omnigateway 0.9.0 → 0.9.2
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/README.md +89 -608
- package/bin/omni.js +6347 -2002
- package/gateway.js +7642 -2632
- package/package.json +1 -1
- package/public/assets/{Chip-shturdCv.js → Chip-Did4Zhvj.js} +1 -1
- package/public/assets/{CopyValue-BGt9RRTL.js → CopyValue-Cjg9QXrD.js} +1 -1
- package/public/assets/Lamp-C2Q3t5Mn.js +25 -0
- package/public/assets/Rack-D0_N-xsd.js +476 -0
- package/public/assets/{RequestTable-huSAoNZg.js → RequestTable-i9paP_7e.js} +1 -1
- package/public/assets/{SummaryDeck-BPo2bMSC.js → SummaryDeck-g4yLDeXB.js} +1 -1
- package/public/assets/{Toggle-C84xs_YB.js → Toggle-D-NDlneh.js} +1 -1
- package/public/assets/{TokenBreakdown-CmzXuENj.js → TokenBreakdown-D5ZIngM6.js} +1 -1
- package/public/assets/{WindowChart-BZzVrxYk.js → WindowChart-BsonO5Py.js} +1 -1
- package/public/assets/{_app.accounts-DMmtkwnl.js → _app.accounts-DFhyE62a.js} +1 -1
- package/public/assets/{_app.console-BBz3kCPV.js → _app.console-BfHcfQMp.js} +6 -6
- package/public/assets/{_app.database-ZvtMVgsh.js → _app.database-Cgw9z3rK.js} +1 -1
- package/public/assets/{_app.index-DKouD-rz.js → _app.index-Blw3S4-3.js} +1 -1
- package/public/assets/{_app.keys-BG9-zfh6.js → _app.keys-DrdfnfIk.js} +1 -1
- package/public/assets/{_app.logs-DjinYGYS.js → _app.logs-DUOqlJzB.js} +1 -1
- package/public/assets/{_app.models-BCfQVuoT.js → _app.models-Dm83HRaM.js} +1 -1
- package/public/assets/{_app.plugins._pluginId-Dm48f3wz.js → _app.plugins._pluginId-BmJGDYxw.js} +1 -1
- package/public/assets/{_app.settings-C42ylcNP.js → _app.settings-66rm4vHJ.js} +1 -1
- package/public/assets/{_app.usage-DfPM6eQ-.js → _app.usage-BCufy5XR.js} +1 -1
- package/public/assets/{chevron-right-HI_fK6Gw.js → chevron-right-BZ4QmUDM.js} +1 -1
- package/public/assets/{client-TUf0nuim.js → client-De1_cEH5.js} +1 -1
- package/public/assets/index-PP8vsvw3.js +13 -0
- package/public/assets/{login-w-hVstKf.js → login-CkZlwcdd.js} +1 -1
- package/public/assets/plus-D5AwIXj3.js +1 -0
- package/public/assets/preload-helper-BC9bKUg1.js +1 -0
- package/public/assets/shared-C47BfV_u.js +77 -0
- package/public/assets/{trash-2-Bq4GaXzx.js → trash-2-BLc5o7DN.js} +1 -1
- package/public/index.html +4 -7
- package/public/shared/chunks/{react-dom-BTlfKTOo.js → react-dom-BFxyned6.js} +1 -1
- package/public/shared/dashboard-sdk.js +1 -1
- package/public/shared/react-dom-client.js +3 -3
- package/public/shared/react-dom.js +1 -1
- package/public/shared/react-query.js +1 -1
- package/public/shared/styled-components.js +2 -2
- package/public/assets/Lamp-CVGUT2YK.js +0 -25
- package/public/assets/Rack-BbZyyu2u.js +0 -466
- package/public/assets/_app.plugins._pluginId-B9k5eqAt.js +0 -2
- package/public/assets/index-C66Zn0tX.js +0 -13
- package/public/assets/login-DWgivEPK.js +0 -2
- package/public/assets/plus-BCf2TPqz.js +0 -1
- package/public/assets/preload-helper-Unv7FI91.js +0 -1
- package/public/assets/shared-XRnr7At9.js +0 -77
- package/public/assets/stream-3PafhwhZ.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunks/rolldown-runtime-CbXtAM7H.js";import{t}from"./chunks/react-dom-
|
|
1
|
+
import{n as e}from"./chunks/rolldown-runtime-CbXtAM7H.js";import{t}from"./chunks/react-dom-BFxyned6.js";var n=e(t(),1),r=n.default,{createPortal:i,flushSync:a,preconnect:o,prefetchDNS:s,preload:c,preloadModule:l}=n.default;export{i as createPortal,r as default,a as flushSync,o as preconnect,s as prefetchDNS,c as preload,l as preloadModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunks/rolldown-runtime-CbXtAM7H.js";import{t}from"./chunks/react-GitiQ0dt.js";import{t as n}from"./chunks/jsx-runtime-CznXPbDH.js";var r=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(){}},i=new class extends r{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},a={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},o=new class{#e=a;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function s(e){setTimeout(e,0)}var c=typeof window>`u`||`Deno`in globalThis;function l(){}function u(e,t){return typeof e==`function`?e(t):e}function d(e){return typeof e==`number`&&e>=0&&e!==1/0}function f(e,t){return Math.max(e+(t||0)-Date.now(),0)}function p(e,t){return typeof e==`function`?e(t):e}function m(e,t){return typeof e==`function`?e(t):e}function h(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==_(o,t.options))return!1}else if(!y(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function g(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(v(t.options.mutationKey)!==v(a))return!1}else if(!y(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function _(e,t){return(t?.queryKeyHashFn||v)(e)}function v(e){return JSON.stringify(e,(e,t)=>C(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function y(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!y(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!y(e[r],t[r]))return!1;return!0}return!1}var b=Object.prototype.hasOwnProperty;function x(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=ee(e)&&ee(t);if(!r&&!(C(e)&&C(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:b.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=x(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function S(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function ee(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function C(e){if(!te(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!te(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function te(e){return Object.prototype.toString.call(e)===`[object Object]`}function ne(e){return new Promise(t=>{o.setTimeout(t,e)})}function w(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:x(e,t)}function re(e){return e}function ie(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ae(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var T=Symbol();function E(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===T?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function D(e,t){return typeof e==`function`?e(...t):!!e}function oe(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var O=(()=>{let e=()=>c;return{isServer(){return e()},setIsServer(t){e=t}}})();function k(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}function se(e){let t;if(e.then(e=>(t=e,e),l)?.catch(l),t!==void 0)return{data:t}}function ce(e){return e}function le(e){return{mutationKey:e.options.mutationKey,state:e.state,...e.options.scope&&{scope:e.options.scope},...e.meta&&{meta:e.meta}}}function ue(e,t,n){let r=()=>{let r=e.promise?.then(t).catch(e=>n(e)?Promise.reject(Error(`redacted`)):Promise.reject(e));return r?.catch(l),r};return{dehydratedAt:Date.now(),state:{...e.state,...e.state.data!==void 0&&{data:t(e.state.data)}},queryKey:e.queryKey,queryHash:e.queryHash,...e.state.status===`pending`&&{promise:r()},...e.meta&&{meta:e.meta},...e.queryType&&{queryType:e.queryType}}}function de(e){return e.state.isPaused}function fe(e){return e.state.status===`success`}function pe(e){return!0}function me(e,t={}){let n=t.shouldDehydrateMutation??e.getDefaultOptions().dehydrate?.shouldDehydrateMutation??de,r=e.getMutationCache().getAll().flatMap(e=>n(e)?[le(e)]:[]),i=t.shouldDehydrateQuery??e.getDefaultOptions().dehydrate?.shouldDehydrateQuery??fe,a=t.shouldRedactErrors??e.getDefaultOptions().dehydrate?.shouldRedactErrors??pe,o=t.serializeData??e.getDefaultOptions().dehydrate?.serializeData??ce;return{mutations:r,queries:e.getQueryCache().getAll().flatMap(e=>i(e)?[ue(e,o,a)]:[])}}function A(e,t,n){if(typeof t!=`object`||!t)return;let r=e.getMutationCache(),i=e.getQueryCache(),a=n?.defaultOptions?.deserializeData??e.getDefaultOptions().hydrate?.deserializeData??ce,o=t.mutations||[],s=t.queries||[];o.forEach(({state:t,...i})=>{r.build(e,{...e.getDefaultOptions().hydrate?.mutations,...n?.defaultOptions?.mutations,...i},t)}),s.forEach(({queryKey:t,state:r,queryHash:o,meta:s,promise:c,dehydratedAt:u,queryType:d})=>{let f=c?se(c):void 0,p=r.data===void 0?f?.data:r.data,m=p===void 0?p:a(p),h=i.get(o),g=h?.state.status===`pending`,_=h?.state.fetchStatus===`fetching`;if(h){let e=f&&u!==void 0&&u>h.state.dataUpdatedAt;if(r.dataUpdatedAt>h.state.dataUpdatedAt||e){let{fetchStatus:e,...t}=r;h.setState({...t,data:m,...r.status===`pending`&&m!==void 0&&{status:`success`,dataUpdatedAt:u??Date.now(),...!_&&{fetchStatus:`idle`}}})}}else h=i.build(e,{...e.getDefaultOptions().hydrate?.queries,...n?.defaultOptions?.queries,queryKey:t,queryHash:o,meta:s,_type:d},{...r,data:m,fetchStatus:`idle`,status:r.status===`pending`&&m!==void 0?`success`:r.status,...r.status===`pending`&&m!==void 0&&{dataUpdatedAt:u??Date.now()}});c&&!f&&!g&&!_&&(u===void 0||u>h.state.dataUpdatedAt)&&h.fetch(void 0,{initialPromise:Promise.resolve(c).then(a)}).catch(l)})}var he=s;function ge(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=he,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var j=ge(),M=new class extends r{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function _e(e){return Math.min(1e3*2**e,3e4)}function N(e){return(e??`online`)!==`online`||M.isOnline()}var P=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function ve(e){return e instanceof P}function F(e){let t=!1,n=0,r,a=k(),o=()=>a.status!==`pending`,s=t=>{if(!o()){let n=new P(t);p(n),e.onCancel?.(n)}},c=()=>{t=!0},l=()=>{t=!1},u=()=>i.isFocused()&&(e.networkMode===`always`||M.isOnline())&&e.canRun(),d=()=>N(e.networkMode)&&e.canRun(),f=e=>{o()||(r?.(),a.resolve(e))},p=e=>{o()||(r?.(),a.reject(e))},m=()=>new Promise(t=>{r=e=>{(o()||u())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,o()||e.onContinue?.()}),h=()=>{if(o())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(f).catch(r=>{if(o())return;let i=e.retry??(O.isServer()?0:3),a=e.retryDelay??_e,s=typeof a==`function`?a(n,r):a,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){p(r);return}n++,e.onFail?.(n,r),ne(s).then(()=>u()?void 0:m()).then(()=>{t?p(r):h()})})};return{promise:a,status:()=>a.status,cancel:s,continue:()=>(r?.(),a),cancelRetry:c,continueRetry:l,canStart:d,start:()=>(d()?h():m().then(h),a)}}var I=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),d(this.gcTime)&&(this.#e=o.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(O.isServer()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(o.clearTimeout(this.#e),this.#e=void 0)}};function ye(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{oe(e,()=>t.signal,()=>n=!0)},u=E(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?ae:ie;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?R:L,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:L(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function L(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function R(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function be(e,t){return t?L(e,t)!=null:!1}function xe(e,t){return!t||!e.getPreviousPageParam?!1:R(e,t)!=null}var Se=class extends I{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=z(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=z(this.options);e.data!==void 0&&(this.setState(we(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=w(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(l).catch(l):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>m(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===T||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>p(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!f(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=E(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?ye(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=F({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof P&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof P){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Ce(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...we(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),j.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Ce(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:N(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function we(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function z(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var B=class extends r{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=k(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Ee(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return V(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return V(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof m(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!S(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&De(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||m(this.options.enabled,this.#t)!==m(t.enabled,this.#t)||p(this.options.staleTime,this.#t)!==p(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||m(this.options.enabled,this.#t)!==m(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Oe(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(l)),t}#g(){this.#b();let e=p(this.options.staleTime,this.#t);if(O.isServer()||this.#r.isStale||!d(e))return;let t=f(this.#r.dataUpdatedAt,e)+1;this.#d=o.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(O.isServer()||m(this.options.enabled,this.#t)===!1||!d(this.#p)||this.#p===0)&&(this.#f=o.setInterval(()=>{(this.options.refetchIntervalInBackground||i.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(o.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(o.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Ee(e,t),o=i&&De(e,n,t,r);(a||o)&&(l={...l,...Ce(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:h}=l;d=l.data;let g=!1;if(t.placeholderData!==void 0&&d===void 0&&h===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,g=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(h=`success`,d=w(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!g)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=w(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),h=`error`);let _=l.fetchStatus===`fetching`,v=h===`pending`,y=h===`error`,b=v&&_,x=d!==void 0,S={status:h,fetchStatus:l.fetchStatus,isPending:v,isSuccess:h===`success`,isError:y,isInitialLoading:b,isLoading:b,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:_,isRefetching:_&&!v,isLoadingError:y&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:y&&x,isStale:H(e,t),refetch:this.refetch,promise:this.#o,isEnabled:m(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=S.data!==void 0,r=S.status===`error`&&!t,i=e=>{r?e.reject(S.error):t&&e.resolve(S.data)},a=()=>{let e=this.#o=S.promise=k();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||S.data!==o.value)&&a();break;case`rejected`:(!r||S.error!==o.reason)&&a()}}return S}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!S(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){j.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function Te(e,t){return m(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||m(t.retryOnMount,e)!==!1)}function Ee(e,t){return Te(e,t)||e.state.data!==void 0&&V(e,t,t.refetchOnMount)}function V(e,t,n){if(m(t.enabled,e)!==!1&&p(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&H(e,t)}return!1}function De(e,t,n,r){return(e!==t||m(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&H(e,n)}function H(e,t){return m(t.enabled,e)!==!1&&e.isStaleByTime(p(t.staleTime,e))}function Oe(e,t){return!S(e.getCurrentResult(),t)}var U=class extends B{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,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){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:be(t,n.data),hasPreviousPage:xe(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},ke=class extends I{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Ae(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=F({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),j.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Ae(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var je=class extends r{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new ke({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=W(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=W(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=W(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=W(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){j.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>g(t,e))}findAll(e={}){return this.getAll().filter(t=>g(e,t))}notify(e){j.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return j.batch(()=>Promise.all(e.map(e=>e.continue().catch(l))))}};function W(e){return e.options.scope?.id}var Me=class extends r{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),S(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&v(t.mutationKey)!==v(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Ae();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){j.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function Ne(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}function Pe(e,t,n){let r=e.slice(0);return r[t]=n,r}var Fe=class extends r{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,j.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!S(e,n)});!o&&!s||(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(Ne(e,n).forEach(e=>{e.destroy()}),Ne(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){return t.map((n,r)=>{let i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,e=>{t.forEach(t=>{t.observer.trackProp(e)})})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(!this.#a||this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=x(this.#a,t(e))),this.#a}return e}#f(){return this.#r?.combine!==void 0&&this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new B(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=Pe(this.#t,n,t),this.#h())}#h(){if(this.hasListeners()){let e=this.#u(this.#t,this.#l),t=this.#f(),n=this.#a,r=t?n:this.#d(e,this.#r?.combine);(t||n!==r)&&j.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},Ie=class extends r{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??_(r,t),a=this.get(i);return a||(a=new Se({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}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(){j.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=>h(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>h(e,t)):t}notify(e){j.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){j.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){j.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Le=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Ie,this.#t=e.mutationCache||new je,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=i.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=M.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(p(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=u(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return j.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;j.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return j.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=j.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(l).catch(l)}invalidateQueries(e,t={}){return j.batch(()=>(this.#e.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 n={...t,cancelRefetch:t.cancelRefetch??!0},r=j.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(l)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(l)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(p(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(l).catch(l)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(l).catch(l)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return M.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(v(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{y(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(v(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{y(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=_(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===T&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};function Re({streamFn:e,refetchMode:t=`reset`,reducer:n=(e,t)=>ie(e,t),initialValue:r=[]}){return async i=>{let a=i.client.getQueryCache().find({queryKey:i.queryKey,exact:!0}),o=!!a&&a.isFetched();o&&t===`reset`&&a.setState({...a.resetState,fetchStatus:`fetching`});let s=r,c=!1,l=await e(oe({client:i.client,meta:i.meta,queryKey:i.queryKey,pageParam:i.pageParam,direction:i.direction},()=>i.signal,()=>c=!0)),u=o&&t===`replace`;for await(let e of l){if(c)break;u?s=n(s,e):i.client.setQueryData(i.queryKey,t=>n(t===void 0?r:t,e))}return u&&!c&&i.client.setQueryData(i.queryKey,s),i.client.getQueryData(i.queryKey)??r}}var ze=Symbol(`dataTagSymbol`),Be=Symbol(`dataTagErrorSymbol`),Ve=Symbol(`unsetMarker`),G=e(t(),1),He=e(n(),1),K=G.createContext(void 0),q=e=>{let t=G.useContext(K);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Ue=({client:e,children:t})=>(G.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,He.jsx)(K.Provider,{value:e,children:t})),We=G.createContext(!1),J=()=>G.useContext(We),Ge=We.Provider;function Ke(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var qe=G.createContext(Ke()),Y=()=>G.useContext(qe),Je=({children:e})=>{let[t]=G.useState(()=>Ke());return(0,He.jsx)(qe.Provider,{value:t,children:typeof e==`function`?e(t):e})},Ye=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?D(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Xe=e=>{G.useEffect(()=>{e.clearReset()},[e])},Ze=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||D(n,[e.error,r])),X=(e,t)=>t.state.data===void 0,Qe=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},$e=(e,t)=>e.isLoading&&e.isFetching&&!t,Z=(e,t)=>e?.suspense&&t.isPending,Q=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function et({queries:e,...t},n){let r=q(n),i=J(),a=Y(),o=G.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:`optimistic`,t}),[e,r,i]);o.forEach(e=>{Qe(e);let t=r.getQueryCache().get(e.queryHash);Ye(e,a,t)}),Xe(a);let[s]=G.useState(()=>new Fe(r,o,t)),[c,u,d]=s.getOptimisticResult(o,t.combine),f=!i&&t.subscribed!==!1;G.useSyncExternalStore(G.useCallback(e=>f?s.subscribe(j.batchCalls(e)):l,[s,f]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),G.useEffect(()=>{s.setQueries(o,t)},[o,t,s]);let p=c.some((e,t)=>Z(o[t],e))?c.flatMap((e,t)=>{let n=o[t];return n&&Z(n,e)?Q(n,new B(r,n),a):[]}):[];if(p.length>0)throw Promise.all(p);let m=c.find((e,t)=>{let n=o[t];return n&&Ze({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(m?.error)throw m.error;return u(d())}function $(e,t,n){let r=J(),i=Y(),a=q(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Qe(o),Ye(o,i,s),Xe(i);let u=!a.getQueryCache().get(o.queryHash),[d]=G.useState(()=>new t(a,o)),f=d.getOptimisticResult(o),p=!r&&c;if(G.useSyncExternalStore(G.useCallback(e=>{let t=p?d.subscribe(j.batchCalls(e)):l;return d.updateResult(),t},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),G.useEffect(()=>{d.setOptions(o)},[o,d]),Z(o,f))throw Q(o,d,i);if(Ze({result:f,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw f.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,f),o.experimental_prefetchInRender&&!O.isServer()&&$e(f,r)&&(u?Q(o,d,i):s?.promise)?.catch(l).finally(()=>{d.updateResult()}),o.notifyOnChangeProps?f:d.trackResult(f)}function tt(e,t){return $(e,B,t)}function nt(e,t){return $({...e,enabled:!0,suspense:!0,throwOnError:X,placeholderData:void 0},B,t)}function rt(e,t){return $({...e,enabled:!0,suspense:!0,throwOnError:X},U,t)}function it(e,t){return et({...e,queries:e.queries.map(e=>({...e,suspense:!0,throwOnError:X,enabled:!0,placeholderData:void 0}))},t)}function at(e,t){let n=q(t);n.getQueryState(e.queryKey)||n.prefetchQuery(e)}function ot(e,t){let n=q(t);n.getQueryState(e.queryKey)||n.prefetchInfiniteQuery(e)}function st(e){return e}function ct(e){return e}var lt=({children:e,options:t={},state:n,queryClient:r})=>{let i=q(r),a=G.useRef(t);G.useEffect(()=>{a.current=t});let o=G.useMemo(()=>{if(n){if(typeof n!=`object`)return;let e=i.getQueryCache(),t=n.queries||[],r=[],o=[];for(let n of t){let t=e.get(n.queryHash);t?(n.state.dataUpdatedAt>t.state.dataUpdatedAt||n.promise&&t.state.status!==`pending`&&t.state.fetchStatus!==`fetching`&&n.dehydratedAt!==void 0&&n.dehydratedAt>t.state.dataUpdatedAt)&&o.push(n):r.push(n)}if(r.length>0&&A(i,{queries:r},a.current),o.length>0)return o}},[i,n]);return G.useEffect(()=>{o&&A(i,{queries:o},a.current)},[i,o]),e};function ut(e,t){let n=q(t),r=n.getQueryCache();return G.useSyncExternalStore(G.useCallback(e=>r.subscribe(j.batchCalls(e)),[r]),()=>n.isFetching(e),()=>n.isFetching(e))}function dt(e,t){let n=q(t);return pt({filters:{...e,status:`pending`}},n).length}function ft(e,t){return e.findAll(t.filters).map(e=>t.select?t.select(e):e.state)}function pt(e={},t){let n=q(t).getMutationCache(),r=G.useRef(e),i=G.useRef(null);return i.current===null&&(i.current=ft(n,e)),G.useEffect(()=>{r.current=e}),G.useSyncExternalStore(G.useCallback(e=>n.subscribe(()=>{let t=x(i.current,ft(n,r.current));i.current!==t&&(i.current=t,j.schedule(e))}),[n]),()=>i.current,()=>i.current)}function mt(e,t){let n=q(t),[r]=G.useState(()=>new Me(n,e));G.useEffect(()=>{r.setOptions(e)},[r,e]);let i=G.useSyncExternalStore(G.useCallback(e=>r.subscribe(j.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=G.useCallback((e,t)=>{r.mutate(e,t).catch(l)},[r]);if(i.error&&D(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function ht(e){return e}function gt(e,t){return $(e,U,t)}export{P as CancelledError,lt as HydrationBoundary,U as InfiniteQueryObserver,Ge as IsRestoringProvider,ke as Mutation,je as MutationCache,Me as MutationObserver,Fe as QueriesObserver,Se as Query,Ie as QueryCache,Le as QueryClient,K as QueryClientContext,Ue as QueryClientProvider,Je as QueryErrorResetBoundary,B as QueryObserver,Be as dataTagErrorSymbol,ze as dataTagSymbol,he as defaultScheduler,de as defaultShouldDehydrateMutation,fe as defaultShouldDehydrateQuery,me as dehydrate,O as environmentManager,Re as experimental_streamedQuery,i as focusManager,v as hashKey,A as hydrate,ct as infiniteQueryOptions,ve as isCancelledError,c as isServer,re as keepPreviousData,g as matchMutation,h as matchQuery,ht as mutationOptions,l as noop,j as notifyManager,M as onlineManager,y as partialMatchKey,st as queryOptions,x as replaceEqualDeep,D as shouldThrowError,T as skipToken,o as timeoutManager,Ve as unsetMarker,gt as useInfiniteQuery,ut as useIsFetching,dt as useIsMutating,J as useIsRestoring,mt as useMutation,pt as useMutationState,ot as usePrefetchInfiniteQuery,at as usePrefetchQuery,et as useQueries,tt as useQuery,q as useQueryClient,Y as useQueryErrorResetBoundary,rt as useSuspenseInfiniteQuery,it as useSuspenseQueries,nt as useSuspenseQuery};
|
|
1
|
+
import{n as e}from"./chunks/rolldown-runtime-CbXtAM7H.js";import{t}from"./chunks/react-GitiQ0dt.js";import{t as n}from"./chunks/jsx-runtime-CznXPbDH.js";var r=e(t(),1),i=e(n(),1),a=r.createContext(void 0),o=e=>{let t=r.useContext(a);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},s=({client:e,children:t})=>(r.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,i.jsx)(a.Provider,{value:e,children:t})),c={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},l=new class{#e=c;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function u(e){setTimeout(e,0)}var d=typeof window>`u`||`Deno`in globalThis;function f(){}function p(e,t){return typeof e==`function`?e(t):e}function m(e){return typeof e==`number`&&e>=0&&e!==1/0}function h(e,t){return Math.max(e+(t||0)-Date.now(),0)}function g(e,t){return typeof e==`function`?e(t):e}function _(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==y(o,t.options))return!1}else if(!x(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function v(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(b(t.options.mutationKey)!==b(a))return!1}else if(!x(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function y(e,t){return(t?.queryKeyHashFn||b)(e)}function b(e){return JSON.stringify(e,(e,t)=>w(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function x(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!x(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!x(e[r],t[r]))return!1;return!0}return!1}var ee=Object.prototype.hasOwnProperty;function S(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=te(e)&&te(t);if(!r&&!(w(e)&&w(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ee.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=S(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function C(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function te(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function w(e){if(!ne(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ne(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function ne(e){return Object.prototype.toString.call(e)===`[object Object]`}function re(e){return new Promise(t=>{l.setTimeout(t,e)})}function T(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:S(e,t)}function ie(e){return e}function ae(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function oe(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var E=Symbol();function se(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===E?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function D(e,t){return typeof e==`function`?e(...t):!!e}function ce(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var O=()=>d,k=()=>O(),le={isServer:k,setIsServer(e){O=e}},A=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(){}},j=new class extends A{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}};function ue(e){let t;if(e.then(e=>(t=e,e),f)?.catch?.(f),t!==void 0)return{data:t}}function de(e){return{mutationKey:e.options.mutationKey,state:e.state,...e.options.scope&&{scope:e.options.scope},...e.meta&&{meta:e.meta}}}function fe(e,t,n){let r=e.promise?.then(t).catch(e=>n?.(e)===!1?Promise.reject(e):Promise.reject(Error(`redacted`)));return r?.catch(f),r}function pe(e,t,n){return{dehydratedAt:Date.now(),state:{...e.state,...e.state.data!==void 0&&{data:t?t(e.state.data):e.state.data}},queryKey:e.queryKey,queryHash:e.queryHash,...e.state.status===`pending`&&{promise:fe(e,t,n)},...e.meta&&{meta:e.meta},...e.queryType&&{queryType:e.queryType}}}function me(e){return e.state.isPaused}function he(e){return e.state.status===`success`}function ge(e,t={}){let n=t.shouldDehydrateMutation??e.getDefaultOptions().dehydrate?.shouldDehydrateMutation??me,r=e.getMutationCache().getAll().flatMap(e=>n(e)?[de(e)]:[]),i=t.shouldDehydrateQuery??e.getDefaultOptions().dehydrate?.shouldDehydrateQuery??he,a=t.shouldRedactErrors??e.getDefaultOptions().dehydrate?.shouldRedactErrors,o=t.serializeData??e.getDefaultOptions().dehydrate?.serializeData;return{mutations:r,queries:e.getQueryCache().getAll().flatMap(e=>i(e)?[pe(e,o,a)]:[])}}function M(e,t,n){let r=e.getMutationCache(),i=e.getQueryCache(),a=n?.defaultOptions?.deserializeData??e.getDefaultOptions().hydrate?.deserializeData;t.mutations?.forEach(({state:t,...i})=>{r.build(e,{...e.getDefaultOptions().hydrate?.mutations,...n?.defaultOptions?.mutations,...i},t)}),t.queries?.forEach(({queryKey:t,state:r,queryHash:o,meta:s,promise:c,dehydratedAt:l,queryType:u})=>{let d=c?ue(c):void 0,p=r.data===void 0?d?.data:r.data,m=p===void 0?p:a?a(p):p,h=i.get(o),g=h?.state.status===`pending`,_=h?.state.fetchStatus===`fetching`;if(h){let e=d&&l!==void 0&&l>h.state.dataUpdatedAt;if(r.dataUpdatedAt>h.state.dataUpdatedAt||e){let{fetchStatus:e,...t}=r;h.setState({...t,data:m,...r.status===`pending`&&m!==void 0&&{status:`success`,dataUpdatedAt:l??Date.now(),...!_&&{fetchStatus:`idle`}}})}}else h=i.build(e,{...e.getDefaultOptions().hydrate?.queries,...n?.defaultOptions?.queries,queryKey:t,queryHash:o,meta:s,_type:u},{...r,data:m,fetchStatus:`idle`,status:r.status===`pending`&&m!==void 0?`success`:r.status,...r.status===`pending`&&m!==void 0&&{dataUpdatedAt:l??Date.now()}});c&&!d&&!g&&!_&&(l===void 0||l>h.state.dataUpdatedAt)&&h.fetch(void 0,{initialPromise:Promise.resolve(c).then(a)}).catch(f)})}var _e=u;function ve(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=_e,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var N=ve(),P=new class extends A{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function ye(e){return Math.min(1e3*2**e,3e4)}function be(e){return(e??`online`)!==`online`||P.isOnline()}var F=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function xe(e){return e instanceof F}function Se(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(f);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new F(t);g(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},p=()=>j.isFocused()&&(e.networkMode===`always`||P.isOnline())&&e.canRun(),m=()=>be(e.networkMode)&&e.canRun(),h=e=>{c()||(r?.(),i=`resolved`,a(e))},g=e=>{c()||(r?.(),i=`rejected`,o(e))},_=()=>new Promise(t=>{r=e=>{(c()||p())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),v=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(h).catch(r=>{if(c())return;let i=e.retry??(k()?0:3),a=e.retryDelay??ye,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){g(r);return}n++,e.onFail?.(n,r),re(o).then(()=>p()?void 0:_()).then(()=>{t?g(r):v()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:m,start:()=>(m()?v():_().then(v),s)}}var Ce=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),m(this.gcTime)&&(this.#e=l.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(k()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(l.clearTimeout(this.#e),this.#e=void 0)}};function we(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{ce(e,()=>t.signal,()=>n=!0)},u=se(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?oe:ae;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?L:I,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:I(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function I(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function L(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function Te(e,t){return t?I(e,t)!=null:!1}function Ee(e,t){return!t||!e.getPreviousPageParam?!1:L(e,t)!=null}var R=class extends Ce{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=V(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=V(this.options);e.data!==void 0&&(this.setState(B(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=T(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(f).catch(f):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>g(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===E||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>g(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!h(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=se(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?we(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=Se({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof F&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof F){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...z(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...B(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),N.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function z(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:be(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function B(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function V(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var H=class extends A{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),U(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return W(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return W(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof g(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!C(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Oe(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||g(this.options.enabled,this.#t)!==g(t.enabled,this.#t)||g(this.options.staleTime,this.#t)!==g(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||g(this.options.enabled,this.#t)!==g(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return C(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(f)),t}#h(e){return!k()&&g(this.options.enabled,this.#t)!==!1&&m(e)}#g(){this.#b();let e=g(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=h(this.#r.dataUpdatedAt,e)+1;this.#u=l.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=l.setInterval(()=>{(this.options.refetchIntervalInBackground||j.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(l.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(l.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&U(e,t),o=i&&Oe(e,n,t,r);(a||o)&&(l={...l,...z(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=T(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=T(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let _=l.fetchStatus===`fetching`,v=m===`pending`,y=m===`error`,b=v&&_,x=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:v,isSuccess:m===`success`,isError:y,isInitialLoading:b,isLoading:b,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:_,isRefetching:_&&!v,isLoadingError:y&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:y&&x,isStale:G(e,t),refetch:this.refetch,isEnabled:g(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),C(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();N.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function De(e,t){return g(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||g(t.retryOnMount,e)!==!1)}function U(e,t){return De(e,t)||e.state.data!==void 0&&W(e,t,t.refetchOnMount)}function W(e,t,n){if(g(t.enabled,e)!==!1&&g(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&G(e,t)}return!1}function Oe(e,t,n,r){return(e!==t||g(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&G(e,n)}function G(e,t){return g(t.enabled,e)!==!1&&e.isStaleByTime(g(t.staleTime,e))}var K=class extends H{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,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){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Te(t,n.data),hasPreviousPage:Ee(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},ke=class extends Ce{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||q(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=Se({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),N.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function q(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Ae=class extends A{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new ke({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=J(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=J(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=J(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=J(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){N.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>v(t,e))}findAll(e={}){return this.getAll().filter(t=>v(e,t))}notify(e){N.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return N.batch(()=>Promise.all(e.map(e=>e.continue().catch(f))))}};function J(e){return e.options.scope?.id}var je=class extends A{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),C(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&b(t.mutationKey)!==b(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??q();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){N.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function Me(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}var Ne=class extends A{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,N.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!C(e,n)});(o||s)&&(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(Me(e,n).forEach(e=>{e.destroy()}),Me(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){let n=new Set;return t.map((r,i)=>{let a=e[i];return r.defaultedQueryOptions.notifyOnChangeProps?a:r.observer.trackResult(a,e=>{n.has(e)||(n.add(e),t.forEach(t=>{t.observer.trackProp(e)}))})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=S(this.#a,t(e))),this.#a}return e}#f(){return!this.#r?.combine||this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new H(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=this.#t.slice(),this.#t[n]=t,this.#h())}#h(){if(this.hasListeners()){let e=this.#f(),t=this.#a,n=e?t:this.#d(this.#u(this.#t,this.#l),this.#r?.combine);(e||t!==n)&&N.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},Pe=class extends A{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??y(r,t),a=this.get(i);return a||(a=new R({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}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.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=>_(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>_(e,t)):t}notify(e){N.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){N.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){N.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Fe=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Pe,this.#t=e.mutationCache||new Ae,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=j.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=P.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(g(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=p(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return N.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;N.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return N.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=N.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(f).catch(f)}invalidateQueries(e,t={}){return N.batch(()=>(this.#e.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 n={...t,cancelRefetch:t.cancelRefetch??!0},r=N.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(f)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(f)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(g(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(g(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(f).catch(f)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(f).catch(f)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return P.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(b(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{x(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(b(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{x(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=y(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===E&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};function Ie({streamFn:e,refetchMode:t=`reset`,reducer:n=(e,t)=>ae(e,t),initialValue:r=[]}){return async i=>{let a=i.client.getQueryCache().find({queryKey:i.queryKey,exact:!0}),o=!!a&&a.isFetched();o&&t===`reset`&&a.setState({...a.resetState,fetchStatus:`fetching`});let s=r,c=!1,l=await e(ce({client:i.client,meta:i.meta,queryKey:i.queryKey,pageParam:i.pageParam,direction:i.direction},()=>i.signal,()=>c=!0)),u=o&&t===`replace`;for await(let e of l){if(c)break;u?s=n(s,e):i.client.setQueryData(i.queryKey,t=>n(t===void 0?r:t,e))}return u&&!c&&i.client.setQueryData(i.queryKey,s),i.client.getQueryData(i.queryKey)??r}}var Le=Symbol(),Re=Symbol(),ze=Symbol(),Be=({children:e,options:t={},state:n,queryClient:i})=>{let a=o(i),s=r.useRef(t);r.useEffect(()=>{s.current=t});let c=r.useMemo(()=>{if(n){if(typeof n!=`object`)return;let e=a.getQueryCache(),t=n.queries||[],r=[],i=[];for(let n of t){let t=e.get(n.queryHash);t?(n.state.dataUpdatedAt>t.state.dataUpdatedAt||n.promise&&t.state.status!==`pending`&&t.state.fetchStatus!==`fetching`&&n.dehydratedAt!==void 0&&n.dehydratedAt>t.state.dataUpdatedAt)&&i.push(n):r.push(n)}if(r.length>0&&M(a,{queries:r},s.current),i.length>0)return i}},[a,n]);return r.useEffect(()=>{c&&M(a,{queries:c},s.current)},[a,c]),e},Ve=r.createContext(!1),Y=()=>r.useContext(Ve),He=Ve.Provider;function Ue(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var We=r.createContext(Ue()),X=()=>r.useContext(We),Ge=({children:e})=>{let[t]=r.useState(()=>Ue());return(0,i.jsx)(We.Provider,{value:t,children:typeof e==`function`?e(t):e})},Ke=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?D(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},qe=e=>{r.useEffect(()=>{e.clearReset()},[e])},Je=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||D(n,[e.error,r])),Z=(e,t)=>t.state.data===void 0,Ye=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Q=(e,t)=>e?.suspense&&t.isPending,Xe=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Ze({queries:e,...t},n){let i=o(n),a=Y(),s=X(),c=t.subscribed!==!1,l=r.useMemo(()=>e.map(e=>{let t=i.defaultQueryOptions(e);return t._optimisticResults=a?`isRestoring`:c?`optimistic`:void 0,t}),[e,i,a,c]);l.forEach(e=>{Ye(e);let t=i.getQueryCache().get(e.queryHash);Ke(e,s,t)}),qe(s);let[u]=r.useState(()=>new Ne(i,l,t)),[d,p,m]=u.getOptimisticResult(l,t.combine),h=!a&&c;r.useSyncExternalStore(r.useCallback(e=>h?u.subscribe(N.batchCalls(e)):f,[u,h]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),r.useEffect(()=>{u.setQueries(l,t)},[l,t,u]);let g=d.some((e,t)=>Q(l[t],e))?d.flatMap((e,t)=>{let n=l[t];return n&&Q(n,e)?Xe(n,new H(i,n),s):[]}):[];if(g.length>0)throw Promise.all(g);let _=d.find((e,t)=>{let n=l[t];return n&&Je({result:e,errorResetBoundary:s,throwOnError:n.throwOnError,query:i.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(_)throw _.error;return p(m())}function $(e,t,n){let i=Y(),a=X(),s=o(n),c=s.defaultQueryOptions(e),l=s.getQueryCache().get(c.queryHash),u=e.subscribed!==!1;c._optimisticResults=i?`isRestoring`:u?`optimistic`:void 0,Ye(c),Ke(c,a,l),qe(a);let[d]=r.useState(()=>new t(s,c)),p=d.getOptimisticResult(c),m=!i&&u;if(r.useSyncExternalStore(r.useCallback(e=>{let t=m?d.subscribe(N.batchCalls(e)):f;return d.updateResult(),t},[d,m]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),r.useEffect(()=>{d.setOptions(c)},[c,d]),Q(c,p))throw Xe(c,d,a);if(Je({result:p,errorResetBoundary:a,throwOnError:c.throwOnError,query:l,suspense:c.suspense}))throw p.error;return c.notifyOnChangeProps?p:d.trackResult(p)}function Qe(e,t){return $(e,H,t)}function $e(e,t){return $({...e,enabled:!0,suspense:!0,throwOnError:Z,placeholderData:void 0},H,t)}function et(e,t){return $({...e,enabled:!0,suspense:!0,throwOnError:Z,placeholderData:void 0},K,t)}function tt(e,t){return Ze({...e,queries:e.queries.map(e=>({...e,suspense:!0,throwOnError:Z,enabled:!0,placeholderData:void 0}))},t)}function nt(e,t){let n=o(t);n.getQueryState(e.queryKey)||n.query(e).catch(f)}function rt(e,t){let n=o(t);n.getQueryState(e.queryKey)||n.infiniteQuery(e).catch(f)}function it(e){return e}function at(e){return e}function ot(e,t){let n=o(t),i=n.getQueryCache();return r.useSyncExternalStore(r.useCallback(e=>i.subscribe(N.batchCalls(e)),[i]),()=>n.isFetching(e),()=>n.isFetching(e))}function st(e,t){let n=o(t);return lt({filters:{...e,status:`pending`}},n).length}function ct(e,t){return e.findAll(t.filters).map(e=>t.select?t.select(e):e.state)}function lt(e={},t){let n=o(t).getMutationCache(),i=r.useRef(e),a=r.useRef(null);return a.current===null&&(a.current=ct(n,e)),r.useEffect(()=>{i.current=e}),r.useSyncExternalStore(r.useCallback(e=>n.subscribe(()=>{let t=S(a.current,ct(n,i.current));a.current!==t&&(a.current=t,N.schedule(e))}),[n]),()=>a.current,()=>a.current)}function ut(e,t){let n=o(t),[i]=r.useState(()=>new je(n,e));r.useEffect(()=>{i.setOptions(e)},[i,e]);let a=r.useSyncExternalStore(r.useCallback(e=>i.subscribe(N.batchCalls(e)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),s=r.useCallback((...e)=>{i.mutate(e[0],e[1]).catch(f)},[i]);if(a.error&&D(i.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:s,mutateAsync:a.mutate}}function dt(e){return e}function ft(e,t){return $(e,K,t)}export{F as CancelledError,Be as HydrationBoundary,K as InfiniteQueryObserver,He as IsRestoringProvider,ke as Mutation,Ae as MutationCache,je as MutationObserver,Ne as QueriesObserver,R as Query,Pe as QueryCache,Fe as QueryClient,a as QueryClientContext,s as QueryClientProvider,Ge as QueryErrorResetBoundary,H as QueryObserver,Re as dataTagErrorSymbol,Le as dataTagSymbol,_e as defaultScheduler,me as defaultShouldDehydrateMutation,he as defaultShouldDehydrateQuery,ge as dehydrate,pe as dehydrateQuery,le as environmentManager,Ie as experimental_streamedQuery,j as focusManager,b as hashKey,M as hydrate,at as infiniteQueryOptions,xe as isCancelledError,d as isServer,ie as keepPreviousData,v as matchMutation,_ as matchQuery,dt as mutationOptions,f as noop,N as notifyManager,P as onlineManager,x as partialMatchKey,it as queryOptions,S as replaceEqualDeep,D as shouldThrowError,E as skipToken,l as timeoutManager,ze as unsetMarker,ft as useInfiniteQuery,ot as useIsFetching,st as useIsMutating,Y as useIsRestoring,ut as useMutation,lt as useMutationState,rt as usePrefetchInfiniteQuery,nt as usePrefetchQuery,Ze as useQueries,Qe as useQuery,o as useQueryClient,X as useQueryErrorResetBoundary,et as useSuspenseInfiniteQuery,tt as useSuspenseQueries,$e as useSuspenseQuery};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{n as e}from"./chunks/rolldown-runtime-CbXtAM7H.js";import{t}from"./chunks/react-GitiQ0dt.js";var n=`-ms-`,r=`-moz-`,i=`-webkit-`,a=`comm`,o=`rule`,s=`decl`,c=`@import`,l=`@namespace`,u=`@keyframes`,d=`@layer`,f=Math.abs,p=String.fromCharCode,m=Object.assign;function h(e,t){return b(e,0)^45?(((t<<2^b(e,0))<<2^b(e,1))<<2^b(e,2))<<2^b(e,3):0}function g(e){return e.trim()}function _(e,t){return(e=t.exec(e))?e[0]:e}function v(e,t,n){return e.replace(t,n)}function y(e,t,n){return e.indexOf(t,n)}function b(e,t){return e.charCodeAt(t)|0}function x(e,t,n){return e.slice(t,n)}function S(e){return e.length}function ee(e){return e.length}function C(e,t){return t.push(e),e}function w(e,t){return e.map(t).join(``)}function T(e,t){return e.filter(function(e){return!_(e,t)})}var E=1,D=1,O=0,k=0,A=0,j=``;function te(e,t,n,r,i,a,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:E,column:D,length:o,return:``,siblings:s}}function M(e,t){return m(te(``,null,null,``,null,null,0,e.siblings),e,{length:-e.length},t)}function N(e){for(;e.root;)e=M(e.root,{children:[e]});C(e,e.siblings)}function ne(){return A}function re(){return A=k>0?b(j,--k):0,D--,A===10&&(D=1,E--),A}function P(){return A=k<O?b(j,k++):0,D++,A===10&&(D=1,E++),A}function F(){return b(j,k)}function ie(){return k}function ae(e,t){return x(j,e,t)}function I(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function oe(e){return E=D=1,O=S(j=e),k=0,[]}function se(e){return j=``,e}function ce(e){return g(ae(k-1,de(e===91?e+2:e===40?e+1:e)))}function le(e){for(;(A=F())&&A<33;)P();return I(e)>2||I(A)>3?``:` `}function ue(e,t){for(;--t&&P()&&!(A<48||A>102||A>57&&A<65||A>70&&A<97););return ae(e,ie()+(t<6&&F()==32&&P()==32))}function de(e){for(;P();)switch(A){case e:return k;case 34:case 39:e!==34&&e!==39&&de(A);break;case 40:e===41&&de(e);break;case 92:P()
|
|
1
|
+
import{n as e}from"./chunks/rolldown-runtime-CbXtAM7H.js";import{t}from"./chunks/react-GitiQ0dt.js";var n=`-ms-`,r=`-moz-`,i=`-webkit-`,a=`comm`,o=`rule`,s=`decl`,c=`@import`,l=`@namespace`,u=`@keyframes`,d=`@layer`,f=Math.abs,p=String.fromCharCode,m=Object.assign;function h(e,t){return b(e,0)^45?(((t<<2^b(e,0))<<2^b(e,1))<<2^b(e,2))<<2^b(e,3):0}function g(e){return e.trim()}function _(e,t){return(e=t.exec(e))?e[0]:e}function v(e,t,n){return e.replace(t,n)}function y(e,t,n){return e.indexOf(t,n)}function b(e,t){return e.charCodeAt(t)|0}function x(e,t,n){return e.slice(t,n)}function S(e){return e.length}function ee(e){return e.length}function C(e,t){return t.push(e),e}function w(e,t){return e.map(t).join(``)}function T(e,t){return e.filter(function(e){return!_(e,t)})}var E=1,D=1,O=0,k=0,A=0,j=``;function te(e,t,n,r,i,a,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:E,column:D,length:o,return:``,siblings:s}}function M(e,t){return m(te(``,null,null,``,null,null,0,e.siblings),e,{length:-e.length},t)}function N(e){for(;e.root;)e=M(e.root,{children:[e]});C(e,e.siblings)}function ne(){return A}function re(){return A=k>0?b(j,--k):0,D--,A===10&&(D=1,E--),A}function P(){return A=k<O?b(j,k++):0,D++,A===10&&(D=1,E++),A}function F(){return b(j,k)}function ie(){return k}function ae(e,t){return x(j,e,t)}function I(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function oe(e){return E=D=1,O=S(j=e),k=0,[]}function se(e){return j=``,e}function ce(e){return g(ae(k-1,de(e===91?e+2:e===40?e+1:e)))}function le(e){for(;(A=F())&&A<33;)P();return I(e)>2||I(A)>3?``:` `}function ue(e,t){for(;--t&&P()&&!(A<48||A>102||A>57&&A<65||A>70&&A<97););return ae(e,ie()+(t<6&&F()==32&&P()==32))}function de(e){for(;P();)switch(A){case e:return k;case 34:case 39:e!==34&&e!==39&&de(A);break;case 40:e===41&&de(e);break;case 92:P()}return k}function fe(e,t){for(;P()&&e+A!==57&&(e+A!==84||F()!==47););return`/*`+ae(t,k-1)+`*`+p(e===47?e:P())}function pe(e){for(;!I(F());)P();return ae(e,k)}function me(e){return se(he(``,null,null,null,[``],e=oe(e),0,[0],e))}function he(e,t,n,r,i,a,o,s,c){for(var l=0,u=0,d=o,m=0,h=0,g=0,_=1,ee=1,w=1,T=0,E=``,D=i,O=a,k=r,A=E;ee;)switch(g=T,T=P()){case 40:if(g!=108&&b(A,d-1)==58){y(A+=v(ce(T),`&`,`&\f`),`&\f`,f(l?s[l-1]:0))!=-1&&(w=-1);break}case 34:case 39:case 91:A+=ce(T);break;case 9:case 10:case 13:case 32:A+=le(g);break;case 92:A+=ue(ie()-1,7);continue;case 47:switch(F()){case 42:case 47:C(_e(fe(P(),ie()),t,n,c),c),(I(g||1)==5||I(F()||1)==5)&&S(A)&&x(A,-1,void 0)!==` `&&(A+=` `);break;default:A+=`/`}break;case 123*_:s[l++]=S(A)*w;case 125*_:case 59:case 0:switch(T){case 0:case 125:ee=0;case 59+u:w==-1&&(A=v(A,/\f/g,``)),h>0&&(S(A)-d||_===0&&g===47)&&C(h>32?ve(A+`;`,r,n,d-1,c):ve(v(A,` `,``)+`;`,r,n,d-2,c),c);break;case 59:A+=`;`;default:if(C(k=ge(A,t,n,l,u,i,s,E,D=[],O=[],d,a),a),T===123){if(u===0)he(A,t,k,k,D,a,d,s,O);else{switch(m){case 99:if(b(A,3)===110)break;case 108:if(b(A,2)===97)break;default:u=0;case 100:case 109:case 115:}u?he(e,k,k,r&&C(ge(e,k,k,0,0,i,s,E,i,D=[],d,O),O),i,O,d,s,r?D:O):he(A,k,k,k,[``],O,0,s,O)}}}l=u=h=0,_=w=1,E=A=``,d=o;break;case 58:d=1+S(A),h=g;default:if(_<1){if(T==123)--_;else if(T==125&&_++==0&&re()==125)continue}switch(A+=p(T),T*_){case 38:w=u>0?1:(A+=`\f`,-1);break;case 44:s[l++]=(S(A)-1)*w,w=1;break;case 64:F()===45&&(A+=ce(P())),m=F(),u=d=S(E=A+=pe(ie())),T++;break;case 45:g===45&&S(A)==2&&(_=0)}}return a}function ge(e,t,n,r,i,a,s,c,l,u,d,p){for(var m=i-1,h=i===0?a:[``],_=ee(h),y=0,b=0,S=0;y<r;++y)for(var C=0,w=x(e,m+1,m=f(b=s[y])),T=e;C<_;++C)(T=g(b>0?h[C]+` `+w:v(w,/&\f/g,h[C])))&&(l[S++]=T);return te(e,t,n,i===0?o:c,l,u,d,p)}function _e(e,t,n,r){return te(e,t,n,a,p(ne()),x(e,2,-2),0,r)}function ve(e,t,n,r,i){return te(e,t,n,s,x(e,0,r),x(e,r+1,-1),r,i)}function ye(e,t,a){switch(h(e,t)){case 5103:return i+`print-`+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:case 6391:case 5879:case 5623:case 6135:case 4599:return i+e+e;case 4855:return i+e.replace(`add`,`source-over`).replace(`substract`,`source-out`).replace(`intersect`,`source-in`).replace(`exclude`,`xor`)+e;case 4789:return r+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return i+e+r+e+n+e+e;case 5936:switch(b(e,t+11)){case 114:return i+e+n+v(e,/[svh]\w+-[tblr]{2}/,`tb`)+e;case 108:return i+e+n+v(e,/[svh]\w+-[tblr]{2}/,`tb-rl`)+e;case 45:return i+e+n+v(e,/[svh]\w+-[tblr]{2}/,`lr`)+e}case 6828:case 4268:case 2903:return i+e+n+e+e;case 6165:return i+e+n+`flex-`+e+e;case 5187:return i+e+v(e,/(\w+).+(:[^]+)/,i+`box-$1$2`+n+`flex-$1$2`)+e;case 5443:return i+e+n+`flex-item-`+v(e,/flex-|-self/g,``)+(_(e,/flex-|baseline/)?``:n+`grid-row-`+v(e,/flex-|-self/g,``))+e;case 4675:return i+e+n+`flex-line-pack`+v(e,/align-content|flex-|-self/g,``)+e;case 5548:return i+e+n+v(e,`shrink`,`negative`)+e;case 5292:return i+e+n+v(e,`basis`,`preferred-size`)+e;case 6060:return i+`box-`+v(e,`-grow`,``)+i+e+n+v(e,`grow`,`positive`)+e;case 4554:return i+v(e,/([^-])(transform)/g,`$1`+i+`$2`)+e;case 6187:return v(v(v(e,/(zoom-|grab)/,i+`$1`),/(image-set)/,i+`$1`),e,``)+e;case 5495:case 3959:return v(e,/(image-set\([^]*)/,i+"$1$`$1");case 4968:return v(v(e,/(.+:)(flex-)?(.*)/,i+`box-pack:$3`+n+`flex-pack:$3`),/space-between/,`justify`)+i+e+e;case 4200:if(!_(e,/flex-|baseline/))return n+`grid-column-align`+x(e,t)+e;break;case 2592:case 3360:return n+v(e,`template-`,``)+e;case 4384:case 3616:return a&&a.some(function(e,n){return t=n,_(e.props,/grid-\w+-end/)})?~y(e+(a=a[t].value),`span`,0)?e:n+v(e,`-start`,``)+e+n+`grid-row-span:`+(~y(a,`span`,0)?_(a,/\d+/):+_(a,/\d+/)-_(e,/\d+/))+`;`:n+v(e,`-start`,``)+e;case 4896:case 4128:return a&&a.some(function(e){return _(e.props,/grid-\w+-start/)})?e:n+v(v(e,`-end`,`-span`),`span `,``)+e;case 4095:case 3583:case 4068:case 2532:return v(e,/(.+)-inline(.+)/,i+`$1$2`)+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(S(e)-1-t>6)switch(b(e,t+1)){case 109:if(b(e,t+4)!==45)break;case 102:return v(e,/(.+:)(.+)-([^]+)/,`$1`+i+`$2-$3$1`+r+(b(e,t+3)==108?`$3`:`$2-$3`))+e;case 115:return~y(e,`stretch`,0)?ye(v(e,`stretch`,`fill-available`),t,a)+e:e}break;case 5152:case 5920:return v(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(t,r,i,a,o,s,c){return n+r+`:`+i+c+(a?n+r+`-span:`+(o?s:+s-i)+c:``)+e});case 4949:if(b(e,t+6)===121)return v(e,`:`,`:`+i)+e;break;case 6444:switch(b(e,b(e,14)===45?18:11)){case 120:return v(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,`$1`+i+(b(e,14)===45?`inline-`:``)+`box$3$1`+i+`$2$3$1`+n+`$2box$3`)+e;case 100:return v(e,`:`,`:`+n)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return v(e,`scroll-`,`scroll-snap-`)+e}return e}function be(e,t){for(var n=``,r=0;r<e.length;r++)n+=t(e[r],r,e,t)||``;return n}function xe(e,t,n,r){switch(e.type){case d:if(e.children.length)break;case c:case l:case s:return e.return=e.return||e.value;case a:return``;case u:return e.return=e.value+`{`+be(e.children,r)+`}`;case o:if(!S(e.value=e.props.join(`,`)))return``}return S(n=be(e.children,r))?e.return=e.value+`{`+n+`}`:``}function Se(e){var t=ee(e);return function(n,r,i,a){for(var o=``,s=0;s<t;s++)o+=e[s](n,r,i,a)||``;return o}}function Ce(e){return function(t){t.root||(t=t.return)&&e(t)}}function we(e,t,a,c){if(e.length>-1&&!e.return)switch(e.type){case s:e.return=ye(e.value,e.length,a);return;case u:return be([M(e,{value:v(e.value,`@`,`@`+i)})],c);case o:if(e.length)return w(a=e.props,function(t){switch(_(t,c=/(::plac\w+|:read-\w+)/)){case`:read-only`:case`:read-write`:N(M(e,{props:[v(t,/:(read-\w+)/,`:`+r+`$1`)]})),N(M(e,{props:[t]})),m(e,{props:T(a,c)});break;case`::placeholder`:N(M(e,{props:[v(t,/:(plac\w+)/,`:`+i+`input-$1`)]})),N(M(e,{props:[v(t,/:(plac\w+)/,`:`+r+`$1`)]})),N(M(e,{props:[v(t,/:(plac\w+)/,n+`input-$1`)]})),N(M(e,{props:[t]})),m(e,{props:T(a,c)})}return``})}}var L=e(t()),R=typeof process<`u`&&({}.REACT_APP_SC_ATTR||{}.SC_ATTR)||`data-styled`,Te=`active`,Ee=`data-styled-version`,z=`6.5.3`,De=`/*!sc*/
|
|
2
2
|
`,B=typeof window<`u`&&typeof document<`u`;function Oe(e){if(typeof process<`u`){let t={}[e];if(t!==void 0&&t!==``)return t!==`false`}}var ke=!!(typeof SC_DISABLE_SPEEDY==`boolean`?SC_DISABLE_SPEEDY:Oe(`REACT_APP_SC_DISABLE_SPEEDY`)??Oe(`SC_DISABLE_SPEEDY`)??(typeof process<`u`&&!1)),Ae=`sc-keyframes-`,je={};function V(e,...t){return Error(`An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#${e} for more information.${t.length>0?` Args: ${t.join(`, `)}`:``}`)}var Me=new Map,Ne=new Map,Pe=1,H=e=>{if(Me.has(e))return Me.get(e);for(;Ne.has(Pe);)Pe++;let t=Pe++;return Me.set(e,t),Ne.set(t,e),t},Fe=e=>Ne.get(e),Ie=(e,t)=>{Pe=t+1,Me.set(e,t),Ne.set(t,e)},Le=Object.freeze([]),U=Object.freeze({});function Re(e,t,n=U){return e.theme!==n.theme&&e.theme||t||n.theme}var ze=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Be=/(^-|-$)/g;function Ve(e){return e.replace(ze,`-`).replace(Be,``)}var He=/(a)(d)/gi,Ue=e=>String.fromCharCode(e+(e>25?39:97));function We(e){let t,n=``;for(t=Math.abs(e);t>52;t=t/52|0)n=Ue(t%52)+n;return(Ue(t%52)+n).replace(He,`$1-$2`)}var Ge=5381,W=(e,t)=>{let n=t.length;for(;n;)e=33*e^t.charCodeAt(--n);return e},Ke=e=>W(Ge,e);function qe(e){return We(Ke(e)>>>0)}function Je(e){return e.displayName||e.name||`Component`}function Ye(e){return typeof e==`string`&&!0}function Xe(e){return Ye(e)?`styled.${e}`:`Styled(${Je(e)})`}var Ze=Symbol.for(`react.memo`),Qe=Symbol.for(`react.forward_ref`),$e={contextType:!0,defaultProps:!0,displayName:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,propTypes:!0,type:!0},et={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},tt={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},nt={[Qe]:{$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},[Ze]:tt};function rt(e){return(`type`in(t=e)&&t.type.$$typeof)===Ze?tt:`$$typeof`in e?nt[e.$$typeof]:$e;var t}var it=Object.defineProperty,at=Object.getOwnPropertyNames,ot=Object.getOwnPropertySymbols,st=Object.getOwnPropertyDescriptor,ct=Object.getPrototypeOf,lt=Object.prototype;function ut(e,t,n){if(typeof t!=`string`){let r=ct(t);r&&r!==lt&&ut(e,r,n);let i=at(t).concat(ot(t)),a=rt(e),o=rt(t);for(let r=0;r<i.length;++r){let s=i[r];if(!(s in et||n&&n[s]||o&&s in o||a&&s in a)){let n=st(t,s);try{it(e,s,n)}catch{}}}}return e}function G(e){return typeof e==`function`}var dt=Symbol.for(`react.forward_ref`);function ft(e){return e!=null&&(typeof e==`object`||typeof e==`function`)&&e.$$typeof===dt&&`styledComponentId`in e}function K(e,t){return e&&t?e+` `+t:e||t||``}function q(e,t){return e.join(t||``)}function J(e){return typeof e==`object`&&!!e&&e.constructor.name===Object.name&&!(`props`in e&&e.$$typeof)}function pt(e,t,n=!1){if(!n&&!J(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(let n=0;n<t.length;n++)e[n]=pt(e[n],t[n]);else if(J(t))for(let n in t)e[n]=pt(e[n],t[n]);return e}function mt(e,t){Object.defineProperty(e,"toString",{value:t})}var ht=class{constructor(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e,this._cGroup=0,this._cIndex=0}indexOfGroup(e){if(e===this._cGroup)return this._cIndex;let t=this._cIndex;if(e>this._cGroup)for(let n=this._cGroup;n<e;n++)t+=this.groupSizes[n];else for(let n=this._cGroup-1;n>=e;n--)t-=this.groupSizes[n];return this._cGroup=e,this._cIndex=t,t}insertRules(e,t){if(e>=this.groupSizes.length){let t=this.groupSizes,n=t.length,r=n;for(;e>=r;)if(r<<=1,r<0)throw V(16,`${e}`);this.groupSizes=new Uint32Array(r),this.groupSizes.set(t),this.length=r;for(let e=n;e<r;e++)this.groupSizes[e]=0}let n=this.indexOfGroup(e+1),r=0;for(let i=0,a=t.length;i<a;i++)this.tag.insertRule(n,t[i])&&(this.groupSizes[e]++,n++,r++);r>0&&this._cGroup>e&&(this._cIndex+=r)}clearGroup(e){if(e<this.length){let t=this.groupSizes[e],n=this.indexOfGroup(e),r=n+t;this.groupSizes[e]=0;for(let e=n;e<r;e++)this.tag.deleteRule(n);t>0&&this._cGroup>e&&(this._cIndex-=t)}}getGroup(e){let t=``;if(e>=this.length||this.groupSizes[e]===0)return t;let n=this.groupSizes[e],r=this.indexOfGroup(e),i=r+n;for(let e=r;e<i;e++)t+=this.tag.getRule(e)+De;return t}},gt=`style[${R}][${Ee}="${z}"]`,_t=RegExp(`^${R}\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)`),vt=e=>typeof ShadowRoot<`u`&&e instanceof ShadowRoot||`host`in e&&e.nodeType===11,yt=e=>{if(!e)return document;if(vt(e))return e;if(`getRootNode`in e){let t=e.getRootNode();if(vt(t))return t}return document},bt=(e,t,n)=>{let r=n.split(`,`),i;for(let n=0,a=r.length;n<a;n++)(i=r[n])&&e.registerName(t,i)},xt=(e,t)=>{let n=(t.textContent??``).split(De),r=[];for(let t=0,i=n.length;t<i;t++){let i=n[t].trim();if(!i)continue;let a=i.match(_t);if(a){let t=0|parseInt(a[1],10),n=a[2];t!==0&&(Ie(n,t),bt(e,n,a[3]),e.getTag().insertRules(t,r)),r.length=0}else r.push(i)}},St=e=>{let t=yt(e.options.target).querySelectorAll(gt);for(let n=0,r=t.length;n<r;n++){let r=t[n];r&&r.getAttribute(R)!==Te&&(xt(e,r),r.parentNode&&r.parentNode.removeChild(r))}},Y=!1;function Ct(){if(!1!==Y)return Y;if(typeof document<`u`){let e=document.head.querySelector(`meta[property="csp-nonce"]`);if(e)return Y=e.nonce||e.getAttribute(`content`)||void 0;let t=document.head.querySelector(`meta[name="sc-nonce"]`);if(t)return Y=t.getAttribute(`content`)||void 0}return Y=typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}var wt=(e,t)=>{let n=document.head,r=e||n,i=document.createElement(`style`),a=(e=>{let t=Array.from(e.querySelectorAll(`style[${R}]`));return t[t.length-1]})(r),o=a===void 0?null:a.nextSibling;i.setAttribute(R,Te),i.setAttribute(Ee,z);let s=t||Ct();return s&&i.setAttribute(`nonce`,s),r.insertBefore(i,o),i},Tt=class{constructor(e,t){this.element=wt(e,t),this.element.appendChild(document.createTextNode(``)),this.sheet=(e=>{if(e.sheet)return e.sheet;let t=e.getRootNode().styleSheets??document.styleSheets;for(let n=0,r=t.length;n<r;n++){let r=t[n];if(r.ownerNode===e)return r}throw V(17)})(this.element),this.length=0}insertRule(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch{return!1}}deleteRule(e){this.sheet.deleteRule(e),this.length--}getRule(e){let t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:``}},Et=class{constructor(e,t){this.element=wt(e,t),this.nodes=this.element.childNodes,this.length=0}insertRule(e,t){if(e<=this.length&&e>=0){let n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1}deleteRule(e){this.element.removeChild(this.nodes[e]),this.length--}getRule(e){return e<this.length?this.nodes[e].textContent:``}},Dt=B,Ot={isServer:!B,useCSSOMInjection:!ke},kt=class e{static registerId(e){return H(e)}constructor(e=U,t={},n){this.options=Object.assign(Object.assign({},Ot),e),this.gs=t,this.keyframeIds=new Set,this.names=new Map(n),this.server=!!e.isServer,!this.server&&B&&Dt&&(Dt=!1,St(this)),mt(this,()=>(e=>{let t=e.getTag(),{length:n}=t,r=``;for(let i=0;i<n;i++){let n=Fe(i);if(n===void 0)continue;let a=e.names.get(n);if(a===void 0||!a.size)continue;let o=t.getGroup(i);if(o.length===0)continue;let s=R+`.g`+i+`[id="`+n+`"]`,c=``;for(let e of a)e.length>0&&(c+=e+`,`);r+=o+s+`{content:"`+c+`"}/*!sc*/
|
|
3
|
-
`}return r})(this))}rehydrate(){!this.server&&B&&St(this)}reconstructWithOptions(t,n=!0){let r=new e(Object.assign(Object.assign({},this.options),t),this.gs,n&&this.names||void 0);return r.keyframeIds=new Set(this.keyframeIds),!this.server&&B&&t.target!==this.options.target&&yt(this.options.target)!==yt(t.target)&&St(r),r}allocateGSInstance(e){return this.gs[e]=(this.gs[e]||0)+1}getTag(){return this.tag||=(e=(({useCSSOMInjection:e,target:t,nonce:n})=>e?new Tt(t,n):new Et(t,n))(this.options),new ht(e));var e}hasNameForId(e,t){var n;return(n=this.names.get(e)?.has(t))!=null&&n}registerName(e,t){H(e),e.startsWith(Ae)&&this.keyframeIds.add(e);let n=this.names.get(e);n?n.add(t):this.names.set(e,new Set([t]))}insertRules(e,t,n){this.registerName(e,t),this.getTag().insertRules(H(e),n)}clearNames(e){this.names.has(e)&&this.names.get(e).clear()}clearRules(e){this.getTag().clearGroup(H(e)),this.clearNames(e)}clearTag(){this.tag=void 0}},At=new WeakSet,jt={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexShrink:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function Mt(e,t){return t==null||typeof t==`boolean`||t===``?``:typeof t!=`number`||t===0||e in jt||e.startsWith(`--`)?String(t).trim():t+`px`}var X=47;function Nt(e){if(e.charCodeAt(0)===45&&e.charCodeAt(1)===45)return e;let t=``;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t+=r>=65&&r<=90?`-`+String.fromCharCode(r+32):e[n]}return t.startsWith(`ms-`)?`-`+t:t}var Pt=Symbol.for(`sc-keyframes`);function Ft(e){return typeof e==`object`&&!!e&&Pt in e}function It(e){return G(e)&&!(e.prototype&&e.prototype.isReactComponent)}var Lt=e=>e==null||!1===e||e===``,Rt=Symbol.for(`react.client.reference`);function zt(e){return e.$$typeof===Rt}function Bt(e,t){for(let n in e){let r=e[n];e.hasOwnProperty(n)&&!Lt(r)&&(Array.isArray(r)&&At.has(r)||G(r)?t.push(Nt(n)+`:`,r,`;`):J(r)?(t.push(n+` {`),Bt(r,t),t.push(`}`)):t.push(Nt(n)+`: `+Mt(n,r)+`;`))}}function Z(e,t,n,r,i=[]){if(Lt(e))return i;let a=typeof e;if(a===`string`)return i.push(e),i;if(a===`function`)return zt(e)?i:It(e)&&t?Z(e(t),t,n,r,i):(i.push(e),i);if(Array.isArray(e)){for(let a=0;a<e.length;a++)Z(e[a],t,n,r,i);return i}return ft(e)?(i.push(`.${e.styledComponentId}`),i):Ft(e)?(n?(e.inject(n,r),i.push(e.getName(r))):i.push(e),i):zt(e)?i:J(e)&&e.toString===Object.prototype.toString?(Bt(e,i),i):(i.push(e.toString()),i)}var Vt=Ke(z),Ht=class{constructor(e,t,n){this.rules=e,this.componentId=t,this.baseHash=W(Vt,t),this.baseStyle=n,kt.registerId(t)}generateAndInjectStyles(e,t,n){let r=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,n):``;{let i=``;for(let r=0;r<this.rules.length;r++){let a=this.rules[r];if(typeof a==`string`)i+=a;else if(a)if(It(a)){let r=a(e);typeof r==`string`?i+=r:r!=null&&!1!==r&&(i+=q(Z(r,e,t,n)))}else i+=q(Z(a,e,t,n))}if(i){this.dynamicNameCache||=new Map;let e=n.hash?n.hash+i:i,a=this.dynamicNameCache.get(e);if(!a){if(a=We(W(W(this.baseHash,n.hash),i)>>>0),this.dynamicNameCache.size>=200){let e=this.dynamicNameCache.keys().next().value;e!==void 0&&this.dynamicNameCache.delete(e)}this.dynamicNameCache.set(e,a)}if(!t.hasNameForId(this.componentId,a)){let e=n(i,`.`+a,void 0,this.componentId);t.insertRules(this.componentId,a,e)}r=K(r,a)}}return r}},Ut=/&/g;function Wt(e,t){let n=0;for(;--t>=0&&e.charCodeAt(t)===92;)n++;return!(1&~n)}function Gt(e){let t=e.length,n=``,r=0,i=0,a=0,o=!1,s=!1;for(let c=0;c<t;c++){let l=e.charCodeAt(c);if(a!==0||o||l!==X||e.charCodeAt(c+1)!==42)if(o)l===42&&e.charCodeAt(c+1)===X&&(o=!1,c++);else if(l!==34&&l!==39||Wt(e,c)){if(a===0)if(l===123)i++;else if(l===125){if(i--,i<0){s=!0;let n=c+1;for(;n<t;){let t=e.charCodeAt(n);if(t===59||t===10)break;n++}n<t&&e.charCodeAt(n)===59&&n++,i=0,c=n-1,r=n;continue}i===0&&(n+=e.substring(r,c+1),r=c+1)}else l===59&&i===0&&(n+=e.substring(r,c+1),r=c+1)}else a===0?a=l:a===l&&(a=0);else o=!0,c++}return s||i!==0||a!==0?(r<t&&i===0&&a===0&&(n+=e.substring(r)),n):e}function Kt(e,t){let n=t+` `,r=`,`+n;for(let i=0;i<e.length;i++){let a=e[i];if(a.type===`rule`){a.value=(n+a.value).replaceAll(`,`,r);let e=a.props,t=[];for(let r=0;r<e.length;r++)t[r]=n+e[r];a.props=t}Array.isArray(a.children)&&a.type!==`@keyframes`&&Kt(a.children,t)}return e}function qt({options:e=U,plugins:t=Le}=U){let n,r,i,a=(e,t,i)=>i.startsWith(r)&&i.endsWith(r)&&i.replaceAll(r,``).length>0?`.${n}`:e,o=t.slice();o.push(e=>{e.type===`rule`&&e.value.includes(`&`)&&(i||=RegExp(`\\${r}\\b`,`g`),e.props[0]=e.props[0].replace(Ut,r).replace(i,a))}),e.prefix&&o.push(we),o.push(xe);let s=[],c=Se(o.concat(Ce(e=>s.push(e)))),l=(t,a=``,o=``,l=`&`)=>{n=l,r=a,i=void 0;let u=function(e){let t=e.indexOf(`//`)!==-1,n=e.indexOf(`}`)!==-1;if(!t&&!n)return e;if(!t)return Gt(e);let r=e.length,i=``,a=0,o=0,s=0,c=0,l=0,u=!1;for(;o<r;){let t=e.charCodeAt(o);if(t!==34&&t!==39||Wt(e,o))if(s===0)if(t===X&&o+1<r&&e.charCodeAt(o+1)===42){for(o+=2;o+1<r&&(e.charCodeAt(o)!==42||e.charCodeAt(o+1)!==X);)o++;o+=2}else if(t!==40)if(t!==41)if(c>0)o++;else if(t===42&&o+1<r&&e.charCodeAt(o+1)===X)i+=e.substring(a,o),o+=2,a=o,u=!0;else if(t===X&&o+1<r&&e.charCodeAt(o+1)===X){for(i+=e.substring(a,o);o<r&&e.charCodeAt(o)!==10;)o++;a=o,u=!0}else t===123?l++:t===125&&l--,o++;else c>0&&c--,o++;else c++,o++;else o++;else s===0?s=t:s===t&&(s=0),o++}return u?(a<r&&(i+=e.substring(a)),l===0?i:Gt(i)):l===0?e:Gt(e)}(t),d=me(o||a?o+` `+a+` { `+u+` }`:u);return e.namespace&&(d=Kt(d,e.namespace)),s=[],be(d,c),s},u=e,d=Ge;for(let e=0;e<t.length;e++)t[e].name||V(15),d=W(d,t[e].name);return u!=null&&u.namespace&&(d=W(d,u.namespace)),u!=null&&u.prefix&&(d=W(d,`p`)),l.hash=d===Ge?``:d.toString(),l}var Jt=new kt,Yt=qt(),Xt=L.createContext({shouldForwardProp:void 0,styleSheet:Jt,stylis:Yt,stylisPlugins:void 0}),Zt=Xt.Consumer;function Qt(){return L.useContext(Xt)}function $t(e){let t=Qt(),{styleSheet:n}=t,r=L.useMemo(()=>{let t=n;return e.sheet?t=e.sheet:e.target?t=t.reconstructWithOptions(e.nonce===void 0?{target:e.target}:{target:e.target,nonce:e.nonce},!1):e.nonce!==void 0&&(t=t.reconstructWithOptions({nonce:e.nonce})),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t},[e.disableCSSOMInjection,e.nonce,e.sheet,e.target,n]),i=L.useMemo(()=>e.stylisPlugins===void 0&&e.namespace===void 0&&e.enableVendorPrefixes===void 0?t.stylis:qt({options:{namespace:e.namespace,prefix:e.enableVendorPrefixes},plugins:e.stylisPlugins??t.stylisPlugins}),[e.enableVendorPrefixes,e.namespace,e.stylisPlugins,t.stylis,t.stylisPlugins]),a=`shouldForwardProp`in e?e.shouldForwardProp:t.shouldForwardProp,o=e.stylisPlugins??t.stylisPlugins,s=L.useMemo(()=>({shouldForwardProp:a,styleSheet:r,stylis:i,stylisPlugins:o}),[a,r,i,o]);return L.createElement(Xt.Provider,{value:s},e.children)}var Q=L.createContext(void 0),en=Q.Consumer;function tn(){let e=L.useContext(Q);if(!e)throw V(18);return e}function nn(e){let t=L.useContext(Q),n=L.useMemo(()=>function(e,t){if(!e)throw V(14);if(G(e))return e(t);if(Array.isArray(e)||typeof e!=`object`)throw V(8);return t?Object.assign(Object.assign({},t),e):e}(e.theme,t),[e.theme,t]);return e.children?L.createElement(Q.Provider,{value:n},e.children):null}var rn=Object.prototype.hasOwnProperty,an={};function on(e,t){let n=typeof e==`string`?Ve(e):`sc`;an[n]=(an[n]||0)+1;let r=n+`-`+qe(z+n+an[n]);return t?t+`-`+r:r}function sn(e,t,n){let r=ft(e),i=e,a=!Ye(e),{attrs:o=Le,componentId:s=on(t.displayName,t.parentComponentId),displayName:c=Xe(e)}=t,l=t.displayName&&t.componentId?Ve(t.displayName)+`-`+t.componentId:t.componentId||s,u=r&&i.attrs?i.attrs.concat(o).filter(Boolean):o,{shouldForwardProp:d}=t;if(r&&i.shouldForwardProp){let e=i.shouldForwardProp;if(t.shouldForwardProp){let n=t.shouldForwardProp;d=(t,r)=>e(t,r)&&n(t,r)}else d=e}let f=new Ht(n,l,r?i.componentStyle:void 0);function p(e,t){return function(e,t,n){let{attrs:r,componentStyle:i,defaultProps:a,foldedComponentIds:o,styledComponentId:s,target:c}=e,l=L.useContext(Q),u=Qt(),d=e.shouldForwardProp||u.shouldForwardProp,f=Re(t,l,a)||U,p,m;{let e=L.useRef(null),n=e.current;if(n!==null&&n[1]===f&&n[2]===u.styleSheet&&n[3]===u.stylis&&n[7]===i&&function(e,t,n){let r=e,i=t,a=0;for(let e in i)if(rn.call(i,e)&&(a++,r[e]!==i[e]))return!1;return a===n}(n[0],t,n[4]))p=n[5],m=n[6];else{p=function(e,t,n){let r=Object.assign(Object.assign({},t),{className:void 0,theme:n}),i=e.length>1;for(let n=0;n<e.length;n++){let a=e[n],o=G(a)?a(i?Object.assign({},r):r):a;for(let e in o)e===`className`?r.className=K(r.className,o[e]):e===`style`?r.style=Object.assign(Object.assign({},r.style),o[e]):e in t&&t[e]===void 0||(r[e]=o[e])}return`className`in t&&typeof t.className==`string`&&(r.className=K(r.className,t.className)),r}(r,t,f),m=i.generateAndInjectStyles(p,u.styleSheet,u.stylis);let n=0;for(let e in t)rn.call(t,e)&&n++;e.current=[t,f,u.styleSheet,u.stylis,n,p,m,i]}}let h=p.as||c,g=function(e,t,n,r){let i={};for(let a in e)e[a]===void 0||a[0]===`$`||a===`as`||a===`theme`&&e.theme===n||(a===`forwardedAs`?i.as=e.forwardedAs:r&&!r(a,t)||(i[a]=e[a]));return i}(p,h,f,d),_=K(o,s);return m&&(_+=` `+m),p.className&&(_+=` `+p.className),g[Ye(h)&&h.includes(`-`)?`class`:`className`]=_,n&&(g.ref=n),(0,L.createElement)(h,g)}(m,e,t)}p.displayName=c;let m=L.forwardRef(p);return m.attrs=u,m.componentStyle=f,m.displayName=c,m.shouldForwardProp=d,m.foldedComponentIds=r?K(i.foldedComponentIds,i.styledComponentId):``,m.styledComponentId=l,m.target=r?i.target:e,Object.defineProperty(m,"defaultProps",{get(){return this._foldedDefaultProps},set(e){this._foldedDefaultProps=r?function(e,...t){for(let n of t)pt(e,n,!0);return e}({},i.defaultProps,e):e}}),mt(m,()=>`.${m.styledComponentId}`),a&&ut(m,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),m}var cn=new Set(`a.abbr.address.area.article.aside.audio.b.bdi.bdo.blockquote.body.button.br.canvas.caption.cite.code.col.colgroup.data.datalist.dd.del.details.dfn.dialog.div.dl.dt.em.embed.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.hr.html.i.iframe.img.input.ins.kbd.label.legend.li.main.map.mark.menu.meter.nav.object.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.slot.small.span.strong.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.u.ul.var.video.wbr.circle.clipPath.defs.ellipse.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.filter.foreignObject.g.image.line.linearGradient.marker.mask.path.pattern.polygon.polyline.radialGradient.rect.stop.svg.switch.symbol.text.textPath.tspan.use`.split(`.`));function ln(e,t){let n=[e[0]];for(let r=0,i=t.length;r<i;r+=1)n.push(t[r],e[r+1]);return n}var un=e=>(At.add(e),e);function dn(e,...t){if(G(e)||J(e))return un(Z(ln(Le,[e,...t])));let n=e;return t.length===0&&n.length===1&&typeof n[0]==`string`?Z(n):un(Z(ln(n,t)))}function fn(e,t,n=U){if(!t)throw V(1,t);let r=(r,...i)=>e(t,n,dn(r,...i));return r.attrs=r=>fn(e,t,Object.assign(Object.assign({},n),{attrs:Array.prototype.concat(n.attrs,r).filter(Boolean)})),r.withConfig=r=>fn(e,t,Object.assign(Object.assign({},n),r)),r}var pn=e=>fn(sn,e),mn=pn;cn.forEach(e=>{mn[e]=pn(e)});var hn=class{constructor(e,t){this.instanceRules=new Map,this.rules=e,this.componentId=t,this.isStatic=function(e){for(let t=0;t<e.length;t+=1){let n=e[t];if(G(n)&&!ft(n))return!1}return!0}(e),kt.registerId(this.componentId)}removeStyles(e,t){this.instanceRules.delete(e),this.rebuildGroup(t)}renderStyles(e,t,n,r){let i=this.componentId;if(this.isStatic){if(n.hasNameForId(i,i+e))this.instanceRules.has(e)||this.computeRules(e,t,n,r);else{let a=this.computeRules(e,t,n,r);n.insertRules(i,a.name,a.rules)}return}let a=this.instanceRules.get(e);if(this.computeRules(e,t,n,r),!n.server&&a){let t=a.rules,n=this.instanceRules.get(e).rules;if(t.length===n.length){let e=!0;for(let r=0;r<t.length;r++)if(t[r]!==n[r]){e=!1;break}if(e)return}}this.rebuildGroup(n)}computeRules(e,t,n,r){let i=q(Z(this.rules,t,n,r)),a={name:this.componentId+e,rules:r(i,``)};return this.instanceRules.set(e,a),a}rebuildGroup(e){let t=this.componentId;e.clearRules(t);for(let n of this.instanceRules.values())e.insertRules(t,n.name,n.rules)}};function gn(e,...t){let n=dn(e,...t),r=`sc-global-${qe(JSON.stringify(n))}`,i=new hn(n,r),a=e=>{let t=Qt(),n=L.useContext(Q),a;{let e=L.useRef(null);e.current===null&&(e.current=t.styleSheet.allocateGSInstance(r)),a=e.current}t.styleSheet.server&&o(a,e,t.styleSheet,n,t.stylis);{let s=i.isStatic?[a,t.styleSheet,i]:[a,e,t.styleSheet,n,t.stylis,i],c=L.useRef(i);L.useLayoutEffect(()=>{t.styleSheet.server||(c.current!==i&&(t.styleSheet.clearRules(r),c.current=i),o(a,e,t.styleSheet,n,t.stylis))},s),L.useLayoutEffect(()=>()=>{t.styleSheet.server||i.removeStyles(a,t.styleSheet)},[a,t.styleSheet,i])}return t.styleSheet.server&&i.instanceRules.delete(a),null};function o(e,t,n,r,o){if(i.isStatic)i.renderStyles(e,je,n,o);else{let s=Object.assign(Object.assign({},t),{theme:Re(t,r,a.defaultProps)});i.renderStyles(e,s,n,o)}}return L.memo(a)}function _n(e,t,n,r,i){for(let a in e){let o=e[a],s=i?i+`-`+a:a;if(typeof o==`object`&&o){let e={};_n(o,t,e,r,s),n[a]=e}else n[a]=r(s,o,a)}}function vn(e,t,n,r){let i=``;for(let a in e){let o=e[a],s=t[a],c=r?r+`-`+a:a;typeof o==`object`&&o?typeof s==`object`&&s&&(i+=vn(o,s,n,c)):s!==void 0&&typeof s!=`function`&&(i+=`--`+n+c+`:`+s+`;`)}return i}function yn(e,t){let n=(t?.prefix??`sc`)+`-`,r=t?.selector??`:root`,i=function(e,t){let n={};return _n(e,t,n,e=>`--`+t+e),n}(e,n),a=function(e,t){let n={};return _n(e,t,n,(e,n)=>`var(--`+t+e+`, `+n+`)`),n}(e,n),o=gn`
|
|
3
|
+
`}return r})(this))}rehydrate(){!this.server&&B&&St(this)}reconstructWithOptions(t,n=!0){let r=new e(Object.assign(Object.assign({},this.options),t),this.gs,n&&this.names||void 0);return r.keyframeIds=new Set(this.keyframeIds),!this.server&&B&&t.target!==this.options.target&&yt(this.options.target)!==yt(t.target)&&St(r),r}allocateGSInstance(e){return this.gs[e]=(this.gs[e]||0)+1}getTag(){return this.tag||=(e=(({useCSSOMInjection:e,target:t,nonce:n})=>e?new Tt(t,n):new Et(t,n))(this.options),new ht(e));var e}hasNameForId(e,t){var n;return(n=this.names.get(e)?.has(t))!=null&&n}registerName(e,t){H(e),e.startsWith(Ae)&&this.keyframeIds.add(e);let n=this.names.get(e);n?n.add(t):this.names.set(e,new Set([t]))}insertRules(e,t,n){this.registerName(e,t),this.getTag().insertRules(H(e),n)}clearNames(e){this.names.has(e)&&this.names.get(e).clear()}clearRules(e){this.getTag().clearGroup(H(e)),this.clearNames(e)}clearTag(){this.tag=void 0}},At=new WeakSet,jt={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexShrink:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function Mt(e,t){return t==null||typeof t==`boolean`||t===``?``:typeof t!=`number`||t===0||e in jt||e.startsWith(`--`)?String(t).trim():t+`px`}var X=47;function Nt(e){if(e.charCodeAt(0)===45&&e.charCodeAt(1)===45)return e;let t=``;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t+=r>=65&&r<=90?`-`+String.fromCharCode(r+32):e[n]}return t.startsWith(`ms-`)?`-`+t:t}var Pt=Symbol.for(`sc-keyframes`);function Ft(e){return typeof e==`object`&&!!e&&Pt in e}function It(e){return G(e)&&!(e.prototype&&e.prototype.isReactComponent)}var Lt=e=>e==null||!1===e||e===``,Rt=Symbol.for(`react.client.reference`);function zt(e){return e.$$typeof===Rt}function Bt(e,t){for(let n in e){let r=e[n];e.hasOwnProperty(n)&&!Lt(r)&&(Array.isArray(r)&&At.has(r)||G(r)?t.push(Nt(n)+`:`,r,`;`):J(r)?(t.push(n+` {`),Bt(r,t),t.push(`}`)):t.push(Nt(n)+`: `+Mt(n,r)+`;`))}}function Z(e,t,n,r,i=[]){if(Lt(e))return i;let a=typeof e;if(a===`string`)return i.push(e),i;if(a===`function`)return zt(e)?i:It(e)&&t?Z(e(t),t,n,r,i):(i.push(e),i);if(Array.isArray(e)){for(let a=0;a<e.length;a++)Z(e[a],t,n,r,i);return i}return ft(e)?(i.push(`.${e.styledComponentId}`),i):Ft(e)?(n?(e.inject(n,r),i.push(e.getName(r))):i.push(e),i):zt(e)?i:J(e)&&e.toString===Object.prototype.toString?(Bt(e,i),i):(i.push(e.toString()),i)}var Vt=Ke(z),Ht=class{constructor(e,t,n){this.rules=e,this.componentId=t,this.baseHash=W(Vt,t),this.baseStyle=n,kt.registerId(t)}generateAndInjectStyles(e,t,n){let r=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,n):``;{let i=``;for(let r=0;r<this.rules.length;r++){let a=this.rules[r];if(typeof a==`string`)i+=a;else if(a){if(It(a)){let r=a(e);typeof r==`string`?i+=r:r!=null&&!1!==r&&(i+=q(Z(r,e,t,n)))}else i+=q(Z(a,e,t,n))}}if(i){this.dynamicNameCache||=new Map;let e=n.hash?n.hash+i:i,a=this.dynamicNameCache.get(e);if(!a){if(a=We(W(W(this.baseHash,n.hash),i)>>>0),this.dynamicNameCache.size>=200){let e=this.dynamicNameCache.keys().next().value;e!==void 0&&this.dynamicNameCache.delete(e)}this.dynamicNameCache.set(e,a)}if(!t.hasNameForId(this.componentId,a)){let e=n(i,`.`+a,void 0,this.componentId);t.insertRules(this.componentId,a,e)}r=K(r,a)}}return r}},Ut=/&/g;function Wt(e,t){let n=0;for(;--t>=0&&e.charCodeAt(t)===92;)n++;return!(1&~n)}function Gt(e){let t=e.length,n=``,r=0,i=0,a=0,o=!1,s=!1;for(let c=0;c<t;c++){let l=e.charCodeAt(c);if(a!==0||o||l!==X||e.charCodeAt(c+1)!==42){if(o)l===42&&e.charCodeAt(c+1)===X&&(o=!1,c++);else if(l!==34&&l!==39||Wt(e,c)){if(a===0){if(l===123)i++;else if(l===125){if(i--,i<0){s=!0;let n=c+1;for(;n<t;){let t=e.charCodeAt(n);if(t===59||t===10)break;n++}n<t&&e.charCodeAt(n)===59&&n++,i=0,c=n-1,r=n;continue}i===0&&(n+=e.substring(r,c+1),r=c+1)}else l===59&&i===0&&(n+=e.substring(r,c+1),r=c+1)}}else a===0?a=l:a===l&&(a=0)}else o=!0,c++}return s||i!==0||a!==0?(r<t&&i===0&&a===0&&(n+=e.substring(r)),n):e}function Kt(e,t){let n=t+` `,r=`,`+n;for(let i=0;i<e.length;i++){let a=e[i];if(a.type===`rule`){a.value=(n+a.value).replaceAll(`,`,r);let e=a.props,t=[];for(let r=0;r<e.length;r++)t[r]=n+e[r];a.props=t}Array.isArray(a.children)&&a.type!==`@keyframes`&&Kt(a.children,t)}return e}function qt({options:e=U,plugins:t=Le}=U){let n,r,i,a=(e,t,i)=>i.startsWith(r)&&i.endsWith(r)&&i.replaceAll(r,``).length>0?`.${n}`:e,o=t.slice();o.push(e=>{e.type===`rule`&&e.value.includes(`&`)&&(i||=RegExp(`\\${r}\\b`,`g`),e.props[0]=e.props[0].replace(Ut,r).replace(i,a))}),e.prefix&&o.push(we),o.push(xe);let s=[],c=Se(o.concat(Ce(e=>s.push(e)))),l=(t,a=``,o=``,l=`&`)=>{n=l,r=a,i=void 0;let u=function(e){let t=e.indexOf(`//`)!==-1,n=e.indexOf(`}`)!==-1;if(!t&&!n)return e;if(!t)return Gt(e);let r=e.length,i=``,a=0,o=0,s=0,c=0,l=0,u=!1;for(;o<r;){let t=e.charCodeAt(o);if(t!==34&&t!==39||Wt(e,o)){if(s===0){if(t===X&&o+1<r&&e.charCodeAt(o+1)===42){for(o+=2;o+1<r&&(e.charCodeAt(o)!==42||e.charCodeAt(o+1)!==X);)o++;o+=2}else if(t!==40){if(t!==41){if(c>0)o++;else if(t===42&&o+1<r&&e.charCodeAt(o+1)===X)i+=e.substring(a,o),o+=2,a=o,u=!0;else if(t===X&&o+1<r&&e.charCodeAt(o+1)===X){for(i+=e.substring(a,o);o<r&&e.charCodeAt(o)!==10;)o++;a=o,u=!0}else t===123?l++:t===125&&l--,o++}else c>0&&c--,o++}else c++,o++}else o++}else s===0?s=t:s===t&&(s=0),o++}return u?(a<r&&(i+=e.substring(a)),l===0?i:Gt(i)):l===0?e:Gt(e)}(t),d=me(o||a?o+` `+a+` { `+u+` }`:u);return e.namespace&&(d=Kt(d,e.namespace)),s=[],be(d,c),s},u=e,d=Ge;for(let e=0;e<t.length;e++)t[e].name||V(15),d=W(d,t[e].name);return u!=null&&u.namespace&&(d=W(d,u.namespace)),u!=null&&u.prefix&&(d=W(d,`p`)),l.hash=d===Ge?``:d.toString(),l}var Jt=new kt,Yt=qt(),Xt=L.createContext({shouldForwardProp:void 0,styleSheet:Jt,stylis:Yt,stylisPlugins:void 0}),Zt=Xt.Consumer;function Qt(){return L.useContext(Xt)}function $t(e){let t=Qt(),{styleSheet:n}=t,r=L.useMemo(()=>{let t=n;return e.sheet?t=e.sheet:e.target?t=t.reconstructWithOptions(e.nonce===void 0?{target:e.target}:{target:e.target,nonce:e.nonce},!1):e.nonce!==void 0&&(t=t.reconstructWithOptions({nonce:e.nonce})),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t},[e.disableCSSOMInjection,e.nonce,e.sheet,e.target,n]),i=L.useMemo(()=>e.stylisPlugins===void 0&&e.namespace===void 0&&e.enableVendorPrefixes===void 0?t.stylis:qt({options:{namespace:e.namespace,prefix:e.enableVendorPrefixes},plugins:e.stylisPlugins??t.stylisPlugins}),[e.enableVendorPrefixes,e.namespace,e.stylisPlugins,t.stylis,t.stylisPlugins]),a=`shouldForwardProp`in e?e.shouldForwardProp:t.shouldForwardProp,o=e.stylisPlugins??t.stylisPlugins,s=L.useMemo(()=>({shouldForwardProp:a,styleSheet:r,stylis:i,stylisPlugins:o}),[a,r,i,o]);return L.createElement(Xt.Provider,{value:s},e.children)}var Q=L.createContext(void 0),en=Q.Consumer;function tn(){let e=L.useContext(Q);if(!e)throw V(18);return e}function nn(e){let t=L.useContext(Q),n=L.useMemo(()=>function(e,t){if(!e)throw V(14);if(G(e))return e(t);if(Array.isArray(e)||typeof e!=`object`)throw V(8);return t?Object.assign(Object.assign({},t),e):e}(e.theme,t),[e.theme,t]);return e.children?L.createElement(Q.Provider,{value:n},e.children):null}var rn=Object.prototype.hasOwnProperty,an={};function on(e,t){let n=typeof e==`string`?Ve(e):`sc`;an[n]=(an[n]||0)+1;let r=n+`-`+qe(z+n+an[n]);return t?t+`-`+r:r}function sn(e,t,n){let r=ft(e),i=e,a=!Ye(e),{attrs:o=Le,componentId:s=on(t.displayName,t.parentComponentId),displayName:c=Xe(e)}=t,l=t.displayName&&t.componentId?Ve(t.displayName)+`-`+t.componentId:t.componentId||s,u=r&&i.attrs?i.attrs.concat(o).filter(Boolean):o,{shouldForwardProp:d}=t;if(r&&i.shouldForwardProp){let e=i.shouldForwardProp;if(t.shouldForwardProp){let n=t.shouldForwardProp;d=(t,r)=>e(t,r)&&n(t,r)}else d=e}let f=new Ht(n,l,r?i.componentStyle:void 0);function p(e,t){return function(e,t,n){let{attrs:r,componentStyle:i,defaultProps:a,foldedComponentIds:o,styledComponentId:s,target:c}=e,l=L.useContext(Q),u=Qt(),d=e.shouldForwardProp||u.shouldForwardProp,f=Re(t,l,a)||U,p,m;{let e=L.useRef(null),n=e.current;if(n!==null&&n[1]===f&&n[2]===u.styleSheet&&n[3]===u.stylis&&n[7]===i&&function(e,t,n){let r=e,i=t,a=0;for(let e in i)if(rn.call(i,e)&&(a++,r[e]!==i[e]))return!1;return a===n}(n[0],t,n[4]))p=n[5],m=n[6];else{p=function(e,t,n){let r=Object.assign(Object.assign({},t),{className:void 0,theme:n}),i=e.length>1;for(let n=0;n<e.length;n++){let a=e[n],o=G(a)?a(i?Object.assign({},r):r):a;for(let e in o)e===`className`?r.className=K(r.className,o[e]):e===`style`?r.style=Object.assign(Object.assign({},r.style),o[e]):e in t&&t[e]===void 0||(r[e]=o[e])}return`className`in t&&typeof t.className==`string`&&(r.className=K(r.className,t.className)),r}(r,t,f),m=i.generateAndInjectStyles(p,u.styleSheet,u.stylis);let n=0;for(let e in t)rn.call(t,e)&&n++;e.current=[t,f,u.styleSheet,u.stylis,n,p,m,i]}}let h=p.as||c,g=function(e,t,n,r){let i={};for(let a in e)e[a]===void 0||a[0]===`$`||a===`as`||a===`theme`&&e.theme===n||(a===`forwardedAs`?i.as=e.forwardedAs:r&&!r(a,t)||(i[a]=e[a]));return i}(p,h,f,d),_=K(o,s);return m&&(_+=` `+m),p.className&&(_+=` `+p.className),g[Ye(h)&&h.includes(`-`)?`class`:`className`]=_,n&&(g.ref=n),(0,L.createElement)(h,g)}(m,e,t)}p.displayName=c;let m=L.forwardRef(p);return m.attrs=u,m.componentStyle=f,m.displayName=c,m.shouldForwardProp=d,m.foldedComponentIds=r?K(i.foldedComponentIds,i.styledComponentId):``,m.styledComponentId=l,m.target=r?i.target:e,Object.defineProperty(m,"defaultProps",{get(){return this._foldedDefaultProps},set(e){this._foldedDefaultProps=r?function(e,...t){for(let n of t)pt(e,n,!0);return e}({},i.defaultProps,e):e}}),mt(m,()=>`.${m.styledComponentId}`),a&&ut(m,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),m}var cn=new Set(`a.abbr.address.area.article.aside.audio.b.bdi.bdo.blockquote.body.button.br.canvas.caption.cite.code.col.colgroup.data.datalist.dd.del.details.dfn.dialog.div.dl.dt.em.embed.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.hr.html.i.iframe.img.input.ins.kbd.label.legend.li.main.map.mark.menu.meter.nav.object.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.slot.small.span.strong.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.u.ul.var.video.wbr.circle.clipPath.defs.ellipse.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.filter.foreignObject.g.image.line.linearGradient.marker.mask.path.pattern.polygon.polyline.radialGradient.rect.stop.svg.switch.symbol.text.textPath.tspan.use`.split(`.`));function ln(e,t){let n=[e[0]];for(let r=0,i=t.length;r<i;r+=1)n.push(t[r],e[r+1]);return n}var un=e=>(At.add(e),e);function dn(e,...t){if(G(e)||J(e))return un(Z(ln(Le,[e,...t])));let n=e;return t.length===0&&n.length===1&&typeof n[0]==`string`?Z(n):un(Z(ln(n,t)))}function fn(e,t,n=U){if(!t)throw V(1,t);let r=(r,...i)=>e(t,n,dn(r,...i));return r.attrs=r=>fn(e,t,Object.assign(Object.assign({},n),{attrs:Array.prototype.concat(n.attrs,r).filter(Boolean)})),r.withConfig=r=>fn(e,t,Object.assign(Object.assign({},n),r)),r}var pn=e=>fn(sn,e),mn=pn;cn.forEach(e=>{mn[e]=pn(e)});var hn=class{constructor(e,t){this.instanceRules=new Map,this.rules=e,this.componentId=t,this.isStatic=function(e){for(let t=0;t<e.length;t+=1){let n=e[t];if(G(n)&&!ft(n))return!1}return!0}(e),kt.registerId(this.componentId)}removeStyles(e,t){this.instanceRules.delete(e),this.rebuildGroup(t)}renderStyles(e,t,n,r){let i=this.componentId;if(this.isStatic){if(n.hasNameForId(i,i+e))this.instanceRules.has(e)||this.computeRules(e,t,n,r);else{let a=this.computeRules(e,t,n,r);n.insertRules(i,a.name,a.rules)}return}let a=this.instanceRules.get(e);if(this.computeRules(e,t,n,r),!n.server&&a){let t=a.rules,n=this.instanceRules.get(e).rules;if(t.length===n.length){let e=!0;for(let r=0;r<t.length;r++)if(t[r]!==n[r]){e=!1;break}if(e)return}}this.rebuildGroup(n)}computeRules(e,t,n,r){let i=q(Z(this.rules,t,n,r)),a={name:this.componentId+e,rules:r(i,``)};return this.instanceRules.set(e,a),a}rebuildGroup(e){let t=this.componentId;e.clearRules(t);for(let n of this.instanceRules.values())e.insertRules(t,n.name,n.rules)}};function gn(e,...t){let n=dn(e,...t),r=`sc-global-${qe(JSON.stringify(n))}`,i=new hn(n,r),a=e=>{let t=Qt(),n=L.useContext(Q),a;{let e=L.useRef(null);e.current===null&&(e.current=t.styleSheet.allocateGSInstance(r)),a=e.current}t.styleSheet.server&&o(a,e,t.styleSheet,n,t.stylis);{let s=i.isStatic?[a,t.styleSheet,i]:[a,e,t.styleSheet,n,t.stylis,i],c=L.useRef(i);L.useLayoutEffect(()=>{t.styleSheet.server||(c.current!==i&&(t.styleSheet.clearRules(r),c.current=i),o(a,e,t.styleSheet,n,t.stylis))},s),L.useLayoutEffect(()=>()=>{t.styleSheet.server||i.removeStyles(a,t.styleSheet)},[a,t.styleSheet,i])}return t.styleSheet.server&&i.instanceRules.delete(a),null};function o(e,t,n,r,o){if(i.isStatic)i.renderStyles(e,je,n,o);else{let s=Object.assign(Object.assign({},t),{theme:Re(t,r,a.defaultProps)});i.renderStyles(e,s,n,o)}}return L.memo(a)}function _n(e,t,n,r,i){for(let a in e){let o=e[a],s=i?i+`-`+a:a;if(typeof o==`object`&&o){let e={};_n(o,t,e,r,s),n[a]=e}else n[a]=r(s,o,a)}}function vn(e,t,n,r){let i=``;for(let a in e){let o=e[a],s=t[a],c=r?r+`-`+a:a;typeof o==`object`&&o?typeof s==`object`&&s&&(i+=vn(o,s,n,c)):s!==void 0&&typeof s!=`function`&&(i+=`--`+n+c+`:`+s+`;`)}return i}function yn(e,t){let n=(t?.prefix??`sc`)+`-`,r=t?.selector??`:root`,i=function(e,t){let n={};return _n(e,t,n,e=>`--`+t+e),n}(e,n),a=function(e,t){let n={};return _n(e,t,n,(e,n)=>`var(--`+t+e+`, `+n+`)`),n}(e,n),o=gn`
|
|
4
4
|
${r} {
|
|
5
5
|
${t=>vn(e,t.theme,n)}
|
|
6
6
|
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import{c as e,d as t,f as n,k as r,l as i,m as a,p as o,u as s}from"./Panel-BlNr9j6-.js";import{queryOptions as c,useMutation as l,useQuery as u,useQueryClient as d}from"@tanstack/react-query";import*as f from"react";import p,{useCallback as m,useDebugValue as h,useEffect as g,useMemo as _,useRef as v,useSyncExternalStore as y}from"react";import{jsx as b}from"react/jsx-runtime";import{flushSync as ee}from"react-dom";import x,{css as S,keyframes as C}from"styled-components";var w=f.use,T=f.useLayoutEffect;function te(e,t,n={},r){f.useEffect(()=>{if(!e.current||r||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,r,n,e])}function ne(e){let t=f.useRef(null);return f.useImperativeHandle(e,()=>t.current,[]),t}function E(e){return e[e.length-1]}function D(e){return typeof e==`function`}function re(e,t){return D(e)?e(t):e}var O=Object.prototype.hasOwnProperty,ie=Object.prototype.propertyIsEnumerable;function ae(e){for(let t in e)if(O.call(e,t))return!0;return!1}var oe=()=>Object.create(null),se=(e,t)=>ce(e,t,oe);function ce(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=de(e)&&de(i);if(!a&&!(k(e)&&k(i)))return i;let o=a?e:le(e);if(!o)return i;let s=a?i:le(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:O.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=ce(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function le(e){let t=Object.keys(e);if(t.length!==Object.getOwnPropertyNames(e).length)return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;for(let r of n){if(!ie.call(e,r))return!1;t.push(r)}return t}function k(e){if(!ue(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ue(n)||!n.hasOwnProperty(`isPrototypeOf`))}function ue(e){return Object.prototype.toString.call(e)===`[object Object]`}function de(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function A(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!A(e[r],t[r],n))return!1;return!0}if(k(e)&&k(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!A(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!A(e[o],t[o],n)))return!1;return i===a}return!1}function fe(e){return typeof e?.message==`string`?e.message.startsWith(`Failed to fetch dynamically imported module`)||e.message.startsWith(`error loading dynamically imported module`)||e.message.startsWith(`Importing a module script failed`):!1}var j=/[\x00-\x1f\x7f"<>`{}]/g;function pe(e){return e.replace(j,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function me(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return pe(t)}var he=[`http:`,`https:`,`mailto:`,`tel:`];function M(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function ge(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=me(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=me(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function _e(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function N(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function P(){throw Error(`Invariant failed`)}function F(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var I=4,L=5;function ve(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function ye(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=ve(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function R(e,t,n,r,i,a,o,s){s?.(n);let c=r;{let r=n.fullPath??n.from,s=n.options,l=r.length,u=s?.caseSensitive??e,d=s?.params?.parse??s?.parseParams;for(;c<l;){let e=ye(r,c,t),n,s=c,l=e[5];c=l+1,a++;let f=e[0];switch(f){case 0:{let t=r.substring(e[2],e[3]),o=t,s;u?s=i.static??=new Map:(o=t.toLowerCase(),s=i.staticInsensitive??=new Map);let c=s.get(o);if(c)n=c;else{let e=B(r);e.parent=i,e.depth=a,n=e,s.set(o,e)}break}case 1:case 3:case 2:{let t=r.substring(s,e[1]),c=r.substring(e[4],l),p=u&&!!(t||c),m=t?p?t:t.toLowerCase():void 0,h=c?p?c:c.toLowerCase():void 0,g=f===1?i.dynamic:f===3?i.optional:i.wildcard,_=f!==2&&!d&&g?.find(e=>!e.parse&&e.caseSensitive===p&&e.prefix===m&&e.suffix===h);if(_)n=_;else{let e=V(f,r,p,m,h);n=e,e.parent=i,e.depth=a;let t;t=f===1?i.dynamic??=[]:f===3?i.optional??=[]:i.wildcard??=[],t.push(e),t.length===2&&o?.push(t)}break}}i=n}if(d&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=B(r);e.kind=L,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let f=(n.path||!n.children)&&!n.isRoot;if(f&&r.endsWith(`/`)){let e=B(r);e.kind=I,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=d??null,i.priority=s?.params?.priority??0,f&&!i.route&&(i.route=n,i.fullPath=r)}if(n.children)for(let r of n.children)R(e,t,r,c,i,a,o,s)}function z(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function B(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function V(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function H(e,t){let n=B(`/`),r=new Uint16Array(6),i=[];for(let t of e)R(!1,r,t,1,n,0,i);for(let e of i)e.sort(z);t.masksTree=n,t.flatCache=F(1e3)}function be(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=Te(e,t.masksTree);return t.flatCache.set(e,r),r}function xe(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=B(`/`),R(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),Te(r,o,n)}function Se(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=Te(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=De(a.route)),t.matchCache.set(r,a),a}function Ce(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function we(e,t=!1,n){let r=B(e.fullPath),i=new Uint16Array(6),a=[],o={},s={},c=0;R(t,i,e,1,r,0,a,e=>{if(n?.(e,c),e.id in o&&P(),o[e.id]=e,c!==0&&e.path){let t=Ce(e.fullPath);(!s[t]||e.fullPath.endsWith(`/`))&&(s[t]=e)}c++});for(let e of a)e.sort(z);return{processedTree:{segmentTree:r,singleCache:F(1e3),matchCache:F(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:s}}function Te(e,t,n=!1){let r=e.split(`/`),i=ke(e,r,t,n);if(!i)return null;let[a]=Ee(e,r,i);return{route:i.node.route,rawParams:a}}function Ee(e,t,n){let r=Oe(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===I)break;if(u.kind===L){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function De(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Oe(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function ke(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!E(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,statics:f,dynamics:p,optionals:m}=n,{extract:h,rawParams:g}=n;if(i.kind===2&&i.route&&!W(l,n))continue;if(i.parse){if(!je(e,t,n))continue;g=n.rawParams,h=n.extract}r&&i.route&&i.kind!==I&&W(c,n)&&(c=n);let _=u===o;if(_&&(i.route&&(!a||i.kind===I||i.kind===2)&&W(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let v=_?void 0:t[u],y;if(_&&i.index){let n={node:i.index,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g},r=!0;if(i.index.parse&&(je(e,t,n)||(r=!1)),r){if(!p&&!m&&!d&&Ae(f,o))return n;W(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!(r&&(_||!(n.caseSensitive?v:y??=v.toLowerCase()).startsWith(r)))){if(a){if(_)continue;let e=t.slice(u).join(`/`).slice(-a.length);if((n.caseSensitive?e:e.toLowerCase())!==a)continue}s.push({node:n,index:o,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(i.optional){let e=d|1<<i.depth+1;for(let t=i.optional.length-1;t>=0;t--){let n=i.optional[t];s.push({node:n,index:u,skipped:e,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_)for(let e=i.optional.length-1;e>=0;e--){let t=i.optional[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p,optionals:m+U(o,u),extract:h,rawParams:g})}}if(!_&&i.dynamic&&v)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p+U(o,u),optionals:m,extract:h,rawParams:g})}if(!_&&i.staticInsensitive){let e=i.staticInsensitive.get(y??=v.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,statics:f+U(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_&&i.static){let e=i.static.get(v);e&&s.push({node:e,index:u+1,skipped:d,statics:f+U(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(i.pathless)for(let e=i.pathless.length-1;e>=0;e--){let t=i.pathless[e];s.push({node:t,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function U(e,t){return 2**(e-t-1)}function Ae(e,t){return e===2**(t-1)-1}function je(e,t,n){let r,i;try{[r,i]=Ee(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function W(e,t){return!e||t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===I)>(e.node.kind===I)||t.node.kind===I==(e.node.kind===I)&&t.node.depth>e.node.depth)))}function Me(e){return Ne(e.filter(e=>e!==void 0).join(`/`))}function Ne(e){return e.replace(/\/{2,}/g,`/`)}function Pe(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function Fe(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function Ie(e){return Fe(Pe(e))}function Le(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function Re(e,t,n){return Le(e,n)===Le(t,n)}function ze({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t===`.`,a=t.startsWith(`/`),o;if(r){o=a?t:i?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(i)s=e.split(`/`);else if(a)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&E(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.length>1?s.pop():s=[``]:r===`.`||s.push(r)}}s.length>1&&(E(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c=Ne(s.join(`/`))||`/`;return o&&r&&r.set(o,c),c}function Be(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function Ve(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>Ue(e,n)).join(`/`):Ue(r,n):r}function He({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=ye(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=Ve(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=Ve(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=Ve(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function Ue(e,t){let n=encodeURIComponent(e);return t?.(n)??n}var We=`Error preloading route! ☝️`;function Ge({children:e,fallback:t=null}){return b(p.Fragment,{children:Ke()?e:t})}function Ke(){return p.useSyncExternalStore(qe,()=>!0,()=>!1)}function qe(){return()=>{}}function Je(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Ye=typeof Object.is==`function`?Object.is:Je;function Xe(e,t,n,r,i){let a=v(null),o;a.current===null?(o={hasValue:!1,value:null},a.current=o):o=a.current;let[s,c]=_(()=>{let e=!1,a,s,c=t=>{if(!e){e=!0,a=t;let n=r(t);if(i!==void 0&&o.hasValue){let e=o.value;if(i(e,n))return s=e,e}return s=n,n}let n=s;if(Ye(a,t))return n;let c=r(t);return i?.(n,c)?(a=t,n):(a=t,s=c,c)},l=n===void 0?null:n;return[()=>c(t()),l===null?void 0:()=>c(l())]},[t,n,r,i,o]),l=y(e,s,c);return g(()=>{o.hasValue=!0,o.value=l},[l,o]),h(l),l}function Ze(e,t){return e===t}function Qe(e,t,n=Ze){let r=m(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=m(()=>e?.get(),[e]);return Xe(r,i,i,t,n)}function $e(e){let t=r();return f.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function et(e){let t=f.useRef(e);return A(t.current,e,{ignoreUndefined:!1})||(t.current=e),t.current}function tt(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function nt(e,t,n){if(e?.external)return M(e.href,n)?void 0:e.href;if(!ft(t)&&typeof t==`string`&&t.indexOf(`:`)!==-1)try{return new URL(t),M(t,n)?void 0:t}catch{}}function rt(e,t,n,r,i,a){if(a)return!1;if(n?.exact){if(!Re(e.pathname,t.pathname,r))return!1}else{let n=Le(e.pathname,r),i=Le(t.pathname,r);if(!(n.startsWith(i)&&(n.length===i.length||n[i.length]===`/`)))return!1}return(n?.includeSearch??!0)&&!A(e.search,t.search,{partial:!n?.exact,ignoreUndefined:!n?.explicitUndefined})?!1:!n?.includeHash||i&&e.hash===t.hash}function it(e,t){let n=r(),i=ne(t),{activeProps:a,inactiveProps:o,activeOptions:s,to:c,preload:l,preloadDelay:u,preloadIntentProximity:d,hashScrollIntoView:p,replace:m,startTransition:h,resetScroll:g,viewTransition:_,children:v,target:y,disabled:b,style:x,className:S,onClick:C,onBlur:w,onFocus:T,onMouseEnter:E,onMouseLeave:D,onTouchStart:O,ignoreBlocker:ie,params:ae,search:oe,hash:se,state:ce,mask:le,reloadDocument:k,unsafeRelative:ue,from:de,_fromLocation:A,...fe}=e,j=Ke(),pe=et(e.search),me=et(e.params),he=et(s),M=f.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,pe,me,e.state,e.mask,e.unsafeRelative]),ge=f.useCallback(e=>{let t=n.buildLocation({_fromLocation:e,...M}),r=dt(t.maskedLocation?t.maskedLocation.publicHref:t.publicHref,t.maskedLocation?t.maskedLocation.external:t.external,n.history,b),i=nt(r,c,n.protocolAllowlist);return[r?.href,i,rt(e,t,he,n.basepath,j,i!==void 0)]},[he,b,j,M,n,c]),[_e,N,P]=Qe(n.stores.location,ge,tt),F=P?re(a,{})??ot:at,I=P?at:re(o,{})??at,L=[S,F.className,I.className].filter(Boolean).join(` `),ve=(x||F.style||I.style)&&{...x,...F.style,...I.style},[ye,R]=f.useState(!1),z=f.useRef(!1),B=e.reloadDocument||N?!1:l??n.options.defaultPreload,V=u??n.options.defaultPreloadDelay??0,H=f.useCallback(()=>{n.preloadRoute(M).catch(e=>{console.warn(e),console.warn(We)})},[n,M]);te(i,f.useCallback(e=>{e?.isIntersecting&&H()},[H]),ut,!!b||B!==`viewport`),f.useEffect(()=>{z.current||!b&&B===`render`&&(H(),z.current=!0)},[b,H,B]);let be=e=>{let t=e.currentTarget.getAttribute(`target`),r=y===void 0?t:y;if(!b&&!mt(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),ee(()=>{R(!0)});let t=n.subscribe(`onResolved`,()=>{t(),R(!1)});n.navigate({...M,replace:m,resetScroll:g,hashScrollIntoView:p,startTransition:h,viewTransition:_,ignoreBlocker:ie})}};if(N)return{...fe,ref:i,href:N,...v&&{children:v},...y&&{target:y},...b&&{disabled:b},...x&&{style:x},...S&&{className:S},...C&&{onClick:C},...w&&{onBlur:w},...T&&{onFocus:T},...E&&{onMouseEnter:E},...D&&{onMouseLeave:D},...O&&{onTouchStart:O}};let xe=e=>{if(b||B!==`intent`)return;if(!V){H();return}let t=e.currentTarget;if(G.has(t))return;let n=setTimeout(()=>{G.delete(t),H()},V);G.set(t,n)},Se=e=>{b||B!==`intent`||H()},Ce=e=>{if(b||!B||!V)return;let t=e.currentTarget,n=G.get(t);n&&(clearTimeout(n),G.delete(t))};return{...fe,...F,...I,href:_e,ref:i,onClick:K([C,be]),onBlur:K([w,Ce]),onFocus:K([T,xe]),onMouseEnter:K([E,xe]),onMouseLeave:K([D,Ce]),onTouchStart:K([O,Se]),disabled:!!b,target:y,...ve&&{style:ve},...L&&{className:L},...b&&st,...P&&ct,...j&&ye&<}}var at={},ot={className:`active`},st={role:`link`,"aria-disabled":!0},ct={"data-status":`active`,"aria-current":`page`},lt={"data-transitioning":`transitioning`},G=new WeakMap,ut={rootMargin:`100px`},K=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function dt(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function ft(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var pt=f.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=it(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return f.createElement(`a`,t,o)}return f.createElement(n,a,o)});function mt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var q={status:[`status`],credentials:[`credentials`],credentialHealth:[`credentials`,`health`],models:[`models`],keys:[`keys`],settings:[`settings`],agentSetup:(e,t)=>[`agent-setup`,e,t??null],usage:e=>[`usage`,e.grain??`raw`,e.groupBy,e.splitBy??null,e.since,e.until??null],quotaHistory:e=>[`quota-history`,e.credentialId,e.since,e.until??null],logs:e=>[`logs`,e],requestBody:e=>[`logs`,`body`,e],clientSummary:[`client`,`summary`],clientUsage:e=>[`client`,`usage`,e.grain??`raw`,e.groupBy,e.splitBy??null,e.since,e.until??null],clientLogs:e=>[`client`,`logs`,e],clientQuota:[`client`,`quota`],clientQuotaHistory:e=>[`client`,`quota-history`,e.since,e.until??null],console:(e,t,n)=>[`console`,e,t,n],nodes:[`nodes`],database:[`database`],snapshots:[`database`,`snapshots`],lifecycle:[`lifecycle`],plugins:[`plugins`],catalog:[`catalog`]},ht=c({queryKey:q.catalog,queryFn:async({signal:e})=>{let{providers:t}=await i(`/api/catalog`,e);return[...t].sort((e,t)=>e.order-t.order)},staleTime:3e5});function gt(){return u(ht)}function _t(e,t){return e.find(e=>e.id===t)}function vt(){return u({queryKey:q.status,queryFn:({signal:e})=>i(`/api/status`,e),staleTime:3e4})}function yt(){return u({queryKey:q.credentials,queryFn:async({signal:e})=>(await i(`/api/credentials`,e)).credentials})}function bt(e=1e4){return u({queryKey:q.credentialHealth,queryFn:({signal:e})=>i(`/api/credentials/health`,e),refetchInterval:e})}function xt(e,t=!0){return u({queryKey:q.quotaHistory(e),enabled:t,queryFn:({signal:t})=>i(a(`/api/credentials/quota/history`,{credentialId:e.credentialId,since:e.since,...e.until===void 0?{}:{until:e.until}}),t),refetchInterval:!1})}function St(){return u({queryKey:q.models,queryFn:async({signal:e})=>(await i(`/api/models`,e)).models})}function Ct(){return u({queryKey:q.keys,queryFn:async({signal:e})=>(await i(`/api/keys`,e)).keys})}var wt={queryKey:q.settings,queryFn:({signal:e})=>i(`/api/settings`,e)};function Tt(){return u({...wt,select:e=>e.settings})}function Et(){return u({...wt,select:e=>e.bodyLoggingAllowed&&e.settings.bodyLoggingEnabled})}function Dt(){return u({...wt,select:e=>e.bodyLoggingAllowed})}function Ot(e,t){return u({queryKey:q.agentSetup(e,t),enabled:t!==void 0,queryFn:async({signal:n})=>(await i(a(`/api/agent-setup`,{client:e,...t??{}}),n)).files})}function kt(e,t=6e4){return u({queryKey:q.usage(e),queryFn:async({signal:t})=>(await i(a(`/api/usage`,{groupBy:e.groupBy,since:e.since,...e.grain===void 0?{}:{grain:e.grain},...e.splitBy===void 0?{}:{splitBy:e.splitBy},...e.until===void 0?{}:{until:e.until}}),t)).rows,refetchInterval:t})}var At=2e3;function jt(e=100,t=At){return u({queryKey:q.logs(e),queryFn:async({signal:t})=>(await i(a(`/api/logs`,{limit:e}),t)).logs,refetchInterval:t})}function Mt(e){return u({queryKey:q.requestBody(e??``),enabled:e!==null,queryFn:({signal:t})=>i(`/api/requests/${encodeURIComponent(e??``)}/body`,t),refetchInterval:!1})}var Nt=5e3;function Pt(e=200,t=``,n=Nt,r=``){return u({queryKey:q.console(e,t,r),queryFn:async({signal:n})=>i(a(`/api/console`,{lines:e,...t===``?{}:{level:t},...r===``?{}:{node:r}}),n),refetchInterval:n})}var Ft=3e4;function It(){return u({queryKey:q.nodes,queryFn:async({signal:e})=>i(`/api/nodes`,e),refetchInterval:Ft})}function Lt(){return u({queryKey:q.database,queryFn:({signal:e})=>i(`/api/database`,e),refetchInterval:!1,refetchOnWindowFocus:!1,staleTime:1/0})}function Rt(e){return`/api/database/snapshots/${encodeURIComponent(e)}/download`}function zt(){return u({queryKey:q.snapshots,queryFn:async({signal:e})=>(await i(`/api/database/snapshots`,e)).snapshots,refetchInterval:!1})}function J(e){e.invalidateQueries({queryKey:q.database})}function Bt(){let e=d();return l({mutationFn:()=>t(`/api/database/snapshots`),onSuccess:()=>J(e)})}function Vt(){let e=d();return l({mutationFn:e=>n(`/api/database/retention`,e),onSuccess:()=>{J(e),e.invalidateQueries({queryKey:q.settings})}})}function Ht(){let e=d();return l({mutationFn:()=>t(`/api/database/vacuum`),onSuccess:()=>J(e)})}function Ut(){let t=d();return l({mutationFn:()=>e(`/api/database/bodies`),onSuccess:()=>{J(t),t.invalidateQueries({queryKey:[`logs`]})}})}function Wt(){let t=d();return l({mutationFn:t=>e(`/api/database/snapshots/${encodeURIComponent(t)}`),onSuccess:()=>J(t)})}function Gt(){return l({mutationFn:e=>t(`/api/database/snapshots/${encodeURIComponent(e)}/restore`)})}function Kt(){return l({mutationFn:e=>t(`/api/database/import`,e)})}function qt(){return u({queryKey:q.lifecycle,queryFn:({signal:e})=>i(`/api/lifecycle`,e),refetchInterval:!1})}function Jt(){return l({mutationFn:()=>t(`/api/lifecycle/restart`)})}function Yt(){return l({mutationFn:()=>t(`/api/lifecycle/shutdown`)})}function Xt(){let e=d();return l({mutationFn:({mode:e,secret:n})=>e===`client`?t(`/api/client/login`,{key:n}):t(`/api/login`,{password:n,...e===`viewer`?{mode:`viewer`}:{}}),onSuccess:()=>e.invalidateQueries()})}function Zt(){let e=d();return l({mutationFn:e=>t(`/api/setup`,{password:e}),onSuccess:()=>e.invalidateQueries()})}function Qt(){let e=d();return l({mutationFn:()=>t(`/api/logout`),onSuccess:()=>{e.clear()}})}function $t(){let e=d();return l({mutationFn:()=>t(`/api/client/logout`),onSuccess:()=>e.clear()})}function en(){return u({queryKey:q.clientSummary,queryFn:({signal:e})=>i(`/api/client/summary`,e)})}function tn(e,t=6e4){return u({queryKey:q.clientUsage(e),queryFn:({signal:t})=>i(a(`/api/client/usage`,{groupBy:e.groupBy,since:e.since,...e.grain===void 0?{}:{grain:e.grain},...e.splitBy===void 0?{}:{splitBy:e.splitBy},...e.until===void 0?{}:{until:e.until}}),t),refetchInterval:t})}function nn(e=100,t=At){return u({queryKey:q.clientLogs(e),queryFn:async({signal:t})=>(await i(a(`/api/client/logs`,{limit:e}),t)).logs,refetchInterval:t})}function rn(e=6e4){return u({queryKey:q.clientQuota,queryFn:async({signal:e})=>(await i(`/api/client/quota`,e)).accounts,refetchInterval:e})}function an(e,t=!0){return u({queryKey:q.clientQuotaHistory(e),enabled:t,queryFn:({signal:t})=>i(a(`/api/client/quota/history`,{since:e.since,...e.until===void 0?{}:{until:e.until}}),t),refetchInterval:3e5})}function on(){let e=d();return l({mutationFn:({id:e,patch:t})=>s(`/api/credentials/${e}`,t),onSuccess:()=>{e.invalidateQueries({queryKey:q.credentials}),e.invalidateQueries({queryKey:q.credentialHealth})}})}function sn(){let t=d();return l({mutationFn:t=>e(`/api/credentials/${t}`),onSuccess:()=>{t.invalidateQueries({queryKey:q.credentials}),t.invalidateQueries({queryKey:q.credentialHealth})}})}function cn(){let e=d();return l({mutationFn:e=>n(`/api/models/${e.id}`,e),onSuccess:()=>e.invalidateQueries({queryKey:q.models})})}function ln(){let t=d();return l({mutationFn:t=>e(`/api/models/${t}`),onSuccess:()=>t.invalidateQueries({queryKey:q.models})})}function un(){return l({mutationFn:({modelId:e,need:n})=>t(`/api/models/${e}/dry-run`,n)})}function dn(){let e=d();return l({mutationFn:e=>t(`/api/keys`,e),onSuccess:()=>e.invalidateQueries({queryKey:q.keys})})}function fn(){let e=d();return l({mutationFn:({id:e,limits:t})=>n(`/api/keys/${e}/limits`,{limits:t}),onSuccess:()=>e.invalidateQueries({queryKey:q.keys})})}function pn(){let e=d();return l({mutationFn:({id:e,modelAllowlist:t})=>n(`/api/keys/${e}/models`,{modelAllowlist:t}),onSuccess:()=>e.invalidateQueries({queryKey:q.keys})})}function mn(){let t=d();return l({mutationFn:t=>e(`/api/keys/${t}`),onSuccess:()=>t.invalidateQueries({queryKey:q.keys})})}function hn(){let e=d();return l({mutationFn:e=>n(`/api/settings`,e),onSuccess:()=>e.invalidateQueries({queryKey:q.settings})})}function gn(){return l({mutationFn:e=>n(`/api/settings/password`,e)})}function _n(){let e=d();return l({mutationFn:e=>n(`/api/settings/viewer-password`,{password:e}),onSuccess:()=>e.invalidateQueries({queryKey:q.status})})}function vn(){return l({mutationFn:e=>t(`/api/connect/start`,e)})}function yn(){let e=d();return l({mutationFn:e=>t(`/api/credentials`,e),onSuccess:()=>e.invalidateQueries({queryKey:q.credentials})})}function bn(){let e=d();return l({mutationFn:e=>t(`/api/connect/finish`,e),onSuccess:()=>e.invalidateQueries({queryKey:q.credentials})})}function xn(){return u({queryKey:q.plugins,queryFn:async({signal:e})=>(await i(`/api/plugins`,e)).plugins,staleTime:3e5})}async function Sn(e){let t=await o(`/api/connect/poll`,{method:`POST`,body:{flowId:e},accept:[202]});return t.status===202?{status:`pending`}:t.data}var Cn=new Intl.NumberFormat(`en-US`,{notation:`compact`,maximumFractionDigits:1}),wn=new Intl.NumberFormat(`en-US`);function Tn(e){return Number.isFinite(e)?e<1e4?wn.format(Math.round(e)):Cn.format(e).toLowerCase():`—`}function En(e){return Number.isFinite(e)?e===0?`$0`:e<.01?`$${e.toFixed(4)}`:e<100?`$${e.toFixed(2)}`:`$${Cn.format(e).toLowerCase()}`:`—`}function Dn(e){return e==null||!Number.isFinite(e)?`—`:e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${Math.round(e/6e4)}m`}function On(e,t=1){return Number.isFinite(e)?`${(e*100).toFixed(t)}%`:`—`}var kn=[[6e4,1e3,`s`],[36e5,6e4,`m`],[864e5,36e5,`h`],[1/0,864e5,`d`]];function Y(e){let t=Math.abs(e);if(t<1e3)return`0s`;let n=kn.find(([e])=>t<e);return n===void 0?`—`:`${Math.floor(t/n[1])}${n[2]}`}function An(e,t=Date.now()){if(e==null||!Number.isFinite(e))return`—`;let n=e-t;return Math.abs(n)<5e3?`just now`:n<0?`${Y(n)} ago`:`in ${Y(n)}`}function jn(e){return new Date(e).toLocaleTimeString(`en-GB`,{hour12:!1})}var Mn=864e5;function Nn(e,t){let n=new Date(e),r=n.toLocaleTimeString(`en-GB`,{hour:`2-digit`,minute:`2-digit`,hour12:!1});return Pn(t)?`${n.toLocaleDateString(`en-GB`,{day:`2-digit`,month:`short`})} ${r}`:r}function Pn(e){return e>=Mn}function Fn(e){return e==null||!Number.isFinite(e)?`—`:new Date(e).toLocaleString(`en-GB`,{year:`numeric`,month:`short`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,hour12:!1})}var In=[`B`,`KiB`,`MiB`,`GiB`,`TiB`];function Ln(e){if(e==null||!Number.isFinite(e))return`—`;if(Math.abs(e)<1024)return`${Math.round(e)} B`;let t=e,n=0;for(;Math.abs(t)>=1024&&n<In.length-1;)t/=1024,n+=1;return`${t.toFixed(1)} ${In[n]}`}function Rn(e,t=8){return e.length<=t?e:`${e.slice(0,t)}…`}var zn={fiveHour:18e6,daily:864e5,weekly:6048e5};function X(e,t){return t!==null&&t>0?t:zn[e]}var Bn=6e4;function Z(e,t){return e===null||t===null?e===t:Math.abs(e-t)<=Bn}function Vn(e,t){return e.resetsAt!==null&&e.resetsAt<=t}function Hn(e,t){return t===void 0?`unknown`:e.observedAt>0&&t.stale?`stale`:t.ratePerHour===null||e.limit===null||e.limit<=0?`unknown`:t.survives===!1&&t.exhaustsAt!==null?`empty`:t.survives===!0?`ok`:`unknown`}function Un(e,t){if(t.provider!==e.provider)return!1;let n=Symbol(`unusable-endpoint`);return(e=>e===void 0||e===``?void 0:e)(e.endpointId)===(e=>{if(e!==void 0)return typeof e==`string`&&e!==``?e:n})(t.providerData.endpointId)?e.credentialId===void 0||t.id===e.credentialId:!1}function Wn(e,t){if(e.length===0)return null;let n=[...e].sort((e,t)=>e-t);return n[Math.min(n.length-1,Math.max(0,Math.ceil(t*n.length)-1))]??null}function Q(e){return e.state===`pending`}function Gn(e){return e.filter(e=>!Q(e))}function $(e){return Q(e)?!1:e.status>=400||e.errorCode!==null}var Kn={ok:`●`,warn:`◐`,down:`○`,idle:`·`,live:`●`};function qn(e){return Q(e)?`live`:$(e)?`down`:`ok`}function Jn(e){return Q(e)?`in flight`:$(e)?`failed with ${e.status}`:`succeeded`}function Yn(e,t){let n=Gn(e),r=[],i=0,a=0,o=0,s=0,c=0,l=0;for(let e of n)$(e)&&(i+=1),e.ttftMs!==null&&Number.isFinite(e.ttftMs)&&r.push(e.ttftMs),a+=e.costUsd,o+=e.inputTokens,s+=e.outputTokens,c+=e.cacheReadTokens,l+=e.cacheWriteTokens;let u=t/6e4;return{requests:n.length,errors:i,errorRate:n.length===0?0:i/n.length,ratePerMin:u<=0?0:n.length/u,ttftP50:Wn(r,.5),ttftP95:Wn(r,.95),costUsd:a,inputTokens:o,outputTokens:s,cacheReadTokens:c,cacheWriteTokens:l}}function Xn(e,t){let n=Gn(e),{now:r,spanMs:i,count:a}=t,o=i/a,s=r-i,c=Array.from({length:a},(e,t)=>({at:s+t*o,total:0,errors:0,costUsd:0,tokens:0,ttftMs:null})),l=Array.from({length:a},()=>[]);for(let e of n){if(e.at<s||e.at>r)continue;let t=Math.min(a-1,Math.floor((e.at-s)/o)),n=c[t];n!==void 0&&(n.total+=1,n.costUsd+=e.costUsd,n.tokens+=e.inputTokens+e.outputTokens+e.cacheReadTokens+e.cacheWriteTokens,$(e)&&(n.errors+=1),e.ttftMs!==null&&Number.isFinite(e.ttftMs)&&l[t]?.push(e.ttftMs))}for(let[e,t]of c.entries())t.ttftMs=Wn(l[e]??[],.5);return c}var Zn={tokenRejected:`reconnect needed — provider rejected the refresh token`,expiredNoRefresh:`reconnect needed — token expired with nothing to refresh from`};function Qn(e,t,n,r=null){if(!n){let e=r===`tokenRejected`||r===`expiredNoRefresh`;return{state:e?`down`:`idle`,note:e?Zn[r]:`disabled`,ttftMs:null,lastUsedAt:null,consecutiveFailures:0}}if(e.length===0)return{state:`idle`,note:`unused`,ttftMs:null,lastUsedAt:null,consecutiveFailures:0};let i=`ok`,a=``,o=null,s=null,c=0;for(let n of e){if(n.ewmaTtftMs!==null&&(o=o===null?n.ewmaTtftMs:Math.max(o,n.ewmaTtftMs)),n.lastUsedAt!==null&&(s=s===null?n.lastUsedAt:Math.max(s,n.lastUsedAt)),c=Math.max(c,n.consecutiveFailures),n.breakerState===`open`){i=`down`,a=`breaker open`;continue}if(n.rateLimitedUntil!==null&&n.rateLimitedUntil>t&&i!==`down`){i=`warn`,a=`rate limited`;continue}n.breakerState===`halfOpen`&&i===`ok`&&(i=`warn`,a=`probing`)}return{state:i,note:a,ttftMs:o,lastUsedAt:s,consecutiveFailures:c}}var $n={fiveHour:`5h`,daily:`24h`,weekly:`7d`};function er(e){return Math.max(e,6e4)*3}function tr(e,t,n){return e.observedAt<=0||t-e.observedAt>er(n)}function nr(e,t){return t?.ratePerHour===void 0||t.ratePerHour===null||e.limit===null||e.limit<=0?null:t.ratePerHour/e.limit}function rr(e,t){return e.find(e=>e.windowType===t)}function ir(e,t,n,r,i){return ar(e,{stale:tr(e,t,n),rolledOver:Vn(e,t),estimateStale:i===void 0||i.stale,survives:i?.survives??null,exhaustsAt:i?.exhaustsAt??null},t,r)}function ar(e,t,n,r){let i=$n[e.windowType];if(e.observedAt<=0)return`${i} · never observed`;if(t.stale)return`${i} · stale, read ${r(e.observedAt,n)}`;if(t.rolledOver)return`${i} · rolled over, waiting for the next reading`;if(e.resetsAt===null)return i;let a=`resets ${r(e.resetsAt,n)}`;return t.estimateStale||t.survives!==!1||t.exhaustsAt===null?`${i} · ${a}`:`${i} · ${t.exhaustsAt<=n?`empty now`:`empty ~${Y(t.exhaustsAt-n)}`} · ${a}`}function or(e){return{observedAt:e.observedAt,windowType:e.windowType,windowMs:e.windowMs,resetsAt:e.resetsAt,usedRatio:e.limit===null||e.limit<=0?null:Math.min(1,Math.max(0,e.used/e.limit))}}function sr(e,t){if(e.usedRatio!==0||t.usedRatio!==0)return!1;let n=X(e.windowType,e.windowMs),r=X(t.windowType,t.windowMs);return n===r&&Z(e.resetsAt,e.observedAt+n)&&Z(t.resetsAt,t.observedAt+r)&&!Z(t.resetsAt,e.resetsAt)}function cr(e){let t=e.filter(e=>e.usedRatio!==null).sort((e,t)=>e.observedAt-t.observedAt),n=[],r;for(let e of t){let t={at:e.observedAt,percent:Math.min(100,e.usedRatio*100)},i={resetsAt:e.resetsAt,startsAt:e.resetsAt===null?null:e.resetsAt-X(e.windowType,e.windowMs)},a=n[n.length-1],o=r!==void 0&&sr(r,e);a===void 0||r===void 0||!o&&!Z(e.resetsAt,r.resetsAt)?n.push({key:`window-${n.length}`,points:[t],...i}):(a.points.push(t),a.resetsAt=o?null:i.resetsAt,a.startsAt=o?null:i.startsAt),r=e}return n}function lr(e,t){let{usedRatio:n,observedAt:r}=t;if(n===null)return[...e];let i=e.findLastIndex(e=>Z(e.resetsAt,t.resetsAt)),a=e[i];if(a===void 0)return[...e];let o=a.points[a.points.length-1];if(o===void 0||o.at>=r)return[...e];let s={at:r,percent:Math.min(100,n*100)};return e.map((e,t)=>t===i?{...e,points:[...e.points,s]}:e)}function ur(e){return e.startsAt===null||e.resetsAt===null?null:{from:{at:e.startsAt,percent:0},to:{at:e.resetsAt,percent:100}}}var dr=36e5;function fr(e,t){let{usedRatio:n,resetsAt:r,observedAt:i}=e,a=t;if(n===null||r===null||a===null||a<=0)return null;let o=Math.min(100,n*100),s=a*100,c={at:i,percent:o},l=o+s*((r-i)/dr);return l<=100?{from:c,to:{at:r,percent:l}}:{from:c,to:{at:i+(100-o)/s*dr,percent:100}}}var pr={fiveHour:0,daily:1,weekly:2};function mr(e){return e.filter(e=>e.limit!==null&&e.limit>0).map(e=>({window:e,fraction:Math.min(1,e.used/e.limit)})).sort((e,t)=>pr[e.window.windowType]-pr[t.window.windowType])}function hr(e,t){let n=new Map;for(let r of e){let e=t(r),i=n.get(e);i===void 0?n.set(e,[r]):i.push(r)}return n}var gr=C`
|
|
2
|
-
0%, 100% { opacity: 1; }
|
|
3
|
-
50% { opacity: 0.28; }
|
|
4
|
-
`,_r=S`
|
|
5
|
-
color: ${({theme:e})=>e.color.ok};
|
|
6
|
-
animation: ${gr} 1.2s ease-in-out infinite;
|
|
7
|
-
|
|
8
|
-
@media (prefers-reduced-motion: reduce) {
|
|
9
|
-
animation: none;
|
|
10
|
-
}
|
|
11
|
-
`,vr={ok:S`
|
|
12
|
-
color: ${({theme:e})=>e.color.ok};
|
|
13
|
-
`,warn:S`
|
|
14
|
-
color: ${({theme:e})=>e.color.warn};
|
|
15
|
-
`,down:S`
|
|
16
|
-
color: ${({theme:e})=>e.color.down};
|
|
17
|
-
`,idle:S`
|
|
18
|
-
color: ${({theme:e})=>e.color.inkFaint};
|
|
19
|
-
`,live:_r},yr=x.span`
|
|
20
|
-
font-family: ${({theme:e})=>e.font.mono};
|
|
21
|
-
font-size: 12px;
|
|
22
|
-
line-height: 1;
|
|
23
|
-
flex: none;
|
|
24
|
-
${({$state:e})=>vr[e]}
|
|
25
|
-
`;function br({state:e,label:t,className:n}){return b(yr,{$state:e,className:n,role:`img`,"aria-label":t,title:t,children:Kn[e]})}export{rn as $,Me as $t,Tn as A,mn as At,At as B,zt as Bt,X as C,ce as Cn,It as Ct,Ln as D,Mt as Dt,Un as E,xt as Et,An as F,pn as Ft,Rt as G,pt as Gt,_t as H,on as Ht,En as I,_n as It,Dt as J,Xe as Jt,Ot as K,$e as Kt,Pn as L,Tt as Lt,Y as M,Vt as Mt,Dn as N,hn as Nt,Nn as O,Jt as Ot,On as P,fn as Pt,nn as Q,He as Qt,Rn as R,Zt as Rt,lr as S,se as Sn,St,Hn as T,T as Tn,gt as Tt,Sn as U,kt as Ut,ht as V,vt as Vt,q as W,Ht as Wt,Ut as X,Ne as Xt,gn as Y,Ge as Yt,$t as Z,Be as Zt,cr as _,re as _n,Ct as _t,ur as a,be as an,Pt as at,or as b,fe as bn,Qt as bt,hr as c,H as cn,Bt as ct,tr as d,P as dn,Lt as dt,ze as en,an as et,Jn as f,he as fn,sn as ft,ar as g,_e as gn,Kt as gt,ir as h,A as hn,un as ht,Xn as i,De as in,vn as it,Fn as j,cn as jt,jn as k,Gt as kt,$ as l,we as ln,bt as lt,fr as m,ge as mn,Wt as mt,$n as n,Pe as nn,tn as nt,rr as o,Se as on,yn as ot,qn as p,N as pn,ln as pt,Et as q,Qe as qt,pr as r,Fe as rn,bn as rt,Qn as s,xe as sn,dn as st,br as t,Ie as tn,en as tt,Q as u,F as un,yt as ut,mr as v,ae as vn,qt as vt,Vn as w,w as wn,xn as wt,Yn as x,E as xn,jt as xt,nr as y,M as yn,Xt as yt,Nt as z,Yt as zt};
|