@inkeep/open-knowledge 0.65.0-beta.0 → 0.65.0-beta.10
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/{acp-harness-probe-D8GNCLKI.mjs → acp-harness-probe-0kysXPS3.mjs} +2 -2
- package/dist/assets/skills/packs/okf/SKILL.md +2 -1
- package/dist/assets/skills/project/references/components-and-visuals.md +1 -1
- package/dist/cli.mjs +16 -16
- package/dist/config-schema.json +9 -1
- package/dist/config.project-local.schema.json +9 -1
- package/dist/constants-DedAFfaQ.mjs +2 -0
- package/dist/fs-traced-ByTZUu6k.mjs +1 -0
- package/dist/{fs-traced-C5oeVBiQ.mjs → fs-traced-C5AXyho0.mjs} +2 -2
- package/dist/git-handle-CeiR-ZT6.mjs +1 -0
- package/dist/{git-handle-UnQwrdlT.mjs → git-handle-tSoVdwPX.mjs} +2 -2
- package/dist/index.d.mts +40 -1
- package/dist/index.mjs +167 -164
- package/dist/init-BChmDJQ4.mjs +1 -0
- package/dist/{init-eBP6ynxi.mjs → init-CJFMf0Pt.mjs} +3 -3
- package/dist/{launch-json-removal-BFpdcojK.mjs → launch-json-removal-D9Kpu384.mjs} +2 -2
- package/dist/loader-CgTokkEd.mjs +1 -0
- package/dist/{loader-CRRZ4eTQ.mjs → loader-t89TDKH-.mjs} +2 -2
- package/dist/md-manager-BI4O3a2W.mjs +2 -0
- package/dist/{open-browser-mXaE0V-v.mjs → open-browser-Dwh3SYxd.mjs} +2 -2
- package/dist/parse-worker.mjs +1 -1
- package/dist/{preview-cPC1BHPG.mjs → preview-CVVCkcP3.mjs} +2 -2
- package/dist/preview-Jo70n6y1.mjs +1 -0
- package/dist/public/assets/ActivityModeContent-DHLRkmUf.js +1 -0
- package/dist/public/assets/{AddPropertiesButton-CDqx5oOU.js → AddPropertiesButton-CJf3djMt.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-DySEAYNs.js → AgentDiffPane-CL3qqW5L.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-XXRp8VNW.js → AgentThreadClientBinder-Cnk8titC.js} +1 -1
- package/dist/public/assets/{BugReportHistory-BzqzlDvE.js → BugReportHistory-CVREyd4K.js} +1 -1
- package/dist/public/assets/{BugReportHistoryDialog--Su04gP8.js → BugReportHistoryDialog-BK5ks1Al.js} +1 -1
- package/dist/public/assets/CodeMirrorPropInput-BM7OpNpf.js +3 -0
- package/dist/public/assets/{ConsentDialogBody-DWgT7k5c.js → ConsentDialogBody-BQ_fKUiO.js} +1 -1
- package/dist/public/assets/{DocumentContext-BId0aBaa.js → DocumentContext-D4-sdlnA.js} +9 -9
- package/dist/public/assets/{EditorModeToggle-D7GXfSQE.js → EditorModeToggle-D00jPWtj.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-CVKmC5yw.js → EnableSyncConfirmDialog-Dxi4MbUU.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-mxb0y2TR.js → ExcalidrawDocEditor-BFJVzGmK.js} +1 -1
- package/dist/public/assets/FeedbackForm-9dHSfS4a.js +1 -0
- package/dist/public/assets/{GraphPanel-DlmLJpXS.js → GraphPanel-DGW3J-Ha.js} +2 -2
- package/dist/public/assets/{ImportSkillDialog-WPJMdoUX.js → ImportSkillDialog-D-xDH6nL.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-CREx0S2c.js → LintConfigEditor-CA6cGIYg.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-B5dlxFFd.js +1 -0
- package/dist/public/assets/ManagedArtifactProperties-C-BMogEh.js +1 -0
- package/dist/public/assets/{MermaidDocEditor-BeIZEdGa.js → MermaidDocEditor-B9X4OOzm.js} +1 -1
- package/dist/public/assets/PropertyDisplayRow-1okRxEyy.js +2 -0
- package/dist/public/assets/{ReportBugDialogBody-uz1wEEaL.js → ReportBugDialogBody-BSRU1H9A.js} +1 -1
- package/dist/public/assets/{ReportBugMenuTrigger-CciQFblr.js → ReportBugMenuTrigger-DcH2LZLT.js} +2 -2
- package/dist/public/assets/{SchemaConfigEditor-sXi89wgY.js → SchemaConfigEditor-De_1t-Fp.js} +1 -1
- package/dist/public/assets/SessionsHost--dTOCWsD.js +2 -0
- package/dist/public/assets/{SettingsDialogBody-BeSclbmh.js → SettingsDialogBody-DZPZfEx4.js} +4 -4
- package/dist/public/assets/{ShareBranchSwitchDialog-BuKFUw0e.js → ShareBranchSwitchDialog-BOB7Gs1O.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-ILk9qSQi.js → ShareReceiveDialog-C6O1U-80.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-DSPm1Ymd.js → ShareReceiveMissDialog-DbAUwOz_.js} +1 -1
- package/dist/public/assets/{SkillCostValue-Dnq-P4nV.js → SkillCostValue-CULUHX1h.js} +1 -1
- package/dist/public/assets/{SkillEditBanner-Bi5UjV5F.js → SkillEditBanner-Ci2waYek.js} +1 -1
- package/dist/public/assets/SkillInstallMenu-CcQ4rXjm.js +2 -0
- package/dist/public/assets/{SkillOriginInline-CxtxMYgG.js → SkillOriginInline-C6zCsZpu.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-BonUlpuf.js → SkillToolbarControls-BWRfAnRt.js} +1 -1
- package/dist/public/assets/{SlidesToolbarControls-BFw5X_I9.js → SlidesToolbarControls-DjnFahGv.js} +1 -1
- package/dist/public/assets/SourceEditor-DddbKAmO.js +1 -0
- package/dist/public/assets/TerminalPanel-CK5xSGJs.js +146 -0
- package/dist/public/assets/{TerminalWindowApp-Bg0ksRvd.js → TerminalWindowApp-DjNC3U-x.js} +1 -1
- package/dist/public/assets/{TextDocEditor-oysjAuPF.js → TextDocEditor-gh6CMivc.js} +1 -1
- package/dist/public/assets/{ThreadView-B6FpcgQA.js → ThreadView-Be84yxwe.js} +9 -9
- package/dist/public/assets/{TimelineDiffPane-CQtzCGhI.js → TimelineDiffPane-C0l2Bf5B.js} +1 -1
- package/dist/public/assets/{agent-diff-store-7YPKABFM.js → agent-diff-store-BYJQ8UAU.js} +1 -1
- package/dist/public/assets/auth-state-cache-BI-V32hk.js +11 -0
- package/dist/public/assets/{bug-report-send-manager-idwD-g0s.js → bug-report-send-manager-B5OBrvsh.js} +1 -1
- package/dist/public/assets/client-version-DP_DFbkp.js +1 -0
- package/dist/public/assets/{comment-chips-Dd3uvf5B.js → comment-chips-2fhX9RKd.js} +1 -1
- package/dist/public/assets/config-provider-CH25hiPj.js +5 -0
- package/dist/public/assets/{dist-C_QZEaeX.js → dist-CNUsB2q0.js} +122 -119
- package/dist/public/assets/doc-paths-BShtZt2N.js +1 -0
- package/dist/public/assets/{documents-events-CwqQxQT5.js → documents-events-B4_gdzXM.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-Blu63jOX.js → file-tree-adapter-DxRpIDJ8.js} +1 -1
- package/dist/public/assets/{file-tree-utils-CJ625FXw.js → file-tree-utils-BU-0tVMx.js} +1 -1
- package/dist/public/assets/{folder-config-api-Dxuhqlqr.js → folder-config-api-BjfmZE1E.js} +1 -1
- package/dist/public/assets/globals-BaOeic4_.css +1 -0
- package/dist/public/assets/i18n-30_sL_u7.js +1 -0
- package/dist/public/assets/{index-xtNevPWi.js → index-C0zLyhIb.js} +120 -120
- package/dist/public/assets/{launcher-selection-h6hBbSeu.js → launcher-selection-tWPyNXck.js} +1 -1
- package/dist/public/assets/{lint-config-client-CHoPvgQx.js → lint-config-client-DJ92O3EE.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-B15oIG0p.js → markdownlint-rule-browser-ClR8537V.js} +1 -1
- package/dist/public/assets/messages-B1y9my2y.js +1 -0
- package/dist/public/assets/messages-BLPbK3hY.js +1 -0
- package/dist/public/assets/messages-BXcet8bS.js +1 -0
- package/dist/public/assets/messages-BwTBQu-G.js +1 -0
- package/dist/public/assets/messages-CkfMXdXE.js +1 -0
- package/dist/public/assets/messages-CuLYOX5w.js +1 -0
- package/dist/public/assets/messages-Dea4EQjg.js +1 -0
- package/dist/public/assets/messages-IxOupfHQ.js +1 -0
- package/dist/public/assets/messages-Pn_9kcf-.js +1 -0
- package/dist/public/assets/messages-S6T9NAt6.js +1 -0
- package/dist/public/assets/messages-TF1JDcwi.js +1 -0
- package/dist/public/assets/messages-rf4KfpqB.js +1 -0
- package/dist/public/assets/page-list-cache-CdV30Rpz.js +1 -0
- package/dist/public/assets/{pending-receive-nav-store-DSQDb6m_.js → pending-receive-nav-store-BnfTQ1tD.js} +1 -1
- package/dist/public/assets/progress-w86CmZY7.js +9 -0
- package/dist/public/assets/{project-paths-Da-3VtPS.js → project-paths-CuywV7Pt.js} +1 -1
- package/dist/public/assets/prop-types-CeSzd9V3.js +1 -0
- package/dist/public/assets/{receive-store-CZytnhfP.js → receive-store-CXAmTr2-.js} +1 -1
- package/dist/public/assets/{selection-context-DcqZ3oLY.js → selection-context-DyXHLVzS.js} +1 -1
- package/dist/public/assets/{skill-scope-BOgGK9dw.js → skill-scope-C7vDwjos.js} +1 -1
- package/dist/public/assets/{skills-api-Cpxu_weC.js → skills-api-DwfG7_Ox.js} +1 -1
- package/dist/public/assets/{src-o99n4-mI.js → src-diXOV2W6.js} +1 -1
- package/dist/public/assets/{startup-marks-CwgakJzA.js → startup-marks-CxS3ch-T.js} +1 -1
- package/dist/public/assets/{tag-pill-input-Czha5J4D.js → tag-pill-input-CesVkRpl.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-C2Nfap4j.js → target-navigation-intent-DEVrbZZv.js} +1 -1
- package/dist/public/assets/{telemetry-startup-Cr2hA85U.js → telemetry-startup-DvSZlbqT.js} +1 -1
- package/dist/public/assets/{terminal-cli-display-Dt4cbzju.js → terminal-cli-display-D5Yx8BYY.js} +1 -1
- package/dist/public/assets/terminal-command-events-CL99X6I2.js +1 -0
- package/dist/public/assets/typing-burst-detector-CV8eJchU.js +8 -0
- package/dist/public/assets/{uninstall-0vFtGMK2.js → uninstall-C2pTf0Bn.js} +1 -1
- package/dist/public/assets/{use-activity-panel-DgMjR_uo.js → use-activity-panel-CwFDPRy2.js} +1 -1
- package/dist/public/assets/{use-apply-config-color-theme-pxpDfOq4.js → use-apply-config-color-theme-Huz8DxMv.js} +1 -1
- package/dist/public/assets/{use-collab-url-CrPRD0Do.js → use-collab-url-BPWe4f76.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme-vRNyzDLo.js → use-live-xterm-theme-BK6xLi85.js} +1 -1
- package/dist/public/assets/{use-open-skill-DDH7y31F.js → use-open-skill-CZ1fVBS0.js} +1 -1
- package/dist/public/assets/{use-settings-route-6Aa41RPQ.js → use-settings-route-CUsaVNEW.js} +1 -1
- package/dist/public/assets/{use-skill-origin-CCXLtFlz.js → use-skill-origin-DMFgaCuR.js} +1 -1
- package/dist/public/assets/{use-skills-L0px0Zhw.js → use-skills-DIoMs6BD.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-UleqVo0K.js → use-terminal-enabled-CNvrm-_x.js} +1 -1
- package/dist/public/assets/use-timeline-entry-diff-BN0p_LxP.js +6 -0
- package/dist/public/assets/{use-workspace-7B06onC_.js → use-workspace-BLzLEi-_.js} +1 -1
- package/dist/public/index.html +51 -51
- package/dist/public/uninstall.html +6 -6
- package/dist/{repair-launch-json-CkxVvou7.mjs → repair-launch-json-DlGRZVwx.mjs} +2 -2
- package/dist/{repair-mcp-configs-DjVdyrm2.mjs → repair-mcp-configs-Ct8lk44M.mjs} +2 -2
- package/dist/{repair-skills-Dbdo1dep.mjs → repair-skills-BCpTKERH.mjs} +2 -2
- package/dist/repair-skills-CvFeICKK.mjs +1 -0
- package/dist/{resolve-project-root-BgZ293gs.mjs → resolve-project-root-DEipdv30.mjs} +5 -5
- package/dist/schemas/v0/config.project-local.schema.json +9 -1
- package/dist/server-lock-BtkTgyPE.mjs +1 -0
- package/dist/{server-lock-CcnGITIh.mjs → server-lock-CFtoCcIl.mjs} +2 -2
- package/dist/{skill-teardown-BQcurw-H.mjs → skill-teardown-CNyUhPcN.mjs} +2 -2
- package/dist/{sleep-DyLEGHvt.mjs → sleep-BZCw-NJO.mjs} +2 -2
- package/dist/src-BVV6pMrY.mjs +2041 -0
- package/dist/src-CRBq5Usz.mjs +1 -0
- package/dist/{src-DB7C0CZe.mjs → src-CaoQ9J7M.mjs} +1 -1
- package/dist/{src-CaLoSvK5.mjs → src-DYG0hctS.mjs} +130 -127
- package/dist/{src-BQg24g5w.mjs → src-l2oabBVG.mjs} +4 -4
- package/dist/start-CqK6A0Ss.mjs +1 -0
- package/dist/{start-Cx3sd9S_.mjs → start-ice1TOrd.mjs} +3 -3
- package/package.json +4 -4
- package/dist/constants-DzLzqZ-e.mjs +0 -2
- package/dist/fs-traced-DiZ_Z58g.mjs +0 -1
- package/dist/git-handle-Bh1alj7a.mjs +0 -1
- package/dist/init-BX_9NOtu.mjs +0 -1
- package/dist/loader-BO6n9crj.mjs +0 -1
- package/dist/md-manager-BJ88tow5.mjs +0 -2
- package/dist/preview-DyOUTvCV.mjs +0 -1
- package/dist/public/assets/ActivityModeContent-BfSvNw28.js +0 -1
- package/dist/public/assets/CodeMirrorPropInput-DtX4bjvR.js +0 -3
- package/dist/public/assets/FeedbackForm-RpZ8ZAA4.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-3wX-4L9A.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-CEBc2qva.js +0 -1
- package/dist/public/assets/PropertyDisplayRow-DDOV4-Ci.js +0 -2
- package/dist/public/assets/SessionsHost-DUYXhSk4.js +0 -2
- package/dist/public/assets/SkillInstallMenu-DiCGjWcJ.js +0 -2
- package/dist/public/assets/SourceEditor-BzonD5kQ.js +0 -1
- package/dist/public/assets/TerminalPanel-Dqg_--C1.js +0 -146
- package/dist/public/assets/auth-state-cache-CrQ_9ffi.js +0 -11
- package/dist/public/assets/client-version-BH4Ct1dv.js +0 -1
- package/dist/public/assets/config-provider-C6FHgLZX.js +0 -5
- package/dist/public/assets/doc-paths-CzO1mA3r.js +0 -1
- package/dist/public/assets/globals-D1lEgZg7.css +0 -1
- package/dist/public/assets/i18n-Bn0IL-Jk.js +0 -1
- package/dist/public/assets/messages-20ZT_n81.js +0 -1
- package/dist/public/assets/messages-B2X-60YW.js +0 -1
- package/dist/public/assets/messages-B9Qrr14Q.js +0 -1
- package/dist/public/assets/messages-BUgRBtWn.js +0 -1
- package/dist/public/assets/messages-B_l2z4-1.js +0 -1
- package/dist/public/assets/messages-Bu7B_SFk.js +0 -1
- package/dist/public/assets/messages-CFu0nt3l.js +0 -1
- package/dist/public/assets/messages-CLBJUWjQ.js +0 -1
- package/dist/public/assets/messages-DagesR8a.js +0 -1
- package/dist/public/assets/messages-Dl-AHyyi.js +0 -1
- package/dist/public/assets/messages-mvZekN3y.js +0 -1
- package/dist/public/assets/messages-zTkemwXI.js +0 -1
- package/dist/public/assets/page-list-cache-CI-xFldj.js +0 -1
- package/dist/public/assets/progress-Cbjh5yOY.js +0 -9
- package/dist/public/assets/prop-types-DTEkSQcM.js +0 -1
- package/dist/public/assets/terminal-command-events-D0gJ8NJs.js +0 -1
- package/dist/public/assets/typing-burst-detector-BfXA1WDv.js +0 -8
- package/dist/public/assets/use-timeline-entry-diff-CZDwTk89.js +0 -6
- package/dist/repair-skills-CBdnIHQ1.mjs +0 -1
- package/dist/server-lock-D8d0WVYU.mjs +0 -1
- package/dist/src-C28fg0N6.mjs +0 -1
- package/dist/src-DGS-lA-C.mjs +0 -2041
- package/dist/start-Bzg4UT8v.mjs +0 -1
- /package/dist/public/assets/{globals-CVUc-u8t.js → globals-Bezfr5us.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ActivityPanelDiffView-CgaFZtD7.js","./chunk-CYidjpOJ.js","./dist-Nvb76hAm.js","./jsx-runtime-BUgB2tll.js","./react-f2sANaYj.js","./compiler-runtime-BfE3aGVn.js","./ActivityPanelDiffView-legcy4jI.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as ee}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as te}from"./overlay-layers-Bj-TVfKw.js";import{t as o}from"./button-Cym3gapE.js";import{i as ne,n as re,t as ie}from"./tooltip-DttaCTqz.js";import{a as ae,c as oe,i as se,o as ce,s as le,t as ue}from"./dialog-CTNat3T_.js";import{l as de}from"./select-XEGYznMI.js";import{n as fe,t as pe}from"./toggle-group-C2_37kV5.js";import{wt as me}from"./dist-C_QZEaeX.js";import{n as he}from"./dist-CJhtNlOm2.js";import{t as ge}from"./chevron-down-DNO3PgI_.js";import{t as _e}from"./spinner-t7GahFcQ.js";import{n as ve,t as ye}from"./panel-right-open-2VYfauQI.js";import{t as be}from"./undo-2-XcI_wHcs.js";import{t as xe}from"./x-DbShSCr5.js";import{t as Se}from"./timeline-diff-store-ym5Oz1UF.js";import{t as s}from"./lru-string-cache-Cc7rikda.js";import{a as Ce,c as we,i as Te,l as Ee,n as De,o as Oe,r as ke,s as Ae,u as je}from"./use-timeline-entry-diff-CZDwTk89.js";var Me=a(),c=e(r(),1),l=n(),Ne=(0,c.lazy)(async()=>({default:(await t(()=>import(`./ActivityPanelDiffView-CgaFZtD7.js`),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)).ActivityPanelDiffView}));function u(e){let t=(0,Me.c)(161),{view:n,isPanelCollapsed:r,onTogglePanel:a}=e,{_:s}=ee(),{docName:u,sha:Ie,parentSha:Le,laterEdits:d,authorName:Re,relativeTime:ze}=n,[Be]=(0,c.useState)(Fe),[f,Ve]=(0,c.useState)(`rendered`),[p,He]=(0,c.useState)(!1),[m,Ue]=(0,c.useState)(!1),We=(0,c.useRef)(null),Ge=(0,c.useRef)(null),[Ke,qe]=(0,c.useState)(0),[Je,Ye]=(0,c.useState)(!0),h=De(Ie,u,Be,`vs-parent`,Le),g,_,v,y,Xe,b;t[0]!==f||t[1]!==h.after||t[2]!==h.before||t[3]!==h.diff||t[4]!==h.properties||t[5]!==h.status?(y=h.status===`ready`?Ae(h.before,h.after):null,b=f===`rendered`&&y?.ok===!0,_=h.status===`ready`?h.properties:null,v=_?.changes.length??0,g=_!==null&&(_.changes.length>0||_.unparseable!==null),Xe=h.status===`ready`?b&&y?.ok?Ee(y):Ce(h.diff):0,t[0]=f,t[1]=h.after,t[2]=h.before,t[3]=h.diff,t[4]=h.properties,t[5]=h.status,t[6]=g,t[7]=_,t[8]=v,t[9]=y,t[10]=Xe,t[11]=b):(g=t[6],_=t[7],v=t[8],y=t[9],Xe=t[10],b=t[11]);let Ze=Xe+(_===null?0:_.unparseable===null?Je?Math.min(v,50):0:1),Qe;t[12]===b?Qe=t[13]:(Qe=function(e){let t=Ge.current;if(!t)return;let n=[...t.querySelectorAll(ke),...b?Array.from(t.querySelectorAll(we)):Te(t)];if(n.length===0)return;let r=(e+n.length)%n.length;qe(r),n[r]?.scrollIntoView({block:`center`,behavior:`smooth`})},t[12]=b,t[13]=Qe);let $e=Qe,et,tt;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(et=()=>()=>We.current?.abort(),tt=[],t[14]=et,t[15]=tt):(et=t[14],tt=t[15]),(0,c.useEffect)(et,tt);let nt=h.status===`ready`?`${f}:${h.diff}`:``,rt,it;t[16]===nt?(rt=t[17],it=t[18]):(rt=()=>{let e=Ge.current;if(nt===``||!e)return;qe(0);let t=!1,n=null,r,i,ee=()=>{if(t)return;let r=e.querySelector(`[data-property-change]`)??e.querySelector(`.ok-diff-ins, .ok-diff-ins-block, [data-diff-deleted]`)??Te(e)[0];if(!r)return;t=!0,n?.disconnect();let i=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;r.scrollIntoView({block:`center`,behavior:i?`auto`:`smooth`})},a=()=>{t||(r!==void 0&&clearTimeout(r),r=setTimeout(()=>{i!==void 0&&cancelAnimationFrame(i),i=requestAnimationFrame(()=>{i=requestAnimationFrame(ee)})},120))};n=new MutationObserver(a),n.observe(e,{childList:!0,subtree:!0}),a();let te=setTimeout(()=>n?.disconnect(),5e3);return()=>{n?.disconnect(),r!==void 0&&clearTimeout(r),i!==void 0&&cancelAnimationFrame(i),clearTimeout(te)}},it=[nt],t[16]=nt,t[17]=rt,t[18]=it),(0,c.useEffect)(rt,it);let at,ot;t[19]===p?(at=t[20],ot=t[21]):(at=()=>{let e=e=>{e.key===`Escape`&&(p||te()||Se())};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},ot=[p],t[19]=p,t[20]=at,t[21]=ot),(0,c.useEffect)(at,ot);let st;t[22]!==s||t[23]!==u||t[24]!==Ie?(st=async function(){Ue(!0);let e=new AbortController;We.current=e;let t=function(){e.signal.aborted||Ue(!1),We.current===e&&(We.current=null)},n;try{n=await fetch(`/api/rollback`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({docName:u,commitSha:Ie}),signal:e.signal})}catch(n){let r=n;!e.signal.aborted&&!(r instanceof DOMException&&r.name===`AbortError`)&&he.error(s({id:`NkXEFS`}),{duration:4e3}),t();return}if(e.signal.aborted){t();return}if(n.ok){t(),He(!1),Se();return}let r=`HTTP ${n.status}`;try{let e=me.safeParse(await n.json());e.success&&(r=e.data.title)}catch{}he.error(s({id:`uM6jnS`}),{description:r,duration:6e3}),t()},t[22]=s,t[23]=u,t[24]=Ie,t[25]=st):st=t[25];let x=st,ct=h.status===`ready`&&(h.additions>0||h.deletions>0),S;t[26]===s?S=t[27]:(S=s({id:`b18t0_`}),t[26]=s,t[27]=S);let lt;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(lt=(0,l.jsx)(xe,{className:`size-4`}),t[28]=lt):lt=t[28];let C;t[29]===S?C=t[30]:(C=(0,l.jsx)(ne,{asChild:!0,children:(0,l.jsx)(o,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"data-testid":`timeline-diff-close`,"aria-label":S,onClick:Pe,children:lt})}),t[29]=S,t[30]=C);let w;t[31]===s?w=t[32]:(w=s({id:`b18t0_`}),t[31]=s,t[32]=w);let T;t[33]===w?T=t[34]:(T=(0,l.jsx)(re,{side:`bottom`,children:w}),t[33]=w,t[34]=T);let E;t[35]!==C||t[36]!==T?(E=(0,l.jsxs)(ie,{children:[C,T]}),t[35]=C,t[36]=T,t[37]=E):E=t[37];let D;t[38]===u?D=t[39]:(D=(0,l.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,children:u}),t[38]=u,t[39]=D);let O;t[40]!==Re||t[41]!==ze?(O=(0,l.jsxs)(`div`,{className:`truncate text-xs text-muted-foreground`,children:[Re,` · `,ze]}),t[40]=Re,t[41]=ze,t[42]=O):O=t[42];let k;t[43]!==D||t[44]!==O?(k=(0,l.jsxs)(`div`,{className:`min-w-[8rem] flex-1`,children:[D,O]}),t[43]=D,t[44]=O,t[45]=k):k=t[45];let A;t[46]===v?A=t[47]:(A=v>0&&(0,l.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground tabular-nums`,"data-testid":`timeline-diff-property-stat`,children:(0,l.jsx)(i,{id:`UI0WPT`,values:{propertyCount:v}})}),t[46]=v,t[47]=A);let j;t[48]!==s||t[49]!==h.additions||t[50]!==h.deletions||t[51]!==h.status||t[52]!==ct?(j=ct&&h.status===`ready`&&(0,l.jsxs)(`span`,{role:`img`,className:`shrink-0 text-xs tabular-nums`,"data-testid":`timeline-diff-stat`,"aria-label":s({id:`8lwQlE`,values:{0:h.additions,1:h.deletions}}),children:[(0,l.jsxs)(`span`,{"aria-hidden":`true`,className:`text-emerald-600 dark:text-emerald-500`,children:[`+`,h.additions]}),` `,(0,l.jsxs)(`span`,{"aria-hidden":`true`,className:`text-red-600 dark:text-red-500`,children:[`−`,h.deletions]})]}),t[48]=s,t[49]=h.additions,t[50]=h.deletions,t[51]=h.status,t[52]=ct,t[53]=j):j=t[53];let ut;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(ut=e=>{(e===`rendered`||e===`source`)&&Ve(e)},t[54]=ut):ut=t[54];let M;t[55]===s?M=t[56]:(M=s({id:`ZW3mlR`}),t[55]=s,t[56]=M);let dt;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(dt=(0,l.jsx)(fe,{value:`rendered`,className:`h-6 px-2 text-xs`,"data-testid":`timeline-diff-render-rendered`,children:(0,l.jsx)(i,{id:`4z_1j2`})}),t[57]=dt):dt=t[57];let ft;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(ft=(0,l.jsx)(fe,{value:`source`,className:`h-6 px-2 text-xs`,"data-testid":`timeline-diff-render-source`,children:(0,l.jsx)(i,{id:`wdxz7K`})}),t[58]=ft):ft=t[58];let N;t[59]!==f||t[60]!==M?(N=(0,l.jsxs)(pe,{type:`single`,value:f,onValueChange:ut,"aria-label":M,variant:`segmented`,size:`sm`,spacing:1,className:`shrink-0 rounded-md bg-muted p-0.5 dark:bg-background`,children:[dt,ft]}),t[59]=f,t[60]=M,t[61]=N):N=t[61];let P;t[62]!==s||t[63]!==Ze||t[64]!==Ke||t[65]!==$e?(P=Ze>1&&(0,l.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5 rounded-md border border-border bg-muted/40 p-0.5 dark:bg-background`,children:[(0,l.jsx)(o,{variant:`ghost`,size:`icon`,className:`size-6`,"aria-label":s({id:`_azghp`}),"data-testid":`timeline-diff-prev`,onClick:()=>$e(Ke-1),children:(0,l.jsx)(de,{className:`size-3.5`})}),(0,l.jsxs)(`span`,{className:`px-0.5 text-xs tabular-nums text-muted-foreground`,"aria-live":`polite`,children:[Ke+1,` / `,Ze]}),(0,l.jsx)(o,{variant:`ghost`,size:`icon`,className:`size-6`,"aria-label":s({id:`-bFGPF`}),"data-testid":`timeline-diff-next`,onClick:()=>$e(Ke+1),children:(0,l.jsx)(ge,{className:`size-3.5`})})]}),t[62]=s,t[63]=Ze,t[64]=Ke,t[65]=$e,t[66]=P):P=t[66];let pt;t[67]!==x||t[68]!==d?(pt=()=>d>0?He(!0):x(),t[67]=x,t[68]=d,t[69]=pt):pt=t[69];let F;t[70]===m?F=t[71]:(F=m?(0,l.jsx)(_e,{"aria-hidden":`true`,className:`mr-1.5 size-3.5`}):(0,l.jsx)(be,{className:`mr-1.5 size-3.5`}),t[70]=m,t[71]=F);let mt;t[72]===Symbol.for(`react.memo_cache_sentinel`)?(mt=(0,l.jsx)(i,{id:`yKu_3Y`}),t[72]=mt):mt=t[72];let I;t[73]!==m||t[74]!==pt||t[75]!==F?(I=(0,l.jsxs)(o,{variant:`outline`,size:`sm`,className:`h-7 shrink-0`,"data-testid":`timeline-diff-restore`,disabled:m,onClick:pt,children:[F,mt]}),t[73]=m,t[74]=pt,t[75]=F,t[76]=I):I=t[76];let L;t[77]!==s||t[78]!==r?(L=s(r?{id:`6iDEWA`}:{id:`170Js2`}),t[77]=s,t[78]=r,t[79]=L):L=t[79];let ht=!r,R;t[80]===r?R=t[81]:(R=r?(0,l.jsx)(ye,{className:`size-4`}):(0,l.jsx)(ve,{className:`size-4`}),t[80]=r,t[81]=R);let z;t[82]!==a||t[83]!==L||t[84]!==ht||t[85]!==R?(z=(0,l.jsx)(ne,{asChild:!0,children:(0,l.jsx)(o,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"data-testid":`timeline-diff-toggle-panel`,"aria-label":L,"aria-expanded":ht,onClick:a,children:R})}),t[82]=a,t[83]=L,t[84]=ht,t[85]=R,t[86]=z):z=t[86];let B;t[87]!==s||t[88]!==r?(B=s(r?{id:`6iDEWA`}:{id:`170Js2`}),t[87]=s,t[88]=r,t[89]=B):B=t[89];let V;t[90]===B?V=t[91]:(V=(0,l.jsx)(re,{side:`bottom`,children:B}),t[90]=B,t[91]=V);let H;t[92]!==z||t[93]!==V?(H=(0,l.jsxs)(ie,{children:[z,V]}),t[92]=z,t[93]=V,t[94]=H):H=t[94];let U;t[95]!==A||t[96]!==j||t[97]!==N||t[98]!==P||t[99]!==I||t[100]!==H?(U=(0,l.jsxs)(`div`,{className:`ml-auto flex flex-wrap items-center justify-end gap-2`,children:[A,j,N,P,I,H]}),t[95]=A,t[96]=j,t[97]=N,t[98]=P,t[99]=I,t[100]=H,t[101]=U):U=t[101];let W;t[102]!==E||t[103]!==k||t[104]!==U?(W=(0,l.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1.5 border-b border-border px-3 py-2`,children:[E,k,U]}),t[102]=E,t[103]=k,t[104]=U,t[105]=W):W=t[105];let G;t[106]===h.status?G=t[107]:(G=h.status===`loading`&&(0,l.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground`,children:[(0,l.jsx)(_e,{"aria-hidden":`true`,className:`size-3`}),(0,l.jsx)(i,{id:`38foVZ`})]}),t[106]=h.status,t[107]=G);let K;t[108]===h.status?K=t[109]:(K=h.status===`error`&&(0,l.jsx)(`p`,{className:`px-4 py-3 text-xs text-destructive`,children:(0,l.jsx)(i,{id:`vvWZnu`})}),t[108]=h.status,t[109]=K);let q;t[110]!==_||t[111]!==Je||t[112]!==h.status?(q=h.status===`ready`&&_!==null&&(0,l.jsx)(je,{delta:_,open:Je,onOpenChange:e=>{Ye(e),qe(0)}}),t[110]=_,t[111]=Je,t[112]=h.status,t[113]=q):q=t[113];let J;t[114]!==g||t[115]!==f||t[116]!==y||t[117]!==h.after||t[118]!==h.diff||t[119]!==h.status?(J=h.status===`ready`&&(f===`rendered`&&y?.ok?(0,l.jsx)(Oe,{diff:y}):h.diff===``?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`p`,{className:`border-b border-border px-4 py-2 text-xs text-muted-foreground italic`,children:g?(0,l.jsx)(i,{id:`oCO0pe`}):(0,l.jsx)(i,{id:`3YWddZ`})}),(0,l.jsx)(`pre`,{className:`whitespace-pre-wrap px-4 py-3 font-mono text-xs text-foreground/90`,children:h.after})]}):(0,l.jsx)(c.Suspense,{fallback:(0,l.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground`,children:[(0,l.jsx)(_e,{"aria-hidden":`true`,className:`size-3`}),(0,l.jsx)(i,{id:`EDm3wJ`})]}),children:(0,l.jsx)(Ne,{diff:h.diff,viewType:`unified`})})),t[114]=g,t[115]=f,t[116]=y,t[117]=h.after,t[118]=h.diff,t[119]=h.status,t[120]=J):J=t[120];let Y;t[121]!==G||t[122]!==K||t[123]!==q||t[124]!==J?(Y=(0,l.jsxs)(`div`,{ref:Ge,className:`min-h-0 flex-1 overflow-auto subtle-scrollbar`,children:[G,K,q,J]}),t[121]=G,t[122]=K,t[123]=q,t[124]=J,t[125]=Y):Y=t[125];let X;t[126]===m?X=t[127]:(X=e=>{!e&&!m?He(!1):e&&He(!0)},t[126]=m,t[127]=X);let Z;t[128]===s?Z=t[129]:(Z=s({id:`n3wx1q`}),t[128]=s,t[129]=Z);let Q;t[130]===Z?Q=t[131]:(Q=(0,l.jsx)(oe,{children:Z}),t[130]=Z,t[131]=Q);let gt;t[132]===d?gt=t[133]:(gt=(0,l.jsx)(i,{id:`nfPccR`,values:{laterEdits:d}}),t[132]=d,t[133]=gt);let _t;t[134]===Symbol.for(`react.memo_cache_sentinel`)?(_t=(0,l.jsx)(i,{id:`5ZbJFS`}),t[134]=_t):_t=t[134];let vt;t[135]===gt?vt=t[136]:(vt=(0,l.jsxs)(ae,{children:[gt,` `,_t]}),t[135]=gt,t[136]=vt);let yt;t[137]!==Q||t[138]!==vt?(yt=(0,l.jsxs)(le,{children:[Q,vt]}),t[137]=Q,t[138]=vt,t[139]=yt):yt=t[139];let bt;t[140]===Symbol.for(`react.memo_cache_sentinel`)?(bt=(0,l.jsx)(o,{variant:`outline`,"data-testid":`timeline-diff-restore-cancel`,onClick:()=>He(!1),children:(0,l.jsx)(i,{id:`dEgA5A`})}),t[140]=bt):bt=t[140];let xt;t[141]===x?xt=t[142]:(xt=()=>x(),t[141]=x,t[142]=xt);let St;t[143]===m?St=t[144]:(St=m?(0,l.jsx)(_e,{"aria-hidden":`true`,className:`mr-2 size-4`}):null,t[143]=m,t[144]=St);let Ct;t[145]===Symbol.for(`react.memo_cache_sentinel`)?(Ct=(0,l.jsx)(i,{id:`yKu_3Y`}),t[145]=Ct):Ct=t[145];let wt;t[146]!==m||t[147]!==xt||t[148]!==St?(wt=(0,l.jsxs)(ce,{children:[bt,(0,l.jsxs)(o,{variant:`destructive`,"data-testid":`timeline-diff-restore-confirm`,disabled:m,onClick:xt,children:[St,Ct]})]}),t[146]=m,t[147]=xt,t[148]=St,t[149]=wt):wt=t[149];let Tt;t[150]!==yt||t[151]!==wt?(Tt=(0,l.jsxs)(se,{children:[yt,wt]}),t[150]=yt,t[151]=wt,t[152]=Tt):Tt=t[152];let $;t[153]!==p||t[154]!==X||t[155]!==Tt?($=(0,l.jsx)(ue,{open:p,onOpenChange:X,children:Tt}),t[153]=p,t[154]=X,t[155]=Tt,t[156]=$):$=t[156];let Et;return t[157]!==W||t[158]!==Y||t[159]!==$?(Et=(0,l.jsxs)(`div`,{className:`absolute inset-0 z-20 flex flex-col bg-background`,"data-testid":`timeline-diff-pane`,children:[W,Y,$]}),t[157]=W,t[158]=Y,t[159]=$,t[160]=Et):Et=t[160],Et}function Pe(){return Se()}function Fe(){return new s(32)}export{u as TimelineDiffPane};
|
|
2
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as ee}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as te}from"./overlay-layers-Bj-TVfKw.js";import{t as o}from"./button-Cym3gapE.js";import{i as ne,n as re,t as ie}from"./tooltip-DttaCTqz.js";import{a as ae,c as oe,i as se,o as ce,s as le,t as ue}from"./dialog-CTNat3T_.js";import{l as de}from"./select-XEGYznMI.js";import{n as fe,t as pe}from"./toggle-group-C2_37kV5.js";import{wt as me}from"./dist-CNUsB2q0.js";import{n as he}from"./dist-CJhtNlOm2.js";import{t as ge}from"./chevron-down-DNO3PgI_.js";import{t as _e}from"./spinner-t7GahFcQ.js";import{n as ve,t as ye}from"./panel-right-open-2VYfauQI.js";import{t as be}from"./undo-2-XcI_wHcs.js";import{t as xe}from"./x-DbShSCr5.js";import{t as Se}from"./timeline-diff-store-ym5Oz1UF.js";import{t as s}from"./lru-string-cache-Cc7rikda.js";import{a as Ce,c as we,i as Te,l as Ee,n as De,o as Oe,r as ke,s as Ae,u as je}from"./use-timeline-entry-diff-BN0p_LxP.js";var Me=a(),c=e(r(),1),l=n(),Ne=(0,c.lazy)(async()=>({default:(await t(()=>import(`./ActivityPanelDiffView-CgaFZtD7.js`),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)).ActivityPanelDiffView}));function u(e){let t=(0,Me.c)(161),{view:n,isPanelCollapsed:r,onTogglePanel:a}=e,{_:s}=ee(),{docName:u,sha:Ie,parentSha:Le,laterEdits:d,authorName:Re,relativeTime:ze}=n,[Be]=(0,c.useState)(Fe),[f,Ve]=(0,c.useState)(`rendered`),[p,He]=(0,c.useState)(!1),[m,Ue]=(0,c.useState)(!1),We=(0,c.useRef)(null),Ge=(0,c.useRef)(null),[Ke,qe]=(0,c.useState)(0),[Je,Ye]=(0,c.useState)(!0),h=De(Ie,u,Be,`vs-parent`,Le),g,_,v,y,Xe,b;t[0]!==f||t[1]!==h.after||t[2]!==h.before||t[3]!==h.diff||t[4]!==h.properties||t[5]!==h.status?(y=h.status===`ready`?Ae(h.before,h.after):null,b=f===`rendered`&&y?.ok===!0,_=h.status===`ready`?h.properties:null,v=_?.changes.length??0,g=_!==null&&(_.changes.length>0||_.unparseable!==null),Xe=h.status===`ready`?b&&y?.ok?Ee(y):Ce(h.diff):0,t[0]=f,t[1]=h.after,t[2]=h.before,t[3]=h.diff,t[4]=h.properties,t[5]=h.status,t[6]=g,t[7]=_,t[8]=v,t[9]=y,t[10]=Xe,t[11]=b):(g=t[6],_=t[7],v=t[8],y=t[9],Xe=t[10],b=t[11]);let Ze=Xe+(_===null?0:_.unparseable===null?Je?Math.min(v,50):0:1),Qe;t[12]===b?Qe=t[13]:(Qe=function(e){let t=Ge.current;if(!t)return;let n=[...t.querySelectorAll(ke),...b?Array.from(t.querySelectorAll(we)):Te(t)];if(n.length===0)return;let r=(e+n.length)%n.length;qe(r),n[r]?.scrollIntoView({block:`center`,behavior:`smooth`})},t[12]=b,t[13]=Qe);let $e=Qe,et,tt;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(et=()=>()=>We.current?.abort(),tt=[],t[14]=et,t[15]=tt):(et=t[14],tt=t[15]),(0,c.useEffect)(et,tt);let nt=h.status===`ready`?`${f}:${h.diff}`:``,rt,it;t[16]===nt?(rt=t[17],it=t[18]):(rt=()=>{let e=Ge.current;if(nt===``||!e)return;qe(0);let t=!1,n=null,r,i,ee=()=>{if(t)return;let r=e.querySelector(`[data-property-change]`)??e.querySelector(`.ok-diff-ins, .ok-diff-ins-block, [data-diff-deleted]`)??Te(e)[0];if(!r)return;t=!0,n?.disconnect();let i=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;r.scrollIntoView({block:`center`,behavior:i?`auto`:`smooth`})},a=()=>{t||(r!==void 0&&clearTimeout(r),r=setTimeout(()=>{i!==void 0&&cancelAnimationFrame(i),i=requestAnimationFrame(()=>{i=requestAnimationFrame(ee)})},120))};n=new MutationObserver(a),n.observe(e,{childList:!0,subtree:!0}),a();let te=setTimeout(()=>n?.disconnect(),5e3);return()=>{n?.disconnect(),r!==void 0&&clearTimeout(r),i!==void 0&&cancelAnimationFrame(i),clearTimeout(te)}},it=[nt],t[16]=nt,t[17]=rt,t[18]=it),(0,c.useEffect)(rt,it);let at,ot;t[19]===p?(at=t[20],ot=t[21]):(at=()=>{let e=e=>{e.key===`Escape`&&(p||te()||Se())};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},ot=[p],t[19]=p,t[20]=at,t[21]=ot),(0,c.useEffect)(at,ot);let st;t[22]!==s||t[23]!==u||t[24]!==Ie?(st=async function(){Ue(!0);let e=new AbortController;We.current=e;let t=function(){e.signal.aborted||Ue(!1),We.current===e&&(We.current=null)},n;try{n=await fetch(`/api/rollback`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({docName:u,commitSha:Ie}),signal:e.signal})}catch(n){let r=n;!e.signal.aborted&&!(r instanceof DOMException&&r.name===`AbortError`)&&he.error(s({id:`NkXEFS`}),{duration:4e3}),t();return}if(e.signal.aborted){t();return}if(n.ok){t(),He(!1),Se();return}let r=`HTTP ${n.status}`;try{let e=me.safeParse(await n.json());e.success&&(r=e.data.title)}catch{}he.error(s({id:`uM6jnS`}),{description:r,duration:6e3}),t()},t[22]=s,t[23]=u,t[24]=Ie,t[25]=st):st=t[25];let x=st,ct=h.status===`ready`&&(h.additions>0||h.deletions>0),S;t[26]===s?S=t[27]:(S=s({id:`b18t0_`}),t[26]=s,t[27]=S);let lt;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(lt=(0,l.jsx)(xe,{className:`size-4`}),t[28]=lt):lt=t[28];let C;t[29]===S?C=t[30]:(C=(0,l.jsx)(ne,{asChild:!0,children:(0,l.jsx)(o,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"data-testid":`timeline-diff-close`,"aria-label":S,onClick:Pe,children:lt})}),t[29]=S,t[30]=C);let w;t[31]===s?w=t[32]:(w=s({id:`b18t0_`}),t[31]=s,t[32]=w);let T;t[33]===w?T=t[34]:(T=(0,l.jsx)(re,{side:`bottom`,children:w}),t[33]=w,t[34]=T);let E;t[35]!==C||t[36]!==T?(E=(0,l.jsxs)(ie,{children:[C,T]}),t[35]=C,t[36]=T,t[37]=E):E=t[37];let D;t[38]===u?D=t[39]:(D=(0,l.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,children:u}),t[38]=u,t[39]=D);let O;t[40]!==Re||t[41]!==ze?(O=(0,l.jsxs)(`div`,{className:`truncate text-xs text-muted-foreground`,children:[Re,` · `,ze]}),t[40]=Re,t[41]=ze,t[42]=O):O=t[42];let k;t[43]!==D||t[44]!==O?(k=(0,l.jsxs)(`div`,{className:`min-w-[8rem] flex-1`,children:[D,O]}),t[43]=D,t[44]=O,t[45]=k):k=t[45];let A;t[46]===v?A=t[47]:(A=v>0&&(0,l.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground tabular-nums`,"data-testid":`timeline-diff-property-stat`,children:(0,l.jsx)(i,{id:`UI0WPT`,values:{propertyCount:v}})}),t[46]=v,t[47]=A);let j;t[48]!==s||t[49]!==h.additions||t[50]!==h.deletions||t[51]!==h.status||t[52]!==ct?(j=ct&&h.status===`ready`&&(0,l.jsxs)(`span`,{role:`img`,className:`shrink-0 text-xs tabular-nums`,"data-testid":`timeline-diff-stat`,"aria-label":s({id:`8lwQlE`,values:{0:h.additions,1:h.deletions}}),children:[(0,l.jsxs)(`span`,{"aria-hidden":`true`,className:`text-emerald-600 dark:text-emerald-500`,children:[`+`,h.additions]}),` `,(0,l.jsxs)(`span`,{"aria-hidden":`true`,className:`text-red-600 dark:text-red-500`,children:[`−`,h.deletions]})]}),t[48]=s,t[49]=h.additions,t[50]=h.deletions,t[51]=h.status,t[52]=ct,t[53]=j):j=t[53];let ut;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(ut=e=>{(e===`rendered`||e===`source`)&&Ve(e)},t[54]=ut):ut=t[54];let M;t[55]===s?M=t[56]:(M=s({id:`ZW3mlR`}),t[55]=s,t[56]=M);let dt;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(dt=(0,l.jsx)(fe,{value:`rendered`,className:`h-6 px-2 text-xs`,"data-testid":`timeline-diff-render-rendered`,children:(0,l.jsx)(i,{id:`4z_1j2`})}),t[57]=dt):dt=t[57];let ft;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(ft=(0,l.jsx)(fe,{value:`source`,className:`h-6 px-2 text-xs`,"data-testid":`timeline-diff-render-source`,children:(0,l.jsx)(i,{id:`wdxz7K`})}),t[58]=ft):ft=t[58];let N;t[59]!==f||t[60]!==M?(N=(0,l.jsxs)(pe,{type:`single`,value:f,onValueChange:ut,"aria-label":M,variant:`segmented`,size:`sm`,spacing:1,className:`shrink-0 rounded-md bg-muted p-0.5 dark:bg-background`,children:[dt,ft]}),t[59]=f,t[60]=M,t[61]=N):N=t[61];let P;t[62]!==s||t[63]!==Ze||t[64]!==Ke||t[65]!==$e?(P=Ze>1&&(0,l.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5 rounded-md border border-border bg-muted/40 p-0.5 dark:bg-background`,children:[(0,l.jsx)(o,{variant:`ghost`,size:`icon`,className:`size-6`,"aria-label":s({id:`_azghp`}),"data-testid":`timeline-diff-prev`,onClick:()=>$e(Ke-1),children:(0,l.jsx)(de,{className:`size-3.5`})}),(0,l.jsxs)(`span`,{className:`px-0.5 text-xs tabular-nums text-muted-foreground`,"aria-live":`polite`,children:[Ke+1,` / `,Ze]}),(0,l.jsx)(o,{variant:`ghost`,size:`icon`,className:`size-6`,"aria-label":s({id:`-bFGPF`}),"data-testid":`timeline-diff-next`,onClick:()=>$e(Ke+1),children:(0,l.jsx)(ge,{className:`size-3.5`})})]}),t[62]=s,t[63]=Ze,t[64]=Ke,t[65]=$e,t[66]=P):P=t[66];let pt;t[67]!==x||t[68]!==d?(pt=()=>d>0?He(!0):x(),t[67]=x,t[68]=d,t[69]=pt):pt=t[69];let F;t[70]===m?F=t[71]:(F=m?(0,l.jsx)(_e,{"aria-hidden":`true`,className:`mr-1.5 size-3.5`}):(0,l.jsx)(be,{className:`mr-1.5 size-3.5`}),t[70]=m,t[71]=F);let mt;t[72]===Symbol.for(`react.memo_cache_sentinel`)?(mt=(0,l.jsx)(i,{id:`yKu_3Y`}),t[72]=mt):mt=t[72];let I;t[73]!==m||t[74]!==pt||t[75]!==F?(I=(0,l.jsxs)(o,{variant:`outline`,size:`sm`,className:`h-7 shrink-0`,"data-testid":`timeline-diff-restore`,disabled:m,onClick:pt,children:[F,mt]}),t[73]=m,t[74]=pt,t[75]=F,t[76]=I):I=t[76];let L;t[77]!==s||t[78]!==r?(L=s(r?{id:`6iDEWA`}:{id:`170Js2`}),t[77]=s,t[78]=r,t[79]=L):L=t[79];let ht=!r,R;t[80]===r?R=t[81]:(R=r?(0,l.jsx)(ye,{className:`size-4`}):(0,l.jsx)(ve,{className:`size-4`}),t[80]=r,t[81]=R);let z;t[82]!==a||t[83]!==L||t[84]!==ht||t[85]!==R?(z=(0,l.jsx)(ne,{asChild:!0,children:(0,l.jsx)(o,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"data-testid":`timeline-diff-toggle-panel`,"aria-label":L,"aria-expanded":ht,onClick:a,children:R})}),t[82]=a,t[83]=L,t[84]=ht,t[85]=R,t[86]=z):z=t[86];let B;t[87]!==s||t[88]!==r?(B=s(r?{id:`6iDEWA`}:{id:`170Js2`}),t[87]=s,t[88]=r,t[89]=B):B=t[89];let V;t[90]===B?V=t[91]:(V=(0,l.jsx)(re,{side:`bottom`,children:B}),t[90]=B,t[91]=V);let H;t[92]!==z||t[93]!==V?(H=(0,l.jsxs)(ie,{children:[z,V]}),t[92]=z,t[93]=V,t[94]=H):H=t[94];let U;t[95]!==A||t[96]!==j||t[97]!==N||t[98]!==P||t[99]!==I||t[100]!==H?(U=(0,l.jsxs)(`div`,{className:`ml-auto flex flex-wrap items-center justify-end gap-2`,children:[A,j,N,P,I,H]}),t[95]=A,t[96]=j,t[97]=N,t[98]=P,t[99]=I,t[100]=H,t[101]=U):U=t[101];let W;t[102]!==E||t[103]!==k||t[104]!==U?(W=(0,l.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1.5 border-b border-border px-3 py-2`,children:[E,k,U]}),t[102]=E,t[103]=k,t[104]=U,t[105]=W):W=t[105];let G;t[106]===h.status?G=t[107]:(G=h.status===`loading`&&(0,l.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground`,children:[(0,l.jsx)(_e,{"aria-hidden":`true`,className:`size-3`}),(0,l.jsx)(i,{id:`38foVZ`})]}),t[106]=h.status,t[107]=G);let K;t[108]===h.status?K=t[109]:(K=h.status===`error`&&(0,l.jsx)(`p`,{className:`px-4 py-3 text-xs text-destructive`,children:(0,l.jsx)(i,{id:`vvWZnu`})}),t[108]=h.status,t[109]=K);let q;t[110]!==_||t[111]!==Je||t[112]!==h.status?(q=h.status===`ready`&&_!==null&&(0,l.jsx)(je,{delta:_,open:Je,onOpenChange:e=>{Ye(e),qe(0)}}),t[110]=_,t[111]=Je,t[112]=h.status,t[113]=q):q=t[113];let J;t[114]!==g||t[115]!==f||t[116]!==y||t[117]!==h.after||t[118]!==h.diff||t[119]!==h.status?(J=h.status===`ready`&&(f===`rendered`&&y?.ok?(0,l.jsx)(Oe,{diff:y}):h.diff===``?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`p`,{className:`border-b border-border px-4 py-2 text-xs text-muted-foreground italic`,children:g?(0,l.jsx)(i,{id:`oCO0pe`}):(0,l.jsx)(i,{id:`3YWddZ`})}),(0,l.jsx)(`pre`,{className:`whitespace-pre-wrap px-4 py-3 font-mono text-xs text-foreground/90`,children:h.after})]}):(0,l.jsx)(c.Suspense,{fallback:(0,l.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground`,children:[(0,l.jsx)(_e,{"aria-hidden":`true`,className:`size-3`}),(0,l.jsx)(i,{id:`EDm3wJ`})]}),children:(0,l.jsx)(Ne,{diff:h.diff,viewType:`unified`})})),t[114]=g,t[115]=f,t[116]=y,t[117]=h.after,t[118]=h.diff,t[119]=h.status,t[120]=J):J=t[120];let Y;t[121]!==G||t[122]!==K||t[123]!==q||t[124]!==J?(Y=(0,l.jsxs)(`div`,{ref:Ge,className:`min-h-0 flex-1 overflow-auto subtle-scrollbar`,children:[G,K,q,J]}),t[121]=G,t[122]=K,t[123]=q,t[124]=J,t[125]=Y):Y=t[125];let X;t[126]===m?X=t[127]:(X=e=>{!e&&!m?He(!1):e&&He(!0)},t[126]=m,t[127]=X);let Z;t[128]===s?Z=t[129]:(Z=s({id:`n3wx1q`}),t[128]=s,t[129]=Z);let Q;t[130]===Z?Q=t[131]:(Q=(0,l.jsx)(oe,{children:Z}),t[130]=Z,t[131]=Q);let gt;t[132]===d?gt=t[133]:(gt=(0,l.jsx)(i,{id:`nfPccR`,values:{laterEdits:d}}),t[132]=d,t[133]=gt);let _t;t[134]===Symbol.for(`react.memo_cache_sentinel`)?(_t=(0,l.jsx)(i,{id:`5ZbJFS`}),t[134]=_t):_t=t[134];let vt;t[135]===gt?vt=t[136]:(vt=(0,l.jsxs)(ae,{children:[gt,` `,_t]}),t[135]=gt,t[136]=vt);let yt;t[137]!==Q||t[138]!==vt?(yt=(0,l.jsxs)(le,{children:[Q,vt]}),t[137]=Q,t[138]=vt,t[139]=yt):yt=t[139];let bt;t[140]===Symbol.for(`react.memo_cache_sentinel`)?(bt=(0,l.jsx)(o,{variant:`outline`,"data-testid":`timeline-diff-restore-cancel`,onClick:()=>He(!1),children:(0,l.jsx)(i,{id:`dEgA5A`})}),t[140]=bt):bt=t[140];let xt;t[141]===x?xt=t[142]:(xt=()=>x(),t[141]=x,t[142]=xt);let St;t[143]===m?St=t[144]:(St=m?(0,l.jsx)(_e,{"aria-hidden":`true`,className:`mr-2 size-4`}):null,t[143]=m,t[144]=St);let Ct;t[145]===Symbol.for(`react.memo_cache_sentinel`)?(Ct=(0,l.jsx)(i,{id:`yKu_3Y`}),t[145]=Ct):Ct=t[145];let wt;t[146]!==m||t[147]!==xt||t[148]!==St?(wt=(0,l.jsxs)(ce,{children:[bt,(0,l.jsxs)(o,{variant:`destructive`,"data-testid":`timeline-diff-restore-confirm`,disabled:m,onClick:xt,children:[St,Ct]})]}),t[146]=m,t[147]=xt,t[148]=St,t[149]=wt):wt=t[149];let Tt;t[150]!==yt||t[151]!==wt?(Tt=(0,l.jsxs)(se,{children:[yt,wt]}),t[150]=yt,t[151]=wt,t[152]=Tt):Tt=t[152];let $;t[153]!==p||t[154]!==X||t[155]!==Tt?($=(0,l.jsx)(ue,{open:p,onOpenChange:X,children:Tt}),t[153]=p,t[154]=X,t[155]=Tt,t[156]=$):$=t[156];let Et;return t[157]!==W||t[158]!==Y||t[159]!==$?(Et=(0,l.jsxs)(`div`,{className:`absolute inset-0 z-20 flex flex-col bg-background`,"data-testid":`timeline-diff-pane`,children:[W,Y,$]}),t[157]=W,t[158]=Y,t[159]=$,t[160]=Et):Et=t[160],Et}function Pe(){return Se()}function Fe(){return new s(32)}export{u as TimelineDiffPane};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{er as n}from"./DocumentContext-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{er as n}from"./DocumentContext-D4-sdlnA.js";import{t as r}from"./react-f2sANaYj.js";import{t as i}from"./compiler-runtime-BfE3aGVn.js";import{i as a,r as o,t as s}from"./cursor-2VSK5BUh.js";import{t as c}from"./copilot-DMpTxujg.js";var l=i(),u=t();function d(e){let t=(0,l.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,u.jsx)(`title`,{children:`Cline icon`}),r=(0,u.jsx)(`path`,{fill:`currentColor`,d:`M463.6,275.08l-29.26-58.75v-33.83c0-56.08-45.01-101.5-100.53-101.5h-50.01c3.62-7.43,5.61-15.79,5.61-24.61,0-31.17-25.08-56.39-56.07-56.39s-56.07,25.22-56.07,56.39c0,8.82,1.99,17.17,5.61,24.61h-50.01c-55.51,0-100.52,45.42-100.52,101.5v33.83l-29.87,58.59c-3.01,5.9-3.01,12.92,0,18.81l29.87,57.93v33.83c0,56.08,45.01,101.5,100.52,101.5h200.95c55.51,0,100.53-45.42,100.53-101.5v-33.83l29.21-58.13c2.9-5.79,2.9-12.61.05-18.46ZM202.75,322.96c0,25.48-20.54,46.14-45.88,46.14s-45.88-20.66-45.88-46.14v-82.02c0-25.48,20.54-46.14,45.88-46.14s45.88,20.66,45.88,46.14v82.02ZM350.58,322.96c0,25.48-20.54,46.14-45.88,46.14s-45.88-20.66-45.88-46.14v-82.02c0-25.48,20.54-46.14,45.88-46.14s45.88,20.66,45.88,46.14v82.02Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,u.jsxs)(`svg`,{role:`img`,"aria-label":`Cline icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 466.73 487.04`,fill:`none`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}function f(e){let t=(0,l.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,u.jsx)(`title`,{children:`Windsurf icon`}),r=(0,u.jsx)(`path`,{fill:`currentColor`,d:`M21.3192 4.9697H21.1203C20.0734 4.96806 19.2238 5.81589 19.2238 6.86264V11.0961C19.2238 11.9415 18.525 12.6263 17.6934 12.6263C17.1993 12.6263 16.706 12.3777 16.4133 11.9603L12.0896 5.78492C11.7308 5.27214 11.1471 4.96643 10.5152 4.96643C9.52943 4.96643 8.64234 5.80448 8.64234 6.83902V11.0969C8.64234 11.9423 7.94932 12.6271 7.11197 12.6271C6.61625 12.6271 6.12376 12.3785 5.83105 11.9611L0.992853 5.0504C0.883594 4.89387 0.638184 4.97133 0.638184 5.1621V8.85424C0.638184 9.04094 0.695264 9.22193 0.802059 9.37517L5.56362 16.175C5.84492 16.5769 6.25994 16.8753 6.73852 16.9837C7.93627 17.256 9.03861 16.334 9.03861 15.1592V10.9037C9.03861 10.0583 9.7235 9.37354 10.569 9.37354H10.5714C11.081 9.37354 11.5588 9.62219 11.8515 10.0396L16.1761 16.2141C16.5356 16.7277 17.0892 17.0326 17.7497 17.0326C18.7574 17.0326 19.6209 16.1937 19.6209 15.16V10.9029C19.6209 10.0575 20.3058 9.37273 21.1512 9.37273H21.32C21.426 9.37273 21.5116 9.28713 21.5116 9.18116V5.16127C21.5116 5.05531 21.426 4.9697 21.32 4.9697H21.3192Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,u.jsxs)(`svg`,{role:`img`,"aria-label":`Windsurf icon`,xmlns:`http://www.w3.org/2000/svg`,width:22,height:22,viewBox:`0 0 22 22`,fill:`none`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}function p(e){let t=(0,l.c)(17),r,i;if(t[0]===e?(r=t[1],i=t[2]):({icon:r,...i}=e,t[0]=e,t[1]=r,t[2]=i),r===`claude`){let e;return t[3]===i?e=t[4]:(e=(0,u.jsx)(a,{...i}),t[3]=i,t[4]=e),e}if(r===`cursor`){let e;return t[5]===i?e=t[6]:(e=(0,u.jsx)(s,{...i}),t[5]=i,t[6]=e),e}if(r===`windsurf`){let e;return t[7]===i?e=t[8]:(e=(0,u.jsx)(f,{...i}),t[7]=i,t[8]=e),e}if(r===`openai`){let e;return t[9]===i?e=t[10]:(e=(0,u.jsx)(o,{...i}),t[9]=i,t[10]=e),e}if(r===`cline`){let e;return t[11]===i?e=t[12]:(e=(0,u.jsx)(d,{...i}),t[11]=i,t[12]=e),e}if(r===`github`){let e;return t[13]===i?e=t[14]:(e=(0,u.jsx)(c,{...i}),t[13]=i,t[14]=e),e}let p=i,m;return t[15]===p?m=t[16]:(m=(0,u.jsx)(n,{strokeWidth:1.5,...p}),t[15]=p,t[16]=m),m}var m=e(r(),1),h=null,g=new Set;function _(){for(let e of g)e()}function v(e){h=e,_()}function y(e){if(h===null)return;let t=Math.max(0,Math.min(e,h.maxVersions));t!==h.keptCount&&(h={...h,keptCount:t},_())}function b(e,t,n){if(h===null||h.agentId!==e||h.docName!==t||h.maxVersions===n)return;let r=h.keptCount===h.maxVersions?n:Math.min(h.keptCount,n);h={...h,maxVersions:n,keptCount:r},_()}function x(){h!==null&&(h=null,_())}function S(e){return g.add(e),()=>{g.delete(e)}}function C(){return h}function w(){return(0,m.useSyncExternalStore)(S,C,C)}export{w as a,b as i,v as n,p as o,y as r,x as t};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{Sr as n,i as r,or as i,rr as a,vr as o,yr as s}from"./DocumentContext-D4-sdlnA.js";import{t as c}from"./react-f2sANaYj.js";import{n as l,r as u}from"./dist-Nvb76hAm.js";import{t as d}from"./compiler-runtime-BfE3aGVn.js";import{t as f}from"./utils-CPqDy6Hr.js";import{n as p,t as m}from"./clipboard-adapter-815RzzoI.js";import{C as h,S as g,_,a as v,h as y}from"./SkillInstallMenu-CcQ4rXjm.js";import{t as b}from"./button-Cym3gapE.js";import{t as x}from"./dist-BHv-mziD.js";import{i as S,n as C,t as w}from"./tooltip-DttaCTqz.js";import{n as T,r as E,t as D}from"./collapsible-DYySK8La.js";import{a as O,c as k,i as A,n as j,o as M,s as N,t as P}from"./dialog-CTNat3T_.js";import{t as F}from"./alert-dialog-D9BtoYXB.js";import{t as I}from"./checkbox-LVDa5cS9.js";import{a as L,m as R,r as z,t as B}from"./dropdown-menu-CRvS0_4-.js";import{t as ee}from"./label-D-K3fWtj.js";import{i as te,n as V,o as ne,s as H,t as U}from"./select-XEGYznMI.js";import{n as W,t as re}from"./radio-group-npdxiS6E.js";import{Gt as G,Kt as K,Ps as ie,Qo as ae,Ut as oe,Wt as se,Yo as ce,Yt as le,ho as ue,rn as q,wt as de}from"./dist-CNUsB2q0.js";import{n as J}from"./dist-CJhtNlOm2.js";import{c as fe}from"./use-settings-route-CUsaVNEW.js";import{t as Y}from"./dist-Cr4-nBVI.js";import{c as pe,v as me,x as he}from"./documents-events-B4_gdzXM.js";import{i as ge}from"./use-apply-config-theme-CBmHKD_B.js";import{t as _e}from"./parse-api-error-Dd8VI2eu.js";import{n as ve}from"./use-workspace-BLzLEi-_.js";import{t as X}from"./createLucideIcon-BulbvLvN.js";import{h as ye,n as be,r as xe,t as Se}from"./EnableSyncConfirmDialog-Dxi4MbUU.js";import{c as Ce,d as we,l as Te}from"./Mermaid-B4Oa2diB.js";import{t as Ee}from"./arrow-up-right-BTi7mHwL.js";import{t as De}from"./check-Dut4Aov8.js";import{t as Oe}from"./chevron-right-4mYNnAZZ.js";import{s as ke}from"./prop-types-CeSzd9V3.js";import{n as Ae,t as je}from"./terminal-D4HSnHXf.js";import{a as Me,r as Ne,t as Pe}from"./folder-config-api-BjfmZE1E.js";import{t as Fe}from"./spinner-t7GahFcQ.js";import{t as Ie}from"./refresh-cw-BFSYd-XR.js";import{t as Le}from"./trash-2-DSqYvaPJ.js";import{t as Re}from"./triangle-alert-GeclLtDN.js";import{t as ze}from"./x-DbShSCr5.js";import{d as Be,f as Ve,n as He,u as Ue,v as We}from"./doc-paths-BShtZt2N.js";import"./config-provider-CH25hiPj.js";import{S as Ge,h as Ke,i as qe,p as Je,x as Ye}from"./skills-api-DwfG7_Ox.js";import{p as Xe,r as Ze,t as Qe}from"./skill-scope-C7vDwjos.js";import{t as $e}from"./input-DJ1c1x-M.js";import{a as et,i as tt,r as nt,t as rt}from"./popover-BE6X9rKr.js";import{t as it}from"./external-link-B0bVg1hn.js";import{t as at}from"./badge-BWfmbBoh.js";import{a as ot,i as st,n as ct,o as lt,r as ut,s as dt,t as ft}from"./field-Di3yPBdO.js";import{t as pt}from"./use-skills-DIoMs6BD.js";import{t as mt}from"./textarea-BoMa_3jF.js";import{t as ht}from"./terminal-command-events-CL99X6I2.js";var gt=X(`cloud-alert`,[[`path`,{d:`M12 12v4`,key:`tww15h`}],[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.128 16.949A7 7 0 1 1 15.71 8h1.79a1 1 0 0 1 0 9h-1.642`,key:`1namsd`}]]),_t=X(`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`}]]),vt=X(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),yt=X(`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`}]]),bt=X(`move-up-right`,[[`path`,{d:`M13 5H19V11`,key:`1n1gyv`}],[`path`,{d:`M19 5L5 19`,key:`72u4yj`}]]),xt=X(`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`}]]);function St(e){return e===`eperm`?Y._({id:`XuQzrk`}):Y._({id:`BUyQnq`})}async function Ct(e){let t=await e.restartServer(e.config.projectPath);return t.ok?{ok:!0}:{ok:!1,message:St(t.reason)}}var Z=d(),Q=e(c(),1);function wt(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 he(()=>{o(Ot)})},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(Et).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(Tt),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 Tt(e){return e+1}async function Et(e){if(!e.ok){let t=await e.json().catch(Dt);throw Error(_e(t)??`HTTP ${e.status}`)}return e.json()}function Dt(){return null}function Ot(e){return e+1}function kt(){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=()=>he(()=>{a(Mt)}),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(At).then(t=>{if(e)return;let n=q.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 At(e){if(!e.ok){let t=await e.json().catch(jt);throw Error(_e(t)??`HTTP ${e.status}`)}return e.json()}function jt(){return null}function Mt(e){return e+1}async function Nt(){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 Pt(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&&Nt().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 me(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}var $=t(),Ft=`github.com`,It=new Map;async function Lt(e){try{let t=await e.json(),n=de.safeParse(t);if(n.success)return n.data.title}catch{}}async function Rt(e,t){return fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t??{})})}async function zt(e){let t=e?.host??Ft,n=await Rt(`/api/local-op/auth/status`,e);if(!n.ok)return{authenticated:!1,host:t,error:await Lt(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 Bt(e){let t=e?.host??Ft,n=It.get(t);if(n)return n;let r=zt(e).finally(()=>{It.delete(t)});return It.set(t,r),r}function Vt(e){let t=e.split(`
|
|
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 Ht(){return{status:Bt,async repos(e){let t=e?.host??`github.com`,n=await Rt(`/api/local-op/auth/repos`,e);if(!n.ok)return{ok:!1,error:await Lt(n)??Y._({id:`sGZLfB`})};let r=Vt(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 Rt(`/api/local-op/auth/signout`,e);return t.ok?{ok:!0}:{ok:!1,error:await Lt(t)}}}}function Ut(e){return{status:t=>e.localOp.authStatus(t),repos:t=>e.localOp.authRepos(t)}}async function Wt(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
|
+
`);i=o.pop()??``;for(let e of o)if(e.trim()&&t(e)===`terminal`)return!0}}function Gt(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 Kt=2e3,qt=1e4;function Jt(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 Yt(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 Xt(e,t,n,r){let i=Ht(),a=Kt;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 Jt(a,t),a=Math.min(a*1.5,qt)}t.aborted||e({type:`error`,message:Y._({id:`ve8vEM`})})}function Zt(e,t,n){let r=!1,i=Gt((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=de.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 Wt(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 Xt(a,i,n,t.host)}catch(e){if(e instanceof Error&&e.name===`AbortError`)return;if(n!==null){await Xt(a,i,n,t.host);return}a({type:`error`,message:Y._({id:`Q5fqMz`})})}})()});return{events:i.events,cancel:()=>{r||Yt(n),i.cancel()}}}function Qt(){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=de.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 $t(e){return{start(){return e.localOp.auth.start()}}}async function en(e){try{await navigator.clipboard.writeText(e)}catch{}}function tn(e){let t=(0,Z.c)(25),{onSuccess:n,startFlow:r}=e,{_:i}=u(),[a,o]=(0,Q.useState)(null),[c,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),[v,y]=(0,Q.useState)(0),x=(0,Q.useRef)(null),S=(0,Q.useRef)(null),C;t[0]!==i||t[1]!==n||t[2]!==r?(C=async function(){h(null);try{let e=r();x.current=e.cancel;let t=e.events[Symbol.asyncIterator](),a=!1,s=await t.next();for(;!s.done;){let e=s.value;if(e.type===`verification`)o(e.user_code),d(e.verification_uri),_(Date.now()+e.expires_in*1e3),y(e.expires_in*1e3),en(e.user_code).then(()=>{p(!0),setTimeout(()=>p(!1),2e3)});else if(e.type===`complete`){a=!0,n({login:e.login,name:e.name,email:e.email,avatarUrl:e.avatarUrl});break}else if(e.type===`error`){a=!0,h(e.message);break}s=await t.next()}a||h(i({id:`DskIkK`}))}catch(e){let t=e;t instanceof Error&&t.name!==`AbortError`&&h(i({id:`Q5fqMz`}))}},t[0]=i,t[1]=n,t[2]=r,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]!==i||t[8]!==g?(D=()=>{if(g!==null)return S.current=setInterval(()=>{let e=g-Date.now();e<=0?(y(0),S.current&&clearInterval(S.current),h(i({id:`ve8vEM`}))):y(e)},1e3),()=>{S.current&&clearInterval(S.current)}},O=[g,i],t[7]=i,t[8]=g,t[9]=D,t[10]=O):(D=t[9],O=t[10]),(0,Q.useEffect)(D,O);let k=Math.floor(v/6e4),A=Math.floor(v%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]!==i||t[14]!==f||t[15]!==m||t[16]!==M||t[17]!==a||t[18]!==c?(N=a?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(l,{id:`eVPynQ`,values:{verificationUri:c},components:{0:(0,$.jsx)(`a`,{href:c,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>it(e,c),onAuxClick:e=>it(e,c),className:`inline-flex items-center gap-0.5 text-foreground hover:text-primary hover:underline`}),1:(0,$.jsx)(`span`,{}),2:(0,$.jsx)(Ee,{className:`inline size-3.5`,"aria-hidden":!0})}})}),(0,$.jsxs)(b,{type:`button`,variant:`outline`,"aria-label":i({id:`nCzR-G`,values:{userCode:a}}),onClick:()=>void en(a).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:a}),(0,$.jsx)(`span`,{className:`absolute right-3 text-muted-foreground`,"aria-hidden":`true`,children:f?(0,$.jsx)(De,{className:`size-4`}):(0,$.jsx)(s,{className:`size-4`})})]}),(0,$.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`sr-only`,children:f?(0,$.jsx)(l,{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)(l,{id:`5y_9lO`})]}),(0,$.jsx)(`span`,{children:(0,$.jsx)(l,{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)(l,{id:`aWlJai`})}),t[13]=i,t[14]=f,t[15]=m,t[16]=M,t[17]=a,t[18]=c,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 nn(e){let t=(0,Z.c)(30),{login:n,name:r,onNameChange:i,email:a,onEmailChange:o}=e,{_:s}=u(),c;t[0]===n?c=t[1]:(c=(0,$.jsx)(`p`,{className:`text-sm font-medium`,children:(0,$.jsx)(l,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=c);let d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(l,{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)($e,{"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)($e,{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]!==c||t[27]!==y||t[28]!==h?(b=(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[c,d,h,y]}),t[26]=c,t[27]=y,t[28]=h,t[29]=b):b=t[29],b}function rn(e){let t=(0,Z.c)(37),{host:n,token:r,onTokenChange:i,error:a,onSubmit:o,showGhOption:s,onGhSignIn:c}=e,{_:d}=u(),f=`https://${n}/settings/tokens/new?scopes=repo,read:user&description=OpenKnowledge`,p;t[0]!==n||t[1]!==c||t[2]!==s?(p=s?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(b,{type:`button`,onClick:c,children:(0,$.jsx)(l,{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)(l,{id:`8L0EPw`}),(0,$.jsx)(`span`,{className:`h-px flex-1 bg-border`})]})]}):(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(l,{id:`8k6INX`,values:{host:n},components:{0:(0,$.jsx)(`span`,{className:`font-medium text-foreground`})}})}),t[0]=n,t[1]=c,t[2]=s,t[3]=p):p=t[3];let m,h;t[4]===f?(m=t[5],h=t[6]):(m=e=>it(e,f),h=e=>it(e,f),t[4]=f,t[5]=m,t[6]=h);let g;t[7]===n?g=t[8]:(g=(0,$.jsx)(l,{id:`6hYjww`,values:{host:n}}),t[7]=n,t[8]=g);let _;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(Ee,{className:`inline size-3.5`,"aria-hidden":!0}),t[9]=_):_=t[9];let v;t[10]!==f||t[11]!==m||t[12]!==h||t[13]!==g?(v=(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]=v):v=t[14];let y;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,$.jsx)(l,{id:`Xg-Ntj`})}),t[15]=y):y=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)($e,{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)(l,{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)(l,{id:`jxtXZI`})}),(0,$.jsx)(`li`,{children:(0,$.jsx)(l,{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]!==v?(D=(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[p,v,y,w,T,E]}),t[31]=p,t[32]=w,t[33]=T,t[34]=E,t[35]=v,t[36]=D):D=t[36],D}var an=1e4;function on(e){let t=(0,Z.c)(92),{open:n,onOpenChange:r,onSuccess:i,identityPrompt:a,reauth:o,transport:s,queryTransport:c,host:d,ghAvailable:f}=e,{_:p}=u(),m;t[0]===s?m=t[1]:(m=s??Qt(),t[0]=s,t[1]=m);let h=m,g;t[2]===c?g=t[3]:(g=c??Ht(),t[2]=c,t[3]=g);let _=g,[v,y]=(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)(``),[F,I]=(0,Q.useState)(null),[L,R]=(0,Q.useState)(!1),[z,B]=(0,Q.useState)(void 0),[ee,te]=(0,Q.useState)(void 0),V=d??z,ne=!!V&&V!==`github.com`&&!!(f??ee)&&typeof h.ghLogin==`function`,H=!a&&d===void 0,U,W;t[4]!==d||t[5]!==a||t[6]!==H||t[7]!==n?(U=()=>{n&&(S(null),w(``),E(``),O(``),I(null),R(!1),B(void 0),te(void 0),y(a||H?`checking`:d&&d!==`github.com`?`pat`:`auth`))},W=[n,a,d,H],t[4]=d,t[5]=a,t[6]=H,t[7]=n,t[8]=U,t[9]=W):(U=t[8],W=t[9]),(0,Q.useLayoutEffect)(U,W);let re;t[10]!==a||t[11]!==n||t[12]!==_?(re=()=>{if(!n||!a)return;let e=!1,t=t=>{e||(e=!0,y(t))},r=setTimeout(()=>t(`auth`),an);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]=re):re=t[13];let G;t[14]!==a||t[15]!==n?(G=[n,a],t[14]=a,t[15]=n,t[16]=G):G=t[16],(0,Q.useEffect)(re,G);let K;t[17]!==H||t[18]!==n||t[19]!==_?(K=()=>{if(!n||!H)return;let e=!1,t=t=>{e||(e=!0,y(t))},r=setTimeout(()=>t(`auth`),an);return _.status().then(n=>{if(e)return;let r=!!n.host&&n.host!==`github.com`;B(n.host),te(n.ghAvailable),t(r?`pat`:`auth`)}).catch(()=>{t(`auth`)}),()=>{e=!0,clearTimeout(r)}},t[17]=H,t[18]=n,t[19]=_,t[20]=K):K=t[20];let ie;t[21]!==H||t[22]!==n?(ie=[n,H],t[21]=H,t[22]=n,t[23]=ie):ie=t[23],(0,Q.useEffect)(K,ie);let ae;t[24]!==p||t[25]!==a||t[26]!==r||t[27]!==i?(ae=function(e){if(S(e),a)w(e.name??``),E(e.email??``),y(`identity`);else{y(`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]=ae):ae=t[28];let oe=ae,se;t[29]!==p||t[30]!==V||t[31]!==oe||t[32]!==L||t[33]!==D||t[34]!==h?(se=async function(){let e=D.trim();if(!e||!V||L)return;if(!h.pat){I(p({id:`iMYFJM`}));return}R(!0),I(null);let t=await h.pat(V,e);R(!1),t.ok?oe({login:t.login??``}):I(t.error??p({id:`sNeKjP`}))},t[29]=p,t[30]=V,t[31]=oe,t[32]=L,t[33]=D,t[34]=h,t[35]=se):se=t[35];let ce=se,le;t[36]!==p||t[37]!==x||t[38]!==r||t[39]!==i?(le=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(sn);let n={...x??{login:``},name:e,email:t};y(`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]=le):le=t[40];let ue=le,q;t[41]!==p||t[42]!==x||t[43]!==r||t[44]!==i?(q=function(){if(!x)return;y(`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]=q):q=t[45];let de=q,fe;t[46]===r?fe=t[47]:(fe=function(){r(!1)},t[46]=r,t[47]=fe);let Y=fe,pe;t[48]!==a||t[49]!==o||t[50]!==v?(pe=(0,$.jsx)(N,{children:(0,$.jsx)(k,{children:o&&(v===`pat`||v===`gh-device`)?(0,$.jsx)(l,{id:`DUWgfT`}):o?(0,$.jsx)(l,{id:`X8kjQX`}):v===`pat`||v===`gh-device`?(0,$.jsx)(l,{id:`tzZ6ha`}):a&&v!==`auth`?(0,$.jsx)(l,{id:`29XZXN`}):(0,$.jsx)(l,{id:`3jod3l`})})}),t[48]=a,t[49]=o,t[50]=v,t[51]=pe):pe=t[51];let me;t[52]===v?me=t[53]:(me=v===`checking`&&(0,$.jsx)(j,{children:(0,$.jsx)(`div`,{className:`flex items-center justify-center py-6 text-sm text-muted-foreground`,children:(0,$.jsx)(l,{id:`gBbxn_`})})}),t[52]=v,t[53]=me);let he;t[54]!==oe||t[55]!==Y||t[56]!==h||t[57]!==v?(he=v===`auth`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(j,{children:(0,$.jsx)(tn,{onSuccess:oe,startFlow:()=>h.start()})}),(0,$.jsx)(M,{children:(0,$.jsx)(b,{variant:`outline`,className:`font-mono uppercase`,onClick:Y,children:(0,$.jsx)(l,{id:`dEgA5A`})})})]}),t[54]=oe,t[55]=Y,t[56]=h,t[57]=v,t[58]=he):he=t[58];let ge;t[59]!==ne||t[60]!==V||t[61]!==Y||t[62]!==ce||t[63]!==F||t[64]!==L||t[65]!==D||t[66]!==v?(ge=v===`pat`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(j,{children:(0,$.jsx)(rn,{host:V??``,token:D,onTokenChange:O,error:F,onSubmit:ce,showGhOption:ne,onGhSignIn:()=>y(`gh-device`)})}),(0,$.jsxs)(M,{children:[(0,$.jsx)(b,{variant:`outline`,className:`font-mono uppercase`,onClick:Y,children:(0,$.jsx)(l,{id:`dEgA5A`})}),(0,$.jsx)(b,{onClick:ce,disabled:!D.trim()||L,children:L?(0,$.jsx)(l,{id:`9zb2WA`}):(0,$.jsx)(l,{id:`iSLIjg`})})]})]}),t[59]=ne,t[60]=V,t[61]=Y,t[62]=ce,t[63]=F,t[64]=L,t[65]=D,t[66]=v,t[67]=ge):ge=t[67];let _e;t[68]!==V||t[69]!==oe||t[70]!==Y||t[71]!==h||t[72]!==v?(_e=v===`gh-device`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(j,{children:(0,$.jsx)(tn,{onSuccess:oe,startFlow:()=>h.ghLogin?.(V??``)??h.start()})}),(0,$.jsxs)(M,{children:[(0,$.jsx)(b,{variant:`ghost`,onClick:()=>y(`pat`),children:(0,$.jsx)(l,{id:`hLKfZe`})}),(0,$.jsx)(b,{variant:`outline`,className:`font-mono uppercase`,onClick:Y,children:(0,$.jsx)(l,{id:`dEgA5A`})})]})]}),t[68]=V,t[69]=oe,t[70]=Y,t[71]=h,t[72]=v,t[73]=_e):_e=t[73];let ve;t[74]!==x||t[75]!==ue||t[76]!==de||t[77]!==T||t[78]!==C||t[79]!==v?(ve=v===`identity`&&x&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(j,{children:(0,$.jsx)(nn,{login:x.login,name:C,onNameChange:w,email:T,onEmailChange:E})}),(0,$.jsxs)(M,{children:[(0,$.jsx)(b,{variant:`ghost`,onClick:de,children:(0,$.jsx)(l,{id:`6Uau97`})}),(0,$.jsx)(b,{onClick:()=>ue(C.trim(),T.trim()),disabled:!C.trim()||!T.trim(),children:(0,$.jsx)(l,{id:`tfDRzk`})})]})]}),t[74]=x,t[75]=ue,t[76]=de,t[77]=T,t[78]=C,t[79]=v,t[80]=ve):ve=t[80];let X;t[81]!==pe||t[82]!==me||t[83]!==he||t[84]!==ge||t[85]!==_e||t[86]!==ve?(X=(0,$.jsxs)(A,{className:`sm:max-w-md`,children:[pe,me,he,ge,_e,ve]}),t[81]=pe,t[82]=me,t[83]=he,t[84]=ge,t[85]=_e,t[86]=ve,t[87]=X):X=t[87];let ye;return t[88]!==r||t[89]!==n||t[90]!==X?(ye=(0,$.jsx)(P,{open:n,onOpenChange:r,children:X}),t[88]=r,t[89]=n,t[90]=X,t[91]=ye):ye=t[91],ye}function sn(){}function cn(e){let t=(0,Z.c)(16),{value:n,onChange:r,disabled:i,placeholder:a,rows:o}=e,s=i===void 0?!1:i,c=o===void 0?12:o,u=(0,Q.useId)(),d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(l,{id:`3o3tur`}),t[0]=d):d=t[0];let f;t[1]===u?f=t[2]:(f=(0,$.jsx)(lt,{htmlFor:u,children:d}),t[1]=u,t[2]=f);let p;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(ut,{children:(0,$.jsx)(l,{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]!==c||t[10]!==m||t[11]!==n?(h=(0,$.jsx)(mt,{id:u,value:n,onChange:m,disabled:s,rows:c,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]=c,t[10]=m,t[11]=n,t[12]=h):h=t[12];let g;return t[13]!==f||t[14]!==h?(g=(0,$.jsxs)(ft,{children:[f,p,h]}),t[13]=f,t[14]=h,t[15]=g):g=t[15],g}var ln=/^[A-Za-z0-9_-]+$/;function un(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)}function dn(e){let t={},n=e.title.trim();n&&(t.title=n);let r=e.description.trim();return r&&(t.description=r),t}var fn=0;function pn(){return fn+=1,`prop-${fn}`}function mn(e){let{frontmatter:t,body:n}=ce(e);if(t===``)return{type:``,properties:[],markdown:e};let r=[];for(let e of ae(t).split(`
|
|
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:pn(),key:e.key,value:e.value})}return{type:i,properties:a,markdown:n}}function hn(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(`
|
|
5
|
+
`)?e.markdown:`\n${e.markdown}`;return`---\n${t.join(`
|
|
6
|
+
`)}\n---\n${r}`}function gn(e){let t=(0,Z.c)(54),{mode:n,folderPath:r,scope:i,initial:a,existingNames:o,onCommitted:s}=e,c=i===void 0?`local`:i,[l,u]=(0,Q.useState)(a.title),[d,f]=(0,Q.useState)(a.name),[p,m]=(0,Q.useState)(a.description),h;t[0]===a.body?h=t[1]:(h=()=>mn(a.body),t[0]=a.body,t[1]=h);let g=(0,Q.useState)(h)[0],[_,v]=(0,Q.useState)(g.type),[y,b]=(0,Q.useState)(g.properties),[x,S]=(0,Q.useState)(g.markdown),[C,w]=(0,Q.useState)(!1),[T,E]=(0,Q.useState)(!1),[D,O]=(0,Q.useState)(!1),k;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(k=function(e,t){b(n=>n.map(n=>n.id===e?{...n,...t}:n))},t[2]=k):k=t[2];let A=k,j;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(j=function(){b(_n)},t[3]=j):j=t[3];let M=j,N;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(N=function(e){b(t=>t.filter(t=>t.id!==e))},t[4]=N):N=t[4];let P=N,F;t[5]!==n||t[6]!==T?(F=function(e){u(e),n===`create`&&!T&&f(un(e))},t[5]=n,t[6]=T,t[7]=F):F=t[7];let I=F,L;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(L=function(e){f(e),E(!0)},t[8]=L):L=t[8];let R=L,z=n===`edit`&&c===`local`,B=n===`create`||z,ee;t[9]===l?ee=t[10]:(ee=l.trim(),t[9]=l,t[10]=ee);let te=ee,V,ne,H,U;t[11]!==o||t[12]!==n||t[13]!==d||t[14]!==B||t[15]!==te?(U=d.trim(),H=te===``,V=B&&(U===``||!ln.test(U)),ne=n===`create`&&!V&&(o?.has(U)??!1),t[11]=o,t[12]=n,t[13]=d,t[14]=B,t[15]=te,t[16]=V,t[17]=ne,t[18]=H,t[19]=U):(V=t[16],ne=t[17],H=t[18],U=t[19]);let W=ne,re=!C&&!H&&!V,G;t[20]!==x||t[21]!==z||t[22]!==re||t[23]!==p||t[24]!==r||t[25]!==a.name||t[26]!==n||t[27]!==s||t[28]!==y||t[29]!==l||t[30]!==U||t[31]!==te||t[32]!==_?(G=async function(){if(!re){O(!0);return}w(!0);let e=dn({title:l,description:p}),t=hn({type:_,properties:y,markdown:x}),i=z&&U!==a.name,o=i?await Ne({fromFolder:r,fromName:a.name,toFolder:r,toName:U,frontmatter:e,body:t}):await Me({folder:r,name:n===`create`?U:a.name,frontmatter:e,body:t});if(w(!1),!o.ok){let{error:e}=o;J.error(n===`create`?Y._({id:`jdGUeI`,values:{error:e}}):Y._({id:`rQAQus`,values:{error:e}}));return}i?J.success(Y._({id:`YKLP_-`})):`warnings`in o&&o.warnings.length>0?J.warning(o.warnings.join(` `)):n===`create`?J.success(Y._({id:`06SZfb`,values:{trimmedTitle:te}})):J.success(Y._({id:`GamjcN`})),s(n===`create`||i?U:a.name)},t[20]=x,t[21]=z,t[22]=re,t[23]=p,t[24]=r,t[25]=a.name,t[26]=n,t[27]=s,t[28]=y,t[29]=l,t[30]=U,t[31]=te,t[32]=_,t[33]=G):G=t[33];let K=G,ie;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(ie=()=>O(!0),t[34]=ie):ie=t[34];let ae;return t[35]!==x||t[36]!==z||t[37]!==re||t[38]!==p||t[39]!==a.name||t[40]!==n||t[41]!==y||t[42]!==C||t[43]!==I||t[44]!==d||t[45]!==V||t[46]!==W||t[47]!==K||t[48]!==l||t[49]!==H||t[50]!==D||t[51]!==U||t[52]!==_?(ae={mode:n,title:l,slug:d,description:p,type:_,properties:y,body:x,setTitle:I,setSlug:R,setDescription:m,setType:v,setProperty:A,addProperty:M,removeProperty:P,setBody:S,markTitleTouched:ie,titleTouched:D,isSaving:C,canSubmit:re,titleInvalid:H,slugInvalid:V,slugShadows:W,trimmedSlug:U,fixedName:a.name,canRename:z,submit:K},t[35]=x,t[36]=z,t[37]=re,t[38]=p,t[39]=a.name,t[40]=n,t[41]=y,t[42]=C,t[43]=I,t[44]=d,t[45]=V,t[46]=W,t[47]=K,t[48]=l,t[49]=H,t[50]=D,t[51]=U,t[52]=_,t[53]=ae):ae=t[53],ae}function _n(e){return[...e,{id:pn(),key:``,value:``}]}function vn(e){let t=(0,Z.c)(72),{form:n,bodyPlaceholder:r}=e,{_:i}=u(),a=(0,Q.useId)(),o=(0,Q.useId)(),s=(0,Q.useId)(),c=n.titleTouched&&n.titleInvalid,{fixedName:d}=n,f,p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(l,{id:`MHrjPM`}),p=(0,$.jsx)(`span`,{className:`text-destructive`,children:`*`}),t[0]=f,t[1]=p):(f=t[0],p=t[1]);let m;t[2]===a?m=t[3]:(m=(0,$.jsxs)(lt,{htmlFor:a,children:[f,p]}),t[2]=a,t[3]=m);let h=n.title,g;t[4]===n?g=t[5]:(g=e=>n.setTitle(e.target.value),t[4]=n,t[5]=g);let _=n.markTitleTouched,v;t[6]===i?v=t[7]:(v=i({id:`KWL_Ih`}),t[6]=i,t[7]=v);let y;t[8]!==n.isSaving||t[9]!==n.markTitleTouched||t[10]!==n.title||t[11]!==a||t[12]!==c||t[13]!==g||t[14]!==v?(y=(0,$.jsx)($e,{id:a,"data-testid":`template-name-input`,value:h,onChange:g,onBlur:_,placeholder:v,disabled:n.isSaving,"aria-invalid":c}),t[8]=n.isSaving,t[9]=n.markTitleTouched,t[10]=n.title,t[11]=a,t[12]=c,t[13]=g,t[14]=v,t[15]=y):y=t[15];let b;t[16]===c?b=t[17]:(b=c?(0,$.jsx)(st,{children:(0,$.jsx)(l,{id:`V_wltx`})}):null,t[16]=c,t[17]=b);let x;t[18]!==m||t[19]!==y||t[20]!==b?(x=(0,$.jsxs)(ft,{children:[m,y,b]}),t[18]=m,t[19]=y,t[20]=b,t[21]=x):x=t[21];let S;t[22]!==d||t[23]!==n?(S=n.mode===`create`?(0,$.jsx)(bn,{form:n}):n.canRename?(0,$.jsx)(xn,{form:n}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,$.jsx)(l,{id:`NjrIak`,values:{fixedName:d},components:{0:(0,$.jsx)(`code`,{className:`font-mono`})}})}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,$.jsx)(l,{id:`jSO1X5`})})]}),t[22]=d,t[23]=n,t[24]=S):S=t[24];let C;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(l,{id:`Nu4oKW`}),t[25]=C):C=t[25];let w;t[26]===o?w=t[27]:(w=(0,$.jsx)(lt,{htmlFor:o,children:C}),t[26]=o,t[27]=w);let T=n.description,E;t[28]===n?E=t[29]:(E=e=>n.setDescription(e.target.value),t[28]=n,t[29]=E);let D;t[30]===i?D=t[31]:(D=i({id:`3FMvls`}),t[30]=i,t[31]=D);let O;t[32]!==o||t[33]!==n.description||t[34]!==n.isSaving||t[35]!==E||t[36]!==D?(O=(0,$.jsx)(mt,{id:o,value:T,onChange:E,placeholder:D,disabled:n.isSaving,rows:2}),t[32]=o,t[33]=n.description,t[34]=n.isSaving,t[35]=E,t[36]=D,t[37]=O):O=t[37];let k;t[38]!==w||t[39]!==O?(k=(0,$.jsxs)(ft,{children:[w,O]}),t[38]=w,t[39]=O,t[40]=k):k=t[40];let A;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,$.jsx)(l,{id:`-zy2Nq`}),t[41]=A):A=t[41];let j;t[42]===s?j=t[43]:(j=(0,$.jsx)(lt,{htmlFor:s,children:A}),t[42]=s,t[43]=j);let M=n.type,N;t[44]===n?N=t[45]:(N=e=>n.setType(e.target.value),t[44]=n,t[45]=N);let P;t[46]===i?P=t[47]:(P=i({id:`o9CrsQ`}),t[46]=i,t[47]=P);let F;t[48]!==n.isSaving||t[49]!==n.type||t[50]!==N||t[51]!==P||t[52]!==s?(F=(0,$.jsx)($e,{id:s,value:M,onChange:N,placeholder:P,disabled:n.isSaving,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,className:`font-mono`}),t[48]=n.isSaving,t[49]=n.type,t[50]=N,t[51]=P,t[52]=s,t[53]=F):F=t[53];let I;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,$.jsx)(ut,{children:(0,$.jsx)(l,{id:`ipn17C`,components:{0:(0,$.jsx)(`code`,{className:`font-mono`}),1:(0,$.jsx)(`code`,{className:`font-mono`})}})}),t[54]=I):I=t[54];let L;t[55]!==j||t[56]!==F?(L=(0,$.jsxs)(ft,{children:[j,F,I]}),t[55]=j,t[56]=F,t[57]=L):L=t[57];let R;t[58]===n?R=t[59]:(R=(0,$.jsx)(yn,{form:n}),t[58]=n,t[59]=R);let z;t[60]!==r||t[61]!==n.body||t[62]!==n.isSaving||t[63]!==n.setBody?(z=(0,$.jsx)(cn,{value:n.body,onChange:n.setBody,disabled:n.isSaving,placeholder:r}),t[60]=r,t[61]=n.body,t[62]=n.isSaving,t[63]=n.setBody,t[64]=z):z=t[64];let B;return t[65]!==x||t[66]!==S||t[67]!==k||t[68]!==L||t[69]!==R||t[70]!==z?(B=(0,$.jsxs)(ot,{children:[x,S,k,L,R,z]}),t[65]=x,t[66]=S,t[67]=k,t[68]=L,t[69]=R,t[70]=z,t[71]=B):B=t[71],B}function yn(e){let t=(0,Z.c)(12),{form:n}=e,{_:r}=u(),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(lt,{children:(0,$.jsx)(l,{id:`-WFFG2`})}),t[0]=i):i=t[0];let a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(ut,{children:(0,$.jsx)(l,{id:`zrP8HX`,components:{0:(0,$.jsx)(`code`,{className:`font-mono`}),1:(0,$.jsx)(`code`,{className:`font-mono`})}})}),t[1]=a):a=t[1];let o;t[2]!==r||t[3]!==n?(o=n.properties.length>0?(0,$.jsx)(`div`,{className:`flex flex-col gap-2`,children:n.properties.map(e=>(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)($e,{"aria-label":r({id:`56xUL1`}),value:e.key,onChange:t=>n.setProperty(e.id,{key:t.target.value}),placeholder:r({id:`Aq-O0x`}),disabled:n.isSaving,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,className:`font-mono w-1/3`}),(0,$.jsx)($e,{"aria-label":r({id:`iKZkk1`}),value:e.value,onChange:t=>n.setProperty(e.id,{value:t.target.value}),placeholder:r({id:`jEZ6Lf`}),disabled:n.isSaving,spellCheck:!1,className:`font-mono flex-1`}),(0,$.jsx)(b,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":r({id:`rNifQd`}),onClick:()=>n.removeProperty(e.id),disabled:n.isSaving,children:(0,$.jsx)(ze,{"aria-hidden":`true`})})]},e.id))}):null,t[2]=r,t[3]=n,t[4]=o):o=t[4];let s;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(l,{id:`F-NRCj`}),t[5]=s):s=t[5];let c;t[6]!==n.addProperty||t[7]!==n.isSaving?(c=(0,$.jsx)(b,{type:`button`,variant:`outline`,size:`sm`,className:`self-start`,onClick:n.addProperty,disabled:n.isSaving,children:s}),t[6]=n.addProperty,t[7]=n.isSaving,t[8]=c):c=t[8];let d;return t[9]!==o||t[10]!==c?(d=(0,$.jsxs)(ft,{children:[i,a,o,c]}),t[9]=o,t[10]=c,t[11]=d):d=t[11],d}function bn(e){let t=(0,Z.c)(34),{form:n}=e,{_:r}=u(),i=(0,Q.useId)(),[a,o]=(0,Q.useState)(!1),s=a||n.titleTouched&&(n.slugInvalid||n.slugShadows),{slug:c,trimmedSlug:d}=n;if(!s){if(d===``)return null;let e;t[0]===c?e=t[1]:(e={slug:c},t[0]=c,t[1]=e);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r={0:(0,$.jsx)(`code`,{className:`font-mono`})},t[2]=r):r=t[2];let i;t[3]===e?i=t[4]:(i=(0,$.jsx)(l,{id:`Pgu10b`,values:e,components:r}),t[3]=e,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>o(!0),t[5]=a):a=t[5];let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(l,{id:`ePK91l`}),t[6]=s):s=t[6];let u;t[7]===n.isSaving?u=t[8]:(u=(0,$.jsx)(b,{type:`button`,variant:`link`,className:`h-auto p-0 align-baseline text-xs font-mono uppercase`,onClick:a,disabled:n.isSaving,children:s}),t[7]=n.isSaving,t[8]=u);let f;return t[9]!==i||t[10]!==u?(f=(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[i,` `,u]}),t[9]=i,t[10]=u,t[11]=f):f=t[11],f}let f;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(l,{id:`GN6L5F`}),t[12]=f):f=t[12];let p;t[13]===i?p=t[14]:(p=(0,$.jsx)(lt,{htmlFor:i,children:f}),t[13]=i,t[14]=p);let m;t[15]===n?m=t[16]:(m=e=>n.setSlug(e.target.value),t[15]=n,t[16]=m);let h;t[17]===r?h=t[18]:(h=r({id:`tjXez2`}),t[17]=r,t[18]=h);let g;t[19]!==n.isSaving||t[20]!==n.slugInvalid||t[21]!==c||t[22]!==i||t[23]!==m||t[24]!==h?(g=(0,$.jsx)($e,{id:i,value:c,onChange:m,placeholder:h,disabled:n.isSaving,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,"aria-invalid":n.slugInvalid,className:`font-mono`}),t[19]=n.isSaving,t[20]=n.slugInvalid,t[21]=c,t[22]=i,t[23]=m,t[24]=h,t[25]=g):g=t[25];let _;t[26]!==n.slugInvalid||t[27]!==n.slugShadows||t[28]!==d?(_=n.slugInvalid?(0,$.jsx)(st,{children:(0,$.jsx)(l,{id:`l_FAT6`,components:{0:(0,$.jsx)(`code`,{className:`font-mono`}),1:(0,$.jsx)(`code`,{className:`font-mono`})}})}):n.slugShadows?(0,$.jsx)(ut,{className:`text-yellow-600 dark:text-yellow-500`,children:(0,$.jsx)(l,{id:`jwnpdM`,values:{trimmedSlug:d},components:{0:(0,$.jsx)(`code`,{className:`font-mono`})}})}):(0,$.jsx)(ut,{children:(0,$.jsx)(l,{id:`TsZmgr`})}),t[26]=n.slugInvalid,t[27]=n.slugShadows,t[28]=d,t[29]=_):_=t[29];let v;return t[30]!==p||t[31]!==g||t[32]!==_?(v=(0,$.jsxs)(ft,{children:[p,g,_]}),t[30]=p,t[31]=g,t[32]=_,t[33]=v):v=t[33],v}function xn(e){let t=(0,Z.c)(20),{form:n}=e,{_:r}=u(),i=(0,Q.useId)(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(l,{id:`GN6L5F`}),t[0]=a):a=t[0];let o;t[1]===i?o=t[2]:(o=(0,$.jsx)(lt,{htmlFor:i,children:a}),t[1]=i,t[2]=o);let s=n.slug,c;t[3]===n?c=t[4]:(c=e=>n.setSlug(e.target.value),t[3]=n,t[4]=c);let d;t[5]===r?d=t[6]:(d=r({id:`tjXez2`}),t[5]=r,t[6]=d);let f;t[7]!==n.isSaving||t[8]!==n.slug||t[9]!==n.slugInvalid||t[10]!==i||t[11]!==c||t[12]!==d?(f=(0,$.jsx)($e,{id:i,value:s,onChange:c,placeholder:d,disabled:n.isSaving,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,"aria-invalid":n.slugInvalid,className:`font-mono`}),t[7]=n.isSaving,t[8]=n.slug,t[9]=n.slugInvalid,t[10]=i,t[11]=c,t[12]=d,t[13]=f):f=t[13];let p;t[14]===n.slugInvalid?p=t[15]:(p=n.slugInvalid?(0,$.jsx)(st,{children:(0,$.jsx)(l,{id:`l_FAT6`,components:{0:(0,$.jsx)(`code`,{className:`font-mono`}),1:(0,$.jsx)(`code`,{className:`font-mono`})}})}):(0,$.jsx)(ut,{children:(0,$.jsx)(l,{id:`FvMSms`})}),t[14]=n.slugInvalid,t[15]=p);let m;return t[16]!==o||t[17]!==f||t[18]!==p?(m=(0,$.jsxs)(ft,{children:[o,f,p]}),t[16]=o,t[17]=f,t[18]=p,t[19]=m):m=t[19],m}var Sn={name:``,title:``,description:``,body:``},Cn=`## Overview
|
|
7
|
+
|
|
8
|
+
(Replace with the starting content for new documents.)
|
|
9
|
+
`;function wn(e){let t=(0,Z.c)(12),{folderPath:n,existingNames:r,open:i,onOpenChange:a,onCreated:o}=e,s;t[0]!==r||t[1]!==n||t[2]!==o||t[3]!==a||t[4]!==i?(s=i?(0,$.jsx)(Tn,{folderPath:n,existingNames:r,onOpenChange:a,onCreated:o}):null,t[0]=r,t[1]=n,t[2]=o,t[3]=a,t[4]=i,t[5]=s):s=t[5];let c;t[6]===s?c=t[7]:(c=(0,$.jsx)(A,{className:`sm:max-w-3xl max-h-[85vh] flex flex-col`,children:s}),t[6]=s,t[7]=c);let l;return t[8]!==a||t[9]!==i||t[10]!==c?(l=(0,$.jsx)(P,{open:i,onOpenChange:a,children:c}),t[8]=a,t[9]=i,t[10]=c,t[11]=l):l=t[11],l}function Tn(e){let t=(0,Z.c)(31),{folderPath:n,existingNames:r,onOpenChange:i,onCreated:a}=e,o;t[0]!==a||t[1]!==i?(o=e=>{a(e),i(!1)},t[0]=a,t[1]=i,t[2]=o):o=t[2];let s;t[3]!==r||t[4]!==n||t[5]!==o?(s={mode:`create`,folderPath:n,initial:Sn,existingNames:r,onCommitted:o},t[3]=r,t[4]=n,t[5]=o,t[6]=s):s=t[6];let c=gn(s),u;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(k,{children:(0,$.jsx)(l,{id:`G1Gw0v`})}),t[7]=u):u=t[7];let d;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsxs)(N,{children:[u,(0,$.jsx)(O,{children:(0,$.jsx)(l,{id:`NUr4kz`})})]}),t[8]=d):d=t[8];let f;t[9]===c?f=t[10]:(f=(0,$.jsx)(j,{children:(0,$.jsx)(vn,{form:c,bodyPlaceholder:Cn})}),t[9]=c,t[10]=f);let p;t[11]===i?p=t[12]:(p=()=>i(!1),t[11]=i,t[12]=p);let m;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsx)(l,{id:`dEgA5A`}),t[13]=m):m=t[13];let h;t[14]!==c.isSaving||t[15]!==p?(h=(0,$.jsx)(b,{variant:`outline`,className:`font-mono uppercase`,onMouseDown:En,onClick:p,disabled:c.isSaving,children:m}),t[14]=c.isSaving,t[15]=p,t[16]=h):h=t[16];let g;t[17]===c?g=t[18]:(g=()=>void c.submit(),t[17]=c,t[18]=g);let _;t[19]===c.isSaving?_=t[20]:(_=c.isSaving?(0,$.jsx)(l,{id:`E9bKSA`}):(0,$.jsx)(l,{id:`A5hiCy`}),t[19]=c.isSaving,t[20]=_);let v;t[21]!==c.isSaving||t[22]!==_||t[23]!==g?(v=(0,$.jsx)(b,{onClick:g,disabled:c.isSaving,children:_}),t[21]=c.isSaving,t[22]=_,t[23]=g,t[24]=v):v=t[24];let y;t[25]!==v||t[26]!==h?(y=(0,$.jsxs)(M,{children:[h,v]}),t[25]=v,t[26]=h,t[27]=y):y=t[27];let x;return t[28]!==y||t[29]!==f?(x=(0,$.jsxs)($.Fragment,{children:[d,f,y]}),t[28]=y,t[29]=f,t[30]=x):x=t[30],x}function En(e){return e.preventDefault()}function Dn(e){let t=(0,Z.c)(16),{template:n,onOpenChange:r,onDeleted:i}=e,{_:a}=u(),[o,s]=(0,Q.useState)(!1),c;t[0]!==a||t[1]!==i||t[2]!==r?(c=async function(e){s(!0);let t=await Pe(e.source_folder,e.name);if(s(!1),!t.ok){let{error:e}=t;J.error(a({id:`36WXSC`,values:{error:e}}));return}let n=e.title??e.name;J.success(a({id:`ErRi6L`,values:{label:n}})),i(),r(!1)},t[0]=a,t[1]=i,t[2]=r,t[3]=c):c=t[3];let l=c,d=n!==null,f;t[4]!==o||t[5]!==r?(f=e=>{!e&&!o&&r(!1)},t[4]=o,t[5]=r,t[6]=f):f=t[6];let p;t[7]!==a||t[8]!==o||t[9]!==l||t[10]!==n?(p=n?(()=>{let{name:e,path:t,scope:r}=n,i=r===`inherited`?`\n\n${a({id:`8uAWix`})}`:``;return(0,$.jsx)(_,{itemName:a({id:`XfzqjK`,values:{name:e}}),isSubmitting:o,onDelete:()=>l(n),customDescription:`${a({id:`5LXwX8`,values:{path:t}})}${i}`})})():null,t[7]=a,t[8]=o,t[9]=l,t[10]=n,t[11]=p):p=t[11];let m;return t[12]!==d||t[13]!==f||t[14]!==p?(m=(0,$.jsx)(F,{open:d,onOpenChange:f,children:p}),t[12]=d,t[13]=f,t[14]=p,t[15]=m):m=t[15],m}function On(e){let t=(0,Z.c)(45),{template:n,onEdit:r,onDelete:a,onCreate:o,badge:s}=e,{_:c}=u(),d=n.title??n.name,f=!!(n.title&&n.title!==n.name),p;t[0]===d?p=t[1]:(p=(0,$.jsx)(`span`,{className:`truncate font-medium`,children:d}),t[0]=d,t[1]=p);let m;t[2]!==f||t[3]!==n.name?(m=f?(0,$.jsx)(`code`,{className:`shrink-0 font-mono text-xs text-muted-foreground`,children:n.name}):null,t[2]=f,t[3]=n.name,t[4]=m):m=t[4];let _;t[5]===s?_=t[6]:(_=s?(0,$.jsx)(`span`,{className:`ml-auto shrink-0`,children:s}):null,t[5]=s,t[6]=_);let v;t[7]!==p||t[8]!==m||t[9]!==_?(v=(0,$.jsxs)(`span`,{className:`flex w-full items-center gap-2`,children:[p,m,_]}),t[7]=p,t[8]=m,t[9]=_,t[10]=v):v=t[10];let y;t[11]===n.description?y=t[12]:(y=n.description?(0,$.jsx)(`span`,{className:`w-full truncate text-sm text-muted-foreground`,children:n.description}):null,t[11]=n.description,t[12]=y);let x;t[13]!==r||t[14]!==v||t[15]!==y?(x=(0,$.jsxs)(b,{type:`button`,variant:`ghost`,onClick:r,className:`h-auto min-w-0 flex-1 flex-col items-start gap-0.5 px-1.5 py-1 text-left font-normal hover:bg-transparent`,children:[v,y]}),t[13]=r,t[14]=v,t[15]=y,t[16]=x):x=t[16];let S;t[17]!==c||t[18]!==d||t[19]!==o?(S=o?(0,$.jsxs)(b,{type:`button`,variant:`ghost`,size:`sm`,className:`shrink-0 font-mono uppercase opacity-0 group-hover:opacity-100 focus-visible:opacity-100`,onClick:o,"aria-label":c({id:`mZ1r4i`,values:{label:d}}),children:[(0,$.jsx)(g,{className:`size-3.5`,"aria-hidden":!0}),(0,$.jsx)(l,{id:`hYgDIe`})]}):null,t[17]=c,t[18]=d,t[19]=o,t[20]=S):S=t[20];let C;t[21]!==c||t[22]!==d?(C=c({id:`Bx4EXG`,values:{label:d}}),t[21]=c,t[22]=d,t[23]=C):C=t[23];let w;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(h,{className:`size-4`,"aria-hidden":!0}),t[24]=w):w=t[24];let T;t[25]===C?T=t[26]:(T=(0,$.jsx)(R,{asChild:!0,children:(0,$.jsx)(b,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0 opacity-0 group-hover:opacity-100 focus-visible:opacity-100 data-[state=open]:opacity-100`,"aria-label":C,children:w})}),t[25]=C,t[26]=T);let E,D;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(i,{"aria-hidden":!0}),D=(0,$.jsx)(l,{id:`ePK91l`}),t[27]=E,t[28]=D):(E=t[27],D=t[28]);let O;t[29]===r?O=t[30]:(O=(0,$.jsxs)(L,{onSelect:r,children:[E,D]}),t[29]=r,t[30]=O);let k,A;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,$.jsx)(Le,{"aria-hidden":!0}),A=(0,$.jsx)(l,{id:`cnGeoo`}),t[31]=k,t[32]=A):(k=t[31],A=t[32]);let j;t[33]===a?j=t[34]:(j=(0,$.jsxs)(L,{variant:`destructive`,onSelect:a,children:[k,A]}),t[33]=a,t[34]=j);let M;t[35]!==O||t[36]!==j?(M=(0,$.jsxs)(z,{align:`end`,className:`min-w-52`,children:[O,j]}),t[35]=O,t[36]=j,t[37]=M):M=t[37];let N;t[38]!==T||t[39]!==M?(N=(0,$.jsxs)(B,{modal:!1,children:[T,M]}),t[38]=T,t[39]=M,t[40]=N):N=t[40];let P;return t[41]!==N||t[42]!==x||t[43]!==S?(P=(0,$.jsxs)(`li`,{className:`group flex items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-muted/50`,children:[x,S,N]}),t[41]=N,t[42]=x,t[43]=S,t[44]=P):P=t[44],P}function kn(){let e=(0,Z.c)(8),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]=(0,Q.useState)(!1),c;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=!1;return r({status:`loading`}),fetch(`/api/skill-targets`).then(jn).then(t=>{if(e)return;let n=le.safeParse(t);if(!n.success){console.error(`[ok-skills] /api/skill-targets response failed schema validation:`,n.error.issues),r({status:`error`,message:Y._({id:`PXaT32`})});return}r({status:`ready`,data:n.data})}).catch(t=>{e||r({status:`error`,message:t instanceof Error?t.message:String(t)})}),()=>{e=!0}},e[1]=c):c=e[1];let l;e[2]===i?l=e[3]:(l=[i],e[2]=i,e[3]=l),(0,Q.useEffect)(c,l);let u;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(u=async e=>{s(!0);let t=await Ge(e);if(!t.ok)throw s(!1),Error(t.error);if(e.preview)return s(!1),t.preview;pe(),a(An),s(!1)},e[4]=u):u=e[4];let d=u,f;return e[5]!==o||e[6]!==n?(f={state:n,saving:o,folderAction:d},e[5]=o,e[6]=n,e[7]=f):f=e[7],f}function An(e){return e+1}async function jn(e){if(!e.ok){let t=await e.json().catch(Mn);throw Error(_e(t)??`HTTP ${e.status}`)}return e.json()}function Mn(){return null}function Nn(e){let t=(0,Z.c)(2);if(!e.bundle)return null;let n;return t[0]===e?n=t[1]:(n=(0,$.jsx)(Pn,{...e,bundle:e.bundle}),t[0]=e,t[1]=n),n}function Pn(e){let t=(0,Z.c)(118),{bundle:n,source:r,defaultScope:i,installOverride:a,onInstalled:o,onOpenChange:s,returnFocus:c}=e,{_:d}=u(),f=(0,Q.useId)(),p=Xe(),[m,h]=(0,Q.useState)(a?.scope??i),g;t[0]!==n.names||t[1]!==a?(g=()=>a?new Set(n.names):new Set,t[0]=n.names,t[1]=a,t[2]=g):g=t[2];let[_,x]=(0,Q.useState)(g),[S,C]=(0,Q.useState)(!1),w;t[3]===n.descriptions?w=t[4]:(w=()=>new Map(Object.entries(n.descriptions??{})),t[3]=n.descriptions,t[4]=w);let[T,E]=(0,Q.useState)(w),D=kn(),[F,L]=(0,Q.useState)(null),R=D.state.status===`ready`?D.state.data.targets:null,z;t[5]!==R||t[6]!==F?(z=F??new Set(R??[]),t[5]=R,t[6]=F,t[7]=z):z=t[7];let B=z,W=pt(),re=W.status===`ready`?W.data.find(e=>e.scope===m)?.installableEditors:void 0,G=v.filter(e=>!re||re.includes(e)||B.has(e)),K;t[8]!==m||t[9]!==W.data||t[10]!==W.status?(K=W.status===`ready`?new Set(W.data.filter(e=>e.scope===m).map(Bn)):new Set,t[8]=m,t[9]=W.data,t[10]=W.status,t[11]=K):K=t[11];let ie=K,ae;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(ae=new Set,t[12]=ae):ae=t[12];let[oe,se]=(0,Q.useState)(ae),ce=new Set;if(D.state.status===`ready`){let e;t[13]===D.state.data.folders?e=t[14]:(e=D.state.data.folders??[],t[13]=D.state.data.folders,t[14]=e);for(let t of e)t.scope===m&&(v.includes(t.host)||t.root&&ce.add(t.root))}if(W.status===`ready`){for(let e of W.data)if(e.scope===m)for(let t of e.customPlacements??[]){let e=Ze(t);e&&ce.add(e)}}let le=[...ce].sort(),q=a!==void 0,de,fe;t[15]!==r||t[16]!==q?(de=()=>{if(q)return;let e=new AbortController;return qe(r,e.signal).then(t=>{e.signal.aborted||!t.ok||E(new Map(t.skills.map(zn)))}),()=>e.abort()},fe=[r,q],t[15]=r,t[16]=q,t[17]=de,t[18]=fe):(de=t[17],fe=t[18]),(0,Q.useEffect)(de,fe);let{plugin:Y,names:pe}=n,me;if(t[19]!==ie||t[20]!==pe){let e;t[22]===ie?e=t[23]:(e=e=>!ie.has(e),t[22]=ie,t[23]=e),me=pe.filter(e),t[19]=ie,t[20]=pe,t[21]=me}else me=t[21];let he=me,ge=_.size===he.length&&he.length>0,_e;t[24]===_?_e=t[25]:(_e=function(e,t){let n=new Set(_);t?n.add(e):n.delete(e),x(n)},t[24]=_,t[25]=_e);let ve=_e,X;t[26]!==d||t[27]!==oe||t[28]!==B||t[29]!==a||t[30]!==o||t[31]!==s||t[32]!==Y||t[33]!==m||t[34]!==_||t[35]!==r?(X=async function(){if(C(!0),a){let e=await a.installSelected([..._]);if(C(!1),e===null)return;e.size>0&&o?.(e),s(!1);return}let e=await Je({source:r,skills:[..._],scope:m,install:!1,marketplace:!0});if(!e.ok){C(!1),J.error(d({id:`Lbl6KA`,values:{0:Y??r,1:e.error}}));return}let t=e.results.map(Rn).filter(Ln),n=[...B];if(n.length>0)for(let e of t){let t=await Ke({scope:m,name:e,targets:n,linkMode:!0});t.ok||J.error(d({id:`1oSHI0`,values:{0:t.error,skillName:e}}))}for(let e of oe)for(let n of t){let t=await Ye({scope:m,name:n,dir:e,mode:`link`});t.ok||J.error(d({id:`OkC7-2`,values:{0:t.error,skillName:n,root:e}}))}C(!1);let{imported:i,alreadyImported:c,failed:l}=e;if(l>0){let t=e.results.filter(In).map(Fn).join(`, `);J.error(d({id:`cMMb6H`,values:{imported:i,failed:l,failedNames:t}}))}else i===0?J.info(d({id:`uJfwF8`})):c>0?J.success(d({id:`tkIXtS`,values:{imported:i,alreadyImported:c}})):J.success(d({id:`-kKdCC`,values:{0:Y??r,imported:i}}));let u=new Map;for(let t of e.results)t.status!==`imported`&&t.status!==`already-imported`||u.set(t.requested,t.name??t.requested);u.size>0&&o?.(u),s(!1)},t[26]=d,t[27]=oe,t[28]=B,t[29]=a,t[30]=o,t[31]=s,t[32]=Y,t[33]=m,t[34]=_,t[35]=r,t[36]=X):X=t[36];let ye=X,be=P,xe;t[37]!==S||t[38]!==s?(xe=e=>{!e&&!S&&s(!1)},t[37]=S,t[38]=s,t[39]=xe):xe=t[39];let Se=A,Ce;t[40]===c?Ce=t[41]:(Ce=e=>{c&&(e.preventDefault(),c())},t[40]=c,t[41]=Ce);let we;t[42]!==Y||t[43]!==r?(we=(0,$.jsx)(k,{children:Y?(0,$.jsx)(l,{id:`J86siq`,values:{plugin:Y}}):(0,$.jsx)(l,{id:`Q-DKvr`,values:{source:r}})}),t[42]=Y,t[43]=r,t[44]=we):we=t[44];let Te;t[45]===Y?Te=t[46]:(Te=(0,$.jsx)(O,{children:Y?(0,$.jsx)(l,{id:`lj4cNf`}):(0,$.jsx)(l,{id:`4mDIcg`})}),t[45]=Y,t[46]=Te);let Ee;t[47]!==we||t[48]!==Te?(Ee=(0,$.jsxs)(N,{children:[we,Te]}),t[47]=we,t[48]=Te,t[49]=Ee):Ee=t[49];let De=j,Oe;t[50]!==he.length||t[51]!==_.size?(Oe=(0,$.jsx)(`p`,{className:`font-medium text-xs font-mono text-foreground/70 uppercase tracking-wider`,children:(0,$.jsx)(l,{id:`lUtr1r`,values:{0:_.size,1:he.length}})}),t[50]=he.length,t[51]=_.size,t[52]=Oe):Oe=t[52];let ke;t[53]!==ge||t[54]!==he?(ke=()=>x(ge?new Set:new Set(he)),t[53]=ge,t[54]=he,t[55]=ke):ke=t[55];let Ae;t[56]===ge?Ae=t[57]:(Ae=ge?(0,$.jsx)(l,{id:`xCJdfg`}):(0,$.jsx)(l,{id:`wgNoIs`}),t[56]=ge,t[57]=Ae);let je;t[58]!==S||t[59]!==ke||t[60]!==Ae?(je=(0,$.jsx)(b,{variant:`ghost`,size:`sm`,disabled:S,onClick:ke,children:Ae}),t[58]=S,t[59]=ke,t[60]=Ae,t[61]=je):je=t[61];let Me;t[62]!==Oe||t[63]!==je?(Me=(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[Oe,je]}),t[62]=Oe,t[63]=je,t[64]=Me):Me=t[64];let Ne;if(t[65]!==S||t[66]!==T||t[67]!==ie||t[68]!==pe||t[69]!==_||t[70]!==ve){let e;t[72]!==S||t[73]!==T||t[74]!==ie||t[75]!==_||t[76]!==ve?(e=e=>{let t=T.get(e),n=ie.has(e);return(0,$.jsxs)(ee,{className:`flex cursor-pointer items-start gap-3 p-3 text-sm font-normal hover:bg-muted/40`,children:[(0,$.jsx)(I,{checked:n||_.has(e),disabled:S||n,onCheckedChange:t=>ve(e,t===!0),className:`mt-0.5`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,$.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`font-mono`,children:e}),n?(0,$.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground uppercase tracking-wide`,children:(0,$.jsx)(l,{id:`eQkgKV`})}):null]}),t?(0,$.jsx)(`span`,{className:`text-1sm text-muted-foreground line-clamp-2`,children:t}):null]})]},e)},t[72]=S,t[73]=T,t[74]=ie,t[75]=_,t[76]=ve,t[77]=e):e=t[77],Ne=pe.map(e),t[65]=S,t[66]=T,t[67]=ie,t[68]=pe,t[69]=_,t[70]=ve,t[71]=Ne}else Ne=t[71];let Pe;t[78]===Ne?Pe=t[79]:(Pe=(0,$.jsx)(`div`,{className:`max-h-72 overflow-y-auto rounded-md border border-border divide-y divide-border`,children:Ne}),t[78]=Ne,t[79]=Pe);let Ie;t[80]===m?Ie=t[81]:(Ie=m===`project`?(0,$.jsx)(l,{id:`oVW7VD`}):(0,$.jsx)(l,{id:`7HY6fA`}),t[80]=m,t[81]=Ie);let Le=q?null:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{"aria-hidden":!0,children:`·`}),B.size+oe.size>0?(0,$.jsx)(y,{hosts:[...B,...oe],iconClassName:`size-3.5`}):(0,$.jsx)(l,{id:`poAsUN`}),(0,$.jsxs)(rt,{children:[(0,$.jsx)(et,{asChild:!0,children:(0,$.jsx)(b,{variant:`link`,size:`sm`,className:`h-auto px-1`,disabled:S,"data-testid":`plugin-bundle-change-destination`,children:(0,$.jsx)(l,{id:`o-XJ9D`})})}),(0,$.jsxs)(tt,{align:`start`,className:`flex w-72 flex-col gap-4`,children:[(0,$.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(ee,{htmlFor:f,children:(0,$.jsx)(l,{id:`7MSbAT`})}),(0,$.jsxs)(U,{value:m,disabled:S,onValueChange:e=>h(e),children:[(0,$.jsx)(ne,{id:f,className:`w-full`,children:(0,$.jsx)(H,{})}),(0,$.jsx)(V,{children:Qe.map(e=>(0,$.jsx)(te,{value:e,children:p[e]},e))})]})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(ee,{children:(0,$.jsx)(l,{id:`Y5la_5`})}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-2`,children:[G.map(e=>(0,$.jsxs)(ee,{className:`flex cursor-pointer items-center gap-2 text-sm font-normal`,children:[(0,$.jsx)(I,{checked:B.has(e),disabled:S,onCheckedChange:t=>{let n=new Set(B);t===!0?n.add(e):n.delete(e),L(n)}}),ue[e]??e]},e)),le.map(e=>(0,$.jsxs)(ee,{className:`flex cursor-pointer items-center gap-2 font-normal text-sm`,children:[(0,$.jsx)(I,{checked:oe.has(e),disabled:S,onCheckedChange:t=>{let n=new Set(oe);t===!0?n.add(e):n.delete(e),se(n)}}),(0,$.jsx)(`span`,{className:`font-mono text-xs`,children:e})]},e))]})]})]})]})]}),Re;t[82]!==Ie||t[83]!==Le?(Re=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 text-1sm text-muted-foreground`,"data-testid":`plugin-bundle-destination`,children:[Ie,Le]}),t[82]=Ie,t[83]=Le,t[84]=Re):Re=t[84];let ze;t[85]!==De||t[86]!==Me||t[87]!==Pe||t[88]!==Re?(ze=(0,$.jsxs)(De,{className:`flex flex-col gap-4`,children:[Me,Pe,Re]}),t[85]=De,t[86]=Me,t[87]=Pe,t[88]=Re,t[89]=ze):ze=t[89];let Be;t[90]===s?Be=t[91]:(Be=()=>s(!1),t[90]=s,t[91]=Be);let Ve;t[92]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=(0,$.jsx)(l,{id:`dEgA5A`}),t[92]=Ve):Ve=t[92];let He;t[93]!==S||t[94]!==Be?(He=(0,$.jsx)(b,{variant:`outline`,className:`font-mono uppercase`,disabled:S,onClick:Be,children:Ve}),t[93]=S,t[94]=Be,t[95]=He):He=t[95];let Ue=S||_.size===0,We;t[96]===ye?We=t[97]:(We=()=>void ye(),t[96]=ye,t[97]=We);let Ge;t[98]!==S||t[99]!==_.size?(Ge=S?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Fe,{"aria-hidden":`true`,className:`size-4`}),(0,$.jsx)(l,{id:`Wtw22s`})]}):_.size===0?(0,$.jsx)(l,{id:`TKQ7K-`}):(0,$.jsx)(l,{id:`9XwoPv`,values:{0:_.size}}),t[98]=S,t[99]=_.size,t[100]=Ge):Ge=t[100];let $e;t[101]!==Ue||t[102]!==We||t[103]!==Ge?($e=(0,$.jsx)(b,{"data-testid":`plugin-bundle-install`,disabled:Ue,onClick:We,children:Ge}),t[101]=Ue,t[102]=We,t[103]=Ge,t[104]=$e):$e=t[104];let nt;t[105]!==He||t[106]!==$e?(nt=(0,$.jsxs)(M,{children:[He,$e]}),t[105]=He,t[106]=$e,t[107]=nt):nt=t[107];let it;t[108]!==Se||t[109]!==Ce||t[110]!==Ee||t[111]!==ze||t[112]!==nt?(it=(0,$.jsxs)(Se,{className:`sm:max-w-lg`,onCloseAutoFocus:Ce,children:[Ee,ze,nt]}),t[108]=Se,t[109]=Ce,t[110]=Ee,t[111]=ze,t[112]=nt,t[113]=it):it=t[113];let at;return t[114]!==be||t[115]!==xe||t[116]!==it?(at=(0,$.jsx)(be,{open:!0,onOpenChange:xe,children:it}),t[114]=be,t[115]=xe,t[116]=it,t[117]=at):at=t[117],at}function Fn(e){return e.requested}function In(e){return e.status===`failed`||e.status===`not-found`}function Ln(e){return typeof e==`string`}function Rn(e){return e.name}function zn(e){return[e.name,e.description]}function Bn(e){return e.name}var Vn=`claude-cowork`,Hn=`ok:skill:cowork:installed:v`,Un=250,Wn=`/api/skill/install-state`,Gn=null,Kn=new Set,qn=null,Jn=!1,Yn=()=>{sr(hr())},Xn=e=>{e.key?.startsWith(Hn)&&sr(hr())};function Zn(){Jn||typeof window>`u`||(window.addEventListener(`focus`,Yn),window.addEventListener(`storage`,Xn),Jn=!0)}function Qn(){Jn&&(typeof window>`u`||(window.removeEventListener(`focus`,Yn),window.removeEventListener(`storage`,Xn),Jn=!1))}var $n=!1,er=!1,tr=!1,nr=!1,rr=!1,ir=!1,ar=!1;async function or(e){let t=!0;if(e.detectClaudeDesktop)try{t=await e.detectClaudeDesktop()}catch(e){t=!0,$n||($n=!0,console.warn(`[claude-desktop-integration] detectClaudeDesktop IPC rejected — falling back to desktopPresent=true`,e))}let n=await e.fetchSnapshot();if(n){let e=n.targets?.[Vn]??null;return e?.version?{desktopPresent:t,skillInstalled:!0,skillVersion:e.version}:{desktopPresent:t,skillInstalled:!1,skillVersion:null}}let r=e.readLocalStorageGuard();return{desktopPresent:t,skillInstalled:r.skillInstalled,skillVersion:r.skillVersion}}async function sr(e){return qn||(qn=(async()=>{try{Gn=await or(e);for(let e of Kn)try{e()}catch(e){console.error(`[claude-desktop-integration] subscriber threw`,e)}}catch(e){console.error(`[claude-desktop-integration] probe rejected unexpectedly`,e)}finally{qn=null}})(),qn)}function cr(e){return Kn.size===0&&Zn(),Kn.add(e),()=>{Kn.delete(e),Kn.size===0&&Qn()}}function lr(){return Gn}function ur(){if(typeof window>`u`)return;let e=window.okDesktop?.skill,t=e?.detectClaudeDesktop;if(t)return()=>t.call(e)}function dr(e){let t=e?.timeoutMs??Un,n=e?.fetchImpl??(typeof fetch<`u`?fetch:void 0);return async()=>{if(!n)return null;let e;try{let r=new AbortController,i=setTimeout(()=>r.abort(),t);try{e=await n(Wn,{method:`GET`,cache:`no-store`,signal:r.signal})}finally{clearTimeout(i)}}catch(e){let n=e instanceof DOMException&&e.name===`AbortError`;return n&&!tr?(tr=!0,console.warn(`[claude-desktop-integration] fetch ${Wn} timed out (>${t}ms) — falling back to localStorage guard`)):!n&&!er&&(er=!0,console.warn(`[claude-desktop-integration] fetch ${Wn} failed — falling back to localStorage guard`,e)),null}if(!e.ok)return nr||(nr=!0,console.warn(`[claude-desktop-integration] ${Wn} returned ${e.status} ${e.statusText} — falling back to localStorage guard`)),null;let r;try{r=await e.json()}catch(e){return rr||(rr=!0,console.warn(`[claude-desktop-integration] ${Wn} returned unparseable JSON — falling back to localStorage guard`,e)),null}return fr(r)}}function fr(e){if(typeof e!=`object`||!e)return pr(`not an object`);let t=e;if(typeof t.currentVersion!=`string`||t.currentVersion===``)return pr(`currentVersion not a non-empty string`);if(t.targets!==void 0){if(t.targets===null||typeof t.targets!=`object`)return pr(`targets not object`);for(let[,e]of Object.entries(t.targets)){if(e==null)continue;if(typeof e!=`object`)return pr(`target entry not object`);let t=e;if(typeof t.version!=`string`||t.version===``)return pr(`target.version not a non-empty string`)}}return t}function pr(e){return ir||(ir=!0,console.warn(`[claude-desktop-integration] ${Wn} response failed shape validation (${e}) — falling back to localStorage guard`)),null}function mr(){if(typeof localStorage>`u`)return{skillInstalled:!1,skillVersion:null};try{for(let e=0;e<localStorage.length;e++){let t=localStorage.key(e);if(t?.startsWith(Hn))return{skillInstalled:!0,skillVersion:t.slice(27)}}}catch(e){ar||(ar=!0,console.warn(`[claude-desktop-integration] localStorage scan threw — falling back to skillInstalled=false`,e))}return{skillInstalled:!1,skillVersion:null}}function hr(){return{detectClaudeDesktop:ur(),fetchSnapshot:dr(),readLocalStorageGuard:mr}}function gr(){let e=(0,Z.c)(5),t=(0,Q.useSyncExternalStore)(cr,lr,lr),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[],e[0]=n):n=e[0],(0,Q.useEffect)(vr,n);let r=t?.desktopPresent??!0,i=t?.skillInstalled??!1,a=t?.skillVersion??null,o;return e[1]!==r||e[2]!==i||e[3]!==a?(o={desktopPresent:r,skillInstalled:i,skillVersion:a,refresh:_r},e[1]=r,e[2]=i,e[3]=a,e[4]=o):o=e[4],o}function _r(){sr(hr())}function vr(){Gn||sr(hr())}function yr(){return typeof window<`u`&&window.okDesktop!=null}function br(){return yr()&&window.okDesktop?.config.ptyAvailable===!0}var xr=[{path:[`appearance`,`theme`],label:{id:`FEr96N`},description:{id:`JZ8cO6`},control:`theme-cards`},{path:[`appearance`,`language`],label:{id:`vXIe7J`},description:{id:`gUx34c`},control:`language-select`},{path:[`editor`,`wordWrap`],label:{id:`iKSP5j`},description:{id:`mmpzAq`}},{path:[`editor`,`previewTabs`],label:{id:`drzzZw`},description:{id:`AIC67-`}},{path:[`appearance`,`preview`,`autoOpen`],label:{id:`2XQ8Ww`},description:{id:`bultyE`}},{path:[`telemetry`,`skillInstallReports`,`enabled`],label:{id:`2jUGEP`},description:{id:`Ns0z5o`}}],Sr=[{path:[`appearance`,`colorThemeLight`],label:{id:`rFmBG3`},description:{id:`mnpsVn`},control:`theme-tiles`}],Cr=[{sectionId:`preferences`,fields:xr},{sectionId:`plugin:theme`,fields:Sr}];async function wr(){try{let e=await fetch(`/api/sync/conflicts`);return e.ok?{conflicts:(await e.json()).conflicts??[]}:(console.warn(JSON.stringify({event:`conflicts-fetch-failed`,status:e.status})),{conflicts:[],error:`server`})}catch(e){return console.warn(JSON.stringify({event:`conflicts-fetch-failed`,status:null,detail:e instanceof Error?e.message:String(e)})),{conflicts:[],error:`network`}}}function Tr(){let e=(0,Z.c)(10),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0];let[n,r]=(0,Q.useState)(t),[i,a]=(0,Q.useState)(!0),[o,s]=(0,Q.useState)(null),c=(0,Q.useRef)(0),l;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(l=function(){let e=c.current+=1;wr().then(t=>{let{conflicts:n,error:i}=t;e===c.current&&(r(n),s(i??null),a(!1))})},e[1]=l):l=e[1];let u=l,d,f;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>{u()},f=[],e[2]=d,e[3]=f):(d=e[2],f=e[3]),(0,Q.useEffect)(d,f);let p,m;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>me(e=>{e.includes(`sync-status`)&&u()}),m=[],e[4]=p,e[5]=m):(p=e[4],m=e[5]),(0,Q.useEffect)(p,m);let h;return e[6]!==n||e[7]!==o||e[8]!==i?(h={conflicts:n,loading:i,error:o},e[6]=n,e[7]=o,e[8]=i,e[9]=h):h=e[9],h}function Er(e){if(!e)return``;let t=e.replace(/[/\\]+$/g,``),n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return n<0?t:t.slice(n+1)}function Dr(e){let t=e.trim();return t.length===0?{kind:`blank`,raw:e}:t.startsWith(`#`)?{kind:`comment`,raw:e}:{kind:`pattern`,raw:e,text:t}}function Or(e){return{lines:e.split(`
|
|
10
|
+
`).map(Dr)}}function kr(e){return e.lines.map(e=>e.raw).join(`
|
|
11
|
+
`)}function Ar(e){return e.lines.filter(e=>e.kind===`pattern`)}function jr(e,t){let n=t.trim();if(n.length===0)return e;for(let t of e.lines)if(t.kind===`pattern`&&t.text===n)return e;let r={kind:`pattern`,raw:n,text:n},i=e.lines.slice(),a=i[i.length-1];return a&&a.kind===`blank`&&a.raw===``?i.splice(i.length-1,0,r):i.push(r,{kind:`blank`,raw:``}),{lines:i}}function Mr(e,t){let n=t.trim();if(n.length===0)return-1;let r=0;for(let t of e.lines)if(t.kind===`pattern`){if(t.text===n)return r;r++}return-1}function Nr(e,t,n){let r=n.trim();if(r.length===0)return Pr(e,t);let i=Ir(e,t);if(i<0)return e;let a=e.lines.slice();return a[i]={kind:`pattern`,raw:r,text:r},{lines:a}}function Pr(e,t){let n=Ir(e,t);if(n<0)return e;let r=e.lines.slice();return r.splice(n,1),{lines:r}}function Fr(e,t,n){if(t===n)return e;let r=[],i=[];if(e.lines.forEach((e,t)=>{e.kind===`pattern`&&(r.push(t),i.push(e))}),t<0||t>=i.length||n<0||n>=i.length)return e;let a=i.slice(),[o]=a.splice(t,1);if(!o)return e;a.splice(n,0,o);let s=e.lines.slice();return r.forEach((e,t)=>{let n=a[t];n&&(s[e]=n)}),{lines:s}}function Ir(e,t){if(t<0)return-1;let n=0;for(let r=0;r<e.lines.length;r++)if(e.lines[r]?.kind===`pattern`){if(n===t)return r;n++}return-1}var Lr=`/api/share/construct-url`;function Rr(e){return{kind:`doc`,docName:e}}function zr(e){return{kind:`folder`,folderRelativePath:e}}async function Br(e,t=fetch){let n=await t(Lr,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!n.ok)throw Error(`construct-url transport ${n.status}`);let r=await n.json(),i=oe.safeParse(r);if(!i.success)throw Error(`construct-url response shape mismatch`);return i.data}function Vr(e,t){switch(e){case`detached-head`:return Y._({id:`jLOL1H`});case`branch-not-on-origin`:return t?Y._({id:`x-fZxg`,values:{branch:t}}):Y._({id:`ZGVsOD`});case`non-github-remote`:return Y._({id:`V4JHny`});case`invalid-path`:return Y._({id:`0pZmTP`});case`unsupported-share-url`:return Y._({id:`uYZTcW`});case`no-remote`:return Y._({id:`pA16WG`})}}async function Hr(e,t){if(!e.hasRemote)return e.onClickWhenNoRemote(),{kind:`opened-wizard`};let n=e.kind===`folder`?{kind:`folder`,folderPath:e.folderRelativePath}:{kind:`doc`,docPath:He(e.docName)},r;try{r=await Br(n,t.fetchFn)}catch{return t.toastError(Y._({id:`u3YnKw`}),`transport`),{kind:`transport-error`}}if(r.ok){try{await t.clipboardWrite(r.shareUrl)}catch{return t.toastError(Y._({id:`E_A2Nq`}),`clipboard`),t.logEvent(`[share] action=link-construct result=clipboard-failed`),{kind:`clipboard-failed`,shareUrl:r.shareUrl,freshness:r.freshness}}return t.toastSuccess(e.kind===`folder`?Y._({id:`xcGVzH`}):Y._({id:`c1LZZH`})),t.logEvent(`[share] action=link-construct`),{kind:`copied`,shareUrl:r.shareUrl,branch:r.branch,freshness:r.freshness}}if(r.error===`no-remote`)return e.onClickWhenNoRemote(),{kind:`opened-wizard`};let i=r.branch;return t.toastError(Vr(r.error,i),`business`),{kind:`business-error`,error:r.error,branch:i}}var Ur=`/api/share/publish/owners`,Wr=`/api/share/publish/name-check`,Gr=`/api/share/publish`,Kr=/[A-Za-z0-9._-]/g;function qr(e){return(e.match(Kr)?.join(``)??``).replace(/[-.]{2,}/g,e=>e[0]??`-`).replace(/^[-.]+/,``).replace(/[-.]+$/,``)}function Jr(e){return e.find(e=>e.kind===`org`)?.login??e[0]?.login??``}function Yr(e){return`https://github.com/orgs/${encodeURIComponent(e)}/policies/applications`}function Xr(e,t,n){switch(e){case`name-conflict`:return{banner:Y._({id:`n81AV0`,values:{owner:t,name:n}}),next:{kind:`edit-name`}};case`saml-sso`:return{banner:Y._({id:`gLCE2c`,values:{owner:t}}),next:{kind:`authorize-org`,authorizeUrl:Yr(t)}};case`push-failed`:return{banner:Y._({id:`7Y9yTo`,values:{owner:t,name:n}}),next:{kind:`retry-push`}};case`auth-required`:return{banner:Y._({id:`UGtPix`}),next:{kind:`reauth`}};case`init-failed`:return{banner:Y._({id:`kGp168`}),next:{kind:`edit-form`}};case`network`:return{banner:Y._({id:`UVLlMV`}),next:{kind:`edit-form`}};case`no-project`:return{banner:Y._({id:`S6eHlw`}),next:{kind:`edit-form`}}}}async function Zr(e=fetch){let t=await e(Ur,{method:`GET`});if(!t.ok)throw Error(`owners transport ${t.status}`);let n=await t.json(),r=G.safeParse(n);if(!r.success)throw Error(`owners response shape mismatch`);return r.data}async function Qr(e,t,n=fetch){let r=await n(`${Wr}?owner=${encodeURIComponent(e)}&name=${encodeURIComponent(t)}`,{method:`GET`});if(!r.ok)throw Error(`name-check transport ${r.status}`);let i=await r.json(),a=se.safeParse(i);if(!a.success)throw Error(`name-check response shape mismatch`);return a.data}async function $r(e,t=fetch){let n=await t(Gr,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!n.ok)throw Error(`publish transport ${n.status}`);let r=await n.json(),i=K.safeParse(r);if(!i.success)throw Error(`publish response shape mismatch`);return i.data}function ei(e,t,n){return e.ok?e.available?{kind:`available`}:{kind:`taken`,owner:t,name:n}:e.error===`auth-required`?{kind:`error`,banner:Y._({id:`UGtPix`})}:{kind:`error`,banner:Y._({id:`UVLlMV`})}}function ti(e){return e.submitting||e.owner===null||e.sanitizedName.length===0?!1:e.nameCheck.kind===`available`}var ni=500;function ri(e){let t=(0,Z.c)(69),{open:n,onOpenChange:i}=e,{_:a}=u(),o=ve(),{activeDocName:s}=r(),[c,d]=(0,Q.useState)(null),[f,h]=(0,Q.useState)(!1),[g,_]=(0,Q.useState)(null),[v,y]=(0,Q.useState)(``),[x,S]=(0,Q.useState)(``),[C,w]=(0,Q.useState)(`private`),[T,E]=(0,Q.useState)(``),D;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(D={kind:`idle`},t[0]=D):D=t[0];let[F,I]=(0,Q.useState)(D),[L,R]=(0,Q.useState)(!1),[z,B]=(0,Q.useState)(null),[te,V]=(0,Q.useState)(!1),[ne,H]=(0,Q.useState)(null),[U,G]=(0,Q.useState)(!1),[K,ie]=(0,Q.useState)(null),[ae,oe]=(0,Q.useState)(null),se=(0,Q.useRef)(null),ce=(0,Q.useRef)(null),le=(0,Q.useRef)(null),ue;t[1]===x?ue=t[2]:(ue=qr(x),t[1]=x,t[2]=ue);let q=ue,de=c?.find(e=>e.login===v)??null,fe;t[3]!==a||t[4]!==v?(fe=async function(){h(!0),_(null);try{let e=await Zr();if(!e.ok){e.error===`auth-required`?(V(!0),_(a({id:`6cyguR`}))):_(a({id:`UVLlMV`})),h(!1);return}d(e.owners),e.owners.length>0&&v===``&&y(Jr(e.owners))}catch{_(a({id:`UVLlMV`}))}h(!1)},t[3]=a,t[4]=v,t[5]=fe):fe=t[5];let Y=fe,pe;t[6]!==Y||t[7]!==n||t[8]!==c||t[9]!==v||t[10]!==o?.contentDir?(pe=()=>{n&&(I({kind:`idle`}),B(null),R(!1),_(null),H(null),G(!1),ie(null),oe(null),S(qr(Er(o?.contentDir??``))),w(`private`),E(``),c===null?Y():v===``&&c.length>0&&y(Jr(c)))},t[6]=Y,t[7]=n,t[8]=c,t[9]=v,t[10]=o?.contentDir,t[11]=pe):pe=t[11];let me;t[12]===n?me=t[13]:(me=[n],t[12]=n,t[13]=me),(0,Q.useEffect)(pe,me);let he,ge;t[14]!==a||t[15]!==n||t[16]!==q||t[17]!==v?(he=()=>{if(n){if(se.current!==null&&clearTimeout(se.current),v===``||q===``){I({kind:`idle`});return}return I({kind:`pending`}),se.current=setTimeout(async()=>{let e=v,t=q;ce.current=`${e}|${t}`,I({kind:`checking`});try{let n=await Qr(e,t);if(ce.current!==`${e}|${t}`)return;I(ei(n,e,t))}catch{if(ce.current!==`${e}|${t}`)return;I({kind:`error`,banner:a({id:`UVLlMV`})})}},ni),()=>{se.current!==null&&(clearTimeout(se.current),se.current=null)}}},ge=[n,v,q,a],t[14]=a,t[15]=n,t[16]=q,t[17]=v,t[18]=he,t[19]=ge):(he=t[18],ge=t[19]),(0,Q.useEffect)(he,ge);let _e,X;t[20]!==a||t[21]!==s||t[22]!==ne?(_e=()=>{if(!ne||!s)return;let e=!1;return(async()=>{try{let t=await Br({kind:`doc`,docPath:He(s)});if(e)return;t.ok?ie(t.shareUrl):oe(Vr(t.error,t.branch))}catch(t){let n=t;if(e)return;console.warn(`[share] action=prefetch-share-url result=failed`,n),oe(a({id:`J6N5MX`}))}})(),()=>{e=!0}},X=[ne,s,a],t[20]=a,t[21]=s,t[22]=ne,t[23]=_e,t[24]=X):(_e=t[23],X=t[24]),(0,Q.useEffect)(_e,X);let ye;t[25]===Y?ye=t[26]:(ye=function(){V(!1),_(null),Y()},t[25]=Y,t[26]=ye);let be=ye,xe=async function(){if(ti({owner:de,sanitizedName:q,nameCheck:F,submitting:L})){R(!0),B(null);try{let e=await $r({owner:v,name:q,visibility:C,description:T.trim().length>0?T.trim():void 0});if(e.ok){H({ownerLogin:e.ownerLogin,repoName:e.repoName}),R(!1);return}let t=Xr(e.error,v,q);B({message:t.banner,next:t.next}),t.next.kind===`edit-name`?(le.current?.focus(),le.current?.select()):t.next.kind===`reauth`&&V(!0)}catch{B({message:a({id:`UVLlMV`}),next:{kind:`edit-form`}})}R(!1)}},Se;t[27]!==a||t[28]!==U||t[29]!==i||t[30]!==K?(Se=function(){!K||U||(G(!0),p(K).then(()=>{J.success(a({id:`c1LZZH`})),i(!1)}).catch(e=>{if(console.warn(`[share] action=link-construct result=clipboard-failed`,e),m(e)&&window.self!==window.top){J.error(a({id:`Dub54T`}));return}J.error(a({id:`MQIM_Y`}))}).finally(()=>{G(!1)}))},t[27]=a,t[28]=U,t[29]=i,t[30]=K,t[31]=Se):Se=t[31];let Ce=Se,we;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(we=function(e){let t=window.okDesktop?.shell?.openExternal;t?t(e):window.open(e,`_blank`,`noopener`)},t[32]=we):we=t[32];let Te=we,Ee;t[33]===i?Ee=t[34]:(Ee=function(){i(!1)},t[33]=i,t[34]=Ee);let De=Ee,Oe=!ti({owner:de,sanitizedName:q,nameCheck:F,submitting:L}),ke;t[35]!==a||t[36]!==s||t[37]!==z||t[38]!==U||t[39]!==T||t[40]!==Te||t[41]!==De||t[42]!==Ce||t[43]!==xe||t[44]!==Y||t[45]!==x||t[46]!==F||t[47]!==c||t[48]!==g||t[49]!==f||t[50]!==ne||t[51]!==q||t[52]!==v||t[53]!==K||t[54]!==ae||t[55]!==Oe||t[56]!==L||t[57]!==C?(ke=(0,$.jsx)(A,{className:`sm:max-w-lg`,showCloseButton:!1,children:ne?(0,$.jsx)(ai,{ownerLogin:ne.ownerLogin,repoName:ne.repoName,shareUrl:K,shareUrlError:ae,copying:U,canCopy:s!==null,onCopy:Ce,onClose:De}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(N,{children:[(0,$.jsx)(k,{children:(0,$.jsx)(l,{id:`qXsafh`})}),(0,$.jsx)(O,{children:(0,$.jsx)(l,{id:`Z1LF1M`})})]}),(0,$.jsxs)(j,{className:`flex flex-col gap-6`,children:[(0,$.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(ee,{id:`publish-owner-label`,children:(0,$.jsx)(l,{id:`LtI9AS`})}),f&&c===null?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,$.jsx)(Fe,{className:`size-3.5`,"aria-hidden":!0}),` `,(0,$.jsx)(l,{id:`Z3FXyt`})]}):g?(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsx)(`span`,{className:`text-sm text-destructive`,children:g}),(0,$.jsx)(b,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>Y(),children:(0,$.jsx)(l,{id:`6gRgw8`})})]}):(0,$.jsx)(re,{value:v,onValueChange:y,"aria-labelledby":`publish-owner-label`,"data-testid":`publish-owner-radio`,children:(c??[]).map(ii)})]}),(0,$.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(ee,{htmlFor:`publish-name`,children:(0,$.jsx)(l,{id:`0xnmlQ`})}),(0,$.jsx)($e,{id:`publish-name`,ref:le,"data-testid":`publish-name`,value:x,onChange:e=>S(e.target.value),onBlur:()=>{ce.current=null},placeholder:`my-knowledge-base`,autoComplete:`off`,spellCheck:!1}),(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-1sm`,"aria-live":`polite`,children:[(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:q?(0,$.jsx)(l,{id:`Nn4GgW`,values:{sanitizedName:q},components:{0:(0,$.jsx)(`code`,{className:`font-mono`})}}):(0,$.jsx)(l,{id:`Oxyd5f`})}),(0,$.jsx)(ui,{status:F})]})]}),(0,$.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(ee,{id:`publish-visibility-label`,children:(0,$.jsx)(l,{id:`2q_Q7x`})}),(0,$.jsxs)(re,{value:C,onValueChange:e=>w(e===`public`?`public`:`private`),className:`sm:flex`,"aria-labelledby":`publish-visibility-label`,children:[(0,$.jsx)(lt,{htmlFor:`publish-visibility-private`,children:(0,$.jsxs)(ft,{orientation:`horizontal`,children:[(0,$.jsxs)(ct,{children:[(0,$.jsx)(dt,{children:(0,$.jsx)(l,{id:`zwBp5t`})}),(0,$.jsx)(ut,{className:`text-1sm`,children:(0,$.jsx)(l,{id:`D8OV7J`})})]}),(0,$.jsx)(W,{value:`private`,id:`publish-visibility-private`,"data-testid":`publish-visibility-private`})]})}),(0,$.jsx)(lt,{htmlFor:`publish-visibility-public`,children:(0,$.jsxs)(ft,{orientation:`horizontal`,children:[(0,$.jsxs)(ct,{children:[(0,$.jsx)(dt,{children:(0,$.jsx)(l,{id:`7d1a0d`})}),(0,$.jsx)(ut,{className:`text-1sm`,children:(0,$.jsx)(l,{id:`4jDd0j`})})]}),(0,$.jsx)(W,{value:`public`,id:`publish-visibility-public`,"data-testid":`publish-visibility-public`})]})})]})]}),(0,$.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(ee,{htmlFor:`publish-description`,children:(0,$.jsx)(l,{id:`Fxf4jq`})}),(0,$.jsx)(mt,{id:`publish-description`,"data-testid":`publish-description`,rows:2,value:T,onChange:e=>E(e.target.value),placeholder:a({id:`c5rF4v`})})]}),z&&(0,$.jsx)(li,{banner:z,onAuthorize:Te,onRetryPush:xe})]}),(0,$.jsxs)(M,{children:[(0,$.jsx)(b,{type:`button`,variant:`outline`,className:`font-mono uppercase`,onClick:De,children:(0,$.jsx)(l,{id:`dEgA5A`})}),(0,$.jsx)(b,{type:`button`,onClick:xe,disabled:Oe,"data-testid":`publish-submit`,children:L?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Fe,{className:`size-3.5`,"aria-hidden":!0}),` `,(0,$.jsx)(l,{id:`Bdha5y`})]}):(0,$.jsx)(l,{id:`EEYbdt`})})]})]})}),t[35]=a,t[36]=s,t[37]=z,t[38]=U,t[39]=T,t[40]=Te,t[41]=De,t[42]=Ce,t[43]=xe,t[44]=Y,t[45]=x,t[46]=F,t[47]=c,t[48]=g,t[49]=f,t[50]=ne,t[51]=q,t[52]=v,t[53]=K,t[54]=ae,t[55]=Oe,t[56]=L,t[57]=C,t[58]=ke):ke=t[58];let Ae;t[59]!==i||t[60]!==n||t[61]!==ke?(Ae=(0,$.jsx)(P,{open:n,onOpenChange:i,children:ke}),t[59]=i,t[60]=n,t[61]=ke,t[62]=Ae):Ae=t[62];let je;t[63]!==te||t[64]!==be?(je=(0,$.jsx)(on,{open:te,onOpenChange:V,onSuccess:be}),t[63]=te,t[64]=be,t[65]=je):je=t[65];let Me;return t[66]!==Ae||t[67]!==je?(Me=(0,$.jsxs)($.Fragment,{children:[Ae,je]}),t[66]=Ae,t[67]=je,t[68]=Me):Me=t[68],Me}function ii(e){let t=`publish-owner-${e.login}`;return(0,$.jsx)(lt,{htmlFor:t,children:(0,$.jsxs)(ft,{orientation:`horizontal`,children:[(0,$.jsx)(ct,{children:(0,$.jsxs)(dt,{children:[e.avatarUrl?(0,$.jsx)(`img`,{src:e.avatarUrl,alt:``,"aria-hidden":!0,className:`size-4 rounded-full`}):null,(0,$.jsx)(`span`,{children:e.login})]})}),(0,$.jsx)(W,{value:e.login,id:t,"data-testid":`publish-owner-option-${e.login}`})]})},e.login)}function ai(e){let t=(0,Z.c)(36),{ownerLogin:n,repoName:r,shareUrl:i,shareUrlError:a,copying:o,canCopy:c,onCopy:d,onClose:f}=e,{_:p}=u(),m=(0,Q.useRef)(null),h,g;t[0]===i?(h=t[1],g=t[2]):(h=()=>{!i||!m.current||(m.current.focus(),m.current.select())},g=[i],t[0]=i,t[1]=h,t[2]=g),(0,Q.useEffect)(h,g);let _;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(k,{children:(0,$.jsx)(l,{id:`u3wRF-`})}),t[3]=_):_=t[3];let v;t[4]!==n||t[5]!==r?(v={ownerLogin:n,repoName:r},t[4]=n,t[5]=r,t[6]=v):v=t[6];let y;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(y={0:(0,$.jsx)(`code`,{className:`font-mono`})},t[7]=y):y=t[7];let x;t[8]===v?x=t[9]:(x=(0,$.jsxs)(N,{children:[_,(0,$.jsx)(O,{children:(0,$.jsx)(l,{id:`r871ed`,values:v,components:y})})]}),t[8]=v,t[9]=x);let S;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(ke,{className:`mt-0.5 size-4 text-emerald-600`,"aria-hidden":!0}),t[10]=S):S=t[10];let C;t[11]===c?C=t[12]:(C=(0,$.jsxs)(`div`,{role:`status`,"data-testid":`publish-success`,className:`flex items-start gap-3 rounded-md border border-emerald-500/40 bg-emerald-500/5 p-3 text-sm`,children:[S,(0,$.jsx)(`span`,{className:`text-foreground`,children:c?(0,$.jsx)(l,{id:`cOrTMo`}):(0,$.jsx)(l,{id:`nTwL53`})})]}),t[11]=c,t[12]=C);let w;t[13]!==c||t[14]!==i||t[15]!==a?(w=c&&(0,$.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(ee,{htmlFor:`publish-share-url`,children:(0,$.jsx)(l,{id:`5-FeN2`})}),a?(0,$.jsx)(`div`,{role:`alert`,"data-testid":`publish-share-url-error`,className:`rounded-md border border-destructive/50 bg-destructive/5 p-2 text-sm text-destructive`,children:a}):i?(0,$.jsx)($e,{id:`publish-share-url`,ref:m,"data-testid":`publish-share-url`,readOnly:!0,value:i,onFocus:ci,onClick:si,onContextMenu:oi,className:`font-mono text-xs`}):(0,$.jsxs)(`div`,{"data-testid":`publish-share-url-loading`,className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,$.jsx)(Fe,{className:`size-3.5`,"aria-hidden":!0}),` `,(0,$.jsx)(l,{id:`M9597s`})]})]}),t[13]=c,t[14]=i,t[15]=a,t[16]=w):w=t[16];let T;t[17]!==C||t[18]!==w?(T=(0,$.jsxs)(j,{className:`flex flex-col gap-4`,children:[C,w]}),t[17]=C,t[18]=w,t[19]=T):T=t[19];let E;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(l,{id:`DPfwMq`}),t[20]=E):E=t[20];let D;t[21]===f?D=t[22]:(D=(0,$.jsx)(b,{type:`button`,variant:`outline`,className:`font-mono uppercase`,onClick:f,"data-testid":`publish-success-done`,children:E}),t[21]=f,t[22]=D);let A;t[23]!==p||t[24]!==c||t[25]!==o||t[26]!==d||t[27]!==i?(A=c&&(0,$.jsx)(b,{type:`button`,onClick:d,disabled:o||!i,"data-testid":`publish-copy-link`,"aria-label":p({id:`RGCCrg`}),children:o?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Fe,{className:`size-3.5`,"aria-hidden":!0}),` `,(0,$.jsx)(l,{id:`OvEjsP`})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(s,{className:`size-3.5`,"aria-hidden":!0}),` `,(0,$.jsx)(l,{id:`RGCCrg`})]})}),t[23]=p,t[24]=c,t[25]=o,t[26]=d,t[27]=i,t[28]=A):A=t[28];let P;t[29]!==D||t[30]!==A?(P=(0,$.jsxs)(M,{children:[D,A]}),t[29]=D,t[30]=A,t[31]=P):P=t[31];let F;return t[32]!==T||t[33]!==P||t[34]!==x?(F=(0,$.jsxs)($.Fragment,{children:[x,T,P]}),t[32]=T,t[33]=P,t[34]=x,t[35]=F):F=t[35],F}function oi(e){return e.currentTarget.select()}function si(e){return e.currentTarget.select()}function ci(e){return e.currentTarget.select()}function li(e){let t=(0,Z.c)(13),{banner:n,onAuthorize:r,onRetryPush:i}=e,a=n.next,s;t[0]===n.message?s=t[1]:(s=(0,$.jsx)(`span`,{children:n.message}),t[0]=n.message,t[1]=s);let c;t[2]!==a.authorizeUrl||t[3]!==a.kind||t[4]!==r?(c=a.kind===`authorize-org`&&(0,$.jsxs)(b,{type:`button`,variant:`outline`,size:`sm`,className:`self-start`,"data-testid":`publish-authorize-org`,onClick:()=>r(a.authorizeUrl),children:[(0,$.jsx)(l,{id:`FyW0WO`}),` `,(0,$.jsx)(o,{className:`ml-1 size-3`,"aria-hidden":!0})]}),t[2]=a.authorizeUrl,t[3]=a.kind,t[4]=r,t[5]=c):c=t[5];let u;t[6]!==a.kind||t[7]!==i?(u=a.kind===`retry-push`&&(0,$.jsx)(b,{type:`button`,variant:`outline`,size:`sm`,className:`self-start`,"data-testid":`publish-retry-push`,onClick:i,children:(0,$.jsx)(l,{id:`NOHyEE`})}),t[6]=a.kind,t[7]=i,t[8]=u):u=t[8];let d;return t[9]!==s||t[10]!==c||t[11]!==u?(d=(0,$.jsxs)(`div`,{role:`alert`,"data-testid":`publish-banner`,className:`flex flex-col gap-2 rounded-md border border-destructive/50 bg-destructive/5 p-3 text-sm`,children:[s,c,u]}),t[9]=s,t[10]=c,t[11]=u,t[12]=d):d=t[12],d}function ui(e){let t=(0,Z.c)(12),{status:r}=e;if(r.kind===`available`){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(ke,{className:`size-3.5`,"aria-hidden":!0}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsxs)(`span`,{"data-testid":`publish-name-check`,"data-status":`available`,className:`flex items-center gap-1 text-emerald-600 dark:text-emerald-400`,children:[e,` `,(0,$.jsx)(l,{id:`csDS2L`})]}),t[1]=n):n=t[1],n}if(r.kind===`taken`){let{owner:e,name:i}=r,a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(n,{className:`size-3.5`,"aria-hidden":!0}),t[2]=a):a=t[2];let o;return t[3]!==i||t[4]!==e?(o=(0,$.jsxs)(`span`,{"data-testid":`publish-name-check`,"data-status":`taken`,className:`flex items-center gap-1 text-destructive`,children:[a,` `,(0,$.jsx)(l,{id:`LRgZAt`,values:{owner:e,name:i}})]}),t[3]=i,t[4]=e,t[5]=o):o=t[5],o}if(r.kind===`checking`||r.kind===`pending`){let e;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Fe,{className:`size-3.5`,"aria-hidden":!0}),t[6]=e):e=t[6];let n;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(l,{id:`pWT04I`}),t[7]=n):n=t[7];let i;return t[8]===r.kind?i=t[9]:(i=(0,$.jsxs)(`span`,{"data-testid":`publish-name-check`,"data-status":r.kind,className:`flex items-center gap-1 text-muted-foreground`,children:[e,` `,n]}),t[8]=r.kind,t[9]=i),i}if(r.kind===`error`){let e;return t[10]===r.banner?e=t[11]:(e=(0,$.jsx)(`span`,{"data-testid":`publish-name-check`,"data-status":`error`,className:`text-destructive`,children:r.banner}),t[10]=r.banner,t[11]=e),e}return null}var di=5e3,fi=3e4,pi=0;function mi(){let e=Date.now();e-pi<fi||(pi=e,be(`fetch`).catch(()=>{pi===e&&(pi=0)}))}async function hi(){try{let e=await fetch(`/api/git/worktree-status`);return e.ok?await e.json():null}catch{return null}}function gi(e){let t=(0,Z.c)(6),[n,r]=(0,Q.useState)(null),i,a;t[0]===e?(i=t[1],a=t[2]):(i=()=>{if(!e)return;let t=!1,n=!1,i=!1;function a(){if(n){i=!0;return}n=!0,hi().then(e=>{n=!1,!t&&e&&e.readable!==!1&&r(e),i&&!t&&(i=!1,a())})}a(),mi();let o=setInterval(a,di),s=me(e=>{e.includes(`sync-status`)&&a()});return()=>{t=!0,clearInterval(o),s()}},a=[e],t[0]=e,t[1]=i,t[2]=a),(0,Q.useEffect)(i,a);let o=e&&n===null,s;return t[3]!==n||t[4]!==o?(s={status:n,loading:o},t[3]=n,t[4]=o,t[5]=s):s=t[5],s}async function _i(e){let t=await fetch(`/api/sync/resolve-blocking`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:e})});if(!t.ok)throw Error(`sync resolve-blocking failed: ${t.status}`)}function vi(){return typeof window<`u`&&window.okDesktop!=null}function yi(e){let t=(0,Z.c)(23),{paths:n}=e,[r,i]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(!1);if(n.length===0)return null;let s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=async function(e){i(e),o(!1);try{await _i(e),i(null)}catch{o(!0),i(null)}},t[0]=s):s=t[0];let c=s,u=r!==null,d;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(`span`,{id:`sync-blocking-heading`,className:`text-xs font-medium text-foreground`,children:(0,$.jsx)(l,{id:`sdvHp3`})}),t[1]=d):d=t[1];let f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[d,(0,$.jsx)(`span`,{className:`text-2xs text-muted-foreground`,children:(0,$.jsx)(l,{id:`H4doZt`})})]}),t[2]=f):f=t[2];let p;t[3]===n?p=t[4]:(p=n.map(xi),t[3]=n,t[4]=p);let m;t[5]===p?m=t[6]:(m=(0,$.jsx)(`ul`,{"aria-labelledby":`sync-blocking-heading`,className:`flex max-h-28 flex-col gap-1 overflow-y-auto overscroll-contain`,"data-testid":`sync-blocking-list`,children:p}),t[5]=p,t[6]=m);let h;t[7]===a?h=t[8]:(h=a&&(0,$.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,"data-testid":`sync-blocking-error`,children:(0,$.jsx)(l,{id:`FsEXax`})}),t[7]=a,t[8]=h);let g;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>void c(`commit`),t[9]=g):g=t[9];let _;t[10]===r?_=t[11]:(_=r===`commit`&&(0,$.jsx)(Fe,{"aria-hidden":`true`,"data-icon":`inline-start`}),t[10]=r,t[11]=_);let v;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(l,{id:`N7Lau6`}),t[12]=v):v=t[12];let y;t[13]!==u||t[14]!==_?(y=(0,$.jsxs)(b,{size:`xs`,disabled:u,onClick:g,"data-testid":`sync-blocking-commit`,children:[_,v]}),t[13]=u,t[14]=_,t[15]=y):y=t[15];let x;t[16]===u?x=t[17]:(x=vi()&&(0,$.jsxs)(b,{variant:`link-muted`,size:`xs`,className:`self-start p-0`,disabled:u,onClick:bi,"data-testid":`sync-blocking-terminal`,children:[(0,$.jsx)(je,{"data-icon":`inline-start`}),(0,$.jsx)(l,{id:`6EoD0z`})]}),t[16]=u,t[17]=x);let S;return t[18]!==y||t[19]!==x||t[20]!==m||t[21]!==h?(S=(0,$.jsxs)(`div`,{className:`flex flex-col gap-2 border-t pt-3`,children:[f,m,h,y,x]}),t[18]=y,t[19]=x,t[20]=m,t[21]=h,t[22]=S):S=t[22],S}function bi(){return ht(`git-status`)}function xi(e){return(0,$.jsx)(`li`,{title:e,className:`min-w-0 truncate font-mono text-2xs text-foreground`,children:e},e)}function Si(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function Ci(e){return e===``?[]:e.split(`/`)}function wi(e){if(e.length===0)return``;let t=Ci(Si(e[0]));for(let n of e.slice(1)){let e=Ci(Si(n)),r=0;for(;r<t.length&&r<e.length&&t[r]===e[r];)r++;if(t=t.slice(0,r),t.length===0)break}return t.join(`/`)}function Ti(e,t){return e===``?t:t.slice(e.length+1)}function Ei(e,t=8){if(e.length===0)return{prefix:``,groups:[],loose:[]};if(e.length===1)return{prefix:``,groups:[],loose:[{entry:e[0],label:e[0].path}]};let n=wi(e.map(e=>e.path)),r=e.map(e=>{let t=Ti(n,e.path);return{entry:e,rel:t,key:Si(t)}}),i=()=>new Set(r.map(e=>e.key));for(;i().size>t;){let e=Math.max(...r.map(e=>Ci(e.key).length));if(e===0)break;for(let t of r)Ci(t.key).length===e&&(t.key=Si(t.key))}let a=new Map;for(let{entry:e,rel:t,key:n}of r){let r=a.get(n)??[];r.push({entry:e,label:n===``?t:t.slice(n.length+1)}),a.set(n,r)}let o=[],s=[];for(let[e,t]of a)if(e===``||t.length===1)for(let e of t)s.push({entry:e.entry,label:Ti(n,e.entry.path)});else o.push({dir:e,rows:t});return o.sort((e,t)=>t.rows.length-e.rows.length||e.dir.localeCompare(t.dir)),s.sort((e,t)=>e.entry.path.localeCompare(t.entry.path)),{prefix:n,groups:o,loose:s}}function Di(e=`sync`,t){be(e).catch(e=>{console.warn(`[sync-badge] manual sync trigger failed`,e instanceof Error?e.message:e),t?.()})}function Oi(e){typeof window>`u`||We(window.location.hash,e)||(window.location.hash=e)}function ki(e){return e.kind===`doc`?Ve(e.docName):Be(e.path)}function Ai(e){let t=Date.now()-new Date(e).getTime();if(t<6e4)return Y._({id:`xOTzt5`});if(t<36e5){let e=Math.floor(t/6e4);return Y._({id:`_rP3HI`,values:{minutes:e}})}if(t<864e5){let e=Math.floor(t/36e5);return Y._({id:`nYeBmY`,values:{hours:e}})}return new Date(e).toLocaleDateString()}function ji(e){return e.syncMode===`follow`}function Mi(e){return e.state===`idle`&&e.conflictCount>0?`conflict`:e.state}function Ni(e){let t=(0,Z.c)(12),{status:n}=e;switch(Mi(n)){case`dormant`:{let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(vt,{className:`size-3.5 text-muted-foreground`}),t[0]=e):e=t[0],e}case`idle`:{if(n.ahead>0||n.behind>0){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Ie,{className:`size-3.5 text-muted-foreground`}),t[1]=e):e=t[1],e}let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(vt,{className:`size-3.5 text-muted-foreground`}),t[2]=e):e=t[2],e}case`fetching`:case`pulling`:case`pushing`:{let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Fe,{"aria-hidden":`true`,icon:Ie,className:`size-3.5 text-muted-foreground`}),t[3]=e):e=t[3],e}case`conflict`:{let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Re,{className:`size-3.5 text-amber-500`}),t[4]=e):e=t[4],e}case`offline`:{let e;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(_t,{className:`size-3.5 text-muted-foreground`}),t[5]=e):e=t[5],e}case`auth-error`:{let e;return t[6]===n?e=t[7]:(e=Bi(n)?(0,$.jsx)(gt,{className:`size-3.5 text-destructive`}):(0,$.jsx)(yt,{className:`size-3.5 text-destructive`}),t[6]=n,t[7]=e),e}case`disabled`:{if(n.pausedReason){let e;return t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Re,{className:`size-3.5 text-amber-500`}),t[8]=e):e=t[8],e}if(n.ahead>0||n.behind>0){let e;return t[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Ie,{className:`size-3.5 text-muted-foreground`}),t[9]=e):e=t[9],e}let e;return t[10]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(vt,{className:`size-3.5 text-muted-foreground`}),t[10]=e):e=t[10],e}default:{let e;return t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(vt,{className:`size-3.5 text-muted-foreground`}),t[11]=e):e=t[11],e}}}function Pi(e){switch(Mi(e)){case`idle`:return!ji(e)&&e.ahead>0?`↑${e.ahead}`:e.behind>0?`↓${e.behind}`:``;case`fetching`:case`pulling`:case`pushing`:return``;case`conflict`:return e.conflictCount>0?`${e.conflictCount}`:``;case`offline`:return``;case`auth-error`:return``;default:return``}}function Fi(e){let t=ji(e),n=Mi(e);switch(n){case`dormant`:return Y._({id:`RmBY0A`});case`idle`:return t?Y._({id:`j5CWO4`}):Y._({id:`N2FcBE`});case`fetching`:return t?Y._({id:`7IsvrP`}):Y._({id:`Wgmlsw`});case`pulling`:return t?Y._({id:`JL3si7`}):Y._({id:`4uNLmk`});case`pushing`:return Y._({id:`iycx_A`});case`conflict`:return Y._({id:`IInnZo`});case`offline`:return Y._({id:`6Aih4U`});case`auth-error`:return Y._({id:`mHVPm5`});case`disabled`:return e.pausedReason?Y._({id:`U6wmNc`}):Y._({id:`BWTzAb`});default:return n}}function Ii(e){switch(e){case`external-changes-pending`:return Y._({id:`W9_Bub`});case`dirty-tree`:return Y._({id:`a5Gha5`});case`non-content-merge-failure`:return Y._({id:`sIxSSP`});case`detached-head`:return Y._({id:`uQNW00`});case`diverged-local-commits`:return Y._({id:`LQsCPn`});case`auth-error`:return Y._({id:`mHVPm5`});case`protected-branch`:return Y._({id:`8fc_3j`});case`no-push-permission`:return Y._({id:`EiVgl5`});default:return e}}function Li(e,t){let n=[];switch(e){case`not-authenticated`:n.push(Y._({id:`ycIX5i`}));break;case`no-collaborator`:n.push(Y._({id:`EiVgl5`}));break;case`private-no-access`:n.push(Y._({id:`07gHun`}));break;case`repo-not-found`:n.push(Y._({id:`uksqrP`}));break;default:n.push(Y._({id:`EiVgl5`}))}return n.push(...Ri(t)),n}function Ri(e){let t=[];if(e?.resolvedLogin){let n=e.resolvedLogin;t.push(Y._({id:`ZKVuLY`,values:{login:n}}))}return e?.declaredLogin&&t.push(zi(e.declaredLogin,e.declaredSource)),t}function zi(e,t){switch(t){case`remote-url`:return Y._({id:`CMd-g-`,values:{declaredLogin:e}});case`credential-config`:return Y._({id:`akOe4q`,values:{declaredLogin:e}});default:return Y._({id:`GBEqoP`,values:{declaredLogin:e}})}}function Bi(e){return e.pushErrorCode===`auth-not-found-as-identity`||e.pullErrorCode===`auth-not-found-as-identity`}function Vi(e){return e?.pausedReason===`auth-error`&&Bi(e)}function Hi(e){return e?.checkStatus===`denied`&&e.deniedReason===`not-authenticated`}function Ui(e){switch(e){case`auth-403`:return Y._({id:`EiVgl5`});case`auth-401`:return Y._({id:`-Qw-1t`});case`auth-scope-mismatch`:return Y._({id:`Zue_jx`});case`auth-no-credential`:return Y._({id:`uCaIdy`});case`semantic-protected-branch`:return Y._({id:`T0OVm7`});case`auth-not-found-as-identity`:return Y._({id:`jRsjlF`});default:return Y._({id:`1AumWo`})}}function Wi(e){switch(e){case`auth-403`:return Y._({id:`RgbKEe`});case`auth-401`:return Y._({id:`-Qw-1t`});case`auth-scope-mismatch`:return Y._({id:`Zue_jx`});case`auth-no-credential`:return Y._({id:`uCaIdy`});case`auth-not-found-as-identity`:return Y._({id:`jRsjlF`});default:return Y._({id:`jZ_E5M`})}}function Gi(e){switch(e){case`auth-403`:return Y._({id:`RgbKEe`});case`auth-401`:return Y._({id:`-Qw-1t`});case`auth-scope-mismatch`:return Y._({id:`Zue_jx`});case`auth-no-credential`:return Y._({id:`uCaIdy`});case`semantic-protected-branch`:return Y._({id:`T0OVm7`});case`auth-not-found-as-identity`:return Y._({id:`jRsjlF`});default:return Y._({id:`cUk6TF`})}}function Ki(e){let t=e.pushErrorCode!=null||e.pushError!=null,n=e.pullErrorCode!=null||e.pullError!=null;if(t&&n&&(e.pushErrorCode==null?e.pullErrorCode==null&&e.pushError===e.pullError:e.pushErrorCode===e.pullErrorCode))return[{key:`sync`,direction:null,message:e.pushErrorCode==null?e.pushError:Gi(e.pushErrorCode)}];let r=t&&n,i=[];return t&&i.push({key:`push`,direction:r?`push`:null,message:e.pushErrorCode?Ui(e.pushErrorCode):e.pushError}),n&&i.push({key:`pull`,direction:r?`pull`:null,message:e.pullErrorCode?Wi(e.pullErrorCode):e.pullError}),i}function qi(e){return e?.checkStatus===`unknown`&&e.unknownError===`token-invalid`}function Ji(e){return Mi(e)===`auth-error`&&Bi(e)?Y._({id:`EkEFE3`}):Fi(e)}function Yi(e){let t=ji(e),n=Mi(e);if(n===`conflict`&&e.conflictCount>0){let{conflictCount:t}=e;return Y._({id:`cUK8lW`,values:{conflictCount:t}})}if(n===`idle`){let{ahead:n,behind:r}=e;return t?r>0?Y._({id:`9o1bIV`,values:{behind:r}}):Y._({id:`j5CWO4`}):n>0&&r>0?Y._({id:`5F5HYj`,values:{ahead:n,behind:r}}):n>0?Y._({id:`PdA9NZ`,values:{ahead:n}}):r>0?Y._({id:`9o1bIV`,values:{behind:r}}):Y._({id:`N2FcBE`})}return Ji(e)}function Xi(e){let t=(0,Z.c)(3),{children:n,id:r}=e,i;return t[0]!==n||t[1]!==r?(i=(0,$.jsx)(`span`,{id:r,className:`font-mono uppercase tracking-wide text-2xs text-muted-foreground`,children:n}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function Zi(e){switch(e){case`M`:return Y._({id:`tgWuMB`});case`A`:return Y._({id:`hp8OtS`});case`D`:return Y._({id:`vGjmyl`});case`R`:return Y._({id:`QeREu8`});case`C`:return Y._({id:`6V3Ea3`});case`U`:return Y._({id:`cyoNqf`});case`T`:return Y._({id:`zWZBPx`});case`?`:return Y._({id:`C2abof`});case`!`:return Y._({id:`xDKOFk`});default:return Y._({id:`cNsIJf`})}}function Qi(e){switch(e){case`D`:return`destructive`;case`U`:return`warning`;default:return`gray`}}function $i(e){let t=(0,Z.c)(25),{entry:n,dimmed:r,label:i}=e,a;t[0]===n.code?a=t[1]:(a=Zi(n.code),t[0]=n.code,t[1]=a);let o=a,s=n.open,c=`truncate text-start font-mono text-2xs ${r?`text-muted-foreground/60`:`text-foreground`}`,l;t[2]===n.code?l=t[3]:(l=Qi(n.code),t[2]=n.code,t[3]=l);let u;t[4]===n.code?u=t[5]:(u=(0,$.jsx)(`span`,{"aria-hidden":!0,children:n.code}),t[4]=n.code,t[5]=u);let d;t[6]===o?d=t[7]:(d=(0,$.jsx)(`span`,{className:`sr-only`,children:o}),t[6]=o,t[7]=d);let f;t[8]!==l||t[9]!==u||t[10]!==d?(f=(0,$.jsx)(S,{asChild:!0,children:(0,$.jsxs)(at,{variant:l,className:`size-4 shrink-0 justify-center p-0 text-2xs leading-none`,children:[u,d]})}),t[8]=l,t[9]=u,t[10]=d,t[11]=f):f=t[11];let p;t[12]===o?p=t[13]:(p=(0,$.jsx)(C,{children:o}),t[12]=o,t[13]=p);let m;t[14]!==f||t[15]!==p?(m=(0,$.jsxs)(w,{children:[f,p]}),t[14]=f,t[15]=p,t[16]=m):m=t[16];let h;t[17]!==n.path||t[18]!==i||t[19]!==s||t[20]!==c?(h=s?(0,$.jsxs)(w,{children:[(0,$.jsx)(S,{asChild:!0,children:(0,$.jsx)(nt,{asChild:!0,children:(0,$.jsx)(b,{variant:`link-muted`,size:`xs`,className:`h-auto min-h-6 min-w-0 shrink justify-start overflow-hidden p-0 font-normal`,"aria-label":n.path,onClick:()=>Oi(ki(s)),"data-testid":`worktree-row-open`,children:(0,$.jsx)(`span`,{dir:`auto`,className:`min-w-0 ${c}`,children:i})})})}),(0,$.jsx)(C,{dir:`auto`,className:`font-mono text-2xs`,children:n.path})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(w,{children:[(0,$.jsx)(S,{asChild:!0,children:(0,$.jsx)(`span`,{dir:`auto`,tabIndex:0,className:`min-w-0 rounded-xs focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50 ${c}`,children:i})}),(0,$.jsx)(C,{dir:`auto`,className:`font-mono text-2xs`,children:n.path})]}),i!==n.path&&(0,$.jsx)(`span`,{className:`sr-only`,children:n.path})]}),t[17]=n.path,t[18]=i,t[19]=s,t[20]=c,t[21]=h):h=t[21];let g;return t[22]!==m||t[23]!==h?(g=(0,$.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2`,children:[m,h]}),t[22]=m,t[23]=h,t[24]=g):g=t[24],g}function ea(e){let t=(0,Z.c)(15),{rows:n,dimmed:r}=e,[i,a]=(0,Q.useState)(!1),o=n.length>6,s;t[0]!==n||t[1]!==i?(s=i?n:n.slice(0,6),t[0]=n,t[1]=i,t[2]=s):s=t[2];let c=s,u=n.length-6,d;if(t[3]!==r||t[4]!==c){let e;t[6]===r?e=t[7]:(e=e=>{let{entry:t,label:n}=e;return(0,$.jsx)($i,{entry:t,dimmed:r,label:n},`${t.code}:${t.path}`)},t[6]=r,t[7]=e),d=c.map(e),t[3]=r,t[4]=c,t[5]=d}else d=t[5];let f;t[8]!==o||t[9]!==u||t[10]!==i?(f=o&&(0,$.jsx)(`li`,{children:(0,$.jsx)(b,{variant:`link-muted`,size:`xs`,"aria-expanded":i,className:`h-auto min-h-6 justify-start p-0 text-2xs font-normal`,onClick:()=>a(ta),"data-testid":`worktree-rows-show-all`,children:i?(0,$.jsx)(l,{id:`H86f9p`}):(0,$.jsx)(l,{id:`B6Lac2`,values:{overflowCount:u}})})}),t[8]=o,t[9]=u,t[10]=i,t[11]=f):f=t[11];let p;return t[12]!==d||t[13]!==f?(p=(0,$.jsxs)(`ul`,{className:`flex flex-col gap-1`,children:[d,f]}),t[12]=d,t[13]=f,t[14]=p):p=t[14],p}function ta(e){return!e}function na(e){let t=(0,Z.c)(25),{group:n,prefix:r,dimmed:i}=e,a=n.rows.length,[o,s]=(0,Q.useState)(!1),c=r===``?n.dir:`${r}/${n.dir}`,u=`size-3 shrink-0 text-muted-foreground transition-transform motion-reduce:transition-none ${o?`rotate-90`:``}`,d;t[0]===u?d=t[1]:(d=(0,$.jsx)(Oe,{className:u,"aria-hidden":!0}),t[0]=u,t[1]=d);let f;t[2]===n.dir?f=t[3]:(f=(0,$.jsx)(`span`,{dir:`auto`,className:`min-w-0 truncate text-start font-mono text-2xs text-muted-foreground`,children:n.dir}),t[2]=n.dir,t[3]=f);let p;t[4]===a?p=t[5]:(p=(0,$.jsx)(`span`,{"aria-hidden":!0,className:`ms-auto shrink-0 ps-1 text-2xs text-muted-foreground tabular-nums`,children:a}),t[4]=a,t[5]=p);let m;t[6]===a?m=t[7]:(m=(0,$.jsx)(`span`,{className:`sr-only`,children:(0,$.jsx)(l,{id:`u3BOHd`,values:{fileCount:a}})}),t[6]=a,t[7]=m);let h;t[8]!==d||t[9]!==f||t[10]!==p||t[11]!==m?(h=(0,$.jsx)(S,{asChild:!0,children:(0,$.jsx)(E,{asChild:!0,children:(0,$.jsxs)(b,{variant:`ghost`,size:`xs`,className:`h-auto min-h-6 w-full justify-start gap-1 px-0 font-normal`,children:[d,f,p,m]})})}),t[8]=d,t[9]=f,t[10]=p,t[11]=m,t[12]=h):h=t[12];let g;t[13]===c?g=t[14]:(g=(0,$.jsx)(C,{dir:`auto`,className:`font-mono text-2xs`,children:c}),t[13]=c,t[14]=g);let _;t[15]!==h||t[16]!==g?(_=(0,$.jsxs)(w,{children:[h,g]}),t[15]=h,t[16]=g,t[17]=_):_=t[17];let v;t[18]!==i||t[19]!==n.rows?(v=(0,$.jsx)(T,{className:`ps-4`,children:(0,$.jsx)(ea,{rows:n.rows,dimmed:i})}),t[18]=i,t[19]=n.rows,t[20]=v):v=t[20];let y;return t[21]!==o||t[22]!==_||t[23]!==v?(y=(0,$.jsxs)(D,{open:o,onOpenChange:s,className:`flex flex-col gap-1`,children:[_,v]}),t[21]=o,t[22]=_,t[23]=v,t[24]=y):y=t[24],y}function ra(e){let t=(0,Z.c)(39),{title:n,note:r,entries:i,dimmed:a}=e,o=a===void 0?!1:a;if(i.length===0)return null;let s=i.length,c,u,d,f,p,m,h,g,_;if(t[0]!==o||t[1]!==i||t[2]!==s||t[3]!==r||t[4]!==n){let{prefix:e,groups:a,loose:v}=Ei(i);d=v,u=D,g=`flex flex-col gap-1`;let y;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(Oe,{className:`size-3 shrink-0 text-muted-foreground transition-transform motion-reduce:transition-none group-data-[state=open]:rotate-90`,"aria-hidden":!0}),t[14]=y):y=t[14];let x;t[15]===n?x=t[16]:(x=(0,$.jsx)(`span`,{className:`text-2xs font-medium text-muted-foreground`,children:n}),t[15]=n,t[16]=x);let S;t[17]===s?S=t[18]:(S=(0,$.jsx)(`span`,{className:`ms-auto shrink-0 ps-1 text-2xs text-muted-foreground tabular-nums`,children:(0,$.jsx)(l,{id:`u3BOHd`,values:{fileCount:s}})}),t[17]=s,t[18]=S),t[19]!==x||t[20]!==S?(_=(0,$.jsx)(E,{asChild:!0,children:(0,$.jsxs)(b,{variant:`ghost`,size:`xs`,className:`group h-auto min-h-6 w-full justify-start gap-1 px-0 font-normal data-[state=open]:bg-transparent`,children:[y,x,S]})}),t[19]=x,t[20]=S,t[21]=_):_=t[21],c=T,f=`flex flex-col gap-1 ps-3`,t[22]===r?p=t[23]:(p=r&&(0,$.jsx)(`span`,{className:`text-2xs text-muted-foreground/80`,children:r}),t[22]=r,t[23]=p),m=e!==``&&(0,$.jsxs)(`span`,{dir:`auto`,className:`break-all font-mono text-2xs text-muted-foreground`,children:[e,`/`]}),h=a.map(t=>(0,$.jsx)(na,{group:t,prefix:e,dimmed:o},e===``?t.dir:`${e}/${t.dir}`)),t[0]=o,t[1]=i,t[2]=s,t[3]=r,t[4]=n,t[5]=c,t[6]=u,t[7]=d,t[8]=f,t[9]=p,t[10]=m,t[11]=h,t[12]=g,t[13]=_}else c=t[5],u=t[6],d=t[7],f=t[8],p=t[9],m=t[10],h=t[11],g=t[12],_=t[13];let v;t[24]!==o||t[25]!==d?(v=d.length>0&&(0,$.jsx)(ea,{rows:d,dimmed:o}),t[24]=o,t[25]=d,t[26]=v):v=t[26];let y;t[27]!==c||t[28]!==f||t[29]!==p||t[30]!==m||t[31]!==h||t[32]!==v?(y=(0,$.jsxs)(c,{className:f,children:[p,m,h,v]}),t[27]=c,t[28]=f,t[29]=p,t[30]=m,t[31]=h,t[32]=v,t[33]=y):y=t[33];let x;return t[34]!==u||t[35]!==g||t[36]!==_||t[37]!==y?(x=(0,$.jsxs)(u,{className:g,children:[_,y]}),t[34]=u,t[35]=g,t[36]=_,t[37]=y,t[38]=x):x=t[38],x}function ia(e){let t=(0,Z.c)(9),{direction:n,count:r}=e,{_:i}=u();if(r<=0)return null;let a;t[0]===n?a=t[1]:(a=n===`behind`?(0,$.jsx)(we,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":!0}):(0,$.jsx)(Ce,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":!0}),t[0]=n,t[1]=a);let o;t[2]!==i||t[3]!==r||t[4]!==n?(o=i(n===`behind`?{id:`sKHiNR`,values:{count:r}}:{id:`9ZxzfT`,values:{count:r}}),t[2]=i,t[3]=r,t[4]=n,t[5]=o):o=t[5];let s;return t[6]!==a||t[7]!==o?(s=(0,$.jsxs)(`span`,{className:`flex flex-1 items-center gap-1.5 rounded-md bg-muted px-2 py-1 text-xs text-foreground`,children:[a,o]}),t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function aa(e){let t=new Set,n=[],r=[];for(let i of[...e.staged,...e.notStaged,...e.untracked])t.has(i.path)||(t.add(i.path),(i.syncScoped?n:r).push(i));return{willPush:n,wontPush:r}}function oa(e){let t=(0,Z.c)(24),{status:n,worktree:r,loading:i}=e,a;t[0]===r?a=t[1]:(a=r?aa(r):{willPush:[],wontPush:[]},t[0]=r,t[1]=a);let{willPush:o,wontPush:s}=a,c;t[2]===r?.incoming?c=t[3]:(c=r?.incoming??[],t[2]=r?.incoming,t[3]=c);let u=c,d=r!==null&&r.readable===!1,f=r!==null&&o.length===0&&s.length===0&&u.length===0,p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(Xi,{id:`worktree-status-label`,children:(0,$.jsx)(l,{id:`uAQUqI`})}),t[4]=p):p=t[4];let m;t[5]===r?m=t[6]:(m=r&&(r.branch||r.detached)&&(0,$.jsx)(`span`,{className:`min-w-0 truncate font-mono text-2xs text-muted-foreground`,children:r.detached?(0,$.jsx)(l,{id:`OBdkpo`}):r.upstream?`${r.branch} → ${r.upstream}`:r.branch}),t[5]=r,t[6]=m);let h;t[7]===m?h=t[8]:(h=(0,$.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[p,m]}),t[7]=m,t[8]=h);let g;t[9]!==n.ahead||t[10]!==n.behind?(g=(n.behind>0||n.ahead>0)&&(0,$.jsxs)(`div`,{className:`flex items-stretch gap-2`,children:[(0,$.jsx)(ia,{direction:`behind`,count:n.behind}),(0,$.jsx)(ia,{direction:`ahead`,count:n.ahead})]}),t[9]=n.ahead,t[10]=n.behind,t[11]=g):g=t[11];let _;t[12]!==f||t[13]!==u||t[14]!==i||t[15]!==d||t[16]!==o||t[17]!==s||t[18]!==r?(_=i?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,$.jsx)(l,{id:`eolhcI`})}):d?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`worktree-unreadable`,children:(0,$.jsx)(l,{id:`L9ox9k`})}):f?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,$.jsx)(l,{id:`WfcERq`})}):r&&(0,$.jsxs)(`section`,{className:`flex max-h-56 flex-col gap-2.5 overflow-y-auto overscroll-contain focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,tabIndex:0,"aria-labelledby":`worktree-status-label`,"data-testid":`worktree-listing`,children:[(0,$.jsx)(ra,{title:(0,$.jsx)(l,{id:`NcwbBM`}),entries:u}),(0,$.jsx)(ra,{title:(0,$.jsx)(l,{id:`JOhCT9`}),entries:o}),(0,$.jsx)(ra,{title:(0,$.jsx)(l,{id:`vsFXfP`}),note:(0,$.jsx)(l,{id:`PxZCNM`}),entries:s,dimmed:!0}),r.truncated&&(0,$.jsx)(`p`,{className:`text-2xs text-muted-foreground`,children:(0,$.jsx)(l,{id:`KvwJv8`})})]}),t[12]=f,t[13]=u,t[14]=i,t[15]=d,t[16]=o,t[17]=s,t[18]=r,t[19]=_):_=t[19];let v;return t[20]!==h||t[21]!==g||t[22]!==_?(v=(0,$.jsxs)(`div`,{className:`flex flex-col gap-2.5 border-t pt-3`,children:[h,g,_]}),t[20]=h,t[21]=g,t[22]=_,t[23]=v):v=t[23],v}function sa(e){let t=(0,Z.c)(19),{pulledAt:n,pushedAt:r,combinedAt:i}=e,{_:a}=u(),o,s,c;if(t[0]!==a||t[1]!==i||t[2]!==n||t[3]!==r){o=n===null?null:Ai(n),s=r===null?null:Ai(r);let e=i===null?null:Ai(i);c=o!==null&&s!==null?a({id:`1TA-aJ`,values:{pulled:o,pushed:s}}):o===null?s===null?e===null?null:a({id:`irnKr_`,values:{updatedRelative:e}}):a({id:`lPkjpD`,values:{pushed:s}}):a({id:`xW5AUw`,values:{pulled:o}}),t[0]=a,t[1]=i,t[2]=n,t[3]=r,t[4]=o,t[5]=s,t[6]=c}else o=t[4],s=t[5],c=t[6];let l=c,d=o!==null||s!==null;if(l===null){let e;return t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`span`,{}),t[7]=e):e=t[7],e}let f;t[8]!==l||t[9]!==d?(f=d&&(0,$.jsx)(`span`,{className:`sr-only`,"data-testid":`sync-popover-last-sync-label`,children:l}),t[8]=l,t[9]=d,t[10]=f):f=t[10];let p;t[11]!==l||t[12]!==o||t[13]!==s||t[14]!==d?(p=d?(0,$.jsxs)(`span`,{"aria-hidden":`true`,className:`inline-flex items-center gap-1`,children:[o!==null&&(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,$.jsx)(we,{className:`size-3`}),o]}),o!==null&&s!==null&&(0,$.jsx)(`span`,{children:`·`}),s!==null&&(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,$.jsx)(Ce,{className:`size-3`}),s]})]}):(0,$.jsx)(`span`,{"aria-hidden":`true`,children:l}),t[11]=l,t[12]=o,t[13]=s,t[14]=d,t[15]=p):p=t[15];let m;return t[16]!==f||t[17]!==p?(m=(0,$.jsxs)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`sync-popover-last-sync`,children:[f,p]}),t[16]=f,t[17]=p,t[18]=m):m=t[18],m}function ca(e){let t=(0,Z.c)(145),{status:n,onSignIn:r,onSetIdentity:i}=e,{_:o}=u(),{conflictCount:s}=n,{projectLocalConfig:c,projectLocalSynced:d}=ge(),f=c?.autoSync,{mode:p,confirmOpen:m,setConfirmOpen:h,pendingMode:g,strandedCommitCount:_,onModeSelect:v,onConfirm:y}=xe(f,n.ahead),{status:x,loading:S}=gi(!0),C=p===`follow`,w;t[0]===n?w=t[1]:(w=Mi(n),t[0]=n,t[1]=w);let T=w,E;t[2]===n?E=t[3]:(E=Bi(n),t[2]=n,t[3]=E);let D=E,O=n.lastPullOkUtc??null,k=n.lastPushOkUtc??null,A=n.lastRunUtc??n.lastSyncUtc??null,j=n.pushPermission?.checkStatus===`denied`&&n.pushPermission.deniedReason!==`not-authenticated`&&!D,M=!j,N=T===`fetching`||T===`pulling`||T===`pushing`,[P,F]=(0,Q.useState)(null),I,L;t[4]===N?(I=t[5],L=t[6]):(I=()=>{N||F(null)},L=[N],t[4]=N,t[5]=I,t[6]=L),(0,Q.useEffect)(I,L);let R;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>{F(t=>t===e?null:t)},t[7]=R):R=t[7];let z=R,B=N?P??(T===`pushing`?`push`:`pull`):null,ee;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(ee=e=>{F(e),Di(e,()=>z(e))},t[8]=ee):ee=t[8];let W=ee,re=T===`dormant`||T===`auth-error`||n.state===`conflict`,G=re||n.conflictCount>0,K;t[9]===n.blockingPaths?K=t[10]:(K=n.blockingPaths??[],t[9]=n.blockingPaths,t[10]=K);let ae=K,{conflicts:oe}=Tr(),se=oe[0]??null,ce=T===`conflict`&&se!==null,le;t[11]===n?le=t[12]:(le=(0,$.jsx)(Ni,{status:n}),t[11]=n,t[12]=le);let ue;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(ue=(0,$.jsx)(`span`,{className:`text-1sm font-medium`,children:(0,$.jsx)(l,{id:`yZepkk`})}),t[13]=ue):ue=t[13];let q;t[14]===le?q=t[15]:(q=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[le,ue]}),t[14]=le,t[15]=q);let de;t[16]!==o||t[17]!==n.remote?(de=n.remote&&(n.remote.webUrl?(0,$.jsxs)(`a`,{href:n.remote.webUrl,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex min-w-0 items-center gap-0.5 text-xs text-foreground hover:text-primary hover:underline`,"aria-label":o({id:`1nke1r`,values:{0:n.remote.label}}),children:[(0,$.jsx)(`span`,{className:`truncate`,children:n.remote.label}),(0,$.jsx)(Ee,{className:`size-3.5 shrink-0`,"aria-hidden":!0})]}):(0,$.jsx)(`span`,{className:`min-w-0 truncate text-xs text-foreground`,children:n.remote.label})),t[16]=o,t[17]=n.remote,t[18]=de):de=t[18];let J;t[19]!==q||t[20]!==de?(J=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[q,de]}),t[19]=q,t[20]=de,t[21]=J):J=t[21];let fe=g??`full`,Y;t[22]!==m||t[23]!==y||t[24]!==h||t[25]!==_||t[26]!==fe?(Y=(0,$.jsx)(Se,{open:m,onOpenChange:h,onConfirm:y,variant:fe,strandedCommitCount:_}),t[22]=m,t[23]=y,t[24]=h,t[25]=_,t[26]=fe,t[27]=Y):Y=t[27];let pe;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,$.jsx)(Xi,{children:(0,$.jsx)(l,{id:`CnOGgs`})}),t[28]=pe):pe=t[28];let me;t[29]===v?me=t[30]:(me=e=>{ie(e)&&v(e)},t[29]=v,t[30]=me);let he=!d,_e;t[31]===o?_e=t[32]:(_e=o({id:`CnOGgs`}),t[31]=o,t[32]=_e);let ve;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(ve=(0,$.jsx)(H,{}),t[33]=ve):ve=t[33];let X;t[34]===_e?X=t[35]:(X=(0,$.jsx)(ne,{size:`sm`,className:`w-full text-xs`,"aria-label":_e,"data-testid":`sync-mode-select`,children:ve}),t[34]=_e,t[35]=X);let ye;t[36]===o?ye=t[37]:(ye=o({id:`BWTzAb`}),t[36]=o,t[37]=ye);let be;t[38]===ye?be=t[39]:(be=(0,$.jsx)(te,{value:`off`,className:`text-xs`,children:ye}),t[38]=ye,t[39]=be);let Te;t[40]===o?Te=t[41]:(Te=o({id:`tlGXxX`}),t[40]=o,t[41]=Te);let De;t[42]===Te?De=t[43]:(De=(0,$.jsx)(te,{value:`follow`,className:`text-xs`,children:Te}),t[42]=Te,t[43]=De);let Oe;t[44]===o?Oe=t[45]:(Oe=o({id:`IXiG0B`}),t[44]=o,t[45]=Oe);let ke;t[46]!==j||t[47]!==Oe?(ke=(0,$.jsx)(te,{value:`full`,className:`text-xs`,disabled:j,children:Oe}),t[46]=j,t[47]=Oe,t[48]=ke):ke=t[48];let Ae;t[49]!==be||t[50]!==De||t[51]!==ke?(Ae=(0,$.jsxs)(V,{children:[be,De,ke]}),t[49]=be,t[50]=De,t[51]=ke,t[52]=Ae):Ae=t[52];let je;t[53]!==p||t[54]!==me||t[55]!==he||t[56]!==X||t[57]!==Ae?(je=(0,$.jsxs)(U,{value:p,onValueChange:me,disabled:he,children:[X,Ae]}),t[53]=p,t[54]=me,t[55]=he,t[56]=X,t[57]=Ae,t[58]=je):je=t[58];let Me;t[59]===p?Me=t[60]:(Me=(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`sync-popover-mode-line`,children:p===`off`?(0,$.jsx)(l,{id:`qD3krc`}):p===`follow`?(0,$.jsx)(l,{id:`PGRnbw`}):(0,$.jsx)(l,{id:`zBiFZh`})}),t[59]=p,t[60]=Me);let Ne;t[61]!==je||t[62]!==Me?(Ne=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[pe,je,Me]}),t[61]=je,t[62]=Me,t[63]=Ne):Ne=t[63];let Pe;t[64]===Symbol.for(`react.memo_cache_sentinel`)?(Pe=(0,$.jsx)(Xi,{children:(0,$.jsx)(l,{id:`BWTzAb`})}),t[64]=Pe):Pe=t[64];let Le=N||re,Re;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(Re=()=>W(`pull`),t[65]=Re):Re=t[65];let ze;t[66]===B?ze=t[67]:(ze=B===`pull`?(0,$.jsx)(Fe,{"aria-hidden":`true`,"data-icon":`inline-start`}):(0,$.jsx)(we,{"data-icon":`inline-start`}),t[66]=B,t[67]=ze);let Be;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(Be=(0,$.jsx)(l,{id:`e4GHWP`}),t[68]=Be):Be=t[68];let He;t[69]!==Le||t[70]!==ze?(He=(0,$.jsxs)(b,{variant:`outline`,size:`xs`,className:`flex-1`,disabled:Le,onClick:Re,"data-testid":`sync-popover-pull`,children:[ze,Be]}),t[69]=Le,t[70]=ze,t[71]=He):He=t[71];let We;t[72]!==N||t[73]!==M||t[74]!==G||t[75]!==B?(We=M&&(0,$.jsxs)(b,{variant:`outline`,size:`xs`,className:`flex-1`,disabled:N||G,onClick:()=>W(`push`),"data-testid":`sync-popover-push`,children:[B===`push`?(0,$.jsx)(Fe,{"aria-hidden":`true`,"data-icon":`inline-start`}):(0,$.jsx)(Ce,{"data-icon":`inline-start`}),(0,$.jsx)(l,{id:`uO9WLl`})]}),t[72]=N,t[73]=M,t[74]=G,t[75]=B,t[76]=We):We=t[76];let Ge;t[77]!==He||t[78]!==We?(Ge=(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[He,We]}),t[77]=He,t[78]=We,t[79]=Ge):Ge=t[79];let Ke;t[80]!==N||t[81]!==M||t[82]!==G||t[83]!==B?(Ke=M&&(0,$.jsxs)(b,{size:`xs`,className:`w-full`,disabled:N||G,onClick:()=>W(`sync`),"data-testid":`sync-popover-sync`,children:[B===`sync`?(0,$.jsx)(Fe,{"aria-hidden":`true`,icon:Ie,"data-icon":`inline-start`}):(0,$.jsx)(Ie,{"data-icon":`inline-start`}),(0,$.jsx)(l,{id:`YEzhIr`})]}),t[80]=N,t[81]=M,t[82]=G,t[83]=B,t[84]=Ke):Ke=t[84];let qe;t[85]!==Ge||t[86]!==Ke?(qe=(0,$.jsxs)(`div`,{className:`flex flex-col gap-2 border-t pt-3`,children:[Pe,Ge,Ke]}),t[85]=Ge,t[86]=Ke,t[87]=qe):qe=t[87];let Je;if(t[88]!==o||t[89]!==n){let e;t[91]===o?e=t[92]:(e=e=>(0,$.jsx)(`p`,{className:`text-xs text-destructive`,children:e.direction===`push`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`span`,{className:`font-medium`,children:[o({id:`uO9WLl`}),`: `]}),e.message]}):e.direction===`pull`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`span`,{className:`font-medium`,children:[o({id:`e4GHWP`}),`: `]}),e.message]}):e.message},e.key),t[91]=o,t[92]=e),Je=Ki(n).map(e),t[88]=o,t[89]=n,t[90]=Je}else Je=t[90];let Ye;t[93]===n?Ye=t[94]:(Ye=Vi(n)&&n.pushPermission?.checkStatus===`denied`?Ri(n.pushPermission).map(fa):null,t[93]=n,t[94]=Ye);let Xe;t[95]!==n.pausedReason||t[96]!==n.pushPermission?(Xe=n.pausedReason===`no-push-permission`&&n.pushPermission?.checkStatus===`denied`?Ri(n.pushPermission).map(da):null,t[95]=n.pausedReason,t[96]=n.pushPermission,t[97]=Xe):Xe=t[97];let Ze;t[98]!==Je||t[99]!==Ye||t[100]!==Xe?(Ze=(0,$.jsxs)(`div`,{role:`status`,"aria-live":`polite`,className:`flex flex-col gap-3.5 empty:sr-only`,children:[Je,Ye,Xe]}),t[98]=Je,t[99]=Ye,t[100]=Xe,t[101]=Ze):Ze=t[101];let Qe;t[102]!==ae||t[103]!==C||t[104]!==j||t[105]!==r||t[106]!==n?(Qe=!C&&Hi(n.pushPermission)?(0,$.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,$.jsx)(`p`,{className:`min-w-0 flex-1 text-xs text-muted-foreground`,children:(0,$.jsx)(l,{id:`ycIX5i`})}),r&&(0,$.jsx)(b,{variant:`outline`,size:`xs`,className:`self-start`,onClick:r,children:(0,$.jsx)(l,{id:`5lWFkC`})})]}):ae.length>0?(0,$.jsx)(yi,{paths:ae}):Vi(n)?null:n.pausedReason?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:Ii(n.pausedReason)}):!C&&j&&n.pushPermission?.checkStatus===`denied`?Li(n.pushPermission.deniedReason,n.pushPermission).map(ua):qi(n.pushPermission)?(0,$.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,$.jsx)(`p`,{className:`min-w-0 flex-1 text-xs text-muted-foreground`,children:(0,$.jsx)(l,{id:`C_cPoW`})}),r&&(0,$.jsx)(b,{variant:`outline`,size:`xs`,className:`self-start`,onClick:r,children:(0,$.jsx)(l,{id:`5lWFkC`})})]}):null,t[102]=ae,t[103]=C,t[104]=j,t[105]=r,t[106]=n,t[107]=Qe):Qe=t[107];let $e;t[108]!==se||t[109]!==ce||t[110]!==T?($e=T===`conflict`&&(0,$.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,$.jsx)(`p`,{className:`min-w-0 flex-1 text-xs text-amber-700 dark:text-amber-400`,children:(0,$.jsx)(l,{id:`ko386X`})}),ce&&se&&(0,$.jsx)(b,{variant:`outline`,size:`xs`,className:`self-start`,onClick:()=>Oi(Ve(Ue(se.file))),children:(0,$.jsx)(l,{id:`5k0NLb`})})]}),t[108]=se,t[109]=ce,t[110]=T,t[111]=$e):$e=t[111];let et;t[112]!==r||t[113]!==T||t[114]!==n?(et=T===`auth-error`&&!Vi(n)&&r&&(0,$.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,$.jsx)(`p`,{className:`min-w-0 flex-1 text-xs text-destructive`,children:(0,$.jsx)(l,{id:`Vl1H8I`})}),(0,$.jsx)(b,{variant:`outline`,size:`xs`,className:`self-start`,onClick:r,children:(0,$.jsx)(l,{id:`5lWFkC`})})]}),t[112]=r,t[113]=T,t[114]=n,t[115]=et):et=t[115];let tt;t[116]===s?tt=t[117]:(tt=s>0&&(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,$.jsx)(l,{id:`B4_ipX`,values:{conflictCount:s}})}),t[116]=s,t[117]=tt);let rt;t[118]!==n||t[119]!==x||t[120]!==S?(rt=(0,$.jsx)(oa,{status:n,worktree:x,loading:S}),t[118]=n,t[119]=x,t[120]=S,t[121]=rt):rt=t[121];let it;t[122]!==A||t[123]!==O||t[124]!==k?(it=(0,$.jsx)(sa,{pulledAt:O,pushedAt:k,combinedAt:A}),t[122]=A,t[123]=O,t[124]=k,t[125]=it):it=t[125];let at;t[126]===Symbol.for(`react.memo_cache_sentinel`)?(at=(0,$.jsx)(nt,{asChild:!0,children:(0,$.jsxs)(b,{variant:`link`,size:`xs`,className:`h-auto p-0 text-xs text-muted-foreground hover:font-medium hover:text-foreground hover:no-underline`,onClick:la,"data-testid":`sync-popover-settings`,children:[(0,$.jsx)(a,{"data-icon":`inline-start`}),(0,$.jsx)(l,{id:`VNgKZz`})]})}),t[126]=at):at=t[126];let ot;t[127]===it?ot=t[128]:(ot=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[it,at]}),t[127]=it,t[128]=ot);let st;t[129]!==i||t[130]!==n.identityUnresolved?(st=n.identityUnresolved&&i&&(0,$.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-dashed p-2`,children:[(0,$.jsx)(xt,{className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground`}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,$.jsx)(`p`,{className:`text-xs leading-snug text-muted-foreground`,children:(0,$.jsx)(l,{id:`nrGWJ7`})}),(0,$.jsx)(b,{variant:`outline`,size:`xs`,className:`self-start`,onClick:i,children:(0,$.jsx)(l,{id:`keNFEd`})})]})]}),t[129]=i,t[130]=n.identityUnresolved,t[131]=st):st=t[131];let ct;return t[132]!==J||t[133]!==Y||t[134]!==Ne||t[135]!==qe||t[136]!==Ze||t[137]!==Qe||t[138]!==$e||t[139]!==et||t[140]!==tt||t[141]!==rt||t[142]!==ot||t[143]!==st?(ct=(0,$.jsxs)(`div`,{className:`flex flex-col gap-3.5`,children:[J,Y,Ne,qe,Ze,Qe,$e,et,tt,rt,ot,st]}),t[132]=J,t[133]=Y,t[134]=Ne,t[135]=qe,t[136]=Ze,t[137]=Qe,t[138]=$e,t[139]=et,t[140]=tt,t[141]=rt,t[142]=ot,t[143]=st,t[144]=ct):ct=t[144],ct}function la(){return fe({advanced:!0})}function ua(e){return(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e},e)}function da(e){return(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e},e)}function fa(e){return(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e},e)}function pa(e){let t=(0,Z.c)(68),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{onSignIn:r,onSetIdentity:i}=n,{_:a}=u(),{status:o,fetchError:s}=ye();if(!o){if(s){let e;t[2]===a?e=t[3]:(e=a({id:`iqIDv4`}),t[2]=a,t[3]=e);let n;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(_t,{className:`size-3.5`}),t[4]=n):n=t[4];let r;t[5]===e?r=t[6]:(r=(0,$.jsx)(S,{asChild:!0,children:(0,$.jsx)(b,{variant:`ghost`,size:`icon-sm`,className:`text-muted-foreground`,"aria-label":e,disabled:!0,children:n})}),t[5]=e,t[6]=r);let i;t[7]===s?i=t[8]:(i=(0,$.jsx)(C,{children:s===`network`?(0,$.jsx)(l,{id:`I5AfhE`}):(0,$.jsx)(l,{id:`uKRYiW`})}),t[7]=s,t[8]=i);let o;return t[9]!==r||t[10]!==i?(o=(0,$.jsxs)(w,{children:[r,i]}),t[9]=r,t[10]=i,t[11]=o):o=t[11],o}return null}if(!o.hasRemote)return null;let c;t[12]===o?c=t[13]:(c=Pi(o),t[12]=o,t[13]=c);let d=c,f,p,m,h,g,_,v,y,x,T,E,D;if(t[14]!==a||t[15]!==o){let e=Ji(o);_=!!o.identityUnresolved,g=rt,h=w,m=S,D=!0,p=et,E=!0,f=b,v=`ghost`,y=`icon-sm`,x=`text-muted-foreground relative`,T=a(_?{id:`DFfRbX`,values:{syncStateLabel:e}}:{id:`F4vEsL`,values:{syncStateLabel:e}}),t[14]=a,t[15]=o,t[16]=f,t[17]=p,t[18]=m,t[19]=h,t[20]=g,t[21]=_,t[22]=v,t[23]=y,t[24]=x,t[25]=T,t[26]=E,t[27]=D}else f=t[16],p=t[17],m=t[18],h=t[19],g=t[20],_=t[21],v=t[22],y=t[23],x=t[24],T=t[25],E=t[26],D=t[27];let O;t[28]===o?O=t[29]:(O=(0,$.jsx)(Ni,{status:o}),t[28]=o,t[29]=O);let k;t[30]===d?k=t[31]:(k=d&&(0,$.jsx)(`span`,{className:`absolute -top-0.5 -right-0.5 text-[9px] leading-none font-medium bg-background border rounded-full px-0.5`,children:d}),t[30]=d,t[31]=k);let A;t[32]!==d||t[33]!==_?(A=!d&&_&&(0,$.jsx)(`span`,{className:`absolute -top-0.5 -right-0.5 size-1.5 rounded-full bg-amber-500 ring-2 ring-background`,"aria-hidden":!0}),t[32]=d,t[33]=_,t[34]=A):A=t[34];let j;t[35]!==f||t[36]!==k||t[37]!==A||t[38]!==v||t[39]!==y||t[40]!==x||t[41]!==T||t[42]!==O?(j=(0,$.jsxs)(f,{variant:v,size:y,className:x,"aria-label":T,children:[O,k,A]}),t[35]=f,t[36]=k,t[37]=A,t[38]=v,t[39]=y,t[40]=x,t[41]=T,t[42]=O,t[43]=j):j=t[43];let M;t[44]!==p||t[45]!==j||t[46]!==E?(M=(0,$.jsx)(p,{asChild:E,children:j}),t[44]=p,t[45]=j,t[46]=E,t[47]=M):M=t[47];let N;t[48]!==m||t[49]!==M||t[50]!==D?(N=(0,$.jsx)(m,{asChild:D,children:M}),t[48]=m,t[49]=M,t[50]=D,t[51]=N):N=t[51];let P;t[52]===o?P=t[53]:(P=Yi(o),t[52]=o,t[53]=P);let F;t[54]===P?F=t[55]:(F=(0,$.jsx)(C,{children:P}),t[54]=P,t[55]=F);let I;t[56]!==h||t[57]!==N||t[58]!==F?(I=(0,$.jsxs)(h,{children:[N,F]}),t[56]=h,t[57]=N,t[58]=F,t[59]=I):I=t[59];let L;t[60]!==i||t[61]!==r||t[62]!==o?(L=(0,$.jsx)(tt,{align:`end`,className:`flex max-h-(--radix-popover-content-available-height) w-80 flex-col overflow-y-auto p-3`,children:(0,$.jsx)(ca,{status:o,onSignIn:r,onSetIdentity:i})}),t[60]=i,t[61]=r,t[62]=o,t[63]=L):L=t[63];let R;return t[64]!==g||t[65]!==I||t[66]!==L?(R=(0,$.jsxs)(g,{children:[I,L]}),t[64]=g,t[65]=I,t[66]=L,t[67]=R):R=t[67],R}function ma(e){let t=(0,Z.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,size:i,asChild:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`default`:i,s=a!==void 0&&a?x:`div`,c;t[5]===n?c=t[6]:(c=f(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,n),t[5]=n,t[6]=c);let l;return t[7]!==s||t[8]!==r||t[9]!==o||t[10]!==c?(l=(0,$.jsx)(s,{"data-slot":`card`,"data-size":o,className:c,...r}),t[7]=s,t[8]=r,t[9]=o,t[10]=c,t[11]=l):l=t[11],l}function ha(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=f(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`div`,{"data-slot":`card-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ga(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=f(`cn-font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`div`,{"data-slot":`card-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function _a(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=f(`text-sm text-muted-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`div`,{"data-slot":`card-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function va(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=f(`col-start-2 row-span-2 row-start-1 self-start justify-self-end`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`div`,{"data-slot":`card-action`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ya(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=f(`px-(--card-spacing)`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`div`,{"data-slot":`card-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ba(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=f(`flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`div`,{"data-slot":`card-footer`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var xa=`npx @inkeep/open-knowledge cowork`,Sa=`https://openknowledge.ai/docs/integrations/claude-code`;function Ca(){return typeof window<`u`&&typeof window.okDesktop?.skill==`object`}function wa(e){let t=(0,Z.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,$.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 font-mono text-[0.85em]`,children:n}),t[0]=n,t[1]=r),r}function Ta(e){let t=(0,Z.c)(5),{children:n,className:r}=e,i;t[0]===r?i=t[1]:(i=f(`font-mono tracking-wide uppercase text-primary font-medium text-xs`,r),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,$.jsx)(`p`,{className:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function Ea(e){let t=(0,Z.c)(4),{n}=e,r;t[0]===n?r=t[1]:(r=n.toString().padStart(2,`0`),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`flex h-5 w-5 shrink-0 items-center justify-center text-xs font-medium text-muted-foreground font-mono tabular-nums`,children:r}),t[2]=r,t[3]=i),i}function Da(){let e=(0,Z.c)(8),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Ta,{children:(0,$.jsx)(l,{id:`cIptmH`})}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(Ea,{n:1}),e[1]=n):n=e[1];let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsxs)(`li`,{className:`flex gap-3`,children:[n,(0,$.jsx)(`span`,{children:(0,$.jsx)(l,{id:`pHYP6v`,components:{0:(0,$.jsx)(`strong`,{className:`font-medium`}),1:(0,$.jsx)(Te,{"aria-hidden":`true`,className:`inline h-3 w-3 text-muted-foreground`}),2:(0,$.jsx)(`strong`,{className:`font-medium`})}})})]}),e[2]=r):r=e[2];let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(Ea,{n:2}),e[3]=i):i=e[3];let a;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsxs)(`li`,{className:`flex gap-3`,children:[i,(0,$.jsx)(`span`,{children:(0,$.jsx)(l,{id:`gGVP4q`,components:{0:(0,$.jsx)(`span`,{className:`inline-flex items-center justify-center font-medium border h-5 w-5 rounded-md text-xs`}),1:(0,$.jsx)(Te,{"aria-hidden":`true`,className:`inline h-3 w-3 text-muted-foreground`}),2:(0,$.jsx)(`strong`,{className:`font-medium`}),3:(0,$.jsx)(Te,{"aria-hidden":`true`,className:`inline h-3 w-3 text-muted-foreground`}),4:(0,$.jsx)(`strong`,{className:`font-medium`})}})})]}),e[4]=a):a=e[4];let o;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(Ea,{n:3}),e[5]=o):o=e[5];let s;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsxs)(`ol`,{className:`flex flex-col gap-4 text-sm`,children:[r,a,(0,$.jsxs)(`li`,{className:`flex gap-3`,children:[o,(0,$.jsx)(`span`,{children:(0,$.jsx)(l,{id:`COr1Y7`,components:{0:(0,$.jsx)(wa,{}),1:(0,$.jsx)(`strong`,{className:`font-medium`})}})})]})]}),e[6]=s):s=e[6];let c;return e[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[t,s,(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground mt-4`,children:(0,$.jsx)(l,{id:`kV2YZv`,components:{0:(0,$.jsx)(`strong`,{className:`font-medium`}),1:(0,$.jsx)(`strong`,{className:`font-medium`}),2:(0,$.jsx)(Te,{"aria-hidden":`true`,className:`inline h-3 w-3 text-muted-foreground`}),3:(0,$.jsx)(Te,{"aria-hidden":`true`,className:`inline h-3 w-3 text-muted-foreground`})}})})]}),e[7]=c):c=e[7],c}function Oa(e){let t=(0,Z.c)(74),{open:n,onOpenChange:r,reinstall:i}=e,a=i===void 0?!1:i,{_:o}=u(),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={kind:`idle`},t[0]=c):c=t[0];let[d,f]=(0,Q.useState)(c),[p,m]=(0,Q.useState)(!1),h,g;t[1]===n?(h=t[2],g=t[3]):(h=()=>{n||(f({kind:`idle`}),m(!1))},g=[n],t[1]=n,t[2]=h,t[3]=g),(0,Q.useEffect)(h,g);let _;t[4]===o?_=t[5]:(_=async function(){f({kind:`downloading`});let e=window.okDesktop?.skill;if(!e){f({kind:`error`,message:o({id:`y46m5r`})});return}let t=await e.buildAndOpen();if(t.ok)f({kind:`handed-off`,path:t.path});else{let e=t.message??t.reason;J.error(o({id:`hSySVc`,values:{msg:e}})),f({kind:`error`,message:t.reason===`open-failed`?o({id:`IA1wNb`,values:{msg:e}}):`${t.reason}: ${e}`})}},t[4]=o,t[5]=_);let v=_,y;t[6]===o?y=t[7]:(y=async function(){try{await navigator.clipboard.writeText(xa),m(!0),setTimeout(()=>m(!1),2e3)}catch(e){let t=e,n=t instanceof Error?t.message:String(t);J.error(o({id:`Uw6ERJ`,values:{detail:n}}))}},t[6]=o,t[7]=y);let x=y,S;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(S=Ca(),t[8]=S):S=t[8];let C=S,w;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(Ae,{"aria-hidden":`true`,className:`h-4 w-4`}),t[9]=w):w=t[9];let T;t[10]===a?T=t[11]:(T=(0,$.jsxs)(k,{className:`flex items-center gap-2`,children:[w,a?(0,$.jsx)(l,{id:`xNyj3h`}):(0,$.jsx)(l,{id:`7qRHf0`})]}),t[10]=a,t[11]=T);let E;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(O,{children:(0,$.jsx)(l,{id:`9V0W-R`,components:{0:(0,$.jsx)(`strong`,{className:`font-medium text-foreground`})}})}),t[12]=E):E=t[12];let D;t[13]===T?D=t[14]:(D=(0,$.jsxs)(N,{children:[T,E]}),t[13]=T,t[14]=D);let F;t[15]===d.kind?F=t[16]:(F=d.kind===`idle`&&C&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(Ta,{className:`text-muted-foreground`,children:(0,$.jsx)(l,{id:`Dnn2XG`})}),(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(l,{id:`RN62Q8`,components:{0:(0,$.jsx)(wa,{}),1:(0,$.jsx)(wa,{})}})})]}),(0,$.jsx)(Da,{})]}),t[15]=d.kind,t[16]=F);let I;t[17]!==o||t[18]!==p||t[19]!==x||t[20]!==d.kind?(I=d.kind===`idle`&&!C&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(Ta,{children:(0,$.jsx)(l,{id:`L8fKuc`})}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border bg-muted/40 p-2`,children:[(0,$.jsx)(`code`,{className:`flex-1 font-mono text-xs`,children:xa}),(0,$.jsx)(b,{variant:`ghost`,size:`sm`,onClick:x,"aria-label":o({id:`Oos8fo`}),className:`h-7 gap-1`,children:p?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(ke,{"aria-hidden":`true`,className:`h-3 w-3`}),(0,$.jsx)(l,{id:`6V3Ea3`})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(s,{"aria-hidden":`true`,className:`h-3 w-3`}),(0,$.jsx)(l,{id:`he3ygx`})]})})]}),(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(l,{id:`z60Lgn`,components:{0:(0,$.jsx)(wa,{})}})})]}),(0,$.jsx)(Da,{})]}),t[17]=o,t[18]=p,t[19]=x,t[20]=d.kind,t[21]=I):I=t[21];let L;t[22]===d.kind?L=t[23]:(L=d.kind===`downloading`&&(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,$.jsx)(Fe,{"aria-hidden":`true`,className:`h-4 w-4`}),(0,$.jsx)(l,{id:`bwil08`,components:{0:(0,$.jsx)(wa,{})}})]}),t[22]=d.kind,t[23]=L);let R;t[24]!==d.kind||t[25]!==d.path?(R=d.kind===`handed-off`&&C&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-primary/30 bg-primary/5 px-3 py-2`,children:[(0,$.jsx)(ke,{"aria-hidden":`true`,className:`mt-0.5 h-4 w-4 text-primary`}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:(0,$.jsx)(l,{id:`r51jLC`})}),(0,$.jsx)(`code`,{className:`font-mono text-xs text-muted-foreground`,children:d.path??`~/Downloads/openknowledge.skill`})]})]}),(0,$.jsx)(Da,{})]}),t[24]=d.kind,t[25]=d.path,t[26]=R):R=t[26];let z;t[27]===d.kind?z=t[28]:(z=d.kind===`handed-off`&&!C&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-primary/30 bg-primary/5 px-3 py-2`,children:[(0,$.jsx)(ke,{"aria-hidden":`true`,className:`mt-0.5 h-4 w-4 text-primary`}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:(0,$.jsx)(l,{id:`hynz2K`})}),(0,$.jsx)(`span`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(l,{id:`qXg5W9`,components:{0:(0,$.jsx)(wa,{})}})})]})]}),(0,$.jsx)(Da,{})]}),t[27]=d.kind,t[28]=z);let B;t[29]!==d.kind||t[30]!==d.message?(B=d.kind===`error`&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-2 text-sm`,children:[(0,$.jsx)(`span`,{className:`text-destructive`,children:d.message}),(0,$.jsx)(`a`,{href:Sa,target:`_blank`,rel:`noopener noreferrer`,onClick:Ma,onAuxClick:ja,className:`text-xs underline underline-offset-2 hover:text-foreground`,children:(0,$.jsx)(l,{id:`mGaZwZ`})})]}),t[29]=d.kind,t[30]=d.message,t[31]=B):B=t[31];let ee;t[32]!==F||t[33]!==I||t[34]!==L||t[35]!==R||t[36]!==z||t[37]!==B?(ee=(0,$.jsx)(j,{children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-6 py-2`,children:[F,I,L,R,z,B]})}),t[32]=F,t[33]=I,t[34]=L,t[35]=R,t[36]=z,t[37]=B,t[38]=ee):ee=t[38];let te;t[39]===d.kind?te=t[40]:(te=d.kind!==`error`&&(0,$.jsxs)(`a`,{href:Sa,target:`_blank`,rel:`noopener noreferrer`,onClick:Aa,onAuxClick:ka,className:`inline-flex items-center gap-1 self-center text-xs text-muted-foreground underline underline-offset-2 hover:text-foreground sm:mr-auto font-mono tracking-wide uppercase`,children:[(0,$.jsx)(l,{id:`U3IvM5`}),(0,$.jsx)(bt,{"aria-hidden":`true`,className:`h-3 w-3`})]}),t[39]=d.kind,t[40]=te);let V;t[41]!==v||t[42]!==r||t[43]!==d.kind||t[44]!==a?(V=d.kind===`idle`&&C&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(b,{className:`uppercase font-mono`,variant:`outline`,onClick:()=>r(!1),children:(0,$.jsx)(l,{id:`dEgA5A`})}),(0,$.jsxs)(b,{onClick:v,children:[(0,$.jsx)(Ae,{"aria-hidden":`true`,className:`h-4 w-4`}),a?(0,$.jsx)(l,{id:`YGIi_c`}):(0,$.jsx)(l,{id:`TKQ7K-`})]})]}),t[41]=v,t[42]=r,t[43]=d.kind,t[44]=a,t[45]=V):V=t[45];let ne;t[46]!==r||t[47]!==d.kind?(ne=d.kind===`idle`&&!C&&(0,$.jsx)(b,{className:`uppercase font-mono`,variant:`outline`,onClick:()=>r(!1),children:(0,$.jsx)(l,{id:`yz7wBu`})}),t[46]=r,t[47]=d.kind,t[48]=ne):ne=t[48];let H;t[49]!==v||t[50]!==r||t[51]!==d.kind?(H=d.kind===`error`&&C&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(b,{className:`uppercase font-mono`,variant:`outline`,onClick:()=>r(!1),children:(0,$.jsx)(l,{id:`dEgA5A`})}),(0,$.jsxs)(b,{onClick:v,children:[(0,$.jsx)(Ae,{"aria-hidden":`true`,className:`h-4 w-4`}),(0,$.jsx)(l,{id:`KDw4GX`})]})]}),t[49]=v,t[50]=r,t[51]=d.kind,t[52]=H):H=t[52];let U;t[53]!==d.kind||t[54]!==a?(U=d.kind===`downloading`&&(0,$.jsxs)(b,{disabled:!0,children:[(0,$.jsx)(Fe,{"aria-hidden":`true`,className:`h-4 w-4`}),a?(0,$.jsx)(l,{id:`fIgqfQ`}):(0,$.jsx)(l,{id:`Wtw22s`})]}),t[53]=d.kind,t[54]=a,t[55]=U):U=t[55];let W;t[56]!==r||t[57]!==d.kind?(W=d.kind===`handed-off`&&(0,$.jsx)(b,{onClick:()=>r(!1),children:(0,$.jsx)(l,{id:`DPfwMq`})}),t[56]=r,t[57]=d.kind,t[58]=W):W=t[58];let re;t[59]!==te||t[60]!==V||t[61]!==ne||t[62]!==H||t[63]!==U||t[64]!==W?(re=(0,$.jsxs)(M,{children:[te,V,ne,H,U,W]}),t[59]=te,t[60]=V,t[61]=ne,t[62]=H,t[63]=U,t[64]=W,t[65]=re):re=t[65];let G;t[66]!==D||t[67]!==ee||t[68]!==re?(G=(0,$.jsxs)(A,{className:`sm:max-w-lg`,"data-ok-layer-spawned":``,children:[D,ee,re]}),t[66]=D,t[67]=ee,t[68]=re,t[69]=G):G=t[69];let K;return t[70]!==r||t[71]!==n||t[72]!==G?(K=(0,$.jsx)(P,{open:n,onOpenChange:r,children:G}),t[70]=r,t[71]=n,t[72]=G,t[73]=K):K=t[73],K}function ka(e){return it(e,Sa)}function Aa(e){return it(e,Sa)}function ja(e){return it(e,Sa)}function Ma(e){return it(e,Sa)}var Na=new Set;function Pa(e){for(let t of Na)try{t(e)}catch(e){console.warn(`[config-ignore-nested-error-events] listener threw:`,e)}}function Fa(e){return Na.add(e),()=>{Na.delete(e)}}var Ia=new Set;function La(e){for(let t of Ia)try{t(e)}catch(e){console.warn(`[config-validation-events] listener threw:`,e)}}function Ra(e){return Ia.add(e),()=>{Ia.delete(e)}}var za=null;function Ba(){return za}function Va(e){za=e}export{Pt as $,Ar as A,yr as B,ri as C,jr as D,Hr as E,Er as F,On as G,gr as H,Tr as I,on as J,Dn as K,Sr as L,Pr as M,Fr as N,Nr as O,kr as P,Ut as Q,xr as R,qi as S,zr as T,Nn as U,br as V,kn as W,Gt as X,$t as Y,Ht as Z,Ii as _,Pa as a,Vi as b,ma as c,_a as d,kt as et,ba as f,Ri as g,pa as h,Ra as i,Or as j,Mr as k,va as l,ga as m,Va as n,Ct as nt,Fa as o,ha as p,wn as q,La as r,vt as rt,Oa as s,Ba as t,wt as tt,ya as u,Gi as v,Rr as w,Hi as x,Bi as y,Cr as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Mn as e,Yi as t,li as n}from"./dist-CNUsB2q0.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-BulbvLvN.js";var s=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`}]]),c=`support@inkeep.com`;function l(e){return`mailto:${c}?subject=${encodeURIComponent(e)}`}function u(e){return e.split(/[\\/]/).pop()??e}function d(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:e>=1024?`${Math.max(1,Math.round(e/1024))} KB`:`${e} B`}var f=200,p=/^(?:#{1,6}|>)(?:[ \t]+|$)/;function m(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();p.test(r);)r=r.replace(p,``).trim();if(r!==``)return e(r,f).trimEnd()}}var h=`open-knowledge-app`,g=`ok.bug-report.send.attempt`,_={traceparent:()=>void 0,end:()=>{}},v=_;function y(e={}){try{let t=i.getTracer(h).startSpan(g,{attributes:e});return t.isRecording()?b(t,i.setSpan(r,t)):(t.end(),v)}catch(e){return console.warn(`[bug-report-send-otel] span start failed:`,e instanceof Error?e:String(e)),v}}function b(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 x=200,S=3,C=.9;function w(e){if(e.kind===`history-row`){let{row:t}=e;return{zipPath:t.zipPath,zipSizeBytes:t.zipBytes,metadata:{level:t.bundleLevel===`unknown`?`standard`:t.bundleLevel,systemWide:t.systemWide,projectSlug:t.projectSlug,...t.note===void 0?{}:{note:t.note}}}}let{report:t,note:n,includeScreenshot:r}=e;return{zipPath:t.zipPath,zipSizeBytes:t.zipSizeBytes,metadata:{level:t.summary.level,systemWide:t.summary.systemWide,projectSlug:t.summary.projectSlug,note:n},includeScreenshot:r}}function T(e){let t=new Map,n=new Set,r=null;function i(){for(let e of n)try{e()}catch(e){console.warn(`[bug-report-send] subscriber threw:`,e)}}function a(e,t){e.state=t,r=null,i()}function o(e){return{operationId:e.operationId,zipPath:e.zipPath,zipSizeBytes:e.zipSizeBytes,requestSeq:e.requestSeq}}function s(e){e.fillTimer!==null&&(clearInterval(e.fillTimer),e.fillTimer=null)}function c(e){s(e);let t=Date.now();e.fillTimer=setInterval(()=>{if(e.state.status!==`sending`){s(e);return}let n=(Date.now()-t)/1e3,r=Math.min(C,1-Math.exp(-n/S)),i=Math.round(r*100);i!==e.state.fillPercent&&a(e,{...o(e),status:`sending`,fillPercent:i})},x)}function l(e,t){s(e),e.span.end(t.status===`email-draft`?`email-drafted`:t.status===`already-sending`?`joined`:t.status,{"ok.bug_report.request_seq":e.requestSeq}),a(e,{...o(e),...t})}function d(e,t){if(t.ok){l(e,{status:`sent`,reference:t.reference});return}if(t.reason===`email-draft`){l(e,{status:`email-draft`,mailtoUrl:t.fallback.mailtoUrl});return}if(t.reason===`send-in-flight`){l(e,{status:`already-sending`});return}l(e,{status:`failed`,mailtoUrl:t.fallback.mailtoUrl})}function f(e){e.span=y({"ok.bug_report.zip_bytes":e.input.zipSizeBytes,"ok.bug_report.include_screenshot":e.input.includeScreenshot===!0,"ok.bug_report.attempt":e.requestSeq}),a(e,{...o(e),status:`sending`,fillPercent:0}),c(e),m(e,e.input)}function p(e){return e.requestSeq+=1,e.state.status===`sending`?(a(e,{...o(e),status:`sending`,fillPercent:e.state.fillPercent}),e.state):(f(e),e.state)}async function m(t,n){try{let r=e();if(r===void 0){console.warn(`[bug-report-send] no desktop bridge; send cannot be dispatched`),l(t,{status:`failed`});return}let i=t.span.traceparent();d(t,await r.send({zipPath:n.zipPath,metadata:n.metadata,...n.includeScreenshot===void 0?{}:{includeScreenshot:n.includeScreenshot},...i===void 0?{}:{traceparent:i}}))}catch(e){console.warn(`[bug-report-send] IPC dispatch threw:`,e),l(t,{status:`failed`})}}return{startBugReportSend(e){let n=w(e),r=u(n.zipPath),i=t.get(r);if(i!==void 0)return i.input=n,p(i);let a={operationId:r,zipPath:n.zipPath,zipSizeBytes:n.zipSizeBytes,requestSeq:1},o={...a,input:n,fillTimer:null,state:{...a,status:`sending`,fillPercent:0},span:_};return t.set(r,o),f(o),o.state},retryBugReportSend(e){let n=t.get(e);n!==void 0&&p(n)},get(e){return t.get(e)?.state},getSnapshot(){return r??=[...t.values()].map(e=>e.state),r},subscribe(e){return n.add(e),()=>{n.delete(e)}}}}var E=T(()=>window.okDesktop?.bugReport);export{u as a,l as i,m as n,s as o,d as r,E as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Fn as e,In as t}from"./dist-CNUsB2q0.js";var n={BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.64.0`}?.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{Jn as t,Kn as n,Mn as r,Mr as i,Nr as a,ai as o,li as s,ni as c,zr as l}from"./DocumentContext-BId0aBaa.js";import{n as u,r as d}from"./dist-Nvb76hAm.js";import{t as f}from"./compiler-runtime-BfE3aGVn.js";import{i as p}from"./local-menu-action-bus-BLEUyEvu.js";import{t as m}from"./utils-CPqDy6Hr.js";import{t as h}from"./button-Cym3gapE.js";import{i as g,n as _,t as v}from"./tooltip-DttaCTqz.js";import{xt as y}from"./CodeMirrorPropInput-DtX4bjvR.js";import{Fi as b,Rn as x,er as S,tr as C,vr as w,zn as T}from"./dist-C_QZEaeX.js";import{n as E}from"./dist-CJhtNlOm2.js";import{t as D}from"./dist-Cr4-nBVI.js";import{t as O}from"./createLucideIcon-BulbvLvN.js";import{t as ee}from"./x-DbShSCr5.js";import{f as te}from"./doc-paths-CzO1mA3r.js";var k=O(`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=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 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]: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=b(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=w(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)||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=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=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=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:T(e,Math.max(0,t-U),t),suffix:T(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,n,i){let a=y(e);if(!a)return!1;let o=K(a.dom);if(!o)return r(n,`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 r(n,`comment-reveal`,()=>o.scrollTo({top:o.scrollTop+u,behavior:i?.instant||d?`auto`:`smooth`}))}var _e=1e4,Y=80,ve=1500,X=[`wheel`,`touchstart`,`mousedown`,`keydown`];function ye(e){let r=!1,o=null,c=null,l=-1,u=()=>{let t=n(e.docName);if(!t||t.isDestroyed)return!1;if(r||(r=!0,i(e.threadId)),e.quote===``)return o===null&&(o=Date.now(),a(e.threadId)),!0;let s=t.state.doc.content.size;return(c===null||s!==l)&&(c=W(t.state.doc,e.quote,e.context),l=s),!c||!J(t,c,e.docName,{instant:!0})?!1:(o===null&&(o=Date.now(),a(e.threadId)),!0)};s(`comments`),u(),n(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 X)window.removeEventListener(e,p,!0)}},p=()=>f(),m=()=>{u()&&o!==null&&Date.now()-o>=ve&&f()},h=t(m),g=window.setInterval(m,Y),_=window.setTimeout(()=>{o===null&&E.error(r?D._({id:`KeXgA-`}):D._({id:`JDQ5I5`})),f()},_e);for(let e of X)window.addEventListener(e,p,!0);m()}var Z=e();function be(){return c().length}function xe(){let e=(0,A.c)(4),t=c(),n;if(e[0]!==t){n=new Map;for(let e of t){let t=l(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,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=m(`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,Z.jsx)(p,{className:`size-3`}),i=(0,Z.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,Z.jsxs)(h,{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=m(`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 y;t[11]===l?y=t[12]:(y=l({id:`2zvUIK`}),t[11]=l,t[12]=y);let b;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Z.jsx)(k,{className:`size-3`}),t[13]=b):b=t[13];let x;t[14]!==n||t[15]!==c.length?(x=c.length>1?(0,Z.jsx)(u,{id:`5TmrYN`,values:{0:c.length,count:n}}):(0,Z.jsx)(u,{id:`eiUA4k`,values:{count:n}}),t[14]=n,t[15]=c.length,t[16]=x):x=t[16];let S;t[17]!==y||t[18]!==x?(S=(0,Z.jsx)(g,{asChild:!0,children:(0,Z.jsxs)(h,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":y,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:[b,x]})}),t[17]=y,t[18]=x,t[19]=S):S=t[19];let C;t[20]===c?C=t[21]:(C=(0,Z.jsx)(_,{className:`max-w-64`,children:c.length>1?(0,Z.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:c.map(we)}):(0,Z.jsx)(u,{id:`2zvUIK`})}),t[20]=c,t[21]=C);let w;t[22]!==S||t[23]!==C?(w=(0,Z.jsxs)(v,{children:[S,C]}),t[22]=S,t[23]=C,t[24]=w):w=t[24];let T;t[25]===l?T=t[26]:(T=l({id:`pFRz_E`}),t[25]=l,t[26]=T);let E;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Z.jsx)(ee,{className:`size-3`}),t[27]=E):E=t[27];let D;t[28]!==o||t[29]!==T?(D=(0,Z.jsx)(h,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":T,onClick:o,className:`size-4 p-0 text-muted-foreground hover:text-foreground`,children:E}),t[28]=o,t[29]=T,t[30]=D):D=t[30];let O;return t[31]!==D||t[32]!==w?(O=(0,Z.jsxs)(`span`,{"data-testid":`composer-context-chip-comments`,className:f,children:[w,D]}),t[31]=D,t[32]=w,t[33]=O):O=t[33],O}function we(e){return(0,Z.jsxs)(`li`,{className:`flex items-baseline gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`tabular-nums`,children:e.count}),(0,Z.jsx)(`span`,{className:`truncate`,children:Q(e.docName)})]},e.docName)}function Te(){return o()}function Q(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function Ee(e,t){let n=e;for(let e of t)n+=typeof e==`number`?`[${e}]`:`.${e}`;return n}function De(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=()=>{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{Jn as t,Kn as n,Mn as r,Mr as i,Nr as a,ai as o,li as s,ni as c,zr as l}from"./DocumentContext-D4-sdlnA.js";import{n as u,r as d}from"./dist-Nvb76hAm.js";import{t as f}from"./compiler-runtime-BfE3aGVn.js";import{i as p}from"./local-menu-action-bus-BLEUyEvu.js";import{t as m}from"./utils-CPqDy6Hr.js";import{t as h}from"./button-Cym3gapE.js";import{i as g,n as _,t as v}from"./tooltip-DttaCTqz.js";import{xt as y}from"./CodeMirrorPropInput-BM7OpNpf.js";import{Bn as b,Li as x,nr as S,tr as C,yr as w,zn as T}from"./dist-CNUsB2q0.js";import{n as E}from"./dist-CJhtNlOm2.js";import{t as D}from"./dist-Cr4-nBVI.js";import{t as O}from"./createLucideIcon-BulbvLvN.js";import{t as ee}from"./x-DbShSCr5.js";import{f as te}from"./doc-paths-BShtZt2N.js";var k=O(`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=T(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]: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=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=fe(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=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)||w(e.text,t,{syntaxIn:`needle`}).length>0;if(i!==``&&a!==``&&!o(i+t+a)&&o(i+a))return null;let s=C({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 pe(e,t,n){return{prefix:b(e,Math.max(0,t-U),t),suffix:b(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,n,i){let a=y(e);if(!a)return!1;let o=K(a.dom);if(!o)return r(n,`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 r(n,`comment-reveal`,()=>o.scrollTo({top:o.scrollTop+u,behavior:i?.instant||d?`auto`:`smooth`}))}var _e=1e4,Y=80,ve=1500,X=[`wheel`,`touchstart`,`mousedown`,`keydown`];function ye(e){let r=!1,o=null,c=null,l=-1,u=()=>{let t=n(e.docName);if(!t||t.isDestroyed)return!1;if(r||(r=!0,i(e.threadId)),e.quote===``)return o===null&&(o=Date.now(),a(e.threadId)),!0;let s=t.state.doc.content.size;return(c===null||s!==l)&&(c=W(t.state.doc,e.quote,e.context),l=s),!c||!J(t,c,e.docName,{instant:!0})?!1:(o===null&&(o=Date.now(),a(e.threadId)),!0)};s(`comments`),u(),n(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 X)window.removeEventListener(e,p,!0)}},p=()=>f(),m=()=>{u()&&o!==null&&Date.now()-o>=ve&&f()},h=t(m),g=window.setInterval(m,Y),_=window.setTimeout(()=>{o===null&&E.error(r?D._({id:`KeXgA-`}):D._({id:`JDQ5I5`})),f()},_e);for(let e of X)window.addEventListener(e,p,!0);m()}var Z=e();function be(){return c().length}function xe(){let e=(0,A.c)(4),t=c(),n;if(e[0]!==t){n=new Map;for(let e of t){let t=l(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,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=m(`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,Z.jsx)(p,{className:`size-3`}),i=(0,Z.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,Z.jsxs)(h,{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=m(`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 y;t[11]===l?y=t[12]:(y=l({id:`2zvUIK`}),t[11]=l,t[12]=y);let b;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Z.jsx)(k,{className:`size-3`}),t[13]=b):b=t[13];let x;t[14]!==n||t[15]!==c.length?(x=c.length>1?(0,Z.jsx)(u,{id:`5TmrYN`,values:{0:c.length,count:n}}):(0,Z.jsx)(u,{id:`eiUA4k`,values:{count:n}}),t[14]=n,t[15]=c.length,t[16]=x):x=t[16];let S;t[17]!==y||t[18]!==x?(S=(0,Z.jsx)(g,{asChild:!0,children:(0,Z.jsxs)(h,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":y,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:[b,x]})}),t[17]=y,t[18]=x,t[19]=S):S=t[19];let C;t[20]===c?C=t[21]:(C=(0,Z.jsx)(_,{className:`max-w-64`,children:c.length>1?(0,Z.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:c.map(we)}):(0,Z.jsx)(u,{id:`2zvUIK`})}),t[20]=c,t[21]=C);let w;t[22]!==S||t[23]!==C?(w=(0,Z.jsxs)(v,{children:[S,C]}),t[22]=S,t[23]=C,t[24]=w):w=t[24];let T;t[25]===l?T=t[26]:(T=l({id:`pFRz_E`}),t[25]=l,t[26]=T);let E;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Z.jsx)(ee,{className:`size-3`}),t[27]=E):E=t[27];let D;t[28]!==o||t[29]!==T?(D=(0,Z.jsx)(h,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":T,onClick:o,className:`size-4 p-0 text-muted-foreground hover:text-foreground`,children:E}),t[28]=o,t[29]=T,t[30]=D):D=t[30];let O;return t[31]!==D||t[32]!==w?(O=(0,Z.jsxs)(`span`,{"data-testid":`composer-context-chip-comments`,className:f,children:[w,D]}),t[31]=D,t[32]=w,t[33]=O):O=t[33],O}function we(e){return(0,Z.jsxs)(`li`,{className:`flex items-baseline gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`tabular-nums`,children:e.count}),(0,Z.jsx)(`span`,{className:`truncate`,children:Q(e.docName)})]},e.docName)}function Te(){return o()}function Q(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function Ee(e,t){let n=e;for(let e of t)n+=typeof e==`number`?`[${e}]`:`.${e}`;return n}function De(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=()=>{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(`
|