@inkeep/open-knowledge 0.78.0-beta.5 → 0.78.0-beta.6

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 (140) hide show
  1. package/dist/assets/skills/project/SKILL.md +1 -1
  2. package/dist/assets/skills/project/references/linking.md +1 -0
  3. package/dist/cli.mjs +6 -6
  4. package/dist/constants-B5vbbQ59.mjs +1 -0
  5. package/dist/{dist-C9hrA0xr.mjs → dist-DeGSxFUJ.mjs} +178 -178
  6. package/dist/{dist-Bm-n9FIx.mjs → dist-DhGQyLku.mjs} +1 -1
  7. package/dist/index.mjs +1 -1
  8. package/dist/init-UUEtW3_5.mjs +1 -0
  9. package/dist/{init-CMZ1xdkA.mjs → init-__dFxXcd.mjs} +2 -2
  10. package/dist/{launch-json-removal-BuZBUdUh.mjs → launch-json-removal-D-bsUXkT.mjs} +1 -1
  11. package/dist/loader-BI5MbK2x.mjs +1 -0
  12. package/dist/{loader-C96mSVCK.mjs → loader-Dbk8NaZV.mjs} +1 -1
  13. package/dist/{open-browser-CG-plfXw.mjs → open-browser-DB4_oZoA.mjs} +1 -1
  14. package/dist/preview-DAraVn8e.mjs +1 -0
  15. package/dist/{preview-BGznaTo5.mjs → preview-YKuXh9c-.mjs} +1 -1
  16. package/dist/public/assets/{ActivityModeContent-C0ggUUwf.js → ActivityModeContent-2otPjTz0.js} +1 -1
  17. package/dist/public/assets/AddPropertiesButton-z6PEwIQs.js +2 -0
  18. package/dist/public/assets/{AgentDiffPane-CwIvZ2u0.js → AgentDiffPane-BtmZfqMO.js} +1 -1
  19. package/dist/public/assets/{AgentIconCluster-D4c5FBAw.js → AgentIconCluster-DcoteycJ.js} +1 -1
  20. package/dist/public/assets/{AgentThreadClientBinder-DCNH3zpd.js → AgentThreadClientBinder-spIm7YG2.js} +1 -1
  21. package/dist/public/assets/{BugReportHistory-fO3bN8lg.js → BugReportHistory-IV-7NiFn.js} +1 -1
  22. package/dist/public/assets/{BugReportHistoryDialog-JJhcauNP.js → BugReportHistoryDialog-CCtxqoW-.js} +1 -1
  23. package/dist/public/assets/CodeMirrorPropInput-CUaf0ERc.js +3 -0
  24. package/dist/public/assets/{ConsentDialogBody-BqIjS2gR.js → ConsentDialogBody-D5LrKSjM.js} +1 -1
  25. package/dist/public/assets/{DeleteConfirmationDialog-MTriAXRX.js → DeleteConfirmationDialog-B2-SwXRR.js} +1 -1
  26. package/dist/public/assets/{DiffViewBoundary-CvmixHlE.js → DiffViewBoundary-BKTRwr-q.js} +1 -1
  27. package/dist/public/assets/DocumentContext-qmBJKxx1.js +39 -0
  28. package/dist/public/assets/{EditorModeToggle-KkeyqUiS.js → EditorModeToggle-DIsED8Ee.js} +1 -1
  29. package/dist/public/assets/{EnableSyncConfirmDialog-B1jUtYf0.js → EnableSyncConfirmDialog-ClgOSs_Y.js} +1 -1
  30. package/dist/public/assets/{ExcalidrawDocEditor-CWEkU2Is.js → ExcalidrawDocEditor-uHpy0AAc.js} +1 -1
  31. package/dist/public/assets/FeedbackForm-DBF-rKSz.js +1 -0
  32. package/dist/public/assets/{GraphPanel-D5xZaXcb.js → GraphPanel-CZnzR4jC.js} +2 -2
  33. package/dist/public/assets/{ImageAttachments-_-DakRUS.js → ImageAttachments-CWuAmsog.js} +1 -1
  34. package/dist/public/assets/{ImportSkillDialog-1JqeHG2e.js → ImportSkillDialog-CU7iB5L6.js} +1 -1
  35. package/dist/public/assets/{LintConfigEditor-BrzBuNZO.js → LintConfigEditor-B0dzhCuG.js} +1 -1
  36. package/dist/public/assets/{ManagedArtifactProperties-BC8n8Uux.js → ManagedArtifactProperties-CtEUYI6Q.js} +1 -1
  37. package/dist/public/assets/ManagedArtifactProperties-sotU_Ocn.js +1 -0
  38. package/dist/public/assets/{MermaidDocEditor-Bcrx_8El.js → MermaidDocEditor-C7JqZR9B.js} +1 -1
  39. package/dist/public/assets/{OpenInAgentMenuItem-AxhfRLpc.js → OpenInAgentMenuItem-d6cTev6Q.js} +1 -1
  40. package/dist/public/assets/{PropertyDisplayRow-C--8-E2f.js → PropertyDisplayRow-CC5SBOVN.js} +1 -1
  41. package/dist/public/assets/{RegisteredAgentIcon-KQW6AEu6.js → RegisteredAgentIcon-CT5gi4vr.js} +1 -1
  42. package/dist/public/assets/{ReportBugDialogBody-DX1dP7wO.js → ReportBugDialogBody-By2RAlz4.js} +2 -2
  43. package/dist/public/assets/{ReportBugMenuTrigger-CfFeITtu.js → ReportBugMenuTrigger-B6aEgC78.js} +2 -2
  44. package/dist/public/assets/{SchemaConfigEditor-D4GFyhNn.js → SchemaConfigEditor-7rsW6AqO.js} +1 -1
  45. package/dist/public/assets/{SessionsHost-D9ZVPtHV.js → SessionsHost-bNj6G9Pv.js} +2 -2
  46. package/dist/public/assets/{SettingsDialogBody-CuLgDT7N.js → SettingsDialogBody-5-7DYVq5.js} +4 -4
  47. package/dist/public/assets/{ShareBranchSwitchDialog-Di1yYilr.js → ShareBranchSwitchDialog-B1KimRuC.js} +1 -1
  48. package/dist/public/assets/{ShareReceiveDialog-BKjgWKBF.js → ShareReceiveDialog-D5Bd6_Uw.js} +1 -1
  49. package/dist/public/assets/{ShareReceiveMissDialog-wjtra43z.js → ShareReceiveMissDialog-D3LovDQH.js} +1 -1
  50. package/dist/public/assets/{SkillCostValue-BjMa_RzW.js → SkillCostValue-DwP8X4M4.js} +1 -1
  51. package/dist/public/assets/{SkillEditBanner-BuxFwQVA.js → SkillEditBanner-_K6R6aVz.js} +1 -1
  52. package/dist/public/assets/{SkillForkDialog-DZeI1dUW.js → SkillForkDialog-BgexAeVj.js} +1 -1
  53. package/dist/public/assets/{SkillInstallMenu-cLslx-4M.js → SkillInstallMenu-DzL4PC8i.js} +1 -1
  54. package/dist/public/assets/{SkillOriginInline-ghHkXApt.js → SkillOriginInline-I_DytAON.js} +1 -1
  55. package/dist/public/assets/{SkillToolbarControls-Ci1FfVXC.js → SkillToolbarControls-Bb2vtxIa.js} +1 -1
  56. package/dist/public/assets/{SlidesToolbarControls-DgebeZ1o.js → SlidesToolbarControls-sqb30S3w.js} +1 -1
  57. package/dist/public/assets/{SourceEditor-BFdkSsY2.js → SourceEditor-DymwlqP8.js} +1 -1
  58. package/dist/public/assets/{TerminalPanel-BOgEc32H.js → TerminalPanel-a9K3c36S.js} +3 -3
  59. package/dist/public/assets/{TerminalWindowApp-Ct6qN_dO.js → TerminalWindowApp-Dvdpuwl2.js} +1 -1
  60. package/dist/public/assets/{TextDocEditor-mnFdtiZH.js → TextDocEditor-CWdJg5Pu.js} +1 -1
  61. package/dist/public/assets/ThreadView-CILl3ntk.js +21 -0
  62. package/dist/public/assets/{TimelineDiffPane-BAWK-Q5D.js → TimelineDiffPane-B8jS8gx3.js} +1 -1
  63. package/dist/public/assets/{agent-connection-status-BpmHdteI.js → agent-connection-status-LIP44ufg.js} +1 -1
  64. package/dist/public/assets/{auth-state-cache-CdB3wQ9D.js → auth-state-cache-QfPSJt_I.js} +4 -4
  65. package/dist/public/assets/{bug-report-send-manager-Bdl0o5Py.js → bug-report-send-manager-Bs5Fu1jl.js} +1 -1
  66. package/dist/public/assets/{client-version-Ca-8OF05.js → client-version-Sdq1bFlD.js} +1 -1
  67. package/dist/public/assets/{comment-chips-v9i2WFp7.js → comment-chips-DagTxmux.js} +1 -1
  68. package/dist/public/assets/{config-provider-BUgrvKtX.js → config-provider-Dr27QzBn.js} +2 -2
  69. package/dist/public/assets/{css-color-to-hex-CdrQ_PIL.js → css-color-to-hex-C4FHR9dx.js} +1 -1
  70. package/dist/public/assets/{diagnostic-breadcrumb-ZzsGTt1a.js → diagnostic-breadcrumb-CojycWig.js} +1 -1
  71. package/dist/public/assets/{dist-BBWka618.js → dist-DT6HE5IA.js} +195 -195
  72. package/dist/public/assets/{doc-paths-Cchodm9a.js → doc-paths-C7pk7I8D.js} +1 -1
  73. package/dist/public/assets/{doc-undo-manager-Bk_m4g6i.js → doc-undo-manager-BkyufL8p.js} +1 -1
  74. package/dist/public/assets/{documents-events-4ANG-YM5.js → documents-events-CnaHShEW.js} +1 -1
  75. package/dist/public/assets/{file-tree-adapter-DLjG7Vd1.js → file-tree-adapter-BGuWYLzM.js} +1 -1
  76. package/dist/public/assets/{file-tree-utils-xLkLWRXE.js → file-tree-utils-BgvBKCLs.js} +1 -1
  77. package/dist/public/assets/{folder-config-api-DicSUP85.js → folder-config-api-vyjLcdCA.js} +1 -1
  78. package/dist/public/assets/{index--MkvkIJ3.js → index-B3KSeJbY.js} +75 -75
  79. package/dist/public/assets/{lint-config-client-CnphqIMJ.js → lint-config-client-C3yOZHnO.js} +1 -1
  80. package/dist/public/assets/{markdownlint-rule-browser-Deli4eWi.js → markdownlint-rule-browser-CkE1p9lW.js} +1 -1
  81. package/dist/public/assets/navigation-targets-DiuADw5X.js +1 -0
  82. package/dist/public/assets/{page-list-cache-DzovwSp2.js → page-list-cache-DsEiE2Un.js} +1 -1
  83. package/dist/public/assets/{pending-receive-nav-store-CjPbRp3A.js → pending-receive-nav-store-Dcm8McA1.js} +1 -1
  84. package/dist/public/assets/{preferred-session-events-CXVw_3pf.js → preferred-session-events-DWc8Xjyi.js} +1 -1
  85. package/dist/public/assets/{progress-W-vIN-1-.js → progress-CJ4FRC5C.js} +3 -3
  86. package/dist/public/assets/{project-paths-C72_JOWy.js → project-paths-CBxhzjAo.js} +1 -1
  87. package/dist/public/assets/{prop-types-Dr9qeaU4.js → prop-types-CeNV_Lm8.js} +1 -1
  88. package/dist/public/assets/{receive-store-Dsik8VH_.js → receive-store-C7JHFqt7.js} +1 -1
  89. package/dist/public/assets/{selection-context-Cp2kc_W1.js → selection-context-C4yFDd-G.js} +1 -1
  90. package/dist/public/assets/{sign-in-terminal-events-fDClI0Ap.js → sign-in-terminal-events-DLcKlGJW.js} +1 -1
  91. package/dist/public/assets/{skill-scope-CDgG3_a5.js → skill-scope-53qgIrBi.js} +1 -1
  92. package/dist/public/assets/{skills-api-CpXGHi5r.js → skills-api-CG4bu_dq.js} +1 -1
  93. package/dist/public/assets/{src-CTXqiIaz.js → src-D7ecQKqz.js} +1 -1
  94. package/dist/public/assets/{startup-marks-CP0XYWYE.js → startup-marks-Du9Crw9t.js} +1 -1
  95. package/dist/public/assets/{tag-pill-input-Bs1Otf32.js → tag-pill-input-0bmnekZe.js} +1 -1
  96. package/dist/public/assets/{target-navigation-intent-BVmWK8dj.js → target-navigation-intent-DYQRxPvr.js} +1 -1
  97. package/dist/public/assets/{telemetry-startup-B5w9-Gaz.js → telemetry-startup-0nqSXEm2.js} +1 -1
  98. package/dist/public/assets/{terminal-command-events-B_odljGI.js → terminal-command-events-Bcf_LtH6.js} +1 -1
  99. package/dist/public/assets/{terminal-launch-events-BBQ_c0On.js → terminal-launch-events-hw0w9wbw.js} +1 -1
  100. package/dist/public/assets/{terminal-telemetry-GDbpPMTk.js → terminal-telemetry-DEVcyHvO.js} +1 -1
  101. package/dist/public/assets/{thread-client-D1YauXa3.js → thread-client-CvXILcIs.js} +1 -1
  102. package/dist/public/assets/{typing-burst-detector-BFDczoXG.js → typing-burst-detector-bSQ8b587.js} +3 -3
  103. package/dist/public/assets/{uninstall-BcKDZGep.js → uninstall-BYIz77L2.js} +1 -1
  104. package/dist/public/assets/{use-activity-panel-BYLbiHM1.js → use-activity-panel-CCxIwVvo.js} +1 -1
  105. package/dist/public/assets/{use-apply-config-language-CcGDxTum.js → use-apply-config-language-DUnEKDIN.js} +1 -1
  106. package/dist/public/assets/{use-collab-url-BEoSkrry.js → use-collab-url-BBYolnNH.js} +1 -1
  107. package/dist/public/assets/{use-conflicts-N7mhpHgE.js → use-conflicts-CTT0fVBq.js} +1 -1
  108. package/dist/public/assets/{use-live-xterm-theme-BFttHtXj.js → use-live-xterm-theme-lf7zogfi.js} +1 -1
  109. package/dist/public/assets/{use-open-skill-xND65ZuD.js → use-open-skill-BD8zATG5.js} +1 -1
  110. package/dist/public/assets/{use-settings-route-Dq8G3ePM.js → use-settings-route-BdukeOHl.js} +1 -1
  111. package/dist/public/assets/{use-skill-origin-DuzlJQSS.js → use-skill-origin-D5GNh_Yy.js} +1 -1
  112. package/dist/public/assets/{use-skills-ComzVz7s.js → use-skills-6SOBj70E.js} +1 -1
  113. package/dist/public/assets/{use-terminal-enabled-DTm-rbQh.js → use-terminal-enabled-Bi7qjHzG.js} +1 -1
  114. package/dist/public/assets/use-timeline-entry-diff-D1u6nQ9x.js +5 -0
  115. package/dist/public/assets/{use-workspace-JzehlodO.js → use-workspace-BeJwTF-m.js} +1 -1
  116. package/dist/public/index.html +57 -57
  117. package/dist/public/uninstall.html +3 -3
  118. package/dist/{registry-probes-CHLJIRQ4.mjs → registry-probes-BCPhKQte.mjs} +1 -1
  119. package/dist/{removal-file-path-Db5k0FY2.mjs → removal-file-path-D8sfQtGu.mjs} +1 -1
  120. package/dist/{repair-launch-json-deR6M_1O.mjs → repair-launch-json-BMlAnEeM.mjs} +1 -1
  121. package/dist/{repair-mcp-configs-Heu6oO75.mjs → repair-mcp-configs-DXFs_6us.mjs} +1 -1
  122. package/dist/{src-DtEzWpk5.mjs → src-B8i0Z_NO.mjs} +1 -1
  123. package/dist/src-BSG5D3Tb.mjs +1 -0
  124. package/dist/start-CuAZYwLo.mjs +1 -0
  125. package/dist/{start-ufRM13rZ.mjs → start-MMCeO0I3.mjs} +3 -3
  126. package/package.json +5 -5
  127. package/dist/constants-C_LhGnYS.mjs +0 -1
  128. package/dist/init-DCPTgvxB.mjs +0 -1
  129. package/dist/loader-BXm1oZrQ.mjs +0 -1
  130. package/dist/preview-qA7eAGIs.mjs +0 -1
  131. package/dist/public/assets/AddPropertiesButton-onYfQ085.js +0 -2
  132. package/dist/public/assets/CodeMirrorPropInput-BxpqNYRy.js +0 -3
  133. package/dist/public/assets/DocumentContext-D5M6KGbp.js +0 -39
  134. package/dist/public/assets/FeedbackForm-W-GjgDzG.js +0 -1
  135. package/dist/public/assets/ManagedArtifactProperties-BjR__N-F.js +0 -1
  136. package/dist/public/assets/ThreadView-eUlv8dQ1.js +0 -21
  137. package/dist/public/assets/navigation-targets-CQRRzWZU.js +0 -1
  138. package/dist/public/assets/use-timeline-entry-diff-BSYk_tLD.js +0 -5
  139. package/dist/src-x20mMyjG.mjs +0 -1
  140. package/dist/start-u8_lFdEN.mjs +0 -1
