@inkeep/open-knowledge 0.59.0-beta.25 → 0.59.0-beta.27

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 (164) hide show
  1. package/dist/{acp-harness-probe-Dn5m6SU4.mjs → acp-harness-probe-CHDRVQpq.mjs} +2 -2
  2. package/dist/cli.mjs +11 -11
  3. package/dist/config-schema.json +2 -36
  4. package/dist/config.project.schema.json +2 -36
  5. package/dist/constants-DSNC3wSl.mjs +2 -0
  6. package/dist/{fs-traced-6G_aFzgy.mjs → fs-traced-1KTQL4h-.mjs} +6 -6
  7. package/dist/fs-traced-Dak_kryQ.mjs +1 -0
  8. package/dist/git-handle-DmslHvlR.mjs +1 -0
  9. package/dist/{git-handle-BamU1o3R.mjs → git-handle-v3HRk0k0.mjs} +2 -2
  10. package/dist/index.d.mts +0 -5
  11. package/dist/index.mjs +144 -144
  12. package/dist/init-CcwKgR9R.mjs +1 -0
  13. package/dist/{init-Br4iow-A.mjs → init-zTOfz-Hi.mjs} +3 -3
  14. package/dist/{launch-json-removal-CVzBP9hN.mjs → launch-json-removal-CK23LZq3.mjs} +2 -2
  15. package/dist/loader-Bbx1ChcV.mjs +1 -0
  16. package/dist/{loader-D2-VlLlB.mjs → loader-ChVnFNzU.mjs} +2 -2
  17. package/dist/md-manager-7voOTrzM.mjs +2 -0
  18. package/dist/native/native-config.linux-x64-gnu.node +0 -0
  19. package/dist/{open-browser-CD86-cP6.mjs → open-browser-DD5VHxHl.mjs} +2 -2
  20. package/dist/parse-worker.mjs +1 -1
  21. package/dist/{preview-BEsVXytQ.mjs → preview-CIkhwrjV.mjs} +2 -2
  22. package/dist/preview-DcSm8SQu.mjs +1 -0
  23. package/dist/public/assets/{ActivityModeContent-_Kopxpth.js → ActivityModeContent-DJkcYUFG.js} +1 -1
  24. package/dist/public/assets/{AgentDiffPane-C9vavOBW.js → AgentDiffPane-QpnE2RxP.js} +1 -1
  25. package/dist/public/assets/{AgentThreadClientBinder-DyRJbgYV.js → AgentThreadClientBinder-BNxw9YWy.js} +1 -1
  26. package/dist/public/assets/{CodeMirrorPropInput-Cw9Wgv0Z.js → CodeMirrorPropInput-DlJxY2cd.js} +1 -1
  27. package/dist/public/assets/{DocumentContext-CKBQLPkm.js → DocumentContext-BI0smsxZ.js} +1 -1
  28. package/dist/public/assets/{EditorModeToggle-BO-U-stJ.js → EditorModeToggle-DVfUE-Hx.js} +1 -1
  29. package/dist/public/assets/{EnableSyncConfirmDialog-OQmj0lgC.js → EnableSyncConfirmDialog-CH3AktRr.js} +1 -1
  30. package/dist/public/assets/{ExcalidrawDocEditor-XBVeHLJH.js → ExcalidrawDocEditor-HqU6SXrF.js} +1 -1
  31. package/dist/public/assets/FeedbackForm-DfjQFt_o.js +1 -0
  32. package/dist/public/assets/{GraphPanel-DjOi0m6N.js → GraphPanel-MtHSCEEc.js} +1 -1
  33. package/dist/public/assets/{ImportSkillDialog-JTroqgtg.js → ImportSkillDialog-DqbRbXfG.js} +1 -1
  34. package/dist/public/assets/{LintConfigEditor-Cjn744bz.js → LintConfigEditor-DQQlzcbN.js} +1 -1
  35. package/dist/public/assets/{ManagedArtifactProperties-DnH4WPYi.js → ManagedArtifactProperties-CPsIQVz8.js} +1 -1
  36. package/dist/public/assets/ManagedArtifactProperties-DkmtIVIZ.js +1 -0
  37. package/dist/public/assets/{MermaidDocEditor-9WKd_xgY.js → MermaidDocEditor-UIF1Y7PM.js} +1 -1
  38. package/dist/public/assets/{PropertyDisplayRow-DdhcdIOL.js → PropertyDisplayRow-BPCVo30u.js} +1 -1
  39. package/dist/public/assets/{ReportBugDialogBody-DI4KGY6b.js → ReportBugDialogBody-BoQrLPkN.js} +1 -1
  40. package/dist/public/assets/{SchemaConfigEditor-TJOWgbWx.js → SchemaConfigEditor-D5aVltyV.js} +1 -1
  41. package/dist/public/assets/{SessionsHost-k_yT98_h.js → SessionsHost-B0WtFo-7.js} +2 -2
  42. package/dist/public/assets/{SettingsDialogBody-Bbaxgaq5.js → SettingsDialogBody-Cbsyvnqh.js} +1 -1
  43. package/dist/public/assets/{ShareBranchSwitchDialog-DzKK9STn.js → ShareBranchSwitchDialog-DxracRWc.js} +1 -1
  44. package/dist/public/assets/{ShareReceiveDialog-DH2fH5Ep.js → ShareReceiveDialog-Cfp4wdzT.js} +1 -1
  45. package/dist/public/assets/{ShareReceiveMissDialog-GK2Vx2SV.js → ShareReceiveMissDialog-DxcAaxnj.js} +1 -1
  46. package/dist/public/assets/{SkillCostValue-CcR1g_YK.js → SkillCostValue-CDg_lpMT.js} +1 -1
  47. package/dist/public/assets/{SkillEditBanner-Bygl2n7y.js → SkillEditBanner-BEG94SMV.js} +1 -1
  48. package/dist/public/assets/{SkillInstallMenu-8gIaj3K5.js → SkillInstallMenu-xkIcUjyz.js} +1 -1
  49. package/dist/public/assets/{SkillOriginInline-wsT9RocF.js → SkillOriginInline-WxvVrIDh.js} +1 -1
  50. package/dist/public/assets/{SkillToolbarControls-DiX-HmhZ.js → SkillToolbarControls-BvIlOBgX.js} +1 -1
  51. package/dist/public/assets/{SlidesToolbarControls-Bli5Kfnf.js → SlidesToolbarControls-DMGLRgXN.js} +1 -1
  52. package/dist/public/assets/{SourceEditor-Dubsx6EI.js → SourceEditor-BoCr54OC.js} +1 -1
  53. package/dist/public/assets/{TerminalPanel-ByZlnAVD.js → TerminalPanel-B136_x01.js} +1 -1
  54. package/dist/public/assets/{TerminalWindowApp-B0XS4Hcx.js → TerminalWindowApp-C7xQ_h9C.js} +1 -1
  55. package/dist/public/assets/{TextDocEditor-DwRrVvT6.js → TextDocEditor-DZYfekpd.js} +1 -1
  56. package/dist/public/assets/ThreadView-DenCwvfW.js +14 -0
  57. package/dist/public/assets/{TimelineDiffPane-CGZJWY1U.js → TimelineDiffPane-XlGr0GTw.js} +1 -1
  58. package/dist/public/assets/{agent-diff-store-CqhHOxEp.js → agent-diff-store-BVPptGby.js} +1 -1
  59. package/dist/public/assets/{auth-state-cache-BB3XgwHT.js → auth-state-cache-DWZvELXg.js} +1 -1
  60. package/dist/public/assets/client-version-D2k9ZCWX.js +1 -0
  61. package/dist/public/assets/{comment-chips-q2xW3a4a.js → comment-chips-D_lOHAKs.js} +1 -1
  62. package/dist/public/assets/{config-provider-jTKr3hjM.js → config-provider-CDwrJPp7.js} +3 -3
  63. package/dist/public/assets/{dist-C1cuuJXO2.js → dist-Cjt7VASv2.js} +38 -38
  64. package/dist/public/assets/{doc-paths-Bc7iTgnL.js → doc-paths-B8neiW-a.js} +1 -1
  65. package/dist/public/assets/{documents-events-ChHRY_IT.js → documents-events-XYcpMExe.js} +1 -1
  66. package/dist/public/assets/{file-tree-adapter-Cn1x6E2_.js → file-tree-adapter-D09K46if.js} +1 -1
  67. package/dist/public/assets/{file-tree-utils-CE3Y3N48.js → file-tree-utils-D46TNM8I.js} +1 -1
  68. package/dist/public/assets/{folder-config-api-Drl7C-wY.js → folder-config-api-BF1s5fn5.js} +1 -1
  69. package/dist/public/assets/i18n-DyGGRo1x.js +1 -0
  70. package/dist/public/assets/{index-B4Yy1ZPO.js → index-DVAzmNmM.js} +7 -7
  71. package/dist/public/assets/{lint-config-client-BeZysGOL.js → lint-config-client-CexP4XjM.js} +1 -1
  72. package/dist/public/assets/{markdownlint-rule-browser-B7QG3apY.js → markdownlint-rule-browser-RW_wnt3c.js} +1 -1
  73. package/dist/public/assets/messages-C8jffdCe.js +1 -0
  74. package/dist/public/assets/messages-CHwiuY_J.js +1 -0
  75. package/dist/public/assets/messages-CU7VLvME.js +1 -0
  76. package/dist/public/assets/messages-CiFiW58E.js +1 -0
  77. package/dist/public/assets/messages-CjKUNgHP.js +1 -0
  78. package/dist/public/assets/messages-D3MBHECc.js +1 -0
  79. package/dist/public/assets/messages-D9ldJ6Xm.js +1 -0
  80. package/dist/public/assets/messages-DN37a6Ol.js +1 -0
  81. package/dist/public/assets/messages-DdRp2uUH.js +1 -0
  82. package/dist/public/assets/messages-DoKxyRgP.js +1 -0
  83. package/dist/public/assets/messages-J0QBWpSt.js +1 -0
  84. package/dist/public/assets/{messages-C_imTCtv.js → messages-W4EQLozB.js} +1 -1
  85. package/dist/public/assets/{navigation-targets-dmO4e4Qm.js → navigation-targets-B81SRxAl.js} +1 -1
  86. package/dist/public/assets/{open-managed-artifact-tab-D99Uwfo7.js → open-managed-artifact-tab-ONxSWsRO.js} +1 -1
  87. package/dist/public/assets/{pending-receive-nav-store-D17Qn4Gr.js → pending-receive-nav-store-EbqHz-1O.js} +1 -1
  88. package/dist/public/assets/{progress-DphMBTZQ.js → progress-BNa6s6eY.js} +1 -1
  89. package/dist/public/assets/{prop-types-CekqkyBi.js → prop-types-Bi69iPbr.js} +1 -1
  90. package/dist/public/assets/{receive-store-C4_wYBmA.js → receive-store-DvP10j_m.js} +1 -1
  91. package/dist/public/assets/{selection-context-C2Y6r5R9.js → selection-context-BT0IXs_k.js} +1 -1
  92. package/dist/public/assets/{skill-actions-DgO1eUGv.js → skill-actions-C6XMzsRk.js} +1 -1
  93. package/dist/public/assets/{skill-scope-BNRIoNFW.js → skill-scope-D_Zsy3lJ.js} +1 -1
  94. package/dist/public/assets/{skills-api-BHNlkzLI.js → skills-api-BM2BLHCX.js} +1 -1
  95. package/dist/public/assets/{src-8kgNVqg9.js → src-DMrqP3nT.js} +1 -1
  96. package/dist/public/assets/{tag-pill-input-9XCv-eGc.js → tag-pill-input-BFaMBmJa.js} +1 -1
  97. package/dist/public/assets/{target-navigation-intent-BHn4lUYz.js → target-navigation-intent-CWvy9cE2.js} +1 -1
  98. package/dist/public/assets/{telemetry-impl-T0tYRMlO.js → telemetry-impl-CuZ-qtZC.js} +1 -1
  99. package/dist/public/assets/{telemetry-startup-cht6PIz2.js → telemetry-startup-CSHPwDgJ.js} +1 -1
  100. package/dist/public/assets/{terminal-cli-display-C9RSSYZZ.js → terminal-cli-display-BbYqTPWX.js} +1 -1
  101. package/dist/public/assets/{terminal-launch-events-CJ5--wwM.js → terminal-launch-events-BPjoquS2.js} +1 -1
  102. package/dist/public/assets/{terminal-telemetry-g2Rame0f.js → terminal-telemetry-DxMhdnxk.js} +1 -1
  103. package/dist/public/assets/{typing-burst-detector-BQN1kkiQ.js → typing-burst-detector-B7DPFEEZ.js} +1 -1
  104. package/dist/public/assets/{uninstall-C_cCW9T6.js → uninstall-DDXNRWQJ.js} +1 -1
  105. package/dist/public/assets/{use-activity-panel-Bf6QGzBV.js → use-activity-panel-CsxwP-4j.js} +1 -1
  106. package/dist/public/assets/{use-apply-config-color-theme-g3ghtVU3.js → use-apply-config-color-theme-cAcJ-HL5.js} +1 -1
  107. package/dist/public/assets/{use-collab-url-C0l9GQW6.js → use-collab-url-C79vcmVC.js} +1 -1
  108. package/dist/public/assets/{use-live-xterm-theme-CURX_Vkk.js → use-live-xterm-theme-D63CLflu.js} +1 -1
  109. package/dist/public/assets/{use-open-skill-BCHQBNLa.js → use-open-skill-BXh-h1Gy.js} +1 -1
  110. package/dist/public/assets/{use-popular-skills-CK1_ANLy.js → use-popular-skills-Dzx69gvR.js} +1 -1
  111. package/dist/public/assets/{use-settings-route-BzQtFbVz.js → use-settings-route-DT_sDrP6.js} +1 -1
  112. package/dist/public/assets/{use-skill-origin-BM7aK7w5.js → use-skill-origin-djszP4BX.js} +1 -1
  113. package/dist/public/assets/{use-terminal-enabled-BYaosbiD.js → use-terminal-enabled-D8pfw24f.js} +1 -1
  114. package/dist/public/assets/{use-timeline-entry-diff-BH3jqpge.js → use-timeline-entry-diff-CJndzyXq.js} +1 -1
  115. package/dist/public/assets/{use-workspace-uQYd5g6N.js → use-workspace-DanpYgc9.js} +1 -1
  116. package/dist/public/index.html +46 -46
  117. package/dist/public/uninstall.html +4 -4
  118. package/dist/{repair-launch-json-DOf85ekK.mjs → repair-launch-json-CSJT9xyg.mjs} +2 -2
  119. package/dist/{repair-mcp-configs-DGCzXBSl.mjs → repair-mcp-configs-DHHaYqN1.mjs} +2 -2
  120. package/dist/{repair-skills-CGrC_7UB.mjs → repair-skills-DTu-V4yJ.mjs} +2 -2
  121. package/dist/repair-skills-DpzyUqvM.mjs +1 -0
  122. package/dist/{resolve-project-root--qXrA21F.mjs → resolve-project-root-CjlK19bg.mjs} +2 -2
  123. package/dist/schemas/v0/config.project.schema.json +2 -36
  124. package/dist/server-lock-BZd8WJ5h.mjs +1 -0
  125. package/dist/{server-lock-BbnnWHQ-.mjs → server-lock-D3OwE6nq.mjs} +2 -2
  126. package/dist/{skill-teardown-BOfnXWGl.mjs → skill-teardown-dynTQKdJ.mjs} +2 -2
  127. package/dist/{sleep-CEs13Om_.mjs → sleep-DXvB05wr.mjs} +5 -5
  128. package/dist/src-BgcwWUW8.mjs +1 -0
  129. package/dist/{src-B97wzPKQ.mjs → src-D81I39eV.mjs} +3 -3
  130. package/dist/{src-CUzcBQEu.mjs → src-DC0dXNgq.mjs} +248 -248
  131. package/dist/{src-oOfi47J8.mjs → src-DRQtLkln.mjs} +1 -1
  132. package/dist/src-UoW_X1C6.mjs +357 -0
  133. package/dist/start-CZTOPPJD.mjs +1 -0
  134. package/dist/start-Cxm5f8Vn.mjs +4 -0
  135. package/package.json +5 -5
  136. package/dist/constants-B47r0DAb.mjs +0 -2
  137. package/dist/fs-traced-C9RP1mJ2.mjs +0 -1
  138. package/dist/git-handle-B8IJwypU.mjs +0 -1
  139. package/dist/init-D5otPzBM.mjs +0 -1
  140. package/dist/loader-DHuuCI2I.mjs +0 -1
  141. package/dist/md-manager-CE7LjnX6.mjs +0 -2
  142. package/dist/preview-kJTbEGyc.mjs +0 -1
  143. package/dist/public/assets/FeedbackForm-xL0JcY4M.js +0 -1
  144. package/dist/public/assets/ManagedArtifactProperties-Cz-TenGH.js +0 -1
  145. package/dist/public/assets/ThreadView-DjiRLX3i.js +0 -14
  146. package/dist/public/assets/client-version-B8t572qZ.js +0 -1
  147. package/dist/public/assets/i18n-Ddg_NfF0.js +0 -1
  148. package/dist/public/assets/messages-BhuJJrXm.js +0 -1
  149. package/dist/public/assets/messages-C1-8WsW-.js +0 -1
  150. package/dist/public/assets/messages-C2SkGuOW.js +0 -1
  151. package/dist/public/assets/messages-C8J0bHS1.js +0 -1
  152. package/dist/public/assets/messages-CRyXNONN.js +0 -1
  153. package/dist/public/assets/messages-CWqIKcIn.js +0 -1
  154. package/dist/public/assets/messages-D8ZJtm04.js +0 -1
  155. package/dist/public/assets/messages-D91wY0jc.js +0 -1
  156. package/dist/public/assets/messages-DKrriYGt.js +0 -1
  157. package/dist/public/assets/messages-TSlW_hwS.js +0 -1
  158. package/dist/public/assets/messages-UVTad7G3.js +0 -1
  159. package/dist/repair-skills-Bxm3hryZ.mjs +0 -1
  160. package/dist/server-lock-DAYx4_kR.mjs +0 -1
  161. package/dist/src-_JbAf6nM.mjs +0 -357
  162. package/dist/src-dEvRdBw7.mjs +0 -1
  163. package/dist/start-BeMeMKMA.mjs +0 -8
  164. package/dist/start-CIi2MuA7.mjs +0 -1
