@inkeep/open-knowledge 0.45.3 → 0.45.5

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.
Files changed (55) hide show
  1. package/dist/{acp-harness-probe-BTGcVT6W.mjs → acp-harness-probe-B5YN-5-W.mjs} +2 -2
  2. package/dist/assets/skills/discovery/SKILL.md +1 -1
  3. package/dist/assets/skills/project/SKILL.md +1 -1
  4. package/dist/cli.mjs +6 -6
  5. package/dist/constants-RJt5r-RG.mjs +2 -0
  6. package/dist/index.mjs +1 -1
  7. package/dist/init-B7W8vnd1.mjs +1 -0
  8. package/dist/{init-BsyBRztp.mjs → init-iXLbsgSu.mjs} +3 -3
  9. package/dist/{launch-json-removal-D_kkDChQ.mjs → launch-json-removal-Bz-PDQUZ.mjs} +2 -2
  10. package/dist/{loader-BNR-a1U-.mjs → loader-C7i7Dex-.mjs} +2 -2
  11. package/dist/loader-WoEmMajY.mjs +1 -0
  12. package/dist/preview-Bq__p2IQ.mjs +1 -0
  13. package/dist/{preview-Byntfo10.mjs → preview-DSJB2klU.mjs} +2 -2
  14. package/dist/public/assets/{ActivityModeContent-CUdU1LSM.js → ActivityModeContent-DIsSUa0b.js} +1 -1
  15. package/dist/public/assets/{AgentDiffPane-C406On9h.js → AgentDiffPane-B8iLBdmk.js} +1 -1
  16. package/dist/public/assets/{DocumentContext-Bwk1Rcb4.js → DocumentContext-cWbO_qTT.js} +1 -1
  17. package/dist/public/assets/FeedbackForm-BpOA23qa.js +1 -0
  18. package/dist/public/assets/{ManagedArtifactProperties-t_bI4fe1.js → ManagedArtifactProperties-Bk-2oNwh.js} +1 -1
  19. package/dist/public/assets/{PropertyPanel-DjnXiFVP.js → PropertyPanel-D4BNN3Mv.js} +1 -1
  20. package/dist/public/assets/{SettingsDialogBody-CqHPSi0R.js → SettingsDialogBody-BWHpCqnG.js} +4 -4
  21. package/dist/public/assets/{SkillEditorActions-Cy1ElETY.js → SkillEditorActions-BUn81ISW.js} +1 -1
  22. package/dist/public/assets/{SourceEditor-jhl20Ntc.js → SourceEditor-96iSPblD.js} +1 -1
  23. package/dist/public/assets/{TerminalPanel-CEIHsphK.js → TerminalPanel-wFwhgJ69.js} +1 -1
  24. package/dist/public/assets/{TerminalSessionsHost-D1zjz1ZF.js → TerminalSessionsHost-rB1gqG4O.js} +2 -2
  25. package/dist/public/assets/{TerminalWindowApp-Bza3cRBo.js → TerminalWindowApp-C2t7E4Sk.js} +1 -1
  26. package/dist/public/assets/{ThreadView-CQui3mRB.js → ThreadView-C6wTlz-y.js} +1 -1
  27. package/dist/public/assets/{TimelineDiffPane-D-69ryad.js → TimelineDiffPane-DKNdiePH.js} +1 -1
  28. package/dist/public/assets/{auth-state-cache-B5xUAzGt.js → auth-state-cache-dKTSMTCf.js} +1 -1
  29. package/dist/public/assets/{file-tree-adapter-C3r5x-03.js → file-tree-adapter-FINFejHC.js} +1 -1
  30. package/dist/public/assets/{file-tree-rename-validation-wADtjYEi.js → file-tree-rename-validation-COweAeOg.js} +1 -1
  31. package/dist/public/assets/{globals-Dsi-fA9A.js → globals-C7y6kfQ9.js} +1 -1
  32. package/dist/public/assets/{index-BpV70rnW.js → index-C9LFyYfr.js} +100 -100
  33. package/dist/public/assets/lint-plugin-meta-DKTiO7RO.js +1 -0
  34. package/dist/public/assets/{selection-context-BLRRQXPM.js → selection-context-jnXLoW3S.js} +1 -1
  35. package/dist/public/assets/{skill-actions-BpxNxtu3.js → skill-actions-DEa7Mqcd.js} +1 -1
  36. package/dist/public/assets/{typing-burst-detector-BQzKQ6FX.js → typing-burst-detector-8_nLPleJ.js} +1 -1
  37. package/dist/public/assets/{uninstall-DB--eAaa.js → uninstall-ousBF288.js} +1 -1
  38. package/dist/public/assets/{use-activity-panel-CVU0EVdO.js → use-activity-panel-dwds5ZEO.js} +1 -1
  39. package/dist/public/assets/{use-settings-route-nZv4tv_8.js → use-settings-route-FnSIe1ir.js} +1 -1
  40. package/dist/public/assets/{use-timeline-entry-diff-CF4QQ4Me.js → use-timeline-entry-diff-8VJV_hOg.js} +1 -1
  41. package/dist/public/index.html +12 -12
  42. package/dist/public/uninstall.html +2 -2
  43. package/dist/{repair-launch-json-UbqsjTk0.mjs → repair-launch-json-BNfhBn0x.mjs} +2 -2
  44. package/dist/{repair-mcp-configs-BUc3wd8m.mjs → repair-mcp-configs-B3UGbsh_.mjs} +2 -2
  45. package/dist/{src-PKGjlbmX.mjs → src-BjAjAP59.mjs} +2 -2
  46. package/dist/{start-BgJUxSkk.mjs → start-CZo1_eaU.mjs} +2 -2
  47. package/dist/start-Da8PBfr7.mjs +1 -0
  48. package/package.json +4 -4
  49. package/dist/constants-DjsZn4vK.mjs +0 -2
  50. package/dist/init-B89TrBMJ.mjs +0 -1
  51. package/dist/loader-B15OFHdh.mjs +0 -1
  52. package/dist/preview-BQ27G4eM.mjs +0 -1
  53. package/dist/public/assets/FeedbackForm-BSWSiRwU.js +0 -1
  54. package/dist/public/assets/lint-plugin-meta-J-wb-uxW.js +0 -1
  55. package/dist/start-DtLWOZdr.mjs +0 -1
