vendor: 37,549 bytes, line 1
1var ne=e=>{throw TypeError(e)};var Gt=(e,t,s)=>t.has(e)||ne("Cannot "+s);var i=(e,t,s)=>(Gt(e,t,"read from private field"),s?s.call(e):t.get(e)),l=(e,t,s)=>t.has(e)?ne("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),h=(e,t,s,r)=>(Gt(e,t,"write to private field"),r?r.call(e,s):t.set(e,s),s),f=(e,t,s)=>(Gt(e,t,"access private method"),s);var jt=(e,t,s,r)=>({set _(n){h(e,t,n,s)},get _(){return i(e,t,r)}});import{r as D}from"./vendor-react-BrVvBVVj.js";import{j as ke}from"./vendor-ui-Cm0SRr07.js";var Dt=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Mt=typeof window>"u"||"Deno"in globalThis;function L(){}function He(e,t){return typeof e=="function"?e(t):e}function Nt(e){return typeof e=="number"&&e>=0&&e!==1/0}function Se(e,t){return Math.max(e+(t||0)-Date.now(),0)}function pt(e,t){return typeof e=="function"?e(t):e}function G(e,t){return typeof e=="function"?e(t):e}function ae(e,t){const{type:s="all",exact:r,fetchStatus:n,predicate:o,queryKey:u,stale:a}=e;if(u){if(r){if(t.queryHash!==se(u,t.options))return!1}else if(!Tt(t.queryKey,u))return!1}if(s!=="all"){const d=t.isActive();if(s==="active"&&!d||s==="inactive"&&d)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||n&&n!==t.state.fetchStatus||o&&!o(t))}function ue(e,t){const{exact:s,status:r,predicate:n,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(s){if(yt(t.options.mutationKey)!==yt(o))return!1}else if(!Tt(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||n&&!n(t))}function se(e,t){return((t==null?void 0:t.queryKeyHashFn)||yt)(e)}function yt(e){return JSON.stringify(e,(t,s)=>_t(s)?Object.keys(s).sort().reduce((r,n)=>(r[n]=s[n],r),{}):s)}function Tt(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(s=>!Tt(e[s],t[s])):!1}function Pe(e,t){if(e===t)return e;const s=he(e)&&he(t);if(s||_t(e)&&_t(t)){const r=s?e:Object.keys(e),n=r.length,o=s?t:Object.keys(t),u=o.length,a=s?[]:{};let d=0;for(let b=0;b<u;b++){const y=s?b:o[b];(!s&&r.includes(y)||s)&&e[y]===void 0&&t[y]===void 0?(a[y]=void 0,d++):(a[y]=Pe(e[y],t[y]),a[y]===e[y]&&e[y]!==void 0&&d++)}return n===u&&d===n?e:a}return t}function kt(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e)if(e[s]!==t[s])return!1;return!0}function he(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function _t(e){if(!oe(e))return!1;const t=e.constructor;if(t===void 0)return!0;const s=t.prototype;return!(!oe(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function oe(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ge(e){return new Promise(t=>{setTimeout(t,e)})}function zt(e,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,t):s.structuralSharing!==!1?Pe(e,t):t}function Be(e,t,s=0){const r=[...e,t];return s&&r.length>s?r.slice(1):r}function Ne(e,t,s=0){const r=[t,...e];return s&&r.length>s?r.slice(0,-1):r}var Fe=Symbol();function Ee(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Fe?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var ut,Z,mt,ye,_e=(ye=class extends Dt{constructor(){super();l(this,ut);l(this,Z);l(this,mt);h(this,mt,t=>{if(!Mt&&window.addEventListener){const s=()=>t();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){i(this,Z)||this.setEventListener(i(this,mt))}onUnsubscribe(){var t;this.hasListeners()||((t=i(this,Z))==null||t.call(this),h(this,Z,void 0))}setEventListener(t){var s;h(this,mt,t),(s=i(this,Z))==null||s.call(this),h(this,Z,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){i(this,ut)!==t&&(h(this,ut,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(s=>{s(t)})}isFocused(){var t;return typeof i(this,ut)=="boolean"?i(this,ut):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ut=new WeakMap,Z=new WeakMap,mt=new WeakMap,ye),ie=new _e,vt,tt,bt,pe,ze=(pe=class extends Dt{constructor(){super();l(this,vt,!0);l(this,tt);l(this,bt);h(this,bt,t=>{if(!Mt&&window.addEventListener){const s=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",r)}}})}onSubscribe(){i(this,tt)||this.setEventListener(i(this,bt))}onUnsubscribe(){var t;this.hasListeners()||((t=i(this,tt))==null||t.call(this),h(this,tt,void 0))}setEventListener(t){var s;h(this,bt,t),(s=i(this,tt))==null||s.call(this),h(this,tt,t(this.setOnline.bind(this)))}setOnline(t){i(this,vt)!==t&&(h(this,vt,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return i(this,vt)}},vt=new WeakMap,tt=new WeakMap,bt=new WeakMap,pe),Ht=new ze;function Ve(e){return Math.min(1e3*2**e,3e4)}function Qe(e){return(e??"online")==="online"?Ht.isOnline():!0}var Me=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Bt(e){return e instanceof Me}function De(e){let t=!1,s=0,r=!1,n,o,u;const a=new Promise((w,R)=>{o=w,u=R}),d=w=>{var R;r||(E(new Me(w)),(R=e.abort)==null||R.call(e))},b=()=>{t=!0},y=()=>{t=!1},c=()=>ie.isFocused()&&(e.networkMode==="always"||Ht.isOnline())&&e.canRun(),g=()=>Qe(e.networkMode)&&e.canRun(),C=w=>{var R;r||(r=!0,(R=e.onSuccess)==null||R.call(e,w),n==null||n(),o(w))},E=w=>{var R;r||(r=!0,(R=e.onError)==null||R.call(e,w),n==null||n(),u(w))},P=()=>new Promise(w=>{var R;n=O=>{(r||c())&&w(O)},(R=e.onPause)==null||R.call(e)}).then(()=>{var w;n=void 0,r||(w=e.onContinue)==null||w.call(e)}),F=()=>{if(r)return;let w;const R=s===0?e.initialPromise:void 0;try{w=R??e.fn()}catch(O){w=Promise.reject(O)}Promise.resolve(w).then(C).catch(O=>{var m;if(r)return;const Q=e.retry??(Mt?0:3),T=e.retryDelay??Ve,B=typeof T=="function"?T(s,O):T,W=Q===!0||typeof Q=="number"&&s<Q||typeof Q=="function"&&Q(s,O);if(t||!W){E(O);return}s++,(m=e.onFail)==null||m.call(e,s,O),Ge(B).then(()=>c()?void 0:P()).then(()=>{t?E(O):F()})})};return{promise:a,cancel:d,continue:()=>(n==null||n(),a),cancelRetry:b,continueRetry:y,canStart:g,start:()=>(g()?F():P().then(F),a)}}function We(){let e=[],t=0,s=a=>{a()},r=a=>{a()},n=a=>setTimeout(a,0);const o=a=>{t?e.push(a):n(()=>{s(a)})},u=()=>{const a=e;e=[],a.length&&n(()=>{r(()=>{a.forEach(d=>{s(d)})})})};return{batch:a=>{let d;t++;try{d=a()}finally{t--,t||u()}return d},batchCalls:a=>(...d)=>{o(()=>{a(...d)})},schedule:o,setNotifyFunction:a=>{s=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{n=a}}}var M=We(),ht,me,Ae=(me=class{constructor(){l(this,ht)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Nt(this.gcTime)&&h(this,ht,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Mt?1/0:5*60*1e3))}clearGcTimeout(){i(this,ht)&&(clearTimeout(i(this,ht)),h(this,ht,void 0))}},ht=new WeakMap,me),gt,Ot,K,A,It,ot,H,$,ve,$e=(ve=class extends Ae{constructor(t){super();l(this,H);l(this,gt);l(this,Ot);l(this,K);l(this,A);l(this,It);l(this,ot);h(this,ot,!1),h(this,It,t.defaultOptions),this.setOptions(t.options),this.observers=[],h(this,K,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,h(this,gt,Je(this.options)),this.state=t.state??i(this,gt),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=i(this,A))==null?void 0:t.promise}setOptions(t){this.options={...i(this,It),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&i(this,K).remove(this)}setData(t,s){const r=zt(this.state.data,t,this.options);return f(this,H,$).call(this,{data:r,type:"success",dataUpdatedAt:s==null?void 0:s.updatedAt,manual:s==null?void 0:s.manual}),r}setState(t,s){f(this,H,$).call(this,{type:"setState",state:t,setStateOptions:s})}cancel(t){var r,n;const s=(r=i(this,A))==null?void 0:r.promise;return(n=i(this,A))==null||n.cancel(t),s?s.then(L).catch(L):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(i(this,gt))}isActive(){return this.observers.some(t=>G(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!Se(this.state.dataUpdatedAt,t)}onFocus(){var s;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(s=i(this,A))==null||s.continue()}onOnline(){var s;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(s=i(this,A))==null||s.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),i(this,K).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(s=>s!==t),this.observers.length||(i(this,A)&&(i(this,ot)?i(this,A).cancel({revert:!0}):i(this,A).cancelRetry()),this.scheduleGc()),i(this,K).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||f(this,H,$).call(this,{type:"invalidate"})}fetch(t,s){var d,b,y;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(s!=null&&s.cancelRefetch))this.cancel({silent:!0});else if(i(this,A))return i(this,A).continueRetry(),i(this,A).promise}if(t&&this.setOptions(t),!this.options.queryFn){const c=this.observers.find(g=>g.options.queryFn);c&&this.setOptions(c.options)}const r=new AbortController,n=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(h(this,ot,!0),r.signal)})},o=()=>{const c=Ee(this.options,s),g={queryKey:this.queryKey,meta:this.meta};return n(g),h(this,ot,!1),this.options.persister?this.options.persister(c,g,this):c(g)},u={fetchOptions:s,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};n(u),(d=this.options.behavior)==null||d.onFetch(u,this),h(this,Ot,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((b=u.fetchOptions)==null?void 0:b.meta))&&f(this,H,$).call(this,{type:"fetch",meta:(y=u.fetchOptions)==null?void 0:y.meta});const a=c=>{var g,C,E,P;Bt(c)&&c.silent||f(this,H,$).call(this,{type:"error",error:c}),Bt(c)||((C=(g=i(this,K).config).onError)==null||C.call(g,c,this),(P=(E=i(this,K).config).onSettled)==null||P.call(E,this.state.data,c,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return h(this,A,De({initialPromise:s==null?void 0:s.initialPromise,fn:u.fetchFn,abort:r.abort.bind(r),onSuccess:c=>{var g,C,E,P;if(c===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(c)}catch(F){a(F);return}(C=(g=i(this,K).config).onSuccess)==null||C.call(g,c,this),(P=(E=i(this,K).config).onSettled)==null||P.call(E,c,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:a,onFail:(c,g)=>{f(this,H,$).call(this,{type:"failed",failureCount:c,error:g})},onPause:()=>{f(this,H,$).call(this,{type:"pause"})},onContinue:()=>{f(this,H,$).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0})),i(this,A).start()}},gt=new WeakMap,Ot=new WeakMap,K=new WeakMap,A=new WeakMap,It=new WeakMap,ot=new WeakMap,H=new WeakSet,$=function(t){const s=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Te(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const n=t.error;return Bt(n)&&n.revert&&i(this,Ot)?{...i(this,Ot),fetchStatus:"idle"}:{...r,error:n,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=s(this.state),M.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),i(this,K).notify({query:this,type:"updated",action:t})})},ve);function Te(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Qe(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Je(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,s=t!==void 0,r=s?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var N,be,Xe=(be=class extends Dt{constructor(t={}){super();l(this,N);this.config=t,h(this,N,new Map)}build(t,s,r){const n=s.queryKey,o=s.queryHash??se(n,s);let u=this.get(o);return u||(u=new $e({cache:this,queryKey:n,queryHash:o,options:t.defaultQueryOptions(s),state:r,defaultOptions:t.getQueryDefaults(n)}),this.add(u)),u}add(t){i(this,N).has(t.queryHash)||(i(this,N).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const s=i(this,N).get(t.queryHash);s&&(t.destroy(),s===t&&i(this,N).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){M.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return i(this,N).get(t)}getAll(){return[...i(this,N).values()]}find(t){const s={exact:!0,...t};return this.getAll().find(r=>ae(s,r))}findAll(t={}){const s=this.getAll();return Object.keys(t).length>0?s.filter(r=>ae(t,r)):s}notify(t){M.batch(()=>{this.listeners.forEach(s=>{s(t)})})}onFocus(){M.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){M.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},N=new WeakMap,be),_,I,ct,z,Y,ge,Ye=(ge=class extends Ae{constructor(t){super();l(this,z);l(this,_);l(this,I);l(this,ct);this.mutationId=t.mutationId,h(this,I,t.mutationCache),h(this,_,[]),this.state=t.state||Ie(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){i(this,_).includes(t)||(i(this,_).push(t),this.clearGcTimeout(),i(this,I).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){h(this,_,i(this,_).filter(s=>s!==t)),this.scheduleGc(),i(this,I).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){i(this,_).length||(this.state.status==="pending"?this.scheduleGc():i(this,I).remove(this))}continue(){var t;return((t=i(this,ct))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var n,o,u,a,d,b,y,c,g,C,E,P,F,w,R,O,Q,T,B,W;h(this,ct,De({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(m,k)=>{f(this,z,Y).call(this,{type:"failed",failureCount:m,error:k})},onPause:()=>{f(this,z,Y).call(this,{type:"pause"})},onContinue:()=>{f(this,z,Y).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>i(this,I).canRun(this)}));const s=this.state.status==="pending",r=!i(this,ct).canStart();try{if(!s){f(this,z,Y).call(this,{type:"pending",variables:t,isPaused:r}),await((o=(n=i(this,I).config).onMutate)==null?void 0:o.call(n,t,this));const k=await((a=(u=this.options).onMutate)==null?void 0:a.call(u,t));k!==this.state.context&&f(this,z,Y).call(this,{type:"pending",context:k,variables:t,isPaused:r})}const m=await i(this,ct).start();return await((b=(d=i(this,I).config).onSuccess)==null?void 0:b.call(d,m,t,this.state.context,this)),await((c=(y=this.options).onSuccess)==null?void 0:c.call(y,m,t,this.state.context)),await((C=(g=i(this,I).config).onSettled)==null?void 0:C.call(g,m,null,this.state.variables,this.state.context,this)),await((P=(E=this.options).onSettled)==null?void 0:P.call(E,m,null,t,this.state.context)),f(this,z,Y).call(this,{type:"success",data:m}),m}catch(m){try{throw await((w=(F=i(this,I).config).onError)==null?void 0:w.call(F,m,t,this.state.context,this)),await((O=(R=this.options).onError)==null?void 0:O.call(R,m,t,this.state.context)),await((T=(Q=i(this,I).config).onSettled)==null?void 0:T.call(Q,void 0,m,this.state.variables,this.state.context,this)),await((W=(B=this.options).onSettled)==null?void 0:W.call(B,void 0,m,t,this.state.context)),m}finally{f(this,z,Y).call(this,{type:"error",error:m})}}finally{i(this,I).runNext(this)}}},_=new WeakMap,I=new WeakMap,ct=new WeakMap,z=new WeakSet,Y=function(t){const s=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=s(this.state),M.batch(()=>{i(this,_).forEach(r=>{r.onMutationUpdate(t)}),i(this,I).notify({mutation:this,type:"updated",action:t})})},ge);function Ie(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var j,qt,Oe,Ze=(Oe=class extends Dt{constructor(t={}){super();l(this,j);l(this,qt);this.config=t,h(this,j,new Map),h(this,qt,Date.now())}build(t,s,r){const n=new Ye({mutationCache:this,mutationId:++jt(this,qt)._,options:t.defaultMutationOptions(s),state:r});return this.add(n),n}add(t){const s=Kt(t),r=i(this,j).get(s)??[];r.push(t),i(this,j).set(s,r),this.notify({type:"added",mutation:t})}remove(t){var r;const s=Kt(t);if(i(this,j).has(s)){const n=(r=i(this,j).get(s))==null?void 0:r.filter(o=>o!==t);n&&(n.length===0?i(this,j).delete(s):i(this,j).set(s,n))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const s=(r=i(this,j).get(Kt(t)))==null?void 0:r.find(n=>n.state.status==="pending");return!s||s===t}runNext(t){var r;const s=(r=i(this,j).get(Kt(t)))==null?void 0:r.find(n=>n!==t&&n.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}clear(){M.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...i(this,j).values()].flat()}find(t){const s={exact:!0,...t};return this.getAll().find(r=>ue(s,r))}findAll(t={}){return this.getAll().filter(s=>ue(t,s))}notify(t){M.batch(()=>{this.listeners.forEach(s=>{s(t)})})}resumePausedMutations(){const t=this.getAll().filter(s=>s.state.isPaused);return M.batch(()=>Promise.all(t.map(s=>s.continue().catch(L))))}},j=new WeakMap,qt=new WeakMap,Oe);function Kt(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function ce(e){return{onFetch:(t,s)=>{var y,c,g,C,E;const r=t.options,n=(g=(c=(y=t.fetchOptions)==null?void 0:y.meta)==null?void 0:c.fetchMore)==null?void 0:g.direction,o=((C=t.state.data)==null?void 0:C.pages)||[],u=((E=t.state.data)==null?void 0:E.pageParams)||[];let a={pages:[],pageParams:[]},d=0;const b=async()=>{let P=!1;const F=O=>{Object.defineProperty(O,"signal",{enumerable:!0,get:()=>(t.signal.aborted?P=!0:t.signal.addEventListener("abort",()=>{P=!0}),t.signal)})},w=Ee(t.options,t.fetchOptions),R=async(O,Q,T)=>{if(P)return Promise.reject();if(Q==null&&O.pages.length)return Promise.resolve(O);const B={queryKey:t.queryKey,pageParam:Q,direction:T?"backward":"forward",meta:t.options.meta};F(B);const W=await w(B),{maxPages:m}=t.options,k=T?Ne:Be;return{pages:k(O.pages,W,m),pageParams:k(O.pageParams,Q,m)}};if(n&&o.length){const O=n==="backward",Q=O?ts:le,T={pages:o,pageParams:u},B=Q(r,T);a=await R(T,B,O)}else{const O=e??o.length;do{const Q=d===0?u[0]??r.initialPageParam:le(r,a);if(d>0&&Q==null)break;a=await R(a,Q),d++}while(d<O)}return a};t.options.persister?t.fetchFn=()=>{var P,F;return(F=(P=t.options).persister)==null?void 0:F.call(P,b,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s)}:t.fetchFn=b}}}function le(e,{pages:t,pageParams:s}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,s[r],s):void 0}function ts(e,{pages:t,pageParams:s}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,s[0],s):void 0}var S,et,st,Ct,wt,it,Rt,St,Ce,Os=(Ce=class{constructor(e={}){l(this,S);l(this,et);l(this,st);l(this,Ct);l(this,wt);l(this,it);l(this,Rt);l(this,St);h(this,S,e.queryCache||new Xe),h(this,et,e.mutationCache||new Ze),h(this,st,e.defaultOptions||{}),h(this,Ct,new Map),h(this,wt,new Map),h(this,it,0)}mount(){jt(this,it)._++,i(this,it)===1&&(h(this,Rt,ie.subscribe(async e=>{e&&(await this.resumePausedMutations(),i(this,S).onFocus())})),h(this,St,Ht.subscribe(async e=>{e&&(await this.resumePausedMutations(),i(this,S).onOnline())})))}unmount(){var e,t;jt(this,it)._--,i(this,it)===0&&((e=i(this,Rt))==null||e.call(this),h(this,Rt,void 0),(t=i(this,St))==null||t.call(this),h(this,St,void 0))}isFetching(e){return i(this,S).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return i(this,et).findAll({...e,status:"pending"}).length}getQueryData(e){var s;const t=this.defaultQueryOptions({queryKey:e});return(s=i(this,S).get(t.queryHash))==null?void 0:s.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const s=this.defaultQueryOptions(e),r=i(this,S).build(this,s);return e.revalidateIfStale&&r.isStaleByTime(pt(s.staleTime,r))&&this.prefetchQuery(s),Promise.resolve(t)}}getQueriesData(e){return i(this,S).findAll(e).map(({queryKey:t,state:s})=>{const r=s.data;return[t,r]})}setQueryData(e,t,s){const r=this.defaultQueryOptions({queryKey:e}),n=i(this,S).get(r.queryHash),o=n==null?void 0:n.state.data,u=He(t,o);if(u!==void 0)return i(this,S).build(this,r).setData(u,{...s,manual:!0})}setQueriesData(e,t,s){return M.batch(()=>i(this,S).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,s)]))}getQueryState(e){var s;const t=this.defaultQueryOptions({queryKey:e});return(s=i(this,S).get(t.queryHash))==null?void 0:s.state}removeQueries(e){const t=i(this,S);M.batch(()=>{t.findAll(e).forEach(s=>{t.remove(s)})})}resetQueries(e,t){const s=i(this,S),r={type:"active",...e};return M.batch(()=>(s.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const s={revert:!0,...t},r=M.batch(()=>i(this,S).findAll(e).map(n=>n.cancel(s)));return Promise.all(r).then(L).catch(L)}invalidateQueries(e={},t={}){return M.batch(()=>{if(i(this,S).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const s={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(s,t)})}refetchQueries(e={},t){const s={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=M.batch(()=>i(this,S).findAll(e).filter(n=>!n.isDisabled()).map(n=>{let o=n.fetch(void 0,s);return s.throwOnError||(o=o.catch(L)),n.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(L)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=i(this,S).build(this,t);return s.isStaleByTime(pt(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(L).catch(L)}fetchInfiniteQuery(e){return e.behavior=ce(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(L).catch(L)}ensureInfiniteQueryData(e){return e.behavior=ce(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Ht.isOnline()?i(this,et).resumePausedMutations():Promise.resolve()}getQueryCache(){return i(this,S)}getMutationCache(){return i(this,et)}getDefaultOptions(){return i(this,st)}setDefaultOptions(e){h(this,st,e)}setQueryDefaults(e,t){i(this,Ct).set(yt(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...i(this,Ct).values()];let s={};return t.forEach(r=>{Tt(e,r.queryKey)&&(s={...s,...r.defaultOptions})}),s}setMutationDefaults(e,t){i(this,wt).set(yt(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...i(this,wt).values()];let s={};return t.forEach(r=>{Tt(e,r.mutationKey)&&(s={...s,...r.defaultOptions})}),s}defaultQueryOptions(e){if(e._defaulted)return e;const t={...i(this,st).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=se(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.enabled!==!0&&t.queryFn===Fe&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...i(this,st).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){i(this,S).clear(),i(this,et).clear()}},S=new WeakMap,et=new WeakMap,st=new WeakMap,Ct=new WeakMap,wt=new WeakMap,it=new WeakMap,Rt=new WeakMap,St=new WeakMap,Ce),x,p,xt,q,lt,Pt,V,Ut,Ft,Et,dt,ft,rt,Qt,v,At,Vt,Wt,$t,Jt,Xt,Yt,Zt,qe,we,es=(we=class extends Dt{constructor(t,s){super();l(this,v);l(this,x);l(this,p);l(this,xt);l(this,q);l(this,lt);l(this,Pt);l(this,V);l(this,Ut);l(this,Ft);l(this,Et);l(this,dt);l(this,ft);l(this,rt);l(this,Qt,new Set);this.options=s,h(this,x,t),h(this,V,null),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(i(this,p).addObserver(this),de(i(this,p),this.options)?f(this,v,At).call(this):this.updateResult(),f(this,v,Jt).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return te(i(this,p),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return te(i(this,p),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,f(this,v,Xt).call(this),f(this,v,Yt).call(this),i(this,p).removeObserver(this)}setOptions(t,s){const r=this.options,n=i(this,p);if(this.options=i(this,x).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof G(this.options.enabled,i(this,p))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");f(this,v,Zt).call(this),i(this,p).setOptions(this.options),r._defaulted&&!kt(this.options,r)&&i(this,x).getQueryCache().notify({type:"observerOptionsUpdated",query:i(this,p),observer:this});const o=this.hasListeners();o&&fe(i(this,p),n,this.options,r)&&f(this,v,At).call(this),this.updateResult(s),o&&(i(this,p)!==n||G(this.options.enabled,i(this,p))!==G(r.enabled,i(this,p))||pt(this.options.staleTime,i(this,p))!==pt(r.staleTime,i(this,p)))&&f(this,v,Vt).call(this);const u=f(this,v,Wt).call(this);o&&(i(this,p)!==n||G(this.options.enabled,i(this,p))!==G(r.enabled,i(this,p))||u!==i(this,rt))&&f(this,v,$t).call(this,u)}getOptimisticResult(t){const s=i(this,x).getQueryCache().build(i(this,x),t),r=this.createResult(s,t);return is(this,r)&&(h(this,q,r),h(this,Pt,this.options),h(this,lt,i(this,p).state)),r}getCurrentResult(){return i(this,q)}trackResult(t,s){const r={};return Object.keys(t).forEach(n=>{Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(n),s==null||s(n),t[n])})}),r}trackProp(t){i(this,Qt).add(t)}getCurrentQuery(){return i(this,p)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const s=i(this,x).defaultQueryOptions(t),r=i(this,x).getQueryCache().build(i(this,x),s);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,s))}fetch(t){return f(this,v,At).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),i(this,q)))}createResult(t,s){var W;const r=i(this,p),n=this.options,o=i(this,q),u=i(this,lt),a=i(this,Pt),b=t!==r?t.state:i(this,xt),{state:y}=t;let c={...y},g=!1,C;if(s._optimisticResults){const m=this.hasListeners(),k=!m&&de(t,s),Le=m&&fe(t,r,s,n);(k||Le)&&(c={...c,...Te(y.data,t.options)}),s._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:E,errorUpdatedAt:P,status:F}=c;if(s.select&&c.data!==void 0)if(o&&c.data===(u==null?void 0:u.data)&&s.select===i(this,Ut))C=i(this,Ft);else try{h(this,Ut,s.select),C=s.select(c.data),C=zt(o==null?void 0:o.data,C,s),h(this,Ft,C),h(this,V,null)}catch(m){h(this,V,m)}else C=c.data;if(s.placeholderData!==void 0&&C===void 0&&F==="pending"){let m;if(o!=null&&o.isPlaceholderData&&s.placeholderData===(a==null?void 0:a.placeholderData))m=o.data;else if(m=typeof s.placeholderData=="function"?s.placeholderData((W=i(this,Et))==null?void 0:W.state.data,i(this,Et)):s.placeholderData,s.select&&m!==void 0)try{m=s.select(m),h(this,V,null)}catch(k){h(this,V,k)}m!==void 0&&(F="success",C=zt(o==null?void 0:o.data,m,s),g=!0)}i(this,V)&&(E=i(this,V),C=i(this,Ft),P=Date.now(),F="error");const w=c.fetchStatus==="fetching",R=F==="pending",O=F==="error",Q=R&&w,T=C!==void 0;return{status:F,fetchStatus:c.fetchStatus,isPending:R,isSuccess:F==="success",isError:O,isInitialLoading:Q,isLoading:Q,data:C,dataUpdatedAt:c.dataUpdatedAt,error:E,errorUpdatedAt:P,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>b.dataUpdateCount||c.errorUpdateCount>b.errorUpdateCount,isFetching:w,isRefetching:w&&!R,isLoadingError:O&&!T,isPaused:c.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:O&&T,isStale:re(t,s),refetch:this.refetch}}updateResult(t){const s=i(this,q),r=this.createResult(i(this,p),this.options);if(h(this,lt,i(this,p).state),h(this,Pt,this.options),i(this,lt).data!==void 0&&h(this,Et,i(this,p)),kt(r,s))return;h(this,q,r);const n={},o=()=>{if(!s)return!0;const{notifyOnChangeProps:u}=this.options,a=typeof u=="function"?u():u;if(a==="all"||!a&&!i(this,Qt).size)return!0;const d=new Set(a??i(this,Qt));return this.options.throwOnError&&d.add("error"),Object.keys(i(this,q)).some(b=>{const y=b;return i(this,q)[y]!==s[y]&&d.has(y)})};(t==null?void 0:t.listeners)!==!1&&o()&&(n.listeners=!0),f(this,v,qe).call(this,{...n,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&f(this,v,Jt).call(this)}},x=new WeakMap,p=new WeakMap,xt=new WeakMap,q=new WeakMap,lt=new WeakMap,Pt=new WeakMap,V=new WeakMap,Ut=new WeakMap,Ft=new WeakMap,Et=new WeakMap,dt=new WeakMap,ft=new WeakMap,rt=new WeakMap,Qt=new WeakMap,v=new WeakSet,At=function(t){f(this,v,Zt).call(this);let s=i(this,p).fetch(this.options,t);return t!=null&&t.throwOnError||(s=s.catch(L)),s},Vt=function(){f(this,v,Xt).call(this);const t=pt(this.options.staleTime,i(this,p));if(Mt||i(this,q).isStale||!Nt(t))return;const r=Se(i(this,q).dataUpdatedAt,t)+1;h(this,dt,setTimeout(()=>{i(this,q).isStale||this.updateResult()},r))},Wt=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(i(this,p)):this.options.refetchInterval)??!1},$t=function(t){f(this,v,Yt).call(this),h(this,rt,t),!(Mt||G(this.options.enabled,i(this,p))===!1||!Nt(i(this,rt))||i(this,rt)===0)&&h(this,ft,setInterval(()=>{(this.options.refetchIntervalInBackground||ie.isFocused())&&f(this,v,At).call(this)},i(this,rt)))},Jt=function(){f(this,v,Vt).call(this),f(this,v,$t).call(this,f(this,v,Wt).call(this))},Xt=function(){i(this,dt)&&(clearTimeout(i(this,dt)),h(this,dt,void 0))},Yt=function(){i(this,ft)&&(clearInterval(i(this,ft)),h(this,ft,void 0))},Zt=function(){const t=i(this,x).getQueryCache().build(i(this,x),this.options);if(t===i(this,p))return;const s=i(this,p);h(this,p,t),h(this,xt,t.state),this.hasListeners()&&(s==null||s.removeObserver(this),t.addObserver(this))},qe=function(t){M.batch(()=>{t.listeners&&this.listeners.forEach(s=>{s(i(this,q))}),i(this,x).getQueryCache().notify({query:i(this,p),type:"observerResultsUpdated"})})},we);function ss(e,t){return G(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function de(e,t){return ss(e,t)||e.state.data!==void 0&&te(e,t,t.refetchOnMount)}function te(e,t,s){if(G(t.enabled,e)!==!1){const r=typeof s=="function"?s(e):s;return r==="always"||r!==!1&&re(e,t)}return!1}function fe(e,t,s,r){return(e!==t||G(r.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&re(e,s)}function re(e,t){return G(t.enabled,e)!==!1&&e.isStaleByTime(pt(t.staleTime,e))}function is(e,t){return!kt(e.getCurrentResult(),t)}var nt,at,U,J,X,Lt,ee,Re,rs=(Re=class extends Dt{constructor(t,s){super();l(this,X);l(this,nt);l(this,at);l(this,U);l(this,J);h(this,nt,t),this.setOptions(s),this.bindMethods(),f(this,X,Lt).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const s=this.options;this.options=i(this,nt).defaultMutationOptions(t),kt(this.options,s)||i(this,nt).getMutationCache().notify({type:"observerOptionsUpdated",mutation:i(this,U),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&yt(s.mutationKey)!==yt(this.options.mutationKey)?this.reset():((r=i(this,U))==null?void 0:r.state.status)==="pending"&&i(this,U).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=i(this,U))==null||t.removeObserver(this)}onMutationUpdate(t){f(this,X,Lt).call(this),f(this,X,ee).call(this,t)}getCurrentResult(){return i(this,at)}reset(){var t;(t=i(this,U))==null||t.removeObserver(this),h(this,U,void 0),f(this,X,Lt).call(this),f(this,X,ee).call(this)}mutate(t,s){var r;return h(this,J,s),(r=i(this,U))==null||r.removeObserver(this),h(this,U,i(this,nt).getMutationCache().build(i(this,nt),this.options)),i(this,U).addObserver(this),i(this,U).execute(t)}},nt=new WeakMap,at=new WeakMap,U=new WeakMap,J=new WeakMap,X=new WeakSet,Lt=function(){var s;const t=((s=i(this,U))==null?void 0:s.state)??Ie();h(this,at,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},ee=function(t){M.batch(()=>{var s,r,n,o,u,a,d,b;if(i(this,J)&&this.hasListeners()){const y=i(this,at).variables,c=i(this,at).context;(t==null?void 0:t.type)==="success"?((r=(s=i(this,J)).onSuccess)==null||r.call(s,t.data,y,c),(o=(n=i(this,J)).onSettled)==null||o.call(n,t.data,null,y,c)):(t==null?void 0:t.type)==="error"&&((a=(u=i(this,J)).onError)==null||a.call(u,t.error,y,c),(b=(d=i(this,J)).onSettled)==null||b.call(d,void 0,t.error,y,c))}this.listeners.forEach(y=>{y(i(this,at))})})},Re),xe=D.createContext(void 0),Ue=e=>{const t=D.useContext(xe);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Cs=({client:e,children:t})=>(D.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),ke.jsx(xe.Provider,{value:e,children:t})),je=D.createContext(!1),ns=()=>D.useContext(je);je.Provider;function as(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var us=D.createContext(as()),hs=()=>D.useContext(us);function Ke(e,t){return typeof e=="function"?e(...t):!!e}function os(){}var cs=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},ls=e=>{D.useEffect(()=>{e.clearReset()},[e])},ds=({result:e,errorResetBoundary:t,throwOnError:s,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&Ke(s,[e.error,r]),fs=e=>{e.suspense&&(typeof e.staleTime!="number"&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},ys=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,ps=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function ms(e,t,s){var b,y,c,g;const r=Ue(),n=ns(),o=hs(),u=r.defaultQueryOptions(e);(y=(b=r.getDefaultOptions().queries)==null?void 0:b._experimental_beforeQuery)==null||y.call(b,u),u._optimisticResults=n?"isRestoring":"optimistic",fs(u),cs(u,o),ls(o);const[a]=D.useState(()=>new t(r,u)),d=a.getOptimisticResult(u);if(D.useSyncExternalStore(D.useCallback(C=>{const E=n?()=>{}:a.subscribe(M.batchCalls(C));return a.updateResult(),E},[a,n]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),D.useEffect(()=>{a.setOptions(u,{listeners:!1})},[u,a]),ys(u,d))throw ps(u,a,o);if(ds({result:d,errorResetBoundary:o,throwOnError:u.throwOnError,query:r.getQueryCache().get(u.queryHash)}))throw d.error;return(g=(c=r.getDefaultOptions().queries)==null?void 0:c._experimental_afterQuery)==null||g.call(c,u,d),u.notifyOnChangeProps?d:a.trackResult(d)}function ws(e,t){return ms(e,es)}function Rs(e,t){const s=Ue(),[r]=D.useState(()=>new rs(s,e));D.useEffect(()=>{r.setOptions(e)},[r,e]);const n=D.useSyncExternalStore(D.useCallback(u=>r.subscribe(M.batchCalls(u)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=D.useCallback((u,a)=>{r.mutate(u,a).catch(os)},[r]);if(n.error&&Ke(r.options.throwOnError,[n.error]))throw n.error;return{...n,mutate:o,mutateAsync:n.mutate}}export{Os as Q,Rs as a,Ue as b,Cs as c,ws 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.