@inkeep/open-knowledge 0.37.1 → 0.37.3

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 (111) hide show
  1. package/dist/{acp-harness-probe-BaXcmDE0.mjs → acp-harness-probe-N1sSMZGg.mjs} +2 -2
  2. package/dist/assets/skills/discovery/SKILL.md +1 -1
  3. package/dist/assets/skills/project/SKILL.md +1 -1
  4. package/dist/assets/skills/write-skill/SKILL.md +1 -1
  5. package/dist/cli.mjs +62 -63
  6. package/dist/constants-CchUdUMd.mjs +2 -0
  7. package/dist/{git-handle-Dn9o6II0.mjs → git-handle-BNHoFrny.mjs} +2 -2
  8. package/dist/git-handle-CBwvOa-O.mjs +1 -0
  9. package/dist/index.d.mts +12 -1
  10. package/dist/index.mjs +1 -1
  11. package/dist/init-AZMgQ3nS.mjs +1 -0
  12. package/dist/init-CBfUP8hN.mjs +643 -0
  13. package/dist/{launch-json-removal-BNpNXmQG.mjs → launch-json-removal-RCdxWSel.mjs} +2 -2
  14. package/dist/{loader-Cz_WhlON.mjs → loader-DcESlMxI.mjs} +2 -2
  15. package/dist/loader-EZiQC7cG.mjs +1 -0
  16. package/dist/{open-browser-BTGfTWF8.mjs → open-browser-DGOoelb3.mjs} +2 -2
  17. package/dist/{preview-DJt8zOrQ.mjs → preview-Bt-_RLQB.mjs} +2 -2
  18. package/dist/preview-DGyDBzMH.mjs +1 -0
  19. package/dist/public/assets/{ActivityModeContent-fBC0Voik.js → ActivityModeContent-Cgqa56C2.js} +1 -1
  20. package/dist/public/assets/{AgentDiffPane-ChHaUBEu.js → AgentDiffPane-BnvGYsRG.js} +1 -1
  21. package/dist/public/assets/{AgentThreadClientBinder-BMUA20Qq.js → AgentThreadClientBinder-Dzf4FbOU.js} +1 -1
  22. package/dist/public/assets/{CodeMirrorPropInput-0TqZTWBW.js → CodeMirrorPropInput-Cx9FW420.js} +3 -3
  23. package/dist/public/assets/{DocumentContext-BcosLIs9.js → DocumentContext-Dog3N-Wc.js} +17 -17
  24. package/dist/public/assets/{EnableSyncConfirmDialog-Bo_sKBNs.js → EnableSyncConfirmDialog-DtYm7V_O.js} +1 -1
  25. package/dist/public/assets/{GraphPanel-CpJnEgaj.js → GraphPanel-CvqA9xnU.js} +1 -1
  26. package/dist/public/assets/{ManagedArtifactProperties-Cq1ODSN4.js → ManagedArtifactProperties-67a94DaU.js} +1 -1
  27. package/dist/public/assets/{McpConsentDialogBody-hjXtWWhb.js → McpConsentDialogBody-KLslh1LR.js} +1 -1
  28. package/dist/public/assets/{MermaidDocEditor-Bxza5rNh.js → MermaidDocEditor-DH7WRAfL.js} +1 -1
  29. package/dist/public/assets/{PropertyPanel-BoUU2Tf8.js → PropertyPanel-BoKsESSi.js} +1 -1
  30. package/dist/public/assets/{ReportBugDialogBody-CYIt3IGK.js → ReportBugDialogBody-Dg8V3ei2.js} +1 -1
  31. package/dist/public/assets/SettingsDialogBody-DVTTk_BU.js +7 -0
  32. package/dist/public/assets/{ShareBranchSwitchDialog-BDTs1Q1p.js → ShareBranchSwitchDialog-l3OatXNl.js} +1 -1
  33. package/dist/public/assets/ShareReceiveDialog-DuvJdcqg.js +1 -0
  34. package/dist/public/assets/{ShareReceiveMissDialog-Dh6JMbsb.js → ShareReceiveMissDialog-DLNWM2Pm.js} +1 -1
  35. package/dist/public/assets/{SkillEditorActions-NiL9cPXX.js → SkillEditorActions-B5cWxK9p.js} +1 -1
  36. package/dist/public/assets/{SourceEditor-DAvUlAy0.js → SourceEditor-yoaSx3d8.js} +1 -1
  37. package/dist/public/assets/{TerminalPanel-OeXRTBwe.js → TerminalPanel-D3vyvoTf.js} +1 -1
  38. package/dist/public/assets/TerminalSessionsHost-D500Eh7g.js +2 -0
  39. package/dist/public/assets/{TerminalWindowApp-CH4As48E.js → TerminalWindowApp-aWCNBKLz.js} +1 -1
  40. package/dist/public/assets/{ThreadView-BsUfIPqU.js → ThreadView-nnZWrgGO.js} +1 -1
  41. package/dist/public/assets/{TimelineDiffPane-DsFAdXX4.js → TimelineDiffPane-B7O4osuT.js} +1 -1
  42. package/dist/public/assets/{agent-diff-store-CmFPaGyV.js → agent-diff-store-DuUxJBjU.js} +1 -1
  43. package/dist/public/assets/{agent-visibility-BKHfJySh.js → agent-visibility-D2Mr5Jzk.js} +1 -1
  44. package/dist/public/assets/{auth-state-cache-CnAAGiPA.js → auth-state-cache-CEBkZrQO.js} +7 -7
  45. package/dist/public/assets/{config-provider-DMJrhWUp.js → config-provider-pXCSDe7I.js} +2 -2
  46. package/dist/public/assets/dist-CAKhzFlX.js +124 -0
  47. package/dist/public/assets/{dist-CJUUFO9W.js → dist-DZ_OIHsD.js} +1 -1
  48. package/dist/public/assets/{dist-D6R8vG-1.js → dist-zc03OoUp.js} +2 -2
  49. package/dist/public/assets/{doc-hash-sxvnKnL5.js → doc-hash-D8EI7kHA.js} +1 -1
  50. package/dist/public/assets/{documents-events-Bd2Tt95I.js → documents-events-BTDcCELc.js} +1 -1
  51. package/dist/public/assets/{file-tree-adapter-Cl9Gep-E.js → file-tree-adapter-BJqJ74LH.js} +1 -1
  52. package/dist/public/assets/index-1TeKfA3W.js +1995 -0
  53. package/dist/public/assets/index-CJ_7DqKn.css +1 -0
  54. package/dist/public/assets/{keyboard-shortcuts-ziymY5lY.js → keyboard-shortcuts-g08DUgcY.js} +1 -1
  55. package/dist/public/assets/{lint-config-client-B4tvFSj6.js → lint-config-client-BcxnEgHO.js} +1 -1
  56. package/dist/public/assets/{navigation-targets-CdngrI3e.js → navigation-targets-DUt4VF6E.js} +1 -1
  57. package/dist/public/assets/{open-managed-artifact-tab-CLJdEdvs.js → open-managed-artifact-tab-CRLFq4-B.js} +1 -1
  58. package/dist/public/assets/{pending-receive-nav-store-pcoVj0T5.js → pending-receive-nav-store-C4eKkzcx.js} +1 -1
  59. package/dist/public/assets/{prop-types-DIMZw1aA.js → prop-types-CBBOToAL.js} +1 -1
  60. package/dist/public/assets/{receive-store-CnAYtEWn.js → receive-store-nuIidOiz.js} +1 -1
  61. package/dist/public/assets/{selection-context-BLlRaGhH.js → selection-context-DgIDY04o.js} +1 -1
  62. package/dist/public/assets/{skill-actions-D_uHXMrN.js → skill-actions-DzaHqGRg.js} +1 -1
  63. package/dist/public/assets/{skills-api-CMDs_cbJ.js → skills-api-BOe6s3mN.js} +1 -1
  64. package/dist/public/assets/{src-DPcWwhgv.js → src-gANoUa2-.js} +1 -1
  65. package/dist/public/assets/{target-navigation-intent-BojcuU7o.js → target-navigation-intent-DzXHO48d.js} +1 -1
  66. package/dist/public/assets/{telemetry-impl-CDBAVJb9.js → telemetry-impl-ClWP6_iI.js} +1 -1
  67. package/dist/public/assets/{telemetry-startup-CZwQc5d3.js → telemetry-startup-D0otGNQT.js} +1 -1
  68. package/dist/public/assets/{terminal-launch-events-fYxl8byx.js → terminal-launch-events-BcKnMQ0G.js} +1 -1
  69. package/dist/public/assets/{terminal-telemetry-YHplv3Gm.js → terminal-telemetry-B-c91nRO.js} +1 -1
  70. package/dist/public/assets/{typing-burst-detector-rg4heHQj.js → typing-burst-detector-B_jwquxb.js} +1 -1
  71. package/dist/public/assets/{use-activity-panel-DXQ7UC10.js → use-activity-panel-Ds1FSy22.js} +1 -1
  72. package/dist/public/assets/{use-apply-config-color-theme-Bb_FV0b5.js → use-apply-config-color-theme-CTTOdBYC.js} +1 -1
  73. package/dist/public/assets/{use-collab-url-xyz-Nyoe.js → use-collab-url-DJN-Eh99.js} +1 -1
  74. package/dist/public/assets/{use-live-xterm-theme-qqv_COHj.js → use-live-xterm-theme-BVrjqV4f.js} +1 -1
  75. package/dist/public/assets/{use-terminal-enabled-CoqSHX6g.js → use-terminal-enabled-WZKABQLf.js} +1 -1
  76. package/dist/public/assets/{use-timeline-entry-diff-vDsLY3JP.js → use-timeline-entry-diff-DD8d8a6p.js} +1 -1
  77. package/dist/public/assets/{use-workspace--VMy_KL1.js → use-workspace-CqL9iZdQ.js} +1 -1
  78. package/dist/public/assets/{workspace-paths-0CCDk_CH.js → workspace-paths-d9KyFHx6.js} +1 -1
  79. package/dist/public/index.html +34 -34
  80. package/dist/{repair-launch-json-QySpBNGz.mjs → repair-launch-json-zFpMB98b.mjs} +2 -2
  81. package/dist/{repair-mcp-configs-BnLNbEPY.mjs → repair-mcp-configs-BooTRwN8.mjs} +2 -2
  82. package/dist/repair-skills-DXhO-R2J.mjs +1 -0
  83. package/dist/{repair-skills-my6e7ABJ.mjs → repair-skills-M9d8MZVm.mjs} +2 -2
  84. package/dist/server-lock-3eYo5zvq.mjs +1 -0
  85. package/dist/{server-lock-BCKlDt3u.mjs → server-lock-DfCsjalw.mjs} +2 -2
  86. package/dist/src-CDixjEaS.mjs +3262 -0
  87. package/dist/src-CL0d0X9t.mjs +1 -0
  88. package/dist/{src-CB6BqwdE.mjs → src-CXOotH7J.mjs} +109 -109
  89. package/dist/src-DRGXfsmB.mjs +21 -0
  90. package/dist/{start-BzmMNHPk.mjs → start-CJDgfxsl.mjs} +2 -2
  91. package/dist/start-DWQUoMMz.mjs +1 -0
  92. package/dist/{write-project-skill-BIiTrHhN.mjs → write-project-skill-B7oIs3rt.mjs} +4 -4
  93. package/package.json +5 -5
  94. package/dist/constants-BtC4Ad17.mjs +0 -2
  95. package/dist/git-handle-CeDCG6sj.mjs +0 -1
  96. package/dist/init-B-c_JFb0.mjs +0 -1
  97. package/dist/init-CCXK-jEf.mjs +0 -643
  98. package/dist/loader-Cc0XghVD.mjs +0 -1
  99. package/dist/preview-BS1Ouf2D.mjs +0 -1
  100. package/dist/public/assets/SettingsDialogBody-Ya-LreoD.js +0 -7
  101. package/dist/public/assets/ShareReceiveDialog-B2mln2_V.js +0 -1
  102. package/dist/public/assets/TerminalSessionsHost-uEP7qR5I.js +0 -2
  103. package/dist/public/assets/dist-CG58rUCC.js +0 -113
  104. package/dist/public/assets/index-CD3OM1Xi.js +0 -1995
  105. package/dist/public/assets/index-DS4HqlZl.css +0 -1
  106. package/dist/repair-skills-ZB7QzRgz.mjs +0 -1
  107. package/dist/server-lock-BrjnkHOv.mjs +0 -1
  108. package/dist/src-5hx6F-Ql.mjs +0 -3262
  109. package/dist/src-B1d5f35Y.mjs +0 -21
  110. package/dist/src-BuzTw3li.mjs +0 -1
  111. package/dist/start-DkuS68HX.mjs +0 -1
