@inkeep/open-knowledge 0.76.0-beta.2 → 0.76.0

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 (169) hide show
  1. package/dist/cli.mjs +6 -6
  2. package/dist/constants-C0Hcyynl.mjs +1 -0
  3. package/dist/{dist-D-tZrAhg.mjs → dist-B1Yrnssl.mjs} +462 -462
  4. package/dist/{dist-Do11N7Tz.mjs → dist-CbV4F1vK.mjs} +1 -1
  5. package/dist/index.mjs +2 -2
  6. package/dist/init-CLEOZlXl.mjs +1 -0
  7. package/dist/{init-DYFDc_AM.mjs → init-DZBrwj-f.mjs} +2 -2
  8. package/dist/{launch-json-removal-GEBAvUYG.mjs → launch-json-removal-CgFn8rKV.mjs} +1 -1
  9. package/dist/loader-BolqLV_p.mjs +1 -0
  10. package/dist/{loader-BL3dafAq.mjs → loader-DQ6r8XPB.mjs} +1 -1
  11. package/dist/{md-manager-BGnqyqi1-RVTa3VvL.mjs → md-manager-BGnqyqi1-BZhj8566.mjs} +1 -1
  12. package/dist/{open-browser-DXg92RYa.mjs → open-browser-CqtvHXWW.mjs} +1 -1
  13. package/dist/parse-worker.mjs +1 -1
  14. package/dist/preview-BOOqiYe1.mjs +1 -0
  15. package/dist/{preview-CKQSX1fz.mjs → preview-DRccedRk.mjs} +1 -1
  16. package/dist/public/assets/{ActivityModeContent-sEWbUM2h.js → ActivityModeContent-80CynN-G.js} +1 -1
  17. package/dist/public/assets/AddPropertiesButton-CKJ1dh70.js +2 -0
  18. package/dist/public/assets/{AgentDiffPane-CJt6NegL.js → AgentDiffPane-BpTvc7QT.js} +1 -1
  19. package/dist/public/assets/{AgentIconCluster-Bfnw1qcQ.js → AgentIconCluster-BjhMMJvg.js} +1 -1
  20. package/dist/public/assets/AgentThreadClientBinder-BGiF8A8t.js +1 -0
  21. package/dist/public/assets/{BugReportHistory-y8Wn379B.js → BugReportHistory-DRk2wfmX.js} +1 -1
  22. package/dist/public/assets/{BugReportHistoryDialog-Dgz75O0I.js → BugReportHistoryDialog-BRt_mvxb.js} +1 -1
  23. package/dist/public/assets/CodeMirrorPropInput-Cp0swO_H.js +3 -0
  24. package/dist/public/assets/{ConsentDialogBody-DtLolAtJ.js → ConsentDialogBody-LH1oK-K1.js} +1 -1
  25. package/dist/public/assets/{DiffViewBoundary-BSyhNpcd.js → DiffViewBoundary-CHGMiI3o.js} +1 -1
  26. package/dist/public/assets/DocumentContext-hLe9P0zX.js +39 -0
  27. package/dist/public/assets/{EditorModeToggle-BTeNrSSH.js → EditorModeToggle-E1iF7lJk.js} +1 -1
  28. package/dist/public/assets/{EnableSyncConfirmDialog-CrIPAXpZ.js → EnableSyncConfirmDialog-DzgXX1-3.js} +1 -1
  29. package/dist/public/assets/{ExcalidrawDocEditor-BELOgESV.js → ExcalidrawDocEditor-BCuw6nx_.js} +1 -1
  30. package/dist/public/assets/FeedbackForm-BTjOmOgu.js +1 -0
  31. package/dist/public/assets/{GraphPanel-BGy5jVGr.js → GraphPanel-7OJGN-lc.js} +2 -2
  32. package/dist/public/assets/{ImageAttachments-qWX-htol.js → ImageAttachments-NcjC3Vh7.js} +1 -1
  33. package/dist/public/assets/{ImportSkillDialog-CSX58ht8.js → ImportSkillDialog-DzfthSYq.js} +1 -1
  34. package/dist/public/assets/{LintConfigEditor-Dkws9z0m.js → LintConfigEditor-CjY5g8sR.js} +1 -1
  35. package/dist/public/assets/ManagedArtifactProperties--0Q4vn0P.js +1 -0
  36. package/dist/public/assets/{ManagedArtifactProperties-3kFpzDB_.js → ManagedArtifactProperties-BPBouf5O.js} +1 -1
  37. package/dist/public/assets/{MermaidDocEditor-uSFJFk-Q.js → MermaidDocEditor-DhXLW8lG.js} +1 -1
  38. package/dist/public/assets/{OpenInAgentMenuItem-yTb5ScY1.js → OpenInAgentMenuItem-BOkiSyJj.js} +1 -1
  39. package/dist/public/assets/{PropertyDisplayRow-BMw5KnKz.js → PropertyDisplayRow-Op30aJC6.js} +1 -1
  40. package/dist/public/assets/{RegisteredAgentIcon-CpYJv3Cv.js → RegisteredAgentIcon-wza-YtV5.js} +1 -1
  41. package/dist/public/assets/{ReportBugDialogBody-BnvYXojE.js → ReportBugDialogBody-DzspPXQX.js} +2 -2
  42. package/dist/public/assets/{ReportBugMenuTrigger-I8HBt3IX.js → ReportBugMenuTrigger-lEPMbjE8.js} +2 -2
  43. package/dist/public/assets/{SchemaConfigEditor-C0O1YHLZ.js → SchemaConfigEditor-DzXzHEV7.js} +1 -1
  44. package/dist/public/assets/SessionsHost-jBloLmPc.js +2 -0
  45. package/dist/public/assets/SettingsDialogBody-EE5EaKPQ.js +12 -0
  46. package/dist/public/assets/{ShareBranchSwitchDialog-BZJDp5FQ.js → ShareBranchSwitchDialog-Cf-6mqfV.js} +1 -1
  47. package/dist/public/assets/{ShareReceiveDialog-BfhbLBaC.js → ShareReceiveDialog-BhARlQ5y.js} +1 -1
  48. package/dist/public/assets/{ShareReceiveMissDialog-CMC3ICe-.js → ShareReceiveMissDialog-C4aqAPJQ.js} +1 -1
  49. package/dist/public/assets/{SkillCostValue-YxVPmSYK.js → SkillCostValue-yjmq3zbE.js} +1 -1
  50. package/dist/public/assets/{SkillEditBanner-DsoGh7Tv.js → SkillEditBanner-Dm70GN3t.js} +1 -1
  51. package/dist/public/assets/{SkillForkDialog-BVSBVDf3.js → SkillForkDialog-C11FyNmp.js} +1 -1
  52. package/dist/public/assets/{SkillInstallMenu-DW4e-S7w.js → SkillInstallMenu-B6dyzecr.js} +1 -1
  53. package/dist/public/assets/{SkillOriginInline-C4sCVeyL.js → SkillOriginInline-DE7ODwX7.js} +1 -1
  54. package/dist/public/assets/{SkillToolbarControls-DlGFhm-i.js → SkillToolbarControls-UCWivRc9.js} +1 -1
  55. package/dist/public/assets/{SlidesToolbarControls-Bdcz7tkM.js → SlidesToolbarControls-DFQKJb27.js} +1 -1
  56. package/dist/public/assets/{SourceEditor-dlV7KOrj.js → SourceEditor-CSWVuFTM.js} +1 -1
  57. package/dist/public/assets/{TerminalPanel-BVYvbm3j.js → TerminalPanel-DJScfB1V.js} +3 -3
  58. package/dist/public/assets/{TerminalWindowApp-vm-X0E3X.js → TerminalWindowApp-sXSINSWN.js} +1 -1
  59. package/dist/public/assets/{TextDocEditor-CtJNgvoq.js → TextDocEditor-DquT-g--.js} +1 -1
  60. package/dist/public/assets/ThreadView-DPTC9ghT.js +18 -0
  61. package/dist/public/assets/{TimelineDiffPane-C3TJ75M_.js → TimelineDiffPane-ChXnVFgP.js} +1 -1
  62. package/dist/public/assets/{agent-connection-status-PHc1Zzq8.js → agent-connection-status-GVtpWcVR.js} +1 -1
  63. package/dist/public/assets/auth-state-cache-DxK2THDm.js +11 -0
  64. package/dist/public/assets/{bug-report-send-manager-CIwCFBmr.js → bug-report-send-manager-nPQrCST0.js} +1 -1
  65. package/dist/public/assets/client-version-DfUKK1OJ.js +1 -0
  66. package/dist/public/assets/{comment-chips-B5qzry8g.js → comment-chips-BJXPFC82.js} +1 -1
  67. package/dist/public/assets/{config-provider-C0MBq3LM.js → config-provider--zrPCgkg.js} +2 -2
  68. package/dist/public/assets/{css-color-to-hex-B3FQXagN.js → css-color-to-hex-SSX32gXw.js} +1 -1
  69. package/dist/public/assets/{dist-PxGOwAUj.js → dist-868Gd8gd.js} +97 -97
  70. package/dist/public/assets/{doc-paths-DPXJQXNY.js → doc-paths-ZgPMU9hv.js} +1 -1
  71. package/dist/public/assets/{doc-undo-manager-DxsHGwsi.js → doc-undo-manager-DU2YTKPY.js} +1 -1
  72. package/dist/public/assets/{documents-events-B96TBXRu.js → documents-events-DyVmV0Qo.js} +1 -1
  73. package/dist/public/assets/{file-tree-adapter-DEUi21g-.js → file-tree-adapter-gYa-13I5.js} +1 -1
  74. package/dist/public/assets/{file-tree-utils-2ZD5gFbM.js → file-tree-utils-Cz4iVcHq.js} +1 -1
  75. package/dist/public/assets/{folder-config-api-BuejvyCq.js → folder-config-api-CL7I86xK.js} +1 -1
  76. package/dist/public/assets/{index-D9OhJE5u.js → index-D0kC4FE0.js} +15 -15
  77. package/dist/public/assets/{launch-agent-thread-CssNYKh8.js → launch-agent-thread-BwjhT4xd.js} +1 -1
  78. package/dist/public/assets/{lint-config-client-BPntTg9s.js → lint-config-client-DkLK3D4G.js} +1 -1
  79. package/dist/public/assets/{markdownlint-rule-browser-DvzDPV1j.js → markdownlint-rule-browser-D9Z_1KbZ.js} +1 -1
  80. package/dist/public/assets/messages-B1nSTUib.js +1 -0
  81. package/dist/public/assets/messages-Bpy2LxD1.js +1 -0
  82. package/dist/public/assets/messages-CX7QlbB5.js +1 -0
  83. package/dist/public/assets/messages-ChaFm4nX.js +1 -0
  84. package/dist/public/assets/messages-ClP1rPcb.js +1 -0
  85. package/dist/public/assets/messages-DSWauZRi.js +1 -0
  86. package/dist/public/assets/messages-DYZGu9n6.js +1 -0
  87. package/dist/public/assets/messages-DZlA_YKm.js +1 -0
  88. package/dist/public/assets/messages-Dg6rGsBw.js +1 -0
  89. package/dist/public/assets/messages-DrhSLGBr.js +1 -0
  90. package/dist/public/assets/messages-M06K4cBB.js +1 -0
  91. package/dist/public/assets/messages-ZbMG_CHm.js +1 -0
  92. package/dist/public/assets/navigation-targets-Dz7Mj6yW.js +1 -0
  93. package/dist/public/assets/{page-list-cache-CvgJb27U.js → page-list-cache-CLQGWEib.js} +1 -1
  94. package/dist/public/assets/{pending-receive-nav-store-CI_hCxBY.js → pending-receive-nav-store-DwTm9drS.js} +1 -1
  95. package/dist/public/assets/{progress-BF784yhL.js → progress-lTImqlq4.js} +5 -5
  96. package/dist/public/assets/{project-paths-DWu_AV-Y.js → project-paths-BXwPEPQG.js} +1 -1
  97. package/dist/public/assets/{prop-types-3AkeLtyh.js → prop-types-xcUPxUpJ.js} +1 -1
  98. package/dist/public/assets/{receive-store-Bc_vQgvG.js → receive-store-C_l3XIQE.js} +1 -1
  99. package/dist/public/assets/{selection-context-D1XXdKYq.js → selection-context-w3uUZcGy.js} +1 -1
  100. package/dist/public/assets/{skill-scope-B8EYySZH.js → skill-scope-BUi8busH.js} +1 -1
  101. package/dist/public/assets/{skills-api-CEPYeJT3.js → skills-api-Cx2rJHH9.js} +1 -1
  102. package/dist/public/assets/{src-CZud-6kC.js → src-snjoZldk.js} +1 -1
  103. package/dist/public/assets/{startup-marks-DvV0-HSR.js → startup-marks-C-4hCO0g.js} +1 -1
  104. package/dist/public/assets/{tag-pill-input-OXRPOwTz.js → tag-pill-input-nlqSiq7s.js} +1 -1
  105. package/dist/public/assets/{target-navigation-intent-BM5W4Xq4.js → target-navigation-intent-B26HXIhC.js} +1 -1
  106. package/dist/public/assets/{telemetry-impl-D_RVw4yU.js → telemetry-impl-DA4De97g.js} +1 -1
  107. package/dist/public/assets/{telemetry-startup-Ska2GwWw.js → telemetry-startup-BJ6uv0mr.js} +1 -1
  108. package/dist/public/assets/{terminal-cli-display-BFx4Fujy.js → terminal-cli-display-OF8nDzxb.js} +1 -1
  109. package/dist/public/assets/{terminal-command-events-qIdVZXUJ.js → terminal-command-events-DQbD5--h.js} +1 -1
  110. package/dist/public/assets/{terminal-launch-events-BG3QjK-a.js → terminal-launch-events-BI8c6JIE.js} +1 -1
  111. package/dist/public/assets/{terminal-telemetry-Ckc3_myT.js → terminal-telemetry-BiZK7c9d.js} +1 -1
  112. package/dist/public/assets/thread-client-B90HGYWT.js +4 -0
  113. package/dist/public/assets/{typing-burst-detector-BDkwn93x.js → typing-burst-detector-DZYJZ6gw.js} +4 -4
  114. package/dist/public/assets/{uninstall-DidFl7EF.js → uninstall-GT7MfN4C.js} +1 -1
  115. package/dist/public/assets/{use-activity-panel-BkGfVF3o.js → use-activity-panel-8w5Kd1Qi.js} +1 -1
  116. package/dist/public/assets/{use-apply-config-language-B7_mA2hk.js → use-apply-config-language-CVInnPNa.js} +2 -2
  117. package/dist/public/assets/{use-collab-url-BcwQXkF9.js → use-collab-url-Bm6gv2VZ.js} +1 -1
  118. package/dist/public/assets/{use-conflicts-BLsv7YlL.js → use-conflicts-D-6loWer.js} +1 -1
  119. package/dist/public/assets/{use-live-xterm-theme-Co4zj3Am.js → use-live-xterm-theme-BSNONOSQ.js} +1 -1
  120. package/dist/public/assets/{use-open-skill-BeSy8-rJ.js → use-open-skill-CKh3twwQ.js} +1 -1
  121. package/dist/public/assets/{use-settings-route-sC35wz8H.js → use-settings-route-Dmjvvjxd.js} +1 -1
  122. package/dist/public/assets/{use-skill-origin-fangpBrR.js → use-skill-origin-BJ_uQdjo.js} +1 -1
  123. package/dist/public/assets/{use-skills-BFl3ykEt.js → use-skills-CpkfrpBl.js} +1 -1
  124. package/dist/public/assets/{use-terminal-enabled-BmCX_MX_.js → use-terminal-enabled-OyYGdWpA.js} +1 -1
  125. package/dist/public/assets/use-timeline-entry-diff-OQilzjwJ.js +5 -0
  126. package/dist/public/assets/{use-workspace-DfO_Xv1Y.js → use-workspace-uVXshHxD.js} +1 -1
  127. package/dist/public/index.html +56 -56
  128. package/dist/public/uninstall.html +4 -4
  129. package/dist/{registry-probes-CZq0pq3Q.mjs → registry-probes-BrFZ7qtz.mjs} +1 -1
  130. package/dist/{removal-file-path-CIezznPj.mjs → removal-file-path-BCQaVi3t.mjs} +1 -1
  131. package/dist/{repair-launch-json-YORXWt3i.mjs → repair-launch-json-DXfwWcIe.mjs} +1 -1
  132. package/dist/{repair-mcp-configs-Cvj1Kmvc.mjs → repair-mcp-configs-ByeAv-iw.mjs} +1 -1
  133. package/dist/{src-Cl2uWN9c.mjs → src-CzuyfUAY.mjs} +1 -1
  134. package/dist/src-nHD4rQaT.mjs +1 -0
  135. package/dist/start-DSgDB-Xd.mjs +1 -0
  136. package/dist/{start-CiIEKnLx.mjs → start-Dt4LNKXw.mjs} +3 -3
  137. package/package.json +4 -4
  138. package/dist/constants-BzdeY7dd.mjs +0 -1
  139. package/dist/init-BOK2A-mx.mjs +0 -1
  140. package/dist/loader-D3o22fPd.mjs +0 -1
  141. package/dist/preview-cSKF3GU4.mjs +0 -1
  142. package/dist/public/assets/AddPropertiesButton-DM-ePjNt.js +0 -2
  143. package/dist/public/assets/AgentThreadClientBinder-CIEni8Z-.js +0 -1
  144. package/dist/public/assets/CodeMirrorPropInput-BJoiebyC.js +0 -3
  145. package/dist/public/assets/DocumentContext-CIEyfEzg.js +0 -39
  146. package/dist/public/assets/FeedbackForm-CRiaQgic.js +0 -1
  147. package/dist/public/assets/ManagedArtifactProperties-DkvvCLki.js +0 -1
  148. package/dist/public/assets/SessionsHost-BFLSEjDn.js +0 -2
  149. package/dist/public/assets/SettingsDialogBody-iQz3nDWh.js +0 -12
  150. package/dist/public/assets/ThreadView-DEcTVFTW.js +0 -18
  151. package/dist/public/assets/auth-state-cache-Bu3ElpXQ.js +0 -11
  152. package/dist/public/assets/client-version-BZyuYcjM.js +0 -1
  153. package/dist/public/assets/messages-A4_1oeLq.js +0 -1
  154. package/dist/public/assets/messages-B-GuOMHc.js +0 -1
  155. package/dist/public/assets/messages-B1vm3zWw.js +0 -1
  156. package/dist/public/assets/messages-BGrs212S.js +0 -1
  157. package/dist/public/assets/messages-BQ4IdAtB.js +0 -1
  158. package/dist/public/assets/messages-CRlJEY5h.js +0 -1
  159. package/dist/public/assets/messages-CbDvYKBi.js +0 -1
  160. package/dist/public/assets/messages-CryJhJWd.js +0 -1
  161. package/dist/public/assets/messages-CwpyOYl3.js +0 -1
  162. package/dist/public/assets/messages-DGusA3qN.js +0 -1
  163. package/dist/public/assets/messages-Di2gj9bu.js +0 -1
  164. package/dist/public/assets/messages-l1QmC8Hw.js +0 -1
  165. package/dist/public/assets/navigation-targets-CqBARqd5.js +0 -1
  166. package/dist/public/assets/thread-client-CIJy1Jbh.js +0 -4
  167. package/dist/public/assets/use-timeline-entry-diff-k3vq-Xn1.js +0 -5
  168. package/dist/src-G670cEwT.mjs +0 -1
  169. package/dist/start-Hhs84znx.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-BnyyQDRs.js";import{c as f}from"./select-ByJwKu6h.js";import{n as p,t as m}from"./toggle-group-C2_37kV5.js";import{Do as h,as as g,ma as _,ns as v}from"./dist-PxGOwAUj.js";import{n as y}from"./dist-CJhtNlOm2.js";import{i as b}from"./use-apply-config-theme-B5w38X1P.js";import{t as x}from"./file-tree-utils-2ZD5gFbM.js";import"./config-provider-C0MBq3LM.js";import{J as S,Tt as C}from"./dist-CLRN-Sf-.js";import{n as w,t as T}from"./cm-theme-Dq_9vMZK.js";import{t as E}from"./dist-BmR-sG8X.js";import{t as D}from"./text-viewer-languages-DBqMOo4t.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:()=>{w({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:_(`${h.has(i)?`/api/asset`:`/api/asset-text`}?path=${encodeURIComponent(e)}`)}}var I=T({dark:!0,background:`var(--background)`,gutterBackground:`var(--muted)`}),L=T({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=v(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 g;return t[25]!==n||t[26]!==r?(g=(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]=g):g=t[27],g}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 _=h;if(!_.hiddenFiles&&!_.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:`,g(t.error)),y.error(a({id:`P47EWZ`}),{description:g(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]!==_.hiddenFiles||t[16]!==S||t[17]!==o?(D=_.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]=_.hiddenFiles,t[16]=S,t[17]=o,t[18]=D):D=t[18];let k;t[19]!==a||t[20]!==_.onlyMarkdownFiles||t[21]!==S||t[22]!==o?(k=_.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]=_.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-BnyyQDRs.js";import{c as f}from"./select-ByJwKu6h.js";import{n as p,t as m}from"./toggle-group-C2_37kV5.js";import{To as h,es as g,fa as _,rs as v}from"./dist-868Gd8gd.js";import{n as y}from"./dist-CJhtNlOm2.js";import{i as b}from"./use-apply-config-theme-B5w38X1P.js";import{t as x}from"./file-tree-utils-Cz4iVcHq.js";import"./config-provider--zrPCgkg.js";import{J as S,Tt as C}from"./dist-CLRN-Sf-.js";import{n as w,t as T}from"./cm-theme-Dq_9vMZK.js";import{t as E}from"./dist-BmR-sG8X.js";import{t as D}from"./text-viewer-languages-DBqMOo4t.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:()=>{w({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:_(`${h.has(i)?`/api/asset`:`/api/asset-text`}?path=${encodeURIComponent(e)}`)}}var I=T({dark:!0,background:`var(--background)`,gutterBackground:`var(--muted)`}),L=T({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 _;t[4]!==a||t[5]!==o?(_=e=>{if(o===null)return;let t=o.patch({appearance:{sidebar:e}});t.ok||(console.warn(`[NotInSidebarIndicator] sidebar visibility flip rejected:`,v(t.error)),y.error(a({id:`P47EWZ`}),{description:v(t.error)}))},t[4]=a,t[5]=o,t[6]=_):_=t[6];let S=_,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-DgIQr9zS.js";import{Ts as h,as as g}from"./dist-PxGOwAUj.js";import{n as _}from"./dist-CJhtNlOm2.js";import{v}from"./documents-events-B96TBXRu.js";import{i as y}from"./use-apply-config-theme-B5w38X1P.js";import{t as b}from"./createLucideIcon-B6ULg5PN.js";import{t as x}from"./eye-BtMXolFK.js";import"./config-provider-C0MBq3LM.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,projectLocalSynced:n}=y();if(t===null||!n)return null;let r;return e[0]===t?r=e[1]:(r=e=>{let n=e?`full`:`off`,r=t.patch({autoSync:{mode:n,enabled:e}});return r.ok?{ok:!0}:{ok:!1,error:g(r.error)}},e[0]=t,e[1]=r),r}function B(){let e=(0,D.c)(2),{projectLocalBinding:t,projectLocalSynced:n}=y();if(t===null||!n)return null;let r;return e[0]===t?r=e[1]:(r=e=>{let n=t.patch({autoSync:{mode:e,enabled:null}});return n.ok?{ok:!0}:{ok:!1,error:g(n.error)}},e[0]=t,e[1]=r),r}function V(){let e=(0,D.c)(2),{projectBinding:t,projectSynced:n}=y();if(t===null||!n)return null;let r;return e[0]===t?r=e[1]:(r=e=>{let n=t.patch({autoSync:{default:e}});return n.ok?{ok:!0}:{ok:!1,error:g(n.error)}},e[0]=t,e[1]=r),r}function H(){let e=(0,D.c)(2),{projectLocalBinding:t,projectLocalSynced:n}=y();if(t===null||!n)return null;let r;return e[0]===t?r=e[1]:(r=e=>{let n=t.patch({autoSync:e});return n.ok?{ok:!0}:{ok:!1,error:g(n.error)}},e[0]=t,e[1]=r),r}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 _.info(r({id:`fiMNLl`}),{id:`sync-settings-not-ready`}),!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 _.info(a({id:`fiMNLl`}),{id:`sync-settings-not-ready`}),!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,projectLocalSynced:n}=y();if(t===null||!n)return null;let r;return e[0]===t?r=e[1]:(r=e=>{let n=t.patch({autoSync:e});return n.ok?{ok:!0}:{ok:!1,error:g(n.error)}},e[0]=t,e[1]=r),r}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=h(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 _.info(r({id:`fiMNLl`}),{id:`sync-settings-not-ready`}),!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 g=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]!==g||n[15]!==c||n[16]!==b?(x={mode:d,confirmOpen:o,setConfirmOpen:s,pendingMode:c,strandedCommitCount:b,onModeSelect:g,onConfirm:y},n[11]=o,n[12]=d,n[13]=y,n[14]=g,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-DgIQr9zS.js";import{Cs as h,rs as g}from"./dist-868Gd8gd.js";import{n as _}from"./dist-CJhtNlOm2.js";import{v}from"./documents-events-DyVmV0Qo.js";import{i as y}from"./use-apply-config-theme-B5w38X1P.js";import{t as b}from"./createLucideIcon-B6ULg5PN.js";import{t as x}from"./eye-BtMXolFK.js";import"./config-provider--zrPCgkg.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,projectLocalSynced:n}=y();if(t===null||!n)return null;let r;return e[0]===t?r=e[1]:(r=e=>{let n=e?`full`:`off`,r=t.patch({autoSync:{mode:n,enabled:e}});return r.ok?{ok:!0}:{ok:!1,error:g(r.error)}},e[0]=t,e[1]=r),r}function B(){let e=(0,D.c)(2),{projectLocalBinding:t,projectLocalSynced:n}=y();if(t===null||!n)return null;let r;return e[0]===t?r=e[1]:(r=e=>{let n=t.patch({autoSync:{mode:e,enabled:null}});return n.ok?{ok:!0}:{ok:!1,error:g(n.error)}},e[0]=t,e[1]=r),r}function V(){let e=(0,D.c)(2),{projectBinding:t,projectSynced:n}=y();if(t===null||!n)return null;let r;return e[0]===t?r=e[1]:(r=e=>{let n=t.patch({autoSync:{default:e}});return n.ok?{ok:!0}:{ok:!1,error:g(n.error)}},e[0]=t,e[1]=r),r}function H(){let e=(0,D.c)(2),{projectLocalBinding:t,projectLocalSynced:n}=y();if(t===null||!n)return null;let r;return e[0]===t?r=e[1]:(r=e=>{let n=t.patch({autoSync:e});return n.ok?{ok:!0}:{ok:!1,error:g(n.error)}},e[0]=t,e[1]=r),r}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 _.info(r({id:`fiMNLl`}),{id:`sync-settings-not-ready`}),!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 _.info(a({id:`fiMNLl`}),{id:`sync-settings-not-ready`}),!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,projectLocalSynced:n}=y();if(t===null||!n)return null;let r;return e[0]===t?r=e[1]:(r=e=>{let n=t.patch({autoSync:e});return n.ok?{ok:!0}:{ok:!1,error:g(n.error)}},e[0]=t,e[1]=r),r}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=h(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 _.info(r({id:`fiMNLl`}),{id:`sync-settings-not-ready`}),!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 g=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]!==g||n[15]!==c||n[16]!==b?(x={mode:d,confirmOpen:o,setConfirmOpen:s,pendingMode:c,strandedCommitCount:b,onModeSelect:g,onConfirm:y},n[11]=o,n[12]=d,n[13]=y,n[14]=g,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 +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{r}from"./dist-Nvb76hAm.js";import{t as i}from"./compiler-runtime-BfE3aGVn.js";import{Jo as a}from"./dist-PxGOwAUj.js";import{n as o,t as s}from"./excalidraw-scene-B6amJVTa.js";import{Na as c}from"./chunk-RM4UPSZO-BxyNl4pZ.js";import{Excalidraw as l,t as u}from"./prod-DY71yyJw.js";import{replaceYText as d}from"./MermaidDocEditor-uSFJFk-Q.js";var f=i(),p=e(n(),1),m={en:`en`,"zh-Hans":`zh-CN`,"zh-Hant":`zh-TW`,hi:null,es:`es-ES`,ar:`ar-SA`,fr:`fr-FR`,bn:null,"pt-BR":`pt-BR`,id:`id-ID`,ur:null,ko:`ko-KR`};a.filter(e=>m[e]===null);function h(e){return Object.hasOwn(m,e)}function g(e){return h(e)?m[e]??`en`:`en`}var _=t();function v(e){if(e.trim()===``)return{ok:!0,scene:s(u,null)};try{return{ok:!0,scene:s(u,JSON.parse(e))}}catch{return{ok:!1,scene:s(u,null)}}}function y(e){let t=(0,f.c)(22),{provider:n}=e,{_:i,i18n:a}=r(),s=n.document.getText(`source`),[m,h]=(0,p.useState)(null),y=(0,p.useRef)(s.toString()),b=v(s.toString());b.ok||console.warn(`[ExcalidrawDocEditor] initial snapshot could not be parsed — falling back to a blank canvas; the original bytes remain in the doc until the user draws their first element (appState-only tweaks on an empty canvas don't unblock the guard)`);let x=(0,p.useRef)(!b.ok),S;t[0]!==m||t[1]!==y||t[2]!==s?(S=()=>{if(m===null)return;let e=()=>{let e=s.toString();if(e===y.current)return;y.current=e;let t=v(e);if(!t.ok){console.warn(`[ExcalidrawDocEditor] sync: remote snapshot could not be parsed — skipping this update`);return}let{elements:n,appState:r,files:i}=t.scene;m.updateScene({elements:n,appState:r,captureUpdate:c.NEVER});let a=Object.values(i);a.length>0&&m.addFiles(a)};return s.observe(e),()=>s.unobserve(e)},t[0]=m,t[1]=y,t[2]=s,t[3]=S):S=t[3];let C;t[4]!==m||t[5]!==s?(C=[s,m],t[4]=m,t[5]=s,t[6]=C):C=t[6],(0,p.useEffect)(S,C);let w;t[7]!==y||t[8]!==s?(w=(e,t,n)=>{if(x.current){if(e.length===0)return;x.current=!1}let r=o(u,e,t,n);r!==y.current&&(y.current=r,d(s,r))},t[7]=y,t[8]=s,t[9]=w):w=t[9];let T=w,E;t[10]===i?E=t[11]:(E=i({id:`wxRR0H`}),t[10]=i,t[11]=E);let D=b.scene,O;t[12]===a.locale?O=t[13]:(O=g(a.locale),t[12]=a.locale,t[13]=O);let k;t[14]!==T||t[15]!==b.scene||t[16]!==h||t[17]!==O?(k=(0,_.jsx)(`div`,{className:`absolute inset-0 z-0`,children:(0,_.jsx)(l,{onExcalidrawAPI:h,initialData:D,onChange:T,langCode:O})}),t[14]=T,t[15]=b.scene,t[16]=h,t[17]=O,t[18]=k):k=t[18];let A;return t[19]!==E||t[20]!==k?(A=(0,_.jsx)(`main`,{className:`relative flex h-full min-h-0 flex-col bg-background`,"aria-label":E,"data-excalidraw-doc-editor":``,children:k}),t[19]=E,t[20]=k,t[21]=A):A=t[21],A}export{y as ExcalidrawDocEditor};
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{r}from"./dist-Nvb76hAm.js";import{t as i}from"./compiler-runtime-BfE3aGVn.js";import{Ko as a}from"./dist-868Gd8gd.js";import{n as o,t as s}from"./excalidraw-scene-B6amJVTa.js";import{Na as c}from"./chunk-RM4UPSZO-BxyNl4pZ.js";import{Excalidraw as l,t as u}from"./prod-DY71yyJw.js";import{replaceYText as d}from"./MermaidDocEditor-DhXLW8lG.js";var f=i(),p=e(n(),1),m={en:`en`,"zh-Hans":`zh-CN`,"zh-Hant":`zh-TW`,hi:null,es:`es-ES`,ar:`ar-SA`,fr:`fr-FR`,bn:null,"pt-BR":`pt-BR`,id:`id-ID`,ur:null,ko:`ko-KR`};a.filter(e=>m[e]===null);function h(e){return Object.hasOwn(m,e)}function g(e){return h(e)?m[e]??`en`:`en`}var _=t();function v(e){if(e.trim()===``)return{ok:!0,scene:s(u,null)};try{return{ok:!0,scene:s(u,JSON.parse(e))}}catch{return{ok:!1,scene:s(u,null)}}}function y(e){let t=(0,f.c)(22),{provider:n}=e,{_:i,i18n:a}=r(),s=n.document.getText(`source`),[m,h]=(0,p.useState)(null),y=(0,p.useRef)(s.toString()),b=v(s.toString());b.ok||console.warn(`[ExcalidrawDocEditor] initial snapshot could not be parsed — falling back to a blank canvas; the original bytes remain in the doc until the user draws their first element (appState-only tweaks on an empty canvas don't unblock the guard)`);let x=(0,p.useRef)(!b.ok),S;t[0]!==m||t[1]!==y||t[2]!==s?(S=()=>{if(m===null)return;let e=()=>{let e=s.toString();if(e===y.current)return;y.current=e;let t=v(e);if(!t.ok){console.warn(`[ExcalidrawDocEditor] sync: remote snapshot could not be parsed — skipping this update`);return}let{elements:n,appState:r,files:i}=t.scene;m.updateScene({elements:n,appState:r,captureUpdate:c.NEVER});let a=Object.values(i);a.length>0&&m.addFiles(a)};return s.observe(e),()=>s.unobserve(e)},t[0]=m,t[1]=y,t[2]=s,t[3]=S):S=t[3];let C;t[4]!==m||t[5]!==s?(C=[s,m],t[4]=m,t[5]=s,t[6]=C):C=t[6],(0,p.useEffect)(S,C);let w;t[7]!==y||t[8]!==s?(w=(e,t,n)=>{if(x.current){if(e.length===0)return;x.current=!1}let r=o(u,e,t,n);r!==y.current&&(y.current=r,d(s,r))},t[7]=y,t[8]=s,t[9]=w):w=t[9];let T=w,E;t[10]===i?E=t[11]:(E=i({id:`wxRR0H`}),t[10]=i,t[11]=E);let D=b.scene,O;t[12]===a.locale?O=t[13]:(O=g(a.locale),t[12]=a.locale,t[13]=O);let k;t[14]!==T||t[15]!==b.scene||t[16]!==h||t[17]!==O?(k=(0,_.jsx)(`div`,{className:`absolute inset-0 z-0`,children:(0,_.jsx)(l,{onExcalidrawAPI:h,initialData:D,onChange:T,langCode:O})}),t[14]=T,t[15]=b.scene,t[16]=h,t[17]=O,t[18]=k):k=t[18];let A;return t[19]!==E||t[20]!==k?(A=(0,_.jsx)(`main`,{className:`relative flex h-full min-h-0 flex-col bg-background`,"aria-label":E,"data-excalidraw-doc-editor":``,children:k}),t[19]=E,t[20]=k,t[21]=A):A=t[21],A}export{y as ExcalidrawDocEditor};
@@ -0,0 +1 @@
1
+ import{t as e}from"./index-D0kC4FE0.js";export{e as FeedbackForm};