decocms 3.73.0 → 3.74.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (286) hide show
  1. package/dist/client/assets/{AlertCircle-Qsz79sot.js → AlertCircle-Ccspj6_x.js} +1 -1
  2. package/dist/client/assets/ArrowRight-DjM-WAe8.js +1 -0
  3. package/dist/client/assets/{ArrowUpRight-CqYlpRve.js → ArrowUpRight-tJm1fmd7.js} +1 -1
  4. package/dist/client/assets/Check-D3J8f8u-.js +1 -0
  5. package/dist/client/assets/{CheckCircle-D96bOHZ4.js → CheckCircle-2NPq-6dO.js} +1 -1
  6. package/dist/client/assets/{ChevronDown-BDUfpA8-.js → ChevronDown-Dilz0yBl.js} +1 -1
  7. package/dist/client/assets/{ChevronLeft-CPb9YQ3b.js → ChevronLeft-CJ5DBM3M.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-BdBQHcGY.js → ChevronRight-KEtpzT4P.js} +1 -1
  9. package/dist/client/assets/ChevronUp-B5x1falF.js +1 -0
  10. package/dist/client/assets/{DotsVertical-B0BcJ-Xx.js → DotsVertical-BM5d8Pc7.js} +1 -1
  11. package/dist/client/assets/{Eye-Cn63kKBo.js → Eye-hHNCwVZ1.js} +1 -1
  12. package/dist/client/assets/{FilterLines-CybSjddP.js → FilterLines-DfVdVEBp.js} +1 -1
  13. package/dist/client/assets/{Globe01-D6_7mD2q.js → Globe01-DD8UM4Hn.js} +1 -1
  14. package/dist/client/assets/{Globe04-DGI5tY8K.js → Globe04-CHjKQaGv.js} +1 -1
  15. package/dist/client/assets/{HardDrive-BoitsKJ1.js → HardDrive-ClhqImrT.js} +1 -1
  16. package/dist/client/assets/{Key01-CEwc6a0T.js → Key01-BYHEvjL0.js} +1 -1
  17. package/dist/client/assets/{LayoutLeft-Dbsbo4ui.js → LayoutLeft-BNwcfVCc.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-B1YJxZ_i.js → LinkExternal01-BqsD3A6i.js} +1 -1
  19. package/dist/client/assets/{Monitor01-BJEn_hPF.js → Monitor01-BqllG5YD.js} +1 -1
  20. package/dist/client/assets/{Palette-DM7mN-wZ.js → Palette-CdtyN2t7.js} +1 -1
  21. package/dist/client/assets/{Play--fnJFFV0.js → Play-DpX5JUyA.js} +1 -1
  22. package/dist/client/assets/{Plus-BotD1zxJ.js → Plus-BaLwS14l.js} +1 -1
  23. package/dist/client/assets/{SearchMd-BJM4yPQO.js → SearchMd-CJ_dFCp5.js} +1 -1
  24. package/dist/client/assets/{Settings02-BDBrMikk.js → Settings02-Cg6Yp6Ig.js} +1 -1
  25. package/dist/client/assets/{Shield01-BLk45Lqh.js → Shield01-DYwaNnY3.js} +1 -1
  26. package/dist/client/assets/{Star01-c7vPYDwm.js → Star01-D42mJCl7.js} +1 -1
  27. package/dist/client/assets/{Stars01-B-5V3LS2.js → Stars01-CrB442jN.js} +1 -1
  28. package/dist/client/assets/{Stars02-CsAFd9rT.js → Stars02-C2akJW-A.js} +1 -1
  29. package/dist/client/assets/{Sun-DLMUNZaS.js → Sun-CgYYfF85.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-BG4hAcSt.js → SwitchHorizontal01-y3DhestF.js} +1 -1
  31. package/dist/client/assets/{Tool01-DuWKfueG.js → Tool01-CI_6KMgQ.js} +1 -1
  32. package/dist/client/assets/{Trash01-CBhkXuxm.js → Trash01-Cd_0JhhN.js} +1 -1
  33. package/dist/client/assets/{Upload01-geIrWEzc.js → Upload01-ijsbLMSK.js} +1 -1
  34. package/dist/client/assets/{User01-BQxtHTb_.js → User01-BI5RuTWy.js} +1 -1
  35. package/dist/client/assets/{Users01-oAfFj8jH.js → Users01-LhAUtJ2l.js} +1 -1
  36. package/dist/client/assets/{Users03-rDpaXmvi.js → Users03-CJf6bBEA.js} +1 -1
  37. package/dist/client/assets/{X-CWsxaTAy.js → X-BmA2kYv-.js} +1 -1
  38. package/dist/client/assets/XCircle-CSVmVGl-.js +1 -0
  39. package/dist/client/assets/{XClose-CjsCyYq1.js → XClose-BGGuhSdx.js} +1 -1
  40. package/dist/client/assets/{Zap-CBPMaWRv.js → Zap-C5OGTH44.js} +1 -1
  41. package/dist/client/assets/{ZapSquare-BZciBg8V.js → ZapSquare-Bh6-lHaM.js} +1 -1
  42. package/dist/client/assets/{ZoomOut-CuzhjD8R.js → ZoomOut-xDQo2yr7.js} +1 -1
  43. package/dist/client/assets/{access-gate-gL5SpIsh.js → access-gate-C-eMG1Ta.js} +1 -1
  44. package/dist/client/assets/add-section-modal-DNNafM9O.js +1 -0
  45. package/dist/client/assets/agent-icon-Bcqwo2Wq.js +1 -0
  46. package/dist/client/assets/agents-list-obMS8uxZ.js +1 -0
  47. package/dist/client/assets/ai-providers-apfL_rjp.js +1 -0
  48. package/dist/client/assets/{alert-CFJHHcie.js → alert-B1Ln6zZV.js} +1 -1
  49. package/dist/client/assets/{alert-dialog-y-SjofRy.js → alert-dialog-BZRM5ze7.js} +3 -3
  50. package/dist/client/assets/app-editor-C0jI2dDZ.js +1 -0
  51. package/dist/client/assets/{auth-catchall-DAbA44Yn.js → auth-catchall-s-1qzuNO.js} +1 -1
  52. package/dist/client/assets/auth-entry-CW5gsTiA.js +1 -0
  53. package/dist/client/assets/{auth-oAvShPIA.js → auth-rl3GT7t8.js} +1 -1
  54. package/dist/client/assets/{auth-split-layout-h72ar9bS.js → auth-split-layout-BC0lphRW.js} +1 -1
  55. package/dist/client/assets/{automation-list-row-CPRLW9qP.js → automation-list-row-DefMjeyu.js} +1 -1
  56. package/dist/client/assets/{automation-runs-MukaSUF3.js → automation-runs-C-Da4MEd.js} +1 -1
  57. package/dist/client/assets/automations-CbOSvhEe.js +1 -0
  58. package/dist/client/assets/{avatar-BuKPm2vr.js → avatar-CXZnLPEU.js} +1 -1
  59. package/dist/client/assets/backoff-CrEUbyZT.js +1 -0
  60. package/dist/client/assets/{badge-r4de0kry.js → badge-DSiiJMKS.js} +1 -1
  61. package/dist/client/assets/{block-document-BV4M7GSw.js → block-document-DR_-i1iv.js} +1 -1
  62. package/dist/client/assets/{brand-context-CBTn9oh3.js → brand-context-D385RFi4.js} +1 -1
  63. package/dist/client/assets/buckets-CfLzGo42.js +1 -0
  64. package/dist/client/assets/{calendar-Cxlga-qo.js → calendar-CdvLiXTi.js} +1 -1
  65. package/dist/client/assets/{capability-load-error-B01bGGw8.js → capability-load-error-Cc0Imt5p.js} +1 -1
  66. package/dist/client/assets/{card-D2P5f0Hv.js → card-DSDTRgoU.js} +1 -1
  67. package/dist/client/assets/category-editor-sMElZzN1.js +1 -0
  68. package/dist/client/assets/chat-context-DnaexSAo.js +21 -0
  69. package/dist/client/assets/checkbox-CL_5fiO_.js +1 -0
  70. package/dist/client/assets/{cli-auth-success-B-xojIRf.js → cli-auth-success-DV-qTae_.js} +1 -1
  71. package/dist/client/assets/collection-detail-CtoW7iVa.js +1 -0
  72. package/dist/client/assets/collection-display-button-Boq8hl8Q.js +1 -0
  73. package/dist/client/assets/{collection-search-DS6Qu-vl.js → collection-search-2g11_WBH.js} +1 -1
  74. package/dist/client/assets/{collection-tabs-Ck6BuvIC.js → collection-tabs-CDMyDuFK.js} +1 -1
  75. package/dist/client/assets/{command-BW1QDtOt.js → command-Bw_f0kDn.js} +1 -1
  76. package/dist/client/assets/commerce-onboarding-LL_9usA-.js +1 -0
  77. package/dist/client/assets/connect-desktop-dialog-Dybq2Hx1.js +1 -0
  78. package/dist/client/assets/{connection-card-Cnc4pAuK.js → connection-card-DA1t_KQo.js} +1 -1
  79. package/dist/client/assets/connection-detail-C3h6Iqqu.js +1 -0
  80. package/dist/client/assets/{connection-form-helpers-BWYI6_re.js → connection-form-helpers-BqK6S8Yx.js} +1 -1
  81. package/dist/client/assets/connections-BdIG1myf.js +1 -0
  82. package/dist/client/assets/context-menu-KaWlIbj1.js +1 -0
  83. package/dist/client/assets/{decopilot-lDNbKmoL.js → decopilot-fUgUe2Eh.js} +1 -1
  84. package/dist/client/assets/decopilot-sse-pool-Dl1x5tdf.js +1 -0
  85. package/dist/client/assets/delay-CnY5UFtP.js +1 -0
  86. package/dist/client/assets/dialog-CQ6B0IwC.js +1 -0
  87. package/dist/client/assets/{domain-settings-DNfnwQe1.js → domain-settings-BvzKBAZm.js} +1 -1
  88. package/dist/client/assets/drawer-mbT59SGx.js +1 -0
  89. package/dist/client/assets/dropdown-menu-bs6nmOyP.js +1 -0
  90. package/dist/client/assets/{empty-state-LK6HJ1Ub.js → empty-state-crYivviN.js} +1 -1
  91. package/dist/client/assets/{extract-connection-data-BVb7kACV.js → extract-connection-data-D-Y4GRfE.js} +1 -1
  92. package/dist/client/assets/file-explorer-iYX8uF4-.js +2 -0
  93. package/dist/client/assets/{file-type-icon-Co_9nTdI.js → file-type-icon-D0ASmNXK.js} +1 -1
  94. package/dist/client/assets/{files-BB2L5yxl.js → files-ENTpyfhv.js} +1 -1
  95. package/dist/client/assets/{form-DeXV6ZbR.js → form-O9DEtf_L.js} +1 -1
  96. package/dist/client/assets/general-BJWZpnpu.js +1 -0
  97. package/dist/client/assets/{github-repo-picker-D28KZVlK.js → github-repo-picker-CHTvfJAD.js} +1 -1
  98. package/dist/client/assets/{hooks-C6xsli9S.js → hooks-CSfRJCjt.js} +6 -6
  99. package/dist/client/assets/image-field-BdcHkDRx.js +1 -0
  100. package/dist/client/assets/{import-from-deco-dialog-BqR81gos.js → import-from-deco-dialog-Bz8FE0_9.js} +2 -2
  101. package/dist/client/assets/{index-DYVHqMRU.js → index-7a12TwCl.js} +10 -10
  102. package/dist/client/assets/{index-BT1fnsTX.js → index-B4I34F6K.js} +1 -1
  103. package/dist/client/assets/{index-BS6SIcIO.js → index-BFeGPSf0.js} +1 -1
  104. package/dist/client/assets/{index-D_EAxCKt.js → index-BK1jVztm.js} +4 -4
  105. package/dist/client/assets/{index-BvJIELiR.js → index-BPuJ390n.js} +1 -1
  106. package/dist/client/assets/{index-Cn123si2.js → index-BRnQ22g3.js} +1 -1
  107. package/dist/client/assets/index-B_6khNsr.js +1 -0
  108. package/dist/client/assets/{index-DhP6uqg6.js → index-BsWl8UuV.js} +1 -1
  109. package/dist/client/assets/index-C9uGIJ2-.js +1 -0
  110. package/dist/client/assets/{index-fZsfe2dv.js → index-CGoh8mx2.js} +2 -2
  111. package/dist/client/assets/{index-EQfvflqN.js → index-D0U_smqt.js} +29 -29
  112. package/dist/client/assets/{index-DlAcri6L.js → index-DHLJyA5u.js} +3 -3
  113. package/dist/client/assets/{index-CL7iXGkA.js → index-D_UY8Zf9.js} +1 -1
  114. package/dist/client/assets/{index-C9ln6Rlu.js → index-DvTimAjS.js} +12 -12
  115. package/dist/client/assets/{index-redirect-DyYQW9cK.js → index-redirect-CPy0Z1T_.js} +1 -1
  116. package/dist/client/assets/{input-DSpuivwc.js → input-Ccm3ShdT.js} +1 -1
  117. package/dist/client/assets/{integration-icon-CLgQo-hX.js → integration-icon-BjRqMG3n.js} +1 -1
  118. package/dist/client/assets/label-KRKjsQLR.js +1 -0
  119. package/dist/client/assets/login-B5WUG2bv.js +1 -0
  120. package/dist/client/assets/{mcp-oauth-B7WMtt2U.js → mcp-oauth-Ccqa98JF.js} +1 -1
  121. package/dist/client/assets/{members-DwMoOKaR.js → members-BwXKPt6c.js} +2 -2
  122. package/dist/client/assets/{monaco-editor-eUJHQqAo.js → monaco-editor-DztiaMte.js} +1 -1
  123. package/dist/client/assets/{monitoring-stats-row-DxDe7dnK.js → monitoring-stats-row-DY_Jk7Qu.js} +1 -1
  124. package/dist/client/assets/{oauth-callback-CeRw4Jke.js → oauth-callback-B5Sy5Cax.js} +1 -1
  125. package/dist/client/assets/{oauth-callback-ai-provider-C2phjFNn.js → oauth-callback-ai-provider-DFLSFrMH.js} +1 -1
  126. package/dist/client/assets/onboarding-tnqH6jke.js +1 -0
  127. package/dist/client/assets/{org-install-CM9G-6Y5.js → org-install-CMfEhUPU.js} +1 -1
  128. package/dist/client/assets/org-layout-DWTGapvu.js +1 -0
  129. package/dist/client/assets/organization-choice-BhcilQzG.js +1 -0
  130. package/dist/client/assets/{page-seo-form-Dzkc_5Zz.js → page-seo-form-CworrxTj.js} +1 -1
  131. package/dist/client/assets/page-seo-sheet-CU9OHYe8.js +1 -0
  132. package/dist/client/assets/popover-CQIMDVug.js +1 -0
  133. package/dist/client/assets/post-editor-BgM1RATm.js +1 -0
  134. package/dist/client/assets/preview-dialog-CJENsRWm.js +5 -0
  135. package/dist/client/assets/{primitives-DTM0cYw2.js → primitives-qIzOEfAk.js} +1 -1
  136. package/dist/client/assets/profile-B0-E7bKd.js +1 -0
  137. package/dist/client/assets/project-app-view-CMI1MfV-.js +1 -0
  138. package/dist/client/assets/record-editor-DGdCVdoZ.js +1 -0
  139. package/dist/client/assets/registry-D-K5v381.js +2 -0
  140. package/dist/client/assets/{registry-layout-Dvh3zycp.js → registry-layout-Cy0i7eVL.js} +4 -4
  141. package/dist/client/assets/require-capability-D9TOSbgf.js +1 -0
  142. package/dist/client/assets/required-auth-layout-D9FVCOQl.js +1 -0
  143. package/dist/client/assets/{reset-password-yVdorWr2.js → reset-password-m90-iQba.js} +1 -1
  144. package/dist/client/assets/roles-m5faIEUW.js +1 -0
  145. package/dist/client/assets/save-referenced-block-CtS93Zrw.js +1 -0
  146. package/dist/client/assets/save-status-Dr27404A.js +1 -0
  147. package/dist/client/assets/{schema-form-BT-HtmzD.js → schema-form-Bpex2GV2.js} +1 -1
  148. package/dist/client/assets/{scroll-area-CLsPpB-r.js → scroll-area-DbztbmuO.js} +7 -7
  149. package/dist/client/assets/{search-input-3wsWtr8y.js → search-input-C742tJr8.js} +1 -1
  150. package/dist/client/assets/secrets-DbY4hLUu.js +1 -0
  151. package/dist/client/assets/{sections-editor--NaQBFc_.js → sections-editor-DJuNcR6f.js} +2 -2
  152. package/dist/client/assets/select-COSJe-70.js +1 -0
  153. package/dist/client/assets/{select-model-BWy_J6Nk.js → select-model-Cv_gN_vr.js} +1 -1
  154. package/dist/client/assets/seo-editor-ynZ80zTU.js +1 -0
  155. package/dist/client/assets/settings-layout-D5cpx9f5.js +1 -0
  156. package/dist/client/assets/{settings-section-Xa6gQanu.js → settings-section-C-zTpCRT.js} +1 -1
  157. package/dist/client/assets/{sheet-CO5nUKz5.js → sheet-CuyenB5M.js} +1 -1
  158. package/dist/client/assets/shell-controls-fwD6Be98.js +1 -0
  159. package/dist/client/assets/shell-layout-BhblvLd4.js +1 -0
  160. package/dist/client/assets/shell-route-loading-ClsKn-Oj.js +1 -0
  161. package/dist/client/assets/{sidebar-Bc_N4P0Q.js → sidebar-BYFEz6-7.js} +1 -1
  162. package/dist/client/assets/skeleton-DHas8e4O.js +1 -0
  163. package/dist/client/assets/{sortable.esm-8cD2lpev.js → sortable.esm-CtBH0PGw.js} +1 -1
  164. package/dist/client/assets/sso-BFO9vLZv.js +1 -0
  165. package/dist/client/assets/{store-DdMLz8Ze.js → store-C9F0E0yc.js} +1 -1
  166. package/dist/client/assets/store-registry-D8kCyVob.js +2 -0
  167. package/dist/client/assets/studio-tools-DO12gBMa.js +1 -0
  168. package/dist/client/assets/switch-By8vCxNg.js +1 -0
  169. package/dist/client/assets/table-BgkbBxMz.js +1 -0
  170. package/dist/client/assets/{tabs-guVlWmKk.js → tabs-DPoZSyfS.js} +1 -1
  171. package/dist/client/assets/{task-status-CuvvylED.js → task-status-D9k3BLzM.js} +1 -1
  172. package/dist/client/assets/textarea-DQwh6y_K.js +1 -0
  173. package/dist/client/assets/{toggle-group-CMjl8VgC.js → toggle-group-CW5GRzAp.js} +1 -1
  174. package/dist/client/assets/{toolbar-CkTqFHd9.js → toolbar-1QmqWl6-.js} +1 -1
  175. package/dist/client/assets/tooltip-DO1R3Vmb.js +1 -0
  176. package/dist/client/assets/{types-D4QaCOrk.js → types-pBNKtzBp.js} +1 -1
  177. package/dist/client/assets/{use-ai-providers-DG2JQjs-.js → use-ai-providers-qobt2OiH.js} +1 -1
  178. package/dist/client/assets/{use-automations-CteEXHmM.js → use-automations-BwoNV2me.js} +1 -1
  179. package/dist/client/assets/use-capability-C09ZF9_G.js +1 -0
  180. package/dist/client/assets/{use-clock-tick-ZNeIyYyN.js → use-clock-tick-_1lW4UqP.js} +1 -1
  181. package/dist/client/assets/{use-collections-BpjfU7Qz.js → use-collections-DRgt6Bb8.js} +1 -1
  182. package/dist/client/assets/use-connection-XfA-QrSw.js +1 -0
  183. package/dist/client/assets/use-copy-DyplBFAe.js +1 -0
  184. package/dist/client/assets/use-create-virtual-mcp-BJFWHgGz.js +1 -0
  185. package/dist/client/assets/{use-debounced-autosave-DcMAFfy3.js → use-debounced-autosave-DqciCJ__.js} +1 -1
  186. package/dist/client/assets/use-deco-credits-CyoNix9p.js +1 -0
  187. package/dist/client/assets/{use-delete-connection-DUHc9RVY.js → use-delete-connection-CweyK7E_.js} +1 -1
  188. package/dist/client/assets/use-file-configs-OLHA7dwa.js +1 -0
  189. package/dist/client/assets/{use-infinite-scroll-BvUO_UAz.js → use-infinite-scroll-BbUZw7ju.js} +1 -1
  190. package/dist/client/assets/{use-join-requests-DTfMSZbu.js → use-join-requests-CHh2Zrhx.js} +1 -1
  191. package/dist/client/assets/use-mcp-client-DilmxmKU.js +10 -0
  192. package/dist/client/assets/{use-mcp-prompts-DK7oMqp2.js → use-mcp-prompts-D2ueJ3CD.js} +1 -1
  193. package/dist/client/assets/{use-mcp-tools-Baigwz11.js → use-mcp-tools-uucJgbkt.js} +1 -1
  194. package/dist/client/assets/{use-members-sheMPGLK.js → use-members-Y5iRty7v.js} +1 -1
  195. package/dist/client/assets/use-navigate-to-agent-HvaD8xDj.js +1 -0
  196. package/dist/client/assets/{use-org-auth-client-BWdAUif4.js → use-org-auth-client-Dl_7zTlg.js} +1 -1
  197. package/dist/client/assets/{use-org-sso-CQCoThc3.js → use-org-sso-9Z0u5sV3.js} +1 -1
  198. package/dist/client/assets/{use-organization-roles-Blo5zOq7.js → use-organization-roles-C8kGFpoE.js} +1 -1
  199. package/dist/client/assets/use-organization-settings-B5vS3xHV.js +1 -0
  200. package/dist/client/assets/{use-registry-connections-Dp82aVQV.js → use-registry-connections-DhFpf503.js} +1 -1
  201. package/dist/client/assets/use-secrets-DtlQfYRK.js +1 -0
  202. package/dist/client/assets/{use-status-sounds-Cbe3FatD.js → use-status-sounds-BSqGti4P.js} +1 -1
  203. package/dist/client/assets/{use-view-mode-DuHWUBn_.js → use-view-mode-Cc4A86jX.js} +1 -1
  204. package/dist/client/assets/{use-virtual-mcp-isKQVwa1.js → use-virtual-mcp-cixi9WNo.js} +1 -1
  205. package/dist/client/assets/useInfiniteQuery-C4arjVN1.js +1 -0
  206. package/dist/client/assets/useSuspenseInfiniteQuery-DTlBviqw.js +1 -0
  207. package/dist/client/assets/variant-calendar-BtDF6xbX.js +1 -0
  208. package/dist/client/assets/view-mode-toggle-BNmCyKXO.js +1 -0
  209. package/dist/client/index.html +1 -1
  210. package/dist/server/cli.js +509 -506
  211. package/dist/server/server.js +318 -318
  212. package/package.json +1 -1
  213. package/dist/client/assets/ChevronUp-ByHCMSz5.js +0 -1
  214. package/dist/client/assets/XCircle-qby-IxK9.js +0 -1
  215. package/dist/client/assets/add-section-modal--cVfcrtB.js +0 -1
  216. package/dist/client/assets/agent-icon-CBTaU_uB.js +0 -1
  217. package/dist/client/assets/agents-list-CXBn8lDh.js +0 -1
  218. package/dist/client/assets/ai-providers-CbnbJJz4.js +0 -1
  219. package/dist/client/assets/app-editor-BcOUOP9g.js +0 -1
  220. package/dist/client/assets/automations-h21yis8y.js +0 -1
  221. package/dist/client/assets/buckets-B83SYpLX.js +0 -1
  222. package/dist/client/assets/category-editor-wy2LOTex.js +0 -1
  223. package/dist/client/assets/chat-context-BtC6Ah0G.js +0 -21
  224. package/dist/client/assets/checkbox-CgVOF7oH.js +0 -1
  225. package/dist/client/assets/collection-detail-nxizKZ79.js +0 -1
  226. package/dist/client/assets/collection-display-button-CdC3bHO_.js +0 -1
  227. package/dist/client/assets/connect-desktop-dialog-CDALyqpZ.js +0 -1
  228. package/dist/client/assets/connection-detail-bVa9c8Lh.js +0 -1
  229. package/dist/client/assets/connections-BJFKAoWQ.js +0 -1
  230. package/dist/client/assets/context-menu-DTN-hspY.js +0 -1
  231. package/dist/client/assets/decopilot-sse-pool-4h5QEcLo.js +0 -1
  232. package/dist/client/assets/dialog-45S14PiE.js +0 -1
  233. package/dist/client/assets/drawer-BdP8u_Wg.js +0 -1
  234. package/dist/client/assets/dropdown-menu-CqSJARyq.js +0 -1
  235. package/dist/client/assets/file-explorer-CvvH4Wsl.js +0 -2
  236. package/dist/client/assets/general-hVWzdym-.js +0 -1
  237. package/dist/client/assets/image-field-CIVwBDwt.js +0 -1
  238. package/dist/client/assets/index-C3c5UhFw.js +0 -1
  239. package/dist/client/assets/index-CX9HPjy_.js +0 -1
  240. package/dist/client/assets/label-WMNwqiQL.js +0 -1
  241. package/dist/client/assets/login-YdjddSPA.js +0 -1
  242. package/dist/client/assets/onboarding-D6fpPPXQ.js +0 -1
  243. package/dist/client/assets/org-layout-DpaEw-4S.js +0 -1
  244. package/dist/client/assets/page-seo-sheet-C_NzOtxI.js +0 -1
  245. package/dist/client/assets/popover-D2IKuRrN.js +0 -1
  246. package/dist/client/assets/post-editor-CM4EkGCt.js +0 -1
  247. package/dist/client/assets/preview-dialog-BYT9QnPJ.js +0 -5
  248. package/dist/client/assets/profile-DU9dowPP.js +0 -1
  249. package/dist/client/assets/project-app-view-CMB3qFiO.js +0 -1
  250. package/dist/client/assets/record-editor-D8GUWHmB.js +0 -1
  251. package/dist/client/assets/registry-Bb6Tgwun.js +0 -2
  252. package/dist/client/assets/require-capability-BnPWl2tF.js +0 -1
  253. package/dist/client/assets/required-auth-layout-D-3ucvj0.js +0 -1
  254. package/dist/client/assets/roles-SqN3pcMs.js +0 -1
  255. package/dist/client/assets/save-referenced-block-CJbd0wX1.js +0 -1
  256. package/dist/client/assets/save-status-BnLQAr10.js +0 -1
  257. package/dist/client/assets/secrets-hO3DohpV.js +0 -1
  258. package/dist/client/assets/select-Cr8ncrzb.js +0 -1
  259. package/dist/client/assets/seo-editor-C7JgJycB.js +0 -1
  260. package/dist/client/assets/settings-layout-BD7cvvYF.js +0 -1
  261. package/dist/client/assets/shell-controls-Bsba7LUp.js +0 -1
  262. package/dist/client/assets/shell-layout-CMM5javC.js +0 -1
  263. package/dist/client/assets/shell-route-loading-rFRhSsv7.js +0 -1
  264. package/dist/client/assets/skeleton-BDjpHo4F.js +0 -1
  265. package/dist/client/assets/sso-Ch2uxBlI.js +0 -1
  266. package/dist/client/assets/store-registry-n1SChU-1.js +0 -2
  267. package/dist/client/assets/studio-tools-CcZtrETh.js +0 -1
  268. package/dist/client/assets/switch-DJTBR0xh.js +0 -1
  269. package/dist/client/assets/table-ujnX7HJ5.js +0 -1
  270. package/dist/client/assets/textarea-DaCUK96G.js +0 -1
  271. package/dist/client/assets/tooltip-DZelUdM0.js +0 -1
  272. package/dist/client/assets/use-capability-D0k-04nV.js +0 -1
  273. package/dist/client/assets/use-connection-DgGg0YyB.js +0 -1
  274. package/dist/client/assets/use-copy-B8BHxthn.js +0 -1
  275. package/dist/client/assets/use-create-virtual-mcp-BIiePYSF.js +0 -1
  276. package/dist/client/assets/use-deco-credits-Mx2CqZEN.js +0 -1
  277. package/dist/client/assets/use-file-configs-CoOJ1-eP.js +0 -1
  278. package/dist/client/assets/use-mcp-client-Dlrc-MQT.js +0 -10
  279. package/dist/client/assets/use-navigate-to-agent-YIuMJGpH.js +0 -1
  280. package/dist/client/assets/use-organization-settings-MrFZCmt9.js +0 -1
  281. package/dist/client/assets/use-secrets-Cl4CjxvR.js +0 -1
  282. package/dist/client/assets/useInfiniteQuery-l1kRSOtu.js +0 -1
  283. package/dist/client/assets/useRouterState-JYZfxOr3.js +0 -1
  284. package/dist/client/assets/useSuspenseInfiniteQuery-CFjEx0xH.js +0 -1
  285. package/dist/client/assets/variant-calendar-wUxggbqL.js +0 -1
  286. package/dist/client/assets/view-mode-toggle-Bo4aZcGU.js +0 -1
