@jean2/client 1.0.9 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/SessionContent-CdwqbaxA.js +9 -0
- package/dist/assets/{SessionMenuButton-DYFvkVbS.js → SessionMenuButton-B1Y7WrJ0.js} +3 -3
- package/dist/assets/_serverId-BigXR4la.js +12 -0
- package/dist/assets/_sessionId-B-yzkOro.js +1 -0
- package/dist/assets/_sessionId-Cw9QdpVW.js +1 -0
- package/dist/assets/alert-DiQZ0wtR.js +31 -0
- package/dist/assets/badge-R1NzTNS9.js +1 -0
- package/dist/assets/{http-namespace-CAzyfpbt.js → http-namespace-DY6xQXl6.js} +1 -1
- package/dist/assets/{index-BfSdy9N7.js → index-Ba9RYqkp.js} +3 -3
- package/dist/assets/index-DSoqo1CY.css +2 -0
- package/dist/assets/{overview-DMnQd1ht.js → overview-CS-dbYj6.js} +1 -1
- package/dist/assets/{popover-w9JFiv-W.js → popover-ClFNuH2c.js} +1 -1
- package/dist/assets/switch-BcwUG5ak.js +1 -0
- package/dist/assets/workspace-BqmXgUL0.js +1 -0
- package/dist/index.html +3 -3
- package/dist/sw.js +1 -1
- package/package.json +1 -1
- package/dist/assets/SessionContent-ClGW5Wjz.js +0 -9
- package/dist/assets/_serverId-CQ5gqnnf.js +0 -11
- package/dist/assets/_sessionId-B2_zq3Dd.js +0 -1
- package/dist/assets/_sessionId-CyjHnxZK.js +0 -1
- package/dist/assets/alert-QyxizSIM.js +0 -31
- package/dist/assets/badge-CBTv6lwu.js +0 -1
- package/dist/assets/index-pIWtxkTI.css +0 -2
- package/dist/assets/switch-D6b_9WjE.js +0 -1
- package/dist/assets/workspace-DmK3rAja.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t,r as n,t as r}from"./jsx-runtime-CoWo_Ex4.js";import{t as i}from"./react-dom-lAXwbrYv.js";import{A as a,C as o,E as s,N as c,O as l,S as u,T as d,_ as f,a as p,b as m,d as h,f as g,h as _,j as v,k as y,l as b,n as x,p as S,s as C,t as w,w as T}from"./serverDataStore-CvTJtC_B.js";import{t as E}from"./createLucideIcon-Cev6Iqjf.js";import{A as D,C as ee,D as O,E as k,F as A,I as j,L as M,M as N,N as te,O as P,P as ne,R as F,S as re,T as ie,b as ae,j as oe,k as se,l as ce,u as I,w as le,x as ue,y as de}from"./dialog-CpPDW758.js";var fe=class extends v{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=g(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),me(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return he(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return he(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 o(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&&ge(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||o(this.options.enabled,this.#t)!==o(t.enabled,this.#t)||T(this.options.staleTime,this.#t)!==T(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||o(this.options.enabled,this.#t)!==o(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return ve(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(m)),t}#g(){this.#b();let e=T(this.options.staleTime,this.#t);if(S.isServer()||this.#r.isStale||!f(e))return;let t=l(this.#r.dataUpdatedAt,e)+1;this.#d=y.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(S.isServer()||o(this.options.enabled,this.#t)===!1||!f(this.#p)||this.#p===0)&&(this.#f=y.setInterval(()=>{(this.options.refetchIntervalInBackground||a.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(y.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(y.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,s=this.#a,c=e===n?this.#n:e.state,{state:l}=e,d={...l},f=!1,p;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&me(e,t),o=i&&ge(e,n,t,r);(a||o)&&(d={...d,...b(l.data,e.options)}),t._optimisticResults===`isRestoring`&&(d.fetchStatus=`idle`)}let{error:m,errorUpdatedAt:h,status:_}=d;p=d.data;let v=!1;if(t.placeholderData!==void 0&&p===void 0&&_===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===s?.placeholderData?(e=i.data,v=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(_=`success`,p=u(i?.data,e,t),f=!0)}if(t.select&&p!==void 0&&!v)if(i&&p===a?.data&&t.select===this.#c)p=this.#l;else try{this.#c=t.select,p=t.select(p),p=u(i?.data,p,t),this.#l=p,this.#s=null}catch(e){this.#s=e}this.#s&&(m=this.#s,p=this.#l,h=Date.now(),_=`error`);let y=d.fetchStatus===`fetching`,x=_===`pending`,S=_===`error`,C=x&&y,w=p!==void 0,T={status:_,fetchStatus:d.fetchStatus,isPending:x,isSuccess:_===`success`,isError:S,isInitialLoading:C,isLoading:C,data:p,dataUpdatedAt:d.dataUpdatedAt,error:m,errorUpdatedAt:h,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:y,isRefetching:y&&!x,isLoadingError:S&&!w,isPaused:d.fetchStatus===`paused`,isPlaceholderData:f,isRefetchError:S&&w,isStale:_e(e,t),refetch:this.refetch,promise:this.#o,isEnabled:o(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=T.data!==void 0,r=T.status===`error`&&!t,i=e=>{r?e.reject(T.error):t&&e.resolve(T.data)},a=()=>{i(this.#o=T.promise=g())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||T.data!==o.value)&&a();break;case`rejected`:(!r||T.error!==o.reason)&&a();break}}return T}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!d(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){h.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function pe(e,t){return o(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&o(t.retryOnMount,e)===!1)}function me(e,t){return pe(e,t)||e.state.data!==void 0&&he(e,t,t.refetchOnMount)}function he(e,t,n){if(o(t.enabled,e)!==!1&&T(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&_e(e,t)}return!1}function ge(e,t,n,r){return(e!==t||o(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&_e(e,n)}function _e(e,t){return o(t.enabled,e)!==!1&&e.isStaleByTime(T(t.staleTime,e))}function ve(e,t){return!d(e.getCurrentResult(),t)}var ye=class extends v{#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.mutationKey)!==_(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??C();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){h.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)})})}},L=r(),R=t(n(),1),be=R.createContext(!1),xe=()=>R.useContext(be);be.Provider;function Se(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ce=R.createContext(Se()),we=()=>R.useContext(Ce),Te=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?s(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Ee=e=>{R.useEffect(()=>{e.clearReset()},[e])},De=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||s(n,[e.error,r])),Oe=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))}},ke=(e,t)=>e.isLoading&&e.isFetching&&!t,Ae=(e,t)=>e?.suspense&&t.isPending,je=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Me(e,t,n){let r=xe(),i=we(),a=p(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?`isRestoring`:`optimistic`,Oe(o),Te(o,i,s),Ee(i);let c=!a.getQueryCache().get(o.queryHash),[l]=R.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&e.subscribed!==!1;if(R.useSyncExternalStore(R.useCallback(e=>{let t=d?l.subscribe(h.batchCalls(e)):m;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),R.useEffect(()=>{l.setOptions(o)},[o,l]),Ae(o,u))throw je(o,l,i);if(De({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!S.isServer()&&ke(u,r)&&(c?je(o,l,i):s?.promise)?.catch(m).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?u:l.trackResult(u)}function z(e,t){return Me(e,fe,t)}function B(e,t){let n=p(t),[r]=R.useState(()=>new ye(n,e));R.useEffect(()=>{r.setOptions(e)},[r,e]);let i=R.useSyncExternalStore(R.useCallback(e=>r.subscribe(h.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=R.useCallback((e,t)=>{r.mutate(e,t).catch(m)},[r]);if(i.error&&s(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function Ne(e){return Math.max(220,Math.min(512,e))}var Pe={SESSIONS:`jean2_sessions_panel_width`,FILES:`jean2_files_panel_width`},Fe=`jean2_draft_`,Ie=720*60*60*1e3;function Le(){try{for(let e=0;e<localStorage.length;e++){let t=localStorage.key(e);if(!(!t||!t.startsWith(`jean2_draft_`)))try{let e=localStorage.getItem(t);if(!e)continue;let n=JSON.parse(e);Date.now()-n.updatedAt>2592e6&&localStorage.removeItem(t)}catch{localStorage.removeItem(t)}}}catch{}}var Re=E(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),ze=E(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Be=E(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),Ve=E(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),He=E(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Ue=E(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),We=E(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Ge=E(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),Ke=E(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),qe=t(i(),1),Je=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Ye=`VisuallyHidden`,Xe=R.forwardRef((e,t)=>(0,L.jsx)(N.span,{...e,ref:t,style:{...Je,...e.style}}));Xe.displayName=Ye;var Ze=Xe;function Qe(e){let t=e+`CollectionProvider`,[n,r]=oe(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=R.useRef(null),a=R.useRef(new Map).current;return(0,L.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=A(s),l=R.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,L.jsx)(c,{ref:F(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=A(u),p=R.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=R.useRef(null),s=F(t,o),c=a(u,n);return R.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,L.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return R.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}var $e=`Collapsible`,[et,tt]=oe($e),[nt,rt]=et($e),it=R.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=P({prop:r,defaultProp:i??!1,onChange:o,caller:$e});return(0,L.jsx)(nt,{scope:n,disabled:a,contentId:k(),open:c,onOpenToggle:R.useCallback(()=>l(e=>!e),[l]),children:(0,L.jsx)(N.div,{"data-state":ut(c),"data-disabled":a?``:void 0,...s,ref:t})})});it.displayName=$e;var at=`CollapsibleTrigger`,ot=R.forwardRef((e,t)=>{let{__scopeCollapsible:n,...r}=e,i=rt(at,n);return(0,L.jsx)(N.button,{type:`button`,"aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":ut(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:D(e.onClick,i.onOpenToggle)})});ot.displayName=at;var st=`CollapsibleContent`,ct=R.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=rt(st,e.__scopeCollapsible);return(0,L.jsx)(O,{present:n||i.open,children:({present:e})=>(0,L.jsx)(lt,{...r,ref:t,present:e})})});ct.displayName=st;var lt=R.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=rt(st,n),[s,c]=R.useState(r),l=R.useRef(null),u=F(t,l),d=R.useRef(0),f=d.current,p=R.useRef(0),m=p.current,h=o.open||s,g=R.useRef(h),_=R.useRef(void 0);return R.useEffect(()=>{let e=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(e)},[]),se(()=>{let e=l.current;if(e){_.current=_.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();d.current=t.height,p.current=t.width,g.current||(e.style.transitionDuration=_.current.transitionDuration,e.style.animationName=_.current.animationName),c(r)}},[o.open,r]),(0,L.jsx)(N.div,{"data-state":ut(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!h,...a,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:h&&i})});function ut(e){return e?`open`:`closed`}var dt=it,ft=R.createContext(void 0);function pt(e){let t=R.useContext(ft);return e||t||`ltr`}function mt(e){let t=R.useRef({value:e,previous:e});return R.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function ht(e){let[t,n]=R.useState(void 0);return se(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var gt=[`top`,`right`,`bottom`,`left`],_t=Math.min,V=Math.max,vt=Math.round,yt=Math.floor,H=e=>({x:e,y:e}),bt={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function xt(e,t,n){return V(e,_t(t,n))}function U(e,t){return typeof e==`function`?e(t):e}function St(e){return e.split(`-`)[0]}function Ct(e){return e.split(`-`)[1]}function wt(e){return e===`x`?`y`:`x`}function Tt(e){return e===`y`?`height`:`width`}function W(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Et(e){return wt(W(e))}function Dt(e,t,n){n===void 0&&(n=!1);let r=Ct(e),i=Et(e),a=Tt(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=It(o)),[o,It(o)]}function Ot(e){let t=It(e);return[kt(e),t,kt(t)]}function kt(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var At=[`left`,`right`],jt=[`right`,`left`],Mt=[`top`,`bottom`],Nt=[`bottom`,`top`];function Pt(e,t,n){switch(e){case`top`:case`bottom`:return n?t?jt:At:t?At:jt;case`left`:case`right`:return t?Mt:Nt;default:return[]}}function Ft(e,t,n,r){let i=Ct(e),a=Pt(St(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(kt)))),a}function It(e){let t=St(e);return bt[t]+e.slice(t.length)}function Lt(e){return{top:0,right:0,bottom:0,left:0,...e}}function Rt(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Lt(e)}function zt(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Bt(e,t,n){let{reference:r,floating:i}=e,a=W(t),o=Et(t),s=Tt(o),c=St(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Ct(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Vt(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=U(t,e),p=Rt(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=zt(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=zt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Ht=50,Ut=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Vt},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Bt(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Ht&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Bt(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Wt=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=U(e,t)||{};if(l==null)return{};let d=Rt(u),f={x:n,y:r},p=Et(i),m=Tt(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=_t(d[_],T),D=_t(d[v],T),ee=E,O=C-h[m]-D,k=C/2-h[m]/2+w,A=xt(ee,k,O),j=!c.arrow&&Ct(i)!=null&&k!==A&&a.reference[m]/2-(k<ee?E:D)-h[m]/2<0,M=j?k<ee?k-ee:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Gt=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=U(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=St(r),_=W(o),v=St(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[It(o)]:Ot(o)),x=p!==`none`;!d&&x&&b.push(...Ft(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Dt(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==W(t))||T.every(e=>W(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=W(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Kt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function qt(e){return gt.some(t=>e[t]>=0)}var Jt=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=U(e,t);switch(i){case`referenceHidden`:{let e=Kt(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:qt(e)}}}case`escaped`:{let e=Kt(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:qt(e)}}}default:return{}}}}},Yt=new Set([`left`,`top`]);async function Xt(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=St(n),s=Ct(n),c=W(n)===`y`,l=Yt.has(o)?-1:1,u=a&&c?-1:1,d=U(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Zt=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Xt(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Qt=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=U(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=W(St(i)),p=wt(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=xt(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=xt(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},$t=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=U(e,t),u={x:n,y:r},d=W(i),f=wt(d),p=u[f],m=u[d],h=U(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Yt.has(St(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},en=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=U(e,t),u=await o.detectOverflow(t,l),d=St(i),f=Ct(i),p=W(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=_t(h-u[g],v),x=_t(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=V(u.left,0),t=V(u.right,0),n=V(u.top,0),r=V(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:V(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:V(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function tn(){return typeof window<`u`}function nn(e){return rn(e)?(e.nodeName||``).toLowerCase():`#document`}function G(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function K(e){return((rn(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function rn(e){return tn()?e instanceof Node||e instanceof G(e).Node:!1}function q(e){return tn()?e instanceof Element||e instanceof G(e).Element:!1}function J(e){return tn()?e instanceof HTMLElement||e instanceof G(e).HTMLElement:!1}function an(e){return!tn()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof G(e).ShadowRoot}function on(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Y(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function sn(e){return/^(table|td|th)$/.test(nn(e))}function cn(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ln=/transform|translate|scale|rotate|perspective|filter/,un=/paint|layout|strict|content/,dn=e=>!!e&&e!==`none`,fn;function pn(e){let t=q(e)?Y(e):e;return dn(t.transform)||dn(t.translate)||dn(t.scale)||dn(t.rotate)||dn(t.perspective)||!hn()&&(dn(t.backdropFilter)||dn(t.filter))||ln.test(t.willChange||``)||un.test(t.contain||``)}function mn(e){let t=vn(e);for(;J(t)&&!gn(t);){if(pn(t))return t;if(cn(t))return null;t=vn(t)}return null}function hn(){return fn??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),fn}function gn(e){return/^(html|body|#document)$/.test(nn(e))}function Y(e){return G(e).getComputedStyle(e)}function _n(e){return q(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function vn(e){if(nn(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||an(e)&&e.host||K(e);return an(t)?t.host:t}function yn(e){let t=vn(e);return gn(t)?e.ownerDocument?e.ownerDocument.body:e.body:J(t)&&on(t)?t:yn(t)}function bn(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=yn(e),i=r===e.ownerDocument?.body,a=G(r);if(i){let e=xn(a);return t.concat(a,a.visualViewport||[],on(r)?r:[],e&&n?bn(e):[])}else return t.concat(r,bn(r,[],n))}function xn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Sn(e){let t=Y(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=J(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=vt(n)!==a||vt(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Cn(e){return q(e)?e:e.contextElement}function wn(e){let t=Cn(e);if(!J(t))return H(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Sn(t),o=(a?vt(n.width):n.width)/r,s=(a?vt(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Tn=H(0);function En(e){let t=G(e);return!hn()||!t.visualViewport?Tn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Dn(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==G(e)?!1:t}function On(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Cn(e),o=H(1);t&&(r?q(r)&&(o=wn(r)):o=wn(e));let s=Dn(a,n,r)?En(a):H(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=G(a),t=r&&q(r)?G(r):r,n=e,i=xn(n);for(;i&&r&&t!==n;){let e=wn(i),t=i.getBoundingClientRect(),r=Y(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=G(i),i=xn(n)}}return zt({width:u,height:d,x:c,y:l})}function kn(e,t){let n=_n(e).scrollLeft;return t?t.left+n:On(K(e)).left+n}function An(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-kn(e,n),y:n.top+t.scrollTop}}function jn(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=K(r),s=t?cn(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=H(1),u=H(0),d=J(r);if((d||!d&&!a)&&((nn(r)!==`body`||on(o))&&(c=_n(r)),d)){let e=On(r);l=wn(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?An(o,c):H(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Mn(e){return Array.from(e.getClientRects())}function Nn(e){let t=K(e),n=_n(e),r=e.ownerDocument.body,i=V(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=V(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+kn(e),s=-n.scrollTop;return Y(r).direction===`rtl`&&(o+=V(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Pn=25;function Fn(e,t){let n=G(e),r=K(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=hn();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=kn(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Pn&&(a-=o)}else l<=Pn&&(a+=l);return{width:a,height:o,x:s,y:c}}function In(e,t){let n=On(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=J(e)?wn(e):H(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ln(e,t,n){let r;if(t===`viewport`)r=Fn(e,n);else if(t===`document`)r=Nn(K(e));else if(q(t))r=In(t,n);else{let n=En(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return zt(r)}function Rn(e,t){let n=vn(e);return n===t||!q(n)||gn(n)?!1:Y(n).position===`fixed`||Rn(n,t)}function zn(e,t){let n=t.get(e);if(n)return n;let r=bn(e,[],!1).filter(e=>q(e)&&nn(e)!==`body`),i=null,a=Y(e).position===`fixed`,o=a?vn(e):e;for(;q(o)&&!gn(o);){let t=Y(o),n=pn(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||on(o)&&!n&&Rn(e,o))?r=r.filter(e=>e!==o):i=t,o=vn(o)}return t.set(e,r),r}function Bn(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?cn(t)?[]:zn(t,this._c):[].concat(n),r],o=Ln(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Ln(t,a[e],i);s=V(n.top,s),c=_t(n.right,c),l=_t(n.bottom,l),u=V(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Vn(e){let{width:t,height:n}=Sn(e);return{width:t,height:n}}function Hn(e,t,n){let r=J(t),i=K(t),a=n===`fixed`,o=On(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=H(0);function l(){c.x=kn(i)}if(r||!r&&!a)if((nn(t)!==`body`||on(i))&&(s=_n(t)),r){let e=On(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?An(i,s):H(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Un(e){return Y(e).position===`static`}function Wn(e,t){if(!J(e)||Y(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return K(e)===n&&(n=n.ownerDocument.body),n}function Gn(e,t){let n=G(e);if(cn(e))return n;if(!J(e)){let t=vn(e);for(;t&&!gn(t);){if(q(t)&&!Un(t))return t;t=vn(t)}return n}let r=Wn(e,t);for(;r&&sn(r)&&Un(r);)r=Wn(r,t);return r&&gn(r)&&Un(r)&&!pn(r)?n:r||mn(e)||n}var Kn=async function(e){let t=this.getOffsetParent||Gn,n=this.getDimensions,r=await n(e.floating);return{reference:Hn(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function qn(e){return Y(e).direction===`rtl`}var Jn={convertOffsetParentRelativeRectToViewportRelativeRect:jn,getDocumentElement:K,getClippingRect:Bn,getOffsetParent:Gn,getElementRects:Kn,getClientRects:Mn,getDimensions:Vn,getScale:wn,isElement:q,isRTL:qn};function Yn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Xn(e,t){let n=null,r,i=K(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=yt(d),h=yt(i.clientWidth-(u+f)),g=yt(i.clientHeight-(d+p)),_=yt(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:V(0,_t(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Yn(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Zn(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Cn(e),u=i||a?[...l?bn(l):[],...t?bn(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Xn(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?On(e):null;c&&g();function g(){let t=On(e);h&&!Yn(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Qn=Zt,$n=Qt,er=Gt,tr=en,nr=Jt,rr=Wt,ir=$t,ar=(e,t,n)=>{let r=new Map,i={platform:Jn,...n},a={...i.platform,_c:r};return Ut(e,t,{...i,platform:a})},or=typeof document<`u`?R.useLayoutEffect:function(){};function sr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!sr(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!sr(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function cr(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function lr(e,t){let n=cr(e);return Math.round(t*n)/n}function ur(e){let t=R.useRef(e);return or(()=>{t.current=e}),t}function dr(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=R.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=R.useState(r);sr(f,r)||p(r);let[m,h]=R.useState(null),[g,_]=R.useState(null),v=R.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=R.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=R.useRef(null),C=R.useRef(null),w=R.useRef(u),T=c!=null,E=ur(c),D=ur(i),ee=ur(l),O=R.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),ar(S.current,C.current,e).then(e=>{let t={...e,isPositioned:ee.current!==!1};k.current&&!sr(w.current,t)&&(w.current=t,qe.flushSync(()=>{d(t)}))})},[f,t,n,D,ee]);or(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let k=R.useRef(!1);or(()=>(k.current=!0,()=>{k.current=!1}),[]),or(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,O);O()}},[b,x,O,E,T]);let A=R.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),j=R.useMemo(()=>({reference:b,floating:x}),[b,x]),M=R.useMemo(()=>{let e={position:n,left:0,top:0};if(!j.floating)return e;let t=lr(j.floating,u.x),r=lr(j.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...cr(j.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,j.floating,u.x,u.y]);return R.useMemo(()=>({...u,update:O,refs:A,elements:j,floatingStyles:M}),[u,O,A,j,M])}var fr=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:rr({element:r.current,padding:i}).fn(n):r?rr({element:r,padding:i}).fn(n):{}}}},pr=(e,t)=>{let n=Qn(e);return{name:n.name,fn:n.fn,options:[e,t]}},mr=(e,t)=>{let n=$n(e);return{name:n.name,fn:n.fn,options:[e,t]}},hr=(e,t)=>({fn:ir(e).fn,options:[e,t]}),gr=(e,t)=>{let n=er(e);return{name:n.name,fn:n.fn,options:[e,t]}},_r=(e,t)=>{let n=tr(e);return{name:n.name,fn:n.fn,options:[e,t]}},vr=(e,t)=>{let n=nr(e);return{name:n.name,fn:n.fn,options:[e,t]}},yr=(e,t)=>{let n=fr(e);return{name:n.name,fn:n.fn,options:[e,t]}},br=`Arrow`,xr=R.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,L.jsx)(N.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,L.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});xr.displayName=br;var Sr=xr,Cr=`Popper`,[wr,Tr]=oe(Cr),[Er,Dr]=wr(Cr),Or=e=>{let{__scopePopper:t,children:n}=e,[r,i]=R.useState(null);return(0,L.jsx)(Er,{scope:t,anchor:r,onAnchorChange:i,children:n})};Or.displayName=Cr;var kr=`PopperAnchor`,Ar=R.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Dr(kr,n),o=R.useRef(null),s=F(t,o),c=R.useRef(null);return R.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,L.jsx)(N.div,{...i,ref:s})});Ar.displayName=kr;var jr=`PopperContent`,[Mr,Nr]=wr(jr),Pr=R.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Dr(jr,n),[_,v]=R.useState(null),y=F(t,e=>v(e)),[b,x]=R.useState(null),S=ht(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],ee=D.length>0,O={padding:E,boundary:D.filter(Rr),altBoundary:ee},{refs:k,floatingStyles:A,placement:j,isPositioned:M,middlewareData:te}=dr({strategy:`fixed`,placement:T,whileElementsMounted:(...e)=>Zn(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[pr({mainAxis:i+w,alignmentAxis:o}),c&&mr({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?hr():void 0,...O}),c&&gr({...O}),_r({...O,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),b&&yr({element:b,padding:s}),zr({arrowWidth:C,arrowHeight:w}),f&&vr({strategy:`referenceHidden`,...O})]}),[P,ne]=Br(j),re=ie(m);se(()=>{M&&re?.()},[M,re]);let ae=te.arrow?.x,oe=te.arrow?.y,ce=te.arrow?.centerOffset!==0,[I,le]=R.useState();return se(()=>{_&&le(window.getComputedStyle(_).zIndex)},[_]),(0,L.jsx)(`div`,{ref:k.setFloating,"data-radix-popper-content-wrapper":``,style:{...A,transform:M?A.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:I,"--radix-popper-transform-origin":[te.transformOrigin?.x,te.transformOrigin?.y].join(` `),...te.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,L.jsx)(Mr,{scope:n,placedSide:P,onArrowChange:x,arrowX:ae,arrowY:oe,shouldHideArrow:ce,children:(0,L.jsx)(N.div,{"data-side":P,"data-align":ne,...h,ref:y,style:{...h.style,animation:M?void 0:`none`}})})})});Pr.displayName=jr;var Fr=`PopperArrow`,Ir={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Lr=R.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Nr(Fr,n),a=Ir[i.placedSide];return(0,L.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,L.jsx)(Sr,{...r,ref:t,style:{...r.style,display:`block`}})})});Lr.displayName=Fr;function Rr(e){return e!==null}var zr=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Br(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function Br(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Vr=Or,Hr=Ar,Ur=Pr,Wr=Lr,Gr=`rovingFocusGroup.onEntryFocus`,Kr={bubbles:!1,cancelable:!0},qr=`RovingFocusGroup`,[Jr,Yr,Xr]=Qe(qr),[Zr,Qr]=oe(qr,[Xr]),[$r,ei]=Zr(qr),ti=R.forwardRef((e,t)=>(0,L.jsx)(Jr.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,L.jsx)(Jr.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,L.jsx)(ni,{...e,ref:t})})}));ti.displayName=qr;var ni=R.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=R.useRef(null),p=F(t,f),m=pt(a),[h,g]=P({prop:o,defaultProp:s??null,onChange:c,caller:qr}),[_,v]=R.useState(!1),y=ie(l),b=Yr(n),x=R.useRef(!1),[S,C]=R.useState(0);return R.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Gr,y),()=>e.removeEventListener(Gr,y)},[y]),(0,L.jsx)($r,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:R.useCallback(e=>g(e),[g]),onItemShiftTab:R.useCallback(()=>v(!0),[]),onFocusableItemAdd:R.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:R.useCallback(()=>C(e=>e-1),[]),children:(0,L.jsx)(N.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:D(e.onMouseDown,()=>{x.current=!0}),onFocus:D(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(Gr,Kr);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);ci([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:D(e.onBlur,()=>v(!1))})})}),ri=`RovingFocusGroupItem`,ii=R.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=k(),l=a||c,u=ei(ri,n),d=u.currentTabStopId===l,f=Yr(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return R.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,L.jsx)(Jr.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,L.jsx)(N.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:D(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:D(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:D(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=si(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?li(n,r+1):n.slice(r+1)}setTimeout(()=>ci(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});ii.displayName=ri;var ai={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function oi(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function si(e,t,n){let r=oi(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return ai[r]}function ci(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function li(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ui=ti,di=ii,fi=[`Enter`,` `],pi=[`ArrowDown`,`PageUp`,`Home`],mi=[`ArrowUp`,`PageDown`,`End`],hi=[...pi,...mi],gi={ltr:[...fi,`ArrowRight`],rtl:[...fi,`ArrowLeft`]},_i={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},vi=`Menu`,[yi,bi,xi]=Qe(vi),[Si,Ci]=oe(vi,[xi,Tr,Qr]),wi=Tr(),Ti=Qr(),[Ei,Di]=Si(vi),[Oi,ki]=Si(vi),Ai=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=wi(t),[c,l]=R.useState(null),u=R.useRef(!1),d=ie(a),f=pt(i);return R.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,L.jsx)(Vr,{...s,children:(0,L.jsx)(Ei,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,L.jsx)(Oi,{scope:t,onClose:R.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};Ai.displayName=vi;var ji=`MenuAnchor`,Mi=R.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=wi(n);return(0,L.jsx)(Hr,{...i,...r,ref:t})});Mi.displayName=ji;var Ni=`MenuPortal`,[Pi,Fi]=Si(Ni,{forceMount:void 0}),Ii=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Di(Ni,t);return(0,L.jsx)(Pi,{scope:t,forceMount:n,children:(0,L.jsx)(O,{present:n||a.open,children:(0,L.jsx)(re,{asChild:!0,container:i,children:r})})})};Ii.displayName=Ni;var X=`MenuContent`,[Li,Ri]=Si(X),zi=R.forwardRef((e,t)=>{let n=Fi(X,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Di(X,e.__scopeMenu),o=ki(X,e.__scopeMenu);return(0,L.jsx)(yi.Provider,{scope:e.__scopeMenu,children:(0,L.jsx)(O,{present:r||a.open,children:(0,L.jsx)(yi.Slot,{scope:e.__scopeMenu,children:o.modal?(0,L.jsx)(Bi,{...i,ref:t}):(0,L.jsx)(Vi,{...i,ref:t})})})})}),Bi=R.forwardRef((e,t)=>{let n=Di(X,e.__scopeMenu),r=R.useRef(null),i=F(t,r);return R.useEffect(()=>{let e=r.current;if(e)return de(e)},[]),(0,L.jsx)(Ui,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:D(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Vi=R.forwardRef((e,t)=>{let n=Di(X,e.__scopeMenu);return(0,L.jsx)(Ui,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Hi=A(`MenuContent.ScrollLock`),Ui=R.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=Di(X,n),_=ki(X,n),v=wi(n),y=Ti(n),b=bi(n),[x,S]=R.useState(null),C=R.useRef(null),w=F(t,C,g.onContentChange),T=R.useRef(0),E=R.useRef(``),O=R.useRef(0),k=R.useRef(null),A=R.useRef(`right`),j=R.useRef(0),M=m?ae:R.Fragment,N=m?{as:Hi,allowPinchZoom:!0}:void 0,te=e=>{let t=E.current+e,n=b().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=Da(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){E.current=t,window.clearTimeout(T.current),t!==``&&(T.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};R.useEffect(()=>()=>window.clearTimeout(T.current),[]),ue();let P=R.useCallback(e=>A.current===k.current?.side&&ka(e,k.current?.area),[]);return(0,L.jsx)(Li,{scope:n,searchRef:E,onItemEnter:R.useCallback(e=>{P(e)&&e.preventDefault()},[P]),onItemLeave:R.useCallback(e=>{P(e)||(C.current?.focus(),S(null))},[P]),onTriggerLeave:R.useCallback(e=>{P(e)&&e.preventDefault()},[P]),pointerGraceTimerRef:O,onPointerGraceIntentChange:R.useCallback(e=>{k.current=e},[]),children:(0,L.jsx)(M,{...N,children:(0,L.jsx)(ee,{asChild:!0,trapped:i,onMountAutoFocus:D(a,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,L.jsx)(le,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,L.jsx)(ui,{asChild:!0,...y,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:x,onCurrentTabStopIdChange:S,onEntryFocus:D(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,L.jsx)(Ur,{role:`menu`,"aria-orientation":`vertical`,"data-state":Sa(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:w,style:{outline:`none`,...h.style},onKeyDown:D(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&te(e.key));let i=C.current;if(e.target!==i||!hi.includes(e.key))return;e.preventDefault();let a=b().filter(e=>!e.disabled).map(e=>e.ref.current);mi.includes(e.key)&&a.reverse(),Ta(a)}),onBlur:D(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(T.current),E.current=``)}),onPointerMove:D(e.onPointerMove,Aa(e=>{let t=e.target,n=j.current!==e.clientX;e.currentTarget.contains(t)&&n&&(A.current=e.clientX>j.current?`right`:`left`,j.current=e.clientX)}))})})})})})})});zi.displayName=X;var Wi=`MenuGroup`,Gi=R.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,L.jsx)(N.div,{role:`group`,...r,ref:t})});Gi.displayName=Wi;var Ki=`MenuLabel`,qi=R.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,L.jsx)(N.div,{...r,ref:t})});qi.displayName=Ki;var Ji=`MenuItem`,Yi=`menu.itemSelect`,Xi=R.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=R.useRef(null),o=ki(Ji,e.__scopeMenu),s=Ri(Ji,e.__scopeMenu),c=F(t,a),l=R.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Yi,{bubbles:!0,cancelable:!0});e.addEventListener(Yi,e=>r?.(e),{once:!0}),te(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,L.jsx)(Zi,{...i,ref:c,disabled:n,onClick:D(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:D(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:D(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||fi.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});Xi.displayName=Ji;var Zi=R.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=Ri(Ji,n),s=Ti(n),c=R.useRef(null),l=F(t,c),[u,d]=R.useState(!1),[f,p]=R.useState(``);return R.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,L.jsx)(yi.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,L.jsx)(di,{asChild:!0,...s,focusable:!r,children:(0,L.jsx)(N.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:D(e.onPointerMove,Aa(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:D(e.onPointerLeave,Aa(e=>o.onItemLeave(e))),onFocus:D(e.onFocus,()=>d(!0)),onBlur:D(e.onBlur,()=>d(!1))})})})}),Qi=`MenuCheckboxItem`,$i=R.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,L.jsx)(sa,{scope:e.__scopeMenu,checked:n,children:(0,L.jsx)(Xi,{role:`menuitemcheckbox`,"aria-checked":Ca(n)?`mixed`:n,...i,ref:t,"data-state":wa(n),onSelect:D(i.onSelect,()=>r?.(Ca(n)?!0:!n),{checkForDefaultPrevented:!1})})})});$i.displayName=Qi;var ea=`MenuRadioGroup`,[ta,na]=Si(ea,{value:void 0,onValueChange:()=>{}}),ra=R.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=ie(r);return(0,L.jsx)(ta,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,L.jsx)(Gi,{...i,ref:t})})});ra.displayName=ea;var ia=`MenuRadioItem`,aa=R.forwardRef((e,t)=>{let{value:n,...r}=e,i=na(ia,e.__scopeMenu),a=n===i.value;return(0,L.jsx)(sa,{scope:e.__scopeMenu,checked:a,children:(0,L.jsx)(Xi,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":wa(a),onSelect:D(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});aa.displayName=ia;var oa=`MenuItemIndicator`,[sa,ca]=Si(oa,{checked:!1}),la=R.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=ca(oa,n);return(0,L.jsx)(O,{present:r||Ca(a.checked)||a.checked===!0,children:(0,L.jsx)(N.span,{...i,ref:t,"data-state":wa(a.checked)})})});la.displayName=oa;var ua=`MenuSeparator`,da=R.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,L.jsx)(N.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});da.displayName=ua;var fa=`MenuArrow`,pa=R.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=wi(n);return(0,L.jsx)(Wr,{...i,...r,ref:t})});pa.displayName=fa;var ma=`MenuSub`,[ha,ga]=Si(ma),_a=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=Di(ma,t),o=wi(t),[s,c]=R.useState(null),[l,u]=R.useState(null),d=ie(i);return R.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,L.jsx)(Vr,{...o,children:(0,L.jsx)(Ei,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,L.jsx)(ha,{scope:t,contentId:k(),triggerId:k(),trigger:s,onTriggerChange:c,children:n})})})};_a.displayName=ma;var va=`MenuSubTrigger`,ya=R.forwardRef((e,t)=>{let n=Di(va,e.__scopeMenu),r=ki(va,e.__scopeMenu),i=ga(va,e.__scopeMenu),a=Ri(va,e.__scopeMenu),o=R.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=R.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return R.useEffect(()=>u,[u]),R.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,L.jsx)(Mi,{asChild:!0,...l,children:(0,L.jsx)(Zi,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":Sa(n.open),...e,ref:M(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:D(e.onPointerMove,Aa(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:D(e.onPointerLeave,Aa(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:D(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||gi[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});ya.displayName=va;var ba=`MenuSubContent`,xa=R.forwardRef((e,t)=>{let n=Fi(X,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Di(X,e.__scopeMenu),o=ki(X,e.__scopeMenu),s=ga(ba,e.__scopeMenu),c=R.useRef(null),l=F(t,c);return(0,L.jsx)(yi.Provider,{scope:e.__scopeMenu,children:(0,L.jsx)(O,{present:r||a.open,children:(0,L.jsx)(yi.Slot,{scope:e.__scopeMenu,children:(0,L.jsx)(Ui,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:l,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:D(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:D(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:D(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=_i[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});xa.displayName=ba;function Sa(e){return e?`open`:`closed`}function Ca(e){return e===`indeterminate`}function wa(e){return Ca(e)?`indeterminate`:e?`checked`:`unchecked`}function Ta(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Ea(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Da(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Ea(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Oa(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function ka(e,t){return t?Oa({x:e.clientX,y:e.clientY},t):!1}function Aa(e){return t=>t.pointerType===`mouse`?e(t):void 0}var ja=Ai,Ma=Mi,Na=Ii,Pa=zi,Fa=Gi,Ia=qi,La=Xi,Ra=$i,za=ra,Ba=aa,Va=la,Ha=da,Ua=pa,Wa=ya,Ga=xa,Ka=`DropdownMenu`,[qa,Ja]=oe(Ka,[Ci]),Z=Ci(),[Ya,Xa]=qa(Ka),Za=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=Z(t),l=R.useRef(null),[u,d]=P({prop:i,defaultProp:a??!1,onChange:o,caller:Ka});return(0,L.jsx)(Ya,{scope:t,triggerId:k(),triggerRef:l,contentId:k(),open:u,onOpenChange:d,onOpenToggle:R.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,L.jsx)(ja,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};Za.displayName=Ka;var Qa=`DropdownMenuTrigger`,$a=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Xa(Qa,n),o=Z(n);return(0,L.jsx)(Ma,{asChild:!0,...o,children:(0,L.jsx)(N.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:M(t,a.triggerRef),onPointerDown:D(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:D(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});$a.displayName=Qa;var eo=`DropdownMenuPortal`,to=e=>{let{__scopeDropdownMenu:t,...n}=e,r=Z(t);return(0,L.jsx)(Na,{...r,...n})};to.displayName=eo;var no=`DropdownMenuContent`,ro=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Xa(no,n),a=Z(n),o=R.useRef(!1);return(0,L.jsx)(Pa,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:D(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:D(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});ro.displayName=no;var io=`DropdownMenuGroup`,ao=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,L.jsx)(Fa,{...i,...r,ref:t})});ao.displayName=io;var oo=`DropdownMenuLabel`,so=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,L.jsx)(Ia,{...i,...r,ref:t})});so.displayName=oo;var co=`DropdownMenuItem`,lo=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,L.jsx)(La,{...i,...r,ref:t})});lo.displayName=co;var uo=`DropdownMenuCheckboxItem`,fo=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,L.jsx)(Ra,{...i,...r,ref:t})});fo.displayName=uo;var po=`DropdownMenuRadioGroup`,mo=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,L.jsx)(za,{...i,...r,ref:t})});mo.displayName=po;var ho=`DropdownMenuRadioItem`,go=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,L.jsx)(Ba,{...i,...r,ref:t})});go.displayName=ho;var _o=`DropdownMenuItemIndicator`,vo=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,L.jsx)(Va,{...i,...r,ref:t})});vo.displayName=_o;var yo=`DropdownMenuSeparator`,bo=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,L.jsx)(Ha,{...i,...r,ref:t})});bo.displayName=yo;var xo=`DropdownMenuArrow`,So=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,L.jsx)(Ua,{...i,...r,ref:t})});So.displayName=xo;var Co=`DropdownMenuSubTrigger`,wo=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,L.jsx)(Wa,{...i,...r,ref:t})});wo.displayName=Co;var To=`DropdownMenuSubContent`,Eo=R.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,L.jsx)(Ga,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Eo.displayName=To;var Do=Za,Oo=$a,ko=to,Ao=ro,jo=so,Mo=lo,No=fo,Po=vo,Fo=bo,Io=`Separator`,Lo=`horizontal`,Ro=[`horizontal`,`vertical`],zo=R.forwardRef((e,t)=>{let{decorative:n,orientation:r=Lo,...i}=e,a=Bo(r)?r:Lo,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,L.jsx)(N.div,{"data-orientation":a,...o,...i,ref:t})});zo.displayName=Io;function Bo(e){return Ro.includes(e)}var Vo=zo,[Ho,Uo]=oe(`Tooltip`,[Tr]),Wo=Tr(),Go=`TooltipProvider`,Ko=700,qo=`tooltip.open`,[Jo,Yo]=Ho(Go),Xo=e=>{let{__scopeTooltip:t,delayDuration:n=Ko,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=R.useRef(!0),s=R.useRef(!1),c=R.useRef(0);return R.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,L.jsx)(Jo,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:R.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:R.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:R.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};Xo.displayName=Go;var Zo=`Tooltip`,[Qo,$o]=Ho(Zo),es=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=Yo(Zo,e.__scopeTooltip),l=Wo(t),[u,d]=R.useState(null),f=k(),p=R.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=R.useRef(!1),[_,v]=P({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(qo))):c.onClose(),a?.(e)},caller:Zo}),y=R.useMemo(()=>_?g.current?`delayed-open`:`instant-open`:`closed`,[_]),b=R.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,v(!0)},[v]),x=R.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v(!1)},[v]),S=R.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,v(!0),p.current=0},h)},[h,v]);return R.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,L.jsx)(Vr,{...l,children:(0,L.jsx)(Qo,{scope:t,contentId:f,open:_,stateAttribute:y,trigger:u,onTriggerChange:d,onTriggerEnter:R.useCallback(()=>{c.isOpenDelayedRef.current?S():b()},[c.isOpenDelayedRef,S,b]),onTriggerLeave:R.useCallback(()=>{m?x():(window.clearTimeout(p.current),p.current=0)},[x,m]),onOpen:b,onClose:x,disableHoverableContent:m,children:n})})};es.displayName=Zo;var ts=`TooltipTrigger`,ns=R.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=$o(ts,n),a=Yo(ts,n),o=Wo(n),s=F(t,R.useRef(null),i.onTriggerChange),c=R.useRef(!1),l=R.useRef(!1),u=R.useCallback(()=>c.current=!1,[]);return R.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,L.jsx)(Hr,{asChild:!0,...o,children:(0,L.jsx)(N.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:D(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:D(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:D(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:D(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:D(e.onBlur,i.onClose),onClick:D(e.onClick,i.onClose)})})});ns.displayName=ts;var rs=`TooltipPortal`,[is,as]=Ho(rs,{forceMount:void 0}),os=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=$o(rs,t);return(0,L.jsx)(is,{scope:t,forceMount:n,children:(0,L.jsx)(O,{present:n||a.open,children:(0,L.jsx)(re,{asChild:!0,container:i,children:r})})})};os.displayName=rs;var ss=`TooltipContent`,cs=R.forwardRef((e,t)=>{let n=as(ss,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=$o(ss,e.__scopeTooltip);return(0,L.jsx)(O,{present:r||o.open,children:o.disableHoverableContent?(0,L.jsx)(ps,{side:i,...a,ref:t}):(0,L.jsx)(ls,{side:i,...a,ref:t})})}),ls=R.forwardRef((e,t)=>{let n=$o(ss,e.__scopeTooltip),r=Yo(ss,e.__scopeTooltip),i=R.useRef(null),a=F(t,i),[o,s]=R.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=R.useCallback(()=>{s(null),d(!1)},[d]),p=R.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=_s(r,gs(r,n.getBoundingClientRect())),a=vs(t.getBoundingClientRect());s(bs([...i,...a])),d(!0)},[d]);return R.useEffect(()=>()=>f(),[f]),R.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),R.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!ys(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,L.jsx)(ps,{...e,ref:a})}),[us,ds]=Ho(Zo,{isInside:!1}),fs=j(`TooltipContent`),ps=R.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=$o(ss,n),l=Wo(n),{onClose:u}=c;return R.useEffect(()=>(document.addEventListener(qo,u),()=>document.removeEventListener(qo,u)),[u]),R.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,L.jsx)(le,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,L.jsxs)(Ur,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,L.jsx)(fs,{children:r}),(0,L.jsx)(us,{scope:n,isInside:!0,children:(0,L.jsx)(Ze,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});cs.displayName=ss;var ms=`TooltipArrow`,hs=R.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=Wo(n);return ds(ms,n).isInside?null:(0,L.jsx)(Wr,{...i,...r,ref:t})});hs.displayName=ms;function gs(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function _s(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function vs(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function ys(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function bs(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),xs(t)}function xs(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Ss=Xo,Cs=es,ws=ns,Ts=os,Es=cs,Ds=hs,Q=e(),Os={promptTokens:0,completionTokens:0,totalTokens:0},ks=x((e,t)=>({currentSession:null,setCurrentSession:t=>e({currentSession:t}),clearActiveSession:()=>e({currentSession:null}),sessions:[],setSessions:t=>e(e=>({sessions:typeof t==`function`?t(e.sessions):t})),addSessionToFront:t=>e(e=>({sessions:[t,...e.sessions]})),updateSession:t=>e(e=>({sessions:e.sessions.map(e=>e.id===t.id?t:e)})),removeSessionById:t=>e(e=>({sessions:e.sessions.filter(e=>e.id!==t)})),clearSessions:()=>e({sessions:[]}),sessionUsage:{...Os},currentModel:`gpt-4o`,selectedVariant:null,compactionSuccess:!1,setSessionUsage:t=>e({sessionUsage:t}),setCurrentModel:t=>e({currentModel:t}),setSelectedVariant:t=>e({selectedVariant:t}),setCompactionSuccess:t=>e({compactionSuccess:t}),clearChatSession:()=>e({sessionUsage:{...Os},currentModel:`gpt-4o`,selectedVariant:null,compactionSuccess:!1}),messagesBySession:{},partsBySession:{},setMessagesBySession:t=>e(e=>({messagesBySession:typeof t==`function`?t(e.messagesBySession):t})),setPartsBySession:t=>e(e=>({partsBySession:typeof t==`function`?t(e.partsBySession):t})),getMessagesBySessionKeysCount:()=>Object.keys(t().messagesBySession).length,queuedMessages:{},clearQueuedMessages:()=>e({queuedMessages:{}}),setQueuedMessagesForSession:(t,n)=>e(e=>({queuedMessages:{...e.queuedMessages,[t]:n}})),addQueuedMessage:(t,n)=>e(e=>({queuedMessages:{...e.queuedMessages,[t]:[...e.queuedMessages[t]||[],n]}})),removeQueuedMessageById:(t,n)=>e(e=>({queuedMessages:{...e.queuedMessages,[t]:(e.queuedMessages[t]||[]).filter(e=>e.id!==n)}})),removeQueuedMessagesByIds:(t,n)=>e(e=>({queuedMessages:{...e.queuedMessages,[t]:(e.queuedMessages[t]||[]).filter(e=>!n.includes(e.id))}})),navigationIntent:{mode:`follow`},setNavigationIntent:t=>e({navigationIntent:t}),clearTargetMessageIntent:()=>e(e=>({navigationIntent:e.navigationIntent.mode===`target-message`?{mode:`free`}:e.navigationIntent}))}));function As(){let e=ks.getState();e.clearSessions(),e.clearActiveSession(),e.clearChatSession(),e.clearQueuedMessages(),e.setMessagesBySession({}),e.setPartsBySession({}),e.setNavigationIntent({mode:`follow`})}var js=(0,R.createContext)(null),Ms=()=>{let e=(0,R.useContext)(js);if(e===null)throw Error(`useViewRefs must be used within a ViewRefsProvider`);return e},Ns=(0,R.createContext)(null);function Ps(){let e=(0,R.useContext)(Ns);if(!e)throw Error(`useSessionManager must be used within a SessionManagerContext.Provider`);return e}var Fs=x((e,t)=>({pendingRequests:[],handlers:new Map,timedOutRequestIds:new Set,addPendingRequest:t=>e(e=>t.ask.type===`permission`&&t.requestId&&e.timedOutRequestIds.has(t.requestId)?e:{pendingRequests:[...t.ask.type===`permission`&&t.requestId?e.pendingRequests.filter(e=>!(e.ask.type===`permission`&&e.requestId===t.requestId)):e.pendingRequests.filter(e=>e.toolCallId!==t.toolCallId),t]}),removePendingRequest:t=>e(e=>({pendingRequests:e.pendingRequests.filter(e=>e.toolCallId!==t)})),removePendingPermissionRequest:(t,n)=>e(e=>{let r=new Set(e.timedOutRequestIds);r.add(t);let i=e.pendingRequests.findIndex(e=>e.ask.type===`permission`&&e.requestId===t);return i===-1?n?{timedOutRequestIds:r,pendingRequests:e.pendingRequests.filter(e=>e.toolCallId!==n)}:{timedOutRequestIds:r}:{timedOutRequestIds:r,pendingRequests:e.pendingRequests.filter((e,t)=>t!==i)}}),replacePendingPermissionRequests:t=>e(e=>{let n=e.pendingRequests.filter(e=>e.ask.type!==`permission`);return{timedOutRequestIds:new Set,pendingRequests:[...n,...t]}}),clearPendingRequests:()=>e({pendingRequests:[],timedOutRequestIds:new Set}),clearPendingRequestsBySessionId:t=>e(e=>({pendingRequests:e.pendingRequests.filter(e=>e.sessionId!==t&&e.originSessionId!==t)})),registerHandler:(t,n)=>{e(e=>{let r=new Map(e.handlers),i=r.get(t)??[];return r.set(t,[...i,n]),{handlers:r}})},unregisterHandler:(t,n)=>{e(e=>{let r=new Map(e.handlers),i=r.get(t);return i&&r.set(t,i.filter(e=>e!==n)),{handlers:r}})},getHandlers:e=>t().handlers.get(e)??[]})),Is=`jean2_sound_chat_finish_enabled`,Ls=`jean2_sound_permission_enabled`,Rs=`jean2_expanded_toolbar`,zs=(e,t)=>{if(typeof window>`u`)return t;let n=localStorage.getItem(e);return n===null?t:n===`true`},Bs=`jean2_auto_approve_severity`;function Vs(){if(typeof window>`u`)return{};try{let e=localStorage.getItem(Bs);return e?JSON.parse(e):{}}catch{return{}}}function Hs(e){typeof window<`u`&&localStorage.setItem(Bs,JSON.stringify(e))}var Us=x(e=>({showSettings:!1,showConfiguration:!1,showTools:!1,showMCPDialog:!1,showWorkspacePermissions:!1,setShowSettings:t=>e({showSettings:t}),setShowConfiguration:t=>e({showConfiguration:t}),setShowTools:t=>e({showTools:t}),setShowMCPDialog:t=>e({showMCPDialog:t}),setShowWorkspacePermissions:t=>e({showWorkspacePermissions:t}),chatFinishSoundEnabled:zs(Is,!0),permissionSoundEnabled:zs(Ls,!0),setChatFinishSoundEnabled:t=>{typeof window<`u`&&localStorage.setItem(Is,String(t)),e({chatFinishSoundEnabled:t})},setPermissionSoundEnabled:t=>{typeof window<`u`&&localStorage.setItem(Ls,String(t)),e({permissionSoundEnabled:t})},expandedToolbar:zs(Rs,!1),setExpandedToolbar:t=>{typeof window<`u`&&localStorage.setItem(Rs,String(t)),e({expandedToolbar:t})},filePreviewTarget:null,openFilePreview:t=>e({filePreviewTarget:t}),closeFilePreview:()=>e({filePreviewTarget:null}),autoApproveBySession:Vs(),setAutoApproveMaxSeverity:(t,n)=>e(e=>{let r={...e.autoApproveBySession};return r[t]=n,Hs(r),{autoApproveBySession:r}}),getAutoApproveMaxSeverity:e=>Us.getState().autoApproveBySession[e]??null})),Ws=x(e=>({connected:!1,authError:null,connectionTimedOut:!1,retryCount:0,nextRetryIn:0,streamingSessionIds:new Set,interruptedSessions:new Set,setConnected:t=>e({connected:t}),setAuthError:t=>e({authError:t}),setConnectionTimedOut:t=>e({connectionTimedOut:t}),setRetryCount:t=>e(e=>({retryCount:typeof t==`function`?t(e.retryCount):t})),setNextRetryIn:t=>e(e=>({nextRetryIn:typeof t==`function`?t(e.nextRetryIn):t})),resetConnection:()=>e({connected:!1,authError:null,connectionTimedOut:!1,retryCount:0,nextRetryIn:0,streamingSessionIds:new Set,interruptedSessions:new Set}),clearStreamingSessions:()=>e({streamingSessionIds:new Set}),addStreamingSession:t=>e(e=>{if(e.streamingSessionIds.has(t))return e;let n=new Set(e.streamingSessionIds);return n.add(t),{streamingSessionIds:n}}),removeStreamingSession:t=>e(e=>{if(!e.streamingSessionIds.has(t))return e;let n=new Set(e.streamingSessionIds);return n.delete(t),{streamingSessionIds:n}}),replaceStreamingSessions:t=>e({streamingSessionIds:t instanceof Set?t:new Set(t)}),addInterruptedSession:t=>e(e=>{if(e.interruptedSessions.has(t))return e;let n=new Set(e.interruptedSessions);return n.add(t),{interruptedSessions:n}}),removeInterruptedSession:t=>e(e=>{if(!e.interruptedSessions.has(t))return e;let n=new Set(e.interruptedSessions);return n.delete(t),{interruptedSessions:n}}),clearInterruptedSessions:()=>e({interruptedSessions:new Set})})),$={sessions:{all:[`sessions`],byWorkspace:e=>[`sessions`,`workspace`,e],grouped:(e,t)=>[`sessions`,`grouped`,{workspaceIds:[...e].sort(),status:t}],tags:e=>[`sessions`,`tags`,e]},tools:{all:[`tools`],envVars:[`tools`,`envVars`]},config:{models:[`config`,`models`],preconfigs:[`config`,`preconfigs`],prompts:[`config`,`prompts`],providers:{all:[`providers`],credentials:[`providers`,`credentials`]},responseFormats:[`config`,`responseFormats`]},mcp:{status:e=>[`mcp`,`status`,e]},files:{browse:(e,t,n)=>[`files`,`browse`,e,t??`.`,n],browseFs:e=>[`files`,`browseFs`,e],drives:[`files`,`drives`],parent:e=>[`files`,`parent`,e],preview:(e,t)=>[`files`,`preview`,e,t],gitDiff:(e,t)=>[`files`,`git-diff`,e,t]},serverInfo:[`serverInfo`],pinnedMessages:{byWorkspace:e=>[`pinnedMessages`,`workspace`,e]}};function Gs(){return c.id===`electron`?`electron`:c.id===`vscode`||c.id===`web`?`web`:`unknown`}function Ks(){return c.id===`electron`}function qs(){return typeof navigator>`u`?!1:/Win/i.test(navigator.platform||navigator.userAgent)}function Js(e){return!!(e.startsWith(`/`)||e.length>=3&&/^[A-Za-z]:[/\\]/.test(e))}function Ys(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return t>=0?e.slice(t+1):e}var Xs=640,Zs=1280;function Qs(){let e=(0,Q.c)(2),[t,n]=R.useState($s),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=window.matchMedia(`(max-width: ${Xs-1}px)`),t=()=>{n(window.innerWidth<Xs)};return e.addEventListener(`change`,t),n(window.innerWidth<Xs),()=>e.removeEventListener(`change`,t)},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),R.useEffect(r,i),t}function $s(){return typeof window<`u`?window.innerWidth<Xs:!1}function ec(){let e=(0,Q.c)(2),[t,n]=R.useState(tc),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=window.matchMedia(`(max-width: ${Zs-1}px)`),t=()=>{n(window.innerWidth<Zs)};return e.addEventListener(`change`,t),n(window.innerWidth<Zs),()=>e.removeEventListener(`change`,t)},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),R.useEffect(r,i),t}function tc(){return typeof window<`u`?window.innerWidth<Zs:!1}function nc(e){let t=(0,Q.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,type:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=I(`h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==a||t[8]!==i?(o=(0,L.jsx)(`input`,{type:i,"data-slot":`input`,className:a,...r}),t[6]=r,t[7]=a,t[8]=i,t[9]=o):o=t[9],o}function rc(e){let t=(0,Q.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,orientation:i,decorative:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`horizontal`:i,s=a===void 0?!0:a,c;t[5]===n?c=t[6]:(c=I(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,n),t[5]=n,t[6]=c);let l;return t[7]!==s||t[8]!==o||t[9]!==r||t[10]!==c?(l=(0,L.jsx)(Vo,{"data-slot":`separator`,decorative:s,orientation:o,className:c,...r}),t[7]=s,t[8]=o,t[9]=r,t[10]=c,t[11]=l):l=t[11],l}function ic(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=I(`animate-pulse rounded-md bg-muted`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,L.jsx)(`div`,{"data-slot":`skeleton`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ac(e){let t=(0,Q.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({delayDuration:r,...n}=e,t[0]=e,t[1]=n,t[2]=r);let i=r===void 0?0:r,a;return t[3]!==i||t[4]!==n?(a=(0,L.jsx)(Ss,{"data-slot":`tooltip-provider`,delayDuration:i,...n}),t[3]=i,t[4]=n,t[5]=a):a=t[5],a}function oc(e){let t=(0,Q.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,L.jsx)(Cs,{"data-slot":`tooltip`,...n}),t[2]=n,t[3]=r),r}function sc(e){let t=(0,Q.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,L.jsx)(ws,{"data-slot":`tooltip-trigger`,...n}),t[2]=n,t[3]=r),r}function cc(e){let t=(0,Q.c)(16),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:r,sideOffset:a,showArrow:o,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=a===void 0?0:a,c=o===void 0?!0:o,l;t[6]===r?l=t[7]:(l=I(`z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,r),t[6]=r,t[7]=l);let u;t[8]===c?u=t[9]:(u=c&&(0,L.jsx)(Ds,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`}),t[8]=c,t[9]=u);let d;return t[10]!==n||t[11]!==i||t[12]!==s||t[13]!==l||t[14]!==u?(d=(0,L.jsx)(Ts,{children:(0,L.jsxs)(Es,{"data-slot":`tooltip-content`,sideOffset:s,className:l,...i,children:[n,u]})}),t[10]=n,t[11]=i,t[12]=s,t[13]=l,t[14]=u,t[15]=d):d=t[15],d}function lc(e){let t=(0,Q.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,L.jsx)(Do,{"data-slot":`dropdown-menu`,...n}),t[2]=n,t[3]=r),r}function uc(e){let t=(0,Q.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,L.jsx)(Oo,{"data-slot":`dropdown-menu-trigger`,...n}),t[2]=n,t[3]=r),r}function dc(e){let t=(0,Q.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,align:i,sideOffset:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`start`:i,s=a===void 0?4:a,c;t[5]===n?c=t[6]:(c=I(`z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:overflow-hidden data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,n),t[5]=n,t[6]=c);let l;return t[7]!==o||t[8]!==r||t[9]!==s||t[10]!==c?(l=(0,L.jsx)(ko,{children:(0,L.jsx)(Ao,{"data-slot":`dropdown-menu-content`,sideOffset:s,align:o,className:c,...r})}),t[7]=o,t[8]=r,t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function fc(e){let t=(0,Q.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,inset:r,variant:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s;t[5]===n?s=t[6]:(s=I(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,n),t[5]=n,t[6]=s);let c;return t[7]!==r||t[8]!==i||t[9]!==s||t[10]!==o?(c=(0,L.jsx)(Mo,{"data-slot":`dropdown-menu-item`,"data-inset":r,"data-variant":o,className:s,...i}),t[7]=r,t[8]=i,t[9]=s,t[10]=o,t[11]=c):c=t[11],c}function pc(e){let t=(0,Q.c)(15),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:i,children:r,checked:n,inset:a,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s;t[6]===i?s=t[7]:(s=I(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,i),t[6]=i,t[7]=s);let c;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,L.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-checkbox-item-indicator`,children:(0,L.jsx)(Po,{children:(0,L.jsx)(Re,{})})}),t[8]=c):c=t[8];let l;return t[9]!==n||t[10]!==r||t[11]!==a||t[12]!==o||t[13]!==s?(l=(0,L.jsxs)(No,{"data-slot":`dropdown-menu-checkbox-item`,"data-inset":a,className:s,checked:n,...o,children:[c,r]}),t[9]=n,t[10]=r,t[11]=a,t[12]=o,t[13]=s,t[14]=l):l=t[14],l}function mc(e){let t=(0,Q.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,inset:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=I(`px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==i||t[8]!==a?(o=(0,L.jsx)(jo,{"data-slot":`dropdown-menu-label`,"data-inset":r,className:a,...i}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9],o}function hc(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=I(`-mx-1 my-1 h-px bg-border`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,L.jsx)(Fo,{"data-slot":`dropdown-menu-separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function gc(e){let t=(0,Q.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,L.jsx)(dt,{"data-slot":`collapsible`,...n}),t[2]=n,t[3]=r),r}function _c(e){let t=(0,Q.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,L.jsx)(ot,{"data-slot":`collapsible-trigger`,...n}),t[2]=n,t[3]=r),r}function vc(e){let t=(0,Q.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,L.jsx)(ct,{"data-slot":`collapsible-content`,...n}),t[2]=n,t[3]=r),r}function yc(e){let t=(0,Q.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.tools.list(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:$.tools.all,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],z(i)}function bc(e){let t=(0,Q.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.tools.listEnvVars(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:$.tools.envVars,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],z(i)}function xc(e){let t=(0,Q.c)(7),n=p(),r;t[0]===e?r=t[1]:(r=t=>{let{key:n,value:r}=t;return e.http.tools.setEnvVar(n,{value:r})},t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:$.tools.envVars})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],B(a)}function Sc(e){let t=(0,Q.c)(7),n=p(),r;t[0]===e?r=t[1]:(r=t=>e.http.tools.clearEnvVar(t),t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:$.tools.envVars})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],B(a)}function Cc(e){let t=(0,Q.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.config.models.get(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:$.config.models,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],z(i)}async function wc(e,t){let n=await e.http.config.models.get(),r=n.providers.flatMap(e=>e.models).filter(e=>e.runtimeStatus?.usable);w.getState().updateModels(r,n.defaultModel,n.defaultProvider),t.setQueryData($.config.models,n)}function Tc(e){let t=(0,Q.c)(8),n=p(),r;t[0]===e?r=t[1]:(r=t=>e.http.config.models.createProvider(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&wc(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],B(a)}function Ec(e){let t=(0,Q.c)(8),n=p(),r;t[0]===e?r=t[1]:(r=t=>{let{providerId:n,body:r}=t;return e.http.config.models.updateProvider(n,r)},t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&wc(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],B(a)}function Dc(e){let t=(0,Q.c)(8),n=p(),r;t[0]===e?r=t[1]:(r=t=>e.http.config.models.deleteProvider(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&wc(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],B(a)}function Oc(e){let t=(0,Q.c)(8),n=p(),r;t[0]===e?r=t[1]:(r=t=>{let{providerId:n,body:r}=t;return e.http.config.models.createModel(n,r)},t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&wc(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],B(a)}function kc(e){let t=(0,Q.c)(8),n=p(),r;t[0]===e?r=t[1]:(r=t=>{let{providerId:n,modelId:r,body:i}=t;return e.http.config.models.updateModel(n,r,i)},t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&wc(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],B(a)}function Ac(e){let t=(0,Q.c)(8),n=p(),r;t[0]===e?r=t[1]:(r=t=>{let{providerId:n,modelId:r}=t;return e.http.config.models.deleteModel(n,r)},t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&wc(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],B(a)}function jc(e){let t=(0,Q.c)(8),n=p(),r;t[0]===e?r=t[1]:(r=t=>e.http.config.models.setDefaults(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&wc(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],B(a)}function Mc(e){let t=(0,Q.c)(8),n=p(),r;t[0]===e?r=t[1]:(r=t=>e.http.config.models.sync(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&wc(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],B(a)}function Nc(e){let t=(0,Q.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.preconfigs.list(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:$.config.preconfigs,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],z(i)}async function Pc(e,t){let n=await e.http.preconfigs.list();w.getState().updatePreconfigs(n.preconfigs),t.setQueryData($.config.preconfigs,n)}function Fc(e){let t=(0,Q.c)(8),n=p(),r;t[0]===e?r=t[1]:(r=t=>e.http.preconfigs.create(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Pc(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],B(a)}function Ic(e){let t=(0,Q.c)(8),n=p(),r;t[0]===e?r=t[1]:(r=t=>{let{id:n,body:r}=t;return e.http.preconfigs.update(n,r)},t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Pc(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],B(a)}function Lc(e){let t=(0,Q.c)(8),n=p(),r;t[0]===e?r=t[1]:(r=t=>e.http.preconfigs.delete(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Pc(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],B(a)}function Rc(e){let t=(0,Q.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.config.prompts.list(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:$.config.prompts,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],z(i)}async function zc(e,t){let n=await e.http.config.prompts.list();w.getState().updatePrompts(n.prompts),t.setQueryData($.config.prompts,n)}function Bc(e){let t=(0,Q.c)(8),n=p(),r;t[0]===e?r=t[1]:(r=t=>e.http.config.prompts.create(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&zc(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],B(a)}function Vc(e){let t=(0,Q.c)(8),n=p(),r;t[0]===e?r=t[1]:(r=t=>{let{name:n,body:r}=t;return e.http.config.prompts.update(n,r)},t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&zc(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],B(a)}function Hc(e){let t=(0,Q.c)(8),n=p(),r;t[0]===e?r=t[1]:(r=t=>e.http.config.prompts.delete(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&zc(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],B(a)}function Uc(e){let t=(0,Q.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.providers.list(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:$.config.providers.all,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],z(i)}function Wc(e){let t=(0,Q.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.providers.listCredentials(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:$.config.providers.credentials,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],z(i)}function Gc(e){let t=(0,Q.c)(7),n=p(),r;t[0]===e?r=t[1]:(r=t=>e.http.providers.connect(t),t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:$.config.providers.all})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],B(a)}function Kc(e){let t=(0,Q.c)(7),n=p(),r;t[0]===e?r=t[1]:(r=t=>e.http.providers.disconnect(t),t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:$.config.providers.all})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],B(a)}function qc(e){let t=(0,Q.c)(7),n=p(),r;t[0]===e?r=t[1]:(r=t=>{let{provider:n,body:r}=t;return e.http.providers.setCredential(n,r)},t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:$.config.providers.credentials})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],B(a)}function Jc(e){let t=(0,Q.c)(7),n=p(),r;t[0]===e?r=t[1]:(r=t=>e.http.providers.clearCredential(t),t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:$.config.providers.credentials})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],B(a)}function Yc(e,t){let n=(0,Q.c)(9),r;n[0]===t?r=n[1]:(r=$.mcp.status(t??``),n[0]=t,n[1]=r);let i;n[2]!==e||n[3]!==t?(i=()=>e.http.mcp.getStatus(t),n[2]=e,n[3]=t,n[4]=i):i=n[4];let a=!!e&&!!t,o;return n[5]!==r||n[6]!==i||n[7]!==a?(o={queryKey:r,queryFn:i,enabled:a},n[5]=r,n[6]=i,n[7]=a,n[8]=o):o=n[8],z(o)}function Xc(e){let t=(0,Q.c)(7),n=p(),r;t[0]===e?r=t[1]:(r=t=>{let{workspaceId:n,name:r}=t;return e.http.mcp.connect(n,r)},t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=(e,t)=>{let{workspaceId:r}=t;n.invalidateQueries({queryKey:$.mcp.status(r)})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],B(a)}function Zc(e){let t=(0,Q.c)(7),n=p(),r;t[0]===e?r=t[1]:(r=t=>{let{workspaceId:n,name:r}=t;return e.http.mcp.disconnect(n,r)},t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=(e,t)=>{let{workspaceId:r}=t;n.invalidateQueries({queryKey:$.mcp.status(r)})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],B(a)}function Qc(e){let t=(0,Q.c)(2),n;return t[0]===e?n=t[1]:(n={mutationFn:t=>{let{workspaceId:n,name:r}=t;return e.http.mcp.startAuth(n,r)}},t[0]=e,t[1]=n),B(n)}function $c(e,t,n,r,i){let a=(0,Q.c)(13),o;a[0]!==r||a[1]!==n||a[2]!==t?(o=$.files.browse(t??``,n,r),a[0]=r,a[1]=n,a[2]=t,a[3]=o):o=a[3];let s;a[4]!==r||a[5]!==n||a[6]!==e||a[7]!==t?(s=()=>e.http.files.browse(t,n,r),a[4]=r,a[5]=n,a[6]=e,a[7]=t,a[8]=s):s=a[8];let c=!!e&&!!t&&(i??!0),l;return a[9]!==o||a[10]!==s||a[11]!==c?(l={queryKey:o,queryFn:s,enabled:c,staleTime:0},a[9]=o,a[10]=s,a[11]=c,a[12]=l):l=a[12],z(l)}function el(e,t,n){let r=(0,Q.c)(9),i=n===void 0?!0:n,a;r[0]===t?a=r[1]:(a=$.files.browseFs(t),r[0]=t,r[1]=a);let o;r[2]!==t||r[3]!==e?(o=()=>e.http.files.browseFs(t),r[2]=t,r[3]=e,r[4]=o):o=r[4];let s=!!e&&i,c;return r[5]!==a||r[6]!==o||r[7]!==s?(c={queryKey:a,queryFn:o,enabled:s},r[5]=a,r[6]=o,r[7]=s,r[8]=c):c=r[8],z(c)}function tl(e){let t=(0,Q.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.files.drives(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:$.files.drives,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],z(i)}function nl(e,t,n){let r=(0,Q.c)(9),i=n===void 0?!0:n,a;r[0]===t?a=r[1]:(a=$.files.parent(t),r[0]=t,r[1]=a);let o;r[2]!==t||r[3]!==e?(o=()=>e.http.files.parent(t),r[2]=t,r[3]=e,r[4]=o):o=r[4];let s=!!e&&i,c;return r[5]!==a||r[6]!==o||r[7]!==s?(c={queryKey:a,queryFn:o,enabled:s},r[5]=a,r[6]=o,r[7]=s,r[8]=c):c=r[8],z(c)}function rl(e,t,n,r){let i=(0,Q.c)(11),a=r===void 0?!0:r,o;i[0]!==n||i[1]!==t?(o=$.files.preview(t??``,n??``),i[0]=n,i[1]=t,i[2]=o):o=i[2];let s;i[3]!==n||i[4]!==e||i[5]!==t?(s=()=>e.http.files.preview(t,n),i[3]=n,i[4]=e,i[5]=t,i[6]=s):s=i[6];let c=!!e&&!!t&&!!n&&a,l;return i[7]!==o||i[8]!==s||i[9]!==c?(l={queryKey:o,queryFn:s,enabled:c,staleTime:0},i[7]=o,i[8]=s,i[9]=c,i[10]=l):l=i[10],z(l)}function il(e,t,n,r){let i=(0,Q.c)(11),a=r===void 0?!0:r,o;i[0]!==n||i[1]!==t?(o=$.files.gitDiff(t??``,n??``),i[0]=n,i[1]=t,i[2]=o):o=i[2];let s;i[3]!==n||i[4]!==e||i[5]!==t?(s=()=>e.http.files.gitDiff(t,n),i[3]=n,i[4]=e,i[5]=t,i[6]=s):s=i[6];let c=!!e&&!!t&&!!n&&a,l;return i[7]!==o||i[8]!==s||i[9]!==c?(l={queryKey:o,queryFn:s,enabled:c,staleTime:0},i[7]=o,i[8]=s,i[9]=c,i[10]=l):l=i[10],z(l)}function al(e){let t=(0,Q.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.responseFormats.list(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:$.config.responseFormats,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],z(i)}function ol(e){let t=(0,Q.c)(7),n=p(),r;t[0]===e?r=t[1]:(r=t=>e.http.responseFormats.create(t),t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:$.config.responseFormats})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],B(a)}function sl(e){let t=(0,Q.c)(7),n=p(),r;t[0]===e?r=t[1]:(r=t=>{let{id:n,body:r}=t;return e.http.responseFormats.update(n,r)},t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:$.config.responseFormats})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],B(a)}function cl(e){let t=(0,Q.c)(7),n=p(),r;t[0]===e?r=t[1]:(r=t=>e.http.responseFormats.delete(t),t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:$.config.responseFormats})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],B(a)}function ll(e,t){let n=(0,Q.c)(9),r;n[0]===t?r=n[1]:(r=t?$.pinnedMessages.byWorkspace(t):[`pinnedMessages`,`workspace`,`none`],n[0]=t,n[1]=r);let i=!!e&&!!t,a;n[2]!==e||n[3]!==t?(a=async()=>{if(!e||!t)throw Error(`Not connected`);return(await e.http.workspaces.listPinnedMessages(t)).pinnedMessages},n[2]=e,n[3]=t,n[4]=a):a=n[4];let o;return n[5]!==r||n[6]!==i||n[7]!==a?(o={queryKey:r,enabled:i,queryFn:a},n[5]=r,n[6]=i,n[7]=a,n[8]=o):o=n[8],z(o)}function ul(e,t){let n=(0,Q.c)(9),r=p(),i;n[0]!==e||n[1]!==t?(i=async n=>{if(!e||!t)throw Error(`Not connected`);return e.http.workspaces.pinMessage(t,n)},n[0]=e,n[1]=t,n[2]=i):i=n[2];let a;n[3]!==r||n[4]!==t?(a=()=>{t&&r.invalidateQueries({queryKey:$.pinnedMessages.byWorkspace(t)})},n[3]=r,n[4]=t,n[5]=a):a=n[5];let o;return n[6]!==i||n[7]!==a?(o={mutationFn:i,onSuccess:a},n[6]=i,n[7]=a,n[8]=o):o=n[8],B(o)}function dl(e,t){let n=(0,Q.c)(9),r=p(),i;n[0]!==e||n[1]!==t?(i=async n=>{let{messageId:r}=n;if(!e||!t)throw Error(`Not connected`);return e.http.workspaces.unpinMessage(t,r)},n[0]=e,n[1]=t,n[2]=i):i=n[2];let a;n[3]!==r||n[4]!==t?(a=()=>{t&&r.invalidateQueries({queryKey:$.pinnedMessages.byWorkspace(t)})},n[3]=r,n[4]=t,n[5]=a):a=n[5];let o;return n[6]!==i||n[7]!==a?(o={mutationFn:i,onSuccess:a},n[6]=i,n[7]=a,n[8]=o):o=n[8],B(o)}function fl(e,t){let n=(0,Q.c)(9),r;n[0]===t?r=n[1]:(r=$.sessions.tags(t??``),n[0]=t,n[1]=r);let i;n[2]!==e||n[3]!==t?(i=()=>e.http.sessions.listTags(t),n[2]=e,n[3]=t,n[4]=i):i=n[4];let a=!!e&&!!t,o;return n[5]!==r||n[6]!==i||n[7]!==a?(o={queryKey:r,queryFn:i,enabled:a},n[5]=r,n[6]=i,n[7]=a,n[8]=o):o=n[8],z(o)}function pl(){let e=(0,Q.c)(2),t=p(),n;return e[0]===t?n=e[1]:(n=e=>{t.invalidateQueries({queryKey:$.sessions.tags(e)})},e[0]=t,e[1]=n),n}var ml=ce(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function hl(e){let t=(0,Q.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,variant:i,asChild:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`default`:i,s=a!==void 0&&a?ne:`span`,c;t[5]!==n||t[6]!==o?(c=I(ml({variant:o}),n),t[5]=n,t[6]=o,t[7]=c):c=t[7];let l;return t[8]!==s||t[9]!==r||t[10]!==c||t[11]!==o?(l=(0,L.jsx)(s,{"data-slot":`badge`,"data-variant":o,className:c,...r}),t[8]=s,t[9]=r,t[10]=c,t[11]=o,t[12]=l):l=t[12],l}export{dc as $,Ne as $t,Vc as A,Qr as At,jc as B,Je as Bt,Kc as C,Ps as Ct,Bc as D,ks as Dt,qc as E,As as Et,Oc as F,Tr as Ft,bc as G,He as Gt,kc as H,Ge as Ht,Tc as I,ht as It,gc as J,ze as Jt,xc as K,Ve as Kt,Ac as L,mt as Lt,Lc as M,Wr as Mt,Nc as N,Ur as Nt,Hc as O,di as Ot,Ic as P,Vr as Pt,pc as Q,Pe as Qt,Dc as R,pt as Rt,Gc as S,Ns as St,Uc as T,Ms as Tt,Ec as U,We as Ut,Mc as V,Ke as Vt,Sc as W,Ue as Wt,_c as X,Fe as Xt,vc as Y,Re as Yt,lc as Z,Ie as Zt,Xc as _,Ys as _t,ll as a,cc as at,Yc as b,Us as bt,cl as c,ic as ct,el as d,ec as dt,Le as en,fc as et,$c as f,Qs as ft,rl as g,qs as gt,nl as h,Ks as ht,ul as i,oc as it,Fc as j,Hr as jt,Rc as k,ui as kt,al as l,rc as lt,il as m,Js as mt,pl as n,hc as nt,dl as o,ac as ot,tl as p,Gs as pt,yc as q,Be as qt,fl as r,uc as rt,ol as s,sc as st,hl as t,z as tn,mc as tt,sl as u,nc as ut,Zc as v,$ as vt,Wc as w,js as wt,Jc as x,Fs as xt,Qc as y,Ws as yt,Cc as z,Qe as zt};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./jsx-runtime-CoWo_Ex4.js";import{A as n,D as r,b as i,c as a,d as o,g as s,h as c,i as l,j as u,m as d,o as f,u as p,v as m,w as h,x as g,y as _}from"./serverDataStore-CvTJtC_B.js";import{a as v}from"./Match-BqRw2YHq.js";var y=class extends u{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new f({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=b(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=b(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=b(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=b(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){o.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>m(t,e))}findAll(e={}){return this.getAll().filter(t=>m(e,t))}notify(e){o.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return o.batch(()=>Promise.all(e.map(e=>e.continue().catch(i))))}};function b(e){return e.options.scope?.id}var x=class extends u{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??s(r,t),o=this.get(i);return o||(o=new a({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){o.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>_(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>_(e,t)):t}notify(e){o.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){o.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){o.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},S=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new x,this.#t=e.mutationCache||new y,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=n.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=p.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(h(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=d(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return o.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;o.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return o.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=o.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(i).catch(i)}invalidateQueries(e,t={}){return o.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=o.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(i)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(i)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(h(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(i).catch(i)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(i).catch(i)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return p.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(c(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{g(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(c(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{g(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=s(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===r&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},C=e(),w=t(),T=new S({defaultOptions:{queries:{staleTime:3e4,gcTime:5*6e4,retry:2,refetchOnWindowFocus:!1}}});function E(e){let t=(0,C.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,w.jsx)(l,{client:T,children:n}),t[0]=n,t[1]=r),r}function D(e){return v({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}var O=class{constructor(e){this.http=e}async list(e){return this.http.get(`/sessions`,{params:e?.status?{status:e.status}:void 0,signal:e?.signal})}async create(e){let{signal:t,...n}=e??{};return this.http.post(`/sessions`,n,{signal:t})}async get(e,t){return this.http.get(`/sessions/${encodeURIComponent(e)}`,{signal:t?.signal})}async update(e,t,n){return this.http.put(`/sessions/${encodeURIComponent(e)}`,t,{signal:n?.signal})}async delete(e,t){return this.http.delete(`/sessions/${encodeURIComponent(e)}`,{signal:t?.signal})}async listMessages(e,t){return this.http.get(`/sessions/${encodeURIComponent(e)}/messages`,{signal:t?.signal})}async listGrouped(e){let t={workspaceIds:e.workspaceIds.join(`,`)};return e.status&&(t.status=e.status),e.rootOnly&&(t.rootOnly=`true`),this.http.get(`/sessions/grouped`,{params:t,signal:e.signal})}async listByWorkspace(e){let t={};return e.status&&(t.status=e.status),e.rootOnly&&(t.rootOnly=`true`),this.http.get(`/workspaces/${encodeURIComponent(e.workspaceId)}/sessions`,{params:t,signal:e.signal})}async listTags(e,t){return this.http.get(`/sessions/tags`,{params:{workspaceId:e},signal:t?.signal})}},k=class{constructor(e){this.http=e}async list(e){return this.http.get(`/workspaces`,{signal:e?.signal})}async create(e){let{signal:t,...n}=e??{};return this.http.post(`/workspaces`,n,{signal:t})}async get(e,t){return this.http.get(`/workspaces/${encodeURIComponent(e)}`,{signal:t?.signal})}async update(e,t,n){return this.http.patch(`/workspaces/${encodeURIComponent(e)}`,t,{signal:n?.signal})}async delete(e,t){return this.http.delete(`/workspaces/${encodeURIComponent(e)}`,{signal:t?.signal})}async listSessions(e,t){return this.http.get(`/workspaces/${encodeURIComponent(e)}/sessions`,{signal:t?.signal})}async listPinnedMessages(e,t){return this.http.get(`/workspaces/${encodeURIComponent(e)}/pinned-messages`,{signal:t?.signal})}async pinMessage(e,t,n){return this.http.post(`/workspaces/${encodeURIComponent(e)}/pinned-messages`,t,{signal:n?.signal})}async unpinMessage(e,t,n){return this.http.delete(`/workspaces/${encodeURIComponent(e)}/pinned-messages/${encodeURIComponent(t)}`,{signal:n?.signal})}},A=class{constructor(e){this.http=e}async list(e){return this.http.get(`/models`,{signal:e?.signal})}},j=class{constructor(e){this.http=e}async list(e){return this.http.get(`/tools`,{signal:e?.signal})}async get(e,t){return this.http.get(`/tools/${encodeURIComponent(e)}`,{signal:t?.signal})}async listEnvVars(e){return this.http.get(`/tools/env`,{signal:e?.signal})}async setEnvVar(e,t,n){return this.http.put(`/tools/env/${encodeURIComponent(e)}`,t,{signal:n?.signal})}async clearEnvVar(e,t){return this.http.delete(`/tools/env/${encodeURIComponent(e)}`,{signal:t?.signal})}},M=class{constructor(e){this.http=e}async list(e){return this.http.get(`/providers`,{signal:e?.signal})}async getStatus(e,t){return this.http.get(`/providers/${encodeURIComponent(e)}/status`,{signal:t?.signal})}async connect(e,t){return this.http.post(`/providers/${encodeURIComponent(e)}/connect`,void 0,{signal:t?.signal})}async disconnect(e,t){return this.http.delete(`/providers/${encodeURIComponent(e)}`,{signal:t?.signal})}async listCredentials(e){return this.http.get(`/config/providers`,{signal:e?.signal})}async setCredential(e,t,n){return this.http.put(`/config/providers/${encodeURIComponent(e)}`,t,{signal:n?.signal})}async clearCredential(e,t){return this.http.delete(`/config/providers/${encodeURIComponent(e)}`,{signal:t?.signal})}},N=class{constructor(e){this.http=e}async list(e){return this.http.get(`/preconfigs`,{signal:e?.signal})}async create(e){let{signal:t,...n}=e??{};return this.http.post(`/preconfigs`,n,{signal:t})}async get(e,t){return this.http.get(`/preconfigs/${encodeURIComponent(e)}`,{signal:t?.signal})}async update(e,t,n){return this.http.put(`/preconfigs/${encodeURIComponent(e)}`,t,{signal:n?.signal})}async delete(e,t){return this.http.delete(`/preconfigs/${encodeURIComponent(e)}`,{signal:t?.signal})}},P=class{constructor(e){this.http=e}async list(e){return this.http.get(`/prompts`,{signal:e?.signal})}},F=class{constructor(e){this.http=e}async browse(e,t,n){let r={};return t!==void 0&&(r.path=t),n?.showHidden!==void 0&&(r.showHidden=String(n.showHidden)),n?.limit!==void 0&&(r.limit=String(n.limit)),this.http.get(`/workspaces/${encodeURIComponent(e)}/files`,{params:Object.keys(r).length>0?r:void 0,signal:n?.signal})}async search(e,t,n){let r={search:t};return n?.limit!==void 0&&(r.limit=String(n.limit)),n?.showHidden!==void 0&&(r.showHidden=String(n.showHidden)),this.http.get(`/workspaces/${encodeURIComponent(e)}/files`,{params:r,signal:n?.signal})}async preview(e,t,n){return this.http.get(`/workspaces/${encodeURIComponent(e)}/file-preview`,{params:{path:t},signal:n?.signal})}async browseFs(e,t){return this.http.get(`/fs/browse`,{params:e===void 0?void 0:{path:e},signal:t?.signal})}async parent(e,t){return this.http.get(`/fs/parent`,{params:{path:e},signal:t?.signal})}async drives(e){return this.http.get(`/fs/drives`,{signal:e?.signal})}},I=class{constructor(e){this.http=e}async list(e,t){return this.http.get(`/sessions/${encodeURIComponent(e)}/attachments`,{signal:t?.signal})}async upload(e,t,n){let r=new FormData;r.append(`file`,t);let{signal:i}=n??{};return this.http.post(`/sessions/${encodeURIComponent(e)}/attachments`,r,{signal:i})}getUrl(e,t,n){return`/api/sessions/${encodeURIComponent(e)}/attachments/${encodeURIComponent(t)}/content?key=${encodeURIComponent(n)}`}},L=class{constructor(e){this.http=e}async list(e,t){return this.http.get(`/workspaces/${encodeURIComponent(e)}/terminals`,{signal:t?.signal})}async create(e,t){let{signal:n,body:r}=t??{};return this.http.post(`/workspaces/${encodeURIComponent(e)}/terminals`,r??{},{signal:n})}async get(e,t,n){return this.http.get(`/workspaces/${encodeURIComponent(e)}/terminals/${encodeURIComponent(t)}`,{signal:n?.signal})}async delete(e,t,n){return this.http.delete(`/workspaces/${encodeURIComponent(e)}/terminals/${encodeURIComponent(t)}`,{signal:n?.signal})}},R=class{constructor(e){this.http=e}async getStatus(e,t){return this.http.get(`/workspaces/${encodeURIComponent(e)}/mcp/status`,{signal:t?.signal})}async connect(e,t,n){let{signal:r}=n??{};return this.http.post(`/workspaces/${encodeURIComponent(e)}/mcp/connect`,{name:t},{signal:r})}async disconnect(e,t,n){let{signal:r}=n??{};return this.http.post(`/workspaces/${encodeURIComponent(e)}/mcp/disconnect`,{name:t},{signal:r})}async startAuth(e,t,n){let{signal:r}=n??{};return this.http.post(`/workspaces/${encodeURIComponent(e)}/mcp/auth`,{name:t},{signal:r})}async finishAuth(e,t,n,r){let{signal:i}=r??{};return this.http.post(`/workspaces/${encodeURIComponent(e)}/mcp/auth/callback`,{name:t,code:n},{signal:i})}},z=class{constructor(e){this.http=e}async get(e){return this.http.get(`/config/models`,{signal:e?.signal})}async createProvider(e,t){return this.http.post(`/config/models/providers`,e,{signal:t?.signal})}async updateProvider(e,t,n){return this.http.put(`/config/models/providers/${encodeURIComponent(e)}`,t,{signal:n?.signal})}async deleteProvider(e,t){return this.http.delete(`/config/models/providers/${encodeURIComponent(e)}`,{signal:t?.signal})}async createModel(e,t,n){return this.http.post(`/config/models/providers/${encodeURIComponent(e)}/models`,t,{signal:n?.signal})}async updateModel(e,t,n,r){return this.http.put(`/config/models/providers/${encodeURIComponent(e)}/models/${encodeURIComponent(t)}`,n,{signal:r?.signal})}async deleteModel(e,t,n){return this.http.delete(`/config/models/providers/${encodeURIComponent(e)}/models/${encodeURIComponent(t)}`,{signal:n?.signal})}async setDefaults(e,t){return this.http.put(`/config/models/defaults`,e,{signal:t?.signal})}async sync(e=`merge`,t){return this.http.post(`/config/models/sync`,{mode:e},{signal:t?.signal})}},B=class{constructor(e){this.http=e}async list(e){return this.http.get(`/config/prompts`,{signal:e?.signal})}async get(e,t){return this.http.get(`/config/prompts/${encodeURIComponent(e)}`,{signal:t?.signal})}async create(e,t){return this.http.post(`/config/prompts`,e,{signal:t?.signal})}async update(e,t,n){return this.http.put(`/config/prompts/${encodeURIComponent(e)}`,t,{signal:n?.signal})}async delete(e,t){return this.http.delete(`/config/prompts/${encodeURIComponent(e)}`,{signal:t?.signal})}},V=class{models;prompts;constructor(e){this.models=new z(e),this.prompts=new B(e)}},H=class{constructor(e){this.http=e}async list(e){return this.http.get(`/response-formats`,{signal:e?.signal})}async get(e,t){return this.http.get(`/response-formats/${encodeURIComponent(e)}`,{signal:t?.signal})}async create(e){return this.http.post(`/response-formats`,e)}async update(e,t){return this.http.put(`/response-formats/${encodeURIComponent(e)}`,t)}async delete(e){return this.http.delete(`/response-formats/${encodeURIComponent(e)}`)}},U=class{sessions;workspaces;models;tools;providers;preconfigs;prompts;files;attachments;terminals;mcp;config;responseFormats;constructor(e){this.sessions=new O(e),this.workspaces=new k(e),this.models=new A(e),this.tools=new j(e),this.providers=new M(e),this.preconfigs=new N(e),this.prompts=new P(e),this.files=new F(e),this.attachments=new I(e),this.terminals=new L(e),this.mcp=new R(e),this.config=new V(e),this.responseFormats=new H(e)}async loadAll(e){let[t,n,r,i,a]=await Promise.all([this.workspaces.list(e),this.preconfigs.list(e),this.prompts.list(e),this.models.list(e),this.providers.list(e)]);return{workspaces:t.workspaces,preconfigs:n.preconfigs,prompts:r.prompts,models:i.models,defaultModel:i.defaultModel,defaultProvider:i.defaultProvider,providers:a.providers}}};export{T as i,D as n,E as r,U as t};
|
|
1
|
+
import{n as e,t}from"./jsx-runtime-CoWo_Ex4.js";import{A as n,D as r,b as i,c as a,d as o,g as s,h as c,i as l,j as u,m as d,o as f,u as p,v as m,w as h,x as g,y as _}from"./serverDataStore-CvTJtC_B.js";import{a as v}from"./Match-BqRw2YHq.js";var y=class extends u{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new f({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=b(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=b(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=b(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=b(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){o.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>m(t,e))}findAll(e={}){return this.getAll().filter(t=>m(e,t))}notify(e){o.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return o.batch(()=>Promise.all(e.map(e=>e.continue().catch(i))))}};function b(e){return e.options.scope?.id}var x=class extends u{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??s(r,t),o=this.get(i);return o||(o=new a({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){o.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>_(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>_(e,t)):t}notify(e){o.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){o.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){o.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},S=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new x,this.#t=e.mutationCache||new y,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=n.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=p.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(h(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=d(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return o.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;o.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return o.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=o.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(i).catch(i)}invalidateQueries(e,t={}){return o.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=o.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(i)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(i)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(h(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(i).catch(i)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(i).catch(i)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return p.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(c(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{g(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(c(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{g(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=s(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===r&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},C=e(),w=t(),T=new S({defaultOptions:{queries:{staleTime:3e4,gcTime:5*6e4,retry:2,refetchOnWindowFocus:!1}}});function E(e){let t=(0,C.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,w.jsx)(l,{client:T,children:n}),t[0]=n,t[1]=r),r}function D(e){return v({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}var O=class{constructor(e){this.http=e}async list(e){return this.http.get(`/sessions`,{params:e?.status?{status:e.status}:void 0,signal:e?.signal})}async create(e){let{signal:t,...n}=e??{};return this.http.post(`/sessions`,n,{signal:t})}async get(e,t){return this.http.get(`/sessions/${encodeURIComponent(e)}`,{signal:t?.signal})}async update(e,t,n){return this.http.put(`/sessions/${encodeURIComponent(e)}`,t,{signal:n?.signal})}async delete(e,t){return this.http.delete(`/sessions/${encodeURIComponent(e)}`,{signal:t?.signal})}async listMessages(e,t){return this.http.get(`/sessions/${encodeURIComponent(e)}/messages`,{signal:t?.signal})}async listGrouped(e){let t={workspaceIds:e.workspaceIds.join(`,`)};return e.status&&(t.status=e.status),e.rootOnly&&(t.rootOnly=`true`),this.http.get(`/sessions/grouped`,{params:t,signal:e.signal})}async listByWorkspace(e){let t={};return e.status&&(t.status=e.status),e.rootOnly&&(t.rootOnly=`true`),this.http.get(`/workspaces/${encodeURIComponent(e.workspaceId)}/sessions`,{params:t,signal:e.signal})}async listTags(e,t){return this.http.get(`/sessions/tags`,{params:{workspaceId:e},signal:t?.signal})}},k=class{constructor(e){this.http=e}async list(e){return this.http.get(`/workspaces`,{signal:e?.signal})}async create(e){let{signal:t,...n}=e??{};return this.http.post(`/workspaces`,n,{signal:t})}async get(e,t){return this.http.get(`/workspaces/${encodeURIComponent(e)}`,{signal:t?.signal})}async update(e,t,n){return this.http.patch(`/workspaces/${encodeURIComponent(e)}`,t,{signal:n?.signal})}async delete(e,t){return this.http.delete(`/workspaces/${encodeURIComponent(e)}`,{signal:t?.signal})}async listSessions(e,t){return this.http.get(`/workspaces/${encodeURIComponent(e)}/sessions`,{signal:t?.signal})}async listPinnedMessages(e,t){return this.http.get(`/workspaces/${encodeURIComponent(e)}/pinned-messages`,{signal:t?.signal})}async pinMessage(e,t,n){return this.http.post(`/workspaces/${encodeURIComponent(e)}/pinned-messages`,t,{signal:n?.signal})}async unpinMessage(e,t,n){return this.http.delete(`/workspaces/${encodeURIComponent(e)}/pinned-messages/${encodeURIComponent(t)}`,{signal:n?.signal})}},A=class{constructor(e){this.http=e}async list(e){return this.http.get(`/models`,{signal:e?.signal})}},j=class{constructor(e){this.http=e}async list(e){return this.http.get(`/tools`,{signal:e?.signal})}async get(e,t){return this.http.get(`/tools/${encodeURIComponent(e)}`,{signal:t?.signal})}async listEnvVars(e){return this.http.get(`/tools/env`,{signal:e?.signal})}async setEnvVar(e,t,n){return this.http.put(`/tools/env/${encodeURIComponent(e)}`,t,{signal:n?.signal})}async clearEnvVar(e,t){return this.http.delete(`/tools/env/${encodeURIComponent(e)}`,{signal:t?.signal})}},M=class{constructor(e){this.http=e}async list(e){return this.http.get(`/providers`,{signal:e?.signal})}async getStatus(e,t){return this.http.get(`/providers/${encodeURIComponent(e)}/status`,{signal:t?.signal})}async connect(e,t){return this.http.post(`/providers/${encodeURIComponent(e)}/connect`,void 0,{signal:t?.signal})}async disconnect(e,t){return this.http.delete(`/providers/${encodeURIComponent(e)}`,{signal:t?.signal})}async listCredentials(e){return this.http.get(`/config/providers`,{signal:e?.signal})}async setCredential(e,t,n){return this.http.put(`/config/providers/${encodeURIComponent(e)}`,t,{signal:n?.signal})}async clearCredential(e,t){return this.http.delete(`/config/providers/${encodeURIComponent(e)}`,{signal:t?.signal})}},N=class{constructor(e){this.http=e}async list(e){return this.http.get(`/preconfigs`,{signal:e?.signal})}async create(e){let{signal:t,...n}=e??{};return this.http.post(`/preconfigs`,n,{signal:t})}async get(e,t){return this.http.get(`/preconfigs/${encodeURIComponent(e)}`,{signal:t?.signal})}async update(e,t,n){return this.http.put(`/preconfigs/${encodeURIComponent(e)}`,t,{signal:n?.signal})}async delete(e,t){return this.http.delete(`/preconfigs/${encodeURIComponent(e)}`,{signal:t?.signal})}},P=class{constructor(e){this.http=e}async list(e){return this.http.get(`/prompts`,{signal:e?.signal})}},F=class{constructor(e){this.http=e}async browse(e,t,n){let r={};return t!==void 0&&(r.path=t),n?.showHidden!==void 0&&(r.showHidden=String(n.showHidden)),n?.limit!==void 0&&(r.limit=String(n.limit)),this.http.get(`/workspaces/${encodeURIComponent(e)}/files`,{params:Object.keys(r).length>0?r:void 0,signal:n?.signal})}async search(e,t,n){let r={search:t};return n?.limit!==void 0&&(r.limit=String(n.limit)),n?.showHidden!==void 0&&(r.showHidden=String(n.showHidden)),this.http.get(`/workspaces/${encodeURIComponent(e)}/files`,{params:r,signal:n?.signal})}async preview(e,t,n){return this.http.get(`/workspaces/${encodeURIComponent(e)}/file-preview`,{params:{path:t},signal:n?.signal})}async gitDiff(e,t,n){return this.http.get(`/workspaces/${encodeURIComponent(e)}/git/diff`,{params:{path:t},signal:n?.signal})}async browseFs(e,t){return this.http.get(`/fs/browse`,{params:e===void 0?void 0:{path:e},signal:t?.signal})}async parent(e,t){return this.http.get(`/fs/parent`,{params:{path:e},signal:t?.signal})}async drives(e){return this.http.get(`/fs/drives`,{signal:e?.signal})}},I=class{constructor(e){this.http=e}async list(e,t){return this.http.get(`/sessions/${encodeURIComponent(e)}/attachments`,{signal:t?.signal})}async upload(e,t,n){let r=new FormData;r.append(`file`,t);let{signal:i}=n??{};return this.http.post(`/sessions/${encodeURIComponent(e)}/attachments`,r,{signal:i})}getUrl(e,t,n){return`/api/sessions/${encodeURIComponent(e)}/attachments/${encodeURIComponent(t)}/content?key=${encodeURIComponent(n)}`}},L=class{constructor(e){this.http=e}async list(e,t){return this.http.get(`/workspaces/${encodeURIComponent(e)}/terminals`,{signal:t?.signal})}async create(e,t){let{signal:n,body:r}=t??{};return this.http.post(`/workspaces/${encodeURIComponent(e)}/terminals`,r??{},{signal:n})}async get(e,t,n){return this.http.get(`/workspaces/${encodeURIComponent(e)}/terminals/${encodeURIComponent(t)}`,{signal:n?.signal})}async delete(e,t,n){return this.http.delete(`/workspaces/${encodeURIComponent(e)}/terminals/${encodeURIComponent(t)}`,{signal:n?.signal})}},R=class{constructor(e){this.http=e}async getStatus(e,t){return this.http.get(`/workspaces/${encodeURIComponent(e)}/mcp/status`,{signal:t?.signal})}async connect(e,t,n){let{signal:r}=n??{};return this.http.post(`/workspaces/${encodeURIComponent(e)}/mcp/connect`,{name:t},{signal:r})}async disconnect(e,t,n){let{signal:r}=n??{};return this.http.post(`/workspaces/${encodeURIComponent(e)}/mcp/disconnect`,{name:t},{signal:r})}async startAuth(e,t,n){let{signal:r}=n??{};return this.http.post(`/workspaces/${encodeURIComponent(e)}/mcp/auth`,{name:t},{signal:r})}async finishAuth(e,t,n,r){let{signal:i}=r??{};return this.http.post(`/workspaces/${encodeURIComponent(e)}/mcp/auth/callback`,{name:t,code:n},{signal:i})}},z=class{constructor(e){this.http=e}async get(e){return this.http.get(`/config/models`,{signal:e?.signal})}async createProvider(e,t){return this.http.post(`/config/models/providers`,e,{signal:t?.signal})}async updateProvider(e,t,n){return this.http.put(`/config/models/providers/${encodeURIComponent(e)}`,t,{signal:n?.signal})}async deleteProvider(e,t){return this.http.delete(`/config/models/providers/${encodeURIComponent(e)}`,{signal:t?.signal})}async createModel(e,t,n){return this.http.post(`/config/models/providers/${encodeURIComponent(e)}/models`,t,{signal:n?.signal})}async updateModel(e,t,n,r){return this.http.put(`/config/models/providers/${encodeURIComponent(e)}/models/${encodeURIComponent(t)}`,n,{signal:r?.signal})}async deleteModel(e,t,n){return this.http.delete(`/config/models/providers/${encodeURIComponent(e)}/models/${encodeURIComponent(t)}`,{signal:n?.signal})}async setDefaults(e,t){return this.http.put(`/config/models/defaults`,e,{signal:t?.signal})}async sync(e=`merge`,t){return this.http.post(`/config/models/sync`,{mode:e},{signal:t?.signal})}},B=class{constructor(e){this.http=e}async list(e){return this.http.get(`/config/prompts`,{signal:e?.signal})}async get(e,t){return this.http.get(`/config/prompts/${encodeURIComponent(e)}`,{signal:t?.signal})}async create(e,t){return this.http.post(`/config/prompts`,e,{signal:t?.signal})}async update(e,t,n){return this.http.put(`/config/prompts/${encodeURIComponent(e)}`,t,{signal:n?.signal})}async delete(e,t){return this.http.delete(`/config/prompts/${encodeURIComponent(e)}`,{signal:t?.signal})}},V=class{models;prompts;constructor(e){this.models=new z(e),this.prompts=new B(e)}},H=class{constructor(e){this.http=e}async list(e){return this.http.get(`/response-formats`,{signal:e?.signal})}async get(e,t){return this.http.get(`/response-formats/${encodeURIComponent(e)}`,{signal:t?.signal})}async create(e){return this.http.post(`/response-formats`,e)}async update(e,t){return this.http.put(`/response-formats/${encodeURIComponent(e)}`,t)}async delete(e){return this.http.delete(`/response-formats/${encodeURIComponent(e)}`)}},U=class{sessions;workspaces;models;tools;providers;preconfigs;prompts;files;attachments;terminals;mcp;config;responseFormats;constructor(e){this.sessions=new O(e),this.workspaces=new k(e),this.models=new A(e),this.tools=new j(e),this.providers=new M(e),this.preconfigs=new N(e),this.prompts=new P(e),this.files=new F(e),this.attachments=new I(e),this.terminals=new L(e),this.mcp=new R(e),this.config=new V(e),this.responseFormats=new H(e)}async loadAll(e){let[t,n,r,i,a]=await Promise.all([this.workspaces.list(e),this.preconfigs.list(e),this.prompts.list(e),this.models.list(e),this.providers.list(e)]);return{workspaces:t.workspaces,preconfigs:n.preconfigs,prompts:r.prompts,models:i.models,defaultModel:i.defaultModel,defaultProvider:i.defaultProvider,providers:a.providers}}};export{T as i,D as n,E as r,U as t};
|