@fox-js/fox 3.0.1-3 → 3.0.1-31
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 +3 -1
- package/libs/{index.d.ts → index.esm.d.ts} +1859 -1880
- package/libs/index.esm.js +5064 -1
- package/libs/index.umd.js +3 -0
- package/libs/style.css +1 -0
- package/package.json +15 -16
- package/READEME.md +0 -58
- package/libs/index.amd.js +0 -1
- package/libs/index.css +0 -144
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
(function(w,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],b):(w=typeof globalThis<"u"?globalThis:w||self,b(w.Fox={},w.Vue))})(this,function(w,b){"use strict";/*!
|
|
2
|
+
* fox v3.0.0 Sat Nov 11 2023 11:07:54 GMT+0800 (中国标准时间)
|
|
3
|
+
*/const me=typeof window<"u",$=function(){return window},Ve=function(){return window.document};function Wr(n){let e=n,t=e.lastIndexOf("/");return t>0&&t<e.length-1?e=e.substring(0,t+1):t===0&&e.indexOf(".")!==-1?e="/":t===-1&&(e.indexOf(".")==-1?e=`/${e}/`:e="/"),e.indexOf("/")!==0&&(e=`/${e}`),e}function at(){if(!me)return"/";let n=$().location,e=`${n.protocol}//${n.host}`;return e+=Wr(n.pathname),e}function ut(n,e,t){n.addEventListener?n.addEventListener(e,t,!1):n.attachEvent?n.attachEvent(`on${e}`,t):n[`on${e}`]=t}function ft(n,e,t){n.removeEventListener?n.removeEventListener(e,t):n.detachEvent?n.detachEvent(`on${e}`,t):n[`on${e}`]=null}const zr=Array.isArray,Jr=n=>Be(n)==="[object Map]",Gr=n=>Be(n)==="[object Set]",Qr=n=>n instanceof Date,S=n=>typeof n=="function",Xr=n=>typeof n=="string",Yr=n=>typeof n=="symbol",tr=n=>n!==null&&typeof n=="object",Zr=n=>tr(n)&&S(n.then)&&S(n.catch),rr=n=>n==null,en=Object.prototype.toString,Be=n=>en.call(n),nr=n=>Be(n)==="[object Object]",tn=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";function ct(n){return n.__esModule||tn&&n[Symbol.toStringTag]==="Module"}const rn=typeof Promise<"u"&&Promise.toString().indexOf("[native code]")!==-1;function K(...n){let e=n[0]!==void 0&&n[0]!==null?n[0]:{},t=1,r=n.length,s=!1;for(typeof e=="boolean"&&(s=e,e=n[t]??{},t++),typeof e!="object"&&(e={});t<r;t++)if(n[t]!==null&&n[t]!==void 0){let i=n[t];for(let o in i){let a=e[o],l=i[o];if(a!==l)if(s===!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(s,u,l)}else l!==void 0&&(e[o]=l)}}return e}function ke(n,e,t=!1){if(!t)K(!0,n,e);else{if(typeof e!="object")return{};typeof n!="object"&&(n={});for(let r of Reflect.ownKeys(e)){let s=n[r],i=e[r];if(s!==i)if(typeof i=="object"){if(!Array.isArray(i)&&!nr(i))continue;s=ke(s,i,t),n[r]=s}else{if(typeof i=="function")continue;n[r]=i}}}return n}class se{static seed=new Date().getTime();static get(){let e=++se.seed;return e>=Number.MAX_VALUE&&(se.seed=0),e}}const ht=rn?Promise.resolve():null;function Ee(n,...e){ht!==null?e&&e.length>0?ht.then(()=>{n(e)}):ht.then(n):e&&e.length>0?setTimeout(()=>{n(e)}):setTimeout(n)}function yt(n){return n==null?!1:typeof n=="boolean"?n:typeof n=="string"?n.toLocaleLowerCase()==="true":!!n}function nn(n){return typeof n=="number"?n:Number(n)}const sn={"[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 dt(n){let t=Object.prototype.toString.call(n);return n==null?String(n):sn[t]||"object"}function mt(n,e){if(n==e)return!0;if(n===void 0||e===void 0)return!1;let t=dt(n),r=dt(e);if(t!==r)return!1;if(t==="object"){let s=Object.keys(n),i=Object.keys(e);if(s.length!==i.length)return!1;for(let o=0;o<s.length;o++){let a=s[o],l=n[a],u=e[a];if(!mt(l,u))return!1}return!0}else if(t==="array"){if(n.length!==e.length)return!1;for(let s=0;s<n.length;s++){let i=n[s],o=e[s];if(!mt(i,o))return!1}return!0}return!1}const sr=n=>{const e={};for(let t of Reflect.ownKeys(n)){let r=n[t];r&&!Array.isArray(r)&&typeof r=="object"&&(r=sr(r)),typeof t=="symbol"?e[String(t)]=r:e[t]=r}return e},on=/^Symbol\((.*)\)$/,ir=n=>{const e={};for(let t of Reflect.ownKeys(n)){let r=n[t];r&&!Array.isArray(r)&&typeof r=="object"&&(r=ir(r));const s=on.exec(t);if(s&&s[1]){const i=Symbol.for(s[1]);e[i]=r}else e[t]=r}return e},or=Symbol("idKey"),ue=Symbol("valueKey"),P=Symbol("childrenKey"),z=Symbol("growKey");class lr{[z]=!0;[or];[ue]=b.ref();[P]=new Map;constructor(e){this[or]=e}}class ln{get(e,t){if(t=="value")return e[ue].value;if(t==="grow")return e[z];let r=e[P].get(t);if(r)return Ae(r);if(e[z])return r=gt(t),r[z]=e[z],e[P].set(t,r),Ae(r)}set(e,t,r){return t=="value"?(e[ue].value=r,!0):t==="grow"?(e[z]=yt(r),!0):r==null?(e[P].delete(t),!0):(console.error(`illegal property:${t}`),!1)}deleteProperty(e,t){return t==="value"||t=="grow"?(console.error(`can not delete property:${String(t)}`),!1):(e[P].delete(t),!0)}}const pt="__proxy__";function gt(n){const e=new lr(n);return Reflect.set(e,pt,new Proxy(e,new ln)),e}function Ae(n){return Reflect.get(n,pt)}class an{name="";persistPolicy="momery";storage;initFlag=!1;state={};constructor(e={}){if(e.persistPolicy&&e.persistPolicy!=="momery"&&rr(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(me){const t=$();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}`,s=t.getItem(r);s&&(this.state=JSON.parse(s),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("/"),s=e[t-1];this.state[r]=s,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("/"),s={};Reflect.ownKeys(this.state).forEach(o=>{typeof o=="string"&&(o===r||o.startsWith(r)||(s[o]=this.state[o]))}),this.state=s,this.saveState()}catch(t){console.error(t)}}clear(){if(this.initFlag)try{this.state={},this.removeState()}catch(e){console.error(e)}}}class ar extends lr{_persistHandler;constructor(e={}){super("__root__"),this._persistHandler=new an(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 s=0;s<t-1;s++){let i=e[s],o;r[P].has(i)?o=r[P].get(i):(o=gt(i),r[P].set(i,o)),r=o}return r[ue].value=e[t-1],this._persistHandler.put(e),!0}get(...e){let t=e.length;if(t===0)return;let r=this;for(let s=0;s<t;s++){let i=e[s];if(r[P].has(i))r=r[P].get(i);else return}return r[ue].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[P].has(o))r=r[P].get(o);else return!1}const s=e[t-1];return r[P].has(s)?(r[P].delete(s),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[P].has(o))r=r[P].get(o);else return!1}const s=e[t-1];return r[P].has(s)}clear(){this[P].clear(),this._persistHandler.clear()}}const un=["put","get","contains","remove","clear","_persistHandler"];function ur(n){return un.includes(n)}class fn{get(e,t){if(t=="value")return e[ue].value;if(t==="grow")return e[z];if(t===P)return e[P];if(typeof t=="string"&&ur(t))return e[t];let r=String(t),s=e[P].get(r);if(s)return Ae(s);if(e[z])return s=gt(r),s[z]=e[z],e[P].set(r,s),Ae(s)}set(e,t,r){return t=="value"?(e[ue].value=r,!0):t==="grow"?(e[z]=yt(r),!0):ur(t)?!1:r==null?(e[P].delete(t),!0):(console.error(`illegal property:${t}`),!1)}deleteProperty(e,t){return t==="value"||t=="grow"?(console.error(`can not delete property:${String(t)}`),!1):(e[P].delete(t),!0)}}function cn(n){const e=new ar(n),t=new fn,r=new Proxy(e,t);return Reflect.set(e,pt,r),e}const vt=new Proxy(ar,{construct(n,e){const t=cn(e[0]??{});return Ae(t)}}),Y="default",fr=Symbol("sync"),N=Symbol("resolveRoute");function cr(n){let e=!1;return function(...t){if(!e)return e=!0,Reflect.apply(n,{},t)}}function hn(n){let e=n.src;return new Promise((t,r)=>{const s=cr(a=>{ct(a)&&(a=a.default),n.component=a,console.debug("success load async module"),t()}),i=cr(a=>{console.debug("reject load async module"),r(a)});let o;try{o=e(s,i)}catch(a){i(a)}if(o)if(typeof o.then=="function")o.then(s,i);else{const a=o.component;a&&typeof a.then=="function"&&a.then(s,i)}})}class yn{name;level;rootName;rootIndex=0;constructor(e,t,r,s){this.name=e,this.level=t,this.rootName=r,this.rootIndex=s}}class Ue{to;routeModel;from;data={};constructor(e,t){this.to=e,this.from=t}static from(e){let t=new Ue(e.to,e.from),r=e.data??{};return K(!0,t.data,r),t}}class C{path;get fullPath(){const e=this.path??`/${this.name}`;return`${this.root??Y}!${e}`}alias;name;root;params;query;traceless;template;matched;meta;success;error;destroy;opsType;updateType;viewTagAttrs;index;active;slot;session;static clone(e,t){let r=new C;return ke(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 C;if(e==null)return t;let r=t;for(let i in e){let o=e[i];r[i]=o}const s=Object.getOwnPropertySymbols(e);if(Array.isArray(s)&&s.length>0)for(let i of s)r[i]=e[i];return t}}class dn{id;name;props;meta;src;component;constructor(e,t,r,s){this.id=se.get(),this.name=e,this.src=t,typeof t!="function"&&(this.component=t),this.props=r,this.meta=s}get isResolved(){return this.component!==void 0}resolve(){return hn(this)}}class hr{models=[]}class wt{path;match;redirect;name;layers=[]}const B=Symbol("chainKey"),I=Symbol("cursorKey"),bt=Symbol("$persistentModeKey"),T=Symbol("statusKey"),Z=Symbol("argsKey"),We=Symbol("exArgsKey"),pe=Symbol("successFnsKey"),Fe=Symbol("errorFnsKey"),ie=Symbol("sessionKey"),ee=Symbol("_go");class _e{[B]=[];[I]=0;[bt]=!1;[T]="Free";[Z]=[];[We]=[];[pe]=[];[Fe]=[];[ie];get session(){return this[ie]}constructor(e,t=!1){this[ie]=e,this[bt]=t}[ee](e,...t){let r=this[T];if(this[T]="Busy",this[I]+=e,this[I]<0&&(this[I]=0),this[Z]=t,r==="Exception"||r==="Reject"){let a=[{session:this[ie]},...this[We]];for(;this[Fe].length>0;)try{let l=this[Fe].shift();typeof l=="function"&&Ee(()=>{Reflect.apply(l,{},a)})}catch(l){console.error(l.message,l)}return this[T]=r,this[B]=[],this[I]=0,this}else if(r==="Finished"||this[I]>=this[B].length){let a=[{session:this[ie]},...this[Z]];for(;this[pe].length>0;){let l=this[pe].shift();typeof l=="function"&&Ee(()=>{Reflect.apply(l,{},a)})}return this[T]="Free",this}if(this[I]>=this[B].length)return this[T]="Free",this;let s=this[B][this[I]];this[bt]||(this[B].splice(0,this[I]+1),this[I]=-1);let i=this[I]+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[ie]};Ee(()=>{Reflect.apply(s,{},[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[We]=e,Reflect.apply(this[ee],this,[0])}throw(...e){return this[T]="Exception",this[We]=e,Reflect.apply(this[ee],this,[0])}reset(...e){this[T]="Busy",this[Z]=e,this[B]=[],this[I]=0;let r=[{session:this[ie]},...this[Z]];for(;this[pe].length>0;){let s=this[pe].shift();Ee(()=>{Reflect.apply(s,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[pe].push(e),t&&typeof t=="function"&&this[Fe].push(t),this[T]==="Busy"?this:(Reflect.apply(this[ee],this,[0,...this[Z]]),this)}exception(e){return e&&typeof e=="function"&&this[Fe].push(e),this[T]==="Busy"?this:Reflect.apply(this[ee],this,[0,...this[Z]])}isFinish(){return this[T]=="Reject"||this[T]=="Free"&&this[I]>=this[B].length}}const ge=Symbol("registerKey");class mn{policy;callback;constructor(e,t){this.callback=e,this.policy=t}}class Rt{[ge]=new Map;constructor(){}on(e,t,r=!1){let s=this[ge].get(e);s||(s=new Array,this[ge].set(e,s));let i=r===!0?1:0,o=new mn(t,i);return s.push(o),this}off(e,t){if(!t)return this[ge].delete(e),this;let r=this[ge].get(e);if(r){for(let s=0;s<r.length;s++)if(r[s].callback===t){r.splice(s,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 s=t-1,i=new Array(s),o=[].splice.call(e,0,s);for(let a=0;a<o.length;a++)this.once(o[a],l=>{i[a]=l,s-=1,s==0&&Reflect.apply(r,{},i)});return this}emit(e,...t){let r=this[ge].get(e);if(!r)return this;for(let s=0;s<r.length;){let i=r[s];if(i.policy==1?r.splice(s,1):s++,typeof i.callback=="function")try{Ee(()=>{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 Ke=Symbol("registerKey");class pn{[Ke]=new Map;constructor(){}set(e,t){this[Ke].set(e,t)}get(e){return this[Ke].get(e)}has(e){return this[Ke].has(e)}delete(e){return this[Ke].delete(e)}}const fe=Symbol("lc");function ze(n,e=!1){let t=n;if(Reflect.has(t,fe))return t[fe];if(e){const r=new pn;return t[fe]=r,r}return null}function yr(n,e=!1){let t=null,r=n;for(;r&&!(Reflect.has(r,fe)&&(t=r[fe],t));)r=r.$parent;if(!t&&e){const s=n;s&&s.$parent&&(t=ze(s.$parent,e))}return t}function xt(n,e){let t=n;for(;t;){if(Reflect.has(t,fe)){const r=t[fe];if(r.has(e))return r.get(e)}t=t.$parent}return null}function gn(n,e,t){yr(n,!0)?.set(e,t)}function vn(n,e){yr(n,!0)?.delete(e)}function dr(n){if(Array.isArray(n.children)&&n.children.length>0){let e=n.children[0];if(e!=null&&e.component!=null&&e.component.proxy!=null)return ze(e.component.proxy,!1)}return null}const Je=Symbol("hooksKey");function wn(n){let e=n.get(Je);e||(e=[],n.set(Je,e))}function mr(n,e){let t=n.get(Je);if(t!=null)for(let r=t.length-1;r>=0;r--){let s=t[r];if(s.type===e)try{Reflect.apply(s.hook,s.target,[])}catch(i){console.error(i.message,i)}}}var St=(n=>(n.DEACTIVATED="da",n.ACTIVATED="a",n))(St||{});class bn{type;hook;target;constructor(e,t,r){this.target=r,this.hook=t,this.type=e}}function Rn(n,e,t,r){let s=new bn(e,t,r);return n.push(s),!0}function xn(n,e,t,r){let s=-1;for(let i=0;i<n.length;i++){let o=n[i];if(o.type===e&&o.hook===t&&o.target===r){s=i;break}}return s!=-1?(n.splice(s,1),!0):!1}function pr(n){return(e,t)=>{let r;if(t)r=t;else{const i=b.getCurrentInstance();if(i==null||i.proxy==null){console.error("can not get current instance or proxy");return}r=i.proxy}const s=xt(r,Je);if(s==null){console.warn("can not get hooks context");return}b.onUnmounted(()=>{xn(s,n,e,r)}),Rn(s,n,e,r)}}const Sn=pr("a"),Pn=pr("da"),Pt=Symbol("routeKey");function gr(n,e){n.set(Pt,e)}function Ct(n){let e=xt(n,Pt);return typeof e=="function"?e():e??null}const Ge=Symbol("rk"),Et=Symbol("vd"),vr=Symbol("rv"),At=Symbol("rvi"),wr=Symbol("pv"),Ft=Symbol("pvi");function Cn(n){for(var e=[],t=0;t<n.length;){var r=n[t];if(r==="*"||r==="+"||r==="?"){e.push({type:"MODIFIER",index:t,value:n[t++]});continue}if(r==="\\"){e.push({type:"ESCAPED_CHAR",index:t++,value:n[t++]});continue}if(r==="{"){e.push({type:"OPEN",index:t,value:n[t++]});continue}if(r==="}"){e.push({type:"CLOSE",index:t,value:n[t++]});continue}if(r===":"){for(var s="",i=t+1;i<n.length;){var o=n.charCodeAt(i);if(o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122||o===95){s+=n[i++];continue}break}if(!s)throw new TypeError("Missing parameter name at ".concat(t));e.push({type:"NAME",index:t,value:s}),t=i;continue}if(r==="("){var a=1,l="",i=t+1;if(n[i]==="?")throw new TypeError('Pattern cannot start with "?" at '.concat(i));for(;i<n.length;){if(n[i]==="\\"){l+=n[i++]+n[i++];continue}if(n[i]===")"){if(a--,a===0){i++;break}}else if(n[i]==="("&&(a++,n[i+1]!=="?"))throw new TypeError("Capturing groups are not allowed at ".concat(i));l+=n[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:n[t++]})}return e.push({type:"END",index:t,value:""}),e}function br(n,e){e===void 0&&(e={});for(var t=Cn(n),r=e.prefixes,s=r===void 0?"./":r,i="[^".concat(ve(e.delimiter||"/#?"),"]+?"),o=[],a=0,l=0,u="",f=function(_){if(l<t.length&&t[l].type===_)return t[l++].value},h=function(_){var A=f(_);if(A!==void 0)return A;var F=t[l],Q=F.type,D=F.index;throw new TypeError("Unexpected ".concat(Q," at ").concat(D,", expected ").concat(_))},c=function(){for(var _="",A;A=f("CHAR")||f("ESCAPED_CHAR");)_+=A;return _};l<t.length;){var y=f("CHAR"),m=f("NAME"),p=f("PATTERN");if(m||p){var d=y||"";s.indexOf(d)===-1&&(u+=d,d=""),u&&(o.push(u),u=""),o.push({name:m||a++,prefix:d,suffix:"",pattern:p||i,modifier:f("MODIFIER")||""});continue}var g=y||f("ESCAPED_CHAR");if(g){u+=g;continue}u&&(o.push(u),u="");var v=f("OPEN");if(v){var d=c(),q=f("NAME")||"",x=f("PATTERN")||"",O=c();h("CLOSE"),o.push({name:q||(x?a++:""),pattern:q&&!x?i:x,prefix:d,suffix:O,modifier:f("MODIFIER")||""});continue}h("END")}return o}function En(n,e){return An(br(n,e),e)}function An(n,e){e===void 0&&(e={});var t=_t(e),r=e.encode,s=r===void 0?function(l){return l}:r,i=e.validate,o=i===void 0?!0:i,a=n.map(function(l){if(typeof l=="object")return new RegExp("^(?:".concat(l.pattern,")$"),t)});return function(l){for(var u="",f=0;f<n.length;f++){var h=n[f];if(typeof h=="string"){u+=h;continue}var c=l?l[h.name]:void 0,y=h.modifier==="?"||h.modifier==="*",m=h.modifier==="*"||h.modifier==="+";if(Array.isArray(c)){if(!m)throw new TypeError('Expected "'.concat(h.name,'" to not repeat, but got an array'));if(c.length===0){if(y)continue;throw new TypeError('Expected "'.concat(h.name,'" to not be empty'))}for(var p=0;p<c.length;p++){var d=s(c[p],h);if(o&&!a[f].test(d))throw new TypeError('Expected all "'.concat(h.name,'" to match "').concat(h.pattern,'", but got "').concat(d,'"'));u+=h.prefix+d+h.suffix}continue}if(typeof c=="string"||typeof c=="number"){var d=s(String(c),h);if(o&&!a[f].test(d))throw new TypeError('Expected "'.concat(h.name,'" to match "').concat(h.pattern,'", but got "').concat(d,'"'));u+=h.prefix+d+h.suffix;continue}if(!y){var g=m?"an array":"a string";throw new TypeError('Expected "'.concat(h.name,'" to be ').concat(g))}}return u}}function Fn(n,e){var t=[],r=Rr(n,t,e);return _n(r,t,e)}function _n(n,e,t){t===void 0&&(t={});var r=t.decode,s=r===void 0?function(i){return i}:r;return function(i){var o=n.exec(i);if(!o)return!1;for(var a=o[0],l=o.index,u=Object.create(null),f=function(c){if(o[c]===void 0)return"continue";var y=e[c-1];y.modifier==="*"||y.modifier==="+"?u[y.name]=o[c].split(y.prefix+y.suffix).map(function(m){return s(m,y)}):u[y.name]=s(o[c],y)},h=1;h<o.length;h++)f(h);return{path:a,index:l,params:u}}}function ve(n){return n.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function _t(n){return n&&n.sensitive?"":"i"}function Kn(n,e){if(!e)return n;for(var t=/\((?:\?<(.*?)>)?(?!\?)/g,r=0,s=t.exec(n.source);s;)e.push({name:s[1]||r++,prefix:"",suffix:"",modifier:"",pattern:""}),s=t.exec(n.source);return n}function Tn(n,e,t){var r=n.map(function(s){return Rr(s,e,t).source});return new RegExp("(?:".concat(r.join("|"),")"),_t(t))}function $n(n,e,t){return jn(br(n,t),e,t)}function jn(n,e,t){t===void 0&&(t={});for(var r=t.strict,s=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(D){return D}:u,h=t.delimiter,c=h===void 0?"/#?":h,y=t.endsWith,m=y===void 0?"":y,p="[".concat(ve(m),"]|$"),d="[".concat(ve(c),"]"),g=o?"^":"",v=0,q=n;v<q.length;v++){var x=q[v];if(typeof x=="string")g+=ve(f(x));else{var O=ve(f(x.prefix)),_=ve(f(x.suffix));if(x.pattern)if(e&&e.push(x),O||_)if(x.modifier==="+"||x.modifier==="*"){var A=x.modifier==="*"?"?":"";g+="(?:".concat(O,"((?:").concat(x.pattern,")(?:").concat(_).concat(O,"(?:").concat(x.pattern,"))*)").concat(_,")").concat(A)}else g+="(?:".concat(O,"(").concat(x.pattern,")").concat(_,")").concat(x.modifier);else x.modifier==="+"||x.modifier==="*"?g+="((?:".concat(x.pattern,")").concat(x.modifier,")"):g+="(".concat(x.pattern,")").concat(x.modifier);else g+="(?:".concat(O).concat(_,")").concat(x.modifier)}}if(l)s||(g+="".concat(d,"?")),g+=t.endsWith?"(?=".concat(p,")"):"$";else{var F=n[n.length-1],Q=typeof F=="string"?d.indexOf(F[F.length-1])>-1:F===void 0;s||(g+="(?:".concat(d,"(?=").concat(p,"))?")),Q||(g+="(?=".concat(d,"|").concat(p,")"))}return new RegExp(g,_t(t))}function Rr(n,e,t){return n instanceof RegExp?Kn(n,e):Array.isArray(n)?Tn(n,e,t):$n(n,e,t)}var j=(n=>(n[n.Push=0]="Push",n[n.Replace=1]="Replace",n[n.Put=2]="Put",n[n.Append=3]="Append",n[n.Open=4]="Open",n))(j||{}),Qe=(n=>(n[n.Part=0]="Part",n[n.All=1]="All",n))(Qe||{});const J=Symbol("rootKey"),G=Symbol("rootNodeKey"),ce=Symbol("parentNodeKey"),Xe=Symbol("nameKey");class oe{instance=null;model;route;active=!0;index=0;constructor(e,t,r=0,s=!0){this.route=e,this.model=t,this.index=r,this.active=s}}class Te{_slots;get slots(){return this._slots==null&&(this._slots=b.shallowRef([])),this._slots}get empty(){return this._slots==null||this._slots.value.length==0}[Xe];[J];[G]=null;[ce]=null;get name(){return this[Xe]}constructor(e,t,r){this[Xe]=e,this[J]=t,r&&(this[G]=r)}}class k{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 s=e[r];if(s.view===t.view&&(t.index==-1||s.index===t.index)&&s.level===t.level)return!0}return!1}}class Kt{views=[]}class qn{layers=[]}class On{time;route}class Ln{forbidTime=300;submitRecorder=new On;isSameRoute(e,t){return e==null||t==null?!1:e.name===t.name&&e.path===t.path&&e.root===t.root}acquire(e){let t=new Date().getTime();if(this.isSameRoute(e,this.submitRecorder.route)&&this.submitRecorder.time&&t-this.submitRecorder.time<=this.forbidTime){this.submitRecorder.time=t;return}return this.submitRecorder.route=e,this.submitRecorder.time=t,t}release(e){this.submitRecorder.time===e&&(this.submitRecorder.route=void 0)}}const we=Symbol("_notifyChange");class xr{currentRoute;routes;constructor(e,t){this.currentRoute=e,this.routes=t}}const he=Symbol("historyChangeConsumerKey"),Sr=Symbol("_navigateFirstRoute"),Ye=Symbol("_getRouteMark"),Tt=Symbol("_getUrlSearch"),$t=Symbol("_generateLocation"),$e=Symbol("_setRouteMarkRecorder"),je=Symbol("beforeRestoreFiltersKey"),Pr=Symbol("_beforeRestore"),Cr="Symbol(_fox_restore_point)";function qe(n,...e){return typeof n=="function"?Reflect.apply(n,null,[...e]):n}function Er(n){if(!Array.isArray(n))return!1;if(n.length===0)return!0;const e=n[0];return!!(Reflect.has(e,"path")&&Reflect.has(e,"root"))}class Ar{base;storage;mode;query;firstNavigate=!0;historyMonitor;traceless=!1;changeHandler;historyChange;[he]=!1;[je]=new Array;backTimeout=320;constructor(e="hash",t="",r="",s=!0,i=!0,o=!1,a,l){this.mode=e,this.base=t,this.query=r,this.firstNavigate=s,this.historyMonitor=i,this.traceless=o,this.storage=a??$().sessionStorage,this.backTimeout=l??320}init(e=!0){const t=$();return typeof this.historyChange!="function"&&(this.historyChange=()=>{if(typeof this[he]=="function"){const r=this[he]();if(this[he]=!1,r)return}else if(this[he]===!0){this[he]=!1;return}if(qe(this.historyMonitor)){const r=t.history.state;this[we](r);try{let s=[];if(typeof r=="string"?s=JSON.parse(r):s=r,Array.isArray(s)&&s.length>0){const i=this[Ye]()??"/";this[$e](i,s)}}catch{}}}),ut(t,"popstate",this.historyChange),this.firstNavigate&&e&&this[Sr](),Promise.resolve()}destroy(){if(this.historyChange){const e=$();ft(e,"popstate",this.historyChange)}}[Pr](e,t,r,s){for(let i of this[je])try{const o=Reflect.apply(i,{},[e,t,r,s]);if(o===!1)return o}catch(o){console.error(o.message,o)}return!0}beforeRestoreEach(e){this[je].push(e)}removeBeforeRestoreEach(e){const t=this[je].indexOf(e);return t!==-1?(this[je].splice(t,1),!0):!1}[Sr](){const e=this[Ye]()??"/",t=this.storage.getItem(Cr);if(t)try{const o=JSON.parse(t);if(o.mark===e&&Array.isArray(o.routes)&&o.routes.length>0){const a=o.routes.filter((l,u)=>(l.params=l.params?ir(l.params):{},this[Pr](l,u,e,o.routes)));if(a.length>0){const l=this[Tt](),u=a.length-1;a[u].query=l||a[u].query,this[we](a);return}}}catch{}const r=e.indexOf("!");let s;r!=-1?s=e.substring(r+1):s=e;const i=new C;i.path=s,i.query=this[Tt](),this[we]([i])}[$e](e,t){try{t.forEach(i=>{i.params=i.params?sr(i.params):{}});const s=JSON.stringify({mark:e,routes:t});this.storage.setItem(Cr,s)}catch(r){console.error(r.message,r)}}setRestorePoint(e){const t=this[Ye]()??"/";this[$e](t,e)}[we](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}[Ye](){const e=$();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}[Tt](){let 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=$();this[he]=t,r.history.go(e)}goBack(e,t){const r=$(),s=r.history.state;if(Er(s)&&s.length>0){let i=0;if(e===null)i=s.length;else for(let h=s.length-1;h>=0;h--){const c=C.from(s[h]);if(!(c.traceless===!0||qe(this.traceless,c))){if(C.isSame(c,e))break;i++}}if(i===0){t();return}let o=s.length-i;if(e!==null&&o===0){t();return}const a=this.backTimeout;let l=null;const u=()=>{r.history.go(-1),l=setTimeout(u,a)};l=setTimeout(u,a);const f=()=>{clearTimeout(l);const c=$().history.state;if(Er(c)&&c.length>0){let y=c.length;const m=c[y-1],p=C.from(m);if(e==null||C.isSame(p,e))return t(),!0;if(y>o){let d=0;for(let g=y-1;g>=0;g--){const v=C.from(c[g]);if(!(v.traceless===!0||qe(this.traceless,v))){if(C.isSame(v,e))break;d++}}if(d===0){t();return}if(o=y-d,o>0)return l=setTimeout(u,a),this.go(-d,f),!0}}return t(),!0};this.go(-i,f)}else t()}push(e){const t=this[$t](e.currentRoute);e.currentRoute.traceless!==!0&&!qe(this.traceless,e.currentRoute)&&$().history.pushState(e.routes,"",t);const r=e.currentRoute.fullPath;this[$e](r,e.routes)}replace(e){const t=this[$t](e.currentRoute);e.currentRoute.traceless!==!0&&!qe(this.traceless,e.currentRoute)&&$().history.replaceState(e.routes,"",t);const r=e.currentRoute.fullPath;this[$e](r,e.routes)}[$t](e){const 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]),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 s=t.location;let i=e.alias??e.fullPath;i.startsWith(Y)&&(i=i.substring(Y.length+1));let o;return r?this.mode=="path"?i.indexOf("/")===0?o=`${this.base}${i}${r}`:o=`${this.base}/${i}${r}`:o=`${s.pathname}${r}#${i}`:this.mode=="path"?i.indexOf("/")===0?o=`${this.base}${i}`:o=`${this.base}/${i}`:o=`${s.pathname}#${i}`,`${s.origin}${o}`}}function Mn(n=!0,e=null,t="",r=!0,s=!1,i){return e!==null&&(e=$().location.pathname),e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),new Ar("path",e??"",t,n,r,s,i)}function Fr(n=!0,e="",t=!0,r=!1,s){return new Ar("hash","",e,n,t,r,s)}class Nn{maxSize=50;cursor=-1;queue=[];changeHandler;base;historyMonitor=!1;traceless=!1;constructor(e,t=50){this.base=e,this.maxSize=t}init(e=!0){return Promise.resolve()}destroy(){this.queue=[]}beforeRestoreEach(e){}removeBeforeRestoreEach(e){return!1}listen(e){this.changeHandler=e}[we](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}go(e,t=!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 s=!1;if(typeof t=="function"?s=t():s=t,!s){const i=this.queue[r];this[we](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 s=this.cursor;s>=0;s--){const i=this.queue[s];if(C.isSame(i.currentRoute,e))break;r++}if(r===0){t();return}this.go(-r,()=>(t(),!0))}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 _r(n="",e=50){return new Nn(n,e)}function bs(n){}const Ze=Symbol("_constructRouteModel"),et=Symbol("_findRouteModel"),jt=Symbol("_findRootView"),Kr=Symbol("_getFirstView"),ye=Symbol("_removeView"),Tr=Symbol("_buildPage"),$r=Symbol("_resolveComponent"),jr=Symbol("_update"),le=Symbol("_merge"),qt=Symbol("_handleHistoryChange"),tt=Symbol("_handleRouteUpdated"),rt=Symbol("routeUpdatedCallback"),R=Symbol("currentRoutes"),be=Symbol("current"),qr=Symbol("_addRouteRecorder"),Oe=Symbol("_removeRouteRecorder"),nt=Symbol("_cloneRouteRecorder"),L=Symbol("_handleError"),st=Symbol("errorCallback"),U=Symbol("registerKey"),it=Symbol("notFoundKey"),Ot=Symbol("notFoundPathKey"),W=Symbol("forestKey"),E=Symbol("historyKey"),Le=Symbol("beforeFiltersKey"),Me=Symbol("afterFiltersKey"),Ne=Symbol("destroyFiltersKey"),Lt=Symbol("propsFilterKey"),Re=Symbol("mainDispatcherKey"),Mt=Symbol("initKey"),de=Symbol("readyKey"),Nt=Symbol("readyHandlersKey"),ot=Symbol("_markReady"),Or=Symbol("_createNextFn"),It=Symbol("_start"),Ht=Symbol("_before"),Dt=Symbol("_after"),Lr=Symbol("_destroy"),Vt=Symbol("_load"),Ie=Symbol("_unload"),He=Symbol("routerGuardKey");function In(n){return n.layers.length==0||n.layers[0].views.length==0}function Hn(n){let e=[];return n.layers.forEach(t=>{t.models==null||t.models==null||t.models.forEach(r=>{if(!(r==null||r==null))if(typeof r.meta=="object"){let s=K(!0,{},r.meta);e.push(s)}else r.meta&&e.push(r.meta)})}),e}class Dn{[U]=new Array;[it];[Ot]="*";[de]=!1;[Nt]=[];[W]=new qn;[E];[R]=new Array;[st]=null;[rt]=null;[Le]=new Array;[Me]=new Array;[Ne]=new Array;[Lt]=null;[Re]=new _e;[He]=new Ln;[Mt]=!1;[be]=b.ref(null);get current(){return this[be].value}options;constructor(e){this.options=e??{},this.options.notFoundPath&&this.setNotFoundPath(this.options.notFoundPath);let t=this.options.routes||[];this.addRoutes(t),this.options.notFound&&this.setNotFoundRoute(this.options.notFound),e.history?this[E]=e.history:this[E]=me?Fr():_r(),this[E]?.listen(async r=>{let s=!0;try{if(typeof r=="string"){const i=this[N](r);i&&await this[qt]([i])}else await this[qt](r)}catch(i){console.error(i.message,i),s=!1}this[de]===!1&&this[ot](s)})}[L](e="error",t){if(t&&typeof t.error=="function")try{t.error(e)}catch{}if(typeof this[st]=="function")try{this[st](e,t)}catch{}console.error(e)}init(){this[Mt]!==!0&&(this[E]?.init(!this[de]),this[Mt]=!0)}isReady(){return this[de]?Promise.resolve():new Promise((e,t)=>{this[Nt].push([e,t])})}[ot](e){this[de]=!0,this[Nt].forEach(([t,r])=>{try{e?t():r()}catch(s){console.error(s.message,s)}})}[qt](e){try{if(!e){let o=[...this[R]].reverse();return this[Ie](o),me&&$().location.reload(),Promise.resolve()}let t=null,r=[],s=[],i=0;for(;i<e.length&&i<this[R].length&&C.isSame(e[i],this[R][i]);i++)e[i].active===!0&&e[i].active!==this[R][i].active&&(t=e[i]);if(i<e.length&&(r=e.slice(i)),i<this[R].length&&(s=this[R].slice(i).reverse()),s.length===0&&r.length===0){if(t!==null)return this.restore([t])}else if(s.length>0){if(this[Ie](s)){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()}[tt](e){if(e)this[be].value=e;else{let t=this[R].length;t>0?this[be].value=this[R][t-1]:this[be].value=null}if(typeof this[rt]=="function")try{this[rt](this[be].value)}catch{}}[qr](e){if(e.opsType===j.Open){let t=!1;const r=this[R].length-1;for(let s=r;s>=0;s--){const i=this[R][s];if(e.root==i.root){if(e.path===i.path){this[R].splice(s,1,e),t=!0;continue}e.active&&(i.active=!1)}}t||this[R].push(e)}else this[R].push(e)}[nt](){let e=[];for(let t of this[R]){let r=C.clone(t,!0);e.push(r)}return e}[Oe](e){if(!this[R])return;let t=-1;for(let r=0;r<this[R].length;r++)if(C.isSame(this[R][r],e)){t=r;break}if(t!=-1){let r=this[R][t];this[R].splice(t,1),this[Lr](r,r.session)}}set historyMonitor(e){this[E]&&(this[E].historyMonitor=e)}get historyMonitor(){return this[E]?this[E].historyMonitor:!1}set traceless(e){this[E]&&(this[E].traceless=e)}get traceless(){return this[E]?this[E].traceless:!1}set propsFilter(e){this[Lt]=e}get propsFilter(){return this[Lt]}setRestorePoint(){const e=this[nt]();this[E]?.setRestorePoint(e)}onRouteUpdated(e){this[rt]=e}onError(e){this[st]=e}beforeEach(e){this[Le].push(e)}removeBeforeEach(e){const t=this[Le].indexOf(e);return t!==-1?(this[Le].splice(t,1),!0):!1}afterEach(e){this[Me].push(e)}removeAfterEach(e){const t=this[Me].indexOf(e);return t!==-1?(this[Me].splice(t,1),!0):!1}destroyEach(e){this[Ne].push(e)}removeDestroyEach(e){const t=this[Ne].indexOf(e);return t!==-1?(this[Ne].splice(t,1),!0):!1}beforeRestoreEach(e){this[E]?.beforeRestoreEach(e)}removeBeforeRestoreEach(e){return this[E]?.removeBeforeRestoreEach(e)??!1}addRoutes(e){for(let t of e)this.addRoute(t)}addRoute(e,t=-1){if(e.path===this[Ot]){this.setNotFoundRoute(e);return}const r=this[Ze](e);if(t==-1)this[U]=[...this[U],...r];else for(let s=r.length-1;s>=0;s--)this[U].splice(t,0,r[s])}removeRoute(e){const t=this[N](e);if(t===null)return console.warn("route格式错误",e),!1;for(let r=0;r<this[U].length;r++){const s=this[U][r];if(t?.path&&s.path===t.path)return this[U].splice(r,1),!0;if(t?.name&&s.name===t.name)return this[U].splice(r,1),!0}return!1}hasRoute(e){const t=this[N](e);return t===null?(console.warn("route格式错误",e),!1):this[U].findIndex(s=>{if(t?.path&&s.path===t.path||t?.name&&s.name===t.name)return!0})!==-1}setNotFoundPath(e){this[Ot]=e}setNotFoundRoute(e){const t=this[Ze](e);this[it]=t[0]}getRoutes(){return[...this[U]]}[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 wt;return a.path=t,a.redirect=e.redirect,[a]}let s=[];for(let a in r){let l=r[a];a.length===0&&(a=Y);let u=new dn(a,l,e.props,e.meta);s.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 f=new wt;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 h=new hr;h.models=[...s],f.layers=[h,...u.layers],o.push(f)}}if(!i){const a=new hr;a.models=s;const l=new wt;l.name=e.name,l.path=t,l.layers=[a],o.splice(0,0,l)}return o}[et](e){const t=e.route;try{for(let r of this[U]){const s=t.template??t.path,i=t.template??t.name;if(s&&r.path){let o=r.match;o||(o=r.match=Fn(r.path));const a=o(s);if(!a)continue;if(r.redirect){const l=new C;K(!0,l,t),l.path=r.redirect;const u={route:l,find:void 0};return this[et](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={},f=l.split("&");for(let h of f){const c=h.split("=");if(c.length!==2)continue;const y=decodeURIComponent(c[0].trim()),m=decodeURIComponent(c[1].trim());u[y]=m}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=En(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}[N](e){let t=null;if(Array.isArray(e))if(t=new C,typeof e[0]=="object")t=C.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=C.from(e):typeof e=="string"&&(t=new C,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??Y,t.opsType=t.opsType??this.options.defaultOperationType??j.Push}return t}push(...e){let t=this[N](e);return t?(t.opsType=t.opsType||j.Push,this.to(t)):(this[L]("resolve route fail",t),this)}put(...e){let t=this[N](e);return t?(t.opsType=j.Put,t.traceless=!0,this.to(t)):(this[L]("resolve route fail",t),this)}replace(...e){let t=this[N](e);return t?(t.opsType=j.Replace,this.to(t)):(this[L]("resolve route fail",t),this)}append(...e){let t=this[N](e);return t?(t.opsType=j.Append,this.to(t)):(this[L]("resolve route fail",t),this)}remove(e,t){return new Promise(r=>{this[Re].post(s=>{try{if(this[R].length===0){s.resolve(),r(!1);return}let i=-1,o,a=[];if(e){if(e.root?o=e.root:o=this[R][0].root??Y,e.all)for(let u=this[R].length-1;u>0;u--){let f=this[R][u];f.opsType===j.Append&&f.root===o&&(a.splice(0,0,f),i=u-1)}else if(e.until)for(let u=this[R].length-1;u>0;u--){let f=this[R][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=Y;let u=this[Kr](this[W]);u&&(o=u.name);for(let f=this[R].length-1;f>0;f--){let h=this[R][f];if(h.opsType===j.Append&&h.root===o){a.push(h),i=f-1;break}}}if(a.length===0){let u="can not find route";console.warn(u),s.resolve(u),r(!1);return}let l=null;if(i!==-1&&(l=this[R][i]),this[Ie](a)){if(t===!1)return s.resolve(),r(!0),!0;const u=this[R].length,f=()=>(s.resolve(),r(!0),!0);if(l&&u>0&&C.isSame(l,this[R][u-1])){this[E]?.goBack(l,f);return}if(l===null&&u===0){this[E]?.goBack(null,f);return}f()}}catch(i){this[L](i),s.resolve(),r(!1)}})})}open(...e){let t=this[N](e);return t?(t.opsType=j.Open,this.to(t)):(this[L]("resolve route fail",t),this)}close(e){return this[Re].post(t=>{try{let r=this[N](e);if(!r){t.reject("resolve route fail");return}let s=[];for(let i=0;i<this[R].length;i++){let o=this[R][i];if(o.root===r.root){if(!r.path&&!r.name){s.push(o);continue}if(r.path&&r.path===o.path){s.push(o);break}else if(r.name&&r.name===o.name){s.push(o);break}}}if(s.length===0){t.resolve();return}this[Ie](s)&&this[tt](),t.resolve()}catch(r){this[L](r),t.resolve()}}),this}to(...e){let t=this[N](e);if(!t)return this[L]("resolve route fail",t),this;let r=this[He].acquire(t);return r==null?(this[L]("route forbid",t),this):(this[Re].post(s=>{try{let i=this[It](t);this[Ht](i),this[Vt](i),this[Dt](i),i.wait((o,a)=>{const l=o.session.to;if(o.session.updateResult&&o.session.updateResult.status==="success")try{let u=C.clone(l,!0);const f=new xr(u,this[nt]());l.opsType===j.Replace?this[E]?.replace(f):this[E]?.push(f)}catch(u){console.error(u.message,u)}if(this[He].release(r),this[tt](l),typeof t.success=="function")try{Reflect.apply(t.success,{},[])}catch(u){console.error(u.message,u)}this[de]===!1&&this[ot](!0),s.resolve()},(o,a)=>{this[He].release(r),a!==null&&this[L](a,t),this[de]===!1&&this[ot](!1),s.resolve()})}catch(i){this[He].release(r),this[L](i,t),s.resolve()}}),this)}back(e=1){this[E]?.go(-e,!1)}[Or](e){return(t,r)=>{if(typeof t=="boolean")e.session.redirect=!1,t?e.resolve():e.reject(r??null);else if(t){const s=this[N](t);if(s){const i=e.session.to;s.success=i.success,s.error=i.error,e.session.to=s,e.session.redirect=!0,e.session.routeModel=null,e.resolve()}else e.session.redirect=!1,e.reject("route resolve fail")}else e.session.redirect=!1,e.resolve()}}[It](e){let t=this[R].length>0?this[R][0]:void 0,r=new Ue(e,t),s={route:e,find:null};return this[et](s),s.find&&(r.routeModel=s.find,e.matched=Hn(s.find),Array.isArray(e.matched)&&e.matched.length>0&&(e.meta=s.find.layers[0].models[0].meta)),new _e(r)}[Ht](e){for(let t of this[Le])e.post(r=>{const s=this[Or](r);Reflect.apply(t,{},[r.session.to,r.session.from,s,r.session])})}[Dt](e){e.post(t=>{for(let r of this[Me])try{Reflect.apply(r,{},[t.session.to,t.session.from,t.session])}catch(s){console.error(s.message,s)}t.resolve()})}[Lr](e,t){for(let r of this[Ne])try{Reflect.apply(r,{},[e,t])}catch(s){console.error(s.message,s)}typeof e.destroy=="function"&&Reflect.apply(e.destroy,e,[])}[Vt](e){e.post(t=>{let r=t.session.to,s=t.session.routeModel;if(s==null){let o={route:r,find:null};if(this[et](o))s=o.find,t.session.routeModel=s;else if(this[it])s=this[it];else{t.reject(`not find route model, path:${r.path??r.name}`);return}}let i=Ue.from(t.session);this[Tr](r,s,i).then(o=>{this[W],t.session.updateResult=o??{status:"success",message:""},t.resolve()},o=>{t.reject(o)})})}[Ie](e){if(e.length==0)return!0;let t=this[W],r=[];for(let s of e){let i=this[jt](t,s);i!=null&&r.push({...i,route:s})}if(r.length==0){let s="can not find view index";return this[L](s),!1}for(let s of r.reverse())this[ye](t,{x:s.x,y:s.y},[s.route.index??0],!0);return!0}[jt](e,t){const r=t.root??Y;let s;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[J]&&l[Xe]===r)return s={x:a,y:i},s}}return null}[Kr](e){return e.layers.length>0&&e.layers[0].views.length>0?e.layers[0].views[0]:null}[ye](e,t,r=null,s=!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 h=u.length-1;h>=0;h--){let c=u[h];(!r||r.indexOf(c.index)!=-1)&&(c.route&&i[J]&&(this[Oe](c.route),c.active===!0&&c.route.opsType==j.Append&&(l=!0)),a.push(new k(i,c.index,t.y)),u.splice(h,1))}if(u.length==0)s?i.slots.value=u:e.layers[t.y].views.splice(t.x,1);else{if(l){let h=u.length-1,c=u[h];c.active=!0,c.route&&(c.route.active=c.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 h=e.layers[f].views,c=[];for(let y=h.length-1;(o||a.length>0)&&y>=0;y--){let m=h[y];if(m[ce]&&(o||k.include(a,m[ce]))){let p=m.slots.value;for(let d=p.length-1;d>=0;d--){let g=p[d];g.route&&m[J]&&this[Oe](g.route),c.push(new k(m,g.index,f)),p.splice(d,1)}e.layers[f].views.splice(y,1)}}a=c,e.layers[f].views.length==0&&(o=!0)}}restore(e){if(!e||this[U].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[R]=[],this[tt](),Promise.resolve()}else return new Promise((r,s)=>{let i=null,o=!1;for(let a=0;a<e.length;a++){const l=e[a];this[Re].post(u=>{const f=this[It](l);this[Ht](f),this[Vt](f),this[Dt](f),f.wait((h,c)=>{i=h.session.to,o=h.session.redirect,u.resolve()},(h,c)=>{i=null,c!==null&&this[L](c),u.resolve()})})}this[Re].post(a=>{if(i&&o===!0){const l=C.clone(i,!0),u=new xr(l,this[nt]());this[E]?.replace(u)}a.resolve(),r()})})}[Tr](e,t,r){const s=e.updateType??Qe.Part;return this[$r](t).then(()=>{const o=this[jr](t,e,r,s);if(o.status==="error")throw Error(o.message);return o})}[$r](e){let t=[];for(let r=0;r<e.layers.length;r++){let s=e.layers[r];for(let i=0;i<s.models.length;i++){let o=s.models[i];o.isResolved||t.push(o.resolve())}}return t.length>0?Promise.all(t):Promise.resolve()}[jr](e,t,r,s){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=In(o),l=t.root??Y,u;!a&&s==Qe.Part&&(u=this[jt](o,t));let f,h=0;if(u==null||u==null)if(a||s===Qe.All){if(o.layers.length==0&&(o.layers[0]=new Kt),o.layers[0].views.length==0){let c=t.root??Y;f=new Te(c,!0,null),o.layers[0].views=[f]}else f=o.layers[0].views[0];u={x:0,y:0}}else{let c=t.slot;if(!c)return{status:"error",message:"can not rebuild view(because not route slot)"};let y=c.level;if(y>o.layers.length)return{status:"error",message:"can not insert view(override level)"};let m;if(c.rootName){let p=o.layers[y-1];for(let d of p.views){if(d[J]&&d.name===c.rootName){m=new k(d,c.rootIndex??0,y-1);break}if(d[G]&&d[G].view.name===c.rootName&&d[G].index===c.rootIndex){m=d[G];break}}}if(!m)return{status:"error",message:"can not insert view(not find root node ref)"};f=new Te(l,!0,m),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(h=u.y,f[J]=!0,t.opsType===j.Append){t.index=t.index??se.get(),t.active=!0;let c=f.slots.value;if(c.length>0){let g=c[c.length-1];g.active=!1,g.route&&(g.route.active=g.active)}let y=new oe(t,i,t.index,!0);f.slots.value=[...c,y];let m=h+1,p=1,d=new k(f,t.index,h);this[le](o,m,e,p,d)}else if(t.opsType===j.Open){let c=f.slots.value;const y=t.active??!0;let m=!1;for(let p of c){if(p.route!==null&&C.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,m=!0,t.index=p.index,t.active=y,p.route=t}else y&&(p.active=!1);p.route&&(p.route.active=p.active)}if(!m){t.index=t.index??se.get(),t.active=y;let p=new oe(t,i,t.index,y);c.push(p);let d=h+1,g=1,v=new k(f,t.index,h);this[le](o,d,e,g,v)}f.slots.value=[...c]}else{let c=f.slots.value;if(c.length==0){t.index=t.index??se.get(),t.active=!0,f.slots.value=[new oe(t,i,t.index)];let y=h+1,m=1,p=new k(f,t.index,h);this[le](o,y,e,m,p)}else{let y=c[0];if(y.model!==i){this[ye](o,u,null,!0),t.index=t.index??se.get(),t.active=!0,f.slots.value=[new oe(t,i,t.index)];let m=h+1,p=1,d=new k(f,t.index,h);this[le](o,m,e,p,d)}else{y.route!==null&&this[Oe](y.route);let m=!1;const p=t.active??!0;y.active!==p&&(y.active=p,m=!0),t.active=p,t.index=y.index,y.route=t;let d=[];for(let O=1;O<c.length;O++)d.push(c[O].index);d.length>0?this[ye](o,u,d,!0):m&&(f.slots.value=[...c]);let g=[new k(f,t.index,h)],v=h+1,q=1,x=new k(f,t.index,h);for(;g.length>0&&v<o.layers.length&&q<e.layers.length;v++,q++){let O=[];for(let A=0;A<o.layers[v].views.length;A++){let F=o.layers[v].views[A];F[ce]&&k.include(g,F[ce])&&O.unshift(A)}let _=[];for(let A of O){let F=o.layers[v].views[A],Q=e.layers[q].models,D;for(let V=0;V<Q.length;V++)if(F.name===Q[V].name){D=Q[V];break}if(!D)this[ye](o,{x:A,y:v},null,!1);else{let V=F.slots.value;if(V.length==0){let te=0;F.slots.value=[new oe(null,D,te)];let X=v+1,ne=q+1;this[le](o,X,e,ne,x)}else{let te=V[0];if(te.model!==D){this[ye](o,{x:A,y:v},null,!0),F.slots.value=[new oe(null,D,0)];let X=v+1,ne=q+1;this[le](o,X,e,ne,x)}else{F[J]&&te.route!==null&&this[Oe](te.route);let X=[];for(let ne=1;ne<V.length;ne++)X.push(V[ne].index);X.length>0&&this[ye](o,{x:A,y:v},X,!0),_.push(new k(F,te.index,v))}}F[J]=!1}}g=_}this[le](o,v,e,q,x)}}}if(f&&f[G]){let c=f[G];c&&(t.slot=new yn(l,h,c?.view.name,c?.index??0))}return r.to=void 0,r.routeModel=void 0,t.session=r,this[qr](t),{status:"success",message:""}}[le](e,t,r,s,i){let o=s,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 Te(u.name,!1,i),h=new oe(null,u);f.slots.value=[h],l.push(f)}}for(;o<r.layers.length;o++){let l=new Kt;l.views=[];for(let u of r.layers[o].models){let f=new Te(u.name,!1,i),h=new oe(null,u);f.slots.value=[h],l.views.push(f)}e.layers.push(l)}}[fr](e,t,r,s,i,o){if(t<0||t>this[W].layers.length)return null;if(t<this[W].layers.length){let f=this[W].layers[t],h=null;for(let c of f.views){let y=!1;if(r!==null?(y=c.name===e&&c[G]?.view===r,y&&s!==-1&&(y=c[G]?.index===s)):y=c.name===e,!!y){i!==null&&(c[ce]={view:i,index:o,level:t-1}),h=c;break}}if(h!==null)return h}let a=null,l=null;i!==null&&(i[J]?a={view:i,index:o,level:t-1}:a=i[G],l={view:i,index:o,level:t-1});let u=new Te(e,!0,a);if(u[ce]=l,t==this[W].layers.length){let f=new Kt;f.views=[u],this[W].layers.push(f)}else this[W].layers[t].views.push(u);return u}}const Vn="fox-router-view",Bn="fox-router-link";function Mr(n,e=!1){let t=null;return e?t=n.showFromClass??n.enterFromClass:t=n.enterFromClass,t||(t=n.transitionName,t?e?`${t}-show-from`:`${t}-enter-from`:null)}function Nr(n,e=!1){let t=null;return e?t=n.showActiveClass??n.enterActiveClass:t=n.enterActiveClass,t||(t=n.transitionName,t?e?`${t}-show-active`:`${t}-enter-active`:null)}function kn(n,e=!1){let t=null;return e?t=n.showToClass??n.enterToClass:t=n.enterToClass,t||(t=n.transitionName,t?e?`${t}-show-to`:`${t}-enter-to`:null)}function Un(n,e=!1){let t=null;return e?t=n.hideFromClass??n.leaveFromClass:t=n.leaveFromClass,t||(t=n.transitionName,t?e?`${t}-hide-from`:`${t}-leave-from`:null)}function Wn(n,e=!1){let t=null;return e?t=n.hideActiveClass??n.leaveActiveClass:t=n.leaveActiveClass,t||(t=n.transitionName,t?e?`${t}-hide-active`:`${t}-leave-active`:null)}function zn(n,e=!1){let t=null;return e?t=n.hideToClass??n.leaveToClass:t=n.leaveToClass,t||(t=n.transitionName,t?e?`${t}-hide-to`:`${t}-leave-to`:null)}function Jn(n,e=!1){let t=null;return e?t=n.beforeShow??n.beforeEnter:t=n.beforeEnter,t}function Gn(n,e=!1){let t=null;return e?t=n.show??n.enter:t=n.enter,t}function Qn(n,e=!1){let t=null;return e?t=n.afterShow??n.afterEnter:t=n.afterEnter,t}function Xn(n,e=!1){let t=null;return e?t=n.showCancelled??n.enterCancelled:t=n.enterCancelled,t}function Yn(n,e=!1){let t=null;return e?t=n.hide??n.leave:t=n.leave,t}function Zn(n,e=!1){let t=null;return e?t=n.afterHide??n.afterLeave:t=n.afterLeave,t}function es(n,e=!1){let t=null;return e?t=n.hideCancelled??n.leaveCancelled:t=n.leaveCancelled,t}function Bt(n){let e,t=n.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 xe(n,e){n.classList.contains(e)||n.classList.add(e)}function Se(n,e){n.classList.remove(e)}const ts=me&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout;function kt(n){ts(n)}function H(n,e,t){S(e)&&(n==null&&(n={}),Reflect.apply(e,n,t))}function Ir(n,e,t,r=-1,s,i,o,a){if(S(i)){if(s!==void 0&&s>=0){setTimeout(()=>{Reflect.apply(i,n,[e,t,r]),S(a)&&Reflect.apply(a,n,[])},s);return}const l=["animationend","transitionend"],u=f=>{l.forEach(h=>{ft(e,h,u)}),Reflect.apply(i,n,[e,t,r]),a&&Reflect.apply(a,n,[])};l.forEach(f=>{ut(e,f,u)})}if(S(o)){const l="animationcancel",u=f=>{Reflect.apply(o,n,[e,t,r]),ft(e,l,u)};ut(e,l,u)}}function Ut(n){return!me||n===null?!1:n.opsType===j.Append||n.opsType===j.Open}function Hr(n,e,t,r={},s,i=-1){if(e||Ut(s)){const o=Mr(r,e);o&&xe(t,o);const a=Nr(r,e);a&&xe(t,a);const l=Jn(r,e);H(n,l,[t,e,s,i])}}function Dr(n,e,t,r={},s,i,o,a){if(!Ut(i)&&!e){S(a)&&a(n,a,[t]);return}const l=Mr(r,e),u=Nr(r,e),f=kn(r,e),h=Gn(r,e),c=Qn(r,e),y=Xn(r,e);kt(()=>{Ir(n,t,i,o,s,()=>{u&&Se(t,u),f&&Se(t,f),S(c)&&H(n,c,[t,e,i,o]),S(a)&&a(n,a,[t])},()=>{S(y)&&H(n,y,[t,e,i,o])}),l&&Se(t,l),f&&xe(t,f),S(h)&&H(n,h,[t,e,i,o])})}function Vr(n,e,t,r={},s,i,o,a,l){if(!Ut(o)&&!e){!e&&S(i)&&i();return}const u=Un(r,e),f=Wn(r,e),h=zn(r,e),c=Yn(r,e),y=Zn(r,e),m=es(r,e);u&&xe(t,u),f&&xe(t,f),S(c)&&H(n,c,[t,e,o,a]),kt(()=>{Ir(n,t,o,a,s,()=>{f&&Se(t,f),h&&Se(t,h),S(y)&&H(n,y,[t,e,o,a]),S(l)&&H(n,l,[t]),!e&&S(i)&&i()},()=>{S(m)&&H(n,m,[t,e,o,a]),S(l)&&H(n,l,[t]),!e&&S(i)&&i()}),u&&Se(t,u),h&&xe(t,h)})}function Wt(n,e={},t,r=-1){const s=e.mode??"default",i=Bt(e);return{mode:s,persisted:!1,beforeEnter:a=>{Hr(n,!1,a,e,t,r)},enter:a=>{Dr(n,!1,a,e,i.enter,t,r)},leave:(a,l)=>{Vr(n,!1,a,e,i.leave,l,t,r)},clone:a=>Wt(n,e,t,r)}}function Br(n){return n.el}function rs(n,e,t={},r,s,i,o){if(i){const a=Br(e);if(a==null)return;const l=Bt(t);Hr(n,!0,a,t,r,s),Dr(n,!0,a,t,l.show,r,s,u=>{S(o)&&H(n,o,[u])})}else S(o)&&H(n,o,[])}function ns(n,e,t={},r,s,i,o){if(i){const a=Br(e);if(a==null)return;const l=Bt(t);Vr(n,!0,a,t,l.hide,null,r,s,u=>{S(o)&&H(n,o,[u])})}else S(o)&&H(n,o,[])}function ss(n,e={}){kt(()=>{for(let t=0;t<n.length;t++)Reflect.apply(n[t],e,[])})}function ae(n,e,t){return typeof n=="function"?Reflect.apply(n,{},[e,t]):n}function zt(n,e){if(!n)return null;const t=n(e);return t.length===1?t[0]:t}function Pe(n,e){return typeof e=="function"?e(n):n}class is{node;state;constructor(e,t){this.node=e,this.state=t}}const Jt=b.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(n,e){const t=b.getCurrentInstance();if(t===null||t.proxy===null){console.error("instance or instance.proxy not exist");return}const r=n.multi===!0,s=b.inject(Ge,null),i=b.inject(Et,0),o=b.inject(vr,null),a=b.inject(At,-1);let l=null;const u=n.modelSlot;if(u){if(b.provide(Et,i+1),b.provide(At,u.index),b.provide(Ft,u.index),!u.route){console.warn("child view render error, route not exist");return}const c=ze(t.proxy,!0);wn(c),gr(c,()=>u.route??null)}else{if(s==null){console.error("router is not been injected");return}const h=n.name,c=b.inject(wr,null),y=b.inject(Ft,0);if(l=s[fr](h,i,o,a,c,y),l===null)return;b.provide(wr,l);const m=l[J]===!0;if(m&&b.provide(vr,l),!r&&(b.provide(At,-1),b.provide(Et,i+1),b.provide(Ft,-1),m)){const p=ze(t.proxy,!0);gr(p,()=>{const d=l.slots.value;return d.length>0?d[0].route:null})}}const f={value:new Map};return b.onUnmounted(()=>{f.value&&f.value.clear()}),()=>{if(r){const h=new Map,c=[],y=l?.slots.value,m=[];for(let g=0;g<y.length;g++){const v=y[g],q=`${n.name}_${v.index}`,x=ae(n.transition,v.route,g)??!0,O={modelSlot:v};let _;e.slots.default?_=b.h(Jt,O,{default:e.slots.default}):_=b.h(Jt,O);const A={},F=ae(n.viewClass,v.route,g);typeof F=="string"&&F.length>0&&(A[F]=!0);const Q=ae(n.viewActiveClass,v.route,g),D=ae(n.viewInactiveClass,v.route,g),V=f.value.get(q);if(typeof Q=="string"&&Q.length>0&&(A[Q]=v.active),typeof D=="string"&&D.length>0&&(A[D]=!v.active),V&&v.active!==V.state){const re=V.node;v.active?m.unshift(()=>{const er=()=>{let De=dr(re);De!=null&&mr(De,St.ACTIVATED)};rs(t,re,n,v.route,g,x,er)}):m.push(()=>{const er=()=>{const De=dr(re);De!=null&&mr(De,St.DEACTIVATED)};ns(t,re,n,v.route,g,x,er)})}const te={class:A,key:q},X=ae(n.viewTagProps,v.route,g);if(X!==null&&typeof X=="object"){const re=Pe(X,s?.propsFilter);K(!0,te,re)}if(v.route?.viewTagAttrs&&typeof v.route?.viewTagAttrs=="object"){const re=Pe(v.route.viewTagAttrs,s?.propsFilter);K(!0,te,re)}const ne=ae(n.viewTag,v.route,g),Zt=b.h(ne,te,{default:()=>[_]});if(h.set(q,new is(Zt,v.active)),f.value.delete(q),x){const re=Wt(t,n,v.route,g);Zt.transition=re}c.push(Zt)}f.value.forEach(g=>{g.node.transition=null}),f.value=h,ss(m,t);const p=ae(n.tag,null,-1),d={};return Object.assign(d,e.attrs),b.h(p,d,{default:()=>c})}else if(u!=null){const h=u.model,c={};if(h.props){if(typeof h.props=="object"){const m=Pe(h.props,s?.propsFilter);K(!1,c,m)}else if(h.props===!0&&typeof u.route?.params=="object"){const m=Pe(u.route.params,s?.propsFilter);K(!1,c,m)}}const y=b.h(h.component,c);return zt(e.slots.default,{Component:y,route:u.route})??y}else{const h=l.slots.value;if(h.length>0){const c=h[0],y=c.route??(t.proxy&&Ct(t.proxy))??null,m=c.model,p={};if(m.props){if(typeof m.props=="object"){const v=Pe(m.props,s?.propsFilter);K(!1,p,v)}else if(m.props===!0&&typeof y?.params=="object"){const v=Pe(y.params,s?.propsFilter);K(!1,p,v)}}const d=b.h(m.component,p);if(ae(n.transition,y,-1)??!0){const v=Wt(t,n,y,-1);d.transition=v}return zt(e.slots.default,{Component:d,route:y})??d}else return zt(e.slots.fallback,{})}}}});function os(n){if(!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)&&!n.defaultPrevented&&!(n.button!=null&&n.button!==0)){if(n.currentTarget&&n.currentTarget.getAttribute){const e=n.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return n.preventDefault&&n.preventDefault(),!0}}function ls(n,e){return n==null||e==null?!1:!!(n===e||n.path&&n.path===e.path||n.name&&n.name===e.name)}function as(n,e){return n==null||e==null?!1:!!(n.path&&e.path&&e.path.startsWith(n.path)||n.name&&n.name==e.name)}function Ce(n,e){return typeof n=="function"?Reflect.apply(n,{},[e]):n}let us=b.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(n,e){const t=b.inject(Ge,null);return()=>{let r=Ce(n.to,null),s=Ce(n.tag,r);if(s==null){console.warn("can not resolve link tag");return}let i=null,o=null;t!==null&&(i=t[N](r),n.root&&(i.root=n.root),o=t.current);let a={},l=Ce(n.activeClass,i);if(typeof l=="string"&&l.length>0&&(a[l]=as(i,o)),Ce(n.exact,i)===!0){let c=Ce(n.exactActiveClass,i);typeof c=="string"&&c.length>0&&(a[c]=ls(i,o))}let f={class:a};(s==="a"||s==="A")&&(f.href=i?.path??i?.name??"#"),K(!0,f,e.attrs);let h=Ce(n.event,i);if(typeof h=="string"){const c=y=>{if(t==null){console.warn("router is not been injected");return}if(i==null){console.warn("route is not been resolved");return}os(y)&&t.to(i)};f[h]=c}return b.h(s,f,e.slots)}}});var M=(n=>(n[n.Loading=0]="Loading",n[n.Loaded=1]="Loaded",n[n.Defining=2]="Defining",n[n.Defined=3]="Defined",n))(M||{}),lt=(n=>(n[n.normal=0]="normal",n[n.factory=1]="factory",n))(lt||{});class fs{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 kr{moduleManager=new fs;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 Ve().head}constructor(){}setModule(e,t){const r={id:e,src:"",status:M.Defined};typeof t=="function"?(r.exports=t,r.type=lt.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 s={};typeof e[r]=="object"&&(Object.assign(s,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 cs(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 _e;for(let l=0;l<t.length;l++){const u=new hs(l,t[l],s,o);this.mount(a,u)}return this}remove(...e){let t=[],r=e.length-1,s={};typeof e[r]=="object"&&(Object.assign(s,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,s)}),typeof i=="function"&&Reflect.apply(i,{},[]),this}mount(e,t){if(t.src==="exports"){e.post(s=>{t.progress.work(!0,t.index,"exports"),s.resolve()});return}else if(t.src==="module"){e.post(s=>{t.progress.work(!0,t.index,"module"),s.resolve()});return}if(this.isNaturePath(t.src)){let s=t.params.jsPoint;s||(s=this.head),this.mountJS(e,t,s);return}else if(this.isNaturePath(t.src)){let s=t.params.cssPoint;s||(s=this.head),this.mountCSS(e,t,s);return}let r=this.getFileNamePostfix(t.src);if(r==="js"||r.length===0){let s=t.params.jsPoint;s||(s=this.head),this.mountJS(e,t,s);return}else if(r==="css"){let s=t.params.cssPoint;s||(s=this.head),this.mountCSS(e,t,s);return}}mountCSS(e,t,r){e.post(s=>{const i=t.src,o=this.moduleManager.get(i);if(o&&(o.status==M.Defined||o.status==M.Loaded)&&o.exports){o.type===lt.factory&&typeof o.exports=="function"?t.progress.work(!0,t.index,o.exports()):t.progress.work(!0,t.index,o.exports),s.resolve();return}const a=Ve(),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),s.resolve()},l.onerror=()=>{try{r.removeChild(l)}catch(h){console.error(h.message,h)}l.onload=null,l.onerror=null,t.progress.work(!1,t.index,null),s.reject()};else{const h={timeout:this.options.timeout??3e3,time:0,success:()=>{t.progress.work(!0,t.index,t.src),s.resolve()},error:()=>{try{r.removeChild(l)}catch(c){console.error(c.message,c)}t.progress.work(!1,t.index,null),s.resolve()}};setTimeout(()=>{Ur(l,h)},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(s=>{const i=t.src;let o=this.moduleManager.get(i);if(o&&(o.status==M.Defined||o.status==M.Loaded)){if(o.exports){o.type===lt.factory&&typeof o.exports=="function"?t.progress.work(!0,t.index,o.exports()):t.progress.work(!0,t.index,o.exports),s.resolve();return}if(document.querySelector(`script[src='${i}`)){t.progress.work(!0,t.index,o.exports),s.resolve();return}}o={id:i,src:i,status:M.Loading},this.moduleManager.set(i,o);const l=Ve().createElement("script");if("onload"in l)l.onload=()=>{l.onload=null,l.onerror=null,o.status===M.Loading&&(o.status=M.Loaded,t.progress.work(!0,t.index,i)),s.resolve()},l.onerror=()=>{try{r.removeChild(l)}catch(h){console.error(h.message,h)}l.onload=null,l.onerror=null,this.moduleManager.remove(i),t.progress.work(!1,t.index,null),s.resolve()};else{const h=l;h.onreadystatechange=()=>{/loaded|complete/.test(h.readyState)&&(h.onreadystatechange=null,o.status==M.Loading&&(o.status=M.Loaded,t.progress.work(!0,t.index,i)),s.resolve())}}l.defer=!0,l.src=i;const f=$();f.define=this.createDefine(o,t),r.appendChild(l)})}unmount(e,t={}){const r=Ve(),s=this.getFileNamePostfix(e);if(s==="js"||s.length===0){const i=r.querySelector(`script[src="${e}"]`);i&&i.parentNode&&i.parentNode.removeChild(i),this.moduleManager.remove(e);return}else if(s==="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 s=e[r].trim();s.length!==0&&t.push(s)}return t}createDefine(e,t){const r=this,s=function(...i){e.status=M.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 h=f.map(c=>c==="exports"?((!e.exports||typeof e.exports!="object")&&(e.exports={}),e.exports):c==="module"?e:c);if(typeof l=="function"){const c=Reflect.apply(l,e,h);c&&typeof c=="object"&&(e.exports=c)}else e.exports=l;e.status=M.Defined,t.progress.work(!0,t.index,e.exports)}):(typeof l=="function"?e.exports=Reflect.apply(l,e,[]):e.exports=l,e.status=M.Defined,t.progress.work(!0,t.index,e.exports))};return s.amd=!0,s}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 s=`${e[r]}`;t+=`${encodeURIComponent(r)}=${encodeURIComponent(s)}&`}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 s=t[r];if(e.indexOf(s)===0)return!0}return!1}parserPath(e,t){if(e.indexOf("http://")==0||e.indexOf("https://")==0||e.indexOf("file:///")==0)return e;if(e.indexOf("/")==0)return`${at()}${e.slice(1)}`;if(e.indexOf("./")==0)return`${at()}${e.slice(2)}`;if(e.indexOf("//")==0)return`${$().location.protocol}${e}`;if(t){let s=this.options.alias[e];if(!s){let i=e.indexOf("/");if(i==-1)s=e;else{let o=e.slice(0,i),a=this.options.paths[o];a?s=a+e.slice(i):s=e}}return this.parserPath(s,!1)}return`${at()}${e}`}}function Ur(n,e){let t=n.sheet,r=!1;if(e.isOldWebKit)t&&(r=!0);else if(t)try{t.cssRules&&(r=!0)}catch(s){s.name==="NS_ERROR_DOM_SECURITY_ERR"&&(r=!0)}setTimeout(()=>{e.time+=20,r?e.success():e.timeout>e.timeout?e.error():Ur(n,e)},20)}class cs{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(s){console.error(s.message,s)}}isOK(){return this.status}}class hs{index;src;params;progress;constructor(e,t,r,s){this.index=e,this.src=t,this.params=r,this.progress=s}}const Gt=Symbol("fk"),Qt=Symbol("fbk"),Xt=Symbol("fepk");function ys(n={}){const e=new Dn(n),t=new vt,r=new Rt,s=new kr,i={get router(){return e},get bus(){return t},get Bus(){return vt},get EventProxy(){return Rt},get eventproxy(){return r},get EventChain(){return _e},get Require(){return kr},get require(){return s},get extend(){return K},get clone(){return ke},get isESModule(){return ct},install(o){o.provide(Ge,e),o.provide(Gt,i),o.provide(Qt,t),o.provide(Xt,r),o.component(Vn,Jt),o.component(Bn,us),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 Ct(this)}}}),e.init()}};return i}function Yt(n){return n?n.$router:b.inject(Ge)}function ds(n){return n||(n=b.getCurrentInstance()?.proxy??void 0),n?Ct(n):null}function ms(n){return n?n.$fox:b.inject(Gt)}function ps(n){return n?n.$bus:b.inject(Qt)}function gs(n){return n?n.$eventProxy:b.inject(Xt)}function vs(n){const e=Yt(),t=(r,s,i)=>{try{Reflect.apply(n,{},[r,s])}catch(o){console.error(o)}i()};e.beforeEach(t),b.onUnmounted(()=>{e.removeBeforeEach(t)})}function ws(n){const e=Yt(),t=(r,s,i)=>{try{Reflect.apply(n,{},[r,s])}catch(o){console.error(o)}i()};e.afterEach(t),b.onUnmounted(()=>{e.removeAfterEach(t)})}const Rs="";w.Bus=vt,w.EventChain=_e,w.EventProxy=Rt,w.Route=C,w.clone=ke,w.createFox=ys,w.createMemoryHistory=_r,w.createWebHashHistory=Fr,w.createWebHistory=Mn,w.deleteContextValue=vn,w.extend=K,w.foxBusKey=Qt,w.foxEventProxyKey=Xt,w.foxKey=Gt,w.injectContextValue=xt,w.isArray=zr,w.isDate=Qr,w.isESModule=ct,w.isEqual=mt,w.isFunction=S,w.isMap=Jr,w.isNil=rr,w.isObject=tr,w.isPlainObject=nr,w.isPromise=Zr,w.isSet=Gr,w.isString=Xr,w.isSymbol=Yr,w.onAfterRouteUpdate=ws,w.onBeforeRouteUpdate=vs,w.onFoxActivated=Sn,w.onFoxInactivated=Pn,w.provideContextValue=gn,w.sessionKey=ie,w.toBoolean=yt,w.toNumber=nn,w.toTypeString=Be,w.typeOf=dt,w.useBus=ps,w.useEventProxy=gs,w.useFox=ms,w.useRoute=ds,w.useRouter=Yt,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
|
package/libs/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@charset "UTF-8";.fox-views.fox-views-window{display:block}.fox-views.fox-views-window .fox-view{position:fixed;top:0;left:0;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;z-index:100}.fox-views.fox-card-views{position:relative;width:100%;height:100%;-webkit-box-sizing:border-box;box-sizing:border-box}.fox-views.fox-card-views .fox-card-view{width:100%}.fox-views.fox-card-views .fox-card-view-active{z-index:1}.fox-views.fox-card-views .fox-card-view-inactive{display:none;z-index:0}.fox-views .fox-view-trans-enter-to{-webkit-animation:fox-view-in-slide-right .33s;animation:fox-view-in-slide-right .33s;z-index:120}.fox-views .fox-view-trans-leave-to{-webkit-animation:fox-view-out-slide-right .32s;animation:fox-view-out-slide-right .32s;z-index:120}.fox-views .fox-view-trans-show-to{-webkit-animation:fox-view-show-slide-right .3s;animation:fox-view-show-slide-right .3s;z-index:110}.fox-views .fox-view-trans-hide-to{-webkit-animation:fox-view-hide-slide-left .32s;animation:fox-view-hide-slide-left .32s;z-index:110}@-webkit-keyframes fox-view-in-slide-right{0%{-webkit-transform:translateX(103%);transform:translate(103%)}to{-webkit-transform:translateX(0%);transform:translate(0)}}@keyframes fox-view-in-slide-right{0%{-webkit-transform:translateX(103%);transform:translate(103%)}to{-webkit-transform:translateX(0%);transform:translate(0)}}@-webkit-keyframes fox-view-out-slide-right{0%{-webkit-transform:translateX(0%);transform:translate(0)}to{-webkit-transform:translateX(103%);transform:translate(103%)}}@keyframes fox-view-out-slide-right{0%{-webkit-transform:translateX(0%);transform:translate(0)}to{-webkit-transform:translateX(103%);transform:translate(103%)}}@-webkit-keyframes fox-view-hide-slide-left{0%{-webkit-transform:translateX(0%);transform:translate(0)}to{-webkit-transform:translateX(-30%);transform:translate(-30%)}}@keyframes fox-view-hide-slide-left{0%{-webkit-transform:translateX(0%);transform:translate(0)}to{-webkit-transform:translateX(-30%);transform:translate(-30%)}}@-webkit-keyframes fox-view-show-slide-right{0%{-webkit-transform:translateX(-30%);transform:translate(-30%)}to{-webkit-transform:translateX(0%);transform:translate(0)}}@keyframes fox-view-show-slide-right{0%{-webkit-transform:translateX(-30%);transform:translate(-30%)}to{-webkit-transform:translateX(0%);transform:translate(0)}}
|
package/package.json
CHANGED
|
@@ -1,36 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fox-js/fox",
|
|
3
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "3.0.1-31",
|
|
4
5
|
"description": "Fox Router and commons Utils",
|
|
5
6
|
"author": "jiangcheng",
|
|
6
7
|
"keywords": [
|
|
7
8
|
"fox",
|
|
8
9
|
"router",
|
|
9
10
|
"vue3",
|
|
10
|
-
"
|
|
11
|
+
"typescript"
|
|
11
12
|
],
|
|
12
|
-
"main": "libs/index.
|
|
13
|
-
"module": "libs/index.
|
|
13
|
+
"main": "./libs/index.umd.js",
|
|
14
|
+
"module": "./libs/index.esm.js",
|
|
15
|
+
"types": "./libs/index.esm.d.ts",
|
|
16
|
+
"style": "./dist/style.css",
|
|
14
17
|
"exports": {
|
|
15
18
|
".": {
|
|
16
|
-
"import":
|
|
17
|
-
|
|
18
|
-
"default": "./libs/index.esm.js"
|
|
19
|
-
},
|
|
20
|
-
"require": {
|
|
21
|
-
"node": "./libs/index.cjs.js",
|
|
22
|
-
"default": "./libs/index.amd.js"
|
|
23
|
-
}
|
|
19
|
+
"import": "./libs/index.esm.js",
|
|
20
|
+
"require": "./libs/index.umd.js"
|
|
24
21
|
},
|
|
25
|
-
"./
|
|
22
|
+
"./style.css": "./libs/style.css",
|
|
23
|
+
"./*": "./*"
|
|
26
24
|
},
|
|
27
|
-
"
|
|
28
|
-
|
|
25
|
+
"files": [
|
|
26
|
+
"libs"
|
|
27
|
+
],
|
|
29
28
|
"publishConfig": {
|
|
30
29
|
"access": "public"
|
|
31
30
|
},
|
|
32
31
|
"scripts": {
|
|
33
|
-
"publish:next": "npm version prerelease
|
|
32
|
+
"publish:next": "npm version prerelease && npm publish --tag next"
|
|
34
33
|
},
|
|
35
34
|
"dependencies": {},
|
|
36
35
|
"repository": ""
|
package/READEME.md
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @version: 1.0
|
|
3
|
-
* @Author: 江成
|
|
4
|
-
* @Date: 2021-12-19 22:08:30
|
|
5
|
-
-->
|
|
6
|
-
|
|
7
|
-
# Fox
|
|
8
|
-
|
|
9
|
-
Fox Router and commons Utils
|
|
10
|
-
|
|
11
|
-
## 安装
|
|
12
|
-
|
|
13
|
-
正式版
|
|
14
|
-
|
|
15
|
-
```js
|
|
16
|
-
npm install @fox-js/fox@next
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
测试版
|
|
20
|
-
|
|
21
|
-
```js
|
|
22
|
-
npm install @fox-js/fox@beta
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## 使用
|
|
26
|
-
|
|
27
|
-
```js
|
|
28
|
-
import fox from '@fox-js/fox'
|
|
29
|
-
import '@fox-js/fox/index.css'
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## 编译
|
|
33
|
-
|
|
34
|
-
开发版本
|
|
35
|
-
|
|
36
|
-
```js
|
|
37
|
-
npm run dev
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
正式版本
|
|
41
|
-
|
|
42
|
-
```js
|
|
43
|
-
npm run prod
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## 发布
|
|
47
|
-
|
|
48
|
-
测试版本
|
|
49
|
-
|
|
50
|
-
```js
|
|
51
|
-
npm run publish:beta
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
正式版本(慎重)
|
|
55
|
-
|
|
56
|
-
```js
|
|
57
|
-
npm run publish:next
|
|
58
|
-
```
|
package/libs/index.amd.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
define(["exports","vue"],(function(e,t){"use strict";const r=Array.isArray,n=e=>"function"==typeof e,i=e=>null!==e&&"object"==typeof e,s=Object.prototype.toString,o=e=>s.call(e),l=e=>"[object Object]"===o(e),a="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function u(e){return e.__esModule||a&&"Module"===e[Symbol.toStringTag]}const h=typeof Promise<"u"&&-1!==Promise.toString().indexOf("[native code]");function c(...e){let t=void 0!==e[0]&&null!==e[0]?e[0]:{},r=1,n=e.length,i=!1;for("boolean"==typeof t&&(i=t,t=e[r]??{},r++),"object"!=typeof t&&(t={});r<n;r++)if(null!==e[r]&&void 0!==e[r]){let n=e[r];for(let e in n){let r=t[e],s=n[e];if(r!==s)if(!0===i&&s&&"object"==typeof s){let n;n=Array.isArray(s)?r&&Array.isArray(r)?r:[]:r&&"object"==typeof r?r:{},t[e]=c(i,n,s)}else void 0!==s&&(t[e]=s)}}return t}function f(e,t,r=!1){if(r){if("object"!=typeof t)return{};"object"!=typeof e&&(e={});for(let n in t){let i=e[n],s=t[n];if(i!==s)if("object"==typeof s){if(!Array.isArray(s)&&!l(s))continue;i=f(i,s,r),e[n]=i}else{if("function"==typeof s)continue;e[n]=s}}const n=Object.getOwnPropertySymbols(t);for(let i of n){let n=e[i],s=t[i];if(n!==s)if("object"==typeof s){if(!Array.isArray(s)&&!l(s))continue;n=f(n,s,r),e[i]=n}else{if("function"==typeof s)continue;e[i]=s}}}else c(!0,e,t);return e}class p{static seed=(new Date).getTime();static get(){let e=++p.seed;return e>=Number.MAX_VALUE&&(p.seed=0),e}}const d=h?Promise.resolve():null;function y(e,...t){null!==d?t&&t.length>0?d.then((()=>{e(t)})):d.then(e):t&&t.length>0?setTimeout((()=>{e(t)})):setTimeout(e)}function m(e){return null!=e&&("boolean"==typeof e?e:"string"==typeof e?"true"===e.toLocaleLowerCase():Boolean(e))}const g={"[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 v(e){let t=Object.prototype.toString.call(e);return null==e?String(e):g[t]||"object"}function b(e){return e&&"object"==typeof e&&"setInterval"in e}function w(e){let t=!!e&&"length"in e&&e.length,r=v(e);return"function"!==r&&!b(e)&&("array"===r||0===t||"number"==typeof t&&t>0&&t-1 in e)}function x(e,t){let r=+t.length,n=0,i=e.length;for(;n<r;n++)e[i++]=t[n];return e.length=i,e}function S(e,t=[]){let r=t;return null!=e&&(w(Object(e))?x(r,"string"==typeof e?[e]:e):r.push(e)),r}function R(e,t,r){if(w(e))Reflect.apply([].forEach,e,[t]);else for(let n in e)if(r&&e.hasOwnProperty(n)){if(!1===Reflect.apply(t,e,[e[n]]))break}else if(!1===Reflect.apply(t,e,[e[n]]))break;return e}function A(e,t){if(e==t)return!0;if(void 0===e||void 0===t)return!1;let r=v(e);if(r!==v(t))return!1;if("object"===r){let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let n=0;n<r.length;n++){let i=r[n];if(!A(e[i],t[i]))return!1}return!0}if("array"===r){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){if(!A(e[r],t[r]))return!1}return!0}return!1}const E=Symbol("idKey"),C=Symbol("valueKey"),j=Symbol("childrenKey"),P=Symbol("growKey");class T{[P]=!0;[E];[C]=t.ref();[j]=new Map;constructor(e){this[E]=e}}class O{get(e,t){if("value"==t)return e[C].value;if("grow"===t)return e[P];let r=e[j].get(t);return r?F(r):e[P]?(r=$(t),r[P]=e[P],e[j].set(t,r),F(r)):void 0}set(e,t,r){return"value"==t?(e[C].value=r,!0):"grow"===t?(e[P]=m(r),!0):null==r&&(e[j].delete(t),!0)}deleteProperty(e,t){return"value"!==t&&"grow"!=t&&(e[j].delete(t),!0)}}const q="__proxy__";function $(e){let t=new T(e);return Reflect.set(t,q,new Proxy(t,new O)),t}function F(e){return Reflect.get(e,q)}class k extends T{constructor(){super("__root__")}put(...e){let t=e.length;if(t<2)return!1;let r=this;for(let n=0;n<t-1;n++){let t,i=e[n];r[j].has(i)?t=r[j].get(i):(t=$(i),r[j].set(i,t)),r=t}return r[C].value=e[t-1],!0}get(...e){let t=e.length;if(0===t)return;let r=this;for(let n=0;n<t;n++){let t=e[n];if(!r[j].has(t))return;r=r[j].get(t)}return r[C].value}remove(...e){let t=e.length;if(0==t)return!1;let r=this;for(let n=0;n<t-1;n++){let t=e[n];if(!r[j].has(t))return!1;r=r[j].get(t)}let n=e[t-1];return!!r[j].has(n)&&(r[j].delete(n),!0)}contains(...e){let t=e.length;if(0==t)return!1;let r=this;for(let n=0;n<t-1;n++){let t=e[n];if(!r[j].has(t))return!1;r=r[j].get(t)}let n=e[t-1];return r[j].has(n)}clear(){this[j].clear()}}const _=["put","get","contains","remove","clear"];function M(e){return _.includes(e)}class N{get(e,t){if("value"==t)return e[C].value;if("grow"===t)return e[P];if(t===j)return e[j];if("string"==typeof t&&M(t))return e[t];let r=String(t),n=e[j].get(r);return n?F(n):e[P]?(n=$(r),n[P]=e[P],e[j].set(r,n),F(n)):void 0}set(e,t,r){return"value"==t?(e[C].value=r,!0):"grow"===t?(e[P]=m(r),!0):!M(t)&&(null==r&&(e[j].delete(t),!0))}deleteProperty(e,t){return"value"!==t&&"grow"!=t&&(e[j].delete(t),!0)}}let K=new Proxy(k,{construct(e,...t){let r=function(){let e=new k,t=new N,r=new Proxy(e,t);return Object.assign({put:(...t)=>Reflect.apply(e.put,e,t),get:(...t)=>Reflect.apply(e.get,e,t),remove:(...t)=>Reflect.apply(e.remove,e,t),contains:(...t)=>Reflect.apply(e.contains,e,t),clear:()=>Reflect.apply(e.clear,e,[])},r),Reflect.set(e,q,r),e}();return F(r)}});function I(e,t){void 0===t&&(t={});for(var r=function(e){for(var t=[],r=0;r<e.length;){var n=e[r];if("*"!==n&&"+"!==n&&"?"!==n)if("\\"!==n)if("{"!==n)if("}"!==n)if(":"!==n)if("("!==n)t.push({type:"CHAR",index:r,value:e[r++]});else{var i=1,s="";if("?"===e[l=r+1])throw new TypeError('Pattern cannot start with "?" at '.concat(l));for(;l<e.length;)if("\\"!==e[l]){if(")"===e[l]){if(0==--i){l++;break}}else if("("===e[l]&&(i++,"?"!==e[l+1]))throw new TypeError("Capturing groups are not allowed at ".concat(l));s+=e[l++]}else s+=e[l++]+e[l++];if(i)throw new TypeError("Unbalanced pattern at ".concat(r));if(!s)throw new TypeError("Missing pattern at ".concat(r));t.push({type:"PATTERN",index:r,value:s}),r=l}else{for(var o="",l=r+1;l<e.length;){var a=e.charCodeAt(l);if(!(a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122||95===a))break;o+=e[l++]}if(!o)throw new TypeError("Missing parameter name at ".concat(r));t.push({type:"NAME",index:r,value:o}),r=l}else t.push({type:"CLOSE",index:r,value:e[r++]});else t.push({type:"OPEN",index:r,value:e[r++]});else t.push({type:"ESCAPED_CHAR",index:r++,value:e[r++]});else t.push({type:"MODIFIER",index:r,value:e[r++]})}return t.push({type:"END",index:r,value:""}),t}(e),n=t.prefixes,i=void 0===n?"./":n,s="[^".concat(H(t.delimiter||"/#?"),"]+?"),o=[],l=0,a=0,u="",h=function(e){if(a<r.length&&r[a].type===e)return r[a++].value},c=function(e){var t=h(e);if(void 0!==t)return t;var n=r[a],i=n.type,s=n.index;throw new TypeError("Unexpected ".concat(i," at ").concat(s,", expected ").concat(e))},f=function(){for(var e,t="";e=h("CHAR")||h("ESCAPED_CHAR");)t+=e;return t};a<r.length;){var p=h("CHAR"),d=h("NAME"),y=h("PATTERN");if(d||y){var m=p||"";-1===i.indexOf(m)&&(u+=m,m=""),u&&(o.push(u),u=""),o.push({name:d||l++,prefix:m,suffix:"",pattern:y||s,modifier:h("MODIFIER")||""})}else{var g=p||h("ESCAPED_CHAR");if(g)u+=g;else if(u&&(o.push(u),u=""),h("OPEN")){m=f();var v=h("NAME")||"",b=h("PATTERN")||"",w=f();c("CLOSE"),o.push({name:v||(b?l++:""),pattern:v&&!b?s:b,prefix:m,suffix:w,modifier:h("MODIFIER")||""})}else c("END")}}return o}function L(e,t){return function(e,t){void 0===t&&(t={});var r=U(t),n=t.encode,i=void 0===n?function(e){return e}:n,s=t.validate,o=void 0===s||s,l=e.map((function(e){if("object"==typeof e)return new RegExp("^(?:".concat(e.pattern,")$"),r)}));return function(t){for(var r="",n=0;n<e.length;n++){var s=e[n];if("string"!=typeof s){var a=t?t[s.name]:void 0,u="?"===s.modifier||"*"===s.modifier,h="*"===s.modifier||"+"===s.modifier;if(Array.isArray(a)){if(!h)throw new TypeError('Expected "'.concat(s.name,'" to not repeat, but got an array'));if(0===a.length){if(u)continue;throw new TypeError('Expected "'.concat(s.name,'" to not be empty'))}for(var c=0;c<a.length;c++){var f=i(a[c],s);if(o&&!l[n].test(f))throw new TypeError('Expected all "'.concat(s.name,'" to match "').concat(s.pattern,'", but got "').concat(f,'"'));r+=s.prefix+f+s.suffix}}else if("string"!=typeof a&&"number"!=typeof a){if(!u){var p=h?"an array":"a string";throw new TypeError('Expected "'.concat(s.name,'" to be ').concat(p))}}else{f=i(String(a),s);if(o&&!l[n].test(f))throw new TypeError('Expected "'.concat(s.name,'" to match "').concat(s.pattern,'", but got "').concat(f,'"'));r+=s.prefix+f+s.suffix}}else r+=s}return r}}(I(e,t),t)}function D(e,t){var r=[];return function(e,t,r){void 0===r&&(r={});var n=r.decode,i=void 0===n?function(e){return e}:n;return function(r){var n=e.exec(r);if(!n)return!1;for(var s=n[0],o=n.index,l=Object.create(null),a=function(e){if(void 0===n[e])return"continue";var r=t[e-1];"*"===r.modifier||"+"===r.modifier?l[r.name]=n[e].split(r.prefix+r.suffix).map((function(e){return i(e,r)})):l[r.name]=i(n[e],r)},u=1;u<n.length;u++)a(u);return{path:s,index:o,params:l}}}(W(e,r,t),r,t)}function H(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function U(e){return e&&e.sensitive?"":"i"}function B(e,t,r){return function(e,t,r){void 0===r&&(r={});for(var n=r.strict,i=void 0!==n&&n,s=r.start,o=void 0===s||s,l=r.end,a=void 0===l||l,u=r.encode,h=void 0===u?function(e){return e}:u,c=r.delimiter,f=void 0===c?"/#?":c,p=r.endsWith,d="[".concat(H(void 0===p?"":p),"]|$"),y="[".concat(H(f),"]"),m=o?"^":"",g=0,v=e;g<v.length;g++){var b=v[g];if("string"==typeof b)m+=H(h(b));else{var w=H(h(b.prefix)),x=H(h(b.suffix));if(b.pattern)if(t&&t.push(b),w||x)if("+"===b.modifier||"*"===b.modifier){var S="*"===b.modifier?"?":"";m+="(?:".concat(w,"((?:").concat(b.pattern,")(?:").concat(x).concat(w,"(?:").concat(b.pattern,"))*)").concat(x,")").concat(S)}else m+="(?:".concat(w,"(").concat(b.pattern,")").concat(x,")").concat(b.modifier);else"+"===b.modifier||"*"===b.modifier?m+="((?:".concat(b.pattern,")").concat(b.modifier,")"):m+="(".concat(b.pattern,")").concat(b.modifier);else m+="(?:".concat(w).concat(x,")").concat(b.modifier)}}if(a)i||(m+="".concat(y,"?")),m+=r.endsWith?"(?=".concat(d,")"):"$";else{var R=e[e.length-1],A="string"==typeof R?y.indexOf(R[R.length-1])>-1:void 0===R;i||(m+="(?:".concat(y,"(?=").concat(d,"))?")),A||(m+="(?=".concat(y,"|").concat(d,")"))}return new RegExp(m,U(r))}(I(e,r),t,r)}function W(e,t,r){return e instanceof RegExp?function(e,t){if(!t)return e;for(var r=/\((?:\?<(.*?)>)?(?!\?)/g,n=0,i=r.exec(e.source);i;)t.push({name:i[1]||n++,prefix:"",suffix:"",modifier:"",pattern:""}),i=r.exec(e.source);return e}(e,t):Array.isArray(e)?function(e,t,r){var n=e.map((function(e){return W(e,t,r).source}));return new RegExp("(?:".concat(n.join("|"),")"),U(r))}(e,t,r):B(e,t,r)}const V="default",z=Symbol("sync"),J=Symbol("resolveRoute");function G(e){let t=!1;return function(...r){if(!t)return t=!0,Reflect.apply(e,{},r)}}class X{name;level;rootName;rootIndex=0;constructor(e,t,r,n){this.name=e,this.level=t,this.rootName=r,this.rootIndex=n}}class Y{to;routeModel;from;data={};constructor(e,t){this.to=e,this.from=t}static from(e){let t=new Y(e.to,e.from),r=e.data??{};return c(!0,t.data,r),t}}class Q{path;get fullPath(){let e=this.path??`/${this.name}`;return`${this.root??V}!${e}`}name;root;params;query;matched;meta;success;error;destroy;opsType;updateType;viewTagAttrs;index;active;slot;session;static clone(e,t){let r=new Q;return f(r,e,t),r}static isSame(e,t){return e===t||!(null==e||null==t||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||!(null==e||null==t||e.path&&e.path!=t.path||e.name&&e.name!=t.name)}static from(e){let t=new Q;if(null==e)return t;let r=t;for(let t in e){let n=e[t];r[t]=n}const n=Object.getOwnPropertySymbols(e);if(Array.isArray(n)&&n.length>0)for(let t of n)r[t]=e[t];return t}}class Z{id;name;props;meta;src;component;constructor(e,t,r,n){this.id=p.get(),this.name=e,this.src=t,"function"!=typeof t&&(this.component=t),this.props=r,this.meta=n}get isResolved(){return void 0!==this.component}resolve(){return function(e){let t=e.src;return new Promise(((r,n)=>{const i=G((t=>{u(t)&&(t=t.default),e.component=t,r()})),s=G((e=>{n(e)}));let o;try{o=t(i,s)}catch(e){s(e)}if(o)if("function"==typeof o.then)o.then(i,s);else{const e=o.component;e&&"function"==typeof e.then&&e.then(i,s)}}))}(this)}}class ee{models=[]}class te{path;match;redirect;name;layers=[]}var re,ne=((re=ne||{})[re.Push=0]="Push",re[re.Replace=1]="Replace",re[re.Put=2]="Put",re[re.Append=3]="Append",re[re.Open=4]="Open",re),ie=(e=>(e[e.Part=0]="Part",e[e.All=1]="All",e))(ie||{});const se=Symbol("rootKey"),oe=Symbol("rootNodeKey"),le=Symbol("parentNodeKey"),ae=Symbol("nameKey");class ue{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 he{scope=null;set compensation(e){null!==this.scope&&this.scope.stop(),this.scope=t.effectScope(),this.scope.run((()=>{t.watch(this.slots,(()=>{let t=!1;try{t=e()}catch(e){}t&&null!==this.scope&&(this.scope.stop(),this.scope=null)}))}))}_slots;get slots(){return null==this._slots&&(this._slots=t.shallowRef([])),this._slots}get empty(){return null==this._slots||0==this._slots.value.length}[ae];[se];[oe]=null;[le]=null;get name(){return this[ae]}constructor(e,t,r){this[ae]=e,this[se]=t,r&&(this[oe]=r)}}class ce{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&&(-1==t.index||n.index===t.index)&&n.level===t.level)return!0}return!1}}class fe{views=[]}class pe{layers=[]}class de{time;route}class ye{forbidTime=300;submitRecorder=new de;isSameRoute(e,t){return null!=e&&null!=t&&(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))return this.submitRecorder.route=e,this.submitRecorder.time=t,t;this.submitRecorder.time=t}release(e){this.submitRecorder.time===e&&(this.submitRecorder.route=void 0)}}const me=typeof window<"u",ge=function(){return window},ve=function(){return window.document};function be(e,t,r){e.addEventListener?e.addEventListener(t,r,!1):e.attachEvent?e.attachEvent(`on${t}`,r):e[`on${t}`]=r}function we(e,t,r){e.removeEventListener?e.removeEventListener(t,r):e.detachEvent?e.detachEvent(`on${t}`,r):e[`on${t}`]=null}let xe=function(){if(!me)return"/";let e=ge().location,t=`${e.protocol}//${e.host}`;return t+=function(e){let t=e,r=t.lastIndexOf("/");return r>0&&r<t.length-1?t=t.substring(0,r+1):0===r&&-1!==t.indexOf(".")?t="/":-1===r&&(t=-1==t.indexOf(".")?`/${t}/`:"/"),0!==t.indexOf("/")&&(t=`/${t}`),t}(e.pathname),t}();const Se={method:"POST",headers:{"Content-Type":"application/json; charset=UTF-8"},mode:"cors",credentials:"same-origin",cache:"default",redirect:"follow",keepalive:!0},Re=new Map;async function Ae(e){let{id:t,method:r="POST",url:n,headers:i={},data:s,processData:o=!0,timeout:l=-1}=e;if(t&&Re.has(t))throw new Error("resubmit");r=r.toUpperCase();let{contentType:a="application/json; charset=UTF-8"}=i,u=c(!0,{...Se},{method:r,headers:i});if("GET"===r?n=function(e,t,r="text"){if(null==t)return e;let n="";if(0===(r=r.trim().toLowerCase()).indexOf("application/x-www-form-urlencoded")||0===r.indexOf("application/json"))if("object"==typeof t)for(let e in t){let r=t[e];if(Array.isArray(r))for(let t=0;t<r.length;t++){let i=`${encodeURIComponent(e)}=${encodeURIComponent(r[t])}`;n.length>0&&(n+="&"),n+=i}else{let t=`${encodeURIComponent(e)}=${encodeURIComponent(r)}`;n.length>0&&(n+="&"),n+=t}}else n=t;else n=t;return n.length>0&&(e=-1===e.indexOf("?")?`${e}?${n}`:`${e}&${n}`),e}(n,s,a):(o&&(s=function(e,t="text"){let r="";if(0===(t=t.trim().toLowerCase()).indexOf("application/x-www-form-urlencoded"))if("object"==typeof e)for(let t in e){let n=e[t];if(Array.isArray(n))for(let e=0;e<n.length;e++){let i=`${encodeURIComponent(t)}=${encodeURIComponent(n[e])}`;r.length>0&&(r+="&"),r+=i}else{let e=`${encodeURIComponent(t)}=${encodeURIComponent(n)}`;r.length>0&&(r+="&"),r+=e}}else r=e;else r=0===t.indexOf("text")?"object"==typeof e?JSON.stringify(e):e:0===t.indexOf("application/json")&&"object"==typeof e?JSON.stringify(e):e;return r}(s,a)),u.body=s),t||l>0){t||(t=`fetch_${p.get()}`);const e=new AbortController;u.signal=e.signal;let r={timer:null,controller:e};if(l>0){const e=setTimeout((()=>{r.timer&&r.controller.abort()}),l);r.timer=e}Re.set(t,r)}try{let e=await fetch(n,u),r={};e.headers.forEach(((e,t)=>{r[e]=t}));let i,s=r["content-type"]??"";return i=-1!==s.indexOf("application/json")?await e.json():-1!=s.indexOf("text")?await e.text():await e.blob(),{ok:e.ok,status:e.status,statusText:e.statusText,headers:r,data:i,response:e}}catch(e){throw e}finally{if(t){let e=Re.get(t);e&&(e.timer&&(clearTimeout(e.timer),e.timer=null),Re.delete(t))}}}class Ee{cache=new Map;constructor(){}async get(e,t=-1){if(this.cache.has(e))return this.cache.get(e);let r=await Ae({url:e,method:"GET",timeout:t,heaaders:{"content-type":"text/plain"}});if(r.ok)return this.cache.set(e,r.data),r.data;throw Error(r.statusText)}remove(e){this.cache.delete(e)}}var Ce=(e=>(e[e.Loading=0]="Loading",e[e.Loaded=1]="Loaded",e[e.Defining=2]="Defining",e[e.Defined=3]="Defined",e))(Ce||{});class je{exports;status;id;src}class Pe{register=new Map;constructor(){}get(e){return this.register.get(e)}put(e,t){this.register.set(e,t)}remove(e){let t=this.register.get(e);return this.register.delete(e),t}contains(e){return this.register.has(e)}clear(){this.register.clear()}}var Te=(e=>(e.Busy="Busy",e.Free="Free",e.Reject="Reject",e.Exception="Exception",e.Finished="Finished",e))(Te||{});const Oe=Symbol("chainKey"),qe=Symbol("cursorKey"),$e=Symbol("$persistentModeKey"),Fe=Symbol("statusKey"),ke=Symbol("argsKey"),_e=Symbol("exArgsKey"),Me=Symbol("successFnsKey"),Ne=Symbol("errorFnsKey"),Ke=Symbol("sessionKey"),Ie=Symbol("_go");class Le{[Oe]=[];[qe]=0;[$e]=!1;[Fe]="Free";[ke]=[];[_e]=[];[Me]=[];[Ne]=[];[Ke];get session(){return this[Ke]}constructor(e,t=!1){this[Ke]=e,this[$e]=t}[Ie](e,...t){let r=this[Fe];if(this[Fe]="Busy",this[qe]+=e,this[qe]<0&&(this[qe]=0),this[ke]=t,"Exception"===r||"Reject"===r){let e=[{session:this[Ke]},...this[_e]];for(;this[Ne].length>0;)try{let t=this[Ne].shift();"function"==typeof t&&y((()=>{Reflect.apply(t,{},e)}))}catch(e){}return this[Fe]=r,this[Oe]=[],this[qe]=0,this}if("Finished"===r||this[qe]>=this[Oe].length){let e=[{session:this[Ke]},...this[ke]];for(;this[Me].length>0;){let t=this[Me].shift();"function"==typeof t&&y((()=>{Reflect.apply(t,{},e)}))}return this[Fe]="Free",this}if(this[qe]>=this[Oe].length)return this[Fe]="Free",this;let n=this[Oe][this[qe]];this[$e]||(this[Oe].splice(0,this[qe]+1),this[qe]=-1);let i=this[qe]+1;try{let e=!1,t={go:(t,...r)=>{e||(e=!0,Reflect.apply(this[Ie],this,[t,...r]))},resolve:(...t)=>{e||(e=!0,Reflect.apply(this[Ie],this,[1,...t]))},reject:(...t)=>{e||(e=!0,Reflect.apply(this.reject,this,[...t]))},insert:t=>{e||(this[Oe].splice(i,0,t),i++)},session:this[Ke]};y((()=>{Reflect.apply(n,{},[t,...this[ke]])}))}catch(e){this.throw(e)}return this}go(e,...t){return Reflect.apply(this[Ie],this,[e,...t])}finish(...e){return this[Fe]="Finished",this[ke]=e,Reflect.apply(this[Ie],this,[0])}reject(...e){return this[Fe]="Reject",this[_e]=e,Reflect.apply(this[Ie],this,[0])}throw(...e){return this[Fe]="Exception",this[_e]=e,Reflect.apply(this[Ie],this,[0])}reset(...e){this[Fe]="Busy",this[ke]=e,this[Oe]=[],this[qe]=0;let t=[{session:this[Ke]},...this[ke]];for(;this[Me].length>0;){let e=this[Me].shift();y((()=>{Reflect.apply(e,this,t)}))}return this[Fe]="Free",this}post(e){return"Reject"===this[Fe]||"Exception"===this[Fe]||(Array.isArray(e)?this[Oe]=[...this[Oe],...e]:this[Oe].push(e),"Busy"===this[Fe]||Reflect.apply(this[Ie],this,[0,...this[ke]])),this}wait(e,t){return e&&"function"==typeof e&&this[Me].push(e),t&&"function"==typeof t&&this[Ne].push(t),"Busy"===this[Fe]||Reflect.apply(this[Ie],this,[0,...this[ke]]),this}exception(e){return e&&"function"==typeof e&&this[Ne].push(e),"Busy"===this[Fe]?this:Reflect.apply(this[Ie],this,[0,...this[ke]])}isFinish(){return"Reject"==this[Fe]||"Free"==this[Fe]&&this[qe]>=this[Oe].length}}class De{head;isOldWebKit;moduleManager=new Pe;resource=new Ee;options;_query;set query(e){this._query=e}get query(){return this._query}constructor(e={}){const t=ve();this.head=t.head||t.getElementsByTagName("head")[0]||t.documentElement,this.isOldWebKit=+navigator.userAgent.replace(/.*(?:AppleWebKit|AndroidWebKit)\/(\d+).*/,"$1")<536,this.options=e,this.options.paths||(this.options.paths={}),this.options.alias||(this.options.alias={})}ensure(...e){let t=[],r=e.length-1,n={};"object"==typeof e[r]&&(Object.assign(n,e[r]),r--);let i=null;"function"==typeof e[r]&&(i=e[r],r--);for(let n=0;n<=r;n++)if(Array.isArray(e[n])){let r=e[n];for(let e=0;e<r.length;e++)void 0!==r[e]&&t.push(this.resolvePath(r[e]))}else{let r=e[n].split(",");for(let e=0;e<r.length;e++)void 0!==r[e]&&t.push(this.resolvePath(r[e]))}let s=new Ue(t.length,((e,t)=>{if(s.isOK())try{"function"==typeof i&&Reflect.apply(i,{},t)}catch(e){}else try{"function"==typeof i&&Reflect.apply(i,{},[])}catch(e){}})),o=new Le;for(let e=0;e<t.length;e++){let r=new Be(e,t[e],n,s);this.mount(o,r)}return this}remove(...e){let t=[],r=e.length-1,n={};"object"==typeof e[r]&&(Object.assign(n,e[r]),r--);let i=null;"function"==typeof e[r]&&(i=e[r],r--);for(let n=0;n<=r;n++)if(Array.isArray(e[n])){let r=e[n];for(let e=0;e<r.length;e++)void 0!==r[e]&&t.push(this.resolvePath(r[e]))}else{let r=e[n].split(",");for(let e=0;e<r.length;e++)void 0!==r[e]&&t.push(this.resolvePath(r[e]))}return t.forEach((e=>{this.unmount(e,n)})),"function"==typeof i&&Reflect.apply(i,{},[]),this}mount(e,t){const r=ve();if(this.isNaturePath(t.src,"js")){let r=t.params.jsPoint;return r||(r=this.head),void this.mountJS(e,t,r)}if(this.isNaturePath(t.src,"css")){let r=t.params.cssPoint;return r||(r=this.head),void this.mountCSS(e,t,r)}if(this.isNaturePath(t.src,"html")){let n=t.params.htmlPoint;return n||(n=r.body),void this.mountHTML(e,t,n)}let n=this.getFileNamePostfix(t.src);if("js"===n||0===n.length){let r=t.params.jsPoint;return r||(r=this.head),void this.mountJS(e,t,r)}if("css"===n){let r=t.params.cssPoint;return r||(r=this.head),void this.mountCSS(e,t,r)}{let n=t.params.htmlPoint;return n||(n=r.body),void this.mountHTML(e,t,n)}}mountHTML(e,t,r){e.post((e=>{let n=t.params.timeout??this.options.timeout??3e4,i=t.src;this.resource.get(i,n).then((n=>{r.innerHTML=n,t.progress.work(!0,t.index,n),e.resolve()}),(r=>{t.progress.work(!1,t.index,null),e.reject()}))}))}mountCSS(e,t,r){e.post((e=>{const n=ve(),i=t.src,s=n.createElement("link"),o="onload"in s;if(this.isOldWebKit||!o){const n={timeout:this.options.time||3e3,time:0,isOldWebKit:this.isOldWebKit,success:()=>{t.progress.work(!0,t.index,t.src),e.resolve()},error:()=>{try{r.removeChild(s)}catch(e){}t.progress.work(!1,t.index,null),e.resolve()}};setTimeout((()=>{He(s,n)}),1)}else s.onload=()=>{s.onload=s.onerror=null,t.progress.work(!0,t.index,t.src),e.resolve()},s.onerror=()=>{try{r.removeChild(s)}catch(e){}s.onload=s.onerror=null,t.progress.work(!1,t.index,null),e.reject()};let l=n.getElementById(i);l&&l.parentNode&&l.parentNode.removeChild(l),s.rel="stylesheet",s.type="text/css",s.id=i,s.href=i,r.appendChild(s)}))}mountJS(e,t,r){e.post((e=>{let n=t.src,i=this.moduleManager.get(n);if(i&&(i.status==Ce.Defined||i.status==Ce.Loaded)){if(i.exports)return t.progress.work(!0,t.index,i.exports),void e.resolve();if(document.querySelector(`script[src='${n}`))return t.progress.work(!0,t.index,i.exports),void e.resolve()}i=new je,i.id=n,i.src=n,i.status=Ce.Loading,this.moduleManager.put(n,i);const s=ve().createElement("script");if("onload"in s)s.onload=()=>{s.onload=s.onerror=null,i.status==Ce.Loading&&(i.status=Ce.Loaded,t.progress.work(!0,t.index,n)),e.resolve()},s.onerror=()=>{try{r.removeChild(s)}catch(e){}s.onload=s.onerror=null,t.progress.work(!1,t.index,null),e.reject()};else{let r=s;r.onreadystatechange=()=>{/loaded|complete/.test(r.readyState)&&(r.onreadystatechange=null,i.status==Ce.Loading&&(i.status=Ce.Loaded,t.progress.work(!0,t.index,n)),e.resolve())}}s.defer=!0,s.src=n,ge().define=this.createDefine(i,t),r.appendChild(s)}))}unmount(e,t={}){const r=ve(),n=this.getFileNamePostfix(e);if("js"===n||0===n.length){const t=r.querySelector(`script[src="${e}"]`);return t&&t.parentNode&&t.parentNode.removeChild(t),void this.moduleManager.remove(e)}if("css"!==n){this.resource.remove(e);let n=t.htmlPoint;return n||(n=r.body),void(n.innerHTML="")}{const t=r.querySelector(`style[href="${e}"]`);t&&t.parentNode&&t.parentNode.removeChild(t)}}trimEmptyElement(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r].trim();0!==n.length&&t.push(n)}return t}createDefine(e,t){let r=this,n=function(...n){e.status=Ce.Defining;let i,s,o,l=n.length;1===l?(o=n[0],i=void 0):2===l?(o=n[1],Array.isArray(n[0])?(s=r.trimEmptyElement(n[0]),i=void 0):s=void 0):(i=n[0],s=r.trimEmptyElement(n[1]),o=n[2]),i&&(e.id=i,r.options.alias[i]=e.src),s&&s.length>0?r.ensure(s,((...r)=>{e.exports="function"==typeof o?Reflect.apply(o,e,r):o,e.status=Ce.Defined,t.progress.work(!0,t.index,e.exports)})):(e.exports="function"==typeof o?Reflect.apply(o,e,[]):o,e.status=Ce.Defined,t.progress.work(!0,t.index,e.exports))};return n.amd=!0,n}resolvePath(e){try{if(this.isNaturePath(e,"all"))return e;e=this.parserPath(e,!0);let t=this.getFileNamePostfix(e);t=t.toLowerCase();let r=this.createSearch(this.query);return-1==e.indexOf("?")?("js"!==t&&"css"!==t&&"html"!==t&&(e+=".js"),r.length>0&&(e+=`?${r}`)):r.length>0&&(e+=`&${r}`),e}catch(e){throw e}}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("?");-1==t&&(t=e.length);let r=e.lastIndexOf(".",t);return-1==r?"":e.substring(r+1,t)}isNaturePath(e,t){if(null==this.options.nature)return!1;if("all"===t||"js"===t){let t=this.options.nature.js;if(void 0!==t)for(let r=0;r<t.length;r++){let n=t[r];if(0===e.indexOf(n))return!0}}if("all"===t||"css"===t){let t=this.options.nature.css;if(void 0!==t)for(let r=0;r<t.length;r++){let n=t[r];if(0===e.indexOf(n))return!0}}if("all"===t||"html"===t){let t=this.options.nature.html;if(void 0!==t)for(let r=0;r<t.length;r++){let n=t[r];if(0===e.indexOf(n))return!0}}return!1}parserPath(e,t){if(0==e.indexOf("http://")||0==e.indexOf("https://")||0==e.indexOf("file:///"))return e;if(0==e.indexOf("/"))return xe+e.slice(1);if(0==e.indexOf("./"))return xe+e.slice(2);if(t){let t=this.options.alias[e];if(!t){let r=e.indexOf("/");if(-1==r)t=e;else{let n=e.slice(0,r),i=this.options.paths[n];t=i?i+e.slice(r):e}}return this.parserPath(t,!1)}return xe+e}}function He(e,t){let r=e.sheet,n=!1;if(t.isOldWebKit)r&&(n=!0);else if(r)try{r.cssRules&&(n=!0)}catch(e){"NS_ERROR_DOM_SECURITY_ERR"===e.name&&(n=!0)}setTimeout((()=>{t.time+=20,n?t.success():t.time>t.timeout?t.error():He(e,t)}),20)}class Ue{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,!0===this.status&&(this.lastIndex!==t&&this.size--,this.lastIndex=t,this.values.push(r)),0===this.size||!1===this.status)try{Reflect.apply(this.callback,this,[this.status,this.values])}catch(e){}}isOK(){return this.status}}class Be{index;src;params;progress;constructor(e,t,r,n){this.index=e,this.src=t,this.params=r,this.progress=n}}const We=Symbol("_notifyChange");class Ve{currentRoute;routes;constructor(e,t){this.currentRoute=e,this.routes=t}}const ze=Symbol("_navigateFirstRoute"),Je=Symbol("_getRouteMark"),Ge=Symbol("_getUrlSearch"),Xe=Symbol("_generateLocation"),Ye=Symbol("_setRoteMarkhRecorder");class Qe{base;storage;mode;query;firstNavigate=!0;historyMonitor;traceless=!1;changeHandler;historyChange;lastMark;constructor(e="hash",t="",r="",n=!0,i=!0,s=!1,o){this.mode=e,this.base=t,this.query=r,this.firstNavigate=n,this.historyMonitor=i,this.traceless=s,this.storage=o??ge().sessionStorage}init(e=!0){const t=ge();return"function"!=typeof this.historyChange&&(this.historyChange=()=>{if(!this.historyMonitor)return;const e=t.history.state;this[We](e)}),be(t,"popstate",this.historyChange),this.firstNavigate&&e&&this[ze](),Promise.resolve()}destroy(){if(this.historyChange){we(ge(),"popstate",this.historyChange)}}[ze](){let e=this[Je]()??"/";const t=this.storage.getItem(e);if(t)try{const e=JSON.parse(t);return void this[We](e)}catch{}const r=e.indexOf("!");let n;n=-1!=r?e.substring(r+1):e;const i=new Q;i.path=n,i.query=this[Ge](),this[We]([i])}[Ye](e,t){if(this.historyMonitor)try{this.lastMark&&this.storage.removeItem(this.lastMark);let r=JSON.stringify(t);this.storage.setItem(e,r),this.lastMark=e}catch(e){}}[We](e){"function"==typeof this.changeHandler&&this.changeHandler(e)}[Je](){const e=ge();if("path"===this.mode){let t=e.location.pathname;this.base&&0==t.indexOf(this.base)&&(t=t.substring(this.base.length));const r=t.indexOf("#");return-1!=r&&(t=t.substring(0,r)),t}{const t=e.location.hash,r=t.indexOf("#");if(-1!=r)return t.substring(r+1)}return null}[Ge](){return ge().location.search}listen(e){this.changeHandler=e}go(e){ge().history.go(e)}push(e){let t=this[Xe](e.currentRoute);this.traceless||ge().history.pushState(e.routes,"",t),this[Ye](e.currentRoute.fullPath,e.routes)}replace(e){let t=this[Xe](e.currentRoute);this.traceless||ge().history.replaceState(e.routes,"",t),this[Ye](e.currentRoute.fullPath,e.routes)}[Xe](e){const t=ge();let r;if(e.query){let t="";if("object"==typeof e.query)for(let r in e.query){let n=encodeURIComponent(e.query[r]),i=`${encodeURIComponent(r)}=${n}`;t.length>0&&(t+="&"),t+=i}else t=e.query;this.query?(r=`${this.query}&${t}`,"?"!==r.charAt(0)&&(r=`?${r}`)):r=`?${t}`}const n=t.location;let i,s=e.fullPath;return s.startsWith(V)&&(s=s.substring(V.length+2)),i=r?"path"==this.mode?`${this.base}/${s}${r}`:`${n.pathname}${r}#${s}`:"path"==this.mode?`${this.base}/${s}`:`${n.pathname}#${s}`,`${n.origin}${i}`}}function Ze(e=!0,t="",r=!0,n=!1,i){return new Qe("hash","",t,e,r,n,i)}class et{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=[]}listen(e){this.changeHandler=e}[We](e){"function"==typeof this.changeHandler&&this.changeHandler(e)}go(e){if(0==this.queue.length||this.cursor<=0||this.cursor>=this.queue.length-1)return;let t=this.cursor+e;if(t<0?t=0:t>this.queue.length-1&&(t=this.queue.length-1),t!=this.cursor){this.cursor=t;const e=this.queue[t];this[We](e.routes)}}push(e){this.queue.length>=this.maxSize&&this.queue.splice(0,1),this.queue.push(e),this.cursor=this.queue.length-1}replace(e){let t=this.queue.length-this.cursor;this.queue.splice(this.cursor,t),this.queue[this.cursor]=e}}function tt(e="",t=50){return new et(e,t)}const rt=Symbol("_constructRouteModel"),nt=Symbol("_findRouteModel"),it=Symbol("_findRootView"),st=Symbol("_getFirstView"),ot=Symbol("_removeView"),lt=Symbol("_buildPage"),at=Symbol("_resolveComponent"),ut=Symbol("_update"),ht=Symbol("_merge"),ct=Symbol("ignoreHistoryChangeOnceKey"),ft=Symbol("_handleHistoryChange"),pt=Symbol("_handleRouteUpdated"),dt=Symbol("routeUpdatedCallback"),yt=Symbol("currentRoutes"),mt=Symbol("current"),gt=Symbol("_addRouteRecorder"),vt=Symbol("_removeRouteRecorder"),bt=Symbol("_cloneRouteRecorder"),wt=Symbol("_hanldeError"),xt=Symbol("errorCallback"),St=Symbol("registerKey"),Rt=Symbol("notFoundKey"),At=Symbol("notFoundPathKey"),Et=Symbol("forestKey"),Ct=Symbol("historyKey"),jt=Symbol("beforeFiltersKey"),Pt=Symbol("afterFiltersKey"),Tt=Symbol("destroyFiltersKey"),Ot=Symbol("mainDispatcherKey"),qt=Symbol("initKey"),$t=Symbol("requireKey"),Ft=Symbol("readyKey"),kt=Symbol("readyHandlersKey"),_t=Symbol("_markReady"),Mt=Symbol("_createNextFn"),Nt=Symbol("_start"),Kt=Symbol("_before"),It=Symbol("_after"),Lt=Symbol("_destroy"),Dt=Symbol("_load"),Ht=Symbol("_unload"),Ut=Symbol("_loadDependency"),Bt=Symbol("resolvedModulesKey"),Wt=Symbol("resolveDependencyKey"),Vt=Symbol("routerGuardKey");class zt{[St]=new Array;[Rt];[At]="*";[Ft]=!1;[kt]=[];[Et]=new pe;[Ct];[yt]=new Array;[xt]=null;[dt]=null;[jt]=new Array;[Pt]=new Array;[Tt]=new Array;[Ot]=new Le;[Bt]=new Map;[Wt]=null;[Vt]=new ye;[qt]=!1;[mt]=t.ref(null);[$t]=null;get require(){return me?(this[$t]||(this[$t]=new De),this[$t]):null}get current(){return this[mt].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[Ct]=e.history:this[Ct]=me?Ze():tt(),this[Ct]?.listen((async e=>{let t=!0;try{if("string"==typeof e){let t=this[J](e);t&&await this[ft]([t])}else await this[ft](e)}catch(e){t=!1}!1===this[Ft]&&this[_t](t)}))}[wt](e="error",t){if(t&&"function"==typeof t.error)try{t.error(e)}catch{}if("function"==typeof this[xt])try{this[xt](e,t)}catch{}}init(){!0!==this[qt]&&(this[Ct]?.init(!this[Ft]),this[qt]=!0)}isReady(){return this[Ft]?Promise.resolve():new Promise(((e,t)=>{this[kt].push([e,t])}))}[_t](e){this[Ft]=!0,this[kt].forEach((([t,r])=>{try{e?t():r()}catch(e){}}))}[ct]=!1;[ft](e){if(this[ct])return this[ct]=!1,Promise.resolve();try{if(!e){let e=[...this[yt]].reverse();return this[Ht](e),me&&ge().location.reload(),Promise.resolve()}let t=null,r=[],n=[],i=0;for(;i<e.length&&i<this[yt].length&&Q.isSame(e[i],this[yt][i]);i++)e[i].opsType===ne.Open&&!0===e[i].active&&e[i].active!==this[yt][i].active&&(t=e[i]);if(i<e.length&&(r=e.slice(i)),i<this[yt].length&&(n=this[yt].slice(i).reverse()),0==n.length&&0==r.length){if(null!==t)return this.restore([t])}else{if(!(n.length>0))return this.restore(r);if(this[Ht](n)){if(r.length>0)return this.restore(r);if(null!==t)return this.restore([t])}}}catch(e){this[wt](e)}return Promise.resolve()}[pt](e){if(e)this[mt].value=e;else{let e=this[yt].length;this[mt].value=e>0?this[yt][e-1]:null}if("function"==typeof this[dt])try{this[dt](this[mt].value)}catch{}}[gt](e,t=-1){t<0||t>=this[yt].length?this[yt].push(e):this[yt].splice(t,0,e)}[bt](){let e=[];for(let t of this[yt]){let r=Q.clone(t,!0);e.push(r)}return e}[vt](e){if(null==this[yt])return;let t=-1;for(let r=0;r<this[yt].length;r++)if(Q.isSame(this[yt][r],e)){t=r;break}if(-1!=t){let e=this[yt][t];this[yt].splice(t,1),this[Lt](e,e.session)}}set hisotryMonitor(e){this[Ct]&&(this[Ct].historyMonitor=e)}get historyMonitor(){return!!this[Ct]&&this[Ct].historyMonitor}set traceless(e){this[Ct]&&(this[Ct].traceless=e)}get traceless(){return!!this[Ct]&&this[Ct].traceless}onRouteUpdated(e){this[dt]=e}onError(e){this[xt]=e}beforeEach(e){this[jt].push(e)}removeBeforeEach(e){const t=this[jt].indexOf(e);return-1!==t&&(this[jt].splice(t,1),!0)}afterEach(e){this[Pt].push(e)}removeAfterEach(e){const t=this[Pt].indexOf(e);return-1!==t&&(this[Pt].splice(t,1),!0)}destroyEach(e){this[Tt].push(e)}removeDestroyEach(e){const t=this[Tt].indexOf(e);return-1!==t&&(this[Tt].splice(t,1),!0)}setResolveDependency(e){this[Wt]=e}addRoutes(e){for(let t of e)this.addRoute(t)}addRoute(e,t=-1){if(e.path===this[At])return void this.setNotFoundRoute(e);const r=this[rt](e);if(-1==t)this[St]=[...this[St],...r];else for(let e=r.length-1;e>=0;e--)this[St].splice(t,0,r[e])}removeRoute(e){const t=this[J](e);if(null===t)return!1;for(let e=0;e<this[St].length;e++){const r=this[St][e];if(t?.path&&r.path===t.path)return this[St].splice(e,1),!0;if(t?.name&&r.name===t.name)return this[St].splice(e,1),!0}return!1}hasRoute(e){const t=this[J](e);return null!==t&&-1!==this[St].findIndex((e=>{if(t?.path&&e.path===t.path||t?.name&&e.name===t.name)return!0}))}setNotFoundPath(e){this[At]=e}setNotFoundRoute(e){const t=this[rt](e);this[Rt]=t[0]}getRoutes(){return[...this[St]]}[rt](e){let t=e.path??"";t.length>0&&"/"!==t.charAt(0)&&(t=`/${t}`);let r=e.components??(e.component&&{"":e.component});if(null==r){let r=new te;return r.path=t,r.redirect=e.redirect,[r]}let n=[];for(let t in r){let i=r[t];0===t.length&&(t=V);let s=new Z(t,i,e.props,e.meta);n.push(s)}let i=!1,s=[];if(e.children)for(let r of e.children){let e=this[rt](r);for(let r of e){let e=new te;e.name=r.name,r.path&&r.path.length>0?e.path="/"!==t?`${t}${r.path}`:r.path:(i=!0,e.path=t);let o=new ee;o.models=[...n],e.layers=[o,...r.layers],s.push(e)}}if(!i){let r=new ee;r.models=n;let i=new te;i.name=e.name,i.path=t,i.layers=[r],s.splice(0,0,i)}return s}[nt](e){let t=e.route;try{for(let r of this[St]){if(t.path&&r.path){let n=r.match;n||(n=r.match=D(r.path));let i=n(t.path);if(!i)continue;if(r.redirect){let n=new Q;c(!0,n,t),n.path=r.redirect;let i={route:n,find:void 0};return!!this[nt](i)&&(e.route=i.route,e.find=i.find,!0)}if(t.params=t.params??{},c(!0,t.params,i.params),t.query){let e=t.query;if("string"==typeof e){let r={},n=e.split("&");for(let e of n){let t=e.split("=");if(2!==t.length)continue;let n=decodeURIComponent(t[0].trim()),i=decodeURIComponent(t[1].trim());r[n]=i}c(!0,t.params,r)}else"object"==typeof e&&c(!0,t.params,e)}return e.find=r,!0}if(t.name===r.name){t.params=t.params??{};let n=L(r.path);return t.path=n(t.params),e.find=r,!0}}}catch(e){"function"==typeof t.error&&t.error(e.message)}return!1}[J](e){let t=null;if(Array.isArray(e))if(t=new Q,"object"==typeof e[0])t=Q.from(e[0]);else for(let r=0;r<e.length;r++)0===r?"/"===e[r].charAt(0)?t.path=e[r]:t.name=e[r]:1===r?t.params=e[r]:2===r?t.root=e[r]:3===r&&c(!1,t,e[r]);else"object"==typeof e?t=Q.from(e):"string"==typeof e&&(t=new Q,"/"==e.charAt(0)?t.path=e:t.name=e);if(t){if(t.path){let e=t.path.indexOf("?");-1!==e&&e<t.path.length-1&&(t.query=t.path.substring(e+1),t.path=t.path.substring(0,e))}t.root=t.root??V,t.opsType=t.opsType??this.options.defaultOperationType??ne.Push}return t}push(...e){let t=this[J](e);return t?(t.opsType=t.opsType||ne.Push,this.to(t)):(this[wt]("resolve route fail",t),this)}put(...e){let t=this[J](e);return t?(t.opsType=ne.Put,this.to(t)):(this[wt]("resolve route fail",t),this)}replace(...e){let t=this[J](e);return t?(t.opsType=ne.Replace,this.to(t)):(this[wt]("resolve route fail",t),this)}append(...e){let t=this[J](e);return t?(t.opsType=ne.Append,this.to(t)):(this[wt]("resolve route fail",t),this)}remove(e){return new Promise((t=>{this[Ot].post((r=>{try{if(0===this[yt].length)return r.resolve(),void t(!1);let n,i=-1,s=[];if(e){if(n=e.root?e.root:this[yt][0].root??V,e.all)for(let e=this[yt].length-1;e>0;e--){let t=this[yt][e];t.opsType===ne.Append&&t.root===n&&(s.splice(0,0,t),i=e-1)}else if(e.until)for(let t=this[yt].length-1;t>0;t--){let r=this[yt][t];if(r.opsType===ne.Append&&r.root===n){if("/"===e.until.charAt(0)&&e.until===r.path){i=t;break}if(e.until===r.name){i=t;break}s.splice(0,0,r)}}}else{n=V;let e=this[st](this[Et]);e&&(n=e.name);for(let e=this[yt].length-1;e>0;e--){let t=this[yt][e];if(t.opsType===ne.Append&&t.root===n){s.push(t),i=e-1;break}}}if(0===s.length){let e="can not find route";return r.resolve(e),void t(!1)}let o=0;if(this[yt].forEach((e=>{e.opsType!==ne.Put&&o++})),this[Ht](s)){let e=0;this[yt].forEach((t=>{t.opsType!==ne.Put&&e++}));let n=o-e;this[ct]=!0,this.back(n),r.resolve(),t(!0)}}catch(e){this[wt](e),r.resolve(),t(!1)}}))}))}open(...e){let t=this[J](e);return t?(t.opsType=ne.Open,this.to(t)):(this[wt]("resolve route fail",t),this)}close(e){return this[Ot].post((t=>{try{let r=this[J](e);if(!r)return void t.reject("resolve route fail");let n=[];for(let e=0;e<this[yt].length;e++){let t=this[yt][e];if(t.root===r.root){if(r.path&&r.path===t.path){n.push(t);break}if(r.name&&r.name===t.name){n.push(t);break}}}if(0===n.length)return void t.resolve();if(this[Ht](n)){let e=Q.clone(r,!0);const t=new Ve(e,this[bt]());this[Ct]?.replace(t),this[pt]()}t.resolve()}catch(e){this[wt](e),t.resolve()}})),this}to(...e){let t=this[J](e);if(!t)return this[wt]("resolve route fail",t),this;let r=this[Vt].acquire(t);return null==r?(this[wt]("route forbid",t),this):(this[Ot].post((e=>{try{let n=this[Nt](t);this[Kt](n),!n.session?.routeModel&&this[Wt]&&this[Ut](n),this[Dt](n),this[It](n),n.wait(((n,i)=>{let s=n.session.to;try{let e=Q.clone(s,!0);const t=new Ve(e,this[bt]());s.opsType===ne.Replace?this[Ct]?.replace(t):this[Ct]?.push(t)}catch(e){}if(this[Vt].release(r),this[pt](s),"function"==typeof t.success)try{Reflect.apply(t.success,{},[])}catch(e){}!1===this[Ft]&&this[_t](!0),e.resolve()}),((n,i)=>{this[Vt].release(r),this[wt](i,t),!1===this[Ft]&&this[_t](!1),e.resolve()}))}catch(n){this[Vt].release(r),this[wt](n,t),e.resolve()}})),this)}back(e=1){this[Ct]?.go(-e)}[Mt](e){return(t,r)=>{if("boolean"==typeof t)t?e.resolve():e.reject(r);else if(t){let r=this[J](t);if(r){let t=e.session.to;r.success=t.success,r.error=t.error,e.session.to=r,e.session.routeModel=null,e.resolve()}else e.reject("route resolve fail")}else e.resolve()}}[Nt](e){let t=this[yt].length>0?this[yt][0]:void 0,r=new Y(e,t),n={route:e,find:null};return this[nt](n),n.find&&(r.routeModel=n.find,e.matched=function(e){let t=[];return e.layers.forEach((e=>{null==e.models||null==e.models||e.models.forEach((e=>{if(null!=e&&null!=e)if("object"==typeof e.meta){let r=c(!0,{},e.meta);t.push(r)}else e.meta&&t.push(e.meta)}))})),t}(n.find),Array.isArray(e.matched)&&e.matched.length>0&&(e.meta=n.find.layers[0].models[0].meta)),new Le(r)}[Kt](e){for(let t of this[jt])e.post((e=>{let r=this[Mt](e);Reflect.apply(t,{},[e.session.to,e.session.from,r,e.session])}))}[It](e){e.post((e=>{for(let t of this[Pt])try{Reflect.apply(t,{},[e.session.to,e.session.from,e.session])}catch(e){}e.resolve()}))}[Lt](e,t){for(let r of this[Tt])try{Reflect.apply(r,{},[e,t])}catch(e){}"function"==typeof e.destroy&&Reflect.apply(e.destroy,e,[])}[Ut](e){let t=e.session,r=Reflect.apply(this[Wt],this,[t?.to]);if(null==r)return;Array.isArray(r)||(r=[r]);let n=[];for(let e of r)this[Bt].has(e)||n.push(e);0!==n.length&&e.post((e=>{this.require.ensure(n,((...t)=>{if(t){for(let e of t){if(!e)continue;let t;t=u(e)?e.default:e,Array.isArray(t)&&this.addRoutes(t)}for(let e of n)this[Bt].set(e,!0);e.resolve()}else e.reject()}))}))}[Dt](e){e.post((e=>{let t=e.session.to,r=e.session.routeModel;if(null==r){let n={route:t,find:null};if(this[nt](n))r=n.find,e.session.routeModel=r;else{if(!this[Rt])return void e.reject(`not find route model, path:${t.path??t.name}`);r=this[Rt]}}let n=Y.from(e.session);this[lt](t,r,n).then((t=>{this[Et],e.resolve()}),(t=>{e.reject(t)}))}))}[Ht](e){if(0==e.length)return!0;let t=this[Et],r=[];for(let n of e){let e=this[it](t,n);null!=e&&r.push({...e,route:n})}if(0==r.length){let e="can not find view index";return this[wt](e),!1}for(let e of r.reverse())this[ot](t,{x:e.x,y:e.y},[e.route.index??0],!0);return!0}[it](e,t){let r,n=t.root??V;for(let t=0;t<e.layers.length;t++){let i=e.layers[t];for(let e=i.views.length-1;e>=0;e--){let s=i.views[e];if(s[se]&&s[ae]===n)return r={x:e,y:t},r}}return null}[st](e){return e.layers.length>0&&e.layers[0].views.length>0?e.layers[0].views[0]:null}[ot](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],s=!1,o=[],l=!1,a=i.slots.value;for(let e=a.length-1;e>=0;e--){let n=a[e];(null==r||-1!=r.indexOf(n.index))&&(n.route&&i[se]&&(this[vt](n.route),!0===n.active&&n.route.opsType==ne.Append&&(l=!0)),o.push(new ce(i,n.index,t.y)),a.splice(e,1))}if(0==a.length)n?i.slots.value=[...a]:e.layers[t.y].views.splice(t.x,1);else{if(l){let e=a[a.length-1];e.active=!0,e.route&&(e.route.active=e.active)}i.slots.value=[...a]}0==e.layers[t.y].views.length&&(s=!0);let u=t.y+1;for(;u<e.layers.length;u++){let t=e.layers[u].views,r=[];for(let n=t.length-1;(s||o.length>0)&&n>=0;n--){let i=t[n];if(i[le]&&(s||ce.include(o,i[le]))){let t=i.slots.value;for(let e=t.length-1;e>=0;e--){let n=t[e];n.route&&i[se]&&this[vt](n.route),r.push(new ce(i,n.index,u)),t.splice(e,1)}e.layers[u].views.splice(n,1)}}o=r,0==e.layers[u].views.length&&(s=!0)}}restore(e){if(e&&0!=this[St].length)return new Promise(((t,r)=>{for(let t=0;t<e.length;t++){let r=e[t];this[Ot].post((e=>{let t=this[Nt](r);this[Kt](t),!t.session?.routeModel&&this[Wt]&&this[Ut](t),this[Dt](t),this[It](t),t.wait(((t,r)=>{e.resolve()}),((t,r)=>{this[wt](r),e.resolve()}))}))}this[Ot].post((e=>{e.resolve(),t()}))}));{let e=this[Et];if(e.layers.length>0){let t=e.layers[0].views;t.length>0&&(t[0].slots.value=[])}return this[yt]=[],this[pt](),Promise.resolve()}}[lt](e,t,r){let n=e.updateType??ie.Part;return this[at](t).then((()=>{this[ut](t,e,r,n)}))}[at](e){let t=[];for(let r=0;r<e.layers.length;r++){let n=e.layers[r];for(let e=0;e<n.models.length;e++){let r=n.models[e];r.isResolved||t.push(r.resolve())}}return t.length>0?Promise.all(t):Promise.resolve()}[ut](e,t,r,n){if(1!==e.layers[0].models.length)return Promise.reject("illegal route structure(multil root node)");const i=e.layers[0].models[0];let s,o=this[Et],l=function(e){return 0==e.layers.length||0==e.layers[0].views.length}(o),a=t.root??V;!l&&n==ie.Part&&(s=this[it](o,t));let u,h=0;if(null==s||null==s)if(l||n===ie.All){if(0==o.layers.length&&(o.layers[0]=new fe),0==o.layers[0].views.length){let e=t.root??V;u=new he(e,!0,null),o.layers[0].views=[u]}else u=o.layers[0].views[0];s={x:0,y:0}}else{let e=t.slot;if(!e)return Promise.reject("can not rebuild view(because not route slot)");let r,n=e.level;if(n>o.layers.length)return Promise.reject("can not insert view(override level)");if(e.rootName){let t=o.layers[n-1];for(let i of t.views){if(i[se]&&i.name===e.rootName){r=new ce(i,e.rootIndex??0,n-1);break}if(i[oe]&&i[oe].view.name===e.rootName&&i[oe].index===e.rootIndex){r=i[oe];break}}}if(!r)return Promise.reject("can not insert view(not find root node ref)");u=new he(a,!0,r),o.layers[n].views.push(u),s={x:o.layers[n].views.length-1,y:n}}else u=o.layers[s.y].views[s.x];if(h=s.y,u[se]=!0,t.opsType===ne.Append){t.index=p.get();let r=u.slots.value;if(r.length>0){let e=r[r.length-1];e.active=!1,e.route&&(e.route.active=e.active)}let n=new ue(t,i,t.index,!0);u.slots.value=[...r,n];let s=h+1,l=1,a=new ce(u,t.index,h);this[ht](o,s,e,l,a)}else if(t.opsType===ne.Open){let r=u.slots.value,n=!1;for(let e of r){if(null!==e.route&&Q.isSameForRouteModel(e.route,t)){if(1==e.active)return t.index=e.index,t.active=e.active,e.route=t,Promise.resolve();e.active=!0,n=!0,t.index=e.index,t.active=e.active,e.route=t,this[vt](e.route)}else e.active=!1;e.route&&(e.route.active=e.active)}if(!n){t.index=p.get(),t.active=!0;let n=new ue(t,i,t.index,!0);r.push(n);let s=h+1,l=1,a=new ce(u,t.index,h);this[ht](o,s,e,l,a)}u.slots.value=[...r]}else{let r=u.slots.value;if(0==r.length){t.index=p.get(),u.slots.value=[new ue(t,i,t.index)];let r=h+1,n=1,s=new ce(u,t.index,h);this[ht](o,r,e,n,s)}else{let n=r[0];if(n.model!==i){this[ot](o,s,null,!0),t.index=p.get(),u.slots.value=[new ue(t,i,t.index)];let r=h+1,n=1,l=new ce(u,t.index,h);this[ht](o,r,e,n,l)}else{null!==n.route&&this[vt](n.route);let i=[];for(let e=1;e<r.length;e++)i.push(r[e].index);i.length>0&&this[ot](o,s,i,!0),t.index=n.index,n.route=t;let l=[new ce(u,t.index,h)],a=h+1,c=1,f=new ce(u,t.index,h);for(;l.length>0&&a<o.layers.length&&c<e.layers.length;a++,c++){let t=[];for(let e=0;e<o.layers[a].views.length;e++){let r=o.layers[a].views[e];r[le]&&ce.include(l,r[le])&&t.unshift(e)}let r=[];for(let n of t){let t,i=o.layers[a].views[n],s=e.layers[c].models;for(let e=0;e<s.length;e++)if(i.name===s[e].name){t=s[e];break}if(t){let s=i.slots.value;if(0==s.length){let r=0;i.slots.value=[new ue(null,t,r)];let n=a+1,s=c+1;this[ht](o,n,e,s,f)}else{let l=s[0];if(l.model!==t){this[ot](o,{x:n,y:a},null,!0),i.slots.value=[new ue(null,t,0)];let r=a+1,s=c+1;this[ht](o,r,e,s,f)}else{i[se]&&null!==l.route&&this[vt](l.route);let e=[];for(let t=1;t<s.length;t++)e.push(s[t].index);e.length>0&&this[ot](o,{x:n,y:a},e,!0),r.push(new ce(i,l.index,a))}}i[se]=!1}else this[ot](o,{x:n,y:a},null,!1)}l=r}this[ht](o,a,e,c,f)}}}if(u&&u[oe]){let e=u[oe];e&&(t.slot=new X(a,h,e?.view.name,e?.index??0))}r.to=void 0,r.routeModel=void 0,t.session=r,this[gt](t)}[ht](e,t,r,n,i){let s=n,o=t;for(;o<e.layers.length&&s<r.layers.length;o++,s++){let t=e.layers[o].views;for(let e of r.layers[s].models){let r=new he(e.name,!1,i),n=new ue(null,e);r.slots.value=[n],t.push(r)}}for(;s<r.layers.length;s++){let t=new fe;t.views=[];for(let e of r.layers[s].models){let r=new he(e.name,!1,i),n=new ue(null,e);r.slots.value=[n],t.views.push(r)}e.layers.push(t)}}[z](e,t,r,n,i,s){if(t<0||t>this[Et].layers.length)return null;if(t<this[Et].layers.length){let o=this[Et].layers[t],l=null;for(let a of o.views){let o=!1;if(null!==r?(o=a.name===e&&a[oe]?.view===r,o&&-1!==n&&(o=a[oe]?.index===n)):o=a.name===e,o){null!==i&&(a[le]={view:i,index:s,level:t-1}),l=a;break}}if(null!==l)return l}let o=null,l=null;null!==i&&(o=i[se]?{view:i,index:s,level:t-1}:i[oe],l={view:i,index:s,level:t-1});let a=new he(e,!0,o);if(a[le]=l,t==this[Et].layers.length){let e=new fe;e.views=[a],this[Et].layers.push(e)}else this[Et].layers[t].views.push(a);return a}}var Jt=(e=>(e[e.limitless=0]="limitless",e[e.once=1]="once",e))(Jt||{});const Gt=Symbol("registerKey");class Xt{policy;callback;constructor(e,t){this.callback=e,this.policy=t}}class Yt{[Gt]=new Map;constructor(){}on(e,t,r=!1){let n=this[Gt].get(e);n||(n=new Array,this[Gt].set(e,n));let i=new Xt(t,!0===r?1:0);return n.push(i),this}off(e,t){if(!t)return this[Gt].delete(e),this;let r=this[Gt].get(e);if(r)for(let e=0;e<r.length;e++)if(r[e].callback===t){r.splice(e,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("function"!=typeof r)return this;let n=t-1,i=new Array(n),s=[].splice.call(e,0,n);for(let e=0;e<s.length;e++)this.once(s[e],(t=>{i[e]=t,n-=1,0==n&&Reflect.apply(r,{},i)}));return this}emit(e,...t){let r=this[Gt].get(e);if(!r)return this;for(let e=0;e<r.length;){let n=r[e];if(1==n.policy?r.splice(e,1):e++,"function"==typeof n.callback)try{y((()=>{Reflect.apply(n.callback,{},t)}))}catch(e){}}return this}trigger(e,...t){return Reflect.apply(this.emit,this,[e,...t])}}const Qt=Symbol("registerKey");class Zt{[Qt]=new Map;constructor(){}set(e,t){this[Qt].set(e,t)}get(e){return this[Qt].get(e)}has(e){return this[Qt].has(e)}delete(e){return this[Qt].delete(e)}}const er=Symbol("lc");function tr(e,t=!1){let r=e,n=r[er];if(!n){if(!t)return null;n=new Zt,r[er]=n}return n}function rr(e,t){let r=e;for(;null!==r;){let e=r[er];if(e&&e.has(t))return e.get(t);r=r.$parent}return null}function nr(e){if(Array.isArray(e.children)&&e.children.length>0){let t=e.children[0];if(null!=t&&null!=t.component&&null!=t.component.proxy)return tr(t.component.proxy,!1)}return null}const ir=Symbol("hooksKey");function sr(e,t){let r=e.get(ir);if(null!=r)for(let e=r.length-1;e>=0;e--){let n=r[e];if(n.type===t)try{Reflect.apply(n.hook,n.target,[])}catch(e){}}}var or=(e=>(e.DEACTIVATED="da",e.ACTIVATED="a",e))(or||{});class lr{type;hook;target;constructor(e,t,r){this.target=r,this.hook=t,this.type=e}}function ar(e){return(r,n)=>{let i;if(n)i=n;else{let e=t.getCurrentInstance();if(null==e||null==e.proxy)return;i=e.proxy}let s=rr(i,ir);null!=s&&(t.onUnmounted((()=>{!function(e,t,r,n){let i=-1;for(let s=0;s<e.length;s++){let o=e[s];if(o.type===t&&o.hook===r&&o.target===n){i=s;break}}-1!=i&&e.splice(i,1)}(s,e,r,i)})),function(e,t,r,n){let i=new lr(t,r,n);e.push(i)}(s,e,r,i))}}let ur=ar("a"),hr=ar("da");const cr=Symbol("routeKey");function fr(e,r){let n=e.get(cr);if(n){let e={path:"",name:"",params:{},index:-1,session:{}};Object.assign(e,r),Object.assign(n,e)}else n=function(){let e=new Q;return e.path="",e.name="",e.params={},e.index=-1,t.shallowReactive(e)}(),Object.assign(n,r),e.set(cr,n)}function pr(e){return rr(e,cr)??null}const dr=Symbol("rk"),yr=Symbol("vd"),mr=Symbol("rv"),gr=Symbol("rvi"),vr=Symbol("pv"),br=Symbol("pvi");function wr(e,t=!1){let r=null;return r=t?e.showFromClass??e.enterFromClass:e.enterFromClass,r||(r=e.transitionName,r?t?`${r}-show-from`:`${r}-enter-from`:null)}function xr(e,t=!1){let r=null;return r=t?e.showActiveClass??e.enterActiveClass:e.enterActiveClass,r||(r=e.transitionName,r?t?`${r}-show-active`:`${r}-enter-active`:null)}function Sr(e){let t,r=e.duration;return"object"==typeof r?t={enter:r.enter??-1,leave:r.leave??-1,show:r.show??-1,hide:r.hide??-1}:("string"==typeof r&&(r=0==r.length?-1:Number(r)),t={enter:r,leave:r,show:r,hide:r}),t}function Rr(e,t){e.classList.contains(t)||e.classList.add(t)}function Ar(e,t){e.classList.remove(t)}const Er=me&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout;function Cr(e){Er(e)}function jr(e,t,...r){!n(t)||(null==e&&(e={}),Reflect.apply(t,e,r))}function Pr(e,t,r,i=-1,s,o,l,a){if(n(o)){if(void 0!==s&&s>=0)return void setTimeout((()=>{Reflect.apply(o,e,[t,r,i]),n(a)&&Reflect.apply(a,e,[])}),s);let l=["animationend","transitionend"],u=n=>{l.forEach((e=>{we(t,e,u)})),Reflect.apply(o,e,[t,r,i]),a&&Reflect.apply(a,e,[])};l.forEach((e=>{be(t,e,u)}))}if(n(l)){let n="animationcancel",s=o=>{Reflect.apply(l,e,[t,r,i]),we(t,n,s)};be(t,n,s)}}function Tr(e){return!(!me||null===e)&&(e.opsType===ne.Append||e.opsType===ne.Open)}function Or(e,t,r,n,i={},s,o=-1){if(t&&(r||Tr(s))){let e=wr(i,r);e&&Rr(n,e);let t=xr(i,r);t&&Rr(n,t)}else{let t=function(e,t=!1){let r=null;return r=t?e.onBeforeShow??e.onBeforeEnter:e.onBeforeEnter,r}(i,r);jr(e,t,[n,s,o])}}function qr(e,t,r,i,s={},o,l,a,u){if(Tr(l)||r)if(t){let t=wr(s,r),h=xr(s,r),c=function(e,t=!1){let r=null;return r=t?e.showToClass??e.enterToClass:e.enterToClass,r||(r=e.transitionName,r?t?`${r}-show-to`:`${r}-enter-to`:null)}(s,r);Cr(c?()=>{Pr(e,i,l,a,o,(()=>{h&&Ar(i,h),c&&Ar(i,c),n(u)&&u(e,u,[i])})),t&&Ar(i,t),c&&Rr(i,c)}:()=>{t&&Ar(i,t),h&&Ar(i,h),n(u)&&u(e,u,[i])})}else{let t=function(e,t=!1){let r=null;return r=t?e.onShow??e.onEnter:e.onEnter,r}(s,r),o=function(e,t=!1){let r=null;return r=t?e.onAfterShow??e.onAfterEnter:e.onAfterEnter,r}(s,r),h=function(e,t=!1){let r=null;return r=t?e.onShowCancelled??e.onEnterCancelled:e.onEnterCancelled,r}(s,r),c=t=>{!t&&n(o)?jr(e,o,[i,l,a]):n(h)&&jr(e,h,[i,l,a]),n(u)&&u(e,u,[i])};n(t)?jr(e,t,[i,c,l,a]):c()}else n(u)&&u(e,u,[i])}function $r(e,t,r,i,s={},o,l,a,u,h){if(Tr(a)||r)if(t){let t=function(e,t=!1){let r=null;return r=t?e.hideFromClass??e.leaveFromClass:e.leaveFromClass,r||(r=e.transitionName,r?t?`${r}-hide-from`:`${r}-leave-from`:null)}(s,r),c=function(e,t=!1){let r=null;return r=t?e.hideActiveClass??e.leaveActiveClass:e.leaveActiveClass,r||(r=e.transitionName,r?t?`${r}-hide-active`:`${r}-leave-active`:null)}(s,r),f=function(e,t=!1){let r=null;return r=t?e.hideToClass??e.leaveToClass:e.leaveToClass,r||(r=e.transitionName,r?t?`${r}-hide-to`:`${r}-leave-to`:null)}(s,r);t&&Rr(i,t),c&&Rr(i,c),Cr(f?()=>{Pr(e,i,a,u,o,(()=>{c&&Ar(i,c),f&&Ar(i,f),n(h)&&jr(e,h,[i]),!r&&n(l)&&l()})),t&&Ar(i,t),f&&Rr(i,f)}:()=>{t&&Ar(i,t),c&&Ar(i,c),n(h)&&jr(e,h,[i]),!r&&n(l)&&l()})}else{let t=function(e,t=!1){let r=null;return r=t?e.onHide??e.onLeave:e.onLeave,r}(s,r),o=function(e,t=!1){let r=null;return r=t?e.onAfterHide??e.onAfterLeave:e.onAfterLeave,r}(s,r),c=function(e,t=!1){let r=null;return r=t?e.onHideCancelled??e.onLeaveCancelled:e.onLeaveCancelled,r}(s,r),f=t=>{!t&&n(o)?(jr(e,o,[i,a,u]),n(h)&&jr(e,h,[i]),!r&&n(l)&&l()):n(c)&&(jr(e,c,[i,a,u]),n(h)&&jr(e,h,[i]))};n(t)?jr(e,t,[i,f,a,u]):f()}else!r&&n(l)&&l()}function Fr(e,t={},r,n=-1){let i=m(t.css),s=t.mode??"default",o=Sr(t);return{mode:s,persisted:!1,beforeEnter:s=>{Or(e,i,!1,s,t,r,n)},enter:s=>{qr(e,i,!1,s,t,o.enter,r,n)},leave:(s,l)=>{$r(e,i,!1,s,t,o.leave,l,r,n)},clone:i=>Fr(e,t,r,n)}}function kr(e){return e.el}function _r(e,t,r={},i,s,o,l){if(o){let o=kr(t);if(null==o)return;let a=m(r.css),u=Sr(r);Or(e,a,!0,o,r,i,s),qr(e,a,!0,o,r,u.show,i,s,(t=>{n(l)&&jr(e,l,[t])}))}else n(l)&&jr(e,l,[])}function Mr(e,t,r={},i,s,o,l){if(o){let o=kr(t);if(null==o)return;let a=m(r.css),u=Sr(r);$r(e,a,!0,o,r,u.hide,null,i,s,(t=>{n(l)&&jr(e,l,[t])}))}else n(l)&&jr(e,l,[])}function Nr(e,t,r){return"function"==typeof e?Reflect.apply(e,{},[t,r]):e}function Kr(e,t){if(!e)return null;const r=e(t);return 1===r.length?r[0]:r}class Ir{node;state;constructor(e,t){this.node=e,this.state=t}}const Lr=t.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:()=>({})},viewClass:{type:[String,Function],required:!1},viewActiveClass:{type:[String,Function],required:!1},viewDeactiveClass:{type:[String,Function],required:!1},css:{type:[Boolean,String],required:!1,default:!0},transition:{type:[Boolean,String],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},onBeforeEnter:{type:Function,required:!1},onEnter:{type:Function,required:!1},onAfterEnter:{type:Function,required:!1},onEnterCancelled:{type:Function,required:!1},onBeforeLeave:{type:Function,required:!1},onLeave:{type:Function,required:!1},onAfterLeave:{type:Function,required:!1},onLeaveCancelled:{type:Function,required:!1},onBeforeShow:{type:Function,required:!1},onShow:{type:Function,required:!1},onAfterShow:{type:Function,required:!1},onShowCancelled:{type:Function,required:!1},onBeforeHide:{type:Function,required:!1},onHide:{type:Function,required:!1},onAfterHide:{type:Function,required:!1},onHideCancelled:{type:Function,required:!1}},setup(e,r){const n=t.getCurrentInstance();if(null===n||null===n.proxy)return;const i=!0===e.multi,s=t.inject(dr,null),o=t.inject(yr,0),l=t.inject(mr,null),a=t.inject(gr,-1);let u=!1,h=null;const f=e.modelSlot;if(f){t.provide(yr,o+1),t.provide(gr,f.index),t.provide(br,f.index);const e=f.route;if(!e)return;const r=tr(n.proxy,!0);(function(e){let t=e.get(ir);t||(t=[],e.set(ir,t))})(r),fr(r,e)}else{if(null==s)return;const r=e.name,c=t.inject(vr,null),f=t.inject(br,0);if(h=s[z](r,o,l,a,c,f),null===h)return;if(t.provide(vr,h),!0===h[se]&&t.provide(mr,h),i)u=m(e.transition??!0);else{u=m(e.transition??!1),t.provide(gr,-1),t.provide(yr,o+1),t.provide(br,-1);const r=h.slots.value;if(r.length>0){const e=r[0].route;if(e){fr(tr(n.proxy,!0),e)}}else{const e=tr(n.proxy,!0);h.compensation=()=>{const t=h.slots.value;if(t.length>0){const r=t[0].route;return r&&fr(e,r),!0}return!1}}}}const p={value:new Map};return t.onUnmounted((()=>{p.value&&p.value.clear()})),()=>{if(i){const i=new Map,s=[],o=h?.slots.value,l=[];for(let a=0;a<o.length;a++){const h=o[a],f=`${e.name}-${h.index}`,d={modelSlot:h};let y;y=r.slots.default?t.h(Lr,d,{default:r.slots.default}):t.h(Lr,d);const m={},g=Nr(e.viewClass,h.route,a);"string"==typeof g&&g.length>0&&(m[g]=!0);const v=Nr(e.viewActiveClass,h.route,a),b=Nr(e.viewDeactiveClass,h.route,a),w=p.value.get(f);if("string"==typeof v&&v.length>0&&(m[v]=h.active),"string"==typeof b&&b.length>0&&(m[b]=!h.active),w&&h.active!==w.state){const t=w.node;h.active?l.unshift((()=>{_r(n,t,e,h.route,a,u,(()=>{let e=nr(t);null!=e&&sr(e,or.ACTIVATED)}))})):l.push((()=>{Mr(n,t,e,h.route,a,u,(()=>{let e=nr(t);null!=e&&sr(e,or.DEACTIVATED)}))}))}const x={class:m,key:f},S=Nr(e.viewTagProps,h.route,a);null!==S&&"object"==typeof S&&c(!0,x,S),h.route?.viewTagAttrs&&"object"==typeof h.route?.viewTagAttrs&&c(!0,x,h.route.viewTagAttrs);const R=Nr(e.viewTag,h.route,a),A=t.h(R,x,{default:()=>[y]});if(i.set(f,new Ir(A,h.active)),u){const t=Fr(n,e,h.route,a);A.transition=t}s.push(A)}p.value=i,function(e,t={}){Cr((()=>{for(let r=0;r<e.length;r++)Reflect.apply(e[r],t,[])}))}(l,n);const a=Nr(e.tag,null,-1),f={};return Object.assign(f,r.attrs),t.h(a,f,{default:()=>s})}if(null!=f){const e=f.model,n={};e.props&&("object"==typeof e.props?c(!1,n,e.props):!0===e.props&&"object"==typeof f.route?.params&&c(!1,n,f.route?.params));const i=t.h(e.component,n);return Kr(r.slots.default,{Component:i,route:f.route})??i}{const i=h.slots.value;if(i.length>0){const s=i[0],o=s.model,l={};o.props&&("object"==typeof o.props?c(!1,l,o.props):!0===o.props&&"object"==typeof s.route?.params&&c(!1,l,s.route?.params));const a=t.h(o.component,l);if(u){const t=Fr(n,e,s.route,-1);a.transition=t}return Kr(r.slots.default,{Component:a,route:s.route})??a}return Kr(r.slots.fallback,{})}}}});function Dr(e,t){return"function"==typeof e?Reflect.apply(e,{},[t]):e}let Hr=t.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(e,r){const n=t.inject(dr,null);return()=>{let i=Dr(e.to,null),s=Dr(e.tag,i);if(null==s)return;let o=null,l=null;null!==n&&(o=n[J](i),e.root&&(o.root=e.root),l=n.current);let a={},u=Dr(e.activeClass,o);if("string"==typeof u&&u.length>0&&(a[u]=function(e,t){return null!=e&&null!=t&&!!(e.path&&t.path&&t.path.startsWith(e.path)||e.name&&e.name==t.name)}(o,l)),!0===Dr(e.exact,o)){let t=Dr(e.exactActiveClass,o);"string"==typeof t&&t.length>0&&(a[t]=function(e,t){return null!=e&&null!=t&&!!(e===t||e.path&&e.path===t.path||e.name&&e.name===t.name)}(o,l))}let h={class:a};("a"===s||"A"===s)&&(h.href=o?.path??o?.name??"#"),c(!0,h,r.attrs);let f=Dr(e.event,o);if("string"==typeof f){const e=e=>{null!=n&&null!=o&&function(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey||e.defaultPrevented||null!=e.button&&0!==e.button)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}(e)&&n.to(o)};h[f]=e}return t.h(s,h,r.slots)}}}),Ur={get each(){return R},get type(){return v},get isFunction(){return n},get isArray(){return r},get isArrayLike(){return w},get makeArray(){return S},get merge(){return x},get isWindow(){return b},get isPlainObject(){return l},get isEqual(){return A}};const Br=Symbol("fk"),Wr=Symbol("fbk"),Vr=Symbol("fepk");function zr(e){return e?e.$router:t.inject(dr)}e.Bus=K,e.EventChain=Le,e.EventProxy=Yt,e.Route=Q,e.Router=zt,e.cancel=function(e){let t=Re.get(e);return!!t&&(t.timer&&(clearTimeout(t.timer),t.timer=null),t.controller.abort(),Re.delete(e),!0)},e.clone=f,e.createFox=function(e={}){const t=new zt(e),r=new K,n=new Yt,i={...Ur,get router(){return t},get bus(){return r},get Bus(){return K},get eventproxy(){return n},get EventProxy(){return Yt},get EventChain(){return Le},get require(){return t.require},get request(){return Ae},get extend(){return c},get clone(){return f},install(e){e.provide(dr,t),e.provide(Br,i),e.provide(Wr,r),e.provide(Vr,n),e.component("fox-router-view",Lr),e.component("fox-router-link",Hr),Reflect.defineProperty(e.config.globalProperties,"$fox",{get:()=>i}),Reflect.defineProperty(e.config.globalProperties,"$router",{get:()=>t}),Reflect.defineProperty(e.config.globalProperties,"$bus",{get:()=>r}),Reflect.defineProperty(e.config.globalProperties,"$bus",{get:()=>r}),Reflect.defineProperty(e.config.globalProperties,"$eventProxy",{get:()=>n}),e.config.globalProperties.$fox_on=function(e,t,r=!1){n.on(e,t,r)},e.config.globalProperties.$fox_off=function(e,t){n.off(e,t)},e.config.globalProperties.$fox_once=function(e,t){n.once(e,t)},e.config.globalProperties.$fox_all=function(...e){let t=n;Reflect.apply(t.all,t,e)},e.config.globalProperties.$fox_trigger=function(e,...t){let r=n;Reflect.apply(r.trigger,r,[e,...t])},e.config.globalProperties.$fox_emit=function(e,...t){let r=n;Reflect.apply(r.trigger,r,[e,...t])},e.mixin({computed:{$route(){return pr(this)}}}),t.init()}};return i},e.createMemoryHistory=tt,e.createWebHashHistory=Ze,e.createWebHistory=function(e=!0,t=null,r="",n=!0,i=!1,s){return null!==t&&(t=ge().location.pathname),t&&t.endsWith("/")&&(t=t.substring(0,t.length-1)),new Qe("path",t??"",r,e,n,i,s)},e.extend=c,e.foxBusKey=Wr,e.foxEventProxyKey=Vr,e.foxKey=Br,e.isArray=r,e.isDate=e=>e instanceof Date,e.isESModule=u,e.isEqual=A,e.isFunction=n,e.isMap=e=>"[object Map]"===o(e),e.isObject=i,e.isPlainObject=l,e.isPromise=e=>i(e)&&n(e.then)&&n(e.catch),e.isSet=e=>"[object Set]"===o(e),e.isString=e=>"string"==typeof e,e.isSymbol=e=>"symbol"==typeof e,e.onAfterRouteUpdate=function(e){const r=zr(),n=(t,r,n)=>{try{Reflect.apply(e,{},[t,r])}catch(e){}n()};r.afterEach(n),t.onUnmounted((()=>{r.removeAfterEach(n)}))},e.onBeforeRouteUpdate=function(e){const r=zr(),n=(t,r,n)=>{try{Reflect.apply(e,{},[t,r])}catch(e){}n()};r.beforeEach(n),t.onUnmounted((()=>{r.removeBeforeEach(n)}))},e.onFoxActivated=ur,e.onFoxDeactivated=hr,e.request=Ae,e.toBoolean=m,e.toNumber=function(e){return"number"==typeof e?e:Number(e)},e.toTypeString=o,e.useBus=function(e){return e?e.$bus:t.inject(Wr)},e.useEventProxy=function(e){return e?e.$eventProxy:t.inject(Vr)},e.useFox=function(e){return e?e.$fox:t.inject(Br)},e.useRoute=function(e){return e||(e=t.getCurrentInstance()?.proxy??void 0),e?pr(e):null},e.useRouter=zr,Object.defineProperty(e,"__esModule",{value:!0})}));
|
package/libs/index.css
DELETED
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
@charset "UTF-8";
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
/*views window*/
|
|
4
|
-
.fox-views {
|
|
5
|
-
/*卡片容器class*/
|
|
6
|
-
}
|
|
7
|
-
.fox-views.fox-views-window {
|
|
8
|
-
display: block;
|
|
9
|
-
/*view class*/
|
|
10
|
-
}
|
|
11
|
-
.fox-views.fox-views-window .fox-view {
|
|
12
|
-
position: fixed;
|
|
13
|
-
top: 0px;
|
|
14
|
-
left: 0px;
|
|
15
|
-
width: 100%;
|
|
16
|
-
-webkit-box-sizing: border-box;
|
|
17
|
-
box-sizing: border-box;
|
|
18
|
-
z-index: 100;
|
|
19
|
-
}
|
|
20
|
-
.fox-views.fox-card-views {
|
|
21
|
-
position: relative;
|
|
22
|
-
width: 100%;
|
|
23
|
-
height: 100%;
|
|
24
|
-
box-sizing: border-box;
|
|
25
|
-
/*卡片页class*/
|
|
26
|
-
/*卡片页激活class*/
|
|
27
|
-
/*卡片页失活class*/
|
|
28
|
-
}
|
|
29
|
-
.fox-views.fox-card-views .fox-card-view {
|
|
30
|
-
width: 100%;
|
|
31
|
-
height: 100%;
|
|
32
|
-
}
|
|
33
|
-
.fox-views.fox-card-views .fox-card-view-active {
|
|
34
|
-
z-index: 1;
|
|
35
|
-
}
|
|
36
|
-
.fox-views.fox-card-views .fox-card-view-deactive {
|
|
37
|
-
display: none;
|
|
38
|
-
z-index: 0;
|
|
39
|
-
}
|
|
40
|
-
.fox-views .fox-view-trans-enter-to {
|
|
41
|
-
animation: fox-view-in-slide-right 330ms;
|
|
42
|
-
-webkit-animation: fox-view-in-slide-right 330ms;
|
|
43
|
-
z-index: 120;
|
|
44
|
-
}
|
|
45
|
-
.fox-views .fox-view-trans-leave-to {
|
|
46
|
-
animation: fox-view-out-slide-right 320ms;
|
|
47
|
-
-webkit-animation: fox-view-out-slide-right 320ms;
|
|
48
|
-
z-index: 120;
|
|
49
|
-
}
|
|
50
|
-
.fox-views .fox-view-trans-show-to {
|
|
51
|
-
animation: fox-view-show-slide-right 300ms;
|
|
52
|
-
-webkit-animation: fox-view-show-slide-right 300ms;
|
|
53
|
-
z-index: 110;
|
|
54
|
-
}
|
|
55
|
-
.fox-views .fox-view-trans-hide-to {
|
|
56
|
-
animation: fox-view-hide-slide-left 320ms;
|
|
57
|
-
-webkit-animation: fox-view-hide-slide-left 320ms;
|
|
58
|
-
z-index: 110;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/* 进场动画 */
|
|
62
|
-
@-webkit-keyframes fox-view-in-slide-right {
|
|
63
|
-
0% {
|
|
64
|
-
-webkit-transform: translateX(103%);
|
|
65
|
-
transform: translateX(103%);
|
|
66
|
-
}
|
|
67
|
-
100% {
|
|
68
|
-
-webkit-transform: translateX(0%);
|
|
69
|
-
transform: translateX(0%);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
@keyframes fox-view-in-slide-right {
|
|
73
|
-
0% {
|
|
74
|
-
-webkit-transform: translateX(103%);
|
|
75
|
-
transform: translateX(103%);
|
|
76
|
-
}
|
|
77
|
-
100% {
|
|
78
|
-
-webkit-transform: translateX(0%);
|
|
79
|
-
transform: translateX(0%);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
/* 出场动画 */
|
|
83
|
-
@-webkit-keyframes fox-view-out-slide-right {
|
|
84
|
-
0% {
|
|
85
|
-
-webkit-transform: translateX(0%);
|
|
86
|
-
transform: translateX(0%);
|
|
87
|
-
}
|
|
88
|
-
100% {
|
|
89
|
-
-webkit-transform: translateX(103%);
|
|
90
|
-
transform: translateX(103%);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
@keyframes fox-view-out-slide-right {
|
|
94
|
-
0% {
|
|
95
|
-
-webkit-transform: translateX(0%);
|
|
96
|
-
transform: translateX(0%);
|
|
97
|
-
}
|
|
98
|
-
100% {
|
|
99
|
-
-webkit-transform: translateX(103%);
|
|
100
|
-
transform: translateX(103%);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
/* 隐藏动画 */
|
|
104
|
-
@-webkit-keyframes fox-view-hide-slide-left {
|
|
105
|
-
0% {
|
|
106
|
-
-webkit-transform: translateX(0%);
|
|
107
|
-
transform: translateX(0%);
|
|
108
|
-
}
|
|
109
|
-
100% {
|
|
110
|
-
-webkit-transform: translateX(-30%);
|
|
111
|
-
transform: translateX(-30%);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
@keyframes fox-view-hide-slide-left {
|
|
115
|
-
0% {
|
|
116
|
-
-webkit-transform: translateX(0%);
|
|
117
|
-
transform: translateX(0%);
|
|
118
|
-
}
|
|
119
|
-
100% {
|
|
120
|
-
-webkit-transform: translateX(-30%);
|
|
121
|
-
transform: translateX(-30%);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
/* 显示动画 */
|
|
125
|
-
@-webkit-keyframes fox-view-show-slide-right {
|
|
126
|
-
0% {
|
|
127
|
-
-webkit-transform: translateX(-30%);
|
|
128
|
-
transform: translateX(-30%);
|
|
129
|
-
}
|
|
130
|
-
100% {
|
|
131
|
-
-webkit-transform: translateX(0%);
|
|
132
|
-
transform: translateX(0%);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
@keyframes fox-view-show-slide-right {
|
|
136
|
-
0% {
|
|
137
|
-
-webkit-transform: translateX(-30%);
|
|
138
|
-
transform: translateX(-30%);
|
|
139
|
-
}
|
|
140
|
-
100% {
|
|
141
|
-
-webkit-transform: translateX(0%);
|
|
142
|
-
transform: translateX(0%);
|
|
143
|
-
}
|
|
144
|
-
}
|