@jean2/client 1.0.4 → 1.0.5

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.
Files changed (31) hide show
  1. package/README.md +2 -2
  2. package/dist/assets/ServerContext-Dy9T5Mj8.js +1 -0
  3. package/dist/assets/SessionContent-DMPPyidM.js +11 -0
  4. package/dist/assets/{SessionMenuButton-vkh7M4zW.js → SessionMenuButton-DtN_qfRb.js} +1 -1
  5. package/dist/assets/_serverId-BOWHyoan.js +12 -0
  6. package/dist/assets/_sessionId-BfVgqUBK.js +1 -0
  7. package/dist/assets/_sessionId-Bp7Qrc4O.js +1 -0
  8. package/dist/assets/add-server-BU3oc_j3.js +1 -0
  9. package/dist/assets/index-Db3JxRbZ.js +10 -0
  10. package/dist/assets/index-DzEyMPKG.css +2 -0
  11. package/dist/assets/{mutation-CAoDu7x3.js → mutation-D4xtepYQ.js} +1 -1
  12. package/dist/assets/{overview-BqXC_X43.js → overview-DbKX71kj.js} +1 -1
  13. package/dist/assets/platform-cRBZ7eSy.js +1 -0
  14. package/dist/assets/{preload-helper-eKqpTzup.js → preload-helper-D844vhe4.js} +1 -1
  15. package/dist/assets/{queries-CFdMXU0x.js → queries-C0JoQFZb.js} +1 -1
  16. package/dist/assets/{routes-cgaNpRxR.js → routes-Ck6V8B0w.js} +1 -1
  17. package/dist/assets/{sidebar-C-dZ1XFl.js → sidebar-BqQ-fUFc.js} +1 -1
  18. package/dist/assets/{src-DMBD0Xgc.js → src-BALdofIU.js} +1 -1
  19. package/dist/assets/{workspace-CdMsk_3x.js → workspace-BzFUmInc.js} +1 -1
  20. package/dist/cli.mjs +21 -9
  21. package/dist/index.html +7 -7
  22. package/package.json +1 -1
  23. package/dist/assets/ServerContext-CH3cYgM3.js +0 -1
  24. package/dist/assets/SessionContent-CMU2K0ZO.js +0 -9
  25. package/dist/assets/_serverId-BCYw0-Oi.js +0 -12
  26. package/dist/assets/_sessionId-B6Q1fh9D.js +0 -1
  27. package/dist/assets/_sessionId-DErHwuR_.js +0 -1
  28. package/dist/assets/add-server-BdiLp0YW.js +0 -1
  29. package/dist/assets/index-BPY3JRFs.css +0 -2
  30. package/dist/assets/index-DFZki7uV.js +0 -10
  31. package/dist/assets/platform-BOMKRNFM.js +0 -1
