UNPKG

vue-hooks-plus

Version:
1 lines 68.7 kB
var VueHooks_Plus=function(v,c){"use strict";var Hc=Object.defineProperty;var Gc=(v,c,H)=>c in v?Hc(v,c,{enumerable:!0,configurable:!0,writable:!0,value:H}):v[c]=H;var j=(v,c,H)=>(Gc(v,typeof c!="symbol"?c+"":c,H),H);const H=(e,{manual:t,ready:n=!0,refreshDeps:r=[],refreshDepsAction:a})=>{const o=c.ref(!1);return c.watchEffect(()=>{!t&&e.options.refreshDeps!==!0&&(o.value=c.unref(n))}),r instanceof Array?c.watch([o,...r],([s])=>{!s||!t&&s&&(a?a():e.refresh())},{deep:!0,immediate:!1}):c.watch(o,s=>{!t&&s&&(a?a():e.refresh())}),{name:"autoRunPlugin",onBefore:()=>{if(!c.unref(n))return{stopNow:!0}}}};H.onInit=({ready:e=!0,manual:t})=>({loading:!t&&c.unref(e)});const ee=new Map,In=(e,t,n)=>{const r=ee.get(e);r!=null&&r.timer&&clearTimeout(r.timer);let a;t>-1&&(a=setTimeout(()=>{ee.delete(e)},t)),ee.set(e,{...n,timer:a})},Mn=e=>ee.get(e),Fn=e=>{e?(Array.isArray(e)?e:[e]).forEach(n=>ee.delete(n)):ee.clear()},ve=new Map,Nn=e=>ve.get(e),Un=(e,t)=>{ve.set(e,t),t.then(n=>(ve.delete(e),n)).catch(n=>{throw ve.delete(e),n})},W={},xn=[],Bn=(e,t)=>{W[e]&&(W[e].forEach(n=>n(t)),xn.forEach(n=>n({type:e,data:t})))},$e=(e,t)=>(W[e]||(W[e]=[]),W[e].push(t),function(){const r=W[e].indexOf(t);W[e].splice(r,1)}),qn=(e,{cacheKey:t,cacheTime:n=5*60*1e3,staleTime:r=0,setCache:a,getCache:o})=>{const s=c.ref(),i=c.ref(),u=(l,f)=>{a?a(f):In(l,n,f),Bn(l,f.data)},d=(l,f=[])=>o?o(f):Mn(l);return c.watchEffect(()=>{if(!t)return;const l=d(t);l&&Object.hasOwnProperty.call(l,"data")&&(e.state.data=l.data,e.state.params=l.params,(r===-1||new Date().getTime()-l.time<=r)&&(e.state.loading=!1)),s.value=$e(t,f=>{e.setState({data:f})})}),c.onScopeDispose(()=>{var l;(l=s.value)==null||l.call(s)}),t?{name:"cachePlugin",onBefore:l=>{const f=d(t,l);return!f||!Object.hasOwnProperty.call(f,"data")?{}:r===-1||new Date().getTime()-f.time<=r?{loading:!1,data:f==null?void 0:f.data,returnNow:!0}:{data:f==null?void 0:f.data}},onRequest:(l,f)=>{let g=Nn(t);return g&&g!==i.value?{servicePromise:g}:(g=l(...f),i.value=g,Un(t,g),{servicePromise:g})},onSuccess:(l,f)=>{var g;t&&((g=s.value)==null||g.call(s),u(t,{data:l,params:f,time:new Date().getTime()}),s.value=$e(t,h=>{e.setState({data:h})}))},onMutate:l=>{var f;t&&((f=s.value)==null||f.call(s),u(t,{data:l,params:e.state.params,time:new Date().getTime()}),s.value=$e(t,g=>{e.setState({data:g})}))}}:{}};function I(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Hn=typeof global=="object"&&global&&global.Object===Object&&global;const it=Hn;var Gn=typeof self=="object"&&self&&self.Object===Object&&self,zn=it||Gn||Function("return this")();const M=zn;var Wn=function(){return M.Date.now()};const Le=Wn;var Vn=/\s/;function Yn(e){for(var t=e.length;t--&&Vn.test(e.charAt(t)););return t}var Xn=/^\s+/;function Qn(e){return e&&e.slice(0,Yn(e)+1).replace(Xn,"")}var Jn=M.Symbol;const G=Jn;var ut=Object.prototype,kn=ut.hasOwnProperty,Kn=ut.toString,re=G?G.toStringTag:void 0;function Zn(e){var t=kn.call(e,re),n=e[re];try{e[re]=void 0;var r=!0}catch{}var a=Kn.call(e);return r&&(t?e[re]=n:delete e[re]),a}var er=Object.prototype,tr=er.toString;function nr(e){return tr.call(e)}var rr="[object Null]",ar="[object Undefined]",ct=G?G.toStringTag:void 0;function V(e){return e==null?e===void 0?ar:rr:ct&&ct in Object(e)?Zn(e):nr(e)}function F(e){return e!=null&&typeof e=="object"}var sr="[object Symbol]";function or(e){return typeof e=="symbol"||F(e)&&V(e)==sr}var lt=0/0,ir=/^[-+]0x[0-9a-f]+$/i,ur=/^0b[01]+$/i,cr=/^0o[0-7]+$/i,lr=parseInt;function ft(e){if(typeof e=="number")return e;if(or(e))return lt;if(I(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=I(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Qn(e);var n=ur.test(e);return n||cr.test(e)?lr(e.slice(2),n?2:8):ir.test(e)?lt:+e}var fr="Expected a function",dr=Math.max,gr=Math.min;function De(e,t,n){var r,a,o,s,i,u,d=0,l=!1,f=!1,g=!0;if(typeof e!="function")throw new TypeError(fr);t=ft(t)||0,I(n)&&(l=!!n.leading,f="maxWait"in n,o=f?dr(ft(n.maxWait)||0,t):o,g="trailing"in n?!!n.trailing:g);function h(E){var L=r,R=a;return r=a=void 0,d=E,s=e.apply(R,L),s}function w(E){return d=E,i=setTimeout(b,t),l?h(E):s}function m(E){var L=E-u,R=E-d,q=t-L;return f?gr(q,o-R):q}function p(E){var L=E-u,R=E-d;return u===void 0||L>=t||L<0||f&&R>=o}function b(){var E=Le();if(p(E))return T(E);i=setTimeout(b,m(E))}function T(E){return i=void 0,g&&r?h(E):(r=a=void 0,s)}function _(){i!==void 0&&clearTimeout(i),d=0,r=u=a=i=void 0}function S(){return i===void 0?s:T(Le())}function y(){var E=Le(),L=p(E);if(r=arguments,a=this,u=E,L){if(i===void 0)return w(u);if(f)return clearTimeout(i),i=setTimeout(b,t),h(u)}return i===void 0&&(i=setTimeout(b,t)),s}return y.cancel=_,y.flush=S,y}const hr=(e,{debounceWait:t,debounceLeading:n,debounceTrailing:r,debounceMaxWait:a})=>{const o=c.ref(),s=c.computed(()=>{const i={},u=c.unref(n),d=c.unref(r),l=c.unref(a);return u!==void 0&&(i.leading=u),d!==void 0&&(i.trailing=d),l!==void 0&&(i.maxWait=l),i});return c.watchEffect(i=>{if(c.unref(t)){const u=e.runAsync.bind(e);o.value=De(d=>{d()},c.unref(t),s.value),e.runAsync=(...d)=>new Promise((l,f)=>{var g;(g=o.value)==null||g.call(o,()=>{u(...d).then(l).catch(f)})}),i(()=>{var d;(d=o.value)==null||d.cancel(),e.runAsync=u})}}),c.unref(t)?{name:"debouncePlugin",onCancel:()=>{var i;(i=o.value)==null||i.cancel()}}:{}};function mr(e){const n=e.toString().match(/^function\s+([^\s(]+)/);return n?n[1]:""}function vr(e){const t=e.toString(),n=/([a-zA-Z$_][a-zA-Z0-9$_]*)\s*\(/,r=t.match(n);return r?r[1].trim():""}function pr(e){return e==="pending"?16747520:e==="done"?6586111:e==="error"?16724736:e==="cancel"?10500409:e==="mutate"?27647:4873398}class br{constructor(){j(this,"requestInstances",new Map);j(this,"listeners",[])}emit(t){this.listeners.forEach(n=>n(t))}subscribe(t){return this.listeners.push(t),()=>{const n=this.listeners.indexOf(t);this.listeners.splice(n,1)}}insert(t,n){this.requestInstances.set(t,{...n}),this.emit({key:t,...n})}update(t,n){this.has(t)&&this.requestInstances.set(t,{...this.requestInstances.get(t),...n})}has(t){return this.requestInstances.has(t)}reset(t){if(this.requestInstances.has(t)){const n=this.requestInstances.get(t);this.requestInstances.clear(),this.insert(t,n)}else this.requestInstances.clear()}getAll(){return this.requestInstances}}const $=new br,wr=(e,{ready:t=!0,debugKey:n,...r})=>{const a=()=>{if(n&&!$.has(n)){const s=e.serviceRef.value.toString().includes("function")?mr(e.serviceRef.value.toString()):vr(e.serviceRef.value.toString());$.insert(n,{instance:e,requestName:s,time:Date.now()})}},o=c.computed(()=>Object.fromEntries(Object.entries({ready:t,...r}).map(([s,i])=>[s,c.unref(i)])));return c.watchEffect(()=>{n&&$.has(n)&&$.emit({...e,options:{...e.options,...o.value}})}),{name:"devtoolsPlugin",onBefore:s=>{a(),n&&$.has(n)&&$.emit({...e.state,key:n,params:s,loading:!0,time:Date.now(),type:"pending"})},onSuccess(s,i){a(),n&&$.has(n)&&$.emit({...e.state,key:n,data:s,params:i,loading:!1,time:Date.now(),type:"done"})},onCancel(){a(),n&&$.has(n)&&$.emit({...e.state,key:n,loading:!1,time:Date.now(),type:"cancel"})},onError(s,i){a(),n&&$.has(n)&&$.emit({...e.state,key:n,params:i,loading:!1,error:s,time:Date.now(),type:"error"})},onMutate(s){a(),n&&$.has(n)&&$.emit({...e.state,key:n,data:s,loading:!1,time:Date.now(),type:"mutate"})}}},yr=(e,{loadingDelay:t})=>{const n=c.ref(),r=()=>{n.value&&(clearTimeout(c.unref(n.value)),n.value=void 0)};return{name:"loadingDelayPlugin",onFinally:()=>{r();const a=c.unref(t);a&&(e.setState({loading:!0}),n.value=setTimeout(()=>{e.setState({loading:!1})},a))},onError:()=>{r()}}};function Re(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}const Er=!!(typeof window<"u"&&window.document&&window.document.createElement);function je(){return Re()?document.visibilityState!=="hidden":!0}const ae=[];function Tr(e){return ae.push(e),function(){const n=ae.indexOf(e);ae.splice(n,1)}}if(Re()){const e=()=>{if(!!je())for(let t=0;t<ae.length;t++){const n=ae[t];n()}};window.addEventListener("visibilitychange",e,!1)}const Sr=(e,{pollingInterval:t,pollingWhenHidden:n=!0,pollingErrorRetryCount:r=-1})=>{let a;const o=c.ref(),s=c.ref(0),i=()=>{var u;a&&clearTimeout(a),(u=o.value)==null||u.call(o)};return c.watchEffect(()=>{c.unref(t)||i()}),c.unref(t)?{name:"pollingPlugin",onBefore:()=>{i()},onError:()=>{s.value+=1},onSuccess:()=>{s.value=0},onFinally:()=>{r===-1||r!==-1&&s.value<=r?a=setTimeout(()=>{!n&&!je()?o.value=Tr(()=>{e.refresh()}):e.refresh()},c.unref(t)):s.value=0},onCancel:()=>{i()}}:{}};function _r(e,t){let n=!1;return(...r)=>{n||(n=!0,e(...r),setTimeout(()=>{n=!1},t))}}function Or(){return Re()&&typeof navigator.onLine<"u"?navigator.onLine:!0}const se=[];function Pr(e){return se.push(e),function(){const n=se.indexOf(e);n>-1&&se.splice(n,1)}}if(Er){const e=()=>{if(!(!je()||!Or()))for(let t=0;t<se.length;t++){const n=se[t];n()}};window.addEventListener("visibilitychange",e,!1),window.addEventListener("focus",e,!1)}const Ar=(e,{refreshOnWindowFocus:t,focusTimespan:n=5e3})=>{const r=c.ref(),a=()=>{var o;(o=r.value)==null||o.call(r)};return c.watchEffect(o=>{if(c.unref(t)){const s=_r(e.refresh.bind(e),c.unref(n));r.value=Pr(()=>{s()})}o(()=>{a()})}),c.onScopeDispose(()=>{a()}),{name:"refreshOnWindowFocusPlugin"}},$r=(e,{retryInterval:t,retryCount:n})=>{const r=c.ref(),a=c.ref(0),o=c.ref(!1);return n?{name:"retryPlugin",onBefore:()=>{o.value||(a.value=0),o.value=!1,r.value&&clearTimeout(r.value)},onSuccess:()=>{a.value=0},onError:()=>{if(a.value+=1,n===-1||a.value<=n){const s=t!=null?t:Math.min(1e3*2**a.value,3e4);r.value=setTimeout(()=>{o.value=!0,e.refresh()},s)}else a.value=0},onCancel:()=>{a.value=0,r.value&&clearTimeout(r.value)}}:{}};var Lr=Array.isArray;const Y=Lr;function dt(e){return e}var Dr="[object AsyncFunction]",Rr="[object Function]",jr="[object GeneratorFunction]",Cr="[object Proxy]";function Ce(e){if(!I(e))return!1;var t=V(e);return t==Rr||t==jr||t==Dr||t==Cr}var Ir=M["__core-js_shared__"];const Ie=Ir;var gt=function(){var e=/[^.]+$/.exec(Ie&&Ie.keys&&Ie.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Mr(e){return!!gt&&gt in e}var Fr=Function.prototype,Nr=Fr.toString;function X(e){if(e!=null){try{return Nr.call(e)}catch{}try{return e+""}catch{}}return""}var Ur=/[\\^$.*+?()[\]{}|]/g,xr=/^\[object .+?Constructor\]$/,Br=Function.prototype,qr=Object.prototype,Hr=Br.toString,Gr=qr.hasOwnProperty,zr=RegExp("^"+Hr.call(Gr).replace(Ur,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Wr(e){if(!I(e)||Mr(e))return!1;var t=Ce(e)?zr:xr;return t.test(X(e))}function Vr(e,t){return e==null?void 0:e[t]}function Q(e,t){var n=Vr(e,t);return Wr(n)?n:void 0}var Yr=Q(M,"WeakMap");const Me=Yr;var ht=Object.create,Xr=function(){function e(){}return function(t){if(!I(t))return{};if(ht)return ht(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const Qr=Xr;function Jr(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function mt(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var kr=800,Kr=16,Zr=Date.now;function ea(e){var t=0,n=0;return function(){var r=Zr(),a=Kr-(r-n);if(n=r,a>0){if(++t>=kr)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function ta(e){return function(){return e}}var na=function(){try{var e=Q(Object,"defineProperty");return e({},"",{}),e}catch{}}();const pe=na;var ra=pe?function(e,t){return pe(e,"toString",{configurable:!0,enumerable:!1,value:ta(t),writable:!0})}:dt,aa=ea(ra);const sa=aa;function oa(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var ia=9007199254740991,ua=/^(?:0|[1-9]\d*)$/;function vt(e,t){var n=typeof e;return t=t==null?ia:t,!!t&&(n=="number"||n!="symbol"&&ua.test(e))&&e>-1&&e%1==0&&e<t}function Fe(e,t,n){t=="__proto__"&&pe?pe(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function oe(e,t){return e===t||e!==e&&t!==t}var ca=Object.prototype,la=ca.hasOwnProperty;function pt(e,t,n){var r=e[t];(!(la.call(e,t)&&oe(r,n))||n===void 0&&!(t in e))&&Fe(e,t,n)}function ie(e,t,n,r){var a=!n;n||(n={});for(var o=-1,s=t.length;++o<s;){var i=t[o],u=r?r(n[i],e[i],i,n,e):void 0;u===void 0&&(u=e[i]),a?Fe(n,i,u):pt(n,i,u)}return n}var bt=Math.max;function fa(e,t,n){return t=bt(t===void 0?e.length-1:t,0),function(){for(var r=arguments,a=-1,o=bt(r.length-t,0),s=Array(o);++a<o;)s[a]=r[t+a];a=-1;for(var i=Array(t+1);++a<t;)i[a]=r[a];return i[t]=n(s),Jr(e,this,i)}}function da(e,t){return sa(fa(e,t,dt),e+"")}var ga=9007199254740991;function wt(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ga}function be(e){return e!=null&&wt(e.length)&&!Ce(e)}function ha(e,t,n){if(!I(n))return!1;var r=typeof t;return(r=="number"?be(n)&&vt(t,n.length):r=="string"&&t in n)?oe(n[t],e):!1}function ma(e){return da(function(t,n){var r=-1,a=n.length,o=a>1?n[a-1]:void 0,s=a>2?n[2]:void 0;for(o=e.length>3&&typeof o=="function"?(a--,o):void 0,s&&ha(n[0],n[1],s)&&(o=a<3?void 0:o,a=1),t=Object(t);++r<a;){var i=n[r];i&&e(t,i,r,o)}return t})}var va=Object.prototype;function Ne(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||va;return e===n}function pa(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var ba="[object Arguments]";function yt(e){return F(e)&&V(e)==ba}var Et=Object.prototype,wa=Et.hasOwnProperty,ya=Et.propertyIsEnumerable,Ea=yt(function(){return arguments}())?yt:function(e){return F(e)&&wa.call(e,"callee")&&!ya.call(e,"callee")};const Ue=Ea;function Ta(){return!1}var Tt=typeof v=="object"&&v&&!v.nodeType&&v,St=Tt&&typeof module=="object"&&module&&!module.nodeType&&module,Sa=St&&St.exports===Tt,_t=Sa?M.Buffer:void 0,_a=_t?_t.isBuffer:void 0,Oa=_a||Ta;const ue=Oa;var Pa="[object Arguments]",Aa="[object Array]",$a="[object Boolean]",La="[object Date]",Da="[object Error]",Ra="[object Function]",ja="[object Map]",Ca="[object Number]",Ia="[object Object]",Ma="[object RegExp]",Fa="[object Set]",Na="[object String]",Ua="[object WeakMap]",xa="[object ArrayBuffer]",Ba="[object DataView]",qa="[object Float32Array]",Ha="[object Float64Array]",Ga="[object Int8Array]",za="[object Int16Array]",Wa="[object Int32Array]",Va="[object Uint8Array]",Ya="[object Uint8ClampedArray]",Xa="[object Uint16Array]",Qa="[object Uint32Array]",P={};P[qa]=P[Ha]=P[Ga]=P[za]=P[Wa]=P[Va]=P[Ya]=P[Xa]=P[Qa]=!0,P[Pa]=P[Aa]=P[xa]=P[$a]=P[Ba]=P[La]=P[Da]=P[Ra]=P[ja]=P[Ca]=P[Ia]=P[Ma]=P[Fa]=P[Na]=P[Ua]=!1;function Ja(e){return F(e)&&wt(e.length)&&!!P[V(e)]}function xe(e){return function(t){return e(t)}}var Ot=typeof v=="object"&&v&&!v.nodeType&&v,ce=Ot&&typeof module=="object"&&module&&!module.nodeType&&module,ka=ce&&ce.exports===Ot,Be=ka&&it.process,Ka=function(){try{var e=ce&&ce.require&&ce.require("util").types;return e||Be&&Be.binding&&Be.binding("util")}catch{}}();const te=Ka;var Pt=te&&te.isTypedArray,Za=Pt?xe(Pt):Ja;const qe=Za;var es=Object.prototype,ts=es.hasOwnProperty;function At(e,t){var n=Y(e),r=!n&&Ue(e),a=!n&&!r&&ue(e),o=!n&&!r&&!a&&qe(e),s=n||r||a||o,i=s?pa(e.length,String):[],u=i.length;for(var d in e)(t||ts.call(e,d))&&!(s&&(d=="length"||a&&(d=="offset"||d=="parent")||o&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||vt(d,u)))&&i.push(d);return i}function $t(e,t){return function(n){return e(t(n))}}var ns=$t(Object.keys,Object);const rs=ns;var as=Object.prototype,ss=as.hasOwnProperty;function os(e){if(!Ne(e))return rs(e);var t=[];for(var n in Object(e))ss.call(e,n)&&n!="constructor"&&t.push(n);return t}function He(e){return be(e)?At(e):os(e)}function is(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var us=Object.prototype,cs=us.hasOwnProperty;function ls(e){if(!I(e))return is(e);var t=Ne(e),n=[];for(var r in e)r=="constructor"&&(t||!cs.call(e,r))||n.push(r);return n}function le(e){return be(e)?At(e,!0):ls(e)}var fs=Q(Object,"create");const fe=fs;function ds(){this.__data__=fe?fe(null):{},this.size=0}function gs(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var hs="__lodash_hash_undefined__",ms=Object.prototype,vs=ms.hasOwnProperty;function ps(e){var t=this.__data__;if(fe){var n=t[e];return n===hs?void 0:n}return vs.call(t,e)?t[e]:void 0}var bs=Object.prototype,ws=bs.hasOwnProperty;function ys(e){var t=this.__data__;return fe?t[e]!==void 0:ws.call(t,e)}var Es="__lodash_hash_undefined__";function Ts(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=fe&&t===void 0?Es:t,this}function J(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}J.prototype.clear=ds,J.prototype.delete=gs,J.prototype.get=ps,J.prototype.has=ys,J.prototype.set=Ts;function Ss(){this.__data__=[],this.size=0}function we(e,t){for(var n=e.length;n--;)if(oe(e[n][0],t))return n;return-1}var _s=Array.prototype,Os=_s.splice;function Ps(e){var t=this.__data__,n=we(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Os.call(t,n,1),--this.size,!0}function As(e){var t=this.__data__,n=we(t,e);return n<0?void 0:t[n][1]}function $s(e){return we(this.__data__,e)>-1}function Ls(e,t){var n=this.__data__,r=we(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function x(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}x.prototype.clear=Ss,x.prototype.delete=Ps,x.prototype.get=As,x.prototype.has=$s,x.prototype.set=Ls;var Ds=Q(M,"Map");const de=Ds;function Rs(){this.size=0,this.__data__={hash:new J,map:new(de||x),string:new J}}function js(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ye(e,t){var n=e.__data__;return js(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Cs(e){var t=ye(this,e).delete(e);return this.size-=t?1:0,t}function Is(e){return ye(this,e).get(e)}function Ms(e){return ye(this,e).has(e)}function Fs(e,t){var n=ye(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function k(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}k.prototype.clear=Rs,k.prototype.delete=Cs,k.prototype.get=Is,k.prototype.has=Ms,k.prototype.set=Fs;function Lt(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e}var Ns=$t(Object.getPrototypeOf,Object);const Ge=Ns;var Us="[object Object]",xs=Function.prototype,Bs=Object.prototype,Dt=xs.toString,qs=Bs.hasOwnProperty,Hs=Dt.call(Object);function Gs(e){if(!F(e)||V(e)!=Us)return!1;var t=Ge(e);if(t===null)return!0;var n=qs.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Dt.call(n)==Hs}function zs(){this.__data__=new x,this.size=0}function Ws(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Vs(e){return this.__data__.get(e)}function Ys(e){return this.__data__.has(e)}var Xs=200;function Qs(e,t){var n=this.__data__;if(n instanceof x){var r=n.__data__;if(!de||r.length<Xs-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new k(r)}return n.set(e,t),this.size=n.size,this}function N(e){var t=this.__data__=new x(e);this.size=t.size}N.prototype.clear=zs,N.prototype.delete=Ws,N.prototype.get=Vs,N.prototype.has=Ys,N.prototype.set=Qs;function Js(e,t){return e&&ie(t,He(t),e)}function ks(e,t){return e&&ie(t,le(t),e)}var Rt=typeof v=="object"&&v&&!v.nodeType&&v,jt=Rt&&typeof module=="object"&&module&&!module.nodeType&&module,Ks=jt&&jt.exports===Rt,Ct=Ks?M.Buffer:void 0,It=Ct?Ct.allocUnsafe:void 0;function Mt(e,t){if(t)return e.slice();var n=e.length,r=It?It(n):new e.constructor(n);return e.copy(r),r}function Zs(e,t){for(var n=-1,r=e==null?0:e.length,a=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[a++]=s)}return o}function Ft(){return[]}var eo=Object.prototype,to=eo.propertyIsEnumerable,Nt=Object.getOwnPropertySymbols,no=Nt?function(e){return e==null?[]:(e=Object(e),Zs(Nt(e),function(t){return to.call(e,t)}))}:Ft;const ze=no;function ro(e,t){return ie(e,ze(e),t)}var ao=Object.getOwnPropertySymbols,so=ao?function(e){for(var t=[];e;)Lt(t,ze(e)),e=Ge(e);return t}:Ft;const Ut=so;function oo(e,t){return ie(e,Ut(e),t)}function xt(e,t,n){var r=t(e);return Y(e)?r:Lt(r,n(e))}function We(e){return xt(e,He,ze)}function io(e){return xt(e,le,Ut)}var uo=Q(M,"DataView");const Ve=uo;var co=Q(M,"Promise");const Ye=co;var lo=Q(M,"Set");const Xe=lo;var Bt="[object Map]",fo="[object Object]",qt="[object Promise]",Ht="[object Set]",Gt="[object WeakMap]",zt="[object DataView]",go=X(Ve),ho=X(de),mo=X(Ye),vo=X(Xe),po=X(Me),K=V;(Ve&&K(new Ve(new ArrayBuffer(1)))!=zt||de&&K(new de)!=Bt||Ye&&K(Ye.resolve())!=qt||Xe&&K(new Xe)!=Ht||Me&&K(new Me)!=Gt)&&(K=function(e){var t=V(e),n=t==fo?e.constructor:void 0,r=n?X(n):"";if(r)switch(r){case go:return zt;case ho:return Bt;case mo:return qt;case vo:return Ht;case po:return Gt}return t});const ge=K;var bo=Object.prototype,wo=bo.hasOwnProperty;function yo(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&wo.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var Eo=M.Uint8Array;const Ee=Eo;function Qe(e){var t=new e.constructor(e.byteLength);return new Ee(t).set(new Ee(e)),t}function To(e,t){var n=t?Qe(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var So=/\w*$/;function _o(e){var t=new e.constructor(e.source,So.exec(e));return t.lastIndex=e.lastIndex,t}var Wt=G?G.prototype:void 0,Vt=Wt?Wt.valueOf:void 0;function Oo(e){return Vt?Object(Vt.call(e)):{}}function Yt(e,t){var n=t?Qe(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Po="[object Boolean]",Ao="[object Date]",$o="[object Map]",Lo="[object Number]",Do="[object RegExp]",Ro="[object Set]",jo="[object String]",Co="[object Symbol]",Io="[object ArrayBuffer]",Mo="[object DataView]",Fo="[object Float32Array]",No="[object Float64Array]",Uo="[object Int8Array]",xo="[object Int16Array]",Bo="[object Int32Array]",qo="[object Uint8Array]",Ho="[object Uint8ClampedArray]",Go="[object Uint16Array]",zo="[object Uint32Array]";function Wo(e,t,n){var r=e.constructor;switch(t){case Io:return Qe(e);case Po:case Ao:return new r(+e);case Mo:return To(e,n);case Fo:case No:case Uo:case xo:case Bo:case qo:case Ho:case Go:case zo:return Yt(e,n);case $o:return new r;case Lo:case jo:return new r(e);case Do:return _o(e);case Ro:return new r;case Co:return Oo(e)}}function Xt(e){return typeof e.constructor=="function"&&!Ne(e)?Qr(Ge(e)):{}}var Vo="[object Map]";function Yo(e){return F(e)&&ge(e)==Vo}var Qt=te&&te.isMap,Xo=Qt?xe(Qt):Yo;const Qo=Xo;var Jo="[object Set]";function ko(e){return F(e)&&ge(e)==Jo}var Jt=te&&te.isSet,Ko=Jt?xe(Jt):ko;const Zo=Ko;var ei=1,ti=2,ni=4,kt="[object Arguments]",ri="[object Array]",ai="[object Boolean]",si="[object Date]",oi="[object Error]",Kt="[object Function]",ii="[object GeneratorFunction]",ui="[object Map]",ci="[object Number]",Zt="[object Object]",li="[object RegExp]",fi="[object Set]",di="[object String]",gi="[object Symbol]",hi="[object WeakMap]",mi="[object ArrayBuffer]",vi="[object DataView]",pi="[object Float32Array]",bi="[object Float64Array]",wi="[object Int8Array]",yi="[object Int16Array]",Ei="[object Int32Array]",Ti="[object Uint8Array]",Si="[object Uint8ClampedArray]",_i="[object Uint16Array]",Oi="[object Uint32Array]",O={};O[kt]=O[ri]=O[mi]=O[vi]=O[ai]=O[si]=O[pi]=O[bi]=O[wi]=O[yi]=O[Ei]=O[ui]=O[ci]=O[Zt]=O[li]=O[fi]=O[di]=O[gi]=O[Ti]=O[Si]=O[_i]=O[Oi]=!0,O[oi]=O[Kt]=O[hi]=!1;function Te(e,t,n,r,a,o){var s,i=t&ei,u=t&ti,d=t&ni;if(n&&(s=a?n(e,r,a,o):n(e)),s!==void 0)return s;if(!I(e))return e;var l=Y(e);if(l){if(s=yo(e),!i)return mt(e,s)}else{var f=ge(e),g=f==Kt||f==ii;if(ue(e))return Mt(e,i);if(f==Zt||f==kt||g&&!a){if(s=u||g?{}:Xt(e),!i)return u?oo(e,ks(s,e)):ro(e,Js(s,e))}else{if(!O[f])return a?e:{};s=Wo(e,f,i)}}o||(o=new N);var h=o.get(e);if(h)return h;o.set(e,s),Zo(e)?e.forEach(function(p){s.add(Te(p,t,n,p,e,o))}):Qo(e)&&e.forEach(function(p,b){s.set(b,Te(p,t,n,b,e,o))});var w=d?u?io:We:u?le:He,m=l?void 0:w(e);return oa(m||e,function(p,b){m&&(b=p,p=e[b]),pt(s,b,Te(p,t,n,b,e,o))}),s}var Pi=1,Ai=4;function en(e){return Te(e,Pi|Ai)}var $i="__lodash_hash_undefined__";function Li(e){return this.__data__.set(e,$i),this}function Di(e){return this.__data__.has(e)}function Se(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new k;++t<n;)this.add(e[t])}Se.prototype.add=Se.prototype.push=Li,Se.prototype.has=Di;function Ri(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function ji(e,t){return e.has(t)}var Ci=1,Ii=2;function tn(e,t,n,r,a,o){var s=n&Ci,i=e.length,u=t.length;if(i!=u&&!(s&&u>i))return!1;var d=o.get(e),l=o.get(t);if(d&&l)return d==t&&l==e;var f=-1,g=!0,h=n&Ii?new Se:void 0;for(o.set(e,t),o.set(t,e);++f<i;){var w=e[f],m=t[f];if(r)var p=s?r(m,w,f,t,e,o):r(w,m,f,e,t,o);if(p!==void 0){if(p)continue;g=!1;break}if(h){if(!Ri(t,function(b,T){if(!ji(h,T)&&(w===b||a(w,b,n,r,o)))return h.push(T)})){g=!1;break}}else if(!(w===m||a(w,m,n,r,o))){g=!1;break}}return o.delete(e),o.delete(t),g}function Mi(e){var t=-1,n=Array(e.size);return e.forEach(function(r,a){n[++t]=[a,r]}),n}function Fi(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var Ni=1,Ui=2,xi="[object Boolean]",Bi="[object Date]",qi="[object Error]",Hi="[object Map]",Gi="[object Number]",zi="[object RegExp]",Wi="[object Set]",Vi="[object String]",Yi="[object Symbol]",Xi="[object ArrayBuffer]",Qi="[object DataView]",nn=G?G.prototype:void 0,Je=nn?nn.valueOf:void 0;function Ji(e,t,n,r,a,o,s){switch(n){case Qi:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Xi:return!(e.byteLength!=t.byteLength||!o(new Ee(e),new Ee(t)));case xi:case Bi:case Gi:return oe(+e,+t);case qi:return e.name==t.name&&e.message==t.message;case zi:case Vi:return e==t+"";case Hi:var i=Mi;case Wi:var u=r&Ni;if(i||(i=Fi),e.size!=t.size&&!u)return!1;var d=s.get(e);if(d)return d==t;r|=Ui,s.set(e,t);var l=tn(i(e),i(t),r,a,o,s);return s.delete(e),l;case Yi:if(Je)return Je.call(e)==Je.call(t)}return!1}var ki=1,Ki=Object.prototype,Zi=Ki.hasOwnProperty;function eu(e,t,n,r,a,o){var s=n&ki,i=We(e),u=i.length,d=We(t),l=d.length;if(u!=l&&!s)return!1;for(var f=u;f--;){var g=i[f];if(!(s?g in t:Zi.call(t,g)))return!1}var h=o.get(e),w=o.get(t);if(h&&w)return h==t&&w==e;var m=!0;o.set(e,t),o.set(t,e);for(var p=s;++f<u;){g=i[f];var b=e[g],T=t[g];if(r)var _=s?r(T,b,g,t,e,o):r(b,T,g,e,t,o);if(!(_===void 0?b===T||a(b,T,n,r,o):_)){m=!1;break}p||(p=g=="constructor")}if(m&&!p){var S=e.constructor,y=t.constructor;S!=y&&"constructor"in e&&"constructor"in t&&!(typeof S=="function"&&S instanceof S&&typeof y=="function"&&y instanceof y)&&(m=!1)}return o.delete(e),o.delete(t),m}var tu=1,rn="[object Arguments]",an="[object Array]",_e="[object Object]",nu=Object.prototype,sn=nu.hasOwnProperty;function ru(e,t,n,r,a,o){var s=Y(e),i=Y(t),u=s?an:ge(e),d=i?an:ge(t);u=u==rn?_e:u,d=d==rn?_e:d;var l=u==_e,f=d==_e,g=u==d;if(g&&ue(e)){if(!ue(t))return!1;s=!0,l=!1}if(g&&!l)return o||(o=new N),s||qe(e)?tn(e,t,n,r,a,o):Ji(e,t,u,n,r,a,o);if(!(n&tu)){var h=l&&sn.call(e,"__wrapped__"),w=f&&sn.call(t,"__wrapped__");if(h||w){var m=h?e.value():e,p=w?t.value():t;return o||(o=new N),a(m,p,n,r,o)}}return g?(o||(o=new N),eu(e,t,n,r,a,o)):!1}function on(e,t,n,r,a){return e===t?!0:e==null||t==null||!F(e)&&!F(t)?e!==e&&t!==t:ru(e,t,n,r,on,a)}function au(e){return function(t,n,r){for(var a=-1,o=Object(t),s=r(t),i=s.length;i--;){var u=s[e?i:++a];if(n(o[u],u,o)===!1)break}return t}}var su=au();const ou=su;function ke(e,t,n){(n!==void 0&&!oe(e[t],n)||n===void 0&&!(t in e))&&Fe(e,t,n)}function iu(e){return F(e)&&be(e)}function Ke(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function uu(e){return ie(e,le(e))}function cu(e,t,n,r,a,o,s){var i=Ke(e,n),u=Ke(t,n),d=s.get(u);if(d){ke(e,n,d);return}var l=o?o(i,u,n+"",e,t,s):void 0,f=l===void 0;if(f){var g=Y(u),h=!g&&ue(u),w=!g&&!h&&qe(u);l=u,g||h||w?Y(i)?l=i:iu(i)?l=mt(i):h?(f=!1,l=Mt(u,!0)):w?(f=!1,l=Yt(u,!0)):l=[]:Gs(u)||Ue(u)?(l=i,Ue(i)?l=uu(i):(!I(i)||Ce(i))&&(l=Xt(u))):f=!1}f&&(s.set(u,l),a(l,u,r,o,s),s.delete(u)),ke(e,n,l)}function un(e,t,n,r,a){e!==t&&ou(t,function(o,s){if(a||(a=new N),I(o))cu(e,t,s,n,un,r,a);else{var i=r?r(Ke(e,s),o,s+"",e,t,a):void 0;i===void 0&&(i=o),ke(e,s,i)}},le)}function lu(e,t){return on(e,t)}var fu=ma(function(e,t,n){un(e,t,n)});const du=fu;var gu="Expected a function";function cn(e,t,n){var r=!0,a=!0;if(typeof e!="function")throw new TypeError(gu);return I(n)&&(r="leading"in n?!!n.leading:r,a="trailing"in n?!!n.trailing:a),De(e,t,{leading:r,maxWait:t,trailing:a})}const hu=(e,{throttleWait:t,throttleLeading:n,throttleTrailing:r})=>{const a=c.computed(()=>{const s={};return c.unref(n)!==void 0&&(s.leading=c.unref(n)),c.unref(r)!==void 0&&(s.trailing=c.unref(r)),s}),o=c.computed(()=>cn(s=>{s()},c.unref(t),a.value));return c.watchEffect(s=>{if(c.unref(t)){const i=e.runAsync.bind(e);e.runAsync=(...u)=>new Promise((d,l)=>{var f;(f=o.value)==null||f.call(o,()=>{i(...u).then(d).catch(l)})}),s(()=>{var u;e.runAsync=i,(u=o.value)==null||u.cancel()})}}),c.unref(t)?{name:"throttlePlugin",onCancel:()=>{var s;(s=o.value)==null||s.cancel()}}:{}},ln=e=>typeof e=="function",mu=e=>typeof e=="boolean";class vu{constructor(t,n,r,a={}){j(this,"pluginImpls");j(this,"count",0);j(this,"state",{loading:!1,params:void 0,data:void 0,error:void 0});j(this,"previousValidData");this.serviceRef=t,this.options=n,this.setUpdateData=r,this.initState=a,this.state={...this.state,loading:!n.manual,...a}}setState(t={}){this.state={...this.state,...t},this.setUpdateData(this.state)}setData(t,n){console.warn("Please use 'setFetchState' instead of 'setData'"),n instanceof Array?n.forEach(r=>{this.state[r]=t,this.setUpdateData(t,r)}):(this.state[n]=t,this.setUpdateData(t,n))}setFetchState(t,n){n instanceof Array?n.forEach(r=>{this.state[r]=t,this.setUpdateData(t,r)}):(this.state[n]=t,this.setUpdateData(t,n))}runPluginHandler(t,...n){var a,o,s;const r=(s=(o=(a=this.pluginImpls)==null?void 0:a.map(i=>{var u;return(u=i[t])==null?void 0:u.call(i,...n)}))!=null?o:[])==null?void 0:s.filter(Boolean);return Object.assign({},...r)}async runAsync(...t){var s,i,u,d,l,f,g,h,w,m,p;this.count+=1;const n=this.count,{stopNow:r=!1,returnNow:a=!1,...o}=this.runPluginHandler("onBefore",t);if(r)return new Promise(()=>{});if(this.setState({loading:!0,params:t,...o}),a)return Promise.resolve(o.data);try{(i=(s=this.options).onBefore)==null||i.call(s,t)}catch(b){return this.setState({error:b,loading:!1}),(d=(u=this.options).onError)==null||d.call(u,b,t),this.runPluginHandler("onError",b,t),new Promise(()=>{})}try{let{servicePromise:b}=this.runPluginHandler("onRequest",this.serviceRef.value,t);const T=S=>{var E,L,R,q;if(n!==this.count)return new Promise(()=>{});const y=this.options.formatResult?this.options.formatResult(S):S;return this.setState({data:y,error:void 0,loading:!1}),(L=(E=this.options).onSuccess)==null||L.call(E,y,t),this.runPluginHandler("onSuccess",y,t),this.previousValidData=y,(q=(R=this.options).onFinally)==null||q.call(R,t,y,void 0),n===this.count&&this.runPluginHandler("onFinally",t,y,void 0),y};b||(b=this.serviceRef.value(...t));const _=await b;return T(_)}catch(b){if(n!==this.count)return new Promise(()=>{});throw this.setState({error:b,loading:!1}),(f=(l=this.options).onError)==null||f.call(l,b,t),this.runPluginHandler("onError",b,t),(ln((g=this.options)==null?void 0:g.rollbackOnError)&&((h=this.options)==null?void 0:h.rollbackOnError(t))||mu((w=this.options)==null?void 0:w.rollbackOnError)&&this.options.rollbackOnError)&&this.setState({data:this.previousValidData}),(p=(m=this.options).onFinally)==null||p.call(m,t,void 0,b),n===this.count&&this.runPluginHandler("onFinally",t,void 0,b),b}}run(...t){this.runAsync(...t).catch(n=>{this.options.onError||console.error(n)})}cancel(){this.count+=1,this.setState({loading:!1}),this.runPluginHandler("onCancel")}refresh(){this.run(...this.state.params||[])}refreshAsync(){return this.runAsync(...this.state.params||[])}mutate(t){const n=ln(t)?t(this.state.data):t;this.runPluginHandler("onMutate",n),this.setState({data:n})}}const fn=Symbol("USEREQUEST_GLOBAL_OPTIONS_PROVIDE_KEY");function pu(e){return Object.keys(e).filter(n=>["data","loading","params","error"].includes(n)).length===4}function bu(e,t={},n=[]){const r=c.inject(fn,{}),{initialData:a=void 0,manual:o=!1,ready:s=!0,...i}={...r!=null?r:{},...t!=null?t:{}},u={manual:o,ready:s,initialData:a,...i},d=c.ref(e),l=c.reactive({data:a,loading:!1,params:void 0,error:void 0}),f=(m,p)=>{p?l[p]=m:pu(m)&&(l.data=m.data,l.loading=m.loading,l.error=m.error,l.params=m.params)},g=n.map(m=>{var p;return(p=m==null?void 0:m.onInit)==null?void 0:p.call(m,u)}).filter(Boolean),h=new vu(d,u,f,Object.assign({},...g,l));h.options=u,h.pluginImpls=n.map(m=>m(h,u));const w=c.computed(()=>c.isRef(s)?s.value:s);if(c.watchEffect(()=>{if(!o){const m=h.state.params||t.defaultParams||[];w.value&&h.options.refreshDeps===!0&&!!d.value&&h.run(...m)}}),!o&&h.options.refreshDeps!==!0){const m=h.state.params||t.defaultParams||[];c.unref(s)&&h.run(...m)}return c.onScopeDispose(()=>{h.cancel()}),{...c.toRefs(l),cancel:h.cancel.bind(h),refresh:h.refresh.bind(h),refreshAsync:h.refreshAsync.bind(h),run:h.run.bind(h),runAsync:h.runAsync.bind(h),mutate:h.mutate.bind(h)}}const wu=(e,t)=>function(r,a={},o=[]){let s=e;const i=t||[];for(let u=i.length;u--;)s=i[u](s);return s(r,a,o)};function Ze(e,t,n){const r=[process.env.NODE_ENV==="development"?wr:null,hr,yr,Sr,Ar,hu,H,qn,$r].filter(Boolean);return wu(bu,t==null?void 0:t.use)(e,t,[...n||[],...r])}function yu(e){c.provide(fn,e)}function Eu(){return dn().__VUE_DEVTOOLS_GLOBAL_HOOK__}function dn(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const Tu=typeof Proxy=="function",Su="devtools-plugin:setup",_u="plugin:settings:set";let ne,et;function Ou(){var e;return ne!==void 0||(typeof window<"u"&&window.performance?(ne=!0,et=window.performance):typeof globalThis<"u"&&((e=globalThis.perf_hooks)===null||e===void 0?void 0:e.performance)?(ne=!0,et=globalThis.perf_hooks.performance):ne=!1),ne}function Pu(){return Ou()?et.now():Date.now()}class Au{constructor(t,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=t,this.hook=n;const r={};if(t.settings)for(const s in t.settings){const i=t.settings[s];r[s]=i.defaultValue}const a=`__vue-devtools-plugin-settings__${t.id}`;let o=Object.assign({},r);try{const s=localStorage.getItem(a),i=JSON.parse(s);Object.assign(o,i)}catch{}this.fallbacks={getSettings(){return o},setSettings(s){try{localStorage.setItem(a,JSON.stringify(s))}catch{}o=s},now(){return Pu()}},n&&n.on(_u,(s,i)=>{s===this.plugin.id&&this.fallbacks.setSettings(i)}),this.proxiedOn=new Proxy({},{get:(s,i)=>this.target?this.target.on[i]:(...u)=>{this.onQueue.push({method:i,args:u})}}),this.proxiedTarget=new Proxy({},{get:(s,i)=>this.target?this.target[i]:i==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(i)?(...u)=>(this.targetQueue.push({method:i,args:u,resolve:()=>{}}),this.fallbacks[i](...u)):(...u)=>new Promise(d=>{this.targetQueue.push({method:i,args:u,resolve:d})})})}async setRealTarget(t){this.target=t;for(const n of this.onQueue)this.target.on[n.method](...n.args);for(const n of this.targetQueue)n.resolve(await this.target[n.method](...n.args))}}function $u(e,t){const n=e,r=dn(),a=Eu(),o=Tu&&n.enableEarlyProxy;if(a&&(r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!o))a.emit(Su,e,t);else{const s=o?new Au(n,a):null;(r.__VUE_DEVTOOLS_PLUGINS__=r.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:t,proxy:s}),s&&t(s.proxiedTarget)}}const U="vue-hooks-plus",tt="Vue Hooks Plus \u{1F36D}",Lu="https://raw.githubusercontent.com/InhiblabCore/vue-hooks-plus/c3b984112610ef3fb21140a0beb27b4a228fe0b3/packages/hooks/docs/public/logo.svg";let gn;const Du=new Map;function Ru(e){$u({id:U,label:tt,packageName:"vue-hooks-plus",homepage:"https://inhiblabcore.github.io/docs/hooks",logo:Lu,app:e,settings:{baseSort:{type:"choice",component:"button-group",label:"Sort Cache Entries",options:[{label:"ASC",value:1},{label:"DESC",value:-1}],defaultValue:1}}},t=>{t.addTimelineLayer({id:U,label:tt,color:16767308}),t.addInspector({id:U,label:tt,icon:"api",treeFilterPlaceholder:"Search useRequest",actions:[{icon:"delete",tooltip:"Clear useRequest root ",action:()=>{$.reset(gn),t.sendInspectorTree(U),t.sendInspectorState(U)}}]}),$.subscribe(n=>{$.update(n.key,{time:n.time,type:n.type}),t.sendInspectorTree(U),t.sendInspectorState(U),t.addTimelineEvent({layerId:U,event:{title:n.type,subtitle:`data: ${JSON.stringify(n.data)}`,time:t.now(),data:{...n}}})}),t.on.getInspectorTree(n=>{if(n.inspectorId===U){Du.clear();const r=t.getSettings(),a=$.getAll();let o=[];r.baseSort===1?o=Array.from(a.entries()).sort((i,u)=>{var d,l,f,g;return((l=(d=u[1])==null?void 0:d.time)!=null?l:0)-((g=(f=i[1])==null?void 0:f.time)!=null?g:0)}):o=Array.from(a.entries()).sort((i,u)=>{var d,l,f,g;return((l=(d=i[1])==null?void 0:d.time)!=null?l:0)-((g=(f=u[1])==null?void 0:f.time)!=null?g:0)});const s=o.filter(i=>new RegExp(n.filter,"g").test(i[0])).map(i=>{var u,d,l;return{id:i[0],label:i[0],tags:(u=i[1])!=null&&u.type?[{label:`${(d=i[1])==null?void 0:d.type}`,textColor:16777215,backgroundColor:pr((l=i[1])==null?void 0:l.type)}]:[]}});n.rootNodes=[{id:"vue-hooks-plus-useRequest",label:"useRequest",tags:[{label:"Root",textColor:16777215,backgroundColor:4372611}],children:s!=null?s:[]}]}}),t.on.getInspectorState(n=>{var a,o,s;gn=n.nodeId;let r=0;if(n.inspectorId===U){const i=$.getAll();if(n.nodeId){const u=i.get(n.nodeId);if(!u)return;n.state={Details:[{key:"Key",value:n.nodeId},{key:"Request Name",value:u.requestName}],"Data Explorer":Object.keys(u.instance.state).map(d=>({key:d,value:c.unref(u.instance.state[d])})),Option:Object.keys(u.instance.options).map(d=>({key:d,value:u.instance.options[d]})),["Plugins \u{1F9E9}"]:(s=(o=(a=u.instance.pluginImpls)==null?void 0:a.map((d,l)=>{var g,h,w,m,p,b;const f=(w=(h=(g=u==null?void 0:u.instance)==null?void 0:g.pluginImpls)==null?void 0:h[l])==null?void 0:w.name;return f||l!==r&&r++,{key:f||`plugin ${r}`,value:(b=(p=(m=u==null?void 0:u.instance)==null?void 0:m.pluginImpls)==null?void 0:p[l])!=null?b:null}}))==null?void 0:o.filter(d=>Object.keys(d.value).length!==0))!=null?s:[]}}}})})}const ju={install(e){process.env.NODE_ENV==="development"&&Ru(e)}};function hn(e,t,n){(n==null?void 0:n.immediate)&&e(),c.watchEffect(a=>{if(c.unref(t)===void 0||typeof c.unref(t)!="number"||c.unref(t)<0)return;const o=c.unref(t),s=setTimeout(()=>{e()},o);a(()=>{clearInterval(s)})})}function Cu({task:e,option:t}){const{delay:n=0,onError:r,onReady:a,onSuccess:o}=t!=null?t:{};if(!(e instanceof Array))throw new Error("task must be Array");const s=d=>{r==null||r(d)},i=d=>l=>{s(l),d==null||d({error:l})},u=()=>{var d;(d=Array(...e.keys()))==null||d.reduce((l,f)=>l.then(h=>(h!=null&&h.error||o==null||o(h),new Promise(w=>{var m;(m=e==null?void 0:e[f])==null||m.call(e,w,i(w),f)}))),Promise.resolve())};hn(()=>{a==null||a(),u()},n)}function mn(e=!1,t){const n=c.ref(e),r=c.computed(()=>{const a=t===void 0?!e:t;return{toggle:()=>{n.value=n.value===e?a:e},set:d=>n.value=d,setLeft:()=>n.value=e,setRight:()=>n.value=a}});return[c.shallowReadonly(n),{...r.value}]}function Oe(e=!1){const[t,{set:n,toggle:r}]=mn(e);return[t,{set:o=>n(!!o),setTrue:()=>n(!0),setFalse:()=>n(!1),toggle:r}]}/*! js-cookie v3.0.5 | MIT */function Pe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var Iu={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function nt(e,t){function n(a,o,s){if(!(typeof document>"u")){s=Pe({},t,s),typeof s.expires=="number"&&(s.expires=new Date(Date.now()+s.expires*864e5)),s.expires&&(s.expires=s.expires.toUTCString()),a=encodeURIComponent(a).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var u in s)!s[u]||(i+="; "+u,s[u]!==!0&&(i+="="+s[u].split(";")[0]));return document.cookie=a+"="+e.write(o,a)+i}}function r(a){if(!(typeof document>"u"||arguments.length&&!a)){for(var o=document.cookie?document.cookie.split("; "):[],s={},i=0;i<o.length;i++){var u=o[i].split("="),d=u.slice(1).join("=");try{var l=decodeURIComponent(u[0]);if(s[l]=e.read(d,l),a===l)break}catch{}}return a?s[a]:s}}return Object.create({set:n,get:r,remove:function(a,o){n(a,"",Pe({},o,{expires:-1}))},withAttributes:function(a){return nt(this.converter,Pe({},this.attributes,a))},withConverter:function(a){return nt(Pe({},this.converter,a),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var rt=nt(Iu,{path:"/"});function vn(e){return typeof e=="function"}function Mu(e,t={}){const n=()=>{const o=rt.get(e);return typeof o=="string"?o:vn(t.defaultValue)?t.defaultValue():t.defaultValue},r=c.ref(n()),a=(o,s={})=>{const{defaultValue:i,...u}={...t,...s},d=()=>{const l=vn(o)?o(r.value):o;return l===void 0?rt.remove(e):rt.set(e,l,u),l};r.value=d()};return[c.readonly(r),a]}const Fu=e=>typeof e=="function",Nu=e=>typeof e=="string",he=e=>typeof e=="number";function pn(e,t={}){const{min:n,max:r}=t;let a=e;return he(r)&&(a=Math.min(r,a)),he(n)&&(a=Math.max(n,a)),a}function Uu(e=0,t={}){const{min:n,max:r}=t,a=c.ref(pn(e,{min:n,max:r})),o=l=>{const f=he(l)?l:l(a.value);return a.value=pn(f,{max:r,min:n}),a.value},s=(l=1)=>{o(f=>f+l)},i=(l=1)=>{o(f=>f-l)},u=l=>{o(l)},d=()=>{o(e)};return[c.readonly(a),{inc:s,dec:i,set:u,reset:d}]}function bn(e,t){var a;const n=(a=t==null?void 0:t.wait)!=null?a:1e3,r=De(e,n,t);return{run:r,cancel:r.cancel,flush:r.flush}}function xu(e,t){const n=c.ref(e.value),{run:r}=bn(()=>n.value=e.value,t);return c.watch(e,()=>r(),{deep:!0}),n}const Ae=!!(typeof window<"u"&&window.document&&window.document.createElement);function A(e,t){var r,a;if(!Ae)return;if(!e)return t;let n;return typeof e=="function"?n=e():c.isRef(e)?n=(a=(r=e.value)==null?void 0:r.$el)!=null?a:e.value:n=e,n}function wn(e,t){if(e===t)return!0;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}const Z=(e=>(n,r,a)=>{const o=c.ref(!1),s=c.ref([]),i=c.ref([]),u=c.ref();e(()=>{var f;const l=(Array.isArray(a)?a:[a]).map(g=>A(g));if(!o.value){o.value=!0,s.value=l,i.value=r,u.value=n();return}(l.length!==s.value.length||!wn(l,s.value)||!wn(r,i.value))&&((f=u.value)==null||f.call(u),s.value=l,i.value=r,u.value=n())}),c.onUnmounted(()=>{var d;(d=u.value)==null||d.call(u),o.value=!1})})(c.watchEffect),Bu=(e,t,n={})=>{const r=c.ref(n);Z(()=>{const a=A(t);if(!(a!=null&&a.addEventListener))return;const o=i=>{var u,d,l;(d=(u=r.value).onDragStart)==null||d.call(u,i),(l=i.dataTransfer)==null||l.setData("custom",JSON.stringify(e))},s=i=>{var u,d;(d=(u=r.value).onDragEnd)==null||d.call(u,i)};return a.setAttribute("draggable",`${(n==null?void 0:n.draggable)!==void 0?n==null?void 0:n.draggable:!0}`),a.addEventListener("dragstart",o),a.addEventListener("dragend",s),()=>{a.removeEventListener("dragstart",o),a.removeEventListener("dragend",s)}},[],t)},qu=(e,t={})=>{const n=c.ref(t),r=c.ref();Z(()=>{const a=A(e);if(!(a!=null&&a.addEventListener))return;const o=(f,g)=>{const h=f.getData("text/uri-list"),w=f.getData("custom");if(w&&n.value.onDom){let m=w;try{m=JSON.parse(w)}catch{m=w}n.value.onDom(m,g);return}if(h&&n.value.onUri){n.value.onUri(h,g);return}if(f.files&&f.files.length&&n.value.onFiles){n.value.onFiles(Array.from(f.files),g);return}f.items&&f.items.length&&n.value.onText&&f.items[0].getAsString(m=>{n.value.onText(m,g)})},s=f=>{var g,h;f.preventDefault(),f.stopPropagation(),r.value=f.target,(h=(g=n.value).onDragEnter)==null||h.call(g,f)},i=f=>{var g,h;f.preventDefault(),(h=(g=n.value).onDragOver)==null||h.call(g,f)},u=f=>{var g,h;f.target===r.value&&((h=(g=n.value).onDragLeave)==null||h.call(g,f))},d=f=>{var g,h;f.preventDefault(),o(f.dataTransfer,f),(h=(g=n.value).onDrop)==null||h.call(g,f)},l=f=>{var g,h;o(f.clipboardData,f),(h=(g=n.value).onPaste)==null||h.call(g,f)};return a.addEventListener("dragenter",s),a.addEventListener("dragover",i),a.addEventListener("dragleave",u),a.addEventListener("drop",d),a.addEventListener("paste",l),()=>{a.removeEventListener("dragenter",s),a.removeEventListener("dragover",i),a.removeEventListener("dragleave",u),a.removeEventListener("drop",d),a.removeEventListener("paste",l)}},[],e)};function yn(e){return typeof e=="function"}function En(e){function t(n,r){let a;try{a=e()}catch(l){console.error(l)}const o=l=>r!=null&&r.serializer?r==null?void 0:r.serializer(l):JSON.stringify(l),s=l=>r!=null&&r.deserializer?r==null?void 0:r.deserializer(l):JSON.parse(l);function i(){try{const l=a==null?void 0:a.getItem(c.unref(n));if(l)return s(l)}catch(l){console.error(l)}return yn(r==null?void 0:r.defaultValue)?r==null?void 0:r.defaultValue():r==null?void 0:r.defaultValue}const u=c.ref(i());c.watchEffect(()=>{n&&(u.value=i())});const d=l=>{if(typeof l>"u")u.value=void 0,a==null||a.removeItem(c.unref(n));else if(yn(l)){const f=l(u.value);try{u.value=f,a==null||a.setItem(c.unref(n),o(f))}catch(g){console.error(g)}}else try{u.value=l,a==null||a.setItem(c.unref(n),o(l))}catch(f){console.error(f)}};return[c.readonly(u),d]}return t}const Tn=En(()=>Ae?localStorage:void 0);function Sn(e,t,n){const r=e.map(i=>window.matchMedia(i)),a=()=>{const i=r.findIndex(u=>u.matches);return typeof t[i]<"u"?t[i]:n},o=c.ref(a()),s=()=>{o.value=a()};return c.watchEffect(i=>{r.forEach(u=>{u.addListener(s)}),i(()=>{r.forEach(u=>u.removeListener(s))})}),o}function Hu(){const[e,t]=Tn("dark-mode-enabled"),n=Gu(),r=c.computed(()=>typeof e.value<"u"?e.value:n.value);return c.watchEffect(()=>{const a="[vue-hooks-plus]-dark-mode",o=window.document.body;r.value?o.classList.add(a):o.classList.remove(a)}),[r,t]}function Gu(){return Sn(["(prefers-color-scheme: dark)"],[!0],!1)}const me={},zu=(e,t={})=>{const n=document.querySelector(`script[src="${e}"]`);if(!n){const r=document.createElement("script");return r.src=e,Object.keys(t).forEach(a=>{r[a]=t[a]}),r.setAttribute("data-status","loading"),document.body.appendChild(r),{ref:r,status:"loading"}}return{ref:n,status:n.getAttribute("data-status")||"ready"}},Wu=(e,t={})=>{const n=document.querySelector(`link[href="${e}"]`);if(!n){const r=document.createElement("link");return r.rel="stylesheet",r.href=e,Object.keys(t).forEach(o=>{r[o]=t[o]}),"hideFocus"in r&&r.relList&&(r.rel="preload",r.as="style"),r.setAttribute("data-status","loading"),document.head.appendChild(r),{ref:r,status:"loading"}}return{ref:n,status:n.getAttribute("data-status")||"ready"}};function Vu(e,t){const n=c.ref(e?"loading":"unset"),r=c.ref(),a=c.computed(()=>c.unref(e));return c.watchEffect(o=>{var u,d,l,f;if(!a.value){n.value="unset";return}const s=(d=(u=a.value)==null?void 0:u.replace(/[|#].*$/,""))!=null?d:"";if((t==null?void 0:t.type)==="css"||!(t!=null&&t.type)&&/(^css!|\.css$)/.test(s)){const g=Wu((l=a.value)!=null?l:"",t==null?void 0:t.css);r.value=g.ref,n.value=g.status}else if((t==null?void 0:t.type)==="js"||!(t!=null&&t.type)&&/(^js!|\.js$)/.test(s)){const g=zu((f=a.value)!=null?f:"",t==null?void 0:t.js);r.value=g.ref,n.value=g.status}else console.error("Cannot infer the type of external resource, and please provide a type ('js' | 'css'). Refer to the https://ahooks.js.org/hooks/dom/use-external/#options");if(!r.value)return;a.value&&me[a.value]===void 0?me[a.value]=1:a.value&&(me[a.value]+=1);const i=g=>{var w;const h=g.type==="load"?"ready":"error";(w=r.value)==null||w.setAttribute("data-status",h),n.value=h};r.value.addEventListener("load",i),r.value.addEventListener("error",i),o(()=>{var g,h,w;(g=r.value)==null||g.removeEventListener("load",i),(h=r.value)==null||h.removeEventListener("error",i),a.value&&(me[a.value]-=1),a.value&&me[a.value]===0&&((w=r.value)==null||w.remove()),r.value=void 0})}),c.readonly(n)}function B(e,t,n={}){const r=c.ref(t);Z(()=>{const a=A(n.target,window);if(!(a!=null&&a.addEventListener))return;const o=s=>r.value(s);return a.addEventListener(e,o,{capture:n.capture,once:n.once,passive:n.passive}),()=>{a.removeEventListener(e,o,{capture:n.capture})}},[e,n.capture,n.once,n.passive],n.target)}class _n{constructor(){j(this,"subscriptions",new Map);j(this,"emitEffectCache",new Map);j(this,"useSubscription",(t,n)=>{const r=c.ref();c.watchEffect(a=>{var i,u;r.value=n;function o(d){r.value&&r.value(d)}const s=(u=(i=this.subscriptions)==null?void 0:i.get(t))!=null?u:[];s.push(o),this.subscriptions.set(t,s),this.emitEffect(t),a(()=>{this.subscriptions.delete(t)})})});j(this,"emit",(t,...n)=>{if(typeof t=="string"||typeof t=="number"){const r=this.subscriptions.get(t);r==null||r.forEach(a=>{a==null||a({params:en(n),event:t})}),this.emitEffectCache.set(t,{params:en(n),event:t})}else throw new TypeError("event must be string or number !")});j(this,"emitEffect",t=>{const n=this.emitEffectCache.get(t),r=this.subscriptions.get(t);n&&(r==null||r.forEach(a=>{a==null||a({...n})}))});j(this,"removeListener",t=>{this.subscriptions.delete(t)});j(this,"clear",()=>{this.subscriptions.clear()});this.clear()}}const Yu=new _n;function Xu(e){const t=c.ref(),n=c.computed(()=>e!=null?e:{global:!1});return t.value||(t.value=n.value.global?t.value=Yu:t.value=new _n),c.watchEffect(r=>{r(()=>{var a;return(a=t.value)==null?void 0:a.clear()})}),t.value}const Qu={SVG:"image/svg+xml",ICO:"image/x-icon",GIF:"image/gif",PNG:"image/png"};function Ju(e){const t=c.computed(()=>c.unref(e));c.watchEffect(()=>{var o;if(!t.value)return;const n=(o=t.value)==null?void 0:o.split("."),r=n[n.length-1].toLocaleUpperCase(),a=document.querySelector("link[rel*='icon']")||document.createElement("link");a.type=Qu[r],a.href=t.value,a.rel="shortcut icon",document.getElementsByTagName("head")[0].appendChild(a)})}function ku(e,t){const[n,{set:r}]=Oe(!1),{onFocus:a,onBlur:o,onChange:s}=t||{};return B("focusin",i=>{n.value||(a==null||a(i),s==null||s(!0),r(!0))},{target:e}),B("focusout",i=>{var u,d;n.value&&!((d=(u=i.currentTarget)==null?void 0:u.contains)!=null&&d.call(u,i.relatedTarget))&&(o==nu