@inkeep/open-knowledge 0.70.0-beta.0 → 0.70.0-beta.2
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.
- package/dist/cli.mjs +55 -55
- package/dist/config-schema.json +41 -2
- package/dist/config.project-local.schema.json +41 -2
- package/dist/constants-Bc5xIETT.mjs +1 -0
- package/dist/dist-C4d76Rpb.mjs +2096 -0
- package/dist/{dist-CGh73TLX.mjs → dist-DSfQybpf.mjs} +1 -1
- package/dist/index.d.mts +34 -5
- package/dist/index.mjs +195 -194
- package/dist/{init-BoWs4nCr.mjs → init-B8otmhem.mjs} +6 -6
- package/dist/init-VOay_9uk.mjs +1 -0
- package/dist/{launch-json-removal-Dhpyz5pP.mjs → launch-json-removal-CSUPTNXq.mjs} +1 -1
- package/dist/loader-Bw8wLLLY.mjs +1 -0
- package/dist/{loader-cLA8gh5I.mjs → loader-DM3RDJSO.mjs} +1 -1
- package/dist/{md-manager-BGnqyqi1-Eez8IlhB.mjs → md-manager-BGnqyqi1-BRU4tUy7.mjs} +152 -151
- package/dist/{open-browser-BtsloeTq.mjs → open-browser-DuRYNL6B.mjs} +1 -1
- package/dist/parse-worker.mjs +1 -1
- package/dist/preview-BBMcu2-A.mjs +1 -0
- package/dist/{preview-ONz3pvVl.mjs → preview-CYFnPQOv.mjs} +1 -1
- package/dist/public/assets/{ActivityModeContent-DLrJ4foi.js → ActivityModeContent-DragaXza.js} +1 -1
- package/dist/public/assets/AddPropertiesButton-DFlCgtou.js +2 -0
- package/dist/public/assets/{AgentDiffPane-CK20Sler.js → AgentDiffPane-yvytaUVs.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-BDxB-fkd.js → AgentThreadClientBinder-CIZGqnO4.js} +1 -1
- package/dist/public/assets/{BugReportHistory-CW96wvko.js → BugReportHistory-DBsYT9iz.js} +1 -1
- package/dist/public/assets/{BugReportHistoryDialog-fg844kz-.js → BugReportHistoryDialog-P3UNFYpX.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-B_ciIFEl.js → CodeMirrorPropInput-CUQWZHWI.js} +1 -1
- package/dist/public/assets/{ConsentDialogBody-DLKYsBGr.js → ConsentDialogBody-BfHPZhzb.js} +1 -1
- package/dist/public/assets/{DiffViewBoundary-BsDs3Cr8.js → DiffViewBoundary-CQewsack.js} +1 -1
- package/dist/public/assets/DocumentContext-CCqrdOs8.js +38 -0
- package/dist/public/assets/{EditorModeToggle-t65MRbWS.js → EditorModeToggle-1weEywlb.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-BY66VE3w.js → EnableSyncConfirmDialog-d7C4dW9c.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-ukJfoIvo.js → ExcalidrawDocEditor-Dginkgvz.js} +1 -1
- package/dist/public/assets/FeedbackForm-ojPXbRqa.js +1 -0
- package/dist/public/assets/{GraphPanel-sNH2eMK2.js → GraphPanel-C5ev3_SE.js} +2 -2
- package/dist/public/assets/{ImageAttachments-Dru1UxQV.js → ImageAttachments-D2aCcVH8.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-DfepoPGA.js → ImportSkillDialog-BTamx01W.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-By9LU84S.js → LintConfigEditor-sQ74NhCq.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-BQ_Rtzjn.js +1 -0
- package/dist/public/assets/{ManagedArtifactProperties-DyMGJVvZ.js → ManagedArtifactProperties-D3aoeLtI.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-Bh5kUvWT.js → MermaidDocEditor-DeKBCmeb.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-BmkISl_n.js → PropertyDisplayRow-gEjcWfq6.js} +1 -1
- package/dist/public/assets/{RegisteredAgentIcon-DU5Zkepy.js → RegisteredAgentIcon-YDviE6X3.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-Dzr6g2wD.js → ReportBugDialogBody-SFi56UkR.js} +2 -2
- package/dist/public/assets/{ReportBugMenuTrigger-UUESg7vh.js → ReportBugMenuTrigger-F91L1AZj.js} +2 -2
- package/dist/public/assets/{SchemaConfigEditor-Do0ih795.js → SchemaConfigEditor-CIxijG-Z.js} +1 -1
- package/dist/public/assets/{SessionsHost-tCNY61mn.js → SessionsHost-D_N77zo3.js} +2 -2
- package/dist/public/assets/SettingsDialogBody-KFPdTdnB.js +12 -0
- package/dist/public/assets/{ShareBranchSwitchDialog-CaH1eNpE.js → ShareBranchSwitchDialog-bAZJO__I.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-Fig-8wyz.js → ShareReceiveDialog-C41B5z4S.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-fcJuM795.js → ShareReceiveMissDialog-CwomSBtJ.js} +1 -1
- package/dist/public/assets/{SkillCostValue-ZQq6hE5u.js → SkillCostValue-Bylmnb-A.js} +1 -1
- package/dist/public/assets/{SkillEditBanner-BPuqCq4o.js → SkillEditBanner-C2mIN6x3.js} +1 -1
- package/dist/public/assets/{SkillForkDialog-DIIWYvbn.js → SkillForkDialog-dYxaj5dE.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-D5A-yH22.js → SkillInstallMenu-D6T8E32d.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-BvwZtzy0.js → SkillOriginInline-D5WXJdzq.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-Bzuf2L4K.js → SkillToolbarControls-CyeUXd0g.js} +1 -1
- package/dist/public/assets/{SlidesToolbarControls-CCNjUkub.js → SlidesToolbarControls-DjFzwy6P.js} +1 -1
- package/dist/public/assets/{SourceEditor-D1EC4LhR.js → SourceEditor-3QZVvj5K.js} +1 -1
- package/dist/public/assets/{TerminalPanel-ADMpIanl.js → TerminalPanel-CV-qYO9k.js} +37 -37
- package/dist/public/assets/{TerminalWindowApp-DRN5HohI.js → TerminalWindowApp-DGN2hBxh.js} +1 -1
- package/dist/public/assets/{TextDocEditor-CAqLRqDD.js → TextDocEditor-BgTfF3vK.js} +1 -1
- package/dist/public/assets/{ThreadView-B2ROkECH.js → ThreadView-DXA6kMQF.js} +3 -3
- package/dist/public/assets/{TimelineDiffPane-CRUAE_xv.js → TimelineDiffPane-UzOjUQi8.js} +1 -1
- package/dist/public/assets/{agent-diff-store-CJc5CsTO.js → agent-diff-store-x6ALbH63.js} +1 -1
- package/dist/public/assets/{auth-state-cache-DavuotNV.js → auth-state-cache-D6FotIEW.js} +4 -4
- package/dist/public/assets/{bug-report-send-manager-BK30wBiV.js → bug-report-send-manager-BGTXLvLl.js} +1 -1
- package/dist/public/assets/{client-version-Z0XiFg26.js → client-version-DyH2NeXw.js} +1 -1
- package/dist/public/assets/{comment-chips-dkLNa0Dp.js → comment-chips-BCzPwZfE.js} +1 -1
- package/dist/public/assets/{config-provider-9C5o_NsX.js → config-provider-E8aTSnD0.js} +3 -3
- package/dist/public/assets/{dist-CGNkoXKB.js → dist-BAMccoiQ.js} +190 -189
- package/dist/public/assets/{doc-hash-CH3Kq7TA.js → doc-hash-BosQg4sh.js} +1 -1
- package/dist/public/assets/{doc-undo-manager-HNka4jFM.js → doc-undo-manager-Dohw7WEh.js} +1 -1
- package/dist/public/assets/{documents-events-kUbk4KBT.js → documents-events-Bn2F4Kjs.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-VUzkO2kv.js → file-tree-adapter-CEGar4xj.js} +1 -1
- package/dist/public/assets/{file-tree-utils-D_wP4Dm1.js → file-tree-utils-BQ9mREpa.js} +1 -1
- package/dist/public/assets/{folder-config-api-BF554VSQ.js → folder-config-api-YIvh3iHf.js} +1 -1
- package/dist/public/assets/i18n-B7ZLDvza.js +1 -0
- package/dist/public/assets/{index-DorsgN-U.js → index-K4zW7H4W.js} +18 -18
- package/dist/public/assets/{launcher-selection-C9GmEvOn.js → launcher-selection-B8B77mIg.js} +1 -1
- package/dist/public/assets/{lint-config-client-D2qMETc6.js → lint-config-client-BvWKC3Wa.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-B_7f1Awf.js → markdownlint-rule-browser-CCZftRat.js} +1 -1
- package/dist/public/assets/messages-BTFjxU9n.js +1 -0
- package/dist/public/assets/messages-Brep2oKI.js +1 -0
- package/dist/public/assets/messages-Bs9DJqd5.js +1 -0
- package/dist/public/assets/messages-C9cITjkK.js +1 -0
- package/dist/public/assets/messages-CDnLA-DO.js +1 -0
- package/dist/public/assets/messages-CLyvRLHM.js +1 -0
- package/dist/public/assets/messages-CYuDalsI.js +1 -0
- package/dist/public/assets/messages-ClgLx-TE.js +1 -0
- package/dist/public/assets/messages-CvjxIZ7a.js +1 -0
- package/dist/public/assets/messages-DIf0D0KN.js +1 -0
- package/dist/public/assets/messages-DdK4xB83.js +1 -0
- package/dist/public/assets/messages-xs-q9MAy.js +1 -0
- package/dist/public/assets/page-list-cache-BZ2ZBwsu.js +1 -0
- package/dist/public/assets/{pending-receive-nav-store-CLkSa_9n.js → pending-receive-nav-store-BBBf2Umy.js} +1 -1
- package/dist/public/assets/{progress-BmCmpLlk.js → progress-D3HqSAZp.js} +3 -3
- package/dist/public/assets/{project-paths-Bzd32aJI.js → project-paths-BYXdbpMB.js} +1 -1
- package/dist/public/assets/{prop-types-CFuqY6TP.js → prop-types-CasKVPOh.js} +1 -1
- package/dist/public/assets/{receive-store-BJw3I9N7.js → receive-store-DtW787bd.js} +1 -1
- package/dist/public/assets/{selection-context-DoFtvhYh.js → selection-context-CTMzDsjU.js} +1 -1
- package/dist/public/assets/{skill-scope-B1qEIboE.js → skill-scope-C1Qgc63z.js} +1 -1
- package/dist/public/assets/{skills-api-NyR-fZMK.js → skills-api-BMqLu4Hb.js} +1 -1
- package/dist/public/assets/{src-BRf4q1hw.js → src-Ha52QnYu.js} +1 -1
- package/dist/public/assets/{startup-marks-D0gyAKgY.js → startup-marks-CdHF3wVo.js} +1 -1
- package/dist/public/assets/{tag-pill-input-D1rYfOx4.js → tag-pill-input-BeodRn3n.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-Bf41Ns6y.js → target-navigation-intent-CzTyWdJV.js} +1 -1
- package/dist/public/assets/{telemetry-startup-DirKbY7N.js → telemetry-startup-x3t38jkW.js} +1 -1
- package/dist/public/assets/{terminal-cli-display-BrLCqbMd.js → terminal-cli-display-Bw4dSufC.js} +1 -1
- package/dist/public/assets/{terminal-command-events-CloL_dun.js → terminal-command-events-DOFESer5.js} +1 -1
- package/dist/public/assets/{terminal-telemetry-DBBf7dvq.js → terminal-telemetry-2-39Uk_y.js} +1 -1
- package/dist/public/assets/typing-burst-detector-Q1x_V1Np.js +8 -0
- package/dist/public/assets/{uninstall-BvLS4uRg.js → uninstall-DNrOrE2h.js} +1 -1
- package/dist/public/assets/{use-activity-panel-BbdRwkSj.js → use-activity-panel-DjFXJ_db.js} +1 -1
- package/dist/public/assets/{use-apply-config-color-theme-sUvEkbPv.js → use-apply-config-color-theme-BcpT8ttI.js} +1 -1
- package/dist/public/assets/{use-collab-url-BMqkaPvt.js → use-collab-url-C24fvRK0.js} +1 -1
- package/dist/public/assets/{use-conflicts-CMLH1ChX.js → use-conflicts-CZ8GxQ-n.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme-BgQOsQLk.js → use-live-xterm-theme-CHjJ2cOf.js} +1 -1
- package/dist/public/assets/{use-open-skill-CSftgywB.js → use-open-skill-BRBShUEV.js} +1 -1
- package/dist/public/assets/{use-settings-route-hU5QNNlM.js → use-settings-route-C9scHnRY.js} +1 -1
- package/dist/public/assets/{use-skill-origin-CBguK4Xh.js → use-skill-origin-DKyS0Igh.js} +1 -1
- package/dist/public/assets/{use-skills-CI07Z3HF.js → use-skills-sMW0gn5i.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-0s8YIP0W.js → use-terminal-enabled-BsKs7ckE.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-GWD0dVVe.js → use-timeline-entry-diff-DpqygKQG.js} +4 -4
- package/dist/public/assets/{use-workspace-CfpIXxMZ.js → use-workspace-DFnkEIDS.js} +1 -1
- package/dist/public/index.html +53 -53
- package/dist/public/uninstall.html +4 -4
- package/dist/{registry-probes-CPpx09tY.mjs → registry-probes-QaKSE8L7.mjs} +2 -2
- package/dist/{removal-file-path-D-Qi401y.mjs → removal-file-path-ucl0tG3x.mjs} +1 -1
- package/dist/{repair-launch-json-B37vVBms.mjs → repair-launch-json-2skQfy9M.mjs} +1 -1
- package/dist/{repair-mcp-configs-Yyo5vgwH.mjs → repair-mcp-configs-BlbBPod2.mjs} +1 -1
- package/dist/schemas/v0/config.project-local.schema.json +41 -2
- package/dist/src-BHAV63UV.mjs +1 -0
- package/dist/{src-CHCuSO0V.mjs → src-BSRKGNp2.mjs} +4 -4
- package/dist/start-B1MHILpQ.mjs +1 -0
- package/dist/{start-BReu23Dy.mjs → start-CsbVSNv_.mjs} +3 -3
- package/package.json +5 -5
- package/dist/constants-D3Rooejd.mjs +0 -1
- package/dist/dist-asnPGf9w.mjs +0 -2096
- package/dist/init-BKL7C-UY.mjs +0 -1
- package/dist/loader-ByPipY8E.mjs +0 -1
- package/dist/preview-wHhBYqft.mjs +0 -1
- package/dist/public/assets/AddPropertiesButton-iyg-Wm6e.js +0 -2
- package/dist/public/assets/DocumentContext-COdAfUDp.js +0 -38
- package/dist/public/assets/FeedbackForm-DJbjViGF.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-BmkLvmEc.js +0 -1
- package/dist/public/assets/SettingsDialogBody-X76GBelU.js +0 -12
- package/dist/public/assets/i18n-BsHlNewq.js +0 -1
- package/dist/public/assets/messages-6uDL41Rd.js +0 -1
- package/dist/public/assets/messages-BnPhyIng.js +0 -1
- package/dist/public/assets/messages-BtJLchgT.js +0 -1
- package/dist/public/assets/messages-CQAwj1_q.js +0 -1
- package/dist/public/assets/messages-CR0YbKke.js +0 -1
- package/dist/public/assets/messages-CjU9JdHC.js +0 -1
- package/dist/public/assets/messages-ClA9pqnQ.js +0 -1
- package/dist/public/assets/messages-CwLPA7dh.js +0 -1
- package/dist/public/assets/messages-D6xU-RON.js +0 -1
- package/dist/public/assets/messages-DNmJqYc2.js +0 -1
- package/dist/public/assets/messages-hzOzvtfE.js +0 -1
- package/dist/public/assets/messages-ivhKqFT6.js +0 -1
- package/dist/public/assets/page-list-cache-DoLH1XoG.js +0 -1
- package/dist/public/assets/typing-burst-detector-Deq92qeN.js +0 -8
- package/dist/src-C4iUQI7F.mjs +0 -1
- package/dist/start-DNYUru4q.mjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Mn as e,Xi as t,fi as n}from"./dist-
|
|
1
|
+
import{Mn as e,Xi as t,fi as n}from"./dist-BAMccoiQ.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-82vnOD-h.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=n(i);for(r=t(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{Fn as e,In as t}from"./dist-
|
|
1
|
+
import{Fn as e,In as t}from"./dist-BAMccoiQ.js";var n={BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.69.1`}?.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,Nn as n,Pr as r,Vr as i,Yn as a,di as o,ii as s,qn as c,si as l}from"./DocumentContext-COdAfUDp.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-Cym3gapE.js";import{i as h,n as g,t as _}from"./tooltip-DttaCTqz.js";import{Bi as v,Bn as y,nr as b,tr as x,yr as S,zn as C}from"./dist-CGNkoXKB.js";import{n as w}from"./dist-CJhtNlOm2.js";import{t as T}from"./dist-Cr4-nBVI.js";import{i as E}from"./local-menu-action-bus-4I1Xm40D.js";import{t as D}from"./createLucideIcon-B6ULg5PN.js";import{St as O}from"./CodeMirrorPropInput-B_ciIFEl.js";import{t as ee}from"./x-CnGRb1ER.js";import{l as te}from"./doc-hash-CH3Kq7TA.js";var k=D(`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`}]]),A=f(),j=`var(--ok-comment-hue,37,99,235)`,ne=j,re={fill:.22,line:.7},ie={fill:.45,line:1},ae=.45;function oe(e,t){let n=ne,{fill:r,line:i}=t?ie:re;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 M(e){return e.map(e=>e.id??`·`).join(`|`)}function se(e){let t=null;for(let n of e)n.id!==null&&(t===null||n.to-n.from<t.to-t.from)&&(t=n);return t?.id??null}function N(e,t){return e.id===null||e.id===t}function ce(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=>N(e,t));i.push({from:a.from,to:a.to,style:oe(e??a.covering[0],e!==void 0),threadId:se(a.covering)}),a=null};for(let e=0;e<r.length-1;e++){let t=r[e],i=r[e+1],s=n.filter(e=>e.from<=t&&e.to>=i);if(s.length===0){o();continue}if(a!==null&&a.to===t&&M(a.covering)===M(s)){a.to=i;continue}o(),a={from:t,to:i,covering:s}}return o(),i}var P=`data-comment-reveal`;function F(e){return typeof CSS<`u`&&CSS.escape?CSS.escape(e):e}function I(e){return e===``?null:document.querySelector(`[data-testid="property-row"][data-key="${F(e)}"]`)}function le(e){let t=I(e);if(t===null)return null;let n=t.getBoundingClientRect();return n.height===0&&n.width===0?null:n}function ue(e){I(e)?.scrollIntoView({block:`center`,behavior:`smooth`})}function L(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="${F(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=R(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 R(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`,`rgba(${j},${ae})`),e.setAttribute(P,`true`);let t=()=>{e.removeAttribute(P),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 z(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=C(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 fe(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]:S(e,r,{syntaxIn:`needle`}).map(e=>e.end),o=i===``?[e.length]:S(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=v(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=fe(e.text,t).map(e=>({start:e,end:e+t.length}));if(r.length===0&&(r=S(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)||S(e.text,t,{syntaxIn:`needle`}).length>0;if(i!==``&&a!==``&&!o(i+t+a)&&o(i+a))return null;let s=x({prefix:i,suffix:a},{syntaxInContext:!0}),c=t=>s===0||b(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=b(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 pe(e,t,n){return{prefix:y(e,Math.max(0,t-U),t),suffix:y(e,n,Math.min(e.content.size,n+U))}}function W(e,t,n){return G(e)(t,n)}function G(e){let t=z(e),n=null;return(r,i)=>{let a=H(t,r,i);return a===null?(n??=z(e,{includeBlockComponents:!0}),H(n,r,i)):a}}var me=220,he=24;function ge(e){let t=e.viewTop+e.insetTop,n=e.viewBottom-me;return e.anchorTop>=t&&e.anchorBottom<=n?0:e.anchorTop-(t+he)}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=O(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=ge({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 _e=1e4,ve=80,ye=1500,Y=[`wheel`,`touchstart`,`mousedown`,`keydown`];function be(e){let n=!1,i=null,s=null,l=-1,u=()=>{let a=c(e.docName);if(!a||a.isDestroyed)return!1;if(n||(n=!0,r(e.threadId)),e.quote===``)return i===null&&(i=Date.now(),t(e.threadId)),!0;let o=a.state.doc.content.size;return(s===null||o!==l)&&(s=W(a.state.doc,e.quote,e.context),l=o),!s||!J(a,s,e.docName,{instant:!0})?!1:(i===null&&(i=Date.now(),t(e.threadId)),!0)};o(`comments`),u(),c(e.docName)===null&&window.location.assign(te(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()&&i!==null&&Date.now()-i>=ye&&f()},h=a(m),g=window.setInterval(m,ve),_=window.setTimeout(()=>{i===null&&w.error(n?T._({id:`KeXgA-`}):T._({id:`JDQ5I5`})),f()},_e);for(let e of Y)window.addEventListener(e,p,!0);m()}var X=e();function xe(){return s().length}function Se(){let e=(0,A.c)(4),t=s(),n;if(e[0]!==t){n=new Map;for(let e of t){let t=i(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(Ce),e[2]=n,e[3]=r),r}function Ce(e){let[t,n]=e;return{docName:t,count:n}}function we(e){let t=(0,A.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}=d();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=p(`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)(E,{className:`size-3`}),i=(0,X.jsx)(u,{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)(m,{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 f;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(f=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[10]=f):f=t[10];let v;t[11]===l?v=t[12]:(v=l({id:`2zvUIK`}),t[11]=l,t[12]=v);let y;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,X.jsx)(k,{className:`size-3`}),t[13]=y):y=t[13];let b;t[14]!==n||t[15]!==c.length?(b=c.length>1?(0,X.jsx)(u,{id:`5TmrYN`,values:{0:c.length,count:n}}):(0,X.jsx)(u,{id:`eiUA4k`,values:{count:n}}),t[14]=n,t[15]=c.length,t[16]=b):b=t[16];let x;t[17]!==v||t[18]!==b?(x=(0,X.jsx)(h,{asChild:!0,children:(0,X.jsxs)(m,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":v,onClick:Ee,"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:[y,b]})}),t[17]=v,t[18]=b,t[19]=x):x=t[19];let S;t[20]===c?S=t[21]:(S=(0,X.jsx)(g,{className:`max-w-64`,children:c.length>1?(0,X.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:c.map(Te)}):(0,X.jsx)(u,{id:`2zvUIK`})}),t[20]=c,t[21]=S);let C;t[22]!==x||t[23]!==S?(C=(0,X.jsxs)(_,{children:[x,S]}),t[22]=x,t[23]=S,t[24]=C):C=t[24];let w;t[25]===l?w=t[26]:(w=l({id:`pFRz_E`}),t[25]=l,t[26]=w);let T;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,X.jsx)(ee,{className:`size-3`}),t[27]=T):T=t[27];let D;t[28]!==o||t[29]!==w?(D=(0,X.jsx)(m,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":w,onClick:o,className:`size-4 p-0 text-muted-foreground hover:text-foreground`,children:T}),t[28]=o,t[29]=w,t[30]=D):D=t[30];let O;return t[31]!==D||t[32]!==C?(O=(0,X.jsxs)(`span`,{"data-testid":`composer-context-chip-comments`,className:f,children:[C,D]}),t[31]=D,t[32]=C,t[33]=O):O=t[33],O}function Te(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 Ee(){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 De(e){be({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=()=>{L({key:t.key,path:t.path,quote:n.quote,start:n.start,end:n.end})||(r+=1,!(r>=Oe)&&requestAnimationFrame(i))};requestAnimationFrame(i)}var Oe=30;function ke(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 Ae(e){let t=e.replace(/\s+/g,` `).trimStart();return t.length>$?`…${t.slice(-$)}`:t}function je(e){let t=e.replace(/\s+/g,` `).trimEnd();return t.length>$?`${t.slice(0,$)}…`:t}function Me(e){if(!e.repeats)return null;let t=Ae(e.prefix),n=je(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 Ne(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,Nn as n,Pr as r,Vr as i,Yn as a,di as o,ii as s,qn as c,si as l}from"./DocumentContext-CCqrdOs8.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-Cym3gapE.js";import{i as h,n as g,t as _}from"./tooltip-DttaCTqz.js";import{Bi as v,Bn as y,nr as b,tr as x,yr as S,zn as C}from"./dist-BAMccoiQ.js";import{n as w}from"./dist-CJhtNlOm2.js";import{t as T}from"./dist-Cr4-nBVI.js";import{i as E}from"./local-menu-action-bus-4I1Xm40D.js";import{t as D}from"./createLucideIcon-B6ULg5PN.js";import{St as O}from"./CodeMirrorPropInput-CUQWZHWI.js";import{t as ee}from"./x-CnGRb1ER.js";import{l as te}from"./doc-hash-BosQg4sh.js";var k=D(`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`}]]),A=f(),j=`var(--ok-comment-hue,37,99,235)`,ne=j,re={fill:.22,line:.7},ie={fill:.45,line:1},ae=.45;function oe(e,t){let n=ne,{fill:r,line:i}=t?ie:re;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 M(e){return e.map(e=>e.id??`·`).join(`|`)}function se(e){let t=null;for(let n of e)n.id!==null&&(t===null||n.to-n.from<t.to-t.from)&&(t=n);return t?.id??null}function N(e,t){return e.id===null||e.id===t}function ce(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=>N(e,t));i.push({from:a.from,to:a.to,style:oe(e??a.covering[0],e!==void 0),threadId:se(a.covering)}),a=null};for(let e=0;e<r.length-1;e++){let t=r[e],i=r[e+1],s=n.filter(e=>e.from<=t&&e.to>=i);if(s.length===0){o();continue}if(a!==null&&a.to===t&&M(a.covering)===M(s)){a.to=i;continue}o(),a={from:t,to:i,covering:s}}return o(),i}var P=`data-comment-reveal`;function F(e){return typeof CSS<`u`&&CSS.escape?CSS.escape(e):e}function I(e){return e===``?null:document.querySelector(`[data-testid="property-row"][data-key="${F(e)}"]`)}function le(e){let t=I(e);if(t===null)return null;let n=t.getBoundingClientRect();return n.height===0&&n.width===0?null:n}function ue(e){I(e)?.scrollIntoView({block:`center`,behavior:`smooth`})}function L(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="${F(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=R(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 R(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`,`rgba(${j},${ae})`),e.setAttribute(P,`true`);let t=()=>{e.removeAttribute(P),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 z(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=C(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 fe(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]:S(e,r,{syntaxIn:`needle`}).map(e=>e.end),o=i===``?[e.length]:S(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=v(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=fe(e.text,t).map(e=>({start:e,end:e+t.length}));if(r.length===0&&(r=S(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)||S(e.text,t,{syntaxIn:`needle`}).length>0;if(i!==``&&a!==``&&!o(i+t+a)&&o(i+a))return null;let s=x({prefix:i,suffix:a},{syntaxInContext:!0}),c=t=>s===0||b(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=b(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 pe(e,t,n){return{prefix:y(e,Math.max(0,t-U),t),suffix:y(e,n,Math.min(e.content.size,n+U))}}function W(e,t,n){return G(e)(t,n)}function G(e){let t=z(e),n=null;return(r,i)=>{let a=H(t,r,i);return a===null?(n??=z(e,{includeBlockComponents:!0}),H(n,r,i)):a}}var me=220,he=24;function ge(e){let t=e.viewTop+e.insetTop,n=e.viewBottom-me;return e.anchorTop>=t&&e.anchorBottom<=n?0:e.anchorTop-(t+he)}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=O(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=ge({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 _e=1e4,ve=80,ye=1500,Y=[`wheel`,`touchstart`,`mousedown`,`keydown`];function be(e){let n=!1,i=null,s=null,l=-1,u=()=>{let a=c(e.docName);if(!a||a.isDestroyed)return!1;if(n||(n=!0,r(e.threadId)),e.quote===``)return i===null&&(i=Date.now(),t(e.threadId)),!0;let o=a.state.doc.content.size;return(s===null||o!==l)&&(s=W(a.state.doc,e.quote,e.context),l=o),!s||!J(a,s,e.docName,{instant:!0})?!1:(i===null&&(i=Date.now(),t(e.threadId)),!0)};o(`comments`),u(),c(e.docName)===null&&window.location.assign(te(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()&&i!==null&&Date.now()-i>=ye&&f()},h=a(m),g=window.setInterval(m,ve),_=window.setTimeout(()=>{i===null&&w.error(n?T._({id:`KeXgA-`}):T._({id:`JDQ5I5`})),f()},_e);for(let e of Y)window.addEventListener(e,p,!0);m()}var X=e();function xe(){return s().length}function Se(){let e=(0,A.c)(4),t=s(),n;if(e[0]!==t){n=new Map;for(let e of t){let t=i(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(Ce),e[2]=n,e[3]=r),r}function Ce(e){let[t,n]=e;return{docName:t,count:n}}function we(e){let t=(0,A.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}=d();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=p(`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)(E,{className:`size-3`}),i=(0,X.jsx)(u,{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)(m,{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 f;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(f=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[10]=f):f=t[10];let v;t[11]===l?v=t[12]:(v=l({id:`2zvUIK`}),t[11]=l,t[12]=v);let y;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,X.jsx)(k,{className:`size-3`}),t[13]=y):y=t[13];let b;t[14]!==n||t[15]!==c.length?(b=c.length>1?(0,X.jsx)(u,{id:`5TmrYN`,values:{0:c.length,count:n}}):(0,X.jsx)(u,{id:`eiUA4k`,values:{count:n}}),t[14]=n,t[15]=c.length,t[16]=b):b=t[16];let x;t[17]!==v||t[18]!==b?(x=(0,X.jsx)(h,{asChild:!0,children:(0,X.jsxs)(m,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":v,onClick:Ee,"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:[y,b]})}),t[17]=v,t[18]=b,t[19]=x):x=t[19];let S;t[20]===c?S=t[21]:(S=(0,X.jsx)(g,{className:`max-w-64`,children:c.length>1?(0,X.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:c.map(Te)}):(0,X.jsx)(u,{id:`2zvUIK`})}),t[20]=c,t[21]=S);let C;t[22]!==x||t[23]!==S?(C=(0,X.jsxs)(_,{children:[x,S]}),t[22]=x,t[23]=S,t[24]=C):C=t[24];let w;t[25]===l?w=t[26]:(w=l({id:`pFRz_E`}),t[25]=l,t[26]=w);let T;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,X.jsx)(ee,{className:`size-3`}),t[27]=T):T=t[27];let D;t[28]!==o||t[29]!==w?(D=(0,X.jsx)(m,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":w,onClick:o,className:`size-4 p-0 text-muted-foreground hover:text-foreground`,children:T}),t[28]=o,t[29]=w,t[30]=D):D=t[30];let O;return t[31]!==D||t[32]!==C?(O=(0,X.jsxs)(`span`,{"data-testid":`composer-context-chip-comments`,className:f,children:[C,D]}),t[31]=D,t[32]=C,t[33]=O):O=t[33],O}function Te(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 Ee(){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 De(e){be({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=()=>{L({key:t.key,path:t.path,quote:n.quote,start:n.start,end:n.end})||(r+=1,!(r>=Oe)&&requestAnimationFrame(i))};requestAnimationFrame(i)}var Oe=30;function ke(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 Ae(e){let t=e.replace(/\s+/g,` `).trimStart();return t.length>$?`…${t.slice(-$)}`:t}function je(e){let t=e.replace(/\s+/g,` `).trimEnd();return t.length>$?`${t.slice(0,$)}…`:t}function Me(e){if(!e.repeats)return null;let t=Ae(e.prefix),n=je(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 Ne(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=Me(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(`
|