@inkeep/open-knowledge 0.30.1-beta.2 → 0.30.1-beta.3

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.
@@ -1999,5 +1999,5 @@ Error generating stack: `+e.message+`
1999
1999
  :host([${vY}]) [data-item-focused="true"] {
2000
2000
  --trees-focus-ring-color: transparent;
2001
2001
  }
2002
- `}\n${Sq}\n${Cq}`;function bY(e){let t=e.split(`/`).pop()?.replace(/\.md$/i,``).toLowerCase();return!!t&&iY.has(t)}function xY(e){return e===`darwin`?qc._({id:`LtSYdi`}):e===`win32`?qc._({id:`qi1F96`}):qc._({id:`e1Rn_k`})}function SY(e){let t=(0,$.c)(18),{item:n,workspace:r,onClose:i}=e,{_:a}=At(),o=typeof window<`u`?window.okDesktop:void 0;if(!o)return null;let s=o.platform,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=xY(s),t[0]=c):c=t[0];let l=c,u,d;t[1]!==a||t[2]!==r?(u=r?null:a({id:`wTcjov`}),d=a(s===`darwin`?u?{id:`FvpFSZ`,values:{hint:u}}:{id:`LtSYdi`}:s===`win32`?u?{id:`o4dcAf`,values:{hint:u}}:{id:`qi1F96`}:u?{id:`zUhPuR`,values:{hint:u}}:{id:`e1Rn_k`}),t[1]=a,t[2]=r,t[3]=u,t[4]=d):(u=t[3],d=t[4]);let f=d,p=!r,m;t[5]!==n||t[6]!==i||t[7]!==r?(m=()=>{if(!r)return;i();let e=Po(r.contentDir,Bu(n),r.pathSeparator);o.shell.showItemInFolder(e)},t[5]=n,t[6]=i,t[7]=r,t[8]=m):m=t[8];let h,g;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(Bo,{"aria-hidden":`true`}),g=(0,Z.jsx)(`span`,{className:`flex-1`,children:l}),t[9]=h,t[10]=g):(h=t[9],g=t[10]);let _;t[11]===u?_=t[12]:(_=u?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:u}):null,t[11]=u,t[12]=_);let v;return t[13]!==f||t[14]!==p||t[15]!==m||t[16]!==_?(v=(0,Z.jsxs)(bc,{disabled:p,onSelect:m,"aria-label":f,children:[h,g,_]}),t[13]=f,t[14]=p,t[15]=m,t[16]=_,t[17]=v):v=t[17],v}function CY(e,t){return Ru({kind:e.endsWith(`/`)?`directory`:`file`,name:e,path:e},t)}function wY(e){let t=e.match(/\.(md|mdx)$/i);if(!t)return null;let n=t[0].toLowerCase()===`.md`?`.mdx`:`.md`;return`${e.slice(0,-t[0].length)}${n}`}function TY(e,t){let n=wY(e);return n?t.includes(n):!1}function EY(e,t){return e!==t&&e.startsWith(t)}function DY(e,t){let n=[...new Set(e)].filter(e=>!ul(e)),r=n.filter(e=>e.endsWith(`/`));return n.filter(e=>!r.some(t=>EY(e,t))).map(e=>CY(e,t))}function OY(e,t){let n=e.getItem(t)??e.getItem(ed(t));return n?.isDirectory()?ed(cd(n.getPath())):t}function kY(e){let t=e.getFocusedPath()??e.getSelectedPaths()[0]??null;return t?OY(e,t):null}function AY(e,t,n){let r=kY(e);return!r||n.has(r)||ul(r)?null:CY(r,t)}function jY(e,t){let n=e.getSelectedPaths(),r=kY(e);return DY(n.length>0?n.map(t=>OY(e,t)):r?[r]:[],t)}function MY(e,t){return e===t||e.startsWith(`${t}/`)}function NY(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName;return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||e.isContentEditable||e.closest(`[contenteditable="true"]`)!==null}function PY(e,t,n){let r=new Set,i=new Set,a=new Set;for(let o of e){if(o.kind===`file`){r.add(o.path);continue}if(o.kind===`asset`){a.add(o.path);continue}i.add(o.path);for(let e of t)tl(e)&&e.docName.startsWith(`${o.path}/`)?r.add(e.docName):fl(e)&&e.path.startsWith(`${o.path}/`)&&a.add(e.path);for(let e of n){let t=cd(e);MY(t,o.path)&&i.add(t)}}return{docNames:r,folderPaths:i,assetPaths:a}}function FY(e,t){return e.kind===`file`?t.kind===`file`&&e.path===t.createdPath:e.kind===`asset`?!1:MY(t.createdPath,e.path)}function IY(e){let t=(0,$.c)(68),{item:n,context:r,anyActionBusy:i,workspace:a,handoff:o,model:s,okignoreBinding:c,onStartCreating:l,onCreateFromTemplate:u,onDuplicate:d,onDelete:f,onExpandSubtree:p,onCollapseSubtree:m,folderTreePaths:h,isAsset:g,documents:v}=e,{_:y}=At(),b=Ru(n,v),x=n.kind===`directory`,S;t[0]===n.path?S=t[1]:(S=ul(n.path),t[0]=n.path,t[1]=S);let C=S,w=b.kind===`asset`?null:b,T=w!==null&&c!==null,E;t[2]!==y||t[3]!==x?(E=y(x?{id:`5D3Ior`}:{id:`dbhUX1`}),t[2]=y,t[3]=x,t[4]=E):E=t[4];let D=E,O;t[5]!==x||t[6]!==n.path?(O=x?cd(n.path):null,t[5]=x,t[6]=n.path,t[7]=O):O=t[7];let k=bo(O),A=k.state.status===`ready`?(k.state.data.folder.templates_available?.length??0)>0:!0,j=s.getSelectedPaths(),M=j.includes(b.treePath)?DY(j,v):[],N=M.length>1?M:[b],P=N.length,F=qc._({id:`djjdjr`,values:{deleteCount:P}}),I;t[8]!==v||t[9]!==g||t[10]!==x||t[11]!==n||t[12]!==a?(I=g?null:x?ka({folderRelativePath:Bu(n),workspace:a}):ja({docName:sd(n.path,v),workspace:a}),t[8]=v,t[9]=g,t[10]=x,t[11]=n,t[12]=a,t[13]=I):I=t[13];let L=I,R;t[14]===r?R=t[15]:(R=()=>r.close({restoreFocus:!1}),t[14]=r,t[15]=R);let z=R,B;t[16]===r?B=t[17]:(B=()=>r.close(),t[16]=r,t[17]=B);let V=B,{status:H}=Bi(),U=H?.hasRemote===!0,W;t[18]!==v||t[19]!==g||t[20]!==x||t[21]!==n.path||t[22]!==b?(W=g||b.kind===`asset`?null:x?Ia(cd(n.path)):Wa(sd(n.path,v)),t[18]=v,t[19]=g,t[20]=x,t[21]=n.path,t[22]=b,t[23]=W):W=t[23];let G=W,ee=U&&G!==null,te;t[24]!==y||t[25]!==U||t[26]!==G?(te=()=>{G&&za({...G,hasRemote:U,onClickWhenNoRemote:()=>{_s.error(y({id:`WyQxwa`}))}},{clipboardWrite:Ca,toastSuccess:zY,toastError:RY,logEvent:LY})},t[24]=y,t[25]=U,t[26]=G,t[27]=te):te=t[27];let K=te,ne;t[28]!==ee||t[29]!==V||t[30]!==K?(ne=ee?(0,Z.jsxs)(bc,{"data-testid":`file-tree-menu-share`,onSelect:()=>{V(),K()},children:[(0,Z.jsx)(Nf,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`Z8lGw6`})]}):null,t[28]=ee,t[29]=V,t[30]=K,t[31]=ne):ne=t[31];let re=ne,ie=0,q=0;if(x){let e=ed(n.path);for(let t of h)(t===e||t.startsWith(e))&&(ie++,hJ(s.getItem(t))?.isExpanded()&&q++)}let ae=x&&q<ie,oe=x&&q>0,se;t[32]===V?se=t[33]:(se=e=>{e||V()},t[32]=V,t[33]=se);let ce;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,Z.jsx)(oc,{asChild:!0,children:(0,Z.jsx)(`span`,{"aria-hidden":`true`,"data-file-tree-context-menu-root":`true`,className:`block size-px`})}),t[34]=ce):ce=t[34];let le;t[35]!==y||t[36]!==i||t[37]!==T||t[38]!==V||t[39]!==z||t[40]!==F||t[41]!==N||t[42]!==A||t[43]!==o||t[44]!==L||t[45]!==D||t[46]!==g||t[47]!==x||t[48]!==C||t[49]!==n||t[50]!==s||t[51]!==c||t[52]!==w||t[53]!==m||t[54]!==u||t[55]!==f||t[56]!==d||t[57]!==p||t[58]!==l||t[59]!==re||t[60]!==oe||t[61]!==ae||t[62]!==b||t[63]!==a?(le=(0,Z.jsx)(Sc,{sideOffset:0,align:`start`,"data-file-tree-context-menu-root":`true`,className:`min-w-52`,children:x?(0,Z.jsxs)(Z.Fragment,{children:[C?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(bc,{disabled:i,onSelect:()=>{z(),l(`file`,cd(n.path))},children:[(0,Z.jsx)(Lf,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`HdkSiO`})]}),A?(0,Z.jsxs)(ic,{children:[(0,Z.jsxs)(_c,{disabled:i,children:[(0,Z.jsx)(ao,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`Uuj_R4`})]}),(0,Z.jsx)(Mc,{children:(0,Z.jsx)(mJ,{parentDir:cd(n.path),onSelectTemplate:e=>{z(),u(cd(n.path),e)},ItemComponent:bc})})]}):null,(0,Z.jsxs)(bc,{disabled:i,onSelect:()=>{z(),l(`folder`,cd(n.path))},children:[(0,Z.jsx)($d,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`96G6Re`})]}),(0,Z.jsx)(gc,{})]}),(0,Z.jsx)(SY,{item:n,workspace:a,onClose:V}),(0,Z.jsx)(ma,{input:L,installStates:o.installStates,isElectronHost:o.isElectronHost,dispatch:o.dispatch}),re,(0,Z.jsxs)(ic,{children:[(0,Z.jsxs)(_c,{children:[(0,Z.jsx)(Ao,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`oCZkaG`})]}),(0,Z.jsxs)(Mc,{children:[(0,Z.jsx)(bc,{disabled:!a,onSelect:()=>{a&&(V(),rY(Po(a.contentDir,Bu(n),a.pathSeparator),`full`))},children:(0,Z.jsx)(J,{id:`oQA-cA`})}),(0,Z.jsx)(bc,{onSelect:()=>{V(),rY(Bu(n),`relative`)},children:(0,Z.jsx)(J,{id:`s061i4`})})]})]}),ae||oe?(0,Z.jsx)(gc,{}):null,ae?(0,Z.jsxs)(bc,{onSelect:()=>{V(),p(n.path)},children:[(0,Z.jsx)(Zf,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`OlAl5i`})]}):null,oe?(0,Z.jsxs)(bc,{onSelect:()=>{V(),m(n.path)},children:[(0,Z.jsx)(Zd,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`qvWGzP`})]}):null,C?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(gc,{}),(0,Z.jsxs)(bc,{disabled:i,onSelect:()=>{b.kind!==`asset`&&(V(),d(b))},children:[(0,Z.jsx)(jo,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`euc6Ns`})]}),(0,Z.jsxs)(bc,{disabled:i,onSelect:()=>{z(),s.startRenaming(n.path)},children:[(0,Z.jsx)(zo,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`2wxgft`})]}),(0,Z.jsxs)(bc,{"data-testid":`file-tree-menu-hide`,disabled:!T,onSelect:()=>{if(!c||!w)return;V();let e=Bq(w),t=po(c.current()),n=Co(t,e);if(n===t)return;c.patch(eo(n));let r=w.path.split(`/`).pop()||w.path;_s.success(y({id:`4xtLTl`,values:{basename:r}}),{description:y({id:`nWv1ja`}),duration:5e3})},children:[(0,Z.jsx)(_,{"aria-hidden":`true`}),D]}),(0,Z.jsxs)(bc,{variant:`destructive`,disabled:i,onSelect:()=>{V(),f(N)},children:[(0,Z.jsx)(ss,{"aria-hidden":`true`}),F]})]})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(SY,{item:n,workspace:a,onClose:V}),!g&&(0,Z.jsx)(ma,{input:L,installStates:o.installStates,isElectronHost:o.isElectronHost,dispatch:o.dispatch}),re,(0,Z.jsxs)(ic,{children:[(0,Z.jsxs)(_c,{children:[(0,Z.jsx)(Ao,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`oCZkaG`})]}),(0,Z.jsxs)(Mc,{children:[(0,Z.jsx)(bc,{disabled:!a,onSelect:()=>{a&&(V(),rY(Po(a.contentDir,Bu(n),a.pathSeparator),`full`))},children:(0,Z.jsx)(J,{id:`oQA-cA`})}),(0,Z.jsx)(bc,{onSelect:()=>{V(),rY(Bu(n),`relative`)},children:(0,Z.jsx)(J,{id:`s061i4`})})]})]}),C?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(gc,{}),g?null:(0,Z.jsxs)(bc,{disabled:i,onSelect:()=>{V(),d(b)},children:[(0,Z.jsx)(jo,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`euc6Ns`})]}),(0,Z.jsxs)(bc,{disabled:i,onSelect:()=>{z(),s.startRenaming(n.path)},children:[(0,Z.jsx)(zo,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`2wxgft`})]}),w?(0,Z.jsxs)(bc,{"data-testid":`file-tree-menu-hide`,disabled:!T,onSelect:()=>{if(!c)return;V();let e=Bq(w),t=po(c.current()),n=Co(t,e);if(n===t)return;c.patch(eo(n));let r=w.path.split(`/`).pop()||w.path;_s.success(y({id:`OD0FCX`,values:{basename:r}}),{description:y({id:`nWv1ja`}),duration:5e3})},children:[(0,Z.jsx)(_,{"aria-hidden":`true`}),D]}):null,(0,Z.jsxs)(bc,{variant:`destructive`,disabled:i,onSelect:()=>{V(),f(N)},children:[(0,Z.jsx)(ss,{"aria-hidden":`true`}),F]})]})]})}),t[35]=y,t[36]=i,t[37]=T,t[38]=V,t[39]=z,t[40]=F,t[41]=N,t[42]=A,t[43]=o,t[44]=L,t[45]=D,t[46]=g,t[47]=x,t[48]=C,t[49]=n,t[50]=s,t[51]=c,t[52]=w,t[53]=m,t[54]=u,t[55]=f,t[56]=d,t[57]=p,t[58]=l,t[59]=re,t[60]=oe,t[61]=ae,t[62]=b,t[63]=a,t[64]=le):le=t[64];let ue;return t[65]!==se||t[66]!==le?(ue=(0,Z.jsxs)(Oc,{open:!0,modal:!1,onOpenChange:se,children:[ce,le]}),t[65]=se,t[66]=le,t[67]=ue):ue=t[67],ue}function LY(e){return console.log(e)}function RY(e){return _s.error(e)}function zY(e){return _s.success(e)}function BY(e,t){return`/api/documents?showAll=true${t?`&showOk=true`:``}&dir=${encodeURIComponent(e)}&depth=1`}async function VY(e,t,n,r,i){try{let a=await fetch(BY(e,t),{signal:n,headers:kJ});if(AJ(a)){let e=await NJ(a);return{kind:`entries`,entries:Zc(e.entries),truncated:e.truncated}}let o=await kt(a,r);if(!o.ok)return{kind:`http-error`,title:o.title};let s=mn.safeParse(o.body);return s.success?{kind:`entries`,entries:Zc(s.data.documents),truncated:s.data.truncated===!0}:{kind:`http-error`,title:i}}catch(e){return e instanceof jJ?{kind:`http-error`,title:e.message}:{kind:`network-error`,cause:e}}}function HY(e){let t=(0,$.c)(366),{ref:n,onContentHeightChange:r}=e,{_:i,i18n:a}=At(),{activeDocName:o,activeTarget:s,closeTabs:c,closeDocument:l,closeAndClearForRename:u,getPoolActiveDocName:d,poolHas:p,isNewTabActive:m,openTarget:h,prewarm:g,remapTabsForRename:_}=Xe(),{notifySidebarFileSelected:v}=$j(),{resolvedTheme:y}=ln(),{addPage:b,pageMeta:x,pages:S}=aa(),C;t[0]===x?C=t[1]:(C=function(e,t){return il(e,t??x.get(e)?.size)??{kind:`doc`,target:e,docName:e}},t[0]=x,t[1]=C);let w=C,T;t[2]!==b||t[3]!==w||t[4]!==v||t[5]!==h?(T=function(e,t,n){n?.registerPage&&b(e),h(w(e,t),{tabBehavior:`replace-active`}),Tl(Ml(e)),v()},t[2]=b,t[3]=w,t[4]=v,t[5]=h,t[6]=T):T=t[6];let E=T,D;t[7]!==v||t[8]!==h?(D=function(e){let t=wl(e);h({kind:`folder`,target:e,folderPath:e},{tabBehavior:`replace-active`}),Tl(t),v()},t[7]=v,t[8]=h,t[9]=D):D=t[9];let O=D,k;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(k=[],t[10]=k):k=t[10];let[A,j]=(0,Q.useState)(k),[M,N]=(0,Q.useState)(!0),[P,F]=(0,Q.useState)(null),[I,L]=(0,Q.useState)(!1),R=RN(),z=(0,Q.useRef)(null),[B,V]=(0,Q.useState)(null),[H,U]=(0,Q.useState)(0),[W,G]=(0,Q.useState)(null),[ee,te]=(0,Q.useState)(null),[K,ne]=(0,Q.useState)(null),{conflicts:re}=Ka(),[ie,q]=(0,Q.useState)(null),[ae,oe]=(0,Q.useState)(null),[se,ce]=(0,Q.useState)(!1),le=(0,Q.useRef)(se),ue;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(ue=new Set,t[11]=ue):ue=t[11];let de=(0,Q.useRef)(ue),fe=(0,Q.useRef)(A),pe=(0,Q.useRef)(x),me=(0,Q.useRef)(null),he;t[12]!==A||t[13]!==O||t[14]!==E||t[15]!==v||t[16]!==h||t[17]!==S?(he=function(e,t){let n=t===void 0?A:t,r=tJ(e,n);if(r.kind===`none`){console.debug(`[FileTree] Dropped selection for unknown docName:`,od(e));return}if(r.kind===`asset`){h({kind:`asset`,target:r.path,assetPath:r.path,mediaKind:r.mediaKind},{tabBehavior:`replace-active`}),Tl(r.hash),v();return}if(r.kind===`folder`){O(r.path);return}let i=n.find(e=>tl(e)&&e.docName===r.path),a=el(r.path,{pages:S,docExt:i?.docExt});if(a?.kind===`asset`){h(a,{tabBehavior:`replace-active`}),Tl(Al(a.assetPath)),v();return}if(a?.kind===`doc`){E(a.docName);return}E(r.path,i?.size,{registerPage:Jc(r.path)})},t[12]=A,t[13]=O,t[14]=E,t[15]=v,t[16]=h,t[17]=S,t[18]=he):he=t[18];let ge=he,_e;t[19]!==v||t[20]!==h?(_e=function(e,t){h({kind:`asset`,target:e,assetPath:e,mediaKind:(t??fe.current).find(t=>fl(t)&&t.path===e)?.mediaKind??null},{tabBehavior:`replace-active`}),Tl(Al(e)),v()},t[19]=v,t[20]=h,t[21]=_e):_e=t[21];let ve=_e,be=(0,Q.useRef)(o),xe;t[22]===A?xe=t[23]:(xe=new Set(A.filter(fl).map(gX)),t[22]=A,t[23]=xe);let Se=xe,Ce=(0,Q.useRef)(Se),we;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(we=[],t[24]=we):we=t[24];let Te=(0,Q.useRef)(we),Ee=(0,Q.useRef)(null),Oe=(0,Q.useRef)(hX),ke=(0,Q.useRef)(null),Ae=(0,Q.useRef)(null),je=(0,Q.useRef)(!1),Me=(0,Q.useRef)(!1),Ne=(0,Q.useRef)(null),Pe;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(Pe={row:null,root:null},t[25]=Pe):Pe=t[25];let Fe=(0,Q.useRef)(Pe),Ie=(0,Q.useRef)(mX),Le=(0,Q.useRef)(null),Re=(0,Q.useRef)(null),ze;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(ze=new Map,t[26]=ze):ze=t[26];let Be=(0,Q.useRef)(ze),Ve;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=new Set,t[27]=Ve):Ve=t[27];let He=(0,Q.useRef)(Ve),Ue;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=new Map,t[28]=Ue):Ue=t[28];let We=(0,Q.useRef)(Ue),Ge=(0,Q.useRef)(0),Ke;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(Ke=new Set,t[29]=Ke):Ke=t[29];let qe=(0,Q.useRef)(Ke),Je=(0,Q.useRef)(pX),Ye=(0,Q.useRef)(fX),Ze=(0,Q.useRef)(!1),Qe=(0,Q.useRef)(!1),$e=(0,Q.useRef)(!1),et;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(et=()=>({showHiddenFiles:Ze.current,showOnlyMarkdownFiles:Qe.current,showOkFolders:$e.current}),t[30]=et):et=t[30];let tt=et,nt=(0,Q.useRef)(null),rt=(0,Q.useRef)(null),it=(0,Q.useRef)(dX),at=(0,Q.useRef)(uX),ot=(0,Q.useRef)(lX),lt=(0,Q.useRef)(cX),ut=(0,Q.useRef)(s),[dt,ft]=(0,Q.useState)(!1),pt;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(pt=function(){z.current!==null&&(clearTimeout(z.current),z.current=null)},t[31]=pt):pt=t[31];let mt=pt,ht;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(ht=function(){mt(),L(!1)},t[32]=ht):ht=t[32];let gt=ht,_t;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(_t=function(e){gt(),F(e)},t[33]=_t):_t=t[33];let vt=_t,yt;t[34]===i?yt=t[35]:(yt=function(){if(mt(),PN()){F(null),L(!0),z.current=setTimeout(()=>{z.current=null,nt.current?.()},gY);return}L(!1),F(i({id:`34qyH5`}))},t[34]=i,t[35]=yt);let bt=yt,xt=(0,Q.useRef)(!0),St;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(St=()=>{if(xt.current){xt.current=!1;return}nt.current?.()},t[36]=St):St=t[36];let Ct;t[37]===R?Ct=t[38]:(Ct=[R],t[37]=R,t[38]=Ct),(0,Q.useEffect)(St,Ct);let wt,Tt;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(wt=()=>mt,Tt=[],t[39]=wt,t[40]=Tt):(wt=t[39],Tt=t[40]),(0,Q.useEffect)(wt,Tt);let Et,Dt;t[41]!==A.length||t[42]!==M?(Et=()=>{if(M||A.length===0)return;let e=rt.current?.querySelector(dR)?.shadowRoot;if(!e)return;let t=e,n=function(){Ne.current!==null&&clearTimeout(Ne.current),Ne.current=setTimeout(()=>{Me.current=!1,Ne.current=null},0)},r=function(e){if(!(e instanceof DragEvent))return;let t=vX(e),n=t?.dataset.itemPath;if(!n)return;let r=oJ(t.dataset.itemType===`folder`?ed(n):n,fe.current,pe.current);r&&(Ne.current!==null&&(clearTimeout(Ne.current),Ne.current=null),Me.current=!0,e.dataTransfer?.setData(Fu,Nu(r)))},i=function(e){if(!(e instanceof DragEvent)||!Zu(e))return;let t=bX(e);if(!t){tY(Fe);return}e.preventDefault(),e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`),nY(Fe,t)},a=function(e){if(!(e instanceof DragEvent)||!Zu(e))return;let n=e.relatedTarget;n instanceof Node&&t.contains(n)||tY(Fe)},o=function(e){if(!(e instanceof DragEvent)||!Zu(e))return;let t=bX(e),n=Gu(e);if(!t||n.length===0){tY(Fe);return}e.preventDefault(),e.stopPropagation(),tY(Fe),Ie.current(n,t.parentDir,t.busyPath)};return e.addEventListener(`dragstart`,r,{capture:!0}),e.addEventListener(`dragover`,i,{capture:!0}),e.addEventListener(`dragleave`,a,{capture:!0}),e.addEventListener(`drop`,o,{capture:!0}),e.addEventListener(`dragend`,n,{capture:!0}),window.addEventListener(`drop`,n,!0),window.addEventListener(`dragend`,n,!0),()=>{e.removeEventListener(`dragstart`,r,{capture:!0}),e.removeEventListener(`dragover`,i,{capture:!0}),e.removeEventListener(`dragleave`,a,{capture:!0}),e.removeEventListener(`drop`,o,{capture:!0}),e.removeEventListener(`dragend`,n,{capture:!0}),window.removeEventListener(`drop`,n,!0),window.removeEventListener(`dragend`,n,!0),tY(Fe),Ne.current!==null&&(clearTimeout(Ne.current),Ne.current=null),Me.current=!1}},Dt=[A.length,M],t[41]=A.length,t[42]=M,t[43]=Et,t[44]=Dt):(Et=t[43],Dt=t[44]),(0,Q.useEffect)(Et,Dt);let{selectedFilePath:Ot,selectedFolderPath:jt,navigationPath:Mt}=eJ(s,m?null:o),Nt=Ot?nd(Ot,A.find(e=>tl(e)&&e.docName===Ot)?.docExt):jt?ed(jt):s?.kind===`asset`?s.assetPath:null,Pt=se?null:Nt,Ft=ba().states,{dispatch:It}=fa(),Lt;t[45]!==It||t[46]!==Ft?(Lt={installStates:Ft,isElectronHost:typeof window<`u`&&window.okDesktop!=null,dispatch:It},t[45]=It,t[46]=Ft,t[47]=Lt):Lt=t[47];let Rt=Lt,{okignoreBinding:zt,merged:Bt}=du(),Vt=Bt?.appearance?.sidebar?.showHiddenFiles??!1,Ht=Bt?.appearance?.sidebar?.showOnlyMarkdownFiles??!1,Ut=Bt?.appearance?.sidebar?.showOkFolders??!1,Wt;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(Wt=()=>Le.current===null,t[48]=Wt):Wt=t[48];let Gt=Wt,Kt;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(Kt=[],t[49]=Kt):Kt=t[49];let qt;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(qt={set:`complete`,spriteSheet:dY,byFileExtension:{md:{name:sY,viewBox:st},mdx:{name:sY,viewBox:st}}},t[50]=qt):qt=t[50];let Jt;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(Jt={contextMenu:{enabled:!0,triggerMode:`both`,buttonVisibility:`when-needed`}},t[51]=Jt):Jt=t[51];let Yt;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(Yt={canDrag:Gt,canDrop:Gt,onDropComplete:e=>lt.current(e),onDropError:sX},t[52]=Yt):Yt=t[52];let Xt,Zt;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(Xt={canRename:Gt,onRename:e=>at.current(e),onError:e=>ot.current(e)},Zt=e=>it.current(e),t[53]=Xt,t[54]=Zt):(Xt=t[53],Zt=t[54]);let Qt;t[55]===i?Qt=t[56]:(Qt={paths:Kt,initialExpansion:`closed`,fileTreeSearchMode:`hide-non-matches`,initialVisibleRowCount:18,stickyFolders:!0,...bq,icons:qt,unsafeCSS:yY,composition:Jt,dragAndDrop:Yt,renaming:Xt,onSelectionChange:Zt,renderRowDecoration:e=>{let{item:t}=e;if(t.kind===`file`){let e=fe.current.find(e=>tl(e)&&nd(e.docName,e.docExt)===t.path);if(e?.isSymlink){let t=e.targetPath;return{icon:aY,title:i(t?{id:`JE21eh`,values:{targetPath:t}}:{id:`BQu9Pg`})}}return bY(t.path)?{icon:oY,title:i({id:`i9toLO`})}:null}let n=fe.current.find(e=>dl(e)&&ed(e.path)===ed(t.path));if(n?.isSymlink){let e=n.targetPath;return{icon:aY,title:i(e?{id:`JE21eh`,values:{targetPath:e}}:{id:`BQu9Pg`})}}return null}},t[55]=i,t[56]=Qt);let{model:$t}=vq(Qt),en;t[57]===$t?en=t[58]:(en=function(e){let t=$t.getItem(e)??$t.getItem(ed(e));return t?.isDirectory()?ed(cd(t.getPath())):e},t[57]=$t,t[58]=en);let tn=en,nn,rn;t[59]===A?(nn=t[60],rn=t[61]):(rn=Uu(A),nn=Pu(rn),t[59]=A,t[60]=nn,t[61]=rn);let an=nn,on=(0,Q.useRef)(rn),sn;t[62]!==A||t[63]!==Ut?(sn=Qu(A,{includeOkFolders:Ut}),t[62]=A,t[63]=Ut,t[64]=sn):sn=t[64];let cn=sn,un=(0,Q.useRef)(cn),dn=jt?td(ed(jt)).slice(0,-1):td(Pt??Mt),fn=dn.join(`\0`),pn;t[65]===$t?pn=t[66]:(pn=()=>{let e=new Set;for(let t of un.current)hJ($t.getItem(t))?.isExpanded()&&e.add(t);return e},t[65]=$t,t[66]=pn);let hn=pn,gn;t[67]===hn?gn=t[68]:(gn=e=>{let t=new Set(Qu(e??fe.current,{includeOkFolders:$e.current})),n=hn();for(let e of Te.current)n.add(e);return[...n].filter(e=>t.has(e))},t[67]=hn,t[68]=gn);let _n=gn,vn;t[69]!==_n||t[70]!==$t?(vn=e=>{let t=Uu(e??fe.current);$t.resetPaths(t,{initialExpandedPaths:_n(e)})},t[69]=_n,t[70]=$t,t[71]=vn):vn=t[71];let yn=vn,bn;t[72]!==i||t[73]!==bt?(bn=async function(e){let t=Ge.current,n=new AbortController;We.current.set(e,n);let r=await VY(cd(e),$e.current,n.signal,i({id:`8RtNI0`}),i({id:`HlmZBk`}));if(We.current.get(e)===n&&We.current.delete(e),n.signal.aborted||t!==Ge.current)return;if(r.kind===`network-error`){bt(),console.warn(`[FileTree] lazy folder children fetch failed:`,e,r.cause);return}if(r.kind===`http-error`){console.warn(`[FileTree] lazy folder children http error:`,e,r.title),vt(r.title);return}let a=$c(r.entries,tt());He.current.add(e),j(t=>IJ(t,e,a,Be.current)),F(null),gt(),r.truncated&&V(r.entries.length)},t[72]=i,t[73]=bt,t[74]=bn):bn=t[74];let xn=bn,Sn;t[75]!==hn||t[76]!==xn?(Sn=()=>{let e=hn(),t=qe.current;qe.current=e;for(let n of e){if(t.has(n)||He.current.has(n)||We.current.has(n))continue;let e=cd(n);fe.current.find(t=>dl(t)&&t.path===e)?.hasChildren!==!1&&xn(n)}},t[75]=hn,t[76]=xn,t[77]=Sn):Sn=t[77];let Cn=Sn,wn;t[78]!==hn||t[79]!==xn?(wn=()=>{for(let e of hn())He.current.has(e)||We.current.has(e)||xn(e)},t[78]=hn,t[79]=xn,t[80]=wn):wn=t[80];let Tn=wn,En;t[81]!==$t||t[82]!==yn?(En=(e,t,n,r)=>{let i=r===void 0?[]:r,a=0,o=null;for(let{fromDocName:r,toDocName:i}of n){let n=e.find(e=>tl(e)&&e.docName===r);if(n==null||$t.getItem(i)==null)continue;let s=nd(i,t.find(e=>tl(e)&&e.docName===i)?.docExt??n.docExt);$t.move(i,s),o=s,a+=1}for(let{toPath:e}of i){let t=Xc(e);if(t===``)continue;let n=e.slice(0,-t.length);$t.getItem(n)!=null&&($t.getItem(e)??$t.move(n,e),o=e,a+=1)}a!==0&&(yn(t),o!=null&&$t.focusPath(o))},t[81]=$t,t[82]=yn,t[83]=En):En=t[83];let Dn=En,On;t[84]===Symbol.for(`react.memo_cache_sentinel`)?(On=e=>{ke.current=Xu(e)},t[84]=On):On=t[84];let kn=On,jn;t[85]===Symbol.for(`react.memo_cache_sentinel`)?(jn=e=>Ce.current.has(e),t[85]=jn):jn=t[85];let Pn=jn,Fn;t[86]!==i||t[87]!==b||t[88]!==O||t[89]!==E||t[90]!==yn?(Fn=async function(e){if(e.kind===`asset`||Le.current!==null)return;let t=()=>{G(null),Le.current=null};Le.current=e.path,G(e.path),F(null);try{let n=await kt(await fetch(`/api/duplicate-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:e.kind,path:e.path})}),i({id:`dw_dUJ`}));if(!n.ok){_s.error(n.title),yn(),t();return}let r=f(Mn,n.body,`duplicate-path`,null);if(r===null){let e=i({id:`67f-3g`});_s.error(e),F(e),hl([`files`,`backlinks`,`graph`]),yn(),t();return}for(let e of r.duplicatedDocNames)b(e);j(t=>{let n=uP(t,e,r);return yn(n),kn(n),n}),hl([`files`,`backlinks`,`graph`]),r.path!==e.path&&(r.kind===`folder`?O(r.path):E(r.path)),_s.success(r.kind===`folder`?i({id:`iilQXA`}):i({id:`A6h5b-`}),{description:r.path}),t()}catch(e){let n=e,r=n instanceof Error?n.message:String(n);console.warn(`[FileTree] duplicate failed:`,n),_s.error(i({id:`EBVbtP`}),{description:r}),yn(),t()}},t[86]=i,t[87]=b,t[88]=O,t[89]=E,t[90]=yn,t[91]=Fn):Fn=t[91];let Ln=Fn,Rn=(0,Q.useRef)(Ln),zn;t[92]===Ln?zn=t[93]:(zn=()=>{Rn.current=Ln},t[92]=Ln,t[93]=zn),(0,Q.useEffect)(zn);let Bn=function(e){let t=QJ(e);if(!t||$J(t))return!1;let n=$t.getFocusedPath()??$t.getSelectedPaths()[0]??null;if(!n||n.endsWith(`/`)||Pn(n))return!1;let r=$J(n);if(!r)return!1;let i=ed(t);if(!un.current.includes(i))return!1;let a=`${t}${r}`;return on.current.includes(a)?!1:(xr({sourcePath:n,destinationPath:a,isFolder:!1}),$t.move(n,a),!0)},Vn;t[94]===Symbol.for(`react.memo_cache_sentinel`)?(Vn=e=>{let t=e??Ee.current;!t||Ee.current!==t||(t.disposeCommitListener(),Ee.current=null)},t[94]=Vn):Vn=t[94];let Hn=Vn,Wn;t[95]!==i||t[96]!==Hn||t[97]!==l||t[98]!==c||t[99]!==yn?(Wn=async function(e,t){let n=t===void 0?{}:t,r=n.updateUi??!0,a=n.restoreLocation??r;Hn(e),r&&G(e.renamePath);try{let t=await fetch(`/api/delete-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:e.kind,path:e.createdPath})});if(!t.ok&&t.status!==404){let n=e.kind,a=e.createdPath,o=await kt(t,i({id:`EcM3k7`,values:{kind:n}}));if(o.ok)return;let s=o.title,c=i({id:`YPFBfr`,values:{detail:s,kind:n,createdPath:a}});r?_s.error(c):console.warn(`[FileTree] cleanup pending create failed: ${c}`),r&&(G(null),yn());return}}catch(t){if(console.warn(`[FileTree] cleanup pending create failed:`,t),r){let t=e.kind,n=e.createdPath;_s.error(i({id:`_TDESN`,values:{kind:t,createdPath:n}}))}r&&(G(null),yn());return}r&&(e.kind===`file`?l(e.createdPath):c([ct(e.createdPath)],{force:!0})),r&&j(t=>{let n=cP(t,e.kind===`file`?[e.createdPath]:[],e.kind===`folder`?e.createdPath:void 0);return kn(n),n}),hl([`files`,`backlinks`,`graph`]),a&&(window.location.hash=e.previousHash),r&&G(null)},t[95]=i,t[96]=Hn,t[97]=l,t[98]=c,t[99]=yn,t[100]=Wn):Wn=t[100];let Gn=Wn,Kn,qn;t[101]===Symbol.for(`react.memo_cache_sentinel`)?(Kn=()=>()=>{let e=Ee.current;e&&Oe.current(e,{restoreLocation:!1,updateUi:!1}).catch(oX)},qn=[],t[101]=Kn,t[102]=qn):(Kn=t[101],qn=t[102]),(0,Q.useEffect)(Kn,qn);let Jn;t[103]!==i||t[104]!==bt?(Jn=()=>{let e=!0,t=null,n=OJ(async function(){t?.abort();let n=new AbortController;t=n,Ge.current+=1;for(let e of We.current.values())e.abort();We.current.clear(),He.current.clear();try{let t=await fetch(BY(``,$e.current),{signal:n.signal,headers:kJ});if(AJ(t)){let r=tt(),i=!1,{entries:a,truncated:o}=await NJ(t,{onBatch:t=>{if(!e||n.signal.aborted)return;let a=$c(Zc(t),r);a.length!==0&&(j(e=>FJ(e,a)),i||(i=!0,F(null),gt(),N(!1)))}});if(!e)return;let s=Zc(a),c=$c(s,r);j(e=>IJ(e,``,c,Be.current)),F(null),gt(),V(o?a.length:null),U(s.length),Ye.current()}else{let n=await kt(t,i({id:`8RtNI0`}));if(!e)return;if(!n.ok)vt(n.title),V(null);else{let e=mn.safeParse(n.body);if(!e.success)vt(i({id:`HlmZBk`})),V(null);else{let t=Zc(e.data.documents),n=$c(t,tt());j(e=>IJ(e,``,n,Be.current)),F(null),gt(),V(e.data.truncated===!0?e.data.documents.length:null),U(t.length),Ye.current()}}}}catch(t){let r=t;if(n.signal.aborted)return;e&&(r instanceof jJ?vt(r.message):bt()),console.warn(`[FileTree] fetch failed:`,r)}e&&N(!1)},()=>t?.abort());nt.current=()=>n.request(),n.request();let r=()=>{document.visibilityState===`visible`&&n.request()};window.addEventListener(`focus`,r),window.addEventListener(`visibilitychange`,r);let a=gl(e=>{e.includes(`files`)&&n.request()});return()=>{e=!1,nt.current=null,n.dispose();for(let e of We.current.values())e.abort();We.current.clear(),window.removeEventListener(`focus`,r),window.removeEventListener(`visibilitychange`,r),a()}},t[103]=i,t[104]=bt,t[105]=Jn):Jn=t[105];let Yn;t[106]===i?Yn=t[107]:(Yn=[i],t[106]=i,t[107]=Yn),(0,Q.useEffect)(Jn,Yn);let Xn=(0,Q.useRef)(!0),Zn;t[108]===Symbol.for(`react.memo_cache_sentinel`)?(Zn=()=>{if(Xn.current){Xn.current=!1;return}nt.current?.()},t[108]=Zn):Zn=t[108];let Qn;t[109]!==Vt||t[110]!==Ut||t[111]!==Ht?(Qn=[Vt,Ht,Ut],t[109]=Vt,t[110]=Ut,t[111]=Ht,t[112]=Qn):Qn=t[112],(0,Q.useEffect)(Zn,Qn);let $n,er;t[113]===Symbol.for(`react.memo_cache_sentinel`)?($n=()=>{let e=!0;return fetch(`/api/workspace`).then(async t=>{let n=await t.json();if(!e||!t.ok)return;let r=f(An,n,`workspace`,null);r&&oe({contentDir:r.contentDir,pathSeparator:r.pathSeparator})}).catch(aX),()=>{e=!1}},er=[],t[113]=$n,t[114]=er):($n=t[113],er=t[114]),(0,Q.useEffect)($n,er);let tr;t[115]!==_n||t[116]!==$t||t[117]!==an?(tr=()=>{if(ke.current===an){ke.current=null;return}$t.resetPaths(on.current,{initialExpandedPaths:_n()})},t[115]=_n,t[116]=$t,t[117]=an,t[118]=tr):tr=t[118];let nr;t[119]!==$t||t[120]!==an?(nr=[$t,an],t[119]=$t,t[120]=an,t[121]=nr):nr=t[121],(0,Q.useEffect)(tr,nr),vJ($t,Pt,fn,je,an);let rr,ir;t[122]!==$t||t[123]!==r?(rr=()=>{if(!r)return;let e=0,t=0,n=()=>rt.current?.querySelector(`file-tree-container`)?.shadowRoot?.querySelector(`[data-file-tree-virtualized-list]`)??null,i=()=>{let e=n();if(!e)return;let t=Number.parseFloat(e.style.height);Number.isFinite(t)&&r(t)},a=()=>{cancelAnimationFrame(e),e=requestAnimationFrame(i)},o=new MutationObserver(i),s=()=>{let e=n();e?(o.observe(e,{attributes:!0,attributeFilter:[`style`]}),i()):t=requestAnimationFrame(s)};s();let c=$t.subscribe(a);return window.addEventListener(`resize`,a),()=>{cancelAnimationFrame(e),cancelAnimationFrame(t),o.disconnect(),c(),window.removeEventListener(`resize`,a)}},ir=[r,$t],t[122]=$t,t[123]=r,t[124]=rr,t[125]=ir):(rr=t[124],ir=t[125]),(0,Q.useEffect)(rr,ir);let ar;t[126]===Symbol.for(`react.memo_cache_sentinel`)?(ar=()=>{ce(!1)},t[126]=ar):ar=t[126];let or;t[127]===Nt?or=t[128]:(or=[Nt],t[127]=Nt,t[128]=or),(0,Q.useEffect)(ar,or);let sr,cr;t[129]===se?(sr=t[130],cr=t[131]):(sr=()=>{le.current=se;for(let e of de.current)e()},cr=[se],t[129]=se,t[130]=sr,t[131]=cr),(0,Q.useEffect)(sr,cr);let lr;t[132]!==Pt||t[133]!==M||t[134]!==$t?(lr=()=>{M||!Pt||Qq($t,Pt)},t[132]=Pt,t[133]=M,t[134]=$t,t[135]=lr):lr=t[135];let dr;t[136]!==fn||t[137]!==Pt||t[138]!==M||t[139]!==$t||t[140]!==an?(dr=[Pt,fn,an,M,$t],t[136]=fn,t[137]=Pt,t[138]=M,t[139]=$t,t[140]=an,t[141]=dr):dr=t[141],(0,Q.useEffect)(lr,dr);let fr,mr;t[142]===$t?(fr=t[143],mr=t[144]):(fr=()=>$t.subscribe(()=>{if(!$t.isSearchOpen())for(let e of Te.current){let t=hJ($t.getItem(e));t&&!t.isExpanded()&&t.expand()}}),mr=[$t],t[142]=$t,t[143]=fr,t[144]=mr),(0,Q.useEffect)(fr,mr);let hr,gr;t[145]===$t?(hr=t[146],gr=t[147]):(hr=()=>$t.subscribe(()=>Je.current()),gr=[$t],t[145]=$t,t[146]=hr,t[147]=gr),(0,Q.useEffect)(hr,gr);let _r,vr;t[148]===$t?(_r=t[149],vr=t[150]):(_r=()=>$t.onMutation(`remove`,e=>{let t=Ee.current;!t||e.path!==t.renamePath||Oe.current(t)}),vr=[$t],t[148]=$t,t[149]=_r,t[150]=vr),(0,Q.useEffect)(_r,vr);let yr;t[151]!==b||t[152]!==u||t[153]!==d||t[154]!==ve||t[155]!==O||t[156]!==E||t[157]!==p||t[158]!==Dn||t[159]!==_?(yr=async(e,t,n,r,i)=>{let a=t===void 0?[]:t,o=n===void 0?[]:n,s=i===void 0?[]:i,c=r?.docName??be.current,l=new Map,f=new Map;for(let e of fe.current){if(tl(e)){let t=o.find(t=>t.fromPath===nd(e.docName,e.docExt))?.toPath;t&&l.set(e.docName,t);continue}if(fl(e)){let t=o.find(t=>t.fromPath===e.path)?.toPath;t&&Jc(t)&&f.set(e.path,Hu(t))}}let m=c?l.get(c)??null:null,h=r?.folderPath??(ut.current?.kind===`folder`?ut.current.folderPath:null),g=h?ye(h,a):null,v=r?.assetPath??(ut.current?.kind===`asset`?ut.current.assetPath:null),y=v?f.get(v)??null:null,x=m?null:y??dP(c,e),S=m??(v?y?null:o.find(e=>e.fromPath===v)?.toPath??ye(v,a):null);De(e);let C=[...fP(e,d(),p),...l.keys()];await Promise.all(C.map(e=>u(e)));for(let t of e)b(t.toDocName);for(let e of f.values())b(e);_(e,a,o);let w=null;j(t=>{let n=sP(t,e,a,o,s);return w=n,Dn(t,n,e,o),kn(n),n}),h&&g&&g!==h?O(g):x&&x!==c?(E(x),eY(x)):S&&(m||S!==v)&&ve(S,w??fe.current),hl([`files`,`backlinks`,`graph`])},t[151]=b,t[152]=u,t[153]=d,t[154]=ve,t[155]=O,t[156]=E,t[157]=p,t[158]=Dn,t[159]=_,t[160]=yr):yr=t[160];let br=yr;async function xr(e){let t=!e.isFolder&&Pn(e.sourcePath),n=t?e.sourcePath:qu(e.sourcePath,e.isFolder);G(n),F(null);try{let r=Yc(e.sourcePath,e.destinationPath,e.isFolder),a=!e.isFolder&&!t&&!Jc(r.destinationPath),o=t||a?r.destinationPath:qu(r.destinationPath,e.isFolder),s=e.isFolder?{kind:`folder`,fromPath:cd(n),toPath:cd(o)}:t||a?{kind:`asset`,fromPath:n,toPath:o}:{kind:`file`,fromPath:sd(n,fe.current),toPath:o},c={docName:be.current,folderPath:ut.current?.kind===`folder`?ut.current.folderPath:null,assetPath:ut.current?.kind===`asset`?ut.current.assetPath:null},l=await kt(await fetch(`/api/rename-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(s)}),i({id:`gijbne`}));if(!l.ok){_s.error(l.title),yn();let e=Ee.current;e&&e.renamePath===n?await Gn(e):Hn(),G(null);return}let u=f(pr,l.body,`rename-path`,{renamed:[],renamedAssets:[]});try{await br(u.renamed,e.isFolder?[{fromPath:cd(n),toPath:cd(o)}]:[],u.renamedAssets,c,!e.isFolder&&!t&&!a?u.renamed.flatMap(e=>{let t=Xc(o);return t?[{toDocName:e.toDocName,docExt:t}]:[]}):[])}catch(e){console.warn(`[FileTree] post-rename reconciliation failed`,{err:e,sourceTreePath:n,destinationTreePath:o,renamedCount:u.renamed.length,renamedAssetCount:u.renamedAssets.length}),_s.error(i({id:`dDpCOp`}))}Hn(),G(null)}catch(e){console.warn(`[FileTree] rename failed:`,e);let t=i({id:`HIb0vl`});_s.error(t),F(t),yn();let r=Ee.current;r&&r.renamePath===n?await Gn(r):Hn(),G(null)}}let Sr;t[161]!==i||t[162]!==br||t[163]!==yn?(Sr=async function(e){let t=e.draggedPaths.map(t=>{let n=Ju(t,e.target);return t===n?null:{sourcePath:t,destinationTreePath:n}}).filter(iX);if(t.length!==0){G(t[0]?.sourcePath??null),F(null);try{let e=[],n=[],r=[],a={docName:be.current,folderPath:ut.current?.kind===`folder`?ut.current.folderPath:null,assetPath:ut.current?.kind===`asset`?ut.current.assetPath:null};for(let a of t){let t=a.sourcePath.endsWith(`/`),o=!t&&Pn(a.sourcePath),s=o?null:sd(a.sourcePath,fe.current),c=t?{kind:`folder`,fromPath:cd(a.sourcePath),toPath:cd(a.destinationTreePath)}:o?{kind:`asset`,fromPath:a.sourcePath,toPath:a.destinationTreePath}:{kind:`file`,fromPath:s??Hu(a.sourcePath),toPath:s&&Jc(s)?a.destinationTreePath:Hu(a.destinationTreePath)},l=await kt(await fetch(`/api/rename-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(c)}),i({id:`dOHMA0`}));if(!l.ok){_s.error(l.title),yn(),G(null);return}let u=f(pr,l.body,`rename-path:drop`,{renamed:[],renamedAssets:[]});e=e.concat(u.renamed),n=n.concat(u.renamedAssets),t&&r.push({fromPath:cd(a.sourcePath),toPath:cd(a.destinationTreePath)})}try{await br(e,r,n,a)}catch(r){console.warn(`[FileTree] post-move reconciliation failed`,{err:r,operationCount:t.length,renamedCount:e.length,renamedAssetCount:n.length}),_s.error(i({id:`8OxKZy`}))}G(null)}catch(e){console.warn(`[FileTree] move failed:`,e),_s.error(i({id:`HIb0vl`})),yn(),G(null)}}},t[161]=i,t[162]=br,t[163]=yn,t[164]=Sr):Sr=t[164];let Cr=Sr,wr;t[165]!==i||t[166]!==b||t[167]!==yn?(wr=async function(e,t,n){if(e.length===0||Le.current!==null)return;let r=()=>{Le.current=null,G(null)};Le.current=n,G(n),F(null);let a=[],o=0,s=0;for(let n of e){let e=new FormData;e.append(`file`,n),rd(e,t,n.name||`upload`);try{let r=await kt(await fetch(`/api/upload`,{method:`POST`,body:e}),i({id:`4Gz2wC`}));if(!r.ok){s+=1,_s.error(r.title,{description:n.name});continue}let c=f(ur,r.body,`upload:drop`,null);if(c===null){s+=1,_s.error(i({id:`4Gz2wC`}),{description:n.name});continue}let l=zu(t,c);if(c.deduped===!0){s+=1,_s.error(i({id:`4sKwf6`}),{description:l});continue}o+=1;let u=id(l,n);u&&a.push(u)}catch(e){let t=e;s+=1,console.warn(`[FileTree] external file upload failed:`,t),_s.error(t instanceof TypeError?i({id:`HIb0vl`}):i({id:`4Gz2wC`}),{description:n.name})}}try{if(a.length>0){for(let e of a)tl(e)&&b(e.docName);j(e=>{let t=new Set(e.map(Wu)),n=!1,r=[...e];for(let e of a){let i=Wu(e);Be.current.set(i,Date.now()),!t.has(i)&&(t.add(i),r.push(e),n=!0)}return n?(yn(r),kn(r),r):e})}o>0&&(hl([`files`,`backlinks`,`graph`]),nt.current?.(),_s.success(qc._({id:`v75Em9`,values:{uploadedCount:o}}),{description:t||i({id:`RSqaSd`})})),s>0&&F(o>0?qc._({id:`yH7T4q`,values:{failedCount:s}}):i({id:`4Gz2wC`})),r()}catch(e){let t=e,n=i({id:`VcqWBy`});console.warn(`[FileTree] upload post-upload reconciliation failed:`,t),_s.error(n),F(n),r()}},t[165]=i,t[166]=b,t[167]=yn,t[168]=wr):wr=t[168];let Tr=wr,Er;t[169]===Symbol.for(`react.memo_cache_sentinel`)?(Er=function(e){q({parentDir:e})},t[169]=Er):Er=t[169];let Dr=Er,Or;t[170]!==i||t[171]!==b||t[172]!==Gn||t[173]!==Hn||t[174]!==$t||t[175]!==O||t[176]!==E||t[177]!==yn||t[178]!==rn?(Or=async function(e,t,n){if(Le.current)return;let r=Ee.current;r&&Hn(r);try{let r=$u(e,t,[...rn,...un.current]);G(r.renamePath),Le.current=r.renamePath;let a=window.location.hash,o;if(e===`file`){let e=Vu(`file`,r.addPath),t={path:e};n?.template&&(t.template=n.template);let a=await kt(await fetch(`/api/create-page`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)}),i({id:`fJgQHX`}));if(!a.ok){_s.error(a.title),G(null),Le.current=null;return}let s=Hu(e),c=f(In,a.body,`create-page`,{docName:s}).docName;o=c;let l={kind:`document`,docName:c,docExt:e.toLowerCase().endsWith(`.mdx`)?`.mdx`:`.md`,modified:new Date().toISOString(),size:0};b(c),j(e=>{if(e.some(e=>tl(e)&&e.docName===c))return e;let t=[...e,l];return kn(t),Be.current.set(Wu(l),Date.now()),t}),hl([`files`,`backlinks`,`graph`]),E(c)}else{let e=cd(r.addPath),t=await kt(await fetch(`/api/create-folder`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e})}),i({id:`K1ckLX`}));if(!t.ok){_s.error(t.title),G(null),Le.current=null;return}o=f(Hr,t.body,`create-folder`,{path:e}).path;let n={kind:`folder`,path:o,modified:new Date().toISOString(),size:0};j(e=>{if(e.some(e=>dl(e)&&e.path===o))return e;let t=[...e,n];return kn(t),Be.current.set(Wu(n),Date.now()),t}),hl([`files`]),O(o)}let s=!1,c=e=>{if(e.key!==`Enter`)return;let t=Ee.current;!t||t.renamePath!==r.renamePath||queueMicrotask(()=>Hn(t))};document.addEventListener(`keydown`,c,!0),Ee.current={kind:e,renamePath:r.renamePath,createdPath:o,previousHash:a,disposeCommitListener:()=>{s||(s=!0,document.removeEventListener(`keydown`,c,!0))}},G(null),Le.current=null,$t.add(r.addPath),$t.startRenaming(r.renamePath,{removeIfCanceled:!0})}catch(e){console.warn(`[FileTree] create placeholder failed:`,e),_s.error(i({id:`S6l5dv`}));let t=Ee.current;t?await Gn(t):Hn(),G(null),Le.current=null,yn()}},t[170]=i,t[171]=b,t[172]=Gn,t[173]=Hn,t[174]=$t,t[175]=O,t[176]=E,t[177]=yn,t[178]=rn,t[179]=Or):Or=t[179];let kr=Or,Ar;t[180]===$t?Ar=t[181]:(Ar=function(e){let t=ed(e);(0,Q.startTransition)(()=>{for(let e of un.current)if(e===t||e.startsWith(t)){let t=hJ($t.getItem(e));t&&t.expand()}})},t[180]=$t,t[181]=Ar);let jr=Ar,Mr;t[182]===$t?Mr=t[183]:(Mr=function(e){let t=ed(e),n=new Set(Te.current);(0,Q.startTransition)(()=>{for(let e of[...un.current].reverse())if((e===t||e.startsWith(t))&&!n.has(e)){let t=hJ($t.getItem(e));t&&t.collapse()}})},t[182]=$t,t[183]=Mr);let Nr=Mr,Pr;t[184]===Symbol.for(`react.memo_cache_sentinel`)?(Pr=function(){return((rt.current?.querySelector(`file-tree-container`)?.shadowRoot)?.querySelector(`[aria-selected="true"][data-item-path]`))?.dataset.itemPath??null},t[184]=Pr):Pr=t[184];let Fr=Pr,Ir;t[185]!==ge||t[186]!==dn||t[187]!==o||t[188]!==s||t[189]!==Se||t[190]!==W||t[191]!==Gn||t[192]!==Cn||t[193]!==A||t[194]!==cn||t[195]!==Cr||t[196]!==xr||t[197]!==tn||t[198]!==x||t[199]!==Bn||t[200]!==Tn||t[201]!==Vt||t[202]!==Ut||t[203]!==Ht||t[204]!==rn||t[205]!==Tr?(Ir=()=>{fe.current=A,pe.current=x,be.current=o,ut.current=s,Ce.current=Se,Le.current=W,Ze.current=Vt,Qe.current=Ht,$e.current=Ut,on.current=rn,un.current=cn,Te.current=dn,Je.current=Cn,Ye.current=Tn,Oe.current=Gn,Ie.current=(e,t,n)=>{Tr(e,t,n)},it.current=e=>{if(je.current||Me.current||e.length!==1)return;let t=e[0];if(t){ce(!1);let e=tn(t),n=me.current,r=n!==null&&Hu(n)===Hu(e),i=r?n:e;me.current=null,queueMicrotask(()=>{ge(tn((r?null:Fr())??i),fe.current)})}},ot.current=e=>{Bn(e)||_s.error(e)},at.current=xr,lt.current=Cr},t[185]=ge,t[186]=dn,t[187]=o,t[188]=s,t[189]=Se,t[190]=W,t[191]=Gn,t[192]=Cn,t[193]=A,t[194]=cn,t[195]=Cr,t[196]=xr,t[197]=tn,t[198]=x,t[199]=Bn,t[200]=Tn,t[201]=Vt,t[202]=Ut,t[203]=Ht,t[204]=rn,t[205]=Tr,t[206]=Ir):Ir=t[206],(0,Q.useLayoutEffect)(Ir);let Lr,Rr;t[207]===$t?(Lr=t[208],Rr=t[209]):(Lr=()=>{let e=e=>{let t=(e.metaKey||e.ctrlKey)&&!e.altKey,n=e.key.toLowerCase(),r=t&&n===`a`,i=t&&!e.shiftKey&&n===`d`,a=t&&!e.shiftKey&&n===`c`,o=t&&!e.shiftKey&&n===`v`,s=!e.altKey&&!e.shiftKey&&(e.metaKey&&!e.ctrlKey&&n===`backspace`||!e.metaKey&&!e.ctrlKey&&n===`delete`);if(!r&&!i&&!a&&!o&&!s||NY(e.target))return;let c=rt.current,l=e.target,u=document.activeElement,d=l instanceof Node&&c?.contains(l),f=u instanceof Node&&c?.contains(u);if(!d&&!f)return;if(a){let t=AY($t,fe.current,Ce.current);if(!t)return;Re.current=t,e.preventDefault(),e.stopPropagation();return}if(o){let t=Re.current;if(!t)return;Rn.current(t),e.preventDefault(),e.stopPropagation();return}if(i){let t=AY($t,fe.current,Ce.current);if(!t)return;Rn.current(t),e.preventDefault(),e.stopPropagation();return}if(s){if(Le.current!==null)return;let t=jY($t,fe.current);if(t.length===0)return;te({targets:t}),e.preventDefault(),e.stopPropagation();return}let p=new Set([...un.current,...on.current]);je.current=!0;for(let e of p)e&&$t.getItem(e)?.select();queueMicrotask(()=>{je.current=!1}),e.preventDefault(),e.stopPropagation()};return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},Rr=[$t],t[207]=$t,t[208]=Lr,t[209]=Rr),(0,Q.useEffect)(Lr,Rr);let Br,Vr;t[210]!==A.length||t[211]!==M?(Br=()=>{if(M||A.length===0)return;let e=rt.current?.querySelector(dR)?.shadowRoot;if(!e)return;let t=rX,n=()=>{for(let n of e.querySelectorAll(`[data-item-path]`)){let e=n.dataset.itemPath;if(!e)continue;let r=t(e);n.title!==r&&(n.title=r)}let n=e.querySelector(`[data-type="context-menu-anchor"]`);if(n){let r=e.querySelector(`[data-item-context-hover="true"][data-item-path]`)?.dataset.itemPath,i=r?t(r):``;n.title!==i&&(n.title=i)}};n();let r=new MutationObserver(n);return r.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`data-item-path`,`data-item-context-hover`]}),()=>r.disconnect()},Vr=[M,A.length],t[210]=A.length,t[211]=M,t[212]=Br,t[213]=Vr):(Br=t[212],Vr=t[213]),(0,Q.useEffect)(Br,Vr);let Ur,Wr;t[214]!==A.length||t[215]!==M?(Ur=()=>{if(M||A.length===0)return;let e=rt.current?.querySelector(dR)?.shadowRoot;if(!e)return;let t=()=>kq(e);t();let n=new MutationObserver(t);return n.observe(e,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:[`data-item-path`]}),()=>n.disconnect()},Wr=[M,A.length],t[214]=A.length,t[215]=M,t[216]=Ur,t[217]=Wr):(Ur=t[216],Wr=t[217]),(0,Q.useEffect)(Ur,Wr);let Gr,Kr;t[218]!==A.length||t[219]!==M?(Gr=()=>{if(M||A.length===0)return;let e=rt.current?.querySelector(dR)?.shadowRoot;if(!e)return;let t=()=>qq(e);t();let n=new MutationObserver(t);return n.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`data-item-path`]}),()=>n.disconnect()},Kr=[M,A.length],t[218]=A.length,t[219]=M,t[220]=Gr,t[221]=Kr):(Gr=t[220],Kr=t[221]),(0,Q.useEffect)(Gr,Kr);let qr;t[222]===Symbol.for(`react.memo_cache_sentinel`)?(qr={folderCount:0,expandedCount:0},t[222]=qr):qr=t[222];let Jr=(0,Q.useRef)(qr),Yr=(0,Q.useRef)(kr),Xr=(0,Q.useRef)(Dr),Zr;t[223]===kr?Zr=t[224]:(Zr=()=>{Yr.current=kr,Xr.current=Dr},t[223]=kr,t[224]=Zr),(0,Q.useEffect)(Zr);let Qr,$r;t[225]===$t?(Qr=t[226],$r=t[227]):(Qr=()=>({startCreating(e,t){Yr.current(e,t)},startCreatingFromTemplate(e){Xr.current(e)},createFromTemplate(e,t){Yr.current(`file`,e,{template:t})},expandAll(){(0,Q.startTransition)(()=>{for(let e of un.current){let t=hJ($t.getItem(e));t&&t.expand()}})},collapseAll(){let e=new Set(Te.current);(0,Q.startTransition)(()=>{for(let t of[...un.current].reverse()){if(e.has(t))continue;let n=hJ($t.getItem(t));n&&n.collapse()}})},getFolderState(){let e=un.current,t=0;for(let n of e)hJ($t.getItem(n))?.isExpanded()&&t++;let n=e.length,r=Jr.current;if(r.folderCount===n&&r.expandedCount===t)return r;let i={folderCount:n,expandedCount:t};return Jr.current=i,i},isCreationTargetCleared(){return le.current},clearCreationTarget(){ce(!0)},subscribe(e){de.current.add(e);let t=$t.subscribe(e);return()=>{de.current.delete(e),t()}}}),$r=[$t],t[225]=$t,t[226]=Qr,t[227]=$r),(0,Q.useImperativeHandle)(n,Qr,$r);let ei;t[228]!==Hn||t[229]!==u||t[230]!==c||t[231]!==$t?(ei=async function(e,t,n){let r=PY(e,fe.current,un.current),i=Ee.current;i&&e.some(e=>FY(e,i))&&(i.kind===`file`?r.docNames.add(i.createdPath):r.folderPaths.add(i.createdPath),Hn(i));let a=new Set([...r.docNames,...t]),o=new Set([...r.folderPaths,...n]),s=new Set([...r.assetPaths,...e.filter(nX).map(tX)]);c([...[...a].map(eX),...[...o].map($Y),...[...s].map(QY)],{force:!0}),await Promise.all([...a].map(e=>u(e)));for(let t of e){let e=t.kind===`folder`?ed(t.path):t.kind===`asset`?t.path:nd(t.path,t.docExt);$t.getItem(e)&&$t.remove(e,t.kind===`folder`?{recursive:!0}:void 0)}j(e=>{let t=cP(e,[...a],void 0,[...s]);for(let e of o)t=cP(t,[],e);return kn(t),t}),hl([`files`,`backlinks`,`graph`])},t[228]=Hn,t[229]=u,t[230]=c,t[231]=$t,t[232]=ei):ei=t[232];let ti=ei,ni;t[233]!==i||t[234]!==ti?(ni=async function(e){let t=[],n=[],r=[];for(let a of e){let e=a.kind;G(a.path);let o=await kt(await fetch(`/api/delete-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:e,path:a.path})}),i({id:`7JtSLi`}));if(!o.ok)return r.length>0&&await ti(r,t,n),_s.error(o.title),!1;let s=f(zr,o.body,`delete-path`,{deletedDocNames:[]});t.push(...s.deletedDocNames),e===`folder`&&n.push(a.path),r.push(a)}return await ti(r,t,n),!0},t[233]=i,t[234]=ti,t[235]=ni):ni=t[235];let ri=ni,ii;t[236]===Symbol.for(`react.memo_cache_sentinel`)?(ii=async function(e,t,n){let r=[],i=[];for(let a of e){G(a.path);let e=pP(a,n),o=await t.shell.trashItem(e);o.ok?r.push(a):i.push({kind:a.kind,path:a.path,name:a.name,reason:cJ(o.reason),detail:o.detail})}return{trashed:r,failed:i}},t[236]=ii):ii=t[236];let ai=ii,oi;t[237]===i?oi=t[238]:(oi=async function(e){let t=[],n=[],r=[];for(let a of e){let e=a.kind;try{let o=await kt(await fetch(`/api/trash/cleanup`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:e,path:a.path})}),i({id:`DVh_Tb`}));if(!o.ok){console.warn(`[FileTree] trash-cleanup failed`,{target:`${a.kind}:${a.path}`,reason:o.title}),r.push({target:a,reason:o.title});continue}let s=f(Nn,o.body,`trash-cleanup`,{deletedDocNames:[]});t.push(...s.deletedDocNames),e===`folder`&&n.push(a.path)}catch(e){let t=e;console.warn(`[FileTree] trash-cleanup threw`,{target:`${a.kind}:${a.path}`,err:t}),r.push({target:a,reason:i({id:`r4R7AZ`})})}}if(r.length>0){let e=r.length;_s.error(i({id:`IrB5AK`,values:{failedCount:e}}),{description:i({id:`vEJDlt`})})}return r.length===e.length&&e.length>0?null:{deletedDocNames:t,deletedFolderPaths:n}},t[237]=i,t[238]=oi);let si=oi,ci;t[239]!==i||t[240]!==re||t[241]!==ti||t[242]!==ri||t[243]!==si||t[244]!==yn||t[245]!==ae?(ci=async function(e){let t=e.filter(ZY).map(e=>lP(e,fe.current)),n=t[0];if(!n)return;let r=re.filter(e=>t.some(t=>{if(t.kind===`file`){let n=`${t.path}${t.docExt??`.md`}`;return e.file===n}return t.kind===`folder`?e.file.startsWith(`${t.path}/`):!1}));if(r.length>0){let e=r.slice(0,3).map(XY),t=r.length>e.length?`, +${r.length-e.length} more`:``;_s.error(`Cannot delete files with unresolved conflicts`,{description:`Resolve the conflict on ${e.join(`, `)}${t} before deleting.`});return}G(n.path),te(null);let a=typeof window<`u`?window.okDesktop:void 0;try{if(a&&ae){let{trashed:e,failed:n}=await ai(t,a,ae);if(e.length>0){let t=await si(e);t?await ti(e,t.deletedDocNames,t.deletedFolderPaths):await ti(e,e.filter(YY).map(JY),e.filter(qY).map(KY))}n.length>0&&ne({failed:n,originalTargets:[...t]}),G(null)}else{let e=await ri(t);G(null),e||yn()}}catch(e){let t=e,n=t instanceof Error?t.message:String(t);console.warn(`[FileTree] delete failed:`,t),_s.error(i({id:`0eHrMb`}),{description:n}),G(null),yn()}},t[239]=i,t[240]=re,t[241]=ti,t[242]=ri,t[243]=si,t[244]=yn,t[245]=ae,t[246]=ci):ci=t[246];let li=ci,ui;t[247]!==i||t[248]!==ri||t[249]!==yn||t[250]!==K?(ui=async function(){if(!K)return;let e=new Set(K.failed.map(GY)),t=K.originalTargets.filter(t=>e.has(`${t.kind}:${t.path}`));if(ne(null),t.length!==0){G(t[0]?.path??null);try{let e=await ri(t);G(null),e||yn()}catch(e){let t=e,n=t instanceof Error?t.message:String(t);console.warn(`[FileTree] hard-delete fallback failed:`,t),_s.error(i({id:`0eHrMb`}),{description:n}),G(null),yn()}}},t[247]=i,t[248]=ri,t[249]=yn,t[250]=K,t[251]=ui):ui=t[251];let di=ui,fi;t[252]!==li||t[253]!==K?(fi=async function(){if(!K)return;let e=new Set(K.failed.map(WY)),t=K.originalTargets.filter(t=>e.has(`${t.kind}:${t.path}`));ne(null),await li(t)},t[252]=li,t[253]=K,t[254]=fi):fi=t[254];let pi=fi,mi=(0,Q.useRef)(li),hi;t[255]===li?hi=t[256]:(hi=()=>{mi.current=li},t[255]=li,t[256]=hi),(0,Q.useEffect)(hi);let gi,_i;t[257]===Symbol.for(`react.memo_cache_sentinel`)?(gi=()=>CJ(e=>{if(e.kind===`doc`||e.kind===`folder-index`){let t=e.docName,n=fe.current.find(e=>tl(e)&&e.docName===t);mi.current([{kind:`file`,path:t,name:t.split(`/`).pop()??t,docExt:n?.docExt}]);return}if(e.kind===`folder`){mi.current([{kind:`folder`,path:e.folderPath,name:e.folderPath.split(`/`).pop()??e.folderPath}]);return}if(e.kind===`asset`){mi.current([{kind:`asset`,path:e.assetPath,name:e.assetPath.split(`/`).pop()??e.assetPath}]);return}console.warn(JSON.stringify({event:`file-tree-menu-action-delete-unsupported-kind`,kind:e.kind}))}),_i=[],t[257]=gi,t[258]=_i):(gi=t[257],_i=t[258]),(0,Q.useEffect)(gi,_i);let vi,yi;t[259]===Symbol.for(`react.memo_cache_sentinel`)?(vi=()=>DJ(e=>{if(e.kind===`doc`||e.kind===`folder-index`){let t=e.docName,n=fe.current.find(e=>tl(e)&&e.docName===t);Rn.current({kind:`file`,path:t,name:t.split(`/`).pop()??t,docExt:n?.docExt});return}if(e.kind===`folder`){Rn.current({kind:`folder`,path:e.folderPath,name:e.folderPath.split(`/`).pop()??e.folderPath});return}console.warn(JSON.stringify({event:`file-tree-menu-action-duplicate-unsupported-kind`,kind:e.kind}))}),yi=[],t[259]=vi,t[260]=yi):(vi=t[259],yi=t[260]),(0,Q.useEffect)(vi,yi);let bi,xi;t[261]===$t?(bi=t[262],xi=t[263]):(bi=()=>TJ(e=>{if(e.kind===`doc`||e.kind===`folder-index`){let t=e.docName,n=nd(t,fe.current.find(e=>tl(e)&&e.docName===t)?.docExt);$t.startRenaming(n);return}if(e.kind===`folder`){$t.startRenaming(e.folderPath);return}if(e.kind===`asset`){$t.startRenaming(e.assetPath);return}console.warn(JSON.stringify({event:`file-tree-menu-action-rename-unsupported-kind`,kind:e.kind}))}),xi=[$t],t[261]=$t,t[262]=bi,t[263]=xi),(0,Q.useEffect)(bi,xi);let Si;t[264]===Symbol.for(`react.memo_cache_sentinel`)?(Si=function(){let e=Ae.current;e&&XJ(e),Ae.current=null},t[264]=Si):Si=t[264];let Ci=Si,wi;t[265]===Symbol.for(`react.memo_cache_sentinel`)?(wi=function(e){let t=wY(e);if(!t)return!1;let n=rt.current?.querySelector(dR)?.shadowRoot;if(!n)return!1;for(let e of n.querySelectorAll(`[data-item-path]`))if(e.dataset.itemPath===t)return!0;return!1},t[265]=wi):wi=t[265];let Ti=wi,Ei;t[266]===g?Ei=t[267]:(Ei=function(e){let t=_X(e.nativeEvent);if(!t||t.endsWith(`/`)){Ci();return}let n=fe.current.find(e=>Wu(e)===t);if(n&&fl(n)){Ci();return}let r=n&&tl(n)?n.docName:sd(t,fe.current);if(n&&tl(n)&&Un(n.size)){Ci();return}Ae.current!==r&&(Ci(),Ae.current=r,YJ(r,e=>g(e)))},t[266]=g,t[267]=Ei);let Di=Ei,Oi;t[268]!==ge||t[269]!==$t||t[270]!==O||t[271]!==E?(Oi=function(e){if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=vX(e.nativeEvent);if(!t){xX(e.nativeEvent)&&ce(!0);return}let n=t.getAttribute(`aria-selected`)===`true`,r=t.dataset.itemPath;if(!r)return;let i=t.dataset.itemType===`folder`?ed(r):r;if(t.dataset.itemType===`folder`){let t=cd(i),r=hJ($t.getItem(i));if(!n){e.preventDefault(),e.stopPropagation(),r&&!r.isExpanded()&&r.expand(),queueMicrotask(()=>O(t));return}if($t.getSelectedPaths().length!==1||window.location.hash===wl(t))return;e.preventDefault(),e.stopPropagation(),r&&!r.isExpanded()&&r.expand(),queueMicrotask(()=>O(t));return}if(!n){if(TY(i,on.current)||Ti(i)){me.current=i,setTimeout(()=>E(i,void 0,{registerPage:!0}),0);return}queueMicrotask(()=>ge(i));return}let a=sd(i,fe.current);$t.getSelectedPaths().length===1&&window.location.hash!==Ml(a)&&queueMicrotask(()=>ge(i))},t[268]=ge,t[269]=$t,t[270]=O,t[271]=E,t[272]=Oi):Oi=t[272];let ki=Oi,Ai;t[273]===Symbol.for(`react.memo_cache_sentinel`)?(Ai=function(e){Zu(e.nativeEvent)&&(e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect=`copy`,ft(!0))},t[273]=Ai):Ai=t[273];let ji=Ai,Mi;t[274]===Symbol.for(`react.memo_cache_sentinel`)?(Mi=function(e){let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||ft(!1)},t[274]=Mi):Mi=t[274];let Ni=Mi,Pi;t[275]===Tr?Pi=t[276]:(Pi=function(e){if(!Zu(e.nativeEvent))return;let t=Gu(e.nativeEvent);t.length!==0&&(e.preventDefault(),e.stopPropagation(),ft(!1),Tr(t,``,hY))},t[275]=Tr,t[276]=Pi);let Fi=Pi;if(M){let e;return t[277]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(CX,{}),t[277]=e):e=t[277],e}let Ii;t[278]!==i||t[279]!==I||t[280]!==R?(Ii=I?i(R?{id:`H-vDm3`}:{id:`09Tv5j`}):null,t[278]=i,t[279]=I,t[280]=R,t[281]=Ii):Ii=t[281];let Li=Ii;if(A.length===0){if(Li!==null){let e;return t[282]===Li?e=t[283]:(e=(0,Z.jsx)(`div`,{className:`flex flex-1 items-center justify-center py-8`,children:(0,Z.jsx)(`span`,{role:`status`,className:`select-none text-sidebar-foreground/50 text-sm`,children:Li})}),t[282]=Li,t[283]=e),e}if(P){let e;return t[284]===P?e=t[285]:(e=(0,Z.jsx)(`div`,{className:`flex flex-1 items-center justify-center py-8`,children:(0,Z.jsx)(`span`,{role:`alert`,className:`select-none text-sidebar-foreground/50 text-sm`,children:P})}),t[284]=P,t[285]=e),e}if(rl({visibility:{showHiddenFiles:Vt,showOnlyMarkdownFiles:Ht},unfilteredRootEntryCount:H,knownPageCount:S.size})===`filtered-to-zero`){let e;return t[286]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(yq,{}),t[286]=e):e=t[286],e}let e;t[287]===i?e=t[288]:(e=i({id:`5ZB7XC`}),t[287]=i,t[288]=e);let n=dt&&`bg-primary/5 ring-2 ring-primary/70 ring-inset`,r;t[289]===n?r=t[290]:(r=Y(`flex flex-1 flex-col items-center justify-center gap-3 rounded-md py-8`,n),t[289]=n,t[290]=r);let a;t[291]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(`span`,{className:`select-none text-sidebar-foreground/30 text-sm`,children:(0,Z.jsx)(J,{id:`xiv-dW`})}),t[291]=a):a=t[291];let o;t[292]===kr?o=t[293]:(o=()=>kr(`file`,``),t[292]=kr,t[293]=o);let s;t[294]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(J,{id:`6ibbCg`}),t[294]=s):s=t[294];let c;t[295]===o?c=t[296]:(c=(0,Z.jsx)(X,{variant:`link`,size:`sm`,className:`font-mono uppercase`,onClick:o,children:s}),t[295]=o,t[296]=c);let l;return t[297]!==Fi||t[298]!==e||t[299]!==r||t[300]!==c?(l=(0,Z.jsxs)(`section`,{"aria-label":e,className:r,onDragOver:ji,onDragLeave:Ni,onDrop:Fi,children:[a,c]}),t[297]=Fi,t[298]=e,t[299]=r,t[300]=c,t[301]=l):l=t[301],l}let Ri=W!==null,zi=ee?.targets[0]??null,Bi=null;if(B!==null){let e;if(t[302]!==a.locale||t[303]!==B){let n=new Intl.NumberFormat(a.locale).format(B);e=qc._({id:`LuoJWu`,values:{truncatedShownCount:B,formattedCount:n}}),t[302]=a.locale,t[303]=B,t[304]=e}else e=t[304];Bi=e}let Vi;t[305]!==P||t[306]!==Li||t[307]!==Bi?(Vi=(P||Li!==null||Bi!==null)&&(0,Z.jsxs)(Z.Fragment,{children:[Li===null?P&&(0,Z.jsx)(TX,{kind:`error`,children:P}):(0,Z.jsx)(TX,{kind:`reconnecting`,children:Li}),Bi!==null&&(0,Z.jsx)(TX,{kind:`info`,children:Bi})]}),t[305]=P,t[306]=Li,t[307]=Bi,t[308]=Vi):Vi=t[308];let Hi;t[309]===y?Hi=t[310]:(Hi=wq(y),t[309]=y,t[310]=Hi);let Ui=se?``:void 0,Wi;t[311]===Ui?Wi=t[312]:(Wi={[vY]:Ui},t[311]=Ui,t[312]=Wi);let Gi;t[313]!==Ri||t[314]!==Se||t[315]!==Nr||t[316]!==A||t[317]!==jr||t[318]!==cn||t[319]!==Ln||t[320]!==Rt||t[321]!==$t||t[322]!==zt||t[323]!==kr||t[324]!==ae?(Gi=(e,t)=>(0,Z.jsx)(IY,{item:e,context:t,anyActionBusy:Ri,workspace:ae,handoff:Rt,model:$t,okignoreBinding:zt,onStartCreating:kr,onCreateFromTemplate:(e,t)=>kr(`file`,e,{template:t}),onDuplicate:Ln,onDelete:e=>te({targets:e}),onExpandSubtree:jr,onCollapseSubtree:Nr,folderTreePaths:cn,isAsset:Se.has(e.path),documents:A}),t[313]=Ri,t[314]=Se,t[315]=Nr,t[316]=A,t[317]=jr,t[318]=cn,t[319]=Ln,t[320]=Rt,t[321]=$t,t[322]=zt,t[323]=kr,t[324]=ae,t[325]=Gi):Gi=t[325];let Ki;t[326]!==ki||t[327]!==Di||t[328]!==$t||t[329]!==Vi||t[330]!==Hi||t[331]!==Wi||t[332]!==Gi?(Ki=(0,Z.jsx)(`div`,{ref:rt,className:`flex min-h-0 flex-1 flex-col`,children:(0,Z.jsx)(_q,{header:Vi,model:$t,style:Hi,...Wi,onClickCapture:ki,onMouseMove:Di,onMouseLeave:Ci,renderContextMenu:Gi})}),t[326]=ki,t[327]=Di,t[328]=$t,t[329]=Vi,t[330]=Hi,t[331]=Wi,t[332]=Gi,t[333]=Ki):Ki=t[333];let qi=!!ee,Ji;t[334]===W?Ji=t[335]:(Ji=e=>{!e&&!W&&te(null)},t[334]=W,t[335]=Ji);let Yi;t[336]!==i||t[337]!==W||t[338]!==ee||t[339]!==li||t[340]!==zi?(Yi=ee&&zi&&(0,Z.jsx)(Ta,{...(()=>{let e=iJ(typeof window<`u`&&window.okDesktop!=null?`electron`:`web`,ee.targets);if(e)return{customTitle:e.title,customDescription:``,customDetail:e.detail,customConfirmLabel:e.confirmLabel,customConfirmLabelBusy:e.confirmLabelBusy,children:e.listedTargets?(0,Z.jsx)(`ul`,{className:`flex flex-col gap-1 font-mono text-foreground text-xs`,children:e.listedTargets.map(UY)}):null};let t=ee.targets.length,n=zi.name;return{itemName:t===1?zi.kind===`folder`?`${zi.name}/`:zi.kind===`file`?`${zi.name}${zi.docExt??`.md`}`:zi.name:void 0,customTitle:t>1?i({id:`abiHje`}):void 0,customDescription:t>1?i({id:`WMIKXK`,values:{targetCount:t}}):zi.kind===`folder`?i({id:`a5W0q0`,values:{folderName:n}}):void 0}})(),isSubmitting:W!==null,onDelete:()=>li(ee.targets)}),t[336]=i,t[337]=W,t[338]=ee,t[339]=li,t[340]=zi,t[341]=Yi):Yi=t[341];let Xi;t[342]!==qi||t[343]!==Ji||t[344]!==Yi?(Xi=(0,Z.jsx)(Vs,{open:qi,onOpenChange:Ji,children:Yi}),t[342]=qi,t[343]=Ji,t[344]=Yi,t[345]=Xi):Xi=t[345];let Zi=!!K,Qi;t[346]===W?Qi=t[347]:(Qi=e=>{!e&&!W&&ne(null)},t[346]=W,t[347]=Qi);let $i;t[348]!==W||t[349]!==di||t[350]!==pi||t[351]!==K?($i=K&&(0,Z.jsx)(fJ,{failedTargets:K.failed,isSubmitting:W!==null,onDeletePermanently:di,onRetry:pi,onCancel:()=>ne(null)}),t[348]=W,t[349]=di,t[350]=pi,t[351]=K,t[352]=$i):$i=t[352];let ea;t[353]!==Zi||t[354]!==Qi||t[355]!==$i?(ea=(0,Z.jsx)(Vs,{open:Zi,onOpenChange:Qi,children:$i}),t[353]=Zi,t[354]=Qi,t[355]=$i,t[356]=ea):ea=t[356];let ta=ie!==null,na;t[357]===Symbol.for(`react.memo_cache_sentinel`)?(na=e=>{e||q(null)},t[357]=na):na=t[357];let ra=ie?.parentDir??``,ia;t[358]!==ta||t[359]!==ra?(ia=(0,Z.jsx)(Dh,{open:ta,onOpenChange:na,kind:`file`,initialDir:ra,defaultToTemplate:!0}),t[358]=ta,t[359]=ra,t[360]=ia):ia=t[360];let oa;return t[361]!==Ki||t[362]!==Xi||t[363]!==ea||t[364]!==ia?(oa=(0,Z.jsxs)(Z.Fragment,{children:[Ki,Xi,ea,ia]}),t[361]=Ki,t[362]=Xi,t[363]=ea,t[364]=ia,t[365]=oa):oa=t[365],oa}function UY(e){return(0,Z.jsx)(`li`,{"data-testid":`delete-target-row`,children:aJ(e)},`${e.kind}:${e.path}`)}function WY(e){return`${e.kind}:${e.path}`}function GY(e){return`${e.kind}:${e.path}`}function KY(e){return e.path}function qY(e){return e.kind===`folder`}function JY(e){return e.path}function YY(e){return e.kind===`file`}function XY(e){return e.file}function ZY(e){return!ul(e.path)}function QY(e){return ke(e)}function $Y(e){return ct(e)}function eX(e){return mt(e)}function tX(e){return e.path}function nX(e){return e.kind===`asset`}function rX(e){return e.endsWith(`/`)?e.slice(0,-1):e}function iX(e){return!!e}function aX(e){console.warn(`[FileTree] /api/workspace fetch failed:`,e)}function oX(e){console.warn(`[FileTree] unmount cleanup failed:`,e)}function sX(e){_s.error(e)}function cX(){}function lX(e){return _s.error(e)}function uX(){}function dX(){}function fX(){}function pX(){}function mX(){}async function hX(){}function gX(e){return Wu(e)}function _X(e){return vX(e)?.dataset.itemPath??null}function vX(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&t.dataset.itemPath)return t;return null}function yX(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&t.matches(`[data-file-tree-virtualized-root]`))return t;return null}function bX(e){let t=vX(e);if(t){let e=t.dataset.itemPath;if(!e)return null;let n=t.dataset.itemType===`folder`,r=Ku(e,n);return{parentDir:r,row:t,root:null,busyPath:n?ed(r):e}}return xX(e)?{parentDir:``,row:null,root:yX(e),busyPath:hY}:null}function xX(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&t.matches(`[data-file-tree-virtualized-scroll]`))return!0;return!1}var SX=[`w-3/4`,`w-2/3`,`w-4/5`,`w-1/2`,`w-3/5`,`w-2/3`];function CX(){let e=(0,$.c)(5),{_:t}=At(),n;e[0]===t?n=e[1]:(n=t({id:`5Tk8Fb`}),e[0]=t,e[1]=n);let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=SX.map(wX),e[2]=r):r=e[2];let i;return e[3]===n?i=e[4]:(i=(0,Z.jsx)(`div`,{className:`flex flex-1 flex-col gap-1 px-2 py-2`,role:`status`,"aria-busy":`true`,"aria-label":n,children:r}),e[3]=n,e[4]=i),i}function wX(e,t){return(0,Z.jsxs)(`div`,{className:`flex h-6 items-center gap-2`,children:[(0,Z.jsx)(Ja,{className:`h-3 w-3 shrink-0 rounded-sm`}),(0,Z.jsx)(Ja,{className:`h-3 ${e}`})]},t)}function TX(e){let t=(0,$.c)(14),{kind:n,children:r}=e,i=n===`error`?cs:n===`reconnecting`?os:rs,a=n===`error`?`alert`:`status`,o=n===`error`?`text-destructive`:`text-muted-foreground`,s;t[0]===o?s=t[1]:(s=Y(`mx-2 mb-1 flex items-start gap-1.5 rounded-md bg-muted/50 px-2 py-1.5 text-xs leading-snug`,o),t[0]=o,t[1]=s);let c=n===`reconnecting`&&`animate-spin motion-reduce:animate-none`,l;t[2]===c?l=t[3]:(l=Y(`mt-0.5 size-3.5 shrink-0`,c),t[2]=c,t[3]=l);let u;t[4]!==i||t[5]!==l?(u=(0,Z.jsx)(i,{"aria-hidden":`true`,className:l}),t[4]=i,t[5]=l,t[6]=u):u=t[6];let d;t[7]===r?d=t[8]:(d=(0,Z.jsx)(`span`,{className:`min-w-0`,children:r}),t[7]=r,t[8]=d);let f;return t[9]!==a||t[10]!==s||t[11]!==u||t[12]!==d?(f=(0,Z.jsxs)(`span`,{role:a,className:s,children:[u,d]}),t[9]=a,t[10]=s,t[11]=u,t[12]=d,t[13]=f):f=t[13],f}function EX(e){return e?qc._({id:`wTcjov`}):null}function DX(e){let t=(0,$.c)(23),{_:n}=At(),r=Io(),i=_a();if(r)return null;let{input:a,installStates:o,dispatch:s}=e,c=a===null,l,u,d,f,p,m;if(t[0]!==n||t[1]!==s||t[2]!==a||t[3]!==c||t[4]!==o||t[5]!==i){m=Symbol.for(`react.early_return_sentinel`);bb0:{let e=EX(c),r;t[12]===o?r=t[13]:(r=e=>o[e.id]?.installed===!0,t[12]=o,t[13]=r);let h=la.filter(r),g=h.length>0,_=i!==null;if(!g&&!_){m=null;break bb0}let v=i?Sa(i.installedClis):[];u=SP,t[14]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsxs)(TP,{children:[(0,Z.jsx)(No,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`O7_W_a`})]}),t[14]=p):p=t[14],l=EP,d=_?(0,Z.jsxs)(xP,{"aria-label":n({id:`ALhMYW`}),children:[(0,Z.jsx)(OP,{children:(0,Z.jsx)(J,{id:`ALhMYW`})}),v.map(t=>{let{displayName:r}=Vr[t];return(0,Z.jsxs)(wP,{onSelect:()=>{a!==null&&i.launchInTerminal(a,t)},disabled:c,"data-testid":`empty-space-open-in-terminal-${t}`,"aria-label":n(e?{id:`AIn2Yv`,values:{displayName:r,hint:e}}:{id:`QYfQdv`,values:{displayName:r}}),children:[(0,Z.jsx)(va,{id:ga(t),"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:r}),e?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t)})]}):null,f=g?(0,Z.jsxs)(Z.Fragment,{children:[_?(0,Z.jsx)(kP,{}):null,(0,Z.jsxs)(xP,{"aria-label":n({id:`BBqGS9`}),children:[(0,Z.jsx)(OP,{children:(0,Z.jsx)(J,{id:`BBqGS9`})}),h.map(t=>{let r=!c,{displayName:i}=t,o=n(e?{id:`1ZpfyB`,values:{displayName:i,hint:e}}:{id:`WqLq6M`,values:{displayName:i}});return(0,Z.jsxs)(wP,{disabled:!r,onSelect:()=>{a&&s(t.id,a)},"data-testid":`empty-space-open-in-${t.id}`,"aria-label":o,children:[(0,Z.jsx)(va,{id:t.id,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:t.displayName}),e?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t.id)})]})]}):null}t[0]=n,t[1]=s,t[2]=a,t[3]=c,t[4]=o,t[5]=i,t[6]=l,t[7]=u,t[8]=d,t[9]=f,t[10]=p,t[11]=m}else l=t[6],u=t[7],d=t[8],f=t[9],p=t[10],m=t[11];if(m!==Symbol.for(`react.early_return_sentinel`))return m;let h;t[15]!==l||t[16]!==d||t[17]!==f?(h=(0,Z.jsxs)(l,{children:[d,f]}),t[15]=l,t[16]=d,t[17]=f,t[18]=h):h=t[18];let g;return t[19]!==u||t[20]!==p||t[21]!==h?(g=(0,Z.jsxs)(u,{children:[p,h]}),t[19]=u,t[20]=p,t[21]=h,t[22]=g):g=t[22],g}async function OX(e){try{let t=await e.project.listRecent(),n=e.config.projectPath;if(t.some(e=>e.path!==n))return null;let r=await _T();return e.config.freshlyCreated?r:r===0?0:null}catch(e){return console.warn(`[onboarding-card-visible] fresh-project probe failed; suppressing card`,e),null}}function kX(e){let t=(0,$.c)(4),n=e===void 0?pT:e,{initialized:r,dismissed:i,completed:a}=(0,Q.useSyncExternalStore)(n.subscribe,n.getSnapshot,n.getSnapshot),o=i||a,s=!r&&!o,c,l;return t[0]!==s||t[1]!==n?(c=()=>{if(!s)return;let e=window.okDesktop;if(e==null)return;let t=!1;return OX(e).then(e=>{!t&&e!==null&&n.activate(e)}),()=>{t=!0}},l=[s,n],t[0]=s,t[1]=n,t[2]=c,t[3]=l):(c=t[2],l=t[3]),(0,Q.useEffect)(c,l),r&&!o}function AX(e){let t=(0,$.c)(3),n=e===void 0?pT:e,r,i;t[0]===n?(r=t[1],i=t[2]):(r=()=>{if(n.getSnapshot().steps.file)return;let e=gl(e=>{e.includes(`files`)&&vT(n)});return vT(n),e},i=[n],t[0]=n,t[1]=r,t[2]=i),(0,Q.useEffect)(r,i)}var jX=3,MX=5200,NX=1500,PX=220;function FX(e){let t=(0,$.c)(14),{complete:n,label:r,shortcutId:i}=e,a;t[0]===n?a=t[1]:(a=(0,Z.jsx)(Hs,{checked:n,disabled:!0,"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none opacity-100 disabled:opacity-100`}),t[0]=n,t[1]=a);let o=n?`flex-1 text-muted-foreground/60`:`flex-1`,s;t[2]===n?s=t[3]:(s=n?(0,Z.jsxs)(`span`,{className:`sr-only`,children:[(0,Z.jsx)(J,{id:`Qj4RL5`}),` `]}):null,t[2]=n,t[3]=s);let c;t[4]!==r||t[5]!==o||t[6]!==s?(c=(0,Z.jsxs)(`span`,{className:o,children:[s,r]}),t[4]=r,t[5]=o,t[6]=s,t[7]=c):c=t[7];let l;t[8]===i?l=t[9]:(l=i?(0,Z.jsx)(I,{children:Il(i)}):null,t[8]=i,t[9]=l);let u;return t[10]!==a||t[11]!==c||t[12]!==l?(u=(0,Z.jsxs)(`li`,{className:`flex items-center gap-2 py-0.5 text-sm`,children:[a,c,l]}),t[10]=a,t[11]=c,t[12]=l,t[13]=u):u=t[13],u}function IX(e){let t=(0,$.c)(24),{store:n,lingerMs:r}=e,i=n===void 0?pT:n,a=r===void 0?MX:r,{_:o}=At(),{steps:s}=mT(i);AX(i);let[c,l]=(0,Q.useState)(0),[u,d]=(0,Q.useState)(!1),f=1+ +!!s.file+ +!!s.askedAi,p=f===jX,m,h;t[0]!==p||t[1]!==a?(m=()=>{if(!p)return;l(RX);let e=setInterval(()=>l(LX),NX),t=setTimeout(()=>{clearInterval(e),d(!0)},a);return()=>{clearInterval(e),clearTimeout(t)}},h=[p,a],t[0]=p,t[1]=a,t[2]=m,t[3]=h):(m=t[2],h=t[3]),(0,Q.useEffect)(m,h);let g,_;t[4]!==u||t[5]!==i?(g=()=>{if(!u)return;let e=setTimeout(()=>i.markCompleted(),PX);return()=>clearTimeout(e)},_=[u,i],t[4]=u,t[5]=i,t[6]=g,t[7]=_):(g=t[6],_=t[7]),(0,Q.useEffect)(g,_);let v;t[8]!==o||t[9]!==p?(v=p?o({id:`7jIIFX`}):``,t[8]=o,t[9]=p,t[10]=v):v=t[10];let y;t[11]===v?y=t[12]:(y=(0,Z.jsx)(`div`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:v}),t[11]=v,t[12]=y);let b;t[13]!==p||t[14]!==c||t[15]!==f||t[16]!==u||t[17]!==s.askedAi||t[18]!==s.file||t[19]!==i?(b=p?(0,Z.jsxs)(`section`,{"aria-hidden":!0,className:Y(`mx-2 mb-1 flex items-center gap-3 rounded-lg border bg-card px-4 py-3 text-card-foreground`,`motion-reduce:animate-none motion-reduce:duration-0`,u?`animate-out fade-out-0 zoom-out-95 fill-mode-forwards duration-200`:`animate-in fade-in-0 zoom-in-95 duration-300`),children:[(0,Z.jsx)(FS,{size:36,celebrateSignal:c}),(0,Z.jsx)(`span`,{className:`font-medium text-sm`,children:(0,Z.jsx)(J,{id:`7jIIFX`})})]}):(0,Z.jsxs)(`section`,{"aria-labelledby":`onboarding-card-heading`,className:`mx-2 mb-1 rounded-lg border bg-card px-4 py-3 text-card-foreground`,children:[(0,Z.jsxs)(`header`,{className:`mb-3 flex items-center justify-between`,children:[(0,Z.jsx)(`h2`,{id:`onboarding-card-heading`,className:`font-medium text-sm`,children:(0,Z.jsx)(J,{id:`Y1QMlM`})}),(0,Z.jsx)(`span`,{className:`text-muted-foreground/60 text-xs tabular-nums`,children:`${f} / ${jX}`})]}),(0,Z.jsxs)(`ul`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(FX,{complete:!0,label:(0,Z.jsx)(J,{id:`4E9jPa`})}),(0,Z.jsx)(FX,{complete:s.file,label:(0,Z.jsx)(J,{id:`6ibbCg`}),shortcutId:`new-item`}),(0,Z.jsx)(FX,{complete:s.askedAi,label:(0,Z.jsx)(J,{id:`xWEvuo`}),shortcutId:`open-ask-ai`})]}),(0,Z.jsx)(`footer`,{className:`-mb-1 mt-2 flex justify-end`,children:(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`sm`,className:`h-auto px-2 py-1 text-muted-foreground text-xs`,onClick:()=>i.dismiss(),children:(0,Z.jsx)(J,{id:`1QfxQT`})})})]}),t[13]=p,t[14]=c,t[15]=f,t[16]=u,t[17]=s.askedAi,t[18]=s.file,t[19]=i,t[20]=b):b=t[20];let x;return t[21]!==y||t[22]!==b?(x=(0,Z.jsxs)(Z.Fragment,{children:[y,b]}),t[21]=y,t[22]=b,t[23]=x):x=t[23],x}function LX(e){return e+1}function RX(e){return e+1}function zX(){let e=(0,$.c)(1);if(!kX())return null;let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(IX,{}),e[0]=t):t=e[0],t}function BX(e){return e===null?null:e.kind===`local`?e.name:e.ref}function VX(e,t){if(e.length===0)return null;let n=`origin/${e}`;return t.includes(n)?n:t.find(t=>Br(t)===e)??null}function HX(e){switch(e){case`branch-exists`:return{id:`wzq9Rv`};case`already-checked-out`:return{id:`ljHjfg`};case`path-exists`:return{id:`mYzDD_`};case`invalid-branch`:return{id:`r-OJYm`};case`no-git`:return{id:`CFnavk`};default:return{id:`-zA2E7`}}}function UX(e){let t=(0,$.c)(71),{open:n,onOpenChange:r,bridge:i,currentBranch:a,branches:o,existingWorktreeBranches:s,remoteBranches:c,behindByBranch:l,initialBranchName:u}=e,d=o===void 0?[]:o,f=c===void 0?[]:c,p=u===void 0?``:u,{_:m}=At(),h=(0,Q.useId)(),g=(0,Q.useId)(),_=(0,Q.useId)(),v=(0,Q.useId)(),y=(0,Q.useId)(),b=(0,Q.useId)(),[x,S]=(0,Q.useState)(``),C;t[0]===a?C=t[1]:(C=a===null?null:{kind:`local`,name:a},t[0]=a,t[1]=C);let[w,T]=(0,Q.useState)(C),[E,D]=(0,Q.useState)(!1),[O,k]=(0,Q.useState)(``),[A,j]=(0,Q.useState)(!1),[M,N]=(0,Q.useState)(null),P=(0,Q.useRef)(null),F=(0,Q.useRef)(null),I,L;t[2]!==a||t[3]!==p||t[4]!==n?(I=()=>{if(!n)return;S(p),T(a===null?null:{kind:`local`,name:a}),D(!1),k(``),j(!1),N(null);let e=requestAnimationFrame(()=>P.current?.focus());return()=>cancelAnimationFrame(e)},L=[n,a,p],t[2]=a,t[3]=p,t[4]=n,t[5]=I,t[6]=L):(I=t[5],L=t[6]),(0,Q.useEffect)(I,L);let R=x.trim(),z=!A&&R.length>0,B=R.length>0&&d.includes(R),V=B?null:VX(R,f),H=V!==null,U=B||H,W=B&&(s?.has(R)??!1),G=d.filter(e=>e.toLowerCase().startsWith(R.toLowerCase())),ee=!A&&G.length>0&&!U,te=(a!==null&&!d.includes(a)?[a,...d]:d).map(JX),K=f.map(qX),ne=BX(w),re=O.trim().toLowerCase(),ie=re===``?te:te.filter(e=>e.name.toLowerCase().includes(re)),ae=re===``?K:K.filter(e=>e.ref.toLowerCase().includes(re)),se=re!==``&&ie.length===0&&ae.length===0,le=async function(e){if(e.preventDefault(),z){j(!0),N(null);try{let e=H?{branch:R,createBranch:!0,remoteRef:V}:B?{branch:R,createBranch:!1}:{branch:R,createBranch:!0,baseBranch:w?.kind===`local`?w.name:void 0,baseRef:w?.kind===`remote`?w.ref:void 0},t=await i.worktree.create(e);if(!t.ok){N(HX(t.reason)),j(!1);return}mg(),r(!1),await i.project.open({path:t.path,target:`new-window`,entryPoint:`worktree`})}catch(e){console.warn(`[NewWorktreeDialog] worktree create/open failed:`,e),_s.error(m({id:`vAYoCZ`})),j(!1)}}},ue=Vs,de;t[7]!==A||t[8]!==r?(de=e=>{A||r(e)},t[7]=A,t[8]=r,t[9]=de):de=t[9];let fe=Ls,pe;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,Z.jsx)(Is,{children:(0,Z.jsx)(J,{id:`DXd9LM`})}),t[10]=pe):pe=t[10];let me;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,Z.jsxs)(Bs,{children:[pe,(0,Z.jsx)(Fs,{children:(0,Z.jsx)(J,{id:`NEzPEh`})})]}),t[11]=me):me=t[11];let he=Rs,ge;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,Z.jsx)(J,{id:`ng2Ibo`}),t[12]=ge):ge=t[12];let _e;t[13]===g?_e=t[14]:(_e=(0,Z.jsx)(Fc,{htmlFor:g,children:ge}),t[13]=g,t[14]=_e);let ve;t[15]===m?ve=t[16]:(ve=m({id:`IX_uXB`}),t[15]=m,t[16]=ve);let ye;t[17]===M?ye=t[18]:(ye=e=>{S(e.target.value),M!==null&&N(null)},t[17]=M,t[18]=ye);let be=M!==null,xe=M===null?y:`${y} ${b}`,Se;t[19]!==x||t[20]!==A||t[21]!==g||t[22]!==ve||t[23]!==ye||t[24]!==be||t[25]!==xe?(Se=(0,Z.jsx)(Gc,{id:g,ref:P,value:x,placeholder:ve,onChange:ye,disabled:A,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-invalid":be,"aria-describedby":xe,"data-testid":`new-worktree-branch`}),t[19]=x,t[20]=A,t[21]=g,t[22]=ve,t[23]=ye,t[24]=be,t[25]=xe,t[26]=Se):Se=t[26];let Ce=R.length>0?(0,Z.jsxs)(`p`,{id:y,className:`flex items-start gap-1.5 text-1sm text-muted-foreground`,"data-testid":W?`new-worktree-mode-existing-worktree`:H?`new-worktree-mode-remote-checkout`:B?`new-worktree-mode-checkout`:`new-worktree-mode-create`,children:[W?(0,Z.jsx)(Bo,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-amber-600 dark:text-amber-400`}):H?(0,Z.jsx)(oo,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-violet-600 dark:text-violet-400`}):B?(0,Z.jsx)(ea,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-blue-600 dark:text-blue-400`}):(0,Z.jsx)(rt,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-green-600 dark:text-green-400`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1`,children:W?(0,Z.jsx)(J,{id:`QAi7Q9`,values:{trimmed:R},components:{0:(0,Z.jsx)(`code`,{className:`font-mono break-words`})}}):H?(0,Z.jsx)(J,{id:`oAGN8p`,values:{remoteCheckoutRef:V,trimmed:R},components:{0:(0,Z.jsx)(`code`,{className:`font-mono break-words`}),1:(0,Z.jsx)(`code`,{className:`font-mono break-words`}),2:(0,Z.jsx)(`code`,{className:`font-mono`})}}):B?(0,Z.jsx)(J,{id:`b4VvP-`,values:{trimmed:R},components:{0:(0,Z.jsx)(`code`,{className:`font-mono break-words`}),1:(0,Z.jsx)(`code`,{className:`font-mono`})}}):ne===null?(0,Z.jsx)(J,{id:`t4sFKC`,values:{trimmed:R},components:{0:(0,Z.jsx)(`code`,{className:`font-mono break-words`}),1:(0,Z.jsx)(`code`,{className:`font-mono`})}}):(0,Z.jsx)(J,{id:`dGAdpH`,values:{trimmed:R,currentBaseLabel:ne},components:{0:(0,Z.jsx)(`code`,{className:`font-mono break-words`}),1:(0,Z.jsx)(`code`,{className:`font-mono break-words`}),2:(0,Z.jsx)(`code`,{className:`font-mono`})}})})]}):null,we=ee?(0,Z.jsx)(`div`,{className:`max-h-40 overflow-y-auto rounded-md border bg-popover p-1 shadow-xs`,"data-testid":`new-worktree-branch-list`,children:G.map(e=>(0,Z.jsxs)(X,{type:`button`,variant:`ghost`,size:`sm`,tabIndex:-1,onClick:()=>{S(e),M!==null&&N(null),P.current?.focus()},"data-testid":`new-worktree-branch-option-${e}`,className:`h-8 w-full justify-start gap-2 font-normal`,children:[(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-left`,children:e})]},e))}):null,Te=U?null:(0,Z.jsxs)(`div`,{className:`mt-1 flex flex-col gap-2`,children:[(0,Z.jsx)(Fc,{id:v,htmlFor:_,children:(0,Z.jsx)(J,{id:`ZWwYwM`})}),(0,Z.jsxs)(oe,{open:E,onOpenChange:e=>{D(e),e||k(``)},children:[(0,Z.jsx)(ce,{asChild:!0,children:(0,Z.jsxs)(X,{id:_,type:`button`,variant:`outline`,role:`combobox`,"aria-expanded":E,"aria-haspopup":`listbox`,"aria-labelledby":`${v} ${_}`,"aria-label":m({id:`ZWwYwM`}),disabled:A,"data-testid":`new-worktree-base-trigger`,className:`w-full justify-between font-normal`,children:[(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[w?.kind===`remote`?(0,Z.jsx)(oo,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}):(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`min-w-0 truncate text-left`,children:ne===null?(0,Z.jsx)(J,{id:`EbjWsS`}):ne})]}),(0,Z.jsx)(Ld,{"aria-hidden":`true`,className:`ml-2 size-4 shrink-0 opacity-50`})]})}),(0,Z.jsxs)(q,{align:`start`,className:`w-[var(--radix-popover-trigger-width)] p-1`,onWheel:KX,onTouchMove:GX,onOpenAutoFocus:e=>{e.preventDefault(),F.current?.focus()},children:[(0,Z.jsxs)(aw,{className:`mb-1 h-8`,children:[(0,Z.jsx)(uw,{ref:F,"aria-label":m({id:`fuJZKk`}),placeholder:m({id:`hQXiDc`}),value:O,onChange:e=>k(e.target.value),onKeyDown:WX,"data-testid":`new-worktree-base-search`}),(0,Z.jsx)(sw,{children:(0,Z.jsx)(Ee,{"aria-hidden":`true`})})]}),(0,Z.jsxs)(`div`,{role:`listbox`,"aria-label":m({id:`ZWwYwM`}),className:`max-h-56 overflow-y-auto`,"data-testid":`new-worktree-base-list`,children:[se?(0,Z.jsx)(`p`,{className:`px-2 py-1.5 text-1sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`Sh3Qkg`})}):null,ie.map(e=>{let t=e.name,n=l?.get(t);return(0,Z.jsxs)(X,{type:`button`,role:`option`,"aria-selected":w?.kind===`local`&&w.name===t,variant:`ghost`,size:`sm`,onClick:()=>{T(e),D(!1),k(``)},"data-testid":`new-worktree-base-option-${t}`,className:`h-8 w-full justify-start gap-2 font-normal`,children:[(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-left`,children:t}),n!==void 0&&n>0?(0,Z.jsx)(`span`,{className:`shrink-0 text-xs text-amber-600 dark:text-amber-400`,"data-testid":`new-worktree-base-behind-${t}`,children:(0,Z.jsx)(J,{id:`6-wLTJ`,values:{behind:n}})}):null]},`local:${t}`)}),ae.map(e=>{let t=e.ref;return(0,Z.jsxs)(X,{type:`button`,role:`option`,"aria-selected":w?.kind===`remote`&&w.ref===t,variant:`ghost`,size:`sm`,onClick:()=>{T(e),D(!1),k(``)},"data-testid":`new-worktree-base-option-${t}`,className:`h-8 w-full justify-start gap-2 font-normal`,children:[(0,Z.jsx)(oo,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-left`,children:t}),(0,Z.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:(0,Z.jsx)(J,{id:`dIYSqk`})})]},`remote:${t}`)})]})]})]})]}),De;t[27]!==m||t[28]!==M||t[29]!==b?(De=M===null?null:(0,Z.jsx)(`p`,{id:b,role:`alert`,className:`text-1sm text-destructive`,"data-testid":`new-worktree-error`,children:m(M)}),t[27]=m,t[28]=M,t[29]=b,t[30]=De):De=t[30];let Oe;t[31]!==h||t[32]!==le||t[33]!==_e||t[34]!==Se||t[35]!==Ce||t[36]!==we||t[37]!==Te||t[38]!==De?(Oe=(0,Z.jsxs)(`form`,{id:h,onSubmit:le,className:`flex flex-col gap-2`,children:[_e,Se,Ce,we,Te,De]}),t[31]=h,t[32]=le,t[33]=_e,t[34]=Se,t[35]=Ce,t[36]=we,t[37]=Te,t[38]=De,t[39]=Oe):Oe=t[39];let ke;t[40]!==he||t[41]!==Oe?(ke=(0,Z.jsx)(he,{children:Oe}),t[40]=he,t[41]=Oe,t[42]=ke):ke=t[42];let Ae;t[43]===r?Ae=t[44]:(Ae=()=>r(!1),t[43]=r,t[44]=Ae);let je;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(je=(0,Z.jsx)(J,{id:`dEgA5A`}),t[45]=je):je=t[45];let Me;t[46]!==A||t[47]!==Ae?(Me=(0,Z.jsx)(X,{type:`button`,variant:`outline`,onClick:Ae,disabled:A,"data-testid":`new-worktree-cancel`,children:je}),t[46]=A,t[47]=Ae,t[48]=Me):Me=t[48];let Ne=!z,Pe;t[49]!==A||t[50]!==W||t[51]!==B||t[52]!==H?(Pe=A?(0,Z.jsx)(J,{id:`b4itZn`}):W?(0,Z.jsx)(J,{id:`XV5sC0`}):H?(0,Z.jsx)(J,{id:`XAyxsa`}):B?(0,Z.jsx)(J,{id:`uGaIIS`}):(0,Z.jsx)(J,{id:`iO8V-7`}),t[49]=A,t[50]=W,t[51]=B,t[52]=H,t[53]=Pe):Pe=t[53];let Fe;t[54]!==h||t[55]!==Ne||t[56]!==Pe?(Fe=(0,Z.jsx)(X,{type:`submit`,form:h,disabled:Ne,"data-testid":`new-worktree-create`,children:Pe}),t[54]=h,t[55]=Ne,t[56]=Pe,t[57]=Fe):Fe=t[57];let Ie;t[58]!==Me||t[59]!==Fe?(Ie=(0,Z.jsxs)(zs,{children:[Me,Fe]}),t[58]=Me,t[59]=Fe,t[60]=Ie):Ie=t[60];let Le;t[61]!==fe||t[62]!==me||t[63]!==ke||t[64]!==Ie?(Le=(0,Z.jsxs)(fe,{className:`sm:max-w-md`,"data-testid":`new-worktree-dialog`,children:[me,ke,Ie]}),t[61]=fe,t[62]=me,t[63]=ke,t[64]=Ie,t[65]=Le):Le=t[65];let Re;return t[66]!==ue||t[67]!==n||t[68]!==Le||t[69]!==de?(Re=(0,Z.jsx)(ue,{open:n,onOpenChange:de,children:Le}),t[66]=ue,t[67]=n,t[68]=Le,t[69]=de,t[70]=Re):Re=t[70],Re}function WX(e){return e.stopPropagation()}function GX(e){e.stopPropagation()}function KX(e){e.stopPropagation()}function qX(e){return{kind:`remote`,ref:e}}function JX(e){return{kind:`local`,name:e}}function YX(e){let t=(0,$.c)(51),{bridge:n,recents:r,currentPath:i,query:a,worktreeModel:o,closeMenu:s,guardStaleSelect:c,flyoutPath:l,setFlyoutPath:u,openNewWorktreeWith:d}=e,{_:f}=At(),p;t[0]!==f||t[1]!==n.project||t[2]!==s?(p=function(e,t){s(),n.project.open({path:e,target:`new-window`,entryPoint:t}).catch(e=>{console.warn(`[RecentProjectsMenu] project.open failed:`,e),_s.error(f({id:`6HCOwA`}))})},t[0]=f,t[1]=n.project,t[2]=s,t[3]=p):p=t[3];let m=p,h;t[4]!==f||t[5]!==n.project||t[6]!==n.worktree?(h=async function(e){try{let t=await n.worktree.create({branch:e,createBranch:!1});if(!t.ok){_s.error(f({id:`teD0H9`}));return}mg(),await n.project.open({path:t.path,target:`new-window`,entryPoint:`worktree`})}catch(e){console.warn(`[RecentProjectsMenu] create/open branch failed:`,e),_s.error(f({id:`LwMxXg`}))}},t[4]=f,t[5]=n.project,t[6]=n.worktree,t[7]=h):h=t[7];let g=h,_;t[8]!==s||t[9]!==i||t[10]!==m?(_=function(e){if(e.path===i){s();return}m(e.path,e.isLinkedWorktree?`worktree`:`recents`)},t[8]=s,t[9]=i,t[10]=m,t[11]=_):_=t[11];let v=_,y;t[12]!==s||t[13]!==g||t[14]!==i||t[15]!==m?(y=function(e){if(e.path!==null){if(e.path===i){s();return}m(e.path,e.isMain?`recents`:`worktree`);return}e.branch!==null&&(s(),g(e.branch))},t[12]=s,t[13]=g,t[14]=i,t[15]=m,t[16]=y):y=t[16];let b=y;if(a!==``){let e;t[17]!==s||t[18]!==g?(e=e=>{s(),g(e)},t[17]=s,t[18]=g,t[19]=e):e=t[19];let n;return t[20]!==i||t[21]!==c||t[22]!==v||t[23]!==a||t[24]!==r||t[25]!==e||t[26]!==o?(n=(0,Z.jsx)(eZ,{recents:r,currentPath:i,query:a,worktreeModel:o,onPickEntry:v,onPickBranch:e,guardStaleSelect:c}),t[20]=i,t[21]=c,t[22]=v,t[23]=a,t[24]=r,t[25]=e,t[26]=o,t[27]=n):n=t[27],n}let x;if(t[28]!==s||t[29]!==i||t[30]!==l||t[31]!==c||t[32]!==b||t[33]!==d||t[34]!==m||t[35]!==r||t[36]!==u||t[37]!==o){let e=Dg(r),n;t[39]!==s||t[40]!==i||t[41]!==l||t[42]!==c||t[43]!==b||t[44]!==d||t[45]!==m||t[46]!==u||t[47]!==o?(n=e=>(0,Z.jsx)(XX,{group:e,currentPath:i,worktreeModel:o,flyoutOpen:l===e.project.path,setFlyoutOpen:t=>u(n=>t?e.project.path:n===e.project.path?null:n),onPickProject:()=>{if(e.project.path===i){s();return}m(e.project.path,`recents`)},onPickFlyoutEntry:b,guardStaleSelect:c,openNewWorktreeWith:d},e.project.path),t[39]=s,t[40]=i,t[41]=l,t[42]=c,t[43]=b,t[44]=d,t[45]=m,t[46]=u,t[47]=o,t[48]=n):n=t[48],x=e.map(n),t[28]=s,t[29]=i,t[30]=l,t[31]=c,t[32]=b,t[33]=d,t[34]=m,t[35]=r,t[36]=u,t[37]=o,t[38]=x}else x=t[38];let S;return t[49]===x?S=t[50]:(S=(0,Z.jsx)(Z.Fragment,{children:x}),t[49]=x,t[50]=S),S}function XX(e){let t=(0,$.c)(34),{group:n,currentPath:r,worktreeModel:i,flyoutOpen:a,setFlyoutOpen:o,onPickProject:s,onPickFlyoutEntry:c,guardStaleSelect:l,openNewWorktreeWith:u}=e,d=n.project.path===r,f,p;t[0]!==r||t[1]!==n||t[2]!==i?(f=wg(n,i,r),p=f.filter(ZX),t[0]=r,t[1]=n,t[2]=i,t[3]=f,t[4]=p):(f=t[3],p=t[4]);let m=p.length;if(m===0){let e;t[5]!==l||t[6]!==s?(e=e=>{l(e)||s()},t[5]=l,t[6]=s,t[7]=e):e=t[7];let r=`project-switcher-recent-${n.project.path}`,i=d?`true`:void 0,a;t[8]!==n.project.name||t[9]!==n.project.path||t[10]!==d?(a=(0,Z.jsx)(rZ,{name:n.project.name,path:n.project.path,current:d}),t[8]=n.project.name,t[9]=n.project.path,t[10]=d,t[11]=a):a=t[11];let o;return t[12]!==e||t[13]!==r||t[14]!==i||t[15]!==a?(o=(0,Z.jsx)(bc,{onSelect:e,className:`flex w-full min-w-0 flex-col items-start gap-0.5`,"data-testid":r,"data-current":i,children:a}),t[12]=e,t[13]=r,t[14]=i,t[15]=a,t[16]=o):o=t[16],o}let h;t[17]!==r||t[18]!==n.worktrees||t[19]!==d?(h=d||n.worktrees.some(e=>e.path===r),t[17]=r,t[18]=n.worktrees,t[19]=d,t[20]=h):h=t[20];let g=h,_;return t[21]!==g||t[22]!==r||t[23]!==f||t[24]!==a||t[25]!==n||t[26]!==l||t[27]!==c||t[28]!==s||t[29]!==u||t[30]!==m||t[31]!==o||t[32]!==i?(_=(0,Z.jsx)(QX,{group:n,currentPath:r,containsCurrent:g,worktreeModel:i,flyoutEntries:f,openedWorktreeCount:m,flyoutOpen:a,setFlyoutOpen:o,onPickProject:s,onPickFlyoutEntry:c,guardStaleSelect:l,openNewWorktreeWith:u}),t[21]=g,t[22]=r,t[23]=f,t[24]=a,t[25]=n,t[26]=l,t[27]=c,t[28]=s,t[29]=u,t[30]=m,t[31]=o,t[32]=i,t[33]=_):_=t[33],_}function ZX(e){return e.opened&&!e.isMain}function QX(e){let t=(0,$.c)(46),{group:n,currentPath:r,containsCurrent:i,worktreeModel:a,flyoutEntries:o,openedWorktreeCount:s,flyoutOpen:c,setFlyoutOpen:l,onPickProject:u,onPickFlyoutEntry:d,guardStaleSelect:f,openNewWorktreeWith:p}=e,{_:m}=At(),h=n.project.path===r,g;t[0]!==f||t[1]!==u?(g=e=>{f(e)||u()},t[0]=f,t[1]=u,t[2]=g):g=t[2];let _=g,v,y;t[3]===_?(v=t[4],y=t[5]):(v=e=>{e.target.closest(`[data-project-open]`)!==null&&(e.preventDefault(),_(e.nativeEvent))},y=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),_(e.nativeEvent))},t[3]=_,t[4]=v,t[5]=y);let b=`project-switcher-group-${n.project.path}`,x=c?`true`:void 0,S=i?`true`:void 0,C;t[6]===n.project.name?C=t[7]:(C=(0,Z.jsx)(`span`,{className:`truncate font-medium text-sm`,"data-project-open":``,title:n.project.name,children:n.project.name}),t[6]=n.project.name,t[7]=C);let w;t[8]===n.project.path?w=t[9]:(w=(0,Z.jsx)(`span`,{className:`truncate text-muted-foreground text-xs`,title:n.project.path,children:n.project.path}),t[8]=n.project.path,t[9]=w);let T;t[10]!==C||t[11]!==w?(T=(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[C,w]}),t[10]=C,t[11]=w,t[12]=T):T=t[12];let E;t[13]!==m||t[14]!==h?(E=h?(0,Z.jsx)(ea,{"aria-label":m({id:`Hp1l6f`}),className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground`}):null,t[13]=m,t[14]=h,t[15]=E):E=t[15];let D=`project-switcher-toggle-${n.project.path}`,O;t[16]===s?O=t[17]:(O=(0,Z.jsx)(`span`,{className:`tabular-nums`,children:s}),t[16]=s,t[17]=O);let k;t[18]===s?k=t[19]:(k=(0,Z.jsx)(J,{id:`AKxFtn`,values:{openedWorktreeCount:s}}),t[18]=s,t[19]=k);let A;t[20]!==D||t[21]!==O||t[22]!==k?(A=(0,Z.jsxs)(`span`,{className:`mt-0.5 shrink-0 text-muted-foreground text-xs`,"data-testid":D,children:[O,` `,k]}),t[20]=D,t[21]=O,t[22]=k,t[23]=A):A=t[23];let j;t[24]!==E||t[25]!==A||t[26]!==v||t[27]!==y||t[28]!==b||t[29]!==x||t[30]!==S||t[31]!==T?(j=(0,Z.jsxs)(_c,{onClick:v,onKeyDown:y,className:`flex w-full min-w-0 items-start gap-2`,"data-testid":b,"data-flyout-open":x,"data-current":S,children:[T,E,A]}),t[24]=E,t[25]=A,t[26]=v,t[27]=y,t[28]=b,t[29]=x,t[30]=S,t[31]=T,t[32]=j):j=t[32];let M;t[33]!==o||t[34]!==c||t[35]!==n||t[36]!==f||t[37]!==d||t[38]!==p||t[39]!==a?(M=(0,Z.jsx)($X,{group:n,open:c,worktreeModel:a,entries:o,onPickFlyoutEntry:d,guardStaleSelect:f,openNewWorktreeWith:p}),t[33]=o,t[34]=c,t[35]=n,t[36]=f,t[37]=d,t[38]=p,t[39]=a,t[40]=M):M=t[40];let N;return t[41]!==c||t[42]!==l||t[43]!==j||t[44]!==M?(N=(0,Z.jsxs)(ic,{open:c,onOpenChange:l,children:[j,M]}),t[41]=c,t[42]=l,t[43]=j,t[44]=M,t[45]=N):N=t[45],N}function $X(e){let t=(0,$.c)(15),{group:n,open:r,worktreeModel:i,entries:a,onPickFlyoutEntry:o,guardStaleSelect:s,openNewWorktreeWith:c}=e,{_:l}=At(),[u,d]=(0,Q.useState)(``),f=(0,Q.useRef)(null),p=(0,Q.useRef)(null),m,h;t[0]===r?(m=t[1],h=t[2]):(m=()=>{r&&f.current?.focus({preventScroll:!0})},h=[r],t[0]=r,t[1]=m,t[2]=h),(0,Q.useEffect)(m,h);let g=function(){let e=p.current;return e===null?[]:[...e.querySelectorAll(`[role="menuitem"]`)]},_=function(e){g()[e]?.focus()},v=function(e,t){if(e.key===`ArrowDown`){e.preventDefault(),e.stopPropagation();let t=g(),n=t.indexOf(e.currentTarget);_(Math.min(n+1,t.length-1))}else if(e.key===`ArrowUp`){e.preventDefault(),e.stopPropagation();let t=g().indexOf(e.currentTarget);t<=0?f.current?.focus():_(t-1)}else e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),t())},y;if(t[3]!==a||t[4]!==u){let e=u.trim().toLowerCase();y=e===``?a:a.filter(t=>(t.branch??``).toLowerCase().includes(e)),t[3]=a,t[4]=u,t[5]=y}else y=t[5];let b=y,x=i!==null&&i.mainRoot===n.project.mainRoot,S=u.trim(),C=x&&S.length>0,w;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsx)(sw,{align:`inline-start`,children:(0,Z.jsx)(Ee,{"aria-hidden":`true`})}),t[6]=w):w=t[6];let T;t[7]===l?T=t[8]:(T=l({id:`bSD4im`}),t[7]=l,t[8]=T);let E;t[9]===l?E=t[10]:(E=l({id:`Skr_7L`}),t[9]=l,t[10]=E);let D;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>d(e.target.value),t[11]=D):D=t[11];let O=b.length===0?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(jc,{className:`font-normal text-muted-foreground text-xs`,role:`status`,"aria-live":`polite`,children:l({id:`-uaQnI`})}),C?(0,Z.jsxs)(bc,{onSelect:e=>{s(e)||c(S)},onKeyDown:e=>v(e,()=>c(S)),className:`flex items-center gap-2`,"data-testid":`project-switcher-flyout-create`,children:[(0,Z.jsx)(rt,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,title:S,children:(0,Z.jsx)(J,{id:`gHSAWT`,values:{typedName:S},components:{0:(0,Z.jsx)(`span`,{className:`font-medium`}),1:(0,Z.jsx)(`span`,{className:`font-mono`})}})})]}):null]}):b.map(e=>{let t=e.path??`branch:${e.branch}`,n=e.branch??l({id:`D12vtS`});return(0,Z.jsxs)(bc,{onSelect:t=>{s(t)||o(e)},onKeyDown:t=>v(t,()=>o(e)),className:`flex items-center gap-2`,"data-testid":`project-switcher-flyout-entry-${t}`,"data-current":e.isCurrent?`true`:void 0,children:[(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,title:n,children:n}),e.isMain?(0,Z.jsx)(`span`,{className:`shrink-0 text-muted-foreground text-xs`,children:l({id:`Bn9-El`})}):e.opened?null:(0,Z.jsx)(`span`,{className:`shrink-0 text-muted-foreground text-xs`,title:l({id:`Dvwa0U`}),children:l({id:`nfoduq`})}),e.isCurrent?(0,Z.jsx)(iZ,{}):null]},t)}),k;return t[12]!==p||t[13]!==O?(k=(0,Z.jsx)(`div`,{ref:p,className:`min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain subtle-scrollbar`,children:O}),t[12]=p,t[13]=O,t[14]=k):k=t[14],(0,Z.jsx)(Nc,{children:(0,Z.jsxs)(Mc,{avoidCollisions:!1,sideOffset:-8,className:`flex max-h-80 w-96 flex-col gap-1 overflow-hidden p-1`,"data-testid":`project-switcher-flyout-${n.project.path}`,children:[(0,Z.jsxs)(aw,{className:`mb-1 h-8 shrink-0`,children:[w,(0,Z.jsx)(uw,{ref:f,"aria-label":T,placeholder:E,value:u,onChange:D,onKeyDown:e=>{e.key===`ArrowDown`&&(e.preventDefault(),_(0)),e.stopPropagation()},"data-testid":`project-switcher-flyout-search-${n.project.path}`})]}),k]})})}function eZ(e){let t=(0,$.c)(41),{recents:n,currentPath:r,query:i,worktreeModel:a,onPickEntry:o,onPickBranch:s,guardStaleSelect:c}=e,{_:l}=At(),u;t[0]===i?u=t[1]:(u=e=>e.toLowerCase().includes(i),t[0]=i,t[1]=u);let d=u,f,p,m,h;if(t[2]!==l||t[3]!==r||t[4]!==c||t[5]!==d||t[6]!==s||t[7]!==o||t[8]!==n||t[9]!==a){h=Symbol.for(`react.early_return_sentinel`);bb0:{let e;t[14]===d?e=t[15]:(e=e=>!e.isLinkedWorktree&&(d(e.name)||d(e.path)),t[14]=d,t[15]=e);let i=n.filter(e),u;t[16]===d?u=t[17]:(u=e=>e.isLinkedWorktree===!0&&(d(e.branch??``)||d(e.path)),t[16]=d,t[17]=u);let g=n.filter(u),_=new Set(g.map(tZ)),v;t[18]===a?.entries?v=t[19]:(v=a?.entries??[],t[18]=a?.entries,t[19]=v);let y=v.filter(e=>e.branch!==null&&d(e.branch)&&(e.worktreePath===null||!_.has(e.worktreePath))&&e.worktreePath!==r);if(i.length===0&&g.length===0&&y.length===0){let e;t[20]===l?e=t[21]:(e=l({id:`pEQFsW`}),t[20]=l,t[21]=e);let n;t[22]===e?n=t[23]:(n=(0,Z.jsx)(jc,{className:`font-normal text-muted-foreground text-xs`,role:`status`,"aria-live":`polite`,children:e}),t[22]=e,t[23]=n),h=n;break bb0}let b;t[24]!==r||t[25]!==c||t[26]!==o?(b=e=>(0,Z.jsx)(bc,{onSelect:t=>{c(t)||o(e)},className:`flex w-full min-w-0 flex-col items-start gap-0.5`,"data-testid":`project-switcher-recent-${e.path}`,children:(0,Z.jsx)(rZ,{name:e.name,path:e.path,current:e.path===r})},e.path),t[24]=r,t[25]=c,t[26]=o,t[27]=b):b=t[27],f=i.map(b);let x;t[28]!==r||t[29]!==c||t[30]!==o?(x=e=>(0,Z.jsxs)(bc,{onSelect:t=>{c(t)||o(e)},className:`flex items-start gap-2`,"data-testid":`project-switcher-worktree-${e.path}`,"data-current":e.path===r?`true`:void 0,children:[(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0`}),(0,Z.jsx)(nZ,{branch:e.branch??e.name,project:e.mainRoot===void 0?null:Eg(e.mainRoot)})]},e.path),t[28]=r,t[29]=c,t[30]=o,t[31]=x):x=t[31],p=g.map(x);let S;t[32]!==l||t[33]!==c||t[34]!==s||t[35]!==a?(S=e=>(0,Z.jsxs)(bc,{onSelect:t=>{c(t)||e.branch!==null&&s(e.branch)},className:`flex items-start gap-2`,"data-testid":`project-switcher-branch-${e.branch}`,children:[(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 opacity-40`}),(0,Z.jsx)(nZ,{branch:e.branch??``,project:a===null?null:Eg(a.mainRoot),hint:l({id:`nfoduq`})})]},`branch:${e.branch}`),t[32]=l,t[33]=c,t[34]=s,t[35]=a,t[36]=S):S=t[36],m=y.map(S)}t[2]=l,t[3]=r,t[4]=c,t[5]=d,t[6]=s,t[7]=o,t[8]=n,t[9]=a,t[10]=f,t[11]=p,t[12]=m,t[13]=h}else f=t[10],p=t[11],m=t[12],h=t[13];if(h!==Symbol.for(`react.early_return_sentinel`))return h;let g;return t[37]!==f||t[38]!==p||t[39]!==m?(g=(0,Z.jsxs)(Z.Fragment,{children:[f,p,m]}),t[37]=f,t[38]=p,t[39]=m,t[40]=g):g=t[40],g}function tZ(e){return e.path}function nZ(e){let t=(0,$.c)(12),{branch:n,project:r,hint:i}=e,a;t[0]===n?a=t[1]:(a=(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,children:n}),t[0]=n,t[1]=a);let o;t[2]===i?o=t[3]:(o=i===void 0?null:(0,Z.jsx)(`span`,{className:`shrink-0 text-muted-foreground text-xs`,children:i}),t[2]=i,t[3]=o);let s;t[4]!==a||t[5]!==o?(s=(0,Z.jsxs)(`span`,{className:`flex w-full min-w-0 items-center gap-1.5`,children:[a,o]}),t[4]=a,t[5]=o,t[6]=s):s=t[6];let c;t[7]===r?c=t[8]:(c=r===null?null:(0,Z.jsx)(`span`,{className:`truncate text-muted-foreground text-xs`,title:r,children:r}),t[7]=r,t[8]=c);let l;return t[9]!==s||t[10]!==c?(l=(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[s,c]}),t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function rZ(e){let t=(0,$.c)(15),{name:n,path:r,current:i}=e,a=i&&`font-medium`,o;t[0]===a?o=t[1]:(o=Y(`flex w-full items-center gap-1.5`,a),t[0]=a,t[1]=o);let s;t[2]===n?s=t[3]:(s=(0,Z.jsx)(`span`,{className:`truncate font-medium text-sm`,title:n,children:n}),t[2]=n,t[3]=s);let c;t[4]===i?c=t[5]:(c=i?(0,Z.jsx)(ea,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}):null,t[4]=i,t[5]=c);let l;t[6]!==o||t[7]!==s||t[8]!==c?(l=(0,Z.jsxs)(`span`,{className:o,children:[s,c]}),t[6]=o,t[7]=s,t[8]=c,t[9]=l):l=t[9];let u;t[10]===r?u=t[11]:(u=(0,Z.jsx)(`span`,{className:`w-full truncate text-muted-foreground text-xs`,title:r,children:r}),t[10]=r,t[11]=u);let d;return t[12]!==l||t[13]!==u?(d=(0,Z.jsxs)(`span`,{className:`flex w-full min-w-0 flex-col gap-0.5`,children:[l,u]}),t[12]=l,t[13]=u,t[14]=d):d=t[14],d}function iZ(){let e=(0,$.c)(4),{_:t}=At(),n;e[0]===t?n=e[1]:(n=t({id:`Hp1l6f`}),e[0]=t,e[1]=n);let r;return e[2]===n?r=e[3]:(r=(0,Z.jsx)(ea,{"aria-label":n,className:`size-3.5 shrink-0 text-muted-foreground`}),e[2]=n,e[3]=r),r}var aZ=(e,t,n)=>vg(e,t,n,`ProjectSwitcher`),oZ=350;function sZ(e){let t=(0,$.c)(108),{bridge:n}=e,{_:r}=At(),[i,a]=(0,Q.useState)(null),[o,s]=(0,Q.useState)(!1),[c,l]=(0,Q.useState)(``),[u,d]=(0,Q.useState)(!1),[f,p]=(0,Q.useState)(!1),[m,h]=(0,Q.useState)(``),[g,_]=(0,Q.useState)(null),v=DM(),y=hg(),b=typeof window<`u`&&window.okDesktop!=null,x=(0,Q.useRef)(!1),S=(0,Q.useRef)(!1),C=(0,Q.useRef)(null),w;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(w=e=>{e&&(S.current=!0,C.current!==null&&clearTimeout(C.current),C.current=setTimeout(()=>{S.current=!1},oZ)),s(e),e||(l(``),_(null))},t[0]=w):w=t[0];let T=w,E;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(E=e=>!b||!S.current?!1:(e.preventDefault(),!0),t[1]=E):E=t[1];let D=E,O;t[2]!==r||t[3]!==n.project||t[4]!==o?(O=()=>{if(!o)return;let e=!1;return aZ(async()=>{let t=await n.project.listRecent();e||a(t)},r({id:`fYKgzG`})),()=>{e=!0}},t[2]=r,t[3]=n.project,t[4]=o,t[5]=O):O=t[5];let k;t[6]!==r||t[7]!==n||t[8]!==o?(k=[o,n,r],t[6]=r,t[7]=n,t[8]=o,t[9]=k):k=t[9],(0,Q.useEffect)(O,k);let A,j;t[10]===n?(A=t[11],j=t[12]):(A=()=>n.onMenuAction(e=>{e===`new-worktree`?(s(!1),_(null),h(``),p(!0)):e===`switch-worktree`&&s(!0)}),j=[n],t[10]=n,t[11]=A,t[12]=j),(0,Q.useEffect)(A,j);let M;t[13]!==r||t[14]!==n.dialog||t[15]!==n.project?(M=()=>{T(!1),aZ(async()=>{let e=await n.dialog.openFolder();e&&await n.project.open({path:e,target:`new-window`,entryPoint:`pick-existing`})},r({id:`gmJ0An`}))},t[13]=r,t[14]=n.dialog,t[15]=n.project,t[16]=M):M=t[16];let N=M,P;t[17]!==r||t[18]!==n.navigator?(P=()=>{T(!1),aZ(()=>n.navigator.open(),r({id:`jol95m`}))},t[17]=r,t[18]=n.navigator,t[19]=P):P=t[19];let F=P,I;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>{T(!1),d(!0)},t[20]=I):I=t[20];let L=I,R;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>{T(!1),h(e),p(!0)},t[21]=R):R=t[21];let z=R,B=n.config.projectPath,V;t[22]===c?V=t[23]:(V=c.trim().toLowerCase(),t[22]=c,t[23]=V);let H=V,U=H!==``,W;t[24]===i?W=t[25]:(W=i??[],t[24]=i,t[25]=W);let G=W,ee;t[26]!==U||t[27]!==G?(ee=U?G.filter(hZ):G,t[26]=U,t[27]=G,t[28]=ee):ee=t[28];let te=ee,K=U?null:y,ne=v!==null&&`h-auto py-1.5`,re;t[29]===ne?re=t[30]:(re=Y(`justify-between text-sidebar-foreground/70 hover:text-sidebar-foreground! data-open:hover:text-sidebar-foreground!`,ne),t[29]=ne,t[30]=re);let ie;t[31]===r?ie=t[32]:(ie=r({id:`zZ_I5K`}),t[31]=r,t[32]=ie);let q;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(q=b?()=>{x.current=!0}:void 0,t[33]=q):q=t[33];let ae;t[34]===o?ae=t[35]:(ae=b?()=>{if(x.current){x.current=!1;return}T(!o)}:void 0,t[34]=o,t[35]=ae);let oe;t[36]===n.config.projectName?oe=t[37]:(oe=(0,Z.jsx)(`span`,{className:`truncate`,children:n.config.projectName}),t[36]=n.config.projectName,t[37]=oe);let se;t[38]===v?se=t[39]:(se=v===null?null:(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 text-xs text-sidebar-foreground/50 group-hover/menu-button:text-sidebar-foreground`,"data-testid":`project-switcher-branch`,children:[(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`size-3! shrink-0`}),(0,Z.jsx)(`span`,{className:`truncate`,children:v})]}),t[38]=v,t[39]=se);let ce;t[40]!==oe||t[41]!==se?(ce=(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[oe,se]}),t[40]=oe,t[41]=se,t[42]=ce):ce=t[42];let le;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,Z.jsx)(Ld,{"aria-hidden":`true`,className:`opacity-60`}),t[43]=le):le=t[43];let ue;t[44]!==n.config.projectPath||t[45]!==re||t[46]!==ie||t[47]!==ae||t[48]!==ce?(ue=(0,Z.jsx)(oc,{asChild:!0,children:(0,Z.jsxs)(_M,{className:re,"data-testid":`project-switcher-trigger`,"aria-label":ie,title:n.config.projectPath,onPointerDown:q,onClick:ae,children:[ce,le]})}),t[44]=n.config.projectPath,t[45]=re,t[46]=ie,t[47]=ae,t[48]=ce,t[49]=ue):ue=t[49];let de;t[50]!==r||t[51]!==n||t[52]!==B||t[53]!==g||t[54]!==te||t[55]!==K||t[56]!==H||t[57]!==i||t[58]!==c?(de=i===null?null:i.length===0?(0,Z.jsx)(jc,{className:`font-normal text-muted-foreground text-xs`,children:(0,Z.jsx)(J,{id:`MUrVEo`})}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(aw,{className:`mb-1 h-8 border-0 shadow-none has-[[data-slot=input-group-control]:focus-visible]:ring-0`,children:[(0,Z.jsx)(uw,{"aria-label":r({id:`blFttG`}),placeholder:r({id:`RVZJWQ`}),value:c,onChange:e=>{e.target.value!==``&&_(null),l(e.target.value)},onKeyDown:mZ,"data-testid":`project-switcher-search`}),(0,Z.jsx)(sw,{children:(0,Z.jsx)(Ee,{"aria-hidden":`true`})})]}),(0,Z.jsx)(gc,{}),(0,Z.jsx)(`div`,{className:`max-h-64 overflow-x-hidden overflow-y-auto overscroll-contain subtle-scrollbar scroll-fade-mask`,"data-testid":`project-switcher-scroll`,onScroll:()=>{g!==null&&_(null)},children:(0,Z.jsx)(YX,{bridge:n,recents:te,currentPath:B,query:H,worktreeModel:K,closeMenu:()=>T(!1),guardStaleSelect:D,flyoutPath:g,setFlyoutPath:_,openNewWorktreeWith:z})})]}),t[50]=r,t[51]=n,t[52]=B,t[53]=g,t[54]=te,t[55]=K,t[56]=H,t[57]=i,t[58]=c,t[59]=de):de=t[59];let fe;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(fe=(0,Z.jsx)(gc,{}),t[60]=fe):fe=t[60];let pe;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(pe=e=>{D(e)||L()},t[61]=pe):pe=t[61];let me;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,Z.jsxs)(bc,{onSelect:pe,"data-testid":`project-switcher-new-project`,children:[(0,Z.jsx)(rt,{"aria-hidden":`true`,className:`text-muted-foreground`}),(0,Z.jsx)(J,{id:`gKi-a_`})]}),t[62]=me):me=t[62];let he;t[63]===F?he=t[64]:(he=e=>{D(e)||F()},t[63]=F,t[64]=he);let ge,_e;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,Z.jsx)(be,{"aria-hidden":`true`,className:`text-muted-foreground`}),_e=(0,Z.jsx)(J,{id:`xaDWAI`}),t[65]=ge,t[66]=_e):(ge=t[65],_e=t[66]);let ve;t[67]===he?ve=t[68]:(ve=(0,Z.jsxs)(bc,{onSelect:he,"data-testid":`project-switcher-switch-project`,children:[ge,_e]}),t[67]=he,t[68]=ve);let ye;t[69]===N?ye=t[70]:(ye=e=>{D(e)||N()},t[69]=N,t[70]=ye);let xe,Se;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,Z.jsx)(Bo,{"aria-hidden":`true`,className:`text-muted-foreground`}),Se=(0,Z.jsx)(J,{id:`PVUn_c`}),t[71]=xe,t[72]=Se):(xe=t[71],Se=t[72]);let Ce;t[73]===ye?Ce=t[74]:(Ce=(0,Z.jsxs)(bc,{onSelect:ye,"data-testid":`project-switcher-open-folder`,children:[xe,Se]}),t[73]=ye,t[74]=Ce);let we;t[75]===v?we=t[76]:(we=v===null?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(gc,{}),(0,Z.jsxs)(bc,{onSelect:e=>{D(e)||(T(!1),h(``),p(!0))},"data-testid":`project-switcher-new-worktree`,children:[(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`text-muted-foreground`}),(0,Z.jsx)(J,{id:`DXd9LM`})]})]}),t[75]=v,t[76]=we);let Te;t[77]!==de||t[78]!==ve||t[79]!==Ce||t[80]!==we?(Te=(0,Z.jsxs)(Sc,{align:`start`,side:`top`,className:`min-w-[260px]`,"data-testid":`project-switcher-menu`,children:[de,fe,me,ve,Ce,we]}),t[77]=de,t[78]=ve,t[79]=Ce,t[80]=we,t[81]=Te):Te=t[81];let De;t[82]!==o||t[83]!==ue||t[84]!==Te?(De=(0,Z.jsxs)(Oc,{open:o,onOpenChange:T,modal:!1,children:[ue,Te]}),t[82]=o,t[83]=ue,t[84]=Te,t[85]=De):De=t[85];let Oe;t[86]!==n||t[87]!==u?(Oe=(0,Z.jsx)(Cm,{open:u,onOpenChange:d,bridge:n}),t[86]=n,t[87]=u,t[88]=Oe):Oe=t[88];let ke;t[89]===y?.entries?ke=t[90]:(ke=y?.entries.map(pZ).filter(fZ),t[89]=y?.entries,t[90]=ke);let Ae;t[91]===y?.entries?Ae=t[92]:(Ae=new Set(y?.entries.filter(dZ).map(uZ)),t[91]=y?.entries,t[92]=Ae);let je=y?.remoteBranches,Me;t[93]===y?.entries?Me=t[94]:(Me=new Map(y?.entries.filter(lZ).map(cZ)),t[93]=y?.entries,t[94]=Me);let Ne;t[95]!==v||t[96]!==n||t[97]!==m||t[98]!==f||t[99]!==ke||t[100]!==Ae||t[101]!==je||t[102]!==Me?(Ne=(0,Z.jsx)(UX,{open:f,onOpenChange:p,bridge:n,currentBranch:v,initialBranchName:m,branches:ke,existingWorktreeBranches:Ae,remoteBranches:je,behindByBranch:Me}),t[95]=v,t[96]=n,t[97]=m,t[98]=f,t[99]=ke,t[100]=Ae,t[101]=je,t[102]=Me,t[103]=Ne):Ne=t[103];let Pe;return t[104]!==De||t[105]!==Oe||t[106]!==Ne?(Pe=(0,Z.jsxs)(Z.Fragment,{children:[De,Oe,Ne]}),t[104]=De,t[105]=Oe,t[106]=Ne,t[107]=Pe):Pe=t[107],Pe}function cZ(e){return[e.branch,e.behind]}function lZ(e){return e.branch!==null&&e.behind!==void 0}function uZ(e){return e.branch}function dZ(e){return e.branch!==null&&e.worktreePath!==null}function fZ(e){return e!==null}function pZ(e){return e.branch}function mZ(e){return e.stopPropagation()}function hZ(e){return!e.isLinkedWorktree}function gZ(e,t){let n=e instanceof Error?e:Error(String(e));console.warn(JSON.stringify({event:`jsx-render-failure`,component:`sidebarSearchPill`,rawComponentName:`sidebarSearchPill`,error:String(n),stack:t.componentStack})),Cn(`sidebarSearchPill`)}function _Z(e){let t=(0,$.c)(8),{onClick:n,className:r}=e,i;t[0]===r?i=t[1]:(i=Y(`rounded-lg h-9 w-full justify-start gap-2 px-3 font-normal text-muted-foreground`,r),t[0]=r,t[1]=i);let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(Ee,{"aria-hidden":`true`}),t[2]=a):a=t[2];let o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(`span`,{className:`flex-1 text-left text-sm`,children:(0,Z.jsx)(J,{id:`A1taO8`})}),t[3]=o):o=t[3];let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(I,{className:`text-foreground/70`,children:Il(`command-palette`)}),t[4]=s):s=t[4];let c;return t[5]!==n||t[6]!==i?(c=(0,Z.jsxs)(X,{variant:`outline`,onClick:n,"data-telemetry-event":`ok.sidebar.search_pill.click`,className:i,children:[a,o,s]}),t[5]=n,t[6]=i,t[7]=c):c=t[7],c}function vZ(){let e=(0,$.c)(31),{_:t}=At(),n=xa(),{activeDocName:r}=Xe(),[i,a]=(0,Q.useState)(!1),o=Ea(),s;e[0]!==n.data||e[1]!==n.status?(s=n.status===`ready`?n.data:[],e[0]=n.data,e[1]=n.status,e[2]=s):s=e[2];let c=s,l;e[3]===c?l=e[4]:(l=Fo(c),e[3]=c,e[4]=l);let u=l,d=Lo(),f;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(f={},e[5]=f):f=e[5];let[p,m]=(0,Q.useState)(f),h;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(dM,{asChild:!0,children:(0,Z.jsxs)(Ns,{className:`flex w-full items-center gap-1.5`,children:[(0,Z.jsx)(rf,{className:`size-3.5 shrink-0`}),(0,Z.jsx)(J,{id:`PCSkw2`}),(0,Z.jsx)(ra,{className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-data-[state=open]/skills:rotate-90`})]})}),e[6]=h):h=e[6];let g;e[7]===t?g=e[8]:(g=t({id:`MdpSC1`}),e[7]=t,e[8]=g);let _,v;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(_=()=>a(!0),v=(0,Z.jsx)(rt,{}),e[9]=_,e[10]=v):(_=e[9],v=e[10]);let y;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(J,{id:`MdpSC1`})}),e[11]=y):y=e[11];let b;e[12]===g?b=e[13]:(b=(0,Z.jsxs)(fM,{title:g,onClick:_,children:[v,y]}),e[12]=g,e[13]=b);let x;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Z.jsx)(TZ,{}),e[14]=x):x=e[14];let S;e[15]!==o||e[16]!==r||e[17]!==u||e[18]!==p||e[19]!==d||e[20]!==c?(S=c.length===0?(0,Z.jsx)(`p`,{className:`px-2 py-1 text-xs text-muted-foreground`,children:(0,Z.jsx)(J,{id:`PdJZ5p`})}):Mo.filter(e=>c.some(t=>t.scope===e)).map(e=>(0,Z.jsxs)(Ps,{className:`group/scope`,open:c.some(t=>t.scope===e&&Ln(t.scope,t.name)===r)||(p[e]??!1),onOpenChange:t=>m(n=>({...n,[e]:t})),children:[(0,Z.jsxs)(Ns,{className:`flex w-full items-center gap-1 px-2 pt-1 pb-0.5 text-[11px] text-muted-foreground/70 hover:text-muted-foreground`,children:[(0,Z.jsx)(ra,{className:`size-3 shrink-0 transition-transform group-data-[state=open]/scope:rotate-90`}),(0,Z.jsx)(`span`,{className:`truncate`,children:d[e]})]}),(0,Z.jsx)(Ms,{children:(0,Z.jsx)(mM,{className:`pl-2`,children:c.filter(t=>t.scope===e).map(e=>(0,Z.jsx)(bZ,{skill:e,activeDocName:r,actions:o,existingNames:u[e.scope]},`${e.scope}::${e.name}`))})})]},e)),e[15]=o,e[16]=r,e[17]=u,e[18]=p,e[19]=d,e[20]=c,e[21]=S):S=e[21];let C;e[22]===S?C=e[23]:(C=(0,Z.jsx)(Ms,{children:(0,Z.jsxs)(pM,{children:[x,S]})}),e[22]=S,e[23]=C);let w;e[24]===i?w=e[25]:(w=(0,Z.jsx)(uo,{defaultScope:`project`,open:i,onOpenChange:a,onCreated:yZ}),e[24]=i,e[25]=w);let T;return e[26]!==o.dialogs||e[27]!==C||e[28]!==w||e[29]!==b?(T=(0,Z.jsx)(Ps,{className:`group/skills shrink-0`,children:(0,Z.jsxs)(uM,{className:`px-0`,children:[h,b,C,o.dialogs,w]})}),e[26]=o.dialogs,e[27]=C,e[28]=w,e[29]=b,e[30]=T):T=e[30],T}function yZ(e){let{scope:t,name:n}=e;return $o(Ln(t,n))}function bZ(e){let t=(0,$.c)(50),{skill:n,activeDocName:r,actions:i,existingNames:a}=e,{_:o}=At(),[s,c]=(0,Q.useState)(!1),[l,u]=(0,Q.useState)(!1),d;t[0]!==n.name||t[1]!==n.scope?(d=Ln(n.scope,n.name),t[0]=n.name,t[1]=n.scope,t[2]=d):d=t[2];let f=r===d,p,m,h;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>{e.preventDefault(),u(!0)},m=(0,Z.jsx)(ra,{className:`size-3 shrink-0 text-muted-foreground transition-transform group-data-[state=open]/skill:rotate-90`}),h=(0,Z.jsx)(rf,{className:`size-3 shrink-0 text-muted-foreground`}),t[3]=p,t[4]=m,t[5]=h):(p=t[3],m=t[4],h=t[5]);let g=n.name,_;t[6]===n.name?_=t[7]:(_=ko(n.name),t[6]=n.name,t[7]=_);let v;t[8]!==n.name||t[9]!==_?(v=(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:g,children:_}),t[8]=n.name,t[9]=_,t[10]=v):v=t[10];let y;t[11]!==o||t[12]!==n.bundledVersion||t[13]!==n.updateAvailable?(y=n.updateAvailable?(0,Z.jsx)(`span`,{title:o({id:`1YJ4Yg`,values:{0:n.bundledVersion?` (${n.bundledVersion})`:``}}),className:`flex items-center`,children:(0,Z.jsx)(os,{className:`size-3 text-primary`,"aria-label":o({id:`CifUuG`})})}):null,t[11]=o,t[12]=n.bundledVersion,t[13]=n.updateAvailable,t[14]=y):y=t[14];let b;t[15]===n.installed?b=t[16]:(b=(0,Z.jsx)(io,{installed:n.installed,subtle:!0,className:`shrink-0`}),t[15]=n.installed,t[16]=b);let x;t[17]!==y||t[18]!==b?(x=(0,Z.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1`,children:[y,b]}),t[17]=y,t[18]=b,t[19]=x):x=t[19];let S;t[20]!==f||t[21]!==x||t[22]!==v?(S=(0,Z.jsx)(Ns,{asChild:!0,children:(0,Z.jsxs)(_M,{size:`sm`,isActive:f,className:`h-6 text-[11px]`,onContextMenu:p,children:[m,h,v,x]})}),t[20]=f,t[21]=x,t[22]=v,t[23]=S):S=t[23];let C;t[24]!==o||t[25]!==n.name?(C=o({id:`RlLl3G`,values:{0:n.name}}),t[24]=o,t[25]=n.name,t[26]=C):C=t[26];let w;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsx)(Gd,{}),t[27]=w):w=t[27];let T;t[28]===C?T=t[29]:(T=(0,Z.jsx)(oc,{asChild:!0,children:(0,Z.jsx)(vM,{showOnHover:!0,"aria-label":C,children:w})}),t[28]=C,t[29]=T);let E;t[30]!==i||t[31]!==a||t[32]!==n?(E=(0,Z.jsx)(Sc,{side:`right`,align:`start`,className:`min-w-52`,children:(0,Z.jsx)(wa,{skill:n,actions:i,existingNames:a})}),t[30]=i,t[31]=a,t[32]=n,t[33]=E):E=t[33];let D;t[34]!==l||t[35]!==T||t[36]!==E?(D=(0,Z.jsxs)(Oc,{open:l,onOpenChange:u,children:[T,E]}),t[34]=l,t[35]=T,t[36]=E,t[37]=D):D=t[37];let O;t[38]!==s||t[39]!==n?(O=s?(0,Z.jsx)(CZ,{skill:n}):null,t[38]=s,t[39]=n,t[40]=O):O=t[40];let k;t[41]===O?k=t[42]:(k=(0,Z.jsx)(Ms,{children:O}),t[41]=O,t[42]=k);let A;t[43]!==S||t[44]!==D||t[45]!==k?(A=(0,Z.jsxs)(hM,{children:[S,D,k]}),t[43]=S,t[44]=D,t[45]=k,t[46]=A):A=t[46];let j;return t[47]!==s||t[48]!==A?(j=(0,Z.jsx)(Ps,{open:s,onOpenChange:c,className:`group/skill`,children:A}),t[47]=s,t[48]=A,t[49]=j):j=t[49],j}function xZ(e){let t=[];for(let n of e){let e=n.path.split(`/`),r=t;e.forEach((t,i)=>{let a=i===e.length-1,o=r.find(e=>e.name===t);o||(o=a?{name:t,path:n.path,text:n.text}:{name:t,path:e.slice(0,i+1).join(`/`),children:[]},r.push(o)),!a&&o.children&&(r=o.children)})}return SZ(t),t}function SZ(e){e.sort((e,t)=>{let n=+!e.children,r=+!t.children;return n===r?e.name.localeCompare(t.name):n-r});for(let t of e)t.children&&SZ(t.children)}function CZ(e){let t=(0,$.c)(27),{skill:n}=e,{_:r}=At(),[i,a]=(0,Q.useState)(null),[o,s]=(0,Q.useState)(!1),{openTarget:c}=Xe(),l;t[0]===c?l=t[1]:(l=function(e){c({kind:`doc`,target:e,docName:e},{tabBehavior:`append`}),Tl(Ml(e))},t[0]=c,t[1]=l);let u=l,d;t[2]!==u||t[3]!==c||t[4]!==n.name||t[5]!==n.scope?(d=function(e){let t=e.lastIndexOf(`.`),r=t>=0?e.slice(t+1).toLowerCase():``;if(n.scope===`project`&&(r===`md`||r===`mdx`)){u(qe(n.name,e.replace(/\.mdx?$/i,``)));return}c({kind:`skill-file`,target:`${n.scope}/${n.name}/${e}`,scope:n.scope,name:n.name,path:e},{tabBehavior:`replace-active`}),Tl(Ol({scope:n.scope,name:n.name,path:e}))},t[2]=u,t[3]=c,t[4]=n.name,t[5]=n.scope,t[6]=d):d=t[6];let f=d,p,m;t[7]!==n.name||t[8]!==n.scope?(p=()=>{let e=!0,t=()=>{kc(n.scope,n.name).then(t=>{e&&(t.ok?(a(t.files),s(!1)):(a([]),s(!0)))})};t();let r=vl(t);return()=>{e=!1,r()}},m=[n.scope,n.name],t[7]=n.name,t[8]=n.scope,t[9]=p,t[10]=m):(p=t[9],m=t[10]),(0,Q.useEffect)(p,m);let h;if(t[11]!==r||t[12]!==i||t[13]!==o||t[14]!==f||t[15]!==u||t[16]!==n.name||t[17]!==n.scope){let e=i?xZ(i):[],a;t[19]!==u||t[20]!==n.name||t[21]!==n.scope?(a=()=>n.scope===`project`?u(Sr(n.name)):$o(Ln(n.scope,n.name)),t[19]=u,t[20]=n.name,t[21]=n.scope,t[22]=a):a=t[22];let s,c;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(Ci,{className:`size-3 shrink-0 text-muted-foreground`}),c=(0,Z.jsx)(`span`,{className:`truncate`,children:`SKILL.md`}),t[23]=s,t[24]=c):(s=t[23],c=t[24]);let l;t[25]===a?l=t[26]:(l=(0,Z.jsx)(bM,{children:(0,Z.jsxs)(xM,{size:`sm`,onClick:a,className:`text-[11px]`,children:[s,c]})}),t[25]=a,t[26]=l),h=(0,Z.jsxs)(yM,{className:`mr-0 pr-0`,children:[l,i===null?(0,Z.jsx)(bM,{children:(0,Z.jsx)(`span`,{className:`px-2 py-0.5 text-[11px] text-muted-foreground/70`,children:(0,Z.jsx)(J,{id:`yQE2r9`})})}):o?(0,Z.jsx)(bM,{children:(0,Z.jsx)(`span`,{className:`px-2 py-0.5 text-[11px] text-muted-foreground/70`,title:r({id:`3Ijjy1`}),children:(0,Z.jsx)(J,{id:`ZARuZJ`})})}):e.map(e=>(0,Z.jsx)(wZ,{node:e,depth:0,onOpenFile:f},e.path))]}),t[11]=r,t[12]=i,t[13]=o,t[14]=f,t[15]=u,t[16]=n.name,t[17]=n.scope,t[18]=h}else h=t[18];return h}function wZ(e){let t=(0,$.c)(34),{node:n,depth:r,onOpenFile:i}=e,[a,o]=(0,Q.useState)(!1),s=`${r*.6}rem`,c;t[0]===s?c=t[1]:(c={paddingLeft:s},t[0]=s,t[1]=c);let l=c;if(n.children){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(ra,{className:`size-3 shrink-0 text-muted-foreground transition-transform group-data-[state=open]/dir:rotate-90`}),t[2]=e):e=t[2];let s;t[3]===n.name?s=t[4]:(s=(0,Z.jsxs)(`span`,{className:`truncate`,children:[n.name,`/`]}),t[3]=n.name,t[4]=s);let c;t[5]!==l||t[6]!==s?(c=(0,Z.jsx)(Ns,{asChild:!0,children:(0,Z.jsxs)(xM,{size:`sm`,className:`text-[11px]`,style:l,children:[e,s]})}),t[5]=l,t[6]=s,t[7]=c):c=t[7];let u;if(t[8]!==r||t[9]!==n.children||t[10]!==i){let e;t[12]!==r||t[13]!==i?(e=e=>(0,Z.jsx)(wZ,{node:e,depth:r+1,onOpenFile:i},e.path),t[12]=r,t[13]=i,t[14]=e):e=t[14],u=n.children.map(e),t[8]=r,t[9]=n.children,t[10]=i,t[11]=u}else u=t[11];let d;t[15]===u?d=t[16]:(d=(0,Z.jsx)(Ms,{children:u}),t[15]=u,t[16]=d);let f;t[17]!==c||t[18]!==d?(f=(0,Z.jsxs)(bM,{children:[c,d]}),t[17]=c,t[18]=d,t[19]=f):f=t[19];let p;return t[20]!==a||t[21]!==f?(p=(0,Z.jsx)(Ps,{open:a,onOpenChange:o,className:`group/dir`,children:f}),t[20]=a,t[21]=f,t[22]=p):p=t[22],p}let u=`skill-file-${n.path}`,d;t[23]!==n.path||t[24]!==i?(d=()=>i(n.path),t[23]=n.path,t[24]=i,t[25]=d):d=t[25];let f;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(Jd,{className:`size-3 shrink-0 text-muted-foreground`}),t[26]=f):f=t[26];let p;t[27]===n.name?p=t[28]:(p=(0,Z.jsx)(`span`,{className:`truncate`,children:n.name}),t[27]=n.name,t[28]=p);let m;return t[29]!==l||t[30]!==u||t[31]!==d||t[32]!==p?(m=(0,Z.jsx)(bM,{children:(0,Z.jsxs)(xM,{size:`sm`,className:`text-[11px]`,style:l,"data-testid":u,onClick:d,children:[f,p]})}),t[29]=l,t[30]=u,t[31]=d,t[32]=p,t[33]=m):m=t[33],m}function TZ(){let e=(0,$.c)(19),[t,n]=(0,Q.useState)(null),[r,i]=(0,Q.useState)(!1),a,o;if(e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>{let e=!1;return Cc().then(t=>{e||n(t)}),()=>{e=!0}},o=[],e[0]=a,e[1]=o):(a=e[0],o=e[1]),(0,Q.useEffect)(a,o),!t||t.managed!==null||t.importable===0)return null;let s;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=async e=>{if(i(!0),!await Ac(e)){i(!1);return}n({managed:e,importable:0})},e[2]=s):s=e[2];let c=s,l;e[3]===t.importable?l=e[4]:(l=(0,Z.jsx)(`p`,{className:`mb-2 text-muted-foreground`,children:(0,Z.jsx)(J,{id:`mu1O0q`,values:{0:t.importable}})}),e[3]=t.importable,e[4]=l);let u,d;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>c(!0),d=(0,Z.jsx)(J,{id:`l3s5ri`}),e[5]=u,e[6]=d):(u=e[5],d=e[6]);let f;e[7]===r?f=e[8]:(f=(0,Z.jsx)(X,{size:`sm`,className:`h-6 px-2 text-xs`,disabled:r,onClick:u,children:d}),e[7]=r,e[8]=f);let p,m;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>c(!1),m=(0,Z.jsx)(J,{id:`PBxg_E`}),e[9]=p,e[10]=m):(p=e[9],m=e[10]);let h;e[11]===r?h=e[12]:(h=(0,Z.jsx)(X,{size:`sm`,variant:`ghost`,className:`h-6 px-2 text-xs`,disabled:r,onClick:p,children:m}),e[11]=r,e[12]=h);let g;e[13]!==f||e[14]!==h?(g=(0,Z.jsxs)(`div`,{className:`flex gap-1.5`,children:[f,h]}),e[13]=f,e[14]=h,e[15]=g):g=e[15];let _;return e[16]!==g||e[17]!==l?(_=(0,Z.jsxs)(`div`,{className:`mx-2 mb-1 rounded-md border border-border/60 bg-muted/40 p-2 text-xs`,children:[l,g]}),e[16]=g,e[17]=l,e[18]=_):_=e[18],_}var EZ=`Relaunch`,DZ=`Release notes`,OZ=`Updates paused`,kZ=`Download`,AZ=`Reset to defaults`,jZ=`Relaunching to install the update…`,MZ=`Relaunch failed — please restart manually`;function NZ(e){return`Update to ${e} didn't install.`}var PZ=`Retry`,FZ=`Download manually`,IZ=`Recovery action failed — please try again`;function LZ(e,t){let n=t instanceof Error&&t.message?t.message:``;return n?`${e}: ${n}`:e}function RZ(e){return`Version ${e} ready to install`}function zZ(e){return`Updated to Version ${e}`}function BZ(e){return`Your settings and recent projects were saved by a newer build than this one (v${e}). Reset to defaults to continue.`}var VZ=0,HZ=0,UZ=1,WZ=2,GZ=3,KZ=6e4;function qZ(e,t,n=()=>{},r=KZ,i={isEligible:()=>!1,onShown:()=>{}}){let a=[],o=new Set,s=`update-downloaded`;return a.push(e.onUpdateDownloaded(({version:r})=>{let i=s,a=()=>{t({id:i,body:RZ(r),priority:WZ,action:{label:EZ,onClick:()=>{t({id:i,body:jZ,priority:WZ,dismissible:!1}),e.update.relaunchNow().then(()=>{n(i)},e=>{a(),t({id:`relaunch-error-${r}`,body:LZ(MZ,e),variant:`error`,priority:UZ})})}}})};a()})),a.push(e.onUpdateRelaunching(()=>{t({id:s,body:jZ,priority:WZ,dismissible:!1})})),a.push(e.onUpdateRelaunchFailed(({version:r,message:i,downloadUrl:a})=>{if(a){let i=`install-failed-${r}`,o=()=>{t({id:i,body:NZ(r),variant:`error`,priority:UZ,action:{label:PZ,onClick:()=>{e.update.relaunchNow().then(()=>{n(i)},e=>{console.warn(`[update-notice] install-failed retry rejected`,e),o()})}},secondaryAction:{label:FZ,onClick:()=>{e.shell.openExternal(a)}}})};o();return}t({id:`relaunch-error-${r}`,body:i?`${MZ}: ${i}`:MZ,variant:`error`,priority:UZ})})),a.push(e.onWhatsNew(({version:a,releaseUrl:s})=>{if(i.isEligible(a)){i.onShown(a),t({id:`whats-new-combined-${a}`,body:zZ(a),variant:`success`,priority:GZ,combinedSubscribe:!0,whatsNew:{version:a,releaseUrl:s},action:{label:DZ,onClick:()=>{e.shell.openExternal(s)}}}),e.update.dismissWhatsNew(a);return}let c=`whats-new-${a}`;t({id:c,body:zZ(a),variant:`success`,priority:GZ,action:{label:DZ,onClick:()=>{e.shell.openExternal(s)}},onDismiss:()=>{e.update.dismissWhatsNew(a)}});let l=setTimeout(()=>{o.delete(l),n(c),e.update.dismissWhatsNew(a)},r);o.add(l)})),a.push(e.onWhatsNewDismissed(({version:e})=>{n(`whats-new-${e}`)})),a.push(e.onUpdateStuckHint(({downloadUrl:n})=>{t({id:`update-stuck-hint`,body:OZ,priority:HZ,action:{label:kZ,onClick:()=>{e.shell.openExternal(n)}}})})),()=>{for(let e of a)e();for(let e of o)clearTimeout(e);o.clear()}}function JZ(e,t,n,r=()=>{}){let i=`schema-incompatibility-${t.persistedSchemaVersion}`,a=`schema-incompatibility-error-${t.persistedSchemaVersion}`,o=e=>{r(i),n({id:a,body:LZ(IZ,e),variant:`error`,priority:VZ})};n({id:i,body:BZ(t.currentBuild),priority:VZ,action:{label:AZ,onClick:()=>{e.state.resetIncompatible().then(()=>{r(i)},o)}}})}var YZ=[],XZ=new Set,ZZ=!1;function QZ(){for(let e of XZ)e()}function $Z(e){let t=YZ.findIndex(t=>t.id===e.id);if(t===-1)YZ=[...YZ,e];else{let n=YZ.slice();n[t]=e,YZ=n}QZ()}function eQ(e){let t=YZ.filter(t=>t.id!==e);t.length!==YZ.length&&(YZ=t,QZ())}function tQ(){return YZ}function nQ(e){return XZ.add(e),()=>{XZ.delete(e)}}function rQ(){if(ZZ||typeof window>`u`)return;let e=window.okDesktop;e&&(ZZ=!0,qZ(e,$Z,eQ,void 0,{isEligible:e=>OF(FF.getSnapshot(),e),onShown:e=>FF.recordShown(e)}),e.state.query().then(t=>{t.schemaIncompatibility&&JZ(e,t.schemaIncompatibility,$Z,eQ)},e=>{console.warn(`[update-notices-store] bridge.state.query() failed`,e)}))}var iQ=6e4,aQ=e=>{let t=(0,$.c)(11),{href:n,label:r,icon:i}=e,a,o;t[0]===n?(a=t[1],o=t[2]):(a=e=>Du(e,n),o=e=>Du(e,n),t[0]=n,t[1]=a,t[2]=o);let s;t[3]===i?s=t[4]:(s=(0,Z.jsx)(i,{"aria-hidden":`true`,className:`size-3.5`}),t[3]=i,t[4]=s);let c;return t[5]!==n||t[6]!==r||t[7]!==a||t[8]!==o||t[9]!==s?(c=(0,Z.jsx)(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,onClick:a,onAuxClick:o,"aria-label":r,className:`rounded-md p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,children:s}),t[5]=n,t[6]=r,t[7]=a,t[8]=o,t[9]=s,t[10]=c):c=t[10],c};function oQ(e){let t=(0,$.c)(34),{version:n,onOpenReleaseNotes:r,onClose:i,store:a,autoDismissMs:o}=e,s=a===void 0?FF:a,c=o===void 0?iQ:o,{_:l}=At(),[u,d]=(0,Q.useState)(!1),f,p;t[0]!==c||t[1]!==i||t[2]!==u?(f=()=>{if(!u)return;let e=setTimeout(i,c);return()=>clearTimeout(e)},p=[u,i,c],t[0]=c,t[1]=i,t[2]=u,t[3]=f,t[4]=p):(f=t[3],p=t[4]),(0,Q.useEffect)(f,p);let m;t[5]===l?m=t[6]:(m=l({id:`GzPQ2f`}),t[5]=l,t[6]=m);let h;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(J,{id:`yLEyuq`}),t[7]=h):h=t[7];let g;t[8]===s?g=t[9]:(g=()=>{s.markSubscribed(),d(!0)},t[8]=s,t[9]=g);let _;t[10]!==i||t[11]!==s?(_=()=>{s.dismiss(),i()},t[10]=i,t[11]=s,t[12]=_):_=t[12];let v;t[13]!==g||t[14]!==_?(v=(0,Z.jsx)(SF,{source:`post_update_card`,compactSubmit:!0,description:h,onSuccess:g,onDismiss:_}),t[13]=g,t[14]=_,t[15]=v):v=t[15];let y;t[16]!==l||t[17]!==u?(y=u?null:(0,Z.jsxs)(`nav`,{"aria-label":l({id:`dbapvC`}),className:`mt-3 flex items-center gap-1.5 text-muted-foreground text-xs`,children:[(0,Z.jsx)(`span`,{className:`mr-0.5`,children:(0,Z.jsx)(J,{id:`9sBe85`})}),(0,Z.jsx)(aQ,{href:TF,label:l({id:`I7Exsw`}),icon:zF}),(0,Z.jsx)(aQ,{href:CF,label:l({id:`zyKa-I`}),icon:RF}),(0,Z.jsx)(aQ,{href:wF,label:l({id:`36aWJD`}),icon:LF})]}),t[16]=l,t[17]=u,t[18]=y):y=t[18];let b;t[19]!==y||t[20]!==v?(b=(0,Z.jsxs)(`div`,{className:`px-3 py-2.5`,children:[v,y]}),t[19]=y,t[20]=v,t[21]=b):b=t[21];let x;t[22]===n?x=t[23]:(x=(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:(0,Z.jsx)(J,{id:`hLy8b1`,values:{version:n}})}),t[22]=n,t[23]=x);let S;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(J,{id:`_PACVa`}),t[24]=S):S=t[24];let C;t[25]===r?C=t[26]:(C=(0,Z.jsx)(X,{variant:`link`,size:`sm`,className:`h-auto p-0 text-muted-foreground text-xs hover:text-foreground`,onClick:r,children:S}),t[25]=r,t[26]=C);let w;t[27]!==x||t[28]!==C?(w=(0,Z.jsxs)(`div`,{className:`flex items-center justify-between border-t bg-muted/30 px-3 py-2.5 space-x-2`,children:[x,C]}),t[27]=x,t[28]=C,t[29]=w):w=t[29];let T;return t[30]!==b||t[31]!==w||t[32]!==m?(T=(0,Z.jsxs)(`section`,{"aria-label":m,className:`mx-1 mb-1 overflow-hidden rounded-lg border bg-card text-card-foreground`,children:[b,w]}),t[30]=b,t[31]=w,t[32]=m,t[33]=T):T=t[33],T}function sQ(e){let t=(0,$.c)(37),{notice:n,onDismiss:r}=e,{_:i}=At(),a=n.variant===`error`?`border-destructive/60 bg-sidebar-accent/30 text-muted-foreground`:n.variant===`success`?`border-emerald-500/40 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400`:`border-sidebar-border bg-sidebar-accent/30 text-muted-foreground`,o;t[0]!==i||t[1]!==n.dismissible||t[2]!==r?(o=n.dismissible===!1?null:(0,Z.jsx)(X,{variant:`ghost`,size:`icon`,className:`size-5 shrink-0 text-muted-foreground hover:text-sidebar-foreground`,"aria-label":i({id:`GUYwCr`}),onClick:r,children:(0,Z.jsx)(vs,{"aria-hidden":`true`,className:`size-3`})}),t[0]=i,t[1]=n.dismissible,t[2]=r,t[3]=o):o=t[3];let s=o,c=`shrink-0 text-xs font-medium underline underline-offset-2 ${n.variant===`success`?`decoration-emerald-500/40`:`decoration-muted-foreground/40`} hover:text-sidebar-foreground hover:decoration-sidebar-foreground`;if(n.secondaryAction){let e=`update-notice-${n.id}`,r=`flex flex-col gap-2 rounded-md border px-2 py-2 text-xs ${a}`,i;t[4]===n.body?i=t[5]:(i=(0,Z.jsx)(`span`,{className:`flex-1 leading-snug`,children:n.body}),t[4]=n.body,t[5]=i);let o;t[6]!==s||t[7]!==i?(o=(0,Z.jsxs)(`div`,{className:`flex items-start gap-2`,children:[i,s]}),t[6]=s,t[7]=i,t[8]=o):o=t[8];let l;t[9]!==c||t[10]!==n.action?(l=n.action?(0,Z.jsx)(`button`,{type:`button`,className:c,onClick:()=>{n.action?.onClick()},children:n.action.label}):null,t[9]=c,t[10]=n.action,t[11]=l):l=t[11];let u;t[12]===n.secondaryAction?u=t[13]:(u=()=>{n.secondaryAction?.onClick()},t[12]=n.secondaryAction,t[13]=u);let d;t[14]!==c||t[15]!==n.secondaryAction.label||t[16]!==u?(d=(0,Z.jsx)(`button`,{type:`button`,className:c,onClick:u,children:n.secondaryAction.label}),t[14]=c,t[15]=n.secondaryAction.label,t[16]=u,t[17]=d):d=t[17];let f;t[18]!==l||t[19]!==d?(f=(0,Z.jsxs)(`div`,{className:`flex gap-3 pl-1`,children:[l,d]}),t[18]=l,t[19]=d,t[20]=f):f=t[20];let p;return t[21]!==e||t[22]!==r||t[23]!==o||t[24]!==f?(p=(0,Z.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"data-testid":e,className:r,children:[o,f]}),t[21]=e,t[22]=r,t[23]=o,t[24]=f,t[25]=p):p=t[25],p}let l=`update-notice-${n.id}`,u=`flex items-center gap-2 rounded-md border px-2 py-1.5 text-xs ${a}`,d;t[26]===n.body?d=t[27]:(d=(0,Z.jsx)(`span`,{className:`flex-1 leading-snug`,children:n.body}),t[26]=n.body,t[27]=d);let f;t[28]!==c||t[29]!==n.action?(f=n.action?(0,Z.jsx)(`button`,{type:`button`,className:c,onClick:()=>{n.action?.onClick()},children:n.action.label}):null,t[28]=c,t[29]=n.action,t[30]=f):f=t[30];let p;return t[31]!==s||t[32]!==l||t[33]!==u||t[34]!==d||t[35]!==f?(p=(0,Z.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"data-testid":l,className:u,children:[d,f,s]}),t[31]=s,t[32]=l,t[33]=u,t[34]=d,t[35]=f,t[36]=p):p=t[36],p}function cQ(e){if(e.length===0)return null;let t=e[0];if(!t)return null;for(let n=1;n<e.length;n++){let r=e[n];r&&r.priority<t.priority&&(t=r)}return t}function lQ(){let e=(0,$.c)(15),t=(0,Q.useSyncExternalStore)(nQ,tQ,tQ),n;e[0]===t?n=e[1]:(n=cQ(t),e[0]=t,e[1]=n);let r=n;if(!r)return null;if(r.combinedSubscribe&&r.whatsNew){let t;e[2]===r.action?t=e[3]:(t=()=>r.action?.onClick(),e[2]=r.action,e[3]=t);let n;e[4]===r.id?n=e[5]:(n=()=>eQ(r.id),e[4]=r.id,e[5]=n);let i;return e[6]!==r.whatsNew.version||e[7]!==t||e[8]!==n?(i=(0,Z.jsx)(`div`,{"data-testid":`update-notices-list`,children:(0,Z.jsx)(oQ,{version:r.whatsNew.version,onOpenReleaseNotes:t,onClose:n})}),e[6]=r.whatsNew.version,e[7]=t,e[8]=n,e[9]=i):i=e[9],i}let i;e[10]===r?i=e[11]:(i=()=>{r.onDismiss?.(),eQ(r.id)},e[10]=r,e[11]=i);let a;return e[12]!==r||e[13]!==i?(a=(0,Z.jsx)(`div`,{"data-testid":`update-notices-list`,children:(0,Z.jsx)(sQ,{notice:r,onDismiss:i})}),e[12]=r,e[13]=i,e[14]=a):a=e[14],a}function uQ(e,t){return e?.kind===`doc`||e?.kind===`folder-index`?Po(t.contentDir,Ro(e.docName),t.pathSeparator):e?.kind===`folder`?Po(t.contentDir,e.folderPath,t.pathSeparator):e?.kind===`asset`?Po(t.contentDir,e.assetPath,t.pathSeparator):t.contentDir}function dQ(e){return e?.kind===`doc`||e?.kind===`folder-index`?Ro(e.docName):e?.kind===`folder`?e.folderPath:e?.kind===`asset`?e.assetPath:``}function fQ(e,t){return e===null?ha({workspace:t}):e.kind===`folder`?t?ka({folderRelativePath:e.folderPath,workspace:t}):null:e.kind===`doc`||e.kind===`folder-index`?ja({docName:e.docName,workspace:t}):null}var pQ={folderCount:0,expandedCount:0},mQ=`button, [role="button"], [role="menuitem"], input, textarea, select, a[href]`;function hQ(e){return typeof Element>`u`||!(e instanceof Element)?!1:e.closest(mQ)!==null}function gQ(e){let t=(0,$.c)(2),{onOpenSearch:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(xl,{name:`file-sidebar`,children:(0,Z.jsx)(yQ,{onOpenSearch:n})}),t[0]=n,t[1]=r),r}var _Q=e=>{let t=(0,$.c)(15),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({icon:n,label:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=(0,Z.jsx)(n,{"aria-hidden":`true`}),t[4]=n,t[5]=a);let o;t[6]!==r||t[7]!==i||t[8]!==a?(o=(0,Z.jsx)(Ds,{asChild:!0,children:(0,Z.jsx)(X,{variant:`ghost`,size:`icon-sm`,"aria-label":r,...i,children:a})}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9];let s;t[10]===r?s=t[11]:(s=(0,Z.jsx)(Os,{children:r}),t[10]=r,t[11]=s);let c;return t[12]!==o||t[13]!==s?(c=(0,Z.jsxs)(As,{children:[o,s]}),t[12]=o,t[13]=s,t[14]=c):c=t[14],c},vQ=e=>{let t=(0,$.c)(15),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({icon:n,label:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=(0,Z.jsx)(n,{"aria-hidden":`true`}),t[4]=n,t[5]=a);let o;t[6]!==r||t[7]!==i||t[8]!==a?(o=(0,Z.jsx)(Ds,{asChild:!0,children:(0,Z.jsx)(oc,{asChild:!0,children:(0,Z.jsx)(X,{variant:`ghost`,size:`icon-sm`,"aria-label":r,...i,children:a})})}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9];let s;t[10]===r?s=t[11]:(s=(0,Z.jsx)(Os,{children:r}),t[10]=r,t[11]=s);let c;return t[12]!==o||t[13]!==s?(c=(0,Z.jsxs)(As,{children:[o,s]}),t[12]=o,t[13]=s,t[14]=c):c=t[14],c};function yQ(e){let t=(0,$.c)(308),{onOpenSearch:n}=e,{_:r}=At(),[i,a]=(0,Q.useState)(null),[o,s]=(0,Q.useState)(null),{activeDocName:c,activeTarget:l}=Xe(),u;t[0]!==c||t[1]!==l?(u=l?.kind===`folder`||l?.kind===`folder-index`?l.folderPath:nl(c),t[0]=c,t[1]=l,t[2]=u):u=t[2];let d=u,f;t[3]===d?f=t[4]:(f=ul(d)?``:d,t[3]=d,t[4]=f);let p=f,[m,g]=(0,Q.useState)(!1),_=m?``:p,v=typeof window<`u`&&window.okDesktop!=null,{state:y,toggleSidebar:b}=$j(),x=Io(),S=y===`expanded`,C=v&&y===`collapsed`,[w,T]=(0,Q.useState)(pQ),E,D;t[5]===i?(E=t[6],D=t[7]):(E=()=>{if(i===null)return;let e=()=>{T(i.getFolderState()),g(i.isCreationTargetCleared())};return e(),i.subscribe(e)},D=[i],t[5]=i,t[6]=E,t[7]=D),(0,Q.useEffect)(E,D);let O,k;t[8]===i?(O=t[9],k=t[10]):(O=()=>{if(i!==null)return WS(e=>{let t=e.initialDir??``;if(e.template){i.createFromTemplate(e.template.folder,e.template.name);return}i.startCreating(`file`,t)})},k=[i],t[8]=i,t[9]=O,t[10]=k),(0,Q.useEffect)(O,k);let A=w.folderCount>0,j=A&&w.expandedCount===w.folderCount,M=w.expandedCount===0,N=bo(``),P=bo(_===``?null:_),F=_===``?N:P,I=N.state.status===`ready`?(N.state.data.folder.templates_available?.length??0)>0:!0,L=F.state.status===`ready`?(F.state.data.folder.templates_available?.length??0)>0:!0,R=typeof window<`u`?window.okDesktop:void 0,z=ua(),{status:B}=Bi(),V=B?.hasRemote===!0,H;t[11]!==r||t[12]!==z?.contentDir?(H=R?.config?.projectName||z?.contentDir.split(`/`).filter(Boolean).pop()||r({id:`sER-bs`}),t[11]=r,t[12]=z?.contentDir,t[13]=H):H=t[13];let U=H,W=ba().states,{dispatch:G}=fa(),ee;t[14]===z?ee=t[15]:(ee=ha({workspace:z}),t[14]=z,t[15]=ee);let te=ee,{projectLocalBinding:K,merged:ne}=du(),re=ne?.appearance?.sidebar?.showHiddenFiles??!1,ie=ne?.appearance?.sidebar?.showOkFolders??!1,q=ne?.appearance?.sidebar?.showOnlyMarkdownFiles??!1,ae=ne?.appearance?.sidebar?.showSkillsSection??!0,oe=A&&!j,se=A&&!M,ce=oe||se,le=wQ,ue;t[16]!==i||t[17]!==z?(ue=()=>{z&&i?.startCreating(`file`,``)},t[16]=i,t[17]=z,t[18]=ue):ue=t[18];let de=ue,fe;t[19]!==i||t[20]!==z?(fe=e=>{z&&i?.createFromTemplate(``,e)},t[19]=i,t[20]=z,t[21]=fe):fe=t[21];let pe=fe,me;t[22]!==i||t[23]!==z?(me=()=>{z&&i?.startCreating(`folder`,``)},t[22]=i,t[23]=z,t[24]=me):me=t[24];let he=me,ge;t[25]===z?ge=t[26]:(ge=()=>{!z||!R||R.shell.showItemInFolder(z.contentDir)},t[25]=z,t[26]=ge);let _e=ge,ve;t[27]!==r||t[28]!==z?(ve=async()=>{if(z)try{await navigator.clipboard.writeText(z.contentDir),_s.success(r({id:`6_ZOw4`}),{description:z.contentDir})}catch(e){console.warn(`[FileSidebar] clipboard write failed:`,e),_s.error(r({id:`vfRlCI`}))}},t[27]=r,t[28]=z,t[29]=ve):ve=t[29];let ye=ve,be;t[30]!==r||t[31]!==V?(be=()=>{za({...Ia(``),hasRemote:V,onClickWhenNoRemote:()=>{_s.error(r({id:`WyQxwa`}))}},{clipboardWrite:Ca,toastSuccess:CQ,toastError:SQ,logEvent:xQ})},t[30]=r,t[31]=V,t[32]=be):be=t[32];let xe=be,Se;t[33]!==r||t[34]!==K?(Se=e=>{if(K===null)return;let t=K.patch({appearance:{sidebar:e}});t.ok||(console.warn(`[FileSidebar] sidebar visibility toggle rejected:`,Wn(t.error)),_s.error(r({id:`P47EWZ`}),{description:Wn(t.error)}))},t[33]=r,t[34]=K,t[35]=Se):Se=t[35];let Ce=Se,we;t[36]===i?we=t[37]:(we=()=>{i?.expandAll()},t[36]=i,t[37]=we);let Te=we,Ee;t[38]===i?Ee=t[39]:(Ee=()=>{i?.collapseAll()},t[38]=i,t[39]=Ee);let De=Ee,Oe,ke;t[40]!==se||t[41]!==oe||t[42]!==re||t[43]!==ie||t[44]!==q||t[45]!==ae||t[46]!==y?(Oe=()=>{R&&R.editor.notifyViewMenuStateChanged({showHiddenFiles:re,showOkFolders:ie,showOnlyMarkdownFiles:q,showSkillsSection:ae,canExpandAll:oe,canCollapseAll:se,sidebarVisible:y===`expanded`})},ke=[R,re,ie,q,ae,oe,se,y],t[40]=se,t[41]=oe,t[42]=re,t[43]=ie,t[44]=q,t[45]=ae,t[46]=y,t[47]=Oe,t[48]=ke):(Oe=t[47],ke=t[48]),(0,Q.useEffect)(Oe,ke);let Ae;t[49]!==r||t[50]!==l||t[51]!==G||t[52]!==W||t[53]!==_||t[54]!==Ce||t[55]!==re||t[56]!==ie||t[57]!==q||t[58]!==ae||t[59]!==b||t[60]!==i||t[61]!==z?(Ae=()=>{if(R)return R.onMenuAction(e=>{let t=l!==null&&ul(dQ(l));switch(e){case`new-doc`:if(!z||!i)return;i.startCreating(`file`,_);return;case`new-folder`:if(!z||!i)return;i.startCreating(`folder`,_);return;case`new-from-template`:if(!z||!i)return;i.startCreatingFromTemplate(_);return;case`rename`:if(!l||t)return;wJ(l);return;case`duplicate`:if(!l||t)return;EJ(l);return;case`move-to-trash`:if(!l||t)return;SJ(l);return;case`reveal-in-finder`:{if(!R||!z)return;let e=uQ(l,z);R.shell.showItemInFolder(e);return}case`send-to-ai`:{let e=la.filter(e=>W[e.id]?.installed===!0);if(e.length===0){_s.error(r({id:`LKOLNn`}));return}let t=fQ(l,z);if(!t)return;let[n]=e;if(!n)return;G(n.id,t);return}case`copy-full-path`:{if(!z)return;let e=uQ(l,z);navigator.clipboard.writeText(e).then(()=>_s.success(r({id:`6_ZOw4`}),{description:e})).catch(e=>{console.warn(`[FileSidebar] clipboard write failed:`,e),_s.error(r({id:`vfRlCI`}))});return}case`copy-relative-path`:{let e=dQ(l);if(e===``){_s.error(r({id:`74eHt-`}));return}navigator.clipboard.writeText(e).then(()=>_s.success(r({id:`haHgQj`}),{description:e})).catch(e=>{console.warn(`[FileSidebar] clipboard write failed:`,e),_s.error(r({id:`5QGTaA`}))});return}case`toggle-show-ok-folders`:Ce({showOkFolders:!ie});return;case`toggle-show-hidden-files`:Ce({showHiddenFiles:!re});return;case`toggle-show-only-markdown-files`:Ce({showOnlyMarkdownFiles:!q});return;case`toggle-show-skills-section`:Ce({showSkillsSection:!ae});return;case`expand-all-tree`:i?.expandAll();return;case`collapse-all-tree`:i?.collapseAll();return;case`toggle-sidebar`:b();return;case`delete`:case`toggle-source`:case`save-version`:case`version-history`:case`focus-search`:case`focus-command-palette`:case`close-active-tab-or-window`:case`toggle-doc-panel`:return}})},t[49]=r,t[50]=l,t[51]=G,t[52]=W,t[53]=_,t[54]=Ce,t[55]=re,t[56]=ie,t[57]=q,t[58]=ae,t[59]=b,t[60]=i,t[61]=z,t[62]=Ae):Ae=t[62];let je;t[63]!==r||t[64]!==l||t[65]!==G||t[66]!==W||t[67]!==_||t[68]!==K||t[69]!==re||t[70]!==ie||t[71]!==q||t[72]!==ae||t[73]!==b||t[74]!==i||t[75]!==z?(je=[R,i,z,l,_,K,re,ie,q,ae,W,G,b,r],t[63]=r,t[64]=l,t[65]=G,t[66]=W,t[67]=_,t[68]=K,t[69]=re,t[70]=ie,t[71]=q,t[72]=ae,t[73]=b,t[74]=i,t[75]=z,t[76]=je):je=t[76],(0,Q.useEffect)(Ae,je);let Me=v&&S&&`motion-safe:delay-100`,Ne=C&&`opacity-0`,Pe;t[77]!==Me||t[78]!==Ne?(Pe=Y(`flex-row h-12 items-center py-0 px-3`,`justify-between`,v&&`overflow-x-clip`,v&&`motion-safe:transition-opacity motion-safe:duration-100 motion-safe:ease-out`,Me,Ne,v&&`[-webkit-app-region:drag]`),t[77]=Me,t[78]=Ne,t[79]=Pe):Pe=t[79];let Fe;t[80]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=v?(0,Z.jsx)(`div`,{"aria-hidden":`true`,"data-testid":`sidebar-traffic-light-reserve`,className:`w-[var(--ok-titlebar-reserve-left,0px)] shrink-0 self-stretch`}):null,t[80]=Fe):Fe=t[80];let Ie;t[81]===S?Ie=t[82]:(Ie=S&&!v?(0,Z.jsx)(`span`,{className:`shrink-0 font-mono text-sm uppercase tracking-wider text-sidebar-foreground/50`,children:(0,Z.jsx)(J,{id:`sER-bs`})}):null,t[81]=S,t[82]=Ie);let Le;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(Le=Y(`flex items-center gap-1`,v&&`[&>*]:[-webkit-app-region:no-drag]`),t[83]=Le):Le=t[83];let Re;t[84]===r?Re=t[85]:(Re=r({id:`Rq1vFD`}),t[84]=r,t[85]=Re);let ze;t[86]===Re?ze=t[87]:(ze=(0,Z.jsx)(vQ,{icon:uf,label:Re}),t[86]=Re,t[87]=ze);let Be;t[88]!==oe||t[89]!==i?(Be=oe?(0,Z.jsxs)(bc,{onSelect:()=>i?.expandAll(),children:[(0,Z.jsx)(Zf,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`OlAl5i`})]}):null,t[88]=oe,t[89]=i,t[90]=Be):Be=t[90];let Ve;t[91]!==se||t[92]!==i?(Ve=se?(0,Z.jsxs)(bc,{onSelect:()=>i?.collapseAll(),children:[(0,Z.jsx)(Zd,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`qvWGzP`})]}):null,t[91]=se,t[92]=i,t[93]=Ve):Ve=t[93];let He;t[94]===ce?He=t[95]:(He=ce?(0,Z.jsx)(gc,{}):null,t[94]=ce,t[95]=He);let Ue;t[96]===r?Ue=t[97]:(Ue=r({id:`8vETh9`}),t[96]=r,t[97]=Ue);let We;t[98]===Symbol.for(`react.memo_cache_sentinel`)?(We=(0,Z.jsx)(jc,{children:(0,Z.jsx)(J,{id:`8vETh9`})}),t[98]=We):We=t[98];let Ge;t[99]===Ce?Ge=t[100]:(Ge=e=>Ce({showHiddenFiles:e}),t[99]=Ce,t[100]=Ge);let Ke=K===null,qe;t[101]===Symbol.for(`react.memo_cache_sentinel`)?(qe=(0,Z.jsx)(J,{id:`6KCH4m`}),t[101]=qe):qe=t[101];let Je;t[102]!==re||t[103]!==Ge||t[104]!==Ke?(Je=(0,Z.jsx)(Ec,{checked:re,onCheckedChange:Ge,disabled:Ke,"data-testid":`tree-options-show-hidden-files`,children:qe}),t[102]=re,t[103]=Ge,t[104]=Ke,t[105]=Je):Je=t[105];let Ye;t[106]===Ce?Ye=t[107]:(Ye=e=>Ce({showOkFolders:e}),t[106]=Ce,t[107]=Ye);let Ze=K===null,Qe;t[108]===Symbol.for(`react.memo_cache_sentinel`)?(Qe=(0,Z.jsx)(J,{id:`ELYtNJ`}),t[108]=Qe):Qe=t[108];let $e;t[109]!==ie||t[110]!==Ye||t[111]!==Ze?($e=(0,Z.jsx)(Ec,{checked:ie,onCheckedChange:Ye,disabled:Ze,"data-testid":`tree-options-show-ok-folders`,children:Qe}),t[109]=ie,t[110]=Ye,t[111]=Ze,t[112]=$e):$e=t[112];let et;t[113]===Ce?et=t[114]:(et=e=>Ce({showOnlyMarkdownFiles:e}),t[113]=Ce,t[114]=et);let tt=K===null,nt;t[115]===Symbol.for(`react.memo_cache_sentinel`)?(nt=(0,Z.jsx)(J,{id:`5-o4kO`}),t[115]=nt):nt=t[115];let rt;t[116]!==q||t[117]!==et||t[118]!==tt?(rt=(0,Z.jsx)(Ec,{checked:q,onCheckedChange:et,disabled:tt,"data-testid":`tree-options-show-only-markdown-files`,children:nt}),t[116]=q,t[117]=et,t[118]=tt,t[119]=rt):rt=t[119];let it;t[120]===Ce?it=t[121]:(it=e=>Ce({showSkillsSection:e}),t[120]=Ce,t[121]=it);let at=K===null,ot;t[122]===Symbol.for(`react.memo_cache_sentinel`)?(ot=(0,Z.jsx)(J,{id:`PCSkw2`}),t[122]=ot):ot=t[122];let st;t[123]!==ae||t[124]!==it||t[125]!==at?(st=(0,Z.jsx)(Ec,{checked:ae,onCheckedChange:it,disabled:at,"data-testid":`tree-options-show-skills`,children:ot}),t[123]=ae,t[124]=it,t[125]=at,t[126]=st):st=t[126];let ct;t[127]!==Ue||t[128]!==Je||t[129]!==$e||t[130]!==rt||t[131]!==st?(ct=(0,Z.jsxs)(xc,{"aria-label":Ue,children:[We,Je,$e,rt,st]}),t[127]=Ue,t[128]=Je,t[129]=$e,t[130]=rt,t[131]=st,t[132]=ct):ct=t[132];let lt;t[133]!==Be||t[134]!==Ve||t[135]!==He||t[136]!==ct?(lt=(0,Z.jsxs)(Sc,{align:`end`,className:`min-w-52`,"data-testid":`tree-options-menu`,children:[Be,Ve,He,ct]}),t[133]=Be,t[134]=Ve,t[135]=He,t[136]=ct,t[137]=lt):lt=t[137];let ut;t[138]!==ze||t[139]!==lt?(ut=(0,Z.jsxs)(Oc,{children:[ze,lt]}),t[138]=ze,t[139]=lt,t[140]=ut):ut=t[140];let dt;t[141]===r?dt=t[142]:(dt=r({id:`HdkSiO`}),t[141]=r,t[142]=dt);let ft;t[143]!==_||t[144]!==i?(ft=()=>i?.startCreating(`file`,_),t[143]=_,t[144]=i,t[145]=ft):ft=t[145];let pt;t[146]!==dt||t[147]!==ft?(pt=(0,Z.jsx)(_Q,{icon:Lf,label:dt,onClick:ft}),t[146]=dt,t[147]=ft,t[148]=pt):pt=t[148];let mt;t[149]!==r||t[150]!==L||t[151]!==_||t[152]!==i?(mt=L?(0,Z.jsxs)(Oc,{children:[(0,Z.jsx)(vQ,{icon:ao,label:r({id:`Uuj_R4`})}),(0,Z.jsx)(Sc,{align:`end`,className:`min-w-52`,children:(0,Z.jsx)(mJ,{parentDir:_,onSelectTemplate:e=>i?.createFromTemplate(_,e),ItemComponent:bc})})]}):null,t[149]=r,t[150]=L,t[151]=_,t[152]=i,t[153]=mt):mt=t[153];let ht;t[154]===r?ht=t[155]:(ht=r({id:`96G6Re`}),t[154]=r,t[155]=ht);let gt;t[156]!==_||t[157]!==i?(gt=()=>i?.startCreating(`folder`,_),t[156]=_,t[157]=i,t[158]=gt):gt=t[158];let _t;t[159]!==ht||t[160]!==gt?(_t=(0,Z.jsx)(_Q,{icon:$d,label:ht,onClick:gt}),t[159]=ht,t[160]=gt,t[161]=_t):_t=t[161];let vt;t[162]!==ut||t[163]!==pt||t[164]!==mt||t[165]!==_t?(vt=(0,Z.jsxs)(`div`,{"data-testid":`sidebar-toolbar`,className:Le,children:[ut,pt,mt,_t]}),t[162]=ut,t[163]=pt,t[164]=mt,t[165]=_t,t[166]=vt):vt=t[166];let yt;t[167]!==Pe||t[168]!==Ie||t[169]!==vt?(yt=(0,Z.jsxs)(sM,{"data-electron-drag":v?``:void 0,className:Pe,children:[Fe,Ie,vt]}),t[167]=Pe,t[168]=Ie,t[169]=vt,t[170]=yt):yt=t[170];let bt=v&&S&&`motion-safe:delay-100`,xt=C&&`opacity-0`,St;t[171]!==bt||t[172]!==xt?(St=Y(`px-2 pb-2`,v&&`[-webkit-app-region:no-drag]`,v&&`motion-safe:transition-opacity motion-safe:duration-100 motion-safe:ease-out`,bt,xt),t[171]=bt,t[172]=xt,t[173]=St):St=t[173];let Ct;t[174]===y?Ct=t[175]:(Ct=[y],t[174]=y,t[175]=Ct);let wt;t[176]===n?wt=t[177]:(wt=(0,Z.jsx)(_Z,{onClick:n}),t[176]=n,t[177]=wt);let Tt;t[178]!==Ct||t[179]!==wt?(Tt=(0,Z.jsx)(h,{fallbackRender:bQ,onError:gZ,resetKeys:Ct,children:wt}),t[178]=Ct,t[179]=wt,t[180]=Tt):Tt=t[180];let Et;t[181]!==St||t[182]!==Tt?(Et=(0,Z.jsx)(`div`,{className:St,children:Tt}),t[181]=St,t[182]=Tt,t[183]=Et):Et=t[183];let Dt;t[184]===Symbol.for(`react.memo_cache_sentinel`)?(Dt=(0,Z.jsx)(XI,{}),t[184]=Dt):Dt=t[184];let Ot;t[185]===Symbol.for(`react.memo_cache_sentinel`)?(Ot=(0,Z.jsx)(Bo,{className:`size-3.5 shrink-0`}),t[185]=Ot):Ot=t[185];let kt;t[186]===U?kt=t[187]:(kt=(0,Z.jsx)(`span`,{className:`truncate`,children:U}),t[186]=U,t[187]=kt);let jt;t[188]===Symbol.for(`react.memo_cache_sentinel`)?(jt=(0,Z.jsx)(ra,{className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-data-[state=open]/files:rotate-90`}),t[188]=jt):jt=t[188];let Mt;t[189]===kt?Mt=t[190]:(Mt=(0,Z.jsx)(dM,{asChild:!0,className:`shrink-0`,children:(0,Z.jsxs)(Ns,{"data-sidebar-root-context":!0,className:`flex w-full items-center gap-1.5`,children:[Ot,kt,jt]})}),t[189]=kt,t[190]=Mt);let Nt=o==null?`50vh`:`${o}px`,Pt;t[191]===Nt?Pt=t[192]:(Pt={height:Nt},t[191]=Nt,t[192]=Pt);let Ft;t[193]===Symbol.for(`react.memo_cache_sentinel`)?(Ft=(0,Z.jsx)(HY,{ref:a,onContentHeightChange:s}),t[193]=Ft):Ft=t[193];let It;t[194]===Pt?It=t[195]:(It=(0,Z.jsx)(Ms,{className:`flex max-h-[70vh] flex-col overflow-hidden`,style:Pt,children:Ft}),t[194]=Pt,t[195]=It);let Lt;t[196]!==Mt||t[197]!==It?(Lt=(0,Z.jsx)(Ps,{defaultOpen:!0,className:`group/files flex shrink-0 flex-col`,children:(0,Z.jsxs)(uM,{className:`min-h-0 px-0`,children:[Mt,It]})}),t[196]=Mt,t[197]=It,t[198]=Lt):Lt=t[198];let Rt;t[199]===ae?Rt=t[200]:(Rt=ae?(0,Z.jsx)(vZ,{}):null,t[199]=ae,t[200]=Rt);let zt;t[201]===i?zt=t[202]:(zt=(0,Z.jsx)(`div`,{"aria-hidden":!0,"data-sidebar-empty-deselect":!0,className:`min-h-8 flex-1 cursor-default`,onClick:()=>i?.clearCreationTarget()}),t[201]=i,t[202]=zt);let Bt;t[203]!==Lt||t[204]!==Rt||t[205]!==zt?(Bt=(0,Z.jsxs)(lM,{children:[Dt,Lt,Rt,zt]}),t[203]=Lt,t[204]=Rt,t[205]=zt,t[206]=Bt):Bt=t[206];let Vt;t[207]===Symbol.for(`react.memo_cache_sentinel`)?(Vt=(0,Z.jsxs)(cM,{className:`px-0`,children:[(0,Z.jsx)(zX,{}),(0,Z.jsx)(lQ,{}),typeof window<`u`&&window.okDesktop?(0,Z.jsx)(mM,{children:(0,Z.jsx)(hM,{children:(0,Z.jsx)(sZ,{bridge:window.okDesktop})})}):null]}),t[207]=Vt):Vt=t[207];let Ht=!(x&&y===`collapsed`),Ut;t[208]===Ht?Ut=t[209]:(Ut=(0,Z.jsx)(aM,{enableToggle:!1,enableDrag:Ht}),t[208]=Ht,t[209]=Ut);let Wt;t[210]!==yt||t[211]!==Et||t[212]!==Bt||t[213]!==Ut?(Wt=(0,Z.jsx)(bP,{asChild:!0,children:(0,Z.jsxs)(`div`,{className:`contents`,onContextMenu:le,children:[yt,Et,Bt,Vt,Ut]})}),t[210]=yt,t[211]=Et,t[212]=Bt,t[213]=Ut,t[214]=Wt):Wt=t[214];let Gt=!z,Kt,qt;t[215]===Symbol.for(`react.memo_cache_sentinel`)?(Kt=(0,Z.jsx)(Lf,{"aria-hidden":`true`}),qt=(0,Z.jsx)(J,{id:`HdkSiO`}),t[215]=Kt,t[216]=qt):(Kt=t[215],qt=t[216]);let Jt;t[217]!==de||t[218]!==Gt?(Jt=(0,Z.jsxs)(wP,{disabled:Gt,onSelect:de,"data-testid":`empty-space-menu-new-file`,children:[Kt,qt]}),t[217]=de,t[218]=Gt,t[219]=Jt):Jt=t[219];let Yt;t[220]!==pe||t[221]!==I||t[222]!==z?(Yt=I?(0,Z.jsxs)(SP,{children:[(0,Z.jsxs)(TP,{disabled:!z,"data-testid":`empty-space-menu-new-from-template`,children:[(0,Z.jsx)(ao,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`Uuj_R4`})]}),(0,Z.jsx)(EP,{children:(0,Z.jsx)(mJ,{parentDir:``,onSelectTemplate:pe,ItemComponent:wP})})]}):null,t[220]=pe,t[221]=I,t[222]=z,t[223]=Yt):Yt=t[223];let Xt=!z,Zt,Qt;t[224]===Symbol.for(`react.memo_cache_sentinel`)?(Zt=(0,Z.jsx)($d,{"aria-hidden":`true`}),Qt=(0,Z.jsx)(J,{id:`96G6Re`}),t[224]=Zt,t[225]=Qt):(Zt=t[224],Qt=t[225]);let $t;t[226]!==he||t[227]!==Xt?($t=(0,Z.jsxs)(wP,{disabled:Xt,onSelect:he,"data-testid":`empty-space-menu-new-folder`,children:[Zt,Qt]}),t[226]=he,t[227]=Xt,t[228]=$t):$t=t[228];let en;t[229]===Symbol.for(`react.memo_cache_sentinel`)?(en=(0,Z.jsx)(kP,{}),t[229]=en):en=t[229];let tn;t[230]!==r||t[231]!==_e||t[232]!==z?(tn=R?(0,Z.jsxs)(wP,{disabled:!z,onSelect:_e,"data-testid":`empty-space-menu-reveal-in-finder`,"aria-label":r(z?{id:`LtSYdi`}:{id:`o2yoFu`}),children:[(0,Z.jsx)(Bo,{"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(J,{id:`LtSYdi`})}),z?null:(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:(0,Z.jsx)(J,{id:`wTcjov`})})]}):null,t[230]=r,t[231]=_e,t[232]=z,t[233]=tn):tn=t[233];let nn;t[234]!==G||t[235]!==te||t[236]!==W?(nn=(0,Z.jsx)(DX,{input:te,installStates:W,dispatch:G}),t[234]=G,t[235]=te,t[236]=W,t[237]=nn):nn=t[237];let rn;t[238]!==xe||t[239]!==V?(rn=V?(0,Z.jsxs)(wP,{onSelect:xe,"data-testid":`empty-space-menu-share`,children:[(0,Z.jsx)(Nf,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`Z8lGw6`})]}):null,t[238]=xe,t[239]=V,t[240]=rn):rn=t[240];let an=!z,on;t[241]!==r||t[242]!==z?(on=r(z?{id:`Up2_7p`}:{id:`U8CD-l`}),t[241]=r,t[242]=z,t[243]=on):on=t[243];let sn;t[244]===Symbol.for(`react.memo_cache_sentinel`)?(sn=(0,Z.jsx)(Ao,{"aria-hidden":`true`}),t[244]=sn):sn=t[244];let cn;t[245]===Symbol.for(`react.memo_cache_sentinel`)?(cn=(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(J,{id:`Up2_7p`})}),t[245]=cn):cn=t[245];let ln;t[246]===z?ln=t[247]:(ln=z?null:(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:(0,Z.jsx)(J,{id:`wTcjov`})}),t[246]=z,t[247]=ln);let un;t[248]!==ye||t[249]!==an||t[250]!==on||t[251]!==ln?(un=(0,Z.jsxs)(wP,{disabled:an,onSelect:ye,"data-testid":`empty-space-menu-copy-full-path`,"aria-label":on,children:[sn,cn,ln]}),t[248]=ye,t[249]=an,t[250]=on,t[251]=ln,t[252]=un):un=t[252];let dn;t[253]===Symbol.for(`react.memo_cache_sentinel`)?(dn=(0,Z.jsx)(kP,{}),t[253]=dn):dn=t[253];let fn;t[254]===Ce?fn=t[255]:(fn=e=>Ce({showHiddenFiles:e}),t[254]=Ce,t[255]=fn);let pn=K===null,mn;t[256]===Symbol.for(`react.memo_cache_sentinel`)?(mn=(0,Z.jsx)(J,{id:`XcGbim`}),t[256]=mn):mn=t[256];let hn;t[257]!==re||t[258]!==fn||t[259]!==pn?(hn=(0,Z.jsx)(DP,{checked:re,onCheckedChange:fn,disabled:pn,"data-testid":`empty-space-menu-show-hidden-files`,children:mn}),t[257]=re,t[258]=fn,t[259]=pn,t[260]=hn):hn=t[260];let gn;t[261]===Ce?gn=t[262]:(gn=e=>Ce({showOkFolders:e}),t[261]=Ce,t[262]=gn);let _n=K===null,vn;t[263]===Symbol.for(`react.memo_cache_sentinel`)?(vn=(0,Z.jsx)(J,{id:`GHsJb8`}),t[263]=vn):vn=t[263];let yn;t[264]!==ie||t[265]!==gn||t[266]!==_n?(yn=(0,Z.jsx)(DP,{checked:ie,onCheckedChange:gn,disabled:_n,"data-testid":`empty-space-menu-show-ok-folders`,children:vn}),t[264]=ie,t[265]=gn,t[266]=_n,t[267]=yn):yn=t[267];let bn;t[268]===Ce?bn=t[269]:(bn=e=>Ce({showOnlyMarkdownFiles:e}),t[268]=Ce,t[269]=bn);let xn=K===null,Sn;t[270]===Symbol.for(`react.memo_cache_sentinel`)?(Sn=(0,Z.jsx)(J,{id:`WkTLN7`}),t[270]=Sn):Sn=t[270];let Cn;t[271]!==q||t[272]!==bn||t[273]!==xn?(Cn=(0,Z.jsx)(DP,{checked:q,onCheckedChange:bn,disabled:xn,"data-testid":`empty-space-menu-show-only-markdown-files`,children:Sn}),t[271]=q,t[272]=bn,t[273]=xn,t[274]=Cn):Cn=t[274];let wn;t[275]===Ce?wn=t[276]:(wn=e=>Ce({showSkillsSection:e}),t[275]=Ce,t[276]=wn);let Tn=K===null,En;t[277]===Symbol.for(`react.memo_cache_sentinel`)?(En=(0,Z.jsx)(J,{id:`NF_Wcg`}),t[277]=En):En=t[277];let Dn;t[278]!==ae||t[279]!==wn||t[280]!==Tn?(Dn=(0,Z.jsx)(DP,{checked:ae,onCheckedChange:wn,disabled:Tn,"data-testid":`empty-space-menu-show-skills-section`,children:En}),t[278]=ae,t[279]=wn,t[280]=Tn,t[281]=Dn):Dn=t[281];let On;t[282]===ce?On=t[283]:(On=ce?(0,Z.jsx)(kP,{}):null,t[282]=ce,t[283]=On);let kn;t[284]!==Te||t[285]!==oe?(kn=oe?(0,Z.jsxs)(wP,{onSelect:Te,"data-testid":`empty-space-menu-expand-all`,children:[(0,Z.jsx)(Zf,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`OlAl5i`})]}):null,t[284]=Te,t[285]=oe,t[286]=kn):kn=t[286];let An;t[287]!==De||t[288]!==se?(An=se?(0,Z.jsxs)(wP,{onSelect:De,"data-testid":`empty-space-menu-collapse-all`,children:[(0,Z.jsx)(Zd,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`qvWGzP`})]}):null,t[287]=De,t[288]=se,t[289]=An):An=t[289];let jn;t[290]!==un||t[291]!==hn||t[292]!==yn||t[293]!==Cn||t[294]!==Dn||t[295]!==On||t[296]!==kn||t[297]!==An||t[298]!==Jt||t[299]!==Yt||t[300]!==$t||t[301]!==tn||t[302]!==nn||t[303]!==rn?(jn=(0,Z.jsxs)(CP,{className:`min-w-52`,children:[Jt,Yt,$t,en,tn,nn,rn,un,dn,hn,yn,Cn,Dn,On,kn,An]}),t[290]=un,t[291]=hn,t[292]=yn,t[293]=Cn,t[294]=Dn,t[295]=On,t[296]=kn,t[297]=An,t[298]=Jt,t[299]=Yt,t[300]=$t,t[301]=tn,t[302]=nn,t[303]=rn,t[304]=jn):jn=t[304];let Mn;return t[305]!==jn||t[306]!==Wt?(Mn=(0,Z.jsx)(rM,{variant:`inset`,children:(0,Z.jsxs)(yP,{children:[Wt,jn]})}),t[305]=jn,t[306]=Wt,t[307]=Mn):Mn=t[307],Mn}function bQ(){return null}function xQ(e){return console.log(e)}function SQ(e){return _s.error(e)}function CQ(e){return _s.success(e)}function wQ(e){e.target instanceof Element&&e.target.closest(`[data-sidebar-root-context]`)||hQ(e.target)&&(e.preventDefault(),e.stopPropagation())}var TQ=(0,Q.lazy)(()=>n(()=>import(`./McpConsentDialogBody-CBhFj_dO.js`),__vite__mapDeps([104,1,10,3,11,6,7,81,20,21,15,13,16,63,64,61,62,83,19,31,70,42,105]),import.meta.url));function EQ(){let e=(0,$.c)(1);if(!(0,Q.useSyncExternalStore)(ld.subscribe,OQ,DQ))return null;let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(TQ,{})}),e[0]=t):t=e[0],t}function DQ(){return!1}function OQ(){return ld.getSnapshot()!==null}function kQ(){let e=(0,$.c)(17),t=rn(),{collabUrl:n,setSystemProvider:r,updateServerInstanceId:i,onBranchSwitched:a,observeBranch:o,observeDiskAck:s,refreshServerInfo:c}=Xe(),l;e[0]!==o||e[1]!==s||e[2]!==a||e[3]!==c||e[4]!==i?(l={updateServerInstanceId:i,onBranchSwitched:a,observeBranch:o,observeDiskAck:s,refreshServerInfo:c},e[0]=o,e[1]=s,e[2]=a,e[3]=c,e[4]=i,e[5]=l):l=e[5];let u=(0,Q.useRef)(l),d;e[6]!==o||e[7]!==s||e[8]!==a||e[9]!==c||e[10]!==i?(d=()=>{u.current={updateServerInstanceId:i,onBranchSwitched:a,observeBranch:o,observeDiskAck:s,refreshServerInfo:c}},e[6]=o,e[7]=s,e[8]=a,e[9]=c,e[10]=i,e[11]=d):d=e[11],(0,Q.useEffect)(d);let f,p;return e[12]!==n||e[13]!==t||e[14]!==r?(f=()=>{if(n===null)return;let e=new Vl,i=new zl({url:n,name:hr,document:e,onStateless:e=>{let{payload:t}=e;b(t,{onServerInfo:e=>{u.current.updateServerInstanceId(e.serverInstanceId),e.currentBranch!==void 0&&u.current.observeBranch(e.currentBranch)},onBranchSwitched:e=>{u.current.onBranchSwitched(e.branch)},onDiskAck:e=>{u.current.observeDiskAck(e.docName,e.sv)},onDerivedView:FQ,onConfigValidationRejected:PQ,onConfigIgnoreNestedError:NQ,onUnknown:MQ})},onClose:jQ,onDisconnect:AQ}),a=gl(e=>{(e.includes(`files`)||e.includes(`backlinks`))&&(t.invalidateQueries({queryKey:[`backlinks`]}),t.invalidateQueries({queryKey:[`forward-links`]})),(e.includes(`files`)||e.includes(`graph`))&&(t.invalidateQueries({queryKey:[`orphans`]}),t.invalidateQueries({queryKey:[`hubs`]}))}),o=M(()=>{u.current.refreshServerInfo()});i.on(`synced`,()=>{hl([`files`,`backlinks`,`graph`]),o()});let s=new Set,c=()=>{if(i.awareness)for(let[e,t]of i.awareness.getStates().entries())s.has(e)||t.user?.type===`agent`&&(s.add(e),console.warn(`[agent-presence] observed stale AwarenessUser.type === 'agent' from clientID ${e} — probably a stale bundled client`))};return i.awareness?.on(`change`,c),r(i),()=>{a(),i.awareness?.off(`change`,c),r(null),i.destroy(),e.destroy()}},p=[t,n,r],e[12]=n,e[13]=t,e[14]=r,e[15]=f,e[16]=p):(f=e[15],p=e[16]),(0,Q.useEffect)(f,p),null}function AQ(){console.warn(`[CC1] __system__ disconnected - derived views may be stale`)}function jQ(e){let{event:t}=e;console.warn(`[CC1] __system__ connection closed:`,t.code,t.reason)}function MQ(e){console.warn(`[CC1] Unparseable stateless payload, skipping:`,e.slice(0,100))}function NQ(e){to(e)}function PQ(e){vo(e)}function FQ(e){hl([e.ch])}function IQ(e){let t=we(e);if(t)return{scope:`project`,name:t};let n=Qn(e);return n?.kind===`skill`?{scope:n.scope,name:n.name}:null}function LQ(e,t){let n=new Set(t.map(e=>`${e.scope}\u0000${e.name}`)),r=[];for(let t of e){let e=IQ(t);if(!e||n.has(`${e.scope}\u0000${e.name}`))continue;let i=e.scope===`project`?`global`:`project`;n.has(`${i}\u0000${e.name}`)?r.push({kind:`retarget`,fromDocName:t,toDocName:Ln(i,e.name)}):r.push({kind:`close`,docName:t})}return r}function RQ(){let e=(0,$.c)(13),{openTabs:t,closeDocument:n}=Xe(),r;e[0]===t?r=e[1]:(r=t.some(BQ),e[0]=t,e[1]=r);let i=r,a;e[2]===i?a=e[3]:(a={enabled:i},e[2]=i,e[3]=a);let o=xa(a),s=(0,Q.useRef)(null),c;e[4]!==n||e[5]!==t||e[6]!==o.data||e[7]!==o.status?(c=()=>{if(o.status!==`ready`)return;let e=o.data,r=`${t.join(``)}\u0002${e.map(zQ).sort().join(``)}`;if(s.current===r)return;s.current=r;let i=LQ(t,e);for(let e of i)e.kind===`retarget`?($o(e.toDocName),n(e.fromDocName)):n(e.docName)},e[4]=n,e[5]=t,e[6]=o.data,e[7]=o.status,e[8]=c):c=e[8];let l;e[9]!==n||e[10]!==t||e[11]!==o?(l=[o,t,n],e[9]=n,e[10]=t,e[11]=o,e[12]=l):l=e[12],(0,Q.useEffect)(c,l)}function zQ(e){return`${e.scope}\u0000${e.name}`}function BQ(e){return IQ(e)!==null}var VQ=1e3,HQ=3e4;function UQ(e){let t=e.scheduler??{setTimeout:(e,t)=>globalThis.setTimeout(e,t),clearTimeout:e=>globalThis.clearTimeout(e)},n=e.initialBackoffMs??VQ,r=e.maxBackoffMs??HQ,i=e.rng??Math.random,a=e.createWebSocket??(e=>new WebSocket(e)),o=e.logger??null,s=e.log,c=null,l=null,u=!1,d=n;function f(e,t,n){try{o?o[e](t,n):s?.(t)}catch{}}function p(){if(u)return;l!==null&&t.clearTimeout(l);let e=d;d=Math.min(d*2,r);let n=i(),a=Math.max(1,Math.floor(e*(1-n/2)));f(`debug`,`scheduling reconnect`,{backoffMs:a,ceilMs:e}),l=t.setTimeout(()=>{l=null,m().catch(e=>f(`warn`,`reconnect failed`,{error:String(e)}))},a)}async function m(){if(u)return;let t;try{t=await e.resolveWsUrl()}catch(e){f(`warn`,`resolveWsUrl threw`,{error:String(e)}),p();return}if(!t){p();return}let r=[];e.pid!==void 0&&r.push(`pid=${encodeURIComponent(String(e.pid))}`),e.connectionId&&r.push(`connectionId=${encodeURIComponent(e.connectionId)}`),e.connectionId&&e.displayName!==void 0&&e.clientName!==void 0&&e.colorSeed!==void 0&&(r.push(`displayName=${encodeURIComponent(e.displayName)}`),r.push(`clientName=${encodeURIComponent(e.clientName)}`),r.push(`colorSeed=${encodeURIComponent(e.colorSeed)}`));let i=r.length>0?`?${r.join(`&`)}`:``,o=`${t}/collab/keepalive${i}`;try{c=a(o)}catch(e){f(`warn`,`WebSocket constructor failed`,{url:o,error:String(e)}),c=null,p();return}c.addEventListener(`open`,()=>{f(`info`,`connected`,{url:t}),d=n}),c.addEventListener(`close`,()=>{u||(f(`info`,`disconnected`,{url:t}),c=null,p())}),c.addEventListener(`error`,()=>{f(`debug`,`websocket error observed`,{url:t,readyState:c?.readyState,reason:`error-event`})})}return queueMicrotask(()=>{m().catch(e=>f(`warn`,`initial connect failed`,{error:String(e)}))}),{close:()=>{if(!u&&(u=!0,l!==null&&(t.clearTimeout(l),l=null),c)){try{c.close()}catch{}c=null}},isConnected:()=>c!==null&&c.readyState===1}}function WQ(e){if(e)return e.replace(/\/collab\/?$/,``)}function GQ(){return H(window)!==null}function KQ(e,t){let n=(0,$.c)(5),r=(0,Q.useRef)(e),i=(0,Q.useRef)(t),a,o;n[0]===e?(a=n[1],o=n[2]):(a=()=>{r.current=e},o=[e],n[0]=e,n[1]=a,n[2]=o),(0,Q.useEffect)(a,o);let s,c;n[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{let e=i.current?.startKeepalive??UQ;if((i.current?.isElectronHost??GQ)())return;let t=e({resolveWsUrl:async()=>WQ(r.current)});return()=>t.close()},c=[],n[3]=s,n[4]=c):(s=n[3],c=n[4]),(0,Q.useEffect)(s,c)}var qQ=(0,Q.lazy)(()=>n(()=>import(`./ShareBranchSwitchDialog-BlhZ6hTx.js`).then(e=>({default:e.ShareBranchSwitchDialog})),__vite__mapDeps([106,1,6,7,13,61,15,16,62,69,71,107,108,109,110,10,3,11]),import.meta.url)),JQ=(0,Q.lazy)(()=>n(()=>import(`./ShareReceiveMissDialog-D6rKf26E.js`).then(e=>({default:e.ShareReceiveMissDialog})),__vite__mapDeps([111,1,61,6,7,15,13,16,62,112,86,10,3,11,55,40,56,68,35,31,64,57,70,71,107,88,39,34,42]),import.meta.url)),YQ=`#install-claude-desktop`,XQ=/\.(md|mdx)$/i;function ZQ(e){return e===`#settings`||e===YQ}function QQ(e,t){if(!XQ.test(e))return null;for(let n of t){let t=Ve(n);if(t.kind===`doc`&&t.docName===e)return{kind:`doc`,target:e,docName:e}}return null}function $Q(e,t,n,r){return[e,t,n,r].map(e=>[...e].sort().join(`\0`)).join(``)}function e$(){let e=(0,$.c)(26),{clearTarget:t,openTabs:n,syncOpenTabsWithKnownTargets:r,tabSessionLoaded:i}=Xe(),{openTargetTransition:a}=ot();RQ();let{assetPaths:o,filePaths:s,folderPaths:c,loading:l,pageMeta:u,pages:d,pagesBySlug:f,pagesByBasename:p}=aa(),m=(0,Q.useRef)(null),h;e[0]!==o||e[1]!==s||e[2]!==c||e[3]!==d?(h=$Q(d,c,o,s),e[0]=o,e[1]=s,e[2]=c,e[3]=d,e[4]=h):h=e[4];let g=h,_,v;e[5]!==o||e[6]!==s||e[7]!==c||e[8]!==l||e[9]!==d||e[10]!==r||e[11]!==i||e[12]!==g?(_=()=>{l||!i||m.current===g||(m.current=g,r({pages:d,folderPaths:c,assetPaths:o,filePaths:s}))},v=[o,s,c,l,d,r,i,g],e[5]=o,e[6]=s,e[7]=c,e[8]=l,e[9]=d,e[10]=r,e[11]=i,e[12]=g,e[13]=_,e[14]=v):(_=e[13],v=e[14]),(0,Q.useEffect)(_,v);let y,b;return e[15]!==t||e[16]!==c||e[17]!==l||e[18]!==n||e[19]!==a||e[20]!==u||e[21]!==d||e[22]!==p||e[23]!==f?(y=()=>{e();function e(){if(ZQ(window.location.hash))return;let e=kl(window.location.hash);if(e){let t=wr(e.split(`.`).pop()??``);bl(`ok/nav/hash-change`,{docName:null,kind:`asset`}),a({kind:`asset`,target:e,assetPath:e,mediaKind:t});return}let r=El(window.location.hash);if(r){bl(`ok/nav/hash-change`,{docName:null,kind:`skill-file`}),a({kind:`skill-file`,target:`${r.scope}/${r.name}/${r.path}`,scope:r.scope,name:r.name,path:r.path});return}if(Pl(window.location.hash)){bl(`ok/nav/hash-change`,{docName:null,kind:`folder`}),a({kind:`folder`,target:``,folderPath:``});return}let i=jl(window.location.hash);if(!i){bl(`ok/nav/hash-change`,{docName:null,kind:`clear`}),t();return}if(l){bl(`ok/nav/hash-change`,{docName:i,kind:`deferred-loading`});return}let o=QQ(i,n)??sl(i,{pages:d,folderPaths:c,pagesBySlug:f,pagesByBasename:p});if(o.kind===`missing`&&/\/+$/.test(i.trim())){bl(`ok/nav/hash-change`,{docName:i,kind:`deferred-missing-folder`});return}let s=ll(cl(o),u);bl(`ok/nav/hash-change`,{docName:i,kind:s.kind}),a(s)}return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},b=[t,c,l,a,n,u,d,f,p],e[15]=t,e[16]=c,e[17]=l,e[18]=n,e[19]=a,e[20]=u,e[21]=d,e[22]=p,e[23]=f,e[24]=y,e[25]=b):(y=e[24],b=e[25]),(0,Q.useEffect)(y,b),null}function t$(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0],(0,Q.useEffect)(n$,t),null}function n$(){let e=function(e){let t=e.target;$a({target:t,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,key:e.key})&&(e.preventDefault(),window.location.hash!==`#settings`&&(window.location.hash=Za))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)}function r$(){let e=(0,$.c)(4),{activeTarget:t}=Xe(),n=typeof window<`u`?window.okDesktop??null:null,r=t?.kind===`doc`||t?.kind===`folder`||t?.kind===`asset`?t.kind:null,i=t?.kind===`doc`?t.docName:t?.kind===`folder`?t.folderPath:t?.kind===`asset`?t.assetPath:null,a,o;return e[0]!==i||e[1]!==r?(a=()=>{if(n){if(r===null){n.editor.notifyActiveTargetChanged({kind:null});return}i!==null&&n.editor.notifyActiveTargetChanged({kind:r,identifier:i})}},o=[n,r,i],e[0]=i,e[1]=r,e[2]=a,e[3]=o):(a=e[2],o=e[3]),(0,Q.useEffect)(a,o),null}function i$(){let e=(0,$.c)(8),{activeDocName:t,activeTarget:n}=Xe(),[r,i]=(0,Q.useState)(!1),a;e[0]!==t||e[1]!==n?(a=n?.kind===`folder`?n.folderPath:nl(t),e[0]=t,e[1]=n,e[2]=a):a=e[2];let o=a,s,c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{let e=function(e){let t=e.target;Th({target:t,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,key:e.key})&&(e.preventDefault(),i(!0))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},c=[],e[3]=s,e[4]=c):(s=e[3],c=e[4]),(0,Q.useEffect)(s,c);let l;return e[5]!==r||e[6]!==o?(l=(0,Z.jsx)(Dh,{open:r,onOpenChange:i,kind:`file`,initialDir:o}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function a$(e){let t=(0,$.c)(3),{children:n}=e,{collabUrl:r}=Xe();KQ(r);let i;return t[0]!==n||t[1]!==r?(i=(0,Z.jsx)(Ul,{collabUrl:r,children:n}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function o$(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(xl,{name:`app`,children:(0,Z.jsx)(ft,{children:(0,Z.jsx)(a$,{children:(0,Z.jsx)(bg,{children:(0,Z.jsx)(s$,{})})})})}),e[0]=t):t=e[0],t}function s$(){let e=(0,$.c)(28),t=typeof window<`u`?window.okDesktop??null:null,n=typeof window<`u`&&window.okDesktop!=null,[r,i]=(0,Q.useState)(!1),a=Cg(),o=d_(),s;e[0]===o?s=e[1]:(s=t?{launchInTerminal:c$,installedClis:o}:null,e[0]=o,e[1]=s);let c=s,l;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(Xg,{}),e[2]=l):l=e[2];let u,d,f,p;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(kQ,{}),d=(0,Z.jsx)(e$,{}),f=(0,Z.jsx)(r$,{}),p=(0,Z.jsx)(i$,{}),e[3]=u,e[4]=d,e[5]=f,e[6]=p):(u=e[3],d=e[4],f=e[5],p=e[6]);let m;e[7]===a?m=e[8]:(m=!a&&(0,Z.jsx)(t$,{}),e[7]=a,e[8]=m);let h,g,_,v;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(g=!1,_=t?(0,Z.jsx)(Zg,{bridge:t}):null,v=(0,Z.jsx)(EQ,{}),h=t?(0,Z.jsxs)(Q.Suspense,{fallback:null,children:[(0,Z.jsx)(qQ,{bridge:t}),(0,Z.jsx)(JQ,{})]}):null,e[9]=h,e[10]=g,e[11]=_,e[12]=v):(h=e[9],g=e[10],_=e[11],v=e[12]);let y;e[13]===r?y=e[14]:(y=(0,Z.jsx)(zg,{bridge:t,open:r,onOpenChange:i}),e[13]=r,e[14]=y);let b;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(b=n&&(0,Z.jsx)(`div`,{"aria-hidden":`true`,"data-testid":`editor-window-chrome-drag-strip`,"data-electron-drag":``,className:`pointer-events-none fixed inset-x-0 top-0 z-50 h-2 [-webkit-app-region:drag]`}),e[15]=b):b=e[15];let x;e[16]===a?x=e[17]:(x=!a&&(0,Z.jsx)(gQ,{onOpenSearch:()=>i(!0)}),e[16]=a,e[17]=x);let S;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(oM,{className:`overflow-hidden h-[calc(100vh-var(--layout-inset-offset))]`,children:(0,Z.jsx)(GI,{onOpenSearch:()=>i(!0)})}),e[18]=S):S=e[18];let C;e[19]===x?C=e[20]:(C=(0,Z.jsxs)(eM,{className:`h-screen overflow-hidden`,children:[x,S]}),e[19]=x,e[20]=C);let w;e[21]!==C||e[22]!==c?(w=(0,Z.jsx)(Oa,{value:c,children:C}),e[21]=C,e[22]=c,e[23]=w):w=e[23];let T;return e[24]!==y||e[25]!==w||e[26]!==m?(T=(0,Z.jsxs)(Z.Fragment,{children:[l,(0,Z.jsxs)(oa,{children:[u,d,f,p,m,g,_,v,h,y,b,w]})]}),e[24]=y,e[25]=w,e[26]=m,e[27]=T):T=e[27],T}function c$(e,t){lI(da(e,t),t)}function l$(e){let t=/\/([^/]+?)(?:\.git)?\/?$/.exec(e);return t?t[1]:`repo`}function u$(e){return{async getAuthStatus(){return e.authQueryTransport.status()},async startSignIn(){return e.openSignIn()},async runClone({url:t,branch:n}){let r=await e.bridge.dialog.openFolder();if(!r)return{kind:`cancelled`};let i=l$(t),a=`${r.replace(/\/$/,``)}/${i}`,o=_s.loading(qc._({id:`GXf9hG`,values:{repoName:i}}),{duration:1/0}),s=typeof n==`string`&&n.length>0?n:null;try{let n=e.cloneTransport.start({url:t,dir:a,branch:s});for await(let e of n.events){if(e.type===`progress`){let t=e.phase,n=Math.round(e.pct);_s.loading(qc._({id:`GXf9hG`,values:{repoName:i}}),{id:o,description:qc._({id:`SCzAbA`,values:{phase:t,pct:n}}),duration:1/0});continue}if(e.type===`branch-fallback`){console.log(dd({branch_action:`fallback`,branch:e.branch})),_s.info(qc._({id:`3JYy1p`,values:{0:e.branch}}),{duration:8e3});continue}if(e.type===`complete`)return _s.success(qc._({id:`IRv9cH`,values:{repoName:i}}),{id:o,duration:4e3}),{kind:`ok`,dir:e.dir};if(e.type===`error`)return _s.dismiss(o),{kind:`error`,detail:e.message}}return _s.dismiss(o),{kind:`error`,detail:`Clone ended unexpectedly.`}}catch(e){console.warn(`[clone-controller] clone transport threw`,e);let t=e instanceof Error?e.message:`Unknown error`;return _s.dismiss(o),{kind:`error`,detail:t}}}}}function d$(){return{start(e){return Va((t,n)=>{(async()=>{try{let r=await fetch(`/api/local-op/clone`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({url:e.url,dir:e.dir||void 0,branch:typeof e.branch==`string`&&e.branch.length>0?e.branch:void 0}),signal:n});if(!r.ok){let e=`Clone failed — check the URL and try again (${r.status})`;try{let t=await r.json(),n=or.safeParse(t);n.success&&(e=`Clone failed: ${n.data.title}`)}catch{}t({type:`error`,message:e});return}if(!r.body){t({type:`error`,message:`Clone failed — empty response body`});return}let i=r.body.getReader(),a=new TextDecoder,o=``;for(;;){let{done:e,value:r}=await i.read();if(e)break;o+=a.decode(r,{stream:!0});let s=o.split(`
2002
+ `}\n${Sq}\n${Cq}`;function bY(e){let t=e.split(`/`).pop()?.replace(/\.md$/i,``).toLowerCase();return!!t&&iY.has(t)}function xY(e){return e===`darwin`?qc._({id:`LtSYdi`}):e===`win32`?qc._({id:`qi1F96`}):qc._({id:`e1Rn_k`})}function SY(e){let t=(0,$.c)(18),{item:n,workspace:r,onClose:i}=e,{_:a}=At(),o=typeof window<`u`?window.okDesktop:void 0;if(!o)return null;let s=o.platform,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=xY(s),t[0]=c):c=t[0];let l=c,u,d;t[1]!==a||t[2]!==r?(u=r?null:a({id:`wTcjov`}),d=a(s===`darwin`?u?{id:`FvpFSZ`,values:{hint:u}}:{id:`LtSYdi`}:s===`win32`?u?{id:`o4dcAf`,values:{hint:u}}:{id:`qi1F96`}:u?{id:`zUhPuR`,values:{hint:u}}:{id:`e1Rn_k`}),t[1]=a,t[2]=r,t[3]=u,t[4]=d):(u=t[3],d=t[4]);let f=d,p=!r,m;t[5]!==n||t[6]!==i||t[7]!==r?(m=()=>{if(!r)return;i();let e=Po(r.contentDir,Bu(n),r.pathSeparator);o.shell.showItemInFolder(e)},t[5]=n,t[6]=i,t[7]=r,t[8]=m):m=t[8];let h,g;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(Bo,{"aria-hidden":`true`}),g=(0,Z.jsx)(`span`,{className:`flex-1`,children:l}),t[9]=h,t[10]=g):(h=t[9],g=t[10]);let _;t[11]===u?_=t[12]:(_=u?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:u}):null,t[11]=u,t[12]=_);let v;return t[13]!==f||t[14]!==p||t[15]!==m||t[16]!==_?(v=(0,Z.jsxs)(bc,{disabled:p,onSelect:m,"aria-label":f,children:[h,g,_]}),t[13]=f,t[14]=p,t[15]=m,t[16]=_,t[17]=v):v=t[17],v}function CY(e,t){return Ru({kind:e.endsWith(`/`)?`directory`:`file`,name:e,path:e},t)}function wY(e){let t=e.match(/\.(md|mdx)$/i);if(!t)return null;let n=t[0].toLowerCase()===`.md`?`.mdx`:`.md`;return`${e.slice(0,-t[0].length)}${n}`}function TY(e,t){let n=wY(e);return n?t.includes(n):!1}function EY(e,t){return e!==t&&e.startsWith(t)}function DY(e,t){let n=[...new Set(e)].filter(e=>!ul(e)),r=n.filter(e=>e.endsWith(`/`));return n.filter(e=>!r.some(t=>EY(e,t))).map(e=>CY(e,t))}function OY(e,t){let n=e.getItem(t)??e.getItem(ed(t));return n?.isDirectory()?ed(cd(n.getPath())):t}function kY(e){let t=e.getFocusedPath()??e.getSelectedPaths()[0]??null;return t?OY(e,t):null}function AY(e,t,n){let r=kY(e);return!r||n.has(r)||ul(r)?null:CY(r,t)}function jY(e,t){let n=e.getSelectedPaths(),r=kY(e);return DY(n.length>0?n.map(t=>OY(e,t)):r?[r]:[],t)}function MY(e,t){return e===t||e.startsWith(`${t}/`)}function NY(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName;return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||e.isContentEditable||e.closest(`[contenteditable="true"]`)!==null}function PY(e,t,n){let r=new Set,i=new Set,a=new Set;for(let o of e){if(o.kind===`file`){r.add(o.path);continue}if(o.kind===`asset`){a.add(o.path);continue}i.add(o.path);for(let e of t)tl(e)&&e.docName.startsWith(`${o.path}/`)?r.add(e.docName):fl(e)&&e.path.startsWith(`${o.path}/`)&&a.add(e.path);for(let e of n){let t=cd(e);MY(t,o.path)&&i.add(t)}}return{docNames:r,folderPaths:i,assetPaths:a}}function FY(e,t){return e.kind===`file`?t.kind===`file`&&e.path===t.createdPath:e.kind===`asset`?!1:MY(t.createdPath,e.path)}function IY(e){let t=(0,$.c)(68),{item:n,context:r,anyActionBusy:i,workspace:a,handoff:o,model:s,okignoreBinding:c,onStartCreating:l,onCreateFromTemplate:u,onDuplicate:d,onDelete:f,onExpandSubtree:p,onCollapseSubtree:m,folderTreePaths:h,isAsset:g,documents:v}=e,{_:y}=At(),b=Ru(n,v),x=n.kind===`directory`,S;t[0]===n.path?S=t[1]:(S=ul(n.path),t[0]=n.path,t[1]=S);let C=S,w=b.kind===`asset`?null:b,T=w!==null&&c!==null,E;t[2]!==y||t[3]!==x?(E=y(x?{id:`5D3Ior`}:{id:`dbhUX1`}),t[2]=y,t[3]=x,t[4]=E):E=t[4];let D=E,O;t[5]!==x||t[6]!==n.path?(O=x?cd(n.path):null,t[5]=x,t[6]=n.path,t[7]=O):O=t[7];let k=bo(O),A=k.state.status===`ready`?(k.state.data.folder.templates_available?.length??0)>0:!0,j=s.getSelectedPaths(),M=j.includes(b.treePath)?DY(j,v):[],N=M.length>1?M:[b],P=N.length,F=qc._({id:`djjdjr`,values:{deleteCount:P}}),I;t[8]!==v||t[9]!==g||t[10]!==x||t[11]!==n||t[12]!==a?(I=g?null:x?ka({folderRelativePath:Bu(n),workspace:a}):ja({docName:sd(n.path,v),workspace:a}),t[8]=v,t[9]=g,t[10]=x,t[11]=n,t[12]=a,t[13]=I):I=t[13];let L=I,R;t[14]===r?R=t[15]:(R=()=>r.close({restoreFocus:!1}),t[14]=r,t[15]=R);let z=R,B;t[16]===r?B=t[17]:(B=()=>r.close(),t[16]=r,t[17]=B);let V=B,{status:H}=Bi(),U=H?.hasRemote===!0,W;t[18]!==v||t[19]!==g||t[20]!==x||t[21]!==n.path||t[22]!==b?(W=g||b.kind===`asset`?null:x?Ia(cd(n.path)):Wa(sd(n.path,v)),t[18]=v,t[19]=g,t[20]=x,t[21]=n.path,t[22]=b,t[23]=W):W=t[23];let G=W,ee=U&&G!==null,te;t[24]!==y||t[25]!==U||t[26]!==G?(te=()=>{G&&za({...G,hasRemote:U,onClickWhenNoRemote:()=>{_s.error(y({id:`WyQxwa`}))}},{clipboardWrite:Ca,toastSuccess:zY,toastError:RY,logEvent:LY})},t[24]=y,t[25]=U,t[26]=G,t[27]=te):te=t[27];let K=te,ne;t[28]!==ee||t[29]!==V||t[30]!==K?(ne=ee?(0,Z.jsxs)(bc,{"data-testid":`file-tree-menu-share`,onSelect:()=>{V(),K()},children:[(0,Z.jsx)(Nf,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`Z8lGw6`})]}):null,t[28]=ee,t[29]=V,t[30]=K,t[31]=ne):ne=t[31];let re=ne,ie=0,q=0;if(x){let e=ed(n.path);for(let t of h)(t===e||t.startsWith(e))&&(ie++,hJ(s.getItem(t))?.isExpanded()&&q++)}let ae=x&&q<ie,oe=x&&q>0,se;t[32]===V?se=t[33]:(se=e=>{e||V()},t[32]=V,t[33]=se);let ce;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,Z.jsx)(oc,{asChild:!0,children:(0,Z.jsx)(`span`,{"aria-hidden":`true`,"data-file-tree-context-menu-root":`true`,className:`block size-px`})}),t[34]=ce):ce=t[34];let le;t[35]!==y||t[36]!==i||t[37]!==T||t[38]!==V||t[39]!==z||t[40]!==F||t[41]!==N||t[42]!==A||t[43]!==o||t[44]!==L||t[45]!==D||t[46]!==g||t[47]!==x||t[48]!==C||t[49]!==n||t[50]!==s||t[51]!==c||t[52]!==w||t[53]!==m||t[54]!==u||t[55]!==f||t[56]!==d||t[57]!==p||t[58]!==l||t[59]!==re||t[60]!==oe||t[61]!==ae||t[62]!==b||t[63]!==a?(le=(0,Z.jsx)(Sc,{sideOffset:0,align:`start`,"data-file-tree-context-menu-root":`true`,className:`min-w-52`,children:x?(0,Z.jsxs)(Z.Fragment,{children:[C?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(bc,{disabled:i,onSelect:()=>{z(),l(`file`,cd(n.path))},children:[(0,Z.jsx)(Lf,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`HdkSiO`})]}),A?(0,Z.jsxs)(ic,{children:[(0,Z.jsxs)(_c,{disabled:i,children:[(0,Z.jsx)(ao,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`Uuj_R4`})]}),(0,Z.jsx)(Mc,{children:(0,Z.jsx)(mJ,{parentDir:cd(n.path),onSelectTemplate:e=>{z(),u(cd(n.path),e)},ItemComponent:bc})})]}):null,(0,Z.jsxs)(bc,{disabled:i,onSelect:()=>{z(),l(`folder`,cd(n.path))},children:[(0,Z.jsx)($d,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`96G6Re`})]}),(0,Z.jsx)(gc,{})]}),(0,Z.jsx)(SY,{item:n,workspace:a,onClose:V}),(0,Z.jsx)(ma,{input:L,installStates:o.installStates,isElectronHost:o.isElectronHost,dispatch:o.dispatch}),re,(0,Z.jsxs)(ic,{children:[(0,Z.jsxs)(_c,{children:[(0,Z.jsx)(Ao,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`oCZkaG`})]}),(0,Z.jsxs)(Mc,{children:[(0,Z.jsx)(bc,{disabled:!a,onSelect:()=>{a&&(V(),rY(Po(a.contentDir,Bu(n),a.pathSeparator),`full`))},children:(0,Z.jsx)(J,{id:`oQA-cA`})}),(0,Z.jsx)(bc,{onSelect:()=>{V(),rY(Bu(n),`relative`)},children:(0,Z.jsx)(J,{id:`s061i4`})})]})]}),ae||oe?(0,Z.jsx)(gc,{}):null,ae?(0,Z.jsxs)(bc,{onSelect:()=>{V(),p(n.path)},children:[(0,Z.jsx)(Zf,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`OlAl5i`})]}):null,oe?(0,Z.jsxs)(bc,{onSelect:()=>{V(),m(n.path)},children:[(0,Z.jsx)(Zd,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`qvWGzP`})]}):null,C?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(gc,{}),(0,Z.jsxs)(bc,{disabled:i,onSelect:()=>{b.kind!==`asset`&&(V(),d(b))},children:[(0,Z.jsx)(jo,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`euc6Ns`})]}),(0,Z.jsxs)(bc,{disabled:i,onSelect:()=>{z(),s.startRenaming(n.path)},children:[(0,Z.jsx)(zo,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`2wxgft`})]}),(0,Z.jsxs)(bc,{"data-testid":`file-tree-menu-hide`,disabled:!T,onSelect:()=>{if(!c||!w)return;V();let e=Bq(w),t=po(c.current()),n=Co(t,e);if(n===t)return;c.patch(eo(n));let r=w.path.split(`/`).pop()||w.path;_s.success(y({id:`4xtLTl`,values:{basename:r}}),{description:y({id:`nWv1ja`}),duration:5e3})},children:[(0,Z.jsx)(_,{"aria-hidden":`true`}),D]}),(0,Z.jsxs)(bc,{variant:`destructive`,disabled:i,onSelect:()=>{V(),f(N)},children:[(0,Z.jsx)(ss,{"aria-hidden":`true`}),F]})]})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(SY,{item:n,workspace:a,onClose:V}),!g&&(0,Z.jsx)(ma,{input:L,installStates:o.installStates,isElectronHost:o.isElectronHost,dispatch:o.dispatch}),re,(0,Z.jsxs)(ic,{children:[(0,Z.jsxs)(_c,{children:[(0,Z.jsx)(Ao,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`oCZkaG`})]}),(0,Z.jsxs)(Mc,{children:[(0,Z.jsx)(bc,{disabled:!a,onSelect:()=>{a&&(V(),rY(Po(a.contentDir,Bu(n),a.pathSeparator),`full`))},children:(0,Z.jsx)(J,{id:`oQA-cA`})}),(0,Z.jsx)(bc,{onSelect:()=>{V(),rY(Bu(n),`relative`)},children:(0,Z.jsx)(J,{id:`s061i4`})})]})]}),C?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(gc,{}),g?null:(0,Z.jsxs)(bc,{disabled:i,onSelect:()=>{V(),d(b)},children:[(0,Z.jsx)(jo,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`euc6Ns`})]}),(0,Z.jsxs)(bc,{disabled:i,onSelect:()=>{z(),s.startRenaming(n.path)},children:[(0,Z.jsx)(zo,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`2wxgft`})]}),w?(0,Z.jsxs)(bc,{"data-testid":`file-tree-menu-hide`,disabled:!T,onSelect:()=>{if(!c)return;V();let e=Bq(w),t=po(c.current()),n=Co(t,e);if(n===t)return;c.patch(eo(n));let r=w.path.split(`/`).pop()||w.path;_s.success(y({id:`OD0FCX`,values:{basename:r}}),{description:y({id:`nWv1ja`}),duration:5e3})},children:[(0,Z.jsx)(_,{"aria-hidden":`true`}),D]}):null,(0,Z.jsxs)(bc,{variant:`destructive`,disabled:i,onSelect:()=>{V(),f(N)},children:[(0,Z.jsx)(ss,{"aria-hidden":`true`}),F]})]})]})}),t[35]=y,t[36]=i,t[37]=T,t[38]=V,t[39]=z,t[40]=F,t[41]=N,t[42]=A,t[43]=o,t[44]=L,t[45]=D,t[46]=g,t[47]=x,t[48]=C,t[49]=n,t[50]=s,t[51]=c,t[52]=w,t[53]=m,t[54]=u,t[55]=f,t[56]=d,t[57]=p,t[58]=l,t[59]=re,t[60]=oe,t[61]=ae,t[62]=b,t[63]=a,t[64]=le):le=t[64];let ue;return t[65]!==se||t[66]!==le?(ue=(0,Z.jsxs)(Oc,{open:!0,modal:!1,onOpenChange:se,children:[ce,le]}),t[65]=se,t[66]=le,t[67]=ue):ue=t[67],ue}function LY(e){return console.log(e)}function RY(e){return _s.error(e)}function zY(e){return _s.success(e)}function BY(e,t){return`/api/documents?showAll=true${t?`&showOk=true`:``}&dir=${encodeURIComponent(e)}&depth=1`}async function VY(e,t,n,r,i){try{let a=await fetch(BY(e,t),{signal:n,headers:kJ});if(AJ(a)){let e=await NJ(a);return{kind:`entries`,entries:Zc(e.entries),truncated:e.truncated}}let o=await kt(a,r);if(!o.ok)return{kind:`http-error`,title:o.title};let s=mn.safeParse(o.body);return s.success?{kind:`entries`,entries:Zc(s.data.documents),truncated:s.data.truncated===!0}:{kind:`http-error`,title:i}}catch(e){return e instanceof jJ?{kind:`http-error`,title:e.message}:{kind:`network-error`,cause:e}}}function HY(e){let t=(0,$.c)(366),{ref:n,onContentHeightChange:r}=e,{_:i,i18n:a}=At(),{activeDocName:o,activeTarget:s,closeTabs:c,closeDocument:l,closeAndClearForRename:u,getPoolActiveDocName:d,poolHas:p,isNewTabActive:m,openTarget:h,prewarm:g,remapTabsForRename:_}=Xe(),{notifySidebarFileSelected:v}=$j(),{resolvedTheme:y}=ln(),{addPage:b,pageMeta:x,pages:S}=aa(),C;t[0]===x?C=t[1]:(C=function(e,t){return il(e,t??x.get(e)?.size)??{kind:`doc`,target:e,docName:e}},t[0]=x,t[1]=C);let w=C,T;t[2]!==b||t[3]!==w||t[4]!==v||t[5]!==h?(T=function(e,t,n){n?.registerPage&&b(e),h(w(e,t),{tabBehavior:`replace-active`}),Tl(Ml(e)),v()},t[2]=b,t[3]=w,t[4]=v,t[5]=h,t[6]=T):T=t[6];let E=T,D;t[7]!==v||t[8]!==h?(D=function(e){let t=wl(e);h({kind:`folder`,target:e,folderPath:e},{tabBehavior:`replace-active`}),Tl(t),v()},t[7]=v,t[8]=h,t[9]=D):D=t[9];let O=D,k;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(k=[],t[10]=k):k=t[10];let[A,j]=(0,Q.useState)(k),[M,N]=(0,Q.useState)(!0),[P,F]=(0,Q.useState)(null),[I,L]=(0,Q.useState)(!1),R=RN(),z=(0,Q.useRef)(null),[B,V]=(0,Q.useState)(null),[H,U]=(0,Q.useState)(0),[W,G]=(0,Q.useState)(null),[ee,te]=(0,Q.useState)(null),[K,ne]=(0,Q.useState)(null),{conflicts:re}=Ka(),[ie,q]=(0,Q.useState)(null),[ae,oe]=(0,Q.useState)(null),[se,ce]=(0,Q.useState)(!1),le=(0,Q.useRef)(se),ue;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(ue=new Set,t[11]=ue):ue=t[11];let de=(0,Q.useRef)(ue),fe=(0,Q.useRef)(A),pe=(0,Q.useRef)(x),me=(0,Q.useRef)(null),he;t[12]!==A||t[13]!==O||t[14]!==E||t[15]!==v||t[16]!==h||t[17]!==S?(he=function(e,t){let n=t===void 0?A:t,r=tJ(e,n);if(r.kind===`none`){console.debug(`[FileTree] Dropped selection for unknown docName:`,od(e));return}if(r.kind===`asset`){h({kind:`asset`,target:r.path,assetPath:r.path,mediaKind:r.mediaKind},{tabBehavior:`replace-active`}),Tl(r.hash),v();return}if(r.kind===`folder`){O(r.path);return}let i=n.find(e=>tl(e)&&e.docName===r.path),a=el(r.path,{pages:S,docExt:i?.docExt});if(a?.kind===`asset`){h(a,{tabBehavior:`replace-active`}),Tl(Al(a.assetPath)),v();return}if(a?.kind===`doc`){E(a.docName);return}E(r.path,i?.size,{registerPage:Jc(r.path)})},t[12]=A,t[13]=O,t[14]=E,t[15]=v,t[16]=h,t[17]=S,t[18]=he):he=t[18];let ge=he,_e;t[19]!==v||t[20]!==h?(_e=function(e,t){h({kind:`asset`,target:e,assetPath:e,mediaKind:(t??fe.current).find(t=>fl(t)&&t.path===e)?.mediaKind??null},{tabBehavior:`replace-active`}),Tl(Al(e)),v()},t[19]=v,t[20]=h,t[21]=_e):_e=t[21];let ve=_e,be=(0,Q.useRef)(o),xe;t[22]===A?xe=t[23]:(xe=new Set(A.filter(fl).map(gX)),t[22]=A,t[23]=xe);let Se=xe,Ce=(0,Q.useRef)(Se),we;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(we=[],t[24]=we):we=t[24];let Te=(0,Q.useRef)(we),Ee=(0,Q.useRef)(null),Oe=(0,Q.useRef)(hX),ke=(0,Q.useRef)(null),Ae=(0,Q.useRef)(null),je=(0,Q.useRef)(!1),Me=(0,Q.useRef)(!1),Ne=(0,Q.useRef)(null),Pe;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(Pe={row:null,root:null},t[25]=Pe):Pe=t[25];let Fe=(0,Q.useRef)(Pe),Ie=(0,Q.useRef)(mX),Le=(0,Q.useRef)(null),Re=(0,Q.useRef)(null),ze;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(ze=new Map,t[26]=ze):ze=t[26];let Be=(0,Q.useRef)(ze),Ve;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=new Set,t[27]=Ve):Ve=t[27];let He=(0,Q.useRef)(Ve),Ue;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=new Map,t[28]=Ue):Ue=t[28];let We=(0,Q.useRef)(Ue),Ge=(0,Q.useRef)(0),Ke;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(Ke=new Set,t[29]=Ke):Ke=t[29];let qe=(0,Q.useRef)(Ke),Je=(0,Q.useRef)(pX),Ye=(0,Q.useRef)(fX),Ze=(0,Q.useRef)(!1),Qe=(0,Q.useRef)(!1),$e=(0,Q.useRef)(!1),et;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(et=()=>({showHiddenFiles:Ze.current,showOnlyMarkdownFiles:Qe.current,showOkFolders:$e.current}),t[30]=et):et=t[30];let tt=et,nt=(0,Q.useRef)(null),rt=(0,Q.useRef)(null),it=(0,Q.useRef)(dX),at=(0,Q.useRef)(uX),ot=(0,Q.useRef)(lX),lt=(0,Q.useRef)(cX),ut=(0,Q.useRef)(s),[dt,ft]=(0,Q.useState)(!1),pt;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(pt=function(){z.current!==null&&(clearTimeout(z.current),z.current=null)},t[31]=pt):pt=t[31];let mt=pt,ht;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(ht=function(){mt(),L(!1)},t[32]=ht):ht=t[32];let gt=ht,_t;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(_t=function(e){gt(),F(e)},t[33]=_t):_t=t[33];let vt=_t,yt;t[34]===i?yt=t[35]:(yt=function(){if(mt(),PN()){F(null),L(!0),z.current=setTimeout(()=>{z.current=null,nt.current?.()},gY);return}L(!1),F(i({id:`34qyH5`}))},t[34]=i,t[35]=yt);let bt=yt,xt=(0,Q.useRef)(!0),St;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(St=()=>{if(xt.current){xt.current=!1;return}nt.current?.()},t[36]=St):St=t[36];let Ct;t[37]===R?Ct=t[38]:(Ct=[R],t[37]=R,t[38]=Ct),(0,Q.useEffect)(St,Ct);let wt,Tt;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(wt=()=>mt,Tt=[],t[39]=wt,t[40]=Tt):(wt=t[39],Tt=t[40]),(0,Q.useEffect)(wt,Tt);let Et,Dt;t[41]!==A.length||t[42]!==M?(Et=()=>{if(M||A.length===0)return;let e=rt.current?.querySelector(dR)?.shadowRoot;if(!e)return;let t=e,n=function(){Ne.current!==null&&clearTimeout(Ne.current),Ne.current=setTimeout(()=>{Me.current=!1,Ne.current=null},0)},r=function(e){if(!(e instanceof DragEvent))return;let t=vX(e),n=t?.dataset.itemPath;if(!n)return;let r=oJ(t.dataset.itemType===`folder`?ed(n):n,fe.current,pe.current);r&&(Ne.current!==null&&(clearTimeout(Ne.current),Ne.current=null),Me.current=!0,e.dataTransfer?.setData(Fu,Nu(r)))},i=function(e){if(!(e instanceof DragEvent)||!Zu(e))return;let t=bX(e);if(!t){tY(Fe);return}e.preventDefault(),e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`),nY(Fe,t)},a=function(e){if(!(e instanceof DragEvent)||!Zu(e))return;let n=e.relatedTarget;n instanceof Node&&t.contains(n)||tY(Fe)},o=function(e){if(!(e instanceof DragEvent)||!Zu(e))return;let t=bX(e),n=Gu(e);if(!t||n.length===0){tY(Fe);return}e.preventDefault(),e.stopPropagation(),tY(Fe),Ie.current(n,t.parentDir,t.busyPath)};return e.addEventListener(`dragstart`,r,{capture:!0}),e.addEventListener(`dragover`,i,{capture:!0}),e.addEventListener(`dragleave`,a,{capture:!0}),e.addEventListener(`drop`,o,{capture:!0}),e.addEventListener(`dragend`,n,{capture:!0}),window.addEventListener(`drop`,n,!0),window.addEventListener(`dragend`,n,!0),()=>{e.removeEventListener(`dragstart`,r,{capture:!0}),e.removeEventListener(`dragover`,i,{capture:!0}),e.removeEventListener(`dragleave`,a,{capture:!0}),e.removeEventListener(`drop`,o,{capture:!0}),e.removeEventListener(`dragend`,n,{capture:!0}),window.removeEventListener(`drop`,n,!0),window.removeEventListener(`dragend`,n,!0),tY(Fe),Ne.current!==null&&(clearTimeout(Ne.current),Ne.current=null),Me.current=!1}},Dt=[A.length,M],t[41]=A.length,t[42]=M,t[43]=Et,t[44]=Dt):(Et=t[43],Dt=t[44]),(0,Q.useEffect)(Et,Dt);let{selectedFilePath:Ot,selectedFolderPath:jt,navigationPath:Mt}=eJ(s,m?null:o),Nt=Ot?nd(Ot,A.find(e=>tl(e)&&e.docName===Ot)?.docExt):jt?ed(jt):s?.kind===`asset`?s.assetPath:null,Pt=se?null:Nt,Ft=ba().states,{dispatch:It}=fa(),Lt;t[45]!==It||t[46]!==Ft?(Lt={installStates:Ft,isElectronHost:typeof window<`u`&&window.okDesktop!=null,dispatch:It},t[45]=It,t[46]=Ft,t[47]=Lt):Lt=t[47];let Rt=Lt,{okignoreBinding:zt,merged:Bt}=du(),Vt=Bt?.appearance?.sidebar?.showHiddenFiles??!1,Ht=Bt?.appearance?.sidebar?.showOnlyMarkdownFiles??!1,Ut=Bt?.appearance?.sidebar?.showOkFolders??!1,Wt;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(Wt=()=>Le.current===null,t[48]=Wt):Wt=t[48];let Gt=Wt,Kt;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(Kt=[],t[49]=Kt):Kt=t[49];let qt;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(qt={set:`complete`,spriteSheet:dY,byFileExtension:{md:{name:sY,viewBox:st},mdx:{name:sY,viewBox:st}}},t[50]=qt):qt=t[50];let Jt;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(Jt={contextMenu:{enabled:!0,triggerMode:`both`,buttonVisibility:`when-needed`}},t[51]=Jt):Jt=t[51];let Yt;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(Yt={canDrag:Gt,canDrop:Gt,onDropComplete:e=>lt.current(e),onDropError:sX},t[52]=Yt):Yt=t[52];let Xt,Zt;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(Xt={canRename:Gt,onRename:e=>at.current(e),onError:e=>ot.current(e)},Zt=e=>it.current(e),t[53]=Xt,t[54]=Zt):(Xt=t[53],Zt=t[54]);let Qt;t[55]===i?Qt=t[56]:(Qt={paths:Kt,initialExpansion:`closed`,fileTreeSearchMode:`hide-non-matches`,initialVisibleRowCount:18,stickyFolders:!0,...bq,icons:qt,unsafeCSS:yY,composition:Jt,dragAndDrop:Yt,renaming:Xt,onSelectionChange:Zt,renderRowDecoration:e=>{let{item:t}=e;if(t.kind===`file`){let e=fe.current.find(e=>tl(e)&&nd(e.docName,e.docExt)===t.path);if(e?.isSymlink){let t=e.targetPath;return{icon:aY,title:i(t?{id:`JE21eh`,values:{targetPath:t}}:{id:`BQu9Pg`})}}return bY(t.path)?{icon:oY,title:i({id:`i9toLO`})}:null}let n=fe.current.find(e=>dl(e)&&ed(e.path)===ed(t.path));if(n?.isSymlink){let e=n.targetPath;return{icon:aY,title:i(e?{id:`JE21eh`,values:{targetPath:e}}:{id:`BQu9Pg`})}}return null}},t[55]=i,t[56]=Qt);let{model:$t}=vq(Qt),en;t[57]===$t?en=t[58]:(en=function(e){let t=$t.getItem(e)??$t.getItem(ed(e));return t?.isDirectory()?ed(cd(t.getPath())):e},t[57]=$t,t[58]=en);let tn=en,nn,rn;t[59]===A?(nn=t[60],rn=t[61]):(rn=Uu(A),nn=Pu(rn),t[59]=A,t[60]=nn,t[61]=rn);let an=nn,on=(0,Q.useRef)(rn),sn;t[62]!==A||t[63]!==Ut?(sn=Qu(A,{includeOkFolders:Ut}),t[62]=A,t[63]=Ut,t[64]=sn):sn=t[64];let cn=sn,un=(0,Q.useRef)(cn),dn=jt?td(ed(jt)).slice(0,-1):td(Pt??Mt),fn=dn.join(`\0`),pn;t[65]===$t?pn=t[66]:(pn=()=>{let e=new Set;for(let t of un.current)hJ($t.getItem(t))?.isExpanded()&&e.add(t);return e},t[65]=$t,t[66]=pn);let hn=pn,gn;t[67]===hn?gn=t[68]:(gn=e=>{let t=new Set(Qu(e??fe.current,{includeOkFolders:$e.current})),n=hn();for(let e of Te.current)n.add(e);return[...n].filter(e=>t.has(e))},t[67]=hn,t[68]=gn);let _n=gn,vn;t[69]!==_n||t[70]!==$t?(vn=e=>{let t=Uu(e??fe.current);$t.resetPaths(t,{initialExpandedPaths:_n(e)})},t[69]=_n,t[70]=$t,t[71]=vn):vn=t[71];let yn=vn,bn;t[72]!==i||t[73]!==bt?(bn=async function(e){let t=Ge.current,n=new AbortController;We.current.set(e,n);let r=await VY(cd(e),$e.current,n.signal,i({id:`8RtNI0`}),i({id:`HlmZBk`}));if(We.current.get(e)===n&&We.current.delete(e),n.signal.aborted||t!==Ge.current)return;if(r.kind===`network-error`){bt(),console.warn(`[FileTree] lazy folder children fetch failed:`,e,r.cause);return}if(r.kind===`http-error`){console.warn(`[FileTree] lazy folder children http error:`,e,r.title),vt(r.title);return}let a=$c(r.entries,tt());He.current.add(e),j(t=>IJ(t,e,a,Be.current)),F(null),gt(),r.truncated&&V(r.entries.length)},t[72]=i,t[73]=bt,t[74]=bn):bn=t[74];let xn=bn,Sn;t[75]!==hn||t[76]!==xn?(Sn=()=>{let e=hn(),t=qe.current;qe.current=e;for(let n of e){if(t.has(n)||He.current.has(n)||We.current.has(n))continue;let e=cd(n);fe.current.find(t=>dl(t)&&t.path===e)?.hasChildren!==!1&&xn(n)}},t[75]=hn,t[76]=xn,t[77]=Sn):Sn=t[77];let Cn=Sn,wn;t[78]!==hn||t[79]!==xn?(wn=()=>{for(let e of hn())He.current.has(e)||We.current.has(e)||xn(e)},t[78]=hn,t[79]=xn,t[80]=wn):wn=t[80];let Tn=wn,En;t[81]!==$t||t[82]!==yn?(En=(e,t,n,r)=>{let i=r===void 0?[]:r,a=0,o=null;for(let{fromDocName:r,toDocName:i}of n){let n=e.find(e=>tl(e)&&e.docName===r);if(n==null||$t.getItem(i)==null)continue;let s=nd(i,t.find(e=>tl(e)&&e.docName===i)?.docExt??n.docExt);$t.move(i,s),o=s,a+=1}for(let{toPath:e}of i){let t=Xc(e);if(t===``)continue;let n=e.slice(0,-t.length);$t.getItem(n)!=null&&($t.getItem(e)??$t.move(n,e),o=e,a+=1)}a!==0&&(yn(t),o!=null&&$t.focusPath(o))},t[81]=$t,t[82]=yn,t[83]=En):En=t[83];let Dn=En,On;t[84]===Symbol.for(`react.memo_cache_sentinel`)?(On=e=>{ke.current=Xu(e)},t[84]=On):On=t[84];let kn=On,jn;t[85]===Symbol.for(`react.memo_cache_sentinel`)?(jn=e=>Ce.current.has(e),t[85]=jn):jn=t[85];let Pn=jn,Fn;t[86]!==i||t[87]!==b||t[88]!==O||t[89]!==E||t[90]!==yn?(Fn=async function(e){if(e.kind===`asset`||Le.current!==null)return;let t=()=>{G(null),Le.current=null};Le.current=e.path,G(e.path),F(null);try{let n=await kt(await fetch(`/api/duplicate-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:e.kind,path:e.path})}),i({id:`dw_dUJ`}));if(!n.ok){_s.error(n.title),yn(),t();return}let r=f(Mn,n.body,`duplicate-path`,null);if(r===null){let e=i({id:`67f-3g`});_s.error(e),F(e),hl([`files`,`backlinks`,`graph`]),yn(),t();return}for(let e of r.duplicatedDocNames)b(e);j(t=>{let n=uP(t,e,r);return yn(n),kn(n),n}),hl([`files`,`backlinks`,`graph`]),r.path!==e.path&&(r.kind===`folder`?O(r.path):E(r.path)),_s.success(r.kind===`folder`?i({id:`iilQXA`}):i({id:`A6h5b-`}),{description:r.path}),t()}catch(e){let n=e,r=n instanceof Error?n.message:String(n);console.warn(`[FileTree] duplicate failed:`,n),_s.error(i({id:`EBVbtP`}),{description:r}),yn(),t()}},t[86]=i,t[87]=b,t[88]=O,t[89]=E,t[90]=yn,t[91]=Fn):Fn=t[91];let Ln=Fn,Rn=(0,Q.useRef)(Ln),zn;t[92]===Ln?zn=t[93]:(zn=()=>{Rn.current=Ln},t[92]=Ln,t[93]=zn),(0,Q.useEffect)(zn);let Bn=function(e){let t=QJ(e);if(!t||$J(t))return!1;let n=$t.getFocusedPath()??$t.getSelectedPaths()[0]??null;if(!n||n.endsWith(`/`)||Pn(n))return!1;let r=$J(n);if(!r)return!1;let i=ed(t);if(!un.current.includes(i))return!1;let a=`${t}${r}`;return on.current.includes(a)?!1:(xr({sourcePath:n,destinationPath:a,isFolder:!1}),$t.move(n,a),!0)},Vn;t[94]===Symbol.for(`react.memo_cache_sentinel`)?(Vn=e=>{let t=e??Ee.current;!t||Ee.current!==t||(t.disposeCommitListener(),Ee.current=null)},t[94]=Vn):Vn=t[94];let Hn=Vn,Wn;t[95]!==i||t[96]!==Hn||t[97]!==l||t[98]!==c||t[99]!==yn?(Wn=async function(e,t){let n=t===void 0?{}:t,r=n.updateUi??!0,a=n.restoreLocation??r;Hn(e),r&&G(e.renamePath);try{let t=await fetch(`/api/delete-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:e.kind,path:e.createdPath})});if(!t.ok&&t.status!==404){let n=e.kind,a=e.createdPath,o=await kt(t,i({id:`EcM3k7`,values:{kind:n}}));if(o.ok)return;let s=o.title,c=i({id:`YPFBfr`,values:{detail:s,kind:n,createdPath:a}});r?_s.error(c):console.warn(`[FileTree] cleanup pending create failed: ${c}`),r&&(G(null),yn());return}}catch(t){if(console.warn(`[FileTree] cleanup pending create failed:`,t),r){let t=e.kind,n=e.createdPath;_s.error(i({id:`_TDESN`,values:{kind:t,createdPath:n}}))}r&&(G(null),yn());return}r&&(e.kind===`file`?l(e.createdPath):c([ct(e.createdPath)],{force:!0})),r&&j(t=>{let n=cP(t,e.kind===`file`?[e.createdPath]:[],e.kind===`folder`?e.createdPath:void 0);return kn(n),n}),hl([`files`,`backlinks`,`graph`]),a&&(window.location.hash=e.previousHash),r&&G(null)},t[95]=i,t[96]=Hn,t[97]=l,t[98]=c,t[99]=yn,t[100]=Wn):Wn=t[100];let Gn=Wn,Kn,qn;t[101]===Symbol.for(`react.memo_cache_sentinel`)?(Kn=()=>()=>{let e=Ee.current;e&&Oe.current(e,{restoreLocation:!1,updateUi:!1}).catch(oX)},qn=[],t[101]=Kn,t[102]=qn):(Kn=t[101],qn=t[102]),(0,Q.useEffect)(Kn,qn);let Jn;t[103]!==i||t[104]!==bt?(Jn=()=>{let e=!0,t=null,n=OJ(async function(){t?.abort();let n=new AbortController;t=n,Ge.current+=1;for(let e of We.current.values())e.abort();We.current.clear(),He.current.clear();try{let t=await fetch(BY(``,$e.current),{signal:n.signal,headers:kJ});if(AJ(t)){let r=tt(),i=!1,{entries:a,truncated:o}=await NJ(t,{onBatch:t=>{if(!e||n.signal.aborted)return;let a=$c(Zc(t),r);a.length!==0&&(j(e=>FJ(e,a)),i||(i=!0,F(null),gt(),N(!1)))}});if(!e)return;let s=Zc(a),c=$c(s,r);j(e=>IJ(e,``,c,Be.current)),F(null),gt(),V(o?a.length:null),U(s.length),Ye.current()}else{let n=await kt(t,i({id:`8RtNI0`}));if(!e)return;if(!n.ok)vt(n.title),V(null);else{let e=mn.safeParse(n.body);if(!e.success)vt(i({id:`HlmZBk`})),V(null);else{let t=Zc(e.data.documents),n=$c(t,tt());j(e=>IJ(e,``,n,Be.current)),F(null),gt(),V(e.data.truncated===!0?e.data.documents.length:null),U(t.length),Ye.current()}}}}catch(t){let r=t;if(n.signal.aborted)return;e&&(r instanceof jJ?vt(r.message):bt()),console.warn(`[FileTree] fetch failed:`,r)}e&&N(!1)},()=>t?.abort());nt.current=()=>n.request(),n.request();let r=()=>{document.visibilityState===`visible`&&n.request()};window.addEventListener(`focus`,r),window.addEventListener(`visibilitychange`,r);let a=gl(e=>{e.includes(`files`)&&n.request()});return()=>{e=!1,nt.current=null,n.dispose();for(let e of We.current.values())e.abort();We.current.clear(),window.removeEventListener(`focus`,r),window.removeEventListener(`visibilitychange`,r),a()}},t[103]=i,t[104]=bt,t[105]=Jn):Jn=t[105];let Yn;t[106]===i?Yn=t[107]:(Yn=[i],t[106]=i,t[107]=Yn),(0,Q.useEffect)(Jn,Yn);let Xn=(0,Q.useRef)(!0),Zn;t[108]===Symbol.for(`react.memo_cache_sentinel`)?(Zn=()=>{if(Xn.current){Xn.current=!1;return}nt.current?.()},t[108]=Zn):Zn=t[108];let Qn;t[109]!==Vt||t[110]!==Ut||t[111]!==Ht?(Qn=[Vt,Ht,Ut],t[109]=Vt,t[110]=Ut,t[111]=Ht,t[112]=Qn):Qn=t[112],(0,Q.useEffect)(Zn,Qn);let $n,er;t[113]===Symbol.for(`react.memo_cache_sentinel`)?($n=()=>{let e=!0;return fetch(`/api/workspace`).then(async t=>{let n=await t.json();if(!e||!t.ok)return;let r=f(An,n,`workspace`,null);r&&oe({contentDir:r.contentDir,pathSeparator:r.pathSeparator})}).catch(aX),()=>{e=!1}},er=[],t[113]=$n,t[114]=er):($n=t[113],er=t[114]),(0,Q.useEffect)($n,er);let tr;t[115]!==_n||t[116]!==$t||t[117]!==an?(tr=()=>{if(ke.current===an){ke.current=null;return}$t.resetPaths(on.current,{initialExpandedPaths:_n()})},t[115]=_n,t[116]=$t,t[117]=an,t[118]=tr):tr=t[118];let nr;t[119]!==$t||t[120]!==an?(nr=[$t,an],t[119]=$t,t[120]=an,t[121]=nr):nr=t[121],(0,Q.useEffect)(tr,nr),vJ($t,Pt,fn,je,an);let rr,ir;t[122]!==$t||t[123]!==r?(rr=()=>{if(!r)return;let e=0,t=0,n=()=>rt.current?.querySelector(`file-tree-container`)?.shadowRoot?.querySelector(`[data-file-tree-virtualized-list]`)??null,i=()=>{let e=n();if(!e)return;let t=Number.parseFloat(e.style.height);Number.isFinite(t)&&r(t)},a=()=>{cancelAnimationFrame(e),e=requestAnimationFrame(i)},o=new MutationObserver(i),s=()=>{let e=n();e?(o.observe(e,{attributes:!0,attributeFilter:[`style`]}),i()):t=requestAnimationFrame(s)};s();let c=$t.subscribe(a);return window.addEventListener(`resize`,a),()=>{cancelAnimationFrame(e),cancelAnimationFrame(t),o.disconnect(),c(),window.removeEventListener(`resize`,a)}},ir=[r,$t],t[122]=$t,t[123]=r,t[124]=rr,t[125]=ir):(rr=t[124],ir=t[125]),(0,Q.useEffect)(rr,ir);let ar;t[126]===Symbol.for(`react.memo_cache_sentinel`)?(ar=()=>{ce(!1)},t[126]=ar):ar=t[126];let or;t[127]===Nt?or=t[128]:(or=[Nt],t[127]=Nt,t[128]=or),(0,Q.useEffect)(ar,or);let sr,cr;t[129]===se?(sr=t[130],cr=t[131]):(sr=()=>{le.current=se;for(let e of de.current)e()},cr=[se],t[129]=se,t[130]=sr,t[131]=cr),(0,Q.useEffect)(sr,cr);let lr;t[132]!==Pt||t[133]!==M||t[134]!==$t?(lr=()=>{M||!Pt||Qq($t,Pt)},t[132]=Pt,t[133]=M,t[134]=$t,t[135]=lr):lr=t[135];let dr;t[136]!==fn||t[137]!==Pt||t[138]!==M||t[139]!==$t||t[140]!==an?(dr=[Pt,fn,an,M,$t],t[136]=fn,t[137]=Pt,t[138]=M,t[139]=$t,t[140]=an,t[141]=dr):dr=t[141],(0,Q.useEffect)(lr,dr);let fr,mr;t[142]===$t?(fr=t[143],mr=t[144]):(fr=()=>$t.subscribe(()=>{if(!$t.isSearchOpen())for(let e of Te.current){let t=hJ($t.getItem(e));t&&!t.isExpanded()&&t.expand()}}),mr=[$t],t[142]=$t,t[143]=fr,t[144]=mr),(0,Q.useEffect)(fr,mr);let hr,gr;t[145]===$t?(hr=t[146],gr=t[147]):(hr=()=>$t.subscribe(()=>Je.current()),gr=[$t],t[145]=$t,t[146]=hr,t[147]=gr),(0,Q.useEffect)(hr,gr);let _r,vr;t[148]===$t?(_r=t[149],vr=t[150]):(_r=()=>$t.onMutation(`remove`,e=>{let t=Ee.current;!t||e.path!==t.renamePath||Oe.current(t)}),vr=[$t],t[148]=$t,t[149]=_r,t[150]=vr),(0,Q.useEffect)(_r,vr);let yr;t[151]!==b||t[152]!==u||t[153]!==d||t[154]!==ve||t[155]!==O||t[156]!==E||t[157]!==p||t[158]!==Dn||t[159]!==_?(yr=async(e,t,n,r,i)=>{let a=t===void 0?[]:t,o=n===void 0?[]:n,s=i===void 0?[]:i,c=r?.docName??be.current,l=new Map,f=new Map;for(let e of fe.current){if(tl(e)){let t=o.find(t=>t.fromPath===nd(e.docName,e.docExt))?.toPath;t&&l.set(e.docName,t);continue}if(fl(e)){let t=o.find(t=>t.fromPath===e.path)?.toPath;t&&Jc(t)&&f.set(e.path,Hu(t))}}let m=c?l.get(c)??null:null,h=r?.folderPath??(ut.current?.kind===`folder`?ut.current.folderPath:null),g=h?ye(h,a):null,v=r?.assetPath??(ut.current?.kind===`asset`?ut.current.assetPath:null),y=v?f.get(v)??null:null,x=m?null:y??dP(c,e),S=m??(v?y?null:o.find(e=>e.fromPath===v)?.toPath??ye(v,a):null);De(e);let C=[...fP(e,d(),p),...l.keys()];await Promise.all(C.map(e=>u(e)));for(let t of e)b(t.toDocName);for(let e of f.values())b(e);_(e,a,o);let w=null;j(t=>{let n=sP(t,e,a,o,s);return w=n,Dn(t,n,e,o),kn(n),n}),h&&g&&g!==h?O(g):x&&x!==c?(E(x),eY(x)):S&&(m||S!==v)&&ve(S,w??fe.current),hl([`files`,`backlinks`,`graph`])},t[151]=b,t[152]=u,t[153]=d,t[154]=ve,t[155]=O,t[156]=E,t[157]=p,t[158]=Dn,t[159]=_,t[160]=yr):yr=t[160];let br=yr;async function xr(e){let t=!e.isFolder&&Pn(e.sourcePath),n=t?e.sourcePath:qu(e.sourcePath,e.isFolder);G(n),F(null);try{let r=Yc(e.sourcePath,e.destinationPath,e.isFolder),a=!e.isFolder&&!t&&!Jc(r.destinationPath),o=t||a?r.destinationPath:qu(r.destinationPath,e.isFolder),s=e.isFolder?{kind:`folder`,fromPath:cd(n),toPath:cd(o)}:t||a?{kind:`asset`,fromPath:n,toPath:o}:{kind:`file`,fromPath:sd(n,fe.current),toPath:o},c={docName:be.current,folderPath:ut.current?.kind===`folder`?ut.current.folderPath:null,assetPath:ut.current?.kind===`asset`?ut.current.assetPath:null},l=await kt(await fetch(`/api/rename-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(s)}),i({id:`gijbne`}));if(!l.ok){_s.error(l.title),yn();let e=Ee.current;e&&e.renamePath===n?await Gn(e):Hn(),G(null);return}let u=f(pr,l.body,`rename-path`,{renamed:[],renamedAssets:[]});try{await br(u.renamed,e.isFolder?[{fromPath:cd(n),toPath:cd(o)}]:[],u.renamedAssets,c,!e.isFolder&&!t&&!a?u.renamed.flatMap(e=>{let t=Xc(o);return t?[{toDocName:e.toDocName,docExt:t}]:[]}):[])}catch(e){console.warn(`[FileTree] post-rename reconciliation failed`,{err:e,sourceTreePath:n,destinationTreePath:o,renamedCount:u.renamed.length,renamedAssetCount:u.renamedAssets.length}),_s.error(i({id:`dDpCOp`}))}Hn(),G(null)}catch(e){console.warn(`[FileTree] rename failed:`,e);let t=i({id:`HIb0vl`});_s.error(t),F(t),yn();let r=Ee.current;r&&r.renamePath===n?await Gn(r):Hn(),G(null)}}let Sr;t[161]!==i||t[162]!==br||t[163]!==yn?(Sr=async function(e){let t=e.draggedPaths.map(t=>{let n=Ju(t,e.target);return t===n?null:{sourcePath:t,destinationTreePath:n}}).filter(iX);if(t.length!==0){G(t[0]?.sourcePath??null),F(null);try{let e=[],n=[],r=[],a={docName:be.current,folderPath:ut.current?.kind===`folder`?ut.current.folderPath:null,assetPath:ut.current?.kind===`asset`?ut.current.assetPath:null};for(let a of t){let t=a.sourcePath.endsWith(`/`),o=!t&&Pn(a.sourcePath),s=o?null:sd(a.sourcePath,fe.current),c=t?{kind:`folder`,fromPath:cd(a.sourcePath),toPath:cd(a.destinationTreePath)}:o?{kind:`asset`,fromPath:a.sourcePath,toPath:a.destinationTreePath}:{kind:`file`,fromPath:s??Hu(a.sourcePath),toPath:s&&Jc(s)?a.destinationTreePath:Hu(a.destinationTreePath)},l=await kt(await fetch(`/api/rename-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(c)}),i({id:`dOHMA0`}));if(!l.ok){_s.error(l.title),yn(),G(null);return}let u=f(pr,l.body,`rename-path:drop`,{renamed:[],renamedAssets:[]});e=e.concat(u.renamed),n=n.concat(u.renamedAssets),t&&r.push({fromPath:cd(a.sourcePath),toPath:cd(a.destinationTreePath)})}try{await br(e,r,n,a)}catch(r){console.warn(`[FileTree] post-move reconciliation failed`,{err:r,operationCount:t.length,renamedCount:e.length,renamedAssetCount:n.length}),_s.error(i({id:`8OxKZy`}))}G(null)}catch(e){console.warn(`[FileTree] move failed:`,e),_s.error(i({id:`HIb0vl`})),yn(),G(null)}}},t[161]=i,t[162]=br,t[163]=yn,t[164]=Sr):Sr=t[164];let Cr=Sr,wr;t[165]!==i||t[166]!==b||t[167]!==yn?(wr=async function(e,t,n){if(e.length===0||Le.current!==null)return;let r=()=>{Le.current=null,G(null)};Le.current=n,G(n),F(null);let a=[],o=0,s=0;for(let n of e){let e=new FormData;e.append(`file`,n),rd(e,t,n.name||`upload`);try{let r=await kt(await fetch(`/api/upload`,{method:`POST`,body:e}),i({id:`4Gz2wC`}));if(!r.ok){s+=1,_s.error(r.title,{description:n.name});continue}let c=f(ur,r.body,`upload:drop`,null);if(c===null){s+=1,_s.error(i({id:`4Gz2wC`}),{description:n.name});continue}let l=zu(t,c);if(c.deduped===!0){s+=1,_s.error(i({id:`4sKwf6`}),{description:l});continue}o+=1;let u=id(l,n);u&&a.push(u)}catch(e){let t=e;s+=1,console.warn(`[FileTree] external file upload failed:`,t),_s.error(t instanceof TypeError?i({id:`HIb0vl`}):i({id:`4Gz2wC`}),{description:n.name})}}try{if(a.length>0){for(let e of a)tl(e)&&b(e.docName);j(e=>{let t=new Set(e.map(Wu)),n=!1,r=[...e];for(let e of a){let i=Wu(e);Be.current.set(i,Date.now()),!t.has(i)&&(t.add(i),r.push(e),n=!0)}return n?(yn(r),kn(r),r):e})}o>0&&(hl([`files`,`backlinks`,`graph`]),nt.current?.(),_s.success(qc._({id:`v75Em9`,values:{uploadedCount:o}}),{description:t||i({id:`RSqaSd`})})),s>0&&F(o>0?qc._({id:`yH7T4q`,values:{failedCount:s}}):i({id:`4Gz2wC`})),r()}catch(e){let t=e,n=i({id:`VcqWBy`});console.warn(`[FileTree] upload post-upload reconciliation failed:`,t),_s.error(n),F(n),r()}},t[165]=i,t[166]=b,t[167]=yn,t[168]=wr):wr=t[168];let Tr=wr,Er;t[169]===Symbol.for(`react.memo_cache_sentinel`)?(Er=function(e){q({parentDir:e})},t[169]=Er):Er=t[169];let Dr=Er,Or;t[170]!==i||t[171]!==b||t[172]!==Gn||t[173]!==Hn||t[174]!==$t||t[175]!==O||t[176]!==E||t[177]!==yn||t[178]!==rn?(Or=async function(e,t,n){if(Le.current)return;let r=Ee.current;r&&Hn(r);try{let r=$u(e,t,[...rn,...un.current]);G(r.renamePath),Le.current=r.renamePath;let a=window.location.hash,o;if(e===`file`){let e=Vu(`file`,r.addPath),t={path:e};n?.template&&(t.template=n.template);let a=await kt(await fetch(`/api/create-page`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)}),i({id:`fJgQHX`}));if(!a.ok){_s.error(a.title),G(null),Le.current=null;return}let s=Hu(e),c=f(In,a.body,`create-page`,{docName:s}).docName;o=c;let l={kind:`document`,docName:c,docExt:e.toLowerCase().endsWith(`.mdx`)?`.mdx`:`.md`,modified:new Date().toISOString(),size:0};b(c),j(e=>{if(e.some(e=>tl(e)&&e.docName===c))return e;let t=[...e,l];return kn(t),Be.current.set(Wu(l),Date.now()),t}),hl([`files`,`backlinks`,`graph`]),E(c)}else{let e=cd(r.addPath),t=await kt(await fetch(`/api/create-folder`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e})}),i({id:`K1ckLX`}));if(!t.ok){_s.error(t.title),G(null),Le.current=null;return}o=f(Hr,t.body,`create-folder`,{path:e}).path;let n={kind:`folder`,path:o,modified:new Date().toISOString(),size:0};j(e=>{if(e.some(e=>dl(e)&&e.path===o))return e;let t=[...e,n];return kn(t),Be.current.set(Wu(n),Date.now()),t}),hl([`files`]),O(o)}let s=!1,c=e=>{if(e.key!==`Enter`)return;let t=Ee.current;!t||t.renamePath!==r.renamePath||queueMicrotask(()=>Hn(t))};document.addEventListener(`keydown`,c,!0),Ee.current={kind:e,renamePath:r.renamePath,createdPath:o,previousHash:a,disposeCommitListener:()=>{s||(s=!0,document.removeEventListener(`keydown`,c,!0))}},G(null),Le.current=null,$t.add(r.addPath),$t.startRenaming(r.renamePath,{removeIfCanceled:!0})}catch(e){console.warn(`[FileTree] create placeholder failed:`,e),_s.error(i({id:`S6l5dv`}));let t=Ee.current;t?await Gn(t):Hn(),G(null),Le.current=null,yn()}},t[170]=i,t[171]=b,t[172]=Gn,t[173]=Hn,t[174]=$t,t[175]=O,t[176]=E,t[177]=yn,t[178]=rn,t[179]=Or):Or=t[179];let kr=Or,Ar;t[180]===$t?Ar=t[181]:(Ar=function(e){let t=ed(e);(0,Q.startTransition)(()=>{for(let e of un.current)if(e===t||e.startsWith(t)){let t=hJ($t.getItem(e));t&&t.expand()}})},t[180]=$t,t[181]=Ar);let jr=Ar,Mr;t[182]===$t?Mr=t[183]:(Mr=function(e){let t=ed(e),n=new Set(Te.current);(0,Q.startTransition)(()=>{for(let e of[...un.current].reverse())if((e===t||e.startsWith(t))&&!n.has(e)){let t=hJ($t.getItem(e));t&&t.collapse()}})},t[182]=$t,t[183]=Mr);let Nr=Mr,Pr;t[184]===Symbol.for(`react.memo_cache_sentinel`)?(Pr=function(){return((rt.current?.querySelector(`file-tree-container`)?.shadowRoot)?.querySelector(`[aria-selected="true"][data-item-path]`))?.dataset.itemPath??null},t[184]=Pr):Pr=t[184];let Fr=Pr,Ir;t[185]!==ge||t[186]!==dn||t[187]!==o||t[188]!==s||t[189]!==Se||t[190]!==W||t[191]!==Gn||t[192]!==Cn||t[193]!==A||t[194]!==cn||t[195]!==Cr||t[196]!==xr||t[197]!==tn||t[198]!==x||t[199]!==Bn||t[200]!==Tn||t[201]!==Vt||t[202]!==Ut||t[203]!==Ht||t[204]!==rn||t[205]!==Tr?(Ir=()=>{fe.current=A,pe.current=x,be.current=o,ut.current=s,Ce.current=Se,Le.current=W,Ze.current=Vt,Qe.current=Ht,$e.current=Ut,on.current=rn,un.current=cn,Te.current=dn,Je.current=Cn,Ye.current=Tn,Oe.current=Gn,Ie.current=(e,t,n)=>{Tr(e,t,n)},it.current=e=>{if(je.current||Me.current||e.length!==1)return;let t=e[0];if(t){ce(!1);let e=tn(t),n=me.current,r=n!==null&&Hu(n)===Hu(e),i=r?n:e;me.current=null,queueMicrotask(()=>{ge(tn((r?null:Fr())??i),fe.current)})}},ot.current=e=>{Bn(e)||_s.error(e)},at.current=xr,lt.current=Cr},t[185]=ge,t[186]=dn,t[187]=o,t[188]=s,t[189]=Se,t[190]=W,t[191]=Gn,t[192]=Cn,t[193]=A,t[194]=cn,t[195]=Cr,t[196]=xr,t[197]=tn,t[198]=x,t[199]=Bn,t[200]=Tn,t[201]=Vt,t[202]=Ut,t[203]=Ht,t[204]=rn,t[205]=Tr,t[206]=Ir):Ir=t[206],(0,Q.useLayoutEffect)(Ir);let Lr,Rr;t[207]===$t?(Lr=t[208],Rr=t[209]):(Lr=()=>{let e=e=>{let t=(e.metaKey||e.ctrlKey)&&!e.altKey,n=e.key.toLowerCase(),r=t&&n===`a`,i=t&&!e.shiftKey&&n===`d`,a=t&&!e.shiftKey&&n===`c`,o=t&&!e.shiftKey&&n===`v`,s=!e.altKey&&!e.shiftKey&&(e.metaKey&&!e.ctrlKey&&n===`backspace`||!e.metaKey&&!e.ctrlKey&&n===`delete`);if(!r&&!i&&!a&&!o&&!s||NY(e.target))return;let c=rt.current,l=e.target,u=document.activeElement,d=l instanceof Node&&c?.contains(l),f=u instanceof Node&&c?.contains(u);if(!d&&!f)return;if(a){let t=AY($t,fe.current,Ce.current);if(!t)return;Re.current=t,e.preventDefault(),e.stopPropagation();return}if(o){let t=Re.current;if(!t)return;Rn.current(t),e.preventDefault(),e.stopPropagation();return}if(i){let t=AY($t,fe.current,Ce.current);if(!t)return;Rn.current(t),e.preventDefault(),e.stopPropagation();return}if(s){if(Le.current!==null)return;let t=jY($t,fe.current);if(t.length===0)return;te({targets:t}),e.preventDefault(),e.stopPropagation();return}let p=new Set([...un.current,...on.current]);je.current=!0;for(let e of p)e&&$t.getItem(e)?.select();queueMicrotask(()=>{je.current=!1}),e.preventDefault(),e.stopPropagation()};return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},Rr=[$t],t[207]=$t,t[208]=Lr,t[209]=Rr),(0,Q.useEffect)(Lr,Rr);let Br,Vr;t[210]!==A.length||t[211]!==M?(Br=()=>{if(M||A.length===0)return;let e=rt.current?.querySelector(dR)?.shadowRoot;if(!e)return;let t=rX,n=()=>{for(let n of e.querySelectorAll(`[data-item-path]`)){let e=n.dataset.itemPath;if(!e)continue;let r=t(e);n.title!==r&&(n.title=r)}let n=e.querySelector(`[data-type="context-menu-anchor"]`);if(n){let r=e.querySelector(`[data-item-context-hover="true"][data-item-path]`)?.dataset.itemPath,i=r?t(r):``;n.title!==i&&(n.title=i)}};n();let r=new MutationObserver(n);return r.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`data-item-path`,`data-item-context-hover`]}),()=>r.disconnect()},Vr=[M,A.length],t[210]=A.length,t[211]=M,t[212]=Br,t[213]=Vr):(Br=t[212],Vr=t[213]),(0,Q.useEffect)(Br,Vr);let Ur,Wr;t[214]!==A.length||t[215]!==M?(Ur=()=>{if(M||A.length===0)return;let e=rt.current?.querySelector(dR)?.shadowRoot;if(!e)return;let t=()=>kq(e);t();let n=new MutationObserver(t);return n.observe(e,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:[`data-item-path`]}),()=>n.disconnect()},Wr=[M,A.length],t[214]=A.length,t[215]=M,t[216]=Ur,t[217]=Wr):(Ur=t[216],Wr=t[217]),(0,Q.useEffect)(Ur,Wr);let Gr,Kr;t[218]!==A.length||t[219]!==M?(Gr=()=>{if(M||A.length===0)return;let e=rt.current?.querySelector(dR)?.shadowRoot;if(!e)return;let t=()=>qq(e);t();let n=new MutationObserver(t);return n.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`data-item-path`]}),()=>n.disconnect()},Kr=[M,A.length],t[218]=A.length,t[219]=M,t[220]=Gr,t[221]=Kr):(Gr=t[220],Kr=t[221]),(0,Q.useEffect)(Gr,Kr);let qr;t[222]===Symbol.for(`react.memo_cache_sentinel`)?(qr={folderCount:0,expandedCount:0},t[222]=qr):qr=t[222];let Jr=(0,Q.useRef)(qr),Yr=(0,Q.useRef)(kr),Xr=(0,Q.useRef)(Dr),Zr;t[223]===kr?Zr=t[224]:(Zr=()=>{Yr.current=kr,Xr.current=Dr},t[223]=kr,t[224]=Zr),(0,Q.useEffect)(Zr);let Qr,$r;t[225]===$t?(Qr=t[226],$r=t[227]):(Qr=()=>({startCreating(e,t){Yr.current(e,t)},startCreatingFromTemplate(e){Xr.current(e)},createFromTemplate(e,t){Yr.current(`file`,e,{template:t})},expandAll(){(0,Q.startTransition)(()=>{for(let e of un.current){let t=hJ($t.getItem(e));t&&t.expand()}})},collapseAll(){let e=new Set(Te.current);(0,Q.startTransition)(()=>{for(let t of[...un.current].reverse()){if(e.has(t))continue;let n=hJ($t.getItem(t));n&&n.collapse()}})},getFolderState(){let e=un.current,t=0;for(let n of e)hJ($t.getItem(n))?.isExpanded()&&t++;let n=e.length,r=Jr.current;if(r.folderCount===n&&r.expandedCount===t)return r;let i={folderCount:n,expandedCount:t};return Jr.current=i,i},isCreationTargetCleared(){return le.current},clearCreationTarget(){ce(!0)},subscribe(e){de.current.add(e);let t=$t.subscribe(e);return()=>{de.current.delete(e),t()}}}),$r=[$t],t[225]=$t,t[226]=Qr,t[227]=$r),(0,Q.useImperativeHandle)(n,Qr,$r);let ei;t[228]!==Hn||t[229]!==u||t[230]!==c||t[231]!==$t?(ei=async function(e,t,n){let r=PY(e,fe.current,un.current),i=Ee.current;i&&e.some(e=>FY(e,i))&&(i.kind===`file`?r.docNames.add(i.createdPath):r.folderPaths.add(i.createdPath),Hn(i));let a=new Set([...r.docNames,...t]),o=new Set([...r.folderPaths,...n]),s=new Set([...r.assetPaths,...e.filter(nX).map(tX)]);c([...[...a].map(eX),...[...o].map($Y),...[...s].map(QY)],{force:!0}),await Promise.all([...a].map(e=>u(e)));for(let t of e){let e=t.kind===`folder`?ed(t.path):t.kind===`asset`?t.path:nd(t.path,t.docExt);$t.getItem(e)&&$t.remove(e,t.kind===`folder`?{recursive:!0}:void 0)}j(e=>{let t=cP(e,[...a],void 0,[...s]);for(let e of o)t=cP(t,[],e);return kn(t),t}),hl([`files`,`backlinks`,`graph`])},t[228]=Hn,t[229]=u,t[230]=c,t[231]=$t,t[232]=ei):ei=t[232];let ti=ei,ni;t[233]!==i||t[234]!==ti?(ni=async function(e){let t=[],n=[],r=[];for(let a of e){let e=a.kind;G(a.path);let o=await kt(await fetch(`/api/delete-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:e,path:a.path})}),i({id:`7JtSLi`}));if(!o.ok)return r.length>0&&await ti(r,t,n),_s.error(o.title),!1;let s=f(zr,o.body,`delete-path`,{deletedDocNames:[]});t.push(...s.deletedDocNames),e===`folder`&&n.push(a.path),r.push(a)}return await ti(r,t,n),!0},t[233]=i,t[234]=ti,t[235]=ni):ni=t[235];let ri=ni,ii;t[236]===Symbol.for(`react.memo_cache_sentinel`)?(ii=async function(e,t,n){let r=[],i=[];for(let a of e){G(a.path);let e=pP(a,n),o=await t.shell.trashItem(e);o.ok?r.push(a):i.push({kind:a.kind,path:a.path,name:a.name,reason:cJ(o.reason),detail:o.detail})}return{trashed:r,failed:i}},t[236]=ii):ii=t[236];let ai=ii,oi;t[237]===i?oi=t[238]:(oi=async function(e){let t=[],n=[],r=[];for(let a of e){let e=a.kind;try{let o=await kt(await fetch(`/api/trash/cleanup`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:e,path:a.path})}),i({id:`DVh_Tb`}));if(!o.ok){console.warn(`[FileTree] trash-cleanup failed`,{target:`${a.kind}:${a.path}`,reason:o.title}),r.push({target:a,reason:o.title});continue}let s=f(Nn,o.body,`trash-cleanup`,{deletedDocNames:[]});t.push(...s.deletedDocNames),e===`folder`&&n.push(a.path)}catch(e){let t=e;console.warn(`[FileTree] trash-cleanup threw`,{target:`${a.kind}:${a.path}`,err:t}),r.push({target:a,reason:i({id:`r4R7AZ`})})}}if(r.length>0){let e=r.length;_s.error(i({id:`IrB5AK`,values:{failedCount:e}}),{description:i({id:`vEJDlt`})})}return r.length===e.length&&e.length>0?null:{deletedDocNames:t,deletedFolderPaths:n}},t[237]=i,t[238]=oi);let si=oi,ci;t[239]!==i||t[240]!==re||t[241]!==ti||t[242]!==ri||t[243]!==si||t[244]!==yn||t[245]!==ae?(ci=async function(e){let t=e.filter(ZY).map(e=>lP(e,fe.current)),n=t[0];if(!n)return;let r=re.filter(e=>t.some(t=>{if(t.kind===`file`){let n=`${t.path}${t.docExt??`.md`}`;return e.file===n}return t.kind===`folder`?e.file.startsWith(`${t.path}/`):!1}));if(r.length>0){let e=r.slice(0,3).map(XY),t=r.length>e.length?`, +${r.length-e.length} more`:``;_s.error(`Cannot delete files with unresolved conflicts`,{description:`Resolve the conflict on ${e.join(`, `)}${t} before deleting.`});return}G(n.path),te(null);let a=typeof window<`u`?window.okDesktop:void 0;try{if(a&&ae){let{trashed:e,failed:n}=await ai(t,a,ae);if(e.length>0){let t=await si(e);t?await ti(e,t.deletedDocNames,t.deletedFolderPaths):await ti(e,e.filter(YY).map(JY),e.filter(qY).map(KY))}n.length>0&&ne({failed:n,originalTargets:[...t]}),G(null)}else{let e=await ri(t);G(null),e||yn()}}catch(e){let t=e,n=t instanceof Error?t.message:String(t);console.warn(`[FileTree] delete failed:`,t),_s.error(i({id:`0eHrMb`}),{description:n}),G(null),yn()}},t[239]=i,t[240]=re,t[241]=ti,t[242]=ri,t[243]=si,t[244]=yn,t[245]=ae,t[246]=ci):ci=t[246];let li=ci,ui;t[247]!==i||t[248]!==ri||t[249]!==yn||t[250]!==K?(ui=async function(){if(!K)return;let e=new Set(K.failed.map(GY)),t=K.originalTargets.filter(t=>e.has(`${t.kind}:${t.path}`));if(ne(null),t.length!==0){G(t[0]?.path??null);try{let e=await ri(t);G(null),e||yn()}catch(e){let t=e,n=t instanceof Error?t.message:String(t);console.warn(`[FileTree] hard-delete fallback failed:`,t),_s.error(i({id:`0eHrMb`}),{description:n}),G(null),yn()}}},t[247]=i,t[248]=ri,t[249]=yn,t[250]=K,t[251]=ui):ui=t[251];let di=ui,fi;t[252]!==li||t[253]!==K?(fi=async function(){if(!K)return;let e=new Set(K.failed.map(WY)),t=K.originalTargets.filter(t=>e.has(`${t.kind}:${t.path}`));ne(null),await li(t)},t[252]=li,t[253]=K,t[254]=fi):fi=t[254];let pi=fi,mi=(0,Q.useRef)(li),hi;t[255]===li?hi=t[256]:(hi=()=>{mi.current=li},t[255]=li,t[256]=hi),(0,Q.useEffect)(hi);let gi,_i;t[257]===Symbol.for(`react.memo_cache_sentinel`)?(gi=()=>CJ(e=>{if(e.kind===`doc`||e.kind===`folder-index`){let t=e.docName,n=fe.current.find(e=>tl(e)&&e.docName===t);mi.current([{kind:`file`,path:t,name:t.split(`/`).pop()??t,docExt:n?.docExt}]);return}if(e.kind===`folder`){mi.current([{kind:`folder`,path:e.folderPath,name:e.folderPath.split(`/`).pop()??e.folderPath}]);return}if(e.kind===`asset`){mi.current([{kind:`asset`,path:e.assetPath,name:e.assetPath.split(`/`).pop()??e.assetPath}]);return}console.warn(JSON.stringify({event:`file-tree-menu-action-delete-unsupported-kind`,kind:e.kind}))}),_i=[],t[257]=gi,t[258]=_i):(gi=t[257],_i=t[258]),(0,Q.useEffect)(gi,_i);let vi,yi;t[259]===Symbol.for(`react.memo_cache_sentinel`)?(vi=()=>DJ(e=>{if(e.kind===`doc`||e.kind===`folder-index`){let t=e.docName,n=fe.current.find(e=>tl(e)&&e.docName===t);Rn.current({kind:`file`,path:t,name:t.split(`/`).pop()??t,docExt:n?.docExt});return}if(e.kind===`folder`){Rn.current({kind:`folder`,path:e.folderPath,name:e.folderPath.split(`/`).pop()??e.folderPath});return}console.warn(JSON.stringify({event:`file-tree-menu-action-duplicate-unsupported-kind`,kind:e.kind}))}),yi=[],t[259]=vi,t[260]=yi):(vi=t[259],yi=t[260]),(0,Q.useEffect)(vi,yi);let bi,xi;t[261]===$t?(bi=t[262],xi=t[263]):(bi=()=>TJ(e=>{if(e.kind===`doc`||e.kind===`folder-index`){let t=e.docName,n=nd(t,fe.current.find(e=>tl(e)&&e.docName===t)?.docExt);$t.startRenaming(n);return}if(e.kind===`folder`){$t.startRenaming(e.folderPath);return}if(e.kind===`asset`){$t.startRenaming(e.assetPath);return}console.warn(JSON.stringify({event:`file-tree-menu-action-rename-unsupported-kind`,kind:e.kind}))}),xi=[$t],t[261]=$t,t[262]=bi,t[263]=xi),(0,Q.useEffect)(bi,xi);let Si;t[264]===Symbol.for(`react.memo_cache_sentinel`)?(Si=function(){let e=Ae.current;e&&XJ(e),Ae.current=null},t[264]=Si):Si=t[264];let Ci=Si,wi;t[265]===Symbol.for(`react.memo_cache_sentinel`)?(wi=function(e){let t=wY(e);if(!t)return!1;let n=rt.current?.querySelector(dR)?.shadowRoot;if(!n)return!1;for(let e of n.querySelectorAll(`[data-item-path]`))if(e.dataset.itemPath===t)return!0;return!1},t[265]=wi):wi=t[265];let Ti=wi,Ei;t[266]===g?Ei=t[267]:(Ei=function(e){let t=_X(e.nativeEvent);if(!t||t.endsWith(`/`)){Ci();return}let n=fe.current.find(e=>Wu(e)===t);if(n&&fl(n)){Ci();return}let r=n&&tl(n)?n.docName:sd(t,fe.current);if(n&&tl(n)&&Un(n.size)){Ci();return}Ae.current!==r&&(Ci(),Ae.current=r,YJ(r,e=>g(e)))},t[266]=g,t[267]=Ei);let Di=Ei,Oi;t[268]!==ge||t[269]!==$t||t[270]!==O||t[271]!==E?(Oi=function(e){if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=vX(e.nativeEvent);if(!t){xX(e.nativeEvent)&&ce(!0);return}let n=t.getAttribute(`aria-selected`)===`true`,r=t.dataset.itemPath;if(!r)return;let i=t.dataset.itemType===`folder`?ed(r):r;if(t.dataset.itemType===`folder`){let t=cd(i),r=hJ($t.getItem(i));if(!n){e.preventDefault(),e.stopPropagation(),r&&!r.isExpanded()&&r.expand(),queueMicrotask(()=>O(t));return}if($t.getSelectedPaths().length!==1||window.location.hash===wl(t))return;e.preventDefault(),e.stopPropagation(),r&&!r.isExpanded()&&r.expand(),queueMicrotask(()=>O(t));return}if(!n){if(TY(i,on.current)||Ti(i)){me.current=i,setTimeout(()=>E(i,void 0,{registerPage:!0}),0);return}queueMicrotask(()=>ge(i));return}let a=sd(i,fe.current);$t.getSelectedPaths().length===1&&window.location.hash!==Ml(a)&&queueMicrotask(()=>ge(i))},t[268]=ge,t[269]=$t,t[270]=O,t[271]=E,t[272]=Oi):Oi=t[272];let ki=Oi,Ai;t[273]===Symbol.for(`react.memo_cache_sentinel`)?(Ai=function(e){Zu(e.nativeEvent)&&(e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect=`copy`,ft(!0))},t[273]=Ai):Ai=t[273];let ji=Ai,Mi;t[274]===Symbol.for(`react.memo_cache_sentinel`)?(Mi=function(e){let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||ft(!1)},t[274]=Mi):Mi=t[274];let Ni=Mi,Pi;t[275]===Tr?Pi=t[276]:(Pi=function(e){if(!Zu(e.nativeEvent))return;let t=Gu(e.nativeEvent);t.length!==0&&(e.preventDefault(),e.stopPropagation(),ft(!1),Tr(t,``,hY))},t[275]=Tr,t[276]=Pi);let Fi=Pi;if(M){let e;return t[277]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(CX,{}),t[277]=e):e=t[277],e}let Ii;t[278]!==i||t[279]!==I||t[280]!==R?(Ii=I?i(R?{id:`H-vDm3`}:{id:`09Tv5j`}):null,t[278]=i,t[279]=I,t[280]=R,t[281]=Ii):Ii=t[281];let Li=Ii;if(A.length===0){if(Li!==null){let e;return t[282]===Li?e=t[283]:(e=(0,Z.jsx)(`div`,{className:`flex flex-1 items-center justify-center py-8`,children:(0,Z.jsx)(`span`,{role:`status`,className:`select-none text-sidebar-foreground/50 text-sm`,children:Li})}),t[282]=Li,t[283]=e),e}if(P){let e;return t[284]===P?e=t[285]:(e=(0,Z.jsx)(`div`,{className:`flex flex-1 items-center justify-center py-8`,children:(0,Z.jsx)(`span`,{role:`alert`,className:`select-none text-sidebar-foreground/50 text-sm`,children:P})}),t[284]=P,t[285]=e),e}if(rl({visibility:{showHiddenFiles:Vt,showOnlyMarkdownFiles:Ht},unfilteredRootEntryCount:H,knownPageCount:S.size})===`filtered-to-zero`){let e;return t[286]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(yq,{}),t[286]=e):e=t[286],e}let e;t[287]===i?e=t[288]:(e=i({id:`5ZB7XC`}),t[287]=i,t[288]=e);let n=dt&&`bg-primary/5 ring-2 ring-primary/70 ring-inset`,r;t[289]===n?r=t[290]:(r=Y(`flex flex-1 flex-col items-center justify-center gap-3 rounded-md py-8`,n),t[289]=n,t[290]=r);let a;t[291]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(`span`,{className:`select-none text-sidebar-foreground/30 text-sm`,children:(0,Z.jsx)(J,{id:`xiv-dW`})}),t[291]=a):a=t[291];let o;t[292]===kr?o=t[293]:(o=()=>kr(`file`,``),t[292]=kr,t[293]=o);let s;t[294]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(J,{id:`6ibbCg`}),t[294]=s):s=t[294];let c;t[295]===o?c=t[296]:(c=(0,Z.jsx)(X,{variant:`link`,size:`sm`,className:`font-mono uppercase`,onClick:o,children:s}),t[295]=o,t[296]=c);let l;return t[297]!==Fi||t[298]!==e||t[299]!==r||t[300]!==c?(l=(0,Z.jsxs)(`section`,{"aria-label":e,className:r,onDragOver:ji,onDragLeave:Ni,onDrop:Fi,children:[a,c]}),t[297]=Fi,t[298]=e,t[299]=r,t[300]=c,t[301]=l):l=t[301],l}let Ri=W!==null,zi=ee?.targets[0]??null,Bi=null;if(B!==null){let e;if(t[302]!==a.locale||t[303]!==B){let n=new Intl.NumberFormat(a.locale).format(B);e=qc._({id:`LuoJWu`,values:{truncatedShownCount:B,formattedCount:n}}),t[302]=a.locale,t[303]=B,t[304]=e}else e=t[304];Bi=e}let Vi;t[305]!==P||t[306]!==Li||t[307]!==Bi?(Vi=(P||Li!==null||Bi!==null)&&(0,Z.jsxs)(Z.Fragment,{children:[Li===null?P&&(0,Z.jsx)(TX,{kind:`error`,children:P}):(0,Z.jsx)(TX,{kind:`reconnecting`,children:Li}),Bi!==null&&(0,Z.jsx)(TX,{kind:`info`,children:Bi})]}),t[305]=P,t[306]=Li,t[307]=Bi,t[308]=Vi):Vi=t[308];let Hi;t[309]===y?Hi=t[310]:(Hi=wq(y),t[309]=y,t[310]=Hi);let Ui=se?``:void 0,Wi;t[311]===Ui?Wi=t[312]:(Wi={[vY]:Ui},t[311]=Ui,t[312]=Wi);let Gi;t[313]!==Ri||t[314]!==Se||t[315]!==Nr||t[316]!==A||t[317]!==jr||t[318]!==cn||t[319]!==Ln||t[320]!==Rt||t[321]!==$t||t[322]!==zt||t[323]!==kr||t[324]!==ae?(Gi=(e,t)=>(0,Z.jsx)(IY,{item:e,context:t,anyActionBusy:Ri,workspace:ae,handoff:Rt,model:$t,okignoreBinding:zt,onStartCreating:kr,onCreateFromTemplate:(e,t)=>kr(`file`,e,{template:t}),onDuplicate:Ln,onDelete:e=>te({targets:e}),onExpandSubtree:jr,onCollapseSubtree:Nr,folderTreePaths:cn,isAsset:Se.has(e.path),documents:A}),t[313]=Ri,t[314]=Se,t[315]=Nr,t[316]=A,t[317]=jr,t[318]=cn,t[319]=Ln,t[320]=Rt,t[321]=$t,t[322]=zt,t[323]=kr,t[324]=ae,t[325]=Gi):Gi=t[325];let Ki;t[326]!==ki||t[327]!==Di||t[328]!==$t||t[329]!==Vi||t[330]!==Hi||t[331]!==Wi||t[332]!==Gi?(Ki=(0,Z.jsx)(`div`,{ref:rt,className:`flex min-h-0 flex-1 flex-col`,children:(0,Z.jsx)(_q,{header:Vi,model:$t,style:Hi,...Wi,onClickCapture:ki,onMouseMove:Di,onMouseLeave:Ci,renderContextMenu:Gi})}),t[326]=ki,t[327]=Di,t[328]=$t,t[329]=Vi,t[330]=Hi,t[331]=Wi,t[332]=Gi,t[333]=Ki):Ki=t[333];let qi=!!ee,Ji;t[334]===W?Ji=t[335]:(Ji=e=>{!e&&!W&&te(null)},t[334]=W,t[335]=Ji);let Yi;t[336]!==i||t[337]!==W||t[338]!==ee||t[339]!==li||t[340]!==zi?(Yi=ee&&zi&&(0,Z.jsx)(Ta,{...(()=>{let e=iJ(typeof window<`u`&&window.okDesktop!=null?`electron`:`web`,ee.targets);if(e)return{customTitle:e.title,customDescription:``,customDetail:e.detail,customConfirmLabel:e.confirmLabel,customConfirmLabelBusy:e.confirmLabelBusy,children:e.listedTargets?(0,Z.jsx)(`ul`,{className:`flex flex-col gap-1 font-mono text-foreground text-xs`,children:e.listedTargets.map(UY)}):null};let t=ee.targets.length,n=zi.name;return{itemName:t===1?zi.kind===`folder`?`${zi.name}/`:zi.kind===`file`?`${zi.name}${zi.docExt??`.md`}`:zi.name:void 0,customTitle:t>1?i({id:`abiHje`}):void 0,customDescription:t>1?i({id:`WMIKXK`,values:{targetCount:t}}):zi.kind===`folder`?i({id:`a5W0q0`,values:{folderName:n}}):void 0}})(),isSubmitting:W!==null,onDelete:()=>li(ee.targets)}),t[336]=i,t[337]=W,t[338]=ee,t[339]=li,t[340]=zi,t[341]=Yi):Yi=t[341];let Xi;t[342]!==qi||t[343]!==Ji||t[344]!==Yi?(Xi=(0,Z.jsx)(Vs,{open:qi,onOpenChange:Ji,children:Yi}),t[342]=qi,t[343]=Ji,t[344]=Yi,t[345]=Xi):Xi=t[345];let Zi=!!K,Qi;t[346]===W?Qi=t[347]:(Qi=e=>{!e&&!W&&ne(null)},t[346]=W,t[347]=Qi);let $i;t[348]!==W||t[349]!==di||t[350]!==pi||t[351]!==K?($i=K&&(0,Z.jsx)(fJ,{failedTargets:K.failed,isSubmitting:W!==null,onDeletePermanently:di,onRetry:pi,onCancel:()=>ne(null)}),t[348]=W,t[349]=di,t[350]=pi,t[351]=K,t[352]=$i):$i=t[352];let ea;t[353]!==Zi||t[354]!==Qi||t[355]!==$i?(ea=(0,Z.jsx)(Vs,{open:Zi,onOpenChange:Qi,children:$i}),t[353]=Zi,t[354]=Qi,t[355]=$i,t[356]=ea):ea=t[356];let ta=ie!==null,na;t[357]===Symbol.for(`react.memo_cache_sentinel`)?(na=e=>{e||q(null)},t[357]=na):na=t[357];let ra=ie?.parentDir??``,ia;t[358]!==ta||t[359]!==ra?(ia=(0,Z.jsx)(Dh,{open:ta,onOpenChange:na,kind:`file`,initialDir:ra,defaultToTemplate:!0}),t[358]=ta,t[359]=ra,t[360]=ia):ia=t[360];let oa;return t[361]!==Ki||t[362]!==Xi||t[363]!==ea||t[364]!==ia?(oa=(0,Z.jsxs)(Z.Fragment,{children:[Ki,Xi,ea,ia]}),t[361]=Ki,t[362]=Xi,t[363]=ea,t[364]=ia,t[365]=oa):oa=t[365],oa}function UY(e){return(0,Z.jsx)(`li`,{"data-testid":`delete-target-row`,children:aJ(e)},`${e.kind}:${e.path}`)}function WY(e){return`${e.kind}:${e.path}`}function GY(e){return`${e.kind}:${e.path}`}function KY(e){return e.path}function qY(e){return e.kind===`folder`}function JY(e){return e.path}function YY(e){return e.kind===`file`}function XY(e){return e.file}function ZY(e){return!ul(e.path)}function QY(e){return ke(e)}function $Y(e){return ct(e)}function eX(e){return mt(e)}function tX(e){return e.path}function nX(e){return e.kind===`asset`}function rX(e){return e.endsWith(`/`)?e.slice(0,-1):e}function iX(e){return!!e}function aX(e){console.warn(`[FileTree] /api/workspace fetch failed:`,e)}function oX(e){console.warn(`[FileTree] unmount cleanup failed:`,e)}function sX(e){_s.error(e)}function cX(){}function lX(e){return _s.error(e)}function uX(){}function dX(){}function fX(){}function pX(){}function mX(){}async function hX(){}function gX(e){return Wu(e)}function _X(e){return vX(e)?.dataset.itemPath??null}function vX(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&t.dataset.itemPath)return t;return null}function yX(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&t.matches(`[data-file-tree-virtualized-root]`))return t;return null}function bX(e){let t=vX(e);if(t){let e=t.dataset.itemPath;if(!e)return null;let n=t.dataset.itemType===`folder`,r=Ku(e,n);return{parentDir:r,row:t,root:null,busyPath:n?ed(r):e}}return xX(e)?{parentDir:``,row:null,root:yX(e),busyPath:hY}:null}function xX(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&t.matches(`[data-file-tree-virtualized-scroll]`))return!0;return!1}var SX=[`w-3/4`,`w-2/3`,`w-4/5`,`w-1/2`,`w-3/5`,`w-2/3`];function CX(){let e=(0,$.c)(5),{_:t}=At(),n;e[0]===t?n=e[1]:(n=t({id:`5Tk8Fb`}),e[0]=t,e[1]=n);let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=SX.map(wX),e[2]=r):r=e[2];let i;return e[3]===n?i=e[4]:(i=(0,Z.jsx)(`div`,{className:`flex flex-1 flex-col gap-1 px-2 py-2`,role:`status`,"aria-busy":`true`,"aria-label":n,children:r}),e[3]=n,e[4]=i),i}function wX(e,t){return(0,Z.jsxs)(`div`,{className:`flex h-6 items-center gap-2`,children:[(0,Z.jsx)(Ja,{className:`h-3 w-3 shrink-0 rounded-sm`}),(0,Z.jsx)(Ja,{className:`h-3 ${e}`})]},t)}function TX(e){let t=(0,$.c)(14),{kind:n,children:r}=e,i=n===`error`?cs:n===`reconnecting`?os:rs,a=n===`error`?`alert`:`status`,o=n===`error`?`text-destructive`:`text-muted-foreground`,s;t[0]===o?s=t[1]:(s=Y(`mx-2 mb-1 flex items-start gap-1.5 rounded-md bg-muted/50 px-2 py-1.5 text-xs leading-snug`,o),t[0]=o,t[1]=s);let c=n===`reconnecting`&&`animate-spin motion-reduce:animate-none`,l;t[2]===c?l=t[3]:(l=Y(`mt-0.5 size-3.5 shrink-0`,c),t[2]=c,t[3]=l);let u;t[4]!==i||t[5]!==l?(u=(0,Z.jsx)(i,{"aria-hidden":`true`,className:l}),t[4]=i,t[5]=l,t[6]=u):u=t[6];let d;t[7]===r?d=t[8]:(d=(0,Z.jsx)(`span`,{className:`min-w-0`,children:r}),t[7]=r,t[8]=d);let f;return t[9]!==a||t[10]!==s||t[11]!==u||t[12]!==d?(f=(0,Z.jsxs)(`span`,{role:a,className:s,children:[u,d]}),t[9]=a,t[10]=s,t[11]=u,t[12]=d,t[13]=f):f=t[13],f}function EX(e){return e?qc._({id:`wTcjov`}):null}function DX(e){let t=(0,$.c)(23),{_:n}=At(),r=Io(),i=_a();if(r)return null;let{input:a,installStates:o,dispatch:s}=e,c=a===null,l,u,d,f,p,m;if(t[0]!==n||t[1]!==s||t[2]!==a||t[3]!==c||t[4]!==o||t[5]!==i){m=Symbol.for(`react.early_return_sentinel`);bb0:{let e=EX(c),r;t[12]===o?r=t[13]:(r=e=>o[e.id]?.installed===!0,t[12]=o,t[13]=r);let h=la.filter(r),g=h.length>0,_=i!==null;if(!g&&!_){m=null;break bb0}let v=i?Sa(i.installedClis):[];u=SP,t[14]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsxs)(TP,{children:[(0,Z.jsx)(No,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`O7_W_a`})]}),t[14]=p):p=t[14],l=EP,d=_?(0,Z.jsxs)(xP,{"aria-label":n({id:`ALhMYW`}),children:[(0,Z.jsx)(OP,{children:(0,Z.jsx)(J,{id:`ALhMYW`})}),v.map(t=>{let{displayName:r}=Vr[t];return(0,Z.jsxs)(wP,{onSelect:()=>{a!==null&&i.launchInTerminal(a,t)},disabled:c,"data-testid":`empty-space-open-in-terminal-${t}`,"aria-label":n(e?{id:`AIn2Yv`,values:{displayName:r,hint:e}}:{id:`QYfQdv`,values:{displayName:r}}),children:[(0,Z.jsx)(va,{id:ga(t),"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:r}),e?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t)})]}):null,f=g?(0,Z.jsxs)(Z.Fragment,{children:[_?(0,Z.jsx)(kP,{}):null,(0,Z.jsxs)(xP,{"aria-label":n({id:`BBqGS9`}),children:[(0,Z.jsx)(OP,{children:(0,Z.jsx)(J,{id:`BBqGS9`})}),h.map(t=>{let r=!c,{displayName:i}=t,o=n(e?{id:`1ZpfyB`,values:{displayName:i,hint:e}}:{id:`WqLq6M`,values:{displayName:i}});return(0,Z.jsxs)(wP,{disabled:!r,onSelect:()=>{a&&s(t.id,a)},"data-testid":`empty-space-open-in-${t.id}`,"aria-label":o,children:[(0,Z.jsx)(va,{id:t.id,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:t.displayName}),e?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t.id)})]})]}):null}t[0]=n,t[1]=s,t[2]=a,t[3]=c,t[4]=o,t[5]=i,t[6]=l,t[7]=u,t[8]=d,t[9]=f,t[10]=p,t[11]=m}else l=t[6],u=t[7],d=t[8],f=t[9],p=t[10],m=t[11];if(m!==Symbol.for(`react.early_return_sentinel`))return m;let h;t[15]!==l||t[16]!==d||t[17]!==f?(h=(0,Z.jsxs)(l,{children:[d,f]}),t[15]=l,t[16]=d,t[17]=f,t[18]=h):h=t[18];let g;return t[19]!==u||t[20]!==p||t[21]!==h?(g=(0,Z.jsxs)(u,{children:[p,h]}),t[19]=u,t[20]=p,t[21]=h,t[22]=g):g=t[22],g}async function OX(e){try{let t=await e.project.listRecent(),n=e.config.projectPath;if(t.some(e=>e.path!==n))return null;let r=await _T();return e.config.freshlyCreated?r:r===0?0:null}catch(e){return console.warn(`[onboarding-card-visible] fresh-project probe failed; suppressing card`,e),null}}function kX(e){let t=(0,$.c)(4),n=e===void 0?pT:e,{initialized:r,dismissed:i,completed:a}=(0,Q.useSyncExternalStore)(n.subscribe,n.getSnapshot,n.getSnapshot),o=i||a,s=!r&&!o,c,l;return t[0]!==s||t[1]!==n?(c=()=>{if(!s)return;let e=window.okDesktop;if(e==null)return;let t=!1;return OX(e).then(e=>{!t&&e!==null&&n.activate(e)}),()=>{t=!0}},l=[s,n],t[0]=s,t[1]=n,t[2]=c,t[3]=l):(c=t[2],l=t[3]),(0,Q.useEffect)(c,l),r&&!o}function AX(e){let t=(0,$.c)(3),n=e===void 0?pT:e,r,i;t[0]===n?(r=t[1],i=t[2]):(r=()=>{if(n.getSnapshot().steps.file)return;let e=gl(e=>{e.includes(`files`)&&vT(n)});return vT(n),e},i=[n],t[0]=n,t[1]=r,t[2]=i),(0,Q.useEffect)(r,i)}var jX=3,MX=5200,NX=1500,PX=220;function FX(e){let t=(0,$.c)(14),{complete:n,label:r,shortcutId:i}=e,a;t[0]===n?a=t[1]:(a=(0,Z.jsx)(Hs,{checked:n,disabled:!0,"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none opacity-100 disabled:opacity-100`}),t[0]=n,t[1]=a);let o=n?`flex-1 text-muted-foreground/60`:`flex-1`,s;t[2]===n?s=t[3]:(s=n?(0,Z.jsxs)(`span`,{className:`sr-only`,children:[(0,Z.jsx)(J,{id:`Qj4RL5`}),` `]}):null,t[2]=n,t[3]=s);let c;t[4]!==r||t[5]!==o||t[6]!==s?(c=(0,Z.jsxs)(`span`,{className:o,children:[s,r]}),t[4]=r,t[5]=o,t[6]=s,t[7]=c):c=t[7];let l;t[8]===i?l=t[9]:(l=i?(0,Z.jsx)(I,{children:Il(i)}):null,t[8]=i,t[9]=l);let u;return t[10]!==a||t[11]!==c||t[12]!==l?(u=(0,Z.jsxs)(`li`,{className:`flex items-center gap-2 py-0.5 text-sm`,children:[a,c,l]}),t[10]=a,t[11]=c,t[12]=l,t[13]=u):u=t[13],u}function IX(e){let t=(0,$.c)(24),{store:n,lingerMs:r}=e,i=n===void 0?pT:n,a=r===void 0?MX:r,{_:o}=At(),{steps:s}=mT(i);AX(i);let[c,l]=(0,Q.useState)(0),[u,d]=(0,Q.useState)(!1),f=1+ +!!s.file+ +!!s.askedAi,p=f===jX,m,h;t[0]!==p||t[1]!==a?(m=()=>{if(!p)return;l(RX);let e=setInterval(()=>l(LX),NX),t=setTimeout(()=>{clearInterval(e),d(!0)},a);return()=>{clearInterval(e),clearTimeout(t)}},h=[p,a],t[0]=p,t[1]=a,t[2]=m,t[3]=h):(m=t[2],h=t[3]),(0,Q.useEffect)(m,h);let g,_;t[4]!==u||t[5]!==i?(g=()=>{if(!u)return;let e=setTimeout(()=>i.markCompleted(),PX);return()=>clearTimeout(e)},_=[u,i],t[4]=u,t[5]=i,t[6]=g,t[7]=_):(g=t[6],_=t[7]),(0,Q.useEffect)(g,_);let v;t[8]!==o||t[9]!==p?(v=p?o({id:`7jIIFX`}):``,t[8]=o,t[9]=p,t[10]=v):v=t[10];let y;t[11]===v?y=t[12]:(y=(0,Z.jsx)(`div`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:v}),t[11]=v,t[12]=y);let b;t[13]!==p||t[14]!==c||t[15]!==f||t[16]!==u||t[17]!==s.askedAi||t[18]!==s.file||t[19]!==i?(b=p?(0,Z.jsxs)(`section`,{"aria-hidden":!0,className:Y(`mx-2 mb-1 flex items-center gap-3 rounded-lg border bg-card px-4 py-3 text-card-foreground`,`motion-reduce:animate-none motion-reduce:duration-0`,u?`animate-out fade-out-0 zoom-out-95 fill-mode-forwards duration-200`:`animate-in fade-in-0 zoom-in-95 duration-300`),children:[(0,Z.jsx)(FS,{size:36,celebrateSignal:c}),(0,Z.jsx)(`span`,{className:`font-medium text-sm`,children:(0,Z.jsx)(J,{id:`7jIIFX`})})]}):(0,Z.jsxs)(`section`,{"aria-labelledby":`onboarding-card-heading`,className:`mx-2 mb-1 rounded-lg border bg-card px-4 py-3 text-card-foreground`,children:[(0,Z.jsxs)(`header`,{className:`mb-3 flex items-center justify-between`,children:[(0,Z.jsx)(`h2`,{id:`onboarding-card-heading`,className:`font-medium text-sm`,children:(0,Z.jsx)(J,{id:`Y1QMlM`})}),(0,Z.jsx)(`span`,{className:`text-muted-foreground/60 text-xs tabular-nums`,children:`${f} / ${jX}`})]}),(0,Z.jsxs)(`ul`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(FX,{complete:!0,label:(0,Z.jsx)(J,{id:`4E9jPa`})}),(0,Z.jsx)(FX,{complete:s.file,label:(0,Z.jsx)(J,{id:`6ibbCg`}),shortcutId:`new-item`}),(0,Z.jsx)(FX,{complete:s.askedAi,label:(0,Z.jsx)(J,{id:`xWEvuo`}),shortcutId:`open-ask-ai`})]}),(0,Z.jsx)(`footer`,{className:`-mb-1 mt-2 flex justify-end`,children:(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`sm`,className:`h-auto px-2 py-1 text-muted-foreground text-xs`,onClick:()=>i.dismiss(),children:(0,Z.jsx)(J,{id:`1QfxQT`})})})]}),t[13]=p,t[14]=c,t[15]=f,t[16]=u,t[17]=s.askedAi,t[18]=s.file,t[19]=i,t[20]=b):b=t[20];let x;return t[21]!==y||t[22]!==b?(x=(0,Z.jsxs)(Z.Fragment,{children:[y,b]}),t[21]=y,t[22]=b,t[23]=x):x=t[23],x}function LX(e){return e+1}function RX(e){return e+1}function zX(){let e=(0,$.c)(1);if(!kX())return null;let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(IX,{}),e[0]=t):t=e[0],t}function BX(e){return e===null?null:e.kind===`local`?e.name:e.ref}function VX(e,t){if(e.length===0)return null;let n=`origin/${e}`;return t.includes(n)?n:t.find(t=>Br(t)===e)??null}function HX(e){switch(e){case`branch-exists`:return{id:`wzq9Rv`};case`already-checked-out`:return{id:`ljHjfg`};case`path-exists`:return{id:`mYzDD_`};case`invalid-branch`:return{id:`r-OJYm`};case`no-git`:return{id:`CFnavk`};default:return{id:`-zA2E7`}}}function UX(e){let t=(0,$.c)(71),{open:n,onOpenChange:r,bridge:i,currentBranch:a,branches:o,existingWorktreeBranches:s,remoteBranches:c,behindByBranch:l,initialBranchName:u}=e,d=o===void 0?[]:o,f=c===void 0?[]:c,p=u===void 0?``:u,{_:m}=At(),h=(0,Q.useId)(),g=(0,Q.useId)(),_=(0,Q.useId)(),v=(0,Q.useId)(),y=(0,Q.useId)(),b=(0,Q.useId)(),[x,S]=(0,Q.useState)(``),C;t[0]===a?C=t[1]:(C=a===null?null:{kind:`local`,name:a},t[0]=a,t[1]=C);let[w,T]=(0,Q.useState)(C),[E,D]=(0,Q.useState)(!1),[O,k]=(0,Q.useState)(``),[A,j]=(0,Q.useState)(!1),[M,N]=(0,Q.useState)(null),P=(0,Q.useRef)(null),F=(0,Q.useRef)(null),I,L;t[2]!==a||t[3]!==p||t[4]!==n?(I=()=>{if(!n)return;S(p),T(a===null?null:{kind:`local`,name:a}),D(!1),k(``),j(!1),N(null);let e=requestAnimationFrame(()=>P.current?.focus());return()=>cancelAnimationFrame(e)},L=[n,a,p],t[2]=a,t[3]=p,t[4]=n,t[5]=I,t[6]=L):(I=t[5],L=t[6]),(0,Q.useEffect)(I,L);let R=x.trim(),z=!A&&R.length>0,B=R.length>0&&d.includes(R),V=B?null:VX(R,f),H=V!==null,U=B||H,W=B&&(s?.has(R)??!1),G=d.filter(e=>e.toLowerCase().startsWith(R.toLowerCase())),ee=!A&&G.length>0&&!U,te=(a!==null&&!d.includes(a)?[a,...d]:d).map(JX),K=f.map(qX),ne=BX(w),re=O.trim().toLowerCase(),ie=re===``?te:te.filter(e=>e.name.toLowerCase().includes(re)),ae=re===``?K:K.filter(e=>e.ref.toLowerCase().includes(re)),se=re!==``&&ie.length===0&&ae.length===0,le=async function(e){if(e.preventDefault(),z){j(!0),N(null);try{let e=H?{branch:R,createBranch:!0,remoteRef:V}:B?{branch:R,createBranch:!1}:{branch:R,createBranch:!0,baseBranch:w?.kind===`local`?w.name:void 0,baseRef:w?.kind===`remote`?w.ref:void 0},t=await i.worktree.create(e);if(!t.ok){N(HX(t.reason)),j(!1);return}mg(),r(!1),await i.project.open({path:t.path,target:`new-window`,entryPoint:`worktree`})}catch(e){console.warn(`[NewWorktreeDialog] worktree create/open failed:`,e),_s.error(m({id:`vAYoCZ`})),j(!1)}}},ue=Vs,de;t[7]!==A||t[8]!==r?(de=e=>{A||r(e)},t[7]=A,t[8]=r,t[9]=de):de=t[9];let fe=Ls,pe;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,Z.jsx)(Is,{children:(0,Z.jsx)(J,{id:`DXd9LM`})}),t[10]=pe):pe=t[10];let me;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,Z.jsxs)(Bs,{children:[pe,(0,Z.jsx)(Fs,{children:(0,Z.jsx)(J,{id:`NEzPEh`})})]}),t[11]=me):me=t[11];let he=Rs,ge;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,Z.jsx)(J,{id:`ng2Ibo`}),t[12]=ge):ge=t[12];let _e;t[13]===g?_e=t[14]:(_e=(0,Z.jsx)(Fc,{htmlFor:g,children:ge}),t[13]=g,t[14]=_e);let ve;t[15]===m?ve=t[16]:(ve=m({id:`IX_uXB`}),t[15]=m,t[16]=ve);let ye;t[17]===M?ye=t[18]:(ye=e=>{S(e.target.value),M!==null&&N(null)},t[17]=M,t[18]=ye);let be=M!==null,xe=M===null?y:`${y} ${b}`,Se;t[19]!==x||t[20]!==A||t[21]!==g||t[22]!==ve||t[23]!==ye||t[24]!==be||t[25]!==xe?(Se=(0,Z.jsx)(Gc,{id:g,ref:P,value:x,placeholder:ve,onChange:ye,disabled:A,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-invalid":be,"aria-describedby":xe,"data-testid":`new-worktree-branch`}),t[19]=x,t[20]=A,t[21]=g,t[22]=ve,t[23]=ye,t[24]=be,t[25]=xe,t[26]=Se):Se=t[26];let Ce=R.length>0?(0,Z.jsxs)(`p`,{id:y,className:`flex items-start gap-1.5 text-1sm text-muted-foreground`,"data-testid":W?`new-worktree-mode-existing-worktree`:H?`new-worktree-mode-remote-checkout`:B?`new-worktree-mode-checkout`:`new-worktree-mode-create`,children:[W?(0,Z.jsx)(Bo,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-amber-600 dark:text-amber-400`}):H?(0,Z.jsx)(oo,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-violet-600 dark:text-violet-400`}):B?(0,Z.jsx)(ea,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-blue-600 dark:text-blue-400`}):(0,Z.jsx)(rt,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-green-600 dark:text-green-400`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1`,children:W?(0,Z.jsx)(J,{id:`QAi7Q9`,values:{trimmed:R},components:{0:(0,Z.jsx)(`code`,{className:`font-mono break-words`})}}):H?(0,Z.jsx)(J,{id:`oAGN8p`,values:{remoteCheckoutRef:V,trimmed:R},components:{0:(0,Z.jsx)(`code`,{className:`font-mono break-words`}),1:(0,Z.jsx)(`code`,{className:`font-mono break-words`}),2:(0,Z.jsx)(`code`,{className:`font-mono`})}}):B?(0,Z.jsx)(J,{id:`b4VvP-`,values:{trimmed:R},components:{0:(0,Z.jsx)(`code`,{className:`font-mono break-words`}),1:(0,Z.jsx)(`code`,{className:`font-mono`})}}):ne===null?(0,Z.jsx)(J,{id:`t4sFKC`,values:{trimmed:R},components:{0:(0,Z.jsx)(`code`,{className:`font-mono break-words`}),1:(0,Z.jsx)(`code`,{className:`font-mono`})}}):(0,Z.jsx)(J,{id:`dGAdpH`,values:{trimmed:R,currentBaseLabel:ne},components:{0:(0,Z.jsx)(`code`,{className:`font-mono break-words`}),1:(0,Z.jsx)(`code`,{className:`font-mono break-words`}),2:(0,Z.jsx)(`code`,{className:`font-mono`})}})})]}):null,we=ee?(0,Z.jsx)(`div`,{className:`max-h-40 overflow-y-auto rounded-md border bg-popover p-1 shadow-xs`,"data-testid":`new-worktree-branch-list`,children:G.map(e=>(0,Z.jsxs)(X,{type:`button`,variant:`ghost`,size:`sm`,tabIndex:-1,onClick:()=>{S(e),M!==null&&N(null),P.current?.focus()},"data-testid":`new-worktree-branch-option-${e}`,className:`h-8 w-full justify-start gap-2 font-normal`,children:[(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-left`,children:e})]},e))}):null,Te=U?null:(0,Z.jsxs)(`div`,{className:`mt-1 flex flex-col gap-2`,children:[(0,Z.jsx)(Fc,{id:v,htmlFor:_,children:(0,Z.jsx)(J,{id:`ZWwYwM`})}),(0,Z.jsxs)(oe,{open:E,onOpenChange:e=>{D(e),e||k(``)},children:[(0,Z.jsx)(ce,{asChild:!0,children:(0,Z.jsxs)(X,{id:_,type:`button`,variant:`outline`,role:`combobox`,"aria-expanded":E,"aria-haspopup":`listbox`,"aria-labelledby":`${v} ${_}`,"aria-label":m({id:`ZWwYwM`}),disabled:A,"data-testid":`new-worktree-base-trigger`,className:`w-full justify-between font-normal`,children:[(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[w?.kind===`remote`?(0,Z.jsx)(oo,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}):(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`min-w-0 truncate text-left`,children:ne===null?(0,Z.jsx)(J,{id:`EbjWsS`}):ne})]}),(0,Z.jsx)(Ld,{"aria-hidden":`true`,className:`ml-2 size-4 shrink-0 opacity-50`})]})}),(0,Z.jsxs)(q,{align:`start`,className:`w-[var(--radix-popover-trigger-width)] p-1`,onWheel:KX,onTouchMove:GX,onOpenAutoFocus:e=>{e.preventDefault(),F.current?.focus()},children:[(0,Z.jsxs)(aw,{className:`mb-1 h-8`,children:[(0,Z.jsx)(uw,{ref:F,"aria-label":m({id:`fuJZKk`}),placeholder:m({id:`hQXiDc`}),value:O,onChange:e=>k(e.target.value),onKeyDown:WX,"data-testid":`new-worktree-base-search`}),(0,Z.jsx)(sw,{children:(0,Z.jsx)(Ee,{"aria-hidden":`true`})})]}),(0,Z.jsxs)(`div`,{role:`listbox`,"aria-label":m({id:`ZWwYwM`}),className:`max-h-56 overflow-y-auto`,"data-testid":`new-worktree-base-list`,children:[se?(0,Z.jsx)(`p`,{className:`px-2 py-1.5 text-1sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`Sh3Qkg`})}):null,ie.map(e=>{let t=e.name,n=l?.get(t);return(0,Z.jsxs)(X,{type:`button`,role:`option`,"aria-selected":w?.kind===`local`&&w.name===t,variant:`ghost`,size:`sm`,onClick:()=>{T(e),D(!1),k(``)},"data-testid":`new-worktree-base-option-${t}`,className:`h-8 w-full justify-start gap-2 font-normal`,children:[(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-left`,children:t}),n!==void 0&&n>0?(0,Z.jsx)(`span`,{className:`shrink-0 text-xs text-amber-600 dark:text-amber-400`,"data-testid":`new-worktree-base-behind-${t}`,children:(0,Z.jsx)(J,{id:`6-wLTJ`,values:{behind:n}})}):null]},`local:${t}`)}),ae.map(e=>{let t=e.ref;return(0,Z.jsxs)(X,{type:`button`,role:`option`,"aria-selected":w?.kind===`remote`&&w.ref===t,variant:`ghost`,size:`sm`,onClick:()=>{T(e),D(!1),k(``)},"data-testid":`new-worktree-base-option-${t}`,className:`h-8 w-full justify-start gap-2 font-normal`,children:[(0,Z.jsx)(oo,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-left`,children:t}),(0,Z.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:(0,Z.jsx)(J,{id:`dIYSqk`})})]},`remote:${t}`)})]})]})]})]}),De;t[27]!==m||t[28]!==M||t[29]!==b?(De=M===null?null:(0,Z.jsx)(`p`,{id:b,role:`alert`,className:`text-1sm text-destructive`,"data-testid":`new-worktree-error`,children:m(M)}),t[27]=m,t[28]=M,t[29]=b,t[30]=De):De=t[30];let Oe;t[31]!==h||t[32]!==le||t[33]!==_e||t[34]!==Se||t[35]!==Ce||t[36]!==we||t[37]!==Te||t[38]!==De?(Oe=(0,Z.jsxs)(`form`,{id:h,onSubmit:le,className:`flex flex-col gap-2`,children:[_e,Se,Ce,we,Te,De]}),t[31]=h,t[32]=le,t[33]=_e,t[34]=Se,t[35]=Ce,t[36]=we,t[37]=Te,t[38]=De,t[39]=Oe):Oe=t[39];let ke;t[40]!==he||t[41]!==Oe?(ke=(0,Z.jsx)(he,{children:Oe}),t[40]=he,t[41]=Oe,t[42]=ke):ke=t[42];let Ae;t[43]===r?Ae=t[44]:(Ae=()=>r(!1),t[43]=r,t[44]=Ae);let je;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(je=(0,Z.jsx)(J,{id:`dEgA5A`}),t[45]=je):je=t[45];let Me;t[46]!==A||t[47]!==Ae?(Me=(0,Z.jsx)(X,{type:`button`,variant:`outline`,onClick:Ae,disabled:A,"data-testid":`new-worktree-cancel`,children:je}),t[46]=A,t[47]=Ae,t[48]=Me):Me=t[48];let Ne=!z,Pe;t[49]!==A||t[50]!==W||t[51]!==B||t[52]!==H?(Pe=A?(0,Z.jsx)(J,{id:`b4itZn`}):W?(0,Z.jsx)(J,{id:`XV5sC0`}):H?(0,Z.jsx)(J,{id:`XAyxsa`}):B?(0,Z.jsx)(J,{id:`uGaIIS`}):(0,Z.jsx)(J,{id:`iO8V-7`}),t[49]=A,t[50]=W,t[51]=B,t[52]=H,t[53]=Pe):Pe=t[53];let Fe;t[54]!==h||t[55]!==Ne||t[56]!==Pe?(Fe=(0,Z.jsx)(X,{type:`submit`,form:h,disabled:Ne,"data-testid":`new-worktree-create`,children:Pe}),t[54]=h,t[55]=Ne,t[56]=Pe,t[57]=Fe):Fe=t[57];let Ie;t[58]!==Me||t[59]!==Fe?(Ie=(0,Z.jsxs)(zs,{children:[Me,Fe]}),t[58]=Me,t[59]=Fe,t[60]=Ie):Ie=t[60];let Le;t[61]!==fe||t[62]!==me||t[63]!==ke||t[64]!==Ie?(Le=(0,Z.jsxs)(fe,{className:`sm:max-w-md`,"data-testid":`new-worktree-dialog`,children:[me,ke,Ie]}),t[61]=fe,t[62]=me,t[63]=ke,t[64]=Ie,t[65]=Le):Le=t[65];let Re;return t[66]!==ue||t[67]!==n||t[68]!==Le||t[69]!==de?(Re=(0,Z.jsx)(ue,{open:n,onOpenChange:de,children:Le}),t[66]=ue,t[67]=n,t[68]=Le,t[69]=de,t[70]=Re):Re=t[70],Re}function WX(e){return e.stopPropagation()}function GX(e){e.stopPropagation()}function KX(e){e.stopPropagation()}function qX(e){return{kind:`remote`,ref:e}}function JX(e){return{kind:`local`,name:e}}function YX(e){let t=(0,$.c)(51),{bridge:n,recents:r,currentPath:i,query:a,worktreeModel:o,closeMenu:s,guardStaleSelect:c,flyoutPath:l,setFlyoutPath:u,openNewWorktreeWith:d}=e,{_:f}=At(),p;t[0]!==f||t[1]!==n.project||t[2]!==s?(p=function(e,t){s(),n.project.open({path:e,target:`new-window`,entryPoint:t}).catch(e=>{console.warn(`[RecentProjectsMenu] project.open failed:`,e),_s.error(f({id:`6HCOwA`}))})},t[0]=f,t[1]=n.project,t[2]=s,t[3]=p):p=t[3];let m=p,h;t[4]!==f||t[5]!==n.project||t[6]!==n.worktree?(h=async function(e){try{let t=await n.worktree.create({branch:e,createBranch:!1});if(!t.ok){_s.error(f({id:`teD0H9`}));return}mg(),await n.project.open({path:t.path,target:`new-window`,entryPoint:`worktree`})}catch(e){console.warn(`[RecentProjectsMenu] create/open branch failed:`,e),_s.error(f({id:`LwMxXg`}))}},t[4]=f,t[5]=n.project,t[6]=n.worktree,t[7]=h):h=t[7];let g=h,_;t[8]!==s||t[9]!==i||t[10]!==m?(_=function(e){if(e.path===i){s();return}m(e.path,e.isLinkedWorktree?`worktree`:`recents`)},t[8]=s,t[9]=i,t[10]=m,t[11]=_):_=t[11];let v=_,y;t[12]!==s||t[13]!==g||t[14]!==i||t[15]!==m?(y=function(e){if(e.path!==null){if(e.path===i){s();return}m(e.path,e.isMain?`recents`:`worktree`);return}e.branch!==null&&(s(),g(e.branch))},t[12]=s,t[13]=g,t[14]=i,t[15]=m,t[16]=y):y=t[16];let b=y;if(a!==``){let e;t[17]!==s||t[18]!==g?(e=e=>{s(),g(e)},t[17]=s,t[18]=g,t[19]=e):e=t[19];let n;return t[20]!==i||t[21]!==c||t[22]!==v||t[23]!==a||t[24]!==r||t[25]!==e||t[26]!==o?(n=(0,Z.jsx)(eZ,{recents:r,currentPath:i,query:a,worktreeModel:o,onPickEntry:v,onPickBranch:e,guardStaleSelect:c}),t[20]=i,t[21]=c,t[22]=v,t[23]=a,t[24]=r,t[25]=e,t[26]=o,t[27]=n):n=t[27],n}let x;if(t[28]!==s||t[29]!==i||t[30]!==l||t[31]!==c||t[32]!==b||t[33]!==d||t[34]!==m||t[35]!==r||t[36]!==u||t[37]!==o){let e=Dg(r),n;t[39]!==s||t[40]!==i||t[41]!==l||t[42]!==c||t[43]!==b||t[44]!==d||t[45]!==m||t[46]!==u||t[47]!==o?(n=e=>(0,Z.jsx)(XX,{group:e,currentPath:i,worktreeModel:o,flyoutOpen:l===e.project.path,setFlyoutOpen:t=>u(n=>t?e.project.path:n===e.project.path?null:n),onPickProject:()=>{if(e.project.path===i){s();return}m(e.project.path,`recents`)},onPickFlyoutEntry:b,guardStaleSelect:c,openNewWorktreeWith:d},e.project.path),t[39]=s,t[40]=i,t[41]=l,t[42]=c,t[43]=b,t[44]=d,t[45]=m,t[46]=u,t[47]=o,t[48]=n):n=t[48],x=e.map(n),t[28]=s,t[29]=i,t[30]=l,t[31]=c,t[32]=b,t[33]=d,t[34]=m,t[35]=r,t[36]=u,t[37]=o,t[38]=x}else x=t[38];let S;return t[49]===x?S=t[50]:(S=(0,Z.jsx)(Z.Fragment,{children:x}),t[49]=x,t[50]=S),S}function XX(e){let t=(0,$.c)(34),{group:n,currentPath:r,worktreeModel:i,flyoutOpen:a,setFlyoutOpen:o,onPickProject:s,onPickFlyoutEntry:c,guardStaleSelect:l,openNewWorktreeWith:u}=e,d=n.project.path===r,f,p;t[0]!==r||t[1]!==n||t[2]!==i?(f=wg(n,i,r),p=f.filter(ZX),t[0]=r,t[1]=n,t[2]=i,t[3]=f,t[4]=p):(f=t[3],p=t[4]);let m=p.length;if(m===0){let e;t[5]!==l||t[6]!==s?(e=e=>{l(e)||s()},t[5]=l,t[6]=s,t[7]=e):e=t[7];let r=`project-switcher-recent-${n.project.path}`,i=d?`true`:void 0,a;t[8]!==n.project.name||t[9]!==n.project.path||t[10]!==d?(a=(0,Z.jsx)(rZ,{name:n.project.name,path:n.project.path,current:d}),t[8]=n.project.name,t[9]=n.project.path,t[10]=d,t[11]=a):a=t[11];let o;return t[12]!==e||t[13]!==r||t[14]!==i||t[15]!==a?(o=(0,Z.jsx)(bc,{onSelect:e,className:`flex w-full min-w-0 flex-col items-start gap-0.5`,"data-testid":r,"data-current":i,children:a}),t[12]=e,t[13]=r,t[14]=i,t[15]=a,t[16]=o):o=t[16],o}let h;t[17]!==r||t[18]!==n.worktrees||t[19]!==d?(h=d||n.worktrees.some(e=>e.path===r),t[17]=r,t[18]=n.worktrees,t[19]=d,t[20]=h):h=t[20];let g=h,_;return t[21]!==g||t[22]!==r||t[23]!==f||t[24]!==a||t[25]!==n||t[26]!==l||t[27]!==c||t[28]!==s||t[29]!==u||t[30]!==m||t[31]!==o||t[32]!==i?(_=(0,Z.jsx)(QX,{group:n,currentPath:r,containsCurrent:g,worktreeModel:i,flyoutEntries:f,openedWorktreeCount:m,flyoutOpen:a,setFlyoutOpen:o,onPickProject:s,onPickFlyoutEntry:c,guardStaleSelect:l,openNewWorktreeWith:u}),t[21]=g,t[22]=r,t[23]=f,t[24]=a,t[25]=n,t[26]=l,t[27]=c,t[28]=s,t[29]=u,t[30]=m,t[31]=o,t[32]=i,t[33]=_):_=t[33],_}function ZX(e){return e.opened&&!e.isMain}function QX(e){let t=(0,$.c)(46),{group:n,currentPath:r,containsCurrent:i,worktreeModel:a,flyoutEntries:o,openedWorktreeCount:s,flyoutOpen:c,setFlyoutOpen:l,onPickProject:u,onPickFlyoutEntry:d,guardStaleSelect:f,openNewWorktreeWith:p}=e,{_:m}=At(),h=n.project.path===r,g;t[0]!==f||t[1]!==u?(g=e=>{f(e)||u()},t[0]=f,t[1]=u,t[2]=g):g=t[2];let _=g,v,y;t[3]===_?(v=t[4],y=t[5]):(v=e=>{e.target.closest(`[data-project-open]`)!==null&&(e.preventDefault(),_(e.nativeEvent))},y=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),_(e.nativeEvent))},t[3]=_,t[4]=v,t[5]=y);let b=`project-switcher-group-${n.project.path}`,x=c?`true`:void 0,S=i?`true`:void 0,C;t[6]===n.project.name?C=t[7]:(C=(0,Z.jsx)(`span`,{className:`truncate font-medium text-sm`,"data-project-open":``,title:n.project.name,children:n.project.name}),t[6]=n.project.name,t[7]=C);let w;t[8]===n.project.path?w=t[9]:(w=(0,Z.jsx)(`span`,{className:`truncate text-muted-foreground text-xs`,title:n.project.path,children:n.project.path}),t[8]=n.project.path,t[9]=w);let T;t[10]!==C||t[11]!==w?(T=(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[C,w]}),t[10]=C,t[11]=w,t[12]=T):T=t[12];let E;t[13]!==m||t[14]!==h?(E=h?(0,Z.jsx)(ea,{"aria-label":m({id:`Hp1l6f`}),className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground`}):null,t[13]=m,t[14]=h,t[15]=E):E=t[15];let D=`project-switcher-toggle-${n.project.path}`,O;t[16]===s?O=t[17]:(O=(0,Z.jsx)(`span`,{className:`tabular-nums`,children:s}),t[16]=s,t[17]=O);let k;t[18]===s?k=t[19]:(k=(0,Z.jsx)(J,{id:`AKxFtn`,values:{openedWorktreeCount:s}}),t[18]=s,t[19]=k);let A;t[20]!==D||t[21]!==O||t[22]!==k?(A=(0,Z.jsxs)(`span`,{className:`mt-0.5 shrink-0 text-muted-foreground text-xs`,"data-testid":D,children:[O,` `,k]}),t[20]=D,t[21]=O,t[22]=k,t[23]=A):A=t[23];let j;t[24]!==E||t[25]!==A||t[26]!==v||t[27]!==y||t[28]!==b||t[29]!==x||t[30]!==S||t[31]!==T?(j=(0,Z.jsxs)(_c,{onClick:v,onKeyDown:y,className:`flex w-full min-w-0 items-start gap-2`,"data-testid":b,"data-flyout-open":x,"data-current":S,children:[T,E,A]}),t[24]=E,t[25]=A,t[26]=v,t[27]=y,t[28]=b,t[29]=x,t[30]=S,t[31]=T,t[32]=j):j=t[32];let M;t[33]!==o||t[34]!==c||t[35]!==n||t[36]!==f||t[37]!==d||t[38]!==p||t[39]!==a?(M=(0,Z.jsx)($X,{group:n,open:c,worktreeModel:a,entries:o,onPickFlyoutEntry:d,guardStaleSelect:f,openNewWorktreeWith:p}),t[33]=o,t[34]=c,t[35]=n,t[36]=f,t[37]=d,t[38]=p,t[39]=a,t[40]=M):M=t[40];let N;return t[41]!==c||t[42]!==l||t[43]!==j||t[44]!==M?(N=(0,Z.jsxs)(ic,{open:c,onOpenChange:l,children:[j,M]}),t[41]=c,t[42]=l,t[43]=j,t[44]=M,t[45]=N):N=t[45],N}function $X(e){let t=(0,$.c)(15),{group:n,open:r,worktreeModel:i,entries:a,onPickFlyoutEntry:o,guardStaleSelect:s,openNewWorktreeWith:c}=e,{_:l}=At(),[u,d]=(0,Q.useState)(``),f=(0,Q.useRef)(null),p=(0,Q.useRef)(null),m,h;t[0]===r?(m=t[1],h=t[2]):(m=()=>{r&&f.current?.focus({preventScroll:!0})},h=[r],t[0]=r,t[1]=m,t[2]=h),(0,Q.useEffect)(m,h);let g=function(){let e=p.current;return e===null?[]:[...e.querySelectorAll(`[role="menuitem"]`)]},_=function(e){g()[e]?.focus()},v=function(e,t){if(e.key===`ArrowDown`){e.preventDefault(),e.stopPropagation();let t=g(),n=t.indexOf(e.currentTarget);_(Math.min(n+1,t.length-1))}else if(e.key===`ArrowUp`){e.preventDefault(),e.stopPropagation();let t=g().indexOf(e.currentTarget);t<=0?f.current?.focus():_(t-1)}else e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),t())},y;if(t[3]!==a||t[4]!==u){let e=u.trim().toLowerCase();y=e===``?a:a.filter(t=>(t.branch??``).toLowerCase().includes(e)),t[3]=a,t[4]=u,t[5]=y}else y=t[5];let b=y,x=i!==null&&i.mainRoot===n.project.mainRoot,S=u.trim(),C=x&&S.length>0,w;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsx)(sw,{align:`inline-start`,children:(0,Z.jsx)(Ee,{"aria-hidden":`true`})}),t[6]=w):w=t[6];let T;t[7]===l?T=t[8]:(T=l({id:`bSD4im`}),t[7]=l,t[8]=T);let E;t[9]===l?E=t[10]:(E=l({id:`Skr_7L`}),t[9]=l,t[10]=E);let D;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>d(e.target.value),t[11]=D):D=t[11];let O=b.length===0?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(jc,{className:`font-normal text-muted-foreground text-xs`,role:`status`,"aria-live":`polite`,children:l({id:`-uaQnI`})}),C?(0,Z.jsxs)(bc,{onSelect:e=>{s(e)||c(S)},onKeyDown:e=>v(e,()=>c(S)),className:`flex items-center gap-2`,"data-testid":`project-switcher-flyout-create`,children:[(0,Z.jsx)(rt,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,title:S,children:(0,Z.jsx)(J,{id:`gHSAWT`,values:{typedName:S},components:{0:(0,Z.jsx)(`span`,{className:`font-medium`}),1:(0,Z.jsx)(`span`,{className:`font-mono`})}})})]}):null]}):b.map(e=>{let t=e.path??`branch:${e.branch}`,n=e.branch??l({id:`D12vtS`});return(0,Z.jsxs)(bc,{onSelect:t=>{s(t)||o(e)},onKeyDown:t=>v(t,()=>o(e)),className:`flex items-center gap-2`,"data-testid":`project-switcher-flyout-entry-${t}`,"data-current":e.isCurrent?`true`:void 0,children:[(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,title:n,children:n}),e.isMain?(0,Z.jsx)(`span`,{className:`shrink-0 text-muted-foreground text-xs`,children:l({id:`Bn9-El`})}):e.opened?null:(0,Z.jsx)(`span`,{className:`shrink-0 text-muted-foreground text-xs`,title:l({id:`Dvwa0U`}),children:l({id:`nfoduq`})}),e.isCurrent?(0,Z.jsx)(iZ,{}):null]},t)}),k;return t[12]!==p||t[13]!==O?(k=(0,Z.jsx)(`div`,{ref:p,className:`min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain subtle-scrollbar`,children:O}),t[12]=p,t[13]=O,t[14]=k):k=t[14],(0,Z.jsx)(Nc,{children:(0,Z.jsxs)(Mc,{avoidCollisions:!1,sideOffset:-8,className:`flex max-h-80 w-96 flex-col gap-1 overflow-hidden p-1`,"data-testid":`project-switcher-flyout-${n.project.path}`,children:[(0,Z.jsxs)(aw,{className:`mb-1 h-8 shrink-0`,children:[w,(0,Z.jsx)(uw,{ref:f,"aria-label":T,placeholder:E,value:u,onChange:D,onKeyDown:e=>{e.key===`ArrowDown`&&(e.preventDefault(),_(0)),e.stopPropagation()},"data-testid":`project-switcher-flyout-search-${n.project.path}`})]}),k]})})}function eZ(e){let t=(0,$.c)(41),{recents:n,currentPath:r,query:i,worktreeModel:a,onPickEntry:o,onPickBranch:s,guardStaleSelect:c}=e,{_:l}=At(),u;t[0]===i?u=t[1]:(u=e=>e.toLowerCase().includes(i),t[0]=i,t[1]=u);let d=u,f,p,m,h;if(t[2]!==l||t[3]!==r||t[4]!==c||t[5]!==d||t[6]!==s||t[7]!==o||t[8]!==n||t[9]!==a){h=Symbol.for(`react.early_return_sentinel`);bb0:{let e;t[14]===d?e=t[15]:(e=e=>!e.isLinkedWorktree&&(d(e.name)||d(e.path)),t[14]=d,t[15]=e);let i=n.filter(e),u;t[16]===d?u=t[17]:(u=e=>e.isLinkedWorktree===!0&&(d(e.branch??``)||d(e.path)),t[16]=d,t[17]=u);let g=n.filter(u),_=new Set(g.map(tZ)),v;t[18]===a?.entries?v=t[19]:(v=a?.entries??[],t[18]=a?.entries,t[19]=v);let y=v.filter(e=>e.branch!==null&&d(e.branch)&&(e.worktreePath===null||!_.has(e.worktreePath))&&e.worktreePath!==r);if(i.length===0&&g.length===0&&y.length===0){let e;t[20]===l?e=t[21]:(e=l({id:`pEQFsW`}),t[20]=l,t[21]=e);let n;t[22]===e?n=t[23]:(n=(0,Z.jsx)(jc,{className:`font-normal text-muted-foreground text-xs`,role:`status`,"aria-live":`polite`,children:e}),t[22]=e,t[23]=n),h=n;break bb0}let b;t[24]!==r||t[25]!==c||t[26]!==o?(b=e=>(0,Z.jsx)(bc,{onSelect:t=>{c(t)||o(e)},className:`flex w-full min-w-0 flex-col items-start gap-0.5`,"data-testid":`project-switcher-recent-${e.path}`,children:(0,Z.jsx)(rZ,{name:e.name,path:e.path,current:e.path===r})},e.path),t[24]=r,t[25]=c,t[26]=o,t[27]=b):b=t[27],f=i.map(b);let x;t[28]!==r||t[29]!==c||t[30]!==o?(x=e=>(0,Z.jsxs)(bc,{onSelect:t=>{c(t)||o(e)},className:`flex items-start gap-2`,"data-testid":`project-switcher-worktree-${e.path}`,"data-current":e.path===r?`true`:void 0,children:[(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0`}),(0,Z.jsx)(nZ,{branch:e.branch??e.name,project:e.mainRoot===void 0?null:Eg(e.mainRoot)})]},e.path),t[28]=r,t[29]=c,t[30]=o,t[31]=x):x=t[31],p=g.map(x);let S;t[32]!==l||t[33]!==c||t[34]!==s||t[35]!==a?(S=e=>(0,Z.jsxs)(bc,{onSelect:t=>{c(t)||e.branch!==null&&s(e.branch)},className:`flex items-start gap-2`,"data-testid":`project-switcher-branch-${e.branch}`,children:[(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 opacity-40`}),(0,Z.jsx)(nZ,{branch:e.branch??``,project:a===null?null:Eg(a.mainRoot),hint:l({id:`nfoduq`})})]},`branch:${e.branch}`),t[32]=l,t[33]=c,t[34]=s,t[35]=a,t[36]=S):S=t[36],m=y.map(S)}t[2]=l,t[3]=r,t[4]=c,t[5]=d,t[6]=s,t[7]=o,t[8]=n,t[9]=a,t[10]=f,t[11]=p,t[12]=m,t[13]=h}else f=t[10],p=t[11],m=t[12],h=t[13];if(h!==Symbol.for(`react.early_return_sentinel`))return h;let g;return t[37]!==f||t[38]!==p||t[39]!==m?(g=(0,Z.jsxs)(Z.Fragment,{children:[f,p,m]}),t[37]=f,t[38]=p,t[39]=m,t[40]=g):g=t[40],g}function tZ(e){return e.path}function nZ(e){let t=(0,$.c)(12),{branch:n,project:r,hint:i}=e,a;t[0]===n?a=t[1]:(a=(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,children:n}),t[0]=n,t[1]=a);let o;t[2]===i?o=t[3]:(o=i===void 0?null:(0,Z.jsx)(`span`,{className:`shrink-0 text-muted-foreground text-xs`,children:i}),t[2]=i,t[3]=o);let s;t[4]!==a||t[5]!==o?(s=(0,Z.jsxs)(`span`,{className:`flex w-full min-w-0 items-center gap-1.5`,children:[a,o]}),t[4]=a,t[5]=o,t[6]=s):s=t[6];let c;t[7]===r?c=t[8]:(c=r===null?null:(0,Z.jsx)(`span`,{className:`truncate text-muted-foreground text-xs`,title:r,children:r}),t[7]=r,t[8]=c);let l;return t[9]!==s||t[10]!==c?(l=(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[s,c]}),t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function rZ(e){let t=(0,$.c)(15),{name:n,path:r,current:i}=e,a=i&&`font-medium`,o;t[0]===a?o=t[1]:(o=Y(`flex w-full items-center gap-1.5`,a),t[0]=a,t[1]=o);let s;t[2]===n?s=t[3]:(s=(0,Z.jsx)(`span`,{className:`truncate font-medium text-sm`,title:n,children:n}),t[2]=n,t[3]=s);let c;t[4]===i?c=t[5]:(c=i?(0,Z.jsx)(ea,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}):null,t[4]=i,t[5]=c);let l;t[6]!==o||t[7]!==s||t[8]!==c?(l=(0,Z.jsxs)(`span`,{className:o,children:[s,c]}),t[6]=o,t[7]=s,t[8]=c,t[9]=l):l=t[9];let u;t[10]===r?u=t[11]:(u=(0,Z.jsx)(`span`,{className:`w-full truncate text-muted-foreground text-xs`,title:r,children:r}),t[10]=r,t[11]=u);let d;return t[12]!==l||t[13]!==u?(d=(0,Z.jsxs)(`span`,{className:`flex w-full min-w-0 flex-col gap-0.5`,children:[l,u]}),t[12]=l,t[13]=u,t[14]=d):d=t[14],d}function iZ(){let e=(0,$.c)(4),{_:t}=At(),n;e[0]===t?n=e[1]:(n=t({id:`Hp1l6f`}),e[0]=t,e[1]=n);let r;return e[2]===n?r=e[3]:(r=(0,Z.jsx)(ea,{"aria-label":n,className:`size-3.5 shrink-0 text-muted-foreground`}),e[2]=n,e[3]=r),r}var aZ=(e,t,n)=>vg(e,t,n,`ProjectSwitcher`),oZ=350;function sZ(e){let t=(0,$.c)(108),{bridge:n}=e,{_:r}=At(),[i,a]=(0,Q.useState)(null),[o,s]=(0,Q.useState)(!1),[c,l]=(0,Q.useState)(``),[u,d]=(0,Q.useState)(!1),[f,p]=(0,Q.useState)(!1),[m,h]=(0,Q.useState)(``),[g,_]=(0,Q.useState)(null),v=DM(),y=hg(),b=typeof window<`u`&&window.okDesktop!=null,x=(0,Q.useRef)(!1),S=(0,Q.useRef)(!1),C=(0,Q.useRef)(null),w;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(w=e=>{e&&(S.current=!0,C.current!==null&&clearTimeout(C.current),C.current=setTimeout(()=>{S.current=!1},oZ)),s(e),e||(l(``),_(null))},t[0]=w):w=t[0];let T=w,E;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(E=e=>!b||!S.current?!1:(e.preventDefault(),!0),t[1]=E):E=t[1];let D=E,O;t[2]!==r||t[3]!==n.project||t[4]!==o?(O=()=>{if(!o)return;let e=!1;return aZ(async()=>{let t=await n.project.listRecent();e||a(t)},r({id:`fYKgzG`})),()=>{e=!0}},t[2]=r,t[3]=n.project,t[4]=o,t[5]=O):O=t[5];let k;t[6]!==r||t[7]!==n||t[8]!==o?(k=[o,n,r],t[6]=r,t[7]=n,t[8]=o,t[9]=k):k=t[9],(0,Q.useEffect)(O,k);let A,j;t[10]===n?(A=t[11],j=t[12]):(A=()=>n.onMenuAction(e=>{e===`new-worktree`?(s(!1),_(null),h(``),p(!0)):e===`switch-worktree`&&s(!0)}),j=[n],t[10]=n,t[11]=A,t[12]=j),(0,Q.useEffect)(A,j);let M;t[13]!==r||t[14]!==n.dialog||t[15]!==n.project?(M=()=>{T(!1),aZ(async()=>{let e=await n.dialog.openFolder();e&&await n.project.open({path:e,target:`new-window`,entryPoint:`pick-existing`})},r({id:`gmJ0An`}))},t[13]=r,t[14]=n.dialog,t[15]=n.project,t[16]=M):M=t[16];let N=M,P;t[17]!==r||t[18]!==n.navigator?(P=()=>{T(!1),aZ(()=>n.navigator.open(),r({id:`jol95m`}))},t[17]=r,t[18]=n.navigator,t[19]=P):P=t[19];let F=P,I;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>{T(!1),d(!0)},t[20]=I):I=t[20];let L=I,R;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>{T(!1),h(e),p(!0)},t[21]=R):R=t[21];let z=R,B=n.config.projectPath,V;t[22]===c?V=t[23]:(V=c.trim().toLowerCase(),t[22]=c,t[23]=V);let H=V,U=H!==``,W;t[24]===i?W=t[25]:(W=i??[],t[24]=i,t[25]=W);let G=W,ee;t[26]!==U||t[27]!==G?(ee=U?G.filter(hZ):G,t[26]=U,t[27]=G,t[28]=ee):ee=t[28];let te=ee,K=U?null:y,ne=v!==null&&`h-auto py-1.5`,re;t[29]===ne?re=t[30]:(re=Y(`justify-between text-sidebar-foreground/70 hover:text-sidebar-foreground! data-open:hover:text-sidebar-foreground!`,ne),t[29]=ne,t[30]=re);let ie;t[31]===r?ie=t[32]:(ie=r({id:`zZ_I5K`}),t[31]=r,t[32]=ie);let q;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(q=b?()=>{x.current=!0}:void 0,t[33]=q):q=t[33];let ae;t[34]===o?ae=t[35]:(ae=b?()=>{if(x.current){x.current=!1;return}T(!o)}:void 0,t[34]=o,t[35]=ae);let oe;t[36]===n.config.projectName?oe=t[37]:(oe=(0,Z.jsx)(`span`,{className:`truncate`,children:n.config.projectName}),t[36]=n.config.projectName,t[37]=oe);let se;t[38]===v?se=t[39]:(se=v===null?null:(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 text-xs text-sidebar-foreground/50 group-hover/menu-button:text-sidebar-foreground`,"data-testid":`project-switcher-branch`,children:[(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`size-3! shrink-0`}),(0,Z.jsx)(`span`,{className:`truncate`,children:v})]}),t[38]=v,t[39]=se);let ce;t[40]!==oe||t[41]!==se?(ce=(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[oe,se]}),t[40]=oe,t[41]=se,t[42]=ce):ce=t[42];let le;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,Z.jsx)(Ld,{"aria-hidden":`true`,className:`opacity-60`}),t[43]=le):le=t[43];let ue;t[44]!==n.config.projectPath||t[45]!==re||t[46]!==ie||t[47]!==ae||t[48]!==ce?(ue=(0,Z.jsx)(oc,{asChild:!0,children:(0,Z.jsxs)(_M,{className:re,"data-testid":`project-switcher-trigger`,"aria-label":ie,title:n.config.projectPath,onPointerDown:q,onClick:ae,children:[ce,le]})}),t[44]=n.config.projectPath,t[45]=re,t[46]=ie,t[47]=ae,t[48]=ce,t[49]=ue):ue=t[49];let de;t[50]!==r||t[51]!==n||t[52]!==B||t[53]!==g||t[54]!==te||t[55]!==K||t[56]!==H||t[57]!==i||t[58]!==c?(de=i===null?null:i.length===0?(0,Z.jsx)(jc,{className:`font-normal text-muted-foreground text-xs`,children:(0,Z.jsx)(J,{id:`MUrVEo`})}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(aw,{className:`mb-1 h-8 border-0 shadow-none has-[[data-slot=input-group-control]:focus-visible]:ring-0`,children:[(0,Z.jsx)(uw,{"aria-label":r({id:`blFttG`}),placeholder:r({id:`RVZJWQ`}),value:c,onChange:e=>{e.target.value!==``&&_(null),l(e.target.value)},onKeyDown:mZ,"data-testid":`project-switcher-search`}),(0,Z.jsx)(sw,{children:(0,Z.jsx)(Ee,{"aria-hidden":`true`})})]}),(0,Z.jsx)(gc,{}),(0,Z.jsx)(`div`,{className:`max-h-64 overflow-x-hidden overflow-y-auto overscroll-contain subtle-scrollbar scroll-fade-mask`,"data-testid":`project-switcher-scroll`,onScroll:()=>{g!==null&&_(null)},children:(0,Z.jsx)(YX,{bridge:n,recents:te,currentPath:B,query:H,worktreeModel:K,closeMenu:()=>T(!1),guardStaleSelect:D,flyoutPath:g,setFlyoutPath:_,openNewWorktreeWith:z})})]}),t[50]=r,t[51]=n,t[52]=B,t[53]=g,t[54]=te,t[55]=K,t[56]=H,t[57]=i,t[58]=c,t[59]=de):de=t[59];let fe;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(fe=(0,Z.jsx)(gc,{}),t[60]=fe):fe=t[60];let pe;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(pe=e=>{D(e)||L()},t[61]=pe):pe=t[61];let me;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,Z.jsxs)(bc,{onSelect:pe,"data-testid":`project-switcher-new-project`,children:[(0,Z.jsx)(rt,{"aria-hidden":`true`,className:`text-muted-foreground`}),(0,Z.jsx)(J,{id:`gKi-a_`})]}),t[62]=me):me=t[62];let he;t[63]===F?he=t[64]:(he=e=>{D(e)||F()},t[63]=F,t[64]=he);let ge,_e;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,Z.jsx)(be,{"aria-hidden":`true`,className:`text-muted-foreground`}),_e=(0,Z.jsx)(J,{id:`xaDWAI`}),t[65]=ge,t[66]=_e):(ge=t[65],_e=t[66]);let ve;t[67]===he?ve=t[68]:(ve=(0,Z.jsxs)(bc,{onSelect:he,"data-testid":`project-switcher-switch-project`,children:[ge,_e]}),t[67]=he,t[68]=ve);let ye;t[69]===N?ye=t[70]:(ye=e=>{D(e)||N()},t[69]=N,t[70]=ye);let xe,Se;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,Z.jsx)(Bo,{"aria-hidden":`true`,className:`text-muted-foreground`}),Se=(0,Z.jsx)(J,{id:`PVUn_c`}),t[71]=xe,t[72]=Se):(xe=t[71],Se=t[72]);let Ce;t[73]===ye?Ce=t[74]:(Ce=(0,Z.jsxs)(bc,{onSelect:ye,"data-testid":`project-switcher-open-folder`,children:[xe,Se]}),t[73]=ye,t[74]=Ce);let we;t[75]===v?we=t[76]:(we=v===null?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(gc,{}),(0,Z.jsxs)(bc,{onSelect:e=>{D(e)||(T(!1),h(``),p(!0))},"data-testid":`project-switcher-new-worktree`,children:[(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`text-muted-foreground`}),(0,Z.jsx)(J,{id:`DXd9LM`})]})]}),t[75]=v,t[76]=we);let Te;t[77]!==de||t[78]!==ve||t[79]!==Ce||t[80]!==we?(Te=(0,Z.jsxs)(Sc,{align:`start`,side:`top`,className:`min-w-[260px]`,"data-testid":`project-switcher-menu`,children:[de,fe,me,ve,Ce,we]}),t[77]=de,t[78]=ve,t[79]=Ce,t[80]=we,t[81]=Te):Te=t[81];let De;t[82]!==o||t[83]!==ue||t[84]!==Te?(De=(0,Z.jsxs)(Oc,{open:o,onOpenChange:T,modal:!1,children:[ue,Te]}),t[82]=o,t[83]=ue,t[84]=Te,t[85]=De):De=t[85];let Oe;t[86]!==n||t[87]!==u?(Oe=(0,Z.jsx)(Cm,{open:u,onOpenChange:d,bridge:n}),t[86]=n,t[87]=u,t[88]=Oe):Oe=t[88];let ke;t[89]===y?.entries?ke=t[90]:(ke=y?.entries.map(pZ).filter(fZ),t[89]=y?.entries,t[90]=ke);let Ae;t[91]===y?.entries?Ae=t[92]:(Ae=new Set(y?.entries.filter(dZ).map(uZ)),t[91]=y?.entries,t[92]=Ae);let je=y?.remoteBranches,Me;t[93]===y?.entries?Me=t[94]:(Me=new Map(y?.entries.filter(lZ).map(cZ)),t[93]=y?.entries,t[94]=Me);let Ne;t[95]!==v||t[96]!==n||t[97]!==m||t[98]!==f||t[99]!==ke||t[100]!==Ae||t[101]!==je||t[102]!==Me?(Ne=(0,Z.jsx)(UX,{open:f,onOpenChange:p,bridge:n,currentBranch:v,initialBranchName:m,branches:ke,existingWorktreeBranches:Ae,remoteBranches:je,behindByBranch:Me}),t[95]=v,t[96]=n,t[97]=m,t[98]=f,t[99]=ke,t[100]=Ae,t[101]=je,t[102]=Me,t[103]=Ne):Ne=t[103];let Pe;return t[104]!==De||t[105]!==Oe||t[106]!==Ne?(Pe=(0,Z.jsxs)(Z.Fragment,{children:[De,Oe,Ne]}),t[104]=De,t[105]=Oe,t[106]=Ne,t[107]=Pe):Pe=t[107],Pe}function cZ(e){return[e.branch,e.behind]}function lZ(e){return e.branch!==null&&e.behind!==void 0}function uZ(e){return e.branch}function dZ(e){return e.branch!==null&&e.worktreePath!==null}function fZ(e){return e!==null}function pZ(e){return e.branch}function mZ(e){return e.stopPropagation()}function hZ(e){return!e.isLinkedWorktree}function gZ(e,t){let n=e instanceof Error?e:Error(String(e));console.warn(JSON.stringify({event:`jsx-render-failure`,component:`sidebarSearchPill`,rawComponentName:`sidebarSearchPill`,error:String(n),stack:t.componentStack})),Cn(`sidebarSearchPill`)}function _Z(e){let t=(0,$.c)(8),{onClick:n,className:r}=e,i;t[0]===r?i=t[1]:(i=Y(`rounded-lg h-9 w-full justify-start gap-2 px-3 font-normal text-muted-foreground`,r),t[0]=r,t[1]=i);let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(Ee,{"aria-hidden":`true`}),t[2]=a):a=t[2];let o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(`span`,{className:`flex-1 text-left text-sm`,children:(0,Z.jsx)(J,{id:`A1taO8`})}),t[3]=o):o=t[3];let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(I,{className:`text-foreground/70`,children:Il(`command-palette`)}),t[4]=s):s=t[4];let c;return t[5]!==n||t[6]!==i?(c=(0,Z.jsxs)(X,{variant:`outline`,onClick:n,"data-telemetry-event":`ok.sidebar.search_pill.click`,className:i,children:[a,o,s]}),t[5]=n,t[6]=i,t[7]=c):c=t[7],c}function vZ(){let e=(0,$.c)(31),{_:t}=At(),n=xa(),{activeDocName:r}=Xe(),[i,a]=(0,Q.useState)(!1),o=Ea(),s;e[0]!==n.data||e[1]!==n.status?(s=n.status===`ready`?n.data:[],e[0]=n.data,e[1]=n.status,e[2]=s):s=e[2];let c=s,l;e[3]===c?l=e[4]:(l=Fo(c),e[3]=c,e[4]=l);let u=l,d=Lo(),f;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(f={},e[5]=f):f=e[5];let[p,m]=(0,Q.useState)(f),h;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(dM,{asChild:!0,children:(0,Z.jsxs)(Ns,{className:`flex w-full items-center gap-1.5`,children:[(0,Z.jsx)(rf,{className:`size-3.5 shrink-0`}),(0,Z.jsx)(J,{id:`PCSkw2`}),(0,Z.jsx)(ra,{className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-data-[state=open]/skills:rotate-90`})]})}),e[6]=h):h=e[6];let g;e[7]===t?g=e[8]:(g=t({id:`MdpSC1`}),e[7]=t,e[8]=g);let _,v;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(_=()=>a(!0),v=(0,Z.jsx)(rt,{}),e[9]=_,e[10]=v):(_=e[9],v=e[10]);let y;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(J,{id:`MdpSC1`})}),e[11]=y):y=e[11];let b;e[12]===g?b=e[13]:(b=(0,Z.jsxs)(fM,{title:g,onClick:_,children:[v,y]}),e[12]=g,e[13]=b);let x;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Z.jsx)(TZ,{}),e[14]=x):x=e[14];let S;e[15]!==o||e[16]!==r||e[17]!==u||e[18]!==p||e[19]!==d||e[20]!==c?(S=c.length===0?(0,Z.jsx)(`p`,{className:`px-2 py-1 text-xs text-muted-foreground`,children:(0,Z.jsx)(J,{id:`PdJZ5p`})}):Mo.filter(e=>c.some(t=>t.scope===e)).map(e=>(0,Z.jsxs)(Ps,{className:`group/scope`,open:c.some(t=>t.scope===e&&Ln(t.scope,t.name)===r)||(p[e]??!1),onOpenChange:t=>m(n=>({...n,[e]:t})),children:[(0,Z.jsxs)(Ns,{className:`flex w-full items-center gap-1 px-2 pt-1 pb-0.5 text-[11px] text-muted-foreground/70 hover:text-muted-foreground`,children:[(0,Z.jsx)(ra,{className:`size-3 shrink-0 transition-transform group-data-[state=open]/scope:rotate-90`}),(0,Z.jsx)(`span`,{className:`truncate`,children:d[e]})]}),(0,Z.jsx)(Ms,{children:(0,Z.jsx)(mM,{className:`pl-2`,children:c.filter(t=>t.scope===e).map(e=>(0,Z.jsx)(bZ,{skill:e,activeDocName:r,actions:o,existingNames:u[e.scope]},`${e.scope}::${e.name}`))})})]},e)),e[15]=o,e[16]=r,e[17]=u,e[18]=p,e[19]=d,e[20]=c,e[21]=S):S=e[21];let C;e[22]===S?C=e[23]:(C=(0,Z.jsx)(Ms,{children:(0,Z.jsxs)(pM,{children:[x,S]})}),e[22]=S,e[23]=C);let w;e[24]===i?w=e[25]:(w=(0,Z.jsx)(uo,{defaultScope:`project`,open:i,onOpenChange:a,onCreated:yZ}),e[24]=i,e[25]=w);let T;return e[26]!==o.dialogs||e[27]!==C||e[28]!==w||e[29]!==b?(T=(0,Z.jsx)(Ps,{className:`group/skills shrink-0`,children:(0,Z.jsxs)(uM,{className:`px-0`,children:[h,b,C,o.dialogs,w]})}),e[26]=o.dialogs,e[27]=C,e[28]=w,e[29]=b,e[30]=T):T=e[30],T}function yZ(e){let{scope:t,name:n}=e;return $o(Ln(t,n))}function bZ(e){let t=(0,$.c)(50),{skill:n,activeDocName:r,actions:i,existingNames:a}=e,{_:o}=At(),[s,c]=(0,Q.useState)(!1),[l,u]=(0,Q.useState)(!1),d;t[0]!==n.name||t[1]!==n.scope?(d=Ln(n.scope,n.name),t[0]=n.name,t[1]=n.scope,t[2]=d):d=t[2];let f=r===d,p,m,h;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>{e.preventDefault(),u(!0)},m=(0,Z.jsx)(ra,{className:`size-3 shrink-0 text-muted-foreground transition-transform group-data-[state=open]/skill:rotate-90`}),h=(0,Z.jsx)(rf,{className:`size-3 shrink-0 text-muted-foreground`}),t[3]=p,t[4]=m,t[5]=h):(p=t[3],m=t[4],h=t[5]);let g=n.name,_;t[6]===n.name?_=t[7]:(_=ko(n.name),t[6]=n.name,t[7]=_);let v;t[8]!==n.name||t[9]!==_?(v=(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:g,children:_}),t[8]=n.name,t[9]=_,t[10]=v):v=t[10];let y;t[11]!==o||t[12]!==n.bundledVersion||t[13]!==n.updateAvailable?(y=n.updateAvailable?(0,Z.jsx)(`span`,{title:o({id:`1YJ4Yg`,values:{0:n.bundledVersion?` (${n.bundledVersion})`:``}}),className:`flex items-center`,children:(0,Z.jsx)(os,{className:`size-3 text-primary`,"aria-label":o({id:`CifUuG`})})}):null,t[11]=o,t[12]=n.bundledVersion,t[13]=n.updateAvailable,t[14]=y):y=t[14];let b;t[15]===n.installed?b=t[16]:(b=(0,Z.jsx)(io,{installed:n.installed,subtle:!0,className:`shrink-0`}),t[15]=n.installed,t[16]=b);let x;t[17]!==y||t[18]!==b?(x=(0,Z.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1`,children:[y,b]}),t[17]=y,t[18]=b,t[19]=x):x=t[19];let S;t[20]!==f||t[21]!==x||t[22]!==v?(S=(0,Z.jsx)(Ns,{asChild:!0,children:(0,Z.jsxs)(_M,{size:`sm`,isActive:f,className:`h-6 text-[11px]`,onContextMenu:p,children:[m,h,v,x]})}),t[20]=f,t[21]=x,t[22]=v,t[23]=S):S=t[23];let C;t[24]!==o||t[25]!==n.name?(C=o({id:`RlLl3G`,values:{0:n.name}}),t[24]=o,t[25]=n.name,t[26]=C):C=t[26];let w;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsx)(Gd,{}),t[27]=w):w=t[27];let T;t[28]===C?T=t[29]:(T=(0,Z.jsx)(oc,{asChild:!0,children:(0,Z.jsx)(vM,{showOnHover:!0,"aria-label":C,children:w})}),t[28]=C,t[29]=T);let E;t[30]!==i||t[31]!==a||t[32]!==n?(E=(0,Z.jsx)(Sc,{side:`right`,align:`start`,className:`min-w-52`,children:(0,Z.jsx)(wa,{skill:n,actions:i,existingNames:a})}),t[30]=i,t[31]=a,t[32]=n,t[33]=E):E=t[33];let D;t[34]!==l||t[35]!==T||t[36]!==E?(D=(0,Z.jsxs)(Oc,{open:l,onOpenChange:u,children:[T,E]}),t[34]=l,t[35]=T,t[36]=E,t[37]=D):D=t[37];let O;t[38]!==s||t[39]!==n?(O=s?(0,Z.jsx)(CZ,{skill:n}):null,t[38]=s,t[39]=n,t[40]=O):O=t[40];let k;t[41]===O?k=t[42]:(k=(0,Z.jsx)(Ms,{children:O}),t[41]=O,t[42]=k);let A;t[43]!==S||t[44]!==D||t[45]!==k?(A=(0,Z.jsxs)(hM,{children:[S,D,k]}),t[43]=S,t[44]=D,t[45]=k,t[46]=A):A=t[46];let j;return t[47]!==s||t[48]!==A?(j=(0,Z.jsx)(Ps,{open:s,onOpenChange:c,className:`group/skill`,children:A}),t[47]=s,t[48]=A,t[49]=j):j=t[49],j}function xZ(e){let t=[];for(let n of e){let e=n.path.split(`/`),r=t;e.forEach((t,i)=>{let a=i===e.length-1,o=r.find(e=>e.name===t);o||(o=a?{name:t,path:n.path,text:n.text}:{name:t,path:e.slice(0,i+1).join(`/`),children:[]},r.push(o)),!a&&o.children&&(r=o.children)})}return SZ(t),t}function SZ(e){e.sort((e,t)=>{let n=+!e.children,r=+!t.children;return n===r?e.name.localeCompare(t.name):n-r});for(let t of e)t.children&&SZ(t.children)}function CZ(e){let t=(0,$.c)(27),{skill:n}=e,{_:r}=At(),[i,a]=(0,Q.useState)(null),[o,s]=(0,Q.useState)(!1),{openTarget:c}=Xe(),l;t[0]===c?l=t[1]:(l=function(e){c({kind:`doc`,target:e,docName:e},{tabBehavior:`append`}),Tl(Ml(e))},t[0]=c,t[1]=l);let u=l,d;t[2]!==u||t[3]!==c||t[4]!==n.name||t[5]!==n.scope?(d=function(e){let t=e.lastIndexOf(`.`),r=t>=0?e.slice(t+1).toLowerCase():``;if(n.scope===`project`&&(r===`md`||r===`mdx`)){u(qe(n.name,e.replace(/\.mdx?$/i,``)));return}c({kind:`skill-file`,target:`${n.scope}/${n.name}/${e}`,scope:n.scope,name:n.name,path:e},{tabBehavior:`replace-active`}),Tl(Ol({scope:n.scope,name:n.name,path:e}))},t[2]=u,t[3]=c,t[4]=n.name,t[5]=n.scope,t[6]=d):d=t[6];let f=d,p,m;t[7]!==n.name||t[8]!==n.scope?(p=()=>{let e=!0,t=()=>{kc(n.scope,n.name).then(t=>{e&&(t.ok?(a(t.files),s(!1)):(a([]),s(!0)))})};t();let r=vl(t);return()=>{e=!1,r()}},m=[n.scope,n.name],t[7]=n.name,t[8]=n.scope,t[9]=p,t[10]=m):(p=t[9],m=t[10]),(0,Q.useEffect)(p,m);let h;if(t[11]!==r||t[12]!==i||t[13]!==o||t[14]!==f||t[15]!==u||t[16]!==n.name||t[17]!==n.scope){let e=i?xZ(i):[],a;t[19]!==u||t[20]!==n.name||t[21]!==n.scope?(a=()=>n.scope===`project`?u(Sr(n.name)):$o(Ln(n.scope,n.name)),t[19]=u,t[20]=n.name,t[21]=n.scope,t[22]=a):a=t[22];let s,c;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(Ci,{className:`size-3 shrink-0 text-muted-foreground`}),c=(0,Z.jsx)(`span`,{className:`truncate`,children:`SKILL.md`}),t[23]=s,t[24]=c):(s=t[23],c=t[24]);let l;t[25]===a?l=t[26]:(l=(0,Z.jsx)(bM,{children:(0,Z.jsxs)(xM,{size:`sm`,onClick:a,className:`text-[11px]`,children:[s,c]})}),t[25]=a,t[26]=l),h=(0,Z.jsxs)(yM,{className:`mr-0 pr-0`,children:[l,i===null?(0,Z.jsx)(bM,{children:(0,Z.jsx)(`span`,{className:`px-2 py-0.5 text-[11px] text-muted-foreground/70`,children:(0,Z.jsx)(J,{id:`yQE2r9`})})}):o?(0,Z.jsx)(bM,{children:(0,Z.jsx)(`span`,{className:`px-2 py-0.5 text-[11px] text-muted-foreground/70`,title:r({id:`3Ijjy1`}),children:(0,Z.jsx)(J,{id:`ZARuZJ`})})}):e.map(e=>(0,Z.jsx)(wZ,{node:e,depth:0,onOpenFile:f},e.path))]}),t[11]=r,t[12]=i,t[13]=o,t[14]=f,t[15]=u,t[16]=n.name,t[17]=n.scope,t[18]=h}else h=t[18];return h}function wZ(e){let t=(0,$.c)(34),{node:n,depth:r,onOpenFile:i}=e,[a,o]=(0,Q.useState)(!1),s=`${r*.6}rem`,c;t[0]===s?c=t[1]:(c={paddingLeft:s},t[0]=s,t[1]=c);let l=c;if(n.children){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(ra,{className:`size-3 shrink-0 text-muted-foreground transition-transform group-data-[state=open]/dir:rotate-90`}),t[2]=e):e=t[2];let s;t[3]===n.name?s=t[4]:(s=(0,Z.jsxs)(`span`,{className:`truncate`,children:[n.name,`/`]}),t[3]=n.name,t[4]=s);let c;t[5]!==l||t[6]!==s?(c=(0,Z.jsx)(Ns,{asChild:!0,children:(0,Z.jsxs)(xM,{size:`sm`,className:`text-[11px]`,style:l,children:[e,s]})}),t[5]=l,t[6]=s,t[7]=c):c=t[7];let u;if(t[8]!==r||t[9]!==n.children||t[10]!==i){let e;t[12]!==r||t[13]!==i?(e=e=>(0,Z.jsx)(wZ,{node:e,depth:r+1,onOpenFile:i},e.path),t[12]=r,t[13]=i,t[14]=e):e=t[14],u=n.children.map(e),t[8]=r,t[9]=n.children,t[10]=i,t[11]=u}else u=t[11];let d;t[15]===u?d=t[16]:(d=(0,Z.jsx)(Ms,{children:u}),t[15]=u,t[16]=d);let f;t[17]!==c||t[18]!==d?(f=(0,Z.jsxs)(bM,{children:[c,d]}),t[17]=c,t[18]=d,t[19]=f):f=t[19];let p;return t[20]!==a||t[21]!==f?(p=(0,Z.jsx)(Ps,{open:a,onOpenChange:o,className:`group/dir`,children:f}),t[20]=a,t[21]=f,t[22]=p):p=t[22],p}let u=`skill-file-${n.path}`,d;t[23]!==n.path||t[24]!==i?(d=()=>i(n.path),t[23]=n.path,t[24]=i,t[25]=d):d=t[25];let f;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(Jd,{className:`size-3 shrink-0 text-muted-foreground`}),t[26]=f):f=t[26];let p;t[27]===n.name?p=t[28]:(p=(0,Z.jsx)(`span`,{className:`truncate`,children:n.name}),t[27]=n.name,t[28]=p);let m;return t[29]!==l||t[30]!==u||t[31]!==d||t[32]!==p?(m=(0,Z.jsx)(bM,{children:(0,Z.jsxs)(xM,{size:`sm`,className:`text-[11px]`,style:l,"data-testid":u,onClick:d,children:[f,p]})}),t[29]=l,t[30]=u,t[31]=d,t[32]=p,t[33]=m):m=t[33],m}function TZ(){let e=(0,$.c)(19),[t,n]=(0,Q.useState)(null),[r,i]=(0,Q.useState)(!1),a,o;if(e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>{let e=!1;return Cc().then(t=>{e||n(t)}),()=>{e=!0}},o=[],e[0]=a,e[1]=o):(a=e[0],o=e[1]),(0,Q.useEffect)(a,o),!t||t.managed!==null||t.importable===0)return null;let s;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=async e=>{if(i(!0),!await Ac(e)){i(!1);return}n({managed:e,importable:0})},e[2]=s):s=e[2];let c=s,l;e[3]===t.importable?l=e[4]:(l=(0,Z.jsx)(`p`,{className:`mb-2 text-muted-foreground`,children:(0,Z.jsx)(J,{id:`mu1O0q`,values:{0:t.importable}})}),e[3]=t.importable,e[4]=l);let u,d;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>c(!0),d=(0,Z.jsx)(J,{id:`l3s5ri`}),e[5]=u,e[6]=d):(u=e[5],d=e[6]);let f;e[7]===r?f=e[8]:(f=(0,Z.jsx)(X,{size:`sm`,className:`h-6 px-2 text-xs`,disabled:r,onClick:u,children:d}),e[7]=r,e[8]=f);let p,m;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>c(!1),m=(0,Z.jsx)(J,{id:`PBxg_E`}),e[9]=p,e[10]=m):(p=e[9],m=e[10]);let h;e[11]===r?h=e[12]:(h=(0,Z.jsx)(X,{size:`sm`,variant:`ghost`,className:`h-6 px-2 text-xs`,disabled:r,onClick:p,children:m}),e[11]=r,e[12]=h);let g;e[13]!==f||e[14]!==h?(g=(0,Z.jsxs)(`div`,{className:`flex gap-1.5`,children:[f,h]}),e[13]=f,e[14]=h,e[15]=g):g=e[15];let _;return e[16]!==g||e[17]!==l?(_=(0,Z.jsxs)(`div`,{className:`mx-2 mb-1 rounded-md border border-border/60 bg-muted/40 p-2 text-xs`,children:[l,g]}),e[16]=g,e[17]=l,e[18]=_):_=e[18],_}var EZ=`Relaunch`,DZ=`Release notes`,OZ=`Updates paused`,kZ=`Download`,AZ=`Reset to defaults`,jZ=`Relaunching to install the update…`,MZ=`Relaunch failed — please restart manually`;function NZ(e){return`Update to ${e} didn't install.`}var PZ=`Retry`,FZ=`Download manually`,IZ=`Recovery action failed — please try again`;function LZ(e,t){let n=t instanceof Error&&t.message?t.message:``;return n?`${e}: ${n}`:e}function RZ(e){return`Version ${e} ready to install`}function zZ(e){return`Updated to Version ${e}`}function BZ(e){return`Your settings and recent projects were saved by a newer build than this one (v${e}). Reset to defaults to continue.`}var VZ=0,HZ=0,UZ=1,WZ=2,GZ=3,KZ=6e4;function qZ(e,t,n=()=>{},r=KZ,i={isEligible:()=>!1,onShown:()=>{}}){let a=[],o=new Set,s=`update-downloaded`;return a.push(e.onUpdateDownloaded(({version:r})=>{let i=s,a=()=>{t({id:i,body:RZ(r),priority:WZ,action:{label:EZ,onClick:()=>{t({id:i,body:jZ,priority:WZ,dismissible:!1}),e.update.relaunchNow().then(()=>{n(i)},e=>{a(),t({id:`relaunch-error-${r}`,body:LZ(MZ,e),variant:`error`,priority:UZ})})}}})};a()})),a.push(e.onUpdateRelaunching(()=>{t({id:s,body:jZ,priority:WZ,dismissible:!1})})),a.push(e.onUpdateRelaunchFailed(({version:r,message:i,downloadUrl:a})=>{if(a){let i=`install-failed-${r}`,o=()=>{t({id:i,body:NZ(r),variant:`error`,priority:UZ,action:{label:PZ,onClick:()=>{e.update.relaunchNow().then(()=>{n(i)},e=>{console.warn(`[update-notice] install-failed retry rejected`,e),o()})}},secondaryAction:{label:FZ,onClick:()=>{e.shell.openExternal(a)}}})};o();return}t({id:`relaunch-error-${r}`,body:i?`${MZ}: ${i}`:MZ,variant:`error`,priority:UZ})})),a.push(e.onWhatsNew(({version:a,releaseUrl:s})=>{if(i.isEligible(a)){i.onShown(a),t({id:`whats-new-combined-${a}`,body:zZ(a),variant:`success`,priority:GZ,combinedSubscribe:!0,whatsNew:{version:a,releaseUrl:s},action:{label:DZ,onClick:()=>{e.shell.openExternal(s)}}}),e.update.dismissWhatsNew(a);return}let c=`whats-new-${a}`;t({id:c,body:zZ(a),variant:`success`,priority:GZ,action:{label:DZ,onClick:()=>{e.shell.openExternal(s)}},onDismiss:()=>{e.update.dismissWhatsNew(a)}});let l=setTimeout(()=>{o.delete(l),n(c),e.update.dismissWhatsNew(a)},r);o.add(l)})),a.push(e.onWhatsNewDismissed(({version:e})=>{n(`whats-new-${e}`)})),a.push(e.onUpdateStuckHint(({downloadUrl:n})=>{t({id:`update-stuck-hint`,body:OZ,priority:HZ,action:{label:kZ,onClick:()=>{e.shell.openExternal(n)}}})})),()=>{for(let e of a)e();for(let e of o)clearTimeout(e);o.clear()}}function JZ(e,t,n,r=()=>{}){let i=`schema-incompatibility-${t.persistedSchemaVersion}`,a=`schema-incompatibility-error-${t.persistedSchemaVersion}`,o=e=>{r(i),n({id:a,body:LZ(IZ,e),variant:`error`,priority:VZ})};n({id:i,body:BZ(t.currentBuild),priority:VZ,action:{label:AZ,onClick:()=>{e.state.resetIncompatible().then(()=>{r(i)},o)}}})}var YZ=[],XZ=new Set,ZZ=!1;function QZ(){for(let e of XZ)e()}function $Z(e){let t=YZ.findIndex(t=>t.id===e.id);if(t===-1)YZ=[...YZ,e];else{let n=YZ.slice();n[t]=e,YZ=n}QZ()}function eQ(e){let t=YZ.filter(t=>t.id!==e);t.length!==YZ.length&&(YZ=t,QZ())}function tQ(){return YZ}function nQ(e){return XZ.add(e),()=>{XZ.delete(e)}}function rQ(){if(ZZ||typeof window>`u`)return;let e=window.okDesktop;e&&(ZZ=!0,qZ(e,$Z,eQ,void 0,{isEligible:e=>OF(FF.getSnapshot(),e),onShown:e=>FF.recordShown(e)}),e.state.query().then(t=>{t.schemaIncompatibility&&JZ(e,t.schemaIncompatibility,$Z,eQ)},e=>{console.warn(`[update-notices-store] bridge.state.query() failed`,e)}))}var iQ=6e4,aQ=e=>{let t=(0,$.c)(11),{href:n,label:r,icon:i}=e,a,o;t[0]===n?(a=t[1],o=t[2]):(a=e=>Du(e,n),o=e=>Du(e,n),t[0]=n,t[1]=a,t[2]=o);let s;t[3]===i?s=t[4]:(s=(0,Z.jsx)(i,{"aria-hidden":`true`,className:`size-3.5`}),t[3]=i,t[4]=s);let c;return t[5]!==n||t[6]!==r||t[7]!==a||t[8]!==o||t[9]!==s?(c=(0,Z.jsx)(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,onClick:a,onAuxClick:o,"aria-label":r,className:`rounded-md p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,children:s}),t[5]=n,t[6]=r,t[7]=a,t[8]=o,t[9]=s,t[10]=c):c=t[10],c};function oQ(e){let t=(0,$.c)(34),{version:n,onOpenReleaseNotes:r,onClose:i,store:a,autoDismissMs:o}=e,s=a===void 0?FF:a,c=o===void 0?iQ:o,{_:l}=At(),[u,d]=(0,Q.useState)(!1),f,p;t[0]!==c||t[1]!==i||t[2]!==u?(f=()=>{if(!u)return;let e=setTimeout(i,c);return()=>clearTimeout(e)},p=[u,i,c],t[0]=c,t[1]=i,t[2]=u,t[3]=f,t[4]=p):(f=t[3],p=t[4]),(0,Q.useEffect)(f,p);let m;t[5]===l?m=t[6]:(m=l({id:`GzPQ2f`}),t[5]=l,t[6]=m);let h;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(J,{id:`yLEyuq`}),t[7]=h):h=t[7];let g;t[8]===s?g=t[9]:(g=()=>{s.markSubscribed(),d(!0)},t[8]=s,t[9]=g);let _;t[10]!==i||t[11]!==s?(_=()=>{s.dismiss(),i()},t[10]=i,t[11]=s,t[12]=_):_=t[12];let v;t[13]!==g||t[14]!==_?(v=(0,Z.jsx)(SF,{source:`post_update_card`,compactSubmit:!0,description:h,onSuccess:g,onDismiss:_}),t[13]=g,t[14]=_,t[15]=v):v=t[15];let y;t[16]!==l||t[17]!==u?(y=u?null:(0,Z.jsxs)(`nav`,{"aria-label":l({id:`dbapvC`}),className:`mt-3 flex items-center gap-1.5 text-muted-foreground text-xs`,children:[(0,Z.jsx)(`span`,{className:`mr-0.5`,children:(0,Z.jsx)(J,{id:`9sBe85`})}),(0,Z.jsx)(aQ,{href:TF,label:l({id:`I7Exsw`}),icon:zF}),(0,Z.jsx)(aQ,{href:CF,label:l({id:`zyKa-I`}),icon:RF}),(0,Z.jsx)(aQ,{href:wF,label:l({id:`36aWJD`}),icon:LF})]}),t[16]=l,t[17]=u,t[18]=y):y=t[18];let b;t[19]!==y||t[20]!==v?(b=(0,Z.jsxs)(`div`,{className:`px-3 py-2.5`,children:[v,y]}),t[19]=y,t[20]=v,t[21]=b):b=t[21];let x;t[22]===n?x=t[23]:(x=(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:(0,Z.jsx)(J,{id:`hLy8b1`,values:{version:n}})}),t[22]=n,t[23]=x);let S;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(J,{id:`_PACVa`}),t[24]=S):S=t[24];let C;t[25]===r?C=t[26]:(C=(0,Z.jsx)(X,{variant:`link`,size:`sm`,className:`h-auto p-0 text-muted-foreground text-xs hover:text-foreground`,onClick:r,children:S}),t[25]=r,t[26]=C);let w;t[27]!==x||t[28]!==C?(w=(0,Z.jsxs)(`div`,{className:`flex items-center justify-between border-t bg-muted/30 px-3 py-2.5 space-x-2`,children:[x,C]}),t[27]=x,t[28]=C,t[29]=w):w=t[29];let T;return t[30]!==b||t[31]!==w||t[32]!==m?(T=(0,Z.jsxs)(`section`,{"aria-label":m,className:`mx-1 mb-1 overflow-hidden rounded-lg border bg-card text-card-foreground`,children:[b,w]}),t[30]=b,t[31]=w,t[32]=m,t[33]=T):T=t[33],T}function sQ(e){let t=(0,$.c)(37),{notice:n,onDismiss:r}=e,{_:i}=At(),a=n.variant===`error`?`border-destructive/60 bg-sidebar-accent/30 text-muted-foreground`:n.variant===`success`?`border-emerald-500/40 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400`:`border-sidebar-border bg-sidebar-accent/30 text-muted-foreground`,o;t[0]!==i||t[1]!==n.dismissible||t[2]!==r?(o=n.dismissible===!1?null:(0,Z.jsx)(X,{variant:`ghost`,size:`icon`,className:`size-5 shrink-0 text-muted-foreground hover:text-sidebar-foreground`,"aria-label":i({id:`GUYwCr`}),onClick:r,children:(0,Z.jsx)(vs,{"aria-hidden":`true`,className:`size-3`})}),t[0]=i,t[1]=n.dismissible,t[2]=r,t[3]=o):o=t[3];let s=o,c=`shrink-0 text-xs font-medium underline underline-offset-2 ${n.variant===`success`?`decoration-emerald-500/40`:`decoration-muted-foreground/40`} hover:text-sidebar-foreground hover:decoration-sidebar-foreground`;if(n.secondaryAction){let e=`update-notice-${n.id}`,r=`flex flex-col gap-2 rounded-md border px-2 py-2 text-xs ${a}`,i;t[4]===n.body?i=t[5]:(i=(0,Z.jsx)(`span`,{className:`flex-1 leading-snug`,children:n.body}),t[4]=n.body,t[5]=i);let o;t[6]!==s||t[7]!==i?(o=(0,Z.jsxs)(`div`,{className:`flex items-start gap-2`,children:[i,s]}),t[6]=s,t[7]=i,t[8]=o):o=t[8];let l;t[9]!==c||t[10]!==n.action?(l=n.action?(0,Z.jsx)(`button`,{type:`button`,className:c,onClick:()=>{n.action?.onClick()},children:n.action.label}):null,t[9]=c,t[10]=n.action,t[11]=l):l=t[11];let u;t[12]===n.secondaryAction?u=t[13]:(u=()=>{n.secondaryAction?.onClick()},t[12]=n.secondaryAction,t[13]=u);let d;t[14]!==c||t[15]!==n.secondaryAction.label||t[16]!==u?(d=(0,Z.jsx)(`button`,{type:`button`,className:c,onClick:u,children:n.secondaryAction.label}),t[14]=c,t[15]=n.secondaryAction.label,t[16]=u,t[17]=d):d=t[17];let f;t[18]!==l||t[19]!==d?(f=(0,Z.jsxs)(`div`,{className:`flex gap-3 pl-1`,children:[l,d]}),t[18]=l,t[19]=d,t[20]=f):f=t[20];let p;return t[21]!==e||t[22]!==r||t[23]!==o||t[24]!==f?(p=(0,Z.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"data-testid":e,className:r,children:[o,f]}),t[21]=e,t[22]=r,t[23]=o,t[24]=f,t[25]=p):p=t[25],p}let l=`update-notice-${n.id}`,u=`flex items-center gap-2 rounded-md border px-2 py-1.5 text-xs ${a}`,d;t[26]===n.body?d=t[27]:(d=(0,Z.jsx)(`span`,{className:`flex-1 leading-snug`,children:n.body}),t[26]=n.body,t[27]=d);let f;t[28]!==c||t[29]!==n.action?(f=n.action?(0,Z.jsx)(`button`,{type:`button`,className:c,onClick:()=>{n.action?.onClick()},children:n.action.label}):null,t[28]=c,t[29]=n.action,t[30]=f):f=t[30];let p;return t[31]!==s||t[32]!==l||t[33]!==u||t[34]!==d||t[35]!==f?(p=(0,Z.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"data-testid":l,className:u,children:[d,f,s]}),t[31]=s,t[32]=l,t[33]=u,t[34]=d,t[35]=f,t[36]=p):p=t[36],p}function cQ(e){if(e.length===0)return null;let t=e[0];if(!t)return null;for(let n=1;n<e.length;n++){let r=e[n];r&&r.priority<t.priority&&(t=r)}return t}function lQ(){let e=(0,$.c)(15),t=(0,Q.useSyncExternalStore)(nQ,tQ,tQ),n;e[0]===t?n=e[1]:(n=cQ(t),e[0]=t,e[1]=n);let r=n;if(!r)return null;if(r.combinedSubscribe&&r.whatsNew){let t;e[2]===r.action?t=e[3]:(t=()=>r.action?.onClick(),e[2]=r.action,e[3]=t);let n;e[4]===r.id?n=e[5]:(n=()=>eQ(r.id),e[4]=r.id,e[5]=n);let i;return e[6]!==r.whatsNew.version||e[7]!==t||e[8]!==n?(i=(0,Z.jsx)(`div`,{"data-testid":`update-notices-list`,children:(0,Z.jsx)(oQ,{version:r.whatsNew.version,onOpenReleaseNotes:t,onClose:n})}),e[6]=r.whatsNew.version,e[7]=t,e[8]=n,e[9]=i):i=e[9],i}let i;e[10]===r?i=e[11]:(i=()=>{r.onDismiss?.(),eQ(r.id)},e[10]=r,e[11]=i);let a;return e[12]!==r||e[13]!==i?(a=(0,Z.jsx)(`div`,{"data-testid":`update-notices-list`,children:(0,Z.jsx)(sQ,{notice:r,onDismiss:i})}),e[12]=r,e[13]=i,e[14]=a):a=e[14],a}function uQ(e,t){return e?.kind===`doc`||e?.kind===`folder-index`?Po(t.contentDir,Ro(e.docName),t.pathSeparator):e?.kind===`folder`?Po(t.contentDir,e.folderPath,t.pathSeparator):e?.kind===`asset`?Po(t.contentDir,e.assetPath,t.pathSeparator):t.contentDir}function dQ(e){return e?.kind===`doc`||e?.kind===`folder-index`?Ro(e.docName):e?.kind===`folder`?e.folderPath:e?.kind===`asset`?e.assetPath:``}function fQ(e,t){return e===null?ha({workspace:t}):e.kind===`folder`?t?ka({folderRelativePath:e.folderPath,workspace:t}):null:e.kind===`doc`||e.kind===`folder-index`?ja({docName:e.docName,workspace:t}):null}var pQ={folderCount:0,expandedCount:0},mQ=`button, [role="button"], [role="menuitem"], input, textarea, select, a[href]`;function hQ(e){return typeof Element>`u`||!(e instanceof Element)?!1:e.closest(mQ)!==null}function gQ(e){let t=(0,$.c)(2),{onOpenSearch:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(xl,{name:`file-sidebar`,children:(0,Z.jsx)(yQ,{onOpenSearch:n})}),t[0]=n,t[1]=r),r}var _Q=e=>{let t=(0,$.c)(15),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({icon:n,label:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=(0,Z.jsx)(n,{"aria-hidden":`true`}),t[4]=n,t[5]=a);let o;t[6]!==r||t[7]!==i||t[8]!==a?(o=(0,Z.jsx)(Ds,{asChild:!0,children:(0,Z.jsx)(X,{variant:`ghost`,size:`icon-sm`,"aria-label":r,...i,children:a})}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9];let s;t[10]===r?s=t[11]:(s=(0,Z.jsx)(Os,{children:r}),t[10]=r,t[11]=s);let c;return t[12]!==o||t[13]!==s?(c=(0,Z.jsxs)(As,{children:[o,s]}),t[12]=o,t[13]=s,t[14]=c):c=t[14],c},vQ=e=>{let t=(0,$.c)(15),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({icon:n,label:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=(0,Z.jsx)(n,{"aria-hidden":`true`}),t[4]=n,t[5]=a);let o;t[6]!==r||t[7]!==i||t[8]!==a?(o=(0,Z.jsx)(Ds,{asChild:!0,children:(0,Z.jsx)(oc,{asChild:!0,children:(0,Z.jsx)(X,{variant:`ghost`,size:`icon-sm`,"aria-label":r,...i,children:a})})}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9];let s;t[10]===r?s=t[11]:(s=(0,Z.jsx)(Os,{children:r}),t[10]=r,t[11]=s);let c;return t[12]!==o||t[13]!==s?(c=(0,Z.jsxs)(As,{children:[o,s]}),t[12]=o,t[13]=s,t[14]=c):c=t[14],c};function yQ(e){let t=(0,$.c)(309),{onOpenSearch:n}=e,{_:r}=At(),[i,a]=(0,Q.useState)(null),[o,s]=(0,Q.useState)(null),{activeDocName:c,activeTarget:l}=Xe(),u;t[0]!==c||t[1]!==l?(u=l?.kind===`folder`||l?.kind===`folder-index`?l.folderPath:nl(c),t[0]=c,t[1]=l,t[2]=u):u=t[2];let d=u,f;t[3]===d?f=t[4]:(f=ul(d)?``:d,t[3]=d,t[4]=f);let p=f,[m,g]=(0,Q.useState)(!1),_=m?``:p,v=typeof window<`u`&&window.okDesktop!=null,{state:y,toggleSidebar:b}=$j(),x=Io(),S=y===`expanded`,C=v&&y===`collapsed`,[w,T]=(0,Q.useState)(pQ),E,D;t[5]===i?(E=t[6],D=t[7]):(E=()=>{if(i===null)return;let e=()=>{T(i.getFolderState()),g(i.isCreationTargetCleared())};return e(),i.subscribe(e)},D=[i],t[5]=i,t[6]=E,t[7]=D),(0,Q.useEffect)(E,D);let O,k;t[8]===i?(O=t[9],k=t[10]):(O=()=>{if(i!==null)return WS(e=>{let t=e.initialDir??``;if(e.template){i.createFromTemplate(e.template.folder,e.template.name);return}i.startCreating(`file`,t)})},k=[i],t[8]=i,t[9]=O,t[10]=k),(0,Q.useEffect)(O,k);let A=w.folderCount>0,j=A&&w.expandedCount===w.folderCount,M=w.expandedCount===0,N=bo(``),P=bo(_===``?null:_),F=_===``?N:P,I=N.state.status===`ready`?(N.state.data.folder.templates_available?.length??0)>0:!0,L=F.state.status===`ready`?(F.state.data.folder.templates_available?.length??0)>0:!0,R=typeof window<`u`?window.okDesktop:void 0,z=ua(),{status:B}=Bi(),V=B?.hasRemote===!0,H;t[11]!==r||t[12]!==z?.contentDir?(H=R?.config?.projectName||z?.contentDir.split(`/`).filter(Boolean).pop()||r({id:`sER-bs`}),t[11]=r,t[12]=z?.contentDir,t[13]=H):H=t[13];let U=H,W=ba().states,{dispatch:G}=fa(),ee;t[14]===z?ee=t[15]:(ee=ha({workspace:z}),t[14]=z,t[15]=ee);let te=ee,{projectLocalBinding:K,merged:ne}=du(),re=ne?.appearance?.sidebar?.showHiddenFiles??!1,ie=ne?.appearance?.sidebar?.showOkFolders??!1,q=ne?.appearance?.sidebar?.showOnlyMarkdownFiles??!1,ae=ne?.appearance?.sidebar?.showSkillsSection??!0,oe=A&&!j,se=A&&!M,ce=oe||se,le=(0,Q.useRef)(!1),ue;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(ue=e=>{le.current&&(le.current=!1,e.preventDefault())},t[16]=ue):ue=t[16];let de=ue,fe=wQ,pe;t[17]!==i||t[18]!==z?(pe=()=>{z&&(le.current=!0,i?.startCreating(`file`,``))},t[17]=i,t[18]=z,t[19]=pe):pe=t[19];let me=pe,he;t[20]!==i||t[21]!==z?(he=e=>{z&&(le.current=!0,i?.createFromTemplate(``,e))},t[20]=i,t[21]=z,t[22]=he):he=t[22];let ge=he,_e;t[23]!==i||t[24]!==z?(_e=()=>{z&&(le.current=!0,i?.startCreating(`folder`,``))},t[23]=i,t[24]=z,t[25]=_e):_e=t[25];let ve=_e,ye;t[26]===z?ye=t[27]:(ye=()=>{!z||!R||R.shell.showItemInFolder(z.contentDir)},t[26]=z,t[27]=ye);let be=ye,xe;t[28]!==r||t[29]!==z?(xe=async()=>{if(z)try{await navigator.clipboard.writeText(z.contentDir),_s.success(r({id:`6_ZOw4`}),{description:z.contentDir})}catch(e){console.warn(`[FileSidebar] clipboard write failed:`,e),_s.error(r({id:`vfRlCI`}))}},t[28]=r,t[29]=z,t[30]=xe):xe=t[30];let Se=xe,Ce;t[31]!==r||t[32]!==V?(Ce=()=>{za({...Ia(``),hasRemote:V,onClickWhenNoRemote:()=>{_s.error(r({id:`WyQxwa`}))}},{clipboardWrite:Ca,toastSuccess:CQ,toastError:SQ,logEvent:xQ})},t[31]=r,t[32]=V,t[33]=Ce):Ce=t[33];let we=Ce,Te;t[34]!==r||t[35]!==K?(Te=e=>{if(K===null)return;let t=K.patch({appearance:{sidebar:e}});t.ok||(console.warn(`[FileSidebar] sidebar visibility toggle rejected:`,Wn(t.error)),_s.error(r({id:`P47EWZ`}),{description:Wn(t.error)}))},t[34]=r,t[35]=K,t[36]=Te):Te=t[36];let Ee=Te,De;t[37]===i?De=t[38]:(De=()=>{i?.expandAll()},t[37]=i,t[38]=De);let Oe=De,ke;t[39]===i?ke=t[40]:(ke=()=>{i?.collapseAll()},t[39]=i,t[40]=ke);let Ae=ke,je,Me;t[41]!==se||t[42]!==oe||t[43]!==re||t[44]!==ie||t[45]!==q||t[46]!==ae||t[47]!==y?(je=()=>{R&&R.editor.notifyViewMenuStateChanged({showHiddenFiles:re,showOkFolders:ie,showOnlyMarkdownFiles:q,showSkillsSection:ae,canExpandAll:oe,canCollapseAll:se,sidebarVisible:y===`expanded`})},Me=[R,re,ie,q,ae,oe,se,y],t[41]=se,t[42]=oe,t[43]=re,t[44]=ie,t[45]=q,t[46]=ae,t[47]=y,t[48]=je,t[49]=Me):(je=t[48],Me=t[49]),(0,Q.useEffect)(je,Me);let Ne;t[50]!==r||t[51]!==l||t[52]!==G||t[53]!==W||t[54]!==_||t[55]!==Ee||t[56]!==re||t[57]!==ie||t[58]!==q||t[59]!==ae||t[60]!==b||t[61]!==i||t[62]!==z?(Ne=()=>{if(R)return R.onMenuAction(e=>{let t=l!==null&&ul(dQ(l));switch(e){case`new-doc`:if(!z||!i)return;i.startCreating(`file`,_);return;case`new-folder`:if(!z||!i)return;i.startCreating(`folder`,_);return;case`new-from-template`:if(!z||!i)return;i.startCreatingFromTemplate(_);return;case`rename`:if(!l||t)return;wJ(l);return;case`duplicate`:if(!l||t)return;EJ(l);return;case`move-to-trash`:if(!l||t)return;SJ(l);return;case`reveal-in-finder`:{if(!R||!z)return;let e=uQ(l,z);R.shell.showItemInFolder(e);return}case`send-to-ai`:{let e=la.filter(e=>W[e.id]?.installed===!0);if(e.length===0){_s.error(r({id:`LKOLNn`}));return}let t=fQ(l,z);if(!t)return;let[n]=e;if(!n)return;G(n.id,t);return}case`copy-full-path`:{if(!z)return;let e=uQ(l,z);navigator.clipboard.writeText(e).then(()=>_s.success(r({id:`6_ZOw4`}),{description:e})).catch(e=>{console.warn(`[FileSidebar] clipboard write failed:`,e),_s.error(r({id:`vfRlCI`}))});return}case`copy-relative-path`:{let e=dQ(l);if(e===``){_s.error(r({id:`74eHt-`}));return}navigator.clipboard.writeText(e).then(()=>_s.success(r({id:`haHgQj`}),{description:e})).catch(e=>{console.warn(`[FileSidebar] clipboard write failed:`,e),_s.error(r({id:`5QGTaA`}))});return}case`toggle-show-ok-folders`:Ee({showOkFolders:!ie});return;case`toggle-show-hidden-files`:Ee({showHiddenFiles:!re});return;case`toggle-show-only-markdown-files`:Ee({showOnlyMarkdownFiles:!q});return;case`toggle-show-skills-section`:Ee({showSkillsSection:!ae});return;case`expand-all-tree`:i?.expandAll();return;case`collapse-all-tree`:i?.collapseAll();return;case`toggle-sidebar`:b();return;case`delete`:case`toggle-source`:case`save-version`:case`version-history`:case`focus-search`:case`focus-command-palette`:case`close-active-tab-or-window`:case`toggle-doc-panel`:return}})},t[50]=r,t[51]=l,t[52]=G,t[53]=W,t[54]=_,t[55]=Ee,t[56]=re,t[57]=ie,t[58]=q,t[59]=ae,t[60]=b,t[61]=i,t[62]=z,t[63]=Ne):Ne=t[63];let Pe;t[64]!==r||t[65]!==l||t[66]!==G||t[67]!==W||t[68]!==_||t[69]!==K||t[70]!==re||t[71]!==ie||t[72]!==q||t[73]!==ae||t[74]!==b||t[75]!==i||t[76]!==z?(Pe=[R,i,z,l,_,K,re,ie,q,ae,W,G,b,r],t[64]=r,t[65]=l,t[66]=G,t[67]=W,t[68]=_,t[69]=K,t[70]=re,t[71]=ie,t[72]=q,t[73]=ae,t[74]=b,t[75]=i,t[76]=z,t[77]=Pe):Pe=t[77],(0,Q.useEffect)(Ne,Pe);let Fe=v&&S&&`motion-safe:delay-100`,Ie=C&&`opacity-0`,Le;t[78]!==Fe||t[79]!==Ie?(Le=Y(`flex-row h-12 items-center py-0 px-3`,`justify-between`,v&&`overflow-x-clip`,v&&`motion-safe:transition-opacity motion-safe:duration-100 motion-safe:ease-out`,Fe,Ie,v&&`[-webkit-app-region:drag]`),t[78]=Fe,t[79]=Ie,t[80]=Le):Le=t[80];let Re;t[81]===Symbol.for(`react.memo_cache_sentinel`)?(Re=v?(0,Z.jsx)(`div`,{"aria-hidden":`true`,"data-testid":`sidebar-traffic-light-reserve`,className:`w-[var(--ok-titlebar-reserve-left,0px)] shrink-0 self-stretch`}):null,t[81]=Re):Re=t[81];let ze;t[82]===S?ze=t[83]:(ze=S&&!v?(0,Z.jsx)(`span`,{className:`shrink-0 font-mono text-sm uppercase tracking-wider text-sidebar-foreground/50`,children:(0,Z.jsx)(J,{id:`sER-bs`})}):null,t[82]=S,t[83]=ze);let Be;t[84]===Symbol.for(`react.memo_cache_sentinel`)?(Be=Y(`flex items-center gap-1`,v&&`[&>*]:[-webkit-app-region:no-drag]`),t[84]=Be):Be=t[84];let Ve;t[85]===r?Ve=t[86]:(Ve=r({id:`Rq1vFD`}),t[85]=r,t[86]=Ve);let He;t[87]===Ve?He=t[88]:(He=(0,Z.jsx)(vQ,{icon:uf,label:Ve}),t[87]=Ve,t[88]=He);let Ue;t[89]!==oe||t[90]!==i?(Ue=oe?(0,Z.jsxs)(bc,{onSelect:()=>i?.expandAll(),children:[(0,Z.jsx)(Zf,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`OlAl5i`})]}):null,t[89]=oe,t[90]=i,t[91]=Ue):Ue=t[91];let We;t[92]!==se||t[93]!==i?(We=se?(0,Z.jsxs)(bc,{onSelect:()=>i?.collapseAll(),children:[(0,Z.jsx)(Zd,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`qvWGzP`})]}):null,t[92]=se,t[93]=i,t[94]=We):We=t[94];let Ge;t[95]===ce?Ge=t[96]:(Ge=ce?(0,Z.jsx)(gc,{}):null,t[95]=ce,t[96]=Ge);let Ke;t[97]===r?Ke=t[98]:(Ke=r({id:`8vETh9`}),t[97]=r,t[98]=Ke);let qe;t[99]===Symbol.for(`react.memo_cache_sentinel`)?(qe=(0,Z.jsx)(jc,{children:(0,Z.jsx)(J,{id:`8vETh9`})}),t[99]=qe):qe=t[99];let Je;t[100]===Ee?Je=t[101]:(Je=e=>Ee({showHiddenFiles:e}),t[100]=Ee,t[101]=Je);let Ye=K===null,Ze;t[102]===Symbol.for(`react.memo_cache_sentinel`)?(Ze=(0,Z.jsx)(J,{id:`6KCH4m`}),t[102]=Ze):Ze=t[102];let Qe;t[103]!==re||t[104]!==Je||t[105]!==Ye?(Qe=(0,Z.jsx)(Ec,{checked:re,onCheckedChange:Je,disabled:Ye,"data-testid":`tree-options-show-hidden-files`,children:Ze}),t[103]=re,t[104]=Je,t[105]=Ye,t[106]=Qe):Qe=t[106];let $e;t[107]===Ee?$e=t[108]:($e=e=>Ee({showOkFolders:e}),t[107]=Ee,t[108]=$e);let et=K===null,tt;t[109]===Symbol.for(`react.memo_cache_sentinel`)?(tt=(0,Z.jsx)(J,{id:`ELYtNJ`}),t[109]=tt):tt=t[109];let nt;t[110]!==ie||t[111]!==$e||t[112]!==et?(nt=(0,Z.jsx)(Ec,{checked:ie,onCheckedChange:$e,disabled:et,"data-testid":`tree-options-show-ok-folders`,children:tt}),t[110]=ie,t[111]=$e,t[112]=et,t[113]=nt):nt=t[113];let rt;t[114]===Ee?rt=t[115]:(rt=e=>Ee({showOnlyMarkdownFiles:e}),t[114]=Ee,t[115]=rt);let it=K===null,at;t[116]===Symbol.for(`react.memo_cache_sentinel`)?(at=(0,Z.jsx)(J,{id:`5-o4kO`}),t[116]=at):at=t[116];let ot;t[117]!==q||t[118]!==rt||t[119]!==it?(ot=(0,Z.jsx)(Ec,{checked:q,onCheckedChange:rt,disabled:it,"data-testid":`tree-options-show-only-markdown-files`,children:at}),t[117]=q,t[118]=rt,t[119]=it,t[120]=ot):ot=t[120];let st;t[121]===Ee?st=t[122]:(st=e=>Ee({showSkillsSection:e}),t[121]=Ee,t[122]=st);let ct=K===null,lt;t[123]===Symbol.for(`react.memo_cache_sentinel`)?(lt=(0,Z.jsx)(J,{id:`PCSkw2`}),t[123]=lt):lt=t[123];let ut;t[124]!==ae||t[125]!==st||t[126]!==ct?(ut=(0,Z.jsx)(Ec,{checked:ae,onCheckedChange:st,disabled:ct,"data-testid":`tree-options-show-skills`,children:lt}),t[124]=ae,t[125]=st,t[126]=ct,t[127]=ut):ut=t[127];let dt;t[128]!==Ke||t[129]!==Qe||t[130]!==nt||t[131]!==ot||t[132]!==ut?(dt=(0,Z.jsxs)(xc,{"aria-label":Ke,children:[qe,Qe,nt,ot,ut]}),t[128]=Ke,t[129]=Qe,t[130]=nt,t[131]=ot,t[132]=ut,t[133]=dt):dt=t[133];let ft;t[134]!==Ue||t[135]!==We||t[136]!==Ge||t[137]!==dt?(ft=(0,Z.jsxs)(Sc,{align:`end`,className:`min-w-52`,"data-testid":`tree-options-menu`,children:[Ue,We,Ge,dt]}),t[134]=Ue,t[135]=We,t[136]=Ge,t[137]=dt,t[138]=ft):ft=t[138];let pt;t[139]!==He||t[140]!==ft?(pt=(0,Z.jsxs)(Oc,{children:[He,ft]}),t[139]=He,t[140]=ft,t[141]=pt):pt=t[141];let mt;t[142]===r?mt=t[143]:(mt=r({id:`HdkSiO`}),t[142]=r,t[143]=mt);let ht;t[144]!==_||t[145]!==i?(ht=()=>i?.startCreating(`file`,_),t[144]=_,t[145]=i,t[146]=ht):ht=t[146];let gt;t[147]!==mt||t[148]!==ht?(gt=(0,Z.jsx)(_Q,{icon:Lf,label:mt,onClick:ht}),t[147]=mt,t[148]=ht,t[149]=gt):gt=t[149];let _t;t[150]!==r||t[151]!==L||t[152]!==_||t[153]!==i?(_t=L?(0,Z.jsxs)(Oc,{children:[(0,Z.jsx)(vQ,{icon:ao,label:r({id:`Uuj_R4`})}),(0,Z.jsx)(Sc,{align:`end`,className:`min-w-52`,onCloseAutoFocus:de,children:(0,Z.jsx)(mJ,{parentDir:_,onSelectTemplate:e=>{le.current=!0,i?.createFromTemplate(_,e)},ItemComponent:bc})})]}):null,t[150]=r,t[151]=L,t[152]=_,t[153]=i,t[154]=_t):_t=t[154];let vt;t[155]===r?vt=t[156]:(vt=r({id:`96G6Re`}),t[155]=r,t[156]=vt);let yt;t[157]!==_||t[158]!==i?(yt=()=>i?.startCreating(`folder`,_),t[157]=_,t[158]=i,t[159]=yt):yt=t[159];let bt;t[160]!==vt||t[161]!==yt?(bt=(0,Z.jsx)(_Q,{icon:$d,label:vt,onClick:yt}),t[160]=vt,t[161]=yt,t[162]=bt):bt=t[162];let xt;t[163]!==pt||t[164]!==gt||t[165]!==_t||t[166]!==bt?(xt=(0,Z.jsxs)(`div`,{"data-testid":`sidebar-toolbar`,className:Be,children:[pt,gt,_t,bt]}),t[163]=pt,t[164]=gt,t[165]=_t,t[166]=bt,t[167]=xt):xt=t[167];let St;t[168]!==Le||t[169]!==ze||t[170]!==xt?(St=(0,Z.jsxs)(sM,{"data-electron-drag":v?``:void 0,className:Le,children:[Re,ze,xt]}),t[168]=Le,t[169]=ze,t[170]=xt,t[171]=St):St=t[171];let Ct=v&&S&&`motion-safe:delay-100`,wt=C&&`opacity-0`,Tt;t[172]!==Ct||t[173]!==wt?(Tt=Y(`px-2 pb-2`,v&&`[-webkit-app-region:no-drag]`,v&&`motion-safe:transition-opacity motion-safe:duration-100 motion-safe:ease-out`,Ct,wt),t[172]=Ct,t[173]=wt,t[174]=Tt):Tt=t[174];let Et;t[175]===y?Et=t[176]:(Et=[y],t[175]=y,t[176]=Et);let Dt;t[177]===n?Dt=t[178]:(Dt=(0,Z.jsx)(_Z,{onClick:n}),t[177]=n,t[178]=Dt);let Ot;t[179]!==Et||t[180]!==Dt?(Ot=(0,Z.jsx)(h,{fallbackRender:bQ,onError:gZ,resetKeys:Et,children:Dt}),t[179]=Et,t[180]=Dt,t[181]=Ot):Ot=t[181];let kt;t[182]!==Tt||t[183]!==Ot?(kt=(0,Z.jsx)(`div`,{className:Tt,children:Ot}),t[182]=Tt,t[183]=Ot,t[184]=kt):kt=t[184];let jt;t[185]===Symbol.for(`react.memo_cache_sentinel`)?(jt=(0,Z.jsx)(XI,{}),t[185]=jt):jt=t[185];let Mt;t[186]===Symbol.for(`react.memo_cache_sentinel`)?(Mt=(0,Z.jsx)(Bo,{className:`size-3.5 shrink-0`}),t[186]=Mt):Mt=t[186];let Nt;t[187]===U?Nt=t[188]:(Nt=(0,Z.jsx)(`span`,{className:`truncate`,children:U}),t[187]=U,t[188]=Nt);let Pt;t[189]===Symbol.for(`react.memo_cache_sentinel`)?(Pt=(0,Z.jsx)(ra,{className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-data-[state=open]/files:rotate-90`}),t[189]=Pt):Pt=t[189];let Ft;t[190]===Nt?Ft=t[191]:(Ft=(0,Z.jsx)(dM,{asChild:!0,className:`shrink-0`,children:(0,Z.jsxs)(Ns,{"data-sidebar-root-context":!0,className:`flex w-full items-center gap-1.5`,children:[Mt,Nt,Pt]})}),t[190]=Nt,t[191]=Ft);let It=o==null?`50vh`:`${o}px`,Lt;t[192]===It?Lt=t[193]:(Lt={height:It},t[192]=It,t[193]=Lt);let Rt;t[194]===Symbol.for(`react.memo_cache_sentinel`)?(Rt=(0,Z.jsx)(HY,{ref:a,onContentHeightChange:s}),t[194]=Rt):Rt=t[194];let zt;t[195]===Lt?zt=t[196]:(zt=(0,Z.jsx)(Ms,{className:`flex max-h-[70vh] flex-col overflow-hidden`,style:Lt,children:Rt}),t[195]=Lt,t[196]=zt);let Bt;t[197]!==Ft||t[198]!==zt?(Bt=(0,Z.jsx)(Ps,{defaultOpen:!0,className:`group/files flex shrink-0 flex-col`,children:(0,Z.jsxs)(uM,{className:`min-h-0 px-0`,children:[Ft,zt]})}),t[197]=Ft,t[198]=zt,t[199]=Bt):Bt=t[199];let Vt;t[200]===ae?Vt=t[201]:(Vt=ae?(0,Z.jsx)(vZ,{}):null,t[200]=ae,t[201]=Vt);let Ht;t[202]===i?Ht=t[203]:(Ht=(0,Z.jsx)(`div`,{"aria-hidden":!0,"data-sidebar-empty-deselect":!0,className:`min-h-8 flex-1 cursor-default`,onClick:()=>i?.clearCreationTarget()}),t[202]=i,t[203]=Ht);let Ut;t[204]!==Bt||t[205]!==Vt||t[206]!==Ht?(Ut=(0,Z.jsxs)(lM,{children:[jt,Bt,Vt,Ht]}),t[204]=Bt,t[205]=Vt,t[206]=Ht,t[207]=Ut):Ut=t[207];let Wt;t[208]===Symbol.for(`react.memo_cache_sentinel`)?(Wt=(0,Z.jsxs)(cM,{className:`px-0`,children:[(0,Z.jsx)(zX,{}),(0,Z.jsx)(lQ,{}),typeof window<`u`&&window.okDesktop?(0,Z.jsx)(mM,{children:(0,Z.jsx)(hM,{children:(0,Z.jsx)(sZ,{bridge:window.okDesktop})})}):null]}),t[208]=Wt):Wt=t[208];let Gt=!(x&&y===`collapsed`),Kt;t[209]===Gt?Kt=t[210]:(Kt=(0,Z.jsx)(aM,{enableToggle:!1,enableDrag:Gt}),t[209]=Gt,t[210]=Kt);let qt;t[211]!==St||t[212]!==kt||t[213]!==Ut||t[214]!==Kt?(qt=(0,Z.jsx)(bP,{asChild:!0,children:(0,Z.jsxs)(`div`,{className:`contents`,onContextMenu:fe,children:[St,kt,Ut,Wt,Kt]})}),t[211]=St,t[212]=kt,t[213]=Ut,t[214]=Kt,t[215]=qt):qt=t[215];let Jt=!z,Yt,Xt;t[216]===Symbol.for(`react.memo_cache_sentinel`)?(Yt=(0,Z.jsx)(Lf,{"aria-hidden":`true`}),Xt=(0,Z.jsx)(J,{id:`HdkSiO`}),t[216]=Yt,t[217]=Xt):(Yt=t[216],Xt=t[217]);let Zt;t[218]!==me||t[219]!==Jt?(Zt=(0,Z.jsxs)(wP,{disabled:Jt,onSelect:me,"data-testid":`empty-space-menu-new-file`,children:[Yt,Xt]}),t[218]=me,t[219]=Jt,t[220]=Zt):Zt=t[220];let Qt;t[221]!==ge||t[222]!==I||t[223]!==z?(Qt=I?(0,Z.jsxs)(SP,{children:[(0,Z.jsxs)(TP,{disabled:!z,"data-testid":`empty-space-menu-new-from-template`,children:[(0,Z.jsx)(ao,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`Uuj_R4`})]}),(0,Z.jsx)(EP,{children:(0,Z.jsx)(mJ,{parentDir:``,onSelectTemplate:ge,ItemComponent:wP})})]}):null,t[221]=ge,t[222]=I,t[223]=z,t[224]=Qt):Qt=t[224];let $t=!z,en,tn;t[225]===Symbol.for(`react.memo_cache_sentinel`)?(en=(0,Z.jsx)($d,{"aria-hidden":`true`}),tn=(0,Z.jsx)(J,{id:`96G6Re`}),t[225]=en,t[226]=tn):(en=t[225],tn=t[226]);let nn;t[227]!==ve||t[228]!==$t?(nn=(0,Z.jsxs)(wP,{disabled:$t,onSelect:ve,"data-testid":`empty-space-menu-new-folder`,children:[en,tn]}),t[227]=ve,t[228]=$t,t[229]=nn):nn=t[229];let rn;t[230]===Symbol.for(`react.memo_cache_sentinel`)?(rn=(0,Z.jsx)(kP,{}),t[230]=rn):rn=t[230];let an;t[231]!==r||t[232]!==be||t[233]!==z?(an=R?(0,Z.jsxs)(wP,{disabled:!z,onSelect:be,"data-testid":`empty-space-menu-reveal-in-finder`,"aria-label":r(z?{id:`LtSYdi`}:{id:`o2yoFu`}),children:[(0,Z.jsx)(Bo,{"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(J,{id:`LtSYdi`})}),z?null:(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:(0,Z.jsx)(J,{id:`wTcjov`})})]}):null,t[231]=r,t[232]=be,t[233]=z,t[234]=an):an=t[234];let on;t[235]!==G||t[236]!==te||t[237]!==W?(on=(0,Z.jsx)(DX,{input:te,installStates:W,dispatch:G}),t[235]=G,t[236]=te,t[237]=W,t[238]=on):on=t[238];let sn;t[239]!==we||t[240]!==V?(sn=V?(0,Z.jsxs)(wP,{onSelect:we,"data-testid":`empty-space-menu-share`,children:[(0,Z.jsx)(Nf,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`Z8lGw6`})]}):null,t[239]=we,t[240]=V,t[241]=sn):sn=t[241];let cn=!z,ln;t[242]!==r||t[243]!==z?(ln=r(z?{id:`Up2_7p`}:{id:`U8CD-l`}),t[242]=r,t[243]=z,t[244]=ln):ln=t[244];let un;t[245]===Symbol.for(`react.memo_cache_sentinel`)?(un=(0,Z.jsx)(Ao,{"aria-hidden":`true`}),t[245]=un):un=t[245];let dn;t[246]===Symbol.for(`react.memo_cache_sentinel`)?(dn=(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(J,{id:`Up2_7p`})}),t[246]=dn):dn=t[246];let fn;t[247]===z?fn=t[248]:(fn=z?null:(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:(0,Z.jsx)(J,{id:`wTcjov`})}),t[247]=z,t[248]=fn);let pn;t[249]!==Se||t[250]!==cn||t[251]!==ln||t[252]!==fn?(pn=(0,Z.jsxs)(wP,{disabled:cn,onSelect:Se,"data-testid":`empty-space-menu-copy-full-path`,"aria-label":ln,children:[un,dn,fn]}),t[249]=Se,t[250]=cn,t[251]=ln,t[252]=fn,t[253]=pn):pn=t[253];let mn;t[254]===Symbol.for(`react.memo_cache_sentinel`)?(mn=(0,Z.jsx)(kP,{}),t[254]=mn):mn=t[254];let hn;t[255]===Ee?hn=t[256]:(hn=e=>Ee({showHiddenFiles:e}),t[255]=Ee,t[256]=hn);let gn=K===null,_n;t[257]===Symbol.for(`react.memo_cache_sentinel`)?(_n=(0,Z.jsx)(J,{id:`XcGbim`}),t[257]=_n):_n=t[257];let vn;t[258]!==re||t[259]!==hn||t[260]!==gn?(vn=(0,Z.jsx)(DP,{checked:re,onCheckedChange:hn,disabled:gn,"data-testid":`empty-space-menu-show-hidden-files`,children:_n}),t[258]=re,t[259]=hn,t[260]=gn,t[261]=vn):vn=t[261];let yn;t[262]===Ee?yn=t[263]:(yn=e=>Ee({showOkFolders:e}),t[262]=Ee,t[263]=yn);let bn=K===null,xn;t[264]===Symbol.for(`react.memo_cache_sentinel`)?(xn=(0,Z.jsx)(J,{id:`GHsJb8`}),t[264]=xn):xn=t[264];let Sn;t[265]!==ie||t[266]!==yn||t[267]!==bn?(Sn=(0,Z.jsx)(DP,{checked:ie,onCheckedChange:yn,disabled:bn,"data-testid":`empty-space-menu-show-ok-folders`,children:xn}),t[265]=ie,t[266]=yn,t[267]=bn,t[268]=Sn):Sn=t[268];let Cn;t[269]===Ee?Cn=t[270]:(Cn=e=>Ee({showOnlyMarkdownFiles:e}),t[269]=Ee,t[270]=Cn);let wn=K===null,Tn;t[271]===Symbol.for(`react.memo_cache_sentinel`)?(Tn=(0,Z.jsx)(J,{id:`WkTLN7`}),t[271]=Tn):Tn=t[271];let En;t[272]!==q||t[273]!==Cn||t[274]!==wn?(En=(0,Z.jsx)(DP,{checked:q,onCheckedChange:Cn,disabled:wn,"data-testid":`empty-space-menu-show-only-markdown-files`,children:Tn}),t[272]=q,t[273]=Cn,t[274]=wn,t[275]=En):En=t[275];let Dn;t[276]===Ee?Dn=t[277]:(Dn=e=>Ee({showSkillsSection:e}),t[276]=Ee,t[277]=Dn);let On=K===null,kn;t[278]===Symbol.for(`react.memo_cache_sentinel`)?(kn=(0,Z.jsx)(J,{id:`NF_Wcg`}),t[278]=kn):kn=t[278];let An;t[279]!==ae||t[280]!==Dn||t[281]!==On?(An=(0,Z.jsx)(DP,{checked:ae,onCheckedChange:Dn,disabled:On,"data-testid":`empty-space-menu-show-skills-section`,children:kn}),t[279]=ae,t[280]=Dn,t[281]=On,t[282]=An):An=t[282];let jn;t[283]===ce?jn=t[284]:(jn=ce?(0,Z.jsx)(kP,{}):null,t[283]=ce,t[284]=jn);let Mn;t[285]!==Oe||t[286]!==oe?(Mn=oe?(0,Z.jsxs)(wP,{onSelect:Oe,"data-testid":`empty-space-menu-expand-all`,children:[(0,Z.jsx)(Zf,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`OlAl5i`})]}):null,t[285]=Oe,t[286]=oe,t[287]=Mn):Mn=t[287];let Nn;t[288]!==Ae||t[289]!==se?(Nn=se?(0,Z.jsxs)(wP,{onSelect:Ae,"data-testid":`empty-space-menu-collapse-all`,children:[(0,Z.jsx)(Zd,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`qvWGzP`})]}):null,t[288]=Ae,t[289]=se,t[290]=Nn):Nn=t[290];let Pn;t[291]!==sn||t[292]!==pn||t[293]!==vn||t[294]!==Sn||t[295]!==En||t[296]!==An||t[297]!==jn||t[298]!==Mn||t[299]!==Nn||t[300]!==Zt||t[301]!==Qt||t[302]!==nn||t[303]!==an||t[304]!==on?(Pn=(0,Z.jsxs)(CP,{className:`min-w-52`,onCloseAutoFocus:de,children:[Zt,Qt,nn,rn,an,on,sn,pn,mn,vn,Sn,En,An,jn,Mn,Nn]}),t[291]=sn,t[292]=pn,t[293]=vn,t[294]=Sn,t[295]=En,t[296]=An,t[297]=jn,t[298]=Mn,t[299]=Nn,t[300]=Zt,t[301]=Qt,t[302]=nn,t[303]=an,t[304]=on,t[305]=Pn):Pn=t[305];let Fn;return t[306]!==Pn||t[307]!==qt?(Fn=(0,Z.jsx)(rM,{variant:`inset`,children:(0,Z.jsxs)(yP,{children:[qt,Pn]})}),t[306]=Pn,t[307]=qt,t[308]=Fn):Fn=t[308],Fn}function bQ(){return null}function xQ(e){return console.log(e)}function SQ(e){return _s.error(e)}function CQ(e){return _s.success(e)}function wQ(e){e.target instanceof Element&&e.target.closest(`[data-sidebar-root-context]`)||hQ(e.target)&&(e.preventDefault(),e.stopPropagation())}var TQ=(0,Q.lazy)(()=>n(()=>import(`./McpConsentDialogBody-CBhFj_dO.js`),__vite__mapDeps([104,1,10,3,11,6,7,81,20,21,15,13,16,63,64,61,62,83,19,31,70,42,105]),import.meta.url));function EQ(){let e=(0,$.c)(1);if(!(0,Q.useSyncExternalStore)(ld.subscribe,OQ,DQ))return null;let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(TQ,{})}),e[0]=t):t=e[0],t}function DQ(){return!1}function OQ(){return ld.getSnapshot()!==null}function kQ(){let e=(0,$.c)(17),t=rn(),{collabUrl:n,setSystemProvider:r,updateServerInstanceId:i,onBranchSwitched:a,observeBranch:o,observeDiskAck:s,refreshServerInfo:c}=Xe(),l;e[0]!==o||e[1]!==s||e[2]!==a||e[3]!==c||e[4]!==i?(l={updateServerInstanceId:i,onBranchSwitched:a,observeBranch:o,observeDiskAck:s,refreshServerInfo:c},e[0]=o,e[1]=s,e[2]=a,e[3]=c,e[4]=i,e[5]=l):l=e[5];let u=(0,Q.useRef)(l),d;e[6]!==o||e[7]!==s||e[8]!==a||e[9]!==c||e[10]!==i?(d=()=>{u.current={updateServerInstanceId:i,onBranchSwitched:a,observeBranch:o,observeDiskAck:s,refreshServerInfo:c}},e[6]=o,e[7]=s,e[8]=a,e[9]=c,e[10]=i,e[11]=d):d=e[11],(0,Q.useEffect)(d);let f,p;return e[12]!==n||e[13]!==t||e[14]!==r?(f=()=>{if(n===null)return;let e=new Vl,i=new zl({url:n,name:hr,document:e,onStateless:e=>{let{payload:t}=e;b(t,{onServerInfo:e=>{u.current.updateServerInstanceId(e.serverInstanceId),e.currentBranch!==void 0&&u.current.observeBranch(e.currentBranch)},onBranchSwitched:e=>{u.current.onBranchSwitched(e.branch)},onDiskAck:e=>{u.current.observeDiskAck(e.docName,e.sv)},onDerivedView:FQ,onConfigValidationRejected:PQ,onConfigIgnoreNestedError:NQ,onUnknown:MQ})},onClose:jQ,onDisconnect:AQ}),a=gl(e=>{(e.includes(`files`)||e.includes(`backlinks`))&&(t.invalidateQueries({queryKey:[`backlinks`]}),t.invalidateQueries({queryKey:[`forward-links`]})),(e.includes(`files`)||e.includes(`graph`))&&(t.invalidateQueries({queryKey:[`orphans`]}),t.invalidateQueries({queryKey:[`hubs`]}))}),o=M(()=>{u.current.refreshServerInfo()});i.on(`synced`,()=>{hl([`files`,`backlinks`,`graph`]),o()});let s=new Set,c=()=>{if(i.awareness)for(let[e,t]of i.awareness.getStates().entries())s.has(e)||t.user?.type===`agent`&&(s.add(e),console.warn(`[agent-presence] observed stale AwarenessUser.type === 'agent' from clientID ${e} — probably a stale bundled client`))};return i.awareness?.on(`change`,c),r(i),()=>{a(),i.awareness?.off(`change`,c),r(null),i.destroy(),e.destroy()}},p=[t,n,r],e[12]=n,e[13]=t,e[14]=r,e[15]=f,e[16]=p):(f=e[15],p=e[16]),(0,Q.useEffect)(f,p),null}function AQ(){console.warn(`[CC1] __system__ disconnected - derived views may be stale`)}function jQ(e){let{event:t}=e;console.warn(`[CC1] __system__ connection closed:`,t.code,t.reason)}function MQ(e){console.warn(`[CC1] Unparseable stateless payload, skipping:`,e.slice(0,100))}function NQ(e){to(e)}function PQ(e){vo(e)}function FQ(e){hl([e.ch])}function IQ(e){let t=we(e);if(t)return{scope:`project`,name:t};let n=Qn(e);return n?.kind===`skill`?{scope:n.scope,name:n.name}:null}function LQ(e,t){let n=new Set(t.map(e=>`${e.scope}\u0000${e.name}`)),r=[];for(let t of e){let e=IQ(t);if(!e||n.has(`${e.scope}\u0000${e.name}`))continue;let i=e.scope===`project`?`global`:`project`;n.has(`${i}\u0000${e.name}`)?r.push({kind:`retarget`,fromDocName:t,toDocName:Ln(i,e.name)}):r.push({kind:`close`,docName:t})}return r}function RQ(){let e=(0,$.c)(13),{openTabs:t,closeDocument:n}=Xe(),r;e[0]===t?r=e[1]:(r=t.some(BQ),e[0]=t,e[1]=r);let i=r,a;e[2]===i?a=e[3]:(a={enabled:i},e[2]=i,e[3]=a);let o=xa(a),s=(0,Q.useRef)(null),c;e[4]!==n||e[5]!==t||e[6]!==o.data||e[7]!==o.status?(c=()=>{if(o.status!==`ready`)return;let e=o.data,r=`${t.join(``)}\u0002${e.map(zQ).sort().join(``)}`;if(s.current===r)return;s.current=r;let i=LQ(t,e);for(let e of i)e.kind===`retarget`?($o(e.toDocName),n(e.fromDocName)):n(e.docName)},e[4]=n,e[5]=t,e[6]=o.data,e[7]=o.status,e[8]=c):c=e[8];let l;e[9]!==n||e[10]!==t||e[11]!==o?(l=[o,t,n],e[9]=n,e[10]=t,e[11]=o,e[12]=l):l=e[12],(0,Q.useEffect)(c,l)}function zQ(e){return`${e.scope}\u0000${e.name}`}function BQ(e){return IQ(e)!==null}var VQ=1e3,HQ=3e4;function UQ(e){let t=e.scheduler??{setTimeout:(e,t)=>globalThis.setTimeout(e,t),clearTimeout:e=>globalThis.clearTimeout(e)},n=e.initialBackoffMs??VQ,r=e.maxBackoffMs??HQ,i=e.rng??Math.random,a=e.createWebSocket??(e=>new WebSocket(e)),o=e.logger??null,s=e.log,c=null,l=null,u=!1,d=n;function f(e,t,n){try{o?o[e](t,n):s?.(t)}catch{}}function p(){if(u)return;l!==null&&t.clearTimeout(l);let e=d;d=Math.min(d*2,r);let n=i(),a=Math.max(1,Math.floor(e*(1-n/2)));f(`debug`,`scheduling reconnect`,{backoffMs:a,ceilMs:e}),l=t.setTimeout(()=>{l=null,m().catch(e=>f(`warn`,`reconnect failed`,{error:String(e)}))},a)}async function m(){if(u)return;let t;try{t=await e.resolveWsUrl()}catch(e){f(`warn`,`resolveWsUrl threw`,{error:String(e)}),p();return}if(!t){p();return}let r=[];e.pid!==void 0&&r.push(`pid=${encodeURIComponent(String(e.pid))}`),e.connectionId&&r.push(`connectionId=${encodeURIComponent(e.connectionId)}`),e.connectionId&&e.displayName!==void 0&&e.clientName!==void 0&&e.colorSeed!==void 0&&(r.push(`displayName=${encodeURIComponent(e.displayName)}`),r.push(`clientName=${encodeURIComponent(e.clientName)}`),r.push(`colorSeed=${encodeURIComponent(e.colorSeed)}`));let i=r.length>0?`?${r.join(`&`)}`:``,o=`${t}/collab/keepalive${i}`;try{c=a(o)}catch(e){f(`warn`,`WebSocket constructor failed`,{url:o,error:String(e)}),c=null,p();return}c.addEventListener(`open`,()=>{f(`info`,`connected`,{url:t}),d=n}),c.addEventListener(`close`,()=>{u||(f(`info`,`disconnected`,{url:t}),c=null,p())}),c.addEventListener(`error`,()=>{f(`debug`,`websocket error observed`,{url:t,readyState:c?.readyState,reason:`error-event`})})}return queueMicrotask(()=>{m().catch(e=>f(`warn`,`initial connect failed`,{error:String(e)}))}),{close:()=>{if(!u&&(u=!0,l!==null&&(t.clearTimeout(l),l=null),c)){try{c.close()}catch{}c=null}},isConnected:()=>c!==null&&c.readyState===1}}function WQ(e){if(e)return e.replace(/\/collab\/?$/,``)}function GQ(){return H(window)!==null}function KQ(e,t){let n=(0,$.c)(5),r=(0,Q.useRef)(e),i=(0,Q.useRef)(t),a,o;n[0]===e?(a=n[1],o=n[2]):(a=()=>{r.current=e},o=[e],n[0]=e,n[1]=a,n[2]=o),(0,Q.useEffect)(a,o);let s,c;n[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{let e=i.current?.startKeepalive??UQ;if((i.current?.isElectronHost??GQ)())return;let t=e({resolveWsUrl:async()=>WQ(r.current)});return()=>t.close()},c=[],n[3]=s,n[4]=c):(s=n[3],c=n[4]),(0,Q.useEffect)(s,c)}var qQ=(0,Q.lazy)(()=>n(()=>import(`./ShareBranchSwitchDialog-BlhZ6hTx.js`).then(e=>({default:e.ShareBranchSwitchDialog})),__vite__mapDeps([106,1,6,7,13,61,15,16,62,69,71,107,108,109,110,10,3,11]),import.meta.url)),JQ=(0,Q.lazy)(()=>n(()=>import(`./ShareReceiveMissDialog-D6rKf26E.js`).then(e=>({default:e.ShareReceiveMissDialog})),__vite__mapDeps([111,1,61,6,7,15,13,16,62,112,86,10,3,11,55,40,56,68,35,31,64,57,70,71,107,88,39,34,42]),import.meta.url)),YQ=`#install-claude-desktop`,XQ=/\.(md|mdx)$/i;function ZQ(e){return e===`#settings`||e===YQ}function QQ(e,t){if(!XQ.test(e))return null;for(let n of t){let t=Ve(n);if(t.kind===`doc`&&t.docName===e)return{kind:`doc`,target:e,docName:e}}return null}function $Q(e,t,n,r){return[e,t,n,r].map(e=>[...e].sort().join(`\0`)).join(``)}function e$(){let e=(0,$.c)(26),{clearTarget:t,openTabs:n,syncOpenTabsWithKnownTargets:r,tabSessionLoaded:i}=Xe(),{openTargetTransition:a}=ot();RQ();let{assetPaths:o,filePaths:s,folderPaths:c,loading:l,pageMeta:u,pages:d,pagesBySlug:f,pagesByBasename:p}=aa(),m=(0,Q.useRef)(null),h;e[0]!==o||e[1]!==s||e[2]!==c||e[3]!==d?(h=$Q(d,c,o,s),e[0]=o,e[1]=s,e[2]=c,e[3]=d,e[4]=h):h=e[4];let g=h,_,v;e[5]!==o||e[6]!==s||e[7]!==c||e[8]!==l||e[9]!==d||e[10]!==r||e[11]!==i||e[12]!==g?(_=()=>{l||!i||m.current===g||(m.current=g,r({pages:d,folderPaths:c,assetPaths:o,filePaths:s}))},v=[o,s,c,l,d,r,i,g],e[5]=o,e[6]=s,e[7]=c,e[8]=l,e[9]=d,e[10]=r,e[11]=i,e[12]=g,e[13]=_,e[14]=v):(_=e[13],v=e[14]),(0,Q.useEffect)(_,v);let y,b;return e[15]!==t||e[16]!==c||e[17]!==l||e[18]!==n||e[19]!==a||e[20]!==u||e[21]!==d||e[22]!==p||e[23]!==f?(y=()=>{e();function e(){if(ZQ(window.location.hash))return;let e=kl(window.location.hash);if(e){let t=wr(e.split(`.`).pop()??``);bl(`ok/nav/hash-change`,{docName:null,kind:`asset`}),a({kind:`asset`,target:e,assetPath:e,mediaKind:t});return}let r=El(window.location.hash);if(r){bl(`ok/nav/hash-change`,{docName:null,kind:`skill-file`}),a({kind:`skill-file`,target:`${r.scope}/${r.name}/${r.path}`,scope:r.scope,name:r.name,path:r.path});return}if(Pl(window.location.hash)){bl(`ok/nav/hash-change`,{docName:null,kind:`folder`}),a({kind:`folder`,target:``,folderPath:``});return}let i=jl(window.location.hash);if(!i){bl(`ok/nav/hash-change`,{docName:null,kind:`clear`}),t();return}if(l){bl(`ok/nav/hash-change`,{docName:i,kind:`deferred-loading`});return}let o=QQ(i,n)??sl(i,{pages:d,folderPaths:c,pagesBySlug:f,pagesByBasename:p});if(o.kind===`missing`&&/\/+$/.test(i.trim())){bl(`ok/nav/hash-change`,{docName:i,kind:`deferred-missing-folder`});return}let s=ll(cl(o),u);bl(`ok/nav/hash-change`,{docName:i,kind:s.kind}),a(s)}return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},b=[t,c,l,a,n,u,d,f,p],e[15]=t,e[16]=c,e[17]=l,e[18]=n,e[19]=a,e[20]=u,e[21]=d,e[22]=p,e[23]=f,e[24]=y,e[25]=b):(y=e[24],b=e[25]),(0,Q.useEffect)(y,b),null}function t$(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0],(0,Q.useEffect)(n$,t),null}function n$(){let e=function(e){let t=e.target;$a({target:t,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,key:e.key})&&(e.preventDefault(),window.location.hash!==`#settings`&&(window.location.hash=Za))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)}function r$(){let e=(0,$.c)(4),{activeTarget:t}=Xe(),n=typeof window<`u`?window.okDesktop??null:null,r=t?.kind===`doc`||t?.kind===`folder`||t?.kind===`asset`?t.kind:null,i=t?.kind===`doc`?t.docName:t?.kind===`folder`?t.folderPath:t?.kind===`asset`?t.assetPath:null,a,o;return e[0]!==i||e[1]!==r?(a=()=>{if(n){if(r===null){n.editor.notifyActiveTargetChanged({kind:null});return}i!==null&&n.editor.notifyActiveTargetChanged({kind:r,identifier:i})}},o=[n,r,i],e[0]=i,e[1]=r,e[2]=a,e[3]=o):(a=e[2],o=e[3]),(0,Q.useEffect)(a,o),null}function i$(){let e=(0,$.c)(8),{activeDocName:t,activeTarget:n}=Xe(),[r,i]=(0,Q.useState)(!1),a;e[0]!==t||e[1]!==n?(a=n?.kind===`folder`?n.folderPath:nl(t),e[0]=t,e[1]=n,e[2]=a):a=e[2];let o=a,s,c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{let e=function(e){let t=e.target;Th({target:t,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,key:e.key})&&(e.preventDefault(),i(!0))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},c=[],e[3]=s,e[4]=c):(s=e[3],c=e[4]),(0,Q.useEffect)(s,c);let l;return e[5]!==r||e[6]!==o?(l=(0,Z.jsx)(Dh,{open:r,onOpenChange:i,kind:`file`,initialDir:o}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function a$(e){let t=(0,$.c)(3),{children:n}=e,{collabUrl:r}=Xe();KQ(r);let i;return t[0]!==n||t[1]!==r?(i=(0,Z.jsx)(Ul,{collabUrl:r,children:n}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function o$(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(xl,{name:`app`,children:(0,Z.jsx)(ft,{children:(0,Z.jsx)(a$,{children:(0,Z.jsx)(bg,{children:(0,Z.jsx)(s$,{})})})})}),e[0]=t):t=e[0],t}function s$(){let e=(0,$.c)(28),t=typeof window<`u`?window.okDesktop??null:null,n=typeof window<`u`&&window.okDesktop!=null,[r,i]=(0,Q.useState)(!1),a=Cg(),o=d_(),s;e[0]===o?s=e[1]:(s=t?{launchInTerminal:c$,installedClis:o}:null,e[0]=o,e[1]=s);let c=s,l;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(Xg,{}),e[2]=l):l=e[2];let u,d,f,p;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(kQ,{}),d=(0,Z.jsx)(e$,{}),f=(0,Z.jsx)(r$,{}),p=(0,Z.jsx)(i$,{}),e[3]=u,e[4]=d,e[5]=f,e[6]=p):(u=e[3],d=e[4],f=e[5],p=e[6]);let m;e[7]===a?m=e[8]:(m=!a&&(0,Z.jsx)(t$,{}),e[7]=a,e[8]=m);let h,g,_,v;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(g=!1,_=t?(0,Z.jsx)(Zg,{bridge:t}):null,v=(0,Z.jsx)(EQ,{}),h=t?(0,Z.jsxs)(Q.Suspense,{fallback:null,children:[(0,Z.jsx)(qQ,{bridge:t}),(0,Z.jsx)(JQ,{})]}):null,e[9]=h,e[10]=g,e[11]=_,e[12]=v):(h=e[9],g=e[10],_=e[11],v=e[12]);let y;e[13]===r?y=e[14]:(y=(0,Z.jsx)(zg,{bridge:t,open:r,onOpenChange:i}),e[13]=r,e[14]=y);let b;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(b=n&&(0,Z.jsx)(`div`,{"aria-hidden":`true`,"data-testid":`editor-window-chrome-drag-strip`,"data-electron-drag":``,className:`pointer-events-none fixed inset-x-0 top-0 z-50 h-2 [-webkit-app-region:drag]`}),e[15]=b):b=e[15];let x;e[16]===a?x=e[17]:(x=!a&&(0,Z.jsx)(gQ,{onOpenSearch:()=>i(!0)}),e[16]=a,e[17]=x);let S;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(oM,{className:`overflow-hidden h-[calc(100vh-var(--layout-inset-offset))]`,children:(0,Z.jsx)(GI,{onOpenSearch:()=>i(!0)})}),e[18]=S):S=e[18];let C;e[19]===x?C=e[20]:(C=(0,Z.jsxs)(eM,{className:`h-screen overflow-hidden`,children:[x,S]}),e[19]=x,e[20]=C);let w;e[21]!==C||e[22]!==c?(w=(0,Z.jsx)(Oa,{value:c,children:C}),e[21]=C,e[22]=c,e[23]=w):w=e[23];let T;return e[24]!==y||e[25]!==w||e[26]!==m?(T=(0,Z.jsxs)(Z.Fragment,{children:[l,(0,Z.jsxs)(oa,{children:[u,d,f,p,m,g,_,v,h,y,b,w]})]}),e[24]=y,e[25]=w,e[26]=m,e[27]=T):T=e[27],T}function c$(e,t){lI(da(e,t),t)}function l$(e){let t=/\/([^/]+?)(?:\.git)?\/?$/.exec(e);return t?t[1]:`repo`}function u$(e){return{async getAuthStatus(){return e.authQueryTransport.status()},async startSignIn(){return e.openSignIn()},async runClone({url:t,branch:n}){let r=await e.bridge.dialog.openFolder();if(!r)return{kind:`cancelled`};let i=l$(t),a=`${r.replace(/\/$/,``)}/${i}`,o=_s.loading(qc._({id:`GXf9hG`,values:{repoName:i}}),{duration:1/0}),s=typeof n==`string`&&n.length>0?n:null;try{let n=e.cloneTransport.start({url:t,dir:a,branch:s});for await(let e of n.events){if(e.type===`progress`){let t=e.phase,n=Math.round(e.pct);_s.loading(qc._({id:`GXf9hG`,values:{repoName:i}}),{id:o,description:qc._({id:`SCzAbA`,values:{phase:t,pct:n}}),duration:1/0});continue}if(e.type===`branch-fallback`){console.log(dd({branch_action:`fallback`,branch:e.branch})),_s.info(qc._({id:`3JYy1p`,values:{0:e.branch}}),{duration:8e3});continue}if(e.type===`complete`)return _s.success(qc._({id:`IRv9cH`,values:{repoName:i}}),{id:o,duration:4e3}),{kind:`ok`,dir:e.dir};if(e.type===`error`)return _s.dismiss(o),{kind:`error`,detail:e.message}}return _s.dismiss(o),{kind:`error`,detail:`Clone ended unexpectedly.`}}catch(e){console.warn(`[clone-controller] clone transport threw`,e);let t=e instanceof Error?e.message:`Unknown error`;return _s.dismiss(o),{kind:`error`,detail:t}}}}}function d$(){return{start(e){return Va((t,n)=>{(async()=>{try{let r=await fetch(`/api/local-op/clone`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({url:e.url,dir:e.dir||void 0,branch:typeof e.branch==`string`&&e.branch.length>0?e.branch:void 0}),signal:n});if(!r.ok){let e=`Clone failed — check the URL and try again (${r.status})`;try{let t=await r.json(),n=or.safeParse(t);n.success&&(e=`Clone failed: ${n.data.title}`)}catch{}t({type:`error`,message:e});return}if(!r.body){t({type:`error`,message:`Clone failed — empty response body`});return}let i=r.body.getReader(),a=new TextDecoder,o=``;for(;;){let{done:e,value:r}=await i.read();if(e)break;o+=a.decode(r,{stream:!0});let s=o.split(`
2003
2003
  `);o=s.pop()??``;for(let e of s){if(!e.trim())continue;let n;try{n=JSON.parse(e)}catch{console.warn(`[clone-transport] Dropped unparseable NDJSON line:`,e.slice(0,100));continue}if(n&&typeof n==`object`&&n.type===`error`&&`problem`in n){let e=n.problem;t({type:`error`,message:e?.detail||e?.title||`Unknown error`});break}t(n)}if(n.aborted)break}n.aborted||t({type:`error`,message:`Clone stream ended unexpectedly — check if the clone completed`})}catch(e){if(e instanceof Error&&e.name===`AbortError`)return;t({type:`error`,message:`Clone failed — connection error`})}})()})}}}function f$(e){return{start(t){let n=typeof t.branch==`string`&&t.branch.length>0?t.branch:null;return e.localOp.clone.start({url:t.url,dir:t.dir,branch:n})}}}function p$(e){switch(e){case`receiving`:return{id:`qbfj1f`};case`resolving`:return{id:`adsMWO`};case`checking`:return{id:`1HBhDS`};case`init`:return{id:`LlHqdU`};case`done`:return{id:`bD8I7O`};default:return{id:`25Pw6a`}}}function m$(e){let t=e.trim();if(/^[\w.-]+\/[\w.-]+$/.test(t))return t.split(`/`)[1];try{return new URL(t.replace(/^git@([^:]+):/,`https://$1/`)).pathname.replace(/\.git$/,``).split(`/`).pop()??`repo`}catch{return t.split(`/`).pop()?.replace(/\.git$/,``)??`repo`}}function h$(e){let t=(0,$.c)(100),{open:n,onOpenChange:r,onSignIn:i,onCloneComplete:a,transport:o,authQueryTransport:s,pickParentFolder:c,initialUrl:l}=e,{_:u}=At(),d;t[0]===o?d=t[1]:(d=o??d$(),t[0]=o,t[1]=d);let f=d,p;t[2]===s?p=t[3]:(p=s??_o(),t[2]=s,t[3]=p);let m=p,h=c!==void 0,[g,_]=(0,Q.useState)(``),[v,y]=(0,Q.useState)(``),[b,x]=(0,Q.useState)(null),[S,C]=(0,Q.useState)(!1),T;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(T=xo(),t[4]=T):T=t[4];let[E,D]=(0,Q.useState)(T),[O,k]=(0,Q.useState)(!1),[A,j]=(0,Q.useState)(!1),[M,N]=(0,Q.useState)(-1),P=(0,Q.useRef)(null),F=(0,Q.useRef)(null),I=(0,Q.useRef)(null),L=(0,Q.useId)(),R;t[5]!==n||t[6]!==m?(R=()=>{if(!n)return;let e=!1;return m.status().then(t=>{mo(t.authenticated),e||D(t.authenticated)}).catch(()=>{e||D(!1)}),()=>{e=!0}},t[5]=n,t[6]=m,t[7]=R):R=t[7];let z;t[8]===n?z=t[9]:(z=[n],t[8]=n,t[9]=z),(0,Q.useEffect)(R,z);let B;t[10]!==E||t[11]!==n||t[12]!==m?(B=()=>{if(!E||!n)return;let e=!1;return C(!0),m.repos().then(t=>{e||(x(t.ok?t.repos:[]),C(!1))}).catch(()=>{e||(x([]),C(!1))}),()=>{e=!0}},t[10]=E,t[11]=n,t[12]=m,t[13]=B):B=t[13];let V;t[14]!==E||t[15]!==n?(V=[E,n],t[14]=E,t[15]=n,t[16]=V):V=t[16],(0,Q.useEffect)(B,V);let H,U;t[17]!==l||t[18]!==n||t[19]!==h?(H=()=>{if(!n||!l||(_(l),h))return;let e=m$(l);e&&y(`~/Documents/${e}`)},U=[n,l,h],t[17]=l,t[18]=n,t[19]=h,t[20]=H,t[21]=U):(H=t[20],U=t[21]),(0,Q.useEffect)(H,U);let W,G;t[22]!==M||t[23]!==L?(W=()=>{M<0||document.getElementById(`${L}-opt-${M}`)?.scrollIntoView({block:`nearest`})},G=[M,L],t[22]=M,t[23]=L,t[24]=W,t[25]=G):(W=t[24],G=t[25]),(0,Q.useEffect)(W,G);let ee;t[26]===h?ee=t[27]:(ee=function(e){if(_(e),j(!0),N(-1),h)return;let t=m$(e);t&&y(`~/Documents/${t}`)},t[26]=h,t[27]=ee);let te=ee,K;t[28]===h?K=t[29]:(K=function(e){if(_(e.clone_url),h)return;let t=e.full_name.split(`/`)[1];y(`~/Documents/${t}`)},t[28]=h,t[29]=K);let ne=K,re;t[30]!==u||t[31]!==v||t[32]!==a||t[33]!==r||t[34]!==c||t[35]!==f||t[36]!==g?(re=async function(){let e=g.trim();if(!e){_s.error(u({id:`FTUGgh`}));return}let t=v||``;if(c){k(!0);let n=await c();if(!n){k(!1);return}let r=m$(e);t=`${n.replace(/\/$/,``)}/${r}`}else k(!0);let n=_s.loading(u({id:`2tgFCe`}),{duration:1/0});F.current=n;let i=f.start({url:e,dir:t});P.current=i.cancel;try{let e=i.events[Symbol.asyncIterator](),t=await e.next();for(;!t.done;){let i=t.value;if(i.type===`progress`){let e=u(p$(i.phase));_s.loading(`${e} — ${i.pct}%`,{id:n})}else if(i.type===`complete`){_s.success(u({id:`u_lS4C`}),{id:n}),r(!1),k(!1),P.current=null;let e=`port`in i?i.port:void 0;a?a({port:e,dir:i.dir}):e!==void 0&&(window.location.href=`http://localhost:${e}`);return}else if(i.type===`error`){let e=i.message;_s.error(u({id:`eFJkVt`,values:{cloneError:e}}),{id:n}),k(!1),P.current=null;return}t=await e.next()}_s.error(u({id:`Tz9pJB`}),{id:n}),k(!1),P.current=null}catch(e){console.error(`[CloneDialog] clone iteration failed:`,e),_s.error(u({id:`K9J00P`}),{id:n}),k(!1),P.current=null}},t[30]=u,t[31]=v,t[32]=a,t[33]=r,t[34]=c,t[35]=f,t[36]=g,t[37]=re):re=t[37];let ie=re,ae;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(ae=function(){P.current?.(),P.current=null,k(!1),_s.dismiss(F.current??void 0)},t[38]=ae):ae=t[38];let se=ae,ce;t[39]!==O||t[40]!==r||t[41]!==h?(ce=function(e){O||(r(e),e||(_(``),h||y(``),j(!1),N(-1)))},t[39]=O,t[40]=r,t[41]=h,t[42]=ce):ce=t[42];let le=ce,ue;t[43]===ne?ue=t[44]:(ue=function(e){ne(e),j(!1),N(-1),I.current?.focus()},t[43]=ne,t[44]=ue);let de=ue,fe=E===null||S&&b===null,pe;if(t[45]!==b||t[46]!==g){let e=g.trim().toLowerCase(),n;t[48]===b?n=t[49]:(n=b??[],t[48]=b,t[49]=n),pe=n.filter(t=>`${t.full_name} ${t.clone_url}`.toLowerCase().includes(e)),t[45]=b,t[46]=g,t[47]=pe}else pe=t[47];let me=pe,he;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(he=/:\/\/|^git@|\.git$/i,t[50]=he):he=t[50];let ge;t[51]===g?ge=t[52]:(ge=he.test(g.trim()),t[51]=g,t[52]=ge);let _e=ge,ve=E===!0&&b!==null&&me.length===0&&!_e,ye=A&&E!==!1&&!O&&(fe||me.length>0||ve),be=me.length,xe=`${L}-loading`,Se,Ce;t[53]===be?(Se=t[54],Ce=t[55]):(Se=()=>{N(e=>e>=be?be-1:e)},Ce=[be],t[53]=be,t[54]=Se,t[55]=Ce),(0,Q.useEffect)(Se,Ce);let we;t[56]!==M||t[57]!==O||t[58]!==ye||t[59]!==de||t[60]!==me?(we=function(e){if(!O)if(e.key===`ArrowDown`){if(e.preventDefault(),!ye){j(!0);return}N(e=>Math.min(e+1,me.length-1))}else e.key===`ArrowUp`?(e.preventDefault(),N(x$)):e.key===`Enter`?ye&&M>=0&&M<me.length&&(e.preventDefault(),de(me[M])):e.key===`Escape`&&ye&&(e.preventDefault(),e.stopPropagation(),j(!1),N(-1))},t[56]=M,t[57]=O,t[58]=ye,t[59]=de,t[60]=me,t[61]=we):we=t[61];let Te=we,Ee;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=(0,Z.jsx)(Bs,{children:(0,Z.jsx)(Is,{children:(0,Z.jsx)(J,{id:`VdXv4D`})})}),t[62]=Ee):Ee=t[62];let De;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(De=(0,Z.jsx)(`label`,{htmlFor:`clone-source`,className:`text-sm font-medium`,children:(0,Z.jsx)(J,{id:`IreQBq`})}),t[63]=De):De=t[63];let Oe;t[64]!==u||t[65]!==M||t[66]!==O||t[67]!==Te||t[68]!==te||t[69]!==E||t[70]!==L||t[71]!==xe||t[72]!==i||t[73]!==ye||t[74]!==fe||t[75]!==b||t[76]!==de||t[77]!==me||t[78]!==g?(Oe=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[De,E===!1?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Gc,{id:`clone-source`,placeholder:u({id:`Xv_ijG`}),value:g,onChange:e=>te(e.target.value),disabled:O}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 text-1sm text-muted-foreground`,children:[(0,Z.jsx)(`span`,{children:(0,Z.jsx)(J,{id:`9oE4C3`})}),(0,Z.jsx)(X,{variant:`link`,className:`h-auto p-0`,onClick:()=>i?.(),disabled:O,children:(0,Z.jsx)(J,{id:`3jod3l`})})]})]}):(0,Z.jsxs)(oe,{open:ye,onOpenChange:j,children:[(0,Z.jsx)(w,{asChild:!0,children:(0,Z.jsx)(Gc,{id:`clone-source`,ref:I,role:`combobox`,"aria-expanded":ye,"aria-controls":ye?fe?xe:L:void 0,"aria-activedescendant":M>=0?`${L}-opt-${M}`:void 0,"aria-autocomplete":`list`,autoComplete:`off`,placeholder:u({id:`R0jJzV`}),value:g,onChange:e=>te(e.target.value),onFocus:()=>j(!0),onKeyDown:Te,disabled:O})}),(0,Z.jsx)(q,{align:`start`,sideOffset:4,className:`w-(--radix-popover-trigger-width) max-h-56 overflow-y-auto overscroll-y-contain subtle-scrollbar p-0`,onOpenAutoFocus:b$,onCloseAutoFocus:y$,onInteractOutside:e=>{I.current?.contains(e.target)&&e.preventDefault()},onWheel:v$,onTouchMove:_$,children:fe?(0,Z.jsxs)(`output`,{id:xe,className:`flex flex-col gap-1.5 px-3 py-2`,"aria-label":u({id:`8XQRON`}),children:[(0,Z.jsx)(Ja,{className:`h-4 w-2/3`}),(0,Z.jsx)(Ja,{className:`h-4 w-1/2`}),(0,Z.jsx)(Ja,{className:`h-4 w-3/4`}),(0,Z.jsx)(Ja,{className:`h-4 w-2/5`})]}):(0,Z.jsx)(`div`,{id:L,role:`listbox`,"aria-label":u({id:`KX1MZR`}),className:`py-1`,children:me.length===0?(0,Z.jsx)(`div`,{role:`presentation`,className:`px-3 py-2 text-xs text-muted-foreground`,children:b&&b.length===0?(0,Z.jsx)(J,{id:`cOSAfL`}):(0,Z.jsx)(J,{id:`8eW0WQ`})}):me.map((e,t)=>(0,Z.jsxs)(`div`,{id:`${L}-opt-${t}`,role:`option`,tabIndex:-1,"aria-selected":t===M,onMouseDown:g$,onMouseEnter:()=>N(t),onClick:()=>de(e),className:Y(`flex cursor-default items-center gap-2 px-3 py-1.5 text-sm`,t===M&&`bg-accent text-accent-foreground`),children:[e.private?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(pf,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(J,{id:`n5n_vi`})})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ia,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(J,{id:`NuH1jp`})})]}),(0,Z.jsx)(`span`,{className:`truncate`,children:e.full_name})]},e.full_name))})})]})]}),t[64]=u,t[65]=M,t[66]=O,t[67]=Te,t[68]=te,t[69]=E,t[70]=L,t[71]=xe,t[72]=i,t[73]=ye,t[74]=fe,t[75]=b,t[76]=de,t[77]=me,t[78]=g,t[79]=Oe):Oe=t[79];let ke;t[80]!==O||t[81]!==v||t[82]!==h?(ke=!h&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`label`,{htmlFor:`clone-path`,className:`text-sm font-medium`,children:(0,Z.jsx)(J,{id:`Gp_twO`})}),(0,Z.jsx)(Gc,{id:`clone-path`,placeholder:`~/Documents/repo-name`,value:v,onChange:e=>y(e.target.value),disabled:O})]}),t[80]=O,t[81]=v,t[82]=h,t[83]=ke):ke=t[83];let Ae;t[84]!==Oe||t[85]!==ke?(Ae=(0,Z.jsx)(Rs,{children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[Oe,ke]})}),t[84]=Oe,t[85]=ke,t[86]=Ae):Ae=t[86];let je;t[87]!==O||t[88]!==ie||t[89]!==le||t[90]!==g||t[91]!==h?(je=(0,Z.jsx)(zs,{children:O?(0,Z.jsx)(X,{variant:`outline`,className:`font-mono uppercase`,onClick:se,children:(0,Z.jsx)(J,{id:`dEgA5A`})}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(X,{variant:`outline`,className:`font-mono uppercase`,onClick:()=>le(!1),children:(0,Z.jsx)(J,{id:`dEgA5A`})}),(0,Z.jsx)(X,{onClick:()=>void ie(),disabled:!g.trim(),"aria-describedby":h?`clone-picker-hint`:void 0,children:(0,Z.jsx)(J,{id:`9UQ730`})}),h&&(0,Z.jsx)(`span`,{id:`clone-picker-hint`,className:`sr-only`,children:(0,Z.jsx)(J,{id:`EvPX7f`})})]})}),t[87]=O,t[88]=ie,t[89]=le,t[90]=g,t[91]=h,t[92]=je):je=t[92];let Me;t[93]!==Ae||t[94]!==je?(Me=(0,Z.jsxs)(Ls,{className:`sm:max-w-lg`,children:[Ee,Ae,je]}),t[93]=Ae,t[94]=je,t[95]=Me):Me=t[95];let Ne;return t[96]!==le||t[97]!==n||t[98]!==Me?(Ne=(0,Z.jsx)(Vs,{open:n,onOpenChange:le,children:Me}),t[96]=le,t[97]=n,t[98]=Me,t[99]=Ne):Ne=t[99],Ne}function g$(e){return e.preventDefault()}function _$(e){return e.stopPropagation()}function v$(e){return e.stopPropagation()}function y$(e){return e.preventDefault()}function b$(e){return e.preventDefault()}function x$(e){return Math.max(e-1,-1)}var S$=(0,Q.lazy)(()=>n(()=>import(`./ConsentDialogBody-BuKqWdML.js`),__vite__mapDeps([113,1,6,7,81,20,21,15,13,16,63,64,60,61,62,66,114,83,84,17,18,19,70,73,89]),import.meta.url));function C$(){let e=(0,$.c)(1);if(!(0,Q.useSyncExternalStore)(Wc.subscribe,T$,w$))return null;let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(S$,{})}),e[0]=t):t=e[0],t}function w$(){return!1}function T$(){return Wc.getSnapshot()!==null}function E$(e){let t=(0,$.c)(5),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`OpenKnowledge icon`}),t[0]=n):n=t[0];let r;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsxs)(`g`,{filter:`url(#filter0_d_ok)`,children:[(0,Z.jsx)(`path`,{d:`M66.8902 16.1017C58.2694 3.86669 46.1739 -0.690239 29.9182 2.17749C21.3995 3.67813 13.4602 9.555 8.67934 17.9009C3.93974 26.1701 2.98514 35.6533 6.05714 43.9166C9.31574 52.6868 16.7168 58.4752 24.2299 63.4231C25.7973 64.4562 26.1351 65.7172 26.3551 68.9896C26.5221 71.4625 26.799 75.6011 30.6842 77.7204C31.8176 78.3372 33.0648 78.6515 34.3946 78.6515C37.0796 78.6515 39.4033 77.3649 40.5189 76.7482C47.1049 73.1046 68.8878 59.7147 72.6453 40.4027C74.3444 31.6679 70.9797 21.9019 66.8922 16.1017H66.8902Z`,fill:`white`}),(0,Z.jsx)(`path`,{d:`M37.4214 71.154C28.7888 75.929 36.787 64.0397 27.7458 58.0843C21.6372 54.0616 14.788 49.0568 12.0499 41.6911C6.74463 27.4192 17.5438 10.8473 31.028 8.47262C45.1977 5.97613 54.6946 9.8947 61.6635 19.7844C65.2089 24.8167 67.6013 32.8365 66.3658 39.1828C63.6906 52.9341 49.073 64.7075 37.4214 71.154Z`,fill:`#69A3FF`}),(0,Z.jsx)(`path`,{d:`M52.7244 29.2638C53.4665 28.5217 54.6697 28.5217 55.4119 29.2638V29.2638C56.154 30.0059 56.154 31.2091 55.4119 31.9513L49.2589 38.1042L46.5715 35.4167L52.7244 29.2638Z`,fill:`#D5E5FF`}),(0,Z.jsx)(`path`,{d:`M55.4119 38.8821C56.154 39.6242 56.154 40.8274 55.4119 41.5696V41.5696C54.6698 42.3117 53.4665 42.3117 52.7244 41.5696L46.5715 35.4166L49.259 32.7292L55.4119 38.8821Z`,fill:`#D5E5FF`})]}),t[1]=r):r=t[1];let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(`defs`,{children:(0,Z.jsxs)(`filter`,{id:`filter0_d_ok`,x:`-9.53674e-07`,y:`-0.0799994`,width:`77.3817`,height:`85.8743`,filterUnits:`userSpaceOnUse`,colorInterpolationFilters:`sRGB`,children:[(0,Z.jsx)(`feFlood`,{floodOpacity:`0`,result:`BackgroundImageFix`}),(0,Z.jsx)(`feColorMatrix`,{in:`SourceAlpha`,type:`matrix`,values:`0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0`,result:`hardAlpha`}),(0,Z.jsx)(`feOffset`,{dy:`2.85714`}),(0,Z.jsx)(`feGaussianBlur`,{stdDeviation:`2.14286`}),(0,Z.jsx)(`feComposite`,{in2:`hardAlpha`,operator:`out`}),(0,Z.jsx)(`feColorMatrix`,{type:`matrix`,values:`0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0`}),(0,Z.jsx)(`feBlend`,{mode:`normal`,in2:`BackgroundImageFix`,result:`effect1_dropShadow_ok`}),(0,Z.jsx)(`feBlend`,{mode:`normal`,in:`SourceGraphic`,in2:`effect1_dropShadow_ok`,result:`shape`})]})}),t[2]=i):i=t[2];let a;return t[3]===e?a=t[4]:(a=(0,Z.jsxs)(`svg`,{role:`img`,"aria-label":`OpenKnowledge icon`,fill:`none`,height:24,width:24,viewBox:`0 0 78 80`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[n,r,i]}),t[3]=e,t[4]=a),a}var D$=(0,Q.lazy)(()=>n(()=>import(`./ShareReceiveDialog-L3wJj8ez.js`).then(e=>({default:e.ShareReceiveDialog})),__vite__mapDeps([115,1,10,3,11,6,7,13,61,15,16,62,71,108,109,110]),import.meta.url)),O$=(e,t,n)=>_g(e,t,n,`NavigatorApp`);function k$(e,t){return e.filter(e=>e.path!==t)}function A$(e){let t=(0,$.c)(106),{bridge:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],t[0]=r):r=t[0];let[i,a]=(0,Q.useState)(r),o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=new Map,t[1]=o):o=t[1];let[s,c]=(0,Q.useState)(o),[l,u]=(0,Q.useState)(!0),[d,f]=(0,Q.useState)(!1),[p,m]=(0,Q.useState)(null),[h,g]=(0,Q.useState)(null),[_,v]=(0,Q.useState)(!1),[y,b]=(0,Q.useState)(!1),[x,S]=(0,Q.useState)(void 0),[C,w]=(0,Q.useState)(void 0),[T,E]=(0,Q.useState)(!1),[D,O]=(0,Q.useState)(!1),[k,A]=(0,Q.useState)(null),j=typeof window<`u`&&window.okDesktop!=null,[M,N]=(0,Q.useState)(`auth`),{theme:P}=ln(),{_:F}=At();Hl(n,P??`system`);let I;t[2]!==F||t[3]!==n.project?(I=()=>{let e=!1;return n.project.listRecent().then(async t=>{if(e)return;a(t);let r=t.filter(j$),i=await Promise.all(r.map(async e=>{try{let{currentBranch:t}=await n.project.readHeadBranch(e.path);return[e.path,t]}catch{return[e.path,null]}}));e||c(e=>{let t=new Map(e);for(let[e,n]of i)t.set(e,n);return t})}).catch(t=>{console.error(`[NavigatorApp] listRecent failed:`,t),e||(m(t instanceof Error?t.message:F({id:`fYKgzG`})),f(!0))}).finally(()=>{e||u(!1)}),()=>{e=!0}},t[2]=F,t[3]=n.project,t[4]=I):I=t[4];let L;t[5]!==F||t[6]!==n?(L=[n,F],t[5]=F,t[6]=n,t[7]=L):L=t[7],(0,Q.useEffect)(I,L);let R,z;t[8]===n?(R=t[9],z=t[10]):(R=()=>n.onMenuAction(e=>{e===`new-project`&&b(!0),e===`close-active-tab-or-window`&&window.close()}),z=[n],t[8]=n,t[9]=R,t[10]=z),(0,Q.useEffect)(R,z);let B;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(B=(e,t)=>O$(e,t,m),t[11]=B):B=t[11];let V=B,H;t[12]!==F||t[13]!==n?(H=(e,t,r)=>V(()=>(g(r),F$(n,e,t).finally(()=>g(null))),F({id:`SUOoXn`})),t[12]=F,t[13]=n,t[14]=H):H=t[14];let U=H,W;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(W=()=>v(!0),t[15]=W):W=t[15];let G=W,ee;t[16]!==F||t[17]!==n?(ee=()=>V(async()=>{let e=await n.dialog.openFolder();e&&(g(I$(e)),await F$(n,e,`pick-existing`).finally(()=>g(null)))},F({id:`gmJ0An`})),t[16]=F,t[17]=n,t[18]=ee):ee=t[18];let te=ee,K;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(K=()=>b(!0),t[19]=K):K=t[19];let ne=K,re;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(re=(e,t)=>{S(e),w(t),b(!0)},t[20]=re):re=t[20];let ie=re,q;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(q=e=>{b(e),e||(S(void 0),w(void 0))},t[21]=q):q=t[21];let ae=q,oe;t[22]===U?oe=t[23]:(oe=e=>U(e,`recents`,I$(e)),t[22]=U,t[23]=oe);let se=oe,ce;t[24]!==F||t[25]!==n.project?(ce=e=>V(async()=>{await n.project.removeRecent(e),a(t=>k$(t,e)),c(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},F({id:`viwC-K`})),t[24]=F,t[25]=n.project,t[26]=ce):ce=t[26];let le=ce,ue;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(ue=(0,Z.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 top-0 z-10 h-9 ${j?`[-webkit-app-region:drag]`:``}`,"data-electron-drag":j?``:void 0,"data-testid":`nav-chrome-row`}),t[27]=ue):ue=t[27];let de;t[28]!==F||t[29]!==h?(de=h===null?null:(0,Z.jsxs)(`div`,{className:`absolute inset-0 z-20 flex flex-col items-center justify-center gap-3 bg-primary-foreground/85 dark:bg-background/85 backdrop-blur-sm`,"data-testid":`nav-opening-overlay`,role:`status`,"aria-live":`polite`,children:[(0,Z.jsx)(is,{className:`size-6 animate-spin text-muted-foreground`}),(0,Z.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:F({id:`s0_GnA`,values:{openingLabel:h}})})]}),t[28]=F,t[29]=h,t[30]=de):de=t[30];let fe;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(fe=(0,Z.jsx)(E$,{className:`size-12 shrink-0`}),t[31]=fe):fe=t[31];let pe;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`h1`,{className:`font-medium text-xl tracking-tight`,children:`OpenKnowledge`}),(0,Z.jsx)(rP,{})]}),t[32]=pe):pe=t[32];let me;t[33]===n.appVersion?me=t[34]:(me=(0,Z.jsxs)(`header`,{className:`shrink-0 flex-wrap flex items-center gap-2.5`,children:[fe,(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[pe,(0,Z.jsxs)(`p`,{className:`text-muted-foreground text-xs font-mono`,children:[`v`,n.appVersion]})]})]}),t[33]=n.appVersion,t[34]=me);let he;t[35]!==F||t[36]!==l||t[37]!==te||t[38]!==i||t[39]!==d?(he=l?null:!d&&i.length===0?(0,Z.jsx)(N$,{onPackSelect:ie,onOpenFolder:te,onClone:G,onCreate:ne}):(0,Z.jsxs)(`section`,{className:`grid shrink-0 sm:grid-cols-3 gap-3`,children:[(0,Z.jsx)(M$,{title:F({id:`wbv9xO`}),description:F({id:`0uTHCg`}),onClick:ne,dataTestId:`nav-create-new`,Icon:rt}),(0,Z.jsx)(M$,{title:F({id:`WPwDin`}),description:F({id:`tUvUfp`}),onClick:te,dataTestId:`nav-open`,Icon:Bo}),(0,Z.jsx)(M$,{title:F({id:`VdXv4D`}),description:F({id:`JOcPqH`}),onClick:G,dataTestId:`nav-clone`,Icon:RF})]}),t[35]=F,t[36]=l,t[37]=te,t[38]=i,t[39]=d,t[40]=he):he=t[40];let ge;t[41]===p?ge=t[42]:(ge=p===null?null:(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between gap-3 rounded-md border border-red-500/30 bg-red-500/10 px-3 py-2`,"data-testid":`nav-error-banner`,role:`alert`,children:[(0,Z.jsx)(`span`,{className:`text-red-700 text-xs dark:text-red-300`,children:p}),(0,Z.jsx)(X,{type:`button`,variant:`link`,size:`sm`,onClick:()=>m(null),className:`h-auto p-0 text-red-700 text-xs dark:text-red-300`,"data-testid":`nav-error-dismiss`,children:(0,Z.jsx)(J,{id:`1QfxQT`})})]}),t[41]=p,t[42]=ge);let _e;t[43]!==l||t[44]!==se||t[45]!==le||t[46]!==s||t[47]!==i?(_e=l?(0,Z.jsx)(`section`,{className:`flex shrink-0 flex-col items-center`,children:(0,Z.jsx)(is,{className:`size-4 animate-spin text-muted-foreground/60`})}):i.length>0?(0,Z.jsxs)(`section`,{className:`flex min-h-0 flex-col`,children:[(0,Z.jsx)(`h2`,{className:`mb-2 shrink-0 font-medium text-muted-foreground font-mono text-xs uppercase tracking-wide`,children:(0,Z.jsx)(J,{id:`CCTop_`})}),(0,Z.jsx)(`ul`,{className:`min-h-0 max-h-48 subtle-scrollbar scroll-fade-mask overflow-y-auto space-y-0.5 -mx-4`,"data-testid":`nav-recent-list`,children:i.map(e=>(0,Z.jsx)(P$,{project:e,branch:s.get(e.path)??null,onOpen:()=>se(e.path),onRemove:()=>le(e.path)},e.path))})]}):null,t[43]=l,t[44]=se,t[45]=le,t[46]=s,t[47]=i,t[48]=_e):_e=t[48];let ve;t[49]!==me||t[50]!==he||t[51]!==ge||t[52]!==_e?(ve=(0,Z.jsx)(`div`,{className:`mx-auto flex h-full w-full max-w-5xl flex-col overflow-hidden px-12 py-12`,children:(0,Z.jsxs)(`div`,{className:`my-auto flex min-h-0 flex-col space-y-10`,children:[me,he,ge,_e]})}),t[49]=me,t[50]=he,t[51]=ge,t[52]=_e,t[53]=ve):ve=t[53];let ye,be;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(ye=(0,Z.jsx)(EQ,{}),be=(0,Z.jsx)(C$,{}),t[54]=ye,t[55]=be):(ye=t[54],be=t[55]);let xe;t[56]!==n||t[57]!==y||t[58]!==x||t[59]!==C?(xe=(0,Z.jsx)(Cm,{open:y,onOpenChange:ae,bridge:n,initialPackId:x,packs:C}),t[56]=n,t[57]=y,t[58]=x,t[59]=C,t[60]=xe):xe=t[60];let Se;t[61]===k?Se=t[62]:(Se=e=>{E(e),e||(O(!1),k&&(k(null),A(null)))},t[61]=k,t[62]=Se);let Ce;t[63]===n?Ce=t[64]:(Ce=La(n),t[63]=n,t[64]=Ce);let we;t[65]===n?we=t[66]:(we=Ba(n),t[65]=n,t[66]=we);let Te=M===`identity`,Ee;t[67]!==D||t[68]!==k?(Ee=e=>{E(!1),D&&(O(!1),v(!0)),k&&(k({authenticated:!0,host:`github.com`,login:e.login}),A(null))},t[67]=D,t[68]=k,t[69]=Ee):Ee=t[69];let De;t[70]!==T||t[71]!==Se||t[72]!==Ce||t[73]!==we||t[74]!==Te||t[75]!==Ee?(De=(0,Z.jsx)(Xa,{open:T,onOpenChange:Se,transport:Ce,queryTransport:we,identityPrompt:Te,onSuccess:Ee}),t[70]=T,t[71]=Se,t[72]=Ce,t[73]=we,t[74]=Te,t[75]=Ee,t[76]=De):De=t[76];let Oe;t[77]===n?Oe=t[78]:(Oe=f$(n),t[77]=n,t[78]=Oe);let ke;t[79]===n?ke=t[80]:(ke=Ba(n),t[79]=n,t[80]=ke);let Ae;t[81]===n.dialog?Ae=t[82]:(Ae=()=>n.dialog.openFolder(),t[81]=n.dialog,t[82]=Ae);let je;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(je=()=>{v(!1),N(`auth`),O(!0),E(!0)},t[83]=je):je=t[83];let Me;t[84]!==F||t[85]!==n?(Me=e=>{let{dir:t}=e;V(()=>(g(I$(t)),F$(n,t,`pick-existing`).finally(()=>g(null))),F({id:`iSnkwB`}))},t[84]=F,t[85]=n,t[86]=Me):Me=t[86];let Ne;t[87]!==_||t[88]!==Oe||t[89]!==ke||t[90]!==Ae||t[91]!==Me?(Ne=(0,Z.jsx)(h$,{open:_,onOpenChange:v,transport:Oe,authQueryTransport:ke,pickParentFolder:Ae,onSignIn:je,onCloneComplete:Me}),t[87]=_,t[88]=Oe,t[89]=ke,t[90]=Ae,t[91]=Me,t[92]=Ne):Ne=t[92];let Pe;if(t[93]!==n){let e;t[95]===Symbol.for(`react.memo_cache_sentinel`)?(e=()=>new Promise(e=>{A(()=>e),E(!0)}),t[95]=e):e=t[95],Pe=u$({bridge:n,authQueryTransport:Ba(n),cloneTransport:f$(n),openSignIn:e}),t[93]=n,t[94]=Pe}else Pe=t[94];let Fe;t[96]!==n||t[97]!==Pe?(Fe=(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(D$,{bridge:n,cloneController:Pe})}),t[96]=n,t[97]=Pe,t[98]=Fe):Fe=t[98];let Ie;return t[99]!==de||t[100]!==ve||t[101]!==xe||t[102]!==De||t[103]!==Ne||t[104]!==Fe?(Ie=(0,Z.jsxs)(`div`,{className:`relative flex h-screen w-screen flex-col overflow-hidden bg-primary-foreground dark:bg-background text-foreground`,children:[ue,de,ve,ye,be,xe,De,Ne,Fe]}),t[99]=de,t[100]=ve,t[101]=xe,t[102]=De,t[103]=Ne,t[104]=Fe,t[105]=Ie):Ie=t[105],Ie}function j$(e){return!e.missing}function M$(e){let t=(0,$.c)(14),{title:n,description:r,onClick:i,dataTestId:a,Icon:o}=e,s;t[0]===o?s=t[1]:(s=o?(0,Z.jsx)(o,{className:`size-4 shrink-0 text-muted-foreground`}):null,t[0]=o,t[1]=s);let c;t[2]===n?c=t[3]:(c=(0,Z.jsx)(`span`,{className:`font-medium text-gray-700 dark:text-foreground text-sm`,children:n}),t[2]=n,t[3]=c);let l;t[4]!==s||t[5]!==c?(l=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[s,c]}),t[4]=s,t[5]=c,t[6]=l):l=t[6];let u;t[7]===r?u=t[8]:(u=(0,Z.jsx)(`span`,{className:`line-clamp-2 text-muted-foreground text-xs leading-snug`,children:r}),t[7]=r,t[8]=u);let d;return t[9]!==a||t[10]!==i||t[11]!==l||t[12]!==u?(d=(0,Z.jsxs)(X,{type:`button`,variant:`outline`,onClick:i,"data-testid":a,className:`h-auto flex-col items-start justify-start gap-1.5 whitespace-normal bg-card px-4 py-3.5 text-left`,children:[l,u]}),t[9]=a,t[10]=i,t[11]=l,t[12]=u,t[13]=d):d=t[13],d}function N$(e){let t=(0,$.c)(31),{onPackSelect:n,onOpenFolder:r,onClone:i,onCreate:a}=e,[o,s]=(0,Q.useState)(null),c,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=!1;return(async()=>{try{let t=await Kh().listPacks();if(e)return;t.ok?s(t.packs):(console.error(`[NavigatorApp] listPacks returned error:`,t),s([]))}catch(t){let n=t;if(e)return;console.error(`[NavigatorApp] listPacks failed:`,n),s([])}})(),()=>{e=!0}},l=[],t[0]=c,t[1]=l):(c=t[0],l=t[1]),(0,Q.useEffect)(c,l);let u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(`h2`,{className:`text-xl font-light tracking-tighter text-balance`,children:(0,Z.jsx)(J,{id:`QnjpOq`})}),t[2]=u):u=t[2];let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-1`,children:[u,(0,Z.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:(0,Z.jsx)(J,{id:`gYuDfu`})})]}),t[3]=d):d=t[3];let f;t[4]!==n||t[5]!==o?(f=e=>n(e,o??[]),t[4]=n,t[5]=o,t[6]=f):f=t[6];let p;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(p=[`okf`,`entity-vault`],t[7]=p):p=t[7];let m;t[8]!==o||t[9]!==f?(m=(0,Z.jsx)(`div`,{className:`-m-1 min-h-0 flex-1 overflow-y-auto subtle-scrollbar p-1`,children:(0,Z.jsx)(Yh,{packs:o,onPackSelect:f,collapsedPackIds:p})}),t[8]=o,t[9]=f,t[10]=m):m=t[10];let h;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(`span`,{className:`text-muted-foreground text-sm`,children:(0,Z.jsx)(J,{id:`S34Vju`})}),t[11]=h):h=t[11];let g,_;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Z.jsx)(Bo,{"aria-hidden":`true`,className:`size-3.5`}),g=(0,Z.jsx)(J,{id:`PVUn_c`}),t[12]=g,t[13]=_):(g=t[12],_=t[13]);let v;t[14]===r?v=t[15]:(v=(0,Z.jsxs)(X,{type:`button`,variant:`link-muted`,size:`sm`,onClick:r,"data-testid":`nav-first-run-open`,children:[_,g]}),t[14]=r,t[15]=v);let y,b;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(RF,{"aria-hidden":`true`,className:`size-3.5`}),b=(0,Z.jsx)(J,{id:`VdXv4D`}),t[16]=y,t[17]=b):(y=t[16],b=t[17]);let x;t[18]===i?x=t[19]:(x=(0,Z.jsxs)(X,{type:`button`,variant:`link-muted`,size:`sm`,onClick:i,"data-testid":`nav-first-run-clone`,children:[y,b]}),t[18]=i,t[19]=x);let S,C;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(rt,{"aria-hidden":`true`,className:`size-3.5`}),C=(0,Z.jsx)(J,{id:`ircigK`}),t[20]=S,t[21]=C):(S=t[20],C=t[21]);let w;t[22]===a?w=t[23]:(w=(0,Z.jsxs)(X,{type:`button`,variant:`link-muted`,size:`sm`,onClick:a,"data-testid":`nav-first-run-blank`,children:[S,C]}),t[22]=a,t[23]=w);let T;t[24]!==v||t[25]!==x||t[26]!==w?(T=(0,Z.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1`,"data-testid":`nav-first-run-secondary`,children:[h,(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-1 gap-y-1`,children:[v,x,w]})]}),t[24]=v,t[25]=x,t[26]=w,t[27]=T):T=t[27];let E;return t[28]!==T||t[29]!==m?(E=(0,Z.jsxs)(`section`,{className:`flex min-h-0 shrink flex-col gap-6`,"data-testid":`nav-first-run`,children:[d,m,T]}),t[28]=T,t[29]=m,t[30]=E):E=t[30],E}function P$(e){let t=(0,$.c)(44),{project:n,branch:r,onOpen:i,onRemove:a}=e,{_:o}=At(),{name:c}=n,l=n.isLinkedWorktree===!0,u=l?n.branch??r:r,d=n.missing,f=n.missing&&`opacity-50`,p;t[0]===f?p=t[1]:(p=Y(`h-auto min-w-0 flex-1 justify-between gap-3 py-3.5 pl-4 pr-2 text-left hover:bg-transparent`,f),t[0]=f,t[1]=p);let m;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Z.jsx)(ef,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-muted-foreground`}),t[2]=m):m=t[2];let h;t[3]===n.name?h=t[4]:(h=(0,Z.jsx)(`span`,{className:`truncate font-medium text-sm text-gray-700 dark:text-foreground`,children:n.name}),t[3]=n.name,t[4]=h);let g;t[5]===l?g=t[6]:(g=l?(0,Z.jsxs)(s,{variant:`secondary`,className:`shrink-0 gap-1 rounded-full border-transparent bg-green-600/10 px-2 py-0 font-medium text-2xs text-green-800 dark:bg-green-400/10 dark:text-green-400`,children:[(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`size-2.5`}),(0,Z.jsx)(J,{id:`z-lawV`})]}):null,t[5]=l,t[6]=g);let _;t[7]!==h||t[8]!==g?(_=(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[h,g]}),t[7]=h,t[8]=g,t[9]=_):_=t[9];let v=l?n.mainRoot??``:n.path,y;t[10]!==l||t[11]!==n.mainRoot||t[12]!==n.path?(y=l?(0,Z.jsx)(J,{id:`PRnH8G`,values:{0:Eg(n.mainRoot??``)}}):n.path,t[10]=l,t[11]=n.mainRoot,t[12]=n.path,t[13]=y):y=t[13];let b;t[14]!==v||t[15]!==y?(b=(0,Z.jsx)(`span`,{className:`truncate w-full text-muted-foreground text-xs`,title:v,children:y}),t[14]=v,t[15]=y,t[16]=b):b=t[16];let x;t[17]!==b||t[18]!==_?(x=(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[m,(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1 truncate`,children:[_,b]})]}),t[17]=b,t[18]=_,t[19]=x):x=t[19];let S;t[20]!==n.missing||t[21]!==n.path||t[22]!==u?(S=n.missing?(0,Z.jsx)(s,{className:`text-2xs rounded-sm`,variant:`warning`,children:(0,Z.jsx)(J,{id:`VU3Nrn`})}):u==null?null:(0,Z.jsxs)(`span`,{className:`flex max-w-[40%] items-center gap-1 text-muted-foreground text-xs`,"data-testid":`nav-recent-branch-${n.path}`,children:[(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,Z.jsx)(`span`,{className:`truncate font-mono`,children:u})]}),t[20]=n.missing,t[21]=n.path,t[22]=u,t[23]=S):S=t[23];let C;t[24]!==i||t[25]!==n.missing||t[26]!==x||t[27]!==S||t[28]!==p?(C=(0,Z.jsxs)(X,{type:`button`,variant:`ghost`,onClick:i,disabled:d,className:p,children:[x,S]}),t[24]=i,t[25]=n.missing,t[26]=x,t[27]=S,t[28]=p,t[29]=C):C=t[29];let w;t[30]!==o||t[31]!==c?(w=o({id:`hDoLrm`,values:{projectName:c}}),t[30]=o,t[31]=c,t[32]=w):w=t[32];let T;t[33]===o?T=t[34]:(T=o({id:`Es-eZU`}),t[33]=o,t[34]=T);let E=`nav-recent-remove-${n.path}`,D;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Z.jsx)(vs,{"aria-hidden":`true`}),t[35]=D):D=t[35];let O;t[36]!==a||t[37]!==w||t[38]!==T||t[39]!==E?(O=(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-sm`,onClick:a,"aria-label":w,title:T,className:`pointer-events-none mr-2 opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 focus-visible:pointer-events-auto focus-visible:opacity-100`,"data-testid":E,children:D}),t[36]=a,t[37]=w,t[38]=T,t[39]=E,t[40]=O):O=t[40];let k;return t[41]!==C||t[42]!==O?(k=(0,Z.jsxs)(`li`,{className:`group flex items-center justify-between rounded-lg hover:bg-accent`,children:[C,O]}),t[41]=C,t[42]=O,t[43]=k):k=t[43],k}async function F$(e,t,n){await e.project.open({path:t,target:`new-window`,entryPoint:n})}function I$(e){let t=e.split(/[/\\]/).filter(Boolean);return t.length>0?t[t.length-1]??e:e}function L$(e){let t=(0,$.c)(5),{bridge:n}=e,r=n.config.collabUrl?n.config.collabUrl:null,i;t[0]===n?i=t[1]:(i=(0,Z.jsx)(R$,{bridge:n}),t[0]=n,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,Z.jsx)(Ul,{collabUrl:r,children:i}),t[2]=r,t[3]=i,t[4]=a):a=t[4],a}function R$(e){let t=(0,$.c)(11),{bridge:n}=e,{resolvedTheme:r}=ln(),i=d_(),[a,o]=(0,Q.useState)(null),s;t[0]===r?s=t[1]:(s=Iu(r),t[0]=r,t[1]=s);let c;t[2]===s.background?c=t[3]:(c=(0,Z.jsx)(`div`,{ref:o,className:`flex h-screen min-h-0 flex-col`,style:{backgroundColor:s.background}}),t[2]=s.background,t[3]=c);let l;t[4]!==n||t[5]!==a||t[6]!==i?(l=(0,Z.jsx)(NI,{bridge:n,variant:`window`,visible:!0,onVisibleChange:B$,installedClis:i,container:a,isShowing:!0,onRequestEditorFocus:z$}),t[4]=n,t[5]=a,t[6]=i,t[7]=l):l=t[7];let u;return t[8]!==c||t[9]!==l?(u=(0,Z.jsxs)(Z.Fragment,{children:[c,l]}),t[8]=c,t[9]=l,t[10]=u):u=t[10],u}function z$(){}function B$(e){e||window.close()}function V$(e){return e?.config.mode===`terminal`?(0,Z.jsx)(L$,{bridge:e}):e?.config.mode===`navigator`?(0,Z.jsx)(A$,{bridge:e}):(0,Z.jsx)(o$,{})}var H$=e=>{let t=(0,$.c)(8),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let{theme:r}=ln(),i=r===void 0?`system`:r,a,o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a={success:(0,Z.jsx)(sa,{className:`size-4`}),info:(0,Z.jsx)(rs,{className:`size-4`}),warning:(0,Z.jsx)(cs,{className:`size-4`}),error:(0,Z.jsx)(_f,{className:`size-4`}),loading:(0,Z.jsx)(is,{className:`size-4 animate-spin`})},o={"--normal-bg":`var(--popover)`,"--normal-text":`var(--popover-foreground)`,"--normal-border":`var(--border)`,"--border-radius":`var(--radius)`},t[2]=a,t[3]=o):(a=t[2],o=t[3]);let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s={classNames:{toast:`cn-toast`}},t[4]=s):s=t[4];let c;return t[5]!==n||t[6]!==i?(c=(0,Z.jsx)(ys,{theme:i,className:`toaster group`,icons:a,style:o,toastOptions:s,...n}),t[5]=n,t[6]=i,t[7]=c):c=t[7],c},U$=Symbol.for(`ok.client.fetchWrapper`);function W$(e={}){if(typeof window>`u`)return;let t=e.apiOrigin&&e.apiOrigin.length>0?e.apiOrigin:void 0;if(window.fetch[U$])return;let n=window.fetch.bind(window),r=Bl(),i=((e,i)=>{let a=K$(e,t);if(!a.isApi)return n(e,i);if(e instanceof Request){let t=G$(e.headers,r);return n(new Request(a.url,e),{headers:t})}let o=G$(i?.headers,r);return n(a.url,{...i,headers:o})});i[U$]=!0,window.fetch=i}function G$(e,t){let n=new Headers(e);for(let[e,r]of Object.entries(t))n.set(e,r);return n}function K$(e,t){if(typeof e==`string`){if(e.startsWith(`/api/`))return{isApi:!0,url:t?t+e:e};let n=q$(e);return n&&J$(n,t)?{isApi:!0,url:e}:{isApi:!1,url:e}}let n=e instanceof URL?e:q$(e.url,window.location.origin);if(n&&J$(n,t)){let r=e instanceof URL?e.href:e.url;return t&&(n.origin===window.location.origin||n.protocol===`file:`)?{isApi:!0,url:t+n.pathname+n.search+n.hash}:{isApi:!0,url:r}}return{isApi:!1,url:e instanceof URL?e.href:e.url}}function q$(e,t){try{return new URL(e,t)}catch{return null}}function J$(e,t){if(!e.pathname.startsWith(`/api/`))return!1;if(e.origin===window.location.origin||e.protocol===`file:`)return!0;if(t){let n=q$(t);if(n&&e.origin===n.origin)return!0}return!1}var Y$={messages:JSON.parse(`{"--T3kB":["Loading preview"],"-3Qbv7":[["count","plural",{"one":["matches ","#"," file"],"other":["matches ","#"," files"]}]],"-3ois8":["Hard break"],"-5jISU":[["0","plural",{"one":["#"," template"],"other":["#"," templates"]}]],"-8PP0T":["Match case"],"-K0AvT":["Disconnect"],"-LHLx7":["edited template"],"-QCLWk":["Templates available"],"-Qw-1t":["GitHub authentication failed. Try signing in again."],"-WFFG2":["Default properties"],"-YV1Uo":["Pattern ",["patternNumber"]],"-g6KIS":["Unrecognized link"],"-gdcIo":["Auto-sync is on — your commits push and remote changes pull on intervals."],"-i7ik4":["Collapse burst ",["burstNumber"]," diff"],"-lCAuQ":["Loading graph"],"-q4abP":["Results capped — this workspace has more files than search can index. A missing file may be a cap artifact, not a typo."],"-r_Kx7":["Create skill"],"-slrNR":["Toggle a task list."],"-uaQnI":["No matching worktrees or branches."],"-wePNM":["Search matches file names, paths, and folders. Open a file to search its body (⌘F)."],"-zA2E7":["Couldn't create the worktree. Try a different name."],"-zy2Nq":["Type"],"0-31GV":["Removing"],"00c7t0":["Ask AI about this code block"],"02P3hL":["Upload failed: ",["message"]],"04RA0-":["Failed to enable sync — ",["detail"]],"04XyCH":["Adds a managed block to ",["0"]],"05n5wS":["Doc mention suggestions"],"06SZfb":["Template \\"",["trimmedTitle"],"\\" created"],"07eGJB":["Couldn't move skill: ",["0"]],"07gHun":["You don't have access to this private repo. Sign in with an account that does."],"07q4Qk":["File sidebar"],"09Tv5j":["Reconnecting…"],"0BB9ID":["No headings yet."],"0BfhAj":["Reset view"],"0E9DR6":["Type to find a doc"],"0Er6-M":["Restarting"],"0Gd0NU":["Shared"],"0LBDjY":["\\"",["0"],"\\" uninstalled — back to a draft"],"0NA4b3":["Keep my version"],"0SBTff":["Show terminal"],"0TnCvC":["Rename ",["0"]],"0YEbfk":["Connect to AI tools"],"0YUS3Q":["Subfolder under current folder"],"0_J12R":["New file from template \\"",["displayTitle"],"\\" (",["fileName"],") in ",["targetLabel"]],"0eHrMb":["Could not complete delete"],"0g7rCZ":["Duplicated to \\"",["0"],"\\""],"0inVGS":["Helps your coding agent recognize OpenKnowledge projects and route reads and writes through it."],"0jD-Gn":["A team knowledge base, a personal wiki, project docs..."],"0kTAXe":["Open source: ",["mirrorSrc"]],"0rwwOn":["By tag"],"0s8-e8":["Select, enter, or leave block components and fallback source blocks from keyboard boundaries."],"0t0bbC":["Could not save sync preference: ",["detail"]],"0uTHCg":["Start a new OpenKnowledge project."],"0wswKc":["Horizontal rule that divides sections."],"0xnmlQ":["Repository name"],"0yL--g":["Review conflicts"],"10g8I_":["Turn off Only markdown files"],"12F9WL":["(no id)"],"16D5Zj":["Are you sure you want to delete ",["itemName"],"? This action cannot be undone."],"1AumWo":["Push failed — check the server logs for details."],"1EcCom":[["keyName"]," value"],"1FLarN":["Describe what you want to create to continue"],"1GhYxC":["of ",["totalPages"]],"1HBhDS":["Checking out files"],"1MGRQl":["Terminal sessions"],"1QfxQT":["Dismiss"],"1RluQD":["Show replace"],"1TNIig":["Open"],"1Ta7Fd":["Open ",["basename"]],"1XSMhZ":["Switching to <0>local-only</0> will refuse until they're untracked via<1> git rm --cached</1>."],"1YJ4Yg":["Update available",["0"]],"1ZpfyB":["Open with AI ",["displayName"],", ",["hint"]],"1bDVu5":["Workspace Command Palette"],"1d1F11":["Select all files and folders"],"1di5fu":["Document not found"],"1hvhf0":["The folder on disk and the id agents use to invoke this skill."],"1nke1r":["Open ",["0"]," on GitHub (opens in a new tab)"],"1t_NnN":["Reject"],"2277Tu":["Collapse graph"],"237hSL":["Ended"],"25Pw6a":["Cloning"],"27XW26":["Clone happens in the Project Navigator. Reclick the share link there."],"28B21t":["Agent Skills"],"29VNqC":["Unknown error"],"29XZXN":["Set git identity"],"2B6eYX":["What this checkbox changes"],"2BBAbc":["List"],"2FYpfJ":["More"],"2GT3Hf":["Global"],"2IYGkU":["This doc has unpushed changes. Recipients will see the last pushed version."],"2QM24L":["All tags"],"2RBzMG":["Network error — check your connection and try again"],"2XQ8Ww":["Open preview when agent edits"],"2YOwme":["Restarted — now running v",["appRuntime"],"."],"2YZwPB":["Forward-links response did not match expected shape."],"2bVHbB":["Available in every project on this computer."],"2fkdnR":["Nothing to undo on this file"],"2hYmUH":["my@email.com"],"2hpdRq":["Hide panel (",["panelShortcutLabel"],")"],"2j1kfc":["Enter a valid URL (for example https://api.openai.com/v1)."],"2n3oDU":["Project-level pages ordered by inbound link count, up to ",["FULLSCREEN_HUB_LIMIT"]," results."],"2q_Q7x":["Visibility"],"2ryd91":["Failed to rename property"],"2tgFCe":["Starting clone"],"2vIPtm":["Open link in new tab"],"2wxgft":["Rename"],"322lyb":["Highlight tips, warnings, and notes."],"34qyH5":["Could not reach server"],"36WXSC":["Couldn't delete template: ",["error"]],"36aWJD":["Join us on Discord"],"379t2h":["Unified diff"],"38foVZ":["Loading diff"],"3BnyYc":["This doc isn't on GitHub yet. The link won't work until it's pushed."],"3DTatP":["Copy a prompt for your agent, start a blank file, or scaffold from a template."],"3FMvls":["A short line shown under the title in the template list."],"3Fcb0I":["Open graph"],"3HNlwb":["Hello, world!"],"3Ib6FN":["Move down"],"3Ijjy1":["Couldn't load this skill's files."],"3IseAk":["Install an AI agent to create with AI"],"3J7d2N":["Big section heading."],"3JYy1p":["Branch ",["0"]," no longer exists. Cloned to default branch."],"3MnvrL":["Showing top ",["0"]," matches — keep typing to narrow"],"3Mwaly":["Could not initialize ",["0"],"."],"3SDfZl":["<0>Mirror — pick a source.</0> Set <1>src</1> + <2>anchor</2> via the property panel to point at a <3><MirrorSource></3> elsewhere."],"3TCafD":["Stored on this machine."],"3VbwPp":["Open ",["keyName"]," in browser"],"3VsNTI":["Loading document"],"3YvS-c":["New tab"],"3_6U6f":["Connect to GitHub"],"3__SjS":["breadcrumb"],"3a_Bd7":["Open source doc: ",["mirrorSrc"]],"3aeN7X":["All files"],"3cOo2C":["Create a folder from the current document or folder context."],"3ePd3I":["What's new"],"3h5zMp":["Something went wrong loading the settings panel."],"3iyGWF":["Open recent project"],"3jod3l":["Connect GitHub"],"3m2GBo":["Searching docs"],"3mFsc3":["Restore with remote changes"],"3o3tur":["Starter content"],"3oh0nQ":["Nested .okignore error in ",["path"]],"3pU8e-":["Pin tab"],"3wiBAs":["Where should it live?"],"3y6XTb":["Semantic search"],"3zyg_A":["Ignore patterns"],"438Fca":["Cloned successfully, but could not open the project."],"44DSl0":["Already have a git repository? Add it with <0>git remote add origin <url></0> in this project's folder. This page updates automatically once a remote is detected."],"45MZFs":["Commands"],"47EXvY":["This replaces the current skill content with the bundled version ",["0"]," (you have ",["1"],"). Any local edits will be replaced — your current version is saved to history first, so you can restore it."],"484LKL":["Remove link"],"48uGTI":["Failed to load docs. Press Escape and re-open to retry."],"4A3Yzu":["Code block"],"4BITzH":["Error:"],"4CfgPM":["Project folder created, but git init failed. Try again."],"4E9jPa":["Create your first project"],"4Gz2wC":["Failed to upload file"],"4KmEoC":["Hotkeys"],"4NC2Ym":["Move to the next or previous table cell."],"4PYsOz":["Hide Files (",["sidebarShortcutLabel"],")"],"4Sxexw":["Source undo or redo"],"4TzU0n":["Initialize"],"4XL6N4":["Detected from the editors this project is set up for. Adjust to control where every skill installs."],"4buZWd":["Inherited from ",["path"]],"4c_a6S":["Nothing set yet."],"4g19V6":["Failed to update property"],"4hJhzz":["Table"],"4jDd0j":["Anyone can see"],"4mLBx9":["Subscriptions aren't available right now."],"4niEzY":["Sandboxed HTML embed — write HTML, see the rendered preview live."],"4nj6n8":["/api/config returned HTTP ",["code"]],"4rjwLG":["Create with ",["0"]," CLI"],"4sKwf6":["File already exists"],"4uNLmk":["Pulling"],"4v2Yyz":["Select every visible file-tree row when focus is in the Files sidebar."],"4xtLTl":["Hidden folder “",["basename"],"”"],"4zEZS5":["Auto-sync is on for this worktree, inherited from ",["project"],". Change it in Settings → Sync."],"4zGlN_":["Paste image URL or click upload"],"5-FeN2":["Share URL"],"5-o4kO":["Only markdown files"],"54Y6Fg":["Could not load templates. Try again later."],"56WWtu":["Couldn't load starter packs: ",["error"]],"56xUL1":["Property name"],"57fiu8":["(read-only — edit in source mode for now)"],"5ALjdr":["Move through visual-editor find results from the find field."],"5Ajb15":["The formula <0>c = √(a² + b²)</0> renders inline."],"5ClEAu":["Inline hashtag for cross-doc grouping."],"5D3Ior":["Hide folder"],"5DFPDh":["Started a fresh OpenKnowledge server (v",["appRuntime"],") for this dev session — the server already running for this project was terminated. Connected agents (Claude Code, Codex, Cursor) just lost their OpenKnowledge MCP connection; restart the agent, or toggle its OpenKnowledge MCP server off and on, to reconnect."],"5F5HYj":[["ahead"]," ahead, ",["behind"]," behind"],"5GKMSz":["Indent or outdent the current list item."],"5GRxoA":["Search files, folders, and commands for the current workspace."],"5LXwX8":["This permanently removes ",["path"],". Agents that reference this template by name will fail until it's recreated or replaced by one in a parent folder."],"5OTgC7":["Open and focus the bottom Ask AI prompt composer."],"5OqaJi":["Enter a project name"],"5QGTaA":["Could not copy relative path"],"5SwVv1":["Not installed"],"5Tk8Fb":["Loading files"],"5WDhAk":["Link to a page or external URL."],"5ZB7XC":["File drop zone"],"5e1Dri":["The menu label agents pick this template by (required)."],"5gr_ev":["Becomes the document's content when someone creates a doc from this template. Type <0>",["dateToken"],"</0> or <1>",["userToken"],"</1> to fill in today's date or the author's name automatically."],"5kWklo":["(some may already be hidden by other rules)"],"5lWFkC":["Sign in"],"5mksg0":["Failed to disable semantic search — ",["detail"]],"5qNxOe":[["count","plural",{"one":["#"," item could not be moved to the Trash. Do you want to permanently delete instead?"],"other":["#"," items could not be moved to the Trash. Do you want to permanently delete instead?"]}]],"5wV2qQ":["and more"],"5y_9lO":["Waiting for authorization"],"6-wLTJ":[["behind"]," behind origin"],"62Pc08":["Install for Claude Chat & Cowork (Desktop App)"],"636K3K":["Delete adjacent chip"],"67f-3g":["Duplicate succeeded but the sidebar may be out of date — refresh to resync"],"6Aih4U":["Offline"],"6EKG_c":["What agents match on to decide when to use the skill."],"6HCOwA":["Failed to open."],"6KCH4m":["Hidden files"],"6LbUG7":["The repository is private and your GitHub account doesn't have access to it."],"6MnZEC":["Terminal failed to load"],"6O626z":["No headings match \\"",["trimmedAnchorQuery"],"\\""],"6Pxqwv":["No project templates yet. Create one to make it available everywhere in this project. Folder-scoped templates live on each folder's overview page."],"6Uau97":["Skip"],"6V3Ea3":["Copied"],"6VqW-1":["Remove ",["keyName"]],"6WdDG7":["Page"],"6YtxFj":["Name"],"6ZhdPI":["What the agent may read, write, and surface."],"6_ZOw4":["Copied full path"],"6bTTAN":["Invalid input — pick a different folder."],"6cR-PU":["Already open"],"6caB2T":["Connect an existing repository"],"6cuT_1":["Open date picker for ",["keyName"]],"6cyguR":["Connect GitHub to continue."],"6eniID":["Map the architecture"],"6fGjTz":["Show fewer"],"6g2jsp":["Update skill"],"6gRgw8":["Retry"],"6h4zVU":["What would you like to create?"],"6hfDJr":["Server error: ",["status"]],"6ibbCg":["Create your first file"],"6ki7F2":[["0","plural",{"one":["#"," item"],"other":["#"," items"]}]],"6lGV3K":["Show less"],"6m_7We":["Open this settings dialog."],"6q0rnH":["writing"],"6qMe0o":["Draft a technical spec for my project. Start with an overview, then add cross-linked pages for the architecture, the key modules, and the open questions, all linked from a specs index."],"6s7LXO":["Heads up"],"6u9LvN":[["days","plural",{"one":["#"," day ago"],"other":["#"," days ago"]}]],"6vEr3W":["Link target"],"72xhRD":["Diagram view mode"],"74-bX-":["A pull quote stands out from the surrounding text."],"74eHt-":["No file or folder selected"],"75Y1dk":["Horizontal pill strip + active panel below; click a pill to switch panels."],"77SdEP":["Delete ",["itemName"]],"7FamGZ":["Go to line"],"7Fkcej":["+ Add ",["addChildName"]],"7H4UHD":["Documents tagged <0>#",["tagName"],"</0>"],"7JtSLi":["Failed to delete path"],"7KeV5F":["Undo all failed: ",["message"]],"7OhaRy":["Source search"],"7Ongq0":["Condense my AGENTS.md file to less than 40k characters"],"7OwvEL":["Show HTML preview"],"7PNNNs":["This sends content off your machine"],"7PXYaF":["<0>ok</0> won't run in external terminals until you add it later from the File menu. OpenKnowledge's built-in terminal and AI tools keep working."],"7PzzBU":["User"],"7YRrJ9":["Available in the OpenKnowledge desktop app. From a terminal, use<0> ok config-sharing status</0> / <1>share</1> / <2>unshare</2>."],"7_bFEL":["Drag ",["patternText"]," to reorder"],"7apDiJ":["A folder named <0>",["sanitized"],"</0> already has files here. Pick a different name."],"7d1a0d":["Public"],"7hctf2":["Describe the project you want to create"],"7jIIFX":["You're all set up!"],"7qRHf0":["Install for Claude Chat & Cowork"],"7uBlRT":["Copy the focused file-tree item so Paste can duplicate it."],"80c4-P":["Code copied to clipboard"],"81H_23":["Add properties"],"881Uwh":["Delete selected table"],"89TtiD":["New file from template \\"",["displayTitle"],"\\" (",["fileName"],") in the project root"],"8F1i42":["Page not found"],"8FqTCr":[["chunksRemaining","plural",{"one":["#"," unresolved hunk"],"other":["#"," unresolved hunks"]}]],"8Gzz2G":["worktree of ",["worktreeOf"]],"8IP5jY":["Each selected tool gets an OpenKnowledge MCP entry."],"8Jm2EP":["Toggle heading levels 1 through 6."],"8OGgNM":["Open or close visual-editor find."],"8OxKZy":["Move succeeded but the sidebar may be out of date — refresh to resync"],"8PifYj":["Mermaid diagram"],"8PmoQF":["Open the insert menu in an empty or active text position."],"8RtNI0":["Failed to load documents"],"8XQRON":["Loading repositories"],"8_brI5":["Name is required"],"8cS0nH":["Config sharing unavailable: ",["0"],"."],"8cpOa8":["Couldn't disconnect — please try again."],"8cpeU3":["Shared repositories"],"8eW0WQ":["No matching repositories."],"8fRyLo":["Invalid patch payload"],"8fc_3j":["Protected branch — cannot push"],"8m8diM":["No location selected. Use Browse to choose a folder."],"8tjQCz":["Explore"],"8uAWix":["This template lives in a parent folder — deleting it affects every folder beneath it that doesn't define its own version."],"8vETh9":["Show"],"92rbk2":["Mirror loading <0>",["mirrorRef"],"</0>"],"96G6Re":["New folder"],"96w9hU":["Something went wrong opening this file (HTTP ",["status"],")."],"99eR72":["Visual editor table selection"],"9Bd18D":["Failed to load hub pages"],"9NJWgv":["Backlinks"],"9OIqw4":["You don't have write access to this repo."],"9PQysm":["Hide advanced"],"9R7pRC":["No tags match \\"",["trimmed"],"\\". Continue typing to create one."],"9UQ730":["Clone"],"9V0W-R":["Adds the OpenKnowledge skill to the <0>Claude Desktop App</0> so it's available in Chat and Cowork sessions."],"9bCiQ8":["No pages are missing incoming graph links."],"9clcD5":["Open documents tagged #",["chip"]],"9dw5bW":["Create with ",["0"]],"9euN0m":[["count","plural",{"one":["#"," more cross-doc participant"],"other":["#"," more cross-doc participants"]}]],"9fhQRL":["Beta channel"],"9fvog2":["Preview unavailable: ",["errorDetail"]],"9i21pa":["Commits happen automatically"],"9jnjV0":["Embed an audio file with native player controls."],"9mEZeD":[["name"]," CLI"],"9npOH9":["Open file"],"9o1bIV":[["behind"]," behind"],"9oE4C3":["Browse your repos:"],"9sBe85":["Follow us on"],"9tJX8r":["By meaning"],"9zb2WA":["Connecting"],"A1taO8":["Search"],"A50vr3":["Use lowercase letters, digits, and <0>-</0> only."],"A5CYnd":["Broken link"],"A5hiCy":["Create template"],"A67Uwj":["Still loading"],"A6h5b-":["File duplicated"],"AAlr5Y":["No collab server for this worktree — run <0>ok start</0> here, or reopen the project."],"AB4qw9":["New terminal"],"AE7BY3":["The terminal session ended."],"AIn2Yv":[["displayName"]," CLI, ",["hint"]],"AItsE5":["Open it there"],"AKxFtn":[["openedWorktreeCount","plural",{"one":["worktree"],"other":["worktrees"]}]],"ALhMYW":["Terminal"],"AQ-Lfg":["Couldn't load templates"],"AQGtjK":["Commands run with the full access of your macOS user account on this machine. Turn this off to disable the shell."],"ATGYL1":["Email address"],"AVW-K9":["Failed to load orphan pages"],"AWOSPo":["Zoom in"],"AaaESH":["Auto-sync is off for this worktree, inherited from ",["project"],". Change it in Settings → Sync."],"AcK_r0":["Claude CLI"],"AczYxH":["Custom open-knowledge entry — not managed by OpenKnowledge"],"AdcGcG":["Applying your change"],"AddR83":["Could not create project. Try again or pick a different location."],"AeHuzT":["# One pattern per line.\\n# Examples:\\n# drafts/\\n# *.draft.md\\n# !keep.md"],"AeXO77":["Account"],"AiNMQ7":["This project lives only on this computer. Connect it to GitHub to back it up and share it with other people."],"Aif3E7":["Enable semantic search"],"Am78jY":["Drag ",["keyName"]," to reorder"],"Aq-O0x":["status"],"AqnqMJ":["API key set"],"ArBWJf":["Undo last edit"],"AsqRE_":["Default location for new attachments"],"AtBdnD":["Couldn't delete skill: ",["error"]],"B11p-O":["Edit markdown link"],"B2DrPb":["Auto-save"],"B2Srgd":[["packName"]," skill installed."],"B3NAZC":["Open Navigator"],"B4_ipX":[["conflictCount","plural",{"one":["#"," file conflicted"],"other":["#"," files conflicted"]}]],"BAH4qX":["Selected graph item"],"BBqGS9":["Desktop"],"BD0XSC":["Failed to load project templates"],"BEkF-P":[["userName"],", ",["tabCount","plural",{"one":["#"," concurrent tab"],"other":["#"," concurrent tabs"]}]],"BGHHtQ":["Single page"],"BH56dn":["Custom display text"],"BQKHuL":["Restart terminal"],"BQu9Pg":["Symlink"],"BUyQnq":["Couldn't restart the server. Try \`ok start\` in this folder."],"BY-g4_":["Add pattern"],"Bdha5y":["Publishing..."],"BeWTQy":["Loading starter packs"],"BgV29F":["Visual editor find input focused"],"Bn9-El":["default"],"Bv5a9_":["Selection statistics"],"Bx4EXG":["Actions for ",["label"]],"By-7Pn":["Toggle a bullet list."],"BymzO4":["Document outline"],"C37Zkt":["Send to"],"C62P6b":["Editor selection"],"C7XjNB":["Global Skill"],"C9TBvF":["No Outgoing"],"CCTop_":["Recent"],"CFnavk":["This project isn't a git repository, so worktrees aren't available."],"CKyk7Q":["Go back"],"COr1Y7":["Pick <0>openknowledge.skill</0> from your <1>Downloads</1> folder. It enables automatically."],"CSL0l1":["Couldn't clear the key — please try again."],"CTJLpz":["\\"",["trimmed"],"\\" already exists here"],"CU3AiE":["Switching branches"],"CWzc2T":["<0>~/.ok/bin</0> and <1>~/.ok/env.sh</1> stay either way — the app always maintains them."],"CXTwen":["Can't safely edit this project config"],"CXj9C-":["New property name"],"C_WGy8":["This file is too large to open in the built-in text editor (1 MB limit). Use Open file below to open it in another app."],"C_cPoW":["Your GitHub session expired — sign in again to verify push access."],"ChAtFg":["You don't have permission to push to this repo"],"CifUuG":["Update available"],"Ck9XRt":["Couldn't save the key — please try again."],"CmeH9S":["Add property to ",["keyName"]],"CoHvYd":["Moved ",["0"]," to position ",["1"]," of ",["2"]],"CvsD6Y":["via ",["viaTags"]],"D-Oh1s":["How to set up ",["0"]," (opens in browser)"],"D12vtS":["(detached)"],"D2CwBE":["Create a new OpenKnowledge project from the <0>",["0"],"</0> starter pack (",["1","plural",{"one":["#"," folder"],"other":["#"," folders"]}]," and starter templates) in the folder of your choice."],"D4H2N6":["Remove ",["tag"]],"D8OV7J":["Only collaborators"],"DDTdLl":["Code block settings"],"DELNQk":["Collaborators see your in-progress edits as soon as they sync."],"DEWDbv":["Show diagram"],"DF1MtZ":["Loading conflict for ",["filePath"]],"DFfRbX":["Sync status: ",["syncStateLabel"]," — git identity unset"],"DId6MT":["Project-level pages with no outgoing graph edges."],"DJd000":["Activate the previous editor tab."],"DPfwMq":["Done"],"DVh_Tb":["Failed to clean up after trash"],"DXd9LM":["New worktree"],"D_WKe_":["Click an agent's avatar in the presence bar to view their session."],"DbILZA":["No matches. Some files are excluded from search (hidden or ignored files)."],"DeDYLr":["Unrecognized wiki link"],"DgcGrb":[["fileCount","plural",{"one":["file"],"other":["files"]}]],"DhK_hZ":["Moved \\"",["name"],"\\" to ",["0"]," (",["skipped"]," binary file(s) not copied)"],"DhLHEb":["Failed to load activity"],"DiFKSL":["Counting markdown files"],"Dnn2XG":["Automatic"],"DrYM2Z":["Sync disabled"],"DskIkK":["Sign-in stream ended without confirmation — please try again"],"Dub54T":["Preview browsers can't auto-copy. Use Cmd/Ctrl+C on the URL above, or open OK in the desktop app."],"Dvwa0U":["Create a worktree from this branch"],"Dw1T_W":["Rename ",["label"]],"E1Da_b":["This permanently removes ",["0"],". Agents that invoke this skill by name will fail until it's recreated."],"E1_c72":["Task list"],"E1tG2u":["Get Claude Code"],"E2Mv-X":["Copy source"],"E4XYYH":["Enable terminal for this project"],"E5WeIy":["Reopen the most recently closed editor tab."],"E6lrpp":["Manage the GitHub account OpenKnowledge uses to browse and sync your repositories."],"E7BhZn":["Blank note"],"E9bKSA":["Creating"],"EBVbtP":["Could not duplicate item"],"EDl9kS":["Subscribe"],"EDm3wJ":["Loading diff renderer"],"EEYbdt":["Publish"],"EHu0x2":["Syncing"],"EJuO7B":["Connect a GitHub account to browse and sync your repositories."],"ELYtNJ":[".ok folders"],"EL_YRd":["Mirror of <0>api-spec</0>"],"EOjU5V":["Inline Math Properties"],"ETyvvg":["No language match."],"EVnzPs":["Edit with AI"],"EWX92Z":["Collapse Ask AI"],"EZVxVz":["Replace the active match from the replace field."],"E_BHoD":["Could not move \\"",["targetName"],"\\" to the Trash. Do you want to permanently delete instead?"],"E_tNGD":["Connected as @",["login"]],"Ea1prf":["Choose which editors every skill in this project installs into."],"EarrCe":["Search emoji"],"EbZT7P":["Toggle the left file sidebar."],"EbjWsS":["Current commit"],"EcM3k7":["Failed to clean up pending ",["kind"]],"EcR0fl":["Checking for installed agents"],"EdQY6l":["None"],"EeRZnZ":["Expand burst ",["burstNumber"]," diff"],"Ef7StM":["Unknown"],"EhDLBx":["You modified <0>",["filePath"],"</0> locally, but it was deleted upstream."],"Ehkru0":["Open, navigate, accept, or dismiss CodeMirror completion suggestions."],"EiVgl5":["You don't have permission to push to this repo."],"Eji13z":["Toggle highlight formatting."],"EkH9pt":["Update"],"El7NbA":["Heading 2"],"Emz5BG":["Embeddings are computed only when a search runs and are cached locally under <0>.ok/local</0>."],"EoaQyO":["Append-only log of what changed."],"EqrC_R":["Undo failed: ",["message"]],"EqtBXb":["Visual editor find open"],"ErRi6L":["Template \\"",["label"],"\\" deleted"],"Es-eZU":["Remove from recent projects"],"Ev2r9A":["No results"],"EvPX7f":["Opens a folder picker to choose where to clone the repository."],"Evq3lu":["Orphan mode"],"ExPiRQ":["Move to the next CodeMirror lint diagnostic."],"ExUzM4":["skill \\"",["0"],"\\""],"F-NRCj":["Add property"],"F-vBv0":["Ask"],"F0OA00":["Get ",["displayName"]],"F1T9y_":["Showing top matches — keep typing to narrow"],"F4IYWe":["Share doc"],"F4vEsL":["Sync status: ",["syncStateLabel"]],"F6pfE9":["Active"],"FBknns":["HTML"],"FCAcjR":["Run a real terminal docked inside OpenKnowledge, starting in this project's folder."],"FCxvG5":["First item"],"FEK4oC":["OpenKnowledge will be initialized at <0>",["gitRoot"],"</0> — the parent of your new folder, because it contains a <1>.git</1> folder (one project per git repo)."],"FEqWFL":["Guides your AI agents on how to work here."],"FEr96N":["Theme"],"FNTx6u":["Search \\"",["semanticSubmitQuery"],"\\" by meaning"],"FOGD7m":["Create something great."],"FRYB1Q":["/api/config returned a malformed body"],"FRqZ9v":["Couldn't update skill: ",["0"]],"FTUGgh":["Enter a repository URL or owner/repo"],"FUMerq":["Could not enable sync: ",["detail"]],"FWQuPE":["This project is running a different, incompatible build of OpenKnowledge than this app (v",["0"],")."],"FXk_zY":["Adds a guided workflow for authoring new Agent Skills."],"FjkaiT":["Zoom out"],"FnMkli":["Sync disabled — you don't have permission to push"],"FqTpiN":["Bird wiki"],"Fqr8BP":["Multi-page PDF viewer with toolbar controls (thumbnails, page nav, zoom)."],"Fsx78O":["Add the <0>ok</0> command to your terminal"],"FvMSms":["Renaming changes the file on disk and the id agents use to pick this template."],"FvpFSZ":["Reveal in Finder, ",["hint"]],"Fxf4jq":["Description (optional)"],"Fy4GgU":["Explain how your codebase works so teammates and AI agents can find their way around. Good for documenting the architecture, the main parts, and the questions new contributors always ask."],"FyW0WO":["Authorize in browser"],"G-JBA1":["Source mode requires a live connection — your edits are saved and will appear when you reconnect."],"G0YZ-I":["Indent or outdent list item"],"G1Gw0v":["New template"],"G1XxbZ":["Checkbox"],"G4-bgo":["Ask AI (from selection)"],"G7-rf8":["Pattern syntax error: ",["message"]],"G7cMuO":["HTML preview"],"G8t9NN":["Add a property"],"GA-UkN":[["keyName"]," type: ",["typeLabel"],". Click to change."],"GDvlUT":["Role"],"GF51cw":["Give the AI tools you use access to read and update your projects. Pick what to set up below, and change it anytime."],"GGsM4y":["Selected in graph"],"GHsJb8":["Show .ok folders"],"GJH-AT":[["docName"]," is ",["0"],". OpenKnowledge currently opens files up to ",["1"],"."],"GK-IRZ":["Undo buttons are disabled — per-session state has been garbage-collected."],"GLxIKR":["How to push manually"],"GN6L5F":["Filename"],"GQDSBN":["Layout options"],"GUYwCr":["Dismiss notice"],"GUqTzn":["Competitor research"],"GXf9hG":["Cloning ",["repoName"],"..."],"G_686w":["Task List"],"G_efLf":["Installed into"],"G_mWXb":["Filter languages"],"GamjcN":["Template saved"],"GemPfn":["Failed to parse forward-links error response (HTTP ",["status"],")"],"Gfr4fu":["Server can't open documents"],"GhjUB_":["Reconnected"],"Gp_twO":["Local path"],"GsBUCk":["Loading settings"],"Gt4gOO":["This folder has unpushed changes. Recipients will see the last pushed version."],"GubkSu":["Use a starter pack"],"GuqOb1":["Failed to load headings"],"Gx0VS1":["e.g. drafts/ or *.draft.md"],"GzPQ2f":["Stay in the loop"],"H-vDm3":["Relaunching to install the update…"],"H0WlWQ":["Grid of rows and columns with a header row."],"H86f9p":["Collapse"],"HAvRAI":[["skillCount","plural",{"one":["skill"],"other":["skills"]}]],"HCn0Ay":["Toggle strikethrough formatting."],"HGNCsl":["Connection lost — keep this tab open, your edits will sync when reconnected"],"HIb0vl":["Network error — please try again"],"HM56Bx":["Creating..."],"HPTPGr":["Create a new spec file for my user story"],"HSh8u_":["Folders"],"HTW0Zw":["One more step: run <0>claude</0> in this project and approve OpenKnowledge once."],"HXFyWD":["Split diff"],"HdkSiO":["New file"],"HfI1dR":["I already have it locally →"],"Hl89Qd":["Loading templates"],"HlmZBk":["Documents response did not match expected shape."],"Hnl9nT":["Set where pasted and dropped files are stored for this project."],"HoWElC":["This ",["targetNoun"]," has been moved, renamed, or deleted in your local copy of branch <0>",["branch"],"</0>. Please commit your changes or enable auto-sync."],"Hp1l6f":["Current"],"HpK_8d":["Reload"],"HptUxX":["Number"],"HqiZvw":["OpenKnowledge stores its configuration and internal files inside a newly created <0>.ok</0> directory in your project root folder."],"Hrz9NY":["Wiki link"],"HyvSqq":["Project Skill"],"I1gRhX":["Failed to rename"],"I5685_":["Try a prompt"],"I5AfhE":["Sync status unavailable — server unreachable."],"I7Exsw":["Follow us on X"],"IA1wNb":["The Claude Desktop App didn't open the file. Is it installed? (",["msg"],")"],"IA6JW2":["Detecting"],"ICoNYz":["You can also manage this in Settings."],"IInnZo":["Conflict"],"IKoTAC":["Keep disabled"],"IN4UX8":["Search (",["searchShortcut"],")"],"IQPyrD":["Missing page — click to create"],"IRv9cH":["Cloned ",["repoName"],"."],"IWGfGF":["Checking your GitHub connection"],"IX7-sq":["Something went wrong opening \\"",["docName"],"\\"."],"IX_uXB":["my-feature"],"IajAbS":["Add a starter pack"],"If0crP":["Open with AI ",["targetDisplayName"],", ",["hint"]],"IgTwLt":["Open this document in the editor and collapse the graph."],"Ik-gP0":["Heading H",["level"],": ",["text"]],"Iq8zdU":["Close terminal"],"IrB5AK":["Server-side cleanup failed for ",["failedCount","plural",{"one":["#"," item"],"other":["#"," items"]}]],"IreQBq":["Repository"],"It9ARY":["Toggle the right document panel."],"Ix0K8o":["Hide external URL nodes"],"J2MgzQ":["Undo all edits on ",["docName"]],"J2Mv98":["Name (e.g. ",["login"],")"],"J2eKUI":["File"],"J3HzPL":["Collapse ",["keyName"]],"J6N5MX":["Couldn't construct the share URL. Try Done and re-share."],"J6mxC1":["A network problem or GitHub outage interrupted the clone."],"JCxGEX":["No disconnected pages. Pages appear here only when they have no incoming and no outgoing graph edges."],"JE21eh":["Symlink to ",["targetPath"]],"JK-Ave":["Hide thumbnails"],"JL3si7":["Updating"],"JLUTgi":["No tags yet — author \`#tagname\` in any doc to populate the index."],"JLzQi_":["Close ",["accessibleLabel"]],"JM_aq-":["Use an https:// URL — http:// is only allowed for localhost."],"JOcPqH":["Bring a remote repository onto this machine."],"JWsZlx":["Open a project to edit."],"JZ8cO6":["Light, dark, or follow the OS."],"Jejur6":["Couldn't load document"],"Jhj_lh":["Modify the link target, anchor, and display label."],"JkCD2u":["Sync paused — you don't have permission to push to this repo"],"JmfgFc":["(a worktree of ",["0"],")"],"Jqqevv":["System error"],"JtD-Br":["Page link"],"Jw6EC4":["Branch switch failed — try opening the ",["targetNoun"]," manually."],"K-a33w":["Start writing to create this page"],"K-h9cT":["Couldn't save the resolution for ",["filePath"],"."],"K0N7zS":["Config sharing status read failed"],"K1ckLX":["Failed to create folder"],"K6MQQk":["Sync is failing. See the sync status for details."],"K6jjWB":[["packName"]," was already set up. Nothing to do."],"K6jxcj":["Add a key"],"K8-WWn":["Move between table cells"],"K9J00P":["Clone failed — connection error"],"KDuPiY":["Uploading ",["fileName"]],"KDw4GX":["Try again"],"KFdXwz":["Show panel (",["panelShortcut"],")"],"KH5bQi":["Using the <0>OK_EMBEDDINGS_API_KEY</0> environment variable (managed outside OpenKnowledge)."],"KIIamL":["OpenKnowledge will create commits and push them to your remote automatically. If you do not want automatic commits in your git history, you should not enable auto-sync."],"KOZud0":["Build a competitor research knowledge base. Start with an overview page, then add cross-linked pages for each competitor, their products and pricing, and the sources behind every claim."],"KPW5WC":["moved template"],"KQGZuq":["Reused if it already exists, created if not."],"KRJ6xh":["No tags yet. Continue typing to create one."],"KWL_Ih":["Blog post"],"KX1MZR":["Your repositories"],"KYSocE":["Research the extinction of flightless birds"],"KYcZ6Y":["Above"],"KZLdgR":["See <0>#design-docs</0> for the latest specs."],"K_vT1F":["Upstream sync"],"KaFCD3":["Open this link in a new tab and collapse the graph."],"Kf7GG5":["Restarting the server…"],"Kgdbkt":["Switch to local-only refused"],"Kh1n4a":["<",["componentName"],"> isn't a known component. Copy the source to use it elsewhere, or delete the block."],"Khxcyu":["Terminal access isn't enabled for this project."],"KkEAud":["Create a file from the current document or folder context."],"KmydK6":["Bold"],"KnoB--":["Will be saved as <0>",["sanitized"],"</0>."],"Kr3VPS":["Codex will still ask until you run \\"ok init\\" in a terminal for this project."],"KsAPaB":["This branch is checked out in:"],"KszKI_":["Skill level"],"KujtjC":["Find"],"L-rMC9":["Reset to default"],"L1ZE3M":["Document statistics"],"L1rRuU":["Embeddings API endpoint"],"L3CEC1":["this item"],"L4Cdd9":["or create a new file <0/>"],"L6Hhh6":["(root)"],"L8fKuc":["Run this in your terminal"],"L9Y9Om":["Top linked pages"],"LBwUR6":["Branch switch timed out — try opening the ",["targetNoun"]," manually."],"LCUy_N":["Session ended"],"LDuM35":["Replace current match from field"],"LE7t79":["Clone to a new folder"],"LKOLNn":["No AI agents installed"],"LNum6A":[["minutes"]," min ago"],"LRgZAt":[["owner"],"/",["name"]," already exists"],"LXdWeS":["Medium section heading."],"LXfNU-":["Navigation and suggestions"],"LYufDw":["Failed to enable semantic search — ",["detail"]],"LbmLyU":["Can't safely edit this tool's config"],"Lcehxn":["Save resolution"],"LdABLa":["Could not open ",["target"],". Try opening it manually."],"LdKIHS":["Draft a spec"],"LhQlGR":["This project is running an older version of OpenKnowledge (v",["0"],") than this app (v",["1"],")."],"LhWYpm":["Other OK paths are tracked upstream:"],"LiAw2k":["What this changes"],"LlHqdU":["Initializing project"],"Llyqvo":["This usually means one of:"],"LpB85N":["Plain"],"LtI9AS":["Owner"],"LtSYdi":["Reveal in Finder"],"LtiJ5c":["Project skill"],"LuoJWu":[["truncatedShownCount","plural",{"one":["Showing the first item in one folder — the rest of that folder is hidden."],"other":["Showing the first ",["formattedCount"]," items in one folder — the rest of that folder is hidden."]}]],"LwMxXg":["Failed to open worktree."],"M1OfV9":["Next source diagnostic"],"M3ytY_":["This looks like a drive root (e.g., C:\\\\). Scaffolding here will scan an entire drive."],"M5mfAe":["Add tag"],"M9597s":["Preparing share URL..."],"MCjC9A":["Delete ",["deleteDescriptorLabel"]],"MDZSJe":["When the agent runs its scheduled work."],"MGb89P":["Insert, delete, move, copy, and indent source editor lines through CodeMirror's default keymap."],"MHrjPM":["Title"],"MKOVhz":["Enable git auto-sync"],"MQIM_Y":["Couldn't copy. Select the URL above to copy it manually."],"MTs6g3":["Couldn't reconnect after server restart"],"MUBR8r":["Rename succeeded but the tabstrip may be out of date — refresh to resync"],"MUrVEo":["No recent projects."],"MV-Dkb":["Found ",["countDisplay"]," markdown files"],"MVxpbf":["Find and replace"],"MWrUEd":["Undo all"],"MZSBsh":["No templates yet. Add one to give new docs in this folder a ready-made starting point."],"MZoxVx":["Failed to load tags. Press Escape and re-open to retry."],"Mb_20S":["Visual"],"Md709y":["Loading ",["fileName"]],"MdpSC1":["New skill"],"Mh_4hd":["Previous tab"],"Mj8R8K":["Couldn't install skill: ",["0"]],"MmDDWK":["Recently opened"],"MmqnGI":["No global skills yet."],"Mnavhe":[["propPanelDescriptorLabel"]," Properties"],"MqQoV-":["Describe what you want to build, start a blank file, or scaffold from a template."],"MrwYIK":["Toggle a source comment through CodeMirror."],"MsuXaI":["Hide panel (",["panelShortcut"],")"],"My9uXI":["Updated \\"",["display"],"\\" to ",["0"]," — your previous version is in history if you need to restore it."],"N1KkEO":["Jump to last tab"],"N1YYa7":["Loading image"],"N1mdmS":["This file can't be opened in the text editor."],"N2FcBE":["Synced"],"N2S1rs":["Empty"],"N2eHWq":["Code Block"],"N3_ozB":["Hubs"],"N55YNr":["Choose whether this project's OpenKnowledge setup, including its AI-tool connections, is saved with the project so teammates get it too, or kept only on your computer."],"NEzPEh":["Create a new branch, or check out an existing one, in its own window."],"NF_Wcg":["Show skills section"],"NIWAux":["No docs registered under #",["tagDocsName"],"."],"NJyQi_":["Branch ",["shareBranch"]," no longer exists on the remote."],"NKkZXl":["Initialize and open"],"NNJsn7":["One more step: enable it in Cursor → Settings → Tools & MCP (Cursor leaves project servers off until you turn them on)."],"NOHyEE":["Retry push"],"NORKZU":["Pattern warnings: ",["summary"]],"NQ8llq":["Add item"],"NRSLBe":[["diffMin"],"m ago"],"NSnIUP":["Two-page (even)"],"NUr4kz":["A reusable starting point for new documents in this folder."],"NYUhy5":["Subfolder name"],"N_7kkF":["Read through this codebase and draft a technical spec for the most complex module: an overview, the architecture, key files, and open questions, all linked from a specs index page."],"NcurBF":["Pan down"],"NjrIak":["File: <0>",["fixedName"],".md</0>"],"NkXEFS":["Restore failed — document unchanged"],"NmPNJJ":["Copy code"],"Nn4GgW":["Will be created as <0>",["sanitizedName"],"</0>"],"NnQapF":["Open with AI ",["targetDisplayName"]],"NpC29w":["Create a new list item from the current list item."],"Nu4DdT":["Sync"],"Nu4oKW":["Description"],"NuH1jp":["Public repository"],"Nv3mUj":["Show advanced"],"NvOvTi":["Create in <0>",["dirDisplay"],"</0>"],"Nx7BWE":["Git auto-sync"],"NxW-md":["Resize ",["handleKey"]],"NzFvyK":["Session ended — undo unavailable"],"O0Z2Xr":["Outgoing"],"O2UpM1":["Browse"],"O3oNi5":["Email"],"O4PnDd":["AI tool management is only available in the OpenKnowledge desktop app."],"O6yEPk":["Create a new OpenKnowledge project in the folder of your choice."],"O7_W_a":["Open with AI"],"OD0FCX":["Hidden “",["basename"],"”"],"ODGGlj":["Folder name: ",["detail"]],"OETysD":["No hub pages yet. Hubs appear once pages accumulate inbound graph links."],"OEu_0l":["Failed to load skills: ",["0"]],"OFBmkg":["Search files, commands, projects, and AI handoff actions. With text selected in the visual editor, this chord adds a link instead."],"OJTOUj":["Requires ",["brand"],"."],"OJeiSH":["Failed to add property"],"OLBz-_":["Mermaid diagram failed to render."],"OLIKgw":["Drag item ",["0"]," to reorder"],"ONPvOb":["Loading agent activity"],"ONgEZF":["Loading headings for ",["pageTarget"]],"OOIVJo":["Uninstalled \\"",["0"],"\\" from ",["1"]],"OTF92M":["Label <0>(optional display text)</0>"],"OVjNeX":["Terminal ",["0"]],"OX2Neh":["Inline code"],"OXb_Df":["Settings content"],"OYnx7O":["Path cannot start with \\"/\\""],"OZJeTZ":["Skill"],"OdmsFg":["Failed to delete item"],"OeAl1e":["e.g. assets/uploads"],"OgyJSr":["Local only"],"OiHJdA":["Move through slash, wiki-link, tag, and path suggestions; accept or dismiss the active suggestion."],"Okd2Xv":["Toggle underline formatting."],"OlAl5i":["Expand all"],"OmHTGj":["Disable git auto-sync"],"On0aF2":["Website"],"Oo_WWc":["No pages found"],"Oos8fo":["Copy command"],"OplnBG":["Managing AI tools is unavailable in this build."],"OuY8t9":["Open in current branch"],"OvEjsP":["Copying..."],"OxplNM":["Updated \\"",["0"],"\\": added ",["1"],", removed ",["2"]],"Oxyd5f":["Pick a name"],"OyIC0Q":["Project name"],"P-ye9o":["Could not open folder picker"],"P0HC30":["This ",["targetNoun"]," moved to <0>",["0"],"</0>. Open it there?"],"P3NS4G":["Pattern syntax error (line ",["lineNumber"],"): ",["message"]],"P3hnm0":["File too large to open"],"P47EWZ":["Could not update sidebar settings"],"P6gXB-":["Replace ",["keyName"]],"P6lAT3":["Folder target: ",["linkTitle"],". Click to open the overview."],"P8yDjG":["Name can’t be empty, \\".\\", \\"..\\", or contain / or \\\\"],"PB4upl":["Find previous match"],"PBwmDJ":["Searching by meaning"],"PBxg_E":["Not now"],"PCNIuJ":["File an issue"],"PCSkw2":["Skills"],"PIMM5l":["You're subscribed!"],"PKLY-1":["Opening..."],"PMyJ9C":["No edit session yet"],"PPFQ3o":["Installed \\"",["0"],"\\" into ",["1"]],"PQCdtv":["\\"",["docName"],"\\" doesn't exist."],"PR9FSv":["Move to the next visual-editor find result."],"PRnH8G":["of ",["0"]],"PVUn_c":["Open folder"],"P_bX4O":["How to set up"],"PdA9NZ":[["ahead"]," ahead"],"PdJZ5p":["No skills yet."],"Pgu10b":["Saved as <0>",["slug"],".md</0>"],"PgzIpb":["Move to the previous visual-editor find result."],"PiH3UR":["Copied!"],"PkeYXL":["Expanded graph mode"],"Pkw7J9":["This folder is empty."],"PqYWiC":["Couldn't restart the server automatically. Try running \`ok stop all\` in a terminal, then reopen this project — or restart your computer if it persists."],"PrJYSN":["This folder isn't on GitHub yet. The link won't work until it's pushed."],"PrhzDE":["Pan up"],"Pyp1NA":["Restore to this point?"],"Q5fqMz":["Connection error — try again"],"Q6hhn8":["Preferences"],"Q7W-mC":["Same folder as current file"],"Q8A-U_":["Connected to"],"QAi7Q9":["Branch <0>",["trimmed"],"</0> already has a worktree — it'll open in its own window."],"QDZbvN":[["diffDays"],"d ago"],"QJaG-9":["Choose CLI for new chat"],"QNxpRm":["Dock terminal to the right"],"QOINDn":["empty"],"QQghPu":["Install in Claude Desktop"],"QR5SP1":["created template"],"QYfQdv":[["displayName"]," CLI"],"QcpeeE":["Navigate to ",["docName"]],"QfFBdJ":["The template's filename (without \`.md\`)."],"Qj4RL5":["Completed:"],"QlxHAH":["Showing results for \\"",["semanticResultsLabel"],"\\""],"QnjpOq":["What do you want to build?"],"QqBQu1":["Label <0>(visible link text)</0>"],"Qvls7J":["Eng specs"],"Qw-7Ie":["A simple place to write, with one file per topic and a daily journal. Pick this if you just want to start writing and let the links between notes build up over time."],"QyioBP":["Move up"],"R0cyYB":[["0","plural",{"one":["#"," request blocked by the preview's security policy"],"other":["#"," requests blocked by the preview's security policy"]}]],"R0jJzV":["Paste URL, owner/repo, or search your repos"],"R3y75Z":["Edit source"],"R65q-K":["A real shell is off for this project. Turning it on runs commands with the full access of your macOS user account."],"R9IDFz":["Renames the folder on disk and the id agents use to invoke it."],"RDjuBN":["Setup"],"RDrXh4":["Configure user, project, and integration settings."],"RG4XHV":["Copy ",["0"]," prompt"],"RGCCrg":["Copy share link"],"RGkNeJ":["Initialize a starter pack"],"RJ3a8Z":["Looking for <0>",["lookingForUrl"],"</0>."],"RN62Q8":["We'll build <0>openknowledge.skill</0>, save it to <1>~/Downloads</1>, and open the Claude Desktop App for you."],"RSqaSd":["Project root"],"RVZJWQ":["Search projects..."],"RXNu_r":["Shared via git with everyone working on this project."],"RY6Bq1":["Open shared ",["targetNoun"]],"RaPMZv":["Keyboard shortcuts available in the editor and workspace."],"Rah7yq":["What should the AI do? (optional)"],"RfHNf8":["Open activity panel for ",["tooltipName"]],"RfaEio":["Toggle source comment"],"RgbKEe":["You don't have access to this repository."],"Rj01Fz":["Links"],"RlCInP":["Slash commands"],"RlLl3G":["Actions for ",["0"]],"RmBY0A":["No git remote"],"RnrnTe":["Already set up — ok is available in your terminal"],"RobAKV":["Update the destination and optional section anchor."],"Rq1vFD":["Tree view options"],"RrAIZx":["What config sharing covers"],"Rx5ReQ":["Rename ",["keyName"]],"RyIKxy":["This ",["targetNoun"]," has been moved, renamed, or deleted in your local copy, and that change hasn't synced yet."],"S33tz3":["Not connected"],"S34Vju":["Have something else in mind?"],"S6l5dv":["Could not start creating a new item"],"S9Vnum":["Remove ",["patternText"]],"SCoBBH":["Tag suggestions"],"SCzAbA":[["phase"]," — ",["pct"],"%"],"SEYWYq":["Undo all edits on this file?"],"SFN6dN":["Heading 3"],"STTOnz":[["keyName"]," type: complex value (nested; read-only)"],"SUOoXn":["Failed to open project."],"SVLPt5":[["formatted"]," GitHub stars"],"SXCSQd":["Copied path"],"SYfHmN":["Unpin tab"],"Sc1bKE":["Local collaboration data for \\"",["docName"],"\\" could not be cleared in time. Reload to retry."],"ScwcF2":["A project already exists at this location. Pick a different parent folder."],"SfxQX8":["Writes a project-MCP config for each selected tool."],"SgKLfA":["Not connected to GitHub."],"Sh3Qkg":["No matching branches."],"SiUUCS":["Next match"],"SkMZlS":["Couldn't remove <0>",["targetGitPath"],"</0>: ",["removeGitError"]],"Skr_7L":["Search worktrees"],"Sq8lf2":["Editors to install skills into"],"SrOuyg":["Document panels"],"T-654M":["Loading PDF"],"T0OVm7":["The default branch is protected — pushes need a pull request."],"T67A0Y":["Auto-sync pushes/pulls commits to your git remote on intervals and on save. Toggling on requires confirmation."],"TEEPPF":["Will replace existing OpenKnowledge entry"],"TJnkyf":["ok ui responded but server.lock has no port yet"],"TKQ7K-":["Install"],"TLIO3j":["Toggle italic formatting."],"T_wG4n":["We couldn't check your GitHub connection."],"Ta25TG":["No history yet"],"TbjyhA":["Docs"],"ThmUrC":["Could not finalize project setup. Try again."],"Tjc1pH":["Section <0>(optional heading anchor)</0>"],"TsZmgr":["The file on disk, and the id agents use."],"TwYboS":["Navigate CodeMirror source search results or dismiss the search panel."],"Tz0i8g":["Settings"],"Tz9pJB":["Clone stream ended unexpectedly — check if the clone completed"],"U2Kx6T":["Close all unpinned"],"U2pMtf":["tag-name"],"U3IvM5":["Full guide"],"U5Spo9":["Content directory must be inside the project"],"U8CD-l":["Copy full path, No workspace"],"UBv8UK":["Delete Permanently"],"UDFrWm":["Checking GitHub connection..."],"UL8A9w":["Tag"],"UMrOy2":["Skill \\"",["trimmedName"],"\\" created"],"UPjaXD":["Couldn't duplicate \\"",["0"],"\\": ",["1"]],"UQAp48":["Search templates"],"UQMMvx":["Moved \\"",["name"],"\\" to ",["0"]],"URmyfc":["Details"],"UTNVyS":["Select the full source document."],"UTZ97u":["Selection must be inside the project"],"UVLlMV":["Couldn't reach GitHub. Try again?"],"UW2Fg3":["This project's running server doesn't support live editing. Restart OpenKnowledge to fix."],"UW93oq":["Replace key"],"UYcGIW":["Connecting — waiting for collab server"],"Ua78MH":["no response"],"UaDyeb":["Hide selection preview"],"Uay5NL":["This ",["targetNoun"]," was added to branch <0>",["shareBranch"],"</0> recently. Switch and update to open it."],"Uci-Ph":["Ordered List"],"Ud0Pj9":["<0>Mirror source removed.</0> The doc <1>",["src"],"</1> is no longer available."],"UfW9Kr":["Your search queries and the full text of matching pages are sent to your embeddings provider (OpenAI by default) to compute embeddings."],"UhpfxY":["Pan left"],"UkQGhd":["Hide replace"],"Up2_7p":["Copy full path"],"UuYo7g":["This ",["targetNoun"]," has been moved, renamed, or deleted in your local copy. Please commit your changes or enable auto-sync."],"Uuj_R4":["New from template"],"Uw6ERJ":["Couldn't copy: ",["detail"]],"UyROxs":[["mins","plural",{"one":["#"," min ago"],"other":["#"," min ago"]}]],"V48OUT":["You deleted <0>",["filePath"],"</0> locally, but it was modified upstream."],"V7QxyT":["Connection dropped"],"VAHWL_":["Connected as <0>@",["signedInLogin"],"</0>"],"VBE2dw":["Build and keep track of the world behind your story. A home for your characters, places, factions, and the lore that ties them together, so details stay consistent as you write."],"VIwCaD":["Entry"],"VM7H66":["This file is binary and can't be shown as text."],"VNgKZz":["Advanced settings"],"VU3Nrn":["Missing"],"VUijjF":["Embed an image with optional alt text."],"VYd_YA":["Open an existing project folder from disk."],"VZGGPK":["Collapse terminal"],"VZGh8G":["Fold, unfold, fold all, or unfold all source ranges."],"VZSBXL":["Semantic ranking activates the first time an agent runs a search."],"V_6bJ4":["Terminal settings not loaded yet — try again in a moment."],"V_wltx":["Enter a title for this template."],"VbqhBI":["Already at ",["assetContentPath"]," — reusing."],"VcqWBy":["Upload may have succeeded but the sidebar is out of date — refresh to resync"],"VdXv4D":["Clone from GitHub"],"Vlc75q":["Keep file deleted"],"VsaI0G":[["folderCount","plural",{"one":["folder"],"other":["folders"]}]],"VuxVSP":["Start source completion"],"VvS_k_":["Config sharing is now local-only."],"VxO6wR":["Delete selected files or folders"],"VzGJRl":["Add link"],"W-ntoW":["heading-slug"],"W0i24j":["Object"],"W1qRuM":["This document is already active in the editor. Use Open to collapse the graph."],"W3Xlpc":["Set the auto-sync default for users opening this project for the first time. This setting is committed to your repository."],"W5A0Ly":["An unexpected error occurred."],"W7XJN4":["Can't nest projects. An OpenKnowledge project already exists at <0>",["rootPath"],"</0>. Choose a location outside it, or open that project instead."],"W8vpBM":["starter pack"],"W9_Bub":["Local changes overlap with incoming sync"],"WHPvOb":["All files are hidden by view filters."],"WL6puM":["Path resolves outside project"],"WMIKXK":["Are you sure you want to delete ",["targetCount"]," selected items? Folders and all files inside them will be deleted. This action cannot be undone."],"WPwDin":["Open folder on disk"],"WR0y2O":["Share folder"],"WRNXKp":["Searching"],"WWcqsG":["Start here: what this is and how it's organized."],"WZ-vBy":["Permanently deletes <0>",["targetGitPath"],"</0> and all its git history. Working files stay in place. If the parent git repo is intentional (e.g. you cloned it), cancel and pick a location outside it."],"Waiy-j":["The agent's persona, values, and voice."],"WamGNs":["Failed to load PDF: ",["error"]],"WcWS__":["Download file"],"Wcv-Zi":["Make this knowledge base available as a Claude Skill."],"We7h2I":["📝 or assets/icon.png"],"Weq9zb":["General"],"Wgmlsw":["Fetching"],"Wh0im4":["editing [[",["realCurrentDoc"],"]]"],"WhOsNE":["Strikethrough"],"WkTLN7":["Show only markdown files"],"WmPbvm":["Get product updates in your inbox."],"Wq6Wcm":["Please enter a valid email address."],"WqLq6M":["Open with AI ",["displayName"]],"Wt5W56":["Sync is off — your edits will not sync to the remote repository."],"Wtw22s":["Installing"],"WyQxwa":["Connect this project to GitHub to share."],"WyXG7w":["Close all"],"Wyxs0x":["Path cannot contain \\"..\\""],"X0ttSN":["No tags match \\"",["tagListQuery"],"\\"."],"X7u0xR":[["0"]," templates available"],"X8kjQX":["Re-authenticate with GitHub"],"X9VpsP":["Loading folder contents"],"XAyxsa":["Check out remote branch"],"XDzAnp":["Opens in a new tab"],"XH30C4":["document"],"XJOV1Y":["Activity"],"XPJ0sN":[["settingsDescriptorLabel"]," properties"],"XPqe3B":["Create new tag #",["tagValue"]],"XRuL0i":["Create page"],"XU0OXn":["Enable auto-sync"],"XV5sC0":["Open worktree"],"XW18jo":["Page headings response did not match success schema"],"XYlJJT":["Setting up"],"XcGbim":["Show hidden files"],"Xet9MX":["Failed to load backlinks"],"Xewl6B":["Your local copy is behind. Pull the latest changes, then open the link again."],"XfzqjK":["template \\"",["name"],"\\""],"Xl-UUg":["guides/install or https://example.com"],"XmJfZT":["name"],"XnlF3W":["Add the next matching source selection."],"XnoA1k":["This ",["targetNoun"]," only exists on branch <0>",["shareBranch"],"</0>. You have uncommitted changes that prevent switching. Commit or stash your changes, then open the share link again."],"XopE_I":["Failed to parse backlinks error response (HTTP ",["status"],")"],"XpIZmv":["Fenced code block with monospace text."],"XqNHcm":["Couldn't update skill targets: ",["0"]],"XtRoxT":["Page ",["pageNumber"]],"XuQzrk":["Couldn't restart the server — another process owns it. Quit other OpenKnowledge windows for this project, then try again."],"XvPJaT":["Diff layout"],"Xv_ijG":["https://github.com/owner/repo or owner/repo"],"Xw_maT":["Type a query, then press ↵ to search your pages by meaning."],"XyOUTJ":["Exit merge"],"Xzy0s0":["Remove ",["fullLabel"]," from context"],"Y-Urt2":["Block math equation rendered with KaTeX from a LaTeX source string."],"Y1QMlM":["Get set up"],"Y1kX2z":["OpenKnowledge initializes at <0>",["projectDir"],"</0> — the parent of <1>",["pickedRelative"],"</1> because it contains a <2>.git</2> folder (one .ok/ per git repo). <3>Content directory</3> defaults to <4>.</4> (the whole repo); type a sub-folder to narrow it."],"Y6SK9K":["Show source"],"Y8ViJx":["A newer version may have been deployed since this tab opened."],"YC6_wP":["Edit ",["keyName"]],"YEP3X2":["Delete a table when the active table cell selection covers the full table."],"YGIi_c":["Reinstall"],"YJ1BTp":["A skill with that name already exists."],"YKLP_-":["Template renamed"],"YPFBfr":[["detail"]," - ",["kind"]," \\"",["createdPath"],"\\" still exists on disk"],"YSFv5w":["No git repository — config sharing does not apply here."],"YTLmTM":["Remove the parent <0>.git</0> folder"],"YW7Q86":["Search settings not yet loaded — try again in a moment"],"Y_kL7X":["Customize how the editor looks and behaves."],"YaeyFh":["Pulls may overwrite uncommitted edits in your local files."],"Yea-K5":["Restore to this point"],"Yi0VMG":["Upload ",["keyName"]],"YjhKI5":["Cloning..."],"YlDuro":["Fit height"],"YsEYYS":[["behind","plural",{"one":["#"," commit behind"],"other":["#"," commits behind"]}]],"YwPUUP":["This pack is already set up here."],"YyXtnN":["Underline"],"Z1LF1M":["Sharing a doc needs a GitHub repository. Create one for this project."],"Z2M5XM":["Reason: ",["reason"]," (",["osDetail"],")"],"Z3FXyt":["Loading..."],"Z5HWHd":["On"],"Z5h97D":["Hide files and folders from your knowledge base. Hidden items don’t appear in the file tree, search, or AI tools. <0>Learn more about patterns</0>."],"Z8KDox":["Enter a folder name (e.g. brain)."],"Z8lGw6":["Share"],"ZARuZJ":["Couldn't load files"],"ZBYKxv":["Reverts every change this agent made to <0>",["docName"],"</0> this session (",["burstCount","plural",{"one":["#"," burst"],"other":["#"," bursts"]}],"). Other files and writers are unaffected."],"ZBt4rI":["Instruction for the AI"],"ZLQol-":["You can turn this on later in <0>Settings → Sync</0>."],"ZNK2Tq":["root"],"ZQJ1IV":["Activate the last editor tab."],"ZQLDTl":["created folder"],"ZU8VV_":["Remove failed: ",["error"]],"ZWgr0b":["In a subfolder"],"ZWolSV":["You picked the filesystem root (/). Scaffolding here will scan every file on this machine — make sure that's what you want."],"ZWwYwM":["Base branch"],"ZWxfrc":["cleared folder properties"],"ZWyHmq":["This project"],"ZYtq3m":["Connect the AI tools you use to this specific project. These files live in the project folder, so anyone who opens it gets the same setup."],"Zf0w-R":["Take a piece of writing from a rough idea to a finished draft to something you're ready to share. Good for blog posts, essays, or anything you want to move through clear stages."],"ZgGuA4":[["0","plural",{"one":["File"],"other":["Files"]}]],"ZhhOwV":["Quote"],"ZjtgI-":["Command palette"],"Zon_qG":["Mirror source <0>",["label"],"</0>"],"ZptNUh":["Show ",["hidden"]," more"],"ZsGpr_":["Paste link"],"Zue_jx":["Your GitHub token is missing required scopes. Try signing in again."],"Zul8Ry":["never"],"ZvzbDF":["Add it directly to this project."],"ZxXhLY":["Hide Files (",["sidebarShortcut"],")"],"Zz25kq":["Show Files (",["sidebarShortcut"],")"],"_5qBNl":["AI tools & CLI"],"_6FVBz":["Jump to tab 1-8"],"_7UQ7y":["Whole word"],"_8quCH":["From template"],"_902BE":["This ",["targetNoun"]," was shared from branch <0>",["shareBranch"],"</0>. You're currently on <1>",["currentLabel"],"</1>."],"_BthEY":["Open in ",["shareBranch"]],"_NX6gG":["Managing project AI tools is unavailable in this build."],"_PACVa":["Release notes"],"_PBJRl":["Add at least one letter or number."],"_QwkMu":["No matching paths"],"_RcqUM":["You picked your home directory. OpenKnowledge will index everything in your home tree — large and may surface personal files."],"_TDESN":["Network error - ",["kind"]," \\"",["createdPath"],"\\" still exists on disk"],"_TF8ep":["Failed to render PDF"],"_VRtd7":["Couldn't send the selection — please try again."],"_W-elG":["(inline)"],"_WPP7e":["Read-only copy of a MirrorSource block from another doc. Edit at the source and it updates live."],"_XWY2J":["Terminal disabled"],"_ayOfA":["A knowledge base that follows Google's Open Knowledge Format, a shared way of organizing what you know. Pick this if you want your notes to work well with other tools that understand the format."],"_bth6g":["Claude Code is installed, but OpenKnowledge tools aren't connected to it yet."],"_eguJc":["Uploading"],"_gkGSK":["deleted template"],"_hPpdX":["Skill renamed"],"_pY_Vq":["The repository was moved, renamed, or deleted."],"_qD6mn":["Pick the folder where you've cloned it."],"_rP3HI":[["minutes"],"m ago"],"_tekeB":["updated folder properties"],"_tjopj":["Paste duplicate"],"a-cKXz":["Select all source"],"a3H_MR":["Open and focus the Ask AI composer for the current editor selection."],"a5Gha5":["Local changes blocked the merge"],"a5W0q0":["Are you sure you want to delete ",["folderName"],"/ and all files inside? This action cannot be undone."],"a9OzSn":["No pages found for \\"",["trimmedQuery"],"\\""],"aBgwis":["Scope"],"aByJ8j":["How does sharing work?"],"aE2_XM":["One pattern per line — appended to <0>.okignore</0>."],"aENGMB":["Semantic search adds meaning-based ranking to the search tool so conceptually-related pages surface even without shared keywords."],"aM23Wr":["page-name"],"aOp3hw":["Couldn't move to Trash"],"aWlJai":["Starting sign-in flow"],"a_u4ck":["Loading tags"],"aaE55D":["Clear ",["keyName"]],"aalx4E":["Editing broken MDX source: ",["reason"]],"abiHje":["Delete selected items"],"adsMWO":["Resolving deltas"],"aiArms":["We couldn't clone this repository."],"ajz9F8":["Couldn't load conflict content for ",["filePath"],". Try reloading the page."],"aoa6xA":["network error (is \`ok ui\` running?)"],"arUUsK":["Product updates"],"az8lvo":["Off"],"b3Thhd":["Upload failed"],"b4AQFK":["Open activity panel for ",["tooltipName"],", editing ",["realCurrentDoc"]],"b4VvP-":["Existing branch <0>",["trimmed"],"</0> will be checked out into its own window, under <1>.ok/worktrees/</1>."],"b4itZn":["Working"],"b5aNbi":["The ",["targetNoun"]," could not be opened — try navigating to it manually."],"bBE5tC":["Detected on this machine"],"bBcFK_":["Open emoji picker for ",["keyName"]],"bD8I7O":["Complete"],"bGa3Fk":["Uploading file"],"bH382I":["Edit this HTML — the preview updates live."],"bSD4im":["Search worktrees and branches"],"bS_boY":["Replace current match"],"bUUVED":["Asset"],"bV6DJA":["Who you are, so the agent has your context."],"bWLmRK":["Could not fetch branch. Check your connection."],"ba3vIW":[["templateCount","plural",{"one":["template"],"other":["templates"]}]],"bcDHUM":[["descriptorLabel"]," — render error, source editable below"],"bcjYUA":["Fold or unfold source"],"bkQRMh":["Paragraph"],"blFttG":["Search projects"],"bmC18N":["Clearing local collaboration data for \\"",["docName"],"\\" before reconnecting."],"brCtGB":["History unavailable"],"bultyE":["When enabled, the agent opens or refreshes the preview after each edit. Disable if you manage your own preview window (OK Desktop, a browser tab on another display, etc.)."],"bwil08":["Building <0>openknowledge.skill</0> and opening the Claude Desktop App"],"c1LZZH":["Link copied."],"c5f7sm":["Code block language: ",["currentLabel"],". Click to change."],"c5rF4v":["What is this knowledge base for?"],"c863eW":["Could not switch to ",["shareBranch"],". Try switching manually."],"c8iK2Y":["No templates found."],"c8jBgX":["Checking for updates on GitHub"],"cEoyWz":["Add item to ",["keyName"]],"cF9DyA":["Reconnecting after server restart"],"cIptmH":["In the Claude Desktop App"],"cKjLuT":["(project + user)"],"cOSAfL":["No repositories found on your GitHub account."],"cOrTMo":["Your share link is ready below."],"cRHuuI":["Couldn't copy path"],"cSCbv3":["BETA"],"cUK8lW":[["conflictCount","plural",{"one":["#"," conflict"],"other":["#"," conflicts"]}]],"cUk6TF":["Sync failed — check the server logs for details."],"cV7LOw":["Team Wiki"],"cZGNlb":["Add another pattern"],"cZI5AL":["OK Desktop"],"cZ_8zB":["Stays on this computer."],"cdm00A":["No Incoming"],"cdmk8A":["Uncommitted changes"],"chL5IG":["Community"],"cklVjM":["Timeline"],"cn1sLi":["Couldn't connect OpenKnowledge tools to Claude Code. Please try again."],"cnGeoo":["Delete"],"cqQyPB":["Folder name"],"crqzW5":["AI tools"],"cs4mps":["Config sharing"],"csDS2L":["Available"],"ct2kv5":["No headings in ",["pageTarget"]],"cuA8QW":["Organize specs"],"d1JjXo":["Your local copy of branch <0>",["branch"],"</0> is behind. Pull the latest changes, then open the link again."],"d2uTPx":["Server error (HTTP ",["status"],")"],"d5rK4X":[["chars","plural",{"one":["char"],"other":["chars"]}]],"dD7NPy":["Outline"],"dDpCOp":["Rename succeeded but the sidebar may be out of date — refresh to resync"],"dEgA5A":["Cancel"],"dGAdpH":["New branch <0>",["trimmed"],"</0> will be created from <1>",["currentBaseLabel"],"</1>, in its own worktree under <2>.ok/worktrees/</2>."],"dIYSqk":["remote"],"dJw2_7":["Saved with the project for your team."],"dMsx3p":["Home page and navigation hub."],"dN20LW":["Semantic search is on, but no API key is set — search falls back to keyword matching. Add one in <0>Settings → Account</0> (it's stored once for your whole machine)."],"dNM58w":["Claude Code (claude) isn't installed or on your PATH."],"dOHMA0":["Failed to move"],"dOxPd4":["Footnote"],"dPOFid":["Show or hide terminal"],"dTaauv":["Reason: ",["reason"]],"dUCQo4":["Renamed to \\"",["trimmed"],"\\""],"dUQ7_J":["Add meaning-based ranking to search so conceptually-related pages surface even when they share no keywords. This setting applies only to this computer."],"dURmlQ":["\\"frontmatter\\" is a reserved property name"],"dXWMFn":["Removes this skill from your editors."],"dbapvC":["Follow us on social media"],"dbhUX1":["Hide this file"],"dbtjJh":["(opens in new tab)"],"djc1l9":["More than ",["0"]," requests were blocked by the preview's security policy"],"djjdjr":[["deleteCount","plural",{"one":["Delete"],"other":["Delete ","#"," items"]}]],"dprWmL":["Anchor in this page"],"dr1vFs":["Replace all matches"],"dvGKu2":["Shared auto-sync default"],"dw_3cv":["Rename skill"],"dw_dUJ":["Failed to duplicate path"],"e0NrBM":["Project"],"e1Rn_k":["Open containing folder"],"e1hptq":["Embed a video with native player controls."],"e4GHWP":["Pull"],"e4PbgC":["Duplicate the file-tree item copied from the Files sidebar."],"e8L17t":["A non-empty folder already exists at this path. Pick a different folder."],"e8zRrb":["Show Files"],"eBIT9h":["Paste failed.",["restoreSuffix"]],"eFJkVt":["Clone failed: ",["cloneError"]],"eG8Jsg":["Toggle source tab focus mode"],"eGUbmF":["Copy selected file or folder"],"eJitUk":["Upload from computer"],"eKThTQ":["Failed to reorder"],"eLl1VX":["Failed to update the embeddings endpoint — ",["detail"]],"eNQGRb":["Inline LaTeX math rendered with KaTeX."],"ePK91l":["Edit"],"eQkgKV":["Installed"],"eQxm13":["Failed to update attachment location — ",["detail"]],"eTL5y9":["Show selection preview"],"eTsJYJ":["description"],"eVPynQ":["Open <0><1>",["verificationUri"],"</1><2/></0> and enter this code:"],"el312q":["Install skills into"],"emgiet":["Authoritative content; mirrored verbatim everywhere it's referenced."],"eneWvv":["Draft"],"epuNYK":["Mark a block as the source of truth. Mirrors elsewhere update live as you edit it."],"euc6Ns":["Duplicate"],"evs0iw":["Tags matching \\"",["tagListQuery"],"\\""],"f1XQyZ":["Move block"],"f65AOQ":["Start from"],"f8jU-L":[["0"],"/",["1"]," — ",["2"]],"f9lQNJ":["Adds a managed block to"],"fBHvBn":["There's no project folder for this window, so a terminal can't start here."],"fG0X0e":["Install ",["brand"]," →"],"fIgqfQ":["Reinstalling"],"fJgQHX":["Failed to create file"],"fNr-MX":["Disable semantic search"],"fR-Kdc":["(project-level only)"],"fVcm9t":[["0","plural",{"one":["#"," doc"],"other":["#"," docs"]}]],"fWi7pn":["Initialize starter pack"],"fWsBTs":["Something went wrong. Please try again."],"fYKgzG":["Failed to load recent projects."],"fYjgXu":["Unordered list of items."],"f_PkYv":["Restarting closes this project's server. Connected agents (Claude Code, Codex, Cursor) will see their OpenKnowledge MCP connection close unexpectedly — you may need to restart the agent, or toggle its OpenKnowledge MCP server off and on, to reconnect."],"fbdLmk":["Toggle bold formatting."],"fbsiBw":["Something went wrong starting the terminal."],"fcgvCA":["Claude"],"fiMNLl":["Sync settings not yet loaded — try again in a moment"],"fj5YiP":["Downloads a fresh copy from GitHub."],"fnlBN4":["Auto-approve settings not yet loaded — try again in a moment"],"fo0VXg":["Uninstall"],"fqSfXY":["Replace"],"fuJZKk":["Search branches"],"fwhX-N":["Indent or outdent source"],"fxbCNQ":["Synced. The link is up to date."],"g3UF2V":["Accept"],"g4WlQK":["Project AI tool management is only available in the OpenKnowledge desktop app."],"g4XBm0":["Small section heading."],"g58Kwy":["<",["descriptorLabel"],"> failed to render (likely a bad prop). Copy the source to see what went wrong, or delete the block."],"gBbxn_":["Checking sign-in status"],"gGVP4q":["Click <0>+</0> <1/> <2>Create skill</2> <3/> <4>Upload skill</4>."],"gHSAWT":["Create worktree <0>“<1>",["typedName"],"</1>”</0>"],"gITz7o":["Move the cursor or extend selection through CodeMirror's standard source-editor navigation keymap."],"gJR87V":["Could not create the project folder. Pick a different folder."],"gKi-a_":["New project"],"gQV-9w":["Branch switched but the ",["targetNoun"]," could not be opened — try navigating to it manually."],"gUlRQj":["Orphans"],"gYuDfu":["Pick a starter pack to scaffold your project with ready-made folders and templates."],"gYz2ep":["Expires in ",["timeLabel"]],"gbHcbI":["Failed to delete property"],"gfdqcY":["Couldn't apply the change: ",["0"]],"gfohmY":["Connect tools"],"ggm6JX":["This page doesn't exist yet. Open it to create the page in the editor and collapse the graph."],"ggs9f8":["Search files, folders, or commands"],"gijbne":["Failed to rename path"],"gk_-qj":["Couldn't rename template: ",["0"]],"gljvbT":[["words","plural",{"one":["word"],"other":["words"]}]],"glzsS_":["Pan right"],"gmJ0An":["Failed to open folder."],"goO4Ll":["Editor status bar"],"gp3I7-":["Before syncing, set your identity for git commits:"],"gtEbeW":["Highlight"],"gvApb7":["Turn the things you read into clear, trusted articles. Save a source, figure out what it means, then keep the final version so you can rely on it later."],"gwykHF":["This doc hasn't synced to GitHub yet. The link will work after the next sync."],"h-AdvS":["The folders and templates are already here, so there's nothing to add."],"h06R3C":["No pages are missing outgoing graph links."],"h6EvY-":["This will replace the current document content with the version from <0>",["relative"]," (",["absoluteTime"],", ",["entrySha"],")</0> by <1>",["authorName"],"</1>. Your current content is already saved in the timeline — you can restore it anytime."],"h7FzJC":["Link-graph response did not match expected shape."],"h9QFb9":["Skill \\"",["0"],"\\" deleted"],"hBMK4W":["Project templates"],"hCOLSd":["Keep a written record of how your product gets built. A home for proposing ideas, recording decisions, writing specs, and capturing what you learned after something broke."],"hDEaQu":["Connect OpenKnowledge to other tools you use."],"hDKtoF":[["diffHrs"],"h ago"],"hDoLrm":["Remove ",["projectName"]," from recent projects"],"hGmuTc":["Docs tagged #",["tagDocsName"]],"hHMv6l":["Delete block"],"hIQkLb":["New chat"],"hItdtk":["Browse folder"],"hLy8b1":["Updated to Version ",["version"]],"hQXiDc":["Search branches..."],"hSBIG-":["A title, description, tags — anything that describes this folder."],"hSySVc":["Install handoff failed: ",["msg"]],"hXUWyd":["Value is required"],"hXbSxc":["Asset: ",["title"]],"hY8pka":["Select next occurrence"],"hYDc6B":["Name cannot be empty"],"hYgDIe":["Create"],"hZoBHK":["Empty starting content"],"haHgQj":["Copied relative path"],"habOU_":["Failed to update the auto-approve setting — ",["detail"]],"he3ygx":["Copy"],"hjO0Mq":["Add tab"],"hmYd9H":["Keep track of the people and companies you work with and the meetings you have with them. Good for remembering who someone is, how you know them, and what you last talked about."],"hnq8fP":["Remove ",["label"]," from context"],"hpDtUm":["External wiki link"],"hpzRlK":["Reopen closed tab"],"hwFOFD":["Settings failed to load"],"hxBHxQ":["A line with a footnote<0><1>[1]</1></0> and a definition shown below."],"hxEUVJ":["Initialize ",["selectedPackName"]],"hyCxJY":["Open that worktree instead"],"hynz2K":["Download started"],"i-ShMB":["Diagram"],"i1flq_":["Wiki link suggestions"],"i3f2kh":["No matching commands."],"i92eAT":["We'll create a repository and start syncing — no terminal needed."],"i9OyGp":["Undo or redo"],"i9TPUi":["This ",["targetNoun"]," isn't on branch <0>",["branch"],"</0>. It may not have been pushed yet."],"i9toLO":["Agent configuration file"],"iAoh55":["Update \\"",["0"],"\\"?"],"iDZtvM":["Failed to load templates: ",["message"]],"iEQQyu":["Agent"],"iEYxO4":["Show thumbnails"],"iGCs04":["No templates available"],"iH8pgl":["Back"],"iHAJDj":["Resolving default location"],"iKSP5j":["Word wrap"],"iKZkk1":["Property value"],"iMkWoF":["Turn on"],"iNFKkm":["No diff."],"iO8V-7":["Create worktree"],"iOHg1t":["Open embedded URL in new tab"],"iSLIjg":["Connect"],"iSQTsg":["Ordered list"],"iSnkwB":["Failed to open cloned project."],"iTlqm3":[["ahead","plural",{"one":["#"," commit ahead"],"other":["#"," commits ahead"]}]],"iTylMl":["Templates"],"iXTp5j":["Scope: "],"idD8Ev":["Saved"],"ig5vUe":["Failed to load file"],"iilQXA":["Folder duplicated"],"ijLc3m":["Bullet list"],"ilodsp":["Let agents use OpenKnowledge without asking"],"ipn17C":["The <0>type</0> every document created from this template gets (e.g. <1>research-note</1>). Keeps new docs Open Knowledge Format–conformant."],"iqIDv4":["Sync status unavailable"],"iqugog":["Initialize failed: ",["errorDetail"]],"irFGwu":["Template list"],"ircigK":["Blank project"],"irrm_E":["Remove selection"],"isRobC":["New"],"itxlnr":["Setup files include: <0>.ok/</0>, AI-tool MCP configs (<1>.mcp.json</1> and per-tool files), project skills.<2/><3>Shared</3> commits them to git, so anyone who clones the repo gets the same setup. <4/><5>Local only</5> keeps them out of git (via <6>.git/info/exclude</6>)."],"iuTKci":["No edits yet."],"iycx_A":["Pushing"],"j9Vqvc":["inherited"],"j9tqwO":["Not in sidebar"],"jAMpHn":["What is a starter pack?"],"jBVUXo":["Couldn't open the terminal — please try again."],"jC8LSZ":["Reset view filters"],"jEZ6Lf":["provisional"],"jEdF24":["Missing page: ",["linkTitle"],". Click to create."],"jKd3AP":["Could not enable the terminal: ",["0"]],"jPUPvG":["Couldn't resolve the conflict for ",["filePath"],"."],"jRHdCz":["Failed to load PDF"],"jSO1X5":["Inherited templates can't be renamed here — rename it in the folder that owns it."],"jSY41h":["\\"",["docName"],"\\" took too long. Check your connection."],"jTLWxh":["Embed an external page in an inline iframe (docs, demos, Figma, CodeSandbox)."],"jX0IPx":["A skill with this name already exists."],"jZ_E5M":["Fetch failed — check the server logs for details."],"j_Z6g7":["Shared default"],"jbSG8V":["Show Files (",["sidebarShortcutLabel"],")"],"jdGUeI":["Couldn't create template: ",["error"]],"jerqF0":["Loading branch state"],"jhtG3I":[" Your selection has been restored."],"jjtmV_":["First file name"],"jol95m":["Failed to open Project Navigator."],"jtg_8-":["Build a knowledge wiki about the different types of flightless birds. Start with an overview page, then add cross-linked pages for each major group (ratites like ostriches, emus, and kiwis; penguins; and flightless rails), the regions they live in, and a timeline of how flightlessness evolved."],"ju38ms":["This project has no git repository — sharing mode does not apply. Initialize a repo to enable the toggle."],"jwnpdM":["A template named <0>",["trimmedSlug"],"</0> already exists here. Saving creates a local copy that overrides it for this folder."],"k0vc0N":["New terminal tab"],"k4CuuV":["Ready-made folders and templates to get you started quickly. Select a pack to preview what gets created, then add it to your project."],"kCNU4q":["Indexing your pages — ",["semanticIndexedCount"]," of ",["semanticTotalCount"]," ready. Results may be incomplete."],"kCqCyf":["Open CodeMirror's lint diagnostics panel."],"kFLlsI":["Insert a footnote reference + matching definition stub."],"kLv8d3":["Your copy of branch <0>",["shareBranch"],"</0> has changes that aren't on GitHub. The ",["targetNoun"]," will appear once the branch syncs."],"kNqMMd":["Folder"],"kUn-CN":["Sync off"],"kV2YZv":["Don't see <0>Skills</0>? Enable <1>Settings <2/> Capabilities <3/> Code execution and file creation</1> first."],"kYL1lH":["Agent activity"],"k_pade":["Config sharing is now shared. Commit the OK files to share with your team."],"k_yIIc":["Will be created at: <0>",["targetPreview"],"</0>"],"kdzzOK":["Off — search ranks by keyword only. No content leaves this computer."],"keNFEd":["Set identity"],"khCa4M":["Teaches coding agents in this project to read and write through OpenKnowledge."],"kj9pAE":["Creating page"],"kknhfj":["No changes"],"kmKqZg":["Clusters"],"knjOzA":["Tag value"],"kolRU1":["Do you want to permanently delete instead?"],"kpqWwG":["This ",["targetNoun"]," was removed from branch <0>",["branch"],"</0>."],"ku0yLQ":["Pages are embedded the first time a search needs them."],"ky9Tuc":["Edit ",["0"]," source"],"l17ab4":["Could not write project files. Try a different location."],"l1aQKz":["Visual editor table"],"l1l8sj":[["0"],"d ago"],"l3s5ri":["Import"],"l46MqT":["Next tab"],"l6OXqI":["No installed agents found"],"l6kpzR":["This ",["targetNoun"]," has been moved, renamed, or deleted in your local copy of branch <0>",["branch"],"</0>, and that change hasn't synced yet."],"l8G3S9":["Auto-sync is off — you don't have permission to push to this repo"],"lAiyU_":["Only the current document uses <0>#",["tag"],"</0>."],"lCC_D5":["Subscribing..."],"lGs_bQ":["Page <0>*</0>"],"lHCR4I":["Clear the field to reset back to the default OpenAI endpoint."],"lHwYMr":["Server error: ",["status"]," ",["statusText"]],"lI0Td2":["Use letters, digits, <0>_</0> and <1>-</1> only."],"lIn9L9":["Disable sync"],"lPzyrU":["All hunks resolved"],"lVWEIL":["Indexed ",["embedded"]," of ",["total"]," pages."],"lWNpNB":["Add cursors or select matching occurrences through CodeMirror."],"lXKZGw":["Heading 1"],"lZAiSP":["Backlinks response did not match expected shape."],"l_FAT6":["Use letters, digits, <0>-</0> or <1>_</1> only."],"l_UFPv":["Properties"],"lb_UU4":["Sync now"],"lbkOif":["Undo or redo visual-editor changes through TipTap collaboration history."],"lhjq3G":["Reset ",["labelText"]," to default"],"ljHjfg":["That branch is already open in another worktree."],"lkYioO":["Show or hide document panel"],"ll2yNl":["Content directory"],"lond3p":["Shows above the code body. Round-trips as \`title=\\"...\\"\` in markdown."],"lrhetp":["+ ",["overflow"]," more"],"ls1N1w":["(missing)"],"lyWa43":["Project-level disconnected pages"],"lzmtKp":["Failed to load folder properties: ",["message"]],"lzwo7p":["Could not open GitHub sign-in. Please try again."],"m16xKo":["Add"],"m2T1Xj":["Tag #",["tagValue"],", ",["uses"]],"m4v3XT":["Undo last edit on ",["docName"]],"m6YGpY":["Active panel content for the selected tab shows here."],"mBltnd":["Path suggestions"],"mGaZwZ":["See the full install guide"],"mHVPm5":["Reconnect required"],"mLAjyL":["Give the AI tools you use access to read and update your projects. Checking a box sets it up right away; unchecking removes it."],"mNY1G6":["Undo all edits"],"mPneVR":["Updated \\"",["display"],"\\" to ",["0"],"."],"mPy9lS":["Organize my existing specs into a linked index grouped by area, and flag any that have drifted out of sync with the current code."],"mU3j1b":["Remove item ",["0"]],"mVFyH-":[["accessibleLabel"]," (conflict)"],"mWVJRX":["Collapsible section with a clickable summary."],"mY8U64":["Teach agents a repeatable task. You can edit the body after creating."],"mYGY3B":["Date"],"mYzDD_":["A worktree folder for that branch already exists."],"mZ1r4i":["Create a document from ",["label"]],"maDWIB":["Mirror source <0>api-spec</0>"],"makN88":["No patterns yet. Type a folder or file name below to start hiding files."],"mdKFEy":["You cancelled loading \\"",["docName"],"\\"."],"mdzKSV":[["nodeCount","plural",{"one":["#"," node"],"other":["#"," nodes"]}]],"mf37rL":["Retrying"],"mg0YGL":["Source multi-cursor and multi-select"],"mk2poV":["e.g. server.ts"],"mmpzAq":["Wrap long lines in the markdown source editor."],"mo22UP":["Toggle inline code formatting."],"mqSwZH":["<0>Mirror anchor not found.</0> No <1>",["mirrorSourceTag"],"</1> exists in <2>",["src"],"</2>."],"msOK6I":["Repositories you've already cloned may keep syncing through git's own saved credentials, even after you disconnect."],"msqUNq":["Ready-made folders and templates to get you started quickly."],"mu1O0q":["Open Knowledge can manage ",["0"]," editor skill(s) for this project. Import moves them into .ok/skills and replaces the .claude, .codex, etc. copies with symlinks — one place to edit, in sync everywhere. If those folders are committed to git, review the change first; symlinks can behave differently on some editors and on Windows."],"mwMF9u":["Open CodeMirror search in source editor mode."],"mxY24F":["Duplicate the focused file-tree item when focus is in the Files sidebar."],"n2lRue":["Commit or stash changes to switch:"],"n5n_vi":["Private repository"],"n6hXUm":["Auto-sync periodically fetches, pulls, and pushes commits to your remote git repository so your edits stay in sync across machines."],"n7aopT":["Editor mode"],"n8DwqQ":["Connects automatically the next time you open this project in a trusted Codex session."],"nCzR-G":["Copy code ",["userCode"]],"nD7Fx9":["This replaces the current skill content with the bundled version ",["0"],". Any local edits will be replaced — your current version is saved to history first, so you can restore it."],"nDT8qt":["Initialized ",["0"]," but could not open it."],"nJq7et":["Couldn't uninstall skill: ",["0"]],"nMSYz5":["This path is on an external volume (/Volumes/...). OpenKnowledge will lose track of files when the drive ejects."],"nNYV3Y":["and ",["remaining"]," more"],"nP-KFo":["New ",["0"]," chat"],"nP76lk":["Applies to all projects on this machine. Claude and Codex, started from the built-in terminal, auto-approve OpenKnowledge's read and write tools (Claude also auto-runs \\"ok open\\"). Deleting, moving, sharing, installing skills, other commands, and non-OpenKnowledge file edits still ask. Cursor, OpenCode, and Pi are unaffected. Best-effort per agent."],"nTwL53":["Open a doc to share its URL."],"nUNZL4":["Ask ",["0"]],"nWv1ja":["Manage hidden files in Settings → Ignore patterns."],"nYKerc":["(user-level only)"],"nYeBmY":[["hours"],"h ago"],"nbfdhU":["Integrations"],"ndeI89":["Use Cmd/Ctrl+C to copy the link below, or open OK in the desktop app."],"ndwmea":["unavailable on this platform"],"neRy3o":["Split list item"],"nfoduq":["create worktree"],"nft48x":["Stored at <0>.ok/templates/</0> in this project. Available in every folder (folder-scoped templates can override by filename)."],"ng2Ibo":["Branch name"],"nh3wwx":["Embeddings provider key"],"njBeMm":["Both"],"njU86j":["Property \\"",["trimmed"],"\\" already exists"],"noH1JX":["Couldn't reach collab server — ",["errorDetail"],". Try <0>ok status</0> or check <1>.ok/local/last-spawn-error.log</1>."],"npcziF":["Install on"],"nqV0Kk":["This folder hasn't synced to GitHub yet. The link will work after the next sync."],"nrGWJ7":["Git identity isn't set — commits use a default author. Set yours so teammates see your name."],"nskygk":["Choose agent"],"nxlOpL":["OpenKnowledge is using this GitHub account."],"ny6vNn":["OpenKnowledge is using a GitHub account provided by the gh CLI. There's no separate OpenKnowledge credential to disconnect."],"nzHlj8":["Close ",["0"]],"nzaV6Q":["Page thumbnails"],"o2yoFu":["Reveal in Finder, No workspace"],"o49mDZ":["Loading timeline history"],"o4dcAf":["Reveal in File Explorer, ",["hint"]],"o5gfs1":["This setting is per-machine and isn't shared with collaborators. It needs an API key set with <0>ok embeddings set-key</0>."],"o9CrsQ":["research-note"],"oAFVKX":["Failed to update the project sync default — ",["detail"]],"oAGN8p":["Remote branch <0>",["remoteCheckoutRef"],"</0> will be checked out as a new local tracking branch <1>",["trimmed"],"</1>, in its own window under <2>.ok/worktrees/</2>."],"oBXkm2":["Delete code block"],"oCHfGC":["Level"],"oCNLN8":["Toggle the bottom terminal panel. With text selected, stage it in the terminal's AI input instead."],"oCZkaG":["Copy path"],"oEgEn_":["A key is set, but the embeddings provider rejected it or was unreachable — search fell back to keyword matching. Check the key in <0>Settings → Account</0> and the embeddings endpoint setting."],"oJl7eO":["Unknown component: ",["componentName"]," — source editable below"],"oKBnk5":["More requests were blocked."],"oQA-cA":["Full path"],"oS1YpJ":["Open the Project Navigator."],"oXKEsy":["Delete an adjacent wiki-link or tag chip."],"oYepHb":["The terminal is turned off for this project. Turn it back on to run commands here."],"of3tF-":["You picked ~/Documents. OpenKnowledge will index every markdown file under it. If you only want to manage a sub-folder, choose a smaller scope."],"ogAuyr":["Back to document view"],"omXJcU":["Close others"],"optX0N":[["0"],"h ago"],"oqB2ez":["Previous match"],"osRqlv":["Open delete confirmation for the selected file-tree items."],"ot5BRK":["Duplicate selected file or folder"],"otE4aj":["Show external URL nodes"],"ou1hFW":["Toggle an ordered list."],"outYNy":["Duplicate name \\"",["keyName"],"\\""],"ovIGrT":["Local collaboration data for \\"",["docName"],"\\" could not be cleared. Reload to retry."],"p0Iq25":["Insert link"],"p9sdCy":["New ignore pattern"],"pAgkuZ":["Reopening \\"",["docName"],"\\" with a fresh local collaboration cache."],"pBROkv":["Thanks for subscribing. Watch your inbox for product updates."],"pEQFsW":["No matching projects."],"pFagOn":["Source editing"],"pHYP6v":["Open <0>Customize</0> in the sidebar <1/> <2>Skills</2>."],"pRc-Im":["Undone all edits on ",["docName"]],"pTPqMK":["Toggle a fenced code block."],"pWT04I":["Checking..."],"pWbsW6":["Loading docs"],"pZAs1T":["Failed to load outgoing links"],"pajIrl":["Could not turn off the terminal: ",["0"]],"pbwTg6":[["seconds"],"s ago"],"pckX1A":[["0","plural",{"one":["#"," use"],"other":["#"," uses"]}]],"pcqlQu":[["0","plural",{"one":["Folder"],"other":["Folders"]}]],"pgq_xf":[["0"],"/",["1"]," ",["2"]],"phM8Kh":["Found the repo but could not open the project. Please try again."],"pha01Y":["Project-level pages with no incoming graph edges."],"pkAft1":["Search failed."],"pmKdif":["Failed: ",["loadError"]],"pmOGtg":["Use the default OpenAI endpoint or override it with an OpenAI-compatible base URL for Azure or a self-hosted provider."],"pmUArF":["Workspace"],"ppDgFi":["Restart with this app's version"],"psfGPX":["MCP connections"],"pzutoc":["Italic"],"q2kXMG":["Inline Math"],"q4YJl_":["The terminal session ended (exit code ",["0"],")."],"q6-JVU":["Loading pages"],"q7F5am":["title"],"qAQVSD":["Page headings response was not JSON"],"qAhFeg":[["userName"]," · ",["tabCount","plural",{"one":["#"," tab"],"other":["#"," tabs"]}]],"qAx7xG":["Fixed folder in content root"],"qEIFZu":["Key ending in ",["keyHint"]],"qEue6Q":[" or "],"qFWMl-":["View as text"],"qNOgUu":["Edits at the source land here — no copy-paste drift."],"qRZh7J":["Let Tab leave the source editor instead of indenting."],"qSKu2v":["Source navigation and selection"],"qSxaOz":["Accept their deletion"],"qUB_o_":["Auto-sync is off — your edits stay local until you commit and push manually."],"qXg5W9":["File saves to <0>~/Downloads/openknowledge.skill</0>."],"qXsafh":["Publish to GitHub"],"qZv5ZR":["Config sharing toggle failed"],"q_9EcE":["Enable git auto-sync?"],"q_z77Z":["Heading levels"],"qaHyRJ":[["linkCount","plural",{"one":["#"," link"],"other":["#"," links"]}]],"qbfj1f":["Receiving objects"],"qdBUHP":["Couldn't load ",["fileName"]],"qi1F96":["Reveal in File Explorer"],"qiRoLb":["Summarize everything I changed this week"],"qioCwA":["Jump to page ",["pageNumber"]],"qjHMHf":["Failed to disable sync — ",["detail"]],"qo4zCg":["Path cannot contain backslashes"],"qpQwGC":["Describe what you're working on and the agent sets it up for you."],"qvWGzP":["Collapse all"],"qyLmWw":["Source editor search panel"],"r-OJYm":["Enter a valid branch name (no spaces, no leading dot, no \\"..\\")."],"r2huLx":["Undo, redo, or undo selection changes through CodeMirror history."],"r4R7AZ":["Network error during cleanup"],"r51jLC":["File saved & Claude Desktop App opened"],"r871ed":["Your knowledge base is now on GitHub at <0>",["ownerLogin"],"/",["repoName"],"</0>."],"rBc32v":["Couldn't reach the embeddings provider — press ↵ to retry"],"rFw02Q":["Uploading ",["keyName"]],"rJVoVX":["Source find results"],"rNifQd":["Remove property"],"rQAQus":["Couldn't save template: ",["error"]],"rQRrkB":["yesterday"],"rSoi6g":[["displayName"]," (",["bin"],") isn't installed or on your PATH."],"rVgSRB":["Collapse ",["docName"]],"rVxu1k":["No pages link here yet."],"rXz97P":["Numbered list of items."],"rZ9HZq":["To do"],"rZVMkf":["Visual editor replace input focused"],"rageVb":["Custom HTML with a live preview pane (sandboxed iframe)."],"rdU729":["Layout"],"rf6x3F":["Dock terminal to the bottom"],"rfFpcF":["Remove ",["chip"]],"rgPqOw":["Convert the current block to a paragraph."],"riqekz":["Suggestion menu navigation"],"rlUzXK":["Could not validate folder. Please try again."],"roAe2K":["Link URL"],"roiUQQ":["This page doesn't link to anything yet."],"rppgXF":["Disconnecting"],"rssK8c":["Ignore patterns (raw text)"],"rtdR4v":["Show or hide Files"],"rwrPbS":["Component boundary navigation"],"s-MGs7":["Resources"],"s-XOaI":["File name"],"s061i4":["Relative path"],"s0IDhW":["This file could not be found."],"s0J_k9":[["0","plural",{"one":["#"," key"],"other":["#"," keys"]}]],"s0_GnA":["Opening ",["openingLabel"],"…"],"s1c0ja":["Bullet List"],"s3caR3":["Deleting"],"sE7R19":["Could not load templates: ",["templatesError"],". You can still create a blank note."],"sER-bs":["Files"],"sFhaTJ":["Disambiguates similarly-named templates in the menu."],"sHrqDx":["Couldn't rename skill: ",["0"]],"sIGbBZ":["Convert selection to footnote"],"sIxSSP":["Resolve conflict in your terminal"],"sJK6pq":["Permission denied"],"sJWhgo":["Unknown component: ",["unregisteredComponentName"]],"sOxZaS":["Failed to load graph"],"sZ2IOu":["This ",["targetNoun"]," was shared from branch <0>",["shareBranch"],"</0>. It doesn't exist on your current branch (<1>",["currentLabel"],"</1>)."],"saIASg":["Second item"],"saYiIO":["Path cannot contain null bytes"],"seeS6l":["Setup OpenKnowledge in this folder?"],"shNd9t":["Slash command menu"],"si3L24":["Open an additional terminal tab. With text selected, stage it in the new tab's AI input."],"skf5Ix":["Indent or outdent source editor lines."],"snrVQ7":["probe failed"],"ssuwjF":["Branch"],"stlgky":["On — your search queries and the text of matching pages are sent to your embeddings provider (OpenAI by default) to compute embeddings."],"sxTdZI":["Loading paths…"],"sxjyRq":["Worktrees"],"sxkWRg":["Advanced"],"t-JXbf":["Notion-style inline row for a downloadable file. Drag-drop also works."],"t18QYR":["Unpin ",["accessibleLabel"]],"t2TkQ3":["Sync paused — resolve conflicts to resume."],"t422_7":["Uninstall everywhere"],"t4sFKC":["New branch <0>",["trimmed"],"</0> will be created from the current commit, in its own worktree under <1>.ok/worktrees/</1>."],"t6w1cq":["Open a blank editor tab."],"tAPZEx":["Below"],"tHKQ6j":["Renaming"],"tP5DDk":["Apply link"],"tUvUfp":["Use a folder you already have."],"tW_yvQ":["Expand ",["docName"]],"t_YqKh":["Remove"],"teD0H9":["Couldn't open a worktree for that branch."],"tfDRzk":["Save"],"tfi40B":["Failed to create page"],"tgWuMB":["Modified"],"thnPBX":["Activate the next editor tab."],"ti6aF_":["Ask ",["0"]," CLI"],"tiWX6q":["Source editor"],"tjXez2":["blog-post"],"toyw51":["Mermaid diagram controls"],"tsiTqO":["Paste your API key"],"tsyExA":["Connect your AI tools to OpenKnowledge"],"u-9fWA":["See <0>Architecture</0> for the system overview."],"u3BOHd":[["fileCount","plural",{"one":["#"," file"],"other":["#"," files"]}]],"u3YnKw":["Could not construct share URL."],"u3wRF-":["Published"],"u6Hp4N":["Markdown"],"u7H-Wn":["Show panel (",["panelShortcutLabel"],")"],"u7U_Ij":["Link the selected text, or edit the link under the caret."],"uA_jXp":["Switch and update branch"],"uCaIdy":["GitHub sign-in is missing or expired. Reconnect to resume syncing."],"uDlyqd":["Document the architecture of this repo: create an overview page that links to a page per major module describing its responsibilities and entry points."],"uF9ruK":["Saving"],"uFOL2y":["No project skills yet. Author one to teach agents a repeatable task scoped to this knowledge base."],"uFQbYd":["Home page and entry point."],"uGaIIS":["Check out worktree"],"uH_S-u":[["loadErrorTitle"],": ",["message"]],"uKRYiW":["Sync status unavailable — server error."],"uL_Wx8":["The terminal stopped unexpectedly."],"uM6jnS":["Restore failed"],"uO9WLl":["Push"],"uQNW00":["Detached HEAD — checkout a branch to resume"],"uQewpR":["Couldn't restart the server — it's running under a different account. Restart your computer to clear it, then reopen this project."],"uWtdQR":["No templates yet. Add one in this folder's Templates section, or in Settings → Templates."],"uWx2ZP":["Last sync"],"u_lS4C":["Clone complete — opening project"],"uaUc6t":["Restart server"],"ubMwcO":["The terminal session ended (signal ",["0"],")."],"ugoTXs":["folder"],"uhJEA2":[["count","plural",{"one":["#"," more participant"],"other":["#"," more participants"]}]],"uksqrP":["Repository not found. It may have been renamed, deleted, or moved."],"un8kBM":["Creating page: ",["linkTitle"],"."],"ur2XSb":["Visual editor"],"uuoHOU":["Command failed."],"uynXup":[["tokens","plural",{"one":["token"],"other":["tokens"]}]],"v-h2hx":["Delete ",["targetGitPath"]],"v2ZW0K":["Enable terminal"],"v41fCm":["File not found"],"v75Em9":[["uploadedCount","plural",{"one":["Uploaded one file"],"other":["Uploaded ",["uploadedCount"]," files"]}]],"v77jrg":["Visual editor selection"],"v7hK0U":["Use lowercase letters, digits, and hyphens only."],"v7lbnC":["Find next match"],"vAYoCZ":["Couldn't open the worktree. Try again."],"vDXqVv":["Insert a markdown hard break."],"vEJDlt":["The file is in your Trash; the file-watcher will reconcile."],"vGeNNQ":["Copy a prompt and paste it into your agent to set up your project."],"vIxrEk":["Fit width"],"vLyv1R":["Hide"],"vQIVHc":["Folder properties"],"vWc9a0":["Type to edit; <0>⌘ Enter</0> saves, <1>Esc</1> cancels."],"vZVeFG":["Upload failed — please try again"],"vbK_ZG":["Files sidebar"],"ve8vEM":["Code expired — please try again"],"vfRlCI":["Could not copy full path"],"vfWA_g":["You picked ~/Desktop. OpenKnowledge will index everything on your desktop."],"vhAnzJ":["Turn on semantic search?"],"viwC-K":["Failed to remove project."],"vppAju":["Where newly added attachments are placed."],"vv7kpg":["Cancelled"],"vvWZnu":["Diff unavailable"],"w3tVpc":["No links yet. Add wiki links or markdown links to build a graph."],"w3vFfL":["Hide Files"],"w4hMYl":["Could not read branch state for this project. Close this dialog and open the share link again."],"w6sBjd":["Terminal settings not yet loaded — try again in a moment"],"w7SsvI":["That folder isn't an OpenKnowledge project yet. Initialize it and open?"],"w7nm4K":["Indented blockquote for citations."],"wDgmsr":["\\"",["0"],"\\" install refreshed (",["1"],")"],"wGSHzy":["Activate one of the first eight editor tabs."],"wJijgU":["Location"],"wJo9oS":["Close find"],"wQp1V3":["Mirror of <0>",["src"],"</0>"],"wT4iQr":["Open visual-editor find with replace controls expanded."],"wTcjov":["No workspace"],"wXO4Tg":[["hrs"],"h ago"],"w_Sphq":["Attachments"],"wbv9xO":["Create new project"],"wbwHYD":["Enable sync"],"wccmX0":["Your embeddings provider API key, used only to create embeddings of your content for semantic search. Stored once for this machine in <0>~/.ok/secrets.yml</0> (readable only by your user account) and shared across all projects. Turn the feature on per project in This project → Search, where you can also override the endpoint."],"wdxz7K":["Source"],"weP6me":["Couldn't load docs — type @ again to retry"],"wlwXUk":["You picked ~/Downloads. Files there are usually transient — consider a stable folder instead."],"wn8EJi":["Skills teach agents repeatable tasks. Author them here; install a skill to project it into your editors' skill folders."],"wndeIl":["Project-level pages with neither incoming nor outgoing graph edges."],"wtcxiD":["Share this setup with your team?"],"wvbc1r":["Couldn't open document"],"wzq9Rv":["A branch with that name already exists. Open its worktree from the switcher instead."],"x-5mJ1":["Install on all"],"x2fr_j":["Graph"],"x3-2ta":[["packName"]," initialized (",["projectEntries","plural",{"one":["#"," entry"],"other":["#"," entries"]}],")"],"x57cJf":["Open link"],"xCJdfg":["Clear"],"xCdTnb":["Close new tab"],"xDBki3":["Heading suggestions"],"xFQRu4":["I already have it locally"],"xG4tb6":["Lost connection to \\"",["docName"],"\\"."],"xHGM4U":["Hide HTML preview"],"xK291b":["Two-page (odd)"],"xNyj3h":["Reinstall for Claude Chat & Cowork"],"xOTzt5":["just now"],"xSVO3J":["What gets created"],"xWEvuo":["Ask AI"],"xXo8FT":["Save failed: ",["error"]],"xYMPyY":["Paste was incomplete — ",["chunksCompleted"]," of ",["totalChunks"]," chunks landed.",["restoreSuffix"]],"xaDWAI":["Switch project"],"xbdtfY":["Markdown source"],"xc4g25":["Parse failed"],"xeXS4P":["Or use a starter pack"],"xeiujy":["Text"],"xhlFsx":["Inherited — set a value here to replace it."],"xiv-dW":["No files yet."],"xloBjn":["Relative Path"],"xnP32l":["No description yet — add one so agents know when to use this skill."],"xrVr_k":["Couldn't create skill: ",["0"]],"xsZhu-":["Page number"],"xzktOa":["Edit wiki link"],"y1t8bQ":["Settings sections"],"y3aU20":["Save changes"],"y46m5r":["The desktop app isn't responding. Refresh and try again."],"y5FUYi":["Suggestion menu open"],"y8B54M":["Couldn't send your prompt — please try again."],"yCX4jp":[" Your selection could not be restored."],"yEJ-sl":["The preview blocks resources that don't meet its security rules (for example plain http:// URLs, or code that uses eval). The content above may render incompletely."],"yFyZMJ":["No pages matched \\"",["semanticQueryText"],"\\" by meaning."],"yH7T4q":[["failedCount","plural",{"one":["1 file failed to upload"],"other":[["failedCount"]," files failed to upload"]}]],"yHikCO":["Open CodeMirror's go-to-line prompt."],"yIPXut":["Preparing search"],"yKu_3Y":["Restore"],"yLEyuq":["Product updates in your inbox."],"yLq4w4":["Separator"],"yMgL_E":["Find field navigation"],"yQE2r9":["Loading"],"yQyglE":["No matching docs"],"yUxR-Q":["Expand ",["keyName"]],"yWSvcf":["Content root"],"yWWThY":["Asset reference"],"yYR6za":["Display text"],"yZmvQ4":["This project's server (v",["0"],") is newer than this app (v",["1"],")."],"y_5CE8":["Item ",["0"]],"yaPGPa":["Open a project to manage its AI tool connections."],"yf5r22":[["keyName"]," type: ",["typeLabel"]," (inherited from folder properties; not editable here)"],"yhdqox":["Installed — ok is available in external terminals. Unchecking removes it; OpenKnowledge's built-in terminal and AI tools keep working."],"yitgD9":["Failed to load skill targets: ",["0"]],"yjExfe":["Branch <0>",["shareBranch"],"</0> is checked out in:"],"ylXj1N":["Selected"],"ymWJLd":["Show ",["0"]," more"],"ynIa4S":["Visual editor list item"],"ypw6My":["Showing top ",["0"]," headings — keep typing to narrow"],"ysxgu8":["project"],"yutJKi":["Checklist with checkboxes."],"yvG-l1":["Open source lint panel"],"yvHDYG":["Claude Desktop"],"yz7wBu":["Close"],"yzF66j":["Link"],"yzGPkm":["Expand graph"],"z-lawV":["worktree"],"z0a2EA":["Diagram from Mermaid source — flowchart, sequence, class, state, ER, gantt, pie."],"z1uNN0":["No emoji found."],"z2JdQ-":["Config sharing unchanged — see details below."],"z2funE":["Full Path"],"z5pqI8":["Cannot upload: no document is open"],"z60Lgn":["Saves the file to <0>~/Downloads/openknowledge.skill</0> and opens the Claude Desktop App. Requires Node.js or Bun on your PATH."],"zAsDLY":["Graph visualization of document links"],"zKxoPm":["Couldn't rename \\"",["0"],"\\": ",["1"]],"zL0LPh":["Global outside text fields"],"zLGXna":["No starter packs available."],"zLak8b":["Activate new tab"],"zQBg2C":["Move the current block up or down one position."],"zUhPuR":["Open containing folder, ",["hint"]],"zXj1rA":["Search by meaning"],"zZ_I5K":["Open project menu"],"zaXlhf":["The properties block at the top of this doc has a formatting error. Switch to source mode to fix it."],"zbymaY":[["0"],"m ago"],"zd00pH":["Copy Path"],"zgSFyG":["External link"],"zkz0Fg":["Set up syncing"],"zlErBl":["Page headings error response did not match RFC 9457"],"zo3Dl7":["Toggle thumbnails"],"zrP8HX":["Frontmatter every document created from this template starts with. Values are YAML — a list is <0>[a, b]</0>; <1>{",["date"],"}</1> fills in on create."],"ztKII6":["Failed to add item"],"zwBp5t":["Private"],"zyKa-I":["Star us on GitHub"]}`)},X$=`en`;qc.load(X$,Y$.messages),qc.activate(X$);var Z$=Symbol.for(`ok.client.logForwarder`),Q$=2e3,$$=[`log`,`info`,`warn`,`error`],e1={log:`info`,info:`info`,warn:`warn`,error:`error`};function t1(e){if(typeof e==`string`)return e;if(e instanceof Error)return`${e.name}: ${e.message}`;try{return JSON.stringify(e)??String(e)}catch{return String(e)}}function n1(e){let t=e.message.length+80;if(e.event&&(t+=e.event.length),e.fields)try{t+=JSON.stringify(e.fields).length}catch{}return t}function r1(e={}){let t=e.windowObj??(typeof window<`u`?window:void 0);if(!t||t.okDesktop)return;let n=t;if(n[Z$])return;n[Z$]=!0;let r=e.consoleObj??console,i=e.documentObj===void 0?typeof document<`u`?document:null:e.documentObj,a=e.flushIntervalMs??Q$,o=e.fetchImpl??n.fetch.bind(n),s=e.now??Date.now,c=[],l=0,u=null,d=!1,f={log:r.log.bind(r),info:r.info.bind(r),warn:r.warn.bind(r),error:r.error.bind(r)};function p(){if(u!==null&&(clearTimeout(u),u=null),c.length===0)return;let e=c.splice(0,100);l=0,d=!0;try{o(`/api/client-logs`,{method:`POST`,headers:{"content-type":`application/json`},keepalive:!0,body:JSON.stringify({entries:e})}).catch(()=>{})}catch{}finally{d=!1}}function m(e){if(c.push(e),l+=n1(e),c.length>100){let e=c.shift();e&&(l-=n1(e))}if(c.length>=100||l>=32768){p();return}u===null&&(u=setTimeout(p,a))}function h(e,t){if(!d)try{let n=gn(t.map(t1).join(` `)),r=t[0],i=typeof r==`string`&&r.length<=32768?r:void 0,a=i?Pr(i):null,o=a?.fields;if(o)try{JSON.stringify(o).length>8192&&(o=void 0)}catch{o=void 0}m({level:e,message:n,ts:s(),...a?.event?{event:a.event}:{},...o?{fields:o}:{}})}catch{}}for(let e of $$)r[e]=(...t)=>{f[e](...t),h(e1[e],t)};let g=e=>{if(d)return;let t=e;h(`error`,[`uncaught error: ${t.message} (${t.filename}:${t.lineno}:${t.colno})`])},_=e=>{d||h(`error`,[`unhandledrejection: ${t1(e.reason)}`])},v=()=>p(),y=()=>{i&&i.visibilityState===`hidden`&&p()};n.addEventListener(`error`,g),n.addEventListener(`unhandledrejection`,_),n.addEventListener(`pagehide`,v),i&&i.addEventListener(`visibilitychange`,y);function b(){for(let e of $$)r[e]=f[e];n.removeEventListener(`error`,g),n.removeEventListener(`unhandledrejection`,_),n.removeEventListener(`pagehide`,v),i&&i.removeEventListener(`visibilitychange`,y),u!==null&&(clearTimeout(u),u=null),c.length=0,delete n[Z$]}return{flushNow:p,uninstall:b}}function i1(e,t){return e.branch===void 0||e.branch===null||e.branch===``||t===``||e.multiCandidate!==!0?null:{message:`Opened on branch ${e.branch}`,description:t}}function a1(e){let t=e.bridge;if(!t)return;let n=e.setHash??(e=>{window.location.hash=e}),r=e.emitToast??((e,t)=>{_s(e,t)});return t.onDeepLink(e=>{let i=e.kind??`doc`,a={kind:i,path:e.doc,branch:e.branch??null};if(e.targetMissing===!0){as.arm(a);return}ei.arm(a),n(Dl(i,e.doc,i===`doc`?e.branch:void 0));let o=i1(e,t.config.projectPath);o!==null&&r(o.message,{description:o.description,duration:3e3})})}var o1=4e3,s1=1440*60*1e3;function c1(e){let t=e.bridge;if(t&&t.onboarding)return t.onboarding.onToast(e=>{if(e.kind===`ancestor-promote`){_s.success(`Opened existing OpenKnowledge project at ${e.ancestorPath}`,{duration:o1});return}if(e.kind===`startup-reclaim`){let t=[];if(e.mcp.status===`repaired`){let n=e.mcp.editors.map(e=>lr[e]??e).join(`, `);t.push(`repaired ${n} MCP integration`)}else e.mcp.status===`failed`&&t.push(`MCP auto-repair failed`);e.path.status===`installed`&&t.push(e.path.summary),e.path.status===`failed`&&t.push(`PATH install failed: ${e.path.summary}`);let n=t.length>0?t.join(`; `):`OpenKnowledge integrations checked.`,r=e.mcp.status===`failed`||e.path.status===`failed`,i=e.path.status!==`none`;_s[r?`error`:`success`](n,{duration:r||i?s1:o1,position:`bottom-left`});return}if(e.kind===`sharing-refused-tracked`){_s.error(`Config sharing unchanged: ${e.tracked.length} OK file(s) tracked upstream — see message below.`,{duration:s1,description:e.remediation});return}if(e.kind===`sharing-no-git`){_s.warning(`Local-only requested but no git repository was created. Switch later via Settings → Config sharing once the project is in a git repo.`,{duration:o1});return}let t=Uc(e.gitRoot,e.pickedPath)??e.pickedPath;_s.success(`Initialized OpenKnowledge at ${e.gitRoot} — opened parent of ${t} because it contains a .git folder`,{duration:o1})})}function l1(e){let t=(0,$.c)(18),{body:n,warning:r,restartLabel:i,cancelLabel:a,onRestart:o,onDismiss:s}=e,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(cs,{className:`mt-0.5 size-4 shrink-0 text-amber-500`}),t[0]=c):c=t[0];let l;t[1]===n?l=t[2]:(l=(0,Z.jsx)(`p`,{className:`font-medium text-sm`,children:n}),t[1]=n,t[2]=l);let u;t[3]===r?u=t[4]:(u=(0,Z.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:r}),t[3]=r,t[4]=u);let d;t[5]!==o||t[6]!==i?(d=(0,Z.jsx)(X,{size:`sm`,onClick:o,children:i}),t[5]=o,t[6]=i,t[7]=d):d=t[7];let f;t[8]!==a||t[9]!==s?(f=(0,Z.jsx)(X,{size:`sm`,variant:`ghost`,onClick:s,children:a}),t[8]=a,t[9]=s,t[10]=f):f=t[10];let p;t[11]!==d||t[12]!==f?(p=(0,Z.jsxs)(`div`,{className:`mt-1 flex flex-wrap gap-2`,children:[d,f]}),t[11]=d,t[12]=f,t[13]=p):p=t[13];let m;return t[14]!==l||t[15]!==u||t[16]!==p?(m=(0,Z.jsxs)(`div`,{className:`flex w-full gap-3 rounded-lg border bg-popover p-4 text-popover-foreground shadow-lg`,children:[c,(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[l,u,p]})]}),t[14]=l,t[15]=u,t[16]=p,t[17]=m):m=t[17],m}function u1(){return qc._({id:`f_PkYv`})}function d1(e){return e.serverRuntime===e.appRuntime?qc._({id:`FWQuPE`,values:{0:e.appRuntime}}):e.relation===`older`?qc._({id:`LhQlGR`,values:{0:e.serverRuntime,1:e.appRuntime}}):qc._({id:`yZmvQ4`,values:{0:e.serverRuntime,1:e.appRuntime}})}function f1(e){return qc._({id:`2YOwme`,values:{appRuntime:e}})}function p1(e){return qc._({id:`5DFPDh`,values:{appRuntime:e}})}function m1(e){return e===`eperm`?qc._({id:`uQewpR`}):qc._({id:`PqYWiC`})}async function h1(e){let t=_s.loading(qc._({id:`Kf7GG5`}),{duration:1/0}),n;try{n=await e.restartServer(e.config.projectPath)}catch{return}_s.dismiss(t),n.ok===!1&&_s.error(m1(n.reason),{duration:1/0})}function g1(e){let t=e.bridge;if(!t)return;let n=t.onServerVersionDrift(e=>{_s.custom(n=>(0,Q.createElement)(l1,{body:d1(e),warning:u1(),restartLabel:qc._({id:`ppDgFi`}),cancelLabel:qc._({id:`PBxg_E`}),onRestart:()=>{_s.dismiss(n),h1(t)},onDismiss:()=>_s.dismiss(n)}),{duration:1/0})}),r=t.onServerRestarted(e=>{_s.success(f1(e.appRuntime))}),i=t.onServerReclaimed(e=>{_s.warning(p1(e.appRuntime),{duration:15e3})});return()=>{n(),r(),i()}}function _1(e){let{initialDoc:t}=e;if(!t)return;let n=e.getHash();n!==``&&n!==`#`&&n!==`#/`||e.setHash(Ml(t))}function v1(){typeof window>`u`||!window.okDesktop||_1({initialDoc:window.okDesktop.config.initialDoc,getHash:()=>window.location.hash,setHash:e=>{window.location.hash=e}})}pd(),n(()=>import(`./telemetry-startup-DxsH0f-U.js`).then(e=>e.initStartupTrace()),__vite__mapDeps([116,0,1,2,3,4,38,7]),import.meta.url),W$({apiOrigin:typeof window<`u`?window.okDesktop?.config.apiOrigin:void 0}),r1(),sE()&&pE(),rQ(),hT(),IF(),LN(),typeof window<`u`&&a1({bridge:window.okDesktop}),typeof window<`u`&&g1({bridge:window.okDesktop}),typeof window<`u`&&ud({bridge:window.okDesktop}),typeof window<`u`&&Hc({bridge:window.okDesktop}),typeof window<`u`&&c1({bridge:window.okDesktop}),typeof window<`u`&&fd({bridge:window.okDesktop}),v1();var y1=new Sd({defaultOptions:{queries:{retry:1,staleTime:1e4}}}),b1=document.getElementById(`root`);if(!b1)throw Error(`Root element not found`);var x1=typeof window>`u`?void 0:window.okDesktop;(0,Nd.createRoot)(b1).render((0,Z.jsx)(Q.StrictMode,{children:(0,Z.jsx)(jt,{i18n:qc,children:(0,Z.jsx)(Yt,{client:y1,children:(0,Z.jsxs)(un,{attribute:`class`,defaultTheme:`system`,enableSystem:!0,disableTransitionOnChange:!0,storageKey:`ok-theme-v1`,children:[(0,Z.jsx)(ks,{children:V$(x1)}),(0,Z.jsx)(H$,{richColors:!0,closeButton:!0})]})})})}));