decocms 4.3.0 → 4.4.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 (249) hide show
  1. package/dist/client/assets/{AlertCircle-DC-zDzV-.js → AlertCircle-CM6D9elR.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-OJZisFPQ.js → ArrowUpRight-Kqa5fEjt.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-Cgnheu-R.js → CheckCircle-8DKF8Yx5.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-DyHvxYlc.js → ChevronDown-DGuR7uUZ.js} +1 -1
  5. package/dist/client/assets/{ChevronRight-Cpfh3gza.js → ChevronRight-BswIt99A.js} +1 -1
  6. package/dist/client/assets/{ChevronUp-DBpw6M-L.js → ChevronUp-DSdWQUoR.js} +1 -1
  7. package/dist/client/assets/{DotsVertical-5jSu3d1f.js → DotsVertical-DSosYpI1.js} +1 -1
  8. package/dist/client/assets/{Eye-bojNLUjA.js → Eye-Dn1AISrx.js} +1 -1
  9. package/dist/client/assets/{FilterLines-CFl65nng.js → FilterLines-CmWI-8pG.js} +1 -1
  10. package/dist/client/assets/{Globe01-CyfpzbeQ.js → Globe01-CcXDI4W7.js} +1 -1
  11. package/dist/client/assets/{Globe04-DFpdKSRI.js → Globe04-B9Btoycr.js} +1 -1
  12. package/dist/client/assets/{HardDrive-B1mtnaeA.js → HardDrive-BqXWgcmp.js} +1 -1
  13. package/dist/client/assets/{Key01-CwrJlZo0.js → Key01-F6-x7vNY.js} +1 -1
  14. package/dist/client/assets/{LayoutLeft-fsm0LcB8.js → LayoutLeft-DpqtgcH3.js} +1 -1
  15. package/dist/client/assets/{LinkExternal01-BHwVyDja.js → LinkExternal01-DOU6-C1w.js} +1 -1
  16. package/dist/client/assets/{Monitor01-ChA6ov2I.js → Monitor01-SkSQUhmT.js} +1 -1
  17. package/dist/client/assets/{Palette-DusYqL0W.js → Palette-CnoObDqZ.js} +1 -1
  18. package/dist/client/assets/{Play-CnXG8qqP.js → Play-DzGcMRv3.js} +1 -1
  19. package/dist/client/assets/{Plus-eGxBB1d8.js → Plus-DDlkoJBs.js} +1 -1
  20. package/dist/client/assets/{SearchLg-CDpA_lbT.js → SearchLg-CdT_y89m.js} +1 -1
  21. package/dist/client/assets/{SearchMd-ujiTPCmg.js → SearchMd-UY2xUREv.js} +1 -1
  22. package/dist/client/assets/{Settings02-BcAnTzm5.js → Settings02-QyYEyYyn.js} +1 -1
  23. package/dist/client/assets/{Shield01-ZxmFmrvL.js → Shield01-V8b5EFFL.js} +1 -1
  24. package/dist/client/assets/{Star01-DHEkWySe.js → Star01-GVe4t6O1.js} +1 -1
  25. package/dist/client/assets/{Stars01-BdCaKqhF.js → Stars01-BIVPeWqS.js} +1 -1
  26. package/dist/client/assets/{Stars02-qnq-_X9g.js → Stars02-DVZm69DV.js} +1 -1
  27. package/dist/client/assets/{Sun-lTiqxOzH.js → Sun-B2ndPBZP.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-DAZXInW8.js → SwitchHorizontal01-BL4xnvxO.js} +1 -1
  29. package/dist/client/assets/{Tool01-CvnpFI53.js → Tool01-Ci5EQ1tM.js} +1 -1
  30. package/dist/client/assets/{Trash01-ByxlxTiZ.js → Trash01-Cc007jho.js} +1 -1
  31. package/dist/client/assets/{Upload01-Z77n1bV8.js → Upload01-DB9meUjO.js} +1 -1
  32. package/dist/client/assets/{User01-COQtf360.js → User01-Dz-_mMMJ.js} +1 -1
  33. package/dist/client/assets/{Users01-wtRJYQKX.js → Users01-Ctg0iuAM.js} +1 -1
  34. package/dist/client/assets/{Users03-DknrDMtT.js → Users03-BazvU-rC.js} +1 -1
  35. package/dist/client/assets/{X-DrMVHLcw.js → X-_dGiBqSn.js} +1 -1
  36. package/dist/client/assets/{XCircle-Ct0eqqsw.js → XCircle-CmN6DNsv.js} +1 -1
  37. package/dist/client/assets/{XClose-BaZ908gw.js → XClose-BpreRuFP.js} +1 -1
  38. package/dist/client/assets/{Zap-wRIFSWIq.js → Zap-CWxLsQ6b.js} +1 -1
  39. package/dist/client/assets/{ZapSquare-PMiGcZpW.js → ZapSquare-D5x1wm0t.js} +1 -1
  40. package/dist/client/assets/{ZoomOut-6ix2H92j.js → ZoomOut-C0bVPfpC.js} +1 -1
  41. package/dist/client/assets/{access-gate-D6dGDGRI.js → access-gate-CpQ3bOMg.js} +1 -1
  42. package/dist/client/assets/{add-section-modal-DOhGqRCL.js → add-section-modal-D22Rp_ry.js} +1 -1
  43. package/dist/client/assets/agent-icon-BjxA8YR3.js +1 -0
  44. package/dist/client/assets/agents-list-C17XwfcN.js +1 -0
  45. package/dist/client/assets/{ai-providers-Crp7kidL.js → ai-providers-DNjwL7U0.js} +1 -1
  46. package/dist/client/assets/{alert-CKj_5smu.js → alert-CTzYtGwN.js} +1 -1
  47. package/dist/client/assets/{alert-dialog-CYizItFp.js → alert-dialog-DMWXmTGp.js} +2 -2
  48. package/dist/client/assets/app-editor-uAXMllzs.js +1 -0
  49. package/dist/client/assets/{auth-Bej0Tx2Y.js → auth-DraSXrC6.js} +1 -1
  50. package/dist/client/assets/{auth-catchall-CmNVpp-8.js → auth-catchall--3ZAEbBd.js} +1 -1
  51. package/dist/client/assets/{auth-entry-PwLVm-jX.js → auth-entry-DRJ-aW15.js} +1 -1
  52. package/dist/client/assets/{auth-split-layout-5YwPgbAb.js → auth-split-layout-B77S9w6i.js} +1 -1
  53. package/dist/client/assets/{authenticate-and-persist-oauth-DoPUB_Bh.js → authenticate-and-persist-oauth-HBteAcVm.js} +1 -1
  54. package/dist/client/assets/{automation-list-row-CsTyBm4M.js → automation-list-row-NZNZGrlr.js} +1 -1
  55. package/dist/client/assets/automation-runs-BoQeZ1gh.js +1 -0
  56. package/dist/client/assets/automations-bd5MK3eJ.js +1 -0
  57. package/dist/client/assets/{avatar-CJP1BOq4.js → avatar-COMRxqae.js} +1 -1
  58. package/dist/client/assets/{badge-DhpSM7g_.js → badge-B1dPfLuK.js} +1 -1
  59. package/dist/client/assets/{block-document-B2vhG8Ii.js → block-document-B6TgjyKW.js} +2 -2
  60. package/dist/client/assets/{brand-context-BRpHgxfT.js → brand-context-DGv078pp.js} +1 -1
  61. package/dist/client/assets/{buckets-DDR0G33f.js → buckets-LnyV7EWC.js} +1 -1
  62. package/dist/client/assets/bulk-category-panel-BP0Mtj3P.js +1 -0
  63. package/dist/client/assets/{capability-load-error-CCgNL5xi.js → capability-load-error-WTr85D-I.js} +1 -1
  64. package/dist/client/assets/{card-BFb5m83e.js → card-Bys-wDTW.js} +1 -1
  65. package/dist/client/assets/category-editor-Cm1sAVk_.js +1 -0
  66. package/dist/client/assets/{chat-context-n9syhvq-.js → chat-context-huSCeR82.js} +4 -4
  67. package/dist/client/assets/{checkbox-DmOzmKLP.js → checkbox-BIDlFz_0.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-BVPtMYcv.js → cli-auth-success-DJ5lbMQC.js} +1 -1
  69. package/dist/client/assets/collection-detail-UTQtN0-J.js +1 -0
  70. package/dist/client/assets/{collection-display-button-Bf9dlJRy.js → collection-display-button-Bnm_JutP.js} +1 -1
  71. package/dist/client/assets/{collection-search-8iNXnGlM.js → collection-search-CKMDHnku.js} +1 -1
  72. package/dist/client/assets/{collection-tabs-KA2be3wH.js → collection-tabs-CWrBkWhe.js} +1 -1
  73. package/dist/client/assets/{command-C34397s2.js → command-DrgMAh0a.js} +1 -1
  74. package/dist/client/assets/commerce-onboarding-B8pBrcvE.js +1 -0
  75. package/dist/client/assets/{connect-desktop-dialog-Brra3cMC.js → connect-desktop-dialog-CvuFk-NY.js} +1 -1
  76. package/dist/client/assets/{connection-card-C6NYo4Gp.js → connection-card-DIh-SIqT.js} +1 -1
  77. package/dist/client/assets/connection-detail-CWog7XFK.js +1 -0
  78. package/dist/client/assets/{connection-form-helpers-CwZx7WkC.js → connection-form-helpers-DV-bwjt7.js} +1 -1
  79. package/dist/client/assets/connections-BkvcH3F-.js +1 -0
  80. package/dist/client/assets/{context-menu-BW_OZBmV.js → context-menu-BPHfkJEs.js} +1 -1
  81. package/dist/client/assets/{decopilot-BItqS11w.js → decopilot-BxOK0Z8W.js} +1 -1
  82. package/dist/client/assets/{decopilot-sse-pool-CvYk1hkc.js → decopilot-sse-pool-Chmwc1_x.js} +1 -1
  83. package/dist/client/assets/{dialog-BAqFyO8a.js → dialog-o7scRbG9.js} +1 -1
  84. package/dist/client/assets/{domain-settings-r_E3rHsG.js → domain-settings-DIv14WFm.js} +1 -1
  85. package/dist/client/assets/{drawer-CFkqEC3w.js → drawer-B-Vy7tMY.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-C62KNjwK.js → dropdown-menu-D-VNET4I.js} +1 -1
  87. package/dist/client/assets/{empty-state-Sh_DuDcy.js → empty-state-1p_UpPHY.js} +1 -1
  88. package/dist/client/assets/{extract-connection-data-D6bQrejT.js → extract-connection-data-BVX9Eneo.js} +1 -1
  89. package/dist/client/assets/file-explorer-Bh9kp1sm.js +2 -0
  90. package/dist/client/assets/{file-type-icon-DPWxBpNL.js → file-type-icon-LHBbJJTG.js} +1 -1
  91. package/dist/client/assets/{files-B9ekmQa_.js → files-Bw3w16xX.js} +1 -1
  92. package/dist/client/assets/{form-DGE2mWLL.js → form-DX8cQ4SA.js} +1 -1
  93. package/dist/client/assets/{general-BMDKtyZB.js → general-DzJAxzRR.js} +1 -1
  94. package/dist/client/assets/{github-repo-picker-B5tZucJa.js → github-repo-picker-ZmfhFTO6.js} +1 -1
  95. package/dist/client/assets/{hooks-CUSV6Enf.js → hooks-BUt6AoQh.js} +6 -6
  96. package/dist/client/assets/{import-from-deco-dialog-M3CP3Gmn.js → import-from-deco-dialog-DZhtwoRn.js} +1 -1
  97. package/dist/client/assets/{index-Bb-tYGNK.js → index-BBTFoidO.js} +1 -1
  98. package/dist/client/assets/{index-CkTyYAY1.js → index-BPD9Iyv5.js} +1 -1
  99. package/dist/client/assets/index-BcXb7VeZ.css +1 -0
  100. package/dist/client/assets/index-CAV1BNai.js +173 -0
  101. package/dist/client/assets/{index-mEtg0zTM.js → index-CL3KBg-D.js} +1 -1
  102. package/dist/client/assets/{index-CFiyU0D9.js → index-CXy6rN6i.js} +3 -3
  103. package/dist/client/assets/{index-DGzNvPy2.js → index-CjKis1yy.js} +1 -1
  104. package/dist/client/assets/{index-jBUpmiBg.js → index-Cod7u1PQ.js} +1 -1
  105. package/dist/client/assets/{index-CRxAjd1d.js → index-CpgVJVWB.js} +27 -27
  106. package/dist/client/assets/{index-B6hcksS9.js → index-DCwPnlYH.js} +1 -1
  107. package/dist/client/assets/index-DKs6HTlj.js +1 -0
  108. package/dist/client/assets/{index-Dj7TxcSd.js → index-Db3cPjnW.js} +2 -2
  109. package/dist/client/assets/index-DvDkdoxH.js +1 -0
  110. package/dist/client/assets/{index-hmJjUPum.js → index-NJ9aYDVC.js} +1 -1
  111. package/dist/client/assets/{index-DIBoN36v.js → index-VkScKLdP.js} +1 -1
  112. package/dist/client/assets/{index-redirect-C9Kkmz45.js → index-redirect-B6MtHNAq.js} +1 -1
  113. package/dist/client/assets/{input-BwRH-Gsz.js → input-BlhkemhH.js} +1 -1
  114. package/dist/client/assets/{integration-icon-LQhkkaLl.js → integration-icon-BSHD1Ijr.js} +1 -1
  115. package/dist/client/assets/{label-CdBSUJpf.js → label-CL8Vh65B.js} +1 -1
  116. package/dist/client/assets/{login-d0UWtw9N.js → login-B4UwjrwL.js} +1 -1
  117. package/dist/client/assets/{mcp-oauth-IblqU9XT.js → mcp-oauth-CXj7zg3h.js} +1 -1
  118. package/dist/client/assets/{members-Bpdrl2e9.js → members-CZJJNFCT.js} +1 -1
  119. package/dist/client/assets/{monaco-editor-5JIc-lnc.js → monaco-editor-DBScTPL_.js} +2 -2
  120. package/dist/client/assets/{monitoring-stats-row-DPsQ-OAn.js → monitoring-stats-row-DS-oLjL7.js} +1 -1
  121. package/dist/client/assets/{oauth-callback-B1AvYYRn.js → oauth-callback-DmaJ1bda.js} +1 -1
  122. package/dist/client/assets/{oauth-callback-ai-provider-BtGHmjpp.js → oauth-callback-ai-provider-BQMnSXh3.js} +1 -1
  123. package/dist/client/assets/{onboarding-DfUmI7F5.js → onboarding-Byb6DxyK.js} +1 -1
  124. package/dist/client/assets/{org-install-CpJAFt1s.js → org-install-DE37K5KN.js} +1 -1
  125. package/dist/client/assets/{org-layout-BsuFzdH_.js → org-layout-des0Y5a9.js} +1 -1
  126. package/dist/client/assets/{organization-choice-DrxWffZp.js → organization-choice-COkZ5W_o.js} +1 -1
  127. package/dist/client/assets/{page-seo-form-BLqpZnj6.js → page-seo-form-BcrUATEU.js} +1 -1
  128. package/dist/client/assets/page-seo-sheet-D1Z6hzyV.js +1 -0
  129. package/dist/client/assets/popover-SD8gnUXm.js +1 -0
  130. package/dist/client/assets/post-editor-BDlfII0z.js +1 -0
  131. package/dist/client/assets/{primitives-BF1opf4F.js → primitives-CVsZF3ex.js} +1 -1
  132. package/dist/client/assets/{profile-C8meo3ry.js → profile-DBUkydtR.js} +1 -1
  133. package/dist/client/assets/project-app-view-Bk8oTYIF.js +1 -0
  134. package/dist/client/assets/record-editor-DL8IQ3xy.js +1 -0
  135. package/dist/client/assets/registry-Bd0JPSYO.js +2 -0
  136. package/dist/client/assets/{registry-layout-C4UMhzml.js → registry-layout-BL9jjFNp.js} +1 -1
  137. package/dist/client/assets/{require-capability--mIKExbX.js → require-capability-CLQ4GBGj.js} +1 -1
  138. package/dist/client/assets/{required-auth-layout-DDJmFi3U.js → required-auth-layout-BzYoSj-D.js} +1 -1
  139. package/dist/client/assets/{reset-password-CuNa1ife.js → reset-password-C3Zmx-Z-.js} +1 -1
  140. package/dist/client/assets/roles-RwbAlbhC.js +1 -0
  141. package/dist/client/assets/{scroll-area-BM-54tW1.js → scroll-area-DgIklajW.js} +54 -54
  142. package/dist/client/assets/{search-input-M7ubuBMG.js → search-input-BwHA7yOt.js} +1 -1
  143. package/dist/client/assets/{secrets-BN1JMG5V.js → secrets-Cu_Gp7gT.js} +1 -1
  144. package/dist/client/assets/{sections-editor-Buouhx1S.js → sections-editor-CaNl1tLu.js} +2 -2
  145. package/dist/client/assets/select-DM3pFFAV.js +1 -0
  146. package/dist/client/assets/{select-model-Cz9R_UN3.js → select-model-C1odlJ1X.js} +1 -1
  147. package/dist/client/assets/seo-editor-C28ZayGa.js +1 -0
  148. package/dist/client/assets/settings-layout-C_nc5y3_.js +1 -0
  149. package/dist/client/assets/{settings-section-MeT61nuY.js → settings-section-6b9w_VoZ.js} +1 -1
  150. package/dist/client/assets/{sheet-DyU03ddw.js → sheet-BJF6qruz.js} +1 -1
  151. package/dist/client/assets/shell-controls-C9tE75mS.js +1 -0
  152. package/dist/client/assets/{shell-layout-Nyz7GHu7.js → shell-layout-gi6XYvgE.js} +1 -1
  153. package/dist/client/assets/shell-route-loading-Agan4lHM.js +1 -0
  154. package/dist/client/assets/{sidebar-BNrafefE.js → sidebar-BD77ZDQ1.js} +1 -1
  155. package/dist/client/assets/{skeleton-B0I93PJP.js → skeleton-CuVDGSZE.js} +1 -1
  156. package/dist/client/assets/{sortable.esm-MymOIPKk.js → sortable.esm-DpWg8tde.js} +2 -2
  157. package/dist/client/assets/{sso-CfyYgWAs.js → sso-B9XBpXX9.js} +1 -1
  158. package/dist/client/assets/{store-T7GJ1SPI.js → store-Il1Qjdpz.js} +1 -1
  159. package/dist/client/assets/store-registry-BN4Ygwm2.js +2 -0
  160. package/dist/client/assets/{studio-tools-CNO5iCKk.js → studio-tools-C-Eel15b.js} +1 -1
  161. package/dist/client/assets/{switch-CCMIMmOF.js → switch-DWXEjjcR.js} +1 -1
  162. package/dist/client/assets/{tab-id-BptcWVWa.js → tab-id-AX1D_RMI.js} +1 -1
  163. package/dist/client/assets/{table-DeNuxLMl.js → table-sXVKQ5vt.js} +1 -1
  164. package/dist/client/assets/{tabs-Ca0vDJqc.js → tabs-BeXAqCdo.js} +1 -1
  165. package/dist/client/assets/{task-status-B3nPzwP7.js → task-status-CaQuE65s.js} +1 -1
  166. package/dist/client/assets/{textarea-BYT525JZ.js → textarea-C30KYfio.js} +1 -1
  167. package/dist/client/assets/{toggle-group-9TrYMc69.js → toggle-group-B6oTaI1f.js} +1 -1
  168. package/dist/client/assets/toolbar-DuZrnshW.js +1 -0
  169. package/dist/client/assets/toolbar-icon-button-CG8gWMNZ.js +1 -0
  170. package/dist/client/assets/{tools-list-uWC3Ij6C.js → tools-list-BSe55AC9.js} +1 -1
  171. package/dist/client/assets/tooltip-BRQCINXK.js +1 -0
  172. package/dist/client/assets/{types-C7syjwde.js → types-ywta9rZ4.js} +4 -4
  173. package/dist/client/assets/{use-ai-providers-C7KmiuqP.js → use-ai-providers-CpUPA2Pj.js} +1 -1
  174. package/dist/client/assets/{use-automations-RMjkwkxX.js → use-automations-BSn8_z4p.js} +1 -1
  175. package/dist/client/assets/{use-capability-C6Dwri-U.js → use-capability-AkUZCu97.js} +1 -1
  176. package/dist/client/assets/{use-clock-tick-BcxdOJLx.js → use-clock-tick-7J301cSN.js} +1 -1
  177. package/dist/client/assets/{use-collections-B4atckEK.js → use-collections-BhzLncHB.js} +1 -1
  178. package/dist/client/assets/{use-connection-Dz29RF9P.js → use-connection-CSQdDXlG.js} +1 -1
  179. package/dist/client/assets/{use-copy-Xy0buIqd.js → use-copy-3aLRhzTZ.js} +1 -1
  180. package/dist/client/assets/use-create-virtual-mcp-ClyuqzV0.js +1 -0
  181. package/dist/client/assets/{use-debounced-autosave-B4mbwJnu.js → use-debounced-autosave-DwyO4Yri.js} +1 -1
  182. package/dist/client/assets/{use-debounced-value-C6U3mliE.js → use-debounced-value-BGsbVLHA.js} +1 -1
  183. package/dist/client/assets/{use-decopilot-events-CpQNzv3e.js → use-decopilot-events-B8-U5_6h.js} +1 -1
  184. package/dist/client/assets/{use-delete-connection-CqeuxO_6.js → use-delete-connection-yP5RphYi.js} +1 -1
  185. package/dist/client/assets/{use-file-configs-CFCmr--W.js → use-file-configs-XF2AvMPs.js} +1 -1
  186. package/dist/client/assets/{use-infinite-scroll-BX1nHHVY.js → use-infinite-scroll-CkXtceVR.js} +1 -1
  187. package/dist/client/assets/{use-join-requests-j9WpmFq7.js → use-join-requests-mfteqXVe.js} +1 -1
  188. package/dist/client/assets/{use-mcp-client-xOK-OF8p.js → use-mcp-client-CRWIqSWI.js} +1 -1
  189. package/dist/client/assets/{use-mcp-prompts-Crr3H7P7.js → use-mcp-prompts-BV9cBymv.js} +1 -1
  190. package/dist/client/assets/{use-mcp-tools-C8tMWwG9.js → use-mcp-tools-Dgj65Z69.js} +1 -1
  191. package/dist/client/assets/{use-members-BMNjJExY.js → use-members-BZOJ4ncQ.js} +1 -1
  192. package/dist/client/assets/{use-mobile-NlF-3RoP.js → use-mobile-DgvzRDzB.js} +1 -1
  193. package/dist/client/assets/{use-navigate-to-agent-DZubxUSm.js → use-navigate-to-agent-DTqeD3lq.js} +1 -1
  194. package/dist/client/assets/{use-org-auth-client-C_UJ3Vg_.js → use-org-auth-client-Dx974y4u.js} +1 -1
  195. package/dist/client/assets/{use-org-fs-DyK8omii.js → use-org-fs-DI1Q1Ycz.js} +1 -1
  196. package/dist/client/assets/{use-org-sso-DkqH8Zpz.js → use-org-sso-kfQLtl8D.js} +1 -1
  197. package/dist/client/assets/{use-organization-roles-Cu69Rnex.js → use-organization-roles-B2GmBYYT.js} +1 -1
  198. package/dist/client/assets/{use-organization-settings-DksiQdGc.js → use-organization-settings-ClL7mSbK.js} +1 -1
  199. package/dist/client/assets/{use-registry-connections-BOZLpkM5.js → use-registry-connections-DzyhBLO8.js} +1 -1
  200. package/dist/client/assets/{use-secrets-CLmhH-Rb.js → use-secrets-BX0N_3N-.js} +1 -1
  201. package/dist/client/assets/{use-status-sounds-DxV7deix.js → use-status-sounds-BsVH7G2F.js} +1 -1
  202. package/dist/client/assets/{use-view-mode-C2dllj6L.js → use-view-mode-D4v-Vh_n.js} +1 -1
  203. package/dist/client/assets/{use-virtual-mcp-2U_MnYnK.js → use-virtual-mcp-7AWl-thI.js} +1 -1
  204. package/dist/client/assets/useInfiniteQuery-DbI8AV-k.js +1 -0
  205. package/dist/client/assets/useSuspenseInfiniteQuery-DT-JxV4F.js +1 -0
  206. package/dist/client/assets/{useSuspenseQueries-Cysvk68n.js → useSuspenseQueries-D4Gfj0Tf.js} +1 -1
  207. package/dist/client/assets/variant-calendar-C9mxKuI5.js +1 -0
  208. package/dist/client/assets/{view-mode-toggle-4CQodGfa.js → view-mode-toggle-Dcs21C2T.js} +1 -1
  209. package/dist/client/index.html +2 -2
  210. package/dist/server/cli.js +11 -2
  211. package/dist/server/server.js +1 -1
  212. package/package.json +1 -1
  213. package/dist/client/assets/ChevronLeft-dyRjFCmp.js +0 -1
  214. package/dist/client/assets/agent-icon-oDx9Z_Be.js +0 -1
  215. package/dist/client/assets/agents-list-BgSM_QG_.js +0 -1
  216. package/dist/client/assets/app-editor-Xoia35dq.js +0 -1
  217. package/dist/client/assets/automation-runs-B-dNDEWH.js +0 -1
  218. package/dist/client/assets/automations-D395202A.js +0 -1
  219. package/dist/client/assets/bulk-category-panel-CM1bMunr.js +0 -1
  220. package/dist/client/assets/category-editor-2T4Y_ABL.js +0 -1
  221. package/dist/client/assets/collection-detail-BQKV3UU7.js +0 -1
  222. package/dist/client/assets/commerce-onboarding-D2H83R0U.js +0 -1
  223. package/dist/client/assets/connection-detail-gJ5ITUXe.js +0 -1
  224. package/dist/client/assets/connections-CicrEJbU.js +0 -1
  225. package/dist/client/assets/file-explorer-C8pgfKCz.js +0 -2
  226. package/dist/client/assets/index-B2yJy2sB.js +0 -1
  227. package/dist/client/assets/index-BqKQnks_.css +0 -1
  228. package/dist/client/assets/index-DQnTjiix.js +0 -1
  229. package/dist/client/assets/index-D_S_Rq8A.js +0 -169
  230. package/dist/client/assets/page-seo-sheet-C7jjKuEW.js +0 -1
  231. package/dist/client/assets/popover-BXFiEQtN.js +0 -1
  232. package/dist/client/assets/post-editor-Tve7DmSa.js +0 -1
  233. package/dist/client/assets/preview-dialog-CQgf0QcR.js +0 -5
  234. package/dist/client/assets/project-app-view-BR2-hR46.js +0 -1
  235. package/dist/client/assets/record-editor-DbXO7U7E.js +0 -1
  236. package/dist/client/assets/registry-jjhvqeDq.js +0 -2
  237. package/dist/client/assets/roles-BMhGnq_F.js +0 -1
  238. package/dist/client/assets/select-C6v8Xcth.js +0 -1
  239. package/dist/client/assets/seo-editor-D9o3utSQ.js +0 -1
  240. package/dist/client/assets/settings-layout-CSaUQUXv.js +0 -1
  241. package/dist/client/assets/shell-controls-DtGb6E4l.js +0 -1
  242. package/dist/client/assets/shell-route-loading-BRcTX0VT.js +0 -1
  243. package/dist/client/assets/store-registry-B-YJeGRV.js +0 -2
  244. package/dist/client/assets/toolbar-p8VcpV1N.js +0 -1
  245. package/dist/client/assets/tooltip-DrpiSbRG.js +0 -1
  246. package/dist/client/assets/use-create-virtual-mcp-DVmI--_C.js +0 -1
  247. package/dist/client/assets/useInfiniteQuery-RUqqRph1.js +0 -1
  248. package/dist/client/assets/useSuspenseInfiniteQuery-fRYRtDkY.js +0 -1
  249. package/dist/client/assets/variant-calendar-mZn_D1Zo.js +0 -1
