@mrpatronz/nexusflow 2.18.1 → 2.19.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.
Files changed (43) hide show
  1. package/dist/commands/skill.js +1 -1
  2. package/dist/commands/skill.js.map +1 -1
  3. package/dist/core/planning-refresh.d.ts +7 -0
  4. package/dist/core/planning-refresh.d.ts.map +1 -0
  5. package/dist/core/planning-refresh.js +15 -0
  6. package/dist/core/planning-refresh.js.map +1 -0
  7. package/dist/core/verify.js +1 -1
  8. package/dist/core/verify.js.map +1 -1
  9. package/dist/generators/plan-generator.d.ts.map +1 -1
  10. package/dist/generators/plan-generator.js +50 -7
  11. package/dist/generators/plan-generator.js.map +1 -1
  12. package/dist/gui/assets/{AgentsPage-B9ejJYsf.js → AgentsPage-DsJ8dxJG.js} +2 -2
  13. package/dist/gui/assets/DashboardPage-CtJnqdvu.js +1 -0
  14. package/dist/gui/assets/{DocumentPreview-CtylgIF0.js → DocumentPreview-B1-9LSiH.js} +1 -1
  15. package/dist/gui/assets/{GettingStartedPage-BM8m5uir.js → GettingStartedPage-KkTgBu7C.js} +1 -1
  16. package/dist/gui/assets/{MonacoDiffAdapter-DHYIkG2a.js → MonacoDiffAdapter-CsyKXuq8.js} +1 -1
  17. package/dist/gui/assets/{ProjectsPage-CNZF11wO.js → ProjectsPage-Dsl46Cx5.js} +1 -1
  18. package/dist/gui/assets/{ScaffoldRepoInline-B5qMbiRV.js → ScaffoldRepoInline-BZBzfuYr.js} +1 -1
  19. package/dist/gui/assets/{SettingsPage-S68Q-rBG.js → SettingsPage-BYuNRM43.js} +1 -1
  20. package/dist/gui/assets/{SkillsPage-B97Al8vk.js → SkillsPage-BmsLo_kt.js} +4 -4
  21. package/dist/gui/assets/StartWorkPage-CY9s8_zb.js +1 -0
  22. package/dist/gui/assets/{StrategiesPage-INv0HW7D.js → StrategiesPage-Bd9vJ5ml.js} +2 -2
  23. package/dist/gui/assets/WorkroomsPage-Yoy1dJFI.js +4 -0
  24. package/dist/gui/assets/WorkspacesPage-CpZsBgiV.js +13 -0
  25. package/dist/gui/assets/{alert-dialog-B-6-jHIr.js → alert-dialog-D24plC11.js} +1 -1
  26. package/dist/gui/assets/index-B5-rK_Uq.css +2 -0
  27. package/dist/gui/assets/index-CxyTuBKc.js +80 -0
  28. package/dist/gui/assets/{queries-CJBjicdw.js → queries-DYi6drfC.js} +1 -1
  29. package/dist/gui/assets/{tabs-CJ2imrHY.js → tabs--FCq-tVR.js} +1 -1
  30. package/dist/gui/index.html +3 -3
  31. package/dist/http/work-guidance-routes.d.ts.map +1 -1
  32. package/dist/http/work-guidance-routes.js +6 -5
  33. package/dist/http/work-guidance-routes.js.map +1 -1
  34. package/dist/mcp/planning-tools.d.ts.map +1 -1
  35. package/dist/mcp/planning-tools.js +6 -5
  36. package/dist/mcp/planning-tools.js.map +1 -1
  37. package/package.json +1 -1
  38. package/dist/gui/assets/DashboardPage-BwwB7uTm.js +0 -1
  39. package/dist/gui/assets/StartWorkPage-Dq0Ke4hS.js +0 -1
  40. package/dist/gui/assets/WorkroomsPage-uCiHE87E.js +0 -4
  41. package/dist/gui/assets/WorkspacesPage-CAHQrIgk.js +0 -13
  42. package/dist/gui/assets/index-BzqpMUfC.css +0 -2
  43. package/dist/gui/assets/index-DmbV3DA2.js +0 -80
