PageSourceSearch

https://vizops360.ai/assets/useQuery-B7Md0brC.js

js vizops360.ai collected 2026-10-05 13:50:30 UTC 10,223 bytes, 1 lines download raw bytes

1var pt=e=>{throw TypeError(e)};var Y=(e,t,s)=>t.has(e)||pt("Cannot "+s);var i=(e,t,s)=>(Y(e,t,"read from private field"),s?s.call(e):t.get(e)),p=(e,t,s)=>t.has(e)?pt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),c=(e,t,s,r)=>(Y(e,t,"write to private field"),r?r.call(e,s):t.set(e,s),s),l=(e,t,s)=>(Y(e,t,"access private method"),s);import{ii as Tt,ms as vt,mt as g,ij as Z,mu as B,io as $,mv as q,mw as mt,mx as wt,my as K,mz as Qt,mA as Mt,mB as bt,im as Ot,r as S,ip as Et,gd as xt}from"./index-CpeGhXo5.js";var b,n,A,m,Q,_,y,E,j,P,F,M,x,C,U,a,N,tt,et,st,it,rt,nt,at,Ct,St,_t=(St=class extends Tt{constructor(t,s){super();p(this,a);p(this,b);p(this,n);p(this,A);p(this,m);p(this,Q);p(this,_);p(this,y);p(this,E);p(this,j);p(this,P);p(this,F);p(this,M);p(this,x);p(this,C);p(this,U,new Set);this.options=s,c(this,b,t),c(this,E,null),c(this,y,vt()),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(i(this,n).addObserver(this),Rt(i(this,n),this.options)?l(this,a,N).call(this):this.updateResult(),l(this,a,it).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ot(i(this,n),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ot(i(this,n),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,l(this,a,rt).call(this),l(this,a,nt).call(this),i(this,n).removeObserver(this)}setOptions(t){const s=this.options,r=i(this,n);if(this.options=i(this,b).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof g(this.options.enabled,i(this,n))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");l(this,a,at).call(this),i(this,n).setOptions(this.options),s._defaulted&&!Z(this.options,s)&&i(this,b).getQueryCache().notify({type:"observerOptionsUpdated",query:i(this,n),observer:this});const o=this.hasListeners();o&&gt(i(this,n),r,this.options,s)&&l(this,a,N).call(this),this.updateResult(),o&&(i(this,n)!==r||g(this.options.enabled,i(this,n))!==g(s.enabled,i(this,n))||B(this.options.staleTime,i(this,n))!==B(s.staleTime,i(this,n)))&&l(this,a,tt).call(this);const d=l(this,a,et).call(this);o&&(i(this,n)!==r||g(this.options.enabled,i(this,n))!==g(s.enabled,i(this,n))||d!==i(this,C))&&l(this,a,st).call(this,d)}getOptimisticResult(t){const s=i(this,b).getQueryCache().build(i(this,b),t),r=this.createResult(s,t);return Ft(this,r)&&(c(this,m,r),c(this,_,this.options),c(this,Q,i(this,n).state)),r}getCurrentResult(){return i(this,m)}trackResult(t,s){return new Proxy(t,{get:(r,o)=>(this.trackProp(o),s?.(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&i(this,y).status==="pending"&&i(this,y).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,o))})}trackProp(t){i(this,U).add(t)}getCurrentQuery(){return i(this,n)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const s=i(this,b).defaultQueryOptions(t),r=i(this,b).getQueryCache().build(i(this,b),s);return r.fetch().then(()=>this.createResult(r,s))}fetch(t){return l(this,a,N).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),i(this,m)))}createResult(t,s){const r=i(this,n),o=this.options,d=i(this,m),h=i(this,Q),I=i(this,_),D=t!==r?t.state:i(this,A),{state:v}=t;let u={...v},k=!1,f;if(s._optimisticResults){const R=this.hasListeners(),L=!R&&Rt(t,s),z=R&&gt(t,r,s,o);(L||z)&&(u={...u,...Mt(v.data,t.options)}),s._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:H,errorUpdatedAt:ct,status:w}=u;f=u.data;let ut=!1;
1if(s.placeholderData!==void 0&&f===void 0&&w==="pending"){let R;d?.isPlaceholderData&&s.placeholderData===I?.placeholderData?(R=d.data,ut=!0):R=typeof s.placeholderData=="function"?s.placeholderData(i(this,F)?.state.data,i(this,F)):s.placeholderData,R!==void 0&&(w="success",f=bt(d?.data,R,s),k=!0)}if(s.select&&f!==void 0&&!ut)if(d&&f===h?.data&&s.select===i(this,j))f=i(this,P);else try{c(this,j,s.select),f=s.select(f),f=bt(d?.data,f,s),c(this,P,f),c(this,E,null)}catch(R){c(this,E,R)}i(this,E)&&(H=i(this,E),f=i(this,P),ct=Date.now(),w="error");const G=u.fetchStatus==="fetching",J=w==="pending",X=w==="error",lt=J&&G,dt=f!==void 0,O={status:w,fetchStatus:u.fetchStatus,isPending:J,isSuccess:w==="success",isError:X,isInitialLoading:lt,isLoading:lt,data:f,dataUpdatedAt:u.dataUpdatedAt,error:H,errorUpdatedAt:ct,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:u.dataUpdateCount>D.dataUpdateCount||u.errorUpdateCount>D.errorUpdate
1Count,isFetching:G,isRefetching:G&&!J,isLoadingError:X&&!dt,isPaused:u.fetchStatus==="paused",isPlaceholderData:k,isRefetchError:X&&dt,isStale:ht(t,s),refetch:this.refetch,promise:i(this,y),isEnabled:g(s.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const R=O.data!==void 0,L=O.status==="error"&&!R,z=V=>{L?V.reject(O.error):R&&V.resolve(O.data)},ft=()=>{const V=c(this,y,O.promise=vt());z(V)},W=i(this,y);switch(W.status){case"pending":t.queryHash===r.queryHash&&z(W);break;case"fulfilled":(L||O.data!==W.value)&&ft();break;case"rejected":(!L||O.error!==W.reason)&&ft();break}}return O}updateResult(){const t=i(this,m),s=this.createResult(i(this,n),this.options);if(c(this,Q,i(this,n).state),c(this,_,this.options),i(this,Q).data!==void 0&&c(this,F,i(this,n)),Z(s,t))return;c(this,m,s);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,d=typeof o=="function"?o():o;if(d==="all"||!d&&!i(this,U).size)return!0;const h=new Set(d??i(this,U));return this.options.throwOnError&&h.add("error"),Object.keys(i(this,m)).some(I=>{const T=I;return i(this,m)[T]!==t[T]&&h.has(T)})};l(this,a,Ct).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&l(this,a,it).call(this)}},b=new WeakMap,n=new WeakMap,A=new WeakMap,m=new WeakMap,Q=new WeakMap,_=new WeakMap,y=new WeakMap,E=new WeakMap,j=new WeakMap,P=new WeakMap,F=new WeakMap,M=new WeakMap,x=new WeakMap,C=new WeakMap,U=new WeakMap,a=new WeakSet,N=function(t){l(this,a,at).call(this);let s=i(this,n).fetch(this.options,t);return t?.throwOnError||(s=s.catch($)),s},tt=function(){l(this,a,rt).call(this);const t=B(this.options.staleTime,i(this,n));if(q.isServer()||i(this,m).isStale||!mt(t))return;const r=wt(i(this,m).dataUpdatedAt,t)+1;c(this,M,K.setTimeout(()=>{i(this,m).isStale||this.updateResult()},r))},et=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(i(this,n)):this.options.refetchInterval)??!1},st=function(t){l(this,a,nt).call(this),c(this,C,t),!(q.isServer()||g(this.options.enabled,i(this,n))===!1||!mt(i(this,C))||i(this,C)===0)&&c(this,x,K.setInterval(()=>{(this.options.refetchIntervalInBackground||Qt.isFocused())&&l(this,a,N).call(this)},i(this,C)))},it=function(){l(this,a,tt).call(this),l(this,a,st).call(this,l(this,a,et).call(this))},rt=function(){i(this,M)!==void 0&&(K.clearTimeout(i(this,M)),c(this,M,void 0))},nt=function(){i(this,x)!==void 0&&(K.clearInterval(i(this,x)),c(this,x,void 0))},at=function(){const t=i(this,b).getQueryCache().build(i(this,b),this.options);if(t===i(this,n))return;const s=i(this,n);c(this,n,t),c(this,A,t.state),this.hasListeners()&&(s?.removeObserver(this),t.addObserver(this))},Ct=function(t){Ot.batch(()=>{t.listeners&&this.listeners.forEach(s=>{s(i(this,m))}),i(this,b).getQueryCache().notify({query:i(this,n),type:"observerResultsUpdated"})})},St);function Pt(e,t){return g(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&g(t.retryOnMount,e)===!1)}function Rt(e,t){return Pt(e,t)||e.state.data!==void 0&&ot(e,t,t.refetchOnMount)}function ot(e,t,s){if(g(t.enabled,e)!==!1&&B(t.staleTime,e)!=="static"){const r=typeof s=="function"?s(e):s;return r==="always"||r!==!1&&ht(e,t)}return!1}function gt(e,t,s,r){return(e!==t||g(r.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&ht(e,s)}function ht(e,t){return g(t.enabled,e)!==!1&&e.isStaleByTime(B(t.staleTime,e))}function Ft(e,t){return!Z(e.getCurrentResult(),t)}var It=S.createContext(!1),Ut=()=>S.useContext(It);It.Provider;function Dt(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var kt=S.createContext(Dt()),Lt=()=>S.useContext(kt),Nt=(e,t,s)=>{const r=s?.state.error&&typeof e.throwOnError=="function"?Et(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Bt=e=>{S.useEffect(()=>{e.clearReset()},[e])},At=({result:e,errorResetBoundary:t,throwOnError:s,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||Et(s,[e.error,r])),jt=e=>{if(e.suspense){const s=o=>o==="static"?o:Math.max(o??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...o)=>s(r(...o)):s(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Ht=(e,t)=>
1e.isLoading&&e.isFetching&&!t,zt=(e,t)=>e?.suspense&&t.isPending,yt=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function Wt(e,t,s){const r=Ut(),o=Lt(),d=xt(),h=d.defaultQueryOptions(e);d.getDefaultOptions().queries?._experimental_beforeQuery?.(h);const I=d.getQueryCache().get(h.queryHash),T=e.subscribed!==!1;h._optimisticResults=r?"isRestoring":T?"optimistic":void 0,jt(h),Nt(h,o,I),Bt(o);const D=!d.getQueryCache().get(h.queryHash),[v]=S.useState(()=>new t(d,h)),u=v.getOptimisticResult(h),k=!r&&T;if(S.useSyncExternalStore(S.useCallback(f=>{const H=k?v.subscribe(Ot.batchCalls(f)):$;return v.updateResult(),H},[v,k]),()=>v.getCurrentResult(),()=>v.getCurrentResult()),S.useEffect(()=>{v.setOptions(h)},[h,v]),zt(h,u))throw yt(h,v,o);if(At({result:u,errorResetBoundary:o,throwOnError:h.throwOnError,query:I,suspense:h.suspense}))throw u.error;return d.getDefaultOptions().queries?._experimental_afterQuery?.(h,u),h.experimental_prefetchInRender&&!q.isServer()&&Ht(u,r)&&(D?yt(h,v,o):I?.promise)?.catch($).finally(()=>{v.updateResult()}),h.notifyOnChangeProps?u:v.trackResult(u)}function Jt(e,t){return Wt(e,_t)}export{Jt as u};

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.