@@ -1 +1 @@
1
- import{Rn as e,Ti as t,da as n}from"./dist-BBWka618.js";import{c as r,t as i}from"./trace-api-BP9dN1Hz.js";import{t as a}from"./propagation-api-DC5404fy.js";import{t as o}from"./createLucideIcon-B6ULg5PN.js";import{n as s}from"./contact-email-store-VCf9Nhpy.js";var c=o(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),l=`support@inkeep.com`;function u(e){return`mailto:${l}?subject=${encodeURIComponent(e)}`}function d(e){return e.split(/[\\/]/).pop()??e}function f(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:e>=1024?`${Math.max(1,Math.round(e/1024))} KB`:`${e} B`}var p=200,m=/^(?:#{1,6}|>)(?:[ \t]+|$)/;function h(r){if(typeof r==`string`)for(let i of r.split(/\r\n|\r|\n/)){let r=t(i);for(r=n(r).replace(/\s+/g,` `).trim();m.test(r);)r=r.replace(m,``).trim();if(r!==``)return e(r,p).trimEnd()}}var g=`open-knowledge-app`,_=`ok.bug-report.send.attempt`,v={traceparent:()=>void 0,end:()=>{}},y=v;function b(e={}){try{let t=i.getTracer(g).startSpan(_,{attributes:e});return t.isRecording()?x(t,i.setSpan(r,t)):(t.end(),y)}catch(e){return console.warn(`[bug-report-send-otel] span start failed:`,e instanceof Error?e:String(e)),y}}function x(e,t){let n=!1;return{traceparent(){try{let e={};return a.inject(t,e),e.traceparent}catch{return}},end(t,r){if(!n){n=!0;try{r&&e.setAttributes(r),e.setAttribute(`ok.bug_report.renderer_outcome`,t),e.end()}catch{}}}}}var S=200,C=3,w=.9;function T(e,t=s){if(e.kind===`history-row`){let{row:n}=e,r=t.getSnapshot().email;return{zipPath:n.zipPath,zipSizeBytes:n.zipBytes,metadata:{level:n.bundleLevel===`unknown`?`standard`:n.bundleLevel,systemWide:n.systemWide,projectSlug:n.projectSlug,...n.note===void 0?{}:{note:n.note},...r===null?{}:{email:r}}}}let{report:n,note:r,includeScreenshot:i,includeAttachments:a,email:o}=e;return{zipPath:n.zipPath,zipSizeBytes:n.zipSizeBytes,metadata:{level:n.summary.level,systemWide:n.summary.systemWide,projectSlug:n.summary.projectSlug,note:r,...o===void 0?{}:{email:o}},includeScreenshot:i,...a===void 0?{}:{includeAttachments:a}}}function E(e,t=s){let n=new Map,r=new Set,i=null;function a(){for(let e of r)try{e()}catch(e){console.warn(`[bug-report-send] subscriber threw:`,e)}}function o(e,t){e.state=t,i=null,a()}function c(e){return{operationId:e.operationId,zipPath:e.zipPath,zipSizeBytes:e.zipSizeBytes,requestSeq:e.requestSeq}}function l(e){e.fillTimer!==null&&(clearInterval(e.fillTimer),e.fillTimer=null)}function u(e){l(e);let t=Date.now();e.fillTimer=setInterval(()=>{if(e.state.status!==`sending`){l(e);return}let n=(Date.now()-t)/1e3,r=Math.min(w,1-Math.exp(-n/C)),i=Math.round(r*100);i!==e.state.fillPercent&&o(e,{...c(e),status:`sending`,fillPercent:i})},S)}function f(e,t){l(e),e.span.end(t.status===`email-draft`?`email-drafted`:t.status===`already-sending`?`joined`:t.status,{"ok.bug_report.request_seq":e.requestSeq}),o(e,{...c(e),...t})}function p(e,t){if(t.ok){f(e,{status:`sent`,reference:t.reference});return}if(t.reason===`email-draft`){f(e,{status:`email-draft`,mailtoUrl:t.fallback.mailtoUrl});return}if(t.reason===`send-in-flight`){f(e,{status:`already-sending`});return}f(e,{status:`failed`,mailtoUrl:t.fallback.mailtoUrl})}function m(e){e.span=b({"ok.bug_report.zip_bytes":e.input.zipSizeBytes,"ok.bug_report.include_screenshot":e.input.includeScreenshot===!0,"ok.bug_report.attempt":e.requestSeq}),o(e,{...c(e),status:`sending`,fillPercent:0}),u(e),g(e,e.input)}function h(e){return e.requestSeq+=1,e.state.status===`sending`?(o(e,{...c(e),status:`sending`,fillPercent:e.state.fillPercent}),e.state):(m(e),e.state)}async function g(t,n){try{let r=e();if(r===void 0){console.warn(`[bug-report-send] no desktop bridge; send cannot be dispatched`),f(t,{status:`failed`});return}let i=t.span.traceparent();p(t,await r.send({zipPath:n.zipPath,metadata:n.metadata,...n.includeScreenshot===void 0?{}:{includeScreenshot:n.includeScreenshot},...n.includeAttachments===void 0?{}:{includeAttachments:n.includeAttachments},...i===void 0?{}:{traceparent:i}}))}catch(e){console.warn(`[bug-report-send] IPC dispatch threw:`,e),f(t,{status:`failed`})}}return{startBugReportSend(e){let r=T(e,t),i=d(r.zipPath),a=n.get(i);if(a!==void 0)return a.input=r,h(a);let o={operationId:i,zipPath:r.zipPath,zipSizeBytes:r.zipSizeBytes,requestSeq:1},s={...o,input:r,fillTimer:null,state:{...o,status:`sending`,fillPercent:0},span:v};return n.set(i,s),m(s),s.state},retryBugReportSend(e){let t=n.get(e);t!==void 0&&h(t)},get(e){return n.get(e)?.state},getSnapshot(){return i??=[...n.values()].map(e=>e.state),i},subscribe(e){return r.add(e),()=>{r.delete(e)}}}}var D=E(()=>window.okDesktop?.bugReport);export{d as a,u as i,h as n,c as o,f as r,D as t};
1
+ import{Rn as e,Ti as t,fa as n}from"./dist-DT6HE5IA.js";import{c as r,t as i}from"./trace-api-BP9dN1Hz.js";import{t as a}from"./propagation-api-DC5404fy.js";import{t as o}from"./createLucideIcon-B6ULg5PN.js";import{n as s}from"./contact-email-store-VCf9Nhpy.js";var c=o(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),l=`support@inkeep.com`;function u(e){return`mailto:${l}?subject=${encodeURIComponent(e)}`}function d(e){return e.split(/[\\/]/).pop()??e}function f(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:e>=1024?`${Math.max(1,Math.round(e/1024))} KB`:`${e} B`}var p=200,m=/^(?:#{1,6}|>)(?:[ \t]+|$)/;function h(r){if(typeof r==`string`)for(let i of r.split(/\r\n|\r|\n/)){let r=t(i);for(r=n(r).replace(/\s+/g,` `).trim();m.test(r);)r=r.replace(m,``).trim();if(r!==``)return e(r,p).trimEnd()}}var g=`open-knowledge-app`,_=`ok.bug-report.send.attempt`,v={traceparent:()=>void 0,end:()=>{}},y=v;function b(e={}){try{let t=i.getTracer(g).startSpan(_,{attributes:e});return t.isRecording()?x(t,i.setSpan(r,t)):(t.end(),y)}catch(e){return console.warn(`[bug-report-send-otel] span start failed:`,e instanceof Error?e:String(e)),y}}function x(e,t){let n=!1;return{traceparent(){try{let e={};return a.inject(t,e),e.traceparent}catch{return}},end(t,r){if(!n){n=!0;try{r&&e.setAttributes(r),e.setAttribute(`ok.bug_report.renderer_outcome`,t),e.end()}catch{}}}}}var S=200,C=3,w=.9;function T(e,t=s){if(e.kind===`history-row`){let{row:n}=e,r=t.getSnapshot().email;return{zipPath:n.zipPath,zipSizeBytes:n.zipBytes,metadata:{level:n.bundleLevel===`unknown`?`standard`:n.bundleLevel,systemWide:n.systemWide,projectSlug:n.projectSlug,...n.note===void 0?{}:{note:n.note},...r===null?{}:{email:r}}}}let{report:n,note:r,includeScreenshot:i,includeAttachments:a,email:o}=e;return{zipPath:n.zipPath,zipSizeBytes:n.zipSizeBytes,metadata:{level:n.summary.level,systemWide:n.summary.systemWide,projectSlug:n.summary.projectSlug,note:r,...o===void 0?{}:{email:o}},includeScreenshot:i,...a===void 0?{}:{includeAttachments:a}}}function E(e,t=s){let n=new Map,r=new Set,i=null;function a(){for(let e of r)try{e()}catch(e){console.warn(`[bug-report-send] subscriber threw:`,e)}}function o(e,t){e.state=t,i=null,a()}function c(e){return{operationId:e.operationId,zipPath:e.zipPath,zipSizeBytes:e.zipSizeBytes,requestSeq:e.requestSeq}}function l(e){e.fillTimer!==null&&(clearInterval(e.fillTimer),e.fillTimer=null)}function u(e){l(e);let t=Date.now();e.fillTimer=setInterval(()=>{if(e.state.status!==`sending`){l(e);return}let n=(Date.now()-t)/1e3,r=Math.min(w,1-Math.exp(-n/C)),i=Math.round(r*100);i!==e.state.fillPercent&&o(e,{...c(e),status:`sending`,fillPercent:i})},S)}function f(e,t){l(e),e.span.end(t.status===`email-draft`?`email-drafted`:t.status===`already-sending`?`joined`:t.status,{"ok.bug_report.request_seq":e.requestSeq}),o(e,{...c(e),...t})}function p(e,t){if(t.ok){f(e,{status:`sent`,reference:t.reference});return}if(t.reason===`email-draft`){f(e,{status:`email-draft`,mailtoUrl:t.fallback.mailtoUrl});return}if(t.reason===`send-in-flight`){f(e,{status:`already-sending`});return}f(e,{status:`failed`,mailtoUrl:t.fallback.mailtoUrl})}function m(e){e.span=b({"ok.bug_report.zip_bytes":e.input.zipSizeBytes,"ok.bug_report.include_screenshot":e.input.includeScreenshot===!0,"ok.bug_report.attempt":e.requestSeq}),o(e,{...c(e),status:`sending`,fillPercent:0}),u(e),g(e,e.input)}function h(e){return e.requestSeq+=1,e.state.status===`sending`?(o(e,{...c(e),status:`sending`,fillPercent:e.state.fillPercent}),e.state):(m(e),e.state)}async function g(t,n){try{let r=e();if(r===void 0){console.warn(`[bug-report-send] no desktop bridge; send cannot be dispatched`),f(t,{status:`failed`});return}let i=t.span.traceparent();p(t,await r.send({zipPath:n.zipPath,metadata:n.metadata,...n.includeScreenshot===void 0?{}:{includeScreenshot:n.includeScreenshot},...n.includeAttachments===void 0?{}:{includeAttachments:n.includeAttachments},...i===void 0?{}:{traceparent:i}}))}catch(e){console.warn(`[bug-report-send] IPC dispatch threw:`,e),f(t,{status:`failed`})}}return{startBugReportSend(e){let r=T(e,t),i=d(r.zipPath),a=n.get(i);if(a!==void 0)return a.input=r,h(a);let o={operationId:i,zipPath:r.zipPath,zipSizeBytes:r.zipSizeBytes,requestSeq:1},s={...o,input:r,fillTimer:null,state:{...o,status:`sending`,fillPercent:0},span:v};return n.set(i,s),m(s),s.state},retryBugReportSend(e){let t=n.get(e);t!==void 0&&h(t)},get(e){return n.get(e)?.state},getSnapshot(){return i??=[...n.values()].map(e=>e.state),i},subscribe(e){return r.add(e),()=>{r.delete(e)}}}}var D=E(()=>window.okDesktop?.bugReport);export{d as a,u as i,h as n,c as o,f as r,D as t};
@@ -1 +1 @@
1
- import{Hn as e,Un as t}from"./dist-BBWka618.js";var n={BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.77.8`}?.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
+ import{Hn as e,Un as t}from"./dist-DT6HE5IA.js";var n={BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.77.8`}?.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{Fr as t,In as n,Pr as r,Qn as i,Vr as a,Xn as o,di as s,ii as c,si as l}from"./DocumentContext-D5M6KGbp.js";import{n as u,r as d}from"./dist-Nvb76hAm.js";import{t as f}from"./compiler-runtime-BfE3aGVn.js";import{t as p}from"./utils-CPqDy6Hr.js";import{t as m}from"./button-HKX9wT1K.js";import{i as h,n as g,t as _}from"./tooltip-DVBVVaAs.js";import{Dr as v,Kn as y,cr as b,ea as x,lr as S,qn as C}from"./dist-BBWka618.js";import{n as w}from"./dist-CJhtNlOm2.js";import{t as T}from"./dist-Cr4-nBVI.js";import{t as ee}from"./createLucideIcon-B6ULg5PN.js";import{Mt as te}from"./CodeMirrorPropInput-BxpqNYRy.js";import{t as ne}from"./x-DIayTyoR.js";import{f as re}from"./doc-paths-Cchodm9a.js";var E=ee(`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`}]]),D=f(),ie=`var(--ok-comment-hue, rgb(37 99 235))`,ae={fill:.22,line:.7},O={fill:.45,line:1},oe=.45;function k(e){return`color-mix(in srgb,${ie} ${e*100}%,transparent)`}function se(e,t){let{fill:n,line:r}=t?O:ae;return[`border-radius:2px`,`padding-bottom:1px`,...e.id===null?[]:[`cursor:pointer`],`background-color:${k(n)}`,`box-shadow:inset 0 -2px 0 ${k(r)}`,``].join(`;`)}function A(e){return e.map(e=>e.id??`·`).join(`|`)}function ce(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 j(e,t){return e.id===null||e.id===t}function M(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=>j(e,t));i.push({from:a.from,to:a.to,style:se(e??a.covering[0],e!==void 0),threadId:ce(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&&A(a.covering)===A(s)){a.to=i;continue}o(),a={from:t,to:i,covering:s}}return o(),i}var N=`data-comment-reveal`;function P(e){return typeof CSS<`u`&&CSS.escape?CSS.escape(e):e}function F(e){return e===``?null:document.querySelector(`[data-testid="property-row"][data-key="${P(e)}"]`)}function le(e){let t=F(e);if(t===null)return null;let n=t.getBoundingClientRect();return n.height===0&&n.width===0?null:n}function ue(e){F(e)?.scrollIntoView({block:`center`,behavior:`smooth`})}function I(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="${P(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=L(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),de(n),!0}return!1}function L(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 de(e){e.style.setProperty(`--comment-reveal-fill`,k(oe)),e.setAttribute(N,`true`);let t=()=>{e.removeAttribute(N),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 R(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=y(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 z(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 B(e,t,n){let r=n?.prefix??``,i=n?.suffix??``;if(r===``&&i===``)return null;let a=r===``?[0]:v(e,r,{syntaxIn:`needle`}).map(e=>e.end),o=i===``?[e.length]:v(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=x(t.length);return c-s>l?null:{start:s,end:c}}function V(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 H(e,t,n){if(t.length===0)return null;let r=z(e.text,t).map(e=>({start:e,end:e+t.length}));if(r.length===0&&(r=v(e.text,t,{syntaxIn:`needle`})),r.length===0){let r=B(e.text,t,n);return r===null?null:V(e,r)}let i=n?.prefix??``,a=n?.suffix??``,o=t=>e.text.includes(t)||v(e.text,t,{syntaxIn:`needle`}).length>0;if(i!==``&&a!==``&&!o(i+t+a)&&o(i+a))return null;let s=b({prefix:i,suffix:a},{syntaxInContext:!0}),c=t=>s===0||S(e.text,t,{prefix:i,suffix:a},{syntaxIn:`none`,syntaxInContext:!0})>=s;if(r.length===1){if(!c(r[0])){let r=B(e.text,t,n);return r===null?null:V(e,r)}return V(e,r[0])}let l=[],u=-1;for(let t of r){let n=S(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=B(e.text,t,n);return r===null?null:V(e,r)}return V(e,l[0])}var U=64;function fe(e,t,n){return{prefix:C(e,Math.max(0,t-U),t),suffix:C(e,n,Math.min(e.content.size,n+U))}}function W(e,t,n){return G(e)(t,n)}function G(e){let t=R(e),n=null;return(r,i)=>{let a=H(t,r,i);return a===null?(n??=R(e,{includeBlockComponents:!0}),H(n,r,i)):a}}var pe=220,me=24;function he(e){let t=e.viewTop+e.insetTop,n=e.viewBottom-pe;return e.anchorTop>=t&&e.anchorBottom<=n?0:e.anchorTop-(t+me)}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,r,i){let a=te(e);if(!a)return!1;let o=K(a.dom);if(!o)return n(r,`comment-reveal`,()=>e.commands.scrollIntoView());let s,c;try{s=a.coordsAtPos(t.from),c=a.coordsAtPos(t.to)}catch{return!1}let l=o.getBoundingClientRect(),u=he({anchorTop:s.top,anchorBottom:Math.max(s.bottom,c.bottom),viewTop:l.top,viewBottom:l.bottom,insetTop:q(o)});if(u===0)return!0;let d=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;return n(r,`comment-reveal`,()=>o.scrollTo({top:o.scrollTop+u,behavior:i?.instant||d?`auto`:`smooth`}))}var ge=1e4,_e=80,ve=1500,Y=[`wheel`,`touchstart`,`mousedown`,`keydown`];function ye(e){let n=!1,a=null,c=null,l=-1,u=()=>{let i=o(e.docName);if(!i||i.isDestroyed)return!1;if(n||(n=!0,r(e.threadId)),e.quote===``)return a===null&&(a=Date.now(),t(e.threadId)),!0;let s=i.state.doc.content.size;return(c===null||s!==l)&&(c=W(i.state.doc,e.quote,e.context),l=s),!c||!J(i,c,e.docName,{instant:!0})?!1:(a===null&&(a=Date.now(),t(e.threadId)),!0)};s(`comments`),u(),o(e.docName)===null&&window.location.assign(re(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()&&a!==null&&Date.now()-a>=ve&&f()},h=i(m),g=window.setInterval(m,_e),_=window.setTimeout(()=>{a===null&&w.error(n?T._({id:`KeXgA-`}):T._({id:`JDQ5I5`})),f()},ge);for(let e of Y)window.addEventListener(e,p,!0);m()}var X=e();function be(){return c().length}function xe(){let e=(0,D.c)(4),t=c(),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(Se),e[2]=n,e[3]=r),r}function Se(e){let[t,n]=e;return{docName:t,count:n}}function Ce(e){let t=(0,D.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}=d();if(n===0)return null;let c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=p(`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 f;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,X.jsx)(E,{className:`size-3`}),t[5]=f):f=t[5];let v;t[6]!==n||t[7]!==o.length?(v=o.length>1?(0,X.jsx)(u,{id:`5TmrYN`,values:{0:o.length,count:n}}):(0,X.jsx)(u,{id:`eiUA4k`,values:{count:n}}),t[6]=n,t[7]=o.length,t[8]=v):v=t[8];let y;t[9]!==l||t[10]!==v?(y=(0,X.jsx)(h,{asChild:!0,children:(0,X.jsxs)(m,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":l,onClick:Te,"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:[f,v]})}),t[9]=l,t[10]=v,t[11]=y):y=t[11];let b;t[12]===o?b=t[13]:(b=(0,X.jsx)(g,{className:`max-w-64`,children:o.length>1?(0,X.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:o.map(we)}):(0,X.jsx)(u,{id:`2zvUIK`})}),t[12]=o,t[13]=b);let x;t[14]!==y||t[15]!==b?(x=(0,X.jsxs)(_,{children:[y,b]}),t[14]=y,t[15]=b,t[16]=x):x=t[16];let S;t[17]===s?S=t[18]:(S=s({id:`pFRz_E`}),t[17]=s,t[18]=S);let C;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,X.jsx)(ne,{className:`size-3`}),t[19]=C):C=t[19];let w;t[20]!==i||t[21]!==S?(w=(0,X.jsx)(m,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":S,onClick:i,className:`size-4 p-0 text-muted-foreground hover:text-foreground`,children:C}),t[20]=i,t[21]=S,t[22]=w):w=t[22];let T;return t[23]!==w||t[24]!==x?(T=(0,X.jsxs)(`span`,{"data-testid":`composer-context-chip-comments`,className:c,children:[x,w]}),t[23]=w,t[24]=x,t[25]=T):T=t[25],T}function we(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 Te(){return l()}function Z(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function Q(e,t){let n=e;for(let e of t)n+=typeof e==`number`?`[${e}]`:`.${e}`;return n}function Ee(e){ye({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=()=>{I({key:t.key,path:t.path,quote:n.quote,start:n.start,end:n.end})||(r+=1,!(r>=De)&&requestAnimationFrame(i))};requestAnimationFrame(i)}var De=30;function Oe(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 ke(e){let t=e.replace(/\s+/g,` `).trimStart();return t.length>$?`…${t.slice(-$)}`:t}function Ae(e){let t=e.replace(/\s+/g,` `).trimEnd();return t.length>$?`${t.slice(0,$)}…`:t}function je(e){if(!e.repeats)return null;let t=ke(e.prefix),n=Ae(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 Me(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{Fr as t,In as n,Pr as r,Qn as i,Vr as a,Xn as o,di as s,ii as c,si as l}from"./DocumentContext-qmBJKxx1.js";import{n as u,r as d}from"./dist-Nvb76hAm.js";import{t as f}from"./compiler-runtime-BfE3aGVn.js";import{t as p}from"./utils-CPqDy6Hr.js";import{t as m}from"./button-HKX9wT1K.js";import{i as h,n as g,t as _}from"./tooltip-DVBVVaAs.js";import{Dr as v,Kn as y,cr as b,lr as x,qn as S,ta as C}from"./dist-DT6HE5IA.js";import{n as w}from"./dist-CJhtNlOm2.js";import{t as T}from"./dist-Cr4-nBVI.js";import{t as ee}from"./createLucideIcon-B6ULg5PN.js";import{Mt as te}from"./CodeMirrorPropInput-CUaf0ERc.js";import{t as ne}from"./x-DIayTyoR.js";import{f as re}from"./doc-paths-C7pk7I8D.js";var E=ee(`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`}]]),D=f(),ie=`var(--ok-comment-hue, rgb(37 99 235))`,ae={fill:.22,line:.7},O={fill:.45,line:1},oe=.45;function k(e){return`color-mix(in srgb,${ie} ${e*100}%,transparent)`}function se(e,t){let{fill:n,line:r}=t?O:ae;return[`border-radius:2px`,`padding-bottom:1px`,...e.id===null?[]:[`cursor:pointer`],`background-color:${k(n)}`,`box-shadow:inset 0 -2px 0 ${k(r)}`,``].join(`;`)}function A(e){return e.map(e=>e.id??`·`).join(`|`)}function ce(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 j(e,t){return e.id===null||e.id===t}function M(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=>j(e,t));i.push({from:a.from,to:a.to,style:se(e??a.covering[0],e!==void 0),threadId:ce(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&&A(a.covering)===A(s)){a.to=i;continue}o(),a={from:t,to:i,covering:s}}return o(),i}var N=`data-comment-reveal`;function P(e){return typeof CSS<`u`&&CSS.escape?CSS.escape(e):e}function F(e){return e===``?null:document.querySelector(`[data-testid="property-row"][data-key="${P(e)}"]`)}function le(e){let t=F(e);if(t===null)return null;let n=t.getBoundingClientRect();return n.height===0&&n.width===0?null:n}function ue(e){F(e)?.scrollIntoView({block:`center`,behavior:`smooth`})}function I(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="${P(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=L(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),de(n),!0}return!1}function L(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 de(e){e.style.setProperty(`--comment-reveal-fill`,k(oe)),e.setAttribute(N,`true`);let t=()=>{e.removeAttribute(N),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 R(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=y(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 z(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 B(e,t,n){let r=n?.prefix??``,i=n?.suffix??``;if(r===``&&i===``)return null;let a=r===``?[0]:v(e,r,{syntaxIn:`needle`}).map(e=>e.end),o=i===``?[e.length]:v(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=C(t.length);return c-s>l?null:{start:s,end:c}}function V(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 H(e,t,n){if(t.length===0)return null;let r=z(e.text,t).map(e=>({start:e,end:e+t.length}));if(r.length===0&&(r=v(e.text,t,{syntaxIn:`needle`})),r.length===0){let r=B(e.text,t,n);return r===null?null:V(e,r)}let i=n?.prefix??``,a=n?.suffix??``,o=t=>e.text.includes(t)||v(e.text,t,{syntaxIn:`needle`}).length>0;if(i!==``&&a!==``&&!o(i+t+a)&&o(i+a))return null;let s=b({prefix:i,suffix:a},{syntaxInContext:!0}),c=t=>s===0||x(e.text,t,{prefix:i,suffix:a},{syntaxIn:`none`,syntaxInContext:!0})>=s;if(r.length===1){if(!c(r[0])){let r=B(e.text,t,n);return r===null?null:V(e,r)}return V(e,r[0])}let l=[],u=-1;for(let t of r){let n=x(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=B(e.text,t,n);return r===null?null:V(e,r)}return V(e,l[0])}var U=64;function fe(e,t,n){return{prefix:S(e,Math.max(0,t-U),t),suffix:S(e,n,Math.min(e.content.size,n+U))}}function W(e,t,n){return G(e)(t,n)}function G(e){let t=R(e),n=null;return(r,i)=>{let a=H(t,r,i);return a===null?(n??=R(e,{includeBlockComponents:!0}),H(n,r,i)):a}}var pe=220,me=24;function he(e){let t=e.viewTop+e.insetTop,n=e.viewBottom-pe;return e.anchorTop>=t&&e.anchorBottom<=n?0:e.anchorTop-(t+me)}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,r,i){let a=te(e);if(!a)return!1;let o=K(a.dom);if(!o)return n(r,`comment-reveal`,()=>e.commands.scrollIntoView());let s,c;try{s=a.coordsAtPos(t.from),c=a.coordsAtPos(t.to)}catch{return!1}let l=o.getBoundingClientRect(),u=he({anchorTop:s.top,anchorBottom:Math.max(s.bottom,c.bottom),viewTop:l.top,viewBottom:l.bottom,insetTop:q(o)});if(u===0)return!0;let d=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;return n(r,`comment-reveal`,()=>o.scrollTo({top:o.scrollTop+u,behavior:i?.instant||d?`auto`:`smooth`}))}var ge=1e4,_e=80,ve=1500,Y=[`wheel`,`touchstart`,`mousedown`,`keydown`];function ye(e){let n=!1,a=null,c=null,l=-1,u=()=>{let i=o(e.docName);if(!i||i.isDestroyed)return!1;if(n||(n=!0,r(e.threadId)),e.quote===``)return a===null&&(a=Date.now(),t(e.threadId)),!0;let s=i.state.doc.content.size;return(c===null||s!==l)&&(c=W(i.state.doc,e.quote,e.context),l=s),!c||!J(i,c,e.docName,{instant:!0})?!1:(a===null&&(a=Date.now(),t(e.threadId)),!0)};s(`comments`),u(),o(e.docName)===null&&window.location.assign(re(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()&&a!==null&&Date.now()-a>=ve&&f()},h=i(m),g=window.setInterval(m,_e),_=window.setTimeout(()=>{a===null&&w.error(n?T._({id:`KeXgA-`}):T._({id:`JDQ5I5`})),f()},ge);for(let e of Y)window.addEventListener(e,p,!0);m()}var X=e();function be(){return c().length}function xe(){let e=(0,D.c)(4),t=c(),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(Se),e[2]=n,e[3]=r),r}function Se(e){let[t,n]=e;return{docName:t,count:n}}function Ce(e){let t=(0,D.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}=d();if(n===0)return null;let c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=p(`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 f;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,X.jsx)(E,{className:`size-3`}),t[5]=f):f=t[5];let v;t[6]!==n||t[7]!==o.length?(v=o.length>1?(0,X.jsx)(u,{id:`5TmrYN`,values:{0:o.length,count:n}}):(0,X.jsx)(u,{id:`eiUA4k`,values:{count:n}}),t[6]=n,t[7]=o.length,t[8]=v):v=t[8];let y;t[9]!==l||t[10]!==v?(y=(0,X.jsx)(h,{asChild:!0,children:(0,X.jsxs)(m,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":l,onClick:Te,"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:[f,v]})}),t[9]=l,t[10]=v,t[11]=y):y=t[11];let b;t[12]===o?b=t[13]:(b=(0,X.jsx)(g,{className:`max-w-64`,children:o.length>1?(0,X.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:o.map(we)}):(0,X.jsx)(u,{id:`2zvUIK`})}),t[12]=o,t[13]=b);let x;t[14]!==y||t[15]!==b?(x=(0,X.jsxs)(_,{children:[y,b]}),t[14]=y,t[15]=b,t[16]=x):x=t[16];let S;t[17]===s?S=t[18]:(S=s({id:`pFRz_E`}),t[17]=s,t[18]=S);let C;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,X.jsx)(ne,{className:`size-3`}),t[19]=C):C=t[19];let w;t[20]!==i||t[21]!==S?(w=(0,X.jsx)(m,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":S,onClick:i,className:`size-4 p-0 text-muted-foreground hover:text-foreground`,children:C}),t[20]=i,t[21]=S,t[22]=w):w=t[22];let T;return t[23]!==w||t[24]!==x?(T=(0,X.jsxs)(`span`,{"data-testid":`composer-context-chip-comments`,className:c,children:[x,w]}),t[23]=w,t[24]=x,t[25]=T):T=t[25],T}function we(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 Te(){return l()}function Z(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function Q(e,t){let n=e;for(let e of t)n+=typeof e==`number`?`[${e}]`:`.${e}`;return n}function Ee(e){ye({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=()=>{I({key:t.key,path:t.path,quote:n.quote,start:n.start,end:n.end})||(r+=1,!(r>=De)&&requestAnimationFrame(i))};requestAnimationFrame(i)}var De=30;function Oe(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 ke(e){let t=e.replace(/\s+/g,` `).trimStart();return t.length>$?`…${t.slice(-$)}`:t}function Ae(e){let t=e.replace(/\s+/g,` `).trimEnd();return t.length>$?`${t.slice(0,$)}…`:t}function je(e){if(!e.repeats)return null;let t=ke(e.prefix),n=Ae(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 Me(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=je(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(`