@inkeep/open-knowledge 0.64.0-beta.3 → 0.64.0-beta.4

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 (353) hide show
  1. package/dist/{acp-harness-probe-DDqiQmm_.mjs → acp-harness-probe-B0ZOHZTz.mjs} +2 -2
  2. package/dist/cli.mjs +6 -6
  3. package/dist/constants-C-QXBCBl.mjs +2 -0
  4. package/dist/index.d.mts +37 -2
  5. package/dist/index.mjs +1 -1
  6. package/dist/init-DPb4O5KS.mjs +1 -0
  7. package/dist/{init-8KXad73_.mjs → init-XAxC4-D4.mjs} +3 -3
  8. package/dist/{launch-json-removal-BwH0QFXd.mjs → launch-json-removal-1-8ZHJtz.mjs} +2 -2
  9. package/dist/{loader-COdw9cCC.mjs → loader-BAhIE_G7.mjs} +2 -2
  10. package/dist/loader-DhmZ3k83.mjs +1 -0
  11. package/dist/{preview-DLUqlPI6.mjs → preview-W17sbyAM.mjs} +2 -2
  12. package/dist/preview-ztEEIVyt.mjs +1 -0
  13. package/dist/public/assets/{ActivityModeContent-DVp1gZjW.js → ActivityModeContent-CTkq714U.js} +1 -1
  14. package/dist/public/assets/{AddPropertiesButton-B4mgksK9.js → AddPropertiesButton-BPD1FL9u.js} +1 -1
  15. package/dist/public/assets/{AgentDiffPane-CxHgKni7.js → AgentDiffPane-irQjcz1_.js} +1 -1
  16. package/dist/public/assets/{AgentThreadClientBinder-DjPyJZC2.js → AgentThreadClientBinder-BVL-74Xg.js} +1 -1
  17. package/dist/public/assets/{AppMenubar-D2MAtGAz.js → AppMenubar-ywn95n5_.js} +1 -1
  18. package/dist/public/assets/{BugReportHistory-CVve2Axu.js → BugReportHistory-DH6PeCd-.js} +1 -1
  19. package/dist/public/assets/{BugReportHistoryDialog-Ba061U9i.js → BugReportHistoryDialog-B8YFi-N2.js} +1 -1
  20. package/dist/public/assets/{CodeMirrorPropInput-BL-5Q3Jo.js → CodeMirrorPropInput-kIJWwKe4.js} +2 -2
  21. package/dist/public/assets/{ConfigSharingInfoTooltip-BAHlj9xZ.js → ConfigSharingInfoTooltip-CmY8gl8k.js} +1 -1
  22. package/dist/public/assets/{ConsentDialogBody-CzH4EuI3.js → ConsentDialogBody-oXXodDvV.js} +1 -1
  23. package/dist/public/assets/{DiffView-D8XUmPm-.js → DiffView-BgxYEqNK.js} +1 -1
  24. package/dist/public/assets/DocumentContext-6gn-Aiv8.js +38 -0
  25. package/dist/public/assets/{EditorModeToggle-D6L8r63B.js → EditorModeToggle-BaN2Oili.js} +1 -1
  26. package/dist/public/assets/{EnableSyncConfirmDialog-BZuygRVh.js → EnableSyncConfirmDialog-xkXGTFo0.js} +1 -1
  27. package/dist/public/assets/{ExcalidrawDocEditor-D2QIjqhX.js → ExcalidrawDocEditor-Dj9eB-pP.js} +4 -4
  28. package/dist/public/assets/FeedbackForm-BnoSzKB_.js +1 -0
  29. package/dist/public/assets/{GraphPanel-ByInPd3a.js → GraphPanel-DwUEHRhD.js} +1 -1
  30. package/dist/public/assets/{ImportSkillDialog-BAk-BVT8.js → ImportSkillDialog-DkMQKyPv.js} +1 -1
  31. package/dist/public/assets/{LintConfigEditor-a6yi3Ww5.js → LintConfigEditor-B-NsTPbc.js} +1 -1
  32. package/dist/public/assets/ManagedArtifactProperties-DL8NyQe3.js +1 -0
  33. package/dist/public/assets/{ManagedArtifactProperties-D8geiZjG.js → ManagedArtifactProperties-rX7XGDin.js} +1 -1
  34. package/dist/public/assets/{McpConsentDialogBody-DVBhoRAw.js → McpConsentDialogBody-Da_YGlKw.js} +1 -1
  35. package/dist/public/assets/{Mermaid-C9X7cjZ1.js → Mermaid-BAKMqFxz.js} +2 -2
  36. package/dist/public/assets/{MermaidDocEditor-04iIKbvP.js → MermaidDocEditor-yQOGFE0A.js} +1 -1
  37. package/dist/public/assets/{PropertyDisplayRow-Cn7uHncy.js → PropertyDisplayRow-Du0eofgg.js} +2 -2
  38. package/dist/public/assets/{RegisteredAgentIcon-DIfsdEiW.js → RegisteredAgentIcon-C5l0ngck.js} +1 -1
  39. package/dist/public/assets/ReportBugDialogBody-CSy9sPgF.js +3 -0
  40. package/dist/public/assets/ReportBugMenuTrigger-DcXixDKs.js +2 -0
  41. package/dist/public/assets/{RowDisclosure-BTtG2df8.js → RowDisclosure-BD4HJbRH.js} +1 -1
  42. package/dist/public/assets/{SchemaConfigEditor-fWpkoH9e.js → SchemaConfigEditor-Bw4WfNdB.js} +1 -1
  43. package/dist/public/assets/{SessionsHost-BbabLBoa.js → SessionsHost-Bb2LhY4k.js} +2 -2
  44. package/dist/public/assets/SettingsDialogBody-BOlhS9Ub.js +12 -0
  45. package/dist/public/assets/{ShareBranchSwitchDialog-CPFRMiPb.js → ShareBranchSwitchDialog-MPieYF0-.js} +1 -1
  46. package/dist/public/assets/{ShareReceiveDialog-DHygzplb.js → ShareReceiveDialog-Dv4IxMEt.js} +1 -1
  47. package/dist/public/assets/{ShareReceiveMissDialog-DDYsfJz-.js → ShareReceiveMissDialog-BDMgkM4B.js} +1 -1
  48. package/dist/public/assets/{SkillCostValue-Dh3W83GI.js → SkillCostValue-BN4Joz66.js} +1 -1
  49. package/dist/public/assets/{SkillEditBanner-Dmd9x2GL.js → SkillEditBanner-ojtVKJKQ.js} +1 -1
  50. package/dist/public/assets/{SkillInstallMenu-Bj4eanWC.js → SkillInstallMenu-B3V2W9x9.js} +1 -1
  51. package/dist/public/assets/{SkillOriginInline-DPbc95eY.js → SkillOriginInline-C997nHPd.js} +1 -1
  52. package/dist/public/assets/{SkillToolbarControls-CiKYhqeu.js → SkillToolbarControls-Dj-887tA.js} +1 -1
  53. package/dist/public/assets/{SlidesToolbarControls-DukKIknR.js → SlidesToolbarControls-DW6XStbl.js} +1 -1
  54. package/dist/public/assets/{SourceEditor-ChRbLJso.js → SourceEditor-YP4-TM8J.js} +1 -1
  55. package/dist/public/assets/{TerminalPanel-niWqOudS.js → TerminalPanel-CT7hDlGm.js} +1 -1
  56. package/dist/public/assets/{TerminalStartingNotice-LVCAO53j.js → TerminalStartingNotice-5YXAirXU.js} +1 -1
  57. package/dist/public/assets/TerminalWindowApp-YPZsrULF.js +1 -0
  58. package/dist/public/assets/{TextDocEditor-DYyxuF3J.js → TextDocEditor-7bDJHloT.js} +1 -1
  59. package/dist/public/assets/{ThemePicker-DXALMWUA.js → ThemePicker-BEVvKk5L.js} +1 -1
  60. package/dist/public/assets/{ThreadView-Dg2ocFRD.js → ThreadView-DP3_zX56.js} +7 -7
  61. package/dist/public/assets/{TimelineDiffPane-Dq7qjm7t.js → TimelineDiffPane-DG4VaixQ.js} +1 -1
  62. package/dist/public/assets/{abnfDiagram-N423BO3Z-CcNzibSW.js → abnfDiagram-N423BO3Z-DBJ3AZ9J.js} +1 -1
  63. package/dist/public/assets/{agent-diff-store-B3dLX7vR.js → agent-diff-store-DikFdttU.js} +1 -1
  64. package/dist/public/assets/{alert-dialog-v-lStrvw.js → alert-dialog-BV3f4Vr2.js} +1 -1
  65. package/dist/public/assets/{architectureDiagram-T3A2C74G-x7KhBP2B.js → architectureDiagram-T3A2C74G-DHhiMV1e.js} +1 -1
  66. package/dist/public/assets/arrow-up-right-BTi7mHwL.js +1 -0
  67. package/dist/public/assets/{auth-state-cache-D7CM6sAp.js → auth-state-cache-Oucukckm.js} +4 -4
  68. package/dist/public/assets/{badge-zJWUwhkd.js → badge-52pHek8I.js} +1 -1
  69. package/dist/public/assets/{blockDiagram-VBNYF7ZC-_DUjKmqC.js → blockDiagram-VBNYF7ZC-B0XVQOlY.js} +1 -1
  70. package/dist/public/assets/{braces-DmS8bWjv.js → braces-Bzye844v.js} +1 -1
  71. package/dist/public/assets/{bug-report-send-manager-CXIJIjU-.js → bug-report-send-manager-Di-wNg5H.js} +1 -1
  72. package/dist/public/assets/{button-CA0dewJJ.js → button-Cym3gapE.js} +1 -1
  73. package/dist/public/assets/{c4Diagram-5PPSVZJV-BvXPINTk.js → c4Diagram-5PPSVZJV-C0fXVzxK.js} +1 -1
  74. package/dist/public/assets/{calendar-D-m9ekuo.js → calendar-P1YHNDVH.js} +1 -1
  75. package/dist/public/assets/{case-sensitive-m-hzm2Fd.js → case-sensitive-BwklrMJw.js} +1 -1
  76. package/dist/public/assets/channel-Bw1oZ3oX.js +1 -0
  77. package/dist/public/assets/check-Dut4Aov8.js +1 -0
  78. package/dist/public/assets/{checkbox-C60ghXVs.js → checkbox-UfDS9TpS.js} +1 -1
  79. package/dist/public/assets/{chevron-down-Dkq_Sx62.js → chevron-down-DNO3PgI_.js} +1 -1
  80. package/dist/public/assets/chevron-left-Dhf0Sw0W.js +1 -0
  81. package/dist/public/assets/chevron-right-4mYNnAZZ.js +1 -0
  82. package/dist/public/assets/{chunk-2GRJ4B5K-Cj6-Oom3.js → chunk-2GRJ4B5K-I9g7v43C.js} +1 -1
  83. package/dist/public/assets/{chunk-3NCLNEKW-Bd-QhfAE.js → chunk-3NCLNEKW-CIPZUTs2.js} +1 -1
  84. package/dist/public/assets/{chunk-4I5QYGJK-DTmx7k3q.js → chunk-4I5QYGJK-CJSo7JWo.js} +1 -1
  85. package/dist/public/assets/{chunk-5RXB4S5H-szWjFIhQ.js → chunk-5RXB4S5H-CV_VIHj4.js} +1 -1
  86. package/dist/public/assets/{chunk-6Q2QTUOP-vClzZXZJ.js → chunk-6Q2QTUOP-HonjM1WC.js} +1 -1
  87. package/dist/public/assets/{chunk-7Z6QIM7H-CG3W4Gq4.js → chunk-7Z6QIM7H-C7MoQiZ1.js} +1 -1
  88. package/dist/public/assets/{chunk-BO2N2NFS-DhLAiJRz.js → chunk-BO2N2NFS-D2iiEks4.js} +4 -4
  89. package/dist/public/assets/{chunk-GF5L2VYU-D2VOXB1D.js → chunk-GF5L2VYU-DMKobWUK.js} +1 -1
  90. package/dist/public/assets/{chunk-I66GZJ75-BIJACljW.js → chunk-I66GZJ75-BUquu3u4.js} +1 -1
  91. package/dist/public/assets/{chunk-J7OUQ5F2-IIkcOqGv.js → chunk-J7OUQ5F2-D_xZJOyH.js} +2 -2
  92. package/dist/public/assets/{chunk-JQJVKLGR-QOce9PgS.js → chunk-JQJVKLGR-DEq8-3eQ.js} +1 -1
  93. package/dist/public/assets/{chunk-KBJHAD2P-B80ctoly.js → chunk-KBJHAD2P-D4Yduc8o.js} +1 -1
  94. package/dist/public/assets/{chunk-NSK5VX7P-DLJZ8VNx.js → chunk-NSK5VX7P-BW0NvKtJ.js} +1 -1
  95. package/dist/public/assets/{chunk-QR6OTTB3-DfBTRDdj.js → chunk-QR6OTTB3-BAd_wKMz.js} +1 -1
  96. package/dist/public/assets/{chunk-UBXNYLIW-zy0cmc7-.js → chunk-UBXNYLIW-xJmEmvG8.js} +1 -1
  97. package/dist/public/assets/{chunk-W5SLKNZC-dHRGG7r8.js → chunk-W5SLKNZC-9q5ZT0Or.js} +1 -1
  98. package/dist/public/assets/{chunk-WRU74C26-DC6Jygyt.js → chunk-WRU74C26-DEuLBlab.js} +1 -1
  99. package/dist/public/assets/{circle-alert-CeU2sqgg.js → circle-alert-b-E0_BIP.js} +1 -1
  100. package/dist/public/assets/classDiagram-JCYQIIEL-CrlbOdYD.js +1 -0
  101. package/dist/public/assets/classDiagram-v2-OCEON4UE-CrkjdB4S.js +1 -0
  102. package/dist/public/assets/{client-version-Cr4yDTzO.js → client-version-DpPDNVRX.js} +1 -1
  103. package/dist/public/assets/{cm-theme-CUQw2QSJ.js → cm-theme-CvD6eMwN.js} +1 -1
  104. package/dist/public/assets/{code-highlighter-impl-DQmjHoA2.js → code-highlighter-impl-CGDVGaGi.js} +1 -1
  105. package/dist/public/assets/{collapsible-COrqeoHr.js → collapsible-DYySK8La.js} +1 -1
  106. package/dist/public/assets/comment-chips-BNT5yiMX.js +5 -0
  107. package/dist/public/assets/{config-provider-DyH_5S1M.js → config-provider-D9QQqC6e.js} +3 -3
  108. package/dist/public/assets/context-api-dUnlgSJr.js +1 -0
  109. package/dist/public/assets/{cynefinDiagram-MW4NZA55-CqGzh2Za.js → cynefinDiagram-MW4NZA55-Vp3Z3EOq.js} +1 -1
  110. package/dist/public/assets/{dagre-VZM6K2ZE-1ir2rJwc.js → dagre-VZM6K2ZE-BsNhh3lr.js} +1 -1
  111. package/dist/public/assets/{diagram-7IWD3JNH-Bj6PNtgh.js → diagram-7IWD3JNH-CntjEuMQ.js} +1 -1
  112. package/dist/public/assets/{diagram-B4RE2ZJO-Dz4Gdk3e.js → diagram-B4RE2ZJO-CxKY34wz.js} +1 -1
  113. package/dist/public/assets/{diagram-LBJQPF4R-DwZPbSOO.js → diagram-LBJQPF4R-CAoRKtuu.js} +1 -1
  114. package/dist/public/assets/{diagram-Q27KOJAE-DpBefHrG.js → diagram-Q27KOJAE-Bexqwg9W.js} +1 -1
  115. package/dist/public/assets/{diagram-UB23O5K3-CnYsy3bR.js → diagram-UB23O5K3-BO3f0yq6.js} +1 -1
  116. package/dist/public/assets/{dialog-CkCtHEOY.js → dialog-Ba9N5nEw.js} +1 -1
  117. package/dist/public/assets/{dist-BNjWPf5h.js → dist-4YFTUwt_.js} +1 -1
  118. package/dist/public/assets/{dist-BpVYX4pM2.js → dist-B6U1sHwQ2.js} +1 -1
  119. package/dist/public/assets/{dist-DJUH3LhV.js → dist-BDna-dOq.js} +1 -1
  120. package/dist/public/assets/{dist-C2xqTq7L.js → dist-BXlOzfrR.js} +1 -1
  121. package/dist/public/assets/dist-BY_vnlVW2.js +1 -0
  122. package/dist/public/assets/{dist-DsLZcVyZ.js → dist-BcvirUWL.js} +1 -1
  123. package/dist/public/assets/{dist-BF2Tao7_.js → dist-Bd3O90Cl.js} +1 -1
  124. package/dist/public/assets/{dist-gTGB_-tT.js → dist-Bn0BEeMP.js} +1 -1
  125. package/dist/public/assets/{dist-CSCWMTfQ.js → dist-CMrReMig.js} +1 -1
  126. package/dist/public/assets/{dist-Bun0_jqP.js → dist-CWL3ooGG.js} +1 -1
  127. package/dist/public/assets/{dist-aPIbpbAV.js → dist-CZYk4Gmy.js} +1 -1
  128. package/dist/public/assets/{dist-D_jhHcmP.js → dist-CfolydxL.js} +1 -1
  129. package/dist/public/assets/{dist-CUculQn6.js → dist-CkzVKD46.js} +1 -1
  130. package/dist/public/assets/{dist-BvwnbioL.js → dist-DRO03ovd.js} +1 -1
  131. package/dist/public/assets/{dist-BTeDUJz7.js → dist-DTZ5Uilk.js} +4 -4
  132. package/dist/public/assets/{dist-D6nD_291.js → dist-DXjgrsHI.js} +1 -1
  133. package/dist/public/assets/{dist-DOg6TrZ3.js → dist-DatS2_-H.js} +1 -1
  134. package/dist/public/assets/{dist-BcWdMddd.js → dist-Dhtu02232.js} +1 -1
  135. package/dist/public/assets/{dist-DbEdNEy-2.js → dist-DnnH0RLX2.js} +1 -1
  136. package/dist/public/assets/{dist-C1JnQAE8.js → dist-Ds0ot8zG.js} +1 -1
  137. package/dist/public/assets/{dist-Cu8jzM5J.js → dist-GoOli512.js} +1 -1
  138. package/dist/public/assets/{dist-CtBjTqZn.js → dist-MhaicsMV.js} +1 -1
  139. package/dist/public/assets/dist-wcXwpuqG.js +1 -0
  140. package/dist/public/assets/{dist-DkdJazl9.js → dist-xXHzlM2r.js} +1 -1
  141. package/dist/public/assets/{doc-paths-DRMElswC.js → doc-paths-CbSX4XTW.js} +1 -1
  142. package/dist/public/assets/{documents-events-DhF_sptK.js → documents-events-DxL5ysM1.js} +1 -1
  143. package/dist/public/assets/dropdown-menu-CRvS0_4-.js +1 -0
  144. package/dist/public/assets/{ebnfDiagram-BXEA7PRR-CbFOpeAM.js → ebnfDiagram-BXEA7PRR-DC58rQAn.js} +1 -1
  145. package/dist/public/assets/{erDiagram-JOGREHBK-CZ9JcnST.js → erDiagram-JOGREHBK-CUz9pdjc.js} +1 -1
  146. package/dist/public/assets/{es2015-wpLRKwCl.js → es2015-B9_uRFGw.js} +1 -1
  147. package/dist/public/assets/{eye-DrF_XrDR.js → eye-7pio2q9G.js} +1 -1
  148. package/dist/public/assets/{field-Ml4KaP--.js → field-XqXEu64v.js} +1 -1
  149. package/dist/public/assets/{file-tree-adapter-hJoW3AuD.js → file-tree-adapter-Dfj6r2ub.js} +1 -1
  150. package/dist/public/assets/{file-tree-utils-Cb7_vXe_.js → file-tree-utils-Cs7B4muN.js} +1 -1
  151. package/dist/public/assets/flowDiagram-UKHOOZJN-DHMrplYi.js +1 -0
  152. package/dist/public/assets/{folder-config-api-CBCo8vGy.js → folder-config-api-DrObHnBt.js} +1 -1
  153. package/dist/public/assets/{folder-open-BGKIxsBF.js → folder-open-BWpLO6wT.js} +1 -1
  154. package/dist/public/assets/{form-DWhbcQ6z.js → form-BntZOc7C.js} +1 -1
  155. package/dist/public/assets/{ganttDiagram-PKOTCBZU-BHB-hUMH.js → ganttDiagram-PKOTCBZU-C2NMWsS0.js} +1 -1
  156. package/dist/public/assets/{git-branch-CYpvbxHz.js → git-branch-3CSRgL0o.js} +1 -1
  157. package/dist/public/assets/{gitGraphDiagram-DS77QQ5N-ZJ5Y224L.js → gitGraphDiagram-DS77QQ5N-CVdMqGMX.js} +1 -1
  158. package/dist/public/assets/{globals-BuFIIVIr.css → globals-20k8qIHJ.css} +1 -1
  159. package/dist/public/assets/{hash-DdgzU_HC.js → hash-3VQG5UJ7.js} +1 -1
  160. package/dist/public/assets/{highlighted-body-OFNGDK62-PeS0VpT5.js → highlighted-body-OFNGDK62-UCUIw0Lt.js} +1 -1
  161. package/dist/public/assets/i18n-CP94ib4l.js +1 -0
  162. package/dist/public/assets/index-DxkeeuEK.js +2204 -0
  163. package/dist/public/assets/{info-YXcJ2AqB.js → info-SlzbpjOb.js} +1 -1
  164. package/dist/public/assets/{infoDiagram-6WML65LV-BG7MF-gX.js → infoDiagram-6WML65LV-D2JV8LcI.js} +1 -1
  165. package/dist/public/assets/{input-group-Co1pGUva.js → input-group-DpVg5lNG.js} +1 -1
  166. package/dist/public/assets/{ishikawaDiagram-WSZJBQD7-B0JcQQJV.js → ishikawaDiagram-WSZJBQD7-YJJMNAlB.js} +1 -1
  167. package/dist/public/assets/{journeyDiagram-NVQOT4AX-CU6rukz3.js → journeyDiagram-NVQOT4AX-NC-EWDbF.js} +1 -1
  168. package/dist/public/assets/{kanban-definition-27J2QSJJ-XgZkt40N.js → kanban-definition-27J2QSJJ-A5wz4I7T.js} +1 -1
  169. package/dist/public/assets/{label-Bbz2bT-a.js → label-D-K3fWtj.js} +1 -1
  170. package/dist/public/assets/{launch-agent-thread-b9-Dv6tT.js → launch-agent-thread-J0X5JOlh.js} +1 -1
  171. package/dist/public/assets/{launcher-selection-Bld0AvL_.js → launcher-selection-B27yBVlr.js} +1 -1
  172. package/dist/public/assets/{lib-BoSom6iA.js → lib-DmueaA5E.js} +1 -1
  173. package/dist/public/assets/{lib-D6L_wV12.js → lib-vOz_s3tj.js} +1 -1
  174. package/dist/public/assets/{line-B4oNUbqJ.js → line-BURCYBOK.js} +1 -1
  175. package/dist/public/assets/{lint-config-client-DEbFKblI.js → lint-config-client-DbEZKTUk.js} +1 -1
  176. package/dist/public/assets/{lint-plugin-meta-C39uvKXt.js → lint-plugin-meta-LEBWvINg.js} +1 -1
  177. package/dist/public/assets/{list-plus-DZ9qXaBL.js → list-plus-nPRgk4Qi.js} +1 -1
  178. package/dist/public/assets/{local-menu-action-bus-CXdHCOml.js → local-menu-action-bus-BLEUyEvu.js} +1 -1
  179. package/dist/public/assets/{markdownlint-rule-browser-CajbFe11.js → markdownlint-rule-browser-CLc72-TR.js} +1 -1
  180. package/dist/public/assets/mermaid-GHXKKRXX-BmYrNHJr.js +1 -0
  181. package/dist/public/assets/{mermaid.core-CRAU02Cc.js → mermaid.core-C0IvVkS9.js} +3 -3
  182. package/dist/public/assets/mermaid.core-DhUKqb7Q.js +1 -0
  183. package/dist/public/assets/messages-B9v-Dl6o.js +1 -0
  184. package/dist/public/assets/messages-BNKgouAQ.js +1 -0
  185. package/dist/public/assets/messages-BWVpwygE.js +1 -0
  186. package/dist/public/assets/messages-BdoFX7Ke.js +1 -0
  187. package/dist/public/assets/messages-BozLzcJu.js +1 -0
  188. package/dist/public/assets/messages-C0rOkBCJ.js +1 -0
  189. package/dist/public/assets/messages-CF7zITDG.js +1 -0
  190. package/dist/public/assets/messages-CIBqdK6N.js +1 -0
  191. package/dist/public/assets/messages-CfXBJncQ.js +1 -0
  192. package/dist/public/assets/messages-DXdzgbRq.js +1 -0
  193. package/dist/public/assets/messages-G8fhkSEs.js +1 -0
  194. package/dist/public/assets/messages-z_LlF45n.js +1 -0
  195. package/dist/public/assets/{mindmap-definition-FAOFIHXS-CbNRnPS1.js → mindmap-definition-FAOFIHXS-CKQxgOGt.js} +1 -1
  196. package/dist/public/assets/minus-VHw16jS_.js +1 -0
  197. package/dist/public/assets/{miss-dialog-store-DtLnMdOO.js → miss-dialog-store-DVpIaq34.js} +1 -1
  198. package/dist/public/assets/{ok-B0nm7wTQ.js → ok-Z-u-nHAF.js} +1 -1
  199. package/dist/public/assets/{package-CisN94Rd.js → package-B5dxtZEP.js} +1 -1
  200. package/dist/public/assets/{page-list-cache-QK9n5Q5R.js → page-list-cache-4RZDQAIl.js} +1 -1
  201. package/dist/public/assets/{panel-right-open-BgAOqW9e.js → panel-right-open-B0h13QHr.js} +1 -1
  202. package/dist/public/assets/{paperclip-DTGtQ_JR.js → paperclip-ChAyZqn8.js} +1 -1
  203. package/dist/public/assets/{pegDiagram-VL7TDLO6-1D9kW7ay.js → pegDiagram-VL7TDLO6-BHV9FATd.js} +1 -1
  204. package/dist/public/assets/{pending-receive-nav-store-Dgzal0Jj.js → pending-receive-nav-store-CakgGJjG.js} +1 -1
  205. package/dist/public/assets/{pieDiagram-7S7Q4E2Y-CAWP7eNl.js → pieDiagram-7S7Q4E2Y-vlst6sEu.js} +1 -1
  206. package/dist/public/assets/{platform-labels-CQrhw-5Z.js → platform-labels-DdSSzvdg.js} +1 -1
  207. package/dist/public/assets/{popover-BlSDN3zW.js → popover-B7jXm65e.js} +1 -1
  208. package/dist/public/assets/{progress-Bssl1FLe.js → progress-BJuxWr77.js} +1 -1
  209. package/dist/public/assets/{project-paths-CBkV3-Ol.js → project-paths-vxe5ndBy.js} +1 -1
  210. package/dist/public/assets/{prop-types-BGEVLmnR.js → prop-types-DcE7SWmX.js} +1 -1
  211. package/dist/public/assets/{propagation-api-BqnX4XED.js → propagation-api-DC5404fy.js} +1 -1
  212. package/dist/public/assets/{quadrantDiagram-CIZ2JOQS-Z4KSVoW4.js → quadrantDiagram-CIZ2JOQS-aZGa0dqP.js} +1 -1
  213. package/dist/public/assets/radio-group-npdxiS6E.js +1 -0
  214. package/dist/public/assets/{railroadDiagram-AXF67PYL-BP83q5bW.js → railroadDiagram-AXF67PYL-Daf6Zy7e.js} +1 -1
  215. package/dist/public/assets/{receive-store-SbtZ93F8.js → receive-store-CkD0UhDA.js} +1 -1
  216. package/dist/public/assets/{refresh-cw-BaBMjcrv.js → refresh-cw-DwRz6AkS.js} +1 -1
  217. package/dist/public/assets/{requirementDiagram-LRYGKXZP--AY3V6V9.js → requirementDiagram-LRYGKXZP-C8dZAU1p.js} +1 -1
  218. package/dist/public/assets/{sankeyDiagram-W5VNT64P-B-TG-dlh.js → sankeyDiagram-W5VNT64P-DSVSXy_1.js} +1 -1
  219. package/dist/public/assets/{select-Bs8KgWvR.js → select-XEGYznMI.js} +1 -1
  220. package/dist/public/assets/{selection-context-BbFFffLG.js → selection-context-BFI-bqiT.js} +1 -1
  221. package/dist/public/assets/{separator-B8dpHmeD.js → separator-C6x7j8mC.js} +1 -1
  222. package/dist/public/assets/{sequenceDiagram-SI44F4Z6-CXQngtIb.js → sequenceDiagram-SI44F4Z6-Bnbh_rO1.js} +1 -1
  223. package/dist/public/assets/{skill-scope-D3YD_IZ5.js → skill-scope-grqY_b8j.js} +1 -1
  224. package/dist/public/assets/{skills-api-BHMzgYxx.js → skills-api-DNXy9jz0.js} +1 -1
  225. package/dist/public/assets/{spinner-OTMpJ3P-.js → spinner-t7GahFcQ.js} +1 -1
  226. package/dist/public/assets/{square-pen-CBDgB7xx.js → square-pen-K4JT0cp9.js} +1 -1
  227. package/dist/public/assets/{src-B7bXrIgD.js → src-DXdR4ZQN.js} +1 -1
  228. package/dist/public/assets/{stateDiagram-OKZ733FA-DjmKNgc-.js → stateDiagram-OKZ733FA-DS5XYAjU.js} +1 -1
  229. package/dist/public/assets/stateDiagram-v2-UEYNNEHI-BWm5URXG.js +1 -0
  230. package/dist/public/assets/{swimlanes-SLNWSIFB-W7I7Md-O.js → swimlanes-SLNWSIFB-BGX6QMGe.js} +1 -1
  231. package/dist/public/assets/swimlanesDiagram-ULZ7WXOC-CQ5DIVBE.js +8 -0
  232. package/dist/public/assets/{switch-BeP1gMN6.js → switch-iwBsEWej.js} +1 -1
  233. package/dist/public/assets/{tabs-r9BJxNSQ.js → tabs-BNfoCymd.js} +1 -1
  234. package/dist/public/assets/{tag-pill-input-CIT-G8TJ.js → tag-pill-input-D34lLgUq.js} +1 -1
  235. package/dist/public/assets/{target-navigation-intent-BePi2-hy.js → target-navigation-intent-XZyK8hlI.js} +1 -1
  236. package/dist/public/assets/{telemetry-impl-C53i8fXP.js → telemetry-impl-CQvRl6_a.js} +1 -1
  237. package/dist/public/assets/{telemetry-startup-BuxfLmwJ.js → telemetry-startup-BZHG8uvV.js} +1 -1
  238. package/dist/public/assets/{terminal-tB03Ykfq.js → terminal-D4HSnHXf.js} +1 -1
  239. package/dist/public/assets/terminal-cli-display-C3XNS9Zb.js +1 -0
  240. package/dist/public/assets/{terminal-launch-events-D3fBT3uk.js → terminal-launch-events-BgzVfom1.js} +1 -1
  241. package/dist/public/assets/{terminal-telemetry-DogVmcEg.js → terminal-telemetry-CWD0Kbui.js} +1 -1
  242. package/dist/public/assets/{text-viewer-languages-CmBalDDz.js → text-viewer-languages-DRp_Y82n.js} +2 -2
  243. package/dist/public/assets/{thread-client-DG1ERL6y.js → thread-client-CyOBKqv0.js} +1 -1
  244. package/dist/public/assets/{timeline-definition-Z64GVDOM-Cl223Ubn.js → timeline-definition-Z64GVDOM-BKNoWHPk.js} +1 -1
  245. package/dist/public/assets/toggle-group-C2_37kV5.js +1 -0
  246. package/dist/public/assets/{tooltip-DPvMEqsq.js → tooltip-DttaCTqz.js} +1 -1
  247. package/dist/public/assets/{trash-2-BvCgdeps.js → trash-2-CePzTX_C.js} +1 -1
  248. package/dist/public/assets/{triangle-alert-BMtjvBBD.js → triangle-alert-D0n54WVY.js} +1 -1
  249. package/dist/public/assets/{typing-burst-detector-BQPFhb8j.js → typing-burst-detector-CHFv8DDa.js} +2 -2
  250. package/dist/public/assets/{undo-2-DI8uqzmR.js → undo-2-BOBiJGd5.js} +1 -1
  251. package/dist/public/assets/{uninstall-DreCX4_1.js → uninstall-Cl4LM0CB.js} +1 -1
  252. package/dist/public/assets/{use-activity-panel-CR337nsy.js → use-activity-panel-BdGnO2Z6.js} +1 -1
  253. package/dist/public/assets/{use-apply-config-color-theme-D4rPvW8P.js → use-apply-config-color-theme-Bwj3f7UC.js} +1 -1
  254. package/dist/public/assets/{use-collab-url-D5rWSAYA.js → use-collab-url-OrVAc6Wo.js} +1 -1
  255. package/dist/public/assets/{use-live-xterm-theme-DeqoKEyE.js → use-live-xterm-theme-5k6Gqiaw.js} +1 -1
  256. package/dist/public/assets/{use-open-skill-B6OWc3jt.js → use-open-skill-DymWWnJ_.js} +1 -1
  257. package/dist/public/assets/use-settings-route-BFU85dl8.js +1 -0
  258. package/dist/public/assets/{use-skill-origin-QOgMC_cx.js → use-skill-origin-BTVSbkkb.js} +1 -1
  259. package/dist/public/assets/{use-skills-CUyxM_-s.js → use-skills-Dn1UHdyr.js} +1 -1
  260. package/dist/public/assets/{use-terminal-enabled-BUJSR3VC.js → use-terminal-enabled-DkT9h5DB.js} +1 -1
  261. package/dist/public/assets/use-timeline-entry-diff-CQ3Ngq3P.js +6 -0
  262. package/dist/public/assets/{use-workspace-DHq4JpK0.js → use-workspace-BfO5PsIE.js} +1 -1
  263. package/dist/public/assets/{vennDiagram-T6HMQDX7-B_vlI0S5.js → vennDiagram-T6HMQDX7-CRzUxobP.js} +1 -1
  264. package/dist/public/assets/{wardleyDiagram-T6FBY63Y-D3R5qk6E.js → wardleyDiagram-T6FBY63Y-CoEGckrX.js} +1 -1
  265. package/dist/public/assets/{wrench-DtgyRnkw.js → wrench-ZOpNzIoC.js} +1 -1
  266. package/dist/public/assets/x-C0WDbk6g.js +1 -0
  267. package/dist/public/assets/{xychartDiagram-ELKLHX3M-Btdla0qC.js → xychartDiagram-ELKLHX3M-BlVTFSNG.js} +1 -1
  268. package/dist/public/index.html +155 -155
  269. package/dist/public/uninstall.html +29 -29
  270. package/dist/{repair-launch-json-srmUn2hE.mjs → repair-launch-json-BLY6J8I2.mjs} +2 -2
  271. package/dist/{repair-mcp-configs-I0KtICul.mjs → repair-mcp-configs-lXWW4hnd.mjs} +2 -2
  272. package/dist/src-BZeMIn4S.mjs +1 -0
  273. package/dist/{src-BMK0mOrM.mjs → src-Cv5CfSHR.mjs} +2 -2
  274. package/dist/{start-1qNjbPX9.mjs → start-BaCKwcGO.mjs} +2 -2
  275. package/dist/start-Bqguzc8D.mjs +1 -0
  276. package/package.json +4 -4
  277. package/dist/constants-vY0RbDo-.mjs +0 -2
  278. package/dist/init-CQuP4oZS.mjs +0 -1
  279. package/dist/loader-DPUVbNgg.mjs +0 -1
  280. package/dist/preview-Tkr1Psqx.mjs +0 -1
  281. package/dist/public/assets/DocumentContext-DKudm1-z.js +0 -38
  282. package/dist/public/assets/FeedbackForm-DFqW8szu.js +0 -1
  283. package/dist/public/assets/ManagedArtifactProperties-DqX6bBKJ.js +0 -1
  284. package/dist/public/assets/ReportBugDialogBody-DsOp1u-j.js +0 -3
  285. package/dist/public/assets/SettingsDialogBody-Dd2GkDtz.js +0 -12
  286. package/dist/public/assets/TerminalWindowApp-CWKtaPQf.js +0 -1
  287. package/dist/public/assets/arrow-up-right-BATFT-Sr.js +0 -1
  288. package/dist/public/assets/channel-CPB7MoVI.js +0 -1
  289. package/dist/public/assets/check-_e5AYsE9.js +0 -1
  290. package/dist/public/assets/chevron-left-C3qnVWRd.js +0 -1
  291. package/dist/public/assets/chevron-right-BBMR0NbW.js +0 -1
  292. package/dist/public/assets/classDiagram-JCYQIIEL-Co922tiB.js +0 -1
  293. package/dist/public/assets/classDiagram-v2-OCEON4UE-CUyubUTn.js +0 -1
  294. package/dist/public/assets/comment-chips-BPjveL06.js +0 -5
  295. package/dist/public/assets/context-api-7lTvMdKG.js +0 -1
  296. package/dist/public/assets/dist-Be8lWZxP2.js +0 -1
  297. package/dist/public/assets/dist-pKYOq3XC2.js +0 -1
  298. package/dist/public/assets/dropdown-menu-JsEh078s.js +0 -1
  299. package/dist/public/assets/flowDiagram-UKHOOZJN-CFTGjA42.js +0 -1
  300. package/dist/public/assets/i18n-B28KWA_H.js +0 -1
  301. package/dist/public/assets/index-D7ftC-TA.js +0 -2204
  302. package/dist/public/assets/mermaid-GHXKKRXX-f4wv8zwP.js +0 -1
  303. package/dist/public/assets/mermaid.core-wyUsrdV8.js +0 -1
  304. package/dist/public/assets/messages-BNqWoTE7.js +0 -1
  305. package/dist/public/assets/messages-BVQV1WJj.js +0 -1
  306. package/dist/public/assets/messages-Bu3H835T.js +0 -1
  307. package/dist/public/assets/messages-C2YnjINV.js +0 -1
  308. package/dist/public/assets/messages-CDgZBFJp.js +0 -1
  309. package/dist/public/assets/messages-D81fhPOK.js +0 -1
  310. package/dist/public/assets/messages-DRSi5QzW.js +0 -1
  311. package/dist/public/assets/messages-DmpME-BQ.js +0 -1
  312. package/dist/public/assets/messages-Drz1dYnk.js +0 -1
  313. package/dist/public/assets/messages-Ds1yna2Q.js +0 -1
  314. package/dist/public/assets/messages-N6kgiusx.js +0 -1
  315. package/dist/public/assets/messages-wwtrT-dP.js +0 -1
  316. package/dist/public/assets/minus-Dz9yQFxH.js +0 -1
  317. package/dist/public/assets/radio-group-BsZGGl8l.js +0 -1
  318. package/dist/public/assets/stateDiagram-v2-UEYNNEHI-DYowbT5J.js +0 -1
  319. package/dist/public/assets/swimlanesDiagram-ULZ7WXOC-Hyp8OggN.js +0 -8
  320. package/dist/public/assets/terminal-cli-display-Ch5uUFIR.js +0 -1
  321. package/dist/public/assets/toggle-group-BlEg4yJE.js +0 -1
  322. package/dist/public/assets/use-installed-clis-vg6izNL9.js +0 -1
  323. package/dist/public/assets/use-settings-route-9Zx6tEdn.js +0 -1
  324. package/dist/public/assets/use-timeline-entry-diff-BwGOAWfO.js +0 -6
  325. package/dist/public/assets/x-BAYve4SL.js +0 -1
  326. package/dist/src-ByMg6cEv.mjs +0 -1
  327. package/dist/start-BBP7vc3m.mjs +0 -1
  328. /package/dist/public/assets/{asset-dispatch-D3iE-ozy.js → asset-dispatch-CD6rGcnF.js} +0 -0
  329. /package/dist/public/assets/{auth-prompt-store-BXeyTyYx.js → auth-prompt-store-vAFATIFt.js} +0 -0
  330. /package/dist/public/assets/{createLucideIcon-CfxA0Qtb.js → createLucideIcon-BulbvLvN.js} +0 -0
  331. /package/dist/public/assets/{desktop-bridge-types-rBjHIYSI.js → desktop-bridge-types-oYPdTDmz.js} +0 -0
  332. /package/dist/public/assets/{dist-mv8e6dBX.js → dist-BHv-mziD.js} +0 -0
  333. /package/dist/public/assets/{dist-Cm417ZCm.js → dist-Bd_yyADX.js} +0 -0
  334. /package/dist/public/assets/{dist-DTX2HxC82.js → dist-CJhtNlOm2.js} +0 -0
  335. /package/dist/public/assets/{dist-BgXDUIPy.js → dist-Cr4-nBVI.js} +0 -0
  336. /package/dist/public/assets/{documents-fetch-B1PtbYbS.js → documents-fetch-Bw4lKnRN.js} +0 -0
  337. /package/dist/public/assets/{external-link-D2rJDkPo.js → external-link-DGqXfQJy.js} +0 -0
  338. /package/dist/public/assets/{file-tree-rename-validation-D2G4Kbju.js → file-tree-rename-validation-DmGgIR2S.js} +0 -0
  339. /package/dist/public/assets/{floating-ui.dom-Dk5WJYh0.js → floating-ui.dom-BcZPrP06.js} +0 -0
  340. /package/dist/public/assets/{globals-Cu_E7Ptz.js → globals-CTSydwqe.js} +0 -0
  341. /package/dist/public/assets/{html-void-elements-Biw85x38.js → html-void-elements-zEl0KGqf.js} +0 -0
  342. /package/dist/public/assets/{input-BZhIrrdB.js → input-Cy2M_Avq.js} +0 -0
  343. /package/dist/public/assets/{katex-DJlTj0sX.js → katex-CcPk1vJT.js} +0 -0
  344. /package/dist/public/assets/{markdownit-BZnioq-C.js → markdownit-CugClK-K.js} +0 -0
  345. /package/dist/public/assets/{note-window-mode-BXAdiDXS.js → note-window-mode-CsmLTxU_.js} +0 -0
  346. /package/dist/public/assets/{parse-api-error-Cmyw9Afr.js → parse-api-error-Dd8VI2eu.js} +0 -0
  347. /package/dist/public/assets/{startup-marks-BPO-vrjH.js → startup-marks-C-m5WZDP.js} +0 -0
  348. /package/dist/public/assets/{stex-PMopVeEZ.js → stex-s_JxeNEZ.js} +0 -0
  349. /package/dist/public/assets/{tool-list-format-CGMeWIgE.js → tool-list-format-HdFmW82S.js} +0 -0
  350. /package/dist/public/assets/{trace-api-CEY5PfXs.js → trace-api-BP9dN1Hz.js} +0 -0
  351. /package/dist/public/assets/{use-apply-config-theme-PILfflfB.js → use-apply-config-theme-CBmHKD_B.js} +0 -0
  352. /package/dist/public/assets/{w3c-keyname-DlL_314g.js → w3c-keyname-C7Rznu6R.js} +0 -0
  353. /package/dist/public/assets/{workspace-paths-F2vuFWEQ.js → workspace-paths-CAsMig07.js} +0 -0
@@ -1,11 +1,11 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{_r as n,br as r,gr as i,i as a,ir as o,tr as s}from"./DocumentContext-DKudm1-z.js";import{t as c}from"./react-f2sANaYj.js";import{n as l,r as u}from"./dist-Nvb76hAm.js";import{t as d}from"./compiler-runtime-BfE3aGVn.js";import{t as f}from"./utils-CPqDy6Hr.js";import{n as p,t as m}from"./clipboard-adapter-815RzzoI.js";import{C as h,S as g,_,a as v,h as y}from"./SkillInstallMenu-Bj4eanWC.js";import{t as b}from"./button-CA0dewJJ.js";import{t as x}from"./dist-mv8e6dBX.js";import{i as S,n as C,t as w}from"./tooltip-DPvMEqsq.js";import{a as T,c as E,i as D,n as O,o as k,s as A,t as j}from"./dialog-CkCtHEOY.js";import{t as M}from"./alert-dialog-v-lStrvw.js";import{t as N}from"./checkbox-C60ghXVs.js";import{a as P,m as F,r as I,t as L}from"./dropdown-menu-JsEh078s.js";import{t as R}from"./label-Bbz2bT-a.js";import{i as z,n as ee,o as te,s as ne,t as B}from"./select-Bs8KgWvR.js";import{n as re,t as V}from"./radio-group-BsZGGl8l.js";import{Ct as H,Gt as U,Ht as W,Jt as G,Ko as K,Ut as ie,Wt as ae,Yo as oe,fo as se,js as ce,nn as le}from"./dist-BTeDUJz7.js";import{n as q}from"./dist-DTX2HxC82.js";import{c as ue}from"./use-settings-route-9Zx6tEdn.js";import{t as J}from"./dist-BgXDUIPy.js";import{c as de,v as fe,x as Y}from"./documents-events-DhF_sptK.js";import{i as pe}from"./use-apply-config-theme-PILfflfB.js";import{t as me}from"./parse-api-error-Cmyw9Afr.js";import{n as he}from"./use-workspace-DHq4JpK0.js";import{t as X}from"./createLucideIcon-CfxA0Qtb.js";import{h as ge,n as _e,r as ve,t as ye}from"./EnableSyncConfirmDialog-BZuygRVh.js";import{c as be,s as xe,u as Se}from"./Mermaid-C9X7cjZ1.js";import{t as Ce}from"./arrow-up-right-BATFT-Sr.js";import{t as we}from"./check-_e5AYsE9.js";import{s as Te}from"./prop-types-BGEVLmnR.js";import{n as Ee,t as De}from"./terminal-tB03Ykfq.js";import{a as Oe,r as ke,t as Ae}from"./folder-config-api-CBCo8vGy.js";import{t as je}from"./spinner-OTMpJ3P-.js";import{t as Me}from"./refresh-cw-BaBMjcrv.js";import{t as Ne}from"./trash-2-BvCgdeps.js";import{t as Pe}from"./triangle-alert-BMtjvBBD.js";import{t as Fe}from"./x-BAYve4SL.js";import{d as Ie,f as Le,n as Re,u as ze,v as Be}from"./doc-paths-DRMElswC.js";import"./config-provider-DyH_5S1M.js";import{S as Ve,h as He,i as Ue,p as We,x as Ge}from"./skills-api-BHMzgYxx.js";import{p as Ke,r as qe,t as Je}from"./skill-scope-D3YD_IZ5.js";import{t as Ye}from"./input-BZhIrrdB.js";import{a as Xe,i as Ze,r as Qe,t as $e}from"./popover-BlSDN3zW.js";import{t as et}from"./external-link-D2rJDkPo.js";import{t as tt}from"./badge-zJWUwhkd.js";import{a as nt,i as rt,n as it,o as at,r as ot,s as st,t as ct}from"./field-Ml4KaP--.js";import{t as lt}from"./use-skills-CUyxM_-s.js";import{t as ut}from"./textarea-BtqZ3yY1.js";import{t as dt}from"./terminal-command-events-ponJwwNv.js";var ft=X(`cloud-alert`,[[`path`,{d:`M12 12v4`,key:`tww15h`}],[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.128 16.949A7 7 0 1 1 15.71 8h1.79a1 1 0 0 1 0 9h-1.642`,key:`1namsd`}]]),pt=X(`cloud-off`,[[`path`,{d:`M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057`,key:`1uxyv8`}],[`path`,{d:`M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78`,key:`99tcn7`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),mt=X(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),ht=X(`log-in`,[[`path`,{d:`m10 17 5-5-5-5`,key:`1bsop3`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4`,key:`u53s6r`}]]),gt=X(`move-up-right`,[[`path`,{d:`M13 5H19V11`,key:`1n1gyv`}],[`path`,{d:`M19 5L5 19`,key:`72u4yj`}]]),_t=X(`user-cog`,[[`path`,{d:`M10 15H6a4 4 0 0 0-4 4v2`,key:`1nfge6`}],[`path`,{d:`m14.305 16.53.923-.382`,key:`1itpsq`}],[`path`,{d:`m15.228 13.852-.923-.383`,key:`eplpkm`}],[`path`,{d:`m16.852 12.228-.383-.923`,key:`13v3q0`}],[`path`,{d:`m16.852 17.772-.383.924`,key:`1i8mnm`}],[`path`,{d:`m19.148 12.228.383-.923`,key:`1q8j1v`}],[`path`,{d:`m19.53 18.696-.382-.924`,key:`vk1qj3`}],[`path`,{d:`m20.772 13.852.924-.383`,key:`n880s0`}],[`path`,{d:`m20.772 16.148.924.383`,key:`1g6xey`}],[`circle`,{cx:`18`,cy:`15`,r:`3`,key:`gjjjvw`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]);function vt(e){return e===`eperm`?J._({id:`XuQzrk`}):J._({id:`BUyQnq`})}async function yt(e){let t=await e.restartServer(e.config.projectPath);return t.ok?{ok:!0}:{ok:!1,message:vt(t.reason)}}var Z=d(),Q=e(c(),1);function bt(e){let t=(0,Z.c)(12),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={status:`idle`},t[0]=n):n=t[0];let[r,i]=(0,Q.useState)(n),[a,o]=(0,Q.useState)(0),s,c;t[1]===e?(s=t[2],c=t[3]):(s=()=>{if(e!==null)return Y(()=>{o(wt)})},c=[e],t[1]=e,t[2]=s,t[3]=c),(0,Q.useEffect)(s,c);let l;t[4]===e?l=t[5]:(l=()=>{if(e===null){i({status:`idle`});return}let t=!1;i({status:`loading`});let n=e?`?path=${encodeURIComponent(e)}`:``;return fetch(`/api/folder-config${n}`).then(St).then(e=>{if(!t){if(!e||typeof e!=`object`||!e.folder){i({status:`error`,message:J._({id:`_ci9Bj`})});return}i({status:`ready`,data:{folder:e.folder,frontmatterLocal:e.frontmatter_local??null}})}}).catch(e=>{t||i({status:`error`,message:e instanceof Error?e.message:String(e)})}),()=>{t=!0}},t[4]=e,t[5]=l);let u;t[6]!==e||t[7]!==a?(u=[e,a],t[6]=e,t[7]=a,t[8]=u):u=t[8],(0,Q.useEffect)(l,u);let d;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>o(xt),t[9]=d):d=t[9];let f;return t[10]===r?f=t[11]:(f={state:r,refresh:d},t[10]=r,t[11]=f),f}function xt(e){return e+1}async function St(e){if(!e.ok){let t=await e.json().catch(Ct);throw Error(me(t)??`HTTP ${e.status}`)}return e.json()}function Ct(){return null}function wt(e){return e+1}function Tt(){let e=(0,Z.c)(6),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={status:`idle`},e[0]=t):t=e[0];let[n,r]=(0,Q.useState)(t),[i,a]=(0,Q.useState)(0),o,s;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>Y(()=>{a(Ot)}),s=[],e[1]=o,e[2]=s):(o=e[1],s=e[2]),(0,Q.useEffect)(o,s);let c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=!1;return r({status:`loading`}),fetch(`/api/templates`).then(Et).then(t=>{if(e)return;let n=le.safeParse(t);if(!n.success){console.error(`[ok-templates] /api/templates response failed schema validation:`,n.error.issues),r({status:`error`,message:J._({id:`RLNIgv`})});return}r({status:`ready`,data:n.data.templates})}).catch(t=>{e||r({status:`error`,message:t instanceof Error?t.message:String(t)})}),()=>{e=!0}},e[3]=c):c=e[3];let l;return e[4]===i?l=e[5]:(l=[i],e[4]=i,e[5]=l),(0,Q.useEffect)(c,l),n}async function Et(e){if(!e.ok){let t=await e.json().catch(Dt);throw Error(me(t)??`HTTP ${e.status}`)}return e.json()}function Dt(){return null}function Ot(e){return e+1}async function kt(){try{let e=await fetch(`/api/semantic-status`);return e.ok?await e.json():(console.debug(`[semantic-status] probe returned`,e.status),null)}catch(e){return console.debug(`[semantic-status] probe failed`,e),null}}function At(e){let t=(0,Z.c)(16),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let r=n.enabled??!0,[i,a]=(0,Q.useState)(null),o;t[2]===r?o=t[3]:(o=function(){r&&kt().then(e=>{e&&a(e)})},t[2]=r,t[3]=o);let s=o,c;t[4]===s?c=t[5]:(c=()=>{s()},t[4]=s,t[5]=c);let l;t[6]===r?l=t[7]:(l=[r],t[6]=r,t[7]=l),(0,Q.useEffect)(c,l);let u;t[8]!==r||t[9]!==s?(u=()=>{if(r)return fe(e=>{e.includes(`files`)&&s()})},t[8]=r,t[9]=s,t[10]=u):u=t[10];let d;t[11]===r?d=t[12]:(d=[r],t[11]=r,t[12]=d),(0,Q.useEffect)(u,d);let f;return t[13]!==s||t[14]!==i?(f={status:i,refresh:s},t[13]=s,t[14]=i,t[15]=f):f=t[15],f}var $=t(),jt=`github.com`,Mt=new Map;async function Nt(e){try{let t=await e.json(),n=H.safeParse(t);if(n.success)return n.data.title}catch{}}async function Pt(e,t){return fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t??{})})}async function Ft(e){let t=e?.host??jt,n=await Pt(`/api/local-op/auth/status`,e);if(!n.ok)return{authenticated:!1,host:t,error:await Nt(n)};let r=await n.json(),i=typeof r.host==`string`?r.host:t,a=r.ghAvailable===!0;if(r.authenticated===!0&&typeof r.login==`string`){let e=r.tier===`A`||r.tier===`B`||r.tier===`C`?r.tier:void 0;return{authenticated:!0,host:i,login:r.login,tier:e,name:typeof r.name==`string`?r.name:void 0,email:typeof r.email==`string`?r.email:void 0,ghAvailable:a}}return{authenticated:!1,host:i,error:typeof r.error==`string`?r.error:void 0,ghAvailable:a}}function It(e){let t=e?.host??jt,n=Mt.get(t);if(n)return n;let r=Ft(e).finally(()=>{Mt.delete(t)});return Mt.set(t,r),r}function Lt(e){let t=e.split(`
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{_r as n,ar as r,i,nr as a,vr as o,xr as s}from"./DocumentContext-6gn-Aiv8.js";import{t as c}from"./react-f2sANaYj.js";import{n as l,r as u}from"./dist-Nvb76hAm.js";import{t as d}from"./compiler-runtime-BfE3aGVn.js";import{t as f}from"./utils-CPqDy6Hr.js";import{n as p,t as m}from"./clipboard-adapter-815RzzoI.js";import{C as h,S as g,_,a as v,h as y}from"./SkillInstallMenu-B3V2W9x9.js";import{t as b}from"./button-Cym3gapE.js";import{t as x}from"./dist-BHv-mziD.js";import{i as S,n as C,t as w}from"./tooltip-DttaCTqz.js";import{a as T,c as E,i as D,n as O,o as k,s as A,t as j}from"./dialog-Ba9N5nEw.js";import{t as M}from"./alert-dialog-BV3f4Vr2.js";import{t as N}from"./checkbox-UfDS9TpS.js";import{a as P,m as F,r as I,t as L}from"./dropdown-menu-CRvS0_4-.js";import{t as R}from"./label-D-K3fWtj.js";import{i as z,n as ee,o as te,s as ne,t as B}from"./select-XEGYznMI.js";import{n as re,t as V}from"./radio-group-npdxiS6E.js";import{Ct as H,Gt as U,Ht as W,Jt as G,Ko as K,Ut as ie,Wt as ae,Yo as oe,fo as se,js as ce,nn as le}from"./dist-DTZ5Uilk.js";import{n as q}from"./dist-CJhtNlOm2.js";import{c as ue}from"./use-settings-route-BFU85dl8.js";import{t as J}from"./dist-Cr4-nBVI.js";import{c as de,v as fe,x as Y}from"./documents-events-DxL5ysM1.js";import{i as pe}from"./use-apply-config-theme-CBmHKD_B.js";import{t as me}from"./parse-api-error-Dd8VI2eu.js";import{n as he}from"./use-workspace-BfO5PsIE.js";import{t as X}from"./createLucideIcon-BulbvLvN.js";import{h as ge,n as _e,r as ve,t as ye}from"./EnableSyncConfirmDialog-xkXGTFo0.js";import{c as be,s as xe,u as Se}from"./Mermaid-BAKMqFxz.js";import{t as Ce}from"./arrow-up-right-BTi7mHwL.js";import{t as we}from"./check-Dut4Aov8.js";import{s as Te}from"./prop-types-DcE7SWmX.js";import{n as Ee,t as De}from"./terminal-D4HSnHXf.js";import{a as Oe,r as ke,t as Ae}from"./folder-config-api-DrObHnBt.js";import{t as je}from"./spinner-t7GahFcQ.js";import{t as Me}from"./refresh-cw-DwRz6AkS.js";import{t as Ne}from"./trash-2-CePzTX_C.js";import{t as Pe}from"./triangle-alert-D0n54WVY.js";import{t as Fe}from"./x-C0WDbk6g.js";import{d as Ie,f as Le,n as Re,u as ze,v as Be}from"./doc-paths-CbSX4XTW.js";import"./config-provider-D9QQqC6e.js";import{S as Ve,h as He,i as Ue,p as We,x as Ge}from"./skills-api-DNXy9jz0.js";import{p as Ke,r as qe,t as Je}from"./skill-scope-grqY_b8j.js";import{t as Ye}from"./input-Cy2M_Avq.js";import{a as Xe,i as Ze,r as Qe,t as $e}from"./popover-B7jXm65e.js";import{t as et}from"./external-link-DGqXfQJy.js";import{t as tt}from"./badge-52pHek8I.js";import{a as nt,i as rt,n as it,o as at,r as ot,s as st,t as ct}from"./field-XqXEu64v.js";import{t as lt}from"./use-skills-Dn1UHdyr.js";import{t as ut}from"./textarea-BtqZ3yY1.js";import{t as dt}from"./terminal-command-events-ponJwwNv.js";var ft=X(`cloud-alert`,[[`path`,{d:`M12 12v4`,key:`tww15h`}],[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.128 16.949A7 7 0 1 1 15.71 8h1.79a1 1 0 0 1 0 9h-1.642`,key:`1namsd`}]]),pt=X(`cloud-off`,[[`path`,{d:`M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057`,key:`1uxyv8`}],[`path`,{d:`M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78`,key:`99tcn7`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),mt=X(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),ht=X(`log-in`,[[`path`,{d:`m10 17 5-5-5-5`,key:`1bsop3`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4`,key:`u53s6r`}]]),gt=X(`move-up-right`,[[`path`,{d:`M13 5H19V11`,key:`1n1gyv`}],[`path`,{d:`M19 5L5 19`,key:`72u4yj`}]]),_t=X(`user-cog`,[[`path`,{d:`M10 15H6a4 4 0 0 0-4 4v2`,key:`1nfge6`}],[`path`,{d:`m14.305 16.53.923-.382`,key:`1itpsq`}],[`path`,{d:`m15.228 13.852-.923-.383`,key:`eplpkm`}],[`path`,{d:`m16.852 12.228-.383-.923`,key:`13v3q0`}],[`path`,{d:`m16.852 17.772-.383.924`,key:`1i8mnm`}],[`path`,{d:`m19.148 12.228.383-.923`,key:`1q8j1v`}],[`path`,{d:`m19.53 18.696-.382-.924`,key:`vk1qj3`}],[`path`,{d:`m20.772 13.852.924-.383`,key:`n880s0`}],[`path`,{d:`m20.772 16.148.924.383`,key:`1g6xey`}],[`circle`,{cx:`18`,cy:`15`,r:`3`,key:`gjjjvw`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]);function vt(e){return e===`eperm`?J._({id:`XuQzrk`}):J._({id:`BUyQnq`})}async function yt(e){let t=await e.restartServer(e.config.projectPath);return t.ok?{ok:!0}:{ok:!1,message:vt(t.reason)}}var Z=d(),Q=e(c(),1);function bt(e){let t=(0,Z.c)(12),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={status:`idle`},t[0]=n):n=t[0];let[r,i]=(0,Q.useState)(n),[a,o]=(0,Q.useState)(0),s,c;t[1]===e?(s=t[2],c=t[3]):(s=()=>{if(e!==null)return Y(()=>{o(wt)})},c=[e],t[1]=e,t[2]=s,t[3]=c),(0,Q.useEffect)(s,c);let l;t[4]===e?l=t[5]:(l=()=>{if(e===null){i({status:`idle`});return}let t=!1;i({status:`loading`});let n=e?`?path=${encodeURIComponent(e)}`:``;return fetch(`/api/folder-config${n}`).then(St).then(e=>{if(!t){if(!e||typeof e!=`object`||!e.folder){i({status:`error`,message:J._({id:`_ci9Bj`})});return}i({status:`ready`,data:{folder:e.folder,frontmatterLocal:e.frontmatter_local??null}})}}).catch(e=>{t||i({status:`error`,message:e instanceof Error?e.message:String(e)})}),()=>{t=!0}},t[4]=e,t[5]=l);let u;t[6]!==e||t[7]!==a?(u=[e,a],t[6]=e,t[7]=a,t[8]=u):u=t[8],(0,Q.useEffect)(l,u);let d;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>o(xt),t[9]=d):d=t[9];let f;return t[10]===r?f=t[11]:(f={state:r,refresh:d},t[10]=r,t[11]=f),f}function xt(e){return e+1}async function St(e){if(!e.ok){let t=await e.json().catch(Ct);throw Error(me(t)??`HTTP ${e.status}`)}return e.json()}function Ct(){return null}function wt(e){return e+1}function Tt(){let e=(0,Z.c)(6),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={status:`idle`},e[0]=t):t=e[0];let[n,r]=(0,Q.useState)(t),[i,a]=(0,Q.useState)(0),o,s;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>Y(()=>{a(Ot)}),s=[],e[1]=o,e[2]=s):(o=e[1],s=e[2]),(0,Q.useEffect)(o,s);let c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=!1;return r({status:`loading`}),fetch(`/api/templates`).then(Et).then(t=>{if(e)return;let n=le.safeParse(t);if(!n.success){console.error(`[ok-templates] /api/templates response failed schema validation:`,n.error.issues),r({status:`error`,message:J._({id:`RLNIgv`})});return}r({status:`ready`,data:n.data.templates})}).catch(t=>{e||r({status:`error`,message:t instanceof Error?t.message:String(t)})}),()=>{e=!0}},e[3]=c):c=e[3];let l;return e[4]===i?l=e[5]:(l=[i],e[4]=i,e[5]=l),(0,Q.useEffect)(c,l),n}async function Et(e){if(!e.ok){let t=await e.json().catch(Dt);throw Error(me(t)??`HTTP ${e.status}`)}return e.json()}function Dt(){return null}function Ot(e){return e+1}async function kt(){try{let e=await fetch(`/api/semantic-status`);return e.ok?await e.json():(console.debug(`[semantic-status] probe returned`,e.status),null)}catch(e){return console.debug(`[semantic-status] probe failed`,e),null}}function At(e){let t=(0,Z.c)(16),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let r=n.enabled??!0,[i,a]=(0,Q.useState)(null),o;t[2]===r?o=t[3]:(o=function(){r&&kt().then(e=>{e&&a(e)})},t[2]=r,t[3]=o);let s=o,c;t[4]===s?c=t[5]:(c=()=>{s()},t[4]=s,t[5]=c);let l;t[6]===r?l=t[7]:(l=[r],t[6]=r,t[7]=l),(0,Q.useEffect)(c,l);let u;t[8]!==r||t[9]!==s?(u=()=>{if(r)return fe(e=>{e.includes(`files`)&&s()})},t[8]=r,t[9]=s,t[10]=u):u=t[10];let d;t[11]===r?d=t[12]:(d=[r],t[11]=r,t[12]=d),(0,Q.useEffect)(u,d);let f;return t[13]!==s||t[14]!==i?(f={status:i,refresh:s},t[13]=s,t[14]=i,t[15]=f):f=t[15],f}var $=t(),jt=`github.com`,Mt=new Map;async function Nt(e){try{let t=await e.json(),n=H.safeParse(t);if(n.success)return n.data.title}catch{}}async function Pt(e,t){return fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t??{})})}async function Ft(e){let t=e?.host??jt,n=await Pt(`/api/local-op/auth/status`,e);if(!n.ok)return{authenticated:!1,host:t,error:await Nt(n)};let r=await n.json(),i=typeof r.host==`string`?r.host:t,a=r.ghAvailable===!0;if(r.authenticated===!0&&typeof r.login==`string`){let e=r.tier===`A`||r.tier===`B`||r.tier===`C`?r.tier:void 0;return{authenticated:!0,host:i,login:r.login,tier:e,name:typeof r.name==`string`?r.name:void 0,email:typeof r.email==`string`?r.email:void 0,ghAvailable:a}}return{authenticated:!1,host:i,error:typeof r.error==`string`?r.error:void 0,ghAvailable:a}}function It(e){let t=e?.host??jt,n=Mt.get(t);if(n)return n;let r=Ft(e).finally(()=>{Mt.delete(t)});return Mt.set(t,r),r}function Lt(e){let t=e.split(`
2
2
  `);for(let e=t.length-1;e>=0;e--){let n=t[e]?.trim();if(n)try{let e=JSON.parse(n);if(e&&typeof e==`object`)return e}catch{}}return null}function Rt(){return{status:It,async repos(e){let t=e?.host??`github.com`,n=await Pt(`/api/local-op/auth/repos`,e);if(!n.ok)return{ok:!1,error:await Nt(n)??J._({id:`sGZLfB`})};let r=Lt(await n.text());if(r&&r.type===`error`&&r.problem&&typeof r.problem==`object`){let e=r.problem;return{ok:!1,error:e.detail||e.title||J._({id:`sGZLfB`})}}if(!r||!Array.isArray(r.repos))return{ok:!1,error:J._({id:`sGZLfB`})};let i=[];for(let e of r.repos){let t=e;typeof t?.full_name==`string`&&typeof t.clone_url==`string`&&i.push({full_name:t.full_name,clone_url:t.clone_url,private:t.private===!0})}return{ok:!0,host:typeof r.host==`string`?r.host:t,repos:i}},async signout(e){let t=await Pt(`/api/local-op/auth/signout`,e);return t.ok?{ok:!0}:{ok:!1,error:await Nt(t)}}}}function zt(e){return{status:t=>e.localOp.authStatus(t),repos:t=>e.localOp.authRepos(t)}}async function Bt(e,t){let n=e.getReader(),r=new TextDecoder,i=``;for(;;){let{done:e,value:a}=await n.read();if(e)return i+=r.decode(),!!(i.trim()&&t(i)===`terminal`);i+=r.decode(a,{stream:!0});let o=i.split(`
3
- `);i=o.pop()??``;for(let e of o)if(e.trim()&&t(e)===`terminal`)return!0}}function Vt(e){let t=[],n=[],r=new AbortController,i=!1,a=()=>{for(let e of n.splice(0))e(null)};return e(e=>{i||(n.length>0?n.shift()?.(e):t.push(e),(e.type===`complete`||e.type===`error`)&&(i=!0,r.abort(),a()))},r.signal),{events:{[Symbol.asyncIterator](){return{async next(){if(t.length>0){let e=t.shift();return e===void 0?{value:void 0,done:!0}:{value:e,done:!1}}return i?{value:void 0,done:!0}:new Promise(e=>{n.push(t=>{e(t===null?{value:void 0,done:!0}:{value:t,done:!1})})})}}}},cancel:()=>{i||(i=!0,r.abort(),a())}}}var Ht=2e3,Ut=1e4;function Wt(e,t){return new Promise(n=>{let r=setTimeout(()=>{t.removeEventListener(`abort`,i),n()},e);function i(){clearTimeout(r),n()}t.addEventListener(`abort`,i,{once:!0})})}function Gt(e){fetch(`/api/local-op/auth/cancel`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({channel:e})}).catch(e=>{console.warn(`[auth-transport] Cancel request failed (best-effort):`,e instanceof Error?e.message:e)})}async function Kt(e,t,n,r){let i=Rt(),a=Ht;for(;!t.aborted&&Date.now()<n;){try{let n=await i.status(r?{host:r}:void 0);if(t.aborted)return;if(n.authenticated){e({type:`complete`,host:n.host,login:n.login,name:n.name,email:n.email});return}}catch(e){console.warn(`[auth-transport] Recovery probe failed:`,e instanceof Error?e.message:e)}await Wt(a,t),a=Math.min(a*1.5,Ut)}t.aborted||e({type:`error`,message:J._({id:`ve8vEM`})})}function qt(e,t,n){let r=!1,i=Vt((n,i)=>{let a=e=>{(e.type===`complete`||e.type===`error`)&&(r=!0),n(e)};(async()=>{let n=null;try{let r=await fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t),signal:i});if(!r.ok){let e=J._({id:`LnVIW4`});try{let t=H.safeParse(await r.json());t.success&&(e=t.data.title)}catch{}a({type:`error`,message:e});return}if(!r.body){a({type:`error`,message:J._({id:`LnVIW4`})});return}if(await Bt(r.body,e=>{let t;try{t=JSON.parse(e)}catch{return console.warn(`[auth-transport] Dropped unparseable NDJSON line:`,e.slice(0,100)),`continue`}if(t&&typeof t==`object`&&t.type===`error`&&`problem`in t){let e=t.problem;return a({type:`error`,message:e?.detail||e?.title||J._({id:`29VNqC`})}),`terminal`}if(t.type===`ping`)return`continue`;let r=t;return r.type===`verification`&&(n=Date.now()+r.expires_in*1e3),a(r),r.type===`complete`||r.type===`error`?`terminal`:`continue`})||i.aborted)return;if(n===null){a({type:`error`,message:J._({id:`DskIkK`})});return}await Kt(a,i,n,t.host)}catch(e){if(e instanceof Error&&e.name===`AbortError`)return;if(n!==null){await Kt(a,i,n,t.host);return}a({type:`error`,message:J._({id:`Q5fqMz`})})}})()});return{events:i.events,cancel:()=>{r||Gt(n),i.cancel()}}}function Jt(){return{start(){return qt(`/api/local-op/auth/login`,{json:!0},`login`)},ghLogin(e){return qt(`/api/local-op/auth/gh-login`,{host:e,json:!0},`gh-login`)},async pat(e,t){try{let n=await fetch(`/api/local-op/auth/pat`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({host:e,token:t})});if(n.ok){let e=await n.json();return{ok:!0,login:typeof e.login==`string`?e.login:``}}let r=J._({id:`sNeKjP`});try{let e=H.safeParse(await n.json());e.success&&(r=e.data.detail||e.data.title)}catch{}return{ok:!1,error:r}}catch{return{ok:!1,error:J._({id:`Q5fqMz`})}}}}}function Yt(e){return{start(){return e.localOp.auth.start()}}}async function Xt(e){try{await navigator.clipboard.writeText(e)}catch{}}function Zt(e){let t=(0,Z.c)(25),{onSuccess:r,startFlow:i}=e,{_:a}=u(),[o,s]=(0,Q.useState)(null),[c,d]=(0,Q.useState)(`https://github.com/login/device`),[f,p]=(0,Q.useState)(!1),[m,h]=(0,Q.useState)(null),[g,_]=(0,Q.useState)(null),[v,y]=(0,Q.useState)(0),x=(0,Q.useRef)(null),S=(0,Q.useRef)(null),C;t[0]!==a||t[1]!==r||t[2]!==i?(C=async function(){h(null);try{let e=i();x.current=e.cancel;let t=e.events[Symbol.asyncIterator](),n=!1,o=await t.next();for(;!o.done;){let e=o.value;if(e.type===`verification`)s(e.user_code),d(e.verification_uri),_(Date.now()+e.expires_in*1e3),y(e.expires_in*1e3),Xt(e.user_code).then(()=>{p(!0),setTimeout(()=>p(!1),2e3)});else if(e.type===`complete`){n=!0,r({login:e.login,name:e.name,email:e.email,avatarUrl:e.avatarUrl});break}else if(e.type===`error`){n=!0,h(e.message);break}o=await t.next()}n||h(a({id:`DskIkK`}))}catch(e){let t=e;t instanceof Error&&t.name!==`AbortError`&&h(a({id:`Q5fqMz`}))}},t[0]=a,t[1]=r,t[2]=i,t[3]=C):C=t[3];let w=C,T;t[4]===w?T=t[5]:(T=()=>{let e=!1;return queueMicrotask(()=>{e||w()}),()=>{e=!0,x.current?.(),x.current=null,S.current&&clearInterval(S.current)}},t[4]=w,t[5]=T);let E;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(E=[],t[6]=E):E=t[6],(0,Q.useEffect)(T,E);let D,O;t[7]!==a||t[8]!==g?(D=()=>{if(g!==null)return S.current=setInterval(()=>{let e=g-Date.now();e<=0?(y(0),S.current&&clearInterval(S.current),h(a({id:`ve8vEM`}))):y(e)},1e3),()=>{S.current&&clearInterval(S.current)}},O=[g,a],t[7]=a,t[8]=g,t[9]=D,t[10]=O):(D=t[9],O=t[10]),(0,Q.useEffect)(D,O);let k=Math.floor(v/6e4),A=Math.floor(v%6e4/1e3),j;t[11]===A?j=t[12]:(j=A.toString().padStart(2,`0`),t[11]=A,t[12]=j);let M=`${k}:${j}`,N;t[13]!==a||t[14]!==f||t[15]!==m||t[16]!==M||t[17]!==o||t[18]!==c?(N=o?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(l,{id:`eVPynQ`,values:{verificationUri:c},components:{0:(0,$.jsx)(`a`,{href:c,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>et(e,c),onAuxClick:e=>et(e,c),className:`inline-flex items-center gap-0.5 text-foreground hover:text-primary hover:underline`}),1:(0,$.jsx)(`span`,{}),2:(0,$.jsx)(Ce,{className:`inline size-3.5`,"aria-hidden":!0})}})}),(0,$.jsxs)(b,{type:`button`,variant:`outline`,"aria-label":a({id:`nCzR-G`,values:{userCode:o}}),onClick:()=>void Xt(o).then(()=>{p(!0),setTimeout(()=>p(!1),2e3)}),className:`relative h-auto w-full justify-center rounded-md bg-muted px-12 py-3 hover:bg-muted/80`,children:[(0,$.jsx)(`code`,{className:`font-mono text-2xl font-bold tracking-widest`,children:o}),(0,$.jsx)(`span`,{className:`absolute right-3 text-muted-foreground`,"aria-hidden":`true`,children:f?(0,$.jsx)(we,{className:`size-4`}):(0,$.jsx)(n,{className:`size-4`})})]}),(0,$.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`sr-only`,children:f?(0,$.jsx)(l,{id:`80c4-P`}):null}),(0,$.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(`span`,{className:`size-1.5 rounded-full bg-amber-500 animate-pulse`}),(0,$.jsx)(l,{id:`5y_9lO`})]}),(0,$.jsx)(`span`,{children:(0,$.jsx)(l,{id:`gYz2ep`,values:{timeLabel:M}})})]})]}):(0,$.jsx)(`div`,{className:`flex items-center justify-center py-6 text-sm text-muted-foreground`,children:m?null:(0,$.jsx)(l,{id:`aWlJai`})}),t[13]=a,t[14]=f,t[15]=m,t[16]=M,t[17]=o,t[18]=c,t[19]=N):N=t[19];let P;t[20]===m?P=t[21]:(P=m&&(0,$.jsx)(`p`,{className:`text-1sm text-destructive`,children:m}),t[20]=m,t[21]=P);let F;return t[22]!==N||t[23]!==P?(F=(0,$.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[N,P]}),t[22]=N,t[23]=P,t[24]=F):F=t[24],F}function Qt(e){let t=(0,Z.c)(30),{login:n,name:r,onNameChange:i,email:a,onEmailChange:o}=e,{_:s}=u(),c;t[0]===n?c=t[1]:(c=(0,$.jsx)(`p`,{className:`text-sm font-medium`,children:(0,$.jsx)(l,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=c);let d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(l,{id:`gp3I7-`})}),t[2]=d):d=t[2];let f;t[3]===s?f=t[4]:(f=s({id:`6YtxFj`}),t[3]=s,t[4]=f);let p;t[5]!==s||t[6]!==n?(p=s({id:`J2Mv98`,values:{login:n}}),t[5]=s,t[6]=n,t[7]=p):p=t[7];let m;t[8]===i?m=t[9]:(m=e=>i(e.target.value),t[8]=i,t[9]=m);let h;t[10]!==r||t[11]!==f||t[12]!==p||t[13]!==m?(h=(0,$.jsx)(Ye,{"aria-label":f,placeholder:p,value:r,onChange:m}),t[10]=r,t[11]=f,t[12]=p,t[13]=m,t[14]=h):h=t[14];let g;t[15]===s?g=t[16]:(g=s({id:`O3oNi5`}),t[15]=s,t[16]=g);let _;t[17]===s?_=t[18]:(_=s({id:`O3oNi5`}),t[17]=s,t[18]=_);let v;t[19]===o?v=t[20]:(v=e=>o(e.target.value),t[19]=o,t[20]=v);let y;t[21]!==a||t[22]!==g||t[23]!==_||t[24]!==v?(y=(0,$.jsx)(Ye,{type:`email`,"aria-label":g,placeholder:_,value:a,onChange:v}),t[21]=a,t[22]=g,t[23]=_,t[24]=v,t[25]=y):y=t[25];let b;return t[26]!==c||t[27]!==y||t[28]!==h?(b=(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[c,d,h,y]}),t[26]=c,t[27]=y,t[28]=h,t[29]=b):b=t[29],b}function $t(e){let t=(0,Z.c)(37),{host:n,token:r,onTokenChange:i,error:a,onSubmit:o,showGhOption:s,onGhSignIn:c}=e,{_:d}=u(),f=`https://${n}/settings/tokens/new?scopes=repo,read:user&description=OpenKnowledge`,p;t[0]!==n||t[1]!==c||t[2]!==s?(p=s?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(b,{type:`button`,onClick:c,children:(0,$.jsx)(l,{id:`_SDGzH`})}),(0,$.jsxs)(`div`,{className:`flex items-center gap-3 text-xs text-muted-foreground`,children:[(0,$.jsx)(`span`,{className:`h-px flex-1 bg-border`}),(0,$.jsx)(l,{id:`8L0EPw`}),(0,$.jsx)(`span`,{className:`h-px flex-1 bg-border`})]})]}):(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(l,{id:`8k6INX`,values:{host:n},components:{0:(0,$.jsx)(`span`,{className:`font-medium text-foreground`})}})}),t[0]=n,t[1]=c,t[2]=s,t[3]=p):p=t[3];let m,h;t[4]===f?(m=t[5],h=t[6]):(m=e=>et(e,f),h=e=>et(e,f),t[4]=f,t[5]=m,t[6]=h);let g;t[7]===n?g=t[8]:(g=(0,$.jsx)(l,{id:`6hYjww`,values:{host:n}}),t[7]=n,t[8]=g);let _;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(Ce,{className:`inline size-3.5`,"aria-hidden":!0}),t[9]=_):_=t[9];let v;t[10]!==f||t[11]!==m||t[12]!==h||t[13]!==g?(v=(0,$.jsxs)(`a`,{href:f,target:`_blank`,rel:`noopener noreferrer`,onClick:m,onAuxClick:h,className:`inline-flex w-fit items-center gap-0.5 text-sm text-foreground hover:text-primary hover:underline`,children:[g,_]}),t[10]=f,t[11]=m,t[12]=h,t[13]=g,t[14]=v):v=t[14];let y;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,$.jsx)(l,{id:`Xg-Ntj`})}),t[15]=y):y=t[15];let x;t[16]===d?x=t[17]:(x=d({id:`p2LEhJ`}),t[16]=d,t[17]=x);let S;t[18]===i?S=t[19]:(S=e=>i(e.target.value),t[18]=i,t[19]=S);let C;t[20]===o?C=t[21]:(C=e=>{e.key===`Enter`&&o()},t[20]=o,t[21]=C);let w;t[22]!==C||t[23]!==x||t[24]!==S||t[25]!==r?(w=(0,$.jsx)(Ye,{type:`password`,"aria-label":x,placeholder:`ghp_`,value:r,onChange:S,onKeyDown:C}),t[22]=C,t[23]=x,t[24]=S,t[25]=r,t[26]=w):w=t[26];let T;t[27]===a?T=t[28]:(T=a&&(0,$.jsx)(`p`,{className:`text-1sm text-destructive`,children:a}),t[27]=a,t[28]=T);let E;t[29]===s?E=t[30]:(E=!s&&(0,$.jsxs)(`div`,{className:`mt-1 rounded-md border border-border/60 bg-muted/40 p-3 text-sm text-muted-foreground`,children:[(0,$.jsx)(`p`,{children:(0,$.jsx)(l,{id:`qX-ABr`})}),(0,$.jsxs)(`ol`,{className:`mt-1.5 list-decimal space-y-0.5 pl-5`,children:[(0,$.jsx)(`li`,{children:(0,$.jsx)(l,{id:`jxtXZI`})}),(0,$.jsx)(`li`,{children:(0,$.jsx)(l,{id:`9Vh9Jf`})})]})]}),t[29]=s,t[30]=E);let D;return t[31]!==p||t[32]!==w||t[33]!==T||t[34]!==E||t[35]!==v?(D=(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[p,v,y,w,T,E]}),t[31]=p,t[32]=w,t[33]=T,t[34]=E,t[35]=v,t[36]=D):D=t[36],D}var en=1e4;function tn(e){let t=(0,Z.c)(92),{open:n,onOpenChange:r,onSuccess:i,identityPrompt:a,reauth:o,transport:s,queryTransport:c,host:d,ghAvailable:f}=e,{_:p}=u(),m;t[0]===s?m=t[1]:(m=s??Jt(),t[0]=s,t[1]=m);let h=m,g;t[2]===c?g=t[3]:(g=c??Rt(),t[2]=c,t[3]=g);let _=g,[v,y]=(0,Q.useState)(`auth`),[x,S]=(0,Q.useState)(null),[C,w]=(0,Q.useState)(``),[T,M]=(0,Q.useState)(``),[N,P]=(0,Q.useState)(``),[F,I]=(0,Q.useState)(null),[L,R]=(0,Q.useState)(!1),[z,ee]=(0,Q.useState)(void 0),[te,ne]=(0,Q.useState)(void 0),B=d??z,re=!!B&&B!==`github.com`&&!!(f??te)&&typeof h.ghLogin==`function`,V=!a&&d===void 0,H,U;t[4]!==d||t[5]!==a||t[6]!==V||t[7]!==n?(H=()=>{n&&(S(null),w(``),M(``),P(``),I(null),R(!1),ee(void 0),ne(void 0),y(a||V?`checking`:d&&d!==`github.com`?`pat`:`auth`))},U=[n,a,d,V],t[4]=d,t[5]=a,t[6]=V,t[7]=n,t[8]=H,t[9]=U):(H=t[8],U=t[9]),(0,Q.useLayoutEffect)(H,U);let W;t[10]!==a||t[11]!==n||t[12]!==_?(W=()=>{if(!n||!a)return;let e=!1,t=t=>{e||(e=!0,y(t))},r=setTimeout(()=>t(`auth`),en);return _.status().then(n=>{e||(n.authenticated?(S({login:n.login,name:n.name,email:n.email}),w(n.name??``),M(n.email??``),t(`identity`)):t(`auth`))}).catch(()=>{t(`auth`)}),()=>{e=!0,clearTimeout(r)}},t[10]=a,t[11]=n,t[12]=_,t[13]=W):W=t[13];let G;t[14]!==a||t[15]!==n?(G=[n,a],t[14]=a,t[15]=n,t[16]=G):G=t[16],(0,Q.useEffect)(W,G);let K;t[17]!==V||t[18]!==n||t[19]!==_?(K=()=>{if(!n||!V)return;let e=!1,t=t=>{e||(e=!0,y(t))},r=setTimeout(()=>t(`auth`),en);return _.status().then(n=>{if(e)return;let r=!!n.host&&n.host!==`github.com`;ee(n.host),ne(n.ghAvailable),t(r?`pat`:`auth`)}).catch(()=>{t(`auth`)}),()=>{e=!0,clearTimeout(r)}},t[17]=V,t[18]=n,t[19]=_,t[20]=K):K=t[20];let ie;t[21]!==V||t[22]!==n?(ie=[n,V],t[21]=V,t[22]=n,t[23]=ie):ie=t[23],(0,Q.useEffect)(K,ie);let ae;t[24]!==p||t[25]!==a||t[26]!==r||t[27]!==i?(ae=function(e){if(S(e),a)w(e.name??``),M(e.email??``),y(`identity`);else{y(`done`),i?.(e),r(!1);let t=e.login;q.success(p(t?{id:`E_tNGD`,values:{login:t}}:{id:`cgl-gn`}))}},t[24]=p,t[25]=a,t[26]=r,t[27]=i,t[28]=ae):ae=t[28];let oe=ae,se;t[29]!==p||t[30]!==B||t[31]!==oe||t[32]!==L||t[33]!==N||t[34]!==h?(se=async function(){let e=N.trim();if(!e||!B||L)return;if(!h.pat){I(p({id:`iMYFJM`}));return}R(!0),I(null);let t=await h.pat(B,e);R(!1),t.ok?oe({login:t.login??``}):I(t.error??p({id:`sNeKjP`}))},t[29]=p,t[30]=B,t[31]=oe,t[32]=L,t[33]=N,t[34]=h,t[35]=se):se=t[35];let ce=se,le;t[36]!==p||t[37]!==x||t[38]!==r||t[39]!==i?(le=function(e,t){fetch(`/api/local-op/auth/set-identity`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({name:e,email:t})}).catch(nn);let n={...x??{login:``},name:e,email:t};y(`done`),i?.(n),r(!1);let a=n.login;q.success(p(a?{id:`E_tNGD`,values:{login:a}}:{id:`cgl-gn`}))},t[36]=p,t[37]=x,t[38]=r,t[39]=i,t[40]=le):le=t[40];let ue=le,J;t[41]!==p||t[42]!==x||t[43]!==r||t[44]!==i?(J=function(){if(!x)return;y(`done`),i?.(x),r(!1);let e=x.login;q.success(p(e?{id:`E_tNGD`,values:{login:e}}:{id:`cgl-gn`}))},t[41]=p,t[42]=x,t[43]=r,t[44]=i,t[45]=J):J=t[45];let de=J,fe;t[46]===r?fe=t[47]:(fe=function(){r(!1)},t[46]=r,t[47]=fe);let Y=fe,pe;t[48]!==a||t[49]!==o||t[50]!==v?(pe=(0,$.jsx)(A,{children:(0,$.jsx)(E,{children:o&&(v===`pat`||v===`gh-device`)?(0,$.jsx)(l,{id:`DUWgfT`}):o?(0,$.jsx)(l,{id:`X8kjQX`}):v===`pat`||v===`gh-device`?(0,$.jsx)(l,{id:`tzZ6ha`}):a&&v!==`auth`?(0,$.jsx)(l,{id:`29XZXN`}):(0,$.jsx)(l,{id:`3jod3l`})})}),t[48]=a,t[49]=o,t[50]=v,t[51]=pe):pe=t[51];let me;t[52]===v?me=t[53]:(me=v===`checking`&&(0,$.jsx)(O,{children:(0,$.jsx)(`div`,{className:`flex items-center justify-center py-6 text-sm text-muted-foreground`,children:(0,$.jsx)(l,{id:`gBbxn_`})})}),t[52]=v,t[53]=me);let he;t[54]!==oe||t[55]!==Y||t[56]!==h||t[57]!==v?(he=v===`auth`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(O,{children:(0,$.jsx)(Zt,{onSuccess:oe,startFlow:()=>h.start()})}),(0,$.jsx)(k,{children:(0,$.jsx)(b,{variant:`outline`,className:`font-mono uppercase`,onClick:Y,children:(0,$.jsx)(l,{id:`dEgA5A`})})})]}),t[54]=oe,t[55]=Y,t[56]=h,t[57]=v,t[58]=he):he=t[58];let X;t[59]!==re||t[60]!==B||t[61]!==Y||t[62]!==ce||t[63]!==F||t[64]!==L||t[65]!==N||t[66]!==v?(X=v===`pat`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(O,{children:(0,$.jsx)($t,{host:B??``,token:N,onTokenChange:P,error:F,onSubmit:ce,showGhOption:re,onGhSignIn:()=>y(`gh-device`)})}),(0,$.jsxs)(k,{children:[(0,$.jsx)(b,{variant:`outline`,className:`font-mono uppercase`,onClick:Y,children:(0,$.jsx)(l,{id:`dEgA5A`})}),(0,$.jsx)(b,{onClick:ce,disabled:!N.trim()||L,children:L?(0,$.jsx)(l,{id:`9zb2WA`}):(0,$.jsx)(l,{id:`iSLIjg`})})]})]}),t[59]=re,t[60]=B,t[61]=Y,t[62]=ce,t[63]=F,t[64]=L,t[65]=N,t[66]=v,t[67]=X):X=t[67];let ge;t[68]!==B||t[69]!==oe||t[70]!==Y||t[71]!==h||t[72]!==v?(ge=v===`gh-device`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(O,{children:(0,$.jsx)(Zt,{onSuccess:oe,startFlow:()=>h.ghLogin?.(B??``)??h.start()})}),(0,$.jsxs)(k,{children:[(0,$.jsx)(b,{variant:`ghost`,onClick:()=>y(`pat`),children:(0,$.jsx)(l,{id:`hLKfZe`})}),(0,$.jsx)(b,{variant:`outline`,className:`font-mono uppercase`,onClick:Y,children:(0,$.jsx)(l,{id:`dEgA5A`})})]})]}),t[68]=B,t[69]=oe,t[70]=Y,t[71]=h,t[72]=v,t[73]=ge):ge=t[73];let _e;t[74]!==x||t[75]!==ue||t[76]!==de||t[77]!==T||t[78]!==C||t[79]!==v?(_e=v===`identity`&&x&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(O,{children:(0,$.jsx)(Qt,{login:x.login,name:C,onNameChange:w,email:T,onEmailChange:M})}),(0,$.jsxs)(k,{children:[(0,$.jsx)(b,{variant:`ghost`,onClick:de,children:(0,$.jsx)(l,{id:`6Uau97`})}),(0,$.jsx)(b,{onClick:()=>ue(C.trim(),T.trim()),disabled:!C.trim()||!T.trim(),children:(0,$.jsx)(l,{id:`tfDRzk`})})]})]}),t[74]=x,t[75]=ue,t[76]=de,t[77]=T,t[78]=C,t[79]=v,t[80]=_e):_e=t[80];let ve;t[81]!==pe||t[82]!==me||t[83]!==he||t[84]!==X||t[85]!==ge||t[86]!==_e?(ve=(0,$.jsxs)(D,{className:`sm:max-w-md`,children:[pe,me,he,X,ge,_e]}),t[81]=pe,t[82]=me,t[83]=he,t[84]=X,t[85]=ge,t[86]=_e,t[87]=ve):ve=t[87];let ye;return t[88]!==r||t[89]!==n||t[90]!==ve?(ye=(0,$.jsx)(j,{open:n,onOpenChange:r,children:ve}),t[88]=r,t[89]=n,t[90]=ve,t[91]=ye):ye=t[91],ye}function nn(){}function rn(e){let t=(0,Z.c)(16),{value:n,onChange:r,disabled:i,placeholder:a,rows:o}=e,s=i===void 0?!1:i,c=o===void 0?12:o,u=(0,Q.useId)(),d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(l,{id:`3o3tur`}),t[0]=d):d=t[0];let f;t[1]===u?f=t[2]:(f=(0,$.jsx)(at,{htmlFor:u,children:d}),t[1]=u,t[2]=f);let p;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(ot,{children:(0,$.jsx)(l,{id:`5gr_ev`,values:{dateToken:`{{date}}`,userToken:`{{user}}`},components:{0:(0,$.jsx)(`code`,{className:`font-mono`}),1:(0,$.jsx)(`code`,{className:`font-mono`})}})}),t[3]=p):p=t[3];let m;t[4]===r?m=t[5]:(m=e=>r(e.target.value),t[4]=r,t[5]=m);let h;t[6]!==s||t[7]!==u||t[8]!==a||t[9]!==c||t[10]!==m||t[11]!==n?(h=(0,$.jsx)(ut,{id:u,value:n,onChange:m,disabled:s,rows:c,spellCheck:!1,placeholder:a,className:`font-mono text-xs leading-relaxed min-h-72`}),t[6]=s,t[7]=u,t[8]=a,t[9]=c,t[10]=m,t[11]=n,t[12]=h):h=t[12];let g;return t[13]!==f||t[14]!==h?(g=(0,$.jsxs)(ct,{children:[f,p,h]}),t[13]=f,t[14]=h,t[15]=g):g=t[15],g}var an=/^[A-Za-z0-9_-]+$/;function on(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)}function sn(e){let t={},n=e.title.trim();n&&(t.title=n);let r=e.description.trim();return r&&(t.description=r),t}var cn=0;function ln(){return cn+=1,`prop-${cn}`}function un(e){let{frontmatter:t,body:n}=K(e);if(t===``)return{type:``,properties:[],markdown:e};let r=[];for(let e of oe(t).split(`
3
+ `);i=o.pop()??``;for(let e of o)if(e.trim()&&t(e)===`terminal`)return!0}}function Vt(e){let t=[],n=[],r=new AbortController,i=!1,a=()=>{for(let e of n.splice(0))e(null)};return e(e=>{i||(n.length>0?n.shift()?.(e):t.push(e),(e.type===`complete`||e.type===`error`)&&(i=!0,r.abort(),a()))},r.signal),{events:{[Symbol.asyncIterator](){return{async next(){if(t.length>0){let e=t.shift();return e===void 0?{value:void 0,done:!0}:{value:e,done:!1}}return i?{value:void 0,done:!0}:new Promise(e=>{n.push(t=>{e(t===null?{value:void 0,done:!0}:{value:t,done:!1})})})}}}},cancel:()=>{i||(i=!0,r.abort(),a())}}}var Ht=2e3,Ut=1e4;function Wt(e,t){return new Promise(n=>{let r=setTimeout(()=>{t.removeEventListener(`abort`,i),n()},e);function i(){clearTimeout(r),n()}t.addEventListener(`abort`,i,{once:!0})})}function Gt(e){fetch(`/api/local-op/auth/cancel`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({channel:e})}).catch(e=>{console.warn(`[auth-transport] Cancel request failed (best-effort):`,e instanceof Error?e.message:e)})}async function Kt(e,t,n,r){let i=Rt(),a=Ht;for(;!t.aborted&&Date.now()<n;){try{let n=await i.status(r?{host:r}:void 0);if(t.aborted)return;if(n.authenticated){e({type:`complete`,host:n.host,login:n.login,name:n.name,email:n.email});return}}catch(e){console.warn(`[auth-transport] Recovery probe failed:`,e instanceof Error?e.message:e)}await Wt(a,t),a=Math.min(a*1.5,Ut)}t.aborted||e({type:`error`,message:J._({id:`ve8vEM`})})}function qt(e,t,n){let r=!1,i=Vt((n,i)=>{let a=e=>{(e.type===`complete`||e.type===`error`)&&(r=!0),n(e)};(async()=>{let n=null;try{let r=await fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t),signal:i});if(!r.ok){let e=J._({id:`LnVIW4`});try{let t=H.safeParse(await r.json());t.success&&(e=t.data.title)}catch{}a({type:`error`,message:e});return}if(!r.body){a({type:`error`,message:J._({id:`LnVIW4`})});return}if(await Bt(r.body,e=>{let t;try{t=JSON.parse(e)}catch{return console.warn(`[auth-transport] Dropped unparseable NDJSON line:`,e.slice(0,100)),`continue`}if(t&&typeof t==`object`&&t.type===`error`&&`problem`in t){let e=t.problem;return a({type:`error`,message:e?.detail||e?.title||J._({id:`29VNqC`})}),`terminal`}if(t.type===`ping`)return`continue`;let r=t;return r.type===`verification`&&(n=Date.now()+r.expires_in*1e3),a(r),r.type===`complete`||r.type===`error`?`terminal`:`continue`})||i.aborted)return;if(n===null){a({type:`error`,message:J._({id:`DskIkK`})});return}await Kt(a,i,n,t.host)}catch(e){if(e instanceof Error&&e.name===`AbortError`)return;if(n!==null){await Kt(a,i,n,t.host);return}a({type:`error`,message:J._({id:`Q5fqMz`})})}})()});return{events:i.events,cancel:()=>{r||Gt(n),i.cancel()}}}function Jt(){return{start(){return qt(`/api/local-op/auth/login`,{json:!0},`login`)},ghLogin(e){return qt(`/api/local-op/auth/gh-login`,{host:e,json:!0},`gh-login`)},async pat(e,t){try{let n=await fetch(`/api/local-op/auth/pat`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({host:e,token:t})});if(n.ok){let e=await n.json();return{ok:!0,login:typeof e.login==`string`?e.login:``}}let r=J._({id:`sNeKjP`});try{let e=H.safeParse(await n.json());e.success&&(r=e.data.detail||e.data.title)}catch{}return{ok:!1,error:r}}catch{return{ok:!1,error:J._({id:`Q5fqMz`})}}}}}function Yt(e){return{start(){return e.localOp.auth.start()}}}async function Xt(e){try{await navigator.clipboard.writeText(e)}catch{}}function Zt(e){let t=(0,Z.c)(25),{onSuccess:n,startFlow:r}=e,{_:i}=u(),[a,s]=(0,Q.useState)(null),[c,d]=(0,Q.useState)(`https://github.com/login/device`),[f,p]=(0,Q.useState)(!1),[m,h]=(0,Q.useState)(null),[g,_]=(0,Q.useState)(null),[v,y]=(0,Q.useState)(0),x=(0,Q.useRef)(null),S=(0,Q.useRef)(null),C;t[0]!==i||t[1]!==n||t[2]!==r?(C=async function(){h(null);try{let e=r();x.current=e.cancel;let t=e.events[Symbol.asyncIterator](),a=!1,o=await t.next();for(;!o.done;){let e=o.value;if(e.type===`verification`)s(e.user_code),d(e.verification_uri),_(Date.now()+e.expires_in*1e3),y(e.expires_in*1e3),Xt(e.user_code).then(()=>{p(!0),setTimeout(()=>p(!1),2e3)});else if(e.type===`complete`){a=!0,n({login:e.login,name:e.name,email:e.email,avatarUrl:e.avatarUrl});break}else if(e.type===`error`){a=!0,h(e.message);break}o=await t.next()}a||h(i({id:`DskIkK`}))}catch(e){let t=e;t instanceof Error&&t.name!==`AbortError`&&h(i({id:`Q5fqMz`}))}},t[0]=i,t[1]=n,t[2]=r,t[3]=C):C=t[3];let w=C,T;t[4]===w?T=t[5]:(T=()=>{let e=!1;return queueMicrotask(()=>{e||w()}),()=>{e=!0,x.current?.(),x.current=null,S.current&&clearInterval(S.current)}},t[4]=w,t[5]=T);let E;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(E=[],t[6]=E):E=t[6],(0,Q.useEffect)(T,E);let D,O;t[7]!==i||t[8]!==g?(D=()=>{if(g!==null)return S.current=setInterval(()=>{let e=g-Date.now();e<=0?(y(0),S.current&&clearInterval(S.current),h(i({id:`ve8vEM`}))):y(e)},1e3),()=>{S.current&&clearInterval(S.current)}},O=[g,i],t[7]=i,t[8]=g,t[9]=D,t[10]=O):(D=t[9],O=t[10]),(0,Q.useEffect)(D,O);let k=Math.floor(v/6e4),A=Math.floor(v%6e4/1e3),j;t[11]===A?j=t[12]:(j=A.toString().padStart(2,`0`),t[11]=A,t[12]=j);let M=`${k}:${j}`,N;t[13]!==i||t[14]!==f||t[15]!==m||t[16]!==M||t[17]!==a||t[18]!==c?(N=a?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(l,{id:`eVPynQ`,values:{verificationUri:c},components:{0:(0,$.jsx)(`a`,{href:c,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>et(e,c),onAuxClick:e=>et(e,c),className:`inline-flex items-center gap-0.5 text-foreground hover:text-primary hover:underline`}),1:(0,$.jsx)(`span`,{}),2:(0,$.jsx)(Ce,{className:`inline size-3.5`,"aria-hidden":!0})}})}),(0,$.jsxs)(b,{type:`button`,variant:`outline`,"aria-label":i({id:`nCzR-G`,values:{userCode:a}}),onClick:()=>void Xt(a).then(()=>{p(!0),setTimeout(()=>p(!1),2e3)}),className:`relative h-auto w-full justify-center rounded-md bg-muted px-12 py-3 hover:bg-muted/80`,children:[(0,$.jsx)(`code`,{className:`font-mono text-2xl font-bold tracking-widest`,children:a}),(0,$.jsx)(`span`,{className:`absolute right-3 text-muted-foreground`,"aria-hidden":`true`,children:f?(0,$.jsx)(we,{className:`size-4`}):(0,$.jsx)(o,{className:`size-4`})})]}),(0,$.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`sr-only`,children:f?(0,$.jsx)(l,{id:`80c4-P`}):null}),(0,$.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(`span`,{className:`size-1.5 rounded-full bg-amber-500 animate-pulse`}),(0,$.jsx)(l,{id:`5y_9lO`})]}),(0,$.jsx)(`span`,{children:(0,$.jsx)(l,{id:`gYz2ep`,values:{timeLabel:M}})})]})]}):(0,$.jsx)(`div`,{className:`flex items-center justify-center py-6 text-sm text-muted-foreground`,children:m?null:(0,$.jsx)(l,{id:`aWlJai`})}),t[13]=i,t[14]=f,t[15]=m,t[16]=M,t[17]=a,t[18]=c,t[19]=N):N=t[19];let P;t[20]===m?P=t[21]:(P=m&&(0,$.jsx)(`p`,{className:`text-1sm text-destructive`,children:m}),t[20]=m,t[21]=P);let F;return t[22]!==N||t[23]!==P?(F=(0,$.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[N,P]}),t[22]=N,t[23]=P,t[24]=F):F=t[24],F}function Qt(e){let t=(0,Z.c)(30),{login:n,name:r,onNameChange:i,email:a,onEmailChange:o}=e,{_:s}=u(),c;t[0]===n?c=t[1]:(c=(0,$.jsx)(`p`,{className:`text-sm font-medium`,children:(0,$.jsx)(l,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=c);let d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(l,{id:`gp3I7-`})}),t[2]=d):d=t[2];let f;t[3]===s?f=t[4]:(f=s({id:`6YtxFj`}),t[3]=s,t[4]=f);let p;t[5]!==s||t[6]!==n?(p=s({id:`J2Mv98`,values:{login:n}}),t[5]=s,t[6]=n,t[7]=p):p=t[7];let m;t[8]===i?m=t[9]:(m=e=>i(e.target.value),t[8]=i,t[9]=m);let h;t[10]!==r||t[11]!==f||t[12]!==p||t[13]!==m?(h=(0,$.jsx)(Ye,{"aria-label":f,placeholder:p,value:r,onChange:m}),t[10]=r,t[11]=f,t[12]=p,t[13]=m,t[14]=h):h=t[14];let g;t[15]===s?g=t[16]:(g=s({id:`O3oNi5`}),t[15]=s,t[16]=g);let _;t[17]===s?_=t[18]:(_=s({id:`O3oNi5`}),t[17]=s,t[18]=_);let v;t[19]===o?v=t[20]:(v=e=>o(e.target.value),t[19]=o,t[20]=v);let y;t[21]!==a||t[22]!==g||t[23]!==_||t[24]!==v?(y=(0,$.jsx)(Ye,{type:`email`,"aria-label":g,placeholder:_,value:a,onChange:v}),t[21]=a,t[22]=g,t[23]=_,t[24]=v,t[25]=y):y=t[25];let b;return t[26]!==c||t[27]!==y||t[28]!==h?(b=(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[c,d,h,y]}),t[26]=c,t[27]=y,t[28]=h,t[29]=b):b=t[29],b}function $t(e){let t=(0,Z.c)(37),{host:n,token:r,onTokenChange:i,error:a,onSubmit:o,showGhOption:s,onGhSignIn:c}=e,{_:d}=u(),f=`https://${n}/settings/tokens/new?scopes=repo,read:user&description=OpenKnowledge`,p;t[0]!==n||t[1]!==c||t[2]!==s?(p=s?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(b,{type:`button`,onClick:c,children:(0,$.jsx)(l,{id:`_SDGzH`})}),(0,$.jsxs)(`div`,{className:`flex items-center gap-3 text-xs text-muted-foreground`,children:[(0,$.jsx)(`span`,{className:`h-px flex-1 bg-border`}),(0,$.jsx)(l,{id:`8L0EPw`}),(0,$.jsx)(`span`,{className:`h-px flex-1 bg-border`})]})]}):(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(l,{id:`8k6INX`,values:{host:n},components:{0:(0,$.jsx)(`span`,{className:`font-medium text-foreground`})}})}),t[0]=n,t[1]=c,t[2]=s,t[3]=p):p=t[3];let m,h;t[4]===f?(m=t[5],h=t[6]):(m=e=>et(e,f),h=e=>et(e,f),t[4]=f,t[5]=m,t[6]=h);let g;t[7]===n?g=t[8]:(g=(0,$.jsx)(l,{id:`6hYjww`,values:{host:n}}),t[7]=n,t[8]=g);let _;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(Ce,{className:`inline size-3.5`,"aria-hidden":!0}),t[9]=_):_=t[9];let v;t[10]!==f||t[11]!==m||t[12]!==h||t[13]!==g?(v=(0,$.jsxs)(`a`,{href:f,target:`_blank`,rel:`noopener noreferrer`,onClick:m,onAuxClick:h,className:`inline-flex w-fit items-center gap-0.5 text-sm text-foreground hover:text-primary hover:underline`,children:[g,_]}),t[10]=f,t[11]=m,t[12]=h,t[13]=g,t[14]=v):v=t[14];let y;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,$.jsx)(l,{id:`Xg-Ntj`})}),t[15]=y):y=t[15];let x;t[16]===d?x=t[17]:(x=d({id:`p2LEhJ`}),t[16]=d,t[17]=x);let S;t[18]===i?S=t[19]:(S=e=>i(e.target.value),t[18]=i,t[19]=S);let C;t[20]===o?C=t[21]:(C=e=>{e.key===`Enter`&&o()},t[20]=o,t[21]=C);let w;t[22]!==C||t[23]!==x||t[24]!==S||t[25]!==r?(w=(0,$.jsx)(Ye,{type:`password`,"aria-label":x,placeholder:`ghp_`,value:r,onChange:S,onKeyDown:C}),t[22]=C,t[23]=x,t[24]=S,t[25]=r,t[26]=w):w=t[26];let T;t[27]===a?T=t[28]:(T=a&&(0,$.jsx)(`p`,{className:`text-1sm text-destructive`,children:a}),t[27]=a,t[28]=T);let E;t[29]===s?E=t[30]:(E=!s&&(0,$.jsxs)(`div`,{className:`mt-1 rounded-md border border-border/60 bg-muted/40 p-3 text-sm text-muted-foreground`,children:[(0,$.jsx)(`p`,{children:(0,$.jsx)(l,{id:`qX-ABr`})}),(0,$.jsxs)(`ol`,{className:`mt-1.5 list-decimal space-y-0.5 pl-5`,children:[(0,$.jsx)(`li`,{children:(0,$.jsx)(l,{id:`jxtXZI`})}),(0,$.jsx)(`li`,{children:(0,$.jsx)(l,{id:`9Vh9Jf`})})]})]}),t[29]=s,t[30]=E);let D;return t[31]!==p||t[32]!==w||t[33]!==T||t[34]!==E||t[35]!==v?(D=(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[p,v,y,w,T,E]}),t[31]=p,t[32]=w,t[33]=T,t[34]=E,t[35]=v,t[36]=D):D=t[36],D}var en=1e4;function tn(e){let t=(0,Z.c)(92),{open:n,onOpenChange:r,onSuccess:i,identityPrompt:a,reauth:o,transport:s,queryTransport:c,host:d,ghAvailable:f}=e,{_:p}=u(),m;t[0]===s?m=t[1]:(m=s??Jt(),t[0]=s,t[1]=m);let h=m,g;t[2]===c?g=t[3]:(g=c??Rt(),t[2]=c,t[3]=g);let _=g,[v,y]=(0,Q.useState)(`auth`),[x,S]=(0,Q.useState)(null),[C,w]=(0,Q.useState)(``),[T,M]=(0,Q.useState)(``),[N,P]=(0,Q.useState)(``),[F,I]=(0,Q.useState)(null),[L,R]=(0,Q.useState)(!1),[z,ee]=(0,Q.useState)(void 0),[te,ne]=(0,Q.useState)(void 0),B=d??z,re=!!B&&B!==`github.com`&&!!(f??te)&&typeof h.ghLogin==`function`,V=!a&&d===void 0,H,U;t[4]!==d||t[5]!==a||t[6]!==V||t[7]!==n?(H=()=>{n&&(S(null),w(``),M(``),P(``),I(null),R(!1),ee(void 0),ne(void 0),y(a||V?`checking`:d&&d!==`github.com`?`pat`:`auth`))},U=[n,a,d,V],t[4]=d,t[5]=a,t[6]=V,t[7]=n,t[8]=H,t[9]=U):(H=t[8],U=t[9]),(0,Q.useLayoutEffect)(H,U);let W;t[10]!==a||t[11]!==n||t[12]!==_?(W=()=>{if(!n||!a)return;let e=!1,t=t=>{e||(e=!0,y(t))},r=setTimeout(()=>t(`auth`),en);return _.status().then(n=>{e||(n.authenticated?(S({login:n.login,name:n.name,email:n.email}),w(n.name??``),M(n.email??``),t(`identity`)):t(`auth`))}).catch(()=>{t(`auth`)}),()=>{e=!0,clearTimeout(r)}},t[10]=a,t[11]=n,t[12]=_,t[13]=W):W=t[13];let G;t[14]!==a||t[15]!==n?(G=[n,a],t[14]=a,t[15]=n,t[16]=G):G=t[16],(0,Q.useEffect)(W,G);let K;t[17]!==V||t[18]!==n||t[19]!==_?(K=()=>{if(!n||!V)return;let e=!1,t=t=>{e||(e=!0,y(t))},r=setTimeout(()=>t(`auth`),en);return _.status().then(n=>{if(e)return;let r=!!n.host&&n.host!==`github.com`;ee(n.host),ne(n.ghAvailable),t(r?`pat`:`auth`)}).catch(()=>{t(`auth`)}),()=>{e=!0,clearTimeout(r)}},t[17]=V,t[18]=n,t[19]=_,t[20]=K):K=t[20];let ie;t[21]!==V||t[22]!==n?(ie=[n,V],t[21]=V,t[22]=n,t[23]=ie):ie=t[23],(0,Q.useEffect)(K,ie);let ae;t[24]!==p||t[25]!==a||t[26]!==r||t[27]!==i?(ae=function(e){if(S(e),a)w(e.name??``),M(e.email??``),y(`identity`);else{y(`done`),i?.(e),r(!1);let t=e.login;q.success(p(t?{id:`E_tNGD`,values:{login:t}}:{id:`cgl-gn`}))}},t[24]=p,t[25]=a,t[26]=r,t[27]=i,t[28]=ae):ae=t[28];let oe=ae,se;t[29]!==p||t[30]!==B||t[31]!==oe||t[32]!==L||t[33]!==N||t[34]!==h?(se=async function(){let e=N.trim();if(!e||!B||L)return;if(!h.pat){I(p({id:`iMYFJM`}));return}R(!0),I(null);let t=await h.pat(B,e);R(!1),t.ok?oe({login:t.login??``}):I(t.error??p({id:`sNeKjP`}))},t[29]=p,t[30]=B,t[31]=oe,t[32]=L,t[33]=N,t[34]=h,t[35]=se):se=t[35];let ce=se,le;t[36]!==p||t[37]!==x||t[38]!==r||t[39]!==i?(le=function(e,t){fetch(`/api/local-op/auth/set-identity`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({name:e,email:t})}).catch(nn);let n={...x??{login:``},name:e,email:t};y(`done`),i?.(n),r(!1);let a=n.login;q.success(p(a?{id:`E_tNGD`,values:{login:a}}:{id:`cgl-gn`}))},t[36]=p,t[37]=x,t[38]=r,t[39]=i,t[40]=le):le=t[40];let ue=le,J;t[41]!==p||t[42]!==x||t[43]!==r||t[44]!==i?(J=function(){if(!x)return;y(`done`),i?.(x),r(!1);let e=x.login;q.success(p(e?{id:`E_tNGD`,values:{login:e}}:{id:`cgl-gn`}))},t[41]=p,t[42]=x,t[43]=r,t[44]=i,t[45]=J):J=t[45];let de=J,fe;t[46]===r?fe=t[47]:(fe=function(){r(!1)},t[46]=r,t[47]=fe);let Y=fe,pe;t[48]!==a||t[49]!==o||t[50]!==v?(pe=(0,$.jsx)(A,{children:(0,$.jsx)(E,{children:o&&(v===`pat`||v===`gh-device`)?(0,$.jsx)(l,{id:`DUWgfT`}):o?(0,$.jsx)(l,{id:`X8kjQX`}):v===`pat`||v===`gh-device`?(0,$.jsx)(l,{id:`tzZ6ha`}):a&&v!==`auth`?(0,$.jsx)(l,{id:`29XZXN`}):(0,$.jsx)(l,{id:`3jod3l`})})}),t[48]=a,t[49]=o,t[50]=v,t[51]=pe):pe=t[51];let me;t[52]===v?me=t[53]:(me=v===`checking`&&(0,$.jsx)(O,{children:(0,$.jsx)(`div`,{className:`flex items-center justify-center py-6 text-sm text-muted-foreground`,children:(0,$.jsx)(l,{id:`gBbxn_`})})}),t[52]=v,t[53]=me);let he;t[54]!==oe||t[55]!==Y||t[56]!==h||t[57]!==v?(he=v===`auth`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(O,{children:(0,$.jsx)(Zt,{onSuccess:oe,startFlow:()=>h.start()})}),(0,$.jsx)(k,{children:(0,$.jsx)(b,{variant:`outline`,className:`font-mono uppercase`,onClick:Y,children:(0,$.jsx)(l,{id:`dEgA5A`})})})]}),t[54]=oe,t[55]=Y,t[56]=h,t[57]=v,t[58]=he):he=t[58];let X;t[59]!==re||t[60]!==B||t[61]!==Y||t[62]!==ce||t[63]!==F||t[64]!==L||t[65]!==N||t[66]!==v?(X=v===`pat`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(O,{children:(0,$.jsx)($t,{host:B??``,token:N,onTokenChange:P,error:F,onSubmit:ce,showGhOption:re,onGhSignIn:()=>y(`gh-device`)})}),(0,$.jsxs)(k,{children:[(0,$.jsx)(b,{variant:`outline`,className:`font-mono uppercase`,onClick:Y,children:(0,$.jsx)(l,{id:`dEgA5A`})}),(0,$.jsx)(b,{onClick:ce,disabled:!N.trim()||L,children:L?(0,$.jsx)(l,{id:`9zb2WA`}):(0,$.jsx)(l,{id:`iSLIjg`})})]})]}),t[59]=re,t[60]=B,t[61]=Y,t[62]=ce,t[63]=F,t[64]=L,t[65]=N,t[66]=v,t[67]=X):X=t[67];let ge;t[68]!==B||t[69]!==oe||t[70]!==Y||t[71]!==h||t[72]!==v?(ge=v===`gh-device`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(O,{children:(0,$.jsx)(Zt,{onSuccess:oe,startFlow:()=>h.ghLogin?.(B??``)??h.start()})}),(0,$.jsxs)(k,{children:[(0,$.jsx)(b,{variant:`ghost`,onClick:()=>y(`pat`),children:(0,$.jsx)(l,{id:`hLKfZe`})}),(0,$.jsx)(b,{variant:`outline`,className:`font-mono uppercase`,onClick:Y,children:(0,$.jsx)(l,{id:`dEgA5A`})})]})]}),t[68]=B,t[69]=oe,t[70]=Y,t[71]=h,t[72]=v,t[73]=ge):ge=t[73];let _e;t[74]!==x||t[75]!==ue||t[76]!==de||t[77]!==T||t[78]!==C||t[79]!==v?(_e=v===`identity`&&x&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(O,{children:(0,$.jsx)(Qt,{login:x.login,name:C,onNameChange:w,email:T,onEmailChange:M})}),(0,$.jsxs)(k,{children:[(0,$.jsx)(b,{variant:`ghost`,onClick:de,children:(0,$.jsx)(l,{id:`6Uau97`})}),(0,$.jsx)(b,{onClick:()=>ue(C.trim(),T.trim()),disabled:!C.trim()||!T.trim(),children:(0,$.jsx)(l,{id:`tfDRzk`})})]})]}),t[74]=x,t[75]=ue,t[76]=de,t[77]=T,t[78]=C,t[79]=v,t[80]=_e):_e=t[80];let ve;t[81]!==pe||t[82]!==me||t[83]!==he||t[84]!==X||t[85]!==ge||t[86]!==_e?(ve=(0,$.jsxs)(D,{className:`sm:max-w-md`,children:[pe,me,he,X,ge,_e]}),t[81]=pe,t[82]=me,t[83]=he,t[84]=X,t[85]=ge,t[86]=_e,t[87]=ve):ve=t[87];let ye;return t[88]!==r||t[89]!==n||t[90]!==ve?(ye=(0,$.jsx)(j,{open:n,onOpenChange:r,children:ve}),t[88]=r,t[89]=n,t[90]=ve,t[91]=ye):ye=t[91],ye}function nn(){}function rn(e){let t=(0,Z.c)(16),{value:n,onChange:r,disabled:i,placeholder:a,rows:o}=e,s=i===void 0?!1:i,c=o===void 0?12:o,u=(0,Q.useId)(),d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(l,{id:`3o3tur`}),t[0]=d):d=t[0];let f;t[1]===u?f=t[2]:(f=(0,$.jsx)(at,{htmlFor:u,children:d}),t[1]=u,t[2]=f);let p;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(ot,{children:(0,$.jsx)(l,{id:`5gr_ev`,values:{dateToken:`{{date}}`,userToken:`{{user}}`},components:{0:(0,$.jsx)(`code`,{className:`font-mono`}),1:(0,$.jsx)(`code`,{className:`font-mono`})}})}),t[3]=p):p=t[3];let m;t[4]===r?m=t[5]:(m=e=>r(e.target.value),t[4]=r,t[5]=m);let h;t[6]!==s||t[7]!==u||t[8]!==a||t[9]!==c||t[10]!==m||t[11]!==n?(h=(0,$.jsx)(ut,{id:u,value:n,onChange:m,disabled:s,rows:c,spellCheck:!1,placeholder:a,className:`font-mono text-xs leading-relaxed min-h-72`}),t[6]=s,t[7]=u,t[8]=a,t[9]=c,t[10]=m,t[11]=n,t[12]=h):h=t[12];let g;return t[13]!==f||t[14]!==h?(g=(0,$.jsxs)(ct,{children:[f,p,h]}),t[13]=f,t[14]=h,t[15]=g):g=t[15],g}var an=/^[A-Za-z0-9_-]+$/;function on(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)}function sn(e){let t={},n=e.title.trim();n&&(t.title=n);let r=e.description.trim();return r&&(t.description=r),t}var cn=0;function ln(){return cn+=1,`prop-${cn}`}function un(e){let{frontmatter:t,body:n}=K(e);if(t===``)return{type:``,properties:[],markdown:e};let r=[];for(let e of oe(t).split(`
4
4
  `)){if(e.trim()===``)continue;let t=e.indexOf(`:`);if((/^\s/.test(e)||t===-1)&&r.length>0){let t=r[r.length-1];t&&(t.value+=`\n${e}`);continue}t!==-1&&r.push({key:e.slice(0,t).trim(),value:e.slice(t+1).replace(/^ /,``)})}let i=``,a=[];for(let e of r){if(e.key===`type`&&i===``){i=e.value.trim();continue}a.push({id:ln(),key:e.key,value:e.value})}return{type:i,properties:a,markdown:n}}function dn(e){let t=[],n=e.type.trim();n&&t.push(`type: ${n}`);for(let n of e.properties){let e=n.key.trim();e===``||e===`type`||t.push(n.value===``?`${e}:`:`${e}: ${n.value}`)}if(t.length===0)return e.markdown.replace(/^\n+/,``);let r=e.markdown.startsWith(`
5
5
  `)?e.markdown:`\n${e.markdown}`;return`---\n${t.join(`
6
6
  `)}\n---\n${r}`}function fn(e){let t=(0,Z.c)(54),{mode:n,folderPath:r,scope:i,initial:a,existingNames:o,onCommitted:s}=e,c=i===void 0?`local`:i,[l,u]=(0,Q.useState)(a.title),[d,f]=(0,Q.useState)(a.name),[p,m]=(0,Q.useState)(a.description),h;t[0]===a.body?h=t[1]:(h=()=>un(a.body),t[0]=a.body,t[1]=h);let g=(0,Q.useState)(h)[0],[_,v]=(0,Q.useState)(g.type),[y,b]=(0,Q.useState)(g.properties),[x,S]=(0,Q.useState)(g.markdown),[C,w]=(0,Q.useState)(!1),[T,E]=(0,Q.useState)(!1),[D,O]=(0,Q.useState)(!1),k;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(k=function(e,t){b(n=>n.map(n=>n.id===e?{...n,...t}:n))},t[2]=k):k=t[2];let A=k,j;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(j=function(){b(pn)},t[3]=j):j=t[3];let M=j,N;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(N=function(e){b(t=>t.filter(t=>t.id!==e))},t[4]=N):N=t[4];let P=N,F;t[5]!==n||t[6]!==T?(F=function(e){u(e),n===`create`&&!T&&f(on(e))},t[5]=n,t[6]=T,t[7]=F):F=t[7];let I=F,L;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(L=function(e){f(e),E(!0)},t[8]=L):L=t[8];let R=L,z=n===`edit`&&c===`local`,ee=n===`create`||z,te;t[9]===l?te=t[10]:(te=l.trim(),t[9]=l,t[10]=te);let ne=te,B,re,V,H;t[11]!==o||t[12]!==n||t[13]!==d||t[14]!==ee||t[15]!==ne?(H=d.trim(),V=ne===``,B=ee&&(H===``||!an.test(H)),re=n===`create`&&!B&&(o?.has(H)??!1),t[11]=o,t[12]=n,t[13]=d,t[14]=ee,t[15]=ne,t[16]=B,t[17]=re,t[18]=V,t[19]=H):(B=t[16],re=t[17],V=t[18],H=t[19]);let U=re,W=!C&&!V&&!B,G;t[20]!==x||t[21]!==z||t[22]!==W||t[23]!==p||t[24]!==r||t[25]!==a.name||t[26]!==n||t[27]!==s||t[28]!==y||t[29]!==l||t[30]!==H||t[31]!==ne||t[32]!==_?(G=async function(){if(!W){O(!0);return}w(!0);let e=sn({title:l,description:p}),t=dn({type:_,properties:y,markdown:x}),i=z&&H!==a.name,o=i?await ke({fromFolder:r,fromName:a.name,toFolder:r,toName:H,frontmatter:e,body:t}):await Oe({folder:r,name:n===`create`?H:a.name,frontmatter:e,body:t});if(w(!1),!o.ok){let{error:e}=o;q.error(n===`create`?J._({id:`jdGUeI`,values:{error:e}}):J._({id:`rQAQus`,values:{error:e}}));return}i?q.success(J._({id:`YKLP_-`})):`warnings`in o&&o.warnings.length>0?q.warning(o.warnings.join(` `)):n===`create`?q.success(J._({id:`06SZfb`,values:{trimmedTitle:ne}})):q.success(J._({id:`GamjcN`})),s(n===`create`||i?H:a.name)},t[20]=x,t[21]=z,t[22]=W,t[23]=p,t[24]=r,t[25]=a.name,t[26]=n,t[27]=s,t[28]=y,t[29]=l,t[30]=H,t[31]=ne,t[32]=_,t[33]=G):G=t[33];let K=G,ie;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(ie=()=>O(!0),t[34]=ie):ie=t[34];let ae;return t[35]!==x||t[36]!==z||t[37]!==W||t[38]!==p||t[39]!==a.name||t[40]!==n||t[41]!==y||t[42]!==C||t[43]!==I||t[44]!==d||t[45]!==B||t[46]!==U||t[47]!==K||t[48]!==l||t[49]!==V||t[50]!==D||t[51]!==H||t[52]!==_?(ae={mode:n,title:l,slug:d,description:p,type:_,properties:y,body:x,setTitle:I,setSlug:R,setDescription:m,setType:v,setProperty:A,addProperty:M,removeProperty:P,setBody:S,markTitleTouched:ie,titleTouched:D,isSaving:C,canSubmit:W,titleInvalid:V,slugInvalid:B,slugShadows:U,trimmedSlug:H,fixedName:a.name,canRename:z,submit:K},t[35]=x,t[36]=z,t[37]=W,t[38]=p,t[39]=a.name,t[40]=n,t[41]=y,t[42]=C,t[43]=I,t[44]=d,t[45]=B,t[46]=U,t[47]=K,t[48]=l,t[49]=V,t[50]=D,t[51]=H,t[52]=_,t[53]=ae):ae=t[53],ae}function pn(e){return[...e,{id:ln(),key:``,value:``}]}function mn(e){let t=(0,Z.c)(72),{form:n,bodyPlaceholder:r}=e,{_:i}=u(),a=(0,Q.useId)(),o=(0,Q.useId)(),s=(0,Q.useId)(),c=n.titleTouched&&n.titleInvalid,{fixedName:d}=n,f,p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(l,{id:`MHrjPM`}),p=(0,$.jsx)(`span`,{className:`text-destructive`,children:`*`}),t[0]=f,t[1]=p):(f=t[0],p=t[1]);let m;t[2]===a?m=t[3]:(m=(0,$.jsxs)(at,{htmlFor:a,children:[f,p]}),t[2]=a,t[3]=m);let h=n.title,g;t[4]===n?g=t[5]:(g=e=>n.setTitle(e.target.value),t[4]=n,t[5]=g);let _=n.markTitleTouched,v;t[6]===i?v=t[7]:(v=i({id:`KWL_Ih`}),t[6]=i,t[7]=v);let y;t[8]!==n.isSaving||t[9]!==n.markTitleTouched||t[10]!==n.title||t[11]!==a||t[12]!==c||t[13]!==g||t[14]!==v?(y=(0,$.jsx)(Ye,{id:a,"data-testid":`template-name-input`,value:h,onChange:g,onBlur:_,placeholder:v,disabled:n.isSaving,"aria-invalid":c}),t[8]=n.isSaving,t[9]=n.markTitleTouched,t[10]=n.title,t[11]=a,t[12]=c,t[13]=g,t[14]=v,t[15]=y):y=t[15];let b;t[16]===c?b=t[17]:(b=c?(0,$.jsx)(rt,{children:(0,$.jsx)(l,{id:`V_wltx`})}):null,t[16]=c,t[17]=b);let x;t[18]!==m||t[19]!==y||t[20]!==b?(x=(0,$.jsxs)(ct,{children:[m,y,b]}),t[18]=m,t[19]=y,t[20]=b,t[21]=x):x=t[21];let S;t[22]!==d||t[23]!==n?(S=n.mode===`create`?(0,$.jsx)(gn,{form:n}):n.canRename?(0,$.jsx)(_n,{form:n}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,$.jsx)(l,{id:`NjrIak`,values:{fixedName:d},components:{0:(0,$.jsx)(`code`,{className:`font-mono`})}})}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,$.jsx)(l,{id:`jSO1X5`})})]}),t[22]=d,t[23]=n,t[24]=S):S=t[24];let C;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(l,{id:`Nu4oKW`}),t[25]=C):C=t[25];let w;t[26]===o?w=t[27]:(w=(0,$.jsx)(at,{htmlFor:o,children:C}),t[26]=o,t[27]=w);let T=n.description,E;t[28]===n?E=t[29]:(E=e=>n.setDescription(e.target.value),t[28]=n,t[29]=E);let D;t[30]===i?D=t[31]:(D=i({id:`3FMvls`}),t[30]=i,t[31]=D);let O;t[32]!==o||t[33]!==n.description||t[34]!==n.isSaving||t[35]!==E||t[36]!==D?(O=(0,$.jsx)(ut,{id:o,value:T,onChange:E,placeholder:D,disabled:n.isSaving,rows:2}),t[32]=o,t[33]=n.description,t[34]=n.isSaving,t[35]=E,t[36]=D,t[37]=O):O=t[37];let k;t[38]!==w||t[39]!==O?(k=(0,$.jsxs)(ct,{children:[w,O]}),t[38]=w,t[39]=O,t[40]=k):k=t[40];let A;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,$.jsx)(l,{id:`-zy2Nq`}),t[41]=A):A=t[41];let j;t[42]===s?j=t[43]:(j=(0,$.jsx)(at,{htmlFor:s,children:A}),t[42]=s,t[43]=j);let M=n.type,N;t[44]===n?N=t[45]:(N=e=>n.setType(e.target.value),t[44]=n,t[45]=N);let P;t[46]===i?P=t[47]:(P=i({id:`o9CrsQ`}),t[46]=i,t[47]=P);let F;t[48]!==n.isSaving||t[49]!==n.type||t[50]!==N||t[51]!==P||t[52]!==s?(F=(0,$.jsx)(Ye,{id:s,value:M,onChange:N,placeholder:P,disabled:n.isSaving,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,className:`font-mono`}),t[48]=n.isSaving,t[49]=n.type,t[50]=N,t[51]=P,t[52]=s,t[53]=F):F=t[53];let I;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,$.jsx)(ot,{children:(0,$.jsx)(l,{id:`ipn17C`,components:{0:(0,$.jsx)(`code`,{className:`font-mono`}),1:(0,$.jsx)(`code`,{className:`font-mono`})}})}),t[54]=I):I=t[54];let L;t[55]!==j||t[56]!==F?(L=(0,$.jsxs)(ct,{children:[j,F,I]}),t[55]=j,t[56]=F,t[57]=L):L=t[57];let R;t[58]===n?R=t[59]:(R=(0,$.jsx)(hn,{form:n}),t[58]=n,t[59]=R);let z;t[60]!==r||t[61]!==n.body||t[62]!==n.isSaving||t[63]!==n.setBody?(z=(0,$.jsx)(rn,{value:n.body,onChange:n.setBody,disabled:n.isSaving,placeholder:r}),t[60]=r,t[61]=n.body,t[62]=n.isSaving,t[63]=n.setBody,t[64]=z):z=t[64];let ee;return t[65]!==x||t[66]!==S||t[67]!==k||t[68]!==L||t[69]!==R||t[70]!==z?(ee=(0,$.jsxs)(nt,{children:[x,S,k,L,R,z]}),t[65]=x,t[66]=S,t[67]=k,t[68]=L,t[69]=R,t[70]=z,t[71]=ee):ee=t[71],ee}function hn(e){let t=(0,Z.c)(12),{form:n}=e,{_:r}=u(),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(at,{children:(0,$.jsx)(l,{id:`-WFFG2`})}),t[0]=i):i=t[0];let a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(ot,{children:(0,$.jsx)(l,{id:`zrP8HX`,components:{0:(0,$.jsx)(`code`,{className:`font-mono`}),1:(0,$.jsx)(`code`,{className:`font-mono`})}})}),t[1]=a):a=t[1];let o;t[2]!==r||t[3]!==n?(o=n.properties.length>0?(0,$.jsx)(`div`,{className:`flex flex-col gap-2`,children:n.properties.map(e=>(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(Ye,{"aria-label":r({id:`56xUL1`}),value:e.key,onChange:t=>n.setProperty(e.id,{key:t.target.value}),placeholder:r({id:`Aq-O0x`}),disabled:n.isSaving,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,className:`font-mono w-1/3`}),(0,$.jsx)(Ye,{"aria-label":r({id:`iKZkk1`}),value:e.value,onChange:t=>n.setProperty(e.id,{value:t.target.value}),placeholder:r({id:`jEZ6Lf`}),disabled:n.isSaving,spellCheck:!1,className:`font-mono flex-1`}),(0,$.jsx)(b,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":r({id:`rNifQd`}),onClick:()=>n.removeProperty(e.id),disabled:n.isSaving,children:(0,$.jsx)(Fe,{"aria-hidden":`true`})})]},e.id))}):null,t[2]=r,t[3]=n,t[4]=o):o=t[4];let s;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(l,{id:`F-NRCj`}),t[5]=s):s=t[5];let c;t[6]!==n.addProperty||t[7]!==n.isSaving?(c=(0,$.jsx)(b,{type:`button`,variant:`outline`,size:`sm`,className:`self-start`,onClick:n.addProperty,disabled:n.isSaving,children:s}),t[6]=n.addProperty,t[7]=n.isSaving,t[8]=c):c=t[8];let d;return t[9]!==o||t[10]!==c?(d=(0,$.jsxs)(ct,{children:[i,a,o,c]}),t[9]=o,t[10]=c,t[11]=d):d=t[11],d}function gn(e){let t=(0,Z.c)(34),{form:n}=e,{_:r}=u(),i=(0,Q.useId)(),[a,o]=(0,Q.useState)(!1),s=a||n.titleTouched&&(n.slugInvalid||n.slugShadows),{slug:c,trimmedSlug:d}=n;if(!s){if(d===``)return null;let e;t[0]===c?e=t[1]:(e={slug:c},t[0]=c,t[1]=e);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r={0:(0,$.jsx)(`code`,{className:`font-mono`})},t[2]=r):r=t[2];let i;t[3]===e?i=t[4]:(i=(0,$.jsx)(l,{id:`Pgu10b`,values:e,components:r}),t[3]=e,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>o(!0),t[5]=a):a=t[5];let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(l,{id:`ePK91l`}),t[6]=s):s=t[6];let u;t[7]===n.isSaving?u=t[8]:(u=(0,$.jsx)(b,{type:`button`,variant:`link`,className:`h-auto p-0 align-baseline text-xs font-mono uppercase`,onClick:a,disabled:n.isSaving,children:s}),t[7]=n.isSaving,t[8]=u);let f;return t[9]!==i||t[10]!==u?(f=(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[i,` `,u]}),t[9]=i,t[10]=u,t[11]=f):f=t[11],f}let f;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(l,{id:`GN6L5F`}),t[12]=f):f=t[12];let p;t[13]===i?p=t[14]:(p=(0,$.jsx)(at,{htmlFor:i,children:f}),t[13]=i,t[14]=p);let m;t[15]===n?m=t[16]:(m=e=>n.setSlug(e.target.value),t[15]=n,t[16]=m);let h;t[17]===r?h=t[18]:(h=r({id:`tjXez2`}),t[17]=r,t[18]=h);let g;t[19]!==n.isSaving||t[20]!==n.slugInvalid||t[21]!==c||t[22]!==i||t[23]!==m||t[24]!==h?(g=(0,$.jsx)(Ye,{id:i,value:c,onChange:m,placeholder:h,disabled:n.isSaving,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,"aria-invalid":n.slugInvalid,className:`font-mono`}),t[19]=n.isSaving,t[20]=n.slugInvalid,t[21]=c,t[22]=i,t[23]=m,t[24]=h,t[25]=g):g=t[25];let _;t[26]!==n.slugInvalid||t[27]!==n.slugShadows||t[28]!==d?(_=n.slugInvalid?(0,$.jsx)(rt,{children:(0,$.jsx)(l,{id:`l_FAT6`,components:{0:(0,$.jsx)(`code`,{className:`font-mono`}),1:(0,$.jsx)(`code`,{className:`font-mono`})}})}):n.slugShadows?(0,$.jsx)(ot,{className:`text-yellow-600 dark:text-yellow-500`,children:(0,$.jsx)(l,{id:`jwnpdM`,values:{trimmedSlug:d},components:{0:(0,$.jsx)(`code`,{className:`font-mono`})}})}):(0,$.jsx)(ot,{children:(0,$.jsx)(l,{id:`TsZmgr`})}),t[26]=n.slugInvalid,t[27]=n.slugShadows,t[28]=d,t[29]=_):_=t[29];let v;return t[30]!==p||t[31]!==g||t[32]!==_?(v=(0,$.jsxs)(ct,{children:[p,g,_]}),t[30]=p,t[31]=g,t[32]=_,t[33]=v):v=t[33],v}function _n(e){let t=(0,Z.c)(20),{form:n}=e,{_:r}=u(),i=(0,Q.useId)(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(l,{id:`GN6L5F`}),t[0]=a):a=t[0];let o;t[1]===i?o=t[2]:(o=(0,$.jsx)(at,{htmlFor:i,children:a}),t[1]=i,t[2]=o);let s=n.slug,c;t[3]===n?c=t[4]:(c=e=>n.setSlug(e.target.value),t[3]=n,t[4]=c);let d;t[5]===r?d=t[6]:(d=r({id:`tjXez2`}),t[5]=r,t[6]=d);let f;t[7]!==n.isSaving||t[8]!==n.slug||t[9]!==n.slugInvalid||t[10]!==i||t[11]!==c||t[12]!==d?(f=(0,$.jsx)(Ye,{id:i,value:s,onChange:c,placeholder:d,disabled:n.isSaving,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,"aria-invalid":n.slugInvalid,className:`font-mono`}),t[7]=n.isSaving,t[8]=n.slug,t[9]=n.slugInvalid,t[10]=i,t[11]=c,t[12]=d,t[13]=f):f=t[13];let p;t[14]===n.slugInvalid?p=t[15]:(p=n.slugInvalid?(0,$.jsx)(rt,{children:(0,$.jsx)(l,{id:`l_FAT6`,components:{0:(0,$.jsx)(`code`,{className:`font-mono`}),1:(0,$.jsx)(`code`,{className:`font-mono`})}})}):(0,$.jsx)(ot,{children:(0,$.jsx)(l,{id:`FvMSms`})}),t[14]=n.slugInvalid,t[15]=p);let m;return t[16]!==o||t[17]!==f||t[18]!==p?(m=(0,$.jsxs)(ct,{children:[o,f,p]}),t[16]=o,t[17]=f,t[18]=p,t[19]=m):m=t[19],m}var vn={name:``,title:``,description:``,body:``},yn=`## Overview
7
7
 
8
8
  (Replace with the starting content for new documents.)
9
- `;function bn(e){let t=(0,Z.c)(12),{folderPath:n,existingNames:r,open:i,onOpenChange:a,onCreated:o}=e,s;t[0]!==r||t[1]!==n||t[2]!==o||t[3]!==a||t[4]!==i?(s=i?(0,$.jsx)(xn,{folderPath:n,existingNames:r,onOpenChange:a,onCreated:o}):null,t[0]=r,t[1]=n,t[2]=o,t[3]=a,t[4]=i,t[5]=s):s=t[5];let c;t[6]===s?c=t[7]:(c=(0,$.jsx)(D,{className:`sm:max-w-3xl max-h-[85vh] flex flex-col`,children:s}),t[6]=s,t[7]=c);let l;return t[8]!==a||t[9]!==i||t[10]!==c?(l=(0,$.jsx)(j,{open:i,onOpenChange:a,children:c}),t[8]=a,t[9]=i,t[10]=c,t[11]=l):l=t[11],l}function xn(e){let t=(0,Z.c)(31),{folderPath:n,existingNames:r,onOpenChange:i,onCreated:a}=e,o;t[0]!==a||t[1]!==i?(o=e=>{a(e),i(!1)},t[0]=a,t[1]=i,t[2]=o):o=t[2];let s;t[3]!==r||t[4]!==n||t[5]!==o?(s={mode:`create`,folderPath:n,initial:vn,existingNames:r,onCommitted:o},t[3]=r,t[4]=n,t[5]=o,t[6]=s):s=t[6];let c=fn(s),u;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(E,{children:(0,$.jsx)(l,{id:`G1Gw0v`})}),t[7]=u):u=t[7];let d;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsxs)(A,{children:[u,(0,$.jsx)(T,{children:(0,$.jsx)(l,{id:`NUr4kz`})})]}),t[8]=d):d=t[8];let f;t[9]===c?f=t[10]:(f=(0,$.jsx)(O,{children:(0,$.jsx)(mn,{form:c,bodyPlaceholder:yn})}),t[9]=c,t[10]=f);let p;t[11]===i?p=t[12]:(p=()=>i(!1),t[11]=i,t[12]=p);let m;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsx)(l,{id:`dEgA5A`}),t[13]=m):m=t[13];let h;t[14]!==c.isSaving||t[15]!==p?(h=(0,$.jsx)(b,{variant:`outline`,className:`font-mono uppercase`,onMouseDown:Sn,onClick:p,disabled:c.isSaving,children:m}),t[14]=c.isSaving,t[15]=p,t[16]=h):h=t[16];let g;t[17]===c?g=t[18]:(g=()=>void c.submit(),t[17]=c,t[18]=g);let _;t[19]===c.isSaving?_=t[20]:(_=c.isSaving?(0,$.jsx)(l,{id:`E9bKSA`}):(0,$.jsx)(l,{id:`A5hiCy`}),t[19]=c.isSaving,t[20]=_);let v;t[21]!==c.isSaving||t[22]!==_||t[23]!==g?(v=(0,$.jsx)(b,{onClick:g,disabled:c.isSaving,children:_}),t[21]=c.isSaving,t[22]=_,t[23]=g,t[24]=v):v=t[24];let y;t[25]!==v||t[26]!==h?(y=(0,$.jsxs)(k,{children:[h,v]}),t[25]=v,t[26]=h,t[27]=y):y=t[27];let x;return t[28]!==y||t[29]!==f?(x=(0,$.jsxs)($.Fragment,{children:[d,f,y]}),t[28]=y,t[29]=f,t[30]=x):x=t[30],x}function Sn(e){return e.preventDefault()}function Cn(e){let t=(0,Z.c)(16),{template:n,onOpenChange:r,onDeleted:i}=e,{_:a}=u(),[o,s]=(0,Q.useState)(!1),c;t[0]!==a||t[1]!==i||t[2]!==r?(c=async function(e){s(!0);let t=await Ae(e.source_folder,e.name);if(s(!1),!t.ok){let{error:e}=t;q.error(a({id:`36WXSC`,values:{error:e}}));return}let n=e.title??e.name;q.success(a({id:`ErRi6L`,values:{label:n}})),i(),r(!1)},t[0]=a,t[1]=i,t[2]=r,t[3]=c):c=t[3];let l=c,d=n!==null,f;t[4]!==o||t[5]!==r?(f=e=>{!e&&!o&&r(!1)},t[4]=o,t[5]=r,t[6]=f):f=t[6];let p;t[7]!==a||t[8]!==o||t[9]!==l||t[10]!==n?(p=n?(()=>{let{name:e,path:t,scope:r}=n,i=r===`inherited`?`\n\n${a({id:`8uAWix`})}`:``;return(0,$.jsx)(_,{itemName:a({id:`XfzqjK`,values:{name:e}}),isSubmitting:o,onDelete:()=>l(n),customDescription:`${a({id:`5LXwX8`,values:{path:t}})}${i}`})})():null,t[7]=a,t[8]=o,t[9]=l,t[10]=n,t[11]=p):p=t[11];let m;return t[12]!==d||t[13]!==f||t[14]!==p?(m=(0,$.jsx)(M,{open:d,onOpenChange:f,children:p}),t[12]=d,t[13]=f,t[14]=p,t[15]=m):m=t[15],m}function wn(e){let t=(0,Z.c)(45),{template:n,onEdit:r,onDelete:i,onCreate:a,badge:s}=e,{_:c}=u(),d=n.title??n.name,f=!!(n.title&&n.title!==n.name),p;t[0]===d?p=t[1]:(p=(0,$.jsx)(`span`,{className:`truncate font-medium`,children:d}),t[0]=d,t[1]=p);let m;t[2]!==f||t[3]!==n.name?(m=f?(0,$.jsx)(`code`,{className:`shrink-0 font-mono text-xs text-muted-foreground`,children:n.name}):null,t[2]=f,t[3]=n.name,t[4]=m):m=t[4];let _;t[5]===s?_=t[6]:(_=s?(0,$.jsx)(`span`,{className:`ml-auto shrink-0`,children:s}):null,t[5]=s,t[6]=_);let v;t[7]!==p||t[8]!==m||t[9]!==_?(v=(0,$.jsxs)(`span`,{className:`flex w-full items-center gap-2`,children:[p,m,_]}),t[7]=p,t[8]=m,t[9]=_,t[10]=v):v=t[10];let y;t[11]===n.description?y=t[12]:(y=n.description?(0,$.jsx)(`span`,{className:`w-full truncate text-sm text-muted-foreground`,children:n.description}):null,t[11]=n.description,t[12]=y);let x;t[13]!==r||t[14]!==v||t[15]!==y?(x=(0,$.jsxs)(b,{type:`button`,variant:`ghost`,onClick:r,className:`h-auto min-w-0 flex-1 flex-col items-start gap-0.5 px-1.5 py-1 text-left font-normal hover:bg-transparent`,children:[v,y]}),t[13]=r,t[14]=v,t[15]=y,t[16]=x):x=t[16];let S;t[17]!==c||t[18]!==d||t[19]!==a?(S=a?(0,$.jsxs)(b,{type:`button`,variant:`ghost`,size:`sm`,className:`shrink-0 font-mono uppercase opacity-0 group-hover:opacity-100 focus-visible:opacity-100`,onClick:a,"aria-label":c({id:`mZ1r4i`,values:{label:d}}),children:[(0,$.jsx)(g,{className:`size-3.5`,"aria-hidden":!0}),(0,$.jsx)(l,{id:`hYgDIe`})]}):null,t[17]=c,t[18]=d,t[19]=a,t[20]=S):S=t[20];let C;t[21]!==c||t[22]!==d?(C=c({id:`Bx4EXG`,values:{label:d}}),t[21]=c,t[22]=d,t[23]=C):C=t[23];let w;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(h,{className:`size-4`,"aria-hidden":!0}),t[24]=w):w=t[24];let T;t[25]===C?T=t[26]:(T=(0,$.jsx)(F,{asChild:!0,children:(0,$.jsx)(b,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0 opacity-0 group-hover:opacity-100 focus-visible:opacity-100 data-[state=open]:opacity-100`,"aria-label":C,children:w})}),t[25]=C,t[26]=T);let E,D;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(o,{"aria-hidden":!0}),D=(0,$.jsx)(l,{id:`ePK91l`}),t[27]=E,t[28]=D):(E=t[27],D=t[28]);let O;t[29]===r?O=t[30]:(O=(0,$.jsxs)(P,{onSelect:r,children:[E,D]}),t[29]=r,t[30]=O);let k,A;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,$.jsx)(Ne,{"aria-hidden":!0}),A=(0,$.jsx)(l,{id:`cnGeoo`}),t[31]=k,t[32]=A):(k=t[31],A=t[32]);let j;t[33]===i?j=t[34]:(j=(0,$.jsxs)(P,{variant:`destructive`,onSelect:i,children:[k,A]}),t[33]=i,t[34]=j);let M;t[35]!==O||t[36]!==j?(M=(0,$.jsxs)(I,{align:`end`,className:`min-w-52`,children:[O,j]}),t[35]=O,t[36]=j,t[37]=M):M=t[37];let N;t[38]!==T||t[39]!==M?(N=(0,$.jsxs)(L,{modal:!1,children:[T,M]}),t[38]=T,t[39]=M,t[40]=N):N=t[40];let R;return t[41]!==N||t[42]!==x||t[43]!==S?(R=(0,$.jsxs)(`li`,{className:`group flex items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-muted/50`,children:[x,S,N]}),t[41]=N,t[42]=x,t[43]=S,t[44]=R):R=t[44],R}function Tn(){let e=(0,Z.c)(8),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={status:`idle`},e[0]=t):t=e[0];let[n,r]=(0,Q.useState)(t),[i,a]=(0,Q.useState)(0),[o,s]=(0,Q.useState)(!1),c;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=!1;return r({status:`loading`}),fetch(`/api/skill-targets`).then(Dn).then(t=>{if(e)return;let n=G.safeParse(t);if(!n.success){console.error(`[ok-skills] /api/skill-targets response failed schema validation:`,n.error.issues),r({status:`error`,message:J._({id:`PXaT32`})});return}r({status:`ready`,data:n.data})}).catch(t=>{e||r({status:`error`,message:t instanceof Error?t.message:String(t)})}),()=>{e=!0}},e[1]=c):c=e[1];let l;e[2]===i?l=e[3]:(l=[i],e[2]=i,e[3]=l),(0,Q.useEffect)(c,l);let u;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(u=async e=>{s(!0);let t=await Ve(e);if(!t.ok)throw s(!1),Error(t.error);if(e.preview)return s(!1),t.preview;de(),a(En),s(!1)},e[4]=u):u=e[4];let d=u,f;return e[5]!==o||e[6]!==n?(f={state:n,saving:o,folderAction:d},e[5]=o,e[6]=n,e[7]=f):f=e[7],f}function En(e){return e+1}async function Dn(e){if(!e.ok){let t=await e.json().catch(On);throw Error(me(t)??`HTTP ${e.status}`)}return e.json()}function On(){return null}function kn(e){let t=(0,Z.c)(2);if(!e.bundle)return null;let n;return t[0]===e?n=t[1]:(n=(0,$.jsx)(An,{...e,bundle:e.bundle}),t[0]=e,t[1]=n),n}function An(e){let t=(0,Z.c)(118),{bundle:n,source:r,defaultScope:i,installOverride:a,onInstalled:o,onOpenChange:s,returnFocus:c}=e,{_:d}=u(),f=(0,Q.useId)(),p=Ke(),[m,h]=(0,Q.useState)(a?.scope??i),g;t[0]!==n.names||t[1]!==a?(g=()=>a?new Set(n.names):new Set,t[0]=n.names,t[1]=a,t[2]=g):g=t[2];let[_,x]=(0,Q.useState)(g),[S,C]=(0,Q.useState)(!1),w;t[3]===n.descriptions?w=t[4]:(w=()=>new Map(Object.entries(n.descriptions??{})),t[3]=n.descriptions,t[4]=w);let[M,P]=(0,Q.useState)(w),F=Tn(),[I,L]=(0,Q.useState)(null),re=F.state.status===`ready`?F.state.data.targets:null,V;t[5]!==re||t[6]!==I?(V=I??new Set(re??[]),t[5]=re,t[6]=I,t[7]=V):V=t[7];let H=V,U=lt(),W=U.status===`ready`?U.data.find(e=>e.scope===m)?.installableEditors:void 0,G=v.filter(e=>!W||W.includes(e)||H.has(e)),K;t[8]!==m||t[9]!==U.data||t[10]!==U.status?(K=U.status===`ready`?new Set(U.data.filter(e=>e.scope===m).map(In)):new Set,t[8]=m,t[9]=U.data,t[10]=U.status,t[11]=K):K=t[11];let ie=K,ae;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(ae=new Set,t[12]=ae):ae=t[12];let[oe,ce]=(0,Q.useState)(ae),le=new Set;if(F.state.status===`ready`){let e;t[13]===F.state.data.folders?e=t[14]:(e=F.state.data.folders??[],t[13]=F.state.data.folders,t[14]=e);for(let t of e)t.scope===m&&(v.includes(t.host)||t.root&&le.add(t.root))}if(U.status===`ready`){for(let e of U.data)if(e.scope===m)for(let t of e.customPlacements??[]){let e=qe(t);e&&le.add(e)}}let ue=[...le].sort(),J=a!==void 0,de,fe;t[15]!==r||t[16]!==J?(de=()=>{if(J)return;let e=new AbortController;return Ue(r,e.signal).then(t=>{e.signal.aborted||!t.ok||P(new Map(t.skills.map(Fn)))}),()=>e.abort()},fe=[r,J],t[15]=r,t[16]=J,t[17]=de,t[18]=fe):(de=t[17],fe=t[18]),(0,Q.useEffect)(de,fe);let{plugin:Y,names:pe}=n,me;if(t[19]!==ie||t[20]!==pe){let e;t[22]===ie?e=t[23]:(e=e=>!ie.has(e),t[22]=ie,t[23]=e),me=pe.filter(e),t[19]=ie,t[20]=pe,t[21]=me}else me=t[21];let he=me,X=_.size===he.length&&he.length>0,ge;t[24]===_?ge=t[25]:(ge=function(e,t){let n=new Set(_);t?n.add(e):n.delete(e),x(n)},t[24]=_,t[25]=ge);let _e=ge,ve;t[26]!==d||t[27]!==oe||t[28]!==H||t[29]!==a||t[30]!==o||t[31]!==s||t[32]!==Y||t[33]!==m||t[34]!==_||t[35]!==r?(ve=async function(){if(C(!0),a){let e=await a.installSelected([..._]);if(C(!1),e===null)return;e.size>0&&o?.(e),s(!1);return}let e=await We({source:r,skills:[..._],scope:m,install:!1,marketplace:!0});if(!e.ok){C(!1),q.error(d({id:`Lbl6KA`,values:{0:Y??r,1:e.error}}));return}let t=e.results.map(Pn).filter(Nn),n=[...H];if(n.length>0)for(let e of t){let t=await He({scope:m,name:e,targets:n,linkMode:!0});t.ok||q.error(d({id:`1oSHI0`,values:{0:t.error,skillName:e}}))}for(let e of oe)for(let n of t){let t=await Ge({scope:m,name:n,dir:e,mode:`link`});t.ok||q.error(d({id:`OkC7-2`,values:{0:t.error,skillName:n,root:e}}))}C(!1);let{imported:i,alreadyImported:c,failed:l}=e;if(l>0){let t=e.results.filter(Mn).map(jn).join(`, `);q.error(d({id:`cMMb6H`,values:{imported:i,failed:l,failedNames:t}}))}else i===0?q.info(d({id:`uJfwF8`})):c>0?q.success(d({id:`tkIXtS`,values:{imported:i,alreadyImported:c}})):q.success(d({id:`-kKdCC`,values:{0:Y??r,imported:i}}));let u=new Map;for(let t of e.results)t.status!==`imported`&&t.status!==`already-imported`||u.set(t.requested,t.name??t.requested);u.size>0&&o?.(u),s(!1)},t[26]=d,t[27]=oe,t[28]=H,t[29]=a,t[30]=o,t[31]=s,t[32]=Y,t[33]=m,t[34]=_,t[35]=r,t[36]=ve):ve=t[36];let ye=ve,be=j,xe;t[37]!==S||t[38]!==s?(xe=e=>{!e&&!S&&s(!1)},t[37]=S,t[38]=s,t[39]=xe):xe=t[39];let Se=D,Ce;t[40]===c?Ce=t[41]:(Ce=e=>{c&&(e.preventDefault(),c())},t[40]=c,t[41]=Ce);let we;t[42]!==Y||t[43]!==r?(we=(0,$.jsx)(E,{children:Y?(0,$.jsx)(l,{id:`J86siq`,values:{plugin:Y}}):(0,$.jsx)(l,{id:`Q-DKvr`,values:{source:r}})}),t[42]=Y,t[43]=r,t[44]=we):we=t[44];let Te;t[45]===Y?Te=t[46]:(Te=(0,$.jsx)(T,{children:Y?(0,$.jsx)(l,{id:`lj4cNf`}):(0,$.jsx)(l,{id:`4mDIcg`})}),t[45]=Y,t[46]=Te);let Ee;t[47]!==we||t[48]!==Te?(Ee=(0,$.jsxs)(A,{children:[we,Te]}),t[47]=we,t[48]=Te,t[49]=Ee):Ee=t[49];let De=O,Oe;t[50]!==he.length||t[51]!==_.size?(Oe=(0,$.jsx)(`p`,{className:`font-medium text-xs font-mono text-foreground/70 uppercase tracking-wider`,children:(0,$.jsx)(l,{id:`lUtr1r`,values:{0:_.size,1:he.length}})}),t[50]=he.length,t[51]=_.size,t[52]=Oe):Oe=t[52];let ke;t[53]!==X||t[54]!==he?(ke=()=>x(X?new Set:new Set(he)),t[53]=X,t[54]=he,t[55]=ke):ke=t[55];let Ae;t[56]===X?Ae=t[57]:(Ae=X?(0,$.jsx)(l,{id:`xCJdfg`}):(0,$.jsx)(l,{id:`wgNoIs`}),t[56]=X,t[57]=Ae);let Me;t[58]!==S||t[59]!==ke||t[60]!==Ae?(Me=(0,$.jsx)(b,{variant:`ghost`,size:`sm`,disabled:S,onClick:ke,children:Ae}),t[58]=S,t[59]=ke,t[60]=Ae,t[61]=Me):Me=t[61];let Ne;t[62]!==Oe||t[63]!==Me?(Ne=(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[Oe,Me]}),t[62]=Oe,t[63]=Me,t[64]=Ne):Ne=t[64];let Pe;if(t[65]!==S||t[66]!==M||t[67]!==ie||t[68]!==pe||t[69]!==_||t[70]!==_e){let e;t[72]!==S||t[73]!==M||t[74]!==ie||t[75]!==_||t[76]!==_e?(e=e=>{let t=M.get(e),n=ie.has(e);return(0,$.jsxs)(R,{className:`flex cursor-pointer items-start gap-3 p-3 text-sm font-normal hover:bg-muted/40`,children:[(0,$.jsx)(N,{checked:n||_.has(e),disabled:S||n,onCheckedChange:t=>_e(e,t===!0),className:`mt-0.5`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,$.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`font-mono`,children:e}),n?(0,$.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground uppercase tracking-wide`,children:(0,$.jsx)(l,{id:`eQkgKV`})}):null]}),t?(0,$.jsx)(`span`,{className:`text-1sm text-muted-foreground line-clamp-2`,children:t}):null]})]},e)},t[72]=S,t[73]=M,t[74]=ie,t[75]=_,t[76]=_e,t[77]=e):e=t[77],Pe=pe.map(e),t[65]=S,t[66]=M,t[67]=ie,t[68]=pe,t[69]=_,t[70]=_e,t[71]=Pe}else Pe=t[71];let Fe;t[78]===Pe?Fe=t[79]:(Fe=(0,$.jsx)(`div`,{className:`max-h-72 overflow-y-auto rounded-md border border-border divide-y divide-border`,children:Pe}),t[78]=Pe,t[79]=Fe);let Ie;t[80]===m?Ie=t[81]:(Ie=m===`project`?(0,$.jsx)(l,{id:`oVW7VD`}):(0,$.jsx)(l,{id:`7HY6fA`}),t[80]=m,t[81]=Ie);let Le=J?null:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{"aria-hidden":!0,children:`·`}),H.size+oe.size>0?(0,$.jsx)(y,{hosts:[...H,...oe],iconClassName:`size-3.5`}):(0,$.jsx)(l,{id:`poAsUN`}),(0,$.jsxs)($e,{children:[(0,$.jsx)(Xe,{asChild:!0,children:(0,$.jsx)(b,{variant:`link`,size:`sm`,className:`h-auto px-1`,disabled:S,"data-testid":`plugin-bundle-change-destination`,children:(0,$.jsx)(l,{id:`o-XJ9D`})})}),(0,$.jsxs)(Ze,{align:`start`,className:`flex w-72 flex-col gap-4`,children:[(0,$.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(R,{htmlFor:f,children:(0,$.jsx)(l,{id:`7MSbAT`})}),(0,$.jsxs)(B,{value:m,disabled:S,onValueChange:e=>h(e),children:[(0,$.jsx)(te,{id:f,className:`w-full`,children:(0,$.jsx)(ne,{})}),(0,$.jsx)(ee,{children:Je.map(e=>(0,$.jsx)(z,{value:e,children:p[e]},e))})]})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(R,{children:(0,$.jsx)(l,{id:`Y5la_5`})}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-2`,children:[G.map(e=>(0,$.jsxs)(R,{className:`flex cursor-pointer items-center gap-2 text-sm font-normal`,children:[(0,$.jsx)(N,{checked:H.has(e),disabled:S,onCheckedChange:t=>{let n=new Set(H);t===!0?n.add(e):n.delete(e),L(n)}}),se[e]??e]},e)),ue.map(e=>(0,$.jsxs)(R,{className:`flex cursor-pointer items-center gap-2 font-normal text-sm`,children:[(0,$.jsx)(N,{checked:oe.has(e),disabled:S,onCheckedChange:t=>{let n=new Set(oe);t===!0?n.add(e):n.delete(e),ce(n)}}),(0,$.jsx)(`span`,{className:`font-mono text-xs`,children:e})]},e))]})]})]})]})]}),Re;t[82]!==Ie||t[83]!==Le?(Re=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 text-1sm text-muted-foreground`,"data-testid":`plugin-bundle-destination`,children:[Ie,Le]}),t[82]=Ie,t[83]=Le,t[84]=Re):Re=t[84];let ze;t[85]!==De||t[86]!==Ne||t[87]!==Fe||t[88]!==Re?(ze=(0,$.jsxs)(De,{className:`flex flex-col gap-4`,children:[Ne,Fe,Re]}),t[85]=De,t[86]=Ne,t[87]=Fe,t[88]=Re,t[89]=ze):ze=t[89];let Be;t[90]===s?Be=t[91]:(Be=()=>s(!1),t[90]=s,t[91]=Be);let Ve;t[92]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=(0,$.jsx)(l,{id:`dEgA5A`}),t[92]=Ve):Ve=t[92];let Ye;t[93]!==S||t[94]!==Be?(Ye=(0,$.jsx)(b,{variant:`outline`,className:`font-mono uppercase`,disabled:S,onClick:Be,children:Ve}),t[93]=S,t[94]=Be,t[95]=Ye):Ye=t[95];let Qe=S||_.size===0,et;t[96]===ye?et=t[97]:(et=()=>void ye(),t[96]=ye,t[97]=et);let tt;t[98]!==S||t[99]!==_.size?(tt=S?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(je,{"aria-hidden":`true`,className:`size-4`}),(0,$.jsx)(l,{id:`Wtw22s`})]}):_.size===0?(0,$.jsx)(l,{id:`TKQ7K-`}):(0,$.jsx)(l,{id:`9XwoPv`,values:{0:_.size}}),t[98]=S,t[99]=_.size,t[100]=tt):tt=t[100];let nt;t[101]!==Qe||t[102]!==et||t[103]!==tt?(nt=(0,$.jsx)(b,{"data-testid":`plugin-bundle-install`,disabled:Qe,onClick:et,children:tt}),t[101]=Qe,t[102]=et,t[103]=tt,t[104]=nt):nt=t[104];let rt;t[105]!==Ye||t[106]!==nt?(rt=(0,$.jsxs)(k,{children:[Ye,nt]}),t[105]=Ye,t[106]=nt,t[107]=rt):rt=t[107];let it;t[108]!==Se||t[109]!==Ce||t[110]!==Ee||t[111]!==ze||t[112]!==rt?(it=(0,$.jsxs)(Se,{className:`sm:max-w-lg`,onCloseAutoFocus:Ce,children:[Ee,ze,rt]}),t[108]=Se,t[109]=Ce,t[110]=Ee,t[111]=ze,t[112]=rt,t[113]=it):it=t[113];let at;return t[114]!==be||t[115]!==xe||t[116]!==it?(at=(0,$.jsx)(be,{open:!0,onOpenChange:xe,children:it}),t[114]=be,t[115]=xe,t[116]=it,t[117]=at):at=t[117],at}function jn(e){return e.requested}function Mn(e){return e.status===`failed`||e.status===`not-found`}function Nn(e){return typeof e==`string`}function Pn(e){return e.name}function Fn(e){return[e.name,e.description]}function In(e){return e.name}var Ln=`claude-cowork`,Rn=`ok:skill:cowork:installed:v`,zn=250,Bn=`/api/skill/install-state`,Vn=null,Hn=new Set,Un=null,Wn=!1,Gn=()=>{rr(dr())},Kn=e=>{e.key?.startsWith(Rn)&&rr(dr())};function qn(){Wn||typeof window>`u`||(window.addEventListener(`focus`,Gn),window.addEventListener(`storage`,Kn),Wn=!0)}function Jn(){Wn&&(typeof window>`u`||(window.removeEventListener(`focus`,Gn),window.removeEventListener(`storage`,Kn),Wn=!1))}var Yn=!1,Xn=!1,Zn=!1,Qn=!1,$n=!1,er=!1,tr=!1;async function nr(e){let t=!0;if(e.detectClaudeDesktop)try{t=await e.detectClaudeDesktop()}catch(e){t=!0,Yn||(Yn=!0,console.warn(`[claude-desktop-integration] detectClaudeDesktop IPC rejected — falling back to desktopPresent=true`,e))}let n=await e.fetchSnapshot();if(n){let e=n.targets?.[Ln]??null;return e?.version?{desktopPresent:t,skillInstalled:!0,skillVersion:e.version}:{desktopPresent:t,skillInstalled:!1,skillVersion:null}}let r=e.readLocalStorageGuard();return{desktopPresent:t,skillInstalled:r.skillInstalled,skillVersion:r.skillVersion}}async function rr(e){return Un||(Un=(async()=>{try{Vn=await nr(e);for(let e of Hn)try{e()}catch(e){console.error(`[claude-desktop-integration] subscriber threw`,e)}}catch(e){console.error(`[claude-desktop-integration] probe rejected unexpectedly`,e)}finally{Un=null}})(),Un)}function ir(e){return Hn.size===0&&qn(),Hn.add(e),()=>{Hn.delete(e),Hn.size===0&&Jn()}}function ar(){return Vn}function or(){if(typeof window>`u`)return;let e=window.okDesktop?.skill,t=e?.detectClaudeDesktop;if(t)return()=>t.call(e)}function sr(e){let t=e?.timeoutMs??zn,n=e?.fetchImpl??(typeof fetch<`u`?fetch:void 0);return async()=>{if(!n)return null;let e;try{let r=new AbortController,i=setTimeout(()=>r.abort(),t);try{e=await n(Bn,{method:`GET`,cache:`no-store`,signal:r.signal})}finally{clearTimeout(i)}}catch(e){let n=e instanceof DOMException&&e.name===`AbortError`;return n&&!Zn?(Zn=!0,console.warn(`[claude-desktop-integration] fetch ${Bn} timed out (>${t}ms) — falling back to localStorage guard`)):!n&&!Xn&&(Xn=!0,console.warn(`[claude-desktop-integration] fetch ${Bn} failed — falling back to localStorage guard`,e)),null}if(!e.ok)return Qn||(Qn=!0,console.warn(`[claude-desktop-integration] ${Bn} returned ${e.status} ${e.statusText} — falling back to localStorage guard`)),null;let r;try{r=await e.json()}catch(e){return $n||($n=!0,console.warn(`[claude-desktop-integration] ${Bn} returned unparseable JSON — falling back to localStorage guard`,e)),null}return cr(r)}}function cr(e){if(typeof e!=`object`||!e)return lr(`not an object`);let t=e;if(typeof t.currentVersion!=`string`||t.currentVersion===``)return lr(`currentVersion not a non-empty string`);if(t.targets!==void 0){if(t.targets===null||typeof t.targets!=`object`)return lr(`targets not object`);for(let[,e]of Object.entries(t.targets)){if(e==null)continue;if(typeof e!=`object`)return lr(`target entry not object`);let t=e;if(typeof t.version!=`string`||t.version===``)return lr(`target.version not a non-empty string`)}}return t}function lr(e){return er||(er=!0,console.warn(`[claude-desktop-integration] ${Bn} response failed shape validation (${e}) — falling back to localStorage guard`)),null}function ur(){if(typeof localStorage>`u`)return{skillInstalled:!1,skillVersion:null};try{for(let e=0;e<localStorage.length;e++){let t=localStorage.key(e);if(t?.startsWith(Rn))return{skillInstalled:!0,skillVersion:t.slice(27)}}}catch(e){tr||(tr=!0,console.warn(`[claude-desktop-integration] localStorage scan threw — falling back to skillInstalled=false`,e))}return{skillInstalled:!1,skillVersion:null}}function dr(){return{detectClaudeDesktop:or(),fetchSnapshot:sr(),readLocalStorageGuard:ur}}function fr(){let e=(0,Z.c)(5),t=(0,Q.useSyncExternalStore)(ir,ar,ar),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[],e[0]=n):n=e[0],(0,Q.useEffect)(mr,n);let r=t?.desktopPresent??!0,i=t?.skillInstalled??!1,a=t?.skillVersion??null,o;return e[1]!==r||e[2]!==i||e[3]!==a?(o={desktopPresent:r,skillInstalled:i,skillVersion:a,refresh:pr},e[1]=r,e[2]=i,e[3]=a,e[4]=o):o=e[4],o}function pr(){rr(dr())}function mr(){Vn||rr(dr())}function hr(){return typeof window<`u`&&window.okDesktop!=null}function gr(){return hr()&&window.okDesktop?.config.ptyAvailable===!0}var _r=[{path:[`appearance`,`theme`],label:{id:`FEr96N`},description:{id:`JZ8cO6`},control:`theme-cards`},{path:[`appearance`,`language`],label:{id:`vXIe7J`},description:{id:`gUx34c`},control:`language-select`},{path:[`editor`,`wordWrap`],label:{id:`iKSP5j`},description:{id:`mmpzAq`}},{path:[`editor`,`previewTabs`],label:{id:`drzzZw`},description:{id:`AIC67-`}},{path:[`appearance`,`preview`,`autoOpen`],label:{id:`2XQ8Ww`},description:{id:`bultyE`}},{path:[`telemetry`,`skillInstallReports`,`enabled`],label:{id:`2jUGEP`},description:{id:`Ns0z5o`}}],vr=[{path:[`appearance`,`colorThemeLight`],label:{id:`rFmBG3`},description:{id:`mnpsVn`},control:`theme-tiles`}],yr=[{sectionId:`preferences`,fields:_r},{sectionId:`plugin:theme`,fields:vr}];async function br(){try{let e=await fetch(`/api/sync/conflicts`);return e.ok?{conflicts:(await e.json()).conflicts??[]}:(console.warn(JSON.stringify({event:`conflicts-fetch-failed`,status:e.status})),{conflicts:[],error:`server`})}catch(e){return console.warn(JSON.stringify({event:`conflicts-fetch-failed`,status:null,detail:e instanceof Error?e.message:String(e)})),{conflicts:[],error:`network`}}}function xr(){let e=(0,Z.c)(10),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0];let[n,r]=(0,Q.useState)(t),[i,a]=(0,Q.useState)(!0),[o,s]=(0,Q.useState)(null),c=(0,Q.useRef)(0),l;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(l=function(){let e=c.current+=1;br().then(t=>{let{conflicts:n,error:i}=t;e===c.current&&(r(n),s(i??null),a(!1))})},e[1]=l):l=e[1];let u=l,d,f;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>{u()},f=[],e[2]=d,e[3]=f):(d=e[2],f=e[3]),(0,Q.useEffect)(d,f);let p,m;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>fe(e=>{e.includes(`sync-status`)&&u()}),m=[],e[4]=p,e[5]=m):(p=e[4],m=e[5]),(0,Q.useEffect)(p,m);let h;return e[6]!==n||e[7]!==o||e[8]!==i?(h={conflicts:n,loading:i,error:o},e[6]=n,e[7]=o,e[8]=i,e[9]=h):h=e[9],h}function Sr(e){if(!e)return``;let t=e.replace(/[/\\]+$/g,``),n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return n<0?t:t.slice(n+1)}function Cr(e){let t=e.trim();return t.length===0?{kind:`blank`,raw:e}:t.startsWith(`#`)?{kind:`comment`,raw:e}:{kind:`pattern`,raw:e,text:t}}function wr(e){return{lines:e.split(`
9
+ `;function bn(e){let t=(0,Z.c)(12),{folderPath:n,existingNames:r,open:i,onOpenChange:a,onCreated:o}=e,s;t[0]!==r||t[1]!==n||t[2]!==o||t[3]!==a||t[4]!==i?(s=i?(0,$.jsx)(xn,{folderPath:n,existingNames:r,onOpenChange:a,onCreated:o}):null,t[0]=r,t[1]=n,t[2]=o,t[3]=a,t[4]=i,t[5]=s):s=t[5];let c;t[6]===s?c=t[7]:(c=(0,$.jsx)(D,{className:`sm:max-w-3xl max-h-[85vh] flex flex-col`,children:s}),t[6]=s,t[7]=c);let l;return t[8]!==a||t[9]!==i||t[10]!==c?(l=(0,$.jsx)(j,{open:i,onOpenChange:a,children:c}),t[8]=a,t[9]=i,t[10]=c,t[11]=l):l=t[11],l}function xn(e){let t=(0,Z.c)(31),{folderPath:n,existingNames:r,onOpenChange:i,onCreated:a}=e,o;t[0]!==a||t[1]!==i?(o=e=>{a(e),i(!1)},t[0]=a,t[1]=i,t[2]=o):o=t[2];let s;t[3]!==r||t[4]!==n||t[5]!==o?(s={mode:`create`,folderPath:n,initial:vn,existingNames:r,onCommitted:o},t[3]=r,t[4]=n,t[5]=o,t[6]=s):s=t[6];let c=fn(s),u;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(E,{children:(0,$.jsx)(l,{id:`G1Gw0v`})}),t[7]=u):u=t[7];let d;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsxs)(A,{children:[u,(0,$.jsx)(T,{children:(0,$.jsx)(l,{id:`NUr4kz`})})]}),t[8]=d):d=t[8];let f;t[9]===c?f=t[10]:(f=(0,$.jsx)(O,{children:(0,$.jsx)(mn,{form:c,bodyPlaceholder:yn})}),t[9]=c,t[10]=f);let p;t[11]===i?p=t[12]:(p=()=>i(!1),t[11]=i,t[12]=p);let m;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsx)(l,{id:`dEgA5A`}),t[13]=m):m=t[13];let h;t[14]!==c.isSaving||t[15]!==p?(h=(0,$.jsx)(b,{variant:`outline`,className:`font-mono uppercase`,onMouseDown:Sn,onClick:p,disabled:c.isSaving,children:m}),t[14]=c.isSaving,t[15]=p,t[16]=h):h=t[16];let g;t[17]===c?g=t[18]:(g=()=>void c.submit(),t[17]=c,t[18]=g);let _;t[19]===c.isSaving?_=t[20]:(_=c.isSaving?(0,$.jsx)(l,{id:`E9bKSA`}):(0,$.jsx)(l,{id:`A5hiCy`}),t[19]=c.isSaving,t[20]=_);let v;t[21]!==c.isSaving||t[22]!==_||t[23]!==g?(v=(0,$.jsx)(b,{onClick:g,disabled:c.isSaving,children:_}),t[21]=c.isSaving,t[22]=_,t[23]=g,t[24]=v):v=t[24];let y;t[25]!==v||t[26]!==h?(y=(0,$.jsxs)(k,{children:[h,v]}),t[25]=v,t[26]=h,t[27]=y):y=t[27];let x;return t[28]!==y||t[29]!==f?(x=(0,$.jsxs)($.Fragment,{children:[d,f,y]}),t[28]=y,t[29]=f,t[30]=x):x=t[30],x}function Sn(e){return e.preventDefault()}function Cn(e){let t=(0,Z.c)(16),{template:n,onOpenChange:r,onDeleted:i}=e,{_:a}=u(),[o,s]=(0,Q.useState)(!1),c;t[0]!==a||t[1]!==i||t[2]!==r?(c=async function(e){s(!0);let t=await Ae(e.source_folder,e.name);if(s(!1),!t.ok){let{error:e}=t;q.error(a({id:`36WXSC`,values:{error:e}}));return}let n=e.title??e.name;q.success(a({id:`ErRi6L`,values:{label:n}})),i(),r(!1)},t[0]=a,t[1]=i,t[2]=r,t[3]=c):c=t[3];let l=c,d=n!==null,f;t[4]!==o||t[5]!==r?(f=e=>{!e&&!o&&r(!1)},t[4]=o,t[5]=r,t[6]=f):f=t[6];let p;t[7]!==a||t[8]!==o||t[9]!==l||t[10]!==n?(p=n?(()=>{let{name:e,path:t,scope:r}=n,i=r===`inherited`?`\n\n${a({id:`8uAWix`})}`:``;return(0,$.jsx)(_,{itemName:a({id:`XfzqjK`,values:{name:e}}),isSubmitting:o,onDelete:()=>l(n),customDescription:`${a({id:`5LXwX8`,values:{path:t}})}${i}`})})():null,t[7]=a,t[8]=o,t[9]=l,t[10]=n,t[11]=p):p=t[11];let m;return t[12]!==d||t[13]!==f||t[14]!==p?(m=(0,$.jsx)(M,{open:d,onOpenChange:f,children:p}),t[12]=d,t[13]=f,t[14]=p,t[15]=m):m=t[15],m}function wn(e){let t=(0,Z.c)(45),{template:n,onEdit:i,onDelete:a,onCreate:o,badge:s}=e,{_:c}=u(),d=n.title??n.name,f=!!(n.title&&n.title!==n.name),p;t[0]===d?p=t[1]:(p=(0,$.jsx)(`span`,{className:`truncate font-medium`,children:d}),t[0]=d,t[1]=p);let m;t[2]!==f||t[3]!==n.name?(m=f?(0,$.jsx)(`code`,{className:`shrink-0 font-mono text-xs text-muted-foreground`,children:n.name}):null,t[2]=f,t[3]=n.name,t[4]=m):m=t[4];let _;t[5]===s?_=t[6]:(_=s?(0,$.jsx)(`span`,{className:`ml-auto shrink-0`,children:s}):null,t[5]=s,t[6]=_);let v;t[7]!==p||t[8]!==m||t[9]!==_?(v=(0,$.jsxs)(`span`,{className:`flex w-full items-center gap-2`,children:[p,m,_]}),t[7]=p,t[8]=m,t[9]=_,t[10]=v):v=t[10];let y;t[11]===n.description?y=t[12]:(y=n.description?(0,$.jsx)(`span`,{className:`w-full truncate text-sm text-muted-foreground`,children:n.description}):null,t[11]=n.description,t[12]=y);let x;t[13]!==i||t[14]!==v||t[15]!==y?(x=(0,$.jsxs)(b,{type:`button`,variant:`ghost`,onClick:i,className:`h-auto min-w-0 flex-1 flex-col items-start gap-0.5 px-1.5 py-1 text-left font-normal hover:bg-transparent`,children:[v,y]}),t[13]=i,t[14]=v,t[15]=y,t[16]=x):x=t[16];let S;t[17]!==c||t[18]!==d||t[19]!==o?(S=o?(0,$.jsxs)(b,{type:`button`,variant:`ghost`,size:`sm`,className:`shrink-0 font-mono uppercase opacity-0 group-hover:opacity-100 focus-visible:opacity-100`,onClick:o,"aria-label":c({id:`mZ1r4i`,values:{label:d}}),children:[(0,$.jsx)(g,{className:`size-3.5`,"aria-hidden":!0}),(0,$.jsx)(l,{id:`hYgDIe`})]}):null,t[17]=c,t[18]=d,t[19]=o,t[20]=S):S=t[20];let C;t[21]!==c||t[22]!==d?(C=c({id:`Bx4EXG`,values:{label:d}}),t[21]=c,t[22]=d,t[23]=C):C=t[23];let w;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(h,{className:`size-4`,"aria-hidden":!0}),t[24]=w):w=t[24];let T;t[25]===C?T=t[26]:(T=(0,$.jsx)(F,{asChild:!0,children:(0,$.jsx)(b,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0 opacity-0 group-hover:opacity-100 focus-visible:opacity-100 data-[state=open]:opacity-100`,"aria-label":C,children:w})}),t[25]=C,t[26]=T);let E,D;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(r,{"aria-hidden":!0}),D=(0,$.jsx)(l,{id:`ePK91l`}),t[27]=E,t[28]=D):(E=t[27],D=t[28]);let O;t[29]===i?O=t[30]:(O=(0,$.jsxs)(P,{onSelect:i,children:[E,D]}),t[29]=i,t[30]=O);let k,A;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,$.jsx)(Ne,{"aria-hidden":!0}),A=(0,$.jsx)(l,{id:`cnGeoo`}),t[31]=k,t[32]=A):(k=t[31],A=t[32]);let j;t[33]===a?j=t[34]:(j=(0,$.jsxs)(P,{variant:`destructive`,onSelect:a,children:[k,A]}),t[33]=a,t[34]=j);let M;t[35]!==O||t[36]!==j?(M=(0,$.jsxs)(I,{align:`end`,className:`min-w-52`,children:[O,j]}),t[35]=O,t[36]=j,t[37]=M):M=t[37];let N;t[38]!==T||t[39]!==M?(N=(0,$.jsxs)(L,{modal:!1,children:[T,M]}),t[38]=T,t[39]=M,t[40]=N):N=t[40];let R;return t[41]!==N||t[42]!==x||t[43]!==S?(R=(0,$.jsxs)(`li`,{className:`group flex items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-muted/50`,children:[x,S,N]}),t[41]=N,t[42]=x,t[43]=S,t[44]=R):R=t[44],R}function Tn(){let e=(0,Z.c)(8),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={status:`idle`},e[0]=t):t=e[0];let[n,r]=(0,Q.useState)(t),[i,a]=(0,Q.useState)(0),[o,s]=(0,Q.useState)(!1),c;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=!1;return r({status:`loading`}),fetch(`/api/skill-targets`).then(Dn).then(t=>{if(e)return;let n=G.safeParse(t);if(!n.success){console.error(`[ok-skills] /api/skill-targets response failed schema validation:`,n.error.issues),r({status:`error`,message:J._({id:`PXaT32`})});return}r({status:`ready`,data:n.data})}).catch(t=>{e||r({status:`error`,message:t instanceof Error?t.message:String(t)})}),()=>{e=!0}},e[1]=c):c=e[1];let l;e[2]===i?l=e[3]:(l=[i],e[2]=i,e[3]=l),(0,Q.useEffect)(c,l);let u;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(u=async e=>{s(!0);let t=await Ve(e);if(!t.ok)throw s(!1),Error(t.error);if(e.preview)return s(!1),t.preview;de(),a(En),s(!1)},e[4]=u):u=e[4];let d=u,f;return e[5]!==o||e[6]!==n?(f={state:n,saving:o,folderAction:d},e[5]=o,e[6]=n,e[7]=f):f=e[7],f}function En(e){return e+1}async function Dn(e){if(!e.ok){let t=await e.json().catch(On);throw Error(me(t)??`HTTP ${e.status}`)}return e.json()}function On(){return null}function kn(e){let t=(0,Z.c)(2);if(!e.bundle)return null;let n;return t[0]===e?n=t[1]:(n=(0,$.jsx)(An,{...e,bundle:e.bundle}),t[0]=e,t[1]=n),n}function An(e){let t=(0,Z.c)(118),{bundle:n,source:r,defaultScope:i,installOverride:a,onInstalled:o,onOpenChange:s,returnFocus:c}=e,{_:d}=u(),f=(0,Q.useId)(),p=Ke(),[m,h]=(0,Q.useState)(a?.scope??i),g;t[0]!==n.names||t[1]!==a?(g=()=>a?new Set(n.names):new Set,t[0]=n.names,t[1]=a,t[2]=g):g=t[2];let[_,x]=(0,Q.useState)(g),[S,C]=(0,Q.useState)(!1),w;t[3]===n.descriptions?w=t[4]:(w=()=>new Map(Object.entries(n.descriptions??{})),t[3]=n.descriptions,t[4]=w);let[M,P]=(0,Q.useState)(w),F=Tn(),[I,L]=(0,Q.useState)(null),re=F.state.status===`ready`?F.state.data.targets:null,V;t[5]!==re||t[6]!==I?(V=I??new Set(re??[]),t[5]=re,t[6]=I,t[7]=V):V=t[7];let H=V,U=lt(),W=U.status===`ready`?U.data.find(e=>e.scope===m)?.installableEditors:void 0,G=v.filter(e=>!W||W.includes(e)||H.has(e)),K;t[8]!==m||t[9]!==U.data||t[10]!==U.status?(K=U.status===`ready`?new Set(U.data.filter(e=>e.scope===m).map(In)):new Set,t[8]=m,t[9]=U.data,t[10]=U.status,t[11]=K):K=t[11];let ie=K,ae;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(ae=new Set,t[12]=ae):ae=t[12];let[oe,ce]=(0,Q.useState)(ae),le=new Set;if(F.state.status===`ready`){let e;t[13]===F.state.data.folders?e=t[14]:(e=F.state.data.folders??[],t[13]=F.state.data.folders,t[14]=e);for(let t of e)t.scope===m&&(v.includes(t.host)||t.root&&le.add(t.root))}if(U.status===`ready`){for(let e of U.data)if(e.scope===m)for(let t of e.customPlacements??[]){let e=qe(t);e&&le.add(e)}}let ue=[...le].sort(),J=a!==void 0,de,fe;t[15]!==r||t[16]!==J?(de=()=>{if(J)return;let e=new AbortController;return Ue(r,e.signal).then(t=>{e.signal.aborted||!t.ok||P(new Map(t.skills.map(Fn)))}),()=>e.abort()},fe=[r,J],t[15]=r,t[16]=J,t[17]=de,t[18]=fe):(de=t[17],fe=t[18]),(0,Q.useEffect)(de,fe);let{plugin:Y,names:pe}=n,me;if(t[19]!==ie||t[20]!==pe){let e;t[22]===ie?e=t[23]:(e=e=>!ie.has(e),t[22]=ie,t[23]=e),me=pe.filter(e),t[19]=ie,t[20]=pe,t[21]=me}else me=t[21];let he=me,X=_.size===he.length&&he.length>0,ge;t[24]===_?ge=t[25]:(ge=function(e,t){let n=new Set(_);t?n.add(e):n.delete(e),x(n)},t[24]=_,t[25]=ge);let _e=ge,ve;t[26]!==d||t[27]!==oe||t[28]!==H||t[29]!==a||t[30]!==o||t[31]!==s||t[32]!==Y||t[33]!==m||t[34]!==_||t[35]!==r?(ve=async function(){if(C(!0),a){let e=await a.installSelected([..._]);if(C(!1),e===null)return;e.size>0&&o?.(e),s(!1);return}let e=await We({source:r,skills:[..._],scope:m,install:!1,marketplace:!0});if(!e.ok){C(!1),q.error(d({id:`Lbl6KA`,values:{0:Y??r,1:e.error}}));return}let t=e.results.map(Pn).filter(Nn),n=[...H];if(n.length>0)for(let e of t){let t=await He({scope:m,name:e,targets:n,linkMode:!0});t.ok||q.error(d({id:`1oSHI0`,values:{0:t.error,skillName:e}}))}for(let e of oe)for(let n of t){let t=await Ge({scope:m,name:n,dir:e,mode:`link`});t.ok||q.error(d({id:`OkC7-2`,values:{0:t.error,skillName:n,root:e}}))}C(!1);let{imported:i,alreadyImported:c,failed:l}=e;if(l>0){let t=e.results.filter(Mn).map(jn).join(`, `);q.error(d({id:`cMMb6H`,values:{imported:i,failed:l,failedNames:t}}))}else i===0?q.info(d({id:`uJfwF8`})):c>0?q.success(d({id:`tkIXtS`,values:{imported:i,alreadyImported:c}})):q.success(d({id:`-kKdCC`,values:{0:Y??r,imported:i}}));let u=new Map;for(let t of e.results)t.status!==`imported`&&t.status!==`already-imported`||u.set(t.requested,t.name??t.requested);u.size>0&&o?.(u),s(!1)},t[26]=d,t[27]=oe,t[28]=H,t[29]=a,t[30]=o,t[31]=s,t[32]=Y,t[33]=m,t[34]=_,t[35]=r,t[36]=ve):ve=t[36];let ye=ve,be=j,xe;t[37]!==S||t[38]!==s?(xe=e=>{!e&&!S&&s(!1)},t[37]=S,t[38]=s,t[39]=xe):xe=t[39];let Se=D,Ce;t[40]===c?Ce=t[41]:(Ce=e=>{c&&(e.preventDefault(),c())},t[40]=c,t[41]=Ce);let we;t[42]!==Y||t[43]!==r?(we=(0,$.jsx)(E,{children:Y?(0,$.jsx)(l,{id:`J86siq`,values:{plugin:Y}}):(0,$.jsx)(l,{id:`Q-DKvr`,values:{source:r}})}),t[42]=Y,t[43]=r,t[44]=we):we=t[44];let Te;t[45]===Y?Te=t[46]:(Te=(0,$.jsx)(T,{children:Y?(0,$.jsx)(l,{id:`lj4cNf`}):(0,$.jsx)(l,{id:`4mDIcg`})}),t[45]=Y,t[46]=Te);let Ee;t[47]!==we||t[48]!==Te?(Ee=(0,$.jsxs)(A,{children:[we,Te]}),t[47]=we,t[48]=Te,t[49]=Ee):Ee=t[49];let De=O,Oe;t[50]!==he.length||t[51]!==_.size?(Oe=(0,$.jsx)(`p`,{className:`font-medium text-xs font-mono text-foreground/70 uppercase tracking-wider`,children:(0,$.jsx)(l,{id:`lUtr1r`,values:{0:_.size,1:he.length}})}),t[50]=he.length,t[51]=_.size,t[52]=Oe):Oe=t[52];let ke;t[53]!==X||t[54]!==he?(ke=()=>x(X?new Set:new Set(he)),t[53]=X,t[54]=he,t[55]=ke):ke=t[55];let Ae;t[56]===X?Ae=t[57]:(Ae=X?(0,$.jsx)(l,{id:`xCJdfg`}):(0,$.jsx)(l,{id:`wgNoIs`}),t[56]=X,t[57]=Ae);let Me;t[58]!==S||t[59]!==ke||t[60]!==Ae?(Me=(0,$.jsx)(b,{variant:`ghost`,size:`sm`,disabled:S,onClick:ke,children:Ae}),t[58]=S,t[59]=ke,t[60]=Ae,t[61]=Me):Me=t[61];let Ne;t[62]!==Oe||t[63]!==Me?(Ne=(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[Oe,Me]}),t[62]=Oe,t[63]=Me,t[64]=Ne):Ne=t[64];let Pe;if(t[65]!==S||t[66]!==M||t[67]!==ie||t[68]!==pe||t[69]!==_||t[70]!==_e){let e;t[72]!==S||t[73]!==M||t[74]!==ie||t[75]!==_||t[76]!==_e?(e=e=>{let t=M.get(e),n=ie.has(e);return(0,$.jsxs)(R,{className:`flex cursor-pointer items-start gap-3 p-3 text-sm font-normal hover:bg-muted/40`,children:[(0,$.jsx)(N,{checked:n||_.has(e),disabled:S||n,onCheckedChange:t=>_e(e,t===!0),className:`mt-0.5`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,$.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`font-mono`,children:e}),n?(0,$.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground uppercase tracking-wide`,children:(0,$.jsx)(l,{id:`eQkgKV`})}):null]}),t?(0,$.jsx)(`span`,{className:`text-1sm text-muted-foreground line-clamp-2`,children:t}):null]})]},e)},t[72]=S,t[73]=M,t[74]=ie,t[75]=_,t[76]=_e,t[77]=e):e=t[77],Pe=pe.map(e),t[65]=S,t[66]=M,t[67]=ie,t[68]=pe,t[69]=_,t[70]=_e,t[71]=Pe}else Pe=t[71];let Fe;t[78]===Pe?Fe=t[79]:(Fe=(0,$.jsx)(`div`,{className:`max-h-72 overflow-y-auto rounded-md border border-border divide-y divide-border`,children:Pe}),t[78]=Pe,t[79]=Fe);let Ie;t[80]===m?Ie=t[81]:(Ie=m===`project`?(0,$.jsx)(l,{id:`oVW7VD`}):(0,$.jsx)(l,{id:`7HY6fA`}),t[80]=m,t[81]=Ie);let Le=J?null:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{"aria-hidden":!0,children:`·`}),H.size+oe.size>0?(0,$.jsx)(y,{hosts:[...H,...oe],iconClassName:`size-3.5`}):(0,$.jsx)(l,{id:`poAsUN`}),(0,$.jsxs)($e,{children:[(0,$.jsx)(Xe,{asChild:!0,children:(0,$.jsx)(b,{variant:`link`,size:`sm`,className:`h-auto px-1`,disabled:S,"data-testid":`plugin-bundle-change-destination`,children:(0,$.jsx)(l,{id:`o-XJ9D`})})}),(0,$.jsxs)(Ze,{align:`start`,className:`flex w-72 flex-col gap-4`,children:[(0,$.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(R,{htmlFor:f,children:(0,$.jsx)(l,{id:`7MSbAT`})}),(0,$.jsxs)(B,{value:m,disabled:S,onValueChange:e=>h(e),children:[(0,$.jsx)(te,{id:f,className:`w-full`,children:(0,$.jsx)(ne,{})}),(0,$.jsx)(ee,{children:Je.map(e=>(0,$.jsx)(z,{value:e,children:p[e]},e))})]})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(R,{children:(0,$.jsx)(l,{id:`Y5la_5`})}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-2`,children:[G.map(e=>(0,$.jsxs)(R,{className:`flex cursor-pointer items-center gap-2 text-sm font-normal`,children:[(0,$.jsx)(N,{checked:H.has(e),disabled:S,onCheckedChange:t=>{let n=new Set(H);t===!0?n.add(e):n.delete(e),L(n)}}),se[e]??e]},e)),ue.map(e=>(0,$.jsxs)(R,{className:`flex cursor-pointer items-center gap-2 font-normal text-sm`,children:[(0,$.jsx)(N,{checked:oe.has(e),disabled:S,onCheckedChange:t=>{let n=new Set(oe);t===!0?n.add(e):n.delete(e),ce(n)}}),(0,$.jsx)(`span`,{className:`font-mono text-xs`,children:e})]},e))]})]})]})]})]}),Re;t[82]!==Ie||t[83]!==Le?(Re=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 text-1sm text-muted-foreground`,"data-testid":`plugin-bundle-destination`,children:[Ie,Le]}),t[82]=Ie,t[83]=Le,t[84]=Re):Re=t[84];let ze;t[85]!==De||t[86]!==Ne||t[87]!==Fe||t[88]!==Re?(ze=(0,$.jsxs)(De,{className:`flex flex-col gap-4`,children:[Ne,Fe,Re]}),t[85]=De,t[86]=Ne,t[87]=Fe,t[88]=Re,t[89]=ze):ze=t[89];let Be;t[90]===s?Be=t[91]:(Be=()=>s(!1),t[90]=s,t[91]=Be);let Ve;t[92]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=(0,$.jsx)(l,{id:`dEgA5A`}),t[92]=Ve):Ve=t[92];let Ye;t[93]!==S||t[94]!==Be?(Ye=(0,$.jsx)(b,{variant:`outline`,className:`font-mono uppercase`,disabled:S,onClick:Be,children:Ve}),t[93]=S,t[94]=Be,t[95]=Ye):Ye=t[95];let Qe=S||_.size===0,et;t[96]===ye?et=t[97]:(et=()=>void ye(),t[96]=ye,t[97]=et);let tt;t[98]!==S||t[99]!==_.size?(tt=S?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(je,{"aria-hidden":`true`,className:`size-4`}),(0,$.jsx)(l,{id:`Wtw22s`})]}):_.size===0?(0,$.jsx)(l,{id:`TKQ7K-`}):(0,$.jsx)(l,{id:`9XwoPv`,values:{0:_.size}}),t[98]=S,t[99]=_.size,t[100]=tt):tt=t[100];let nt;t[101]!==Qe||t[102]!==et||t[103]!==tt?(nt=(0,$.jsx)(b,{"data-testid":`plugin-bundle-install`,disabled:Qe,onClick:et,children:tt}),t[101]=Qe,t[102]=et,t[103]=tt,t[104]=nt):nt=t[104];let rt;t[105]!==Ye||t[106]!==nt?(rt=(0,$.jsxs)(k,{children:[Ye,nt]}),t[105]=Ye,t[106]=nt,t[107]=rt):rt=t[107];let it;t[108]!==Se||t[109]!==Ce||t[110]!==Ee||t[111]!==ze||t[112]!==rt?(it=(0,$.jsxs)(Se,{className:`sm:max-w-lg`,onCloseAutoFocus:Ce,children:[Ee,ze,rt]}),t[108]=Se,t[109]=Ce,t[110]=Ee,t[111]=ze,t[112]=rt,t[113]=it):it=t[113];let at;return t[114]!==be||t[115]!==xe||t[116]!==it?(at=(0,$.jsx)(be,{open:!0,onOpenChange:xe,children:it}),t[114]=be,t[115]=xe,t[116]=it,t[117]=at):at=t[117],at}function jn(e){return e.requested}function Mn(e){return e.status===`failed`||e.status===`not-found`}function Nn(e){return typeof e==`string`}function Pn(e){return e.name}function Fn(e){return[e.name,e.description]}function In(e){return e.name}var Ln=`claude-cowork`,Rn=`ok:skill:cowork:installed:v`,zn=250,Bn=`/api/skill/install-state`,Vn=null,Hn=new Set,Un=null,Wn=!1,Gn=()=>{rr(dr())},Kn=e=>{e.key?.startsWith(Rn)&&rr(dr())};function qn(){Wn||typeof window>`u`||(window.addEventListener(`focus`,Gn),window.addEventListener(`storage`,Kn),Wn=!0)}function Jn(){Wn&&(typeof window>`u`||(window.removeEventListener(`focus`,Gn),window.removeEventListener(`storage`,Kn),Wn=!1))}var Yn=!1,Xn=!1,Zn=!1,Qn=!1,$n=!1,er=!1,tr=!1;async function nr(e){let t=!0;if(e.detectClaudeDesktop)try{t=await e.detectClaudeDesktop()}catch(e){t=!0,Yn||(Yn=!0,console.warn(`[claude-desktop-integration] detectClaudeDesktop IPC rejected — falling back to desktopPresent=true`,e))}let n=await e.fetchSnapshot();if(n){let e=n.targets?.[Ln]??null;return e?.version?{desktopPresent:t,skillInstalled:!0,skillVersion:e.version}:{desktopPresent:t,skillInstalled:!1,skillVersion:null}}let r=e.readLocalStorageGuard();return{desktopPresent:t,skillInstalled:r.skillInstalled,skillVersion:r.skillVersion}}async function rr(e){return Un||(Un=(async()=>{try{Vn=await nr(e);for(let e of Hn)try{e()}catch(e){console.error(`[claude-desktop-integration] subscriber threw`,e)}}catch(e){console.error(`[claude-desktop-integration] probe rejected unexpectedly`,e)}finally{Un=null}})(),Un)}function ir(e){return Hn.size===0&&qn(),Hn.add(e),()=>{Hn.delete(e),Hn.size===0&&Jn()}}function ar(){return Vn}function or(){if(typeof window>`u`)return;let e=window.okDesktop?.skill,t=e?.detectClaudeDesktop;if(t)return()=>t.call(e)}function sr(e){let t=e?.timeoutMs??zn,n=e?.fetchImpl??(typeof fetch<`u`?fetch:void 0);return async()=>{if(!n)return null;let e;try{let r=new AbortController,i=setTimeout(()=>r.abort(),t);try{e=await n(Bn,{method:`GET`,cache:`no-store`,signal:r.signal})}finally{clearTimeout(i)}}catch(e){let n=e instanceof DOMException&&e.name===`AbortError`;return n&&!Zn?(Zn=!0,console.warn(`[claude-desktop-integration] fetch ${Bn} timed out (>${t}ms) — falling back to localStorage guard`)):!n&&!Xn&&(Xn=!0,console.warn(`[claude-desktop-integration] fetch ${Bn} failed — falling back to localStorage guard`,e)),null}if(!e.ok)return Qn||(Qn=!0,console.warn(`[claude-desktop-integration] ${Bn} returned ${e.status} ${e.statusText} — falling back to localStorage guard`)),null;let r;try{r=await e.json()}catch(e){return $n||($n=!0,console.warn(`[claude-desktop-integration] ${Bn} returned unparseable JSON — falling back to localStorage guard`,e)),null}return cr(r)}}function cr(e){if(typeof e!=`object`||!e)return lr(`not an object`);let t=e;if(typeof t.currentVersion!=`string`||t.currentVersion===``)return lr(`currentVersion not a non-empty string`);if(t.targets!==void 0){if(t.targets===null||typeof t.targets!=`object`)return lr(`targets not object`);for(let[,e]of Object.entries(t.targets)){if(e==null)continue;if(typeof e!=`object`)return lr(`target entry not object`);let t=e;if(typeof t.version!=`string`||t.version===``)return lr(`target.version not a non-empty string`)}}return t}function lr(e){return er||(er=!0,console.warn(`[claude-desktop-integration] ${Bn} response failed shape validation (${e}) — falling back to localStorage guard`)),null}function ur(){if(typeof localStorage>`u`)return{skillInstalled:!1,skillVersion:null};try{for(let e=0;e<localStorage.length;e++){let t=localStorage.key(e);if(t?.startsWith(Rn))return{skillInstalled:!0,skillVersion:t.slice(27)}}}catch(e){tr||(tr=!0,console.warn(`[claude-desktop-integration] localStorage scan threw — falling back to skillInstalled=false`,e))}return{skillInstalled:!1,skillVersion:null}}function dr(){return{detectClaudeDesktop:or(),fetchSnapshot:sr(),readLocalStorageGuard:ur}}function fr(){let e=(0,Z.c)(5),t=(0,Q.useSyncExternalStore)(ir,ar,ar),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[],e[0]=n):n=e[0],(0,Q.useEffect)(mr,n);let r=t?.desktopPresent??!0,i=t?.skillInstalled??!1,a=t?.skillVersion??null,o;return e[1]!==r||e[2]!==i||e[3]!==a?(o={desktopPresent:r,skillInstalled:i,skillVersion:a,refresh:pr},e[1]=r,e[2]=i,e[3]=a,e[4]=o):o=e[4],o}function pr(){rr(dr())}function mr(){Vn||rr(dr())}function hr(){return typeof window<`u`&&window.okDesktop!=null}function gr(){return hr()&&window.okDesktop?.config.ptyAvailable===!0}var _r=[{path:[`appearance`,`theme`],label:{id:`FEr96N`},description:{id:`JZ8cO6`},control:`theme-cards`},{path:[`appearance`,`language`],label:{id:`vXIe7J`},description:{id:`gUx34c`},control:`language-select`},{path:[`editor`,`wordWrap`],label:{id:`iKSP5j`},description:{id:`mmpzAq`}},{path:[`editor`,`previewTabs`],label:{id:`drzzZw`},description:{id:`AIC67-`}},{path:[`appearance`,`preview`,`autoOpen`],label:{id:`2XQ8Ww`},description:{id:`bultyE`}},{path:[`telemetry`,`skillInstallReports`,`enabled`],label:{id:`2jUGEP`},description:{id:`Ns0z5o`}}],vr=[{path:[`appearance`,`colorThemeLight`],label:{id:`rFmBG3`},description:{id:`mnpsVn`},control:`theme-tiles`}],yr=[{sectionId:`preferences`,fields:_r},{sectionId:`plugin:theme`,fields:vr}];async function br(){try{let e=await fetch(`/api/sync/conflicts`);return e.ok?{conflicts:(await e.json()).conflicts??[]}:(console.warn(JSON.stringify({event:`conflicts-fetch-failed`,status:e.status})),{conflicts:[],error:`server`})}catch(e){return console.warn(JSON.stringify({event:`conflicts-fetch-failed`,status:null,detail:e instanceof Error?e.message:String(e)})),{conflicts:[],error:`network`}}}function xr(){let e=(0,Z.c)(10),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0];let[n,r]=(0,Q.useState)(t),[i,a]=(0,Q.useState)(!0),[o,s]=(0,Q.useState)(null),c=(0,Q.useRef)(0),l;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(l=function(){let e=c.current+=1;br().then(t=>{let{conflicts:n,error:i}=t;e===c.current&&(r(n),s(i??null),a(!1))})},e[1]=l):l=e[1];let u=l,d,f;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>{u()},f=[],e[2]=d,e[3]=f):(d=e[2],f=e[3]),(0,Q.useEffect)(d,f);let p,m;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>fe(e=>{e.includes(`sync-status`)&&u()}),m=[],e[4]=p,e[5]=m):(p=e[4],m=e[5]),(0,Q.useEffect)(p,m);let h;return e[6]!==n||e[7]!==o||e[8]!==i?(h={conflicts:n,loading:i,error:o},e[6]=n,e[7]=o,e[8]=i,e[9]=h):h=e[9],h}function Sr(e){if(!e)return``;let t=e.replace(/[/\\]+$/g,``),n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return n<0?t:t.slice(n+1)}function Cr(e){let t=e.trim();return t.length===0?{kind:`blank`,raw:e}:t.startsWith(`#`)?{kind:`comment`,raw:e}:{kind:`pattern`,raw:e,text:t}}function wr(e){return{lines:e.split(`
10
10
  `).map(Cr)}}function Tr(e){return e.lines.map(e=>e.raw).join(`
11
- `)}function Er(e){return e.lines.filter(e=>e.kind===`pattern`)}function Dr(e,t){let n=t.trim();if(n.length===0)return e;for(let t of e.lines)if(t.kind===`pattern`&&t.text===n)return e;let r={kind:`pattern`,raw:n,text:n},i=e.lines.slice(),a=i[i.length-1];return a&&a.kind===`blank`&&a.raw===``?i.splice(i.length-1,0,r):i.push(r,{kind:`blank`,raw:``}),{lines:i}}function Or(e,t){let n=t.trim();if(n.length===0)return-1;let r=0;for(let t of e.lines)if(t.kind===`pattern`){if(t.text===n)return r;r++}return-1}function kr(e,t,n){let r=n.trim();if(r.length===0)return Ar(e,t);let i=Mr(e,t);if(i<0)return e;let a=e.lines.slice();return a[i]={kind:`pattern`,raw:r,text:r},{lines:a}}function Ar(e,t){let n=Mr(e,t);if(n<0)return e;let r=e.lines.slice();return r.splice(n,1),{lines:r}}function jr(e,t,n){if(t===n)return e;let r=[],i=[];if(e.lines.forEach((e,t)=>{e.kind===`pattern`&&(r.push(t),i.push(e))}),t<0||t>=i.length||n<0||n>=i.length)return e;let a=i.slice(),[o]=a.splice(t,1);if(!o)return e;a.splice(n,0,o);let s=e.lines.slice();return r.forEach((e,t)=>{let n=a[t];n&&(s[e]=n)}),{lines:s}}function Mr(e,t){if(t<0)return-1;let n=0;for(let r=0;r<e.lines.length;r++)if(e.lines[r]?.kind===`pattern`){if(n===t)return r;n++}return-1}var Nr=`/api/share/construct-url`;function Pr(e){return{kind:`doc`,docName:e}}function Fr(e){return{kind:`folder`,folderRelativePath:e}}async function Ir(e,t=fetch){let n=await t(Nr,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!n.ok)throw Error(`construct-url transport ${n.status}`);let r=await n.json(),i=W.safeParse(r);if(!i.success)throw Error(`construct-url response shape mismatch`);return i.data}function Lr(e,t){switch(e){case`detached-head`:return J._({id:`jLOL1H`});case`branch-not-on-origin`:return t?J._({id:`x-fZxg`,values:{branch:t}}):J._({id:`ZGVsOD`});case`non-github-remote`:return J._({id:`V4JHny`});case`invalid-path`:return J._({id:`0pZmTP`});case`unsupported-share-url`:return J._({id:`uYZTcW`});case`no-remote`:return J._({id:`pA16WG`})}}async function Rr(e,t){if(!e.hasRemote)return e.onClickWhenNoRemote(),{kind:`opened-wizard`};let n=e.kind===`folder`?{kind:`folder`,folderPath:e.folderRelativePath}:{kind:`doc`,docPath:Re(e.docName)},r;try{r=await Ir(n,t.fetchFn)}catch{return t.toastError(J._({id:`u3YnKw`}),`transport`),{kind:`transport-error`}}if(r.ok){try{await t.clipboardWrite(r.shareUrl)}catch{return t.toastError(J._({id:`E_A2Nq`}),`clipboard`),t.logEvent(`[share] action=link-construct result=clipboard-failed`),{kind:`clipboard-failed`,shareUrl:r.shareUrl,freshness:r.freshness}}return t.toastSuccess(e.kind===`folder`?J._({id:`xcGVzH`}):J._({id:`c1LZZH`})),t.logEvent(`[share] action=link-construct`),{kind:`copied`,shareUrl:r.shareUrl,branch:r.branch,freshness:r.freshness}}if(r.error===`no-remote`)return e.onClickWhenNoRemote(),{kind:`opened-wizard`};let i=r.branch;return t.toastError(Lr(r.error,i),`business`),{kind:`business-error`,error:r.error,branch:i}}var zr=`/api/share/publish/owners`,Br=`/api/share/publish/name-check`,Vr=`/api/share/publish`,Hr=/[A-Za-z0-9._-]/g;function Ur(e){return(e.match(Hr)?.join(``)??``).replace(/[-.]{2,}/g,e=>e[0]??`-`).replace(/^[-.]+/,``).replace(/[-.]+$/,``)}function Wr(e){return e.find(e=>e.kind===`org`)?.login??e[0]?.login??``}function Gr(e){return`https://github.com/orgs/${encodeURIComponent(e)}/policies/applications`}function Kr(e,t,n){switch(e){case`name-conflict`:return{banner:J._({id:`n81AV0`,values:{owner:t,name:n}}),next:{kind:`edit-name`}};case`saml-sso`:return{banner:J._({id:`gLCE2c`,values:{owner:t}}),next:{kind:`authorize-org`,authorizeUrl:Gr(t)}};case`push-failed`:return{banner:J._({id:`7Y9yTo`,values:{owner:t,name:n}}),next:{kind:`retry-push`}};case`auth-required`:return{banner:J._({id:`UGtPix`}),next:{kind:`reauth`}};case`init-failed`:return{banner:J._({id:`kGp168`}),next:{kind:`edit-form`}};case`network`:return{banner:J._({id:`UVLlMV`}),next:{kind:`edit-form`}};case`no-project`:return{banner:J._({id:`S6eHlw`}),next:{kind:`edit-form`}}}}async function qr(e=fetch){let t=await e(zr,{method:`GET`});if(!t.ok)throw Error(`owners transport ${t.status}`);let n=await t.json(),r=ae.safeParse(n);if(!r.success)throw Error(`owners response shape mismatch`);return r.data}async function Jr(e,t,n=fetch){let r=await n(`${Br}?owner=${encodeURIComponent(e)}&name=${encodeURIComponent(t)}`,{method:`GET`});if(!r.ok)throw Error(`name-check transport ${r.status}`);let i=await r.json(),a=ie.safeParse(i);if(!a.success)throw Error(`name-check response shape mismatch`);return a.data}async function Yr(e,t=fetch){let n=await t(Vr,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!n.ok)throw Error(`publish transport ${n.status}`);let r=await n.json(),i=U.safeParse(r);if(!i.success)throw Error(`publish response shape mismatch`);return i.data}function Xr(e,t,n){return e.ok?e.available?{kind:`available`}:{kind:`taken`,owner:t,name:n}:e.error===`auth-required`?{kind:`error`,banner:J._({id:`UGtPix`})}:{kind:`error`,banner:J._({id:`UVLlMV`})}}function Zr(e){return e.submitting||e.owner===null||e.sanitizedName.length===0?!1:e.nameCheck.kind===`available`}var Qr=500;function $r(e){let t=(0,Z.c)(69),{open:n,onOpenChange:r}=e,{_:i}=u(),o=he(),{activeDocName:s}=a(),[c,d]=(0,Q.useState)(null),[f,h]=(0,Q.useState)(!1),[g,_]=(0,Q.useState)(null),[v,y]=(0,Q.useState)(``),[x,S]=(0,Q.useState)(``),[C,w]=(0,Q.useState)(`private`),[M,N]=(0,Q.useState)(``),P;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(P={kind:`idle`},t[0]=P):P=t[0];let[F,I]=(0,Q.useState)(P),[L,z]=(0,Q.useState)(!1),[ee,te]=(0,Q.useState)(null),[ne,B]=(0,Q.useState)(!1),[H,U]=(0,Q.useState)(null),[W,G]=(0,Q.useState)(!1),[K,ie]=(0,Q.useState)(null),[ae,oe]=(0,Q.useState)(null),se=(0,Q.useRef)(null),ce=(0,Q.useRef)(null),le=(0,Q.useRef)(null),ue;t[1]===x?ue=t[2]:(ue=Ur(x),t[1]=x,t[2]=ue);let J=ue,de=c?.find(e=>e.login===v)??null,fe;t[3]!==i||t[4]!==v?(fe=async function(){h(!0),_(null);try{let e=await qr();if(!e.ok){e.error===`auth-required`?(B(!0),_(i({id:`6cyguR`}))):_(i({id:`UVLlMV`})),h(!1);return}d(e.owners),e.owners.length>0&&v===``&&y(Wr(e.owners))}catch{_(i({id:`UVLlMV`}))}h(!1)},t[3]=i,t[4]=v,t[5]=fe):fe=t[5];let Y=fe,pe;t[6]!==Y||t[7]!==n||t[8]!==c||t[9]!==v||t[10]!==o?.contentDir?(pe=()=>{n&&(I({kind:`idle`}),te(null),z(!1),_(null),U(null),G(!1),ie(null),oe(null),S(Ur(Sr(o?.contentDir??``))),w(`private`),N(``),c===null?Y():v===``&&c.length>0&&y(Wr(c)))},t[6]=Y,t[7]=n,t[8]=c,t[9]=v,t[10]=o?.contentDir,t[11]=pe):pe=t[11];let me;t[12]===n?me=t[13]:(me=[n],t[12]=n,t[13]=me),(0,Q.useEffect)(pe,me);let X,ge;t[14]!==i||t[15]!==n||t[16]!==J||t[17]!==v?(X=()=>{if(n){if(se.current!==null&&clearTimeout(se.current),v===``||J===``){I({kind:`idle`});return}return I({kind:`pending`}),se.current=setTimeout(async()=>{let e=v,t=J;ce.current=`${e}|${t}`,I({kind:`checking`});try{let n=await Jr(e,t);if(ce.current!==`${e}|${t}`)return;I(Xr(n,e,t))}catch{if(ce.current!==`${e}|${t}`)return;I({kind:`error`,banner:i({id:`UVLlMV`})})}},Qr),()=>{se.current!==null&&(clearTimeout(se.current),se.current=null)}}},ge=[n,v,J,i],t[14]=i,t[15]=n,t[16]=J,t[17]=v,t[18]=X,t[19]=ge):(X=t[18],ge=t[19]),(0,Q.useEffect)(X,ge);let _e,ve;t[20]!==i||t[21]!==s||t[22]!==H?(_e=()=>{if(!H||!s)return;let e=!1;return(async()=>{try{let t=await Ir({kind:`doc`,docPath:Re(s)});if(e)return;t.ok?ie(t.shareUrl):oe(Lr(t.error,t.branch))}catch(t){let n=t;if(e)return;console.warn(`[share] action=prefetch-share-url result=failed`,n),oe(i({id:`J6N5MX`}))}})(),()=>{e=!0}},ve=[H,s,i],t[20]=i,t[21]=s,t[22]=H,t[23]=_e,t[24]=ve):(_e=t[23],ve=t[24]),(0,Q.useEffect)(_e,ve);let ye;t[25]===Y?ye=t[26]:(ye=function(){B(!1),_(null),Y()},t[25]=Y,t[26]=ye);let be=ye,xe=async function(){if(Zr({owner:de,sanitizedName:J,nameCheck:F,submitting:L})){z(!0),te(null);try{let e=await Yr({owner:v,name:J,visibility:C,description:M.trim().length>0?M.trim():void 0});if(e.ok){U({ownerLogin:e.ownerLogin,repoName:e.repoName}),z(!1);return}let t=Kr(e.error,v,J);te({message:t.banner,next:t.next}),t.next.kind===`edit-name`?(le.current?.focus(),le.current?.select()):t.next.kind===`reauth`&&B(!0)}catch{te({message:i({id:`UVLlMV`}),next:{kind:`edit-form`}})}z(!1)}},Se;t[27]!==i||t[28]!==W||t[29]!==r||t[30]!==K?(Se=function(){!K||W||(G(!0),p(K).then(()=>{q.success(i({id:`c1LZZH`})),r(!1)}).catch(e=>{if(console.warn(`[share] action=link-construct result=clipboard-failed`,e),m(e)&&window.self!==window.top){q.error(i({id:`Dub54T`}));return}q.error(i({id:`MQIM_Y`}))}).finally(()=>{G(!1)}))},t[27]=i,t[28]=W,t[29]=r,t[30]=K,t[31]=Se):Se=t[31];let Ce=Se,we;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(we=function(e){let t=window.okDesktop?.shell?.openExternal;t?t(e):window.open(e,`_blank`,`noopener`)},t[32]=we):we=t[32];let Te=we,Ee;t[33]===r?Ee=t[34]:(Ee=function(){r(!1)},t[33]=r,t[34]=Ee);let De=Ee,Oe=!Zr({owner:de,sanitizedName:J,nameCheck:F,submitting:L}),ke;t[35]!==i||t[36]!==s||t[37]!==ee||t[38]!==W||t[39]!==M||t[40]!==Te||t[41]!==De||t[42]!==Ce||t[43]!==xe||t[44]!==Y||t[45]!==x||t[46]!==F||t[47]!==c||t[48]!==g||t[49]!==f||t[50]!==H||t[51]!==J||t[52]!==v||t[53]!==K||t[54]!==ae||t[55]!==Oe||t[56]!==L||t[57]!==C?(ke=(0,$.jsx)(D,{className:`sm:max-w-lg`,showCloseButton:!1,children:H?(0,$.jsx)(ti,{ownerLogin:H.ownerLogin,repoName:H.repoName,shareUrl:K,shareUrlError:ae,copying:W,canCopy:s!==null,onCopy:Ce,onClose:De}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(A,{children:[(0,$.jsx)(E,{children:(0,$.jsx)(l,{id:`qXsafh`})}),(0,$.jsx)(T,{children:(0,$.jsx)(l,{id:`Z1LF1M`})})]}),(0,$.jsxs)(O,{className:`flex flex-col gap-6`,children:[(0,$.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(R,{id:`publish-owner-label`,children:(0,$.jsx)(l,{id:`LtI9AS`})}),f&&c===null?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,$.jsx)(je,{className:`size-3.5`,"aria-hidden":!0}),` `,(0,$.jsx)(l,{id:`Z3FXyt`})]}):g?(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsx)(`span`,{className:`text-sm text-destructive`,children:g}),(0,$.jsx)(b,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>Y(),children:(0,$.jsx)(l,{id:`6gRgw8`})})]}):(0,$.jsx)(V,{value:v,onValueChange:y,"aria-labelledby":`publish-owner-label`,"data-testid":`publish-owner-radio`,children:(c??[]).map(ei)})]}),(0,$.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(R,{htmlFor:`publish-name`,children:(0,$.jsx)(l,{id:`0xnmlQ`})}),(0,$.jsx)(Ye,{id:`publish-name`,ref:le,"data-testid":`publish-name`,value:x,onChange:e=>S(e.target.value),onBlur:()=>{ce.current=null},placeholder:`my-knowledge-base`,autoComplete:`off`,spellCheck:!1}),(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-1sm`,"aria-live":`polite`,children:[(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:J?(0,$.jsx)(l,{id:`Nn4GgW`,values:{sanitizedName:J},components:{0:(0,$.jsx)(`code`,{className:`font-mono`})}}):(0,$.jsx)(l,{id:`Oxyd5f`})}),(0,$.jsx)(oi,{status:F})]})]}),(0,$.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(R,{id:`publish-visibility-label`,children:(0,$.jsx)(l,{id:`2q_Q7x`})}),(0,$.jsxs)(V,{value:C,onValueChange:e=>w(e===`public`?`public`:`private`),className:`sm:flex`,"aria-labelledby":`publish-visibility-label`,children:[(0,$.jsx)(at,{htmlFor:`publish-visibility-private`,children:(0,$.jsxs)(ct,{orientation:`horizontal`,children:[(0,$.jsxs)(it,{children:[(0,$.jsx)(st,{children:(0,$.jsx)(l,{id:`zwBp5t`})}),(0,$.jsx)(ot,{className:`text-1sm`,children:(0,$.jsx)(l,{id:`D8OV7J`})})]}),(0,$.jsx)(re,{value:`private`,id:`publish-visibility-private`,"data-testid":`publish-visibility-private`})]})}),(0,$.jsx)(at,{htmlFor:`publish-visibility-public`,children:(0,$.jsxs)(ct,{orientation:`horizontal`,children:[(0,$.jsxs)(it,{children:[(0,$.jsx)(st,{children:(0,$.jsx)(l,{id:`7d1a0d`})}),(0,$.jsx)(ot,{className:`text-1sm`,children:(0,$.jsx)(l,{id:`4jDd0j`})})]}),(0,$.jsx)(re,{value:`public`,id:`publish-visibility-public`,"data-testid":`publish-visibility-public`})]})})]})]}),(0,$.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(R,{htmlFor:`publish-description`,children:(0,$.jsx)(l,{id:`Fxf4jq`})}),(0,$.jsx)(ut,{id:`publish-description`,"data-testid":`publish-description`,rows:2,value:M,onChange:e=>N(e.target.value),placeholder:i({id:`c5rF4v`})})]}),ee&&(0,$.jsx)(ai,{banner:ee,onAuthorize:Te,onRetryPush:xe})]}),(0,$.jsxs)(k,{children:[(0,$.jsx)(b,{type:`button`,variant:`outline`,className:`font-mono uppercase`,onClick:De,children:(0,$.jsx)(l,{id:`dEgA5A`})}),(0,$.jsx)(b,{type:`button`,onClick:xe,disabled:Oe,"data-testid":`publish-submit`,children:L?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(je,{className:`size-3.5`,"aria-hidden":!0}),` `,(0,$.jsx)(l,{id:`Bdha5y`})]}):(0,$.jsx)(l,{id:`EEYbdt`})})]})]})}),t[35]=i,t[36]=s,t[37]=ee,t[38]=W,t[39]=M,t[40]=Te,t[41]=De,t[42]=Ce,t[43]=xe,t[44]=Y,t[45]=x,t[46]=F,t[47]=c,t[48]=g,t[49]=f,t[50]=H,t[51]=J,t[52]=v,t[53]=K,t[54]=ae,t[55]=Oe,t[56]=L,t[57]=C,t[58]=ke):ke=t[58];let Ae;t[59]!==r||t[60]!==n||t[61]!==ke?(Ae=(0,$.jsx)(j,{open:n,onOpenChange:r,children:ke}),t[59]=r,t[60]=n,t[61]=ke,t[62]=Ae):Ae=t[62];let Me;t[63]!==ne||t[64]!==be?(Me=(0,$.jsx)(tn,{open:ne,onOpenChange:B,onSuccess:be}),t[63]=ne,t[64]=be,t[65]=Me):Me=t[65];let Ne;return t[66]!==Ae||t[67]!==Me?(Ne=(0,$.jsxs)($.Fragment,{children:[Ae,Me]}),t[66]=Ae,t[67]=Me,t[68]=Ne):Ne=t[68],Ne}function ei(e){let t=`publish-owner-${e.login}`;return(0,$.jsx)(at,{htmlFor:t,children:(0,$.jsxs)(ct,{orientation:`horizontal`,children:[(0,$.jsx)(it,{children:(0,$.jsxs)(st,{children:[e.avatarUrl?(0,$.jsx)(`img`,{src:e.avatarUrl,alt:``,"aria-hidden":!0,className:`size-4 rounded-full`}):null,(0,$.jsx)(`span`,{children:e.login})]})}),(0,$.jsx)(re,{value:e.login,id:t,"data-testid":`publish-owner-option-${e.login}`})]})},e.login)}function ti(e){let t=(0,Z.c)(36),{ownerLogin:r,repoName:i,shareUrl:a,shareUrlError:o,copying:s,canCopy:c,onCopy:d,onClose:f}=e,{_:p}=u(),m=(0,Q.useRef)(null),h,g;t[0]===a?(h=t[1],g=t[2]):(h=()=>{!a||!m.current||(m.current.focus(),m.current.select())},g=[a],t[0]=a,t[1]=h,t[2]=g),(0,Q.useEffect)(h,g);let _;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(E,{children:(0,$.jsx)(l,{id:`u3wRF-`})}),t[3]=_):_=t[3];let v;t[4]!==r||t[5]!==i?(v={ownerLogin:r,repoName:i},t[4]=r,t[5]=i,t[6]=v):v=t[6];let y;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(y={0:(0,$.jsx)(`code`,{className:`font-mono`})},t[7]=y):y=t[7];let x;t[8]===v?x=t[9]:(x=(0,$.jsxs)(A,{children:[_,(0,$.jsx)(T,{children:(0,$.jsx)(l,{id:`r871ed`,values:v,components:y})})]}),t[8]=v,t[9]=x);let S;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(Te,{className:`mt-0.5 size-4 text-emerald-600`,"aria-hidden":!0}),t[10]=S):S=t[10];let C;t[11]===c?C=t[12]:(C=(0,$.jsxs)(`div`,{role:`status`,"data-testid":`publish-success`,className:`flex items-start gap-3 rounded-md border border-emerald-500/40 bg-emerald-500/5 p-3 text-sm`,children:[S,(0,$.jsx)(`span`,{className:`text-foreground`,children:c?(0,$.jsx)(l,{id:`cOrTMo`}):(0,$.jsx)(l,{id:`nTwL53`})})]}),t[11]=c,t[12]=C);let w;t[13]!==c||t[14]!==a||t[15]!==o?(w=c&&(0,$.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(R,{htmlFor:`publish-share-url`,children:(0,$.jsx)(l,{id:`5-FeN2`})}),o?(0,$.jsx)(`div`,{role:`alert`,"data-testid":`publish-share-url-error`,className:`rounded-md border border-destructive/50 bg-destructive/5 p-2 text-sm text-destructive`,children:o}):a?(0,$.jsx)(Ye,{id:`publish-share-url`,ref:m,"data-testid":`publish-share-url`,readOnly:!0,value:a,onFocus:ii,onClick:ri,onContextMenu:ni,className:`font-mono text-xs`}):(0,$.jsxs)(`div`,{"data-testid":`publish-share-url-loading`,className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,$.jsx)(je,{className:`size-3.5`,"aria-hidden":!0}),` `,(0,$.jsx)(l,{id:`M9597s`})]})]}),t[13]=c,t[14]=a,t[15]=o,t[16]=w):w=t[16];let D;t[17]!==C||t[18]!==w?(D=(0,$.jsxs)(O,{className:`flex flex-col gap-4`,children:[C,w]}),t[17]=C,t[18]=w,t[19]=D):D=t[19];let j;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,$.jsx)(l,{id:`DPfwMq`}),t[20]=j):j=t[20];let M;t[21]===f?M=t[22]:(M=(0,$.jsx)(b,{type:`button`,variant:`outline`,className:`font-mono uppercase`,onClick:f,"data-testid":`publish-success-done`,children:j}),t[21]=f,t[22]=M);let N;t[23]!==p||t[24]!==c||t[25]!==s||t[26]!==d||t[27]!==a?(N=c&&(0,$.jsx)(b,{type:`button`,onClick:d,disabled:s||!a,"data-testid":`publish-copy-link`,"aria-label":p({id:`RGCCrg`}),children:s?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(je,{className:`size-3.5`,"aria-hidden":!0}),` `,(0,$.jsx)(l,{id:`OvEjsP`})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(n,{className:`size-3.5`,"aria-hidden":!0}),` `,(0,$.jsx)(l,{id:`RGCCrg`})]})}),t[23]=p,t[24]=c,t[25]=s,t[26]=d,t[27]=a,t[28]=N):N=t[28];let P;t[29]!==M||t[30]!==N?(P=(0,$.jsxs)(k,{children:[M,N]}),t[29]=M,t[30]=N,t[31]=P):P=t[31];let F;return t[32]!==D||t[33]!==P||t[34]!==x?(F=(0,$.jsxs)($.Fragment,{children:[x,D,P]}),t[32]=D,t[33]=P,t[34]=x,t[35]=F):F=t[35],F}function ni(e){return e.currentTarget.select()}function ri(e){return e.currentTarget.select()}function ii(e){return e.currentTarget.select()}function ai(e){let t=(0,Z.c)(13),{banner:n,onAuthorize:r,onRetryPush:a}=e,o=n.next,s;t[0]===n.message?s=t[1]:(s=(0,$.jsx)(`span`,{children:n.message}),t[0]=n.message,t[1]=s);let c;t[2]!==o.authorizeUrl||t[3]!==o.kind||t[4]!==r?(c=o.kind===`authorize-org`&&(0,$.jsxs)(b,{type:`button`,variant:`outline`,size:`sm`,className:`self-start`,"data-testid":`publish-authorize-org`,onClick:()=>r(o.authorizeUrl),children:[(0,$.jsx)(l,{id:`FyW0WO`}),` `,(0,$.jsx)(i,{className:`ml-1 size-3`,"aria-hidden":!0})]}),t[2]=o.authorizeUrl,t[3]=o.kind,t[4]=r,t[5]=c):c=t[5];let u;t[6]!==o.kind||t[7]!==a?(u=o.kind===`retry-push`&&(0,$.jsx)(b,{type:`button`,variant:`outline`,size:`sm`,className:`self-start`,"data-testid":`publish-retry-push`,onClick:a,children:(0,$.jsx)(l,{id:`NOHyEE`})}),t[6]=o.kind,t[7]=a,t[8]=u):u=t[8];let d;return t[9]!==s||t[10]!==c||t[11]!==u?(d=(0,$.jsxs)(`div`,{role:`alert`,"data-testid":`publish-banner`,className:`flex flex-col gap-2 rounded-md border border-destructive/50 bg-destructive/5 p-3 text-sm`,children:[s,c,u]}),t[9]=s,t[10]=c,t[11]=u,t[12]=d):d=t[12],d}function oi(e){let t=(0,Z.c)(12),{status:n}=e;if(n.kind===`available`){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Te,{className:`size-3.5`,"aria-hidden":!0}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsxs)(`span`,{"data-testid":`publish-name-check`,"data-status":`available`,className:`flex items-center gap-1 text-emerald-600 dark:text-emerald-400`,children:[e,` `,(0,$.jsx)(l,{id:`csDS2L`})]}),t[1]=n):n=t[1],n}if(n.kind===`taken`){let{owner:e,name:i}=n,a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(r,{className:`size-3.5`,"aria-hidden":!0}),t[2]=a):a=t[2];let o;return t[3]!==i||t[4]!==e?(o=(0,$.jsxs)(`span`,{"data-testid":`publish-name-check`,"data-status":`taken`,className:`flex items-center gap-1 text-destructive`,children:[a,` `,(0,$.jsx)(l,{id:`LRgZAt`,values:{owner:e,name:i}})]}),t[3]=i,t[4]=e,t[5]=o):o=t[5],o}if(n.kind===`checking`||n.kind===`pending`){let e;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(je,{className:`size-3.5`,"aria-hidden":!0}),t[6]=e):e=t[6];let r;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(l,{id:`pWT04I`}),t[7]=r):r=t[7];let i;return t[8]===n.kind?i=t[9]:(i=(0,$.jsxs)(`span`,{"data-testid":`publish-name-check`,"data-status":n.kind,className:`flex items-center gap-1 text-muted-foreground`,children:[e,` `,r]}),t[8]=n.kind,t[9]=i),i}if(n.kind===`error`){let e;return t[10]===n.banner?e=t[11]:(e=(0,$.jsx)(`span`,{"data-testid":`publish-name-check`,"data-status":`error`,className:`text-destructive`,children:n.banner}),t[10]=n.banner,t[11]=e),e}return null}var si=5e3,ci=3e4,li=0;function ui(){let e=Date.now();e-li<ci||(li=e,_e(`fetch`).catch(()=>{li===e&&(li=0)}))}async function di(){try{let e=await fetch(`/api/git/worktree-status`);return e.ok?await e.json():null}catch{return null}}function fi(e){let t=(0,Z.c)(6),[n,r]=(0,Q.useState)(null),i,a;t[0]===e?(i=t[1],a=t[2]):(i=()=>{if(!e)return;let t=!1,n=!1,i=!1;function a(){if(n){i=!0;return}n=!0,di().then(e=>{n=!1,!t&&e&&e.readable!==!1&&r(e),i&&!t&&(i=!1,a())})}a(),ui();let o=setInterval(a,si),s=fe(e=>{e.includes(`sync-status`)&&a()});return()=>{t=!0,clearInterval(o),s()}},a=[e],t[0]=e,t[1]=i,t[2]=a),(0,Q.useEffect)(i,a);let o=e&&n===null,s;return t[3]!==n||t[4]!==o?(s={status:n,loading:o},t[3]=n,t[4]=o,t[5]=s):s=t[5],s}async function pi(e){let t=await fetch(`/api/sync/resolve-blocking`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:e})});if(!t.ok)throw Error(`sync resolve-blocking failed: ${t.status}`)}function mi(){return typeof window<`u`&&window.okDesktop!=null}function hi(e){let t=(0,Z.c)(23),{paths:n}=e,[r,i]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(!1);if(n.length===0)return null;let s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=async function(e){i(e),o(!1);try{await pi(e),i(null)}catch{o(!0),i(null)}},t[0]=s):s=t[0];let c=s,u=r!==null,d;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(`span`,{id:`sync-blocking-heading`,className:`text-xs font-medium text-foreground`,children:(0,$.jsx)(l,{id:`sdvHp3`})}),t[1]=d):d=t[1];let f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[d,(0,$.jsx)(`span`,{className:`text-2xs text-muted-foreground`,children:(0,$.jsx)(l,{id:`H4doZt`})})]}),t[2]=f):f=t[2];let p;t[3]===n?p=t[4]:(p=n.map(_i),t[3]=n,t[4]=p);let m;t[5]===p?m=t[6]:(m=(0,$.jsx)(`ul`,{"aria-labelledby":`sync-blocking-heading`,className:`flex max-h-28 flex-col gap-1 overflow-y-auto overscroll-contain`,"data-testid":`sync-blocking-list`,children:p}),t[5]=p,t[6]=m);let h;t[7]===a?h=t[8]:(h=a&&(0,$.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,"data-testid":`sync-blocking-error`,children:(0,$.jsx)(l,{id:`FsEXax`})}),t[7]=a,t[8]=h);let g;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>void c(`commit`),t[9]=g):g=t[9];let _;t[10]===r?_=t[11]:(_=r===`commit`&&(0,$.jsx)(je,{"aria-hidden":`true`,"data-icon":`inline-start`}),t[10]=r,t[11]=_);let v;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(l,{id:`N7Lau6`}),t[12]=v):v=t[12];let y;t[13]!==u||t[14]!==_?(y=(0,$.jsxs)(b,{size:`xs`,disabled:u,onClick:g,"data-testid":`sync-blocking-commit`,children:[_,v]}),t[13]=u,t[14]=_,t[15]=y):y=t[15];let x;t[16]===u?x=t[17]:(x=mi()&&(0,$.jsxs)(b,{variant:`link-muted`,size:`xs`,className:`self-start p-0`,disabled:u,onClick:gi,"data-testid":`sync-blocking-terminal`,children:[(0,$.jsx)(De,{"data-icon":`inline-start`}),(0,$.jsx)(l,{id:`6EoD0z`})]}),t[16]=u,t[17]=x);let S;return t[18]!==y||t[19]!==x||t[20]!==m||t[21]!==h?(S=(0,$.jsxs)(`div`,{className:`flex flex-col gap-2 border-t pt-3`,children:[f,m,h,y,x]}),t[18]=y,t[19]=x,t[20]=m,t[21]=h,t[22]=S):S=t[22],S}function gi(){return dt(`git-status`)}function _i(e){return(0,$.jsx)(`li`,{title:e,className:`min-w-0 truncate font-mono text-2xs text-foreground`,children:e},e)}function vi(e=`sync`,t){_e(e).catch(e=>{console.warn(`[sync-badge] manual sync trigger failed`,e instanceof Error?e.message:e),t?.()})}function yi(e){typeof window>`u`||Be(window.location.hash,e)||(window.location.hash=e)}function bi(e){return e.kind===`doc`?Le(e.docName):Ie(e.path)}function xi(e){let t=Date.now()-new Date(e).getTime();if(t<6e4)return J._({id:`xOTzt5`});if(t<36e5){let e=Math.floor(t/6e4);return J._({id:`_rP3HI`,values:{minutes:e}})}if(t<864e5){let e=Math.floor(t/36e5);return J._({id:`nYeBmY`,values:{hours:e}})}return new Date(e).toLocaleDateString()}function Si(e){return e.syncMode===`follow`}function Ci(e){return e.state===`idle`&&e.conflictCount>0?`conflict`:e.state}function wi(e){let t=(0,Z.c)(12),{status:n}=e;switch(Ci(n)){case`dormant`:{let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(mt,{className:`size-3.5 text-muted-foreground`}),t[0]=e):e=t[0],e}case`idle`:{if(n.ahead>0||n.behind>0){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Me,{className:`size-3.5 text-muted-foreground`}),t[1]=e):e=t[1],e}let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(mt,{className:`size-3.5 text-muted-foreground`}),t[2]=e):e=t[2],e}case`fetching`:case`pulling`:case`pushing`:{let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(je,{"aria-hidden":`true`,icon:Me,className:`size-3.5 text-muted-foreground`}),t[3]=e):e=t[3],e}case`conflict`:{let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Pe,{className:`size-3.5 text-amber-500`}),t[4]=e):e=t[4],e}case`offline`:{let e;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(pt,{className:`size-3.5 text-muted-foreground`}),t[5]=e):e=t[5],e}case`auth-error`:{let e;return t[6]===n?e=t[7]:(e=ji(n)?(0,$.jsx)(ft,{className:`size-3.5 text-destructive`}):(0,$.jsx)(ht,{className:`size-3.5 text-destructive`}),t[6]=n,t[7]=e),e}case`disabled`:{if(n.pausedReason){let e;return t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Pe,{className:`size-3.5 text-amber-500`}),t[8]=e):e=t[8],e}if(n.ahead>0||n.behind>0){let e;return t[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Me,{className:`size-3.5 text-muted-foreground`}),t[9]=e):e=t[9],e}let e;return t[10]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(mt,{className:`size-3.5 text-muted-foreground`}),t[10]=e):e=t[10],e}default:{let e;return t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(mt,{className:`size-3.5 text-muted-foreground`}),t[11]=e):e=t[11],e}}}function Ti(e){switch(Ci(e)){case`idle`:return!Si(e)&&e.ahead>0?`↑${e.ahead}`:e.behind>0?`↓${e.behind}`:``;case`fetching`:case`pulling`:case`pushing`:return``;case`conflict`:return e.conflictCount>0?`${e.conflictCount}`:``;case`offline`:return``;case`auth-error`:return``;default:return``}}function Ei(e){let t=Si(e),n=Ci(e);switch(n){case`dormant`:return J._({id:`RmBY0A`});case`idle`:return t?J._({id:`j5CWO4`}):J._({id:`N2FcBE`});case`fetching`:return t?J._({id:`7IsvrP`}):J._({id:`Wgmlsw`});case`pulling`:return t?J._({id:`JL3si7`}):J._({id:`4uNLmk`});case`pushing`:return J._({id:`iycx_A`});case`conflict`:return J._({id:`IInnZo`});case`offline`:return J._({id:`6Aih4U`});case`auth-error`:return J._({id:`mHVPm5`});case`disabled`:return e.pausedReason?J._({id:`U6wmNc`}):J._({id:`BWTzAb`});default:return n}}function Di(e){switch(e){case`external-changes-pending`:return J._({id:`W9_Bub`});case`dirty-tree`:return J._({id:`a5Gha5`});case`non-content-merge-failure`:return J._({id:`sIxSSP`});case`detached-head`:return J._({id:`uQNW00`});case`diverged-local-commits`:return J._({id:`LQsCPn`});case`auth-error`:return J._({id:`mHVPm5`});case`protected-branch`:return J._({id:`8fc_3j`});case`no-push-permission`:return J._({id:`EiVgl5`});default:return e}}function Oi(e,t){let n=[];switch(e){case`not-authenticated`:n.push(J._({id:`ycIX5i`}));break;case`no-collaborator`:n.push(J._({id:`EiVgl5`}));break;case`private-no-access`:n.push(J._({id:`07gHun`}));break;case`repo-not-found`:n.push(J._({id:`uksqrP`}));break;default:n.push(J._({id:`EiVgl5`}))}return n.push(...ki(t)),n}function ki(e){let t=[];if(e?.resolvedLogin){let n=e.resolvedLogin;t.push(J._({id:`ZKVuLY`,values:{login:n}}))}return e?.declaredLogin&&t.push(Ai(e.declaredLogin,e.declaredSource)),t}function Ai(e,t){switch(t){case`remote-url`:return J._({id:`CMd-g-`,values:{declaredLogin:e}});case`credential-config`:return J._({id:`akOe4q`,values:{declaredLogin:e}});default:return J._({id:`GBEqoP`,values:{declaredLogin:e}})}}function ji(e){return e.pushErrorCode===`auth-not-found-as-identity`||e.pullErrorCode===`auth-not-found-as-identity`}function Mi(e){return e?.pausedReason===`auth-error`&&ji(e)}function Ni(e){return e?.checkStatus===`denied`&&e.deniedReason===`not-authenticated`}function Pi(e){switch(e){case`auth-403`:return J._({id:`EiVgl5`});case`auth-401`:return J._({id:`-Qw-1t`});case`auth-scope-mismatch`:return J._({id:`Zue_jx`});case`auth-no-credential`:return J._({id:`uCaIdy`});case`semantic-protected-branch`:return J._({id:`T0OVm7`});case`auth-not-found-as-identity`:return J._({id:`jRsjlF`});default:return J._({id:`1AumWo`})}}function Fi(e){switch(e){case`auth-403`:return J._({id:`RgbKEe`});case`auth-401`:return J._({id:`-Qw-1t`});case`auth-scope-mismatch`:return J._({id:`Zue_jx`});case`auth-no-credential`:return J._({id:`uCaIdy`});case`auth-not-found-as-identity`:return J._({id:`jRsjlF`});default:return J._({id:`jZ_E5M`})}}function Ii(e){switch(e){case`auth-403`:return J._({id:`RgbKEe`});case`auth-401`:return J._({id:`-Qw-1t`});case`auth-scope-mismatch`:return J._({id:`Zue_jx`});case`auth-no-credential`:return J._({id:`uCaIdy`});case`semantic-protected-branch`:return J._({id:`T0OVm7`});case`auth-not-found-as-identity`:return J._({id:`jRsjlF`});default:return J._({id:`cUk6TF`})}}function Li(e){let t=e.pushErrorCode!=null||e.pushError!=null,n=e.pullErrorCode!=null||e.pullError!=null;if(t&&n&&(e.pushErrorCode==null?e.pullErrorCode==null&&e.pushError===e.pullError:e.pushErrorCode===e.pullErrorCode))return[{key:`sync`,direction:null,message:e.pushErrorCode==null?e.pushError:Ii(e.pushErrorCode)}];let r=t&&n,i=[];return t&&i.push({key:`push`,direction:r?`push`:null,message:e.pushErrorCode?Pi(e.pushErrorCode):e.pushError}),n&&i.push({key:`pull`,direction:r?`pull`:null,message:e.pullErrorCode?Fi(e.pullErrorCode):e.pullError}),i}function Ri(e){return e?.checkStatus===`unknown`&&e.unknownError===`token-invalid`}function zi(e){return Ci(e)===`auth-error`&&ji(e)?J._({id:`EkEFE3`}):Ei(e)}function Bi(e){let t=Si(e),n=Ci(e);if(n===`conflict`&&e.conflictCount>0){let{conflictCount:t}=e;return J._({id:`cUK8lW`,values:{conflictCount:t}})}if(n===`idle`){let{ahead:n,behind:r}=e;return t?r>0?J._({id:`9o1bIV`,values:{behind:r}}):J._({id:`j5CWO4`}):n>0&&r>0?J._({id:`5F5HYj`,values:{ahead:n,behind:r}}):n>0?J._({id:`PdA9NZ`,values:{ahead:n}}):r>0?J._({id:`9o1bIV`,values:{behind:r}}):J._({id:`N2FcBE`})}return zi(e)}function Vi(e){let t=(0,Z.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,$.jsx)(`span`,{className:`font-mono uppercase tracking-wide text-2xs text-muted-foreground`,children:n}),t[0]=n,t[1]=r),r}function Hi(e){switch(e){case`M`:return J._({id:`tgWuMB`});case`A`:return J._({id:`hp8OtS`});case`D`:return J._({id:`vGjmyl`});case`R`:return J._({id:`QeREu8`});case`C`:return J._({id:`6V3Ea3`});case`U`:return J._({id:`cyoNqf`});case`T`:return J._({id:`zWZBPx`});case`?`:return J._({id:`C2abof`});case`!`:return J._({id:`xDKOFk`});default:return J._({id:`cNsIJf`})}}function Ui(e){switch(e){case`D`:return`destructive`;case`U`:return`warning`;default:return`gray`}}function Wi(e){let t=(0,Z.c)(24),{entry:n,dimmed:r}=e,i;t[0]===n.code?i=t[1]:(i=Hi(n.code),t[0]=n.code,t[1]=i);let a=i,o=n.open,s=`truncate font-mono text-2xs ${r?`text-muted-foreground/60`:`text-foreground`}`,c;t[2]===n.code?c=t[3]:(c=Ui(n.code),t[2]=n.code,t[3]=c);let l;t[4]===n.code?l=t[5]:(l=(0,$.jsx)(`span`,{"aria-hidden":!0,children:n.code}),t[4]=n.code,t[5]=l);let u;t[6]===a?u=t[7]:(u=(0,$.jsx)(`span`,{className:`sr-only`,children:a}),t[6]=a,t[7]=u);let d;t[8]!==c||t[9]!==l||t[10]!==u?(d=(0,$.jsx)(S,{asChild:!0,children:(0,$.jsxs)(tt,{variant:c,className:`size-4 shrink-0 justify-center p-0 text-2xs leading-none`,children:[l,u]})}),t[8]=c,t[9]=l,t[10]=u,t[11]=d):d=t[11];let f;t[12]===a?f=t[13]:(f=(0,$.jsx)(C,{children:a}),t[12]=a,t[13]=f);let p;t[14]!==d||t[15]!==f?(p=(0,$.jsxs)(w,{children:[d,f]}),t[14]=d,t[15]=f,t[16]=p):p=t[16];let m;t[17]!==n.path||t[18]!==o||t[19]!==s?(m=o?(0,$.jsx)(Qe,{asChild:!0,children:(0,$.jsx)(b,{variant:`link`,size:`xs`,className:`h-auto min-h-6 min-w-0 shrink justify-start overflow-hidden p-0 font-normal`,onClick:()=>yi(bi(o)),"data-testid":`worktree-row-open`,children:(0,$.jsx)(`span`,{title:n.path,className:`min-w-0 ${s}`,children:n.path})})}):(0,$.jsx)(`span`,{title:n.path,className:s,children:n.path}),t[17]=n.path,t[18]=o,t[19]=s,t[20]=m):m=t[20];let h;return t[21]!==p||t[22]!==m?(h=(0,$.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2`,children:[p,m]}),t[21]=p,t[22]=m,t[23]=h):h=t[23],h}function Gi(e){let t=(0,Z.c)(15),{title:n,note:r,entries:i,dimmed:a}=e,o=a===void 0?!1:a;if(i.length===0)return null;let s;t[0]===n?s=t[1]:(s=(0,$.jsx)(`span`,{className:`text-2xs font-medium text-muted-foreground`,children:n}),t[0]=n,t[1]=s);let c;t[2]===r?c=t[3]:(c=r&&(0,$.jsx)(`span`,{className:`text-2xs text-muted-foreground/80`,children:r}),t[2]=r,t[3]=c);let l;if(t[4]!==o||t[5]!==i){let e;t[7]===o?e=t[8]:(e=e=>(0,$.jsx)(Wi,{entry:e,dimmed:o},`${e.code}:${e.path}`),t[7]=o,t[8]=e),l=i.map(e),t[4]=o,t[5]=i,t[6]=l}else l=t[6];let u;t[9]===l?u=t[10]:(u=(0,$.jsx)(`ul`,{className:`flex flex-col gap-1`,children:l}),t[9]=l,t[10]=u);let d;return t[11]!==s||t[12]!==c||t[13]!==u?(d=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[s,c,u]}),t[11]=s,t[12]=c,t[13]=u,t[14]=d):d=t[14],d}function Ki(e){let t=(0,Z.c)(9),{direction:n,count:r}=e,{_:i}=u();if(r<=0)return null;let a;t[0]===n?a=t[1]:(a=n===`behind`?(0,$.jsx)(Se,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":!0}):(0,$.jsx)(xe,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":!0}),t[0]=n,t[1]=a);let o;t[2]!==i||t[3]!==r||t[4]!==n?(o=i(n===`behind`?{id:`sKHiNR`,values:{count:r}}:{id:`9ZxzfT`,values:{count:r}}),t[2]=i,t[3]=r,t[4]=n,t[5]=o):o=t[5];let s;return t[6]!==a||t[7]!==o?(s=(0,$.jsxs)(`span`,{className:`flex flex-1 items-center gap-1.5 rounded-md bg-muted px-2 py-1 text-xs text-foreground`,children:[a,o]}),t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function qi(e){let t=new Set,n=[],r=[];for(let i of[...e.staged,...e.notStaged,...e.untracked])t.has(i.path)||(t.add(i.path),(i.syncScoped?n:r).push(i));return{willPush:n,wontPush:r}}function Ji(e){let t=(0,Z.c)(24),{status:n,worktree:r,loading:i}=e,a;t[0]===r?a=t[1]:(a=r?qi(r):{willPush:[],wontPush:[]},t[0]=r,t[1]=a);let{willPush:o,wontPush:s}=a,c;t[2]===r?.incoming?c=t[3]:(c=r?.incoming??[],t[2]=r?.incoming,t[3]=c);let u=c,d=r!==null&&r.readable===!1,f=r!==null&&o.length===0&&s.length===0&&u.length===0,p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(Vi,{children:(0,$.jsx)(l,{id:`uAQUqI`})}),t[4]=p):p=t[4];let m;t[5]===r?m=t[6]:(m=r&&(r.branch||r.detached)&&(0,$.jsx)(`span`,{className:`min-w-0 truncate font-mono text-2xs text-muted-foreground`,children:r.detached?(0,$.jsx)(l,{id:`OBdkpo`}):r.upstream?`${r.branch} → ${r.upstream}`:r.branch}),t[5]=r,t[6]=m);let h;t[7]===m?h=t[8]:(h=(0,$.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[p,m]}),t[7]=m,t[8]=h);let g;t[9]!==n.ahead||t[10]!==n.behind?(g=(n.behind>0||n.ahead>0)&&(0,$.jsxs)(`div`,{className:`flex items-stretch gap-2`,children:[(0,$.jsx)(Ki,{direction:`behind`,count:n.behind}),(0,$.jsx)(Ki,{direction:`ahead`,count:n.ahead})]}),t[9]=n.ahead,t[10]=n.behind,t[11]=g):g=t[11];let _;t[12]!==f||t[13]!==u||t[14]!==i||t[15]!==d||t[16]!==o||t[17]!==s||t[18]!==r?(_=i?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,$.jsx)(l,{id:`eolhcI`})}):d?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`worktree-unreadable`,children:(0,$.jsx)(l,{id:`L9ox9k`})}):f?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,$.jsx)(l,{id:`WfcERq`})}):r&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[(0,$.jsx)(Gi,{title:(0,$.jsx)(l,{id:`NcwbBM`}),entries:u}),(0,$.jsx)(Gi,{title:(0,$.jsx)(l,{id:`JOhCT9`}),entries:o}),(0,$.jsx)(Gi,{title:(0,$.jsx)(l,{id:`vsFXfP`}),note:(0,$.jsx)(l,{id:`PxZCNM`}),entries:s,dimmed:!0}),r.truncated&&(0,$.jsx)(`p`,{className:`text-2xs text-muted-foreground`,children:(0,$.jsx)(l,{id:`KvwJv8`})})]}),t[12]=f,t[13]=u,t[14]=i,t[15]=d,t[16]=o,t[17]=s,t[18]=r,t[19]=_):_=t[19];let v;return t[20]!==h||t[21]!==g||t[22]!==_?(v=(0,$.jsxs)(`div`,{className:`flex flex-col gap-2.5 border-t pt-3`,children:[h,g,_]}),t[20]=h,t[21]=g,t[22]=_,t[23]=v):v=t[23],v}function Yi(e){let t=(0,Z.c)(19),{pulledAt:n,pushedAt:r,combinedAt:i}=e,{_:a}=u(),o,s,c;if(t[0]!==a||t[1]!==i||t[2]!==n||t[3]!==r){o=n===null?null:xi(n),s=r===null?null:xi(r);let e=i===null?null:xi(i);c=o!==null&&s!==null?a({id:`1TA-aJ`,values:{pulled:o,pushed:s}}):o===null?s===null?e===null?null:a({id:`irnKr_`,values:{updatedRelative:e}}):a({id:`lPkjpD`,values:{pushed:s}}):a({id:`xW5AUw`,values:{pulled:o}}),t[0]=a,t[1]=i,t[2]=n,t[3]=r,t[4]=o,t[5]=s,t[6]=c}else o=t[4],s=t[5],c=t[6];let l=c,d=o!==null||s!==null;if(l===null){let e;return t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`span`,{}),t[7]=e):e=t[7],e}let f;t[8]!==l||t[9]!==d?(f=d&&(0,$.jsx)(`span`,{className:`sr-only`,"data-testid":`sync-popover-last-sync-label`,children:l}),t[8]=l,t[9]=d,t[10]=f):f=t[10];let p;t[11]!==l||t[12]!==o||t[13]!==s||t[14]!==d?(p=d?(0,$.jsxs)(`span`,{"aria-hidden":`true`,className:`inline-flex items-center gap-1`,children:[o!==null&&(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,$.jsx)(Se,{className:`size-3`}),o]}),o!==null&&s!==null&&(0,$.jsx)(`span`,{children:`·`}),s!==null&&(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,$.jsx)(xe,{className:`size-3`}),s]})]}):(0,$.jsx)(`span`,{"aria-hidden":`true`,children:l}),t[11]=l,t[12]=o,t[13]=s,t[14]=d,t[15]=p):p=t[15];let m;return t[16]!==f||t[17]!==p?(m=(0,$.jsxs)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`sync-popover-last-sync`,children:[f,p]}),t[16]=f,t[17]=p,t[18]=m):m=t[18],m}function Xi(e){let t=(0,Z.c)(145),{status:n,onSignIn:r,onSetIdentity:i}=e,{_:a}=u(),{conflictCount:o}=n,{projectLocalConfig:c,projectLocalSynced:d}=pe(),f=c?.autoSync,{mode:p,confirmOpen:m,setConfirmOpen:h,pendingMode:g,strandedCommitCount:_,onModeSelect:v,onConfirm:y}=ve(f,n.ahead),{status:x,loading:S}=fi(!0),C=p===`follow`,w;t[0]===n?w=t[1]:(w=Ci(n),t[0]=n,t[1]=w);let T=w,E;t[2]===n?E=t[3]:(E=ji(n),t[2]=n,t[3]=E);let D=E,O=n.lastPullOkUtc??null,k=n.lastPushOkUtc??null,A=n.lastRunUtc??n.lastSyncUtc??null,j=n.pushPermission?.checkStatus===`denied`&&n.pushPermission.deniedReason!==`not-authenticated`&&!D,M=!j,N=T===`fetching`||T===`pulling`||T===`pushing`,[P,F]=(0,Q.useState)(null),I,L;t[4]===N?(I=t[5],L=t[6]):(I=()=>{N||F(null)},L=[N],t[4]=N,t[5]=I,t[6]=L),(0,Q.useEffect)(I,L);let R;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>{F(t=>t===e?null:t)},t[7]=R):R=t[7];let re=R,V=N?P??(T===`pushing`?`push`:`pull`):null,H;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(H=e=>{F(e),vi(e,()=>re(e))},t[8]=H):H=t[8];let U=H,W=T===`dormant`||T===`auth-error`||n.state===`conflict`,G=W||n.conflictCount>0,K;t[9]===n.blockingPaths?K=t[10]:(K=n.blockingPaths??[],t[9]=n.blockingPaths,t[10]=K);let ie=K,{conflicts:ae}=xr(),oe=ae[0]??null,se=T===`conflict`&&oe!==null,le;t[11]===n?le=t[12]:(le=(0,$.jsx)(wi,{status:n}),t[11]=n,t[12]=le);let q;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,$.jsx)(`span`,{className:`text-1sm font-medium`,children:(0,$.jsx)(l,{id:`yZepkk`})}),t[13]=q):q=t[13];let ue;t[14]===le?ue=t[15]:(ue=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[le,q]}),t[14]=le,t[15]=ue);let J;t[16]!==a||t[17]!==n.remote?(J=n.remote&&(n.remote.webUrl?(0,$.jsxs)(`a`,{href:n.remote.webUrl,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex min-w-0 items-center gap-0.5 text-xs text-foreground hover:text-primary hover:underline`,"aria-label":a({id:`1nke1r`,values:{0:n.remote.label}}),children:[(0,$.jsx)(`span`,{className:`truncate`,children:n.remote.label}),(0,$.jsx)(Ce,{className:`size-3.5 shrink-0`,"aria-hidden":!0})]}):(0,$.jsx)(`span`,{className:`min-w-0 truncate text-xs text-foreground`,children:n.remote.label})),t[16]=a,t[17]=n.remote,t[18]=J):J=t[18];let de;t[19]!==ue||t[20]!==J?(de=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[ue,J]}),t[19]=ue,t[20]=J,t[21]=de):de=t[21];let fe=g??`full`,Y;t[22]!==m||t[23]!==y||t[24]!==h||t[25]!==_||t[26]!==fe?(Y=(0,$.jsx)(ye,{open:m,onOpenChange:h,onConfirm:y,variant:fe,strandedCommitCount:_}),t[22]=m,t[23]=y,t[24]=h,t[25]=_,t[26]=fe,t[27]=Y):Y=t[27];let me;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,$.jsx)(Vi,{children:(0,$.jsx)(l,{id:`CnOGgs`})}),t[28]=me):me=t[28];let he;t[29]===v?he=t[30]:(he=e=>{ce(e)&&v(e)},t[29]=v,t[30]=he);let X=!d,ge;t[31]===a?ge=t[32]:(ge=a({id:`CnOGgs`}),t[31]=a,t[32]=ge);let _e;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(_e=(0,$.jsx)(ne,{}),t[33]=_e):_e=t[33];let be;t[34]===ge?be=t[35]:(be=(0,$.jsx)(te,{size:`sm`,className:`w-full text-xs`,"aria-label":ge,"data-testid":`sync-mode-select`,children:_e}),t[34]=ge,t[35]=be);let we;t[36]===a?we=t[37]:(we=a({id:`BWTzAb`}),t[36]=a,t[37]=we);let Te;t[38]===we?Te=t[39]:(Te=(0,$.jsx)(z,{value:`off`,className:`text-xs`,children:we}),t[38]=we,t[39]=Te);let Ee;t[40]===a?Ee=t[41]:(Ee=a({id:`tlGXxX`}),t[40]=a,t[41]=Ee);let De;t[42]===Ee?De=t[43]:(De=(0,$.jsx)(z,{value:`follow`,className:`text-xs`,children:Ee}),t[42]=Ee,t[43]=De);let Oe;t[44]===a?Oe=t[45]:(Oe=a({id:`IXiG0B`}),t[44]=a,t[45]=Oe);let ke;t[46]!==j||t[47]!==Oe?(ke=(0,$.jsx)(z,{value:`full`,className:`text-xs`,disabled:j,children:Oe}),t[46]=j,t[47]=Oe,t[48]=ke):ke=t[48];let Ae;t[49]!==Te||t[50]!==De||t[51]!==ke?(Ae=(0,$.jsxs)(ee,{children:[Te,De,ke]}),t[49]=Te,t[50]=De,t[51]=ke,t[52]=Ae):Ae=t[52];let Ne;t[53]!==p||t[54]!==he||t[55]!==X||t[56]!==be||t[57]!==Ae?(Ne=(0,$.jsxs)(B,{value:p,onValueChange:he,disabled:X,children:[be,Ae]}),t[53]=p,t[54]=he,t[55]=X,t[56]=be,t[57]=Ae,t[58]=Ne):Ne=t[58];let Pe;t[59]===p?Pe=t[60]:(Pe=(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`sync-popover-mode-line`,children:p===`off`?(0,$.jsx)(l,{id:`qD3krc`}):p===`follow`?(0,$.jsx)(l,{id:`PGRnbw`}):(0,$.jsx)(l,{id:`zBiFZh`})}),t[59]=p,t[60]=Pe);let Fe;t[61]!==Ne||t[62]!==Pe?(Fe=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[me,Ne,Pe]}),t[61]=Ne,t[62]=Pe,t[63]=Fe):Fe=t[63];let Ie;t[64]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=(0,$.jsx)(Vi,{children:(0,$.jsx)(l,{id:`BWTzAb`})}),t[64]=Ie):Ie=t[64];let Re=N||W,Be;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(Be=()=>U(`pull`),t[65]=Be):Be=t[65];let Ve;t[66]===V?Ve=t[67]:(Ve=V===`pull`?(0,$.jsx)(je,{"aria-hidden":`true`,"data-icon":`inline-start`}):(0,$.jsx)(Se,{"data-icon":`inline-start`}),t[66]=V,t[67]=Ve);let He;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(He=(0,$.jsx)(l,{id:`e4GHWP`}),t[68]=He):He=t[68];let Ue;t[69]!==Re||t[70]!==Ve?(Ue=(0,$.jsxs)(b,{variant:`outline`,size:`xs`,className:`flex-1`,disabled:Re,onClick:Be,"data-testid":`sync-popover-pull`,children:[Ve,He]}),t[69]=Re,t[70]=Ve,t[71]=Ue):Ue=t[71];let We;t[72]!==N||t[73]!==M||t[74]!==G||t[75]!==V?(We=M&&(0,$.jsxs)(b,{variant:`outline`,size:`xs`,className:`flex-1`,disabled:N||G,onClick:()=>U(`push`),"data-testid":`sync-popover-push`,children:[V===`push`?(0,$.jsx)(je,{"aria-hidden":`true`,"data-icon":`inline-start`}):(0,$.jsx)(xe,{"data-icon":`inline-start`}),(0,$.jsx)(l,{id:`uO9WLl`})]}),t[72]=N,t[73]=M,t[74]=G,t[75]=V,t[76]=We):We=t[76];let Ge;t[77]!==Ue||t[78]!==We?(Ge=(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[Ue,We]}),t[77]=Ue,t[78]=We,t[79]=Ge):Ge=t[79];let Ke;t[80]!==N||t[81]!==M||t[82]!==G||t[83]!==V?(Ke=M&&(0,$.jsxs)(b,{size:`xs`,className:`w-full`,disabled:N||G,onClick:()=>U(`sync`),"data-testid":`sync-popover-sync`,children:[V===`sync`?(0,$.jsx)(je,{"aria-hidden":`true`,icon:Me,"data-icon":`inline-start`}):(0,$.jsx)(Me,{"data-icon":`inline-start`}),(0,$.jsx)(l,{id:`YEzhIr`})]}),t[80]=N,t[81]=M,t[82]=G,t[83]=V,t[84]=Ke):Ke=t[84];let qe;t[85]!==Ge||t[86]!==Ke?(qe=(0,$.jsxs)(`div`,{className:`flex flex-col gap-2 border-t pt-3`,children:[Ie,Ge,Ke]}),t[85]=Ge,t[86]=Ke,t[87]=qe):qe=t[87];let Je;if(t[88]!==a||t[89]!==n){let e;t[91]===a?e=t[92]:(e=e=>(0,$.jsx)(`p`,{className:`text-xs text-destructive`,children:e.direction===`push`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`span`,{className:`font-medium`,children:[a({id:`uO9WLl`}),`: `]}),e.message]}):e.direction===`pull`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`span`,{className:`font-medium`,children:[a({id:`e4GHWP`}),`: `]}),e.message]}):e.message},e.key),t[91]=a,t[92]=e),Je=Li(n).map(e),t[88]=a,t[89]=n,t[90]=Je}else Je=t[90];let Ye;t[93]===n?Ye=t[94]:(Ye=Mi(n)&&n.pushPermission?.checkStatus===`denied`?ki(n.pushPermission).map(ea):null,t[93]=n,t[94]=Ye);let Xe;t[95]!==n.pausedReason||t[96]!==n.pushPermission?(Xe=n.pausedReason===`no-push-permission`&&n.pushPermission?.checkStatus===`denied`?ki(n.pushPermission).map($i):null,t[95]=n.pausedReason,t[96]=n.pushPermission,t[97]=Xe):Xe=t[97];let Ze;t[98]!==Je||t[99]!==Ye||t[100]!==Xe?(Ze=(0,$.jsxs)(`div`,{role:`status`,"aria-live":`polite`,className:`flex flex-col gap-3.5 empty:sr-only`,children:[Je,Ye,Xe]}),t[98]=Je,t[99]=Ye,t[100]=Xe,t[101]=Ze):Ze=t[101];let $e;t[102]!==ie||t[103]!==C||t[104]!==j||t[105]!==r||t[106]!==n?($e=!C&&Ni(n.pushPermission)?(0,$.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,$.jsx)(`p`,{className:`min-w-0 flex-1 text-xs text-muted-foreground`,children:(0,$.jsx)(l,{id:`ycIX5i`})}),r&&(0,$.jsx)(b,{variant:`outline`,size:`xs`,className:`self-start`,onClick:r,children:(0,$.jsx)(l,{id:`5lWFkC`})})]}):ie.length>0?(0,$.jsx)(hi,{paths:ie}):Mi(n)?null:n.pausedReason?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:Di(n.pausedReason)}):!C&&j&&n.pushPermission?.checkStatus===`denied`?Oi(n.pushPermission.deniedReason,n.pushPermission).map(Qi):Ri(n.pushPermission)?(0,$.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,$.jsx)(`p`,{className:`min-w-0 flex-1 text-xs text-muted-foreground`,children:(0,$.jsx)(l,{id:`C_cPoW`})}),r&&(0,$.jsx)(b,{variant:`outline`,size:`xs`,className:`self-start`,onClick:r,children:(0,$.jsx)(l,{id:`5lWFkC`})})]}):null,t[102]=ie,t[103]=C,t[104]=j,t[105]=r,t[106]=n,t[107]=$e):$e=t[107];let et;t[108]!==oe||t[109]!==se||t[110]!==T?(et=T===`conflict`&&(0,$.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,$.jsx)(`p`,{className:`min-w-0 flex-1 text-xs text-amber-700 dark:text-amber-400`,children:(0,$.jsx)(l,{id:`ko386X`})}),se&&oe&&(0,$.jsx)(b,{variant:`outline`,size:`xs`,className:`self-start`,onClick:()=>yi(Le(ze(oe.file))),children:(0,$.jsx)(l,{id:`5k0NLb`})})]}),t[108]=oe,t[109]=se,t[110]=T,t[111]=et):et=t[111];let tt;t[112]!==r||t[113]!==T||t[114]!==n?(tt=T===`auth-error`&&!Mi(n)&&r&&(0,$.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,$.jsx)(`p`,{className:`min-w-0 flex-1 text-xs text-destructive`,children:(0,$.jsx)(l,{id:`Vl1H8I`})}),(0,$.jsx)(b,{variant:`outline`,size:`xs`,className:`self-start`,onClick:r,children:(0,$.jsx)(l,{id:`5lWFkC`})})]}),t[112]=r,t[113]=T,t[114]=n,t[115]=tt):tt=t[115];let nt;t[116]===o?nt=t[117]:(nt=o>0&&(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,$.jsx)(l,{id:`B4_ipX`,values:{conflictCount:o}})}),t[116]=o,t[117]=nt);let rt;t[118]!==n||t[119]!==x||t[120]!==S?(rt=(0,$.jsx)(Ji,{status:n,worktree:x,loading:S}),t[118]=n,t[119]=x,t[120]=S,t[121]=rt):rt=t[121];let it;t[122]!==A||t[123]!==O||t[124]!==k?(it=(0,$.jsx)(Yi,{pulledAt:O,pushedAt:k,combinedAt:A}),t[122]=A,t[123]=O,t[124]=k,t[125]=it):it=t[125];let at;t[126]===Symbol.for(`react.memo_cache_sentinel`)?(at=(0,$.jsx)(Qe,{asChild:!0,children:(0,$.jsxs)(b,{variant:`link`,size:`xs`,className:`h-auto p-0 text-xs text-muted-foreground hover:font-medium hover:text-foreground hover:no-underline`,onClick:Zi,"data-testid":`sync-popover-settings`,children:[(0,$.jsx)(s,{"data-icon":`inline-start`}),(0,$.jsx)(l,{id:`VNgKZz`})]})}),t[126]=at):at=t[126];let ot;t[127]===it?ot=t[128]:(ot=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[it,at]}),t[127]=it,t[128]=ot);let st;t[129]!==i||t[130]!==n.identityUnresolved?(st=n.identityUnresolved&&i&&(0,$.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-dashed p-2`,children:[(0,$.jsx)(_t,{className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground`}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,$.jsx)(`p`,{className:`text-xs leading-snug text-muted-foreground`,children:(0,$.jsx)(l,{id:`nrGWJ7`})}),(0,$.jsx)(b,{variant:`outline`,size:`xs`,className:`self-start`,onClick:i,children:(0,$.jsx)(l,{id:`keNFEd`})})]})]}),t[129]=i,t[130]=n.identityUnresolved,t[131]=st):st=t[131];let ct;return t[132]!==de||t[133]!==Y||t[134]!==Fe||t[135]!==qe||t[136]!==Ze||t[137]!==$e||t[138]!==et||t[139]!==tt||t[140]!==nt||t[141]!==rt||t[142]!==ot||t[143]!==st?(ct=(0,$.jsxs)(`div`,{className:`flex flex-col gap-3.5`,children:[de,Y,Fe,qe,Ze,$e,et,tt,nt,rt,ot,st]}),t[132]=de,t[133]=Y,t[134]=Fe,t[135]=qe,t[136]=Ze,t[137]=$e,t[138]=et,t[139]=tt,t[140]=nt,t[141]=rt,t[142]=ot,t[143]=st,t[144]=ct):ct=t[144],ct}function Zi(){return ue({advanced:!0})}function Qi(e){return(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e},e)}function $i(e){return(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e},e)}function ea(e){return(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e},e)}function ta(e){let t=(0,Z.c)(68),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{onSignIn:r,onSetIdentity:i}=n,{_:a}=u(),{status:o,fetchError:s}=ge();if(!o){if(s){let e;t[2]===a?e=t[3]:(e=a({id:`iqIDv4`}),t[2]=a,t[3]=e);let n;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(pt,{className:`size-3.5`}),t[4]=n):n=t[4];let r;t[5]===e?r=t[6]:(r=(0,$.jsx)(S,{asChild:!0,children:(0,$.jsx)(b,{variant:`ghost`,size:`icon-sm`,className:`text-muted-foreground`,"aria-label":e,disabled:!0,children:n})}),t[5]=e,t[6]=r);let i;t[7]===s?i=t[8]:(i=(0,$.jsx)(C,{children:s===`network`?(0,$.jsx)(l,{id:`I5AfhE`}):(0,$.jsx)(l,{id:`uKRYiW`})}),t[7]=s,t[8]=i);let o;return t[9]!==r||t[10]!==i?(o=(0,$.jsxs)(w,{children:[r,i]}),t[9]=r,t[10]=i,t[11]=o):o=t[11],o}return null}if(!o.hasRemote)return null;let c;t[12]===o?c=t[13]:(c=Ti(o),t[12]=o,t[13]=c);let d=c,f,p,m,h,g,_,v,y,x,T,E,D;if(t[14]!==a||t[15]!==o){let e=zi(o);_=!!o.identityUnresolved,g=$e,h=w,m=S,D=!0,p=Xe,E=!0,f=b,v=`ghost`,y=`icon-sm`,x=`text-muted-foreground relative`,T=a(_?{id:`DFfRbX`,values:{syncStateLabel:e}}:{id:`F4vEsL`,values:{syncStateLabel:e}}),t[14]=a,t[15]=o,t[16]=f,t[17]=p,t[18]=m,t[19]=h,t[20]=g,t[21]=_,t[22]=v,t[23]=y,t[24]=x,t[25]=T,t[26]=E,t[27]=D}else f=t[16],p=t[17],m=t[18],h=t[19],g=t[20],_=t[21],v=t[22],y=t[23],x=t[24],T=t[25],E=t[26],D=t[27];let O;t[28]===o?O=t[29]:(O=(0,$.jsx)(wi,{status:o}),t[28]=o,t[29]=O);let k;t[30]===d?k=t[31]:(k=d&&(0,$.jsx)(`span`,{className:`absolute -top-0.5 -right-0.5 text-[9px] leading-none font-medium bg-background border rounded-full px-0.5`,children:d}),t[30]=d,t[31]=k);let A;t[32]!==d||t[33]!==_?(A=!d&&_&&(0,$.jsx)(`span`,{className:`absolute -top-0.5 -right-0.5 size-1.5 rounded-full bg-amber-500 ring-2 ring-background`,"aria-hidden":!0}),t[32]=d,t[33]=_,t[34]=A):A=t[34];let j;t[35]!==f||t[36]!==k||t[37]!==A||t[38]!==v||t[39]!==y||t[40]!==x||t[41]!==T||t[42]!==O?(j=(0,$.jsxs)(f,{variant:v,size:y,className:x,"aria-label":T,children:[O,k,A]}),t[35]=f,t[36]=k,t[37]=A,t[38]=v,t[39]=y,t[40]=x,t[41]=T,t[42]=O,t[43]=j):j=t[43];let M;t[44]!==p||t[45]!==j||t[46]!==E?(M=(0,$.jsx)(p,{asChild:E,children:j}),t[44]=p,t[45]=j,t[46]=E,t[47]=M):M=t[47];let N;t[48]!==m||t[49]!==M||t[50]!==D?(N=(0,$.jsx)(m,{asChild:D,children:M}),t[48]=m,t[49]=M,t[50]=D,t[51]=N):N=t[51];let P;t[52]===o?P=t[53]:(P=Bi(o),t[52]=o,t[53]=P);let F;t[54]===P?F=t[55]:(F=(0,$.jsx)(C,{children:P}),t[54]=P,t[55]=F);let I;t[56]!==h||t[57]!==N||t[58]!==F?(I=(0,$.jsxs)(h,{children:[N,F]}),t[56]=h,t[57]=N,t[58]=F,t[59]=I):I=t[59];let L;t[60]!==i||t[61]!==r||t[62]!==o?(L=(0,$.jsx)(Ze,{align:`end`,className:`flex max-h-(--radix-popover-content-available-height) w-80 flex-col overflow-y-auto p-3`,children:(0,$.jsx)(Xi,{status:o,onSignIn:r,onSetIdentity:i})}),t[60]=i,t[61]=r,t[62]=o,t[63]=L):L=t[63];let R;return t[64]!==g||t[65]!==I||t[66]!==L?(R=(0,$.jsxs)(g,{children:[I,L]}),t[64]=g,t[65]=I,t[66]=L,t[67]=R):R=t[67],R}function na(e){let t=(0,Z.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,size:i,asChild:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`default`:i,s=a!==void 0&&a?x:`div`,c;t[5]===n?c=t[6]:(c=f(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,n),t[5]=n,t[6]=c);let l;return t[7]!==s||t[8]!==r||t[9]!==o||t[10]!==c?(l=(0,$.jsx)(s,{"data-slot":`card`,"data-size":o,className:c,...r}),t[7]=s,t[8]=r,t[9]=o,t[10]=c,t[11]=l):l=t[11],l}function ra(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=f(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`div`,{"data-slot":`card-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ia(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=f(`cn-font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`div`,{"data-slot":`card-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function aa(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=f(`text-sm text-muted-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`div`,{"data-slot":`card-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function oa(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=f(`col-start-2 row-span-2 row-start-1 self-start justify-self-end`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`div`,{"data-slot":`card-action`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function sa(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=f(`px-(--card-spacing)`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`div`,{"data-slot":`card-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ca(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=f(`flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`div`,{"data-slot":`card-footer`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var la=`npx @inkeep/open-knowledge cowork`,ua=`https://openknowledge.ai/docs/integrations/claude-code`;function da(){return typeof window<`u`&&typeof window.okDesktop?.skill==`object`}function fa(e){let t=(0,Z.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,$.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 font-mono text-[0.85em]`,children:n}),t[0]=n,t[1]=r),r}function pa(e){let t=(0,Z.c)(5),{children:n,className:r}=e,i;t[0]===r?i=t[1]:(i=f(`font-mono tracking-wide uppercase text-primary font-medium text-xs`,r),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,$.jsx)(`p`,{className:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function ma(e){let t=(0,Z.c)(4),{n}=e,r;t[0]===n?r=t[1]:(r=n.toString().padStart(2,`0`),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`flex h-5 w-5 shrink-0 items-center justify-center text-xs font-medium text-muted-foreground font-mono tabular-nums`,children:r}),t[2]=r,t[3]=i),i}function ha(){let e=(0,Z.c)(8),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(pa,{children:(0,$.jsx)(l,{id:`cIptmH`})}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(ma,{n:1}),e[1]=n):n=e[1];let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsxs)(`li`,{className:`flex gap-3`,children:[n,(0,$.jsx)(`span`,{children:(0,$.jsx)(l,{id:`pHYP6v`,components:{0:(0,$.jsx)(`strong`,{className:`font-medium`}),1:(0,$.jsx)(be,{"aria-hidden":`true`,className:`inline h-3 w-3 text-muted-foreground`}),2:(0,$.jsx)(`strong`,{className:`font-medium`})}})})]}),e[2]=r):r=e[2];let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(ma,{n:2}),e[3]=i):i=e[3];let a;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsxs)(`li`,{className:`flex gap-3`,children:[i,(0,$.jsx)(`span`,{children:(0,$.jsx)(l,{id:`gGVP4q`,components:{0:(0,$.jsx)(`span`,{className:`inline-flex items-center justify-center font-medium border h-5 w-5 rounded-md text-xs`}),1:(0,$.jsx)(be,{"aria-hidden":`true`,className:`inline h-3 w-3 text-muted-foreground`}),2:(0,$.jsx)(`strong`,{className:`font-medium`}),3:(0,$.jsx)(be,{"aria-hidden":`true`,className:`inline h-3 w-3 text-muted-foreground`}),4:(0,$.jsx)(`strong`,{className:`font-medium`})}})})]}),e[4]=a):a=e[4];let o;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(ma,{n:3}),e[5]=o):o=e[5];let s;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsxs)(`ol`,{className:`flex flex-col gap-4 text-sm`,children:[r,a,(0,$.jsxs)(`li`,{className:`flex gap-3`,children:[o,(0,$.jsx)(`span`,{children:(0,$.jsx)(l,{id:`COr1Y7`,components:{0:(0,$.jsx)(fa,{}),1:(0,$.jsx)(`strong`,{className:`font-medium`})}})})]})]}),e[6]=s):s=e[6];let c;return e[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[t,s,(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground mt-4`,children:(0,$.jsx)(l,{id:`kV2YZv`,components:{0:(0,$.jsx)(`strong`,{className:`font-medium`}),1:(0,$.jsx)(`strong`,{className:`font-medium`}),2:(0,$.jsx)(be,{"aria-hidden":`true`,className:`inline h-3 w-3 text-muted-foreground`}),3:(0,$.jsx)(be,{"aria-hidden":`true`,className:`inline h-3 w-3 text-muted-foreground`})}})})]}),e[7]=c):c=e[7],c}function ga(e){let t=(0,Z.c)(74),{open:r,onOpenChange:i,reinstall:a}=e,o=a===void 0?!1:a,{_:s}=u(),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={kind:`idle`},t[0]=c):c=t[0];let[d,f]=(0,Q.useState)(c),[p,m]=(0,Q.useState)(!1),h,g;t[1]===r?(h=t[2],g=t[3]):(h=()=>{r||(f({kind:`idle`}),m(!1))},g=[r],t[1]=r,t[2]=h,t[3]=g),(0,Q.useEffect)(h,g);let _;t[4]===s?_=t[5]:(_=async function(){f({kind:`downloading`});let e=window.okDesktop?.skill;if(!e){f({kind:`error`,message:s({id:`y46m5r`})});return}let t=await e.buildAndOpen();if(t.ok)f({kind:`handed-off`,path:t.path});else{let e=t.message??t.reason;q.error(s({id:`hSySVc`,values:{msg:e}})),f({kind:`error`,message:t.reason===`open-failed`?s({id:`IA1wNb`,values:{msg:e}}):`${t.reason}: ${e}`})}},t[4]=s,t[5]=_);let v=_,y;t[6]===s?y=t[7]:(y=async function(){try{await navigator.clipboard.writeText(la),m(!0),setTimeout(()=>m(!1),2e3)}catch(e){let t=e,n=t instanceof Error?t.message:String(t);q.error(s({id:`Uw6ERJ`,values:{detail:n}}))}},t[6]=s,t[7]=y);let x=y,S;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(S=da(),t[8]=S):S=t[8];let C=S,w;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(Ee,{"aria-hidden":`true`,className:`h-4 w-4`}),t[9]=w):w=t[9];let M;t[10]===o?M=t[11]:(M=(0,$.jsxs)(E,{className:`flex items-center gap-2`,children:[w,o?(0,$.jsx)(l,{id:`xNyj3h`}):(0,$.jsx)(l,{id:`7qRHf0`})]}),t[10]=o,t[11]=M);let N;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(T,{children:(0,$.jsx)(l,{id:`9V0W-R`,components:{0:(0,$.jsx)(`strong`,{className:`font-medium text-foreground`})}})}),t[12]=N):N=t[12];let P;t[13]===M?P=t[14]:(P=(0,$.jsxs)(A,{children:[M,N]}),t[13]=M,t[14]=P);let F;t[15]===d.kind?F=t[16]:(F=d.kind===`idle`&&C&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(pa,{className:`text-muted-foreground`,children:(0,$.jsx)(l,{id:`Dnn2XG`})}),(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(l,{id:`RN62Q8`,components:{0:(0,$.jsx)(fa,{}),1:(0,$.jsx)(fa,{})}})})]}),(0,$.jsx)(ha,{})]}),t[15]=d.kind,t[16]=F);let I;t[17]!==s||t[18]!==p||t[19]!==x||t[20]!==d.kind?(I=d.kind===`idle`&&!C&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(pa,{children:(0,$.jsx)(l,{id:`L8fKuc`})}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border bg-muted/40 p-2`,children:[(0,$.jsx)(`code`,{className:`flex-1 font-mono text-xs`,children:la}),(0,$.jsx)(b,{variant:`ghost`,size:`sm`,onClick:x,"aria-label":s({id:`Oos8fo`}),className:`h-7 gap-1`,children:p?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Te,{"aria-hidden":`true`,className:`h-3 w-3`}),(0,$.jsx)(l,{id:`6V3Ea3`})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(n,{"aria-hidden":`true`,className:`h-3 w-3`}),(0,$.jsx)(l,{id:`he3ygx`})]})})]}),(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(l,{id:`z60Lgn`,components:{0:(0,$.jsx)(fa,{})}})})]}),(0,$.jsx)(ha,{})]}),t[17]=s,t[18]=p,t[19]=x,t[20]=d.kind,t[21]=I):I=t[21];let L;t[22]===d.kind?L=t[23]:(L=d.kind===`downloading`&&(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,$.jsx)(je,{"aria-hidden":`true`,className:`h-4 w-4`}),(0,$.jsx)(l,{id:`bwil08`,components:{0:(0,$.jsx)(fa,{})}})]}),t[22]=d.kind,t[23]=L);let R;t[24]!==d.kind||t[25]!==d.path?(R=d.kind===`handed-off`&&C&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-primary/30 bg-primary/5 px-3 py-2`,children:[(0,$.jsx)(Te,{"aria-hidden":`true`,className:`mt-0.5 h-4 w-4 text-primary`}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:(0,$.jsx)(l,{id:`r51jLC`})}),(0,$.jsx)(`code`,{className:`font-mono text-xs text-muted-foreground`,children:d.path??`~/Downloads/openknowledge.skill`})]})]}),(0,$.jsx)(ha,{})]}),t[24]=d.kind,t[25]=d.path,t[26]=R):R=t[26];let z;t[27]===d.kind?z=t[28]:(z=d.kind===`handed-off`&&!C&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-primary/30 bg-primary/5 px-3 py-2`,children:[(0,$.jsx)(Te,{"aria-hidden":`true`,className:`mt-0.5 h-4 w-4 text-primary`}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:(0,$.jsx)(l,{id:`hynz2K`})}),(0,$.jsx)(`span`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(l,{id:`qXg5W9`,components:{0:(0,$.jsx)(fa,{})}})})]})]}),(0,$.jsx)(ha,{})]}),t[27]=d.kind,t[28]=z);let ee;t[29]!==d.kind||t[30]!==d.message?(ee=d.kind===`error`&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-2 text-sm`,children:[(0,$.jsx)(`span`,{className:`text-destructive`,children:d.message}),(0,$.jsx)(`a`,{href:ua,target:`_blank`,rel:`noopener noreferrer`,onClick:ba,onAuxClick:ya,className:`text-xs underline underline-offset-2 hover:text-foreground`,children:(0,$.jsx)(l,{id:`mGaZwZ`})})]}),t[29]=d.kind,t[30]=d.message,t[31]=ee):ee=t[31];let te;t[32]!==F||t[33]!==I||t[34]!==L||t[35]!==R||t[36]!==z||t[37]!==ee?(te=(0,$.jsx)(O,{children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-6 py-2`,children:[F,I,L,R,z,ee]})}),t[32]=F,t[33]=I,t[34]=L,t[35]=R,t[36]=z,t[37]=ee,t[38]=te):te=t[38];let ne;t[39]===d.kind?ne=t[40]:(ne=d.kind!==`error`&&(0,$.jsxs)(`a`,{href:ua,target:`_blank`,rel:`noopener noreferrer`,onClick:va,onAuxClick:_a,className:`inline-flex items-center gap-1 self-center text-xs text-muted-foreground underline underline-offset-2 hover:text-foreground sm:mr-auto font-mono tracking-wide uppercase`,children:[(0,$.jsx)(l,{id:`U3IvM5`}),(0,$.jsx)(gt,{"aria-hidden":`true`,className:`h-3 w-3`})]}),t[39]=d.kind,t[40]=ne);let B;t[41]!==v||t[42]!==i||t[43]!==d.kind||t[44]!==o?(B=d.kind===`idle`&&C&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(b,{className:`uppercase font-mono`,variant:`outline`,onClick:()=>i(!1),children:(0,$.jsx)(l,{id:`dEgA5A`})}),(0,$.jsxs)(b,{onClick:v,children:[(0,$.jsx)(Ee,{"aria-hidden":`true`,className:`h-4 w-4`}),o?(0,$.jsx)(l,{id:`YGIi_c`}):(0,$.jsx)(l,{id:`TKQ7K-`})]})]}),t[41]=v,t[42]=i,t[43]=d.kind,t[44]=o,t[45]=B):B=t[45];let re;t[46]!==i||t[47]!==d.kind?(re=d.kind===`idle`&&!C&&(0,$.jsx)(b,{className:`uppercase font-mono`,variant:`outline`,onClick:()=>i(!1),children:(0,$.jsx)(l,{id:`yz7wBu`})}),t[46]=i,t[47]=d.kind,t[48]=re):re=t[48];let V;t[49]!==v||t[50]!==i||t[51]!==d.kind?(V=d.kind===`error`&&C&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(b,{className:`uppercase font-mono`,variant:`outline`,onClick:()=>i(!1),children:(0,$.jsx)(l,{id:`dEgA5A`})}),(0,$.jsxs)(b,{onClick:v,children:[(0,$.jsx)(Ee,{"aria-hidden":`true`,className:`h-4 w-4`}),(0,$.jsx)(l,{id:`KDw4GX`})]})]}),t[49]=v,t[50]=i,t[51]=d.kind,t[52]=V):V=t[52];let H;t[53]!==d.kind||t[54]!==o?(H=d.kind===`downloading`&&(0,$.jsxs)(b,{disabled:!0,children:[(0,$.jsx)(je,{"aria-hidden":`true`,className:`h-4 w-4`}),o?(0,$.jsx)(l,{id:`fIgqfQ`}):(0,$.jsx)(l,{id:`Wtw22s`})]}),t[53]=d.kind,t[54]=o,t[55]=H):H=t[55];let U;t[56]!==i||t[57]!==d.kind?(U=d.kind===`handed-off`&&(0,$.jsx)(b,{onClick:()=>i(!1),children:(0,$.jsx)(l,{id:`DPfwMq`})}),t[56]=i,t[57]=d.kind,t[58]=U):U=t[58];let W;t[59]!==ne||t[60]!==B||t[61]!==re||t[62]!==V||t[63]!==H||t[64]!==U?(W=(0,$.jsxs)(k,{children:[ne,B,re,V,H,U]}),t[59]=ne,t[60]=B,t[61]=re,t[62]=V,t[63]=H,t[64]=U,t[65]=W):W=t[65];let G;t[66]!==P||t[67]!==te||t[68]!==W?(G=(0,$.jsxs)(D,{className:`sm:max-w-lg`,"data-ok-layer-spawned":``,children:[P,te,W]}),t[66]=P,t[67]=te,t[68]=W,t[69]=G):G=t[69];let K;return t[70]!==i||t[71]!==r||t[72]!==G?(K=(0,$.jsx)(j,{open:r,onOpenChange:i,children:G}),t[70]=i,t[71]=r,t[72]=G,t[73]=K):K=t[73],K}function _a(e){return et(e,ua)}function va(e){return et(e,ua)}function ya(e){return et(e,ua)}function ba(e){return et(e,ua)}var xa=new Set;function Sa(e){for(let t of xa)try{t(e)}catch(e){console.warn(`[config-ignore-nested-error-events] listener threw:`,e)}}function Ca(e){return xa.add(e),()=>{xa.delete(e)}}var wa=new Set;function Ta(e){for(let t of wa)try{t(e)}catch(e){console.warn(`[config-validation-events] listener threw:`,e)}}function Ea(e){return wa.add(e),()=>{wa.delete(e)}}var Da=null;function Oa(){return Da}function ka(e){Da=e}export{At as $,Er as A,hr as B,$r as C,Dr as D,Rr as E,Sr as F,wn as G,fr as H,xr as I,tn as J,Cn as K,vr as L,Ar as M,jr as N,kr as O,Tr as P,zt as Q,_r as R,Ri as S,Fr as T,kn as U,gr as V,Tn as W,Vt as X,Yt as Y,Rt as Z,Di as _,Sa as a,Mi as b,na as c,aa as d,Tt as et,ca as f,ki as g,ta as h,Ea as i,wr as j,Or as k,oa as l,ia as m,ka as n,yt as nt,Ca as o,ra as p,bn as q,Ta as r,mt as rt,ga as s,Oa as t,bt as tt,sa as u,Ii as v,Pr as w,Ni as x,ji as y,yr as z};
11
+ `)}function Er(e){return e.lines.filter(e=>e.kind===`pattern`)}function Dr(e,t){let n=t.trim();if(n.length===0)return e;for(let t of e.lines)if(t.kind===`pattern`&&t.text===n)return e;let r={kind:`pattern`,raw:n,text:n},i=e.lines.slice(),a=i[i.length-1];return a&&a.kind===`blank`&&a.raw===``?i.splice(i.length-1,0,r):i.push(r,{kind:`blank`,raw:``}),{lines:i}}function Or(e,t){let n=t.trim();if(n.length===0)return-1;let r=0;for(let t of e.lines)if(t.kind===`pattern`){if(t.text===n)return r;r++}return-1}function kr(e,t,n){let r=n.trim();if(r.length===0)return Ar(e,t);let i=Mr(e,t);if(i<0)return e;let a=e.lines.slice();return a[i]={kind:`pattern`,raw:r,text:r},{lines:a}}function Ar(e,t){let n=Mr(e,t);if(n<0)return e;let r=e.lines.slice();return r.splice(n,1),{lines:r}}function jr(e,t,n){if(t===n)return e;let r=[],i=[];if(e.lines.forEach((e,t)=>{e.kind===`pattern`&&(r.push(t),i.push(e))}),t<0||t>=i.length||n<0||n>=i.length)return e;let a=i.slice(),[o]=a.splice(t,1);if(!o)return e;a.splice(n,0,o);let s=e.lines.slice();return r.forEach((e,t)=>{let n=a[t];n&&(s[e]=n)}),{lines:s}}function Mr(e,t){if(t<0)return-1;let n=0;for(let r=0;r<e.lines.length;r++)if(e.lines[r]?.kind===`pattern`){if(n===t)return r;n++}return-1}var Nr=`/api/share/construct-url`;function Pr(e){return{kind:`doc`,docName:e}}function Fr(e){return{kind:`folder`,folderRelativePath:e}}async function Ir(e,t=fetch){let n=await t(Nr,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!n.ok)throw Error(`construct-url transport ${n.status}`);let r=await n.json(),i=W.safeParse(r);if(!i.success)throw Error(`construct-url response shape mismatch`);return i.data}function Lr(e,t){switch(e){case`detached-head`:return J._({id:`jLOL1H`});case`branch-not-on-origin`:return t?J._({id:`x-fZxg`,values:{branch:t}}):J._({id:`ZGVsOD`});case`non-github-remote`:return J._({id:`V4JHny`});case`invalid-path`:return J._({id:`0pZmTP`});case`unsupported-share-url`:return J._({id:`uYZTcW`});case`no-remote`:return J._({id:`pA16WG`})}}async function Rr(e,t){if(!e.hasRemote)return e.onClickWhenNoRemote(),{kind:`opened-wizard`};let n=e.kind===`folder`?{kind:`folder`,folderPath:e.folderRelativePath}:{kind:`doc`,docPath:Re(e.docName)},r;try{r=await Ir(n,t.fetchFn)}catch{return t.toastError(J._({id:`u3YnKw`}),`transport`),{kind:`transport-error`}}if(r.ok){try{await t.clipboardWrite(r.shareUrl)}catch{return t.toastError(J._({id:`E_A2Nq`}),`clipboard`),t.logEvent(`[share] action=link-construct result=clipboard-failed`),{kind:`clipboard-failed`,shareUrl:r.shareUrl,freshness:r.freshness}}return t.toastSuccess(e.kind===`folder`?J._({id:`xcGVzH`}):J._({id:`c1LZZH`})),t.logEvent(`[share] action=link-construct`),{kind:`copied`,shareUrl:r.shareUrl,branch:r.branch,freshness:r.freshness}}if(r.error===`no-remote`)return e.onClickWhenNoRemote(),{kind:`opened-wizard`};let i=r.branch;return t.toastError(Lr(r.error,i),`business`),{kind:`business-error`,error:r.error,branch:i}}var zr=`/api/share/publish/owners`,Br=`/api/share/publish/name-check`,Vr=`/api/share/publish`,Hr=/[A-Za-z0-9._-]/g;function Ur(e){return(e.match(Hr)?.join(``)??``).replace(/[-.]{2,}/g,e=>e[0]??`-`).replace(/^[-.]+/,``).replace(/[-.]+$/,``)}function Wr(e){return e.find(e=>e.kind===`org`)?.login??e[0]?.login??``}function Gr(e){return`https://github.com/orgs/${encodeURIComponent(e)}/policies/applications`}function Kr(e,t,n){switch(e){case`name-conflict`:return{banner:J._({id:`n81AV0`,values:{owner:t,name:n}}),next:{kind:`edit-name`}};case`saml-sso`:return{banner:J._({id:`gLCE2c`,values:{owner:t}}),next:{kind:`authorize-org`,authorizeUrl:Gr(t)}};case`push-failed`:return{banner:J._({id:`7Y9yTo`,values:{owner:t,name:n}}),next:{kind:`retry-push`}};case`auth-required`:return{banner:J._({id:`UGtPix`}),next:{kind:`reauth`}};case`init-failed`:return{banner:J._({id:`kGp168`}),next:{kind:`edit-form`}};case`network`:return{banner:J._({id:`UVLlMV`}),next:{kind:`edit-form`}};case`no-project`:return{banner:J._({id:`S6eHlw`}),next:{kind:`edit-form`}}}}async function qr(e=fetch){let t=await e(zr,{method:`GET`});if(!t.ok)throw Error(`owners transport ${t.status}`);let n=await t.json(),r=ae.safeParse(n);if(!r.success)throw Error(`owners response shape mismatch`);return r.data}async function Jr(e,t,n=fetch){let r=await n(`${Br}?owner=${encodeURIComponent(e)}&name=${encodeURIComponent(t)}`,{method:`GET`});if(!r.ok)throw Error(`name-check transport ${r.status}`);let i=await r.json(),a=ie.safeParse(i);if(!a.success)throw Error(`name-check response shape mismatch`);return a.data}async function Yr(e,t=fetch){let n=await t(Vr,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!n.ok)throw Error(`publish transport ${n.status}`);let r=await n.json(),i=U.safeParse(r);if(!i.success)throw Error(`publish response shape mismatch`);return i.data}function Xr(e,t,n){return e.ok?e.available?{kind:`available`}:{kind:`taken`,owner:t,name:n}:e.error===`auth-required`?{kind:`error`,banner:J._({id:`UGtPix`})}:{kind:`error`,banner:J._({id:`UVLlMV`})}}function Zr(e){return e.submitting||e.owner===null||e.sanitizedName.length===0?!1:e.nameCheck.kind===`available`}var Qr=500;function $r(e){let t=(0,Z.c)(69),{open:n,onOpenChange:r}=e,{_:a}=u(),o=he(),{activeDocName:s}=i(),[c,d]=(0,Q.useState)(null),[f,h]=(0,Q.useState)(!1),[g,_]=(0,Q.useState)(null),[v,y]=(0,Q.useState)(``),[x,S]=(0,Q.useState)(``),[C,w]=(0,Q.useState)(`private`),[M,N]=(0,Q.useState)(``),P;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(P={kind:`idle`},t[0]=P):P=t[0];let[F,I]=(0,Q.useState)(P),[L,z]=(0,Q.useState)(!1),[ee,te]=(0,Q.useState)(null),[ne,B]=(0,Q.useState)(!1),[H,U]=(0,Q.useState)(null),[W,G]=(0,Q.useState)(!1),[K,ie]=(0,Q.useState)(null),[ae,oe]=(0,Q.useState)(null),se=(0,Q.useRef)(null),ce=(0,Q.useRef)(null),le=(0,Q.useRef)(null),ue;t[1]===x?ue=t[2]:(ue=Ur(x),t[1]=x,t[2]=ue);let J=ue,de=c?.find(e=>e.login===v)??null,fe;t[3]!==a||t[4]!==v?(fe=async function(){h(!0),_(null);try{let e=await qr();if(!e.ok){e.error===`auth-required`?(B(!0),_(a({id:`6cyguR`}))):_(a({id:`UVLlMV`})),h(!1);return}d(e.owners),e.owners.length>0&&v===``&&y(Wr(e.owners))}catch{_(a({id:`UVLlMV`}))}h(!1)},t[3]=a,t[4]=v,t[5]=fe):fe=t[5];let Y=fe,pe;t[6]!==Y||t[7]!==n||t[8]!==c||t[9]!==v||t[10]!==o?.contentDir?(pe=()=>{n&&(I({kind:`idle`}),te(null),z(!1),_(null),U(null),G(!1),ie(null),oe(null),S(Ur(Sr(o?.contentDir??``))),w(`private`),N(``),c===null?Y():v===``&&c.length>0&&y(Wr(c)))},t[6]=Y,t[7]=n,t[8]=c,t[9]=v,t[10]=o?.contentDir,t[11]=pe):pe=t[11];let me;t[12]===n?me=t[13]:(me=[n],t[12]=n,t[13]=me),(0,Q.useEffect)(pe,me);let X,ge;t[14]!==a||t[15]!==n||t[16]!==J||t[17]!==v?(X=()=>{if(n){if(se.current!==null&&clearTimeout(se.current),v===``||J===``){I({kind:`idle`});return}return I({kind:`pending`}),se.current=setTimeout(async()=>{let e=v,t=J;ce.current=`${e}|${t}`,I({kind:`checking`});try{let n=await Jr(e,t);if(ce.current!==`${e}|${t}`)return;I(Xr(n,e,t))}catch{if(ce.current!==`${e}|${t}`)return;I({kind:`error`,banner:a({id:`UVLlMV`})})}},Qr),()=>{se.current!==null&&(clearTimeout(se.current),se.current=null)}}},ge=[n,v,J,a],t[14]=a,t[15]=n,t[16]=J,t[17]=v,t[18]=X,t[19]=ge):(X=t[18],ge=t[19]),(0,Q.useEffect)(X,ge);let _e,ve;t[20]!==a||t[21]!==s||t[22]!==H?(_e=()=>{if(!H||!s)return;let e=!1;return(async()=>{try{let t=await Ir({kind:`doc`,docPath:Re(s)});if(e)return;t.ok?ie(t.shareUrl):oe(Lr(t.error,t.branch))}catch(t){let n=t;if(e)return;console.warn(`[share] action=prefetch-share-url result=failed`,n),oe(a({id:`J6N5MX`}))}})(),()=>{e=!0}},ve=[H,s,a],t[20]=a,t[21]=s,t[22]=H,t[23]=_e,t[24]=ve):(_e=t[23],ve=t[24]),(0,Q.useEffect)(_e,ve);let ye;t[25]===Y?ye=t[26]:(ye=function(){B(!1),_(null),Y()},t[25]=Y,t[26]=ye);let be=ye,xe=async function(){if(Zr({owner:de,sanitizedName:J,nameCheck:F,submitting:L})){z(!0),te(null);try{let e=await Yr({owner:v,name:J,visibility:C,description:M.trim().length>0?M.trim():void 0});if(e.ok){U({ownerLogin:e.ownerLogin,repoName:e.repoName}),z(!1);return}let t=Kr(e.error,v,J);te({message:t.banner,next:t.next}),t.next.kind===`edit-name`?(le.current?.focus(),le.current?.select()):t.next.kind===`reauth`&&B(!0)}catch{te({message:a({id:`UVLlMV`}),next:{kind:`edit-form`}})}z(!1)}},Se;t[27]!==a||t[28]!==W||t[29]!==r||t[30]!==K?(Se=function(){!K||W||(G(!0),p(K).then(()=>{q.success(a({id:`c1LZZH`})),r(!1)}).catch(e=>{if(console.warn(`[share] action=link-construct result=clipboard-failed`,e),m(e)&&window.self!==window.top){q.error(a({id:`Dub54T`}));return}q.error(a({id:`MQIM_Y`}))}).finally(()=>{G(!1)}))},t[27]=a,t[28]=W,t[29]=r,t[30]=K,t[31]=Se):Se=t[31];let Ce=Se,we;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(we=function(e){let t=window.okDesktop?.shell?.openExternal;t?t(e):window.open(e,`_blank`,`noopener`)},t[32]=we):we=t[32];let Te=we,Ee;t[33]===r?Ee=t[34]:(Ee=function(){r(!1)},t[33]=r,t[34]=Ee);let De=Ee,Oe=!Zr({owner:de,sanitizedName:J,nameCheck:F,submitting:L}),ke;t[35]!==a||t[36]!==s||t[37]!==ee||t[38]!==W||t[39]!==M||t[40]!==Te||t[41]!==De||t[42]!==Ce||t[43]!==xe||t[44]!==Y||t[45]!==x||t[46]!==F||t[47]!==c||t[48]!==g||t[49]!==f||t[50]!==H||t[51]!==J||t[52]!==v||t[53]!==K||t[54]!==ae||t[55]!==Oe||t[56]!==L||t[57]!==C?(ke=(0,$.jsx)(D,{className:`sm:max-w-lg`,showCloseButton:!1,children:H?(0,$.jsx)(ti,{ownerLogin:H.ownerLogin,repoName:H.repoName,shareUrl:K,shareUrlError:ae,copying:W,canCopy:s!==null,onCopy:Ce,onClose:De}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(A,{children:[(0,$.jsx)(E,{children:(0,$.jsx)(l,{id:`qXsafh`})}),(0,$.jsx)(T,{children:(0,$.jsx)(l,{id:`Z1LF1M`})})]}),(0,$.jsxs)(O,{className:`flex flex-col gap-6`,children:[(0,$.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(R,{id:`publish-owner-label`,children:(0,$.jsx)(l,{id:`LtI9AS`})}),f&&c===null?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,$.jsx)(je,{className:`size-3.5`,"aria-hidden":!0}),` `,(0,$.jsx)(l,{id:`Z3FXyt`})]}):g?(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsx)(`span`,{className:`text-sm text-destructive`,children:g}),(0,$.jsx)(b,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>Y(),children:(0,$.jsx)(l,{id:`6gRgw8`})})]}):(0,$.jsx)(V,{value:v,onValueChange:y,"aria-labelledby":`publish-owner-label`,"data-testid":`publish-owner-radio`,children:(c??[]).map(ei)})]}),(0,$.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(R,{htmlFor:`publish-name`,children:(0,$.jsx)(l,{id:`0xnmlQ`})}),(0,$.jsx)(Ye,{id:`publish-name`,ref:le,"data-testid":`publish-name`,value:x,onChange:e=>S(e.target.value),onBlur:()=>{ce.current=null},placeholder:`my-knowledge-base`,autoComplete:`off`,spellCheck:!1}),(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-1sm`,"aria-live":`polite`,children:[(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:J?(0,$.jsx)(l,{id:`Nn4GgW`,values:{sanitizedName:J},components:{0:(0,$.jsx)(`code`,{className:`font-mono`})}}):(0,$.jsx)(l,{id:`Oxyd5f`})}),(0,$.jsx)(oi,{status:F})]})]}),(0,$.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(R,{id:`publish-visibility-label`,children:(0,$.jsx)(l,{id:`2q_Q7x`})}),(0,$.jsxs)(V,{value:C,onValueChange:e=>w(e===`public`?`public`:`private`),className:`sm:flex`,"aria-labelledby":`publish-visibility-label`,children:[(0,$.jsx)(at,{htmlFor:`publish-visibility-private`,children:(0,$.jsxs)(ct,{orientation:`horizontal`,children:[(0,$.jsxs)(it,{children:[(0,$.jsx)(st,{children:(0,$.jsx)(l,{id:`zwBp5t`})}),(0,$.jsx)(ot,{className:`text-1sm`,children:(0,$.jsx)(l,{id:`D8OV7J`})})]}),(0,$.jsx)(re,{value:`private`,id:`publish-visibility-private`,"data-testid":`publish-visibility-private`})]})}),(0,$.jsx)(at,{htmlFor:`publish-visibility-public`,children:(0,$.jsxs)(ct,{orientation:`horizontal`,children:[(0,$.jsxs)(it,{children:[(0,$.jsx)(st,{children:(0,$.jsx)(l,{id:`7d1a0d`})}),(0,$.jsx)(ot,{className:`text-1sm`,children:(0,$.jsx)(l,{id:`4jDd0j`})})]}),(0,$.jsx)(re,{value:`public`,id:`publish-visibility-public`,"data-testid":`publish-visibility-public`})]})})]})]}),(0,$.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(R,{htmlFor:`publish-description`,children:(0,$.jsx)(l,{id:`Fxf4jq`})}),(0,$.jsx)(ut,{id:`publish-description`,"data-testid":`publish-description`,rows:2,value:M,onChange:e=>N(e.target.value),placeholder:a({id:`c5rF4v`})})]}),ee&&(0,$.jsx)(ai,{banner:ee,onAuthorize:Te,onRetryPush:xe})]}),(0,$.jsxs)(k,{children:[(0,$.jsx)(b,{type:`button`,variant:`outline`,className:`font-mono uppercase`,onClick:De,children:(0,$.jsx)(l,{id:`dEgA5A`})}),(0,$.jsx)(b,{type:`button`,onClick:xe,disabled:Oe,"data-testid":`publish-submit`,children:L?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(je,{className:`size-3.5`,"aria-hidden":!0}),` `,(0,$.jsx)(l,{id:`Bdha5y`})]}):(0,$.jsx)(l,{id:`EEYbdt`})})]})]})}),t[35]=a,t[36]=s,t[37]=ee,t[38]=W,t[39]=M,t[40]=Te,t[41]=De,t[42]=Ce,t[43]=xe,t[44]=Y,t[45]=x,t[46]=F,t[47]=c,t[48]=g,t[49]=f,t[50]=H,t[51]=J,t[52]=v,t[53]=K,t[54]=ae,t[55]=Oe,t[56]=L,t[57]=C,t[58]=ke):ke=t[58];let Ae;t[59]!==r||t[60]!==n||t[61]!==ke?(Ae=(0,$.jsx)(j,{open:n,onOpenChange:r,children:ke}),t[59]=r,t[60]=n,t[61]=ke,t[62]=Ae):Ae=t[62];let Me;t[63]!==ne||t[64]!==be?(Me=(0,$.jsx)(tn,{open:ne,onOpenChange:B,onSuccess:be}),t[63]=ne,t[64]=be,t[65]=Me):Me=t[65];let Ne;return t[66]!==Ae||t[67]!==Me?(Ne=(0,$.jsxs)($.Fragment,{children:[Ae,Me]}),t[66]=Ae,t[67]=Me,t[68]=Ne):Ne=t[68],Ne}function ei(e){let t=`publish-owner-${e.login}`;return(0,$.jsx)(at,{htmlFor:t,children:(0,$.jsxs)(ct,{orientation:`horizontal`,children:[(0,$.jsx)(it,{children:(0,$.jsxs)(st,{children:[e.avatarUrl?(0,$.jsx)(`img`,{src:e.avatarUrl,alt:``,"aria-hidden":!0,className:`size-4 rounded-full`}):null,(0,$.jsx)(`span`,{children:e.login})]})}),(0,$.jsx)(re,{value:e.login,id:t,"data-testid":`publish-owner-option-${e.login}`})]})},e.login)}function ti(e){let t=(0,Z.c)(36),{ownerLogin:n,repoName:r,shareUrl:i,shareUrlError:a,copying:s,canCopy:c,onCopy:d,onClose:f}=e,{_:p}=u(),m=(0,Q.useRef)(null),h,g;t[0]===i?(h=t[1],g=t[2]):(h=()=>{!i||!m.current||(m.current.focus(),m.current.select())},g=[i],t[0]=i,t[1]=h,t[2]=g),(0,Q.useEffect)(h,g);let _;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(E,{children:(0,$.jsx)(l,{id:`u3wRF-`})}),t[3]=_):_=t[3];let v;t[4]!==n||t[5]!==r?(v={ownerLogin:n,repoName:r},t[4]=n,t[5]=r,t[6]=v):v=t[6];let y;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(y={0:(0,$.jsx)(`code`,{className:`font-mono`})},t[7]=y):y=t[7];let x;t[8]===v?x=t[9]:(x=(0,$.jsxs)(A,{children:[_,(0,$.jsx)(T,{children:(0,$.jsx)(l,{id:`r871ed`,values:v,components:y})})]}),t[8]=v,t[9]=x);let S;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(Te,{className:`mt-0.5 size-4 text-emerald-600`,"aria-hidden":!0}),t[10]=S):S=t[10];let C;t[11]===c?C=t[12]:(C=(0,$.jsxs)(`div`,{role:`status`,"data-testid":`publish-success`,className:`flex items-start gap-3 rounded-md border border-emerald-500/40 bg-emerald-500/5 p-3 text-sm`,children:[S,(0,$.jsx)(`span`,{className:`text-foreground`,children:c?(0,$.jsx)(l,{id:`cOrTMo`}):(0,$.jsx)(l,{id:`nTwL53`})})]}),t[11]=c,t[12]=C);let w;t[13]!==c||t[14]!==i||t[15]!==a?(w=c&&(0,$.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(R,{htmlFor:`publish-share-url`,children:(0,$.jsx)(l,{id:`5-FeN2`})}),a?(0,$.jsx)(`div`,{role:`alert`,"data-testid":`publish-share-url-error`,className:`rounded-md border border-destructive/50 bg-destructive/5 p-2 text-sm text-destructive`,children:a}):i?(0,$.jsx)(Ye,{id:`publish-share-url`,ref:m,"data-testid":`publish-share-url`,readOnly:!0,value:i,onFocus:ii,onClick:ri,onContextMenu:ni,className:`font-mono text-xs`}):(0,$.jsxs)(`div`,{"data-testid":`publish-share-url-loading`,className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,$.jsx)(je,{className:`size-3.5`,"aria-hidden":!0}),` `,(0,$.jsx)(l,{id:`M9597s`})]})]}),t[13]=c,t[14]=i,t[15]=a,t[16]=w):w=t[16];let D;t[17]!==C||t[18]!==w?(D=(0,$.jsxs)(O,{className:`flex flex-col gap-4`,children:[C,w]}),t[17]=C,t[18]=w,t[19]=D):D=t[19];let j;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,$.jsx)(l,{id:`DPfwMq`}),t[20]=j):j=t[20];let M;t[21]===f?M=t[22]:(M=(0,$.jsx)(b,{type:`button`,variant:`outline`,className:`font-mono uppercase`,onClick:f,"data-testid":`publish-success-done`,children:j}),t[21]=f,t[22]=M);let N;t[23]!==p||t[24]!==c||t[25]!==s||t[26]!==d||t[27]!==i?(N=c&&(0,$.jsx)(b,{type:`button`,onClick:d,disabled:s||!i,"data-testid":`publish-copy-link`,"aria-label":p({id:`RGCCrg`}),children:s?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(je,{className:`size-3.5`,"aria-hidden":!0}),` `,(0,$.jsx)(l,{id:`OvEjsP`})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(o,{className:`size-3.5`,"aria-hidden":!0}),` `,(0,$.jsx)(l,{id:`RGCCrg`})]})}),t[23]=p,t[24]=c,t[25]=s,t[26]=d,t[27]=i,t[28]=N):N=t[28];let P;t[29]!==M||t[30]!==N?(P=(0,$.jsxs)(k,{children:[M,N]}),t[29]=M,t[30]=N,t[31]=P):P=t[31];let F;return t[32]!==D||t[33]!==P||t[34]!==x?(F=(0,$.jsxs)($.Fragment,{children:[x,D,P]}),t[32]=D,t[33]=P,t[34]=x,t[35]=F):F=t[35],F}function ni(e){return e.currentTarget.select()}function ri(e){return e.currentTarget.select()}function ii(e){return e.currentTarget.select()}function ai(e){let t=(0,Z.c)(13),{banner:r,onAuthorize:i,onRetryPush:a}=e,o=r.next,s;t[0]===r.message?s=t[1]:(s=(0,$.jsx)(`span`,{children:r.message}),t[0]=r.message,t[1]=s);let c;t[2]!==o.authorizeUrl||t[3]!==o.kind||t[4]!==i?(c=o.kind===`authorize-org`&&(0,$.jsxs)(b,{type:`button`,variant:`outline`,size:`sm`,className:`self-start`,"data-testid":`publish-authorize-org`,onClick:()=>i(o.authorizeUrl),children:[(0,$.jsx)(l,{id:`FyW0WO`}),` `,(0,$.jsx)(n,{className:`ml-1 size-3`,"aria-hidden":!0})]}),t[2]=o.authorizeUrl,t[3]=o.kind,t[4]=i,t[5]=c):c=t[5];let u;t[6]!==o.kind||t[7]!==a?(u=o.kind===`retry-push`&&(0,$.jsx)(b,{type:`button`,variant:`outline`,size:`sm`,className:`self-start`,"data-testid":`publish-retry-push`,onClick:a,children:(0,$.jsx)(l,{id:`NOHyEE`})}),t[6]=o.kind,t[7]=a,t[8]=u):u=t[8];let d;return t[9]!==s||t[10]!==c||t[11]!==u?(d=(0,$.jsxs)(`div`,{role:`alert`,"data-testid":`publish-banner`,className:`flex flex-col gap-2 rounded-md border border-destructive/50 bg-destructive/5 p-3 text-sm`,children:[s,c,u]}),t[9]=s,t[10]=c,t[11]=u,t[12]=d):d=t[12],d}function oi(e){let t=(0,Z.c)(12),{status:n}=e;if(n.kind===`available`){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Te,{className:`size-3.5`,"aria-hidden":!0}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsxs)(`span`,{"data-testid":`publish-name-check`,"data-status":`available`,className:`flex items-center gap-1 text-emerald-600 dark:text-emerald-400`,children:[e,` `,(0,$.jsx)(l,{id:`csDS2L`})]}),t[1]=n):n=t[1],n}if(n.kind===`taken`){let{owner:e,name:r}=n,i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(s,{className:`size-3.5`,"aria-hidden":!0}),t[2]=i):i=t[2];let a;return t[3]!==r||t[4]!==e?(a=(0,$.jsxs)(`span`,{"data-testid":`publish-name-check`,"data-status":`taken`,className:`flex items-center gap-1 text-destructive`,children:[i,` `,(0,$.jsx)(l,{id:`LRgZAt`,values:{owner:e,name:r}})]}),t[3]=r,t[4]=e,t[5]=a):a=t[5],a}if(n.kind===`checking`||n.kind===`pending`){let e;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(je,{className:`size-3.5`,"aria-hidden":!0}),t[6]=e):e=t[6];let r;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(l,{id:`pWT04I`}),t[7]=r):r=t[7];let i;return t[8]===n.kind?i=t[9]:(i=(0,$.jsxs)(`span`,{"data-testid":`publish-name-check`,"data-status":n.kind,className:`flex items-center gap-1 text-muted-foreground`,children:[e,` `,r]}),t[8]=n.kind,t[9]=i),i}if(n.kind===`error`){let e;return t[10]===n.banner?e=t[11]:(e=(0,$.jsx)(`span`,{"data-testid":`publish-name-check`,"data-status":`error`,className:`text-destructive`,children:n.banner}),t[10]=n.banner,t[11]=e),e}return null}var si=5e3,ci=3e4,li=0;function ui(){let e=Date.now();e-li<ci||(li=e,_e(`fetch`).catch(()=>{li===e&&(li=0)}))}async function di(){try{let e=await fetch(`/api/git/worktree-status`);return e.ok?await e.json():null}catch{return null}}function fi(e){let t=(0,Z.c)(6),[n,r]=(0,Q.useState)(null),i,a;t[0]===e?(i=t[1],a=t[2]):(i=()=>{if(!e)return;let t=!1,n=!1,i=!1;function a(){if(n){i=!0;return}n=!0,di().then(e=>{n=!1,!t&&e&&e.readable!==!1&&r(e),i&&!t&&(i=!1,a())})}a(),ui();let o=setInterval(a,si),s=fe(e=>{e.includes(`sync-status`)&&a()});return()=>{t=!0,clearInterval(o),s()}},a=[e],t[0]=e,t[1]=i,t[2]=a),(0,Q.useEffect)(i,a);let o=e&&n===null,s;return t[3]!==n||t[4]!==o?(s={status:n,loading:o},t[3]=n,t[4]=o,t[5]=s):s=t[5],s}async function pi(e){let t=await fetch(`/api/sync/resolve-blocking`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:e})});if(!t.ok)throw Error(`sync resolve-blocking failed: ${t.status}`)}function mi(){return typeof window<`u`&&window.okDesktop!=null}function hi(e){let t=(0,Z.c)(23),{paths:n}=e,[r,i]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(!1);if(n.length===0)return null;let s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=async function(e){i(e),o(!1);try{await pi(e),i(null)}catch{o(!0),i(null)}},t[0]=s):s=t[0];let c=s,u=r!==null,d;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(`span`,{id:`sync-blocking-heading`,className:`text-xs font-medium text-foreground`,children:(0,$.jsx)(l,{id:`sdvHp3`})}),t[1]=d):d=t[1];let f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[d,(0,$.jsx)(`span`,{className:`text-2xs text-muted-foreground`,children:(0,$.jsx)(l,{id:`H4doZt`})})]}),t[2]=f):f=t[2];let p;t[3]===n?p=t[4]:(p=n.map(_i),t[3]=n,t[4]=p);let m;t[5]===p?m=t[6]:(m=(0,$.jsx)(`ul`,{"aria-labelledby":`sync-blocking-heading`,className:`flex max-h-28 flex-col gap-1 overflow-y-auto overscroll-contain`,"data-testid":`sync-blocking-list`,children:p}),t[5]=p,t[6]=m);let h;t[7]===a?h=t[8]:(h=a&&(0,$.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,"data-testid":`sync-blocking-error`,children:(0,$.jsx)(l,{id:`FsEXax`})}),t[7]=a,t[8]=h);let g;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>void c(`commit`),t[9]=g):g=t[9];let _;t[10]===r?_=t[11]:(_=r===`commit`&&(0,$.jsx)(je,{"aria-hidden":`true`,"data-icon":`inline-start`}),t[10]=r,t[11]=_);let v;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(l,{id:`N7Lau6`}),t[12]=v):v=t[12];let y;t[13]!==u||t[14]!==_?(y=(0,$.jsxs)(b,{size:`xs`,disabled:u,onClick:g,"data-testid":`sync-blocking-commit`,children:[_,v]}),t[13]=u,t[14]=_,t[15]=y):y=t[15];let x;t[16]===u?x=t[17]:(x=mi()&&(0,$.jsxs)(b,{variant:`link-muted`,size:`xs`,className:`self-start p-0`,disabled:u,onClick:gi,"data-testid":`sync-blocking-terminal`,children:[(0,$.jsx)(De,{"data-icon":`inline-start`}),(0,$.jsx)(l,{id:`6EoD0z`})]}),t[16]=u,t[17]=x);let S;return t[18]!==y||t[19]!==x||t[20]!==m||t[21]!==h?(S=(0,$.jsxs)(`div`,{className:`flex flex-col gap-2 border-t pt-3`,children:[f,m,h,y,x]}),t[18]=y,t[19]=x,t[20]=m,t[21]=h,t[22]=S):S=t[22],S}function gi(){return dt(`git-status`)}function _i(e){return(0,$.jsx)(`li`,{title:e,className:`min-w-0 truncate font-mono text-2xs text-foreground`,children:e},e)}function vi(e=`sync`,t){_e(e).catch(e=>{console.warn(`[sync-badge] manual sync trigger failed`,e instanceof Error?e.message:e),t?.()})}function yi(e){typeof window>`u`||Be(window.location.hash,e)||(window.location.hash=e)}function bi(e){return e.kind===`doc`?Le(e.docName):Ie(e.path)}function xi(e){let t=Date.now()-new Date(e).getTime();if(t<6e4)return J._({id:`xOTzt5`});if(t<36e5){let e=Math.floor(t/6e4);return J._({id:`_rP3HI`,values:{minutes:e}})}if(t<864e5){let e=Math.floor(t/36e5);return J._({id:`nYeBmY`,values:{hours:e}})}return new Date(e).toLocaleDateString()}function Si(e){return e.syncMode===`follow`}function Ci(e){return e.state===`idle`&&e.conflictCount>0?`conflict`:e.state}function wi(e){let t=(0,Z.c)(12),{status:n}=e;switch(Ci(n)){case`dormant`:{let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(mt,{className:`size-3.5 text-muted-foreground`}),t[0]=e):e=t[0],e}case`idle`:{if(n.ahead>0||n.behind>0){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Me,{className:`size-3.5 text-muted-foreground`}),t[1]=e):e=t[1],e}let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(mt,{className:`size-3.5 text-muted-foreground`}),t[2]=e):e=t[2],e}case`fetching`:case`pulling`:case`pushing`:{let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(je,{"aria-hidden":`true`,icon:Me,className:`size-3.5 text-muted-foreground`}),t[3]=e):e=t[3],e}case`conflict`:{let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Pe,{className:`size-3.5 text-amber-500`}),t[4]=e):e=t[4],e}case`offline`:{let e;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(pt,{className:`size-3.5 text-muted-foreground`}),t[5]=e):e=t[5],e}case`auth-error`:{let e;return t[6]===n?e=t[7]:(e=ji(n)?(0,$.jsx)(ft,{className:`size-3.5 text-destructive`}):(0,$.jsx)(ht,{className:`size-3.5 text-destructive`}),t[6]=n,t[7]=e),e}case`disabled`:{if(n.pausedReason){let e;return t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Pe,{className:`size-3.5 text-amber-500`}),t[8]=e):e=t[8],e}if(n.ahead>0||n.behind>0){let e;return t[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Me,{className:`size-3.5 text-muted-foreground`}),t[9]=e):e=t[9],e}let e;return t[10]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(mt,{className:`size-3.5 text-muted-foreground`}),t[10]=e):e=t[10],e}default:{let e;return t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(mt,{className:`size-3.5 text-muted-foreground`}),t[11]=e):e=t[11],e}}}function Ti(e){switch(Ci(e)){case`idle`:return!Si(e)&&e.ahead>0?`↑${e.ahead}`:e.behind>0?`↓${e.behind}`:``;case`fetching`:case`pulling`:case`pushing`:return``;case`conflict`:return e.conflictCount>0?`${e.conflictCount}`:``;case`offline`:return``;case`auth-error`:return``;default:return``}}function Ei(e){let t=Si(e),n=Ci(e);switch(n){case`dormant`:return J._({id:`RmBY0A`});case`idle`:return t?J._({id:`j5CWO4`}):J._({id:`N2FcBE`});case`fetching`:return t?J._({id:`7IsvrP`}):J._({id:`Wgmlsw`});case`pulling`:return t?J._({id:`JL3si7`}):J._({id:`4uNLmk`});case`pushing`:return J._({id:`iycx_A`});case`conflict`:return J._({id:`IInnZo`});case`offline`:return J._({id:`6Aih4U`});case`auth-error`:return J._({id:`mHVPm5`});case`disabled`:return e.pausedReason?J._({id:`U6wmNc`}):J._({id:`BWTzAb`});default:return n}}function Di(e){switch(e){case`external-changes-pending`:return J._({id:`W9_Bub`});case`dirty-tree`:return J._({id:`a5Gha5`});case`non-content-merge-failure`:return J._({id:`sIxSSP`});case`detached-head`:return J._({id:`uQNW00`});case`diverged-local-commits`:return J._({id:`LQsCPn`});case`auth-error`:return J._({id:`mHVPm5`});case`protected-branch`:return J._({id:`8fc_3j`});case`no-push-permission`:return J._({id:`EiVgl5`});default:return e}}function Oi(e,t){let n=[];switch(e){case`not-authenticated`:n.push(J._({id:`ycIX5i`}));break;case`no-collaborator`:n.push(J._({id:`EiVgl5`}));break;case`private-no-access`:n.push(J._({id:`07gHun`}));break;case`repo-not-found`:n.push(J._({id:`uksqrP`}));break;default:n.push(J._({id:`EiVgl5`}))}return n.push(...ki(t)),n}function ki(e){let t=[];if(e?.resolvedLogin){let n=e.resolvedLogin;t.push(J._({id:`ZKVuLY`,values:{login:n}}))}return e?.declaredLogin&&t.push(Ai(e.declaredLogin,e.declaredSource)),t}function Ai(e,t){switch(t){case`remote-url`:return J._({id:`CMd-g-`,values:{declaredLogin:e}});case`credential-config`:return J._({id:`akOe4q`,values:{declaredLogin:e}});default:return J._({id:`GBEqoP`,values:{declaredLogin:e}})}}function ji(e){return e.pushErrorCode===`auth-not-found-as-identity`||e.pullErrorCode===`auth-not-found-as-identity`}function Mi(e){return e?.pausedReason===`auth-error`&&ji(e)}function Ni(e){return e?.checkStatus===`denied`&&e.deniedReason===`not-authenticated`}function Pi(e){switch(e){case`auth-403`:return J._({id:`EiVgl5`});case`auth-401`:return J._({id:`-Qw-1t`});case`auth-scope-mismatch`:return J._({id:`Zue_jx`});case`auth-no-credential`:return J._({id:`uCaIdy`});case`semantic-protected-branch`:return J._({id:`T0OVm7`});case`auth-not-found-as-identity`:return J._({id:`jRsjlF`});default:return J._({id:`1AumWo`})}}function Fi(e){switch(e){case`auth-403`:return J._({id:`RgbKEe`});case`auth-401`:return J._({id:`-Qw-1t`});case`auth-scope-mismatch`:return J._({id:`Zue_jx`});case`auth-no-credential`:return J._({id:`uCaIdy`});case`auth-not-found-as-identity`:return J._({id:`jRsjlF`});default:return J._({id:`jZ_E5M`})}}function Ii(e){switch(e){case`auth-403`:return J._({id:`RgbKEe`});case`auth-401`:return J._({id:`-Qw-1t`});case`auth-scope-mismatch`:return J._({id:`Zue_jx`});case`auth-no-credential`:return J._({id:`uCaIdy`});case`semantic-protected-branch`:return J._({id:`T0OVm7`});case`auth-not-found-as-identity`:return J._({id:`jRsjlF`});default:return J._({id:`cUk6TF`})}}function Li(e){let t=e.pushErrorCode!=null||e.pushError!=null,n=e.pullErrorCode!=null||e.pullError!=null;if(t&&n&&(e.pushErrorCode==null?e.pullErrorCode==null&&e.pushError===e.pullError:e.pushErrorCode===e.pullErrorCode))return[{key:`sync`,direction:null,message:e.pushErrorCode==null?e.pushError:Ii(e.pushErrorCode)}];let r=t&&n,i=[];return t&&i.push({key:`push`,direction:r?`push`:null,message:e.pushErrorCode?Pi(e.pushErrorCode):e.pushError}),n&&i.push({key:`pull`,direction:r?`pull`:null,message:e.pullErrorCode?Fi(e.pullErrorCode):e.pullError}),i}function Ri(e){return e?.checkStatus===`unknown`&&e.unknownError===`token-invalid`}function zi(e){return Ci(e)===`auth-error`&&ji(e)?J._({id:`EkEFE3`}):Ei(e)}function Bi(e){let t=Si(e),n=Ci(e);if(n===`conflict`&&e.conflictCount>0){let{conflictCount:t}=e;return J._({id:`cUK8lW`,values:{conflictCount:t}})}if(n===`idle`){let{ahead:n,behind:r}=e;return t?r>0?J._({id:`9o1bIV`,values:{behind:r}}):J._({id:`j5CWO4`}):n>0&&r>0?J._({id:`5F5HYj`,values:{ahead:n,behind:r}}):n>0?J._({id:`PdA9NZ`,values:{ahead:n}}):r>0?J._({id:`9o1bIV`,values:{behind:r}}):J._({id:`N2FcBE`})}return zi(e)}function Vi(e){let t=(0,Z.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,$.jsx)(`span`,{className:`font-mono uppercase tracking-wide text-2xs text-muted-foreground`,children:n}),t[0]=n,t[1]=r),r}function Hi(e){switch(e){case`M`:return J._({id:`tgWuMB`});case`A`:return J._({id:`hp8OtS`});case`D`:return J._({id:`vGjmyl`});case`R`:return J._({id:`QeREu8`});case`C`:return J._({id:`6V3Ea3`});case`U`:return J._({id:`cyoNqf`});case`T`:return J._({id:`zWZBPx`});case`?`:return J._({id:`C2abof`});case`!`:return J._({id:`xDKOFk`});default:return J._({id:`cNsIJf`})}}function Ui(e){switch(e){case`D`:return`destructive`;case`U`:return`warning`;default:return`gray`}}function Wi(e){let t=(0,Z.c)(24),{entry:n,dimmed:r}=e,i;t[0]===n.code?i=t[1]:(i=Hi(n.code),t[0]=n.code,t[1]=i);let a=i,o=n.open,s=`truncate font-mono text-2xs ${r?`text-muted-foreground/60`:`text-foreground`}`,c;t[2]===n.code?c=t[3]:(c=Ui(n.code),t[2]=n.code,t[3]=c);let l;t[4]===n.code?l=t[5]:(l=(0,$.jsx)(`span`,{"aria-hidden":!0,children:n.code}),t[4]=n.code,t[5]=l);let u;t[6]===a?u=t[7]:(u=(0,$.jsx)(`span`,{className:`sr-only`,children:a}),t[6]=a,t[7]=u);let d;t[8]!==c||t[9]!==l||t[10]!==u?(d=(0,$.jsx)(S,{asChild:!0,children:(0,$.jsxs)(tt,{variant:c,className:`size-4 shrink-0 justify-center p-0 text-2xs leading-none`,children:[l,u]})}),t[8]=c,t[9]=l,t[10]=u,t[11]=d):d=t[11];let f;t[12]===a?f=t[13]:(f=(0,$.jsx)(C,{children:a}),t[12]=a,t[13]=f);let p;t[14]!==d||t[15]!==f?(p=(0,$.jsxs)(w,{children:[d,f]}),t[14]=d,t[15]=f,t[16]=p):p=t[16];let m;t[17]!==n.path||t[18]!==o||t[19]!==s?(m=o?(0,$.jsx)(Qe,{asChild:!0,children:(0,$.jsx)(b,{variant:`link`,size:`xs`,className:`h-auto min-h-6 min-w-0 shrink justify-start overflow-hidden p-0 font-normal`,onClick:()=>yi(bi(o)),"data-testid":`worktree-row-open`,children:(0,$.jsx)(`span`,{title:n.path,className:`min-w-0 ${s}`,children:n.path})})}):(0,$.jsx)(`span`,{title:n.path,className:s,children:n.path}),t[17]=n.path,t[18]=o,t[19]=s,t[20]=m):m=t[20];let h;return t[21]!==p||t[22]!==m?(h=(0,$.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2`,children:[p,m]}),t[21]=p,t[22]=m,t[23]=h):h=t[23],h}function Gi(e){let t=(0,Z.c)(15),{title:n,note:r,entries:i,dimmed:a}=e,o=a===void 0?!1:a;if(i.length===0)return null;let s;t[0]===n?s=t[1]:(s=(0,$.jsx)(`span`,{className:`text-2xs font-medium text-muted-foreground`,children:n}),t[0]=n,t[1]=s);let c;t[2]===r?c=t[3]:(c=r&&(0,$.jsx)(`span`,{className:`text-2xs text-muted-foreground/80`,children:r}),t[2]=r,t[3]=c);let l;if(t[4]!==o||t[5]!==i){let e;t[7]===o?e=t[8]:(e=e=>(0,$.jsx)(Wi,{entry:e,dimmed:o},`${e.code}:${e.path}`),t[7]=o,t[8]=e),l=i.map(e),t[4]=o,t[5]=i,t[6]=l}else l=t[6];let u;t[9]===l?u=t[10]:(u=(0,$.jsx)(`ul`,{className:`flex flex-col gap-1`,children:l}),t[9]=l,t[10]=u);let d;return t[11]!==s||t[12]!==c||t[13]!==u?(d=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[s,c,u]}),t[11]=s,t[12]=c,t[13]=u,t[14]=d):d=t[14],d}function Ki(e){let t=(0,Z.c)(9),{direction:n,count:r}=e,{_:i}=u();if(r<=0)return null;let a;t[0]===n?a=t[1]:(a=n===`behind`?(0,$.jsx)(Se,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":!0}):(0,$.jsx)(xe,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":!0}),t[0]=n,t[1]=a);let o;t[2]!==i||t[3]!==r||t[4]!==n?(o=i(n===`behind`?{id:`sKHiNR`,values:{count:r}}:{id:`9ZxzfT`,values:{count:r}}),t[2]=i,t[3]=r,t[4]=n,t[5]=o):o=t[5];let s;return t[6]!==a||t[7]!==o?(s=(0,$.jsxs)(`span`,{className:`flex flex-1 items-center gap-1.5 rounded-md bg-muted px-2 py-1 text-xs text-foreground`,children:[a,o]}),t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function qi(e){let t=new Set,n=[],r=[];for(let i of[...e.staged,...e.notStaged,...e.untracked])t.has(i.path)||(t.add(i.path),(i.syncScoped?n:r).push(i));return{willPush:n,wontPush:r}}function Ji(e){let t=(0,Z.c)(24),{status:n,worktree:r,loading:i}=e,a;t[0]===r?a=t[1]:(a=r?qi(r):{willPush:[],wontPush:[]},t[0]=r,t[1]=a);let{willPush:o,wontPush:s}=a,c;t[2]===r?.incoming?c=t[3]:(c=r?.incoming??[],t[2]=r?.incoming,t[3]=c);let u=c,d=r!==null&&r.readable===!1,f=r!==null&&o.length===0&&s.length===0&&u.length===0,p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(Vi,{children:(0,$.jsx)(l,{id:`uAQUqI`})}),t[4]=p):p=t[4];let m;t[5]===r?m=t[6]:(m=r&&(r.branch||r.detached)&&(0,$.jsx)(`span`,{className:`min-w-0 truncate font-mono text-2xs text-muted-foreground`,children:r.detached?(0,$.jsx)(l,{id:`OBdkpo`}):r.upstream?`${r.branch} → ${r.upstream}`:r.branch}),t[5]=r,t[6]=m);let h;t[7]===m?h=t[8]:(h=(0,$.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[p,m]}),t[7]=m,t[8]=h);let g;t[9]!==n.ahead||t[10]!==n.behind?(g=(n.behind>0||n.ahead>0)&&(0,$.jsxs)(`div`,{className:`flex items-stretch gap-2`,children:[(0,$.jsx)(Ki,{direction:`behind`,count:n.behind}),(0,$.jsx)(Ki,{direction:`ahead`,count:n.ahead})]}),t[9]=n.ahead,t[10]=n.behind,t[11]=g):g=t[11];let _;t[12]!==f||t[13]!==u||t[14]!==i||t[15]!==d||t[16]!==o||t[17]!==s||t[18]!==r?(_=i?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,$.jsx)(l,{id:`eolhcI`})}):d?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`worktree-unreadable`,children:(0,$.jsx)(l,{id:`L9ox9k`})}):f?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,$.jsx)(l,{id:`WfcERq`})}):r&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[(0,$.jsx)(Gi,{title:(0,$.jsx)(l,{id:`NcwbBM`}),entries:u}),(0,$.jsx)(Gi,{title:(0,$.jsx)(l,{id:`JOhCT9`}),entries:o}),(0,$.jsx)(Gi,{title:(0,$.jsx)(l,{id:`vsFXfP`}),note:(0,$.jsx)(l,{id:`PxZCNM`}),entries:s,dimmed:!0}),r.truncated&&(0,$.jsx)(`p`,{className:`text-2xs text-muted-foreground`,children:(0,$.jsx)(l,{id:`KvwJv8`})})]}),t[12]=f,t[13]=u,t[14]=i,t[15]=d,t[16]=o,t[17]=s,t[18]=r,t[19]=_):_=t[19];let v;return t[20]!==h||t[21]!==g||t[22]!==_?(v=(0,$.jsxs)(`div`,{className:`flex flex-col gap-2.5 border-t pt-3`,children:[h,g,_]}),t[20]=h,t[21]=g,t[22]=_,t[23]=v):v=t[23],v}function Yi(e){let t=(0,Z.c)(19),{pulledAt:n,pushedAt:r,combinedAt:i}=e,{_:a}=u(),o,s,c;if(t[0]!==a||t[1]!==i||t[2]!==n||t[3]!==r){o=n===null?null:xi(n),s=r===null?null:xi(r);let e=i===null?null:xi(i);c=o!==null&&s!==null?a({id:`1TA-aJ`,values:{pulled:o,pushed:s}}):o===null?s===null?e===null?null:a({id:`irnKr_`,values:{updatedRelative:e}}):a({id:`lPkjpD`,values:{pushed:s}}):a({id:`xW5AUw`,values:{pulled:o}}),t[0]=a,t[1]=i,t[2]=n,t[3]=r,t[4]=o,t[5]=s,t[6]=c}else o=t[4],s=t[5],c=t[6];let l=c,d=o!==null||s!==null;if(l===null){let e;return t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`span`,{}),t[7]=e):e=t[7],e}let f;t[8]!==l||t[9]!==d?(f=d&&(0,$.jsx)(`span`,{className:`sr-only`,"data-testid":`sync-popover-last-sync-label`,children:l}),t[8]=l,t[9]=d,t[10]=f):f=t[10];let p;t[11]!==l||t[12]!==o||t[13]!==s||t[14]!==d?(p=d?(0,$.jsxs)(`span`,{"aria-hidden":`true`,className:`inline-flex items-center gap-1`,children:[o!==null&&(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,$.jsx)(Se,{className:`size-3`}),o]}),o!==null&&s!==null&&(0,$.jsx)(`span`,{children:`·`}),s!==null&&(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,$.jsx)(xe,{className:`size-3`}),s]})]}):(0,$.jsx)(`span`,{"aria-hidden":`true`,children:l}),t[11]=l,t[12]=o,t[13]=s,t[14]=d,t[15]=p):p=t[15];let m;return t[16]!==f||t[17]!==p?(m=(0,$.jsxs)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`sync-popover-last-sync`,children:[f,p]}),t[16]=f,t[17]=p,t[18]=m):m=t[18],m}function Xi(e){let t=(0,Z.c)(145),{status:n,onSignIn:r,onSetIdentity:i}=e,{_:o}=u(),{conflictCount:s}=n,{projectLocalConfig:c,projectLocalSynced:d}=pe(),f=c?.autoSync,{mode:p,confirmOpen:m,setConfirmOpen:h,pendingMode:g,strandedCommitCount:_,onModeSelect:v,onConfirm:y}=ve(f,n.ahead),{status:x,loading:S}=fi(!0),C=p===`follow`,w;t[0]===n?w=t[1]:(w=Ci(n),t[0]=n,t[1]=w);let T=w,E;t[2]===n?E=t[3]:(E=ji(n),t[2]=n,t[3]=E);let D=E,O=n.lastPullOkUtc??null,k=n.lastPushOkUtc??null,A=n.lastRunUtc??n.lastSyncUtc??null,j=n.pushPermission?.checkStatus===`denied`&&n.pushPermission.deniedReason!==`not-authenticated`&&!D,M=!j,N=T===`fetching`||T===`pulling`||T===`pushing`,[P,F]=(0,Q.useState)(null),I,L;t[4]===N?(I=t[5],L=t[6]):(I=()=>{N||F(null)},L=[N],t[4]=N,t[5]=I,t[6]=L),(0,Q.useEffect)(I,L);let R;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>{F(t=>t===e?null:t)},t[7]=R):R=t[7];let re=R,V=N?P??(T===`pushing`?`push`:`pull`):null,H;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(H=e=>{F(e),vi(e,()=>re(e))},t[8]=H):H=t[8];let U=H,W=T===`dormant`||T===`auth-error`||n.state===`conflict`,G=W||n.conflictCount>0,K;t[9]===n.blockingPaths?K=t[10]:(K=n.blockingPaths??[],t[9]=n.blockingPaths,t[10]=K);let ie=K,{conflicts:ae}=xr(),oe=ae[0]??null,se=T===`conflict`&&oe!==null,le;t[11]===n?le=t[12]:(le=(0,$.jsx)(wi,{status:n}),t[11]=n,t[12]=le);let q;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,$.jsx)(`span`,{className:`text-1sm font-medium`,children:(0,$.jsx)(l,{id:`yZepkk`})}),t[13]=q):q=t[13];let ue;t[14]===le?ue=t[15]:(ue=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[le,q]}),t[14]=le,t[15]=ue);let J;t[16]!==o||t[17]!==n.remote?(J=n.remote&&(n.remote.webUrl?(0,$.jsxs)(`a`,{href:n.remote.webUrl,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex min-w-0 items-center gap-0.5 text-xs text-foreground hover:text-primary hover:underline`,"aria-label":o({id:`1nke1r`,values:{0:n.remote.label}}),children:[(0,$.jsx)(`span`,{className:`truncate`,children:n.remote.label}),(0,$.jsx)(Ce,{className:`size-3.5 shrink-0`,"aria-hidden":!0})]}):(0,$.jsx)(`span`,{className:`min-w-0 truncate text-xs text-foreground`,children:n.remote.label})),t[16]=o,t[17]=n.remote,t[18]=J):J=t[18];let de;t[19]!==ue||t[20]!==J?(de=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[ue,J]}),t[19]=ue,t[20]=J,t[21]=de):de=t[21];let fe=g??`full`,Y;t[22]!==m||t[23]!==y||t[24]!==h||t[25]!==_||t[26]!==fe?(Y=(0,$.jsx)(ye,{open:m,onOpenChange:h,onConfirm:y,variant:fe,strandedCommitCount:_}),t[22]=m,t[23]=y,t[24]=h,t[25]=_,t[26]=fe,t[27]=Y):Y=t[27];let me;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,$.jsx)(Vi,{children:(0,$.jsx)(l,{id:`CnOGgs`})}),t[28]=me):me=t[28];let he;t[29]===v?he=t[30]:(he=e=>{ce(e)&&v(e)},t[29]=v,t[30]=he);let X=!d,ge;t[31]===o?ge=t[32]:(ge=o({id:`CnOGgs`}),t[31]=o,t[32]=ge);let _e;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(_e=(0,$.jsx)(ne,{}),t[33]=_e):_e=t[33];let be;t[34]===ge?be=t[35]:(be=(0,$.jsx)(te,{size:`sm`,className:`w-full text-xs`,"aria-label":ge,"data-testid":`sync-mode-select`,children:_e}),t[34]=ge,t[35]=be);let we;t[36]===o?we=t[37]:(we=o({id:`BWTzAb`}),t[36]=o,t[37]=we);let Te;t[38]===we?Te=t[39]:(Te=(0,$.jsx)(z,{value:`off`,className:`text-xs`,children:we}),t[38]=we,t[39]=Te);let Ee;t[40]===o?Ee=t[41]:(Ee=o({id:`tlGXxX`}),t[40]=o,t[41]=Ee);let De;t[42]===Ee?De=t[43]:(De=(0,$.jsx)(z,{value:`follow`,className:`text-xs`,children:Ee}),t[42]=Ee,t[43]=De);let Oe;t[44]===o?Oe=t[45]:(Oe=o({id:`IXiG0B`}),t[44]=o,t[45]=Oe);let ke;t[46]!==j||t[47]!==Oe?(ke=(0,$.jsx)(z,{value:`full`,className:`text-xs`,disabled:j,children:Oe}),t[46]=j,t[47]=Oe,t[48]=ke):ke=t[48];let Ae;t[49]!==Te||t[50]!==De||t[51]!==ke?(Ae=(0,$.jsxs)(ee,{children:[Te,De,ke]}),t[49]=Te,t[50]=De,t[51]=ke,t[52]=Ae):Ae=t[52];let Ne;t[53]!==p||t[54]!==he||t[55]!==X||t[56]!==be||t[57]!==Ae?(Ne=(0,$.jsxs)(B,{value:p,onValueChange:he,disabled:X,children:[be,Ae]}),t[53]=p,t[54]=he,t[55]=X,t[56]=be,t[57]=Ae,t[58]=Ne):Ne=t[58];let Pe;t[59]===p?Pe=t[60]:(Pe=(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`sync-popover-mode-line`,children:p===`off`?(0,$.jsx)(l,{id:`qD3krc`}):p===`follow`?(0,$.jsx)(l,{id:`PGRnbw`}):(0,$.jsx)(l,{id:`zBiFZh`})}),t[59]=p,t[60]=Pe);let Fe;t[61]!==Ne||t[62]!==Pe?(Fe=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[me,Ne,Pe]}),t[61]=Ne,t[62]=Pe,t[63]=Fe):Fe=t[63];let Ie;t[64]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=(0,$.jsx)(Vi,{children:(0,$.jsx)(l,{id:`BWTzAb`})}),t[64]=Ie):Ie=t[64];let Re=N||W,Be;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(Be=()=>U(`pull`),t[65]=Be):Be=t[65];let Ve;t[66]===V?Ve=t[67]:(Ve=V===`pull`?(0,$.jsx)(je,{"aria-hidden":`true`,"data-icon":`inline-start`}):(0,$.jsx)(Se,{"data-icon":`inline-start`}),t[66]=V,t[67]=Ve);let He;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(He=(0,$.jsx)(l,{id:`e4GHWP`}),t[68]=He):He=t[68];let Ue;t[69]!==Re||t[70]!==Ve?(Ue=(0,$.jsxs)(b,{variant:`outline`,size:`xs`,className:`flex-1`,disabled:Re,onClick:Be,"data-testid":`sync-popover-pull`,children:[Ve,He]}),t[69]=Re,t[70]=Ve,t[71]=Ue):Ue=t[71];let We;t[72]!==N||t[73]!==M||t[74]!==G||t[75]!==V?(We=M&&(0,$.jsxs)(b,{variant:`outline`,size:`xs`,className:`flex-1`,disabled:N||G,onClick:()=>U(`push`),"data-testid":`sync-popover-push`,children:[V===`push`?(0,$.jsx)(je,{"aria-hidden":`true`,"data-icon":`inline-start`}):(0,$.jsx)(xe,{"data-icon":`inline-start`}),(0,$.jsx)(l,{id:`uO9WLl`})]}),t[72]=N,t[73]=M,t[74]=G,t[75]=V,t[76]=We):We=t[76];let Ge;t[77]!==Ue||t[78]!==We?(Ge=(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[Ue,We]}),t[77]=Ue,t[78]=We,t[79]=Ge):Ge=t[79];let Ke;t[80]!==N||t[81]!==M||t[82]!==G||t[83]!==V?(Ke=M&&(0,$.jsxs)(b,{size:`xs`,className:`w-full`,disabled:N||G,onClick:()=>U(`sync`),"data-testid":`sync-popover-sync`,children:[V===`sync`?(0,$.jsx)(je,{"aria-hidden":`true`,icon:Me,"data-icon":`inline-start`}):(0,$.jsx)(Me,{"data-icon":`inline-start`}),(0,$.jsx)(l,{id:`YEzhIr`})]}),t[80]=N,t[81]=M,t[82]=G,t[83]=V,t[84]=Ke):Ke=t[84];let qe;t[85]!==Ge||t[86]!==Ke?(qe=(0,$.jsxs)(`div`,{className:`flex flex-col gap-2 border-t pt-3`,children:[Ie,Ge,Ke]}),t[85]=Ge,t[86]=Ke,t[87]=qe):qe=t[87];let Je;if(t[88]!==o||t[89]!==n){let e;t[91]===o?e=t[92]:(e=e=>(0,$.jsx)(`p`,{className:`text-xs text-destructive`,children:e.direction===`push`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`span`,{className:`font-medium`,children:[o({id:`uO9WLl`}),`: `]}),e.message]}):e.direction===`pull`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`span`,{className:`font-medium`,children:[o({id:`e4GHWP`}),`: `]}),e.message]}):e.message},e.key),t[91]=o,t[92]=e),Je=Li(n).map(e),t[88]=o,t[89]=n,t[90]=Je}else Je=t[90];let Ye;t[93]===n?Ye=t[94]:(Ye=Mi(n)&&n.pushPermission?.checkStatus===`denied`?ki(n.pushPermission).map(ea):null,t[93]=n,t[94]=Ye);let Xe;t[95]!==n.pausedReason||t[96]!==n.pushPermission?(Xe=n.pausedReason===`no-push-permission`&&n.pushPermission?.checkStatus===`denied`?ki(n.pushPermission).map($i):null,t[95]=n.pausedReason,t[96]=n.pushPermission,t[97]=Xe):Xe=t[97];let Ze;t[98]!==Je||t[99]!==Ye||t[100]!==Xe?(Ze=(0,$.jsxs)(`div`,{role:`status`,"aria-live":`polite`,className:`flex flex-col gap-3.5 empty:sr-only`,children:[Je,Ye,Xe]}),t[98]=Je,t[99]=Ye,t[100]=Xe,t[101]=Ze):Ze=t[101];let $e;t[102]!==ie||t[103]!==C||t[104]!==j||t[105]!==r||t[106]!==n?($e=!C&&Ni(n.pushPermission)?(0,$.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,$.jsx)(`p`,{className:`min-w-0 flex-1 text-xs text-muted-foreground`,children:(0,$.jsx)(l,{id:`ycIX5i`})}),r&&(0,$.jsx)(b,{variant:`outline`,size:`xs`,className:`self-start`,onClick:r,children:(0,$.jsx)(l,{id:`5lWFkC`})})]}):ie.length>0?(0,$.jsx)(hi,{paths:ie}):Mi(n)?null:n.pausedReason?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:Di(n.pausedReason)}):!C&&j&&n.pushPermission?.checkStatus===`denied`?Oi(n.pushPermission.deniedReason,n.pushPermission).map(Qi):Ri(n.pushPermission)?(0,$.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,$.jsx)(`p`,{className:`min-w-0 flex-1 text-xs text-muted-foreground`,children:(0,$.jsx)(l,{id:`C_cPoW`})}),r&&(0,$.jsx)(b,{variant:`outline`,size:`xs`,className:`self-start`,onClick:r,children:(0,$.jsx)(l,{id:`5lWFkC`})})]}):null,t[102]=ie,t[103]=C,t[104]=j,t[105]=r,t[106]=n,t[107]=$e):$e=t[107];let et;t[108]!==oe||t[109]!==se||t[110]!==T?(et=T===`conflict`&&(0,$.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,$.jsx)(`p`,{className:`min-w-0 flex-1 text-xs text-amber-700 dark:text-amber-400`,children:(0,$.jsx)(l,{id:`ko386X`})}),se&&oe&&(0,$.jsx)(b,{variant:`outline`,size:`xs`,className:`self-start`,onClick:()=>yi(Le(ze(oe.file))),children:(0,$.jsx)(l,{id:`5k0NLb`})})]}),t[108]=oe,t[109]=se,t[110]=T,t[111]=et):et=t[111];let tt;t[112]!==r||t[113]!==T||t[114]!==n?(tt=T===`auth-error`&&!Mi(n)&&r&&(0,$.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,$.jsx)(`p`,{className:`min-w-0 flex-1 text-xs text-destructive`,children:(0,$.jsx)(l,{id:`Vl1H8I`})}),(0,$.jsx)(b,{variant:`outline`,size:`xs`,className:`self-start`,onClick:r,children:(0,$.jsx)(l,{id:`5lWFkC`})})]}),t[112]=r,t[113]=T,t[114]=n,t[115]=tt):tt=t[115];let nt;t[116]===s?nt=t[117]:(nt=s>0&&(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,$.jsx)(l,{id:`B4_ipX`,values:{conflictCount:s}})}),t[116]=s,t[117]=nt);let rt;t[118]!==n||t[119]!==x||t[120]!==S?(rt=(0,$.jsx)(Ji,{status:n,worktree:x,loading:S}),t[118]=n,t[119]=x,t[120]=S,t[121]=rt):rt=t[121];let it;t[122]!==A||t[123]!==O||t[124]!==k?(it=(0,$.jsx)(Yi,{pulledAt:O,pushedAt:k,combinedAt:A}),t[122]=A,t[123]=O,t[124]=k,t[125]=it):it=t[125];let at;t[126]===Symbol.for(`react.memo_cache_sentinel`)?(at=(0,$.jsx)(Qe,{asChild:!0,children:(0,$.jsxs)(b,{variant:`link`,size:`xs`,className:`h-auto p-0 text-xs text-muted-foreground hover:font-medium hover:text-foreground hover:no-underline`,onClick:Zi,"data-testid":`sync-popover-settings`,children:[(0,$.jsx)(a,{"data-icon":`inline-start`}),(0,$.jsx)(l,{id:`VNgKZz`})]})}),t[126]=at):at=t[126];let ot;t[127]===it?ot=t[128]:(ot=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[it,at]}),t[127]=it,t[128]=ot);let st;t[129]!==i||t[130]!==n.identityUnresolved?(st=n.identityUnresolved&&i&&(0,$.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-dashed p-2`,children:[(0,$.jsx)(_t,{className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground`}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,$.jsx)(`p`,{className:`text-xs leading-snug text-muted-foreground`,children:(0,$.jsx)(l,{id:`nrGWJ7`})}),(0,$.jsx)(b,{variant:`outline`,size:`xs`,className:`self-start`,onClick:i,children:(0,$.jsx)(l,{id:`keNFEd`})})]})]}),t[129]=i,t[130]=n.identityUnresolved,t[131]=st):st=t[131];let ct;return t[132]!==de||t[133]!==Y||t[134]!==Fe||t[135]!==qe||t[136]!==Ze||t[137]!==$e||t[138]!==et||t[139]!==tt||t[140]!==nt||t[141]!==rt||t[142]!==ot||t[143]!==st?(ct=(0,$.jsxs)(`div`,{className:`flex flex-col gap-3.5`,children:[de,Y,Fe,qe,Ze,$e,et,tt,nt,rt,ot,st]}),t[132]=de,t[133]=Y,t[134]=Fe,t[135]=qe,t[136]=Ze,t[137]=$e,t[138]=et,t[139]=tt,t[140]=nt,t[141]=rt,t[142]=ot,t[143]=st,t[144]=ct):ct=t[144],ct}function Zi(){return ue({advanced:!0})}function Qi(e){return(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e},e)}function $i(e){return(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e},e)}function ea(e){return(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e},e)}function ta(e){let t=(0,Z.c)(68),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{onSignIn:r,onSetIdentity:i}=n,{_:a}=u(),{status:o,fetchError:s}=ge();if(!o){if(s){let e;t[2]===a?e=t[3]:(e=a({id:`iqIDv4`}),t[2]=a,t[3]=e);let n;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(pt,{className:`size-3.5`}),t[4]=n):n=t[4];let r;t[5]===e?r=t[6]:(r=(0,$.jsx)(S,{asChild:!0,children:(0,$.jsx)(b,{variant:`ghost`,size:`icon-sm`,className:`text-muted-foreground`,"aria-label":e,disabled:!0,children:n})}),t[5]=e,t[6]=r);let i;t[7]===s?i=t[8]:(i=(0,$.jsx)(C,{children:s===`network`?(0,$.jsx)(l,{id:`I5AfhE`}):(0,$.jsx)(l,{id:`uKRYiW`})}),t[7]=s,t[8]=i);let o;return t[9]!==r||t[10]!==i?(o=(0,$.jsxs)(w,{children:[r,i]}),t[9]=r,t[10]=i,t[11]=o):o=t[11],o}return null}if(!o.hasRemote)return null;let c;t[12]===o?c=t[13]:(c=Ti(o),t[12]=o,t[13]=c);let d=c,f,p,m,h,g,_,v,y,x,T,E,D;if(t[14]!==a||t[15]!==o){let e=zi(o);_=!!o.identityUnresolved,g=$e,h=w,m=S,D=!0,p=Xe,E=!0,f=b,v=`ghost`,y=`icon-sm`,x=`text-muted-foreground relative`,T=a(_?{id:`DFfRbX`,values:{syncStateLabel:e}}:{id:`F4vEsL`,values:{syncStateLabel:e}}),t[14]=a,t[15]=o,t[16]=f,t[17]=p,t[18]=m,t[19]=h,t[20]=g,t[21]=_,t[22]=v,t[23]=y,t[24]=x,t[25]=T,t[26]=E,t[27]=D}else f=t[16],p=t[17],m=t[18],h=t[19],g=t[20],_=t[21],v=t[22],y=t[23],x=t[24],T=t[25],E=t[26],D=t[27];let O;t[28]===o?O=t[29]:(O=(0,$.jsx)(wi,{status:o}),t[28]=o,t[29]=O);let k;t[30]===d?k=t[31]:(k=d&&(0,$.jsx)(`span`,{className:`absolute -top-0.5 -right-0.5 text-[9px] leading-none font-medium bg-background border rounded-full px-0.5`,children:d}),t[30]=d,t[31]=k);let A;t[32]!==d||t[33]!==_?(A=!d&&_&&(0,$.jsx)(`span`,{className:`absolute -top-0.5 -right-0.5 size-1.5 rounded-full bg-amber-500 ring-2 ring-background`,"aria-hidden":!0}),t[32]=d,t[33]=_,t[34]=A):A=t[34];let j;t[35]!==f||t[36]!==k||t[37]!==A||t[38]!==v||t[39]!==y||t[40]!==x||t[41]!==T||t[42]!==O?(j=(0,$.jsxs)(f,{variant:v,size:y,className:x,"aria-label":T,children:[O,k,A]}),t[35]=f,t[36]=k,t[37]=A,t[38]=v,t[39]=y,t[40]=x,t[41]=T,t[42]=O,t[43]=j):j=t[43];let M;t[44]!==p||t[45]!==j||t[46]!==E?(M=(0,$.jsx)(p,{asChild:E,children:j}),t[44]=p,t[45]=j,t[46]=E,t[47]=M):M=t[47];let N;t[48]!==m||t[49]!==M||t[50]!==D?(N=(0,$.jsx)(m,{asChild:D,children:M}),t[48]=m,t[49]=M,t[50]=D,t[51]=N):N=t[51];let P;t[52]===o?P=t[53]:(P=Bi(o),t[52]=o,t[53]=P);let F;t[54]===P?F=t[55]:(F=(0,$.jsx)(C,{children:P}),t[54]=P,t[55]=F);let I;t[56]!==h||t[57]!==N||t[58]!==F?(I=(0,$.jsxs)(h,{children:[N,F]}),t[56]=h,t[57]=N,t[58]=F,t[59]=I):I=t[59];let L;t[60]!==i||t[61]!==r||t[62]!==o?(L=(0,$.jsx)(Ze,{align:`end`,className:`flex max-h-(--radix-popover-content-available-height) w-80 flex-col overflow-y-auto p-3`,children:(0,$.jsx)(Xi,{status:o,onSignIn:r,onSetIdentity:i})}),t[60]=i,t[61]=r,t[62]=o,t[63]=L):L=t[63];let R;return t[64]!==g||t[65]!==I||t[66]!==L?(R=(0,$.jsxs)(g,{children:[I,L]}),t[64]=g,t[65]=I,t[66]=L,t[67]=R):R=t[67],R}function na(e){let t=(0,Z.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,size:i,asChild:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`default`:i,s=a!==void 0&&a?x:`div`,c;t[5]===n?c=t[6]:(c=f(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,n),t[5]=n,t[6]=c);let l;return t[7]!==s||t[8]!==r||t[9]!==o||t[10]!==c?(l=(0,$.jsx)(s,{"data-slot":`card`,"data-size":o,className:c,...r}),t[7]=s,t[8]=r,t[9]=o,t[10]=c,t[11]=l):l=t[11],l}function ra(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=f(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`div`,{"data-slot":`card-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ia(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=f(`cn-font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`div`,{"data-slot":`card-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function aa(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=f(`text-sm text-muted-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`div`,{"data-slot":`card-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function oa(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=f(`col-start-2 row-span-2 row-start-1 self-start justify-self-end`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`div`,{"data-slot":`card-action`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function sa(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=f(`px-(--card-spacing)`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`div`,{"data-slot":`card-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ca(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=f(`flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`div`,{"data-slot":`card-footer`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var la=`npx @inkeep/open-knowledge cowork`,ua=`https://openknowledge.ai/docs/integrations/claude-code`;function da(){return typeof window<`u`&&typeof window.okDesktop?.skill==`object`}function fa(e){let t=(0,Z.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,$.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 font-mono text-[0.85em]`,children:n}),t[0]=n,t[1]=r),r}function pa(e){let t=(0,Z.c)(5),{children:n,className:r}=e,i;t[0]===r?i=t[1]:(i=f(`font-mono tracking-wide uppercase text-primary font-medium text-xs`,r),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,$.jsx)(`p`,{className:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function ma(e){let t=(0,Z.c)(4),{n}=e,r;t[0]===n?r=t[1]:(r=n.toString().padStart(2,`0`),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`flex h-5 w-5 shrink-0 items-center justify-center text-xs font-medium text-muted-foreground font-mono tabular-nums`,children:r}),t[2]=r,t[3]=i),i}function ha(){let e=(0,Z.c)(8),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(pa,{children:(0,$.jsx)(l,{id:`cIptmH`})}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(ma,{n:1}),e[1]=n):n=e[1];let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsxs)(`li`,{className:`flex gap-3`,children:[n,(0,$.jsx)(`span`,{children:(0,$.jsx)(l,{id:`pHYP6v`,components:{0:(0,$.jsx)(`strong`,{className:`font-medium`}),1:(0,$.jsx)(be,{"aria-hidden":`true`,className:`inline h-3 w-3 text-muted-foreground`}),2:(0,$.jsx)(`strong`,{className:`font-medium`})}})})]}),e[2]=r):r=e[2];let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(ma,{n:2}),e[3]=i):i=e[3];let a;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsxs)(`li`,{className:`flex gap-3`,children:[i,(0,$.jsx)(`span`,{children:(0,$.jsx)(l,{id:`gGVP4q`,components:{0:(0,$.jsx)(`span`,{className:`inline-flex items-center justify-center font-medium border h-5 w-5 rounded-md text-xs`}),1:(0,$.jsx)(be,{"aria-hidden":`true`,className:`inline h-3 w-3 text-muted-foreground`}),2:(0,$.jsx)(`strong`,{className:`font-medium`}),3:(0,$.jsx)(be,{"aria-hidden":`true`,className:`inline h-3 w-3 text-muted-foreground`}),4:(0,$.jsx)(`strong`,{className:`font-medium`})}})})]}),e[4]=a):a=e[4];let o;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(ma,{n:3}),e[5]=o):o=e[5];let s;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsxs)(`ol`,{className:`flex flex-col gap-4 text-sm`,children:[r,a,(0,$.jsxs)(`li`,{className:`flex gap-3`,children:[o,(0,$.jsx)(`span`,{children:(0,$.jsx)(l,{id:`COr1Y7`,components:{0:(0,$.jsx)(fa,{}),1:(0,$.jsx)(`strong`,{className:`font-medium`})}})})]})]}),e[6]=s):s=e[6];let c;return e[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[t,s,(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground mt-4`,children:(0,$.jsx)(l,{id:`kV2YZv`,components:{0:(0,$.jsx)(`strong`,{className:`font-medium`}),1:(0,$.jsx)(`strong`,{className:`font-medium`}),2:(0,$.jsx)(be,{"aria-hidden":`true`,className:`inline h-3 w-3 text-muted-foreground`}),3:(0,$.jsx)(be,{"aria-hidden":`true`,className:`inline h-3 w-3 text-muted-foreground`})}})})]}),e[7]=c):c=e[7],c}function ga(e){let t=(0,Z.c)(74),{open:n,onOpenChange:r,reinstall:i}=e,a=i===void 0?!1:i,{_:s}=u(),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={kind:`idle`},t[0]=c):c=t[0];let[d,f]=(0,Q.useState)(c),[p,m]=(0,Q.useState)(!1),h,g;t[1]===n?(h=t[2],g=t[3]):(h=()=>{n||(f({kind:`idle`}),m(!1))},g=[n],t[1]=n,t[2]=h,t[3]=g),(0,Q.useEffect)(h,g);let _;t[4]===s?_=t[5]:(_=async function(){f({kind:`downloading`});let e=window.okDesktop?.skill;if(!e){f({kind:`error`,message:s({id:`y46m5r`})});return}let t=await e.buildAndOpen();if(t.ok)f({kind:`handed-off`,path:t.path});else{let e=t.message??t.reason;q.error(s({id:`hSySVc`,values:{msg:e}})),f({kind:`error`,message:t.reason===`open-failed`?s({id:`IA1wNb`,values:{msg:e}}):`${t.reason}: ${e}`})}},t[4]=s,t[5]=_);let v=_,y;t[6]===s?y=t[7]:(y=async function(){try{await navigator.clipboard.writeText(la),m(!0),setTimeout(()=>m(!1),2e3)}catch(e){let t=e,n=t instanceof Error?t.message:String(t);q.error(s({id:`Uw6ERJ`,values:{detail:n}}))}},t[6]=s,t[7]=y);let x=y,S;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(S=da(),t[8]=S):S=t[8];let C=S,w;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(Ee,{"aria-hidden":`true`,className:`h-4 w-4`}),t[9]=w):w=t[9];let M;t[10]===a?M=t[11]:(M=(0,$.jsxs)(E,{className:`flex items-center gap-2`,children:[w,a?(0,$.jsx)(l,{id:`xNyj3h`}):(0,$.jsx)(l,{id:`7qRHf0`})]}),t[10]=a,t[11]=M);let N;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(T,{children:(0,$.jsx)(l,{id:`9V0W-R`,components:{0:(0,$.jsx)(`strong`,{className:`font-medium text-foreground`})}})}),t[12]=N):N=t[12];let P;t[13]===M?P=t[14]:(P=(0,$.jsxs)(A,{children:[M,N]}),t[13]=M,t[14]=P);let F;t[15]===d.kind?F=t[16]:(F=d.kind===`idle`&&C&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(pa,{className:`text-muted-foreground`,children:(0,$.jsx)(l,{id:`Dnn2XG`})}),(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(l,{id:`RN62Q8`,components:{0:(0,$.jsx)(fa,{}),1:(0,$.jsx)(fa,{})}})})]}),(0,$.jsx)(ha,{})]}),t[15]=d.kind,t[16]=F);let I;t[17]!==s||t[18]!==p||t[19]!==x||t[20]!==d.kind?(I=d.kind===`idle`&&!C&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(pa,{children:(0,$.jsx)(l,{id:`L8fKuc`})}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border bg-muted/40 p-2`,children:[(0,$.jsx)(`code`,{className:`flex-1 font-mono text-xs`,children:la}),(0,$.jsx)(b,{variant:`ghost`,size:`sm`,onClick:x,"aria-label":s({id:`Oos8fo`}),className:`h-7 gap-1`,children:p?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Te,{"aria-hidden":`true`,className:`h-3 w-3`}),(0,$.jsx)(l,{id:`6V3Ea3`})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(o,{"aria-hidden":`true`,className:`h-3 w-3`}),(0,$.jsx)(l,{id:`he3ygx`})]})})]}),(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(l,{id:`z60Lgn`,components:{0:(0,$.jsx)(fa,{})}})})]}),(0,$.jsx)(ha,{})]}),t[17]=s,t[18]=p,t[19]=x,t[20]=d.kind,t[21]=I):I=t[21];let L;t[22]===d.kind?L=t[23]:(L=d.kind===`downloading`&&(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,$.jsx)(je,{"aria-hidden":`true`,className:`h-4 w-4`}),(0,$.jsx)(l,{id:`bwil08`,components:{0:(0,$.jsx)(fa,{})}})]}),t[22]=d.kind,t[23]=L);let R;t[24]!==d.kind||t[25]!==d.path?(R=d.kind===`handed-off`&&C&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-primary/30 bg-primary/5 px-3 py-2`,children:[(0,$.jsx)(Te,{"aria-hidden":`true`,className:`mt-0.5 h-4 w-4 text-primary`}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:(0,$.jsx)(l,{id:`r51jLC`})}),(0,$.jsx)(`code`,{className:`font-mono text-xs text-muted-foreground`,children:d.path??`~/Downloads/openknowledge.skill`})]})]}),(0,$.jsx)(ha,{})]}),t[24]=d.kind,t[25]=d.path,t[26]=R):R=t[26];let z;t[27]===d.kind?z=t[28]:(z=d.kind===`handed-off`&&!C&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-primary/30 bg-primary/5 px-3 py-2`,children:[(0,$.jsx)(Te,{"aria-hidden":`true`,className:`mt-0.5 h-4 w-4 text-primary`}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:(0,$.jsx)(l,{id:`hynz2K`})}),(0,$.jsx)(`span`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(l,{id:`qXg5W9`,components:{0:(0,$.jsx)(fa,{})}})})]})]}),(0,$.jsx)(ha,{})]}),t[27]=d.kind,t[28]=z);let ee;t[29]!==d.kind||t[30]!==d.message?(ee=d.kind===`error`&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-2 text-sm`,children:[(0,$.jsx)(`span`,{className:`text-destructive`,children:d.message}),(0,$.jsx)(`a`,{href:ua,target:`_blank`,rel:`noopener noreferrer`,onClick:ba,onAuxClick:ya,className:`text-xs underline underline-offset-2 hover:text-foreground`,children:(0,$.jsx)(l,{id:`mGaZwZ`})})]}),t[29]=d.kind,t[30]=d.message,t[31]=ee):ee=t[31];let te;t[32]!==F||t[33]!==I||t[34]!==L||t[35]!==R||t[36]!==z||t[37]!==ee?(te=(0,$.jsx)(O,{children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-6 py-2`,children:[F,I,L,R,z,ee]})}),t[32]=F,t[33]=I,t[34]=L,t[35]=R,t[36]=z,t[37]=ee,t[38]=te):te=t[38];let ne;t[39]===d.kind?ne=t[40]:(ne=d.kind!==`error`&&(0,$.jsxs)(`a`,{href:ua,target:`_blank`,rel:`noopener noreferrer`,onClick:va,onAuxClick:_a,className:`inline-flex items-center gap-1 self-center text-xs text-muted-foreground underline underline-offset-2 hover:text-foreground sm:mr-auto font-mono tracking-wide uppercase`,children:[(0,$.jsx)(l,{id:`U3IvM5`}),(0,$.jsx)(gt,{"aria-hidden":`true`,className:`h-3 w-3`})]}),t[39]=d.kind,t[40]=ne);let B;t[41]!==v||t[42]!==r||t[43]!==d.kind||t[44]!==a?(B=d.kind===`idle`&&C&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(b,{className:`uppercase font-mono`,variant:`outline`,onClick:()=>r(!1),children:(0,$.jsx)(l,{id:`dEgA5A`})}),(0,$.jsxs)(b,{onClick:v,children:[(0,$.jsx)(Ee,{"aria-hidden":`true`,className:`h-4 w-4`}),a?(0,$.jsx)(l,{id:`YGIi_c`}):(0,$.jsx)(l,{id:`TKQ7K-`})]})]}),t[41]=v,t[42]=r,t[43]=d.kind,t[44]=a,t[45]=B):B=t[45];let re;t[46]!==r||t[47]!==d.kind?(re=d.kind===`idle`&&!C&&(0,$.jsx)(b,{className:`uppercase font-mono`,variant:`outline`,onClick:()=>r(!1),children:(0,$.jsx)(l,{id:`yz7wBu`})}),t[46]=r,t[47]=d.kind,t[48]=re):re=t[48];let V;t[49]!==v||t[50]!==r||t[51]!==d.kind?(V=d.kind===`error`&&C&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(b,{className:`uppercase font-mono`,variant:`outline`,onClick:()=>r(!1),children:(0,$.jsx)(l,{id:`dEgA5A`})}),(0,$.jsxs)(b,{onClick:v,children:[(0,$.jsx)(Ee,{"aria-hidden":`true`,className:`h-4 w-4`}),(0,$.jsx)(l,{id:`KDw4GX`})]})]}),t[49]=v,t[50]=r,t[51]=d.kind,t[52]=V):V=t[52];let H;t[53]!==d.kind||t[54]!==a?(H=d.kind===`downloading`&&(0,$.jsxs)(b,{disabled:!0,children:[(0,$.jsx)(je,{"aria-hidden":`true`,className:`h-4 w-4`}),a?(0,$.jsx)(l,{id:`fIgqfQ`}):(0,$.jsx)(l,{id:`Wtw22s`})]}),t[53]=d.kind,t[54]=a,t[55]=H):H=t[55];let U;t[56]!==r||t[57]!==d.kind?(U=d.kind===`handed-off`&&(0,$.jsx)(b,{onClick:()=>r(!1),children:(0,$.jsx)(l,{id:`DPfwMq`})}),t[56]=r,t[57]=d.kind,t[58]=U):U=t[58];let W;t[59]!==ne||t[60]!==B||t[61]!==re||t[62]!==V||t[63]!==H||t[64]!==U?(W=(0,$.jsxs)(k,{children:[ne,B,re,V,H,U]}),t[59]=ne,t[60]=B,t[61]=re,t[62]=V,t[63]=H,t[64]=U,t[65]=W):W=t[65];let G;t[66]!==P||t[67]!==te||t[68]!==W?(G=(0,$.jsxs)(D,{className:`sm:max-w-lg`,"data-ok-layer-spawned":``,children:[P,te,W]}),t[66]=P,t[67]=te,t[68]=W,t[69]=G):G=t[69];let K;return t[70]!==r||t[71]!==n||t[72]!==G?(K=(0,$.jsx)(j,{open:n,onOpenChange:r,children:G}),t[70]=r,t[71]=n,t[72]=G,t[73]=K):K=t[73],K}function _a(e){return et(e,ua)}function va(e){return et(e,ua)}function ya(e){return et(e,ua)}function ba(e){return et(e,ua)}var xa=new Set;function Sa(e){for(let t of xa)try{t(e)}catch(e){console.warn(`[config-ignore-nested-error-events] listener threw:`,e)}}function Ca(e){return xa.add(e),()=>{xa.delete(e)}}var wa=new Set;function Ta(e){for(let t of wa)try{t(e)}catch(e){console.warn(`[config-validation-events] listener threw:`,e)}}function Ea(e){return wa.add(e),()=>{wa.delete(e)}}var Da=null;function Oa(){return Da}function ka(e){Da=e}export{At as $,Er as A,hr as B,$r as C,Dr as D,Rr as E,Sr as F,wn as G,fr as H,xr as I,tn as J,Cn as K,vr as L,Ar as M,jr as N,kr as O,Tr as P,zt as Q,_r as R,Ri as S,Fr as T,kn as U,gr as V,Tn as W,Vt as X,Yt as Y,Rt as Z,Di as _,Sa as a,Mi as b,na as c,aa as d,Tt as et,ca as f,ki as g,ta as h,Ea as i,wr as j,Or as k,oa as l,ia as m,ka as n,yt as nt,Ca as o,ra as p,bn as q,Ta as r,mt as rt,ga as s,Oa as t,bt as tt,sa as u,Ii as v,Pr as w,Ni as x,ji as y,yr as z};