@@ -1,4 +1,4 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{Qn as n,Zn as r,a as i,tr as a,zn as o}from"./DocumentContext-CKBQLPkm.js";import{t as s}from"./react-f2sANaYj.js";import{n as c,r as l}from"./dist-Nvb76hAm.js";import{t as u}from"./compiler-runtime-BfE3aGVn.js";import{t as d}from"./utils-CPqDy6Hr.js";import{C as f,S as p,_ as m,g as h,h as g,i as _}from"./SkillInstallMenu-8gIaj3K5.js";import{t as v}from"./button-CA0dewJJ.js";import{t as y}from"./dist-mv8e6dBX.js";import{i as b,n as x,t as S}from"./tooltip-DPvMEqsq.js";import{t as C}from"./alert-dialog-ZBAB0rfs.js";import{t as w}from"./checkbox-Bi7zk4c5.js";import{a as T,m as E,r as D,t as O}from"./dropdown-menu-DRIarAms.js";import{t as k}from"./label-Bbz2bT-a.js";import{i as A,n as j,o as M,s as N,t as P}from"./select-fWSYgcDA.js";import{n as F,t as I}from"./radio-group-BsZGGl8l.js";import{t as L}from"./switch-BeP1gMN6.js";import{n as R,t as z}from"./toggle-group-BlEg4yJE.js";import{Es as ee,Ho as B,Ht as V,Ls as H,St as U,Ut as W,Vt as G,Wt as K,en as te,oo as ne,qt as re,ws as q,zo as ie}from"./dist-C1cuuJXO2.js";import{n as J}from"./dist-DTX2HxC82.js";import{t as Y}from"./dist-BgXDUIPy.js";import{_ as X,s as ae,y as oe}from"./documents-events-ChHRY_IT.js";import{n as se}from"./config-context-BH8hj2sg.js";import{t as ce}from"./parse-api-error-DcnXKbfT.js";import{t as le}from"./use-workspace-uQYd5g6N.js";import{t as ue}from"./createLucideIcon-CAkY8Blx.js";import{m as de,n as fe,r as pe,t as me}from"./EnableSyncConfirmDialog-OQmj0lgC.js";import{s as he}from"./Mermaid-D6W1JO-s.js";import{t as ge}from"./arrow-up-right-CXMA4cr5.js";import{t as _e}from"./check-Bzwwm-o4.js";import{s as ve}from"./prop-types-CekqkyBi.js";import{t as ye}from"./download-Bdmlj4Jo.js";import{a as be,r as xe,t as Se}from"./folder-config-api-Drl7C-wY.js";import{t as Ce}from"./spinner-DmibE6UV.js";import{t as we}from"./refresh-cw-D41gUk_B.js";import{t as Te}from"./trash-2-BVoWHmfV.js";import{t as Ee}from"./triangle-alert-CJVfCxE0.js";import{t as De}from"./x-wQUDJS55.js";import{f as Oe,n as ke,u as Ae,y as je}from"./doc-paths-Bc7iTgnL.js";import{f as Me,t as Ne}from"./skill-scope-BNRIoNFW.js";import{a as Pe,i as Fe,n as Ie,o as Le,r as Re,s as ze,t as Be}from"./field-C1cHfxiy.js";import{t as Ve}from"./input-DikXDeKw.js";import{a as He,c as Ue,i as We,n as Ge,o as Ke,s as qe,t as Je}from"./dialog-DD-GTVf9.js";import{i as Ye,r as Xe,t as Ze}from"./popover-C7NTz6uK.js";import{S as Qe,h as $e,i as et,p as tt}from"./skills-api-BHNlkzLI.js";import"./config-provider-jTKr3hjM.js";import{t as nt}from"./external-link-Dzk3biRr.js";import{t as rt}from"./textarea-BoMa_3jF.js";var it=ue(`cloud-off`,[[`path`,{d:`M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057`,key:`1uxyv8`}],[`path`,{d:`M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78`,key:`99tcn7`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),at=ue(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),ot=ue(`log-in`,[[`path`,{d:`m10 17 5-5-5-5`,key:`1bsop3`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4`,key:`u53s6r`}]]),st=ue(`move-up-right`,[[`path`,{d:`M13 5H19V11`,key:`1n1gyv`}],[`path`,{d:`M19 5L5 19`,key:`72u4yj`}]]),ct=ue(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),lt=ue(`user-cog`,[[`path`,{d:`M10 15H6a4 4 0 0 0-4 4v2`,key:`1nfge6`}],[`path`,{d:`m14.305 16.53.923-.382`,key:`1itpsq`}],[`path`,{d:`m15.228 13.852-.923-.383`,key:`eplpkm`}],[`path`,{d:`m16.852 12.228-.383-.923`,key:`13v3q0`}],[`path`,{d:`m16.852 17.772-.383.924`,key:`1i8mnm`}],[`path`,{d:`m19.148 12.228.383-.923`,key:`1q8j1v`}],[`path`,{d:`m19.53 18.696-.382-.924`,key:`vk1qj3`}],[`path`,{d:`m20.772 13.852.924-.383`,key:`n880s0`}],[`path`,{d:`m20.772 16.148.924.383`,key:`1g6xey`}],[`circle`,{cx:`18`,cy:`15`,r:`3`,key:`gjjjvw`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),Z=u(),Q=e(s(),1);function ut(e){let t=(0,Z.c)(12),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={status:`idle`},t[0]=n):n=t[0];let[r,i]=(0,Q.useState)(n),[a,o]=(0,Q.useState)(0),s,c;t[1]===e?(s=t[2],c=t[3]):(s=()=>{if(e!==null)return oe(()=>{o(mt)})},c=[e],t[1]=e,t[2]=s,t[3]=c),(0,Q.useEffect)(s,c);let l;t[4]===e?l=t[5]:(l=()=>{if(e===null){i({status:`idle`});return}let t=!1;i({status:`loading`});let n=e?`?path=${encodeURIComponent(e)}`:``;return fetch(`/api/folder-config${n}`).then(ft).then(e=>{if(!t){if(!e||typeof e!=`object`||!e.folder){i({status:`error`,message:Y._({id:`_ci9Bj`})});return}i({status:`ready`,data:{folder:e.folder,frontmatterLocal:e.frontmatter_local??null}})}}).catch(e=>{t||i({status:`error`,message:e instanceof Error?e.message:String(e)})}),()=>{t=!0}},t[4]=e,t[5]=l);let u;t[6]!==e||t[7]!==a?(u=[e,a],t[6]=e,t[7]=a,t[8]=u):u=t[8],(0,Q.useEffect)(l,u);let d;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>o(dt),t[9]=d):d=t[9];let f;return t[10]===r?f=t[11]:(f={state:r,refresh:d},t[10]=r,t[11]=f),f}function dt(e){return e+1}async function ft(e){if(!e.ok){let t=await e.json().catch(pt);throw Error(ce(t)??`HTTP ${e.status}`)}return e.json()}function pt(){return null}function mt(e){return e+1}function ht(){let e=(0,Z.c)(6),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={status:`idle`},e[0]=t):t=e[0];let[n,r]=(0,Q.useState)(t),[i,a]=(0,Q.useState)(0),o,s;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>oe(()=>{a(vt)}),s=[],e[1]=o,e[2]=s):(o=e[1],s=e[2]),(0,Q.useEffect)(o,s);let c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=!1;return r({status:`loading`}),fetch(`/api/templates`).then(gt).then(t=>{if(e)return;let n=te.safeParse(t);if(!n.success){console.error(`[ok-templates] /api/templates response failed schema validation:`,n.error.issues),r({status:`error`,message:Y._({id:`RLNIgv`})});return}r({status:`ready`,data:n.data.templates})}).catch(t=>{e||r({status:`error`,message:t instanceof Error?t.message:String(t)})}),()=>{e=!0}},e[3]=c):c=e[3];let l;return e[4]===i?l=e[5]:(l=[i],e[4]=i,e[5]=l),(0,Q.useEffect)(c,l),n}async function gt(e){if(!e.ok){let t=await e.json().catch(_t);throw Error(ce(t)??`HTTP ${e.status}`)}return e.json()}function _t(){return null}function vt(e){return e+1}async function yt(){try{let e=await fetch(`/api/semantic-status`);return e.ok?await e.json():(console.debug(`[semantic-status] probe returned`,e.status),null)}catch(e){return console.debug(`[semantic-status] probe failed`,e),null}}function bt(e){let t=(0,Z.c)(16),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let r=n.enabled??!0,[i,a]=(0,Q.useState)(null),o;t[2]===r?o=t[3]:(o=function(){r&&yt().then(e=>{e&&a(e)})},t[2]=r,t[3]=o);let s=o,c;t[4]===s?c=t[5]:(c=()=>{s()},t[4]=s,t[5]=c);let l;t[6]===r?l=t[7]:(l=[r],t[6]=r,t[7]=l),(0,Q.useEffect)(c,l);let u;t[8]!==r||t[9]!==s?(u=()=>{if(r)return X(e=>{e.includes(`files`)&&s()})},t[8]=r,t[9]=s,t[10]=u):u=t[10];let d;t[11]===r?d=t[12]:(d=[r],t[11]=r,t[12]=d),(0,Q.useEffect)(u,d);let f;return t[13]!==s||t[14]!==i?(f={status:i,refresh:s},t[13]=s,t[14]=i,t[15]=f):f=t[15],f}function xt(e){return e===`eperm`?Y._({id:`XuQzrk`}):Y._({id:`BUyQnq`})}async function St(e){let t=await e.restartServer(e.config.projectPath);return t.ok?{ok:!0}:{ok:!1,message:xt(t.reason)}}var $=t(),Ct=`github.com`,wt=new Map;async function Tt(e){try{let t=await e.json(),n=U.safeParse(t);if(n.success)return n.data.title}catch{}}async function Et(e,t){return fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t??{})})}async function Dt(e){let t=e?.host??Ct,n=await Et(`/api/local-op/auth/status`,e);if(!n.ok)return{authenticated:!1,host:t,error:await Tt(n)};let r=await n.json(),i=typeof r.host==`string`?r.host:t,a=r.ghAvailable===!0;if(r.authenticated===!0&&typeof r.login==`string`){let e=r.tier===`A`||r.tier===`B`||r.tier===`C`?r.tier:void 0;return{authenticated:!0,host:i,login:r.login,tier:e,name:typeof r.name==`string`?r.name:void 0,email:typeof r.email==`string`?r.email:void 0,ghAvailable:a}}return{authenticated:!1,host:i,error:typeof r.error==`string`?r.error:void 0,ghAvailable:a}}function Ot(e){let t=e?.host??Ct,n=wt.get(t);if(n)return n;let r=Dt(e).finally(()=>{wt.delete(t)});return wt.set(t,r),r}function kt(e){let t=e.split(`
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{Qn as n,Zn as r,a as i,tr as a,zn as o}from"./DocumentContext-BI0smsxZ.js";import{t as s}from"./react-f2sANaYj.js";import{n as c,r as l}from"./dist-Nvb76hAm.js";import{t as u}from"./compiler-runtime-BfE3aGVn.js";import{t as d}from"./utils-CPqDy6Hr.js";import{C as f,S as p,_ as m,g as h,h as g,i as _}from"./SkillInstallMenu-xkIcUjyz.js";import{t as v}from"./button-CA0dewJJ.js";import{t as y}from"./dist-mv8e6dBX.js";import{i as b,n as x,t as S}from"./tooltip-DPvMEqsq.js";import{t as C}from"./alert-dialog-ZBAB0rfs.js";import{t as w}from"./checkbox-Bi7zk4c5.js";import{a as T,m as E,r as D,t as O}from"./dropdown-menu-DRIarAms.js";import{t as k}from"./label-Bbz2bT-a.js";import{i as A,n as j,o as M,s as N,t as P}from"./select-fWSYgcDA.js";import{n as F,t as I}from"./radio-group-BsZGGl8l.js";import{t as L}from"./switch-BeP1gMN6.js";import{n as R,t as z}from"./toggle-group-BlEg4yJE.js";import{Es as ee,Ho as B,Ht as V,Ls as H,St as U,Ut as W,Vt as G,Wt as K,en as te,oo as ne,qt as re,ws as q,zo as ie}from"./dist-Cjt7VASv2.js";import{n as J}from"./dist-DTX2HxC82.js";import{t as Y}from"./dist-BgXDUIPy.js";import{_ as X,s as ae,y as oe}from"./documents-events-XYcpMExe.js";import{n as se}from"./config-context-BH8hj2sg.js";import{t as ce}from"./parse-api-error-DcnXKbfT.js";import{t as le}from"./use-workspace-DanpYgc9.js";import{t as ue}from"./createLucideIcon-CAkY8Blx.js";import{m as de,n as fe,r as pe,t as me}from"./EnableSyncConfirmDialog-CH3AktRr.js";import{s as he}from"./Mermaid-D6W1JO-s.js";import{t as ge}from"./arrow-up-right-CXMA4cr5.js";import{t as _e}from"./check-Bzwwm-o4.js";import{s as ve}from"./prop-types-Bi69iPbr.js";import{t as ye}from"./download-Bdmlj4Jo.js";import{a as be,r as xe,t as Se}from"./folder-config-api-BF1s5fn5.js";import{t as Ce}from"./spinner-DmibE6UV.js";import{t as we}from"./refresh-cw-D41gUk_B.js";import{t as Te}from"./trash-2-BVoWHmfV.js";import{t as Ee}from"./triangle-alert-CJVfCxE0.js";import{t as De}from"./x-wQUDJS55.js";import{f as Oe,n as ke,u as Ae,y as je}from"./doc-paths-B8neiW-a.js";import{f as Me,t as Ne}from"./skill-scope-D_Zsy3lJ.js";import{a as Pe,i as Fe,n as Ie,o as Le,r as Re,s as ze,t as Be}from"./field-C1cHfxiy.js";import{t as Ve}from"./input-DikXDeKw.js";import{a as He,c as Ue,i as We,n as Ge,o as Ke,s as qe,t as Je}from"./dialog-DD-GTVf9.js";import{i as Ye,r as Xe,t as Ze}from"./popover-C7NTz6uK.js";import{S as Qe,h as $e,i as et,p as tt}from"./skills-api-BM2BLHCX.js";import"./config-provider-CDwrJPp7.js";import{t as nt}from"./external-link-Dzk3biRr.js";import{t as rt}from"./textarea-BoMa_3jF.js";var it=ue(`cloud-off`,[[`path`,{d:`M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057`,key:`1uxyv8`}],[`path`,{d:`M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78`,key:`99tcn7`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),at=ue(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),ot=ue(`log-in`,[[`path`,{d:`m10 17 5-5-5-5`,key:`1bsop3`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4`,key:`u53s6r`}]]),st=ue(`move-up-right`,[[`path`,{d:`M13 5H19V11`,key:`1n1gyv`}],[`path`,{d:`M19 5L5 19`,key:`72u4yj`}]]),ct=ue(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),lt=ue(`user-cog`,[[`path`,{d:`M10 15H6a4 4 0 0 0-4 4v2`,key:`1nfge6`}],[`path`,{d:`m14.305 16.53.923-.382`,key:`1itpsq`}],[`path`,{d:`m15.228 13.852-.923-.383`,key:`eplpkm`}],[`path`,{d:`m16.852 12.228-.383-.923`,key:`13v3q0`}],[`path`,{d:`m16.852 17.772-.383.924`,key:`1i8mnm`}],[`path`,{d:`m19.148 12.228.383-.923`,key:`1q8j1v`}],[`path`,{d:`m19.53 18.696-.382-.924`,key:`vk1qj3`}],[`path`,{d:`m20.772 13.852.924-.383`,key:`n880s0`}],[`path`,{d:`m20.772 16.148.924.383`,key:`1g6xey`}],[`circle`,{cx:`18`,cy:`15`,r:`3`,key:`gjjjvw`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),Z=u(),Q=e(s(),1);function ut(e){let t=(0,Z.c)(12),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={status:`idle`},t[0]=n):n=t[0];let[r,i]=(0,Q.useState)(n),[a,o]=(0,Q.useState)(0),s,c;t[1]===e?(s=t[2],c=t[3]):(s=()=>{if(e!==null)return oe(()=>{o(mt)})},c=[e],t[1]=e,t[2]=s,t[3]=c),(0,Q.useEffect)(s,c);let l;t[4]===e?l=t[5]:(l=()=>{if(e===null){i({status:`idle`});return}let t=!1;i({status:`loading`});let n=e?`?path=${encodeURIComponent(e)}`:``;return fetch(`/api/folder-config${n}`).then(ft).then(e=>{if(!t){if(!e||typeof e!=`object`||!e.folder){i({status:`error`,message:Y._({id:`_ci9Bj`})});return}i({status:`ready`,data:{folder:e.folder,frontmatterLocal:e.frontmatter_local??null}})}}).catch(e=>{t||i({status:`error`,message:e instanceof Error?e.message:String(e)})}),()=>{t=!0}},t[4]=e,t[5]=l);let u;t[6]!==e||t[7]!==a?(u=[e,a],t[6]=e,t[7]=a,t[8]=u):u=t[8],(0,Q.useEffect)(l,u);let d;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>o(dt),t[9]=d):d=t[9];let f;return t[10]===r?f=t[11]:(f={state:r,refresh:d},t[10]=r,t[11]=f),f}function dt(e){return e+1}async function ft(e){if(!e.ok){let t=await e.json().catch(pt);throw Error(ce(t)??`HTTP ${e.status}`)}return e.json()}function pt(){return null}function mt(e){return e+1}function ht(){let e=(0,Z.c)(6),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={status:`idle`},e[0]=t):t=e[0];let[n,r]=(0,Q.useState)(t),[i,a]=(0,Q.useState)(0),o,s;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>oe(()=>{a(vt)}),s=[],e[1]=o,e[2]=s):(o=e[1],s=e[2]),(0,Q.useEffect)(o,s);let c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=!1;return r({status:`loading`}),fetch(`/api/templates`).then(gt).then(t=>{if(e)return;let n=te.safeParse(t);if(!n.success){console.error(`[ok-templates] /api/templates response failed schema validation:`,n.error.issues),r({status:`error`,message:Y._({id:`RLNIgv`})});return}r({status:`ready`,data:n.data.templates})}).catch(t=>{e||r({status:`error`,message:t instanceof Error?t.message:String(t)})}),()=>{e=!0}},e[3]=c):c=e[3];let l;return e[4]===i?l=e[5]:(l=[i],e[4]=i,e[5]=l),(0,Q.useEffect)(c,l),n}async function gt(e){if(!e.ok){let t=await e.json().catch(_t);throw Error(ce(t)??`HTTP ${e.status}`)}return e.json()}function _t(){return null}function vt(e){return e+1}async function yt(){try{let e=await fetch(`/api/semantic-status`);return e.ok?await e.json():(console.debug(`[semantic-status] probe returned`,e.status),null)}catch(e){return console.debug(`[semantic-status] probe failed`,e),null}}function bt(e){let t=(0,Z.c)(16),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let r=n.enabled??!0,[i,a]=(0,Q.useState)(null),o;t[2]===r?o=t[3]:(o=function(){r&&yt().then(e=>{e&&a(e)})},t[2]=r,t[3]=o);let s=o,c;t[4]===s?c=t[5]:(c=()=>{s()},t[4]=s,t[5]=c);let l;t[6]===r?l=t[7]:(l=[r],t[6]=r,t[7]=l),(0,Q.useEffect)(c,l);let u;t[8]!==r||t[9]!==s?(u=()=>{if(r)return X(e=>{e.includes(`files`)&&s()})},t[8]=r,t[9]=s,t[10]=u):u=t[10];let d;t[11]===r?d=t[12]:(d=[r],t[11]=r,t[12]=d),(0,Q.useEffect)(u,d);let f;return t[13]!==s||t[14]!==i?(f={status:i,refresh:s},t[13]=s,t[14]=i,t[15]=f):f=t[15],f}function xt(e){return e===`eperm`?Y._({id:`XuQzrk`}):Y._({id:`BUyQnq`})}async function St(e){let t=await e.restartServer(e.config.projectPath);return t.ok?{ok:!0}:{ok:!1,message:xt(t.reason)}}var $=t(),Ct=`github.com`,wt=new Map;async function Tt(e){try{let t=await e.json(),n=U.safeParse(t);if(n.success)return n.data.title}catch{}}async function Et(e,t){return fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t??{})})}async function Dt(e){let t=e?.host??Ct,n=await Et(`/api/local-op/auth/status`,e);if(!n.ok)return{authenticated:!1,host:t,error:await Tt(n)};let r=await n.json(),i=typeof r.host==`string`?r.host:t,a=r.ghAvailable===!0;if(r.authenticated===!0&&typeof r.login==`string`){let e=r.tier===`A`||r.tier===`B`||r.tier===`C`?r.tier:void 0;return{authenticated:!0,host:i,login:r.login,tier:e,name:typeof r.name==`string`?r.name:void 0,email:typeof r.email==`string`?r.email:void 0,ghAvailable:a}}return{authenticated:!1,host:i,error:typeof r.error==`string`?r.error:void 0,ghAvailable:a}}function Ot(e){let t=e?.host??Ct,n=wt.get(t);if(n)return n;let r=Dt(e).finally(()=>{wt.delete(t)});return wt.set(t,r),r}function kt(e){let t=e.split(`
2
2
  `);for(let e=t.length-1;e>=0;e--){let n=t[e]?.trim();if(n)try{let e=JSON.parse(n);if(e&&typeof e==`object`)return e}catch{}}return null}function At(){return{status:Ot,async repos(e){let t=e?.host??`github.com`,n=await Et(`/api/local-op/auth/repos`,e);if(!n.ok)return{ok:!1,error:await Tt(n)??Y._({id:`sGZLfB`})};let r=kt(await n.text());if(r&&r.type===`error`&&r.problem&&typeof r.problem==`object`){let e=r.problem;return{ok:!1,error:e.detail||e.title||Y._({id:`sGZLfB`})}}if(!r||!Array.isArray(r.repos))return{ok:!1,error:Y._({id:`sGZLfB`})};let i=[];for(let e of r.repos){let t=e;typeof t?.full_name==`string`&&typeof t.clone_url==`string`&&i.push({full_name:t.full_name,clone_url:t.clone_url,private:t.private===!0})}return{ok:!0,host:typeof r.host==`string`?r.host:t,repos:i}},async signout(e){let t=await Et(`/api/local-op/auth/signout`,e);return t.ok?{ok:!0}:{ok:!1,error:await Tt(t)}}}}function jt(e){return{status:t=>e.localOp.authStatus(t),repos:t=>e.localOp.authRepos(t)}}async function Mt(e,t){let n=e.getReader(),r=new TextDecoder,i=``;for(;;){let{done:e,value:a}=await n.read();if(e)return i+=r.decode(),!!(i.trim()&&t(i)===`terminal`);i+=r.decode(a,{stream:!0});let o=i.split(`
3
3
  `);i=o.pop()??``;for(let e of o)if(e.trim()&&t(e)===`terminal`)return!0}}function Nt(e){let t=[],n=[],r=new AbortController,i=!1,a=()=>{for(let e of n.splice(0))e(null)};return e(e=>{i||(n.length>0?n.shift()?.(e):t.push(e),(e.type===`complete`||e.type===`error`)&&(i=!0,r.abort(),a()))},r.signal),{events:{[Symbol.asyncIterator](){return{async next(){if(t.length>0){let e=t.shift();return e===void 0?{value:void 0,done:!0}:{value:e,done:!1}}return i?{value:void 0,done:!0}:new Promise(e=>{n.push(t=>{e(t===null?{value:void 0,done:!0}:{value:t,done:!1})})})}}}},cancel:()=>{i||(i=!0,r.abort(),a())}}}var Pt=2e3,Ft=1e4;function It(e,t){return new Promise(n=>{let r=setTimeout(()=>{t.removeEventListener(`abort`,i),n()},e);function i(){clearTimeout(r),n()}t.addEventListener(`abort`,i,{once:!0})})}function Lt(e){fetch(`/api/local-op/auth/cancel`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({channel:e})}).catch(e=>{console.warn(`[auth-transport] Cancel request failed (best-effort):`,e instanceof Error?e.message:e)})}async function Rt(e,t,n,r){let i=At(),a=Pt;for(;!t.aborted&&Date.now()<n;){try{let n=await i.status(r?{host:r}:void 0);if(t.aborted)return;if(n.authenticated){e({type:`complete`,host:n.host,login:n.login,name:n.name,email:n.email});return}}catch(e){console.warn(`[auth-transport] Recovery probe failed:`,e instanceof Error?e.message:e)}await It(a,t),a=Math.min(a*1.5,Ft)}t.aborted||e({type:`error`,message:Y._({id:`ve8vEM`})})}function zt(e,t,n){let r=!1,i=Nt((n,i)=>{let a=e=>{(e.type===`complete`||e.type===`error`)&&(r=!0),n(e)};(async()=>{let n=null;try{let r=await fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t),signal:i});if(!r.ok){let e=Y._({id:`LnVIW4`});try{let t=U.safeParse(await r.json());t.success&&(e=t.data.title)}catch{}a({type:`error`,message:e});return}if(!r.body){a({type:`error`,message:Y._({id:`LnVIW4`})});return}if(await Mt(r.body,e=>{let t;try{t=JSON.parse(e)}catch{return console.warn(`[auth-transport] Dropped unparseable NDJSON line:`,e.slice(0,100)),`continue`}if(t&&typeof t==`object`&&t.type===`error`&&`problem`in t){let e=t.problem;return a({type:`error`,message:e?.detail||e?.title||Y._({id:`29VNqC`})}),`terminal`}if(t.type===`ping`)return`continue`;let r=t;return r.type===`verification`&&(n=Date.now()+r.expires_in*1e3),a(r),r.type===`complete`||r.type===`error`?`terminal`:`continue`})||i.aborted)return;if(n===null){a({type:`error`,message:Y._({id:`DskIkK`})});return}await Rt(a,i,n,t.host)}catch(e){if(e instanceof Error&&e.name===`AbortError`)return;if(n!==null){await Rt(a,i,n,t.host);return}a({type:`error`,message:Y._({id:`Q5fqMz`})})}})()});return{events:i.events,cancel:()=>{r||Lt(n),i.cancel()}}}function Bt(){return{start(){return zt(`/api/local-op/auth/login`,{json:!0},`login`)},ghLogin(e){return zt(`/api/local-op/auth/gh-login`,{host:e,json:!0},`gh-login`)},async pat(e,t){try{let n=await fetch(`/api/local-op/auth/pat`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({host:e,token:t})});if(n.ok){let e=await n.json();return{ok:!0,login:typeof e.login==`string`?e.login:``}}let r=Y._({id:`sNeKjP`});try{let e=U.safeParse(await n.json());e.success&&(r=e.data.detail||e.data.title)}catch{}return{ok:!1,error:r}}catch{return{ok:!1,error:Y._({id:`Q5fqMz`})}}}}}function Vt(e){return{start(){return e.localOp.auth.start()}}}async function Ht(e){try{await navigator.clipboard.writeText(e)}catch{}}function Ut(e){let t=(0,Z.c)(25),{onSuccess:r,startFlow:i}=e,{_:a}=l(),[o,s]=(0,Q.useState)(null),[u,d]=(0,Q.useState)(`https://github.com/login/device`),[f,p]=(0,Q.useState)(!1),[m,h]=(0,Q.useState)(null),[g,_]=(0,Q.useState)(null),[y,b]=(0,Q.useState)(0),x=(0,Q.useRef)(null),S=(0,Q.useRef)(null),C;t[0]!==a||t[1]!==r||t[2]!==i?(C=async function(){h(null);try{let e=i();x.current=e.cancel;let t=e.events[Symbol.asyncIterator](),n=!1,o=await t.next();for(;!o.done;){let e=o.value;if(e.type===`verification`)s(e.user_code),d(e.verification_uri),_(Date.now()+e.expires_in*1e3),b(e.expires_in*1e3),Ht(e.user_code).then(()=>{p(!0),setTimeout(()=>p(!1),2e3)});else if(e.type===`complete`){n=!0,r({login:e.login,name:e.name,email:e.email,avatarUrl:e.avatarUrl});break}else if(e.type===`error`){n=!0,h(e.message);break}o=await t.next()}n||h(a({id:`DskIkK`}))}catch(e){let t=e;t instanceof Error&&t.name!==`AbortError`&&h(a({id:`Q5fqMz`}))}},t[0]=a,t[1]=r,t[2]=i,t[3]=C):C=t[3];let w=C,T;t[4]===w?T=t[5]:(T=()=>{let e=!1;return queueMicrotask(()=>{e||w()}),()=>{e=!0,x.current?.(),x.current=null,S.current&&clearInterval(S.current)}},t[4]=w,t[5]=T);let E;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(E=[],t[6]=E):E=t[6],(0,Q.useEffect)(T,E);let D,O;t[7]!==a||t[8]!==g?(D=()=>{if(g!==null)return S.current=setInterval(()=>{let e=g-Date.now();e<=0?(b(0),S.current&&clearInterval(S.current),h(a({id:`ve8vEM`}))):b(e)},1e3),()=>{S.current&&clearInterval(S.current)}},O=[g,a],t[7]=a,t[8]=g,t[9]=D,t[10]=O):(D=t[9],O=t[10]),(0,Q.useEffect)(D,O);let k=Math.floor(y/6e4),A=Math.floor(y%6e4/1e3),j;t[11]===A?j=t[12]:(j=A.toString().padStart(2,`0`),t[11]=A,t[12]=j);let M=`${k}:${j}`,N;t[13]!==a||t[14]!==f||t[15]!==m||t[16]!==M||t[17]!==o||t[18]!==u?(N=o?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(c,{id:`eVPynQ`,values:{verificationUri:u},components:{0:(0,$.jsx)(`a`,{href:u,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>nt(e,u),onAuxClick:e=>nt(e,u),className:`inline-flex items-center gap-0.5 text-foreground hover:text-primary hover:underline`}),1:(0,$.jsx)(`span`,{}),2:(0,$.jsx)(ge,{className:`inline size-3.5`,"aria-hidden":!0})}})}),(0,$.jsxs)(v,{type:`button`,variant:`outline`,"aria-label":a({id:`nCzR-G`,values:{userCode:o}}),onClick:()=>void Ht(o).then(()=>{p(!0),setTimeout(()=>p(!1),2e3)}),className:`relative h-auto w-full justify-center rounded-md bg-muted px-12 py-3 hover:bg-muted/80`,children:[(0,$.jsx)(`code`,{className:`font-mono text-2xl font-bold tracking-widest`,children:o}),(0,$.jsx)(`span`,{className:`absolute right-3 text-muted-foreground`,"aria-hidden":`true`,children:f?(0,$.jsx)(_e,{className:`size-4`}):(0,$.jsx)(n,{className:`size-4`})})]}),(0,$.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`sr-only`,children:f?(0,$.jsx)(c,{id:`80c4-P`}):null}),(0,$.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(`span`,{className:`size-1.5 rounded-full bg-amber-500 animate-pulse`}),(0,$.jsx)(c,{id:`5y_9lO`})]}),(0,$.jsx)(`span`,{children:(0,$.jsx)(c,{id:`gYz2ep`,values:{timeLabel:M}})})]})]}):(0,$.jsx)(`div`,{className:`flex items-center justify-center py-6 text-sm text-muted-foreground`,children:m?null:(0,$.jsx)(c,{id:`aWlJai`})}),t[13]=a,t[14]=f,t[15]=m,t[16]=M,t[17]=o,t[18]=u,t[19]=N):N=t[19];let P;t[20]===m?P=t[21]:(P=m&&(0,$.jsx)(`p`,{className:`text-1sm text-destructive`,children:m}),t[20]=m,t[21]=P);let F;return t[22]!==N||t[23]!==P?(F=(0,$.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[N,P]}),t[22]=N,t[23]=P,t[24]=F):F=t[24],F}function Wt(e){let t=(0,Z.c)(30),{login:n,name:r,onNameChange:i,email:a,onEmailChange:o}=e,{_:s}=l(),u;t[0]===n?u=t[1]:(u=(0,$.jsx)(`p`,{className:`text-sm font-medium`,children:(0,$.jsx)(c,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=u);let d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(c,{id:`gp3I7-`})}),t[2]=d):d=t[2];let f;t[3]===s?f=t[4]:(f=s({id:`6YtxFj`}),t[3]=s,t[4]=f);let p;t[5]!==s||t[6]!==n?(p=s({id:`J2Mv98`,values:{login:n}}),t[5]=s,t[6]=n,t[7]=p):p=t[7];let m;t[8]===i?m=t[9]:(m=e=>i(e.target.value),t[8]=i,t[9]=m);let h;t[10]!==r||t[11]!==f||t[12]!==p||t[13]!==m?(h=(0,$.jsx)(Ve,{"aria-label":f,placeholder:p,value:r,onChange:m}),t[10]=r,t[11]=f,t[12]=p,t[13]=m,t[14]=h):h=t[14];let g;t[15]===s?g=t[16]:(g=s({id:`O3oNi5`}),t[15]=s,t[16]=g);let _;t[17]===s?_=t[18]:(_=s({id:`O3oNi5`}),t[17]=s,t[18]=_);let v;t[19]===o?v=t[20]:(v=e=>o(e.target.value),t[19]=o,t[20]=v);let y;t[21]!==a||t[22]!==g||t[23]!==_||t[24]!==v?(y=(0,$.jsx)(Ve,{type:`email`,"aria-label":g,placeholder:_,value:a,onChange:v}),t[21]=a,t[22]=g,t[23]=_,t[24]=v,t[25]=y):y=t[25];let b;return t[26]!==u||t[27]!==y||t[28]!==h?(b=(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[u,d,h,y]}),t[26]=u,t[27]=y,t[28]=h,t[29]=b):b=t[29],b}function Gt(e){let t=(0,Z.c)(37),{host:n,token:r,onTokenChange:i,error:a,onSubmit:o,showGhOption:s,onGhSignIn:u}=e,{_:d}=l(),f=`https://${n}/settings/tokens/new?scopes=repo,read:user&description=OpenKnowledge`,p;t[0]!==n||t[1]!==u||t[2]!==s?(p=s?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(v,{type:`button`,onClick:u,children:(0,$.jsx)(c,{id:`_SDGzH`})}),(0,$.jsxs)(`div`,{className:`flex items-center gap-3 text-xs text-muted-foreground`,children:[(0,$.jsx)(`span`,{className:`h-px flex-1 bg-border`}),(0,$.jsx)(c,{id:`8L0EPw`}),(0,$.jsx)(`span`,{className:`h-px flex-1 bg-border`})]})]}):(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(c,{id:`8k6INX`,values:{host:n},components:{0:(0,$.jsx)(`span`,{className:`font-medium text-foreground`})}})}),t[0]=n,t[1]=u,t[2]=s,t[3]=p):p=t[3];let m,h;t[4]===f?(m=t[5],h=t[6]):(m=e=>nt(e,f),h=e=>nt(e,f),t[4]=f,t[5]=m,t[6]=h);let g;t[7]===n?g=t[8]:(g=(0,$.jsx)(c,{id:`6hYjww`,values:{host:n}}),t[7]=n,t[8]=g);let _;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(ge,{className:`inline size-3.5`,"aria-hidden":!0}),t[9]=_):_=t[9];let y;t[10]!==f||t[11]!==m||t[12]!==h||t[13]!==g?(y=(0,$.jsxs)(`a`,{href:f,target:`_blank`,rel:`noopener noreferrer`,onClick:m,onAuxClick:h,className:`inline-flex w-fit items-center gap-0.5 text-sm text-foreground hover:text-primary hover:underline`,children:[g,_]}),t[10]=f,t[11]=m,t[12]=h,t[13]=g,t[14]=y):y=t[14];let b;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,$.jsx)(c,{id:`Xg-Ntj`})}),t[15]=b):b=t[15];let x;t[16]===d?x=t[17]:(x=d({id:`p2LEhJ`}),t[16]=d,t[17]=x);let S;t[18]===i?S=t[19]:(S=e=>i(e.target.value),t[18]=i,t[19]=S);let C;t[20]===o?C=t[21]:(C=e=>{e.key===`Enter`&&o()},t[20]=o,t[21]=C);let w;t[22]!==C||t[23]!==x||t[24]!==S||t[25]!==r?(w=(0,$.jsx)(Ve,{type:`password`,"aria-label":x,placeholder:`ghp_`,value:r,onChange:S,onKeyDown:C}),t[22]=C,t[23]=x,t[24]=S,t[25]=r,t[26]=w):w=t[26];let T;t[27]===a?T=t[28]:(T=a&&(0,$.jsx)(`p`,{className:`text-1sm text-destructive`,children:a}),t[27]=a,t[28]=T);let E;t[29]===s?E=t[30]:(E=!s&&(0,$.jsxs)(`div`,{className:`mt-1 rounded-md border border-border/60 bg-muted/40 p-3 text-sm text-muted-foreground`,children:[(0,$.jsx)(`p`,{children:(0,$.jsx)(c,{id:`qX-ABr`})}),(0,$.jsxs)(`ol`,{className:`mt-1.5 list-decimal space-y-0.5 pl-5`,children:[(0,$.jsx)(`li`,{children:(0,$.jsx)(c,{id:`jxtXZI`})}),(0,$.jsx)(`li`,{children:(0,$.jsx)(c,{id:`9Vh9Jf`})})]})]}),t[29]=s,t[30]=E);let D;return t[31]!==p||t[32]!==w||t[33]!==T||t[34]!==E||t[35]!==y?(D=(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[p,y,b,w,T,E]}),t[31]=p,t[32]=w,t[33]=T,t[34]=E,t[35]=y,t[36]=D):D=t[36],D}var Kt=1e4;function qt(e){let t=(0,Z.c)(92),{open:n,onOpenChange:r,onSuccess:i,identityPrompt:a,reauth:o,transport:s,queryTransport:u,host:d,ghAvailable:f}=e,{_:p}=l(),m;t[0]===s?m=t[1]:(m=s??Bt(),t[0]=s,t[1]=m);let h=m,g;t[2]===u?g=t[3]:(g=u??At(),t[2]=u,t[3]=g);let _=g,[y,b]=(0,Q.useState)(`auth`),[x,S]=(0,Q.useState)(null),[C,w]=(0,Q.useState)(``),[T,E]=(0,Q.useState)(``),[D,O]=(0,Q.useState)(``),[k,A]=(0,Q.useState)(null),[j,M]=(0,Q.useState)(!1),[N,P]=(0,Q.useState)(void 0),[F,I]=(0,Q.useState)(void 0),L=d??N,R=!!L&&L!==`github.com`&&!!(f??F)&&typeof h.ghLogin==`function`,z=!a&&d===void 0,ee,B;t[4]!==d||t[5]!==a||t[6]!==z||t[7]!==n?(ee=()=>{n&&(S(null),w(``),E(``),O(``),A(null),M(!1),P(void 0),I(void 0),b(a||z?`checking`:d&&d!==`github.com`?`pat`:`auth`))},B=[n,a,d,z],t[4]=d,t[5]=a,t[6]=z,t[7]=n,t[8]=ee,t[9]=B):(ee=t[8],B=t[9]),(0,Q.useLayoutEffect)(ee,B);let V;t[10]!==a||t[11]!==n||t[12]!==_?(V=()=>{if(!n||!a)return;let e=!1,t=t=>{e||(e=!0,b(t))},r=setTimeout(()=>t(`auth`),Kt);return _.status().then(n=>{e||(n.authenticated?(S({login:n.login,name:n.name,email:n.email}),w(n.name??``),E(n.email??``),t(`identity`)):t(`auth`))}).catch(()=>{t(`auth`)}),()=>{e=!0,clearTimeout(r)}},t[10]=a,t[11]=n,t[12]=_,t[13]=V):V=t[13];let H;t[14]!==a||t[15]!==n?(H=[n,a],t[14]=a,t[15]=n,t[16]=H):H=t[16],(0,Q.useEffect)(V,H);let U;t[17]!==z||t[18]!==n||t[19]!==_?(U=()=>{if(!n||!z)return;let e=!1,t=t=>{e||(e=!0,b(t))},r=setTimeout(()=>t(`auth`),Kt);return _.status().then(n=>{if(e)return;let r=!!n.host&&n.host!==`github.com`;P(n.host),I(n.ghAvailable),t(r?`pat`:`auth`)}).catch(()=>{t(`auth`)}),()=>{e=!0,clearTimeout(r)}},t[17]=z,t[18]=n,t[19]=_,t[20]=U):U=t[20];let W;t[21]!==z||t[22]!==n?(W=[n,z],t[21]=z,t[22]=n,t[23]=W):W=t[23],(0,Q.useEffect)(U,W);let G;t[24]!==p||t[25]!==a||t[26]!==r||t[27]!==i?(G=function(e){if(S(e),a)w(e.name??``),E(e.email??``),b(`identity`);else{b(`done`),i?.(e),r(!1);let t=e.login;J.success(p(t?{id:`E_tNGD`,values:{login:t}}:{id:`cgl-gn`}))}},t[24]=p,t[25]=a,t[26]=r,t[27]=i,t[28]=G):G=t[28];let K=G,te;t[29]!==p||t[30]!==L||t[31]!==K||t[32]!==j||t[33]!==D||t[34]!==h?(te=async function(){let e=D.trim();if(!e||!L||j)return;if(!h.pat){A(p({id:`iMYFJM`}));return}M(!0),A(null);let t=await h.pat(L,e);M(!1),t.ok?K({login:t.login??``}):A(t.error??p({id:`sNeKjP`}))},t[29]=p,t[30]=L,t[31]=K,t[32]=j,t[33]=D,t[34]=h,t[35]=te):te=t[35];let ne=te,re;t[36]!==p||t[37]!==x||t[38]!==r||t[39]!==i?(re=function(e,t){fetch(`/api/local-op/auth/set-identity`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({name:e,email:t})}).catch(Jt);let n={...x??{login:``},name:e,email:t};b(`done`),i?.(n),r(!1);let a=n.login;J.success(p(a?{id:`E_tNGD`,values:{login:a}}:{id:`cgl-gn`}))},t[36]=p,t[37]=x,t[38]=r,t[39]=i,t[40]=re):re=t[40];let q=re,ie;t[41]!==p||t[42]!==x||t[43]!==r||t[44]!==i?(ie=function(){if(!x)return;b(`done`),i?.(x),r(!1);let e=x.login;J.success(p(e?{id:`E_tNGD`,values:{login:e}}:{id:`cgl-gn`}))},t[41]=p,t[42]=x,t[43]=r,t[44]=i,t[45]=ie):ie=t[45];let Y=ie,X;t[46]===r?X=t[47]:(X=function(){r(!1)},t[46]=r,t[47]=X);let ae=X,oe;t[48]!==a||t[49]!==o||t[50]!==y?(oe=(0,$.jsx)(qe,{children:(0,$.jsx)(Ue,{children:o&&(y===`pat`||y===`gh-device`)?(0,$.jsx)(c,{id:`DUWgfT`}):o?(0,$.jsx)(c,{id:`X8kjQX`}):y===`pat`||y===`gh-device`?(0,$.jsx)(c,{id:`tzZ6ha`}):a&&y!==`auth`?(0,$.jsx)(c,{id:`29XZXN`}):(0,$.jsx)(c,{id:`3jod3l`})})}),t[48]=a,t[49]=o,t[50]=y,t[51]=oe):oe=t[51];let se;t[52]===y?se=t[53]:(se=y===`checking`&&(0,$.jsx)(Ge,{children:(0,$.jsx)(`div`,{className:`flex items-center justify-center py-6 text-sm text-muted-foreground`,children:(0,$.jsx)(c,{id:`gBbxn_`})})}),t[52]=y,t[53]=se);let ce;t[54]!==K||t[55]!==ae||t[56]!==h||t[57]!==y?(ce=y===`auth`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ge,{children:(0,$.jsx)(Ut,{onSuccess:K,startFlow:()=>h.start()})}),(0,$.jsx)(Ke,{children:(0,$.jsx)(v,{variant:`outline`,className:`font-mono uppercase`,onClick:ae,children:(0,$.jsx)(c,{id:`dEgA5A`})})})]}),t[54]=K,t[55]=ae,t[56]=h,t[57]=y,t[58]=ce):ce=t[58];let le;t[59]!==R||t[60]!==L||t[61]!==ae||t[62]!==ne||t[63]!==k||t[64]!==j||t[65]!==D||t[66]!==y?(le=y===`pat`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ge,{children:(0,$.jsx)(Gt,{host:L??``,token:D,onTokenChange:O,error:k,onSubmit:ne,showGhOption:R,onGhSignIn:()=>b(`gh-device`)})}),(0,$.jsxs)(Ke,{children:[(0,$.jsx)(v,{variant:`outline`,className:`font-mono uppercase`,onClick:ae,children:(0,$.jsx)(c,{id:`dEgA5A`})}),(0,$.jsx)(v,{onClick:ne,disabled:!D.trim()||j,children:j?(0,$.jsx)(c,{id:`9zb2WA`}):(0,$.jsx)(c,{id:`iSLIjg`})})]})]}),t[59]=R,t[60]=L,t[61]=ae,t[62]=ne,t[63]=k,t[64]=j,t[65]=D,t[66]=y,t[67]=le):le=t[67];let ue;t[68]!==L||t[69]!==K||t[70]!==ae||t[71]!==h||t[72]!==y?(ue=y===`gh-device`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ge,{children:(0,$.jsx)(Ut,{onSuccess:K,startFlow:()=>h.ghLogin?.(L??``)??h.start()})}),(0,$.jsxs)(Ke,{children:[(0,$.jsx)(v,{variant:`ghost`,onClick:()=>b(`pat`),children:(0,$.jsx)(c,{id:`hLKfZe`})}),(0,$.jsx)(v,{variant:`outline`,className:`font-mono uppercase`,onClick:ae,children:(0,$.jsx)(c,{id:`dEgA5A`})})]})]}),t[68]=L,t[69]=K,t[70]=ae,t[71]=h,t[72]=y,t[73]=ue):ue=t[73];let de;t[74]!==x||t[75]!==q||t[76]!==Y||t[77]!==T||t[78]!==C||t[79]!==y?(de=y===`identity`&&x&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ge,{children:(0,$.jsx)(Wt,{login:x.login,name:C,onNameChange:w,email:T,onEmailChange:E})}),(0,$.jsxs)(Ke,{children:[(0,$.jsx)(v,{variant:`ghost`,onClick:Y,children:(0,$.jsx)(c,{id:`6Uau97`})}),(0,$.jsx)(v,{onClick:()=>q(C.trim(),T.trim()),disabled:!C.trim()||!T.trim(),children:(0,$.jsx)(c,{id:`tfDRzk`})})]})]}),t[74]=x,t[75]=q,t[76]=Y,t[77]=T,t[78]=C,t[79]=y,t[80]=de):de=t[80];let fe;t[81]!==oe||t[82]!==se||t[83]!==ce||t[84]!==le||t[85]!==ue||t[86]!==de?(fe=(0,$.jsxs)(We,{className:`sm:max-w-md`,children:[oe,se,ce,le,ue,de]}),t[81]=oe,t[82]=se,t[83]=ce,t[84]=le,t[85]=ue,t[86]=de,t[87]=fe):fe=t[87];let pe;return t[88]!==r||t[89]!==n||t[90]!==fe?(pe=(0,$.jsx)(Je,{open:n,onOpenChange:r,children:fe}),t[88]=r,t[89]=n,t[90]=fe,t[91]=pe):pe=t[91],pe}function Jt(){}function Yt(e){let t=(0,Z.c)(16),{value:n,onChange:r,disabled:i,placeholder:a,rows:o}=e,s=i===void 0?!1:i,l=o===void 0?12:o,u=(0,Q.useId)(),d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(c,{id:`3o3tur`}),t[0]=d):d=t[0];let f;t[1]===u?f=t[2]:(f=(0,$.jsx)(Le,{htmlFor:u,children:d}),t[1]=u,t[2]=f);let p;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(Re,{children:(0,$.jsx)(c,{id:`5gr_ev`,values:{dateToken:`{{date}}`,userToken:`{{user}}`},components:{0:(0,$.jsx)(`code`,{className:`font-mono`}),1:(0,$.jsx)(`code`,{className:`font-mono`})}})}),t[3]=p):p=t[3];let m;t[4]===r?m=t[5]:(m=e=>r(e.target.value),t[4]=r,t[5]=m);let h;t[6]!==s||t[7]!==u||t[8]!==a||t[9]!==l||t[10]!==m||t[11]!==n?(h=(0,$.jsx)(rt,{id:u,value:n,onChange:m,disabled:s,rows:l,spellCheck:!1,placeholder:a,className:`font-mono text-xs leading-relaxed min-h-72`}),t[6]=s,t[7]=u,t[8]=a,t[9]=l,t[10]=m,t[11]=n,t[12]=h):h=t[12];let g;return t[13]!==f||t[14]!==h?(g=(0,$.jsxs)(Be,{children:[f,p,h]}),t[13]=f,t[14]=h,t[15]=g):g=t[15],g}var Xt=/^[A-Za-z0-9_-]+$/;function Zt(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)}function Qt(e){let t={},n=e.title.trim();n&&(t.title=n);let r=e.description.trim();return r&&(t.description=r),t}var $t=0;function en(){return $t+=1,`prop-${$t}`}function tn(e){let{frontmatter:t,body:n}=ie(e);if(t===``)return{type:``,properties:[],markdown:e};let r=[];for(let e of B(t).split(`
4
4
  `)){if(e.trim()===``)continue;let t=e.indexOf(`:`);if((/^\s/.test(e)||t===-1)&&r.length>0){let t=r[r.length-1];t&&(t.value+=`\n${e}`);continue}t!==-1&&r.push({key:e.slice(0,t).trim(),value:e.slice(t+1).replace(/^ /,``)})}let i=``,a=[];for(let e of r){if(e.key===`type`&&i===``){i=e.value.trim();continue}a.push({id:en(),key:e.key,value:e.value})}return{type:i,properties:a,markdown:n}}function nn(e){let t=[],n=e.type.trim();n&&t.push(`type: ${n}`);for(let n of e.properties){let e=n.key.trim();e===``||e===`type`||t.push(n.value===``?`${e}:`:`${e}: ${n.value}`)}if(t.length===0)return e.markdown.replace(/^\n+/,``);let r=e.markdown.startsWith(`
@@ -0,0 +1 @@
1
+ import{An as e,jn as t}from"./dist-Cjt7VASv2.js";var n={BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.58.10`}?.VITE_APP_VERSION??`0.0.0-unknown`;function r(){return e({kind:`web`,runtimeVersion:n})}function i(){return t({kind:`web`,runtimeVersion:n})}export{r as n,i as r,n as t};
@@ -1,4 +1,4 @@
1
- import{t as e}from"./jsx-runtime-BUgB2tll.js";import{Dn as t,Fr as n,Rr as r,Tn as i,Vr as a,dr as o,fn as s,fr as c,on as l,vr as u}from"./DocumentContext-CKBQLPkm.js";import{n as d,r as f}from"./dist-Nvb76hAm.js";import{t as p}from"./compiler-runtime-BfE3aGVn.js";import{i as m}from"./local-menu-action-bus-aAi23OVU.js";import{t as h}from"./utils-CPqDy6Hr.js";import{t as g}from"./button-CA0dewJJ.js";import{i as _,n as ee,t as te}from"./tooltip-DPvMEqsq.js";import{rt as v}from"./CodeMirrorPropInput-Cw9Wgv0Z.js";import{Ai as y,Fn as b,Pn as x,Xn as S,Zn as C,mr as w}from"./dist-C1cuuJXO2.js";import{n as T}from"./dist-DTX2HxC82.js";import{t as E}from"./dist-BgXDUIPy.js";import{t as ne}from"./createLucideIcon-CAkY8Blx.js";import{t as re}from"./x-wQUDJS55.js";import{f as ie}from"./doc-paths-Bc7iTgnL.js";var D=ne(`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`}]]),O=p(),k=`245,158,11`,ae=k,oe={fill:.22,line:.7},A={fill:.45,line:1},se=.45;function ce(e,t){let n=ae,{fill:r,line:i}=t?A:oe;return[`border-radius:2px`,`padding-bottom:1px`,...e.id===null?[]:[`cursor:pointer`],`background-color:rgba(${n},${r})`,`box-shadow:inset 0 -2px 0 rgba(${n},${i})`,``].join(`;`)}function j(e){return e.map(e=>e.id??`·`).join(`|`)}function le(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 ue(e,t){return e.id===null||e.id===t}function de(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=>ue(e,t));i.push({from:a.from,to:a.to,style:ce(e??a.covering[0],e!==void 0),threadId:le(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&&j(a.covering)===j(s)){a.to=i;continue}o(),a={from:t,to:i,covering:s}}return o(),i}var M=`data-comment-reveal`;function N(e){return typeof CSS<`u`&&CSS.escape?CSS.escape(e):e}function P(e){return e===``?null:document.querySelector(`[data-testid="property-row"][data-key="${N(e)}"]`)}function fe(e){let t=P(e);if(t===null)return null;let n=t.getBoundingClientRect();return n.height===0&&n.width===0?null:n}function pe(e){P(e)?.scrollIntoView({block:`center`,behavior:`smooth`})}function F(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="${N(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=I(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),me(n),!0}return!1}function I(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 me(e){e.style.setProperty(`--comment-reveal-fill`,`rgba(${k},${se})`),e.setAttribute(M,`true`);let t=()=>{e.removeAttribute(M),e.style.removeProperty(`--comment-reveal-fill`)};e.addEventListener(`blur`,t,{once:!0}),e.addEventListener(`pointerdown`,t,{once:!0}),e.addEventListener(`keydown`,t,{once:!0})}function L(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=x(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 R(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 z(e,t,n){let r=n?.prefix??``,i=n?.suffix??``;if(r===``&&i===``)return null;let a=r===``?[0]:w(e,r,{syntaxIn:`needle`}).map(e=>e.end),o=i===``?[e.length]:w(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=y(t.length);return c-s>l?null:{start:s,end:c}}function B(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 V(e,t,n){if(t.length===0)return null;let r=R(e.text,t).map(e=>({start:e,end:e+t.length}));if(r.length===0&&(r=w(e.text,t,{syntaxIn:`needle`})),r.length===0){let r=z(e.text,t,n);return r===null?null:B(e,r)}let i=n?.prefix??``,a=n?.suffix??``,o=t=>e.text.includes(t)||w(e.text,t,{syntaxIn:`needle`}).length>0;if(i!==``&&a!==``&&!o(i+t+a)&&o(i+a))return null;let s=S({prefix:i,suffix:a},{syntaxInContext:!0}),c=t=>s===0||C(e.text,t,{prefix:i,suffix:a},{syntaxIn:`none`,syntaxInContext:!0})>=s;if(r.length===1){if(!c(r[0])){let r=z(e.text,t,n);return r===null?null:B(e,r)}return B(e,r[0])}let l=[],u=-1;for(let t of r){let n=C(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=z(e.text,t,n);return r===null?null:B(e,r)}return B(e,l[0])}var H=64;function he(e,t,n){return{prefix:b(e,Math.max(0,t-H),t),suffix:b(e,n,Math.min(e.content.size,n+H))}}function U(e,t,n){return W(e)(t,n)}function W(e){let t=L(e),n=null;return(r,i)=>{let a=V(t,r,i);return a===null?(n??=L(e,{includeBlockComponents:!0}),V(n,r,i)):a}}var ge=220,_e=24,ve=600;function G(e,t){return s(e,()=>{let n=l(e);t(),window.setTimeout(()=>n.release(),ve)})}function ye(e){let t=e.viewTop+e.insetTop,n=e.viewBottom-ge;return e.anchorTop>=t&&e.anchorBottom<=n?0:e.anchorTop-(t+_e)}function K(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 q(e){let t=Number.parseFloat(getComputedStyle(e).scrollPaddingTop);return Number.isFinite(t)?t:0}function J(e,t,n,r){let i=v(e);if(!i)return!1;let a=K(i.dom);if(!a)return G(n,()=>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=ye({anchorTop:o.top,anchorBottom:Math.max(o.bottom,s.bottom),viewTop:c.top,viewBottom:c.bottom,insetTop:q(a)});if(l===0)return!0;let u=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;return G(n,()=>a.scrollTo({top:a.scrollTop+l,behavior:r?.instant||u?`auto`:`smooth`}))}var be=1e4,xe=80,Se=1500,Y=[`wheel`,`touchstart`,`mousedown`,`keydown`];function Ce(e){let n=!1,r=null,s=null,l=-1,u=()=>{let t=i(e.docName);if(!t||t.isDestroyed)return!1;if(n||(n=!0,o(e.threadId)),e.quote===``)return r===null&&(r=Date.now(),c(e.threadId)),!0;let a=t.state.doc.content.size;return(s===null||a!==l)&&(s=U(t.state.doc,e.quote,e.context),l=a),!s||!J(t,s,e.docName,{instant:!0})?!1:(r===null&&(r=Date.now(),c(e.threadId)),!0)};a(`comments`),u(),i(e.docName)===null&&window.location.assign(ie(e.docName));let d=!1,f=()=>{if(!d){d=!0,h(),window.clearInterval(g),window.clearTimeout(_);for(let e of Y)window.removeEventListener(e,p,!0)}},p=()=>f(),m=()=>{u()&&r!==null&&Date.now()-r>=Se&&f()},h=t(m),g=window.setInterval(m,xe),_=window.setTimeout(()=>{r===null&&T.error(n?E._({id:`KeXgA-`}):E._({id:`JDQ5I5`})),f()},be);for(let e of Y)window.addEventListener(e,p,!0);m()}var X=e();function we(){return n().length}function Te(){let e=(0,O.c)(4),t=n(),r;if(e[0]!==t){r=new Map;for(let e of t){let t=u(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(Ee),e[2]=r,e[3]=i),i}function Ee(e){let[t,n]=e;return{docName:t,count:n}}function De(e){let t=(0,O.c)(34),{count:n,docs:r,attached:i,onAttach:a,onDismiss:o}=e,s;t[0]===r?s=t[1]:(s=r===void 0?[]:r,t[0]=r,t[1]=s);let c=s,{_:l}=f();if(n===0)return null;if(!i){let e;t[2]===l?e=t[3]:(e=l({id:`UpOct_`}),t[2]=l,t[3]=e);let n,r,i;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=h(`h-auto min-h-0 gap-1 rounded-md border border-dashed bg-transparent px-1.5 py-0.5`,`text-xs font-normal text-muted-foreground hover:bg-muted/60 hover:text-foreground`),r=(0,X.jsx)(m,{className:`size-3`}),i=(0,X.jsx)(d,{id:`VbyRUy`}),t[4]=n,t[5]=r,t[6]=i):(n=t[4],r=t[5],i=t[6]);let o;return t[7]!==a||t[8]!==e?(o=(0,X.jsxs)(g,{type:`button`,size:`sm`,variant:`ghost`,"aria-pressed":!1,"aria-label":e,onClick:a,"data-testid":`composer-context-chip-comments`,className:n,children:[r,i]}),t[7]=a,t[8]=e,t[9]=o):o=t[9],o}let u;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(u=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[10]=u):u=t[10];let p;t[11]===l?p=t[12]:(p=l({id:`2zvUIK`}),t[11]=l,t[12]=p);let v;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,X.jsx)(D,{className:`size-3`}),t[13]=v):v=t[13];let y;t[14]!==n||t[15]!==c.length?(y=c.length>1?(0,X.jsx)(d,{id:`5TmrYN`,values:{0:c.length,count:n}}):(0,X.jsx)(d,{id:`eiUA4k`,values:{count:n}}),t[14]=n,t[15]=c.length,t[16]=y):y=t[16];let b;t[17]!==p||t[18]!==y?(b=(0,X.jsx)(_,{asChild:!0,children:(0,X.jsxs)(g,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":p,onClick:ke,"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:[v,y]})}),t[17]=p,t[18]=y,t[19]=b):b=t[19];let x;t[20]===c?x=t[21]:(x=(0,X.jsx)(ee,{className:`max-w-64`,children:c.length>1?(0,X.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:c.map(Oe)}):(0,X.jsx)(d,{id:`2zvUIK`})}),t[20]=c,t[21]=x);let S;t[22]!==b||t[23]!==x?(S=(0,X.jsxs)(te,{children:[b,x]}),t[22]=b,t[23]=x,t[24]=S):S=t[24];let C;t[25]===l?C=t[26]:(C=l({id:`pFRz_E`}),t[25]=l,t[26]=C);let w;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,X.jsx)(re,{className:`size-3`}),t[27]=w):w=t[27];let T;t[28]!==o||t[29]!==C?(T=(0,X.jsx)(g,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":C,onClick:o,className:`size-4 p-0 text-muted-foreground hover:text-foreground`,children:w}),t[28]=o,t[29]=C,t[30]=T):T=t[30];let E;return t[31]!==T||t[32]!==S?(E=(0,X.jsxs)(`span`,{"data-testid":`composer-context-chip-comments`,className:u,children:[S,T]}),t[31]=T,t[32]=S,t[33]=E):E=t[33],E}function Oe(e){return(0,X.jsxs)(`li`,{className:`flex items-baseline gap-1.5`,children:[(0,X.jsx)(`span`,{className:`tabular-nums`,children:e.count}),(0,X.jsx)(`span`,{className:`truncate`,children:Z(e.docName)})]},e.docName)}function ke(){return r()}function Z(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function Ae(e,t){let n=e;for(let e of t)n+=typeof e==`number`?`[${e}]`:`.${e}`;return n}function je(e){Ce({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=()=>{F({key:t.key,path:t.path,quote:n.quote,start:n.start,end:n.end})||(r+=1,!(r>=Q)&&requestAnimationFrame(i))};requestAnimationFrame(i)}var Q=30;function Me(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 Ne(e){let t=e.replace(/\s+/g,` `).trimStart();return t.length>$?`…${t.slice(-$)}`:t}function Pe(e){let t=e.replace(/\s+/g,` `).trimEnd();return t.length>$?`${t.slice(0,$)}…`:t}function Fe(e){if(!e.repeats)return null;let t=Ne(e.prefix),n=Pe(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 Ie(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(`
1
+ import{t as e}from"./jsx-runtime-BUgB2tll.js";import{Dn as t,Fr as n,Rr as r,Tn as i,Vr as a,dr as o,fn as s,fr as c,on as l,vr as u}from"./DocumentContext-BI0smsxZ.js";import{n as d,r as f}from"./dist-Nvb76hAm.js";import{t as p}from"./compiler-runtime-BfE3aGVn.js";import{i as m}from"./local-menu-action-bus-aAi23OVU.js";import{t as h}from"./utils-CPqDy6Hr.js";import{t as g}from"./button-CA0dewJJ.js";import{i as _,n as ee,t as te}from"./tooltip-DPvMEqsq.js";import{rt as v}from"./CodeMirrorPropInput-DlJxY2cd.js";import{Ai as y,Fn as b,Pn as x,Xn as S,Zn as C,mr as w}from"./dist-Cjt7VASv2.js";import{n as T}from"./dist-DTX2HxC82.js";import{t as E}from"./dist-BgXDUIPy.js";import{t as ne}from"./createLucideIcon-CAkY8Blx.js";import{t as re}from"./x-wQUDJS55.js";import{f as ie}from"./doc-paths-B8neiW-a.js";var D=ne(`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`}]]),O=p(),k=`245,158,11`,ae=k,oe={fill:.22,line:.7},A={fill:.45,line:1},se=.45;function ce(e,t){let n=ae,{fill:r,line:i}=t?A:oe;return[`border-radius:2px`,`padding-bottom:1px`,...e.id===null?[]:[`cursor:pointer`],`background-color:rgba(${n},${r})`,`box-shadow:inset 0 -2px 0 rgba(${n},${i})`,``].join(`;`)}function j(e){return e.map(e=>e.id??`·`).join(`|`)}function le(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 ue(e,t){return e.id===null||e.id===t}function de(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=>ue(e,t));i.push({from:a.from,to:a.to,style:ce(e??a.covering[0],e!==void 0),threadId:le(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&&j(a.covering)===j(s)){a.to=i;continue}o(),a={from:t,to:i,covering:s}}return o(),i}var M=`data-comment-reveal`;function N(e){return typeof CSS<`u`&&CSS.escape?CSS.escape(e):e}function P(e){return e===``?null:document.querySelector(`[data-testid="property-row"][data-key="${N(e)}"]`)}function fe(e){let t=P(e);if(t===null)return null;let n=t.getBoundingClientRect();return n.height===0&&n.width===0?null:n}function pe(e){P(e)?.scrollIntoView({block:`center`,behavior:`smooth`})}function F(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="${N(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=I(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),me(n),!0}return!1}function I(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 me(e){e.style.setProperty(`--comment-reveal-fill`,`rgba(${k},${se})`),e.setAttribute(M,`true`);let t=()=>{e.removeAttribute(M),e.style.removeProperty(`--comment-reveal-fill`)};e.addEventListener(`blur`,t,{once:!0}),e.addEventListener(`pointerdown`,t,{once:!0}),e.addEventListener(`keydown`,t,{once:!0})}function L(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=x(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 R(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 z(e,t,n){let r=n?.prefix??``,i=n?.suffix??``;if(r===``&&i===``)return null;let a=r===``?[0]:w(e,r,{syntaxIn:`needle`}).map(e=>e.end),o=i===``?[e.length]:w(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=y(t.length);return c-s>l?null:{start:s,end:c}}function B(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 V(e,t,n){if(t.length===0)return null;let r=R(e.text,t).map(e=>({start:e,end:e+t.length}));if(r.length===0&&(r=w(e.text,t,{syntaxIn:`needle`})),r.length===0){let r=z(e.text,t,n);return r===null?null:B(e,r)}let i=n?.prefix??``,a=n?.suffix??``,o=t=>e.text.includes(t)||w(e.text,t,{syntaxIn:`needle`}).length>0;if(i!==``&&a!==``&&!o(i+t+a)&&o(i+a))return null;let s=S({prefix:i,suffix:a},{syntaxInContext:!0}),c=t=>s===0||C(e.text,t,{prefix:i,suffix:a},{syntaxIn:`none`,syntaxInContext:!0})>=s;if(r.length===1){if(!c(r[0])){let r=z(e.text,t,n);return r===null?null:B(e,r)}return B(e,r[0])}let l=[],u=-1;for(let t of r){let n=C(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=z(e.text,t,n);return r===null?null:B(e,r)}return B(e,l[0])}var H=64;function he(e,t,n){return{prefix:b(e,Math.max(0,t-H),t),suffix:b(e,n,Math.min(e.content.size,n+H))}}function U(e,t,n){return W(e)(t,n)}function W(e){let t=L(e),n=null;return(r,i)=>{let a=V(t,r,i);return a===null?(n??=L(e,{includeBlockComponents:!0}),V(n,r,i)):a}}var ge=220,_e=24,ve=600;function G(e,t){return s(e,()=>{let n=l(e);t(),window.setTimeout(()=>n.release(),ve)})}function ye(e){let t=e.viewTop+e.insetTop,n=e.viewBottom-ge;return e.anchorTop>=t&&e.anchorBottom<=n?0:e.anchorTop-(t+_e)}function K(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 q(e){let t=Number.parseFloat(getComputedStyle(e).scrollPaddingTop);return Number.isFinite(t)?t:0}function J(e,t,n,r){let i=v(e);if(!i)return!1;let a=K(i.dom);if(!a)return G(n,()=>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=ye({anchorTop:o.top,anchorBottom:Math.max(o.bottom,s.bottom),viewTop:c.top,viewBottom:c.bottom,insetTop:q(a)});if(l===0)return!0;let u=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;return G(n,()=>a.scrollTo({top:a.scrollTop+l,behavior:r?.instant||u?`auto`:`smooth`}))}var be=1e4,xe=80,Se=1500,Y=[`wheel`,`touchstart`,`mousedown`,`keydown`];function Ce(e){let n=!1,r=null,s=null,l=-1,u=()=>{let t=i(e.docName);if(!t||t.isDestroyed)return!1;if(n||(n=!0,o(e.threadId)),e.quote===``)return r===null&&(r=Date.now(),c(e.threadId)),!0;let a=t.state.doc.content.size;return(s===null||a!==l)&&(s=U(t.state.doc,e.quote,e.context),l=a),!s||!J(t,s,e.docName,{instant:!0})?!1:(r===null&&(r=Date.now(),c(e.threadId)),!0)};a(`comments`),u(),i(e.docName)===null&&window.location.assign(ie(e.docName));let d=!1,f=()=>{if(!d){d=!0,h(),window.clearInterval(g),window.clearTimeout(_);for(let e of Y)window.removeEventListener(e,p,!0)}},p=()=>f(),m=()=>{u()&&r!==null&&Date.now()-r>=Se&&f()},h=t(m),g=window.setInterval(m,xe),_=window.setTimeout(()=>{r===null&&T.error(n?E._({id:`KeXgA-`}):E._({id:`JDQ5I5`})),f()},be);for(let e of Y)window.addEventListener(e,p,!0);m()}var X=e();function we(){return n().length}function Te(){let e=(0,O.c)(4),t=n(),r;if(e[0]!==t){r=new Map;for(let e of t){let t=u(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(Ee),e[2]=r,e[3]=i),i}function Ee(e){let[t,n]=e;return{docName:t,count:n}}function De(e){let t=(0,O.c)(34),{count:n,docs:r,attached:i,onAttach:a,onDismiss:o}=e,s;t[0]===r?s=t[1]:(s=r===void 0?[]:r,t[0]=r,t[1]=s);let c=s,{_:l}=f();if(n===0)return null;if(!i){let e;t[2]===l?e=t[3]:(e=l({id:`UpOct_`}),t[2]=l,t[3]=e);let n,r,i;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=h(`h-auto min-h-0 gap-1 rounded-md border border-dashed bg-transparent px-1.5 py-0.5`,`text-xs font-normal text-muted-foreground hover:bg-muted/60 hover:text-foreground`),r=(0,X.jsx)(m,{className:`size-3`}),i=(0,X.jsx)(d,{id:`VbyRUy`}),t[4]=n,t[5]=r,t[6]=i):(n=t[4],r=t[5],i=t[6]);let o;return t[7]!==a||t[8]!==e?(o=(0,X.jsxs)(g,{type:`button`,size:`sm`,variant:`ghost`,"aria-pressed":!1,"aria-label":e,onClick:a,"data-testid":`composer-context-chip-comments`,className:n,children:[r,i]}),t[7]=a,t[8]=e,t[9]=o):o=t[9],o}let u;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(u=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[10]=u):u=t[10];let p;t[11]===l?p=t[12]:(p=l({id:`2zvUIK`}),t[11]=l,t[12]=p);let v;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,X.jsx)(D,{className:`size-3`}),t[13]=v):v=t[13];let y;t[14]!==n||t[15]!==c.length?(y=c.length>1?(0,X.jsx)(d,{id:`5TmrYN`,values:{0:c.length,count:n}}):(0,X.jsx)(d,{id:`eiUA4k`,values:{count:n}}),t[14]=n,t[15]=c.length,t[16]=y):y=t[16];let b;t[17]!==p||t[18]!==y?(b=(0,X.jsx)(_,{asChild:!0,children:(0,X.jsxs)(g,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":p,onClick:ke,"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:[v,y]})}),t[17]=p,t[18]=y,t[19]=b):b=t[19];let x;t[20]===c?x=t[21]:(x=(0,X.jsx)(ee,{className:`max-w-64`,children:c.length>1?(0,X.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:c.map(Oe)}):(0,X.jsx)(d,{id:`2zvUIK`})}),t[20]=c,t[21]=x);let S;t[22]!==b||t[23]!==x?(S=(0,X.jsxs)(te,{children:[b,x]}),t[22]=b,t[23]=x,t[24]=S):S=t[24];let C;t[25]===l?C=t[26]:(C=l({id:`pFRz_E`}),t[25]=l,t[26]=C);let w;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,X.jsx)(re,{className:`size-3`}),t[27]=w):w=t[27];let T;t[28]!==o||t[29]!==C?(T=(0,X.jsx)(g,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":C,onClick:o,className:`size-4 p-0 text-muted-foreground hover:text-foreground`,children:w}),t[28]=o,t[29]=C,t[30]=T):T=t[30];let E;return t[31]!==T||t[32]!==S?(E=(0,X.jsxs)(`span`,{"data-testid":`composer-context-chip-comments`,className:u,children:[S,T]}),t[31]=T,t[32]=S,t[33]=E):E=t[33],E}function Oe(e){return(0,X.jsxs)(`li`,{className:`flex items-baseline gap-1.5`,children:[(0,X.jsx)(`span`,{className:`tabular-nums`,children:e.count}),(0,X.jsx)(`span`,{className:`truncate`,children:Z(e.docName)})]},e.docName)}function ke(){return r()}function Z(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function Ae(e,t){let n=e;for(let e of t)n+=typeof e==`number`?`[${e}]`:`.${e}`;return n}function je(e){Ce({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=()=>{F({key:t.key,path:t.path,quote:n.quote,start:n.start,end:n.end})||(r+=1,!(r>=Q)&&requestAnimationFrame(i))};requestAnimationFrame(i)}var Q=30;function Me(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 Ne(e){let t=e.replace(/\s+/g,` `).trimStart();return t.length>$?`…${t.slice(-$)}`:t}function Pe(e){let t=e.replace(/\s+/g,` `).trimEnd();return t.length>$?`${t.slice(0,$)}…`:t}function Fe(e){if(!e.repeats)return null;let t=Ne(e.prefix),n=Pe(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 Ie(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(`
2
2
  `))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(`
3
3
  `))i.push(` > ${t}`);i.push(``),i.push(` ${e.body.trim()}`);let n=Fe(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(`
4
4
  `))i.push(`> ${e}`)}return i.join(`