@av-pi-studio/web-client 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -0
- package/dist/web/assets/BinaryFallbackViewer-BVnOJSh_.js +2 -0
- package/dist/web/assets/BinaryFallbackViewer-BVnOJSh_.js.map +1 -0
- package/dist/web/assets/BinaryFallbackViewer-CLiNWU_S.css +1 -0
- package/dist/web/assets/ChatPanel-BOR3MYdN.js +3 -0
- package/dist/web/assets/ChatPanel-BOR3MYdN.js.map +1 -0
- package/dist/web/assets/ChatPanel-DW5U4HRf.css +1 -0
- package/dist/web/assets/CodeView-BJb8T6q4.js +2 -0
- package/dist/web/assets/CodeView-BJb8T6q4.js.map +1 -0
- package/dist/web/assets/CodeView-CLRODhB8.css +1 -0
- package/dist/web/assets/DiffView-B4H-yHuX.js +3 -0
- package/dist/web/assets/DiffView-B4H-yHuX.js.map +1 -0
- package/dist/web/assets/DiffView-CRbeRztO.css +1 -0
- package/dist/web/assets/FilePanel-DIInFr3h.css +1 -0
- package/dist/web/assets/FilePanel-lERDJldp.js +3 -0
- package/dist/web/assets/FilePanel-lERDJldp.js.map +1 -0
- package/dist/web/assets/ImageViewer-Cnr0mhRu.js +2 -0
- package/dist/web/assets/ImageViewer-Cnr0mhRu.js.map +1 -0
- package/dist/web/assets/ImageViewer-ijzMsq8H.css +1 -0
- package/dist/web/assets/MarkdownFileViewer-BD5Ri_Fb.css +1 -0
- package/dist/web/assets/MarkdownFileViewer-CDHJBxdH.js +2 -0
- package/dist/web/assets/MarkdownFileViewer-CDHJBxdH.js.map +1 -0
- package/dist/web/assets/TerminalPanel-BQj62G6N.css +1 -0
- package/dist/web/assets/TerminalPanel-cnkK_YF5.js +2 -0
- package/dist/web/assets/TerminalPanel-cnkK_YF5.js.map +1 -0
- package/dist/web/assets/TextViewer-DWYO-J8z.js +2 -0
- package/dist/web/assets/TextViewer-DWYO-J8z.js.map +1 -0
- package/dist/web/assets/VideoViewer-BBuZ4wou.css +1 -0
- package/dist/web/assets/VideoViewer-D2ZnEQoA.js +2 -0
- package/dist/web/assets/VideoViewer-D2ZnEQoA.js.map +1 -0
- package/dist/web/assets/index-DnTTpAX5.js +3 -0
- package/dist/web/assets/index-DnTTpAX5.js.map +1 -0
- package/dist/web/assets/index-DrGTLQo0.css +1 -0
- package/dist/web/assets/markdown-BQwXm0MF.css +1 -0
- package/dist/web/assets/markdown-Biwdm3dP.js +2 -0
- package/dist/web/assets/markdown-Biwdm3dP.js.map +1 -0
- package/dist/web/assets/use-file-download-BpyWNVxA.js +2 -0
- package/dist/web/assets/use-file-download-BpyWNVxA.js.map +1 -0
- package/dist/web/assets/vendor-BFXtRv5b.js +83 -0
- package/dist/web/assets/vendor-BFXtRv5b.js.map +1 -0
- package/dist/web/assets/vendor-dnd-D9kA7FgH.js +6 -0
- package/dist/web/assets/vendor-dnd-D9kA7FgH.js.map +1 -0
- package/dist/web/assets/vendor-highlight-DaTzDdJW.js +5 -0
- package/dist/web/assets/vendor-highlight-DaTzDdJW.js.map +1 -0
- package/dist/web/assets/vendor-icons-DUloQbkI.js +182 -0
- package/dist/web/assets/vendor-icons-DUloQbkI.js.map +1 -0
- package/dist/web/assets/vendor-markdown-CpaoCv-a.js +36 -0
- package/dist/web/assets/vendor-markdown-CpaoCv-a.js.map +1 -0
- package/dist/web/assets/vendor-overlays-Bo99M0pM.js +2 -0
- package/dist/web/assets/vendor-overlays-Bo99M0pM.js.map +1 -0
- package/dist/web/assets/vendor-query-CAh-Aqig.js +2 -0
- package/dist/web/assets/vendor-query-CAh-Aqig.js.map +1 -0
- package/dist/web/assets/vendor-react-BoIQBqDW.js +50 -0
- package/dist/web/assets/vendor-react-BoIQBqDW.js.map +1 -0
- package/dist/web/assets/vendor-terminal-BhzX2_ts.js +10 -0
- package/dist/web/assets/vendor-terminal-BhzX2_ts.js.map +1 -0
- package/dist/web/assets/vendor-terminal-DYP7pi_n.css +32 -0
- package/dist/web/index.html +21 -0
- package/package.json +56 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var Se=s=>{throw TypeError(s)};var Jt=(s,t,e)=>t.has(s)||Se("Cannot "+e);var o=(s,t,e)=>(Jt(s,t,"read from private field"),e?e.call(s):t.get(s)),w=(s,t,e)=>t.has(s)?Se("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),f=(s,t,e,i)=>(Jt(s,t,"write to private field"),i?i.call(s,e):t.set(s,e),e),C=(s,t,e)=>(Jt(s,t,"access private method"),e);var Vt=(s,t,e,i)=>({set _(n){f(s,t,n,e)},get _(){return o(s,t,i)}});import{r as z,j as es,a as ss}from"./vendor-react-BoIQBqDW.js";var qt=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(s){return this.listeners.add(s),this.onSubscribe(),()=>{this.listeners.delete(s),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ht,Y,St,Pe,is=(Pe=class extends qt{constructor(){super();w(this,ht);w(this,Y);w(this,St);f(this,St,t=>{if(typeof window<"u"&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}})}onSubscribe(){o(this,Y)||this.setEventListener(o(this,St))}onUnsubscribe(){var t;this.hasListeners()||((t=o(this,Y))==null||t.call(this),f(this,Y,void 0))}setEventListener(t){var e;f(this,St,t),(e=o(this,Y))==null||e.call(this),f(this,Y,t(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(t){o(this,ht)!==t&&(f(this,ht,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){var t;return typeof o(this,ht)=="boolean"?o(this,ht):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ht=new WeakMap,Y=new WeakMap,St=new WeakMap,Pe),me=new is,ns={setTimeout:(s,t)=>setTimeout(s,t),clearTimeout:s=>clearTimeout(s),setInterval:(s,t)=>setInterval(s,t),clearInterval:s=>clearInterval(s)},tt,fe,_e,rs=(_e=class{constructor(){w(this,tt,ns);w(this,fe,!1)}setTimeoutProvider(s){f(this,tt,s)}setTimeout(s,t){return o(this,tt).setTimeout(s,t)}clearTimeout(s){o(this,tt).clearTimeout(s)}setInterval(s,t){return o(this,tt).setInterval(s,t)}clearInterval(s){o(this,tt).clearInterval(s)}},tt=new WeakMap,fe=new WeakMap,_e),lt=new rs;function os(s){setTimeout(s,0)}var as=typeof window>"u"||"Deno"in globalThis;function U(){}function ls(s,t){return typeof s=="function"?s(t):s}function Yt(s){return typeof s=="number"&&s>=0&&s!==1/0}function qe(s,t){return Math.max(s+(t||0)-Date.now(),0)}function at(s,t){return typeof s=="function"?s(t):s}function q(s,t){return typeof s=="function"?s(t):s}function be(s,t){const{type:e="all",exact:i,fetchStatus:n,predicate:r,queryKey:l,stale:a}=s;if(l){if(i){if(t.queryHash!==pe(l,t.options))return!1}else if(!Dt(t.queryKey,l))return!1}if(e!=="all"){const h=t.isActive();if(e==="active"&&!h||e==="inactive"&&h)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||n&&n!==t.state.fetchStatus||r&&!r(t))}function we(s,t){const{exact:e,status:i,predicate:n,mutationKey:r}=s;if(r){if(!t.options.mutationKey)return!1;if(e){if(zt(t.options.mutationKey)!==zt(r))return!1}else if(!Dt(t.options.mutationKey,r))return!1}return!(i&&t.state.status!==i||n&&!n(t))}function pe(s,t){return((t==null?void 0:t.queryKeyHashFn)||zt)(s)}function zt(s){return JSON.stringify(s,(t,e)=>ee(e)?Object.keys(e).sort().reduce((i,n)=>(i[n]=e[n],i),{}):e)}function Dt(s,t){return s===t?!0:typeof s!=typeof t?!1:s&&t&&typeof s=="object"&&typeof t=="object"?Object.keys(t).every(e=>Dt(s[e],t[e])):!1}var hs=Object.prototype.hasOwnProperty;function We(s,t,e=0){if(s===t)return s;if(e>500)return t;const i=Oe(s)&&Oe(t);if(!i&&!(ee(s)&&ee(t)))return t;const r=(i?s:Object.keys(s)).length,l=i?t:Object.keys(t),a=l.length,h=i?new Array(a):{};let d=0;for(let c=0;c<a;c++){const u=i?c:l[c],m=s[u],g=t[u];if(m===g){h[u]=m,(i?c<r:hs.call(s,u))&&d++;continue}if(m===null||g===null||typeof m!="object"||typeof g!="object"){h[u]=g;continue}const p=We(m,g,e+1);h[u]=p,p===m&&d++}return r===a&&d===r?s:h}function te(s,t){if(!t||Object.keys(s).length!==Object.keys(t).length)return!1;for(const e in s)if(s[e]!==t[e])return!1;return!0}function Oe(s){return Array.isArray(s)&&s.length===Object.keys(s).length}function ee(s){if(!Ee(s))return!1;const t=s.constructor;if(t===void 0)return!0;const e=t.prototype;return!(!Ee(e)||!e.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(s)!==Object.prototype)}function Ee(s){return Object.prototype.toString.call(s)==="[object Object]"}function us(s){return new Promise(t=>{lt.setTimeout(t,s)})}function se(s,t,e){return typeof e.structuralSharing=="function"?e.structuralSharing(s,t):e.structuralSharing!==!1?We(s,t):t}function cs(s,t,e=0){const i=[...s,t];return e&&i.length>e?i.slice(1):i}function ds(s,t,e=0){const i=[t,...s];return e&&i.length>e?i.slice(0,-1):i}var ge=Symbol();function Ne(s,t){return!s.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!s.queryFn||s.queryFn===ge?()=>Promise.reject(new Error(`Missing queryFn: '${s.queryHash}'`)):s.queryFn}function He(s,t){return typeof s=="function"?s(...t):!!s}function fs(s,t,e){let i=!1,n;return Object.defineProperty(s,"signal",{enumerable:!0,get:()=>(n??(n=t()),i||(i=!0,n.aborted?e():n.addEventListener("abort",e,{once:!0})),n)}),s}var Qt=(()=>{let s=()=>as;return{isServer(){return s()},setIsServer(t){s=t}}})();function ie(){let s,t;const e=new Promise((n,r)=>{s=n,t=r});e.status="pending",e.catch(()=>{});function i(n){Object.assign(e,n),delete e.resolve,delete e.reject}return e.resolve=n=>{i({status:"fulfilled",value:n}),s(n)},e.reject=n=>{i({status:"rejected",reason:n}),t(n)},e}var ms=os;function ps(){let s=[],t=0,e=a=>{a()},i=a=>{a()},n=ms;const r=a=>{t?s.push(a):n(()=>{e(a)})},l=()=>{const a=s;s=[],a.length&&n(()=>{i(()=>{a.forEach(h=>{e(h)})})})};return{batch:a=>{let h;t++;try{h=a()}finally{t--,t||l()}return h},batchCalls:a=>(...h)=>{r(()=>{a(...h)})},schedule:r,setNotifyFunction:a=>{e=a},setBatchNotifyFunction:a=>{i=a},setScheduler:a=>{n=a}}}var _=ps(),bt,et,wt,ze,gs=(ze=class extends qt{constructor(){super();w(this,bt,!0);w(this,et);w(this,wt);f(this,wt,t=>{if(typeof window<"u"&&window.addEventListener){const e=()=>t(!0),i=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",i)}}})}onSubscribe(){o(this,et)||this.setEventListener(o(this,wt))}onUnsubscribe(){var t;this.hasListeners()||((t=o(this,et))==null||t.call(this),f(this,et,void 0))}setEventListener(t){var e;f(this,wt,t),(e=o(this,et))==null||e.call(this),f(this,et,t(this.setOnline.bind(this)))}setOnline(t){o(this,bt)!==t&&(f(this,bt,t),this.listeners.forEach(i=>{i(t)}))}isOnline(){return o(this,bt)}},bt=new WeakMap,et=new WeakMap,wt=new WeakMap,ze),Gt=new gs;function ys(s){return Math.min(1e3*2**s,3e4)}function Ve(s){return(s??"online")==="online"?Gt.isOnline():!0}var ne=class extends Error{constructor(s){super("CancelledError"),this.revert=s==null?void 0:s.revert,this.silent=s==null?void 0:s.silent}};function Be(s){let t=!1,e=0,i;const n=ie(),r=()=>n.status!=="pending",l=y=>{var O;if(!r()){const b=new ne(y);m(b),(O=s.onCancel)==null||O.call(s,b)}},a=()=>{t=!0},h=()=>{t=!1},d=()=>me.isFocused()&&(s.networkMode==="always"||Gt.isOnline())&&s.canRun(),c=()=>Ve(s.networkMode)&&s.canRun(),u=y=>{r()||(i==null||i(),n.resolve(y))},m=y=>{r()||(i==null||i(),n.reject(y))},g=()=>new Promise(y=>{var O;i=b=>{(r()||d())&&y(b)},(O=s.onPause)==null||O.call(s)}).then(()=>{var y;i=void 0,r()||(y=s.onContinue)==null||y.call(s)}),p=()=>{if(r())return;let y;const O=e===0?s.initialPromise:void 0;try{y=O??s.fn()}catch(b){y=Promise.reject(b)}Promise.resolve(y).then(u).catch(b=>{var F;if(r())return;const E=s.retry??(Qt.isServer()?0:3),S=s.retryDelay??ys,v=typeof S=="function"?S(e,b):S,T=E===!0||typeof E=="number"&&e<E||typeof E=="function"&&E(e,b);if(t||!T){m(b);return}e++,(F=s.onFail)==null||F.call(s,e,b),us(v).then(()=>d()?void 0:g()).then(()=>{t?m(b):p()})})};return{promise:n,status:()=>n.status,cancel:l,continue:()=>(i==null||i(),n),cancelRetry:a,continueRetry:h,canStart:c,start:()=>(c()?p():g().then(p),n)}}var ut,De,Ge=(De=class{constructor(){w(this,ut)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Yt(this.gcTime)&&f(this,ut,lt.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(s){this.gcTime=Math.max(this.gcTime||0,s??(Qt.isServer()?1/0:300*1e3))}clearGcTimeout(){o(this,ut)!==void 0&&(lt.clearTimeout(o(this,ut)),f(this,ut,void 0))}},ut=new WeakMap,De);function vs(s){return{onFetch:(t,e)=>{var c,u,m,g,p;const i=t.options,n=(m=(u=(c=t.fetchOptions)==null?void 0:c.meta)==null?void 0:u.fetchMore)==null?void 0:m.direction,r=((g=t.state.data)==null?void 0:g.pages)||[],l=((p=t.state.data)==null?void 0:p.pageParams)||[];let a={pages:[],pageParams:[]},h=0;const d=async()=>{let y=!1;const O=S=>{fs(S,()=>t.signal,()=>y=!0)},b=Ne(t.options,t.fetchOptions),E=async(S,v,T)=>{if(y)return Promise.reject(t.signal.reason);if(v==null&&S.pages.length)return Promise.resolve(S);const D=(()=>{const X={client:t.client,queryKey:t.queryKey,pageParam:v,direction:T?"backward":"forward",meta:t.options.meta};return O(X),X})(),x=await b(D),{maxPages:A}=t.options,j=T?ds:cs;return{pages:j(S.pages,x,A),pageParams:j(S.pageParams,v,A)}};if(n&&r.length){const S=n==="backward",v=S?Ss:Ce,T={pages:r,pageParams:l},F=v(i,T);a=await E(T,F,S)}else{const S=s??r.length;do{const v=h===0?l[0]??i.initialPageParam:Ce(i,a);if(h>0&&v==null)break;a=await E(a,v),h++}while(h<S)}return a};t.options.persister?t.fetchFn=()=>{var y,O;return(O=(y=t.options).persister)==null?void 0:O.call(y,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},e)}:t.fetchFn=d}}}function Ce(s,{pages:t,pageParams:e}){const i=t.length-1;return t.length>0?s.getNextPageParam(t[i],t,e[i],e):void 0}function Ss(s,{pages:t,pageParams:e}){var i;return t.length>0?(i=s.getPreviousPageParam)==null?void 0:i.call(s,t[0],t,e[0],e):void 0}var Ot,ct,Et,W,dt,P,jt,ft,K,$e,G,Qe,bs=(Qe=class extends Ge{constructor(t){super();w(this,K);w(this,Ot);w(this,ct);w(this,Et);w(this,W);w(this,dt);w(this,P);w(this,jt);w(this,ft);f(this,ft,!1),f(this,jt,t.defaultOptions),this.setOptions(t.options),this.observers=[],f(this,dt,t.client),f(this,W,o(this,dt).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,f(this,ct,Me(this.options)),this.state=t.state??o(this,ct),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return o(this,Ot)}get promise(){var t;return(t=o(this,P))==null?void 0:t.promise}setOptions(t){if(this.options={...o(this,jt),...t},t!=null&&t._type&&f(this,Ot,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const e=Me(this.options);e.data!==void 0&&(this.setState(Ie(e.data,e.dataUpdatedAt)),f(this,ct,e))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&o(this,W).remove(this)}setData(t,e){const i=se(this.state.data,t,this.options);return C(this,K,G).call(this,{data:i,type:"success",dataUpdatedAt:e==null?void 0:e.updatedAt,manual:e==null?void 0:e.manual}),i}setState(t){C(this,K,G).call(this,{type:"setState",state:t})}cancel(t){var i,n;const e=(i=o(this,P))==null?void 0:i.promise;return(n=o(this,P))==null||n.cancel(t),e?e.then(U).catch(U):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return o(this,ct)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>q(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ge||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>at(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!qe(this.state.dataUpdatedAt,t)}onFocus(){var e;const t=this.observers.find(i=>i.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(e=o(this,P))==null||e.continue()}onOnline(){var e;const t=this.observers.find(i=>i.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(e=o(this,P))==null||e.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),o(this,W).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(o(this,P)&&(o(this,ft)||C(this,K,$e).call(this)?o(this,P).cancel({revert:!0}):o(this,P).cancelRetry()),this.scheduleGc()),o(this,W).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||C(this,K,G).call(this,{type:"invalidate"})}async fetch(t,e){var d,c,u,m,g,p,y,O,b,E,S;if(this.state.fetchStatus!=="idle"&&((d=o(this,P))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(e!=null&&e.cancelRefetch))this.cancel({silent:!0});else if(o(this,P))return o(this,P).continueRetry(),o(this,P).promise}if(t&&this.setOptions(t),!this.options.queryFn){const v=this.observers.find(T=>T.options.queryFn);v&&this.setOptions(v.options)}const i=new AbortController,n=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(f(this,ft,!0),i.signal)})},r=()=>{const v=Ne(this.options,e),F=(()=>{const D={client:o(this,dt),queryKey:this.queryKey,meta:this.meta};return n(D),D})();return f(this,ft,!1),this.options.persister?this.options.persister(v,F,this):v(F)},a=(()=>{const v={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:o(this,dt),state:this.state,fetchFn:r};return n(v),v})(),h=o(this,Ot)==="infinite"?vs(this.options.pages):this.options.behavior;h==null||h.onFetch(a,this),f(this,Et,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=a.fetchOptions)==null?void 0:c.meta))&&C(this,K,G).call(this,{type:"fetch",meta:(u=a.fetchOptions)==null?void 0:u.meta}),f(this,P,Be({initialPromise:e==null?void 0:e.initialPromise,fn:a.fetchFn,onCancel:v=>{v instanceof ne&&v.revert&&this.setState({...o(this,Et),fetchStatus:"idle"}),i.abort()},onFail:(v,T)=>{C(this,K,G).call(this,{type:"failed",failureCount:v,error:T})},onPause:()=>{C(this,K,G).call(this,{type:"pause"})},onContinue:()=>{C(this,K,G).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const v=await o(this,P).start();if(v===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(v),(g=(m=o(this,W).config).onSuccess)==null||g.call(m,v,this),(y=(p=o(this,W).config).onSettled)==null||y.call(p,v,this.state.error,this),v}catch(v){if(v instanceof ne){if(v.silent)return o(this,P).promise;if(v.revert){if(this.state.data===void 0)throw v;return this.state.data}}throw C(this,K,G).call(this,{type:"error",error:v}),(b=(O=o(this,W).config).onError)==null||b.call(O,v,this),(S=(E=o(this,W).config).onSettled)==null||S.call(E,this.state.data,v,this),v}finally{this.scheduleGc()}}},Ot=new WeakMap,ct=new WeakMap,Et=new WeakMap,W=new WeakMap,dt=new WeakMap,P=new WeakMap,jt=new WeakMap,ft=new WeakMap,K=new WeakSet,$e=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},G=function(t){const e=i=>{switch(t.type){case"failed":return{...i,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...Je(i.data,this.options),fetchMeta:t.meta??null};case"success":const n={...i,...Ie(t.data,t.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return f(this,Et,t.manual?n:void 0),n;case"error":const r=t.error;return{...i,error:r,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...t.state}}};this.state=e(this.state),_.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),o(this,W).notify({query:this,type:"updated",action:t})})},Qe);function Je(s,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ve(t.networkMode)?"fetching":"paused",...s===void 0&&{error:null,status:"pending"}}}function Ie(s,t){return{data:s,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Me(s){const t=typeof s.initialData=="function"?s.initialData():s.initialData,e=t!==void 0,i=e?typeof s.initialDataUpdatedAt=="function"?s.initialDataUpdatedAt():s.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:e?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:e?"success":"pending",fetchStatus:"idle"}}var L,I,kt,k,mt,Ct,$,st,Lt,It,Mt,pt,gt,it,xt,M,_t,re,oe,ae,le,he,ue,ce,Xe,je,ws=(je=class extends qt{constructor(t,e){super();w(this,M);w(this,L);w(this,I);w(this,kt);w(this,k);w(this,mt);w(this,Ct);w(this,$);w(this,st);w(this,Lt);w(this,It);w(this,Mt);w(this,pt);w(this,gt);w(this,it);w(this,xt,new Set);this.options=e,f(this,L,t),f(this,st,null),f(this,$,ie()),this.bindMethods(),this.setOptions(e)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(o(this,I).addObserver(this),xe(o(this,I),this.options)?C(this,M,_t).call(this):this.updateResult(),C(this,M,le).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return de(o(this,I),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return de(o(this,I),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,C(this,M,he).call(this),C(this,M,ue).call(this),o(this,I).removeObserver(this)}setOptions(t){const e=this.options,i=o(this,I);if(this.options=o(this,L).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof q(this.options.enabled,o(this,I))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");C(this,M,ce).call(this),o(this,I).setOptions(this.options),e._defaulted&&!te(this.options,e)&&o(this,L).getQueryCache().notify({type:"observerOptionsUpdated",query:o(this,I),observer:this});const n=this.hasListeners();n&&Te(o(this,I),i,this.options,e)&&C(this,M,_t).call(this),this.updateResult(),n&&(o(this,I)!==i||q(this.options.enabled,o(this,I))!==q(e.enabled,o(this,I))||at(this.options.staleTime,o(this,I))!==at(e.staleTime,o(this,I)))&&C(this,M,re).call(this);const r=C(this,M,oe).call(this);n&&(o(this,I)!==i||q(this.options.enabled,o(this,I))!==q(e.enabled,o(this,I))||r!==o(this,it))&&C(this,M,ae).call(this,r)}getOptimisticResult(t){const e=o(this,L).getQueryCache().build(o(this,L),t),i=this.createResult(e,t);return Es(this,i)&&(f(this,k,i),f(this,Ct,this.options),f(this,mt,o(this,I).state)),i}getCurrentResult(){return o(this,k)}trackResult(t,e){return new Proxy(t,{get:(i,n)=>(this.trackProp(n),e==null||e(n),n==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&o(this,$).status==="pending"&&o(this,$).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,n))})}trackProp(t){o(this,xt).add(t)}getCurrentQuery(){return o(this,I)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=o(this,L).defaultQueryOptions(t),i=o(this,L).getQueryCache().build(o(this,L),e);return i.fetch().then(()=>this.createResult(i,e))}fetch(t){return C(this,M,_t).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),o(this,k)))}createResult(t,e){var A;const i=o(this,I),n=this.options,r=o(this,k),l=o(this,mt),a=o(this,Ct),d=t!==i?t.state:o(this,kt),{state:c}=t;let u={...c},m=!1,g;if(e._optimisticResults){const j=this.hasListeners(),X=!j&&xe(t,e),Wt=j&&Te(t,i,e,n);(X||Wt)&&(u={...u,...Je(c.data,t.options)}),e._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:p,errorUpdatedAt:y,status:O}=u;g=u.data;let b=!1;if(e.placeholderData!==void 0&&g===void 0&&O==="pending"){let j;r!=null&&r.isPlaceholderData&&e.placeholderData===(a==null?void 0:a.placeholderData)?(j=r.data,b=!0):j=typeof e.placeholderData=="function"?e.placeholderData((A=o(this,Mt))==null?void 0:A.state.data,o(this,Mt)):e.placeholderData,j!==void 0&&(O="success",g=se(r==null?void 0:r.data,j,e),m=!0)}if(e.select&&g!==void 0&&!b)if(r&&g===(l==null?void 0:l.data)&&e.select===o(this,Lt))g=o(this,It);else try{f(this,Lt,e.select),g=e.select(g),g=se(r==null?void 0:r.data,g,e),f(this,It,g),f(this,st,null)}catch(j){f(this,st,j)}o(this,st)&&(p=o(this,st),g=o(this,It),y=Date.now(),O="error");const E=u.fetchStatus==="fetching",S=O==="pending",v=O==="error",T=S&&E,F=g!==void 0,x={status:O,fetchStatus:u.fetchStatus,isPending:S,isSuccess:O==="success",isError:v,isInitialLoading:T,isLoading:T,data:g,dataUpdatedAt:u.dataUpdatedAt,error:p,errorUpdatedAt:y,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:u.dataUpdateCount>d.dataUpdateCount||u.errorUpdateCount>d.errorUpdateCount,isFetching:E,isRefetching:E&&!S,isLoadingError:v&&!F,isPaused:u.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:v&&F,isStale:ye(t,e),refetch:this.refetch,promise:o(this,$),isEnabled:q(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const j=x.data!==void 0,X=x.status==="error"&&!j,Wt=Ht=>{X?Ht.reject(x.error):j&&Ht.resolve(x.data)},ve=()=>{const Ht=f(this,$,x.promise=ie());Wt(Ht)},Nt=o(this,$);switch(Nt.status){case"pending":t.queryHash===i.queryHash&&Wt(Nt);break;case"fulfilled":(X||x.data!==Nt.value)&&ve();break;case"rejected":(!X||x.error!==Nt.reason)&&ve();break}}return x}updateResult(){const t=o(this,k),e=this.createResult(o(this,I),this.options);if(f(this,mt,o(this,I).state),f(this,Ct,this.options),o(this,mt).data!==void 0&&f(this,Mt,o(this,I)),te(e,t))return;f(this,k,e);const i=()=>{if(!t)return!0;const{notifyOnChangeProps:n}=this.options,r=typeof n=="function"?n():n;if(r==="all"||!r&&!o(this,xt).size)return!0;const l=new Set(r??o(this,xt));return this.options.throwOnError&&l.add("error"),Object.keys(o(this,k)).some(a=>{const h=a;return o(this,k)[h]!==t[h]&&l.has(h)})};C(this,M,Xe).call(this,{listeners:i()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&C(this,M,le).call(this)}},L=new WeakMap,I=new WeakMap,kt=new WeakMap,k=new WeakMap,mt=new WeakMap,Ct=new WeakMap,$=new WeakMap,st=new WeakMap,Lt=new WeakMap,It=new WeakMap,Mt=new WeakMap,pt=new WeakMap,gt=new WeakMap,it=new WeakMap,xt=new WeakMap,M=new WeakSet,_t=function(t){C(this,M,ce).call(this);let e=o(this,I).fetch(this.options,t);return t!=null&&t.throwOnError||(e=e.catch(U)),e},re=function(){C(this,M,he).call(this);const t=at(this.options.staleTime,o(this,I));if(Qt.isServer()||o(this,k).isStale||!Yt(t))return;const i=qe(o(this,k).dataUpdatedAt,t)+1;f(this,pt,lt.setTimeout(()=>{o(this,k).isStale||this.updateResult()},i))},oe=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(o(this,I)):this.options.refetchInterval)??!1},ae=function(t){C(this,M,ue).call(this),f(this,it,t),!(Qt.isServer()||q(this.options.enabled,o(this,I))===!1||!Yt(o(this,it))||o(this,it)===0)&&f(this,gt,lt.setInterval(()=>{(this.options.refetchIntervalInBackground||me.isFocused())&&C(this,M,_t).call(this)},o(this,it)))},le=function(){C(this,M,re).call(this),C(this,M,ae).call(this,C(this,M,oe).call(this))},he=function(){o(this,pt)!==void 0&&(lt.clearTimeout(o(this,pt)),f(this,pt,void 0))},ue=function(){o(this,gt)!==void 0&&(lt.clearInterval(o(this,gt)),f(this,gt,void 0))},ce=function(){const t=o(this,L).getQueryCache().build(o(this,L),this.options);if(t===o(this,I))return;const e=o(this,I);f(this,I,t),f(this,kt,t.state),this.hasListeners()&&(e==null||e.removeObserver(this),t.addObserver(this))},Xe=function(t){_.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(o(this,k))}),o(this,L).getQueryCache().notify({query:o(this,I),type:"observerResultsUpdated"})})},je);function Os(s,t){return q(t.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&q(t.retryOnMount,s)===!1)}function xe(s,t){return Os(s,t)||s.state.data!==void 0&&de(s,t,t.refetchOnMount)}function de(s,t,e){if(q(t.enabled,s)!==!1&&at(t.staleTime,s)!=="static"){const i=typeof e=="function"?e(s):e;return i==="always"||i!==!1&&ye(s,t)}return!1}function Te(s,t,e,i){return(s!==t||q(i.enabled,s)===!1)&&(!e.suspense||s.state.status!=="error")&&ye(s,e)}function ye(s,t){return q(t.enabled,s)!==!1&&s.isStaleByTime(at(t.staleTime,s))}function Es(s,t){return!te(s.getCurrentResult(),t)}var Ut,H,Q,yt,V,Z,ke,Cs=(ke=class extends Ge{constructor(t){super();w(this,V);w(this,Ut);w(this,H);w(this,Q);w(this,yt);f(this,Ut,t.client),this.mutationId=t.mutationId,f(this,Q,t.mutationCache),f(this,H,[]),this.state=t.state||Is(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){o(this,H).includes(t)||(o(this,H).push(t),this.clearGcTimeout(),o(this,Q).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){f(this,H,o(this,H).filter(e=>e!==t)),this.scheduleGc(),o(this,Q).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){o(this,H).length||(this.state.status==="pending"?this.scheduleGc():o(this,Q).remove(this))}continue(){var t;return((t=o(this,yt))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,a,h,d,c,u,m,g,p,y,O,b,E,S,v,T,F,D;const e=()=>{C(this,V,Z).call(this,{type:"continue"})},i={client:o(this,Ut),meta:this.options.meta,mutationKey:this.options.mutationKey};f(this,yt,Be({fn:()=>this.options.mutationFn?this.options.mutationFn(t,i):Promise.reject(new Error("No mutationFn found")),onFail:(x,A)=>{C(this,V,Z).call(this,{type:"failed",failureCount:x,error:A})},onPause:()=>{C(this,V,Z).call(this,{type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>o(this,Q).canRun(this)}));const n=this.state.status==="pending",r=!o(this,yt).canStart();try{if(n)e();else{C(this,V,Z).call(this,{type:"pending",variables:t,isPaused:r}),o(this,Q).config.onMutate&&await o(this,Q).config.onMutate(t,this,i);const A=await((a=(l=this.options).onMutate)==null?void 0:a.call(l,t,i));A!==this.state.context&&C(this,V,Z).call(this,{type:"pending",context:A,variables:t,isPaused:r})}const x=await o(this,yt).start();return await((d=(h=o(this,Q).config).onSuccess)==null?void 0:d.call(h,x,t,this.state.context,this,i)),await((u=(c=this.options).onSuccess)==null?void 0:u.call(c,x,t,this.state.context,i)),await((g=(m=o(this,Q).config).onSettled)==null?void 0:g.call(m,x,null,this.state.variables,this.state.context,this,i)),await((y=(p=this.options).onSettled)==null?void 0:y.call(p,x,null,t,this.state.context,i)),C(this,V,Z).call(this,{type:"success",data:x}),x}catch(x){try{await((b=(O=o(this,Q).config).onError)==null?void 0:b.call(O,x,t,this.state.context,this,i))}catch(A){Promise.reject(A)}try{await((S=(E=this.options).onError)==null?void 0:S.call(E,x,t,this.state.context,i))}catch(A){Promise.reject(A)}try{await((T=(v=o(this,Q).config).onSettled)==null?void 0:T.call(v,void 0,x,this.state.variables,this.state.context,this,i))}catch(A){Promise.reject(A)}try{await((D=(F=this.options).onSettled)==null?void 0:D.call(F,void 0,x,t,this.state.context,i))}catch(A){Promise.reject(A)}throw C(this,V,Z).call(this,{type:"error",error:x}),x}finally{o(this,Q).runNext(this)}}},Ut=new WeakMap,H=new WeakMap,Q=new WeakMap,yt=new WeakMap,V=new WeakSet,Z=function(t){const e=i=>{switch(t.type){case"failed":return{...i,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,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{...i,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:t.error,failureCount:i.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=e(this.state),_.batch(()=>{o(this,H).forEach(i=>{i.onMutationUpdate(t)}),o(this,Q).notify({mutation:this,type:"updated",action:t})})},ke);function Is(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var J,N,Kt,Le,Ms=(Le=class extends qt{constructor(t={}){super();w(this,J);w(this,N);w(this,Kt);this.config=t,f(this,J,new Set),f(this,N,new Map),f(this,Kt,0)}build(t,e,i){const n=new Cs({client:t,mutationCache:this,mutationId:++Vt(this,Kt)._,options:t.defaultMutationOptions(e),state:i});return this.add(n),n}add(t){o(this,J).add(t);const e=Bt(t);if(typeof e=="string"){const i=o(this,N).get(e);i?i.push(t):o(this,N).set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(o(this,J).delete(t)){const e=Bt(t);if(typeof e=="string"){const i=o(this,N).get(e);if(i)if(i.length>1){const n=i.indexOf(t);n!==-1&&i.splice(n,1)}else i[0]===t&&o(this,N).delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=Bt(t);if(typeof e=="string"){const i=o(this,N).get(e),n=i==null?void 0:i.find(r=>r.state.status==="pending");return!n||n===t}else return!0}runNext(t){var i;const e=Bt(t);if(typeof e=="string"){const n=(i=o(this,N).get(e))==null?void 0:i.find(r=>r!==t&&r.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}else return Promise.resolve()}clear(){_.batch(()=>{o(this,J).forEach(t=>{this.notify({type:"removed",mutation:t})}),o(this,J).clear(),o(this,N).clear()})}getAll(){return Array.from(o(this,J))}find(t){const e={exact:!0,...t};return this.getAll().find(i=>we(e,i))}findAll(t={}){return this.getAll().filter(e=>we(t,e))}notify(t){_.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(e=>e.state.isPaused);return _.batch(()=>Promise.all(t.map(e=>e.continue().catch(U))))}},J=new WeakMap,N=new WeakMap,Kt=new WeakMap,Le);function Bt(s){var t;return(t=s.options.scope)==null?void 0:t.id}var B,Ue,xs=(Ue=class extends qt{constructor(t={}){super();w(this,B);this.config=t,f(this,B,new Map)}build(t,e,i){const n=e.queryKey,r=e.queryHash??pe(n,e);let l=this.get(r);return l||(l=new bs({client:t,queryKey:n,queryHash:r,options:t.defaultQueryOptions(e),state:i,defaultOptions:t.getQueryDefaults(n)}),this.add(l)),l}add(t){o(this,B).has(t.queryHash)||(o(this,B).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=o(this,B).get(t.queryHash);e&&(t.destroy(),e===t&&o(this,B).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){_.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return o(this,B).get(t)}getAll(){return[...o(this,B).values()]}find(t){const e={exact:!0,...t};return this.getAll().find(i=>be(e,i))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(i=>be(t,i)):e}notify(t){_.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){_.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){_.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},B=new WeakMap,Ue),R,nt,rt,Tt,Rt,ot,Ft,At,Ke,ni=(Ke=class{constructor(s={}){w(this,R);w(this,nt);w(this,rt);w(this,Tt);w(this,Rt);w(this,ot);w(this,Ft);w(this,At);f(this,R,s.queryCache||new xs),f(this,nt,s.mutationCache||new Ms),f(this,rt,s.defaultOptions||{}),f(this,Tt,new Map),f(this,Rt,new Map),f(this,ot,0)}mount(){Vt(this,ot)._++,o(this,ot)===1&&(f(this,Ft,me.subscribe(async s=>{s&&(await this.resumePausedMutations(),o(this,R).onFocus())})),f(this,At,Gt.subscribe(async s=>{s&&(await this.resumePausedMutations(),o(this,R).onOnline())})))}unmount(){var s,t;Vt(this,ot)._--,o(this,ot)===0&&((s=o(this,Ft))==null||s.call(this),f(this,Ft,void 0),(t=o(this,At))==null||t.call(this),f(this,At,void 0))}isFetching(s){return o(this,R).findAll({...s,fetchStatus:"fetching"}).length}isMutating(s){return o(this,nt).findAll({...s,status:"pending"}).length}getQueryData(s){var e;const t=this.defaultQueryOptions({queryKey:s});return(e=o(this,R).get(t.queryHash))==null?void 0:e.state.data}ensureQueryData(s){const t=this.defaultQueryOptions(s),e=o(this,R).build(this,t),i=e.state.data;return i===void 0?this.fetchQuery(s):(s.revalidateIfStale&&e.isStaleByTime(at(t.staleTime,e))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(s){return o(this,R).findAll(s).map(({queryKey:t,state:e})=>{const i=e.data;return[t,i]})}setQueryData(s,t,e){const i=this.defaultQueryOptions({queryKey:s}),n=o(this,R).get(i.queryHash),r=n==null?void 0:n.state.data,l=ls(t,r);if(l!==void 0)return o(this,R).build(this,i).setData(l,{...e,manual:!0})}setQueriesData(s,t,e){return _.batch(()=>o(this,R).findAll(s).map(({queryKey:i})=>[i,this.setQueryData(i,t,e)]))}getQueryState(s){var e;const t=this.defaultQueryOptions({queryKey:s});return(e=o(this,R).get(t.queryHash))==null?void 0:e.state}removeQueries(s){const t=o(this,R);_.batch(()=>{t.findAll(s).forEach(e=>{t.remove(e)})})}resetQueries(s,t){const e=o(this,R);return _.batch(()=>(e.findAll(s).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...s},t)))}cancelQueries(s,t={}){const e={revert:!0,...t},i=_.batch(()=>o(this,R).findAll(s).map(n=>n.cancel(e)));return Promise.all(i).then(U).catch(U)}invalidateQueries(s,t={}){return _.batch(()=>(o(this,R).findAll(s).forEach(e=>{e.invalidate()}),(s==null?void 0:s.refetchType)==="none"?Promise.resolve():this.refetchQueries({...s,type:(s==null?void 0:s.refetchType)??(s==null?void 0:s.type)??"active"},t)))}refetchQueries(s,t={}){const e={...t,cancelRefetch:t.cancelRefetch??!0},i=_.batch(()=>o(this,R).findAll(s).filter(n=>!n.isDisabled()&&!n.isStatic()).map(n=>{let r=n.fetch(void 0,e);return e.throwOnError||(r=r.catch(U)),n.state.fetchStatus==="paused"?Promise.resolve():r}));return Promise.all(i).then(U)}fetchQuery(s){const t=this.defaultQueryOptions(s);t.retry===void 0&&(t.retry=!1);const e=o(this,R).build(this,t);return e.isStaleByTime(at(t.staleTime,e))?e.fetch(t):Promise.resolve(e.state.data)}prefetchQuery(s){return this.fetchQuery(s).then(U).catch(U)}fetchInfiniteQuery(s){return s._type="infinite",this.fetchQuery(s)}prefetchInfiniteQuery(s){return this.fetchInfiniteQuery(s).then(U).catch(U)}ensureInfiniteQueryData(s){return s._type="infinite",this.ensureQueryData(s)}resumePausedMutations(){return Gt.isOnline()?o(this,nt).resumePausedMutations():Promise.resolve()}getQueryCache(){return o(this,R)}getMutationCache(){return o(this,nt)}getDefaultOptions(){return o(this,rt)}setDefaultOptions(s){f(this,rt,s)}setQueryDefaults(s,t){o(this,Tt).set(zt(s),{queryKey:s,defaultOptions:t})}getQueryDefaults(s){const t=[...o(this,Tt).values()],e={};return t.forEach(i=>{Dt(s,i.queryKey)&&Object.assign(e,i.defaultOptions)}),e}setMutationDefaults(s,t){o(this,Rt).set(zt(s),{mutationKey:s,defaultOptions:t})}getMutationDefaults(s){const t=[...o(this,Rt).values()],e={};return t.forEach(i=>{Dt(s,i.mutationKey)&&Object.assign(e,i.defaultOptions)}),e}defaultQueryOptions(s){if(s._defaulted)return s;const t={...o(this,rt).queries,...this.getQueryDefaults(s.queryKey),...s,_defaulted:!0};return t.queryHash||(t.queryHash=pe(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.queryFn===ge&&(t.enabled=!1),t}defaultMutationOptions(s){return s!=null&&s._defaulted?s:{...o(this,rt).mutations,...(s==null?void 0:s.mutationKey)&&this.getMutationDefaults(s.mutationKey),...s,_defaulted:!0}}clear(){o(this,R).clear(),o(this,nt).clear()}},R=new WeakMap,nt=new WeakMap,rt=new WeakMap,Tt=new WeakMap,Rt=new WeakMap,ot=new WeakMap,Ft=new WeakMap,At=new WeakMap,Ke),Ze=z.createContext(void 0),Ts=s=>{const t=z.useContext(Ze);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},ri=({client:s,children:t})=>(z.useEffect(()=>(s.mount(),()=>{s.unmount()}),[s]),es.jsx(Ze.Provider,{value:s,children:t})),Ye=z.createContext(!1),Rs=()=>z.useContext(Ye);Ye.Provider;function Fs(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}var As=z.createContext(Fs()),Ps=()=>z.useContext(As),_s=(s,t,e)=>{const i=e!=null&&e.state.error&&typeof s.throwOnError=="function"?He(s.throwOnError,[e.state.error,e]):s.throwOnError;(s.suspense||s.experimental_prefetchInRender||i)&&(t.isReset()||(s.retryOnMount=!1))},zs=s=>{z.useEffect(()=>{s.clearReset()},[s])},Ds=({result:s,errorResetBoundary:t,throwOnError:e,query:i,suspense:n})=>s.isError&&!t.isReset()&&!s.isFetching&&i&&(n&&s.data===void 0||He(e,[s.error,i])),Qs=s=>{if(s.suspense){const e=n=>n==="static"?n:Math.max(n??1e3,1e3),i=s.staleTime;s.staleTime=typeof i=="function"?(...n)=>e(i(...n)):e(i),typeof s.gcTime=="number"&&(s.gcTime=Math.max(s.gcTime,1e3))}},js=(s,t)=>s.isLoading&&s.isFetching&&!t,ks=(s,t)=>(s==null?void 0:s.suspense)&&t.isPending,Re=(s,t,e)=>t.fetchOptimistic(s).catch(()=>{e.clearReset()});function Ls(s,t,e){var g,p,y,O;const i=Rs(),n=Ps(),r=Ts(),l=r.defaultQueryOptions(s);(p=(g=r.getDefaultOptions().queries)==null?void 0:g._experimental_beforeQuery)==null||p.call(g,l);const a=r.getQueryCache().get(l.queryHash),h=s.subscribed!==!1;l._optimisticResults=i?"isRestoring":h?"optimistic":void 0,Qs(l),_s(l,n,a),zs(n);const d=!r.getQueryCache().get(l.queryHash),[c]=z.useState(()=>new t(r,l)),u=c.getOptimisticResult(l),m=!i&&h;if(z.useSyncExternalStore(z.useCallback(b=>{const E=m?c.subscribe(_.batchCalls(b)):U;return c.updateResult(),E},[c,m]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),z.useEffect(()=>{c.setOptions(l)},[l,c]),ks(l,u))throw Re(l,c,n);if(Ds({result:u,errorResetBoundary:n,throwOnError:l.throwOnError,query:a,suspense:l.suspense}))throw u.error;if((O=(y=r.getDefaultOptions().queries)==null?void 0:y._experimental_afterQuery)==null||O.call(y,l,u),l.experimental_prefetchInRender&&!Qt.isServer()&&js(u,i)){const b=d?Re(l,c,n):a==null?void 0:a.promise;b==null||b.catch(U).finally(()=>{c.updateResult()})}return l.notifyOnChangeProps?u:c.trackResult(u)}function oi(s,t){return Ls(s,ws)}function Us(s,t,e){const i=new Array(s);return new Proxy(i,{get(n,r,l){if(typeof r=="string"){const a=r.charCodeAt(0);if(a>=48&&a<=57){const h=+r;if(Number.isInteger(h)&&h>=0&&h<s){let d=n[h];if(!d){const c=t[h*2];d=n[h]={index:h,key:e(h),start:c,size:t[h*2+1],end:c+t[h*2+1],lane:0}}return d}}if(r==="length")return s}return Reflect.get(n,r,l)}})}function vt(s,t,e){let i=e.initialDeps??[],n,r=!0;function l(){const a=s();return(a.length!==i.length||a.some((d,c)=>i[c]!==d))&&(i=a,n=t(...a),e!=null&&e.onChange&&!(r&&e.skipInitialOnChange)&&e.onChange(n),r=!1),n}return l.updateDeps=a=>{i=a},l}function Fe(s,t){if(s===void 0)throw new Error("Unexpected undefined");return s}const Ks=(s,t)=>Math.abs(s-t)<1.01,qs=(s,t,e)=>{let i;return function(...n){s.clearTimeout(i),i=s.setTimeout(()=>t.apply(this,n),e)}};let Pt;const Xt=()=>{if(Pt!==void 0)return Pt;if(typeof navigator>"u")return Pt=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Pt=!0;const s=navigator.maxTouchPoints;return Pt=navigator.platform==="MacIntel"&&s!==void 0&&s>0},Ae=s=>{const{offsetWidth:t,offsetHeight:e}=s;return{width:t,height:e}},Ws=s=>s,Ns=s=>{const t=Math.max(s.startIndex-s.overscan,0),i=Math.min(s.endIndex+s.overscan,s.count-1)-t+1,n=new Array(i);for(let r=0;r<i;r++)n[r]=t+r;return n},Hs=(s,t)=>{const e=s.scrollElement;if(!e)return;const i=s.targetWindow;if(!i)return;const n=l=>{const{width:a,height:h}=l;t({width:Math.round(a),height:Math.round(h)})};if(n(Ae(e)),!i.ResizeObserver)return()=>{};const r=new i.ResizeObserver(l=>{const a=()=>{const h=l[0];if(h!=null&&h.borderBoxSize){const d=h.borderBoxSize[0];if(d){n({width:d.inlineSize,height:d.blockSize});return}}n(Ae(e))};s.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return r.observe(e,{box:"border-box"}),()=>{r.unobserve(e)}},$t={passive:!0},Vs=typeof window>"u"?!0:"onscrollend"in window,Bs=(s,t,e)=>{const i=s.scrollElement;if(!i)return;const n=s.targetWindow;if(!n)return;const r=s.options.useScrollendEvent&&Vs;let l=0;const a=r?null:qs(n,()=>t(l,!1),s.options.isScrollingResetDelay),h=u=>()=>{l=e(i),a==null||a(),t(l,u)},d=h(!0),c=h(!1);return i.addEventListener("scroll",d,$t),r&&i.addEventListener("scrollend",c,$t),()=>{i.removeEventListener("scroll",d),r&&i.removeEventListener("scrollend",c)}},Gs=(s,t)=>Bs(s,t,e=>{const{horizontal:i,isRtl:n}=s.options;return i?e.scrollLeft*(n&&-1||1):e.scrollTop}),$s=(s,t,e)=>{if(e.options.useCachedMeasurements){const i=e.indexFromElement(s),n=e.options.getItemKey(i);return e.itemSizeCache.get(n)??e.options.estimateSize(i)}if(t!=null&&t.borderBoxSize){const i=t.borderBoxSize[0];if(i)return Math.round(i[e.options.horizontal?"inlineSize":"blockSize"])}if(!t){const i=e.indexFromElement(s),n=e.options.getItemKey(i),r=e.itemSizeCache.get(n);if(r!==void 0)return r}return s[e.options.horizontal?"offsetWidth":"offsetHeight"]},Js=(s,{adjustments:t=0,behavior:e},i)=>{var n,r;(r=(n=i.scrollElement)==null?void 0:n.scrollTo)==null||r.call(n,{[i.options.horizontal?"left":"top"]:s+t,behavior:e})},Xs=Js;class Zs{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var e,i,n;return((n=(i=(e=this.targetWindow)==null?void 0:e.performance)==null?void 0:i.now)==null?void 0:n.call(i))??Date.now()},this.observer=(()=>{let e=null;const i=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(n=>{n.forEach(r=>{const l=()=>{const a=r.target,h=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);for(const[d,c]of this.elementsCache)if(c===a){this.elementsCache.delete(d);break}return}this.shouldMeasureDuringScroll(h)&&this.resizeItem(h,this.options.measureElement(a,r,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()})}));return{disconnect:()=>{var n;(n=i())==null||n.disconnect(),e=null},observe:n=>{var r;return(r=i())==null?void 0:r.observe(n,{box:"border-box"})},unobserve:n=>{var r;return(r=i())==null?void 0:r.unobserve(n)}}})(),this.range=null,this.setOptions=e=>{var i,n;const r={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Ws,rangeExtractor:Ns,onChange:()=>{},measureElement:$s,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const m in e){const g=e[m];g!==void 0&&(r[m]=g)}const l=this.options;let a=null,h=null,d=!1;if(l!==void 0&&l.enabled&&r.enabled&&r.anchorTo==="end"&&this.scrollElement!==null){const m=l.count,g=r.count,p=this.getMeasurements(),y=m>0?((i=p[0])==null?void 0:i.key)??l.getItemKey(0):null,O=m>0?((n=p[m-1])==null?void 0:n.key)??l.getItemKey(m-1):null;if(g!==m||m>0&&g>0&&(r.getItemKey(0)!==y||r.getItemKey(g-1)!==O)){d=!0;const S=m>0?this.getVirtualItemForOffset(this.getScrollOffset())??p[0]:null;S&&(a=[S.key,this.getScrollOffset()-S.start]);const v=r.followOnAppend===!0?"auto":r.followOnAppend||null;v&&g>m&&this.isAtEnd(l.scrollEndThreshold)&&(m===0||r.getItemKey(g-1)!==O)&&(h=v)}}this.options=r,d&&(this.pendingMin=0,this.itemSizeCacheVersion++);let c=!1,u=0;if(a&&this.scrollOffset!==null){const[m,g]=a,p=this.getMeasurements(),{count:y,getItemKey:O}=this.options;let b=0;for(;b<y&&O(b)!==m;)b++;if(b<y){const E=p[b];if(E){const S=E.start+g;S!==this.scrollOffset&&(u=S-this.scrollOffset,this.scrollOffset=S,c=!0)}}}(c||h)&&(this.pendingScrollAnchor=[c?a[0]:null,c?a[1]:0,h,u])},this.notify=e=>{var i,n;(n=(i=this.options).onChange)==null||n.call(i,this,e)},this.maybeNotify=vt(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;const i=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==i){if(this.cleanup(),!i){this.maybeNotify();return}if(this.scrollElement=i,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((e=this.scrollElement)==null?void 0:e.window)??null,this.elementsCache.forEach(r=>{this.observer.observe(r)}),this.unsubs.push(this.options.observeElementRect(this,r=>{this.scrollRect=r,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(r,l)=>{if(l&&this._intendedScrollOffset===null&&r===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(r-this._intendedScrollOffset)<1.5&&(r=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const a=this.getScrollOffset();this.scrollDirection=l?a===r?this.scrollDirection:a<r?"forward":"backward":null,this.scrollOffset=r,this.isScrolling=l,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const r=this.scrollElement,l=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},a=()=>{this._iosTouching=!1,!(!Xt()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};r.addEventListener("touchstart",l,$t),r.addEventListener("touchend",a,$t),this.unsubs.push(()=>{r.removeEventListener("touchstart",l),r.removeEventListener("touchend",a),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const n=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,n&&this.scrollElement&&this.options.enabled){const[r,l,a,h]=n;r!==null&&!a&&(Xt()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?h!==0&&(this._iosDeferredAdjustment+=h):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),a&&this.scrollToEnd({behavior:a})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const e=this.getScrollOffset(),i=this.getMaxScrollOffset();if(e<0||e>i)return;const n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,i)=>{const n=new Map,r=new Map;for(let l=i-1;l>=0;l--){const a=e[l];if(n.has(a.lane))continue;const h=r.get(a.lane);if(h==null||a.end>h.end?r.set(a.lane,a):a.end<h.end&&n.set(a.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((l,a)=>l.end===a.end?l.index-a.index:l.end-a.end)[0]:void 0},this.getMeasurementOptions=vt(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(e,i,n,r,l,a,h)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:i,scrollMargin:n,getItemKey:r,enabled:l,lanes:a,laneAssignmentMode:h}),{key:!1}),this.getMeasurements=vt(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:i,scrollMargin:n,getItemKey:r,enabled:l,lanes:a,laneAssignmentMode:h},d)=>{const c=this.itemSizeCache;if(!l)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(const p of this.laneAssignments.keys())p>=e&&this.laneAssignments.delete(p);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(p=>{this.itemSizeCache.set(p.key,p.size)}));const u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){const p=this.options.gap,y=e*2;let O=this._flatMeasurements;if(!O||O.length<y){const S=new Float64Array(y);O&&u>0&&S.set(O.subarray(0,u*2)),O=S,this._flatMeasurements=O}let b;if(u===0)b=i+n;else{const S=u-1;b=O[S*2]+O[S*2+1]+p}for(let S=u;S<e;S++){const v=r(S),T=c.get(v),F=typeof T=="number"?T:this.options.estimateSize(S);O[S*2]=b,O[S*2+1]=F,b+=F+p}const E=Us(e,O,r);return this.measurementsCache=E,E}const m=this.measurementsCache.slice(0,u),g=new Array(a).fill(void 0);for(let p=0;p<u;p++){const y=m[p];y&&(g[y.lane]=p)}for(let p=u;p<e;p++){const y=r(p),O=this.laneAssignments.get(p);let b,E;const S=h==="estimate"||c.has(y);if(O!==void 0&&this.options.lanes>1){b=O;const D=g[b],x=D!==void 0?m[D]:void 0;E=x?x.end+this.options.gap:i+n}else{const D=this.options.lanes===1?m[p-1]:this.getFurthestMeasurement(m,p);E=D?D.end+this.options.gap:i+n,b=D?D.lane:p%this.options.lanes,this.options.lanes>1&&S&&this.laneAssignments.set(p,b)}const v=c.get(y),T=typeof v=="number"?v:this.options.estimateSize(p),F=E+T;m[p]={index:p,start:E,size:T,end:F,key:y,lane:b},g[b]=p}return this.measurementsCache=m,m},{key:!1,debug:()=>this.options.debug}),this.calculateRange=vt(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,i,n,r)=>e.length===0||i===0?(this.range=null,null):(this.range=ti(e,i,n,r,r===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=vt(()=>{let e=null,i=null;const n=this.calculateRange();return n&&(e=n.startIndex,i=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,i]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,i]},(e,i,n,r,l)=>r===null||l===null?[]:e({startIndex:r,endIndex:l,overscan:i,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{const i=this.options.indexAttribute,n=e.getAttribute(i);return n?parseInt(n,10):(console.warn(`Missing attribute name '${i}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{var i;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const n=this.scrollState.index??((i=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:i.index);if(n!==void 0&&this.range){const r=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),l=Math.max(0,n-r),a=Math.min(this.options.count-1,n+r);return e>=l&&e<=a}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((l,a)=>{l.isConnected||(this.observer.unobserve(l),this.elementsCache.delete(a))});return}const i=this.indexFromElement(e),n=this.options.getItemKey(i),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(i)&&this.resizeItem(i,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,i)=>{var n,r;if(e<0||e>=this.options.count)return;let l,a,h;const d=this._flatMeasurements;if(this.options.lanes===1&&d!==null)h=this.options.getItemKey(e),a=d[e*2],l=d[e*2+1];else{const m=this.measurementsCache[e];if(!m)return;h=m.key,a=m.start,l=m.size}const c=this.itemSizeCache.get(h)??l,u=i-c;if(u!==0){const m=this.options.anchorTo==="end"&&((n=this.scrollState)==null?void 0:n.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,g=m?this.getTotalSize():0,p=((r=this.scrollState)==null?void 0:r.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:h,start:a,size:l,end:a+l,lane:0},u,this):a<this.getScrollOffset()+this.scrollAdjustments&&(!this.itemSizeCache.has(h)||this.scrollDirection!=="backward"));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(h,i),this.itemSizeCacheVersion++,m?this.applyScrollAdjustment(this.getTotalSize()-g):p&&this.applyScrollAdjustment(u),this.notify(!1)}},this.getVirtualItems=vt(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,i)=>{const n=[];for(let r=0,l=e.length;r<l;r++){const a=e[r],h=i[a];n.push(h)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const i=this.getMeasurements();if(i.length===0)return;const n=this._flatMeasurements,r=this.options.lanes===1&&n!=null,l=ts(0,i.length-1,r?a=>n[a*2]:a=>Fe(i[a]).start,e);return Fe(i[l])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,i,n=0)=>{if(!this.scrollElement)return 0;const r=this.getSize(),l=this.getScrollOffset();i==="auto"&&(i=e>=l+r?"end":"start"),i==="center"?e+=(n-r)/2:i==="end"&&(e-=r);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,i="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const n=this.getSize(),r=this.getScrollOffset(),l=this.measurementsCache[e];if(!l)return;if(i==="auto")if(l.end>=r+n-this.options.scrollPaddingEnd)i="end";else if(l.start<=r+this.options.scrollPaddingStart)i="start";else return[r,i];if(i==="end"&&e===this.options.count-1)return[this.getMaxScrollOffset(),i];const a=i==="end"?l.end+this.options.scrollPaddingEnd:l.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,i,l.size),i]},this.scrollToOffset=(e,{align:i="start",behavior:n="auto"}={})=>{const r=this.getOffsetForAlignment(e,i),l=this.now();this.scrollState={index:null,align:i,behavior:n,startedAt:l,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:i="auto",behavior:n="auto"}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));const r=this.getOffsetForIndex(e,i);if(!r)return;const[l,a]=r,h=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:h,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:i="auto"}={})=>{const n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:"start",behavior:i,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:e});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{var e;const i=this.getMeasurements();let n;if(i.length===0)n=this.options.paddingStart;else if(this.options.lanes===1){const r=i.length-1,l=this._flatMeasurements;l!=null?n=l[r*2]+l[r*2+1]:n=((e=i[r])==null?void 0:e.end)??0}else{const r=Array(this.options.lanes).fill(null);let l=i.length-1;for(;l>=0&&r.some(a=>a===null);){const a=i[l];r[a.lane]===null&&(r[a.lane]=a.end),l--}n=Math.max(...r.filter(a=>a!==null))}return Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const e=[];if(this.itemSizeCache.size===0)return e;const i=this.getMeasurements();for(const n of i)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:i,behavior:n})=>{this._intendedScrollOffset=e+(i??0),this.options.scrollToFn(e,{behavior:n,adjustments:i},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(t)}applyScrollAdjustment(t,e){t!==0&&(Xt()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=t:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=t,behavior:e}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollAdjustments=0)))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const i=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,n=i?i[0]:this.scrollState.lastTargetOffset,r=1,l=n!==this.scrollState.lastTargetOffset;if(!l&&Ks(n,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=r){this.getScrollOffset()!==n&&this._scrollToOffset(n,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,l){const a=this.getSize()||600,h=Math.abs(n-this.getScrollOffset()),d=this.scrollState.behavior==="smooth"&&h>a;this.scrollState.lastTargetOffset=n,d||(this.scrollState.behavior="auto"),this._scrollToOffset(n,{adjustments:void 0,behavior:d?"smooth":"auto"})}this.scheduleScrollReconcile()}}const ts=(s,t,e,i)=>{for(;s<=t;){const n=(s+t)/2|0,r=e(n);if(r<i)s=n+1;else if(r>i)t=n-1;else return n}return s>0?s-1:0};function Ys(s,t,e){let i=0;for(;i<=t;){const n=(i+t)/2|0,r=s[n*2];if(r<e)i=n+1;else if(r>e)t=n-1;else return n}return i>0?i-1:0}function ti(s,t,e,i,n){const r=s.length-1;if(s.length<=i)return{startIndex:0,endIndex:r};if(i===1&&n!==null){const d=Ys(n,r,e);let c=d;const u=e+t;for(;c<r&&n[c*2]+n[c*2+1]<u;)c++;return{startIndex:d,endIndex:c}}let a=ts(0,r,d=>s[d].start,e),h=a;if(i===1)for(;h<r&&s[h].end<e+t;)h++;else if(i>1){const d=Array(i).fill(0);for(;h<r&&d.some(u=>u<e+t);){const u=s[h];d[u.lane]=u.end,h++}const c=Array(i).fill(e+t);for(;a>=0&&c.some(u=>u>=e);){const u=s[a];c[u.lane]=u.start,a--}a=Math.max(0,a-a%i),h=Math.min(r,h+(i-1-h%i))}return{startIndex:a,endIndex:h}}const Zt=typeof document<"u"?z.useLayoutEffect:z.useEffect;function ei({useFlushSync:s=!0,directDomUpdates:t=!1,directDomUpdatesMode:e="transform",...i}){const n=z.useReducer(d=>d+1,0)[1],r=z.useRef({enabled:t,mode:e,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});r.current.enabled=t,r.current.mode=e;const l=d=>{const c=r.current;if(!c.enabled||!c.container)return;const u=d.getTotalSize();if(u!==c.lastSize){c.lastSize=u;const b=d.options.horizontal?"width":"height";c.container.style[b]=`${u}px`}const m=!!d.options.horizontal,g=c.mode==="transform",p=m?"left":"top",y=d.options.scrollMargin,O=d.getVirtualItems();for(const b of O){const E=b.start-y,S=d.elementsCache.get(b.key);S&&c.lastPositions.get(S)!==E&&(c.lastPositions.set(S,E),g?S.style.transform=m?`translate3d(${E}px, 0, 0)`:`translate3d(0, ${E}px, 0)`:S.style[p]=`${E}px`)}},a={...i,onChange:(d,c)=>{var u;const m=r.current;let g=!0;if(m.enabled){l(d);const p=d.range,y=m.prevRange;g=!y||y.isScrolling!==d.isScrolling||y.startIndex!==(p==null?void 0:p.startIndex)||y.endIndex!==(p==null?void 0:p.endIndex),g&&(m.prevRange=p?{startIndex:p.startIndex,endIndex:p.endIndex,isScrolling:d.isScrolling}:null)}g&&(s&&c?ss.flushSync(n):n()),(u=i.onChange)==null||u.call(i,d,c)}},[h]=z.useState(()=>{const d=new Zs(a);return Object.assign(d,{containerRef:c=>{const u=r.current;if(u.container=c,u.lastSize=null,c&&u.enabled){const m=d.getTotalSize();u.lastSize=m;const g=d.options.horizontal?"width":"height";c.style[g]=`${m}px`}}})});return h.setOptions(a),Zt(()=>h._didMount(),[]),Zt(()=>h._willUpdate()),Zt(()=>{l(h)}),h}function ai(s){return ei({observeElementRect:Hs,observeElementOffset:Gs,scrollToFn:Xs,...s})}export{ni as Q,ri as a,Ts as b,ai as c,oi as u};
|
|
2
|
+
//# sourceMappingURL=vendor-query-CAh-Aqig.js.map
|