@@ -0,0 +1 @@
1
+ import"./index-D0U_smqt.js";import{e as w}from"./backoff-CrEUbyZT.js";const A={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},p=Object.values(A),y=3e4,v=1e3;function _(n){const{buildUrl:u,eventTypes:d,name:a,crossTab:f=!1}=n,o=new Map,i=f&&typeof BroadcastChannel<"u"&&typeof navigator<"u"&&typeof navigator.locks<"u";if(i&&!a)throw new Error("createSSESubscription: `name` is required when crossTab");function l(e,t){e.bootDone=!0;for(const s of e.handlers)try{s(t)}catch{}}function h(e){for(const t of e.reconnectHandlers)try{t()}catch{}}function E(e){const t=new EventSource(u(e.key));e.es=t,t.onopen=()=>{e.reconnectAttempt=0,e.bootDone&&(h(e),e.channel?.postMessage({kind:"reconnect"})),e.bootDone=!0},t.onerror=()=>{e.es===t&&t.readyState===EventSource.CLOSED&&b(e)};const s=r=>{e.channel?.postMessage({kind:"event",type:r.type,data:r.data}),l(e,r)};for(const r of d)t.addEventListener(r,s)}function b(e){if(e.refCount<=0||e.reconnectTimer)return;const t=w(y,v,e.reconnectAttempt,2,0);e.reconnectAttempt++,e.reconnectTimer=setTimeout(()=>{e.reconnectTimer=null,!(e.refCount<=0||!e.isLeader)&&(e.es?.close(),E(e))},t)}function T(e){if(e.refCount<=0){e.releaseLeadership?.(),e.releaseLeadership=null;return}e.isLeader=!0,E(e)}function S(e){if(!i){T(e);return}e.lockAbort=new AbortController,navigator.locks.request(`sse-leader:${a}:${e.key}`,{signal:e.lockAbort.signal},()=>new Promise(t=>{e.releaseLeadership=t,T(e)})).catch(()=>{})}function C(e,t){t.kind==="event"?l(e,new MessageEvent(t.type,{data:t.data})):t.kind==="reconnect"&&h(e)}function m(e){const t=o.get(e);if(t)return t;const s={key:e,refCount:0,handlers:new Set,reconnectHandlers:new Set,bootDone:!1,es:null,isLeader:!1,reconnectAttempt:0,reconnectTimer:null,channel:null,lockAbort:null,releaseLeadership:null};if(o.set(e,s),i){const r=new BroadcastChannel(`sse:${a}:${e}`);r.onmessage=c=>C(s,c.data),s.channel=r}return S(s),s}function L(e){e.reconnectTimer&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=null),e.es?.close(),e.es=null,e.releaseLeadership?.(),e.releaseLeadership=null,e.lockAbort?.abort(),e.lockAbort=null,e.channel?.close(),e.channel=null,o.delete(e.key)}return{subscribe(e,t,s){const r=m(e);r.refCount++,r.handlers.add(t),s&&r.reconnectHandlers.add(s);let c=!1;return()=>{c||(c=!0,r.handlers.delete(t),s&&r.reconnectHandlers.delete(s),r.refCount--,r.refCount<=0&&L(r))}}}}function k(n,u){const d=new Set(u);return{subscribe(a,f,o){const i=l=>{d.has(l.type)&&f(l)};return n.subscribe(a,i,o)}}}const D=[...p],g=[...p],O=_({name:"watch",buildUrl:n=>`/api/${encodeURIComponent(n)}/watch?types=${D.join(",")}`,eventTypes:g,crossTab:!0}),H=k(O,[...p]),P=H;export{A as D,P as d};
@@ -0,0 +1 @@
1
+ function m(o,t={}){const{signal:e}=t;return e?.aborted?Promise.reject(e.reason):new Promise((r,u)=>{const n=()=>{clearTimeout(+i),u(e?.reason)},i=a(()=>{e?.removeEventListener("abort",n),r()},o);e?.addEventListener("abort",n,{once:!0})})}const s=2**31-1;function a(o,t){if(t=Math.trunc(Math.max(t,0)||0),t<=s){const n=Number(setTimeout(o,t));return{valueOf:()=>n}}const e=Date.now();let r;const u=()=>{const n=t-(Date.now()-e);r=n>s?Number(setTimeout(u,s)):Number(setTimeout(o,n))};return u(),{valueOf:()=>r}}export{m as d};
@@ -0,0 +1 @@
1
+ import{c as n,j as i,cA as u,l as c,bR as m,dp as x,dq as j,cB as N,cC as b,dr as g,ds as D}from"./index-D0U_smqt.js";import{i as h}from"./X-BmA2kYv-.js";function z(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(b,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(g,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function R(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function T(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{T as D,E as a,O as b,R as c,z as d,B as e,w as f,v as g,y as h,k as i};
@@ -1 +1 @@
1
- import{e as X,p as H,F as U,r as W,K as J,m as ee,a as Z,t as te,n as p,j as i,B as $}from"./index-EQfvflqN.js";import{u as ie}from"./studio-tools-CcZtrETh.js";import{b as se,S as ne,a as oe}from"./settings-section-Xa6gQanu.js";import{B as Q}from"./badge-r4de0kry.js";import{I as ae}from"./input-DSpuivwc.js";import{d as re,b as le,c as ce,S as de,a as me}from"./select-Cr8ncrzb.js";const ue={off:"Off",auto:"Auto-join",request:"Require approval"};function fe(e,t){switch(e){case"auto":return`Anyone with a verified @${t} email joins automatically.`;case"request":return`People with a verified @${t} email can request to join; an admin approves.`;default:return"Not discoverable — no one can find or join through this domain."}}function be(){const e=X.c(69),{org:t}=H(),u=U(),s=ie(),[l,x]=W.useState("");let r;e[0]!==t.id?(r=J.organizationDomains(t.id),e[0]=t.id,e[1]=r):r=e[1];let c;e[2]!==s?(c=()=>s.call("ORGANIZATION_DOMAIN_LIST",{}),e[2]=s,e[3]=c):c=e[3];let d;e[4]!==r||e[5]!==c?(d={queryKey:r,queryFn:c},e[4]=r,e[5]=c,e[6]=d):d=e[6];const{data:f,isPending:j}=ee(d);let m;e[7]!==t.id||e[8]!==u?(m=()=>u.invalidateQueries({queryKey:J.organizationDomains(t.id)}),e[7]=t.id,e[8]=u,e[9]=m):m=e[9];const n=m;let N;e[10]!==s?(N=o=>s.call("ORGANIZATION_DOMAIN_ADD",{domain:o}),e[10]=s,e[11]=N):N=e[11];let v;e[12]!==n||e[13]!==t.id?(v=()=>{te("organization_domain_added",{organization_id:t.id}),x(""),n(),p.success("Domain added")},e[12]=n,e[13]=t.id,e[14]=v):v=e[14];let R;e[15]!==N||e[16]!==v?(R={mutationFn:N,onSuccess:v,onError:je},e[15]=N,e[16]=v,e[17]=R):R=e[17];const h=Z(R);let S;e[18]!==s?(S=o=>{const{id:a,joinMode:g}=o;return s.call("ORGANIZATION_DOMAIN_UPDATE",{id:a,joinMode:g})},e[18]=s,e[19]=S):S=e[19];let y;e[20]!==n?(y=()=>{n(),p.success("Join mode updated")},e[20]=n,e[21]=y):y=e[21];let V;e[22]!==S||e[23]!==y?(V={mutationFn:S,onSuccess:y,onError:ge},e[22]=S,e[23]=y,e[24]=V):V=e[24];const P=Z(V);let _;e[25]!==s?(_=o=>s.call("ORGANIZATION_DOMAIN_VERIFY",{id:o}),e[25]=s,e[26]=_):_=e[26];let A;e[27]!==n?(A=o=>{n(),o.verified?p.success("Domain verified"):p.error("TXT record not found yet — DNS can take a few minutes.")},e[27]=n,e[28]=A):A=e[28];let k;e[29]!==_||e[30]!==A?(k={mutationFn:_,onSuccess:A,onError:he},e[29]=_,e[30]=A,e[31]=k):k=e[31];const D=Z(k);let I;e[32]!==s?(I=o=>s.call("ORGANIZATION_DOMAIN_REMOVE",{id:o}),e[32]=s,e[33]=I):I=e[33];let b;e[34]!==n?(b=()=>{n(),p.success("Domain removed")},e[34]=n,e[35]=b):b=e[35];let q;e[36]!==I||e[37]!==b?(q={mutationFn:I,onSuccess:b,onError:xe},e[36]=I,e[37]=b,e[38]=q):q=e[38];const E=Z(q);if(j)return null;let z;e[39]!==f?.domains?(z=f?.domains??[],e[39]=f?.domains,e[40]=z):z=e[40];const K=z;let O;if(e[41]!==K||e[42]!==E||e[43]!==P||e[44]!==D){let o;e[46]!==E||e[47]!==P||e[48]!==D?(o=a=>{const g=a.verificationStatus==="verified";return i.jsx(se,{title:i.jsxs("span",{className:"flex items-center gap-2",children:[a.domain,g?i.jsx(Q,{variant:"secondary",children:"Verified"}):i.jsx(Q,{variant:"outline",children:"Pending"})]}),description:g?fe(a.joinMode,a.domain):"Add the DNS record below, then verify.",action:i.jsxs("div",{className:"flex items-center gap-2",children:[g&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-xs text-muted-foreground",children:"Join mode"}),i.jsxs(re,{value:a.joinMode,onValueChange:Y=>P.mutate({id:a.id,joinMode:Y}),children:[i.jsx(le,{className:"w-44",size:"sm",children:i.jsx(ce,{})}),i.jsx(de,{children:["off","auto","request"].map(pe)})]})]}),!g&&i.jsx($,{size:"sm",variant:"outline",onClick:()=>D.mutate(a.id),disabled:D.isPending,children:"Verify"}),i.jsx($,{size:"sm",variant:"ghost",onClick:()=>E.mutate(a.id),disabled:E.isPending,children:"Remove"})]}),children:!g&&a.recordName&&a.recordValue&&i.jsx(Ne,{recordName:a.recordName,recordValue:a.recordValue})},a.id)},e[46]=E,e[47]=P,e[48]=D,e[49]=o):o=e[49],O=K.map(o),e[41]=K,e[42]=E,e[43]=P,e[44]=D,e[45]=O}else O=e[45];let B;e[50]===Symbol.for("react.memo_cache_sentinel")?(B=o=>x(o.target.value),e[50]=B):B=e[50];let M;e[51]!==l?(M=i.jsx(ae,{value:l,onChange:B,placeholder:"acme.com",className:"max-w-xs"}),e[51]=l,e[52]=M):M=e[52];let T;e[53]!==h||e[54]!==l?(T=()=>h.mutate(l.trim()),e[53]=h,e[54]=l,e[55]=T):T=e[55];let C;e[56]!==h.isPending||e[57]!==l?(C=!l.trim()||h.isPending,e[56]=h.isPending,e[57]=l,e[58]=C):C=e[58];const L=h.isPending?"Adding…":"Add domain";let F;e[59]!==T||e[60]!==C||e[61]!==L?(F=i.jsx($,{size:"sm",onClick:T,disabled:C,children:L}),e[59]=T,e[60]=C,e[61]=L,e[62]=F):F=e[62];let w;e[63]!==M||e[64]!==F?(w=i.jsxs("div",{className:"flex items-center gap-2 p-4",children:[M,F]}),e[63]=M,e[64]=F,e[65]=w):w=e[65];let G;return e[66]!==O||e[67]!==w?(G=i.jsx(ne,{title:"Email domains",description:"Let people with a matching email domain discover and join this organization.",children:i.jsxs(oe,{children:[O,w]})}),e[66]=O,e[67]=w,e[68]=G):G=e[68],G}function pe(e){return i.jsx(me,{value:e,children:ue[e]},e)}function xe(e){return p.error(e instanceof Error?e.message:"Failed to remove")}function he(e){return p.error(e instanceof Error?e.message:"Failed to verify")}function ge(e){return p.error(e instanceof Error?e.message:"Failed to update")}function je(e){return p.error(e instanceof Error?e.message:"Failed to add domain")}function Ne(e){const t=X.c(16),{recordName:u,recordValue:s}=e,l=ve;let x;t[0]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx("p",{className:"text-muted-foreground",children:"Add this TXT record at your DNS provider, then click Verify:"}),t[0]=x):x=t[0];let r;t[1]!==u?(r=()=>l(u),t[1]=u,t[2]=r):r=t[2];let c;t[3]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("span",{className:"text-muted-foreground",children:"TXT "}),t[3]=c):c=t[3];let d;t[4]!==u||t[5]!==r?(d=i.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:r,children:[c,u]}),t[4]=u,t[5]=r,t[6]=d):d=t[6];let f;t[7]!==s?(f=()=>l(s),t[7]=s,t[8]=f):f=t[8];let j;t[9]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsx("span",{className:"text-muted-foreground",children:"value "}),t[9]=j):j=t[9];let m;t[10]!==s||t[11]!==f?(m=i.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:f,children:[j,s]}),t[10]=s,t[11]=f,t[12]=m):m=t[12];let n;return t[13]!==d||t[14]!==m?(n=i.jsxs("div",{className:"mt-3 rounded-lg border border-border bg-muted/40 p-3 text-xs space-y-2",children:[x,i.jsxs("div",{className:"grid gap-1",children:[d,m]})]}),t[13]=d,t[14]=m,t[15]=n):n=t[15],n}function ve(e){navigator.clipboard?.writeText(e),p.success("Copied")}export{be as D};
1
+ import{c as X,s as H,I as U,r as W,K as J,k as ee,d as Z,p as te,t as p,j as i,B as $}from"./index-D0U_smqt.js";import{u as ie}from"./studio-tools-DO12gBMa.js";import{b as se,S as ne,a as oe}from"./settings-section-C-zTpCRT.js";import{B as Q}from"./badge-DSiiJMKS.js";import{I as ae}from"./input-Ccm3ShdT.js";import{d as re,b as le,c as ce,S as de,a as me}from"./select-COSJe-70.js";const ue={off:"Off",auto:"Auto-join",request:"Require approval"};function fe(e,t){switch(e){case"auto":return`Anyone with a verified @${t} email joins automatically.`;case"request":return`People with a verified @${t} email can request to join; an admin approves.`;default:return"Not discoverable — no one can find or join through this domain."}}function be(){const e=X.c(69),{org:t}=H(),u=U(),s=ie(),[l,x]=W.useState("");let r;e[0]!==t.id?(r=J.organizationDomains(t.id),e[0]=t.id,e[1]=r):r=e[1];let c;e[2]!==s?(c=()=>s.call("ORGANIZATION_DOMAIN_LIST",{}),e[2]=s,e[3]=c):c=e[3];let d;e[4]!==r||e[5]!==c?(d={queryKey:r,queryFn:c},e[4]=r,e[5]=c,e[6]=d):d=e[6];const{data:f,isPending:j}=ee(d);let m;e[7]!==t.id||e[8]!==u?(m=()=>u.invalidateQueries({queryKey:J.organizationDomains(t.id)}),e[7]=t.id,e[8]=u,e[9]=m):m=e[9];const n=m;let N;e[10]!==s?(N=o=>s.call("ORGANIZATION_DOMAIN_ADD",{domain:o}),e[10]=s,e[11]=N):N=e[11];let v;e[12]!==n||e[13]!==t.id?(v=()=>{te("organization_domain_added",{organization_id:t.id}),x(""),n(),p.success("Domain added")},e[12]=n,e[13]=t.id,e[14]=v):v=e[14];let P;e[15]!==N||e[16]!==v?(P={mutationFn:N,onSuccess:v,onError:je},e[15]=N,e[16]=v,e[17]=P):P=e[17];const h=Z(P);let S;e[18]!==s?(S=o=>{const{id:a,joinMode:g}=o;return s.call("ORGANIZATION_DOMAIN_UPDATE",{id:a,joinMode:g})},e[18]=s,e[19]=S):S=e[19];let y;e[20]!==n?(y=()=>{n(),p.success("Join mode updated")},e[20]=n,e[21]=y):y=e[21];let R;e[22]!==S||e[23]!==y?(R={mutationFn:S,onSuccess:y,onError:ge},e[22]=S,e[23]=y,e[24]=R):R=e[24];const F=Z(R);let _;e[25]!==s?(_=o=>s.call("ORGANIZATION_DOMAIN_VERIFY",{id:o}),e[25]=s,e[26]=_):_=e[26];let A;e[27]!==n?(A=o=>{n(),o.verified?p.success("Domain verified"):p.error("TXT record not found yet — DNS can take a few minutes.")},e[27]=n,e[28]=A):A=e[28];let V;e[29]!==_||e[30]!==A?(V={mutationFn:_,onSuccess:A,onError:he},e[29]=_,e[30]=A,e[31]=V):V=e[31];const D=Z(V);let I;e[32]!==s?(I=o=>s.call("ORGANIZATION_DOMAIN_REMOVE",{id:o}),e[32]=s,e[33]=I):I=e[33];let b;e[34]!==n?(b=()=>{n(),p.success("Domain removed")},e[34]=n,e[35]=b):b=e[35];let q;e[36]!==I||e[37]!==b?(q={mutationFn:I,onSuccess:b,onError:xe},e[36]=I,e[37]=b,e[38]=q):q=e[38];const E=Z(q);if(j)return null;let z;e[39]!==f?.domains?(z=f?.domains??[],e[39]=f?.domains,e[40]=z):z=e[40];const K=z;let O;if(e[41]!==K||e[42]!==E||e[43]!==F||e[44]!==D){let o;e[46]!==E||e[47]!==F||e[48]!==D?(o=a=>{const g=a.verificationStatus==="verified";return i.jsx(se,{title:i.jsxs("span",{className:"flex items-center gap-2",children:[a.domain,g?i.jsx(Q,{variant:"secondary",children:"Verified"}):i.jsx(Q,{variant:"outline",children:"Pending"})]}),description:g?fe(a.joinMode,a.domain):"Add the DNS record below, then verify.",action:i.jsxs("div",{className:"flex items-center gap-2",children:[g&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-xs text-muted-foreground",children:"Join mode"}),i.jsxs(re,{value:a.joinMode,onValueChange:Y=>F.mutate({id:a.id,joinMode:Y}),children:[i.jsx(le,{className:"w-44",size:"sm",children:i.jsx(ce,{})}),i.jsx(de,{children:["off","auto","request"].map(pe)})]})]}),!g&&i.jsx($,{size:"sm",variant:"outline",onClick:()=>D.mutate(a.id),disabled:D.isPending,children:"Verify"}),i.jsx($,{size:"sm",variant:"ghost",onClick:()=>E.mutate(a.id),disabled:E.isPending,children:"Remove"})]}),children:!g&&a.recordName&&a.recordValue&&i.jsx(Ne,{recordName:a.recordName,recordValue:a.recordValue})},a.id)},e[46]=E,e[47]=F,e[48]=D,e[49]=o):o=e[49],O=K.map(o),e[41]=K,e[42]=E,e[43]=F,e[44]=D,e[45]=O}else O=e[45];let B;e[50]===Symbol.for("react.memo_cache_sentinel")?(B=o=>x(o.target.value),e[50]=B):B=e[50];let M;e[51]!==l?(M=i.jsx(ae,{value:l,onChange:B,placeholder:"acme.com",className:"max-w-xs"}),e[51]=l,e[52]=M):M=e[52];let T;e[53]!==h||e[54]!==l?(T=()=>h.mutate(l.trim()),e[53]=h,e[54]=l,e[55]=T):T=e[55];let C;e[56]!==h.isPending||e[57]!==l?(C=!l.trim()||h.isPending,e[56]=h.isPending,e[57]=l,e[58]=C):C=e[58];const L=h.isPending?"Adding…":"Add domain";let k;e[59]!==T||e[60]!==C||e[61]!==L?(k=i.jsx($,{size:"sm",onClick:T,disabled:C,children:L}),e[59]=T,e[60]=C,e[61]=L,e[62]=k):k=e[62];let w;e[63]!==M||e[64]!==k?(w=i.jsxs("div",{className:"flex items-center gap-2 p-4",children:[M,k]}),e[63]=M,e[64]=k,e[65]=w):w=e[65];let G;return e[66]!==O||e[67]!==w?(G=i.jsx(ne,{title:"Email domains",description:"Let people with a matching email domain discover and join this organization.",children:i.jsxs(oe,{children:[O,w]})}),e[66]=O,e[67]=w,e[68]=G):G=e[68],G}function pe(e){return i.jsx(me,{value:e,children:ue[e]},e)}function xe(e){return p.error(e instanceof Error?e.message:"Failed to remove")}function he(e){return p.error(e instanceof Error?e.message:"Failed to verify")}function ge(e){return p.error(e instanceof Error?e.message:"Failed to update")}function je(e){return p.error(e instanceof Error?e.message:"Failed to add domain")}function Ne(e){const t=X.c(16),{recordName:u,recordValue:s}=e,l=ve;let x;t[0]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx("p",{className:"text-muted-foreground",children:"Add this TXT record at your DNS provider, then click Verify:"}),t[0]=x):x=t[0];let r;t[1]!==u?(r=()=>l(u),t[1]=u,t[2]=r):r=t[2];let c;t[3]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("span",{className:"text-muted-foreground",children:"TXT "}),t[3]=c):c=t[3];let d;t[4]!==u||t[5]!==r?(d=i.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:r,children:[c,u]}),t[4]=u,t[5]=r,t[6]=d):d=t[6];let f;t[7]!==s?(f=()=>l(s),t[7]=s,t[8]=f):f=t[8];let j;t[9]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsx("span",{className:"text-muted-foreground",children:"value "}),t[9]=j):j=t[9];let m;t[10]!==s||t[11]!==f?(m=i.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:f,children:[j,s]}),t[10]=s,t[11]=f,t[12]=m):m=t[12];let n;return t[13]!==d||t[14]!==m?(n=i.jsxs("div",{className:"mt-3 rounded-lg border border-border bg-muted/40 p-3 text-xs space-y-2",children:[x,i.jsxs("div",{className:"grid gap-1",children:[d,m]})]}),t[13]=d,t[14]=m,t[15]=n):n=t[15],n}function ve(e){navigator.clipboard?.writeText(e),p.success("Copied")}export{be as D};
@@ -0,0 +1 @@
1
+ import{c as d,j as s,cs as i,l as c}from"./index-D0U_smqt.js";function x(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Root,{"data-slot":"drawer",...t}),e[2]=t,e[3]=a):a=e[3],a}function v(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Trigger,{"data-slot":"drawer-trigger",...t}),e[2]=t,e[3]=a):a=e[3],a}function w(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Portal,{"data-slot":"drawer-portal",...t}),e[2]=t,e[3]=a):a=e[3],a}function b(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Close,{"data-slot":"drawer-close",...t}),e[2]=t,e[3]=a):a=e[3],a}function m(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Overlay,{"data-slot":"drawer-overlay",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function g(l){const e=d.c(12);let t,a,r;e[0]!==l?({className:a,children:t,...r}=l,e[0]=l,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(m,{}),e[4]=o):o=e[4];let n;e[5]!==a?(n=c("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[95vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",a),e[5]=a,e[6]=n):n=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=f):f=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==n?(u=s.jsxs(w,{"data-slot":"drawer-portal",children:[o,s.jsxs(i.Content,{"data-slot":"drawer-content",className:n,...r,children:[f,t]})]}),e[8]=t,e[9]=r,e[10]=n,e[11]=u):u=e[11],u}function h(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("flex flex-col gap-1.5 px-4 py-2",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-header",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function j(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("mt-auto flex flex-col gap-2 p-4",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-footer",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function D(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-foreground font-semibold",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Title,{"data-slot":"drawer-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function N(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Description,{"data-slot":"drawer-description",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}export{x as D,g as a,D as b,h as c,N as d,b as e,j as f,v as g};
@@ -0,0 +1 @@
1
+ import{c,j as d,dX as f,dY as m,l as u,dZ as g,d_ as x,d$ as v,e0 as b,e1 as h,e2 as w,e3 as j,e4 as N,e5 as z,e6 as _,e7 as y,e8 as p}from"./index-D0U_smqt.js";import{i as $}from"./Check-D3J8f8u-.js";import{i as D}from"./ChevronRight-KEtpzT4P.js";import{i as M}from"./DotsVertical-BM5d8Pc7.js";function C(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(f,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(m,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function E(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,sideOffset:o,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);const n=o===void 0?4:o;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let i;return e[6]!==s||e[7]!==n||e[8]!==r?(i=d.jsx(x,{children:d.jsx(v,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...s})}),e[6]=s,e[7]=n,e[8]=r,e[9]=i):i=e[9],i}function G(a){const e=c.c(12);let t,s,o,n;e[0]!==a?({className:t,inset:s,variant:n,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);const r=n===void 0?"default":n;let i;e[5]!==t?(i=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=i):i=e[6];let l;return e[7]!==s||e[8]!==o||e[9]!==i||e[10]!==r?(l=d.jsx(g,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":r,className:i,...o}),e[7]=s,e[8]=o,e[9]=i,e[10]=r,e[11]=l):l=e[11],l}function L(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:o,children:s,checked:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:d.jsx(p,{children:d.jsx($,{className:"size-4"})})}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==n||e[11]!==r?(l=d.jsxs(h,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:t,...n,children:[i,s]}),e[8]=t,e[9]=s,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function O(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(_,{"data-slot":"dropdown-menu-radio-group",...t}),e[2]=t,e[3]=s):s=e[3],s}function P(a){const e=c.c(11);let t,s,o;e[0]!==a?({className:s,children:t,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==s?(n=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[4]=s,e[5]=n):n=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=d.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:d.jsx(p,{children:d.jsx(M,{className:"size-2 fill-current"})})}),e[6]=r):r=e[6];let i;return e[7]!==t||e[8]!==o||e[9]!==n?(i=d.jsxs(y,{"data-slot":"dropdown-menu-radio-item",className:n,...o,children:[r,t]}),e[7]=t,e[8]=o,e[9]=n,e[10]=i):i=e[10],i}function X(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,inset:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==t?(n=u("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),e[4]=t,e[5]=n):n=e[5];let r;return e[6]!==s||e[7]!==o||e[8]!==n?(r=d.jsx(b,{"data-slot":"dropdown-menu-label","data-inset":s,className:n,...o}),e[6]=s,e[7]=o,e[8]=n,e[9]=r):r=e[9],r}function Y(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=d.jsx(w,{"data-slot":"dropdown-menu-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}function Z(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(j,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=s):s=e[3],s}function q(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:s,inset:o,children:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==s?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",s),e[5]=s,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(D,{className:"ml-auto size-4"}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==o||e[10]!==n||e[11]!==r?(l=d.jsxs(N,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:r,...n,children:[t,i]}),e[8]=t,e[9]=o,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function A(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=d.jsx(z,{"data-slot":"dropdown-menu-sub-content",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}export{C as D,T as a,E as b,G as c,Z as d,q as e,A as f,Y as g,P as h,X as i,O as j,L as k};
@@ -1 +1 @@
1
- import{e as v,c as N,j as t}from"./index-EQfvflqN.js";function y(){const x=v.c(1);let e;return x[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),x[0]=e):e=x[0],e}function C(x){const e=v.c(24),{image:f,title:p,description:u,actions:o,className:h,descriptionClassName:j,actionsClassName:g}=x;let s;e[0]!==h?(s=N("flex flex-1 flex-col items-center justify-center gap-8 p-4",h),e[0]=h,e[1]=s):s=e[1];let l;e[2]!==f?(l=f!==null&&t.jsx("div",{className:"flex items-center justify-center",children:f??t.jsx(y,{})}),e[2]=f,e[3]=l):l=e[3];let i;e[4]!==p?(i=t.jsx("h3",{className:"text-lg font-medium text-foreground",children:p}),e[4]=p,e[5]=i):i=e[5];let c;e[6]!==j?(c=N("text-sm text-muted-foreground text-center max-w-[300px]",j),e[6]=j,e[7]=c):c=e[7];let a;e[8]!==u||e[9]!==c?(a=t.jsx("div",{className:c,children:u}),e[8]=u,e[9]=c,e[10]=a):a=e[10];let n;e[11]!==i||e[12]!==a?(n=t.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i,a]}),e[11]=i,e[12]=a,e[13]=n):n=e[13];let r;e[14]!==o||e[15]!==g?(r=o&&t.jsx("div",{className:N("flex items-center gap-2",g),children:o}),e[14]=o,e[15]=g,e[16]=r):r=e[16];let m;e[17]!==n||e[18]!==r?(m=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[n,r]}),e[17]=n,e[18]=r,e[19]=m):m=e[19];let d;return e[20]!==s||e[21]!==l||e[22]!==m?(d=t.jsxs("div",{className:s,children:[l,m]}),e[20]=s,e[21]=l,e[22]=m,e[23]=d):d=e[23],d}export{C as E};
1
+ import{c as v,l as N,j as t}from"./index-D0U_smqt.js";function y(){const x=v.c(1);let e;return x[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),x[0]=e):e=x[0],e}function C(x){const e=v.c(24),{image:f,title:p,description:u,actions:o,className:h,descriptionClassName:j,actionsClassName:g}=x;let s;e[0]!==h?(s=N("flex flex-1 flex-col items-center justify-center gap-8 p-4",h),e[0]=h,e[1]=s):s=e[1];let l;e[2]!==f?(l=f!==null&&t.jsx("div",{className:"flex items-center justify-center",children:f??t.jsx(y,{})}),e[2]=f,e[3]=l):l=e[3];let i;e[4]!==p?(i=t.jsx("h3",{className:"text-lg font-medium text-foreground",children:p}),e[4]=p,e[5]=i):i=e[5];let c;e[6]!==j?(c=N("text-sm text-muted-foreground text-center max-w-[300px]",j),e[6]=j,e[7]=c):c=e[7];let a;e[8]!==u||e[9]!==c?(a=t.jsx("div",{className:c,children:u}),e[8]=u,e[9]=c,e[10]=a):a=e[10];let n;e[11]!==i||e[12]!==a?(n=t.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i,a]}),e[11]=i,e[12]=a,e[13]=n):n=e[13];let r;e[14]!==o||e[15]!==g?(r=o&&t.jsx("div",{className:N("flex items-center gap-2",g),children:o}),e[14]=o,e[15]=g,e[16]=r):r=e[16];let m;e[17]!==n||e[18]!==r?(m=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[n,r]}),e[17]=n,e[18]=r,e[19]=m):m=e[19];let d;return e[20]!==s||e[21]!==l||e[22]!==m?(d=t.jsxs("div",{className:s,children:[l,m]}),e[20]=s,e[21]=l,e[22]=m,e[23]=d):d=e[23],d}export{C as E};
@@ -1 +1 @@
1
- import"./index-EQfvflqN.js";import{W as T,d as O}from"./use-mcp-client-Dlrc-MQT.js";const x="mcp.mesh";function U(e){if(!e)return null;const t=typeof e=="string"?e:e.url;if(!t)return null;const n=t.match(/github\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?\/?$/);return n?{owner:n[1]||"",repo:n[2]||""}:null}function H(e){const t=U(e);if(!t)return null;const n=`https://github.com/${t.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(n)}&output=webp`}function L(e,t){return e===T.REGISTRY(t)||e===T.COMMUNITY_REGISTRY(t)}function q(e,t){return L(e,t)?"COLLECTION_REGISTRY_APP_LIST":"REGISTRY_ITEM_LIST"}function B(e){if(!e)return[];const t=[];for(const n of e){let a=[];if(Array.isArray(n))a=n;else if(typeof n=="object"&&n!==null){const r=Object.keys(n).find(o=>Array.isArray(n[o]));r&&(a=n[r])}t.push(...a)}return t}const Y={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function D(e){return e?Y[e]??e.toUpperCase():null}function J(e){if(!e)return[];if(Array.isArray(e))return e;if(typeof e=="object"&&e!==null){const t=Object.keys(e).find(n=>Array.isArray(e[n]));if(t)return e[t]}return[]}async function Q(e,t,n,a,r){const o=await O({connectionId:e,orgId:t,orgSlug:n});try{const s=await o.callTool({name:a,arguments:r});return s.structuredContent??s}finally{await o.close().catch(console.error)}}let G="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",$=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=G[n[e]&63];return t};function j(e){return`${e}_${$()}`}function K(e){return e._meta?.["mcp.mesh"]?.appName||e.server?.name||null}function V(e){if(!e?.url)return"Unknown";try{return new URL(e.url).hostname}catch{return e.url}}function W(e){const t=e?.identifier||e?.name;return t?t.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,a=>a.toUpperCase()):"Unknown"}function X(e,t,n,a){const r=e.server,o=e._meta?.[x],s=new Date().toISOString(),I=o?.friendlyName||o?.friendly_name||e.title||r?.title||r?.name||"Unnamed MCP Server",R=r?.description||null,k=r?.icons?.[0]?.src||H(r?.repository)||null,i=o?.oauth_config,w=i&&typeof i.authorizationEndpoint=="string"&&typeof i.tokenEndpoint=="string"&&typeof i.clientId=="string"&&Array.isArray(i.scopes)&&(i.grantType==="authorization_code"||i.grantType==="client_credentials")?i:null,A=o?.configuration_state,C=o?.configuration_scopes,P=r?.repository?{url:r.repository.url,source:r.repository.source,subfolder:r.repository.subfolder}:null,p=r?.packages??[],m=r?.remotes??[],v=a?.packageIndex??0,S=a?.remoteIndex??0,y=p.length>0&&a?.packageIndex!==void 0,c=y?p[v]:null,l=y?null:m[S];let u,f,h=null;if(c){const _=c.identifier||c.name;u="STDIO",f="";const d={};if(c.environmentVariables)for(const b of c.environmentVariables)b.name&&(d[b.name]="");h={command:"npx",args:_?["-y",_]:[],...Object.keys(d).length>0&&{envVars:d}}}else l?(u=D(l.type)||"HTTP",f=l.url||""):(u="HTTP",f="");const N=m.length>1,M=p.length>1;let g="";c&&M?g=` (${W(c)})`:l&&N&&(g=` (${V(l)})`);const E=I+g;return{id:j("conn"),title:E,description:R,icon:k,app_name:K(e),app_id:o?.id||e.id||null,connection_type:u,connection_url:f,connection_token:null,connection_headers:h,oauth_config:w,configuration_state:A??null,configuration_scopes:C??null,metadata:{source:"store",registry_item_id:e.id,verified:o?.verified??!1,scopeName:o?.scopeName??null,toolsCount:o?.tools?.length??0,publishedAt:o?.publishedAt??null,repository:P},created_at:s,updated_at:s,created_by:n,organization_id:t,tools:null,bindings:null,status:"inactive"}}export{K as a,H as b,Q as c,J as d,X as e,B as f,j as g,q as i};
1
+ import"./index-D0U_smqt.js";import{W as T,e as O}from"./use-mcp-client-DilmxmKU.js";const x="mcp.mesh";function U(e){if(!e)return null;const t=typeof e=="string"?e:e.url;if(!t)return null;const n=t.match(/github\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?\/?$/);return n?{owner:n[1]||"",repo:n[2]||""}:null}function H(e){const t=U(e);if(!t)return null;const n=`https://github.com/${t.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(n)}&output=webp`}function L(e,t){return e===T.REGISTRY(t)||e===T.COMMUNITY_REGISTRY(t)}function q(e,t){return L(e,t)?"COLLECTION_REGISTRY_APP_LIST":"REGISTRY_ITEM_LIST"}function B(e){if(!e)return[];const t=[];for(const n of e){let a=[];if(Array.isArray(n))a=n;else if(typeof n=="object"&&n!==null){const r=Object.keys(n).find(o=>Array.isArray(n[o]));r&&(a=n[r])}t.push(...a)}return t}const Y={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function D(e){return e?Y[e]??e.toUpperCase():null}function J(e){if(!e)return[];if(Array.isArray(e))return e;if(typeof e=="object"&&e!==null){const t=Object.keys(e).find(n=>Array.isArray(e[n]));if(t)return e[t]}return[]}async function Q(e,t,n,a,r){const o=await O({connectionId:e,orgId:t,orgSlug:n});try{const s=await o.callTool({name:a,arguments:r});return s.structuredContent??s}finally{await o.close().catch(console.error)}}let G="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",$=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=G[n[e]&63];return t};function j(e){return`${e}_${$()}`}function K(e){return e._meta?.["mcp.mesh"]?.appName||e.server?.name||null}function V(e){if(!e?.url)return"Unknown";try{return new URL(e.url).hostname}catch{return e.url}}function W(e){const t=e?.identifier||e?.name;return t?t.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,a=>a.toUpperCase()):"Unknown"}function X(e,t,n,a){const r=e.server,o=e._meta?.[x],s=new Date().toISOString(),I=o?.friendlyName||o?.friendly_name||e.title||r?.title||r?.name||"Unnamed MCP Server",R=r?.description||null,k=r?.icons?.[0]?.src||H(r?.repository)||null,i=o?.oauth_config,w=i&&typeof i.authorizationEndpoint=="string"&&typeof i.tokenEndpoint=="string"&&typeof i.clientId=="string"&&Array.isArray(i.scopes)&&(i.grantType==="authorization_code"||i.grantType==="client_credentials")?i:null,A=o?.configuration_state,C=o?.configuration_scopes,P=r?.repository?{url:r.repository.url,source:r.repository.source,subfolder:r.repository.subfolder}:null,p=r?.packages??[],d=r?.remotes??[],v=a?.packageIndex??0,S=a?.remoteIndex??0,y=p.length>0&&a?.packageIndex!==void 0,c=y?p[v]:null,l=y?null:d[S];let u,f,h=null;if(c){const _=c.identifier||c.name;u="STDIO",f="";const m={};if(c.environmentVariables)for(const b of c.environmentVariables)b.name&&(m[b.name]="");h={command:"npx",args:_?["-y",_]:[],...Object.keys(m).length>0&&{envVars:m}}}else l?(u=D(l.type)||"HTTP",f=l.url||""):(u="HTTP",f="");const N=d.length>1,M=p.length>1;let g="";c&&M?g=` (${W(c)})`:l&&N&&(g=` (${V(l)})`);const E=I+g;return{id:j("conn"),title:E,description:R,icon:k,app_name:K(e),app_id:o?.id||e.id||null,connection_type:u,connection_url:f,connection_token:null,connection_headers:h,oauth_config:w,configuration_state:A??null,configuration_scopes:C??null,metadata:{source:"store",registry_item_id:e.id,verified:o?.verified??!1,scopeName:o?.scopeName??null,toolsCount:o?.tools?.length??0,publishedAt:o?.publishedAt??null,repository:P},created_at:s,updated_at:s,created_by:n,organization_id:t,tools:null,bindings:null,status:"inactive"}}export{K as a,H as b,Q as c,J as d,X as e,B as f,j as g,q as i};
@@ -0,0 +1,2 @@
1
+ import{c as Ke,r as l,j as i,i as re,B as fe,l as Ve,I as ut,t as $,K as Te}from"./index-D0U_smqt.js";import{F as mt,l as pt}from"./index-BsWl8UuV.js";import{e as ht,at as xt,au as gt,av as ae,aw as yt,N as $e}from"./agent-icon-Bcqwo2Wq.js";import{a as wt}from"./Tool01-CI_6KMgQ.js";import{s as jt}from"./XClose-BGGuhSdx.js";import{S as bt}from"./scroll-area-DbztbmuO.js";import{b as Oe,T as Re,a as ze}from"./tooltip-DO1R3Vmb.js";import{f as vt,a as Ct,b as Nt,c as St,d as Dt,e as kt,A as Ft,g as Lt}from"./alert-dialog-BZRM5ze7.js";import{u as Et}from"./chat-context-DnaexSAo.js";import{b as Pt}from"./shell-layout-BhblvLd4.js";import{ae as le,af as Ae,ag as Tt}from"./index-DvTimAjS.js";import{a as $t,b as Ot,D as Rt,e as zt,c as At,d as It}from"./dialog-CQ6B0IwC.js";import{I as Ie}from"./input-Ccm3ShdT.js";import{b as Wt,C as _,a as We,c as Mt,d as Kt}from"./context-menu-KaWlIbj1.js";import{t as Vt}from"./ChevronDown-Dilz0yBl.js";import{i as Bt}from"./ChevronRight-KEtpzT4P.js";import{a as Gt}from"./ZoomOut-xDQo2yr7.js";import{E as qt,z as Me,A as he,B as Qt,C as Ut,D as Jt,G as M,I as ce,g as xe,J as ge,K as Ht,M as Xt,N as ye,O as de,P as we,Q as Yt,U as Zt}from"./preview-dialog-CJENsRWm.js";import"./AlertCircle-Ccspj6_x.js";import"./SwitchHorizontal01-y3DhestF.js";import"./Settings02-Cg6Yp6Ig.js";import"./XCircle-CSVmVGl-.js";import"./ArrowRight-DjM-WAe8.js";import"./ArrowUpRight-tJm1fmd7.js";import"./ZapSquare-Bh6-lHaM.js";import"./Users03-CJf6bBEA.js";import"./CheckCircle-2NPq-6dO.js";import"./Check-D3J8f8u-.js";import"./ChevronLeft-CJ5DBM3M.js";import"./ChevronUp-B5x1falF.js";import"./DotsVertical-BM5d8Pc7.js";import"./Stars02-C2akJW-A.js";import"./Eye-hHNCwVZ1.js";import"./Globe01-DD8UM4Hn.js";import"./FilterLines-DfVdVEBp.js";import"./Star01-D42mJCl7.js";import"./Globe04-CHjKQaGv.js";import"./HardDrive-ClhqImrT.js";import"./Key01-BYHEvjL0.js";import"./LayoutLeft-BNwcfVCc.js";import"./LinkExternal01-BqsD3A6i.js";import"./Monitor01-BqllG5YD.js";import"./Sun-CgYYfF85.js";import"./Palette-CdtyN2t7.js";import"./Play-DpX5JUyA.js";import"./Plus-BaLwS14l.js";import"./SearchMd-CJ_dFCp5.js";import"./Shield01-DYwaNnY3.js";import"./Stars01-CrB442jN.js";import"./Trash01-Cd_0JhhN.js";import"./Upload01-ijsbLMSK.js";import"./User01-BI5RuTWy.js";import"./Users01-LhAUtJ2l.js";import"./X-BmA2kYv-.js";import"./Zap-C5OGTH44.js";import"./use-clock-tick-_1lW4UqP.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DyplBFAe.js";import"./file-type-icon-D0ASmNXK.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-pBNKtzBp.js";import"./use-mcp-client-DilmxmKU.js";import"./auth-rl3GT7t8.js";import"./hooks-CSfRJCjt.js";import"./decopilot-sse-pool-Dl1x5tdf.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-DO12gBMa.js";import"./sheet-CuyenB5M.js";import"./integration-icon-BjRqMG3n.js";import"./use-virtual-mcp-cixi9WNo.js";import"./use-collections-DRgt6Bb8.js";import"./use-navigate-to-agent-HvaD8xDj.js";import"./use-connection-XfA-QrSw.js";import"./use-mcp-prompts-D2ueJ3CD.js";import"./form-O9DEtf_L.js";import"./label-KRKjsQLR.js";import"./select-COSJe-70.js";import"./use-ai-providers-qobt2OiH.js";import"./use-organization-settings-B5vS3xHV.js";import"./avatar-CXZnLPEU.js";import"./required-auth-layout-D9FVCOQl.js";import"./use-org-sso-9Z0u5sV3.js";import"./index-CGoh8mx2.js";import"./drawer-mbT59SGx.js";import"./collection-search-2g11_WBH.js";import"./tabs-DPoZSyfS.js";import"./toggle-group-CW5GRzAp.js";import"./use-deco-credits-CyoNix9p.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DA1t_KQo.js";import"./use-registry-connections-DhFpf503.js";import"./useInfiniteQuery-C4arjVN1.js";import"./use-infinite-scroll-BbUZw7ju.js";import"./extract-connection-data-D-Y4GRfE.js";import"./card-DSDTRgoU.js";import"./collection-tabs-CDMyDuFK.js";import"./badge-DSiiJMKS.js";import"./textarea-DQwh6y_K.js";import"./connection-form-helpers-BqK6S8Yx.js";import"./useSuspenseInfiniteQuery-DTlBviqw.js";import"./mcp-oauth-Ccqa98JF.js";import"./connect-desktop-dialog-Dybq2Hx1.js";import"./decopilot-fUgUe2Eh.js";import"./checkbox-CL_5fiO_.js";import"./skeleton-DHas8e4O.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-C-zTpCRT.js";import"./popover-CQIMDVug.js";import"./command-Bw_f0kDn.js";import"./index-BRnQ22g3.js";import"./dropdown-menu-bs6nmOyP.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BSqGti4P.js";import"./empty-state-crYivviN.js";import"./toolbar-1QmqWl6-.js";import"./use-mcp-tools-uucJgbkt.js";import"./use-capability-C09ZF9_G.js";import"./shell-route-loading-ClsKn-Oj.js";import"./index-D_UY8Zf9.js";import"./switch-By8vCxNg.js";import"./use-debounced-autosave-DqciCJ__.js";import"./index-BFeGPSf0.js";import"./sidebar-BYFEz6-7.js";import"./search-input-C742tJr8.js";import"./github-repo-picker-CHTvfJAD.js";import"./use-secrets-DtlQfYRK.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-BNmCyKXO.js";import"./select-model-Cv_gN_vr.js";import"./use-automations-BwoNV2me.js";import"./monaco-editor-DztiaMte.js";import"./automation-runs-C-Da4MEd.js";import"./table-BgkbBxMz.js";import"./use-members-Y5iRty7v.js";import"./use-org-auth-client-Dl_7zTlg.js";import"./task-status-D9k3BLzM.js";import"./automation-list-row-DefMjeyu.js";const _t={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function en(y){const e=Ke.c(51),{open:c,mode:K,initialName:X,parentLabel:Q,isPending:A,onSubmit:V,onOpenChange:P}=y,I=X===void 0?"":X,o=A===void 0?!1:A,[p,O]=l.useState(I),[W,B]=l.useState(c),f=_t[K];c!==W&&(B(c),c&&O(I));let F;e[0]!==o||e[1]!==P?(F=E=>{!E&&!o&&P(!1)},e[0]=o,e[1]=P,e[2]=F):F=e[2];const U=F;let G;e[3]!==o||e[4]!==p||e[5]!==V?(G=async E=>{E.preventDefault();const z=p.trim();!z||o||await V(z)},e[3]=o,e[4]=p,e[5]=V,e[6]=G):G=e[6];const q=G;let L;e[7]!==f.title?(L=i.jsx($t,{children:f.title}),e[7]=f.title,e[8]=L):L=e[8];let N;e[9]!==f.description?(N=i.jsx(Ot,{children:f.description}),e[9]=f.description,e[10]=N):N=e[10];let R;e[11]!==L||e[12]!==N?(R=i.jsxs(Rt,{children:[L,N]}),e[11]=L,e[12]=N,e[13]=R):R=e[13];let S;e[14]!==Q?(S=Q&&i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),i.jsx(Ie,{value:Q,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=Q,e[15]=S):S=e[15];let D;e[16]===Symbol.for("react.memo_cache_sentinel")?(D=i.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=D):D=e[16];let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=E=>O(E.target.value),e[17]=j):j=e[17];let b;e[18]!==f.placeholder||e[19]!==o||e[20]!==p?(b=i.jsxs("div",{className:"space-y-1.5",children:[D,i.jsx(Ie,{id:"file-explorer-name",value:p,onChange:j,placeholder:f.placeholder,autoFocus:!0,disabled:o})]}),e[18]=f.placeholder,e[19]=o,e[20]=p,e[21]=b):b=e[21];let h;e[22]!==b||e[23]!==S?(h=i.jsxs("div",{className:"space-y-4 py-4",children:[S,b]}),e[22]=b,e[23]=S,e[24]=h):h=e[24];let x;e[25]!==P?(x=()=>P(!1),e[25]=P,e[26]=x):x=e[26];let v;e[27]!==o||e[28]!==x?(v=i.jsx(fe,{type:"button",variant:"outline",onClick:x,disabled:o,children:"Cancel"}),e[27]=o,e[28]=x,e[29]=v):v=e[29];let C;e[30]!==o||e[31]!==p?(C=!p.trim()||o,e[30]=o,e[31]=p,e[32]=C):C=e[32];let u;e[33]!==f.submit||e[34]!==o?(u=o?i.jsxs(i.Fragment,{children:[i.jsx(re,{size:14,className:"animate-spin"}),"Saving…"]}):f.submit,e[33]=f.submit,e[34]=o,e[35]=u):u=e[35];let k;e[36]!==C||e[37]!==u?(k=i.jsx(fe,{type:"submit",disabled:C,children:u}),e[36]=C,e[37]=u,e[38]=k):k=e[38];let m;e[39]!==v||e[40]!==k?(m=i.jsxs(zt,{children:[v,k]}),e[39]=v,e[40]=k,e[41]=m):m=e[41];let g;e[42]!==q||e[43]!==h||e[44]!==m||e[45]!==R?(g=i.jsx(At,{className:"sm:max-w-md",children:i.jsxs("form",{onSubmit:q,children:[R,h,m]})}),e[42]=q,e[43]=h,e[44]=m,e[45]=R,e[46]=g):g=e[46];let T;return e[47]!==U||e[48]!==c||e[49]!==g?(T=i.jsx(It,{open:c,onOpenChange:U,children:g}),e[47]=U,e[48]=c,e[49]=g,e[50]=T):T=e[50],T}const tn="#d9a441";function nn(y){const e=Ke.c(45),{node:c,depth:K,isExpanded:X,isSelected:Q,isLoading:A,fileVisual:V,onOpen:P,onSelect:I,onNewFile:o,onNewFolder:p,onCopyPath:O,onCopyRelativePath:W,onRename:B,onDelete:f}=y,F=A===void 0?!1:A,U=c.kind==="directory",{Icon:G,color:q}=V,L=Q&&"bg-accent";let N;e[0]!==L?(N=Ve("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",L),e[0]=L,e[1]=N):N=e[1];const R=`${K*14+8}px`;let S;e[2]!==R?(S={paddingLeft:R},e[2]=R,e[3]=S):S=e[3];let D;e[4]!==P||e[5]!==I?(D=()=>{I(),P()},e[4]=P,e[5]=I,e[6]=D):D=e[6];let j;e[7]!==G||e[8]!==q||e[9]!==U||e[10]!==X||e[11]!==F?(j=U?i.jsxs(i.Fragment,{children:[F?i.jsx(re,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):X?i.jsx(Vt,{size:14,className:"shrink-0 text-muted-foreground"}):i.jsx(Bt,{size:14,className:"shrink-0 text-muted-foreground"}),i.jsx(Gt,{size:16,className:"shrink-0",style:{color:tn}})]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"w-3.5 shrink-0"}),i.jsx(G,{size:16,className:"shrink-0",style:{color:q}})]}),e[7]=G,e[8]=q,e[9]=U,e[10]=X,e[11]=F,e[12]=j):j=e[12];let b;e[13]!==c.name?(b=i.jsx("span",{className:"truncate",children:c.name}),e[13]=c.name,e[14]=b):b=e[14];let h;e[15]!==N||e[16]!==S||e[17]!==D||e[18]!==j||e[19]!==b?(h=i.jsx(Wt,{asChild:!0,children:i.jsxs("button",{type:"button",className:N,style:S,onClick:D,children:[j,b]})}),e[15]=N,e[16]=S,e[17]=D,e[18]=j,e[19]=b,e[20]=h):h=e[20];let x;e[21]!==o?(x=i.jsx(_,{onSelect:o,children:"New File"}),e[21]=o,e[22]=x):x=e[22];let v;e[23]!==p?(v=i.jsx(_,{onSelect:p,children:"New Folder"}),e[23]=p,e[24]=v):v=e[24];let C;e[25]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(We,{}),e[25]=C):C=e[25];let u;e[26]!==O?(u=i.jsx(_,{onSelect:O,children:"Copy Path"}),e[26]=O,e[27]=u):u=e[27];let k;e[28]!==W?(k=i.jsx(_,{onSelect:W,children:"Copy Relative Path"}),e[28]=W,e[29]=k):k=e[29];let m;e[30]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(We,{}),e[30]=m):m=e[30];let g;e[31]!==B?(g=i.jsx(_,{onSelect:B,children:"Rename"}),e[31]=B,e[32]=g):g=e[32];let T;e[33]!==f?(T=i.jsx(_,{variant:"destructive",onSelect:f,children:"Delete"}),e[33]=f,e[34]=T):T=e[34];let E;e[35]!==x||e[36]!==v||e[37]!==u||e[38]!==k||e[39]!==g||e[40]!==T?(E=i.jsxs(Mt,{className:"w-52",children:[x,v,C,u,k,m,g,T]}),e[35]=x,e[36]=v,e[37]=u,e[38]=k,e[39]=g,e[40]=T,e[41]=E):E=e[41];let z;return e[42]!==E||e[43]!==h?(z=i.jsxs(Kt,{children:[h,E]}),e[42]=E,e[43]=h,e[44]=z):z=e[44],z}pt.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function je(y,e,c,K){return`/api/${y}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(c)}/${K}`}function rn(y){const e=M(y);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const sn="#94a3b8";function on(y){const e=y.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ae,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ae,color:"#d9a441"}:e.endsWith(".json")?{Icon:yt,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ae,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ae,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:wt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:$e,color:"#64748b"}:{Icon:$e,color:sn}}function Ii({orgSlug:y,virtualMcpId:e,branch:c,openPath:K}){const[X,Q]=l.useState({files:[],directories:[],truncated:!1}),{files:A,directories:V}=X,[P,I]=l.useState(new Set),[o,p]=l.useState(null),[O,W]=l.useState(null),[B,f]=l.useState([]),[F,U]=l.useState(""),[G,q]=l.useState(!1),[L,N]=l.useState(!1),[,R]=l.useState(new Set),[S,D]=l.useState(new Set),j=l.useRef(0),b=l.useRef(null),h=l.useRef(new Set),x=l.useRef(new Map);function v(t){R(n=>{const r=typeof t=="function"?t(n):t;return h.current=r,r})}const[C,u]=l.useState(new Map),k=l.useRef(null),[m,g]=l.useState(null),{sendMessage:T}=Et(),{setChatOpen:E}=Pt(),z=ut(),[w,J]=l.useState(null),[H,ue]=l.useState(null),[ee,ie]=l.useState(!1);async function te(t,n){const r=await fetch(je(y,e,c,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!r.ok){const s=await r.json().catch(()=>({}));throw new Error(s.error??`Request failed (${r.status})`)}return r.json()}async function se(){z.invalidateQueries({queryKey:Ae(y,e,c)})}function be(t,n){navigator.clipboard.writeText(n).then(()=>$.success(`${t} copied`),()=>$.error(`Failed to copy ${t.toLowerCase()}`))}function Be(t){const n=Yt(t);if(!n)return;const r=`${y}/${e}/${c}`;z.setQueryData(Te.decofile(r),s=>{if(!s)return s;const{[n]:a,...d}=s;return d}),z.invalidateQueries({queryKey:Te.liveMeta(r)})}function Ge(t){const n=t.kind==="file"?[t.path]:A.filter(r=>r.startsWith(".deco/blocks/")).map(r=>ce(r)).filter(r=>r===t.path||r.startsWith(`${t.path}/`));for(const r of n)Be(r)}function qe(t){const n=ce(t);return B.filter(r=>{if(r!==n&&!r.startsWith(`${n}/`))return!1;const s=C.get(r);return!!(s?.loaded&&s.editorValue!==s.savedContent)})}function ve(t){f(n=>n.map(r=>t(r)).filter(r=>r!==null)),p(n=>n&&t(n)),u(n=>{const r=new Map;for(const[s,a]of n){const d=t(s);d&&r.set(d,a)}return r}),W(n=>{if(!n)return n;const r=t(n.path);return r?r===n.path?n:{...n,path:r,name:r.split("/").pop()??r}:null})}function Qe(t){const n=ce(t);W(r=>r&&(r.path===n||r.path.startsWith(`${n}/`)?null:r)),ve(r=>r===n||r.startsWith(`${n}/`)?null:r)}async function Ue(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);await te("write",{path:M(n),content:""}),await ne(),await se(),J(null),me(n)}async function Je(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);const r=M(n);await te("mkdir",{path:r}),Q(s=>({...s,directories:s.directories.includes(r)?s.directories:[...s.directories,r]})),await ne(),await se(),J(null),I(s=>{const a=new Set(s);for(const d of he(n))a.add(d);return a.add(n),a}),W({name:t,path:n,kind:"directory",children:[]})}async function He(t){if(!w)return;const n=w.node.path,r=ye(n),s=de(r,t);if(s===n){J(null);return}if(we(s,A,V))throw new Error(`"${t}" already exists`);await te("rename",{from:M(n),to:M(s)}),ve(a=>a===n?s:a.startsWith(`${n}/`)?de(s,a.slice(n.length+1)):a),await ne(),await se(),J(null)}async function Xe(t){ie(!0);try{await te("unlink",{path:M(t.path),recursive:t.kind==="directory"}),Ge(t),Qe(t.path),await ne(),await se(),ue(null),$.success(`Deleted "${t.name}"`)}catch(n){$.error(n instanceof Error?n.message:"Delete failed")}finally{ie(!1)}}async function Ye(t){const n=Xt(t);if(n){$.error(n);return}ie(!0);try{w?.mode==="new-file"?(await Ue(t),$.success(`Created "${t}"`)):w?.mode==="new-folder"?(await Je(t),$.success(`Created folder "${t}"`)):w?.mode==="rename"&&(await He(t),$.success(`Renamed to "${t}"`))}catch(r){$.error(r instanceof Error?r.message:"Operation failed")}finally{ie(!1)}}const Ce=l.useRef(!1);Ce.current||(Ce.current=!0,b.current=ne());const[Ze,_e]=l.useState(null);if(K&&K!==Ze){_e(K);const t=K;queueMicrotask(()=>{rn(t)&&me(t).catch(n=>{$.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ne(t){const n=await te("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Se(t,n,r){if(r!==j.current)return!1;let s=!1;return Q(a=>{const d=n?Zt(a.files,a.directories,t,a.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return s=!!d.truncated,{files:d.files,directories:d.directories,truncated:s}}),s&&$.warning("File list truncated — some files may be hidden"),s}async function et(t){const n=x.current.get(t);if(n)return n;const r=j.current,s=(async()=>{const a=await Ne({pattern:"**/*",path:M(t),limit:Me}),d=Se(a,!0,r);return!d&&r===j.current&&v(Y=>{const oe=new Set(Y);return oe.add(t),oe}),d})();x.current.set(t,s);try{return await s}finally{x.current.delete(t)}}async function De(t){if(!ge(t,h.current))return!1;D(n=>new Set(n).add(t));try{return await et(t)}finally{D(n=>{const r=new Set(n);return r.delete(t),r})}}async function tt(t){const n=new Set(h.current);for(const r of he(t)){if(!ge(r,n))continue;if(await De(r))throw new Error("Folder listing truncated — expand again to load more");n.add(r)}}async function ne(){const t=++j.current;x.current.clear(),q(!0),v(new Set),I(new Set),D(new Set);try{const n=await Ne({pattern:"**/*",limit:Me,maxDepth:qt});Se(n,!1,t),N(!0)}catch{L&&$.error("Failed to refresh file tree")}finally{q(!1)}}async function ke(t){if(!C.get(t)?.loaded){u(r=>{const s=new Map(r);return s.set(t,{savedContent:"",editorValue:"",loaded:!1}),s});try{const r=await fetch(je(y,e,c,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),full:!0})});if(!r.ok)return;const s=await r.json(),a=Ht(s.content??"");u(d=>{const Y=new Map(d);return Y.set(t,{savedContent:a,editorValue:a,loaded:!0}),Y})}catch{}}}async function nt(t,n){try{const r=await fetch(je(y,e,c,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),content:n})});if(!r.ok){le("file save failed",{path:t,status:r.status});return}le("file saved via sandbox /write",{path:t}),z.invalidateQueries({queryKey:Ae(y,e,c)});try{const s=await Tt(y,e,c);le("git status after save",s)}catch(s){le("git status after save failed",{path:t,error:s instanceof Error?s.message:String(s)})}u(s=>{const a=new Map(s),d=a.get(t);return d&&a.set(t,{...d,savedContent:n}),a})}catch{}}function rt(t){p(t),W({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),g(null),B.includes(t)||f(n=>[...n,t]),ke(t)}function it(t){f(n=>{const r=n.filter(s=>s!==t);return o===t&&p(r[r.length-1]??null),r}),u(n=>{const r=new Map(n);return r.delete(t),r})}function Fe(t){I(n=>{const r=new Set(n);return r.has(t)?r.delete(t):r.add(t),r})}async function st(t){if(ge(t,h.current))try{if(await De(t))return}catch(n){$.error(n instanceof Error?n.message:"Failed to load folder");return}Fe(t)}async function ot(t,n){if(n){Fe(t);return}await st(t)}async function me(t){await b.current,await tt(t);const n=he(t);I(r=>{const s=new Set(r);for(const a of n)s.add(a);return s}),rt(t)}function at(){return O?.kind==="directory"?O.path:O?.kind==="file"?ye(O.path):o?ye(o):"/"}function Le(t){const n=at();J({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const lt=Qt(A,V),Ee=Ut(lt,P),Pe=F?Ee.filter(t=>t.node.name.toLowerCase().includes(F.toLowerCase())):Ee,Z=o?C.get(o):null,ct=Z?.loaded&&Z.editorValue!==Z.savedContent,pe=H?qe(H.path):[],dt=(t,n)=>{k.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!o)return;const r=t.getValue();await nt(o,r)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const r=t.getSelection(),s=t.getModel();if(!r||!s||!o)return;const a=s.getValueInRange(r);g({filePath:o,lineStart:r.startLineNumber,lineEnd:r.endLineNumber,selectedCode:a})})};function ft(t){if(!m)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${m.filePath}\``,`**Lines:** ${m.lineStart}–${m.lineEnd}`];if(m.selectedCode){const r=xe(m.filePath),s=m.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+r,s,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),E(!0),T({parts:[{type:"text",text:n.join(`
2
+ `)}]}),g(null)}return G&&!L?i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}):i.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[i.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[i.jsxs("div",{className:"relative min-w-0 flex-1",children:[i.jsx(ht,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),i.jsx("input",{type:"text",value:F,onChange:t=>U(t.target.value),placeholder:"Search files...","aria-label":"Search files",className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),i.jsxs(Oe,{children:[i.jsx(Re,{asChild:!0,children:i.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New file",onClick:()=>Le("new-file"),children:i.jsx(xt,{size:14})})}),i.jsx(ze,{side:"bottom",children:"New file"})]}),i.jsxs(Oe,{children:[i.jsx(Re,{asChild:!0,children:i.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New folder",onClick:()=>Le("new-folder"),children:i.jsx(gt,{size:14})})}),i.jsx(ze,{side:"bottom",children:"New folder"})]})]}),i.jsx(bt,{className:"flex-1",children:i.jsxs("div",{className:"py-1",children:[Pe.map(t=>{const{node:n,depth:r}=t,s=n.kind==="directory",a=P.has(n.path),d=O?.path===n.path,Y=Jt(n.path,n.kind),oe=s&&S.has(n.path);return i.jsx(nn,{node:n,depth:r,isExpanded:a,isSelected:d,isLoading:oe,fileVisual:on(n.name),onSelect:()=>W(n),onOpen:()=>{s?ot(n.path,a):me(n.path)},onNewFile:()=>J({mode:"new-file",node:n,parentDir:Y}),onNewFolder:()=>J({mode:"new-folder",node:n,parentDir:Y}),onCopyPath:()=>be("Path",ce(n.path)),onCopyRelativePath:()=>be("Relative path",M(n.path)),onRename:()=>J({mode:"rename",node:n,parentDir:Y}),onDelete:()=>ue(n)},n.path)}),L&&Pe.length===0&&i.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:F?`No files match "${F}"`:"No files found"})]})})]}),i.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[B.length>0&&i.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:B.map(t=>{const n=C.get(t),r=n?.loaded&&n.editorValue!==n.savedContent,s=o===t,a=t.split("/").pop()??t;return i.jsxs("div",{className:Ve("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",s?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{p(t),ke(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":s,children:[i.jsx("span",{className:"truncate max-w-32",children:a}),r&&i.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),i.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:d=>{d.stopPropagation(),it(t)},children:i.jsx(jt,{size:12})})]},t)})}),m&&i.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:i.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:t=>{t.preventDefault();const r=t.currentTarget.elements.namedItem("askAiInput");r.value.trim()&&ft(r.value)},children:[i.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:"Ask the AI...",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&g(null)}}),i.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:"Send",children:i.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[i.jsx("title",{children:"Send"}),i.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),i.jsx("div",{className:"flex-1 overflow-hidden",children:o&&Z?.loaded?i.jsx(mt,{language:xe(o),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:Z.editorValue,path:o,onChange:t=>{const n=o;n&&u(r=>{const s=new Map(r),a=s.get(n);return a&&s.set(n,{...a,editorValue:t??""}),s})},onMount:dt,loading:i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}),options:{fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,wordWrap:"on",minimap:{enabled:!1},padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}}},o):o&&!Z?.loaded?i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}):i.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:"Select a file to edit"})}),o&&i.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[i.jsx("span",{className:"truncate",children:o}),i.jsxs("span",{children:[ct?"Modified":"Saved"," ·"," ",xe(o)]})]})]}),i.jsx(en,{open:w!==null,mode:w?.mode??"new-file",initialName:w?.mode==="rename"?w.node.name:"",parentLabel:w&&w.mode!=="rename"?w.parentDir==="/"?"/":M(w.parentDir):void 0,isPending:ee,onSubmit:Ye,onOpenChange:t=>{!t&&!ee&&J(null)}}),i.jsx(vt,{open:H!==null,onOpenChange:t=>{!t&&!ee&&ue(null)},children:i.jsxs(Ct,{children:[i.jsxs(Nt,{children:[i.jsxs(St,{children:["Delete ",H?.kind==="directory"?"folder":"file","?"]}),i.jsxs(Dt,{children:["This will permanently delete"," ",i.jsx("span",{className:"font-mono",children:H?.name}),H?.kind==="directory"?" and everything inside it.":".",pe.length>0&&i.jsxs(i.Fragment,{children:[" ",pe.length===1?"One open file has unsaved changes that will be lost.":`${pe.length} open files have unsaved changes that will be lost.`]})]})]}),i.jsxs(kt,{children:[i.jsx(Ft,{disabled:ee,children:"Cancel"}),i.jsx(Lt,{disabled:ee||!H,onClick:t=>{t.preventDefault(),H&&Xe(H)},children:"Delete"})]})]})})]})}export{Ii as FileExplorer};
@@ -1,4 +1,4 @@
1
- import{bw as zl,j as q,af as lt,bO as zn,r as Ve,bP as b0,c as Gb,e as Ke,f as E0,g as T0,B as $b}from"./index-EQfvflqN.js";import{i as zb}from"./ChevronUp-ByHCMSz5.js";import{a as jb}from"./Eye-Cn63kKBo.js";import{d as S0,g as y0,h as A0,a as _0}from"./dialog-45S14PiE.js";import{n as I0}from"./Globe01-D6_7mD2q.js";import{j as k0,n as R0}from"./ZoomOut-CuzhjD8R.js";import{u as N0}from"./tooltip-DZelUdM0.js";import{m as C0}from"./tab-id-BptcWVWa.js";function jl(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Nt=jl();function Vb(e){Nt=e}var ln={exec:()=>null};function le(e,t=""){let n=typeof e=="string"?e:e.source;const r={replace:(a,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(xe.caret,"$1"),n=n.replace(a,o),r},getRegex:()=>new RegExp(n,t)};return r}var xe={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},v0=/^(?:[ \t]*(?:\n|$))+/,w0=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,x0=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,_n=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,O0=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Vl=/(?:[*+-]|\d{1,9}[.)])/,Yb=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Wb=le(Yb).replace(/bull/g,Vl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),L0=le(Yb).replace(/bull/g,Vl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Yl=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,D0=/^[^\n]+/,Wl=/(?!\s*\])(?:\\.|[^\[\]\\])+/,M0=le(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Wl).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),P0=le(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Vl).getRegex(),er="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Kl=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,F0=le("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Kl).replace("tag",er).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Kb=le(Yl).replace("hr",_n).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",er).getRegex(),B0=le(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Kb).getRegex(),Xl={blockquote:B0,code:w0,def:M0,fences:x0,heading:O0,hr:_n,html:F0,lheading:Wb,list:P0,newline:v0,paragraph:Kb,table:ln,text:D0},Mc=le("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",_n).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",er).getRegex(),U0={...Xl,lheading:L0,table:Mc,paragraph:le(Yl).replace("hr",_n).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Mc).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",er).getRegex()},H0={...Xl,html:le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Kl).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ln,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:le(Yl).replace("hr",_n).replace("heading",` *#{1,6} *[^
1
+ import{by as zl,j as q,af as lt,bQ as zn,r as Ve,bR as b0,l as Gb,c as Ke,b as E0,e as T0,B as $b}from"./index-D0U_smqt.js";import{i as zb}from"./Check-D3J8f8u-.js";import{a as jb}from"./Eye-hHNCwVZ1.js";import{d as S0,g as y0,h as A0,a as _0}from"./dialog-CQ6B0IwC.js";import{n as I0}from"./Globe01-DD8UM4Hn.js";import{j as k0,n as R0}from"./ZoomOut-xDQo2yr7.js";import{u as N0}from"./tooltip-DO1R3Vmb.js";import{m as C0}from"./tab-id-BptcWVWa.js";function jl(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Nt=jl();function Vb(e){Nt=e}var ln={exec:()=>null};function le(e,t=""){let n=typeof e=="string"?e:e.source;const r={replace:(a,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(xe.caret,"$1"),n=n.replace(a,o),r},getRegex:()=>new RegExp(n,t)};return r}var xe={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},v0=/^(?:[ \t]*(?:\n|$))+/,w0=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,x0=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,_n=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,O0=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Vl=/(?:[*+-]|\d{1,9}[.)])/,Yb=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Wb=le(Yb).replace(/bull/g,Vl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),L0=le(Yb).replace(/bull/g,Vl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Yl=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,D0=/^[^\n]+/,Wl=/(?!\s*\])(?:\\.|[^\[\]\\])+/,M0=le(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Wl).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),P0=le(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Vl).getRegex(),er="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Kl=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,F0=le("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Kl).replace("tag",er).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Kb=le(Yl).replace("hr",_n).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",er).getRegex(),B0=le(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Kb).getRegex(),Xl={blockquote:B0,code:w0,def:M0,fences:x0,heading:O0,hr:_n,html:F0,lheading:Wb,list:P0,newline:v0,paragraph:Kb,table:ln,text:D0},Mc=le("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",_n).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",er).getRegex(),U0={...Xl,lheading:L0,table:Mc,paragraph:le(Yl).replace("hr",_n).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Mc).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",er).getRegex()},H0={...Xl,html:le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Kl).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ln,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:le(Yl).replace("hr",_n).replace("heading",` *#{1,6} *[^
2
2
  ]`).replace("lheading",Wb).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},q0=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,G0=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Xb=/^( {2,}|\\)\n(?!\s*$)/,$0=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,tr=/[\p{P}\p{S}]/u,Zl=/[\s\p{P}\p{S}]/u,Zb=/[^\s\p{P}\p{S}]/u,z0=le(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Zl).getRegex(),Qb=/(?!~)[\p{P}\p{S}]/u,j0=/(?!~)[\s\p{P}\p{S}]/u,V0=/(?:[^\s\p{P}\p{S}]|~)/u,Y0=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Jb=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,W0=le(Jb,"u").replace(/punct/g,tr).getRegex(),K0=le(Jb,"u").replace(/punct/g,Qb).getRegex(),eE="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",X0=le(eE,"gu").replace(/notPunctSpace/g,Zb).replace(/punctSpace/g,Zl).replace(/punct/g,tr).getRegex(),Z0=le(eE,"gu").replace(/notPunctSpace/g,V0).replace(/punctSpace/g,j0).replace(/punct/g,Qb).getRegex(),Q0=le("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Zb).replace(/punctSpace/g,Zl).replace(/punct/g,tr).getRegex(),J0=le(/\\(punct)/,"gu").replace(/punct/g,tr).getRegex(),eS=le(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),tS=le(Kl).replace("(?:-->|$)","-->").getRegex(),nS=le("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",tS).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),jn=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,rS=le(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",jn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),tE=le(/^!?\[(label)\]\[(ref)\]/).replace("label",jn).replace("ref",Wl).getRegex(),nE=le(/^!?\[(ref)\](?:\[\])?/).replace("ref",Wl).getRegex(),aS=le("reflink|nolink(?!\\()","g").replace("reflink",tE).replace("nolink",nE).getRegex(),Ql={_backpedal:ln,anyPunctuation:J0,autolink:eS,blockSkip:Y0,br:Xb,code:G0,del:ln,emStrongLDelim:W0,emStrongRDelimAst:X0,emStrongRDelimUnd:Q0,escape:q0,link:rS,nolink:nE,punctuation:z0,reflink:tE,reflinkSearch:aS,tag:nS,text:$0,url:ln},iS={...Ql,link:le(/^!?\[(label)\]\((.*?)\)/).replace("label",jn).getRegex(),reflink:le(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",jn).getRegex()},_l={...Ql,emStrongRDelimAst:Z0,emStrongLDelim:K0,url:le(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},oS={..._l,br:le(Xb).replace("{2,}","*").getRegex(),text:le(_l.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},xn={normal:Xl,gfm:U0,pedantic:H0},Jt={normal:Ql,gfm:_l,breaks:oS,pedantic:iS},sS={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Pc=e=>sS[e];function Je(e,t){if(t){if(xe.escapeTest.test(e))return e.replace(xe.escapeReplace,Pc)}else if(xe.escapeTestNoEncode.test(e))return e.replace(xe.escapeReplaceNoEncode,Pc);return e}function Fc(e){try{e=encodeURI(e).replace(xe.percentDecode,"%")}catch{return null}return e}function Bc(e,t){const n=e.replace(xe.findPipe,(i,o,s)=>{let u=!1,l=o;for(;--l>=0&&s[l]==="\\";)u=!u;return u?"|":" |"}),r=n.split(xe.splitPipe);let a=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;a<r.length;a++)r[a]=r[a].trim().replace(xe.slashPipe,"|");return r}function en(e,t,n){const r=e.length;if(r===0)return"";let a=0;for(;a<r&&e.charAt(r-a-1)===t;)a++;return e.slice(0,r-a)}function uS(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Uc(e,t,n,r,a){const i=t.href,o=t.title||null,s=e[1].replace(a.other.outputLinkReplace,"$1");r.state.inLink=!0;const u={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,u}function lS(e,t,n){const r=e.match(n.other.indentCodeCompensation);if(r===null)return t;const a=r[1];return t.split(`
3
3
  `).map(i=>{const o=i.match(n.other.beginningSpace);if(o===null)return i;const[s]=o;return s.length>=a.length?i.slice(a.length):i}).join(`
4
4
  `)}var Vn=class{options;rules;lexer;constructor(e){this.options=e||Nt}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:en(n,`
@@ -1 +1 @@
1
- import{e as a,g as o,j as i,N as l}from"./index-EQfvflqN.js";function m(){const e=a.c(3);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const{org:r}=o(t);let s;return e[1]!==r?(s=i.jsx(l,{to:"/$org/files",params:{org:r},replace:!0}),e[1]=r,e[2]=s):s=e[2],s}export{m as default};
1
+ import{c as a,e as o,j as i,N as l}from"./index-D0U_smqt.js";function m(){const e=a.c(3);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const{org:r}=o(t);let s;return e[1]!==r?(s=i.jsx(l,{to:"/$org/files",params:{org:r},replace:!0}),e[1]=r,e[2]=s):s=e[2],s}export{m as default};
@@ -1 +1 @@
1
- import{cE as C,e as f,j as c,ad as b,r as d,c as p,bb as j,cF as v,cG as h}from"./index-EQfvflqN.js";import{L as N}from"./label-WMNwqiQL.js";const D=C,g=d.createContext({}),M=t=>{const e=f.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let n;e[4]!==s?(n=c.jsx(b,{...s}),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(g.Provider,{value:o,children:n}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r},x=()=>{const t=f.c(13),e=d.useContext(g),s=d.useContext($),{getFieldState:o}=v();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=h(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},$=d.createContext({});function w(t){const e=f.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=d.useId();let r;e[3]!==n?(r={id:n},e[3]=n,e[4]=r):r=e[4];let a;e[5]!==s?(a=p("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==o||e[8]!==a?(l=c.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=c.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function L(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formItemId:r}=x(),a=!!n;let l;e[3]!==s?(l=p("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==l?(i=c.jsx(N,{"data-slot":"form-label","data-error":a,className:l,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=l,e[9]=i):i=e[9],i}function P(t){const e=f.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=x(),l=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==n||e[3]!==s||e[4]!==l||e[5]!==i?(m=c.jsx(j,{"data-slot":"form-control",id:n,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=n,e[3]=s,e[4]=l,e[5]=i,e[6]=m):m=e[6],m}function y(t){const e=f.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:n}=x();let r;e[3]!==s?(r=p("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==o||e[7]!==r?(a=c.jsx("p",{"data-slot":"form-description",id:n,className:r,...o}),e[5]=n,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function R(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formMessageId:r}=x(),a=n?String(n?.message??""):o.children;if(!a)return null;let l;e[3]!==s?(l=p("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==l?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{M as F,D as a,w as b,L as c,P as d,y as e,R as f};
1
+ import{cE as C,c as f,j as c,ad as j,r as d,l as p,be as b,cF as v,cG as h}from"./index-D0U_smqt.js";import{L as N}from"./label-KRKjsQLR.js";const D=C,g=d.createContext({}),M=t=>{const e=f.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let n;e[4]!==s?(n=c.jsx(j,{...s}),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(g.Provider,{value:o,children:n}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r},x=()=>{const t=f.c(13),e=d.useContext(g),s=d.useContext($),{getFieldState:o}=v();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=h(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},$=d.createContext({});function w(t){const e=f.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=d.useId();let r;e[3]!==n?(r={id:n},e[3]=n,e[4]=r):r=e[4];let a;e[5]!==s?(a=p("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==o||e[8]!==a?(l=c.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=c.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function L(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formItemId:r}=x(),a=!!n;let l;e[3]!==s?(l=p("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==l?(i=c.jsx(N,{"data-slot":"form-label","data-error":a,className:l,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=l,e[9]=i):i=e[9],i}function P(t){const e=f.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=x(),l=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==n||e[3]!==s||e[4]!==l||e[5]!==i?(m=c.jsx(b,{"data-slot":"form-control",id:n,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=n,e[3]=s,e[4]=l,e[5]=i,e[6]=m):m=e[6],m}function y(t){const e=f.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:n}=x();let r;e[3]!==s?(r=p("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==o||e[7]!==r?(a=c.jsx("p",{"data-slot":"form-description",id:n,className:r,...o}),e[5]=n,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function R(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formMessageId:r}=x(),a=n?String(n?.message??""):o.children;if(!a)return null;let l;e[3]!==s?(l=p("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==l?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{M as F,D as a,w as b,L as c,P as d,y as e,R as f};
@@ -0,0 +1 @@
1
+ import{b as M,s as $,I as U,C as Q,z as Y,d as q,p as P,t as w,K as I,j as n,ad as L,x as Z,y as k,c as E,r as T,B as H,L as B,n as J}from"./index-D0U_smqt.js";import{P as N}from"./index-BFeGPSf0.js";import{u as W}from"./use-org-auth-client-Dl_7zTlg.js";import{u as X}from"./use-debounced-autosave-DqciCJ__.js";import{A as ee}from"./avatar-CXZnLPEU.js";import{I as V}from"./input-Ccm3ShdT.js";import{S as K,a as G,b as A,c as te}from"./settings-section-C-zTpCRT.js";import{D as ne}from"./domain-settings-BvzKBAZm.js";import{u as ae}from"./studio-tools-DO12gBMa.js";import{c as se,b as oe,d as ie,A as re,e as le,g as ce,a as ue,f as de}from"./alert-dialog-BZRM5ze7.js";import{R as me}from"./require-capability-D9TOSbgf.js";import"./sidebar-BYFEz6-7.js";import"./LayoutLeft-BNwcfVCc.js";import"./tooltip-DO1R3Vmb.js";import"./sheet-CuyenB5M.js";import"./X-BmA2kYv-.js";import"./User01-BI5RuTWy.js";import"./card-DSDTRgoU.js";import"./ArrowUpRight-tJm1fmd7.js";import"./badge-DSiiJMKS.js";import"./select-COSJe-70.js";import"./Check-D3J8f8u-.js";import"./ChevronDown-Dilz0yBl.js";import"./ChevronUp-B5x1falF.js";import"./use-capability-C09ZF9_G.js";import"./access-gate-C-eMG1Ta.js";import"./capability-load-error-Cc0Imt5p.js";const ge=Z({name:k().min(1,"Name is required").max(255,"Name is too long"),slug:k().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:k().optional()});function fe(e){const t=E.c(13),{value:v,onChange:h,name:o,disabled:d}=e,m=T.useRef(null);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>m.current?.click(),t[0]=l):l=t[0];const r=l;let c;t[1]!==h?(c=x=>{const j=x.target.files?.[0];if(!j)return;if(j.size>2097152){w.error("Image must be smaller than 2MB");return}const u=new FileReader;u.onerror=pe,u.onloadend=()=>{u.result&&h(u.result),m.current&&(m.current.value="")},u.readAsDataURL(j)},t[1]=h,t[2]=c):c=t[2];const a=c;let s;t[3]!==d||t[4]!==a?(s=n.jsx("input",{ref:m,type:"file",accept:"image/*",onChange:a,className:"hidden",disabled:d}),t[3]=d,t[4]=a,t[5]=s):s=t[5];const i=v||void 0,p=o??"?";let g;t[6]!==i||t[7]!==p?(g=n.jsx(ee,{url:i,fallback:p,shape:"square",size:"base"}),t[6]=i,t[7]=p,t[8]=g):g=t[8];let f;return t[9]!==d||t[10]!==s||t[11]!==g?(f=n.jsxs("button",{type:"button",onClick:r,disabled:d,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":"Upload organization logo",children:[s,g]}),t[9]=d,t[10]=s,t[11]=g,t[12]=f):f=t[12],f}function pe(){return w.error("Failed to read image")}function he(){const e=M(),{org:t}=$(),v=W(),h=U(),o=Q({resolver:Y(ge),values:{name:t.name??"",slug:t.slug??"",logo:t.logo??""}}),d=q({mutationFn:async a=>{const s={name:a.name,slug:a.slug};a.logo&&(s.logo=a.logo);const i=await v.organization.update({data:s});if(i?.error)throw new Error(i.error.message||"Failed to update organization");return i},onSuccess:(a,s)=>{P("organization_settings_updated",{organization_id:t.id,fields:Object.keys(s)}),h.invalidateQueries({queryKey:I.organizations()}),h.invalidateQueries({queryKey:I.activeOrganization(t.slug)}),w.success("Organization updated successfully"),a?.data?.slug&&a.data.slug!==t.slug&&e({to:"/$org/settings/general",params:{org:a.data.slug}})},onError:(a,s)=>{P("organization_settings_update_failed",{organization_id:t.id,fields:Object.keys(s),error:a instanceof Error?a.message:String(a)}),w.error(a instanceof Error?a.message:"Failed to update organization")}}),{schedule:m,flush:l}=X({save:async()=>{const a=o.control._formState.dirtyFields;if(Object.keys(a).length===0||!await o.trigger())return;const i=o.getValues(),p=o.control._defaultValues;o.reset(i,{keepValues:!0});try{await d.mutateAsync(i)}catch{o.reset(p,{keepValues:!0})}}}),r=o.formState.errors,c=typeof window<"u"?`${window.location.host}/`:"";return n.jsx(K,{children:n.jsxs(G,{children:[n.jsx(A,{title:"Logo",description:"Recommended size is 256x256px",action:n.jsx(fe,{value:o.watch("logo"),onChange:a=>{o.setValue("logo",a??"",{shouldDirty:!0}),l()},name:o.watch("name")})}),n.jsx(A,{title:"Name",action:n.jsx(L,{control:o.control,name:"name",render:({field:a})=>n.jsx(V,{id:"org-name",...a,onChange:s=>{a.onChange(s),m()},onBlur:()=>{a.onBlur(),l()},placeholder:"Organization name",className:"w-[280px]"})})}),n.jsx(A,{title:"URL",action:n.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-input/30 focus-within:ring-2 focus-within:ring-ring/50 overflow-hidden",children:[c&&n.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:c}),n.jsx(L,{control:o.control,name:"slug",render:({field:a})=>n.jsx("input",{id:"org-slug",value:a.value??"",name:a.name,ref:a.ref,placeholder:"my-organization",className:"flex-1 min-w-0 bg-transparent px-2 py-1.5 text-sm text-foreground placeholder:text-muted-foreground/60 outline-none",onChange:s=>{const i=s.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");o.setValue("slug",i,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),m()},onBlur:()=>{a.onBlur(),l()}})})]})}),(r.name||r.slug||r.logo)&&n.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[r.name&&n.jsx("p",{className:"text-xs text-destructive",children:r.name.message}),r.slug&&n.jsx("p",{className:"text-xs text-destructive",children:r.slug.message}),r.logo&&n.jsx("p",{className:"text-xs text-destructive",children:r.logo.message})]})]})})}function xe(){const e=E.c(42),{org:t}=$(),[v,h]=T.useState(!1),[o,d]=T.useState(""),m=ae();let l;e[0]!==t.id||e[1]!==m?(l=async()=>{await m.call("ORGANIZATION_DELETE",{id:t.id})},e[0]=t.id,e[1]=m,e[2]=l):l=e[2];let r;e[3]!==t.id||e[4]!==t.slug?(r=()=>{P("organization_deleted",{organization_id:t.id}),localStorage.getItem(B.lastOrgSlug())===t.slug&&localStorage.removeItem(B.lastOrgSlug()),J(),w.success("Organization deleted"),window.location.href="/"},e[3]=t.id,e[4]=t.slug,e[5]=r):r=e[5];let c;e[6]!==l||e[7]!==r?(c={mutationFn:l,onSuccess:r,onError:je},e[6]=l,e[7]=r,e[8]=c):c=e[8];const a=q(c);let s;e[9]===Symbol.for("react.memo_cache_sentinel")?(s=()=>h(!0),e[9]=s):s=e[9];let i;e[10]!==a.isPending?(i=n.jsx(K,{title:"Danger Zone",description:"Irreversible actions that affect your entire organization.",children:n.jsx(G,{className:"border-destructive/40",children:n.jsx(A,{title:"Delete organization",description:"Permanently delete this organization and all of its data. This action cannot be undone.",action:n.jsx(H,{variant:"destructive",size:"sm",onClick:s,disabled:a.isPending,children:"Delete"})})})}),e[10]=a.isPending,e[11]=i):i=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=O=>{h(O),O||d("")},e[12]=p):p=e[12];let g;e[13]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(se,{children:"Delete Organization?"}),e[13]=g):g=e[13];let f;e[14]!==t.name?(f=n.jsxs("p",{children:["This will permanently delete all data associated with"," ",n.jsx("span",{className:"font-medium text-foreground",children:t.name}),". This action cannot be undone."]}),e[14]=t.name,e[15]=f):f=e[15];let x;e[16]!==t.name?(x=n.jsxs("p",{className:"mt-3 mb-1.5",children:["Type"," ",n.jsx("span",{className:"font-medium text-foreground",children:t.name})," ","to confirm:"]}),e[16]=t.name,e[17]=x):x=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=O=>d(O.target.value),e[18]=j):j=e[18];let u;e[19]!==o||e[20]!==t.name?(u=n.jsx(V,{value:o,onChange:j,placeholder:t.name,autoFocus:!0}),e[19]=o,e[20]=t.name,e[21]=u):u=e[21];let y;e[22]!==u||e[23]!==f||e[24]!==x?(y=n.jsxs(oe,{children:[g,n.jsx(ie,{asChild:!0,children:n.jsxs("div",{children:[f,x,u]})})]}),e[22]=u,e[23]=f,e[24]=x,e[25]=y):y=e[25];let D;e[26]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsx(re,{children:"Cancel"}),e[26]=D):D=e[26];let b;e[27]!==a?(b=()=>a.mutate(),e[27]=a,e[28]=b):b=e[28];const F=o!==t.name||a.isPending,R=a.isPending?"Deleting…":"Delete organization";let S;e[29]!==b||e[30]!==F||e[31]!==R?(S=n.jsxs(le,{children:[D,n.jsx(ce,{onClick:b,disabled:F,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:R})]}),e[29]=b,e[30]=F,e[31]=R,e[32]=S):S=e[32];let z;e[33]!==y||e[34]!==S?(z=n.jsxs(ue,{children:[y,S]}),e[33]=y,e[34]=S,e[35]=z):z=e[35];let C;e[36]!==v||e[37]!==z?(C=n.jsx(de,{open:v,onOpenChange:p,children:z}),e[36]=v,e[37]=z,e[38]=C):C=e[38];let _;return e[39]!==C||e[40]!==i?(_=n.jsxs(n.Fragment,{children:[i,C]}),e[39]=C,e[40]=i,e[41]=_):_=e[41],_}function je(e){w.error(e instanceof Error?e.message:"Failed to delete organization")}function ve(){const e=E.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(N,{children:n.jsx(N.Content,{children:n.jsx(N.Body,{children:n.jsxs(te,{children:[n.jsx(N.Title,{children:"Organization"}),n.jsx(he,{}),n.jsx(ne,{}),n.jsx(xe,{})]})})})}),e[0]=t):t=e[0],t}function Qe(){const e=E.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(me,{capability:"org:manage",area:"general settings",children:n.jsx(ve,{})}),e[0]=t):t=e[0],t}export{Qe as default};
@@ -1 +1 @@
1
- import{e as P,j as t,p as Q,b as te,F as W,r as O,a4 as B,l as F,a as ne,n as z,K as V,m as se,c as K,a5 as oe,ae as re}from"./index-EQfvflqN.js";import{D as ie,a as ae,c as le,d as ce}from"./dialog-45S14PiE.js";import{C as J}from"./checkbox-CgVOF7oH.js";import{C as ue}from"./collection-search-DS6Qu-vl.js";import{b as de,u as me}from"./use-connection-DgGg0YyB.js";import{W as fe,u as H,S as X}from"./use-mcp-client-Dlrc-MQT.js";import{i as Z}from"./Settings02-BDBrMikk.js";import{v as pe}from"./agent-icon-CBTaU_uB.js";import{i as ge,a as he}from"./mcp-oauth-B7WMtt2U.js";import{u as xe}from"./use-mcp-tools-Baigwz11.js";import{e as ye}from"./extract-connection-data-BVb7kACV.js";import{m as be}from"./use-navigate-to-agent-YIuMJGpH.js";function U(s){const e=P.c(4),{size:n,className:o}=s;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0016 8c0-4.42-3.58-8-8-8z"}),e[0]=u):u=e[0];let a;return e[1]!==o||e[2]!==n?(a=t.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:o,children:u}),e[1]=o,e[2]=n,e[3]=a):a=e[3],a}function we(s,e){const n=P.c(12),{org:o}=Q();let u;n[0]!==o.id?(u=fe.REGISTRY(o.id),n[0]=o.id,n[1]=u):u=n[1];const a=u;let r;n[2]!==o.id||n[3]!==o.slug||n[4]!==a?(r={connectionId:a,orgId:o.id,orgSlug:o.slug},n[2]=o.id,n[3]=o.slug,n[4]=a,n[5]=r):r=n[5];const f=H(r);let p;n[6]!==s?(p={name:s},n[6]=s,n[7]=p):p=n[7];const i=e?.enabled??!0;let h;return n[8]!==f||n[9]!==p||n[10]!==i?(h={client:f,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:p,enabled:i,staleTime:3e5,select:Ne},n[8]=f,n[9]=p,n[10]=i,n[11]=h):h=n[11],xe(h)}function Ne(s){return s.structuredContent?.item??null}const Ie="deco/mcp-github";function Se(s){const{org:e}=Q(),{data:n}=te.useSession(),o=de(),u=W(),[a,r]=O.useState("idle"),[f,p]=O.useState(null),[i,h]=O.useState(null),{data:g,isLoading:c}=we(Ie,{enabled:s.enabled}),w=O.useRef(!1);s.enabled&&g&&!c&&!w.current&&n?.user?.id&&a==="idle"&&(w.current=!0,y());async function y(){if(!(!g||!n?.user?.id||!e))try{r("installing"),p(null);const x=ye(g,e.id,n.user.id,{remoteIndex:0});if(!x.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:b}=await o.create.mutateAsync(x);r("authenticating");const I=new URL(`/api/${e.slug}/mcp/${b}`,window.location.origin),d=await ge({url:I.href,token:null,orgId:e.id});if(d.supportsOAuth&&!d.isAuthenticated){const{token:j,tokenInfo:l,error:C}=await he({connectionId:b,orgSlug:e.slug,scope:"offline_access"});if(C||!j){try{await o.delete.mutateAsync(b)}catch{}throw new Error(C??"No token received from GitHub")}if(l)try{(await fetch(`/api/${e.slug}/connections/${b}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:l.accessToken,refreshToken:l.refreshToken,expiresIn:l.expiresIn,scope:l.scope,clientId:l.clientId,clientSecret:l.clientSecret,tokenEndpoint:l.tokenEndpoint})})).ok||await o.update.mutateAsync({id:b,data:{connection_token:j}})}catch{await o.update.mutateAsync({id:b,data:{connection_token:j}})}}B(u,e.id),h(x),r("ready")}catch(x){p(x instanceof Error?x.message:String(x)),r("error")}}function N(){r("idle"),p(null),h(null),w.current=!1}return s.enabled&&c&&a==="idle"?{status:"installing",error:null,connection:null,retry:N}:{status:a,error:f,connection:i,retry:N}}const M={contents:"write",metadata:"read",pull_requests:"write",issues:"write"};function je(s){if(!s||typeof s!="object"||Array.isArray(s))return M;const e=s;return Object.values(e).some(n=>typeof n!="string")?M:e}function Ce(s){if(!(typeof s!="number"||!Number.isFinite(s)||!Number.isInteger(s)||s<=0))return s}function Te(s){const e=s.metadata?.repoScope;if(!e||typeof e.installationId!="number"||!Number.isFinite(e.installationId)||!Number.isInteger(e.installationId)||e.installationId<=0||typeof e.owner!="string"||typeof e.repo!="string"||e.owner.length===0||e.repo.length===0)return null;const n=Ce(e.repositoryId);return{sourceConnectionId:typeof e.sourceConnectionId=="string"?e.sourceConnectionId:void 0,installationId:e.installationId,repositoryId:n,owner:e.owner,repo:e.repo,permissions:je(e.permissions),grantProvider:e.grantProvider==="github-mcp"?"github-mcp":void 0}}function Ee(s){return(s??[]).filter(e=>Te(e)===null)}async function ve(s,e){const o=(await s({name:"GITHUB_LIST_USER_ORGS",arguments:{connectionId:e}})).content?.[0]?.text;if(!o)throw new Error("No response from GITHUB_LIST_USER_ORGS");try{return JSON.parse(o)}catch{throw new Error("Invalid response from GITHUB_LIST_USER_ORGS")}}function Xe(s,e){const n=e.toLowerCase();return s.find(o=>o.login.toLowerCase()===n)}const Y="GitHub MCP did not return refreshable repo grant metadata";function L(s){if(typeof s!="string")return null;const e=s.trim();return e.length>0?e:null}function _e(s){try{const e=new URL(s);return(e.protocol==="http:"||e.protocol==="https:")&&!e.username&&!e.password}catch{return!1}}function ke(s){return typeof s=="number"&&Number.isFinite(s)&&Number.isInteger(s)&&s>0?s:void 0}async function Re(s){const{orgSlug:e,sourceConnection:n,installationId:o,owner:u,repo:a,githubCallTool:r,selfCallTool:f}=s,p=await r({name:"MINT_REPO_TOKEN",arguments:{installationId:o,owner:u,repo:a,permissions:M}}),i=p.structuredContent;if(p.isError||!i?.token){const v=p.content?.find(T=>T.type==="text")?.text;throw new Error(v?`Failed to mint a repo-scoped GitHub token: ${v}`:"Failed to mint a repo-scoped GitHub token")}const h=L(i.refreshToken),g=L(i.tokenEndpoint),c=L(i.clientId);if(!h||!g||!c)throw new Error(Y);if(!_e(g))throw new Error(Y);const w=L(i.repository?.owner),y=L(i.repository?.name),N="GitHub MCP returned refresh metadata for a different repository";if(i.repository?.owner!==void 0&&(!w||w.toLowerCase()!==u.toLowerCase()))throw new Error(N);if(i.repository?.name!==void 0&&(!y||y.toLowerCase()!==a.toLowerCase()))throw new Error(N);const x=ke(i.repository?.id),S=i.expiresAt?Date.parse(i.expiresAt):NaN,b=Number.isFinite(S)?Math.max(0,Math.floor((S-Date.now())/1e3)):null,d=(typeof i.expiresIn=="number"&&Number.isFinite(i.expiresIn)&&Number.isInteger(i.expiresIn)&&i.expiresIn>0?i.expiresIn:null)??b,j=await f({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:{title:`GitHub: ${u}/${a}`,description:`Repo-scoped GitHub access for ${u}/${a}`,icon:n.icon,app_name:n.app_name,app_id:n.app_id,connection_type:n.connection_type,connection_url:n.connection_url,metadata:{repoScope:{installationId:o,repositoryId:x,owner:u,repo:a,permissions:M,grantProvider:"github-mcp"}}}}}),l=j.structuredContent??j,C=l.item?.id??l.id;if(!C)throw new Error("Failed to create the repo-scoped GitHub connection");if(!(await fetch(`/api/${e}/connections/${C}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:i.token,refreshToken:h,expiresIn:d,scope:i.scope??null,clientId:c,tokenEndpoint:g})})).ok)throw await f({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:C,force:!0}}).catch(()=>{}),new Error("Failed to persist the repo-scoped token");return{childConnectionId:C}}function Ae(s,e){const n=P.c(4),[o,u]=O.useState(s);let a,r;return n[0]!==e||n[1]!==s?(a=()=>{const f=setTimeout(()=>u(s),e);return()=>clearTimeout(f)},r=[s,e],n[0]=e,n[1]=s,n[2]=a,n[3]=r):(a=n[2],r=n[3]),O.useEffect(a,r),o}const D=[{key:"auto-respond-to-issues",triggerType:"github.issues.opened",nameSuffix:"auto-respond to issues",label:"Auto-respond to new issues",defaultEnabled:!0,instructions:({owner:s,name:e})=>`A new GitHub issue has been opened in ${s}/${e}. Read the issue, explore relevant code, create a branch, implement the fix, and open a PR referencing the issue number.`},{key:"review-incoming-prs",triggerType:"github.pull_request.opened",nameSuffix:"review incoming PRs",label:"Review incoming pull requests",defaultEnabled:!0,instructions:({owner:s,name:e})=>`A pull request was opened in ${s}/${e}. Read the diff, summarize what changed, flag risks (security, perf, breaking changes), and leave a review comment.`},{key:"note-merged-prs",triggerType:"github.pull_request.closed",nameSuffix:"note merged/closed PRs",label:"Note merged or closed PRs",defaultEnabled:!1,instructions:({owner:s,name:e})=>`A pull request was closed in ${s}/${e}. If it was merged, update changelog/release notes as appropriate.`}];function Oe(s,e){const n=new Set;if(s.paramsSchema)for(const u of Object.keys(s.paramsSchema))n.add(u);if(Array.isArray(s.params))for(const u of s.params)n.add(u.name);else if(s.params&&typeof s.params=="object")for(const u of Object.keys(s.params))n.add(u);if(n.has("repo"))return{repo:`${e.owner}/${e.name}`};const o={};return n.has("owner")&&(o.owner=e.owner),n.has("name")&&(o.name=e.name),n.has("repository")&&(o.repository=`${e.owner}/${e.name}`),o}async function Ge({githubCallTool:s,selfCallTool:e,virtualMcpId:n,repo:o,connectionId:u,selectedKeys:a}){const r=await s({name:"TRIGGER_LIST",arguments:{}}),f=r.structuredContent??r,p=new Map((f.triggers??[]).map(c=>[c.type,c])),i=D.filter(c=>a.has(c.key)),h=await Promise.allSettled(i.map(async c=>{const w=p.get(c.triggerType);if(!w)throw new Error(`Trigger ${c.triggerType} not exposed`);const y=await e({name:"AUTOMATION_CREATE",arguments:{name:`${o.name}: ${c.nameSuffix}`,virtual_mcp_id:n,messages:c.instructions(o),active:!0}}),N=(y.structuredContent??y).id;if(!N)throw new Error(`AUTOMATION_CREATE returned no id for ${c.key}`);await e({name:"AUTOMATION_TRIGGER_ADD",arguments:{automation_id:N,type:"event",connection_id:u,event_type:c.triggerType,params:Oe(w,o)}})})),g=h.filter(c=>c.status==="rejected").length;return g>0&&console.error("Some GitHub automations failed to set up:",h.filter(c=>c.status==="rejected")),{total:h.length,failed:g}}function Ze(s){const e=P.c(22),{open:n,onOpenChange:o,title:u,hideAutoRespondCheckbox:a,onImportComplete:r}=s,f=u===void 0?"Import from GitHub":u,p=a===void 0?!1:a,[i,h]=O.useState(null);let g;e[0]!==f?(g=t.jsx(ie,{className:"sr-only",children:t.jsx(ae,{children:f})}),e[0]=f,e[1]=g):g=e[1];let c;e[2]!==i||e[3]!==f?(c=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:i?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>h(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":"Back to accounts",children:t.jsx(Z,{size:16})}),t.jsx("img",{src:i.avatarUrl,alt:i.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:i.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(U,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:f})]})}),e[2]=i,e[3]=f,e[4]=c):c=e[4];let w;e[5]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(F,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=w):w=e[5];let y;e[6]!==o?(y=()=>o(!1),e[6]=o,e[7]=y):y=e[7];let N;e[8]!==p||e[9]!==r||e[10]!==n||e[11]!==i||e[12]!==y?(N=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(O.Suspense,{fallback:w,children:t.jsx($e,{open:n,onComplete:y,selectedInstallation:i,onSelectInstallation:h,hideAutoRespondCheckbox:p,onImportComplete:r})})}),e[8]=p,e[9]=r,e[10]=n,e[11]=i,e[12]=y,e[13]=N):N=e[13];let x;e[14]!==g||e[15]!==c||e[16]!==N?(x=t.jsxs(le,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[g,c,N]}),e[14]=g,e[15]=c,e[16]=N,e[17]=x):x=e[17];let S;return e[18]!==o||e[19]!==n||e[20]!==x?(S=t.jsx(ce,{open:n,onOpenChange:o,children:x}),e[18]=o,e[19]=n,e[20]=x,e[21]=S):S=e[21],S}function $e({open:s,onComplete:e,selectedInstallation:n,onSelectInstallation:o,hideAutoRespondCheckbox:u,onImportComplete:a}){const{org:r}=Q(),f=W(),p=be(),[i,h]=O.useState(null),[g,c]=O.useState(!0),[w,y]=O.useState(()=>new Set(D.filter(m=>m.defaultEnabled).map(m=>m.key))),N=D.filter(m=>m.defaultEnabled).map(m=>m.key),x=u?new Set(N):g?w:new Set,S=me({slug:"mcp-github"}),b=Ee(S),I=Se({enabled:s&&b.length===0}),d=b.length===1?b[0]??null:i,j=H({connectionId:d?.id??"",orgId:r.id,orgSlug:r.slug}),l=H({connectionId:X,orgId:r.id,orgSlug:r.slug}),C=async(m,E)=>{try{const G=await j.callTool({name:"get_file_contents",arguments:{owner:m.owner,repo:m.name,path:E}});if(G.isError)return null;const $=G.content?.find(A=>A.type==="resource")?.resource?.text;if(!$)return null;try{const A=JSON.parse($);return typeof A=="string"?A:JSON.stringify(A)}catch{return $}}catch{return null}},k=(m,E)=>{Promise.all([C(E,"AGENTS.md"),C(E,"CLAUDE.md")]).then(async([R,G])=>{const _=R??G??null;_&&(await l.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:m,data:{metadata:{instructions:_}}}}),B(f,r.id))}).catch(R=>{console.error("GitHub instructions fetch failed:",R)})},v=async({virtualMcpId:m,repo:E,connectionId:R,selectedKeys:G})=>{const{total:_,failed:$}=await Ge({githubCallTool:A=>j.callTool(A),selfCallTool:A=>l.callTool(A),virtualMcpId:m,repo:E,connectionId:R,selectedKeys:G});$>0&&z.warning(`Set up ${_-$}/${_} GitHub automations. Add the rest from the automations view.`)},T=ne({mutationFn:async m=>{if(!d||!n)throw new Error("No GitHub connection or installation");const E=n.installationId,{childConnectionId:R}=await Re({orgSlug:r.slug,sourceConnection:d,installationId:E,owner:m.owner,repo:m.name,githubCallTool:_=>j.callTool(_),selfCallTool:_=>l.callTool(_)});let G=null;try{const _=await l.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:m.name,description:m.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:m.owner,name:m.name,url:m.url,installationId:E,connectionId:R},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:R}]}}}),$=_.structuredContent??_,A=$.item?.id;if(!$.item||!A)throw new Error("Failed to create the imported agent");return G=A,x.size>0&&await v({virtualMcpId:A,repo:m,connectionId:R,selectedKeys:x}).catch(ee=>{console.error("Failed to set up GitHub automations:",ee),z.warning("Imported repo, but failed to set up GitHub automations. You can add triggers manually from the automations view.")}),{virtualMcpId:A,repo:m,connectionId:R,item:$.item}}catch(_){throw G&&await l.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:G}}).catch(()=>{}),await l.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:R,force:!0}}).catch(()=>{}),_}},onSuccess:({virtualMcpId:m,repo:E,connectionId:R,item:G})=>{if(f.setQueryData(V.collectionItem(l,r.id,"","VIRTUAL_MCP",m),{item:G}),B(f,r.id),k(m,E),a){a({virtualMcpId:m,repo:E,connectionId:R});return}z.success(`Imported ${E.name} from GitHub`),e(),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),p(m)},onError:m=>{z.error("Failed to import repo: "+(m instanceof Error?m.message:"Unknown error"))}});return I.status==="installing"||I.status==="authenticating"?t.jsx(q,{status:I.status,error:null,retry:I.retry}):I.status==="error"?t.jsx(q,{status:"error",error:I.error,retry:I.retry}):b.length===0&&I.status==="idle"?t.jsx(q,{status:"installing",error:null,retry:I.retry}):b.length>1&&!d?t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-4 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Select a connection"})}),b.map(m=>t.jsxs("button",{type:"button",onClick:()=>h(m),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[m.icon?t.jsx("img",{src:m.icon,alt:m.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(U,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:m.title})]},m.id))]}):d?n?t.jsx(Le,{connectionId:d.id,orgId:r.id,orgSlug:r.slug,installation:n,onSelectRepo:m=>T.mutate(m),isSaving:T.isPending,autoRespondEnabled:g,onAutoRespondChange:c,selectedAutomationKeys:w,onAutomationKeysChange:y,hideAutoRespondCheckbox:u}):t.jsx(Pe,{connectionId:d.id,orgId:r.id,orgSlug:r.slug,onSelect:o,showBackButton:b.length>1,onBack:()=>h(null)}):null}function Pe(s){const e=P.c(31),{connectionId:n,orgId:o,orgSlug:u,onSelect:a,showBackButton:r,onBack:f}=s;let p;e[0]!==o||e[1]!==u?(p={connectionId:X,orgId:o,orgSlug:u},e[0]=o,e[1]=u,e[2]=p):p=e[2];const i=H(p);let h;e[3]!==n||e[4]!==o?(h=V.githubUserOrgs(o,n),e[3]=n,e[4]=o,e[5]=h):h=e[5];let g;e[6]!==n||e[7]!==i?(g=()=>ve(l=>i.callTool(l),n),e[6]=n,e[7]=i,e[8]=g):g=e[8];let c;e[9]!==h||e[10]!==g?(c={queryKey:h,queryFn:g},e[9]=h,e[10]=g,e[11]=c):c=e[11];const w=se(c);if(w.isLoading){let l;return e[12]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(F,{size:18,className:"animate-spin text-muted-foreground"})}),e[12]=l):l=e[12],l}if(w.isError){let l;return e[13]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load GitHub accounts"})}),e[13]=l):l=e[13],l}const y=w.data;if(!y)return null;let N;e[14]!==f||e[15]!==r?(N=r&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:f,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(Z,{size:12}),"Change connection"]})}),e[14]=f,e[15]=r,e[16]=N):N=e[16];let x;if(e[17]!==y.installations||e[18]!==a){let l;e[20]!==a?(l=C=>t.jsxs("button",{type:"button",onClick:()=>a(C),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:C.avatarUrl,alt:C.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:C.login}),C.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"Personal account"})]}),t.jsx("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:"Select →"})]},C.installationId),e[20]=a,e[21]=l):l=e[21],x=y.installations.map(l),e[17]=y.installations,e[18]=a,e[19]=x}else x=e[19];let S;e[22]!==x?(S=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:x}),e[22]=x,e[23]=S):S=e[23];const b=y.appSlug?`https://github.com/apps/${y.appSlug}/installations/new`:"https://github.com/settings/installations";let I;e[24]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx("span",{className:"underline underline-offset-2",children:"Install the GitHub App"}),e[24]=I):I=e[24];let d;e[25]!==b?(d=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:b,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:["Account not listed?"," ",I]})}),e[25]=b,e[26]=d):d=e[26];let j;return e[27]!==d||e[28]!==N||e[29]!==S?(j=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[N,S,d]}),e[27]=d,e[28]=N,e[29]=S,e[30]=j):j=e[30],j}function Le(s){const e=P.c(27),{connectionId:n,orgId:o,orgSlug:u,installation:a,onSelectRepo:r,isSaving:f,autoRespondEnabled:p,onAutoRespondChange:i,selectedAutomationKeys:h,onAutomationKeysChange:g,hideAutoRespondCheckbox:c}=s,[w,y]=O.useState(""),N=Ae(w,300),x=O.useDeferredValue(N),S=w!==x;let b;e[0]!==S||e[1]!==w?(b=t.jsx(ue,{placeholder:"Search repositories...",value:w,onChange:y,isSearching:S}),e[0]=S,e[1]=w,e[2]=b):b=e[2];const I=S?"opacity-40":"opacity-100";let d;e[3]!==I?(d=K("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",I),e[3]=I,e[4]=d):d=e[4];let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(F,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=j):j=e[5];let l;e[6]!==n||e[7]!==x||e[8]!==a||e[9]!==f||e[10]!==r||e[11]!==o||e[12]!==u?(l=t.jsx(O.Suspense,{fallback:j,children:t.jsx(He,{connectionId:n,orgId:o,orgSlug:u,installation:a,query:x,onSelectRepo:r,isSaving:f})}),e[6]=n,e[7]=x,e[8]=a,e[9]=f,e[10]=r,e[11]=o,e[12]=u,e[13]=l):l=e[13];let C;e[14]!==d||e[15]!==l?(C=t.jsx("div",{className:d,children:l}),e[14]=d,e[15]=l,e[16]=C):C=e[16];let k;e[17]!==p||e[18]!==c||e[19]!==i||e[20]!==g||e[21]!==h?(k=!c&&t.jsxs("div",{className:"border-t border-border shrink-0",children:[t.jsxs("label",{className:"flex items-center gap-2 px-4 py-3 cursor-pointer select-none",children:[t.jsx(J,{checked:p,onCheckedChange:T=>i(T===!0)}),t.jsx("span",{className:"text-xs text-foreground",children:"Set up GitHub automations for this repo"})]}),p&&t.jsx("div",{className:"px-4 pb-3 pl-9 flex flex-col gap-1.5",children:D.map(T=>t.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[t.jsx(J,{checked:h.has(T.key),onCheckedChange:m=>{const E=new Set(h);m===!0?E.add(T.key):E.delete(T.key),g(E)}}),t.jsx("span",{className:"text-xs text-muted-foreground",children:T.label})]},T.key))})]}),e[17]=p,e[18]=c,e[19]=i,e[20]=g,e[21]=h,e[22]=k):k=e[22];let v;return e[23]!==b||e[24]!==C||e[25]!==k?(v=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[b,C,k]}),e[23]=b,e[24]=C,e[25]=k,e[26]=v):v=e[26],v}function He(s){const e=P.c(29),{connectionId:n,orgId:o,orgSlug:u,installation:a,query:r,onSelectRepo:f,isSaving:p}=s;let i;e[0]!==n||e[1]!==o||e[2]!==u?(i={connectionId:n,orgId:o,orgSlug:u},e[0]=n,e[1]=o,e[2]=u,e[3]=i):i=e[3];const h=H(i),g=a.type==="User"?"user":"org",c=r?`${g}:${a.login} ${r} in:name`:`${g}:${a.login}`;let w;e[4]!==n||e[5]!==a.login||e[6]!==o||e[7]!==r?(w=V.githubOrgRepos(o,n,a.login,r),e[4]=n,e[5]=a.login,e[6]=o,e[7]=r,e[8]=w):w=e[8];let y;e[9]!==h||e[10]!==c?(y=async I=>{const{signal:d}=I,l=(await h.callTool({name:"search_repositories",arguments:{query:c,page:1,perPage:30}},void 0,{signal:d})).content?.[0]?.text;if(!l)throw new Error("No response from search_repositories");return(JSON.parse(l).items??[]).map(Ue)},e[9]=h,e[10]=c,e[11]=y):y=e[11];let N;e[12]!==w||e[13]!==y?(N={queryKey:w,queryFn:y},e[12]=w,e[13]=y,e[14]=N):N=e[14];const{data:x}=oe(N);if(x.length===0){let I;e[15]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx("p",{className:"text-sm text-muted-foreground",children:"No repositories found"}),e[15]=I):I=e[15];let d;e[16]!==r?(d=r&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Try a different search term"}),e[16]=r,e[17]=d):d=e[17];let j;return e[18]!==d?(j=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[I,d]}),e[18]=d,e[19]=j):j=e[19],j}let S;if(e[20]!==p||e[21]!==f||e[22]!==x){let I;e[24]!==p||e[25]!==f?(I=d=>t.jsxs("button",{type:"button",onClick:()=>f(d),disabled:p,className:"flex items-start gap-3 px-4 py-3 hover:bg-accent transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx(U,{className:"size-4 text-muted-foreground mt-0.5 shrink-0"}),t.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:t.jsx("span",{className:"text-sm font-medium truncate",children:d.name})}),t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:[d.private?t.jsx(re,{size:10}):t.jsx(pe,{size:10}),d.private?"Private":"Public"]})]},d.fullName),e[24]=p,e[25]=f,e[26]=I):I=e[26],S=x.map(I),e[20]=p,e[21]=f,e[22]=x,e[23]=S}else S=e[23];let b;return e[27]!==S?(b=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:S}),e[27]=S,e[28]=b):b=e[28],b}function Ue(s){return{name:s.name,fullName:s.full_name,owner:s.full_name.split("/")[0]??"",url:s.html_url,private:s.private,description:s.description,updatedAt:s.updated_at}}function q(s){const e=P.c(33),{status:n,error:o,retry:u}=s;if(n==="error"){let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(U,{className:"size-5 text-destructive"})}),e[0]=l):l=e[0];let C;e[1]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("p",{className:"text-sm font-medium",children:"Connection failed"}),e[1]=C):C=e[1];const k=o??"Something went wrong while connecting to GitHub.";let v;e[2]!==k?(v=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[C,t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:k})]}),e[2]=k,e[3]=v):v=e[3];let T;e[4]!==u?(T=t.jsx("button",{type:"button",onClick:u,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:"Try again"}),e[4]=u,e[5]=T):T=e[5];let m;return e[6]!==v||e[7]!==T?(m=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[l,v,T]}),e[6]=v,e[7]=T,e[8]=m):m=e[8],m}const a=n==="authenticating";let r;e[9]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(U,{className:"size-5 text-foreground"})}),e[9]=r):r=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsxs("div",{className:"relative size-10",children:[r,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(F,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[10]=f):f=e[10];const p=a?"Authenticating with GitHub":"Setting up GitHub";let i;e[11]!==p?(i=t.jsx("p",{className:"text-sm font-medium",children:p}),e[11]=p,e[12]=i):i=e[12];const h=a?"Complete the OAuth flow in your browser":"Installing the GitHub connection...";let g;e[13]!==h?(g=t.jsx("p",{className:"text-xs text-muted-foreground",children:h}),e[13]=h,e[14]=g):g=e[14];let c;e[15]!==i||e[16]!==g?(c=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[i,g]}),e[15]=i,e[16]=g,e[17]=c):c=e[17];const w=a?"bg-muted-foreground/30":"bg-foreground animate-pulse";let y;e[18]!==w?(y=K("size-1.5 rounded-full",w),e[18]=w,e[19]=y):y=e[19];let N;e[20]!==y?(N=t.jsx("span",{className:y}),e[20]=y,e[21]=N):N=e[21];const x=a?"bg-foreground animate-pulse":"bg-muted-foreground/30";let S;e[22]!==x?(S=K("size-1.5 rounded-full",x),e[22]=x,e[23]=S):S=e[23];let b;e[24]!==S?(b=t.jsx("span",{className:S}),e[24]=S,e[25]=b):b=e[25];let I;e[26]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[26]=I):I=e[26];let d;e[27]!==N||e[28]!==b?(d=t.jsxs("div",{className:"flex items-center gap-1.5",children:[N,b,I]}),e[27]=N,e[28]=b,e[29]=d):d=e[29];let j;return e[30]!==d||e[31]!==c?(j=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[f,c,d]}),e[30]=d,e[31]=c,e[32]=j):j=e[32],j}export{Ze as G,U as a,Xe as b,ve as f,Ee as g,Re as p,Se as u};
1
+ import{c as P,j as t,s as Q,a as te,I as W,r as O,a4 as B,i as F,d as ne,t as z,K as V,k as se,l as K,a5 as oe,ae as re}from"./index-D0U_smqt.js";import{D as ie,a as ae,c as le,d as ce}from"./dialog-CQ6B0IwC.js";import{C as J}from"./checkbox-CL_5fiO_.js";import{C as ue}from"./collection-search-2g11_WBH.js";import{b as de,u as me}from"./use-connection-XfA-QrSw.js";import{W as fe,u as H,S as X}from"./use-mcp-client-DilmxmKU.js";import{i as Z}from"./Settings02-Cg6Yp6Ig.js";import{v as pe}from"./agent-icon-Bcqwo2Wq.js";import{i as ge,a as he}from"./mcp-oauth-Ccqa98JF.js";import{u as xe}from"./use-mcp-tools-uucJgbkt.js";import{e as ye}from"./extract-connection-data-D-Y4GRfE.js";import{m as be}from"./use-navigate-to-agent-HvaD8xDj.js";function U(s){const e=P.c(4),{size:n,className:o}=s;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0016 8c0-4.42-3.58-8-8-8z"}),e[0]=u):u=e[0];let a;return e[1]!==o||e[2]!==n?(a=t.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:o,children:u}),e[1]=o,e[2]=n,e[3]=a):a=e[3],a}function we(s,e){const n=P.c(12),{org:o}=Q();let u;n[0]!==o.id?(u=fe.REGISTRY(o.id),n[0]=o.id,n[1]=u):u=n[1];const a=u;let r;n[2]!==o.id||n[3]!==o.slug||n[4]!==a?(r={connectionId:a,orgId:o.id,orgSlug:o.slug},n[2]=o.id,n[3]=o.slug,n[4]=a,n[5]=r):r=n[5];const f=H(r);let p;n[6]!==s?(p={name:s},n[6]=s,n[7]=p):p=n[7];const i=e?.enabled??!0;let h;return n[8]!==f||n[9]!==p||n[10]!==i?(h={client:f,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:p,enabled:i,staleTime:3e5,select:Ie},n[8]=f,n[9]=p,n[10]=i,n[11]=h):h=n[11],xe(h)}function Ie(s){return s.structuredContent?.item??null}const Ne="deco/mcp-github";function Se(s){const{org:e}=Q(),{data:n}=te.useSession(),o=de(),u=W(),[a,r]=O.useState("idle"),[f,p]=O.useState(null),[i,h]=O.useState(null),{data:g,isLoading:c}=we(Ne,{enabled:s.enabled}),w=O.useRef(!1);s.enabled&&g&&!c&&!w.current&&n?.user?.id&&a==="idle"&&(w.current=!0,y());async function y(){if(!(!g||!n?.user?.id||!e))try{r("installing"),p(null);const x=ye(g,e.id,n.user.id,{remoteIndex:0});if(!x.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:b}=await o.create.mutateAsync(x);r("authenticating");const N=new URL(`/api/${e.slug}/mcp/${b}`,window.location.origin),d=await ge({url:N.href,token:null,orgId:e.id});if(d.supportsOAuth&&!d.isAuthenticated){const{token:j,tokenInfo:l,error:C}=await he({connectionId:b,orgSlug:e.slug,scope:"offline_access"});if(C||!j){try{await o.delete.mutateAsync(b)}catch{}throw new Error(C??"No token received from GitHub")}if(l)try{(await fetch(`/api/${e.slug}/connections/${b}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:l.accessToken,refreshToken:l.refreshToken,expiresIn:l.expiresIn,scope:l.scope,clientId:l.clientId,clientSecret:l.clientSecret,tokenEndpoint:l.tokenEndpoint})})).ok||await o.update.mutateAsync({id:b,data:{connection_token:j}})}catch{await o.update.mutateAsync({id:b,data:{connection_token:j}})}}B(u,e.id),h(x),r("ready")}catch(x){p(x instanceof Error?x.message:String(x)),r("error")}}function I(){r("idle"),p(null),h(null),w.current=!1}return s.enabled&&c&&a==="idle"?{status:"installing",error:null,connection:null,retry:I}:{status:a,error:f,connection:i,retry:I}}const M={contents:"write",metadata:"read",pull_requests:"write",issues:"write"};function je(s){if(!s||typeof s!="object"||Array.isArray(s))return M;const e=s;return Object.values(e).some(n=>typeof n!="string")?M:e}function Ce(s){if(!(typeof s!="number"||!Number.isFinite(s)||!Number.isInteger(s)||s<=0))return s}function Te(s){const e=s.metadata?.repoScope;if(!e||typeof e.installationId!="number"||!Number.isFinite(e.installationId)||!Number.isInteger(e.installationId)||e.installationId<=0||typeof e.owner!="string"||typeof e.repo!="string"||e.owner.length===0||e.repo.length===0)return null;const n=Ce(e.repositoryId);return{sourceConnectionId:typeof e.sourceConnectionId=="string"?e.sourceConnectionId:void 0,installationId:e.installationId,repositoryId:n,owner:e.owner,repo:e.repo,permissions:je(e.permissions),grantProvider:e.grantProvider==="github-mcp"?"github-mcp":void 0}}function Ee(s){return(s??[]).filter(e=>Te(e)===null)}async function ve(s,e){const o=(await s({name:"GITHUB_LIST_USER_ORGS",arguments:{connectionId:e}})).content?.[0]?.text;if(!o)throw new Error("No response from GITHUB_LIST_USER_ORGS");try{return JSON.parse(o)}catch{throw new Error("Invalid response from GITHUB_LIST_USER_ORGS")}}function Xe(s,e){const n=e.toLowerCase();return s.find(o=>o.login.toLowerCase()===n)}const Y="GitHub MCP did not return refreshable repo grant metadata";function L(s){if(typeof s!="string")return null;const e=s.trim();return e.length>0?e:null}function _e(s){try{const e=new URL(s);return(e.protocol==="http:"||e.protocol==="https:")&&!e.username&&!e.password}catch{return!1}}function ke(s){return typeof s=="number"&&Number.isFinite(s)&&Number.isInteger(s)&&s>0?s:void 0}async function Re(s){const{orgSlug:e,sourceConnection:n,installationId:o,owner:u,repo:a,githubCallTool:r,selfCallTool:f}=s,p=await r({name:"MINT_REPO_TOKEN",arguments:{installationId:o,owner:u,repo:a,permissions:M}}),i=p.structuredContent;if(p.isError||!i?.token){const v=p.content?.find(T=>T.type==="text")?.text;throw new Error(v?`Failed to mint a repo-scoped GitHub token: ${v}`:"Failed to mint a repo-scoped GitHub token")}const h=L(i.refreshToken),g=L(i.tokenEndpoint),c=L(i.clientId);if(!h||!g||!c)throw new Error(Y);if(!_e(g))throw new Error(Y);const w=L(i.repository?.owner),y=L(i.repository?.name),I="GitHub MCP returned refresh metadata for a different repository";if(i.repository?.owner!==void 0&&(!w||w.toLowerCase()!==u.toLowerCase()))throw new Error(I);if(i.repository?.name!==void 0&&(!y||y.toLowerCase()!==a.toLowerCase()))throw new Error(I);const x=ke(i.repository?.id),S=i.expiresAt?Date.parse(i.expiresAt):NaN,b=Number.isFinite(S)?Math.max(0,Math.floor((S-Date.now())/1e3)):null,d=(typeof i.expiresIn=="number"&&Number.isFinite(i.expiresIn)&&Number.isInteger(i.expiresIn)&&i.expiresIn>0?i.expiresIn:null)??b,j=await f({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:{title:`GitHub: ${u}/${a}`,description:`Repo-scoped GitHub access for ${u}/${a}`,icon:n.icon,app_name:n.app_name,app_id:n.app_id,connection_type:n.connection_type,connection_url:n.connection_url,metadata:{repoScope:{installationId:o,repositoryId:x,owner:u,repo:a,permissions:M,grantProvider:"github-mcp"}}}}}),l=j.structuredContent??j,C=l.item?.id??l.id;if(!C)throw new Error("Failed to create the repo-scoped GitHub connection");if(!(await fetch(`/api/${e}/connections/${C}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:i.token,refreshToken:h,expiresIn:d,scope:i.scope??null,clientId:c,tokenEndpoint:g})})).ok)throw await f({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:C,force:!0}}).catch(()=>{}),new Error("Failed to persist the repo-scoped token");return{childConnectionId:C}}function Ae(s,e){const n=P.c(4),[o,u]=O.useState(s);let a,r;return n[0]!==e||n[1]!==s?(a=()=>{const f=setTimeout(()=>u(s),e);return()=>clearTimeout(f)},r=[s,e],n[0]=e,n[1]=s,n[2]=a,n[3]=r):(a=n[2],r=n[3]),O.useEffect(a,r),o}const D=[{key:"auto-respond-to-issues",triggerType:"github.issues.opened",nameSuffix:"auto-respond to issues",label:"Auto-respond to new issues",defaultEnabled:!0,instructions:({owner:s,name:e})=>`A new GitHub issue has been opened in ${s}/${e}. Read the issue, explore relevant code, create a branch, implement the fix, and open a PR referencing the issue number.`},{key:"review-incoming-prs",triggerType:"github.pull_request.opened",nameSuffix:"review incoming PRs",label:"Review incoming pull requests",defaultEnabled:!0,instructions:({owner:s,name:e})=>`A pull request was opened in ${s}/${e}. Read the diff, summarize what changed, flag risks (security, perf, breaking changes), and leave a review comment.`},{key:"note-merged-prs",triggerType:"github.pull_request.closed",nameSuffix:"note merged/closed PRs",label:"Note merged or closed PRs",defaultEnabled:!1,instructions:({owner:s,name:e})=>`A pull request was closed in ${s}/${e}. If it was merged, update changelog/release notes as appropriate.`}];function Oe(s,e){const n=new Set;if(s.paramsSchema)for(const u of Object.keys(s.paramsSchema))n.add(u);if(Array.isArray(s.params))for(const u of s.params)n.add(u.name);else if(s.params&&typeof s.params=="object")for(const u of Object.keys(s.params))n.add(u);if(n.has("repo"))return{repo:`${e.owner}/${e.name}`};const o={};return n.has("owner")&&(o.owner=e.owner),n.has("name")&&(o.name=e.name),n.has("repository")&&(o.repository=`${e.owner}/${e.name}`),o}async function Ge({githubCallTool:s,selfCallTool:e,virtualMcpId:n,repo:o,connectionId:u,selectedKeys:a}){const r=await s({name:"TRIGGER_LIST",arguments:{}}),f=r.structuredContent??r,p=new Map((f.triggers??[]).map(c=>[c.type,c])),i=D.filter(c=>a.has(c.key)),h=await Promise.allSettled(i.map(async c=>{const w=p.get(c.triggerType);if(!w)throw new Error(`Trigger ${c.triggerType} not exposed`);const y=await e({name:"AUTOMATION_CREATE",arguments:{name:`${o.name}: ${c.nameSuffix}`,virtual_mcp_id:n,messages:c.instructions(o),active:!0}}),I=(y.structuredContent??y).id;if(!I)throw new Error(`AUTOMATION_CREATE returned no id for ${c.key}`);await e({name:"AUTOMATION_TRIGGER_ADD",arguments:{automation_id:I,type:"event",connection_id:u,event_type:c.triggerType,params:Oe(w,o)}})})),g=h.filter(c=>c.status==="rejected").length;return g>0&&console.error("Some GitHub automations failed to set up:",h.filter(c=>c.status==="rejected")),{total:h.length,failed:g}}function Ze(s){const e=P.c(22),{open:n,onOpenChange:o,title:u,hideAutoRespondCheckbox:a,onImportComplete:r}=s,f=u===void 0?"Import from GitHub":u,p=a===void 0?!1:a,[i,h]=O.useState(null);let g;e[0]!==f?(g=t.jsx(ie,{className:"sr-only",children:t.jsx(ae,{children:f})}),e[0]=f,e[1]=g):g=e[1];let c;e[2]!==i||e[3]!==f?(c=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:i?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>h(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":"Back to accounts",children:t.jsx(Z,{size:16})}),t.jsx("img",{src:i.avatarUrl,alt:i.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:i.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(U,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:f})]})}),e[2]=i,e[3]=f,e[4]=c):c=e[4];let w;e[5]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(F,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=w):w=e[5];let y;e[6]!==o?(y=()=>o(!1),e[6]=o,e[7]=y):y=e[7];let I;e[8]!==p||e[9]!==r||e[10]!==n||e[11]!==i||e[12]!==y?(I=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(O.Suspense,{fallback:w,children:t.jsx($e,{open:n,onComplete:y,selectedInstallation:i,onSelectInstallation:h,hideAutoRespondCheckbox:p,onImportComplete:r})})}),e[8]=p,e[9]=r,e[10]=n,e[11]=i,e[12]=y,e[13]=I):I=e[13];let x;e[14]!==g||e[15]!==c||e[16]!==I?(x=t.jsxs(le,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[g,c,I]}),e[14]=g,e[15]=c,e[16]=I,e[17]=x):x=e[17];let S;return e[18]!==o||e[19]!==n||e[20]!==x?(S=t.jsx(ce,{open:n,onOpenChange:o,children:x}),e[18]=o,e[19]=n,e[20]=x,e[21]=S):S=e[21],S}function $e({open:s,onComplete:e,selectedInstallation:n,onSelectInstallation:o,hideAutoRespondCheckbox:u,onImportComplete:a}){const{org:r}=Q(),f=W(),p=be(),[i,h]=O.useState(null),[g,c]=O.useState(!0),[w,y]=O.useState(()=>new Set(D.filter(m=>m.defaultEnabled).map(m=>m.key))),I=D.filter(m=>m.defaultEnabled).map(m=>m.key),x=u?new Set(I):g?w:new Set,S=me({slug:"mcp-github"}),b=Ee(S),N=Se({enabled:s&&b.length===0}),d=b.length===1?b[0]??null:i,j=H({connectionId:d?.id??"",orgId:r.id,orgSlug:r.slug}),l=H({connectionId:X,orgId:r.id,orgSlug:r.slug}),C=async(m,E)=>{try{const G=await j.callTool({name:"get_file_contents",arguments:{owner:m.owner,repo:m.name,path:E}});if(G.isError)return null;const $=G.content?.find(A=>A.type==="resource")?.resource?.text;if(!$)return null;try{const A=JSON.parse($);return typeof A=="string"?A:JSON.stringify(A)}catch{return $}}catch{return null}},k=(m,E)=>{Promise.all([C(E,"AGENTS.md"),C(E,"CLAUDE.md")]).then(async([R,G])=>{const _=R??G??null;_&&(await l.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:m,data:{metadata:{instructions:_}}}}),B(f,r.id))}).catch(R=>{console.error("GitHub instructions fetch failed:",R)})},v=async({virtualMcpId:m,repo:E,connectionId:R,selectedKeys:G})=>{const{total:_,failed:$}=await Ge({githubCallTool:A=>j.callTool(A),selfCallTool:A=>l.callTool(A),virtualMcpId:m,repo:E,connectionId:R,selectedKeys:G});$>0&&z.warning(`Set up ${_-$}/${_} GitHub automations. Add the rest from the automations view.`)},T=ne({mutationFn:async m=>{if(!d||!n)throw new Error("No GitHub connection or installation");const E=n.installationId,{childConnectionId:R}=await Re({orgSlug:r.slug,sourceConnection:d,installationId:E,owner:m.owner,repo:m.name,githubCallTool:_=>j.callTool(_),selfCallTool:_=>l.callTool(_)});let G=null;try{const _=await l.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:m.name,description:m.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:m.owner,name:m.name,url:m.url,installationId:E,connectionId:R},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:R}]}}}),$=_.structuredContent??_,A=$.item?.id;if(!$.item||!A)throw new Error("Failed to create the imported agent");return G=A,x.size>0&&await v({virtualMcpId:A,repo:m,connectionId:R,selectedKeys:x}).catch(ee=>{console.error("Failed to set up GitHub automations:",ee),z.warning("Imported repo, but failed to set up GitHub automations. You can add triggers manually from the automations view.")}),{virtualMcpId:A,repo:m,connectionId:R,item:$.item}}catch(_){throw G&&await l.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:G}}).catch(()=>{}),await l.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:R,force:!0}}).catch(()=>{}),_}},onSuccess:({virtualMcpId:m,repo:E,connectionId:R,item:G})=>{if(f.setQueryData(V.collectionItem(l,r.id,"","VIRTUAL_MCP",m),{item:G}),B(f,r.id),k(m,E),a){a({virtualMcpId:m,repo:E,connectionId:R});return}z.success(`Imported ${E.name} from GitHub`),e(),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),p(m)},onError:m=>{z.error("Failed to import repo: "+(m instanceof Error?m.message:"Unknown error"))}});return N.status==="installing"||N.status==="authenticating"?t.jsx(q,{status:N.status,error:null,retry:N.retry}):N.status==="error"?t.jsx(q,{status:"error",error:N.error,retry:N.retry}):b.length===0&&N.status==="idle"?t.jsx(q,{status:"installing",error:null,retry:N.retry}):b.length>1&&!d?t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-4 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Select a connection"})}),b.map(m=>t.jsxs("button",{type:"button",onClick:()=>h(m),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[m.icon?t.jsx("img",{src:m.icon,alt:m.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(U,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:m.title})]},m.id))]}):d?n?t.jsx(Le,{connectionId:d.id,orgId:r.id,orgSlug:r.slug,installation:n,onSelectRepo:m=>T.mutate(m),isSaving:T.isPending,autoRespondEnabled:g,onAutoRespondChange:c,selectedAutomationKeys:w,onAutomationKeysChange:y,hideAutoRespondCheckbox:u}):t.jsx(Pe,{connectionId:d.id,orgId:r.id,orgSlug:r.slug,onSelect:o,showBackButton:b.length>1,onBack:()=>h(null)}):null}function Pe(s){const e=P.c(31),{connectionId:n,orgId:o,orgSlug:u,onSelect:a,showBackButton:r,onBack:f}=s;let p;e[0]!==o||e[1]!==u?(p={connectionId:X,orgId:o,orgSlug:u},e[0]=o,e[1]=u,e[2]=p):p=e[2];const i=H(p);let h;e[3]!==n||e[4]!==o?(h=V.githubUserOrgs(o,n),e[3]=n,e[4]=o,e[5]=h):h=e[5];let g;e[6]!==n||e[7]!==i?(g=()=>ve(l=>i.callTool(l),n),e[6]=n,e[7]=i,e[8]=g):g=e[8];let c;e[9]!==h||e[10]!==g?(c={queryKey:h,queryFn:g},e[9]=h,e[10]=g,e[11]=c):c=e[11];const w=se(c);if(w.isLoading){let l;return e[12]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(F,{size:18,className:"animate-spin text-muted-foreground"})}),e[12]=l):l=e[12],l}if(w.isError){let l;return e[13]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load GitHub accounts"})}),e[13]=l):l=e[13],l}const y=w.data;if(!y)return null;let I;e[14]!==f||e[15]!==r?(I=r&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:f,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(Z,{size:12}),"Change connection"]})}),e[14]=f,e[15]=r,e[16]=I):I=e[16];let x;if(e[17]!==y.installations||e[18]!==a){let l;e[20]!==a?(l=C=>t.jsxs("button",{type:"button",onClick:()=>a(C),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:C.avatarUrl,alt:C.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:C.login}),C.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"Personal account"})]}),t.jsx("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:"Select →"})]},C.installationId),e[20]=a,e[21]=l):l=e[21],x=y.installations.map(l),e[17]=y.installations,e[18]=a,e[19]=x}else x=e[19];let S;e[22]!==x?(S=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:x}),e[22]=x,e[23]=S):S=e[23];const b=y.appSlug?`https://github.com/apps/${y.appSlug}/installations/new`:"https://github.com/settings/installations";let N;e[24]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("span",{className:"underline underline-offset-2",children:"Install the GitHub App"}),e[24]=N):N=e[24];let d;e[25]!==b?(d=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:b,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:["Account not listed?"," ",N]})}),e[25]=b,e[26]=d):d=e[26];let j;return e[27]!==d||e[28]!==I||e[29]!==S?(j=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[I,S,d]}),e[27]=d,e[28]=I,e[29]=S,e[30]=j):j=e[30],j}function Le(s){const e=P.c(27),{connectionId:n,orgId:o,orgSlug:u,installation:a,onSelectRepo:r,isSaving:f,autoRespondEnabled:p,onAutoRespondChange:i,selectedAutomationKeys:h,onAutomationKeysChange:g,hideAutoRespondCheckbox:c}=s,[w,y]=O.useState(""),I=Ae(w,300),x=O.useDeferredValue(I),S=w!==x;let b;e[0]!==S||e[1]!==w?(b=t.jsx(ue,{placeholder:"Search repositories...",value:w,onChange:y,isSearching:S}),e[0]=S,e[1]=w,e[2]=b):b=e[2];const N=S?"opacity-40":"opacity-100";let d;e[3]!==N?(d=K("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",N),e[3]=N,e[4]=d):d=e[4];let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(F,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=j):j=e[5];let l;e[6]!==n||e[7]!==x||e[8]!==a||e[9]!==f||e[10]!==r||e[11]!==o||e[12]!==u?(l=t.jsx(O.Suspense,{fallback:j,children:t.jsx(He,{connectionId:n,orgId:o,orgSlug:u,installation:a,query:x,onSelectRepo:r,isSaving:f})}),e[6]=n,e[7]=x,e[8]=a,e[9]=f,e[10]=r,e[11]=o,e[12]=u,e[13]=l):l=e[13];let C;e[14]!==d||e[15]!==l?(C=t.jsx("div",{className:d,children:l}),e[14]=d,e[15]=l,e[16]=C):C=e[16];let k;e[17]!==p||e[18]!==c||e[19]!==i||e[20]!==g||e[21]!==h?(k=!c&&t.jsxs("div",{className:"border-t border-border shrink-0",children:[t.jsxs("label",{className:"flex items-center gap-2 px-4 py-3 cursor-pointer select-none",children:[t.jsx(J,{checked:p,onCheckedChange:T=>i(T===!0)}),t.jsx("span",{className:"text-xs text-foreground",children:"Set up GitHub automations for this repo"})]}),p&&t.jsx("div",{className:"px-4 pb-3 pl-9 flex flex-col gap-1.5",children:D.map(T=>t.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[t.jsx(J,{checked:h.has(T.key),onCheckedChange:m=>{const E=new Set(h);m===!0?E.add(T.key):E.delete(T.key),g(E)}}),t.jsx("span",{className:"text-xs text-muted-foreground",children:T.label})]},T.key))})]}),e[17]=p,e[18]=c,e[19]=i,e[20]=g,e[21]=h,e[22]=k):k=e[22];let v;return e[23]!==b||e[24]!==C||e[25]!==k?(v=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[b,C,k]}),e[23]=b,e[24]=C,e[25]=k,e[26]=v):v=e[26],v}function He(s){const e=P.c(29),{connectionId:n,orgId:o,orgSlug:u,installation:a,query:r,onSelectRepo:f,isSaving:p}=s;let i;e[0]!==n||e[1]!==o||e[2]!==u?(i={connectionId:n,orgId:o,orgSlug:u},e[0]=n,e[1]=o,e[2]=u,e[3]=i):i=e[3];const h=H(i),g=a.type==="User"?"user":"org",c=r?`${g}:${a.login} ${r} in:name`:`${g}:${a.login}`;let w;e[4]!==n||e[5]!==a.login||e[6]!==o||e[7]!==r?(w=V.githubOrgRepos(o,n,a.login,r),e[4]=n,e[5]=a.login,e[6]=o,e[7]=r,e[8]=w):w=e[8];let y;e[9]!==h||e[10]!==c?(y=async N=>{const{signal:d}=N,l=(await h.callTool({name:"search_repositories",arguments:{query:c,page:1,perPage:30}},void 0,{signal:d})).content?.[0]?.text;if(!l)throw new Error("No response from search_repositories");return(JSON.parse(l).items??[]).map(Ue)},e[9]=h,e[10]=c,e[11]=y):y=e[11];let I;e[12]!==w||e[13]!==y?(I={queryKey:w,queryFn:y},e[12]=w,e[13]=y,e[14]=I):I=e[14];const{data:x}=oe(I);if(x.length===0){let N;e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("p",{className:"text-sm text-muted-foreground",children:"No repositories found"}),e[15]=N):N=e[15];let d;e[16]!==r?(d=r&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Try a different search term"}),e[16]=r,e[17]=d):d=e[17];let j;return e[18]!==d?(j=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[N,d]}),e[18]=d,e[19]=j):j=e[19],j}let S;if(e[20]!==p||e[21]!==f||e[22]!==x){let N;e[24]!==p||e[25]!==f?(N=d=>t.jsxs("button",{type:"button",onClick:()=>f(d),disabled:p,className:"flex items-start gap-3 px-4 py-3 hover:bg-accent transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx(U,{className:"size-4 text-muted-foreground mt-0.5 shrink-0"}),t.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:t.jsx("span",{className:"text-sm font-medium truncate",children:d.name})}),t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:[d.private?t.jsx(re,{size:10}):t.jsx(pe,{size:10}),d.private?"Private":"Public"]})]},d.fullName),e[24]=p,e[25]=f,e[26]=N):N=e[26],S=x.map(N),e[20]=p,e[21]=f,e[22]=x,e[23]=S}else S=e[23];let b;return e[27]!==S?(b=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:S}),e[27]=S,e[28]=b):b=e[28],b}function Ue(s){return{name:s.name,fullName:s.full_name,owner:s.full_name.split("/")[0]??"",url:s.html_url,private:s.private,description:s.description,updatedAt:s.updated_at}}function q(s){const e=P.c(33),{status:n,error:o,retry:u}=s;if(n==="error"){let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(U,{className:"size-5 text-destructive"})}),e[0]=l):l=e[0];let C;e[1]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("p",{className:"text-sm font-medium",children:"Connection failed"}),e[1]=C):C=e[1];const k=o??"Something went wrong while connecting to GitHub.";let v;e[2]!==k?(v=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[C,t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:k})]}),e[2]=k,e[3]=v):v=e[3];let T;e[4]!==u?(T=t.jsx("button",{type:"button",onClick:u,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:"Try again"}),e[4]=u,e[5]=T):T=e[5];let m;return e[6]!==v||e[7]!==T?(m=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[l,v,T]}),e[6]=v,e[7]=T,e[8]=m):m=e[8],m}const a=n==="authenticating";let r;e[9]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(U,{className:"size-5 text-foreground"})}),e[9]=r):r=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsxs("div",{className:"relative size-10",children:[r,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(F,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[10]=f):f=e[10];const p=a?"Authenticating with GitHub":"Setting up GitHub";let i;e[11]!==p?(i=t.jsx("p",{className:"text-sm font-medium",children:p}),e[11]=p,e[12]=i):i=e[12];const h=a?"Complete the OAuth flow in your browser":"Installing the GitHub connection...";let g;e[13]!==h?(g=t.jsx("p",{className:"text-xs text-muted-foreground",children:h}),e[13]=h,e[14]=g):g=e[14];let c;e[15]!==i||e[16]!==g?(c=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[i,g]}),e[15]=i,e[16]=g,e[17]=c):c=e[17];const w=a?"bg-muted-foreground/30":"bg-foreground animate-pulse";let y;e[18]!==w?(y=K("size-1.5 rounded-full",w),e[18]=w,e[19]=y):y=e[19];let I;e[20]!==y?(I=t.jsx("span",{className:y}),e[20]=y,e[21]=I):I=e[21];const x=a?"bg-foreground animate-pulse":"bg-muted-foreground/30";let S;e[22]!==x?(S=K("size-1.5 rounded-full",x),e[22]=x,e[23]=S):S=e[23];let b;e[24]!==S?(b=t.jsx("span",{className:S}),e[24]=S,e[25]=b):b=e[25];let N;e[26]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[26]=N):N=e[26];let d;e[27]!==I||e[28]!==b?(d=t.jsxs("div",{className:"flex items-center gap-1.5",children:[I,b,N]}),e[27]=I,e[28]=b,e[29]=d):d=e[29];let j;return e[30]!==d||e[31]!==c?(j=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[f,c,d]}),e[30]=d,e[31]=c,e[32]=j):j=e[32],j}export{Ze as G,U as a,Xe as b,ve as f,Ee as g,Re as p,Se as u};