(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[177],{5958:e=>{e.exports={style:{fontFamily:"'Inter', 'Inter Fallback'",fontStyle:"normal"},className:"__className_f367f3",variable:"__variable_f367f3"}},6052:(e,t,s)=>{"use strict";s.d(t,{A:()=>l,AuthProvider:()=>u});var i=s(5155),r=s(2115),a=s(2842);let n=(0,r.createContext)(void 0);function u(e){let{children:t}=e,[s,u,l]=(0,a.lT)(["user"]),[o,h]=(0,r.useState)(null),[c,f]=(0,r.useState)(!0);return(0,r.useEffect)(()=>{if(s.user)try{let e;e="string"==typeof s.user?JSON.parse(s.user):s.user,h(e)}catch(e){l("user",{path:"/"}),h(null)}else h(null);f(!1)},[s.user,l]),(0,i.jsx)(n.Provider,{value:{user:o,isLoading:c},children:t})}function l(){let e=(0,r.useContext)(n);if(void 0===e)throw Error("useAuth must be used within an AuthProvider");return e}},6927:e=>{e.exports={style:{fontFamily:"'Roboto Mono', 'Roboto Mono Fallback'",fontStyle:"normal"},className:"__className_5899e0",variable:"__variable_5899e0"}},7313:(e,t,s)=>{Promise.resolve().then(s.bind(s,7655)),Promise.resolve().then(s.bind(s,6052)),Promise.resolve().then(s.t.bind(s,5958,23)),Promise.resolve().then(s.t.bind(s,6927,23)),Promise.resolve().then(s.t.bind(s,9324,23)),Promise.resolve().then(s.bind(s,6671))},7655:(e,t,s)=>{"use strict";s.d(t,{Providers:()=>q});var i=s(5155),r=s(2020),a=s(9853),n=s(7165),u=s(5910),l=class extends u.Q{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,s){let i=t.queryKey,n=t.queryHash??(0,r.F$)(i,t),u=this.get(n);return u||(u=new a.X({client:e,queryKey:i,queryHash:n,options:e.defaultQueryOptions(t),state:s,defaultOptions:e.getQueryDefaults(i)}),this.add(u)),u}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){n.jG.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,r.MK)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,r.MK)(e,t)):t}notify(e){n.jG.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){n.jG.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){n.jG.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},o=s(4560),h=class extends u.Q{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#s=new Map,this.#i=0}#t;#s;#i;build(e,t,s){let i=new o.s({client:e,mutationCache:this,mutationId:++this.#i,options:e.defaultMutationOptions(t),state:s});return this.add(i),i}add(e){this.#t.add(e);let t=c(e);if("string"==typeof t){let s=this.#s.get(t);s?s.push(e):this.#s.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){let t=c(e);if("string"==typeof t){let s=this.#s.get(t);if(s){if(s.length>1){let t=s.indexOf(e);-1!==t&&s.splice(t,1)}else s[0]===e&&this.#s.delete(t)}}}this.notify({type:"removed",mutation:e})}canRun(e){let t=c(e);if("string"!=typeof t)return!0;{let s=this.#s.get(t),i=s?.find(e=>"pending"===e.state.status);return!i||i===e}}runNext(e){let t=c(e);if("string"!=typeof t)return Promise.resolve();{let s=this.#s.get(t)?.find(t=>t!==e&&t.state.isPaused);return s?.continue()??Promise.resolve()}}clear(){n.jG.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#s.clear()})}getAll(){return Array.from(this.#t)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,r.nJ)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,r.nJ)(e,t))}notify(e){n.jG.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return n.jG.batch(()=>Promise.all(e.map(e=>e.continue().catch(r.lQ))))}};function c(e){return e.options.scope?.id}var f=s(920),d=s(1239);function y(e){return{onFetch:(t,s)=>{let i=t.options,a=t.fetchOptions?.meta?.fetchMore?.direction,n=t.state.data?.pages||[],u=t.state.data?.pageParams||[],l={pages:[],pageParams:[]},o=0,h=async()=>{let s=!1,h=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(t.signal.aborted?s=!0:t.signal.addEventListener("abort",()=>{s=!0}),t.signal)})},c=(0,r.ZM)(t.options,t.fetchOptions),f=async(e,i,a)=>{if(s)return Promise.reject();if(null==i&&e.pages.length)return Promise.resolve(e);let n=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:i,direction:a?"backward":"forward",meta:t.options.meta};return h(e),e})(),u=await c(n),{maxPages:l}=t.options,o=a?r.ZZ:r.y9;return{pages:o(e.pages,u,l),pageParams:o(e.pageParams,i,l)}};if(a&&n.length){let e="backward"===a,t={pages:n,pageParams:u},s=(e?function(e,{pages:t,pageParams:s}){return t.length>0?e.getPreviousPageParam?.(t[0],t,s[0],s):void 0}:p)(i,t);l=await f(t,s,e)}else{let t=e??n.length;do{let e=0===o?u[0]??i.initialPageParam:p(i,l);if(o>0&&null==e)break;l=await f(l,e),o++}while(ot.options.persister?.(h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s):t.fetchFn=h}}}function p(e,{pages:t,pageParams:s}){let i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,s[i],s):void 0}var m=class{#r;#a;#n;#u;#l;#o;#h;#c;constructor(e={}){this.#r=e.queryCache||new l,this.#a=e.mutationCache||new h,this.#n=e.defaultOptions||{},this.#u=new Map,this.#l=new Map,this.#o=0}mount(){this.#o++,1===this.#o&&(this.#h=f.m.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#r.onFocus())}),this.#c=d.t.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#r.onOnline())}))}unmount(){this.#o--,0===this.#o&&(this.#h?.(),this.#h=void 0,this.#c?.(),this.#c=void 0)}isFetching(e){return this.#r.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#a.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#r.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),s=this.#r.build(this,t),i=s.state.data;return void 0===i?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime((0,r.d2)(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return this.#r.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,s){let i=this.defaultQueryOptions({queryKey:e}),a=this.#r.get(i.queryHash),n=a?.state.data,u=(0,r.Zw)(t,n);if(void 0!==u)return this.#r.build(this,i).setData(u,{...s,manual:!0})}setQueriesData(e,t,s){return n.jG.batch(()=>this.#r.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,s)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#r.get(t.queryHash)?.state}removeQueries(e){let t=this.#r;n.jG.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let s=this.#r;return n.jG.batch(()=>(s.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let s={revert:!0,...t};return Promise.all(n.jG.batch(()=>this.#r.findAll(e).map(e=>e.cancel(s)))).then(r.lQ).catch(r.lQ)}invalidateQueries(e,t={}){return n.jG.batch(()=>(this.#r.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let s={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(n.jG.batch(()=>this.#r.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,s);return s.throwOnError||(t=t.catch(r.lQ)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(r.lQ)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let s=this.#r.build(this,t);return s.isStaleByTime((0,r.d2)(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(r.lQ).catch(r.lQ)}fetchInfiniteQuery(e){return e.behavior=y(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(r.lQ).catch(r.lQ)}ensureInfiniteQueryData(e){return e.behavior=y(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return d.t.isOnline()?this.#a.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#r}getMutationCache(){return this.#a}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#u.set((0,r.EN)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#u.values()],s={};return t.forEach(t=>{(0,r.Cp)(e,t.queryKey)&&Object.assign(s,t.defaultOptions)}),s}setMutationDefaults(e,t){this.#l.set((0,r.EN)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#l.values()],s={};return t.forEach(t=>{(0,r.Cp)(e,t.mutationKey)&&Object.assign(s,t.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,r.F$)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===r.hT&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#r.clear(),this.#a.clear()}},g=s(6715),b=s(2115),v=s(2842);function q(e){let{children:t}=e,[s]=(0,b.useState)(()=>new m({defaultOptions:{queries:{staleTime:3e5,gcTime:6e5,refetchOnWindowFocus:!1}}}));return(0,i.jsx)(v.vD,{children:(0,i.jsx)(g.Ht,{client:s,children:t})})}},9324:()=>{}},e=>{var t=t=>e(e.s=t);e.O(0,[724,533,897,671,441,684,358],()=>t(7313)),_N_E=e.O()}]);