import{b4 as d,bv as P,bw as b,bx as v,b3 as x,r as l,by as p}from"./index-CHfgriyV.js";var w=class extends d{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:P()})}getOptimisticResult(e){return e.behavior=P(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:s}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:f,isError:c,isRefetchError:g}=i,r=s.fetchMeta?.fetchMore?.direction,n=c&&r==="forward",o=a&&r==="forward",h=c&&r==="backward",u=a&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:v(t,s.data),hasPreviousPage:b(t,s.data),isFetchNextPageError:n,isFetchingNextPage:o,isFetchPreviousPageError:h,isFetchingPreviousPage:u,isRefetchError:g&&!n&&!h,isRefetching:f&&!o&&!u}}};function m(e,t){return x(e,w)}function E(){const e=l.useContext(p);if(!e)throw new Error("useSidePanel must be used within SidePanelProvider");return e}export{m as a,E as u};