@@ -0,0 +1 @@
1
+ import{i as e,n as t,o as n,r}from"./compiler-runtime-DZXZ41-q.js";import{a as i,i as a,n as o,r as s,t as c}from"./classPrivateFieldGet2-BGlEuFdn.js";import{u as l}from"./ServerContext-Dy9T5Mj8.js";import{t as u}from"./useRouter-C67ywEA3.js";var d=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(){}},f,p,m,h=new(f=new WeakMap,p=new WeakMap,m=new WeakMap,class extends d{constructor(){super(),a(this,f,void 0),a(this,p,void 0),a(this,m,void 0),o(m,this,e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}})}onSubscribe(){c(p,this)||this.setEventListener(c(m,this))}onUnsubscribe(){if(!this.hasListeners()){var e;(e=c(p,this))==null||e.call(this),o(p,this,void 0)}}setEventListener(e){var t;o(m,this,e),(t=c(p,this))==null||t.call(this),o(p,this,e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()}))}setFocused(e){c(f,this)!==e&&(o(f,this,e),this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){var e;return typeof c(f,this)==`boolean`?c(f,this):((e=globalThis.document)==null?void 0:e.visibilityState)!==`hidden`}}),g,_,v={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},y=new(g=new WeakMap,_=new WeakMap,class{constructor(){a(this,g,v),a(this,_,!1)}setTimeoutProvider(e){o(g,this,e)}setTimeout(e,t){return c(g,this).setTimeout(e,t)}clearTimeout(e){c(g,this).clearTimeout(e)}setInterval(e,t){return c(g,this).setInterval(e,t)}clearInterval(e){c(g,this).clearInterval(e)}});function b(e){setTimeout(e,0)}var x=typeof window>`u`||`Deno`in globalThis;function S(){}function C(e,t){return typeof e==`function`?e(t):e}function w(e){return typeof e==`number`&&e>=0&&e!==1/0}function T(e,t){return Math.max(e+(t||0)-Date.now(),0)}function E(e,t){return typeof e==`function`?e(t):e}function D(e,t){return typeof e==`function`?e(t):e}function O(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==A(o,t.options))return!1}else if(!M(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 k(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(j(t.options.mutationKey)!==j(a))return!1}else if(!M(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function A(e,t){return((t==null?void 0:t.queryKeyHashFn)||j)(e)}function j(e){return JSON.stringify(e,(e,t)=>re(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function M(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>M(e[n],t[n])):!1}var N=Object.prototype.hasOwnProperty;function ee(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=ne(e)&&ne(t);if(!r&&!(re(e)&&re(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:N.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=ee(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function te(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 ne(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function re(e){if(!ie(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ie(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function ie(e){return Object.prototype.toString.call(e)===`[object Object]`}function ae(e){return new Promise(t=>{y.setTimeout(t,e)})}function oe(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:ee(e,t)}function se(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ce(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var le=Symbol();function ue(e,t){return!e.queryFn&&t!=null&&t.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===le?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function de(e,t){return typeof e==`function`?e(...t):!!e}function fe(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i!=null||(i=t()),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var pe=(()=>{let e=()=>x;return{isServer(){return e()},setIsServer(t){e=t}}})();function me(){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}var he=b;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 _e=ge(),ve,P,ye,be=new(ve=new WeakMap,P=new WeakMap,ye=new WeakMap,class extends d{constructor(){super(),a(this,ve,!0),a(this,P,void 0),a(this,ye,void 0),o(ye,this,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(){c(P,this)||this.setEventListener(c(ye,this))}onUnsubscribe(){if(!this.hasListeners()){var e;(e=c(P,this))==null||e.call(this),o(P,this,void 0)}}setEventListener(e){var t;o(ye,this,e),(t=c(P,this))==null||t.call(this),o(P,this,e(this.setOnline.bind(this)))}setOnline(e){c(ve,this)!==e&&(o(ve,this,e),this.listeners.forEach(t=>{t(e)}))}isOnline(){return c(ve,this)}});function xe(e){return Math.min(1e3*2**e,3e4)}function Se(e){return(e==null?`online`:e)===`online`?be.isOnline():!0}var Ce=class extends Error{constructor(e){super(`CancelledError`),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function we(e){let t=!1,n=0,r,i=me(),a=()=>i.status!==`pending`,o=t=>{if(!a()){var n;let r=new Ce(t);f(r),(n=e.onCancel)==null||n.call(e,r)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>h.isFocused()&&(e.networkMode===`always`||be.isOnline())&&e.canRun(),u=()=>Se(e.networkMode)&&e.canRun(),d=e=>{a()||(r==null||r(),i.resolve(e))},f=e=>{a()||(r==null||r(),i.reject(e))},p=()=>new Promise(t=>{var n;r=e=>{(a()||l())&&t(e)},(n=e.onPause)==null||n.call(e)}).then(()=>{if(r=void 0,!a()){var t;(t=e.onContinue)==null||t.call(e)}}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i==null?e.fn():i}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{var i,o,s;if(a())return;let c=(i=e.retry)==null?pe.isServer()?0:3:i,u=(o=e.retryDelay)==null?xe:o,d=typeof u==`function`?u(n,r):u,h=c===!0||typeof c==`number`&&n<c||typeof c==`function`&&c(n,r);if(t||!h){f(r);return}n++,(s=e.onFail)==null||s.call(e,n,r),ae(d).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r==null||r(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var Te,Ee=(Te=new WeakMap,class{constructor(){a(this,Te,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),w(this.gcTime)&&o(Te,this,y.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e==null?pe.isServer()?1/0:300*1e3:e)}clearGcTimeout(){c(Te,this)!==void 0&&(y.clearTimeout(c(Te,this)),o(Te,this,void 0))}});function De(e){return{onFetch:(t,n)=>{var r,i,a;let o=t.options,s=(r=t.fetchOptions)==null||(r=r.meta)==null||(r=r.fetchMore)==null?void 0:r.direction,c=((i=t.state.data)==null?void 0:i.pages)||[],l=((a=t.state.data)==null?void 0:a.pageParams)||[],u={pages:[],pageParams:[]},d=0,f=async()=>{let n=!1,r=e=>{fe(e,()=>t.signal,()=>n=!0)},i=ue(t.options,t.fetchOptions),a=async(e,a,o)=>{if(n)return Promise.reject(t.signal.reason);if(a==null&&e.pages.length)return Promise.resolve(e);let s=await i((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:a,direction:o?`backward`:`forward`,meta:t.options.meta};return r(e),e})()),{maxPages:c}=t.options,l=o?ce:se;return{pages:l(e.pages,s,c),pageParams:l(e.pageParams,a,c)}};if(s&&c.length){let e=s===`backward`,t=e?ke:Oe,n={pages:c,pageParams:l};u=await a(n,t(o,n),e)}else{let t=e==null?c.length:e;do{var f;let e=d===0?(f=l[0])==null?o.initialPageParam:f:Oe(o,u);if(d>0&&e==null)break;u=await a(u,e),d++}while(d<t)}return u};t.options.persister?t.fetchFn=()=>{var e,r;return(e=(r=t.options).persister)==null?void 0:e.call(r,f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=f}}}function Oe(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 ke(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}function Ae(e,t){i(e,t),t.add(e)}var je,Me,Ne,F,Pe,I,Fe,Ie,L,Le=(je=new WeakMap,Me=new WeakMap,Ne=new WeakMap,F=new WeakMap,Pe=new WeakMap,I=new WeakMap,Fe=new WeakMap,Ie=new WeakMap,L=new WeakSet,class extends Ee{constructor(e){var t;super(),Ae(this,L),a(this,je,void 0),a(this,Me,void 0),a(this,Ne,void 0),a(this,F,void 0),a(this,Pe,void 0),a(this,I,void 0),a(this,Fe,void 0),a(this,Ie,void 0),o(Ie,this,!1),o(Fe,this,e.defaultOptions),this.setOptions(e.options),this.observers=[],o(Pe,this,e.client),o(F,this,c(Pe,this).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,o(Me,this,Ve(this.options)),this.state=(t=e.state)==null?c(Me,this):t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return c(je,this)}get promise(){var e;return(e=c(I,this))==null?void 0:e.promise}setOptions(e){if(this.options={...c(Fe,this),...e},e!=null&&e._type&&o(je,this,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Ve(this.options);e.data!==void 0&&(this.setState(Be(e.data,e.dataUpdatedAt)),o(Me,this,e))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&c(F,this).remove(this)}setData(e,t){let n=oe(this.state.data,e,this.options);return s(L,this,R).call(this,{data:n,type:`success`,dataUpdatedAt:t==null?void 0:t.updatedAt,manual:t==null?void 0:t.manual}),n}setState(e){s(L,this,R).call(this,{type:`setState`,state:e})}cancel(e){var t,n;let r=(t=c(I,this))==null?void 0:t.promise;return(n=c(I,this))==null||n.cancel(e),r?r.then(S).catch(S):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return c(Me,this)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>D(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===le||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>E(e.options.staleTime,this)===`static`):!1}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:!T(this.state.dataUpdatedAt,e)}onFocus(){var e;let t=this.observers.find(e=>e.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(e=c(I,this))==null||e.continue()}onOnline(){var e;let t=this.observers.find(e=>e.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(e=c(I,this))==null||e.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),c(F,this).notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(c(I,this)&&(c(Ie,this)||s(L,this,Re).call(this)?c(I,this).cancel({revert:!0}):c(I,this).cancelRetry()),this.scheduleGc()),c(F,this).notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||s(L,this,R).call(this,{type:`invalidate`})}async fetch(e,t){var n,r;if(this.state.fetchStatus!==`idle`&&((n=c(I,this))==null?void 0:n.status())!==`rejected`){if(this.state.data!==void 0&&t!=null&&t.cancelRefetch)this.cancel({silent:!0});else if(c(I,this))return c(I,this).continueRetry(),c(I,this).promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let i=new AbortController,a=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(o(Ie,this,!0),i.signal)})},l=()=>{let e=ue(this.options,t),n=(()=>{let e={client:c(Pe,this),queryKey:this.queryKey,meta:this.meta};return a(e),e})();return o(Ie,this,!1),this.options.persister?this.options.persister(e,n,this):e(n)},u=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:c(Pe,this),state:this.state,fetchFn:l};return a(e),e})(),d=c(je,this)===`infinite`?De(this.options.pages):this.options.behavior;if(d==null||d.onFetch(u,this),o(Ne,this,this.state),this.state.fetchStatus===`idle`||this.state.fetchMeta!==((r=u.fetchOptions)==null?void 0:r.meta)){var f;s(L,this,R).call(this,{type:`fetch`,meta:(f=u.fetchOptions)==null?void 0:f.meta})}o(I,this,we({initialPromise:t==null?void 0:t.initialPromise,fn:u.fetchFn,onCancel:e=>{e instanceof Ce&&e.revert&&this.setState({...c(Ne,this),fetchStatus:`idle`}),i.abort()},onFail:(e,t)=>{s(L,this,R).call(this,{type:`failed`,failureCount:e,error:t})},onPause:()=>{s(L,this,R).call(this,{type:`pause`})},onContinue:()=>{s(L,this,R).call(this,{type:`continue`})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{var p,m,h,g;let e=await c(I,this).start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),(p=(m=c(F,this).config).onSuccess)==null||p.call(m,e,this),(h=(g=c(F,this).config).onSettled)==null||h.call(g,e,this.state.error,this),e}catch(e){var _,v,y,b;if(e instanceof Ce){if(e.silent)return c(I,this).promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw s(L,this,R).call(this,{type:`error`,error:e}),(_=(v=c(F,this).config).onError)==null||_.call(v,e,this),(y=(b=c(F,this).config).onSettled)==null||y.call(b,this.state.data,e,this),e}finally{this.scheduleGc()}}});function Re(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}function R(e){this.state=(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`:var n;return{...t,...ze(t.data,this.options),fetchMeta:(n=e.meta)==null?null:n};case`success`:let r={...t,...Be(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return o(Ne,this,e.manual?r:void 0),r;case`error`:let i=e.error;return{...t,error:i,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}})(this.state),_e.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),c(F,this).notify({query:this,type:`updated`,action:e})})}function ze(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Se(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Be(e,t){return{data:e,dataUpdatedAt:t==null?Date.now():t,error:null,isInvalidated:!1,status:`success`}}function Ve(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==null?Date.now():r:0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var z=n(r(),1),B=t(),He=z.createContext(void 0),Ue=e=>{let t=z.useContext(He);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},We=({client:e,children:t})=>(z.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,B.jsx)(He.Provider,{value:e,children:t}));function Ge(e){return e[e.length-1]}function Ke(e){return typeof e==`function`}function V(e,t){return Ke(e)?e(t):e}var qe=Object.prototype.hasOwnProperty,Je=Object.prototype.propertyIsEnumerable,Ye=()=>Object.create(null),Xe=(e,t)=>H(e,t,Ye);function H(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=et(e)&&et(i);if(!a&&!(Qe(e)&&Qe(i)))return i;let o=a?e:Ze(e);if(!o)return i;let s=a?i:Ze(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:qe.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=H(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function Ze(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!Je.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!Je.call(e,t))return!1;r.push(t)}return r}function Qe(e){if(!$e(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!$e(n)||!n.hasOwnProperty(`isPrototypeOf`))}function $e(e){return Object.prototype.toString.call(e)===`[object Object]`}function et(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function U(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(!U(e[r],t[r],n))return!1;return!0}if(Qe(e)&&Qe(t)){var r;let i=(r=n==null?void 0:n.ignoreUndefined)==null?!0:r;if(n!=null&&n.partial){for(let r in t)if((!i||t[r]!==void 0)&&!U(e[r],t[r],n))return!1;return!0}let a=0;if(!i)a=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&a++;let o=0;for(let r in t)if((!i||t[r]!==void 0)&&(o++,o>a||!U(e[r],t[r],n)))return!1;return a===o}return!1}function tt(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e==null||e(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function nt(e){return typeof(e==null?void 0: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}function rt(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function it(e){return e.replace(/[\x00-\x1f\x7f]/g,``)}function at(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 it(t)}var ot=[`http:`,`https:`,`mailto:`,`tel:`];function st(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function ct(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+=at(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=at(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function lt(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function ut(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 W(){throw Error(`Invariant failed`)}function dt(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||(n=e),t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var G=4,ft=5;function pt(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 mt(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=pt(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 ht(e,t,n,r,i,a,o){o==null||o(n);let s=r;{var c,l,u,d,f,p,m,h,g;let r=(c=n.fullPath)==null?n.from:c,o=r.length,te=(l=(u=n.options)==null?void 0:u.caseSensitive)==null?e:l,ne=!!(!((d=n.options)==null||(d=d.params)==null)&&d.parse&&!((f=n.options)==null||(f=f.skipRouteOnParseError)==null)&&f.params);for(;s<o;){let e=mt(r,s,t),o,c=s,l=e[5];switch(s=l+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(te){var _;let e=(_=i.static)==null?void 0:_.get(t);if(e)o=e;else{var v,y;(v=i).static!=null||(v.static=new Map);let e=q((y=n.fullPath)==null?n.from:y);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{var b;let e=t.toLowerCase(),r=(b=i.staticInsensitive)==null?void 0:b.get(e);if(r)o=r;else{var x,S;(x=i).staticInsensitive!=null||(x.staticInsensitive=new Map);let t=q((S=n.fullPath)==null?n.from:S);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{var C;let t=r.substring(c,e[1]),s=r.substring(e[4],l),u=te&&!!(t||s),d=t?u?t:t.toLowerCase():void 0,f=s?u?s:s.toLowerCase():void 0,p=!ne&&((C=i.dynamic)==null?void 0:C.find(e=>!e.skipOnParamError&&e.caseSensitive===u&&e.prefix===d&&e.suffix===f));if(p)o=p;else{var w,T;let e=_t(1,(w=n.fullPath)==null?n.from:w,u,d,f);o=e,e.depth=a,e.parent=i,(T=i).dynamic!=null||(T.dynamic=[]),i.dynamic.push(e)}break}case 3:{var E;let t=r.substring(c,e[1]),s=r.substring(e[4],l),u=te&&!!(t||s),d=t?u?t:t.toLowerCase():void 0,f=s?u?s:s.toLowerCase():void 0,p=!ne&&((E=i.optional)==null?void 0:E.find(e=>!e.skipOnParamError&&e.caseSensitive===u&&e.prefix===d&&e.suffix===f));if(p)o=p;else{var D,O;let e=_t(3,(D=n.fullPath)==null?n.from:D,u,d,f);o=e,e.parent=i,e.depth=a,(O=i).optional!=null||(O.optional=[]),i.optional.push(e)}break}case 2:{var k,A;let t=r.substring(c,e[1]),s=r.substring(e[4],l),u=te&&!!(t||s),d=t?u?t:t.toLowerCase():void 0,f=s?u?s:s.toLowerCase():void 0,p=_t(2,(k=n.fullPath)==null?n.from:k,u,d,f);o=p,p.parent=i,p.depth=a,(A=i).wildcard!=null||(A.wildcard=[]),i.wildcard.push(p)}}i=o}if(ne&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){var j,M;let e=q((j=n.fullPath)==null?n.from:j);e.kind=ft,e.parent=i,a++,e.depth=a,(M=i).pathless!=null||(M.pathless=[]),i.pathless.push(e),i=e}let re=(n.path||!n.children)&&!n.isRoot;if(re&&r.endsWith(`/`)){var N;let e=q((N=n.fullPath)==null?n.from:N);e.kind=G,e.parent=i,a++,e.depth=a,i.index=e,i=e}if(i.parse=(p=(m=n.options)==null||(m=m.params)==null?void 0:m.parse)==null?null:p,i.skipOnParamError=ne,i.parsingPriority=(h=(g=n.options)==null||(g=g.skipRouteOnParseError)==null?void 0:g.priority)==null?0:h,re&&!i.route){var ee;i.route=n,i.fullPath=(ee=n.fullPath)==null?n.from:ee}}if(n.children)for(let r of n.children)ht(e,t,r,s,i,a,o)}function gt(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;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 K(e){var t,n,r;if(e.pathless)for(let t of e.pathless)K(t);if(e.static)for(let t of e.static.values())K(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())K(t);if((t=e.dynamic)!=null&&t.length){e.dynamic.sort(gt);for(let t of e.dynamic)K(t)}if((n=e.optional)!=null&&n.length){e.optional.sort(gt);for(let t of e.optional)K(t)}if((r=e.wildcard)!=null&&r.length){e.wildcard.sort(gt);for(let t of e.wildcard)K(t)}}function q(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,skipOnParamError:!1,parsingPriority:0}}function _t(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,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:i}}function vt(e,t){let n=q(`/`),r=new Uint16Array(6);for(let t of e)ht(!1,r,t,1,n,0);K(n),t.masksTree=n,t.flatCache=dt(1e3)}function yt(e,t){e||(e=`/`);let n=t.flatCache.get(e);if(n)return n;let r=wt(e,t.masksTree);return t.flatCache.set(e,r),r}function bt(e,t,n,r,i){e||(e=`/`),r||(r=`/`);let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=q(`/`),ht(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),wt(r,o,n)}function xt(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||(e=`/`);let a;try{a=wt(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=Et(a.route)),t.matchCache.set(r,a),a}function St(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function Ct(e,t=!1,n){let r=q(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return ht(t,i,e,1,r,0,e=>{if(n==null||n(e,s),e.id in a&&W(),a[e.id]=e,s!==0&&e.path){let t=St(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),K(r),{processedTree:{segmentTree:r,singleCache:dt(1e3),matchCache:dt(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function wt(e,t,n=!1){let r=e.split(`/`),i=Ot(e,r,t,n);if(!i)return null;let[a]=Tt(e,r,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function Tt(e,t,n){var r,i,a,o,s,c,l,u;let d=Dt(n.node),f=null,p=Object.create(null),m=(r=(i=n.extract)==null?void 0:i.part)==null?0:r,h=(a=(o=n.extract)==null?void 0:o.node)==null?0:a,g=(s=(c=n.extract)==null?void 0:c.path)==null?0:s,_=(l=(u=n.extract)==null?void 0:u.segment)==null?0:l;for(;h<d.length;m++,h++,g++,_++){let r=d[h];if(r.kind===G)break;if(r.kind===ft){_--,m--,g--;continue}let i=t[m],a=g;if(i&&(g+=i.length),r.kind===1){var v,y;f!=null||(f=n.node.fullPath.split(`/`));let e=f[_],t=(v=(y=r.prefix)==null?void 0:y.length)==null?0:v;if(e.charCodeAt(t)===123){var b,x;let n=(b=(x=r.suffix)==null?void 0:x.length)==null?0:b,a=e.substring(t+2,e.length-n-1),o=i.substring(t,i.length-n);p[a]=decodeURIComponent(o)}else{let t=e.substring(1);p[t]=decodeURIComponent(i)}}else if(r.kind===3){var S,C,w,T;if(n.skipped&1<<h){m--,g=a-1;continue}f!=null||(f=n.node.fullPath.split(`/`));let e=f[_],t=(S=(C=r.prefix)==null?void 0:C.length)==null?0:S,o=(w=(T=r.suffix)==null?void 0:T.length)==null?0:w,s=e.substring(t+3,e.length-o-1),c=r.suffix||r.prefix?i.substring(t,i.length-o):i;c&&(p[s]=decodeURIComponent(c))}else if(r.kind===2){var E,D,O,k;let t=r,n=e.substring(a+((E=(D=t.prefix)==null?void 0:D.length)==null?0:E),e.length-((O=(k=t.suffix)==null?void 0:k.length)==null?0:O)),i=decodeURIComponent(n);p[`*`]=i,p._splat=i;break}}return n.rawParams&&Object.assign(p,n.rawParams),[p,{part:m,node:h,path:g,segment:_}]}function Et(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Dt(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Ot(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!Ge(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}],c=null,l=null,u=null;for(;s.length;){let n=s.pop(),{node:i,index:h,skipped:g,depth:_,statics:v,dynamics:y,optionals:b}=n,{extract:x,rawParams:S,parsedParams:C}=n;if(i.skipOnParamError){if(!kt(e,t,n))continue;S=n.rawParams,x=n.extract,C=n.parsedParams}r&&i.route&&i.kind!==G&&At(l,n)&&(l=n);let w=h===o;if(w&&(i.route&&!a&&At(u,n)&&(u=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let T=w?void 0:t[h],E;if(w&&i.index){let n={node:i.index,index:h,skipped:g,depth:_+1,statics:v,dynamics:y,optionals:b,extract:x,rawParams:S,parsedParams:C},r=!0;if(i.index.skipOnParamError&&(kt(e,t,n)||(r=!1)),r){if(v===o&&!y&&!b&&!g)return n;At(u,n)&&(u=n)}}if(i.wildcard&&At(c,n))for(let n of i.wildcard){let{prefix:r,suffix:i}=n;if(r){var d;if(w||!(n.caseSensitive?T:(d=E)==null?E=T.toLowerCase():d).startsWith(r))continue}if(i){if(w)continue;let e=t.slice(h).join(`/`).slice(-i.length);if((n.caseSensitive?e:e.toLowerCase())!==i)continue}let a={node:n,index:o,skipped:g,depth:_,statics:v,dynamics:y,optionals:b,extract:x,rawParams:S,parsedParams:C};if(!(n.skipOnParamError&&!kt(e,t,a))){c=a;break}}if(i.optional){let e=g|1<<_,t=_+1;for(let n=i.optional.length-1;n>=0;n--){let r=i.optional[n];s.push({node:r,index:h,skipped:e,depth:t,statics:v,dynamics:y,optionals:b,extract:x,rawParams:S,parsedParams:C})}if(!w)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){var f;let e=n.caseSensitive?T:(f=E)==null?E=T.toLowerCase():f;if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:n,index:h+1,skipped:g,depth:t,statics:v,dynamics:y,optionals:b+1,extract:x,rawParams:S,parsedParams:C})}}if(!w&&i.dynamic&&T)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){var p;let e=t.caseSensitive?T:(p=E)==null?E=T.toLowerCase():p;if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:h+1,skipped:g,depth:_+1,statics:v,dynamics:y+1,optionals:b,extract:x,rawParams:S,parsedParams:C})}if(!w&&i.staticInsensitive){var m;let e=i.staticInsensitive.get((m=E)==null?E=T.toLowerCase():m);e&&s.push({node:e,index:h+1,skipped:g,depth:_+1,statics:v+1,dynamics:y,optionals:b,extract:x,rawParams:S,parsedParams:C})}if(!w&&i.static){let e=i.static.get(T);e&&s.push({node:e,index:h+1,skipped:g,depth:_+1,statics:v+1,dynamics:y,optionals:b,extract:x,rawParams:S,parsedParams:C})}if(i.pathless){let e=_+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];s.push({node:n,index:h,skipped:g,depth:e,statics:v,dynamics:y,optionals:b,extract:x,rawParams:S,parsedParams:C})}}}if(u&&c)return At(c,u)?u:c;if(u)return u;if(c)return c;if(r&&l){var h;let n=l.index;for(let e=0;e<l.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return(h=l).rawParams!=null||(h.rawParams=Object.create(null)),l.rawParams[`**`]=decodeURIComponent(r),l}return null}function kt(e,t,n){try{let[r,i]=Tt(e,t,n);n.rawParams=r,n.extract=i;let a=n.node.parse(r);return n.parsedParams=Object.assign(Object.create(null),n.parsedParams,a),!0}catch{return null}}function At(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===G)>(e.node.kind===G)||t.node.kind===G==(e.node.kind===G)&&t.depth>e.depth))):!0}function jt(e){return Mt(e.filter(e=>e!==void 0).join(`/`))}function Mt(e){return e.replace(/\/{2,}/g,`/`)}function Nt(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function Pt(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function Ft(e){return Pt(Nt(e))}function It(e,t){return e!=null&&e.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function Lt(e,t,n){return It(e,n)===It(t,n)}function Rt({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else if(i)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&Ge(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.pop():r===`.`||s.push(r)}}s.length>1&&(Ge(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c,l=``;for(let e=0;e<s.length;e++){e>0&&(l+=`/`);let t=s[e];if(!t)continue;c=mt(t,0,c);let n=c[0];if(n===0){l+=t;continue}let r=c[5],i=t.substring(0,c[1]),a=t.substring(c[4],r),o=t.substring(c[2],c[3]);n===1?l+=i||a?`${i}{$${o}}${a}`:`$${o}`:n===2?l+=i||a?`${i}{$}${a}`:`$`:l+=`${i}{-$${o}}${a}`}l=Mt(l);let u=l||`/`;return o&&r&&r.set(o,u),u}function zt(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=>{var n;return(n=t.get(e))==null?e:n})}function Bt(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>Ht(e,n)).join(`/`):Ht(r,n):r}function Vt({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=mt(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let f=c[0];if(f===0){l+=`/`+e.substring(r,o);continue}if(f===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=Bt(`_splat`,t,n);l+=`/`+u+f+d;continue}if(f===1){var u;let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let d=e.substring(r,c[1]),f=e.substring(c[4],o),p=(u=Bt(s,t,n))==null?`undefined`:u;l+=`/`+d+p+f;continue}if(f===3){var d;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]),f=e.substring(c[4],o),p=(d=Bt(i,t,n))==null?``:d;l+=`/`+u+p+f;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function Ht(e,t){var n;let r=encodeURIComponent(e);return(n=t==null?void 0:t(r))==null?r:n}function J(e){return!!(e!=null&&e.isNotFound)}function Ut(){try{return typeof window<`u`&&typeof window.sessionStorage==`object`?window.sessionStorage:void 0}catch{return}}var Wt=`tsr-scroll-restoration-v1_3`;function Gt(){let e=Ut();if(!e)return null;let t={};try{let n=JSON.parse(e.getItem(`tsr-scroll-restoration-v1_3`)||`{}`);Qe(n)&&(t=n)}catch{}return{get state(){return t},set:e=>{t=V(e,t)||t},persist:()=>{try{e.setItem(Wt,JSON.stringify(t))}catch{}}}}var Kt=Gt(),qt=e=>e.state.__TSR_key||e.href;function Jt(e){let t=[],n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(` > `)}`.toLowerCase()}var Yt=!1,Xt=`window`,Zt=`data-scroll-restoration-id`;function Qt(e,t){var n;if(!Kt)return;let r=Kt;if((n=t==null?e.options.scrollRestoration:t)!=null&&n&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!r)return;e.isScrollRestorationSetup=!0,Yt=!1;let i=e.options.getScrollRestorationKey||qt,a=new Map;window.history.scrollRestoration=`manual`;let o=t=>{if(!(Yt||!e.isScrollRestoring))if(t.target===document||t.target===window)a.set(Xt,{scrollX:window.scrollX||0,scrollY:window.scrollY||0});else{let e=t.target;a.set(e,{scrollX:e.scrollLeft||0,scrollY:e.scrollTop||0})}},s=t=>{var n;if(!e.isScrollRestoring||!t||a.size===0||!r)return;let i=(n=r.state)[t]||(n[t]={});for(let[e,t]of a){let n;if(e===Xt)n=Xt;else if(e.isConnected){let t=e.getAttribute(Zt);n=t?`[${Zt}="${t}"]`:Jt(e)}n&&(i[n]=t)}};document.addEventListener(`scroll`,o,!0),e.subscribe(`onBeforeLoad`,e=>{s(e.fromLocation?i(e.fromLocation):void 0),a.clear()}),window.addEventListener(`pagehide`,()=>{var t;s(i((t=e.stores.resolvedLocation.state)==null?e.stores.location.state:t)),r.persist()}),e.subscribe(`onRendered`,t=>{let n=i(t.toLocation),o=e.options.scrollRestorationBehavior,s=e.options.scrollToTopSelectors;if(a.clear(),!e.resetNextScroll){e.resetNextScroll=!0;return}if(!(typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))){Yt=!0;try{let t=e.isScrollRestoring?r.state[n]:void 0,i=!1;if(t)for(let e in t){let n=t[e];if(!Qe(n))continue;let{scrollX:r,scrollY:a}=n;if(!(!Number.isFinite(r)||!Number.isFinite(a))){if(e===Xt)window.scrollTo({top:a,left:r,behavior:o}),i=!0;else if(e){let t;try{t=document.querySelector(e)}catch{continue}t&&(t.scrollLeft=r,t.scrollTop=a,i=!0)}}}if(!i){let t=e.history.location.hash.slice(1);if(t){var c,l;let e=(c=(l=window.history.state)==null?void 0:l.__hashScrollIntoViewOptions)==null?!0:c;if(e){let n=document.getElementById(t);n&&n.scrollIntoView(e)}}else{let e={top:0,left:0,behavior:o};if(window.scrollTo(e),s)for(let t of s){if(t===Xt)continue;let n=typeof t==`function`?t():document.querySelector(t);n&&n.scrollTo(e)}}}}finally{Yt=!1}e.isScrollRestoring&&r.set(e=>(e[n]||(e[n]={}),e))}})}function $t(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function en(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function tn(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=en(r):Array.isArray(t)?t.push(en(r)):n[e]=[t,en(r)]}return n}var nn=an(JSON.parse),rn=on(JSON.stringify,JSON.parse);function an(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=tn(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function on(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=$t(e,r);return t?`?${t}`:``}}var sn=`__root__`;function cn(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Y(e){return e instanceof Response&&!!e.options}function ln(e){return{input:({url:t})=>{for(let n of e)t=dn(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=fn(e[n],t);return t}}}function un(e){let t=Ft(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:t})=>{let r=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return r===i?t.pathname=`/`:r.startsWith(a)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=jt([`/`,t,e.pathname]),e)}}function dn(e,t){var n;let r=e==null||(n=e.input)==null?void 0:n.call(e,{url:t});if(r){if(typeof r==`string`)return new URL(r);if(r instanceof URL)return r}return t}function fn(e,t){var n;let r=e==null||(n=e.output)==null?void 0:n.call(e,{url:t});if(r){if(typeof r==`string`)return new URL(r);if(r instanceof URL)return r}return t}function pn(e){let t=e;return{get state(){return t},setState(e){t=e(t)}}}function mn(e){return{get state(){return e()}}}function hn(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i,init:a}=t,o=new Map,s=new Map,c=new Map,l=n(e.status),u=n(e.loadedAt),d=n(e.isLoading),f=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),h=n(e.statusCode),g=n(e.redirect),_=n([]),v=n([]),y=n([]),b=r(()=>gn(o,_.state)),x=r(()=>gn(s,v.state)),S=r(()=>gn(c,y.state)),C=r(()=>_.state[0]),w=r(()=>_.state.some(e=>{var t;return((t=o.get(e))==null?void 0:t.state.status)===`pending`})),T=r(()=>{var e;return{locationHref:p.state.href,resolvedLocationHref:(e=m.state)==null?void 0:e.href,status:l.state}}),E=r(()=>({status:l.state,loadedAt:u.state,isLoading:d.state,isTransitioning:f.state,matches:b.state,location:p.state,resolvedLocation:m.state,statusCode:h.state,redirect:g.state})),D=dt(64);function O(e){let t=D.get(e);return t||(t=r(()=>{let t=_.state;for(let n of t){let t=o.get(n);if(t&&t.routeId===e)return t.state}}),D.set(e,t)),t}let k={status:l,loadedAt:u,isLoading:d,isTransitioning:f,location:p,resolvedLocation:m,statusCode:h,redirect:g,matchesId:_,pendingMatchesId:v,cachedMatchesId:y,activeMatchesSnapshot:b,pendingMatchesSnapshot:x,cachedMatchesSnapshot:S,firstMatchId:C,hasPendingMatches:w,matchRouteReactivity:T,activeMatchStoresById:o,pendingMatchStoresById:s,cachedMatchStoresById:c,__store:E,getMatchStoreByRouteId:O,setActiveMatches:A,setPendingMatches:j,setCachedMatches:M};A(e.matches),a==null||a(k);function A(e){_n(e,o,_,n,i)}function j(e){_n(e,s,v,n,i)}function M(e){_n(e,c,y,n,i)}return k}function gn(e,t){let n=[];for(let r of t){let t=e.get(r);t&&n.push(t.state)}return n}function _n(e,t,n,r,i){let a=e.map(e=>e.id),o=new Set(a);i(()=>{for(let e of t.keys())o.has(e)||t.delete(e);for(let n of e){let e=t.get(n.id);if(!e){let e=r(n);e.routeId=n.routeId,t.set(n.id,e);continue}e.routeId=n.routeId,e.state!==n&&e.setState(()=>n)}ut(n.state,a)||n.setState(()=>a)})}var vn=e=>{if(!e.rendered){var t;return e.rendered=!0,(t=e.onReady)==null?void 0:t.call(e)}},yn=e=>e.stores.matchesId.state.some(t=>{var n;return(n=e.stores.activeMatchStoresById.get(t))==null?void 0:n.state._forcePending}),bn=(e,t)=>!!(e.preload&&!e.router.stores.activeMatchStoresById.has(t)),xn=(e,t,n=!0)=>{var r;let i={...(r=e.router.options.context)==null?{}:r},a=n?t:t-1;for(let t=0;t<=a;t++){let n=e.matches[t];if(!n)continue;let r=e.router.getMatch(n.id);r&&Object.assign(i,r.__routeContext,r.__beforeLoadContext)}return i},Sn=(e,t)=>{var n;if(!e.matches.length)return;let r=t.routeId,i=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),a=i>=0?i:0,o=r?e.matches.findIndex(e=>e.routeId===r):(n=e.firstBadMatchIndex)==null?e.matches.length-1:n;o<0&&(o=a);for(let t=o;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return r?o:a},X=(e,t,n)=>{if(!(!Y(n)&&!J(n))){if(Y(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){var r,i,a;(r=t._nonReactive.beforeLoadPromise)==null||r.resolve(),(i=t._nonReactive.loaderPromise)==null||i.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:Y(n)?`redirected`:r.status===`pending`?`success`:r.status,context:xn(e,t.index),isFetching:!1,error:n})),J(n)&&!n.routeId&&(n.routeId=t.routeId),(a=t._nonReactive.loadPromise)==null||a.resolve()}throw Y(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n}},Cn=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},wn=(e,t,n)=>{let r=xn(e,n);e.updateMatch(t,e=>({...e,context:r}))},Tn=(e,t,n,r)=>{let{id:i,routeId:a}=e.matches[t],o=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex!=null||(e.firstBadMatchIndex=t),X(e,e.router.getMatch(i),n);try{var s,c;(s=(c=o.options).onError)==null||s.call(c,n)}catch(t){n=t,X(e,e.router.getMatch(i),n)}e.updateMatch(i,e=>{var t,r;return(t=e._nonReactive.beforeLoadPromise)==null||t.resolve(),e._nonReactive.beforeLoadPromise=void 0,(r=e._nonReactive.loadPromise)==null||r.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}}),!e.preload&&!Y(n)&&!J(n)&&(e.serialError!=null||(e.serialError=n))},En=(e,t,n,r)=>{var i,a,o;if(r._nonReactive.pendingTimeout!==void 0)return;let s=(i=n.options.pendingMs)==null?e.router.options.defaultPendingMs:i;if(e.onReady&&!bn(e,t)&&(n.options.loader||n.options.beforeLoad||Ln(n))&&typeof s==`number`&&s!==1/0&&((a=n.options.pendingComponent)==null?(o=e.router.options)!=null&&o.defaultPendingComponent:a)){let t=setTimeout(()=>{vn(e)},s);r._nonReactive.pendingTimeout=t}},Dn=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;En(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&X(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},On=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=tt(()=>{a==null||a.resolve(),a=void 0});let{paramsError:o,searchError:s}=i;o&&Tn(e,n,o,`PARSE_PARAMS`),s&&Tn(e,n,s,`VALIDATE_SEARCH`),En(e,t,r,i);let c=new AbortController,l=!1,u=()=>{l||(l=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c})))},d=()=>{var n;(n=i._nonReactive.beforeLoadPromise)==null||n.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),d()});return}i._nonReactive.beforeLoadPromise=tt();let f={...xn(e,n,!1),...i.__routeContext},{search:p,params:m,cause:h}=i,g=bn(e,t),_={search:p,abortController:c,params:m,preload:g,context:f,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:g?`preload`:h,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},v=r=>{if(r===void 0){e.router.batch(()=>{u(),d()});return}(Y(r)||J(r))&&(u(),Tn(e,n,r,`BEFORE_LOAD`)),e.router.batch(()=>{u(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),d()})},y;try{if(y=r.options.beforeLoad(_),rt(y))return u(),y.catch(t=>{Tn(e,n,t,`BEFORE_LOAD`)}).then(v)}catch(t){u(),Tn(e,n,t,`BEFORE_LOAD`)}v(y)},kn=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>On(e,n,t,i),s=()=>{if(Cn(e,n))return;let t=Dn(e,n,i);return rt(t)?t.then(o):o()};return a()},An=(e,t,n)=>{var r,i,a,o,s,c;let l=e.router.getMatch(t);if(!l||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let u={ssr:e.router.options.ssr,matches:e.matches,match:l,params:l.params,loaderData:l.loaderData};return Promise.all([(r=(i=n.options).head)==null?void 0:r.call(i,u),(a=(o=n.options).scripts)==null?void 0:a.call(o,u),(s=(c=n.options).headers)==null?void 0:s.call(c,u)]).then(([e,t,n])=>({meta:e==null?void 0:e.meta,links:e==null?void 0:e.links,headScripts:e==null?void 0:e.scripts,headers:n,scripts:t,styles:e==null?void 0:e.styles}))},jn=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=xn(e,r),d=bn(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},Mn=async(e,t,n,r,i)=>{try{let u=e.router.getMatch(n);try{In(i);let a=i.options.loader,o=typeof a==`function`?a:a==null?void 0:a.handler,s=o==null?void 0:o(jn(e,t,n,r,i)),c=!!o&&rt(s);if((c||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||u._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),o){let t=c?await s:s;X(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let l=u._nonReactive.minPendingPromise;l&&await l,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:xn(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){var a,o;let d=t;if((d==null?void 0:d.name)===`AbortError`){if(u.abortController.signal.aborted){var s;(s=u._nonReactive.loaderPromise)==null||s.resolve(),u._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:xn(e,r)}));return}let f=u._nonReactive.minPendingPromise;f&&await f,J(t)&&await((a=i.options.notFoundComponent)==null||(o=a.preload)==null?void 0:o.call(a)),X(e,e.router.getMatch(n),t);try{var c,l;(c=(l=i.options).onError)==null||c.call(l,t)}catch(t){d=t,X(e,e.router.getMatch(n),t)}!Y(d)&&!J(d)&&await In(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:d,context:xn(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),X(e,r,t)}},Nn=async(e,t,n)=>{var r;async function i(r,i,o,l,u){var f,p,m,h;let g=Date.now()-i.updatedAt,_=r?(f=(p=u.options.preloadStaleTime)==null?e.router.options.defaultPreloadStaleTime:p)==null?3e4:f:(m=(h=u.options.staleTime)==null?e.router.options.defaultStaleTime:h)==null?0:m,v=u.options.shouldReload,y=typeof v==`function`?v(jn(e,t,a,n,u)):v,{status:b,invalid:x}=l,S=g>=_&&(!!e.forceStaleReload||l.cause===`enter`||o!==void 0&&o!==l.id);s=b===`success`&&(x||(y==null?S:y)),r&&u.options.preload===!1||(s&&!e.sync&&d?(c=!0,(async()=>{try{var r,i;await Mn(e,t,a,n,u);let o=e.router.getMatch(a);(r=o._nonReactive.loaderPromise)==null||r.resolve(),(i=o._nonReactive.loadPromise)==null||i.resolve(),o._nonReactive.loaderPromise=void 0,o._nonReactive.loadPromise=void 0}catch(t){Y(t)&&await e.router.navigate(t.options)}})()):b!==`success`||s?await Mn(e,t,a,n,u):wn(e,a,n))}let{id:a,routeId:o}=e.matches[n],s=!1,c=!1,l=e.router.looseRoutesById[o],u=l.options.loader,d=((r=typeof u==`function`||u==null?void 0:u.staleReloadMode)==null?e.router.options.defaultStaleReloadMode:r)!==`blocking`;if(Cn(e,a)){if(!e.router.getMatch(a))return e.matches[n];wn(e,a,n)}else{var f,p;let t=e.router.getMatch(a),r=e.router.stores.matchesId.state[n],s=((f=r&&e.router.stores.activeMatchStoresById.get(r)||null)==null?void 0:f.routeId)===o?r:(p=e.router.stores.activeMatchesSnapshot.state.find(e=>e.routeId===o))==null?void 0:p.id,c=bn(e,a);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&d)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(a),r=n._nonReactive.error||n.error;r&&X(e,n,r),n.status===`pending`&&await i(c,t,s,n,l)}else{let n=c&&!e.router.stores.activeMatchStoresById.has(a),r=e.router.getMatch(a);r._nonReactive.loaderPromise=tt(),n!==r.preload&&e.updateMatch(a,e=>({...e,preload:n})),await i(c,t,s,r,l)}}let m=e.router.getMatch(a);if(!c){var h,g;(h=m._nonReactive.loaderPromise)==null||h.resolve(),(g=m._nonReactive.loadPromise)==null||g.resolve(),m._nonReactive.loadPromise=void 0}clearTimeout(m._nonReactive.pendingTimeout),m._nonReactive.pendingTimeout=void 0,c||(m._nonReactive.loaderPromise=void 0),m._nonReactive.dehydrated=void 0;let _=c?m.isFetching:!1;return _!==m.isFetching||m.invalid!==!1?(e.updateMatch(a,e=>({...e,isFetching:_,invalid:!1})),e.router.getMatch(a)):m};async function Pn(e){var t,n;let r=e,i=[];yn(r.router)&&vn(r);let a;for(let e=0;e<r.matches.length;e++){try{let t=kn(r,e);rt(t)&&await t}catch(e){if(Y(e))throw e;if(J(e))a=e;else if(!r.preload)throw e;break}if(r.serialError||r.firstBadMatchIndex!=null)break}let o=(t=r.firstBadMatchIndex)==null?r.matches.length:t,s=a&&!r.preload?Sn(r,a):void 0,c=a&&r.preload?0:s===void 0?o:Math.min(s+1,o),l,u;for(let e=0;e<c;e++)i.push(Nn(r,i,e));try{await Promise.all(i)}catch{let e=await Promise.allSettled(i);for(let t of e){if(t.status!==`rejected`)continue;let e=t.reason;if(Y(e))throw e;J(e)?l!=null||(l=e):u!=null||(u=e)}if(u!==void 0)throw u}let d=(n=l)==null?a&&!r.preload?a:void 0:n,f=r.firstBadMatchIndex===void 0?r.matches.length-1:r.firstBadMatchIndex;if(!d&&a&&r.preload)return r.matches;if(d){var p;let e=Sn(r,d);e===void 0&&W();let t=r.matches[e],n=r.router.looseRoutesById[t.routeId],i=(p=r.router.options)==null?void 0:p.defaultNotFoundComponent;!n.options.notFoundComponent&&i&&(n.options.notFoundComponent=i),d.routeId=t.routeId;let a=t.routeId===r.router.routeTree.id;r.updateMatch(t.id,e=>({...e,...a?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:d},isFetching:!1})),f=e,await In(n,[`notFoundComponent`])}else if(!r.preload){let e=r.matches[0];if(!e.globalNotFound){var m;(m=r.router.getMatch(e.id))!=null&&m.globalNotFound&&r.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}}if(r.serialError&&r.firstBadMatchIndex!==void 0){let e=r.router.looseRoutesById[r.matches[r.firstBadMatchIndex].routeId];await In(e,[`errorComponent`])}for(let e=0;e<=f;e++){let{id:t,routeId:n}=r.matches[e],i=r.router.looseRoutesById[n];try{let e=An(r,t,i);if(e){let n=await e;r.updateMatch(t,e=>({...e,...n}))}}catch(e){console.error(`Error executing head for route ${n}:`,e)}}let h=vn(r);if(rt(h)&&await h,d)throw d;if(r.serialError&&!r.preload&&!r.onReady)throw r.serialError;return r.matches}function Fn(e,t){let n=t.map(t=>{var n,r;return(n=e.options[t])==null||(r=n.preload)==null?void 0:r.call(n)}).filter(Boolean);if(n.length!==0)return Promise.all(n)}function In(e,t=Rn){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);let n=()=>e._componentsLoaded?void 0:t===Rn?(()=>{if(e._componentsPromise===void 0){let t=Fn(e,Rn);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Fn(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function Ln(e){var t;for(let n of Rn)if((t=e.options[n])!=null&&t.preload)return!0;return!1}var Rn=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`],Z=`__TSR_index`,zn=`popstate`,Bn=`beforeunload`;function Vn(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{var i;(i=e.notifyOnIndexChange)==null||i?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{var a,o,s;if((a=r==null?void 0:r.ignoreBlocker)!=null&&a){n();return}let c=(o=(s=e.getBlockers)==null?void 0:s.call(e))==null?[]:o,l=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&c.length&&l)for(let n of c){let r=Kn(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){var u;(u=e.onBlocked)==null||u.call(e);return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[Z];i=Hn(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[Z];i=Hn(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{var n;e.back((n=t==null?void 0:t.ignoreBlocker)==null?!1:n),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{var n;e.forward((n=t==null?void 0:t.ignoreBlocker)==null?!1:n),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[Z]!==0,createHref:t=>e.createHref(t),block:t=>{var n,r;if(!e.setBlockers)return()=>{};let i=(n=(r=e.getBlockers)==null?void 0:r.call(e))==null?[]:n;return e.setBlockers([...i,t]),()=>{var n,r,i;let a=(n=(r=e.getBlockers)==null?void 0:r.call(e))==null?[]:n;(i=e.setBlockers)==null||i.call(e,a.filter(e=>e!==t))}},flush:()=>{var t;return(t=e.flush)==null?void 0:t.call(e)},destroy:()=>{var t;return(t=e.destroy)==null?void 0:t.call(e)},notify:r}}function Hn(e,t){t||(t={});let n=qn();return{...t,key:n,__TSR_key:n,[Z]:e}}function Un(e){var t,n,r,i,a;let o=(t=e==null?void 0:e.window)==null?typeof document<`u`?window:void 0:t,s=o.history.pushState,c=o.history.replaceState,l=[],u=()=>l,d=e=>l=e,f=(n=e==null?void 0:e.createHref)==null?(e=>e):n,p=(r=e==null?void 0:e.parseLocation)==null?(()=>Kn(`${o.location.pathname}${o.location.search}${o.location.hash}`,o.history.state)):r;if(!((i=o.history.state)!=null&&i.__TSR_key)&&!((a=o.history.state)!=null&&a.key)){let e=qn();o.history.replaceState({[Z]:0,key:e,__TSR_key:e},``)}let m=p(),h,g=!1,_=!1,v=!1,y=!1,b=()=>m,x,S,C=()=>{x&&(O._ignoreSubscribers=!0,(x.isPush?o.history.pushState:o.history.replaceState)(x.state,``,x.href),O._ignoreSubscribers=!1,x=void 0,S=void 0,h=void 0)},w=(e,t,n)=>{let r=f(t);S||(h=m),m=Kn(t,n),x={href:r,state:n,isPush:(x==null?void 0:x.isPush)||e===`push`},S||(S=Promise.resolve().then(()=>C()))},T=e=>{m=p(),O.notify({type:e})},E=async()=>{if(_){_=!1;return}let e=p(),t=e.state[Z]-m.state[Z],n=t===1,r=t===-1,i=!n&&!r||g;g=!1;let a=i?`GO`:r?`BACK`:`FORWARD`,s=i?{type:`GO`,index:t}:{type:r?`BACK`:`FORWARD`};if(v)v=!1;else{let t=u();if(typeof document<`u`&&t.length){for(let n of t)if(await n.blockerFn({currentLocation:m,nextLocation:e,action:a})){_=!0,o.history.go(1),O.notify(s);return}}}m=p(),O.notify(s)},D=e=>{if(y){y=!1;return}let t=!1,n=u();if(typeof document<`u`&&n.length)for(let e of n){var r;let n=(r=e.enableBeforeUnload)==null?!0:r;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},O=Vn({getLocation:b,getLength:()=>o.history.length,pushState:(e,t)=>w(`push`,e,t),replaceState:(e,t)=>w(`replace`,e,t),back:e=>(e&&(v=!0),y=!0,o.history.back()),forward:e=>{e&&(v=!0),y=!0,o.history.forward()},go:e=>{g=!0,o.history.go(e)},createHref:e=>f(e),flush:C,destroy:()=>{o.history.pushState=s,o.history.replaceState=c,o.removeEventListener(Bn,D,{capture:!0}),o.removeEventListener(zn,E)},onBlocked:()=>{h&&m!==h&&(m=h)},getBlockers:u,setBlockers:d,notifyOnIndexChange:!1});return o.addEventListener(Bn,D,{capture:!0}),o.addEventListener(zn,E),o.history.pushState=function(...e){let t=s.apply(o.history,e);return O._ignoreSubscribers||T(`PUSH`),t},o.history.replaceState=function(...e){let t=c.apply(o.history,e);return O._ignoreSubscribers||T(`REPLACE`),t},O}function Wn(e){var t;let n=(t=e==null?void 0:e.window)==null?typeof document<`u`?window:void 0:t;return Un({window:n,parseLocation:()=>{var e;let t=n.location.hash.split(`#`).slice(1),r=(e=t[0])==null?`/`:e,i=n.location.search,a=t.slice(1);return Kn(`${r}${i}${a.length===0?``:`#${a.join(`#`)}`}`,n.history.state)},createHref:e=>`${n.location.pathname}${n.location.search}#${e}`})}function Gn(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function Kn(e,t){let n=Gn(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=qn();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[Z]:0,key:a,__TSR_key:a}}}function qn(){return(Math.random()+1).toString(36).substring(7)}function Jn(e,t){let n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:(n==null?void 0:n.pathname)!==r.pathname,hrefChanged:(n==null?void 0:n.href)!==r.href,hashChanged:(n==null?void 0:n.hash)!==r.hash}}var Yn=class{constructor(e,t){var n,r,i,a,o;this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=e=>e(),this.update=e=>{var t,n,r,i,a,o;let s=this.options,c=(t=(n=this.basepath)==null?s==null?void 0:s.basepath:n)==null?`/`:t,l=this.basepath===void 0,u=s==null?void 0:s.rewrite;if(this.options={...s,...e},this.isServer=(r=this.options.isServer)==null?typeof document>`u`:r,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=zt(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Un()),this.origin=this.options.origin,this.origin||((i=window)!=null&&i.origin&&window.origin!==`null`?this.origin=window.origin:this.origin=`http://localhost`),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=dt(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=hn(Qn(this.latestLocation),e),Qt(this)}let d=!1,f=(a=this.options.basepath)==null?`/`:a,p=this.options.rewrite;if(l||c!==f||u!==p){this.basepath=f;let e=[],t=Ft(f);t&&t!==`/`&&e.push(un({basepath:f})),p&&e.push(p),this.rewrite=e.length===0?void 0:e.length===1?e[0]:ln(e),this.history&&this.updateLatestLocation(),d=!0}d&&this.stores&&this.stores.location.setState(()=>this.latestLocation),typeof window<`u`&&`CSS`in window&&typeof((o=window.CSS)==null?void 0:o.supports)==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a)`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=Ct(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&vt(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:ct(e).path,external:!1,searchStr:o,search:Xe(t==null?void 0:t.search,i),hash:ct(r.slice(1)).path,state:H(t==null?void 0:t.state,a)}}let o=new URL(i,this.origin),s=dn(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:ct(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:Xe(t==null?void 0:t.search,c),hash:ct(s.hash.slice(1)).path,state:H(t==null?void 0:t.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>Rt({base:e,to:Mt(t),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>er({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingMatchesId.state.forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.state.forEach(e=>{var t;if(this.stores.pendingMatchStoresById.has(e))return;let n=(t=this.stores.activeMatchStoresById.get(e))==null?void 0:t.state;n&&(n.status===`pending`||n.isFetching===`loader`)&&this.cancelMatch(e)})},this.buildLocation=e=>{let t=(t={})=>{var n,r,i;let a=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,o=this.matchRoutesLightweight(a);t.from;let s=t.unsafeRelative===`path`?a.pathname:(n=t.from)==null?o.fullPath:n,c=this.resolvePathWithBase(s,`.`),l=o.search,u=Object.assign(Object.create(null),o.params),d=t.to?this.resolvePathWithBase(c,`${t.to}`):this.resolvePathWithBase(c,`.`),f=t.params===!1||t.params===null?Object.create(null):((r=t.params)==null?!0:r)===!0?u:Object.assign(u,V(t.params,u)),p=this.getMatchedRoutes(d),m=p.matchedRoutes;if((!p.foundRoute||p.foundRoute.path!==`/`&&p.routeParams[`**`])&&this.options.notFoundRoute&&(m=[...m,this.options.notFoundRoute]),Object.keys(f).length>0)for(let e of m){var h,g;let t=(h=(g=e.options.params)==null?void 0:g.stringify)==null?e.options.stringifyParams:h;if(t)try{Object.assign(f,t(f))}catch{}}let _=e.leaveParams?d:ct(Vt({path:d,params:f,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,v=l;if(e._includeValidateSearch&&(i=this.options.search)!=null&&i.strict){let e={};m.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,$n(t.options.validateSearch,{...e,...v}))}catch{}}),v=e}v=tr({search:v,dest:t,destRoutes:m,_includeValidateSearch:e._includeValidateSearch}),v=Xe(l,v);let y=this.options.stringifySearch(v),b=t.hash===!0?a.hash:t.hash?V(t.hash,a.hash):void 0,x=b?`#${b}`:``,S=t.state===!0?a.state:t.state?V(t.state,a.state):{};S=H(a.state,S);let C=`${_}${y}${x}`,w,T,E=!1;if(this.rewrite){let e=new URL(C,this.origin),t=fn(this.rewrite,e);w=e.href.replace(e.origin,``),t.origin===this.origin?T=t.pathname+t.search+t.hash:(T=t.href,E=!0)}else w=lt(C),T=w;return{publicHref:T,href:w,pathname:_,search:v,searchStr:y,state:S,hash:b==null?``:b,external:E,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=yt(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=s===!1||s===null?Object.create(null):(s==null?!0:s)===!0?n:Object.assign(n,V(s,n));r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{var r;let i=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=U(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},a=Pt(this.latestLocation.href)===Pt(n.href),o=this.commitLocationPromise;if(this.commitLocationPromise=tt(()=>{o==null||o.resolve(),o=void 0}),a&&i())this.load();else{var s;let{maskedLocation:r,hashScrollIntoView:i,...a}=n;if(r){var c,l;a={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...a,search:a.searchStr,state:{...a.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(c=(l=a.unmaskOnReload)==null?this.options.unmaskOnReload:l)!=null&&c&&(a.state.__tempKey=this.tempLocationKey)}a.state.__hashScrollIntoViewOptions=(s=i==null?this.options.defaultHashScrollIntoView:i)==null?!0:s,this.shouldViewTransition=e,this.history[n.replace?`replace`:`push`](a.publicHref,a.state,{ignoreBlocker:t})}return this.resetNextScroll=(r=n.resetScroll)==null?!0:r,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=Kn(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=dn(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){var o,s;let t=this.buildLocation({to:e,...i});n=(o=n)==null?t.publicHref:o,r=(s=r)==null?t.publicHref:s}let t=!a&&r?r:n;if(st(t,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){var c,l,u;let e=(c=(l=(u=this.history).getBlockers)==null?void 0:l.call(u))==null?[]:c;for(let t of e)if(t!=null&&t.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return Promise.resolve()}return i.replace?window.location.replace(t):window.location.href=t,Promise.resolve()}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation),t=this.stores.cachedMatchesSnapshot.state.filter(t=>!e.some(e=>e.id===t.id));this.batch(()=>{this.stores.status.setState(()=>`pending`),this.stores.statusCode.setState(()=>200),this.stores.isLoading.setState(()=>!0),this.stores.location.setState(()=>this.latestLocation),this.stores.setPendingMatches(e),this.stores.setCachedMatches(t)})},this.load=async e=>{var t;let n,r,i,a=(t=this.stores.resolvedLocation.state)==null?this.stores.location.state:t;for(i=new Promise(t=>{this.startTransition(async()=>{try{this.beforeLoad();let t=this.latestLocation,n=this.stores.resolvedLocation.state,r=Jn(t,n);this.stores.redirect.state||this.emit({type:`onBeforeNavigate`,...r}),this.emit({type:`onBeforeLoad`,...r}),await Pn({router:this,sync:e==null?void 0:e.sync,forceStaleReload:a.href===t.href,matches:this.stores.pendingMatchesSnapshot.state,location:t,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=null,t=null,n=null,r=null;this.batch(()=>{let i=this.stores.pendingMatchesSnapshot.state,a=i.length,o=this.stores.activeMatchesSnapshot.state;e=a?o.filter(e=>!this.stores.pendingMatchStoresById.has(e.id)):null;let s=new Set;for(let e of this.stores.pendingMatchStoresById.values())e.routeId&&s.add(e.routeId);let c=new Set;for(let e of this.stores.activeMatchStoresById.values())e.routeId&&c.add(e.routeId);t=a?o.filter(e=>!s.has(e.routeId)):null,n=a?i.filter(e=>!c.has(e.routeId)):null,r=a?i.filter(e=>c.has(e.routeId)):o,this.stores.isLoading.setState(()=>!1),this.stores.loadedAt.setState(()=>Date.now()),a&&(this.stores.setActiveMatches(i),this.stores.setPendingMatches([]),this.stores.setCachedMatches([...this.stores.cachedMatchesSnapshot.state,...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]),this.clearExpiredCache())});for(let[e,o]of[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]]){var i,a;if(e)for(let t of e)(i=(a=this.looseRoutesById[t.routeId].options)[o])==null||i.call(a,t)}})})}})}catch(e){Y(e)?(n=e,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):J(e)&&(r=e);let t=n?n.status:r?404:this.stores.activeMatchesSnapshot.state.some(e=>e.status===`error`)?500:200;this.batch(()=>{this.stores.statusCode.setState(()=>t),this.stores.redirect.setState(()=>n)})}if(this.latestLoadPromise===i){var o;(o=this.commitLocationPromise)==null||o.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0}t()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let o;this.hasNotFoundMatch()?o=404:this.stores.activeMatchesSnapshot.state.some(e=>e.status===`error`)&&(o=500),o!==void 0&&this.stores.statusCode.setState(()=>o)},this.startViewTransition=e=>{var t;let n=(t=this.shouldViewTransition)==null?this.options.defaultViewTransition:t;if(this.shouldViewTransition=void 0,n&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let t;if(typeof n==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.stores.resolvedLocation.state,a=typeof n.types==`function`?n.types(Jn(r,i)):n.types;if(a===!1){e();return}t={update:e,types:a}}else t=e;document.startViewTransition(t)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.stores.pendingMatchStoresById.get(e);if(n){n.setState(t);return}let r=this.stores.activeMatchStoresById.get(e);if(r){r.setState(t);return}let i=this.stores.cachedMatchStoresById.get(e);if(i){let n=t(i.state);n.status===`redirected`?this.stores.cachedMatchStoresById.delete(e)&&this.stores.cachedMatchesId.setState(t=>t.filter(t=>t!==e)):i.setState(()=>n)}})},this.getMatch=e=>{var t,n,r,i,a;return(t=(n=(r=this.stores.cachedMatchStoresById.get(e))==null?void 0:r.state)==null?(i=this.stores.pendingMatchStoresById.get(e))==null?void 0:i.state:n)==null?(a=this.stores.activeMatchStoresById.get(e))==null?void 0:a.state:t},this.invalidate=e=>{let t=t=>{var n,r;return(n=e==null||(r=e.filter)==null?void 0:r.call(e,t))==null||n?{...t,invalid:!0,...e!=null&&e.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t};return this.batch(()=>{this.stores.setActiveMatches(this.stores.activeMatchesSnapshot.state.map(t)),this.stores.setCachedMatches(this.stores.cachedMatchesSnapshot.state.map(t)),this.stores.setPendingMatches(this.stores.pendingMatchesSnapshot.state.map(t))}),this.shouldViewTransition=!1,this.load({sync:e==null?void 0:e.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){var n;let t=(n=e.options._builtLocation)==null?this.buildLocation(e.options):n,r=this.getParsedLocationHref(t);e.options.href=r,e.headers.set(`Location`,r)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&st(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e==null?void 0:e.filter;t===void 0?this.stores.setCachedMatches([]):this.stores.setCachedMatches(this.stores.cachedMatchesSnapshot.state.filter(e=>!t(e)))},this.clearExpiredCache=()=>{let e=Date.now();this.clearCache({filter:t=>{var n,r,i;let a=this.looseRoutesById[t.routeId];if(!a.options.loader)return!0;let o=(n=t.preload?(r=a.options.preloadGcTime)==null?this.options.defaultPreloadGcTime:r:(i=a.options.gcTime)==null?this.options.defaultGcTime:i)==null?300*1e3:n;return t.status===`error`?!0:e-t.updatedAt>=o}})},this.loadRouteChunk=In,this.preloadRoute=async e=>{var t;let n=(t=e._builtLocation)==null?this.buildLocation(e):t,r=this.matchRoutes(n,{throwOnError:!0,preload:!0,dest:e}),i=new Set([...this.stores.matchesId.state,...this.stores.pendingMatchesId.state]),a=new Set([...i,...this.stores.cachedMatchesId.state]),o=r.filter(e=>!a.has(e.id));if(o.length){let e=this.stores.cachedMatchesSnapshot.state;this.stores.setCachedMatches([...e,...o])}try{return r=await Pn({router:this,matches:r,location:n,preload:!0,updateMatch:(e,t)=>{i.has(e)?r=r.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),r}catch(e){if(Y(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:n});J(e)||console.error(e);return}},this.matchRoute=(e,t)=>{var n,r,i;let a={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},o=this.buildLocation(a);if(t!=null&&t.pending&&this.stores.status.state!==`pending`)return!1;let s=((t==null?void 0:t.pending)===void 0?!this.stores.isLoading.state:t.pending)?this.latestLocation:this.stores.resolvedLocation.state||this.stores.location.state,c=bt(o.pathname,(n=t==null?void 0:t.caseSensitive)==null?!1:n,(r=t==null?void 0:t.fuzzy)==null?!1:r,s.pathname,this.processedTree);return!c||e.params&&!U(c.rawParams,e.params,{partial:!0})?!1:(i=t==null?void 0:t.includeSearch)==null||i?U(s.search,o.search,{partial:!0})?c.rawParams:!1:c.rawParams},this.hasNotFoundMatch=()=>this.stores.activeMatchesSnapshot.state.some(e=>e.status===`notFound`||e.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:(n=e.caseSensitive)==null?!1:n,notFoundMode:(r=e.notFoundMode)==null?`fuzzy`:r,stringifySearch:(i=e.stringifySearch)==null?rn:i,parseSearch:(a=e.parseSearch)==null?nn:a,protocolAllowlist:(o=e.protocolAllowlist)==null?ot:o}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.state}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(e){var t,n,r;return e!=null&&e.id?(n=(r=e.context)==null?this.options.context:r)==null?void 0:n:(t=this.options.context)==null?void 0:t}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i,parsedParams:a}=n,{matchedRoutes:o}=n,s=!1;(r?r.path!==`/`&&i[`**`]:Pt(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:s=!0);let c=s?rr(this.options.notFoundMode,o):void 0,l=Array(o.length),u=new Map;for(let e of this.stores.activeMatchStoresById.values())e.routeId&&u.set(e.routeId,e.state);for(let n=0;n<o.length;n++){var d,f,p,m,h;let r=o[n],s=l[n-1],b,x,S;{var g,_;let n=(g=s==null?void 0:s.search)==null?e.search:g,i=(_=s==null?void 0:s._strictSearch)==null?void 0:_;try{var v;let e=(v=$n(r.options.validateSearch,{...n}))==null?void 0:v;b={...n,...e},x={...i,...e},S=void 0}catch(e){let r=e;if(e instanceof Xn||(r=new Xn(e.message,{cause:e})),t!=null&&t.throwOnError)throw r;b=n,x={},S=r}}let C=(d=(f=(p=r.options).loaderDeps)==null?void 0:f.call(p,{search:b}))==null?``:d,w=C?JSON.stringify(C):``,{interpolatedPath:T,usedParams:E}=Vt({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),D=r.id+T+w,O=this.getMatch(D),k=u.get(r.id),A=(m=O==null?void 0:O._strictParams)==null?E:m,j;if(!O)try{ir(r,E,a,A)}catch(e){if(j=J(e)||Y(e)?e:new Zn(e.message,{cause:e}),t!=null&&t.throwOnError)throw j}Object.assign(i,A);let M=k?`stay`:`enter`,N;if(O)N={...O,cause:M,params:(h=k==null?void 0:k.params)==null?i:h,_strictParams:A,search:Xe(k?k.search:O.search,b),_strictSearch:x};else{var y;let e=r.options.loader||r.options.beforeLoad||r.lazyFn||Ln(r)?`pending`:`success`;N={id:D,ssr:r.options.ssr,index:n,routeId:r.id,params:(y=k==null?void 0:k.params)==null?i:y,_strictParams:A,pathname:T,updatedAt:Date.now(),search:k?Xe(k.search,b):b,_strictSearch:x,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:j,__routeContext:void 0,_nonReactive:{loadPromise:tt()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:M,loaderDeps:k?H(k.loaderDeps,C):C,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:r.options.staticData||{},fullPath:r.fullPath}}t!=null&&t.preload||(N.globalNotFound=c===r.id),N.searchError=S;let ee=this.getParentContext(s);N.context={...ee,...N.__routeContext,...N.__beforeLoadContext},l[n]=N}for(let t=0;t<l.length;t++){let n=l[t],r=this.looseRoutesById[n.routeId],a=this.getMatch(n.id),o=u.get(n.routeId);if(n.params=o?Xe(o.params,i):i,!a){let i=l[t-1],a=this.getParentContext(i);if(r.options.context){var b;let t={deps:n.loaderDeps,params:n.params,context:a==null?{}:a,location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:l,routeId:r.id};n.__routeContext=(b=r.options.context(t))==null?void 0:b}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return l}matchRoutesLightweight(e){var t;let{matchedRoutes:n,routeParams:r,parsedParams:i}=this.getMatchedRoutes(e.pathname),a=Ge(n),o={...e.search};for(let e of n)try{Object.assign(o,$n(e.options.validateSearch,o))}catch{}let s=Ge(this.stores.matchesId.state),c=s&&((t=this.stores.activeMatchStoresById.get(s))==null?void 0:t.state),l=c&&c.routeId===a.id&&c.pathname===e.pathname,u;if(l)u=c.params;else{let e=Object.assign(Object.create(null),r);for(let t of n)try{ir(t,r,i==null?{}:i,e)}catch{}u=e}return{matchedRoutes:n,fullPath:a.fullPath,search:o,params:u}}},Xn=class extends Error{},Zn=class extends Error{};function Qn(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function $n(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Xn(`Async validation not supported`);if(n.issues)throw new Xn(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function er({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=Pt(e),a,o,s=xt(i,n,!0);return s&&(a=s.route,Object.assign(r,s.rawParams),o=Object.assign(Object.create(null),s.parsedParams)),{matchedRoutes:(s==null?void 0:s.branch)||[t.__root__],routeParams:r,foundRoute:a,parsedParams:o}}function tr({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return nr(n)(e,t,r==null?!1:r)}function nr(e){let t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(let r of e){if(`search`in r.options){var n;(n=r.options.search)!=null&&n.middlewares&&t.middlewares.push(...r.options.search.middlewares)}else (r.options.preSearchFilters||r.options.postSearchFilters)&&t.middlewares.push(({search:e,next:t})=>{let n=e;`preSearchFilters`in r.options&&r.options.preSearchFilters&&(n=r.options.preSearchFilters.reduce((e,t)=>t(e),e));let i=t(n);return`postSearchFilters`in r.options&&r.options.postSearchFilters?r.options.postSearchFilters.reduce((e,t)=>t(e),i):i});r.options.validateSearch&&t.middlewares.push(({search:e,next:n})=>{let i=n(e);if(!t._includeValidateSearch)return i;try{var a;return{...i,...(a=$n(r.options.validateSearch,i))==null?void 0:a}}catch{return i}})}t.middlewares.push(({search:e})=>{let n=t.dest;return n.search?n.search===!0?e:V(n.search,e):{}});let r=(e,t,n)=>{if(e>=n.length)return t;let i=n[e];return i({search:t,next:t=>r(e+1,t,n)})};return function(e,n,i){return t.dest=n,t._includeValidateSearch=i,r(0,e,t.middlewares)}}function rr(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return sn}function ir(e,t,n,r){var i,a;let o=(i=(a=e.options.params)==null?void 0:a.parse)==null?e.options.parseParams:i;if(o)if(e.options.skipRouteOnParseError)for(let e in t)e in n&&(r[e]=n[e]);else{let e=o(r);Object.assign(r,e)}}function ar(e){var t;let n=(t=e.errorComponent)==null?sr:t;return(0,B.jsx)(or,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:t,reset:r})=>t?z.createElement(n,{error:t,reset:r}):e.children})}var or=class extends z.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function sr({error:e}){let[t,n]=z.useState(!1);return(0,B.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,B.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,B.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,B.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,B.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,B.jsx)(`div`,{children:(0,B.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,B.jsx)(`code`,{children:e.message}):null})}):null]})}function cr({children:e,fallback:t=null}){return lr()?(0,B.jsx)(z.Fragment,{children:e}):(0,B.jsx)(z.Fragment,{children:t})}function lr(){return z.useSyncExternalStore(ur,()=>!0,()=>!1)}function ur(){return()=>{}}var dr=z.createContext(void 0),fr=z.createContext(void 0),pr=e((e=>{var t=r();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:n,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),mr=e(((e,t)=>{t.exports=pr()})),hr=e((e=>{var t=r(),n=mr();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=n.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),gr=e(((e,t)=>{t.exports=hr()}))();function _r(e,t){return e===t}function Q(e,t,n=_r){let r=(0,z.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,z.useCallback)(()=>e==null?void 0:e.get(),[e]);return(0,gr.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var vr={state:void 0,get:()=>void 0,subscribe:()=>()=>{}};function yr(e){var t;let n=u(),r=z.useContext(e.from?fr:dr),i=(t=e.from)==null?r:t,a=i?e.from?n.stores.getMatchStoreByRouteId(i):n.stores.activeMatchStoresById.get(i):void 0,o=z.useRef(void 0);return Q(a==null?vr:a,t=>{var r,i;if(((r=e.shouldThrow)==null||r)&&!t&&W(),t===void 0)return;let a=e.select?e.select(t):t;if((i=e.structuralSharing)==null?n.options.defaultStructuralSharing:i){let e=H(o.current,a);return o.current=e,e}return a})}function br(e){return yr({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function xr(e){let t=u(),n=`not-found-${Q(t.stores.location,e=>e.pathname)}-${Q(t.stores.status,e=>e)}`;return(0,B.jsx)(ar,{getResetKey:()=>n,onCatch:(t,n)=>{var r;if(J(t))(r=e.onCatch)==null||r.call(e,t,n);else throw t},errorComponent:({error:t})=>{var n;if(J(t))return(n=e.fallback)==null?void 0:n.call(e,t);throw t},children:e.children})}function Sr(){return(0,B.jsx)(`p`,{children:`Not Found`})}function Cr(e){return(0,B.jsx)(B.Fragment,{children:e.children})}function wr(e,t,n){return t.options.notFoundComponent?(0,B.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,B.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,B.jsx)(Sr,{})}var Tr=z.memo(function({matchId:e}){let t=u(),n=t.stores.activeMatchStoresById.get(e);n||W();let r=Q(t.stores.loadedAt,e=>e),i=Q(n,e=>e);return(0,B.jsx)(Er,{router:t,matchId:e,resetKey:r,matchState:z.useMemo(()=>{var e;let n=i.routeId,r=(e=t.routesById[n].parentRoute)==null?void 0:e.id;return{routeId:n,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:r}},[i._displayPending,i.routeId,i.ssr,t.routesById])})});function Er({router:e,matchId:t,resetKey:n,matchState:r}){var i,a,o,s,c,l,u,d,f;let p=e.routesById[r.routeId],m=(i=p.options.pendingComponent)==null?e.options.defaultPendingComponent:i,h=m?(0,B.jsx)(m,{}):null,g=(a=p.options.errorComponent)==null?e.options.defaultErrorComponent:a,_=(o=p.options.onCatch)==null?e.options.defaultOnCatch:o,v=p.isRoot?(s=p.options.notFoundComponent)==null?(c=e.options.notFoundRoute)==null?void 0:c.options.component:s:p.options.notFoundComponent,y=r.ssr===!1||r.ssr===`data-only`,b=(!p.isRoot||p.options.wrapInSuspense||y)&&((l=(u=p.options.wrapInSuspense)==null?m:u)==null?(d=p.options.errorComponent)!=null&&d.preload||y:l)?z.Suspense:Cr,x=g?ar:Cr,S=v?xr:Cr;return(0,B.jsxs)(p.isRoot?(f=p.options.shellComponent)==null?Cr:f:Cr,{children:[(0,B.jsx)(dr.Provider,{value:t,children:(0,B.jsx)(b,{fallback:h,children:(0,B.jsx)(x,{getResetKey:()=>n,errorComponent:g||sr,onCatch:(e,t)=>{if(J(e))throw e.routeId!=null||(e.routeId=r.routeId),e;_==null||_(e,t)},children:(0,B.jsx)(S,{fallback:e=>{if(e.routeId!=null||(e.routeId=r.routeId),!v||e.routeId&&e.routeId!==r.routeId||!e.routeId&&!p.isRoot)throw e;return z.createElement(v,e)},children:y||r._displayPending?(0,B.jsx)(cr,{fallback:h,children:(0,B.jsx)(Or,{matchId:t})}):(0,B.jsx)(Or,{matchId:t})})})})}),r.parentRouteId===`__root__`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Dr,{resetKey:n}),(e.options.scrollRestoration,null)]}):null]})}function Dr({resetKey:e}){let t=u(),n=z.useRef(void 0);return l(()=>{let e=t.latestLocation.href;(n.current===void 0||n.current!==e)&&(t.emit({type:`onRendered`,...Jn(t.stores.location.state,t.stores.resolvedLocation.state)}),n.current=e)},[t.latestLocation.state.__TSR_key,e,t]),null}var Or=z.memo(function({matchId:e}){let t=u(),n=(e,n)=>{var r,i;return(r=(i=t.getMatch(e.id))==null?void 0:i._nonReactive[n])==null?e._nonReactive[n]:r},r=t.stores.activeMatchStoresById.get(e);r||W();let i=Q(r,e=>e),a=i.routeId,o=t.routesById[a],s=z.useMemo(()=>{var e,n;let r=(e=(n=t.routesById[a].options.remountDeps)==null?t.options.defaultRemountDeps:n)==null?void 0:e({routeId:a,loaderDeps:i.loaderDeps,params:i._strictParams,search:i._strictSearch});return r?JSON.stringify(r):void 0},[a,i.loaderDeps,i._strictParams,i._strictSearch,t.options.defaultRemountDeps,t.routesById]),c=z.useMemo(()=>{var e;let n=(e=o.options.component)==null?t.options.defaultComponent:e;return n?(0,B.jsx)(n,{},s):(0,B.jsx)(kr,{})},[s,o.options.component,t.options.defaultComponent]);if(i._displayPending)throw n(i,`displayPendingPromise`);if(i._forcePending)throw n(i,`minPendingPromise`);if(i.status===`pending`){var l;let e=(l=o.options.pendingMinMs)==null?t.options.defaultPendingMinMs:l;if(e){let n=t.getMatch(i.id);if(n&&!n._nonReactive.minPendingPromise){let t=tt();n._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),n._nonReactive.minPendingPromise=void 0},e)}}throw n(i,`loadPromise`)}if(i.status===`notFound`)return J(i.error)||W(),wr(t,o,i.error);if(i.status===`redirected`)throw Y(i.error)||W(),n(i,`loadPromise`);if(i.status===`error`)throw i.error;return c}),kr=z.memo(function(){let e=u(),t=z.useContext(dr),n,r=!1,i;{let a=t?e.stores.activeMatchStoresById.get(t):void 0;[n,r]=Q(a,e=>{var t;return[e==null?void 0:e.routeId,(t=e==null?void 0:e.globalNotFound)==null?!1:t]}),i=Q(e.stores.matchesId,e=>e[e.findIndex(e=>e===t)+1])}let a=n?e.routesById[n]:void 0,o=e.options.defaultPendingComponent?(0,B.jsx)(e.options.defaultPendingComponent,{}):null;if(r)return a||W(),wr(e,a,void 0);if(!i)return null;let s=(0,B.jsx)(Tr,{matchId:i});return n===`__root__`?(0,B.jsx)(z.Suspense,{fallback:o,children:s}):s}),$=null;function Ar(){return $||(typeof window>`u`?($=`unknown`,$):window.__JEAN2_ELECTRON__?($=`electron`,$):`__TAURI_INTERNALS__`in window||`__TAURI__`in window?($=`tauri-mobile`,$):($=`web`,$))}function jr(){return Ar()===`electron`}function Mr(){return Ar()===`tauri-mobile`}function Nr(){return typeof navigator>`u`?!1:/Win/i.test(navigator.platform||navigator.userAgent)}export{D as $,st as A,be as B,jt as C,W as D,Pt as E,Le as F,j as G,me as H,ze as I,k as J,A as K,Ae as L,H as M,We as N,U as O,Ue as P,oe as Q,Ee as R,Lt as S,Nt as T,pe as U,_e as V,C as W,S as X,O as Y,M as Z,Wn as _,Tr as a,y as at,cn as b,br as c,dr as d,E as et,lr as f,Jn as g,Yn as h,Nr as i,T as it,nt as j,V as k,yr as l,sr as m,jr as n,de as nt,kr as o,h as ot,ar as p,w as q,Mr as r,le as rt,Cr as s,d as st,Ar as t,te as tt,Q as u,pn as v,It as w,sn as x,mn as y,we as z};
@@ -1 +1 @@
1
- import{n as e,t}from"./compiler-runtime-DZXZ41-q.js";import{B as n,F as r,G as i,J as a,K as o,N as s,V as c,W as l,X as u,Y as d,Z as f,et as p,l as m,ot as h,rt as g,st as _}from"./platform-BOMKRNFM.js";import{i as v,n as y,t as b}from"./classPrivateFieldGet2-BGlEuFdn.js";import{t as x}from"./mutation-CAoDu7x3.js";var S,C,w,T=(S=new WeakMap,C=new WeakMap,w=new WeakMap,class extends _{constructor(e={}){super(),v(this,S,void 0),v(this,C,void 0),v(this,w,void 0),this.config=e,y(S,this,new Set),y(C,this,new Map),y(w,this,0)}build(e,t,n){var r;let i=new x({client:e,mutationCache:this,mutationId:y(w,this,(r=b(w,this),++r)),options:e.defaultMutationOptions(t),state:n});return this.add(i),i}add(e){b(S,this).add(e);let t=E(e);if(typeof t==`string`){let n=b(C,this).get(t);n?n.push(e):b(C,this).set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(b(S,this).delete(e)){let t=E(e);if(typeof t==`string`){let n=b(C,this).get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&b(C,this).delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=E(e);if(typeof t==`string`){let n=b(C,this).get(t),r=n==null?void 0:n.find(e=>e.state.status===`pending`);return!r||r===e}else return!0}runNext(e){let t=E(e);if(typeof t==`string`){var n,r;let i=(n=b(C,this).get(t))==null?void 0:n.find(t=>t!==e&&t.state.isPaused);return(r=i==null?void 0:i.continue())==null?Promise.resolve():r}else return Promise.resolve()}clear(){c.batch(()=>{b(S,this).forEach(e=>{this.notify({type:`removed`,mutation:e})}),b(S,this).clear(),b(C,this).clear()})}getAll(){return Array.from(b(S,this))}find(e){let t={exact:!0,...e};return this.getAll().find(e=>a(t,e))}findAll(e={}){return this.getAll().filter(t=>a(e,t))}notify(e){c.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return c.batch(()=>Promise.all(e.map(e=>e.continue().catch(u))))}});function E(e){var t;return(t=e.options.scope)==null?void 0:t.id}var D,O=(D=new WeakMap,class extends _{constructor(e={}){super(),v(this,D,void 0),this.config=e,y(D,this,new Map)}build(e,t,n){var i;let a=t.queryKey,s=(i=t.queryHash)==null?o(a,t):i,c=this.get(s);return c||(c=new r({client:e,queryKey:a,queryHash:s,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(a)}),this.add(c)),c}add(e){b(D,this).has(e.queryHash)||(b(D,this).set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=b(D,this).get(e.queryHash);t&&(e.destroy(),t===e&&b(D,this).delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){c.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return b(D,this).get(e)}getAll(){return[...b(D,this).values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>d(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>d(e,t)):t}notify(e){c.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){c.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){c.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}}),k,A,j,M,N,P,F,I,L=(k=new WeakMap,A=new WeakMap,j=new WeakMap,M=new WeakMap,N=new WeakMap,P=new WeakMap,F=new WeakMap,I=new WeakMap,class{constructor(e={}){v(this,k,void 0),v(this,A,void 0),v(this,j,void 0),v(this,M,void 0),v(this,N,void 0),v(this,P,void 0),v(this,F,void 0),v(this,I,void 0),y(k,this,e.queryCache||new O),y(A,this,e.mutationCache||new T),y(j,this,e.defaultOptions||{}),y(M,this,new Map),y(N,this,new Map),y(P,this,0)}mount(){var e;y(P,this,(e=b(P,this),e++,e)),b(P,this)===1&&(y(F,this,h.subscribe(async e=>{e&&(await this.resumePausedMutations(),b(k,this).onFocus())})),y(I,this,n.subscribe(async e=>{e&&(await this.resumePausedMutations(),b(k,this).onOnline())})))}unmount(){var e,t,n;y(P,this,(e=b(P,this),e--,e)),b(P,this)===0&&((t=b(F,this))==null||t.call(this),y(F,this,void 0),(n=b(I,this))==null||n.call(this),y(I,this,void 0))}isFetching(e){return b(k,this).findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return b(A,this).findAll({...e,status:`pending`}).length}getQueryData(e){var t;let n=this.defaultQueryOptions({queryKey:e});return(t=b(k,this).get(n.queryHash))==null?void 0:t.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=b(k,this).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 b(k,this).findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=b(k,this).get(r.queryHash),a=l(t,i==null?void 0:i.state.data);if(a!==void 0)return b(k,this).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return c.batch(()=>b(k,this).findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){var t;let n=this.defaultQueryOptions({queryKey:e});return(t=b(k,this).get(n.queryHash))==null?void 0:t.state}removeQueries(e){let t=b(k,this);c.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=b(k,this);return c.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=c.batch(()=>b(k,this).findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(u).catch(u)}invalidateQueries(e,t={}){return c.batch(()=>{var n,r;return b(k,this).findAll(e).forEach(e=>{e.invalidate()}),(e==null?void 0:e.refetchType)===`none`?Promise.resolve():this.refetchQueries({...e,type:(n=(r=e==null?void 0:e.refetchType)==null?e==null?void 0:e.type:r)==null?`active`:n},t)})}refetchQueries(e,t={}){var n;let r={...t,cancelRefetch:(n=t.cancelRefetch)==null?!0:n},i=c.batch(()=>b(k,this).findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(u)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(i).then(u)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=b(k,this).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(u).catch(u)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(u).catch(u)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return n.isOnline()?b(A,this).resumePausedMutations():Promise.resolve()}getQueryCache(){return b(k,this)}getMutationCache(){return b(A,this)}getDefaultOptions(){return b(j,this)}setDefaultOptions(e){y(j,this,e)}setQueryDefaults(e,t){b(M,this).set(i(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...b(M,this).values()],n={};return t.forEach(t=>{f(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){b(N,this).set(i(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...b(N,this).values()],n={};return t.forEach(t=>{f(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...b(j,this).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=o(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===g&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...b(j,this).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){b(k,this).clear(),b(A,this).clear()}}),R=t(),z=e(),B=new L({defaultOptions:{queries:{staleTime:3e4,gcTime:5*6e4,retry:2,refetchOnWindowFocus:!1}}});function V(e){let t=(0,R.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,z.jsx)(s,{client:B,children:n}),t[0]=n,t[1]=r),r}function H(e){return m({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}var U=`modulepreload`,W=function(e,t){return new URL(e,t).href},G={},K=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute(`nonce`));function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=W(t,n),t in G)return;G[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:U,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};export{B as i,H as n,V as r,K as t};
1
+ import{n as e,t}from"./compiler-runtime-DZXZ41-q.js";import{B as n,F as r,G as i,J as a,K as o,N as s,V as c,W as l,X as u,Y as d,Z as f,et as p,l as m,ot as h,rt as g,st as _}from"./platform-cRBZ7eSy.js";import{i as v,n as y,t as b}from"./classPrivateFieldGet2-BGlEuFdn.js";import{t as x}from"./mutation-D4xtepYQ.js";var S,C,w,T=(S=new WeakMap,C=new WeakMap,w=new WeakMap,class extends _{constructor(e={}){super(),v(this,S,void 0),v(this,C,void 0),v(this,w,void 0),this.config=e,y(S,this,new Set),y(C,this,new Map),y(w,this,0)}build(e,t,n){var r;let i=new x({client:e,mutationCache:this,mutationId:y(w,this,(r=b(w,this),++r)),options:e.defaultMutationOptions(t),state:n});return this.add(i),i}add(e){b(S,this).add(e);let t=E(e);if(typeof t==`string`){let n=b(C,this).get(t);n?n.push(e):b(C,this).set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(b(S,this).delete(e)){let t=E(e);if(typeof t==`string`){let n=b(C,this).get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&b(C,this).delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=E(e);if(typeof t==`string`){let n=b(C,this).get(t),r=n==null?void 0:n.find(e=>e.state.status===`pending`);return!r||r===e}else return!0}runNext(e){let t=E(e);if(typeof t==`string`){var n,r;let i=(n=b(C,this).get(t))==null?void 0:n.find(t=>t!==e&&t.state.isPaused);return(r=i==null?void 0:i.continue())==null?Promise.resolve():r}else return Promise.resolve()}clear(){c.batch(()=>{b(S,this).forEach(e=>{this.notify({type:`removed`,mutation:e})}),b(S,this).clear(),b(C,this).clear()})}getAll(){return Array.from(b(S,this))}find(e){let t={exact:!0,...e};return this.getAll().find(e=>a(t,e))}findAll(e={}){return this.getAll().filter(t=>a(e,t))}notify(e){c.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return c.batch(()=>Promise.all(e.map(e=>e.continue().catch(u))))}});function E(e){var t;return(t=e.options.scope)==null?void 0:t.id}var D,O=(D=new WeakMap,class extends _{constructor(e={}){super(),v(this,D,void 0),this.config=e,y(D,this,new Map)}build(e,t,n){var i;let a=t.queryKey,s=(i=t.queryHash)==null?o(a,t):i,c=this.get(s);return c||(c=new r({client:e,queryKey:a,queryHash:s,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(a)}),this.add(c)),c}add(e){b(D,this).has(e.queryHash)||(b(D,this).set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=b(D,this).get(e.queryHash);t&&(e.destroy(),t===e&&b(D,this).delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){c.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return b(D,this).get(e)}getAll(){return[...b(D,this).values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>d(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>d(e,t)):t}notify(e){c.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){c.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){c.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}}),k,A,j,M,N,P,F,I,L=(k=new WeakMap,A=new WeakMap,j=new WeakMap,M=new WeakMap,N=new WeakMap,P=new WeakMap,F=new WeakMap,I=new WeakMap,class{constructor(e={}){v(this,k,void 0),v(this,A,void 0),v(this,j,void 0),v(this,M,void 0),v(this,N,void 0),v(this,P,void 0),v(this,F,void 0),v(this,I,void 0),y(k,this,e.queryCache||new O),y(A,this,e.mutationCache||new T),y(j,this,e.defaultOptions||{}),y(M,this,new Map),y(N,this,new Map),y(P,this,0)}mount(){var e;y(P,this,(e=b(P,this),e++,e)),b(P,this)===1&&(y(F,this,h.subscribe(async e=>{e&&(await this.resumePausedMutations(),b(k,this).onFocus())})),y(I,this,n.subscribe(async e=>{e&&(await this.resumePausedMutations(),b(k,this).onOnline())})))}unmount(){var e,t,n;y(P,this,(e=b(P,this),e--,e)),b(P,this)===0&&((t=b(F,this))==null||t.call(this),y(F,this,void 0),(n=b(I,this))==null||n.call(this),y(I,this,void 0))}isFetching(e){return b(k,this).findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return b(A,this).findAll({...e,status:`pending`}).length}getQueryData(e){var t;let n=this.defaultQueryOptions({queryKey:e});return(t=b(k,this).get(n.queryHash))==null?void 0:t.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=b(k,this).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 b(k,this).findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=b(k,this).get(r.queryHash),a=l(t,i==null?void 0:i.state.data);if(a!==void 0)return b(k,this).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return c.batch(()=>b(k,this).findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){var t;let n=this.defaultQueryOptions({queryKey:e});return(t=b(k,this).get(n.queryHash))==null?void 0:t.state}removeQueries(e){let t=b(k,this);c.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=b(k,this);return c.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=c.batch(()=>b(k,this).findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(u).catch(u)}invalidateQueries(e,t={}){return c.batch(()=>{var n,r;return b(k,this).findAll(e).forEach(e=>{e.invalidate()}),(e==null?void 0:e.refetchType)===`none`?Promise.resolve():this.refetchQueries({...e,type:(n=(r=e==null?void 0:e.refetchType)==null?e==null?void 0:e.type:r)==null?`active`:n},t)})}refetchQueries(e,t={}){var n;let r={...t,cancelRefetch:(n=t.cancelRefetch)==null?!0:n},i=c.batch(()=>b(k,this).findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(u)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(i).then(u)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=b(k,this).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(u).catch(u)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(u).catch(u)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return n.isOnline()?b(A,this).resumePausedMutations():Promise.resolve()}getQueryCache(){return b(k,this)}getMutationCache(){return b(A,this)}getDefaultOptions(){return b(j,this)}setDefaultOptions(e){y(j,this,e)}setQueryDefaults(e,t){b(M,this).set(i(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...b(M,this).values()],n={};return t.forEach(t=>{f(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){b(N,this).set(i(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...b(N,this).values()],n={};return t.forEach(t=>{f(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...b(j,this).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=o(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===g&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...b(j,this).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){b(k,this).clear(),b(A,this).clear()}}),R=t(),z=e(),B=new L({defaultOptions:{queries:{staleTime:3e4,gcTime:5*6e4,retry:2,refetchOnWindowFocus:!1}}});function V(e){let t=(0,R.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,z.jsx)(s,{client:B,children:n}),t[0]=n,t[1]=r),r}function H(e){return m({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}var U=`modulepreload`,W=function(e,t){return new URL(e,t).href},G={},K=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute(`nonce`));function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=W(t,n),t in G)return;G[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:U,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};export{B as i,H as n,V as r,K as t};
@@ -1 +1 @@
1
- import{n as e,o as t,r as n,t as r}from"./compiler-runtime-DZXZ41-q.js";import{G as i,L as a,P as o,V as s,X as c,nt as l,st as u,tt as d}from"./platform-BOMKRNFM.js";import{i as f,n as p,r as m,t as h}from"./classPrivateFieldGet2-BGlEuFdn.js";import{A as g,S as _}from"./sidebar-C-dZ1XFl.js";import{n as v}from"./mutation-CAoDu7x3.js";import{O as y,V as b}from"./badge-Cjebg6Sp.js";import{t as x}from"./createLucideIcon-CuVT3KNW.js";import{C as S,S as C,T as w,b as T,j as E,r as D,v as O,w as k}from"./button--1wnt03c.js";var A,j,M,N,P,ee=(A=new WeakMap,j=new WeakMap,M=new WeakMap,N=new WeakMap,P=new WeakSet,class extends u{constructor(e,t){super(),a(this,P),f(this,A,void 0),f(this,j,void 0),f(this,M,void 0),f(this,N,void 0),p(A,this,e),this.setOptions(t),this.bindMethods(),m(P,this,F).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var t;let n=this.options;this.options=h(A,this).defaultMutationOptions(e),d(this.options,n)||h(A,this).getMutationCache().notify({type:`observerOptionsUpdated`,mutation:h(M,this),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&i(n.mutationKey)!==i(this.options.mutationKey)?this.reset():((t=h(M,this))==null?void 0:t.state.status)===`pending`&&h(M,this).setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners()){var e;(e=h(M,this))==null||e.removeObserver(this)}}onMutationUpdate(e){m(P,this,F).call(this),m(P,this,te).call(this,e)}getCurrentResult(){return h(j,this)}reset(){var e;(e=h(M,this))==null||e.removeObserver(this),p(M,this,void 0),m(P,this,F).call(this),m(P,this,te).call(this)}mutate(e,t){var n;return p(N,this,t),(n=h(M,this))==null||n.removeObserver(this),p(M,this,h(A,this).getMutationCache().build(h(A,this),this.options)),h(M,this).addObserver(this),h(M,this).execute(e)}});function F(){var e,t;let n=(e=(t=h(M,this))==null?void 0:t.state)==null?v():e;p(j,this,{...n,isPending:n.status===`pending`,isSuccess:n.status===`success`,isError:n.status===`error`,isIdle:n.status===`idle`,mutate:this.mutate,reset:this.reset})}function te(e){s.batch(()=>{if(h(N,this)&&this.hasListeners()){let l=h(j,this).variables,u=h(j,this).context,d={client:h(A,this),meta:this.options.meta,mutationKey:this.options.mutationKey};if((e==null?void 0:e.type)===`success`){try{var t,n;(t=(n=h(N,this)).onSuccess)==null||t.call(n,e.data,l,u,d)}catch(e){Promise.reject(e)}try{var r,i;(r=(i=h(N,this)).onSettled)==null||r.call(i,e.data,null,l,u,d)}catch(e){Promise.reject(e)}}else if((e==null?void 0:e.type)===`error`){try{var a,o;(a=(o=h(N,this)).onError)==null||a.call(o,e.error,l,u,d)}catch(e){Promise.reject(e)}try{var s,c;(s=(c=h(N,this)).onSettled)==null||s.call(c,void 0,e.error,l,u,d)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(h(j,this))})})}var I=t(n(),1);function L(e,t){let n=o(t),[r]=I.useState(()=>new ee(n,e));I.useEffect(()=>{r.setOptions(e)},[r,e]);let i=I.useSyncExternalStore(I.useCallback(e=>r.subscribe(s.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=I.useCallback((e,t)=>{r.mutate(e,t).catch(c)},[r]);if(i.error&&l(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var ne=x(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]);function re(e,[t,n]){return Math.min(n,Math.max(t,e))}var R=e();function ie(e,t){return I.useReducer((e,n)=>{let r=t[e][n];return r==null?e:r},e)}var z=`ScrollArea`,[ae,oe]=k(z),[se,B]=ae(z),ce=I.forwardRef((e,t)=>{let{__scopeScrollArea:n,type:r=`hover`,dir:i,scrollHideDelay:a=600,...o}=e,[s,c]=I.useState(null),[l,u]=I.useState(null),[d,f]=I.useState(null),[p,m]=I.useState(null),[h,g]=I.useState(null),[_,v]=I.useState(0),[y,x]=I.useState(0),[S,C]=I.useState(!1),[T,D]=I.useState(!1),O=E(t,e=>c(e)),k=b(i);return(0,R.jsx)(se,{scope:n,type:r,dir:k,scrollHideDelay:a,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:S,onScrollbarXEnabledChange:C,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:T,onScrollbarYEnabledChange:D,onCornerWidthChange:v,onCornerHeightChange:x,children:(0,R.jsx)(w.div,{dir:k,...o,ref:O,style:{position:`relative`,"--radix-scroll-area-corner-width":_+`px`,"--radix-scroll-area-corner-height":y+`px`,...e.style}})})});ce.displayName=z;var le=`ScrollAreaViewport`,ue=I.forwardRef((e,t)=>{let{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=B(le,n),s=E(t,I.useRef(null),o.onViewportChange);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`},nonce:i}),(0,R.jsx)(w.div,{"data-radix-scroll-area-viewport":``,...a,ref:s,style:{overflowX:o.scrollbarXEnabled?`scroll`:`hidden`,overflowY:o.scrollbarYEnabled?`scroll`:`hidden`,...e.style},children:(0,R.jsx)(`div`,{ref:o.onContentChange,style:{minWidth:`100%`,display:`table`},children:r})})]})});ue.displayName=le;var V=`ScrollAreaScrollbar`,de=I.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=B(V,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return I.useEffect(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,R.jsx)(fe,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,R.jsx)(pe,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,R.jsx)(me,{...r,ref:t,forceMount:n}):i.type===`always`?(0,R.jsx)(H,{...r,ref:t}):null});de.displayName=V;var fe=I.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=B(V,e.__scopeScrollArea),[a,o]=I.useState(!1);return I.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=()=>{window.clearTimeout(t),o(!0)},r=()=>{t=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,r),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,r)}}},[i.scrollArea,i.scrollHideDelay]),(0,R.jsx)(T,{present:n||a,children:(0,R.jsx)(me,{"data-state":a?`visible`:`hidden`,...r,ref:t})})}),pe=I.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=B(V,e.__scopeScrollArea),a=e.orientation===`horizontal`,o=J(()=>c(`SCROLL_END`),100),[s,c]=ie(`hidden`,{hidden:{SCROLL:`scrolling`},scrolling:{SCROLL_END:`idle`,POINTER_ENTER:`interacting`},interacting:{SCROLL:`interacting`,POINTER_LEAVE:`idle`},idle:{HIDE:`hidden`,SCROLL:`scrolling`,POINTER_ENTER:`interacting`}});return I.useEffect(()=>{if(s===`idle`){let e=window.setTimeout(()=>c(`HIDE`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),I.useEffect(()=>{let e=i.viewport,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=()=>{let r=e[t];n!==r&&(c(`SCROLL`),o()),n=r};return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[i.viewport,a,c,o]),(0,R.jsx)(T,{present:n||s!==`hidden`,children:(0,R.jsx)(H,{"data-state":s===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:S(e.onPointerEnter,()=>c(`POINTER_ENTER`)),onPointerLeave:S(e.onPointerLeave,()=>c(`POINTER_LEAVE`))})})}),me=I.forwardRef((e,t)=>{let n=B(V,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=I.useState(!1),s=e.orientation===`horizontal`,c=J(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return Y(n.viewport,c),Y(n.content,c),(0,R.jsx)(T,{present:r||a,children:(0,R.jsx)(H,{"data-state":a?`visible`:`hidden`,...i,ref:t})})}),H=I.forwardRef((e,t)=>{let{orientation:n=`vertical`,...r}=e,i=B(V,e.__scopeScrollArea),a=I.useRef(null),o=I.useRef(0),[s,c]=I.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=Ce(s.viewport,s.content),u={...r,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:e=>a.current=e,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:e=>o.current=e};function d(e,t){return we(e,o.current,s,t)}return n===`horizontal`?(0,R.jsx)(he,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=Te(e,s,i.dir);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,i.dir))}}):n===`vertical`?(0,R.jsx)(ge,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=Te(e,s);a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}}):null}),he=I.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=B(V,e.__scopeScrollArea),[o,s]=I.useState(),c=I.useRef(null),l=E(t,c,a.onScrollbarXChange);return I.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,R.jsx)(ye,{"data-orientation":`horizontal`,...i,ref:l,sizes:n,style:{bottom:0,left:a.dir===`rtl`?`var(--radix-scroll-area-corner-width)`:0,right:a.dir===`ltr`?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":q(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),De(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:K(o.paddingLeft),paddingEnd:K(o.paddingRight)}})}})}),ge=I.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=B(V,e.__scopeScrollArea),[o,s]=I.useState(),c=I.useRef(null),l=E(t,c,a.onScrollbarYChange);return I.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,R.jsx)(ye,{"data-orientation":`vertical`,...i,ref:l,sizes:n,style:{top:0,right:a.dir===`ltr`?0:void 0,left:a.dir===`rtl`?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":q(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),De(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:K(o.paddingTop),paddingEnd:K(o.paddingBottom)}})}})}),[_e,ve]=ae(V),ye=I.forwardRef((e,t)=>{let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:d,...f}=e,p=B(V,n),[m,h]=I.useState(null),g=E(t,e=>h(e)),_=I.useRef(null),v=I.useRef(``),y=p.viewport,b=r.content-r.viewport,x=O(u),C=O(c),T=J(d,10);function D(e){_.current&&l({x:e.clientX-_.current.left,y:e.clientY-_.current.top})}return I.useEffect(()=>{let e=e=>{let t=e.target;m!=null&&m.contains(t)&&x(e,b)};return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[y,m,b,x]),I.useEffect(C,[r,C]),Y(m,T),Y(p.content,T),(0,R.jsx)(_e,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:O(a),onThumbPointerUp:O(o),onThumbPositionChange:C,onThumbPointerDown:O(s),children:(0,R.jsx)(w.div,{...f,ref:g,style:{position:`absolute`,...f.style},onPointerDown:S(e.onPointerDown,e=>{e.button===0&&(e.target.setPointerCapture(e.pointerId),_.current=m.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,p.viewport&&(p.viewport.style.scrollBehavior=`auto`),D(e))}),onPointerMove:S(e.onPointerMove,D),onPointerUp:S(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=v.current,p.viewport&&(p.viewport.style.scrollBehavior=``),_.current=null})})})}),U=`ScrollAreaThumb`,W=I.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=ve(U,e.__scopeScrollArea);return(0,R.jsx)(T,{present:n||i.hasThumb,children:(0,R.jsx)(be,{ref:t,...r})})}),be=I.forwardRef((e,t)=>{let{__scopeScrollArea:n,style:r,...i}=e,a=B(U,n),o=ve(U,n),{onThumbPositionChange:s}=o,c=E(t,e=>o.onThumbChange(e)),l=I.useRef(void 0),u=J(()=>{l.current&&(l.current(),l.current=void 0)},100);return I.useEffect(()=>{let e=a.viewport;if(e){let t=()=>{u(),l.current||(l.current=Oe(e,s),s())};return s(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[a.viewport,u,s]),(0,R.jsx)(w.div,{"data-state":o.hasThumb?`visible`:`hidden`,...i,ref:c,style:{width:`var(--radix-scroll-area-thumb-width)`,height:`var(--radix-scroll-area-thumb-height)`,...r},onPointerDownCapture:S(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;o.onThumbPointerDown({x:n,y:r})}),onPointerUp:S(e.onPointerUp,o.onThumbPointerUp)})});W.displayName=U;var G=`ScrollAreaCorner`,xe=I.forwardRef((e,t)=>{let n=B(G,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,R.jsx)(Se,{...e,ref:t}):null});xe.displayName=G;var Se=I.forwardRef((e,t)=>{let{__scopeScrollArea:n,...r}=e,i=B(G,n),[a,o]=I.useState(0),[s,c]=I.useState(0),l=!!(a&&s);return Y(i.scrollbarX,()=>{var e;let t=((e=i.scrollbarX)==null?void 0:e.offsetHeight)||0;i.onCornerHeightChange(t),c(t)}),Y(i.scrollbarY,()=>{var e;let t=((e=i.scrollbarY)==null?void 0:e.offsetWidth)||0;i.onCornerWidthChange(t),o(t)}),l?(0,R.jsx)(w.div,{...r,ref:t,style:{width:a,height:s,position:`absolute`,right:i.dir===`ltr`?0:void 0,left:i.dir===`rtl`?0:void 0,bottom:0,...e.style}}):null});function K(e){return e?parseInt(e,10):0}function Ce(e,t){let n=e/t;return isNaN(n)?0:n}function q(e){let t=Ce(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function we(e,t,n,r=`ltr`){let i=q(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return Ee([c,l],d)(e)}function Te(e,t,n=`ltr`){let r=q(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=re(e,n===`ltr`?[0,o]:[o*-1,0]);return Ee([0,o],[0,s])(c)}function Ee(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function De(e,t){return e>0&&e<t}var Oe=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)};function J(e,t){let n=O(e),r=I.useRef(0);return I.useEffect(()=>()=>window.clearTimeout(r.current),[]),I.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Y(e,t){let n=O(t);C(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var ke=ce,Ae=ue,je=xe,X=r(),Me=I.forwardRef((e,t)=>{let n=(0,X.c)(16),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:i,children:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===i?o=n[5]:(o=D(`relative overflow-hidden`,i),n[4]=i,n[5]=o);let s;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(s={WebkitOverflowScrolling:`touch`},n[6]=s):s=n[6];let c;n[7]!==r||n[8]!==t?(c=(0,R.jsx)(Ae,{ref:t,"data-slot":`scroll-area-viewport`,className:`size-full min-w-0 rounded-[inherit] outline-none`,style:s,children:r}),n[7]=r,n[8]=t,n[9]=c):c=n[9];let l,u;n[10]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,R.jsx)(Ne,{}),u=(0,R.jsx)(je,{}),n[10]=l,n[11]=u):(l=n[10],u=n[11]);let d;return n[12]!==a||n[13]!==o||n[14]!==c?(d=(0,R.jsxs)(ke,{"data-slot":`scroll-area`,className:o,...a,children:[c,l,u]}),n[12]=a,n[13]=o,n[14]=c,n[15]=d):d=n[15],d});Me.displayName=`ScrollArea`;function Ne(e){let t=(0,X.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,orientation:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`vertical`:i,o;t[4]===n?o=t[5]:(o=D(`flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent`,n),t[4]=n,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,R.jsx)(W,{"data-slot":`scroll-area-thumb`,className:`relative flex-1 rounded-full bg-border`}),t[6]=s):s=t[6];let c;return t[7]!==a||t[8]!==r||t[9]!==o?(c=(0,R.jsx)(de,{"data-slot":`scroll-area-scrollbar`,"data-orientation":a,orientation:a,className:o,...r,children:s}),t[7]=a,t[8]=r,t[9]=o,t[10]=c):c=t[10],c}function Pe(e){let t=(0,X.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.tools.list(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:_.tools.all,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],g(i)}function Fe(e){let t=(0,X.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.tools.listEnvVars(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:_.tools.envVars,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],g(i)}function Ie(e){let t=(0,X.c)(7),n=o(),r;t[0]===e?r=t[1]:(r=t=>{let{key:n,value:r}=t;return e.http.tools.setEnvVar(n,{value:r})},t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:_.tools.envVars})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],L(a)}function Le(e){let t=(0,X.c)(7),n=o(),r;t[0]===e?r=t[1]:(r=t=>e.http.tools.clearEnvVar(t),t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:_.tools.envVars})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],L(a)}function Re(e){let t=(0,X.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.config.models.get(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:_.config.models,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],g(i)}async function Z(e,t){let n=await e.http.config.models.get(),r=n.providers.flatMap(e=>e.models).filter(e=>{var t;return(t=e.runtimeStatus)==null?void 0:t.usable});y.getState().updateModels(r,n.defaultModel,n.defaultProvider),t.setQueryData(_.config.models,n)}function ze(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>e.http.config.models.createProvider(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Z(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function Be(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>{let{providerId:n,body:r}=t;return e.http.config.models.updateProvider(n,r)},t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Z(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function Ve(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>e.http.config.models.deleteProvider(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Z(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function He(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>{let{providerId:n,body:r}=t;return e.http.config.models.createModel(n,r)},t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Z(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function Ue(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>{let{providerId:n,modelId:r,body:i}=t;return e.http.config.models.updateModel(n,r,i)},t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Z(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function We(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>{let{providerId:n,modelId:r}=t;return e.http.config.models.deleteModel(n,r)},t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Z(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function Ge(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>e.http.config.models.setDefaults(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Z(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function Ke(e){let t=(0,X.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.preconfigs.list(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:_.config.preconfigs,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],g(i)}async function Q(e,t){let n=await e.http.preconfigs.list();y.getState().updatePreconfigs(n.preconfigs),t.setQueryData(_.config.preconfigs,n)}function qe(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>e.http.preconfigs.create(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Q(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function Je(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>{let{id:n,body:r}=t;return e.http.preconfigs.update(n,r)},t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Q(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function Ye(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>e.http.preconfigs.delete(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Q(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function Xe(e){let t=(0,X.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.config.prompts.list(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:_.config.prompts,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],g(i)}async function $(e,t){let n=await e.http.config.prompts.list();y.getState().updatePrompts(n.prompts),t.setQueryData(_.config.prompts,n)}function Ze(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>e.http.config.prompts.create(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&$(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function Qe(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>{let{name:n,body:r}=t;return e.http.config.prompts.update(n,r)},t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&$(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function $e(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>e.http.config.prompts.delete(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&$(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function et(e){let t=(0,X.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.providers.list(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:_.config.providers.all,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],g(i)}function tt(e){let t=(0,X.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.providers.listCredentials(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:_.config.providers.credentials,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],g(i)}function nt(e){let t=(0,X.c)(7),n=o(),r;t[0]===e?r=t[1]:(r=t=>e.http.providers.connect(t),t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:_.config.providers.all})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],L(a)}function rt(e){let t=(0,X.c)(7),n=o(),r;t[0]===e?r=t[1]:(r=t=>e.http.providers.disconnect(t),t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:_.config.providers.all})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],L(a)}function it(e){let t=(0,X.c)(7),n=o(),r;t[0]===e?r=t[1]:(r=t=>{let{provider:n,body:r}=t;return e.http.providers.setCredential(n,r)},t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:_.config.providers.credentials})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],L(a)}function at(e){let t=(0,X.c)(7),n=o(),r;t[0]===e?r=t[1]:(r=t=>e.http.providers.clearCredential(t),t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:_.config.providers.credentials})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],L(a)}function ot(e,t){let n=(0,X.c)(9),r;n[0]===t?r=n[1]:(r=_.mcp.status(t==null?``:t),n[0]=t,n[1]=r);let i;n[2]!==e||n[3]!==t?(i=()=>e.http.mcp.getStatus(t),n[2]=e,n[3]=t,n[4]=i):i=n[4];let a=!!e&&!!t,o;return n[5]!==r||n[6]!==i||n[7]!==a?(o={queryKey:r,queryFn:i,enabled:a},n[5]=r,n[6]=i,n[7]=a,n[8]=o):o=n[8],g(o)}function st(e){let t=(0,X.c)(7),n=o(),r;t[0]===e?r=t[1]:(r=t=>{let{workspaceId:n,name:r}=t;return e.http.mcp.connect(n,r)},t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=(e,t)=>{let{workspaceId:r}=t;n.invalidateQueries({queryKey:_.mcp.status(r)})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],L(a)}function ct(e){let t=(0,X.c)(7),n=o(),r;t[0]===e?r=t[1]:(r=t=>{let{workspaceId:n,name:r}=t;return e.http.mcp.disconnect(n,r)},t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=(e,t)=>{let{workspaceId:r}=t;n.invalidateQueries({queryKey:_.mcp.status(r)})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],L(a)}function lt(e){let t=(0,X.c)(2),n;return t[0]===e?n=t[1]:(n={mutationFn:t=>{let{workspaceId:n,name:r}=t;return e.http.mcp.startAuth(n,r)}},t[0]=e,t[1]=n),L(n)}function ut(e,t,n,r,i){let a=(0,X.c)(13),o;a[0]!==r||a[1]!==n||a[2]!==t?(o=_.files.browse(t==null?``:t,n,r),a[0]=r,a[1]=n,a[2]=t,a[3]=o):o=a[3];let s;a[4]!==r||a[5]!==n||a[6]!==e||a[7]!==t?(s=()=>e.http.files.browse(t,n,r),a[4]=r,a[5]=n,a[6]=e,a[7]=t,a[8]=s):s=a[8];let c=!!e&&!!t&&(i==null?!0:i),l;return a[9]!==o||a[10]!==s||a[11]!==c?(l={queryKey:o,queryFn:s,enabled:c},a[9]=o,a[10]=s,a[11]=c,a[12]=l):l=a[12],g(l)}function dt(e,t,n){let r=(0,X.c)(9),i=n===void 0?!0:n,a;r[0]===t?a=r[1]:(a=_.files.browseFs(t),r[0]=t,r[1]=a);let o;r[2]!==t||r[3]!==e?(o=()=>e.http.files.browseFs(t),r[2]=t,r[3]=e,r[4]=o):o=r[4];let s=!!e&&i,c;return r[5]!==a||r[6]!==o||r[7]!==s?(c={queryKey:a,queryFn:o,enabled:s},r[5]=a,r[6]=o,r[7]=s,r[8]=c):c=r[8],g(c)}function ft(e){let t=(0,X.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.files.drives(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:_.files.drives,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],g(i)}function pt(e,t,n){let r=(0,X.c)(9),i=n===void 0?!0:n,a;r[0]===t?a=r[1]:(a=_.files.parent(t),r[0]=t,r[1]=a);let o;r[2]!==t||r[3]!==e?(o=()=>e.http.files.parent(t),r[2]=t,r[3]=e,r[4]=o):o=r[4];let s=!!e&&i,c;return r[5]!==a||r[6]!==o||r[7]!==s?(c={queryKey:a,queryFn:o,enabled:s},r[5]=a,r[6]=o,r[7]=s,r[8]=c):c=r[8],g(c)}function mt(e,t,n,r){let i=(0,X.c)(11),a=r===void 0?!0:r,o;i[0]!==n||i[1]!==t?(o=_.files.preview(t==null?``:t,n==null?``:n),i[0]=n,i[1]=t,i[2]=o):o=i[2];let s;i[3]!==n||i[4]!==e||i[5]!==t?(s=()=>e.http.files.preview(t,n),i[3]=n,i[4]=e,i[5]=t,i[6]=s):s=i[6];let c=!!e&&!!t&&!!n&&a,l;return i[7]!==o||i[8]!==s||i[9]!==c?(l={queryKey:o,queryFn:s,enabled:c},i[7]=o,i[8]=s,i[9]=c,i[10]=l):l=i[10],g(l)}export{Ue as A,Je as C,Ve as D,We as E,Pe as F,Me as I,ne as L,Le as M,Fe as N,Re as O,Ie as P,Ke as S,ze as T,$e as _,mt as a,qe as b,lt as c,nt as d,rt as f,Ze as g,it as h,pt as i,Be as j,Ge as k,ot as l,et as m,ut as n,st as o,tt as p,ft as r,ct as s,dt as t,at as u,Xe as v,He as w,Ye as x,Qe as y};
1
+ import{n as e,o as t,r as n,t as r}from"./compiler-runtime-DZXZ41-q.js";import{G as i,L as a,P as o,V as s,X as c,nt as l,st as u,tt as d}from"./platform-cRBZ7eSy.js";import{i as f,n as p,r as m,t as h}from"./classPrivateFieldGet2-BGlEuFdn.js";import{A as g,S as _}from"./sidebar-BqQ-fUFc.js";import{n as v}from"./mutation-D4xtepYQ.js";import{O as y,V as b}from"./badge-Cjebg6Sp.js";import{t as x}from"./createLucideIcon-CuVT3KNW.js";import{C as S,S as C,T as w,b as T,j as E,r as D,v as O,w as k}from"./button--1wnt03c.js";var A,j,M,N,P,ee=(A=new WeakMap,j=new WeakMap,M=new WeakMap,N=new WeakMap,P=new WeakSet,class extends u{constructor(e,t){super(),a(this,P),f(this,A,void 0),f(this,j,void 0),f(this,M,void 0),f(this,N,void 0),p(A,this,e),this.setOptions(t),this.bindMethods(),m(P,this,F).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var t;let n=this.options;this.options=h(A,this).defaultMutationOptions(e),d(this.options,n)||h(A,this).getMutationCache().notify({type:`observerOptionsUpdated`,mutation:h(M,this),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&i(n.mutationKey)!==i(this.options.mutationKey)?this.reset():((t=h(M,this))==null?void 0:t.state.status)===`pending`&&h(M,this).setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners()){var e;(e=h(M,this))==null||e.removeObserver(this)}}onMutationUpdate(e){m(P,this,F).call(this),m(P,this,te).call(this,e)}getCurrentResult(){return h(j,this)}reset(){var e;(e=h(M,this))==null||e.removeObserver(this),p(M,this,void 0),m(P,this,F).call(this),m(P,this,te).call(this)}mutate(e,t){var n;return p(N,this,t),(n=h(M,this))==null||n.removeObserver(this),p(M,this,h(A,this).getMutationCache().build(h(A,this),this.options)),h(M,this).addObserver(this),h(M,this).execute(e)}});function F(){var e,t;let n=(e=(t=h(M,this))==null?void 0:t.state)==null?v():e;p(j,this,{...n,isPending:n.status===`pending`,isSuccess:n.status===`success`,isError:n.status===`error`,isIdle:n.status===`idle`,mutate:this.mutate,reset:this.reset})}function te(e){s.batch(()=>{if(h(N,this)&&this.hasListeners()){let l=h(j,this).variables,u=h(j,this).context,d={client:h(A,this),meta:this.options.meta,mutationKey:this.options.mutationKey};if((e==null?void 0:e.type)===`success`){try{var t,n;(t=(n=h(N,this)).onSuccess)==null||t.call(n,e.data,l,u,d)}catch(e){Promise.reject(e)}try{var r,i;(r=(i=h(N,this)).onSettled)==null||r.call(i,e.data,null,l,u,d)}catch(e){Promise.reject(e)}}else if((e==null?void 0:e.type)===`error`){try{var a,o;(a=(o=h(N,this)).onError)==null||a.call(o,e.error,l,u,d)}catch(e){Promise.reject(e)}try{var s,c;(s=(c=h(N,this)).onSettled)==null||s.call(c,void 0,e.error,l,u,d)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(h(j,this))})})}var I=t(n(),1);function L(e,t){let n=o(t),[r]=I.useState(()=>new ee(n,e));I.useEffect(()=>{r.setOptions(e)},[r,e]);let i=I.useSyncExternalStore(I.useCallback(e=>r.subscribe(s.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=I.useCallback((e,t)=>{r.mutate(e,t).catch(c)},[r]);if(i.error&&l(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var ne=x(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]);function re(e,[t,n]){return Math.min(n,Math.max(t,e))}var R=e();function ie(e,t){return I.useReducer((e,n)=>{let r=t[e][n];return r==null?e:r},e)}var z=`ScrollArea`,[ae,oe]=k(z),[se,B]=ae(z),ce=I.forwardRef((e,t)=>{let{__scopeScrollArea:n,type:r=`hover`,dir:i,scrollHideDelay:a=600,...o}=e,[s,c]=I.useState(null),[l,u]=I.useState(null),[d,f]=I.useState(null),[p,m]=I.useState(null),[h,g]=I.useState(null),[_,v]=I.useState(0),[y,x]=I.useState(0),[S,C]=I.useState(!1),[T,D]=I.useState(!1),O=E(t,e=>c(e)),k=b(i);return(0,R.jsx)(se,{scope:n,type:r,dir:k,scrollHideDelay:a,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:S,onScrollbarXEnabledChange:C,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:T,onScrollbarYEnabledChange:D,onCornerWidthChange:v,onCornerHeightChange:x,children:(0,R.jsx)(w.div,{dir:k,...o,ref:O,style:{position:`relative`,"--radix-scroll-area-corner-width":_+`px`,"--radix-scroll-area-corner-height":y+`px`,...e.style}})})});ce.displayName=z;var le=`ScrollAreaViewport`,ue=I.forwardRef((e,t)=>{let{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=B(le,n),s=E(t,I.useRef(null),o.onViewportChange);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`},nonce:i}),(0,R.jsx)(w.div,{"data-radix-scroll-area-viewport":``,...a,ref:s,style:{overflowX:o.scrollbarXEnabled?`scroll`:`hidden`,overflowY:o.scrollbarYEnabled?`scroll`:`hidden`,...e.style},children:(0,R.jsx)(`div`,{ref:o.onContentChange,style:{minWidth:`100%`,display:`table`},children:r})})]})});ue.displayName=le;var V=`ScrollAreaScrollbar`,de=I.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=B(V,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return I.useEffect(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,R.jsx)(fe,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,R.jsx)(pe,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,R.jsx)(me,{...r,ref:t,forceMount:n}):i.type===`always`?(0,R.jsx)(H,{...r,ref:t}):null});de.displayName=V;var fe=I.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=B(V,e.__scopeScrollArea),[a,o]=I.useState(!1);return I.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=()=>{window.clearTimeout(t),o(!0)},r=()=>{t=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,r),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,r)}}},[i.scrollArea,i.scrollHideDelay]),(0,R.jsx)(T,{present:n||a,children:(0,R.jsx)(me,{"data-state":a?`visible`:`hidden`,...r,ref:t})})}),pe=I.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=B(V,e.__scopeScrollArea),a=e.orientation===`horizontal`,o=J(()=>c(`SCROLL_END`),100),[s,c]=ie(`hidden`,{hidden:{SCROLL:`scrolling`},scrolling:{SCROLL_END:`idle`,POINTER_ENTER:`interacting`},interacting:{SCROLL:`interacting`,POINTER_LEAVE:`idle`},idle:{HIDE:`hidden`,SCROLL:`scrolling`,POINTER_ENTER:`interacting`}});return I.useEffect(()=>{if(s===`idle`){let e=window.setTimeout(()=>c(`HIDE`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),I.useEffect(()=>{let e=i.viewport,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=()=>{let r=e[t];n!==r&&(c(`SCROLL`),o()),n=r};return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[i.viewport,a,c,o]),(0,R.jsx)(T,{present:n||s!==`hidden`,children:(0,R.jsx)(H,{"data-state":s===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:S(e.onPointerEnter,()=>c(`POINTER_ENTER`)),onPointerLeave:S(e.onPointerLeave,()=>c(`POINTER_LEAVE`))})})}),me=I.forwardRef((e,t)=>{let n=B(V,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=I.useState(!1),s=e.orientation===`horizontal`,c=J(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return Y(n.viewport,c),Y(n.content,c),(0,R.jsx)(T,{present:r||a,children:(0,R.jsx)(H,{"data-state":a?`visible`:`hidden`,...i,ref:t})})}),H=I.forwardRef((e,t)=>{let{orientation:n=`vertical`,...r}=e,i=B(V,e.__scopeScrollArea),a=I.useRef(null),o=I.useRef(0),[s,c]=I.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=Ce(s.viewport,s.content),u={...r,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:e=>a.current=e,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:e=>o.current=e};function d(e,t){return we(e,o.current,s,t)}return n===`horizontal`?(0,R.jsx)(he,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=Te(e,s,i.dir);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,i.dir))}}):n===`vertical`?(0,R.jsx)(ge,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=Te(e,s);a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}}):null}),he=I.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=B(V,e.__scopeScrollArea),[o,s]=I.useState(),c=I.useRef(null),l=E(t,c,a.onScrollbarXChange);return I.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,R.jsx)(ye,{"data-orientation":`horizontal`,...i,ref:l,sizes:n,style:{bottom:0,left:a.dir===`rtl`?`var(--radix-scroll-area-corner-width)`:0,right:a.dir===`ltr`?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":q(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),De(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:K(o.paddingLeft),paddingEnd:K(o.paddingRight)}})}})}),ge=I.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=B(V,e.__scopeScrollArea),[o,s]=I.useState(),c=I.useRef(null),l=E(t,c,a.onScrollbarYChange);return I.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,R.jsx)(ye,{"data-orientation":`vertical`,...i,ref:l,sizes:n,style:{top:0,right:a.dir===`ltr`?0:void 0,left:a.dir===`rtl`?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":q(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),De(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:K(o.paddingTop),paddingEnd:K(o.paddingBottom)}})}})}),[_e,ve]=ae(V),ye=I.forwardRef((e,t)=>{let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:d,...f}=e,p=B(V,n),[m,h]=I.useState(null),g=E(t,e=>h(e)),_=I.useRef(null),v=I.useRef(``),y=p.viewport,b=r.content-r.viewport,x=O(u),C=O(c),T=J(d,10);function D(e){_.current&&l({x:e.clientX-_.current.left,y:e.clientY-_.current.top})}return I.useEffect(()=>{let e=e=>{let t=e.target;m!=null&&m.contains(t)&&x(e,b)};return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[y,m,b,x]),I.useEffect(C,[r,C]),Y(m,T),Y(p.content,T),(0,R.jsx)(_e,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:O(a),onThumbPointerUp:O(o),onThumbPositionChange:C,onThumbPointerDown:O(s),children:(0,R.jsx)(w.div,{...f,ref:g,style:{position:`absolute`,...f.style},onPointerDown:S(e.onPointerDown,e=>{e.button===0&&(e.target.setPointerCapture(e.pointerId),_.current=m.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,p.viewport&&(p.viewport.style.scrollBehavior=`auto`),D(e))}),onPointerMove:S(e.onPointerMove,D),onPointerUp:S(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=v.current,p.viewport&&(p.viewport.style.scrollBehavior=``),_.current=null})})})}),U=`ScrollAreaThumb`,W=I.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=ve(U,e.__scopeScrollArea);return(0,R.jsx)(T,{present:n||i.hasThumb,children:(0,R.jsx)(be,{ref:t,...r})})}),be=I.forwardRef((e,t)=>{let{__scopeScrollArea:n,style:r,...i}=e,a=B(U,n),o=ve(U,n),{onThumbPositionChange:s}=o,c=E(t,e=>o.onThumbChange(e)),l=I.useRef(void 0),u=J(()=>{l.current&&(l.current(),l.current=void 0)},100);return I.useEffect(()=>{let e=a.viewport;if(e){let t=()=>{u(),l.current||(l.current=Oe(e,s),s())};return s(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[a.viewport,u,s]),(0,R.jsx)(w.div,{"data-state":o.hasThumb?`visible`:`hidden`,...i,ref:c,style:{width:`var(--radix-scroll-area-thumb-width)`,height:`var(--radix-scroll-area-thumb-height)`,...r},onPointerDownCapture:S(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;o.onThumbPointerDown({x:n,y:r})}),onPointerUp:S(e.onPointerUp,o.onThumbPointerUp)})});W.displayName=U;var G=`ScrollAreaCorner`,xe=I.forwardRef((e,t)=>{let n=B(G,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,R.jsx)(Se,{...e,ref:t}):null});xe.displayName=G;var Se=I.forwardRef((e,t)=>{let{__scopeScrollArea:n,...r}=e,i=B(G,n),[a,o]=I.useState(0),[s,c]=I.useState(0),l=!!(a&&s);return Y(i.scrollbarX,()=>{var e;let t=((e=i.scrollbarX)==null?void 0:e.offsetHeight)||0;i.onCornerHeightChange(t),c(t)}),Y(i.scrollbarY,()=>{var e;let t=((e=i.scrollbarY)==null?void 0:e.offsetWidth)||0;i.onCornerWidthChange(t),o(t)}),l?(0,R.jsx)(w.div,{...r,ref:t,style:{width:a,height:s,position:`absolute`,right:i.dir===`ltr`?0:void 0,left:i.dir===`rtl`?0:void 0,bottom:0,...e.style}}):null});function K(e){return e?parseInt(e,10):0}function Ce(e,t){let n=e/t;return isNaN(n)?0:n}function q(e){let t=Ce(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function we(e,t,n,r=`ltr`){let i=q(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return Ee([c,l],d)(e)}function Te(e,t,n=`ltr`){let r=q(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=re(e,n===`ltr`?[0,o]:[o*-1,0]);return Ee([0,o],[0,s])(c)}function Ee(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function De(e,t){return e>0&&e<t}var Oe=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)};function J(e,t){let n=O(e),r=I.useRef(0);return I.useEffect(()=>()=>window.clearTimeout(r.current),[]),I.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Y(e,t){let n=O(t);C(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var ke=ce,Ae=ue,je=xe,X=r(),Me=I.forwardRef((e,t)=>{let n=(0,X.c)(16),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:i,children:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===i?o=n[5]:(o=D(`relative overflow-hidden`,i),n[4]=i,n[5]=o);let s;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(s={WebkitOverflowScrolling:`touch`},n[6]=s):s=n[6];let c;n[7]!==r||n[8]!==t?(c=(0,R.jsx)(Ae,{ref:t,"data-slot":`scroll-area-viewport`,className:`size-full min-w-0 rounded-[inherit] outline-none`,style:s,children:r}),n[7]=r,n[8]=t,n[9]=c):c=n[9];let l,u;n[10]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,R.jsx)(Ne,{}),u=(0,R.jsx)(je,{}),n[10]=l,n[11]=u):(l=n[10],u=n[11]);let d;return n[12]!==a||n[13]!==o||n[14]!==c?(d=(0,R.jsxs)(ke,{"data-slot":`scroll-area`,className:o,...a,children:[c,l,u]}),n[12]=a,n[13]=o,n[14]=c,n[15]=d):d=n[15],d});Me.displayName=`ScrollArea`;function Ne(e){let t=(0,X.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,orientation:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`vertical`:i,o;t[4]===n?o=t[5]:(o=D(`flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent`,n),t[4]=n,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,R.jsx)(W,{"data-slot":`scroll-area-thumb`,className:`relative flex-1 rounded-full bg-border`}),t[6]=s):s=t[6];let c;return t[7]!==a||t[8]!==r||t[9]!==o?(c=(0,R.jsx)(de,{"data-slot":`scroll-area-scrollbar`,"data-orientation":a,orientation:a,className:o,...r,children:s}),t[7]=a,t[8]=r,t[9]=o,t[10]=c):c=t[10],c}function Pe(e){let t=(0,X.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.tools.list(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:_.tools.all,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],g(i)}function Fe(e){let t=(0,X.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.tools.listEnvVars(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:_.tools.envVars,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],g(i)}function Ie(e){let t=(0,X.c)(7),n=o(),r;t[0]===e?r=t[1]:(r=t=>{let{key:n,value:r}=t;return e.http.tools.setEnvVar(n,{value:r})},t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:_.tools.envVars})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],L(a)}function Le(e){let t=(0,X.c)(7),n=o(),r;t[0]===e?r=t[1]:(r=t=>e.http.tools.clearEnvVar(t),t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:_.tools.envVars})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],L(a)}function Re(e){let t=(0,X.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.config.models.get(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:_.config.models,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],g(i)}async function Z(e,t){let n=await e.http.config.models.get(),r=n.providers.flatMap(e=>e.models).filter(e=>{var t;return(t=e.runtimeStatus)==null?void 0:t.usable});y.getState().updateModels(r,n.defaultModel,n.defaultProvider),t.setQueryData(_.config.models,n)}function ze(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>e.http.config.models.createProvider(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Z(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function Be(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>{let{providerId:n,body:r}=t;return e.http.config.models.updateProvider(n,r)},t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Z(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function Ve(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>e.http.config.models.deleteProvider(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Z(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function He(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>{let{providerId:n,body:r}=t;return e.http.config.models.createModel(n,r)},t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Z(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function Ue(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>{let{providerId:n,modelId:r,body:i}=t;return e.http.config.models.updateModel(n,r,i)},t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Z(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function We(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>{let{providerId:n,modelId:r}=t;return e.http.config.models.deleteModel(n,r)},t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Z(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function Ge(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>e.http.config.models.setDefaults(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Z(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function Ke(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>e.http.config.models.sync(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Z(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function qe(e){let t=(0,X.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.preconfigs.list(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:_.config.preconfigs,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],g(i)}async function Q(e,t){let n=await e.http.preconfigs.list();y.getState().updatePreconfigs(n.preconfigs),t.setQueryData(_.config.preconfigs,n)}function Je(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>e.http.preconfigs.create(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Q(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function Ye(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>{let{id:n,body:r}=t;return e.http.preconfigs.update(n,r)},t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Q(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function Xe(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>e.http.preconfigs.delete(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Q(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function Ze(e){let t=(0,X.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.config.prompts.list(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:_.config.prompts,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],g(i)}async function $(e,t){let n=await e.http.config.prompts.list();y.getState().updatePrompts(n.prompts),t.setQueryData(_.config.prompts,n)}function Qe(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>e.http.config.prompts.create(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&$(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function $e(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>{let{name:n,body:r}=t;return e.http.config.prompts.update(n,r)},t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&$(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function et(e){let t=(0,X.c)(8),n=o(),r;t[0]===e?r=t[1]:(r=t=>e.http.config.prompts.delete(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&$(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],L(a)}function tt(e){let t=(0,X.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.providers.list(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:_.config.providers.all,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],g(i)}function nt(e){let t=(0,X.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.providers.listCredentials(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:_.config.providers.credentials,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],g(i)}function rt(e){let t=(0,X.c)(7),n=o(),r;t[0]===e?r=t[1]:(r=t=>e.http.providers.connect(t),t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:_.config.providers.all})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],L(a)}function it(e){let t=(0,X.c)(7),n=o(),r;t[0]===e?r=t[1]:(r=t=>e.http.providers.disconnect(t),t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:_.config.providers.all})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],L(a)}function at(e){let t=(0,X.c)(7),n=o(),r;t[0]===e?r=t[1]:(r=t=>{let{provider:n,body:r}=t;return e.http.providers.setCredential(n,r)},t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:_.config.providers.credentials})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],L(a)}function ot(e){let t=(0,X.c)(7),n=o(),r;t[0]===e?r=t[1]:(r=t=>e.http.providers.clearCredential(t),t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:_.config.providers.credentials})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],L(a)}function st(e,t){let n=(0,X.c)(9),r;n[0]===t?r=n[1]:(r=_.mcp.status(t==null?``:t),n[0]=t,n[1]=r);let i;n[2]!==e||n[3]!==t?(i=()=>e.http.mcp.getStatus(t),n[2]=e,n[3]=t,n[4]=i):i=n[4];let a=!!e&&!!t,o;return n[5]!==r||n[6]!==i||n[7]!==a?(o={queryKey:r,queryFn:i,enabled:a},n[5]=r,n[6]=i,n[7]=a,n[8]=o):o=n[8],g(o)}function ct(e){let t=(0,X.c)(7),n=o(),r;t[0]===e?r=t[1]:(r=t=>{let{workspaceId:n,name:r}=t;return e.http.mcp.connect(n,r)},t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=(e,t)=>{let{workspaceId:r}=t;n.invalidateQueries({queryKey:_.mcp.status(r)})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],L(a)}function lt(e){let t=(0,X.c)(7),n=o(),r;t[0]===e?r=t[1]:(r=t=>{let{workspaceId:n,name:r}=t;return e.http.mcp.disconnect(n,r)},t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=(e,t)=>{let{workspaceId:r}=t;n.invalidateQueries({queryKey:_.mcp.status(r)})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],L(a)}function ut(e){let t=(0,X.c)(2),n;return t[0]===e?n=t[1]:(n={mutationFn:t=>{let{workspaceId:n,name:r}=t;return e.http.mcp.startAuth(n,r)}},t[0]=e,t[1]=n),L(n)}function dt(e,t,n,r,i){let a=(0,X.c)(13),o;a[0]!==r||a[1]!==n||a[2]!==t?(o=_.files.browse(t==null?``:t,n,r),a[0]=r,a[1]=n,a[2]=t,a[3]=o):o=a[3];let s;a[4]!==r||a[5]!==n||a[6]!==e||a[7]!==t?(s=()=>e.http.files.browse(t,n,r),a[4]=r,a[5]=n,a[6]=e,a[7]=t,a[8]=s):s=a[8];let c=!!e&&!!t&&(i==null?!0:i),l;return a[9]!==o||a[10]!==s||a[11]!==c?(l={queryKey:o,queryFn:s,enabled:c},a[9]=o,a[10]=s,a[11]=c,a[12]=l):l=a[12],g(l)}function ft(e,t,n){let r=(0,X.c)(9),i=n===void 0?!0:n,a;r[0]===t?a=r[1]:(a=_.files.browseFs(t),r[0]=t,r[1]=a);let o;r[2]!==t||r[3]!==e?(o=()=>e.http.files.browseFs(t),r[2]=t,r[3]=e,r[4]=o):o=r[4];let s=!!e&&i,c;return r[5]!==a||r[6]!==o||r[7]!==s?(c={queryKey:a,queryFn:o,enabled:s},r[5]=a,r[6]=o,r[7]=s,r[8]=c):c=r[8],g(c)}function pt(e){let t=(0,X.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.files.drives(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:_.files.drives,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],g(i)}function mt(e,t,n){let r=(0,X.c)(9),i=n===void 0?!0:n,a;r[0]===t?a=r[1]:(a=_.files.parent(t),r[0]=t,r[1]=a);let o;r[2]!==t||r[3]!==e?(o=()=>e.http.files.parent(t),r[2]=t,r[3]=e,r[4]=o):o=r[4];let s=!!e&&i,c;return r[5]!==a||r[6]!==o||r[7]!==s?(c={queryKey:a,queryFn:o,enabled:s},r[5]=a,r[6]=o,r[7]=s,r[8]=c):c=r[8],g(c)}function ht(e,t,n,r){let i=(0,X.c)(11),a=r===void 0?!0:r,o;i[0]!==n||i[1]!==t?(o=_.files.preview(t==null?``:t,n==null?``:n),i[0]=n,i[1]=t,i[2]=o):o=i[2];let s;i[3]!==n||i[4]!==e||i[5]!==t?(s=()=>e.http.files.preview(t,n),i[3]=n,i[4]=e,i[5]=t,i[6]=s):s=i[6];let c=!!e&&!!t&&!!n&&a,l;return i[7]!==o||i[8]!==s||i[9]!==c?(l={queryKey:o,queryFn:s,enabled:c},i[7]=o,i[8]=s,i[9]=c,i[10]=l):l=i[10],g(l)}export{Ke as A,Ye as C,Ve as D,We as E,Ie as F,Pe as I,Me as L,Be as M,Le as N,Re as O,Fe as P,ne as R,qe as S,ze as T,et as _,ht as a,Je as b,ut as c,rt as d,it as f,Qe as g,at as h,mt as i,Ue as j,Ge as k,st as l,tt as m,dt as n,ct as o,nt as p,pt as r,lt as s,ft as t,ot as u,Ze as v,He as w,Xe as x,$e as y};
@@ -1 +1 @@
1
- import{n as e,o as t,r as n,t as r}from"./compiler-runtime-DZXZ41-q.js";import{n as i}from"./ServerContext-CH3cYgM3.js";import{t as a}from"./useNavigate-Ckup4lZi.js";import{F as o,N as s,P as c}from"./button--1wnt03c.js";import{t as l}from"./refresh-cw-BYRFQSBp.js";import{t as u}from"./confirmation-dialog-CFCxzDEX.js";var d=r(),f=t(n(),1);async function p(e,t){try{let n=e.url.startsWith(`https`)?`https`:`http`,r=e.url.replace(/^https?:\/\//,``);return(await fetch(`${n}://${r}/api/info`,{signal:t})).ok?`online`:`offline`}catch{return`offline`}}function m(e){let[t,n]=(0,f.useState)({}),[r,i]=(0,f.useState)(!1),a=(0,f.useCallback)(()=>{if(e.length===0)return;let t=new AbortController;i(!0);let r={};for(let t of e)r[t.id]=`checking`;n(r);let a=e.length;for(let r of e)p(r,t.signal).then(e=>{n(t=>({...t,[r.id]:e})),a--,a===0&&i(!1)});return()=>t.abort()},[e]);return(0,f.useEffect)(()=>a(),[a]),{statuses:t,isChecking:r,refresh:a}}var h=e();function g(e){let t=(0,d.c)(3),{status:n}=e;if(n===`checking`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,h.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full bg-muted-foreground/40 animate-pulse`}),t[0]=e):e=t[0],e}if(n===`online`){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,h.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full bg-green-500`}),t[1]=e):e=t[1],e}let r;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,h.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full bg-destructive`}),t[2]=r):r=t[2],r}function _(){var e;let t=(0,d.c)(42),n=a(),{servers:r,removeServer:p}=i(),[_,v]=(0,f.useState)(null),{statuses:y,isChecking:b,refresh:x}=m(r),S;t[0]===n?S=t[1]:(S=e=>{n({to:`/server/$serverId`,params:{serverId:e.id}})},t[0]=n,t[1]=S);let C=S,w;t[2]!==_||t[3]!==p?(w=()=>{_&&(p(_.id),v(null))},t[2]=_,t[3]=p,t[4]=w):w=t[4];let T=w,E;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,h.jsx)(`h1`,{className:`text-2xl font-bold text-foreground`,children:`Select a Server`}),t[5]=E):E=t[5];let D=`w-4 h-4 ${b?`animate-spin`:``}`,O;t[6]===D?O=t[7]:(O=(0,h.jsx)(l,{className:D}),t[6]=D,t[7]=O);let k;t[8]!==b||t[9]!==x||t[10]!==O?(k=(0,h.jsxs)(`div`,{className:`flex items-center justify-center gap-2`,children:[E,(0,h.jsx)(`button`,{onClick:x,disabled:b,className:`p-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-accent disabled:opacity-50 transition-colors`,title:`Refresh server status`,children:O})]}),t[8]=b,t[9]=x,t[10]=O,t[11]=k):k=t[11];let A;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,h.jsx)(`p`,{className:`text-muted-foreground mt-1`,children:`Choose a saved server or add a new one`}),t[12]=A):A=t[12];let j;t[13]===k?j=t[14]:(j=(0,h.jsxs)(`div`,{className:`px-6 pt-6 pb-4 text-center border-b border-border`,children:[k,A]}),t[13]=k,t[14]=j);let M;if(t[15]!==C||t[16]!==r||t[17]!==y){let e;t[19]!==C||t[20]!==y?(e=e=>{var t;return(0,h.jsxs)(`div`,{className:`group w-full flex items-center gap-4 p-4 bg-background border border-input rounded-lg hover:bg-accent hover:border-ring transition-colors`,children:[(0,h.jsxs)(`button`,{onClick:()=>C(e),className:`flex items-center gap-4 flex-1 min-w-0 text-left`,children:[(0,h.jsx)(`div`,{className:`p-2 bg-primary/10 rounded-lg shrink-0`,children:(0,h.jsx)(c,{className:`w-5 h-5 text-primary`})}),(0,h.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,h.jsx)(`p`,{className:`font-medium text-foreground truncate`,children:e.name}),(0,h.jsx)(g,{status:(t=y[e.id])==null?`checking`:t})]}),(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground truncate`,children:e.url})]})]}),(0,h.jsx)(`button`,{onClick:t=>{t.stopPropagation(),v(e)},className:`p-2 rounded-md opacity-0 group-hover:opacity-100 hover:bg-destructive/10 text-muted-foreground hover:text-destructive transition-all shrink-0`,title:`Remove server`,children:(0,h.jsx)(s,{className:`w-4 h-4`})})]},e.id)},t[19]=C,t[20]=y,t[21]=e):e=t[21],M=r.map(e),t[15]=C,t[16]=r,t[17]=y,t[18]=M}else M=t[18];let N;t[22]===n?N=t[23]:(N=()=>n({to:`/add-server`}),t[22]=n,t[23]=N);let P;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,h.jsx)(`div`,{className:`p-2 bg-primary/10 rounded-lg`,children:(0,h.jsx)(o,{className:`w-5 h-5 text-primary`})}),t[24]=P):P=t[24];let F;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,h.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,h.jsx)(`p`,{className:`font-medium text-muted-foreground`,children:`Add a Server`})}),t[25]=F):F=t[25];let I;t[26]===N?I=t[27]:(I=(0,h.jsxs)(`button`,{onClick:N,className:`w-full flex items-center gap-4 p-4 bg-background border border-dashed border-input rounded-lg hover:bg-accent hover:border-ring transition-colors text-left`,children:[P,F]}),t[26]=N,t[27]=I);let L;t[28]!==I||t[29]!==M?(L=(0,h.jsxs)(`div`,{className:`p-6 space-y-4`,children:[M,I]}),t[28]=I,t[29]=M,t[30]=L):L=t[30];let R;t[31]!==L||t[32]!==j?(R=(0,h.jsxs)(`div`,{className:`bg-card border border-border rounded-xl shadow-2xl overflow-hidden`,children:[j,L]}),t[31]=L,t[32]=j,t[33]=R):R=t[33];let z=_!==null,B;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(B=e=>{e||v(null)},t[34]=B):B=t[34];let V=`Remove "${(e=_==null?void 0:_.name)==null?``:e}" from your saved servers?`,H;t[35]!==T||t[36]!==z||t[37]!==V?(H=(0,h.jsx)(u,{open:z,onOpenChange:B,title:`Remove Server`,description:V,confirmLabel:`Remove`,onConfirm:T,variant:`destructive`}),t[35]=T,t[36]=z,t[37]=V,t[38]=H):H=t[38];let U;return t[39]!==R||t[40]!==H?(U=(0,h.jsx)(`div`,{className:`w-full h-full flex items-center justify-center bg-background dark:bg-gradient-to-br dark:from-muted dark:via-background dark:to-muted p-4`,children:(0,h.jsxs)(`div`,{className:`w-full max-w-2xl`,children:[R,H]})}),t[39]=R,t[40]=H,t[41]=U):U=t[41],U}export{_ as component};
1
+ import{n as e,o as t,r as n,t as r}from"./compiler-runtime-DZXZ41-q.js";import{n as i}from"./ServerContext-Dy9T5Mj8.js";import{t as a}from"./useNavigate-Ckup4lZi.js";import{F as o,N as s,P as c}from"./button--1wnt03c.js";import{t as l}from"./refresh-cw-BYRFQSBp.js";import{t as u}from"./confirmation-dialog-CFCxzDEX.js";var d=r(),f=t(n(),1);async function p(e,t){try{let n=e.url.startsWith(`https`)?`https`:`http`,r=e.url.replace(/^https?:\/\//,``);return(await fetch(`${n}://${r}/api/info`,{signal:t})).ok?`online`:`offline`}catch{return`offline`}}function m(e){let[t,n]=(0,f.useState)({}),[r,i]=(0,f.useState)(!1),a=(0,f.useCallback)(()=>{if(e.length===0)return;let t=new AbortController;i(!0);let r={};for(let t of e)r[t.id]=`checking`;n(r);let a=e.length;for(let r of e)p(r,t.signal).then(e=>{n(t=>({...t,[r.id]:e})),a--,a===0&&i(!1)});return()=>t.abort()},[e]);return(0,f.useEffect)(()=>a(),[a]),{statuses:t,isChecking:r,refresh:a}}var h=e();function g(e){let t=(0,d.c)(3),{status:n}=e;if(n===`checking`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,h.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full bg-muted-foreground/40 animate-pulse`}),t[0]=e):e=t[0],e}if(n===`online`){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,h.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full bg-green-500`}),t[1]=e):e=t[1],e}let r;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,h.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full bg-destructive`}),t[2]=r):r=t[2],r}function _(){var e;let t=(0,d.c)(42),n=a(),{servers:r,removeServer:p}=i(),[_,v]=(0,f.useState)(null),{statuses:y,isChecking:b,refresh:x}=m(r),S;t[0]===n?S=t[1]:(S=e=>{n({to:`/server/$serverId`,params:{serverId:e.id}})},t[0]=n,t[1]=S);let C=S,w;t[2]!==_||t[3]!==p?(w=()=>{_&&(p(_.id),v(null))},t[2]=_,t[3]=p,t[4]=w):w=t[4];let T=w,E;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,h.jsx)(`h1`,{className:`text-2xl font-bold text-foreground`,children:`Select a Server`}),t[5]=E):E=t[5];let D=`w-4 h-4 ${b?`animate-spin`:``}`,O;t[6]===D?O=t[7]:(O=(0,h.jsx)(l,{className:D}),t[6]=D,t[7]=O);let k;t[8]!==b||t[9]!==x||t[10]!==O?(k=(0,h.jsxs)(`div`,{className:`flex items-center justify-center gap-2`,children:[E,(0,h.jsx)(`button`,{onClick:x,disabled:b,className:`p-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-accent disabled:opacity-50 transition-colors`,title:`Refresh server status`,children:O})]}),t[8]=b,t[9]=x,t[10]=O,t[11]=k):k=t[11];let A;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,h.jsx)(`p`,{className:`text-muted-foreground mt-1`,children:`Choose a saved server or add a new one`}),t[12]=A):A=t[12];let j;t[13]===k?j=t[14]:(j=(0,h.jsxs)(`div`,{className:`px-6 pt-6 pb-4 text-center border-b border-border`,children:[k,A]}),t[13]=k,t[14]=j);let M;if(t[15]!==C||t[16]!==r||t[17]!==y){let e;t[19]!==C||t[20]!==y?(e=e=>{var t;return(0,h.jsxs)(`div`,{className:`group w-full flex items-center gap-4 p-4 bg-background border border-input rounded-lg hover:bg-accent hover:border-ring transition-colors`,children:[(0,h.jsxs)(`button`,{onClick:()=>C(e),className:`flex items-center gap-4 flex-1 min-w-0 text-left`,children:[(0,h.jsx)(`div`,{className:`p-2 bg-primary/10 rounded-lg shrink-0`,children:(0,h.jsx)(c,{className:`w-5 h-5 text-primary`})}),(0,h.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,h.jsx)(`p`,{className:`font-medium text-foreground truncate`,children:e.name}),(0,h.jsx)(g,{status:(t=y[e.id])==null?`checking`:t})]}),(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground truncate`,children:e.url})]})]}),(0,h.jsx)(`button`,{onClick:t=>{t.stopPropagation(),v(e)},className:`p-2 rounded-md opacity-0 group-hover:opacity-100 hover:bg-destructive/10 text-muted-foreground hover:text-destructive transition-all shrink-0`,title:`Remove server`,children:(0,h.jsx)(s,{className:`w-4 h-4`})})]},e.id)},t[19]=C,t[20]=y,t[21]=e):e=t[21],M=r.map(e),t[15]=C,t[16]=r,t[17]=y,t[18]=M}else M=t[18];let N;t[22]===n?N=t[23]:(N=()=>n({to:`/add-server`}),t[22]=n,t[23]=N);let P;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,h.jsx)(`div`,{className:`p-2 bg-primary/10 rounded-lg`,children:(0,h.jsx)(o,{className:`w-5 h-5 text-primary`})}),t[24]=P):P=t[24];let F;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,h.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,h.jsx)(`p`,{className:`font-medium text-muted-foreground`,children:`Add a Server`})}),t[25]=F):F=t[25];let I;t[26]===N?I=t[27]:(I=(0,h.jsxs)(`button`,{onClick:N,className:`w-full flex items-center gap-4 p-4 bg-background border border-dashed border-input rounded-lg hover:bg-accent hover:border-ring transition-colors text-left`,children:[P,F]}),t[26]=N,t[27]=I);let L;t[28]!==I||t[29]!==M?(L=(0,h.jsxs)(`div`,{className:`p-6 space-y-4`,children:[M,I]}),t[28]=I,t[29]=M,t[30]=L):L=t[30];let R;t[31]!==L||t[32]!==j?(R=(0,h.jsxs)(`div`,{className:`bg-card border border-border rounded-xl shadow-2xl overflow-hidden`,children:[j,L]}),t[31]=L,t[32]=j,t[33]=R):R=t[33];let z=_!==null,B;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(B=e=>{e||v(null)},t[34]=B):B=t[34];let V=`Remove "${(e=_==null?void 0:_.name)==null?``:e}" from your saved servers?`,H;t[35]!==T||t[36]!==z||t[37]!==V?(H=(0,h.jsx)(u,{open:z,onOpenChange:B,title:`Remove Server`,description:V,confirmLabel:`Remove`,onConfirm:T,variant:`destructive`}),t[35]=T,t[36]=z,t[37]=V,t[38]=H):H=t[38];let U;return t[39]!==R||t[40]!==H?(U=(0,h.jsx)(`div`,{className:`w-full h-full flex items-center justify-center bg-background dark:bg-gradient-to-br dark:from-muted dark:via-background dark:to-muted p-4`,children:(0,h.jsxs)(`div`,{className:`w-full max-w-2xl`,children:[R,H]})}),t[39]=R,t[40]=H,t[41]=U):U=t[41],U}export{_ as component};