import{s as e}from"./chunk-Bj-mKKzh.js";import{n as t}from"./jsx-runtime-CiQ1k8xo.js";import{F as n,W as r,h as i,lt as a}from"./vscode-api-DjORcpSo.js";import{t as o}from"./use-stable-callback-CvFJzJNa.js";import{n as s}from"./run-command-DkMaJ35-.js";var c={},l=r(i,!1),u=r(i,c);function d(e,t){return e[t]?.length??0}var f=a(),p=e(t(),1);function m(e,t,r){let a=(0,f.c)(20),c;a[0]===r?c=a[1]:(c=r===void 0?{}:r,a[0]=r,a[1]=c);let{enabled:l,isActive:d,keyboardHandler:m,menuItem:_}=c,v=l===void 0?!0:l,y=n(i),b;a[2]===d?b=a[3]:(b=()=>d?.()??!0,a[2]=d,a[3]=b);let x=o(b),S;a[4]!==t||a[5]!==m?(S=e=>{if(e!=null&&m?.(e)===!1)return!1;t()},a[4]=t,a[5]=m,a[6]=S):S=a[6];let C=(0,p.useEffectEvent)(S),w;a[7]!==v||a[8]!==C||a[9]!==e||a[10]!==x||a[11]!==_||a[12]!==y?(w=()=>{if(!v)return;let t=_==null?{}:{menuItem:_},n=s(e,C,{isActive:x});return y.set(u,n=>h(n,e,t)),()=>{n(),y.set(u,n=>g(n,e,t))}},a[7]=v,a[8]=C,a[9]=e,a[10]=x,a[11]=_,a[12]=y,a[13]=w):w=a[13];let T;a[14]!==v||a[15]!==e||a[16]!==x||a[17]!==_||a[18]!==y?(T=[v,e,x,_,y],a[14]=v,a[15]=e,a[16]=x,a[17]=_,a[18]=y,a[19]=T):T=a[19],(0,p.useEffect)(w,T)}function h(e,t,n){return{...e,[t]:[...e[t]??[],n]}}function g(e,t,n){let r=e[t];if(r==null)return e;let i=r.lastIndexOf(n);if(i===-1)return e;if(r.length===1){let n={...e};return delete n[t],n}let a=[...r];return a.splice(i,1),{...e,[t]:a}}export{u as i,d as n,l as r,m as t};
//# sourceMappingURL=use-register-command-yA_5KLgb.js.map