@mrpatronz/nexusflow 2.17.0 → 2.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/core/root-documents.d.ts +12 -0
- package/dist/core/root-documents.d.ts.map +1 -1
- package/dist/core/root-documents.js +4 -2
- package/dist/core/root-documents.js.map +1 -1
- package/dist/gui/assets/{AgentsPage-vWomDhqY.js → AgentsPage-B8wY-KQB.js} +1 -1
- package/dist/gui/assets/{DashboardPage-D2LQg1es.js → DashboardPage-B_ZsSGHU.js} +1 -1
- package/dist/gui/assets/DocumentPreview-Ds1fjVR1.js +3 -0
- package/dist/gui/assets/{GettingStartedPage-BYPdHlcN.js → GettingStartedPage-BlTIranD.js} +1 -1
- package/dist/gui/assets/{MonacoDiffAdapter-ClvAYSFE.js → MonacoDiffAdapter-DnVDZN_T.js} +1 -1
- package/dist/gui/assets/{ProjectsPage-DdFVpbr7.js → ProjectsPage-CETgIZML.js} +1 -1
- package/dist/gui/assets/{ScaffoldRepoInline-BvOKUfOp.js → ScaffoldRepoInline-DAcCQwkr.js} +1 -1
- package/dist/gui/assets/{SettingsPage-BtRA38LZ.js → SettingsPage-B-1dbgP4.js} +1 -1
- package/dist/gui/assets/{SkillsPage-Dc8TrRyw.js → SkillsPage-Dynyirx8.js} +1 -1
- package/dist/gui/assets/StartWorkPage-tWC7hUNi.js +1 -0
- package/dist/gui/assets/{StrategiesPage-GkFROjyC.js → StrategiesPage-DaGnJx4E.js} +1 -1
- package/dist/gui/assets/{WorkroomsPage-DZVZcvUV.js → WorkroomsPage-Du28BSKK.js} +1 -1
- package/dist/gui/assets/WorkspacesPage-CdqFqfKR.js +13 -0
- package/dist/gui/assets/{alert-dialog-B_TU2TCX.js → alert-dialog-N0cNDLma.js} +1 -1
- package/dist/gui/assets/{index-DNNQAjn6.js → index-4lBf5Ph9.js} +7 -7
- package/dist/gui/assets/index-BSApVBNm.css +2 -0
- package/dist/gui/assets/{queries-DdbBkqm6.js → queries-CJBjicdw.js} +1 -1
- package/dist/gui/assets/{tabs-D7v4Yq0P.js → tabs-x72_G6CN.js} +1 -1
- package/dist/gui/index.html +3 -3
- package/dist/http/work-guidance-routes.js +1 -1
- package/dist/http/work-guidance-routes.js.map +1 -1
- package/package.json +1 -1
- package/dist/gui/assets/StartWorkPage-BJ7EYD7t.js +0 -1
- package/dist/gui/assets/WorkspacesPage-DefIfu1l.js +0 -13
- package/dist/gui/assets/index-CQGZNI9n.css +0 -2
|
@@ -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,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,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}})},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}})},removeTab:e=>{Q(t=>{let n=t.openTabs.filter(t=>t!==e),r=t.activeTab;return r===e&&(r=n.length>0?n[n.length-1]:null),{...t,openTabs:n,activeTab:r,isOpen:n.length>0&&t.isOpen}})},setActiveTab:e=>{Q(t=>t.openTabs.includes(e)?{...t,activeTab:e,isMinimized:!1}:t)},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}})},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};
|
|
@@ -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{lt as re}from"./index-DNNQAjn6.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{lt as re}from"./index-4lBf5Ph9.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};
|
package/dist/gui/index.html
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
if (link) link.href = iconHref;
|
|
28
28
|
})();
|
|
29
29
|
</script>
|
|
30
|
-
<script type="module" crossorigin src="/assets/index-
|
|
30
|
+
<script type="module" crossorigin src="/assets/index-4lBf5Ph9.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-
|
|
38
|
+
<link rel="modulepreload" crossorigin href="/assets/queries-CJBjicdw.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-
|
|
44
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BSApVBNm.css">
|
|
45
45
|
</head>
|
|
46
46
|
<body>
|
|
47
47
|
<div id="root"></div>
|
|
@@ -36,7 +36,7 @@ export function registerWorkGuidanceRoutes(app, resolveWorkspace) {
|
|
|
36
36
|
c.header('X-Content-Type-Options', 'nosniff');
|
|
37
37
|
c.header('Cache-Control', 'no-store');
|
|
38
38
|
c.header('Content-Security-Policy', "sandbox; default-src 'none'");
|
|
39
|
-
c.header('Content-Disposition', `${download || document.kind === 'download' ? 'attachment' : 'inline'}; filename*=UTF-8''${encodeURIComponent(document.name).replace(/'/g, '%27')}`);
|
|
39
|
+
c.header('Content-Disposition', `${download || document.kind === 'download' || document.kind === 'html' ? 'attachment' : 'inline'}; filename*=UTF-8''${encodeURIComponent(document.name).replace(/'/g, '%27')}`);
|
|
40
40
|
return c.body(new Uint8Array(document.bytes));
|
|
41
41
|
}
|
|
42
42
|
catch (error) {
|
|
@@ -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,EAAE,KAAK,EAAE,sBAAsB,EAAE,EAAE,GAAG,CAAC,CAAC;YACjE,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACvC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvE,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,KAAK,YAAY,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,yBAAyB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QAC7H,CAAC;IACH,CAAC,CAAC;IACF,GAAG,CAAC,GAAG,CAAC,mCAAmC,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACxF,GAAG,CAAC,GAAG,CAAC,8BAA8B,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACnF,GAAG,CAAC,GAAG,CAAC,sCAAsC,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE;QACvE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,GAAG,MAAM,gBAAgB,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QAC/F,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC,CAAC,CAAC;IACJ,GAAG,CAAC,GAAG,CAAC,mCAAmC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;QACvD,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;YACvD,IAAI,CAAC,IAAI;gBAAE,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,sBAAsB,EAAE,EAAE,GAAG,CAAC,CAAC;YACjE,MAAM,QAAQ,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,GAAG,CAAC;YACjD,MAAM,QAAQ,GAAG,MAAM,gBAAgB,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,QAAQ,CAAC,CAAC;YACnF,CAAC,CAAC,MAAM,CAAC,cAAc,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;YACxC,CAAC,CAAC,MAAM,CAAC,wBAAwB,EAAE,SAAS,CAAC,CAAC;YAC9C,CAAC,CAAC,MAAM,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;YACtC,CAAC,CAAC,MAAM,CAAC,yBAAyB,EAAE,6BAA6B,CAAC,CAAC;YACnE,CAAC,CAAC,MAAM,CAAC,qBAAqB,EAAE,GAAG,QAAQ,IAAI,QAAQ,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,sBAAsB,kBAAkB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;
|
|
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,EAAE,KAAK,EAAE,sBAAsB,EAAE,EAAE,GAAG,CAAC,CAAC;YACjE,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACvC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvE,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,KAAK,YAAY,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,yBAAyB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QAC7H,CAAC;IACH,CAAC,CAAC;IACF,GAAG,CAAC,GAAG,CAAC,mCAAmC,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACxF,GAAG,CAAC,GAAG,CAAC,8BAA8B,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACnF,GAAG,CAAC,GAAG,CAAC,sCAAsC,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE;QACvE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,GAAG,MAAM,gBAAgB,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QAC/F,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC,CAAC,CAAC;IACJ,GAAG,CAAC,GAAG,CAAC,mCAAmC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;QACvD,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;YACvD,IAAI,CAAC,IAAI;gBAAE,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,sBAAsB,EAAE,EAAE,GAAG,CAAC,CAAC;YACjE,MAAM,QAAQ,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,GAAG,CAAC;YACjD,MAAM,QAAQ,GAAG,MAAM,gBAAgB,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,QAAQ,CAAC,CAAC;YACnF,CAAC,CAAC,MAAM,CAAC,cAAc,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;YACxC,CAAC,CAAC,MAAM,CAAC,wBAAwB,EAAE,SAAS,CAAC,CAAC;YAC9C,CAAC,CAAC,MAAM,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;YACtC,CAAC,CAAC,MAAM,CAAC,yBAAyB,EAAE,6BAA6B,CAAC,CAAC;YACnE,CAAC,CAAC,MAAM,CAAC,qBAAqB,EAAE,GAAG,QAAQ,IAAI,QAAQ,CAAC,IAAI,KAAK,UAAU,IAAI,QAAQ,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,sBAAsB,kBAAkB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;YACjN,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;QAChD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,0BAA0B,EAAE,EAAE,GAAG,CAAC,CAAC;QACrG,CAAC;IACH,CAAC,CAAC,CAAC;IACH,GAAG,CAAC,GAAG,CAAC,mCAAmC,EAAE,OAAO,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE;QAC7E,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;QACrI,OAAO,iBAAiB,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC,CAAC;IACJ,GAAG,CAAC,GAAG,CAAC,yBAAyB,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QACvD,MAAM,sBAAsB,CAAC,IAAI,CAAC,CAAC;QACnC,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC,CAAC;IACJ,GAAG,CAAC,GAAG,CAAC,yBAAyB,EAAE,OAAO,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE;QACnE,MAAM,kBAAkB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;QACnD,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC,CAAC;IACJ,GAAG,CAAC,IAAI,CAAC,mCAAmC,EAAE,OAAO,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE;QAC9E,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;QAClD,MAAM,eAAe,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,CAAC;QACnF,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC,CAAC;IACJ,GAAG,CAAC,KAAK,CAAC,+CAA+C,EAAE,OAAO,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE;QAC3F,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;QAClD,MAAM,kBAAkB,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,CAAC;QAC1I,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC;IAC9B,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,CAAC;IACvB,CAAC,CAAC,CAAC,CAAC;AACN,CAAC"}
|
package/package.json
CHANGED
|
@@ -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{n as r,t as i}from"./badge-BObbahyU.js";import{C as a,F as o,G as s,L as c,M as l,P as ee,Q as u,S as te,Z as d,a as f,b as p,c as m,et as ne,i as re,m as h,n as ie,t as ae,vt as g,w as oe,y as se}from"./queries-DdbBkqm6.js";import{h as _,m as v,t as y}from"./button-BrcP8Wxx.js";import{t as ce}from"./chevron-down-Dy03VL1q.js";import{a as b,c as x,d as S,f as C,g as le,l as w,m as ue,n as de,o as fe,p as pe,u as me}from"./status-CKOvrZ16.js";import{n as he,r as T,t as ge}from"./ScaffoldRepoInline-BvOKUfOp.js";import{n as _e,r as ve,t as ye}from"./vsc-EOWFTqft.js";import{s as E}from"./brand-hHByyyzq.js";import{n as be}from"./client-B5szthbF.js";import{$t as xe,A as Se,B as Ce,D,Dt as we,E as Te,Gt as Ee,Ht as De,I as Oe,L as O,M as ke,N as Ae,O as je,P as Me,Qt as k,R as Ne,T as Pe,Xt as A,a as Fe,en as Ie,i as j,j as Le,jt as Re,k as ze,n as Be,o as Ve,qt as M,r as N,t as P,u as He,wt as F,yt as Ue,z as We}from"./index-DNNQAjn6.js";var Ge=_(`app-window`,[[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}],[`path`,{d:`M10 4v4`,key:`pp8u80`}],[`path`,{d:`M2 8h20`,key:`d11cs7`}],[`path`,{d:`M6 4v4`,key:`1svtjw`}]]),Ke=_(`orbit`,[[`path`,{d:`M20.341 6.484A10 10 0 0 1 10.266 21.85`,key:`1enhxb`}],[`path`,{d:`M3.659 17.516A10 10 0 0 1 13.74 2.152`,key:`1crzgf`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`circle`,{cx:`19`,cy:`5`,r:`2`,key:`mhkx31`}],[`circle`,{cx:`5`,cy:`19`,r:`2`,key:`v8kfzx`}]]),qe=_(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]),I=e(t(),1),L={status:`idle`,steps:[]};function Je(){let[e,t]=(0,I.useState)(L),n=(0,I.useRef)(null),r=(0,I.useRef)(null),i=g(),a=(0,I.useCallback)(()=>{n.current?.close(),n.current=null,r.current=null},[]);return(0,I.useEffect)(()=>a,[a]),{progress:e,start:(0,I.useCallback)(e=>{if(n.current&&r.current===e)return;a(),r.current=e,t({status:`running`,steps:[]});let o=new EventSource(`/api/workspace/create-stream/${encodeURIComponent(e)}`);n.current=o;let s=0;o.addEventListener(`progress`,r=>{if(n.current===o){s=0;try{let n=JSON.parse(r.data);t({status:n.status===`completed`||n.status===`failed`?n.status:`running`,steps:n.steps??[],error:n.error,workspacePath:n.workspacePath,workspaceId:n.feature?.id??e}),(n.status===`completed`||n.status===`failed`)&&(a(),i.invalidateQueries({queryKey:[`workspaces`]}),i.invalidateQueries({queryKey:[`workspaces-status`]}))}catch{}}}),o.onerror=()=>{n.current===o&&(s+=1,!(o.readyState!==EventSource.CLOSED&&s<5)&&(t(e=>e.status===`running`?{...e,status:`unavailable`,error:e.error??`Unable to reconnect to the creation stream. The workspace may still have been created.`}:e),a(),i.invalidateQueries({queryKey:[`workspaces`]}),i.invalidateQueries({queryKey:[`workspaces-status`]})))}},[a,i]),reset:(0,I.useCallback)(()=>{a(),t(L)},[a])}}var R=n(),z=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,B={codex:ue,claude:b,vscode:ye,"vscode-insiders":_e,cursor:fe,antigravity:Ke,powershell:F,cmd:F,terminal:F,intellij:x,webstorm:S,pycharm:w,sublime:me,zed:pe,windsurf:C},Ye={codex:`bg-foreground text-background`,claude:`bg-[#D97757] text-white`,vscode:`bg-[#007ACC] text-white`,"vscode-insiders":`bg-[#24A148] text-white`,cursor:`bg-zinc-950 text-white dark:bg-white dark:text-zinc-950`,antigravity:`bg-violet-600 text-white`,powershell:`bg-sky-700 text-white`,cmd:`bg-zinc-800 text-amber-400`,terminal:`bg-zinc-800 text-emerald-400`,intellij:`bg-fuchsia-600 text-white`,webstorm:`bg-cyan-600 text-white`,pycharm:`bg-lime-600 text-zinc-950`,sublime:`bg-orange-500 text-white`,zed:`bg-red-600 text-white`,windsurf:`bg-teal-600 text-white`};function V({icon:e}){let t=B[e]??M;return(0,R.jsx)(`span`,{className:v(`grid size-10 shrink-0 place-items-center rounded-xl shadow-sm`,Ye[e]),"aria-hidden":`true`,children:(0,R.jsx)(t,{className:`size-5`})})}function Xe({target:e,busy:t,launching:n,preferred:r,onLaunch:a}){return(0,R.jsxs)(`button`,{type:`button`,disabled:!e.available||t,onClick:()=>a(e),"aria-label":`Open workspace in ${e.name}`,className:v(`flex min-h-20 w-full items-center gap-3 rounded-xl border p-3 text-left outline-none transition-colors`,`focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background`,`cursor-pointer border-border bg-card hover:border-primary/40 hover:bg-accent/60`),children:[(0,R.jsx)(V,{icon:e.icon}),(0,R.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,R.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsx)(`span`,{className:`font-medium text-foreground`,children:e.name}),n?(0,R.jsx)(D,{className:`size-4`}):r?(0,R.jsx)(i,{size:`sm`,variant:`secondary`,children:`Preferred`}):null]}),(0,R.jsx)(`span`,{className:`mt-0.5 block text-xs leading-relaxed text-muted-foreground`,children:e.description})]})]})}function Ze({session:e,busy:t,launching:n,onResume:r}){let i=e.desktopHandoff.method===`direct`,a=i?`Codex Desktop`:`Claude Desktop`;return(0,R.jsxs)(`button`,{type:`button`,disabled:t,onClick:()=>r(e),"aria-label":i?`Resume ${e.title} in Codex Desktop`:`Move ${e.title} to Claude Desktop`,className:v(`flex min-h-20 w-full cursor-pointer items-center gap-3 rounded-xl border border-primary/25 bg-primary/5 p-3 text-left outline-none transition-colors`,`hover:border-primary/45 hover:bg-primary/10 focus-visible:ring-2 focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-65`),children:[(0,R.jsx)(V,{icon:i?`codex`:`claude`}),(0,R.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,R.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsx)(`span`,{className:`truncate font-medium text-foreground`,title:e.title,children:e.title}),n?(0,R.jsx)(D,{className:`size-4 shrink-0`}):i?(0,R.jsx)(le,{className:`size-4 shrink-0 text-muted-foreground`}):(0,R.jsx)(Ee,{className:`size-4 shrink-0 text-muted-foreground`})]}),(0,R.jsxs)(`span`,{className:`mt-0.5 block text-xs leading-relaxed text-muted-foreground`,children:[i?`Open this existing task in ${a}`:`Resume in Claude Code, then type /desktop`,` · `,new Date(e.updatedAt).toLocaleString()]})]})]})}function Qe({workspaceId:e,workspacePath:t,isVsCode:n=!1,className:r}){let[i,a]=(0,I.useState)(!1),[s,l]=(0,I.useState)(null),[ee,u]=(0,I.useState)(null),[te,d]=(0,I.useState)(null),f=(0,I.useRef)(!1),p=o(),m=c(e,i),ne=re().data?.config,h=p.data?.filter(e=>e.available)??[],ie=h.filter(e=>e.kind===`ai-app`),ae=ne?.defaultEditor?{code:`vscode`,"code-insiders":`vscode-insiders`,cursor:`cursor`,antigravity:`antigravity`,idea:`intellij`,webstorm:`webstorm`,charm:`pycharm`,subl:`sublime`,zed:`zed`,windsurf:`windsurf`}[ne.defaultEditor]:void 0,g=h.filter(e=>e.kind===`editor`).toSorted((e,t)=>Number(t.id===ae)-Number(e.id===ae)),oe=new Set(h.map(e=>e.id)),se=(m.data??[]).filter(e=>e.desktopHandoff&&oe.has(e.desktopHandoff.targetId)),_=n||h.length>0,v=async t=>{if(!f.current){f.current=!0,u(null),d(null),l(t.id);try{await be(`/api/workspace/${encodeURIComponent(e)}/launch`,{method:`POST`,body:JSON.stringify({targetId:t.id})}),a(!1)}catch(e){u(e instanceof Error?e.message:String(e)),await p.refetch()}finally{l(null),f.current=!1}}},ce=async t=>{if(!(f.current||!t.desktopHandoff||!z.test(t.id))){f.current=!0,u(null),d(null),l(`session:${t.id}`);try{if(t.desktopHandoff.method===`guided`){await Pe(`claude --resume ${t.id}`),d(`Claude resume command copied. With a Claude subscription login, run it in this workspace, then type /desktop in Claude to move the session into Claude Desktop.`);return}await be(`/api/workspace/${encodeURIComponent(e)}/launch`,{method:`POST`,body:JSON.stringify({targetId:t.desktopHandoff.targetId,action:`resume`,sessionId:t.id})}),a(!1)}catch(e){u(e instanceof Error?e.message:String(e)),await Promise.all([p.refetch(),m.refetch()])}finally{l(null),f.current=!1}}},b=()=>{window.parent.postMessage({type:`openWorkspaceFolder`,workspacePath:t},`*`),a(!1)},x=()=>Promise.all([p.refetch(),m.refetch()]),S=p.isFetching||m.isFetching;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(y,{variant:`outline`,className:r,onClick:()=>a(!0),children:[(0,R.jsx)(qe,{}),`Open with…`]}),(0,R.jsx)(je,{open:i,onOpenChange:e=>{a(e),e||(u(null),d(null))},children:(0,R.jsxs)(Ae,{className:`max-w-2xl`,"aria-busy":s!==null,children:[(0,R.jsxs)(Le,{children:[(0,R.jsx)(Me,{children:`Open workspace with…`}),(0,R.jsx)(ze,{children:`Continue recent AI work or start in an installed coding app or editor. AI apps may use their own online services.`})]}),(0,R.jsxs)(ke,{className:`space-y-5`,children:[ee&&(0,R.jsx)(`div`,{role:`alert`,className:`rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive-foreground`,children:ee}),te&&(0,R.jsx)(`div`,{role:`status`,className:`rounded-lg border border-primary/25 bg-primary/5 px-3 py-2 text-sm text-foreground`,children:te}),m.isLoading?(0,R.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"aria-live":`polite`,children:[(0,R.jsx)(D,{className:`size-4`}),` Checking recent sessions…`]}):se.length>0?(0,R.jsxs)(`section`,{"aria-labelledby":`recent-sessions-heading`,children:[(0,R.jsx)(`h3`,{id:`recent-sessions-heading`,className:`mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`Continue recent work`}),(0,R.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:se.map(e=>(0,R.jsx)(Ze,{session:e,busy:s!==null,launching:s===`session:${e.id}`,onResume:ce},`${e.assistant}:${e.id}`))})]}):m.isError?(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Recent sessions could not be checked. Starting new work is still available.`}):null,n&&(0,R.jsxs)(`section`,{"aria-labelledby":`current-editor-heading`,children:[(0,R.jsx)(`h3`,{id:`current-editor-heading`,className:`mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`Current window`}),(0,R.jsxs)(`button`,{type:`button`,disabled:s!==null,onClick:b,className:`flex min-h-20 w-full cursor-pointer items-center gap-3 rounded-xl border border-primary/30 bg-primary/5 p-3 text-left outline-none transition-colors hover:bg-primary/10 focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-65`,children:[(0,R.jsx)(V,{icon:`vscode`}),(0,R.jsxs)(`span`,{children:[(0,R.jsx)(`span`,{className:`block font-medium`,children:`Current VS Code window`}),(0,R.jsxs)(`span`,{className:`mt-0.5 block text-xs text-muted-foreground`,children:[`Open through the installed `,E,` extension.`]})]})]})]}),p.isLoading?(0,R.jsxs)(`div`,{className:`flex items-center gap-2 py-8 text-sm text-muted-foreground`,"aria-live":`polite`,children:[(0,R.jsx)(D,{}),` Checking apps on this computer…`]}):p.isError?(0,R.jsx)(`div`,{role:`alert`,className:`rounded-lg border border-destructive/30 bg-destructive/10 p-3 text-sm text-destructive-foreground`,children:p.error instanceof Error?p.error.message:`Could not check available apps.`}):(0,R.jsxs)(R.Fragment,{children:[ie.length>0&&(0,R.jsxs)(`section`,{"aria-labelledby":`ai-apps-heading`,children:[(0,R.jsx)(`h3`,{id:`ai-apps-heading`,className:`mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`AI coding apps`}),(0,R.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:ie.map(e=>(0,R.jsx)(Xe,{target:e,busy:s!==null,launching:s===e.id,onLaunch:v},e.id))})]}),g.length>0&&(0,R.jsxs)(`section`,{"aria-labelledby":`editors-heading`,children:[(0,R.jsx)(`h3`,{id:`editors-heading`,className:`mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`Code editors`}),(0,R.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:g.map(e=>(0,R.jsx)(Xe,{target:e,busy:s!==null,launching:s===e.id,preferred:e.id===ae,onLaunch:v},e.id))})]}),!_&&(0,R.jsx)(P,{className:`rounded-xl border border-dashed py-8 md:p-8`,children:(0,R.jsxs)(N,{children:[(0,R.jsx)(j,{variant:`icon`,children:(0,R.jsx)(Ge,{})}),(0,R.jsx)(Fe,{className:`text-base`,children:`No compatible apps detected`}),(0,R.jsx)(Be,{children:`Install a supported coding app or add its command to PATH, then recheck.`})]})})]}),(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-t border-border pt-3`,children:[(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,"aria-live":`polite`,children:S?`Checking recent sessions and apps…`:`Can’t find your app or session? Recheck detection.`}),(0,R.jsxs)(y,{size:`sm`,variant:`ghost`,onClick:()=>void x(),disabled:S||s!==null,children:[(0,R.jsx)(Re,{className:S?`animate-spin`:``}),`Recheck`]})]})]})]})})]})}var $e=`__ad-hoc__`,et=new URLSearchParams(window.location.search).get(`env`)===`vscode`,tt=[{value:`quick`,title:`Small task`,body:`Make and verify a focused change.`},{value:`feature`,title:`Standard change`,body:`Plan, implement, verify, and review a feature.`},{value:`epic`,title:`Epic`,body:`Track a larger change through dependent milestones.`}],nt=[{value:`in-place`,icon:Ue,title:`In-place`,body:`Work directly in the source repos. No branches or worktrees — fastest start.`},{value:`worktree`,icon:De,title:`Isolated worktrees`,body:`A feature branch and worktree per repo. Your source checkouts stay untouched.`}];function rt({repo:e,value:t,onChange:n,enabled:i}){let a=te(e.path,i),o=(0,I.useMemo)(()=>[...new Set([...a.data?.local??[],...a.data?.remote??[]])],[a.data]),s=`branches-${e.path.replace(/[^a-zA-Z0-9]/g,`-`)}`;return(0,R.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`w-40 shrink-0 truncate text-xs`,children:e.name}),(0,R.jsx)(r,{list:s,value:t,onChange:e=>n(e.target.value),placeholder:`existing branch (must exist)`,className:`h-7 font-mono text-xs`}),(0,R.jsx)(`datalist`,{id:s,children:o.map(e=>(0,R.jsx)(`option`,{value:e},e))})]})}function it({step:e}){return(0,R.jsxs)(`li`,{className:`flex items-center gap-3 py-2`,children:[(0,R.jsx)(`span`,{className:v(`grid size-5 shrink-0 place-items-center rounded-full border`,e.status===`completed`&&`border-success bg-success/15 text-success-foreground`,e.status===`running`&&`border-primary text-primary`,e.status===`failed`&&`border-destructive bg-destructive/15 text-destructive-foreground`,e.status===`pending`&&`border-border text-muted-foreground`),children:e.status===`completed`?(0,R.jsx)(k,{className:`size-3`}):e.status===`running`?(0,R.jsx)(D,{className:`size-3`}):e.status===`failed`?(0,R.jsx)(A,{className:`size-3`}):null}),(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`p`,{className:`text-sm font-medium`,children:e.name}),(0,R.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:e.message})]})]})}function at(){let e=d(),[t,n]=u(),o=se(),c=a(),te=ie(),re=ee(),g=l(),_=ae(),b=h(),x=m(),{progress:S,start:C,reset:le}=Je(),w=t.get(`job`),[ue,fe]=(0,I.useState)(t.get(`project`)??$e),[pe,me]=(0,I.useState)(`feature`),[_e,ye]=(0,I.useState)(`feature`),[E,Ee]=(0,I.useState)(`in-place`),[k,Pe]=(0,I.useState)(``),[A,Fe]=(0,I.useState)(``),[j,Be]=(0,I.useState)(``),[M,N]=(0,I.useState)([]),[P,F]=(0,I.useState)([]),[Ue,Ge]=(0,I.useState)(!1),[Ke,qe]=(0,I.useState)([]),[L,z]=(0,I.useState)([]),[B,Ye]=(0,I.useState)([]),[V,Xe]=(0,I.useState)(``),[Ze,at]=(0,I.useState)(``),[ot,st]=(0,I.useState)(!1),[ct,lt]=(0,I.useState)(null),[H,ut]=(0,I.useState)({}),[dt,ft]=(0,I.useState)(!1),[pt,U]=(0,I.useState)(null),[mt,W]=(0,I.useState)(!1),[G,ht]=(0,I.useState)(``),[K,gt]=(0,I.useState)(``),[_t,vt]=(0,I.useState)(``),[yt,bt]=(0,I.useState)(`vertical`),[xt,St]=(0,I.useState)(``),[Ct,wt]=(0,I.useState)(!1),Tt=f(),Et=async()=>{if(!(!G.trim()||!K.trim())){wt(!0);try{let e=K.trim().toLowerCase();await Tt.mutateAsync({id:e,name:G.trim(),description:_t.trim()||G.trim(),categoryType:yt,verifyCommand:xt.trim()||void 0,tags:[e,...G.trim().toLowerCase().split(/\s+/).filter(Boolean)]}),N(t=>t.includes(e)?t:[...t,e]),W(!1),ht(``),gt(``),vt(``),St(``)}catch{}finally{wt(!1)}}},Dt=(0,I.useMemo)(()=>{if(!j.trim()||j.trim().length<3)return[];let e=j.toLowerCase(),t=[];for(let n of b.data??[])M.includes(n.id)||[n.id,n.name,...n.tags??[]].some(t=>t&&e.includes(t.toLowerCase()))&&t.push({id:n.id,title:`#${n.id}`,type:`tag`});for(let n of g.data??[])L.includes(n.id)||[n.id,n.name,n.title,...n.tags??[]].some(t=>t&&t.length>2&&e.includes(t.toLowerCase()))&&t.push({id:n.id,title:n.title||n.name,type:`skill`});return t.slice(0,6)},[j,b.data,g.data,M,L]);(0,I.useEffect)(()=>{w?C(w):le()},[w,le,C]);let Ot=()=>{le(),n(e=>{let t=new URLSearchParams(e);return t.delete(`job`),t},{replace:!0})},kt=()=>{let e=new URL(window.location.href);e.hash=`#/new`,window.location.replace(e.toString())},At=()=>{w&&C(w)},q=(0,I.useMemo)(()=>(o.data??[]).find(e=>e.id===ue)??null,[o.data,ue]),J=(0,I.useMemo)(()=>q?q.repos.map(e=>({name:de(e.path),path:e.path,defaultBranch:e.defaultBranch})):(c.data??[]).filter(e=>P.includes(e.path)),[q,c.data,P]),[jt,Mt]=(0,I.useState)(!0),[Nt,Y]=(0,I.useState)(null),X=p(),Pt=(0,I.useMemo)(()=>J.map(e=>({path:e.path,branch:H[e.path]||e.defaultBranch})),[J,H]),Z=oe(Pt,Pt.length>0),Ft=(0,I.useMemo)(()=>{let e={};for(let t of Z.data??[])e[t.repoPath]=t;return e},[Z.data]),It=(0,I.useMemo)(()=>(Z.data??[]).filter(e=>e.status===`behind`),[Z.data]),Lt=async()=>{Y(null);try{let e=(await X.mutateAsync({repos:It.map(e=>({path:e.repoPath,branch:e.branch}))})).results.filter(e=>e.status===`dirty`||e.status===`diverged`);e.length>0&&Y(`Could not update ${e.length} repo(s): ${e.map(e=>`${e.repoName} (${e.message})`).join(`; `)}`)}catch(e){Y(e instanceof Error?e.message:String(e))}},Rt=async(e,t)=>{Y(null);try{let n=(await X.mutateAsync({path:e,branch:t})).results.find(e=>!e.success);n&&Y(`Could not update ${n.repoName}: ${n.message}`)}catch(e){Y(e instanceof Error?e.message:String(e))}},Q=E===`in-place`,zt=(Q?A.trim().length>0:k.trim().length>0)&&J.length>0&&j.trim().length>0,Bt=e=>{Xe(e),lt(null);let t=(re.data??[]).find(t=>t.id===e);at(t?.content??``)},Vt=async()=>{if(!j.trim()){U(`Describe what you are building first — the suggestion is based on it.`);return}U(null),st(!0);try{let e=await be(`/api/workspace/suggest-workflow`,{method:`POST`,body:JSON.stringify({description:j,repos:J})});Xe(e.suggestedWorkflowId),at(e.customInstructions),lt(e.difficulty)}catch(e){U(e instanceof Error?e.message:String(e))}finally{st(!1)}},Ht=(0,I.useRef)(!1),Ut=async()=>{if(Ht.current||x.isPending||!zt)return;Ht.current=!0,U(null);let e={flowType:_e,workType:pe,mode:E,projectId:q?.id,...Q?{name:A.trim()}:{branchName:k.trim()},description:j.trim(),repos:J.map(e=>({...e,existingBranch:!Q&&H[e.path]?.trim()?H[e.path].trim():void 0})),assistants:Ke,enabledSkills:L.length>0?L:void 0,enabledAgents:B.length>0?B:void 0,domainPacks:M.length>0?M:void 0,teamworkInstructions:Ze.trim()||void 0,autoUpdateBase:jt};try{let{jobId:t}=await x.mutateAsync(e);C(t),n(e=>{let n=new URLSearchParams(e);return n.set(`job`,t),n},{replace:!0})}catch(e){U(e instanceof Error?e.message:String(e))}finally{Ht.current=!1}},$=S.status===`idle`&&w?{status:`running`,steps:[]}:S;if($.status!==`idle`){let t=$.steps.find(e=>e.status===`failed`);return(0,R.jsxs)(`div`,{className:`mx-auto max-w-xl animate-fade-in`,children:[(0,R.jsx)(`h1`,{className:`text-xl font-semibold`,children:$.status===`running`?`Setting up your workspace…`:$.status===`completed`?`Workspace ready`:$.status===`failed`?`Workspace creation failed`:`Unable to reconnect to workspace setup`}),(0,R.jsx)(`ul`,{"aria-live":`polite`,"aria-relevant":`additions text`,className:`mt-6 divide-y divide-border rounded-xl border border-border bg-card px-4`,children:$.steps.length>0?$.steps.map(e=>(0,R.jsx)(it,{step:e},e.id)):(0,R.jsxs)(`li`,{className:`flex items-center gap-3 py-3.5`,children:[(0,R.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary`,children:(0,R.jsx)(D,{className:`size-3`})}),(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`p`,{className:`text-sm font-medium`,children:`Connecting to workspace setup…`}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Waiting for creation progress…`})]})]})}),($.status===`failed`||$.status===`unavailable`)&&(0,R.jsx)(`p`,{className:`mt-4 text-sm text-destructive-foreground`,children:t?.message??$.error??`Something went wrong.`}),$.status===`completed`&&$.workspacePath&&(0,R.jsx)(`p`,{className:`mt-4 truncate font-mono text-xs text-muted-foreground`,children:$.workspacePath}),pt&&(0,R.jsx)(`p`,{className:`mt-2 text-sm text-destructive-foreground`,children:pt}),(0,R.jsxs)(`div`,{"data-testid":`workspace-ready-actions`,className:`mt-6 flex min-w-0 flex-col gap-2 sm:flex-row sm:flex-wrap`,children:[$.status===`completed`&&$.workspaceId&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(y,{className:`w-full min-w-0 whitespace-normal sm:w-auto`,onClick:()=>e(`/workspaces/${encodeURIComponent($.workspaceId)}`),children:`Open workspace`}),$.workspacePath&&(0,R.jsx)(Qe,{workspaceId:$.workspaceId,workspacePath:$.workspacePath,isVsCode:et,className:`w-full min-w-0 whitespace-normal sm:w-auto`})]}),$.status===`failed`&&(0,R.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,R.jsx)(y,{variant:`default`,onClick:Ot,children:`Back to form (edit & retry)`}),(0,R.jsx)(y,{variant:`outline`,onClick:kt,children:`Start over (clear form)`})]}),$.status===`unavailable`&&(0,R.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,R.jsx)(y,{variant:`default`,onClick:At,children:`Try reconnecting`}),(0,R.jsx)(y,{variant:`outline`,onClick:Ot,children:`Back to form`})]}),$.status===`running`&&(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This can take a moment for large repositories.`}),(0,R.jsx)(y,{variant:`outline`,size:`sm`,onClick:Ot,children:`Return to form`})]})]})]})}return(0,R.jsxs)(`div`,{className:`mx-auto max-w-xl animate-fade-in`,children:[(0,R.jsxs)(`header`,{className:`mb-6`,children:[(0,R.jsx)(`h1`,{className:`text-xl font-semibold`,children:`Start work`}),(0,R.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Pick where the work happens and how isolated it should be.`})]}),(0,R.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,R.jsxs)(`section`,{children:[(0,R.jsx)(`span`,{className:`mb-1.5 block text-sm font-medium`,children:`Project`}),(0,R.jsxs)(Oe,{value:ue,onValueChange:e=>typeof e==`string`&&fe(e),children:[(0,R.jsx)(We,{className:`w-full`,"aria-label":`Project`,children:(0,R.jsx)(Ce,{children:q?q.name:`Ad-hoc — pick repositories manually`})}),(0,R.jsxs)(Ne,{alignItemWithTrigger:!1,children:[(o.data??[]).map(e=>(0,R.jsx)(O,{value:e.id,children:e.name},e.id)),(0,R.jsx)(O,{value:$e,children:`Ad-hoc — pick repositories manually`})]})]}),q?(0,R.jsx)(`ul`,{className:`mt-2 flex flex-col gap-0.5`,children:q.repos.map(e=>(0,R.jsx)(`li`,{className:`truncate font-mono text-xs text-muted-foreground`,children:e.path},e.path))}):(0,R.jsxs)(`div`,{className:`mt-2`,children:[(0,R.jsx)(he,{repos:c.data??[],selectedPaths:P,onToggle:e=>F(t=>t.includes(e.path)?t.filter(t=>t!==e.path):[...t,e.path]),loading:c.isLoading,freshnessMap:Ft}),(0,R.jsx)(ge,{onCreated:e=>F(t=>[...t,e.path])})]}),J.length>0&&(0,R.jsxs)(`div`,{className:`mt-3 rounded-lg border border-border bg-card p-3`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsxs)(`span`,{className:`text-xs font-medium text-muted-foreground flex items-center gap-1.5`,children:[(0,R.jsx)(De,{className:`size-3.5`}),`Base repository sync (`,J.length,`)`]}),(0,R.jsx)(`div`,{className:`flex items-center gap-2`,children:It.length>0&&(0,R.jsxs)(y,{size:`sm`,variant:`outline`,className:`h-6 text-xs px-2`,onClick:Lt,disabled:X.isPending,children:[X.isPending?(0,R.jsx)(D,{className:`size-3 mr-1`}):(0,R.jsx)(Re,{className:`size-3 mr-1`}),`Pull `,It.length,` stale `,It.length===1?`repo`:`repos`]})})]}),(0,R.jsx)(`ul`,{className:`mt-2 divide-y divide-border text-xs`,children:J.map(e=>{let t=Ft[e.path],n=t?.status===`behind`;return(0,R.jsxs)(`li`,{className:`flex items-center justify-between py-1.5`,children:[(0,R.jsxs)(`div`,{className:`min-w-0 flex-1 truncate pr-2`,children:[(0,R.jsx)(`span`,{className:`font-medium`,children:e.name}),(0,R.jsxs)(`span`,{className:`ml-2 font-mono text-[11px] text-muted-foreground`,children:[`(`,H[e.path]||e.defaultBranch,`)`]})]}),(0,R.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[Z.isLoading?(0,R.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`Checking…`}):t?(0,R.jsx)(Te,{tone:t.status===`up-to-date`?`success`:t.status===`behind`?`warning`:t.status===`diverged`?`danger`:t.status===`ahead`?`info`:`neutral`,title:t.message,children:t.status===`behind`?`↓ ${t.behind} behind ${t.trackingBranch}`:t.status===`up-to-date`?`Up to date`:t.status===`diverged`?`Diverged`:t.status===`ahead`?`↑ ${t.ahead} ahead`:`Local`}):null,n&&(0,R.jsx)(y,{size:`sm`,variant:`ghost`,className:`h-5 px-1.5 text-[11px] text-amber-500 hover:text-amber-600`,onClick:()=>Rt(e.path,H[e.path]||e.defaultBranch),disabled:X.isPending,children:`Pull`})]})]},e.path)})}),Nt&&(0,R.jsx)(`p`,{className:`mt-2 text-xs text-amber-500`,children:Nt})]}),(o.data??[]).length===0&&!o.isLoading&&(0,R.jsxs)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:[`Tip: `,(0,R.jsx)(s,{to:`/projects`,className:`text-primary hover:underline`,children:`register a project`}),` to skip repo picking next time.`]})]}),(0,R.jsxs)(`fieldset`,{children:[(0,R.jsx)(`legend`,{className:`mb-1.5 text-sm font-medium`,children:`What kind of work is this?`}),(0,R.jsxs)(`label`,{className:`mb-3 block text-sm`,children:[`Work type`,(0,R.jsxs)(`select`,{"aria-label":`Work type`,className:`mt-1 block w-full rounded-md border border-border bg-background p-2`,value:pe,onChange:e=>me(e.target.value),children:[(0,R.jsx)(`option`,{value:`bug`,children:`Bug fix`}),(0,R.jsx)(`option`,{value:`feature`,children:`Feature`}),(0,R.jsx)(`option`,{value:`performance`,children:`Performance`}),(0,R.jsx)(`option`,{value:`refactor`,children:`Refactor`}),(0,R.jsx)(`option`,{value:`rewrite`,children:`Rewrite`})]})]}),(0,R.jsx)(`p`,{className:`mb-3 text-xs text-muted-foreground`,children:`Choose a starting size and milestone preset. You can edit milestones in Plan.`}),(0,R.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:tt.map(e=>(0,R.jsxs)(`label`,{className:v(`cursor-pointer rounded-xl border p-4 focus-within:ring-2 focus-within:ring-ring`,_e===e.value?`border-primary bg-primary/5`:`border-border bg-card`),children:[(0,R.jsxs)(`span`,{className:`flex items-center gap-2 text-sm font-semibold`,children:[(0,R.jsx)(`input`,{type:`radio`,name:`flowType`,value:e.value,checked:_e===e.value,onChange:()=>ye(e.value),"aria-label":e.title,"aria-describedby":`flow-${e.value}-description`,className:`accent-primary`}),e.title]}),(0,R.jsx)(`p`,{id:`flow-${e.value}-description`,className:`mt-2 text-xs text-muted-foreground`,children:e.body})]},e.value))})]}),(0,R.jsxs)(`section`,{children:[(0,R.jsx)(`span`,{className:`mb-1.5 block text-sm font-medium`,children:`How do you want to work?`}),(0,R.jsx)(`div`,{role:`radiogroup`,"aria-label":`Work mode`,className:`grid gap-3 sm:grid-cols-2`,onKeyDown:e=>{if([`ArrowRight`,`ArrowDown`,`ArrowLeft`,`ArrowUp`].includes(e.key)){e.preventDefault();let t=E===`in-place`?`worktree`:`in-place`;Ee(t),document.getElementById(`mode-${t}`)?.focus()}},children:nt.map(e=>(0,R.jsxs)(`button`,{id:`mode-${e.value}`,type:`button`,role:`radio`,"aria-checked":E===e.value,tabIndex:E===e.value?0:-1,onClick:()=>Ee(e.value),className:v(`cursor-pointer rounded-xl border p-4 text-left outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring`,E===e.value?`border-primary bg-primary/5 ring-1 ring-primary`:`border-border bg-card hover:border-foreground/20`),children:[(0,R.jsx)(e.icon,{className:v(`size-4`,E===e.value?`text-primary`:`text-muted-foreground`)}),(0,R.jsx)(`p`,{className:`mt-2 text-sm font-semibold`,children:e.title}),(0,R.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:e.body})]},e.value))})]}),(0,R.jsxs)(`section`,{children:[Q?(0,R.jsxs)(`label`,{className:`block`,children:[(0,R.jsx)(`span`,{className:`mb-1 block text-sm font-medium`,children:`Workspace name`}),(0,R.jsx)(r,{value:A,onChange:e=>Fe(e.target.value),placeholder:`e.g. Fix invoice rounding`})]}):(0,R.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,R.jsxs)(`label`,{className:`block`,children:[(0,R.jsx)(`span`,{className:`mb-1 block text-sm font-medium`,children:`Feature branch`}),(0,R.jsx)(r,{value:k,onChange:e=>Pe(e.target.value),placeholder:`e.g. feature/invoice-rounding`,className:`font-mono`})]}),J.length>0&&(0,R.jsxs)(`details`,{className:`rounded-lg border border-border px-3 py-2`,onToggle:e=>ft(e.target.open),children:[(0,R.jsx)(`summary`,{className:`cursor-pointer text-xs font-medium text-muted-foreground`,children:`Use an existing branch for specific repos (optional)`}),(0,R.jsx)(`div`,{className:`mt-2 flex flex-col gap-2`,children:J.map(e=>(0,R.jsx)(rt,{repo:e,enabled:dt,value:H[e.path]??``,onChange:t=>ut(n=>({...n,[e.path]:t}))},e.path))})]})]}),(0,R.jsxs)(`label`,{className:`mt-3 flex items-center gap-2 cursor-pointer text-xs text-muted-foreground`,children:[(0,R.jsx)(T,{checked:jt,onCheckedChange:e=>Mt(!!e),"aria-label":`Fast-forward clean base branches before creating workspace`}),(0,R.jsx)(`span`,{children:`Fast-forward clean base branches to latest remote commits`})]})]}),(0,R.jsxs)(`section`,{children:[(0,R.jsxs)(`label`,{className:`block`,children:[(0,R.jsx)(`span`,{className:`mb-1 block text-sm font-medium`,children:`What are you building?`}),(0,R.jsx)(Ve,{value:j,onChange:e=>Be(e.target.value),placeholder:`A short description — your AI assistant reads this to plan the work.`,rows:3})]}),Dt.length>0&&(0,R.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-1.5 p-2 rounded-lg bg-primary/5 border border-primary/20 text-xs`,children:[(0,R.jsxs)(`span`,{className:`text-primary font-medium flex items-center gap-1 text-[11px]`,children:[(0,R.jsx)(we,{className:`size-3`}),` Suggested for this task:`]}),Dt.map(e=>(0,R.jsxs)(`button`,{type:`button`,onClick:()=>{e.type===`tag`?N(t=>t.includes(e.id)?t:[...t,e.id]):z(t=>t.includes(e.id)?t:[...t,e.id])},className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-card border border-primary/30 text-[11px] font-mono hover:bg-primary/10 transition-colors text-foreground`,children:[(0,R.jsxs)(`span`,{children:[`+`,e.title]}),(0,R.jsx)(i,{variant:`outline`,className:`text-[8px] px-0.5 py-0 uppercase`,children:e.type})]},`${e.type}-${e.id}`))]})]}),(0,R.jsxs)(`section`,{children:[(0,R.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[(0,R.jsxs)(`span`,{className:`text-sm font-medium flex items-center gap-1.5`,children:[(0,R.jsx)(ve,{className:`size-4 text-primary`}),`Category & Domain Tags`,M.length>0&&(0,R.jsxs)(`span`,{className:`text-xs text-muted-foreground font-normal`,children:[`(`,M.length,` attached)`]})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground hidden sm:inline`,children:`Tags attach curated skill bundles & standards`}),(0,R.jsxs)(y,{type:`button`,size:`xs`,variant:`outline`,onClick:()=>W(!0),className:`h-6 text-xs gap-1 px-2 border-primary/40 text-primary hover:bg-primary/10`,children:[(0,R.jsx)(ve,{className:`size-3`}),`+ New Tag`]})]})]}),(0,R.jsx)(`div`,{className:`space-y-2`,children:b.isLoading?(0,R.jsxs)(`div`,{className:`flex items-center justify-center p-4 gap-2 text-xs text-muted-foreground rounded-lg border border-border`,children:[(0,R.jsx)(D,{className:`size-3`}),`Loading category tags...`]}):(b.data??[]).length===0?(0,R.jsx)(`div`,{className:`p-3.5 border border-border rounded-xl bg-card/40 space-y-2`,children:(0,R.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-3`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-xs font-semibold text-foreground`,children:`No domain tags defined yet`}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:`Tags are optional bundles that package skills, rules, and test commands for a domain. You can create a tag now, or select skills directly below.`})]}),(0,R.jsxs)(y,{type:`button`,size:`xs`,variant:`outline`,onClick:()=>W(!0),className:`text-xs gap-1.5 h-7 shrink-0 text-primary border-primary/40 hover:bg-primary/10`,children:[(0,R.jsx)(ve,{className:`size-3 text-primary`}),`+ Create Tag`]})]})}):(0,R.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:(b.data??[]).map(e=>{let t=M.includes(e.id),n=e.skills?.length??0,r=e.rules?.length??0;return(0,R.jsxs)(`div`,{onClick:()=>N(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id]),className:v(`flex flex-col justify-between p-3 rounded-xl border cursor-pointer transition-colors text-left outline-none select-none`,t?`border-primary bg-primary/5 ring-1 ring-primary/40`:`border-border bg-card hover:border-foreground/20`),children:[(0,R.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(T,{checked:t,onCheckedChange:()=>N(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id]),"aria-label":`Attach ${e.name}`}),(0,R.jsxs)(`span`,{className:`font-medium text-xs font-mono`,children:[`#`,e.id]})]}),e.categoryType&&(0,R.jsx)(i,{variant:`outline`,className:`text-[10px] px-1 py-0 shrink-0 capitalize`,children:e.categoryType===`trait`?`trait`:`domain`})]}),(0,R.jsx)(`p`,{className:`mt-1.5 text-xs text-muted-foreground line-clamp-2`,children:e.description||e.name}),(n>0||r>0)&&(0,R.jsxs)(`div`,{className:`mt-2 pt-2 border-t border-border/50 flex flex-wrap gap-1 items-center text-[10px]`,children:[n>0&&(0,R.jsxs)(`span`,{className:`text-primary font-mono flex items-center gap-1`,children:[(0,R.jsx)(xe,{className:`size-2.5`}),e.skills.join(`, `)]}),r>0&&(0,R.jsxs)(`span`,{className:`text-muted-foreground ml-auto font-mono`,children:[r,` rule`,r===1?``:`s`]})]})]},e.id)})})}),(0,R.jsxs)(`div`,{className:`mt-4 pt-4 border-t border-border/60`,children:[(0,R.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[(0,R.jsxs)(`span`,{className:`text-sm font-medium flex items-center gap-1.5`,children:[(0,R.jsx)(xe,{className:`size-4 text-primary`}),`Direct Agent Skills`,L.length>0&&(0,R.jsxs)(`span`,{className:`text-xs text-muted-foreground font-normal`,children:[`(`,L.length,` selected)`]})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(g.data??[]).length>0&&(0,R.jsx)(y,{type:`button`,size:`xs`,variant:`ghost`,onClick:()=>{let e=(g.data??[]).map(e=>e.id);z(L.length===e.length?[]:e)},className:`text-xs text-muted-foreground hover:text-foreground h-6 px-2`,children:L.length===(g.data??[]).length&&(g.data??[]).length>0?`Deselect All`:`Select All`}),(0,R.jsx)(s,{to:`/skills`,className:`text-xs text-primary hover:underline flex items-center gap-1`,children:`Skill Library →`})]})]}),g.isLoading?(0,R.jsxs)(`div`,{className:`flex items-center justify-center p-3 gap-2 text-xs text-muted-foreground rounded-lg border border-border`,children:[(0,R.jsx)(D,{className:`size-3`}),`Loading skills...`]}):(g.data??[]).length===0?(0,R.jsx)(`div`,{className:`p-3 border border-dashed border-border rounded-lg bg-card/20 text-center`,children:(0,R.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`No skills in your catalog yet. You can create skills in the`,` `,(0,R.jsx)(s,{to:`/skills`,className:`text-primary underline`,children:`Skill Library`}),` `,`or let AI agents create them during development.`]})}):(0,R.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:(g.data??[]).map(e=>{let t=L.includes(e.id);return(0,R.jsxs)(`div`,{onClick:()=>z(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id]),className:v(`flex items-center justify-between gap-2 p-2.5 rounded-lg border cursor-pointer transition-colors select-none text-left`,t?`border-primary/60 bg-primary/5 ring-1 ring-primary/40 text-foreground`:`border-border bg-card hover:border-foreground/20 text-muted-foreground`),children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,R.jsx)(T,{checked:t,onCheckedChange:()=>z(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id]),"aria-label":`Select ${e.title||e.name}`}),(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`p`,{className:`font-mono text-xs font-medium truncate text-foreground`,children:e.title||e.name}),e.description&&(0,R.jsx)(`p`,{className:`text-[11px] text-muted-foreground line-clamp-1`,children:e.description})]})]}),e.category&&(0,R.jsx)(i,{variant:`outline`,className:`text-[9px] px-1 py-0 shrink-0 capitalize`,children:e.category})]},e.id)})})]})]}),(0,R.jsx)(`section`,{className:`rounded-lg border border-border bg-card p-4`,"aria-label":`AI harnesses`,children:(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`mb-1.5 block text-sm font-medium`,children:`AI harnesses`}),(0,R.jsx)(`p`,{className:`mb-3 text-xs text-muted-foreground`,children:`Choose which tools receive workspace instructions. This does not start a session or choose a default harness.`}),(0,R.jsx)(`div`,{className:`flex flex-wrap gap-3`,children:(te.data??[]).map(e=>(0,R.jsxs)(`label`,{className:v(`flex cursor-pointer items-center gap-2 rounded-lg border border-border px-3 py-1.5 text-sm`,!e.detected&&`opacity-50`),children:[(0,R.jsx)(T,{checked:Ke.includes(e.name),onCheckedChange:()=>qe(t=>t.includes(e.name)?t.filter(t=>t!==e.name):[...t,e.name])}),(0,R.jsx)(He,{harness:e.name}),e.displayName,!e.detected&&(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Not installed`})]},e.name))})]})}),(0,R.jsxs)(`section`,{className:`rounded-xl border border-border`,children:[(0,R.jsxs)(`button`,{type:`button`,onClick:()=>Ge(e=>!e),className:`flex w-full items-center justify-between px-4 py-3 text-sm font-medium hover:bg-accent`,"aria-expanded":Ue,children:[`Advanced`,(0,R.jsx)(ce,{className:v(`size-4 text-muted-foreground transition-transform`,Ue&&`rotate-180`)})]}),Ue&&(0,R.jsxs)(`div`,{className:`flex flex-col gap-4 border-t border-border p-4`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between`,children:[(0,R.jsx)(`span`,{className:`text-sm font-medium`,children:`Teamwork strategy`}),(0,R.jsxs)(y,{size:`xs`,variant:`outline`,onClick:Vt,disabled:ot,children:[ot?(0,R.jsx)(D,{}):(0,R.jsx)(we,{}),`Suggest with AI`]})]}),(0,R.jsxs)(Oe,{value:V,onValueChange:e=>typeof e==`string`&&Bt(e),children:[(0,R.jsx)(We,{className:`w-full`,"aria-label":`Teamwork strategy`,children:(0,R.jsx)(Ce,{children:(re.data??[]).find(e=>e.id===V)?.name??`None`})}),(0,R.jsxs)(Ne,{alignItemWithTrigger:!1,children:[(0,R.jsx)(O,{value:``,children:`None`}),(re.data??[]).map(e=>(0,R.jsx)(O,{value:e.id,children:e.name},e.id))]})]}),ct&&(0,R.jsxs)(`p`,{className:`mt-1.5 text-xs text-muted-foreground`,children:[`AI classified this task as `,(0,R.jsx)(`span`,{className:`font-medium`,children:ct}),` difficulty.`]}),(0,R.jsx)(Ve,{value:Ze,onChange:e=>at(e.target.value),placeholder:`Cooperation instructions for the agent team (editable — prefilled by the strategy pick or AI suggestion).`,rows:4,className:`mt-2 font-mono text-xs`})]}),(_.data??[]).length>0&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`mb-1.5 flex items-center justify-between`,children:(0,R.jsxs)(`span`,{className:`text-sm font-medium flex items-center gap-1.5`,children:[(0,R.jsx)(Ie,{className:`size-4 text-purple-400`}),`Codex Native Agents (`,B.length,` selected)`]})}),(0,R.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(_.data??[]).map(e=>{let t=B.includes(e.id);return(0,R.jsxs)(`label`,{className:v(`flex cursor-pointer items-center gap-2 rounded-lg border border-border px-3 py-1.5 text-xs`,t?`border-purple-500/60 bg-purple-500/5 text-foreground`:`text-muted-foreground hover:bg-muted/50`),children:[(0,R.jsx)(T,{checked:t,onCheckedChange:()=>Ye(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id])}),(0,R.jsx)(`span`,{className:`font-mono`,children:e.name})]},e.id)})})]})]})]}),pt&&(0,R.jsx)(`p`,{className:`text-sm text-destructive-foreground`,children:pt}),(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-4 border-t border-border pt-4`,children:[(0,R.jsxs)(`p`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,R.jsx)(ne,{className:`size-3.5`}),J.length,` repositor`,J.length===1?`y`:`ies`,` selected`]}),(0,R.jsxs)(y,{onClick:Ut,disabled:!zt||x.isPending,children:[x.isPending?(0,R.jsx)(D,{}):null,Q?`Start working`:`Create workspace`]})]})]}),(0,R.jsx)(je,{open:mt,onOpenChange:W,children:(0,R.jsxs)(Ae,{className:`max-w-md`,children:[(0,R.jsxs)(Le,{children:[(0,R.jsxs)(Me,{className:`flex items-center gap-2`,children:[(0,R.jsx)(ve,{size:16,className:`text-primary`}),(0,R.jsx)(`span`,{children:`Create Category Tag`})]}),(0,R.jsx)(ze,{children:`Tags bundle reusable skills, rules, and test verification commands for a domain.`})]}),(0,R.jsxs)(ke,{className:`space-y-3 py-2`,children:[(0,R.jsxs)(`div`,{className:`space-y-1`,children:[(0,R.jsx)(`label`,{className:`text-xs font-semibold text-foreground`,children:`Tag Name`}),(0,R.jsx)(r,{value:G,onChange:e=>{ht(e.target.value),(!K||K===G.toLowerCase().replace(/[^a-z0-9]+/g,`-`).slice(0,30))&>(e.target.value.toLowerCase().replace(/[^a-z0-9]+/g,`-`).slice(0,30))},placeholder:`e.g. Invoicing & Billing`,size:`sm`})]}),(0,R.jsxs)(`div`,{className:`space-y-1`,children:[(0,R.jsx)(`label`,{className:`text-xs font-semibold text-foreground`,children:`Tag ID / Slug`}),(0,R.jsx)(r,{value:K,onChange:e=>gt(e.target.value),placeholder:`e.g. billing`,size:`sm`,className:`font-mono`})]}),(0,R.jsxs)(`div`,{className:`space-y-1`,children:[(0,R.jsx)(`label`,{className:`text-xs font-semibold text-foreground`,children:`Type`}),(0,R.jsxs)(`select`,{value:yt,onChange:e=>bt(e.target.value),className:`w-full h-7.5 px-2 text-xs rounded-md border border-border bg-background text-foreground`,children:[(0,R.jsx)(`option`,{value:`vertical`,children:`Vertical Subsystem`}),(0,R.jsx)(`option`,{value:`trait`,children:`Horizontal Trait`})]})]}),(0,R.jsxs)(`div`,{className:`space-y-1`,children:[(0,R.jsx)(`label`,{className:`text-xs font-semibold text-foreground`,children:`Description (optional)`}),(0,R.jsx)(r,{value:_t,onChange:e=>vt(e.target.value),placeholder:`What this domain covers...`,size:`sm`})]}),(0,R.jsxs)(`div`,{className:`space-y-1`,children:[(0,R.jsx)(`label`,{className:`text-xs font-semibold text-foreground`,children:`Verification Command (optional)`}),(0,R.jsx)(r,{value:xt,onChange:e=>St(e.target.value),placeholder:`e.g. npm test -- billing`,size:`sm`,className:`font-mono`})]})]}),(0,R.jsxs)(Se,{className:`flex items-center justify-end gap-2 pt-2 border-t`,children:[(0,R.jsx)(y,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>W(!1),children:`Cancel`}),(0,R.jsx)(y,{type:`button`,size:`sm`,disabled:!G.trim()||!K.trim()||Ct,onClick:()=>void Et(),children:Ct?`Creating...`:`Create & Attach Tag`})]})]})})]})}export{at as StartWorkPage};
|