@fox-js/fox 3.0.1-2 → 3.0.1-3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/READEME.md CHANGED
@@ -26,6 +26,7 @@ npm install @fox-js/fox@beta
26
26
 
27
27
  ```js
28
28
  import fox from '@fox-js/fox'
29
+ import '@fox-js/fox/index.css'
29
30
  ```
30
31
 
31
32
  ## 编译
@@ -0,0 +1 @@
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})}));
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue");const t=Array.isArray,r=e=>"function"==typeof e,n=e=>null!==e&&"object"==typeof e,s=Object.prototype.toString,o=e=>s.call(e),i=e=>"[object Object]"===o(e),l="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function a(e){return e.__esModule||l&&"Module"===e[Symbol.toStringTag]}const u=typeof Promise<"u"&&-1!==Promise.toString().indexOf("[native code]");function h(...e){let t=void 0!==e[0]&&null!==e[0]?e[0]:{},r=1,n=e.length,s=!1;for("boolean"==typeof t&&(s=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],o=n[e];if(r!==o)if(!0===s&&o&&"object"==typeof o){let n;n=Array.isArray(o)?r&&Array.isArray(r)?r:[]:r&&"object"==typeof r?r:{},t[e]=h(s,n,o)}else void 0!==o&&(t[e]=o)}}return t}function c(e,t,r=!1){if(r){if("object"!=typeof t)return{};"object"!=typeof e&&(e={});for(let n in t){let s=e[n],o=t[n];if(s!==o)if("object"==typeof o){if(!Array.isArray(o)&&!i(o))continue;s=c(s,o,r),e[n]=s}else{if("function"==typeof o)continue;e[n]=o}}const n=Object.getOwnPropertySymbols(t);for(let s of n){let n=e[s],o=t[s];if(n!==o)if("object"==typeof o){if(!Array.isArray(o)&&!i(o))continue;n=c(n,o,r),e[s]=n}else{if("function"==typeof o)continue;e[s]=o}}}else h(!0,e,t);return e}class f{static seed=(new Date).getTime();static get(){let e=++f.seed;return e>=Number.MAX_VALUE&&(f.seed=0),e}}const p=u?Promise.resolve():null;function d(e,...t){null!==p?t&&t.length>0?p.then((()=>{e(t)})):p.then(e):t&&t.length>0?setTimeout((()=>{e(t)})):setTimeout(e)}function y(e){return null!=e&&("boolean"==typeof e?e:"string"==typeof e?"true"===e.toLocaleLowerCase():Boolean(e))}const m={"[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 g(e){let t=Object.prototype.toString.call(e);return null==e?String(e):m[t]||"object"}function v(e){return e&&"object"==typeof e&&"setInterval"in e}function b(e){let t=!!e&&"length"in e&&e.length,r=g(e);return"function"!==r&&!v(e)&&("array"===r||0===t||"number"==typeof t&&t>0&&t-1 in e)}function x(e,t){let r=+t.length,n=0,s=e.length;for(;n<r;n++)e[s++]=t[n];return e.length=s,e}function w(e,t=[]){let r=t;return null!=e&&(b(Object(e))?x(r,"string"==typeof e?[e]:e):r.push(e)),r}function S(e,t,r){if(b(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 R(e,t){if(e==t)return!0;if(void 0===e||void 0===t)return!1;let r=g(e);if(r!==g(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 s=r[n];if(!R(e[s],t[s]))return!1}return!0}if("array"===r){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){if(!R(e[r],t[r]))return!1}return!0}return!1}const A=Symbol("idKey"),E=Symbol("valueKey"),C=Symbol("childrenKey"),j=Symbol("growKey");class P{[j]=!0;[A];[E]=e.ref();[C]=new Map;constructor(e){this[A]=e}}class T{get(e,t){if("value"==t)return e[E].value;if("grow"===t)return e[j];let r=e[C].get(t);return r?$(r):e[j]?(r=O(t),r[j]=e[j],e[C].set(t,r),$(r)):void 0}set(e,t,r){return"value"==t?(e[E].value=r,!0):"grow"===t?(e[j]=y(r),!0):null==r&&(e[C].delete(t),!0)}deleteProperty(e,t){return"value"!==t&&"grow"!=t&&(e[C].delete(t),!0)}}const q="__proxy__";function O(e){let t=new P(e);return Reflect.set(t,q,new Proxy(t,new T)),t}function $(e){return Reflect.get(e,q)}class F extends P{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,s=e[n];r[C].has(s)?t=r[C].get(s):(t=O(s),r[C].set(s,t)),r=t}return r[E].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[C].has(t))return;r=r[C].get(t)}return r[E].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[C].has(t))return!1;r=r[C].get(t)}let n=e[t-1];return!!r[C].has(n)&&(r[C].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[C].has(t))return!1;r=r[C].get(t)}let n=e[t-1];return r[C].has(n)}clear(){this[C].clear()}}const k=["put","get","contains","remove","clear"];function _(e){return k.includes(e)}class M{get(e,t){if("value"==t)return e[E].value;if("grow"===t)return e[j];if(t===C)return e[C];if("string"==typeof t&&_(t))return e[t];let r=String(t),n=e[C].get(r);return n?$(n):e[j]?(n=O(r),n[j]=e[j],e[C].set(r,n),$(n)):void 0}set(e,t,r){return"value"==t?(e[E].value=r,!0):"grow"===t?(e[j]=y(r),!0):!_(t)&&(null==r&&(e[C].delete(t),!0))}deleteProperty(e,t){return"value"!==t&&"grow"!=t&&(e[C].delete(t),!0)}}let N=new Proxy(F,{construct(e,...t){let r=function(){let e=new F,t=new M,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 $(r)}});function K(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 s=1,o="";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==--s){l++;break}}else if("("===e[l]&&(s++,"?"!==e[l+1]))throw new TypeError("Capturing groups are not allowed at ".concat(l));o+=e[l++]}else o+=e[l++]+e[l++];if(s)throw new TypeError("Unbalanced pattern at ".concat(r));if(!o)throw new TypeError("Missing pattern at ".concat(r));t.push({type:"PATTERN",index:r,value:o}),r=l}else{for(var i="",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;i+=e[l++]}if(!i)throw new TypeError("Missing parameter name at ".concat(r));t.push({type:"NAME",index:r,value:i}),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,s=void 0===n?"./":n,o="[^".concat(D(t.delimiter||"/#?"),"]+?"),i=[],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],s=n.type,o=n.index;throw new TypeError("Unexpected ".concat(s," at ").concat(o,", 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===s.indexOf(m)&&(u+=m,m=""),u&&(i.push(u),u=""),i.push({name:d||l++,prefix:m,suffix:"",pattern:y||o,modifier:h("MODIFIER")||""})}else{var g=p||h("ESCAPED_CHAR");if(g)u+=g;else if(u&&(i.push(u),u=""),h("OPEN")){m=f();var v=h("NAME")||"",b=h("PATTERN")||"",x=f();c("CLOSE"),i.push({name:v||(b?l++:""),pattern:v&&!b?o:b,prefix:m,suffix:x,modifier:h("MODIFIER")||""})}else c("END")}}return i}function I(e,t){return function(e,t){void 0===t&&(t={});var r=H(t),n=t.encode,s=void 0===n?function(e){return e}:n,o=t.validate,i=void 0===o||o,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 o=e[n];if("string"!=typeof o){var a=t?t[o.name]:void 0,u="?"===o.modifier||"*"===o.modifier,h="*"===o.modifier||"+"===o.modifier;if(Array.isArray(a)){if(!h)throw new TypeError('Expected "'.concat(o.name,'" to not repeat, but got an array'));if(0===a.length){if(u)continue;throw new TypeError('Expected "'.concat(o.name,'" to not be empty'))}for(var c=0;c<a.length;c++){var f=s(a[c],o);if(i&&!l[n].test(f))throw new TypeError('Expected all "'.concat(o.name,'" to match "').concat(o.pattern,'", but got "').concat(f,'"'));r+=o.prefix+f+o.suffix}}else if("string"!=typeof a&&"number"!=typeof a){if(!u){var p=h?"an array":"a string";throw new TypeError('Expected "'.concat(o.name,'" to be ').concat(p))}}else{f=s(String(a),o);if(i&&!l[n].test(f))throw new TypeError('Expected "'.concat(o.name,'" to match "').concat(o.pattern,'", but got "').concat(f,'"'));r+=o.prefix+f+o.suffix}}else r+=o}return r}}(K(e,t),t)}function L(e,t){var r=[];return function(e,t,r){void 0===r&&(r={});var n=r.decode,s=void 0===n?function(e){return e}:n;return function(r){var n=e.exec(r);if(!n)return!1;for(var o=n[0],i=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 s(e,r)})):l[r.name]=s(n[e],r)},u=1;u<n.length;u++)a(u);return{path:o,index:i,params:l}}}(B(e,r,t),r,t)}function D(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function H(e){return e&&e.sensitive?"":"i"}function U(e,t,r){return function(e,t,r){void 0===r&&(r={});for(var n=r.strict,s=void 0!==n&&n,o=r.start,i=void 0===o||o,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(D(void 0===p?"":p),"]|$"),y="[".concat(D(f),"]"),m=i?"^":"",g=0,v=e;g<v.length;g++){var b=v[g];if("string"==typeof b)m+=D(h(b));else{var x=D(h(b.prefix)),w=D(h(b.suffix));if(b.pattern)if(t&&t.push(b),x||w)if("+"===b.modifier||"*"===b.modifier){var S="*"===b.modifier?"?":"";m+="(?:".concat(x,"((?:").concat(b.pattern,")(?:").concat(w).concat(x,"(?:").concat(b.pattern,"))*)").concat(w,")").concat(S)}else m+="(?:".concat(x,"(").concat(b.pattern,")").concat(w,")").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(x).concat(w,")").concat(b.modifier)}}if(a)s||(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;s||(m+="(?:".concat(y,"(?=").concat(d,"))?")),A||(m+="(?=".concat(y,"|").concat(d,")"))}return new RegExp(m,H(r))}(K(e,r),t,r)}function B(e,t,r){return e instanceof RegExp?function(e,t){if(!t)return e;for(var r=/\((?:\?<(.*?)>)?(?!\?)/g,n=0,s=r.exec(e.source);s;)t.push({name:s[1]||n++,prefix:"",suffix:"",modifier:"",pattern:""}),s=r.exec(e.source);return e}(e,t):Array.isArray(e)?function(e,t,r){var n=e.map((function(e){return B(e,t,r).source}));return new RegExp("(?:".concat(n.join("|"),")"),H(r))}(e,t,r):U(e,t,r)}const W="default",V=Symbol("sync"),z=Symbol("resolveRoute");function J(e){let t=!1;return function(...r){if(!t)return t=!0,Reflect.apply(e,{},r)}}class G{name;level;rootName;rootIndex=0;constructor(e,t,r,n){this.name=e,this.level=t,this.rootName=r,this.rootIndex=n}}class X{to;routeModel;from;data={};constructor(e,t){this.to=e,this.from=t}static from(e){let t=new X(e.to,e.from),r=e.data??{};return h(!0,t.data,r),t}}class Y{path;get fullPath(){let e=this.path??`/${this.name}`;return`${this.root??W}!${e}`}name;root;params;query;matched;meta;success;error;destroy;opsType;updateType;viewTagAttrs;index;active;slot;session;static clone(e,t){let r=new Y;return c(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 Y;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 Q{id;name;props;meta;src;component;constructor(e,t,r,n){this.id=f.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 s=J((t=>{a(t)&&(t=t.default),e.component=t,r()})),o=J((e=>{n(e)}));let i;try{i=t(s,o)}catch(e){o(e)}if(i)if("function"==typeof i.then)i.then(s,o);else{const e=i.component;e&&"function"==typeof e.then&&e.then(s,o)}}))}(this)}}class Z{models=[]}class ee{path;match;redirect;name;layers=[]}var te,re=((te=re||{})[te.Push=0]="Push",te[te.Replace=1]="Replace",te[te.Put=2]="Put",te[te.Append=3]="Append",te[te.Open=4]="Open",te),ne=(e=>(e[e.Part=0]="Part",e[e.All=1]="All",e))(ne||{});const se=Symbol("rootKey"),oe=Symbol("rootNodeKey"),ie=Symbol("parentNodeKey"),le=Symbol("nameKey");class ae{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 ue{scope=null;set compensation(t){null!==this.scope&&this.scope.stop(),this.scope=e.effectScope(),this.scope.run((()=>{e.watch(this.slots,(()=>{let e=!1;try{e=t()}catch(e){}e&&null!==this.scope&&(this.scope.stop(),this.scope=null)}))}))}_slots;get slots(){return null==this._slots&&(this._slots=e.shallowRef([])),this._slots}get empty(){return null==this._slots||0==this._slots.value.length}[le];[se];[oe]=null;[ie]=null;get name(){return this[le]}constructor(e,t,r){this[le]=e,this[se]=t,r&&(this[oe]=r)}}class he{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 ce{views=[]}class fe{layers=[]}class pe{time;route}class de{forbidTime=300;submitRecorder=new pe;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 ye=typeof window<"u",me=function(){return window},ge=function(){return window.document};function ve(e,t,r){e.addEventListener?e.addEventListener(t,r,!1):e.attachEvent?e.attachEvent(`on${t}`,r):e[`on${t}`]=r}function be(e,t,r){e.removeEventListener?e.removeEventListener(t,r):e.detachEvent?e.detachEvent(`on${t}`,r):e[`on${t}`]=null}let xe=function(){if(!ye)return"/";let e=me().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 we={method:"POST",headers:{"Content-Type":"application/json; charset=UTF-8"},mode:"cors",credentials:"same-origin",cache:"default",redirect:"follow",keepalive:!0},Se=new Map;async function Re(e){let{id:t,method:r="POST",url:n,headers:s={},data:o,processData:i=!0,timeout:l=-1}=e;if(t&&Se.has(t))throw new Error("resubmit");r=r.toUpperCase();let{contentType:a="application/json; charset=UTF-8"}=s,u=h(!0,{...we},{method:r,headers:s});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 s=`${encodeURIComponent(e)}=${encodeURIComponent(r[t])}`;n.length>0&&(n+="&"),n+=s}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,o,a):(i&&(o=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 s=`${encodeURIComponent(t)}=${encodeURIComponent(n[e])}`;r.length>0&&(r+="&"),r+=s}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}(o,a)),u.body=o),t||l>0){t||(t=`fetch_${f.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}Se.set(t,r)}try{let e=await fetch(n,u),r={};e.headers.forEach(((e,t)=>{r[e]=t}));let s,o=r["content-type"]??"";return s=-1!==o.indexOf("application/json")?await e.json():-1!=o.indexOf("text")?await e.text():await e.blob(),{ok:e.ok,status:e.status,statusText:e.statusText,headers:r,data:s,response:e}}catch(e){throw e}finally{if(t){let e=Se.get(t);e&&(e.timer&&(clearTimeout(e.timer),e.timer=null),Se.delete(t))}}}class Ae{cache=new Map;constructor(){}async get(e,t=-1){if(this.cache.has(e))return this.cache.get(e);let r=await Re({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 Ee=(e=>(e[e.Loading=0]="Loading",e[e.Loaded=1]="Loaded",e[e.Defining=2]="Defining",e[e.Defined=3]="Defined",e))(Ee||{});class Ce{exports;status;id;src}class je{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 Pe=(e=>(e.Busy="Busy",e.Free="Free",e.Reject="Reject",e.Exception="Exception",e.Finished="Finished",e))(Pe||{});const Te=Symbol("chainKey"),qe=Symbol("cursorKey"),Oe=Symbol("$persistentModeKey"),$e=Symbol("statusKey"),Fe=Symbol("argsKey"),ke=Symbol("exArgsKey"),_e=Symbol("successFnsKey"),Me=Symbol("errorFnsKey"),Ne=Symbol("sessionKey"),Ke=Symbol("_go");class Ie{[Te]=[];[qe]=0;[Oe]=!1;[$e]="Free";[Fe]=[];[ke]=[];[_e]=[];[Me]=[];[Ne];get session(){return this[Ne]}constructor(e,t=!1){this[Ne]=e,this[Oe]=t}[Ke](e,...t){let r=this[$e];if(this[$e]="Busy",this[qe]+=e,this[qe]<0&&(this[qe]=0),this[Fe]=t,"Exception"===r||"Reject"===r){let e=[{session:this[Ne]},...this[ke]];for(;this[Me].length>0;)try{let t=this[Me].shift();"function"==typeof t&&d((()=>{Reflect.apply(t,{},e)}))}catch(e){}return this[$e]=r,this[Te]=[],this[qe]=0,this}if("Finished"===r||this[qe]>=this[Te].length){let e=[{session:this[Ne]},...this[Fe]];for(;this[_e].length>0;){let t=this[_e].shift();"function"==typeof t&&d((()=>{Reflect.apply(t,{},e)}))}return this[$e]="Free",this}if(this[qe]>=this[Te].length)return this[$e]="Free",this;let n=this[Te][this[qe]];this[Oe]||(this[Te].splice(0,this[qe]+1),this[qe]=-1);let s=this[qe]+1;try{let e=!1,t={go:(t,...r)=>{e||(e=!0,Reflect.apply(this[Ke],this,[t,...r]))},resolve:(...t)=>{e||(e=!0,Reflect.apply(this[Ke],this,[1,...t]))},reject:(...t)=>{e||(e=!0,Reflect.apply(this.reject,this,[...t]))},insert:t=>{e||(this[Te].splice(s,0,t),s++)},session:this[Ne]};d((()=>{Reflect.apply(n,{},[t,...this[Fe]])}))}catch(e){this.throw(e)}return this}go(e,...t){return Reflect.apply(this[Ke],this,[e,...t])}finish(...e){return this[$e]="Finished",this[Fe]=e,Reflect.apply(this[Ke],this,[0])}reject(...e){return this[$e]="Reject",this[ke]=e,Reflect.apply(this[Ke],this,[0])}throw(...e){return this[$e]="Exception",this[ke]=e,Reflect.apply(this[Ke],this,[0])}reset(...e){this[$e]="Busy",this[Fe]=e,this[Te]=[],this[qe]=0;let t=[{session:this[Ne]},...this[Fe]];for(;this[_e].length>0;){let e=this[_e].shift();d((()=>{Reflect.apply(e,this,t)}))}return this[$e]="Free",this}post(e){return"Reject"===this[$e]||"Exception"===this[$e]||(Array.isArray(e)?this[Te]=[...this[Te],...e]:this[Te].push(e),"Busy"===this[$e]||Reflect.apply(this[Ke],this,[0,...this[Fe]])),this}wait(e,t){return e&&"function"==typeof e&&this[_e].push(e),t&&"function"==typeof t&&this[Me].push(t),"Busy"===this[$e]||Reflect.apply(this[Ke],this,[0,...this[Fe]]),this}exception(e){return e&&"function"==typeof e&&this[Me].push(e),"Busy"===this[$e]?this:Reflect.apply(this[Ke],this,[0,...this[Fe]])}isFinish(){return"Reject"==this[$e]||"Free"==this[$e]&&this[qe]>=this[Te].length}}class Le{head;isOldWebKit;moduleManager=new je;resource=new Ae;options;_query;set query(e){this._query=e}get query(){return this._query}constructor(e={}){const t=ge();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 s=null;"function"==typeof e[r]&&(s=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 o=new He(t.length,((e,t)=>{if(o.isOK())try{"function"==typeof s&&Reflect.apply(s,{},t)}catch(e){}else try{"function"==typeof s&&Reflect.apply(s,{},[])}catch(e){}})),i=new Ie;for(let e=0;e<t.length;e++){let r=new Ue(e,t[e],n,o);this.mount(i,r)}return this}remove(...e){let t=[],r=e.length-1,n={};"object"==typeof e[r]&&(Object.assign(n,e[r]),r--);let s=null;"function"==typeof e[r]&&(s=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 s&&Reflect.apply(s,{},[]),this}mount(e,t){const r=ge();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,s=t.src;this.resource.get(s,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=ge(),s=t.src,o=n.createElement("link"),i="onload"in o;if(this.isOldWebKit||!i){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(o)}catch(e){}t.progress.work(!1,t.index,null),e.resolve()}};setTimeout((()=>{De(o,n)}),1)}else o.onload=()=>{o.onload=o.onerror=null,t.progress.work(!0,t.index,t.src),e.resolve()},o.onerror=()=>{try{r.removeChild(o)}catch(e){}o.onload=o.onerror=null,t.progress.work(!1,t.index,null),e.reject()};let l=n.getElementById(s);l&&l.parentNode&&l.parentNode.removeChild(l),o.rel="stylesheet",o.type="text/css",o.id=s,o.href=s,r.appendChild(o)}))}mountJS(e,t,r){e.post((e=>{let n=t.src,s=this.moduleManager.get(n);if(s&&(s.status==Ee.Defined||s.status==Ee.Loaded)){if(s.exports)return t.progress.work(!0,t.index,s.exports),void e.resolve();if(document.querySelector(`script[src='${n}`))return t.progress.work(!0,t.index,s.exports),void e.resolve()}s=new Ce,s.id=n,s.src=n,s.status=Ee.Loading,this.moduleManager.put(n,s);const o=ge().createElement("script");if("onload"in o)o.onload=()=>{o.onload=o.onerror=null,s.status==Ee.Loading&&(s.status=Ee.Loaded,t.progress.work(!0,t.index,n)),e.resolve()},o.onerror=()=>{try{r.removeChild(o)}catch(e){}o.onload=o.onerror=null,t.progress.work(!1,t.index,null),e.reject()};else{let r=o;r.onreadystatechange=()=>{/loaded|complete/.test(r.readyState)&&(r.onreadystatechange=null,s.status==Ee.Loading&&(s.status=Ee.Loaded,t.progress.work(!0,t.index,n)),e.resolve())}}o.defer=!0,o.src=n,me().define=this.createDefine(s,t),r.appendChild(o)}))}unmount(e,t={}){const r=ge(),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=Ee.Defining;let s,o,i,l=n.length;1===l?(i=n[0],s=void 0):2===l?(i=n[1],Array.isArray(n[0])?(o=r.trimEmptyElement(n[0]),s=void 0):o=void 0):(s=n[0],o=r.trimEmptyElement(n[1]),i=n[2]),s&&(e.id=s,r.options.alias[s]=e.src),o&&o.length>0?r.ensure(o,((...r)=>{e.exports="function"==typeof i?Reflect.apply(i,e,r):i,e.status=Ee.Defined,t.progress.work(!0,t.index,e.exports)})):(e.exports="function"==typeof i?Reflect.apply(i,e,[]):i,e.status=Ee.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),s=this.options.paths[n];t=s?s+e.slice(r):e}}return this.parserPath(t,!1)}return xe+e}}function De(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():De(e,t)}),20)}class He{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 Ue{index;src;params;progress;constructor(e,t,r,n){this.index=e,this.src=t,this.params=r,this.progress=n}}const Be=Symbol("_notifyChange");class We{currentRoute;routes;constructor(e,t){this.currentRoute=e,this.routes=t}}const Ve=Symbol("_navigateFirstRoute"),ze=Symbol("_getRouteMark"),Je=Symbol("_getUrlSearch"),Ge=Symbol("_generateLocation"),Xe=Symbol("_setRoteMarkhRecorder");class Ye{base;storage;mode;query;firstNavigate=!0;historyMonitor;traceless=!1;changeHandler;historyChange;lastMark;constructor(e="hash",t="",r="",n=!0,s=!0,o=!1,i){this.mode=e,this.base=t,this.query=r,this.firstNavigate=n,this.historyMonitor=s,this.traceless=o,this.storage=i??me().sessionStorage}init(e=!0){const t=me();return"function"!=typeof this.historyChange&&(this.historyChange=()=>{if(!this.historyMonitor)return;const e=t.history.state;this[Be](e)}),ve(t,"popstate",this.historyChange),this.firstNavigate&&e&&this[Ve](),Promise.resolve()}destroy(){if(this.historyChange){be(me(),"popstate",this.historyChange)}}[Ve](){let e=this[ze]()??"/";const t=this.storage.getItem(e);if(t)try{const e=JSON.parse(t);return void this[Be](e)}catch{}const r=e.indexOf("!");let n;n=-1!=r?e.substring(r+1):e;const s=new Y;s.path=n,s.query=this[Je](),this[Be]([s])}[Xe](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){}}[Be](e){"function"==typeof this.changeHandler&&this.changeHandler(e)}[ze](){const e=me();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}[Je](){return me().location.search}listen(e){this.changeHandler=e}go(e){me().history.go(e)}push(e){let t=this[Ge](e.currentRoute);this.traceless||me().history.pushState(e.routes,"",t),this[Xe](e.currentRoute.fullPath,e.routes)}replace(e){let t=this[Ge](e.currentRoute);this.traceless||me().history.replaceState(e.routes,"",t),this[Xe](e.currentRoute.fullPath,e.routes)}[Ge](e){const t=me();let r;if(e.query){let t="";if("object"==typeof e.query)for(let r in e.query){let n=encodeURIComponent(e.query[r]),s=`${encodeURIComponent(r)}=${n}`;t.length>0&&(t+="&"),t+=s}else t=e.query;this.query?(r=`${this.query}&${t}`,"?"!==r.charAt(0)&&(r=`?${r}`)):r=`?${t}`}const n=t.location;let s,o=e.fullPath;return o.startsWith(W)&&(o=o.substring(W.length+2)),s=r?"path"==this.mode?`${this.base}/${o}${r}`:`${n.pathname}${r}#${o}`:"path"==this.mode?`${this.base}/${o}`:`${n.pathname}#${o}`,`${n.origin}${s}`}}function Qe(e=!0,t="",r=!0,n=!1,s){return new Ye("hash","",t,e,r,n,s)}class Ze{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}[Be](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[Be](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 et(e="",t=50){return new Ze(e,t)}const tt=Symbol("_constructRouteModel"),rt=Symbol("_findRouteModel"),nt=Symbol("_findRootView"),st=Symbol("_getFirstView"),ot=Symbol("_removeView"),it=Symbol("_buildPage"),lt=Symbol("_resolveComponent"),at=Symbol("_update"),ut=Symbol("_merge"),ht=Symbol("ignoreHistoryChangeOnceKey"),ct=Symbol("_handleHistoryChange"),ft=Symbol("_handleRouteUpdated"),pt=Symbol("routeUpdatedCallback"),dt=Symbol("currentRoutes"),yt=Symbol("current"),mt=Symbol("_addRouteRecorder"),gt=Symbol("_removeRouteRecorder"),vt=Symbol("_cloneRouteRecorder"),bt=Symbol("_hanldeError"),xt=Symbol("errorCallback"),wt=Symbol("registerKey"),St=Symbol("notFoundKey"),Rt=Symbol("notFoundPathKey"),At=Symbol("forestKey"),Et=Symbol("historyKey"),Ct=Symbol("beforeFiltersKey"),jt=Symbol("afterFiltersKey"),Pt=Symbol("destroyFiltersKey"),Tt=Symbol("mainDispatcherKey"),qt=Symbol("initKey"),Ot=Symbol("requireKey"),$t=Symbol("readyKey"),Ft=Symbol("readyHandlersKey"),kt=Symbol("_markReady"),_t=Symbol("_createNextFn"),Mt=Symbol("_start"),Nt=Symbol("_before"),Kt=Symbol("_after"),It=Symbol("_destroy"),Lt=Symbol("_load"),Dt=Symbol("_unload"),Ht=Symbol("_loadDependency"),Ut=Symbol("resolvedModulesKey"),Bt=Symbol("resolveDependencyKey"),Wt=Symbol("routerGuardKey");class Vt{[wt]=new Array;[St];[Rt]="*";[$t]=!1;[Ft]=[];[At]=new fe;[Et];[dt]=new Array;[xt]=null;[pt]=null;[Ct]=new Array;[jt]=new Array;[Pt]=new Array;[Tt]=new Ie;[Ut]=new Map;[Bt]=null;[Wt]=new de;[qt]=!1;[yt]=e.ref(null);[Ot]=null;get require(){return ye?(this[Ot]||(this[Ot]=new Le),this[Ot]):null}get current(){return this[yt].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[Et]=e.history:this[Et]=ye?Qe():et(),this[Et]?.listen((async e=>{let t=!0;try{if("string"==typeof e){let t=this[z](e);t&&await this[ct]([t])}else await this[ct](e)}catch(e){t=!1}!1===this[$t]&&this[kt](t)}))}[bt](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[Et]?.init(!this[$t]),this[qt]=!0)}isReady(){return this[$t]?Promise.resolve():new Promise(((e,t)=>{this[Ft].push([e,t])}))}[kt](e){this[$t]=!0,this[Ft].forEach((([t,r])=>{try{e?t():r()}catch(e){}}))}[ht]=!1;[ct](e){if(this[ht])return this[ht]=!1,Promise.resolve();try{if(!e){let e=[...this[dt]].reverse();return this[Dt](e),ye&&me().location.reload(),Promise.resolve()}let t=null,r=[],n=[],s=0;for(;s<e.length&&s<this[dt].length&&Y.isSame(e[s],this[dt][s]);s++)e[s].opsType===re.Open&&!0===e[s].active&&e[s].active!==this[dt][s].active&&(t=e[s]);if(s<e.length&&(r=e.slice(s)),s<this[dt].length&&(n=this[dt].slice(s).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[Dt](n)){if(r.length>0)return this.restore(r);if(null!==t)return this.restore([t])}}}catch(e){this[bt](e)}return Promise.resolve()}[ft](e){if(e)this[yt].value=e;else{let e=this[dt].length;this[yt].value=e>0?this[dt][e-1]:null}if("function"==typeof this[pt])try{this[pt](this[yt].value)}catch{}}[mt](e,t=-1){t<0||t>=this[dt].length?this[dt].push(e):this[dt].splice(t,0,e)}[vt](){let e=[];for(let t of this[dt]){let r=Y.clone(t,!0);e.push(r)}return e}[gt](e){if(null==this[dt])return;let t=-1;for(let r=0;r<this[dt].length;r++)if(Y.isSame(this[dt][r],e)){t=r;break}if(-1!=t){let e=this[dt][t];this[dt].splice(t,1),this[It](e,e.session)}}set hisotryMonitor(e){this[Et]&&(this[Et].historyMonitor=e)}get historyMonitor(){return!!this[Et]&&this[Et].historyMonitor}set traceless(e){this[Et]&&(this[Et].traceless=e)}get traceless(){return!!this[Et]&&this[Et].traceless}onRouteUpdated(e){this[pt]=e}onError(e){this[xt]=e}beforeEach(e){this[Ct].push(e)}removeBeforeEach(e){const t=this[Ct].indexOf(e);return-1!==t&&(this[Ct].splice(t,1),!0)}afterEach(e){this[jt].push(e)}removeAfterEach(e){const t=this[jt].indexOf(e);return-1!==t&&(this[jt].splice(t,1),!0)}destroyEach(e){this[Pt].push(e)}removeDestroyEach(e){const t=this[Pt].indexOf(e);return-1!==t&&(this[Pt].splice(t,1),!0)}setResolveDependency(e){this[Bt]=e}addRoutes(e){for(let t of e)this.addRoute(t)}addRoute(e,t=-1){if(e.path===this[Rt])return void this.setNotFoundRoute(e);const r=this[tt](e);if(-1==t)this[wt]=[...this[wt],...r];else for(let e=r.length-1;e>=0;e--)this[wt].splice(t,0,r[e])}removeRoute(e){const t=this[z](e);if(null===t)return!1;for(let e=0;e<this[wt].length;e++){const r=this[wt][e];if(t?.path&&r.path===t.path)return this[wt].splice(e,1),!0;if(t?.name&&r.name===t.name)return this[wt].splice(e,1),!0}return!1}hasRoute(e){const t=this[z](e);return null!==t&&-1!==this[wt].findIndex((e=>{if(t?.path&&e.path===t.path||t?.name&&e.name===t.name)return!0}))}setNotFoundPath(e){this[Rt]=e}setNotFoundRoute(e){const t=this[tt](e);this[St]=t[0]}getRoutes(){return[...this[wt]]}[tt](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 ee;return r.path=t,r.redirect=e.redirect,[r]}let n=[];for(let t in r){let s=r[t];0===t.length&&(t=W);let o=new Q(t,s,e.props,e.meta);n.push(o)}let s=!1,o=[];if(e.children)for(let r of e.children){let e=this[tt](r);for(let r of e){let e=new ee;e.name=r.name,r.path&&r.path.length>0?e.path="/"!==t?`${t}${r.path}`:r.path:(s=!0,e.path=t);let i=new Z;i.models=[...n],e.layers=[i,...r.layers],o.push(e)}}if(!s){let r=new Z;r.models=n;let s=new ee;s.name=e.name,s.path=t,s.layers=[r],o.splice(0,0,s)}return o}[rt](e){let t=e.route;try{for(let r of this[wt]){if(t.path&&r.path){let n=r.match;n||(n=r.match=L(r.path));let s=n(t.path);if(!s)continue;if(r.redirect){let n=new Y;h(!0,n,t),n.path=r.redirect;let s={route:n,find:void 0};return!!this[rt](s)&&(e.route=s.route,e.find=s.find,!0)}if(t.params=t.params??{},h(!0,t.params,s.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()),s=decodeURIComponent(t[1].trim());r[n]=s}h(!0,t.params,r)}else"object"==typeof e&&h(!0,t.params,e)}return e.find=r,!0}if(t.name===r.name){t.params=t.params??{};let n=I(r.path);return t.path=n(t.params),e.find=r,!0}}}catch(e){"function"==typeof t.error&&t.error(e.message)}return!1}[z](e){let t=null;if(Array.isArray(e))if(t=new Y,"object"==typeof e[0])t=Y.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&&h(!1,t,e[r]);else"object"==typeof e?t=Y.from(e):"string"==typeof e&&(t=new Y,"/"==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??W,t.opsType=t.opsType??this.options.defaultOperationType??re.Push}return t}push(...e){let t=this[z](e);return t?(t.opsType=t.opsType||re.Push,this.to(t)):(this[bt]("resolve route fail",t),this)}put(...e){let t=this[z](e);return t?(t.opsType=re.Put,this.to(t)):(this[bt]("resolve route fail",t),this)}replace(...e){let t=this[z](e);return t?(t.opsType=re.Replace,this.to(t)):(this[bt]("resolve route fail",t),this)}append(...e){let t=this[z](e);return t?(t.opsType=re.Append,this.to(t)):(this[bt]("resolve route fail",t),this)}remove(e){return new Promise((t=>{this[Tt].post((r=>{try{if(0===this[dt].length)return r.resolve(),void t(!1);let n,s=-1,o=[];if(e){if(n=e.root?e.root:this[dt][0].root??W,e.all)for(let e=this[dt].length-1;e>0;e--){let t=this[dt][e];t.opsType===re.Append&&t.root===n&&(o.splice(0,0,t),s=e-1)}else if(e.until)for(let t=this[dt].length-1;t>0;t--){let r=this[dt][t];if(r.opsType===re.Append&&r.root===n){if("/"===e.until.charAt(0)&&e.until===r.path){s=t;break}if(e.until===r.name){s=t;break}o.splice(0,0,r)}}}else{n=W;let e=this[st](this[At]);e&&(n=e.name);for(let e=this[dt].length-1;e>0;e--){let t=this[dt][e];if(t.opsType===re.Append&&t.root===n){o.push(t),s=e-1;break}}}if(0===o.length){let e="can not find route";return r.resolve(e),void t(!1)}let i=0;if(this[dt].forEach((e=>{e.opsType!==re.Put&&i++})),this[Dt](o)){let e=0;this[dt].forEach((t=>{t.opsType!==re.Put&&e++}));let n=i-e;this[ht]=!0,this.back(n),r.resolve(),t(!0)}}catch(e){this[bt](e),r.resolve(),t(!1)}}))}))}open(...e){let t=this[z](e);return t?(t.opsType=re.Open,this.to(t)):(this[bt]("resolve route fail",t),this)}close(e){return this[Tt].post((t=>{try{let r=this[z](e);if(!r)return void t.reject("resolve route fail");let n=[];for(let e=0;e<this[dt].length;e++){let t=this[dt][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[Dt](n)){let e=Y.clone(r,!0);const t=new We(e,this[vt]());this[Et]?.replace(t),this[ft]()}t.resolve()}catch(e){this[bt](e),t.resolve()}})),this}to(...e){let t=this[z](e);if(!t)return this[bt]("resolve route fail",t),this;let r=this[Wt].acquire(t);return null==r?(this[bt]("route forbid",t),this):(this[Tt].post((e=>{try{let n=this[Mt](t);this[Nt](n),!n.session?.routeModel&&this[Bt]&&this[Ht](n),this[Lt](n),this[Kt](n),n.wait(((n,s)=>{let o=n.session.to;try{let e=Y.clone(o,!0);const t=new We(e,this[vt]());o.opsType===re.Replace?this[Et]?.replace(t):this[Et]?.push(t)}catch(e){}if(this[Wt].release(r),this[ft](o),"function"==typeof t.success)try{Reflect.apply(t.success,{},[])}catch(e){}!1===this[$t]&&this[kt](!0),e.resolve()}),((n,s)=>{this[Wt].release(r),this[bt](s,t),!1===this[$t]&&this[kt](!1),e.resolve()}))}catch(n){this[Wt].release(r),this[bt](n,t),e.resolve()}})),this)}back(e=1){this[Et]?.go(-e)}[_t](e){return(t,r)=>{if("boolean"==typeof t)t?e.resolve():e.reject(r);else if(t){let r=this[z](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()}}[Mt](e){let t=this[dt].length>0?this[dt][0]:void 0,r=new X(e,t),n={route:e,find:null};return this[rt](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=h(!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 Ie(r)}[Nt](e){for(let t of this[Ct])e.post((e=>{let r=this[_t](e);Reflect.apply(t,{},[e.session.to,e.session.from,r,e.session])}))}[Kt](e){e.post((e=>{for(let t of this[jt])try{Reflect.apply(t,{},[e.session.to,e.session.from,e.session])}catch(e){}e.resolve()}))}[It](e,t){for(let r of this[Pt])try{Reflect.apply(r,{},[e,t])}catch(e){}"function"==typeof e.destroy&&Reflect.apply(e.destroy,e,[])}[Ht](e){let t=e.session,r=Reflect.apply(this[Bt],this,[t?.to]);if(null==r)return;Array.isArray(r)||(r=[r]);let n=[];for(let e of r)this[Ut].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=a(e)?e.default:e,Array.isArray(t)&&this.addRoutes(t)}for(let e of n)this[Ut].set(e,!0);e.resolve()}else e.reject()}))}))}[Lt](e){e.post((e=>{let t=e.session.to,r=e.session.routeModel;if(null==r){let n={route:t,find:null};if(this[rt](n))r=n.find,e.session.routeModel=r;else{if(!this[St])return void e.reject(`not find route model, path:${t.path??t.name}`);r=this[St]}}let n=X.from(e.session);this[it](t,r,n).then((t=>{this[At],e.resolve()}),(t=>{e.reject(t)}))}))}[Dt](e){if(0==e.length)return!0;let t=this[At],r=[];for(let n of e){let e=this[nt](t,n);null!=e&&r.push({...e,route:n})}if(0==r.length){let e="can not find view index";return this[bt](e),!1}for(let e of r.reverse())this[ot](t,{x:e.x,y:e.y},[e.route.index??0],!0);return!0}[nt](e,t){let r,n=t.root??W;for(let t=0;t<e.layers.length;t++){let s=e.layers[t];for(let e=s.views.length-1;e>=0;e--){let o=s.views[e];if(o[se]&&o[le]===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 s=e.layers[t.y].views[t.x],o=!1,i=[],l=!1,a=s.slots.value;for(let e=a.length-1;e>=0;e--){let n=a[e];(null==r||-1!=r.indexOf(n.index))&&(n.route&&s[se]&&(this[gt](n.route),!0===n.active&&n.route.opsType==re.Append&&(l=!0)),i.push(new he(s,n.index,t.y)),a.splice(e,1))}if(0==a.length)n?s.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)}s.slots.value=[...a]}0==e.layers[t.y].views.length&&(o=!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;(o||i.length>0)&&n>=0;n--){let s=t[n];if(s[ie]&&(o||he.include(i,s[ie]))){let t=s.slots.value;for(let e=t.length-1;e>=0;e--){let n=t[e];n.route&&s[se]&&this[gt](n.route),r.push(new he(s,n.index,u)),t.splice(e,1)}e.layers[u].views.splice(n,1)}}i=r,0==e.layers[u].views.length&&(o=!0)}}restore(e){if(e&&0!=this[wt].length)return new Promise(((t,r)=>{for(let t=0;t<e.length;t++){let r=e[t];this[Tt].post((e=>{let t=this[Mt](r);this[Nt](t),!t.session?.routeModel&&this[Bt]&&this[Ht](t),this[Lt](t),this[Kt](t),t.wait(((t,r)=>{e.resolve()}),((t,r)=>{this[bt](r),e.resolve()}))}))}this[Tt].post((e=>{e.resolve(),t()}))}));{let e=this[At];if(e.layers.length>0){let t=e.layers[0].views;t.length>0&&(t[0].slots.value=[])}return this[dt]=[],this[ft](),Promise.resolve()}}[it](e,t,r){let n=e.updateType??ne.Part;return this[lt](t).then((()=>{this[at](t,e,r,n)}))}[lt](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()}[at](e,t,r,n){if(1!==e.layers[0].models.length)return Promise.reject("illegal route structure(multil root node)");const s=e.layers[0].models[0];let o,i=this[At],l=function(e){return 0==e.layers.length||0==e.layers[0].views.length}(i),a=t.root??W;!l&&n==ne.Part&&(o=this[nt](i,t));let u,h=0;if(null==o||null==o)if(l||n===ne.All){if(0==i.layers.length&&(i.layers[0]=new ce),0==i.layers[0].views.length){let e=t.root??W;u=new ue(e,!0,null),i.layers[0].views=[u]}else u=i.layers[0].views[0];o={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>i.layers.length)return Promise.reject("can not insert view(override level)");if(e.rootName){let t=i.layers[n-1];for(let s of t.views){if(s[se]&&s.name===e.rootName){r=new he(s,e.rootIndex??0,n-1);break}if(s[oe]&&s[oe].view.name===e.rootName&&s[oe].index===e.rootIndex){r=s[oe];break}}}if(!r)return Promise.reject("can not insert view(not find root node ref)");u=new ue(a,!0,r),i.layers[n].views.push(u),o={x:i.layers[n].views.length-1,y:n}}else u=i.layers[o.y].views[o.x];if(h=o.y,u[se]=!0,t.opsType===re.Append){t.index=f.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 ae(t,s,t.index,!0);u.slots.value=[...r,n];let o=h+1,l=1,a=new he(u,t.index,h);this[ut](i,o,e,l,a)}else if(t.opsType===re.Open){let r=u.slots.value,n=!1;for(let e of r){if(null!==e.route&&Y.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[gt](e.route)}else e.active=!1;e.route&&(e.route.active=e.active)}if(!n){t.index=f.get(),t.active=!0;let n=new ae(t,s,t.index,!0);r.push(n);let o=h+1,l=1,a=new he(u,t.index,h);this[ut](i,o,e,l,a)}u.slots.value=[...r]}else{let r=u.slots.value;if(0==r.length){t.index=f.get(),u.slots.value=[new ae(t,s,t.index)];let r=h+1,n=1,o=new he(u,t.index,h);this[ut](i,r,e,n,o)}else{let n=r[0];if(n.model!==s){this[ot](i,o,null,!0),t.index=f.get(),u.slots.value=[new ae(t,s,t.index)];let r=h+1,n=1,l=new he(u,t.index,h);this[ut](i,r,e,n,l)}else{null!==n.route&&this[gt](n.route);let s=[];for(let e=1;e<r.length;e++)s.push(r[e].index);s.length>0&&this[ot](i,o,s,!0),t.index=n.index,n.route=t;let l=[new he(u,t.index,h)],a=h+1,c=1,f=new he(u,t.index,h);for(;l.length>0&&a<i.layers.length&&c<e.layers.length;a++,c++){let t=[];for(let e=0;e<i.layers[a].views.length;e++){let r=i.layers[a].views[e];r[ie]&&he.include(l,r[ie])&&t.unshift(e)}let r=[];for(let n of t){let t,s=i.layers[a].views[n],o=e.layers[c].models;for(let e=0;e<o.length;e++)if(s.name===o[e].name){t=o[e];break}if(t){let o=s.slots.value;if(0==o.length){let r=0;s.slots.value=[new ae(null,t,r)];let n=a+1,o=c+1;this[ut](i,n,e,o,f)}else{let l=o[0];if(l.model!==t){this[ot](i,{x:n,y:a},null,!0),s.slots.value=[new ae(null,t,0)];let r=a+1,o=c+1;this[ut](i,r,e,o,f)}else{s[se]&&null!==l.route&&this[gt](l.route);let e=[];for(let t=1;t<o.length;t++)e.push(o[t].index);e.length>0&&this[ot](i,{x:n,y:a},e,!0),r.push(new he(s,l.index,a))}}s[se]=!1}else this[ot](i,{x:n,y:a},null,!1)}l=r}this[ut](i,a,e,c,f)}}}if(u&&u[oe]){let e=u[oe];e&&(t.slot=new G(a,h,e?.view.name,e?.index??0))}r.to=void 0,r.routeModel=void 0,t.session=r,this[mt](t)}[ut](e,t,r,n,s){let o=n,i=t;for(;i<e.layers.length&&o<r.layers.length;i++,o++){let t=e.layers[i].views;for(let e of r.layers[o].models){let r=new ue(e.name,!1,s),n=new ae(null,e);r.slots.value=[n],t.push(r)}}for(;o<r.layers.length;o++){let t=new ce;t.views=[];for(let e of r.layers[o].models){let r=new ue(e.name,!1,s),n=new ae(null,e);r.slots.value=[n],t.views.push(r)}e.layers.push(t)}}[V](e,t,r,n,s,o){if(t<0||t>this[At].layers.length)return null;if(t<this[At].layers.length){let i=this[At].layers[t],l=null;for(let a of i.views){let i=!1;if(null!==r?(i=a.name===e&&a[oe]?.view===r,i&&-1!==n&&(i=a[oe]?.index===n)):i=a.name===e,i){null!==s&&(a[ie]={view:s,index:o,level:t-1}),l=a;break}}if(null!==l)return l}let i=null,l=null;null!==s&&(i=s[se]?{view:s,index:o,level:t-1}:s[oe],l={view:s,index:o,level:t-1});let a=new ue(e,!0,i);if(a[ie]=l,t==this[At].layers.length){let e=new ce;e.views=[a],this[At].layers.push(e)}else this[At].layers[t].views.push(a);return a}}var zt=(e=>(e[e.limitless=0]="limitless",e[e.once=1]="once",e))(zt||{});const Jt=Symbol("registerKey");class Gt{policy;callback;constructor(e,t){this.callback=e,this.policy=t}}class Xt{[Jt]=new Map;constructor(){}on(e,t,r=!1){let n=this[Jt].get(e);n||(n=new Array,this[Jt].set(e,n));let s=new Gt(t,!0===r?1:0);return n.push(s),this}off(e,t){if(!t)return this[Jt].delete(e),this;let r=this[Jt].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,s=new Array(n),o=[].splice.call(e,0,n);for(let e=0;e<o.length;e++)this.once(o[e],(t=>{s[e]=t,n-=1,0==n&&Reflect.apply(r,{},s)}));return this}emit(e,...t){let r=this[Jt].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{d((()=>{Reflect.apply(n.callback,{},t)}))}catch(e){}}return this}trigger(e,...t){return Reflect.apply(this.emit,this,[e,...t])}}const Yt=Symbol("registerKey");class Qt{[Yt]=new Map;constructor(){}set(e,t){this[Yt].set(e,t)}get(e){return this[Yt].get(e)}has(e){return this[Yt].has(e)}delete(e){return this[Yt].delete(e)}}const Zt=Symbol("lc");function er(e,t=!1){let r=e,n=r[Zt];if(!n){if(!t)return null;n=new Qt,r[Zt]=n}return n}function tr(e,t){let r=e;for(;null!==r;){let e=r[Zt];if(e&&e.has(t))return e.get(t);r=r.$parent}return null}function rr(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 er(t.component.proxy,!1)}return null}const nr=Symbol("hooksKey");function sr(e,t){let r=e.get(nr);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 ir{type;hook;target;constructor(e,t,r){this.target=r,this.hook=t,this.type=e}}function lr(t){return(r,n)=>{let s;if(n)s=n;else{let t=e.getCurrentInstance();if(null==t||null==t.proxy)return;s=t.proxy}let o=tr(s,nr);null!=o&&(e.onUnmounted((()=>{!function(e,t,r,n){let s=-1;for(let o=0;o<e.length;o++){let i=e[o];if(i.type===t&&i.hook===r&&i.target===n){s=o;break}}-1!=s&&e.splice(s,1)}(o,t,r,s)})),function(e,t,r,n){let s=new ir(t,r,n);e.push(s)}(o,t,r,s))}}let ar=lr("a"),ur=lr("da");const hr=Symbol("routeKey");function cr(t,r){let n=t.get(hr);if(n){let e={path:"",name:"",params:{},index:-1,session:{}};Object.assign(e,r),Object.assign(n,e)}else n=function(){let t=new Y;return t.path="",t.name="",t.params={},t.index=-1,e.shallowReactive(t)}(),Object.assign(n,r),t.set(hr,n)}function fr(e){return tr(e,hr)??null}const pr=Symbol("rk"),dr=Symbol("vd"),yr=Symbol("rv"),mr=Symbol("rvi"),gr=Symbol("pv"),vr=Symbol("pvi");function br(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 wr(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 Sr(e,t){e.classList.contains(t)||e.classList.add(t)}function Rr(e,t){e.classList.remove(t)}const Ar=ye&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout;function Er(e){Ar(e)}function Cr(e,t,...n){!r(t)||(null==e&&(e={}),Reflect.apply(t,e,n))}function jr(e,t,n,s=-1,o,i,l,a){if(r(i)){if(void 0!==o&&o>=0)return void setTimeout((()=>{Reflect.apply(i,e,[t,n,s]),r(a)&&Reflect.apply(a,e,[])}),o);let l=["animationend","transitionend"],u=r=>{l.forEach((e=>{be(t,e,u)})),Reflect.apply(i,e,[t,n,s]),a&&Reflect.apply(a,e,[])};l.forEach((e=>{ve(t,e,u)}))}if(r(l)){let r="animationcancel",o=i=>{Reflect.apply(l,e,[t,n,s]),be(t,r,o)};ve(t,r,o)}}function Pr(e){return!(!ye||null===e)&&(e.opsType===re.Append||e.opsType===re.Open)}function Tr(e,t,r,n,s={},o,i=-1){if(t&&(r||Pr(o))){let e=br(s,r);e&&Sr(n,e);let t=xr(s,r);t&&Sr(n,t)}else{let t=function(e,t=!1){let r=null;return r=t?e.onBeforeShow??e.onBeforeEnter:e.onBeforeEnter,r}(s,r);Cr(e,t,[n,o,i])}}function qr(e,t,n,s,o={},i,l,a,u){if(Pr(l)||n)if(t){let t=br(o,n),h=xr(o,n),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)}(o,n);Er(c?()=>{jr(e,s,l,a,i,(()=>{h&&Rr(s,h),c&&Rr(s,c),r(u)&&u(e,u,[s])})),t&&Rr(s,t),c&&Sr(s,c)}:()=>{t&&Rr(s,t),h&&Rr(s,h),r(u)&&u(e,u,[s])})}else{let t=function(e,t=!1){let r=null;return r=t?e.onShow??e.onEnter:e.onEnter,r}(o,n),i=function(e,t=!1){let r=null;return r=t?e.onAfterShow??e.onAfterEnter:e.onAfterEnter,r}(o,n),h=function(e,t=!1){let r=null;return r=t?e.onShowCancelled??e.onEnterCancelled:e.onEnterCancelled,r}(o,n),c=t=>{!t&&r(i)?Cr(e,i,[s,l,a]):r(h)&&Cr(e,h,[s,l,a]),r(u)&&u(e,u,[s])};r(t)?Cr(e,t,[s,c,l,a]):c()}else r(u)&&u(e,u,[s])}function Or(e,t,n,s,o={},i,l,a,u,h){if(Pr(a)||n)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)}(o,n),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)}(o,n),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)}(o,n);t&&Sr(s,t),c&&Sr(s,c),Er(f?()=>{jr(e,s,a,u,i,(()=>{c&&Rr(s,c),f&&Rr(s,f),r(h)&&Cr(e,h,[s]),!n&&r(l)&&l()})),t&&Rr(s,t),f&&Sr(s,f)}:()=>{t&&Rr(s,t),c&&Rr(s,c),r(h)&&Cr(e,h,[s]),!n&&r(l)&&l()})}else{let t=function(e,t=!1){let r=null;return r=t?e.onHide??e.onLeave:e.onLeave,r}(o,n),i=function(e,t=!1){let r=null;return r=t?e.onAfterHide??e.onAfterLeave:e.onAfterLeave,r}(o,n),c=function(e,t=!1){let r=null;return r=t?e.onHideCancelled??e.onLeaveCancelled:e.onLeaveCancelled,r}(o,n),f=t=>{!t&&r(i)?(Cr(e,i,[s,a,u]),r(h)&&Cr(e,h,[s]),!n&&r(l)&&l()):r(c)&&(Cr(e,c,[s,a,u]),r(h)&&Cr(e,h,[s]))};r(t)?Cr(e,t,[s,f,a,u]):f()}else!n&&r(l)&&l()}function $r(e,t={},r,n=-1){let s=y(t.css),o=t.mode??"default",i=wr(t);return{mode:o,persisted:!1,beforeEnter:o=>{Tr(e,s,!1,o,t,r,n)},enter:o=>{qr(e,s,!1,o,t,i.enter,r,n)},leave:(o,l)=>{Or(e,s,!1,o,t,i.leave,l,r,n)},clone:s=>$r(e,t,r,n)}}function Fr(e){return e.el}function kr(e,t,n={},s,o,i,l){if(i){let i=Fr(t);if(null==i)return;let a=y(n.css),u=wr(n);Tr(e,a,!0,i,n,s,o),qr(e,a,!0,i,n,u.show,s,o,(t=>{r(l)&&Cr(e,l,[t])}))}else r(l)&&Cr(e,l,[])}function _r(e,t,n={},s,o,i,l){if(i){let i=Fr(t);if(null==i)return;let a=y(n.css),u=wr(n);Or(e,a,!0,i,n,u.hide,null,s,o,(t=>{r(l)&&Cr(e,l,[t])}))}else r(l)&&Cr(e,l,[])}function Mr(e,t,r){return"function"==typeof e?Reflect.apply(e,{},[t,r]):e}function Nr(e,t){if(!e)return null;const r=e(t);return 1===r.length?r[0]:r}class Kr{node;state;constructor(e,t){this.node=e,this.state=t}}const Ir=e.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(t,r){const n=e.getCurrentInstance();if(null===n||null===n.proxy)return;const s=!0===t.multi,o=e.inject(pr,null),i=e.inject(dr,0),l=e.inject(yr,null),a=e.inject(mr,-1);let u=!1,c=null;const f=t.modelSlot;if(f){e.provide(dr,i+1),e.provide(mr,f.index),e.provide(vr,f.index);const t=f.route;if(!t)return;const r=er(n.proxy,!0);(function(e){let t=e.get(nr);t||(t=[],e.set(nr,t))})(r),cr(r,t)}else{if(null==o)return;const r=t.name,h=e.inject(gr,null),f=e.inject(vr,0);if(c=o[V](r,i,l,a,h,f),null===c)return;if(e.provide(gr,c),!0===c[se]&&e.provide(yr,c),s)u=y(t.transition??!0);else{u=y(t.transition??!1),e.provide(mr,-1),e.provide(dr,i+1),e.provide(vr,-1);const r=c.slots.value;if(r.length>0){const e=r[0].route;if(e){cr(er(n.proxy,!0),e)}}else{const e=er(n.proxy,!0);c.compensation=()=>{const t=c.slots.value;if(t.length>0){const r=t[0].route;return r&&cr(e,r),!0}return!1}}}}const p={value:new Map};return e.onUnmounted((()=>{p.value&&p.value.clear()})),()=>{if(s){const s=new Map,o=[],i=c?.slots.value,l=[];for(let a=0;a<i.length;a++){const c=i[a],f=`${t.name}-${c.index}`,d={modelSlot:c};let y;y=r.slots.default?e.h(Ir,d,{default:r.slots.default}):e.h(Ir,d);const m={},g=Mr(t.viewClass,c.route,a);"string"==typeof g&&g.length>0&&(m[g]=!0);const v=Mr(t.viewActiveClass,c.route,a),b=Mr(t.viewDeactiveClass,c.route,a),x=p.value.get(f);if("string"==typeof v&&v.length>0&&(m[v]=c.active),"string"==typeof b&&b.length>0&&(m[b]=!c.active),x&&c.active!==x.state){const e=x.node;c.active?l.unshift((()=>{kr(n,e,t,c.route,a,u,(()=>{let t=rr(e);null!=t&&sr(t,or.ACTIVATED)}))})):l.push((()=>{_r(n,e,t,c.route,a,u,(()=>{let t=rr(e);null!=t&&sr(t,or.DEACTIVATED)}))}))}const w={class:m,key:f},S=Mr(t.viewTagProps,c.route,a);null!==S&&"object"==typeof S&&h(!0,w,S),c.route?.viewTagAttrs&&"object"==typeof c.route?.viewTagAttrs&&h(!0,w,c.route.viewTagAttrs);const R=Mr(t.viewTag,c.route,a),A=e.h(R,w,{default:()=>[y]});if(s.set(f,new Kr(A,c.active)),u){const e=$r(n,t,c.route,a);A.transition=e}o.push(A)}p.value=s,function(e,t={}){Er((()=>{for(let r=0;r<e.length;r++)Reflect.apply(e[r],t,[])}))}(l,n);const a=Mr(t.tag,null,-1),f={};return Object.assign(f,r.attrs),e.h(a,f,{default:()=>o})}if(null!=f){const t=f.model,n={};t.props&&("object"==typeof t.props?h(!1,n,t.props):!0===t.props&&"object"==typeof f.route?.params&&h(!1,n,f.route?.params));const s=e.h(t.component,n);return Nr(r.slots.default,{Component:s,route:f.route})??s}{const s=c.slots.value;if(s.length>0){const o=s[0],i=o.model,l={};i.props&&("object"==typeof i.props?h(!1,l,i.props):!0===i.props&&"object"==typeof o.route?.params&&h(!1,l,o.route?.params));const a=e.h(i.component,l);if(u){const e=$r(n,t,o.route,-1);a.transition=e}return Nr(r.slots.default,{Component:a,route:o.route})??a}return Nr(r.slots.fallback,{})}}}});function Lr(e,t){return"function"==typeof e?Reflect.apply(e,{},[t]):e}let Dr=e.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(t,r){const n=e.inject(pr,null);return()=>{let s=Lr(t.to,null),o=Lr(t.tag,s);if(null==o)return;let i=null,l=null;null!==n&&(i=n[z](s),t.root&&(i.root=t.root),l=n.current);let a={},u=Lr(t.activeClass,i);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)}(i,l)),!0===Lr(t.exact,i)){let e=Lr(t.exactActiveClass,i);"string"==typeof e&&e.length>0&&(a[e]=function(e,t){return null!=e&&null!=t&&!!(e===t||e.path&&e.path===t.path||e.name&&e.name===t.name)}(i,l))}let c={class:a};("a"===o||"A"===o)&&(c.href=i?.path??i?.name??"#"),h(!0,c,r.attrs);let f=Lr(t.event,i);if("string"==typeof f){const e=e=>{null!=n&&null!=i&&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(i)};c[f]=e}return e.h(o,c,r.slots)}}}),Hr={get each(){return S},get type(){return g},get isFunction(){return r},get isArray(){return t},get isArrayLike(){return b},get makeArray(){return w},get merge(){return x},get isWindow(){return v},get isPlainObject(){return i},get isEqual(){return R}};const Ur=Symbol("fk"),Br=Symbol("fbk"),Wr=Symbol("fepk");function Vr(t){return t?t.$router:e.inject(pr)}exports.Bus=N,exports.EventChain=Ie,exports.EventProxy=Xt,exports.Route=Y,exports.Router=Vt,exports.cancel=function(e){let t=Se.get(e);return!!t&&(t.timer&&(clearTimeout(t.timer),t.timer=null),t.controller.abort(),Se.delete(e),!0)},exports.clone=c,exports.createFox=function(e={}){const t=new Vt(e),r=new N,n=new Xt,s={...Hr,get router(){return t},get bus(){return r},get Bus(){return N},get eventproxy(){return n},get EventProxy(){return Xt},get EventChain(){return Ie},get require(){return t.require},get request(){return Re},get extend(){return h},get clone(){return c},install(e){e.provide(pr,t),e.provide(Ur,s),e.provide(Br,r),e.provide(Wr,n),e.component("fox-router-view",Ir),e.component("fox-router-link",Dr),Reflect.defineProperty(e.config.globalProperties,"$fox",{get:()=>s}),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 fr(this)}}}),t.init()}};return s},exports.createMemoryHistory=et,exports.createWebHashHistory=Qe,exports.createWebHistory=function(e=!0,t=null,r="",n=!0,s=!1,o){return null!==t&&(t=me().location.pathname),t&&t.endsWith("/")&&(t=t.substring(0,t.length-1)),new Ye("path",t??"",r,e,n,s,o)},exports.extend=h,exports.foxBusKey=Br,exports.foxEventProxyKey=Wr,exports.foxKey=Ur,exports.isArray=t,exports.isDate=e=>e instanceof Date,exports.isESModule=a,exports.isEqual=R,exports.isFunction=r,exports.isMap=e=>"[object Map]"===o(e),exports.isObject=n,exports.isPlainObject=i,exports.isPromise=e=>n(e)&&r(e.then)&&r(e.catch),exports.isSet=e=>"[object Set]"===o(e),exports.isString=e=>"string"==typeof e,exports.isSymbol=e=>"symbol"==typeof e,exports.onAfterRouteUpdate=function(t){const r=Vr(),n=(e,r,n)=>{try{Reflect.apply(t,{},[e,r])}catch(e){}n()};r.afterEach(n),e.onUnmounted((()=>{r.removeAfterEach(n)}))},exports.onBeforeRouteUpdate=function(t){const r=Vr(),n=(e,r,n)=>{try{Reflect.apply(t,{},[e,r])}catch(e){}n()};r.beforeEach(n),e.onUnmounted((()=>{r.removeBeforeEach(n)}))},exports.onFoxActivated=ar,exports.onFoxDeactivated=ur,exports.request=Re,exports.toBoolean=y,exports.toNumber=function(e){return"number"==typeof e?e:Number(e)},exports.toTypeString=o,exports.useBus=function(t){return t?t.$bus:e.inject(Br)},exports.useEventProxy=function(t){return t?t.$eventProxy:e.inject(Wr)},exports.useFox=function(t){return t?t.$fox:e.inject(Ur)},exports.useRoute=function(t){return t||(t=e.getCurrentInstance()?.proxy??void 0),t?fr(t):null},exports.useRouter=Vr;
package/libs/index.d.ts CHANGED
@@ -19,10 +19,10 @@ interface TreeNode {
19
19
  */
20
20
  interface Tree extends TreeNode {
21
21
  /**
22
- * 加入数据
23
- * @param args
24
- * @returns {boolean}
25
- */
22
+ * 加入数据
23
+ * @param args
24
+ * @returns {boolean}
25
+ */
26
26
  put(...args: any[]): boolean;
27
27
  /**
28
28
  * 获取内容
@@ -920,6 +920,70 @@ declare class TaskNode {
920
920
  constructor(index: number, src: string, params: any, progress: Progress);
921
921
  }
922
922
 
923
+ declare class MarkRecord {
924
+ currentRoute: Route;
925
+ routes: Array<Route>;
926
+ /**
927
+ * 构造函数
928
+ * @param currentRoute
929
+ * @param routes
930
+ */
931
+ constructor(currentRoute: Route, routes: Array<Route>);
932
+ }
933
+ /**
934
+ * history change handler
935
+ */
936
+ interface HistoryChangeHandler {
937
+ (args: Array<Route> | string): void;
938
+ }
939
+ /**
940
+ * Router History
941
+ */
942
+ interface RouterHistory {
943
+ /**
944
+ * 基础路径
945
+ */
946
+ base: string;
947
+ /**
948
+ * 是否监听history change
949
+ */
950
+ historyMonitor: boolean;
951
+ /**
952
+ * 是否支持无痕模式
953
+ */
954
+ traceless: boolean;
955
+ /**
956
+ * 初始化
957
+ * @param firstNavigate
958
+ * @returns
959
+ */
960
+ init(firstNavigate: boolean): Promise<void>;
961
+ /**
962
+ * 销毁
963
+ */
964
+ destroy(): void;
965
+ /**
966
+ * 监听历史记录改变
967
+ * @param handler
968
+ */
969
+ listen(handler: HistoryChangeHandler): void;
970
+ /**
971
+ * 跳转
972
+ * @param n
973
+ */
974
+ go(n: number): void;
975
+ /**
976
+ * 加入记录
977
+ * @param record
978
+ */
979
+ push(record: MarkRecord): void;
980
+ /**
981
+ * 替换当前记录
982
+ * @param record
983
+ */
984
+ replace(record: MarkRecord): void;
985
+ }
986
+
923
987
  declare const sync: unique symbol;
924
988
  declare const resolveRoute: unique symbol;
925
989
 
@@ -938,21 +1002,9 @@ interface RouterOptions {
938
1002
  (route: Route): string;
939
1003
  };
940
1004
  /**
941
- * hash monitor(路由跳转是否基于URL hash的变化)
942
- */
943
- hashMonitor?: boolean;
944
- /**
945
- * 无痕迹模式,不修改历史记录
946
- */
947
- traceless?: boolean;
948
- /**
949
- * 默认加载的路由对应路径
950
- */
951
- defaultPath?: string;
952
- /**
953
- * base query
1005
+ * router history
954
1006
  */
955
- query?: any;
1007
+ history?: RouterHistory;
956
1008
  /**
957
1009
  * 路由配置列表
958
1010
  */
@@ -961,6 +1013,10 @@ interface RouterOptions {
961
1013
  * not found 路由
962
1014
  */
963
1015
  notFound?: RouteConfig;
1016
+ /**
1017
+ * not found 路由路径
1018
+ */
1019
+ notFoundPath?: string;
964
1020
  }
965
1021
  /**
966
1022
  * before route update filter
@@ -1004,6 +1060,7 @@ declare const _handleError: unique symbol;
1004
1060
  declare const errorCallback: unique symbol;
1005
1061
  declare const registerKey$1: unique symbol;
1006
1062
  declare const notFoundKey: unique symbol;
1063
+ declare const notFoundPathKey: unique symbol;
1007
1064
  declare const forestKey: unique symbol;
1008
1065
  declare const historyKey: unique symbol;
1009
1066
  declare const beforeFiltersKey: unique symbol;
@@ -1012,6 +1069,9 @@ declare const destroyFiltersKey: unique symbol;
1012
1069
  declare const mainDispatcherKey: unique symbol;
1013
1070
  declare const initKey: unique symbol;
1014
1071
  declare const requireKey: unique symbol;
1072
+ declare const readyKey: unique symbol;
1073
+ declare const readyHandlersKey: unique symbol;
1074
+ declare const _markReady: unique symbol;
1015
1075
  declare const _createNextFn: unique symbol;
1016
1076
  declare const _start: unique symbol;
1017
1077
  declare const _before: unique symbol;
@@ -1032,6 +1092,18 @@ declare class Router {
1032
1092
  * not found route
1033
1093
  */
1034
1094
  private [notFoundKey]?;
1095
+ /**
1096
+ * not found route path
1097
+ */
1098
+ private [notFoundPathKey];
1099
+ /**
1100
+ * ready
1101
+ */
1102
+ private [readyKey];
1103
+ /**
1104
+ * ready handlers
1105
+ */
1106
+ private [readyHandlersKey];
1035
1107
  /**
1036
1108
  * 页面根节点
1037
1109
  */
@@ -1092,7 +1164,7 @@ declare class Router {
1092
1164
  * 创建require
1093
1165
  */
1094
1166
  private [requireKey];
1095
- get require(): Require;
1167
+ get require(): Require | null;
1096
1168
  /**
1097
1169
  * 获取当前最新route
1098
1170
  */
@@ -1105,7 +1177,7 @@ declare class Router {
1105
1177
  constructor(options: RouterOptions);
1106
1178
  /**
1107
1179
  * 记录错误日志
1108
- * @param msg
1180
+ * @param error
1109
1181
  * @param route
1110
1182
  */
1111
1183
  private [_handleError];
@@ -1113,6 +1185,14 @@ declare class Router {
1113
1185
  * 初始化
1114
1186
  */
1115
1187
  init(): void;
1188
+ /**
1189
+ * 第一次导航是否完成
1190
+ */
1191
+ isReady(): Promise<void>;
1192
+ /**
1193
+ * 设置第一导航完成
1194
+ */
1195
+ private [_markReady];
1116
1196
  /**
1117
1197
  * 是否忽略历史记录改变
1118
1198
  * @type {boolean}
@@ -1145,13 +1225,13 @@ declare class Router {
1145
1225
  */
1146
1226
  private [_removeRouteRecorder];
1147
1227
  /**
1148
- * 设置hash monitor是否启动
1228
+ * 设置history monitor是否启动
1149
1229
  */
1150
- set hashMonitor(val: boolean);
1230
+ set hisotryMonitor(val: boolean);
1151
1231
  /**
1152
- * 获取hash minitor
1232
+ * 获取history minitor
1153
1233
  */
1154
- get hashMonitor(): boolean;
1234
+ get historyMonitor(): boolean;
1155
1235
  /**
1156
1236
  * 设置无痕模式,不改变历史记录
1157
1237
  */
@@ -1215,27 +1295,32 @@ declare class Router {
1215
1295
  }): void;
1216
1296
  /**
1217
1297
  * 加入路由配置列表
1218
- * @param routes
1298
+ * @param routeConfigs
1219
1299
  */
1220
1300
  addRoutes(routeConfigs: RouteConfig[]): void;
1221
1301
  /**
1222
1302
  * 加入路由配置
1223
- * @param route
1303
+ * @param routeConfig
1224
1304
  * @param index
1225
1305
  */
1226
1306
  addRoute(routeConfig: RouteConfig, index?: number): void;
1227
1307
  /**
1228
1308
  * 移除路由
1229
1309
  *
1230
- * @param target
1310
+ * @param route
1231
1311
  */
1232
1312
  removeRoute(route: Route | string): boolean;
1233
1313
  /**
1234
1314
  * 判断路由是否存在
1235
1315
  *
1236
- * @param target
1316
+ * @param route
1237
1317
  */
1238
1318
  hasRoute(route: Route | string): boolean;
1319
+ /**
1320
+ * 配置not found路由路径
1321
+ * @param path
1322
+ */
1323
+ setNotFoundPath(path: string): void;
1239
1324
  /**
1240
1325
  * 配置not found路由配置
1241
1326
  * @param routeConfig
@@ -1279,7 +1364,7 @@ declare class Router {
1279
1364
  replace(...args: any[]): Router;
1280
1365
  /**
1281
1366
  * 路由跳转(operation类型为Append)
1282
- * @param path
1367
+ * @param args
1283
1368
  */
1284
1369
  append(...args: any[]): Router;
1285
1370
  /**
@@ -1377,7 +1462,7 @@ declare class Router {
1377
1462
  * build page
1378
1463
  * @param route
1379
1464
  * @param routeModel
1380
- * @returns {boolean}
1465
+ * @returns
1381
1466
  */
1382
1467
  private [_buildPage];
1383
1468
  /**
@@ -1624,6 +1709,57 @@ interface Tools {
1624
1709
  get isEqual(): Function;
1625
1710
  }
1626
1711
 
1712
+ /**
1713
+ * storage
1714
+ */
1715
+ interface Storage {
1716
+ /**
1717
+ * 获取item
1718
+ * @param key
1719
+ */
1720
+ getItem(key: string): string | null;
1721
+ /**
1722
+ * 设置item
1723
+ * @param key
1724
+ * @param value
1725
+ */
1726
+ setItem(key: string, value: string): void;
1727
+ /**
1728
+ * remove item
1729
+ * @param key
1730
+ */
1731
+ removeItem(key: string): void;
1732
+ }
1733
+ /**
1734
+ * 创建web history
1735
+ * @param navigateFirstRoute
1736
+ * @param base
1737
+ * @param query
1738
+ * @param historyMonitor
1739
+ * @param traceless
1740
+ * @param storage
1741
+ * @returns
1742
+ */
1743
+ declare function createWebHistory(navigateFirstRoute?: boolean, base?: string | null, query?: string, historyMonitor?: boolean, traceless?: boolean, storage?: Storage): RouterHistory;
1744
+ /**
1745
+ * 创建web hash history
1746
+ * @param navigateFirstRoute
1747
+ * @param query
1748
+ * @param historyMonitor
1749
+ * @param traceless
1750
+ * @param storage
1751
+ * @returns
1752
+ */
1753
+ declare function createWebHashHistory(navigateFirstRoute?: boolean, query?: string, historyMonitor?: boolean, traceless?: boolean, storage?: Storage): RouterHistory;
1754
+
1755
+ /**
1756
+ * 创建memory history
1757
+ * @param base
1758
+ * @param maxHistoryRecorderSize
1759
+ * @returns
1760
+ */
1761
+ declare function createMemoryHistory(base?: string, maxHistoryRecorderSize?: number): RouterHistory;
1762
+
1627
1763
  /**
1628
1764
  * 全局Fox
1629
1765
  */
@@ -1672,7 +1808,7 @@ interface Fox extends Tools {
1672
1808
  /**
1673
1809
  * 返回require
1674
1810
  */
1675
- get require(): Require;
1811
+ get require(): Require | null;
1676
1812
  /**
1677
1813
  * 返回fectch
1678
1814
  */
@@ -1741,4 +1877,4 @@ declare function onAfterRouteUpdate(callback: {
1741
1877
  (to: Route, from?: Route): void;
1742
1878
  }): void;
1743
1879
 
1744
- export { Bus, EventChain, EventProxy, Route, Router, cancel, clone, createFox, extend, foxBusKey, foxEventProxyKey, foxKey, isArray, isDate, isESModule, isEqual, isFunction, isMap, isObject, isPlainObject, isPromise, isSet, isString, isSymbol, onAfterRouteUpdate, onBeforeRouteUpdate, onFoxActivated, onFoxDeactivated, request, toBoolean, toNumber, toTypeString, useBus, useEventProxy, useFox, useRoute, useRouter };
1880
+ export { Bus, EventChain, EventProxy, Route, Router, cancel, clone, createFox, createMemoryHistory, createWebHashHistory, createWebHistory, extend, foxBusKey, foxEventProxyKey, foxKey, isArray, isDate, isESModule, isEqual, isFunction, isMap, isObject, isPlainObject, isPromise, isSet, isString, isSymbol, onAfterRouteUpdate, onBeforeRouteUpdate, onFoxActivated, onFoxDeactivated, request, toBoolean, toNumber, toTypeString, useBus, useEventProxy, useFox, useRoute, useRouter };
@@ -0,0 +1 @@
1
+ import{ref as e,effectScope as t,watch as r,shallowRef as n,getCurrentInstance as s,onUnmounted as i,shallowReactive as o,defineComponent as l,inject as a,provide as u,h}from"vue";const c=Array.isArray,f=e=>"[object Map]"===x(e),p=e=>"[object Set]"===x(e),d=e=>e instanceof Date,y=e=>"function"==typeof e,m=e=>"string"==typeof e,g=e=>"symbol"==typeof e,v=e=>null!==e&&"object"==typeof e,b=e=>v(e)&&y(e.then)&&y(e.catch),w=Object.prototype.toString,x=e=>w.call(e),S=e=>"[object Object]"===x(e),R="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function A(e){return e.__esModule||R&&"Module"===e[Symbol.toStringTag]}const E=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,s=!1;for("boolean"==typeof t&&(s=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],i=n[e];if(r!==i)if(!0===s&&i&&"object"==typeof i){let n;n=Array.isArray(i)?r&&Array.isArray(r)?r:[]:r&&"object"==typeof r?r:{},t[e]=C(s,n,i)}else void 0!==i&&(t[e]=i)}}return t}function P(e,t,r=!1){if(r){if("object"!=typeof t)return{};"object"!=typeof e&&(e={});for(let n in t){let s=e[n],i=t[n];if(s!==i)if("object"==typeof i){if(!Array.isArray(i)&&!S(i))continue;s=P(s,i,r),e[n]=s}else{if("function"==typeof i)continue;e[n]=i}}const n=Object.getOwnPropertySymbols(t);for(let s of n){let n=e[s],i=t[s];if(n!==i)if("object"==typeof i){if(!Array.isArray(i)&&!S(i))continue;n=P(n,i,r),e[s]=n}else{if("function"==typeof i)continue;e[s]=i}}}else C(!0,e,t);return e}class j{static seed=(new Date).getTime();static get(){let e=++j.seed;return e>=Number.MAX_VALUE&&(j.seed=0),e}}const T=E?Promise.resolve():null;function q(e,...t){null!==T?t&&t.length>0?T.then((()=>{e(t)})):T.then(e):t&&t.length>0?setTimeout((()=>{e(t)})):setTimeout(e)}function O(e){return null!=e&&("boolean"==typeof e?e:"string"==typeof e?"true"===e.toLocaleLowerCase():Boolean(e))}function $(e){return"number"==typeof e?e:Number(e)}const F={"[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 k(e){let t=Object.prototype.toString.call(e);return null==e?String(e):F[t]||"object"}function _(e){return e&&"object"==typeof e&&"setInterval"in e}function M(e){let t=!!e&&"length"in e&&e.length,r=k(e);return"function"!==r&&!_(e)&&("array"===r||0===t||"number"==typeof t&&t>0&&t-1 in e)}function N(e,t){let r=+t.length,n=0,s=e.length;for(;n<r;n++)e[s++]=t[n];return e.length=s,e}function K(e,t=[]){let r=t;return null!=e&&(M(Object(e))?N(r,"string"==typeof e?[e]:e):r.push(e)),r}function I(e,t,r){if(M(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 L(e,t){if(e==t)return!0;if(void 0===e||void 0===t)return!1;let r=k(e);if(r!==k(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 s=r[n];if(!L(e[s],t[s]))return!1}return!0}if("array"===r){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){if(!L(e[r],t[r]))return!1}return!0}return!1}const D=Symbol("idKey"),H=Symbol("valueKey"),B=Symbol("childrenKey"),U=Symbol("growKey");class W{[U]=!0;[D];[H]=e();[B]=new Map;constructor(e){this[D]=e}}class V{get(e,t){if("value"==t)return e[H].value;if("grow"===t)return e[U];let r=e[B].get(t);return r?G(r):e[U]?(r=J(t),r[U]=e[U],e[B].set(t,r),G(r)):void 0}set(e,t,r){return"value"==t?(e[H].value=r,!0):"grow"===t?(e[U]=O(r),!0):null==r&&(e[B].delete(t),!0)}deleteProperty(e,t){return"value"!==t&&"grow"!=t&&(e[B].delete(t),!0)}}const z="__proxy__";function J(e){let t=new W(e);return Reflect.set(t,z,new Proxy(t,new V)),t}function G(e){return Reflect.get(e,z)}class X extends W{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,s=e[n];r[B].has(s)?t=r[B].get(s):(t=J(s),r[B].set(s,t)),r=t}return r[H].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[B].has(t))return;r=r[B].get(t)}return r[H].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[B].has(t))return!1;r=r[B].get(t)}let n=e[t-1];return!!r[B].has(n)&&(r[B].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[B].has(t))return!1;r=r[B].get(t)}let n=e[t-1];return r[B].has(n)}clear(){this[B].clear()}}const Y=["put","get","contains","remove","clear"];function Q(e){return Y.includes(e)}class Z{get(e,t){if("value"==t)return e[H].value;if("grow"===t)return e[U];if(t===B)return e[B];if("string"==typeof t&&Q(t))return e[t];let r=String(t),n=e[B].get(r);return n?G(n):e[U]?(n=J(r),n[U]=e[U],e[B].set(r,n),G(n)):void 0}set(e,t,r){return"value"==t?(e[H].value=r,!0):"grow"===t?(e[U]=O(r),!0):!Q(t)&&(null==r&&(e[B].delete(t),!0))}deleteProperty(e,t){return"value"!==t&&"grow"!=t&&(e[B].delete(t),!0)}}let ee=new Proxy(X,{construct(e,...t){let r=function(){let e=new X,t=new Z,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,z,r),e}();return G(r)}});function te(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 s=1,i="";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==--s){l++;break}}else if("("===e[l]&&(s++,"?"!==e[l+1]))throw new TypeError("Capturing groups are not allowed at ".concat(l));i+=e[l++]}else i+=e[l++]+e[l++];if(s)throw new TypeError("Unbalanced pattern at ".concat(r));if(!i)throw new TypeError("Missing pattern at ".concat(r));t.push({type:"PATTERN",index:r,value:i}),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,s=void 0===n?"./":n,i="[^".concat(se(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],s=n.type,i=n.index;throw new TypeError("Unexpected ".concat(s," at ").concat(i,", 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===s.indexOf(m)&&(u+=m,m=""),u&&(o.push(u),u=""),o.push({name:d||l++,prefix:m,suffix:"",pattern:y||i,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?i:b,prefix:m,suffix:w,modifier:h("MODIFIER")||""})}else c("END")}}return o}function re(e,t){return function(e,t){void 0===t&&(t={});var r=ie(t),n=t.encode,s=void 0===n?function(e){return e}:n,i=t.validate,o=void 0===i||i,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 i=e[n];if("string"!=typeof i){var a=t?t[i.name]:void 0,u="?"===i.modifier||"*"===i.modifier,h="*"===i.modifier||"+"===i.modifier;if(Array.isArray(a)){if(!h)throw new TypeError('Expected "'.concat(i.name,'" to not repeat, but got an array'));if(0===a.length){if(u)continue;throw new TypeError('Expected "'.concat(i.name,'" to not be empty'))}for(var c=0;c<a.length;c++){var f=s(a[c],i);if(o&&!l[n].test(f))throw new TypeError('Expected all "'.concat(i.name,'" to match "').concat(i.pattern,'", but got "').concat(f,'"'));r+=i.prefix+f+i.suffix}}else if("string"!=typeof a&&"number"!=typeof a){if(!u){var p=h?"an array":"a string";throw new TypeError('Expected "'.concat(i.name,'" to be ').concat(p))}}else{f=s(String(a),i);if(o&&!l[n].test(f))throw new TypeError('Expected "'.concat(i.name,'" to match "').concat(i.pattern,'", but got "').concat(f,'"'));r+=i.prefix+f+i.suffix}}else r+=i}return r}}(te(e,t),t)}function ne(e,t){var r=[];return function(e,t,r){void 0===r&&(r={});var n=r.decode,s=void 0===n?function(e){return e}:n;return function(r){var n=e.exec(r);if(!n)return!1;for(var i=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 s(e,r)})):l[r.name]=s(n[e],r)},u=1;u<n.length;u++)a(u);return{path:i,index:o,params:l}}}(le(e,r,t),r,t)}function se(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function ie(e){return e&&e.sensitive?"":"i"}function oe(e,t,r){return function(e,t,r){void 0===r&&(r={});for(var n=r.strict,s=void 0!==n&&n,i=r.start,o=void 0===i||i,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(se(void 0===p?"":p),"]|$"),y="[".concat(se(f),"]"),m=o?"^":"",g=0,v=e;g<v.length;g++){var b=v[g];if("string"==typeof b)m+=se(h(b));else{var w=se(h(b.prefix)),x=se(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)s||(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;s||(m+="(?:".concat(y,"(?=").concat(d,"))?")),A||(m+="(?=".concat(y,"|").concat(d,")"))}return new RegExp(m,ie(r))}(te(e,r),t,r)}function le(e,t,r){return e instanceof RegExp?function(e,t){if(!t)return e;for(var r=/\((?:\?<(.*?)>)?(?!\?)/g,n=0,s=r.exec(e.source);s;)t.push({name:s[1]||n++,prefix:"",suffix:"",modifier:"",pattern:""}),s=r.exec(e.source);return e}(e,t):Array.isArray(e)?function(e,t,r){var n=e.map((function(e){return le(e,t,r).source}));return new RegExp("(?:".concat(n.join("|"),")"),ie(r))}(e,t,r):oe(e,t,r)}const ae="default",ue=Symbol("sync"),he=Symbol("resolveRoute");function ce(e){let t=!1;return function(...r){if(!t)return t=!0,Reflect.apply(e,{},r)}}class fe{name;level;rootName;rootIndex=0;constructor(e,t,r,n){this.name=e,this.level=t,this.rootName=r,this.rootIndex=n}}class pe{to;routeModel;from;data={};constructor(e,t){this.to=e,this.from=t}static from(e){let t=new pe(e.to,e.from),r=e.data??{};return C(!0,t.data,r),t}}class de{path;get fullPath(){let e=this.path??`/${this.name}`;return`${this.root??ae}!${e}`}name;root;params;query;matched;meta;success;error;destroy;opsType;updateType;viewTagAttrs;index;active;slot;session;static clone(e,t){let r=new de;return P(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 de;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 ye{id;name;props;meta;src;component;constructor(e,t,r,n){this.id=j.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 s=ce((t=>{A(t)&&(t=t.default),e.component=t,r()})),i=ce((e=>{n(e)}));let o;try{o=t(s,i)}catch(e){i(e)}if(o)if("function"==typeof o.then)o.then(s,i);else{const e=o.component;e&&"function"==typeof e.then&&e.then(s,i)}}))}(this)}}class me{models=[]}class ge{path;match;redirect;name;layers=[]}var ve,be=((ve=be||{})[ve.Push=0]="Push",ve[ve.Replace=1]="Replace",ve[ve.Put=2]="Put",ve[ve.Append=3]="Append",ve[ve.Open=4]="Open",ve),we=(e=>(e[e.Part=0]="Part",e[e.All=1]="All",e))(we||{});const xe=Symbol("rootKey"),Se=Symbol("rootNodeKey"),Re=Symbol("parentNodeKey"),Ae=Symbol("nameKey");class Ee{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 Ce{scope=null;set compensation(e){null!==this.scope&&this.scope.stop(),this.scope=t(),this.scope.run((()=>{r(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=n([])),this._slots}get empty(){return null==this._slots||0==this._slots.value.length}[Ae];[xe];[Se]=null;[Re]=null;get name(){return this[Ae]}constructor(e,t,r){this[Ae]=e,this[xe]=t,r&&(this[Se]=r)}}class Pe{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 je{views=[]}class Te{layers=[]}class qe{time;route}class Oe{forbidTime=300;submitRecorder=new qe;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 $e=typeof window<"u",Fe=function(){return window},ke=function(){return window.document};function _e(e,t,r){e.addEventListener?e.addEventListener(t,r,!1):e.attachEvent?e.attachEvent(`on${t}`,r):e[`on${t}`]=r}function Me(e,t,r){e.removeEventListener?e.removeEventListener(t,r):e.detachEvent?e.detachEvent(`on${t}`,r):e[`on${t}`]=null}let Ne=function(){if(!$e)return"/";let e=Fe().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 Ke={method:"POST",headers:{"Content-Type":"application/json; charset=UTF-8"},mode:"cors",credentials:"same-origin",cache:"default",redirect:"follow",keepalive:!0},Ie=new Map;async function Le(e){let{id:t,method:r="POST",url:n,headers:s={},data:i,processData:o=!0,timeout:l=-1}=e;if(t&&Ie.has(t))throw new Error("resubmit");r=r.toUpperCase();let{contentType:a="application/json; charset=UTF-8"}=s,u=C(!0,{...Ke},{method:r,headers:s});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 s=`${encodeURIComponent(e)}=${encodeURIComponent(r[t])}`;n.length>0&&(n+="&"),n+=s}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,i,a):(o&&(i=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 s=`${encodeURIComponent(t)}=${encodeURIComponent(n[e])}`;r.length>0&&(r+="&"),r+=s}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}(i,a)),u.body=i),t||l>0){t||(t=`fetch_${j.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}Ie.set(t,r)}try{let e=await fetch(n,u),r={};e.headers.forEach(((e,t)=>{r[e]=t}));let s,i=r["content-type"]??"";return s=-1!==i.indexOf("application/json")?await e.json():-1!=i.indexOf("text")?await e.text():await e.blob(),{ok:e.ok,status:e.status,statusText:e.statusText,headers:r,data:s,response:e}}catch(e){throw e}finally{if(t){let e=Ie.get(t);e&&(e.timer&&(clearTimeout(e.timer),e.timer=null),Ie.delete(t))}}}function De(e){let t=Ie.get(e);return!!t&&(t.timer&&(clearTimeout(t.timer),t.timer=null),t.controller.abort(),Ie.delete(e),!0)}class He{cache=new Map;constructor(){}async get(e,t=-1){if(this.cache.has(e))return this.cache.get(e);let r=await Le({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 Be=(e=>(e[e.Loading=0]="Loading",e[e.Loaded=1]="Loaded",e[e.Defining=2]="Defining",e[e.Defined=3]="Defined",e))(Be||{});class Ue{exports;status;id;src}class We{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 Ve=(e=>(e.Busy="Busy",e.Free="Free",e.Reject="Reject",e.Exception="Exception",e.Finished="Finished",e))(Ve||{});const ze=Symbol("chainKey"),Je=Symbol("cursorKey"),Ge=Symbol("$persistentModeKey"),Xe=Symbol("statusKey"),Ye=Symbol("argsKey"),Qe=Symbol("exArgsKey"),Ze=Symbol("successFnsKey"),et=Symbol("errorFnsKey"),tt=Symbol("sessionKey"),rt=Symbol("_go");class nt{[ze]=[];[Je]=0;[Ge]=!1;[Xe]="Free";[Ye]=[];[Qe]=[];[Ze]=[];[et]=[];[tt];get session(){return this[tt]}constructor(e,t=!1){this[tt]=e,this[Ge]=t}[rt](e,...t){let r=this[Xe];if(this[Xe]="Busy",this[Je]+=e,this[Je]<0&&(this[Je]=0),this[Ye]=t,"Exception"===r||"Reject"===r){let e=[{session:this[tt]},...this[Qe]];for(;this[et].length>0;)try{let t=this[et].shift();"function"==typeof t&&q((()=>{Reflect.apply(t,{},e)}))}catch(e){}return this[Xe]=r,this[ze]=[],this[Je]=0,this}if("Finished"===r||this[Je]>=this[ze].length){let e=[{session:this[tt]},...this[Ye]];for(;this[Ze].length>0;){let t=this[Ze].shift();"function"==typeof t&&q((()=>{Reflect.apply(t,{},e)}))}return this[Xe]="Free",this}if(this[Je]>=this[ze].length)return this[Xe]="Free",this;let n=this[ze][this[Je]];this[Ge]||(this[ze].splice(0,this[Je]+1),this[Je]=-1);let s=this[Je]+1;try{let e=!1,t={go:(t,...r)=>{e||(e=!0,Reflect.apply(this[rt],this,[t,...r]))},resolve:(...t)=>{e||(e=!0,Reflect.apply(this[rt],this,[1,...t]))},reject:(...t)=>{e||(e=!0,Reflect.apply(this.reject,this,[...t]))},insert:t=>{e||(this[ze].splice(s,0,t),s++)},session:this[tt]};q((()=>{Reflect.apply(n,{},[t,...this[Ye]])}))}catch(e){this.throw(e)}return this}go(e,...t){return Reflect.apply(this[rt],this,[e,...t])}finish(...e){return this[Xe]="Finished",this[Ye]=e,Reflect.apply(this[rt],this,[0])}reject(...e){return this[Xe]="Reject",this[Qe]=e,Reflect.apply(this[rt],this,[0])}throw(...e){return this[Xe]="Exception",this[Qe]=e,Reflect.apply(this[rt],this,[0])}reset(...e){this[Xe]="Busy",this[Ye]=e,this[ze]=[],this[Je]=0;let t=[{session:this[tt]},...this[Ye]];for(;this[Ze].length>0;){let e=this[Ze].shift();q((()=>{Reflect.apply(e,this,t)}))}return this[Xe]="Free",this}post(e){return"Reject"===this[Xe]||"Exception"===this[Xe]||(Array.isArray(e)?this[ze]=[...this[ze],...e]:this[ze].push(e),"Busy"===this[Xe]||Reflect.apply(this[rt],this,[0,...this[Ye]])),this}wait(e,t){return e&&"function"==typeof e&&this[Ze].push(e),t&&"function"==typeof t&&this[et].push(t),"Busy"===this[Xe]||Reflect.apply(this[rt],this,[0,...this[Ye]]),this}exception(e){return e&&"function"==typeof e&&this[et].push(e),"Busy"===this[Xe]?this:Reflect.apply(this[rt],this,[0,...this[Ye]])}isFinish(){return"Reject"==this[Xe]||"Free"==this[Xe]&&this[Je]>=this[ze].length}}class st{head;isOldWebKit;moduleManager=new We;resource=new He;options;_query;set query(e){this._query=e}get query(){return this._query}constructor(e={}){const t=ke();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 s=null;"function"==typeof e[r]&&(s=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 i=new ot(t.length,((e,t)=>{if(i.isOK())try{"function"==typeof s&&Reflect.apply(s,{},t)}catch(e){}else try{"function"==typeof s&&Reflect.apply(s,{},[])}catch(e){}})),o=new nt;for(let e=0;e<t.length;e++){let r=new lt(e,t[e],n,i);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 s=null;"function"==typeof e[r]&&(s=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 s&&Reflect.apply(s,{},[]),this}mount(e,t){const r=ke();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,s=t.src;this.resource.get(s,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=ke(),s=t.src,i=n.createElement("link"),o="onload"in i;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(i)}catch(e){}t.progress.work(!1,t.index,null),e.resolve()}};setTimeout((()=>{it(i,n)}),1)}else i.onload=()=>{i.onload=i.onerror=null,t.progress.work(!0,t.index,t.src),e.resolve()},i.onerror=()=>{try{r.removeChild(i)}catch(e){}i.onload=i.onerror=null,t.progress.work(!1,t.index,null),e.reject()};let l=n.getElementById(s);l&&l.parentNode&&l.parentNode.removeChild(l),i.rel="stylesheet",i.type="text/css",i.id=s,i.href=s,r.appendChild(i)}))}mountJS(e,t,r){e.post((e=>{let n=t.src,s=this.moduleManager.get(n);if(s&&(s.status==Be.Defined||s.status==Be.Loaded)){if(s.exports)return t.progress.work(!0,t.index,s.exports),void e.resolve();if(document.querySelector(`script[src='${n}`))return t.progress.work(!0,t.index,s.exports),void e.resolve()}s=new Ue,s.id=n,s.src=n,s.status=Be.Loading,this.moduleManager.put(n,s);const i=ke().createElement("script");if("onload"in i)i.onload=()=>{i.onload=i.onerror=null,s.status==Be.Loading&&(s.status=Be.Loaded,t.progress.work(!0,t.index,n)),e.resolve()},i.onerror=()=>{try{r.removeChild(i)}catch(e){}i.onload=i.onerror=null,t.progress.work(!1,t.index,null),e.reject()};else{let r=i;r.onreadystatechange=()=>{/loaded|complete/.test(r.readyState)&&(r.onreadystatechange=null,s.status==Be.Loading&&(s.status=Be.Loaded,t.progress.work(!0,t.index,n)),e.resolve())}}i.defer=!0,i.src=n,Fe().define=this.createDefine(s,t),r.appendChild(i)}))}unmount(e,t={}){const r=ke(),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=Be.Defining;let s,i,o,l=n.length;1===l?(o=n[0],s=void 0):2===l?(o=n[1],Array.isArray(n[0])?(i=r.trimEmptyElement(n[0]),s=void 0):i=void 0):(s=n[0],i=r.trimEmptyElement(n[1]),o=n[2]),s&&(e.id=s,r.options.alias[s]=e.src),i&&i.length>0?r.ensure(i,((...r)=>{e.exports="function"==typeof o?Reflect.apply(o,e,r):o,e.status=Be.Defined,t.progress.work(!0,t.index,e.exports)})):(e.exports="function"==typeof o?Reflect.apply(o,e,[]):o,e.status=Be.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 Ne+e.slice(1);if(0==e.indexOf("./"))return Ne+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),s=this.options.paths[n];t=s?s+e.slice(r):e}}return this.parserPath(t,!1)}return Ne+e}}function it(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():it(e,t)}),20)}class ot{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 lt{index;src;params;progress;constructor(e,t,r,n){this.index=e,this.src=t,this.params=r,this.progress=n}}const at=Symbol("_notifyChange");class ut{currentRoute;routes;constructor(e,t){this.currentRoute=e,this.routes=t}}const ht=Symbol("_navigateFirstRoute"),ct=Symbol("_getRouteMark"),ft=Symbol("_getUrlSearch"),pt=Symbol("_generateLocation"),dt=Symbol("_setRoteMarkhRecorder");class yt{base;storage;mode;query;firstNavigate=!0;historyMonitor;traceless=!1;changeHandler;historyChange;lastMark;constructor(e="hash",t="",r="",n=!0,s=!0,i=!1,o){this.mode=e,this.base=t,this.query=r,this.firstNavigate=n,this.historyMonitor=s,this.traceless=i,this.storage=o??Fe().sessionStorage}init(e=!0){const t=Fe();return"function"!=typeof this.historyChange&&(this.historyChange=()=>{if(!this.historyMonitor)return;const e=t.history.state;this[at](e)}),_e(t,"popstate",this.historyChange),this.firstNavigate&&e&&this[ht](),Promise.resolve()}destroy(){if(this.historyChange){Me(Fe(),"popstate",this.historyChange)}}[ht](){let e=this[ct]()??"/";const t=this.storage.getItem(e);if(t)try{const e=JSON.parse(t);return void this[at](e)}catch{}const r=e.indexOf("!");let n;n=-1!=r?e.substring(r+1):e;const s=new de;s.path=n,s.query=this[ft](),this[at]([s])}[dt](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){}}[at](e){"function"==typeof this.changeHandler&&this.changeHandler(e)}[ct](){const e=Fe();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}[ft](){return Fe().location.search}listen(e){this.changeHandler=e}go(e){Fe().history.go(e)}push(e){let t=this[pt](e.currentRoute);this.traceless||Fe().history.pushState(e.routes,"",t),this[dt](e.currentRoute.fullPath,e.routes)}replace(e){let t=this[pt](e.currentRoute);this.traceless||Fe().history.replaceState(e.routes,"",t),this[dt](e.currentRoute.fullPath,e.routes)}[pt](e){const t=Fe();let r;if(e.query){let t="";if("object"==typeof e.query)for(let r in e.query){let n=encodeURIComponent(e.query[r]),s=`${encodeURIComponent(r)}=${n}`;t.length>0&&(t+="&"),t+=s}else t=e.query;this.query?(r=`${this.query}&${t}`,"?"!==r.charAt(0)&&(r=`?${r}`)):r=`?${t}`}const n=t.location;let s,i=e.fullPath;return i.startsWith(ae)&&(i=i.substring(ae.length+2)),s=r?"path"==this.mode?`${this.base}/${i}${r}`:`${n.pathname}${r}#${i}`:"path"==this.mode?`${this.base}/${i}`:`${n.pathname}#${i}`,`${n.origin}${s}`}}function mt(e=!0,t=null,r="",n=!0,s=!1,i){return null!==t&&(t=Fe().location.pathname),t&&t.endsWith("/")&&(t=t.substring(0,t.length-1)),new yt("path",t??"",r,e,n,s,i)}function gt(e=!0,t="",r=!0,n=!1,s){return new yt("hash","",t,e,r,n,s)}class vt{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}[at](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[at](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 bt(e="",t=50){return new vt(e,t)}const wt=Symbol("_constructRouteModel"),xt=Symbol("_findRouteModel"),St=Symbol("_findRootView"),Rt=Symbol("_getFirstView"),At=Symbol("_removeView"),Et=Symbol("_buildPage"),Ct=Symbol("_resolveComponent"),Pt=Symbol("_update"),jt=Symbol("_merge"),Tt=Symbol("ignoreHistoryChangeOnceKey"),qt=Symbol("_handleHistoryChange"),Ot=Symbol("_handleRouteUpdated"),$t=Symbol("routeUpdatedCallback"),Ft=Symbol("currentRoutes"),kt=Symbol("current"),_t=Symbol("_addRouteRecorder"),Mt=Symbol("_removeRouteRecorder"),Nt=Symbol("_cloneRouteRecorder"),Kt=Symbol("_hanldeError"),It=Symbol("errorCallback"),Lt=Symbol("registerKey"),Dt=Symbol("notFoundKey"),Ht=Symbol("notFoundPathKey"),Bt=Symbol("forestKey"),Ut=Symbol("historyKey"),Wt=Symbol("beforeFiltersKey"),Vt=Symbol("afterFiltersKey"),zt=Symbol("destroyFiltersKey"),Jt=Symbol("mainDispatcherKey"),Gt=Symbol("initKey"),Xt=Symbol("requireKey"),Yt=Symbol("readyKey"),Qt=Symbol("readyHandlersKey"),Zt=Symbol("_markReady"),er=Symbol("_createNextFn"),tr=Symbol("_start"),rr=Symbol("_before"),nr=Symbol("_after"),sr=Symbol("_destroy"),ir=Symbol("_load"),or=Symbol("_unload"),lr=Symbol("_loadDependency"),ar=Symbol("resolvedModulesKey"),ur=Symbol("resolveDependencyKey"),hr=Symbol("routerGuardKey");class cr{[Lt]=new Array;[Dt];[Ht]="*";[Yt]=!1;[Qt]=[];[Bt]=new Te;[Ut];[Ft]=new Array;[It]=null;[$t]=null;[Wt]=new Array;[Vt]=new Array;[zt]=new Array;[Jt]=new nt;[ar]=new Map;[ur]=null;[hr]=new Oe;[Gt]=!1;[kt]=e(null);[Xt]=null;get require(){return $e?(this[Xt]||(this[Xt]=new st),this[Xt]):null}get current(){return this[kt].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[Ut]=e.history:this[Ut]=$e?gt():bt(),this[Ut]?.listen((async e=>{let t=!0;try{if("string"==typeof e){let t=this[he](e);t&&await this[qt]([t])}else await this[qt](e)}catch(e){t=!1}!1===this[Yt]&&this[Zt](t)}))}[Kt](e="error",t){if(t&&"function"==typeof t.error)try{t.error(e)}catch{}if("function"==typeof this[It])try{this[It](e,t)}catch{}}init(){!0!==this[Gt]&&(this[Ut]?.init(!this[Yt]),this[Gt]=!0)}isReady(){return this[Yt]?Promise.resolve():new Promise(((e,t)=>{this[Qt].push([e,t])}))}[Zt](e){this[Yt]=!0,this[Qt].forEach((([t,r])=>{try{e?t():r()}catch(e){}}))}[Tt]=!1;[qt](e){if(this[Tt])return this[Tt]=!1,Promise.resolve();try{if(!e){let e=[...this[Ft]].reverse();return this[or](e),$e&&Fe().location.reload(),Promise.resolve()}let t=null,r=[],n=[],s=0;for(;s<e.length&&s<this[Ft].length&&de.isSame(e[s],this[Ft][s]);s++)e[s].opsType===be.Open&&!0===e[s].active&&e[s].active!==this[Ft][s].active&&(t=e[s]);if(s<e.length&&(r=e.slice(s)),s<this[Ft].length&&(n=this[Ft].slice(s).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[or](n)){if(r.length>0)return this.restore(r);if(null!==t)return this.restore([t])}}}catch(e){this[Kt](e)}return Promise.resolve()}[Ot](e){if(e)this[kt].value=e;else{let e=this[Ft].length;this[kt].value=e>0?this[Ft][e-1]:null}if("function"==typeof this[$t])try{this[$t](this[kt].value)}catch{}}[_t](e,t=-1){t<0||t>=this[Ft].length?this[Ft].push(e):this[Ft].splice(t,0,e)}[Nt](){let e=[];for(let t of this[Ft]){let r=de.clone(t,!0);e.push(r)}return e}[Mt](e){if(null==this[Ft])return;let t=-1;for(let r=0;r<this[Ft].length;r++)if(de.isSame(this[Ft][r],e)){t=r;break}if(-1!=t){let e=this[Ft][t];this[Ft].splice(t,1),this[sr](e,e.session)}}set hisotryMonitor(e){this[Ut]&&(this[Ut].historyMonitor=e)}get historyMonitor(){return!!this[Ut]&&this[Ut].historyMonitor}set traceless(e){this[Ut]&&(this[Ut].traceless=e)}get traceless(){return!!this[Ut]&&this[Ut].traceless}onRouteUpdated(e){this[$t]=e}onError(e){this[It]=e}beforeEach(e){this[Wt].push(e)}removeBeforeEach(e){const t=this[Wt].indexOf(e);return-1!==t&&(this[Wt].splice(t,1),!0)}afterEach(e){this[Vt].push(e)}removeAfterEach(e){const t=this[Vt].indexOf(e);return-1!==t&&(this[Vt].splice(t,1),!0)}destroyEach(e){this[zt].push(e)}removeDestroyEach(e){const t=this[zt].indexOf(e);return-1!==t&&(this[zt].splice(t,1),!0)}setResolveDependency(e){this[ur]=e}addRoutes(e){for(let t of e)this.addRoute(t)}addRoute(e,t=-1){if(e.path===this[Ht])return void this.setNotFoundRoute(e);const r=this[wt](e);if(-1==t)this[Lt]=[...this[Lt],...r];else for(let e=r.length-1;e>=0;e--)this[Lt].splice(t,0,r[e])}removeRoute(e){const t=this[he](e);if(null===t)return!1;for(let e=0;e<this[Lt].length;e++){const r=this[Lt][e];if(t?.path&&r.path===t.path)return this[Lt].splice(e,1),!0;if(t?.name&&r.name===t.name)return this[Lt].splice(e,1),!0}return!1}hasRoute(e){const t=this[he](e);return null!==t&&-1!==this[Lt].findIndex((e=>{if(t?.path&&e.path===t.path||t?.name&&e.name===t.name)return!0}))}setNotFoundPath(e){this[Ht]=e}setNotFoundRoute(e){const t=this[wt](e);this[Dt]=t[0]}getRoutes(){return[...this[Lt]]}[wt](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 ge;return r.path=t,r.redirect=e.redirect,[r]}let n=[];for(let t in r){let s=r[t];0===t.length&&(t=ae);let i=new ye(t,s,e.props,e.meta);n.push(i)}let s=!1,i=[];if(e.children)for(let r of e.children){let e=this[wt](r);for(let r of e){let e=new ge;e.name=r.name,r.path&&r.path.length>0?e.path="/"!==t?`${t}${r.path}`:r.path:(s=!0,e.path=t);let o=new me;o.models=[...n],e.layers=[o,...r.layers],i.push(e)}}if(!s){let r=new me;r.models=n;let s=new ge;s.name=e.name,s.path=t,s.layers=[r],i.splice(0,0,s)}return i}[xt](e){let t=e.route;try{for(let r of this[Lt]){if(t.path&&r.path){let n=r.match;n||(n=r.match=ne(r.path));let s=n(t.path);if(!s)continue;if(r.redirect){let n=new de;C(!0,n,t),n.path=r.redirect;let s={route:n,find:void 0};return!!this[xt](s)&&(e.route=s.route,e.find=s.find,!0)}if(t.params=t.params??{},C(!0,t.params,s.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()),s=decodeURIComponent(t[1].trim());r[n]=s}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=re(r.path);return t.path=n(t.params),e.find=r,!0}}}catch(e){"function"==typeof t.error&&t.error(e.message)}return!1}[he](e){let t=null;if(Array.isArray(e))if(t=new de,"object"==typeof e[0])t=de.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=de.from(e):"string"==typeof e&&(t=new de,"/"==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??ae,t.opsType=t.opsType??this.options.defaultOperationType??be.Push}return t}push(...e){let t=this[he](e);return t?(t.opsType=t.opsType||be.Push,this.to(t)):(this[Kt]("resolve route fail",t),this)}put(...e){let t=this[he](e);return t?(t.opsType=be.Put,this.to(t)):(this[Kt]("resolve route fail",t),this)}replace(...e){let t=this[he](e);return t?(t.opsType=be.Replace,this.to(t)):(this[Kt]("resolve route fail",t),this)}append(...e){let t=this[he](e);return t?(t.opsType=be.Append,this.to(t)):(this[Kt]("resolve route fail",t),this)}remove(e){return new Promise((t=>{this[Jt].post((r=>{try{if(0===this[Ft].length)return r.resolve(),void t(!1);let n,s=-1,i=[];if(e){if(n=e.root?e.root:this[Ft][0].root??ae,e.all)for(let e=this[Ft].length-1;e>0;e--){let t=this[Ft][e];t.opsType===be.Append&&t.root===n&&(i.splice(0,0,t),s=e-1)}else if(e.until)for(let t=this[Ft].length-1;t>0;t--){let r=this[Ft][t];if(r.opsType===be.Append&&r.root===n){if("/"===e.until.charAt(0)&&e.until===r.path){s=t;break}if(e.until===r.name){s=t;break}i.splice(0,0,r)}}}else{n=ae;let e=this[Rt](this[Bt]);e&&(n=e.name);for(let e=this[Ft].length-1;e>0;e--){let t=this[Ft][e];if(t.opsType===be.Append&&t.root===n){i.push(t),s=e-1;break}}}if(0===i.length){let e="can not find route";return r.resolve(e),void t(!1)}let o=0;if(this[Ft].forEach((e=>{e.opsType!==be.Put&&o++})),this[or](i)){let e=0;this[Ft].forEach((t=>{t.opsType!==be.Put&&e++}));let n=o-e;this[Tt]=!0,this.back(n),r.resolve(),t(!0)}}catch(e){this[Kt](e),r.resolve(),t(!1)}}))}))}open(...e){let t=this[he](e);return t?(t.opsType=be.Open,this.to(t)):(this[Kt]("resolve route fail",t),this)}close(e){return this[Jt].post((t=>{try{let r=this[he](e);if(!r)return void t.reject("resolve route fail");let n=[];for(let e=0;e<this[Ft].length;e++){let t=this[Ft][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[or](n)){let e=de.clone(r,!0);const t=new ut(e,this[Nt]());this[Ut]?.replace(t),this[Ot]()}t.resolve()}catch(e){this[Kt](e),t.resolve()}})),this}to(...e){let t=this[he](e);if(!t)return this[Kt]("resolve route fail",t),this;let r=this[hr].acquire(t);return null==r?(this[Kt]("route forbid",t),this):(this[Jt].post((e=>{try{let n=this[tr](t);this[rr](n),!n.session?.routeModel&&this[ur]&&this[lr](n),this[ir](n),this[nr](n),n.wait(((n,s)=>{let i=n.session.to;try{let e=de.clone(i,!0);const t=new ut(e,this[Nt]());i.opsType===be.Replace?this[Ut]?.replace(t):this[Ut]?.push(t)}catch(e){}if(this[hr].release(r),this[Ot](i),"function"==typeof t.success)try{Reflect.apply(t.success,{},[])}catch(e){}!1===this[Yt]&&this[Zt](!0),e.resolve()}),((n,s)=>{this[hr].release(r),this[Kt](s,t),!1===this[Yt]&&this[Zt](!1),e.resolve()}))}catch(n){this[hr].release(r),this[Kt](n,t),e.resolve()}})),this)}back(e=1){this[Ut]?.go(-e)}[er](e){return(t,r)=>{if("boolean"==typeof t)t?e.resolve():e.reject(r);else if(t){let r=this[he](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()}}[tr](e){let t=this[Ft].length>0?this[Ft][0]:void 0,r=new pe(e,t),n={route:e,find:null};return this[xt](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 nt(r)}[rr](e){for(let t of this[Wt])e.post((e=>{let r=this[er](e);Reflect.apply(t,{},[e.session.to,e.session.from,r,e.session])}))}[nr](e){e.post((e=>{for(let t of this[Vt])try{Reflect.apply(t,{},[e.session.to,e.session.from,e.session])}catch(e){}e.resolve()}))}[sr](e,t){for(let r of this[zt])try{Reflect.apply(r,{},[e,t])}catch(e){}"function"==typeof e.destroy&&Reflect.apply(e.destroy,e,[])}[lr](e){let t=e.session,r=Reflect.apply(this[ur],this,[t?.to]);if(null==r)return;Array.isArray(r)||(r=[r]);let n=[];for(let e of r)this[ar].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=A(e)?e.default:e,Array.isArray(t)&&this.addRoutes(t)}for(let e of n)this[ar].set(e,!0);e.resolve()}else e.reject()}))}))}[ir](e){e.post((e=>{let t=e.session.to,r=e.session.routeModel;if(null==r){let n={route:t,find:null};if(this[xt](n))r=n.find,e.session.routeModel=r;else{if(!this[Dt])return void e.reject(`not find route model, path:${t.path??t.name}`);r=this[Dt]}}let n=pe.from(e.session);this[Et](t,r,n).then((t=>{this[Bt],e.resolve()}),(t=>{e.reject(t)}))}))}[or](e){if(0==e.length)return!0;let t=this[Bt],r=[];for(let n of e){let e=this[St](t,n);null!=e&&r.push({...e,route:n})}if(0==r.length){let e="can not find view index";return this[Kt](e),!1}for(let e of r.reverse())this[At](t,{x:e.x,y:e.y},[e.route.index??0],!0);return!0}[St](e,t){let r,n=t.root??ae;for(let t=0;t<e.layers.length;t++){let s=e.layers[t];for(let e=s.views.length-1;e>=0;e--){let i=s.views[e];if(i[xe]&&i[Ae]===n)return r={x:e,y:t},r}}return null}[Rt](e){return e.layers.length>0&&e.layers[0].views.length>0?e.layers[0].views[0]:null}[At](e,t,r=null,n=!0){if(t.y>=e.layers.length||t.x>=e.layers[t.y].views.length)return;let s=e.layers[t.y].views[t.x],i=!1,o=[],l=!1,a=s.slots.value;for(let e=a.length-1;e>=0;e--){let n=a[e];(null==r||-1!=r.indexOf(n.index))&&(n.route&&s[xe]&&(this[Mt](n.route),!0===n.active&&n.route.opsType==be.Append&&(l=!0)),o.push(new Pe(s,n.index,t.y)),a.splice(e,1))}if(0==a.length)n?s.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)}s.slots.value=[...a]}0==e.layers[t.y].views.length&&(i=!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;(i||o.length>0)&&n>=0;n--){let s=t[n];if(s[Re]&&(i||Pe.include(o,s[Re]))){let t=s.slots.value;for(let e=t.length-1;e>=0;e--){let n=t[e];n.route&&s[xe]&&this[Mt](n.route),r.push(new Pe(s,n.index,u)),t.splice(e,1)}e.layers[u].views.splice(n,1)}}o=r,0==e.layers[u].views.length&&(i=!0)}}restore(e){if(e&&0!=this[Lt].length)return new Promise(((t,r)=>{for(let t=0;t<e.length;t++){let r=e[t];this[Jt].post((e=>{let t=this[tr](r);this[rr](t),!t.session?.routeModel&&this[ur]&&this[lr](t),this[ir](t),this[nr](t),t.wait(((t,r)=>{e.resolve()}),((t,r)=>{this[Kt](r),e.resolve()}))}))}this[Jt].post((e=>{e.resolve(),t()}))}));{let e=this[Bt];if(e.layers.length>0){let t=e.layers[0].views;t.length>0&&(t[0].slots.value=[])}return this[Ft]=[],this[Ot](),Promise.resolve()}}[Et](e,t,r){let n=e.updateType??we.Part;return this[Ct](t).then((()=>{this[Pt](t,e,r,n)}))}[Ct](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()}[Pt](e,t,r,n){if(1!==e.layers[0].models.length)return Promise.reject("illegal route structure(multil root node)");const s=e.layers[0].models[0];let i,o=this[Bt],l=function(e){return 0==e.layers.length||0==e.layers[0].views.length}(o),a=t.root??ae;!l&&n==we.Part&&(i=this[St](o,t));let u,h=0;if(null==i||null==i)if(l||n===we.All){if(0==o.layers.length&&(o.layers[0]=new je),0==o.layers[0].views.length){let e=t.root??ae;u=new Ce(e,!0,null),o.layers[0].views=[u]}else u=o.layers[0].views[0];i={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 s of t.views){if(s[xe]&&s.name===e.rootName){r=new Pe(s,e.rootIndex??0,n-1);break}if(s[Se]&&s[Se].view.name===e.rootName&&s[Se].index===e.rootIndex){r=s[Se];break}}}if(!r)return Promise.reject("can not insert view(not find root node ref)");u=new Ce(a,!0,r),o.layers[n].views.push(u),i={x:o.layers[n].views.length-1,y:n}}else u=o.layers[i.y].views[i.x];if(h=i.y,u[xe]=!0,t.opsType===be.Append){t.index=j.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 Ee(t,s,t.index,!0);u.slots.value=[...r,n];let i=h+1,l=1,a=new Pe(u,t.index,h);this[jt](o,i,e,l,a)}else if(t.opsType===be.Open){let r=u.slots.value,n=!1;for(let e of r){if(null!==e.route&&de.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[Mt](e.route)}else e.active=!1;e.route&&(e.route.active=e.active)}if(!n){t.index=j.get(),t.active=!0;let n=new Ee(t,s,t.index,!0);r.push(n);let i=h+1,l=1,a=new Pe(u,t.index,h);this[jt](o,i,e,l,a)}u.slots.value=[...r]}else{let r=u.slots.value;if(0==r.length){t.index=j.get(),u.slots.value=[new Ee(t,s,t.index)];let r=h+1,n=1,i=new Pe(u,t.index,h);this[jt](o,r,e,n,i)}else{let n=r[0];if(n.model!==s){this[At](o,i,null,!0),t.index=j.get(),u.slots.value=[new Ee(t,s,t.index)];let r=h+1,n=1,l=new Pe(u,t.index,h);this[jt](o,r,e,n,l)}else{null!==n.route&&this[Mt](n.route);let s=[];for(let e=1;e<r.length;e++)s.push(r[e].index);s.length>0&&this[At](o,i,s,!0),t.index=n.index,n.route=t;let l=[new Pe(u,t.index,h)],a=h+1,c=1,f=new Pe(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[Re]&&Pe.include(l,r[Re])&&t.unshift(e)}let r=[];for(let n of t){let t,s=o.layers[a].views[n],i=e.layers[c].models;for(let e=0;e<i.length;e++)if(s.name===i[e].name){t=i[e];break}if(t){let i=s.slots.value;if(0==i.length){let r=0;s.slots.value=[new Ee(null,t,r)];let n=a+1,i=c+1;this[jt](o,n,e,i,f)}else{let l=i[0];if(l.model!==t){this[At](o,{x:n,y:a},null,!0),s.slots.value=[new Ee(null,t,0)];let r=a+1,i=c+1;this[jt](o,r,e,i,f)}else{s[xe]&&null!==l.route&&this[Mt](l.route);let e=[];for(let t=1;t<i.length;t++)e.push(i[t].index);e.length>0&&this[At](o,{x:n,y:a},e,!0),r.push(new Pe(s,l.index,a))}}s[xe]=!1}else this[At](o,{x:n,y:a},null,!1)}l=r}this[jt](o,a,e,c,f)}}}if(u&&u[Se]){let e=u[Se];e&&(t.slot=new fe(a,h,e?.view.name,e?.index??0))}r.to=void 0,r.routeModel=void 0,t.session=r,this[_t](t)}[jt](e,t,r,n,s){let i=n,o=t;for(;o<e.layers.length&&i<r.layers.length;o++,i++){let t=e.layers[o].views;for(let e of r.layers[i].models){let r=new Ce(e.name,!1,s),n=new Ee(null,e);r.slots.value=[n],t.push(r)}}for(;i<r.layers.length;i++){let t=new je;t.views=[];for(let e of r.layers[i].models){let r=new Ce(e.name,!1,s),n=new Ee(null,e);r.slots.value=[n],t.views.push(r)}e.layers.push(t)}}[ue](e,t,r,n,s,i){if(t<0||t>this[Bt].layers.length)return null;if(t<this[Bt].layers.length){let o=this[Bt].layers[t],l=null;for(let a of o.views){let o=!1;if(null!==r?(o=a.name===e&&a[Se]?.view===r,o&&-1!==n&&(o=a[Se]?.index===n)):o=a.name===e,o){null!==s&&(a[Re]={view:s,index:i,level:t-1}),l=a;break}}if(null!==l)return l}let o=null,l=null;null!==s&&(o=s[xe]?{view:s,index:i,level:t-1}:s[Se],l={view:s,index:i,level:t-1});let a=new Ce(e,!0,o);if(a[Re]=l,t==this[Bt].layers.length){let e=new je;e.views=[a],this[Bt].layers.push(e)}else this[Bt].layers[t].views.push(a);return a}}var fr=(e=>(e[e.limitless=0]="limitless",e[e.once=1]="once",e))(fr||{});const pr=Symbol("registerKey");class dr{policy;callback;constructor(e,t){this.callback=e,this.policy=t}}class yr{[pr]=new Map;constructor(){}on(e,t,r=!1){let n=this[pr].get(e);n||(n=new Array,this[pr].set(e,n));let s=new dr(t,!0===r?1:0);return n.push(s),this}off(e,t){if(!t)return this[pr].delete(e),this;let r=this[pr].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,s=new Array(n),i=[].splice.call(e,0,n);for(let e=0;e<i.length;e++)this.once(i[e],(t=>{s[e]=t,n-=1,0==n&&Reflect.apply(r,{},s)}));return this}emit(e,...t){let r=this[pr].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{q((()=>{Reflect.apply(n.callback,{},t)}))}catch(e){}}return this}trigger(e,...t){return Reflect.apply(this.emit,this,[e,...t])}}const mr=Symbol("registerKey");class gr{[mr]=new Map;constructor(){}set(e,t){this[mr].set(e,t)}get(e){return this[mr].get(e)}has(e){return this[mr].has(e)}delete(e){return this[mr].delete(e)}}const vr=Symbol("lc");function br(e,t=!1){let r=e,n=r[vr];if(!n){if(!t)return null;n=new gr,r[vr]=n}return n}function wr(e,t){let r=e;for(;null!==r;){let e=r[vr];if(e&&e.has(t))return e.get(t);r=r.$parent}return null}function xr(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 br(t.component.proxy,!1)}return null}const Sr=Symbol("hooksKey");function Rr(e,t){let r=e.get(Sr);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 Ar=(e=>(e.DEACTIVATED="da",e.ACTIVATED="a",e))(Ar||{});class Er{type;hook;target;constructor(e,t,r){this.target=r,this.hook=t,this.type=e}}function Cr(e){return(t,r)=>{let n;if(r)n=r;else{let e=s();if(null==e||null==e.proxy)return;n=e.proxy}let o=wr(n,Sr);null!=o&&(i((()=>{!function(e,t,r,n){let s=-1;for(let i=0;i<e.length;i++){let o=e[i];if(o.type===t&&o.hook===r&&o.target===n){s=i;break}}-1!=s&&e.splice(s,1)}(o,e,t,n)})),function(e,t,r,n){let s=new Er(t,r,n);e.push(s)}(o,e,t,n))}}let Pr=Cr("a"),jr=Cr("da");const Tr=Symbol("routeKey");function qr(e,t){let r=e.get(Tr);if(r){let e={path:"",name:"",params:{},index:-1,session:{}};Object.assign(e,t),Object.assign(r,e)}else r=function(){let e=new de;return e.path="",e.name="",e.params={},e.index=-1,o(e)}(),Object.assign(r,t),e.set(Tr,r)}function Or(e){return wr(e,Tr)??null}const $r=Symbol("rk"),Fr=Symbol("vd"),kr=Symbol("rv"),_r=Symbol("rvi"),Mr=Symbol("pv"),Nr=Symbol("pvi");function Kr(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 Ir(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 Lr(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 Dr(e,t){e.classList.contains(t)||e.classList.add(t)}function Hr(e,t){e.classList.remove(t)}const Br=$e&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout;function Ur(e){Br(e)}function Wr(e,t,...r){!y(t)||(null==e&&(e={}),Reflect.apply(t,e,r))}function Vr(e,t,r,n=-1,s,i,o,l){if(y(i)){if(void 0!==s&&s>=0)return void setTimeout((()=>{Reflect.apply(i,e,[t,r,n]),y(l)&&Reflect.apply(l,e,[])}),s);let o=["animationend","transitionend"],a=s=>{o.forEach((e=>{Me(t,e,a)})),Reflect.apply(i,e,[t,r,n]),l&&Reflect.apply(l,e,[])};o.forEach((e=>{_e(t,e,a)}))}if(y(o)){let s="animationcancel",i=l=>{Reflect.apply(o,e,[t,r,n]),Me(t,s,i)};_e(t,s,i)}}function zr(e){return!(!$e||null===e)&&(e.opsType===be.Append||e.opsType===be.Open)}function Jr(e,t,r,n,s={},i,o=-1){if(t&&(r||zr(i))){let e=Kr(s,r);e&&Dr(n,e);let t=Ir(s,r);t&&Dr(n,t)}else{let t=function(e,t=!1){let r=null;return r=t?e.onBeforeShow??e.onBeforeEnter:e.onBeforeEnter,r}(s,r);Wr(e,t,[n,i,o])}}function Gr(e,t,r,n,s={},i,o,l,a){if(zr(o)||r)if(t){let t=Kr(s,r),u=Ir(s,r),h=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);Ur(h?()=>{Vr(e,n,o,l,i,(()=>{u&&Hr(n,u),h&&Hr(n,h),y(a)&&a(e,a,[n])})),t&&Hr(n,t),h&&Dr(n,h)}:()=>{t&&Hr(n,t),u&&Hr(n,u),y(a)&&a(e,a,[n])})}else{let t=function(e,t=!1){let r=null;return r=t?e.onShow??e.onEnter:e.onEnter,r}(s,r),i=function(e,t=!1){let r=null;return r=t?e.onAfterShow??e.onAfterEnter:e.onAfterEnter,r}(s,r),u=function(e,t=!1){let r=null;return r=t?e.onShowCancelled??e.onEnterCancelled:e.onEnterCancelled,r}(s,r),h=t=>{!t&&y(i)?Wr(e,i,[n,o,l]):y(u)&&Wr(e,u,[n,o,l]),y(a)&&a(e,a,[n])};y(t)?Wr(e,t,[n,h,o,l]):h()}else y(a)&&a(e,a,[n])}function Xr(e,t,r,n,s={},i,o,l,a,u){if(zr(l)||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),h=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),c=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&&Dr(n,t),h&&Dr(n,h),Ur(c?()=>{Vr(e,n,l,a,i,(()=>{h&&Hr(n,h),c&&Hr(n,c),y(u)&&Wr(e,u,[n]),!r&&y(o)&&o()})),t&&Hr(n,t),c&&Dr(n,c)}:()=>{t&&Hr(n,t),h&&Hr(n,h),y(u)&&Wr(e,u,[n]),!r&&y(o)&&o()})}else{let t=function(e,t=!1){let r=null;return r=t?e.onHide??e.onLeave:e.onLeave,r}(s,r),i=function(e,t=!1){let r=null;return r=t?e.onAfterHide??e.onAfterLeave:e.onAfterLeave,r}(s,r),h=function(e,t=!1){let r=null;return r=t?e.onHideCancelled??e.onLeaveCancelled:e.onLeaveCancelled,r}(s,r),c=t=>{!t&&y(i)?(Wr(e,i,[n,l,a]),y(u)&&Wr(e,u,[n]),!r&&y(o)&&o()):y(h)&&(Wr(e,h,[n,l,a]),y(u)&&Wr(e,u,[n]))};y(t)?Wr(e,t,[n,c,l,a]):c()}else!r&&y(o)&&o()}function Yr(e,t={},r,n=-1){let s=O(t.css),i=t.mode??"default",o=Lr(t);return{mode:i,persisted:!1,beforeEnter:i=>{Jr(e,s,!1,i,t,r,n)},enter:i=>{Gr(e,s,!1,i,t,o.enter,r,n)},leave:(i,l)=>{Xr(e,s,!1,i,t,o.leave,l,r,n)},clone:s=>Yr(e,t,r,n)}}function Qr(e){return e.el}function Zr(e,t,r={},n,s,i,o){if(i){let i=Qr(t);if(null==i)return;let l=O(r.css),a=Lr(r);Jr(e,l,!0,i,r,n,s),Gr(e,l,!0,i,r,a.show,n,s,(t=>{y(o)&&Wr(e,o,[t])}))}else y(o)&&Wr(e,o,[])}function en(e,t,r={},n,s,i,o){if(i){let i=Qr(t);if(null==i)return;let l=O(r.css),a=Lr(r);Xr(e,l,!0,i,r,a.hide,null,n,s,(t=>{y(o)&&Wr(e,o,[t])}))}else y(o)&&Wr(e,o,[])}function tn(e,t,r){return"function"==typeof e?Reflect.apply(e,{},[t,r]):e}function rn(e,t){if(!e)return null;const r=e(t);return 1===r.length?r[0]:r}class nn{node;state;constructor(e,t){this.node=e,this.state=t}}const sn=l({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,t){const r=s();if(null===r||null===r.proxy)return;const n=!0===e.multi,o=a($r,null),l=a(Fr,0),c=a(kr,null),f=a(_r,-1);let p=!1,d=null;const y=e.modelSlot;if(y){u(Fr,l+1),u(_r,y.index),u(Nr,y.index);const e=y.route;if(!e)return;const t=br(r.proxy,!0);(function(e){let t=e.get(Sr);t||(t=[],e.set(Sr,t))})(t),qr(t,e)}else{if(null==o)return;const t=e.name,s=a(Mr,null),i=a(Nr,0);if(d=o[ue](t,l,c,f,s,i),null===d)return;if(u(Mr,d),!0===d[xe]&&u(kr,d),n)p=O(e.transition??!0);else{p=O(e.transition??!1),u(_r,-1),u(Fr,l+1),u(Nr,-1);const t=d.slots.value;if(t.length>0){const e=t[0].route;if(e){qr(br(r.proxy,!0),e)}}else{const e=br(r.proxy,!0);d.compensation=()=>{const t=d.slots.value;if(t.length>0){const r=t[0].route;return r&&qr(e,r),!0}return!1}}}}const m={value:new Map};return i((()=>{m.value&&m.value.clear()})),()=>{if(n){const n=new Map,s=[],i=d?.slots.value,o=[];for(let l=0;l<i.length;l++){const a=i[l],u=`${e.name}-${a.index}`,c={modelSlot:a};let f;f=t.slots.default?h(sn,c,{default:t.slots.default}):h(sn,c);const d={},y=tn(e.viewClass,a.route,l);"string"==typeof y&&y.length>0&&(d[y]=!0);const g=tn(e.viewActiveClass,a.route,l),v=tn(e.viewDeactiveClass,a.route,l),b=m.value.get(u);if("string"==typeof g&&g.length>0&&(d[g]=a.active),"string"==typeof v&&v.length>0&&(d[v]=!a.active),b&&a.active!==b.state){const t=b.node;a.active?o.unshift((()=>{Zr(r,t,e,a.route,l,p,(()=>{let e=xr(t);null!=e&&Rr(e,Ar.ACTIVATED)}))})):o.push((()=>{en(r,t,e,a.route,l,p,(()=>{let e=xr(t);null!=e&&Rr(e,Ar.DEACTIVATED)}))}))}const w={class:d,key:u},x=tn(e.viewTagProps,a.route,l);null!==x&&"object"==typeof x&&C(!0,w,x),a.route?.viewTagAttrs&&"object"==typeof a.route?.viewTagAttrs&&C(!0,w,a.route.viewTagAttrs);const S=tn(e.viewTag,a.route,l),R=h(S,w,{default:()=>[f]});if(n.set(u,new nn(R,a.active)),p){const t=Yr(r,e,a.route,l);R.transition=t}s.push(R)}m.value=n,function(e,t={}){Ur((()=>{for(let r=0;r<e.length;r++)Reflect.apply(e[r],t,[])}))}(o,r);const l=tn(e.tag,null,-1),a={};return Object.assign(a,t.attrs),h(l,a,{default:()=>s})}if(null!=y){const e=y.model,r={};e.props&&("object"==typeof e.props?C(!1,r,e.props):!0===e.props&&"object"==typeof y.route?.params&&C(!1,r,y.route?.params));const n=h(e.component,r);return rn(t.slots.default,{Component:n,route:y.route})??n}{const n=d.slots.value;if(n.length>0){const s=n[0],i=s.model,o={};i.props&&("object"==typeof i.props?C(!1,o,i.props):!0===i.props&&"object"==typeof s.route?.params&&C(!1,o,s.route?.params));const l=h(i.component,o);if(p){const t=Yr(r,e,s.route,-1);l.transition=t}return rn(t.slots.default,{Component:l,route:s.route})??l}return rn(t.slots.fallback,{})}}}});function on(e,t){return"function"==typeof e?Reflect.apply(e,{},[t]):e}let ln=l({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,t){const r=a($r,null);return()=>{let n=on(e.to,null),s=on(e.tag,n);if(null==s)return;let i=null,o=null;null!==r&&(i=r[he](n),e.root&&(i.root=e.root),o=r.current);let l={},a=on(e.activeClass,i);if("string"==typeof a&&a.length>0&&(l[a]=function(e,t){return null!=e&&null!=t&&!!(e.path&&t.path&&t.path.startsWith(e.path)||e.name&&e.name==t.name)}(i,o)),!0===on(e.exact,i)){let t=on(e.exactActiveClass,i);"string"==typeof t&&t.length>0&&(l[t]=function(e,t){return null!=e&&null!=t&&!!(e===t||e.path&&e.path===t.path||e.name&&e.name===t.name)}(i,o))}let u={class:l};("a"===s||"A"===s)&&(u.href=i?.path??i?.name??"#"),C(!0,u,t.attrs);let c=on(e.event,i);if("string"==typeof c){const e=e=>{null!=r&&null!=i&&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)&&r.to(i)};u[c]=e}return h(s,u,t.slots)}}}),an={get each(){return I},get type(){return k},get isFunction(){return y},get isArray(){return c},get isArrayLike(){return M},get makeArray(){return K},get merge(){return N},get isWindow(){return _},get isPlainObject(){return S},get isEqual(){return L}};const un=Symbol("fk"),hn=Symbol("fbk"),cn=Symbol("fepk");function fn(e={}){const t=new cr(e),r=new ee,n=new yr,s={...an,get router(){return t},get bus(){return r},get Bus(){return ee},get eventproxy(){return n},get EventProxy(){return yr},get EventChain(){return nt},get require(){return t.require},get request(){return Le},get extend(){return C},get clone(){return P},install(e){e.provide($r,t),e.provide(un,s),e.provide(hn,r),e.provide(cn,n),e.component("fox-router-view",sn),e.component("fox-router-link",ln),Reflect.defineProperty(e.config.globalProperties,"$fox",{get:()=>s}),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 Or(this)}}}),t.init()}};return s}function pn(e){return e?e.$router:a($r)}function dn(e){return e||(e=s()?.proxy??void 0),e?Or(e):null}function yn(e){return e?e.$fox:a(un)}function mn(e){return e?e.$bus:a(hn)}function gn(e){return e?e.$eventProxy:a(cn)}function vn(e){const t=pn(),r=(t,r,n)=>{try{Reflect.apply(e,{},[t,r])}catch(e){}n()};t.beforeEach(r),i((()=>{t.removeBeforeEach(r)}))}function bn(e){const t=pn(),r=(t,r,n)=>{try{Reflect.apply(e,{},[t,r])}catch(e){}n()};t.afterEach(r),i((()=>{t.removeAfterEach(r)}))}export{ee as Bus,nt as EventChain,yr as EventProxy,de as Route,cr as Router,De as cancel,P as clone,fn as createFox,bt as createMemoryHistory,gt as createWebHashHistory,mt as createWebHistory,C as extend,hn as foxBusKey,cn as foxEventProxyKey,un as foxKey,c as isArray,d as isDate,A as isESModule,L as isEqual,y as isFunction,f as isMap,v as isObject,S as isPlainObject,b as isPromise,p as isSet,m as isString,g as isSymbol,bn as onAfterRouteUpdate,vn as onBeforeRouteUpdate,Pr as onFoxActivated,jr as onFoxDeactivated,Le as request,O as toBoolean,$ as toNumber,x as toTypeString,mn as useBus,gn as useEventProxy,yn as useFox,dn as useRoute,pn as useRouter};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fox-js/fox",
3
- "version": "3.0.1-2",
3
+ "version": "3.0.1-3",
4
4
  "description": "Fox Router and commons Utils",
5
5
  "author": "jiangcheng",
6
6
  "keywords": [
@@ -9,12 +9,20 @@
9
9
  "vue3",
10
10
  "tyepscript"
11
11
  ],
12
- "main": "main.js",
13
- "module": "main.js",
12
+ "main": "libs/index.amd.js",
13
+ "module": "libs/index.es.js",
14
14
  "exports": {
15
15
  ".": {
16
- "import": "./main.js"
17
- }
16
+ "import": {
17
+ "node": "./libs/index.cjs.js",
18
+ "default": "./libs/index.esm.js"
19
+ },
20
+ "require": {
21
+ "node": "./libs/index.cjs.js",
22
+ "default": "./libs/index.amd.js"
23
+ }
24
+ },
25
+ "./index.css": "./libs/index.css"
18
26
  },
19
27
  "style": "libs/index.css",
20
28
  "typings": "libs/index.d.ts",
package/libs/index.js DELETED
@@ -1 +0,0 @@
1
- import{ref as e,effectScope as t,watch as r,shallowRef as n,getCurrentInstance as o,onUnmounted as s,shallowReactive as i,defineComponent as l,inject as a,provide as u,h as c}from"vue";const h=Array.isArray,f=e=>"[object Map]"===x(e),p=e=>"[object Set]"===x(e),d=e=>e instanceof Date,y=e=>"function"==typeof e,m=e=>"string"==typeof e,g=e=>"symbol"==typeof e,v=e=>null!==e&&"object"==typeof e,b=e=>v(e)&&y(e.then)&&y(e.catch),w=Object.prototype.toString,x=e=>w.call(e),S=e=>"[object Object]"===x(e),R="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function A(e){return e.__esModule||R&&"Module"===e[Symbol.toStringTag]}const C="undefined"!=typeof Promise&&-1!==Promise.toString().indexOf("[native code]");function E(...e){let t=void 0!==e[0]&&null!==e[0]?e[0]:{},r=1,n=e.length,o=!1;for("boolean"==typeof t&&(o=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===o&&s&&"object"==typeof s){let n;n=Array.isArray(s)?r&&Array.isArray(r)?r:[]:r&&"object"==typeof r?r:{},t[e]=E(o,n,s)}else void 0!==s&&(t[e]=s)}}return t}function j(e,t,r=!1){if(r){if("object"!=typeof t)return{};"object"!=typeof e&&(e={});for(let n in t){let o=e[n],s=t[n];if(o!==s)if("object"==typeof s){if(!Array.isArray(s)&&!S(s))continue;o=j(o,s,r),e[n]=o}else{if("function"==typeof s)continue;e[n]=s}}const n=Object.getOwnPropertySymbols(t);for(let o of n){let n=e[o],s=t[o];if(n!==s)if("object"==typeof s){if(!Array.isArray(s)&&!S(s))continue;n=j(n,s,r),e[o]=n}else{if("function"==typeof s)continue;e[o]=s}}}else E(!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 T=C?Promise.resolve():null;function O(e,...t){null!==T?t&&t.length>0?T.then((()=>{e(t)})):T.then(e):t&&t.length>0?setTimeout((()=>{e(t)})):setTimeout(e)}function $(e){return null!=e&&("boolean"==typeof e?e:"string"==typeof e?"true"===e.toLocaleLowerCase():Boolean(e))}function q(e){return"number"==typeof e?e:Number(e)}const F={"[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 k(e){let t=Object.prototype.toString.call(e);return null==e?String(e):F[t]||"object"}function _(e){return e&&"object"==typeof e&&"setInterval"in e}function M(e){let t=!!e&&"length"in e&&e.length,r=k(e);return"function"!==r&&!_(e)&&("array"===r||0===t||"number"==typeof t&&t>0&&t-1 in e)}function N(e,t){let r=+t.length,n=0,o=e.length;for(;n<r;n++)e[o++]=t[n];return e.length=o,e}function K(e,t=[]){let r=t;return null!=e&&(M(Object(e))?N(r,"string"==typeof e?[e]:e):r.push(e)),r}function L(e,t,r){if(M(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 I(e,t){if(e==t)return!0;if(void 0===e||void 0===t)return!1;let r=k(e);if(r!==k(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 o=r[n];if(!I(e[o],t[o]))return!1}return!0}if("array"===r){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){if(!I(e[r],t[r]))return!1}return!0}return!1}const D=Symbol("idKey"),H=Symbol("valueKey"),U=Symbol("childrenKey"),B=Symbol("growKey");class W{[B]=!0;[D];[H]=e();[U]=new Map;constructor(e){this[D]=e}}class V{get(e,t){if("value"==t)return e[H].value;if("grow"===t)return e[B];let r=e[U].get(t);return r?z(r):e[B]?(r=J(t),r[B]=e[B],e[U].set(t,r),z(r)):void 0}set(e,t,r){return"value"==t?(e[H].value=r,!0):"grow"===t?(e[B]=$(r),!0):null==r?(e[U].delete(t),!0):(console.error(`illegal property:${t}`),!1)}deleteProperty(e,t){return"value"===t||"grow"==t?(console.error(`can not delete property:${String(t)}`),!1):(e[U].delete(t),!0)}}function J(e){let t=new W(e);return Reflect.set(t,"__proxy__",new Proxy(t,new V)),t}function z(e){return Reflect.get(e,"__proxy__")}class G extends W{constructor(){super("__root__")}put(...e){let t=e.length;if(t<2)return console.error("参数至少包括一个(key, value)"),!1;let r=this;for(let n=0;n<t-1;n++){let t,o=e[n];r[U].has(o)?t=r[U].get(o):(t=J(o),r[U].set(o,t)),r=t}return r[H].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[U].has(t))return;r=r[U].get(t)}return r[H].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[U].has(t))return!1;r=r[U].get(t)}let n=e[t-1];return!!r[U].has(n)&&(r[U].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[U].has(t))return!1;r=r[U].get(t)}let n=e[t-1];return r[U].has(n)}clear(){this[U].clear()}}const X=["put","get","contains","remove","clear"];function Y(e){return X.includes(e)}class Q{get(e,t){if("value"==t)return e[H].value;if("grow"===t)return e[B];if(t===U)return e[U];if("string"==typeof t&&Y(t))return e[t];let r=String(t),n=e[U].get(r);return n?z(n):e[B]?(n=J(r),n[B]=e[B],e[U].set(r,n),z(n)):void 0}set(e,t,r){return"value"==t?(e[H].value=r,!0):"grow"===t?(e[B]=$(r),!0):!Y(t)&&(null==r?(e[U].delete(t),!0):(console.error(`illegal property:${t}`),!1))}deleteProperty(e,t){return"value"===t||"grow"==t?(console.error(`can not delete property:${String(t)}`),!1):(e[U].delete(t),!0)}}let Z=new Proxy(G,{construct:(e,...t)=>z(function(){let e=new G,t=new Q,r=new Proxy(e,t),n={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,[])};return Object.assign(n,r),Reflect.set(e,"__proxy__",r),e}())});function ee(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 o=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==--o){l++;break}}else if("("===e[l]&&(o++,"?"!==e[l+1]))throw new TypeError("Capturing groups are not allowed at ".concat(l));s+=e[l++]}else s+=e[l++]+e[l++];if(o)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 i="",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;i+=e[l++]}if(!i)throw new TypeError("Missing parameter name at ".concat(r));t.push({type:"NAME",index:r,value:i}),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,o=void 0===n?"./":n,s="[^".concat(ne(t.delimiter||"/#?"),"]+?"),i=[],l=0,a=0,u="",c=function(e){if(a<r.length&&r[a].type===e)return r[a++].value},h=function(e){var t=c(e);if(void 0!==t)return t;var n=r[a],o=n.type,s=n.index;throw new TypeError("Unexpected ".concat(o," at ").concat(s,", expected ").concat(e))},f=function(){for(var e,t="";e=c("CHAR")||c("ESCAPED_CHAR");)t+=e;return t};a<r.length;){var p=c("CHAR"),d=c("NAME"),y=c("PATTERN");if(d||y){var m=p||"";-1===o.indexOf(m)&&(u+=m,m=""),u&&(i.push(u),u=""),i.push({name:d||l++,prefix:m,suffix:"",pattern:y||s,modifier:c("MODIFIER")||""})}else{var g=p||c("ESCAPED_CHAR");if(g)u+=g;else if(u&&(i.push(u),u=""),c("OPEN")){m=f();var v=c("NAME")||"",b=c("PATTERN")||"",w=f();h("CLOSE"),i.push({name:v||(b?l++:""),pattern:v&&!b?s:b,prefix:m,suffix:w,modifier:c("MODIFIER")||""})}else h("END")}}return i}function te(e,t){return function(e,t){void 0===t&&(t={});var r=oe(t),n=t.encode,o=void 0===n?function(e){return e}:n,s=t.validate,i=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,c="*"===s.modifier||"+"===s.modifier;if(Array.isArray(a)){if(!c)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 h=0;h<a.length;h++){var f=o(a[h],s);if(i&&!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=c?"an array":"a string";throw new TypeError('Expected "'.concat(s.name,'" to be ').concat(p))}}else{f=o(String(a),s);if(i&&!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}}(ee(e,t),t)}function re(e,t){var r=[];return function(e,t,r){void 0===r&&(r={});var n=r.decode,o=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],i=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 o(e,r)})):l[r.name]=o(n[e],r)},u=1;u<n.length;u++)a(u);return{path:s,index:i,params:l}}}(ie(e,r,t),r,t)}function ne(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function oe(e){return e&&e.sensitive?"":"i"}function se(e,t,r){return function(e,t,r){void 0===r&&(r={});for(var n=r.strict,o=void 0!==n&&n,s=r.start,i=void 0===s||s,l=r.end,a=void 0===l||l,u=r.encode,c=void 0===u?function(e){return e}:u,h=r.delimiter,f=void 0===h?"/#?":h,p=r.endsWith,d="[".concat(ne(void 0===p?"":p),"]|$"),y="[".concat(ne(f),"]"),m=i?"^":"",g=0,v=e;g<v.length;g++){var b=v[g];if("string"==typeof b)m+=ne(c(b));else{var w=ne(c(b.prefix)),x=ne(c(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)o||(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;o||(m+="(?:".concat(y,"(?=").concat(d,"))?")),A||(m+="(?=".concat(y,"|").concat(d,")"))}return new RegExp(m,oe(r))}(ee(e,r),t,r)}function ie(e,t,r){return e instanceof RegExp?function(e,t){if(!t)return e;for(var r=/\((?:\?<(.*?)>)?(?!\?)/g,n=0,o=r.exec(e.source);o;)t.push({name:o[1]||n++,prefix:"",suffix:"",modifier:"",pattern:""}),o=r.exec(e.source);return e}(e,t):Array.isArray(e)?function(e,t,r){var n=e.map((function(e){return ie(e,t,r).source}));return new RegExp("(?:".concat(n.join("|"),")"),oe(r))}(e,t,r):se(e,t,r)}const le=Symbol("sync"),ae=Symbol("resolveRoute");function ue(e){let t=!1;return function(...r){if(!t)return t=!0,Reflect.apply(e,{},r)}}class ce{name;level;rootName;rootIndex=0;constructor(e,t,r,n){this.name=e,this.level=t,this.rootName=r,this.rootIndex=n}}class he{to;routeModel;from;data={};constructor(e,t){this.to=e,this.from=t}static from(e){let t=new he(e.to,e.from),r=e.data??{};return E(!0,t.data,r),t}}class fe{path;get fullPath(){let e=this.path??`/${this.name}`;return`${this.root??"default"}!${e}`}name;root;params;query;matched;meta;success;error;destroy;opsType;updateType;viewTagAttrs;index;active;slot;session;static clone(e,t){let r=new fe;return j(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 fe;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 pe{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 o=ue((t=>{A(t)&&(t=t.default),e.component=t,console.debug("success load async module"),r()})),s=ue((e=>{console.debug("reject load async module"),n(e)}));let i;try{i=t(o,s)}catch(e){s(e)}if(i)if("function"==typeof i.then)i.then(o,s);else{const e=i.component;e&&"function"==typeof e.then&&e.then(o,s)}}))}(this)}}class de{models=[]}class ye{path;match;redirect;name;layers=[]}var me=(e=>(e[e.Push=0]="Push",e[e.Replace=1]="Replace",e[e.Put=2]="Put",e[e.Append=3]="Append",e[e.Open=4]="Open",e))(me||{}),ge=(e=>(e[e.Part=0]="Part",e[e.All=1]="All",e))(ge||{});const ve=Symbol("rootKey"),be=Symbol("rootNodeKey"),we=Symbol("parentNodeKey"),xe=Symbol("nameKey");class Se{instance=null;model;route;active=!0;index=0;constructor(e,t,r=0,n=!0){this.route=e,this.model=t,this.index=r,this.active=n}}class Re{scope=null;set compensation(e){null!==this.scope&&this.scope.stop(),this.scope=t(),this.scope.run((()=>{r(this.slots,(()=>{let t=!1;try{t=e()}catch(e){console.error(e)}t&&null!==this.scope&&(this.scope.stop(),this.scope=null)}))}))}_slots;get slots(){return null==this._slots&&(this._slots=n([])),this._slots}get empty(){return null==this._slots||0==this._slots.value.length}[xe];[ve];[be]=null;[we]=null;get name(){return this[xe]}constructor(e,t,r){this[xe]=e,this[ve]=t,r&&(this[be]=r)}}class Ae{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 Ce{views=[]}class Ee{layers=[]}class je{time;route}class Pe{forbidTime=300;submitRecorder=new je;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 Te=void 0!==typeof window,Oe=window,$e=window.document;function qe(e,t,r){e.addEventListener?e.addEventListener(t,r,!1):e.attachEvent?e.attachEvent(`on${t}`,r):e[`on${t}`]=r}function Fe(e,t,r){e.removeEventListener?e.removeEventListener(t,r):e.detachEvent?e.detachEvent(`on${t}`,r):e[`on${t}`]=null}let ke=function(){let e=Oe.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 _e={method:"POST",headers:{"Content-Type":"application/json; charset=UTF-8"},mode:"cors",credentials:"same-origin",cache:"default",redirect:"follow",keepalive:!0},Me=new Map;async function Ne(e){let{id:t,method:r="POST",url:n,headers:o={},data:s,processData:i=!0,timeout:l=-1}=e;if(t&&Me.has(t))throw new Error("resubmit");r=r.toUpperCase();let{contentType:a="application/json; charset=UTF-8"}=o,u=E(!0,{..._e},{method:r,headers:o});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 o=`${encodeURIComponent(e)}=${encodeURIComponent(r[t])}`;n.length>0&&(n+="&"),n+=o}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):(i&&(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 o=`${encodeURIComponent(t)}=${encodeURIComponent(n[e])}`;r.length>0&&(r+="&"),r+=o}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}Me.set(t,r)}try{let e,r=await fetch(n,u),o={};r.headers.forEach(((e,t)=>{o[e]=t}));let s=o["content-type"]??"";return e=-1!==s.indexOf("application/json")?await r.json():-1!=s.indexOf("text")?await r.text():await r.blob(),{ok:r.ok,status:r.status,statusText:r.statusText,headers:o,data:e,response:r}}catch(e){throw e}finally{if(t){let e=Me.get(t);e&&(e.timer&&(clearTimeout(e.timer),e.timer=null),Me.delete(t))}}}function Ke(e){let t=Me.get(e);return!!t&&(t.timer&&(clearTimeout(t.timer),t.timer=null),t.controller.abort(),Me.delete(e),!0)}class Le{cache=new Map;constructor(){}async get(e,t=-1){if(this.cache.has(e)){return this.cache.get(e)}let r=await Ne({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 Ie=(e=>(e[e.Loading=0]="Loading",e[e.Loaded=1]="Loaded",e[e.Defining=2]="Defining",e[e.Defined=3]="Defined",e))(Ie||{});class De{exports;status;id;src}class He{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()}}const Ue=Symbol("chainKey"),Be=Symbol("cursorKey"),We=Symbol("$persistentModeKey"),Ve=Symbol("statusKey"),Je=Symbol("argsKey"),ze=Symbol("exArgsKey"),Ge=Symbol("successFnsKey"),Xe=Symbol("errorFnsKey"),Ye=Symbol("sessionKey"),Qe=Symbol("_go");class Ze{[Ue]=[];[Be]=0;[We]=!1;[Ve]="Free";[Je]=[];[ze]=[];[Ge]=[];[Xe]=[];[Ye];get session(){return this[Ye]}constructor(e,t=!1){this[Ye]=e,this[We]=t}[Qe](e,...t){let r=this[Ve];if(this[Ve]="Busy",this[Be]+=e,this[Be]<0&&(this[Be]=0),this[Je]=t,"Exception"===r||"Reject"===r){let e=[{session:this[Ye]},...this[ze]];for(;this[Xe].length>0;)try{let t=this[Xe].shift();"function"==typeof t&&O((()=>{Reflect.apply(t,{},e)}))}catch(e){console.error(e.message,e)}return this[Ve]=r,this[Ue]=[],this[Be]=0,this}if("Finished"===r||this[Be]>=this[Ue].length){let e=[{session:this[Ye]},...this[Je]];for(;this[Ge].length>0;){let t=this[Ge].shift();"function"==typeof t&&O((()=>{Reflect.apply(t,{},e)}))}return this[Ve]="Free",this}if(this[Be]>=this[Ue].length)return this[Ve]="Free",this;let n=this[Ue][this[Be]];this[We]||(this[Ue].splice(0,this[Be]+1),this[Be]=-1);let o=this[Be]+1;try{let e=!1,t={go:(t,...r)=>{e||(e=!0,Reflect.apply(this[Qe],this,[t,...r]))},resolve:(...t)=>{e||(e=!0,Reflect.apply(this[Qe],this,[1,...t]))},reject:(...t)=>{e||(e=!0,Reflect.apply(this.reject,this,[...t]))},insert:t=>{e||(this[Ue].splice(o,0,t),o++)},session:this[Ye]};O((()=>{Reflect.apply(n,{},[t,...this[Je]])}))}catch(e){this.throw(e)}return this}go(e,...t){return Reflect.apply(this[Qe],this,[e,...t])}finish(...e){return this[Ve]="Finished",this[Je]=e,Reflect.apply(this[Qe],this,[0])}reject(...e){return this[Ve]="Reject",this[ze]=e,Reflect.apply(this[Qe],this,[0])}throw(...e){return this[Ve]="Exception",this[ze]=e,Reflect.apply(this[Qe],this,[0])}reset(...e){this[Ve]="Busy",this[Je]=e,this[Ue]=[],this[Be]=0;let t=[{session:this[Ye]},...this[Je]];for(;this[Ge].length>0;){let e=this[Ge].shift();O((()=>{Reflect.apply(e,this,t)}))}return this[Ve]="Free",this}post(e){return"Reject"===this[Ve]||"Exception"===this[Ve]?this:(Array.isArray(e)?this[Ue]=[...this[Ue],...e]:this[Ue].push(e),"Busy"===this[Ve]||Reflect.apply(this[Qe],this,[0,...this[Je]]),this)}wait(e,t){return e&&"function"==typeof e&&this[Ge].push(e),t&&"function"==typeof t&&this[Xe].push(t),"Busy"===this[Ve]||Reflect.apply(this[Qe],this,[0,...this[Je]]),this}exception(e){return e&&"function"==typeof e&&this[Xe].push(e),"Busy"===this[Ve]?this:Reflect.apply(this[Qe],this,[0,...this[Je]])}isFinish(){return"Reject"==this[Ve]||"Free"==this[Ve]&&this[Be]>=this[Ue].length}}class et{head;isOldWebKit;moduleManager=new He;resource=new Le;options;_query;set query(e){this._query=e}get query(){return this._query}constructor(e={}){this.head=$e.head||$e.getElementsByTagName("head")[0]||$e.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 o=null;"function"==typeof e[r]&&(o=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 rt(t.length,((e,t)=>{if(s.isOK())try{"function"==typeof o&&Reflect.apply(o,{},t)}catch(e){console.error(e.message,e)}else try{console.error(e),"function"==typeof o&&Reflect.apply(o,{},[])}catch(e){console.error(e.message,e)}})),i=new Ze;for(let e=0;e<t.length;e++){let r=new nt(e,t[e],n,s);this.mount(i,r)}return this}remove(...e){let t=[],r=e.length-1,n={};"object"==typeof e[r]&&(Object.assign(n,e[r]),r--);let o=null;"function"==typeof e[r]&&(o=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 o&&Reflect.apply(o,{},[]),this}mount(e,t){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 r=t.params.htmlPoint;return r||(r=$e.body),void this.mountHTML(e,t,r)}let r=this.getFileNamePostfix(t.src);if("js"===r||0===r.length){let r=t.params.jsPoint;return r||(r=this.head),void this.mountJS(e,t,r)}if("css"===r){let r=t.params.cssPoint;return r||(r=this.head),void this.mountCSS(e,t,r)}{let r=t.params.htmlPoint;return r||(r=$e.body),void this.mountHTML(e,t,r)}}mountHTML(e,t,r){e.post((e=>{let n=t.params.timeout??this.options.timeout??3e4,o=t.src;this.resource.get(o,n).then((n=>{r.innerHTML=n,t.progress.work(!0,t.index,n),e.resolve()}),(r=>{console.error(r),t.progress.work(!1,t.index,null),e.reject()}))}))}mountCSS(e,t,r){e.post((e=>{let n=t.src,o=$e.createElement("link"),s="onload"in o;if(this.isOldWebKit||!s){let 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(o)}catch(e){console.error(e.message,e)}t.progress.work(!1,t.index,null),e.resolve()}};setTimeout((()=>{tt(o,n)}),1)}else o.onload=()=>{o.onload=o.onerror=null,t.progress.work(!0,t.index,t.src),e.resolve()},o.onerror=()=>{try{r.removeChild(o)}catch(e){console.error(e.message,e)}o.onload=o.onerror=null,t.progress.work(!1,t.index,null),e.reject()};let i=$e.getElementById(n);i&&i.parentNode&&i.parentNode.removeChild(i),o.rel="stylesheet",o.type="text/css",o.id=n,o.href=n,r.appendChild(o)}))}mountJS(e,t,r){e.post((e=>{let n=t.src,o=this.moduleManager.get(n);if(o&&(o.status==Ie.Defined||o.status==Ie.Loaded)){if(o.exports)return t.progress.work(!0,t.index,o.exports),void e.resolve();if(document.querySelector(`script[src='${n}`))return t.progress.work(!0,t.index,o.exports),void e.resolve()}o=new De,o.id=n,o.src=n,o.status=Ie.Loading,this.moduleManager.put(n,o);let s=$e.createElement("script");if("onload"in s)s.onload=()=>{s.onload=s.onerror=null,o.status==Ie.Loading&&(o.status=Ie.Loaded,t.progress.work(!0,t.index,n)),e.resolve()},s.onerror=()=>{try{r.removeChild(s)}catch(e){console.error(e.message,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,o.status==Ie.Loading&&(o.status=Ie.Loaded,t.progress.work(!0,t.index,n)),e.resolve())}}s.defer=!0,s.src=n,Oe.define=this.createDefine(o,t),r.appendChild(s)}))}unmount(e,t={}){let r=this.getFileNamePostfix(e);if("js"===r||0===r.length){let t=$e.querySelector(`script[src="${e}"]`);return t&&t.parentNode&&t.parentNode.removeChild(t),void this.moduleManager.remove(e)}if("css"!==r){this.resource.remove(e);let r=t.htmlPoint;return r||(r=$e.body),void(r.innerHTML="")}{let t=$e.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){let o,s,i;e.status=Ie.Defining;let l=n.length;1===l?(i=n[0],o=void 0):2===l?(i=n[1],Array.isArray(n[0])?(s=r.trimEmptyElement(n[0]),o=void 0):s=void 0):(o=n[0],s=r.trimEmptyElement(n[1]),i=n[2]),o&&(e.id=o,r.options.alias[o]=e.src),s&&s.length>0?r.ensure(s,((...r)=>{e.exports="function"==typeof i?Reflect.apply(i,e,r):i,e.status=Ie.Defined,t.progress.work(!0,t.index,e.exports)})):(e.exports="function"==typeof i?Reflect.apply(i,e,[]):i,e.status=Ie.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(t){throw console.error(`resolve path[${e}] fail`,t),t}}createSearch(e){let t="";if(e){for(let r in e){let n=`${e[r]}`;t+=`${encodeURIComponent(r)}=${encodeURIComponent(n)}&`}t.length>0&&(t=t.substring(0,t.length-1))}return t}getFileNamePostfix(e){let t=e.lastIndexOf("?");-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://"))return e;if(0==e.indexOf("https://"))return e;if(0==e.indexOf("file:///"))return e;if(0==e.indexOf("/")){return ke+e.slice(1)}if(0==e.indexOf("./")){return ke+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),o=this.options.paths[n];t=o?o+e.slice(r):e}}return this.parserPath(t,!1)}return ke+e}}function tt(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():tt(e,t)}),20)}class rt{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){console.error(e.message,e)}}isOK(){return this.status}}class nt{index;src;params;progress;constructor(e,t,r,n){this.index=e,this.src=t,this.params=r,this.progress=n}}const ot=Symbol("_notifyChange"),st=Symbol("_generateLocation"),it=Symbol("_setHashRecorder");class lt{currentRoute;routes;constructor(e,t){this.currentRoute=e,this.routes=t}}class at{query;changeHandle;historyChange;hashMonitor;traceless=!1;defaultPath;lastHash;constructor(e="",t=!0,r=!1,n="/"){this.query=e,this.hashMonitor=t,this.traceless=r,this.defaultPath=n}init(){if(!this.hashMonitor)return;if(this.historyChange)return;this.historyChange=()=>{if(!this.hashMonitor)return;let e=Oe.history.state;this[ot](e)},qe(Oe,"popstate",this.historyChange);let e=this.getHash()||this.defaultPath,t=Oe.sessionStorage.getItem(e);if(t){let e=JSON.parse(t);this[ot](e)}else{let t,r=e.indexOf("!");t=-1!=r?e.substring(r+1):e;let n=new fe;n.path=t,n.query=this.getSearch(),this[ot]([n])}}destroy(){this.historyChange&&Fe(Oe,"popstate",this.historyChange)}[it](e,t){if(this.hashMonitor)try{this.lastHash&&Oe.sessionStorage.removeItem(this.lastHash);let r=JSON.stringify(t);Oe.sessionStorage.setItem(e,r),this.lastHash=e}catch(e){console.error(e.message)}}listen(e){this.changeHandle=e}[ot](e){"function"==typeof this.changeHandle&&this.changeHandle(e)}go(e){Oe.history.go(e)}push(e){let t=this[st](e.currentRoute);this.traceless||Oe.history.pushState(e.routes,"",t),this[it](e.currentRoute.fullPath,e.routes)}replace(e){let t=this[st](e.currentRoute);this.traceless||Oe.history.replaceState(e.routes,"",t),this[it](e.currentRoute.fullPath,e.routes)}[st](e){let t;if(e.query){let r="";if("object"==typeof e.query)for(let t in e.query){let n=encodeURIComponent(e.query[t]),o=`${encodeURIComponent(t)}=${n}`;r.length>0&&(r+="&"),r+=o}else r=e.query;this.query?(t=`${this.query}&${r}`,"?"!==t.charAt(0)&&(t=`?${t}`)):t=`?${r}`}const r=Oe.location;let n;return n=t?`${r.origin}${r.pathname}${t}#${e.fullPath}`:`${r.origin}${r.pathname}#${e.fullPath}`,n}getHash(){let e=Oe.location.hash,t=e.indexOf("#");if(-1!=t){return e.substring(t+1)}return null}getSearch(){return Oe.location.search}}const ut=Symbol("_constructRouteModel"),ct=Symbol("_findRouteModel"),ht=Symbol("_findRootView"),ft=Symbol("_getFirstView"),pt=Symbol("_removeView"),dt=Symbol("_buildPage"),yt=Symbol("_resolveComponent"),mt=Symbol("_update"),gt=Symbol("_merge"),vt=Symbol("ignoreHistoryChangeOnceKey"),bt=Symbol("_handleHistoryChange"),wt=Symbol("_handleRouteUpdated"),xt=Symbol("routeUpdatedCallback"),St=Symbol("currentRoutes"),Rt=Symbol("current"),At=Symbol("_addRouteRecorder"),Ct=Symbol("_removeRouteRecorder"),Et=Symbol("_cloneRouteRecorder"),jt=Symbol("_hanldeError"),Pt=Symbol("errorCallback"),Tt=Symbol("registerKey"),Ot=Symbol("notFoundKey"),$t=Symbol("forestKey"),qt=Symbol("historyKey"),Ft=Symbol("beforeFiltersKey"),kt=Symbol("afterFiltersKey"),_t=Symbol("destroyFiltersKey"),Mt=Symbol("mainDispatcherKey"),Nt=Symbol("initKey"),Kt=Symbol("requireKey"),Lt=Symbol("_createNextFn"),It=Symbol("_start"),Dt=Symbol("_before"),Ht=Symbol("_after"),Ut=Symbol("_destroy"),Bt=Symbol("_load"),Wt=Symbol("_unload"),Vt=Symbol("_loadDependency"),Jt=Symbol("resolvedModulesKey"),zt=Symbol("resolveDependencyKey"),Gt=Symbol("routerGuardKey");class Xt{[Tt]=new Array;[Ot];[$t]=new Ee;[qt];[St]=new Array;[Pt]=null;[xt]=null;[Ft]=new Array;[kt]=new Array;[_t]=new Array;[Mt]=new Ze;[Jt]=new Map;[zt]=null;[Gt]=new Pe;[Nt]=!1;[Rt]=e(null);[Kt]=new et;get require(){return this[Kt]}get current(){return this[Rt].value}options;constructor(e){this.options=e??{};let t=this.options.routes||[];this.addRoutes(t),this.options.notFound&&this.setNotFoundRoute(this.options.notFound),this[qt]=new at(this.options.query,this.options.hashMonitor,this.options.traceless,this.options.defaultPath),this[qt]?.listen((e=>{if("string"==typeof e){let t=this[ae](e);t&&this[bt]([t])}else this[bt](e)}))}[jt](e="error",t){if(t&&"function"==typeof t.error)try{t.error(e)}catch(e){}if("function"==typeof this[Pt])try{this[Pt](e,t)}catch(e){}console.error(e)}init(){!0!==this[Nt]&&(this[qt]?.init(),this[Nt]=!0)}[vt]=!1;[bt](e){if(this[vt])this[vt]=!1;else try{if(!e){let e=[...this[St]].reverse();return this[Wt](e),void Oe.location.reload()}let t=null,r=[],n=[],o=0;for(;o<e.length&&o<this[St].length&&fe.isSame(e[o],this[St][o]);o++)e[o].opsType===me.Open&&!0===e[o].active&&e[o].active!==this[St][o].active&&(t=e[o]);if(o<e.length&&(r=e.slice(o)),o<this[St].length&&(n=this[St].slice(o).reverse()),0==n.length&&0==r.length)return void(null!==t&&this.restore([t]));if(n.length>0){if(this[Wt](n)){if(r.length>0)return void this.restore(r);null!==t&&this.restore([t])}}else this.restore(r)}catch(e){this[jt](e)}}[wt](e){if(e)this[Rt].value=e;else{let e=this[St].length;this[Rt].value=e>0?this[St][e-1]:null}if("function"==typeof this[xt])try{this[xt](this[Rt].value)}catch(e){}}[At](e,t=-1){t<0||t>=this[St].length?this[St].push(e):this[St].splice(t,0,e)}[Et](){let e=[];for(let t of this[St]){let r=fe.clone(t,!0);e.push(r)}return e}[Ct](e){if(null==this[St])return;let t=-1;for(let r=0;r<this[St].length;r++)if(fe.isSame(this[St][r],e)){t=r;break}if(-1!=t){let e=this[St][t];this[St].splice(t,1),this[Ut](e,e.session)}}set hashMonitor(e){this[qt]&&(this[qt].hashMonitor=e)}get hashMonitor(){return!!this[qt]&&this[qt].hashMonitor}set traceless(e){this[qt]&&(this[qt].traceless=e)}get traceless(){return!!this[qt]&&this[qt].traceless}onRouteUpdated(e){this[xt]=e}onError(e){this[Pt]=e}beforeEach(e){this[Ft].push(e)}removeBeforeEach(e){let t=this[Ft].indexOf(e);return-1!==t&&(this[Ft].splice(t,1),!0)}afterEach(e){this[kt].push(e)}removeAfterEach(e){let t=this[kt].indexOf(e);return-1!==t&&(this[kt].splice(t,1),!0)}destroyEach(e){this[_t].push(e)}removeDestroyEach(e){let t=this[_t].indexOf(e);return-1!==t&&(this[_t].splice(t,1),!0)}setResolveDependency(e){this[zt]=e}addRoutes(e){for(let t of e)this.addRoute(t)}addRoute(e,t=-1){let r=this[ut](e);if(-1==t)this[Tt]=[...this[Tt],...r];else for(let e=r.length-1;e>=0;e--)this[Tt].splice(t,0,r[e])}removeRoute(e){let t=this[ae](e);if(null===t)return console.warn("route格式错误",e),!1;for(let e=0;e<this[Tt].length;e++){let r=this[Tt][e];if(t?.path&&r.path===t.path)return this[Tt].splice(e,1),!0;if(t?.name&&r.name===t.name)return this[Tt].splice(e,1),!0}return!1}hasRoute(e){let t=this[ae](e);return null===t?(console.warn("route格式错误",e),!1):-1!==this[Tt].findIndex((e=>!(!t?.path||e.path!==t.path)||(!(!t?.name||e.name!==t.name)||void 0)))}setNotFoundRoute(e){let t=this[ut](e);this[Ot]=t[0]}getRoutes(){return[...this[Tt]]}[ut](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 ye;return r.path=t,r.redirect=e.redirect,[r]}let n=[];for(let t in r){let o=r[t];0===t.length&&(t="default");let s=new pe(t,o,e.props,e.meta);n.push(s)}let o=!1,s=[];if(e.children)for(let r of e.children){let e=this[ut](r);for(let r of e){let e=new ye;e.name=r.name,r.path&&r.path.length>0?e.path="/"!==t?`${t}${r.path}`:r.path:(o=!0,e.path=t);let i=new de;i.models=[...n],e.layers=[i,...r.layers],s.push(e)}}if(!o){let r=new de;r.models=n;let o=new ye;o.name=e.name,o.path=t,o.layers=[r],s.splice(0,0,o)}return s}[ct](e){let t=e.route;try{for(let r of this[Tt]){if(t.path&&r.path){let n=r.match;n||(n=r.match=re(r.path));let o=n(t.path);if(!o)continue;if(r.redirect){let n=new fe;E(!0,n,t),n.path=r.redirect;let o={route:n,find:void 0};return!!this[ct](o)&&(e.route=o.route,e.find=o.find,!0)}if(t.params=t.params??{},E(!0,t.params,o.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()),o=decodeURIComponent(t[1].trim());r[n]=o}E(!0,t.params,r)}else"object"==typeof e&&E(!0,t.params,e)}return e.find=r,!0}if(t.name===r.name){t.params=t.params??{};let n=te(r.path);return t.path=n(t.params),e.find=r,!0}}}catch(e){console.error(e.message,e),"function"==typeof t.error&&t.error(e.message)}return!1}[ae](e){let t=null;if(Array.isArray(e))if(t=new fe,"object"==typeof e[0])t=fe.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&&E(!1,t,e[r]);else"object"==typeof e?t=fe.from(e):"string"==typeof e&&(t=new fe,"/"==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??"default",t.opsType=t.opsType??this.options.defaultOperationType??me.Push}return t}push(...e){let t=this[ae](e);return t?(t.opsType=t.opsType||me.Push,this.to(t)):(this[jt]("resolve route fail",t),this)}put(...e){let t=this[ae](e);return t?(t.opsType=me.Put,this.to(t)):(this[jt]("resolve route fail",t),this)}replace(...e){let t=this[ae](e);return t?(t.opsType=me.Replace,this.to(t)):(this[jt]("resolve route fail",t),this)}append(...e){let t=this[ae](e);return t?(t.opsType=me.Append,this.to(t)):(this[jt]("resolve route fail",t),this)}remove(e){return new Promise((t=>{this[Mt].post((r=>{try{if(0===this[St].length)return r.resolve(),void t(!1);let n,o=-1,s=[];if(e){if(e.root)n=e.root;else{n=this[St][0].root??"default"}if(e.all)for(let e=this[St].length-1;e>0;e--){let t=this[St][e];t.opsType===me.Append&&t.root===n&&(s.splice(0,0,t),o=e-1)}else if(e.until)for(let t=this[St].length-1;t>0;t--){let r=this[St][t];if(r.opsType===me.Append&&r.root===n){if("/"===e.until.charAt(0)&&e.until===r.path){o=t;break}if(e.until===r.name){o=t;break}s.splice(0,0,r)}}}else{n="default";let e=this[ft](this[$t]);e&&(n=e.name);for(let e=this[St].length-1;e>0;e--){let t=this[St][e];if(t.opsType===me.Append&&t.root===n){s.push(t),o=e-1;break}}}if(0===s.length){let e="can not find route";return console.warn(e),r.resolve(e),void t(!1)}let i=0;if(this[St].forEach((e=>{e.opsType!==me.Put&&i++})),this[Wt](s)){let e=0;this[St].forEach((t=>{t.opsType!==me.Put&&e++}));let n=i-e;this[vt]=!0,this.back(n),r.resolve(),t(!0)}}catch(e){this[jt](e),r.resolve(),t(!1)}}))}))}open(...e){let t=this[ae](e);return t?(t.opsType=me.Open,this.to(t)):(this[jt]("resolve route fail",t),this)}close(e){return this[Mt].post((t=>{try{let r=this[ae](e);if(!r)return void t.reject("resolve route fail");let n=[];for(let e=0;e<this[St].length;e++){let t=this[St][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[Wt](n)){let e=fe.clone(r,!0);const t=new lt(e,this[Et]());this[qt]?.replace(t),this[wt]()}t.resolve()}catch(e){this[jt](e),t.resolve()}})),this}to(...e){let t=this[ae](e);if(!t)return this[jt]("resolve route fail",t),this;let r=this[Gt].acquire(t);return null==r?(this[jt]("route forbid",t),this):(this[Mt].post((e=>{try{let n=this[It](t);this[Dt](n),!n.session?.routeModel&&this[zt]&&this[Vt](n),this[Bt](n),this[Ht](n),n.wait(((n,o)=>{let s=n.session.to;try{let e=fe.clone(s,!0);const t=new lt(e,this[Et]());s.opsType===me.Replace?this[qt]?.replace(t):this[qt]?.push(t)}catch(e){console.error(e.message,e)}if(this[Gt].release(r),this[wt](s),"function"==typeof t.success)try{Reflect.apply(t.success,{},[])}catch(e){console.error(e.message,e)}e.resolve()}),((n,o)=>{this[Gt].release(r),this[jt](o,t),e.resolve()}))}catch(n){this[Gt].release(r),this[jt](n,t),e.resolve()}})),this)}back(e=1){this[qt]?.go(-e)}[Lt](e){return(t,r)=>{if("boolean"==typeof t)t?e.resolve():e.reject(r);else if(t){let r=this[ae](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()}}[It](e){let t=this[St].length>0?this[St][0]:void 0,r=new he(e,t),n={route:e,find:null};return this[ct](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=E(!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 Ze(r)}[Dt](e){for(let t of this[Ft])e.post((e=>{let r=this[Lt](e);Reflect.apply(t,{},[e.session.to,e.session.from,r,e.session])}))}[Ht](e){e.post((e=>{for(let t of this[kt])try{Reflect.apply(t,{},[e.session.to,e.session.from,e.session])}catch(e){console.error(e.message,e)}e.resolve()}))}[Ut](e,t){for(let r of this[_t])try{Reflect.apply(r,{},[e,t])}catch(e){console.error(e.message,e)}"function"==typeof e.destroy&&Reflect.apply(e.destroy,e,[])}[Vt](e){let t=e.session,r=Reflect.apply(this[zt],this,[t?.to]);if(null==r)return;Array.isArray(r)||(r=[r]);let n=[];for(let e of r)this[Jt].has(e)||n.push(e);0!==n.length&&e.post((e=>{this[Kt].ensure(n,((...t)=>{if(t){for(let e of t){if(!e)continue;let t;t=A(e)?e.default:e,Array.isArray(t)&&this.addRoutes(t)}for(let e of n)this[Jt].set(e,!0);e.resolve()}else e.reject()}))}))}[Bt](e){e.post((e=>{let t=e.session.to,r=e.session.routeModel;if(null==r){let n={route:t,find:null};if(this[ct](n))r=n.find,e.session.routeModel=r;else{if(!this[Ot])return void e.reject(`not find route model, path:${t.path??t.name}`);r=this[Ot]}}let n=he.from(e.session);this[dt](t,r,n).then((t=>{this[$t],e.resolve()}),(t=>{e.reject(t)}))}))}[Wt](e){if(0==e.length)return!0;let t=this[$t],r=[];for(let n of e){let e=this[ht](t,n);null!=e&&r.push({...e,route:n})}if(0==r.length){let e="can not find view index";return this[jt](e),!1}for(let e of r.reverse())this[pt](t,{x:e.x,y:e.y},[e.route.index??0],!0);return!0}[ht](e,t){let r,n=t.root??"default";for(let t=0;t<e.layers.length;t++){let o=e.layers[t];for(let e=o.views.length-1;e>=0;e--){let s=o.views[e];if(s[ve]&&s[xe]===n)return r={x:e,y:t},r}}return null}[ft](e){if(e.layers.length>0&&e.layers[0].views.length>0){return e.layers[0].views[0]}return null}[pt](e,t,r=null,n=!0){if(t.y>=e.layers.length)return;if(t.x>=e.layers[t.y].views.length)return;let o=e.layers[t.y].views[t.x],s=!1,i=[],l=!1,a=o.slots.value;for(let e=a.length-1;e>=0;e--){let n=a[e];null!=r&&-1==r.indexOf(n.index)||(n.route&&o[ve]&&(this[Ct](n.route),!0===n.active&&n.route.opsType==me.Append&&(l=!0)),i.push(new Ae(o,n.index,t.y)),a.splice(e,1))}if(0==a.length)n?o.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)}o.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||i.length>0)&&n>=0;n--){let o=t[n];if(o[we]&&(s||Ae.include(i,o[we]))){let t=o.slots.value;for(let e=t.length-1;e>=0;e--){let n=t[e];n.route&&o[ve]&&this[Ct](n.route),r.push(new Ae(o,n.index,u)),t.splice(e,1)}e.layers[u].views.splice(n,1)}}i=r,0==e.layers[u].views.length&&(s=!0)}}restore(e){if(e&&0!=this[Tt].length){return new Promise(((t,r)=>{for(let t=0;t<e.length;t++){let r=e[t];this[Mt].post((e=>{let t=this[It](r);this[Dt](t),!t.session?.routeModel&&this[zt]&&this[Vt](t),this[Bt](t),this[Ht](t),t.wait(((t,r)=>{e.resolve()}),((t,r)=>{this[jt](r),e.resolve()}))}))}this[Mt].post((e=>{e.resolve(),t()}))}))}{let e=this[$t];if(e.layers.length>0){let t=e.layers[0].views;t.length>0&&(t[0].slots.value=[])}return this[St]=[],this[wt](),Promise.resolve()}}[dt](e,t,r){let n=e.updateType??ge.Part;return this[yt](t).then((()=>{this[mt](t,e,r,n)}))}[yt](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()}[mt](e,t,r,n){if(1!==e.layers[0].models.length)return Promise.reject("illegal route structure(multil root node)");const o=e.layers[0].models[0];let s,i,l=this[$t],a=function(e){return 0==e.layers.length||0==e.layers[0].views.length}(l),u=t.root??"default";a||n!=ge.Part||(s=this[ht](l,t));let c=0;if(null==s||null==s)if(a||n===ge.All){if(0==l.layers[0].views.length){let e=t.root??"default";i=new Re(e,!0,null),l.layers[0].views=[i]}else i=l.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>l.layers.length)return Promise.reject("can not insert view(override level)");if(e.rootName){let t=l.layers[n-1];for(let o of t.views){if(o[ve]&&o.name===e.rootName){r=new Ae(o,e.rootIndex??0,n-1);break}if(o[be]&&o[be].view.name===e.rootName&&o[be].index===e.rootIndex){r=o[be];break}}}if(!r)return Promise.reject("can not insert view(not find root node ref)");i=new Re(u,!0,r),l.layers[n].views.push(i),s={x:l.layers[n].views.length-1,y:n}}else i=l.layers[s.y].views[s.x];if(c=s.y,i[ve]=!0,t.opsType===me.Append){t.index=P.get();let r=i.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 Se(t,o,t.index,!0);i.slots.value=[...r,n];let s=c+1,a=1,u=new Ae(i,t.index,c);this[gt](l,s,e,a,u)}else if(t.opsType===me.Open){let r=i.slots.value,n=!1;for(let e of r){if(null!==e.route&&fe.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[Ct](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 Se(t,o,t.index,!0);r.push(n);let s=c+1,a=1,u=new Ae(i,t.index,c);this[gt](l,s,e,a,u)}i.slots.value=[...r]}else{let r=i.slots.value;if(0==r.length){t.index=P.get(),i.slots.value=[new Se(t,o,t.index)];let r=c+1,n=1,s=new Ae(i,t.index,c);this[gt](l,r,e,n,s)}else{let n=r[0];if(n.model!==o){this[pt](l,s,null,!0),t.index=P.get(),i.slots.value=[new Se(t,o,t.index)];let r=c+1,n=1,a=new Ae(i,t.index,c);this[gt](l,r,e,n,a)}else{null!==n.route&&this[Ct](n.route);let o=[];for(let e=1;e<r.length;e++)o.push(r[e].index);o.length>0&&this[pt](l,s,o,!0),t.index=n.index,n.route=t;let a=[new Ae(i,t.index,c)],u=c+1,h=1,f=new Ae(i,t.index,c);for(;a.length>0&&u<l.layers.length&&h<e.layers.length;u++,h++){let t=[];for(let e=0;e<l.layers[u].views.length;e++){let r=l.layers[u].views[e];r[we]&&Ae.include(a,r[we])&&t.unshift(e)}let r=[];for(let n of t){let t,o=l.layers[u].views[n],s=e.layers[h].models;for(let e=0;e<s.length;e++)if(o.name===s[e].name){t=s[e];break}if(t){let s=o.slots.value;if(0==s.length){let r=0;o.slots.value=[new Se(null,t,r)];let n=u+1,s=h+1;this[gt](l,n,e,s,f)}else{let i=s[0];if(i.model!==t){this[pt](l,{x:n,y:u},null,!0),o.slots.value=[new Se(null,t,0)];let r=u+1,s=h+1;this[gt](l,r,e,s,f)}else{o[ve]&&null!==i.route&&this[Ct](i.route);let e=[];for(let t=1;t<s.length;t++)e.push(s[t].index);e.length>0&&this[pt](l,{x:n,y:u},e,!0),r.push(new Ae(o,i.index,u))}}o[ve]=!1}else this[pt](l,{x:n,y:u},null,!1)}a=r}this[gt](l,u,e,h,f)}}}if(i&&i[be]){let e=i[be];e&&(t.slot=new ce(u,c,e?.view.name,e?.index??0))}r.to=void 0,r.routeModel=void 0,t.session=r,this[At](t)}[gt](e,t,r,n,o){let s=n,i=t;for(;i<e.layers.length&&s<r.layers.length;i++,s++){let t=e.layers[i].views;for(let e of r.layers[s].models){let r=new Re(e.name,!1,o),n=new Se(null,e);r.slots.value=[n],t.push(r)}}for(;s<r.layers.length;s++){let t=new Ce;t.views=[];for(let e of r.layers[s].models){let r=new Re(e.name,!1,o),n=new Se(null,e);r.slots.value=[n],t.views.push(r)}e.layers.push(t)}}[le](e,t,r,n,o,s){if(t<0||t>this[$t].layers.length)return null;if(t<this[$t].layers.length){let i=this[$t].layers[t],l=null;for(let a of i.views){let i=!1;if(null!==r?(i=a.name===e&&a[be]?.view===r,i&&-1!==n&&(i=a[be]?.index===n)):i=a.name===e,i){null!==o&&(a[we]={view:o,index:s,level:t-1}),l=a;break}}if(null!==l)return l}let i=null,l=null;null!==o&&(i=o[ve]?{view:o,index:s,level:t-1}:o[be],l={view:o,index:s,level:t-1});let a=new Re(e,!0,i);if(a[we]=l,t==this[$t].layers.length){let e=new Ce;e.views=[a],this[$t].layers.push(e)}else this[$t].layers[t].views.push(a);return a}}const Yt=Symbol("registerKey");class Qt{policy;callback;constructor(e,t){this.callback=e,this.policy=t}}class Zt{[Yt]=new Map;constructor(){}on(e,t,r=!1){let n=this[Yt].get(e);n||(n=new Array,this[Yt].set(e,n));let o=new Qt(t,!0===r?1:0);return n.push(o),this}off(e,t){if(!t)return this[Yt].delete(e),this;let r=this[Yt].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 console.error("callback can not benn empty"),this;let n=t-1,o=new Array(n),s=[].splice.call(e,0,n);for(let e=0;e<s.length;e++)this.once(s[e],(t=>{o[e]=t,n-=1,0==n&&Reflect.apply(r,{},o)}));return this}emit(e,...t){let r=this[Yt].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{O((()=>{Reflect.apply(n.callback,{},t)}))}catch(e){console.error(e.message,e)}}return this}trigger(e,...t){return Reflect.apply(this.emit,this,[e,...t])}}const er=Symbol("registerKey");class tr{[er]=new Map;constructor(){}set(e,t){this[er].set(e,t)}get(e){return this[er].get(e)}has(e){return this[er].has(e)}delete(e){return this[er].delete(e)}}const rr=Symbol("lc");function nr(e,t=!1){let r=e,n=r[rr];if(!n){if(!t)return null;n=new tr,r[rr]=n}return n}function or(e,t){let r=e;for(;null!==r;){let e=r[rr];if(e&&e.has(t))return e.get(t);r=r.$parent}return null}function sr(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 nr(t.component.proxy,!1)}return null}const ir=Symbol("hooksKey");function lr(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){console.error(e.message,e)}}}var ar=(e=>(e.DEACTIVATED="da",e.ACTIVATED="a",e))(ar||{});class ur{type;hook;target;constructor(e,t,r){this.target=r,this.hook=t,this.type=e}}function cr(e){return(t,r)=>{let n;if(r)n=r;else{let e=o();if(null==e||null==e.proxy)return void console.error("can not get currrent instance or proxy");n=e.proxy}let i=or(n,ir);null!=i?(s((()=>{!function(e,t,r,n){let o=-1;for(let s=0;s<e.length;s++){let i=e[s];if(i.type===t&&i.hook===r&&i.target===n){o=s;break}}-1!=o&&e.splice(o,1)}(i,e,t,n)})),function(e,t,r,n){let o=new ur(t,r,n);e.push(o)}(i,e,t,n)):console.warn("can not get hooks context")}}let hr=cr("a"),fr=cr("da");const pr=Symbol("routeKey");function dr(e,t){let r=e.get(pr);if(r){let e={path:"",name:"",params:{},index:-1,session:{}};Object.assign(e,t),Object.assign(r,e)}else r=function(){let e=new fe;return e.path="",e.name="",e.params={},e.index=-1,i(e)}(),Object.assign(r,t),e.set(pr,r)}function yr(e){let t=or(e,pr);return null!=t?t:null}const mr=Symbol("rk"),gr=Symbol("vd"),vr=Symbol("rv"),br=Symbol("rvi"),wr=Symbol("pv"),xr=Symbol("pvi");function Sr(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 Rr(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 Ar(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 Cr(e,t){e.classList.contains(t)||e.classList.add(t)}function Er(e,t){e.classList.remove(t)}const jr=Te&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout;function Pr(e){jr(e)}function Tr(e,t,...r){y(t)&&(null==e&&(e={}),Reflect.apply(t,e,r))}function Or(e,t,r,n=-1,o,s,i,l){if(y(s)){if(void 0!==o&&o>=0)return void setTimeout((()=>{Reflect.apply(s,e,[t,r,n]),y(l)&&Reflect.apply(l,e,[])}),o);let i=["animationend","transitionend"],a=o=>{i.forEach((e=>{Fe(t,e,a)})),Reflect.apply(s,e,[t,r,n]),l&&Reflect.apply(l,e,[])};i.forEach((e=>{qe(t,e,a)}))}if(y(i)){let o="animationcancel",s=l=>{Reflect.apply(i,e,[t,r,n]),Fe(t,o,s)};qe(t,o,s)}}function $r(e){return null!==e&&(e.opsType===me.Append||e.opsType===me.Open)}function qr(e,t,r,n,o={},s,i=-1){if(t&&(r||$r(s))){let e=Sr(o,r);e&&Cr(n,e);let t=Rr(o,r);t&&Cr(n,t)}else{Tr(e,function(e,t=!1){let r=null;return r=t?e.onBeforeShow??e.onBeforeEnter:e.onBeforeEnter,r}(o,r),[n,s,i])}}function Fr(e,t,r,n,o={},s,i,l,a){if($r(i)||r)if(t){let t=Sr(o,r),u=Rr(o,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)}(o,r);Pr(c?()=>{Or(e,n,i,l,s,(()=>{u&&Er(n,u),c&&Er(n,c),y(a)&&a(e,a,[n])})),t&&Er(n,t),c&&Cr(n,c)}:()=>{t&&Er(n,t),u&&Er(n,u),y(a)&&a(e,a,[n])})}else{let t=function(e,t=!1){let r=null;return r=t?e.onShow??e.onEnter:e.onEnter,r}(o,r),s=function(e,t=!1){let r=null;return r=t?e.onAfterShow??e.onAfterEnter:e.onAfterEnter,r}(o,r),u=function(e,t=!1){let r=null;return r=t?e.onShowCancelled??e.onEnterCancelled:e.onEnterCancelled,r}(o,r),c=t=>{!t&&y(s)?Tr(e,s,[n,i,l]):y(u)&&Tr(e,u,[n,i,l]),y(a)&&a(e,a,[n])};y(t)?Tr(e,t,[n,c,i,l]):c()}else y(a)&&a(e,a,[n])}function kr(e,t,r,n,o={},s,i,l,a,u){if($r(l)||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)}(o,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)}(o,r),h=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)}(o,r);t&&Cr(n,t),c&&Cr(n,c),Pr(h?()=>{Or(e,n,l,a,s,(()=>{c&&Er(n,c),h&&Er(n,h),y(u)&&Tr(e,u,[n]),!r&&y(i)&&i()})),t&&Er(n,t),h&&Cr(n,h)}:()=>{t&&Er(n,t),c&&Er(n,c),y(u)&&Tr(e,u,[n]),!r&&y(i)&&i()})}else{let t=function(e,t=!1){let r=null;return r=t?e.onHide??e.onLeave:e.onLeave,r}(o,r),s=function(e,t=!1){let r=null;return r=t?e.onAfterHide??e.onAfterLeave:e.onAfterLeave,r}(o,r),c=function(e,t=!1){let r=null;return r=t?e.onHideCancelled??e.onLeaveCancelled:e.onLeaveCancelled,r}(o,r),h=t=>{!t&&y(s)?(Tr(e,s,[n,l,a]),y(u)&&Tr(e,u,[n]),!r&&y(i)&&i()):y(c)&&(Tr(e,c,[n,l,a]),y(u)&&Tr(e,u,[n]))};y(t)?Tr(e,t,[n,h,l,a]):h()}else!r&&y(i)&&i()}function _r(e,t={},r,n=-1){let o=$(t.css),s=t.mode??"default",i=Ar(t);return{mode:s,persisted:!1,beforeEnter:s=>{qr(e,o,!1,s,t,r,n)},enter:s=>{Fr(e,o,!1,s,t,i.enter,r,n)},leave:(s,l)=>{kr(e,o,!1,s,t,i.leave,l,r,n)},clone:o=>_r(e,t,r,n)}}function Mr(e){return e.el}function Nr(e,t,r={},n,o,s,i){if(s){let s=Mr(t);if(null==s)return;let l=$(r.css),a=Ar(r);qr(e,l,!0,s,r,n,o),Fr(e,l,!0,s,r,a.show,n,o,(t=>{y(i)&&Tr(e,i,[t])}))}else y(i)&&Tr(e,i,[])}function Kr(e,t,r={},n,o,s,i){if(s){let s=Mr(t);if(null==s)return;let l=$(r.css),a=Ar(r);kr(e,l,!0,s,r,a.hide,null,n,o,(t=>{y(i)&&Tr(e,i,[t])}))}else y(i)&&Tr(e,i,[])}function Lr(e,t,r){return"function"==typeof e?Reflect.apply(e,{},[t,r]):e}function Ir(e,t){if(!e)return null;const r=e(t);return 1===r.length?r[0]:r}class Dr{node;state;constructor(e,t){this.node=e,this.state=t}}const Hr=l({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,t){const r=o();if(null===r||null===r.proxy)return void console.error("instance or instance.proxy not exist");const n=!0===e.multi,i=a(mr,null),l=a(gr,0),h=a(vr,null),f=a(br,-1);let p=!1,d=null;const y=e.modelSlot;if(y){u(gr,l+1),u(br,y.index),u(xr,y.index);const e=y.route;if(!e)return void console.warn("child view render error, route not exist");const t=nr(r.proxy,!0);!function(e){let t=e.get(ir);t||(t=[],e.set(ir,t))}(t),dr(t,e)}else{if(null==i)return void console.error("router is not been injected");const t=e.name,o=a(wr,null),s=a(xr,0);if(d=i[le](t,l,h,f,o,s),null===d)return;u(wr,d);if(!0===d[ve]&&u(vr,d),n)p=$(e.transition??!0);else{p=$(e.transition??!1),u(br,-1),u(gr,l+1),u(xr,-1);const t=d.slots.value;if(t.length>0){const e=t[0].route;if(e){dr(nr(r.proxy,!0),e)}}else{const e=nr(r.proxy,!0);d.compensation=()=>{const t=d.slots.value;if(t.length>0){const r=t[0].route;return r&&dr(e,r),!0}return!1}}}}const m={value:new Map};return s((()=>{m.value&&m.value.clear()})),()=>{if(n){const n=new Map,o=[],s=d?.slots.value,i=[];for(let l=0;l<s.length;l++){const a=s[l],u=`${e.name}-${a.index}`,h={modelSlot:a};let f;f=t.slots.default?c(Hr,h,{default:t.slots.default}):c(Hr,h);const d={},y=Lr(e.viewClass,a.route,l);"string"==typeof y&&y.length>0&&(d[y]=!0);const g=Lr(e.viewActiveClass,a.route,l),v=Lr(e.viewDeactiveClass,a.route,l),b=m.value.get(u);if("string"==typeof g&&g.length>0&&(d[g]=a.active),"string"==typeof v&&v.length>0&&(d[v]=!a.active),b&&a.active!==b.state){const t=b.node;a.active?i.unshift((()=>{Nr(r,t,e,a.route,l,p,(()=>{let e=sr(t);null!=e&&lr(e,ar.ACTIVATED)}))})):i.push((()=>{Kr(r,t,e,a.route,l,p,(()=>{let e=sr(t);null!=e&&lr(e,ar.DEACTIVATED)}))}))}const w={class:d,key:u},x=Lr(e.viewTagProps,a.route,l);null!==x&&"object"==typeof x&&E(!0,w,x),a.route?.viewTagAttrs&&"object"==typeof a.route?.viewTagAttrs&&E(!0,w,a.route.viewTagAttrs);const S=Lr(e.viewTag,a.route,l),R=c(S,w,{default:()=>[f]});if(n.set(u,new Dr(R,a.active)),p){const t=_r(r,e,a.route,l);R.transition=t}o.push(R)}m.value=n,function(e,t={}){Pr((()=>{for(let r=0;r<e.length;r++)Reflect.apply(e[r],t,[])}))}(i,r);const l=Lr(e.tag,null,-1),a={};return Object.assign(a,t.attrs),c(l,a,{default:()=>o})}if(null!=y){const e=y.model,r={};e.props&&("object"==typeof e.props?E(!1,r,e.props):!0===e.props&&"object"==typeof y.route?.params&&E(!1,r,y.route?.params));const n=c(e.component,r);return Ir(t.slots.default,{Component:n,route:y.route})??n}{const n=d.slots.value;if(n.length>0){const o=n[0],s=o.model,i={};s.props&&("object"==typeof s.props?E(!1,i,s.props):!0===s.props&&"object"==typeof o.route?.params&&E(!1,i,o.route?.params));const l=c(s.component,i);if(p){const t=_r(r,e,o.route,-1);l.transition=t}return Ir(t.slots.default,{Component:l,route:o.route})??l}return Ir(t.slots.fallback,{})}}}});function Ur(e,t){return"function"==typeof e?Reflect.apply(e,{},[t]):e}let Br=l({name:"RouterLink",inheritAttrs:!1,props:{tag:{type:[String,Object,Function],required:!1,default:"a"},to:{type:[String,Object,Function],required:!0},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,t){const r=a(mr,null);return()=>{let n=Ur(e.to,null),o=Ur(e.tag,n);if(null==o)return void console.warn("can not resolve link tag");let s=null,i=null;null!==r&&(s=r[ae](n),i=r.current);let l={},a=Ur(e.activeClass,s);if("string"==typeof a&&a.length>0&&(l[a]=function(e,t){return!!(null!=e&&null!=t&&(e.path&&t.path&&t.path.startsWith(e.path)||e.name&&e.name==t.name))}(s,i)),!0===Ur(e.exact,s)){let t=Ur(e.exactActiveClass,s);"string"==typeof t&&t.length>0&&(l[t]=function(e,t){return!!(null!=e&&null!=t&&(e===t||e.path&&e.path===t.path||e.name&&e.name===t.name))}(s,i))}let u={class:l};E(!0,u,t.attrs);let h=Ur(e.event,s);if("string"==typeof h){const e=e=>{null!=r?null!=s?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)&&r.to(s):console.warn("route is not been resolved"):console.warn("router is not been injectd")};u[h]=e}return c(o,u,t.slots)}}}),Wr={get each(){return L},get type(){return k},get isFunction(){return y},get isArray(){return h},get isArrayLike(){return M},get makeArray(){return K},get merge(){return N},get isWindow(){return _},get isPlainObject(){return S},get isEqual(){return I}};const Vr=Symbol("fk"),Jr=Symbol("fbk"),zr=Symbol("fepk");function Gr(e={}){const t=new Xt(e),r=new Z,n=new Zt,o={...Wr,get router(){return t},get bus(){return r},get Bus(){return Z},get eventproxy(){return n},get EventProxy(){return Zt},get EventChain(){return Ze},get require(){return t.require},get request(){return Ne},get extend(){return E},get clone(){return j},install(e){e.provide(mr,t),e.provide(Vr,o),e.provide(Jr,r),e.provide(zr,n),e.component("fox-router-view",Hr),e.component("fox-router-link",Br),Reflect.defineProperty(e.config.globalProperties,"$fox",{get:()=>o}),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 yr(this)}},created(){t.init()}})}};return o}function Xr(e){if(e){return e.$router}return a(mr)}function Yr(e){if(!e){e=o()?.proxy??void 0}return e?yr(e):null}function Qr(e){if(e){return e.$fox}return a(Vr)}function Zr(e){if(e){return e.$bus}return a(Jr)}function en(e){if(e){return e.$eventProxy}return a(zr)}function tn(e){const t=Xr(),r=(t,r,n)=>{try{Reflect.apply(e,{},[t,r])}catch(e){console.error(e)}n()};t.beforeEach(r),s((()=>{t.removeBeforeEach(r)}))}function rn(e){const t=Xr(),r=(t,r,n)=>{try{Reflect.apply(e,{},[t,r])}catch(e){console.error(e)}n()};t.afterEach(r),s((()=>{t.removeAfterEach(r)}))}export{Z as Bus,Ze as EventChain,Zt as EventProxy,fe as Route,Xt as Router,Ke as cancel,j as clone,Gr as createFox,E as extend,Jr as foxBusKey,zr as foxEventProxyKey,Vr as foxKey,h as isArray,d as isDate,A as isESModule,I as isEqual,y as isFunction,f as isMap,v as isObject,S as isPlainObject,b as isPromise,p as isSet,m as isString,g as isSymbol,rn as onAfterRouteUpdate,tn as onBeforeRouteUpdate,hr as onFoxActivated,fr as onFoxDeactivated,Ne as request,$ as toBoolean,q as toNumber,x as toTypeString,Zr as useBus,en as useEventProxy,Qr as useFox,Yr as useRoute,Xr as useRouter};
package/main.js DELETED
@@ -1,8 +0,0 @@
1
- /*
2
- * @version: 1.0
3
- * @Author: 江成
4
- * @Date: 2021-09-18 09:36:45
5
- */
6
-
7
- import './libs/index.css'
8
- export * from './libs/index.js'