티스토리 수익 글 보기
“use strict”;(globalThis.webpackChunk_github_ui_github_ui=globalThis.webpackChunk_github_ui_github_ui||[]).push([[23832],{2471:(e,t,s)=>{s.d(t,{$:()=>u});var i=s(24880),r=s(79757),a=s(26261),n=s(66500),u=class extends n.Q{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,s){let a=t.queryKey,n=t.queryHash??(0,i.F$)(a,t),u=this.get(n);return u||(u=new r.X({client:e,queryKey:a,queryHash:n,options:e.defaultQueryOptions(t),state:s,defaultOptions:e.getQueryDefaults(a)}),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(){a.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,i.MK)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,i.MK)(e,t)):t}notify(e){a.jG.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){a.jG.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){a.jG.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}}},16213:(e,t,s)=>{s.d(t,{_:()=>r});var i=s(53482);function r(e,t){(0,i._)(e,t),t.add(e)}},57678:(e,t,s)=>{s.d(t,{q:()=>u});var i=s(26261),r=s(36158),a=s(24880),n=s(66500),u=class extends n.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 r.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=o(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=o(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=o(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=o(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(){i.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,a.nJ)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,a.nJ)(e,t))}notify(e){i.jG.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return i.jG.batch(()=>Promise.all(e.map(e=>e.continue().catch(a.lQ))))}};function o(e){return e.options.scope?.id}},58959:(e,t,s)=>{s.d(t,{PL:()=>r,RQ:()=>o,rB:()=>u});var i=s(24880);function r(e){return{onFetch:(t,s)=>{let r=t.options,u=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],h=t.state.data?.pageParams||[],l={pages:[],pageParams:[]},c=0,f=async()=>{let s=!1,f=(0,i.ZM)(t.options,t.fetchOptions),d=async(e,r,a)=>{let n;if(s)return Promise.reject();if(null==r&&e.pages.length)return Promise.resolve(e);let u=(Object.defineProperty(n={client:t.client,queryKey:t.queryKey,pageParam:r,direction:a?”backward”:”forward”,meta:t.options.meta},”signal”,{enumerable:!0,get:()=>(t.signal.aborted?s=!0:t.signal.addEventListener(“abort”,()=>{s=!0}),t.signal)}),n),o=await f(u),{maxPages:h}=t.options,l=a?i.ZZ:i.y9;return{pages:l(e.pages,o,h),pageParams:l(e.pageParams,r,h)}};if(u&&o.length){let e=”backward”===u,t={pages:o,pageParams:h},s=(e?n:a)(r,t);l=await d(t,s,e)}else{let t=e??o.length;do{let e=0===c?h[0]??r.initialPageParam:a(r,l);if(c>0&&null==e)break;l=await d(l,e),c++}while(ct.options.persister?.(f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s):t.fetchFn=f}}}function a(e,{pages:t,pageParams:s}){let i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,s[i],s):void 0}function n(e,{pages:t,pageParams:s}){return t.length>0?e.getPreviousPageParam?.(t[0],t,s[0],s):void 0}function u(e,t){return!!t&&null!=a(e,t)}function o(e,t){return!!t&&!!e.getPreviousPageParam&&null!=n(e,t)}},65490:(e,t,s)=>{s.d(t,{E:()=>l});var i=s(24880),r=s(2471),a=s(57678),n=s(29658),u=s(96035),o=s(26261),h=s(58959),l=class{#r;#a;#n;#u;#o;#h;#l;#c;constructor(e={}){this.#r=e.queryCache||new r.$,this.#a=e.mutationCache||new a.q,this.#n=e.defaultOptions||{},this.#u=new Map,this.#o=new Map,this.#h=0}mount(){this.#h++,1===this.#h&&(this.#l=n.m.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#r.onFocus())}),this.#c=u.t.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#r.onOnline())}))}unmount(){this.#h–,0===this.#h&&(this.#l?.(),this.#l=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),r=s.state.data;return void 0===r?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime((0,i.d2)(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#r.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,s){let r=this.defaultQueryOptions({queryKey:e}),a=this.#r.get(r.queryHash),n=a?.state.data,u=(0,i.Zw)(t,n);if(void 0!==u)return this.#r.build(this,r).setData(u,{…s,manual:!0})}setQueriesData(e,t,s){return o.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;o.jG.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let s=this.#r;return o.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(o.jG.batch(()=>this.#r.findAll(e).map(e=>e.cancel(s)))).then(i.lQ).catch(i.lQ)}invalidateQueries(e,t={}){return o.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(o.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(i.lQ)),”paused”===e.state.fetchStatus?Promise.resolve():t}))).then(i.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,i.d2)(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(i.lQ).catch(i.lQ)}fetchInfiniteQuery(e){return e.behavior=(0,h.PL)(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(i.lQ).catch(i.lQ)}ensureInfiniteQueryData(e){return e.behavior=(0,h.PL)(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return u.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,i.EN)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[…this.#u.values()],s={};return t.forEach(t=>{(0,i.Cp)(e,t.queryKey)&&Object.assign(s,t.defaultOptions)}),s}setMutationDefaults(e,t){this.#o.set((0,i.EN)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[…this.#o.values()],s={};return t.forEach(t=>{(0,i.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,i.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===i.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()}}},88243:(e,t,s)=>{s.d(t,{_:()=>i});function i(e,t,s){if(!t.has(e))throw TypeError(“attempted to get private field on non-instance”);return s}},97665:(e,t,s)=>{s.d(t,{Ht:()=>u,jE:()=>n,v4:()=>a});var i=s(96540),r=s(74848),a=i.createContext(void 0),n=e=>{let t=i.useContext(a);if(e)return e;if(!t)throw Error(“No QueryClient set, use QueryClientProvider to set one”);return t},u=({client:e,children:t})=>(i.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,r.jsx)(a.Provider,{value:e,children:t}))}}]);
//# sourceMappingURL=23832-011ab9900750.js.map