@@ -0,0 +1 @@
1
+ import{n as e}from"./loader-C7i7Dex-.mjs";export{e as loadConfig};
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./preview-DSJB2klU.mjs";export{t as formatPreviewBlock,e as previewContent};
@@ -1,3 +1,3 @@
1
- import{Nr as e}from"./src-BIJtc8LA.mjs";import"./constants-DjsZn4vK.mjs";import{join as t,relative as n}from"node:path";import{existsSync as r,lstatSync as i,readdirSync as a,realpathSync as o,statSync as s}from"node:fs";function c(r){let{projectDir:c,contentDir:l,sampleCap:u=5}=r,d=[],f=[];try{i(l)}catch(e){return{totalCount:0,sample:[],contentDir:l,warnings:[`cannot access content directory ${l}: ${e instanceof Error?e.message:String(e)}`]}}let p;try{p=e({projectDir:c,contentDir:l})}catch(e){return{totalCount:0,sample:[],contentDir:l,warnings:[e instanceof Error?e.message:String(e)]}}function m(e){let r;try{r=a(e,{withFileTypes:!0})}catch(t){let r=t instanceof Error?t.message:String(t);d.push(`could not read directory ${n(l,e)||`.`}: ${r}`);return}for(let i of r){let r=t(e,i.name);if(i.isSymbolicLink()){let e;try{e=o(r)}catch(e){let t=e.code;t===`ENOENT`||t===`ELOOP`?d.push(`broken or cyclic symlink: ${n(l,r)}`):d.push(`cannot resolve symlink ${n(l,r)}: ${t??`unknown error`}`);continue}let t;try{t=s(e)}catch{continue}if(t.isDirectory()){let e=n(l,r);if(p.isDirExcluded(e))continue;m(r)}else if(t.isFile()){let e=n(l,r);if(p.isExcluded(e))continue;f.push(e)}}else if(i.isDirectory()){let e=n(l,r);if(p.isDirExcluded(e))continue;m(r)}else if(i.isFile()){let e=n(l,r);if(p.isExcluded(e))continue;f.push(e)}}}return m(l),{totalCount:f.length,sample:f.slice(0,u),contentDir:l,warnings:d}}function l(e,i){let a=[],o=n(i,e.contentDir),s=o===``?`./`:`./${o}`;if(a.push(`Content:`),a.push(` Found ${e.totalCount} markdown files in ${s}`),e.sample.length>0){let t=e.sample.join(`, `),n=e.totalCount>e.sample.length?`, …`:``;a.push(` Sample: ${t}${n}`)}if(e.warnings.length>0)for(let t of e.warnings)a.push(` Warning: ${t}`);return a.push(``),r(t(i,`.ok`,`config.yml`))?(a.push(` To adjust scope, add patterns to .okignore at the project root.`),a.push(` To change the content root, edit .ok/config.yml → content.dir.`)):a.push(" Run `open-knowledge init` to scaffold config + .okignore."),a.push(``),a.push(` Re-check anytime: open-knowledge preview`),a.join(`
1
+ import{Nr as e}from"./src-BIJtc8LA.mjs";import"./constants-RJt5r-RG.mjs";import{join as t,relative as n}from"node:path";import{existsSync as r,lstatSync as i,readdirSync as a,realpathSync as o,statSync as s}from"node:fs";function c(r){let{projectDir:c,contentDir:l,sampleCap:u=5}=r,d=[],f=[];try{i(l)}catch(e){return{totalCount:0,sample:[],contentDir:l,warnings:[`cannot access content directory ${l}: ${e instanceof Error?e.message:String(e)}`]}}let p;try{p=e({projectDir:c,contentDir:l})}catch(e){return{totalCount:0,sample:[],contentDir:l,warnings:[e instanceof Error?e.message:String(e)]}}function m(e){let r;try{r=a(e,{withFileTypes:!0})}catch(t){let r=t instanceof Error?t.message:String(t);d.push(`could not read directory ${n(l,e)||`.`}: ${r}`);return}for(let i of r){let r=t(e,i.name);if(i.isSymbolicLink()){let e;try{e=o(r)}catch(e){let t=e.code;t===`ENOENT`||t===`ELOOP`?d.push(`broken or cyclic symlink: ${n(l,r)}`):d.push(`cannot resolve symlink ${n(l,r)}: ${t??`unknown error`}`);continue}let t;try{t=s(e)}catch{continue}if(t.isDirectory()){let e=n(l,r);if(p.isDirExcluded(e))continue;m(r)}else if(t.isFile()){let e=n(l,r);if(p.isExcluded(e))continue;f.push(e)}}else if(i.isDirectory()){let e=n(l,r);if(p.isDirExcluded(e))continue;m(r)}else if(i.isFile()){let e=n(l,r);if(p.isExcluded(e))continue;f.push(e)}}}return m(l),{totalCount:f.length,sample:f.slice(0,u),contentDir:l,warnings:d}}function l(e,i){let a=[],o=n(i,e.contentDir),s=o===``?`./`:`./${o}`;if(a.push(`Content:`),a.push(` Found ${e.totalCount} markdown files in ${s}`),e.sample.length>0){let t=e.sample.join(`, `),n=e.totalCount>e.sample.length?`, …`:``;a.push(` Sample: ${t}${n}`)}if(e.warnings.length>0)for(let t of e.warnings)a.push(` Warning: ${t}`);return a.push(``),r(t(i,`.ok`,`config.yml`))?(a.push(` To adjust scope, add patterns to .okignore at the project root.`),a.push(` To change the content root, edit .ok/config.yml → content.dir.`)):a.push(" Run `open-knowledge init` to scaffold config + .okignore."),a.push(``),a.push(` Re-check anytime: open-knowledge preview`),a.join(`
2
2
  `)}export{c as n,l as t};
3
- //# sourceMappingURL=preview-Byntfo10.mjs.map
3
+ //# sourceMappingURL=preview-DSJB2klU.mjs.map
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{i as n,r}from"./DocumentContext-Bwk1Rcb4.js";import{t as i}from"./react-f2sANaYj.js";import{n as a,r as o}from"./dist-Nvb76hAm.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{t as c}from"./button-Gol9BgNB.js";import{i as l,n as u,t as d}from"./tooltip-B4J7VHmA.js";import{a as f,c as p,i as m,o as h,s as g,t as _}from"./dialog-TkFkuYVg.js";import{ft as v}from"./CodeMirrorPropInput-BQX8xzkZ.js";import{n as y}from"./CopyButton-1Q6Wnnjb.js";import{i as b}from"./prop-types-BX5rHy8u.js";import{t as x}from"./loader-circle-Cg5SU7AZ.js";import{i as S,t as C}from"./timeline-diff-store-CYckprSS.js";import{n as w}from"./dist-BLAMau9Z.js";import{t as T}from"./dist-q14fBS3T.js";import{s as E}from"./navigation-targets-CILnJhFW.js";import{a as D,i as O,n as k,o as A,t as j}from"./agent-diff-store-qaTtNJLp.js";import{n as M}from"./use-activity-panel-CVU0EVdO.js";var N=s(),P=e(i(),1),F=t();function I(e,t){let n=Math.max(0,t-e);if(n<6e4){let e=Math.round(n/1e3);return T._({id:`pbwTg6`,values:{seconds:e}})}if(n<36e5){let e=Math.round(n/6e4);return T._({id:`_rP3HI`,values:{minutes:e}})}return new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function ee(e){let t=(0,N.c)(86),{burst:n,docName:r,editCount:i,sessionAlive:s,inFlight:v,onOpenDiff:y,onRestore:b}=e,{_:C}=o(),[w,T]=(0,P.useState)(te),E,O;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(E=()=>{let e=setInterval(()=>T(Date.now()),3e4);return()=>clearInterval(e)},O=[],t[0]=E,t[1]=O):(E=t[0],O=t[1]),(0,P.useEffect)(E,O);let[k,A]=(0,P.useState)(!1),j=D(),M=n.stackIndex+1,ee=j?.docName===r&&j.keptCount===M,L=i-M,ne=!s||v||L<=0,re;t[2]!==L||t[3]!==b?(re=function(){A(!1),b(L)},t[2]=L,t[3]=b,t[4]=re):re=t[4];let ie=re,R;t[5]!==n||t[6]!==y?(R=()=>y(n),t[5]=n,t[6]=y,t[7]=R):R=t[7];let z;t[8]!==C||t[9]!==M||t[10]!==r?(z=C({id:`Z79bnE`,values:{burstNumber:M,docName:r}}),t[8]=C,t[9]=M,t[10]=r,t[11]=z):z=t[11];let ae=ee?`bg-muted`:`hover:bg-muted/40`,oe;t[12]===ae?oe=t[13]:(oe=[`flex min-w-0 flex-1 items-center gap-2 px-4 py-1.5 text-xs text-muted-foreground transition-colors`,ae],t[12]=ae,t[13]=oe);let se=oe.join(` `),B;t[14]!==n.ts||t[15]!==w?(B=I(n.ts,w),t[14]=n.ts,t[15]=w,t[16]=B):B=t[16];let V;t[17]===B?V=t[18]:(V=(0,F.jsx)(`span`,{className:`font-mono`,children:B}),t[17]=B,t[18]=V);let H;t[19]===n.additions?H=t[20]:(H=(0,F.jsxs)(`span`,{className:`text-green-600 dark:text-green-400`,children:[`+`,n.additions]}),t[19]=n.additions,t[20]=H);let U;t[21]===n.deletions?U=t[22]:(U=(0,F.jsxs)(`span`,{className:`text-red-600 dark:text-red-400`,children:[`−`,n.deletions]}),t[21]=n.deletions,t[22]=U);let W;t[23]!==H||t[24]!==U?(W=(0,F.jsxs)(`span`,{className:`ml-auto font-mono`,children:[H,` `,U]}),t[23]=H,t[24]=U,t[25]=W):W=t[25];let G;t[26]!==ee||t[27]!==V||t[28]!==W||t[29]!==R||t[30]!==z||t[31]!==se?(G=(0,F.jsxs)(`button`,{type:`button`,onClick:R,"aria-pressed":ee,"aria-label":z,"data-testid":`activity-panel-burst-open`,className:se,children:[V,W]}),t[26]=ee,t[27]=V,t[28]=W,t[29]=R,t[30]=z,t[31]=se,t[32]=G):G=t[32];let ce;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,F.jsx)(`span`,{"aria-hidden":`true`,className:`mx-1.5 h-3 w-px shrink-0 bg-border`}),t[33]=ce):ce=t[33];let K;t[34]!==C||t[35]!==M||t[36]!==r?(K=C({id:`Zhe80e`,values:{burstNumber:M,docName:r}}),t[34]=C,t[35]=M,t[36]=r,t[37]=K):K=t[37];let le;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(le=()=>A(!0),t[38]=le):le=t[38];let q;t[39]===v?q=t[40]:(q=v?(0,F.jsx)(x,{className:`size-3 animate-spin`,"aria-hidden":`true`}):(0,F.jsx)(S,{className:`size-3`,"aria-hidden":`true`}),t[39]=v,t[40]=q);let J;t[41]!==ne||t[42]!==K||t[43]!==q?(J=(0,F.jsx)(l,{asChild:!0,children:(0,F.jsx)(c,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6 shrink-0 text-muted-foreground hover:text-destructive`,"data-testid":`activity-panel-burst-restore`,"aria-label":K,disabled:ne,onClick:le,children:q})}),t[41]=ne,t[42]=K,t[43]=q,t[44]=J):J=t[44];let Y;t[45]!==C||t[46]!==L||t[47]!==s?(Y=C(s?L>0?{id:`SOPwPh`}:{id:`62bOuM`}:{id:`NzFvyK`}),t[45]=C,t[46]=L,t[47]=s,t[48]=Y):Y=t[48];let X;t[49]===Y?X=t[50]:(X=(0,F.jsx)(u,{side:`left`,children:Y}),t[49]=Y,t[50]=X);let Z;t[51]!==J||t[52]!==X?(Z=(0,F.jsxs)(d,{children:[J,X]}),t[51]=J,t[52]=X,t[53]=Z):Z=t[53];let Q;t[54]!==G||t[55]!==Z?(Q=(0,F.jsxs)(`div`,{className:`flex items-center border-t border-border/50 pr-3`,children:[G,ce,Z]}),t[54]=G,t[55]=Z,t[56]=Q):Q=t[56];let $;t[57]===v?$=t[58]:($=e=>{!e&&!v?A(!1):e&&A(!0)},t[57]=v,t[58]=$);let ue;t[59]===C?ue=t[60]:(ue=C({id:`a4FRQv`}),t[59]=C,t[60]=ue);let de;t[61]===ue?de=t[62]:(de=(0,F.jsx)(p,{children:ue}),t[61]=ue,t[62]=de);let fe;t[63]===L?fe=t[64]:(fe=(0,F.jsx)(f,{children:(0,F.jsx)(a,{id:`LKIPzv`,values:{laterEdits:L}})}),t[63]=L,t[64]=fe);let pe;t[65]!==de||t[66]!==fe?(pe=(0,F.jsxs)(g,{children:[de,fe]}),t[65]=de,t[66]=fe,t[67]=pe):pe=t[67];let me;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,F.jsx)(c,{variant:`outline`,"data-testid":`activity-panel-burst-restore-cancel`,onClick:()=>A(!1),children:(0,F.jsx)(a,{id:`dEgA5A`})}),t[68]=me):me=t[68];let he;t[69]===v?he=t[70]:(he=v?(0,F.jsx)(x,{className:`mr-2 size-4 animate-spin`,"aria-hidden":`true`}):null,t[69]=v,t[70]=he);let ge;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,F.jsx)(a,{id:`9uI_rE`}),t[71]=ge):ge=t[71];let _e;t[72]!==ie||t[73]!==v||t[74]!==he?(_e=(0,F.jsxs)(h,{children:[me,(0,F.jsxs)(c,{variant:`destructive`,"data-testid":`activity-panel-burst-restore-confirm`,disabled:v,onClick:ie,children:[he,ge]})]}),t[72]=ie,t[73]=v,t[74]=he,t[75]=_e):_e=t[75];let ve;t[76]!==pe||t[77]!==_e?(ve=(0,F.jsxs)(m,{children:[pe,_e]}),t[76]=pe,t[77]=_e,t[78]=ve):ve=t[78];let ye;t[79]!==k||t[80]!==$||t[81]!==ve?(ye=(0,F.jsx)(_,{open:k,onOpenChange:$,children:ve}),t[79]=k,t[80]=$,t[81]=ve,t[82]=ye):ye=t[82];let be;return t[83]!==Q||t[84]!==ye?(be=(0,F.jsxs)(F.Fragment,{children:[Q,ye]}),t[83]=Q,t[84]=ye,t[85]=be):be=t[85],be}function te(){return Date.now()}function L(e,t){let n=Math.max(0,t-e);if(n<6e4){let e=Math.round(n/1e3);return T._({id:`pbwTg6`,values:{seconds:e}})}if(n<36e5){let e=Math.round(n/6e4);return T._({id:`_rP3HI`,values:{minutes:e}})}let r=Math.round(n/36e5);return T._({id:`nYeBmY`,values:{hours:r}})}function ne(e){let t=(0,N.c)(56),{file:n,sessionAlive:r,isWriting:i,onNavigate:s,onUndoDrop:c,onSetVersion:l}=e,{_:u}=o(),{docName:d}=n,[f,p]=(0,P.useState)(!1),[m,h]=(0,P.useState)(re),g,_;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{let e=setInterval(()=>h(Date.now()),3e4);return()=>clearInterval(e)},_=[],t[0]=g,t[1]=_):(g=t[0],_=t[1]),(0,P.useEffect)(g,_);let v=n.bursts.length,y;t[2]!==n.docName||t[3]!==c||t[4]!==r||t[5]!==f?(y=e=>{e<=0||!r||f||(p(!0),Promise.resolve(c(n.docName,e)).finally(()=>{p(!1),j()}))},t[2]=n.docName,t[3]=c,t[4]=r,t[5]=f,t[6]=y):y=t[6];let b=y;if(n.bursts.length===0)return null;let x;t[7]!==n.docName||t[8]!==s?(x=()=>s(n.docName),t[7]=n.docName,t[8]=s,t[9]=x):x=t[9];let S;t[10]!==u||t[11]!==d?(S=u({id:`QcpeeE`,values:{docName:d}}),t[10]=u,t[11]=d,t[12]=S):S=t[12];let C;t[13]!==n.docName||t[14]!==x||t[15]!==S?(C=(0,F.jsx)(`button`,{type:`button`,onClick:x,className:`min-w-0 flex-1 truncate text-left text-foreground hover:underline focus-visible:outline-ring`,"aria-label":S,"data-testid":`activity-panel-file-row-filename`,title:n.docName,children:n.docName}),t[13]=n.docName,t[14]=x,t[15]=S,t[16]=C):C=t[16];let w;t[17]===n.additionsTotal?w=t[18]:(w=(0,F.jsxs)(`span`,{className:`text-green-600 dark:text-green-400`,children:[`+`,n.additionsTotal]}),t[17]=n.additionsTotal,t[18]=w);let T;t[19]===n.deletionsTotal?T=t[20]:(T=(0,F.jsxs)(`span`,{className:`text-red-600 dark:text-red-400`,children:[`−`,n.deletionsTotal]}),t[19]=n.deletionsTotal,t[20]=T);let E;t[21]!==w||t[22]!==T?(E=(0,F.jsxs)(`span`,{className:`shrink-0 font-mono text-xs`,children:[w,` `,T]}),t[21]=w,t[22]=T,t[23]=E):E=t[23];let D;t[24]!==n.lastTs||t[25]!==m?(D=L(n.lastTs,m),t[24]=n.lastTs,t[25]=m,t[26]=D):D=t[26];let O;t[27]===D?O=t[28]:(O=(0,F.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:D}),t[27]=D,t[28]=O);let k;t[29]===i?k=t[30]:(k=i?(0,F.jsx)(`span`,{className:`shrink-0 text-[11px] text-primary animate-pulse`,role:`status`,children:(0,F.jsx)(a,{id:`6q0rnH`})}):null,t[29]=i,t[30]=k);let A;t[31]!==O||t[32]!==k||t[33]!==C||t[34]!==E?(A=(0,F.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 text-sm`,children:[C,E,O,k]}),t[31]=O,t[32]=k,t[33]=C,t[34]=E,t[35]=A):A=t[35];let M;if(t[36]!==b||t[37]!==v||t[38]!==n.bursts||t[39]!==n.docName||t[40]!==l||t[41]!==r||t[42]!==f){let e;t[44]!==b||t[45]!==v||t[46]!==n.docName||t[47]!==l||t[48]!==r||t[49]!==f?(e=e=>(0,F.jsx)(ee,{burst:e,docName:n.docName,editCount:v,sessionAlive:r,inFlight:f,onOpenDiff:e=>l(e.stackIndex+1),onRestore:b},`${n.docName}:${e.stackIndex}`),t[44]=b,t[45]=v,t[46]=n.docName,t[47]=l,t[48]=r,t[49]=f,t[50]=e):e=t[50],M=n.bursts.map(e),t[36]=b,t[37]=v,t[38]=n.bursts,t[39]=n.docName,t[40]=l,t[41]=r,t[42]=f,t[43]=M}else M=t[43];let I;t[51]===M?I=t[52]:(I=(0,F.jsx)(`div`,{children:M}),t[51]=M,t[52]=I);let te;return t[53]!==A||t[54]!==I?(te=(0,F.jsxs)(`div`,{className:`border-b border-border`,"data-testid":`activity-panel-file-row`,children:[A,I]}),t[53]=A,t[54]=I,t[55]=te):te=t[55],te}function re(){return Date.now()}async function ie(e){let t=await fetch(`/api/agent-undo`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...e,agentId:e.connectionId})});if(!t.ok)throw Error(`agent-undo failed: HTTP ${t.status}`)}function R(e){return`#/${e.split(`/`).map(e=>encodeURIComponent(e)).join(`/`)}`}function z(e){typeof window>`u`||(window.location.hash=R(e))}function ae(){let e=(0,N.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,F.jsx)(x,{className:`mr-2 size-4 animate-spin`,"aria-hidden":`true`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,F.jsxs)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,role:`status`,"aria-busy":`true`,children:[t,(0,F.jsx)(`span`,{className:`text-sm`,children:(0,F.jsx)(a,{id:`ONPvOb`})})]}),e[1]=n):n=e[1],n}function oe(e){let t=(0,N.c)(10),{error:n,onRetry:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,F.jsx)(y,{className:`size-6 text-destructive`,"aria-hidden":`true`}),t[0]=i):i=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,F.jsx)(`p`,{className:`text-sm font-medium`,children:(0,F.jsx)(a,{id:`DhLHEb`})}),t[1]=o):o=t[1];let s;t[2]===n?s=t[3]:(s=(0,F.jsxs)(`div`,{className:`space-y-1`,children:[o,(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n})]}),t[2]=n,t[3]=s);let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,F.jsx)(a,{id:`6gRgw8`}),t[4]=l):l=t[4];let u;t[5]===r?u=t[6]:(u=(0,F.jsx)(c,{type:`button`,variant:`outline`,size:`sm`,onClick:r,children:l}),t[5]=r,t[6]=u);let d;return t[7]!==s||t[8]!==u?(d=(0,F.jsxs)(`div`,{className:`flex flex-col items-center gap-3 p-6 text-center`,role:`alert`,"data-testid":`activity-panel-error`,children:[i,s,u]}),t[7]=s,t[8]=u,t[9]=d):d=t[9],d}function se(){let e=(0,N.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,F.jsx)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,"data-testid":`activity-panel-empty`,children:(0,F.jsx)(`p`,{className:`text-sm italic`,children:(0,F.jsx)(a,{id:`iuTKci`})})}),e[0]=t):t=e[0],t}function B(e){let t=(0,N.c)(12),{onExit:n,showBackButton:r}=e,{_:i}=o(),s;t[0]===i?s=t[1]:(s=i({id:`kYL1lH`}),t[0]=i,t[1]=s);let c;t[2]!==n||t[3]!==r?(c=r?(0,F.jsx)(V,{onClick:n}):null,t[2]=n,t[3]=r,t[4]=c):c=t[4];let l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,F.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:(0,F.jsx)(a,{id:`kYL1lH`})}),t[5]=l):l=t[5];let u;t[6]===c?u=t[7]:(u=(0,F.jsxs)(`div`,{className:`flex shrink-0 flex-row items-center gap-2 border-b border-border px-3 py-2`,children:[c,l]}),t[6]=c,t[7]=u);let d;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,F.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-6 text-muted-foreground`,children:(0,F.jsx)(`p`,{className:`text-center text-sm italic`,children:(0,F.jsx)(a,{id:`D_WKe_`})})}),t[8]=d):d=t[8];let f;return t[9]!==s||t[10]!==u?(f=(0,F.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`activity-panel-no-agent`,"aria-label":s,children:[u,d]}),t[9]=s,t[10]=u,t[11]=f):f=t[11],f}function V(e){let t=(0,N.c)(9),{onClick:n}=e,{_:r}=o(),i;t[0]===r?i=t[1]:(i=r({id:`ogAuyr`}),t[0]=r,t[1]=i);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,F.jsx)(v,{}),t[2]=s):s=t[2];let f;t[3]!==n||t[4]!==i?(f=(0,F.jsx)(l,{asChild:!0,children:(0,F.jsx)(c,{type:`button`,variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,onClick:n,"aria-label":i,"data-testid":`docpanel-exit-agent-mode`,children:s})}),t[3]=n,t[4]=i,t[5]=f):f=t[5];let p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,F.jsx)(u,{side:`bottom`,children:(0,F.jsx)(a,{id:`ogAuyr`})}),t[6]=p):p=t[6];let m;return t[7]===f?m=t[8]:(m=(0,F.jsxs)(d,{children:[f,p]}),t[7]=f,t[8]=m),m}function H(e){let t=(0,N.c)(9),{lastTs:n}=e,[r]=(0,P.useState)(U),i;t[0]!==n||t[1]!==r?(i=n?W(r-n):null,t[0]=n,t[1]=r,t[2]=i):i=t[2];let o=i,s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,F.jsx)(`span`,{className:`font-medium`,children:(0,F.jsx)(a,{id:`LCUy_N`})}),t[3]=s):s=t[3];let c;t[4]===o?c=t[5]:(c=o?(0,F.jsxs)(`span`,{children:[` · `,o]}):null,t[4]=o,t[5]=c);let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,F.jsx)(`div`,{className:`mt-1 opacity-80`,children:(0,F.jsx)(a,{id:`GK-IRZ`})}),t[6]=l):l=t[6];let u;return t[7]===c?u=t[8]:(u=(0,F.jsxs)(`div`,{className:`border-b border-border bg-muted/40 px-4 py-3 text-xs text-muted-foreground`,"data-testid":`activity-panel-session-ended`,children:[s,c,l]}),t[7]=c,t[8]=u),u}function U(){return Date.now()}function W(e){let t=Math.max(0,e);if(t<6e4){let e=Math.round(t/1e3);return T._({id:`pbwTg6`,values:{seconds:e}})}if(t<36e5){let e=Math.round(t/6e4);return T._({id:`_rP3HI`,values:{minutes:e}})}let n=Math.round(t/36e5);return T._({id:`nYeBmY`,values:{hours:n}})}function G(e){let t=(0,N.c)(10),{agent:n,size:r}=e,i=r===void 0?28:r,a;t[0]!==n.color||t[1]!==i?(a={backgroundColor:n.color,width:i,height:i},t[0]=n.color,t[1]=i,t[2]=a):a=t[2];let o=i*.57,s=i*.57,c;t[3]!==n.icon||t[4]!==o||t[5]!==s?(c=(0,F.jsx)(A,{icon:n.icon,width:o,height:s}),t[3]=n.icon,t[4]=o,t[5]=s,t[6]=c):c=t[6];let l;return t[7]!==a||t[8]!==c?(l=(0,F.jsx)(`span`,{className:`inline-flex shrink-0 items-center justify-center rounded-full text-white ring-2 ring-background`,style:a,"aria-hidden":`true`,children:c}),t[7]=a,t[8]=c,t[9]=l):l=t[9],l}function ce(e){let t=(0,N.c)(25),{data:n,status:r,error:i,reload:s,onExit:c,onNavigate:l,onUndoDrop:u,onSetVersion:d,showBackButton:f}=e,{_:p}=o(),m=n?.files?.[0]?.lastTs??null,h=n?.files?.length??0,g;t[0]===p?g=t[1]:(g=p({id:`kYL1lH`}),t[0]=p,t[1]=g);let _;t[2]!==c||t[3]!==f?(_=f?(0,F.jsx)(V,{onClick:c}):null,t[2]=c,t[3]=f,t[4]=_):_=t[4];let v;t[5]!==n||t[6]!==h||t[7]!==m?(v=n?.agent?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(G,{agent:n.agent}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:n.agent.displayName}),(0,F.jsxs)(`p`,{className:`truncate text-xs text-muted-foreground`,children:[n.sessionAlive?(0,F.jsx)(a,{id:`F6pfE9`}):m===null?(0,F.jsx)(a,{id:`PMyJ9C`}):(0,F.jsx)(a,{id:`237hSL`}),n.files.length>0?(0,F.jsxs)(F.Fragment,{children:[` · `,(0,F.jsx)(a,{id:`u3BOHd`,values:{fileCount:h}})]}):null]})]})]}):(0,F.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,F.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:(0,F.jsx)(a,{id:`kYL1lH`})})}),t[5]=n,t[6]=h,t[7]=m,t[8]=v):v=t[8];let y;t[9]!==_||t[10]!==v?(y=(0,F.jsxs)(`div`,{className:`flex flex-row items-center gap-2 border-b border-border px-3 py-2 shrink-0`,children:[_,v]}),t[9]=_,t[10]=v,t[11]=y):y=t[11];let b;t[12]!==n||t[13]!==i||t[14]!==m||t[15]!==l||t[16]!==d||t[17]!==u||t[18]!==s||t[19]!==r?(b=(0,F.jsx)(`div`,{className:`flex-1 overflow-y-auto`,"data-testid":`activity-panel-body`,children:r===`loading`&&n===null?(0,F.jsx)(ae,{}):r===`error`&&i?(0,F.jsx)(oe,{error:i,onRetry:s}):n===null?(0,F.jsx)(se,{}):(0,F.jsxs)(F.Fragment,{children:[!n.sessionAlive&&m!==null?(0,F.jsx)(H,{lastTs:m}):null,n.files.length===0?(0,F.jsx)(se,{}):n.files.map(e=>(0,F.jsx)(ne,{file:e,sessionAlive:n.sessionAlive,isWriting:n.writingDocs.has(e.docName),onNavigate:l,onUndoDrop:u,onSetVersion:t=>d(e,t)},e.docName))]})}),t[12]=n,t[13]=i,t[14]=m,t[15]=l,t[16]=d,t[17]=u,t[18]=s,t[19]=r,t[20]=b):b=t[20];let x;return t[21]!==g||t[22]!==y||t[23]!==b?(x=(0,F.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`activity-panel`,"aria-label":g,children:[y,b]}),t[21]=g,t[22]=y,t[23]=b,t[24]=x):x=t[24],x}function K(e){let t=(0,N.c)(30),i;t[0]===e?i=t[1]:(i=e===void 0?{}:e,t[0]=e,t[1]=i);let{showBackButton:a}=i,s=a===void 0?!0:a,{_:c}=o(),{docPanelAgentId:l,closeActivityPanel:u}=r(),{openTargetTransition:d}=n(),{pageMeta:f}=b(),{data:p,status:m,error:h,reload:g}=M(l),_,v;if(t[2]!==p||t[3]!==l?(_=()=>{if(!(!p||l===null))for(let e of p.files)O(l,e.docName,e.bursts.length)},v=[p,l],t[2]=p,t[3]=l,t[4]=_,t[5]=v):(_=t[4],v=t[5]),(0,P.useEffect)(_,v),l===null){let e;return t[6]!==u||t[7]!==s?(e=(0,F.jsx)(B,{onExit:u,showBackButton:s}),t[6]=u,t[7]=s,t[8]=e):e=t[8],e}let y;t[9]!==d||t[10]!==f?(y=e=>{d(E({kind:`doc`,target:e,docName:e},f)),z(e)},t[9]=d,t[10]=f,t[11]=y):y=t[11];let x=y,S;t[12]!==p||t[13]!==l?(S=(e,t)=>{if(!p?.agent||l===null)return;C();let n=e.bursts.length;k({agentId:l,agentName:p.agent.displayName,agentColor:p.agent.color,agentIcon:p.agent.icon,docName:e.docName,keptCount:Math.max(0,Math.min(t,n)),maxVersions:n})},t[12]=p,t[13]=l,t[14]=S):S=t[14];let T=S,D;t[15]!==c||t[16]!==p||t[17]!==l||t[18]!==g?(D=async(e,t)=>{if(!(t<=0))try{await ie({connectionId:l,docName:e,scope:`count`,count:t,agentName:p?.agent?.displayName}),w.success(c(t===1?{id:`-dNlfM`,values:{docName:e}}:{id:`ApeA0n`,values:{dropCount:t,docName:e}})),g()}catch(e){let t=e,n=t instanceof Error?t.message:String(t);w.error(c({id:`EqrC_R`,values:{message:n}})),g()}},t[15]=c,t[16]=p,t[17]=l,t[18]=g,t[19]=D):D=t[19];let A=D,j;return t[20]!==u||t[21]!==p||t[22]!==h||t[23]!==x||t[24]!==T||t[25]!==A||t[26]!==g||t[27]!==s||t[28]!==m?(j=(0,F.jsx)(ce,{data:p,status:m,error:h,reload:g,onExit:u,onNavigate:x,onUndoDrop:A,onSetVersion:T,showBackButton:s}),t[20]=u,t[21]=p,t[22]=h,t[23]=x,t[24]=T,t[25]=A,t[26]=g,t[27]=s,t[28]=m,t[29]=j):j=t[29],j}export{K as ActivityModeContent};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{i as n,r}from"./DocumentContext-cWbO_qTT.js";import{t as i}from"./react-f2sANaYj.js";import{n as a,r as o}from"./dist-Nvb76hAm.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{t as c}from"./button-Gol9BgNB.js";import{i as l,n as u,t as d}from"./tooltip-B4J7VHmA.js";import{a as f,c as p,i as m,o as h,s as g,t as _}from"./dialog-TkFkuYVg.js";import{ft as v}from"./CodeMirrorPropInput-BQX8xzkZ.js";import{n as y}from"./CopyButton-1Q6Wnnjb.js";import{i as b}from"./prop-types-BX5rHy8u.js";import{t as x}from"./loader-circle-Cg5SU7AZ.js";import{i as S,t as C}from"./timeline-diff-store-CYckprSS.js";import{n as w}from"./dist-BLAMau9Z.js";import{t as T}from"./dist-q14fBS3T.js";import{s as E}from"./navigation-targets-CILnJhFW.js";import{a as D,i as O,n as k,o as A,t as j}from"./agent-diff-store-qaTtNJLp.js";import{n as M}from"./use-activity-panel-dwds5ZEO.js";var N=s(),P=e(i(),1),F=t();function I(e,t){let n=Math.max(0,t-e);if(n<6e4){let e=Math.round(n/1e3);return T._({id:`pbwTg6`,values:{seconds:e}})}if(n<36e5){let e=Math.round(n/6e4);return T._({id:`_rP3HI`,values:{minutes:e}})}return new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function ee(e){let t=(0,N.c)(86),{burst:n,docName:r,editCount:i,sessionAlive:s,inFlight:v,onOpenDiff:y,onRestore:b}=e,{_:C}=o(),[w,T]=(0,P.useState)(te),E,O;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(E=()=>{let e=setInterval(()=>T(Date.now()),3e4);return()=>clearInterval(e)},O=[],t[0]=E,t[1]=O):(E=t[0],O=t[1]),(0,P.useEffect)(E,O);let[k,A]=(0,P.useState)(!1),j=D(),M=n.stackIndex+1,ee=j?.docName===r&&j.keptCount===M,L=i-M,ne=!s||v||L<=0,re;t[2]!==L||t[3]!==b?(re=function(){A(!1),b(L)},t[2]=L,t[3]=b,t[4]=re):re=t[4];let ie=re,R;t[5]!==n||t[6]!==y?(R=()=>y(n),t[5]=n,t[6]=y,t[7]=R):R=t[7];let z;t[8]!==C||t[9]!==M||t[10]!==r?(z=C({id:`Z79bnE`,values:{burstNumber:M,docName:r}}),t[8]=C,t[9]=M,t[10]=r,t[11]=z):z=t[11];let ae=ee?`bg-muted`:`hover:bg-muted/40`,oe;t[12]===ae?oe=t[13]:(oe=[`flex min-w-0 flex-1 items-center gap-2 px-4 py-1.5 text-xs text-muted-foreground transition-colors`,ae],t[12]=ae,t[13]=oe);let se=oe.join(` `),B;t[14]!==n.ts||t[15]!==w?(B=I(n.ts,w),t[14]=n.ts,t[15]=w,t[16]=B):B=t[16];let V;t[17]===B?V=t[18]:(V=(0,F.jsx)(`span`,{className:`font-mono`,children:B}),t[17]=B,t[18]=V);let H;t[19]===n.additions?H=t[20]:(H=(0,F.jsxs)(`span`,{className:`text-green-600 dark:text-green-400`,children:[`+`,n.additions]}),t[19]=n.additions,t[20]=H);let U;t[21]===n.deletions?U=t[22]:(U=(0,F.jsxs)(`span`,{className:`text-red-600 dark:text-red-400`,children:[`−`,n.deletions]}),t[21]=n.deletions,t[22]=U);let W;t[23]!==H||t[24]!==U?(W=(0,F.jsxs)(`span`,{className:`ml-auto font-mono`,children:[H,` `,U]}),t[23]=H,t[24]=U,t[25]=W):W=t[25];let G;t[26]!==ee||t[27]!==V||t[28]!==W||t[29]!==R||t[30]!==z||t[31]!==se?(G=(0,F.jsxs)(`button`,{type:`button`,onClick:R,"aria-pressed":ee,"aria-label":z,"data-testid":`activity-panel-burst-open`,className:se,children:[V,W]}),t[26]=ee,t[27]=V,t[28]=W,t[29]=R,t[30]=z,t[31]=se,t[32]=G):G=t[32];let ce;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,F.jsx)(`span`,{"aria-hidden":`true`,className:`mx-1.5 h-3 w-px shrink-0 bg-border`}),t[33]=ce):ce=t[33];let K;t[34]!==C||t[35]!==M||t[36]!==r?(K=C({id:`Zhe80e`,values:{burstNumber:M,docName:r}}),t[34]=C,t[35]=M,t[36]=r,t[37]=K):K=t[37];let le;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(le=()=>A(!0),t[38]=le):le=t[38];let q;t[39]===v?q=t[40]:(q=v?(0,F.jsx)(x,{className:`size-3 animate-spin`,"aria-hidden":`true`}):(0,F.jsx)(S,{className:`size-3`,"aria-hidden":`true`}),t[39]=v,t[40]=q);let J;t[41]!==ne||t[42]!==K||t[43]!==q?(J=(0,F.jsx)(l,{asChild:!0,children:(0,F.jsx)(c,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6 shrink-0 text-muted-foreground hover:text-destructive`,"data-testid":`activity-panel-burst-restore`,"aria-label":K,disabled:ne,onClick:le,children:q})}),t[41]=ne,t[42]=K,t[43]=q,t[44]=J):J=t[44];let Y;t[45]!==C||t[46]!==L||t[47]!==s?(Y=C(s?L>0?{id:`SOPwPh`}:{id:`62bOuM`}:{id:`NzFvyK`}),t[45]=C,t[46]=L,t[47]=s,t[48]=Y):Y=t[48];let X;t[49]===Y?X=t[50]:(X=(0,F.jsx)(u,{side:`left`,children:Y}),t[49]=Y,t[50]=X);let Z;t[51]!==J||t[52]!==X?(Z=(0,F.jsxs)(d,{children:[J,X]}),t[51]=J,t[52]=X,t[53]=Z):Z=t[53];let Q;t[54]!==G||t[55]!==Z?(Q=(0,F.jsxs)(`div`,{className:`flex items-center border-t border-border/50 pr-3`,children:[G,ce,Z]}),t[54]=G,t[55]=Z,t[56]=Q):Q=t[56];let $;t[57]===v?$=t[58]:($=e=>{!e&&!v?A(!1):e&&A(!0)},t[57]=v,t[58]=$);let ue;t[59]===C?ue=t[60]:(ue=C({id:`a4FRQv`}),t[59]=C,t[60]=ue);let de;t[61]===ue?de=t[62]:(de=(0,F.jsx)(p,{children:ue}),t[61]=ue,t[62]=de);let fe;t[63]===L?fe=t[64]:(fe=(0,F.jsx)(f,{children:(0,F.jsx)(a,{id:`LKIPzv`,values:{laterEdits:L}})}),t[63]=L,t[64]=fe);let pe;t[65]!==de||t[66]!==fe?(pe=(0,F.jsxs)(g,{children:[de,fe]}),t[65]=de,t[66]=fe,t[67]=pe):pe=t[67];let me;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,F.jsx)(c,{variant:`outline`,"data-testid":`activity-panel-burst-restore-cancel`,onClick:()=>A(!1),children:(0,F.jsx)(a,{id:`dEgA5A`})}),t[68]=me):me=t[68];let he;t[69]===v?he=t[70]:(he=v?(0,F.jsx)(x,{className:`mr-2 size-4 animate-spin`,"aria-hidden":`true`}):null,t[69]=v,t[70]=he);let ge;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,F.jsx)(a,{id:`9uI_rE`}),t[71]=ge):ge=t[71];let _e;t[72]!==ie||t[73]!==v||t[74]!==he?(_e=(0,F.jsxs)(h,{children:[me,(0,F.jsxs)(c,{variant:`destructive`,"data-testid":`activity-panel-burst-restore-confirm`,disabled:v,onClick:ie,children:[he,ge]})]}),t[72]=ie,t[73]=v,t[74]=he,t[75]=_e):_e=t[75];let ve;t[76]!==pe||t[77]!==_e?(ve=(0,F.jsxs)(m,{children:[pe,_e]}),t[76]=pe,t[77]=_e,t[78]=ve):ve=t[78];let ye;t[79]!==k||t[80]!==$||t[81]!==ve?(ye=(0,F.jsx)(_,{open:k,onOpenChange:$,children:ve}),t[79]=k,t[80]=$,t[81]=ve,t[82]=ye):ye=t[82];let be;return t[83]!==Q||t[84]!==ye?(be=(0,F.jsxs)(F.Fragment,{children:[Q,ye]}),t[83]=Q,t[84]=ye,t[85]=be):be=t[85],be}function te(){return Date.now()}function L(e,t){let n=Math.max(0,t-e);if(n<6e4){let e=Math.round(n/1e3);return T._({id:`pbwTg6`,values:{seconds:e}})}if(n<36e5){let e=Math.round(n/6e4);return T._({id:`_rP3HI`,values:{minutes:e}})}let r=Math.round(n/36e5);return T._({id:`nYeBmY`,values:{hours:r}})}function ne(e){let t=(0,N.c)(56),{file:n,sessionAlive:r,isWriting:i,onNavigate:s,onUndoDrop:c,onSetVersion:l}=e,{_:u}=o(),{docName:d}=n,[f,p]=(0,P.useState)(!1),[m,h]=(0,P.useState)(re),g,_;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{let e=setInterval(()=>h(Date.now()),3e4);return()=>clearInterval(e)},_=[],t[0]=g,t[1]=_):(g=t[0],_=t[1]),(0,P.useEffect)(g,_);let v=n.bursts.length,y;t[2]!==n.docName||t[3]!==c||t[4]!==r||t[5]!==f?(y=e=>{e<=0||!r||f||(p(!0),Promise.resolve(c(n.docName,e)).finally(()=>{p(!1),j()}))},t[2]=n.docName,t[3]=c,t[4]=r,t[5]=f,t[6]=y):y=t[6];let b=y;if(n.bursts.length===0)return null;let x;t[7]!==n.docName||t[8]!==s?(x=()=>s(n.docName),t[7]=n.docName,t[8]=s,t[9]=x):x=t[9];let S;t[10]!==u||t[11]!==d?(S=u({id:`QcpeeE`,values:{docName:d}}),t[10]=u,t[11]=d,t[12]=S):S=t[12];let C;t[13]!==n.docName||t[14]!==x||t[15]!==S?(C=(0,F.jsx)(`button`,{type:`button`,onClick:x,className:`min-w-0 flex-1 truncate text-left text-foreground hover:underline focus-visible:outline-ring`,"aria-label":S,"data-testid":`activity-panel-file-row-filename`,title:n.docName,children:n.docName}),t[13]=n.docName,t[14]=x,t[15]=S,t[16]=C):C=t[16];let w;t[17]===n.additionsTotal?w=t[18]:(w=(0,F.jsxs)(`span`,{className:`text-green-600 dark:text-green-400`,children:[`+`,n.additionsTotal]}),t[17]=n.additionsTotal,t[18]=w);let T;t[19]===n.deletionsTotal?T=t[20]:(T=(0,F.jsxs)(`span`,{className:`text-red-600 dark:text-red-400`,children:[`−`,n.deletionsTotal]}),t[19]=n.deletionsTotal,t[20]=T);let E;t[21]!==w||t[22]!==T?(E=(0,F.jsxs)(`span`,{className:`shrink-0 font-mono text-xs`,children:[w,` `,T]}),t[21]=w,t[22]=T,t[23]=E):E=t[23];let D;t[24]!==n.lastTs||t[25]!==m?(D=L(n.lastTs,m),t[24]=n.lastTs,t[25]=m,t[26]=D):D=t[26];let O;t[27]===D?O=t[28]:(O=(0,F.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:D}),t[27]=D,t[28]=O);let k;t[29]===i?k=t[30]:(k=i?(0,F.jsx)(`span`,{className:`shrink-0 text-[11px] text-primary animate-pulse`,role:`status`,children:(0,F.jsx)(a,{id:`6q0rnH`})}):null,t[29]=i,t[30]=k);let A;t[31]!==O||t[32]!==k||t[33]!==C||t[34]!==E?(A=(0,F.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 text-sm`,children:[C,E,O,k]}),t[31]=O,t[32]=k,t[33]=C,t[34]=E,t[35]=A):A=t[35];let M;if(t[36]!==b||t[37]!==v||t[38]!==n.bursts||t[39]!==n.docName||t[40]!==l||t[41]!==r||t[42]!==f){let e;t[44]!==b||t[45]!==v||t[46]!==n.docName||t[47]!==l||t[48]!==r||t[49]!==f?(e=e=>(0,F.jsx)(ee,{burst:e,docName:n.docName,editCount:v,sessionAlive:r,inFlight:f,onOpenDiff:e=>l(e.stackIndex+1),onRestore:b},`${n.docName}:${e.stackIndex}`),t[44]=b,t[45]=v,t[46]=n.docName,t[47]=l,t[48]=r,t[49]=f,t[50]=e):e=t[50],M=n.bursts.map(e),t[36]=b,t[37]=v,t[38]=n.bursts,t[39]=n.docName,t[40]=l,t[41]=r,t[42]=f,t[43]=M}else M=t[43];let I;t[51]===M?I=t[52]:(I=(0,F.jsx)(`div`,{children:M}),t[51]=M,t[52]=I);let te;return t[53]!==A||t[54]!==I?(te=(0,F.jsxs)(`div`,{className:`border-b border-border`,"data-testid":`activity-panel-file-row`,children:[A,I]}),t[53]=A,t[54]=I,t[55]=te):te=t[55],te}function re(){return Date.now()}async function ie(e){let t=await fetch(`/api/agent-undo`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...e,agentId:e.connectionId})});if(!t.ok)throw Error(`agent-undo failed: HTTP ${t.status}`)}function R(e){return`#/${e.split(`/`).map(e=>encodeURIComponent(e)).join(`/`)}`}function z(e){typeof window>`u`||(window.location.hash=R(e))}function ae(){let e=(0,N.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,F.jsx)(x,{className:`mr-2 size-4 animate-spin`,"aria-hidden":`true`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,F.jsxs)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,role:`status`,"aria-busy":`true`,children:[t,(0,F.jsx)(`span`,{className:`text-sm`,children:(0,F.jsx)(a,{id:`ONPvOb`})})]}),e[1]=n):n=e[1],n}function oe(e){let t=(0,N.c)(10),{error:n,onRetry:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,F.jsx)(y,{className:`size-6 text-destructive`,"aria-hidden":`true`}),t[0]=i):i=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,F.jsx)(`p`,{className:`text-sm font-medium`,children:(0,F.jsx)(a,{id:`DhLHEb`})}),t[1]=o):o=t[1];let s;t[2]===n?s=t[3]:(s=(0,F.jsxs)(`div`,{className:`space-y-1`,children:[o,(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n})]}),t[2]=n,t[3]=s);let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,F.jsx)(a,{id:`6gRgw8`}),t[4]=l):l=t[4];let u;t[5]===r?u=t[6]:(u=(0,F.jsx)(c,{type:`button`,variant:`outline`,size:`sm`,onClick:r,children:l}),t[5]=r,t[6]=u);let d;return t[7]!==s||t[8]!==u?(d=(0,F.jsxs)(`div`,{className:`flex flex-col items-center gap-3 p-6 text-center`,role:`alert`,"data-testid":`activity-panel-error`,children:[i,s,u]}),t[7]=s,t[8]=u,t[9]=d):d=t[9],d}function se(){let e=(0,N.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,F.jsx)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,"data-testid":`activity-panel-empty`,children:(0,F.jsx)(`p`,{className:`text-sm italic`,children:(0,F.jsx)(a,{id:`iuTKci`})})}),e[0]=t):t=e[0],t}function B(e){let t=(0,N.c)(12),{onExit:n,showBackButton:r}=e,{_:i}=o(),s;t[0]===i?s=t[1]:(s=i({id:`kYL1lH`}),t[0]=i,t[1]=s);let c;t[2]!==n||t[3]!==r?(c=r?(0,F.jsx)(V,{onClick:n}):null,t[2]=n,t[3]=r,t[4]=c):c=t[4];let l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,F.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:(0,F.jsx)(a,{id:`kYL1lH`})}),t[5]=l):l=t[5];let u;t[6]===c?u=t[7]:(u=(0,F.jsxs)(`div`,{className:`flex shrink-0 flex-row items-center gap-2 border-b border-border px-3 py-2`,children:[c,l]}),t[6]=c,t[7]=u);let d;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,F.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-6 text-muted-foreground`,children:(0,F.jsx)(`p`,{className:`text-center text-sm italic`,children:(0,F.jsx)(a,{id:`D_WKe_`})})}),t[8]=d):d=t[8];let f;return t[9]!==s||t[10]!==u?(f=(0,F.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`activity-panel-no-agent`,"aria-label":s,children:[u,d]}),t[9]=s,t[10]=u,t[11]=f):f=t[11],f}function V(e){let t=(0,N.c)(9),{onClick:n}=e,{_:r}=o(),i;t[0]===r?i=t[1]:(i=r({id:`ogAuyr`}),t[0]=r,t[1]=i);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,F.jsx)(v,{}),t[2]=s):s=t[2];let f;t[3]!==n||t[4]!==i?(f=(0,F.jsx)(l,{asChild:!0,children:(0,F.jsx)(c,{type:`button`,variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,onClick:n,"aria-label":i,"data-testid":`docpanel-exit-agent-mode`,children:s})}),t[3]=n,t[4]=i,t[5]=f):f=t[5];let p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,F.jsx)(u,{side:`bottom`,children:(0,F.jsx)(a,{id:`ogAuyr`})}),t[6]=p):p=t[6];let m;return t[7]===f?m=t[8]:(m=(0,F.jsxs)(d,{children:[f,p]}),t[7]=f,t[8]=m),m}function H(e){let t=(0,N.c)(9),{lastTs:n}=e,[r]=(0,P.useState)(U),i;t[0]!==n||t[1]!==r?(i=n?W(r-n):null,t[0]=n,t[1]=r,t[2]=i):i=t[2];let o=i,s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,F.jsx)(`span`,{className:`font-medium`,children:(0,F.jsx)(a,{id:`LCUy_N`})}),t[3]=s):s=t[3];let c;t[4]===o?c=t[5]:(c=o?(0,F.jsxs)(`span`,{children:[` · `,o]}):null,t[4]=o,t[5]=c);let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,F.jsx)(`div`,{className:`mt-1 opacity-80`,children:(0,F.jsx)(a,{id:`GK-IRZ`})}),t[6]=l):l=t[6];let u;return t[7]===c?u=t[8]:(u=(0,F.jsxs)(`div`,{className:`border-b border-border bg-muted/40 px-4 py-3 text-xs text-muted-foreground`,"data-testid":`activity-panel-session-ended`,children:[s,c,l]}),t[7]=c,t[8]=u),u}function U(){return Date.now()}function W(e){let t=Math.max(0,e);if(t<6e4){let e=Math.round(t/1e3);return T._({id:`pbwTg6`,values:{seconds:e}})}if(t<36e5){let e=Math.round(t/6e4);return T._({id:`_rP3HI`,values:{minutes:e}})}let n=Math.round(t/36e5);return T._({id:`nYeBmY`,values:{hours:n}})}function G(e){let t=(0,N.c)(10),{agent:n,size:r}=e,i=r===void 0?28:r,a;t[0]!==n.color||t[1]!==i?(a={backgroundColor:n.color,width:i,height:i},t[0]=n.color,t[1]=i,t[2]=a):a=t[2];let o=i*.57,s=i*.57,c;t[3]!==n.icon||t[4]!==o||t[5]!==s?(c=(0,F.jsx)(A,{icon:n.icon,width:o,height:s}),t[3]=n.icon,t[4]=o,t[5]=s,t[6]=c):c=t[6];let l;return t[7]!==a||t[8]!==c?(l=(0,F.jsx)(`span`,{className:`inline-flex shrink-0 items-center justify-center rounded-full text-white ring-2 ring-background`,style:a,"aria-hidden":`true`,children:c}),t[7]=a,t[8]=c,t[9]=l):l=t[9],l}function ce(e){let t=(0,N.c)(25),{data:n,status:r,error:i,reload:s,onExit:c,onNavigate:l,onUndoDrop:u,onSetVersion:d,showBackButton:f}=e,{_:p}=o(),m=n?.files?.[0]?.lastTs??null,h=n?.files?.length??0,g;t[0]===p?g=t[1]:(g=p({id:`kYL1lH`}),t[0]=p,t[1]=g);let _;t[2]!==c||t[3]!==f?(_=f?(0,F.jsx)(V,{onClick:c}):null,t[2]=c,t[3]=f,t[4]=_):_=t[4];let v;t[5]!==n||t[6]!==h||t[7]!==m?(v=n?.agent?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(G,{agent:n.agent}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:n.agent.displayName}),(0,F.jsxs)(`p`,{className:`truncate text-xs text-muted-foreground`,children:[n.sessionAlive?(0,F.jsx)(a,{id:`F6pfE9`}):m===null?(0,F.jsx)(a,{id:`PMyJ9C`}):(0,F.jsx)(a,{id:`237hSL`}),n.files.length>0?(0,F.jsxs)(F.Fragment,{children:[` · `,(0,F.jsx)(a,{id:`u3BOHd`,values:{fileCount:h}})]}):null]})]})]}):(0,F.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,F.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:(0,F.jsx)(a,{id:`kYL1lH`})})}),t[5]=n,t[6]=h,t[7]=m,t[8]=v):v=t[8];let y;t[9]!==_||t[10]!==v?(y=(0,F.jsxs)(`div`,{className:`flex flex-row items-center gap-2 border-b border-border px-3 py-2 shrink-0`,children:[_,v]}),t[9]=_,t[10]=v,t[11]=y):y=t[11];let b;t[12]!==n||t[13]!==i||t[14]!==m||t[15]!==l||t[16]!==d||t[17]!==u||t[18]!==s||t[19]!==r?(b=(0,F.jsx)(`div`,{className:`flex-1 overflow-y-auto`,"data-testid":`activity-panel-body`,children:r===`loading`&&n===null?(0,F.jsx)(ae,{}):r===`error`&&i?(0,F.jsx)(oe,{error:i,onRetry:s}):n===null?(0,F.jsx)(se,{}):(0,F.jsxs)(F.Fragment,{children:[!n.sessionAlive&&m!==null?(0,F.jsx)(H,{lastTs:m}):null,n.files.length===0?(0,F.jsx)(se,{}):n.files.map(e=>(0,F.jsx)(ne,{file:e,sessionAlive:n.sessionAlive,isWriting:n.writingDocs.has(e.docName),onNavigate:l,onUndoDrop:u,onSetVersion:t=>d(e,t)},e.docName))]})}),t[12]=n,t[13]=i,t[14]=m,t[15]=l,t[16]=d,t[17]=u,t[18]=s,t[19]=r,t[20]=b):b=t[20];let x;return t[21]!==g||t[22]!==y||t[23]!==b?(x=(0,F.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`activity-panel`,"aria-label":g,children:[y,b]}),t[21]=g,t[22]=y,t[23]=b,t[24]=x):x=t[24],x}function K(e){let t=(0,N.c)(30),i;t[0]===e?i=t[1]:(i=e===void 0?{}:e,t[0]=e,t[1]=i);let{showBackButton:a}=i,s=a===void 0?!0:a,{_:c}=o(),{docPanelAgentId:l,closeActivityPanel:u}=r(),{openTargetTransition:d}=n(),{pageMeta:f}=b(),{data:p,status:m,error:h,reload:g}=M(l),_,v;if(t[2]!==p||t[3]!==l?(_=()=>{if(!(!p||l===null))for(let e of p.files)O(l,e.docName,e.bursts.length)},v=[p,l],t[2]=p,t[3]=l,t[4]=_,t[5]=v):(_=t[4],v=t[5]),(0,P.useEffect)(_,v),l===null){let e;return t[6]!==u||t[7]!==s?(e=(0,F.jsx)(B,{onExit:u,showBackButton:s}),t[6]=u,t[7]=s,t[8]=e):e=t[8],e}let y;t[9]!==d||t[10]!==f?(y=e=>{d(E({kind:`doc`,target:e,docName:e},f)),z(e)},t[9]=d,t[10]=f,t[11]=y):y=t[11];let x=y,S;t[12]!==p||t[13]!==l?(S=(e,t)=>{if(!p?.agent||l===null)return;C();let n=e.bursts.length;k({agentId:l,agentName:p.agent.displayName,agentColor:p.agent.color,agentIcon:p.agent.icon,docName:e.docName,keptCount:Math.max(0,Math.min(t,n)),maxVersions:n})},t[12]=p,t[13]=l,t[14]=S):S=t[14];let T=S,D;t[15]!==c||t[16]!==p||t[17]!==l||t[18]!==g?(D=async(e,t)=>{if(!(t<=0))try{await ie({connectionId:l,docName:e,scope:`count`,count:t,agentName:p?.agent?.displayName}),w.success(c(t===1?{id:`-dNlfM`,values:{docName:e}}:{id:`ApeA0n`,values:{dropCount:t,docName:e}})),g()}catch(e){let t=e,n=t instanceof Error?t.message:String(t);w.error(c({id:`EqrC_R`,values:{message:n}})),g()}},t[15]=c,t[16]=p,t[17]=l,t[18]=g,t[19]=D):D=t[19];let A=D,j;return t[20]!==u||t[21]!==p||t[22]!==h||t[23]!==x||t[24]!==T||t[25]!==A||t[26]!==g||t[27]!==s||t[28]!==m?(j=(0,F.jsx)(ce,{data:p,status:m,error:h,reload:g,onExit:u,onNavigate:x,onUndoDrop:A,onSetVersion:T,showBackButton:s}),t[20]=u,t[21]=p,t[22]=h,t[23]=x,t[24]=T,t[25]=A,t[26]=g,t[27]=s,t[28]=m,t[29]=j):j=t[29],j}export{K as ActivityModeContent};
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ActivityPanelDiffView-B03Wzvap.js","./chunk-CYidjpOJ.js","./dist-Nvb76hAm.js","./jsx-runtime-BUgB2tll.js","./react-f2sANaYj.js","./compiler-runtime-BfE3aGVn.js","./ActivityPanelDiffView-legcy4jI.css"])))=>i.map(i=>d[i]);
2
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as ee}from"./button-Gol9BgNB.js";import{i as te,n as ne,t as re}from"./tooltip-B4J7VHmA.js";import{n as s,t as c}from"./toggle-group-CjXmmTGy.js";import{t as l}from"./loader-circle-Cg5SU7AZ.js";import{n as u,t as d}from"./panel-right-open-B7ziq39V.js";import{t as ie}from"./x-DVkpYo5d.js";import{t as ae}from"./overlay-layers-y-dNUWSd.js";import{o as oe,r as se,t as ce}from"./agent-diff-store-qaTtNJLp.js";import{t as f}from"./lru-string-cache-BZxOuxTi.js";import{t as le}from"./use-activity-panel-CVU0EVdO.js";import{a as ue,o as de,r as fe,t as pe}from"./use-timeline-entry-diff-CF4QQ4Me.js";var me=o(),p=e(r(),1),m=n(),he=(0,p.lazy)(async()=>({default:(await t(()=>import(`./ActivityPanelDiffView-B03Wzvap.js`),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)).ActivityPanelDiffView})),h=64;function g(e){let t=(0,me.c)(115),{view:n,isPanelCollapsed:r,onTogglePanel:o}=e,{_:f}=a(),{agentId:h,agentName:g,agentColor:_,agentIcon:v,docName:y,keptCount:b}=n,[x]=(0,p.useState)(_e),ve=(0,p.useRef)(null),[S,ye]=(0,p.useState)(`rendered`),be;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(be={status:`loading`,diff:``,before:``,after:``},t[0]=be):be=t[0];let[C,xe]=(0,p.useState)(be),Se,Ce;t[1]!==h||t[2]!==x||t[3]!==y||t[4]!==b?(Se=()=>{let e=!1;xe({status:`loading`,diff:``,before:``,after:``});let t=`${y}\0${b}`,n=x.get(t);if(n!==void 0){xe({status:`ready`,...JSON.parse(n)});return}return le(h,y,b).then(n=>{e||(x.set(t,JSON.stringify(n)),xe({status:`ready`,...n}))}).catch(t=>{e||(console.error(`[agent-diff] failed to load burst diff`,{agentId:h,docName:y,keptCount:b,err:t}),xe({status:`error`,diff:``,before:``,after:``}))}),()=>{e=!0}},Ce=[h,y,b,x],t[1]=h,t[2]=x,t[3]=y,t[4]=b,t[5]=Se,t[6]=Ce):(Se=t[5],Ce=t[6]),(0,p.useEffect)(Se,Ce);let w;t[7]!==C.after||t[8]!==C.before||t[9]!==C.status?(w=C.status===`ready`?de(C.before,C.after):null,t[7]=C.after,t[8]=C.before,t[9]=C.status,t[10]=w):w=t[10];let T=w,E=C.status===`ready`&&C.diff!==``?`${S}:${C.diff}`:``,D,O;t[11]===E?(D=t[12],O=t[13]):(D=()=>{let e=ve.current;if(E===``||!e)return;let t=!1,n=null,r,i,a=()=>{if(t)return;let r=e.querySelector(`.ok-diff-ins, .ok-diff-ins-block, [data-diff-deleted]`)??fe(e)[0];if(!r)return;t=!0,n?.disconnect();let i=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;r.scrollIntoView({block:`center`,behavior:i?`auto`:`smooth`})},o=()=>{t||(r!==void 0&&clearTimeout(r),r=setTimeout(()=>{i!==void 0&&cancelAnimationFrame(i),i=requestAnimationFrame(()=>{i=requestAnimationFrame(a)})},120))};n=new MutationObserver(o),n.observe(e,{childList:!0,subtree:!0}),o();let ee=setTimeout(()=>n?.disconnect(),5e3);return()=>{n?.disconnect(),r!==void 0&&clearTimeout(r),i!==void 0&&cancelAnimationFrame(i),clearTimeout(ee)}},O=[E],t[11]=E,t[12]=D,t[13]=O),(0,p.useEffect)(D,O);let k,A;t[14]===b?(k=t[15],A=t[16]):(k=()=>{let e=e=>{if(e.key===`Escape`&&e.defaultPrevented||ae())return;let t=e.target;t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable)||(e.key===`Escape`?ce():e.key===`j`||e.key===`ArrowRight`?(e.preventDefault(),se(b+1)):(e.key===`k`||e.key===`ArrowLeft`)&&(e.preventDefault(),se(b-1)))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},A=[b],t[14]=b,t[15]=k,t[16]=A),(0,p.useEffect)(k,A);let j,M,N,P,F,I,L,R;if(t[17]!==f||t[18]!==_||t[19]!==v||t[20]!==g||t[21]!==y||t[22]!==C.diff||t[23]!==C.status){let e=C.status===`ready`?pe(C.diff):{additions:0,deletions:0},n=e.additions>0||e.deletions>0;I=`absolute inset-0 z-20 flex flex-col bg-background`,L=`agent-diff-pane`,M=`flex flex-wrap items-center gap-x-2 gap-y-1.5 border-b border-border px-3 py-2`;let r;t[32]===f?r=t[33]:(r=f({id:`b18t0_`}),t[32]=f,t[33]=r);let i;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,m.jsx)(ie,{className:`size-4`}),t[34]=i):i=t[34];let a;t[35]===r?a=t[36]:(a=(0,m.jsx)(te,{asChild:!0,children:(0,m.jsx)(ee,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"data-testid":`agent-diff-close`,"aria-label":r,onClick:ge,children:i})}),t[35]=r,t[36]=a);let o;t[37]===f?o=t[38]:(o=f({id:`b18t0_`}),t[37]=f,t[38]=o);let s;t[39]===o?s=t[40]:(s=(0,m.jsx)(ne,{side:`bottom`,children:o}),t[39]=o,t[40]=s),t[41]!==a||t[42]!==s?(N=(0,m.jsxs)(re,{children:[a,s]}),t[41]=a,t[42]=s,t[43]=N):N=t[43];let c;t[44]===_?c=t[45]:(c={backgroundColor:_},t[44]=_,t[45]=c);let l;t[46]===v?l=t[47]:(l=(0,m.jsx)(oe,{icon:v,width:13,height:13}),t[46]=v,t[47]=l),t[48]!==c||t[49]!==l?(P=(0,m.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-full text-white`,style:c,children:l}),t[48]=c,t[49]=l,t[50]=P):P=t[50];let u;t[51]===y?u=t[52]:(u=(0,m.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,children:y}),t[51]=y,t[52]=u);let d;t[53]===g?d=t[54]:(d=(0,m.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:g}),t[53]=g,t[54]=d),t[55]!==u||t[56]!==d?(F=(0,m.jsxs)(`div`,{className:`min-w-0 max-w-[14rem] shrink`,children:[u,d]}),t[55]=u,t[56]=d,t[57]=F):F=t[57],R=`ml-auto flex flex-wrap items-center justify-end gap-2`,j=n&&(0,m.jsxs)(`span`,{role:`img`,className:`shrink-0 text-xs tabular-nums`,"data-testid":`agent-diff-stat`,"aria-label":f({id:`8lwQlE`,values:{0:e.additions,1:e.deletions}}),children:[(0,m.jsxs)(`span`,{"aria-hidden":`true`,className:`text-emerald-600 dark:text-emerald-500`,children:[`+`,e.additions]}),` `,(0,m.jsxs)(`span`,{"aria-hidden":`true`,className:`text-red-600 dark:text-red-500`,children:[`−`,e.deletions]})]}),t[17]=f,t[18]=_,t[19]=v,t[20]=g,t[21]=y,t[22]=C.diff,t[23]=C.status,t[24]=j,t[25]=M,t[26]=N,t[27]=P,t[28]=F,t[29]=I,t[30]=L,t[31]=R}else j=t[24],M=t[25],N=t[26],P=t[27],F=t[28],I=t[29],L=t[30],R=t[31];let z;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(z=e=>{(e===`rendered`||e===`source`)&&ye(e)},t[58]=z):z=t[58];let B;t[59]===f?B=t[60]:(B=f({id:`ZW3mlR`}),t[59]=f,t[60]=B);let we;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(we=(0,m.jsx)(s,{value:`rendered`,className:`h-6 px-2 text-xs`,"data-testid":`agent-diff-render-rendered`,children:(0,m.jsx)(i,{id:`4z_1j2`})}),t[61]=we):we=t[61];let Te;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,m.jsx)(s,{value:`source`,className:`h-6 px-2 text-xs`,"data-testid":`agent-diff-render-source`,children:(0,m.jsx)(i,{id:`wdxz7K`})}),t[62]=Te):Te=t[62];let V;t[63]!==S||t[64]!==B?(V=(0,m.jsxs)(c,{type:`single`,value:S,onValueChange:z,"aria-label":B,variant:`segmented`,size:`sm`,spacing:1,className:`shrink-0 rounded-md bg-muted p-0.5 dark:bg-background`,children:[we,Te]}),t[63]=S,t[64]=B,t[65]=V):V=t[65];let H;t[66]!==f||t[67]!==r?(H=f(r?{id:`6iDEWA`}:{id:`170Js2`}),t[66]=f,t[67]=r,t[68]=H):H=t[68];let Ee=!r,U;t[69]===r?U=t[70]:(U=r?(0,m.jsx)(d,{className:`size-4`}):(0,m.jsx)(u,{className:`size-4`}),t[69]=r,t[70]=U);let W;t[71]!==o||t[72]!==H||t[73]!==Ee||t[74]!==U?(W=(0,m.jsx)(te,{asChild:!0,children:(0,m.jsx)(ee,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"data-testid":`agent-diff-toggle-panel`,"aria-label":H,"aria-expanded":Ee,onClick:o,children:U})}),t[71]=o,t[72]=H,t[73]=Ee,t[74]=U,t[75]=W):W=t[75];let G;t[76]!==f||t[77]!==r?(G=f(r?{id:`6iDEWA`}:{id:`170Js2`}),t[76]=f,t[77]=r,t[78]=G):G=t[78];let K;t[79]===G?K=t[80]:(K=(0,m.jsx)(ne,{side:`bottom`,children:G}),t[79]=G,t[80]=K);let q;t[81]!==W||t[82]!==K?(q=(0,m.jsxs)(re,{children:[W,K]}),t[81]=W,t[82]=K,t[83]=q):q=t[83];let J;t[84]!==j||t[85]!==V||t[86]!==q||t[87]!==R?(J=(0,m.jsxs)(`div`,{className:R,children:[j,V,q]}),t[84]=j,t[85]=V,t[86]=q,t[87]=R,t[88]=J):J=t[88];let Y;t[89]!==M||t[90]!==N||t[91]!==P||t[92]!==F||t[93]!==J?(Y=(0,m.jsxs)(`div`,{className:M,children:[N,P,F,J]}),t[89]=M,t[90]=N,t[91]=P,t[92]=F,t[93]=J,t[94]=Y):Y=t[94];let X;t[95]===C.status?X=t[96]:(X=C.status===`loading`&&(0,m.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground`,children:[(0,m.jsx)(l,{className:`size-3 animate-spin`}),(0,m.jsx)(i,{id:`38foVZ`})]}),t[95]=C.status,t[96]=X);let Z;t[97]===C.status?Z=t[98]:(Z=C.status===`error`&&(0,m.jsx)(`p`,{className:`px-4 py-3 text-xs text-destructive`,children:(0,m.jsx)(i,{id:`vvWZnu`})}),t[97]=C.status,t[98]=Z);let Q;t[99]!==b||t[100]!==S||t[101]!==T||t[102]!==C.after||t[103]!==C.diff||t[104]!==C.status?(Q=C.status===`ready`&&(S===`rendered`&&T?.ok?(0,m.jsx)(ue,{diff:T}):C.diff===``?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`p`,{className:`border-b border-border px-4 py-2 text-xs text-muted-foreground italic`,children:b===0?(0,m.jsx)(i,{id:`klPS-L`}):(0,m.jsx)(i,{id:`k7Hoig`})}),(0,m.jsx)(`pre`,{className:`whitespace-pre-wrap px-4 py-3 font-mono text-xs text-foreground/90`,children:C.after})]}):(0,m.jsx)(p.Suspense,{fallback:(0,m.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground`,children:[(0,m.jsx)(l,{className:`size-3 animate-spin`}),(0,m.jsx)(i,{id:`EDm3wJ`})]}),children:(0,m.jsx)(he,{diff:C.diff,viewType:`unified`})})),t[99]=b,t[100]=S,t[101]=T,t[102]=C.after,t[103]=C.diff,t[104]=C.status,t[105]=Q):Q=t[105];let $;t[106]!==X||t[107]!==Z||t[108]!==Q?($=(0,m.jsxs)(`div`,{ref:ve,className:`min-h-0 flex-1 overflow-auto subtle-scrollbar`,children:[X,Z,Q]}),t[106]=X,t[107]=Z,t[108]=Q,t[109]=$):$=t[109];let De;return t[110]!==I||t[111]!==L||t[112]!==Y||t[113]!==$?(De=(0,m.jsxs)(`div`,{className:I,"data-testid":L,children:[Y,$]}),t[110]=I,t[111]=L,t[112]=Y,t[113]=$,t[114]=De):De=t[114],De}function ge(){return ce()}function _e(){return new f(h)}export{g as AgentDiffPane};
2
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as ee}from"./button-Gol9BgNB.js";import{i as te,n as ne,t as re}from"./tooltip-B4J7VHmA.js";import{n as s,t as c}from"./toggle-group-CjXmmTGy.js";import{t as l}from"./loader-circle-Cg5SU7AZ.js";import{n as u,t as d}from"./panel-right-open-B7ziq39V.js";import{t as ie}from"./x-DVkpYo5d.js";import{t as ae}from"./overlay-layers-y-dNUWSd.js";import{o as oe,r as se,t as ce}from"./agent-diff-store-qaTtNJLp.js";import{t as f}from"./lru-string-cache-BZxOuxTi.js";import{t as le}from"./use-activity-panel-dwds5ZEO.js";import{a as ue,o as de,r as fe,t as pe}from"./use-timeline-entry-diff-8VJV_hOg.js";var me=o(),p=e(r(),1),m=n(),he=(0,p.lazy)(async()=>({default:(await t(()=>import(`./ActivityPanelDiffView-B03Wzvap.js`),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)).ActivityPanelDiffView})),h=64;function g(e){let t=(0,me.c)(115),{view:n,isPanelCollapsed:r,onTogglePanel:o}=e,{_:f}=a(),{agentId:h,agentName:g,agentColor:_,agentIcon:v,docName:y,keptCount:b}=n,[x]=(0,p.useState)(_e),ve=(0,p.useRef)(null),[S,ye]=(0,p.useState)(`rendered`),be;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(be={status:`loading`,diff:``,before:``,after:``},t[0]=be):be=t[0];let[C,xe]=(0,p.useState)(be),Se,Ce;t[1]!==h||t[2]!==x||t[3]!==y||t[4]!==b?(Se=()=>{let e=!1;xe({status:`loading`,diff:``,before:``,after:``});let t=`${y}\0${b}`,n=x.get(t);if(n!==void 0){xe({status:`ready`,...JSON.parse(n)});return}return le(h,y,b).then(n=>{e||(x.set(t,JSON.stringify(n)),xe({status:`ready`,...n}))}).catch(t=>{e||(console.error(`[agent-diff] failed to load burst diff`,{agentId:h,docName:y,keptCount:b,err:t}),xe({status:`error`,diff:``,before:``,after:``}))}),()=>{e=!0}},Ce=[h,y,b,x],t[1]=h,t[2]=x,t[3]=y,t[4]=b,t[5]=Se,t[6]=Ce):(Se=t[5],Ce=t[6]),(0,p.useEffect)(Se,Ce);let w;t[7]!==C.after||t[8]!==C.before||t[9]!==C.status?(w=C.status===`ready`?de(C.before,C.after):null,t[7]=C.after,t[8]=C.before,t[9]=C.status,t[10]=w):w=t[10];let T=w,E=C.status===`ready`&&C.diff!==``?`${S}:${C.diff}`:``,D,O;t[11]===E?(D=t[12],O=t[13]):(D=()=>{let e=ve.current;if(E===``||!e)return;let t=!1,n=null,r,i,a=()=>{if(t)return;let r=e.querySelector(`.ok-diff-ins, .ok-diff-ins-block, [data-diff-deleted]`)??fe(e)[0];if(!r)return;t=!0,n?.disconnect();let i=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;r.scrollIntoView({block:`center`,behavior:i?`auto`:`smooth`})},o=()=>{t||(r!==void 0&&clearTimeout(r),r=setTimeout(()=>{i!==void 0&&cancelAnimationFrame(i),i=requestAnimationFrame(()=>{i=requestAnimationFrame(a)})},120))};n=new MutationObserver(o),n.observe(e,{childList:!0,subtree:!0}),o();let ee=setTimeout(()=>n?.disconnect(),5e3);return()=>{n?.disconnect(),r!==void 0&&clearTimeout(r),i!==void 0&&cancelAnimationFrame(i),clearTimeout(ee)}},O=[E],t[11]=E,t[12]=D,t[13]=O),(0,p.useEffect)(D,O);let k,A;t[14]===b?(k=t[15],A=t[16]):(k=()=>{let e=e=>{if(e.key===`Escape`&&e.defaultPrevented||ae())return;let t=e.target;t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable)||(e.key===`Escape`?ce():e.key===`j`||e.key===`ArrowRight`?(e.preventDefault(),se(b+1)):(e.key===`k`||e.key===`ArrowLeft`)&&(e.preventDefault(),se(b-1)))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},A=[b],t[14]=b,t[15]=k,t[16]=A),(0,p.useEffect)(k,A);let j,M,N,P,F,I,L,R;if(t[17]!==f||t[18]!==_||t[19]!==v||t[20]!==g||t[21]!==y||t[22]!==C.diff||t[23]!==C.status){let e=C.status===`ready`?pe(C.diff):{additions:0,deletions:0},n=e.additions>0||e.deletions>0;I=`absolute inset-0 z-20 flex flex-col bg-background`,L=`agent-diff-pane`,M=`flex flex-wrap items-center gap-x-2 gap-y-1.5 border-b border-border px-3 py-2`;let r;t[32]===f?r=t[33]:(r=f({id:`b18t0_`}),t[32]=f,t[33]=r);let i;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,m.jsx)(ie,{className:`size-4`}),t[34]=i):i=t[34];let a;t[35]===r?a=t[36]:(a=(0,m.jsx)(te,{asChild:!0,children:(0,m.jsx)(ee,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"data-testid":`agent-diff-close`,"aria-label":r,onClick:ge,children:i})}),t[35]=r,t[36]=a);let o;t[37]===f?o=t[38]:(o=f({id:`b18t0_`}),t[37]=f,t[38]=o);let s;t[39]===o?s=t[40]:(s=(0,m.jsx)(ne,{side:`bottom`,children:o}),t[39]=o,t[40]=s),t[41]!==a||t[42]!==s?(N=(0,m.jsxs)(re,{children:[a,s]}),t[41]=a,t[42]=s,t[43]=N):N=t[43];let c;t[44]===_?c=t[45]:(c={backgroundColor:_},t[44]=_,t[45]=c);let l;t[46]===v?l=t[47]:(l=(0,m.jsx)(oe,{icon:v,width:13,height:13}),t[46]=v,t[47]=l),t[48]!==c||t[49]!==l?(P=(0,m.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-full text-white`,style:c,children:l}),t[48]=c,t[49]=l,t[50]=P):P=t[50];let u;t[51]===y?u=t[52]:(u=(0,m.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,children:y}),t[51]=y,t[52]=u);let d;t[53]===g?d=t[54]:(d=(0,m.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:g}),t[53]=g,t[54]=d),t[55]!==u||t[56]!==d?(F=(0,m.jsxs)(`div`,{className:`min-w-0 max-w-[14rem] shrink`,children:[u,d]}),t[55]=u,t[56]=d,t[57]=F):F=t[57],R=`ml-auto flex flex-wrap items-center justify-end gap-2`,j=n&&(0,m.jsxs)(`span`,{role:`img`,className:`shrink-0 text-xs tabular-nums`,"data-testid":`agent-diff-stat`,"aria-label":f({id:`8lwQlE`,values:{0:e.additions,1:e.deletions}}),children:[(0,m.jsxs)(`span`,{"aria-hidden":`true`,className:`text-emerald-600 dark:text-emerald-500`,children:[`+`,e.additions]}),` `,(0,m.jsxs)(`span`,{"aria-hidden":`true`,className:`text-red-600 dark:text-red-500`,children:[`−`,e.deletions]})]}),t[17]=f,t[18]=_,t[19]=v,t[20]=g,t[21]=y,t[22]=C.diff,t[23]=C.status,t[24]=j,t[25]=M,t[26]=N,t[27]=P,t[28]=F,t[29]=I,t[30]=L,t[31]=R}else j=t[24],M=t[25],N=t[26],P=t[27],F=t[28],I=t[29],L=t[30],R=t[31];let z;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(z=e=>{(e===`rendered`||e===`source`)&&ye(e)},t[58]=z):z=t[58];let B;t[59]===f?B=t[60]:(B=f({id:`ZW3mlR`}),t[59]=f,t[60]=B);let we;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(we=(0,m.jsx)(s,{value:`rendered`,className:`h-6 px-2 text-xs`,"data-testid":`agent-diff-render-rendered`,children:(0,m.jsx)(i,{id:`4z_1j2`})}),t[61]=we):we=t[61];let Te;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,m.jsx)(s,{value:`source`,className:`h-6 px-2 text-xs`,"data-testid":`agent-diff-render-source`,children:(0,m.jsx)(i,{id:`wdxz7K`})}),t[62]=Te):Te=t[62];let V;t[63]!==S||t[64]!==B?(V=(0,m.jsxs)(c,{type:`single`,value:S,onValueChange:z,"aria-label":B,variant:`segmented`,size:`sm`,spacing:1,className:`shrink-0 rounded-md bg-muted p-0.5 dark:bg-background`,children:[we,Te]}),t[63]=S,t[64]=B,t[65]=V):V=t[65];let H;t[66]!==f||t[67]!==r?(H=f(r?{id:`6iDEWA`}:{id:`170Js2`}),t[66]=f,t[67]=r,t[68]=H):H=t[68];let Ee=!r,U;t[69]===r?U=t[70]:(U=r?(0,m.jsx)(d,{className:`size-4`}):(0,m.jsx)(u,{className:`size-4`}),t[69]=r,t[70]=U);let W;t[71]!==o||t[72]!==H||t[73]!==Ee||t[74]!==U?(W=(0,m.jsx)(te,{asChild:!0,children:(0,m.jsx)(ee,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"data-testid":`agent-diff-toggle-panel`,"aria-label":H,"aria-expanded":Ee,onClick:o,children:U})}),t[71]=o,t[72]=H,t[73]=Ee,t[74]=U,t[75]=W):W=t[75];let G;t[76]!==f||t[77]!==r?(G=f(r?{id:`6iDEWA`}:{id:`170Js2`}),t[76]=f,t[77]=r,t[78]=G):G=t[78];let K;t[79]===G?K=t[80]:(K=(0,m.jsx)(ne,{side:`bottom`,children:G}),t[79]=G,t[80]=K);let q;t[81]!==W||t[82]!==K?(q=(0,m.jsxs)(re,{children:[W,K]}),t[81]=W,t[82]=K,t[83]=q):q=t[83];let J;t[84]!==j||t[85]!==V||t[86]!==q||t[87]!==R?(J=(0,m.jsxs)(`div`,{className:R,children:[j,V,q]}),t[84]=j,t[85]=V,t[86]=q,t[87]=R,t[88]=J):J=t[88];let Y;t[89]!==M||t[90]!==N||t[91]!==P||t[92]!==F||t[93]!==J?(Y=(0,m.jsxs)(`div`,{className:M,children:[N,P,F,J]}),t[89]=M,t[90]=N,t[91]=P,t[92]=F,t[93]=J,t[94]=Y):Y=t[94];let X;t[95]===C.status?X=t[96]:(X=C.status===`loading`&&(0,m.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground`,children:[(0,m.jsx)(l,{className:`size-3 animate-spin`}),(0,m.jsx)(i,{id:`38foVZ`})]}),t[95]=C.status,t[96]=X);let Z;t[97]===C.status?Z=t[98]:(Z=C.status===`error`&&(0,m.jsx)(`p`,{className:`px-4 py-3 text-xs text-destructive`,children:(0,m.jsx)(i,{id:`vvWZnu`})}),t[97]=C.status,t[98]=Z);let Q;t[99]!==b||t[100]!==S||t[101]!==T||t[102]!==C.after||t[103]!==C.diff||t[104]!==C.status?(Q=C.status===`ready`&&(S===`rendered`&&T?.ok?(0,m.jsx)(ue,{diff:T}):C.diff===``?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`p`,{className:`border-b border-border px-4 py-2 text-xs text-muted-foreground italic`,children:b===0?(0,m.jsx)(i,{id:`klPS-L`}):(0,m.jsx)(i,{id:`k7Hoig`})}),(0,m.jsx)(`pre`,{className:`whitespace-pre-wrap px-4 py-3 font-mono text-xs text-foreground/90`,children:C.after})]}):(0,m.jsx)(p.Suspense,{fallback:(0,m.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground`,children:[(0,m.jsx)(l,{className:`size-3 animate-spin`}),(0,m.jsx)(i,{id:`EDm3wJ`})]}),children:(0,m.jsx)(he,{diff:C.diff,viewType:`unified`})})),t[99]=b,t[100]=S,t[101]=T,t[102]=C.after,t[103]=C.diff,t[104]=C.status,t[105]=Q):Q=t[105];let $;t[106]!==X||t[107]!==Z||t[108]!==Q?($=(0,m.jsxs)(`div`,{ref:ve,className:`min-h-0 flex-1 overflow-auto subtle-scrollbar`,children:[X,Z,Q]}),t[106]=X,t[107]=Z,t[108]=Q,t[109]=$):$=t[109];let De;return t[110]!==I||t[111]!==L||t[112]!==Y||t[113]!==$?(De=(0,m.jsxs)(`div`,{className:I,"data-testid":L,children:[Y,$]}),t[110]=I,t[111]=L,t[112]=Y,t[113]=$,t[114]=De):De=t[114],De}function ge(){return ce()}function _e(){return new f(h)}export{g as AgentDiffPane};