@@ -1 +1 @@
1
- import{c as X,D as H,m as U,r as W,K as J,k as ee,d as Z,v as te,t as p,j as i,B as $}from"./index-CFiyU0D9.js";import{u as ie}from"./studio-tools-CNO5iCKk.js";import{b as se,S as ne,a as oe}from"./settings-section-MeT61nuY.js";import{B as Q}from"./badge-DhpSM7g_.js";import{I as ae}from"./input-BwRH-Gsz.js";import{d as re,b as le,c as ce,S as de,a as me}from"./select-C6v8Xcth.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 v;e[10]!==s?(v=o=>s.call("ORGANIZATION_DOMAIN_ADD",{domain:o}),e[10]=s,e[11]=v):v=e[11];let N;e[12]!==n||e[13]!==t.id?(N=()=>{te("organization_domain_added",{organization_id:t.id}),x(""),n(),p.success("Domain added")},e[12]=n,e[13]=t.id,e[14]=N):N=e[14];let P;e[15]!==v||e[16]!==N?(P={mutationFn:v,onSuccess:N,onError:je},e[15]=v,e[16]=N,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 D;e[27]!==n?(D=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]=D):D=e[28];let V;e[29]!==_||e[30]!==D?(V={mutationFn:_,onSuccess:D,onError:he},e[29]=_,e[30]=D,e[31]=V):V=e[31];const A=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]!==A){let o;e[46]!==E||e[47]!==F||e[48]!==A?(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:()=>A.mutate(a.id),disabled:A.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(ve,{recordName:a.recordName,recordValue:a.recordValue})},a.id)},e[46]=E,e[47]=F,e[48]=A,e[49]=o):o=e[49],O=K.map(o),e[41]=K,e[42]=E,e[43]=F,e[44]=A,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 ve(e){const t=X.c(16),{recordName:u,recordValue:s}=e,l=Ne;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 Ne(e){navigator.clipboard?.writeText(e),p.success("Copied")}export{be as D};
1
+ import{c as X,D as H,m as U,r as W,K as J,k as ee,d as Z,v as te,t as p,j as i,B as $}from"./index-CXy6rN6i.js";import{u as ie}from"./studio-tools-C-Eel15b.js";import{b as se,S as ne,a as oe}from"./settings-section-6b9w_VoZ.js";import{B as Q}from"./badge-B1dPfLuK.js";import{I as ae}from"./input-BlhkemhH.js";import{S as re,a as le,b as ce,c as de,d as me}from"./select-DM3pFFAV.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 v;e[10]!==s?(v=o=>s.call("ORGANIZATION_DOMAIN_ADD",{domain:o}),e[10]=s,e[11]=v):v=e[11];let N;e[12]!==n||e[13]!==t.id?(N=()=>{te("organization_domain_added",{organization_id:t.id}),x(""),n(),p.success("Domain added")},e[12]=n,e[13]=t.id,e[14]=N):N=e[14];let P;e[15]!==v||e[16]!==N?(P={mutationFn:v,onSuccess:N,onError:je},e[15]=v,e[16]=N,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 D;e[27]!==n?(D=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]=D):D=e[28];let V;e[29]!==_||e[30]!==D?(V={mutationFn:_,onSuccess:D,onError:he},e[29]=_,e[30]=D,e[31]=V):V=e[31];const A=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]!==A){let o;e[46]!==E||e[47]!==F||e[48]!==A?(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:()=>A.mutate(a.id),disabled:A.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(ve,{recordName:a.recordName,recordValue:a.recordValue})},a.id)},e[46]=E,e[47]=F,e[48]=A,e[49]=o):o=e[49],O=K.map(o),e[41]=K,e[42]=E,e[43]=F,e[44]=A,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 ve(e){const t=X.c(16),{recordName:u,recordValue:s}=e,l=Ne;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 Ne(e){navigator.clipboard?.writeText(e),p.success("Copied")}export{be as D};
@@ -1 +1 @@
1
- import{c as d,j as s,cv as i,l as c}from"./index-CFiyU0D9.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};
1
+ import{c as d,j as s,cu as i,l as c}from"./index-CXy6rN6i.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};
@@ -1 +1 @@
1
- import{c,j as d,dZ as f,d_ as m,l as u,d$ as g,e0 as x,e1 as v,e2 as b,e3 as h,e4 as w,e5 as j,e6 as N,e7 as z,e8 as _,e9 as y,ea as p}from"./index-CFiyU0D9.js";import{i as $}from"./ChevronUp-DBpw6M-L.js";import{i as D}from"./ChevronRight-Cpfh3gza.js";import{a as M}from"./DotsVertical-5jSu3d1f.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 Z(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 q(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 A(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 B(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 F(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,A as d,B as e,F as f,q as g,Z as h,P as i,O as j,L as k};
1
+ import{c,j as d,dY as f,dZ as m,l as u,d_ as g,d$ as x,e0 as v,e1 as b,e2 as h,e3 as w,e4 as j,e5 as N,e6 as z,e7 as _,e8 as y,e9 as p}from"./index-CXy6rN6i.js";import{i as $}from"./ChevronUp-DSdWQUoR.js";import{i as D}from"./ChevronRight-BswIt99A.js";import{a as M}from"./DotsVertical-DSosYpI1.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 Y(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 Z(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 q(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 A(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 B(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,q as d,A as e,B as f,Z as g,Y as h,P as i,O as j,L as k};
@@ -1 +1 @@
1
- import{c as v,l as N,j as t}from"./index-CFiyU0D9.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-CXy6rN6i.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-CFiyU0D9.js";import{W as T,e as O}from"./use-mcp-client-xOK-OF8p.js";function x(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 U(e){const t=x(e);if(!t)return null;const n=`https://github.com/${t.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(n)}&output=webp`}function H(e,t){return e===T.REGISTRY(t)||e===T.COMMUNITY_REGISTRY(t)}function q(e,t){return H(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 L={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function Y(e){return e?L[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)}}const D="mcp.mesh";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?.[D],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||U(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=Y(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{j as a,K as b,Q as c,J as d,X as e,B as f,U as g,q as i};
1
+ import"./index-CXy6rN6i.js";import{W as T,e as O}from"./use-mcp-client-CRWIqSWI.js";function x(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 U(e){const t=x(e);if(!t)return null;const n=`https://github.com/${t.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(n)}&output=webp`}function H(e,t){return e===T.REGISTRY(t)||e===T.COMMUNITY_REGISTRY(t)}function q(e,t){return H(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 L={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function Y(e){return e?L[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)}}const D="mcp.mesh";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?.[D],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||U(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=Y(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{j as a,K as b,Q as c,J as d,X as e,B as f,U 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,m as ut,t as $,K as Te}from"./index-CXy6rN6i.js";import{F as mt,l as pt}from"./index-DCwPnlYH.js";import{i as ht,aA as xt,aB as gt,aC as ae,aD as yt,Y as $e}from"./agent-icon-BjxA8YR3.js";import{a as wt}from"./Tool01-Ci5EQ1tM.js";import{s as jt}from"./XClose-BpreRuFP.js";import{S as bt}from"./scroll-area-DgIklajW.js";import{T as Re,a as Oe,b as ze}from"./tooltip-BRQCINXK.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-DMWXmTGp.js";import{u as Et}from"./chat-context-huSCeR82.js";import{b as Pt}from"./shell-layout-gi6XYvgE.js";import{am as le,an as Ae,ao as Tt}from"./index-CpgVJVWB.js";import{a as $t,b as Rt,c as Ot,D as zt,d as At,e as Wt}from"./dialog-o7scRbG9.js";import{I as We}from"./input-BlhkemhH.js";import{b as It,C as _,a as Ie,c as Mt,d as Kt}from"./context-menu-BPHfkJEs.js";import{t as Vt}from"./ChevronDown-DGuR7uUZ.js";import{i as Bt}from"./ChevronRight-BswIt99A.js";import{a as Gt}from"./ZoomOut-C0bVPfpC.js";import{E as qt,m as Me,n as he,o as Qt,p as Ut,q as Ht,t as M,r as ce,g as xe,s as ge,u as Jt,v as Yt,w as ye,x as de,y as we,z as Xt,A as Zt}from"./index-CAV1BNai.js";import"./AlertCircle-CM6D9elR.js";import"./SwitchHorizontal01-BL4xnvxO.js";import"./Settings02-QyYEyYyn.js";import"./XCircle-CmN6DNsv.js";import"./ArrowUpRight-Kqa5fEjt.js";import"./ZapSquare-D5x1wm0t.js";import"./Users03-BazvU-rC.js";import"./CheckCircle-8DKF8Yx5.js";import"./ChevronUp-DSdWQUoR.js";import"./DotsVertical-DSosYpI1.js";import"./Stars02-DVZm69DV.js";import"./Eye-Dn1AISrx.js";import"./Globe01-CcXDI4W7.js";import"./FilterLines-CmWI-8pG.js";import"./Star01-GVe4t6O1.js";import"./Globe04-B9Btoycr.js";import"./HardDrive-BqXWgcmp.js";import"./Key01-F6-x7vNY.js";import"./LayoutLeft-DpqtgcH3.js";import"./LinkExternal01-DOU6-C1w.js";import"./Monitor01-SkSQUhmT.js";import"./Sun-B2ndPBZP.js";import"./Palette-CnoObDqZ.js";import"./Play-DzGcMRv3.js";import"./Plus-DDlkoJBs.js";import"./SearchLg-CdT_y89m.js";import"./SearchMd-UY2xUREv.js";import"./Shield01-V8b5EFFL.js";import"./Stars01-BIVPeWqS.js";import"./Trash01-Cc007jho.js";import"./Upload01-DB9meUjO.js";import"./User01-Dz-_mMMJ.js";import"./Users01-Ctg0iuAM.js";import"./X-_dGiBqSn.js";import"./Zap-CWxLsQ6b.js";import"./use-clock-tick-7J301cSN.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-3aLRhzTZ.js";import"./file-type-icon-LHBbJJTG.js";import"./use-mobile-DgvzRDzB.js";import"./tab-id-AX1D_RMI.js";import"./content-blocks-o63cs2vh.js";import"./types-ywta9rZ4.js";import"./use-mcp-client-CRWIqSWI.js";import"./auth-DraSXrC6.js";import"./hooks-BUt6AoQh.js";import"./decopilot-sse-pool-Chmwc1_x.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-C-Eel15b.js";import"./sheet-BJF6qruz.js";import"./integration-icon-BSHD1Ijr.js";import"./use-virtual-mcp-7AWl-thI.js";import"./use-collections-BhzLncHB.js";import"./use-navigate-to-agent-DTqeD3lq.js";import"./use-connection-CSQdDXlG.js";import"./use-mcp-prompts-BV9cBymv.js";import"./form-DX8cQ4SA.js";import"./label-CL8Vh65B.js";import"./select-DM3pFFAV.js";import"./use-ai-providers-CpUPA2Pj.js";import"./use-decopilot-events-B8-U5_6h.js";import"./use-organization-settings-ClL7mSbK.js";import"./avatar-COMRxqae.js";import"./required-auth-layout-BzYoSj-D.js";import"./use-org-sso-kfQLtl8D.js";import"./index-CL3KBg-D.js";import"./drawer-B-Vy7tMY.js";import"./collection-search-CKMDHnku.js";import"./tabs-BeXAqCdo.js";import"./toggle-group-B6oTaI1f.js";import"./sortable.esm-DpWg8tde.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DIh-SIqT.js";import"./use-registry-connections-DzyhBLO8.js";import"./useInfiniteQuery-DbI8AV-k.js";import"./use-infinite-scroll-CkXtceVR.js";import"./extract-connection-data-BVX9Eneo.js";import"./card-Bys-wDTW.js";import"./collection-tabs-CWrBkWhe.js";import"./badge-B1dPfLuK.js";import"./textarea-C30KYfio.js";import"./connection-form-helpers-DV-bwjt7.js";import"./authenticate-and-persist-oauth-HBteAcVm.js";import"./mcp-oauth-CXj7zg3h.js";import"./useSuspenseInfiniteQuery-DT-JxV4F.js";import"./connect-desktop-dialog-CvuFk-NY.js";import"./decopilot-BxOK0Z8W.js";import"./checkbox-BIDlFz_0.js";import"./skeleton-CuVDGSZE.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-6b9w_VoZ.js";import"./popover-SD8gnUXm.js";import"./command-DrgMAh0a.js";import"./index-Cod7u1PQ.js";import"./use-org-fs-DI1Q1Ycz.js";import"./dropdown-menu-D-VNET4I.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-Agan4lHM.js";import"./task-status-CaQuE65s.js";import"./use-status-sounds-BsVH7G2F.js";import"./empty-state-1p_UpPHY.js";import"./toolbar-DuZrnshW.js";import"./toolbar-icon-button-CG8gWMNZ.js";import"./use-mcp-tools-Dgj65Z69.js";import"./use-capability-AkUZCu97.js";import"./tools-list-BSe55AC9.js";import"./switch-DWXEjjcR.js";import"./use-debounced-autosave-DwyO4Yri.js";import"./index-BBTFoidO.js";import"./sidebar-BD77ZDQ1.js";import"./search-input-BwHA7yOt.js";import"./github-repo-picker-ZmfhFTO6.js";import"./use-debounced-value-BGsbVLHA.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-BX0N_3N-.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./automation-runs-BoQeZ1gh.js";import"./table-sXVKQ5vt.js";import"./use-members-BZOJ4ncQ.js";import"./use-org-auth-client-Dx974y4u.js";import"./use-automations-BSn8_z4p.js";import"./use-file-configs-XF2AvMPs.js";import"./monaco-editor-DBScTPL_.js";import"./select-model-C1odlJ1X.js";import"./automation-list-row-NZNZGrlr.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:Y,parentLabel:Q,isPending:A,onSubmit:V,onOpenChange:P}=y,W=Y===void 0?"":Y,o=A===void 0?!1:A,[p,R]=l.useState(W),[I,B]=l.useState(c),f=_t[K];c!==I&&(B(c),c&&R(W));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(Rt,{children:f.description}),e[9]=f.description,e[10]=N):N=e[10];let O;e[11]!==L||e[12]!==N?(O=i.jsxs(Ot,{children:[L,N]}),e[11]=L,e[12]=N,e[13]=O):O=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(We,{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=>R(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(We,{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]!==O?(g=i.jsx(At,{className:"sm:max-w-md",children:i.jsxs("form",{onSubmit:q,children:[O,h,m]})}),e[42]=q,e[43]=h,e[44]=m,e[45]=O,e[46]=g):g=e[46];let T;return e[47]!==U||e[48]!==c||e[49]!==g?(T=i.jsx(Wt,{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:Y,isSelected:Q,isLoading:A,fileVisual:V,onOpen:P,onSelect:W,onNewFile:o,onNewFolder:p,onCopyPath:R,onCopyRelativePath:I,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 O=`${K*14+8}px`;let S;e[2]!==O?(S={paddingLeft:O},e[2]=O,e[3]=S):S=e[3];let D;e[4]!==P||e[5]!==W?(D=()=>{W(),P()},e[4]=P,e[5]=W,e[6]=D):D=e[6];let j;e[7]!==G||e[8]!==q||e[9]!==U||e[10]!==Y||e[11]!==F?(j=U?i.jsxs(i.Fragment,{children:[F?i.jsx(re,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):Y?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]=Y,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(It,{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(Ie,{}),e[25]=C):C=e[25];let u;e[26]!==R?(u=i.jsx(_,{onSelect:R,children:"Copy Path"}),e[26]=R,e[27]=u):u=e[27];let k;e[28]!==I?(k=i.jsx(_,{onSelect:I,children:"Copy Relative Path"}),e[28]=I,e[29]=k):k=e[29];let m;e[30]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(Ie,{}),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 Bi({orgSlug:y,virtualMcpId:e,branch:c,openPath:K}){const[Y,Q]=l.useState({files:[],directories:[],truncated:!1}),{files:A,directories:V}=Y,[P,W]=l.useState(new Set),[o,p]=l.useState(null),[R,I]=l.useState(null),[B,f]=l.useState([]),[F,U]=l.useState(""),[G,q]=l.useState(!1),[L,N]=l.useState(!1),[,O]=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){O(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,H]=l.useState(null),[J,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=Xt(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}),I(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);I(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(),H(null),me(n)}async function He(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(),H(null),W(s=>{const a=new Set(s);for(const d of he(n))a.add(d);return a.add(n),a}),I({name:t,path:n,kind:"directory",children:[]})}async function Je(t){if(!w)return;const n=w.node.path,r=ye(n),s=de(r,t);if(s===n){H(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(),H(null)}async function Ye(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 Xe(t){const n=Yt(t);if(n){$.error(n);return}ie(!0);try{w?.mode==="new-file"?(await Ue(t),$.success(`Created "${t}"`)):w?.mode==="new-folder"?(await He(t),$.success(`Created folder "${t}"`)):w?.mode==="rename"&&(await Je(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(X=>{const oe=new Set(X);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),W(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=Jt(s.content??"");u(d=>{const X=new Map(d);return X.set(t,{savedContent:a,editorValue:a,loaded:!0}),X})}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),I({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){W(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);W(r=>{const s=new Set(r);for(const a of n)s.add(a);return s}),rt(t)}function at(){return R?.kind==="directory"?R.path:R?.kind==="file"?ye(R.path):o?ye(o):"/"}function Le(t){const n=at();H({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=J?qe(J.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(Re,{children:[i.jsx(Oe,{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(Re,{children:[i.jsx(Oe,{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=R?.path===n.path,X=Ht(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:()=>I(n),onOpen:()=>{s?ot(n.path,a):me(n.path)},onNewFile:()=>H({mode:"new-file",node:n,parentDir:X}),onNewFolder:()=>H({mode:"new-folder",node:n,parentDir:X}),onCopyPath:()=>be("Path",ce(n.path)),onCopyRelativePath:()=>be("Relative path",M(n.path)),onRename:()=>H({mode:"rename",node:n,parentDir:X}),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:Xe,onOpenChange:t=>{!t&&!ee&&H(null)}}),i.jsx(vt,{open:J!==null,onOpenChange:t=>{!t&&!ee&&ue(null)},children:i.jsxs(Ct,{children:[i.jsxs(Nt,{children:[i.jsxs(St,{children:["Delete ",J?.kind==="directory"?"folder":"file","?"]}),i.jsxs(Dt,{children:["This will permanently delete"," ",i.jsx("span",{className:"font-mono",children:J?.name}),J?.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||!J,onClick:t=>{t.preventDefault(),J&&Ye(J)},children:"Delete"})]})]})})]})}export{Bi as FileExplorer};
@@ -1,4 +1,4 @@
1
- import{bB as zl,j as q,ah as lt,bT as zn,r as Ve,bU as b0,l as Gb,c as Ke,b as E0,e as T0,B as $b}from"./index-CFiyU0D9.js";import{i as zb}from"./ChevronUp-DBpw6M-L.js";import{a as jb}from"./Eye-bojNLUjA.js";import{e as S0,g as y0,h as A0,a as _0}from"./dialog-BAqFyO8a.js";import{n as I0}from"./Globe01-CyfpzbeQ.js";import{j as k0,n as R0}from"./ZoomOut-6ix2H92j.js";import{u as N0}from"./use-mobile-NlF-3RoP.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{bz as zl,j as q,af as lt,bS as zn,r as Ve,bT as b0,l as Gb,c as Ke,b as E0,e as T0,B as $b}from"./index-CXy6rN6i.js";import{i as zb}from"./ChevronUp-DSdWQUoR.js";import{a as jb}from"./Eye-Dn1AISrx.js";import{e as S0,g as y0,h as A0,a as _0}from"./dialog-o7scRbG9.js";import{n as I0}from"./Globe01-CcXDI4W7.js";import{j as k0,n as R0}from"./ZoomOut-C0bVPfpC.js";import{u as N0}from"./use-mobile-DgvzRDzB.js";import{g as C0}from"./tab-id-AX1D_RMI.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{c as a,e as o,j as i,N as l}from"./index-CFiyU0D9.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-CXy6rN6i.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{cH as C,c as f,j as c,af as j,r as d,l as p,bh as b,cI as h,cJ as v}from"./index-CFiyU0D9.js";import{L as N}from"./label-CdBSUJpf.js";const E=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}=h();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=v(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,E as a,w as b,L as c,P as d,R as e,y as f};
1
+ import{cG as C,c as f,j as c,ad as j,r as d,l as p,bf as b,cH as v,cI as h}from"./index-CXy6rN6i.js";import{L as N}from"./label-CL8Vh65B.js";const E=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,E as a,w as b,L as c,P as d,R as e,y as f};
@@ -1 +1 @@
1
- import{b as M,D as $,m as U,p as Q,n as Y,d as q,v as P,t as D,K as L,j as n,af as I,o as Z,s as k,c as E,r as T,B as H,L as B,y as J}from"./index-CFiyU0D9.js";import{P as N}from"./index-Bb-tYGNK.js";import{u as W}from"./use-org-auth-client-C_UJ3Vg_.js";import{u as X}from"./use-debounced-autosave-B4mbwJnu.js";import{A as ee}from"./avatar-CJP1BOq4.js";import{I as V}from"./input-BwRH-Gsz.js";import{S as K,a as G,b as A,c as te}from"./settings-section-MeT61nuY.js";import{D as ne}from"./domain-settings-r_E3rHsG.js";import{u as ae}from"./studio-tools-CNO5iCKk.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-CYizItFp.js";import{R as me}from"./require-capability--mIKExbX.js";import"./sidebar-BNrafefE.js";import"./LayoutLeft-fsm0LcB8.js";import"./use-mobile-NlF-3RoP.js";import"./sheet-DyU03ddw.js";import"./X-DrMVHLcw.js";import"./tooltip-DrpiSbRG.js";import"./User01-COQtf360.js";import"./card-BFb5m83e.js";import"./ArrowUpRight-OJZisFPQ.js";import"./badge-DhpSM7g_.js";import"./select-C6v8Xcth.js";import"./ChevronUp-DBpw6M-L.js";import"./ChevronDown-DyHvxYlc.js";import"./use-capability-C6Dwri-U.js";import"./access-gate-D6dGDGRI.js";import"./capability-load-error-CCgNL5xi.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){D.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 D.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:L.organizations()}),h.invalidateQueries({queryKey:L.activeOrganization(t.slug)}),D.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)}),D.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(I,{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(I,{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(),D.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 w;e[26]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(re,{children:"Cancel"}),e[26]=w):w=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:[w,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){D.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
+ import{b as M,D as $,m as U,p as Q,n as Y,d as q,v as P,t as D,K as L,j as n,ad as I,o as Z,s as k,c as E,r as T,B as H,L as B,y as J}from"./index-CXy6rN6i.js";import{P as N}from"./index-BBTFoidO.js";import{u as W}from"./use-org-auth-client-Dx974y4u.js";import{u as X}from"./use-debounced-autosave-DwyO4Yri.js";import{A as ee}from"./avatar-COMRxqae.js";import{I as V}from"./input-BlhkemhH.js";import{S as K,a as G,b as A,c as te}from"./settings-section-6b9w_VoZ.js";import{D as ne}from"./domain-settings-DIv14WFm.js";import{u as ae}from"./studio-tools-C-Eel15b.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-DMWXmTGp.js";import{R as me}from"./require-capability-CLQ4GBGj.js";import"./sidebar-BD77ZDQ1.js";import"./LayoutLeft-DpqtgcH3.js";import"./use-mobile-DgvzRDzB.js";import"./sheet-BJF6qruz.js";import"./X-_dGiBqSn.js";import"./tooltip-BRQCINXK.js";import"./User01-Dz-_mMMJ.js";import"./card-Bys-wDTW.js";import"./ArrowUpRight-Kqa5fEjt.js";import"./badge-B1dPfLuK.js";import"./select-DM3pFFAV.js";import"./ChevronUp-DSdWQUoR.js";import"./ChevronDown-DGuR7uUZ.js";import"./use-capability-AkUZCu97.js";import"./access-gate-CpQ3bOMg.js";import"./capability-load-error-WTr85D-I.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){D.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 D.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:L.organizations()}),h.invalidateQueries({queryKey:L.activeOrganization(t.slug)}),D.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)}),D.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(I,{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(I,{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(),D.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 w;e[26]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(re,{children:"Cancel"}),e[26]=w):w=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:[w,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){D.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{c as $,j as t,D as Q,a as te,m as W,r as G,a7 as B,i as U,d as ne,t as z,K as V,k as se,l as K,q as oe,ag as re}from"./index-CFiyU0D9.js";import{c as ie,a as ae,d as le,e as ce}from"./dialog-BAqFyO8a.js";import{C as J}from"./checkbox-DmOzmKLP.js";import{C as ue}from"./collection-search-8iNXnGlM.js";import{u as de}from"./use-debounced-value-C6U3mliE.js";import{b as me,u as fe}from"./use-connection-Dz29RF9P.js";import{W as pe,u as H,S as X}from"./use-mcp-client-xOK-OF8p.js";import{b as Z}from"./Settings02-BcAnTzm5.js";import{w as ge}from"./agent-icon-oDx9Z_Be.js";import{a as xe}from"./authenticate-and-persist-oauth-DoPUB_Bh.js";import{u as he}from"./use-mcp-tools-C8tMWwG9.js";import{e as ye}from"./extract-connection-data-D6bQrejT.js";import{m as be}from"./use-navigate-to-agent-DZubxUSm.js";import{f as we}from"./github-installations-DzN1UQ4x.js";function M(s){const e=$.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 l;return e[1]!==o||e[2]!==n?(l=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]=l):l=e[3],l}function Ne(s,e){const n=$.c(12),{org:o}=Q();let u;n[0]!==o.id?(u=pe.REGISTRY(o.id),n[0]=o.id,n[1]=u):u=n[1];const l=u;let i;n[2]!==o.id||n[3]!==o.slug||n[4]!==l?(i={connectionId:l,orgId:o.id,orgSlug:o.slug},n[2]=o.id,n[3]=o.slug,n[4]=l,n[5]=i):i=n[5];const x=H(i);let m;n[6]!==s?(m={name:s},n[6]=s,n[7]=m):m=n[7];const r=e?.enabled??!0;let h;return n[8]!==x||n[9]!==m||n[10]!==r?(h={client:x,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:m,enabled:r,staleTime:3e5,select:je},n[8]=x,n[9]=m,n[10]=r,n[11]=h):h=n[11],he(h)}function je(s){return s.structuredContent?.item??null}const Ie="deco/mcp-github";function Ce(s){const{org:e}=Q(),{data:n}=te.useSession(),o=me(),u=W(),[l,i]=G.useState("idle"),[x,m]=G.useState(null),[r,h]=G.useState(null),{data:g,isLoading:a}=Ne(Ie,{enabled:s.enabled}),w=G.useRef(!1);s.enabled&&g&&!a&&!w.current&&n?.user?.id&&l==="idle"&&(w.current=!0,b());async function b(){if(!(!g||!n?.user?.id||!e))try{i("installing"),m(null);const y=ye(g,e.id,n.user.id,{remoteIndex:0});if(!y.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:I}=await o.create.mutateAsync(y);i("authenticating");const f=await xe({connectionId:I,orgId:e.id,orgSlug:e.slug,persistFallback:d=>o.update.mutateAsync({id:I,data:{connection_token:d}}).then(()=>{})});if(f.ran&&!f.ok){try{await o.delete.mutateAsync(I)}catch{}throw new Error(f.error&&f.error!=="no token received"?f.error:"No token received from GitHub")}B(u,e.id),h(y),i("ready")}catch(y){m(y instanceof Error?y.message:String(y)),i("error")}}function N(){i("idle"),m(null),h(null),w.current=!1}return s.enabled&&a&&l==="idle"?{status:"installing",error:null,connection:null,retry:N}:{status:l,error:x,connection:r,retry:N}}const F={contents:"write",metadata:"read",pull_requests:"write",issues:"write"};function Se(s){if(!s||typeof s!="object"||Array.isArray(s))return F;const e=s;return Object.values(e).some(n=>typeof n!="string")?F:e}function ve(s){if(!(typeof s!="number"||!Number.isFinite(s)||!Number.isInteger(s)||s<=0))return s}function Ee(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=ve(e.repositoryId);return{sourceConnectionId:typeof e.sourceConnectionId=="string"?e.sourceConnectionId:void 0,installationId:e.installationId,repositoryId:n,owner:e.owner,repo:e.repo,permissions:Se(e.permissions),grantProvider:e.grantProvider==="github-mcp"?"github-mcp":void 0}}function Te(s){return(s??[]).filter(e=>Ee(e)===null)}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 ke(s){try{const e=new URL(s);return(e.protocol==="http:"||e.protocol==="https:")&&!e.username&&!e.password}catch{return!1}}function _e(s){return typeof s=="number"&&Number.isFinite(s)&&Number.isInteger(s)&&s>0?s:void 0}async function Ae(s){const{orgSlug:e,sourceConnection:n,installationId:o,owner:u,repo:l,githubCallTool:i,selfCallTool:x}=s,m=await i({name:"MINT_REPO_TOKEN",arguments:{installationId:o,owner:u,repo:l,permissions:F}}),r=m.structuredContent;if(m.isError||!r?.token){const T=m.content?.find(v=>v.type==="text")?.text;throw new Error(T?`Failed to mint a repo-scoped GitHub token: ${T}`:"Failed to mint a repo-scoped GitHub token")}const h=L(r.refreshToken),g=L(r.tokenEndpoint),a=L(r.clientId);if(!h||!g||!a)throw new Error(Y);if(!ke(g))throw new Error(Y);const w=L(r.repository?.owner),b=L(r.repository?.name),N="GitHub MCP returned refresh metadata for a different repository";if(r.repository?.owner!==void 0&&(!w||w.toLowerCase()!==u.toLowerCase()))throw new Error(N);if(r.repository?.name!==void 0&&(!b||b.toLowerCase()!==l.toLowerCase()))throw new Error(N);const y=_e(r.repository?.id),j=r.expiresAt?Date.parse(r.expiresAt):NaN,I=Number.isFinite(j)?Math.max(0,Math.floor((j-Date.now())/1e3)):null,d=(typeof r.expiresIn=="number"&&Number.isFinite(r.expiresIn)&&Number.isInteger(r.expiresIn)&&r.expiresIn>0?r.expiresIn:null)??I,C=await x({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:{title:`GitHub: ${u}/${l}`,description:`Repo-scoped GitHub access for ${u}/${l}`,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:y,owner:u,repo:l,permissions:F,grantProvider:"github-mcp"}}}}}),p=C.structuredContent??C,S=p.item?.id??p.id;if(!S)throw new Error("Failed to create the repo-scoped GitHub connection");if(!(await fetch(`/api/${e}/connections/${S}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:r.token,refreshToken:h,expiresIn:d,scope:r.scope??null,clientId:a,tokenEndpoint:g})})).ok)throw await x({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:S,force:!0}}).catch(()=>{}),new Error("Failed to persist the repo-scoped token");return{childConnectionId:S}}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 Re(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 Oe({githubCallTool:s,selfCallTool:e,virtualMcpId:n,repo:o,connectionId:u,selectedKeys:l}){const i=await s({name:"TRIGGER_LIST",arguments:{}}),x=i.structuredContent??i,m=new Map((x.triggers??[]).map(a=>[a.type,a])),r=D.filter(a=>l.has(a.key)),h=await Promise.allSettled(r.map(async a=>{const w=m.get(a.triggerType);if(!w)throw new Error(`Trigger ${a.triggerType} not exposed`);const b=await e({name:"AUTOMATION_CREATE",arguments:{name:`${o.name}: ${a.nameSuffix}`,virtual_mcp_id:n,messages:a.instructions(o),active:!0}}),N=(b.structuredContent??b).id;if(!N)throw new Error(`AUTOMATION_CREATE returned no id for ${a.key}`);await e({name:"AUTOMATION_TRIGGER_ADD",arguments:{automation_id:N,type:"event",connection_id:u,event_type:a.triggerType,params:Re(w,o)}})})),g=h.filter(a=>a.status==="rejected").length;return g>0&&console.error("Some GitHub automations failed to set up:",h.filter(a=>a.status==="rejected")),{total:h.length,failed:g}}function Ze(s){const e=$.c(22),{open:n,onOpenChange:o,title:u,hideAutoRespondCheckbox:l,onImportComplete:i}=s,x=u===void 0?"Import from GitHub":u,m=l===void 0?!1:l,[r,h]=G.useState(null);let g;e[0]!==x?(g=t.jsx(ie,{className:"sr-only",children:t.jsx(ae,{children:x})}),e[0]=x,e[1]=g):g=e[1];let a;e[2]!==r||e[3]!==x?(a=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:r?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:r.avatarUrl,alt:r.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:r.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(M,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:x})]})}),e[2]=r,e[3]=x,e[4]=a):a=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(U,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=w):w=e[5];let b;e[6]!==o?(b=()=>o(!1),e[6]=o,e[7]=b):b=e[7];let N;e[8]!==m||e[9]!==i||e[10]!==n||e[11]!==r||e[12]!==b?(N=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(G.Suspense,{fallback:w,children:t.jsx(Ge,{open:n,onComplete:b,selectedInstallation:r,onSelectInstallation:h,hideAutoRespondCheckbox:m,onImportComplete:i})})}),e[8]=m,e[9]=i,e[10]=n,e[11]=r,e[12]=b,e[13]=N):N=e[13];let y;e[14]!==g||e[15]!==a||e[16]!==N?(y=t.jsxs(le,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[g,a,N]}),e[14]=g,e[15]=a,e[16]=N,e[17]=y):y=e[17];let j;return e[18]!==o||e[19]!==n||e[20]!==y?(j=t.jsx(ce,{open:n,onOpenChange:o,children:y}),e[18]=o,e[19]=n,e[20]=y,e[21]=j):j=e[21],j}function Ge({open:s,onComplete:e,selectedInstallation:n,onSelectInstallation:o,hideAutoRespondCheckbox:u,onImportComplete:l}){const{org:i}=Q(),x=W(),m=be(),[r,h]=G.useState(null),[g,a]=G.useState(!0),[w,b]=G.useState(()=>new Set(D.filter(c=>c.defaultEnabled).map(c=>c.key))),N=D.filter(c=>c.defaultEnabled).map(c=>c.key),y=u?new Set(N):g?w:new Set,j=fe({slug:"mcp-github"}),I=Te(j),f=Ce({enabled:s&&I.length===0}),d=I.length===1?I[0]??null:r,C=H({connectionId:d?.id??"",orgId:i.id,orgSlug:i.slug}),p=H({connectionId:X,orgId:i.id,orgSlug:i.slug}),S=async(c,E)=>{try{const O=await C.callTool({name:"get_file_contents",arguments:{owner:c.owner,repo:c.name,path:E}});if(O.isError)return null;const P=O.content?.find(A=>A.type==="resource")?.resource?.text;if(!P)return null;try{const A=JSON.parse(P);return typeof A=="string"?A:JSON.stringify(A)}catch{return P}}catch{return null}},R=(c,E)=>{Promise.all([S(E,"AGENTS.md"),S(E,"CLAUDE.md")]).then(async([_,O])=>{const k=_??O??null;k&&(await p.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:c,data:{metadata:{instructions:k}}}}),B(x,i.id))}).catch(_=>{console.error("GitHub instructions fetch failed:",_)})},T=async({virtualMcpId:c,repo:E,connectionId:_,selectedKeys:O})=>{const{total:k,failed:P}=await Oe({githubCallTool:A=>C.callTool(A),selfCallTool:A=>p.callTool(A),virtualMcpId:c,repo:E,connectionId:_,selectedKeys:O});P>0&&z.warning(`Set up ${k-P}/${k} GitHub automations. Add the rest from the automations view.`)},v=ne({mutationFn:async c=>{if(!d||!n)throw new Error("No GitHub connection or installation");const E=n.installationId,{childConnectionId:_}=await Ae({orgSlug:i.slug,sourceConnection:d,installationId:E,owner:c.owner,repo:c.name,githubCallTool:k=>C.callTool(k),selfCallTool:k=>p.callTool(k)});let O=null;try{const k=await p.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:c.name,description:c.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:c.owner,name:c.name,url:c.url,installationId:E,connectionId:_},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:_}]}}}),P=k.structuredContent??k,A=P.item?.id;if(!P.item||!A)throw new Error("Failed to create the imported agent");return O=A,y.size>0&&await T({virtualMcpId:A,repo:c,connectionId:_,selectedKeys:y}).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:c,connectionId:_,item:P.item}}catch(k){throw O&&await p.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:O}}).catch(()=>{}),await p.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:_,force:!0}}).catch(()=>{}),k}},onSuccess:({virtualMcpId:c,repo:E,connectionId:_,item:O})=>{if(x.setQueryData(V.collectionItem(p,i.id,"","VIRTUAL_MCP",c),{item:O}),B(x,i.id),R(c,E),l){l({virtualMcpId:c,repo:E,connectionId:_});return}z.success(`Imported ${E.name} from GitHub`),e(),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),m(c)},onError:c=>{z.error("Failed to import repo: "+(c instanceof Error?c.message:"Unknown error"))}});return f.status==="installing"||f.status==="authenticating"?t.jsx(q,{status:f.status,error:null,retry:f.retry}):f.status==="error"?t.jsx(q,{status:"error",error:f.error,retry:f.retry}):I.length===0&&f.status==="idle"?t.jsx(q,{status:"installing",error:null,retry:f.retry}):I.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"})}),I.map(c=>t.jsxs("button",{type:"button",onClick:()=>h(c),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[c.icon?t.jsx("img",{src:c.icon,alt:c.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(M,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:c.title})]},c.id))]}):d?n?t.jsx($e,{connectionId:d.id,orgId:i.id,orgSlug:i.slug,installation:n,onSelectRepo:c=>v.mutate(c),isSaving:v.isPending,autoRespondEnabled:g,onAutoRespondChange:a,selectedAutomationKeys:w,onAutomationKeysChange:b,hideAutoRespondCheckbox:u}):t.jsx(Pe,{connectionId:d.id,orgId:i.id,orgSlug:i.slug,onSelect:o,showBackButton:I.length>1,onBack:()=>h(null)}):null}function Pe(s){const e=$.c(31),{connectionId:n,orgId:o,orgSlug:u,onSelect:l,showBackButton:i,onBack:x}=s;let m;e[0]!==o||e[1]!==u?(m={connectionId:X,orgId:o,orgSlug:u},e[0]=o,e[1]=u,e[2]=m):m=e[2];const r=H(m);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]!==r?(g=()=>we(p=>r.callTool(p),n),e[6]=n,e[7]=r,e[8]=g):g=e[8];let a;e[9]!==h||e[10]!==g?(a={queryKey:h,queryFn:g},e[9]=h,e[10]=g,e[11]=a):a=e[11];const w=se(a);if(w.isLoading){let p;return e[12]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(U,{size:18,className:"animate-spin text-muted-foreground"})}),e[12]=p):p=e[12],p}if(w.isError){let p;return e[13]===Symbol.for("react.memo_cache_sentinel")?(p=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]=p):p=e[13],p}const b=w.data;if(!b)return null;let N;e[14]!==x||e[15]!==i?(N=i&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:x,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]=x,e[15]=i,e[16]=N):N=e[16];let y;if(e[17]!==b.installations||e[18]!==l){let p;e[20]!==l?(p=S=>t.jsxs("button",{type:"button",onClick:()=>l(S),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:S.avatarUrl,alt:S.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:S.login}),S.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 →"})]},S.installationId),e[20]=l,e[21]=p):p=e[21],y=b.installations.map(p),e[17]=b.installations,e[18]=l,e[19]=y}else y=e[19];let j;e[22]!==y?(j=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:y}),e[22]=y,e[23]=j):j=e[23];const I=b.appSlug?`https://github.com/apps/${b.appSlug}/installations/new`:"https://github.com/settings/installations";let f;e[24]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("span",{className:"underline underline-offset-2",children:"Install the GitHub App"}),e[24]=f):f=e[24];let d;e[25]!==I?(d=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:I,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:["Account not listed?"," ",f]})}),e[25]=I,e[26]=d):d=e[26];let C;return e[27]!==d||e[28]!==N||e[29]!==j?(C=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[N,j,d]}),e[27]=d,e[28]=N,e[29]=j,e[30]=C):C=e[30],C}function $e(s){const e=$.c(27),{connectionId:n,orgId:o,orgSlug:u,installation:l,onSelectRepo:i,isSaving:x,autoRespondEnabled:m,onAutoRespondChange:r,selectedAutomationKeys:h,onAutomationKeysChange:g,hideAutoRespondCheckbox:a}=s,[w,b]=G.useState(""),N=de(w,300),y=G.useDeferredValue(N),j=w!==y;let I;e[0]!==j||e[1]!==w?(I=t.jsx(ue,{placeholder:"Search repositories...",value:w,onChange:b,isSearching:j}),e[0]=j,e[1]=w,e[2]=I):I=e[2];const f=j?"opacity-40":"opacity-100";let d;e[3]!==f?(d=K("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",f),e[3]=f,e[4]=d):d=e[4];let C;e[5]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(U,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=C):C=e[5];let p;e[6]!==n||e[7]!==y||e[8]!==l||e[9]!==x||e[10]!==i||e[11]!==o||e[12]!==u?(p=t.jsx(G.Suspense,{fallback:C,children:t.jsx(Le,{connectionId:n,orgId:o,orgSlug:u,installation:l,query:y,onSelectRepo:i,isSaving:x})}),e[6]=n,e[7]=y,e[8]=l,e[9]=x,e[10]=i,e[11]=o,e[12]=u,e[13]=p):p=e[13];let S;e[14]!==d||e[15]!==p?(S=t.jsx("div",{className:d,children:p}),e[14]=d,e[15]=p,e[16]=S):S=e[16];let R;e[17]!==m||e[18]!==a||e[19]!==r||e[20]!==g||e[21]!==h?(R=!a&&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:m,onCheckedChange:v=>r(v===!0)}),t.jsx("span",{className:"text-xs text-foreground",children:"Set up GitHub automations for this repo"})]}),m&&t.jsx("div",{className:"px-4 pb-3 pl-9 flex flex-col gap-1.5",children:D.map(v=>t.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[t.jsx(J,{checked:h.has(v.key),onCheckedChange:c=>{const E=new Set(h);c===!0?E.add(v.key):E.delete(v.key),g(E)}}),t.jsx("span",{className:"text-xs text-muted-foreground",children:v.label})]},v.key))})]}),e[17]=m,e[18]=a,e[19]=r,e[20]=g,e[21]=h,e[22]=R):R=e[22];let T;return e[23]!==I||e[24]!==S||e[25]!==R?(T=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[I,S,R]}),e[23]=I,e[24]=S,e[25]=R,e[26]=T):T=e[26],T}function Le(s){const e=$.c(29),{connectionId:n,orgId:o,orgSlug:u,installation:l,query:i,onSelectRepo:x,isSaving:m}=s;let r;e[0]!==n||e[1]!==o||e[2]!==u?(r={connectionId:n,orgId:o,orgSlug:u},e[0]=n,e[1]=o,e[2]=u,e[3]=r):r=e[3];const h=H(r),g=l.type==="User"?"user":"org",a=i?`${g}:${l.login} ${i} in:name`:`${g}:${l.login}`;let w;e[4]!==n||e[5]!==l.login||e[6]!==o||e[7]!==i?(w=V.githubOrgRepos(o,n,l.login,i),e[4]=n,e[5]=l.login,e[6]=o,e[7]=i,e[8]=w):w=e[8];let b;e[9]!==h||e[10]!==a?(b=async f=>{const{signal:d}=f,p=(await h.callTool({name:"search_repositories",arguments:{query:a,page:1,perPage:30}},void 0,{signal:d})).content?.[0]?.text;if(!p)throw new Error("No response from search_repositories");return(JSON.parse(p).items??[]).map(He)},e[9]=h,e[10]=a,e[11]=b):b=e[11];let N;e[12]!==w||e[13]!==b?(N={queryKey:w,queryFn:b},e[12]=w,e[13]=b,e[14]=N):N=e[14];const{data:y}=oe(N);if(y.length===0){let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("p",{className:"text-sm text-muted-foreground",children:"No repositories found"}),e[15]=f):f=e[15];let d;e[16]!==i?(d=i&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Try a different search term"}),e[16]=i,e[17]=d):d=e[17];let C;return e[18]!==d?(C=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[f,d]}),e[18]=d,e[19]=C):C=e[19],C}let j;if(e[20]!==m||e[21]!==x||e[22]!==y){let f;e[24]!==m||e[25]!==x?(f=d=>t.jsxs("button",{type:"button",onClick:()=>x(d),disabled:m,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(M,{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(ge,{size:10}),d.private?"Private":"Public"]})]},d.fullName),e[24]=m,e[25]=x,e[26]=f):f=e[26],j=y.map(f),e[20]=m,e[21]=x,e[22]=y,e[23]=j}else j=e[23];let I;return e[27]!==j?(I=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:j}),e[27]=j,e[28]=I):I=e[28],I}function He(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=$.c(33),{status:n,error:o,retry:u}=s;if(n==="error"){let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(M,{className:"size-5 text-destructive"})}),e[0]=p):p=e[0];let S;e[1]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("p",{className:"text-sm font-medium",children:"Connection failed"}),e[1]=S):S=e[1];const R=o??"Something went wrong while connecting to GitHub.";let T;e[2]!==R?(T=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[S,t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:R})]}),e[2]=R,e[3]=T):T=e[3];let v;e[4]!==u?(v=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]=v):v=e[5];let c;return e[6]!==T||e[7]!==v?(c=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[p,T,v]}),e[6]=T,e[7]=v,e[8]=c):c=e[8],c}const l=n==="authenticating";let i;e[9]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(M,{className:"size-5 text-foreground"})}),e[9]=i):i=e[9];let x;e[10]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsxs("div",{className:"relative size-10",children:[i,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(U,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[10]=x):x=e[10];const m=l?"Authenticating with GitHub":"Setting up GitHub";let r;e[11]!==m?(r=t.jsx("p",{className:"text-sm font-medium",children:m}),e[11]=m,e[12]=r):r=e[12];const h=l?"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 a;e[15]!==r||e[16]!==g?(a=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[r,g]}),e[15]=r,e[16]=g,e[17]=a):a=e[17];const w=l?"bg-muted-foreground/30":"bg-foreground animate-pulse";let b;e[18]!==w?(b=K("size-1.5 rounded-full",w),e[18]=w,e[19]=b):b=e[19];let N;e[20]!==b?(N=t.jsx("span",{className:b}),e[20]=b,e[21]=N):N=e[21];const y=l?"bg-foreground animate-pulse":"bg-muted-foreground/30";let j;e[22]!==y?(j=K("size-1.5 rounded-full",y),e[22]=y,e[23]=j):j=e[23];let I;e[24]!==j?(I=t.jsx("span",{className:j}),e[24]=j,e[25]=I):I=e[25];let f;e[26]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[26]=f):f=e[26];let d;e[27]!==N||e[28]!==I?(d=t.jsxs("div",{className:"flex items-center gap-1.5",children:[N,I,f]}),e[27]=N,e[28]=I,e[29]=d):d=e[29];let C;return e[30]!==d||e[31]!==a?(C=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[x,a,d]}),e[30]=d,e[31]=a,e[32]=C):C=e[32],C}export{Ze as G,M as a,Te as g,Ae as p,Ce as u};
1
+ import{c as $,j as t,D as Q,a as te,m as W,r as G,a5 as B,i as U,d as ne,t as z,K as V,k as se,l as K,q as oe,ae as re}from"./index-CXy6rN6i.js";import{c as ie,a as ae,d as le,e as ce}from"./dialog-o7scRbG9.js";import{C as J}from"./checkbox-BIDlFz_0.js";import{C as ue}from"./collection-search-CKMDHnku.js";import{u as de}from"./use-debounced-value-BGsbVLHA.js";import{b as me,u as fe}from"./use-connection-CSQdDXlG.js";import{W as pe,u as H,S as X}from"./use-mcp-client-CRWIqSWI.js";import{b as Z}from"./Settings02-QyYEyYyn.js";import{x as ge}from"./agent-icon-BjxA8YR3.js";import{a as xe}from"./authenticate-and-persist-oauth-HBteAcVm.js";import{u as he}from"./use-mcp-tools-Dgj65Z69.js";import{e as ye}from"./extract-connection-data-BVX9Eneo.js";import{k as be}from"./use-navigate-to-agent-DTqeD3lq.js";import{f as Ne}from"./github-installations-DzN1UQ4x.js";function M(s){const e=$.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 l;return e[1]!==o||e[2]!==n?(l=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]=l):l=e[3],l}function we(s,e){const n=$.c(12),{org:o}=Q();let u;n[0]!==o.id?(u=pe.REGISTRY(o.id),n[0]=o.id,n[1]=u):u=n[1];const l=u;let i;n[2]!==o.id||n[3]!==o.slug||n[4]!==l?(i={connectionId:l,orgId:o.id,orgSlug:o.slug},n[2]=o.id,n[3]=o.slug,n[4]=l,n[5]=i):i=n[5];const x=H(i);let m;n[6]!==s?(m={name:s},n[6]=s,n[7]=m):m=n[7];const r=e?.enabled??!0;let h;return n[8]!==x||n[9]!==m||n[10]!==r?(h={client:x,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:m,enabled:r,staleTime:3e5,select:je},n[8]=x,n[9]=m,n[10]=r,n[11]=h):h=n[11],he(h)}function je(s){return s.structuredContent?.item??null}const Ie="deco/mcp-github";function Ce(s){const{org:e}=Q(),{data:n}=te.useSession(),o=me(),u=W(),[l,i]=G.useState("idle"),[x,m]=G.useState(null),[r,h]=G.useState(null),{data:g,isLoading:a}=we(Ie,{enabled:s.enabled}),N=G.useRef(!1);s.enabled&&g&&!a&&!N.current&&n?.user?.id&&l==="idle"&&(N.current=!0,b());async function b(){if(!(!g||!n?.user?.id||!e))try{i("installing"),m(null);const y=ye(g,e.id,n.user.id,{remoteIndex:0});if(!y.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:I}=await o.create.mutateAsync(y);i("authenticating");const f=await xe({connectionId:I,orgId:e.id,orgSlug:e.slug,persistFallback:d=>o.update.mutateAsync({id:I,data:{connection_token:d}}).then(()=>{})});if(f.ran&&!f.ok){try{await o.delete.mutateAsync(I)}catch{}throw new Error(f.error&&f.error!=="no token received"?f.error:"No token received from GitHub")}B(u,e.id),h(y),i("ready")}catch(y){m(y instanceof Error?y.message:String(y)),i("error")}}function w(){i("idle"),m(null),h(null),N.current=!1}return s.enabled&&a&&l==="idle"?{status:"installing",error:null,connection:null,retry:w}:{status:l,error:x,connection:r,retry:w}}const F={contents:"write",metadata:"read",pull_requests:"write",issues:"write"};function Se(s){if(!s||typeof s!="object"||Array.isArray(s))return F;const e=s;return Object.values(e).some(n=>typeof n!="string")?F:e}function ve(s){if(!(typeof s!="number"||!Number.isFinite(s)||!Number.isInteger(s)||s<=0))return s}function Ee(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=ve(e.repositoryId);return{sourceConnectionId:typeof e.sourceConnectionId=="string"?e.sourceConnectionId:void 0,installationId:e.installationId,repositoryId:n,owner:e.owner,repo:e.repo,permissions:Se(e.permissions),grantProvider:e.grantProvider==="github-mcp"?"github-mcp":void 0}}function Te(s){return(s??[]).filter(e=>Ee(e)===null)}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 ke(s){try{const e=new URL(s);return(e.protocol==="http:"||e.protocol==="https:")&&!e.username&&!e.password}catch{return!1}}function _e(s){return typeof s=="number"&&Number.isFinite(s)&&Number.isInteger(s)&&s>0?s:void 0}async function Ae(s){const{orgSlug:e,sourceConnection:n,installationId:o,owner:u,repo:l,githubCallTool:i,selfCallTool:x}=s,m=await i({name:"MINT_REPO_TOKEN",arguments:{installationId:o,owner:u,repo:l,permissions:F}}),r=m.structuredContent;if(m.isError||!r?.token){const T=m.content?.find(v=>v.type==="text")?.text;throw new Error(T?`Failed to mint a repo-scoped GitHub token: ${T}`:"Failed to mint a repo-scoped GitHub token")}const h=L(r.refreshToken),g=L(r.tokenEndpoint),a=L(r.clientId);if(!h||!g||!a)throw new Error(Y);if(!ke(g))throw new Error(Y);const N=L(r.repository?.owner),b=L(r.repository?.name),w="GitHub MCP returned refresh metadata for a different repository";if(r.repository?.owner!==void 0&&(!N||N.toLowerCase()!==u.toLowerCase()))throw new Error(w);if(r.repository?.name!==void 0&&(!b||b.toLowerCase()!==l.toLowerCase()))throw new Error(w);const y=_e(r.repository?.id),j=r.expiresAt?Date.parse(r.expiresAt):NaN,I=Number.isFinite(j)?Math.max(0,Math.floor((j-Date.now())/1e3)):null,d=(typeof r.expiresIn=="number"&&Number.isFinite(r.expiresIn)&&Number.isInteger(r.expiresIn)&&r.expiresIn>0?r.expiresIn:null)??I,C=await x({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:{title:`GitHub: ${u}/${l}`,description:`Repo-scoped GitHub access for ${u}/${l}`,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:y,owner:u,repo:l,permissions:F,grantProvider:"github-mcp"}}}}}),p=C.structuredContent??C,S=p.item?.id??p.id;if(!S)throw new Error("Failed to create the repo-scoped GitHub connection");if(!(await fetch(`/api/${e}/connections/${S}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:r.token,refreshToken:h,expiresIn:d,scope:r.scope??null,clientId:a,tokenEndpoint:g})})).ok)throw await x({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:S,force:!0}}).catch(()=>{}),new Error("Failed to persist the repo-scoped token");return{childConnectionId:S}}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 Re(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 Oe({githubCallTool:s,selfCallTool:e,virtualMcpId:n,repo:o,connectionId:u,selectedKeys:l}){const i=await s({name:"TRIGGER_LIST",arguments:{}}),x=i.structuredContent??i,m=new Map((x.triggers??[]).map(a=>[a.type,a])),r=D.filter(a=>l.has(a.key)),h=await Promise.allSettled(r.map(async a=>{const N=m.get(a.triggerType);if(!N)throw new Error(`Trigger ${a.triggerType} not exposed`);const b=await e({name:"AUTOMATION_CREATE",arguments:{name:`${o.name}: ${a.nameSuffix}`,virtual_mcp_id:n,messages:a.instructions(o),active:!0}}),w=(b.structuredContent??b).id;if(!w)throw new Error(`AUTOMATION_CREATE returned no id for ${a.key}`);await e({name:"AUTOMATION_TRIGGER_ADD",arguments:{automation_id:w,type:"event",connection_id:u,event_type:a.triggerType,params:Re(N,o)}})})),g=h.filter(a=>a.status==="rejected").length;return g>0&&console.error("Some GitHub automations failed to set up:",h.filter(a=>a.status==="rejected")),{total:h.length,failed:g}}function Ze(s){const e=$.c(22),{open:n,onOpenChange:o,title:u,hideAutoRespondCheckbox:l,onImportComplete:i}=s,x=u===void 0?"Import from GitHub":u,m=l===void 0?!1:l,[r,h]=G.useState(null);let g;e[0]!==x?(g=t.jsx(ie,{className:"sr-only",children:t.jsx(ae,{children:x})}),e[0]=x,e[1]=g):g=e[1];let a;e[2]!==r||e[3]!==x?(a=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:r?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:r.avatarUrl,alt:r.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:r.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(M,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:x})]})}),e[2]=r,e[3]=x,e[4]=a):a=e[4];let N;e[5]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(U,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=N):N=e[5];let b;e[6]!==o?(b=()=>o(!1),e[6]=o,e[7]=b):b=e[7];let w;e[8]!==m||e[9]!==i||e[10]!==n||e[11]!==r||e[12]!==b?(w=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(G.Suspense,{fallback:N,children:t.jsx(Ge,{open:n,onComplete:b,selectedInstallation:r,onSelectInstallation:h,hideAutoRespondCheckbox:m,onImportComplete:i})})}),e[8]=m,e[9]=i,e[10]=n,e[11]=r,e[12]=b,e[13]=w):w=e[13];let y;e[14]!==g||e[15]!==a||e[16]!==w?(y=t.jsxs(le,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[g,a,w]}),e[14]=g,e[15]=a,e[16]=w,e[17]=y):y=e[17];let j;return e[18]!==o||e[19]!==n||e[20]!==y?(j=t.jsx(ce,{open:n,onOpenChange:o,children:y}),e[18]=o,e[19]=n,e[20]=y,e[21]=j):j=e[21],j}function Ge({open:s,onComplete:e,selectedInstallation:n,onSelectInstallation:o,hideAutoRespondCheckbox:u,onImportComplete:l}){const{org:i}=Q(),x=W(),m=be(),[r,h]=G.useState(null),[g,a]=G.useState(!0),[N,b]=G.useState(()=>new Set(D.filter(c=>c.defaultEnabled).map(c=>c.key))),w=D.filter(c=>c.defaultEnabled).map(c=>c.key),y=u?new Set(w):g?N:new Set,j=fe({slug:"mcp-github"}),I=Te(j),f=Ce({enabled:s&&I.length===0}),d=I.length===1?I[0]??null:r,C=H({connectionId:d?.id??"",orgId:i.id,orgSlug:i.slug}),p=H({connectionId:X,orgId:i.id,orgSlug:i.slug}),S=async(c,E)=>{try{const O=await C.callTool({name:"get_file_contents",arguments:{owner:c.owner,repo:c.name,path:E}});if(O.isError)return null;const P=O.content?.find(A=>A.type==="resource")?.resource?.text;if(!P)return null;try{const A=JSON.parse(P);return typeof A=="string"?A:JSON.stringify(A)}catch{return P}}catch{return null}},R=(c,E)=>{Promise.all([S(E,"AGENTS.md"),S(E,"CLAUDE.md")]).then(async([_,O])=>{const k=_??O??null;k&&(await p.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:c,data:{metadata:{instructions:k}}}}),B(x,i.id))}).catch(_=>{console.error("GitHub instructions fetch failed:",_)})},T=async({virtualMcpId:c,repo:E,connectionId:_,selectedKeys:O})=>{const{total:k,failed:P}=await Oe({githubCallTool:A=>C.callTool(A),selfCallTool:A=>p.callTool(A),virtualMcpId:c,repo:E,connectionId:_,selectedKeys:O});P>0&&z.warning(`Set up ${k-P}/${k} GitHub automations. Add the rest from the automations view.`)},v=ne({mutationFn:async c=>{if(!d||!n)throw new Error("No GitHub connection or installation");const E=n.installationId,{childConnectionId:_}=await Ae({orgSlug:i.slug,sourceConnection:d,installationId:E,owner:c.owner,repo:c.name,githubCallTool:k=>C.callTool(k),selfCallTool:k=>p.callTool(k)});let O=null;try{const k=await p.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:c.name,description:c.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:c.owner,name:c.name,url:c.url,installationId:E,connectionId:_},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:_}]}}}),P=k.structuredContent??k,A=P.item?.id;if(!P.item||!A)throw new Error("Failed to create the imported agent");return O=A,y.size>0&&await T({virtualMcpId:A,repo:c,connectionId:_,selectedKeys:y}).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:c,connectionId:_,item:P.item}}catch(k){throw O&&await p.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:O}}).catch(()=>{}),await p.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:_,force:!0}}).catch(()=>{}),k}},onSuccess:({virtualMcpId:c,repo:E,connectionId:_,item:O})=>{if(x.setQueryData(V.collectionItem(p,i.id,"","VIRTUAL_MCP",c),{item:O}),B(x,i.id),R(c,E),l){l({virtualMcpId:c,repo:E,connectionId:_});return}z.success(`Imported ${E.name} from GitHub`),e(),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),m(c)},onError:c=>{z.error("Failed to import repo: "+(c instanceof Error?c.message:"Unknown error"))}});return f.status==="installing"||f.status==="authenticating"?t.jsx(q,{status:f.status,error:null,retry:f.retry}):f.status==="error"?t.jsx(q,{status:"error",error:f.error,retry:f.retry}):I.length===0&&f.status==="idle"?t.jsx(q,{status:"installing",error:null,retry:f.retry}):I.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"})}),I.map(c=>t.jsxs("button",{type:"button",onClick:()=>h(c),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[c.icon?t.jsx("img",{src:c.icon,alt:c.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(M,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:c.title})]},c.id))]}):d?n?t.jsx($e,{connectionId:d.id,orgId:i.id,orgSlug:i.slug,installation:n,onSelectRepo:c=>v.mutate(c),isSaving:v.isPending,autoRespondEnabled:g,onAutoRespondChange:a,selectedAutomationKeys:N,onAutomationKeysChange:b,hideAutoRespondCheckbox:u}):t.jsx(Pe,{connectionId:d.id,orgId:i.id,orgSlug:i.slug,onSelect:o,showBackButton:I.length>1,onBack:()=>h(null)}):null}function Pe(s){const e=$.c(31),{connectionId:n,orgId:o,orgSlug:u,onSelect:l,showBackButton:i,onBack:x}=s;let m;e[0]!==o||e[1]!==u?(m={connectionId:X,orgId:o,orgSlug:u},e[0]=o,e[1]=u,e[2]=m):m=e[2];const r=H(m);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]!==r?(g=()=>Ne(p=>r.callTool(p),n),e[6]=n,e[7]=r,e[8]=g):g=e[8];let a;e[9]!==h||e[10]!==g?(a={queryKey:h,queryFn:g},e[9]=h,e[10]=g,e[11]=a):a=e[11];const N=se(a);if(N.isLoading){let p;return e[12]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(U,{size:18,className:"animate-spin text-muted-foreground"})}),e[12]=p):p=e[12],p}if(N.isError){let p;return e[13]===Symbol.for("react.memo_cache_sentinel")?(p=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]=p):p=e[13],p}const b=N.data;if(!b)return null;let w;e[14]!==x||e[15]!==i?(w=i&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:x,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]=x,e[15]=i,e[16]=w):w=e[16];let y;if(e[17]!==b.installations||e[18]!==l){let p;e[20]!==l?(p=S=>t.jsxs("button",{type:"button",onClick:()=>l(S),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:S.avatarUrl,alt:S.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:S.login}),S.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 →"})]},S.installationId),e[20]=l,e[21]=p):p=e[21],y=b.installations.map(p),e[17]=b.installations,e[18]=l,e[19]=y}else y=e[19];let j;e[22]!==y?(j=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:y}),e[22]=y,e[23]=j):j=e[23];const I=b.appSlug?`https://github.com/apps/${b.appSlug}/installations/new`:"https://github.com/settings/installations";let f;e[24]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("span",{className:"underline underline-offset-2",children:"Install the GitHub App"}),e[24]=f):f=e[24];let d;e[25]!==I?(d=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:I,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:["Account not listed?"," ",f]})}),e[25]=I,e[26]=d):d=e[26];let C;return e[27]!==d||e[28]!==w||e[29]!==j?(C=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[w,j,d]}),e[27]=d,e[28]=w,e[29]=j,e[30]=C):C=e[30],C}function $e(s){const e=$.c(27),{connectionId:n,orgId:o,orgSlug:u,installation:l,onSelectRepo:i,isSaving:x,autoRespondEnabled:m,onAutoRespondChange:r,selectedAutomationKeys:h,onAutomationKeysChange:g,hideAutoRespondCheckbox:a}=s,[N,b]=G.useState(""),w=de(N,300),y=G.useDeferredValue(w),j=N!==y;let I;e[0]!==j||e[1]!==N?(I=t.jsx(ue,{placeholder:"Search repositories...",value:N,onChange:b,isSearching:j}),e[0]=j,e[1]=N,e[2]=I):I=e[2];const f=j?"opacity-40":"opacity-100";let d;e[3]!==f?(d=K("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",f),e[3]=f,e[4]=d):d=e[4];let C;e[5]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(U,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=C):C=e[5];let p;e[6]!==n||e[7]!==y||e[8]!==l||e[9]!==x||e[10]!==i||e[11]!==o||e[12]!==u?(p=t.jsx(G.Suspense,{fallback:C,children:t.jsx(Le,{connectionId:n,orgId:o,orgSlug:u,installation:l,query:y,onSelectRepo:i,isSaving:x})}),e[6]=n,e[7]=y,e[8]=l,e[9]=x,e[10]=i,e[11]=o,e[12]=u,e[13]=p):p=e[13];let S;e[14]!==d||e[15]!==p?(S=t.jsx("div",{className:d,children:p}),e[14]=d,e[15]=p,e[16]=S):S=e[16];let R;e[17]!==m||e[18]!==a||e[19]!==r||e[20]!==g||e[21]!==h?(R=!a&&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:m,onCheckedChange:v=>r(v===!0)}),t.jsx("span",{className:"text-xs text-foreground",children:"Set up GitHub automations for this repo"})]}),m&&t.jsx("div",{className:"px-4 pb-3 pl-9 flex flex-col gap-1.5",children:D.map(v=>t.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[t.jsx(J,{checked:h.has(v.key),onCheckedChange:c=>{const E=new Set(h);c===!0?E.add(v.key):E.delete(v.key),g(E)}}),t.jsx("span",{className:"text-xs text-muted-foreground",children:v.label})]},v.key))})]}),e[17]=m,e[18]=a,e[19]=r,e[20]=g,e[21]=h,e[22]=R):R=e[22];let T;return e[23]!==I||e[24]!==S||e[25]!==R?(T=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[I,S,R]}),e[23]=I,e[24]=S,e[25]=R,e[26]=T):T=e[26],T}function Le(s){const e=$.c(29),{connectionId:n,orgId:o,orgSlug:u,installation:l,query:i,onSelectRepo:x,isSaving:m}=s;let r;e[0]!==n||e[1]!==o||e[2]!==u?(r={connectionId:n,orgId:o,orgSlug:u},e[0]=n,e[1]=o,e[2]=u,e[3]=r):r=e[3];const h=H(r),g=l.type==="User"?"user":"org",a=i?`${g}:${l.login} ${i} in:name`:`${g}:${l.login}`;let N;e[4]!==n||e[5]!==l.login||e[6]!==o||e[7]!==i?(N=V.githubOrgRepos(o,n,l.login,i),e[4]=n,e[5]=l.login,e[6]=o,e[7]=i,e[8]=N):N=e[8];let b;e[9]!==h||e[10]!==a?(b=async f=>{const{signal:d}=f,p=(await h.callTool({name:"search_repositories",arguments:{query:a,page:1,perPage:30}},void 0,{signal:d})).content?.[0]?.text;if(!p)throw new Error("No response from search_repositories");return(JSON.parse(p).items??[]).map(He)},e[9]=h,e[10]=a,e[11]=b):b=e[11];let w;e[12]!==N||e[13]!==b?(w={queryKey:N,queryFn:b},e[12]=N,e[13]=b,e[14]=w):w=e[14];const{data:y}=oe(w);if(y.length===0){let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("p",{className:"text-sm text-muted-foreground",children:"No repositories found"}),e[15]=f):f=e[15];let d;e[16]!==i?(d=i&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Try a different search term"}),e[16]=i,e[17]=d):d=e[17];let C;return e[18]!==d?(C=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[f,d]}),e[18]=d,e[19]=C):C=e[19],C}let j;if(e[20]!==m||e[21]!==x||e[22]!==y){let f;e[24]!==m||e[25]!==x?(f=d=>t.jsxs("button",{type:"button",onClick:()=>x(d),disabled:m,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(M,{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(ge,{size:10}),d.private?"Private":"Public"]})]},d.fullName),e[24]=m,e[25]=x,e[26]=f):f=e[26],j=y.map(f),e[20]=m,e[21]=x,e[22]=y,e[23]=j}else j=e[23];let I;return e[27]!==j?(I=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:j}),e[27]=j,e[28]=I):I=e[28],I}function He(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=$.c(33),{status:n,error:o,retry:u}=s;if(n==="error"){let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(M,{className:"size-5 text-destructive"})}),e[0]=p):p=e[0];let S;e[1]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("p",{className:"text-sm font-medium",children:"Connection failed"}),e[1]=S):S=e[1];const R=o??"Something went wrong while connecting to GitHub.";let T;e[2]!==R?(T=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[S,t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:R})]}),e[2]=R,e[3]=T):T=e[3];let v;e[4]!==u?(v=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]=v):v=e[5];let c;return e[6]!==T||e[7]!==v?(c=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[p,T,v]}),e[6]=T,e[7]=v,e[8]=c):c=e[8],c}const l=n==="authenticating";let i;e[9]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(M,{className:"size-5 text-foreground"})}),e[9]=i):i=e[9];let x;e[10]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsxs("div",{className:"relative size-10",children:[i,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(U,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[10]=x):x=e[10];const m=l?"Authenticating with GitHub":"Setting up GitHub";let r;e[11]!==m?(r=t.jsx("p",{className:"text-sm font-medium",children:m}),e[11]=m,e[12]=r):r=e[12];const h=l?"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 a;e[15]!==r||e[16]!==g?(a=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[r,g]}),e[15]=r,e[16]=g,e[17]=a):a=e[17];const N=l?"bg-muted-foreground/30":"bg-foreground animate-pulse";let b;e[18]!==N?(b=K("size-1.5 rounded-full",N),e[18]=N,e[19]=b):b=e[19];let w;e[20]!==b?(w=t.jsx("span",{className:b}),e[20]=b,e[21]=w):w=e[21];const y=l?"bg-foreground animate-pulse":"bg-muted-foreground/30";let j;e[22]!==y?(j=K("size-1.5 rounded-full",y),e[22]=y,e[23]=j):j=e[23];let I;e[24]!==j?(I=t.jsx("span",{className:j}),e[24]=j,e[25]=I):I=e[25];let f;e[26]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[26]=f):f=e[26];let d;e[27]!==w||e[28]!==I?(d=t.jsxs("div",{className:"flex items-center gap-1.5",children:[w,I,f]}),e[27]=w,e[28]=I,e[29]=d):d=e[29];let C;return e[30]!==d||e[31]!==a?(C=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[x,a,d]}),e[30]=d,e[31]=a,e[32]=C):C=e[32],C}export{Ze as G,M as a,Te as g,Ae as p,Ce as u};