@@ -1,3 +1,3 @@
1
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{c as a,m as o}from"./brand-hHByyyzq.js";import{n as s}from"./client-B5szthbF.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.
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}})},open:e=>{Q(t=>{let n=[...t.openTabs],r=t.activeTab;return e?(n.includes(e)||n.push(e),r=e):!r&&n.length>0&&(r=n[0]),{...t,isOpen:!0,isMinimized:!1,openTabs:n,activeTab:r,splitTab:r===t.splitTab?t.activeTab:t.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=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};
@@ -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{C as r,D as i,E as a,En as o,In as s,Jn as c,K as l,Kt as u,Ln as d,Mt as f,Nn as p,Nt as m,S as h,T as g,Wt as _,Xt as v,Yt as y,_ as b,_t as x,an as S,b as C,bn as w,cn as T,ht as E,in as D,jt as O,kn as k,ln as A,mt as j,nn as M,on as N,p as P,pt as F,sn as I,v as L,vt as R,x as z,y as B}from"./badge-BObbahyU.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-BONWqXlb.js";import{dt as re}from"./index-DmbV3DA2.js";var Y=n(),X=e(t(),1);function ie(){let[,e]=X.useState({});return X.useCallback(()=>{e({})},[])}function Z(e){let t=A(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=w(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:a=`horizontal`,render:c,value:l,style:u,...d}=e,f=e.defaultValue!==void 0,m=X.useRef([]),[h,g]=X.useState(()=>new Map),[_,v]=o({controlled:l,default:r,name:`Tabs`,state:`value`}),b=l!==void 0,[x,S]=X.useState(()=>new Map),C=X.useRef(void 0),w=X.useCallback(e=>se(x,e),[x]),[E,D]=X.useState(()=>({previousValue:_,tabActivationDirection:`none`})),{previousValue:O,tabActivationDirection:A}=E,j=A,M=!1;O!==_&&(j=ce(O,_,a,x),M=O!=null&&_!=null&&w(_)==null);let N=M?O:_,P=O!==N||A!==j;I(()=>{P&&D({previousValue:N,tabActivationDirection:j})},[N,P,j]);let F=T((e,t)=>{t.activationDirection=ce(_,e,a,x),i?.(e,t),!t.isCanceled&&v(e)}),L=T((e,t)=>{i?.(e,y(t,void 0,void 0,{activationDirection:`none`}))}),R=T((e,t)=>(g(n=>{let r=new Map(n);return r.set(e,t),r}),()=>{g(n=>{if(n.get(e)!==t)return n;let r=new Map(n);return r.delete(e),r})})),z=X.useCallback(e=>h.get(e),[h]),B=X.useCallback(e=>{for(let t of x.values())if(e===t.value)return t.id},[x]),V=X.useMemo(()=>({getTabElementBySelectedValue:w,getTabIdByPanelValue:B,getTabPanelIdByValue:z,onValueChange:F,orientation:a,registerMountedTabPanel:R,setTabMap:S,tabActivationDirection:j,value:_}),[w,B,z,F,a,R,S,j,_]),H=X.useMemo(()=>{for(let e of x.values())if(e.value===_)return e},[x,_]),W=X.useMemo(()=>{for(let e of x.values())if(!e.disabled)return e.value},[x]),G=X.useRef(!f),K=X.useRef(r),q=X.useRef(f),J=X.useRef(!1);I(()=>{if(b)return;function e(e,t){v(e),D({previousValue:e,tabActivationDirection:`none`}),L(e,t),G.current=!1}if(x.size===0){J.current&&_!==null&&!C.current?.isConnected&&e(null,s);return}J.current=!0,C.current=x.keys().next().value;let t=H?.disabled,n=H==null&&_!==null;if(!t&&_===K.current&&(q.current=!1),q.current&&t&&_===K.current)return;let r=G.current;if(t||n){let n=W??null;if(_===n){G.current=!1;return}let i=s;r?i=p:t&&(i=k),e(n,i);return}r&&H!=null&&(L(_,p),G.current=!1)},[W,b,L,H,v,x,_]);let te=U(`div`,e,{state:{orientation:a,tabActivationDirection:j},ref:t,props:d,stateAttributesMapping:$});return(0,Y.jsx)(ae.Provider,{value:V,children:(0,Y.jsx)(ee,{elementsRef:m,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:r=!1,render:i,value:a,id:o,nativeButton:s=!0,style:c,...l}=e,{value:u,getTabPanelIdByValue:p,onValueChange:m,orientation:h,tabActivationDirection:g}=Q(),{activateOnFocus:_,registerTabResizeObserverElement:b,tabsListElement:x}=de(),{highlightedIndex:S,onHighlightedIndexChange:C}=N(),w=v(o),E=X.useMemo(()=>({disabled:r,id:w,value:a}),[r,w,a]),{compositeProps:k,compositeRef:A,index:j}=re({metadata:E}),P=a===u,F=X.useRef(!1),L=X.useRef(null),R=T(e=>{L.current?.(),L.current=e?b(e):null});I(()=>{if(F.current){F.current=!1;return}if(!(P&&j>-1&&S!==j))return;let e=x;if(e!=null){let t=O(D(e));if(t&&f(e,t))return}r||C(j)},[P,j,S,C,r,x]);let{getButtonProps:z,buttonRef:B}=M({disabled:r,native:s,focusableWhenDisabled:!0}),V=p(a),H=X.useRef(!1),W=X.useRef(!1);function G(e){m(a,y(d,e.nativeEvent,void 0,{activationDirection:`none`}))}function K(e){P||r||G(e)}function q(e){P||r||_&&(!H.current||W.current)&&G(e)}function J(e){if(P||r)return;H.current=!0,W.current=e.button===0;let t=D(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:r,active:P,orientation:h,tabActivationDirection:g},ref:[t,B,A,R],props:[k,{role:`tab`,"aria-controls":V,"aria-selected":P,id:w,onClick:K,onFocus:q,onPointerDown:J,[le]:P?``:void 0,onKeyDownCapture(){F.current=!0}},l,z],stateAttributesMapping:$})}),pe=l();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}=P();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={...$,...c},Ce=X.forwardRef(function(e,t){let{className:n,value:r,render:i,keepMounted:a=!1,style:o,...s}=e,{value:c,getTabIdByPanelValue:l,orientation:d,tabActivationDirection:f,registerMountedTabPanel:p}=Q(),m=v(),{ref:h,index:g}=J(),y=r===c,{mounted:b,transitionStatus:x,setMounted:S}=u(y),C=!b,w=l(r),T={hidden:C,orientation:d,tabActivationDirection:f,transitionStatus:x},E=X.useRef(null),D=U(`div`,e,{state:T,ref:[t,h,E],props:[{"aria-labelledby":w,hidden:C,id:m,role:`tabpanel`,tabIndex:y?0:-1,inert:L(!y),"data-index":g},s],stateAttributesMapping:Se});return _({open:y,ref:E,onComplete(){y||S(!1)}}),I(()=>{if(!(m==null||C&&!a))return p(r,m)},[C,a,r,m,p]),a||b?D:null}),we=[];function Te(e){let{loopFocus:t=!0,orientation:n=`both`,grid:o,onLoop:s,direction:c,highlightedIndex:l,onHighlightedIndexChange:u,rootRef:d,enableHomeAndEndKeys:f=!1,stopEventPropagation:p,disabledIndices:g,modifierKeys:_=we}=e,[v,y]=X.useState(0),b=o!=null,S=X.useRef(null),w=H(S,d),D=X.useRef([]),O=X.useRef(!1),k=l??v,A=T((e,t=!1)=>{if((u??y)(e),t){let t=D.current[e];i(S.current,t,c,n)}}),M=T(e=>{if(e.size===0||O.current)return;O.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)A(a);else if(R(t,k,g)){let e=F(t,{disabledIndices:g});x(t,e)||A(e)}i(S.current,r,c,n)});I(()=>{if(g==null||l!=null||!O.current)return;let e=D.current;if(R(e,k,g)){let t=F(e,{disabledIndices:g});x(e,t)||A(t)}},[g,l,k,D,A]);let N=T((e,t,n)=>s?s(e,t,n,D):n),P=T(e=>{let i=e.key===`Home`||e.key===`End`;if(!r.has(e.key)||!f&&i||Ee(e,_)||!S.current)return;let l=c===`rtl`,u=l?C:z,d=l?z:C,v=n===`vertical`?B:u,y=n===`vertical`?h:d,w=m(e.nativeEvent);if(w!=null&&a(w)&&!te(w)){let t=w.selectionStart,n=w.selectionEnd,r=w.value;if(t==null||e.shiftKey||t!==n||e.key!==y&&t<r.length||e.key!==v&&t>0)return}let T=k,O=E(D,g),M=j(D,g);o!=null&&(T=o({disabledIndices:g,elementsRef:D,event:e,highlightedIndex:k,loopFocus:t,maxIndex:M,minIndex:O,onLoop:N,orientation:n,rtl:l}));let P=n!==`vertical`&&e.key===u||n!==`horizontal`&&e.key===`ArrowDown`,I=n!==`vertical`&&e.key===d||n!==`horizontal`&&e.key===`ArrowUp`;f&&(e.key===`Home`?T=O:e.key===`End`&&(T=M)),T===k&&(P||I)&&(t&&T===M&&P?(T=O,s&&(T=s(e,k,T,D))):t&&T===O&&I?(T=M,s&&(T=s(e,k,T,D))):T=F(D.current,{startingIndex:T,decrement:I,disabledIndices:g})),T!==k&&!x(D.current,T)&&(p&&e.stopPropagation(),(b||i||P||I)&&e.preventDefault(),A(T,!0),queueMicrotask(()=>{D.current[T]?.focus()}))});return{props:{ref:w,onFocus(e){let t=S.current,n=m(e.nativeEvent);!t||n==null||!a(n)||n.setSelectionRange(0,n.value.length)},onKeyDown:P},highlightedIndex:k,onHighlightedIndexChange:A,elementsRef:D,onMapChange:M,relayKeyboardEvent:P}}function Ee(e,t){for(let n of g)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:x=!1,tag:C=`div`,...w}=e,{props:T,highlightedIndex:E,onHighlightedIndexChange:D,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:b(),disabledIndices:v,modifierKeys:y}),j=U(C,e,{state:o,ref:i,props:[T,...a,w],stateAttributesMapping:s}),M=X.useMemo(()=>({highlightedIndex:E,onHighlightedIndexChange:D,highlightItemOnHover:x,relayKeyboardEvent:A}),[E,D,x,A]);return(0,Y.jsx)(S.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);I(()=>{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=T(e=>(h.current.add(e),()=>{h.current.delete(e)})),y=T(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{C as r,D as i,E as a,En as o,In as s,Jn as c,K as l,Kt as u,Ln as d,Mt as f,Nn as p,Nt as m,S as h,T as g,Wt as _,Xt as v,Yt as y,_ as b,_t as x,an as S,b as C,bn as w,cn as T,ht as E,in as D,jt as O,kn as k,ln as A,mt as j,nn as M,on as N,p as P,pt as F,sn as I,v as L,vt as R,x as z,y as B}from"./badge-BObbahyU.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-BONWqXlb.js";import{dt as re}from"./index-CxyTuBKc.js";var Y=n(),X=e(t(),1);function ie(){let[,e]=X.useState({});return X.useCallback(()=>{e({})},[])}function Z(e){let t=A(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=w(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:a=`horizontal`,render:c,value:l,style:u,...d}=e,f=e.defaultValue!==void 0,m=X.useRef([]),[h,g]=X.useState(()=>new Map),[_,v]=o({controlled:l,default:r,name:`Tabs`,state:`value`}),b=l!==void 0,[x,S]=X.useState(()=>new Map),C=X.useRef(void 0),w=X.useCallback(e=>se(x,e),[x]),[E,D]=X.useState(()=>({previousValue:_,tabActivationDirection:`none`})),{previousValue:O,tabActivationDirection:A}=E,j=A,M=!1;O!==_&&(j=ce(O,_,a,x),M=O!=null&&_!=null&&w(_)==null);let N=M?O:_,P=O!==N||A!==j;I(()=>{P&&D({previousValue:N,tabActivationDirection:j})},[N,P,j]);let F=T((e,t)=>{t.activationDirection=ce(_,e,a,x),i?.(e,t),!t.isCanceled&&v(e)}),L=T((e,t)=>{i?.(e,y(t,void 0,void 0,{activationDirection:`none`}))}),R=T((e,t)=>(g(n=>{let r=new Map(n);return r.set(e,t),r}),()=>{g(n=>{if(n.get(e)!==t)return n;let r=new Map(n);return r.delete(e),r})})),z=X.useCallback(e=>h.get(e),[h]),B=X.useCallback(e=>{for(let t of x.values())if(e===t.value)return t.id},[x]),V=X.useMemo(()=>({getTabElementBySelectedValue:w,getTabIdByPanelValue:B,getTabPanelIdByValue:z,onValueChange:F,orientation:a,registerMountedTabPanel:R,setTabMap:S,tabActivationDirection:j,value:_}),[w,B,z,F,a,R,S,j,_]),H=X.useMemo(()=>{for(let e of x.values())if(e.value===_)return e},[x,_]),W=X.useMemo(()=>{for(let e of x.values())if(!e.disabled)return e.value},[x]),G=X.useRef(!f),K=X.useRef(r),q=X.useRef(f),J=X.useRef(!1);I(()=>{if(b)return;function e(e,t){v(e),D({previousValue:e,tabActivationDirection:`none`}),L(e,t),G.current=!1}if(x.size===0){J.current&&_!==null&&!C.current?.isConnected&&e(null,s);return}J.current=!0,C.current=x.keys().next().value;let t=H?.disabled,n=H==null&&_!==null;if(!t&&_===K.current&&(q.current=!1),q.current&&t&&_===K.current)return;let r=G.current;if(t||n){let n=W??null;if(_===n){G.current=!1;return}let i=s;r?i=p:t&&(i=k),e(n,i);return}r&&H!=null&&(L(_,p),G.current=!1)},[W,b,L,H,v,x,_]);let te=U(`div`,e,{state:{orientation:a,tabActivationDirection:j},ref:t,props:d,stateAttributesMapping:$});return(0,Y.jsx)(ae.Provider,{value:V,children:(0,Y.jsx)(ee,{elementsRef:m,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:r=!1,render:i,value:a,id:o,nativeButton:s=!0,style:c,...l}=e,{value:u,getTabPanelIdByValue:p,onValueChange:m,orientation:h,tabActivationDirection:g}=Q(),{activateOnFocus:_,registerTabResizeObserverElement:b,tabsListElement:x}=de(),{highlightedIndex:S,onHighlightedIndexChange:C}=N(),w=v(o),E=X.useMemo(()=>({disabled:r,id:w,value:a}),[r,w,a]),{compositeProps:k,compositeRef:A,index:j}=re({metadata:E}),P=a===u,F=X.useRef(!1),L=X.useRef(null),R=T(e=>{L.current?.(),L.current=e?b(e):null});I(()=>{if(F.current){F.current=!1;return}if(!(P&&j>-1&&S!==j))return;let e=x;if(e!=null){let t=O(D(e));if(t&&f(e,t))return}r||C(j)},[P,j,S,C,r,x]);let{getButtonProps:z,buttonRef:B}=M({disabled:r,native:s,focusableWhenDisabled:!0}),V=p(a),H=X.useRef(!1),W=X.useRef(!1);function G(e){m(a,y(d,e.nativeEvent,void 0,{activationDirection:`none`}))}function K(e){P||r||G(e)}function q(e){P||r||_&&(!H.current||W.current)&&G(e)}function J(e){if(P||r)return;H.current=!0,W.current=e.button===0;let t=D(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:r,active:P,orientation:h,tabActivationDirection:g},ref:[t,B,A,R],props:[k,{role:`tab`,"aria-controls":V,"aria-selected":P,id:w,onClick:K,onFocus:q,onPointerDown:J,[le]:P?``:void 0,onKeyDownCapture(){F.current=!0}},l,z],stateAttributesMapping:$})}),pe=l();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}=P();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={...$,...c},Ce=X.forwardRef(function(e,t){let{className:n,value:r,render:i,keepMounted:a=!1,style:o,...s}=e,{value:c,getTabIdByPanelValue:l,orientation:d,tabActivationDirection:f,registerMountedTabPanel:p}=Q(),m=v(),{ref:h,index:g}=J(),y=r===c,{mounted:b,transitionStatus:x,setMounted:S}=u(y),C=!b,w=l(r),T={hidden:C,orientation:d,tabActivationDirection:f,transitionStatus:x},E=X.useRef(null),D=U(`div`,e,{state:T,ref:[t,h,E],props:[{"aria-labelledby":w,hidden:C,id:m,role:`tabpanel`,tabIndex:y?0:-1,inert:L(!y),"data-index":g},s],stateAttributesMapping:Se});return _({open:y,ref:E,onComplete(){y||S(!1)}}),I(()=>{if(!(m==null||C&&!a))return p(r,m)},[C,a,r,m,p]),a||b?D:null}),we=[];function Te(e){let{loopFocus:t=!0,orientation:n=`both`,grid:o,onLoop:s,direction:c,highlightedIndex:l,onHighlightedIndexChange:u,rootRef:d,enableHomeAndEndKeys:f=!1,stopEventPropagation:p,disabledIndices:g,modifierKeys:_=we}=e,[v,y]=X.useState(0),b=o!=null,S=X.useRef(null),w=H(S,d),D=X.useRef([]),O=X.useRef(!1),k=l??v,A=T((e,t=!1)=>{if((u??y)(e),t){let t=D.current[e];i(S.current,t,c,n)}}),M=T(e=>{if(e.size===0||O.current)return;O.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)A(a);else if(R(t,k,g)){let e=F(t,{disabledIndices:g});x(t,e)||A(e)}i(S.current,r,c,n)});I(()=>{if(g==null||l!=null||!O.current)return;let e=D.current;if(R(e,k,g)){let t=F(e,{disabledIndices:g});x(e,t)||A(t)}},[g,l,k,D,A]);let N=T((e,t,n)=>s?s(e,t,n,D):n),P=T(e=>{let i=e.key===`Home`||e.key===`End`;if(!r.has(e.key)||!f&&i||Ee(e,_)||!S.current)return;let l=c===`rtl`,u=l?C:z,d=l?z:C,v=n===`vertical`?B:u,y=n===`vertical`?h:d,w=m(e.nativeEvent);if(w!=null&&a(w)&&!te(w)){let t=w.selectionStart,n=w.selectionEnd,r=w.value;if(t==null||e.shiftKey||t!==n||e.key!==y&&t<r.length||e.key!==v&&t>0)return}let T=k,O=E(D,g),M=j(D,g);o!=null&&(T=o({disabledIndices:g,elementsRef:D,event:e,highlightedIndex:k,loopFocus:t,maxIndex:M,minIndex:O,onLoop:N,orientation:n,rtl:l}));let P=n!==`vertical`&&e.key===u||n!==`horizontal`&&e.key===`ArrowDown`,I=n!==`vertical`&&e.key===d||n!==`horizontal`&&e.key===`ArrowUp`;f&&(e.key===`Home`?T=O:e.key===`End`&&(T=M)),T===k&&(P||I)&&(t&&T===M&&P?(T=O,s&&(T=s(e,k,T,D))):t&&T===O&&I?(T=M,s&&(T=s(e,k,T,D))):T=F(D.current,{startingIndex:T,decrement:I,disabledIndices:g})),T!==k&&!x(D.current,T)&&(p&&e.stopPropagation(),(b||i||P||I)&&e.preventDefault(),A(T,!0),queueMicrotask(()=>{D.current[T]?.focus()}))});return{props:{ref:w,onFocus(e){let t=S.current,n=m(e.nativeEvent);!t||n==null||!a(n)||n.setSelectionRange(0,n.value.length)},onKeyDown:P},highlightedIndex:k,onHighlightedIndexChange:A,elementsRef:D,onMapChange:M,relayKeyboardEvent:P}}function Ee(e,t){for(let n of g)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:x=!1,tag:C=`div`,...w}=e,{props:T,highlightedIndex:E,onHighlightedIndexChange:D,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:b(),disabledIndices:v,modifierKeys:y}),j=U(C,e,{state:o,ref:i,props:[T,...a,w],stateAttributesMapping:s}),M=X.useMemo(()=>({highlightedIndex:E,onHighlightedIndexChange:D,highlightItemOnHover:x,relayKeyboardEvent:A}),[E,D,x,A]);return(0,Y.jsx)(S.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);I(()=>{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=T(e=>(h.current.add(e),()=>{h.current.delete(e)})),y=T(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};
@@ -27,7 +27,7 @@
27
27
  if (link) link.href = iconHref;
28
28
  })();
29
29
  </script>
30
- <script type="module" crossorigin src="/assets/index-DmbV3DA2.js"></script>
30
+ <script type="module" crossorigin src="/assets/index-CxyTuBKc.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-hHByyyzq.js">
37
37
  <link rel="modulepreload" crossorigin href="/assets/client-B5szthbF.js">
38
- <link rel="modulepreload" crossorigin href="/assets/queries-CJBjicdw.js">
38
+ <link rel="modulepreload" crossorigin href="/assets/queries-DYi6drfC.js">
39
39
  <link rel="modulepreload" crossorigin href="/assets/chevron-down-Dy03VL1q.js">
40
40
  <link rel="modulepreload" crossorigin href="/assets/useValueChanged-DfJmRF2P.js">
41
41
  <link rel="modulepreload" crossorigin href="/assets/isElementDisabled-BONWqXlb.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-BzqpMUfC.css">
44
+ <link rel="stylesheet" crossorigin href="/assets/index-B5-rK_Uq.css">
45
45
  </head>
46
46
  <body>
47
47
  <div id="root"></div>
@@ -1 +1 @@
1
- {"version":3,"file":"work-guidance-routes.d.ts","sourceRoot":"","sources":["../../src/http/work-guidance-routes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAoB,MAAM,MAAM,CAAC;AAOnD,kEAAkE;AAClE,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,QA6D7G"}
1
+ {"version":3,"file":"work-guidance-routes.d.ts","sourceRoot":"","sources":["../../src/http/work-guidance-routes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAoB,MAAM,MAAM,CAAC;AAQnD,kEAAkE;AAClE,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,QA6D7G"}
@@ -4,6 +4,7 @@ import { z } from 'zod';
4
4
  import { addWorkDocument, getWorkContext, readWorkDocument, updateWorkDocument, updateWorkGuidance } from '../core/work-guidance.js';
5
5
  import { loadWorkspaceLifecycle, updateLifecyclePlan } from '../core/lifecycle.js';
6
6
  import { listRootDocuments, readRootDocument } from '../core/root-documents.js';
7
+ import { refreshPlanningContext } from '../core/planning-refresh.js';
7
8
  /** Mounted behind the server's existing local-origin boundary. */
8
9
  export function registerWorkGuidanceRoutes(app, resolveWorkspace) {
9
10
  const bounded = bodyLimit({ maxSize: 600_000 });
@@ -45,7 +46,7 @@ export function registerWorkGuidanceRoutes(app, resolveWorkspace) {
45
46
  });
46
47
  app.put('/api/workspace/:id/planning-notes', bounded, handle(async (root, c) => {
47
48
  const input = z.object({ revision: z.string().regex(/^[a-f0-9]{64}$/), content: z.string().max(500_000) }).parse(await c.req.json());
48
- return savePlanningNotes(root, input.revision, input.content);
49
+ return { ...(await savePlanningNotes(root, input.revision, input.content)), ...(await refreshPlanningContext(root)) };
49
50
  }));
50
51
  app.get('/api/workspace/:id/work', handle(async (root) => {
51
52
  await loadWorkspaceLifecycle(root);
@@ -53,22 +54,22 @@ export function registerWorkGuidanceRoutes(app, resolveWorkspace) {
53
54
  }));
54
55
  app.put('/api/workspace/:id/work', bounded, handle(async (root, c) => {
55
56
  await updateWorkGuidance(root, await c.req.json());
56
- return getWorkContext(root);
57
+ return { ...(await getWorkContext(root)), ...(await refreshPlanningContext(root)) };
57
58
  }));
58
59
  app.post('/api/workspace/:id/work/documents', bounded, handle(async (root, c) => {
59
60
  const { revision, ...input } = await c.req.json();
60
61
  await addWorkDocument(root, z.number().int().nonnegative().parse(revision), input);
61
- return getWorkContext(root);
62
+ return { ...(await getWorkContext(root)), ...(await refreshPlanningContext(root)) };
62
63
  }));
63
64
  app.patch('/api/workspace/:id/work/documents/:documentId', bounded, handle(async (root, c) => {
64
65
  const { revision, ...input } = await c.req.json();
65
66
  await updateWorkDocument(root, z.string().uuid().parse(c.req.param('documentId')), z.number().int().nonnegative().parse(revision), input);
66
- return getWorkContext(root);
67
+ return { ...(await getWorkContext(root)), ...(await refreshPlanningContext(root)) };
67
68
  }));
68
69
  app.get('/api/workspace/:id/work/documents/:documentId', handle((root, c) => readWorkDocument(root, z.string().uuid().parse(c.req.param('documentId')))));
69
70
  app.put('/api/workspace/:id/lifecycle/plan', bounded, handle(async (root, c) => {
70
71
  const lifecycle = await updateLifecyclePlan(root, await c.req.json());
71
- return { lifecycle };
72
+ return { lifecycle, ...(await refreshPlanningContext(root)) };
72
73
  }));
73
74
  }
74
75
  //# sourceMappingURL=work-guidance-routes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"work-guidance-routes.js","sourceRoot":"","sources":["../../src/http/work-guidance-routes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAEjF,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACrI,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAEhF,kEAAkE;AAClE,MAAM,UAAU,0BAA0B,CAAC,GAAS,EAAE,gBAAwD;IAC5G,MAAM,OAAO,GAAG,SAAS,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;IAChD,MAAM,MAAM,GAAG,CAAC,MAA8D,EAAW,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;QACtG,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,gBAAgB,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAChF,IAAI,CAAC,IAAI;gBAAE,OAAO,CAAC,CAAC,IAAI,CAAC,EAA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,EAAE,GAAG,CAAC,MAAM,sBAAsB,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;IACtF,CAAC,CAAC,CAAC,CAAC;IACJ,GAAG,CAAC,GAAG,CAAC,+CAA+C,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1J,GAAG,CAAC,GAAG,CAAC,mCAAmC,EAAE,OAAO,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE;QAC7E,MAAM,SAAS,GAAG,MAAM,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;QACtE,OAAO,EAAE,SAAS,EAAE,GAAG,CAAC,MAAM,sBAAsB,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;IAChE,CAAC,CAAC,CAAC,CAAC;AACN,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"planning-tools.d.ts","sourceRoot":"","sources":["../../src/mcp/planning-tools.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAqChD,eAAO,MAAM,aAAa,EAAE,aAAa,EAqBxC,CAAC"}
1
+ {"version":3,"file":"planning-tools.d.ts","sourceRoot":"","sources":["../../src/mcp/planning-tools.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAsChD,eAAO,MAAM,aAAa,EAAE,aAAa,EAqBxC,CAAC"}
@@ -3,6 +3,7 @@ import { lifecyclePlanSchema, updateLifecyclePlan } from '../core/lifecycle.js';
3
3
  import { addWorkDocument, updateWorkDocument, updateWorkGuidance, getWorkContext, documentInputSchema, documentMetadataSchema, guidanceUpdateSchema, } from '../core/work-guidance.js';
4
4
  import { savePlanningNotes } from '../core/planning-notes.js';
5
5
  import { loadFeatureConfig } from '../core/workspace.js';
6
+ import { refreshPlanningContext } from '../core/planning-refresh.js';
6
7
  /** Publish and validate the same input contract used by the core mutations. */
7
8
  function planningTool(name, description, schema, action, destructiveHint = false) {
8
9
  const inputSchema = z.toJSONSchema(schema, { io: 'input' });
@@ -33,10 +34,10 @@ const revision = z.number().int().nonnegative();
33
34
  const addDocumentSchema = documentInputSchema.safeExtend({ revision });
34
35
  const updateDocumentSchema = documentMetadataSchema.extend({ revision, documentId: z.string().uuid() });
35
36
  export const planningTools = [
36
- planningTool('update_milestone_plan', 'Create, edit, reorder, or remove feature-specific workspace milestones. Read get_work_context first and send lifecycle.revision (0 when absent) plus the entire desired steps array. Omitted steps are removed; [] disables milestones. Retained steps keep progress and verification. Reassign document/assignment scopes before removing referenced milestones. On conflict, reread and merge. Do not invent generic steps. Refresh context after saving to update generated files.', lifecyclePlanSchema, async (input, root) => ({ lifecycle: await updateLifecyclePlan(root, input) }), true),
37
- planningTool('update_work_assignment', 'Update work type, size, and the current AI assignment, including stage, objective, expected output, stopping point, and optional milestone scope. Read get_work_context first and use guidance.revision. Supply the complete assignment; omit milestoneId for workspace scope. Follow the user-authorized scope; changing a saved stage does not itself grant permission to proceed. Returns the updated context and revision.', guidanceUpdateSchema, async (input, root) => { await updateWorkGuidance(root, input); return getWorkContext(root); }),
38
- planningTool('add_work_document', 'Attach original Markdown/text or an HTTP(S) document link to the workspace, a milestone, or its project. Read get_work_context for guidance.revision. Provide exactly one of content or url. Documents default to draft; mark approved only when the user has approved the requirements. Links are stored, not fetched. Returns document IDs and the updated guidance revision.', addDocumentSchema, async ({ revision, ...input }, root) => { await addWorkDocument(root, revision, input); return getWorkContext(root); }),
39
- planningTool('update_work_document', 'Edit an attached source document’s title, role, status, scope, and summary without changing its original content or URL. Read get_work_context for guidance.revision and documentId. Supply the complete metadata; use scope:{} for workspace scope. Use superseded for historical sources. Approval status must reflect the user’s decision. Shared project sources must be edited in their owning workspace.', updateDocumentSchema, async ({ revision, documentId, ...input }, root) => { await updateWorkDocument(root, documentId, revision, input); return getWorkContext(root); }),
40
- planningTool('save_planning_notes', 'Replace authored delivery notes, questions, and deferred decisions in contextspace-milestones.md. First read get_planning_notes and supply its revision hash plus the entire revised content. On conflict, reread and merge instead of overwriting newer notes. Use update_milestone_plan for structured milestones.', z.object({ revision: z.string().regex(/^[a-f0-9]{64}$/), content: z.string().max(500_000) }), (input, root) => savePlanningNotes(root, input.revision, input.content), true),
37
+ planningTool('update_milestone_plan', 'Create, edit, reorder, or remove feature-specific workspace milestones. Read get_work_context first and send lifecycle.revision (0 when absent) plus the entire desired steps array. Omitted steps are removed; [] disables milestones. Retained steps keep progress and verification. Reassign document/assignment scopes before removing referenced milestones. On conflict, reread and merge. Do not invent generic steps. Refresh context after saving to update generated files.', lifecyclePlanSchema, async (input, root) => ({ lifecycle: await updateLifecyclePlan(root, input), ...(await refreshPlanningContext(root)) }), true),
38
+ planningTool('update_work_assignment', 'Update work type, size, and the current AI assignment, including stage, objective, expected output, stopping point, and optional milestone scope. Read get_work_context first and use guidance.revision. Supply the complete assignment; omit milestoneId for workspace scope. Follow the user-authorized scope; changing a saved stage does not itself grant permission to proceed. Returns the updated context and revision.', guidanceUpdateSchema, async (input, root) => { await updateWorkGuidance(root, input); return { ...(await getWorkContext(root)), ...(await refreshPlanningContext(root)) }; }),
39
+ planningTool('add_work_document', 'Attach original Markdown/text or an HTTP(S) document link to the workspace, a milestone, or its project. Read get_work_context for guidance.revision. Provide exactly one of content or url. Documents default to draft; mark approved only when the user has approved the requirements. Links are stored, not fetched. Returns document IDs and the updated guidance revision.', addDocumentSchema, async ({ revision, ...input }, root) => { await addWorkDocument(root, revision, input); return { ...(await getWorkContext(root)), ...(await refreshPlanningContext(root)) }; }),
40
+ planningTool('update_work_document', 'Edit an attached source document’s title, role, status, scope, and summary without changing its original content or URL. Read get_work_context for guidance.revision and documentId. Supply the complete metadata; use scope:{} for workspace scope. Use superseded for historical sources. Approval status must reflect the user’s decision. Shared project sources must be edited in their owning workspace.', updateDocumentSchema, async ({ revision, documentId, ...input }, root) => { await updateWorkDocument(root, documentId, revision, input); return { ...(await getWorkContext(root)), ...(await refreshPlanningContext(root)) }; }),
41
+ planningTool('save_planning_notes', 'Replace authored delivery notes, questions, and deferred decisions in contextspace-milestones.md. First read get_planning_notes and supply its revision hash plus the entire revised content. On conflict, reread and merge instead of overwriting newer notes. Use update_milestone_plan for structured milestones.', z.object({ revision: z.string().regex(/^[a-f0-9]{64}$/), content: z.string().max(500_000) }), async (input, root) => ({ ...(await savePlanningNotes(root, input.revision, input.content)), ...(await refreshPlanningContext(root)) }), true),
41
42
  ];
42
43
  //# sourceMappingURL=planning-tools.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"planning-tools.js","sourceRoot":"","sources":["../../src/mcp/planning-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EACL,eAAe,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,cAAc,EACvE,mBAAmB,EAAE,sBAAsB,EAAE,oBAAoB,GAClE,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD,+EAA+E;AAC/E,SAAS,YAAY,CACnB,IAAY,EACZ,WAAmB,EACnB,MAAS,EACT,MAA8D,EAC9D,eAAe,GAAG,KAAK;IAEvB,MAAM,WAAW,GAAG,CAAC,CAAC,YAAY,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAC5D,OAAO;QACL,IAAI,EAAE,WAAW;QACjB,WAAW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AI assistant context",
5
5
  "type": "module",
6
6
  "repository": {
@@ -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,Z as a,_ as o,et as s,n as c}from"./queries-CJBjicdw.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 ee,s as _}from"./status-CKOvrZ16.js";import{t as te}from"./brand-hHByyyzq.js";import{n as v}from"./client-B5szthbF.js";import{Et as y,O as b,Pt as x,Wt as S,Yt as C,a as w,an as T,i as ne,k as E,kt as D,o as O,q as re,r as k,s as A,sn as j,tn as M}from"./index-DmbV3DA2.js";import{t as N}from"./card-BMggHY3n.js";var ie=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(),ae=[{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)(y,{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)(C,{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)(y,{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)(y,{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)(y,{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)(C,{size:12})}]}];function I({workspaces:e,workspaceStatuses:t,workspacesLoading:n=!1,onOpenWorkspace:l,onNewWorkspace:f,showToast:p}){let m=c(),h=i(),_=o(),[y,C]=(0,P.useState)(``),[I,L]=(0,P.useState)(!1),[R,z]=(0,P.useState)(``),B=e.find(e=>e.branchName===R)??e[0],V=e.filter(e=>`${e.branchName} ${e.description??``} ${e.repos.join(` `)}`.toLowerCase().includes(y.trim().toLowerCase())&&(!I||(t[e.branchName]?.changedFiles??0)>0)),[H,U]=(0,P.useState)(null),W=e.flatMap(e=>t[e.branchName]?[t[e.branchName]]:[]),G=W.reduce((e,t)=>e+(t.changedFiles||0),0),K=W.filter(e=>e.changedFiles>0).length,q=e.filter(e=>(e.mode??`worktree`)===`worktree`).length,oe=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)(()=>ae.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]),se=async(e,t)=>{if(H)return;let n=B;if(!n){p?.(`No active workspace available to launch harness in.`,`error`);return}let r=`${e.id}:${t.id}`;U(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 v(`/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{U(null)}},Q=a(),{customTitles:$}=re();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)(j,{size:14,className:`text-primary`}),(0,F.jsx)(`span`,{children:te}),(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)(x,{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:`${q} isolated · ${oe} host`,icon:s},{label:`Review Queue`,value:W.length?G:`—`,detail:`${K} worktrees with diffs`,icon:S,isDirty:G>0},{label:`Tracked Repos`,value:n?`—`:J.length,detail:`Connected on local host`,icon:M},{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)(N,{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 (`,V.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:y,onChange:e=>C(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:I?`secondary`:`outline`,size:`xs`,className:`h-8 rounded-lg text-xs font-medium cursor-pointer`,"aria-pressed":I,onClick:()=>L(!I),children:[(0,F.jsx)(S,{size:13}),` Diffs only`]})]})]}),n?(0,F.jsx)(N,{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?V.length?(0,F.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:V.map(e=>{let n=t[e.branchName],r=e.mode===`in-place`||!n?null:ee(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)(S,{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 items-center justify-between gap-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[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)(ie,{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)(T,{size:11})]})]})]},e.id)})}):(0,F.jsxs)(N,{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:()=>{C(``),L(!1)},children:`Clear filter`})]}):(0,F.jsx)(N,{className:`rounded-xl border border-dashed border-border bg-card/50 p-8`,children:(0,F.jsxs)(k,{children:[(0,F.jsxs)(w,{children:[(0,F.jsx)(O,{variant:`icon`,children:(0,F.jsx)(s,{})}),(0,F.jsx)(A,{children:`No active worktrees`}),(0,F.jsx)(ne,{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)(x,{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:B?.branchName??``,onChange:e=>z(e.target.value),disabled:!e.length||!!H,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)(b,{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:!!H||!B,onClick:()=>void se(e,t),title:`Launch ${e.name} in ${B?.branchName??`workspace`}`,className:`h-7 text-xs border-border hover:bg-accent cursor-pointer`,children:[H===`${e.id}:${t.id}`?(0,F.jsx)(E,{className:`size-3`}):t.icon,t.shortLabel,(0,F.jsx)(T,{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)(M,{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:()=>{C(e.path),L(!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};