@inkeep/open-knowledge 0.38.0-beta.6 → 0.38.0-beta.8

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 (86) hide show
  1. package/dist/{acp-harness-probe-CD3DPSei.mjs → acp-harness-probe-DvjHMUZJ.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-C84FnhVs.mjs +2 -0
  6. package/dist/index.mjs +1 -1
  7. package/dist/{init-DTQvzEMW.mjs → init-CJIlsZl0.mjs} +3 -3
  8. package/dist/init-dZonLham.mjs +1 -0
  9. package/dist/{launch-json-removal-CSzqpsW_.mjs → launch-json-removal-D2I6kiJ-.mjs} +2 -2
  10. package/dist/{loader-CAo4CIDz.mjs → loader-D0m_F_PJ.mjs} +2 -2
  11. package/dist/loader-DSaY9ZdA.mjs +1 -0
  12. package/dist/{preview-C5HzJLxE.mjs → preview-DnuyHBMZ.mjs} +2 -2
  13. package/dist/preview-lmKXRS8K.mjs +1 -0
  14. package/dist/public/assets/{ActivityModeContent-BRQiz7Gg.js → ActivityModeContent-BMPZl3tb.js} +1 -1
  15. package/dist/public/assets/{AgentDiffPane-D_m8Olga.js → AgentDiffPane-Cw5qpBlW.js} +1 -1
  16. package/dist/public/assets/{AgentThreadClientBinder-CTB6pLJ7.js → AgentThreadClientBinder-CBCAdG4p.js} +1 -1
  17. package/dist/public/assets/{AppMenubar-DqlpmcU7.js → AppMenubar-hPGBtMtR.js} +1 -1
  18. package/dist/public/assets/{CodeMirrorPropInput-D0RRvxEm.js → CodeMirrorPropInput-QvShYcbF.js} +1 -1
  19. package/dist/public/assets/{DocumentContext-B_zqYuAI.js → DocumentContext-BvywpAcT.js} +2 -2
  20. package/dist/public/assets/{EnableSyncConfirmDialog-D7Zyqovd.js → EnableSyncConfirmDialog-5rWSIoBH.js} +1 -1
  21. package/dist/public/assets/{FeedbackForm-D_BU9MqU.js → FeedbackForm-BGZFeizL.js} +1 -1
  22. package/dist/public/assets/{GraphPanel-DZuVLVOw.js → GraphPanel-CG7ehFyf.js} +1 -1
  23. package/dist/public/assets/{ManagedArtifactProperties-DzfhF4o0.js → ManagedArtifactProperties-DHph_UjU.js} +1 -1
  24. package/dist/public/assets/{McpConsentDialogBody-CxKyNN1f.js → McpConsentDialogBody-BEu_w4lu.js} +1 -1
  25. package/dist/public/assets/{MermaidDocEditor-xXyuXJXZ.js → MermaidDocEditor-CkwmBdaN.js} +1 -1
  26. package/dist/public/assets/{PropertyPanel-Cogbrfkl.js → PropertyPanel-SSFVfVqt.js} +1 -1
  27. package/dist/public/assets/{ReportBugDialogBody-CEUi8lPt.js → ReportBugDialogBody--5aXNg8I.js} +1 -1
  28. package/dist/public/assets/{SettingsDialogBody-CsFAzGUM.js → SettingsDialogBody-DjAi_I1t.js} +1 -1
  29. package/dist/public/assets/{ShareBranchSwitchDialog-CEAr3I9Q.js → ShareBranchSwitchDialog-Dz3x9STZ.js} +1 -1
  30. package/dist/public/assets/{ShareReceiveDialog-B7OvGQHd.js → ShareReceiveDialog-B4PVwjNG.js} +1 -1
  31. package/dist/public/assets/{ShareReceiveMissDialog-B5udBca5.js → ShareReceiveMissDialog-CfmR8h5c.js} +1 -1
  32. package/dist/public/assets/{SkillEditorActions-Be8i-jaa.js → SkillEditorActions-Dr52b0PZ.js} +1 -1
  33. package/dist/public/assets/{SourceEditor-B6XV44St.js → SourceEditor-DSyO1lGU.js} +1 -1
  34. package/dist/public/assets/{TerminalPanel-C_3duhgQ.js → TerminalPanel-BpSo4w0_.js} +1 -1
  35. package/dist/public/assets/{TerminalSessionsHost-CAO8SF-D.js → TerminalSessionsHost-C289EqcI.js} +2 -2
  36. package/dist/public/assets/{TerminalWindowApp-CzguEKor.js → TerminalWindowApp-Bd8MRyRT.js} +1 -1
  37. package/dist/public/assets/{ThreadView-CuepCUyH.js → ThreadView-DNyNBhL-.js} +1 -1
  38. package/dist/public/assets/{TimelineDiffPane-udPd9-Yt.js → TimelineDiffPane-oLpdDeEi.js} +1 -1
  39. package/dist/public/assets/{agent-diff-store-Dhae8oo2.js → agent-diff-store-Bd0NDaYd.js} +1 -1
  40. package/dist/public/assets/{agent-visibility-DiHdMcdh.js → agent-visibility-bo7-lQPw.js} +1 -1
  41. package/dist/public/assets/{auth-state-cache-Dw5cv-Re.js → auth-state-cache-DPxIwzLQ.js} +1 -1
  42. package/dist/public/assets/{client-version-C6us3zHK.js → client-version-CCRyjBYZ.js} +1 -1
  43. package/dist/public/assets/{config-provider-DNXd8psn.js → config-provider-DEma7e0E.js} +1 -1
  44. package/dist/public/assets/{dist-CM-z5Mlq.js → dist-BmKvzgDR.js} +1 -1
  45. package/dist/public/assets/{dist-Ca38G5U3.js → dist-df-v6kvy.js} +1 -1
  46. package/dist/public/assets/{doc-hash-Bs2ss-ac.js → doc-hash-NyLrtNo2.js} +1 -1
  47. package/dist/public/assets/{documents-events-CVeZVUoq.js → documents-events-BHJB8gGz.js} +1 -1
  48. package/dist/public/assets/{file-tree-adapter-Bc2We8C-.js → file-tree-adapter-BnZwo5Ls.js} +1 -1
  49. package/dist/public/assets/index-BDJklKwO.js +1995 -0
  50. package/dist/public/assets/{keyboard-shortcuts-CndBRPor.js → keyboard-shortcuts-Ctc7xams.js} +1 -1
  51. package/dist/public/assets/{lint-config-client-DMUkUIUK.js → lint-config-client-BwIg_Zty.js} +1 -1
  52. package/dist/public/assets/{navigation-targets-BFURDxV-.js → navigation-targets-D1rdXyAI.js} +1 -1
  53. package/dist/public/assets/{open-managed-artifact-tab-DiXXqIwr.js → open-managed-artifact-tab-MjzvjrV8.js} +1 -1
  54. package/dist/public/assets/{pending-receive-nav-store-Cbz7Kdas.js → pending-receive-nav-store-D7HSeXpy.js} +1 -1
  55. package/dist/public/assets/{prop-types-IIZw7u0n.js → prop-types-C0wWXvTx.js} +1 -1
  56. package/dist/public/assets/{receive-store-Dcra48Oz.js → receive-store-B3ygF-LA.js} +1 -1
  57. package/dist/public/assets/{selection-context-CNyRDPes.js → selection-context-t5daNj99.js} +1 -1
  58. package/dist/public/assets/{skill-actions-DknvAoZT.js → skill-actions-DeZSwOo7.js} +1 -1
  59. package/dist/public/assets/{skills-api-BfzuhumH.js → skills-api-vt4KnCX6.js} +1 -1
  60. package/dist/public/assets/{src-bqPreb6w.js → src-BS_Yyi8K.js} +1 -1
  61. package/dist/public/assets/{target-navigation-intent-I4UM-x6n.js → target-navigation-intent-DNrmu8Sx.js} +1 -1
  62. package/dist/public/assets/{terminal-launch-events-BHwqFf2t.js → terminal-launch-events-vDhBoD8w.js} +1 -1
  63. package/dist/public/assets/{terminal-telemetry-D1aeGl-R.js → terminal-telemetry-D1lMQO11.js} +1 -1
  64. package/dist/public/assets/{typing-burst-detector-CDZ6YHeV.js → typing-burst-detector-GlRUPS8u.js} +1 -1
  65. package/dist/public/assets/{use-activity-panel-BQma_v27.js → use-activity-panel-Dq1IdrW7.js} +1 -1
  66. package/dist/public/assets/{use-apply-config-color-theme-C0Cek6NJ.js → use-apply-config-color-theme-R1RZkk5a.js} +1 -1
  67. package/dist/public/assets/{use-collab-url-BaNZ7sdp.js → use-collab-url-B-LUA0g9.js} +1 -1
  68. package/dist/public/assets/{use-live-xterm-theme-Dz6hvjuv.js → use-live-xterm-theme-DW54zfIk.js} +1 -1
  69. package/dist/public/assets/{use-terminal-enabled-qFZ8rXL0.js → use-terminal-enabled-CqEC-KDC.js} +1 -1
  70. package/dist/public/assets/{use-timeline-entry-diff-aNFtV2Jq.js → use-timeline-entry-diff-CHEjXPj0.js} +1 -1
  71. package/dist/public/assets/{use-workspace-BLr9vvf6.js → use-workspace-0T1cdRp3.js} +1 -1
  72. package/dist/public/assets/{workspace-paths-Dgj2u8bQ.js → workspace-paths-nkXut9sM.js} +1 -1
  73. package/dist/public/assets/{zod-BtDPLTDt.js → zod-BmQcPlGk.js} +1 -1
  74. package/dist/public/index.html +35 -35
  75. package/dist/{repair-launch-json-DdKhQjo_.mjs → repair-launch-json-kiGsPVGL.mjs} +2 -2
  76. package/dist/{repair-mcp-configs-CR7okbjl.mjs → repair-mcp-configs-CxGH6jn-.mjs} +2 -2
  77. package/dist/{src-2rFtUPmd.mjs → src-CZoZ08SX.mjs} +2 -2
  78. package/dist/start-BJGQmBXF.mjs +1 -0
  79. package/dist/{start-CSxxyep8.mjs → start-COU-JCst.mjs} +2 -2
  80. package/package.json +5 -5
  81. package/dist/constants-XB7Gbn8b.mjs +0 -2
  82. package/dist/init-CEo2uEMy.mjs +0 -1
  83. package/dist/loader-wEc1RSer.mjs +0 -1
  84. package/dist/preview-CcMnlzBn.mjs +0 -1
  85. package/dist/public/assets/index-C3xDGGXT.js +0 -1995
  86. package/dist/start-OWnhXqlM.mjs +0 -1
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{_ as e,a as t,c as n,g as r,i,l as a,m as o,o as s,r as c,s as l,t as u,u as d}from"./write-project-skill-BD-Ei4Cn.mjs";import{a as f,i as p,n as m,t as h}from"./acp-harness-probe-CD3DPSei.mjs";import{A as g,F as _,I as v,M as y,N as b,O as x,P as S,d as C,j as w,k as T,n as E,o as D,s as O,v as k,x as A,y as j}from"./init-DTQvzEMW.mjs";import{C as M,D as N,E as P,b as F,d as I,f as L,h as R,i as z,n as B,p as V,r as H,t as U,u as W,v as G,x as K,y as q}from"./src-2rFtUPmd.mjs";import{n as J}from"./loader-CAo4CIDz.mjs";import{n as Y}from"./preview-C5HzJLxE.mjs";import{n as X,t as Z}from"./mcp-migrate-event-CWx0WLdE.mjs";export{l as ALL_EDITOR_IDS,n as EDITOR_LABELS,a as EDITOR_TARGETS,d as HOSTS_WITH_USER_SKILL_DIR,E as LAUNCH_CONFIG_NAME,I as PATH_SHIM_BEGIN,L as PATH_SHIM_BLOCK_RE,V as PATH_SHIM_END,x as addOkPathsToGitExclude,u as assertProjectPathSafe,o as buildManagedServerEntry,H as buildMcpConfigDeclineEvent,Z as buildMcpConfigMigrateEvent,D as classifyExistingMcpEntry,M as collectReportBundle,p as createTokenStore,P as defaultBugReportZipPath,m as detectGh,O as detectInstalledEditors,T as formatTrackedRemediation,g as getExcludedOkPaths,w as getOkArtifactPaths,r as isEntryUpToDate,e as isOwnManagedEntry,J as loadConfig,f as makeLazyProbeTokenStore,G as parseGitHubBlobUrl,q as parseGitHubShareUrl,F as parseGitHubTreeUrl,K as parseGitUrl,R as pathInstallMarkerPath,Y as previewContent,h as probeOwnManagedEditorMcpEntry,y as probeTrackedOkPaths,C as readExistingMcpEntry,b as readSharingMode,S as readSkillsShared,N as redactContent,_ as removeOkPathsFromGitExclude,W as removeOwnMcpEntry,c as removeProjectSkill,t as removeUserGlobalSkillBundle,A as resolveProjectRoot,z as runStop,v as setSkillsShared,X as truncatePriorEntry,s as userGlobalSkillBundleTargets,B as validateLocalFolderForShare,k as writeEditorMcpConfig,U as writeProjectAiIntegrations,i as writeProjectSkill,j as writeUserMcpConfigs};
1
+ import{_ as e,a as t,c as n,g as r,i,l as a,m as o,o as s,r as c,s as l,t as u,u as d}from"./write-project-skill-BD-Ei4Cn.mjs";import{a as f,i as p,n as m,t as h}from"./acp-harness-probe-DvjHMUZJ.mjs";import{A as g,F as _,I as v,M as y,N as b,O as x,P as S,d as C,j as w,k as T,n as E,o as D,s as O,v as k,x as A,y as j}from"./init-CJIlsZl0.mjs";import{C as M,D as N,E as P,b as F,d as I,f as L,h as R,i as z,n as B,p as V,r as H,t as U,u as W,v as G,x as K,y as q}from"./src-CZoZ08SX.mjs";import{n as J}from"./loader-D0m_F_PJ.mjs";import{n as Y}from"./preview-DnuyHBMZ.mjs";import{n as X,t as Z}from"./mcp-migrate-event-CWx0WLdE.mjs";export{l as ALL_EDITOR_IDS,n as EDITOR_LABELS,a as EDITOR_TARGETS,d as HOSTS_WITH_USER_SKILL_DIR,E as LAUNCH_CONFIG_NAME,I as PATH_SHIM_BEGIN,L as PATH_SHIM_BLOCK_RE,V as PATH_SHIM_END,x as addOkPathsToGitExclude,u as assertProjectPathSafe,o as buildManagedServerEntry,H as buildMcpConfigDeclineEvent,Z as buildMcpConfigMigrateEvent,D as classifyExistingMcpEntry,M as collectReportBundle,p as createTokenStore,P as defaultBugReportZipPath,m as detectGh,O as detectInstalledEditors,T as formatTrackedRemediation,g as getExcludedOkPaths,w as getOkArtifactPaths,r as isEntryUpToDate,e as isOwnManagedEntry,J as loadConfig,f as makeLazyProbeTokenStore,G as parseGitHubBlobUrl,q as parseGitHubShareUrl,F as parseGitHubTreeUrl,K as parseGitUrl,R as pathInstallMarkerPath,Y as previewContent,h as probeOwnManagedEditorMcpEntry,y as probeTrackedOkPaths,C as readExistingMcpEntry,b as readSharingMode,S as readSkillsShared,N as redactContent,_ as removeOkPathsFromGitExclude,W as removeOwnMcpEntry,c as removeProjectSkill,t as removeUserGlobalSkillBundle,A as resolveProjectRoot,z as runStop,v as setSkillsShared,X as truncatePriorEntry,s as userGlobalSkillBundleTargets,B as validateLocalFolderForShare,k as writeEditorMcpConfig,U as writeProjectAiIntegrations,i as writeProjectSkill,j as writeUserMcpConfigs};
@@ -1,4 +1,4 @@
1
- import{i as e,o as t,t as n}from"./chunk-DTipWd-i.mjs";import{O as r,Pa as i,_a as a,j as o}from"./src-FuRMJntf.mjs";import{$n as s,$t as c,Hn as l,Mn as u,Nr as d,Tn as f,Vn as p,c as m,en as h,er as g,fn as _,in as v,l as y,nn as b,pa as x,pn as S,rr as C,tr as ee,u as te}from"./src-DBW4MhVj.mjs";import{U as ne}from"./sleep-DcENuR74.mjs";import{M as w,P as T}from"./fs-traced-B-qtPUmb.mjs";import{C as re,a as ie,b as ae,d as E,f as oe,i as se,l as D,m as ce,p as le,s as ue,t as de,x as fe}from"./write-project-skill-BD-Ei4Cn.mjs";import{t as pe}from"./constants-XB7Gbn8b.mjs";import{t as O}from"./is-object-Bw0-z8qH.mjs";import{i as k,n as me,o as A,r as he,s as j,t as M}from"./colors-_gzKDfrv.mjs";import{t as ge}from"./preview-C5HzJLxE.mjs";import{createRequire as _e}from"node:module";import{execFileSync as ve}from"node:child_process";import N,{dirname as P,isAbsolute as ye,join as F,relative as I,resolve as be,sep as xe}from"node:path";import{existsSync as L,lstatSync as Se,mkdirSync as Ce,readFileSync as R,readlinkSync as we,realpathSync as Te,statSync as Ee,writeFileSync as De}from"node:fs";import{homedir as Oe}from"node:os";import z from"node:process";import{fileURLToPath as ke}from"node:url";import*as Ae from"node:readline";import{inspect as je,stripVTControlCharacters as Me,styleText as B}from"node:util";import{AsyncLocalStorage as Ne,AsyncResource as Pe}from"node:async_hooks";const Fe=new Set([`emacs`,`vim`]);function Ie(e){return Fe.has(e)}function Le(){let e=process.env.INQUIRER_KEYBINDINGS;return e?Array.from(new Set(e.toLowerCase().split(/[\s,]+/).filter(Ie))):[]}const V=(e,t=[])=>e.name===`up`||t.includes(`vim`)&&e.name===`k`||t.includes(`emacs`)&&e.ctrl&&e.name===`p`,Re=(e,t=[])=>e.name===`down`||t.includes(`vim`)&&e.name===`j`||t.includes(`emacs`)&&e.ctrl&&e.name===`n`,ze=e=>e.name===`space`,Be=e=>e.name===`backspace`,Ve=e=>`1234567890`.includes(e.name),He=e=>e.name===`enter`||e.name===`return`;var Ue=class extends Error{name=`AbortPromptError`;message=`Prompt was aborted`;constructor(e){super(),this.cause=e?.cause}},We=class extends Error{name=`CancelPromptError`;message=`Prompt was canceled`},Ge=class extends Error{name=`ExitPromptError`},Ke=class extends Error{name=`HookError`},qe=class extends Error{name=`ValidationError`};const Je=new Ne;function Ye(e){return{rl:e,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function Xe(e,t){let n=Ye(e);return Je.run(n,()=>{function e(e){n.handleChange=()=>{n.index=0,e()},n.handleChange()}return t(e)})}function H(){let e=Je.getStore();if(!e)throw new Ke(`[Inquirer] Hook functions can only be called from within a prompt`);return e}function Ze(){return H().rl}function Qe(e){return Pe.bind((...t)=>{let n=H(),r=!1,i=n.handleChange;n.handleChange=()=>{r=!0};let a=e(...t);return r&&i(),n.handleChange=i,a})}function $e(e){let t=H(),{index:n}=t,r=e({get(){return t.hooks[n]},set(e){t.hooks[n]=e},initialized:n in t.hooks});return t.index++,r}function et(){H().handleChange()}const U={queue(e){let t=H(),{index:n}=t;t.hooksEffect.push(()=>{t.hooksCleanup[n]?.();let r=e(Ze());if(r!=null&&typeof r!=`function`)throw new qe(`useEffect return value must be a cleanup function or nothing.`);t.hooksCleanup[n]=r})},run(){let e=H();Qe(()=>{e.hooksEffect.forEach(e=>{e()}),e.hooksEffect.length=0})()},clearAll(){let e=H();e.hooksCleanup.forEach(e=>{e?.()}),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function tt(e){return typeof e==`function`}function W(e){return $e(t=>{let n=Pe.bind(function(e){t.get()!==e&&(t.set(e),et())});if(t.initialized)return[t.get(),n];let r=tt(e)?e():e;return t.set(r),[r,n]})}function nt(e,t){$e(n=>{let r=n.get();(!Array.isArray(r)||t.some((e,t)=>!Object.is(e,r[t])))&&U.queue(e),n.set(t)})}function rt(){return z.platform.startsWith(`win`)?!!z.env.CI||!!z.env.WT_SESSION||!!z.env.TERMINUS_SUBLIME||z.env.ConEmuTask===`{cmd::Cmder}`||z.env.TERM_PROGRAM===`Terminus-Sublime`||z.env.TERM_PROGRAM===`vscode`||z.env.TERM===`xterm-256color`||z.env.TERM===`alacritty`||z.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:z.env.TERM!==`linux`}const it={circleQuestionMark:`(?)`,questionMarkPrefix:`(?)`,square:`█`,squareDarkShade:`▓`,squareMediumShade:`▒`,squareLightShade:`░`,squareTop:`▀`,squareBottom:`▄`,squareLeft:`▌`,squareRight:`▐`,squareCenter:`■`,bullet:`●`,dot:`․`,ellipsis:`…`,pointerSmall:`›`,triangleUp:`▲`,triangleUpSmall:`▴`,triangleDown:`▼`,triangleDownSmall:`▾`,triangleLeftSmall:`◂`,triangleRightSmall:`▸`,home:`⌂`,heart:`♥`,musicNote:`♪`,musicNoteBeamed:`♫`,arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,arrowLeftRight:`↔`,arrowUpDown:`↕`,almostEqual:`≈`,notEqual:`≠`,lessOrEqual:`≤`,greaterOrEqual:`≥`,identical:`≡`,infinity:`∞`,subscriptZero:`₀`,subscriptOne:`₁`,subscriptTwo:`₂`,subscriptThree:`₃`,subscriptFour:`₄`,subscriptFive:`₅`,subscriptSix:`₆`,subscriptSeven:`₇`,subscriptEight:`₈`,subscriptNine:`₉`,oneHalf:`½`,oneThird:`⅓`,oneQuarter:`¼`,oneFifth:`⅕`,oneSixth:`⅙`,oneEighth:`⅛`,twoThirds:`⅔`,twoFifths:`⅖`,threeQuarters:`¾`,threeFifths:`⅗`,threeEighths:`⅜`,fourFifths:`⅘`,fiveSixths:`⅚`,fiveEighths:`⅝`,sevenEighths:`⅞`,line:`─`,lineBold:`━`,lineDouble:`═`,lineDashed0:`┄`,lineDashed1:`┅`,lineDashed2:`┈`,lineDashed3:`┉`,lineDashed4:`╌`,lineDashed5:`╍`,lineDashed6:`╴`,lineDashed7:`╶`,lineDashed8:`╸`,lineDashed9:`╺`,lineDashed10:`╼`,lineDashed11:`╾`,lineDashed12:`−`,lineDashed13:`–`,lineDashed14:`‐`,lineDashed15:`⁃`,lineVertical:`│`,lineVerticalBold:`┃`,lineVerticalDouble:`║`,lineVerticalDashed0:`┆`,lineVerticalDashed1:`┇`,lineVerticalDashed2:`┊`,lineVerticalDashed3:`┋`,lineVerticalDashed4:`╎`,lineVerticalDashed5:`╏`,lineVerticalDashed6:`╵`,lineVerticalDashed7:`╷`,lineVerticalDashed8:`╹`,lineVerticalDashed9:`╻`,lineVerticalDashed10:`╽`,lineVerticalDashed11:`╿`,lineDownLeft:`┐`,lineDownLeftArc:`╮`,lineDownBoldLeftBold:`┓`,lineDownBoldLeft:`┒`,lineDownLeftBold:`┑`,lineDownDoubleLeftDouble:`╗`,lineDownDoubleLeft:`╖`,lineDownLeftDouble:`╕`,lineDownRight:`┌`,lineDownRightArc:`╭`,lineDownBoldRightBold:`┏`,lineDownBoldRight:`┎`,lineDownRightBold:`┍`,lineDownDoubleRightDouble:`╔`,lineDownDoubleRight:`╓`,lineDownRightDouble:`╒`,lineUpLeft:`┘`,lineUpLeftArc:`╯`,lineUpBoldLeftBold:`┛`,lineUpBoldLeft:`┚`,lineUpLeftBold:`┙`,lineUpDoubleLeftDouble:`╝`,lineUpDoubleLeft:`╜`,lineUpLeftDouble:`╛`,lineUpRight:`└`,lineUpRightArc:`╰`,lineUpBoldRightBold:`┗`,lineUpBoldRight:`┖`,lineUpRightBold:`┕`,lineUpDoubleRightDouble:`╚`,lineUpDoubleRight:`╙`,lineUpRightDouble:`╘`,lineUpDownLeft:`┤`,lineUpBoldDownBoldLeftBold:`┫`,lineUpBoldDownBoldLeft:`┨`,lineUpDownLeftBold:`┥`,lineUpBoldDownLeftBold:`┩`,lineUpDownBoldLeftBold:`┪`,lineUpDownBoldLeft:`┧`,lineUpBoldDownLeft:`┦`,lineUpDoubleDownDoubleLeftDouble:`╣`,lineUpDoubleDownDoubleLeft:`╢`,lineUpDownLeftDouble:`╡`,lineUpDownRight:`├`,lineUpBoldDownBoldRightBold:`┣`,lineUpBoldDownBoldRight:`┠`,lineUpDownRightBold:`┝`,lineUpBoldDownRightBold:`┡`,lineUpDownBoldRightBold:`┢`,lineUpDownBoldRight:`┟`,lineUpBoldDownRight:`┞`,lineUpDoubleDownDoubleRightDouble:`╠`,lineUpDoubleDownDoubleRight:`╟`,lineUpDownRightDouble:`╞`,lineDownLeftRight:`┬`,lineDownBoldLeftBoldRightBold:`┳`,lineDownLeftBoldRightBold:`┯`,lineDownBoldLeftRight:`┰`,lineDownBoldLeftBoldRight:`┱`,lineDownBoldLeftRightBold:`┲`,lineDownLeftRightBold:`┮`,lineDownLeftBoldRight:`┭`,lineDownDoubleLeftDoubleRightDouble:`╦`,lineDownDoubleLeftRight:`╥`,lineDownLeftDoubleRightDouble:`╤`,lineUpLeftRight:`┴`,lineUpBoldLeftBoldRightBold:`┻`,lineUpLeftBoldRightBold:`┷`,lineUpBoldLeftRight:`┸`,lineUpBoldLeftBoldRight:`┹`,lineUpBoldLeftRightBold:`┺`,lineUpLeftRightBold:`┶`,lineUpLeftBoldRight:`┵`,lineUpDoubleLeftDoubleRightDouble:`╩`,lineUpDoubleLeftRight:`╨`,lineUpLeftDoubleRightDouble:`╧`,lineUpDownLeftRight:`┼`,lineUpBoldDownBoldLeftBoldRightBold:`╋`,lineUpDownBoldLeftBoldRightBold:`╈`,lineUpBoldDownLeftBoldRightBold:`╇`,lineUpBoldDownBoldLeftRightBold:`╊`,lineUpBoldDownBoldLeftBoldRight:`╉`,lineUpBoldDownLeftRight:`╀`,lineUpDownBoldLeftRight:`╁`,lineUpDownLeftBoldRight:`┽`,lineUpDownLeftRightBold:`┾`,lineUpBoldDownBoldLeftRight:`╂`,lineUpDownLeftBoldRightBold:`┿`,lineUpBoldDownLeftBoldRight:`╃`,lineUpBoldDownLeftRightBold:`╄`,lineUpDownBoldLeftBoldRight:`╅`,lineUpDownBoldLeftRightBold:`╆`,lineUpDoubleDownDoubleLeftDoubleRightDouble:`╬`,lineUpDoubleDownDoubleLeftRight:`╫`,lineUpDownLeftDoubleRightDouble:`╪`,lineCross:`╳`,lineBackslash:`╲`,lineSlash:`╱`},at={tick:`✔`,info:`ℹ`,warning:`⚠`,cross:`✘`,squareSmall:`◻`,squareSmallFilled:`◼`,circle:`◯`,circleFilled:`◉`,circleDotted:`◌`,circleDouble:`◎`,circleCircle:`ⓞ`,circleCross:`ⓧ`,circlePipe:`Ⓘ`,radioOn:`◉`,radioOff:`◯`,checkboxOn:`☒`,checkboxOff:`☐`,checkboxCircleOn:`ⓧ`,checkboxCircleOff:`Ⓘ`,pointer:`❯`,triangleUpOutline:`△`,triangleLeft:`◀`,triangleRight:`▶`,lozenge:`◆`,lozengeOutline:`◇`,hamburger:`☰`,smiley:`㋡`,mustache:`෴`,star:`★`,play:`▶`,nodejs:`⬢`,oneSeventh:`⅐`,oneNinth:`⅑`,oneTenth:`⅒`},ot={tick:`√`,info:`i`,warning:`‼`,cross:`×`,squareSmall:`□`,squareSmallFilled:`■`,circle:`( )`,circleFilled:`(*)`,circleDotted:`( )`,circleDouble:`( )`,circleCircle:`(○)`,circleCross:`(×)`,circlePipe:`(│)`,radioOn:`(*)`,radioOff:`( )`,checkboxOn:`[×]`,checkboxOff:`[ ]`,checkboxCircleOn:`(×)`,checkboxCircleOff:`( )`,pointer:`>`,triangleUpOutline:`∆`,triangleLeft:`◄`,triangleRight:`►`,lozenge:`♦`,lozengeOutline:`◊`,hamburger:`≡`,smiley:`☺`,mustache:`┌─┐`,star:`✶`,play:`►`,nodejs:`♦`,oneSeventh:`1/7`,oneNinth:`1/9`,oneTenth:`1/10`},st={...it,...at},ct={...it,...ot},G=rt()?st:ct;Object.entries(at);const lt={prefix:{idle:B(`blue`,`?`),done:B(`green`,G.tick)},spinner:{interval:80,frames:[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`].map(e=>B(`yellow`,e))},keybindings:[],style:{answer:e=>B(`cyan`,e),message:e=>B(`bold`,e),error:e=>B(`red`,`> ${e}`),defaultAnswer:e=>B(`dim`,`(${e})`),help:e=>B(`dim`,e),highlight:e=>B(`cyan`,e),key:e=>B(`cyan`,B(`bold`,`<${e}>`))}};function ut(){return{...lt,keybindings:Le()}}function dt(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function ft(...e){let t={};for(let n of e)for(let[e,r]of Object.entries(n)){let n=t[e];t[e]=dt(n)&&dt(r)?ft(n,r):r}return t}function pt(...e){return ft(ut(),...e.filter(e=>e!=null))}function mt({status:e=`idle`,theme:t}){let[n,r]=W(!1),[i,a]=W(0),{prefix:o,spinner:s}=pt(t);return nt(()=>{if(e===`loading`){let e,t=-1,n=setTimeout(()=>{r(!0),e=setInterval(()=>{t+=1,a(t%s.frames.length)},s.interval)},300);return()=>{clearTimeout(n),clearInterval(e)}}else r(!1)},[e]),n?s.frames[i]:typeof o==`string`?o:o[e===`loading`?`idle`:e]??o.idle}function ht(e,t){return $e(n=>{let r=n.get();if(!r||r.dependencies.length!==t.length||r.dependencies.some((e,n)=>e!==t[n])){let r=e();return n.set({value:r,dependencies:t}),r}return r.value})}function gt(e){return W({current:e})[0]}function _t(e){let t=gt(e);t.current=e,nt(e=>{let n=!1,r=Qe((r,i)=>{n||t.current(i,e)});return e.input.on(`keypress`,r),()=>{n=!0,e.input.removeListener(`keypress`,r)}},[])}var vt=t(n(((t,n)=>{n.exports=i;function r(t){let n={defaultWidth:0,output:process.stdout,tty:e(`tty`)};return t?(Object.keys(n).forEach(function(e){t[e]||(t[e]=n[e])}),t):n}function i(e){let t=r(e);if(t.output.getWindowSize)return t.output.getWindowSize()[0]||t.defaultWidth;if(t.tty.getWindowSize)return t.tty.getWindowSize()[1]||t.defaultWidth;if(t.output.columns)return t.output.columns;if(process.env.CLI_WIDTH){let e=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(e)&&e!==0)return e}return t.defaultWidth}}))(),1);const yt=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let n=0;for(e.lastIndex=0;e.test(t);)n+=1;return t.length-n}})(),bt=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,xt=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141,St=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,Ct=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,wt=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy,Tt=/\t{1,1000}/y,Et=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy,Dt=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Ot=/\p{M}+/gu,kt={limit:1/0,ellipsis:``},At=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?At(i,kt,n).width:0),o=n.controlWidth??0,s=n.tabWidth??8,c=n.emojiWidth??2,l=n.regularWidth??1,u=n.wideWidth??2,d=[[Dt,l],[St,0],[Ct,o],[Tt,s],[Et,c],[wt,u]],f=0,p=0,m=e.length,h=0,g=!1,_=m,v=Math.max(0,r-a),y=0,b=0,x=0,S=0;outer:for(;;){if(b>y||p>=m&&p>f){let t=e.slice(y,b)||e.slice(f,p);h=0;for(let e of t.replaceAll(Ot,``)){let t=e.codePointAt(0)||0;if(S=bt(t)?2:xt(t)?u:l,x+S>v&&(_=Math.min(_,Math.max(y,f)+h)),x+S>r){g=!0;break outer}h+=e.length,x+=S}y=b=0}if(p>=m)break outer;for(let t=0,n=d.length;t<n;t++){let[n,i]=d[t];if(n.lastIndex=p,n.test(e)){if(h=n===wt?yt(e.slice(p,n.lastIndex)):n===Et?1:n.lastIndex-p,S=h*i,x+S>v&&(_=Math.min(_,p+Math.floor((v-x)/i))),x+S>r){g=!0;break outer}x+=S,y=f,b=p,p=f=n.lastIndex;continue outer}}p+=1}return{width:g?v:x,index:g?_:m,truncated:g,ellipsed:g&&r>=a}},jt={limit:1/0,ellipsis:``,ellipsisWidth:0},K=(e,t={})=>At(e,jt,t).width,Mt=`]8;;`,Nt=RegExp(`(?:\\[(?<code>\\d+)m|\\${Mt}(?<uri>.*))`,`y`),Pt=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},Ft=e=>`[${e}m`,It=e=>`${Mt}${e}`,Lt=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:K(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=K(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===`›`)&&(i=!0,a=t.startsWith(Mt,u+1)),i?a?o===`\x07`&&(i=!1,a=!1):o===`m`&&(i=!1):(s+=d,s===n&&!l.done&&(e.push(``),s=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!s&&o!==void 0&&o.length&&e.length>1&&(e[e.length-2]+=e.pop())},Rt=e=>{let t=e.split(` `),n=t.length;for(;n&&!K(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},zt=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=[``],c=0;for(let e=0;e<o.length;e++){let r=o[e];if(n.trim!==!1){let e=s.at(-1)??``,t=e.trimStart();e.length!==t.length&&(s[s.length-1]=t,c=K(t))}e!==0&&(c>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),c=0),(c||n.trim===!1)&&(s[s.length-1]+=` `,c++));let i=K(r);if(n.hard&&i>t){let e=t-c,n=1+Math.floor((i-e-1)/t);Math.floor((i-1)/t)<n&&s.push(``),Lt(s,r,t),c=K(s.at(-1)??``);continue}if(c+i>t&&c&&i){if(n.wordWrap===!1&&c<t){Lt(s,r,t),c=K(s.at(-1)??``);continue}s.push(``),c=0}if(c+i>t&&n.wordWrap===!1){Lt(s,r,t),c=K(s.at(-1)??``);continue}s[s.length-1]+=r,c+=i}n.trim!==!1&&(s=s.map(e=>Rt(e)));let l=s.join(`
1
+ import{i as e,o as t,t as n}from"./chunk-DTipWd-i.mjs";import{O as r,Pa as i,_a as a,j as o}from"./src-FuRMJntf.mjs";import{$n as s,$t as c,Hn as l,Mn as u,Nr as d,Tn as f,Vn as p,c as m,en as h,er as g,fn as _,in as v,l as y,nn as b,pa as x,pn as S,rr as C,tr as ee,u as te}from"./src-DBW4MhVj.mjs";import{U as ne}from"./sleep-DcENuR74.mjs";import{M as w,P as T}from"./fs-traced-B-qtPUmb.mjs";import{C as re,a as ie,b as ae,d as E,f as oe,i as se,l as D,m as ce,p as le,s as ue,t as de,x as fe}from"./write-project-skill-BD-Ei4Cn.mjs";import{t as pe}from"./constants-C84FnhVs.mjs";import{t as O}from"./is-object-Bw0-z8qH.mjs";import{i as k,n as me,o as A,r as he,s as j,t as M}from"./colors-_gzKDfrv.mjs";import{t as ge}from"./preview-DnuyHBMZ.mjs";import{createRequire as _e}from"node:module";import{execFileSync as ve}from"node:child_process";import N,{dirname as P,isAbsolute as ye,join as F,relative as I,resolve as be,sep as xe}from"node:path";import{existsSync as L,lstatSync as Se,mkdirSync as Ce,readFileSync as R,readlinkSync as we,realpathSync as Te,statSync as Ee,writeFileSync as De}from"node:fs";import{homedir as Oe}from"node:os";import z from"node:process";import{fileURLToPath as ke}from"node:url";import*as Ae from"node:readline";import{inspect as je,stripVTControlCharacters as Me,styleText as B}from"node:util";import{AsyncLocalStorage as Ne,AsyncResource as Pe}from"node:async_hooks";const Fe=new Set([`emacs`,`vim`]);function Ie(e){return Fe.has(e)}function Le(){let e=process.env.INQUIRER_KEYBINDINGS;return e?Array.from(new Set(e.toLowerCase().split(/[\s,]+/).filter(Ie))):[]}const V=(e,t=[])=>e.name===`up`||t.includes(`vim`)&&e.name===`k`||t.includes(`emacs`)&&e.ctrl&&e.name===`p`,Re=(e,t=[])=>e.name===`down`||t.includes(`vim`)&&e.name===`j`||t.includes(`emacs`)&&e.ctrl&&e.name===`n`,ze=e=>e.name===`space`,Be=e=>e.name===`backspace`,Ve=e=>`1234567890`.includes(e.name),He=e=>e.name===`enter`||e.name===`return`;var Ue=class extends Error{name=`AbortPromptError`;message=`Prompt was aborted`;constructor(e){super(),this.cause=e?.cause}},We=class extends Error{name=`CancelPromptError`;message=`Prompt was canceled`},Ge=class extends Error{name=`ExitPromptError`},Ke=class extends Error{name=`HookError`},qe=class extends Error{name=`ValidationError`};const Je=new Ne;function Ye(e){return{rl:e,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function Xe(e,t){let n=Ye(e);return Je.run(n,()=>{function e(e){n.handleChange=()=>{n.index=0,e()},n.handleChange()}return t(e)})}function H(){let e=Je.getStore();if(!e)throw new Ke(`[Inquirer] Hook functions can only be called from within a prompt`);return e}function Ze(){return H().rl}function Qe(e){return Pe.bind((...t)=>{let n=H(),r=!1,i=n.handleChange;n.handleChange=()=>{r=!0};let a=e(...t);return r&&i(),n.handleChange=i,a})}function $e(e){let t=H(),{index:n}=t,r=e({get(){return t.hooks[n]},set(e){t.hooks[n]=e},initialized:n in t.hooks});return t.index++,r}function et(){H().handleChange()}const U={queue(e){let t=H(),{index:n}=t;t.hooksEffect.push(()=>{t.hooksCleanup[n]?.();let r=e(Ze());if(r!=null&&typeof r!=`function`)throw new qe(`useEffect return value must be a cleanup function or nothing.`);t.hooksCleanup[n]=r})},run(){let e=H();Qe(()=>{e.hooksEffect.forEach(e=>{e()}),e.hooksEffect.length=0})()},clearAll(){let e=H();e.hooksCleanup.forEach(e=>{e?.()}),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function tt(e){return typeof e==`function`}function W(e){return $e(t=>{let n=Pe.bind(function(e){t.get()!==e&&(t.set(e),et())});if(t.initialized)return[t.get(),n];let r=tt(e)?e():e;return t.set(r),[r,n]})}function nt(e,t){$e(n=>{let r=n.get();(!Array.isArray(r)||t.some((e,t)=>!Object.is(e,r[t])))&&U.queue(e),n.set(t)})}function rt(){return z.platform.startsWith(`win`)?!!z.env.CI||!!z.env.WT_SESSION||!!z.env.TERMINUS_SUBLIME||z.env.ConEmuTask===`{cmd::Cmder}`||z.env.TERM_PROGRAM===`Terminus-Sublime`||z.env.TERM_PROGRAM===`vscode`||z.env.TERM===`xterm-256color`||z.env.TERM===`alacritty`||z.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:z.env.TERM!==`linux`}const it={circleQuestionMark:`(?)`,questionMarkPrefix:`(?)`,square:`█`,squareDarkShade:`▓`,squareMediumShade:`▒`,squareLightShade:`░`,squareTop:`▀`,squareBottom:`▄`,squareLeft:`▌`,squareRight:`▐`,squareCenter:`■`,bullet:`●`,dot:`․`,ellipsis:`…`,pointerSmall:`›`,triangleUp:`▲`,triangleUpSmall:`▴`,triangleDown:`▼`,triangleDownSmall:`▾`,triangleLeftSmall:`◂`,triangleRightSmall:`▸`,home:`⌂`,heart:`♥`,musicNote:`♪`,musicNoteBeamed:`♫`,arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,arrowLeftRight:`↔`,arrowUpDown:`↕`,almostEqual:`≈`,notEqual:`≠`,lessOrEqual:`≤`,greaterOrEqual:`≥`,identical:`≡`,infinity:`∞`,subscriptZero:`₀`,subscriptOne:`₁`,subscriptTwo:`₂`,subscriptThree:`₃`,subscriptFour:`₄`,subscriptFive:`₅`,subscriptSix:`₆`,subscriptSeven:`₇`,subscriptEight:`₈`,subscriptNine:`₉`,oneHalf:`½`,oneThird:`⅓`,oneQuarter:`¼`,oneFifth:`⅕`,oneSixth:`⅙`,oneEighth:`⅛`,twoThirds:`⅔`,twoFifths:`⅖`,threeQuarters:`¾`,threeFifths:`⅗`,threeEighths:`⅜`,fourFifths:`⅘`,fiveSixths:`⅚`,fiveEighths:`⅝`,sevenEighths:`⅞`,line:`─`,lineBold:`━`,lineDouble:`═`,lineDashed0:`┄`,lineDashed1:`┅`,lineDashed2:`┈`,lineDashed3:`┉`,lineDashed4:`╌`,lineDashed5:`╍`,lineDashed6:`╴`,lineDashed7:`╶`,lineDashed8:`╸`,lineDashed9:`╺`,lineDashed10:`╼`,lineDashed11:`╾`,lineDashed12:`−`,lineDashed13:`–`,lineDashed14:`‐`,lineDashed15:`⁃`,lineVertical:`│`,lineVerticalBold:`┃`,lineVerticalDouble:`║`,lineVerticalDashed0:`┆`,lineVerticalDashed1:`┇`,lineVerticalDashed2:`┊`,lineVerticalDashed3:`┋`,lineVerticalDashed4:`╎`,lineVerticalDashed5:`╏`,lineVerticalDashed6:`╵`,lineVerticalDashed7:`╷`,lineVerticalDashed8:`╹`,lineVerticalDashed9:`╻`,lineVerticalDashed10:`╽`,lineVerticalDashed11:`╿`,lineDownLeft:`┐`,lineDownLeftArc:`╮`,lineDownBoldLeftBold:`┓`,lineDownBoldLeft:`┒`,lineDownLeftBold:`┑`,lineDownDoubleLeftDouble:`╗`,lineDownDoubleLeft:`╖`,lineDownLeftDouble:`╕`,lineDownRight:`┌`,lineDownRightArc:`╭`,lineDownBoldRightBold:`┏`,lineDownBoldRight:`┎`,lineDownRightBold:`┍`,lineDownDoubleRightDouble:`╔`,lineDownDoubleRight:`╓`,lineDownRightDouble:`╒`,lineUpLeft:`┘`,lineUpLeftArc:`╯`,lineUpBoldLeftBold:`┛`,lineUpBoldLeft:`┚`,lineUpLeftBold:`┙`,lineUpDoubleLeftDouble:`╝`,lineUpDoubleLeft:`╜`,lineUpLeftDouble:`╛`,lineUpRight:`└`,lineUpRightArc:`╰`,lineUpBoldRightBold:`┗`,lineUpBoldRight:`┖`,lineUpRightBold:`┕`,lineUpDoubleRightDouble:`╚`,lineUpDoubleRight:`╙`,lineUpRightDouble:`╘`,lineUpDownLeft:`┤`,lineUpBoldDownBoldLeftBold:`┫`,lineUpBoldDownBoldLeft:`┨`,lineUpDownLeftBold:`┥`,lineUpBoldDownLeftBold:`┩`,lineUpDownBoldLeftBold:`┪`,lineUpDownBoldLeft:`┧`,lineUpBoldDownLeft:`┦`,lineUpDoubleDownDoubleLeftDouble:`╣`,lineUpDoubleDownDoubleLeft:`╢`,lineUpDownLeftDouble:`╡`,lineUpDownRight:`├`,lineUpBoldDownBoldRightBold:`┣`,lineUpBoldDownBoldRight:`┠`,lineUpDownRightBold:`┝`,lineUpBoldDownRightBold:`┡`,lineUpDownBoldRightBold:`┢`,lineUpDownBoldRight:`┟`,lineUpBoldDownRight:`┞`,lineUpDoubleDownDoubleRightDouble:`╠`,lineUpDoubleDownDoubleRight:`╟`,lineUpDownRightDouble:`╞`,lineDownLeftRight:`┬`,lineDownBoldLeftBoldRightBold:`┳`,lineDownLeftBoldRightBold:`┯`,lineDownBoldLeftRight:`┰`,lineDownBoldLeftBoldRight:`┱`,lineDownBoldLeftRightBold:`┲`,lineDownLeftRightBold:`┮`,lineDownLeftBoldRight:`┭`,lineDownDoubleLeftDoubleRightDouble:`╦`,lineDownDoubleLeftRight:`╥`,lineDownLeftDoubleRightDouble:`╤`,lineUpLeftRight:`┴`,lineUpBoldLeftBoldRightBold:`┻`,lineUpLeftBoldRightBold:`┷`,lineUpBoldLeftRight:`┸`,lineUpBoldLeftBoldRight:`┹`,lineUpBoldLeftRightBold:`┺`,lineUpLeftRightBold:`┶`,lineUpLeftBoldRight:`┵`,lineUpDoubleLeftDoubleRightDouble:`╩`,lineUpDoubleLeftRight:`╨`,lineUpLeftDoubleRightDouble:`╧`,lineUpDownLeftRight:`┼`,lineUpBoldDownBoldLeftBoldRightBold:`╋`,lineUpDownBoldLeftBoldRightBold:`╈`,lineUpBoldDownLeftBoldRightBold:`╇`,lineUpBoldDownBoldLeftRightBold:`╊`,lineUpBoldDownBoldLeftBoldRight:`╉`,lineUpBoldDownLeftRight:`╀`,lineUpDownBoldLeftRight:`╁`,lineUpDownLeftBoldRight:`┽`,lineUpDownLeftRightBold:`┾`,lineUpBoldDownBoldLeftRight:`╂`,lineUpDownLeftBoldRightBold:`┿`,lineUpBoldDownLeftBoldRight:`╃`,lineUpBoldDownLeftRightBold:`╄`,lineUpDownBoldLeftBoldRight:`╅`,lineUpDownBoldLeftRightBold:`╆`,lineUpDoubleDownDoubleLeftDoubleRightDouble:`╬`,lineUpDoubleDownDoubleLeftRight:`╫`,lineUpDownLeftDoubleRightDouble:`╪`,lineCross:`╳`,lineBackslash:`╲`,lineSlash:`╱`},at={tick:`✔`,info:`ℹ`,warning:`⚠`,cross:`✘`,squareSmall:`◻`,squareSmallFilled:`◼`,circle:`◯`,circleFilled:`◉`,circleDotted:`◌`,circleDouble:`◎`,circleCircle:`ⓞ`,circleCross:`ⓧ`,circlePipe:`Ⓘ`,radioOn:`◉`,radioOff:`◯`,checkboxOn:`☒`,checkboxOff:`☐`,checkboxCircleOn:`ⓧ`,checkboxCircleOff:`Ⓘ`,pointer:`❯`,triangleUpOutline:`△`,triangleLeft:`◀`,triangleRight:`▶`,lozenge:`◆`,lozengeOutline:`◇`,hamburger:`☰`,smiley:`㋡`,mustache:`෴`,star:`★`,play:`▶`,nodejs:`⬢`,oneSeventh:`⅐`,oneNinth:`⅑`,oneTenth:`⅒`},ot={tick:`√`,info:`i`,warning:`‼`,cross:`×`,squareSmall:`□`,squareSmallFilled:`■`,circle:`( )`,circleFilled:`(*)`,circleDotted:`( )`,circleDouble:`( )`,circleCircle:`(○)`,circleCross:`(×)`,circlePipe:`(│)`,radioOn:`(*)`,radioOff:`( )`,checkboxOn:`[×]`,checkboxOff:`[ ]`,checkboxCircleOn:`(×)`,checkboxCircleOff:`( )`,pointer:`>`,triangleUpOutline:`∆`,triangleLeft:`◄`,triangleRight:`►`,lozenge:`♦`,lozengeOutline:`◊`,hamburger:`≡`,smiley:`☺`,mustache:`┌─┐`,star:`✶`,play:`►`,nodejs:`♦`,oneSeventh:`1/7`,oneNinth:`1/9`,oneTenth:`1/10`},st={...it,...at},ct={...it,...ot},G=rt()?st:ct;Object.entries(at);const lt={prefix:{idle:B(`blue`,`?`),done:B(`green`,G.tick)},spinner:{interval:80,frames:[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`].map(e=>B(`yellow`,e))},keybindings:[],style:{answer:e=>B(`cyan`,e),message:e=>B(`bold`,e),error:e=>B(`red`,`> ${e}`),defaultAnswer:e=>B(`dim`,`(${e})`),help:e=>B(`dim`,e),highlight:e=>B(`cyan`,e),key:e=>B(`cyan`,B(`bold`,`<${e}>`))}};function ut(){return{...lt,keybindings:Le()}}function dt(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function ft(...e){let t={};for(let n of e)for(let[e,r]of Object.entries(n)){let n=t[e];t[e]=dt(n)&&dt(r)?ft(n,r):r}return t}function pt(...e){return ft(ut(),...e.filter(e=>e!=null))}function mt({status:e=`idle`,theme:t}){let[n,r]=W(!1),[i,a]=W(0),{prefix:o,spinner:s}=pt(t);return nt(()=>{if(e===`loading`){let e,t=-1,n=setTimeout(()=>{r(!0),e=setInterval(()=>{t+=1,a(t%s.frames.length)},s.interval)},300);return()=>{clearTimeout(n),clearInterval(e)}}else r(!1)},[e]),n?s.frames[i]:typeof o==`string`?o:o[e===`loading`?`idle`:e]??o.idle}function ht(e,t){return $e(n=>{let r=n.get();if(!r||r.dependencies.length!==t.length||r.dependencies.some((e,n)=>e!==t[n])){let r=e();return n.set({value:r,dependencies:t}),r}return r.value})}function gt(e){return W({current:e})[0]}function _t(e){let t=gt(e);t.current=e,nt(e=>{let n=!1,r=Qe((r,i)=>{n||t.current(i,e)});return e.input.on(`keypress`,r),()=>{n=!0,e.input.removeListener(`keypress`,r)}},[])}var vt=t(n(((t,n)=>{n.exports=i;function r(t){let n={defaultWidth:0,output:process.stdout,tty:e(`tty`)};return t?(Object.keys(n).forEach(function(e){t[e]||(t[e]=n[e])}),t):n}function i(e){let t=r(e);if(t.output.getWindowSize)return t.output.getWindowSize()[0]||t.defaultWidth;if(t.tty.getWindowSize)return t.tty.getWindowSize()[1]||t.defaultWidth;if(t.output.columns)return t.output.columns;if(process.env.CLI_WIDTH){let e=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(e)&&e!==0)return e}return t.defaultWidth}}))(),1);const yt=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let n=0;for(e.lastIndex=0;e.test(t);)n+=1;return t.length-n}})(),bt=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,xt=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141,St=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,Ct=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,wt=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy,Tt=/\t{1,1000}/y,Et=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy,Dt=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Ot=/\p{M}+/gu,kt={limit:1/0,ellipsis:``},At=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?At(i,kt,n).width:0),o=n.controlWidth??0,s=n.tabWidth??8,c=n.emojiWidth??2,l=n.regularWidth??1,u=n.wideWidth??2,d=[[Dt,l],[St,0],[Ct,o],[Tt,s],[Et,c],[wt,u]],f=0,p=0,m=e.length,h=0,g=!1,_=m,v=Math.max(0,r-a),y=0,b=0,x=0,S=0;outer:for(;;){if(b>y||p>=m&&p>f){let t=e.slice(y,b)||e.slice(f,p);h=0;for(let e of t.replaceAll(Ot,``)){let t=e.codePointAt(0)||0;if(S=bt(t)?2:xt(t)?u:l,x+S>v&&(_=Math.min(_,Math.max(y,f)+h)),x+S>r){g=!0;break outer}h+=e.length,x+=S}y=b=0}if(p>=m)break outer;for(let t=0,n=d.length;t<n;t++){let[n,i]=d[t];if(n.lastIndex=p,n.test(e)){if(h=n===wt?yt(e.slice(p,n.lastIndex)):n===Et?1:n.lastIndex-p,S=h*i,x+S>v&&(_=Math.min(_,p+Math.floor((v-x)/i))),x+S>r){g=!0;break outer}x+=S,y=f,b=p,p=f=n.lastIndex;continue outer}}p+=1}return{width:g?v:x,index:g?_:m,truncated:g,ellipsed:g&&r>=a}},jt={limit:1/0,ellipsis:``,ellipsisWidth:0},K=(e,t={})=>At(e,jt,t).width,Mt=`]8;;`,Nt=RegExp(`(?:\\[(?<code>\\d+)m|\\${Mt}(?<uri>.*))`,`y`),Pt=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},Ft=e=>`[${e}m`,It=e=>`${Mt}${e}`,Lt=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:K(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=K(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===`›`)&&(i=!0,a=t.startsWith(Mt,u+1)),i?a?o===`\x07`&&(i=!1,a=!1):o===`m`&&(i=!1):(s+=d,s===n&&!l.done&&(e.push(``),s=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!s&&o!==void 0&&o.length&&e.length>1&&(e[e.length-2]+=e.pop())},Rt=e=>{let t=e.split(` `),n=t.length;for(;n&&!K(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},zt=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=[``],c=0;for(let e=0;e<o.length;e++){let r=o[e];if(n.trim!==!1){let e=s.at(-1)??``,t=e.trimStart();e.length!==t.length&&(s[s.length-1]=t,c=K(t))}e!==0&&(c>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),c=0),(c||n.trim===!1)&&(s[s.length-1]+=` `,c++));let i=K(r);if(n.hard&&i>t){let e=t-c,n=1+Math.floor((i-e-1)/t);Math.floor((i-1)/t)<n&&s.push(``),Lt(s,r,t),c=K(s.at(-1)??``);continue}if(c+i>t&&c&&i){if(n.wordWrap===!1&&c<t){Lt(s,r,t),c=K(s.at(-1)??``);continue}s.push(``),c=0}if(c+i>t&&n.wordWrap===!1){Lt(s,r,t),c=K(s.at(-1)??``);continue}s[s.length-1]+=r,c+=i}n.trim!==!1&&(s=s.map(e=>Rt(e)));let l=s.join(`
2
2
  `),u=!1;for(let e=0;e<l.length;e++){let t=l[e];if(r+=t,u)u=!1;else if(u=t>=`\ud800`&&t<=`\udbff`,u)continue;if(t===`\x1B`||t===`›`){Nt.lastIndex=e+1;let t=Nt.exec(l)?.groups;if(t?.code!==void 0){let e=Number.parseFloat(t.code);i=e===39?void 0:e}else t?.uri!==void 0&&(a=t.uri.length===0?void 0:t.uri)}if(l[e+1]===`
3
3
  `){a&&(r+=It(``));let e=i?Pt(i):void 0;i&&e&&(r+=Ft(e))}else t===`
4
4
  `&&(i&&Pt(i)&&(r+=Ft(i)),a&&(r+=It(a)))}return r},Bt=/\r?\n/;function Vt(e,t,n){return String(e).normalize().split(Bt).map(e=>zt(e,t,n)).join(`
@@ -638,6 +638,6 @@ export default function okBridge(pi: {
638
638
  `));let f=`${a?``:``}${u}`;return f!==i&&T(e,f,{mode:Bn(e)}),{kind:l?`overwritten`:`written`}}const _i=e=>e!==`project`,vi=e=>e!==`user`;async function yi(){let e=await Yn({message:`Where should the MCP server be configured?
639
639
  `,required:!1,theme:{icon:{checked:`[x]`,unchecked:`[ ]`}},choices:[{name:`User-level (~/.claude.json, ~/.cursor/mcp.json, …)`,value:`user`,checked:!0},{name:`Project-level (.mcp.json, .cursor/mcp.json, …)`,value:`project`,checked:!0}]});return e.includes(`user`)&&e.includes(`project`)?`both`:e.includes(`user`)?`user`:e.includes(`project`)?`project`:null}async function bi(e){return e.mcp===!1?null:e.scope?e.scope:e.isTTY??process.stdout.isTTY?(e.promptFn??yi)():`both`}async function xi(e){return er({message:`How do you want to handle OpenKnowledge config files (.ok/, .mcp.json, project skills)?`,default:e,choices:[{name:`Share with my team (commit alongside content)`,value:`shared`,description:`OK config gets committed alongside your project content.`},{name:`Local only (keep out of git via .git/info/exclude)`,value:`local-only`,description:"OK config stays on this machine only; teammates do not see it. Safe escape hatch via `ok config-sharing share`."}]})}async function Si(e){if(e.sharing!==void 0)return e.sharing;let t=Dn(e.projectRoot)===`local-only`?`local-only`:`shared`;return e.isTTY??process.stdout.isTTY?(e.promptFn??xi)(t):t}var $=class extends Error{constructor(e){super(e),this.name=`ContentDirError`}};function Ci(e){if(e===void 0||e===!0)return new Set(l);if(e===!1)return new Set;let t=e.split(`,`).map(e=>e.trim()).filter(Boolean);return new Set(l.filter(e=>t.includes(e)))}function wi(e,t,n){let r=be(n,e),i;try{i=Ee(r)}catch(e){let t=e.code;throw t===`ENOENT`?new $(`--content-dir path does not exist: ${r}`):new $(`--content-dir path is not accessible (${t??`unknown error`}): ${r}`)}if(!i.isDirectory())throw new $(`--content-dir must be a directory: ${r}`);let a=I(Ti(t),Ti(r));if(a.startsWith(`..`)||ye(a))throw new $(`--content-dir must be inside the project root (${t}); got ${r}`);return a===``?`.`:a}function Ti(e){try{return Te(e)}catch{return e}}const Ei=`open-knowledge-ui`;function Di(e,t,n){try{return L(e.detectPath?.(t,n)??P(e.configPath(t,n)))}catch{return!1}}function Oi(e,t,n,r,i){let a=e.serverName(t),o;try{o=i??e.configPath(t,r)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:``,serverName:a,error:t instanceof Error?t.message:String(t)}}let s=!n.skipAvailabilityCheck||e.offerOnlyWhenDetected===!0;if(!i&&s&&!Di(e,t,r))return{editorId:e.id,label:e.label,action:`skipped-missing`,configPath:o,serverName:a};if(i!==void 0)try{de(o,t)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t),configScope:`project`}}if(e.format===`file`)return Ai(e,o,a,n,{isProjectScope:i!==void 0});let c;try{c=e.buildEntry(t,n)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t),...i===void 0?{}:{configScope:`project`}}}try{Ce(P(o),{recursive:!0})}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t),...i===void 0?{}:{configScope:`project`}}}let l={action:`written`},u;try{w(`${o}.lock`,()=>{let t=Kr(o).writePath;if(Ce(P(t),{recursive:!0}),e.format===`toml`){let n=hi(ei(),t,e.topLevelKey,a,c);l.action=n.kind,n.kind===`declined`&&(l.declineReason=n.reason);return}if(e.format===`yaml`){let n=gi(t,e.topLevelKey,a,c);l.action=n.kind,n.kind===`declined`&&(l.declineReason=n.reason);return}let n=mi(t,e.topLevelKey,a,c,e.serverMapSubKey);l.action=n.kind,n.kind===`declined`&&(l.declineReason=n.reason)},{onWarn:(e,t)=>process.stderr.write(`[ok] ${e} ${JSON.stringify(t)}\n`)})}catch(e){u=e instanceof Error?e:Error(String(e))}return u?{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:u.message,...i===void 0?{}:{configScope:`project`}}:l.action===`declined`?{editorId:e.id,label:e.label,action:`declined`,configPath:o,serverName:a,declineReason:l.declineReason,...i===void 0?{}:{configScope:`project`}}:{editorId:e.id,label:e.label,action:l.action,configPath:o,serverName:a,...i===void 0?{}:{configScope:`project`}}}const ki={pi:Fr};function Ai(e,t,n,r,i){let a=i.isProjectScope?{configScope:`project`}:{},o=r=>({editorId:e.id,label:e.label,action:`failed`,configPath:t,serverName:n,error:r instanceof Error?r.message:String(r),...a}),s=ki[e.id];if(!s)return o(Error(`No managed-file builder registered for editor "${e.id}" (format: 'file' targets need a MANAGED_FILE_BUILDERS entry).`));let c;try{c=s(r)}catch(e){return o(e)}try{Ce(P(t),{recursive:!0})}catch(e){return o(e)}let l={action:`written`};try{w(`${t}.lock`,()=>{let e=null;try{e=R(t,`utf-8`)}catch{e=null}if(e===c){l.action=`overwritten`;return}T(t,c,e===null?void 0:{mode:Bn(t)}),l.action=e===null?`written`:`overwritten`},{onWarn:(e,t)=>process.stderr.write(`[ok] ${e} ${JSON.stringify(t)}\n`)})}catch(e){return o(e)}return{editorId:e.id,label:e.label,action:l.action,configPath:t,serverName:n,...a}}function ji(e,t){let n=e.projectConfigPath?.(t);if(!(!n||!L(n)))return{editorId:e.id,label:e.label,path:n}}async function Mi(e){let t=ae(e.editors).filter(e=>e.scope===`global`),n={mode:`published`,skipAvailabilityCheck:!0};return t.map(t=>Oi(t,``,n,e.home))}function Ni(e,t,n,r){let i=Fi(e,t,n,r);return i.kind===`present`?i.entry:null}function Pi(e,t,n,r){let i=pi(e,t,r);if(!O(i))return{kind:`no-entry`};let a=i[n];return O(a)?{kind:`present`,entry:a}:{kind:`no-entry`}}function Fi(e,t,n,r){let i;try{i=r??e.configPath(t,n)}catch{return{kind:`absent`}}if(!L(i))return{kind:`absent`};try{if(Ee(i).size>ci)return{kind:`decline`,reason:`oversize`}}catch{return{kind:`decline`,reason:`unparseable`}}let a;try{a=R(i,`utf-8`)}catch{return{kind:`decline`,reason:`unparseable`}}if(a.trim()===``)return{kind:`absent`};if(e.format===`file`)return{kind:`present`,entry:Pr(a)};let o=e.serverName(t);if(e.format===`toml`){let t;try{t=ei().parseToObject(a)}catch{return{kind:`decline`,reason:`unparseable`}}return Pi(t,e.topLevelKey,o,e.serverMapSubKey)}if(e.format===`yaml`){let t=(0,bn.parseDocument)(a.charCodeAt(0)===65279?a.slice(1):a);return t.errors.length>0?{kind:`decline`,reason:`unparseable`}:Pi(t.toJS()??{},e.topLevelKey,o,e.serverMapSubKey)}let s=ri(a);return s?ii(s,e.topLevelKey)>1?{kind:`decline`,reason:`duplicate-container`}:Pi(g(s),e.topLevelKey,o,e.serverMapSubKey):{kind:`decline`,reason:`unparseable`}}async function Ii(e={}){let t=be(e.cwd??process.cwd()),n=Rr(t,{homeDir:e.home}),r=n.projectRoot,i=!L(F(r,`.ok`)),a=n.gitRootPromoted?I(r,t):void 0,o=e.contentDir===void 0?n.defaultContentDir:wi(e.contentDir,r,t);n.ancestorPromoted?console.log(`[ok] Opened existing project at ${r}`):n.gitRootPromoted&&i&&o===`.`&&process.stderr.write(`${j(`[ok] Content scope promoted to the git repo root: ${r}`)}\n Ran in ${a}/, but .ok/ lives at the git root (one .ok/ per git repo),\n so the whole repo is now the content scope. To narrow it, re-run with\n \`ok init --content-dir .\`, or set content.dir: ${a} in .ok/config.yml.\n`);let s={mode:e.devMcp?`dev`:`published`},d=await te(r),g;try{g=h(r,{contentDir:o})}catch(t){let i=D.claude.configPath(r,e.home);return{projectRoot:r,contentCreated:[],contentUpdated:[],contentSkipped:[],editors:[],projectSkills:[],legacyProjectConfigs:[],didGitInit:d.didInit,rootGitignoreCreated:!1,gitRootPromoted:n.gitRootPromoted,promotedFromDir:a,contentDirRequested:e.contentDir,contentScaffoldFailed:!0,mcpAction:`failed`,mcpPath:i,mcpError:`Content scaffolding failed: ${t instanceof Error?t.message:String(t)}`,sharing:{kind:`no-exclude`,reason:`no-git`,localOnlyRequested:!1}}}let _=g.created.includes(pe),v=!1;if(d.didInit)try{v=b(r)===`created`}catch(e){console.warn(`[ok] Skipping .gitignore seed at ${r}: ${e instanceof Error?e.message:String(e)}`)}try{c(r)}catch(e){console.warn(`[ok] Skipping project-skill .gitignore entry at ${r}: ${e instanceof Error?e.message:String(e)}`)}let y=await m(r);y.kind===`untracked`&&console.warn(`[ok] Untracked the OpenKnowledge project skill (${y.dirs.join(`, `)}) — it is now local-only. Teammates will see this as a deletion on their next pull.`);let x=await bi({scope:e.scope,mcp:e.mcp,isTTY:e.isTTY,promptFn:e.promptFn}),S=e.editors??Hi(r,e.home),C=e.editors??ue.filter(e=>D[e].projectConfigPath!==void 0||D[e].projectSkillPath!==void 0),ee=ae(S),ne=ae(C),w=e.mcp===!1||x===null,T=Array.from(new Map([...ee,...w?[]:ne].map(e=>[e.id,e])).values()),re=ee.filter(t=>Di(t,r,e.home)),E=[],oe=[],ce=new Set;for(let t of T){if(w){let n=``;try{n=t.configPath(r,e.home)}catch{}E.push({editorId:t.id,label:t.label,action:`skipped-flag`,configPath:n,serverName:t.serverName(r)});continue}if(_i(x)&&ee.includes(t)&&t.scope===`global`&&E.push(Oi(t,r,s,e.home)),vi(x)&&ne.includes(t)&&t.projectConfigPath){let n=t.projectConfigPath(r),i=Oi(t,r,s,e.home,n);E.push(i),(i.action===`written`||i.action===`overwritten`)&&ce.add(n)}}let le=new Set;for(let t of ne){let n=t.projectSkillPath?.(r);!n||le.has(n)||(le.add(n),oe.push(se(t,r,{home:e.home})))}let de=!w&&x!==null&&vi(x)?ne.filter(e=>!e.projectConfigPath&&!e.projectSkillPath).map(e=>e.label):void 0,fe=w?[]:re.map(e=>ji(e,r)).filter(e=>e!==void 0).filter(e=>!ce.has(e.path)),O=e.installUserSkill??f,k=e.home??Oe(),me=Ci(e.skills),A=!1,he=!1,M=!1,ge=!1;for(let t of l){let n=me.has(t);if(await u(k,p[t],n).catch(()=>{}),n){A=!0;let n=await O({home:e.home,bundleId:t,force:!0});n===`installed`?he=!0:n===`failed`?M=!0:ge=!0}else try{ie(k,t)}catch{}}let _e=M?`failed`:he?`installed`:A&&ge?`skip-current`:`declined`,ve=w?`skipped-flag`:`skipped-missing`,N=E.find(e=>e.editorId===`claude`)??E[0]??{action:ve,configPath:D.claude.configPath(r,e.home)},P=await Li({projectRoot:r,desiredMode:await Si({sharing:e.sharing,projectRoot:r,isTTY:e.isTTY,promptFn:e.sharingPromptFn}),explicitFlag:e.sharing});return{projectRoot:r,contentCreated:g.created,contentUpdated:g.updated,contentSkipped:g.skipped,editors:E,projectSkills:oe,legacyProjectConfigs:fe,skillInstall:_e,didGitInit:d.didInit,rootGitignoreCreated:v,gitRootPromoted:n.gitRootPromoted,promotedFromDir:a,contentDir:_?o:void 0,contentDirRequested:e.contentDir,contentScaffoldFailed:!1,mcpAction:N.action,mcpPath:N.configPath,mcpError:`error`in N?N.error:void 0,projectScopeUnsupportedLabels:de,sharing:P}}async function Li(e){let{projectRoot:t,desiredMode:n,explicitFlag:r}=e,i=Dn(t);if(i===`no-git`)return{kind:`no-exclude`,reason:`no-git`,localOnlyRequested:r===`local-only`};let a=wn(t);if(n===`local-only`){let e=Tn(t,a);if(e.kind===`refused-tracked`){let t=e;return{kind:`refused-tracked`,tracked:t.tracked,remediation:t.remediation}}return e.kind===`no-exclude`?{kind:`no-exclude`,reason:e.reason,localOnlyRequested:r===`local-only`}:Ri(t,e,`add`)}if(i===`shared`)return{kind:`applied`,mode:`shared`,action:`noop`,appended:[],alreadyPresent:[],removed:[]};let o=En(t,a);return o.kind===`no-exclude`?{kind:`no-exclude`,reason:o.reason,localOnlyRequested:!1}:Ri(t,o,`remove`)}function Ri(e,t,n){let r=Dn(e);return n===`add`?{kind:`applied`,mode:r,action:t.appended.length>0?`added`:`noop`,appended:t.appended,alreadyPresent:t.alreadyPresent,removed:[]}:{kind:`applied`,mode:r,action:`removed`,appended:[],alreadyPresent:[],removed:t.removed}}function zi(e){switch(e){case`oversize`:return`config too large to edit safely`;case`duplicate-container`:return`duplicate server block`;case`no-native-writer`:return`no format-preserving writer available`;default:return`config not readable`}}function Bi(e,t){let n=[],r=e.editors.some(e=>e.action===`written`||e.action===`overwritten`),i=e.editors.some(e=>e.action===`failed`)||e.projectSkills.some(e=>e.action===`failed`),a=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-flag`),o=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-missing`);e.didGitInit&&n.push(`Initialized git repo at ${t}/.git/ (default branch: main)`),e.rootGitignoreCreated&&n.push(`Seeded .gitignore at ${t}/.gitignore (.DS_Store)`);let s=F(t,`.ok`);if(e.contentCreated.length>0||e.contentUpdated.length>0?(n.push(M(`Content scaffolded at ${s}/`)),e.contentCreated.length>0&&n.push(` Created: ${e.contentCreated.join(`, `)}`),e.contentUpdated.length>0&&n.push(` Updated: ${e.contentUpdated.join(`, `)}`)):n.push(M(`Content already present at ${s}/`)),e.contentSkipped.length>0&&n.push(` Skipped (already exist): ${e.contentSkipped.join(`, `)}`),n.push(``),e.mcpError&&e.editors.length===0)n.push(`Warning: ${e.mcpError}`);else if(e.editors.length===0)if(n.push(M(`MCP server configuration:`)),e.mcpAction===`skipped-flag`)n.push(` MCP config not written — use without --no-mcp to configure editors`);else if(e.projectScopeUnsupportedLabels&&e.projectScopeUnsupportedLabels.length>0){let t=e.projectScopeUnsupportedLabels.join(`, `),r=e.projectScopeUnsupportedLabels.length===1?`does`:`do`;n.push(` ${t} ${r} not support project-level config; skipped`)}else n.push(` No supported editor config directories detected; skipped MCP registration`);else if(a)n.push(`MCP config not written — use without --no-mcp to configure editors`);else if(o)n.push(M(`MCP server configuration:`)),n.push(` No supported editor config directories detected; skipped MCP registration`);else{n.push(M(`MCP server configuration:`));for(let r of e.editors){let e=r.configPath.startsWith(t)?I(t,r.configPath):r.configPath.replace(/^\/Users\/[^/]+/,`~`),i=r.serverName===`open-knowledge`?``:` (${r.serverName})`,a=r.configScope===`project`?` (project)`:``,o=`${r.label}${a}`,s=` `.repeat(Math.max(1,20-o.length)),c=r.editorId===`claude-desktop`&&(r.action===`written`||r.action===`overwritten`)?` — quit and relaunch Claude Desktop to activate`:``;switch(r.action){case`written`:n.push(` ${o}${s}${e} ${A(`registered`)}${i}${c}`);break;case`overwritten`:n.push(` ${o}${s}${e} ${A(`updated`)}${i}${c}`);break;case`skipped-missing`:n.push(` ${o}${s}${e} config root missing; skipped`);break;case`failed`:n.push(` ${o}${s}${e} ${he(`FAILED`)}: ${r.error}`);break;case`declined`:n.push(` ${o}${s}${e} left unchanged (${zi(r.declineReason)})`);break;case`skipped-flag`:break;default:r.action}}if(e.projectScopeUnsupportedLabels&&e.projectScopeUnsupportedLabels.length>0){let t=e.projectScopeUnsupportedLabels.join(`, `),r=e.projectScopeUnsupportedLabels.length===1?`does`:`do`;n.push(` ${t} ${r} not support project-level config; skipped`)}}if(e.projectSkills.length>0){n.push(``),n.push(M(`Project-local skills:`));for(let r of e.projectSkills){let e=`${r.label} (project)`,i=` `.repeat(Math.max(1,20-e.length)),a=r.path?I(t,r.path):``;switch(r.action){case`written`:n.push(` ${e}${i}${a} ${A(`installed`)}`);break;case`overwritten`:n.push(` ${e}${i}${a} ${A(`updated`)}`);break;case`skipped-unsupported`:n.push(` ${e}${i}no known project skill surface; skipped`);break;case`skipped-prerequisite`:n.push(` ${e}${i}OpenKnowledge MCP is not configured; skipped`);break;case`failed`:n.push(` ${e}${i}${a} ${he(`FAILED`)}: ${r.error}`);break}}}if(i&&(n.push(``),n.push(`For failed editors, add the MCP server entry or project skill manually. See:`),n.push(` https://github.com/inkeep/open-knowledge#mcp-setup`)),e.legacyProjectConfigs.length>0){n.push(``),n.push(`Project MCP configs found:`);for(let r of e.legacyProjectConfigs)n.push(` ${r.label} ${I(t,r.path)}`);n.push(` These project-local files may override the global config. Remove them if you want fully user-scoped MCP setup in this project.`)}if(e.skillInstall)switch(n.push(``),n.push(M(`User-global skill:`)),e.skillInstall){case`installed`:n.push(` open-knowledge ${A(`installed to detected agent hosts`)} via \`npx skills\``);break;case`skip-current`:n.push(` open-knowledge ${A(`already installed at current version`)}`);break;case`declined`:n.push(` open-knowledge ${me(`skipped (opted out via --no-skills)`)}`);break;case`failed`:n.push(` ${j(`open-knowledge install failed — MCP still configured; run manually:`)}`),n.push(` ${j(` npx skills@~1.5.0 add <bundled-path> --agent '*' -g -y --copy`)}`);break}if(e.contentDirRequested!==void 0&&e.contentDir===void 0&&!e.contentScaffoldFailed?(n.push(``),n.push(j(`⚠ --content-dir ${e.contentDirRequested} ignored — .ok/config.yml already exists`)),n.push(` Edit .ok/config.yml → content.dir directly to change the content scope.`)):e.contentDir!==void 0&&e.contentDir!==`.`?(n.push(``),n.push(`Content scope set to ${e.contentDir}/ (content.dir in .ok/config.yml).`)):e.gitRootPromoted&&e.contentDir===`.`&&e.contentDirRequested===void 0&&(n.push(``),n.push(j(`⚠ Content scope promoted to the git repo root`)),n.push(` .ok/ was initialized at ${t} because it contains a .git folder (one .ok/ per git repo),`),n.push(` not the sub-folder you ran \`ok init\` in${e.promotedFromDir?` (${e.promotedFromDir})`:``}. The whole repo is now the content scope.`),e.promotedFromDir&&(n.push(" To scope to just that sub-folder, re-run `ok init --content-dir .` from there, or set"),n.push(` content.dir: ${e.promotedFromDir} in .ok/config.yml.`))),e.preview?(n.push(``),n.push(ge(e.preview,t))):e.previewWarning&&(n.push(``),n.push(`Content preview unavailable: ${e.previewWarning}`)),n.push(``),n.push(...Gi(e.sharing,t)),r){let t=new Set,r=e.editors.filter(e=>e.action===`written`||e.action===`overwritten`).filter(e=>!t.has(e.editorId)&&t.add(e.editorId)).map(e=>e.label);n.push(``),n.push(`${A(`✓`)} ${M(`Next steps:`)}`),n.push(` 1. Open your editor (${k(r.join(` / `))})`),n.push(` 2. Approve the MCP server when prompted`),n.push(` 3. (Optional) scaffold the starter knowledge-base structure:`),n.push(` - ${k(`ok seed`)} — empty repo, Karpathy 3-layer`),n.push(` - ${k(`mcp__open-knowledge__discover`)} — existing repo, extract conventions`),n.push(` 4. Use the MCP workflow tools as you build the wiki:`),n.push(` - ${k(`mcp__open-knowledge__ingest`)} — capture an external source`),n.push(` - ${k(`mcp__open-knowledge__research`)} — gather sources and write findings`),n.push(` - ${k(`mcp__open-knowledge__consolidate`)} — promote research to canonical articles`)}return n.join(`
640
640
  `)}function Vi(e,t){return{projectRoot:e.projectRoot,gitRootPromoted:e.gitRootPromoted,promotedFromDir:e.promotedFromDir??null,contentDir:t.contentDir,contentDirRequested:e.contentDirRequested??null,contentDirApplied:e.contentDir!==void 0,contentFileCount:t.contentFileCount,previewError:e.previewWarning??null,didGitInit:e.didGitInit,mcpAction:e.mcpAction,editors:e.editors.map(e=>({editorId:e.editorId,label:e.label,action:e.action,configPath:e.configPath,scope:e.configScope===`project`?`project`:`user`}))}}function Hi(e,t){let n=[];for(let r of ue)Di(D[r],e,t)&&n.push(r);return n}function Ui(){let e={log:console.log,info:console.info,debug:console.debug},t=(...e)=>{process.stderr.write(`${e.map(e=>typeof e==`string`?e:je(e)).join(` `)}\n`)};return console.log=t,console.info=t,console.debug=t,()=>{console.log=e.log,console.info=e.info,console.debug=e.debug}}function Wi(){return new fe(`init`).description(`Scaffold .ok/ in the current directory and register the MCP server for your editor(s)`).option(`--mcp`,`Register the MCP server for selected editors (default: true)`,!0).option(`--no-mcp`,`Scaffold the .ok/ directory but do not touch MCP config`).option(`--dev-mcp`,`Register a local dev MCP entry using node + packages/cli/dist/cli.mjs with debug logging`).option(`--content-dir <dir>`,`Limit content to <dir> instead of the whole project. <dir> is interpreted relative to your current directory (e.g. "." = the folder you run the command in), then saved to .ok/config.yml as content.dir.`).option(`--json`,`Emit a structured JSON summary to stdout (diagnostics stay on stderr)`).option(`--skills <ids>`,`Install only the named user-global skill bundles (comma list: discovery,write-skill)`).option(`--no-skills`,`Do not install any user-global skill bundles`).addOption(new re(`--scope <scope>`,`Write MCP config at user level, project level, or both`).choices([`user`,`project`,`both`])).addOption(new re(`--shared`,`Commit OK config alongside content (the default for fresh repos)`).conflicts(`localOnly`)).addOption(new re(`--local-only`,`Keep OK config out of git via .git/info/exclude (per-clone, not committed)`).conflicts(`shared`)).action(async e=>{let t=process.cwd(),n=e.shared?`shared`:e.localOnly?`local-only`:void 0,r=e.json?Ui():null;try{let r;try{r=await Ii({cwd:t,mcp:e.mcp,devMcp:e.devMcp,scope:e.scope,sharing:n,contentDir:e.contentDir,skills:e.skills})}catch(e){if(e instanceof $){process.stderr.write(`${e.message}\n`),process.exitCode=64;return}if(e instanceof _||e instanceof S){process.stderr.write(`${e.message}\n`),process.exitCode=78;return}if(e instanceof y){process.stderr.write(`open-knowledge could not initialize a git repo for this project. Re-run, or run 'git init' yourself in the project folder.
641
- `),e.stderr&&process.stderr.write(`${e.stderr.trim()}\n`),process.exitCode=1;return}throw e}let i=r.contentDir??`.`,a=null,{loadConfig:o}=await import(`./loader-wEc1RSer.mjs`),{resolveContentDir:s}=await import(`./src-DuSq_ZD1.mjs`),c;try{c=o(r.projectRoot).config,i=c.content.dir}catch(e){r.previewWarning=e instanceof Error?e.message:String(e)}if(c)try{let{previewContent:e}=await import(`./preview-CcMnlzBn.mjs`),t=s(c,r.projectRoot);r.preview=e({projectDir:r.projectRoot,contentDir:t}),a=r.preview.totalCount}catch(e){r.previewWarning=e instanceof Error?e.message:String(e)}e.json?process.stdout.write(`${JSON.stringify(Vi(r,{contentDir:i,contentFileCount:a}),null,2)}\n`):process.stdout.write(`${Bi(r,r.projectRoot)}\n`),(r.editors.some(e=>e.action===`failed`)||r.mcpAction===`failed`)&&(process.exitCode=1)}finally{r?.()}})}function Gi(e,t){let n=[];switch(e.kind){case`applied`:return n.push(M(`Sharing mode:`)),e.mode===`local-only`?e.action===`added`?n.push(` ${A(`local-only`)} — appended ${e.appended.length} path(s) to ${M(`${t}/.git/info/exclude`)} (per-clone, not committed).`):e.action===`noop`&&e.alreadyPresent.length>0?n.push(` ${A(`local-only`)} — already excluded; nothing to do.`):n.push(` ${A(`local-only`)}`):e.action===`removed`?n.push(` ${A(`shared`)} — removed OK paths from ${M(`${t}/.git/info/exclude`)}; commit the files to share with teammates.`):n.push(` ${A(`shared`)} — OK config will be committed alongside content.`),n;case`refused-tracked`:n.push(j(`Sharing mode: switch to local-only deferred`));for(let t of e.remediation.split(`
641
+ `),e.stderr&&process.stderr.write(`${e.stderr.trim()}\n`),process.exitCode=1;return}throw e}let i=r.contentDir??`.`,a=null,{loadConfig:o}=await import(`./loader-DSaY9ZdA.mjs`),{resolveContentDir:s}=await import(`./src-DuSq_ZD1.mjs`),c;try{c=o(r.projectRoot).config,i=c.content.dir}catch(e){r.previewWarning=e instanceof Error?e.message:String(e)}if(c)try{let{previewContent:e}=await import(`./preview-lmKXRS8K.mjs`),t=s(c,r.projectRoot);r.preview=e({projectDir:r.projectRoot,contentDir:t}),a=r.preview.totalCount}catch(e){r.previewWarning=e instanceof Error?e.message:String(e)}e.json?process.stdout.write(`${JSON.stringify(Vi(r,{contentDir:i,contentFileCount:a}),null,2)}\n`):process.stdout.write(`${Bi(r,r.projectRoot)}\n`),(r.editors.some(e=>e.action===`failed`)||r.mcpAction===`failed`)&&(process.exitCode=1)}finally{r?.()}})}function Gi(e,t){let n=[];switch(e.kind){case`applied`:return n.push(M(`Sharing mode:`)),e.mode===`local-only`?e.action===`added`?n.push(` ${A(`local-only`)} — appended ${e.appended.length} path(s) to ${M(`${t}/.git/info/exclude`)} (per-clone, not committed).`):e.action===`noop`&&e.alreadyPresent.length>0?n.push(` ${A(`local-only`)} — already excluded; nothing to do.`):n.push(` ${A(`local-only`)}`):e.action===`removed`?n.push(` ${A(`shared`)} — removed OK paths from ${M(`${t}/.git/info/exclude`)}; commit the files to share with teammates.`):n.push(` ${A(`shared`)} — OK config will be committed alongside content.`),n;case`refused-tracked`:n.push(j(`Sharing mode: switch to local-only deferred`));for(let t of e.remediation.split(`
642
642
  `))n.push(t.length>0?` ${t}`:``);return n.push(` Re-run ${k(`ok config-sharing unshare`)} after resolving to complete the switch.`),n;case`no-exclude`:if(e.localOnlyRequested)n.push(j(`Sharing mode: --local-only requested but no git repo found — option ignored`)),n.push(` Run ${k(`git init`)} (or open this folder via OK Desktop, which can scaffold a repo) and then ${k(`ok config-sharing unshare`)}.`);else if(e.reason===`no-git`)return[];else n.push(j(`Sharing mode unavailable: ${e.reason}.`));return n}}export{On as A,mt as B,er as C,Vn as D,zn as E,En as F,W as H,An as I,yn as L,jn as M,Dn as N,Tn as O,kn as P,sn as R,Nr as S,Bn as T,He as U,pt as V,di as _,Vi as a,ei as b,Bi as c,Ni as d,Ci as f,Ii as g,Si as h,Li as i,wn as j,Mn as k,Gi as l,wi as m,Ei as n,Fi as o,bi as p,ki as r,Hi as s,$ as t,Wi as u,Oi as v,Yn as w,Rr as x,Mi as y,_t as z};
643
- //# sourceMappingURL=init-DTQvzEMW.mjs.map
643
+ //# sourceMappingURL=init-CJIlsZl0.mjs.map
@@ -0,0 +1 @@
1
+ import{g as e}from"./init-CJIlsZl0.mjs";export{e as runInit};
@@ -1,2 +1,2 @@
1
- import{er as e,rr as t}from"./src-DBW4MhVj.mjs";import{P as n}from"./fs-traced-B-qtPUmb.mjs";import{D as r,T as i}from"./init-DTQvzEMW.mjs";import{t as a}from"./is-object-Bw0-z8qH.mjs";import{join as o}from"node:path";import{existsSync as s,readFileSync as c,rmSync as l}from"node:fs";const u={allowTrailingComma:!0,disallowComments:!1};function d(e,t){return e.error===1&&e.offset===0&&t.charCodeAt(0)===65279}function f(f){let p=o(f,`.claude`,`launch.json`);if(!s(p))return{kind:`not-present`};let m;try{m=c(p,`utf-8`)}catch{return{kind:`declined`}}let h=[],g=t(m,h,u)??void 0;if(h.some(e=>!d(e,m))||!g||g.type!==`object`)return{kind:`declined`};let _=e(g).configurations;if(!Array.isArray(_))return{kind:`not-present`};let v=_.findIndex(e=>a(e)&&e.name===`open-knowledge-ui`);if(v===-1)return{kind:`not-present`};if(_.length===1)return l(p,{force:!0}),{kind:`removed-file`};let{text:y,changed:b}=r(m,[`configurations`,v]);return b?(n(p,y,{mode:i(p)}),{kind:`removed`}):{kind:`not-present`}}export{f as t};
2
- //# sourceMappingURL=launch-json-removal-CSzqpsW_.mjs.map
1
+ import{er as e,rr as t}from"./src-DBW4MhVj.mjs";import{P as n}from"./fs-traced-B-qtPUmb.mjs";import{D as r,T as i}from"./init-CJIlsZl0.mjs";import{t as a}from"./is-object-Bw0-z8qH.mjs";import{join as o}from"node:path";import{existsSync as s,readFileSync as c,rmSync as l}from"node:fs";const u={allowTrailingComma:!0,disallowComments:!1};function d(e,t){return e.error===1&&e.offset===0&&t.charCodeAt(0)===65279}function f(f){let p=o(f,`.claude`,`launch.json`);if(!s(p))return{kind:`not-present`};let m;try{m=c(p,`utf-8`)}catch{return{kind:`declined`}}let h=[],g=t(m,h,u)??void 0;if(h.some(e=>!d(e,m))||!g||g.type!==`object`)return{kind:`declined`};let _=e(g).configurations;if(!Array.isArray(_))return{kind:`not-present`};let v=_.findIndex(e=>a(e)&&e.name===`open-knowledge-ui`);if(v===-1)return{kind:`not-present`};if(_.length===1)return l(p,{force:!0}),{kind:`removed-file`};let{text:y,changed:b}=r(m,[`configurations`,v]);return b?(n(p,y,{mode:i(p)}),{kind:`removed`}):{kind:`not-present`}}export{f as t};
2
+ //# sourceMappingURL=launch-json-removal-D2I6kiJ-.mjs.map
@@ -1,4 +1,4 @@
1
- import"./src-FuRMJntf.mjs";import{_ as e}from"./src-DBW4MhVj.mjs";import{U as t,l as n,o as r,s as i}from"./sleep-DcENuR74.mjs";import{D as a,O as o}from"./fs-traced-B-qtPUmb.mjs";import{t as s}from"./constants-XB7Gbn8b.mjs";import{t as c}from"./is-object-Bw0-z8qH.mjs";import{resolve as l}from"node:path";import{existsSync as u,readFileSync as d}from"node:fs";import{realpath as f}from"node:fs/promises";var p=t();async function m(e){let t=l(e);try{return await f(t)}catch(e){if(e.code!==`ENOENT`){let n=e instanceof Error?e.message:String(e);console.warn(`[normalize-cwd] realpath failed for ${t}: ${n}`)}return t}}function h(e,t){let n={...e};for(let r of Object.keys(t)){let i=e[r],a=t[r];c(a)&&c(i)?n[r]=h(i,a):a!==void 0&&(n[r]=a)}return n}function g(e){if(!u(e))return{value:null,path:e,source:null,doc:null};let t;try{t=d(e,`utf-8`)}catch(t){return console.warn(`[config] Failed to read ${e}: ${t instanceof Error?t.message:t}`),{value:null,path:e,source:null,doc:null}}let n=(0,p.parseDocument)(t);if(n.errors.length>0)return console.warn(`[config] Failed to parse ${e}: ${n.errors.map(e=>e.message).join(`; `)}`),{value:null,path:e,source:t,doc:null};let r=n.toJSON();return c(r)?{value:r,path:e,source:t,doc:n}:{value:null,path:e,source:t,doc:n}}function _(e,t){return e.map(e=>{let n=e.path.map(e=>typeof e==`symbol`?String(e):e),r={path:n,message:e.message,issueCode:e.code};if(t.doc!==null&&t.source!==null){let e=i({file:t.path,source:t.source,doc:t.doc,path:n});if(e!==void 0)return{...r,source:e}}return r})}function v(t){let i=t??process.cwd(),c=[],u=o(`user`,i),d=a({absPath:u}),f={};d.valid&&d.source!==void 0?(f=h(f,d.value),c.push(u)):d.valid;let p=l(i,`.ok`,s),m=g(p);if(m.value!==null){let e=r({value:m.value,file:m.path,source:m.source,doc:m.doc});if(e.length>0)throw Error(e.map(n).join(`
1
+ import"./src-FuRMJntf.mjs";import{_ as e}from"./src-DBW4MhVj.mjs";import{U as t,l as n,o as r,s as i}from"./sleep-DcENuR74.mjs";import{D as a,O as o}from"./fs-traced-B-qtPUmb.mjs";import{t as s}from"./constants-C84FnhVs.mjs";import{t as c}from"./is-object-Bw0-z8qH.mjs";import{resolve as l}from"node:path";import{existsSync as u,readFileSync as d}from"node:fs";import{realpath as f}from"node:fs/promises";var p=t();async function m(e){let t=l(e);try{return await f(t)}catch(e){if(e.code!==`ENOENT`){let n=e instanceof Error?e.message:String(e);console.warn(`[normalize-cwd] realpath failed for ${t}: ${n}`)}return t}}function h(e,t){let n={...e};for(let r of Object.keys(t)){let i=e[r],a=t[r];c(a)&&c(i)?n[r]=h(i,a):a!==void 0&&(n[r]=a)}return n}function g(e){if(!u(e))return{value:null,path:e,source:null,doc:null};let t;try{t=d(e,`utf-8`)}catch(t){return console.warn(`[config] Failed to read ${e}: ${t instanceof Error?t.message:t}`),{value:null,path:e,source:null,doc:null}}let n=(0,p.parseDocument)(t);if(n.errors.length>0)return console.warn(`[config] Failed to parse ${e}: ${n.errors.map(e=>e.message).join(`; `)}`),{value:null,path:e,source:t,doc:null};let r=n.toJSON();return c(r)?{value:r,path:e,source:t,doc:n}:{value:null,path:e,source:t,doc:n}}function _(e,t){return e.map(e=>{let n=e.path.map(e=>typeof e==`symbol`?String(e):e),r={path:n,message:e.message,issueCode:e.code};if(t.doc!==null&&t.source!==null){let e=i({file:t.path,source:t.source,doc:t.doc,path:n});if(e!==void 0)return{...r,source:e}}return r})}function v(t){let i=t??process.cwd(),c=[],u=o(`user`,i),d=a({absPath:u}),f={};d.valid&&d.source!==void 0?(f=h(f,d.value),c.push(u)):d.valid;let p=l(i,`.ok`,s),m=g(p);if(m.value!==null){let e=r({value:m.value,file:m.path,source:m.source,doc:m.doc});if(e.length>0)throw Error(e.map(n).join(`
2
2
 
3
3
  `));f=h(f,m.value),c.push(p)}let v=e.safeParse(f);if(!v.success){let e={code:`SCHEMA_INVALID`,issues:_(v.error.issues,m)};throw Error(n(e))}return{config:v.data,sources:c}}function y(e){let t=e.cacheMs??1e3,n=e.loadConfigFn??v,r=new Map,i=new Map,a=m(e.startupCwd);return async o=>{let s=await m(o??e.startupCwd),c=Date.now(),l=r.get(s);if(l&&l.expiresAt>c)return l.config;let u=i.get(s);if(u)return await u;let d=(async()=>{if(s===await a)return r.set(s,{config:e.startupConfig,expiresAt:Date.now()+t}),e.startupConfig;let i=n(s).config;return r.set(s,{config:i,expiresAt:Date.now()+t}),i})();i.set(s,d);try{return await d}finally{i.delete(s)}}}export{v as n,y as t};
4
- //# sourceMappingURL=loader-CAo4CIDz.mjs.map
4
+ //# sourceMappingURL=loader-D0m_F_PJ.mjs.map
@@ -0,0 +1 @@
1
+ import{n as e}from"./loader-D0m_F_PJ.mjs";export{e as loadConfig};
@@ -1,3 +1,3 @@
1
- import{ir as e}from"./src-DBW4MhVj.mjs";import"./constants-XB7Gbn8b.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{ir as e}from"./src-DBW4MhVj.mjs";import"./constants-C84FnhVs.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-C5HzJLxE.mjs.map
3
+ //# sourceMappingURL=preview-DnuyHBMZ.mjs.map
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./preview-DnuyHBMZ.mjs";export{t as formatPreviewBlock,e as previewContent};
@@ -1 +1 @@
1
- import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./jsx-runtime-DyiINK0N.js";import{n,r}from"./DocumentContext-B_zqYuAI.js";import{t as i}from"./react-JNybMug3.js";import{n as a,r as o}from"./dist-DBENJeML.js";import{t as s}from"./compiler-runtime-dQcBxOhn.js";import{t as c}from"./button-DHE6Sx02.js";import{i as l,n as u,t as d}from"./tooltip-BCGL5jDF.js";import{a as f,c as p,i as m,o as h,s as g,t as _}from"./dialog-BLaUGJCd.js";import{vt as v}from"./CodeMirrorPropInput-D0RRvxEm.js";import{n as y}from"./CopyButton-D0gTyMvW.js";import{i as b}from"./prop-types-IIZw7u0n.js";import{t as x}from"./loader-circle-K7Xwpjny.js";import{i as S,t as C}from"./timeline-diff-store-dt1fl2gd.js";import{n as w}from"./dist-DwCd6eR-.js";import{t as T}from"./dist-BD3698ve.js";import{s as E}from"./navigation-targets-BFURDxV-.js";import{a as D,i as O,n as k,o as A,t as j}from"./agent-diff-store-Dhae8oo2.js";import{n as M}from"./use-activity-panel-BQma_v27.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}=n(),{openTargetTransition:d}=r(),{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{i as e}from"./chunk-DseTPa7n.js";import{t}from"./jsx-runtime-DyiINK0N.js";import{n,r}from"./DocumentContext-BvywpAcT.js";import{t as i}from"./react-JNybMug3.js";import{n as a,r as o}from"./dist-DBENJeML.js";import{t as s}from"./compiler-runtime-dQcBxOhn.js";import{t as c}from"./button-DHE6Sx02.js";import{i as l,n as u,t as d}from"./tooltip-BCGL5jDF.js";import{a as f,c as p,i as m,o as h,s as g,t as _}from"./dialog-BLaUGJCd.js";import{vt as v}from"./CodeMirrorPropInput-QvShYcbF.js";import{n as y}from"./CopyButton-D0gTyMvW.js";import{i as b}from"./prop-types-C0wWXvTx.js";import{t as x}from"./loader-circle-K7Xwpjny.js";import{i as S,t as C}from"./timeline-diff-store-dt1fl2gd.js";import{n as w}from"./dist-DwCd6eR-.js";import{t as T}from"./dist-BD3698ve.js";import{s as E}from"./navigation-targets-D1rdXyAI.js";import{a as D,i as O,n as k,o as A,t as j}from"./agent-diff-store-Bd0NDaYd.js";import{n as M}from"./use-activity-panel-Dq1IdrW7.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}=n(),{openTargetTransition:d}=r(),{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-Ca-9q7Zb.js","./chunk-DseTPa7n.js","./dist-DBENJeML.js","./jsx-runtime-DyiINK0N.js","./react-JNybMug3.js","./compiler-runtime-dQcBxOhn.js","./ActivityPanelDiffView-legcy4jI.css"])))=>i.map(i=>d[i]);
2
- import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./preload-helper-2ej06EnG.js";import{t as n}from"./jsx-runtime-DyiINK0N.js";import{t as r}from"./react-JNybMug3.js";import{n as i,r as a}from"./dist-DBENJeML.js";import{t as o}from"./compiler-runtime-dQcBxOhn.js";import{t as ee}from"./button-DHE6Sx02.js";import{i as te,n as ne,t as re}from"./tooltip-BCGL5jDF.js";import{n as s,t as c}from"./toggle-group-CxrQL99E.js";import{t as l}from"./loader-circle-K7Xwpjny.js";import{n as u,t as d}from"./panel-right-open-CBweAP43.js";import{t as ie}from"./x-6ATUQvcC.js";import{o as ae,r as oe,t as se}from"./agent-diff-store-Dhae8oo2.js";import{t as f}from"./lru-string-cache-D19dwCKJ.js";import{t as ce}from"./use-activity-panel-BQma_v27.js";import{a as le,o as ue,r as de,t as fe}from"./use-timeline-entry-diff-aNFtV2Jq.js";var pe=o(),p=e(r(),1),m=n(),me=(0,p.lazy)(async()=>({default:(await t(()=>import(`./ActivityPanelDiffView-Ca-9q7Zb.js`),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)).ActivityPanelDiffView})),h=64;function g(e){let t=(0,pe.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)(ge),_e=(0,p.useRef)(null),[S,ve]=(0,p.useState)(`rendered`),ye;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(ye={status:`loading`,diff:``,before:``,after:``},t[0]=ye):ye=t[0];let[C,be]=(0,p.useState)(ye),xe,Se;t[1]!==h||t[2]!==x||t[3]!==y||t[4]!==b?(xe=()=>{let e=!1;be({status:`loading`,diff:``,before:``,after:``});let t=`${y}\0${b}`,n=x.get(t);if(n!==void 0){be({status:`ready`,...JSON.parse(n)});return}return ce(h,y,b).then(n=>{e||(x.set(t,JSON.stringify(n)),be({status:`ready`,...n}))}).catch(t=>{e||(console.error(`[agent-diff] failed to load burst diff`,{agentId:h,docName:y,keptCount:b,err:t}),be({status:`error`,diff:``,before:``,after:``}))}),()=>{e=!0}},Se=[h,y,b,x],t[1]=h,t[2]=x,t[3]=y,t[4]=b,t[5]=xe,t[6]=Se):(xe=t[5],Se=t[6]),(0,p.useEffect)(xe,Se);let Ce;t[7]!==C.after||t[8]!==C.before||t[9]!==C.status?(Ce=C.status===`ready`?ue(C.before,C.after):null,t[7]=C.after,t[8]=C.before,t[9]=C.status,t[10]=Ce):Ce=t[10];let w=Ce,T=C.status===`ready`&&C.diff!==``?`${S}:${C.diff}`:``,E,D;t[11]===T?(E=t[12],D=t[13]):(E=()=>{let e=_e.current;if(T===``||!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]`)??de(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)}},D=[T],t[11]=T,t[12]=E,t[13]=D),(0,p.useEffect)(E,D);let O,k;t[14]===b?(O=t[15],k=t[16]):(O=()=>{let e=e=>{let t=e.target;t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`)||(e.key===`Escape`?se():e.key===`j`||e.key===`ArrowRight`?(e.preventDefault(),oe(b+1)):(e.key===`k`||e.key===`ArrowLeft`)&&(e.preventDefault(),oe(b-1)))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},k=[b],t[14]=b,t[15]=O,t[16]=k),(0,p.useEffect)(O,k);let A,j,M,N,P,F,I,L;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`?fe(C.diff):{additions:0,deletions:0},n=e.additions>0||e.deletions>0;F=`absolute inset-0 z-20 flex flex-col bg-background`,I=`agent-diff-pane`,j=`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:he,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?(M=(0,m.jsxs)(re,{children:[a,s]}),t[41]=a,t[42]=s,t[43]=M):M=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)(ae,{icon:v,width:13,height:13}),t[46]=v,t[47]=l),t[48]!==c||t[49]!==l?(N=(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]=N):N=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?(P=(0,m.jsxs)(`div`,{className:`min-w-0 max-w-[14rem] shrink`,children:[u,d]}),t[55]=u,t[56]=d,t[57]=P):P=t[57],L=`ml-auto flex flex-wrap items-center justify-end gap-2`,A=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]=A,t[25]=j,t[26]=M,t[27]=N,t[28]=P,t[29]=F,t[30]=I,t[31]=L}else A=t[24],j=t[25],M=t[26],N=t[27],P=t[28],F=t[29],I=t[30],L=t[31];let R;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>{(e===`rendered`||e===`source`)&&ve(e)},t[58]=R):R=t[58];let z;t[59]===f?z=t[60]:(z=f({id:`ZW3mlR`}),t[59]=f,t[60]=z);let B;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(B=(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]=B):B=t[61];let we;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(we=(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]=we):we=t[62];let V;t[63]!==S||t[64]!==z?(V=(0,m.jsxs)(c,{type:`single`,value:S,onValueChange:R,"aria-label":z,variant:`segmented`,size:`sm`,spacing:1,className:`shrink-0 rounded-md bg-muted p-0.5 dark:bg-background`,children:[B,we]}),t[63]=S,t[64]=z,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 Te=!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]!==Te||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":Te,onClick:o,children:U})}),t[71]=o,t[72]=H,t[73]=Te,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]!==A||t[85]!==V||t[86]!==q||t[87]!==L?(J=(0,m.jsxs)(`div`,{className:L,children:[A,V,q]}),t[84]=A,t[85]=V,t[86]=q,t[87]=L,t[88]=J):J=t[88];let Y;t[89]!==j||t[90]!==M||t[91]!==N||t[92]!==P||t[93]!==J?(Y=(0,m.jsxs)(`div`,{className:j,children:[M,N,P,J]}),t[89]=j,t[90]=M,t[91]=N,t[92]=P,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]!==w||t[102]!==C.after||t[103]!==C.diff||t[104]!==C.status?(Q=C.status===`ready`&&(S===`rendered`&&w?.ok?(0,m.jsx)(le,{diff:w}):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)(me,{diff:C.diff,viewType:`unified`})})),t[99]=b,t[100]=S,t[101]=w,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:_e,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 Ee;return t[110]!==F||t[111]!==I||t[112]!==Y||t[113]!==$?(Ee=(0,m.jsxs)(`div`,{className:F,"data-testid":I,children:[Y,$]}),t[110]=F,t[111]=I,t[112]=Y,t[113]=$,t[114]=Ee):Ee=t[114],Ee}function he(){return se()}function ge(){return new f(h)}export{g as AgentDiffPane};
2
+ import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./preload-helper-2ej06EnG.js";import{t as n}from"./jsx-runtime-DyiINK0N.js";import{t as r}from"./react-JNybMug3.js";import{n as i,r as a}from"./dist-DBENJeML.js";import{t as o}from"./compiler-runtime-dQcBxOhn.js";import{t as ee}from"./button-DHE6Sx02.js";import{i as te,n as ne,t as re}from"./tooltip-BCGL5jDF.js";import{n as s,t as c}from"./toggle-group-CxrQL99E.js";import{t as l}from"./loader-circle-K7Xwpjny.js";import{n as u,t as d}from"./panel-right-open-CBweAP43.js";import{t as ie}from"./x-6ATUQvcC.js";import{o as ae,r as oe,t as se}from"./agent-diff-store-Bd0NDaYd.js";import{t as f}from"./lru-string-cache-D19dwCKJ.js";import{t as ce}from"./use-activity-panel-Dq1IdrW7.js";import{a as le,o as ue,r as de,t as fe}from"./use-timeline-entry-diff-CHEjXPj0.js";var pe=o(),p=e(r(),1),m=n(),me=(0,p.lazy)(async()=>({default:(await t(()=>import(`./ActivityPanelDiffView-Ca-9q7Zb.js`),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)).ActivityPanelDiffView})),h=64;function g(e){let t=(0,pe.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)(ge),_e=(0,p.useRef)(null),[S,ve]=(0,p.useState)(`rendered`),ye;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(ye={status:`loading`,diff:``,before:``,after:``},t[0]=ye):ye=t[0];let[C,be]=(0,p.useState)(ye),xe,Se;t[1]!==h||t[2]!==x||t[3]!==y||t[4]!==b?(xe=()=>{let e=!1;be({status:`loading`,diff:``,before:``,after:``});let t=`${y}\0${b}`,n=x.get(t);if(n!==void 0){be({status:`ready`,...JSON.parse(n)});return}return ce(h,y,b).then(n=>{e||(x.set(t,JSON.stringify(n)),be({status:`ready`,...n}))}).catch(t=>{e||(console.error(`[agent-diff] failed to load burst diff`,{agentId:h,docName:y,keptCount:b,err:t}),be({status:`error`,diff:``,before:``,after:``}))}),()=>{e=!0}},Se=[h,y,b,x],t[1]=h,t[2]=x,t[3]=y,t[4]=b,t[5]=xe,t[6]=Se):(xe=t[5],Se=t[6]),(0,p.useEffect)(xe,Se);let Ce;t[7]!==C.after||t[8]!==C.before||t[9]!==C.status?(Ce=C.status===`ready`?ue(C.before,C.after):null,t[7]=C.after,t[8]=C.before,t[9]=C.status,t[10]=Ce):Ce=t[10];let w=Ce,T=C.status===`ready`&&C.diff!==``?`${S}:${C.diff}`:``,E,D;t[11]===T?(E=t[12],D=t[13]):(E=()=>{let e=_e.current;if(T===``||!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]`)??de(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)}},D=[T],t[11]=T,t[12]=E,t[13]=D),(0,p.useEffect)(E,D);let O,k;t[14]===b?(O=t[15],k=t[16]):(O=()=>{let e=e=>{let t=e.target;t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`)||(e.key===`Escape`?se():e.key===`j`||e.key===`ArrowRight`?(e.preventDefault(),oe(b+1)):(e.key===`k`||e.key===`ArrowLeft`)&&(e.preventDefault(),oe(b-1)))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},k=[b],t[14]=b,t[15]=O,t[16]=k),(0,p.useEffect)(O,k);let A,j,M,N,P,F,I,L;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`?fe(C.diff):{additions:0,deletions:0},n=e.additions>0||e.deletions>0;F=`absolute inset-0 z-20 flex flex-col bg-background`,I=`agent-diff-pane`,j=`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:he,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?(M=(0,m.jsxs)(re,{children:[a,s]}),t[41]=a,t[42]=s,t[43]=M):M=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)(ae,{icon:v,width:13,height:13}),t[46]=v,t[47]=l),t[48]!==c||t[49]!==l?(N=(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]=N):N=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?(P=(0,m.jsxs)(`div`,{className:`min-w-0 max-w-[14rem] shrink`,children:[u,d]}),t[55]=u,t[56]=d,t[57]=P):P=t[57],L=`ml-auto flex flex-wrap items-center justify-end gap-2`,A=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]=A,t[25]=j,t[26]=M,t[27]=N,t[28]=P,t[29]=F,t[30]=I,t[31]=L}else A=t[24],j=t[25],M=t[26],N=t[27],P=t[28],F=t[29],I=t[30],L=t[31];let R;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>{(e===`rendered`||e===`source`)&&ve(e)},t[58]=R):R=t[58];let z;t[59]===f?z=t[60]:(z=f({id:`ZW3mlR`}),t[59]=f,t[60]=z);let B;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(B=(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]=B):B=t[61];let we;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(we=(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]=we):we=t[62];let V;t[63]!==S||t[64]!==z?(V=(0,m.jsxs)(c,{type:`single`,value:S,onValueChange:R,"aria-label":z,variant:`segmented`,size:`sm`,spacing:1,className:`shrink-0 rounded-md bg-muted p-0.5 dark:bg-background`,children:[B,we]}),t[63]=S,t[64]=z,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 Te=!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]!==Te||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":Te,onClick:o,children:U})}),t[71]=o,t[72]=H,t[73]=Te,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]!==A||t[85]!==V||t[86]!==q||t[87]!==L?(J=(0,m.jsxs)(`div`,{className:L,children:[A,V,q]}),t[84]=A,t[85]=V,t[86]=q,t[87]=L,t[88]=J):J=t[88];let Y;t[89]!==j||t[90]!==M||t[91]!==N||t[92]!==P||t[93]!==J?(Y=(0,m.jsxs)(`div`,{className:j,children:[M,N,P,J]}),t[89]=j,t[90]=M,t[91]=N,t[92]=P,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]!==w||t[102]!==C.after||t[103]!==C.diff||t[104]!==C.status?(Q=C.status===`ready`&&(S===`rendered`&&w?.ok?(0,m.jsx)(le,{diff:w}):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)(me,{diff:C.diff,viewType:`unified`})})),t[99]=b,t[100]=S,t[101]=w,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:_e,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 Ee;return t[110]!==F||t[111]!==I||t[112]!==Y||t[113]!==$?(Ee=(0,m.jsxs)(`div`,{className:F,"data-testid":I,children:[Y,$]}),t[110]=F,t[111]=I,t[112]=Y,t[113]=$,t[114]=Ee):Ee=t[114],Ee}function he(){return se()}function ge(){return new f(h)}export{g as AgentDiffPane};
@@ -1 +1 @@
1
- import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{t as n}from"./compiler-runtime-dQcBxOhn.js";import{n as r}from"./use-collab-url-BaNZ7sdp.js";import{i,r as a}from"./thread-client-DH1Xs0By.js";var o=n(),s=e(t(),1);function c(){let e=(0,o.c)(3),{collabUrl:t}=r(),n,c;return e[0]===t?(n=e[1],c=e[2]):(n=()=>{a().setUrl(i(t))},c=[t],e[0]=t,e[1]=n,e[2]=c),(0,s.useEffect)(n,c),null}export{c as AgentThreadClientBinder};
1
+ import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{t as n}from"./compiler-runtime-dQcBxOhn.js";import{n as r}from"./use-collab-url-B-LUA0g9.js";import{i,r as a}from"./thread-client-DH1Xs0By.js";var o=n(),s=e(t(),1);function c(){let e=(0,o.c)(3),{collabUrl:t}=r(),n,c;return e[0]===t?(n=e[1],c=e[2]):(n=()=>{a().setUrl(i(t))},c=[t],e[0]=t,e[1]=n,e[2]=c),(0,s.useEffect)(n,c),null}export{c as AgentThreadClientBinder};
@@ -1 +1 @@
1
- import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./jsx-runtime-DyiINK0N.js";import{t as n}from"./react-JNybMug3.js";import{r}from"./dist-DBENJeML.js";import{t as i}from"./compiler-runtime-dQcBxOhn.js";import{o as a,s as o}from"./createLucideIcon-BUb14crZ.js";import{c as s,d as c,i as l,o as u,u as d}from"./dist-Bv-DNDka.js";import{n as f,t as p}from"./dist-B4uQVk5s.js";import{n as ee,r as m,t as h}from"./dist-BJxDYUHt.js";import{_ as g,a as _,c as te,d as ne,f as re,g as v,h as ie,i as y,l as ae,m as b,n as oe,o as x,p as S,r as se,s as ce,t as le,u as ue}from"./dist-Cx2QCt5k.js";import{t as de}from"./check-D3jznJmG.js";import{t as fe}from"./chevron-right-zaL9JagC.js";var C=e(n(),1),w=t(),T=`Menubar`,[E,pe,D]=f(T),[me,he]=d(T,[D,m]),O=g(),k=m(),[ge,A]=me(T),_e=C.forwardRef((e,t)=>{let{__scopeMenubar:n,value:r,onValueChange:i,defaultValue:a,loop:o=!0,dir:s,...l}=e,d=p(s),f=k(n),[m,h]=u({prop:r,onChange:i,defaultProp:a??``,caller:T}),[g,_]=C.useState(null);return(0,w.jsx)(ge,{scope:n,value:m,onMenuOpen:C.useCallback(e=>{h(e),_(e)},[h]),onMenuClose:C.useCallback(()=>h(``),[h]),onMenuToggle:C.useCallback(e=>{h(t=>t?``:e),_(e)},[h]),dir:d,loop:o,children:(0,w.jsx)(E.Provider,{scope:n,children:(0,w.jsx)(E.Slot,{scope:n,children:(0,w.jsx)(ee,{asChild:!0,...f,orientation:`horizontal`,loop:o,dir:d,currentTabStopId:g,onCurrentTabStopIdChange:_,children:(0,w.jsx)(c.div,{role:`menubar`,...l,ref:t})})})})})});_e.displayName=T;var j=`MenubarMenu`,[M,N]=me(j),ve=e=>{let{__scopeMenubar:t,value:n,...r}=e,i=l(),a=n||i||`LEGACY_REACT_AUTO_VALUE`,o=A(j,t),s=O(t),c=C.useRef(null),u=C.useRef(!1),d=o.value===a;return C.useEffect(()=>{d||(u.current=!1)},[d]),(0,w.jsx)(M,{scope:t,value:a,triggerId:l(),triggerRef:c,contentId:l(),wasKeyboardTriggerOpenRef:u,children:(0,w.jsx)(re,{...s,open:d,onOpenChange:e=>{e||o.onMenuClose()},modal:!1,dir:o.dir,...r})})};ve.displayName=j;var P=`MenubarTrigger`,F=C.forwardRef((e,t)=>{let{__scopeMenubar:n,disabled:r=!1,...i}=e,o=k(n),l=O(n),u=A(P,n),d=N(P,n),f=C.useRef(null),p=a(t,f,d.triggerRef),[ee,m]=C.useState(!1),g=u.value===d.value;return(0,w.jsx)(E.ItemSlot,{scope:n,value:d.value,disabled:r,children:(0,w.jsx)(h,{asChild:!0,...o,focusable:!r,tabStopId:d.value,children:(0,w.jsx)(le,{asChild:!0,...l,children:(0,w.jsx)(c.button,{type:`button`,role:`menuitem`,id:d.triggerId,"aria-haspopup":`menu`,"aria-expanded":g,"aria-controls":g?d.contentId:void 0,"data-highlighted":ee?``:void 0,"data-state":g?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:p,onPointerDown:s(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(u.onMenuOpen(d.value),g||e.preventDefault())}),onPointerEnter:s(e.onPointerEnter,()=>{u.value&&!g&&(u.onMenuOpen(d.value),f.current?.focus())}),onKeyDown:s(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&u.onMenuToggle(d.value),e.key===`ArrowDown`&&u.onMenuOpen(d.value),[`Enter`,` `,`ArrowDown`].includes(e.key)&&(d.wasKeyboardTriggerOpenRef.current=!0,e.preventDefault()))}),onFocus:s(e.onFocus,()=>m(!0)),onBlur:s(e.onBlur,()=>m(!1))})})})})});F.displayName=P;var ye=`MenubarPortal`,be=e=>{let{__scopeMenubar:t,...n}=e,r=O(t);return(0,w.jsx)(ae,{...r,...n})};be.displayName=ye;var I=`MenubarContent`,L=C.forwardRef((e,t)=>{let{__scopeMenubar:n,align:r=`start`,...i}=e,a=O(n),o=A(I,n),c=N(I,n),l=pe(n),u=C.useRef(!1);return(0,w.jsx)(y,{id:c.contentId,"aria-labelledby":c.triggerId,"data-radix-menubar-content":``,...a,...i,ref:t,align:r,onCloseAutoFocus:s(e.onCloseAutoFocus,e=>{!o.value&&!u.current&&c.triggerRef.current?.focus(),u.current=!1,e.preventDefault()}),onFocusOutside:s(e.onFocusOutside,e=>{let t=e.target;l().some(e=>e.ref.current?.contains(t))&&e.preventDefault()}),onInteractOutside:s(e.onInteractOutside,()=>{u.current=!0}),onEntryFocus:e=>{c.wasKeyboardTriggerOpenRef.current||e.preventDefault()},onKeyDown:s(e.onKeyDown,e=>{if([`ArrowRight`,`ArrowLeft`].includes(e.key)){let t=e.target,n=t.hasAttribute(`data-radix-menubar-subtrigger`),r=t.closest(`[data-radix-menubar-content]`)!==e.currentTarget,i=(o.dir===`rtl`?`ArrowRight`:`ArrowLeft`)===e.key;if(!i&&n||r&&i)return;let a=l().filter(e=>!e.disabled).map(e=>e.value);i&&a.reverse();let s=a.indexOf(c.value);a=o.loop?Ne(a,s+1):a.slice(s+1);let[u]=a;u&&o.onMenuOpen(u)}},{checkForDefaultPrevented:!1}),style:{...e.style,"--radix-menubar-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-menubar-content-available-width":`var(--radix-popper-available-width)`,"--radix-menubar-content-available-height":`var(--radix-popper-available-height)`,"--radix-menubar-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-menubar-trigger-height":`var(--radix-popper-anchor-height)`}})});L.displayName=I;var xe=`MenubarGroup`,R=C.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=O(n);return(0,w.jsx)(_,{...i,...r,ref:t})});R.displayName=xe;var Se=`MenubarLabel`,Ce=C.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=O(n);return(0,w.jsx)(te,{...i,...r,ref:t})});Ce.displayName=Se;var z=`MenubarItem`,B=C.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=O(n);return(0,w.jsx)(x,{...i,...r,ref:t})});B.displayName=z;var we=`MenubarCheckboxItem`,Te=C.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=O(n);return(0,w.jsx)(se,{...i,...r,ref:t})});Te.displayName=we;var V=`MenubarRadioGroup`,Ee=C.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=O(n);return(0,w.jsx)(ue,{...i,...r,ref:t})});Ee.displayName=V;var H=`MenubarRadioItem`,De=C.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=O(n);return(0,w.jsx)(ne,{...i,...r,ref:t})});De.displayName=H;var Oe=`MenubarItemIndicator`,U=C.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=O(n);return(0,w.jsx)(ce,{...i,...r,ref:t})});U.displayName=Oe;var ke=`MenubarSeparator`,Ae=C.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=O(n);return(0,w.jsx)(S,{...i,...r,ref:t})});Ae.displayName=ke;var W=`MenubarArrow`,G=C.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=O(n);return(0,w.jsx)(oe,{...i,...r,ref:t})});G.displayName=W;var K=`MenubarSub`,q=e=>{let{__scopeMenubar:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=O(t),[s,c]=u({prop:r,defaultProp:a??!1,onChange:i,caller:K});return(0,w.jsx)(b,{...o,open:s,onOpenChange:c,children:n})};q.displayName=K;var je=`MenubarSubTrigger`,J=C.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=O(n);return(0,w.jsx)(v,{"data-radix-menubar-subtrigger":``,...i,...r,ref:t})});J.displayName=je;var Y=`MenubarSubContent`,Me=C.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=O(n);return(0,w.jsx)(ie,{...i,"data-radix-menubar-content":``,...r,ref:t,style:{...e.style,"--radix-menubar-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-menubar-content-available-width":`var(--radix-popper-available-width)`,"--radix-menubar-content-available-height":`var(--radix-popper-available-height)`,"--radix-menubar-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-menubar-trigger-height":`var(--radix-popper-anchor-height)`}})});Me.displayName=Y;function Ne(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Pe=_e,Fe=ve,Ie=F,Le=be,Re=L,ze=B,Be=Te,Ve=U,He=Ae,Ue=q,We=J,Ge=Me,X=i();function Ke(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`flex h-8 items-center gap-0.5 rounded-lg border p-[3px]`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,w.jsx)(Pe,{"data-slot":`menubar`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function qe(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,w.jsx)(Fe,{"data-slot":`menubar-menu`,...n}),t[2]=n,t[3]=r),r}function Je(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,w.jsx)(Le,{"data-slot":`menubar-portal`,...n}),t[2]=n,t[3]=r),r}function Ye(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`flex items-center rounded-sm px-1.5 py-[2px] text-sm font-medium outline-hidden select-none hover:bg-muted aria-expanded:bg-muted`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,w.jsx)(Ie,{"data-slot":`menubar-trigger`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Xe(e){let t=(0,X.c)(14),n,r,i,a,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],s=t[5]):({className:n,align:i,alignOffset:a,sideOffset:s,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=s);let c=i===void 0?`start`:i,l=a===void 0?-4:a,u=s===void 0?8:s,d;t[6]===n?d=t[7]:(d=o(`z-50 min-w-36 origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95`,n),t[6]=n,t[7]=d);let f;return t[8]!==c||t[9]!==l||t[10]!==r||t[11]!==u||t[12]!==d?(f=(0,w.jsx)(Je,{children:(0,w.jsx)(Re,{"data-slot":`menubar-content`,align:c,alignOffset:l,sideOffset:u,className:d,...r})}),t[8]=c,t[9]=l,t[10]=r,t[11]=u,t[12]=d,t[13]=f):f=t[13],f}function Z(e){let t=(0,X.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,inset:r,variant:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let s=a===void 0?`default`:a,c;t[5]===n?c=t[6]:(c=o(`group/menubar-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive!`,n),t[5]=n,t[6]=c);let l;return t[7]!==r||t[8]!==i||t[9]!==c||t[10]!==s?(l=(0,w.jsx)(ze,{"data-slot":`menubar-item`,"data-inset":r,"data-variant":s,className:c,...i}),t[7]=r,t[8]=i,t[9]=c,t[10]=s,t[11]=l):l=t[11],l}function Ze(e){let t=(0,X.c)(15),n,r,i,a,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],s=t[5]):({className:i,children:r,checked:n,inset:a,...s}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=s);let c;t[6]===i?c=t[7]:(c=o(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-1.5 pl-7 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0`,i),t[6]=i,t[7]=c);let l;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,w.jsx)(`span`,{className:`pointer-events-none absolute left-1.5 flex size-4 items-center justify-center [&_svg:not([class*='size-'])]:size-4`,children:(0,w.jsx)(Ve,{children:(0,w.jsx)(de,{})})}),t[8]=l):l=t[8];let u;return t[9]!==n||t[10]!==r||t[11]!==a||t[12]!==s||t[13]!==c?(u=(0,w.jsxs)(Be,{"data-slot":`menubar-checkbox-item`,"data-inset":a,className:c,checked:n,...s,children:[l,r]}),t[9]=n,t[10]=r,t[11]=a,t[12]=s,t[13]=c,t[14]=u):u=t[14],u}function Q(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`-mx-1 my-1 h-px bg-border`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,w.jsx)(He,{"data-slot":`menubar-separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function $(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`ml-auto text-xs tracking-widest text-muted-foreground group-focus/menubar-item:text-accent-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,w.jsx)(`span`,{"data-slot":`menubar-shortcut`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Qe(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,w.jsx)(Ue,{"data-slot":`menubar-sub`,...n}),t[2]=n,t[3]=r),r}function $e(e){let t=(0,X.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,inset:i,children:n,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let s;t[5]===r?s=t[6]:(s=o(`flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-none select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg:not([class*='size-'])]:size-4`,r),t[5]=r,t[6]=s);let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,w.jsx)(fe,{className:`ml-auto size-4`}),t[7]=c):c=t[7];let l;return t[8]!==n||t[9]!==i||t[10]!==a||t[11]!==s?(l=(0,w.jsxs)(We,{"data-slot":`menubar-sub-trigger`,"data-inset":i,className:s,...a,children:[n,c]}),t[8]=n,t[9]=i,t[10]=a,t[11]=s,t[12]=l):l=t[12],l}function et(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`z-50 min-w-32 origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,w.jsx)(Ge,{"data-slot":`menubar-sub-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function tt(){let e=(0,X.c)(370),{_:t}=r(),n=typeof window<`u`?window.okDesktop??null:null,[i,a]=(0,C.useState)(null);if(n==null||n.menu==null||n.platform===`darwin`)return null;let o=n.menu,s=n.platform===`win32`,c;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=e=>{o.dispatch(e).catch(nt)},e[0]=c):c=e[0];let l=c,u;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>{o.dispatch({kind:`query`}).then(e=>a(e??null)).catch(()=>a(null))},e[1]=u):u=e[1];let d=u,f=i?.activeTarget.kind??null,p=i?.viewMenuState,ee;e[2]===t?ee=e[3]:(ee=t(s?{id:`rFTdVq`}:{id:`H6nKok`}),e[2]=t,e[3]=ee);let m=ee,h;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=e=>{e&&d()},e[4]=h):h=e[4];let g;e[5]===t?g=e[6]:(g=t({id:`J2eKUI`}),e[5]=t,e[6]=g);let _;e[7]===g?_=e[8]:(_=(0,w.jsx)(Ye,{className:`px-2 py-1 text-xs font-normal`,children:g}),e[7]=g,e[8]=_);let te;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(te=()=>l({kind:`menu-action`,action:`new-doc`}),e[9]=te):te=e[9];let ne;e[10]===t?ne=e[11]:(ne=t({id:`HdkSiO`}),e[10]=t,e[11]=ne);let re;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,w.jsx)($,{children:`Ctrl+N`}),e[12]=re):re=e[12];let v;e[13]===ne?v=e[14]:(v=(0,w.jsxs)(Z,{onSelect:te,children:[ne,re]}),e[13]=ne,e[14]=v);let ie;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(ie=()=>l({kind:`menu-action`,action:`new-folder`}),e[15]=ie):ie=e[15];let y;e[16]===t?y=e[17]:(y=t({id:`96G6Re`}),e[16]=t,e[17]=y);let ae;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,w.jsx)($,{children:`Ctrl+Shift+N`}),e[18]=ae):ae=e[18];let b;e[19]===y?b=e[20]:(b=(0,w.jsxs)(Z,{onSelect:ie,children:[y,ae]}),e[19]=y,e[20]=b);let oe;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(oe=()=>l({kind:`menu-action`,action:`new-from-template`}),e[21]=oe):oe=e[21];let x;e[22]===t?x=e[23]:(x=t({id:`ioMn4Z`}),e[22]=t,e[23]=x);let S;e[24]===x?S=e[25]:(S=(0,w.jsx)(Z,{onSelect:oe,children:x}),e[24]=x,e[25]=S);let se;e[26]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,w.jsx)(Q,{}),e[26]=se):se=e[26];let ce;e[27]===t?ce=e[28]:(ce=t({id:`ten9en`}),e[27]=t,e[28]=ce);let le;e[29]===ce?le=e[30]:(le=(0,w.jsx)($e,{children:ce}),e[29]=ce,e[30]=le);let ue;e[31]!==t||e[32]!==i?(ue=(0,w.jsx)(et,{children:i==null||i.recentProjects.length===0?(0,w.jsx)(Z,{disabled:!0,children:t({id:`SvBFYA`})}):(0,w.jsxs)(w.Fragment,{children:[i.recentProjects.slice(0,10).map(e=>(0,w.jsx)(Z,{onSelect:()=>l({kind:`open-recent-project`,path:e.path}),children:e.name},e.path)),(0,w.jsx)(Q,{}),(0,w.jsx)(Z,{onSelect:()=>l({kind:`command`,command:`clear-recent-projects`}),children:t({id:`ak4LLg`})})]})}),e[31]=t,e[32]=i,e[33]=ue):ue=e[33];let de;e[34]!==le||e[35]!==ue?(de=(0,w.jsxs)(Qe,{children:[le,ue]}),e[34]=le,e[35]=ue,e[36]=de):de=e[36];let fe;e[37]===Symbol.for(`react.memo_cache_sentinel`)?(fe=()=>l({kind:`menu-action`,action:`new-project`}),e[37]=fe):fe=e[37];let T;e[38]===t?T=e[39]:(T=t({id:`NYu2Pt`}),e[38]=t,e[39]=T);let E;e[40]===T?E=e[41]:(E=(0,w.jsx)(Z,{onSelect:fe,children:T}),e[40]=T,e[41]=E);let pe;e[42]===Symbol.for(`react.memo_cache_sentinel`)?(pe=()=>l({kind:`command`,command:`open-navigator`}),e[42]=pe):pe=e[42];let D;e[43]===t?D=e[44]:(D=t({id:`vYPvPB`}),e[43]=t,e[44]=D);let me;e[45]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,w.jsx)($,{children:`Ctrl+Shift+P`}),e[45]=me):me=e[45];let he;e[46]===D?he=e[47]:(he=(0,w.jsxs)(Z,{onSelect:pe,children:[D,me]}),e[46]=D,e[47]=he);let O;e[48]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>l({kind:`command`,command:`open-folder-dialog`}),e[48]=O):O=e[48];let k;e[49]===t?k=e[50]:(k=t({id:`FDBwmS`}),e[49]=t,e[50]=k);let ge;e[51]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,w.jsx)($,{children:`Ctrl+O`}),e[51]=ge):ge=e[51];let A;e[52]===k?A=e[53]:(A=(0,w.jsxs)(Z,{onSelect:O,children:[k,ge]}),e[52]=k,e[53]=A);let _e;e[54]===Symbol.for(`react.memo_cache_sentinel`)?(_e=(0,w.jsx)(Q,{}),e[54]=_e):_e=e[54];let j;e[55]===Symbol.for(`react.memo_cache_sentinel`)?(j=()=>l({kind:`menu-action`,action:`new-worktree`}),e[55]=j):j=e[55];let M;e[56]===t?M=e[57]:(M=t({id:`TTDXD8`}),e[56]=t,e[57]=M);let N;e[58]===M?N=e[59]:(N=(0,w.jsx)(Z,{onSelect:j,children:M}),e[58]=M,e[59]=N);let ve;e[60]===Symbol.for(`react.memo_cache_sentinel`)?(ve=()=>l({kind:`menu-action`,action:`switch-worktree`}),e[60]=ve):ve=e[60];let P;e[61]===t?P=e[62]:(P=t({id:`mxGJVE`}),e[61]=t,e[62]=P);let F;e[63]===P?F=e[64]:(F=(0,w.jsx)(Z,{onSelect:ve,children:P}),e[63]=P,e[64]=F);let ye;e[65]===Symbol.for(`react.memo_cache_sentinel`)?(ye=(0,w.jsx)(Q,{}),e[65]=ye):ye=e[65];let be=f!==`doc`&&f!==`folder`,I;e[66]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>l({kind:`menu-action`,action:`duplicate`}),e[66]=I):I=e[66];let L;e[67]===t?L=e[68]:(L=t({id:`euc6Ns`}),e[67]=t,e[68]=L);let xe;e[69]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,w.jsx)($,{children:`Ctrl+D`}),e[69]=xe):xe=e[69];let R;e[70]!==be||e[71]!==L?(R=(0,w.jsxs)(Z,{disabled:be,onSelect:I,children:[L,xe]}),e[70]=be,e[71]=L,e[72]=R):R=e[72];let Se=f===null,Ce;e[73]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=()=>l({kind:`menu-action`,action:`rename`}),e[73]=Ce):Ce=e[73];let z;e[74]===t?z=e[75]:(z=t({id:`2wxgft`}),e[74]=t,e[75]=z);let B;e[76]!==Se||e[77]!==z?(B=(0,w.jsx)(Z,{disabled:Se,onSelect:Ce,children:z}),e[76]=Se,e[77]=z,e[78]=B):B=e[78];let we=f===null,Te;e[79]===Symbol.for(`react.memo_cache_sentinel`)?(Te=()=>l({kind:`menu-action`,action:`move-to-trash`}),e[79]=Te):Te=e[79];let V;e[80]===t?V=e[81]:(V=t({id:`q3TWG7`}),e[80]=t,e[81]=V);let Ee;e[82]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=(0,w.jsx)($,{children:`Ctrl+Del`}),e[82]=Ee):Ee=e[82];let H;e[83]!==we||e[84]!==V?(H=(0,w.jsxs)(Z,{disabled:we,onSelect:Te,children:[V,Ee]}),e[83]=we,e[84]=V,e[85]=H):H=e[85];let De;e[86]===Symbol.for(`react.memo_cache_sentinel`)?(De=(0,w.jsx)(Q,{}),e[86]=De):De=e[86];let Oe;e[87]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=()=>l({kind:`menu-action`,action:`reveal-in-finder`}),e[87]=Oe):Oe=e[87];let U;e[88]===m?U=e[89]:(U=(0,w.jsx)(Z,{onSelect:Oe,children:m}),e[88]=m,e[89]=U);let ke=f===`asset`,Ae;e[90]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=()=>l({kind:`menu-action`,action:`send-to-ai`}),e[90]=Ae):Ae=e[90];let W;e[91]===t?W=e[92]:(W=t({id:`O7_W_a`}),e[91]=t,e[92]=W);let G;e[93]!==ke||e[94]!==W?(G=(0,w.jsx)(Z,{disabled:ke,onSelect:Ae,children:W}),e[93]=ke,e[94]=W,e[95]=G):G=e[95];let K;e[96]===t?K=e[97]:(K=t({id:`oCZkaG`}),e[96]=t,e[97]=K);let q;e[98]===K?q=e[99]:(q=(0,w.jsx)($e,{children:K}),e[98]=K,e[99]=q);let je;e[100]===Symbol.for(`react.memo_cache_sentinel`)?(je=()=>l({kind:`menu-action`,action:`copy-full-path`}),e[100]=je):je=e[100];let J;e[101]===t?J=e[102]:(J=t({id:`oQA-cA`}),e[101]=t,e[102]=J);let Y;e[103]===J?Y=e[104]:(Y=(0,w.jsx)(Z,{onSelect:je,children:J}),e[103]=J,e[104]=Y);let Me;e[105]===Symbol.for(`react.memo_cache_sentinel`)?(Me=()=>l({kind:`menu-action`,action:`copy-relative-path`}),e[105]=Me):Me=e[105];let Ne;e[106]===t?Ne=e[107]:(Ne=t({id:`s061i4`}),e[106]=t,e[107]=Ne);let Pe;e[108]===Ne?Pe=e[109]:(Pe=(0,w.jsx)(Z,{onSelect:Me,children:Ne}),e[108]=Ne,e[109]=Pe);let Fe;e[110]!==Y||e[111]!==Pe?(Fe=(0,w.jsxs)(et,{children:[Y,Pe]}),e[110]=Y,e[111]=Pe,e[112]=Fe):Fe=e[112];let Ie;e[113]!==q||e[114]!==Fe?(Ie=(0,w.jsxs)(Qe,{children:[q,Fe]}),e[113]=q,e[114]=Fe,e[115]=Ie):Ie=e[115];let Le;e[116]===Symbol.for(`react.memo_cache_sentinel`)?(Le=(0,w.jsx)(Q,{}),e[116]=Le):Le=e[116];let Re;e[117]!==t||e[118]!==i?.canReconfigureMcpWiring?(Re=i?.canReconfigureMcpWiring===!0&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Z,{onSelect:()=>l({kind:`command`,command:`reconfigure-mcp-wiring`}),children:t({id:`zBUqvf`})}),(0,w.jsx)(Q,{})]}),e[117]=t,e[118]=i?.canReconfigureMcpWiring,e[119]=Re):Re=e[119];let ze;e[120]===Symbol.for(`react.memo_cache_sentinel`)?(ze=()=>l({kind:`command`,command:`open-settings`}),e[120]=ze):ze=e[120];let Be;e[121]===t?Be=e[122]:(Be=t({id:`uVbUP8`}),e[121]=t,e[122]=Be);let Ve;e[123]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=(0,w.jsx)($,{children:`Ctrl+,`}),e[123]=Ve):Ve=e[123];let He;e[124]===Be?He=e[125]:(He=(0,w.jsxs)(Z,{onSelect:ze,children:[Be,Ve]}),e[124]=Be,e[125]=He);let Ue;e[126]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=(0,w.jsx)(Q,{}),e[126]=Ue):Ue=e[126];let We;e[127]===Symbol.for(`react.memo_cache_sentinel`)?(We=()=>l({kind:`role`,role:`quit`}),e[127]=We):We=e[127];let Ge;e[128]===t?Ge=e[129]:(Ge=t({id:`ydzS9x`}),e[128]=t,e[129]=Ge);let Je;e[130]===Ge?Je=e[131]:(Je=(0,w.jsx)(Z,{onSelect:We,children:Ge}),e[130]=Ge,e[131]=Je);let tt;e[132]!==b||e[133]!==S||e[134]!==de||e[135]!==E||e[136]!==he||e[137]!==A||e[138]!==N||e[139]!==F||e[140]!==R||e[141]!==B||e[142]!==H||e[143]!==U||e[144]!==G||e[145]!==Ie||e[146]!==Re||e[147]!==He||e[148]!==Je||e[149]!==v?(tt=(0,w.jsxs)(Xe,{children:[v,b,S,se,de,E,he,A,_e,N,F,ye,R,B,H,De,U,G,Ie,Le,Re,He,Ue,Je]}),e[132]=b,e[133]=S,e[134]=de,e[135]=E,e[136]=he,e[137]=A,e[138]=N,e[139]=F,e[140]=R,e[141]=B,e[142]=H,e[143]=U,e[144]=G,e[145]=Ie,e[146]=Re,e[147]=He,e[148]=Je,e[149]=v,e[150]=tt):tt=e[150];let rt;e[151]!==_||e[152]!==tt?(rt=(0,w.jsxs)(qe,{children:[_,tt]}),e[151]=_,e[152]=tt,e[153]=rt):rt=e[153];let it;e[154]===t?it=e[155]:(it=t({id:`ePK91l`}),e[154]=t,e[155]=it);let at;e[156]===it?at=e[157]:(at=(0,w.jsx)(Ye,{className:`px-2 py-1 text-xs font-normal`,children:it}),e[156]=it,e[157]=at);let ot;e[158]===Symbol.for(`react.memo_cache_sentinel`)?(ot=()=>l({kind:`role`,role:`undo`}),e[158]=ot):ot=e[158];let st;e[159]===t?st=e[160]:(st=t({id:`9uI_rE`}),e[159]=t,e[160]=st);let ct;e[161]===Symbol.for(`react.memo_cache_sentinel`)?(ct=(0,w.jsx)($,{children:`Ctrl+Z`}),e[161]=ct):ct=e[161];let lt;e[162]===st?lt=e[163]:(lt=(0,w.jsxs)(Z,{onSelect:ot,children:[st,ct]}),e[162]=st,e[163]=lt);let ut;e[164]===Symbol.for(`react.memo_cache_sentinel`)?(ut=()=>l({kind:`role`,role:`redo`}),e[164]=ut):ut=e[164];let dt;e[165]===t?dt=e[166]:(dt=t({id:`H3oH0g`}),e[165]=t,e[166]=dt);let ft;e[167]===Symbol.for(`react.memo_cache_sentinel`)?(ft=(0,w.jsx)($,{children:`Ctrl+Y`}),e[167]=ft):ft=e[167];let pt;e[168]===dt?pt=e[169]:(pt=(0,w.jsxs)(Z,{onSelect:ut,children:[dt,ft]}),e[168]=dt,e[169]=pt);let mt;e[170]===Symbol.for(`react.memo_cache_sentinel`)?(mt=(0,w.jsx)(Q,{}),e[170]=mt):mt=e[170];let ht;e[171]===Symbol.for(`react.memo_cache_sentinel`)?(ht=()=>l({kind:`role`,role:`cut`}),e[171]=ht):ht=e[171];let gt;e[172]===t?gt=e[173]:(gt=t({id:`cCd8Bs`}),e[172]=t,e[173]=gt);let _t;e[174]===Symbol.for(`react.memo_cache_sentinel`)?(_t=(0,w.jsx)($,{children:`Ctrl+X`}),e[174]=_t):_t=e[174];let vt;e[175]===gt?vt=e[176]:(vt=(0,w.jsxs)(Z,{onSelect:ht,children:[gt,_t]}),e[175]=gt,e[176]=vt);let yt;e[177]===Symbol.for(`react.memo_cache_sentinel`)?(yt=()=>l({kind:`role`,role:`copy`}),e[177]=yt):yt=e[177];let bt;e[178]===t?bt=e[179]:(bt=t({id:`he3ygx`}),e[178]=t,e[179]=bt);let xt;e[180]===Symbol.for(`react.memo_cache_sentinel`)?(xt=(0,w.jsx)($,{children:`Ctrl+C`}),e[180]=xt):xt=e[180];let St;e[181]===bt?St=e[182]:(St=(0,w.jsxs)(Z,{onSelect:yt,children:[bt,xt]}),e[181]=bt,e[182]=St);let Ct;e[183]===Symbol.for(`react.memo_cache_sentinel`)?(Ct=()=>l({kind:`role`,role:`paste`}),e[183]=Ct):Ct=e[183];let wt;e[184]===t?wt=e[185]:(wt=t({id:`HzVv6g`}),e[184]=t,e[185]=wt);let Tt;e[186]===Symbol.for(`react.memo_cache_sentinel`)?(Tt=(0,w.jsx)($,{children:`Ctrl+V`}),e[186]=Tt):Tt=e[186];let Et;e[187]===wt?Et=e[188]:(Et=(0,w.jsxs)(Z,{onSelect:Ct,children:[wt,Tt]}),e[187]=wt,e[188]=Et);let Dt;e[189]===Symbol.for(`react.memo_cache_sentinel`)?(Dt=()=>l({kind:`role`,role:`selectAll`}),e[189]=Dt):Dt=e[189];let Ot;e[190]===t?Ot=e[191]:(Ot=t({id:`mCB6Je`}),e[190]=t,e[191]=Ot);let kt;e[192]===Symbol.for(`react.memo_cache_sentinel`)?(kt=(0,w.jsx)($,{children:`Ctrl+A`}),e[192]=kt):kt=e[192];let At;e[193]===Ot?At=e[194]:(At=(0,w.jsxs)(Z,{onSelect:Dt,children:[Ot,kt]}),e[193]=Ot,e[194]=At);let jt;e[195]===Symbol.for(`react.memo_cache_sentinel`)?(jt=(0,w.jsx)(Q,{}),e[195]=jt):jt=e[195];let Mt=i?.spellCheckEnabled??!0,Nt;e[196]===Symbol.for(`react.memo_cache_sentinel`)?(Nt=()=>l({kind:`command`,command:`toggle-spell-check`}),e[196]=Nt):Nt=e[196];let Pt;e[197]===t?Pt=e[198]:(Pt=t({id:`ZgJVnp`}),e[197]=t,e[198]=Pt);let Ft;e[199]!==Mt||e[200]!==Pt?(Ft=(0,w.jsx)(Ze,{checked:Mt,onSelect:Nt,children:Pt}),e[199]=Mt,e[200]=Pt,e[201]=Ft):Ft=e[201];let It;e[202]!==St||e[203]!==Et||e[204]!==At||e[205]!==Ft||e[206]!==lt||e[207]!==pt||e[208]!==vt?(It=(0,w.jsxs)(Xe,{children:[lt,pt,mt,vt,St,Et,At,jt,Ft]}),e[202]=St,e[203]=Et,e[204]=At,e[205]=Ft,e[206]=lt,e[207]=pt,e[208]=vt,e[209]=It):It=e[209];let Lt;e[210]!==It||e[211]!==at?(Lt=(0,w.jsxs)(qe,{children:[at,It]}),e[210]=It,e[211]=at,e[212]=Lt):Lt=e[212];let Rt;e[213]===t?Rt=e[214]:(Rt=t({id:`jpctdh`}),e[213]=t,e[214]=Rt);let zt;e[215]===Rt?zt=e[216]:(zt=(0,w.jsx)(Ye,{className:`px-2 py-1 text-xs font-normal`,children:Rt}),e[215]=Rt,e[216]=zt);let Bt;e[217]===Symbol.for(`react.memo_cache_sentinel`)?(Bt=()=>l({kind:`role`,role:`reload`}),e[217]=Bt):Bt=e[217];let Vt;e[218]===t?Vt=e[219]:(Vt=t({id:`HpK_8d`}),e[218]=t,e[219]=Vt);let Ht;e[220]===Vt?Ht=e[221]:(Ht=(0,w.jsx)(Z,{onSelect:Bt,children:Vt}),e[220]=Vt,e[221]=Ht);let Ut;e[222]===Symbol.for(`react.memo_cache_sentinel`)?(Ut=()=>l({kind:`role`,role:`forceReload`}),e[222]=Ut):Ut=e[222];let Wt;e[223]===t?Wt=e[224]:(Wt=t({id:`2CHoQv`}),e[223]=t,e[224]=Wt);let Gt;e[225]===Wt?Gt=e[226]:(Gt=(0,w.jsx)(Z,{onSelect:Ut,children:Wt}),e[225]=Wt,e[226]=Gt);let Kt;e[227]!==t||e[228]!==i?.showDevToolsMenu?(Kt=i?.showDevToolsMenu===!0&&(0,w.jsx)(Z,{onSelect:()=>l({kind:`role`,role:`toggleDevTools`}),children:t({id:`pgDlbM`})}),e[227]=t,e[228]=i?.showDevToolsMenu,e[229]=Kt):Kt=e[229];let qt;e[230]===Symbol.for(`react.memo_cache_sentinel`)?(qt=(0,w.jsx)(Q,{}),e[230]=qt):qt=e[230];let Jt;e[231]===Symbol.for(`react.memo_cache_sentinel`)?(Jt=()=>l({kind:`menu-action`,action:`toggle-sidebar`}),e[231]=Jt):Jt=e[231];let Yt;e[232]!==t||e[233]!==p?.sidebarVisible?(Yt=p?.sidebarVisible===!1?t({id:`151wvk`}):t({id:`Q1mtyd`}),e[232]=t,e[233]=p?.sidebarVisible,e[234]=Yt):Yt=e[234];let Xt;e[235]===Symbol.for(`react.memo_cache_sentinel`)?(Xt=(0,w.jsx)($,{children:`Ctrl+Alt+S`}),e[235]=Xt):Xt=e[235];let Zt;e[236]===Yt?Zt=e[237]:(Zt=(0,w.jsxs)(Z,{onSelect:Jt,children:[Yt,Xt]}),e[236]=Yt,e[237]=Zt);let Qt;e[238]===Symbol.for(`react.memo_cache_sentinel`)?(Qt=()=>l({kind:`menu-action`,action:`toggle-doc-panel`}),e[238]=Qt):Qt=e[238];let $t;e[239]!==t||e[240]!==p?.docPanelVisible?($t=p?.docPanelVisible===!1?t({id:`fSRzLo`}):t({id:`GSYWCm`}),e[239]=t,e[240]=p?.docPanelVisible,e[241]=$t):$t=e[241];let en;e[242]===Symbol.for(`react.memo_cache_sentinel`)?(en=(0,w.jsx)($,{children:`Ctrl+Alt+B`}),e[242]=en):en=e[242];let tn;e[243]===$t?tn=e[244]:(tn=(0,w.jsxs)(Z,{onSelect:Qt,children:[$t,en]}),e[243]=$t,e[244]=tn);let nn;e[245]===Symbol.for(`react.memo_cache_sentinel`)?(nn=(0,w.jsx)(Q,{}),e[245]=nn):nn=e[245];let rn=p?.showHiddenFiles??!1,an;e[246]===Symbol.for(`react.memo_cache_sentinel`)?(an=()=>l({kind:`menu-action`,action:`toggle-show-hidden-files`}),e[246]=an):an=e[246];let on;e[247]===t?on=e[248]:(on=t({id:`XcGbim`}),e[247]=t,e[248]=on);let sn;e[249]===Symbol.for(`react.memo_cache_sentinel`)?(sn=(0,w.jsx)($,{children:`Ctrl+Shift+.`}),e[249]=sn):sn=e[249];let cn;e[250]!==rn||e[251]!==on?(cn=(0,w.jsxs)(Ze,{checked:rn,onSelect:an,children:[on,sn]}),e[250]=rn,e[251]=on,e[252]=cn):cn=e[252];let ln=p?.showOkFolders??!1,un;e[253]===Symbol.for(`react.memo_cache_sentinel`)?(un=()=>l({kind:`menu-action`,action:`toggle-show-ok-folders`}),e[253]=un):un=e[253];let dn;e[254]===t?dn=e[255]:(dn=t({id:`GHsJb8`}),e[254]=t,e[255]=dn);let fn;e[256]!==ln||e[257]!==dn?(fn=(0,w.jsx)(Ze,{checked:ln,onSelect:un,children:dn}),e[256]=ln,e[257]=dn,e[258]=fn):fn=e[258];let pn=p?.showOnlyMarkdownFiles??!1,mn;e[259]===Symbol.for(`react.memo_cache_sentinel`)?(mn=()=>l({kind:`menu-action`,action:`toggle-show-only-markdown-files`}),e[259]=mn):mn=e[259];let hn;e[260]===t?hn=e[261]:(hn=t({id:`WkTLN7`}),e[260]=t,e[261]=hn);let gn;e[262]!==pn||e[263]!==hn?(gn=(0,w.jsx)(Ze,{checked:pn,onSelect:mn,children:hn}),e[262]=pn,e[263]=hn,e[264]=gn):gn=e[264];let _n=p?.showSkillsSection??!0,vn;e[265]===Symbol.for(`react.memo_cache_sentinel`)?(vn=()=>l({kind:`menu-action`,action:`toggle-show-skills-section`}),e[265]=vn):vn=e[265];let yn;e[266]===t?yn=e[267]:(yn=t({id:`NF_Wcg`}),e[266]=t,e[267]=yn);let bn;e[268]!==_n||e[269]!==yn?(bn=(0,w.jsx)(Ze,{checked:_n,onSelect:vn,children:yn}),e[268]=_n,e[269]=yn,e[270]=bn):bn=e[270];let xn;e[271]===Symbol.for(`react.memo_cache_sentinel`)?(xn=(0,w.jsx)(Q,{}),e[271]=xn):xn=e[271];let Sn;e[272]!==t||e[273]!==p?.canExpandAll?(Sn=(p?.canExpandAll??!0)&&(0,w.jsx)(Z,{onSelect:()=>l({kind:`menu-action`,action:`expand-all-tree`}),children:t({id:`OlAl5i`})}),e[272]=t,e[273]=p?.canExpandAll,e[274]=Sn):Sn=e[274];let Cn;e[275]!==t||e[276]!==p?.canCollapseAll?(Cn=(p?.canCollapseAll??!0)&&(0,w.jsx)(Z,{onSelect:()=>l({kind:`menu-action`,action:`collapse-all-tree`}),children:t({id:`qvWGzP`})}),e[275]=t,e[276]=p?.canCollapseAll,e[277]=Cn):Cn=e[277];let wn;e[278]===Symbol.for(`react.memo_cache_sentinel`)?(wn=(0,w.jsx)(Q,{}),e[278]=wn):wn=e[278];let Tn;e[279]===Symbol.for(`react.memo_cache_sentinel`)?(Tn=()=>l({kind:`role`,role:`resetZoom`}),e[279]=Tn):Tn=e[279];let En;e[280]===t?En=e[281]:(En=t({id:`FF7V5K`}),e[280]=t,e[281]=En);let Dn;e[282]===En?Dn=e[283]:(Dn=(0,w.jsx)(Z,{onSelect:Tn,children:En}),e[282]=En,e[283]=Dn);let On;e[284]===Symbol.for(`react.memo_cache_sentinel`)?(On=()=>l({kind:`role`,role:`zoomIn`}),e[284]=On):On=e[284];let kn;e[285]===t?kn=e[286]:(kn=t({id:`Dz7fsq`}),e[285]=t,e[286]=kn);let An;e[287]===kn?An=e[288]:(An=(0,w.jsx)(Z,{onSelect:On,children:kn}),e[287]=kn,e[288]=An);let jn;e[289]===Symbol.for(`react.memo_cache_sentinel`)?(jn=()=>l({kind:`role`,role:`zoomOut`}),e[289]=jn):jn=e[289];let Mn;e[290]===t?Mn=e[291]:(Mn=t({id:`bbJ-VR`}),e[290]=t,e[291]=Mn);let Nn;e[292]===Mn?Nn=e[293]:(Nn=(0,w.jsx)(Z,{onSelect:jn,children:Mn}),e[292]=Mn,e[293]=Nn);let Pn;e[294]===Symbol.for(`react.memo_cache_sentinel`)?(Pn=(0,w.jsx)(Q,{}),e[294]=Pn):Pn=e[294];let Fn;e[295]===Symbol.for(`react.memo_cache_sentinel`)?(Fn=()=>l({kind:`role`,role:`toggleFullScreen`}),e[295]=Fn):Fn=e[295];let In;e[296]===t?In=e[297]:(In=t({id:`LTeJuX`}),e[296]=t,e[297]=In);let Ln;e[298]===Symbol.for(`react.memo_cache_sentinel`)?(Ln=(0,w.jsx)($,{children:`F11`}),e[298]=Ln):Ln=e[298];let Rn;e[299]===In?Rn=e[300]:(Rn=(0,w.jsxs)(Z,{onSelect:Fn,children:[In,Ln]}),e[299]=In,e[300]=Rn);let zn;e[301]!==Ht||e[302]!==Gt||e[303]!==Kt||e[304]!==Zt||e[305]!==tn||e[306]!==cn||e[307]!==fn||e[308]!==gn||e[309]!==bn||e[310]!==Sn||e[311]!==Cn||e[312]!==Dn||e[313]!==An||e[314]!==Nn||e[315]!==Rn?(zn=(0,w.jsxs)(Xe,{children:[Ht,Gt,Kt,qt,Zt,tn,nn,cn,fn,gn,bn,xn,Sn,Cn,wn,Dn,An,Nn,Pn,Rn]}),e[301]=Ht,e[302]=Gt,e[303]=Kt,e[304]=Zt,e[305]=tn,e[306]=cn,e[307]=fn,e[308]=gn,e[309]=bn,e[310]=Sn,e[311]=Cn,e[312]=Dn,e[313]=An,e[314]=Nn,e[315]=Rn,e[316]=zn):zn=e[316];let Bn;e[317]!==zt||e[318]!==zn?(Bn=(0,w.jsxs)(qe,{children:[zt,zn]}),e[317]=zt,e[318]=zn,e[319]=Bn):Bn=e[319];let Vn;e[320]===t?Vn=e[321]:(Vn=t({id:`T3Mld1`}),e[320]=t,e[321]=Vn);let Hn;e[322]===Vn?Hn=e[323]:(Hn=(0,w.jsx)(Ye,{className:`px-2 py-1 text-xs font-normal`,children:Vn}),e[322]=Vn,e[323]=Hn);let Un;e[324]===Symbol.for(`react.memo_cache_sentinel`)?(Un=()=>l({kind:`role`,role:`minimize`}),e[324]=Un):Un=e[324];let Wn;e[325]===t?Wn=e[326]:(Wn=t({id:`3TSz9S`}),e[325]=t,e[326]=Wn);let Gn;e[327]===Wn?Gn=e[328]:(Gn=(0,w.jsx)(Z,{onSelect:Un,children:Wn}),e[327]=Wn,e[328]=Gn);let Kn;e[329]===Symbol.for(`react.memo_cache_sentinel`)?(Kn=()=>l({kind:`role`,role:`close`}),e[329]=Kn):Kn=e[329];let qn;e[330]===t?qn=e[331]:(qn=t({id:`aRI3Om`}),e[330]=t,e[331]=qn);let Jn;e[332]===qn?Jn=e[333]:(Jn=(0,w.jsx)(Z,{onSelect:Kn,children:qn}),e[332]=qn,e[333]=Jn);let Yn;e[334]!==Gn||e[335]!==Jn?(Yn=(0,w.jsxs)(Xe,{children:[Gn,Jn]}),e[334]=Gn,e[335]=Jn,e[336]=Yn):Yn=e[336];let Xn;e[337]!==Hn||e[338]!==Yn?(Xn=(0,w.jsxs)(qe,{children:[Hn,Yn]}),e[337]=Hn,e[338]=Yn,e[339]=Xn):Xn=e[339];let Zn;e[340]===t?Zn=e[341]:(Zn=t({id:`c3XJ18`}),e[340]=t,e[341]=Zn);let Qn;e[342]===Zn?Qn=e[343]:(Qn=(0,w.jsx)(Ye,{className:`px-2 py-1 text-xs font-normal`,children:Zn}),e[342]=Zn,e[343]=Qn);let $n;e[344]===Symbol.for(`react.memo_cache_sentinel`)?($n=()=>l({kind:`command`,command:`open-github`}),e[344]=$n):$n=e[344];let er;e[345]===t?er=e[346]:(er=t({id:`LeGeTf`}),e[345]=t,e[346]=er);let tr;e[347]===er?tr=e[348]:(tr=(0,w.jsx)(Z,{onSelect:$n,children:er}),e[347]=er,e[348]=tr);let nr;e[349]===Symbol.for(`react.memo_cache_sentinel`)?(nr=()=>l({kind:`menu-action`,action:`report-bug`}),e[349]=nr):nr=e[349];let rr;e[350]===t?rr=e[351]:(rr=t({id:`fTtfPS`}),e[350]=t,e[351]=rr);let ir;e[352]===rr?ir=e[353]:(ir=(0,w.jsx)(Z,{onSelect:nr,children:rr}),e[352]=rr,e[353]=ir);let ar;e[354]!==t||e[355]!==i?.canCheckForUpdates?(ar=i?.canCheckForUpdates===!0&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Q,{}),(0,w.jsx)(Z,{onSelect:()=>l({kind:`command`,command:`check-for-updates`}),children:t({id:`3SZrdj`})})]}),e[354]=t,e[355]=i?.canCheckForUpdates,e[356]=ar):ar=e[356];let or;e[357]!==tr||e[358]!==ir||e[359]!==ar?(or=(0,w.jsxs)(Xe,{children:[tr,ir,ar]}),e[357]=tr,e[358]=ir,e[359]=ar,e[360]=or):or=e[360];let sr;e[361]!==Qn||e[362]!==or?(sr=(0,w.jsxs)(qe,{children:[Qn,or]}),e[361]=Qn,e[362]=or,e[363]=sr):sr=e[363];let cr;return e[364]!==Lt||e[365]!==Bn||e[366]!==Xn||e[367]!==sr||e[368]!==rt?(cr=(0,w.jsxs)(Ke,{"data-testid":`app-menubar`,className:`h-auto rounded-none border-0 bg-transparent p-0 shadow-none [-webkit-app-region:no-drag]`,onValueChange:h,children:[rt,Lt,Bn,Xn,sr]}),e[364]=Lt,e[365]=Bn,e[366]=Xn,e[367]=sr,e[368]=rt,e[369]=cr):cr=e[369],cr}function nt(){}export{tt as AppMenubar};
1
+ import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./jsx-runtime-DyiINK0N.js";import{t as n}from"./react-JNybMug3.js";import{r}from"./dist-DBENJeML.js";import{t as i}from"./compiler-runtime-dQcBxOhn.js";import{o as a,s as o}from"./createLucideIcon-BUb14crZ.js";import{c as s,d as c,i as l,o as u,u as d}from"./dist-Bv-DNDka.js";import{n as f,t as p}from"./dist-B4uQVk5s.js";import{n as ee,r as m,t as h}from"./dist-BJxDYUHt.js";import{_ as g,a as _,c as te,d as ne,f as re,g as v,h as ie,i as y,l as ae,m as b,n as oe,o as x,p as S,r as se,s as ce,t as le,u as ue}from"./dist-Cx2QCt5k.js";import{t as de}from"./check-D3jznJmG.js";import{t as fe}from"./chevron-right-zaL9JagC.js";var C=e(n(),1),w=t(),T=`Menubar`,[E,pe,D]=f(T),[me,he]=d(T,[D,m]),O=g(),k=m(),[ge,A]=me(T),_e=C.forwardRef((e,t)=>{let{__scopeMenubar:n,value:r,onValueChange:i,defaultValue:a,loop:o=!0,dir:s,...l}=e,d=p(s),f=k(n),[m,h]=u({prop:r,onChange:i,defaultProp:a??``,caller:T}),[g,_]=C.useState(null);return(0,w.jsx)(ge,{scope:n,value:m,onMenuOpen:C.useCallback(e=>{h(e),_(e)},[h]),onMenuClose:C.useCallback(()=>h(``),[h]),onMenuToggle:C.useCallback(e=>{h(t=>t?``:e),_(e)},[h]),dir:d,loop:o,children:(0,w.jsx)(E.Provider,{scope:n,children:(0,w.jsx)(E.Slot,{scope:n,children:(0,w.jsx)(ee,{asChild:!0,...f,orientation:`horizontal`,loop:o,dir:d,currentTabStopId:g,onCurrentTabStopIdChange:_,children:(0,w.jsx)(c.div,{role:`menubar`,...l,ref:t})})})})})});_e.displayName=T;var j=`MenubarMenu`,[M,N]=me(j),ve=e=>{let{__scopeMenubar:t,value:n,...r}=e,i=l(),a=n||i||`LEGACY_REACT_AUTO_VALUE`,o=A(j,t),s=O(t),c=C.useRef(null),u=C.useRef(!1),d=o.value===a;return C.useEffect(()=>{d||(u.current=!1)},[d]),(0,w.jsx)(M,{scope:t,value:a,triggerId:l(),triggerRef:c,contentId:l(),wasKeyboardTriggerOpenRef:u,children:(0,w.jsx)(re,{...s,open:d,onOpenChange:e=>{e||o.onMenuClose()},modal:!1,dir:o.dir,...r})})};ve.displayName=j;var P=`MenubarTrigger`,F=C.forwardRef((e,t)=>{let{__scopeMenubar:n,disabled:r=!1,...i}=e,o=k(n),l=O(n),u=A(P,n),d=N(P,n),f=C.useRef(null),p=a(t,f,d.triggerRef),[ee,m]=C.useState(!1),g=u.value===d.value;return(0,w.jsx)(E.ItemSlot,{scope:n,value:d.value,disabled:r,children:(0,w.jsx)(h,{asChild:!0,...o,focusable:!r,tabStopId:d.value,children:(0,w.jsx)(le,{asChild:!0,...l,children:(0,w.jsx)(c.button,{type:`button`,role:`menuitem`,id:d.triggerId,"aria-haspopup":`menu`,"aria-expanded":g,"aria-controls":g?d.contentId:void 0,"data-highlighted":ee?``:void 0,"data-state":g?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:p,onPointerDown:s(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(u.onMenuOpen(d.value),g||e.preventDefault())}),onPointerEnter:s(e.onPointerEnter,()=>{u.value&&!g&&(u.onMenuOpen(d.value),f.current?.focus())}),onKeyDown:s(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&u.onMenuToggle(d.value),e.key===`ArrowDown`&&u.onMenuOpen(d.value),[`Enter`,` `,`ArrowDown`].includes(e.key)&&(d.wasKeyboardTriggerOpenRef.current=!0,e.preventDefault()))}),onFocus:s(e.onFocus,()=>m(!0)),onBlur:s(e.onBlur,()=>m(!1))})})})})});F.displayName=P;var ye=`MenubarPortal`,be=e=>{let{__scopeMenubar:t,...n}=e,r=O(t);return(0,w.jsx)(ae,{...r,...n})};be.displayName=ye;var I=`MenubarContent`,L=C.forwardRef((e,t)=>{let{__scopeMenubar:n,align:r=`start`,...i}=e,a=O(n),o=A(I,n),c=N(I,n),l=pe(n),u=C.useRef(!1);return(0,w.jsx)(y,{id:c.contentId,"aria-labelledby":c.triggerId,"data-radix-menubar-content":``,...a,...i,ref:t,align:r,onCloseAutoFocus:s(e.onCloseAutoFocus,e=>{!o.value&&!u.current&&c.triggerRef.current?.focus(),u.current=!1,e.preventDefault()}),onFocusOutside:s(e.onFocusOutside,e=>{let t=e.target;l().some(e=>e.ref.current?.contains(t))&&e.preventDefault()}),onInteractOutside:s(e.onInteractOutside,()=>{u.current=!0}),onEntryFocus:e=>{c.wasKeyboardTriggerOpenRef.current||e.preventDefault()},onKeyDown:s(e.onKeyDown,e=>{if([`ArrowRight`,`ArrowLeft`].includes(e.key)){let t=e.target,n=t.hasAttribute(`data-radix-menubar-subtrigger`),r=t.closest(`[data-radix-menubar-content]`)!==e.currentTarget,i=(o.dir===`rtl`?`ArrowRight`:`ArrowLeft`)===e.key;if(!i&&n||r&&i)return;let a=l().filter(e=>!e.disabled).map(e=>e.value);i&&a.reverse();let s=a.indexOf(c.value);a=o.loop?Ne(a,s+1):a.slice(s+1);let[u]=a;u&&o.onMenuOpen(u)}},{checkForDefaultPrevented:!1}),style:{...e.style,"--radix-menubar-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-menubar-content-available-width":`var(--radix-popper-available-width)`,"--radix-menubar-content-available-height":`var(--radix-popper-available-height)`,"--radix-menubar-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-menubar-trigger-height":`var(--radix-popper-anchor-height)`}})});L.displayName=I;var xe=`MenubarGroup`,R=C.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=O(n);return(0,w.jsx)(_,{...i,...r,ref:t})});R.displayName=xe;var Se=`MenubarLabel`,Ce=C.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=O(n);return(0,w.jsx)(te,{...i,...r,ref:t})});Ce.displayName=Se;var z=`MenubarItem`,B=C.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=O(n);return(0,w.jsx)(x,{...i,...r,ref:t})});B.displayName=z;var we=`MenubarCheckboxItem`,Te=C.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=O(n);return(0,w.jsx)(se,{...i,...r,ref:t})});Te.displayName=we;var V=`MenubarRadioGroup`,Ee=C.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=O(n);return(0,w.jsx)(ue,{...i,...r,ref:t})});Ee.displayName=V;var H=`MenubarRadioItem`,De=C.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=O(n);return(0,w.jsx)(ne,{...i,...r,ref:t})});De.displayName=H;var Oe=`MenubarItemIndicator`,U=C.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=O(n);return(0,w.jsx)(ce,{...i,...r,ref:t})});U.displayName=Oe;var ke=`MenubarSeparator`,Ae=C.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=O(n);return(0,w.jsx)(S,{...i,...r,ref:t})});Ae.displayName=ke;var W=`MenubarArrow`,G=C.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=O(n);return(0,w.jsx)(oe,{...i,...r,ref:t})});G.displayName=W;var K=`MenubarSub`,q=e=>{let{__scopeMenubar:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=O(t),[s,c]=u({prop:r,defaultProp:a??!1,onChange:i,caller:K});return(0,w.jsx)(b,{...o,open:s,onOpenChange:c,children:n})};q.displayName=K;var je=`MenubarSubTrigger`,J=C.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=O(n);return(0,w.jsx)(v,{"data-radix-menubar-subtrigger":``,...i,...r,ref:t})});J.displayName=je;var Y=`MenubarSubContent`,Me=C.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=O(n);return(0,w.jsx)(ie,{...i,"data-radix-menubar-content":``,...r,ref:t,style:{...e.style,"--radix-menubar-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-menubar-content-available-width":`var(--radix-popper-available-width)`,"--radix-menubar-content-available-height":`var(--radix-popper-available-height)`,"--radix-menubar-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-menubar-trigger-height":`var(--radix-popper-anchor-height)`}})});Me.displayName=Y;function Ne(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Pe=_e,Fe=ve,Ie=F,Le=be,Re=L,ze=B,Be=Te,Ve=U,He=Ae,Ue=q,We=J,Ge=Me,X=i();function Ke(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`flex h-8 items-center gap-0.5 rounded-lg border p-[3px]`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,w.jsx)(Pe,{"data-slot":`menubar`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function qe(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,w.jsx)(Fe,{"data-slot":`menubar-menu`,...n}),t[2]=n,t[3]=r),r}function Je(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,w.jsx)(Le,{"data-slot":`menubar-portal`,...n}),t[2]=n,t[3]=r),r}function Ye(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`flex items-center rounded-sm px-1.5 py-[2px] text-sm font-medium outline-hidden select-none hover:bg-muted aria-expanded:bg-muted`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,w.jsx)(Ie,{"data-slot":`menubar-trigger`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Xe(e){let t=(0,X.c)(14),n,r,i,a,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],s=t[5]):({className:n,align:i,alignOffset:a,sideOffset:s,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=s);let c=i===void 0?`start`:i,l=a===void 0?-4:a,u=s===void 0?8:s,d;t[6]===n?d=t[7]:(d=o(`z-50 min-w-36 origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95`,n),t[6]=n,t[7]=d);let f;return t[8]!==c||t[9]!==l||t[10]!==r||t[11]!==u||t[12]!==d?(f=(0,w.jsx)(Je,{children:(0,w.jsx)(Re,{"data-slot":`menubar-content`,align:c,alignOffset:l,sideOffset:u,className:d,...r})}),t[8]=c,t[9]=l,t[10]=r,t[11]=u,t[12]=d,t[13]=f):f=t[13],f}function Z(e){let t=(0,X.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,inset:r,variant:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let s=a===void 0?`default`:a,c;t[5]===n?c=t[6]:(c=o(`group/menubar-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive!`,n),t[5]=n,t[6]=c);let l;return t[7]!==r||t[8]!==i||t[9]!==c||t[10]!==s?(l=(0,w.jsx)(ze,{"data-slot":`menubar-item`,"data-inset":r,"data-variant":s,className:c,...i}),t[7]=r,t[8]=i,t[9]=c,t[10]=s,t[11]=l):l=t[11],l}function Ze(e){let t=(0,X.c)(15),n,r,i,a,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],s=t[5]):({className:i,children:r,checked:n,inset:a,...s}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=s);let c;t[6]===i?c=t[7]:(c=o(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-1.5 pl-7 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0`,i),t[6]=i,t[7]=c);let l;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,w.jsx)(`span`,{className:`pointer-events-none absolute left-1.5 flex size-4 items-center justify-center [&_svg:not([class*='size-'])]:size-4`,children:(0,w.jsx)(Ve,{children:(0,w.jsx)(de,{})})}),t[8]=l):l=t[8];let u;return t[9]!==n||t[10]!==r||t[11]!==a||t[12]!==s||t[13]!==c?(u=(0,w.jsxs)(Be,{"data-slot":`menubar-checkbox-item`,"data-inset":a,className:c,checked:n,...s,children:[l,r]}),t[9]=n,t[10]=r,t[11]=a,t[12]=s,t[13]=c,t[14]=u):u=t[14],u}function Q(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`-mx-1 my-1 h-px bg-border`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,w.jsx)(He,{"data-slot":`menubar-separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function $(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`ml-auto text-xs tracking-widest text-muted-foreground group-focus/menubar-item:text-accent-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,w.jsx)(`span`,{"data-slot":`menubar-shortcut`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Qe(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,w.jsx)(Ue,{"data-slot":`menubar-sub`,...n}),t[2]=n,t[3]=r),r}function $e(e){let t=(0,X.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,inset:i,children:n,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let s;t[5]===r?s=t[6]:(s=o(`flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-none select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg:not([class*='size-'])]:size-4`,r),t[5]=r,t[6]=s);let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,w.jsx)(fe,{className:`ml-auto size-4`}),t[7]=c):c=t[7];let l;return t[8]!==n||t[9]!==i||t[10]!==a||t[11]!==s?(l=(0,w.jsxs)(We,{"data-slot":`menubar-sub-trigger`,"data-inset":i,className:s,...a,children:[n,c]}),t[8]=n,t[9]=i,t[10]=a,t[11]=s,t[12]=l):l=t[12],l}function et(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`z-50 min-w-32 origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,w.jsx)(Ge,{"data-slot":`menubar-sub-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function tt(){let e=(0,X.c)(376),{_:t}=r(),n=typeof window<`u`?window.okDesktop??null:null,[i,a]=(0,C.useState)(null);if(n==null||n.menu==null||n.platform===`darwin`)return null;let o=n.menu,s=n.platform===`win32`,c;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=e=>{o.dispatch(e).catch(nt)},e[0]=c):c=e[0];let l=c,u;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>{o.dispatch({kind:`query`}).then(e=>a(e??null)).catch(()=>a(null))},e[1]=u):u=e[1];let d=u,f=i?.activeTarget.kind??null,p=i?.viewMenuState,ee;e[2]===t?ee=e[3]:(ee=t(s?{id:`rFTdVq`}:{id:`H6nKok`}),e[2]=t,e[3]=ee);let m=ee,h;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=e=>{e&&d()},e[4]=h):h=e[4];let g;e[5]===t?g=e[6]:(g=t({id:`J2eKUI`}),e[5]=t,e[6]=g);let _;e[7]===g?_=e[8]:(_=(0,w.jsx)(Ye,{className:`px-2 py-1 text-xs font-normal`,children:g}),e[7]=g,e[8]=_);let te;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(te=()=>l({kind:`menu-action`,action:`new-doc`}),e[9]=te):te=e[9];let ne;e[10]===t?ne=e[11]:(ne=t({id:`HdkSiO`}),e[10]=t,e[11]=ne);let re;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,w.jsx)($,{children:`Ctrl+N`}),e[12]=re):re=e[12];let v;e[13]===ne?v=e[14]:(v=(0,w.jsxs)(Z,{onSelect:te,children:[ne,re]}),e[13]=ne,e[14]=v);let ie;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(ie=()=>l({kind:`menu-action`,action:`new-folder`}),e[15]=ie):ie=e[15];let y;e[16]===t?y=e[17]:(y=t({id:`96G6Re`}),e[16]=t,e[17]=y);let ae;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,w.jsx)($,{children:`Ctrl+Shift+N`}),e[18]=ae):ae=e[18];let b;e[19]===y?b=e[20]:(b=(0,w.jsxs)(Z,{onSelect:ie,children:[y,ae]}),e[19]=y,e[20]=b);let oe;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(oe=()=>l({kind:`menu-action`,action:`new-from-template`}),e[21]=oe):oe=e[21];let x;e[22]===t?x=e[23]:(x=t({id:`ioMn4Z`}),e[22]=t,e[23]=x);let S;e[24]===x?S=e[25]:(S=(0,w.jsx)(Z,{onSelect:oe,children:x}),e[24]=x,e[25]=S);let se;e[26]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,w.jsx)(Q,{}),e[26]=se):se=e[26];let ce;e[27]===t?ce=e[28]:(ce=t({id:`ten9en`}),e[27]=t,e[28]=ce);let le;e[29]===ce?le=e[30]:(le=(0,w.jsx)($e,{children:ce}),e[29]=ce,e[30]=le);let ue;e[31]!==t||e[32]!==i?(ue=(0,w.jsx)(et,{children:i==null||i.recentProjects.length===0?(0,w.jsx)(Z,{disabled:!0,children:t({id:`SvBFYA`})}):(0,w.jsxs)(w.Fragment,{children:[i.recentProjects.slice(0,10).map(e=>(0,w.jsx)(Z,{onSelect:()=>l({kind:`open-recent-project`,path:e.path}),children:e.name},e.path)),(0,w.jsx)(Q,{}),(0,w.jsx)(Z,{onSelect:()=>l({kind:`command`,command:`clear-recent-projects`}),children:t({id:`ak4LLg`})})]})}),e[31]=t,e[32]=i,e[33]=ue):ue=e[33];let de;e[34]!==le||e[35]!==ue?(de=(0,w.jsxs)(Qe,{children:[le,ue]}),e[34]=le,e[35]=ue,e[36]=de):de=e[36];let fe;e[37]===Symbol.for(`react.memo_cache_sentinel`)?(fe=()=>l({kind:`menu-action`,action:`new-project`}),e[37]=fe):fe=e[37];let T;e[38]===t?T=e[39]:(T=t({id:`NYu2Pt`}),e[38]=t,e[39]=T);let E;e[40]===T?E=e[41]:(E=(0,w.jsx)(Z,{onSelect:fe,children:T}),e[40]=T,e[41]=E);let pe;e[42]===Symbol.for(`react.memo_cache_sentinel`)?(pe=()=>l({kind:`command`,command:`open-navigator`}),e[42]=pe):pe=e[42];let D;e[43]===t?D=e[44]:(D=t({id:`vYPvPB`}),e[43]=t,e[44]=D);let me;e[45]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,w.jsx)($,{children:`Ctrl+Shift+P`}),e[45]=me):me=e[45];let he;e[46]===D?he=e[47]:(he=(0,w.jsxs)(Z,{onSelect:pe,children:[D,me]}),e[46]=D,e[47]=he);let O;e[48]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>l({kind:`command`,command:`open-folder-dialog`}),e[48]=O):O=e[48];let k;e[49]===t?k=e[50]:(k=t({id:`FDBwmS`}),e[49]=t,e[50]=k);let ge;e[51]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,w.jsx)($,{children:`Ctrl+O`}),e[51]=ge):ge=e[51];let A;e[52]===k?A=e[53]:(A=(0,w.jsxs)(Z,{onSelect:O,children:[k,ge]}),e[52]=k,e[53]=A);let _e;e[54]===Symbol.for(`react.memo_cache_sentinel`)?(_e=(0,w.jsx)(Q,{}),e[54]=_e):_e=e[54];let j;e[55]===Symbol.for(`react.memo_cache_sentinel`)?(j=()=>l({kind:`menu-action`,action:`new-worktree`}),e[55]=j):j=e[55];let M;e[56]===t?M=e[57]:(M=t({id:`TTDXD8`}),e[56]=t,e[57]=M);let N;e[58]===M?N=e[59]:(N=(0,w.jsx)(Z,{onSelect:j,children:M}),e[58]=M,e[59]=N);let ve;e[60]===Symbol.for(`react.memo_cache_sentinel`)?(ve=()=>l({kind:`menu-action`,action:`switch-worktree`}),e[60]=ve):ve=e[60];let P;e[61]===t?P=e[62]:(P=t({id:`mxGJVE`}),e[61]=t,e[62]=P);let F;e[63]===P?F=e[64]:(F=(0,w.jsx)(Z,{onSelect:ve,children:P}),e[63]=P,e[64]=F);let ye;e[65]===Symbol.for(`react.memo_cache_sentinel`)?(ye=(0,w.jsx)(Q,{}),e[65]=ye):ye=e[65];let be=f!==`doc`&&f!==`folder`,I;e[66]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>l({kind:`menu-action`,action:`duplicate`}),e[66]=I):I=e[66];let L;e[67]===t?L=e[68]:(L=t({id:`euc6Ns`}),e[67]=t,e[68]=L);let xe;e[69]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,w.jsx)($,{children:`Ctrl+D`}),e[69]=xe):xe=e[69];let R;e[70]!==be||e[71]!==L?(R=(0,w.jsxs)(Z,{disabled:be,onSelect:I,children:[L,xe]}),e[70]=be,e[71]=L,e[72]=R):R=e[72];let Se=f===null,Ce;e[73]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=()=>l({kind:`menu-action`,action:`rename`}),e[73]=Ce):Ce=e[73];let z;e[74]===t?z=e[75]:(z=t({id:`2wxgft`}),e[74]=t,e[75]=z);let B;e[76]!==Se||e[77]!==z?(B=(0,w.jsx)(Z,{disabled:Se,onSelect:Ce,children:z}),e[76]=Se,e[77]=z,e[78]=B):B=e[78];let we=f===null,Te;e[79]===Symbol.for(`react.memo_cache_sentinel`)?(Te=()=>l({kind:`menu-action`,action:`move-to-trash`}),e[79]=Te):Te=e[79];let V;e[80]===t?V=e[81]:(V=t({id:`q3TWG7`}),e[80]=t,e[81]=V);let Ee;e[82]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=(0,w.jsx)($,{children:`Ctrl+Del`}),e[82]=Ee):Ee=e[82];let H;e[83]!==we||e[84]!==V?(H=(0,w.jsxs)(Z,{disabled:we,onSelect:Te,children:[V,Ee]}),e[83]=we,e[84]=V,e[85]=H):H=e[85];let De;e[86]===Symbol.for(`react.memo_cache_sentinel`)?(De=(0,w.jsx)(Q,{}),e[86]=De):De=e[86];let Oe;e[87]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=()=>l({kind:`menu-action`,action:`reveal-in-finder`}),e[87]=Oe):Oe=e[87];let U;e[88]===m?U=e[89]:(U=(0,w.jsx)(Z,{onSelect:Oe,children:m}),e[88]=m,e[89]=U);let ke=f===`asset`,Ae;e[90]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=()=>l({kind:`menu-action`,action:`send-to-ai`}),e[90]=Ae):Ae=e[90];let W;e[91]===t?W=e[92]:(W=t({id:`O7_W_a`}),e[91]=t,e[92]=W);let G;e[93]!==ke||e[94]!==W?(G=(0,w.jsx)(Z,{disabled:ke,onSelect:Ae,children:W}),e[93]=ke,e[94]=W,e[95]=G):G=e[95];let K;e[96]===t?K=e[97]:(K=t({id:`oCZkaG`}),e[96]=t,e[97]=K);let q;e[98]===K?q=e[99]:(q=(0,w.jsx)($e,{children:K}),e[98]=K,e[99]=q);let je;e[100]===Symbol.for(`react.memo_cache_sentinel`)?(je=()=>l({kind:`menu-action`,action:`copy-full-path`}),e[100]=je):je=e[100];let J;e[101]===t?J=e[102]:(J=t({id:`oQA-cA`}),e[101]=t,e[102]=J);let Y;e[103]===J?Y=e[104]:(Y=(0,w.jsx)(Z,{onSelect:je,children:J}),e[103]=J,e[104]=Y);let Me;e[105]===Symbol.for(`react.memo_cache_sentinel`)?(Me=()=>l({kind:`menu-action`,action:`copy-relative-path`}),e[105]=Me):Me=e[105];let Ne;e[106]===t?Ne=e[107]:(Ne=t({id:`s061i4`}),e[106]=t,e[107]=Ne);let Pe;e[108]===Ne?Pe=e[109]:(Pe=(0,w.jsx)(Z,{onSelect:Me,children:Ne}),e[108]=Ne,e[109]=Pe);let Fe;e[110]!==Y||e[111]!==Pe?(Fe=(0,w.jsxs)(et,{children:[Y,Pe]}),e[110]=Y,e[111]=Pe,e[112]=Fe):Fe=e[112];let Ie;e[113]!==q||e[114]!==Fe?(Ie=(0,w.jsxs)(Qe,{children:[q,Fe]}),e[113]=q,e[114]=Fe,e[115]=Ie):Ie=e[115];let Le;e[116]===Symbol.for(`react.memo_cache_sentinel`)?(Le=(0,w.jsx)(Q,{}),e[116]=Le):Le=e[116];let Re;e[117]!==t||e[118]!==i?.canReconfigureMcpWiring?(Re=i?.canReconfigureMcpWiring===!0&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Z,{onSelect:()=>l({kind:`command`,command:`reconfigure-mcp-wiring`}),children:t({id:`zBUqvf`})}),(0,w.jsx)(Q,{})]}),e[117]=t,e[118]=i?.canReconfigureMcpWiring,e[119]=Re):Re=e[119];let ze;e[120]===Symbol.for(`react.memo_cache_sentinel`)?(ze=()=>l({kind:`command`,command:`open-settings`}),e[120]=ze):ze=e[120];let Be;e[121]===t?Be=e[122]:(Be=t({id:`uVbUP8`}),e[121]=t,e[122]=Be);let Ve;e[123]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=(0,w.jsx)($,{children:`Ctrl+,`}),e[123]=Ve):Ve=e[123];let He;e[124]===Be?He=e[125]:(He=(0,w.jsxs)(Z,{onSelect:ze,children:[Be,Ve]}),e[124]=Be,e[125]=He);let Ue;e[126]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=(0,w.jsx)(Q,{}),e[126]=Ue):Ue=e[126];let We;e[127]===Symbol.for(`react.memo_cache_sentinel`)?(We=()=>l({kind:`role`,role:`quit`}),e[127]=We):We=e[127];let Ge;e[128]===t?Ge=e[129]:(Ge=t({id:`ydzS9x`}),e[128]=t,e[129]=Ge);let Je;e[130]===Ge?Je=e[131]:(Je=(0,w.jsx)(Z,{onSelect:We,children:Ge}),e[130]=Ge,e[131]=Je);let tt;e[132]!==b||e[133]!==S||e[134]!==de||e[135]!==E||e[136]!==he||e[137]!==A||e[138]!==N||e[139]!==F||e[140]!==R||e[141]!==B||e[142]!==H||e[143]!==U||e[144]!==G||e[145]!==Ie||e[146]!==Re||e[147]!==He||e[148]!==Je||e[149]!==v?(tt=(0,w.jsxs)(Xe,{children:[v,b,S,se,de,E,he,A,_e,N,F,ye,R,B,H,De,U,G,Ie,Le,Re,He,Ue,Je]}),e[132]=b,e[133]=S,e[134]=de,e[135]=E,e[136]=he,e[137]=A,e[138]=N,e[139]=F,e[140]=R,e[141]=B,e[142]=H,e[143]=U,e[144]=G,e[145]=Ie,e[146]=Re,e[147]=He,e[148]=Je,e[149]=v,e[150]=tt):tt=e[150];let rt;e[151]!==_||e[152]!==tt?(rt=(0,w.jsxs)(qe,{children:[_,tt]}),e[151]=_,e[152]=tt,e[153]=rt):rt=e[153];let it;e[154]===t?it=e[155]:(it=t({id:`ePK91l`}),e[154]=t,e[155]=it);let at;e[156]===it?at=e[157]:(at=(0,w.jsx)(Ye,{className:`px-2 py-1 text-xs font-normal`,children:it}),e[156]=it,e[157]=at);let ot;e[158]===Symbol.for(`react.memo_cache_sentinel`)?(ot=()=>l({kind:`role`,role:`undo`}),e[158]=ot):ot=e[158];let st;e[159]===t?st=e[160]:(st=t({id:`9uI_rE`}),e[159]=t,e[160]=st);let ct;e[161]===Symbol.for(`react.memo_cache_sentinel`)?(ct=(0,w.jsx)($,{children:`Ctrl+Z`}),e[161]=ct):ct=e[161];let lt;e[162]===st?lt=e[163]:(lt=(0,w.jsxs)(Z,{onSelect:ot,children:[st,ct]}),e[162]=st,e[163]=lt);let ut;e[164]===Symbol.for(`react.memo_cache_sentinel`)?(ut=()=>l({kind:`role`,role:`redo`}),e[164]=ut):ut=e[164];let dt;e[165]===t?dt=e[166]:(dt=t({id:`H3oH0g`}),e[165]=t,e[166]=dt);let ft;e[167]===Symbol.for(`react.memo_cache_sentinel`)?(ft=(0,w.jsx)($,{children:`Ctrl+Y`}),e[167]=ft):ft=e[167];let pt;e[168]===dt?pt=e[169]:(pt=(0,w.jsxs)(Z,{onSelect:ut,children:[dt,ft]}),e[168]=dt,e[169]=pt);let mt;e[170]===Symbol.for(`react.memo_cache_sentinel`)?(mt=(0,w.jsx)(Q,{}),e[170]=mt):mt=e[170];let ht;e[171]===Symbol.for(`react.memo_cache_sentinel`)?(ht=()=>l({kind:`role`,role:`cut`}),e[171]=ht):ht=e[171];let gt;e[172]===t?gt=e[173]:(gt=t({id:`cCd8Bs`}),e[172]=t,e[173]=gt);let _t;e[174]===Symbol.for(`react.memo_cache_sentinel`)?(_t=(0,w.jsx)($,{children:`Ctrl+X`}),e[174]=_t):_t=e[174];let vt;e[175]===gt?vt=e[176]:(vt=(0,w.jsxs)(Z,{onSelect:ht,children:[gt,_t]}),e[175]=gt,e[176]=vt);let yt;e[177]===Symbol.for(`react.memo_cache_sentinel`)?(yt=()=>l({kind:`role`,role:`copy`}),e[177]=yt):yt=e[177];let bt;e[178]===t?bt=e[179]:(bt=t({id:`he3ygx`}),e[178]=t,e[179]=bt);let xt;e[180]===Symbol.for(`react.memo_cache_sentinel`)?(xt=(0,w.jsx)($,{children:`Ctrl+C`}),e[180]=xt):xt=e[180];let St;e[181]===bt?St=e[182]:(St=(0,w.jsxs)(Z,{onSelect:yt,children:[bt,xt]}),e[181]=bt,e[182]=St);let Ct;e[183]===Symbol.for(`react.memo_cache_sentinel`)?(Ct=()=>l({kind:`role`,role:`paste`}),e[183]=Ct):Ct=e[183];let wt;e[184]===t?wt=e[185]:(wt=t({id:`HzVv6g`}),e[184]=t,e[185]=wt);let Tt;e[186]===Symbol.for(`react.memo_cache_sentinel`)?(Tt=(0,w.jsx)($,{children:`Ctrl+V`}),e[186]=Tt):Tt=e[186];let Et;e[187]===wt?Et=e[188]:(Et=(0,w.jsxs)(Z,{onSelect:Ct,children:[wt,Tt]}),e[187]=wt,e[188]=Et);let Dt;e[189]===Symbol.for(`react.memo_cache_sentinel`)?(Dt=()=>l({kind:`role`,role:`selectAll`}),e[189]=Dt):Dt=e[189];let Ot;e[190]===t?Ot=e[191]:(Ot=t({id:`mCB6Je`}),e[190]=t,e[191]=Ot);let kt;e[192]===Symbol.for(`react.memo_cache_sentinel`)?(kt=(0,w.jsx)($,{children:`Ctrl+A`}),e[192]=kt):kt=e[192];let At;e[193]===Ot?At=e[194]:(At=(0,w.jsxs)(Z,{onSelect:Dt,children:[Ot,kt]}),e[193]=Ot,e[194]=At);let jt;e[195]===Symbol.for(`react.memo_cache_sentinel`)?(jt=(0,w.jsx)(Q,{}),e[195]=jt):jt=e[195];let Mt=i?.spellCheckEnabled??!0,Nt;e[196]===Symbol.for(`react.memo_cache_sentinel`)?(Nt=()=>l({kind:`command`,command:`toggle-spell-check`}),e[196]=Nt):Nt=e[196];let Pt;e[197]===t?Pt=e[198]:(Pt=t({id:`ZgJVnp`}),e[197]=t,e[198]=Pt);let Ft;e[199]!==Mt||e[200]!==Pt?(Ft=(0,w.jsx)(Ze,{checked:Mt,onSelect:Nt,children:Pt}),e[199]=Mt,e[200]=Pt,e[201]=Ft):Ft=e[201];let It;e[202]!==St||e[203]!==Et||e[204]!==At||e[205]!==Ft||e[206]!==lt||e[207]!==pt||e[208]!==vt?(It=(0,w.jsxs)(Xe,{children:[lt,pt,mt,vt,St,Et,At,jt,Ft]}),e[202]=St,e[203]=Et,e[204]=At,e[205]=Ft,e[206]=lt,e[207]=pt,e[208]=vt,e[209]=It):It=e[209];let Lt;e[210]!==It||e[211]!==at?(Lt=(0,w.jsxs)(qe,{children:[at,It]}),e[210]=It,e[211]=at,e[212]=Lt):Lt=e[212];let Rt;e[213]===t?Rt=e[214]:(Rt=t({id:`jpctdh`}),e[213]=t,e[214]=Rt);let zt;e[215]===Rt?zt=e[216]:(zt=(0,w.jsx)(Ye,{className:`px-2 py-1 text-xs font-normal`,children:Rt}),e[215]=Rt,e[216]=zt);let Bt;e[217]===Symbol.for(`react.memo_cache_sentinel`)?(Bt=()=>l({kind:`role`,role:`reload`}),e[217]=Bt):Bt=e[217];let Vt;e[218]===t?Vt=e[219]:(Vt=t({id:`HpK_8d`}),e[218]=t,e[219]=Vt);let Ht;e[220]===Vt?Ht=e[221]:(Ht=(0,w.jsx)(Z,{onSelect:Bt,children:Vt}),e[220]=Vt,e[221]=Ht);let Ut;e[222]===Symbol.for(`react.memo_cache_sentinel`)?(Ut=()=>l({kind:`role`,role:`forceReload`}),e[222]=Ut):Ut=e[222];let Wt;e[223]===t?Wt=e[224]:(Wt=t({id:`2CHoQv`}),e[223]=t,e[224]=Wt);let Gt;e[225]===Wt?Gt=e[226]:(Gt=(0,w.jsx)(Z,{onSelect:Ut,children:Wt}),e[225]=Wt,e[226]=Gt);let Kt;e[227]!==t||e[228]!==i?.showDevToolsMenu?(Kt=i?.showDevToolsMenu===!0&&(0,w.jsx)(Z,{onSelect:()=>l({kind:`role`,role:`toggleDevTools`}),children:t({id:`pgDlbM`})}),e[227]=t,e[228]=i?.showDevToolsMenu,e[229]=Kt):Kt=e[229];let qt;e[230]===Symbol.for(`react.memo_cache_sentinel`)?(qt=(0,w.jsx)(Q,{}),e[230]=qt):qt=e[230];let Jt;e[231]===Symbol.for(`react.memo_cache_sentinel`)?(Jt=()=>l({kind:`menu-action`,action:`toggle-sidebar`}),e[231]=Jt):Jt=e[231];let Yt;e[232]!==t||e[233]!==p?.sidebarVisible?(Yt=p?.sidebarVisible===!1?t({id:`151wvk`}):t({id:`Q1mtyd`}),e[232]=t,e[233]=p?.sidebarVisible,e[234]=Yt):Yt=e[234];let Xt;e[235]===Symbol.for(`react.memo_cache_sentinel`)?(Xt=(0,w.jsx)($,{children:`Ctrl+Alt+S`}),e[235]=Xt):Xt=e[235];let Zt;e[236]===Yt?Zt=e[237]:(Zt=(0,w.jsxs)(Z,{onSelect:Jt,children:[Yt,Xt]}),e[236]=Yt,e[237]=Zt);let Qt;e[238]===Symbol.for(`react.memo_cache_sentinel`)?(Qt=()=>l({kind:`menu-action`,action:`toggle-doc-panel`}),e[238]=Qt):Qt=e[238];let $t;e[239]!==t||e[240]!==p?.docPanelVisible?($t=p?.docPanelVisible===!1?t({id:`fSRzLo`}):t({id:`GSYWCm`}),e[239]=t,e[240]=p?.docPanelVisible,e[241]=$t):$t=e[241];let en;e[242]===Symbol.for(`react.memo_cache_sentinel`)?(en=(0,w.jsx)($,{children:`Ctrl+Alt+B`}),e[242]=en):en=e[242];let tn;e[243]===$t?tn=e[244]:(tn=(0,w.jsxs)(Z,{onSelect:Qt,children:[$t,en]}),e[243]=$t,e[244]=tn);let nn;e[245]===Symbol.for(`react.memo_cache_sentinel`)?(nn=(0,w.jsx)(Q,{}),e[245]=nn):nn=e[245];let rn=p?.showHiddenFiles??!1,an;e[246]===Symbol.for(`react.memo_cache_sentinel`)?(an=()=>l({kind:`menu-action`,action:`toggle-show-hidden-files`}),e[246]=an):an=e[246];let on;e[247]===t?on=e[248]:(on=t({id:`XcGbim`}),e[247]=t,e[248]=on);let sn;e[249]===Symbol.for(`react.memo_cache_sentinel`)?(sn=(0,w.jsx)($,{children:`Ctrl+Shift+.`}),e[249]=sn):sn=e[249];let cn;e[250]!==rn||e[251]!==on?(cn=(0,w.jsxs)(Ze,{checked:rn,onSelect:an,children:[on,sn]}),e[250]=rn,e[251]=on,e[252]=cn):cn=e[252];let ln=p?.showOkFolders??!1,un;e[253]===Symbol.for(`react.memo_cache_sentinel`)?(un=()=>l({kind:`menu-action`,action:`toggle-show-ok-folders`}),e[253]=un):un=e[253];let dn;e[254]===t?dn=e[255]:(dn=t({id:`GHsJb8`}),e[254]=t,e[255]=dn);let fn;e[256]!==ln||e[257]!==dn?(fn=(0,w.jsx)(Ze,{checked:ln,onSelect:un,children:dn}),e[256]=ln,e[257]=dn,e[258]=fn):fn=e[258];let pn=p?.showOnlyMarkdownFiles??!1,mn;e[259]===Symbol.for(`react.memo_cache_sentinel`)?(mn=()=>l({kind:`menu-action`,action:`toggle-show-only-markdown-files`}),e[259]=mn):mn=e[259];let hn;e[260]===t?hn=e[261]:(hn=t({id:`WkTLN7`}),e[260]=t,e[261]=hn);let gn;e[262]!==pn||e[263]!==hn?(gn=(0,w.jsx)(Ze,{checked:pn,onSelect:mn,children:hn}),e[262]=pn,e[263]=hn,e[264]=gn):gn=e[264];let _n=p?.showSkillsSection??!0,vn;e[265]===Symbol.for(`react.memo_cache_sentinel`)?(vn=()=>l({kind:`menu-action`,action:`toggle-show-skills-section`}),e[265]=vn):vn=e[265];let yn;e[266]===t?yn=e[267]:(yn=t({id:`NF_Wcg`}),e[266]=t,e[267]=yn);let bn;e[268]!==_n||e[269]!==yn?(bn=(0,w.jsx)(Ze,{checked:_n,onSelect:vn,children:yn}),e[268]=_n,e[269]=yn,e[270]=bn):bn=e[270];let xn;e[271]===Symbol.for(`react.memo_cache_sentinel`)?(xn=(0,w.jsx)(Q,{}),e[271]=xn):xn=e[271];let Sn;e[272]!==t||e[273]!==p?.canExpandAll?(Sn=(p?.canExpandAll??!0)&&(0,w.jsx)(Z,{onSelect:()=>l({kind:`menu-action`,action:`expand-all-tree`}),children:t({id:`OlAl5i`})}),e[272]=t,e[273]=p?.canExpandAll,e[274]=Sn):Sn=e[274];let Cn;e[275]!==t||e[276]!==p?.canCollapseAll?(Cn=(p?.canCollapseAll??!0)&&(0,w.jsx)(Z,{onSelect:()=>l({kind:`menu-action`,action:`collapse-all-tree`}),children:t({id:`qvWGzP`})}),e[275]=t,e[276]=p?.canCollapseAll,e[277]=Cn):Cn=e[277];let wn;e[278]===Symbol.for(`react.memo_cache_sentinel`)?(wn=(0,w.jsx)(Q,{}),e[278]=wn):wn=e[278];let Tn;e[279]===Symbol.for(`react.memo_cache_sentinel`)?(Tn=()=>l({kind:`role`,role:`resetZoom`}),e[279]=Tn):Tn=e[279];let En;e[280]===t?En=e[281]:(En=t({id:`FF7V5K`}),e[280]=t,e[281]=En);let Dn;e[282]===En?Dn=e[283]:(Dn=(0,w.jsx)(Z,{onSelect:Tn,children:En}),e[282]=En,e[283]=Dn);let On;e[284]===Symbol.for(`react.memo_cache_sentinel`)?(On=()=>l({kind:`role`,role:`zoomIn`}),e[284]=On):On=e[284];let kn;e[285]===t?kn=e[286]:(kn=t({id:`Dz7fsq`}),e[285]=t,e[286]=kn);let An;e[287]===kn?An=e[288]:(An=(0,w.jsx)(Z,{onSelect:On,children:kn}),e[287]=kn,e[288]=An);let jn;e[289]===Symbol.for(`react.memo_cache_sentinel`)?(jn=()=>l({kind:`role`,role:`zoomOut`}),e[289]=jn):jn=e[289];let Mn;e[290]===t?Mn=e[291]:(Mn=t({id:`bbJ-VR`}),e[290]=t,e[291]=Mn);let Nn;e[292]===Mn?Nn=e[293]:(Nn=(0,w.jsx)(Z,{onSelect:jn,children:Mn}),e[292]=Mn,e[293]=Nn);let Pn;e[294]===Symbol.for(`react.memo_cache_sentinel`)?(Pn=(0,w.jsx)(Q,{}),e[294]=Pn):Pn=e[294];let Fn;e[295]===Symbol.for(`react.memo_cache_sentinel`)?(Fn=()=>l({kind:`role`,role:`toggleFullScreen`}),e[295]=Fn):Fn=e[295];let In;e[296]===t?In=e[297]:(In=t({id:`LTeJuX`}),e[296]=t,e[297]=In);let Ln;e[298]===Symbol.for(`react.memo_cache_sentinel`)?(Ln=(0,w.jsx)($,{children:`F11`}),e[298]=Ln):Ln=e[298];let Rn;e[299]===In?Rn=e[300]:(Rn=(0,w.jsxs)(Z,{onSelect:Fn,children:[In,Ln]}),e[299]=In,e[300]=Rn);let zn;e[301]!==Ht||e[302]!==Gt||e[303]!==Kt||e[304]!==Zt||e[305]!==tn||e[306]!==cn||e[307]!==fn||e[308]!==gn||e[309]!==bn||e[310]!==Sn||e[311]!==Cn||e[312]!==Dn||e[313]!==An||e[314]!==Nn||e[315]!==Rn?(zn=(0,w.jsxs)(Xe,{children:[Ht,Gt,Kt,qt,Zt,tn,nn,cn,fn,gn,bn,xn,Sn,Cn,wn,Dn,An,Nn,Pn,Rn]}),e[301]=Ht,e[302]=Gt,e[303]=Kt,e[304]=Zt,e[305]=tn,e[306]=cn,e[307]=fn,e[308]=gn,e[309]=bn,e[310]=Sn,e[311]=Cn,e[312]=Dn,e[313]=An,e[314]=Nn,e[315]=Rn,e[316]=zn):zn=e[316];let Bn;e[317]!==zt||e[318]!==zn?(Bn=(0,w.jsxs)(qe,{children:[zt,zn]}),e[317]=zt,e[318]=zn,e[319]=Bn):Bn=e[319];let Vn;e[320]===t?Vn=e[321]:(Vn=t({id:`T3Mld1`}),e[320]=t,e[321]=Vn);let Hn;e[322]===Vn?Hn=e[323]:(Hn=(0,w.jsx)(Ye,{className:`px-2 py-1 text-xs font-normal`,children:Vn}),e[322]=Vn,e[323]=Hn);let Un;e[324]===Symbol.for(`react.memo_cache_sentinel`)?(Un=()=>l({kind:`role`,role:`minimize`}),e[324]=Un):Un=e[324];let Wn;e[325]===t?Wn=e[326]:(Wn=t({id:`3TSz9S`}),e[325]=t,e[326]=Wn);let Gn;e[327]===Wn?Gn=e[328]:(Gn=(0,w.jsx)(Z,{onSelect:Un,children:Wn}),e[327]=Wn,e[328]=Gn);let Kn;e[329]===Symbol.for(`react.memo_cache_sentinel`)?(Kn=()=>l({kind:`role`,role:`close`}),e[329]=Kn):Kn=e[329];let qn;e[330]===t?qn=e[331]:(qn=t({id:`aRI3Om`}),e[330]=t,e[331]=qn);let Jn;e[332]===qn?Jn=e[333]:(Jn=(0,w.jsx)(Z,{onSelect:Kn,children:qn}),e[332]=qn,e[333]=Jn);let Yn;e[334]!==Gn||e[335]!==Jn?(Yn=(0,w.jsxs)(Xe,{children:[Gn,Jn]}),e[334]=Gn,e[335]=Jn,e[336]=Yn):Yn=e[336];let Xn;e[337]!==Hn||e[338]!==Yn?(Xn=(0,w.jsxs)(qe,{children:[Hn,Yn]}),e[337]=Hn,e[338]=Yn,e[339]=Xn):Xn=e[339];let Zn;e[340]===t?Zn=e[341]:(Zn=t({id:`c3XJ18`}),e[340]=t,e[341]=Zn);let Qn;e[342]===Zn?Qn=e[343]:(Qn=(0,w.jsx)(Ye,{className:`px-2 py-1 text-xs font-normal`,children:Zn}),e[342]=Zn,e[343]=Qn);let $n;e[344]===Symbol.for(`react.memo_cache_sentinel`)?($n=()=>l({kind:`command`,command:`open-github`}),e[344]=$n):$n=e[344];let er;e[345]===t?er=e[346]:(er=t({id:`LeGeTf`}),e[345]=t,e[346]=er);let tr;e[347]===er?tr=e[348]:(tr=(0,w.jsx)(Z,{onSelect:$n,children:er}),e[347]=er,e[348]=tr);let nr;e[349]===Symbol.for(`react.memo_cache_sentinel`)?(nr=()=>l({kind:`menu-action`,action:`report-bug`}),e[349]=nr):nr=e[349];let rr;e[350]===t?rr=e[351]:(rr=t({id:`ft-BOm`}),e[350]=t,e[351]=rr);let ir;e[352]===rr?ir=e[353]:(ir=(0,w.jsx)(Z,{onSelect:nr,children:rr}),e[352]=rr,e[353]=ir);let ar;e[354]===Symbol.for(`react.memo_cache_sentinel`)?(ar=()=>l({kind:`menu-action`,action:`send-feedback`}),e[354]=ar):ar=e[354];let or;e[355]===t?or=e[356]:(or=t({id:`_JOGC0`}),e[355]=t,e[356]=or);let sr;e[357]===or?sr=e[358]:(sr=(0,w.jsx)(Z,{onSelect:ar,children:or}),e[357]=or,e[358]=sr);let cr;e[359]!==t||e[360]!==i?.canCheckForUpdates?(cr=i?.canCheckForUpdates===!0&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Q,{}),(0,w.jsx)(Z,{onSelect:()=>l({kind:`command`,command:`check-for-updates`}),children:t({id:`3SZrdj`})})]}),e[359]=t,e[360]=i?.canCheckForUpdates,e[361]=cr):cr=e[361];let lr;e[362]!==tr||e[363]!==ir||e[364]!==sr||e[365]!==cr?(lr=(0,w.jsxs)(Xe,{children:[tr,ir,sr,cr]}),e[362]=tr,e[363]=ir,e[364]=sr,e[365]=cr,e[366]=lr):lr=e[366];let ur;e[367]!==Qn||e[368]!==lr?(ur=(0,w.jsxs)(qe,{children:[Qn,lr]}),e[367]=Qn,e[368]=lr,e[369]=ur):ur=e[369];let dr;return e[370]!==Lt||e[371]!==Bn||e[372]!==Xn||e[373]!==ur||e[374]!==rt?(dr=(0,w.jsxs)(Ke,{"data-testid":`app-menubar`,className:`h-auto rounded-none border-0 bg-transparent p-0 shadow-none [-webkit-app-region:no-drag]`,onValueChange:h,children:[rt,Lt,Bn,Xn,ur]}),e[370]=Lt,e[371]=Bn,e[372]=Xn,e[373]=ur,e[374]=rt,e[375]=dr):dr=e[375],dr}function nt(){}export{tt as AppMenubar};