@inkeep/open-knowledge 0.66.1 → 0.66.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/dist/{acp-harness-probe-Bk3Dz297.mjs → acp-harness-probe-C-bmwKC0.mjs} +2 -2
  2. package/dist/cli.mjs +6 -6
  3. package/dist/constants-m3Xu5_Pm.mjs +2 -0
  4. package/dist/{git-handle-C9RPCwJN.mjs → git-handle-CehgIzoK.mjs} +2 -2
  5. package/dist/git-handle-DEJ8aYeH.mjs +1 -0
  6. package/dist/index.mjs +2 -2
  7. package/dist/init-CkmKaAE9.mjs +1 -0
  8. package/dist/{init-DNQN84w4.mjs → init-DwE-82L_.mjs} +3 -3
  9. package/dist/{launch-json-removal-CsfA7Q9t.mjs → launch-json-removal-C5njpRMR.mjs} +2 -2
  10. package/dist/{loader-DOE8T0bD.mjs → loader-Da9QChC_.mjs} +2 -2
  11. package/dist/loader-Dt_OoEGe.mjs +1 -0
  12. package/dist/md-manager-BZCd3Vha.mjs +2 -0
  13. package/dist/{open-browser-Bzfc84xQ.mjs → open-browser-DIMVmm0o.mjs} +2 -2
  14. package/dist/parse-worker.mjs +1 -1
  15. package/dist/{preview-Doha4cmP.mjs → preview-BBdR6vmw.mjs} +2 -2
  16. package/dist/preview-oAaqMEbf.mjs +1 -0
  17. package/dist/public/assets/{ActivityModeContent-xON2KhOz.js → ActivityModeContent-B37XJHxx.js} +1 -1
  18. package/dist/public/assets/{AddPropertiesButton-CC1Bimpt.js → AddPropertiesButton-eMa8eBGf.js} +1 -1
  19. package/dist/public/assets/{AgentDiffPane-BPGzdN_g.js → AgentDiffPane-DHlBPg3c.js} +1 -1
  20. package/dist/public/assets/{AgentThreadClientBinder-Sg80UfOQ.js → AgentThreadClientBinder-lpLw9XDN.js} +1 -1
  21. package/dist/public/assets/{BugReportHistory-BOcChnxP.js → BugReportHistory-CuN8iDlA.js} +1 -1
  22. package/dist/public/assets/{BugReportHistoryDialog-BgcEcCCO.js → BugReportHistoryDialog-DGj_pTZf.js} +1 -1
  23. package/dist/public/assets/{CodeMirrorPropInput-Dp0ghtC3.js → CodeMirrorPropInput-Be4UuxHJ.js} +1 -1
  24. package/dist/public/assets/{ConsentDialogBody-DQlUb8Vu.js → ConsentDialogBody-XPmv8PGk.js} +1 -1
  25. package/dist/public/assets/{DocumentContext-Ak51fAXi.js → DocumentContext-CZ1LyjXH.js} +1 -1
  26. package/dist/public/assets/{EditorModeToggle-DpkS50Z0.js → EditorModeToggle-jAYPDv4d.js} +1 -1
  27. package/dist/public/assets/{EnableSyncConfirmDialog-DyPeGiVT.js → EnableSyncConfirmDialog-DGwynRzU.js} +1 -1
  28. package/dist/public/assets/{ExcalidrawDocEditor-BKndnS9g.js → ExcalidrawDocEditor-BWNQPfhq.js} +1 -1
  29. package/dist/public/assets/FeedbackForm-BAO3lafp.js +1 -0
  30. package/dist/public/assets/{GraphPanel-BdWJsnt-.js → GraphPanel-DDKxNmOr.js} +1 -1
  31. package/dist/public/assets/{ImportSkillDialog-C5f6Lj0b.js → ImportSkillDialog-D_3ApyBv.js} +1 -1
  32. package/dist/public/assets/{LintConfigEditor-C21DnP0H.js → LintConfigEditor-B3Gj07cI.js} +1 -1
  33. package/dist/public/assets/ManagedArtifactProperties-CV1Prpoj.js +1 -0
  34. package/dist/public/assets/{ManagedArtifactProperties-Dd9YEu9g.js → ManagedArtifactProperties-DeYta-00.js} +1 -1
  35. package/dist/public/assets/{MermaidDocEditor-CftOutDD.js → MermaidDocEditor-CiHzMRN9.js} +1 -1
  36. package/dist/public/assets/{PropertyDisplayRow-B3tLCY9W.js → PropertyDisplayRow-sm9qwuBw.js} +1 -1
  37. package/dist/public/assets/{ReportBugDialogBody-DRDozPGc.js → ReportBugDialogBody-DZA9GXnC.js} +1 -1
  38. package/dist/public/assets/{ReportBugMenuTrigger-Sbn4B06b.js → ReportBugMenuTrigger-D4qlc7zz.js} +2 -2
  39. package/dist/public/assets/{SchemaConfigEditor-DXhpWbEp.js → SchemaConfigEditor-D17w4XxC.js} +1 -1
  40. package/dist/public/assets/{SessionsHost-CGbrz5ge.js → SessionsHost-Cl-gIFYH.js} +2 -2
  41. package/dist/public/assets/{SettingsDialogBody-GRqpQyOX.js → SettingsDialogBody-Cqc-yl4k.js} +1 -1
  42. package/dist/public/assets/{ShareBranchSwitchDialog-DgKD1FWp.js → ShareBranchSwitchDialog-Ct4sBRfQ.js} +1 -1
  43. package/dist/public/assets/{ShareReceiveDialog-BsGWPO5t.js → ShareReceiveDialog-B92aqQEx.js} +1 -1
  44. package/dist/public/assets/{ShareReceiveMissDialog-DX4YDzpC.js → ShareReceiveMissDialog-C9VJyG_D.js} +1 -1
  45. package/dist/public/assets/{SkillCostValue-B4D7Ysdc.js → SkillCostValue-DLUxO68c.js} +1 -1
  46. package/dist/public/assets/{SkillEditBanner-BruoXTh-.js → SkillEditBanner-b0gL75iO.js} +1 -1
  47. package/dist/public/assets/{SkillInstallMenu-QBcuRLjh.js → SkillInstallMenu-BwbbztKY.js} +1 -1
  48. package/dist/public/assets/{SkillOriginInline-Dshp1Rdi.js → SkillOriginInline-DpPKdpar.js} +1 -1
  49. package/dist/public/assets/{SkillToolbarControls-BCXxl3_M.js → SkillToolbarControls-Bap6lIv8.js} +1 -1
  50. package/dist/public/assets/{SlidesToolbarControls-CJxgVynH.js → SlidesToolbarControls-BNqlGZ8e.js} +1 -1
  51. package/dist/public/assets/{SourceEditor-D9_q6g5_.js → SourceEditor-RCKX4Ohe.js} +1 -1
  52. package/dist/public/assets/{TerminalPanel-Lt1-XHX1.js → TerminalPanel-Zo-UDi-u.js} +1 -1
  53. package/dist/public/assets/{TerminalWindowApp-VUZguLdJ.js → TerminalWindowApp-DjRpidld.js} +1 -1
  54. package/dist/public/assets/{TextDocEditor-Cb7BPpJA.js → TextDocEditor--IKVxg88.js} +1 -1
  55. package/dist/public/assets/{ThreadView-Bf53-ggV.js → ThreadView-CUArcRSL.js} +1 -1
  56. package/dist/public/assets/{TimelineDiffPane-B1HLCcW9.js → TimelineDiffPane-D8HcBg2n.js} +1 -1
  57. package/dist/public/assets/{agent-diff-store-XWhp_hqN.js → agent-diff-store-DgFkR0kV.js} +1 -1
  58. package/dist/public/assets/{auth-state-cache-D22yWCCz.js → auth-state-cache-DNrEadrI.js} +1 -1
  59. package/dist/public/assets/{bug-report-send-manager-BBNXam8A.js → bug-report-send-manager-5nrn8Psu.js} +1 -1
  60. package/dist/public/assets/{client-version-B_H8duw7.js → client-version-DewpIoVp.js} +1 -1
  61. package/dist/public/assets/{comment-chips-D0prCEAx.js → comment-chips-mYvhrkxj.js} +1 -1
  62. package/dist/public/assets/{config-provider-D-Y4Wg0x.js → config-provider-DWieljqa.js} +1 -1
  63. package/dist/public/assets/{dist-D1GzYuCD.js → dist-As2x8uCt.js} +1 -1
  64. package/dist/public/assets/{doc-paths-ByyIE836.js → doc-paths-BkNaaTOB.js} +1 -1
  65. package/dist/public/assets/{documents-events-DPqTvBXn.js → documents-events-2g_OBjKU.js} +1 -1
  66. package/dist/public/assets/{file-tree-adapter-Ccbih42A.js → file-tree-adapter-Q4uvZiQM.js} +1 -1
  67. package/dist/public/assets/{file-tree-utils-Jz2v-e9t.js → file-tree-utils-Cy2QEG_5.js} +1 -1
  68. package/dist/public/assets/{folder-config-api-BddKQIga.js → folder-config-api-DhiWnWlS.js} +1 -1
  69. package/dist/public/assets/i18n-CpxzRV_v.js +1 -0
  70. package/dist/public/assets/{index-nJnxhQRq.js → index-DrzqbmWI.js} +7 -7
  71. package/dist/public/assets/{launcher-selection-CUAKUPGW.js → launcher-selection-DTBWt8s2.js} +1 -1
  72. package/dist/public/assets/{lint-config-client-DeGP10La.js → lint-config-client-CQNYXMfG.js} +1 -1
  73. package/dist/public/assets/{markdownlint-rule-browser-Bir8KkrK.js → markdownlint-rule-browser-BTovNATK.js} +1 -1
  74. package/dist/public/assets/{page-list-cache-D2OX_WDU.js → page-list-cache-AR7XhC2q.js} +1 -1
  75. package/dist/public/assets/{pending-receive-nav-store-sErL2uzl.js → pending-receive-nav-store-DXWRYoc_.js} +1 -1
  76. package/dist/public/assets/{progress-DfDRMpm4.js → progress-YLRB2n7w.js} +1 -1
  77. package/dist/public/assets/{project-paths-DX_YsFET.js → project-paths-BmMTa57i.js} +1 -1
  78. package/dist/public/assets/{prop-types-NHOECtyl.js → prop-types-CTZ-Zcfm.js} +1 -1
  79. package/dist/public/assets/{receive-store-6Dih24L8.js → receive-store-RexqPtVU.js} +1 -1
  80. package/dist/public/assets/{selection-context-C95IJZrT.js → selection-context-BcWEVrAI.js} +1 -1
  81. package/dist/public/assets/{skill-scope-4RF9DbEf.js → skill-scope-CauFSzAn.js} +1 -1
  82. package/dist/public/assets/{skills-api-D5W0J2dk.js → skills-api-KE9J-94z.js} +1 -1
  83. package/dist/public/assets/{src-qGi8ucyG.js → src-B5LNuYlK.js} +1 -1
  84. package/dist/public/assets/{startup-marks-Bvho0uc6.js → startup-marks-CUyZjhyC.js} +1 -1
  85. package/dist/public/assets/{tag-pill-input-CtA1wFQO.js → tag-pill-input-CcAyDLGe.js} +1 -1
  86. package/dist/public/assets/{target-navigation-intent-BFUFQkcA.js → target-navigation-intent-D6pgYTG-.js} +1 -1
  87. package/dist/public/assets/{telemetry-startup-C_zn8gFF.js → telemetry-startup-BFCbpnFp.js} +1 -1
  88. package/dist/public/assets/{terminal-cli-display-ZGFW9kw3.js → terminal-cli-display-C2L3vHWw.js} +1 -1
  89. package/dist/public/assets/{typing-burst-detector-B0lg7vla.js → typing-burst-detector-BO09cycJ.js} +1 -1
  90. package/dist/public/assets/{uninstall-BkDWS7iv.js → uninstall-DJhzaTa1.js} +1 -1
  91. package/dist/public/assets/{use-activity-panel-CuqTH-mx.js → use-activity-panel-BCJavN8T.js} +1 -1
  92. package/dist/public/assets/{use-apply-config-color-theme-Ba8Smkdy.js → use-apply-config-color-theme-CwClEWrd.js} +1 -1
  93. package/dist/public/assets/{use-collab-url-DFpuF-wX.js → use-collab-url-DHOOSaDb.js} +1 -1
  94. package/dist/public/assets/{use-live-xterm-theme-c1fyCaal.js → use-live-xterm-theme-_zomIp7z.js} +1 -1
  95. package/dist/public/assets/{use-open-skill-DJmjKHgr.js → use-open-skill-DzG96lKz.js} +1 -1
  96. package/dist/public/assets/{use-settings-route-BQW0aTo0.js → use-settings-route-Dq3eM_ye.js} +1 -1
  97. package/dist/public/assets/{use-skill-origin-WyyVjfzt.js → use-skill-origin-uUY8unvE.js} +1 -1
  98. package/dist/public/assets/{use-skills-BOMFaoLg.js → use-skills-RpG-BeVz.js} +1 -1
  99. package/dist/public/assets/{use-terminal-enabled-T9hbZCmo.js → use-terminal-enabled-DIQ4qqYj.js} +1 -1
  100. package/dist/public/assets/{use-timeline-entry-diff-Blkn7mx5.js → use-timeline-entry-diff-_fLA4Pt0.js} +1 -1
  101. package/dist/public/assets/{use-workspace-BeSzHXgL.js → use-workspace-DRylP9vX.js} +1 -1
  102. package/dist/public/index.html +47 -47
  103. package/dist/public/uninstall.html +3 -3
  104. package/dist/{repair-launch-json-AsKV5LiF.mjs → repair-launch-json-DO_3ABvq.mjs} +2 -2
  105. package/dist/{repair-mcp-configs-BYASBYNt.mjs → repair-mcp-configs-Bmw9_91L.mjs} +2 -2
  106. package/dist/{repair-skills-AGXJVKE-.mjs → repair-skills-BftHPTbX.mjs} +2 -2
  107. package/dist/repair-skills-CPy4iDny.mjs +1 -0
  108. package/dist/{resolve-project-root-XrNPFGNY.mjs → resolve-project-root-BCdGoKNz.mjs} +2 -2
  109. package/dist/{server-lock-DaOXwt6C.mjs → server-lock-CBDjdfxH.mjs} +2 -2
  110. package/dist/server-lock-xg5Njzvf.mjs +1 -0
  111. package/dist/{skill-teardown-BEnDXQv2.mjs → skill-teardown-Bxy5NV-V.mjs} +2 -2
  112. package/dist/src-B13TeG7U.mjs +1 -0
  113. package/dist/{src-BUfAkcnU.mjs → src-CP2xsmg5.mjs} +2 -2
  114. package/dist/{src-Gpb82U0M.mjs → src-D4A03H49.mjs} +2 -2
  115. package/dist/{src-D79M3x9g.mjs → src-DXJo3hyx.mjs} +1 -1
  116. package/dist/{src-Dyk9iCzv.mjs → src-HFlqeGnA.mjs} +4 -4
  117. package/dist/{start-hZ8_kSuC.mjs → start-7t3OZSc5.mjs} +3 -3
  118. package/dist/start-C1hXUjiR.mjs +1 -0
  119. package/package.json +4 -4
  120. package/dist/constants-DXEhJ197.mjs +0 -2
  121. package/dist/git-handle-pDdbSsMj.mjs +0 -1
  122. package/dist/init-D9KKXAfB.mjs +0 -1
  123. package/dist/loader-hcc6a20d.mjs +0 -1
  124. package/dist/md-manager-BUn7RZOJ.mjs +0 -2
  125. package/dist/preview-CHdEIdwL.mjs +0 -1
  126. package/dist/public/assets/FeedbackForm-BNeQXmJD.js +0 -1
  127. package/dist/public/assets/ManagedArtifactProperties-AGHZbLhh.js +0 -1
  128. package/dist/public/assets/i18n-BFtoQNCd.js +0 -1
  129. package/dist/repair-skills-DUxV_xLI.mjs +0 -1
  130. package/dist/server-lock-VtTnds5h.mjs +0 -1
  131. package/dist/src-s7hpfSip.mjs +0 -1
  132. package/dist/start-ky9sRyOI.mjs +0 -1
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{n as a}from"./dist-PQ5KMVDh.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as s}from"./utils-CPqDy6Hr.js";import{t as c}from"./button-Cym3gapE.js";import{i as l,n as u,t as d}from"./tooltip-DttaCTqz.js";import{c as f}from"./select-XEGYznMI.js";import{n as p,t as m}from"./toggle-group-C2_37kV5.js";import{Qo as h,Ss as g,Ts as _,Xi as v}from"./dist-D1GzYuCD.js";import{n as y}from"./dist-CJhtNlOm2.js";import{i as b}from"./use-apply-config-theme-CBmHKD_B.js";import{t as x}from"./file-tree-utils-Jz2v-e9t.js";import"./config-provider-D-Y4Wg0x.js";import{Z as S,kt as C}from"./dist-nQee1FU7.js";import{t as w}from"./cm-theme-MqTIJzgL.js";import{t as T}from"./asset-dispatch-KsnhYIM1.js";import{t as E}from"./dist-Drn6e5ml2.js";import{t as D}from"./text-viewer-languages-Cc4U6Lc5.js";var O=o(),k=e(n(),1),A=class extends Error{httpStatus;constructor(e,t){super(e),this.name=`ViewerTextLoadError`,this.httpStatus=t}};function j(e){let t=(0,O.c)(10),{_:n}=i(),r;t[0]===n?r=t[1]:(r=e=>n(e===413?{id:`C_WGy8`}:e===415?{id:`VM7H66`}:e===404?{id:`s0IDhW`}:e===400?{id:`N1mdmS`}:typeof e==`number`?{id:`96w9hU`,values:{status:e}}:{id:`ig5vUe`}),t[0]=n,t[1]=r);let a=r,{src:o,loadText:s}=e,c=(0,k.useRef)(s),l=(0,k.useRef)(a),u;t[2]!==s||t[3]!==a?(u=()=>{c.current=s,l.current=a},t[2]=s,t[3]=a,t[4]=u):u=t[4],(0,k.useEffect)(u);let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d={status:`loading`},t[5]=d):d=t[5];let[f,p]=(0,k.useState)(d),m,h;return t[6]!==n||t[7]!==o?(m=()=>{let e=!1,t=new AbortController;p({status:`loading`});let r=c.current;return r?(r(t.signal).then(t=>{if(!e){if(t.ok){p({status:`loaded`,content:t.text});return}p({status:`error`,message:t.message??l.current(t.status),httpStatus:t.status})}}).catch(t=>{e||t instanceof Error&&t.name===`AbortError`||p({status:`error`,message:n({id:`ig5vUe`})})}),()=>{e=!0,t.abort()}):(fetch(o??``,{credentials:`same-origin`,signal:t.signal}).then(async e=>{if(!e.ok)throw new A(l.current(e.status),e.status);return e.text()}).then(t=>{e||p({status:`loaded`,content:t})}).catch(t=>{e||t instanceof Error&&t.name===`AbortError`||p({status:`error`,message:t instanceof Error?t.message:n({id:`ig5vUe`}),httpStatus:t instanceof A?t.httpStatus:void 0})}),()=>{e=!0,t.abort()})},h=[o,n],t[6]=n,t[7]=o,t[8]=m,t[9]=h):(m=t[8],h=t[9]),(0,k.useEffect)(m,h),f}var M=t();function N(e){let t=(0,O.c)(10),{fileName:n,dataAttr:i,extraAttrs:a}=e,o=`${i}-state`,s;t[0]!==i||t[1]!==o?(s={[i]:``,[o]:`loading`},t[0]=i,t[1]=o,t[2]=s):s=t[2];let c;t[3]===n?c=t[4]:(c=(0,M.jsx)(`span`,{children:(0,M.jsx)(r,{id:`Md709y`,values:{fileName:n}})}),t[3]=n,t[4]=c);let l;return t[5]!==a||t[6]!==n||t[7]!==s||t[8]!==c?(l=(0,M.jsx)(`main`,{className:`flex h-full min-h-0 flex-col items-center justify-center bg-background text-muted-foreground text-sm`,"aria-label":n,...s,...a,children:c}),t[5]=a,t[6]=n,t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function P(e){let t=(0,O.c)(16),{fileName:n,dataAttr:i,extraAttrs:a,message:o,openFile:s}=e,l=`${i}-state`,u;t[0]!==i||t[1]!==l?(u={[i]:``,[l]:`error`},t[0]=i,t[1]=l,t[2]=u):u=t[2];let d;t[3]===n?d=t[4]:(d=(0,M.jsx)(`div`,{className:`font-medium text-sm`,children:(0,M.jsx)(r,{id:`qdBUHP`,values:{fileName:n}})}),t[3]=n,t[4]=d);let f;t[5]===o?f=t[6]:(f=(0,M.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:o}),t[5]=o,t[6]=f);let p;t[7]===s?p=t[8]:(p=s?(0,M.jsx)(c,{variant:`outline`,size:`sm`,className:`mt-2`,"data-testid":`viewer-open-file`,onClick:()=>{T({url:s.url,projectRelPath:s.projectRelPath,ext:s.ext,title:s.title,forceOsDelegation:!0})},children:(0,M.jsx)(r,{id:`9npOH9`})}):null,t[7]=s,t[8]=p);let m;return t[9]!==a||t[10]!==n||t[11]!==u||t[12]!==d||t[13]!==f||t[14]!==p?(m=(0,M.jsxs)(`main`,{className:`flex h-full min-h-0 flex-col items-center justify-center gap-2 bg-background p-4 text-center`,"aria-label":n,...u,...a,children:[d,f,p]}),t[9]=a,t[10]=n,t[11]=u,t[12]=d,t[13]=f,t[14]=p,t[15]=m):m=t[15],m}function F({assetPath:e,fileName:t,extension:n,httpStatus:r}){if(!e||r===404)return;let i=n.toLowerCase();return{projectRelPath:e,ext:i,title:t,url:v(`${h.has(i)?`/api/asset`:`/api/asset-text`}?path=${encodeURIComponent(e)}`)}}var I=w({dark:!0,background:`var(--background)`,gutterBackground:`var(--muted)`}),L=w({dark:!1,background:`var(--background)`,gutterBackground:`var(--muted)`});function R(e){let t=(0,O.c)(28),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({fileName:r,extension:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let o=(0,k.useRef)(null),s=(0,k.useRef)(null),{resolvedTheme:c}=a(),l=j(i),u=l.status===`loaded`?l.content:null,d,f;t[4]!==n||t[5]!==u||t[6]!==c?(d=()=>{if(!o.current||u===null)return;let e=n.toLowerCase(),t=g(e),r=c===`dark`?I:L,i=!1,a=null;return D(e,t).then(e=>{if(i||!o.current)return;let t=[E,...e?[e]:[],S.editable.of(!0),C.readOnly.of(!0),S.lineWrapping,r];a=new S({state:C.create({doc:u,extensions:t}),parent:o.current}),s.current=a}),()=>{i=!0,a?.destroy(),s.current=null}},f=[u,n,c],t[4]=n,t[5]=u,t[6]=c,t[7]=d,t[8]=f):(d=t[7],f=t[8]),(0,k.useEffect)(d,f);let p;t[9]===n?p=t[10]:(p={"data-text-viewer-extension":n},t[9]=n,t[10]=p);let m=p;if(l.status===`loading`){let e;return t[11]!==m||t[12]!==r?(e=(0,M.jsx)(N,{fileName:r,dataAttr:`data-text-viewer`,extraAttrs:m}),t[11]=m,t[12]=r,t[13]=e):e=t[13],e}if(l.status===`error`){let e=l.message,a;t[14]!==n||t[15]!==l.httpStatus||t[16]!==r||t[17]!==i.assetPath?(a=F({assetPath:i.assetPath,fileName:r,extension:n,httpStatus:l.httpStatus}),t[14]=n,t[15]=l.httpStatus,t[16]=r,t[17]=i.assetPath,t[18]=a):a=t[18];let o;return t[19]!==m||t[20]!==l.message||t[21]!==r||t[22]!==a?(o=(0,M.jsx)(P,{fileName:r,dataAttr:`data-text-viewer`,extraAttrs:m,message:e,openFile:a}),t[19]=m,t[20]=l.message,t[21]=r,t[22]=a,t[23]=o):o=t[23],o}let h;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,M.jsx)(`div`,{ref:o,className:`min-h-0 flex-1 overflow-auto`}),t[24]=h):h=t[24];let _;return t[25]!==n||t[26]!==r?(_=(0,M.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":r,"data-text-viewer":``,"data-text-viewer-state":`loaded`,"data-text-viewer-extension":n,children:h}),t[25]=n,t[26]=r,t[27]=_):_=t[27],_}function z(e){let t=(0,O.c)(29),{entry:n,className:r}=e,{_:a}=i(),{projectLocalBinding:o,projectLocalSynced:l,merged:u}=b();if(u===null||!l)return null;let d=u?.appearance?.sidebar,p=d?.showHiddenFiles??!1,m=d?.showOnlyMarkdownFiles??!1,h;t[0]!==n||t[1]!==p||t[2]!==m?(h=x(n,{showHiddenFiles:p,showOnlyMarkdownFiles:m}),t[0]=n,t[1]=p,t[2]=m,t[3]=h):h=t[3];let g=h;if(!g.hiddenFiles&&!g.onlyMarkdownFiles)return null;let v;t[4]!==a||t[5]!==o?(v=e=>{if(o===null)return;let t=o.patch({appearance:{sidebar:e}});t.ok||(console.warn(`[NotInSidebarIndicator] sidebar visibility flip rejected:`,_(t.error)),y.error(a({id:`P47EWZ`}),{description:_(t.error)}))},t[4]=a,t[5]=o,t[6]=v):v=t[6];let S=v,C;t[7]===r?C=t[8]:(C=s(`flex items-center gap-1.5 text-muted-foreground/70 text-xs`,r),t[7]=r,t[8]=C);let w;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,M.jsx)(f,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),t[9]=w):w=t[9];let T;t[10]===a?T=t[11]:(T=a({id:`j9tqwO`}),t[10]=a,t[11]=T);let E;t[12]===T?E=t[13]:(E=(0,M.jsx)(`span`,{className:`whitespace-nowrap`,children:T}),t[12]=T,t[13]=E);let D;t[14]!==a||t[15]!==g.hiddenFiles||t[16]!==S||t[17]!==o?(D=g.hiddenFiles?(0,M.jsx)(c,{variant:`outline`,size:`sm`,className:`h-5 rounded-sm px-1.5 font-normal text-2xs text-muted-foreground hover:text-foreground`,disabled:o===null,onClick:()=>S({showHiddenFiles:!0}),"aria-label":a({id:`XcGbim`}),title:a({id:`XcGbim`}),"data-testid":`not-in-sidebar-flip-hidden-files`,children:a({id:`6KCH4m`})}):null,t[14]=a,t[15]=g.hiddenFiles,t[16]=S,t[17]=o,t[18]=D):D=t[18];let k;t[19]!==a||t[20]!==g.onlyMarkdownFiles||t[21]!==S||t[22]!==o?(k=g.onlyMarkdownFiles?(0,M.jsx)(c,{variant:`outline`,size:`sm`,className:`h-5 rounded-sm px-1.5 font-normal text-2xs text-muted-foreground hover:text-foreground`,disabled:o===null,onClick:()=>S({showOnlyMarkdownFiles:!1}),"aria-label":a({id:`10g8I_`}),title:a({id:`10g8I_`}),"data-testid":`not-in-sidebar-flip-only-markdown`,children:a({id:`5-o4kO`})}):null,t[19]=a,t[20]=g.onlyMarkdownFiles,t[21]=S,t[22]=o,t[23]=k):k=t[23];let A;return t[24]!==k||t[25]!==C||t[26]!==E||t[27]!==D?(A=(0,M.jsxs)(`div`,{"data-testid":`not-in-sidebar-indicator`,className:C,children:[w,E,D,k]}),t[24]=k,t[25]=C,t[26]=E,t[27]=D,t[28]=A):A=t[28],A}var B={fill:`none`,height:24,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,viewBox:`0 0 24 24`,width:24,xmlns:`http://www.w3.org/2000/svg`},V=e=>{let t=(0,O.c)(15),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({color:a,size:o,strokeWidth:s,absoluteStrokeWidth:n,className:c,children:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=a===void 0?`currentColor`:a,u=o===void 0?24:o,d=s===void 0?2:s,f=c===void 0?``:c,p=n?Number(d)*24/Number(u):d,m;return t[8]!==r||t[9]!==f||t[10]!==l||t[11]!==i||t[12]!==u||t[13]!==p?(m=(0,M.jsx)(`svg`,{"aria-hidden":`true`,...B,className:f,height:u,stroke:l,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:p,width:u,...i,children:r}),t[8]=r,t[9]=f,t[10]=l,t[11]=i,t[12]=u,t[13]=p,t[14]=m):m=t[14],m},H=e=>{let t=(0,O.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,M.jsx)(`title`,{children:`Markdown`}),r=(0,M.jsx)(`path`,{d:`M232,48H24A16,16,0,0,0,8,64V192a16,16,0,0,0,16,16H232a16,16,0,0,0,16-16V64A16,16,0,0,0,232,48Zm0,144H24V64H232V192ZM128,104v48a8,8,0,0,1-16,0V123.31L93.66,141.66a8,8,0,0,1-11.32,0L64,123.31V152a8,8,0,0,1-16,0V104a8,8,0,0,1,13.66-5.66L88,124.69l26.34-26.35A8,8,0,0,1,128,104Zm77.66,18.34a8,8,0,0,1,0,11.32l-24,24a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L168,132.69V104a8,8,0,0,1,16,0v28.69l10.34-10.35A8,8,0,0,1,205.66,122.34Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,M.jsxs)(V,{...e,viewBox:`0 0 256 256`,fill:`currentColor`,children:[n,r]}),t[2]=e,t[3]=i),i},U=e=>{let t=(0,O.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,M.jsx)(`title`,{children:`Textbox`}),r=(0,M.jsx)(`path`,{d:`M112,40a8,8,0,0,0-8,8V64H24A16,16,0,0,0,8,80v96a16,16,0,0,0,16,16h80v16a8,8,0,0,0,16,0V48A8,8,0,0,0,112,40ZM24,176V80h80v96ZM248,80v96a16,16,0,0,1-16,16H144a8,8,0,0,1,0-16h88V80H144a8,8,0,0,1,0-16h88A16,16,0,0,1,248,80ZM88,112a8,8,0,0,1-8,8H72v24a8,8,0,0,1-16,0V120H48a8,8,0,0,1,0-16H80A8,8,0,0,1,88,112Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,M.jsxs)(V,{...e,viewBox:`0 0 256 256`,fill:`currentColor`,children:[n,r]}),t[2]=e,t[3]=i),i};function W(e){let t=(0,O.c)(48),{isSourceMode:n,onModeChange:a,sourceDisabled:o,wysiwygDisabled:s,wysiwygLabel:c,sourceLabel:f,wysiwygDisabledReason:h}=e,g=o===void 0?!1:o,_=s===void 0?!1:s,{_:v}=i(),y;t[0]!==v||t[1]!==c?(y=c??v({id:`ur2XSb`}),t[0]=v,t[1]=c,t[2]=y):y=t[2];let b=y,x;t[3]!==v||t[4]!==f?(x=f??v({id:`xbdtfY`}),t[3]=v,t[4]=f,t[5]=x):x=t[5];let S=x,C=(0,k.useId)(),w=_&&h?h:null,T=n?`source`:`wysiwyg`,E;t[6]===a?E=t[7]:(E=e=>{e&&a(e)},t[6]=a,t[7]=E);let D;t[8]===v?D=t[9]:(D=v({id:`n7aopT`}),t[8]=v,t[9]=D);let A=w?C:void 0,j;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,M.jsx)(U,{className:`size-4`}),t[10]=j):j=t[10];let N;t[11]!==A||t[12]!==_||t[13]!==b?(N=(0,M.jsx)(p,{value:`wysiwyg`,"aria-label":b,"aria-describedby":A,disabled:_,className:`size-7 px-0 dark:data-[state=on]:bg-foreground/15`,children:j}),t[11]=A,t[12]=_,t[13]=b,t[14]=N):N=t[14];let P;t[15]!==w||t[16]!==C?(P=w?(0,M.jsx)(`span`,{id:C,className:`sr-only`,children:w}):null,t[15]=w,t[16]=C,t[17]=P):P=t[17];let F;t[18]!==N||t[19]!==P?(F=(0,M.jsx)(l,{asChild:!0,children:(0,M.jsxs)(`div`,{children:[N,P]})}),t[18]=N,t[19]=P,t[20]=F):F=t[20];let I;t[21]!==_||t[22]!==h||t[23]!==c?(I=_&&h?h:c||(0,M.jsx)(r,{id:`Mb_20S`}),t[21]=_,t[22]=h,t[23]=c,t[24]=I):I=t[24];let L;t[25]===I?L=t[26]:(L=(0,M.jsx)(u,{side:`bottom`,children:I}),t[25]=I,t[26]=L);let R;t[27]!==F||t[28]!==L?(R=(0,M.jsxs)(d,{children:[F,L]}),t[27]=F,t[28]=L,t[29]=R):R=t[29];let z;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,M.jsx)(H,{className:`size-4`}),t[30]=z):z=t[30];let B;t[31]!==g||t[32]!==S?(B=(0,M.jsx)(l,{asChild:!0,children:(0,M.jsx)(`div`,{children:(0,M.jsx)(p,{value:`source`,"aria-label":S,disabled:g,className:`size-7 px-0 dark:data-[state=on]:bg-foreground/15`,children:z})})}),t[31]=g,t[32]=S,t[33]=B):B=t[33];let V;t[34]!==g||t[35]!==f?(V=g?(0,M.jsx)(r,{id:`G-JBA1`}):f||(0,M.jsx)(r,{id:`u6Hp4N`}),t[34]=g,t[35]=f,t[36]=V):V=t[36];let W;t[37]===V?W=t[38]:(W=(0,M.jsx)(u,{side:`bottom`,children:V}),t[37]=V,t[38]=W);let G;t[39]!==B||t[40]!==W?(G=(0,M.jsxs)(d,{children:[B,W]}),t[39]=B,t[40]=W,t[41]=G):G=t[41];let K;return t[42]!==R||t[43]!==G||t[44]!==T||t[45]!==E||t[46]!==D?(K=(0,M.jsxs)(m,{type:`single`,value:T,onValueChange:E,"aria-label":D,variant:`segmented`,size:`sm`,spacing:1,className:`shrink-0 bg-muted p-0.5 data-[size=sm]:rounded-[10px]`,children:[R,G]}),t[42]=R,t[43]=G,t[44]=T,t[45]=E,t[46]=D,t[47]=K):K=t[47],K}export{F as a,j as c,R as i,H as n,P as o,z as r,N as s,W as t};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{n as a}from"./dist-PQ5KMVDh.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as s}from"./utils-CPqDy6Hr.js";import{t as c}from"./button-Cym3gapE.js";import{i as l,n as u,t as d}from"./tooltip-DttaCTqz.js";import{c as f}from"./select-XEGYznMI.js";import{n as p,t as m}from"./toggle-group-C2_37kV5.js";import{Qo as h,Ss as g,Ts as _,Xi as v}from"./dist-As2x8uCt.js";import{n as y}from"./dist-CJhtNlOm2.js";import{i as b}from"./use-apply-config-theme-CBmHKD_B.js";import{t as x}from"./file-tree-utils-Cy2QEG_5.js";import"./config-provider-DWieljqa.js";import{Z as S,kt as C}from"./dist-nQee1FU7.js";import{t as w}from"./cm-theme-MqTIJzgL.js";import{t as T}from"./asset-dispatch-KsnhYIM1.js";import{t as E}from"./dist-Drn6e5ml2.js";import{t as D}from"./text-viewer-languages-Cc4U6Lc5.js";var O=o(),k=e(n(),1),A=class extends Error{httpStatus;constructor(e,t){super(e),this.name=`ViewerTextLoadError`,this.httpStatus=t}};function j(e){let t=(0,O.c)(10),{_:n}=i(),r;t[0]===n?r=t[1]:(r=e=>n(e===413?{id:`C_WGy8`}:e===415?{id:`VM7H66`}:e===404?{id:`s0IDhW`}:e===400?{id:`N1mdmS`}:typeof e==`number`?{id:`96w9hU`,values:{status:e}}:{id:`ig5vUe`}),t[0]=n,t[1]=r);let a=r,{src:o,loadText:s}=e,c=(0,k.useRef)(s),l=(0,k.useRef)(a),u;t[2]!==s||t[3]!==a?(u=()=>{c.current=s,l.current=a},t[2]=s,t[3]=a,t[4]=u):u=t[4],(0,k.useEffect)(u);let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d={status:`loading`},t[5]=d):d=t[5];let[f,p]=(0,k.useState)(d),m,h;return t[6]!==n||t[7]!==o?(m=()=>{let e=!1,t=new AbortController;p({status:`loading`});let r=c.current;return r?(r(t.signal).then(t=>{if(!e){if(t.ok){p({status:`loaded`,content:t.text});return}p({status:`error`,message:t.message??l.current(t.status),httpStatus:t.status})}}).catch(t=>{e||t instanceof Error&&t.name===`AbortError`||p({status:`error`,message:n({id:`ig5vUe`})})}),()=>{e=!0,t.abort()}):(fetch(o??``,{credentials:`same-origin`,signal:t.signal}).then(async e=>{if(!e.ok)throw new A(l.current(e.status),e.status);return e.text()}).then(t=>{e||p({status:`loaded`,content:t})}).catch(t=>{e||t instanceof Error&&t.name===`AbortError`||p({status:`error`,message:t instanceof Error?t.message:n({id:`ig5vUe`}),httpStatus:t instanceof A?t.httpStatus:void 0})}),()=>{e=!0,t.abort()})},h=[o,n],t[6]=n,t[7]=o,t[8]=m,t[9]=h):(m=t[8],h=t[9]),(0,k.useEffect)(m,h),f}var M=t();function N(e){let t=(0,O.c)(10),{fileName:n,dataAttr:i,extraAttrs:a}=e,o=`${i}-state`,s;t[0]!==i||t[1]!==o?(s={[i]:``,[o]:`loading`},t[0]=i,t[1]=o,t[2]=s):s=t[2];let c;t[3]===n?c=t[4]:(c=(0,M.jsx)(`span`,{children:(0,M.jsx)(r,{id:`Md709y`,values:{fileName:n}})}),t[3]=n,t[4]=c);let l;return t[5]!==a||t[6]!==n||t[7]!==s||t[8]!==c?(l=(0,M.jsx)(`main`,{className:`flex h-full min-h-0 flex-col items-center justify-center bg-background text-muted-foreground text-sm`,"aria-label":n,...s,...a,children:c}),t[5]=a,t[6]=n,t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function P(e){let t=(0,O.c)(16),{fileName:n,dataAttr:i,extraAttrs:a,message:o,openFile:s}=e,l=`${i}-state`,u;t[0]!==i||t[1]!==l?(u={[i]:``,[l]:`error`},t[0]=i,t[1]=l,t[2]=u):u=t[2];let d;t[3]===n?d=t[4]:(d=(0,M.jsx)(`div`,{className:`font-medium text-sm`,children:(0,M.jsx)(r,{id:`qdBUHP`,values:{fileName:n}})}),t[3]=n,t[4]=d);let f;t[5]===o?f=t[6]:(f=(0,M.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:o}),t[5]=o,t[6]=f);let p;t[7]===s?p=t[8]:(p=s?(0,M.jsx)(c,{variant:`outline`,size:`sm`,className:`mt-2`,"data-testid":`viewer-open-file`,onClick:()=>{T({url:s.url,projectRelPath:s.projectRelPath,ext:s.ext,title:s.title,forceOsDelegation:!0})},children:(0,M.jsx)(r,{id:`9npOH9`})}):null,t[7]=s,t[8]=p);let m;return t[9]!==a||t[10]!==n||t[11]!==u||t[12]!==d||t[13]!==f||t[14]!==p?(m=(0,M.jsxs)(`main`,{className:`flex h-full min-h-0 flex-col items-center justify-center gap-2 bg-background p-4 text-center`,"aria-label":n,...u,...a,children:[d,f,p]}),t[9]=a,t[10]=n,t[11]=u,t[12]=d,t[13]=f,t[14]=p,t[15]=m):m=t[15],m}function F({assetPath:e,fileName:t,extension:n,httpStatus:r}){if(!e||r===404)return;let i=n.toLowerCase();return{projectRelPath:e,ext:i,title:t,url:v(`${h.has(i)?`/api/asset`:`/api/asset-text`}?path=${encodeURIComponent(e)}`)}}var I=w({dark:!0,background:`var(--background)`,gutterBackground:`var(--muted)`}),L=w({dark:!1,background:`var(--background)`,gutterBackground:`var(--muted)`});function R(e){let t=(0,O.c)(28),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({fileName:r,extension:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let o=(0,k.useRef)(null),s=(0,k.useRef)(null),{resolvedTheme:c}=a(),l=j(i),u=l.status===`loaded`?l.content:null,d,f;t[4]!==n||t[5]!==u||t[6]!==c?(d=()=>{if(!o.current||u===null)return;let e=n.toLowerCase(),t=g(e),r=c===`dark`?I:L,i=!1,a=null;return D(e,t).then(e=>{if(i||!o.current)return;let t=[E,...e?[e]:[],S.editable.of(!0),C.readOnly.of(!0),S.lineWrapping,r];a=new S({state:C.create({doc:u,extensions:t}),parent:o.current}),s.current=a}),()=>{i=!0,a?.destroy(),s.current=null}},f=[u,n,c],t[4]=n,t[5]=u,t[6]=c,t[7]=d,t[8]=f):(d=t[7],f=t[8]),(0,k.useEffect)(d,f);let p;t[9]===n?p=t[10]:(p={"data-text-viewer-extension":n},t[9]=n,t[10]=p);let m=p;if(l.status===`loading`){let e;return t[11]!==m||t[12]!==r?(e=(0,M.jsx)(N,{fileName:r,dataAttr:`data-text-viewer`,extraAttrs:m}),t[11]=m,t[12]=r,t[13]=e):e=t[13],e}if(l.status===`error`){let e=l.message,a;t[14]!==n||t[15]!==l.httpStatus||t[16]!==r||t[17]!==i.assetPath?(a=F({assetPath:i.assetPath,fileName:r,extension:n,httpStatus:l.httpStatus}),t[14]=n,t[15]=l.httpStatus,t[16]=r,t[17]=i.assetPath,t[18]=a):a=t[18];let o;return t[19]!==m||t[20]!==l.message||t[21]!==r||t[22]!==a?(o=(0,M.jsx)(P,{fileName:r,dataAttr:`data-text-viewer`,extraAttrs:m,message:e,openFile:a}),t[19]=m,t[20]=l.message,t[21]=r,t[22]=a,t[23]=o):o=t[23],o}let h;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,M.jsx)(`div`,{ref:o,className:`min-h-0 flex-1 overflow-auto`}),t[24]=h):h=t[24];let _;return t[25]!==n||t[26]!==r?(_=(0,M.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":r,"data-text-viewer":``,"data-text-viewer-state":`loaded`,"data-text-viewer-extension":n,children:h}),t[25]=n,t[26]=r,t[27]=_):_=t[27],_}function z(e){let t=(0,O.c)(29),{entry:n,className:r}=e,{_:a}=i(),{projectLocalBinding:o,projectLocalSynced:l,merged:u}=b();if(u===null||!l)return null;let d=u?.appearance?.sidebar,p=d?.showHiddenFiles??!1,m=d?.showOnlyMarkdownFiles??!1,h;t[0]!==n||t[1]!==p||t[2]!==m?(h=x(n,{showHiddenFiles:p,showOnlyMarkdownFiles:m}),t[0]=n,t[1]=p,t[2]=m,t[3]=h):h=t[3];let g=h;if(!g.hiddenFiles&&!g.onlyMarkdownFiles)return null;let v;t[4]!==a||t[5]!==o?(v=e=>{if(o===null)return;let t=o.patch({appearance:{sidebar:e}});t.ok||(console.warn(`[NotInSidebarIndicator] sidebar visibility flip rejected:`,_(t.error)),y.error(a({id:`P47EWZ`}),{description:_(t.error)}))},t[4]=a,t[5]=o,t[6]=v):v=t[6];let S=v,C;t[7]===r?C=t[8]:(C=s(`flex items-center gap-1.5 text-muted-foreground/70 text-xs`,r),t[7]=r,t[8]=C);let w;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,M.jsx)(f,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),t[9]=w):w=t[9];let T;t[10]===a?T=t[11]:(T=a({id:`j9tqwO`}),t[10]=a,t[11]=T);let E;t[12]===T?E=t[13]:(E=(0,M.jsx)(`span`,{className:`whitespace-nowrap`,children:T}),t[12]=T,t[13]=E);let D;t[14]!==a||t[15]!==g.hiddenFiles||t[16]!==S||t[17]!==o?(D=g.hiddenFiles?(0,M.jsx)(c,{variant:`outline`,size:`sm`,className:`h-5 rounded-sm px-1.5 font-normal text-2xs text-muted-foreground hover:text-foreground`,disabled:o===null,onClick:()=>S({showHiddenFiles:!0}),"aria-label":a({id:`XcGbim`}),title:a({id:`XcGbim`}),"data-testid":`not-in-sidebar-flip-hidden-files`,children:a({id:`6KCH4m`})}):null,t[14]=a,t[15]=g.hiddenFiles,t[16]=S,t[17]=o,t[18]=D):D=t[18];let k;t[19]!==a||t[20]!==g.onlyMarkdownFiles||t[21]!==S||t[22]!==o?(k=g.onlyMarkdownFiles?(0,M.jsx)(c,{variant:`outline`,size:`sm`,className:`h-5 rounded-sm px-1.5 font-normal text-2xs text-muted-foreground hover:text-foreground`,disabled:o===null,onClick:()=>S({showOnlyMarkdownFiles:!1}),"aria-label":a({id:`10g8I_`}),title:a({id:`10g8I_`}),"data-testid":`not-in-sidebar-flip-only-markdown`,children:a({id:`5-o4kO`})}):null,t[19]=a,t[20]=g.onlyMarkdownFiles,t[21]=S,t[22]=o,t[23]=k):k=t[23];let A;return t[24]!==k||t[25]!==C||t[26]!==E||t[27]!==D?(A=(0,M.jsxs)(`div`,{"data-testid":`not-in-sidebar-indicator`,className:C,children:[w,E,D,k]}),t[24]=k,t[25]=C,t[26]=E,t[27]=D,t[28]=A):A=t[28],A}var B={fill:`none`,height:24,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,viewBox:`0 0 24 24`,width:24,xmlns:`http://www.w3.org/2000/svg`},V=e=>{let t=(0,O.c)(15),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({color:a,size:o,strokeWidth:s,absoluteStrokeWidth:n,className:c,children:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=a===void 0?`currentColor`:a,u=o===void 0?24:o,d=s===void 0?2:s,f=c===void 0?``:c,p=n?Number(d)*24/Number(u):d,m;return t[8]!==r||t[9]!==f||t[10]!==l||t[11]!==i||t[12]!==u||t[13]!==p?(m=(0,M.jsx)(`svg`,{"aria-hidden":`true`,...B,className:f,height:u,stroke:l,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:p,width:u,...i,children:r}),t[8]=r,t[9]=f,t[10]=l,t[11]=i,t[12]=u,t[13]=p,t[14]=m):m=t[14],m},H=e=>{let t=(0,O.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,M.jsx)(`title`,{children:`Markdown`}),r=(0,M.jsx)(`path`,{d:`M232,48H24A16,16,0,0,0,8,64V192a16,16,0,0,0,16,16H232a16,16,0,0,0,16-16V64A16,16,0,0,0,232,48Zm0,144H24V64H232V192ZM128,104v48a8,8,0,0,1-16,0V123.31L93.66,141.66a8,8,0,0,1-11.32,0L64,123.31V152a8,8,0,0,1-16,0V104a8,8,0,0,1,13.66-5.66L88,124.69l26.34-26.35A8,8,0,0,1,128,104Zm77.66,18.34a8,8,0,0,1,0,11.32l-24,24a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L168,132.69V104a8,8,0,0,1,16,0v28.69l10.34-10.35A8,8,0,0,1,205.66,122.34Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,M.jsxs)(V,{...e,viewBox:`0 0 256 256`,fill:`currentColor`,children:[n,r]}),t[2]=e,t[3]=i),i},U=e=>{let t=(0,O.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,M.jsx)(`title`,{children:`Textbox`}),r=(0,M.jsx)(`path`,{d:`M112,40a8,8,0,0,0-8,8V64H24A16,16,0,0,0,8,80v96a16,16,0,0,0,16,16h80v16a8,8,0,0,0,16,0V48A8,8,0,0,0,112,40ZM24,176V80h80v96ZM248,80v96a16,16,0,0,1-16,16H144a8,8,0,0,1,0-16h88V80H144a8,8,0,0,1,0-16h88A16,16,0,0,1,248,80ZM88,112a8,8,0,0,1-8,8H72v24a8,8,0,0,1-16,0V120H48a8,8,0,0,1,0-16H80A8,8,0,0,1,88,112Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,M.jsxs)(V,{...e,viewBox:`0 0 256 256`,fill:`currentColor`,children:[n,r]}),t[2]=e,t[3]=i),i};function W(e){let t=(0,O.c)(48),{isSourceMode:n,onModeChange:a,sourceDisabled:o,wysiwygDisabled:s,wysiwygLabel:c,sourceLabel:f,wysiwygDisabledReason:h}=e,g=o===void 0?!1:o,_=s===void 0?!1:s,{_:v}=i(),y;t[0]!==v||t[1]!==c?(y=c??v({id:`ur2XSb`}),t[0]=v,t[1]=c,t[2]=y):y=t[2];let b=y,x;t[3]!==v||t[4]!==f?(x=f??v({id:`xbdtfY`}),t[3]=v,t[4]=f,t[5]=x):x=t[5];let S=x,C=(0,k.useId)(),w=_&&h?h:null,T=n?`source`:`wysiwyg`,E;t[6]===a?E=t[7]:(E=e=>{e&&a(e)},t[6]=a,t[7]=E);let D;t[8]===v?D=t[9]:(D=v({id:`n7aopT`}),t[8]=v,t[9]=D);let A=w?C:void 0,j;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,M.jsx)(U,{className:`size-4`}),t[10]=j):j=t[10];let N;t[11]!==A||t[12]!==_||t[13]!==b?(N=(0,M.jsx)(p,{value:`wysiwyg`,"aria-label":b,"aria-describedby":A,disabled:_,className:`size-7 px-0 dark:data-[state=on]:bg-foreground/15`,children:j}),t[11]=A,t[12]=_,t[13]=b,t[14]=N):N=t[14];let P;t[15]!==w||t[16]!==C?(P=w?(0,M.jsx)(`span`,{id:C,className:`sr-only`,children:w}):null,t[15]=w,t[16]=C,t[17]=P):P=t[17];let F;t[18]!==N||t[19]!==P?(F=(0,M.jsx)(l,{asChild:!0,children:(0,M.jsxs)(`div`,{children:[N,P]})}),t[18]=N,t[19]=P,t[20]=F):F=t[20];let I;t[21]!==_||t[22]!==h||t[23]!==c?(I=_&&h?h:c||(0,M.jsx)(r,{id:`Mb_20S`}),t[21]=_,t[22]=h,t[23]=c,t[24]=I):I=t[24];let L;t[25]===I?L=t[26]:(L=(0,M.jsx)(u,{side:`bottom`,children:I}),t[25]=I,t[26]=L);let R;t[27]!==F||t[28]!==L?(R=(0,M.jsxs)(d,{children:[F,L]}),t[27]=F,t[28]=L,t[29]=R):R=t[29];let z;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,M.jsx)(H,{className:`size-4`}),t[30]=z):z=t[30];let B;t[31]!==g||t[32]!==S?(B=(0,M.jsx)(l,{asChild:!0,children:(0,M.jsx)(`div`,{children:(0,M.jsx)(p,{value:`source`,"aria-label":S,disabled:g,className:`size-7 px-0 dark:data-[state=on]:bg-foreground/15`,children:z})})}),t[31]=g,t[32]=S,t[33]=B):B=t[33];let V;t[34]!==g||t[35]!==f?(V=g?(0,M.jsx)(r,{id:`G-JBA1`}):f||(0,M.jsx)(r,{id:`u6Hp4N`}),t[34]=g,t[35]=f,t[36]=V):V=t[36];let W;t[37]===V?W=t[38]:(W=(0,M.jsx)(u,{side:`bottom`,children:V}),t[37]=V,t[38]=W);let G;t[39]!==B||t[40]!==W?(G=(0,M.jsxs)(d,{children:[B,W]}),t[39]=B,t[40]=W,t[41]=G):G=t[41];let K;return t[42]!==R||t[43]!==G||t[44]!==T||t[45]!==E||t[46]!==D?(K=(0,M.jsxs)(m,{type:`single`,value:T,onValueChange:E,"aria-label":D,variant:`segmented`,size:`sm`,spacing:1,className:`shrink-0 bg-muted p-0.5 data-[size=sm]:rounded-[10px]`,children:[R,G]}),t[42]=R,t[43]=G,t[44]=T,t[45]=E,t[46]=D,t[47]=K):K=t[47],K}export{F as a,j as c,R as i,H as n,P as o,z as r,N as s,W as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-Cym3gapE.js";import{a as s,c,i as l,n as u,o as d,r as f,s as p,t as m}from"./dialog-CTNat3T_.js";import{Ts as h,Ws as g}from"./dist-D1GzYuCD.js";import{n as _}from"./dist-CJhtNlOm2.js";import{v}from"./documents-events-DPqTvBXn.js";import{i as y}from"./use-apply-config-theme-CBmHKD_B.js";import{t as b}from"./createLucideIcon-BulbvLvN.js";import{t as x}from"./eye-7pio2q9G.js";import"./config-provider-D-Y4Wg0x.js";var S=b(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),C=b(`arrow-right-left`,[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]),w=b(`git-commit-vertical`,[[`path`,{d:`M12 3v6`,key:`1holv5`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`M12 15v6`,key:`a9ows0`}]]),T=b(`git-merge`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]),E=b(`laptop`,[[`path`,{d:`M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z`,key:`1pdavp`}],[`path`,{d:`M20.054 15.987H3.946`,key:`14rxg9`}]]),D=a(),O=e(n(),1);async function k(){try{let e=await fetch(`/api/sync/status`);return e.ok?{status:await e.json()}:{status:null,error:`server`}}catch{return{status:null,error:`network`}}}function A(){return j().status}function j(){let e=(0,D.c)(8),[t,n]=(0,O.useState)(null),[r,i]=(0,O.useState)(null),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=function(){k().then(e=>{let{status:t,error:r}=e;i(r??null),t&&n(t)})},e[0]=a):a=e[0];let o=a,s,c;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{o()},c=[],e[1]=s,e[2]=c):(s=e[1],c=e[2]),(0,O.useEffect)(s,c);let l,u;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>v(e=>{e.includes(`sync-status`)&&o()}),u=[],e[3]=l,e[4]=u):(l=e[3],u=e[4]),(0,O.useEffect)(l,u);let d;return e[5]!==r||e[6]!==t?(d={status:t,fetchError:r},e[5]=r,e[6]=t,e[7]=d):d=e[7],d}var M=t();function N(e){let t=(0,D.c)(3),{children:n}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,M.jsxs)(`p`,{className:`flex items-center gap-1.5 font-mono text-xs font-semibold tracking-wider uppercase`,children:[(0,M.jsx)(`span`,{"aria-hidden":`true`,className:`mb-[3px] flex items-center justify-center`,children:`◇`}),(0,M.jsx)(r,{id:`6s7LXO`})]}),t[0]=i):i=t[0];let a;return t[1]===n?a=t[2]:(a=(0,M.jsxs)(`div`,{role:`note`,className:`flex flex-col gap-5 text-sm`,children:[i,(0,M.jsx)(`div`,{className:`flex flex-col gap-5`,children:n})]}),t[1]=n,t[2]=a),a}function P(e){let t=(0,D.c)(10),{icon:n,title:r,body:i}=e,a;t[0]===r?a=t[1]:(a=(0,M.jsx)(`p`,{className:`font-medium`,children:r}),t[0]=r,t[1]=a);let o;t[2]===i?o=t[3]:(o=(0,M.jsx)(`p`,{className:`text-muted-foreground`,children:i}),t[2]=i,t[3]=o);let s;t[4]!==a||t[5]!==o?(s=(0,M.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[a,o]}),t[4]=a,t[5]=o,t[6]=s):s=t[6];let c;return t[7]!==n||t[8]!==s?(c=(0,M.jsxs)(`div`,{className:`flex items-start gap-3`,children:[n,s]}),t[7]=n,t[8]=s,t[9]=c):c=t[9],c}function F(e){let t=(0,D.c)(4),{variant:n}=e;if((n===void 0?`full`:n)===`follow`){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,M.jsx)(c,{children:(0,M.jsx)(r,{id:`W7mERj`})}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,M.jsxs)(M.Fragment,{children:[e,(0,M.jsx)(s,{children:(0,M.jsx)(r,{id:`KmVekT`})})]}),t[1]=n):n=t[1],n}let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,M.jsx)(c,{children:(0,M.jsx)(r,{id:`Uo2Rj7`})}),t[2]=i):i=t[2];let a;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,M.jsxs)(M.Fragment,{children:[i,(0,M.jsx)(s,{children:(0,M.jsx)(r,{id:`n6hXUm`})})]}),t[3]=a):a=t[3],a}function I(e){let t=(0,D.c)(2),{variant:n}=e,r=n===void 0?`full`:n,i;return t[0]===r?i=t[1]:(i=(0,M.jsx)(N,{children:r===`follow`?(0,M.jsx)(R,{}):(0,M.jsx)(L,{})}),t[0]=r,t[1]=i),i}function L(){let e=(0,D.c)(3),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,M.jsx)(P,{icon:(0,M.jsx)(C,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,M.jsx)(r,{id:`cdmk8A`}),body:(0,M.jsx)(r,{id:`YaeyFh`})}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,M.jsx)(P,{icon:(0,M.jsx)(w,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,M.jsx)(r,{id:`9i21pa`}),body:(0,M.jsx)(r,{id:`KIIamL`})}),e[1]=n):n=e[1];let i;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,M.jsxs)(M.Fragment,{children:[t,n,(0,M.jsx)(P,{icon:(0,M.jsx)(x,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,M.jsx)(r,{id:`8cpeU3`}),body:(0,M.jsx)(r,{id:`DELNQk`})})]}),e[2]=i):i=e[2],i}function R(){let e=(0,D.c)(3),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,M.jsx)(P,{icon:(0,M.jsx)(S,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,M.jsx)(r,{id:`0xnQ_X`}),body:(0,M.jsx)(r,{id:`aCoQfY`})}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,M.jsx)(P,{icon:(0,M.jsx)(E,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,M.jsx)(r,{id:`5rnB76`}),body:(0,M.jsx)(r,{id:`kXNv8P`})}),e[1]=n):n=e[1];let i;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,M.jsxs)(M.Fragment,{children:[t,n,(0,M.jsx)(P,{icon:(0,M.jsx)(T,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,M.jsx)(r,{id:`oBK5fD`}),body:(0,M.jsx)(r,{id:`8Wav8y`})})]}),e[2]=i):i=e[2],i}function z(){let e=(0,D.c)(2),{projectLocalBinding:t}=y();if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=e=>{let n=e?`full`:`off`,r=t.patch({autoSync:{mode:n,enabled:e}});return r.ok?{ok:!0}:{ok:!1,error:h(r.error)}},e[0]=t,e[1]=n),n}function B(){let e=(0,D.c)(2),{projectLocalBinding:t}=y();if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=e=>{let n=t.patch({autoSync:{mode:e,enabled:null}});return n.ok?{ok:!0}:{ok:!1,error:h(n.error)}},e[0]=t,e[1]=n),n}function V(){let e=(0,D.c)(2),{projectBinding:t}=y();if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=e=>{let n=t.patch({autoSync:{default:e}});return n.ok?{ok:!0}:{ok:!1,error:h(n.error)}},e[0]=t,e[1]=n),n}function H(){let e=(0,D.c)(2),{projectLocalBinding:t}=y();if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=e=>{let n=t.patch({autoSync:e});return n.ok?{ok:!0}:{ok:!1,error:h(n.error)}},e[0]=t,e[1]=n),n}function U(e,t){let n=(0,D.c)(12),{_:r}=i(),[a,o]=(0,O.useState)(!1),s;n[0]!==r||n[1]!==e?(s=function(t){if(e===null)return _.error(r({id:`fiMNLl`})),!1;let n=e(t);if(!n.ok){console.error(`[sync] toggle failed:`,n.error);let e=n.error;return _.error(r(t?{id:`04RA0-`,values:{detail:e}}:{id:`qjHMHf`,values:{detail:e}})),!1}return!0},n[0]=r,n[1]=e,n[2]=s):s=n[2];let c=s,l;n[3]===c?l=n[4]:(l=function(e){if(e){o(!0);return}c(!1)},n[3]=c,n[4]=l);let u=l,d;n[5]!==c||n[6]!==t?(d=function(){c(!0)&&(o(!1),t?.onEnabled?.())},n[5]=c,n[6]=t,n[7]=d):d=n[7];let f=d,p;return n[8]!==a||n[9]!==f||n[10]!==u?(p={confirmOpen:a,setConfirmOpen:o,onToggleRequest:u,onConfirm:f},n[8]=a,n[9]=f,n[10]=u,n[11]=p):p=n[11],p}function W(e,t,n){let r=(0,D.c)(15),{_:a}=i(),[o,s]=(0,O.useState)(!1),[c,l]=(0,O.useState)(null),u;r[0]!==a||r[1]!==n||r[2]!==e?(u=function(t){if(e===null)return _.error(a({id:`fiMNLl`})),!1;let r=e(t);if(!r.ok){console.error(`[sync] mode change failed:`,r.error);let e=r.error;return _.error(a({id:`nOEDQs`,values:{detail:e}})),!1}return n?.onApplied?.(t),!0},r[0]=a,r[1]=n,r[2]=e,r[3]=u):u=r[3];let d=u,f;r[4]!==d||r[5]!==t?(f=function(e){if(e!==t){if(e===`off`){d(`off`);return}l(e),s(!0)}},r[4]=d,r[5]=t,r[6]=f):f=r[6];let p=f,m;r[7]!==d||r[8]!==c?(m=function(){c!==null&&d(c)&&s(!1)},r[7]=d,r[8]=c,r[9]=m):m=r[9];let h=m,g;return r[10]!==o||r[11]!==h||r[12]!==p||r[13]!==c?(g={confirmOpen:o,setConfirmOpen:s,pendingMode:c,onModeSelect:p,onConfirm:h},r[10]=o,r[11]=h,r[12]=p,r[13]=c,r[14]=g):g=r[14],g}function G(){let e=(0,D.c)(2),{projectLocalBinding:t}=y();if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=e=>{let n=t.patch({autoSync:e});return n.ok?{ok:!0}:{ok:!1,error:h(n.error)}},e[0]=t,e[1]=n),n}function K(e,t){let n=(0,D.c)(18),{_:r}=i(),a=G(),[o,s]=(0,O.useState)(!1),[c,l]=(0,O.useState)(null),u;n[0]===e?u=n[1]:(u=g(e)??`off`,n[0]=e,n[1]=u);let d=u,f;n[2]!==r||n[3]!==a?(f=function(e){if(a===null)return _.error(r({id:`fiMNLl`})),!1;let t=a(e);if(!t.ok){console.error(`[sync] badge control failed:`,t.error);let e=t.error;return _.error(r({id:`ZVOhXM`,values:{detail:e}})),!1}return!0},n[2]=r,n[3]=a,n[4]=f):f=n[4];let p=f,m;n[5]!==p||n[6]!==d?(m=function(e){if(e!==d){if(e===`off`){p({mode:`off`,enabled:null,resumeMode:null});return}l(e),s(!0)}},n[5]=p,n[6]=d,n[7]=m):m=n[7];let h=m,v;n[8]!==p||n[9]!==c?(v=function(){c!==null&&p({mode:c,enabled:null,resumeMode:null})&&(s(!1),l(null))},n[8]=p,n[9]=c,n[10]=v):v=n[10];let y=v,b=c===`follow`?t:0,x;return n[11]!==o||n[12]!==d||n[13]!==y||n[14]!==h||n[15]!==c||n[16]!==b?(x={mode:d,confirmOpen:o,setConfirmOpen:s,pendingMode:c,strandedCommitCount:b,onModeSelect:h,onConfirm:y},n[11]=o,n[12]=d,n[13]=y,n[14]=h,n[15]=c,n[16]=b,n[17]=x):x=n[17],x}async function q(e){let t=await fetch(`/api/sync/trigger`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({op:e})});if(!t.ok)throw Error(`sync trigger failed: ${t.status}`)}function J(e){let t=(0,D.c)(24),{open:n,onOpenChange:i,onConfirm:a,variant:s,strandedCommitCount:c}=e,h=s===void 0?`full`:s,g=c===void 0?0:c,_=h===`follow`&&g>0,v;t[0]===h?v=t[1]:(v=(0,M.jsx)(p,{children:(0,M.jsx)(F,{variant:h})}),t[0]=h,t[1]=v);let y;t[2]===h?y=t[3]:(y=(0,M.jsx)(I,{variant:h}),t[2]=h,t[3]=y);let b;t[4]!==_||t[5]!==g?(b=_&&(0,M.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:(0,M.jsx)(r,{id:`caw8gO`,values:{strandedCommitCount:g}})}),t[4]=_,t[5]=g,t[6]=b):b=t[6];let x;t[7]!==y||t[8]!==b?(x=(0,M.jsxs)(u,{children:[y,b]}),t[7]=y,t[8]=b,t[9]=x):x=t[9];let S;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,M.jsx)(f,{asChild:!0,children:(0,M.jsx)(o,{variant:`outline`,children:(0,M.jsx)(r,{id:`dEgA5A`})})}),t[10]=S):S=t[10];let C;t[11]===h?C=t[12]:(C=h===`follow`?(0,M.jsx)(r,{id:`jTUxaN`}):(0,M.jsx)(r,{id:`pPiV8s`}),t[11]=h,t[12]=C);let w;t[13]!==a||t[14]!==C?(w=(0,M.jsxs)(d,{children:[S,(0,M.jsx)(o,{onClick:a,children:C})]}),t[13]=a,t[14]=C,t[15]=w):w=t[15];let T;t[16]!==v||t[17]!==x||t[18]!==w?(T=(0,M.jsxs)(l,{className:`sm:max-w-lg`,children:[v,x,w]}),t[16]=v,t[17]=x,t[18]=w,t[19]=T):T=t[19];let E;return t[20]!==i||t[21]!==n||t[22]!==T?(E=(0,M.jsx)(m,{open:n,onOpenChange:i,children:T}),t[20]=i,t[21]=n,t[22]=T,t[23]=E):E=t[23],E}export{S as _,V as a,W as c,I as d,N as f,T as g,j as h,U as i,B as l,A as m,q as n,z as o,P as p,K as r,H as s,J as t,F as u};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-Cym3gapE.js";import{a as s,c,i as l,n as u,o as d,r as f,s as p,t as m}from"./dialog-CTNat3T_.js";import{Ts as h,Ws as g}from"./dist-As2x8uCt.js";import{n as _}from"./dist-CJhtNlOm2.js";import{v}from"./documents-events-2g_OBjKU.js";import{i as y}from"./use-apply-config-theme-CBmHKD_B.js";import{t as b}from"./createLucideIcon-BulbvLvN.js";import{t as x}from"./eye-7pio2q9G.js";import"./config-provider-DWieljqa.js";var S=b(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),C=b(`arrow-right-left`,[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]),w=b(`git-commit-vertical`,[[`path`,{d:`M12 3v6`,key:`1holv5`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`M12 15v6`,key:`a9ows0`}]]),T=b(`git-merge`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]),E=b(`laptop`,[[`path`,{d:`M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z`,key:`1pdavp`}],[`path`,{d:`M20.054 15.987H3.946`,key:`14rxg9`}]]),D=a(),O=e(n(),1);async function k(){try{let e=await fetch(`/api/sync/status`);return e.ok?{status:await e.json()}:{status:null,error:`server`}}catch{return{status:null,error:`network`}}}function A(){return j().status}function j(){let e=(0,D.c)(8),[t,n]=(0,O.useState)(null),[r,i]=(0,O.useState)(null),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=function(){k().then(e=>{let{status:t,error:r}=e;i(r??null),t&&n(t)})},e[0]=a):a=e[0];let o=a,s,c;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{o()},c=[],e[1]=s,e[2]=c):(s=e[1],c=e[2]),(0,O.useEffect)(s,c);let l,u;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>v(e=>{e.includes(`sync-status`)&&o()}),u=[],e[3]=l,e[4]=u):(l=e[3],u=e[4]),(0,O.useEffect)(l,u);let d;return e[5]!==r||e[6]!==t?(d={status:t,fetchError:r},e[5]=r,e[6]=t,e[7]=d):d=e[7],d}var M=t();function N(e){let t=(0,D.c)(3),{children:n}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,M.jsxs)(`p`,{className:`flex items-center gap-1.5 font-mono text-xs font-semibold tracking-wider uppercase`,children:[(0,M.jsx)(`span`,{"aria-hidden":`true`,className:`mb-[3px] flex items-center justify-center`,children:`◇`}),(0,M.jsx)(r,{id:`6s7LXO`})]}),t[0]=i):i=t[0];let a;return t[1]===n?a=t[2]:(a=(0,M.jsxs)(`div`,{role:`note`,className:`flex flex-col gap-5 text-sm`,children:[i,(0,M.jsx)(`div`,{className:`flex flex-col gap-5`,children:n})]}),t[1]=n,t[2]=a),a}function P(e){let t=(0,D.c)(10),{icon:n,title:r,body:i}=e,a;t[0]===r?a=t[1]:(a=(0,M.jsx)(`p`,{className:`font-medium`,children:r}),t[0]=r,t[1]=a);let o;t[2]===i?o=t[3]:(o=(0,M.jsx)(`p`,{className:`text-muted-foreground`,children:i}),t[2]=i,t[3]=o);let s;t[4]!==a||t[5]!==o?(s=(0,M.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[a,o]}),t[4]=a,t[5]=o,t[6]=s):s=t[6];let c;return t[7]!==n||t[8]!==s?(c=(0,M.jsxs)(`div`,{className:`flex items-start gap-3`,children:[n,s]}),t[7]=n,t[8]=s,t[9]=c):c=t[9],c}function F(e){let t=(0,D.c)(4),{variant:n}=e;if((n===void 0?`full`:n)===`follow`){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,M.jsx)(c,{children:(0,M.jsx)(r,{id:`W7mERj`})}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,M.jsxs)(M.Fragment,{children:[e,(0,M.jsx)(s,{children:(0,M.jsx)(r,{id:`KmVekT`})})]}),t[1]=n):n=t[1],n}let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,M.jsx)(c,{children:(0,M.jsx)(r,{id:`Uo2Rj7`})}),t[2]=i):i=t[2];let a;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,M.jsxs)(M.Fragment,{children:[i,(0,M.jsx)(s,{children:(0,M.jsx)(r,{id:`n6hXUm`})})]}),t[3]=a):a=t[3],a}function I(e){let t=(0,D.c)(2),{variant:n}=e,r=n===void 0?`full`:n,i;return t[0]===r?i=t[1]:(i=(0,M.jsx)(N,{children:r===`follow`?(0,M.jsx)(R,{}):(0,M.jsx)(L,{})}),t[0]=r,t[1]=i),i}function L(){let e=(0,D.c)(3),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,M.jsx)(P,{icon:(0,M.jsx)(C,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,M.jsx)(r,{id:`cdmk8A`}),body:(0,M.jsx)(r,{id:`YaeyFh`})}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,M.jsx)(P,{icon:(0,M.jsx)(w,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,M.jsx)(r,{id:`9i21pa`}),body:(0,M.jsx)(r,{id:`KIIamL`})}),e[1]=n):n=e[1];let i;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,M.jsxs)(M.Fragment,{children:[t,n,(0,M.jsx)(P,{icon:(0,M.jsx)(x,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,M.jsx)(r,{id:`8cpeU3`}),body:(0,M.jsx)(r,{id:`DELNQk`})})]}),e[2]=i):i=e[2],i}function R(){let e=(0,D.c)(3),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,M.jsx)(P,{icon:(0,M.jsx)(S,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,M.jsx)(r,{id:`0xnQ_X`}),body:(0,M.jsx)(r,{id:`aCoQfY`})}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,M.jsx)(P,{icon:(0,M.jsx)(E,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,M.jsx)(r,{id:`5rnB76`}),body:(0,M.jsx)(r,{id:`kXNv8P`})}),e[1]=n):n=e[1];let i;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,M.jsxs)(M.Fragment,{children:[t,n,(0,M.jsx)(P,{icon:(0,M.jsx)(T,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,M.jsx)(r,{id:`oBK5fD`}),body:(0,M.jsx)(r,{id:`8Wav8y`})})]}),e[2]=i):i=e[2],i}function z(){let e=(0,D.c)(2),{projectLocalBinding:t}=y();if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=e=>{let n=e?`full`:`off`,r=t.patch({autoSync:{mode:n,enabled:e}});return r.ok?{ok:!0}:{ok:!1,error:h(r.error)}},e[0]=t,e[1]=n),n}function B(){let e=(0,D.c)(2),{projectLocalBinding:t}=y();if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=e=>{let n=t.patch({autoSync:{mode:e,enabled:null}});return n.ok?{ok:!0}:{ok:!1,error:h(n.error)}},e[0]=t,e[1]=n),n}function V(){let e=(0,D.c)(2),{projectBinding:t}=y();if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=e=>{let n=t.patch({autoSync:{default:e}});return n.ok?{ok:!0}:{ok:!1,error:h(n.error)}},e[0]=t,e[1]=n),n}function H(){let e=(0,D.c)(2),{projectLocalBinding:t}=y();if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=e=>{let n=t.patch({autoSync:e});return n.ok?{ok:!0}:{ok:!1,error:h(n.error)}},e[0]=t,e[1]=n),n}function U(e,t){let n=(0,D.c)(12),{_:r}=i(),[a,o]=(0,O.useState)(!1),s;n[0]!==r||n[1]!==e?(s=function(t){if(e===null)return _.error(r({id:`fiMNLl`})),!1;let n=e(t);if(!n.ok){console.error(`[sync] toggle failed:`,n.error);let e=n.error;return _.error(r(t?{id:`04RA0-`,values:{detail:e}}:{id:`qjHMHf`,values:{detail:e}})),!1}return!0},n[0]=r,n[1]=e,n[2]=s):s=n[2];let c=s,l;n[3]===c?l=n[4]:(l=function(e){if(e){o(!0);return}c(!1)},n[3]=c,n[4]=l);let u=l,d;n[5]!==c||n[6]!==t?(d=function(){c(!0)&&(o(!1),t?.onEnabled?.())},n[5]=c,n[6]=t,n[7]=d):d=n[7];let f=d,p;return n[8]!==a||n[9]!==f||n[10]!==u?(p={confirmOpen:a,setConfirmOpen:o,onToggleRequest:u,onConfirm:f},n[8]=a,n[9]=f,n[10]=u,n[11]=p):p=n[11],p}function W(e,t,n){let r=(0,D.c)(15),{_:a}=i(),[o,s]=(0,O.useState)(!1),[c,l]=(0,O.useState)(null),u;r[0]!==a||r[1]!==n||r[2]!==e?(u=function(t){if(e===null)return _.error(a({id:`fiMNLl`})),!1;let r=e(t);if(!r.ok){console.error(`[sync] mode change failed:`,r.error);let e=r.error;return _.error(a({id:`nOEDQs`,values:{detail:e}})),!1}return n?.onApplied?.(t),!0},r[0]=a,r[1]=n,r[2]=e,r[3]=u):u=r[3];let d=u,f;r[4]!==d||r[5]!==t?(f=function(e){if(e!==t){if(e===`off`){d(`off`);return}l(e),s(!0)}},r[4]=d,r[5]=t,r[6]=f):f=r[6];let p=f,m;r[7]!==d||r[8]!==c?(m=function(){c!==null&&d(c)&&s(!1)},r[7]=d,r[8]=c,r[9]=m):m=r[9];let h=m,g;return r[10]!==o||r[11]!==h||r[12]!==p||r[13]!==c?(g={confirmOpen:o,setConfirmOpen:s,pendingMode:c,onModeSelect:p,onConfirm:h},r[10]=o,r[11]=h,r[12]=p,r[13]=c,r[14]=g):g=r[14],g}function G(){let e=(0,D.c)(2),{projectLocalBinding:t}=y();if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=e=>{let n=t.patch({autoSync:e});return n.ok?{ok:!0}:{ok:!1,error:h(n.error)}},e[0]=t,e[1]=n),n}function K(e,t){let n=(0,D.c)(18),{_:r}=i(),a=G(),[o,s]=(0,O.useState)(!1),[c,l]=(0,O.useState)(null),u;n[0]===e?u=n[1]:(u=g(e)??`off`,n[0]=e,n[1]=u);let d=u,f;n[2]!==r||n[3]!==a?(f=function(e){if(a===null)return _.error(r({id:`fiMNLl`})),!1;let t=a(e);if(!t.ok){console.error(`[sync] badge control failed:`,t.error);let e=t.error;return _.error(r({id:`ZVOhXM`,values:{detail:e}})),!1}return!0},n[2]=r,n[3]=a,n[4]=f):f=n[4];let p=f,m;n[5]!==p||n[6]!==d?(m=function(e){if(e!==d){if(e===`off`){p({mode:`off`,enabled:null,resumeMode:null});return}l(e),s(!0)}},n[5]=p,n[6]=d,n[7]=m):m=n[7];let h=m,v;n[8]!==p||n[9]!==c?(v=function(){c!==null&&p({mode:c,enabled:null,resumeMode:null})&&(s(!1),l(null))},n[8]=p,n[9]=c,n[10]=v):v=n[10];let y=v,b=c===`follow`?t:0,x;return n[11]!==o||n[12]!==d||n[13]!==y||n[14]!==h||n[15]!==c||n[16]!==b?(x={mode:d,confirmOpen:o,setConfirmOpen:s,pendingMode:c,strandedCommitCount:b,onModeSelect:h,onConfirm:y},n[11]=o,n[12]=d,n[13]=y,n[14]=h,n[15]=c,n[16]=b,n[17]=x):x=n[17],x}async function q(e){let t=await fetch(`/api/sync/trigger`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({op:e})});if(!t.ok)throw Error(`sync trigger failed: ${t.status}`)}function J(e){let t=(0,D.c)(24),{open:n,onOpenChange:i,onConfirm:a,variant:s,strandedCommitCount:c}=e,h=s===void 0?`full`:s,g=c===void 0?0:c,_=h===`follow`&&g>0,v;t[0]===h?v=t[1]:(v=(0,M.jsx)(p,{children:(0,M.jsx)(F,{variant:h})}),t[0]=h,t[1]=v);let y;t[2]===h?y=t[3]:(y=(0,M.jsx)(I,{variant:h}),t[2]=h,t[3]=y);let b;t[4]!==_||t[5]!==g?(b=_&&(0,M.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:(0,M.jsx)(r,{id:`caw8gO`,values:{strandedCommitCount:g}})}),t[4]=_,t[5]=g,t[6]=b):b=t[6];let x;t[7]!==y||t[8]!==b?(x=(0,M.jsxs)(u,{children:[y,b]}),t[7]=y,t[8]=b,t[9]=x):x=t[9];let S;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,M.jsx)(f,{asChild:!0,children:(0,M.jsx)(o,{variant:`outline`,children:(0,M.jsx)(r,{id:`dEgA5A`})})}),t[10]=S):S=t[10];let C;t[11]===h?C=t[12]:(C=h===`follow`?(0,M.jsx)(r,{id:`jTUxaN`}):(0,M.jsx)(r,{id:`pPiV8s`}),t[11]=h,t[12]=C);let w;t[13]!==a||t[14]!==C?(w=(0,M.jsxs)(d,{children:[S,(0,M.jsx)(o,{onClick:a,children:C})]}),t[13]=a,t[14]=C,t[15]=w):w=t[15];let T;t[16]!==v||t[17]!==x||t[18]!==w?(T=(0,M.jsxs)(l,{className:`sm:max-w-lg`,children:[v,x,w]}),t[16]=v,t[17]=x,t[18]=w,t[19]=T):T=t[19];let E;return t[20]!==i||t[21]!==n||t[22]!==T?(E=(0,M.jsx)(m,{open:n,onOpenChange:i,children:T}),t[20]=i,t[21]=n,t[22]=T,t[23]=E):E=t[23],E}export{S as _,V as a,W as c,I as d,N as f,T as g,j as h,U as i,B as l,A as m,q as n,z as o,P as p,K as r,H as s,J as t,F as u};