@@ -1 +1 @@
1
- import{Ni as e}from"./dist-D6R8vG-1.js";var t={general:{id:`Weq9zb`},workspace:{id:`pmUArF`},search:{id:`A1taO8`},wysiwyg:{id:`ur2XSb`},source:{id:`tiWX6q`},navigation:{id:`LXfNU-`}},n=Object.keys(t),r=[{id:`command-palette`,category:`general`,title:{id:`ZjtgI-`},description:{id:`OFBmkg`},scope:{id:`2GT3Hf`},bindings:[{mac:`⌘ K`,windowsLinux:`Ctrl K`,match:{key:`k`,mod:!0}}]},{id:`settings`,category:`general`,title:{id:`Tz0i8g`},description:{id:`6m_7We`},scope:{id:`zL0LPh`},bindings:[{mac:`⌘ ,`,windowsLinux:`Ctrl ,`,match:{key:`,`,anyMod:!0}}]},{id:`new-item`,category:`general`,title:{id:`HdkSiO`},description:{id:`KkEAud`},scope:{id:`zL0LPh`},bindings:[{mac:`⌘ N`,windowsLinux:`Ctrl N`,match:{key:`n`,mod:!0}},{mac:`⌥⌘ N`,windowsLinux:`Ctrl Alt N`,match:{key:`n`,anyMod:!0,altKey:!0,allowExtraModifiers:!0}}]},{id:`new-folder`,category:`general`,title:{id:`96G6Re`},description:{id:`3cOo2C`},scope:{id:`cZI5AL`},bindings:[{mac:`⇧⌘ N`,windowsLinux:`Ctrl Shift N`}]},{id:`toggle-files-sidebar`,category:`general`,title:{id:`rtdR4v`},description:{id:`EbZT7P`},scope:{id:`2GT3Hf`},bindings:[{mac:`⌥⌘ S`,windowsLinux:`Ctrl Alt S`,match:{code:`KeyS`,anyMod:!0,altKey:!0,allowExtraModifiers:!0}}]},{id:`toggle-document-panel`,category:`general`,title:{id:`lkYioO`},description:{id:`It9ARY`},scope:{id:`2GT3Hf`},bindings:[{mac:`⌥⌘ B`,windowsLinux:`Ctrl Alt B`,match:{code:`KeyB`,anyMod:!0,altKey:!0,allowExtraModifiers:!0}}]},{id:`toggle-terminal-panel`,category:`general`,title:{id:`dPOFid`},description:{id:`oCNLN8`},scope:{id:`cZI5AL`},bindings:[{mac:`⌘ J`,windowsLinux:`Ctrl J`,match:{key:`j`,mod:!0}}]},{id:`open-ask-ai`,category:`general`,title:{id:`xWEvuo`},description:{id:`5OTgC7`},scope:{id:`cZI5AL`},bindings:[{mac:`⌘ L`,windowsLinux:`Ctrl L`,match:{key:`l`,mod:!0}}]},{id:`new-terminal-tab`,category:`general`,title:{id:`k0vc0N`},description:{id:`si3L24`},scope:{id:`cZI5AL`},bindings:[{mac:`⇧⌘ J`,windowsLinux:`Ctrl Shift J`,match:{key:`j`,mod:!0,shiftKey:!0}}]},{id:`tab-new`,category:`navigation`,title:{id:`3YvS-c`},description:{id:`t6w1cq`},scope:{id:`2GT3Hf`},bindings:[{mac:`⌘ T`,windowsLinux:`Ctrl T`,match:{key:`t`,mod:!0}}]},{id:`tab-next`,category:`navigation`,title:{id:`l46MqT`},description:{id:`thnPBX`},scope:{id:`2GT3Hf`},bindings:[{mac:`⌃ Tab`,windowsLinux:`Ctrl Tab`,match:{key:`Tab`,ctrlKey:!0}}]},{id:`tab-previous`,category:`navigation`,title:{id:`Mh_4hd`},description:{id:`DJd000`},scope:{id:`2GT3Hf`},bindings:[{mac:`⌃⇧ Tab`,windowsLinux:`Ctrl Shift Tab`,match:{key:`Tab`,ctrlKey:!0,shiftKey:!0}}]},{id:`tab-jump`,category:`navigation`,title:{id:`_6FVBz`},description:{id:`wGSHzy`},scope:{id:`2GT3Hf`},bindings:[{mac:`⌘ 1-8`,windowsLinux:`Ctrl 1-8`}]},{id:`tab-jump-last`,category:`navigation`,title:{id:`N1KkEO`},description:{id:`ZQJ1IV`},scope:{id:`2GT3Hf`},bindings:[{mac:`⌘ 9`,windowsLinux:`Ctrl 9`}]},{id:`tab-reopen-closed`,category:`navigation`,title:{id:`hpzRlK`},description:{id:`E5WeIy`},scope:{id:`2GT3Hf`},bindings:[{mac:`⇧⌘ T`,windowsLinux:`Ctrl Shift T`,match:{key:`t`,mod:!0,shiftKey:!0}}]},{id:`open-folder`,category:`workspace`,title:{id:`PVUn_c`},description:{id:`VYd_YA`},scope:{id:`cZI5AL`},bindings:[{mac:`⌘ O`,windowsLinux:`Ctrl O`}]},{id:`open-file`,category:`workspace`,title:{id:`9npOH9`},description:{id:`H08D2X`},scope:{id:`cZI5AL`},bindings:[{mac:`⇧⌘ O`,windowsLinux:`Ctrl Shift O`}]},{id:`switch-project`,category:`workspace`,title:{id:`xaDWAI`},description:{id:`oS1YpJ`},scope:{id:`cZI5AL`},bindings:[{mac:`⇧⌘ P`,windowsLinux:`Ctrl Shift P`}]},{id:`file-tree-copy`,category:`workspace`,title:{id:`eGUbmF`},description:{id:`7uBlRT`},scope:{id:`vbK_ZG`},bindings:[{mac:`⌘ C`,windowsLinux:`Ctrl C`}]},{id:`file-tree-paste`,category:`workspace`,title:{id:`_tjopj`},description:{id:`e4PbgC`},scope:{id:`vbK_ZG`},bindings:[{mac:`⌘ V`,windowsLinux:`Ctrl V`}]},{id:`file-tree-duplicate`,category:`workspace`,title:{id:`ot5BRK`},description:{id:`mxY24F`},scope:{id:`vbK_ZG`},bindings:[{mac:`⌘ D`,windowsLinux:`Ctrl D`}]},{id:`file-tree-delete`,category:`workspace`,title:{id:`VxO6wR`},description:{id:`osRqlv`},scope:{id:`vbK_ZG`},bindings:[{mac:`⌘ Backspace`,windowsLinux:`Delete`}]},{id:`file-tree-select-all`,category:`workspace`,title:{id:`1d1F11`},description:{id:`4v2Yyz`},scope:{id:`vbK_ZG`},bindings:[{mac:`⌘ A`,windowsLinux:`Ctrl A`}]},{id:`find`,category:`search`,title:{id:`KujtjC`},description:{id:`8OGgNM`},scope:{id:`ur2XSb`},bindings:[{mac:`⌘ F`,windowsLinux:`Ctrl F`,match:{key:`f`,mod:!0,allowShiftKey:!0}}]},{id:`replace`,category:`search`,title:{id:`fqSfXY`},description:{id:`wT4iQr`},scope:{id:`ur2XSb`},bindings:[{mac:`⌥⌘ F`,windowsLinux:`Ctrl H`,match:{mac:{key:`f`,mod:!0,altKey:!0},windowsLinux:{key:`h`,mod:!0}}}]},{id:`find-next`,category:`search`,title:{id:`v7lbnC`},description:{id:`PR9FSv`},scope:{id:`EqtBXb`},bindings:[{mac:`⌘ G`,windowsLinux:`Ctrl G`,match:{key:`g`,mod:!0}},{mac:`F3`,windowsLinux:`F3`,match:{key:`F3`}}]},{id:`find-previous`,category:`search`,title:{id:`PB4upl`},description:{id:`PgzIpb`},scope:{id:`EqtBXb`},bindings:[{mac:`⇧⌘ G`,windowsLinux:`Ctrl Shift G`,match:{key:`g`,mod:!0,shiftKey:!0}},{mac:`Shift F3`,windowsLinux:`Shift F3`,match:{key:`F3`,shiftKey:!0}}]},{id:`find-field-navigation`,category:`search`,title:{id:`yMgL_E`},description:{id:`5ALjdr`},scope:{id:`BgV29F`},bindings:[{mac:`Enter / Shift Enter`,windowsLinux:`Enter / Shift Enter`}]},{id:`replace-current-from-field`,category:`search`,title:{id:`LDuM35`},description:{id:`EZVxVz`},scope:{id:`rZVMkf`},bindings:[{mac:`Enter`,windowsLinux:`Enter`}]},{id:`format-bold`,category:`wysiwyg`,title:{id:`KmydK6`},description:{id:`fbdLmk`},scope:{id:`ur2XSb`},bindings:[{mac:`⌘ B`,windowsLinux:`Ctrl B`}]},{id:`format-italic`,category:`wysiwyg`,title:{id:`pzutoc`},description:{id:`TLIO3j`},scope:{id:`ur2XSb`},bindings:[{mac:`⌘ I`,windowsLinux:`Ctrl I`}]},{id:`format-underline`,category:`wysiwyg`,title:{id:`YyXtnN`},description:{id:`Okd2Xv`},scope:{id:`ur2XSb`},bindings:[{mac:`⌘ U`,windowsLinux:`Ctrl U`}]},{id:`format-strike`,category:`wysiwyg`,title:{id:`WhOsNE`},description:{id:`HCn0Ay`},scope:{id:`ur2XSb`},bindings:[{mac:`⇧⌘ X`,windowsLinux:`Ctrl Shift X`}]},{id:`format-inline-code`,category:`wysiwyg`,title:{id:`OX2Neh`},description:{id:`mo22UP`},scope:{id:`ur2XSb`},bindings:[{mac:`⌘ E`,windowsLinux:`Ctrl E`}]},{id:`format-highlight`,category:`wysiwyg`,title:{id:`gtEbeW`},description:{id:`Eji13z`},scope:{id:`ur2XSb`},bindings:[{mac:`⇧⌘ H`,windowsLinux:`Ctrl Shift H`}]},{id:`add-link`,category:`wysiwyg`,title:{id:`VzGJRl`},description:{id:`u7U_Ij`},scope:{id:`v77jrg`},bindings:[{mac:`⌘ K`,windowsLinux:`Ctrl K`,match:{key:`k`,mod:!0}}]},{id:`edit-with-ai`,category:`general`,title:{id:`G4-bgo`},description:{id:`a3H_MR`},scope:{id:`C62P6b`},bindings:[{mac:`⇧⌘ I`,windowsLinux:`Ctrl Shift I`,match:{key:`i`,mod:!0,shiftKey:!0}}]},{id:`history-undo-redo`,category:`wysiwyg`,title:{id:`i9OyGp`},description:{id:`lbkOif`},scope:{id:`ur2XSb`},bindings:[{mac:`⌘ Z`,windowsLinux:`Ctrl Z`},{mac:`⇧⌘ Z / ⌘ Y`,windowsLinux:`Ctrl Shift Z / Ctrl Y`}]},{id:`heading-paragraph`,category:`wysiwyg`,title:{id:`bkQRMh`},description:{id:`rgPqOw`},scope:{id:`ur2XSb`},bindings:[{mac:`⌥⌘ 0`,windowsLinux:`Ctrl Alt 0`}]},{id:`heading-levels`,category:`wysiwyg`,title:{id:`q_z77Z`},description:{id:`8Jm2EP`},scope:{id:`ur2XSb`},bindings:[{mac:`⌥⌘ 1-6`,windowsLinux:`Ctrl Alt 1-6`}]},{id:`list-bullet`,category:`wysiwyg`,title:{id:`ijLc3m`},description:{id:`By-7Pn`},scope:{id:`ur2XSb`},bindings:[{mac:`⇧⌘ 8`,windowsLinux:`Ctrl Shift 8`}]},{id:`list-ordered`,category:`wysiwyg`,title:{id:`iSQTsg`},description:{id:`ou1hFW`},scope:{id:`ur2XSb`},bindings:[{mac:`⇧⌘ 7`,windowsLinux:`Ctrl Shift 7`}]},{id:`list-task`,category:`wysiwyg`,title:{id:`E1_c72`},description:{id:`-slrNR`},scope:{id:`ur2XSb`},bindings:[{mac:`⇧⌘ 9`,windowsLinux:`Ctrl Shift 9`}]},{id:`code-block`,category:`wysiwyg`,title:{id:`4A3Yzu`},description:{id:`pTPqMK`},scope:{id:`ur2XSb`},bindings:[{mac:`⌥⌘ C`,windowsLinux:`Ctrl Alt C`}]},{id:`hard-break`,category:`wysiwyg`,title:{id:`-3ois8`},description:{id:`vDXqVv`},scope:{id:`ur2XSb`},bindings:[{mac:`Shift Enter`,windowsLinux:`Shift Enter`},{mac:`⌘ Enter`,windowsLinux:`Ctrl Enter`}]},{id:`move-block`,category:`wysiwyg`,title:{id:`f1XQyZ`},description:{id:`zQBg2C`},scope:{id:`ur2XSb`},bindings:[{mac:`⇧⌘ ↑`,windowsLinux:`Ctrl Shift ↑`},{mac:`⇧⌘ ↓`,windowsLinux:`Ctrl Shift ↓`}]},{id:`list-indent`,category:`wysiwyg`,title:{id:`G0YZ-I`},description:{id:`5GKMSz`},scope:{id:`ynIa4S`},bindings:[{mac:`Tab`,windowsLinux:`Tab`},{mac:`Shift Tab`,windowsLinux:`Shift Tab`}]},{id:`list-split-item`,category:`wysiwyg`,title:{id:`neRy3o`},description:{id:`NpC29w`},scope:{id:`ynIa4S`},bindings:[{mac:`Enter`,windowsLinux:`Enter`}]},{id:`table-cell-navigation`,category:`wysiwyg`,title:{id:`K8-WWn`},description:{id:`4NC2Ym`},scope:{id:`l1aQKz`},bindings:[{mac:`Tab`,windowsLinux:`Tab`},{mac:`Shift Tab`,windowsLinux:`Shift Tab`}]},{id:`table-delete-selection`,category:`wysiwyg`,title:{id:`881Uwh`},description:{id:`YEP3X2`},scope:{id:`99eR72`},bindings:[{mac:`Backspace / Delete`,windowsLinux:`Backspace / Delete`},{mac:`⌘ Backspace / ⌘ Delete`,windowsLinux:`Ctrl Backspace / Ctrl Delete`}]},{id:`delete-atom`,category:`wysiwyg`,title:{id:`636K3K`},description:{id:`oXKEsy`},scope:{id:`ur2XSb`},bindings:[{mac:`Backspace`,windowsLinux:`Backspace`},{mac:`Delete`,windowsLinux:`Delete`}]},{id:`slash-menu`,category:`navigation`,title:{id:`shNd9t`},description:{id:`8PmoQF`},scope:{id:`ur2XSb`},bindings:[{mac:`/`,windowsLinux:`/`}]},{id:`suggestion-navigation`,category:`navigation`,title:{id:`riqekz`},description:{id:`OiHJdA`},scope:{id:`y5FUYi`},bindings:[{mac:`↑ / ↓`,windowsLinux:`↑ / ↓`},{mac:`Enter / Tab`,windowsLinux:`Enter / Tab`},{mac:`Esc`,windowsLinux:`Esc`}]},{id:`component-navigation`,category:`navigation`,title:{id:`rwrPbS`},description:{id:`0s8-e8`},scope:{id:`ur2XSb`},bindings:[{mac:`↑ / ↓ / ← / →`,windowsLinux:`↑ / ↓ / ← / →`},{mac:`Enter / Esc`,windowsLinux:`Enter / Esc`}]},{id:`source-indent`,category:`source`,title:{id:`fwhX-N`},description:{id:`skf5Ix`},scope:{id:`tiWX6q`},bindings:[{mac:`Tab`,windowsLinux:`Tab`},{mac:`Shift Tab`,windowsLinux:`Shift Tab`}]},{id:`source-navigation`,category:`source`,title:{id:`qSKu2v`},description:{id:`gITz7o`},scope:{id:`tiWX6q`},bindings:[{mac:`Arrow keys / Option Arrow / Command Arrow`,windowsLinux:`Arrow keys / Ctrl Arrow / Home / End`},{mac:`Page Up / Page Down`,windowsLinux:`Page Up / Page Down`},{mac:`Shift with movement keys`,windowsLinux:`Shift with movement keys`}]},{id:`source-editing`,category:`source`,title:{id:`pFagOn`},description:{id:`MGb89P`},scope:{id:`tiWX6q`},bindings:[{mac:`Enter / Shift Enter / ⌘ Enter`,windowsLinux:`Enter / Shift Enter / Ctrl Enter`},{mac:`Backspace / Delete`,windowsLinux:`Backspace / Delete`},{mac:`⌥ Backspace / ⌥ Delete`,windowsLinux:`Ctrl Backspace / Ctrl Delete`},{mac:`⌥ ↑ / ⌥ ↓`,windowsLinux:`Alt ↑ / Alt ↓`},{mac:`⇧⌥ ↑ / ⇧⌥ ↓`,windowsLinux:`Shift Alt ↑ / Shift Alt ↓`},{mac:`⇧⌘ K`,windowsLinux:`Ctrl Shift K`}]},{id:`source-history`,category:`source`,title:{id:`4Sxexw`},description:{id:`r2huLx`},scope:{id:`tiWX6q`},bindings:[{mac:`⌘ Z`,windowsLinux:`Ctrl Z`},{mac:`⇧⌘ Z`,windowsLinux:`Ctrl Y / Ctrl Shift Z`},{mac:`⌘ U / ⇧⌘ U`,windowsLinux:`Ctrl U / Alt U`}]},{id:`source-select-all`,category:`source`,title:{id:`a-cKXz`},description:{id:`UTNVyS`},scope:{id:`tiWX6q`},bindings:[{mac:`⌘ A`,windowsLinux:`Ctrl A`}]},{id:`source-multi-cursor`,category:`source`,title:{id:`mg0YGL`},description:{id:`lWNpNB`},scope:{id:`tiWX6q`},bindings:[{mac:`⌥⌘ ↑ / ⌥⌘ ↓`,windowsLinux:`Ctrl Alt ↑ / Ctrl Alt ↓`},{mac:`⇧⌘ L`,windowsLinux:`Ctrl Shift L`}]},{id:`source-search`,category:`source`,title:{id:`7OhaRy`},description:{id:`mwMF9u`},scope:{id:`tiWX6q`},bindings:[{mac:`⌘ F`,windowsLinux:`Ctrl F`}]},{id:`source-toggle-comment`,category:`source`,title:{id:`RfaEio`},description:{id:`MrwYIK`},scope:{id:`tiWX6q`},bindings:[{mac:`⌘ /`,windowsLinux:`Ctrl /`},{mac:`Shift Alt A`,windowsLinux:`Shift Alt A`}]},{id:`source-select-next-occurrence`,category:`source`,title:{id:`hY8pka`},description:{id:`XnlF3W`},scope:{id:`tiWX6q`},bindings:[{mac:`⌘ D`,windowsLinux:`Ctrl D`}]},{id:`source-goto-line`,category:`source`,title:{id:`7FamGZ`},description:{id:`yHikCO`},scope:{id:`tiWX6q`},bindings:[{mac:`⌥⌘ G`,windowsLinux:`Ctrl Alt G`}]},{id:`source-find-results`,category:`source`,title:{id:`rJVoVX`},description:{id:`TwYboS`},scope:{id:`qyLmWw`},bindings:[{mac:`⌘ G / ⇧⌘ G`,windowsLinux:`Ctrl G / Ctrl Shift G`},{mac:`F3 / Shift F3`,windowsLinux:`F3 / Shift F3`},{mac:`Esc`,windowsLinux:`Esc`}]},{id:`source-folding`,category:`source`,title:{id:`bcjYUA`},description:{id:`VZGh8G`},scope:{id:`tiWX6q`},bindings:[{mac:`⌥⌘ [ / ⌥⌘ ]`,windowsLinux:`Ctrl Shift [ / Ctrl Shift ]`},{mac:`Ctrl Alt [ / Ctrl Alt ]`,windowsLinux:`Ctrl Alt [ / Ctrl Alt ]`}]},{id:`source-completion`,category:`source`,title:{id:`VuxVSP`},description:{id:`Ehkru0`},scope:{id:`tiWX6q`},bindings:[{mac:`Ctrl Space`,windowsLinux:`Ctrl Space`},{mac:"⌥ ` / ⌥ I",windowsLinux:`Ctrl Space`},{mac:`↑ / ↓ / Page Up / Page Down`,windowsLinux:`↑ / ↓ / Page Up / Page Down`},{mac:`Enter / Esc`,windowsLinux:`Enter / Esc`}]},{id:`source-tab-focus-mode`,category:`source`,title:{id:`eG8Jsg`},description:{id:`qRZh7J`},scope:{id:`tiWX6q`},bindings:[{mac:`Shift Alt M`,windowsLinux:`Ctrl M`}]},{id:`source-lint-panel`,category:`source`,title:{id:`yvG-l1`},description:{id:`kCqCyf`},scope:{id:`tiWX6q`},bindings:[{mac:`⇧⌘ M`,windowsLinux:`Ctrl Shift M`}]},{id:`source-next-diagnostic`,category:`source`,title:{id:`M1OfV9`},description:{id:`ExPiRQ`},scope:{id:`tiWX6q`},bindings:[{mac:`F8`,windowsLinux:`F8`}]}],i=r,a=new Map(r.map(e=>[e.id,e]));function o(e){let t=a.get(e);if(!t)throw Error(`Unknown keyboard shortcut: ${e}`);return t}function s(){return e()?`mac`:`windowsLinux`}var c=[[/⌘/g,` Command `],[/⌥/g,` Option `],[/⇧/g,` Shift `],[/⌃/g,` Control `],[/↑/g,` Up Arrow `],[/↓/g,` Down Arrow `],[/←/g,` Left Arrow `],[/→/g,` Right Arrow `],[/\[/g,` Left Bracket `],[/\]/g,` Right Bracket `],[/,/g,` Comma `],[/\bCtrl\b/g,` Control `]];function l(e){return e.split(` / `).map(e=>c.reduce((e,[t,n])=>e.replace(t,n),e).replaceAll(/\s+/g,` `).trim()).join(` or `)}function u(e,t=s()){return t===`mac`?e.mac:e.windowsLinux}function d(e,t=s()){return l(u(e,t))}function f(e,t=s()){return u(o(e).bindings[0],t)}function p(e,t=s()){return d(o(e).bindings[0],t)}function m(e){if(!e||typeof e!=`object`)return!1;if(`isContentEditable`in e&&e.isContentEditable===!0)return!0;if(!(`tagName`in e))return!1;let t=String(e.tagName).toUpperCase();return t===`INPUT`||t===`TEXTAREA`}function h(e,t,n=s()){return o(t).bindings.some(t=>{let r=g(t.match,n);return r?v(e,r,n):!1})}function g(e,t){return e?_(e)?e:e[t]??null:null}function _(e){return`key`in e||`code`in e}function v(e,t,n){if(t.key&&e.key.toLowerCase()!==t.key.toLowerCase()||t.code&&e.code!==t.code)return!1;let r=t.metaKey??(t.mod?n===`mac`:!1),i=t.ctrlKey??(t.mod?n===`windowsLinux`:!1),a=t.altKey??!1,o=t.shiftKey??!1;return t.allowExtraModifiers?!(t.anyMod&&!e.metaKey&&!e.ctrlKey||r&&!e.metaKey||i&&!e.ctrlKey||a&&!e.altKey||o&&!e.shiftKey):(t.anyMod?e.metaKey||e.ctrlKey:e.metaKey===r&&e.ctrlKey===i)&&e.altKey===a&&(t.allowShiftKey||!!e.shiftKey===o)}export{u as a,m as c,f as i,h as l,t as n,p as o,n as r,l as s,i as t};
1
+ import{Ni as e}from"./dist-zc03OoUp.js";var t={general:{id:`Weq9zb`},workspace:{id:`pmUArF`},search:{id:`A1taO8`},wysiwyg:{id:`ur2XSb`},source:{id:`tiWX6q`},navigation:{id:`LXfNU-`}},n=Object.keys(t),r=[{id:`command-palette`,category:`general`,title:{id:`ZjtgI-`},description:{id:`OFBmkg`},scope:{id:`2GT3Hf`},bindings:[{mac:`⌘ K`,windowsLinux:`Ctrl K`,match:{key:`k`,mod:!0}}]},{id:`settings`,category:`general`,title:{id:`Tz0i8g`},description:{id:`6m_7We`},scope:{id:`zL0LPh`},bindings:[{mac:`⌘ ,`,windowsLinux:`Ctrl ,`,match:{key:`,`,anyMod:!0}}]},{id:`new-item`,category:`general`,title:{id:`HdkSiO`},description:{id:`KkEAud`},scope:{id:`zL0LPh`},bindings:[{mac:`⌘ N`,windowsLinux:`Ctrl N`,match:{key:`n`,mod:!0}},{mac:`⌥⌘ N`,windowsLinux:`Ctrl Alt N`,match:{key:`n`,anyMod:!0,altKey:!0,allowExtraModifiers:!0}}]},{id:`new-folder`,category:`general`,title:{id:`96G6Re`},description:{id:`3cOo2C`},scope:{id:`cZI5AL`},bindings:[{mac:`⇧⌘ N`,windowsLinux:`Ctrl Shift N`}]},{id:`toggle-files-sidebar`,category:`general`,title:{id:`rtdR4v`},description:{id:`EbZT7P`},scope:{id:`2GT3Hf`},bindings:[{mac:`⌥⌘ S`,windowsLinux:`Ctrl Alt S`,match:{code:`KeyS`,anyMod:!0,altKey:!0,allowExtraModifiers:!0}}]},{id:`toggle-document-panel`,category:`general`,title:{id:`lkYioO`},description:{id:`It9ARY`},scope:{id:`2GT3Hf`},bindings:[{mac:`⌥⌘ B`,windowsLinux:`Ctrl Alt B`,match:{code:`KeyB`,anyMod:!0,altKey:!0,allowExtraModifiers:!0}}]},{id:`toggle-terminal-panel`,category:`general`,title:{id:`dPOFid`},description:{id:`oCNLN8`},scope:{id:`cZI5AL`},bindings:[{mac:`⌘ J`,windowsLinux:`Ctrl J`,match:{key:`j`,mod:!0}}]},{id:`open-ask-ai`,category:`general`,title:{id:`xWEvuo`},description:{id:`5OTgC7`},scope:{id:`cZI5AL`},bindings:[{mac:`⌘ L`,windowsLinux:`Ctrl L`,match:{key:`l`,mod:!0}}]},{id:`new-terminal-tab`,category:`general`,title:{id:`k0vc0N`},description:{id:`si3L24`},scope:{id:`cZI5AL`},bindings:[{mac:`⇧⌘ J`,windowsLinux:`Ctrl Shift J`,match:{key:`j`,mod:!0,shiftKey:!0}}]},{id:`tab-new`,category:`navigation`,title:{id:`3YvS-c`},description:{id:`t6w1cq`},scope:{id:`2GT3Hf`},bindings:[{mac:`⌘ T`,windowsLinux:`Ctrl T`,match:{key:`t`,mod:!0}}]},{id:`tab-next`,category:`navigation`,title:{id:`l46MqT`},description:{id:`thnPBX`},scope:{id:`2GT3Hf`},bindings:[{mac:`⌃ Tab`,windowsLinux:`Ctrl Tab`,match:{key:`Tab`,ctrlKey:!0}}]},{id:`tab-previous`,category:`navigation`,title:{id:`Mh_4hd`},description:{id:`DJd000`},scope:{id:`2GT3Hf`},bindings:[{mac:`⌃⇧ Tab`,windowsLinux:`Ctrl Shift Tab`,match:{key:`Tab`,ctrlKey:!0,shiftKey:!0}}]},{id:`tab-jump`,category:`navigation`,title:{id:`_6FVBz`},description:{id:`wGSHzy`},scope:{id:`2GT3Hf`},bindings:[{mac:`⌘ 1-8`,windowsLinux:`Ctrl 1-8`}]},{id:`tab-jump-last`,category:`navigation`,title:{id:`N1KkEO`},description:{id:`ZQJ1IV`},scope:{id:`2GT3Hf`},bindings:[{mac:`⌘ 9`,windowsLinux:`Ctrl 9`}]},{id:`tab-reopen-closed`,category:`navigation`,title:{id:`hpzRlK`},description:{id:`E5WeIy`},scope:{id:`2GT3Hf`},bindings:[{mac:`⇧⌘ T`,windowsLinux:`Ctrl Shift T`,match:{key:`t`,mod:!0,shiftKey:!0}}]},{id:`open-folder`,category:`workspace`,title:{id:`PVUn_c`},description:{id:`VYd_YA`},scope:{id:`cZI5AL`},bindings:[{mac:`⌘ O`,windowsLinux:`Ctrl O`}]},{id:`open-file`,category:`workspace`,title:{id:`9npOH9`},description:{id:`H08D2X`},scope:{id:`cZI5AL`},bindings:[{mac:`⇧⌘ O`,windowsLinux:`Ctrl Shift O`}]},{id:`switch-project`,category:`workspace`,title:{id:`xaDWAI`},description:{id:`oS1YpJ`},scope:{id:`cZI5AL`},bindings:[{mac:`⇧⌘ P`,windowsLinux:`Ctrl Shift P`}]},{id:`file-tree-copy`,category:`workspace`,title:{id:`eGUbmF`},description:{id:`7uBlRT`},scope:{id:`vbK_ZG`},bindings:[{mac:`⌘ C`,windowsLinux:`Ctrl C`}]},{id:`file-tree-paste`,category:`workspace`,title:{id:`_tjopj`},description:{id:`e4PbgC`},scope:{id:`vbK_ZG`},bindings:[{mac:`⌘ V`,windowsLinux:`Ctrl V`}]},{id:`file-tree-duplicate`,category:`workspace`,title:{id:`ot5BRK`},description:{id:`mxY24F`},scope:{id:`vbK_ZG`},bindings:[{mac:`⌘ D`,windowsLinux:`Ctrl D`}]},{id:`file-tree-delete`,category:`workspace`,title:{id:`VxO6wR`},description:{id:`osRqlv`},scope:{id:`vbK_ZG`},bindings:[{mac:`⌘ Backspace`,windowsLinux:`Delete`}]},{id:`file-tree-select-all`,category:`workspace`,title:{id:`1d1F11`},description:{id:`4v2Yyz`},scope:{id:`vbK_ZG`},bindings:[{mac:`⌘ A`,windowsLinux:`Ctrl A`}]},{id:`find`,category:`search`,title:{id:`KujtjC`},description:{id:`8OGgNM`},scope:{id:`ur2XSb`},bindings:[{mac:`⌘ F`,windowsLinux:`Ctrl F`,match:{key:`f`,mod:!0,allowShiftKey:!0}}]},{id:`replace`,category:`search`,title:{id:`fqSfXY`},description:{id:`wT4iQr`},scope:{id:`ur2XSb`},bindings:[{mac:`⌥⌘ F`,windowsLinux:`Ctrl H`,match:{mac:{key:`f`,mod:!0,altKey:!0},windowsLinux:{key:`h`,mod:!0}}}]},{id:`find-next`,category:`search`,title:{id:`v7lbnC`},description:{id:`PR9FSv`},scope:{id:`EqtBXb`},bindings:[{mac:`⌘ G`,windowsLinux:`Ctrl G`,match:{key:`g`,mod:!0}},{mac:`F3`,windowsLinux:`F3`,match:{key:`F3`}}]},{id:`find-previous`,category:`search`,title:{id:`PB4upl`},description:{id:`PgzIpb`},scope:{id:`EqtBXb`},bindings:[{mac:`⇧⌘ G`,windowsLinux:`Ctrl Shift G`,match:{key:`g`,mod:!0,shiftKey:!0}},{mac:`Shift F3`,windowsLinux:`Shift F3`,match:{key:`F3`,shiftKey:!0}}]},{id:`find-field-navigation`,category:`search`,title:{id:`yMgL_E`},description:{id:`5ALjdr`},scope:{id:`BgV29F`},bindings:[{mac:`Enter / Shift Enter`,windowsLinux:`Enter / Shift Enter`}]},{id:`replace-current-from-field`,category:`search`,title:{id:`LDuM35`},description:{id:`EZVxVz`},scope:{id:`rZVMkf`},bindings:[{mac:`Enter`,windowsLinux:`Enter`}]},{id:`format-bold`,category:`wysiwyg`,title:{id:`KmydK6`},description:{id:`fbdLmk`},scope:{id:`ur2XSb`},bindings:[{mac:`⌘ B`,windowsLinux:`Ctrl B`}]},{id:`format-italic`,category:`wysiwyg`,title:{id:`pzutoc`},description:{id:`TLIO3j`},scope:{id:`ur2XSb`},bindings:[{mac:`⌘ I`,windowsLinux:`Ctrl I`}]},{id:`format-underline`,category:`wysiwyg`,title:{id:`YyXtnN`},description:{id:`Okd2Xv`},scope:{id:`ur2XSb`},bindings:[{mac:`⌘ U`,windowsLinux:`Ctrl U`}]},{id:`format-strike`,category:`wysiwyg`,title:{id:`WhOsNE`},description:{id:`HCn0Ay`},scope:{id:`ur2XSb`},bindings:[{mac:`⇧⌘ X`,windowsLinux:`Ctrl Shift X`}]},{id:`format-inline-code`,category:`wysiwyg`,title:{id:`OX2Neh`},description:{id:`mo22UP`},scope:{id:`ur2XSb`},bindings:[{mac:`⌘ E`,windowsLinux:`Ctrl E`}]},{id:`format-highlight`,category:`wysiwyg`,title:{id:`gtEbeW`},description:{id:`Eji13z`},scope:{id:`ur2XSb`},bindings:[{mac:`⇧⌘ H`,windowsLinux:`Ctrl Shift H`}]},{id:`add-link`,category:`wysiwyg`,title:{id:`VzGJRl`},description:{id:`u7U_Ij`},scope:{id:`v77jrg`},bindings:[{mac:`⌘ K`,windowsLinux:`Ctrl K`,match:{key:`k`,mod:!0}}]},{id:`edit-with-ai`,category:`general`,title:{id:`G4-bgo`},description:{id:`a3H_MR`},scope:{id:`C62P6b`},bindings:[{mac:`⇧⌘ I`,windowsLinux:`Ctrl Shift I`,match:{key:`i`,mod:!0,shiftKey:!0}}]},{id:`history-undo-redo`,category:`wysiwyg`,title:{id:`i9OyGp`},description:{id:`lbkOif`},scope:{id:`ur2XSb`},bindings:[{mac:`⌘ Z`,windowsLinux:`Ctrl Z`},{mac:`⇧⌘ Z / ⌘ Y`,windowsLinux:`Ctrl Shift Z / Ctrl Y`}]},{id:`heading-paragraph`,category:`wysiwyg`,title:{id:`bkQRMh`},description:{id:`rgPqOw`},scope:{id:`ur2XSb`},bindings:[{mac:`⌥⌘ 0`,windowsLinux:`Ctrl Alt 0`}]},{id:`heading-levels`,category:`wysiwyg`,title:{id:`q_z77Z`},description:{id:`8Jm2EP`},scope:{id:`ur2XSb`},bindings:[{mac:`⌥⌘ 1-6`,windowsLinux:`Ctrl Alt 1-6`}]},{id:`list-bullet`,category:`wysiwyg`,title:{id:`ijLc3m`},description:{id:`By-7Pn`},scope:{id:`ur2XSb`},bindings:[{mac:`⇧⌘ 8`,windowsLinux:`Ctrl Shift 8`}]},{id:`list-ordered`,category:`wysiwyg`,title:{id:`iSQTsg`},description:{id:`ou1hFW`},scope:{id:`ur2XSb`},bindings:[{mac:`⇧⌘ 7`,windowsLinux:`Ctrl Shift 7`}]},{id:`list-task`,category:`wysiwyg`,title:{id:`E1_c72`},description:{id:`-slrNR`},scope:{id:`ur2XSb`},bindings:[{mac:`⇧⌘ 9`,windowsLinux:`Ctrl Shift 9`}]},{id:`code-block`,category:`wysiwyg`,title:{id:`4A3Yzu`},description:{id:`pTPqMK`},scope:{id:`ur2XSb`},bindings:[{mac:`⌥⌘ C`,windowsLinux:`Ctrl Alt C`}]},{id:`hard-break`,category:`wysiwyg`,title:{id:`-3ois8`},description:{id:`vDXqVv`},scope:{id:`ur2XSb`},bindings:[{mac:`Shift Enter`,windowsLinux:`Shift Enter`},{mac:`⌘ Enter`,windowsLinux:`Ctrl Enter`}]},{id:`move-block`,category:`wysiwyg`,title:{id:`f1XQyZ`},description:{id:`zQBg2C`},scope:{id:`ur2XSb`},bindings:[{mac:`⇧⌘ ↑`,windowsLinux:`Ctrl Shift ↑`},{mac:`⇧⌘ ↓`,windowsLinux:`Ctrl Shift ↓`}]},{id:`list-indent`,category:`wysiwyg`,title:{id:`G0YZ-I`},description:{id:`5GKMSz`},scope:{id:`ynIa4S`},bindings:[{mac:`Tab`,windowsLinux:`Tab`},{mac:`Shift Tab`,windowsLinux:`Shift Tab`}]},{id:`list-split-item`,category:`wysiwyg`,title:{id:`neRy3o`},description:{id:`NpC29w`},scope:{id:`ynIa4S`},bindings:[{mac:`Enter`,windowsLinux:`Enter`}]},{id:`table-cell-navigation`,category:`wysiwyg`,title:{id:`K8-WWn`},description:{id:`4NC2Ym`},scope:{id:`l1aQKz`},bindings:[{mac:`Tab`,windowsLinux:`Tab`},{mac:`Shift Tab`,windowsLinux:`Shift Tab`}]},{id:`table-delete-selection`,category:`wysiwyg`,title:{id:`881Uwh`},description:{id:`YEP3X2`},scope:{id:`99eR72`},bindings:[{mac:`Backspace / Delete`,windowsLinux:`Backspace / Delete`},{mac:`⌘ Backspace / ⌘ Delete`,windowsLinux:`Ctrl Backspace / Ctrl Delete`}]},{id:`delete-atom`,category:`wysiwyg`,title:{id:`636K3K`},description:{id:`oXKEsy`},scope:{id:`ur2XSb`},bindings:[{mac:`Backspace`,windowsLinux:`Backspace`},{mac:`Delete`,windowsLinux:`Delete`}]},{id:`slash-menu`,category:`navigation`,title:{id:`shNd9t`},description:{id:`8PmoQF`},scope:{id:`ur2XSb`},bindings:[{mac:`/`,windowsLinux:`/`}]},{id:`suggestion-navigation`,category:`navigation`,title:{id:`riqekz`},description:{id:`OiHJdA`},scope:{id:`y5FUYi`},bindings:[{mac:`↑ / ↓`,windowsLinux:`↑ / ↓`},{mac:`Enter / Tab`,windowsLinux:`Enter / Tab`},{mac:`Esc`,windowsLinux:`Esc`}]},{id:`component-navigation`,category:`navigation`,title:{id:`rwrPbS`},description:{id:`0s8-e8`},scope:{id:`ur2XSb`},bindings:[{mac:`↑ / ↓ / ← / →`,windowsLinux:`↑ / ↓ / ← / →`},{mac:`Enter / Esc`,windowsLinux:`Enter / Esc`}]},{id:`source-indent`,category:`source`,title:{id:`fwhX-N`},description:{id:`skf5Ix`},scope:{id:`tiWX6q`},bindings:[{mac:`Tab`,windowsLinux:`Tab`},{mac:`Shift Tab`,windowsLinux:`Shift Tab`}]},{id:`source-navigation`,category:`source`,title:{id:`qSKu2v`},description:{id:`gITz7o`},scope:{id:`tiWX6q`},bindings:[{mac:`Arrow keys / Option Arrow / Command Arrow`,windowsLinux:`Arrow keys / Ctrl Arrow / Home / End`},{mac:`Page Up / Page Down`,windowsLinux:`Page Up / Page Down`},{mac:`Shift with movement keys`,windowsLinux:`Shift with movement keys`}]},{id:`source-editing`,category:`source`,title:{id:`pFagOn`},description:{id:`MGb89P`},scope:{id:`tiWX6q`},bindings:[{mac:`Enter / Shift Enter / ⌘ Enter`,windowsLinux:`Enter / Shift Enter / Ctrl Enter`},{mac:`Backspace / Delete`,windowsLinux:`Backspace / Delete`},{mac:`⌥ Backspace / ⌥ Delete`,windowsLinux:`Ctrl Backspace / Ctrl Delete`},{mac:`⌥ ↑ / ⌥ ↓`,windowsLinux:`Alt ↑ / Alt ↓`},{mac:`⇧⌥ ↑ / ⇧⌥ ↓`,windowsLinux:`Shift Alt ↑ / Shift Alt ↓`},{mac:`⇧⌘ K`,windowsLinux:`Ctrl Shift K`}]},{id:`source-history`,category:`source`,title:{id:`4Sxexw`},description:{id:`r2huLx`},scope:{id:`tiWX6q`},bindings:[{mac:`⌘ Z`,windowsLinux:`Ctrl Z`},{mac:`⇧⌘ Z`,windowsLinux:`Ctrl Y / Ctrl Shift Z`},{mac:`⌘ U / ⇧⌘ U`,windowsLinux:`Ctrl U / Alt U`}]},{id:`source-select-all`,category:`source`,title:{id:`a-cKXz`},description:{id:`UTNVyS`},scope:{id:`tiWX6q`},bindings:[{mac:`⌘ A`,windowsLinux:`Ctrl A`}]},{id:`source-multi-cursor`,category:`source`,title:{id:`mg0YGL`},description:{id:`lWNpNB`},scope:{id:`tiWX6q`},bindings:[{mac:`⌥⌘ ↑ / ⌥⌘ ↓`,windowsLinux:`Ctrl Alt ↑ / Ctrl Alt ↓`},{mac:`⇧⌘ L`,windowsLinux:`Ctrl Shift L`}]},{id:`source-search`,category:`source`,title:{id:`7OhaRy`},description:{id:`mwMF9u`},scope:{id:`tiWX6q`},bindings:[{mac:`⌘ F`,windowsLinux:`Ctrl F`}]},{id:`source-toggle-comment`,category:`source`,title:{id:`RfaEio`},description:{id:`MrwYIK`},scope:{id:`tiWX6q`},bindings:[{mac:`⌘ /`,windowsLinux:`Ctrl /`},{mac:`Shift Alt A`,windowsLinux:`Shift Alt A`}]},{id:`source-select-next-occurrence`,category:`source`,title:{id:`hY8pka`},description:{id:`XnlF3W`},scope:{id:`tiWX6q`},bindings:[{mac:`⌘ D`,windowsLinux:`Ctrl D`}]},{id:`source-goto-line`,category:`source`,title:{id:`7FamGZ`},description:{id:`yHikCO`},scope:{id:`tiWX6q`},bindings:[{mac:`⌥⌘ G`,windowsLinux:`Ctrl Alt G`}]},{id:`source-find-results`,category:`source`,title:{id:`rJVoVX`},description:{id:`TwYboS`},scope:{id:`qyLmWw`},bindings:[{mac:`⌘ G / ⇧⌘ G`,windowsLinux:`Ctrl G / Ctrl Shift G`},{mac:`F3 / Shift F3`,windowsLinux:`F3 / Shift F3`},{mac:`Esc`,windowsLinux:`Esc`}]},{id:`source-folding`,category:`source`,title:{id:`bcjYUA`},description:{id:`VZGh8G`},scope:{id:`tiWX6q`},bindings:[{mac:`⌥⌘ [ / ⌥⌘ ]`,windowsLinux:`Ctrl Shift [ / Ctrl Shift ]`},{mac:`Ctrl Alt [ / Ctrl Alt ]`,windowsLinux:`Ctrl Alt [ / Ctrl Alt ]`}]},{id:`source-completion`,category:`source`,title:{id:`VuxVSP`},description:{id:`Ehkru0`},scope:{id:`tiWX6q`},bindings:[{mac:`Ctrl Space`,windowsLinux:`Ctrl Space`},{mac:"⌥ ` / ⌥ I",windowsLinux:`Ctrl Space`},{mac:`↑ / ↓ / Page Up / Page Down`,windowsLinux:`↑ / ↓ / Page Up / Page Down`},{mac:`Enter / Esc`,windowsLinux:`Enter / Esc`}]},{id:`source-tab-focus-mode`,category:`source`,title:{id:`eG8Jsg`},description:{id:`qRZh7J`},scope:{id:`tiWX6q`},bindings:[{mac:`Shift Alt M`,windowsLinux:`Ctrl M`}]},{id:`source-lint-panel`,category:`source`,title:{id:`yvG-l1`},description:{id:`kCqCyf`},scope:{id:`tiWX6q`},bindings:[{mac:`⇧⌘ M`,windowsLinux:`Ctrl Shift M`}]},{id:`source-next-diagnostic`,category:`source`,title:{id:`M1OfV9`},description:{id:`ExPiRQ`},scope:{id:`tiWX6q`},bindings:[{mac:`F8`,windowsLinux:`F8`}]}],i=r,a=new Map(r.map(e=>[e.id,e]));function o(e){let t=a.get(e);if(!t)throw Error(`Unknown keyboard shortcut: ${e}`);return t}function s(){return e()?`mac`:`windowsLinux`}var c=[[/⌘/g,` Command `],[/⌥/g,` Option `],[/⇧/g,` Shift `],[/⌃/g,` Control `],[/↑/g,` Up Arrow `],[/↓/g,` Down Arrow `],[/←/g,` Left Arrow `],[/→/g,` Right Arrow `],[/\[/g,` Left Bracket `],[/\]/g,` Right Bracket `],[/,/g,` Comma `],[/\bCtrl\b/g,` Control `]];function l(e){return e.split(` / `).map(e=>c.reduce((e,[t,n])=>e.replace(t,n),e).replaceAll(/\s+/g,` `).trim()).join(` or `)}function u(e,t=s()){return t===`mac`?e.mac:e.windowsLinux}function d(e,t=s()){return l(u(e,t))}function f(e,t=s()){return u(o(e).bindings[0],t)}function p(e,t=s()){return d(o(e).bindings[0],t)}function m(e){if(!e||typeof e!=`object`)return!1;if(`isContentEditable`in e&&e.isContentEditable===!0)return!0;if(!(`tagName`in e))return!1;let t=String(e.tagName).toUpperCase();return t===`INPUT`||t===`TEXTAREA`}function h(e,t,n=s()){return o(t).bindings.some(t=>{let r=g(t.match,n);return r?v(e,r,n):!1})}function g(e,t){return e?_(e)?e:e[t]??null:null}function _(e){return`key`in e||`code`in e}function v(e,t,n){if(t.key&&e.key.toLowerCase()!==t.key.toLowerCase()||t.code&&e.code!==t.code)return!1;let r=t.metaKey??(t.mod?n===`mac`:!1),i=t.ctrlKey??(t.mod?n===`windowsLinux`:!1),a=t.altKey??!1,o=t.shiftKey??!1;return t.allowExtraModifiers?!(t.anyMod&&!e.metaKey&&!e.ctrlKey||r&&!e.metaKey||i&&!e.ctrlKey||a&&!e.altKey||o&&!e.shiftKey):(t.anyMod?e.metaKey||e.ctrlKey:e.metaKey===r&&e.ctrlKey===i)&&e.altKey===a&&(t.allowShiftKey||!!e.shiftKey===o)}export{u as a,m as c,f as i,h as l,t as n,p as o,n as r,l as s,i as t};
@@ -1 +1 @@
1
- import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{t as n}from"./compiler-runtime-dQcBxOhn.js";import{$ as r,Q as i,Z as a}from"./dist-D6R8vG-1.js";var o=n(),s=e(t(),1),c=`open-knowledge:lint-config-changed`;function l(){window.dispatchEvent(new CustomEvent(c))}function u(e){let t=()=>e();return window.addEventListener(c,t),()=>window.removeEventListener(c,t)}async function d(e){try{let t=e===void 0?``:`?doc=${encodeURIComponent(e)}`,n=await fetch(`/api/lint/config${t}`);if(!n.ok)return null;let r=await n.json().catch(()=>null),a=i.safeParse(r);return a.success?a.data:(console.warn(`[lint] lint-config response failed schema validation`,a.error.issues),null)}catch{return null}}async function f(e){return(await d(e))?.effective??null}async function p(e){try{let t=e?`?path=${encodeURIComponent(e)}`:``,n=await fetch(`/api/lint/audit${t}`);if(!n.ok)return null;let r=await n.json().catch(()=>null),i=a.safeParse(r);return i.success?i.data:(console.warn(`[lint] audit response failed schema validation`,i.error.issues),null)}catch{return null}}async function m(e){try{let t=await fetch(`/api/lint/fix`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({docName:e})});if(!t.ok){let e=await t.json().catch(()=>null);return{ok:!1,errorDetail:typeof e?.title==`string`?e.title:null}}let n=await t.json().catch(()=>null),i=r.safeParse(n);return i.success?{ok:!0,result:i.data}:(console.warn(`[lint] fix response failed schema validation`,i.error.issues),{ok:!1,errorDetail:null})}catch{return{ok:!1,errorDetail:null}}}async function h(e,t){try{let n=await fetch(`/api/lint/markdownlint-config`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({ruleId:e,value:t})});if(!n.ok){let e=await n.json().catch(()=>null);return{ok:!1,errorDetail:typeof e?.title==`string`?e.title:null}}let r=await n.json().catch(()=>null),a=i.safeParse(r);return a.success?{ok:!0,response:a.data}:{ok:!1,errorDetail:null}}catch{return{ok:!1,errorDetail:null}}}function g(e){let t=(0,o.c)(5),[n,r]=(0,s.useState)(null),i,a;t[0]===e?(i=t[1],a=t[2]):(i=()=>{if(!e){r(null);return}let t=!1,n=()=>{d(e).then(e=>{t||r(e)})};n();let i=u(n);return()=>{t=!0,i()}},a=[e],t[0]=e,t[1]=i,t[2]=a),(0,s.useEffect)(i,a);let c;return t[3]===n?c=t[4]:(c={data:n},t[3]=n,t[4]=c),c}function _(){let e=(0,o.c)(4),[t,n]=(0,s.useState)(null),r,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=!1,t=()=>{d().then(t=>{e||n(t)})};t();let r=u(t);return()=>{e=!0,r()}},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,s.useEffect)(r,i);let a;return e[2]===t?a=e[3]:(a={data:t},e[2]=t,e[3]=a),a}export{u as a,h as c,p as i,f as n,g as o,m as r,_ as s,l as t};
1
+ import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{t as n}from"./compiler-runtime-dQcBxOhn.js";import{$ as r,Q as i,Z as a}from"./dist-zc03OoUp.js";var o=n(),s=e(t(),1),c=`open-knowledge:lint-config-changed`;function l(){window.dispatchEvent(new CustomEvent(c))}function u(e){let t=()=>e();return window.addEventListener(c,t),()=>window.removeEventListener(c,t)}async function d(e){try{let t=e===void 0?``:`?doc=${encodeURIComponent(e)}`,n=await fetch(`/api/lint/config${t}`);if(!n.ok)return null;let r=await n.json().catch(()=>null),a=i.safeParse(r);return a.success?a.data:(console.warn(`[lint] lint-config response failed schema validation`,a.error.issues),null)}catch{return null}}async function f(e){return(await d(e))?.effective??null}async function p(e){try{let t=e?`?path=${encodeURIComponent(e)}`:``,n=await fetch(`/api/lint/audit${t}`);if(!n.ok)return null;let r=await n.json().catch(()=>null),i=a.safeParse(r);return i.success?i.data:(console.warn(`[lint] audit response failed schema validation`,i.error.issues),null)}catch{return null}}async function m(e){try{let t=await fetch(`/api/lint/fix`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({docName:e})});if(!t.ok){let e=await t.json().catch(()=>null);return{ok:!1,errorDetail:typeof e?.title==`string`?e.title:null}}let n=await t.json().catch(()=>null),i=r.safeParse(n);return i.success?{ok:!0,result:i.data}:(console.warn(`[lint] fix response failed schema validation`,i.error.issues),{ok:!1,errorDetail:null})}catch{return{ok:!1,errorDetail:null}}}async function h(e,t){try{let n=await fetch(`/api/lint/markdownlint-config`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({ruleId:e,value:t})});if(!n.ok){let e=await n.json().catch(()=>null);return{ok:!1,errorDetail:typeof e?.title==`string`?e.title:null}}let r=await n.json().catch(()=>null),a=i.safeParse(r);return a.success?{ok:!0,response:a.data}:{ok:!1,errorDetail:null}}catch{return{ok:!1,errorDetail:null}}}function g(e){let t=(0,o.c)(5),[n,r]=(0,s.useState)(null),i,a;t[0]===e?(i=t[1],a=t[2]):(i=()=>{if(!e){r(null);return}let t=!1,n=()=>{d(e).then(e=>{t||r(e)})};n();let i=u(n);return()=>{t=!0,i()}},a=[e],t[0]=e,t[1]=i,t[2]=a),(0,s.useEffect)(i,a);let c;return t[3]===n?c=t[4]:(c={data:n},t[3]=n,t[4]=c),c}function _(){let e=(0,o.c)(4),[t,n]=(0,s.useState)(null),r,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=!1,t=()=>{d().then(t=>{e||n(t)})};t();let r=u(t);return()=>{e=!0,r()}},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,s.useEffect)(r,i);let a;return e[2]===t?a=e[3]:(a={data:t},e[2]=t,e[3]=a),a}export{u as a,h as c,p as i,f as n,g as o,m as r,_ as s,l as t};
@@ -1 +1 @@
1
- import{$r as e,Ar as t,D as n,Mr as r,Rr as i,Ta as a,fr as o,sr as s,ur as c,wa as l,xr as u}from"./dist-D6R8vG-1.js";import{h as d}from"./doc-hash-sxvnKnL5.js";function f(e){return e.kind===`asset`}function p(e){return e.kind===`document`}function m(e){return e.kind===`folder`}function h(e){let t=[],n=0;for(let r of e)switch(r.kind){case`document`:if(r.docName===void 0){n+=1;break}t.push({kind:`document`,docName:r.docName,docExt:r.docExt,size:r.size,modified:r.modified,isSymlink:r.isSymlink,canonicalDocName:r.canonicalDocName,targetPath:r.targetPath});break;case`asset`:if(r.path===void 0||r.assetExt===void 0){n+=1;break}t.push({kind:`asset`,path:r.path,assetExt:r.assetExt,mediaKind:r.mediaKind??null,size:r.size,modified:r.modified,referencedBy:r.referencedBy});break;case`file`:if(r.path===void 0){n+=1;break}t.push({kind:`asset`,path:r.path,assetExt:r.assetExt??g(r.path),mediaKind:null,size:r.size,modified:r.modified,referencedBy:[]});break;case`folder`:if(r.path===void 0){n+=1;break}t.push({kind:`folder`,path:r.path,size:r.size,modified:r.modified,hasChildren:r.hasChildren,isSymlink:r.isSymlink,targetPath:r.targetPath});break;default:r.kind;break}return n>0&&console.warn(`[file-tree-utils] dropped ${n} listing entries missing variant identity fields`),t}function g(e){let t=e.includes(`/`)?e.split(`/`).pop()??e:e,n=t.lastIndexOf(`.`);return n>0&&n<t.length-1?t.slice(n+1).toLowerCase():t.startsWith(`.`)&&t.length>1?t.slice(1).toLowerCase():`file`}function _(e){if(!e)return[];let t=e.split(`/`).filter(Boolean),n=[];for(let e=1;e<t.length;e++)n.push(t.slice(0,e).join(`/`));return n}function v(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):``}function y(e){return e.split(`/`).some(e=>e.toLowerCase()===`.ok`)}function b(e,t){return t&&e!==`document`&&e!==`folder`}function x(e,t){return!t&&c(e)}function S(e,t={}){let{showHiddenFiles:n=!1,showOnlyMarkdownFiles:r=!1,showOkFolders:i=!1}=t;return e.filter(e=>{let t=e.docName??e.path??``;if(t===``||b(e.kind,r))return!1;let a=t.split(`/`),o=a.indexOf(`.ok`);if(o!==-1){if(!i)return!1;let e=a.slice(0,o).join(`/`);return n||e===``||!c(e)}return!x(t,n)})}function C(e,t={}){let{showHiddenFiles:n=!1,showOnlyMarkdownFiles:r=!1}=t,i=e.docName??e.path??``;return i===``||o(i)||y(i)?{hiddenFiles:!1,onlyMarkdownFiles:!1}:{hiddenFiles:x(i,n),onlyMarkdownFiles:b(e.kind,r)}}function w(e){let{visibility:t={},unfilteredRootEntryCount:n,knownPageCount:r}=e;return(n>0||r>0)&&(t.showOnlyMarkdownFiles??!1)?`filtered-to-zero`:`true-empty`}var T=null,E=new Set;function D(e,t){if(e===t)return!0;if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function O(e,t){return e===null?!1:e===t?!0:D(e.pages,t.pages)&&D(e.folderPaths,t.folderPaths)&&D(e.assetPaths??new Set,t.assetPaths??new Set)&&D(e.filePaths??new Set,t.filePaths??new Set)&&k(e.pageIcons,t.pageIcons)}function k(e,t){if(e===t)return!0;let n=e?.size??0;if(n!==(t?.size??0))return!1;if(n===0)return!0;for(let[n,r]of e)if(t.get(n)!==r)return!1;return!0}function A(e,t){let n=new Map;for(let r of e){let e=t(r);e&&!n.has(e)&&n.set(e,r)}return n}function j(e,t){let n=new Map,r=[...e].sort((e,t)=>e.localeCompare(t));for(let e of r){let r=e.lastIndexOf(`/`),i=t(r===-1?e:e.slice(r+1));i&&!n.has(i)&&n.set(i,e)}return n}function M(e){let t=new Map;for(let[n,r]of e){let e=r.icon;typeof e==`string`&&e.trim()!==``&&t.set(n,e)}return t}function N(){return T}function P(e){if(!O(T,e)){T=e;for(let t of Array.from(E))try{t(e)}catch(e){console.error(`[page-list-cache] subscriber threw:`,e)}}}function F(e){if(E.add(e),T!==null)try{e(T)}catch(e){console.error(`[page-list-cache] subscriber threw on replay:`,e)}return()=>{E.delete(e)}}function I(e){let t=e.trim();return{normalizedTarget:t.replace(/^\.\/+/,``).replace(/^\/+/,``).replace(/\/+$/g,``),expectsFolder:/\/+$/.test(t)}}function L(e){return d(e).replace(/\/+$/g,``)}function R(e){let t=new Set;for(let n of e)for(let e of _(n))t.add(e);return t}function z(t,n){if(!n)return;let r=e(t);if(r)return n.get(r)}function B(t,n){if(!n||t.includes(`/`))return;let r=e(t);if(r)return n.get(r)}function V(e,t){return t?`${e}${t}`:(e.split(`/`).pop()??``).lastIndexOf(`.`)>0?e:`${e}.md`}function H(e,t){if(!y(e))return null;let n=u(e);if(n)return{kind:`doc`,target:n,docName:n};if(t.pages.has(e))return null;let r=V(e,t.docExt);return{kind:`asset`,target:r,assetPath:r,mediaKind:a(r.slice(r.lastIndexOf(`.`)+1))}}function U(e,n){if(o(e)){let n=t(e);if(n?.kind===`reference`){let e=`references/${n.rel}.md`;return{kind:`skill-file`,target:`global/${n.name}/${e}`,scope:`global`,name:n.name,path:e}}let a=r(e);if(a?.kind===`skill`&&a.scope===`project`){let e=i(a.name);return{kind:`doc`,target:e,docName:e}}return{kind:`doc`,target:e,docName:e}}let a=u(e);if(a)return{kind:`doc`,target:a,docName:a};let{normalizedTarget:s,expectsFolder:c}=I(e);if(!s)return{kind:`missing`,target:s};if(!c&&l(s))return{kind:`doc`,target:s,docName:s};let d=L(e);if(!c&&n.pages.has(s))return{kind:`doc`,target:s,docName:s};if(!c&&d!==s&&n.pages.has(d))return{kind:`doc`,target:d,docName:d};if(!c){let e=z(d,n.pagesBySlug);if(e)return{kind:`doc`,target:e,docName:e}}let f=`${d}/index`;if(n.pages.has(f))return{kind:`folder-index`,target:d,folderPath:d,docName:f,noteKind:`canonical-index`};let p=d.split(`/`).pop(),m=p?`${d}/${p}`:null;if(m&&n.pages.has(m))return{kind:`folder-index`,target:d,folderPath:d,docName:m,noteKind:`legacy-folder-note`};if(!c){let e=B(d,n.pagesByBasename);if(e)return{kind:`doc`,target:e,docName:e}}return(n.folderPaths??R(n.pages)).has(d)?{kind:`folder`,target:d,folderPath:d}:H(s,n)??{kind:`missing`,target:d||s}}function W(e){return e.kind===`folder-index`?{kind:`folder`,target:e.folderPath,folderPath:e.folderPath}:e}function G(e,t,r=n){return typeof t!=`number`||!s(t,r)?null:{kind:`large-file`,target:e,docName:e,size:t,limit:r}}function K(e,t,r=n){return e.kind!==`doc`&&e.kind!==`folder-index`?e:G(e.docName,t.get(e.docName)?.size,r)??e}function q(e){switch(e.kind){case`doc`:case`folder-index`:case`large-file`:return e.docName;case`missing`:return e.target;case`asset`:case`skill-file`:case`folder`:return null}}export{h as C,g as S,S as _,H as a,p as b,M as c,N as d,P as f,v as g,w as h,G as i,j as l,C as m,q as n,U as o,F as p,W as r,K as s,R as t,A as u,y as v,m as x,f as y};
1
+ import{$r as e,Ar as t,D as n,Mr as r,Rr as i,Ta as a,fr as o,sr as s,ur as c,wa as l,xr as u}from"./dist-zc03OoUp.js";import{h as d}from"./doc-hash-D8EI7kHA.js";function f(e){return e.kind===`asset`}function p(e){return e.kind===`document`}function m(e){return e.kind===`folder`}function h(e){let t=[],n=0;for(let r of e)switch(r.kind){case`document`:if(r.docName===void 0){n+=1;break}t.push({kind:`document`,docName:r.docName,docExt:r.docExt,size:r.size,modified:r.modified,isSymlink:r.isSymlink,canonicalDocName:r.canonicalDocName,targetPath:r.targetPath});break;case`asset`:if(r.path===void 0||r.assetExt===void 0){n+=1;break}t.push({kind:`asset`,path:r.path,assetExt:r.assetExt,mediaKind:r.mediaKind??null,size:r.size,modified:r.modified,referencedBy:r.referencedBy});break;case`file`:if(r.path===void 0){n+=1;break}t.push({kind:`asset`,path:r.path,assetExt:r.assetExt??g(r.path),mediaKind:null,size:r.size,modified:r.modified,referencedBy:[]});break;case`folder`:if(r.path===void 0){n+=1;break}t.push({kind:`folder`,path:r.path,size:r.size,modified:r.modified,hasChildren:r.hasChildren,isSymlink:r.isSymlink,targetPath:r.targetPath});break;default:r.kind;break}return n>0&&console.warn(`[file-tree-utils] dropped ${n} listing entries missing variant identity fields`),t}function g(e){let t=e.includes(`/`)?e.split(`/`).pop()??e:e,n=t.lastIndexOf(`.`);return n>0&&n<t.length-1?t.slice(n+1).toLowerCase():t.startsWith(`.`)&&t.length>1?t.slice(1).toLowerCase():`file`}function _(e){if(!e)return[];let t=e.split(`/`).filter(Boolean),n=[];for(let e=1;e<t.length;e++)n.push(t.slice(0,e).join(`/`));return n}function v(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):``}function y(e){return e.split(`/`).some(e=>e.toLowerCase()===`.ok`)}function b(e,t){return t&&e!==`document`&&e!==`folder`}function x(e,t){return!t&&c(e)}function S(e,t={}){let{showHiddenFiles:n=!1,showOnlyMarkdownFiles:r=!1,showOkFolders:i=!1}=t;return e.filter(e=>{let t=e.docName??e.path??``;if(t===``||b(e.kind,r))return!1;let a=t.split(`/`),o=a.indexOf(`.ok`);if(o!==-1){if(!i)return!1;let e=a.slice(0,o).join(`/`);return n||e===``||!c(e)}return!x(t,n)})}function C(e,t={}){let{showHiddenFiles:n=!1,showOnlyMarkdownFiles:r=!1}=t,i=e.docName??e.path??``;return i===``||o(i)||y(i)?{hiddenFiles:!1,onlyMarkdownFiles:!1}:{hiddenFiles:x(i,n),onlyMarkdownFiles:b(e.kind,r)}}function w(e){let{visibility:t={},unfilteredRootEntryCount:n,knownPageCount:r}=e;return(n>0||r>0)&&(t.showOnlyMarkdownFiles??!1)?`filtered-to-zero`:`true-empty`}var T=null,E=new Set;function D(e,t){if(e===t)return!0;if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function O(e,t){return e===null?!1:e===t?!0:D(e.pages,t.pages)&&D(e.folderPaths,t.folderPaths)&&D(e.assetPaths??new Set,t.assetPaths??new Set)&&D(e.filePaths??new Set,t.filePaths??new Set)&&k(e.pageIcons,t.pageIcons)}function k(e,t){if(e===t)return!0;let n=e?.size??0;if(n!==(t?.size??0))return!1;if(n===0)return!0;for(let[n,r]of e)if(t.get(n)!==r)return!1;return!0}function A(e,t){let n=new Map;for(let r of e){let e=t(r);e&&!n.has(e)&&n.set(e,r)}return n}function j(e,t){let n=new Map,r=[...e].sort((e,t)=>e.localeCompare(t));for(let e of r){let r=e.lastIndexOf(`/`),i=t(r===-1?e:e.slice(r+1));i&&!n.has(i)&&n.set(i,e)}return n}function M(e){let t=new Map;for(let[n,r]of e){let e=r.icon;typeof e==`string`&&e.trim()!==``&&t.set(n,e)}return t}function N(){return T}function P(e){if(!O(T,e)){T=e;for(let t of Array.from(E))try{t(e)}catch(e){console.error(`[page-list-cache] subscriber threw:`,e)}}}function F(e){if(E.add(e),T!==null)try{e(T)}catch(e){console.error(`[page-list-cache] subscriber threw on replay:`,e)}return()=>{E.delete(e)}}function I(e){let t=e.trim();return{normalizedTarget:t.replace(/^\.\/+/,``).replace(/^\/+/,``).replace(/\/+$/g,``),expectsFolder:/\/+$/.test(t)}}function L(e){return d(e).replace(/\/+$/g,``)}function R(e){let t=new Set;for(let n of e)for(let e of _(n))t.add(e);return t}function z(t,n){if(!n)return;let r=e(t);if(r)return n.get(r)}function B(t,n){if(!n||t.includes(`/`))return;let r=e(t);if(r)return n.get(r)}function V(e,t){return t?`${e}${t}`:(e.split(`/`).pop()??``).lastIndexOf(`.`)>0?e:`${e}.md`}function H(e,t){if(!y(e))return null;let n=u(e);if(n)return{kind:`doc`,target:n,docName:n};if(t.pages.has(e))return null;let r=V(e,t.docExt);return{kind:`asset`,target:r,assetPath:r,mediaKind:a(r.slice(r.lastIndexOf(`.`)+1))}}function U(e,n){if(o(e)){let n=t(e);if(n?.kind===`reference`){let e=`references/${n.rel}.md`;return{kind:`skill-file`,target:`global/${n.name}/${e}`,scope:`global`,name:n.name,path:e}}let a=r(e);if(a?.kind===`skill`&&a.scope===`project`){let e=i(a.name);return{kind:`doc`,target:e,docName:e}}return{kind:`doc`,target:e,docName:e}}let a=u(e);if(a)return{kind:`doc`,target:a,docName:a};let{normalizedTarget:s,expectsFolder:c}=I(e);if(!s)return{kind:`missing`,target:s};if(!c&&l(s))return{kind:`doc`,target:s,docName:s};let d=L(e);if(!c&&n.pages.has(s))return{kind:`doc`,target:s,docName:s};if(!c&&d!==s&&n.pages.has(d))return{kind:`doc`,target:d,docName:d};if(!c){let e=z(d,n.pagesBySlug);if(e)return{kind:`doc`,target:e,docName:e}}let f=`${d}/index`;if(n.pages.has(f))return{kind:`folder-index`,target:d,folderPath:d,docName:f,noteKind:`canonical-index`};let p=d.split(`/`).pop(),m=p?`${d}/${p}`:null;if(m&&n.pages.has(m))return{kind:`folder-index`,target:d,folderPath:d,docName:m,noteKind:`legacy-folder-note`};if(!c){let e=B(d,n.pagesByBasename);if(e)return{kind:`doc`,target:e,docName:e}}return(n.folderPaths??R(n.pages)).has(d)?{kind:`folder`,target:d,folderPath:d}:H(s,n)??{kind:`missing`,target:d||s}}function W(e){return e.kind===`folder-index`?{kind:`folder`,target:e.folderPath,folderPath:e.folderPath}:e}function G(e,t,r=n){return typeof t!=`number`||!s(t,r)?null:{kind:`large-file`,target:e,docName:e,size:t,limit:r}}function K(e,t,r=n){return e.kind!==`doc`&&e.kind!==`folder-index`?e:G(e.docName,t.get(e.docName)?.size,r)??e}function q(e){switch(e.kind){case`doc`:case`folder-index`:case`large-file`:return e.docName;case`missing`:return e.target;case`asset`:case`skill-file`:case`folder`:return null}}export{h as C,g as S,S as _,H as a,p as b,M as c,N as d,P as f,v as g,w as h,G as i,j as l,C as m,q as n,U as o,F as p,W as r,K as s,R as t,A as u,y as v,m as x,f as y};
@@ -1 +1 @@
1
- import{t as e}from"./createLucideIcon-B5DNg1uu.js";import{t}from"./parse-api-error-QYXuYti5.js";import{i as n}from"./documents-events-Bd2Tt95I.js";import{l as r,s as i}from"./doc-hash-sxvnKnL5.js";var a=e(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]);async function o(e){return t(await e.json().catch(()=>null))??`HTTP ${e.status}`}async function s(e,t){try{let n=await fetch(`/api/folder-config`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e,frontmatter:t})});return n.ok?{ok:!0}:{ok:!1,error:await o(n)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function c(e){try{let t=await fetch(`/api/template`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await o(t)};let r=await t.json().catch(()=>null);return n(),{ok:!0,created:r?.created??!1,warnings:r?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function l(e,t){try{let r=`?folder=${encodeURIComponent(e)}&name=${encodeURIComponent(t)}`,i=await fetch(`/api/template${r}`,{method:`DELETE`});if(!i.ok)return{ok:!1,error:await o(i)};let a=await i.json().catch(()=>null);return n(),{ok:!0,existed:a?.existed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function u(e){try{let t=await fetch(`/api/template`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await o(t)};let r=await t.json().catch(()=>null);return n(),{ok:!0,committed:r?.committed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function d(e){try{let t=await fetch(`/api/template/import`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await o(t)};let r=await t.json().catch(()=>null);return n(),{ok:!0,path:r?.path??``,created:r?.created??!1,warnings:r?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}function f(e){if(typeof window>`u`)return;let t=i(e);window.location.hash!==t&&(window.location.hash=t)}function p(e){if(typeof window>`u`)return;let t=r(e);window.location.hash!==t&&(window.location.hash=t)}export{u as a,a as c,d as i,p as n,s as o,l as r,c as s,f as t};
1
+ import{t as e}from"./createLucideIcon-B5DNg1uu.js";import{t}from"./parse-api-error-QYXuYti5.js";import{i as n}from"./documents-events-BTDcCELc.js";import{l as r,s as i}from"./doc-hash-D8EI7kHA.js";var a=e(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]);async function o(e){return t(await e.json().catch(()=>null))??`HTTP ${e.status}`}async function s(e,t){try{let n=await fetch(`/api/folder-config`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e,frontmatter:t})});return n.ok?{ok:!0}:{ok:!1,error:await o(n)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function c(e){try{let t=await fetch(`/api/template`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await o(t)};let r=await t.json().catch(()=>null);return n(),{ok:!0,created:r?.created??!1,warnings:r?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function l(e,t){try{let r=`?folder=${encodeURIComponent(e)}&name=${encodeURIComponent(t)}`,i=await fetch(`/api/template${r}`,{method:`DELETE`});if(!i.ok)return{ok:!1,error:await o(i)};let a=await i.json().catch(()=>null);return n(),{ok:!0,existed:a?.existed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function u(e){try{let t=await fetch(`/api/template`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await o(t)};let r=await t.json().catch(()=>null);return n(),{ok:!0,committed:r?.committed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function d(e){try{let t=await fetch(`/api/template/import`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await o(t)};let r=await t.json().catch(()=>null);return n(),{ok:!0,path:r?.path??``,created:r?.created??!1,warnings:r?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}function f(e){if(typeof window>`u`)return;let t=i(e);window.location.hash!==t&&(window.location.hash=t)}function p(e){if(typeof window>`u`)return;let t=r(e);window.location.hash!==t&&(window.location.hash=t)}export{u as a,a as c,d as i,p as n,s as o,l as r,c as s,f as t};
@@ -1 +1 @@
1
- import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./jsx-runtime-DyiINK0N.js";import{t as n}from"./react-JNybMug3.js";import{n as r,r as i}from"./dist-DBENJeML.js";import{t as a}from"./compiler-runtime-dQcBxOhn.js";import{n as o,t as s}from"./createLucideIcon-B5DNg1uu.js";import{a as c,c as l,n as u,r as d,t as f}from"./EnableSyncConfirmDialog-Bo_sKBNs.js";import{t as p}from"./arrow-up-right-DUrnAxeE.js";import{t as m}from"./check-CnRZzbNh.js";import{t as h}from"./folder-open-CIPS7Z9_.js";import{t as g}from"./info-jz24-qK8.js";import{t as _}from"./loader-circle-DZ77ilW4.js";import{n as v}from"./miss-dialog-store-Mtb10VyW.js";import{t as y}from"./refresh-cw-GU9JlNjj.js";import{t as b}from"./triangle-alert-COtjZrcH.js";import{h as x,r as S,u as C}from"./doc-hash-sxvnKnL5.js";import{t as w}from"./external-link-CbUrsN1c.js";var T=s(`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`}]]),E=s(`file-pen`,[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]]),D=s(`file-question-mark`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]]),O=s(`file-x-corner`,[[`path`,{d:`M11 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5`,key:`1jo35a`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m15 17 5 5`,key:`36xl1x`}],[`path`,{d:`m20 17-5 5`,key:`vdz27y`}]]),k=a(),A=e(n(),1),j=t(),M=`https://git-scm.com/docs/git-push`;function N(e,t){return!(e!==`stale`&&e!==`absent`||e===`stale`&&t?.syncEnabled===!0)}function P(e){return e?e.state!==`dormant`&&e.state!==`disabled`&&e.state!==`auth-error`&&e.state!==`conflict`:!1}function F(e){let t=(0,k.c)(47),{freshness:n,status:a,kind:s}=e,{_:l}=i(),{confirmOpen:h,setConfirmOpen:_,onToggleRequest:v,onConfirm:x}=d(c()),[S,C]=(0,A.useState)(`idle`),w=(0,A.useRef)(null),T,E;if(t[0]!==a||t[1]!==S?(T=()=>{if(!(S!==`pending`||!a)){if(a.pushError||a.pushErrorCode){C(`idle`);return}(a.lastSyncUtc??null)!==w.current&&C(`synced`)}},E=[S,a],t[0]=a,t[1]=S,t[2]=T,t[3]=E):(T=t[2],E=t[3]),(0,A.useEffect)(T,E),!N(n,a))return null;if(S===`synced`){let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,j.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-dashed border-border bg-muted/40 p-2 text-xs text-muted-foreground`,"data-testid":`share-freshness-row`,children:[(0,j.jsx)(m,{className:`mt-0.5 size-3.5 shrink-0`,"aria-hidden":`true`}),(0,j.jsx)(`span`,{children:(0,j.jsx)(r,{id:`fxbCNQ`})})]}),t[4]=e):e=t[4],e}let D=a?.syncEnabled===!0,O=a?.pushPermission?.checkStatus===`denied`,F=!!(a?.pushError||a?.pushErrorCode),R=O||F,z=n===`absent`&&!D,B;if(n===`absent`&&!D){let e;t[5]!==l||t[6]!==s?(e=l(s===`folder`?{id:`PrJYSN`}:{id:`3BnyYc`}),t[5]=l,t[6]=s,t[7]=e):e=t[7],B=e}else if(n===`stale`){let e;t[8]!==l||t[9]!==s?(e=l(s===`folder`?{id:`Gt4gOO`}:{id:`2IYGkU`}),t[8]=l,t[9]=s,t[10]=e):e=t[10],B=e}else{let e;t[11]!==l||t[12]!==s?(e=l(s===`folder`?{id:`nqV0Kk`}:{id:`gwykHF`}),t[11]=l,t[12]=s,t[13]=e):e=t[13],B=e}let V;t[14]!==l||t[15]!==F||t[16]!==O?(V=O?l({id:`9OIqw4`}):F?l({id:`K6MQQk`}):null,t[14]=l,t[15]=F,t[16]=O,t[17]=V):V=t[17];let H=V,U;t[18]===a?.lastSyncUtc?U=t[19]:(U=()=>{w.current=a?.lastSyncUtc??null,C(`pending`),u(`sync`).catch(e=>{console.warn(`[share-freshness] sync trigger failed`,e instanceof Error?e.message:e),C(`idle`)})},t[18]=a?.lastSyncUtc,t[19]=U);let W=U,G=z?b:g,K;t[20]===G?K=t[21]:(K=(0,j.jsx)(G,{className:`mt-0.5 size-3.5 shrink-0`,"aria-hidden":`true`}),t[20]=G,t[21]=K);let q;t[22]===B?q=t[23]:(q=(0,j.jsx)(`span`,{children:B}),t[22]=B,t[23]=q);let J;t[24]===H?J=t[25]:(J=H?(0,j.jsx)(`span`,{children:H}):null,t[24]=H,t[25]=J);let Y;t[26]!==R||t[27]!==W||t[28]!==v||t[29]!==a||t[30]!==D||t[31]!==S?(Y=R?null:D?P(a)?(0,j.jsx)(`div`,{children:S===`pending`?(0,j.jsxs)(o,{variant:`outline`,size:`xs`,disabled:!0,children:[(0,j.jsx)(y,{className:`size-3 shrink-0 animate-spin`,"aria-hidden":`true`}),(0,j.jsx)(r,{id:`EHu0x2`})]}):(0,j.jsx)(o,{variant:`outline`,size:`xs`,onClick:W,children:(0,j.jsx)(r,{id:`lb_UU4`})})}):null:(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1.5`,children:[(0,j.jsx)(o,{variant:`outline`,size:`xs`,onClick:()=>v(!0),children:(0,j.jsx)(r,{id:`XU0OXn`})}),(0,j.jsxs)(`a`,{href:M,target:`_blank`,rel:`noopener noreferrer`,onClick:L,onAuxClick:I,className:`inline-flex items-center gap-1 transition-colors hover:text-primary`,children:[(0,j.jsx)(r,{id:`GLxIKR`}),(0,j.jsx)(p,{className:`size-3 shrink-0`,"aria-hidden":`true`})]})]}),t[26]=R,t[27]=W,t[28]=v,t[29]=a,t[30]=D,t[31]=S,t[32]=Y):Y=t[32];let X;t[33]!==q||t[34]!==J||t[35]!==Y?(X=(0,j.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[q,J,Y]}),t[33]=q,t[34]=J,t[35]=Y,t[36]=X):X=t[36];let Z;t[37]!==K||t[38]!==X?(Z=(0,j.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-dashed border-border bg-muted/40 p-2 text-xs text-muted-foreground`,"data-testid":`share-freshness-row`,children:[K,X]}),t[37]=K,t[38]=X,t[39]=Z):Z=t[39];let Q;t[40]!==h||t[41]!==x||t[42]!==_?(Q=(0,j.jsx)(f,{open:h,onOpenChange:_,onConfirm:x}),t[40]=h,t[41]=x,t[42]=_,t[43]=Q):Q=t[43];let $;return t[44]!==Z||t[45]!==Q?($=(0,j.jsxs)(j.Fragment,{children:[Z,Q]}),t[44]=Z,t[45]=Q,t[46]=$):$=t[46],$}function I(e){return w(e,M)}function L(e){return w(e,M)}function R(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function z(e){let t=(0,k.c)(13),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={phase:`pending`},t[0]=n):n=t[0];let[r,i]=(0,A.useState)(n),[a,o]=(0,A.useState)(0),s=e.branch,c;t[1]!==s||t[2]!==e.kind||t[3]!==e.path?(c=()=>{let t=window.okDesktop??null;if(!t||s===null){i({phase:`resolved`,resolution:{verdict:`unknown`}});return}let n=!1;return t.project.fetchTargetStatus({projectPath:t.config.projectPath,branch:s,path:e.path,kind:e.kind}).then(e=>{n||i({phase:`resolved`,resolution:e??{verdict:`unknown`}})}).catch(e=>{n||(console.warn(`[receive] miss target-status fetch failed`,e instanceof Error?e.message:e),i({phase:`resolved`,resolution:{verdict:`unknown`}}))}),()=>{n=!0}},t[1]=s,t[2]=e.kind,t[3]=e.path,t[4]=c):c=t[4];let l;t[5]!==s||t[6]!==a||t[7]!==e.kind||t[8]!==e.path?(l=[s,e.kind,e.path,a],t[5]=s,t[6]=a,t[7]=e.kind,t[8]=e.path,t[9]=l):l=t[9],(0,A.useEffect)(c,l);let u;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>{i({phase:`pending`}),o(B)},t[10]=u):u=t[10];let d;return t[11]===r?d=t[12]:(d={state:r,refetch:u},t[11]=r,t[12]=d),d}function B(e){return e+1}function V(e){let t=(0,k.c)(15),{onEnabled:n}=e,i=c(),a;t[0]===n?a=t[1]:(a={onEnabled:n},t[0]=n,t[1]=a);let{confirmOpen:s,setConfirmOpen:l,onToggleRequest:u,onConfirm:p}=d(i,a),m;t[2]===u?m=t[3]:(m=()=>u(!0),t[2]=u,t[3]=m);let h,g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,j.jsx)(y,{className:`size-4`,"aria-hidden":`true`}),g=(0,j.jsx)(r,{id:`XU0OXn`}),t[4]=h,t[5]=g):(h=t[4],g=t[5]);let _;t[6]===m?_=t[7]:(_=(0,j.jsxs)(o,{onClick:m,"data-testid":`share-receive-miss-enable-sync`,children:[h,g]}),t[6]=m,t[7]=_);let v;t[8]!==s||t[9]!==p||t[10]!==l?(v=(0,j.jsx)(f,{open:s,onOpenChange:l,onConfirm:p}),t[8]=s,t[9]=p,t[10]=l,t[11]=v):v=t[11];let b;return t[12]!==_||t[13]!==v?(b=(0,j.jsxs)(j.Fragment,{children:[_,v]}),t[12]=_,t[13]=v,t[14]=b):b=t[14],b}function H(e){let t=(0,k.c)(15),{status:n,onSyncCompleted:i}=e,[a,s]=(0,A.useState)(!1),c=(0,A.useRef)(null),l;t[0]!==i||t[1]!==a||t[2]!==n.lastSyncUtc||t[3]!==n.pushError||t[4]!==n.pushErrorCode?(l=()=>{if(a){if(n.pushError||n.pushErrorCode){s(!1);return}(n.lastSyncUtc??null)!==c.current&&(s(!1),i?.())}},t[0]=i,t[1]=a,t[2]=n.lastSyncUtc,t[3]=n.pushError,t[4]=n.pushErrorCode,t[5]=l):l=t[5];let d;t[6]!==i||t[7]!==a||t[8]!==n?(d=[a,n,i],t[6]=i,t[7]=a,t[8]=n,t[9]=d):d=t[9],(0,A.useEffect)(l,d);let f;t[10]===n.lastSyncUtc?f=t[11]:(f=()=>{c.current=n.lastSyncUtc??null,s(!0),u(`sync`).catch(e=>{console.warn(`[receive] miss sync trigger failed`,e instanceof Error?e.message:e),s(!1)})},t[10]=n.lastSyncUtc,t[11]=f);let p=f,m;return t[12]!==p||t[13]!==a?(m=a?(0,j.jsxs)(o,{disabled:!0,"data-testid":`share-receive-miss-sync-now`,children:[(0,j.jsx)(y,{className:`size-4 animate-spin`,"aria-hidden":`true`}),(0,j.jsx)(r,{id:`EHu0x2`})]}):(0,j.jsxs)(o,{onClick:p,"data-testid":`share-receive-miss-sync-now`,children:[(0,j.jsx)(y,{className:`size-4`,"aria-hidden":`true`}),(0,j.jsx)(r,{id:`lb_UU4`})]}),t[12]=p,t[13]=a,t[14]=m):m=t[14],m}function U(e){let t=(0,k.c)(67),{nav:n,state:a,onBrowseFolder:s,onOpenRenamed:c,onEnableAutoSync:u,onSyncCompleted:d}=e,{_:f}=i(),p=l(),m=n.branch,g;t[0]!==f||t[1]!==n.kind?(g=n.kind===`folder`?f({id:`ugoTXs`}):f({id:`XH30C4`}),t[0]=f,t[1]=n.kind,t[2]=g):g=t[2];let y=g;if(a.phase===`pending`){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(_,{className:`size-5 animate-spin`,"aria-hidden":`true`}),(0,j.jsx)(r,{id:`c8jBgX`})]}),t[3]=e):e=t[3],e}let{resolution:b}=a,x,S;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,j.jsx)(h,{className:`size-4`,"aria-hidden":`true`}),S=(0,j.jsx)(r,{id:`hItdtk`}),t[4]=x,t[5]=S):(x=t[4],S=t[5]);let C;t[6]===s?C=t[7]:(C=(0,j.jsxs)(o,{variant:`outline`,onClick:s,"data-testid":`share-receive-miss-browse`,children:[x,S]}),t[6]=s,t[7]=C);let w=C,A,M,N;if(b.verdict===`renamed`){let e;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,j.jsx)(v,{className:`size-9`,"aria-hidden":`true`}),t[8]=e):e=t[8],A=e;let n;t[9]!==b.renamedTo||t[10]!==y?(n={0:b.renamedTo,targetNoun:y},t[9]=b.renamedTo,t[10]=y,t[11]=n):n=t[11];let i;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(i={0:(0,j.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})},t[12]=i):i=t[12];let a;t[13]===n?a=t[14]:(a=(0,j.jsx)(r,{id:`P0HC30`,values:n,components:i}),t[13]=n,t[14]=a),M=a;let s;t[15]!==c||t[16]!==b.renamedTo?(s=()=>c(b.renamedTo),t[15]=c,t[16]=b.renamedTo,t[17]=s):s=t[17];let l,u;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,j.jsx)(v,{className:`size-4`,"aria-hidden":`true`}),u=(0,j.jsx)(r,{id:`AItsE5`}),t[18]=l,t[19]=u):(l=t[18],u=t[19]);let d;t[20]===s?d=t[21]:(d=(0,j.jsxs)(o,{onClick:s,"data-testid":`share-receive-miss-open-renamed`,children:[l,u]}),t[20]=s,t[21]=d);let f;t[22]!==w||t[23]!==d?(f=(0,j.jsxs)(j.Fragment,{children:[d,w]}),t[22]=w,t[23]=d,t[24]=f):f=t[24],N=f}else if(b.verdict===`deleted`){let e;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,j.jsx)(O,{className:`size-9`,"aria-hidden":`true`}),t[25]=e):e=t[25],A=e;let n;t[26]!==m||t[27]!==y?(n={targetNoun:y,branch:m},t[26]=m,t[27]=y,t[28]=n):n=t[28];let i;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(i={0:(0,j.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})},t[29]=i):i=t[29];let a;t[30]===n?a=t[31]:(a=(0,j.jsx)(r,{id:`kpqWwG`,values:n,components:i}),t[30]=n,t[31]=a),M=a,N=w}else if(b.verdict===`never-on-branch`){let e;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,j.jsx)(D,{className:`size-9`,"aria-hidden":`true`}),t[32]=e):e=t[32],A=e;let n;t[33]!==m||t[34]!==y?(n={targetNoun:y,branch:m},t[33]=m,t[34]=y,t[35]=n):n=t[35];let i;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(i={0:(0,j.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})},t[36]=i):i=t[36];let a;t[37]===n?a=t[38]:(a=(0,j.jsx)(r,{id:`i9TPUi`,values:n,components:i}),t[37]=n,t[38]=a),M=a,N=w}else if(b.verdict===`changed-locally`){let e;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,j.jsx)(E,{className:`size-9`,"aria-hidden":`true`}),t[39]=e):e=t[39],A=e;let n=p?.syncEnabled===!0,i=p?.pushPermission?.checkStatus===`denied`||!!(p?.pushError||p?.pushErrorCode);if(n){let e;t[40]!==m||t[41]!==y?(e=m===null?(0,j.jsx)(r,{id:`RyIKxy`,values:{targetNoun:y}}):(0,j.jsx)(r,{id:`l6kpzR`,values:{targetNoun:y,branch:m},components:{0:(0,j.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}}),t[40]=m,t[41]=y,t[42]=e):e=t[42],M=e}else{let e;t[43]!==m||t[44]!==y?(e=m===null?(0,j.jsx)(r,{id:`UuYo7g`,values:{targetNoun:y}}):(0,j.jsx)(r,{id:`HoWElC`,values:{targetNoun:y,branch:m},components:{0:(0,j.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}}),t[43]=m,t[44]=y,t[45]=e):e=t[45],M=e}let a=null;if(p?.syncEnabled){if(P(p)&&!i){let e;t[46]!==d||t[47]!==p?(e=(0,j.jsx)(H,{status:p,onSyncCompleted:d}),t[46]=d,t[47]=p,t[48]=e):e=t[48],a=e}}else if(p!==null){let e;t[49]===u?e=t[50]:(e=(0,j.jsx)(V,{onEnabled:u}),t[49]=u,t[50]=e),a=e}let o;t[51]!==w||t[52]!==a?(o=(0,j.jsxs)(j.Fragment,{children:[a,w]}),t[51]=w,t[52]=a,t[53]=o):o=t[53],N=o}else{let e;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,j.jsx)(T,{className:`size-9`,"aria-hidden":`true`}),t[54]=e):e=t[54],A=e;let n;t[55]===m?n=t[56]:(n=m===null?(0,j.jsx)(r,{id:`Xewl6B`}):(0,j.jsx)(r,{id:`d1JjXo`,values:{branch:m},components:{0:(0,j.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}}),t[55]=m,t[56]=n),M=n,N=w}let F;t[57]===A?F=t[58]:(F=(0,j.jsx)(`div`,{className:`flex size-16 items-center justify-center rounded-full border bg-muted/40 text-muted-foreground`,children:A}),t[57]=A,t[58]=F);let I;t[59]===M?I=t[60]:(I=(0,j.jsx)(`p`,{className:`max-w-md text-balance text-base leading-6 text-foreground/90`,children:M}),t[59]=M,t[60]=I);let L;t[61]===N?L=t[62]:(L=(0,j.jsx)(`div`,{className:`flex flex-col-reverse gap-2 sm:flex-row`,children:N}),t[61]=N,t[62]=L);let R;return t[63]!==F||t[64]!==I||t[65]!==L?(R=(0,j.jsxs)(j.Fragment,{children:[F,I,L]}),t[63]=F,t[64]=I,t[65]=L,t[66]=R):R=t[66],R}function W(e){return e.replace(/^\/+|\/+$/g,``)}function G(e,t){if(t.kind===`folder`){if(C(e))return W(t.path)===``;let n=S(e);return n!==null&&W(n)===W(t.path)}let n=S(e);return n===null?!1:x(n)===x(t.path)}function K(){let e=null,t=new Set,n=!1;function r(){for(let e of t)e()}function i(t){e!==t&&(e=t,r())}function a(){e!==null&&(G(window.location.hash,e)||i(null))}function o(){n||typeof window>`u`||(n=!0,window.addEventListener(`hashchange`,a))}return{arm(e){o(),i(e)},clear(){i(null)},getSnapshot(){return e},subscribe(e){return t.add(e),()=>{t.delete(e)}},dispose(){n&&typeof window<`u`&&(window.removeEventListener(`hashchange`,a),n=!1),i(null)}}}var q=K();function J(e,t){return e===null||e.kind!==`missing`||t===null||x(t.path)!==e.target?null:t}export{z as a,T as c,R as i,q as n,F as o,U as r,N as s,J as t};
1
+ import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./jsx-runtime-DyiINK0N.js";import{t as n}from"./react-JNybMug3.js";import{n as r,r as i}from"./dist-DBENJeML.js";import{t as a}from"./compiler-runtime-dQcBxOhn.js";import{n as o,t as s}from"./createLucideIcon-B5DNg1uu.js";import{a as c,c as l,n as u,r as d,t as f}from"./EnableSyncConfirmDialog-DtYm7V_O.js";import{t as p}from"./arrow-up-right-DUrnAxeE.js";import{t as m}from"./check-CnRZzbNh.js";import{t as h}from"./folder-open-CIPS7Z9_.js";import{t as g}from"./info-jz24-qK8.js";import{t as _}from"./loader-circle-DZ77ilW4.js";import{n as v}from"./miss-dialog-store-Mtb10VyW.js";import{t as y}from"./refresh-cw-GU9JlNjj.js";import{t as b}from"./triangle-alert-COtjZrcH.js";import{h as x,r as S,u as C}from"./doc-hash-D8EI7kHA.js";import{t as w}from"./external-link-CbUrsN1c.js";var T=s(`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`}]]),E=s(`file-pen`,[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]]),D=s(`file-question-mark`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]]),O=s(`file-x-corner`,[[`path`,{d:`M11 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5`,key:`1jo35a`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m15 17 5 5`,key:`36xl1x`}],[`path`,{d:`m20 17-5 5`,key:`vdz27y`}]]),k=a(),A=e(n(),1),j=t(),M=`https://git-scm.com/docs/git-push`;function N(e,t){return!(e!==`stale`&&e!==`absent`||e===`stale`&&t?.syncEnabled===!0)}function P(e){return e?e.state!==`dormant`&&e.state!==`disabled`&&e.state!==`auth-error`&&e.state!==`conflict`:!1}function F(e){let t=(0,k.c)(47),{freshness:n,status:a,kind:s}=e,{_:l}=i(),{confirmOpen:h,setConfirmOpen:_,onToggleRequest:v,onConfirm:x}=d(c()),[S,C]=(0,A.useState)(`idle`),w=(0,A.useRef)(null),T,E;if(t[0]!==a||t[1]!==S?(T=()=>{if(!(S!==`pending`||!a)){if(a.pushError||a.pushErrorCode){C(`idle`);return}(a.lastSyncUtc??null)!==w.current&&C(`synced`)}},E=[S,a],t[0]=a,t[1]=S,t[2]=T,t[3]=E):(T=t[2],E=t[3]),(0,A.useEffect)(T,E),!N(n,a))return null;if(S===`synced`){let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,j.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-dashed border-border bg-muted/40 p-2 text-xs text-muted-foreground`,"data-testid":`share-freshness-row`,children:[(0,j.jsx)(m,{className:`mt-0.5 size-3.5 shrink-0`,"aria-hidden":`true`}),(0,j.jsx)(`span`,{children:(0,j.jsx)(r,{id:`fxbCNQ`})})]}),t[4]=e):e=t[4],e}let D=a?.syncEnabled===!0,O=a?.pushPermission?.checkStatus===`denied`,F=!!(a?.pushError||a?.pushErrorCode),R=O||F,z=n===`absent`&&!D,B;if(n===`absent`&&!D){let e;t[5]!==l||t[6]!==s?(e=l(s===`folder`?{id:`PrJYSN`}:{id:`3BnyYc`}),t[5]=l,t[6]=s,t[7]=e):e=t[7],B=e}else if(n===`stale`){let e;t[8]!==l||t[9]!==s?(e=l(s===`folder`?{id:`Gt4gOO`}:{id:`2IYGkU`}),t[8]=l,t[9]=s,t[10]=e):e=t[10],B=e}else{let e;t[11]!==l||t[12]!==s?(e=l(s===`folder`?{id:`nqV0Kk`}:{id:`gwykHF`}),t[11]=l,t[12]=s,t[13]=e):e=t[13],B=e}let V;t[14]!==l||t[15]!==F||t[16]!==O?(V=O?l({id:`9OIqw4`}):F?l({id:`K6MQQk`}):null,t[14]=l,t[15]=F,t[16]=O,t[17]=V):V=t[17];let H=V,U;t[18]===a?.lastSyncUtc?U=t[19]:(U=()=>{w.current=a?.lastSyncUtc??null,C(`pending`),u(`sync`).catch(e=>{console.warn(`[share-freshness] sync trigger failed`,e instanceof Error?e.message:e),C(`idle`)})},t[18]=a?.lastSyncUtc,t[19]=U);let W=U,G=z?b:g,K;t[20]===G?K=t[21]:(K=(0,j.jsx)(G,{className:`mt-0.5 size-3.5 shrink-0`,"aria-hidden":`true`}),t[20]=G,t[21]=K);let q;t[22]===B?q=t[23]:(q=(0,j.jsx)(`span`,{children:B}),t[22]=B,t[23]=q);let J;t[24]===H?J=t[25]:(J=H?(0,j.jsx)(`span`,{children:H}):null,t[24]=H,t[25]=J);let Y;t[26]!==R||t[27]!==W||t[28]!==v||t[29]!==a||t[30]!==D||t[31]!==S?(Y=R?null:D?P(a)?(0,j.jsx)(`div`,{children:S===`pending`?(0,j.jsxs)(o,{variant:`outline`,size:`xs`,disabled:!0,children:[(0,j.jsx)(y,{className:`size-3 shrink-0 animate-spin`,"aria-hidden":`true`}),(0,j.jsx)(r,{id:`EHu0x2`})]}):(0,j.jsx)(o,{variant:`outline`,size:`xs`,onClick:W,children:(0,j.jsx)(r,{id:`lb_UU4`})})}):null:(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1.5`,children:[(0,j.jsx)(o,{variant:`outline`,size:`xs`,onClick:()=>v(!0),children:(0,j.jsx)(r,{id:`XU0OXn`})}),(0,j.jsxs)(`a`,{href:M,target:`_blank`,rel:`noopener noreferrer`,onClick:L,onAuxClick:I,className:`inline-flex items-center gap-1 transition-colors hover:text-primary`,children:[(0,j.jsx)(r,{id:`GLxIKR`}),(0,j.jsx)(p,{className:`size-3 shrink-0`,"aria-hidden":`true`})]})]}),t[26]=R,t[27]=W,t[28]=v,t[29]=a,t[30]=D,t[31]=S,t[32]=Y):Y=t[32];let X;t[33]!==q||t[34]!==J||t[35]!==Y?(X=(0,j.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[q,J,Y]}),t[33]=q,t[34]=J,t[35]=Y,t[36]=X):X=t[36];let Z;t[37]!==K||t[38]!==X?(Z=(0,j.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-dashed border-border bg-muted/40 p-2 text-xs text-muted-foreground`,"data-testid":`share-freshness-row`,children:[K,X]}),t[37]=K,t[38]=X,t[39]=Z):Z=t[39];let Q;t[40]!==h||t[41]!==x||t[42]!==_?(Q=(0,j.jsx)(f,{open:h,onOpenChange:_,onConfirm:x}),t[40]=h,t[41]=x,t[42]=_,t[43]=Q):Q=t[43];let $;return t[44]!==Z||t[45]!==Q?($=(0,j.jsxs)(j.Fragment,{children:[Z,Q]}),t[44]=Z,t[45]=Q,t[46]=$):$=t[46],$}function I(e){return w(e,M)}function L(e){return w(e,M)}function R(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function z(e){let t=(0,k.c)(13),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={phase:`pending`},t[0]=n):n=t[0];let[r,i]=(0,A.useState)(n),[a,o]=(0,A.useState)(0),s=e.branch,c;t[1]!==s||t[2]!==e.kind||t[3]!==e.path?(c=()=>{let t=window.okDesktop??null;if(!t||s===null){i({phase:`resolved`,resolution:{verdict:`unknown`}});return}let n=!1;return t.project.fetchTargetStatus({projectPath:t.config.projectPath,branch:s,path:e.path,kind:e.kind}).then(e=>{n||i({phase:`resolved`,resolution:e??{verdict:`unknown`}})}).catch(e=>{n||(console.warn(`[receive] miss target-status fetch failed`,e instanceof Error?e.message:e),i({phase:`resolved`,resolution:{verdict:`unknown`}}))}),()=>{n=!0}},t[1]=s,t[2]=e.kind,t[3]=e.path,t[4]=c):c=t[4];let l;t[5]!==s||t[6]!==a||t[7]!==e.kind||t[8]!==e.path?(l=[s,e.kind,e.path,a],t[5]=s,t[6]=a,t[7]=e.kind,t[8]=e.path,t[9]=l):l=t[9],(0,A.useEffect)(c,l);let u;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>{i({phase:`pending`}),o(B)},t[10]=u):u=t[10];let d;return t[11]===r?d=t[12]:(d={state:r,refetch:u},t[11]=r,t[12]=d),d}function B(e){return e+1}function V(e){let t=(0,k.c)(15),{onEnabled:n}=e,i=c(),a;t[0]===n?a=t[1]:(a={onEnabled:n},t[0]=n,t[1]=a);let{confirmOpen:s,setConfirmOpen:l,onToggleRequest:u,onConfirm:p}=d(i,a),m;t[2]===u?m=t[3]:(m=()=>u(!0),t[2]=u,t[3]=m);let h,g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,j.jsx)(y,{className:`size-4`,"aria-hidden":`true`}),g=(0,j.jsx)(r,{id:`XU0OXn`}),t[4]=h,t[5]=g):(h=t[4],g=t[5]);let _;t[6]===m?_=t[7]:(_=(0,j.jsxs)(o,{onClick:m,"data-testid":`share-receive-miss-enable-sync`,children:[h,g]}),t[6]=m,t[7]=_);let v;t[8]!==s||t[9]!==p||t[10]!==l?(v=(0,j.jsx)(f,{open:s,onOpenChange:l,onConfirm:p}),t[8]=s,t[9]=p,t[10]=l,t[11]=v):v=t[11];let b;return t[12]!==_||t[13]!==v?(b=(0,j.jsxs)(j.Fragment,{children:[_,v]}),t[12]=_,t[13]=v,t[14]=b):b=t[14],b}function H(e){let t=(0,k.c)(15),{status:n,onSyncCompleted:i}=e,[a,s]=(0,A.useState)(!1),c=(0,A.useRef)(null),l;t[0]!==i||t[1]!==a||t[2]!==n.lastSyncUtc||t[3]!==n.pushError||t[4]!==n.pushErrorCode?(l=()=>{if(a){if(n.pushError||n.pushErrorCode){s(!1);return}(n.lastSyncUtc??null)!==c.current&&(s(!1),i?.())}},t[0]=i,t[1]=a,t[2]=n.lastSyncUtc,t[3]=n.pushError,t[4]=n.pushErrorCode,t[5]=l):l=t[5];let d;t[6]!==i||t[7]!==a||t[8]!==n?(d=[a,n,i],t[6]=i,t[7]=a,t[8]=n,t[9]=d):d=t[9],(0,A.useEffect)(l,d);let f;t[10]===n.lastSyncUtc?f=t[11]:(f=()=>{c.current=n.lastSyncUtc??null,s(!0),u(`sync`).catch(e=>{console.warn(`[receive] miss sync trigger failed`,e instanceof Error?e.message:e),s(!1)})},t[10]=n.lastSyncUtc,t[11]=f);let p=f,m;return t[12]!==p||t[13]!==a?(m=a?(0,j.jsxs)(o,{disabled:!0,"data-testid":`share-receive-miss-sync-now`,children:[(0,j.jsx)(y,{className:`size-4 animate-spin`,"aria-hidden":`true`}),(0,j.jsx)(r,{id:`EHu0x2`})]}):(0,j.jsxs)(o,{onClick:p,"data-testid":`share-receive-miss-sync-now`,children:[(0,j.jsx)(y,{className:`size-4`,"aria-hidden":`true`}),(0,j.jsx)(r,{id:`lb_UU4`})]}),t[12]=p,t[13]=a,t[14]=m):m=t[14],m}function U(e){let t=(0,k.c)(67),{nav:n,state:a,onBrowseFolder:s,onOpenRenamed:c,onEnableAutoSync:u,onSyncCompleted:d}=e,{_:f}=i(),p=l(),m=n.branch,g;t[0]!==f||t[1]!==n.kind?(g=n.kind===`folder`?f({id:`ugoTXs`}):f({id:`XH30C4`}),t[0]=f,t[1]=n.kind,t[2]=g):g=t[2];let y=g;if(a.phase===`pending`){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(_,{className:`size-5 animate-spin`,"aria-hidden":`true`}),(0,j.jsx)(r,{id:`c8jBgX`})]}),t[3]=e):e=t[3],e}let{resolution:b}=a,x,S;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,j.jsx)(h,{className:`size-4`,"aria-hidden":`true`}),S=(0,j.jsx)(r,{id:`hItdtk`}),t[4]=x,t[5]=S):(x=t[4],S=t[5]);let C;t[6]===s?C=t[7]:(C=(0,j.jsxs)(o,{variant:`outline`,onClick:s,"data-testid":`share-receive-miss-browse`,children:[x,S]}),t[6]=s,t[7]=C);let w=C,A,M,N;if(b.verdict===`renamed`){let e;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,j.jsx)(v,{className:`size-9`,"aria-hidden":`true`}),t[8]=e):e=t[8],A=e;let n;t[9]!==b.renamedTo||t[10]!==y?(n={0:b.renamedTo,targetNoun:y},t[9]=b.renamedTo,t[10]=y,t[11]=n):n=t[11];let i;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(i={0:(0,j.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})},t[12]=i):i=t[12];let a;t[13]===n?a=t[14]:(a=(0,j.jsx)(r,{id:`P0HC30`,values:n,components:i}),t[13]=n,t[14]=a),M=a;let s;t[15]!==c||t[16]!==b.renamedTo?(s=()=>c(b.renamedTo),t[15]=c,t[16]=b.renamedTo,t[17]=s):s=t[17];let l,u;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,j.jsx)(v,{className:`size-4`,"aria-hidden":`true`}),u=(0,j.jsx)(r,{id:`AItsE5`}),t[18]=l,t[19]=u):(l=t[18],u=t[19]);let d;t[20]===s?d=t[21]:(d=(0,j.jsxs)(o,{onClick:s,"data-testid":`share-receive-miss-open-renamed`,children:[l,u]}),t[20]=s,t[21]=d);let f;t[22]!==w||t[23]!==d?(f=(0,j.jsxs)(j.Fragment,{children:[d,w]}),t[22]=w,t[23]=d,t[24]=f):f=t[24],N=f}else if(b.verdict===`deleted`){let e;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,j.jsx)(O,{className:`size-9`,"aria-hidden":`true`}),t[25]=e):e=t[25],A=e;let n;t[26]!==m||t[27]!==y?(n={targetNoun:y,branch:m},t[26]=m,t[27]=y,t[28]=n):n=t[28];let i;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(i={0:(0,j.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})},t[29]=i):i=t[29];let a;t[30]===n?a=t[31]:(a=(0,j.jsx)(r,{id:`kpqWwG`,values:n,components:i}),t[30]=n,t[31]=a),M=a,N=w}else if(b.verdict===`never-on-branch`){let e;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,j.jsx)(D,{className:`size-9`,"aria-hidden":`true`}),t[32]=e):e=t[32],A=e;let n;t[33]!==m||t[34]!==y?(n={targetNoun:y,branch:m},t[33]=m,t[34]=y,t[35]=n):n=t[35];let i;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(i={0:(0,j.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})},t[36]=i):i=t[36];let a;t[37]===n?a=t[38]:(a=(0,j.jsx)(r,{id:`i9TPUi`,values:n,components:i}),t[37]=n,t[38]=a),M=a,N=w}else if(b.verdict===`changed-locally`){let e;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,j.jsx)(E,{className:`size-9`,"aria-hidden":`true`}),t[39]=e):e=t[39],A=e;let n=p?.syncEnabled===!0,i=p?.pushPermission?.checkStatus===`denied`||!!(p?.pushError||p?.pushErrorCode);if(n){let e;t[40]!==m||t[41]!==y?(e=m===null?(0,j.jsx)(r,{id:`RyIKxy`,values:{targetNoun:y}}):(0,j.jsx)(r,{id:`l6kpzR`,values:{targetNoun:y,branch:m},components:{0:(0,j.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}}),t[40]=m,t[41]=y,t[42]=e):e=t[42],M=e}else{let e;t[43]!==m||t[44]!==y?(e=m===null?(0,j.jsx)(r,{id:`UuYo7g`,values:{targetNoun:y}}):(0,j.jsx)(r,{id:`HoWElC`,values:{targetNoun:y,branch:m},components:{0:(0,j.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}}),t[43]=m,t[44]=y,t[45]=e):e=t[45],M=e}let a=null;if(p?.syncEnabled){if(P(p)&&!i){let e;t[46]!==d||t[47]!==p?(e=(0,j.jsx)(H,{status:p,onSyncCompleted:d}),t[46]=d,t[47]=p,t[48]=e):e=t[48],a=e}}else if(p!==null){let e;t[49]===u?e=t[50]:(e=(0,j.jsx)(V,{onEnabled:u}),t[49]=u,t[50]=e),a=e}let o;t[51]!==w||t[52]!==a?(o=(0,j.jsxs)(j.Fragment,{children:[a,w]}),t[51]=w,t[52]=a,t[53]=o):o=t[53],N=o}else{let e;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,j.jsx)(T,{className:`size-9`,"aria-hidden":`true`}),t[54]=e):e=t[54],A=e;let n;t[55]===m?n=t[56]:(n=m===null?(0,j.jsx)(r,{id:`Xewl6B`}):(0,j.jsx)(r,{id:`d1JjXo`,values:{branch:m},components:{0:(0,j.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}}),t[55]=m,t[56]=n),M=n,N=w}let F;t[57]===A?F=t[58]:(F=(0,j.jsx)(`div`,{className:`flex size-16 items-center justify-center rounded-full border bg-muted/40 text-muted-foreground`,children:A}),t[57]=A,t[58]=F);let I;t[59]===M?I=t[60]:(I=(0,j.jsx)(`p`,{className:`max-w-md text-balance text-base leading-6 text-foreground/90`,children:M}),t[59]=M,t[60]=I);let L;t[61]===N?L=t[62]:(L=(0,j.jsx)(`div`,{className:`flex flex-col-reverse gap-2 sm:flex-row`,children:N}),t[61]=N,t[62]=L);let R;return t[63]!==F||t[64]!==I||t[65]!==L?(R=(0,j.jsxs)(j.Fragment,{children:[F,I,L]}),t[63]=F,t[64]=I,t[65]=L,t[66]=R):R=t[66],R}function W(e){return e.replace(/^\/+|\/+$/g,``)}function G(e,t){if(t.kind===`folder`){if(C(e))return W(t.path)===``;let n=S(e);return n!==null&&W(n)===W(t.path)}let n=S(e);return n===null?!1:x(n)===x(t.path)}function K(){let e=null,t=new Set,n=!1;function r(){for(let e of t)e()}function i(t){e!==t&&(e=t,r())}function a(){e!==null&&(G(window.location.hash,e)||i(null))}function o(){n||typeof window>`u`||(n=!0,window.addEventListener(`hashchange`,a))}return{arm(e){o(),i(e)},clear(){i(null)},getSnapshot(){return e},subscribe(e){return t.add(e),()=>{t.delete(e)}},dispose(){n&&typeof window<`u`&&(window.removeEventListener(`hashchange`,a),n=!1),i(null)}}}var q=K();function J(e,t){return e===null||e.kind!==`missing`||t===null||x(t.path)!==e.target?null:t}export{z as a,T as c,R as i,q as n,F as o,U as r,N as s,J as t};
@@ -1 +1 @@
1
- import{i as e,t}from"./chunk-DseTPa7n.js";import{t as n}from"./jsx-runtime-DyiINK0N.js";import{t as r}from"./react-JNybMug3.js";import{t as i}from"./compiler-runtime-dQcBxOhn.js";import{t as a}from"./createLucideIcon-B5DNg1uu.js";import{$r as o}from"./dist-D6R8vG-1.js";import{t as s}from"./parse-api-error-QYXuYti5.js";import{c as ee,f as te,l as c,t as ne,u as l}from"./navigation-targets-CdngrI3e.js";import{o as re}from"./documents-events-Bd2Tt95I.js";import{t as u}from"./documents-fetch-DINufYLx.js";import{r as ie}from"./startup-marks-DfgPoe-6.js";var d=a(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),f=a(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),p=e(r(),1),ae=i();function m(e,t){let n=!1,r=!1,i=!1;async function a(){if(!i){n=!0;try{await e()}finally{n=!1,i?r=!1:r&&(r=!1,a())}}}return{request(){if(!i){if(n){r=!0,t?.();return}a()}},dispose(){i=!0,r=!1,t?.()}}}var oe=n(),h=(0,p.createContext)(null);function se(e,t){if(t.size===0)return new Set(e);let n=new Set(e);for(let e of t)n.add(e);return n}function ce(e,t){if(e.size===0)return new Set;let n=new Set;for(let r of e)t.has(r)||n.add(r);return n}function g(e,t){let n=new Map(e);for(let e of t)n.has(e)||n.set(e,e);return n}async function le(){let e=await fetch(`/api/pages`);if(!e.ok){let t=await e.json().catch(()=>null);throw Error(s(t)??`/api/pages responded with ${e.status}`)}let t=await e.json();return Array.isArray(t.pages)?t.pages:[]}async function ue(){let{ok:e,status:t,body:n}=await u();if(!e)throw Error(s(n)??`/api/documents responded with ${t}`);let r=n??{};return Array.isArray(r.documents)?{assetPaths:r.documents.filter(e=>e.kind===`asset`&&typeof e.path==`string`&&e.path.length>0).map(e=>e.path),folderPaths:r.documents.filter(e=>e.kind===`folder`&&typeof e.path==`string`&&e.path.length>0).map(e=>e.path),filePaths:r.documents.filter(e=>e.kind===`file`&&typeof e.path==`string`&&e.path.length>0).map(e=>e.path)}:{assetPaths:[],folderPaths:[],filePaths:[]}}function de(e){console.error(`[PageListContext] Failed to load pages:`,e)}function _(e){console.warn(`[PageListContext] Failed to load referenced assets:`,e)}function v(e){let t=(0,ae.c)(54),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=new Set,t[0]=r):r=t[0];let[i,a]=(0,p.useState)(r),s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=new Map,t[1]=s):s=t[1];let[u,d]=(0,p.useState)(s),f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=new Map,t[2]=f):f=t[2];let[_,v]=(0,p.useState)(f),y;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(y=new Set,t[3]=y):y=t[3];let[b,x]=(0,p.useState)(y),S;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(S=new Set,t[4]=S):S=t[4];let[C,ge]=(0,p.useState)(S),w;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(w=new Set,t[5]=w):w=t[5];let[T,_e]=(0,p.useState)(w),E;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(E=new Set,t[6]=E):E=t[6];let[D,O]=(0,p.useState)(E),[k,A]=(0,p.useState)(!0),[j,M]=(0,p.useState)(null),N=(0,p.useRef)(0),P;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(P=function(){let e=N.current+=1;return Promise.all([le(),ue().catch(he)]).then(t=>{let[n,r]=t;if(e!==N.current)return;let i=new Set(n.map(me));a(i),d(new Map(n.map(pe))),v(new Map(n.map(fe))),x(new Set(r.assetPaths)),ge(new Set(r.folderPaths)),_e(new Set(r.filePaths)),O(e=>ce(e,i)),M(null),ie()}).catch(t=>{e===N.current&&(de(t),M(t instanceof Error?t.message:`Failed to load pages`))}).finally(()=>{e===N.current&&A(!1)})},t[7]=P):P=t[7];let F=P,I;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(I=function(e){O(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n}),M(null)},t[8]=I):I=t[8];let ve=I,L,R;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(L=()=>{let e=m(F);e.request();let t=null,n=()=>{document.visibilityState===`visible`&&e.request()};window.addEventListener(`focus`,n),window.addEventListener(`visibilitychange`,n);let r=re(n=>{n.includes(`files`)&&t===null&&(t=setTimeout(()=>{t=null,e.request()},300))});return()=>{t!==null&&clearTimeout(t),e.dispose(),window.removeEventListener(`focus`,n),window.removeEventListener(`visibilitychange`,n),r()}},R=[],t[9]=L,t[10]=R):(L=t[9],R=t[10]),(0,p.useEffect)(L,R);let z,B,V,H,U,W,G,K;if(t[11]!==D||t[12]!==b||t[13]!==T||t[14]!==C||t[15]!==_||t[16]!==u||t[17]!==i){W=se(i,D);let e;t[26]!==D||t[27]!==u?(e=g(u,D),t[26]=D,t[27]=u,t[28]=e):e=t[28],U=e,H=_,z=b,B=T,V=new Set([...ne(W),...C]),G=l(W,o),K=c(W,o),t[11]=D,t[12]=b,t[13]=T,t[14]=C,t[15]=_,t[16]=u,t[17]=i,t[18]=z,t[19]=B,t[20]=V,t[21]=H,t[22]=U,t[23]=W,t[24]=G,t[25]=K}else z=t[18],B=t[19],V=t[20],H=t[21],U=t[22],W=t[23],G=t[24],K=t[25];let q=K,J;t[29]===_?J=t[30]:(J=ee(_),t[29]=_,t[30]=J);let Y=J,X,Z;t[31]!==z||t[32]!==B||t[33]!==V||t[34]!==Y||t[35]!==W||t[36]!==q||t[37]!==G?(X=()=>{te({pages:W,folderPaths:V,pagesBySlug:G,pagesByBasename:q,assetPaths:z,filePaths:B,pageIcons:Y})},Z=[W,V,G,q,z,B,Y],t[31]=z,t[32]=B,t[33]=V,t[34]=Y,t[35]=W,t[36]=q,t[37]=G,t[38]=X,t[39]=Z):(X=t[38],Z=t[39]),(0,p.useEffect)(X,Z);let Q;t[40]!==z||t[41]!==j||t[42]!==B||t[43]!==V||t[44]!==k||t[45]!==H||t[46]!==U||t[47]!==W||t[48]!==q||t[49]!==G?(Q={pages:W,pagesBySlug:G,pagesByBasename:q,pageTitles:U,pageMeta:H,folderPaths:V,assetPaths:z,filePaths:B,loading:k,error:j,refetch:F,addPage:ve},t[40]=z,t[41]=j,t[42]=B,t[43]=V,t[44]=k,t[45]=H,t[46]=U,t[47]=W,t[48]=q,t[49]=G,t[50]=Q):Q=t[50];let $;return t[51]!==n||t[52]!==Q?($=(0,oe.jsx)(h,{value:Q,children:n}),t[51]=n,t[52]=Q,t[53]=$):$=t[53],$}function fe(e){return[e.docName,{size:e.size,modified:e.modified,docExt:e.docExt,icon:e.icon}]}function pe(e){return[e.docName,e.title]}function me(e){return e.docName}function he(e){return _(e),{assetPaths:[],folderPaths:[],filePaths:[]}}function y(){let e=(0,p.use)(h);if(!e)throw Error(`usePageList must be used within <PageListProvider />`);return e}function b(){return(0,p.use)(h)}var x=t(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),S=t(((e,t)=>{var n=x();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),C=t(((e,t)=>{t.exports=S()()}));export{m as a,y as i,v as n,f as o,b as r,d as s,C as t};
1
+ import{i as e,t}from"./chunk-DseTPa7n.js";import{t as n}from"./jsx-runtime-DyiINK0N.js";import{t as r}from"./react-JNybMug3.js";import{t as i}from"./compiler-runtime-dQcBxOhn.js";import{t as a}from"./createLucideIcon-B5DNg1uu.js";import{$r as o}from"./dist-zc03OoUp.js";import{t as s}from"./parse-api-error-QYXuYti5.js";import{c as ee,f as te,l as c,t as ne,u as l}from"./navigation-targets-DUt4VF6E.js";import{o as re}from"./documents-events-BTDcCELc.js";import{t as u}from"./documents-fetch-DINufYLx.js";import{r as ie}from"./startup-marks-DfgPoe-6.js";var d=a(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),f=a(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),p=e(r(),1),ae=i();function m(e,t){let n=!1,r=!1,i=!1;async function a(){if(!i){n=!0;try{await e()}finally{n=!1,i?r=!1:r&&(r=!1,a())}}}return{request(){if(!i){if(n){r=!0,t?.();return}a()}},dispose(){i=!0,r=!1,t?.()}}}var oe=n(),h=(0,p.createContext)(null);function se(e,t){if(t.size===0)return new Set(e);let n=new Set(e);for(let e of t)n.add(e);return n}function ce(e,t){if(e.size===0)return new Set;let n=new Set;for(let r of e)t.has(r)||n.add(r);return n}function g(e,t){let n=new Map(e);for(let e of t)n.has(e)||n.set(e,e);return n}async function le(){let e=await fetch(`/api/pages`);if(!e.ok){let t=await e.json().catch(()=>null);throw Error(s(t)??`/api/pages responded with ${e.status}`)}let t=await e.json();return Array.isArray(t.pages)?t.pages:[]}async function ue(){let{ok:e,status:t,body:n}=await u();if(!e)throw Error(s(n)??`/api/documents responded with ${t}`);let r=n??{};return Array.isArray(r.documents)?{assetPaths:r.documents.filter(e=>e.kind===`asset`&&typeof e.path==`string`&&e.path.length>0).map(e=>e.path),folderPaths:r.documents.filter(e=>e.kind===`folder`&&typeof e.path==`string`&&e.path.length>0).map(e=>e.path),filePaths:r.documents.filter(e=>e.kind===`file`&&typeof e.path==`string`&&e.path.length>0).map(e=>e.path)}:{assetPaths:[],folderPaths:[],filePaths:[]}}function de(e){console.error(`[PageListContext] Failed to load pages:`,e)}function _(e){console.warn(`[PageListContext] Failed to load referenced assets:`,e)}function v(e){let t=(0,ae.c)(54),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=new Set,t[0]=r):r=t[0];let[i,a]=(0,p.useState)(r),s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=new Map,t[1]=s):s=t[1];let[u,d]=(0,p.useState)(s),f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=new Map,t[2]=f):f=t[2];let[_,v]=(0,p.useState)(f),y;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(y=new Set,t[3]=y):y=t[3];let[b,x]=(0,p.useState)(y),S;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(S=new Set,t[4]=S):S=t[4];let[C,ge]=(0,p.useState)(S),w;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(w=new Set,t[5]=w):w=t[5];let[T,_e]=(0,p.useState)(w),E;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(E=new Set,t[6]=E):E=t[6];let[D,O]=(0,p.useState)(E),[k,A]=(0,p.useState)(!0),[j,M]=(0,p.useState)(null),N=(0,p.useRef)(0),P;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(P=function(){let e=N.current+=1;return Promise.all([le(),ue().catch(he)]).then(t=>{let[n,r]=t;if(e!==N.current)return;let i=new Set(n.map(me));a(i),d(new Map(n.map(pe))),v(new Map(n.map(fe))),x(new Set(r.assetPaths)),ge(new Set(r.folderPaths)),_e(new Set(r.filePaths)),O(e=>ce(e,i)),M(null),ie()}).catch(t=>{e===N.current&&(de(t),M(t instanceof Error?t.message:`Failed to load pages`))}).finally(()=>{e===N.current&&A(!1)})},t[7]=P):P=t[7];let F=P,I;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(I=function(e){O(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n}),M(null)},t[8]=I):I=t[8];let ve=I,L,R;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(L=()=>{let e=m(F);e.request();let t=null,n=()=>{document.visibilityState===`visible`&&e.request()};window.addEventListener(`focus`,n),window.addEventListener(`visibilitychange`,n);let r=re(n=>{n.includes(`files`)&&t===null&&(t=setTimeout(()=>{t=null,e.request()},300))});return()=>{t!==null&&clearTimeout(t),e.dispose(),window.removeEventListener(`focus`,n),window.removeEventListener(`visibilitychange`,n),r()}},R=[],t[9]=L,t[10]=R):(L=t[9],R=t[10]),(0,p.useEffect)(L,R);let z,B,V,H,U,W,G,K;if(t[11]!==D||t[12]!==b||t[13]!==T||t[14]!==C||t[15]!==_||t[16]!==u||t[17]!==i){W=se(i,D);let e;t[26]!==D||t[27]!==u?(e=g(u,D),t[26]=D,t[27]=u,t[28]=e):e=t[28],U=e,H=_,z=b,B=T,V=new Set([...ne(W),...C]),G=l(W,o),K=c(W,o),t[11]=D,t[12]=b,t[13]=T,t[14]=C,t[15]=_,t[16]=u,t[17]=i,t[18]=z,t[19]=B,t[20]=V,t[21]=H,t[22]=U,t[23]=W,t[24]=G,t[25]=K}else z=t[18],B=t[19],V=t[20],H=t[21],U=t[22],W=t[23],G=t[24],K=t[25];let q=K,J;t[29]===_?J=t[30]:(J=ee(_),t[29]=_,t[30]=J);let Y=J,X,Z;t[31]!==z||t[32]!==B||t[33]!==V||t[34]!==Y||t[35]!==W||t[36]!==q||t[37]!==G?(X=()=>{te({pages:W,folderPaths:V,pagesBySlug:G,pagesByBasename:q,assetPaths:z,filePaths:B,pageIcons:Y})},Z=[W,V,G,q,z,B,Y],t[31]=z,t[32]=B,t[33]=V,t[34]=Y,t[35]=W,t[36]=q,t[37]=G,t[38]=X,t[39]=Z):(X=t[38],Z=t[39]),(0,p.useEffect)(X,Z);let Q;t[40]!==z||t[41]!==j||t[42]!==B||t[43]!==V||t[44]!==k||t[45]!==H||t[46]!==U||t[47]!==W||t[48]!==q||t[49]!==G?(Q={pages:W,pagesBySlug:G,pagesByBasename:q,pageTitles:U,pageMeta:H,folderPaths:V,assetPaths:z,filePaths:B,loading:k,error:j,refetch:F,addPage:ve},t[40]=z,t[41]=j,t[42]=B,t[43]=V,t[44]=k,t[45]=H,t[46]=U,t[47]=W,t[48]=q,t[49]=G,t[50]=Q):Q=t[50];let $;return t[51]!==n||t[52]!==Q?($=(0,oe.jsx)(h,{value:Q,children:n}),t[51]=n,t[52]=Q,t[53]=$):$=t[53],$}function fe(e){return[e.docName,{size:e.size,modified:e.modified,docExt:e.docExt,icon:e.icon}]}function pe(e){return[e.docName,e.title]}function me(e){return e.docName}function he(e){return _(e),{assetPaths:[],folderPaths:[],filePaths:[]}}function y(){let e=(0,p.use)(h);if(!e)throw Error(`usePageList must be used within <PageListProvider />`);return e}function b(){return(0,p.use)(h)}var x=t(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),S=t(((e,t)=>{var n=x();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),C=t(((e,t)=>{t.exports=S()()}));export{m as a,y as i,v as n,f as o,b as r,d as s,C as t};
@@ -1,2 +1,2 @@
1
- import{rn as e}from"./dist-D6R8vG-1.js";function t(t){return e(t)}function n(e,t){switch(e.kind){case`ok`:return null;case`not-git`:return`This folder doesn't contain a git repository. Pick a different folder?`;case`wrong-repo`:return`This folder is a clone of ${e.actualOwner}/${e.actualRepo}, not ${t.owner}/${t.repo}. Pick a different folder?`;case`no-origin`:case`non-github`:case`symlink-escape`:return`This folder isn't a clone of ${t.owner}/${t.repo}. Pick a different folder?`}}function r(e){return e.kind===`unsupported-version`?{kind:`unsupported-version`,message:`Update OpenKnowledge to open this share.`}:e.kind===`invalid`?{kind:`invalid`,message:`Invalid share URL.`}:null}function i(e){let t=e.split(`
1
+ import{rn as e}from"./dist-zc03OoUp.js";function t(t){return e(t)}function n(e,t){switch(e.kind){case`ok`:return null;case`not-git`:return`This folder doesn't contain a git repository. Pick a different folder?`;case`wrong-repo`:return`This folder is a clone of ${e.actualOwner}/${e.actualRepo}, not ${t.owner}/${t.repo}. Pick a different folder?`;case`wrong-host`:return`This folder is a clone of ${t.owner}/${t.repo} on ${e.actualHost}, not ${t.host}. Pick a folder cloned from ${t.host}?`;case`no-origin`:case`non-github`:case`symlink-escape`:return`This folder isn't a clone of ${t.owner}/${t.repo}. Pick a different folder?`}}function r(e){return e.kind===`unsupported-version`?{kind:`unsupported-version`,message:`Update OpenKnowledge to open this share.`}:e.kind===`invalid`?{kind:`invalid`,message:`Invalid share URL.`}:null}function i(e){let t=e.split(`
2
2
  `).map(e=>e.trim()).filter(e=>e.length>0&&!/^Cloning into /i.test(e)),n=t.filter(e=>/^remote:/i.test(e)),r=n[n.length-1];if(r)return r.replace(/^remote:\s*/i,``).trim();let i=t.find(e=>/^fatal:/i.test(e));return i?i.replace(/^fatal:\s*/i,``).trim():t[0]??``}function a(e){let t=[`[receive]`];return e.q2_path!==void 0&&t.push(`q2_path=${e.q2_path}`),e.folder_validate!==void 0&&t.push(`folder_validate=${e.folder_validate}`),e.branch_action!==void 0&&t.push(`branch_action=${e.branch_action}`),e.branch!==void 0&&t.push(`branch=${e.branch}`),e.doc_check!==void 0&&t.push(`doc_check=${e.doc_check}`),e.branch_dialog_action!==void 0&&t.push(`branch_dialog_action=${e.branch_dialog_action}`),e.verdict_cell!==void 0&&t.push(`verdict_cell=${e.verdict_cell}`),t.join(` `)}function o(){let e=null,t=new Set,n=!1,r=null;function i(){for(let e of t)e()}function a(){e!==null&&(e=null,i())}return{install({bridge:t}){if(t)return n?r??void 0:(n=!0,r=t.onShareReceived(t=>{e=t,i()}),()=>{r?.(),r=null,n=!1,a()})},getSnapshot(){return e},subscribe(e){return t.add(e),()=>{t.delete(e)}},dismiss(){a()}}}var s=o();function c(e){return s.install(e)}export{a,i,s as n,n as o,t as r,r as s,c as t};
@@ -1,4 +1,4 @@
1
- import{A as e}from"./DocumentContext-BcosLIs9.js";function t(e){return e.lineCount===1&&e.charLen<100?{kind:`inline`,markdown:e.markdown}:e.surface===`source`&&e.sourceLineStart!==void 0&&e.sourceLineEnd!==void 0?{kind:`lines`,startLine:e.sourceLineStart,endLine:e.sourceLineEnd}:{kind:`anchor`,markdown:e.markdown}}function n(e,t){return e.sourceLineStart!==void 0&&e.sourceLineEnd!==void 0?`${t} (${e.sourceLineStart===e.sourceLineEnd?`${e.sourceLineStart}`:`${e.sourceLineStart}-${e.sourceLineEnd}`})`:e.lineCount>1?`${t} (${e.lineCount} lines)`:`${t} (selection)`}function r(e){let t=e.replace(/\r\n/g,`
1
+ import{A as e}from"./DocumentContext-Dog3N-Wc.js";function t(e){return e.lineCount===1&&e.charLen<100?{kind:`inline`,markdown:e.markdown}:e.surface===`source`&&e.sourceLineStart!==void 0&&e.sourceLineEnd!==void 0?{kind:`lines`,startLine:e.sourceLineStart,endLine:e.sourceLineEnd}:{kind:`anchor`,markdown:e.markdown}}function n(e,t){return e.sourceLineStart!==void 0&&e.sourceLineEnd!==void 0?`${t} (${e.sourceLineStart===e.sourceLineEnd?`${e.sourceLineStart}`:`${e.sourceLineStart}-${e.sourceLineEnd}`})`:e.lineCount>1?`${t} (${e.lineCount} lines)`:`${t} (selection)`}function r(e){let t=e.replace(/\r\n/g,`
2
2
  `).split(`
3
3
  `),n=[],r=!1;for(let e of t){let t=e.trim();if(/^(```|~~~)/.test(t)){r||n.push(`code`),r=!r;continue}if(r||t===``)continue;if(/^\|.*\|?$/.test(t)&&t.includes(`|`)){n[n.length-1]!==`table`&&n.push(`table`);continue}if(/^<\/?[A-Za-z]/.test(t)){n[n.length-1]!==`component`&&n.push(`component`);continue}let i=t.match(/^#{1,6}\s+(.*)$/);if(i){n.push(i[1]??``);continue}let a=t.match(/^[-*+]\s+(.*)$/);if(a){n.push(`• ${a[1]??``}`);continue}let o=t.match(/^\d+\.\s+(.*)$/);if(o){n.push(`• ${o[1]??``}`);continue}let s=t.match(/^>\s?(.*)$/);if(s){n.push(s[1]??``);continue}n.push(t)}return n.join(` `).replace(/\s+/g,` `).trim()}var i=new Map,a=new Set,o=(e,t)=>`${t}:${e}`;function s(){for(let e of a)e()}function c(e,t){return e.markdown===t.markdown&&e.sourceLineStart===t.sourceLineStart&&e.sourceLineEnd===t.sourceLineEnd}function l(e,t,n){let r=o(e,t);if(n===null){i.delete(r)&&s();return}let a=i.get(r);a&&c(a,n)||(i.set(r,n),s())}function u(e,t){return e===null?null:i.get(o(e,t))??null}function d(e){return a.add(e),()=>{a.delete(e)}}function f(t,n){if(t.state.selection.empty)return null;let r=e(t);return r.trim()?{surface:`wysiwyg`,docName:n,markdown:r,charLen:r.trim().length,lineCount:(r.match(/\n/g)?.length??0)+1}:null}function p(e,t){return e.trim()?{surface:`frontmatter`,docName:t,markdown:e,charLen:e.trim().length,lineCount:(e.match(/\n/g)?.length??0)+1}:null}function m(e,t){let n=[],r=1/0,i=-1;for(let t of e.state.selection.ranges)t.empty||(n.push(e.state.sliceDoc(t.from,t.to)),r=Math.min(r,t.from),i=Math.max(i,t.to));if(n.length===0)return null;let a=n.join(`
4
4
  `);if(!a.trim())return null;let o=e.state.doc.lineAt(r).number,s=e.state.doc.lineAt(i).number;return{surface:`source`,docName:t,markdown:a,charLen:a.trim().length,lineCount:s-o+1,sourceLineStart:o,sourceLineEnd:s}}export{p as a,t as c,n as i,d as l,r as n,m as o,l as r,f as s,u as t};
@@ -1 +1 @@
1
- import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./jsx-runtime-DyiINK0N.js";import{t as n}from"./react-JNybMug3.js";import{n as r,r as i}from"./dist-DBENJeML.js";import{t as a}from"./compiler-runtime-dQcBxOhn.js";import{n as o,t as s}from"./createLucideIcon-B5DNg1uu.js";import{a as c,c as l,i as u,n as d,o as f,r as p,s as m,t as h}from"./dialog-DRODJICP.js";import{a as g,d as _,f as v,i as y,o as b,p as x,u as S}from"./dropdown-menu-DRE6Cf6z.js";import{t as C}from"./label-JTxG9Ey8.js";import{D as w,a as T,f as E,h as D,m as O,n as k,o as A,p as j,r as M,s as N,t as P,v as F}from"./agent-visibility-BKHfJySh.js";import{$t as I,Et as L,Ft as R,Kt as z,Lt as B,P as V,Rt as H,Zt as U,at as W,bn as G,en as K,fn as q,gn as J,hn as ee,mn as Y,ot as te,pn as ne,ri as re,vn as ie,xn as ae,yn as oe}from"./dist-D6R8vG-1.js";import{t as se}from"./RegisteredAgentIcon-DlQ6ljJ9.js";import{a as ce,d as le,l as ue,n as de,r as fe,t as pe,u as me}from"./workspace-paths-0CCDk_CH.js";import{t as he}from"./copy-KDLrwpxR.js";import{t as ge}from"./folder-open-CIPS7Z9_.js";import{t as _e}from"./loader-circle-DZ77ilW4.js";import{t as ve}from"./refresh-cw-GU9JlNjj.js";import{t as ye}from"./sliders-horizontal-D06S3vlK.js";import{t as be}from"./trash-2-CArNk5fT.js";import{n as X}from"./dist-pkKXEO3Q.js";import{t as xe}from"./input-CKzGvkzv.js";import{t as Se}from"./dist-DEkFedhu.js";import{t as Ce}from"./parse-api-error-QYXuYti5.js";import{o as we,s as Te}from"./documents-events-Bd2Tt95I.js";import{n as Ee}from"./config-context-DOXKMLrN.js";import{t as De}from"./use-workspace--VMy_KL1.js";import{n as Oe}from"./clipboard-adapter-CJiewFjG.js";import{a as ke,d as Ae,f as je,n as Me,s as Ne,t as Pe}from"./skills-api-CMDs_cbJ.js";var Fe=s(`cloud-download`,[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]]),Ie=s(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),Le=s(`pencil-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),Re=s(`power-off`,[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Z=t(),Q=e(n(),1),$=a();function ze(e){return{async install(t){let n;try{n=await e.buildAndOpen(t?.force?{force:!0}:void 0)}catch(e){return{ok:!1,reason:`bridge-error`,message:e instanceof Error?e.message:String(e)}}return n.ok?{ok:!0,path:n.path}:{ok:!1,reason:n.reason,message:n.message}}}}function Be(e={}){let t=e.fetch??globalThis.fetch,n=`${e.apiOrigin??``}/api/install-skill`;return{async install(e){let r;try{r=await t(n,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e?.force?{force:!0}:{})})}catch(e){return{ok:!1,reason:`network-error`,message:e instanceof Error?e.message:String(e)}}if(!r.ok){let e=`HTTP ${r.status}`;try{let t=Ce(await r.json());t&&(e=t)}catch{}return{ok:!1,reason:`http-error`,message:e}}let i;try{i=await r.json()}catch(e){return{ok:!1,reason:`parse-error`,message:e instanceof Error?e.message:`Invalid server response`}}return!i||typeof i.status!=`string`?{ok:!1,reason:`parse-error`,message:`Invalid server response shape`}:i.status===`failed`?{ok:!1,reason:`build-failed`,message:i.buildError??`unknown build failure`}:{ok:!0,path:i.outputPath,handoffWarning:i.handoffError?.message}}}}function Ve(){if(typeof window>`u`)return null;let e=window.okDesktop?.skill;return e?ze(e):Be()}var He=`ok:skill:cowork:installed`,Ue=`1`,We=250,Ge=`/api/skill/install-state`;function Ke(e){return`${He}:v${e}`}var qe=new Map;async function Je(e={},t={}){let n=t.force?`__force__`:`__default__`,r=qe.get(n);if(r)return r;let i=Ye(e,t);return qe.set(n,i),i.finally(()=>{qe.get(n)===i&&qe.delete(n)}),i}async function Ye(e,t){let n=e.installer===void 0?Ve():e.installer,r=Xe(e.storage),i=e.fetchSnapshot??Qe,a=e.serverTimeoutMs??We,o=null;if(!t.force){try{o=await $e(i(),a)}catch(e){console.warn(`[cowork-skill] server install-state check failed; falling through:`,e)}if(o){let e=o.targets[`claude-cowork`]??null;if(e&&e.version===o.currentVersion)return{kind:`already-installed`,source:`server`}}}let s=Ke(o?.currentVersion??e.fallbackSkillVersion??Ze());if(!t.force&&r?.getItem(s)===Ue)return{kind:`already-installed`,source:`local`};if(!n)return{kind:`host-unsupported`};let c=await n.install({force:t.force??!1});if(!c.ok)return{kind:`install-failed`,reason:c.reason,message:c.message};try{r?.setItem(s,Ue)}catch(e){console.warn(`[cowork-skill] storage.setItem failed (guard will not persist):`,e)}return{kind:`installed-now`,path:c.path,handoffWarning:c.handoffWarning}}function Xe(e){if(e!==void 0)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function Ze(){return typeof window>`u`?`unknown`:window.okDesktop?.appVersion??`unknown`}async function Qe(){let e;try{e=await fetch(Ge,{method:`GET`,cache:`no-store`})}catch{return null}if(!e.ok)return null;try{let t=await e.json();return typeof t?.currentVersion==`string`?t:null}catch{return null}}async function $e(e,t){return Promise.race([e,new Promise(e=>{setTimeout(()=>e(null),t)})])}function et(e){return Je({},e)}function tt(){return Je({},{force:!0})}async function nt(e,t){let n;try{n=await t(`/api/handoff`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})}catch(e){return{ok:!1,reason:`dispatch-error`,detail:e instanceof Error?e.message:String(e)}}return n.status===200?{ok:!0}:n.status===404?{ok:!1,reason:`not-installed`,detail:`POST /api/handoff returned 404`}:n.status===422?{ok:!1,reason:`not-installed`,detail:`POST /api/handoff returned ${n.status}`}:{ok:!1,reason:`dispatch-error`,detail:`POST /api/handoff returned ${n.status}`}}async function rt(e,t={}){let n=t.fetch??globalThis.fetch.bind(globalThis);switch(e.target){case`claude-cowork`:return nt({target:`claude-cowork`,url:U({mode:`cowork`},e)},n);case`claude-code`:return nt({target:`claude-code`,url:U({mode:`code`},e)},n);case`codex`:return nt({target:`codex`,url:I(e)},n);case`cursor`:return nt({target:`cursor`,url:K(e),workspacePath:e.projectDir},n);case`copilot`:return{ok:!1,reason:`invalid-payload`,detail:`copilot is terminal-only; launch via requestTerminalLaunch`};case`opencode`:return{ok:!1,reason:`invalid-payload`,detail:`opencode is terminal-only; launch via requestTerminalLaunch`};case`pi`:return{ok:!1,reason:`invalid-payload`,detail:`pi is terminal-only; launch via requestTerminalLaunch`};case`antigravity`:return{ok:!1,reason:`invalid-payload`,detail:`antigravity is terminal-only; launch via requestTerminalLaunch`};case`openclaw`:return{ok:!1,reason:`invalid-payload`,detail:`openclaw is terminal-only; launch via requestTerminalLaunch`};case`hermes`:return{ok:!1,reason:`invalid-payload`,detail:`hermes is terminal-only; launch via requestTerminalLaunch`};default:{let t=e.target;return{ok:!1,reason:`invalid-payload`,detail:`unknown target: ${String(t)}`}}}}async function it(e,t={}){let n=t.okDesktop??(typeof window<`u`?window.okDesktop:void 0);if(n?.shell?.recordHandoff)try{await n.shell.recordHandoff(e)}catch(e){(t.warn??(e=>console.warn(e)))(`[handoff] recordHandoff IPC rejected (telemetry skipped): ${e instanceof Error?e.message:String(e)}`)}}var at=`open-knowledge:agent-thread-launch`;function ot(e,t=typeof window>`u`?new EventTarget:window){t.dispatchEvent(new CustomEvent(at,{detail:e}))}function st(e,t=typeof window>`u`?new EventTarget:window){let n=t=>{let n=t instanceof CustomEvent?t.detail:void 0;n&&typeof n.agentId==`string`&&e(n)};return t.addEventListener(at,n),()=>t.removeEventListener(at,n)}function ct(e){if(!e.docName||!e.workspace)return null;let t=pe(e.docName),{contentDir:n,pathSeparator:r}=e.workspace;return{docContext:{relativePath:t},projectDir:n,docPath:de(n,t,r)}}function lt(e){return e.workspace?.contentDir?{docContext:null,projectDir:e.workspace.contentDir,docPath:``}:null}function ut(e){return e.workspace?.contentDir?{docContext:null,createDescription:e.description,createScenario:e.scenario,createMentions:e.mentions,projectDir:e.workspace.contentDir,docPath:``}:null}function dt(e){return j(e.installUrl).then(()=>void 0)}function ft(e){return!e.workspace?.contentDir||!e.folderRelativePath?null:{docContext:null,folderRelativePath:e.folderRelativePath,projectDir:e.workspace.contentDir,docPath:``}}function pt(e){return!e.workspace?.contentDir||!e.skillName?null:{docContext:null,skill:{name:e.skillName,scope:e.scope},projectDir:e.workspace.contentDir,docPath:``}}function mt(e){if(!e.workspace?.contentDir)return null;let{contentDir:t,pathSeparator:n}=e.workspace;if(e.docName){let r=e.docRelativePath??pe(e.docName),i={scope:`doc`,docRelativePath:r,instruction:e.instruction,mentions:e.mentions};return{docContext:null,compose:e.selection===void 0?i:{...i,selection:e.selection},projectDir:t,docPath:de(t,r,n)}}return e.folderRelativePath?{docContext:null,compose:{scope:`folder`,folderRelativePath:e.folderRelativePath,instruction:e.instruction,mentions:e.mentions},projectDir:t,docPath:``}:{docContext:null,compose:{scope:`project`,instruction:e.instruction,mentions:e.mentions},projectDir:t,docPath:``}}function ht(e){return`Opened in ${e}.`}function gt(e,t=1){return t>=3?`Couldn't reach ${e} — please try again later.`:t===2?`Still couldn't reach ${e} — try one more time?`:`Couldn't reach ${e} — try again?`}function _t(e){return e>=3?null:e===2?`Try one more time`:`Retry`}function vt(e,t,n,r,i){let a=i===void 0?{}:{scope:i};return t.ok?{target:e,host:n,outcome:`ok`,ts:r,...a}:{target:e,host:n,outcome:`error`,ts:r,reason:t.reason,...a}}function yt(e,t,n,r){if(e.scope===`doc`){let i={scope:`doc`,docRelativePath:e.docRelativePath,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r};return e.selection===void 0?i:{...i,selection:e.selection}}return e.scope===`folder`?{scope:`folder`,folderRelativePath:e.folderRelativePath,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r}:{scope:`project`,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r}}function bt(e,t,n,r){return e.compose?z(yt(e.compose,t,n,r)):e.selection?ie({...e.selection,target:t,transport:r}):e.skill?oe(e.skill.name,e.skill.scope,n):e.ask?q(e.ask.relativePath,e.ask.instruction,n,t,r):re(e.docContext===null?e.folderRelativePath?J(e.folderRelativePath,n,e.instruction,r):e.createDescription===void 0?Y(n,e.instruction,r):ne(e.createDescription,n,e.createScenario??`new-project`,e.createMentions??[],r):ee(e.docContext.relativePath,n,e.instruction,r))}function xt(e,t){let n=typeof e.instruction==`string`&&e.instruction.trim()!==``;return e.compose!==void 0||e.createDescription!==void 0||n?`${W} ${bt(e,B[t].handoffTarget,!1,`terminal`)}`:G(e.docContext?.relativePath??null)}function St(e){let t=typeof e.instruction==`string`&&e.instruction.trim()!==``;return e.compose!==void 0||e.createDescription!==void 0||t?`${te} ${bt(e,`claude-code`,!1,`terminal`)}`:ae(e.docContext?.relativePath??null)}function Ct(e){let t=e.docContext?.relativePath;return typeof t!=`string`||t===``?null:t.replace(/\.(md|mdx)$/,``)}function wt(e){let t=[e.compose?.instruction,e.selection?.instruction,e.ask?.instruction,e.createDescription,e.instruction];for(let e of t)if(typeof e==`string`&&e.trim()!==``)return e;return null}function Tt(e,t){ot({agentSource:t?.agent?.source??`registry`,agentId:t?.agent?.id??``,prompt:St(e),docName:Ct(e),titleHint:wt(e)})}async function Et(e,t,n,r=1){if(e===`claude-cowork`&&r===1){let e;try{e=await n.ensureCoworkSkillInstalled()}catch(e){let t=e instanceof Error?e.message:String(e);return n.toast.error(`Couldn't install OpenKnowledge skill — ${t}`),{ok:!1,reason:`dispatch-error`,detail:`install-error: ${t}`}}if(e.kind===`installed-now`)return n.toast.success(`OpenKnowledge skill saved. Upload it in Claude Desktop, then click Cowork again.`),{ok:!0};if(e.kind===`install-failed`){let t=e.message??e.reason;return n.toast.error(`Couldn't install OpenKnowledge skill — ${t}`),{ok:!1,reason:`dispatch-error`,detail:`install-failed: ${t}`}}}let i={target:e,projectDir:t.projectDir,docPath:t.docPath,prompt:bt(t,e,n.autoOpen,`url`)},a=await n.dispatchHandoff(i),o=n.isElectronHost()?`electron`:`web`,s=n.now().toISOString(),c=t.compose,l=vt(e,a,o,s,t.selection!=null||c?.scope===`doc`&&c.selection!==void 0?`selection`:void 0);await n.recordHandoff(l);let u=n.getDisplayName(e);if(a.ok)n.toast.success(ht(u));else{let i=_t(r),a=gt(u,r);i===null?n.toast.error(a):n.toast.error(a,{action:{label:i,onClick:()=>{Et(e,t,n,r+1)}}})}return a}function Dt(e){return O.find(t=>t.id===e)?.displayName??e}function Ot(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function kt(){return{dispatchHandoff:rt,recordHandoff:it,toast:{success:e=>{X.success(e)},error:(e,t)=>{X.error(e,t?{action:t.action}:void 0)}},now:()=>new Date,isElectronHost:()=>Ot(),getDisplayName:Dt,ensureCoworkSkillInstalled:et,autoOpen:!0}}function At(){let e=(0,$.c)(2),{merged:t}=Ee(),n=t?.appearance?.preview?.autoOpen??!0,r;return e[0]===n?r=e[1]:(r={dispatch:(e,t)=>Et(e,t,{...kt(),autoOpen:n}),reinstallCoworkSkill:tt},e[0]=n,e[1]=r),r}var jt=[...new Set(O.flatMap(e=>e.schemes))];function Mt(e,t){let n=t.now?.()??Date.now(),r={};for(let t of O){let i=t.schemes[0],a=i===void 0?void 0:e[i];if(!a){r[t.id]={installed:null};continue}r[t.id]={installed:a.installed,...a.displayName===void 0?{}:{displayName:a.displayName},lastChecked:n}}return r}function Nt(e){return Mt({},e)}async function Pt(e){let t=e.schemes??jt,n=await Promise.all(t.map(async t=>{let n=t.replace(/:$/,``);try{return[t,await e.detectProtocol(n)]}catch{return[t,{installed:!1}]}}));return Object.fromEntries(n)}var Ft=Object.fromEntries(jt.map(e=>[e,{installed:!1}]));async function It(e){let t;try{t=await e.fetch(`/api/installed-agents`,{signal:e.signal,headers:{Accept:`application/json`}})}catch(e){if(e.name===`AbortError`)throw e;return Ft}if(!t.ok)return Ft;let n;try{n=await t.json()}catch{return Ft}if(typeof n!=`object`||!n||Array.isArray(n))return Ft;let r=n,i={};for(let e of jt)i[e]={installed:r[e.replace(/:$/,``)]===!0};return i}function Lt(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(!n||!i||n.installed!==i.installed||n.displayName!==i.displayName)return!1}return!0}function Rt(e){let t=e.throttleMs??1e4,n=!1,r=null,i=null,a={},o=Nt({isElectronHost:e.isElectronHost(),now:e.now}),s=new Set,c=()=>{if(!n)for(let e of s)e(o)},l=()=>{o=Mt(a,{isElectronHost:e.isElectronHost(),now:e.now})};return{probe:async()=>{if(n)return;if(i)return i;if(r!==null&&e.now()-r<t)return;let o=(async()=>{try{let t=await e.probe();if(n)return;let i=!Lt(a,t);a=t,i&&(l(),c()),r=e.now()}catch{}finally{i=null}})();return i=o,o},getTargetStates:()=>o,subscribe:e=>(s.add(e),()=>{s.delete(e)}),cancel:()=>{n=!0,s.clear()}}}function zt(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function Bt(){let e=typeof window<`u`?window.okDesktop:void 0;if(e){let t=t=>e.shell.detectProtocol(t);return{probe:()=>Pt({detectProtocol:t}),isElectronHost:()=>!0,now:Date.now}}let t=globalThis.fetch.bind(globalThis);return{probe:()=>It({fetch:t}),isElectronHost:()=>!1,now:Date.now}}function Vt(){let e=(0,$.c)(5),[t,n]=(0,Q.useState)(Ht),r=(0,Q.useRef)(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=Rt(Bt());r.current=e;let t=e.subscribe(n);e.probe();let i=()=>{e.probe()};return window.addEventListener(`focus`,i),()=>{window.removeEventListener(`focus`,i),t(),e.cancel(),r.current=null}},a=[],e[0]=i,e[1]=a):(i=e[0],a=e[1]),(0,Q.useEffect)(i,a);let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>r.current?.probe()??Promise.resolve(),e[2]=o):o=e[2];let s;return e[3]===t?s=e[4]:(s={states:t,refresh:o},e[3]=t,e[4]=s),s}function Ht(){return Nt({isElectronHost:zt(),now:Date.now})}var Ut=(0,Q.createContext)(null);function Wt(e){let t=(0,$.c)(3),{value:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,Z.jsx)(Ut,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function Gt(){return(0,Q.use)(Ut)}function Kt(e){let t=(0,$.c)(48),{itemName:n,isSubmitting:a,onDelete:s,customTitle:h,customDescription:g,customDetail:_,customConfirmLabel:v,customConfirmLabelBusy:y,children:b}=e,{_:x}=i(),S;t[0]!==x||t[1]!==n?(S=n??x({id:`L3CEC1`}),t[0]=x,t[1]=n,t[2]=S):S=t[2];let C=S,w;t[3]!==x||t[4]!==v?(w=v??x({id:`cnGeoo`}),t[3]=x,t[4]=v,t[5]=w):w=t[5];let T=w,E;t[6]!==x||t[7]!==v||t[8]!==y?(E=y??v??x({id:`s3caR3`}),t[6]=x,t[7]=v,t[8]=y,t[9]=E):E=t[9];let D=E,O;t[10]!==x||t[11]!==h||t[12]!==C?(O=h??x({id:`77SdEP`,values:{itemName:C}}),t[10]=x,t[11]=h,t[12]=C,t[13]=O):O=t[13];let k;t[14]===O?k=t[15]:(k=(0,Z.jsx)(l,{children:O}),t[14]=O,t[15]=k);let A;t[16]!==x||t[17]!==g||t[18]!==C?(A=g??x({id:`16D5Zj`,values:{itemName:C}}),t[16]=x,t[17]=g,t[18]=C,t[19]=A):A=t[19];let j;t[20]===A?j=t[21]:(j=(0,Z.jsx)(c,{className:`whitespace-pre-wrap`,children:A}),t[20]=A,t[21]=j);let M;t[22]===_?M=t[23]:(M=_?(0,Z.jsx)(`p`,{className:`text-muted-foreground text-sm`,"data-testid":`delete-confirmation-detail`,children:_}):null,t[22]=_,t[23]=M);let N;t[24]!==k||t[25]!==j||t[26]!==M?(N=(0,Z.jsxs)(m,{children:[k,j,M]}),t[24]=k,t[25]=j,t[26]=M,t[27]=N):N=t[27];let P;t[28]===b?P=t[29]:(P=b?(0,Z.jsx)(d,{children:b}):null,t[28]=b,t[29]=P);let F;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Z.jsx)(r,{id:`dEgA5A`}),t[30]=F):F=t[30];let I;t[31]===a?I=t[32]:(I=(0,Z.jsx)(p,{asChild:!0,children:(0,Z.jsx)(o,{variant:`outline`,disabled:a,children:F})}),t[31]=a,t[32]=I);let L;t[33]!==T||t[34]!==D||t[35]!==a?(L=a?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(_e,{className:`size-4 animate-spin`}),` `,D]}):T,t[33]=T,t[34]=D,t[35]=a,t[36]=L):L=t[36];let R;t[37]!==a||t[38]!==s||t[39]!==L?(R=(0,Z.jsx)(o,{variant:`destructive`,onClick:s,disabled:a,children:L}),t[37]=a,t[38]=s,t[39]=L,t[40]=R):R=t[40];let z;t[41]!==I||t[42]!==R?(z=(0,Z.jsxs)(f,{children:[I,R]}),t[41]=I,t[42]=R,t[43]=z):z=t[43];let B;return t[44]!==P||t[45]!==z||t[46]!==N?(B=(0,Z.jsxs)(u,{children:[N,P,z]}),t[44]=P,t[45]=z,t[46]=N,t[47]=B):B=t[47],B}function qt(e){return e?Se._({id:`wTcjov`}):null}function Jt(e){let t=(0,$.c)(47),{_:n}=i(),a=fe(),o=Gt(),s=w(),c=E();if(a)return null;let{input:l,installStates:u,dispatch:d,onBeforeLaunch:f}=e,p=l===null,m,h,C,O,j,I,L,R,z,V,U;if(t[0]!==n||t[1]!==d||t[2]!==l||t[3]!==p||t[4]!==u||t[5]!==f||t[6]!==c||t[7]!==s||t[8]!==o){let e=qt(p),i;t[20]===c?i=t[21]:(i=e=>P(c,e.id),t[20]=c,t[21]=i);let a=D.filter(i),w;t[22]===c?w=t[23]:(w=e=>k(c,e.source,e.id,!0,e.supported),t[22]=c,t[23]=w);let E=s.filter(w),F=o?H.filter(e=>M(c,e,o.installedClis)):[];C=a.length>0,O=o!==null&&F.length>0,j=E.length>0,h=_,t[24]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Z.jsxs)(x,{children:[(0,Z.jsx)(ue,{"aria-hidden":`true`}),(0,Z.jsx)(r,{id:`O7_W_a`})]}),t[24]=U):U=t[24],m=v,I=`max-h-80`,L=j?(0,Z.jsxs)(y,{"aria-label":n({id:`vPKX2i`}),children:[(0,Z.jsxs)(b,{className:`flex items-center gap-1.5`,children:[(0,Z.jsx)(r,{id:`RXEbZy`}),(0,Z.jsx)(N,{})]}),E.map(t=>{let i=t.name;return(0,Z.jsxs)(g,{onSelect:()=>{l!==null&&(f?.(),Tt(l,{agent:{source:t.source,id:t.id}}))},disabled:p,"data-testid":`file-tree-open-in-thread-${t.id}`,"aria-label":e?n({id:`gtGQ9S`,values:{agentName:i,hint:e}}):void 0,children:[(0,Z.jsx)(se,{agentId:t.id,iconUrl:t.iconUrl,className:`size-4`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(r,{id:`5PrrYw`,values:{agentName:i}})}),e?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},`${t.source}:${t.id}`)})]}):null,t[25]!==C||t[26]!==O||t[27]!==j?(R=j&&(O||C)?(0,Z.jsx)(S,{}):null,t[25]=C,t[26]=O,t[27]=j,t[28]=R):R=t[28],z=O?(0,Z.jsxs)(y,{"aria-label":n({id:`ALhMYW`}),children:[(0,Z.jsx)(b,{children:(0,Z.jsx)(r,{id:`ALhMYW`})}),F.map(t=>{let{displayName:r}=B[t];return(0,Z.jsxs)(g,{onSelect:()=>{l!==null&&(f?.(),o.launchInTerminal(l,t))},disabled:p,"data-testid":`file-tree-open-in-terminal-${t}`,"aria-label":n(e?{id:`AIn2Yv`,values:{displayName:r,hint:e}}:{id:`QYfQdv`,values:{displayName:r}}),children:[(0,Z.jsx)(A,{id:T(t),"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:r}),e?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t)})]}):null,V=C?(0,Z.jsxs)(Z.Fragment,{children:[O?(0,Z.jsx)(S,{}):null,(0,Z.jsxs)(y,{"aria-label":n({id:`BBqGS9`}),children:[(0,Z.jsx)(b,{children:(0,Z.jsx)(r,{id:`BBqGS9`})}),a.map(t=>{let r=!p,{displayName:i}=t,a=n(e?{id:`1ZpfyB`,values:{displayName:i,hint:e}}:{id:`WqLq6M`,values:{displayName:i}});return(0,Z.jsxs)(g,{disabled:!r,onSelect:()=>{if(l){if(f?.(),u[t.id]?.installed!==!0){dt(t);return}d(t.id,l)}},"data-testid":`file-tree-open-in-${t.id}`,"aria-label":a,children:[(0,Z.jsx)(A,{id:t.id,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:t.displayName}),e?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t.id)})]})]}):null,t[0]=n,t[1]=d,t[2]=l,t[3]=p,t[4]=u,t[5]=f,t[6]=c,t[7]=s,t[8]=o,t[9]=m,t[10]=h,t[11]=C,t[12]=O,t[13]=j,t[14]=I,t[15]=L,t[16]=R,t[17]=z,t[18]=V,t[19]=U}else m=t[9],h=t[10],C=t[11],O=t[12],j=t[13],I=t[14],L=t[15],R=t[16],z=t[17],V=t[18],U=t[19];let W;t[29]!==C||t[30]!==O||t[31]!==j?(W=j||O||C?(0,Z.jsx)(S,{}):null,t[29]=C,t[30]=O,t[31]=j,t[32]=W):W=t[32];let G;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,Z.jsx)(ye,{"aria-hidden":`true`}),t[33]=G):G=t[33];let K;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,Z.jsxs)(g,{onSelect:F,"data-testid":`file-tree-open-in-settings`,children:[G,(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(r,{id:`jRAGrQ`})})]}),t[34]=K):K=t[34];let q;t[35]!==m||t[36]!==I||t[37]!==L||t[38]!==R||t[39]!==z||t[40]!==V||t[41]!==W?(q=(0,Z.jsxs)(m,{className:I,children:[L,R,z,V,W,K]}),t[35]=m,t[36]=I,t[37]=L,t[38]=R,t[39]=z,t[40]=V,t[41]=W,t[42]=q):q=t[42];let J;return t[43]!==h||t[44]!==U||t[45]!==q?(J=(0,Z.jsxs)(h,{children:[U,q]}),t[43]=h,t[44]=U,t[45]=q,t[46]=J):J=t[46],J}function Yt(e){let t=(0,$.c)(8),n=e?.enabled??!0,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={status:`idle`},t[0]=r):r=t[0];let[i,a]=(0,Q.useState)(r),[o,s]=(0,Q.useState)(0),c,l;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=()=>s($t),t=Te(e),n=we(t=>{t.includes(`files`)&&e()});return()=>{t(),n()}},l=[],t[1]=c,t[2]=l):(c=t[1],l=t[2]),(0,Q.useEffect)(c,l);let u;t[3]===n?u=t[4]:(u=()=>{if(!n)return;let e=!1;return a(Qt),fetch(`/api/skills`).then(Xt).then(t=>{if(e)return;let n=R.safeParse(t);if(!n.success){console.error(`[ok-skills] /api/skills response failed schema validation:`,n.error.issues),a({status:`error`,message:`Server returned an incomplete skills response.`});return}a({status:`ready`,data:n.data.skills})}).catch(t=>{e||a({status:`error`,message:t instanceof Error?t.message:String(t)})}),()=>{e=!0}},t[3]=n,t[4]=u);let d;return t[5]!==n||t[6]!==o?(d=[o,n],t[5]=n,t[6]=o,t[7]=d):d=t[7],(0,Q.useEffect)(u,d),i}async function Xt(e){if(!e.ok){let t=await e.json().catch(Zt);throw Error(Ce(t)??`HTTP ${e.status}`)}return e.json()}function Zt(){return null}function Qt(e){return e.status===`ready`?e:{status:`loading`}}function $t(e){return e+1}function en(e){let t=(0,$.c)(16),{skill:n,onOpenChange:r,onDeleted:a}=e,{_:o}=i(),[s,c]=(0,Q.useState)(!1),l;t[0]!==o||t[1]!==a||t[2]!==r?(l=async function(e){c(!0);let t=await Pe(e.scope,e.name);if(c(!1),!t.ok){let{error:e}=t;X.error(o({id:`AtBdnD`,values:{error:e}}));return}X.success(o({id:`h9QFb9`,values:{0:e.name}})),a(),r(!1)},t[0]=o,t[1]=a,t[2]=r,t[3]=l):l=t[3];let u=l,d=n!==null,f;t[4]!==s||t[5]!==r?(f=e=>{!e&&!s&&r(!1)},t[4]=s,t[5]=r,t[6]=f):f=t[6];let p;t[7]!==o||t[8]!==s||t[9]!==u||t[10]!==n?(p=n?(0,Z.jsx)(Kt,{itemName:o({id:`ExUzM4`,values:{0:n.name}}),isSubmitting:s,onDelete:()=>u(n),customDescription:o({id:`E1Da_b`,values:{0:n.path}})}):null,t[7]=o,t[8]=s,t[9]=u,t[10]=n,t[11]=p):p=t[11];let m;return t[12]!==d||t[13]!==f||t[14]!==p?(m=(0,Z.jsx)(h,{open:d,onOpenChange:f,children:p}),t[12]=d,t[13]=f,t[14]=p,t[15]=m):m=t[15],m}function tn(e){let t=(0,$.c)(68),{skill:n,existingNames:a,onOpenChange:s,onRenamed:d}=e,{_:p}=i(),g=n!==null,_=(0,Q.useId)(),[v,y]=(0,Q.useState)(``),[b,x]=(0,Q.useState)(!1),S;t[0]===n?S=t[1]:(S=()=>{n&&y(n.name)},t[0]=n,t[1]=S);let w=n?.scope,T=n?.name,E;if(t[2]!==w||t[3]!==T?(E=[w,T],t[2]=w,t[3]=T,t[4]=E):E=t[4],(0,Q.useEffect)(S,E),!n)return null;let D,O,k,A;t[5]!==a||t[6]!==v||t[7]!==n.name?(k=v.trim(),A=k===n.name,D=k===``||!L.test(k),O=!D&&!A&&a.has(k),t[5]=a,t[6]=v,t[7]=n.name,t[8]=D,t[9]=O,t[10]=k,t[11]=A):(D=t[8],O=t[9],k=t[10],A=t[11]);let j=O,M=!D&&!j&&!A&&!b,N;t[12]!==p||t[13]!==M||t[14]!==s||t[15]!==d||t[16]!==n||t[17]!==k?(N=async function(){if(!n||!M)return;x(!0);let e=await Ne({scope:n.scope,fromName:n.name,toName:k});if(x(!1),!e.ok){X.error(p({id:`zKxoPm`,values:{0:n.name,1:e.error}}));return}X.success(p({id:`dUCQo4`,values:{trimmed:k}})),d?.(k),s(!1)},t[12]=p,t[13]=M,t[14]=s,t[15]=d,t[16]=n,t[17]=k,t[18]=N):N=t[18];let P=N,F;t[19]===s?F=t[20]:(F=e=>e?null:s(!1),t[19]=s,t[20]=F);let I;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Z.jsx)(l,{children:(0,Z.jsx)(r,{id:`dw_3cv`})}),t[21]=I):I=t[21];let R;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,Z.jsxs)(m,{children:[I,(0,Z.jsx)(c,{children:(0,Z.jsx)(r,{id:`R9IDFz`})})]}),t[22]=R):R=t[22];let z;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Z.jsx)(r,{id:`6YtxFj`}),t[23]=z):z=t[23];let B;t[24]===_?B=t[25]:(B=(0,Z.jsx)(C,{htmlFor:_,children:z}),t[24]=_,t[25]=B);let V;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(V=e=>y(e.target.value),t[26]=V):V=t[26];let H;t[27]===P?H=t[28]:(H=e=>{e.key===`Enter`&&P()},t[27]=P,t[28]=H);let U=D||j,W=D&&k!==``||j?`${_}-error`:void 0,G;t[29]!==_||t[30]!==v||t[31]!==H||t[32]!==U||t[33]!==W?(G=(0,Z.jsx)(xe,{id:_,value:v,onChange:V,onKeyDown:H,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,"aria-invalid":U,"aria-describedby":W,className:`font-mono`}),t[29]=_,t[30]=v,t[31]=H,t[32]=U,t[33]=W,t[34]=G):G=t[34];let K;t[35]!==j||t[36]!==_||t[37]!==D||t[38]!==k?(K=D&&k!==``?(0,Z.jsx)(`p`,{id:`${_}-error`,className:`text-xs text-destructive`,children:(0,Z.jsx)(r,{id:`A50vr3`,components:{0:(0,Z.jsx)(`code`,{className:`font-mono`})}})}):j?(0,Z.jsx)(`p`,{id:`${_}-error`,className:`text-xs text-destructive`,children:(0,Z.jsx)(r,{id:`YJ1BTp`})}):null,t[35]=j,t[36]=_,t[37]=D,t[38]=k,t[39]=K):K=t[39];let q;t[40]!==B||t[41]!==G||t[42]!==K?(q=(0,Z.jsxs)(`div`,{className:`space-y-1.5`,children:[B,G,K]}),t[40]=B,t[41]=G,t[42]=K,t[43]=q):q=t[43];let J;t[44]===s?J=t[45]:(J=()=>s(!1),t[44]=s,t[45]=J);let ee;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,Z.jsx)(r,{id:`dEgA5A`}),t[46]=ee):ee=t[46];let Y;t[47]!==b||t[48]!==J?(Y=(0,Z.jsx)(o,{variant:`ghost`,onClick:J,disabled:b,children:ee}),t[47]=b,t[48]=J,t[49]=Y):Y=t[49];let te;t[50]===P?te=t[51]:(te=()=>void P(),t[50]=P,t[51]=te);let ne=!M,re;t[52]===b?re=t[53]:(re=b?(0,Z.jsx)(r,{id:`tHKQ6j`}):(0,Z.jsx)(r,{id:`2wxgft`}),t[52]=b,t[53]=re);let ie;t[54]!==te||t[55]!==ne||t[56]!==re?(ie=(0,Z.jsx)(o,{onClick:te,disabled:ne,children:re}),t[54]=te,t[55]=ne,t[56]=re,t[57]=ie):ie=t[57];let ae;t[58]!==Y||t[59]!==ie?(ae=(0,Z.jsxs)(f,{children:[Y,ie]}),t[58]=Y,t[59]=ie,t[60]=ae):ae=t[60];let oe;t[61]!==q||t[62]!==ae?(oe=(0,Z.jsxs)(u,{children:[R,q,ae]}),t[61]=q,t[62]=ae,t[63]=oe):oe=t[63];let se;return t[64]!==g||t[65]!==oe||t[66]!==F?(se=(0,Z.jsx)(h,{open:g,onOpenChange:F,children:oe}),t[64]=g,t[65]=oe,t[66]=F,t[67]=se):se=t[67],se}function nn(e){let t=(0,$.c)(15),{skill:n,onOpenChange:a,onUpdated:s}=e,{_:g}=i(),[_,v]=(0,Q.useState)(!1),y;t[0]!==g||t[1]!==a||t[2]!==s?(y=async function(e){v(!0);let t=await je({scope:e.scope,name:e.name});v(!1);let n=ce(e.name);if(!t.ok){X.error(g({id:`FRqZ9v`,values:{0:t.error}}));return}X.success(t.checkpointRef?g({id:`My9uXI`,values:{0:t.version,display:n}}):g({id:`mPneVR`,values:{0:t.version,display:n}})),s(),a(!1)},t[0]=g,t[1]=a,t[2]=s,t[3]=y):y=t[3];let b=y,x=n!==null,S;t[4]!==a||t[5]!==_?(S=e=>{!e&&!_&&a(!1)},t[4]=a,t[5]=_,t[6]=S):S=t[6];let C;t[7]!==b||t[8]!==n||t[9]!==_?(C=n?(0,Z.jsxs)(u,{className:`sm:max-w-lg`,children:[(0,Z.jsxs)(m,{children:[(0,Z.jsx)(l,{children:(0,Z.jsx)(r,{id:`iAoh55`,values:{0:ce(n.name)}})}),(0,Z.jsx)(c,{children:n.installedVersion?(0,Z.jsx)(r,{id:`47EXvY`,values:{0:n.bundledVersion??``,1:n.installedVersion}}):(0,Z.jsx)(r,{id:`nD7Fx9`,values:{0:n.bundledVersion??``}})})]}),(0,Z.jsx)(d,{}),(0,Z.jsxs)(f,{children:[(0,Z.jsx)(p,{asChild:!0,children:(0,Z.jsx)(o,{variant:`outline`,disabled:_,children:(0,Z.jsx)(r,{id:`dEgA5A`})})}),(0,Z.jsx)(o,{onClick:()=>void b(n),disabled:_,children:_?(0,Z.jsx)(r,{id:`JL3si7`}):(0,Z.jsx)(r,{id:`EkH9pt`})})]})]}):null,t[7]=b,t[8]=n,t[9]=_,t[10]=C):C=t[10];let w;return t[11]!==x||t[12]!==S||t[13]!==C?(w=(0,Z.jsx)(h,{open:x,onOpenChange:S,children:C}),t[11]=x,t[12]=S,t[13]=C,t[14]=w):w=t[14],w}function rn(){let e=(0,$.c)(30),{_:t}=i(),[n,r]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(null),[l,u]=(0,Q.useState)(null),d;e[0]===t?d=e[1]:(d=async function(e,n){u(e.name);let r=await ke({scope:e.scope,name:e.name,...n?{targets:[...n]}:{}});if(u(null),!r.ok)return X.error(t({id:`Mj8R8K`,values:{0:r.error}})),r;let i=an,a=new Set(r.hosts),o=r.hosts.filter(t=>!e.hosts.includes(t)),s=e.hosts.filter(e=>!a.has(e)),c=e=>{let t=r.warningCodes.indexOf(e);return t>=0?r.warnings[t]:void 0},l=c(`no-targets`);if(l)return X.warning(l),r;if(o.length>0){let e=c(`scripts-present`);e&&X.warning(e)}return r.hosts.length===0?X.success(t({id:`0LBDjY`,values:{0:e.name}})):o.length>0&&s.length===0?X.success(t({id:`PPFQ3o`,values:{0:e.name,1:i(o)}})):s.length>0&&o.length===0?X.success(t({id:`OOIVJo`,values:{0:e.name,1:i(s)}})):o.length>0&&s.length>0?X.success(t({id:`OxplNM`,values:{0:e.name,1:i(o),2:i(s)}})):X.success(t({id:`wDgmsr`,values:{0:e.name,1:i(r.hosts)}})),r},e[0]=t,e[1]=d);let f=d,p;e[2]===t?p=e[3]:(p=async function(e){u(e.name);let n=await Ae({scope:e.scope,name:e.name});return u(null),n.ok?X.success(t({id:`0LBDjY`,values:{0:e.name}})):X.error(t({id:`nJq7et`,values:{0:n.error}})),n},e[2]=t,e[3]=p);let m=p,h;e[4]===t?h=e[5]:(h=async function(e,n){let r=await Me({scope:e.scope,name:e.name,existingNames:n});if(!r.ok){X.error(t({id:`UPjaXD`,values:{0:e.name,1:r.error}}));return}X.success(t({id:`0g7rCZ`,values:{0:r.name}}))},e[4]=t,e[5]=h);let g=h,_,v;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>{e||r(null)},v=()=>r(null),e[6]=_,e[7]=v):(_=e[6],v=e[7]);let y;e[8]===n?y=e[9]:(y=(0,Z.jsx)(en,{skill:n,onOpenChange:_,onDeleted:v}),e[8]=n,e[9]=y);let b=a?.skill??null,x=a?.existingNames??sn,S,C;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=e=>{e||o(null)},C=()=>o(null),e[10]=S,e[11]=C):(S=e[10],C=e[11]);let w;e[12]!==b||e[13]!==x?(w=(0,Z.jsx)(tn,{skill:b,existingNames:x,onOpenChange:S,onRenamed:C}),e[12]=b,e[13]=x,e[14]=w):w=e[14];let T,E;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(T=e=>{e||c(null)},E=()=>c(null),e[15]=T,e[16]=E):(T=e[15],E=e[16]);let D;e[17]===s?D=e[18]:(D=(0,Z.jsx)(nn,{skill:s,onOpenChange:T,onUpdated:E}),e[17]=s,e[18]=D);let O;e[19]!==w||e[20]!==D||e[21]!==y?(O=(0,Z.jsxs)(Z.Fragment,{children:[y,w,D]}),e[19]=w,e[20]=D,e[21]=y,e[22]=O):O=e[22];let k=O,A;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(A=(e,t)=>o({skill:e,existingNames:t}),e[23]=A):A=e[23];let j;return e[24]!==k||e[25]!==g||e[26]!==f||e[27]!==l||e[28]!==m?(j={installingName:l,install:f,uninstall:m,duplicate:g,requestDelete:r,requestRename:A,requestUpdate:c,dialogs:k},e[24]=k,e[25]=g,e[26]=f,e[27]=l,e[28]=m,e[29]=j):j=e[29],j}function an(e){return e.map(on).join(`, `)}function on(e){return V[e]??e}var sn=new Set;function cn(e){let t=(0,$.c)(19),{skill:n,onEdit:i,onInstall:a,onUninstall:o,onDelete:s}=e,c,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(me,{"aria-hidden":!0}),l=(0,Z.jsx)(r,{id:`ePK91l`}),t[0]=c,t[1]=l):(c=t[0],l=t[1]);let u;t[2]===i?u=t[3]:(u=(0,Z.jsxs)(g,{onSelect:i,children:[c,l]}),t[2]=i,t[3]=u);let d;t[4]!==a||t[5]!==n.installed?(d=a&&!n.installed?(0,Z.jsxs)(g,{onSelect:a,children:[(0,Z.jsx)(Fe,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`TKQ7K-`})]}):null,t[4]=a,t[5]=n.installed,t[6]=d):d=t[6];let f;t[7]!==o||t[8]!==n.installed?(f=n.installed?(0,Z.jsxs)(g,{onSelect:o,children:[(0,Z.jsx)(Re,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`fo0VXg`})]}):null,t[7]=o,t[8]=n.installed,t[9]=f):f=t[9];let p,m;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsx)(be,{"aria-hidden":!0}),m=(0,Z.jsx)(r,{id:`cnGeoo`}),t[10]=p,t[11]=m):(p=t[10],m=t[11]);let h;t[12]===s?h=t[13]:(h=(0,Z.jsxs)(g,{variant:`destructive`,onSelect:s,children:[p,m]}),t[12]=s,t[13]=h);let _;return t[14]!==u||t[15]!==d||t[16]!==f||t[17]!==h?(_=(0,Z.jsxs)(Z.Fragment,{children:[u,d,f,h]}),t[14]=u,t[15]=d,t[16]=f,t[17]=h,t[18]=_):_=t[18],_}function ln(e){let t=(0,$.c)(94),{skill:n,actions:a,existingNames:o}=e,{_:s}=i(),c=De(),l=Vt().states,{dispatch:u}=At(),d=typeof window<`u`?window.okDesktop:void 0,f=n.absolutePath,p;t[0]===s?p=t[1]:(p=async function(e){try{await Oe(e),X.success(s({id:`SXCSQd`}))}catch{X.error(s({id:`cRHuuI`}))}},t[0]=s,t[1]=p);let m=p;if(n.managed){let e,i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(b,{className:`flex items-center gap-1.5 text-muted-foreground`,children:[(0,Z.jsx)(Ie,{className:`size-3`,"aria-hidden":!0}),(0,Z.jsx)(r,{id:`VITWk5`})]}),i=(0,Z.jsx)(S,{}),t[2]=e,t[3]=i):(e=t[2],i=t[3]);let a;t[4]===f?a=t[5]:(a=d&&f?(0,Z.jsxs)(g,{onSelect:()=>void d.shell.showItemInFolder(f),children:[(0,Z.jsx)(ge,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`LtSYdi`})]}):null,t[4]=f,t[5]=a);let o;t[6]!==n.name||t[7]!==n.scope||t[8]!==c?(o=pt({skillName:n.name,scope:n.scope,workspace:c}),t[6]=n.name,t[7]=n.scope,t[8]=c,t[9]=o):o=t[9];let s;t[10]!==u||t[11]!==l||t[12]!==o?(s=(0,Z.jsx)(Jt,{input:o,installStates:l,isElectronHost:d!=null,dispatch:u}),t[10]=u,t[11]=l,t[12]=o,t[13]=s):s=t[13];let p;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsxs)(x,{children:[(0,Z.jsx)(he,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`zd00pH`})]}),t[14]=p):p=t[14];let h;t[15]!==f||t[16]!==m?(h=f?(0,Z.jsx)(g,{onSelect:()=>void m(f),children:(0,Z.jsx)(r,{id:`z2funE`})}):null,t[15]=f,t[16]=m,t[17]=h):h=t[17];let y;t[18]!==m||t[19]!==n.path?(y=()=>void m(n.path),t[18]=m,t[19]=n.path,t[20]=y):y=t[20];let C;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Z.jsx)(r,{id:`xloBjn`}),t[21]=C):C=t[21];let w;t[22]===y?w=t[23]:(w=(0,Z.jsx)(g,{onSelect:y,children:C}),t[22]=y,t[23]=w);let T;t[24]!==w||t[25]!==h?(T=(0,Z.jsxs)(_,{children:[p,(0,Z.jsxs)(v,{children:[h,w]})]}),t[24]=w,t[25]=h,t[26]=T):T=t[26];let E;return t[27]!==T||t[28]!==a||t[29]!==s?(E=(0,Z.jsxs)(Z.Fragment,{children:[e,i,a,s,T]}),t[27]=T,t[28]=a,t[29]=s,t[30]=E):E=t[30],E}let h;t[31]===f?h=t[32]:(h=d&&f?(0,Z.jsxs)(g,{onSelect:()=>void d.shell.showItemInFolder(f),children:[(0,Z.jsx)(ge,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`LtSYdi`})]}):null,t[31]=f,t[32]=h);let y;t[33]!==n.name||t[34]!==n.scope||t[35]!==c?(y=pt({skillName:n.name,scope:n.scope,workspace:c}),t[33]=n.name,t[34]=n.scope,t[35]=c,t[36]=y):y=t[36];let C;t[37]!==u||t[38]!==l||t[39]!==y?(C=(0,Z.jsx)(Jt,{input:y,installStates:l,isElectronHost:d!=null,dispatch:u}),t[37]=u,t[38]=l,t[39]=y,t[40]=C):C=t[40];let w;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsxs)(x,{children:[(0,Z.jsx)(he,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`zd00pH`})]}),t[41]=w):w=t[41];let T;t[42]!==f||t[43]!==m?(T=f?(0,Z.jsx)(g,{onSelect:()=>void m(f),children:(0,Z.jsx)(r,{id:`z2funE`})}):null,t[42]=f,t[43]=m,t[44]=T):T=t[44];let E;t[45]!==m||t[46]!==n.path?(E=()=>void m(n.path),t[45]=m,t[46]=n.path,t[47]=E):E=t[47];let D;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Z.jsx)(r,{id:`xloBjn`}),t[48]=D):D=t[48];let O;t[49]===E?O=t[50]:(O=(0,Z.jsx)(g,{onSelect:E,children:D}),t[49]=E,t[50]=O);let k;t[51]!==T||t[52]!==O?(k=(0,Z.jsxs)(_,{children:[w,(0,Z.jsxs)(v,{children:[T,O]})]}),t[51]=T,t[52]=O,t[53]=k):k=t[53];let A;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Z.jsx)(S,{}),t[54]=A):A=t[54];let j;t[55]!==a||t[56]!==o||t[57]!==n?(j=()=>void a.duplicate(n,o),t[55]=a,t[56]=o,t[57]=n,t[58]=j):j=t[58];let M,N;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Z.jsx)(le,{"aria-hidden":!0}),N=(0,Z.jsx)(r,{id:`euc6Ns`}),t[59]=M,t[60]=N):(M=t[59],N=t[60]);let P;t[61]===j?P=t[62]:(P=(0,Z.jsxs)(g,{onSelect:j,children:[M,N]}),t[61]=j,t[62]=P);let F;t[63]!==a||t[64]!==o||t[65]!==n?(F=()=>a.requestRename(n,o),t[63]=a,t[64]=o,t[65]=n,t[66]=F):F=t[66];let I,L;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Z.jsx)(Le,{"aria-hidden":!0}),L=(0,Z.jsx)(r,{id:`2wxgft`}),t[67]=I,t[68]=L):(I=t[67],L=t[68]);let R;t[69]===F?R=t[70]:(R=(0,Z.jsxs)(g,{onSelect:F,children:[I,L]}),t[69]=F,t[70]=R);let z;t[71]!==a||t[72]!==n?(z=n.updateAvailable?(0,Z.jsxs)(g,{onSelect:()=>a.requestUpdate(n),children:[(0,Z.jsx)(ve,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`6g2jsp`})]}):null,t[71]=a,t[72]=n,t[73]=z):z=t[73];let B;t[74]!==a||t[75]!==n?(B=n.installed?(0,Z.jsxs)(g,{onSelect:()=>void a.uninstall(n),children:[(0,Z.jsx)(Re,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`fo0VXg`})]}):(0,Z.jsxs)(g,{onSelect:()=>void a.install(n),children:[(0,Z.jsx)(Fe,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`TKQ7K-`})]}),t[74]=a,t[75]=n,t[76]=B):B=t[76];let V;t[77]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,Z.jsx)(S,{}),t[77]=V):V=t[77];let H;t[78]!==a||t[79]!==n?(H=()=>a.requestDelete(n),t[78]=a,t[79]=n,t[80]=H):H=t[80];let U,W;t[81]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Z.jsx)(be,{"aria-hidden":!0}),W=(0,Z.jsx)(r,{id:`cnGeoo`}),t[81]=U,t[82]=W):(U=t[81],W=t[82]);let G;t[83]===H?G=t[84]:(G=(0,Z.jsxs)(g,{variant:`destructive`,onSelect:H,children:[U,W]}),t[83]=H,t[84]=G);let K;return t[85]!==k||t[86]!==P||t[87]!==R||t[88]!==h||t[89]!==z||t[90]!==B||t[91]!==G||t[92]!==C?(K=(0,Z.jsxs)(Z.Fragment,{children:[h,C,k,A,P,R,z,B,V,G]}),t[85]=k,t[86]=P,t[87]=R,t[88]=h,t[89]=z,t[90]=B,t[91]=G,t[92]=C,t[93]=K):K=t[93],K}export{Fe as C,Ie as S,Dt as _,Jt as a,At as b,Gt as c,ut as d,ft as f,xt as g,pt as h,Yt as i,Vt as l,lt as m,ln as n,Kt as o,ct as p,rn as r,Wt as s,cn as t,mt as u,dt as v,st as x,Tt as y};
1
+ import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./jsx-runtime-DyiINK0N.js";import{t as n}from"./react-JNybMug3.js";import{n as r,r as i}from"./dist-DBENJeML.js";import{t as a}from"./compiler-runtime-dQcBxOhn.js";import{n as o,t as s}from"./createLucideIcon-B5DNg1uu.js";import{a as c,c as l,i as u,n as d,o as f,r as p,s as m,t as h}from"./dialog-DRODJICP.js";import{a as g,d as _,f as v,i as y,o as b,p as x,u as S}from"./dropdown-menu-DRE6Cf6z.js";import{t as C}from"./label-JTxG9Ey8.js";import{O as w,a as T,f as E,h as D,m as O,n as k,o as A,p as j,r as M,s as N,t as P,y as F}from"./agent-visibility-D2Mr5Jzk.js";import{$t as I,Et as L,Ft as R,Kt as z,Lt as B,P as V,Rt as H,Zt as U,at as W,bn as G,en as K,fn as q,gn as J,hn as ee,mn as Y,ot as te,pn as ne,ri as re,vn as ie,xn as ae,yn as oe}from"./dist-zc03OoUp.js";import{t as se}from"./RegisteredAgentIcon-DlQ6ljJ9.js";import{a as ce,d as le,l as ue,n as de,r as fe,t as pe,u as me}from"./workspace-paths-d9KyFHx6.js";import{t as he}from"./copy-KDLrwpxR.js";import{t as ge}from"./folder-open-CIPS7Z9_.js";import{t as _e}from"./loader-circle-DZ77ilW4.js";import{t as ve}from"./refresh-cw-GU9JlNjj.js";import{t as ye}from"./sliders-horizontal-D06S3vlK.js";import{t as be}from"./trash-2-CArNk5fT.js";import{n as X}from"./dist-pkKXEO3Q.js";import{t as xe}from"./input-CKzGvkzv.js";import{t as Se}from"./dist-DEkFedhu.js";import{t as Ce}from"./parse-api-error-QYXuYti5.js";import{o as we,s as Te}from"./documents-events-BTDcCELc.js";import{n as Ee}from"./config-context-DOXKMLrN.js";import{t as De}from"./use-workspace-CqL9iZdQ.js";import{n as Oe}from"./clipboard-adapter-CJiewFjG.js";import{a as ke,d as Ae,f as je,n as Me,s as Ne,t as Pe}from"./skills-api-BOe6s3mN.js";var Fe=s(`cloud-download`,[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]]),Ie=s(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),Le=s(`pencil-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),Re=s(`power-off`,[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Z=t(),Q=e(n(),1),$=a();function ze(e){return{async install(t){let n;try{n=await e.buildAndOpen(t?.force?{force:!0}:void 0)}catch(e){return{ok:!1,reason:`bridge-error`,message:e instanceof Error?e.message:String(e)}}return n.ok?{ok:!0,path:n.path}:{ok:!1,reason:n.reason,message:n.message}}}}function Be(e={}){let t=e.fetch??globalThis.fetch,n=`${e.apiOrigin??``}/api/install-skill`;return{async install(e){let r;try{r=await t(n,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e?.force?{force:!0}:{})})}catch(e){return{ok:!1,reason:`network-error`,message:e instanceof Error?e.message:String(e)}}if(!r.ok){let e=`HTTP ${r.status}`;try{let t=Ce(await r.json());t&&(e=t)}catch{}return{ok:!1,reason:`http-error`,message:e}}let i;try{i=await r.json()}catch(e){return{ok:!1,reason:`parse-error`,message:e instanceof Error?e.message:`Invalid server response`}}return!i||typeof i.status!=`string`?{ok:!1,reason:`parse-error`,message:`Invalid server response shape`}:i.status===`failed`?{ok:!1,reason:`build-failed`,message:i.buildError??`unknown build failure`}:{ok:!0,path:i.outputPath,handoffWarning:i.handoffError?.message}}}}function Ve(){if(typeof window>`u`)return null;let e=window.okDesktop?.skill;return e?ze(e):Be()}var He=`ok:skill:cowork:installed`,Ue=`1`,We=250,Ge=`/api/skill/install-state`;function Ke(e){return`${He}:v${e}`}var qe=new Map;async function Je(e={},t={}){let n=t.force?`__force__`:`__default__`,r=qe.get(n);if(r)return r;let i=Ye(e,t);return qe.set(n,i),i.finally(()=>{qe.get(n)===i&&qe.delete(n)}),i}async function Ye(e,t){let n=e.installer===void 0?Ve():e.installer,r=Xe(e.storage),i=e.fetchSnapshot??Qe,a=e.serverTimeoutMs??We,o=null;if(!t.force){try{o=await $e(i(),a)}catch(e){console.warn(`[cowork-skill] server install-state check failed; falling through:`,e)}if(o){let e=o.targets[`claude-cowork`]??null;if(e&&e.version===o.currentVersion)return{kind:`already-installed`,source:`server`}}}let s=Ke(o?.currentVersion??e.fallbackSkillVersion??Ze());if(!t.force&&r?.getItem(s)===Ue)return{kind:`already-installed`,source:`local`};if(!n)return{kind:`host-unsupported`};let c=await n.install({force:t.force??!1});if(!c.ok)return{kind:`install-failed`,reason:c.reason,message:c.message};try{r?.setItem(s,Ue)}catch(e){console.warn(`[cowork-skill] storage.setItem failed (guard will not persist):`,e)}return{kind:`installed-now`,path:c.path,handoffWarning:c.handoffWarning}}function Xe(e){if(e!==void 0)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function Ze(){return typeof window>`u`?`unknown`:window.okDesktop?.appVersion??`unknown`}async function Qe(){let e;try{e=await fetch(Ge,{method:`GET`,cache:`no-store`})}catch{return null}if(!e.ok)return null;try{let t=await e.json();return typeof t?.currentVersion==`string`?t:null}catch{return null}}async function $e(e,t){return Promise.race([e,new Promise(e=>{setTimeout(()=>e(null),t)})])}function et(e){return Je({},e)}function tt(){return Je({},{force:!0})}async function nt(e,t){let n;try{n=await t(`/api/handoff`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})}catch(e){return{ok:!1,reason:`dispatch-error`,detail:e instanceof Error?e.message:String(e)}}return n.status===200?{ok:!0}:n.status===404?{ok:!1,reason:`not-installed`,detail:`POST /api/handoff returned 404`}:n.status===422?{ok:!1,reason:`not-installed`,detail:`POST /api/handoff returned ${n.status}`}:{ok:!1,reason:`dispatch-error`,detail:`POST /api/handoff returned ${n.status}`}}async function rt(e,t={}){let n=t.fetch??globalThis.fetch.bind(globalThis);switch(e.target){case`claude-cowork`:return nt({target:`claude-cowork`,url:U({mode:`cowork`},e)},n);case`claude-code`:return nt({target:`claude-code`,url:U({mode:`code`},e)},n);case`codex`:return nt({target:`codex`,url:I(e)},n);case`cursor`:return nt({target:`cursor`,url:K(e),workspacePath:e.projectDir},n);case`copilot`:return{ok:!1,reason:`invalid-payload`,detail:`copilot is terminal-only; launch via requestTerminalLaunch`};case`opencode`:return{ok:!1,reason:`invalid-payload`,detail:`opencode is terminal-only; launch via requestTerminalLaunch`};case`pi`:return{ok:!1,reason:`invalid-payload`,detail:`pi is terminal-only; launch via requestTerminalLaunch`};case`antigravity`:return{ok:!1,reason:`invalid-payload`,detail:`antigravity is terminal-only; launch via requestTerminalLaunch`};case`openclaw`:return{ok:!1,reason:`invalid-payload`,detail:`openclaw is terminal-only; launch via requestTerminalLaunch`};case`hermes`:return{ok:!1,reason:`invalid-payload`,detail:`hermes is terminal-only; launch via requestTerminalLaunch`};default:{let t=e.target;return{ok:!1,reason:`invalid-payload`,detail:`unknown target: ${String(t)}`}}}}async function it(e,t={}){let n=t.okDesktop??(typeof window<`u`?window.okDesktop:void 0);if(n?.shell?.recordHandoff)try{await n.shell.recordHandoff(e)}catch(e){(t.warn??(e=>console.warn(e)))(`[handoff] recordHandoff IPC rejected (telemetry skipped): ${e instanceof Error?e.message:String(e)}`)}}var at=`open-knowledge:agent-thread-launch`;function ot(e,t=typeof window>`u`?new EventTarget:window){t.dispatchEvent(new CustomEvent(at,{detail:e}))}function st(e,t=typeof window>`u`?new EventTarget:window){let n=t=>{let n=t instanceof CustomEvent?t.detail:void 0;n&&typeof n.agentId==`string`&&e(n)};return t.addEventListener(at,n),()=>t.removeEventListener(at,n)}function ct(e){if(!e.docName||!e.workspace)return null;let t=pe(e.docName),{contentDir:n,pathSeparator:r}=e.workspace;return{docContext:{relativePath:t},projectDir:n,docPath:de(n,t,r)}}function lt(e){return e.workspace?.contentDir?{docContext:null,projectDir:e.workspace.contentDir,docPath:``}:null}function ut(e){return e.workspace?.contentDir?{docContext:null,createDescription:e.description,createScenario:e.scenario,createMentions:e.mentions,projectDir:e.workspace.contentDir,docPath:``}:null}function dt(e){return j(e.installUrl).then(()=>void 0)}function ft(e){return!e.workspace?.contentDir||!e.folderRelativePath?null:{docContext:null,folderRelativePath:e.folderRelativePath,projectDir:e.workspace.contentDir,docPath:``}}function pt(e){return!e.workspace?.contentDir||!e.skillName?null:{docContext:null,skill:{name:e.skillName,scope:e.scope},projectDir:e.workspace.contentDir,docPath:``}}function mt(e){if(!e.workspace?.contentDir)return null;let{contentDir:t,pathSeparator:n}=e.workspace;if(e.docName){let r=e.docRelativePath??pe(e.docName),i={scope:`doc`,docRelativePath:r,instruction:e.instruction,mentions:e.mentions};return{docContext:null,compose:e.selection===void 0?i:{...i,selection:e.selection},projectDir:t,docPath:de(t,r,n)}}return e.folderRelativePath?{docContext:null,compose:{scope:`folder`,folderRelativePath:e.folderRelativePath,instruction:e.instruction,mentions:e.mentions},projectDir:t,docPath:``}:{docContext:null,compose:{scope:`project`,instruction:e.instruction,mentions:e.mentions},projectDir:t,docPath:``}}function ht(e){return`Opened in ${e}.`}function gt(e,t=1){return t>=3?`Couldn't reach ${e} — please try again later.`:t===2?`Still couldn't reach ${e} — try one more time?`:`Couldn't reach ${e} — try again?`}function _t(e){return e>=3?null:e===2?`Try one more time`:`Retry`}function vt(e,t,n,r,i){let a=i===void 0?{}:{scope:i};return t.ok?{target:e,host:n,outcome:`ok`,ts:r,...a}:{target:e,host:n,outcome:`error`,ts:r,reason:t.reason,...a}}function yt(e,t,n,r){if(e.scope===`doc`){let i={scope:`doc`,docRelativePath:e.docRelativePath,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r};return e.selection===void 0?i:{...i,selection:e.selection}}return e.scope===`folder`?{scope:`folder`,folderRelativePath:e.folderRelativePath,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r}:{scope:`project`,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r}}function bt(e,t,n,r){return e.compose?z(yt(e.compose,t,n,r)):e.selection?ie({...e.selection,target:t,transport:r}):e.skill?oe(e.skill.name,e.skill.scope,n):e.ask?q(e.ask.relativePath,e.ask.instruction,n,t,r):re(e.docContext===null?e.folderRelativePath?J(e.folderRelativePath,n,e.instruction,r):e.createDescription===void 0?Y(n,e.instruction,r):ne(e.createDescription,n,e.createScenario??`new-project`,e.createMentions??[],r):ee(e.docContext.relativePath,n,e.instruction,r))}function xt(e,t){let n=typeof e.instruction==`string`&&e.instruction.trim()!==``;return e.compose!==void 0||e.createDescription!==void 0||n?`${W} ${bt(e,B[t].handoffTarget,!1,`terminal`)}`:G(e.docContext?.relativePath??null)}function St(e){let t=typeof e.instruction==`string`&&e.instruction.trim()!==``;return e.compose!==void 0||e.createDescription!==void 0||t?`${te} ${bt(e,`claude-code`,!1,`terminal`)}`:ae(e.docContext?.relativePath??null)}function Ct(e){let t=e.docContext?.relativePath;return typeof t!=`string`||t===``?null:t.replace(/\.(md|mdx)$/,``)}function wt(e){let t=[e.compose?.instruction,e.selection?.instruction,e.ask?.instruction,e.createDescription,e.instruction];for(let e of t)if(typeof e==`string`&&e.trim()!==``)return e;return null}function Tt(e,t){ot({agentSource:t?.agent?.source??`registry`,agentId:t?.agent?.id??``,prompt:St(e),docName:Ct(e),titleHint:wt(e)})}async function Et(e,t,n,r=1){if(e===`claude-cowork`&&r===1){let e;try{e=await n.ensureCoworkSkillInstalled()}catch(e){let t=e instanceof Error?e.message:String(e);return n.toast.error(`Couldn't install OpenKnowledge skill — ${t}`),{ok:!1,reason:`dispatch-error`,detail:`install-error: ${t}`}}if(e.kind===`installed-now`)return n.toast.success(`OpenKnowledge skill saved. Upload it in Claude Desktop, then click Cowork again.`),{ok:!0};if(e.kind===`install-failed`){let t=e.message??e.reason;return n.toast.error(`Couldn't install OpenKnowledge skill — ${t}`),{ok:!1,reason:`dispatch-error`,detail:`install-failed: ${t}`}}}let i={target:e,projectDir:t.projectDir,docPath:t.docPath,prompt:bt(t,e,n.autoOpen,`url`)},a=await n.dispatchHandoff(i),o=n.isElectronHost()?`electron`:`web`,s=n.now().toISOString(),c=t.compose,l=vt(e,a,o,s,t.selection!=null||c?.scope===`doc`&&c.selection!==void 0?`selection`:void 0);await n.recordHandoff(l);let u=n.getDisplayName(e);if(a.ok)n.toast.success(ht(u));else{let i=_t(r),a=gt(u,r);i===null?n.toast.error(a):n.toast.error(a,{action:{label:i,onClick:()=>{Et(e,t,n,r+1)}}})}return a}function Dt(e){return O.find(t=>t.id===e)?.displayName??e}function Ot(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function kt(){return{dispatchHandoff:rt,recordHandoff:it,toast:{success:e=>{X.success(e)},error:(e,t)=>{X.error(e,t?{action:t.action}:void 0)}},now:()=>new Date,isElectronHost:()=>Ot(),getDisplayName:Dt,ensureCoworkSkillInstalled:et,autoOpen:!0}}function At(){let e=(0,$.c)(2),{merged:t}=Ee(),n=t?.appearance?.preview?.autoOpen??!0,r;return e[0]===n?r=e[1]:(r={dispatch:(e,t)=>Et(e,t,{...kt(),autoOpen:n}),reinstallCoworkSkill:tt},e[0]=n,e[1]=r),r}var jt=[...new Set(O.flatMap(e=>e.schemes))];function Mt(e,t){let n=t.now?.()??Date.now(),r={};for(let t of O){let i=t.schemes[0],a=i===void 0?void 0:e[i];if(!a){r[t.id]={installed:null};continue}r[t.id]={installed:a.installed,...a.displayName===void 0?{}:{displayName:a.displayName},lastChecked:n}}return r}function Nt(e){return Mt({},e)}async function Pt(e){let t=e.schemes??jt,n=await Promise.all(t.map(async t=>{let n=t.replace(/:$/,``);try{return[t,await e.detectProtocol(n)]}catch{return[t,{installed:!1}]}}));return Object.fromEntries(n)}var Ft=Object.fromEntries(jt.map(e=>[e,{installed:!1}]));async function It(e){let t;try{t=await e.fetch(`/api/installed-agents`,{signal:e.signal,headers:{Accept:`application/json`}})}catch(e){if(e.name===`AbortError`)throw e;return Ft}if(!t.ok)return Ft;let n;try{n=await t.json()}catch{return Ft}if(typeof n!=`object`||!n||Array.isArray(n))return Ft;let r=n,i={};for(let e of jt)i[e]={installed:r[e.replace(/:$/,``)]===!0};return i}function Lt(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(!n||!i||n.installed!==i.installed||n.displayName!==i.displayName)return!1}return!0}function Rt(e){let t=e.throttleMs??1e4,n=!1,r=null,i=null,a={},o=Nt({isElectronHost:e.isElectronHost(),now:e.now}),s=new Set,c=()=>{if(!n)for(let e of s)e(o)},l=()=>{o=Mt(a,{isElectronHost:e.isElectronHost(),now:e.now})};return{probe:async()=>{if(n)return;if(i)return i;if(r!==null&&e.now()-r<t)return;let o=(async()=>{try{let t=await e.probe();if(n)return;let i=!Lt(a,t);a=t,i&&(l(),c()),r=e.now()}catch{}finally{i=null}})();return i=o,o},getTargetStates:()=>o,subscribe:e=>(s.add(e),()=>{s.delete(e)}),cancel:()=>{n=!0,s.clear()}}}function zt(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function Bt(){let e=typeof window<`u`?window.okDesktop:void 0;if(e){let t=t=>e.shell.detectProtocol(t);return{probe:()=>Pt({detectProtocol:t}),isElectronHost:()=>!0,now:Date.now}}let t=globalThis.fetch.bind(globalThis);return{probe:()=>It({fetch:t}),isElectronHost:()=>!1,now:Date.now}}function Vt(){let e=(0,$.c)(5),[t,n]=(0,Q.useState)(Ht),r=(0,Q.useRef)(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=Rt(Bt());r.current=e;let t=e.subscribe(n);e.probe();let i=()=>{e.probe()};return window.addEventListener(`focus`,i),()=>{window.removeEventListener(`focus`,i),t(),e.cancel(),r.current=null}},a=[],e[0]=i,e[1]=a):(i=e[0],a=e[1]),(0,Q.useEffect)(i,a);let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>r.current?.probe()??Promise.resolve(),e[2]=o):o=e[2];let s;return e[3]===t?s=e[4]:(s={states:t,refresh:o},e[3]=t,e[4]=s),s}function Ht(){return Nt({isElectronHost:zt(),now:Date.now})}var Ut=(0,Q.createContext)(null);function Wt(e){let t=(0,$.c)(3),{value:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,Z.jsx)(Ut,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function Gt(){return(0,Q.use)(Ut)}function Kt(e){let t=(0,$.c)(48),{itemName:n,isSubmitting:a,onDelete:s,customTitle:h,customDescription:g,customDetail:_,customConfirmLabel:v,customConfirmLabelBusy:y,children:b}=e,{_:x}=i(),S;t[0]!==x||t[1]!==n?(S=n??x({id:`L3CEC1`}),t[0]=x,t[1]=n,t[2]=S):S=t[2];let C=S,w;t[3]!==x||t[4]!==v?(w=v??x({id:`cnGeoo`}),t[3]=x,t[4]=v,t[5]=w):w=t[5];let T=w,E;t[6]!==x||t[7]!==v||t[8]!==y?(E=y??v??x({id:`s3caR3`}),t[6]=x,t[7]=v,t[8]=y,t[9]=E):E=t[9];let D=E,O;t[10]!==x||t[11]!==h||t[12]!==C?(O=h??x({id:`77SdEP`,values:{itemName:C}}),t[10]=x,t[11]=h,t[12]=C,t[13]=O):O=t[13];let k;t[14]===O?k=t[15]:(k=(0,Z.jsx)(l,{children:O}),t[14]=O,t[15]=k);let A;t[16]!==x||t[17]!==g||t[18]!==C?(A=g??x({id:`16D5Zj`,values:{itemName:C}}),t[16]=x,t[17]=g,t[18]=C,t[19]=A):A=t[19];let j;t[20]===A?j=t[21]:(j=(0,Z.jsx)(c,{className:`whitespace-pre-wrap`,children:A}),t[20]=A,t[21]=j);let M;t[22]===_?M=t[23]:(M=_?(0,Z.jsx)(`p`,{className:`text-muted-foreground text-sm`,"data-testid":`delete-confirmation-detail`,children:_}):null,t[22]=_,t[23]=M);let N;t[24]!==k||t[25]!==j||t[26]!==M?(N=(0,Z.jsxs)(m,{children:[k,j,M]}),t[24]=k,t[25]=j,t[26]=M,t[27]=N):N=t[27];let P;t[28]===b?P=t[29]:(P=b?(0,Z.jsx)(d,{children:b}):null,t[28]=b,t[29]=P);let F;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Z.jsx)(r,{id:`dEgA5A`}),t[30]=F):F=t[30];let I;t[31]===a?I=t[32]:(I=(0,Z.jsx)(p,{asChild:!0,children:(0,Z.jsx)(o,{variant:`outline`,disabled:a,children:F})}),t[31]=a,t[32]=I);let L;t[33]!==T||t[34]!==D||t[35]!==a?(L=a?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(_e,{className:`size-4 animate-spin`}),` `,D]}):T,t[33]=T,t[34]=D,t[35]=a,t[36]=L):L=t[36];let R;t[37]!==a||t[38]!==s||t[39]!==L?(R=(0,Z.jsx)(o,{variant:`destructive`,onClick:s,disabled:a,children:L}),t[37]=a,t[38]=s,t[39]=L,t[40]=R):R=t[40];let z;t[41]!==I||t[42]!==R?(z=(0,Z.jsxs)(f,{children:[I,R]}),t[41]=I,t[42]=R,t[43]=z):z=t[43];let B;return t[44]!==P||t[45]!==z||t[46]!==N?(B=(0,Z.jsxs)(u,{children:[N,P,z]}),t[44]=P,t[45]=z,t[46]=N,t[47]=B):B=t[47],B}function qt(e){return e?Se._({id:`wTcjov`}):null}function Jt(e){let t=(0,$.c)(47),{_:n}=i(),a=fe(),o=Gt(),s=w(),c=E();if(a)return null;let{input:l,installStates:u,dispatch:d,onBeforeLaunch:f}=e,p=l===null,m,h,C,O,j,I,L,R,z,V,U;if(t[0]!==n||t[1]!==d||t[2]!==l||t[3]!==p||t[4]!==u||t[5]!==f||t[6]!==c||t[7]!==s||t[8]!==o){let e=qt(p),i;t[20]===c?i=t[21]:(i=e=>P(c,e.id),t[20]=c,t[21]=i);let a=D.filter(i),w;t[22]===c?w=t[23]:(w=e=>k(c,e.source,e.id,!0,e.supported),t[22]=c,t[23]=w);let E=s.filter(w),F=o?H.filter(e=>M(c,e,o.installedClis)):[];C=a.length>0,O=o!==null&&F.length>0,j=E.length>0,h=_,t[24]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Z.jsxs)(x,{children:[(0,Z.jsx)(ue,{"aria-hidden":`true`}),(0,Z.jsx)(r,{id:`O7_W_a`})]}),t[24]=U):U=t[24],m=v,I=`max-h-80`,L=j?(0,Z.jsxs)(y,{"aria-label":n({id:`vPKX2i`}),children:[(0,Z.jsxs)(b,{className:`flex items-center gap-1.5`,children:[(0,Z.jsx)(r,{id:`RXEbZy`}),(0,Z.jsx)(N,{})]}),E.map(t=>{let i=t.name;return(0,Z.jsxs)(g,{onSelect:()=>{l!==null&&(f?.(),Tt(l,{agent:{source:t.source,id:t.id}}))},disabled:p,"data-testid":`file-tree-open-in-thread-${t.id}`,"aria-label":e?n({id:`gtGQ9S`,values:{agentName:i,hint:e}}):void 0,children:[(0,Z.jsx)(se,{agentId:t.id,iconUrl:t.iconUrl,className:`size-4`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(r,{id:`5PrrYw`,values:{agentName:i}})}),e?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},`${t.source}:${t.id}`)})]}):null,t[25]!==C||t[26]!==O||t[27]!==j?(R=j&&(O||C)?(0,Z.jsx)(S,{}):null,t[25]=C,t[26]=O,t[27]=j,t[28]=R):R=t[28],z=O?(0,Z.jsxs)(y,{"aria-label":n({id:`ALhMYW`}),children:[(0,Z.jsx)(b,{children:(0,Z.jsx)(r,{id:`ALhMYW`})}),F.map(t=>{let{displayName:r}=B[t];return(0,Z.jsxs)(g,{onSelect:()=>{l!==null&&(f?.(),o.launchInTerminal(l,t))},disabled:p,"data-testid":`file-tree-open-in-terminal-${t}`,"aria-label":n(e?{id:`AIn2Yv`,values:{displayName:r,hint:e}}:{id:`QYfQdv`,values:{displayName:r}}),children:[(0,Z.jsx)(A,{id:T(t),"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:r}),e?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t)})]}):null,V=C?(0,Z.jsxs)(Z.Fragment,{children:[O?(0,Z.jsx)(S,{}):null,(0,Z.jsxs)(y,{"aria-label":n({id:`BBqGS9`}),children:[(0,Z.jsx)(b,{children:(0,Z.jsx)(r,{id:`BBqGS9`})}),a.map(t=>{let r=!p,{displayName:i}=t,a=n(e?{id:`1ZpfyB`,values:{displayName:i,hint:e}}:{id:`WqLq6M`,values:{displayName:i}});return(0,Z.jsxs)(g,{disabled:!r,onSelect:()=>{if(l){if(f?.(),u[t.id]?.installed!==!0){dt(t);return}d(t.id,l)}},"data-testid":`file-tree-open-in-${t.id}`,"aria-label":a,children:[(0,Z.jsx)(A,{id:t.id,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:t.displayName}),e?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t.id)})]})]}):null,t[0]=n,t[1]=d,t[2]=l,t[3]=p,t[4]=u,t[5]=f,t[6]=c,t[7]=s,t[8]=o,t[9]=m,t[10]=h,t[11]=C,t[12]=O,t[13]=j,t[14]=I,t[15]=L,t[16]=R,t[17]=z,t[18]=V,t[19]=U}else m=t[9],h=t[10],C=t[11],O=t[12],j=t[13],I=t[14],L=t[15],R=t[16],z=t[17],V=t[18],U=t[19];let W;t[29]!==C||t[30]!==O||t[31]!==j?(W=j||O||C?(0,Z.jsx)(S,{}):null,t[29]=C,t[30]=O,t[31]=j,t[32]=W):W=t[32];let G;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,Z.jsx)(ye,{"aria-hidden":`true`}),t[33]=G):G=t[33];let K;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,Z.jsxs)(g,{onSelect:F,"data-testid":`file-tree-open-in-settings`,children:[G,(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(r,{id:`jRAGrQ`})})]}),t[34]=K):K=t[34];let q;t[35]!==m||t[36]!==I||t[37]!==L||t[38]!==R||t[39]!==z||t[40]!==V||t[41]!==W?(q=(0,Z.jsxs)(m,{className:I,children:[L,R,z,V,W,K]}),t[35]=m,t[36]=I,t[37]=L,t[38]=R,t[39]=z,t[40]=V,t[41]=W,t[42]=q):q=t[42];let J;return t[43]!==h||t[44]!==U||t[45]!==q?(J=(0,Z.jsxs)(h,{children:[U,q]}),t[43]=h,t[44]=U,t[45]=q,t[46]=J):J=t[46],J}function Yt(e){let t=(0,$.c)(8),n=e?.enabled??!0,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={status:`idle`},t[0]=r):r=t[0];let[i,a]=(0,Q.useState)(r),[o,s]=(0,Q.useState)(0),c,l;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=()=>s($t),t=Te(e),n=we(t=>{t.includes(`files`)&&e()});return()=>{t(),n()}},l=[],t[1]=c,t[2]=l):(c=t[1],l=t[2]),(0,Q.useEffect)(c,l);let u;t[3]===n?u=t[4]:(u=()=>{if(!n)return;let e=!1;return a(Qt),fetch(`/api/skills`).then(Xt).then(t=>{if(e)return;let n=R.safeParse(t);if(!n.success){console.error(`[ok-skills] /api/skills response failed schema validation:`,n.error.issues),a({status:`error`,message:`Server returned an incomplete skills response.`});return}a({status:`ready`,data:n.data.skills})}).catch(t=>{e||a({status:`error`,message:t instanceof Error?t.message:String(t)})}),()=>{e=!0}},t[3]=n,t[4]=u);let d;return t[5]!==n||t[6]!==o?(d=[o,n],t[5]=n,t[6]=o,t[7]=d):d=t[7],(0,Q.useEffect)(u,d),i}async function Xt(e){if(!e.ok){let t=await e.json().catch(Zt);throw Error(Ce(t)??`HTTP ${e.status}`)}return e.json()}function Zt(){return null}function Qt(e){return e.status===`ready`?e:{status:`loading`}}function $t(e){return e+1}function en(e){let t=(0,$.c)(16),{skill:n,onOpenChange:r,onDeleted:a}=e,{_:o}=i(),[s,c]=(0,Q.useState)(!1),l;t[0]!==o||t[1]!==a||t[2]!==r?(l=async function(e){c(!0);let t=await Pe(e.scope,e.name);if(c(!1),!t.ok){let{error:e}=t;X.error(o({id:`AtBdnD`,values:{error:e}}));return}X.success(o({id:`h9QFb9`,values:{0:e.name}})),a(),r(!1)},t[0]=o,t[1]=a,t[2]=r,t[3]=l):l=t[3];let u=l,d=n!==null,f;t[4]!==s||t[5]!==r?(f=e=>{!e&&!s&&r(!1)},t[4]=s,t[5]=r,t[6]=f):f=t[6];let p;t[7]!==o||t[8]!==s||t[9]!==u||t[10]!==n?(p=n?(0,Z.jsx)(Kt,{itemName:o({id:`ExUzM4`,values:{0:n.name}}),isSubmitting:s,onDelete:()=>u(n),customDescription:o({id:`E1Da_b`,values:{0:n.path}})}):null,t[7]=o,t[8]=s,t[9]=u,t[10]=n,t[11]=p):p=t[11];let m;return t[12]!==d||t[13]!==f||t[14]!==p?(m=(0,Z.jsx)(h,{open:d,onOpenChange:f,children:p}),t[12]=d,t[13]=f,t[14]=p,t[15]=m):m=t[15],m}function tn(e){let t=(0,$.c)(68),{skill:n,existingNames:a,onOpenChange:s,onRenamed:d}=e,{_:p}=i(),g=n!==null,_=(0,Q.useId)(),[v,y]=(0,Q.useState)(``),[b,x]=(0,Q.useState)(!1),S;t[0]===n?S=t[1]:(S=()=>{n&&y(n.name)},t[0]=n,t[1]=S);let w=n?.scope,T=n?.name,E;if(t[2]!==w||t[3]!==T?(E=[w,T],t[2]=w,t[3]=T,t[4]=E):E=t[4],(0,Q.useEffect)(S,E),!n)return null;let D,O,k,A;t[5]!==a||t[6]!==v||t[7]!==n.name?(k=v.trim(),A=k===n.name,D=k===``||!L.test(k),O=!D&&!A&&a.has(k),t[5]=a,t[6]=v,t[7]=n.name,t[8]=D,t[9]=O,t[10]=k,t[11]=A):(D=t[8],O=t[9],k=t[10],A=t[11]);let j=O,M=!D&&!j&&!A&&!b,N;t[12]!==p||t[13]!==M||t[14]!==s||t[15]!==d||t[16]!==n||t[17]!==k?(N=async function(){if(!n||!M)return;x(!0);let e=await Ne({scope:n.scope,fromName:n.name,toName:k});if(x(!1),!e.ok){X.error(p({id:`zKxoPm`,values:{0:n.name,1:e.error}}));return}X.success(p({id:`dUCQo4`,values:{trimmed:k}})),d?.(k),s(!1)},t[12]=p,t[13]=M,t[14]=s,t[15]=d,t[16]=n,t[17]=k,t[18]=N):N=t[18];let P=N,F;t[19]===s?F=t[20]:(F=e=>e?null:s(!1),t[19]=s,t[20]=F);let I;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Z.jsx)(l,{children:(0,Z.jsx)(r,{id:`dw_3cv`})}),t[21]=I):I=t[21];let R;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,Z.jsxs)(m,{children:[I,(0,Z.jsx)(c,{children:(0,Z.jsx)(r,{id:`R9IDFz`})})]}),t[22]=R):R=t[22];let z;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Z.jsx)(r,{id:`6YtxFj`}),t[23]=z):z=t[23];let B;t[24]===_?B=t[25]:(B=(0,Z.jsx)(C,{htmlFor:_,children:z}),t[24]=_,t[25]=B);let V;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(V=e=>y(e.target.value),t[26]=V):V=t[26];let H;t[27]===P?H=t[28]:(H=e=>{e.key===`Enter`&&P()},t[27]=P,t[28]=H);let U=D||j,W=D&&k!==``||j?`${_}-error`:void 0,G;t[29]!==_||t[30]!==v||t[31]!==H||t[32]!==U||t[33]!==W?(G=(0,Z.jsx)(xe,{id:_,value:v,onChange:V,onKeyDown:H,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,"aria-invalid":U,"aria-describedby":W,className:`font-mono`}),t[29]=_,t[30]=v,t[31]=H,t[32]=U,t[33]=W,t[34]=G):G=t[34];let K;t[35]!==j||t[36]!==_||t[37]!==D||t[38]!==k?(K=D&&k!==``?(0,Z.jsx)(`p`,{id:`${_}-error`,className:`text-xs text-destructive`,children:(0,Z.jsx)(r,{id:`A50vr3`,components:{0:(0,Z.jsx)(`code`,{className:`font-mono`})}})}):j?(0,Z.jsx)(`p`,{id:`${_}-error`,className:`text-xs text-destructive`,children:(0,Z.jsx)(r,{id:`YJ1BTp`})}):null,t[35]=j,t[36]=_,t[37]=D,t[38]=k,t[39]=K):K=t[39];let q;t[40]!==B||t[41]!==G||t[42]!==K?(q=(0,Z.jsxs)(`div`,{className:`space-y-1.5`,children:[B,G,K]}),t[40]=B,t[41]=G,t[42]=K,t[43]=q):q=t[43];let J;t[44]===s?J=t[45]:(J=()=>s(!1),t[44]=s,t[45]=J);let ee;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,Z.jsx)(r,{id:`dEgA5A`}),t[46]=ee):ee=t[46];let Y;t[47]!==b||t[48]!==J?(Y=(0,Z.jsx)(o,{variant:`ghost`,onClick:J,disabled:b,children:ee}),t[47]=b,t[48]=J,t[49]=Y):Y=t[49];let te;t[50]===P?te=t[51]:(te=()=>void P(),t[50]=P,t[51]=te);let ne=!M,re;t[52]===b?re=t[53]:(re=b?(0,Z.jsx)(r,{id:`tHKQ6j`}):(0,Z.jsx)(r,{id:`2wxgft`}),t[52]=b,t[53]=re);let ie;t[54]!==te||t[55]!==ne||t[56]!==re?(ie=(0,Z.jsx)(o,{onClick:te,disabled:ne,children:re}),t[54]=te,t[55]=ne,t[56]=re,t[57]=ie):ie=t[57];let ae;t[58]!==Y||t[59]!==ie?(ae=(0,Z.jsxs)(f,{children:[Y,ie]}),t[58]=Y,t[59]=ie,t[60]=ae):ae=t[60];let oe;t[61]!==q||t[62]!==ae?(oe=(0,Z.jsxs)(u,{children:[R,q,ae]}),t[61]=q,t[62]=ae,t[63]=oe):oe=t[63];let se;return t[64]!==g||t[65]!==oe||t[66]!==F?(se=(0,Z.jsx)(h,{open:g,onOpenChange:F,children:oe}),t[64]=g,t[65]=oe,t[66]=F,t[67]=se):se=t[67],se}function nn(e){let t=(0,$.c)(15),{skill:n,onOpenChange:a,onUpdated:s}=e,{_:g}=i(),[_,v]=(0,Q.useState)(!1),y;t[0]!==g||t[1]!==a||t[2]!==s?(y=async function(e){v(!0);let t=await je({scope:e.scope,name:e.name});v(!1);let n=ce(e.name);if(!t.ok){X.error(g({id:`FRqZ9v`,values:{0:t.error}}));return}X.success(t.checkpointRef?g({id:`My9uXI`,values:{0:t.version,display:n}}):g({id:`mPneVR`,values:{0:t.version,display:n}})),s(),a(!1)},t[0]=g,t[1]=a,t[2]=s,t[3]=y):y=t[3];let b=y,x=n!==null,S;t[4]!==a||t[5]!==_?(S=e=>{!e&&!_&&a(!1)},t[4]=a,t[5]=_,t[6]=S):S=t[6];let C;t[7]!==b||t[8]!==n||t[9]!==_?(C=n?(0,Z.jsxs)(u,{className:`sm:max-w-lg`,children:[(0,Z.jsxs)(m,{children:[(0,Z.jsx)(l,{children:(0,Z.jsx)(r,{id:`iAoh55`,values:{0:ce(n.name)}})}),(0,Z.jsx)(c,{children:n.installedVersion?(0,Z.jsx)(r,{id:`47EXvY`,values:{0:n.bundledVersion??``,1:n.installedVersion}}):(0,Z.jsx)(r,{id:`nD7Fx9`,values:{0:n.bundledVersion??``}})})]}),(0,Z.jsx)(d,{}),(0,Z.jsxs)(f,{children:[(0,Z.jsx)(p,{asChild:!0,children:(0,Z.jsx)(o,{variant:`outline`,disabled:_,children:(0,Z.jsx)(r,{id:`dEgA5A`})})}),(0,Z.jsx)(o,{onClick:()=>void b(n),disabled:_,children:_?(0,Z.jsx)(r,{id:`JL3si7`}):(0,Z.jsx)(r,{id:`EkH9pt`})})]})]}):null,t[7]=b,t[8]=n,t[9]=_,t[10]=C):C=t[10];let w;return t[11]!==x||t[12]!==S||t[13]!==C?(w=(0,Z.jsx)(h,{open:x,onOpenChange:S,children:C}),t[11]=x,t[12]=S,t[13]=C,t[14]=w):w=t[14],w}function rn(){let e=(0,$.c)(30),{_:t}=i(),[n,r]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(null),[l,u]=(0,Q.useState)(null),d;e[0]===t?d=e[1]:(d=async function(e,n){u(e.name);let r=await ke({scope:e.scope,name:e.name,...n?{targets:[...n]}:{}});if(u(null),!r.ok)return X.error(t({id:`Mj8R8K`,values:{0:r.error}})),r;let i=an,a=new Set(r.hosts),o=r.hosts.filter(t=>!e.hosts.includes(t)),s=e.hosts.filter(e=>!a.has(e)),c=e=>{let t=r.warningCodes.indexOf(e);return t>=0?r.warnings[t]:void 0},l=c(`no-targets`);if(l)return X.warning(l),r;if(o.length>0){let e=c(`scripts-present`);e&&X.warning(e)}return r.hosts.length===0?X.success(t({id:`0LBDjY`,values:{0:e.name}})):o.length>0&&s.length===0?X.success(t({id:`PPFQ3o`,values:{0:e.name,1:i(o)}})):s.length>0&&o.length===0?X.success(t({id:`OOIVJo`,values:{0:e.name,1:i(s)}})):o.length>0&&s.length>0?X.success(t({id:`OxplNM`,values:{0:e.name,1:i(o),2:i(s)}})):X.success(t({id:`wDgmsr`,values:{0:e.name,1:i(r.hosts)}})),r},e[0]=t,e[1]=d);let f=d,p;e[2]===t?p=e[3]:(p=async function(e){u(e.name);let n=await Ae({scope:e.scope,name:e.name});return u(null),n.ok?X.success(t({id:`0LBDjY`,values:{0:e.name}})):X.error(t({id:`nJq7et`,values:{0:n.error}})),n},e[2]=t,e[3]=p);let m=p,h;e[4]===t?h=e[5]:(h=async function(e,n){let r=await Me({scope:e.scope,name:e.name,existingNames:n});if(!r.ok){X.error(t({id:`UPjaXD`,values:{0:e.name,1:r.error}}));return}X.success(t({id:`0g7rCZ`,values:{0:r.name}}))},e[4]=t,e[5]=h);let g=h,_,v;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>{e||r(null)},v=()=>r(null),e[6]=_,e[7]=v):(_=e[6],v=e[7]);let y;e[8]===n?y=e[9]:(y=(0,Z.jsx)(en,{skill:n,onOpenChange:_,onDeleted:v}),e[8]=n,e[9]=y);let b=a?.skill??null,x=a?.existingNames??sn,S,C;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=e=>{e||o(null)},C=()=>o(null),e[10]=S,e[11]=C):(S=e[10],C=e[11]);let w;e[12]!==b||e[13]!==x?(w=(0,Z.jsx)(tn,{skill:b,existingNames:x,onOpenChange:S,onRenamed:C}),e[12]=b,e[13]=x,e[14]=w):w=e[14];let T,E;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(T=e=>{e||c(null)},E=()=>c(null),e[15]=T,e[16]=E):(T=e[15],E=e[16]);let D;e[17]===s?D=e[18]:(D=(0,Z.jsx)(nn,{skill:s,onOpenChange:T,onUpdated:E}),e[17]=s,e[18]=D);let O;e[19]!==w||e[20]!==D||e[21]!==y?(O=(0,Z.jsxs)(Z.Fragment,{children:[y,w,D]}),e[19]=w,e[20]=D,e[21]=y,e[22]=O):O=e[22];let k=O,A;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(A=(e,t)=>o({skill:e,existingNames:t}),e[23]=A):A=e[23];let j;return e[24]!==k||e[25]!==g||e[26]!==f||e[27]!==l||e[28]!==m?(j={installingName:l,install:f,uninstall:m,duplicate:g,requestDelete:r,requestRename:A,requestUpdate:c,dialogs:k},e[24]=k,e[25]=g,e[26]=f,e[27]=l,e[28]=m,e[29]=j):j=e[29],j}function an(e){return e.map(on).join(`, `)}function on(e){return V[e]??e}var sn=new Set;function cn(e){let t=(0,$.c)(19),{skill:n,onEdit:i,onInstall:a,onUninstall:o,onDelete:s}=e,c,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(me,{"aria-hidden":!0}),l=(0,Z.jsx)(r,{id:`ePK91l`}),t[0]=c,t[1]=l):(c=t[0],l=t[1]);let u;t[2]===i?u=t[3]:(u=(0,Z.jsxs)(g,{onSelect:i,children:[c,l]}),t[2]=i,t[3]=u);let d;t[4]!==a||t[5]!==n.installed?(d=a&&!n.installed?(0,Z.jsxs)(g,{onSelect:a,children:[(0,Z.jsx)(Fe,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`TKQ7K-`})]}):null,t[4]=a,t[5]=n.installed,t[6]=d):d=t[6];let f;t[7]!==o||t[8]!==n.installed?(f=n.installed?(0,Z.jsxs)(g,{onSelect:o,children:[(0,Z.jsx)(Re,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`fo0VXg`})]}):null,t[7]=o,t[8]=n.installed,t[9]=f):f=t[9];let p,m;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsx)(be,{"aria-hidden":!0}),m=(0,Z.jsx)(r,{id:`cnGeoo`}),t[10]=p,t[11]=m):(p=t[10],m=t[11]);let h;t[12]===s?h=t[13]:(h=(0,Z.jsxs)(g,{variant:`destructive`,onSelect:s,children:[p,m]}),t[12]=s,t[13]=h);let _;return t[14]!==u||t[15]!==d||t[16]!==f||t[17]!==h?(_=(0,Z.jsxs)(Z.Fragment,{children:[u,d,f,h]}),t[14]=u,t[15]=d,t[16]=f,t[17]=h,t[18]=_):_=t[18],_}function ln(e){let t=(0,$.c)(94),{skill:n,actions:a,existingNames:o}=e,{_:s}=i(),c=De(),l=Vt().states,{dispatch:u}=At(),d=typeof window<`u`?window.okDesktop:void 0,f=n.absolutePath,p;t[0]===s?p=t[1]:(p=async function(e){try{await Oe(e),X.success(s({id:`SXCSQd`}))}catch{X.error(s({id:`cRHuuI`}))}},t[0]=s,t[1]=p);let m=p;if(n.managed){let e,i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(b,{className:`flex items-center gap-1.5 text-muted-foreground`,children:[(0,Z.jsx)(Ie,{className:`size-3`,"aria-hidden":!0}),(0,Z.jsx)(r,{id:`VITWk5`})]}),i=(0,Z.jsx)(S,{}),t[2]=e,t[3]=i):(e=t[2],i=t[3]);let a;t[4]===f?a=t[5]:(a=d&&f?(0,Z.jsxs)(g,{onSelect:()=>void d.shell.showItemInFolder(f),children:[(0,Z.jsx)(ge,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`LtSYdi`})]}):null,t[4]=f,t[5]=a);let o;t[6]!==n.name||t[7]!==n.scope||t[8]!==c?(o=pt({skillName:n.name,scope:n.scope,workspace:c}),t[6]=n.name,t[7]=n.scope,t[8]=c,t[9]=o):o=t[9];let s;t[10]!==u||t[11]!==l||t[12]!==o?(s=(0,Z.jsx)(Jt,{input:o,installStates:l,isElectronHost:d!=null,dispatch:u}),t[10]=u,t[11]=l,t[12]=o,t[13]=s):s=t[13];let p;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsxs)(x,{children:[(0,Z.jsx)(he,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`zd00pH`})]}),t[14]=p):p=t[14];let h;t[15]!==f||t[16]!==m?(h=f?(0,Z.jsx)(g,{onSelect:()=>void m(f),children:(0,Z.jsx)(r,{id:`z2funE`})}):null,t[15]=f,t[16]=m,t[17]=h):h=t[17];let y;t[18]!==m||t[19]!==n.path?(y=()=>void m(n.path),t[18]=m,t[19]=n.path,t[20]=y):y=t[20];let C;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Z.jsx)(r,{id:`xloBjn`}),t[21]=C):C=t[21];let w;t[22]===y?w=t[23]:(w=(0,Z.jsx)(g,{onSelect:y,children:C}),t[22]=y,t[23]=w);let T;t[24]!==w||t[25]!==h?(T=(0,Z.jsxs)(_,{children:[p,(0,Z.jsxs)(v,{children:[h,w]})]}),t[24]=w,t[25]=h,t[26]=T):T=t[26];let E;return t[27]!==T||t[28]!==a||t[29]!==s?(E=(0,Z.jsxs)(Z.Fragment,{children:[e,i,a,s,T]}),t[27]=T,t[28]=a,t[29]=s,t[30]=E):E=t[30],E}let h;t[31]===f?h=t[32]:(h=d&&f?(0,Z.jsxs)(g,{onSelect:()=>void d.shell.showItemInFolder(f),children:[(0,Z.jsx)(ge,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`LtSYdi`})]}):null,t[31]=f,t[32]=h);let y;t[33]!==n.name||t[34]!==n.scope||t[35]!==c?(y=pt({skillName:n.name,scope:n.scope,workspace:c}),t[33]=n.name,t[34]=n.scope,t[35]=c,t[36]=y):y=t[36];let C;t[37]!==u||t[38]!==l||t[39]!==y?(C=(0,Z.jsx)(Jt,{input:y,installStates:l,isElectronHost:d!=null,dispatch:u}),t[37]=u,t[38]=l,t[39]=y,t[40]=C):C=t[40];let w;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsxs)(x,{children:[(0,Z.jsx)(he,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`zd00pH`})]}),t[41]=w):w=t[41];let T;t[42]!==f||t[43]!==m?(T=f?(0,Z.jsx)(g,{onSelect:()=>void m(f),children:(0,Z.jsx)(r,{id:`z2funE`})}):null,t[42]=f,t[43]=m,t[44]=T):T=t[44];let E;t[45]!==m||t[46]!==n.path?(E=()=>void m(n.path),t[45]=m,t[46]=n.path,t[47]=E):E=t[47];let D;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Z.jsx)(r,{id:`xloBjn`}),t[48]=D):D=t[48];let O;t[49]===E?O=t[50]:(O=(0,Z.jsx)(g,{onSelect:E,children:D}),t[49]=E,t[50]=O);let k;t[51]!==T||t[52]!==O?(k=(0,Z.jsxs)(_,{children:[w,(0,Z.jsxs)(v,{children:[T,O]})]}),t[51]=T,t[52]=O,t[53]=k):k=t[53];let A;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Z.jsx)(S,{}),t[54]=A):A=t[54];let j;t[55]!==a||t[56]!==o||t[57]!==n?(j=()=>void a.duplicate(n,o),t[55]=a,t[56]=o,t[57]=n,t[58]=j):j=t[58];let M,N;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Z.jsx)(le,{"aria-hidden":!0}),N=(0,Z.jsx)(r,{id:`euc6Ns`}),t[59]=M,t[60]=N):(M=t[59],N=t[60]);let P;t[61]===j?P=t[62]:(P=(0,Z.jsxs)(g,{onSelect:j,children:[M,N]}),t[61]=j,t[62]=P);let F;t[63]!==a||t[64]!==o||t[65]!==n?(F=()=>a.requestRename(n,o),t[63]=a,t[64]=o,t[65]=n,t[66]=F):F=t[66];let I,L;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Z.jsx)(Le,{"aria-hidden":!0}),L=(0,Z.jsx)(r,{id:`2wxgft`}),t[67]=I,t[68]=L):(I=t[67],L=t[68]);let R;t[69]===F?R=t[70]:(R=(0,Z.jsxs)(g,{onSelect:F,children:[I,L]}),t[69]=F,t[70]=R);let z;t[71]!==a||t[72]!==n?(z=n.updateAvailable?(0,Z.jsxs)(g,{onSelect:()=>a.requestUpdate(n),children:[(0,Z.jsx)(ve,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`6g2jsp`})]}):null,t[71]=a,t[72]=n,t[73]=z):z=t[73];let B;t[74]!==a||t[75]!==n?(B=n.installed?(0,Z.jsxs)(g,{onSelect:()=>void a.uninstall(n),children:[(0,Z.jsx)(Re,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`fo0VXg`})]}):(0,Z.jsxs)(g,{onSelect:()=>void a.install(n),children:[(0,Z.jsx)(Fe,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`TKQ7K-`})]}),t[74]=a,t[75]=n,t[76]=B):B=t[76];let V;t[77]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,Z.jsx)(S,{}),t[77]=V):V=t[77];let H;t[78]!==a||t[79]!==n?(H=()=>a.requestDelete(n),t[78]=a,t[79]=n,t[80]=H):H=t[80];let U,W;t[81]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Z.jsx)(be,{"aria-hidden":!0}),W=(0,Z.jsx)(r,{id:`cnGeoo`}),t[81]=U,t[82]=W):(U=t[81],W=t[82]);let G;t[83]===H?G=t[84]:(G=(0,Z.jsxs)(g,{variant:`destructive`,onSelect:H,children:[U,W]}),t[83]=H,t[84]=G);let K;return t[85]!==k||t[86]!==P||t[87]!==R||t[88]!==h||t[89]!==z||t[90]!==B||t[91]!==G||t[92]!==C?(K=(0,Z.jsxs)(Z.Fragment,{children:[h,C,k,A,P,R,z,B,V,G]}),t[85]=k,t[86]=P,t[87]=R,t[88]=h,t[89]=z,t[90]=B,t[91]=G,t[92]=C,t[93]=K):K=t[93],K}export{Fe as C,Ie as S,Dt as _,Jt as a,At as b,Gt as c,ut as d,ft as f,xt as g,pt as h,Yt as i,Vt as l,lt as m,ln as n,Kt as o,ct as p,rn as r,Wt as s,cn as t,mt as u,dt as v,st as x,Tt as y};
@@ -1 +1 @@
1
- import{t as e}from"./parse-api-error-QYXuYti5.js";import{r as t}from"./documents-events-Bd2Tt95I.js";async function n(t){return e(await t.json().catch(()=>null))??`HTTP ${t.status}`}async function r(e){try{let r=await fetch(`/api/skill`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.ok)return{ok:!1,error:await n(r)};let i=await r.json().catch(()=>null);return t(),{ok:!0,created:i?.created??!1,warnings:i?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function i(e){try{let r=await fetch(`/api/skill-file`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.ok)return{ok:!1,error:await n(r)};let i=await r.json().catch(()=>null);return t(),{ok:!0,created:i?.created??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function a(){try{let e=await fetch(`/api/skills/management`);return e.ok?await e.json():null}catch{return null}}async function o(e){try{return(await fetch(`/api/skills/management`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({manageEditorSkills:e})})).ok?(t(),!0):!1}catch{return!1}}function s(e,t){let n=`${e}-copy`;if(!t.has(n))return n;for(let n=2;n<1e3;n+=1){let r=`${e}-copy-${n}`;if(!t.has(r))return r}return`${e}-copy-${t.size+1}`}async function c(e){try{let t=new URLSearchParams({name:e.name,scope:e.scope}),i=await fetch(`/api/skill?${t.toString()}`);if(!i.ok)return{ok:!1,error:await n(i)};let a=await i.json().catch(()=>null),o=typeof a?.skill?.frontmatter?.description==`string`?a.skill.frontmatter.description:``,c=typeof a?.skill?.body==`string`?a.skill.body:``,l=s(e.name,e.existingNames),u=await r({scope:e.scope,name:l,frontmatter:{name:l,description:o},body:c});return u.ok?{ok:!0,name:l}:{ok:!1,error:u.error}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function l(e){let{name:a,fromScope:o,toScope:s}=e;if(o===s)return{ok:!0,scope:s};try{let e=await fetch(`/api/skill?name=${encodeURIComponent(a)}&scope=${o}`);if(!e.ok)return{ok:!1,error:await n(e)};let c=await e.json().catch(()=>null),l=typeof c?.skill?.frontmatter?.description==`string`?c.skill.frontmatter.description:``,u=typeof c?.skill?.body==`string`?c.skill.body:``,p=await fetch(`/api/skill?name=${encodeURIComponent(a)}&scope=${s}`);if(p.ok)return{ok:!1,error:`A ${s} skill named "${a}" already exists.`};if(p.status!==404)return{ok:!1,error:`Couldn't verify the ${s} destination "${a}" is free (HTTP ${p.status}); aborting before any write so an existing skill can't be overwritten. Retry in a moment.`};let m=await r({scope:s,name:a,frontmatter:{name:a,description:l},body:u});if(!m.ok)return m;let h=await f(o,a);if(!h.ok)return{ok:!1,error:`Copied "${a}" to ${s}, but reading its bundle files failed (${h.error}); the ${o} original is intact. Delete the partial ${s} copy and retry.`};let g=[];for(let e of h.files){if(e.text===null){g.push(e.path);continue}let t=await i({scope:s,name:a,path:e.path,content:e.text});if(!t.ok)return{ok:!1,error:`Copied "${a}" to ${s}, but copying its bundle file "${e.path}" failed (${t.error}); the ${o} original is intact. Delete the partial ${s} copy and retry.`}}let _=await d(o,a);return _.ok?(t(),{ok:!0,scope:s,...g.length>0?{skippedBinaryFiles:g}:{}}):{ok:!1,error:`Copied to ${s}, but couldn't remove the ${o} copy: ${_.error}`}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function u(e){try{let r=await fetch(`/api/skill`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.ok)return{ok:!1,error:await n(r)};let i=await r.json().catch(()=>null);return t(),{ok:!0,committed:i?.committed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function d(e,r){try{let i=`?name=${encodeURIComponent(r)}&scope=${encodeURIComponent(e)}`,a=await fetch(`/api/skill${i}`,{method:`DELETE`});if(!a.ok)return{ok:!1,error:await n(a)};let o=await a.json().catch(()=>null);return t(),{ok:!0,existed:o?.existed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function f(e,t){try{let r=new URLSearchParams({name:t,scope:e}),i=await fetch(`/api/skill?${r.toString()}`);return i.ok?{ok:!0,files:(await i.json().catch(()=>null))?.skill?.files??[]}:{ok:!1,error:await n(i)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function p(e){try{let t=new URLSearchParams({name:e.name,scope:e.scope,path:e.path}),r=await fetch(`/api/skill-file?${t.toString()}`,{signal:e.signal});if(!r.ok)return{ok:!1,status:r.status,error:await n(r)};let i=await r.json().catch(()=>null);return typeof i?.text==`string`?{ok:!0,text:i.text}:{ok:!1,status:r.status,error:`HTTP ${r.status}`}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}function m(e,t){return p({...e,signal:t}).then(e=>e.ok?{ok:!0,text:e.text}:{ok:!1,status:e.status})}async function h(e){try{let r=await fetch(`/api/skill/install`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.ok)return{ok:!1,error:await n(r)};let i=await r.json().catch(()=>null);return t(),{ok:!0,hosts:i?.hosts??[],scripts:i?.scripts??!1,warnings:i?.warnings??[],warningCodes:i?.warningCodes??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function g(e){try{let r=await fetch(`/api/skill/uninstall`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.ok)return{ok:!1,error:await n(r)};let i=await r.json().catch(()=>null);return t(),{ok:!0,uninstalled:i?.uninstalled??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function _(e){try{let r=await fetch(`/api/skill/update`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.ok)return{ok:!1,error:await n(r)};let i=await r.json().catch(()=>null);return t(),{ok:!0,version:i?.version??``,previousVersion:i?.previousVersion,checkpointRef:i?.checkpointRef}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}export{h as a,l as c,g as d,_ as f,a as i,r as l,c as n,m as o,f as r,u as s,d as t,o as u};
1
+ import{t as e}from"./parse-api-error-QYXuYti5.js";import{r as t}from"./documents-events-BTDcCELc.js";async function n(t){return e(await t.json().catch(()=>null))??`HTTP ${t.status}`}async function r(e){try{let r=await fetch(`/api/skill`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.ok)return{ok:!1,error:await n(r)};let i=await r.json().catch(()=>null);return t(),{ok:!0,created:i?.created??!1,warnings:i?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function i(e){try{let r=await fetch(`/api/skill-file`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.ok)return{ok:!1,error:await n(r)};let i=await r.json().catch(()=>null);return t(),{ok:!0,created:i?.created??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function a(){try{let e=await fetch(`/api/skills/management`);return e.ok?await e.json():null}catch{return null}}async function o(e){try{return(await fetch(`/api/skills/management`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({manageEditorSkills:e})})).ok?(t(),!0):!1}catch{return!1}}function s(e,t){let n=`${e}-copy`;if(!t.has(n))return n;for(let n=2;n<1e3;n+=1){let r=`${e}-copy-${n}`;if(!t.has(r))return r}return`${e}-copy-${t.size+1}`}async function c(e){try{let t=new URLSearchParams({name:e.name,scope:e.scope}),i=await fetch(`/api/skill?${t.toString()}`);if(!i.ok)return{ok:!1,error:await n(i)};let a=await i.json().catch(()=>null),o=typeof a?.skill?.frontmatter?.description==`string`?a.skill.frontmatter.description:``,c=typeof a?.skill?.body==`string`?a.skill.body:``,l=s(e.name,e.existingNames),u=await r({scope:e.scope,name:l,frontmatter:{name:l,description:o},body:c});return u.ok?{ok:!0,name:l}:{ok:!1,error:u.error}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function l(e){let{name:a,fromScope:o,toScope:s}=e;if(o===s)return{ok:!0,scope:s};try{let e=await fetch(`/api/skill?name=${encodeURIComponent(a)}&scope=${o}`);if(!e.ok)return{ok:!1,error:await n(e)};let c=await e.json().catch(()=>null),l=typeof c?.skill?.frontmatter?.description==`string`?c.skill.frontmatter.description:``,u=typeof c?.skill?.body==`string`?c.skill.body:``,p=await fetch(`/api/skill?name=${encodeURIComponent(a)}&scope=${s}`);if(p.ok)return{ok:!1,error:`A ${s} skill named "${a}" already exists.`};if(p.status!==404)return{ok:!1,error:`Couldn't verify the ${s} destination "${a}" is free (HTTP ${p.status}); aborting before any write so an existing skill can't be overwritten. Retry in a moment.`};let m=await r({scope:s,name:a,frontmatter:{name:a,description:l},body:u});if(!m.ok)return m;let h=await f(o,a);if(!h.ok)return{ok:!1,error:`Copied "${a}" to ${s}, but reading its bundle files failed (${h.error}); the ${o} original is intact. Delete the partial ${s} copy and retry.`};let g=[];for(let e of h.files){if(e.text===null){g.push(e.path);continue}let t=await i({scope:s,name:a,path:e.path,content:e.text});if(!t.ok)return{ok:!1,error:`Copied "${a}" to ${s}, but copying its bundle file "${e.path}" failed (${t.error}); the ${o} original is intact. Delete the partial ${s} copy and retry.`}}let _=await d(o,a);return _.ok?(t(),{ok:!0,scope:s,...g.length>0?{skippedBinaryFiles:g}:{}}):{ok:!1,error:`Copied to ${s}, but couldn't remove the ${o} copy: ${_.error}`}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function u(e){try{let r=await fetch(`/api/skill`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.ok)return{ok:!1,error:await n(r)};let i=await r.json().catch(()=>null);return t(),{ok:!0,committed:i?.committed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function d(e,r){try{let i=`?name=${encodeURIComponent(r)}&scope=${encodeURIComponent(e)}`,a=await fetch(`/api/skill${i}`,{method:`DELETE`});if(!a.ok)return{ok:!1,error:await n(a)};let o=await a.json().catch(()=>null);return t(),{ok:!0,existed:o?.existed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function f(e,t){try{let r=new URLSearchParams({name:t,scope:e}),i=await fetch(`/api/skill?${r.toString()}`);return i.ok?{ok:!0,files:(await i.json().catch(()=>null))?.skill?.files??[]}:{ok:!1,error:await n(i)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function p(e){try{let t=new URLSearchParams({name:e.name,scope:e.scope,path:e.path}),r=await fetch(`/api/skill-file?${t.toString()}`,{signal:e.signal});if(!r.ok)return{ok:!1,status:r.status,error:await n(r)};let i=await r.json().catch(()=>null);return typeof i?.text==`string`?{ok:!0,text:i.text}:{ok:!1,status:r.status,error:`HTTP ${r.status}`}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}function m(e,t){return p({...e,signal:t}).then(e=>e.ok?{ok:!0,text:e.text}:{ok:!1,status:e.status})}async function h(e){try{let r=await fetch(`/api/skill/install`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.ok)return{ok:!1,error:await n(r)};let i=await r.json().catch(()=>null);return t(),{ok:!0,hosts:i?.hosts??[],scripts:i?.scripts??!1,warnings:i?.warnings??[],warningCodes:i?.warningCodes??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function g(e){try{let r=await fetch(`/api/skill/uninstall`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.ok)return{ok:!1,error:await n(r)};let i=await r.json().catch(()=>null);return t(),{ok:!0,uninstalled:i?.uninstalled??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function _(e){try{let r=await fetch(`/api/skill/update`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.ok)return{ok:!1,error:await n(r)};let i=await r.json().catch(()=>null);return t(),{ok:!0,version:i?.version??``,previousVersion:i?.previousVersion,checkpointRef:i?.checkpointRef}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}export{h as a,l as c,g as d,_ as f,a as i,r as l,c as n,m as o,f as r,u as s,d as t,o as u};
@@ -1,2 +1,2 @@
1
- import{J as e}from"./CodeMirrorPropInput-0TqZTWBW.js";import{B as t,C as n,H as r,P as i,V as a,b as o,et as s,p as c,tt as l,w as u,y as d}from"./config-provider-DMJrhWUp.js";import{$ as f,Dt as p,J as m,Mt as h,Q as g,St as _,X as v,kt as y}from"./dist-Bdw_F3kx.js";var b=class e{constructor(e,t){this.yanchor=e,this.yhead=t}toJSON(){return{yanchor:i(this.yanchor),yhead:i(this.yhead)}}static fromJSON(t){return new e(n(t.yanchor),n(t.yhead))}},x=class{constructor(e,t){this.ytext=e,this.awareness=t,this.undoManager=new c(e)}toYPos(e,t=0){return u(this.ytext,e,t)}fromYPos(e){let t=o(n(e),this.ytext.doc);if(t==null||t.type!==this.ytext)throw Error(`[y-codemirror] The position you want to retrieve was created by a different document`);return{pos:t.index,assoc:t.assoc}}toYRange(e){let t=e.assoc;return new b(this.toYPos(e.anchor,t),this.toYPos(e.head,t))}fromYRange(e){let t=this.fromYPos(e.yanchor),n=this.fromYPos(e.yhead);return t.pos===n.pos?p.cursor(n.pos,n.assoc):p.range(t.pos,n.pos)}},S=y.define({combine(e){return e[e.length-1]}}),C=_.define(),w=class{constructor(e){this.view=e,this.conf=e.state.facet(S),this._observer=(t,n)=>{if(n.origin!==this.conf){let n=t.delta,r=[],i=0;for(let e=0;e<n.length;e++){let t=n[e];t.insert==null?t.delete==null?i+=t.retain:(r.push({from:i,to:i+t.delete,insert:``}),i+=t.delete):r.push({from:i,to:i,insert:t.insert})}e.dispatch({changes:r,annotations:[C.of(this.conf)]})}},this._ytext=this.conf.ytext,this._ytext.observe(this._observer)}update(e){if(!e.docChanged||e.transactions.length>0&&e.transactions[0].annotation(C)===this.conf)return;let t=this.conf.ytext;t.doc.transact(()=>{let n=0;e.changes.iterChanges((e,r,i,a,o)=>{let s=o.sliceString(0,o.length,`
1
+ import{J as e}from"./CodeMirrorPropInput-Cx9FW420.js";import{B as t,C as n,H as r,P as i,V as a,b as o,et as s,p as c,tt as l,w as u,y as d}from"./config-provider-pXCSDe7I.js";import{$ as f,Dt as p,J as m,Mt as h,Q as g,St as _,X as v,kt as y}from"./dist-Bdw_F3kx.js";var b=class e{constructor(e,t){this.yanchor=e,this.yhead=t}toJSON(){return{yanchor:i(this.yanchor),yhead:i(this.yhead)}}static fromJSON(t){return new e(n(t.yanchor),n(t.yhead))}},x=class{constructor(e,t){this.ytext=e,this.awareness=t,this.undoManager=new c(e)}toYPos(e,t=0){return u(this.ytext,e,t)}fromYPos(e){let t=o(n(e),this.ytext.doc);if(t==null||t.type!==this.ytext)throw Error(`[y-codemirror] The position you want to retrieve was created by a different document`);return{pos:t.index,assoc:t.assoc}}toYRange(e){let t=e.assoc;return new b(this.toYPos(e.anchor,t),this.toYPos(e.head,t))}fromYRange(e){let t=this.fromYPos(e.yanchor),n=this.fromYPos(e.yhead);return t.pos===n.pos?p.cursor(n.pos,n.assoc):p.range(t.pos,n.pos)}},S=y.define({combine(e){return e[e.length-1]}}),C=_.define(),w=class{constructor(e){this.view=e,this.conf=e.state.facet(S),this._observer=(t,n)=>{if(n.origin!==this.conf){let n=t.delta,r=[],i=0;for(let e=0;e<n.length;e++){let t=n[e];t.insert==null?t.delete==null?i+=t.retain:(r.push({from:i,to:i+t.delete,insert:``}),i+=t.delete):r.push({from:i,to:i,insert:t.insert})}e.dispatch({changes:r,annotations:[C.of(this.conf)]})}},this._ytext=this.conf.ytext,this._ytext.observe(this._observer)}update(e){if(!e.docChanged||e.transactions.length>0&&e.transactions[0].annotation(C)===this.conf)return;let t=this.conf.ytext;t.doc.transact(()=>{let n=0;e.changes.iterChanges((e,r,i,a,o)=>{let s=o.sliceString(0,o.length,`
2
2
  `);e!==r&&t.delete(e+n,r-e),s.length>0&&t.insert(e+n,s),n+=s.length-(r-e)})},this.conf)}destroy(){this._ytext.unobserve(this._observer)}},T=g.fromClass(w),E=v.baseTheme({".cm-ySelection":{},".cm-yLineSelection":{padding:0,margin:`0px 2px 0px 4px`},".cm-ySelectionCaret":{position:`relative`,borderLeft:`1px solid black`,borderRight:`1px solid black`,marginLeft:`-1px`,marginRight:`-1px`,boxSizing:`border-box`,display:`inline`},".cm-ySelectionCaretDot":{borderRadius:`50%`,position:`absolute`,width:`.4em`,height:`.4em`,top:`-.2em`,left:`-.2em`,backgroundColor:`inherit`,transition:`transform .3s ease-in-out`,boxSizing:`border-box`},".cm-ySelectionCaret:hover > .cm-ySelectionCaretDot":{transformOrigin:`bottom center`,transform:`scale(0)`},".cm-ySelectionInfo":{position:`absolute`,top:`-1.05em`,left:`-1px`,fontSize:`.75em`,fontFamily:`serif`,fontStyle:`normal`,fontWeight:`normal`,lineHeight:`normal`,userSelect:`none`,color:`white`,paddingLeft:`2px`,paddingRight:`2px`,zIndex:101,transition:`opacity .3s ease-in-out`,backgroundColor:`inherit`,opacity:0,transitionDelay:`0s`,whiteSpace:`nowrap`},".cm-ySelectionCaret:hover > .cm-ySelectionInfo":{opacity:1,transitionDelay:`0s`}}),D=_.define(),O=class extends f{constructor(e,t){super(),this.color=e,this.name=t}toDOM(){return t(`span`,[r(`class`,`cm-ySelectionCaret`),r(`style`,`background-color: ${this.color}; border-color: ${this.color}`)],[a(`⁠`),t(`div`,[r(`class`,`cm-ySelectionCaretDot`)]),a(`⁠`),t(`div`,[r(`class`,`cm-ySelectionInfo`)],[a(this.name)]),a(`⁠`)])}eq(e){return e.color===this.color}compare(e){return e.color===this.color}updateDOM(){return!1}get estimatedHeight(){return-1}ignoreEvent(){return!0}},k=class{constructor(e){this.conf=e.state.facet(S),this._listener=({added:t,updated:n,removed:r},i,a)=>{t.concat(n).concat(r).findIndex(e=>e!==this.conf.awareness.doc.clientID)>=0&&e.dispatch({annotations:[D.of([])]})},this._awareness=this.conf.awareness,this._awareness.on(`change`,this._listener),this.decorations=h.of([])}destroy(){this._awareness.off(`change`,this._listener)}update(e){let t=this.conf.ytext,r=t.doc,i=this.conf.awareness,a=[],c=this.conf.awareness.getLocalState();if(c!=null){let r=e.view.hasFocus&&e.view.dom.ownerDocument.hasFocus(),a=r?e.state.selection.main:null,o=c.cursor==null?null:n(c.cursor.anchor),s=c.cursor==null?null:n(c.cursor.head);if(a!=null){let e=u(t,a.anchor),n=u(t,a.head);(c.cursor==null||!d(o,e)||!d(s,n))&&i.setLocalStateField(`cursor`,{anchor:e,head:n})}else c.cursor!=null&&r&&i.setLocalStateField(`cursor`,null)}i.getStates().forEach((n,c)=>{if(c===i.doc.clientID)return;let u=n.cursor;if(u==null||u.anchor==null||u.head==null)return;let d=o(u.anchor,r),f=o(u.head,r);if(d==null||f==null||d.type!==t||f.type!==t)return;let{color:p=`#30bced`,name:h=`Anonymous`}=n.user||{},g=n.user&&n.user.colorLight||p+`33`,_=l(d.index,f.index),v=s(d.index,f.index),y=e.view.state.doc.lineAt(_),b=e.view.state.doc.lineAt(v);if(y.number===b.number)a.push({from:_,to:v,value:m.mark({attributes:{style:`background-color: ${g}`},class:`cm-ySelection`})});else{a.push({from:_,to:y.from+y.length,value:m.mark({attributes:{style:`background-color: ${g}`},class:`cm-ySelection`})}),a.push({from:b.from,to:v,value:m.mark({attributes:{style:`background-color: ${g}`},class:`cm-ySelection`})});for(let t=y.number+1;t<b.number;t++){let n=e.view.state.doc.line(t).from;a.push({from:n,to:n,value:m.line({attributes:{style:`background-color: ${g}`,class:`cm-yLineSelection`}})})}}a.push({from:f.index,to:f.index,value:m.widget({side:f.index-d.index>0?-1:1,block:!1,widget:new O(p,h)})})}),this.decorations=m.set(a,!0)}},A=g.fromClass(k,{decorations:e=>e.decorations}),j=class{constructor(e){this.undoManager=e}addTrackedOrigin(e){this.undoManager.addTrackedOrigin(e)}removeTrackedOrigin(e){this.undoManager.removeTrackedOrigin(e)}undo(){return this.undoManager.undo()!=null}redo(){return this.undoManager.redo()!=null}},M=y.define({combine(e){return e[e.length-1]}});_.define();var N=class{constructor(t){this.view=t,this.conf=t.state.facet(M),this._undoManager=this.conf.undoManager,this.syncConf=t.state.facet(S),this._beforeChangeSelection=null,this._mux=e(),this._onStackItemAdded=({stackItem:e,changedParentTypes:t})=>{t.has(this.syncConf.ytext)&&this._beforeChangeSelection&&!e.meta.has(this)&&e.meta.set(this,this._beforeChangeSelection)},this._onStackItemPopped=({stackItem:e})=>{let n=e.meta.get(this);if(n){let e=this.syncConf.fromYRange(n);t.dispatch(t.state.update({selection:e,effects:[v.scrollIntoView(e)]})),this._storeSelection()}},this._storeSelection=()=>{this._beforeChangeSelection=this.syncConf.toYRange(this.view.state.selection.main)},this._undoManager.on(`stack-item-added`,this._onStackItemAdded),this._undoManager.on(`stack-item-popped`,this._onStackItemPopped),this._undoManager.addTrackedOrigin(this.syncConf)}update(e){e.selectionSet&&(e.transactions.length===0||e.transactions[0].annotation(C)!==this.syncConf)&&this._storeSelection()}destroy(){this._undoManager.off(`stack-item-added`,this._onStackItemAdded),this._undoManager.off(`stack-item-popped`,this._onStackItemPopped),this._undoManager.removeTrackedOrigin(this.syncConf)}},P=g.fromClass(N),F=({state:e,dispatch:t})=>e.facet(M).undo()||!0,I=({state:e,dispatch:t})=>e.facet(M).redo()||!0,L=(e,t,{undoManager:n=new c(e)}={})=>{let r=new x(e,t),i=[S.of(r),T];return t&&i.push(E,A),n!==!1&&i.push(M.of(new j(n)),P,v.domEventHandlers({beforeinput(e,t){return e.inputType===`historyUndo`?F(t):e.inputType===`historyRedo`?I(t):!1}})),i};export{L as t};
@@ -1 +1 @@
1
- import{o as e}from"./navigation-targets-CdngrI3e.js";import{l as t}from"./doc-hash-sxvnKnL5.js";function n(e){switch(e.kind){case`doc`:case`large-file`:return`doc`;case`skill-file`:return`doc`;case`folder`:case`folder-index`:return`folder`;case`missing`:case`asset`:return`missing`}}function r(r,i){let a=e(r,i);return{resolvedTarget:a,hashDocName:a.target,hash:a.kind===`skill-file`?t({scope:a.scope,name:a.name,path:a.path}):null,displayState:n(a)}}export{r as t};
1
+ import{o as e}from"./navigation-targets-DUt4VF6E.js";import{l as t}from"./doc-hash-D8EI7kHA.js";function n(e){switch(e.kind){case`doc`:case`large-file`:return`doc`;case`skill-file`:return`doc`;case`folder`:case`folder-index`:return`folder`;case`missing`:case`asset`:return`missing`}}function r(r,i){let a=e(r,i);return{resolvedTarget:a,hashDocName:a.target,hash:a.kind===`skill-file`?t({scope:a.scope,name:a.name,path:a.path}):null,displayState:n(a)}}export{r as t};