@mrpatronz/nexusflow 2.20.1 → 2.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gui/assets/AgentsPage-Dhd1ZqwZ.js +3 -0
- package/dist/gui/assets/DashboardPage-DuG3Nx62.js +1 -0
- package/dist/gui/assets/{DocumentPreview-Os281E1X.js → DocumentPreview-BlUlSRK0.js} +1 -1
- package/dist/gui/assets/{GettingStartedPage-bcbneczR.js → GettingStartedPage-C-2t-udq.js} +1 -1
- package/dist/gui/assets/{MonacoDiffAdapter-D1wWcPlt.js → MonacoDiffAdapter-C1gYxNl1.js} +1 -1
- package/dist/gui/assets/{ProjectsPage-CIEM54GU.js → ProjectsPage-Bll4qUCc.js} +1 -1
- package/dist/gui/assets/ScaffoldRepoInline-BYGKL4qv.js +1 -0
- package/dist/gui/assets/SettingsPage-DP1pJNJm.js +1 -0
- package/dist/gui/assets/SkillsPage-CLGLrRq3.js +7 -0
- package/dist/gui/assets/StartWorkPage-CcCPKOv8.js +1 -0
- package/dist/gui/assets/{StrategiesPage-UIiETHGq.js → StrategiesPage-nNBMOxvu.js} +2 -2
- package/dist/gui/assets/WorkroomsPage-CnH1E8mW.js +4 -0
- package/dist/gui/assets/{WorkspacesPage-2tYcZu28.js → WorkspacesPage-DblU6U2z.js} +11 -11
- package/dist/gui/assets/{alert-dialog-CdWem4Th.js → alert-dialog-DnwZtA87.js} +1 -1
- package/dist/gui/assets/index-BO8b3Dk2.css +2 -0
- package/dist/gui/assets/index-R0fvXNEi.js +75 -0
- package/dist/gui/assets/{queries-CtxmqmGJ.js → queries-F2H3SwGY.js} +2 -2
- package/dist/gui/assets/{tabs-7VC4aq4J.js → tabs-CIkN5ISA.js} +1 -1
- package/dist/gui/index.html +3 -3
- package/package.json +1 -1
- package/dist/gui/assets/AgentsPage-BKwrbZTW.js +0 -3
- package/dist/gui/assets/DashboardPage-B5DuTyhZ.js +0 -1
- package/dist/gui/assets/ScaffoldRepoInline-DoqywP_g.js +0 -1
- package/dist/gui/assets/SettingsPage-sCzTlpxr.js +0 -1
- package/dist/gui/assets/SkillsPage-CoMf5sLE.js +0 -7
- package/dist/gui/assets/StartWorkPage-CVnUwx7O.js +0 -1
- package/dist/gui/assets/WorkroomsPage-BTcKu4E8.js +0 -4
- package/dist/gui/assets/index-qvc4aLwP.js +0 -75
- package/dist/gui/assets/index-zHrkxd7h.css +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-DE3RlOCf.js";import{h as r}from"./button-BrcP8Wxx.js";import{o as i}from"./monaco-DLwhzYMT.js";import{o as a,u as o}from"./brand-Bj6g9sFF.js";import{n as s}from"./client-CQ3EdyuW.js";var c=e(t(),1),l=n(),u=c.createContext(void 0),d=e=>{let t=c.useContext(u);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},f=({client:e,children:t})=>(c.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,l.jsx)(u.Provider,{value:e,children:t})),p={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},m=new class{#e=p;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function h(e){setTimeout(e,0)}var g=typeof window>`u`||`Deno`in globalThis;function _(){}function v(e,t){return typeof e==`function`?e(t):e}function y(e){return typeof e==`number`&&e>=0&&e!==1/0}function b(e,t){return Math.max(e+(t||0)-Date.now(),0)}function x(e,t){return typeof e==`function`?e(t):e}function S(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==w(o,t.options))return!1}else if(!E(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 C(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(T(t.options.mutationKey)!==T(a))return!1}else if(!E(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function w(e,t){return(t?.queryKeyHashFn||T)(e)}function T(e){return JSON.stringify(e,(e,t)=>ne(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function E(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!E(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!E(e[r],t[r]))return!1;return!0}return!1}var ee=Object.prototype.hasOwnProperty;function te(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=O(e)&&O(t);if(!r&&!(ne(e)&&ne(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ee.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=te(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function D(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 O(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ne(e){if(!re(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!re(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function re(e){return Object.prototype.toString.call(e)===`[object Object]`}function ie(e){return new Promise(t=>{m.setTimeout(t,e)})}function ae(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:te(e,t)}function oe(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function se(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ce=Symbol();function le(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ce?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ue(e,t){return typeof e==`function`?e(...t):!!e}function de(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var fe=()=>g,pe=()=>fe(),k=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(){}},me=new class extends k{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},he=h;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 A=ge(),_e=new class extends k{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function ve(e){return Math.min(1e3*2**e,3e4)}function ye(e){return(e??`online`)!==`online`||_e.isOnline()}var be=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function xe(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(_);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new be(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>me.isFocused()&&(e.networkMode===`always`||_e.isOnline())&&e.canRun(),p=()=>ye(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),v=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(pe()?0:3),a=e.retryDelay??ve,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),ie(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):v()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?v():g().then(v),s)}}var Se=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),y(this.gcTime)&&(this.#e=m.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(pe()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(m.clearTimeout(this.#e),this.#e=void 0)}};function Ce(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{de(e,()=>t.signal,()=>n=!0)},u=le(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?se:oe;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Te:we,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:we(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function we(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 Te(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Ee=class extends Se{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=ke(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=ke(this.options);e.data!==void 0&&(this.setState(Oe(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=ae(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(_).catch(_):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>x(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ce||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>x(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!b(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=le(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Ce(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=xe({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof be&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof be){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...De(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Oe(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),A.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function De(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ye(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Oe(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function ke(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Ae=class extends k{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Me(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ne(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ne(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof x(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!D(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Pe(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||x(this.options.enabled,this.#t)!==x(t.enabled,this.#t)||x(this.options.staleTime,this.#t)!==x(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||x(this.options.enabled,this.#t)!==x(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return D(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(_)),t}#h(e){return!pe()&&x(this.options.enabled,this.#t)!==!1&&y(e)}#g(){this.#b();let e=x(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=b(this.#r.dataUpdatedAt,e)+1;this.#u=m.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#f=e,!(this.#f===0||!this.#h(this.#f))&&(this.#d=m.setInterval(()=>{(this.options.refetchIntervalInBackground||me.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(m.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(m.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Me(e,t),o=i&&Pe(e,n,t,r);(a||o)&&(l={...l,...De(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=ae(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=ae(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Fe(e,t),refetch:this.refetch,isEnabled:x(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),D(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();A.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function je(e,t){return x(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||x(t.retryOnMount,e)!==!1)}function Me(e,t){return je(e,t)||e.state.data!==void 0&&Ne(e,t,t.refetchOnMount)}function Ne(e,t,n){if(x(t.enabled,e)!==!1&&x(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Fe(e,t)}return!1}function Pe(e,t,n,r){return(e!==t||x(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Fe(e,n)}function Fe(e,t){return x(t.enabled,e)!==!1&&e.isStaleByTime(x(t.staleTime,e))}var Ie=class extends Se{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Le(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=xe({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),A.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Le(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Re=class extends k{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),D(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&T(t.mutationKey)!==T(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Le();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){A.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},ze=c.createContext(!1),Be=()=>c.useContext(ze);ze.Provider;function Ve(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var He=c.createContext(Ve()),Ue=()=>c.useContext(He),We=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?ue(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Ge=e=>{c.useEffect(()=>{e.clearReset()},[e])},Ke=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||ue(n,[e.error,r])),qe=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Je=(e,t)=>e?.suspense&&t.isPending,Ye=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Xe(e,t,n){let r=Be(),i=Ue(),a=d(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),l=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:l?`optimistic`:void 0,qe(o),We(o,i,s),Ge(i);let[u]=c.useState(()=>new t(a,o)),f=u.getOptimisticResult(o),p=!r&&l;if(c.useSyncExternalStore(c.useCallback(e=>{let t=p?u.subscribe(A.batchCalls(e)):_;return u.updateResult(),t},[u,p]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),c.useEffect(()=>{u.setOptions(o)},[o,u]),Je(o,f))throw Ye(o,u,i);if(Ke({result:f,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw f.error;return o.notifyOnChangeProps?f:u.trackResult(f)}function j(e,t){return Xe(e,Ae,t)}function M(e,t){let n=d(t),[r]=c.useState(()=>new Re(n,e));c.useEffect(()=>{r.setOptions(e)},[r,e]);let i=c.useSyncExternalStore(c.useCallback(e=>r.subscribe(A.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=c.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(_)},[r]);if(i.error&&ue(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Ze=r(`folder-git-2`,[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]),Qe=r(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),$e=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,et=/^[\\/]{2}/;function tt(e,t){return t+e.replace(/\\/g,`/`)}var nt=`popstate`;function rt(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function it(e={}){function t(e,t){let{pathname:n=`/`,search:r=``,hash:i=``}=I(e.location.hash.substring(1));return!n.startsWith(`/`)&&!n.startsWith(`.`)&&(n=`/`+n),st(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){let n=e.document.querySelector(`base`),r=``;if(n&&n.getAttribute(`href`)){let t=e.location.href,n=t.indexOf(`#`);r=n===-1?t:t.slice(0,n)}return r+`#`+(typeof t==`string`?t:F(t))}function r(e,t){P(e.pathname.charAt(0)===`/`,`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)}return ct(t,n,r,e)}function N(e,t){if(e===!1||e==null)throw Error(t)}function P(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function at(){return Math.random().toString(36).substring(2,10)}function ot(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function st(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?I(t):t,state:n,key:t&&t.key||r||at(),mask:i}}function F({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function I(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function ct(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=rt(e)?e:st(h.location,e,t);n&&n(r,e),l=u()+1;let d=ot(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=rt(e)?e:st(h.location,e,t);n&&n(r,e),l=u();let i=ot(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return lt(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(nt,d),c=e,()=>{i.removeEventListener(nt,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function lt(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),N(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:F(t);return i=i.replace(/ $/,`%20`),!n&&et.test(i)&&(i=r+i),new URL(i,r)}function ut(e,t,n=`/`){return dt(e,t,n,!1)}function dt(e,t,n,r,i){let a=R((typeof t==`string`?I(t):t).pathname||`/`,n);if(a==null)return null;let o=i??ft(e),s=null,c=Ot(a);for(let e=0;s==null&&e<o.length;++e)s=Tt(o[e],c,r);return s}function ft(e){let t=pt(e);return ht(t),t}function pt(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;N(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=B([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(N(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),pt(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:Ct(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Dt(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of mt(e.path))a(e,t,!0,n)}),t}function mt(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=mt(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function ht(e){e.sort((e,t)=>e.score===t.score?wt(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var gt=/^:[\w-]+$/,_t=3,vt=2,yt=1,bt=10,xt=-2,St=e=>e===`*`;function Ct(e,t){let n=e.split(`/`),r=n.length;return n.some(St)&&(r+=xt),t&&(r+=vt),n.filter(e=>!St(e)).reduce((e,t)=>e+(gt.test(t)?_t:t===``?yt:bt),r)}function wt(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function Tt(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?Et(u,l,s.matcher,s.compiledParams):L(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=L({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:B([a,d.pathname]),pathnameBase:Ft(B([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=B([a,d.pathnameBase]))}return o}function L(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Dt(e.path,e.caseSensitive,e.end);return Et(e,t,n,r)}function Et(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=V(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=V(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Dt(e,t=!1,n=!0){P(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function Ot(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return P(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function R(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function kt(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?I(e):e,a;return n?(n=Pt(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?At(n.substring(1),`/`):At(n,t)):a=t,{pathname:a,search:It(r),hash:Lt(i)}}function At(e,t){let n=V(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function jt(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Mt(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Nt(e){let t=Mt(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function z(e,t,n,r=!1){let i;typeof e==`string`?i=I(e):(i={...e},N(!i.pathname||!i.pathname.includes(`?`),jt(`?`,`pathname`,`search`,i)),N(!i.pathname||!i.pathname.includes(`#`),jt(`#`,`pathname`,`hash`,i)),N(!i.search||!i.search.includes(`#`),jt(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=kt(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Pt=e=>e.replace(/[\\/]{2,}/g,`/`),B=e=>Pt(e.join(`/`));function V(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var Ft=e=>V(e).replace(/^\/*/,`/`),It=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Lt=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Rt=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function zt(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Bt(e){return B(e.map(e=>e.route.path).filter(Boolean))||`/`}var Vt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Ht(e,t){let n=e;if(typeof n!=`string`||!$e.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Vt)try{let e=new URL(window.location.href),r=et.test(n)?new URL(tt(n,e.protocol)):new URL(n),a=R(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{P(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Ut=new URL(`http://localhost`);function Wt(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),Ut)}catch{return Ut}}function Gt(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function Kt(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function qt(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!Gt(i,n),s=!Gt(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!Kt(e,i)||!Gt(i,a)))throw Error(`External navigation is not allowed`)}var Jt=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Jt);var Yt=[`GET`,...Jt];new Set(Yt);var Xt=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Zt(e){try{return Xt.includes(new URL(e).protocol)}catch{return!1}}var H=c.createContext(null);H.displayName=`DataRouter`;var U=c.createContext(null);U.displayName=`DataRouterState`;var Qt=c.createContext(!1);function $t(){return c.useContext(Qt)}var en=c.createContext({isTransitioning:!1});en.displayName=`ViewTransition`;var tn=c.createContext(new Map);tn.displayName=`Fetchers`;var nn=c.createContext(null);nn.displayName=`Await`;var W=c.createContext(null);W.displayName=`Navigation`;var G=c.createContext(null);G.displayName=`Location`;var K=c.createContext({outlet:null,matches:[],isDataRoute:!1});K.displayName=`Route`;var rn=c.createContext(null);rn.displayName=`RouteError`;var an=`REACT_ROUTER_ERROR`,on=`REDIRECT`,sn=`ROUTE_ERROR_RESPONSE`;function cn(e){if(e.startsWith(`${an}:${on}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function ln(e){if(e.startsWith(`${an}:${sn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Rt(t.status,t.statusText,t.data)}catch{}}function un(e,{relative:t}={}){N(q(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=c.useContext(W),{hash:i,pathname:a,search:o}=Y(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:B([n,a])),r.createHref({pathname:s,search:o,hash:i})}function q(){return c.useContext(G)!=null}function J(){return N(q(),`useLocation() may be used only in the context of a <Router> component.`),c.useContext(G).location}var dn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function fn(e){c.useContext(W).static||c.useLayoutEffect(e)}function pn(){let{isDataRoute:e}=c.useContext(K);return e?jn():mn()}function mn(){N(q(),`useNavigate() may be used only in the context of a <Router> component.`);let e=c.useContext(H),{basename:t,navigator:n}=c.useContext(W),{matches:r}=c.useContext(K),{pathname:i}=J(),a=JSON.stringify(Nt(r)),o=c.useRef(!1);return fn(()=>{o.current=!0}),c.useCallback((r,s={})=>{if(P(o.current,dn),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=z(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:B([t,c.pathname])),qt(typeof r==`string`?r:F(r),n.createHref(c),Wt(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}c.createContext(null);function Y(e,{relative:t}={}){let{matches:n}=c.useContext(K),{pathname:r}=J(),i=JSON.stringify(Nt(n));return c.useMemo(()=>z(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function hn(e,t){return gn(e,t)}function gn(e,t,n){N(q(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=c.useContext(W),{matches:i}=c.useContext(K),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,l=a?a.pathnameBase:`/`,u=a&&a.route;{let e=u&&u.path||``;Nn(s,!u||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-DE3RlOCf.js";import{h as r}from"./button-BrcP8Wxx.js";import{o as i}from"./monaco-DLwhzYMT.js";import{o as a,u as o}from"./brand-Bj6g9sFF.js";import{n as s}from"./client-CQ3EdyuW.js";var c=e(t(),1),l=n(),u=c.createContext(void 0),d=e=>{let t=c.useContext(u);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},f=({client:e,children:t})=>(c.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,l.jsx)(u.Provider,{value:e,children:t})),p={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},m=new class{#e=p;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function h(e){setTimeout(e,0)}var g=typeof window>`u`||`Deno`in globalThis;function _(){}function v(e,t){return typeof e==`function`?e(t):e}function y(e){return typeof e==`number`&&e>=0&&e!==1/0}function b(e,t){return Math.max(e+(t||0)-Date.now(),0)}function x(e,t){return typeof e==`function`?e(t):e}function S(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==w(o,t.options))return!1}else if(!E(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 C(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(T(t.options.mutationKey)!==T(a))return!1}else if(!E(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function w(e,t){return(t?.queryKeyHashFn||T)(e)}function T(e){return JSON.stringify(e,(e,t)=>ne(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function E(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!E(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!E(e[r],t[r]))return!1;return!0}return!1}var ee=Object.prototype.hasOwnProperty;function te(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=O(e)&&O(t);if(!r&&!(ne(e)&&ne(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ee.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=te(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function D(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 O(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ne(e){if(!re(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!re(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function re(e){return Object.prototype.toString.call(e)===`[object Object]`}function ie(e){return new Promise(t=>{m.setTimeout(t,e)})}function ae(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:te(e,t)}function oe(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function se(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ce=Symbol();function le(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ce?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ue(e,t){return typeof e==`function`?e(...t):!!e}function de(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var fe=()=>g,pe=()=>fe(),k=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(){}},me=new class extends k{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},he=h;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 A=ge(),_e=new class extends k{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function ve(e){return Math.min(1e3*2**e,3e4)}function ye(e){return(e??`online`)!==`online`||_e.isOnline()}var be=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function xe(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(_);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new be(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>me.isFocused()&&(e.networkMode===`always`||_e.isOnline())&&e.canRun(),p=()=>ye(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),v=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(pe()?0:3),a=e.retryDelay??ve,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),ie(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):v()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?v():g().then(v),s)}}var Se=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),y(this.gcTime)&&(this.#e=m.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(pe()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(m.clearTimeout(this.#e),this.#e=void 0)}};function Ce(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{de(e,()=>t.signal,()=>n=!0)},u=le(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?se:oe;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Te:we,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:we(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function we(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 Te(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Ee=class extends Se{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=ke(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=ke(this.options);e.data!==void 0&&(this.setState(Oe(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=ae(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(_).catch(_):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>x(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ce||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>x(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!b(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=le(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Ce(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=xe({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof be&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof be){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...De(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Oe(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),A.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function De(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ye(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Oe(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function ke(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Ae=class extends k{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Me(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ne(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ne(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof x(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!D(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Pe(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||x(this.options.enabled,this.#t)!==x(t.enabled,this.#t)||x(this.options.staleTime,this.#t)!==x(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||x(this.options.enabled,this.#t)!==x(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return D(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(_)),t}#h(e){return!pe()&&x(this.options.enabled,this.#t)!==!1&&y(e)}#g(){this.#b();let e=x(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=b(this.#r.dataUpdatedAt,e)+1;this.#u=m.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#f=e,!(this.#f===0||!this.#h(this.#f))&&(this.#d=m.setInterval(()=>{(this.options.refetchIntervalInBackground||me.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(m.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(m.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Me(e,t),o=i&&Pe(e,n,t,r);(a||o)&&(l={...l,...De(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=ae(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=ae(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Fe(e,t),refetch:this.refetch,isEnabled:x(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),D(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();A.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function je(e,t){return x(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||x(t.retryOnMount,e)!==!1)}function Me(e,t){return je(e,t)||e.state.data!==void 0&&Ne(e,t,t.refetchOnMount)}function Ne(e,t,n){if(x(t.enabled,e)!==!1&&x(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Fe(e,t)}return!1}function Pe(e,t,n,r){return(e!==t||x(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Fe(e,n)}function Fe(e,t){return x(t.enabled,e)!==!1&&e.isStaleByTime(x(t.staleTime,e))}var Ie=class extends Se{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Le(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=xe({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),A.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Le(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Re=class extends k{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),D(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&T(t.mutationKey)!==T(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Le();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){A.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},ze=c.createContext(!1),Be=()=>c.useContext(ze);ze.Provider;function Ve(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var He=c.createContext(Ve()),Ue=()=>c.useContext(He),We=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?ue(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Ge=e=>{c.useEffect(()=>{e.clearReset()},[e])},Ke=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||ue(n,[e.error,r])),qe=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Je=(e,t)=>e?.suspense&&t.isPending,Ye=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Xe(e,t,n){let r=Be(),i=Ue(),a=d(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),l=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:l?`optimistic`:void 0,qe(o),We(o,i,s),Ge(i);let[u]=c.useState(()=>new t(a,o)),f=u.getOptimisticResult(o),p=!r&&l;if(c.useSyncExternalStore(c.useCallback(e=>{let t=p?u.subscribe(A.batchCalls(e)):_;return u.updateResult(),t},[u,p]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),c.useEffect(()=>{u.setOptions(o)},[o,u]),Je(o,f))throw Ye(o,u,i);if(Ke({result:f,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw f.error;return o.notifyOnChangeProps?f:u.trackResult(f)}function j(e,t){return Xe(e,Ae,t)}function M(e,t){let n=d(t),[r]=c.useState(()=>new Re(n,e));c.useEffect(()=>{r.setOptions(e)},[r,e]);let i=c.useSyncExternalStore(c.useCallback(e=>r.subscribe(A.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=c.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(_)},[r]);if(i.error&&ue(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Ze=r(`folder-git-2`,[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]),Qe=r(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),$e=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,et=/^[\\/]{2}/;function tt(e,t){return t+e.replace(/\\/g,`/`)}var nt=`popstate`;function rt(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function it(e={}){function t(e,t){let{pathname:n=`/`,search:r=``,hash:i=``}=I(e.location.hash.substring(1));return!n.startsWith(`/`)&&!n.startsWith(`.`)&&(n=`/`+n),st(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){let n=e.document.querySelector(`base`),r=``;if(n&&n.getAttribute(`href`)){let t=e.location.href,n=t.indexOf(`#`);r=n===-1?t:t.slice(0,n)}return r+`#`+(typeof t==`string`?t:F(t))}function r(e,t){P(e.pathname.charAt(0)===`/`,`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)}return ct(t,n,r,e)}function N(e,t){if(e===!1||e==null)throw Error(t)}function P(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function at(){return Math.random().toString(36).substring(2,10)}function ot(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function st(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?I(t):t,state:n,key:t&&t.key||r||at(),mask:i}}function F({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function I(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function ct(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=rt(e)?e:st(h.location,e,t);n&&n(r,e),l=u()+1;let d=ot(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=rt(e)?e:st(h.location,e,t);n&&n(r,e),l=u();let i=ot(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return lt(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(nt,d),c=e,()=>{i.removeEventListener(nt,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function lt(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),N(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:F(t);return i=i.replace(/ $/,`%20`),!n&&et.test(i)&&(i=r+i),new URL(i,r)}function ut(e,t,n=`/`){return dt(e,t,n,!1)}function dt(e,t,n,r,i){let a=R((typeof t==`string`?I(t):t).pathname||`/`,n);if(a==null)return null;let o=i??ft(e),s=null,c=Ot(a);for(let e=0;s==null&&e<o.length;++e)s=Tt(o[e],c,r);return s}function ft(e){let t=pt(e);return ht(t),t}function pt(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;N(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=B([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(N(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),pt(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:Ct(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Dt(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of mt(e.path))a(e,t,!0,n)}),t}function mt(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=mt(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function ht(e){e.sort((e,t)=>e.score===t.score?wt(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var gt=/^:[\w-]+$/,_t=3,vt=2,yt=1,bt=10,xt=-2,St=e=>e===`*`;function Ct(e,t){let n=e.split(`/`),r=n.length;return n.some(St)&&(r+=xt),t&&(r+=vt),n.filter(e=>!St(e)).reduce((e,t)=>e+(gt.test(t)?_t:t===``?yt:bt),r)}function wt(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function Tt(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?Et(u,l,s.matcher,s.compiledParams):L(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=L({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:B([a,d.pathname]),pathnameBase:Ft(B([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=B([a,d.pathnameBase]))}return o}function L(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Dt(e.path,e.caseSensitive,e.end);return Et(e,t,n,r)}function Et(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=V(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=V(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Dt(e,t=!1,n=!0){P(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function Ot(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return P(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function R(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function kt(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?I(e):e,a;return n?(n=Pt(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?At(n.substring(1),`/`):At(n,t)):a=t,{pathname:a,search:It(r),hash:Lt(i)}}function At(e,t){let n=V(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function jt(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Mt(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Nt(e){let t=Mt(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function z(e,t,n,r=!1){let i;typeof e==`string`?i=I(e):(i={...e},N(!i.pathname||!i.pathname.includes(`?`),jt(`?`,`pathname`,`search`,i)),N(!i.pathname||!i.pathname.includes(`#`),jt(`#`,`pathname`,`hash`,i)),N(!i.search||!i.search.includes(`#`),jt(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=kt(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Pt=e=>e.replace(/[\\/]{2,}/g,`/`),B=e=>Pt(e.join(`/`));function V(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var Ft=e=>V(e).replace(/^\/*/,`/`),It=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Lt=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Rt=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function zt(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Bt(e){return B(e.map(e=>e.route.path).filter(Boolean))||`/`}var Vt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Ht(e,t){let n=e;if(typeof n!=`string`||!$e.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Vt)try{let e=new URL(window.location.href),r=et.test(n)?new URL(tt(n,e.protocol)):new URL(n),a=R(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{P(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Ut=new URL(`http://localhost`);function Wt(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),Ut)}catch{return Ut}}function Gt(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function Kt(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function qt(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!Gt(i,n),s=!Gt(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!Kt(e,i)||!Gt(i,a)))throw Error(`External navigation is not allowed`)}var Jt=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Jt);var Yt=[`GET`,...Jt];new Set(Yt);var Xt=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Zt(e){try{return Xt.includes(new URL(e).protocol)}catch{return!1}}var H=c.createContext(null);H.displayName=`DataRouter`;var Qt=c.createContext(null);Qt.displayName=`DataRouterState`;var $t=c.createContext(!1);function en(){return c.useContext($t)}var tn=c.createContext({isTransitioning:!1});tn.displayName=`ViewTransition`;var nn=c.createContext(new Map);nn.displayName=`Fetchers`;var rn=c.createContext(null);rn.displayName=`Await`;var U=c.createContext(null);U.displayName=`Navigation`;var W=c.createContext(null);W.displayName=`Location`;var G=c.createContext({outlet:null,matches:[],isDataRoute:!1});G.displayName=`Route`;var an=c.createContext(null);an.displayName=`RouteError`;var on=`REACT_ROUTER_ERROR`,sn=`REDIRECT`,cn=`ROUTE_ERROR_RESPONSE`;function ln(e){if(e.startsWith(`${on}:${sn}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function un(e){if(e.startsWith(`${on}:${cn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Rt(t.status,t.statusText,t.data)}catch{}}function dn(e,{relative:t}={}){N(K(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=c.useContext(U),{hash:i,pathname:a,search:o}=J(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:B([n,a])),r.createHref({pathname:s,search:o,hash:i})}function K(){return c.useContext(W)!=null}function q(){return N(K(),`useLocation() may be used only in the context of a <Router> component.`),c.useContext(W).location}var fn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function pn(e){c.useContext(U).static||c.useLayoutEffect(e)}function mn(){let{isDataRoute:e}=c.useContext(G);return e?Mn():hn()}function hn(){N(K(),`useNavigate() may be used only in the context of a <Router> component.`);let e=c.useContext(H),{basename:t,navigator:n}=c.useContext(U),{matches:r}=c.useContext(G),{pathname:i}=q(),a=JSON.stringify(Nt(r)),o=c.useRef(!1);return pn(()=>{o.current=!0}),c.useCallback((r,s={})=>{if(P(o.current,fn),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=z(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:B([t,c.pathname])),qt(typeof r==`string`?r:F(r),n.createHref(c),Wt(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}c.createContext(null);function J(e,{relative:t}={}){let{matches:n}=c.useContext(G),{pathname:r}=q(),i=JSON.stringify(Nt(n));return c.useMemo(()=>z(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function gn(e,t){return _n(e,t)}function _n(e,t,n){N(K(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=c.useContext(U),{matches:i}=c.useContext(G),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,l=a?a.pathnameBase:`/`,u=a&&a.route;{let e=u&&u.path||``;Pn(s,!u||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
2
2
|
|
|
3
|
-
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let d=J(),f;if(t){let e=typeof t==`string`?I(t):t;N(l===`/`||e.pathname?.startsWith(l),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${l}" but pathname "${e.pathname}" was given in the \`location\` prop.`),f=e}else f=d;let p=f.pathname||`/`,m=p;if(l!==`/`){let e=l.replace(/^\//,``).split(`/`);m=`/`+p.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let h=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):ut(e,{pathname:m});P(u||h!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),P(h==null||h[h.length-1].route.element!==void 0||h[h.length-1].route.Component!==void 0||h[h.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let g=Cn(h&&h.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:B([l,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?l:B([l,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&g?c.createElement(G.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...f},navigationType:`POP`}},g):g}function _n(){let e=An(),t=zt(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=c.createElement(c.Fragment,null,c.createElement(`p`,null,`💿 Hey developer 👋`),c.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,c.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,c.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),c.createElement(c.Fragment,null,c.createElement(`h2`,null,`Unexpected Application Error!`),c.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?c.createElement(`pre`,{style:i},n):null,o)}var vn=c.createElement(_n,null),yn=class extends c.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=ln(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:c.createElement(K.Provider,{value:this.props.routeContext},c.createElement(rn.Provider,{value:e,children:this.props.component}));return this.context?c.createElement(xn,{error:e},t):t}};yn.contextType=Qt;var bn=new WeakMap;function xn({children:e,error:t}){let{basename:n,navigator:r}=c.useContext(W);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=cn(t.digest);if(e){let i=bn.get(t);if(i)throw i;let a=Ht(e.location,n),o=a.absoluteURL||a.to;if(qt(e.location,o,Wt(r),`allow-explicit`),Zt(o))throw Error(`Invalid redirect location`);if(Vt&&!bn.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw bn.set(t,n),n}}return c.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function Sn({routeContext:e,match:t,children:n}){let r=c.useContext(H);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),c.createElement(K.Provider,{value:e},n)}function Cn(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);N(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let l=n?.onError,u=r&&l?(e,t)=>{l(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Bt(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,l)=>{let d,f=!1,p=null,m=null;r&&(d=a&&n.route.id?a[n.route.id]:void 0,p=n.route.errorElement||vn,o&&(s<0&&l===0?(Nn(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,m=null):s===l&&(f=!0,m=n.route.hydrateFallbackElement||null)));let h=t.concat(i.slice(0,l+1)),g=()=>{let t;return t=d?p:f?m:n.route.Component?c.createElement(n.route.Component,null):n.route.element?n.route.element:e,c.createElement(Sn,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||l===0)?c.createElement(yn,{location:r.location,revalidation:r.revalidation,component:p,error:d,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:u}):g()},null)}function wn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Tn(e){let t=c.useContext(H);return N(t,wn(e)),t}function En(e){let t=c.useContext(U);return N(t,wn(e)),t}function Dn(e){let t=c.useContext(K);return N(t,wn(e)),t}function On(e){let t=Dn(e),n=t.matches[t.matches.length-1];return N(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function kn(){return On(`useRouteId`)}function An(){let e=c.useContext(rn),t=En(`useRouteError`),n=On(`useRouteError`);return e===void 0?t.errors?.[n]:e}function jn(){let{router:e}=Tn(`useNavigate`),t=On(`useNavigate`),n=c.useRef(!1);return fn(()=>{n.current=!0}),c.useCallback(async(r,i={})=>{P(n.current,dn),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Mn={};function Nn(e,t,n){!t&&!Mn[e]&&(Mn[e]=!0,P(!1,n))}c.memo(Pn);function Pn({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return gn(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Fn({to:e,replace:t,state:n,relative:r}){N(q(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i,navigator:a}=c.useContext(W);P(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:o}=c.useContext(K),{pathname:s}=J(),l=pn(),u=z(e,Nt(o),s,r===`path`);qt(typeof e==`string`?e:F(e),a.createHref(u),Wt(a),`reject`);let d=JSON.stringify(u);return c.useEffect(()=>{l(JSON.parse(d),{replace:t,state:n,relative:r})},[l,d,r,t,n]),null}function In(e){N(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Ln({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){N(!q(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),l=c.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=I(n));let{pathname:u=`/`,search:d=``,hash:f=``,state:p=null,key:m=`default`,mask:h}=n,g=c.useMemo(()=>{let e=R(u,s);return e==null?null:{location:{pathname:e,search:d,hash:f,state:p,key:m,mask:h},navigationType:r}},[s,u,d,f,p,m,r,h]);return P(g!=null,`<Router basename="${s}"> is not able to match the URL "${u}${d}${f}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:c.createElement(W.Provider,{value:l},c.createElement(G.Provider,{children:t,value:g}))}function Rn({children:e,location:t}){return hn(zn(e),t)}c.Component;function zn(e,t=[]){let n=[];return c.Children.forEach(e,(e,r)=>{if(!c.isValidElement(e))return;let i=[...t,r];if(e.type===c.Fragment){n.push.apply(n,zn(e.props.children,i));return}N(e.type===In,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),N(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=zn(e.props.children,i)),n.push(a)}),n}var Bn=`get`,Vn=`application/x-www-form-urlencoded`;function Hn(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Un(e){return Hn(e)&&e.tagName.toLowerCase()===`button`}function Wn(e){return Hn(e)&&e.tagName.toLowerCase()===`form`}function Gn(e){return Hn(e)&&e.tagName.toLowerCase()===`input`}function Kn(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function qn(e,t){return e.button===0&&(!t||t===`_self`)&&!Kn(e)}function Jn(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Yn(e,t){let n=Jn(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Xn=null;function Zn(){if(Xn===null)try{new FormData(document.createElement(`form`),0),Xn=!1}catch{Xn=!0}return Xn}var Qn=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function $n(e){return e!=null&&!Qn.has(e)?(P(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Vn}"`),null):e}function er(e,t){let n,r,i,a,o;if(Wn(e)){let o=e.getAttribute(`action`);r=o?R(o,t):null,n=e.getAttribute(`method`)||Bn,i=$n(e.getAttribute(`enctype`))||Vn,a=new FormData(e)}else if(Un(e)||Gn(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?R(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Bn,i=$n(e.getAttribute(`formenctype`))||$n(o.getAttribute(`enctype`))||Vn,a=new FormData(o,e),!Zn()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Hn(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Bn,r=null,i=Vn,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function tr(e,t){if(e===!1||e==null)throw Error(t)}function nr(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return i.pathname=n?i.pathname.endsWith(`/`)?`${i.pathname}_.${r}`:`${i.pathname}.${r}`:i.pathname===`/`?`_root.${r}`:t&&R(i.pathname,t)===`/`?`${V(t)}/_root.${r}`:`${V(i.pathname)}.${r}`,i}async function rr(e,t){if(e.id in t)return t[e.id];try{let n=await i(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function ir(e){return e!=null&&typeof e.page==`string`}function ar(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function or(e,t,n){return dr((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await rr(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(ar).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function sr(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function cr(e,t,{includeHydrateFallback:n}={}){return lr(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function lr(e){return[...new Set(e)]}function ur(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function dr(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!ir(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(ur(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function fr(){let e=c.useContext(H);return tr(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function pr(){let e=c.useContext(U);return tr(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var mr=c.createContext(void 0);mr.displayName=`FrameworkContext`;function hr(){let e=c.useContext(mr);return tr(e,`You must render this element inside a <HydratedRouter> element`),e}function gr(e,t){let n=c.useContext(mr),[r,i]=c.useState(!1),[a,o]=c.useState(!1),{onFocus:s,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=c.useRef(null);c.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),c.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let m=()=>{i(!0)},h=()=>{i(!1),o(!1)};return n?e===`intent`?[a,p,{onFocus:X(s,m),onBlur:X(l,h),onMouseEnter:X(u,m),onMouseLeave:X(d,h),onTouchStart:X(f,m)}]:[a,p,{}]:[!1,p,{}]}function X(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function _r({page:e,...t}){let n=$t(),{nonce:r}=hr(),{router:i}=fr(),a=c.useMemo(()=>ut(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?c.createElement(yr,{page:e,matches:a,...t}):c.createElement(br,{page:e,matches:a,...t})):null}function vr(e){let{manifest:t,routeModules:n}=hr(),[r,i]=c.useState([]);return c.useEffect(()=>{let r=!1;return or(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function yr({page:e,matches:t,...n}){let r=J(),{future:i}=hr(),{basename:a}=fr(),o=c.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=nr(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return c.createElement(c.Fragment,null,o.map(e=>c.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function br({page:e,matches:t,...n}){let r=J(),{future:i,manifest:a,routeModules:o}=hr(),{basename:s}=fr(),{loaderData:l,matches:u}=pr(),d=c.useMemo(()=>sr(e,t,u,a,r,`data`),[e,t,u,a,r]),f=c.useMemo(()=>sr(e,t,u,a,r,`assets`),[e,t,u,a,r]),p=c.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,c=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!d.some(t=>t.route.id===e.route.id)&&e.route.id in l&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?c=!0:n.add(e.route.id))}),n.size===0)return[];let u=nr(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return c&&n.size>0&&u.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[u.pathname+u.search]},[s,i.v8_trailingSlashAwareDataRequests,l,r,a,d,t,e,o]),m=c.useMemo(()=>cr(f,a),[f,a]),h=vr(f);return c.createElement(c.Fragment,null,p.map(e=>c.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),m.map(e=>c.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),h.map(({key:e,link:t})=>c.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function xr(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}c.Component;var Sr=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Sr&&(window.__reactRouterVersion=`7.18.3`)}catch{}function Cr({basename:e,children:t,useTransitions:n,window:r}){let i=c.useRef();i.current??=it({window:r,v5Compat:!0});let a=i.current,[o,s]=c.useState({action:a.action,location:a.location}),l=c.useCallback(e=>{n===!1?s(e):c.startTransition(()=>s(e))},[n]);return c.useLayoutEffect(()=>a.listen(l),[a,l]),c.createElement(Ln,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}var wr=c.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:l,to:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p,...m},h){let{basename:g,navigator:_,useTransitions:v}=c.useContext(W),y=typeof u==`string`&&$e.test(u),b=Ht(u,g);u=b.to;let x=un(u,{relative:r}),S=J(),C=null;if(o){let e=z(o,[],S.mask?S.mask.pathname:`/`,!0);g!==`/`&&(e.pathname=e.pathname===`/`?g:B([g,e.pathname])),C=_.createHref(e)}let[w,T,E]=gr(n,m),ee=kr(u,{replace:a,mask:o,state:s,target:l,preventScrollReset:d,relative:r,viewTransition:f,defaultShouldRevalidate:p,useTransitions:v});function te(t){e&&e(t),t.defaultPrevented||ee(t)}let D=!(b.isExternal||i),O=c.createElement(`a`,{...m,...E,href:(D?C:void 0)||b.absoluteURL||x,onClick:D?te:e,ref:xr(h,T),target:l,"data-discover":!y&&t===`render`?`true`:void 0});return w&&!y?c.createElement(c.Fragment,null,O,c.createElement(_r,{page:x})):O});wr.displayName=`Link`;var Tr=c.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...l},u){let d=Y(a,{relative:l.relative}),f=J(),p=c.useContext(U),{navigator:m,basename:h}=c.useContext(W),g=p!=null&&Fr(d)&&o===!0,_=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,v=f.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=R(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!r&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!r&&y.startsWith(_)&&y.charAt(_.length)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return c.createElement(wr,{...l,"aria-current":w,className:T,ref:u,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});Tr.displayName=`NavLink`;var Er=c.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Bn,action:s,onSubmit:l,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p,...m},h)=>{let{useTransitions:g}=c.useContext(W),_=Nr(),v=Pr(s,{relative:u}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&$e.test(s);return c.createElement(`form`,{ref:h,method:y,action:v,onSubmit:r?l:e=>{if(l&&l(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,m=()=>_(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p});g&&n!==!1?c.startTransition(()=>m()):m()},...m,"data-discover":!b&&e===`render`?`true`:void 0})});Er.displayName=`Form`;function Dr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Or(e){let t=c.useContext(H);return N(t,Dr(e)),t}function kr(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:l,useTransitions:u}={}){let d=pn(),f=J(),p=Y(e,{relative:o});return c.useCallback(m=>{if(qn(m,t)){m.preventDefault();let t=n===void 0?F(f)===F(p):n,h=()=>d(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:l});u?c.startTransition(()=>h()):h()}},[f,d,p,n,r,i,t,e,a,o,s,l,u])}function Ar(e){P(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=c.useRef(Jn(e)),n=c.useRef(!1),r=J(),i=c.useMemo(()=>Yn(r.search,n.current?null:t.current),[r.search]),a=pn();return[i,c.useCallback((e,t)=>{let r=Jn(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var jr=0,Mr=()=>`__${String(++jr)}__`;function Nr(){let{router:e}=Or(`useSubmit`),{basename:t}=c.useContext(W),n=kn(),r=e.fetch,i=e.navigate;return c.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=er(e,t);if(a.navigate===!1){let e=a.fetcherKey||Mr();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Pr(e,{relative:t}={}){let{basename:n}=c.useContext(W),r=c.useContext(K);N(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Y(e||`.`,{relative:t})},o=J();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:B([n,a.pathname])),F(a)}function Fr(e,{relative:t}={}){let n=c.useContext(en);N(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Or(`useViewTransitionState`),i=Y(e,{relative:t});if(!n.isTransitioning)return!1;let a=R(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=R(n.nextLocation.pathname,r)||n.nextLocation.pathname;return L(i.pathname,o)!=null||L(i.pathname,a)!=null}var Z={isOpen:!1,isMinimized:!1,isMaximized:!1,openTabs:[],activeTab:null,splitTab:null,splitRatio:50,position:null,size:{width:560,height:680},drafts:{},modes:{},harnesses:{},terminalLaunches:{}};function Ir(){try{let e=localStorage.getItem(a)??localStorage.getItem(o);if(!e)return Z;let t=JSON.parse(e);return{drafts:{},harnesses:Object.fromEntries(Object.entries(t.harnesses??{}).filter(([,e])=>typeof e==`string`)),terminalLaunches:{},modes:Object.fromEntries(Object.entries(t.modes??{}).filter(([,e])=>e===`cli`||e===`chat`)),isOpen:typeof t.isOpen==`boolean`?t.isOpen:Z.isOpen,isMinimized:typeof t.isMinimized==`boolean`?t.isMinimized:Z.isMinimized,isMaximized:typeof t.isMaximized==`boolean`?t.isMaximized:Z.isMaximized,openTabs:Array.isArray(t.openTabs)?t.openTabs.filter(e=>typeof e==`string`):[],activeTab:typeof t.activeTab==`string`?t.activeTab:null,splitTab:typeof t.splitTab==`string`&&t.splitTab!==t.activeTab?t.splitTab:null,splitRatio:typeof t.splitRatio==`number`&&Number.isFinite(t.splitRatio)?Math.max(25,Math.min(75,t.splitRatio)):50,position:t.position&&typeof t.position.x==`number`&&typeof t.position.y==`number`?{x:t.position.x,y:t.position.y}:null,size:t.size&&typeof t.size.width==`number`&&typeof t.size.height==`number`?{width:Math.max(380,Math.min(t.size.width,window.innerWidth||1200)),height:Math.max(420,Math.min(t.size.height,window.innerHeight||900))}:Z.size}}catch{return Z}}var Lr=Ir(),Rr=new Set;function zr(){try{localStorage.setItem(a,JSON.stringify({...Lr,terminalLaunches:{},drafts:{}}))}catch{}for(let e of Rr)e()}function Q(e){Lr=e(Lr),zr()}var $={getState:()=>Lr,subscribe:e=>(Rr.add(e),()=>Rr.delete(e)),openTerminal:(e,t=`shell`,n,r)=>{$.open(e),$.setHarness(e,t),Q(i=>({...i,modes:{...i.modes,[e]:`cli`},terminalLaunches:{...i.terminalLaunches,[e]:{id:crypto.randomUUID(),target:t,sessionId:n,cwd:r}}}))},consumeTerminalLaunch:(e,t)=>{Q(n=>{if(n.terminalLaunches[e]?.id!==t)return n;let r={...n.terminalLaunches};return delete r[e],{...n,terminalLaunches:r}})},setMode:(e,t)=>Q(n=>({...n,modes:{...n.modes,[e]:t}})),setHarness:(e,t)=>Q(n=>({...n,harnesses:{...n.harnesses,[e]:t}})),openDraft:(e,t)=>{$.open(e),$.setMode(e,`chat`),Q(n=>({...n,drafts:{...n.drafts,[e]:{id:crypto.randomUUID(),text:t}}}))},consumeDraft:(e,t)=>{Q(n=>{if(n.drafts[e]?.id!==t)return n;let r={...n.drafts};return delete r[e],{...n,drafts:r}})},openCli:e=>$.open(e,`cli`),open:(e,t)=>{Q(n=>{let r=[...n.openTabs],i=n.activeTab;return e?(r.includes(e)||r.push(e),i=e):!i&&r.length>0&&(i=r[0]),{...n,isOpen:!0,isMinimized:!1,openTabs:r,activeTab:i,modes:e&&t?{...n.modes,[e]:t}:n.modes,splitTab:i===n.splitTab?n.activeTab:n.splitTab}})},close:()=>{Q(e=>({...e,isOpen:!1,isMinimized:!1}))},minimize:()=>{Q(e=>({...e,isMinimized:!0}))},restore:()=>{Q(e=>({...e,isOpen:!0,isMinimized:!1}))},toggleMaximize:()=>{Q(e=>({...e,isMaximized:!e.isMaximized,isMinimized:!1}))},addTab:e=>{Q(t=>{let n=t.openTabs.includes(e)?t.openTabs:[...t.openTabs,e];return{...t,isOpen:!0,isMinimized:!1,openTabs:n,activeTab:e,splitTab:e===t.splitTab?t.activeTab:t.splitTab}})},removeTab:e=>{Q(t=>{let n=t.openTabs.filter(t=>t!==e),r=t.activeTab;return r===e&&(r=n.find(e=>e!==t.splitTab)??n[0]??null),{...t,openTabs:n,activeTab:r,splitTab:e===t.splitTab||r===t.splitTab?null:t.splitTab,isOpen:n.length>0&&t.isOpen}})},setActiveTab:e=>{Q(t=>t.openTabs.includes(e)?{...t,activeTab:e,splitTab:e===t.splitTab?t.activeTab:t.splitTab,isMinimized:!1}:t)},setSplitTab:e=>{Q(t=>{if(e===t.activeTab)return t;let n=e&&!t.openTabs.includes(e)?[...t.openTabs,e]:t.openTabs;return{...t,openTabs:n,splitTab:e,isMaximized:e?!0:t.isMaximized}})},setSplitRatio:e=>Q(t=>({...t,splitRatio:Math.max(25,Math.min(75,e))})),setPosition:e=>{Q(t=>({...t,position:e}))},setSize:e=>{Q(t=>({...t,size:{width:Math.max(380,Math.min(e.width,window.innerWidth||1200)),height:Math.max(420,Math.min(e.height,window.innerHeight||900))}}))}};function Br(){return{...(0,c.useSyncExternalStore)($.subscribe,$.getState,()=>Z),...$}}function Vr(){return j({queryKey:[`config`],queryFn:()=>s(`/api/config`)})}function Hr(){return j({queryKey:[`workspaces`],queryFn:()=>s(`/api/workspaces`)})}function Ur(e={}){return j({queryKey:[`workspaces-status`],queryFn:()=>s(`/api/workspaces/status`),enabled:e.enabled??!0,refetchInterval:e.intervalMs??!1})}function Wr(){return j({queryKey:[`domain-packs`],queryFn:async()=>(await s(`/api/enterprise/domain-packs`))?.domainPacks??[]})}function Gr(){let e=d();return M({mutationFn:e=>s(`/api/enterprise/domain-packs`,{method:`POST`,body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:[`domain-packs`]}),e.invalidateQueries({queryKey:[`workspace-domain-packs`]})}})}function Kr(){let e=d();return M({mutationFn:e=>s(`/api/enterprise/domain-packs/${encodeURIComponent(e.id)}`,{method:`PUT`,body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:[`domain-packs`]}),e.invalidateQueries({queryKey:[`workspace-domain-packs`]})}})}function qr(){let e=d();return M({mutationFn:e=>s(`/api/enterprise/domain-packs/${encodeURIComponent(e)}`,{method:`DELETE`}),onSuccess:()=>{e.invalidateQueries({queryKey:[`domain-packs`]}),e.invalidateQueries({queryKey:[`workspace-domain-packs`]})}})}function Jr(){let e=d();return M({mutationFn:e=>s(`/api/workspace`,{method:`POST`,body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:[`workspaces`]}),e.invalidateQueries({queryKey:[`workspaces-status`]})}})}function Yr(){return j({queryKey:[`projects`],queryFn:()=>s(`/api/projects`)})}function Xr(){let e=d();return M({mutationFn:e=>s(`/api/projects`,{method:`POST`,body:JSON.stringify(e)}),onSuccess:()=>e.invalidateQueries({queryKey:[`projects`]})})}function Zr(){let e=d();return M({mutationFn:({id:e,...t})=>s(`/api/projects/${encodeURIComponent(e)}`,{method:`PUT`,body:JSON.stringify(t)}),onSuccess:()=>e.invalidateQueries({queryKey:[`projects`]})})}function Qr(){let e=d();return M({mutationFn:e=>s(`/api/projects/${encodeURIComponent(e)}`,{method:`DELETE`}),onSuccess:()=>e.invalidateQueries({queryKey:[`projects`]})})}function $r(){return j({queryKey:[`repos`],queryFn:()=>s(`/api/repos`)})}function ei(e,t){return j({queryKey:[`repo-branches`,e],queryFn:()=>s(`/api/repos/branches?path=${encodeURIComponent(e)}`),enabled:t,staleTime:6e4})}function ti(e,t=!0){return j({queryKey:[`repos-freshness`,e],queryFn:()=>s(`/api/repos/freshness`,{method:`POST`,body:JSON.stringify({repos:e})}),enabled:t&&e.length>0,staleTime:3e4})}function ni(){let e=d();return M({mutationFn:e=>s(`/api/repos/pull`,{method:`POST`,body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:[`repo-freshness`]}),e.invalidateQueries({queryKey:[`repos-freshness`]})}})}function ri(){let e=d();return M({mutationFn:e=>s(`/api/repos/new`,{method:`POST`,body:JSON.stringify({name:e})}),onSuccess:()=>e.invalidateQueries({queryKey:[`repos`]})})}function ii(){return j({queryKey:[`ai-detect`],queryFn:()=>s(`/api/ai-detect`),staleTime:6e4})}function ai(){return j({queryKey:[`editor-detect`],queryFn:()=>s(`/api/editor-detect`),staleTime:6e4})}function oi(){return j({queryKey:[`workspace-launch-targets`],queryFn:()=>s(`/api/workspace-launch-targets`),staleTime:6e4})}function si(e,t){return j({queryKey:[`workspace-recent-sessions`,e],queryFn:async()=>{let t=new URLSearchParams({limit:`3`,desktopHandoffOnly:`true`});return(await s(`/api/workspace/${encodeURIComponent(e)}/sessions?${t}`)).sessions},enabled:t,staleTime:3e4})}function ci(){return j({queryKey:[`workflow-templates`],queryFn:async()=>(await s(`/api/workflows/templates`)).templates})}function li(e){return j({queryKey:[`workspace-services`,e],queryFn:()=>s(`/api/workspace/${encodeURIComponent(e)}/services`),enabled:!!e,refetchInterval:3e3,retry:1})}function ui(e){let t=d();return M({mutationFn:({action:t,service:n})=>{let r=`/api/workspace/${encodeURIComponent(e)}/services`,i=n?`${r}/${encodeURIComponent(n)}/${t}`:`${r}/${t}`;return s(i,{method:`POST`})},onSettled:()=>{t.invalidateQueries({queryKey:[`workspace-services`,e]}),t.invalidateQueries({queryKey:[`workspaces-status`]})}})}function di(e){let t=d();return M({mutationFn:({action:t,id:n})=>s(`/api/workspace/${encodeURIComponent(e)}/orchestrators/${t}`,{method:`POST`,body:JSON.stringify({id:n})}),onSettled:()=>{t.invalidateQueries({queryKey:[`workspace-services`,e]}),t.invalidateQueries({queryKey:[`workspaces-status`]})}})}function fi(){return j({queryKey:[`skill-categories`],queryFn:async()=>(await s(`/api/skills/categories`)).categories})}function pi(){let e=d();return M({mutationFn:e=>s(`/api/skills/categories`,{method:`POST`,body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:[`skill-categories`]}),e.invalidateQueries({queryKey:[`skills`]})}})}function mi(){let e=d();return M({mutationFn:e=>s(`/api/skills/categories/${encodeURIComponent(e)}`,{method:`DELETE`}),onSuccess:()=>{e.invalidateQueries({queryKey:[`skill-categories`]}),e.invalidateQueries({queryKey:[`skills`]})}})}function hi(e){return{queryKey:[`skills`,e],queryFn:()=>s(e?`/api/skills?workspace=${encodeURIComponent(e)}`:`/api/skills`)}}function gi(e){return j({...hi(e),select:e=>e.diagnostics??[]})}function _i(e){return j({...hi(e),select:e=>e.skills})}function vi(){let e=d();return M({mutationFn:e=>s(`/api/skills`,{method:`POST`,body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:[`skills`]}),e.invalidateQueries({queryKey:[`skill-categories`]}),e.invalidateQueries({queryKey:[`workspace-skills`]})}})}function yi(){let e=d();return M({mutationFn:e=>{let t=typeof e==`string`?e:e.id,n=typeof e==`string`?void 0:e.workspaceId,r=n?`/api/skills/${encodeURIComponent(t)}?workspace=${encodeURIComponent(n)}`:`/api/skills/${encodeURIComponent(t)}`;return s(r,{method:`DELETE`})},onSuccess:()=>{e.invalidateQueries({queryKey:[`skills`]}),e.invalidateQueries({queryKey:[`workspace-skills`]})}})}function bi(){return j({queryKey:[`codex-agents`],queryFn:async()=>(await s(`/api/agents`)).agents})}function xi(){let e=d();return M({mutationFn:e=>s(`/api/agents`,{method:`POST`,body:JSON.stringify(e)}),onSuccess:()=>e.invalidateQueries({queryKey:[`codex-agents`]})})}function Si(){let e=d();return M({mutationFn:({toml:e,category:t})=>s(`/api/agents/import`,{method:`POST`,body:JSON.stringify({toml:e,category:t})}),onSuccess:()=>e.invalidateQueries({queryKey:[`codex-agents`]})})}function Ci(){let e=d();return M({mutationFn:e=>s(`/api/agents/${encodeURIComponent(e)}`,{method:`DELETE`}),onSuccess:()=>e.invalidateQueries({queryKey:[`codex-agents`]})})}function wi(e){return j({queryKey:[`workspace-skills`,e],queryFn:async()=>(await s(`/api/skills/workspace/${encodeURIComponent(e)}`)).config,enabled:!!e})}function Ti(){let e=d();return M({mutationFn:({workspaceId:e,expectedRevision:t,...n})=>s(`/api/skills/workspace/${encodeURIComponent(e)}/assign`,{method:`POST`,body:JSON.stringify({...n,expectedRevision:t})}),onSuccess:(t,n)=>{e.setQueryData([`workspace-skills`,n.workspaceId],t.config),e.invalidateQueries({queryKey:[`skills`]})}})}function Ei(){return M({mutationFn:async({workspaceId:e,...t})=>t.assistant?($.openTerminal(e,t.assistant,t.sessionId,t.cwd),{success:!0,command:t.assistant}):s(`/api/workspace/${encodeURIComponent(e)}/terminal`,{method:`POST`,body:JSON.stringify(t)})})}function Di(){let e=d();return M({mutationFn:({workspaceId:e,force:t})=>s(`/api/workspace/${encodeURIComponent(e)}/refresh`,{method:`POST`,body:JSON.stringify({force:t})}),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:[`workspaces`]}),e.invalidateQueries({queryKey:[`workspace-skills`,n.workspaceId]}),e.invalidateQueries({queryKey:[`skills`,n.workspaceId]}),e.invalidateQueries({queryKey:[`workspaces-status`]})}})}function Oi(e){return j({queryKey:[`workspace-lifecycle`,e],queryFn:async()=>await s(`/api/workspace/${encodeURIComponent(e)}/lifecycle`),enabled:!!e,staleTime:1e4})}export{Qe as $,fi as A,Hr as B,$r as C,vi as D,Kr as E,oi as F,wr as G,$ as H,Oi as I,In as J,Tr as K,si as L,_i as M,Zr as N,pi as O,ci as P,Ar as Q,li as R,ei as S,xi as T,Br as U,Ur as V,Cr as W,J as X,Rn as Y,pn as Z,Ei as _,f as _t,Gr as a,A as at,ni as b,Jr as c,v as ct,Qr as d,C as dt,Ze as et,yi as f,S as ft,Si as g,ce as gt,ai as h,x as ht,Vr as i,_e as it,gi as j,ui as k,Ci as l,T as lt,Wr as m,E as mt,ii as n,Ie as nt,Xr as o,me as ot,mi as p,_ as pt,Fn as q,Ti as r,Ee as rt,ri as s,k as st,bi as t,j as tt,qr as u,w as ut,di as v,d as vt,ti as w,Di as x,Yr as y,wi as z};
|
|
3
|
+
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let d=q(),f;if(t){let e=typeof t==`string`?I(t):t;N(l===`/`||e.pathname?.startsWith(l),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${l}" but pathname "${e.pathname}" was given in the \`location\` prop.`),f=e}else f=d;let p=f.pathname||`/`,m=p;if(l!==`/`){let e=l.replace(/^\//,``).split(`/`);m=`/`+p.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let h=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):ut(e,{pathname:m});P(u||h!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),P(h==null||h[h.length-1].route.element!==void 0||h[h.length-1].route.Component!==void 0||h[h.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let g=wn(h&&h.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:B([l,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?l:B([l,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&g?c.createElement(W.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...f},navigationType:`POP`}},g):g}function vn(){let e=jn(),t=zt(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=c.createElement(c.Fragment,null,c.createElement(`p`,null,`💿 Hey developer 👋`),c.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,c.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,c.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),c.createElement(c.Fragment,null,c.createElement(`h2`,null,`Unexpected Application Error!`),c.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?c.createElement(`pre`,{style:i},n):null,o)}var yn=c.createElement(vn,null),bn=class extends c.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=un(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:c.createElement(G.Provider,{value:this.props.routeContext},c.createElement(an.Provider,{value:e,children:this.props.component}));return this.context?c.createElement(Sn,{error:e},t):t}};bn.contextType=$t;var xn=new WeakMap;function Sn({children:e,error:t}){let{basename:n,navigator:r}=c.useContext(U);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=ln(t.digest);if(e){let i=xn.get(t);if(i)throw i;let a=Ht(e.location,n),o=a.absoluteURL||a.to;if(qt(e.location,o,Wt(r),`allow-explicit`),Zt(o))throw Error(`Invalid redirect location`);if(Vt&&!xn.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw xn.set(t,n),n}}return c.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function Cn({routeContext:e,match:t,children:n}){let r=c.useContext(H);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),c.createElement(G.Provider,{value:e},n)}function wn(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);N(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let l=n?.onError,u=r&&l?(e,t)=>{l(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Bt(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,l)=>{let d,f=!1,p=null,m=null;r&&(d=a&&n.route.id?a[n.route.id]:void 0,p=n.route.errorElement||yn,o&&(s<0&&l===0?(Pn(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,m=null):s===l&&(f=!0,m=n.route.hydrateFallbackElement||null)));let h=t.concat(i.slice(0,l+1)),g=()=>{let t;return t=d?p:f?m:n.route.Component?c.createElement(n.route.Component,null):n.route.element?n.route.element:e,c.createElement(Cn,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||l===0)?c.createElement(bn,{location:r.location,revalidation:r.revalidation,component:p,error:d,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:u}):g()},null)}function Tn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function En(e){let t=c.useContext(H);return N(t,Tn(e)),t}function Dn(e){let t=c.useContext(Qt);return N(t,Tn(e)),t}function On(e){let t=c.useContext(G);return N(t,Tn(e)),t}function kn(e){let t=On(e),n=t.matches[t.matches.length-1];return N(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function An(){return kn(`useRouteId`)}function jn(){let e=c.useContext(an),t=Dn(`useRouteError`),n=kn(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Mn(){let{router:e}=En(`useNavigate`),t=kn(`useNavigate`),n=c.useRef(!1);return pn(()=>{n.current=!0}),c.useCallback(async(r,i={})=>{P(n.current,fn),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Nn={};function Pn(e,t,n){!t&&!Nn[e]&&(Nn[e]=!0,P(!1,n))}c.memo(Fn);function Fn({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return _n(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function In({to:e,replace:t,state:n,relative:r}){N(K(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i,navigator:a}=c.useContext(U);P(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:o}=c.useContext(G),{pathname:s}=q(),l=mn(),u=z(e,Nt(o),s,r===`path`);qt(typeof e==`string`?e:F(e),a.createHref(u),Wt(a),`reject`);let d=JSON.stringify(u);return c.useEffect(()=>{l(JSON.parse(d),{replace:t,state:n,relative:r})},[l,d,r,t,n]),null}function Ln(e){N(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Rn({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){N(!K(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),l=c.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=I(n));let{pathname:u=`/`,search:d=``,hash:f=``,state:p=null,key:m=`default`,mask:h}=n,g=c.useMemo(()=>{let e=R(u,s);return e==null?null:{location:{pathname:e,search:d,hash:f,state:p,key:m,mask:h},navigationType:r}},[s,u,d,f,p,m,r,h]);return P(g!=null,`<Router basename="${s}"> is not able to match the URL "${u}${d}${f}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:c.createElement(U.Provider,{value:l},c.createElement(W.Provider,{children:t,value:g}))}function zn({children:e,location:t}){return gn(Bn(e),t)}c.Component;function Bn(e,t=[]){let n=[];return c.Children.forEach(e,(e,r)=>{if(!c.isValidElement(e))return;let i=[...t,r];if(e.type===c.Fragment){n.push.apply(n,Bn(e.props.children,i));return}N(e.type===Ln,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),N(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Bn(e.props.children,i)),n.push(a)}),n}var Vn=`get`,Hn=`application/x-www-form-urlencoded`;function Un(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Wn(e){return Un(e)&&e.tagName.toLowerCase()===`button`}function Gn(e){return Un(e)&&e.tagName.toLowerCase()===`form`}function Kn(e){return Un(e)&&e.tagName.toLowerCase()===`input`}function qn(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Jn(e,t){return e.button===0&&(!t||t===`_self`)&&!qn(e)}function Yn(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Xn(e,t){let n=Yn(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Zn=null;function Qn(){if(Zn===null)try{new FormData(document.createElement(`form`),0),Zn=!1}catch{Zn=!0}return Zn}var $n=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function er(e){return e!=null&&!$n.has(e)?(P(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Hn}"`),null):e}function tr(e,t){let n,r,i,a,o;if(Gn(e)){let o=e.getAttribute(`action`);r=o?R(o,t):null,n=e.getAttribute(`method`)||Vn,i=er(e.getAttribute(`enctype`))||Hn,a=new FormData(e)}else if(Wn(e)||Kn(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?R(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Vn,i=er(e.getAttribute(`formenctype`))||er(o.getAttribute(`enctype`))||Hn,a=new FormData(o,e),!Qn()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Un(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Vn,r=null,i=Hn,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function nr(e,t){if(e===!1||e==null)throw Error(t)}function rr(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return i.pathname=n?i.pathname.endsWith(`/`)?`${i.pathname}_.${r}`:`${i.pathname}.${r}`:i.pathname===`/`?`_root.${r}`:t&&R(i.pathname,t)===`/`?`${V(t)}/_root.${r}`:`${V(i.pathname)}.${r}`,i}async function ir(e,t){if(e.id in t)return t[e.id];try{let n=await i(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function ar(e){return e!=null&&typeof e.page==`string`}function or(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function sr(e,t,n){return fr((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await ir(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(or).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function cr(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function lr(e,t,{includeHydrateFallback:n}={}){return ur(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function ur(e){return[...new Set(e)]}function dr(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function fr(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!ar(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(dr(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function pr(){let e=c.useContext(H);return nr(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function mr(){let e=c.useContext(Qt);return nr(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var hr=c.createContext(void 0);hr.displayName=`FrameworkContext`;function gr(){let e=c.useContext(hr);return nr(e,`You must render this element inside a <HydratedRouter> element`),e}function _r(e,t){let n=c.useContext(hr),[r,i]=c.useState(!1),[a,o]=c.useState(!1),{onFocus:s,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=c.useRef(null);c.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),c.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let m=()=>{i(!0)},h=()=>{i(!1),o(!1)};return n?e===`intent`?[a,p,{onFocus:Y(s,m),onBlur:Y(l,h),onMouseEnter:Y(u,m),onMouseLeave:Y(d,h),onTouchStart:Y(f,m)}]:[a,p,{}]:[!1,p,{}]}function Y(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function vr({page:e,...t}){let n=en(),{nonce:r}=gr(),{router:i}=pr(),a=c.useMemo(()=>ut(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?c.createElement(br,{page:e,matches:a,...t}):c.createElement(xr,{page:e,matches:a,...t})):null}function yr(e){let{manifest:t,routeModules:n}=gr(),[r,i]=c.useState([]);return c.useEffect(()=>{let r=!1;return sr(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function br({page:e,matches:t,...n}){let r=q(),{future:i}=gr(),{basename:a}=pr(),o=c.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=rr(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return c.createElement(c.Fragment,null,o.map(e=>c.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function xr({page:e,matches:t,...n}){let r=q(),{future:i,manifest:a,routeModules:o}=gr(),{basename:s}=pr(),{loaderData:l,matches:u}=mr(),d=c.useMemo(()=>cr(e,t,u,a,r,`data`),[e,t,u,a,r]),f=c.useMemo(()=>cr(e,t,u,a,r,`assets`),[e,t,u,a,r]),p=c.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,c=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!d.some(t=>t.route.id===e.route.id)&&e.route.id in l&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?c=!0:n.add(e.route.id))}),n.size===0)return[];let u=rr(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return c&&n.size>0&&u.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[u.pathname+u.search]},[s,i.v8_trailingSlashAwareDataRequests,l,r,a,d,t,e,o]),m=c.useMemo(()=>lr(f,a),[f,a]),h=yr(f);return c.createElement(c.Fragment,null,p.map(e=>c.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),m.map(e=>c.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),h.map(({key:e,link:t})=>c.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Sr(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}c.Component;var Cr=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Cr&&(window.__reactRouterVersion=`7.18.3`)}catch{}function wr({basename:e,children:t,useTransitions:n,window:r}){let i=c.useRef();i.current??=it({window:r,v5Compat:!0});let a=i.current,[o,s]=c.useState({action:a.action,location:a.location}),l=c.useCallback(e=>{n===!1?s(e):c.startTransition(()=>s(e))},[n]);return c.useLayoutEffect(()=>a.listen(l),[a,l]),c.createElement(Rn,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}var Tr=c.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:l,to:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p,...m},h){let{basename:g,navigator:_,useTransitions:v}=c.useContext(U),y=typeof u==`string`&&$e.test(u),b=Ht(u,g);u=b.to;let x=dn(u,{relative:r}),S=q(),C=null;if(o){let e=z(o,[],S.mask?S.mask.pathname:`/`,!0);g!==`/`&&(e.pathname=e.pathname===`/`?g:B([g,e.pathname])),C=_.createHref(e)}let[w,T,E]=_r(n,m),ee=Ar(u,{replace:a,mask:o,state:s,target:l,preventScrollReset:d,relative:r,viewTransition:f,defaultShouldRevalidate:p,useTransitions:v});function te(t){e&&e(t),t.defaultPrevented||ee(t)}let D=!(b.isExternal||i),O=c.createElement(`a`,{...m,...E,href:(D?C:void 0)||b.absoluteURL||x,onClick:D?te:e,ref:Sr(h,T),target:l,"data-discover":!y&&t===`render`?`true`:void 0});return w&&!y?c.createElement(c.Fragment,null,O,c.createElement(vr,{page:x})):O});Tr.displayName=`Link`;var Er=c.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...l},u){let d=J(a,{relative:l.relative}),f=q(),p=c.useContext(Qt),{navigator:m,basename:h}=c.useContext(U),g=p!=null&&Ir(d)&&o===!0,_=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,v=f.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=R(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!r&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!r&&y.startsWith(_)&&y.charAt(_.length)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return c.createElement(Tr,{...l,"aria-current":w,className:T,ref:u,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});Er.displayName=`NavLink`;var Dr=c.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Vn,action:s,onSubmit:l,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p,...m},h)=>{let{useTransitions:g}=c.useContext(U),_=Pr(),v=Fr(s,{relative:u}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&$e.test(s);return c.createElement(`form`,{ref:h,method:y,action:v,onSubmit:r?l:e=>{if(l&&l(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,m=()=>_(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p});g&&n!==!1?c.startTransition(()=>m()):m()},...m,"data-discover":!b&&e===`render`?`true`:void 0})});Dr.displayName=`Form`;function Or(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function kr(e){let t=c.useContext(H);return N(t,Or(e)),t}function Ar(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:l,useTransitions:u}={}){let d=mn(),f=q(),p=J(e,{relative:o});return c.useCallback(m=>{if(Jn(m,t)){m.preventDefault();let t=n===void 0?F(f)===F(p):n,h=()=>d(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:l});u?c.startTransition(()=>h()):h()}},[f,d,p,n,r,i,t,e,a,o,s,l,u])}function jr(e){P(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=c.useRef(Yn(e)),n=c.useRef(!1),r=q(),i=c.useMemo(()=>Xn(r.search,n.current?null:t.current),[r.search]),a=mn();return[i,c.useCallback((e,t)=>{let r=Yn(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var Mr=0,Nr=()=>`__${String(++Mr)}__`;function Pr(){let{router:e}=kr(`useSubmit`),{basename:t}=c.useContext(U),n=An(),r=e.fetch,i=e.navigate;return c.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=tr(e,t);if(a.navigate===!1){let e=a.fetcherKey||Nr();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Fr(e,{relative:t}={}){let{basename:n}=c.useContext(U),r=c.useContext(G);N(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...J(e||`.`,{relative:t})},o=q();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:B([n,a.pathname])),F(a)}function Ir(e,{relative:t}={}){let n=c.useContext(tn);N(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=kr(`useViewTransitionState`),i=J(e,{relative:t});if(!n.isTransitioning)return!1;let a=R(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=R(n.nextLocation.pathname,r)||n.nextLocation.pathname;return L(i.pathname,o)!=null||L(i.pathname,a)!=null}var X={minWidth:380,minHeight:420,defaultWidth:760,defaultHeight:680,compactBreakpointPx:520,splitBreakpointPx:900,splitMinRatio:25,splitMaxRatio:75},Lr=e=>({width:Math.max(X.minWidth,Math.min(e.width,window.innerWidth||1200)),height:Math.max(X.minHeight,Math.min(e.height,window.innerHeight||900))}),Rr=e=>Math.max(X.splitMinRatio,Math.min(X.splitMaxRatio,e)),Z={isOpen:!1,isMinimized:!1,isMaximized:!1,openTabs:[],activeTab:null,splitTab:null,splitRatio:50,position:null,size:{width:X.defaultWidth,height:X.defaultHeight},drafts:{},modes:{},harnesses:{},terminalLaunches:{}};function zr(){try{let e=localStorage.getItem(a)??localStorage.getItem(o);if(!e)return Z;let t=JSON.parse(e);return{drafts:{},harnesses:Object.fromEntries(Object.entries(t.harnesses??{}).filter(([,e])=>typeof e==`string`)),terminalLaunches:{},modes:Object.fromEntries(Object.entries(t.modes??{}).filter(([,e])=>e===`cli`||e===`chat`)),isOpen:typeof t.isOpen==`boolean`?t.isOpen:Z.isOpen,isMinimized:typeof t.isMinimized==`boolean`?t.isMinimized:Z.isMinimized,isMaximized:typeof t.isMaximized==`boolean`?t.isMaximized:Z.isMaximized,openTabs:Array.isArray(t.openTabs)?t.openTabs.filter(e=>typeof e==`string`):[],activeTab:typeof t.activeTab==`string`?t.activeTab:null,splitTab:typeof t.splitTab==`string`&&t.splitTab!==t.activeTab?t.splitTab:null,splitRatio:typeof t.splitRatio==`number`&&Number.isFinite(t.splitRatio)?Rr(t.splitRatio):50,position:t.position&&typeof t.position.x==`number`&&typeof t.position.y==`number`?{x:t.position.x,y:t.position.y}:null,size:t.size&&typeof t.size.width==`number`&&typeof t.size.height==`number`?Lr({width:t.size.width,height:t.size.height}):Z.size}}catch{return Z}}var Br=zr(),Vr=new Set;function Hr(){try{localStorage.setItem(a,JSON.stringify({...Br,terminalLaunches:{},drafts:{}}))}catch{}for(let e of Vr)e()}function Q(e){Br=e(Br),Hr()}var $={getState:()=>Br,subscribe:e=>(Vr.add(e),()=>Vr.delete(e)),openTerminal:(e,t=`shell`,n,r)=>{$.open(e),$.setHarness(e,t),Q(i=>({...i,modes:{...i.modes,[e]:`cli`},terminalLaunches:{...i.terminalLaunches,[e]:{id:crypto.randomUUID(),target:t,sessionId:n,cwd:r}}}))},consumeTerminalLaunch:(e,t)=>{Q(n=>{if(n.terminalLaunches[e]?.id!==t)return n;let r={...n.terminalLaunches};return delete r[e],{...n,terminalLaunches:r}})},setMode:(e,t)=>Q(n=>({...n,modes:{...n.modes,[e]:t}})),setHarness:(e,t)=>Q(n=>({...n,harnesses:{...n.harnesses,[e]:t}})),openDraft:(e,t)=>{$.open(e),$.setMode(e,`chat`),Q(n=>({...n,drafts:{...n.drafts,[e]:{id:crypto.randomUUID(),text:t}}}))},consumeDraft:(e,t)=>{Q(n=>{if(n.drafts[e]?.id!==t)return n;let r={...n.drafts};return delete r[e],{...n,drafts:r}})},openCli:e=>$.open(e,`cli`),open:(e,t)=>{Q(n=>{let r=[...n.openTabs],i=n.activeTab;return e?(r.includes(e)||r.push(e),i=e):!i&&r.length>0&&(i=r[0]),{...n,isOpen:!0,isMinimized:!1,openTabs:r,activeTab:i,modes:e&&t?{...n.modes,[e]:t}:n.modes,splitTab:i===n.splitTab?n.activeTab:n.splitTab}})},close:()=>{Q(e=>({...e,isOpen:!1,isMinimized:!1}))},minimize:()=>{Q(e=>({...e,isMinimized:!0}))},restore:()=>{Q(e=>({...e,isOpen:!0,isMinimized:!1}))},toggleMaximize:()=>{Q(e=>({...e,isMaximized:!e.isMaximized,isMinimized:!1}))},addTab:e=>{Q(t=>{let n=t.openTabs.includes(e)?t.openTabs:[...t.openTabs,e];return{...t,isOpen:!0,isMinimized:!1,openTabs:n,activeTab:e,splitTab:e===t.splitTab?t.activeTab:t.splitTab}})},removeTab:e=>{Q(t=>{let n=t.openTabs.filter(t=>t!==e),r=t.activeTab;return r===e&&(r=n.find(e=>e!==t.splitTab)??n[0]??null),{...t,openTabs:n,activeTab:r,splitTab:e===t.splitTab||r===t.splitTab?null:t.splitTab,isOpen:n.length>0&&t.isOpen}})},setActiveTab:e=>{Q(t=>t.openTabs.includes(e)?{...t,activeTab:e,splitTab:e===t.splitTab?t.activeTab:t.splitTab,isMinimized:!1}:t)},setSplitTab:e=>{Q(t=>{if(e===t.activeTab)return t;let n=e&&!t.openTabs.includes(e)?[...t.openTabs,e]:t.openTabs;return{...t,openTabs:n,splitTab:e,isMaximized:e?!0:t.isMaximized}})},setSplitRatio:e=>Q(t=>({...t,splitRatio:Rr(e)})),setPosition:e=>{Q(t=>({...t,position:e}))},setSize:e=>{Q(t=>({...t,size:Lr(e)}))}};function Ur(){return{...(0,c.useSyncExternalStore)($.subscribe,$.getState,()=>Z),...$}}function Wr(){return j({queryKey:[`config`],queryFn:()=>s(`/api/config`)})}function Gr(){return j({queryKey:[`workspaces`],queryFn:()=>s(`/api/workspaces`)})}function Kr(e={}){return j({queryKey:[`workspaces-status`],queryFn:()=>s(`/api/workspaces/status`),enabled:e.enabled??!0,refetchInterval:e.intervalMs??!1})}function qr(){return j({queryKey:[`domain-packs`],queryFn:async()=>(await s(`/api/enterprise/domain-packs`))?.domainPacks??[]})}function Jr(){let e=d();return M({mutationFn:e=>s(`/api/enterprise/domain-packs`,{method:`POST`,body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:[`domain-packs`]}),e.invalidateQueries({queryKey:[`workspace-domain-packs`]})}})}function Yr(){let e=d();return M({mutationFn:e=>s(`/api/enterprise/domain-packs/${encodeURIComponent(e.id)}`,{method:`PUT`,body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:[`domain-packs`]}),e.invalidateQueries({queryKey:[`workspace-domain-packs`]})}})}function Xr(){let e=d();return M({mutationFn:e=>s(`/api/enterprise/domain-packs/${encodeURIComponent(e)}`,{method:`DELETE`}),onSuccess:()=>{e.invalidateQueries({queryKey:[`domain-packs`]}),e.invalidateQueries({queryKey:[`workspace-domain-packs`]})}})}function Zr(){let e=d();return M({mutationFn:e=>s(`/api/workspace`,{method:`POST`,body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:[`workspaces`]}),e.invalidateQueries({queryKey:[`workspaces-status`]})}})}function Qr(){return j({queryKey:[`projects`],queryFn:()=>s(`/api/projects`)})}function $r(){let e=d();return M({mutationFn:e=>s(`/api/projects`,{method:`POST`,body:JSON.stringify(e)}),onSuccess:()=>e.invalidateQueries({queryKey:[`projects`]})})}function ei(){let e=d();return M({mutationFn:({id:e,...t})=>s(`/api/projects/${encodeURIComponent(e)}`,{method:`PUT`,body:JSON.stringify(t)}),onSuccess:()=>e.invalidateQueries({queryKey:[`projects`]})})}function ti(){let e=d();return M({mutationFn:e=>s(`/api/projects/${encodeURIComponent(e)}`,{method:`DELETE`}),onSuccess:()=>e.invalidateQueries({queryKey:[`projects`]})})}function ni(){return j({queryKey:[`repos`],queryFn:()=>s(`/api/repos`)})}function ri(e,t){return j({queryKey:[`repo-branches`,e],queryFn:()=>s(`/api/repos/branches?path=${encodeURIComponent(e)}`),enabled:t,staleTime:6e4})}function ii(e,t=!0){return j({queryKey:[`repos-freshness`,e],queryFn:()=>s(`/api/repos/freshness`,{method:`POST`,body:JSON.stringify({repos:e})}),enabled:t&&e.length>0,staleTime:3e4})}function ai(){let e=d();return M({mutationFn:e=>s(`/api/repos/pull`,{method:`POST`,body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:[`repo-freshness`]}),e.invalidateQueries({queryKey:[`repos-freshness`]})}})}function oi(){let e=d();return M({mutationFn:e=>s(`/api/repos/new`,{method:`POST`,body:JSON.stringify({name:e})}),onSuccess:()=>e.invalidateQueries({queryKey:[`repos`]})})}function si(){return j({queryKey:[`ai-detect`],queryFn:()=>s(`/api/ai-detect`),staleTime:6e4})}function ci(){return j({queryKey:[`editor-detect`],queryFn:()=>s(`/api/editor-detect`),staleTime:6e4})}function li(){return j({queryKey:[`workspace-launch-targets`],queryFn:()=>s(`/api/workspace-launch-targets`),staleTime:6e4})}function ui(e,t){return j({queryKey:[`workspace-recent-sessions`,e],queryFn:async()=>{let t=new URLSearchParams({limit:`3`,desktopHandoffOnly:`true`});return(await s(`/api/workspace/${encodeURIComponent(e)}/sessions?${t}`)).sessions},enabled:t,staleTime:3e4})}function di(){return j({queryKey:[`workflow-templates`],queryFn:async()=>(await s(`/api/workflows/templates`)).templates})}function fi(e){return j({queryKey:[`workspace-services`,e],queryFn:()=>s(`/api/workspace/${encodeURIComponent(e)}/services`),enabled:!!e,refetchInterval:3e3,retry:1})}function pi(e){let t=d();return M({mutationFn:({action:t,service:n})=>{let r=`/api/workspace/${encodeURIComponent(e)}/services`,i=n?`${r}/${encodeURIComponent(n)}/${t}`:`${r}/${t}`;return s(i,{method:`POST`})},onSettled:()=>{t.invalidateQueries({queryKey:[`workspace-services`,e]}),t.invalidateQueries({queryKey:[`workspaces-status`]})}})}function mi(e){let t=d();return M({mutationFn:({action:t,id:n})=>s(`/api/workspace/${encodeURIComponent(e)}/orchestrators/${t}`,{method:`POST`,body:JSON.stringify({id:n})}),onSettled:()=>{t.invalidateQueries({queryKey:[`workspace-services`,e]}),t.invalidateQueries({queryKey:[`workspaces-status`]})}})}function hi(){return j({queryKey:[`skill-categories`],queryFn:async()=>(await s(`/api/skills/categories`)).categories})}function gi(){let e=d();return M({mutationFn:e=>s(`/api/skills/categories`,{method:`POST`,body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:[`skill-categories`]}),e.invalidateQueries({queryKey:[`skills`]})}})}function _i(){let e=d();return M({mutationFn:e=>s(`/api/skills/categories/${encodeURIComponent(e)}`,{method:`DELETE`}),onSuccess:()=>{e.invalidateQueries({queryKey:[`skill-categories`]}),e.invalidateQueries({queryKey:[`skills`]})}})}function vi(e){return{queryKey:[`skills`,e],queryFn:()=>s(e?`/api/skills?workspace=${encodeURIComponent(e)}`:`/api/skills`)}}function yi(e){return j({...vi(e),select:e=>e.diagnostics??[]})}function bi(e){return j({...vi(e),select:e=>e.skills})}function xi(){let e=d();return M({mutationFn:e=>s(`/api/skills`,{method:`POST`,body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:[`skills`]}),e.invalidateQueries({queryKey:[`skill-categories`]}),e.invalidateQueries({queryKey:[`workspace-skills`]})}})}function Si(){let e=d();return M({mutationFn:e=>{let t=typeof e==`string`?e:e.id,n=typeof e==`string`?void 0:e.workspaceId,r=n?`/api/skills/${encodeURIComponent(t)}?workspace=${encodeURIComponent(n)}`:`/api/skills/${encodeURIComponent(t)}`;return s(r,{method:`DELETE`})},onSuccess:()=>{e.invalidateQueries({queryKey:[`skills`]}),e.invalidateQueries({queryKey:[`workspace-skills`]})}})}function Ci(){return j({queryKey:[`codex-agents`],queryFn:async()=>(await s(`/api/agents`)).agents})}function wi(){let e=d();return M({mutationFn:e=>s(`/api/agents`,{method:`POST`,body:JSON.stringify(e)}),onSuccess:()=>e.invalidateQueries({queryKey:[`codex-agents`]})})}function Ti(){let e=d();return M({mutationFn:({toml:e,category:t})=>s(`/api/agents/import`,{method:`POST`,body:JSON.stringify({toml:e,category:t})}),onSuccess:()=>e.invalidateQueries({queryKey:[`codex-agents`]})})}function Ei(){let e=d();return M({mutationFn:e=>s(`/api/agents/${encodeURIComponent(e)}`,{method:`DELETE`}),onSuccess:()=>e.invalidateQueries({queryKey:[`codex-agents`]})})}function Di(e){return j({queryKey:[`workspace-skills`,e],queryFn:async()=>(await s(`/api/skills/workspace/${encodeURIComponent(e)}`)).config,enabled:!!e})}function Oi(){let e=d();return M({mutationFn:({workspaceId:e,expectedRevision:t,...n})=>s(`/api/skills/workspace/${encodeURIComponent(e)}/assign`,{method:`POST`,body:JSON.stringify({...n,expectedRevision:t})}),onSuccess:(t,n)=>{e.setQueryData([`workspace-skills`,n.workspaceId],t.config),e.invalidateQueries({queryKey:[`skills`]})}})}function ki(){return M({mutationFn:async({workspaceId:e,...t})=>t.assistant?($.openTerminal(e,t.assistant,t.sessionId,t.cwd),{success:!0,command:t.assistant}):s(`/api/workspace/${encodeURIComponent(e)}/terminal`,{method:`POST`,body:JSON.stringify(t)})})}function Ai(){let e=d();return M({mutationFn:({workspaceId:e,force:t})=>s(`/api/workspace/${encodeURIComponent(e)}/refresh`,{method:`POST`,body:JSON.stringify({force:t})}),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:[`workspaces`]}),e.invalidateQueries({queryKey:[`workspace-skills`,n.workspaceId]}),e.invalidateQueries({queryKey:[`skills`,n.workspaceId]}),e.invalidateQueries({queryKey:[`workspaces-status`]})}})}function ji(e){return j({queryKey:[`workspace-lifecycle`,e],queryFn:async()=>await s(`/api/workspace/${encodeURIComponent(e)}/lifecycle`),enabled:!!e,staleTime:1e4})}export{mn as $,hi as A,Gr as B,ni as C,xi as D,Yr as E,li as F,Ur as G,X as H,ji as I,Er as J,wr as K,ui as L,bi as M,ei as N,gi as O,di as P,q as Q,fi as R,ri as S,wi as T,Lr as U,Kr as V,$ as W,Ln as X,In as Y,zn as Z,ki as _,x as _t,Jr as a,Ee as at,ai as b,d as bt,Zr as c,me as ct,ti as d,T as dt,jr as et,Si as f,w as ft,Ti as g,E as gt,ci as h,_ as ht,Wr as i,Ie as it,yi as j,pi as k,Ei as l,k as lt,qr as m,S as mt,si as n,Ze as nt,$r as o,_e as ot,_i as p,C as pt,Tr as q,Oi as r,j as rt,oi as s,A as st,Ci as t,Qe as tt,Xr as u,v as ut,mi as v,ce as vt,ii as w,Ai as x,Qr as y,f as yt,Di as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-DE3RlOCf.js";import{At as r,E as i,Fn as a,G as o,Gt as s,In as c,Jt as l,Mn as u,Mt as d,On as f,S as p,T as m,Tn as h,Ut as g,Yt as _,_ as v,_t as y,an as b,b as x,cn as S,f as C,ft as w,g as T,gt as E,in as D,jt as O,mt as k,on as A,pt as j,qn as M,rn as N,sn as P,tn as F,v as I,w as L,x as R,y as z,yn as B}from"./input-LtE7Sz4D.js";import{c as V,d as H,i as U,l as W,m as G,p as K,s as q}from"./button-BrcP8Wxx.js";import{b as J,c as ee,t as te,y as ne}from"./isElementDisabled-Cpw8EvLX.js";import{rt as re}from"./index-qvc4aLwP.js";var Y=n(),X=e(t(),1);function ie(){let[,e]=X.useState({});return X.useCallback(()=>{e({})},[])}function Z(e){let t=S(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=B(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r;return(ne(n)!==a||ne(r)!==o)&&(n=a,r=o),{width:n,height:r}}var ae=X.createContext(void 0);function Q(){let e=X.useContext(ae);if(e===void 0)throw Error(K(64));return e}var $={tabActivationDirection:e=>({"data-activation-direction":e})},oe=X.forwardRef(function(e,t){let{className:n,defaultValue:r=0,onValueChange:i,orientation:o=`horizontal`,render:s,value:c,style:d,...p}=e,m=e.defaultValue!==void 0,g=X.useRef([]),[_,v]=X.useState(()=>new Map),[y,b]=h({controlled:c,default:r,name:`Tabs`,state:`value`}),x=c!==void 0,[S,C]=X.useState(()=>new Map),w=X.useRef(void 0),T=X.useCallback(e=>se(S,e),[S]),[E,D]=X.useState(()=>({previousValue:y,tabActivationDirection:`none`})),{previousValue:O,tabActivationDirection:k}=E,j=k,M=!1;O!==y&&(j=ce(O,y,o,S),M=O!=null&&y!=null&&T(y)==null);let N=M?O:y,F=O!==N||k!==j;A(()=>{F&&D({previousValue:N,tabActivationDirection:j})},[N,F,j]);let I=P((e,t)=>{t.activationDirection=ce(y,e,o,S),i?.(e,t),!t.isCanceled&&b(e)}),L=P((e,t)=>{i?.(e,l(t,void 0,void 0,{activationDirection:`none`}))}),R=P((e,t)=>(v(n=>{let r=new Map(n);return r.set(e,t),r}),()=>{v(n=>{if(n.get(e)!==t)return n;let r=new Map(n);return r.delete(e),r})})),z=X.useCallback(e=>_.get(e),[_]),B=X.useCallback(e=>{for(let t of S.values())if(e===t.value)return t.id},[S]),V=X.useMemo(()=>({getTabElementBySelectedValue:T,getTabIdByPanelValue:B,getTabPanelIdByValue:z,onValueChange:I,orientation:o,registerMountedTabPanel:R,setTabMap:C,tabActivationDirection:j,value:y}),[T,B,z,I,o,R,C,j,y]),H=X.useMemo(()=>{for(let e of S.values())if(e.value===y)return e},[S,y]),W=X.useMemo(()=>{for(let e of S.values())if(!e.disabled)return e.value},[S]),G=X.useRef(!m),K=X.useRef(r),q=X.useRef(m),J=X.useRef(!1);A(()=>{if(x)return;function e(e,t){b(e),D({previousValue:e,tabActivationDirection:`none`}),L(e,t),G.current=!1}if(S.size===0){J.current&&y!==null&&!w.current?.isConnected&&e(null,a);return}J.current=!0,w.current=S.keys().next().value;let t=H?.disabled,n=H==null&&y!==null;if(!t&&y===K.current&&(q.current=!1),q.current&&t&&y===K.current)return;let r=G.current;if(t||n){let n=W??null;if(y===n){G.current=!1;return}let i=a;r?i=u:t&&(i=f),e(n,i);return}r&&H!=null&&(L(y,u),G.current=!1)},[W,x,L,H,b,S,y]);let te=U(`div`,e,{state:{orientation:o,tabActivationDirection:j},ref:t,props:p,stateAttributesMapping:$});return(0,Y.jsx)(ae.Provider,{value:V,children:(0,Y.jsx)(ee,{elementsRef:g,children:te})})});function se(e,t){for(let[n,r]of e.entries())if(t===r.value)return n;return null}function ce(e,t,n,r){if(e==null||t==null)return`none`;let[i,a,o]=n===`horizontal`?[`left`,`left`,`right`]:[`top`,`up`,`down`],s=se(r,e),c=se(r,t);if(s==null||c==null)return s!==c&&(typeof e==`number`||typeof e==`string`)&&typeof e==typeof t?t>e?o:a:`none`;let l=s.getBoundingClientRect()[i],u=c.getBoundingClientRect()[i];return u<l?a:u>l?o:`none`}var le=`data-composite-item-active`,ue=X.createContext(void 0);function de(){let e=X.useContext(ue);if(e===void 0)throw Error(K(65));return e}var fe=X.forwardRef(function(e,t){let{className:n,disabled:i=!1,render:a,value:o,id:s,nativeButton:u=!0,style:d,...f}=e,{value:p,getTabPanelIdByValue:m,onValueChange:h,orientation:g,tabActivationDirection:v}=Q(),{activateOnFocus:y,registerTabResizeObserverElement:x,tabsListElement:S}=de(),{highlightedIndex:C,onHighlightedIndexChange:w}=b(),T=_(s),E=X.useMemo(()=>({disabled:i,id:T,value:o}),[i,T,o]),{compositeProps:D,compositeRef:k,index:j}=re({metadata:E}),M=o===p,I=X.useRef(!1),L=X.useRef(null),R=P(e=>{L.current?.(),L.current=e?x(e):null});A(()=>{if(I.current){I.current=!1;return}if(!(M&&j>-1&&C!==j))return;let e=S;if(e!=null){let t=r(N(e));if(t&&O(e,t))return}i||w(j)},[M,j,C,w,i,S]);let{getButtonProps:z,buttonRef:B}=F({disabled:i,native:u,focusableWhenDisabled:!0}),V=m(o),H=X.useRef(!1),W=X.useRef(!1);function G(e){h(o,l(c,e.nativeEvent,void 0,{activationDirection:`none`}))}function K(e){M||i||G(e)}function q(e){M||i||y&&(!H.current||W.current)&&G(e)}function J(e){if(M||i)return;H.current=!0,W.current=e.button===0;let t=N(e.currentTarget);function n(){H.current=!1,W.current=!1,t.removeEventListener(`pointerup`,n),t.removeEventListener(`pointercancel`,n)}t.addEventListener(`pointerup`,n),t.addEventListener(`pointercancel`,n)}return U(`button`,e,{state:{disabled:i,active:M,orientation:g,tabActivationDirection:v},ref:[t,B,k,R],props:[D,{role:`tab`,"aria-controls":V,"aria-selected":M,id:T,onClick:K,onFocus:q,onPointerDown:J,[le]:M?``:void 0,onKeyDownCapture(){I.current=!0}},f,z],stateAttributesMapping:$})}),pe=o();function me(){return W}function he(){return!1}function ge(){return!0}function _e(){return(0,pe.useSyncExternalStore)(me,he,ge)}function ve(e){let{script:t}=e,{nonce:n}=C();return _e()?(0,Y.jsx)(`script`,{nonce:n,dangerouslySetInnerHTML:{__html:t},suppressHydrationWarning:!0}):null}var ye,be={...$,activeTabPosition:()=>null,activeTabSize:()=>null},xe=X.forwardRef(function(e,t){let{className:n,render:r,renderBeforeHydration:i=!1,style:a,...o}=e,{getTabElementBySelectedValue:s,orientation:c,tabActivationDirection:l,value:u}=Q(),{tabsListElement:d,registerIndicatorUpdateListener:f}=de(),p=ie();X.useEffect(()=>f(p),[f,p]);let m=0,h=0,g=0,_=0,v=0,y=0,b=!1;if(u!=null&&d!=null){let e=s(u);if(e!=null){b=!0;let{width:t,height:n}=Z(e),{width:r,height:i}=Z(d),a=e.getBoundingClientRect(),o=d.getBoundingClientRect(),s=r>0?o.width/r:1,c=i>0?o.height/i:1;if(s>2**-52&&c>2**-52){let e=a.left-o.left,t=a.top-o.top;m=e/s+d.scrollLeft-d.clientLeft,g=t/c+d.scrollTop-d.clientTop}else m=e.offsetLeft,g=e.offsetTop;v=t,y=n,h=d.scrollWidth-m-v,_=d.scrollHeight-g-y}}let x=b?{left:m,right:h,top:g,bottom:_}:null,S=b?{width:v,height:y}:null,C=b?{"--active-tab-left":`${m}px`,"--active-tab-right":`${h}px`,"--active-tab-top":`${g}px`,"--active-tab-bottom":`${_}px`,"--active-tab-width":`${v}px`,"--active-tab-height":`${y}px`}:void 0,w=U(`span`,e,{state:{orientation:c,activeTabPosition:x,activeTabSize:S,tabActivationDirection:l},ref:t,props:[{role:`presentation`,style:C,hidden:!(b&&v>0&&y>0)},o,{suppressHydrationWarning:!0}],stateAttributesMapping:be});return u==null?null:(0,Y.jsxs)(X.Fragment,{children:[w,i&&(ye||=(0,Y.jsx)(ve,{script:``}))]})}),Se={...$,...M},Ce=X.forwardRef(function(e,t){let{className:n,value:r,render:i,keepMounted:a=!1,style:o,...c}=e,{value:l,getTabIdByPanelValue:u,orientation:d,tabActivationDirection:f,registerMountedTabPanel:p}=Q(),m=_(),{ref:h,index:y}=J(),b=r===l,{mounted:x,transitionStatus:S,setMounted:C}=s(b),w=!x,T=u(r),E={hidden:w,orientation:d,tabActivationDirection:f,transitionStatus:S},D=X.useRef(null),O=U(`div`,e,{state:E,ref:[t,h,D],props:[{"aria-labelledby":T,hidden:w,id:m,role:`tabpanel`,tabIndex:b?0:-1,inert:v(!b),"data-index":y},c],stateAttributesMapping:Se});return g({open:b,ref:D,onComplete(){b||C(!1)}}),A(()=>{if(!(m==null||w&&!a))return p(r,m)},[w,a,r,m,p]),a||x?O:null}),we=[];function Te(e){let{loopFocus:t=!0,orientation:n=`both`,grid:r,onLoop:a,direction:o,highlightedIndex:s,onHighlightedIndexChange:c,rootRef:l,enableHomeAndEndKeys:u=!1,stopEventPropagation:f,disabledIndices:h,modifierKeys:g=we}=e,[_,v]=X.useState(0),b=r!=null,S=X.useRef(null),C=H(S,l),T=X.useRef([]),D=X.useRef(!1),O=s??_,M=P((e,t=!1)=>{if((c??v)(e),t){let t=T.current[e];i(S.current,t,o,n)}}),N=P(e=>{if(e.size===0||D.current)return;D.current=!0;let t=Array.from(e.keys()),r=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,a=r?e.get(r)?.index??-1:-1;if(a!==-1)M(a);else if(y(t,O,h)){let e=w(t,{disabledIndices:h});E(t,e)||M(e)}i(S.current,r,o,n)});A(()=>{if(h==null||s!=null||!D.current)return;let e=T.current;if(y(e,O,h)){let t=w(e,{disabledIndices:h});E(e,t)||M(t)}},[h,s,O,T,M]);let F=P((e,t,n)=>a?a(e,t,n,T):n),L=P(e=>{let i=e.key===`Home`||e.key===`End`;if(!p.has(e.key)||!u&&i||Ee(e,g)||!S.current)return;let s=o===`rtl`,c=s?z:x,l=s?x:z,_=n===`vertical`?I:c,v=n===`vertical`?R:l,y=d(e.nativeEvent);if(y!=null&&m(y)&&!te(y)){let t=y.selectionStart,n=y.selectionEnd,r=y.value;if(t==null||e.shiftKey||t!==n||e.key!==v&&t<r.length||e.key!==_&&t>0)return}let C=O,D=k(T,h),A=j(T,h);r!=null&&(C=r({disabledIndices:h,elementsRef:T,event:e,highlightedIndex:O,loopFocus:t,maxIndex:A,minIndex:D,onLoop:F,orientation:n,rtl:s}));let N=n!==`vertical`&&e.key===c||n!==`horizontal`&&e.key===`ArrowDown`,P=n!==`vertical`&&e.key===l||n!==`horizontal`&&e.key===`ArrowUp`;u&&(e.key===`Home`?C=D:e.key===`End`&&(C=A)),C===O&&(N||P)&&(t&&C===A&&N?(C=D,a&&(C=a(e,O,C,T))):t&&C===D&&P?(C=A,a&&(C=a(e,O,C,T))):C=w(T.current,{startingIndex:C,decrement:P,disabledIndices:h})),C!==O&&!E(T.current,C)&&(f&&e.stopPropagation(),(b||i||N||P)&&e.preventDefault(),M(C,!0),queueMicrotask(()=>{T.current[C]?.focus()}))});return{props:{ref:C,onFocus(e){let t=S.current,n=d(e.nativeEvent);!t||n==null||!m(n)||n.setSelectionRange(0,n.value.length)},onKeyDown:L},highlightedIndex:O,onHighlightedIndexChange:M,elementsRef:T,onMapChange:N,relayKeyboardEvent:L}}function Ee(e,t){for(let n of L)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function De(e){let{render:t,className:n,style:r,refs:i=q,props:a=q,state:o=V,stateAttributesMapping:s,highlightedIndex:c,onHighlightedIndexChange:l,orientation:u,grid:d,loopFocus:f,onLoop:p,enableHomeAndEndKeys:m,onMapChange:h,stopEventPropagation:g=!0,rootRef:_,disabledIndices:v,modifierKeys:y,highlightItemOnHover:b=!1,tag:x=`div`,...S}=e,{props:C,highlightedIndex:w,onHighlightedIndexChange:E,elementsRef:O,onMapChange:k,relayKeyboardEvent:A}=Te({grid:d,loopFocus:f,onLoop:p,orientation:u,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:_,stopEventPropagation:g,enableHomeAndEndKeys:m,direction:T(),disabledIndices:v,modifierKeys:y}),j=U(x,e,{state:o,ref:i,props:[C,...a,S],stateAttributesMapping:s}),M=X.useMemo(()=>({highlightedIndex:w,onHighlightedIndexChange:E,highlightItemOnHover:b,relayKeyboardEvent:A}),[w,E,b,A]);return(0,Y.jsx)(D.Provider,{value:M,children:(0,Y.jsx)(ee,{elementsRef:O,onMapChange:e=>{h?.(e),k(e)},children:j})})}var Oe=X.forwardRef(function(e,t){let{activateOnFocus:n=!1,className:r,loopFocus:i=!0,render:a,style:o,...s}=e,{orientation:c,setTabMap:l,tabActivationDirection:u}=Q(),[d,f]=X.useState(0),[p,m]=X.useState(null),h=X.useRef(new Set),g=X.useRef(new Set),_=X.useRef(null);A(()=>{if(typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>{h.current.forEach(e=>{e()})});return _.current=e,p&&e.observe(p),g.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),_.current=null}},[p]);let v=P(e=>(h.current.add(e),()=>{h.current.delete(e)})),y=P(e=>(g.current.add(e),_.current?.observe(e),()=>{g.current.delete(e),_.current?.unobserve(e)})),b={orientation:c,tabActivationDirection:u},x={"aria-orientation":c===`vertical`?`vertical`:void 0,role:`tablist`},S=X.useMemo(()=>({activateOnFocus:n,registerIndicatorUpdateListener:v,registerTabResizeObserverElement:y,tabsListElement:p}),[n,v,y,p]);return(0,Y.jsx)(ue.Provider,{value:S,children:(0,Y.jsx)(De,{render:a,className:r,style:o,state:b,refs:[t,m],props:[x,s],stateAttributesMapping:$,highlightedIndex:d,enableHomeAndEndKeys:!0,loopFocus:i,orientation:c,onHighlightedIndexChange:f,onMapChange:l,disabledIndices:q})})});function ke({className:e,...t}){return(0,Y.jsx)(oe,{className:G(`flex flex-col gap-4`,e),"data-slot":`tabs`,...t})}function Ae({className:e,...t}){return(0,Y.jsxs)(Oe,{className:G(`relative z-0 flex w-fit items-center gap-1 rounded-lg bg-muted p-1`,e),"data-slot":`tabs-list`,...t,children:[t.children,(0,Y.jsx)(xe,{className:`absolute top-1/2 left-0 z-[-1] h-[calc(100%-0.5rem)] w-(--active-tab-width) -translate-y-1/2 translate-x-(--active-tab-left) rounded-md bg-background shadow-xs transition-all duration-150`,"data-slot":`tabs-indicator`})]})}function je({className:e,...t}){return(0,Y.jsx)(fe,{className:G(`flex h-7 cursor-pointer items-center justify-center whitespace-nowrap rounded-md border border-transparent px-2.5 font-medium text-muted-foreground text-sm outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring data-selected:text-foreground`,e),"data-slot":`tabs-tab`,...t})}function Me({className:e,...t}){return(0,Y.jsx)(Ce,{className:G(`flex-1 outline-none`,e),"data-slot":`tabs-panel`,...t})}export{Z as a,je as i,Ae as n,Me as r,ke as t};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-DE3RlOCf.js";import{At as r,E as i,Fn as a,G as o,Gt as s,In as c,Jt as l,Mn as u,Mt as d,On as f,S as p,T as m,Tn as h,Ut as g,Yt as _,_ as v,_t as y,an as b,b as x,cn as S,f as C,ft as w,g as T,gt as E,in as D,jt as O,mt as k,on as A,pt as j,qn as M,rn as N,sn as P,tn as F,v as I,w as L,x as R,y as z,yn as B}from"./input-LtE7Sz4D.js";import{c as V,d as H,i as U,l as W,m as G,p as K,s as q}from"./button-BrcP8Wxx.js";import{b as J,c as ee,t as te,y as ne}from"./isElementDisabled-Cpw8EvLX.js";import{rt as re}from"./index-R0fvXNEi.js";var Y=n(),X=e(t(),1);function ie(){let[,e]=X.useState({});return X.useCallback(()=>{e({})},[])}function Z(e){let t=S(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=B(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r;return(ne(n)!==a||ne(r)!==o)&&(n=a,r=o),{width:n,height:r}}var ae=X.createContext(void 0);function Q(){let e=X.useContext(ae);if(e===void 0)throw Error(K(64));return e}var $={tabActivationDirection:e=>({"data-activation-direction":e})},oe=X.forwardRef(function(e,t){let{className:n,defaultValue:r=0,onValueChange:i,orientation:o=`horizontal`,render:s,value:c,style:d,...p}=e,m=e.defaultValue!==void 0,g=X.useRef([]),[_,v]=X.useState(()=>new Map),[y,b]=h({controlled:c,default:r,name:`Tabs`,state:`value`}),x=c!==void 0,[S,C]=X.useState(()=>new Map),w=X.useRef(void 0),T=X.useCallback(e=>se(S,e),[S]),[E,D]=X.useState(()=>({previousValue:y,tabActivationDirection:`none`})),{previousValue:O,tabActivationDirection:k}=E,j=k,M=!1;O!==y&&(j=ce(O,y,o,S),M=O!=null&&y!=null&&T(y)==null);let N=M?O:y,F=O!==N||k!==j;A(()=>{F&&D({previousValue:N,tabActivationDirection:j})},[N,F,j]);let I=P((e,t)=>{t.activationDirection=ce(y,e,o,S),i?.(e,t),!t.isCanceled&&b(e)}),L=P((e,t)=>{i?.(e,l(t,void 0,void 0,{activationDirection:`none`}))}),R=P((e,t)=>(v(n=>{let r=new Map(n);return r.set(e,t),r}),()=>{v(n=>{if(n.get(e)!==t)return n;let r=new Map(n);return r.delete(e),r})})),z=X.useCallback(e=>_.get(e),[_]),B=X.useCallback(e=>{for(let t of S.values())if(e===t.value)return t.id},[S]),V=X.useMemo(()=>({getTabElementBySelectedValue:T,getTabIdByPanelValue:B,getTabPanelIdByValue:z,onValueChange:I,orientation:o,registerMountedTabPanel:R,setTabMap:C,tabActivationDirection:j,value:y}),[T,B,z,I,o,R,C,j,y]),H=X.useMemo(()=>{for(let e of S.values())if(e.value===y)return e},[S,y]),W=X.useMemo(()=>{for(let e of S.values())if(!e.disabled)return e.value},[S]),G=X.useRef(!m),K=X.useRef(r),q=X.useRef(m),J=X.useRef(!1);A(()=>{if(x)return;function e(e,t){b(e),D({previousValue:e,tabActivationDirection:`none`}),L(e,t),G.current=!1}if(S.size===0){J.current&&y!==null&&!w.current?.isConnected&&e(null,a);return}J.current=!0,w.current=S.keys().next().value;let t=H?.disabled,n=H==null&&y!==null;if(!t&&y===K.current&&(q.current=!1),q.current&&t&&y===K.current)return;let r=G.current;if(t||n){let n=W??null;if(y===n){G.current=!1;return}let i=a;r?i=u:t&&(i=f),e(n,i);return}r&&H!=null&&(L(y,u),G.current=!1)},[W,x,L,H,b,S,y]);let te=U(`div`,e,{state:{orientation:o,tabActivationDirection:j},ref:t,props:p,stateAttributesMapping:$});return(0,Y.jsx)(ae.Provider,{value:V,children:(0,Y.jsx)(ee,{elementsRef:g,children:te})})});function se(e,t){for(let[n,r]of e.entries())if(t===r.value)return n;return null}function ce(e,t,n,r){if(e==null||t==null)return`none`;let[i,a,o]=n===`horizontal`?[`left`,`left`,`right`]:[`top`,`up`,`down`],s=se(r,e),c=se(r,t);if(s==null||c==null)return s!==c&&(typeof e==`number`||typeof e==`string`)&&typeof e==typeof t?t>e?o:a:`none`;let l=s.getBoundingClientRect()[i],u=c.getBoundingClientRect()[i];return u<l?a:u>l?o:`none`}var le=`data-composite-item-active`,ue=X.createContext(void 0);function de(){let e=X.useContext(ue);if(e===void 0)throw Error(K(65));return e}var fe=X.forwardRef(function(e,t){let{className:n,disabled:i=!1,render:a,value:o,id:s,nativeButton:u=!0,style:d,...f}=e,{value:p,getTabPanelIdByValue:m,onValueChange:h,orientation:g,tabActivationDirection:v}=Q(),{activateOnFocus:y,registerTabResizeObserverElement:x,tabsListElement:S}=de(),{highlightedIndex:C,onHighlightedIndexChange:w}=b(),T=_(s),E=X.useMemo(()=>({disabled:i,id:T,value:o}),[i,T,o]),{compositeProps:D,compositeRef:k,index:j}=re({metadata:E}),M=o===p,I=X.useRef(!1),L=X.useRef(null),R=P(e=>{L.current?.(),L.current=e?x(e):null});A(()=>{if(I.current){I.current=!1;return}if(!(M&&j>-1&&C!==j))return;let e=S;if(e!=null){let t=r(N(e));if(t&&O(e,t))return}i||w(j)},[M,j,C,w,i,S]);let{getButtonProps:z,buttonRef:B}=F({disabled:i,native:u,focusableWhenDisabled:!0}),V=m(o),H=X.useRef(!1),W=X.useRef(!1);function G(e){h(o,l(c,e.nativeEvent,void 0,{activationDirection:`none`}))}function K(e){M||i||G(e)}function q(e){M||i||y&&(!H.current||W.current)&&G(e)}function J(e){if(M||i)return;H.current=!0,W.current=e.button===0;let t=N(e.currentTarget);function n(){H.current=!1,W.current=!1,t.removeEventListener(`pointerup`,n),t.removeEventListener(`pointercancel`,n)}t.addEventListener(`pointerup`,n),t.addEventListener(`pointercancel`,n)}return U(`button`,e,{state:{disabled:i,active:M,orientation:g,tabActivationDirection:v},ref:[t,B,k,R],props:[D,{role:`tab`,"aria-controls":V,"aria-selected":M,id:T,onClick:K,onFocus:q,onPointerDown:J,[le]:M?``:void 0,onKeyDownCapture(){I.current=!0}},f,z],stateAttributesMapping:$})}),pe=o();function me(){return W}function he(){return!1}function ge(){return!0}function _e(){return(0,pe.useSyncExternalStore)(me,he,ge)}function ve(e){let{script:t}=e,{nonce:n}=C();return _e()?(0,Y.jsx)(`script`,{nonce:n,dangerouslySetInnerHTML:{__html:t},suppressHydrationWarning:!0}):null}var ye,be={...$,activeTabPosition:()=>null,activeTabSize:()=>null},xe=X.forwardRef(function(e,t){let{className:n,render:r,renderBeforeHydration:i=!1,style:a,...o}=e,{getTabElementBySelectedValue:s,orientation:c,tabActivationDirection:l,value:u}=Q(),{tabsListElement:d,registerIndicatorUpdateListener:f}=de(),p=ie();X.useEffect(()=>f(p),[f,p]);let m=0,h=0,g=0,_=0,v=0,y=0,b=!1;if(u!=null&&d!=null){let e=s(u);if(e!=null){b=!0;let{width:t,height:n}=Z(e),{width:r,height:i}=Z(d),a=e.getBoundingClientRect(),o=d.getBoundingClientRect(),s=r>0?o.width/r:1,c=i>0?o.height/i:1;if(s>2**-52&&c>2**-52){let e=a.left-o.left,t=a.top-o.top;m=e/s+d.scrollLeft-d.clientLeft,g=t/c+d.scrollTop-d.clientTop}else m=e.offsetLeft,g=e.offsetTop;v=t,y=n,h=d.scrollWidth-m-v,_=d.scrollHeight-g-y}}let x=b?{left:m,right:h,top:g,bottom:_}:null,S=b?{width:v,height:y}:null,C=b?{"--active-tab-left":`${m}px`,"--active-tab-right":`${h}px`,"--active-tab-top":`${g}px`,"--active-tab-bottom":`${_}px`,"--active-tab-width":`${v}px`,"--active-tab-height":`${y}px`}:void 0,w=U(`span`,e,{state:{orientation:c,activeTabPosition:x,activeTabSize:S,tabActivationDirection:l},ref:t,props:[{role:`presentation`,style:C,hidden:!(b&&v>0&&y>0)},o,{suppressHydrationWarning:!0}],stateAttributesMapping:be});return u==null?null:(0,Y.jsxs)(X.Fragment,{children:[w,i&&(ye||=(0,Y.jsx)(ve,{script:``}))]})}),Se={...$,...M},Ce=X.forwardRef(function(e,t){let{className:n,value:r,render:i,keepMounted:a=!1,style:o,...c}=e,{value:l,getTabIdByPanelValue:u,orientation:d,tabActivationDirection:f,registerMountedTabPanel:p}=Q(),m=_(),{ref:h,index:y}=J(),b=r===l,{mounted:x,transitionStatus:S,setMounted:C}=s(b),w=!x,T=u(r),E={hidden:w,orientation:d,tabActivationDirection:f,transitionStatus:S},D=X.useRef(null),O=U(`div`,e,{state:E,ref:[t,h,D],props:[{"aria-labelledby":T,hidden:w,id:m,role:`tabpanel`,tabIndex:b?0:-1,inert:v(!b),"data-index":y},c],stateAttributesMapping:Se});return g({open:b,ref:D,onComplete(){b||C(!1)}}),A(()=>{if(!(m==null||w&&!a))return p(r,m)},[w,a,r,m,p]),a||x?O:null}),we=[];function Te(e){let{loopFocus:t=!0,orientation:n=`both`,grid:r,onLoop:a,direction:o,highlightedIndex:s,onHighlightedIndexChange:c,rootRef:l,enableHomeAndEndKeys:u=!1,stopEventPropagation:f,disabledIndices:h,modifierKeys:g=we}=e,[_,v]=X.useState(0),b=r!=null,S=X.useRef(null),C=H(S,l),T=X.useRef([]),D=X.useRef(!1),O=s??_,M=P((e,t=!1)=>{if((c??v)(e),t){let t=T.current[e];i(S.current,t,o,n)}}),N=P(e=>{if(e.size===0||D.current)return;D.current=!0;let t=Array.from(e.keys()),r=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,a=r?e.get(r)?.index??-1:-1;if(a!==-1)M(a);else if(y(t,O,h)){let e=w(t,{disabledIndices:h});E(t,e)||M(e)}i(S.current,r,o,n)});A(()=>{if(h==null||s!=null||!D.current)return;let e=T.current;if(y(e,O,h)){let t=w(e,{disabledIndices:h});E(e,t)||M(t)}},[h,s,O,T,M]);let F=P((e,t,n)=>a?a(e,t,n,T):n),L=P(e=>{let i=e.key===`Home`||e.key===`End`;if(!p.has(e.key)||!u&&i||Ee(e,g)||!S.current)return;let s=o===`rtl`,c=s?z:x,l=s?x:z,_=n===`vertical`?I:c,v=n===`vertical`?R:l,y=d(e.nativeEvent);if(y!=null&&m(y)&&!te(y)){let t=y.selectionStart,n=y.selectionEnd,r=y.value;if(t==null||e.shiftKey||t!==n||e.key!==v&&t<r.length||e.key!==_&&t>0)return}let C=O,D=k(T,h),A=j(T,h);r!=null&&(C=r({disabledIndices:h,elementsRef:T,event:e,highlightedIndex:O,loopFocus:t,maxIndex:A,minIndex:D,onLoop:F,orientation:n,rtl:s}));let N=n!==`vertical`&&e.key===c||n!==`horizontal`&&e.key===`ArrowDown`,P=n!==`vertical`&&e.key===l||n!==`horizontal`&&e.key===`ArrowUp`;u&&(e.key===`Home`?C=D:e.key===`End`&&(C=A)),C===O&&(N||P)&&(t&&C===A&&N?(C=D,a&&(C=a(e,O,C,T))):t&&C===D&&P?(C=A,a&&(C=a(e,O,C,T))):C=w(T.current,{startingIndex:C,decrement:P,disabledIndices:h})),C!==O&&!E(T.current,C)&&(f&&e.stopPropagation(),(b||i||N||P)&&e.preventDefault(),M(C,!0),queueMicrotask(()=>{T.current[C]?.focus()}))});return{props:{ref:C,onFocus(e){let t=S.current,n=d(e.nativeEvent);!t||n==null||!m(n)||n.setSelectionRange(0,n.value.length)},onKeyDown:L},highlightedIndex:O,onHighlightedIndexChange:M,elementsRef:T,onMapChange:N,relayKeyboardEvent:L}}function Ee(e,t){for(let n of L)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function De(e){let{render:t,className:n,style:r,refs:i=q,props:a=q,state:o=V,stateAttributesMapping:s,highlightedIndex:c,onHighlightedIndexChange:l,orientation:u,grid:d,loopFocus:f,onLoop:p,enableHomeAndEndKeys:m,onMapChange:h,stopEventPropagation:g=!0,rootRef:_,disabledIndices:v,modifierKeys:y,highlightItemOnHover:b=!1,tag:x=`div`,...S}=e,{props:C,highlightedIndex:w,onHighlightedIndexChange:E,elementsRef:O,onMapChange:k,relayKeyboardEvent:A}=Te({grid:d,loopFocus:f,onLoop:p,orientation:u,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:_,stopEventPropagation:g,enableHomeAndEndKeys:m,direction:T(),disabledIndices:v,modifierKeys:y}),j=U(x,e,{state:o,ref:i,props:[C,...a,S],stateAttributesMapping:s}),M=X.useMemo(()=>({highlightedIndex:w,onHighlightedIndexChange:E,highlightItemOnHover:b,relayKeyboardEvent:A}),[w,E,b,A]);return(0,Y.jsx)(D.Provider,{value:M,children:(0,Y.jsx)(ee,{elementsRef:O,onMapChange:e=>{h?.(e),k(e)},children:j})})}var Oe=X.forwardRef(function(e,t){let{activateOnFocus:n=!1,className:r,loopFocus:i=!0,render:a,style:o,...s}=e,{orientation:c,setTabMap:l,tabActivationDirection:u}=Q(),[d,f]=X.useState(0),[p,m]=X.useState(null),h=X.useRef(new Set),g=X.useRef(new Set),_=X.useRef(null);A(()=>{if(typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>{h.current.forEach(e=>{e()})});return _.current=e,p&&e.observe(p),g.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),_.current=null}},[p]);let v=P(e=>(h.current.add(e),()=>{h.current.delete(e)})),y=P(e=>(g.current.add(e),_.current?.observe(e),()=>{g.current.delete(e),_.current?.unobserve(e)})),b={orientation:c,tabActivationDirection:u},x={"aria-orientation":c===`vertical`?`vertical`:void 0,role:`tablist`},S=X.useMemo(()=>({activateOnFocus:n,registerIndicatorUpdateListener:v,registerTabResizeObserverElement:y,tabsListElement:p}),[n,v,y,p]);return(0,Y.jsx)(ue.Provider,{value:S,children:(0,Y.jsx)(De,{render:a,className:r,style:o,state:b,refs:[t,m],props:[x,s],stateAttributesMapping:$,highlightedIndex:d,enableHomeAndEndKeys:!0,loopFocus:i,orientation:c,onHighlightedIndexChange:f,onMapChange:l,disabledIndices:q})})});function ke({className:e,...t}){return(0,Y.jsx)(oe,{className:G(`flex flex-col gap-4`,e),"data-slot":`tabs`,...t})}function Ae({className:e,...t}){return(0,Y.jsxs)(Oe,{className:G(`relative z-0 flex w-fit items-center gap-1 rounded-lg bg-muted p-1`,e),"data-slot":`tabs-list`,...t,children:[t.children,(0,Y.jsx)(xe,{className:`absolute top-1/2 left-0 z-[-1] h-[calc(100%-0.5rem)] w-(--active-tab-width) -translate-y-1/2 translate-x-(--active-tab-left) rounded-md bg-background shadow-xs transition-all duration-150`,"data-slot":`tabs-indicator`})]})}function je({className:e,...t}){return(0,Y.jsx)(fe,{className:G(`flex h-7 cursor-pointer items-center justify-center whitespace-nowrap rounded-md border border-transparent px-2.5 font-medium text-muted-foreground text-sm outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring data-selected:text-foreground`,e),"data-slot":`tabs-tab`,...t})}function Me({className:e,...t}){return(0,Y.jsx)(Ce,{className:G(`flex-1 outline-none`,e),"data-slot":`tabs-panel`,...t})}export{Z as a,je as i,Ae as n,Me as r,ke as t};
|
package/dist/gui/index.html
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
if (link) link.href = iconHref;
|
|
28
28
|
})();
|
|
29
29
|
</script>
|
|
30
|
-
<script type="module" crossorigin src="/assets/index-
|
|
30
|
+
<script type="module" crossorigin src="/assets/index-R0fvXNEi.js"></script>
|
|
31
31
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
32
32
|
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-DE3RlOCf.js">
|
|
33
33
|
<link rel="modulepreload" crossorigin href="/assets/button-BrcP8Wxx.js">
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
<link rel="modulepreload" crossorigin href="/assets/monaco-DLwhzYMT.js">
|
|
36
36
|
<link rel="modulepreload" crossorigin href="/assets/brand-Bj6g9sFF.js">
|
|
37
37
|
<link rel="modulepreload" crossorigin href="/assets/client-CQ3EdyuW.js">
|
|
38
|
-
<link rel="modulepreload" crossorigin href="/assets/queries-
|
|
38
|
+
<link rel="modulepreload" crossorigin href="/assets/queries-F2H3SwGY.js">
|
|
39
39
|
<link rel="modulepreload" crossorigin href="/assets/chevron-down-Dy03VL1q.js">
|
|
40
40
|
<link rel="modulepreload" crossorigin href="/assets/useValueChanged-DcnEcpiS.js">
|
|
41
41
|
<link rel="modulepreload" crossorigin href="/assets/isElementDisabled-Cpw8EvLX.js">
|
|
42
42
|
<link rel="modulepreload" crossorigin href="/assets/status-CKOvrZ16.js">
|
|
43
43
|
<link rel="stylesheet" crossorigin href="/assets/monaco-d9IpiNv7.css">
|
|
44
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
44
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BO8b3Dk2.css">
|
|
45
45
|
</head>
|
|
46
46
|
<body>
|
|
47
47
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-DE3RlOCf.js";import{t as r}from"./input-LtE7Sz4D.js";import{$ as ee,B as te,G as ne,T as re,et as ie,g as ae,l as oe,r as i,t as a,z as se}from"./queries-CtxmqmGJ.js";import{h as o,m as s,t as c}from"./button-BrcP8Wxx.js";import{t as l}from"./bot-D5yM1Tw6.js";import{t as ce}from"./trash-2-BrrLX4tD.js";import{C as u,D as d,Dt as le,Kt as ue,O as f,S as p,T as m,Tt as h,w as g,x as de}from"./index-qvc4aLwP.js";import{a as fe,i as pe,n as me,o as he,r as ge,s as _e,t as ve}from"./alert-dialog-CdWem4Th.js";import{t as _}from"./badge-DQIZRRDZ.js";import{t as ye}from"./card-BMggHY3n.js";import{a as v,i as be,n as y,r as b,t as x}from"./empty-DK2eW2rF.js";import{t as S}from"./label-C610MHwq.js";import{t as C}from"./textarea-0lXkxsuX.js";var xe=o(`file-up`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]),w=e(t(),1),T=n(),E={id:``,name:``,category:`general`,description:``,developerInstructions:``};function D(e){return e.toLowerCase().trim().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)}function O({showToast:e}){let[t,n]=(0,w.useState)(`global`),[o,O]=(0,w.useState)(``),[Se,k]=(0,w.useState)(!1),[A,j]=(0,w.useState)(!1),[M,N]=(0,w.useState)(null),[P,F]=(0,w.useState)(E),[I,L]=(0,w.useState)(``),[R,z]=(0,w.useState)(null),[B,V]=(0,w.useState)(null),{data:H=[],isLoading:Ce,isError:we}=a(),{data:U=[]}=te(),W=se(t===`global`?``:t),G=re(),K=ae(),q=oe(),J=i(),Y=t!==`global`,Te=U.find(e=>e.id===t),X=!Y||Te?.assistants?.includes(`codex`),Z=Y&&X&&!W.isLoading&&!W.isError&&!!W.data;(0,w.useEffect)(()=>{if(!Y){z(null);return}W.data&&z([...W.data.enabledAgents??[]])},[Y,t,W.data]);let Q=(0,w.useMemo)(()=>{let e=o.trim().toLowerCase();return e?H.filter(t=>[t.name,t.description,t.category].some(t=>t.toLowerCase().includes(e))):H},[H,o]),Ee=new Set(R??W.data?.enabledAgents??[]);function $(){N(null),F(E),k(!0)}function De(e){N(e.id),F({id:e.id,name:e.name,category:e.category,description:e.description,developerInstructions:e.developerInstructions,model:e.model,modelReasoningEffort:e.modelReasoningEffort,sandboxMode:e.sandboxMode}),k(!0)}async function Oe(){try{let t=M??D(P.name);await G.mutateAsync({...P,id:t,name:t}),k(!1),e?.(`Codex agent saved`,`success`)}catch(t){e?.(t instanceof Error?t.message:`Failed to save agent`,`error`)}}async function ke(){try{await K.mutateAsync({toml:I,category:`general`}),j(!1),L(``),e?.(`Codex agent imported`,`success`)}catch(t){e?.(t instanceof Error?t.message:`Failed to import agent`,`error`)}}async function Ae(){if(B)try{await q.mutateAsync(B.id),V(null),e?.(`Agent deleted from the personal catalog`,`info`)}catch(t){e?.(t instanceof Error?t.message:`Failed to delete agent`,`error`)}}function je(e){if(!Z||R===null)return;let t=new Set(R);t.has(e)?t.delete(e):t.add(e),z([...t])}async function Me(){if(!(!W.data||R===null))try{await J.mutateAsync({workspaceId:t,expectedRevision:W.data.revision??0,enabledSkills:W.data.enabledSkills,enabledAgents:R,enabledCategories:W.data.enabledCategories??[]}),e?.(`Agent selection saved. Refresh the workspace to apply it.`,`success`)}catch(t){e?.(t instanceof Error?t.message:`Failed to save agent selection`,`error`)}}return(0,T.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,T.jsxs)(`header`,{className:`flex flex-wrap items-center justify-between gap-4 border-b border-border px-6 py-5`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,T.jsx)(`div`,{className:`rounded-lg bg-primary/10 p-2 text-primary`,children:(0,T.jsx)(l,{className:`h-5 w-5`})}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`h1`,{className:`text-xl font-bold tracking-tight`,children:`Codex Agent Library`}),(0,T.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Create and reuse project-scoped Codex custom agents.`})]})]}),(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,T.jsx)(c,{render:(0,T.jsx)(ne,{to:`/skills`}),variant:`outline`,size:`sm`,children:`Skills`}),(0,T.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-border bg-muted/50 px-3 py-1.5`,children:[(0,T.jsx)(ie,{className:`h-4 w-4 text-muted-foreground`}),(0,T.jsx)(S,{htmlFor:`agent-scope`,className:`text-xs text-muted-foreground`,children:`Scope`}),(0,T.jsxs)(`select`,{id:`agent-scope`,value:t,onChange:e=>n(e.target.value),className:`cursor-pointer bg-transparent text-xs font-semibold text-foreground focus:outline-none`,children:[(0,T.jsx)(`option`,{value:`global`,children:`Personal catalog`}),U.map(e=>(0,T.jsx)(`option`,{value:e.id,children:e.id},e.id))]})]}),Y?(0,T.jsx)(c,{size:`sm`,onClick:Me,disabled:!Z||J.isPending,children:J.isPending?`Saving…`:`Save selection`}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(c,{variant:`outline`,size:`sm`,onClick:()=>j(!0),children:[(0,T.jsx)(xe,{className:`mr-1.5 h-4 w-4`}),`Import TOML`]}),(0,T.jsxs)(c,{size:`sm`,onClick:$,children:[(0,T.jsx)(h,{className:`mr-1.5 h-4 w-4`}),`New agent`]})]})]})]}),(0,T.jsx)(`div`,{className:`border-b border-border/60 bg-muted/20 px-6 py-3`,children:(0,T.jsxs)(`div`,{className:`relative max-w-md`,children:[(0,T.jsx)(ee,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground`}),(0,T.jsx)(r,{value:o,onChange:e=>O(e.target.value),placeholder:`Search agents…`,className:`pl-9`})]})}),(0,T.jsx)(`main`,{className:`min-h-0 flex-1 overflow-auto p-6`,children:Ce||Y&&W.isLoading?(0,T.jsx)(`div`,{className:`flex justify-center p-12`,children:(0,T.jsx)(de,{})}):we||Y&&W.isError?(0,T.jsx)(x,{className:`border border-dashed py-12`,children:(0,T.jsxs)(b,{children:[(0,T.jsx)(v,{children:`Resources could not be loaded`}),(0,T.jsx)(y,{children:`Assignment controls remain disabled to protect the saved selection.`})]})}):Y&&!X?(0,T.jsx)(x,{className:`border border-dashed py-12`,children:(0,T.jsxs)(b,{children:[(0,T.jsx)(v,{children:`Codex is not enabled for this workspace`}),(0,T.jsx)(y,{children:`Add Codex to the workspace before assigning Codex-native agents.`})]})}):Q.length===0?(0,T.jsxs)(x,{className:`border border-dashed py-12`,children:[(0,T.jsx)(be,{children:(0,T.jsx)(l,{className:`h-8 w-8 text-muted-foreground`})}),(0,T.jsxs)(b,{children:[(0,T.jsx)(v,{children:`No Codex agents found`}),(0,T.jsx)(y,{children:`Create an agent or import a native TOML definition.`})]}),!Y&&(0,T.jsxs)(c,{size:`sm`,onClick:$,children:[(0,T.jsx)(h,{className:`mr-1.5 h-4 w-4`}),`New agent`]})]}):(0,T.jsx)(`div`,{className:`mx-auto grid max-w-6xl grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3`,children:Q.map(e=>{let t=Ee.has(e.id);return(0,T.jsxs)(ye,{className:s(`flex flex-col gap-4 p-4`,Y&&!t&&`opacity-60`),children:[(0,T.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(`h2`,{className:`font-semibold`,children:e.name}),(0,T.jsx)(_,{variant:`outline`,children:`Codex`})]}),(0,T.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:e.description})]}),Y?(0,T.jsxs)(c,{variant:t?`default`:`outline`,size:`sm`,onClick:()=>je(e.id),disabled:!Z,children:[(0,T.jsx)(ue,{className:s(`mr-1 h-3.5 w-3.5`,!t&&`opacity-0`)}),t?`Enabled`:`Disabled`]}):(0,T.jsxs)(`div`,{className:`flex gap-1`,children:[(0,T.jsx)(c,{variant:`ghost`,size:`icon`,"aria-label":`Edit ${e.name}`,onClick:()=>De(e),children:(0,T.jsx)(le,{className:`h-4 w-4`})}),(0,T.jsx)(c,{variant:`ghost`,size:`icon`,"aria-label":`Delete ${e.name}`,onClick:()=>V(e),children:(0,T.jsx)(ce,{className:`h-4 w-4`})})]})]}),(0,T.jsxs)(`div`,{className:`flex flex-wrap gap-2 text-xs text-muted-foreground`,children:[e.sandboxMode&&(0,T.jsx)(_,{variant:`secondary`,children:e.sandboxMode}),e.modelReasoningEffort&&(0,T.jsx)(_,{variant:`secondary`,children:e.modelReasoningEffort}),e.model&&(0,T.jsx)(_,{variant:`secondary`,children:e.model})]})]},e.id)})})}),(0,T.jsx)(p,{open:Se,onOpenChange:k,children:(0,T.jsxs)(d,{className:`max-w-2xl`,children:[(0,T.jsxs)(m,{children:[(0,T.jsx)(f,{children:M?`Edit Codex agent`:`Create Codex agent`}),(0,T.jsx)(u,{children:`Only the current stable native fields are managed. Omitted settings inherit from Codex.`})]}),(0,T.jsxs)(`div`,{className:`grid gap-4 py-2`,children:[(0,T.jsxs)(`div`,{className:`grid gap-2`,children:[(0,T.jsx)(S,{htmlFor:`agent-name`,children:`Name`}),(0,T.jsx)(r,{id:`agent-name`,value:P.name,disabled:!!M,onChange:e=>F({...P,name:D(e.target.value)}),placeholder:`code-reviewer`})]}),(0,T.jsxs)(`div`,{className:`grid gap-2`,children:[(0,T.jsx)(S,{htmlFor:`agent-description`,children:`Description`}),(0,T.jsx)(r,{id:`agent-description`,value:P.description,onChange:e=>F({...P,description:e.target.value}),placeholder:`Use when reviewing a fixed diff for correctness and security.`})]}),(0,T.jsxs)(`div`,{className:`grid gap-2`,children:[(0,T.jsx)(S,{htmlFor:`agent-instructions`,children:`Developer instructions`}),(0,T.jsx)(C,{id:`agent-instructions`,value:P.developerInstructions,onChange:e=>F({...P,developerInstructions:e.target.value}),className:`min-h-48 font-mono`})]}),(0,T.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-3`,children:[(0,T.jsxs)(`div`,{className:`grid gap-2`,children:[(0,T.jsx)(S,{htmlFor:`agent-model`,children:`Model override`}),(0,T.jsx)(r,{id:`agent-model`,value:P.model??``,onChange:e=>F({...P,model:e.target.value||void 0}),placeholder:`Inherit`})]}),(0,T.jsxs)(`div`,{className:`grid gap-2`,children:[(0,T.jsx)(S,{htmlFor:`agent-effort`,children:`Reasoning`}),(0,T.jsxs)(`select`,{id:`agent-effort`,value:P.modelReasoningEffort??``,onChange:e=>F({...P,modelReasoningEffort:e.target.value||void 0}),className:`h-9 rounded-md border border-input bg-background px-3 text-sm`,children:[(0,T.jsx)(`option`,{value:``,children:`Inherit`}),(0,T.jsx)(`option`,{value:`low`,children:`Low`}),(0,T.jsx)(`option`,{value:`medium`,children:`Medium`}),(0,T.jsx)(`option`,{value:`high`,children:`High`}),(0,T.jsx)(`option`,{value:`xhigh`,children:`XHigh`}),(0,T.jsx)(`option`,{value:`max`,children:`Max`}),(0,T.jsx)(`option`,{value:`ultra`,children:`Ultra`})]})]}),(0,T.jsxs)(`div`,{className:`grid gap-2`,children:[(0,T.jsx)(S,{htmlFor:`agent-sandbox`,children:`Sandbox`}),(0,T.jsxs)(`select`,{id:`agent-sandbox`,value:P.sandboxMode??``,onChange:e=>F({...P,sandboxMode:e.target.value||void 0}),className:`h-9 rounded-md border border-input bg-background px-3 text-sm`,children:[(0,T.jsx)(`option`,{value:``,children:`Inherit`}),(0,T.jsx)(`option`,{value:`read-only`,children:`Read only`}),(0,T.jsx)(`option`,{value:`workspace-write`,children:`Workspace write`})]})]})]})]}),(0,T.jsxs)(g,{children:[(0,T.jsx)(c,{variant:`outline`,onClick:()=>k(!1),children:`Cancel`}),(0,T.jsx)(c,{onClick:Oe,disabled:G.isPending||!P.name||!P.description||!P.developerInstructions,children:G.isPending?`Saving…`:`Save agent`})]})]})}),(0,T.jsx)(p,{open:A,onOpenChange:j,children:(0,T.jsxs)(d,{className:`max-w-2xl`,children:[(0,T.jsxs)(m,{children:[(0,T.jsx)(f,{children:`Import Codex agent TOML`}),(0,T.jsx)(u,{children:`The import accepts the required native fields and supported model, reasoning, and sandbox overrides.`})]}),(0,T.jsx)(C,{value:I,onChange:e=>L(e.target.value),className:`min-h-72 font-mono`,placeholder:`name = "reviewer"
|
|
2
|
-
description = "Use for code review."
|
|
3
|
-
developer_instructions = "Review the fixed diff."`}),(0,T.jsxs)(g,{children:[(0,T.jsx)(c,{variant:`outline`,onClick:()=>j(!1),children:`Cancel`}),(0,T.jsx)(c,{onClick:ke,disabled:K.isPending||!I.trim(),children:K.isPending?`Importing…`:`Import agent`})]})]})}),(0,T.jsx)(ve,{open:B!==null,onOpenChange:e=>!e&&V(null),children:(0,T.jsxs)(he,{children:[(0,T.jsxs)(fe,{children:[(0,T.jsxs)(_e,{children:[`Delete “`,B?.name,`”?`]}),(0,T.jsx)(ge,{children:`This removes the agent from the personal catalog. Existing workspace copies remain until the workspace is refreshed.`})]}),(0,T.jsxs)(pe,{children:[(0,T.jsx)(me,{render:(0,T.jsx)(c,{variant:`outline`,children:`Cancel`})}),(0,T.jsx)(c,{variant:`destructive`,onClick:Ae,disabled:q.isPending,children:q.isPending?`Deleting…`:`Delete agent`})]})]})})]})}export{O as AgentsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-DE3RlOCf.js";import{$ as r,F as i,U as a,Z as o,_ as ee,et as s,n as c}from"./queries-CtxmqmGJ.js";import{h as l,m as u,t as d}from"./button-BrcP8Wxx.js";import{a as f,g as p,i as m,m as h,n as g,r as te,s as _}from"./status-CKOvrZ16.js";import{t as ne}from"./brand-Bj6g9sFF.js";import{n as re}from"./client-CQ3EdyuW.js";import{Ft as v,Qt as y,Tt as b,Vt as x,Xt as S,b as C,qt as w,vt as T,x as E,xt as D,z as O}from"./index-qvc4aLwP.js";import{t as k}from"./card-BMggHY3n.js";import{a as ie,i as A,n as j,r as M,t as N}from"./empty-DK2eW2rF.js";var ae=l(`file-diff`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M9 10h6`,key:`9gxzsh`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}]]),P=e(t(),1),F=n(),oe=[{id:`antigravity`,name:`Google Antigravity`,shortName:`Antigravity`,cliCommand:`agy`,icon:(0,F.jsx)(m,{className:`size-4`}),getOptions:({aiDetected:e,launchTargets:t})=>[{id:`antigravity-cli`,label:`CLI in Terminal`,shortLabel:`CLI`,type:`cli`,command:`agy`,isAvailable:e.antigravity??!1,unavailableReason:`CLI "agy" not found on PATH`,icon:(0,F.jsx)(T,{size:12})},{id:`antigravity-ide`,label:`Antigravity IDE Workspace`,shortLabel:`IDE`,type:`editor`,targetId:`antigravity`,isAvailable:t.find(e=>e.id===`antigravity`)?.available??!1,unavailableReason:`Antigravity IDE not installed`,icon:(0,F.jsx)(x,{size:12})}]},{id:`claude`,name:`Claude Code`,shortName:`Claude`,cliCommand:`claude`,icon:(0,F.jsx)(`span`,{className:`grid size-5 place-items-center rounded bg-[#D97757] text-white shadow-2xs`,children:(0,F.jsx)(f,{className:`size-3`})}),getOptions:({aiDetected:e,launchTargets:t})=>[{id:`claude-cli`,label:`CLI in Terminal`,shortLabel:`CLI`,type:`cli`,command:`claude`,isAvailable:e.claude??!1,unavailableReason:`CLI "claude" not found on PATH`,icon:(0,F.jsx)(T,{size:12})},{id:`claude-desktop`,label:`Claude Desktop App`,shortLabel:`App`,type:`app`,targetId:`claude-desktop`,isAvailable:t.find(e=>e.id===`claude-desktop`)?.available??!1,unavailableReason:`Claude Desktop not detected`,icon:(0,F.jsx)(p,{size:12})}]},{id:`codex`,name:`OpenAI Codex`,shortName:`Codex`,cliCommand:`codex`,icon:(0,F.jsx)(`span`,{className:`grid size-5 place-items-center rounded bg-foreground text-background shadow-2xs`,children:(0,F.jsx)(h,{className:`size-3`})}),getOptions:({aiDetected:e,launchTargets:t})=>[{id:`codex-cli`,label:`CLI in Terminal`,shortLabel:`CLI`,type:`cli`,command:`codex`,isAvailable:e.codex??!1,unavailableReason:`CLI "codex" not found on PATH`,icon:(0,F.jsx)(T,{size:12})},{id:`codex-desktop`,label:`Codex Desktop App`,shortLabel:`App`,type:`app`,targetId:`codex-desktop`,isAvailable:t.find(e=>e.id===`codex-desktop`)?.available??!1,unavailableReason:`Codex Desktop not detected`,icon:(0,F.jsx)(p,{size:12})}]},{id:`copilot`,name:`GitHub Copilot`,shortName:`Copilot`,cliCommand:`copilot`,icon:(0,F.jsx)(`span`,{className:`grid size-5 place-items-center rounded bg-gradient-to-tr from-purple-600 via-indigo-500 to-blue-600 text-white shadow-2xs`,children:(0,F.jsx)(_,{className:`size-3`})}),getOptions:({aiDetected:e,launchTargets:t})=>[{id:`copilot-cli`,label:`Copilot CLI in Terminal`,shortLabel:`CLI`,type:`cli`,command:`copilot`,isAvailable:e.copilot??!1,icon:(0,F.jsx)(T,{size:12})},{id:`copilot-vscode`,label:`VS Code with Copilot`,shortLabel:`VS Code`,type:`editor`,targetId:`vscode`,isAvailable:t.find(e=>e.id===`vscode`)?.available??!1,unavailableReason:`VS Code not detected`,icon:(0,F.jsx)(x,{size:12})}]}];function I({workspaces:e,workspaceStatuses:t,workspacesLoading:n=!1,onOpenWorkspace:l,onNewWorkspace:f,showToast:p}){let m=c(),h=i(),_=ee(),{openCli:x}=a(),[I,L]=(0,P.useState)(``),[R,z]=(0,P.useState)(!1),[B,V]=(0,P.useState)(``),H=e.find(e=>e.branchName===B)??e[0],U=e.filter(e=>`${e.branchName} ${e.description??``} ${e.repos.join(` `)}`.toLowerCase().includes(I.trim().toLowerCase())&&(!R||(t[e.branchName]?.changedFiles??0)>0)),[W,G]=(0,P.useState)(null),K=e.flatMap(e=>t[e.branchName]?[t[e.branchName]]:[]),q=K.reduce((e,t)=>e+(t.changedFiles||0),0),se=K.filter(e=>e.changedFiles>0).length,ce=e.filter(e=>(e.mode??`worktree`)===`worktree`).length,le=e.filter(e=>e.mode===`in-place`).length,J=(0,P.useMemo)(()=>{let t=new Map;return e.forEach(e=>{(e.repos||[]).forEach(e=>{let n=g(e),r=t.get(e);r?r.count+=1:t.set(e,{name:n,path:e,count:1})})}),Array.from(t.values())},[e]),Y=(0,P.useMemo)(()=>{let e={};return(m.data??[]).forEach(t=>{e[t.name]=t.detected}),e},[m.data]),X=(0,P.useMemo)(()=>h.data??[],[h.data]),Z=(0,P.useMemo)(()=>oe.map(e=>{let t=e.getOptions({aiDetected:Y,launchTargets:X}),n=t.filter(e=>e.isAvailable),r=n[0]||t[0],i=n.length>0,a=`Not found`,o=`neutral`;return n.length>1?(a=`${n.map(e=>e.shortLabel).join(` & `)} Ready`,o=`success`):n.length===1&&(a=`${n[0].shortLabel} Ready`,o=`success`),{harness:e,allOptions:t,availableOptions:n,primaryOption:r,isAnyAvailable:i,statusLabel:a,statusTone:o}}),[Y,X]),ue=async(e,t)=>{if(W)return;let n=H;if(!n){p?.(`No active workspace available to launch harness in.`,`error`);return}let r=`${e.id}:${t.id}`;G(r);try{t.type===`cli`?(await _.mutateAsync({workspaceId:n.branchName,assistant:e.id,command:t.command}),p?.(`Opened ${e.name} inside ContextSpace for ${n.branchName}`,`success`)):t.targetId&&(await re(`/api/workspace/${encodeURIComponent(n.branchName)}/launch`,{method:`POST`,body:JSON.stringify({targetId:t.targetId})}),p?.(`Opened ${n.branchName} in ${e.name} (${t.label})`,`success`))}catch(t){p?.(`Failed to launch ${e.name}: ${t instanceof Error?t.message:String(t)}`,`error`)}finally{G(null)}},Q=o(),{customTitles:$}=O();return(0,F.jsxs)(`div`,{className:`mx-auto max-w-7xl space-y-6 pb-12 animate-fade-in`,children:[(0,F.jsxs)(`header`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-4 border-b border-border/80 pb-4`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-mono text-muted-foreground mb-1`,children:[(0,F.jsx)(y,{size:14,className:`text-primary`}),(0,F.jsx)(`span`,{children:ne}),(0,F.jsx)(`span`,{className:`opacity-40`,children:`/`}),(0,F.jsx)(`span`,{className:`text-foreground font-semibold`,children:`Cockpit Overview`})]}),(0,F.jsx)(`h1`,{className:`text-xl font-bold tracking-tight text-foreground`,children:`Multi-Worktree Process & Review Station`})]}),(0,F.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,F.jsxs)(d,{onClick:f,size:`sm`,className:`h-8 gap-1.5 px-3.5 bg-primary text-primary-foreground font-semibold hover:bg-primary/90 shadow-xs cursor-pointer text-xs`,children:[(0,F.jsx)(b,{size:14}),` New Worktree`]})})]}),(0,F.jsx)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-4`,children:[{label:`Active Worktrees`,value:n?`—`:e.length,detail:`${ce} isolated · ${le} host`,icon:s},{label:`Review Queue`,value:K.length?q:`—`,detail:`${se} worktrees with diffs`,icon:v,isDirty:q>0},{label:`Tracked Repos`,value:n?`—`:J.length,detail:`Connected on local host`,icon:w},{label:`AI Assistants`,value:m.isLoading||h.isLoading?`—`:Z.filter(e=>e.isAnyAvailable).length,detail:`Antigravity, Claude, Codex`,icon:D}].map(({label:e,value:t,detail:n,icon:r,isDirty:i})=>(0,F.jsxs)(k,{className:`bg-card border border-border p-3.5 rounded-xl shadow-xs transition-colors hover:border-border/80`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-xs text-muted-foreground`,children:[(0,F.jsx)(`span`,{className:`font-medium`,children:e}),(0,F.jsx)(r,{size:14,className:i?`text-amber-400`:`text-primary`})]}),(0,F.jsx)(`div`,{className:u(`my-1.5 text-2xl font-bold tracking-tight tabular-nums`,i?`text-amber-400`:`text-foreground`),children:t}),(0,F.jsx)(`p`,{className:`text-[11px] text-muted-foreground font-mono`,children:n})]},e))}),(0,F.jsxs)(`div`,{className:`grid items-start gap-6 xl:grid-cols-[minmax(0,1fr)_320px]`,children:[(0,F.jsxs)(`section`,{className:`min-w-0`,"aria-labelledby":`workspaces-heading`,children:[(0,F.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center justify-between gap-3`,children:[(0,F.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,F.jsxs)(`span`,{id:`workspaces-heading`,className:`text-sm font-bold text-foreground`,children:[`Workspaces (`,U.length,`)`]})}),(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,F.jsxs)(`div`,{className:`relative`,children:[(0,F.jsx)(r,{size:13,className:`absolute left-2.5 top-2.5 text-muted-foreground pointer-events-none`}),(0,F.jsx)(`input`,{"aria-label":`Search workspaces`,value:I,onChange:e=>L(e.target.value),placeholder:`Filter worktrees or repos…`,className:`h-8 w-48 sm:w-64 rounded-lg border border-input bg-card pl-8 pr-3 text-xs outline-none focus:border-primary transition-colors text-foreground`})]}),(0,F.jsxs)(d,{variant:R?`secondary`:`outline`,size:`xs`,className:`h-8 rounded-lg text-xs font-medium cursor-pointer`,"aria-pressed":R,onClick:()=>z(!R),children:[(0,F.jsx)(v,{size:13}),` Diffs only`]})]})]}),n?(0,F.jsx)(k,{className:`p-10 border border-border bg-card`,children:(0,F.jsx)(E,{"aria-label":`Loading workspaces`,className:`mx-auto size-5 text-primary`})}):e.length?U.length?(0,F.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:U.map(e=>{let n=t[e.branchName],r=e.mode===`in-place`||!n?null:te(n.syncStatus),i=(n?.changedFiles??0)>0,a=$[e.branchName]?.title||e.description||e.branchName,o=!!$[e.branchName]?.title;return(0,F.jsxs)(`div`,{className:`group rounded-xl border border-border bg-card p-4 transition-all hover:border-primary/50 flex flex-col justify-between gap-3 shadow-xs`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`div`,{className:`flex items-start justify-between gap-2 mb-1.5`,children:[(0,F.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,F.jsx)(`h3`,{className:`font-bold text-sm text-foreground truncate cursor-pointer hover:text-primary transition-colors`,onClick:()=>l(e.branchName),title:a,children:a})}),(0,F.jsx)(`span`,{className:u(`shrink-0 px-2 py-0.5 rounded text-[10px] font-mono font-semibold uppercase tracking-wider border`,e.mode===`in-place`?`border-border bg-secondary text-muted-foreground`:`border-emerald-500/25 bg-emerald-500/10 text-emerald-400`),children:e.mode===`in-place`?`in-place`:`isolated`})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 font-mono text-[11px] text-muted-foreground truncate mb-2`,children:[(0,F.jsx)(v,{size:12,className:`text-primary shrink-0`}),(0,F.jsx)(`span`,{className:`truncate font-semibold text-foreground/80`,children:e.branchName}),o&&e.description&&(0,F.jsxs)(`span`,{className:`text-[10px] text-muted-foreground/70 truncate`,children:[`(`,e.description,`)`]})]}),(0,F.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5 mb-2.5`,children:e.repos.map(e=>(0,F.jsx)(`span`,{className:`rounded border border-border/60 bg-secondary/60 px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground`,children:g(e)},e))}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-mono`,children:[i?(0,F.jsxs)(`span`,{className:`flex items-center gap-1.5 text-amber-400 font-semibold`,children:[(0,F.jsx)(`span`,{className:`size-2 rounded-full bg-amber-400 animate-pulse shrink-0`}),n?.changedFiles,` modified files`]}):(0,F.jsxs)(`span`,{className:`flex items-center gap-1.5 text-emerald-400 font-medium`,children:[(0,F.jsx)(`span`,{className:`size-1.5 rounded-full bg-emerald-400 shrink-0`}),`Clean worktree`]}),r&&(0,F.jsxs)(`span`,{className:`text-muted-foreground text-[10px]`,children:[`• `,r.label]})]})]}),(0,F.jsxs)(`div`,{className:`border-t border-border/70 pt-3 flex flex-wrap items-center justify-between gap-2`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,F.jsxs)(d,{size:`xs`,variant:`secondary`,onClick:()=>x(e.branchName),className:`h-7 gap-1 px-2.5 text-xs font-semibold cursor-pointer`,"aria-label":`Open CLI chat for ${e.branchName}`,children:[(0,F.jsx)(T,{size:12}),` CLI chat`]}),i&&(0,F.jsxs)(d,{size:`xs`,onClick:()=>Q(`/workspaces/${encodeURIComponent(e.branchName)}/changes`),className:`h-7 gap-1 px-2.5 bg-primary text-primary-foreground font-semibold text-xs hover:bg-primary/90 cursor-pointer`,title:`Open Monaco Diff Review`,children:[(0,F.jsx)(ae,{size:12}),` Review Diffs`]}),(0,F.jsx)(d,{size:`xs`,variant:`outline`,onClick:()=>l(e.branchName),className:`h-7 text-xs border-border hover:bg-accent cursor-pointer`,children:`Cockpit`})]}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>Q(`/workspaces/${encodeURIComponent(e.branchName)}/plan`),className:`text-[11px] text-muted-foreground hover:text-primary transition-colors flex items-center gap-1 cursor-pointer`,children:[`Plan `,(0,F.jsx)(S,{size:11})]})]})]},e.id)})}):(0,F.jsxs)(k,{className:`rounded-xl border border-border bg-card p-8 text-center`,children:[(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No worktrees match your filter.`}),(0,F.jsx)(d,{variant:`ghost`,size:`xs`,className:`mt-2`,onClick:()=>{L(``),z(!1)},children:`Clear filter`})]}):(0,F.jsx)(k,{className:`rounded-xl border border-dashed border-border bg-card/50 p-8`,children:(0,F.jsxs)(N,{children:[(0,F.jsxs)(M,{children:[(0,F.jsx)(A,{variant:`icon`,children:(0,F.jsx)(s,{})}),(0,F.jsx)(ie,{children:`No active worktrees`}),(0,F.jsx)(j,{children:`Create a worktree to start working on isolated features with dynamic plan steps.`})]}),(0,F.jsxs)(d,{onClick:f,className:`mt-4 bg-primary text-primary-foreground`,children:[(0,F.jsx)(b,{size:14}),` Create First Worktree`]})]})})]}),(0,F.jsxs)(`aside`,{className:`rounded-xl border border-border bg-card p-4 shadow-xs`,"aria-labelledby":`assistants-heading`,children:[(0,F.jsxs)(`div`,{className:`mb-4`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[10px] font-mono font-bold uppercase tracking-wider text-primary mb-1`,children:[(0,F.jsx)(D,{size:12}),` AI Launch Station`]}),(0,F.jsx)(`h2`,{id:`assistants-heading`,className:`text-sm font-bold tracking-tight text-foreground`,children:`External Coding Harnesses`}),(0,F.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Launch agents directly into the target worktree.`})]}),(0,F.jsx)(`label`,{className:`block text-[10px] font-mono uppercase font-bold text-muted-foreground mb-1.5`,htmlFor:`launch-workspace`,children:`Target Worktree`}),(0,F.jsxs)(`select`,{id:`launch-workspace`,value:H?.branchName??``,onChange:e=>V(e.target.value),disabled:!e.length||!!W,className:`mb-4 h-8 w-full rounded-md border border-input bg-secondary px-2 font-mono text-xs text-foreground focus-visible:outline-ring`,children:[!e.length&&(0,F.jsx)(`option`,{value:``,children:`Create a workspace first`}),e.map(e=>(0,F.jsx)(`option`,{value:e.branchName,children:$[e.branchName]?.title?`${$[e.branchName]?.title} (${e.branchName})`:e.branchName},e.id))]}),(0,F.jsx)(`div`,{className:`divide-y divide-border/60`,children:Z.map(({harness:e,availableOptions:t,isAnyAvailable:n,statusTone:r})=>(0,F.jsxs)(`div`,{className:`py-3 first:pt-0 last:pb-0`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-2 mb-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.icon,(0,F.jsx)(`h3`,{className:`text-xs font-semibold text-foreground`,children:e.name})]}),(0,F.jsx)(C,{tone:r,children:m.isLoading||h.isLoading?`Checking`:m.isError||h.isError?`Check failed`:n?`Ready`:`Not detected`})]}),(0,F.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:t.map(t=>(0,F.jsxs)(d,{variant:`outline`,size:`xs`,disabled:!!W||!H,onClick:()=>void ue(e,t),title:`Launch ${e.name} in ${H?.branchName??`workspace`}`,className:`h-7 text-xs border-border hover:bg-accent cursor-pointer`,children:[W===`${e.id}:${t.id}`?(0,F.jsx)(E,{className:`size-3`}):t.icon,t.shortLabel,(0,F.jsx)(S,{size:10})]},t.id))})]},e.id))})]})]}),J.length>0&&(0,F.jsxs)(`section`,{className:`border-t border-border pt-4`,children:[(0,F.jsxs)(`div`,{className:`mb-2.5 flex items-center gap-2 text-xs font-mono font-medium text-muted-foreground`,children:[(0,F.jsx)(w,{size:13,className:`text-primary`}),` Tracked Repositories`]}),(0,F.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:J.map(e=>(0,F.jsxs)(`button`,{type:`button`,onClick:()=>{L(e.path),z(!1)},title:e.path,className:`flex items-center gap-2 rounded-lg border border-border bg-card px-3 py-1.5 font-mono text-xs transition-colors hover:border-primary/50 text-foreground cursor-pointer`,children:[(0,F.jsx)(s,{size:12,className:`text-primary`}),(0,F.jsx)(`span`,{children:e.name}),(0,F.jsxs)(`span`,{className:`rounded bg-secondary px-1.5 py-0.2 text-[10px] text-muted-foreground`,children:[e.count,` `,e.count===1?`worktree`:`worktrees`]})]},e.path))})]})]})}export{I as DashboardPage};
|