@inkeep/open-knowledge 0.85.0-beta.9 → 0.85.0

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 (179) hide show
  1. package/dist/assets/skills/project/references/doc-editing.md +1 -3
  2. package/dist/cli.mjs +58 -58
  3. package/dist/constants-TNJVUahv.mjs +1 -0
  4. package/dist/{dist-C88EFTff.mjs → dist-4xO55Yaw.mjs} +1 -1
  5. package/dist/dist-Bkpf6l5f.mjs +2212 -0
  6. package/dist/index.d.mts +1 -33
  7. package/dist/index.mjs +209 -209
  8. package/dist/init-CVCNY4Ls.mjs +1 -0
  9. package/dist/{init-CFwaaZQ-.mjs → init-DkjNMYlz.mjs} +9 -9
  10. package/dist/{launch-json-removal-BcAHYoyt.mjs → launch-json-removal-a4E1YMn5.mjs} +1 -1
  11. package/dist/loader-DRmyM_aE.mjs +1 -0
  12. package/dist/{loader-CFx7vc0D.mjs → loader-ucwkbXZa.mjs} +1 -1
  13. package/dist/{md-manager-BGnqyqi1-BXD2ehDb.mjs → md-manager-BGnqyqi1-CDSS__qm.mjs} +125 -125
  14. package/dist/native/native-config.win32-arm64-msvc.node +0 -0
  15. package/dist/native/native-config.win32-x64-msvc.node +0 -0
  16. package/dist/{open-browser-Dz0M-5l3.mjs → open-browser-sLXj2Tjq.mjs} +1 -1
  17. package/dist/parse-worker.mjs +1 -1
  18. package/dist/{preview-CJh6sArT.mjs → preview-D_ZiJu7g.mjs} +1 -1
  19. package/dist/preview-Dcj4w_f3.mjs +1 -0
  20. package/dist/public/assets/{AccountSection-CG2r8-Qs.js → AccountSection-BEKd-tkM.js} +1 -1
  21. package/dist/public/assets/{ActivityModeContent-HehOebkF.js → ActivityModeContent-DrbbsE_-.js} +1 -1
  22. package/dist/public/assets/AddPropertiesButton-DoCpp2QW.js +2 -0
  23. package/dist/public/assets/{AgentConnectionsSection-PbNqCjhO.js → AgentConnectionsSection-BOlCjbB0.js} +1 -1
  24. package/dist/public/assets/{AgentDiffPane-DHmFKYZn.js → AgentDiffPane-CtNtZb9V.js} +1 -1
  25. package/dist/public/assets/{AttachmentsSection-Ca5Qus9h.js → AttachmentsSection-DackfQ_s.js} +1 -1
  26. package/dist/public/assets/{AuthModal-B97W2kBc.js → AuthModal-7ZC-1yVV.js} +1 -1
  27. package/dist/public/assets/{CodeMirrorPropInput-CVk_Tsyv.js → CodeMirrorPropInput-DvKu95Lo.js} +3 -3
  28. package/dist/public/assets/{ContentRulesSection-LXLGw7O3.js → ContentRulesSection-DtplCATO.js} +1 -1
  29. package/dist/public/assets/{DiffViewBoundary-CukzuN1M.js → DiffViewBoundary-Cue9UIPe.js} +1 -1
  30. package/dist/public/assets/{DocumentContext-DFJynlOa.js → DocumentContext-BH42QH54.js} +4 -4
  31. package/dist/public/assets/{EditorModeToggle-BD9i787Z.js → EditorModeToggle-DnKwTnbn.js} +1 -1
  32. package/dist/public/assets/{ExcalidrawDocEditor-D-3evzGG.js → ExcalidrawDocEditor-Bgw6T9Fb.js} +1 -1
  33. package/dist/public/assets/FeedbackForm-h13skg8D.js +1 -0
  34. package/dist/public/assets/{GraphPanel-CbRFSjv5.js → GraphPanel-BmqiikMo.js} +2 -2
  35. package/dist/public/assets/{ImageAttachments-DmZlAyNH.js → ImageAttachments-Dd_h_7LM.js} +1 -1
  36. package/dist/public/assets/{ImportSkillDialog-D2lc1CWn.js → ImportSkillDialog-C4_lHSx9.js} +1 -1
  37. package/dist/public/assets/{LinkPreviewsSection-BP0LAedR.js → LinkPreviewsSection-DQxmONPl.js} +1 -1
  38. package/dist/public/assets/{LintConfigEditor-Bgt3nQ2R.js → LintConfigEditor-BMxjC7yE.js} +1 -1
  39. package/dist/public/assets/{LintingSection-BL7qA0Pi.js → LintingSection-B-IUi1Qd.js} +1 -1
  40. package/dist/public/assets/ManagedArtifactProperties-Bl8aGLz1.js +1 -0
  41. package/dist/public/assets/{ManagedArtifactProperties-Cedhx9UL.js → ManagedArtifactProperties-Jf0t9Hbp.js} +1 -1
  42. package/dist/public/assets/{MermaidDocEditor-5tS_aeFO.js → MermaidDocEditor-CRbSyiuH.js} +1 -1
  43. package/dist/public/assets/{NetworkAccessSection-BR8esyMq.js → NetworkAccessSection-DJggS7b-.js} +1 -1
  44. package/dist/public/assets/{OkignoreSection-Dg2isYSX.js → OkignoreSection-DYAQ4Haz.js} +1 -1
  45. package/dist/public/assets/{PageListContext-B4oUr1KZ.js → PageListContext-DgTeRFU-.js} +1 -1
  46. package/dist/public/assets/{ProjectTemplatesSection-BQRFn0aR.js → ProjectTemplatesSection-oiahzFKw.js} +1 -1
  47. package/dist/public/assets/{PropertyDisplayRow-B8FjzrNw.js → PropertyDisplayRow-D4PvPcj8.js} +1 -1
  48. package/dist/public/assets/{PublishToGitHubDialog-BKjAxV6J.js → PublishToGitHubDialog-DW5fQKKa.js} +1 -1
  49. package/dist/public/assets/{RegisteredAgentIcon-CNf09bvo.js → RegisteredAgentIcon-DKZ8eOKZ.js} +1 -1
  50. package/dist/public/assets/{ReportBugDialogBody-DokEvc7U.js → ReportBugDialogBody-DoHfZBJP.js} +1 -1
  51. package/dist/public/assets/{ReportBugMenuTrigger-BSorqVCo.js → ReportBugMenuTrigger-B7ha_vzT.js} +1 -1
  52. package/dist/public/assets/{SchemaConfigEditor-DOKFePh9.js → SchemaConfigEditor-NA0BTi-e.js} +1 -1
  53. package/dist/public/assets/{SearchSection-C-J0Eo03.js → SearchSection-Cr2ZiTwI.js} +1 -1
  54. package/dist/public/assets/{SessionsHost-YC-zHDRd.js → SessionsHost-DFL-snqS.js} +2 -2
  55. package/dist/public/assets/{SettingsDialogBody-TlFN9JdS.js → SettingsDialogBody-M1HGNylA.js} +2 -2
  56. package/dist/public/assets/{ShareBranchSwitchDialog-BVpHAvAz.js → ShareBranchSwitchDialog-BqfHGl0s.js} +1 -1
  57. package/dist/public/assets/{ShareReceiveDialog-DuE0Io5t.js → ShareReceiveDialog-CxPIsiXq.js} +1 -1
  58. package/dist/public/assets/{ShareReceiveMissDialog-Do5dD2in.js → ShareReceiveMissDialog-BxMzxo4C.js} +1 -1
  59. package/dist/public/assets/{SkillCostValue-BAFvtN-A.js → SkillCostValue-DPX8ruMM.js} +1 -1
  60. package/dist/public/assets/{SkillForkDialog-DK0im2ZH.js → SkillForkDialog-BB_XS1nP.js} +1 -1
  61. package/dist/public/assets/{SkillInstallMenu-BVEHbRUy.js → SkillInstallMenu-CAjgsxCn.js} +1 -1
  62. package/dist/public/assets/{SkillOriginInline-CeyDfqua.js → SkillOriginInline-D1tWqOqr.js} +1 -1
  63. package/dist/public/assets/{SkillToolbarControls-Ccl_Jfw7.js → SkillToolbarControls-BnM0BcVL.js} +1 -1
  64. package/dist/public/assets/{SkillsManagerSection-BY_rUJ96.js → SkillsManagerSection-B0OJHWNm.js} +1 -1
  65. package/dist/public/assets/{SlidesPluginSection-qj2ynzJw.js → SlidesPluginSection-Bi8J2lVH.js} +1 -1
  66. package/dist/public/assets/{SlidesToolbarControls-OD5hTRCr.js → SlidesToolbarControls-CqXBuf70.js} +1 -1
  67. package/dist/public/assets/SourceEditor-DdxSAmDx.js +1 -0
  68. package/dist/public/assets/{SpellingSettings-BvzNDT7g.js → SpellingSettings-Dkdy9B2q.js} +1 -1
  69. package/dist/public/assets/{SyncSection-DnePgTtR.js → SyncSection-DH3epVLR.js} +1 -1
  70. package/dist/public/assets/{SyncStatusBadge-D0Z90-xO.js → SyncStatusBadge-DrRCeCvZ.js} +1 -1
  71. package/dist/public/assets/{TemplateRow-PUB19e3g.js → TemplateRow-DoNZxhIJ.js} +1 -1
  72. package/dist/public/assets/{TerminalLaunchContext-DncO203O.js → TerminalLaunchContext-Cwrrh5Ck.js} +1 -1
  73. package/dist/public/assets/{TerminalPanel-CNyrqROa.js → TerminalPanel-C5LSq4fA.js} +1 -1
  74. package/dist/public/assets/{TerminalSection-DyK2U5kL.js → TerminalSection-DU8swJ-Q.js} +1 -1
  75. package/dist/public/assets/{TerminalWindowApp-ETV5UU_J.js → TerminalWindowApp-CeS0EeFD.js} +1 -1
  76. package/dist/public/assets/{TextDocEditor-BRSxslRl.js → TextDocEditor-DR9-rMdW.js} +1 -1
  77. package/dist/public/assets/{ThemePluginSection-C4i43nY3.js → ThemePluginSection-BT1NQe1R.js} +2 -2
  78. package/dist/public/assets/{ThreadView-CiIFLTxC.js → ThreadView-Cp69nJvv.js} +5 -5
  79. package/dist/public/assets/{TimelineDiffPane-CWm8SIED.js → TimelineDiffPane-BfAbyPCH.js} +1 -1
  80. package/dist/public/assets/_envelope-g8Le8UBe-6j_3zVcA.js +1 -0
  81. package/dist/public/assets/{agent-connections-Dj9-89rY.js → agent-connections-CykO_Ezy.js} +1 -1
  82. package/dist/public/assets/{agent-registry-CUdBP9oP.js → agent-registry-pREadnY_.js} +1 -1
  83. package/dist/public/assets/{bridge-D0M08jrS.js → bridge-D8Oy74FE.js} +3 -3
  84. package/dist/public/assets/{card-13ChSYBD.js → card-DJoKetZ9.js} +1 -1
  85. package/dist/public/assets/{catalog-eC0BYrwO.js → catalog-CJ_rs_wb.js} +1 -1
  86. package/dist/public/assets/{client-version-39luss9E.js → client-version-09D8u2lP.js} +1 -1
  87. package/dist/public/assets/{comment-chips-qRWl23Um.js → comment-chips-aOK6IXhP.js} +2 -2
  88. package/dist/public/assets/{config-provider-DnB2mziM.js → config-provider-m9Ao-f9D.js} +2 -2
  89. package/dist/public/assets/config-schema-Dh_H8E-u.js +1 -0
  90. package/dist/public/assets/{css-color-to-hex-9GaMLm_g.js → css-color-to-hex-Cjxd2Xbp.js} +1 -1
  91. package/dist/public/assets/{diagnostic-breadcrumb-DPgUDxA8.js → diagnostic-breadcrumb-Cr0C15nJ.js} +1 -1
  92. package/dist/public/assets/{doc-undo-manager-CXacfter.js → doc-undo-manager-BNDPNoYq.js} +1 -1
  93. package/dist/public/assets/field-controls-C6S4B1Im.js +1 -0
  94. package/dist/public/assets/{field-controls-Dzoda-yy.js → field-controls-DSwLWrMh.js} +1 -1
  95. package/dist/public/assets/{file-tree-adapter-0APd5Uqe.js → file-tree-adapter-BeSKxnyg.js} +1 -1
  96. package/dist/public/assets/{file-tree-utils-BPUSn1l0.js → file-tree-utils-DUpeRMj2.js} +1 -1
  97. package/dist/public/assets/folder-config-api-Db5-uEQR.js +1 -0
  98. package/dist/public/assets/{frontmatter-tags-BEkbJ1mW.js → frontmatter-tags-CoOxl3mC.js} +1 -1
  99. package/dist/public/assets/{handoff-Ccrokk1b.js → handoff-pwpLEUcJ.js} +1 -1
  100. package/dist/public/assets/index-EQxoHYsz.js +2205 -0
  101. package/dist/public/assets/{lint-config-client-DNaT4xzp.js → lint-config-client-DDZrpVHz.js} +1 -1
  102. package/dist/public/assets/{lint-plugins-C8VmU9DI.js → lint-plugins-DjZCf7i3.js} +1 -1
  103. package/dist/public/assets/{markdown-lint-Bm1176Wf.js → markdown-lint-DeZBsw3J.js} +3 -3
  104. package/dist/public/assets/{markdownlint-rule-browser-0hwXUugA.js → markdownlint-rule-browser-60Esn3tM.js} +1 -1
  105. package/dist/public/assets/{navigation-targets-CcY2FHJZ.js → navigation-targets-DTSxcGor.js} +1 -1
  106. package/dist/public/assets/{page-list-cache-B9RqU_KB.js → page-list-cache-BNFVKu-D.js} +1 -1
  107. package/dist/public/assets/parse-api-error-B5EVRh3T.js +1 -0
  108. package/dist/public/assets/{pending-receive-nav-store-BenGT9wQ.js → pending-receive-nav-store-CTKqE4f9.js} +1 -1
  109. package/dist/public/assets/{perf-CPPbaRwr.js → perf-DZJpLc5j.js} +1 -1
  110. package/dist/public/assets/{preferred-session-events-zRxp_tOs.js → preferred-session-events-D3VKdVs1.js} +1 -1
  111. package/dist/public/assets/{progress-CS1blVQx.js → progress-BUhjQpqL.js} +4 -4
  112. package/dist/public/assets/{receive-store-CnWTih4w.js → receive-store-O9cRwWtJ.js} +1 -1
  113. package/dist/public/assets/saved-themes-client-ByYw6oZt.js +1 -0
  114. package/dist/public/assets/{schema-section-DFiSaK5s.js → schema-section-C8DGjvNX.js} +1 -1
  115. package/dist/public/assets/schemas-api-CQHNNDP6.js +112 -0
  116. package/dist/public/assets/{selection-context-BeooMmdV.js → selection-context-CXQ2g-vC.js} +1 -1
  117. package/dist/public/assets/{skills-api-B9YEcMtk.js → skills-api-B7NWq2mZ.js} +1 -1
  118. package/dist/public/assets/{src-CqFS9uJd.js → src-BW92GkqF.js} +1 -1
  119. package/dist/public/assets/{startup-marks-YB3zPCjL.js → startup-marks-aftNzVFI.js} +1 -1
  120. package/dist/public/assets/storage-scope-lp6Y3sn1.js +1 -0
  121. package/dist/public/assets/{tag-pill-input-CUjBNOlr.js → tag-pill-input-C9tJ_ebG.js} +1 -1
  122. package/dist/public/assets/{target-navigation-intent-OCgrT_rG.js → target-navigation-intent-D7IZjXLN.js} +1 -1
  123. package/dist/public/assets/{telemetry-impl-BAzapNXh.js → telemetry-impl-BGTG-dVN.js} +1 -1
  124. package/dist/public/assets/{telemetry-startup-CR8NeOjR.js → telemetry-startup-Dnz5Cf32.js} +1 -1
  125. package/dist/public/assets/terminal-cli-display-Bn8rI2FY.js +1 -0
  126. package/dist/public/assets/{terminal-command-events-YJjbnpwG.js → terminal-command-events-DYVYsw0p.js} +1 -1
  127. package/dist/public/assets/{terminal-launch-events-C_GWUJjY.js → terminal-launch-events-C1I24zal.js} +1 -1
  128. package/dist/public/assets/{typing-burst-detector-Xqzi7ST5.js → typing-burst-detector-DiJWNHNK.js} +3 -3
  129. package/dist/public/assets/{use-activity-panel-BsfWTJSO.js → use-activity-panel-ZGbJVtoL.js} +1 -1
  130. package/dist/public/assets/{use-apply-config-color-theme-D0H8BLH0.js → use-apply-config-color-theme-B9f6n0Cd.js} +2 -2
  131. package/dist/public/assets/{use-conflicts-CIO4TSqq.js → use-conflicts-BJFBAg9M.js} +1 -1
  132. package/dist/public/assets/{use-installed-clis-CTgVOGN1.js → use-installed-clis-98lB00dU.js} +2 -2
  133. package/dist/public/assets/{use-live-xterm-theme-D4ySF_-p.js → use-live-xterm-theme-CMmPbV7u.js} +1 -1
  134. package/dist/public/assets/{use-open-skill-CfupAuPn.js → use-open-skill-Nru-PAlE.js} +1 -1
  135. package/dist/public/assets/{use-semantic-search-status-CRBCNkG6.js → use-semantic-search-status-Cqw3SIgk.js} +1 -1
  136. package/dist/public/assets/{use-skill-origin-C4Hj71IE.js → use-skill-origin-f6iU7bK5.js} +1 -1
  137. package/dist/public/assets/{use-skill-targets-9Csbq0fG.js → use-skill-targets-CcZTp1aJ.js} +1 -1
  138. package/dist/public/assets/{use-skills-BzbDGc60.js → use-skills-D4I9tjyB.js} +1 -1
  139. package/dist/public/assets/{use-terminal-enabled-DdabpKlf.js → use-terminal-enabled-DnnXtaEs.js} +1 -1
  140. package/dist/public/assets/use-timeline-entry-diff-Bu0jft5W.js +5 -0
  141. package/dist/public/assets/{use-workspace-eebQ7TvN.js → use-workspace-CF2-WOaH.js} +1 -1
  142. package/dist/public/index.html +70 -70
  143. package/dist/{registry-probes-BCy41PAR.mjs → registry-probes-CRUm2aMY.mjs} +3 -3
  144. package/dist/{removal-file-path-CN9lqjya.mjs → removal-file-path-DVMcCry_.mjs} +1 -1
  145. package/dist/{repair-launch-json-CKQ_cwwk.mjs → repair-launch-json-DOfAd3oZ.mjs} +1 -1
  146. package/dist/{repair-mcp-configs-BKiZHPqd.mjs → repair-mcp-configs-C4c5EcIG.mjs} +1 -1
  147. package/dist/src-CNTwiJdN.mjs +14 -0
  148. package/dist/src-DkLULCOE.mjs +1 -0
  149. package/dist/start-C3Psdi4z.mjs +1 -0
  150. package/dist/{start-BiUXIeg2.mjs → start-DxGMMch9.mjs} +3 -3
  151. package/package.json +4 -4
  152. package/dist/constants-D2kF20bT.mjs +0 -1
  153. package/dist/dist-Dizk2k7y.mjs +0 -2212
  154. package/dist/init-78TjO2II.mjs +0 -1
  155. package/dist/loader-BA1bY4d-.mjs +0 -1
  156. package/dist/preview-MrvaP-vW.mjs +0 -1
  157. package/dist/public/assets/AddPropertiesButton-BnDKNUPA.js +0 -2
  158. package/dist/public/assets/FeedbackForm-Babro2gk.js +0 -1
  159. package/dist/public/assets/ManagedArtifactProperties-CC7bF1k-.js +0 -1
  160. package/dist/public/assets/SourceEditor-DNJvmU9V.js +0 -1
  161. package/dist/public/assets/_envelope-DwyyiIO_-B2czcEJX.js +0 -1
  162. package/dist/public/assets/config-schema-C_UAFDLp.js +0 -1
  163. package/dist/public/assets/field-controls-nUgQuwqO.js +0 -1
  164. package/dist/public/assets/folder-config-api-CVKiiPvW.js +0 -1
  165. package/dist/public/assets/index-TvGWoqhF.js +0 -2205
  166. package/dist/public/assets/parse-api-error-CeEVOj25.js +0 -1
  167. package/dist/public/assets/saved-themes-client-DfS9q8l3.js +0 -1
  168. package/dist/public/assets/schemas-api-DbKS2FSh.js +0 -112
  169. package/dist/public/assets/storage-scope-DTSZLReS.js +0 -1
  170. package/dist/public/assets/terminal-cli-display-Dfy7Rj7j.js +0 -1
  171. package/dist/public/assets/use-timeline-entry-diff-CJZV0Tej.js +0 -5
  172. package/dist/src-CyP2DucS.mjs +0 -1
  173. package/dist/src-nTy7Bzbn.mjs +0 -14
  174. package/dist/start-CHpCT2fY.mjs +0 -1
  175. /package/dist/public/assets/{constants-github-B7yhDvQc.js → constants-github-DOek7bCt.js} +0 -0
  176. /package/dist/public/assets/{doc-extensions-CcO7K8uD-DG9uHV54.js → doc-extensions-CcO7K8uD-B004ggqh.js} +0 -0
  177. /package/dist/public/assets/{logging-renderer-log-CqIZVUIQ.js → logging-renderer-log-Bvxj7ztp.js} +0 -0
  178. /package/dist/public/assets/{share-D-LUU2aX-B7Yg0G_m.js → share-D-LUU2aX-DfD-mrg-.js} +0 -0
  179. /package/dist/public/assets/{util-doc-name-DRKmy6g9.js → util-doc-name-D-_o-n0R.js} +0 -0
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import{n as s}from"./AgentIconCluster-Qf_VPGzc.js";import{t as c}from"./dist-CSCUSbQc.js";import{t as l}from"./checkbox-CKD8LETI.js";import{t as u}from"./label-CvMpFFbN.js";import{i as d,n as ee,o as te,s as ne,t as re}from"./select-Bu4Wm3Rf.js";import{t as ie}from"./button-DzgjsZzC.js";import{n as f}from"./dist-BGzUo_18.js";import{n as ae}from"./constants-editors-DLxv8SuP.js";import{t as oe}from"./spinner-Bx8xD6f8.js";import{a as se}from"./SkillInstallMenu-BVEHbRUy.js";import{a as ce,c as le,i as ue,n as de,o as fe,s as pe,t as me}from"./dialog-BJEjKJjL.js";import{p as he,r as ge,t as _e}from"./skill-scope-N3jmnGIX.js";import{h as ve,i as ye,p as be,x as xe}from"./skills-api-B9YEcMtk.js";import{a as Se,i as Ce,t as we}from"./popover-BhiLJhH5.js";import{t as Te}from"./use-skills-BzbDGc60.js";import{t as Ee}from"./use-skill-targets-9Csbq0fG.js";var p=a(),m=e(n(),1),h=t();function g(e){let t=(0,p.c)(2);if(!e.bundle)return null;let n;return t[0]===e?n=t[1]:(n=(0,h.jsx)(_,{...e,bundle:e.bundle}),t[0]=e,t[1]=n),n}function _(e){let t=(0,p.c)(118),{bundle:n,source:a,defaultScope:o,installOverride:c,onInstalled:g,onOpenChange:_,returnFocus:v}=e,{_:y}=i(),Ne=(0,m.useId)(),Pe=he(),[b,Fe]=(0,m.useState)(c?.scope??o),Ie;t[0]!==n.names||t[1]!==c?(Ie=()=>c?new Set(n.names):new Set,t[0]=n.names,t[1]=c,t[2]=Ie):Ie=t[2];let[x,Le]=(0,m.useState)(Ie),[S,Re]=(0,m.useState)(!1),ze;t[3]===n.descriptions?ze=t[4]:(ze=()=>new Map(Object.entries(n.descriptions??{})),t[3]=n.descriptions,t[4]=ze);let[Be,Ve]=(0,m.useState)(ze),C=Ee(),[He,Ue]=(0,m.useState)(null),We=C.state.status===`ready`?C.state.data.targets:null,Ge;t[5]!==We||t[6]!==He?(Ge=He??new Set(We??[]),t[5]=We,t[6]=He,t[7]=Ge):Ge=t[7];let w=Ge,T=Te(),Ke=T.status===`ready`?T.data.find(e=>e.scope===b)?.installableEditors:void 0,qe=se.filter(e=>!Ke||Ke.includes(e)||w.has(e)),Je;t[8]!==b||t[9]!==T.data||t[10]!==T.status?(Je=T.status===`ready`?new Set(T.data.filter(e=>e.scope===b).map(Me)):new Set,t[8]=b,t[9]=T.data,t[10]=T.status,t[11]=Je):Je=t[11];let E=Je,Ye;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(Ye=new Set,t[12]=Ye):Ye=t[12];let[D,Xe]=(0,m.useState)(Ye),Ze=new Set;if(C.state.status===`ready`){let e;t[13]===C.state.data.folders?e=t[14]:(e=C.state.data.folders??[],t[13]=C.state.data.folders,t[14]=e);for(let t of e)t.scope===b&&(se.includes(t.host)||t.root&&Ze.add(t.root))}if(T.status===`ready`){for(let e of T.data)if(e.scope===b)for(let t of e.customPlacements??[]){let e=ge(t);e&&Ze.add(e)}}let Qe=[...Ze].sort(),$e=c!==void 0,et,tt;t[15]!==a||t[16]!==$e?(et=()=>{if($e)return;let e=new AbortController;return ye(a,e.signal).then(t=>{e.signal.aborted||!t.ok||Ve(new Map(t.skills.map(je)))}),()=>e.abort()},tt=[a,$e],t[15]=a,t[16]=$e,t[17]=et,t[18]=tt):(et=t[17],tt=t[18]),(0,m.useEffect)(et,tt);let{plugin:O,names:k}=n,nt;if(t[19]!==E||t[20]!==k){let e;t[22]===E?e=t[23]:(e=e=>!E.has(e),t[22]=E,t[23]=e),nt=k.filter(e),t[19]=E,t[20]=k,t[21]=nt}else nt=t[21];let A=nt,j=x.size===A.length&&A.length>0,rt;t[24]===x?rt=t[25]:(rt=function(e,t){let n=new Set(x);t?n.add(e):n.delete(e),Le(n)},t[24]=x,t[25]=rt);let it=rt,at;t[26]!==y||t[27]!==D||t[28]!==w||t[29]!==c||t[30]!==g||t[31]!==_||t[32]!==O||t[33]!==b||t[34]!==x||t[35]!==a?(at=async function(){if(Re(!0),c){let e=await c.installSelected([...x]);if(Re(!1),e===null)return;e.size>0&&g?.(e),_(!1);return}let e=await be({source:a,skills:[...x],scope:b,install:!1,marketplace:!0});if(!e.ok){Re(!1),f.error(y({id:`Lbl6KA`,values:{0:O??a,1:e.error}}));return}let t=e.results.map(Ae).filter(ke),n=[...w];if(n.length>0)for(let e of t){let t=await ve({scope:b,name:e,targets:n,linkMode:!0});t.ok||f.error(y({id:`1oSHI0`,values:{0:t.error,skillName:e}}))}for(let e of D)for(let n of t){let t=await xe({scope:b,name:n,dir:e,mode:`link`});t.ok||f.error(y({id:`OkC7-2`,values:{0:t.error,skillName:n,root:e}}))}Re(!1);let{imported:r,alreadyImported:i,failed:o}=e;if(o>0){let t=e.results.filter(Oe).map(De).join(`, `);f.error(y({id:`cMMb6H`,values:{imported:r,failed:o,failedNames:t}}))}else r===0?f.info(y({id:`uJfwF8`})):i>0?f.success(y({id:`tkIXtS`,values:{imported:r,alreadyImported:i}})):f.success(y({id:`-kKdCC`,values:{0:O??a,imported:r}}));let s=new Map;for(let t of e.results)t.status!==`imported`&&t.status!==`already-imported`||s.set(t.requested,t.name??t.requested);s.size>0&&g?.(s),_(!1)},t[26]=y,t[27]=D,t[28]=w,t[29]=c,t[30]=g,t[31]=_,t[32]=O,t[33]=b,t[34]=x,t[35]=a,t[36]=at):at=t[36];let ot=at,st=me,M;t[37]!==S||t[38]!==_?(M=e=>{!e&&!S&&_(!1)},t[37]=S,t[38]=_,t[39]=M):M=t[39];let ct=ue,N;t[40]===v?N=t[41]:(N=e=>{v&&(e.preventDefault(),v())},t[40]=v,t[41]=N);let P;t[42]!==O||t[43]!==a?(P=(0,h.jsx)(le,{children:O?(0,h.jsx)(r,{id:`J86siq`,values:{plugin:O}}):(0,h.jsx)(r,{id:`Q-DKvr`,values:{source:a}})}),t[42]=O,t[43]=a,t[44]=P):P=t[44];let F;t[45]===O?F=t[46]:(F=(0,h.jsx)(ce,{children:O?(0,h.jsx)(r,{id:`lj4cNf`}):(0,h.jsx)(r,{id:`4mDIcg`})}),t[45]=O,t[46]=F);let I;t[47]!==P||t[48]!==F?(I=(0,h.jsxs)(pe,{children:[P,F]}),t[47]=P,t[48]=F,t[49]=I):I=t[49];let lt=de,L;t[50]!==A.length||t[51]!==x.size?(L=(0,h.jsx)(`p`,{className:`font-medium text-xs font-mono text-foreground/70 uppercase tracking-wider`,children:(0,h.jsx)(r,{id:`lUtr1r`,values:{0:x.size,1:A.length}})}),t[50]=A.length,t[51]=x.size,t[52]=L):L=t[52];let R;t[53]!==j||t[54]!==A?(R=()=>Le(j?new Set:new Set(A)),t[53]=j,t[54]=A,t[55]=R):R=t[55];let z;t[56]===j?z=t[57]:(z=j?(0,h.jsx)(r,{id:`xCJdfg`}):(0,h.jsx)(r,{id:`wgNoIs`}),t[56]=j,t[57]=z);let B;t[58]!==S||t[59]!==R||t[60]!==z?(B=(0,h.jsx)(ie,{variant:`ghost`,size:`sm`,disabled:S,onClick:R,children:z}),t[58]=S,t[59]=R,t[60]=z,t[61]=B):B=t[61];let V;t[62]!==L||t[63]!==B?(V=(0,h.jsxs)(`div`,{className:`flex items-center justify-between`,children:[L,B]}),t[62]=L,t[63]=B,t[64]=V):V=t[64];let H;if(t[65]!==S||t[66]!==Be||t[67]!==E||t[68]!==k||t[69]!==x||t[70]!==it){let e;t[72]!==S||t[73]!==Be||t[74]!==E||t[75]!==x||t[76]!==it?(e=e=>{let t=Be.get(e),n=E.has(e);return(0,h.jsxs)(u,{className:`flex cursor-pointer items-start gap-3 p-3 text-sm font-normal hover:bg-muted/40`,children:[(0,h.jsx)(l,{checked:n||x.has(e),disabled:S||n,onCheckedChange:t=>it(e,t===!0),className:`mt-0.5`}),(0,h.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,h.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,h.jsx)(`span`,{className:`font-mono`,children:e}),n?(0,h.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground uppercase tracking-wide`,children:(0,h.jsx)(r,{id:`eQkgKV`})}):null]}),t?(0,h.jsx)(`span`,{className:`text-1sm text-muted-foreground line-clamp-2`,children:t}):null]})]},e)},t[72]=S,t[73]=Be,t[74]=E,t[75]=x,t[76]=it,t[77]=e):e=t[77],H=k.map(e),t[65]=S,t[66]=Be,t[67]=E,t[68]=k,t[69]=x,t[70]=it,t[71]=H}else H=t[71];let U;t[78]===H?U=t[79]:(U=(0,h.jsx)(`div`,{className:`max-h-72 overflow-y-auto rounded-md border border-border divide-y divide-border`,children:H}),t[78]=H,t[79]=U);let W;t[80]===b?W=t[81]:(W=b===`project`?(0,h.jsx)(r,{id:`oVW7VD`}):(0,h.jsx)(r,{id:`7HY6fA`}),t[80]=b,t[81]=W);let ut=$e?null:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`span`,{"aria-hidden":!0,children:`·`}),w.size+D.size>0?(0,h.jsx)(s,{hosts:[...w,...D],iconClassName:`size-3.5`}):(0,h.jsx)(r,{id:`poAsUN`}),(0,h.jsxs)(we,{children:[(0,h.jsx)(Se,{asChild:!0,children:(0,h.jsx)(ie,{variant:`link`,size:`sm`,className:`h-auto px-1`,disabled:S,"data-testid":`plugin-bundle-change-destination`,children:(0,h.jsx)(r,{id:`o-XJ9D`})})}),(0,h.jsxs)(Ce,{align:`start`,className:`flex w-72 flex-col gap-4`,children:[(0,h.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,h.jsx)(u,{htmlFor:Ne,children:(0,h.jsx)(r,{id:`7MSbAT`})}),(0,h.jsxs)(re,{value:b,disabled:S,onValueChange:e=>Fe(e),children:[(0,h.jsx)(te,{id:Ne,className:`w-full`,children:(0,h.jsx)(ne,{})}),(0,h.jsx)(ee,{children:_e.map(e=>(0,h.jsx)(d,{value:e,children:Pe[e]},e))})]})]}),(0,h.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,h.jsx)(u,{children:(0,h.jsx)(r,{id:`Y5la_5`})}),(0,h.jsxs)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-2`,children:[qe.map(e=>(0,h.jsxs)(u,{className:`flex cursor-pointer items-center gap-2 text-sm font-normal`,children:[(0,h.jsx)(l,{checked:w.has(e),disabled:S,onCheckedChange:t=>{let n=new Set(w);t===!0?n.add(e):n.delete(e),Ue(n)}}),ae[e]??e]},e)),Qe.map(e=>(0,h.jsxs)(u,{className:`flex cursor-pointer items-center gap-2 font-normal text-sm`,children:[(0,h.jsx)(l,{checked:D.has(e),disabled:S,onCheckedChange:t=>{let n=new Set(D);t===!0?n.add(e):n.delete(e),Xe(n)}}),(0,h.jsx)(`span`,{className:`font-mono text-xs`,children:e})]},e))]})]})]})]})]}),G;t[82]!==W||t[83]!==ut?(G=(0,h.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 text-1sm text-muted-foreground`,"data-testid":`plugin-bundle-destination`,children:[W,ut]}),t[82]=W,t[83]=ut,t[84]=G):G=t[84];let K;t[85]!==lt||t[86]!==V||t[87]!==U||t[88]!==G?(K=(0,h.jsxs)(lt,{className:`flex flex-col gap-4`,children:[V,U,G]}),t[85]=lt,t[86]=V,t[87]=U,t[88]=G,t[89]=K):K=t[89];let q;t[90]===_?q=t[91]:(q=()=>_(!1),t[90]=_,t[91]=q);let dt;t[92]===Symbol.for(`react.memo_cache_sentinel`)?(dt=(0,h.jsx)(r,{id:`dEgA5A`}),t[92]=dt):dt=t[92];let J;t[93]!==S||t[94]!==q?(J=(0,h.jsx)(ie,{variant:`outline`,disabled:S,onClick:q,children:dt}),t[93]=S,t[94]=q,t[95]=J):J=t[95];let ft=S||x.size===0,Y;t[96]===ot?Y=t[97]:(Y=()=>void ot(),t[96]=ot,t[97]=Y);let X;t[98]!==S||t[99]!==x.size?(X=S?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(oe,{"aria-hidden":`true`,className:`size-4`}),(0,h.jsx)(r,{id:`Wtw22s`})]}):x.size===0?(0,h.jsx)(r,{id:`TKQ7K-`}):(0,h.jsx)(r,{id:`9XwoPv`,values:{0:x.size}}),t[98]=S,t[99]=x.size,t[100]=X):X=t[100];let Z;t[101]!==ft||t[102]!==Y||t[103]!==X?(Z=(0,h.jsx)(ie,{"data-testid":`plugin-bundle-install`,disabled:ft,onClick:Y,children:X}),t[101]=ft,t[102]=Y,t[103]=X,t[104]=Z):Z=t[104];let Q;t[105]!==J||t[106]!==Z?(Q=(0,h.jsxs)(fe,{children:[J,Z]}),t[105]=J,t[106]=Z,t[107]=Q):Q=t[107];let $;t[108]!==ct||t[109]!==N||t[110]!==I||t[111]!==K||t[112]!==Q?($=(0,h.jsxs)(ct,{className:`sm:max-w-lg`,onCloseAutoFocus:N,children:[I,K,Q]}),t[108]=ct,t[109]=N,t[110]=I,t[111]=K,t[112]=Q,t[113]=$):$=t[113];let pt;return t[114]!==st||t[115]!==M||t[116]!==$?(pt=(0,h.jsx)(st,{open:!0,onOpenChange:M,children:$}),t[114]=st,t[115]=M,t[116]=$,t[117]=pt):pt=t[117],pt}function De(e){return e.requested}function Oe(e){return e.status===`failed`||e.status===`not-found`}function ke(e){return typeof e==`string`}function Ae(e){return e.name}function je(e){return[e.name,e.description]}function Me(e){return e.name}function v(e){let t=(0,p.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,size:i,asChild:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let s=i===void 0?`default`:i,l=a!==void 0&&a?c:`div`,u;t[5]===n?u=t[6]:(u=o(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,n),t[5]=n,t[6]=u);let d;return t[7]!==l||t[8]!==r||t[9]!==s||t[10]!==u?(d=(0,h.jsx)(l,{"data-slot":`card`,"data-size":s,className:u,...r}),t[7]=l,t[8]=r,t[9]=s,t[10]=u,t[11]=d):d=t[11],d}function y(e){let t=(0,p.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(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,h.jsx)(`div`,{"data-slot":`card-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ne(e){let t=(0,p.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(`cn-font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,h.jsx)(`div`,{"data-slot":`card-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Pe(e){let t=(0,p.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(`text-sm text-muted-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,h.jsx)(`div`,{"data-slot":`card-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function b(e){let t=(0,p.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(`col-start-2 row-span-2 row-start-1 self-start justify-self-end`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,h.jsx)(`div`,{"data-slot":`card-action`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Fe(e){let t=(0,p.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(`px-(--card-spacing)`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,h.jsx)(`div`,{"data-slot":`card-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ie(e){let t=(0,p.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-b-xl border-t bg-muted/50 p-(--card-spacing)`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,h.jsx)(`div`,{"data-slot":`card-footer`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}export{Ie as a,g as c,Pe as i,b as n,y as o,Fe as r,Ne as s,v as t};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import{n as s}from"./AgentIconCluster-Qf_VPGzc.js";import{t as c}from"./dist-CSCUSbQc.js";import{t as l}from"./checkbox-CKD8LETI.js";import{t as u}from"./label-CvMpFFbN.js";import{i as d,n as ee,o as te,s as ne,t as re}from"./select-Bu4Wm3Rf.js";import{t as ie}from"./button-DzgjsZzC.js";import{n as f}from"./dist-BGzUo_18.js";import{n as ae}from"./constants-editors-DLxv8SuP.js";import{t as oe}from"./spinner-Bx8xD6f8.js";import{a as se}from"./SkillInstallMenu-CAjgsxCn.js";import{a as ce,c as le,i as ue,n as de,o as fe,s as pe,t as me}from"./dialog-BJEjKJjL.js";import{p as he,r as ge,t as _e}from"./skill-scope-N3jmnGIX.js";import{h as ve,i as ye,p as be,x as xe}from"./skills-api-B7NWq2mZ.js";import{a as Se,i as Ce,t as we}from"./popover-BhiLJhH5.js";import{t as Te}from"./use-skills-D4I9tjyB.js";import{t as Ee}from"./use-skill-targets-CcZTp1aJ.js";var p=a(),m=e(n(),1),h=t();function g(e){let t=(0,p.c)(2);if(!e.bundle)return null;let n;return t[0]===e?n=t[1]:(n=(0,h.jsx)(_,{...e,bundle:e.bundle}),t[0]=e,t[1]=n),n}function _(e){let t=(0,p.c)(118),{bundle:n,source:a,defaultScope:o,installOverride:c,onInstalled:g,onOpenChange:_,returnFocus:v}=e,{_:y}=i(),Ne=(0,m.useId)(),Pe=he(),[b,Fe]=(0,m.useState)(c?.scope??o),Ie;t[0]!==n.names||t[1]!==c?(Ie=()=>c?new Set(n.names):new Set,t[0]=n.names,t[1]=c,t[2]=Ie):Ie=t[2];let[x,Le]=(0,m.useState)(Ie),[S,Re]=(0,m.useState)(!1),ze;t[3]===n.descriptions?ze=t[4]:(ze=()=>new Map(Object.entries(n.descriptions??{})),t[3]=n.descriptions,t[4]=ze);let[Be,Ve]=(0,m.useState)(ze),C=Ee(),[He,Ue]=(0,m.useState)(null),We=C.state.status===`ready`?C.state.data.targets:null,Ge;t[5]!==We||t[6]!==He?(Ge=He??new Set(We??[]),t[5]=We,t[6]=He,t[7]=Ge):Ge=t[7];let w=Ge,T=Te(),Ke=T.status===`ready`?T.data.find(e=>e.scope===b)?.installableEditors:void 0,qe=se.filter(e=>!Ke||Ke.includes(e)||w.has(e)),Je;t[8]!==b||t[9]!==T.data||t[10]!==T.status?(Je=T.status===`ready`?new Set(T.data.filter(e=>e.scope===b).map(Me)):new Set,t[8]=b,t[9]=T.data,t[10]=T.status,t[11]=Je):Je=t[11];let E=Je,Ye;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(Ye=new Set,t[12]=Ye):Ye=t[12];let[D,Xe]=(0,m.useState)(Ye),Ze=new Set;if(C.state.status===`ready`){let e;t[13]===C.state.data.folders?e=t[14]:(e=C.state.data.folders??[],t[13]=C.state.data.folders,t[14]=e);for(let t of e)t.scope===b&&(se.includes(t.host)||t.root&&Ze.add(t.root))}if(T.status===`ready`){for(let e of T.data)if(e.scope===b)for(let t of e.customPlacements??[]){let e=ge(t);e&&Ze.add(e)}}let Qe=[...Ze].sort(),$e=c!==void 0,et,tt;t[15]!==a||t[16]!==$e?(et=()=>{if($e)return;let e=new AbortController;return ye(a,e.signal).then(t=>{e.signal.aborted||!t.ok||Ve(new Map(t.skills.map(je)))}),()=>e.abort()},tt=[a,$e],t[15]=a,t[16]=$e,t[17]=et,t[18]=tt):(et=t[17],tt=t[18]),(0,m.useEffect)(et,tt);let{plugin:O,names:k}=n,nt;if(t[19]!==E||t[20]!==k){let e;t[22]===E?e=t[23]:(e=e=>!E.has(e),t[22]=E,t[23]=e),nt=k.filter(e),t[19]=E,t[20]=k,t[21]=nt}else nt=t[21];let A=nt,j=x.size===A.length&&A.length>0,rt;t[24]===x?rt=t[25]:(rt=function(e,t){let n=new Set(x);t?n.add(e):n.delete(e),Le(n)},t[24]=x,t[25]=rt);let it=rt,at;t[26]!==y||t[27]!==D||t[28]!==w||t[29]!==c||t[30]!==g||t[31]!==_||t[32]!==O||t[33]!==b||t[34]!==x||t[35]!==a?(at=async function(){if(Re(!0),c){let e=await c.installSelected([...x]);if(Re(!1),e===null)return;e.size>0&&g?.(e),_(!1);return}let e=await be({source:a,skills:[...x],scope:b,install:!1,marketplace:!0});if(!e.ok){Re(!1),f.error(y({id:`Lbl6KA`,values:{0:O??a,1:e.error}}));return}let t=e.results.map(Ae).filter(ke),n=[...w];if(n.length>0)for(let e of t){let t=await ve({scope:b,name:e,targets:n,linkMode:!0});t.ok||f.error(y({id:`1oSHI0`,values:{0:t.error,skillName:e}}))}for(let e of D)for(let n of t){let t=await xe({scope:b,name:n,dir:e,mode:`link`});t.ok||f.error(y({id:`OkC7-2`,values:{0:t.error,skillName:n,root:e}}))}Re(!1);let{imported:r,alreadyImported:i,failed:o}=e;if(o>0){let t=e.results.filter(Oe).map(De).join(`, `);f.error(y({id:`cMMb6H`,values:{imported:r,failed:o,failedNames:t}}))}else r===0?f.info(y({id:`uJfwF8`})):i>0?f.success(y({id:`tkIXtS`,values:{imported:r,alreadyImported:i}})):f.success(y({id:`-kKdCC`,values:{0:O??a,imported:r}}));let s=new Map;for(let t of e.results)t.status!==`imported`&&t.status!==`already-imported`||s.set(t.requested,t.name??t.requested);s.size>0&&g?.(s),_(!1)},t[26]=y,t[27]=D,t[28]=w,t[29]=c,t[30]=g,t[31]=_,t[32]=O,t[33]=b,t[34]=x,t[35]=a,t[36]=at):at=t[36];let ot=at,st=me,M;t[37]!==S||t[38]!==_?(M=e=>{!e&&!S&&_(!1)},t[37]=S,t[38]=_,t[39]=M):M=t[39];let ct=ue,N;t[40]===v?N=t[41]:(N=e=>{v&&(e.preventDefault(),v())},t[40]=v,t[41]=N);let P;t[42]!==O||t[43]!==a?(P=(0,h.jsx)(le,{children:O?(0,h.jsx)(r,{id:`J86siq`,values:{plugin:O}}):(0,h.jsx)(r,{id:`Q-DKvr`,values:{source:a}})}),t[42]=O,t[43]=a,t[44]=P):P=t[44];let F;t[45]===O?F=t[46]:(F=(0,h.jsx)(ce,{children:O?(0,h.jsx)(r,{id:`lj4cNf`}):(0,h.jsx)(r,{id:`4mDIcg`})}),t[45]=O,t[46]=F);let I;t[47]!==P||t[48]!==F?(I=(0,h.jsxs)(pe,{children:[P,F]}),t[47]=P,t[48]=F,t[49]=I):I=t[49];let lt=de,L;t[50]!==A.length||t[51]!==x.size?(L=(0,h.jsx)(`p`,{className:`font-medium text-xs font-mono text-foreground/70 uppercase tracking-wider`,children:(0,h.jsx)(r,{id:`lUtr1r`,values:{0:x.size,1:A.length}})}),t[50]=A.length,t[51]=x.size,t[52]=L):L=t[52];let R;t[53]!==j||t[54]!==A?(R=()=>Le(j?new Set:new Set(A)),t[53]=j,t[54]=A,t[55]=R):R=t[55];let z;t[56]===j?z=t[57]:(z=j?(0,h.jsx)(r,{id:`xCJdfg`}):(0,h.jsx)(r,{id:`wgNoIs`}),t[56]=j,t[57]=z);let B;t[58]!==S||t[59]!==R||t[60]!==z?(B=(0,h.jsx)(ie,{variant:`ghost`,size:`sm`,disabled:S,onClick:R,children:z}),t[58]=S,t[59]=R,t[60]=z,t[61]=B):B=t[61];let V;t[62]!==L||t[63]!==B?(V=(0,h.jsxs)(`div`,{className:`flex items-center justify-between`,children:[L,B]}),t[62]=L,t[63]=B,t[64]=V):V=t[64];let H;if(t[65]!==S||t[66]!==Be||t[67]!==E||t[68]!==k||t[69]!==x||t[70]!==it){let e;t[72]!==S||t[73]!==Be||t[74]!==E||t[75]!==x||t[76]!==it?(e=e=>{let t=Be.get(e),n=E.has(e);return(0,h.jsxs)(u,{className:`flex cursor-pointer items-start gap-3 p-3 text-sm font-normal hover:bg-muted/40`,children:[(0,h.jsx)(l,{checked:n||x.has(e),disabled:S||n,onCheckedChange:t=>it(e,t===!0),className:`mt-0.5`}),(0,h.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,h.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,h.jsx)(`span`,{className:`font-mono`,children:e}),n?(0,h.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground uppercase tracking-wide`,children:(0,h.jsx)(r,{id:`eQkgKV`})}):null]}),t?(0,h.jsx)(`span`,{className:`text-1sm text-muted-foreground line-clamp-2`,children:t}):null]})]},e)},t[72]=S,t[73]=Be,t[74]=E,t[75]=x,t[76]=it,t[77]=e):e=t[77],H=k.map(e),t[65]=S,t[66]=Be,t[67]=E,t[68]=k,t[69]=x,t[70]=it,t[71]=H}else H=t[71];let U;t[78]===H?U=t[79]:(U=(0,h.jsx)(`div`,{className:`max-h-72 overflow-y-auto rounded-md border border-border divide-y divide-border`,children:H}),t[78]=H,t[79]=U);let W;t[80]===b?W=t[81]:(W=b===`project`?(0,h.jsx)(r,{id:`oVW7VD`}):(0,h.jsx)(r,{id:`7HY6fA`}),t[80]=b,t[81]=W);let ut=$e?null:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`span`,{"aria-hidden":!0,children:`·`}),w.size+D.size>0?(0,h.jsx)(s,{hosts:[...w,...D],iconClassName:`size-3.5`}):(0,h.jsx)(r,{id:`poAsUN`}),(0,h.jsxs)(we,{children:[(0,h.jsx)(Se,{asChild:!0,children:(0,h.jsx)(ie,{variant:`link`,size:`sm`,className:`h-auto px-1`,disabled:S,"data-testid":`plugin-bundle-change-destination`,children:(0,h.jsx)(r,{id:`o-XJ9D`})})}),(0,h.jsxs)(Ce,{align:`start`,className:`flex w-72 flex-col gap-4`,children:[(0,h.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,h.jsx)(u,{htmlFor:Ne,children:(0,h.jsx)(r,{id:`7MSbAT`})}),(0,h.jsxs)(re,{value:b,disabled:S,onValueChange:e=>Fe(e),children:[(0,h.jsx)(te,{id:Ne,className:`w-full`,children:(0,h.jsx)(ne,{})}),(0,h.jsx)(ee,{children:_e.map(e=>(0,h.jsx)(d,{value:e,children:Pe[e]},e))})]})]}),(0,h.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,h.jsx)(u,{children:(0,h.jsx)(r,{id:`Y5la_5`})}),(0,h.jsxs)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-2`,children:[qe.map(e=>(0,h.jsxs)(u,{className:`flex cursor-pointer items-center gap-2 text-sm font-normal`,children:[(0,h.jsx)(l,{checked:w.has(e),disabled:S,onCheckedChange:t=>{let n=new Set(w);t===!0?n.add(e):n.delete(e),Ue(n)}}),ae[e]??e]},e)),Qe.map(e=>(0,h.jsxs)(u,{className:`flex cursor-pointer items-center gap-2 font-normal text-sm`,children:[(0,h.jsx)(l,{checked:D.has(e),disabled:S,onCheckedChange:t=>{let n=new Set(D);t===!0?n.add(e):n.delete(e),Xe(n)}}),(0,h.jsx)(`span`,{className:`font-mono text-xs`,children:e})]},e))]})]})]})]})]}),G;t[82]!==W||t[83]!==ut?(G=(0,h.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 text-1sm text-muted-foreground`,"data-testid":`plugin-bundle-destination`,children:[W,ut]}),t[82]=W,t[83]=ut,t[84]=G):G=t[84];let K;t[85]!==lt||t[86]!==V||t[87]!==U||t[88]!==G?(K=(0,h.jsxs)(lt,{className:`flex flex-col gap-4`,children:[V,U,G]}),t[85]=lt,t[86]=V,t[87]=U,t[88]=G,t[89]=K):K=t[89];let q;t[90]===_?q=t[91]:(q=()=>_(!1),t[90]=_,t[91]=q);let dt;t[92]===Symbol.for(`react.memo_cache_sentinel`)?(dt=(0,h.jsx)(r,{id:`dEgA5A`}),t[92]=dt):dt=t[92];let J;t[93]!==S||t[94]!==q?(J=(0,h.jsx)(ie,{variant:`outline`,disabled:S,onClick:q,children:dt}),t[93]=S,t[94]=q,t[95]=J):J=t[95];let ft=S||x.size===0,Y;t[96]===ot?Y=t[97]:(Y=()=>void ot(),t[96]=ot,t[97]=Y);let X;t[98]!==S||t[99]!==x.size?(X=S?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(oe,{"aria-hidden":`true`,className:`size-4`}),(0,h.jsx)(r,{id:`Wtw22s`})]}):x.size===0?(0,h.jsx)(r,{id:`TKQ7K-`}):(0,h.jsx)(r,{id:`9XwoPv`,values:{0:x.size}}),t[98]=S,t[99]=x.size,t[100]=X):X=t[100];let Z;t[101]!==ft||t[102]!==Y||t[103]!==X?(Z=(0,h.jsx)(ie,{"data-testid":`plugin-bundle-install`,disabled:ft,onClick:Y,children:X}),t[101]=ft,t[102]=Y,t[103]=X,t[104]=Z):Z=t[104];let Q;t[105]!==J||t[106]!==Z?(Q=(0,h.jsxs)(fe,{children:[J,Z]}),t[105]=J,t[106]=Z,t[107]=Q):Q=t[107];let $;t[108]!==ct||t[109]!==N||t[110]!==I||t[111]!==K||t[112]!==Q?($=(0,h.jsxs)(ct,{className:`sm:max-w-lg`,onCloseAutoFocus:N,children:[I,K,Q]}),t[108]=ct,t[109]=N,t[110]=I,t[111]=K,t[112]=Q,t[113]=$):$=t[113];let pt;return t[114]!==st||t[115]!==M||t[116]!==$?(pt=(0,h.jsx)(st,{open:!0,onOpenChange:M,children:$}),t[114]=st,t[115]=M,t[116]=$,t[117]=pt):pt=t[117],pt}function De(e){return e.requested}function Oe(e){return e.status===`failed`||e.status===`not-found`}function ke(e){return typeof e==`string`}function Ae(e){return e.name}function je(e){return[e.name,e.description]}function Me(e){return e.name}function v(e){let t=(0,p.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,size:i,asChild:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let s=i===void 0?`default`:i,l=a!==void 0&&a?c:`div`,u;t[5]===n?u=t[6]:(u=o(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,n),t[5]=n,t[6]=u);let d;return t[7]!==l||t[8]!==r||t[9]!==s||t[10]!==u?(d=(0,h.jsx)(l,{"data-slot":`card`,"data-size":s,className:u,...r}),t[7]=l,t[8]=r,t[9]=s,t[10]=u,t[11]=d):d=t[11],d}function y(e){let t=(0,p.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(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,h.jsx)(`div`,{"data-slot":`card-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ne(e){let t=(0,p.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(`cn-font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,h.jsx)(`div`,{"data-slot":`card-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Pe(e){let t=(0,p.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(`text-sm text-muted-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,h.jsx)(`div`,{"data-slot":`card-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function b(e){let t=(0,p.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(`col-start-2 row-span-2 row-start-1 self-start justify-self-end`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,h.jsx)(`div`,{"data-slot":`card-action`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Fe(e){let t=(0,p.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(`px-(--card-spacing)`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,h.jsx)(`div`,{"data-slot":`card-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ie(e){let t=(0,p.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-b-xl border-t bg-muted/50 p-(--card-spacing)`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,h.jsx)(`div`,{"data-slot":`card-footer`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}export{Ie as a,g as c,Pe as i,b as n,y as o,Fe as r,Ne as s,v as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./react-f2sANaYj.js";import{t as n}from"./useQuery-ZeEDLtxh.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{m as i}from"./RegisteredAgentIcon-CNf09bvo.js";var a=r(),o=e(t(),1);function s(e){return e.supported?e.harness?.availability===`present`||e.harness?.credentials===`present`:!1}function c(e){let t=[`claude-acp`,`codex-acp`,`cursor`,`opencode`],n=e=>{let n=t.indexOf(e);return n===-1?t.length:n};return e.filter(s).sort((e,t)=>n(e.id)-n(t.id))}function l(e){return e.harness?.credentials===`present`?0:+(e.harness?.availability===`not-found`)}async function u(e){let t=await fetch(`/api/acp/catalog`,{signal:e??AbortSignal.timeout(2e4)});if(!t.ok)throw Error(`agent catalog request failed: HTTP ${t.status}`);let n=await t.json();return{agents:Array.isArray(n.agents)?n.agents:[],stale:n.stale===!0,maxThreads:typeof n.maxThreads==`number`?n.maxThreads:8}}var d=300*1e3,f=null;function p(e){let t=(0,a.c)(6),r=e===void 0?!0:e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=[`acp-catalog`],t[0]=i):i=t[0];let s;t[1]===r?s=t[2]:(s={queryKey:i,queryFn:m,staleTime:d,enabled:r},t[1]=r,t[2]=s);let c=n(s),{error:l}=c,u,p;return t[3]===l?(u=t[4],p=t[5]):(u=()=>{l==null||l===f||(f=l,console.error(`[acp-catalog] agent catalog request failed`,l))},p=[l],t[3]=l,t[4]=u,t[5]=p),(0,o.useEffect)(u,p),c}function m(e){let{signal:t}=e;return u(t)}function h(){let e=(0,a.c)(3),{data:t}=p(),n=t?.agents,r,s;e[0]===n?(r=e[1],s=e[2]):(r=()=>{n&&i(n.map(g))},s=[n],e[0]=n,e[1]=r,e[2]=s),(0,o.useEffect)(r,s)}function g(e){return{source:e.source,id:e.id,name:e.name,supported:e.supported,featured:e.featured,...e.iconUrl===void 0?{}:{iconUrl:e.iconUrl}}}export{p as a,s as i,u as n,h as o,l as r,c as t};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./react-f2sANaYj.js";import{t as n}from"./useQuery-ZeEDLtxh.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{m as i}from"./RegisteredAgentIcon-DKZ8eOKZ.js";var a=r(),o=e(t(),1);function s(e){return e.supported?e.harness?.availability===`present`||e.harness?.credentials===`present`:!1}function c(e){let t=[`claude-acp`,`codex-acp`,`cursor`,`opencode`],n=e=>{let n=t.indexOf(e);return n===-1?t.length:n};return e.filter(s).sort((e,t)=>n(e.id)-n(t.id))}function l(e){return e.harness?.credentials===`present`?0:+(e.harness?.availability===`not-found`)}async function u(e){let t=await fetch(`/api/acp/catalog`,{signal:e??AbortSignal.timeout(2e4)});if(!t.ok)throw Error(`agent catalog request failed: HTTP ${t.status}`);let n=await t.json();return{agents:Array.isArray(n.agents)?n.agents:[],stale:n.stale===!0,maxThreads:typeof n.maxThreads==`number`?n.maxThreads:8}}var d=300*1e3,f=null;function p(e){let t=(0,a.c)(6),r=e===void 0?!0:e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=[`acp-catalog`],t[0]=i):i=t[0];let s;t[1]===r?s=t[2]:(s={queryKey:i,queryFn:m,staleTime:d,enabled:r},t[1]=r,t[2]=s);let c=n(s),{error:l}=c,u,p;return t[3]===l?(u=t[4],p=t[5]):(u=()=>{l==null||l===f||(f=l,console.error(`[acp-catalog] agent catalog request failed`,l))},p=[l],t[3]=l,t[4]=u,t[5]=p),(0,o.useEffect)(u,p),c}function m(e){let{signal:t}=e;return u(t)}function h(){let e=(0,a.c)(3),{data:t}=p(),n=t?.agents,r,s;e[0]===n?(r=e[1],s=e[2]):(r=()=>{n&&i(n.map(g))},s=[n],e[0]=n,e[1]=r,e[2]=s),(0,o.useEffect)(r,s)}function g(e){return{source:e.source,id:e.id,name:e.name,supported:e.supported,featured:e.featured,...e.iconUrl===void 0?{}:{iconUrl:e.iconUrl}}}export{p as a,s as i,u as n,h as o,l as r,c as t};
@@ -1 +1 @@
1
- var e=`ok.client.surface`,t={protocol:`x-ok-client-protocol`,runtime:`x-ok-client-runtime`,kind:`x-ok-client-kind`};function n({hasDesktopBridge:e,embeddedHost:t}){return e?`desktop`:t===null?`browser`:`embedded:${t}`}function r({kind:e,runtimeVersion:n}){return{[t.protocol]:`2`,[t.runtime]:n,[t.kind]:e}}function i({kind:e,runtimeVersion:t}){return{clientProtocolVersion:2,clientRuntimeVersion:t,clientKind:e}}var a={cursor:/\bCursor(?:\([^)]+\))?\/\d/,codex:/\bCodex(?:\([^)]+\))?\/\d/,"claude-desktop":/\bClaude(?:\([^)]+\))?\/\d/};function o(){if(typeof navigator>`u`)return null;let e=navigator.userAgent;for(let[t,n]of Object.entries(a))if(n.test(e))return t;return null}var s={BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.85.0-beta.9`}?.VITE_APP_VERSION??`0.0.0-unknown`,c=n({hasDesktopBridge:typeof window<`u`&&window.okDesktop!==void 0,embeddedHost:o()});function l(){return r({kind:c,runtimeVersion:s})}function u(){return i({kind:c,runtimeVersion:s})}export{o as a,u as i,c as n,e as o,l as r,s as t};
1
+ var e=`ok.client.surface`,t={protocol:`x-ok-client-protocol`,runtime:`x-ok-client-runtime`,kind:`x-ok-client-kind`};function n({hasDesktopBridge:e,embeddedHost:t}){return e?`desktop`:t===null?`browser`:`embedded:${t}`}function r({kind:e,runtimeVersion:n}){return{[t.protocol]:`2`,[t.runtime]:n,[t.kind]:e}}function i({kind:e,runtimeVersion:t}){return{clientProtocolVersion:2,clientRuntimeVersion:t,clientKind:e}}var a={cursor:/\bCursor(?:\([^)]+\))?\/\d/,codex:/\bCodex(?:\([^)]+\))?\/\d/,"claude-desktop":/\bClaude(?:\([^)]+\))?\/\d/};function o(){if(typeof navigator>`u`)return null;let e=navigator.userAgent;for(let[t,n]of Object.entries(a))if(n.test(e))return t;return null}var s={BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.85.0`}?.VITE_APP_VERSION??`0.0.0-unknown`,c=n({hasDesktopBridge:typeof window<`u`&&window.okDesktop!==void 0,embeddedHost:o()});function l(){return r({kind:c,runtimeVersion:s})}function u(){return i({kind:c,runtimeVersion:s})}export{o as a,u as i,c as n,e as o,l as r,s as t};
@@ -1,7 +1,7 @@
1
- import{t as e}from"./jsx-runtime-BUgB2tll.js";import{$n as t,Ir as n,Lr as r,Qn as i,Ur as a,li as o,oi as s,pi as c,rr as l,tr as u,zn as d}from"./DocumentContext-DFJynlOa.js";import{n as f,r as p}from"./dist-Nvb76hAm.js";import{t as m}from"./compiler-runtime-BfE3aGVn.js";import{t as h}from"./utils-CPqDy6Hr.js";import{i as g,n as _,t as ee}from"./tooltip-DBqLYfio.js";import{t as v}from"./button-DzgjsZzC.js";import{n as y}from"./dist-BGzUo_18.js";import{t as b}from"./dist-C_FzPxEX2.js";import{t as x}from"./createLucideIcon-DdBzwsHe.js";import{cr as S,sr as C}from"./CodeMirrorPropInput-CVk_Tsyv.js";import{t as te}from"./x-DM2drskU.js";import{l as w}from"./doc-hash-BJkweiX9.js";var T=x(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),E=m(),ne=`var(--ok-comment-hue, rgb(37 99 235))`,re={fill:.22,line:.7},ie={fill:.45,line:1},ae=.45;function D(e){return`color-mix(in srgb,${ne} ${e*100}%,transparent)`}function oe(e,t){let{fill:n,line:r}=t?ie:re;return[`border-radius:2px`,`padding-bottom:1px`,...e.id===null?[]:[`cursor:pointer`],`background-color:${D(n)}`,`box-shadow:inset 0 -2px 0 ${D(r)}`,``].join(`;`)}function O(e){return e.map(e=>e.id??`·`).join(`|`)}function se(e){let t=null;for(let n of e)n.id!==null&&(t===null||n.to-n.from<t.to-t.from)&&(t=n);return t?.id??null}function ce(e,t){return e.id===null||e.id===t}function le(e,t=null){let n=[...e].filter(e=>e.from<e.to).sort((e,t)=>e.from-t.from||e.to-t.to||(e.id??``).localeCompare(t.id??``));if(n.length===0)return[];let r=[...new Set(n.flatMap(e=>[e.from,e.to]))].sort((e,t)=>e-t),i=[],a=null,o=()=>{if(a===null)return;let e=a.covering.find(e=>ce(e,t));i.push({from:a.from,to:a.to,style:oe(e??a.covering[0],e!==void 0),threadId:se(a.covering)}),a=null};for(let e=0;e<r.length-1;e++){let t=r[e],i=r[e+1],s=n.filter(e=>e.from<=t&&e.to>=i);if(s.length===0){o();continue}if(a!==null&&a.to===t&&O(a.covering)===O(s)){a.to=i;continue}o(),a={from:t,to:i,covering:s}}return o(),i}var k=`data-comment-reveal`;function A(e){return typeof CSS<`u`&&CSS.escape?CSS.escape(e):e}function ue(e){return e===``?null:document.querySelector(`[data-testid="property-row"][data-key="${A(e)}"]`)}function de(e){let t=ue(e);if(t===null)return null;let n=t.getBoundingClientRect();return n.height===0&&n.width===0?null:n}function fe(e){ue(e)?.scrollIntoView({block:`center`,behavior:`smooth`})}function pe(e){if(e.quote===``)return!1;let t=e.path.length===0?e.key:e.path[e.path.length-1],n=Array.from(document.querySelectorAll(`[data-testid="property-row"][data-key="${A(String(t))}"]`)),r=Array.from(document.querySelectorAll(`[data-testid="property-row"]`));for(let t of[...n,...r]){let n=t.querySelector(`textarea, input`);if(n===null)continue;let r=me(n.value,e.quote,e.start,e.end);if(r!==null)return t.scrollIntoView({block:`center`,behavior:`smooth`}),n.focus(),n.setSelectionRange(r.start,r.end),he(n),!0}return!1}function me(e,t,n,r){if(n!==void 0&&r!==void 0&&e.slice(n,r)===t)return{start:n,end:r};let i=e.indexOf(t);return i<0?null:{start:i,end:i+t.length}}function he(e){e.style.setProperty(`--comment-reveal-fill`,D(ae)),e.setAttribute(k,`true`);let t=()=>{e.removeAttribute(k),e.style.removeProperty(`--comment-reveal-fill`)};e.addEventListener(`blur`,t,{once:!0}),e.addEventListener(`pointerdown`,t,{once:!0}),e.addEventListener(`keydown`,t,{once:!0})}var ge=new Set([`*`,`_`,"`",`~`,`\\`,`$`]),_e=/^={2,}/,j=/^<(?:[A-Za-z][A-Za-z0-9+.-]*:[^<>\s]*|[^\s<>@]+@[^\s<>]+)>/,M=512;function ve(e,t){return j.test(e.slice(t,t+M))}function ye(e,t){let n=e.lastIndexOf(`<`,t);return n<0||t-n>M?!1:j.exec(e.slice(n,t+1))?.[0].length===t+1-n}var be=/^<\/?[A-Za-z][A-Za-z0-9-]*(?:\s[^>]*?)?\/?>/,xe=512,Se=/^!(?=\[)/,Ce=/^\[\^/,we=/^\]\[[^\]]*\]/,Te=/^\[\[[^\][|]*\|/,Ee=/^#[^\][|]*(?=\]\])/,N=512,De=/^\]\([^)]*\)/,Oe=512,ke=/^(?:#{1,6}[ \t]+|>[ \t]?|(?:[-*+]|\d{1,9}[.)])[ \t]+(?:\[[ xX]\][ \t]+)?)/,Ae=32,je=`|`,Me=/^(?:`{3,}[^`\n]*|~{3,}[^\n]*)$/,Ne=/^(?:(?:[-*_][ \t]*){3,}|=+[ \t]*|[|\-: \t]*-[|\-: \t]*)$/,Pe=1024;function Fe(e,t){let n=e.indexOf(`
1
+ import{t as e}from"./jsx-runtime-BUgB2tll.js";import{Fr as t,Hr as n,Ir as r,Qn as i,Rn as a,Zn as o,ai as s,ci as c,er as l,fi as u,nr as d}from"./DocumentContext-BH42QH54.js";import{n as f,r as p}from"./dist-Nvb76hAm.js";import{t as m}from"./compiler-runtime-BfE3aGVn.js";import{t as h}from"./utils-CPqDy6Hr.js";import{i as g,n as _,t as ee}from"./tooltip-DBqLYfio.js";import{t as v}from"./button-DzgjsZzC.js";import{n as y}from"./dist-BGzUo_18.js";import{t as b}from"./dist-C_FzPxEX2.js";import{t as x}from"./createLucideIcon-DdBzwsHe.js";import{cr as S,sr as C}from"./CodeMirrorPropInput-DvKu95Lo.js";import{t as te}from"./x-DM2drskU.js";import{l as w}from"./doc-hash-BJkweiX9.js";var T=x(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),E=m(),ne=`var(--ok-comment-hue, rgb(37 99 235))`,re={fill:.22,line:.7},ie={fill:.45,line:1},ae=.45;function D(e){return`color-mix(in srgb,${ne} ${e*100}%,transparent)`}function oe(e,t){let{fill:n,line:r}=t?ie:re;return[`border-radius:2px`,`padding-bottom:1px`,...e.id===null?[]:[`cursor:pointer`],`background-color:${D(n)}`,`box-shadow:inset 0 -2px 0 ${D(r)}`,``].join(`;`)}function O(e){return e.map(e=>e.id??`·`).join(`|`)}function se(e){let t=null;for(let n of e)n.id!==null&&(t===null||n.to-n.from<t.to-t.from)&&(t=n);return t?.id??null}function ce(e,t){return e.id===null||e.id===t}function le(e,t=null){let n=[...e].filter(e=>e.from<e.to).sort((e,t)=>e.from-t.from||e.to-t.to||(e.id??``).localeCompare(t.id??``));if(n.length===0)return[];let r=[...new Set(n.flatMap(e=>[e.from,e.to]))].sort((e,t)=>e-t),i=[],a=null,o=()=>{if(a===null)return;let e=a.covering.find(e=>ce(e,t));i.push({from:a.from,to:a.to,style:oe(e??a.covering[0],e!==void 0),threadId:se(a.covering)}),a=null};for(let e=0;e<r.length-1;e++){let t=r[e],i=r[e+1],s=n.filter(e=>e.from<=t&&e.to>=i);if(s.length===0){o();continue}if(a!==null&&a.to===t&&O(a.covering)===O(s)){a.to=i;continue}o(),a={from:t,to:i,covering:s}}return o(),i}var k=`data-comment-reveal`;function A(e){return typeof CSS<`u`&&CSS.escape?CSS.escape(e):e}function ue(e){return e===``?null:document.querySelector(`[data-testid="property-row"][data-key="${A(e)}"]`)}function de(e){let t=ue(e);if(t===null)return null;let n=t.getBoundingClientRect();return n.height===0&&n.width===0?null:n}function fe(e){ue(e)?.scrollIntoView({block:`center`,behavior:`smooth`})}function pe(e){if(e.quote===``)return!1;let t=e.path.length===0?e.key:e.path[e.path.length-1],n=Array.from(document.querySelectorAll(`[data-testid="property-row"][data-key="${A(String(t))}"]`)),r=Array.from(document.querySelectorAll(`[data-testid="property-row"]`));for(let t of[...n,...r]){let n=t.querySelector(`textarea, input`);if(n===null)continue;let r=me(n.value,e.quote,e.start,e.end);if(r!==null)return t.scrollIntoView({block:`center`,behavior:`smooth`}),n.focus(),n.setSelectionRange(r.start,r.end),he(n),!0}return!1}function me(e,t,n,r){if(n!==void 0&&r!==void 0&&e.slice(n,r)===t)return{start:n,end:r};let i=e.indexOf(t);return i<0?null:{start:i,end:i+t.length}}function he(e){e.style.setProperty(`--comment-reveal-fill`,D(ae)),e.setAttribute(k,`true`);let t=()=>{e.removeAttribute(k),e.style.removeProperty(`--comment-reveal-fill`)};e.addEventListener(`blur`,t,{once:!0}),e.addEventListener(`pointerdown`,t,{once:!0}),e.addEventListener(`keydown`,t,{once:!0})}var ge=new Set([`*`,`_`,"`",`~`,`\\`,`$`]),_e=/^={2,}/,j=/^<(?:[A-Za-z][A-Za-z0-9+.-]*:[^<>\s]*|[^\s<>@]+@[^\s<>]+)>/,M=512;function ve(e,t){return j.test(e.slice(t,t+M))}function ye(e,t){let n=e.lastIndexOf(`<`,t);return n<0||t-n>M?!1:j.exec(e.slice(n,t+1))?.[0].length===t+1-n}var be=/^<\/?[A-Za-z][A-Za-z0-9-]*(?:\s[^>]*?)?\/?>/,xe=512,Se=/^!(?=\[)/,Ce=/^\[\^/,we=/^\]\[[^\]]*\]/,Te=/^\[\[[^\][|]*\|/,Ee=/^#[^\][|]*(?=\]\])/,N=512,De=/^\]\([^)]*\)/,Oe=512,ke=/^(?:#{1,6}[ \t]+|>[ \t]?|(?:[-*+]|\d{1,9}[.)])[ \t]+(?:\[[ xX]\][ \t]+)?)/,Ae=32,je=`|`,Me=/^(?:`{3,}[^`\n]*|~{3,}[^\n]*)$/,Ne=/^(?:(?:[-*_][ \t]*){3,}|=+[ \t]*|[|\-: \t]*-[|\-: \t]*)$/,Pe=1024;function Fe(e,t){let n=e.indexOf(`
2
2
  `,t),r=n===-1?e.length:n;if(r>t&&e[r-1]===`\r`&&--r,r-t>Pe)return 0;let i=e.slice(t,r);return i.length===0||!Me.test(i)&&!Ne.test(i)?0:i.length}var P=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/y;function F(e,t){if(e[t]!==`&`)return null;let n=t,r=``;for(;;){P.lastIndex=n;let t=P.exec(e)?.[0];if(t===void 0)break;let i=C(t);if(i===null)break;r+=i,n+=t.length}return n===t?null:{length:n-t,rendered:r}}function I(e){return e===` `||e===` `||e===`
3
3
  `||e===`\r`||e===`\f`||e===`\v`}function L(e,t){for(let n=t-1;n>=0;--n){let t=e[n];if(t===`
4
- `)return!0;if(t!==` `&&t!==` `)return!1}return!0}function R(e,t){let n=e[t];if(n===void 0)return 0;if(L(e,t)){let n=Fe(e,t);if(n>0)return n}if(n===je)return 1;if(n===`<`){let n=be.exec(e.slice(t,t+xe))?.[0].length;return n===void 0?+!!ve(e,t):n}if(n===`>`&&ye(e,t))return 1;if(n===`=`){let n=_e.exec(e.slice(t,t+3))?.[0].length;if(n!==void 0)return n}if(n===`!`)return+!!Se.test(e.slice(t,t+2));if(ge.has(n))return 1;if(n===`[`){let n=e.slice(t,t+N),r=Te.exec(n)?.[0].length;return r===void 0?Ce.test(n)?2:1:r}if(n===`#`){let n=Ee.exec(e.slice(t,t+N))?.[0].length;if(n!==void 0)return n}if(n===`]`){if(e[t+1]===`]`)return 2;let n=e.slice(t,t+Math.max(Oe,N)),r=De.exec(n)?.[0].length;if(r!==void 0)return r;let i=we.exec(n)?.[0].length;return i===void 0?1:i}return L(e,t)?ke.exec(e.slice(t,t+Ae))?.[0].length??0:0}function z(e,t,{syntaxIn:n}){let r=[];if(t.length===0)return r;let i=n===`haystack`;for(let n=0;n<e.length;n+=1){let a=e[n];if(a===void 0||I(a)||i&&a!==t[0]&&(R(e,n)>0||F(e,n)!==null))continue;let o=n,s=0;for(;o<e.length&&s<t.length;){let n=e[o],r=t[s];if(n===r){o+=1,s+=1;continue}if(I(r)){s+=1;continue}if(I(n)){o+=1;continue}let a=i?R(e,o):R(t,s);if(a>0){i?o+=a:s+=a;continue}let c=i?F(e,o):F(t,s);if(c!==null){let n=i?t:e,r=i?s:o,a=!0;for(let e of c.rendered)if(!I(e)){for(;r<n.length&&I(n[r]);)r+=1;if(n[r]!==e){a=!1;break}r+=1}if(!a)break;i?(o+=c.length,s=r):(s+=c.length,o=r);continue}break}for(;s<t.length&&I(t[s]);)s+=1;s===t.length&&r.push({start:n,end:o})}return r}var B=8,V=64;function H(e,t,n,r){let i=``,a=Math.max(0,t),o=Math.min(e.length,n);for(;a<o;){let t=e[a];if(I(t)){a+=1;continue}if(r){let t=R(e,a);if(t>0){a+=t;continue}let n=F(e,a);if(n!==null){for(let e of n.rendered)I(e)||(i+=e);a+=n.length;continue}}i+=t,a+=1}return i}function Ie(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[e.length-1-r]===t[t.length-1-r];)r+=1;return r}function Le(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r+=1;return r}function U(e,t,n,{syntaxIn:r,syntaxInContext:i=!1}){let a=n.prefix??``,o=n.suffix??``,s=r===`haystack`,c=0;if(a.length>0){let n=a.length*B+V;c+=Ie(H(a,0,a.length,i),H(e,t.start-n,t.start,s))}if(o.length>0){let n=o.length*B+V;c+=Le(H(o,0,o.length,i),H(e,t.end,t.end+n,s))}return c}function Re(e,{syntaxInContext:t=!1}={}){let n=H(e.prefix??``,0,1/0,t).length+H(e.suffix??``,0,1/0,t).length;return Math.min(8,n)}function ze(e){return Math.max(e*4,e+64)}function W(e,{includeBlockComponents:t=!1}={}){let n=``,r=[];return e.descendants((e,a)=>{if(e.isText&&e.text){for(let t=0;t<e.text.length;t++)n+=e.text[t],r.push(a+t);return!0}if(e.isBlock&&!t)return!0;let o=i(e);if(o.length>0){let t=a+e.nodeSize-1;for(let e=0;e<o.length;e++)n+=o[e],r.push(e===o.length-1?t:a)}return!0}),{text:n,positions:r}}function Be(e,t){let n=[];if(t===``)return n;let r=e.indexOf(t);for(;r!==-1;)n.push(r),r=e.indexOf(t,r+1);return n}function G(e,t,n){let r=n?.prefix??``,i=n?.suffix??``;if(r===``&&i===``)return null;let a=r===``?[0]:z(e,r,{syntaxIn:`needle`}).map(e=>e.end),o=i===``?[e.length]:z(e,i,{syntaxIn:`needle`}).map(e=>e.start);if(a.length!==1||o.length!==1)return null;let s=a[0],c=o[0];for(;s<c&&/\s/.test(e[s]??``);)s+=1;for(;c>s&&/\s/.test(e[c-1]??``);)--c;if(c<=s)return null;let l=ze(t.length);return c-s>l?null:{start:s,end:c}}function K(e,t){let n=e.positions[t.start],r=e.positions[t.end-1];return n==null||r==null?null:{from:n,to:r+1}}function q(e,t,n){if(t.length===0)return null;let r=Be(e.text,t).map(e=>({start:e,end:e+t.length}));if(r.length===0&&(r=z(e.text,t,{syntaxIn:`needle`})),r.length===0){let r=G(e.text,t,n);return r===null?null:K(e,r)}let i=n?.prefix??``,a=n?.suffix??``,o=t=>e.text.includes(t)||z(e.text,t,{syntaxIn:`needle`}).length>0;if(i!==``&&a!==``&&!o(i+t+a)&&o(i+a))return null;let s=Re({prefix:i,suffix:a},{syntaxInContext:!0}),c=t=>s===0||U(e.text,t,{prefix:i,suffix:a},{syntaxIn:`none`,syntaxInContext:!0})>=s;if(r.length===1){if(!c(r[0])){let r=G(e.text,t,n);return r===null?null:K(e,r)}return K(e,r[0])}let l=[],u=-1;for(let t of r){let n=U(e.text,t,{prefix:i,suffix:a},{syntaxIn:`none`,syntaxInContext:!0});n>u?(u=n,l=[t]):n===u&&l.push(t)}if(!c(l[0])){let r=G(e.text,t,n);return r===null?null:K(e,r)}return K(e,l[0])}var J=64;function Ve(e,n,r){return{prefix:t(e,Math.max(0,n-J),n),suffix:t(e,r,Math.min(e.content.size,r+J))}}function Y(e,t,n){return X(e)(t,n)}function X(e){let t=W(e),n=null;return(r,i)=>{let a=q(t,r,i);return a===null?(n??=W(e,{includeBlockComponents:!0}),q(n,r,i)):a}}var He=220,Ue=24;function We(e){let t=e.viewTop+e.insetTop,n=e.viewBottom-He;return e.anchorTop>=t&&e.anchorBottom<=n?0:e.anchorTop-(t+Ue)}function Z(e){let t=e?.parentElement??null;for(;t;){let e=getComputedStyle(t).overflowY;if(e===`auto`||e===`scroll`)return t;t=t.parentElement}return null}function Ge(e){let t=Number.parseFloat(getComputedStyle(e).scrollPaddingTop);return Number.isFinite(t)?t:0}function Ke(e,t,n,r){let i=S(e);if(!i)return!1;let a=Z(i.dom);if(!a)return d(n,`comment-reveal`,()=>e.commands.scrollIntoView());let o,s;try{o=i.coordsAtPos(t.from),s=i.coordsAtPos(t.to)}catch{return!1}let c=a.getBoundingClientRect(),l=We({anchorTop:o.top,anchorBottom:Math.max(o.bottom,s.bottom),viewTop:c.top,viewBottom:c.bottom,insetTop:Ge(a)});if(l===0)return!0;let u=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;return d(n,`comment-reveal`,()=>a.scrollTo({top:a.scrollTop+l,behavior:r?.instant||u?`auto`:`smooth`}))}var qe=1e4,Je=80,Ye=1500,Xe=[`wheel`,`touchstart`,`mousedown`,`keydown`];function Ze(e){let t=!1,i=null,a=null,o=-1,s=()=>{let s=u(e.docName);if(!s||s.isDestroyed)return!1;if(t||(t=!0,n(e.threadId)),e.quote===``)return i===null&&(i=Date.now(),r(e.threadId)),!0;let c=s.state.doc.content.size;return(a===null||c!==o)&&(a=Y(s.state.doc,e.quote,e.context),o=c),!a||!Ke(s,a,e.docName,{instant:!0})?!1:(i===null&&(i=Date.now(),r(e.threadId)),!0)};c(`comments`),s(),u(e.docName)===null&&window.location.assign(w(e.docName));let d=!1,f=()=>{if(!d){d=!0,h(),window.clearInterval(g),window.clearTimeout(_);for(let e of Xe)window.removeEventListener(e,p,!0)}},p=()=>f(),m=()=>{s()&&i!==null&&Date.now()-i>=Ye&&f()},h=l(m),g=window.setInterval(m,Je),_=window.setTimeout(()=>{i===null&&y.error(t?b._({id:`KeXgA-`}):b._({id:`JDQ5I5`})),f()},qe);for(let e of Xe)window.addEventListener(e,p,!0);m()}var Q=e();function Qe(){return s().length}function $e(){let e=(0,E.c)(4),t=s(),n;if(e[0]!==t){n=new Map;for(let e of t){let t=a(e)?.docName;t!==void 0&&n.set(t,(n.get(t)??0)+1)}e[0]=t,e[1]=n}else n=e[1];let r;return e[2]===n?r=e[3]:(r=[...n].map(et),e[2]=n,e[3]=r),r}function et(e){let[t,n]=e;return{docName:t,count:n}}function tt(e){let t=(0,E.c)(26),{count:n,docs:r,onDismiss:i}=e,a;t[0]===r?a=t[1]:(a=r===void 0?[]:r,t[0]=r,t[1]=a);let o=a,{_:s}=p();if(n===0)return null;let c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=h(`inline-flex items-center gap-1 rounded-md border bg-muted/60 py-0.5 pr-0.5 pl-1.5`,`text-xs text-muted-foreground`),t[2]=c):c=t[2];let l;t[3]===s?l=t[4]:(l=s({id:`2zvUIK`}),t[3]=s,t[4]=l);let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(T,{className:`size-3`}),t[5]=u):u=t[5];let d;t[6]!==n||t[7]!==o.length?(d=o.length>1?(0,Q.jsx)(f,{id:`5TmrYN`,values:{0:o.length,count:n}}):(0,Q.jsx)(f,{id:`eiUA4k`,values:{count:n}}),t[6]=n,t[7]=o.length,t[8]=d):d=t[8];let m;t[9]!==l||t[10]!==d?(m=(0,Q.jsx)(g,{asChild:!0,children:(0,Q.jsxs)(v,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":l,onClick:rt,"data-testid":`composer-comments-open-panel`,className:`h-auto min-h-0 gap-1 px-0.5 py-0 text-xs font-normal text-muted-foreground hover:text-foreground`,children:[u,d]})}),t[9]=l,t[10]=d,t[11]=m):m=t[11];let y;t[12]===o?y=t[13]:(y=(0,Q.jsx)(_,{className:`max-w-64`,children:o.length>1?(0,Q.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:o.map(nt)}):(0,Q.jsx)(f,{id:`2zvUIK`})}),t[12]=o,t[13]=y);let b;t[14]!==m||t[15]!==y?(b=(0,Q.jsxs)(ee,{children:[m,y]}),t[14]=m,t[15]=y,t[16]=b):b=t[16];let x;t[17]===s?x=t[18]:(x=s({id:`pFRz_E`}),t[17]=s,t[18]=x);let S;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Q.jsx)(te,{className:`size-3`}),t[19]=S):S=t[19];let C;t[20]!==i||t[21]!==x?(C=(0,Q.jsx)(v,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":x,onClick:i,className:`size-4 p-0 text-muted-foreground hover:text-foreground`,children:S}),t[20]=i,t[21]=x,t[22]=C):C=t[22];let w;return t[23]!==C||t[24]!==b?(w=(0,Q.jsxs)(`span`,{"data-testid":`composer-context-chip-comments`,className:c,children:[b,C]}),t[23]=C,t[24]=b,t[25]=w):w=t[25],w}function nt(e){return(0,Q.jsxs)(`li`,{className:`flex items-baseline gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`tabular-nums`,children:e.count}),(0,Q.jsx)(`span`,{className:`truncate`,children:it(e.docName)})]},e.docName)}function rt(){return o()}function it(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function at(e,t){let n=e;for(let e of t)n+=typeof e==`number`?`[${e}]`:`.${e}`;return n}function ot(e){Ze({docName:e.docName,quote:e.target.kind===`property`?``:e.anchor?.quote??``,threadId:e.id,context:e.anchor??void 0});let{target:t,anchor:n}=e;if(t.kind!==`property`||n===null)return;let r=0,i=()=>{pe({key:t.key,path:t.path,quote:n.quote,start:n.start,end:n.end})||(r+=1,!(r>=st)&&requestAnimationFrame(i))};requestAnimationFrame(i)}var st=30;function ct(e){return{docName:e.docName,body:e.instruction,propertyKey:e.property,quote:e.passage?.exact??``,anchorLost:e.anchorLost,prefix:e.passage?.prefix??``,suffix:e.passage?.suffix??``,repeats:e.passageRepeats}}var $=48;function lt(e){let t=e.replace(/\s+/g,` `).trimStart();return t.length>$?`…${t.slice(-$)}`:t}function ut(e){let t=e.replace(/\s+/g,` `).trimEnd();return t.length>$?`${t.slice(0,$)}…`:t}function dt(e){if(!e.repeats)return null;let t=lt(e.prefix),n=ut(e.suffix);return t===``&&n===``?null:`(This text appears more than once in the file. The one meant is ${t===``?`at the start of the file, followed by "${n}"`:n===``?`at the end of the file, preceded by "${t}"`:`between "${t}" and "${n}"`} — match that context rather than the first occurrence.)`}function ft(e,t,n){let r=t.trim(),i=[];if(i.push(r.length>0?r:`Address the following review comments by editing the documents directly.`),i.push(``),i.push(e.length===1?`The comment:`:`The ${e.length} comments:`),e.forEach((e,t)=>{if(i.push(``),e.propertyKey){let n=e.quote.trim();if(n===``)i.push(`${t+1}. In \`${e.docName}\`, on the \`${e.propertyKey}\` property (frontmatter):`),i.push(``),i.push(` ${e.body.trim()}`);else{i.push(`${t+1}. In \`${e.docName}\`, on this text within the \`${e.propertyKey}\` property (frontmatter):`),i.push(``);for(let e of n.split(`
4
+ `)return!0;if(t!==` `&&t!==` `)return!1}return!0}function R(e,t){let n=e[t];if(n===void 0)return 0;if(L(e,t)){let n=Fe(e,t);if(n>0)return n}if(n===je)return 1;if(n===`<`){let n=be.exec(e.slice(t,t+xe))?.[0].length;return n===void 0?+!!ve(e,t):n}if(n===`>`&&ye(e,t))return 1;if(n===`=`){let n=_e.exec(e.slice(t,t+3))?.[0].length;if(n!==void 0)return n}if(n===`!`)return+!!Se.test(e.slice(t,t+2));if(ge.has(n))return 1;if(n===`[`){let n=e.slice(t,t+N),r=Te.exec(n)?.[0].length;return r===void 0?Ce.test(n)?2:1:r}if(n===`#`){let n=Ee.exec(e.slice(t,t+N))?.[0].length;if(n!==void 0)return n}if(n===`]`){if(e[t+1]===`]`)return 2;let n=e.slice(t,t+Math.max(Oe,N)),r=De.exec(n)?.[0].length;if(r!==void 0)return r;let i=we.exec(n)?.[0].length;return i===void 0?1:i}return L(e,t)?ke.exec(e.slice(t,t+Ae))?.[0].length??0:0}function z(e,t,{syntaxIn:n}){let r=[];if(t.length===0)return r;let i=n===`haystack`;for(let n=0;n<e.length;n+=1){let a=e[n];if(a===void 0||I(a)||i&&a!==t[0]&&(R(e,n)>0||F(e,n)!==null))continue;let o=n,s=0;for(;o<e.length&&s<t.length;){let n=e[o],r=t[s];if(n===r){o+=1,s+=1;continue}if(I(r)){s+=1;continue}if(I(n)){o+=1;continue}let a=i?R(e,o):R(t,s);if(a>0){i?o+=a:s+=a;continue}let c=i?F(e,o):F(t,s);if(c!==null){let n=i?t:e,r=i?s:o,a=!0;for(let e of c.rendered)if(!I(e)){for(;r<n.length&&I(n[r]);)r+=1;if(n[r]!==e){a=!1;break}r+=1}if(!a)break;i?(o+=c.length,s=r):(s+=c.length,o=r);continue}break}for(;s<t.length&&I(t[s]);)s+=1;s===t.length&&r.push({start:n,end:o})}return r}var B=8,V=64;function H(e,t,n,r){let i=``,a=Math.max(0,t),o=Math.min(e.length,n);for(;a<o;){let t=e[a];if(I(t)){a+=1;continue}if(r){let t=R(e,a);if(t>0){a+=t;continue}let n=F(e,a);if(n!==null){for(let e of n.rendered)I(e)||(i+=e);a+=n.length;continue}}i+=t,a+=1}return i}function Ie(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[e.length-1-r]===t[t.length-1-r];)r+=1;return r}function Le(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r+=1;return r}function U(e,t,n,{syntaxIn:r,syntaxInContext:i=!1}){let a=n.prefix??``,o=n.suffix??``,s=r===`haystack`,c=0;if(a.length>0){let n=a.length*B+V;c+=Ie(H(a,0,a.length,i),H(e,t.start-n,t.start,s))}if(o.length>0){let n=o.length*B+V;c+=Le(H(o,0,o.length,i),H(e,t.end,t.end+n,s))}return c}function Re(e,{syntaxInContext:t=!1}={}){let n=H(e.prefix??``,0,1/0,t).length+H(e.suffix??``,0,1/0,t).length;return Math.min(8,n)}function ze(e){return Math.max(e*4,e+64)}function W(e,{includeBlockComponents:t=!1}={}){let n=``,r=[];return e.descendants((e,i)=>{if(e.isText&&e.text){for(let t=0;t<e.text.length;t++)n+=e.text[t],r.push(i+t);return!0}if(e.isBlock&&!t)return!0;let a=o(e);if(a.length>0){let t=i+e.nodeSize-1;for(let e=0;e<a.length;e++)n+=a[e],r.push(e===a.length-1?t:i)}return!0}),{text:n,positions:r}}function Be(e,t){let n=[];if(t===``)return n;let r=e.indexOf(t);for(;r!==-1;)n.push(r),r=e.indexOf(t,r+1);return n}function G(e,t,n){let r=n?.prefix??``,i=n?.suffix??``;if(r===``&&i===``)return null;let a=r===``?[0]:z(e,r,{syntaxIn:`needle`}).map(e=>e.end),o=i===``?[e.length]:z(e,i,{syntaxIn:`needle`}).map(e=>e.start);if(a.length!==1||o.length!==1)return null;let s=a[0],c=o[0];for(;s<c&&/\s/.test(e[s]??``);)s+=1;for(;c>s&&/\s/.test(e[c-1]??``);)--c;if(c<=s)return null;let l=ze(t.length);return c-s>l?null:{start:s,end:c}}function K(e,t){let n=e.positions[t.start],r=e.positions[t.end-1];return n==null||r==null?null:{from:n,to:r+1}}function q(e,t,n){if(t.length===0)return null;let r=Be(e.text,t).map(e=>({start:e,end:e+t.length}));if(r.length===0&&(r=z(e.text,t,{syntaxIn:`needle`})),r.length===0){let r=G(e.text,t,n);return r===null?null:K(e,r)}let i=n?.prefix??``,a=n?.suffix??``,o=t=>e.text.includes(t)||z(e.text,t,{syntaxIn:`needle`}).length>0;if(i!==``&&a!==``&&!o(i+t+a)&&o(i+a))return null;let s=Re({prefix:i,suffix:a},{syntaxInContext:!0}),c=t=>s===0||U(e.text,t,{prefix:i,suffix:a},{syntaxIn:`none`,syntaxInContext:!0})>=s;if(r.length===1){if(!c(r[0])){let r=G(e.text,t,n);return r===null?null:K(e,r)}return K(e,r[0])}let l=[],u=-1;for(let t of r){let n=U(e.text,t,{prefix:i,suffix:a},{syntaxIn:`none`,syntaxInContext:!0});n>u?(u=n,l=[t]):n===u&&l.push(t)}if(!c(l[0])){let r=G(e.text,t,n);return r===null?null:K(e,r)}return K(e,l[0])}var J=64;function Ve(e,t,n){return{prefix:i(e,Math.max(0,t-J),t),suffix:i(e,n,Math.min(e.content.size,n+J))}}function Y(e,t,n){return X(e)(t,n)}function X(e){let t=W(e),n=null;return(r,i)=>{let a=q(t,r,i);return a===null?(n??=W(e,{includeBlockComponents:!0}),q(n,r,i)):a}}var He=220,Ue=24;function We(e){let t=e.viewTop+e.insetTop,n=e.viewBottom-He;return e.anchorTop>=t&&e.anchorBottom<=n?0:e.anchorTop-(t+Ue)}function Z(e){let t=e?.parentElement??null;for(;t;){let e=getComputedStyle(t).overflowY;if(e===`auto`||e===`scroll`)return t;t=t.parentElement}return null}function Ge(e){let t=Number.parseFloat(getComputedStyle(e).scrollPaddingTop);return Number.isFinite(t)?t:0}function Ke(e,t,n,r){let i=S(e);if(!i)return!1;let o=Z(i.dom);if(!o)return a(n,`comment-reveal`,()=>e.commands.scrollIntoView());let s,c;try{s=i.coordsAtPos(t.from),c=i.coordsAtPos(t.to)}catch{return!1}let l=o.getBoundingClientRect(),u=We({anchorTop:s.top,anchorBottom:Math.max(s.bottom,c.bottom),viewTop:l.top,viewBottom:l.bottom,insetTop:Ge(o)});if(u===0)return!0;let d=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;return a(n,`comment-reveal`,()=>o.scrollTo({top:o.scrollTop+u,behavior:r?.instant||d?`auto`:`smooth`}))}var qe=1e4,Je=80,Ye=1500,Xe=[`wheel`,`touchstart`,`mousedown`,`keydown`];function Ze(e){let n=!1,i=null,a=null,o=-1,s=()=>{let s=l(e.docName);if(!s||s.isDestroyed)return!1;if(n||(n=!0,t(e.threadId)),e.quote===``)return i===null&&(i=Date.now(),r(e.threadId)),!0;let c=s.state.doc.content.size;return(a===null||c!==o)&&(a=Y(s.state.doc,e.quote,e.context),o=c),!a||!Ke(s,a,e.docName,{instant:!0})?!1:(i===null&&(i=Date.now(),r(e.threadId)),!0)};u(`comments`),s(),l(e.docName)===null&&window.location.assign(w(e.docName));let c=!1,f=()=>{if(!c){c=!0,h(),window.clearInterval(g),window.clearTimeout(_);for(let e of Xe)window.removeEventListener(e,p,!0)}},p=()=>f(),m=()=>{s()&&i!==null&&Date.now()-i>=Ye&&f()},h=d(m),g=window.setInterval(m,Je),_=window.setTimeout(()=>{i===null&&y.error(n?b._({id:`KeXgA-`}):b._({id:`JDQ5I5`})),f()},qe);for(let e of Xe)window.addEventListener(e,p,!0);m()}var Q=e();function Qe(){return s().length}function $e(){let e=(0,E.c)(4),t=s(),r;if(e[0]!==t){r=new Map;for(let e of t){let t=n(e)?.docName;t!==void 0&&r.set(t,(r.get(t)??0)+1)}e[0]=t,e[1]=r}else r=e[1];let i;return e[2]===r?i=e[3]:(i=[...r].map(et),e[2]=r,e[3]=i),i}function et(e){let[t,n]=e;return{docName:t,count:n}}function tt(e){let t=(0,E.c)(26),{count:n,docs:r,onDismiss:i}=e,a;t[0]===r?a=t[1]:(a=r===void 0?[]:r,t[0]=r,t[1]=a);let o=a,{_:s}=p();if(n===0)return null;let c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=h(`inline-flex items-center gap-1 rounded-md border bg-muted/60 py-0.5 pr-0.5 pl-1.5`,`text-xs text-muted-foreground`),t[2]=c):c=t[2];let l;t[3]===s?l=t[4]:(l=s({id:`2zvUIK`}),t[3]=s,t[4]=l);let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(T,{className:`size-3`}),t[5]=u):u=t[5];let d;t[6]!==n||t[7]!==o.length?(d=o.length>1?(0,Q.jsx)(f,{id:`5TmrYN`,values:{0:o.length,count:n}}):(0,Q.jsx)(f,{id:`eiUA4k`,values:{count:n}}),t[6]=n,t[7]=o.length,t[8]=d):d=t[8];let m;t[9]!==l||t[10]!==d?(m=(0,Q.jsx)(g,{asChild:!0,children:(0,Q.jsxs)(v,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":l,onClick:rt,"data-testid":`composer-comments-open-panel`,className:`h-auto min-h-0 gap-1 px-0.5 py-0 text-xs font-normal text-muted-foreground hover:text-foreground`,children:[u,d]})}),t[9]=l,t[10]=d,t[11]=m):m=t[11];let y;t[12]===o?y=t[13]:(y=(0,Q.jsx)(_,{className:`max-w-64`,children:o.length>1?(0,Q.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:o.map(nt)}):(0,Q.jsx)(f,{id:`2zvUIK`})}),t[12]=o,t[13]=y);let b;t[14]!==m||t[15]!==y?(b=(0,Q.jsxs)(ee,{children:[m,y]}),t[14]=m,t[15]=y,t[16]=b):b=t[16];let x;t[17]===s?x=t[18]:(x=s({id:`pFRz_E`}),t[17]=s,t[18]=x);let S;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Q.jsx)(te,{className:`size-3`}),t[19]=S):S=t[19];let C;t[20]!==i||t[21]!==x?(C=(0,Q.jsx)(v,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":x,onClick:i,className:`size-4 p-0 text-muted-foreground hover:text-foreground`,children:S}),t[20]=i,t[21]=x,t[22]=C):C=t[22];let w;return t[23]!==C||t[24]!==b?(w=(0,Q.jsxs)(`span`,{"data-testid":`composer-context-chip-comments`,className:c,children:[b,C]}),t[23]=C,t[24]=b,t[25]=w):w=t[25],w}function nt(e){return(0,Q.jsxs)(`li`,{className:`flex items-baseline gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`tabular-nums`,children:e.count}),(0,Q.jsx)(`span`,{className:`truncate`,children:it(e.docName)})]},e.docName)}function rt(){return c()}function it(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function at(e,t){let n=e;for(let e of t)n+=typeof e==`number`?`[${e}]`:`.${e}`;return n}function ot(e){Ze({docName:e.docName,quote:e.target.kind===`property`?``:e.anchor?.quote??``,threadId:e.id,context:e.anchor??void 0});let{target:t,anchor:n}=e;if(t.kind!==`property`||n===null)return;let r=0,i=()=>{pe({key:t.key,path:t.path,quote:n.quote,start:n.start,end:n.end})||(r+=1,!(r>=st)&&requestAnimationFrame(i))};requestAnimationFrame(i)}var st=30;function ct(e){return{docName:e.docName,body:e.instruction,propertyKey:e.property,quote:e.passage?.exact??``,anchorLost:e.anchorLost,prefix:e.passage?.prefix??``,suffix:e.passage?.suffix??``,repeats:e.passageRepeats}}var $=48;function lt(e){let t=e.replace(/\s+/g,` `).trimStart();return t.length>$?`…${t.slice(-$)}`:t}function ut(e){let t=e.replace(/\s+/g,` `).trimEnd();return t.length>$?`${t.slice(0,$)}…`:t}function dt(e){if(!e.repeats)return null;let t=lt(e.prefix),n=ut(e.suffix);return t===``&&n===``?null:`(This text appears more than once in the file. The one meant is ${t===``?`at the start of the file, followed by "${n}"`:n===``?`at the end of the file, preceded by "${t}"`:`between "${t}" and "${n}"`} — match that context rather than the first occurrence.)`}function ft(e,t,n){let r=t.trim(),i=[];if(i.push(r.length>0?r:`Address the following review comments by editing the documents directly.`),i.push(``),i.push(e.length===1?`The comment:`:`The ${e.length} comments:`),e.forEach((e,t)=>{if(i.push(``),e.propertyKey){let n=e.quote.trim();if(n===``)i.push(`${t+1}. In \`${e.docName}\`, on the \`${e.propertyKey}\` property (frontmatter):`),i.push(``),i.push(` ${e.body.trim()}`);else{i.push(`${t+1}. In \`${e.docName}\`, on this text within the \`${e.propertyKey}\` property (frontmatter):`),i.push(``);for(let e of n.split(`
5
5
  `))i.push(` > ${e}`);i.push(``),i.push(` ${e.body.trim()}`)}e.anchorLost&&(i.push(``),i.push(n===``?` (Note: \`${e.propertyKey}\` is no longer in this document's frontmatter — it was renamed or removed since the comment was written. Do not apply this to a different property; if you cannot tell what it now refers to, say so instead of guessing.)`:` (Note: that text is no longer in \`${e.propertyKey}\` — the value was edited, reshaped, or removed since the comment was written. Do not apply this to a different property or a different part of the value; if you cannot tell what it now refers to, say so instead of guessing.)`));return}i.push(`${t+1}. In \`${e.docName}\`, on this passage:`),i.push(``);for(let t of e.quote.split(`
6
6
  `))i.push(` > ${t}`);i.push(``),i.push(` ${e.body.trim()}`);let n=dt(e);n!==null&&(i.push(``),i.push(` ${n}`)),e.anchorLost&&(i.push(``),i.push(` (Note: this passage is no longer in the document — it was edited or removed since the comment was written. Do not apply this to a different passage; if you cannot tell what it now refers to, say so instead of guessing.)`))}),n&&n.markdown.trim().length>0){i.push(``),i.push(`Also in scope, selected in \`${n.docName}\` (not a comment):`),i.push(``);for(let e of n.markdown.trim().split(`
7
7
  `))i.push(`> ${e}`)}return i.join(`