import{n as e,s as t}from"./rolldown-runtime-BG2f4sTM.js";import{$lt as n,Dft as r,Mft as i,O_t as a,Qlt as o,Rgt as s,Tft as c,Yut as l,Zut as u,jft as d,npt as f,omt as p,q_t as m,tvt as h,wft as g}from"./app-initial-BHB6SClA.js";function _(e,t,n,r){let i=x(t);e.set(A,e=>{let a=e??{},o=a[i]??w(t);return o?.[n]===r?a:{...a,[i]:{...o,[n]:r}}})}function v(e){r(`${k}:`),e.set(A,{})}function y(e,t,n,r){e.query.snapshot(j,t).setData(e=>e==null?e:{file:{...e.file,suggestions:e.file.suggestions.map(e=>e.id===n?{...e,status:r}:e)}})}function b(e){return e==null?null:Object.keys(e)}function x({domain:e,hostId:t,projectRoot:n}){return e==null?`${k}:${t}:${C(n)}`:`${k}:${t}:${C(n)}:${e}`}function S(e,t){let n=x(t),r=e(A)?.[n];if(r!=null)return r;if(t.domain==null)return w(t)}function C(e){return e??``}function w(e){return g(T(e),void 0)}function T({hostId:e,projectRoot:t}){return`${k}:${e}:${C(t)}`}function E(e,t){let n=[];for(let r of e){let e=(0,D.default)(t,({id:e})=>e===r);if(e?.status===`pending`&&n.push(e),n.length===O)break}return n}var D,O,k,A,j,M,N,P,F,I,L=e((()=>{D=t(p(),1),a(),f(),i(),c(),o(),u(),O=3,k=`ambient-suggestions:default-statuses`,A=n(k,{}),j=l(d,`ambient-suggestions`,({projectRoot:e})=>({enabled:e!=null})),M=l(d,`ambient-suggestions-refresh`,({domain:e,hostId:t,plan:n,projectRoot:r})=>({enabled:r!=null,gcTime:s(n),params:{domain:e,hostId:t,projectRoot:r},select:()=>!0,staleTime:s(n)})),N=h(d,e=>null),P=m(d,(e,{get:t})=>b(S(t,e))),F=m(d,(e,{get:t})=>{let n=t(j,e);return n.data!=null||n.isError}),I=m(d,({domain:e,hostId:t,projectRoot:n},{get:r})=>{let i=r(j,{domain:e,hostId:t,projectRoot:n}).data?.file;return E(i?.currentSuggestionIds??[],i?.suggestions??[])})})),R,z=e((()=>{o(),R=n(`electron:new-chat-suggestion-source-debug-override`,null)}));export{F as a,P as c,_ as d,I as f,j as i,v as l,R as n,M as o,N as r,L as s,z as t,y as u};
//# sourceMappingURL=new-chat-suggestion-source-debug-state-BFY13kAU.js.map