vendor: 4,371 bytes, line 1
1import{M as e,N as t,bt as n,dt as r,et as i,ft as a,gt as o,ht as s,pt as c,v as l}from"./4smVnLCL.js";import{A as u,C as d,D as f,E as p,M as m,T as h,a as g,d as _,f as v,j as y,k as b,m as x,n as S,r as C,t as w,v as T,w as E,x as D}from"./tZmeci-P.js";var O=class extends m{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=v(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),A(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return j(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return j(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof E(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!p(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&M(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||E(this.options.enabled,this.#t)!==E(t.enabled,this.#t)||h(this.options.staleTime,this.#t)!==h(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||E(this.options.enabled,this.#t)!==E(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return P(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(D)),t}#g(){this.#b();let e=h(this.options.staleTime,this.#t);if(x.isServer()||this.#r.isStale||!T(e))return;let t=b(this.#r.dataUpdatedAt,e)+1;this.#d=u.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(x.isServer()||E(this.options.enabled,this.#t)===!1||!T(this.#p)||this.#p===0)&&(this.#f=u.setInterval(()=>{(this.options.refetchIntervalInBackground||y.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(u.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(u.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,f;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&A(e,t),o=i&&M(e,n,t,r);(a||o)&&(l={...l,...g(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:p,errorUpdatedAt:m,status:h}=l;f=l.data;let _=!1;if(t.placeholderData!==void 0&&f===void 0&&h===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,_=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(h=`success`,f=d(i?.data,e,t),u=!0)}if(t.select&&f!==void 0&&!_){if(i&&f===a?.data&&t.select===this.#c)f=this.#l;else try{this.#c=t.select,f=t.select(f),f=d(i?.data,f,t),this.#l=f,this.#s=null}catch(e){this.#s=e}}this.#s&&(p=this.#s,f=this.#l,m=Date.now(),h=`error`);
1let y=l.fetchStatus===`fetching`,b=h===`pending`,x=h===`error`,S=b&&y,C=f!==void 0,w={status:h,fetchStatus:l.fetchStatus,isPending:b,isSuccess:h===`success`,isError:x,isInitialLoading:S,isLoading:S,data:f,dataUpdatedAt:l.dataUpdatedAt,error:p,errorUpdatedAt:m,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:y,isRefetching:y&&!b,isLoadingError:x&&!C,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:x&&C,isStale:N(e,t),refetch:this.refetch,promise:this.#o,isEnabled:E(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=w.data!==void 0,r=w.status===`error`&&!t,i=e=>{r?e.reject(w.error):t&&e.resolve(w.data)},a=()=>{let e=this.#o=w.promise=v();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||w.data!==o.value)&&a();break;case`rejected`:(!r||w.error!==o.reason)&&a()}}return w}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!p(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){_.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function k(e,t){return E(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||E(t.retryOnMount,e)!==!1)}function A(e,t){return k(e,t)||e.state.data!==void 0&&j(e,t,t.refetchOnMount)}function j(e,t,n){if(E(t.enabled,e)!==!1&&h(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&N(e,t)}return!1}function M(e,t,n,r){return(e!==t||E(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&N(e,n)}function N(e,t){return E(t.enabled,e)!==!1&&e.isStaleByTime(h(t.staleTime,e))}function P(e,t){return!p(e.getCurrentResult(),t)}function F(n=``){if(!e())throw Error(`vue-query hooks can only be used inside setup() function or functions that support injection context.`);let r=S(n),i=t(r);if(!i)throw Error(`No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library.`);return i}function I(e,t,u){let d=u||F(),p=l(()=>{let e=t;typeof e==`function`&&(e=e());let n=w(e);typeof n.enabled==`function`&&(n.enabled=n.enabled());let r=d.defaultQueryOptions(n);return r._optimisticResults=d.isRestoring?.value?`isRestoring`:`optimistic`,r}),m=new e(d,p.value),h=p.value.shallow?s(m.getCurrentResult()):a(m.getCurrentResult()),g=()=>{};d.isRestoring&&i(d.isRestoring,e=>{e||(g(),g=m.subscribe(e=>{C(h,e)}))},{immediate:!0});let _=()=>{m.setOptions(p.value),C(h,m.getCurrentResult())};i(p,_),r(()=>{g()});let v=(...e)=>(_(),h.refetch(...e)),y=()=>new Promise((e,t)=>{let n=()=>{},r=()=>{if(p.value.enabled!==!1){m.setOptions(p.value);let r=m.getOptimisticResult(p.value);r.isStale?(n(),m.fetchOptimistic(p.value).then(e,n=>{f(p.value.throwOnError,[n,m.getCurrentQuery()])?t(n):e(m.getCurrentResult())})):(n(),e(r))}};r(),n=i(p,r)});i(()=>h.error,e=>{if(h.isError&&!h.isFetching&&f(p.value.throwOnError,[e,m.getCurrentQuery()]))throw e});let b=p.value.shallow?o(h):c(h),x=n(b);for(let e in h)typeof h[e]==`function`&&(x[e]=h[e]);return x.suspense=y,x.refetch=v,x}export{F as n,O as r,I as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.