decocms 4.77.3 → 4.78.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 (250) hide show
  1. package/dist/client/assets/{AlertCircle-DFFB807G.js → AlertCircle-D6YyJJmm.js} +1 -1
  2. package/dist/client/assets/{AreaChart-oIJCSonG.js → AreaChart-CXzSMWrS.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-CFU7eduC.js → ArrowUp-D3YFKg7G.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-D37SsWBk.js → ArrowUpRight-DgvFsQng.js} +1 -1
  5. package/dist/client/assets/{Check-BAiULwRg.js → Check-Bf3Fz6mT.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-BwwAyNzV.js → CheckCircle-DBI4XJwz.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-Cpk84lU5.js → ChevronDown-TeMcV6Wa.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-UlscOqp6.js → ChevronRight-QSLgw-q7.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-CqCnswy_.js → ChevronUp-g5JVf1F_.js} +1 -1
  10. package/dist/client/assets/{Circle-pOPoWDQn.js → Circle-Cu4ym4Ez.js} +1 -1
  11. package/dist/client/assets/{Copy01-BEB5hDKQ.js → Copy01-DgzGIIpj.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-BFfMlorx.js → DotsVertical-yY90ybrp.js} +1 -1
  13. package/dist/client/assets/{Eye-Bbh_ejV6.js → Eye-vRl0ZCJB.js} +1 -1
  14. package/dist/client/assets/{FilterLines-Dm0WP1zI.js → FilterLines-BbWZ4lL4.js} +1 -1
  15. package/dist/client/assets/{Flag01-e55mynPF.js → Flag01-CXRHMIef.js} +1 -1
  16. package/dist/client/assets/{Globe01-DVm51A__.js → Globe01-B7g_9reV.js} +1 -1
  17. package/dist/client/assets/{Globe04-DA8QsMrW.js → Globe04-C3Z6OIxj.js} +1 -1
  18. package/dist/client/assets/{HardDrive-BJ2MS6we.js → HardDrive-DymMXEyR.js} +1 -1
  19. package/dist/client/assets/{Image01-Y4d3ZI2r.js → Image01-Bx4AOGxs.js} +1 -1
  20. package/dist/client/assets/{Key01-xPUeBTf6.js → Key01-Cmvx37G1.js} +1 -1
  21. package/dist/client/assets/{LayoutLeft-CNWN8tpf.js → LayoutLeft-q_h77zns.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-B6bTrNoI.js → LinkExternal01-BEoe9Fb2.js} +1 -1
  23. package/dist/client/assets/{List-gTaMGV9z.js → List-5170zK7Q.js} +1 -1
  24. package/dist/client/assets/{Monitor01-BdI_dCjX.js → Monitor01-Kb5okFQS.js} +1 -1
  25. package/dist/client/assets/{Package-WlP_SelV.js → Package-yySHtAk6.js} +1 -1
  26. package/dist/client/assets/{Palette-DwivsXKp.js → Palette-Dacxdv_I.js} +1 -1
  27. package/dist/client/assets/{Play-BPQdBfbt.js → Play-BoazbAxP.js} +1 -1
  28. package/dist/client/assets/{Plus-C8FiAr3i.js → Plus-t7Jm0GJ3.js} +1 -1
  29. package/dist/client/assets/{SearchLg-CMWIHllt.js → SearchLg-CB9_TW_3.js} +1 -1
  30. package/dist/client/assets/{SearchMd-Gwm-384G.js → SearchMd-B8rhT4Rt.js} +1 -1
  31. package/dist/client/assets/{Settings02-D5c8FtUa.js → Settings02-D4nrXgvn.js} +1 -1
  32. package/dist/client/assets/{Shield01-Dn6encQp.js → Shield01-Y3jps5Gy.js} +1 -1
  33. package/dist/client/assets/{Star01-C32-NjaL.js → Star01-DBp7dbGs.js} +1 -1
  34. package/dist/client/assets/{Stars01-C8WemEnv.js → Stars01-BJhn7N1A.js} +1 -1
  35. package/dist/client/assets/{Stars02-CzKVb8lE.js → Stars02-BmKcMhZX.js} +1 -1
  36. package/dist/client/assets/{Sun-BPhwV-Eh.js → Sun-DWvykssV.js} +1 -1
  37. package/dist/client/assets/{SwitchHorizontal01-C8Rnw5uG.js → SwitchHorizontal01-DJDXmWgC.js} +1 -1
  38. package/dist/client/assets/{Tool01-CSravChF.js → Tool01-Ct7fGWUY.js} +1 -1
  39. package/dist/client/assets/{Tool02-csu1mOp1.js → Tool02-Cr2Rz6tq.js} +1 -1
  40. package/dist/client/assets/{Trash01-DZTkGJqE.js → Trash01-C3QDvJF1.js} +1 -1
  41. package/dist/client/assets/{TrendUp01-Dw2DNRxA.js → TrendUp01-WsDlxYhZ.js} +1 -1
  42. package/dist/client/assets/{Upload01-s2ES1URH.js → Upload01-C2W1llVr.js} +1 -1
  43. package/dist/client/assets/{User01-D0_zDlJM.js → User01-Deo29J7j.js} +1 -1
  44. package/dist/client/assets/{UserPlus01-DjFNU1Mn.js → UserPlus01-C_-L6kJr.js} +1 -1
  45. package/dist/client/assets/{Users01-CAC4FOXB.js → Users01-CLZ2kdTu.js} +1 -1
  46. package/dist/client/assets/{Users03-Iz-TpUuJ.js → Users03-uM7w0XRw.js} +1 -1
  47. package/dist/client/assets/{X-CTTK5Zj2.js → X-DYT1GSz1.js} +1 -1
  48. package/dist/client/assets/{XCircle-CiVL5z-e.js → XCircle-C965t8pI.js} +1 -1
  49. package/dist/client/assets/{XClose-DxMKQUUD.js → XClose-D8I17tPk.js} +1 -1
  50. package/dist/client/assets/{Zap-CrYnUVJy.js → Zap-p_vD-N15.js} +1 -1
  51. package/dist/client/assets/{ZapSquare-BDp8YrcS.js → ZapSquare-r-I1hrGR.js} +1 -1
  52. package/dist/client/assets/{ZoomOut-CvmU5uj5.js → ZoomOut-CyT94sXk.js} +1 -1
  53. package/dist/client/assets/{access-gate-Bw06fv-s.js → access-gate-C5tHnpFu.js} +1 -1
  54. package/dist/client/assets/{add-section-modal-BUwFQaqb.js → add-section-modal-D3vMc3LK.js} +1 -1
  55. package/dist/client/assets/{agent-icon-jdj2JAEm.js → agent-icon-jLUxIfUX.js} +1 -1
  56. package/dist/client/assets/agents-list-3dntZgUX.js +1 -0
  57. package/dist/client/assets/{ai-providers-azn7N2Yk.js → ai-providers-DUfJcGkX.js} +1 -1
  58. package/dist/client/assets/{alert-U_1RTm6v.js → alert-JyDMBG9Y.js} +1 -1
  59. package/dist/client/assets/{alert-dialog-DtmlB9JL.js → alert-dialog-BZCxnnaY.js} +1 -1
  60. package/dist/client/assets/app-editor-BBLUJ0bm.js +1 -0
  61. package/dist/client/assets/{auth-BR_fNNK7.js → auth-B0oxX-rw.js} +1 -1
  62. package/dist/client/assets/{auth-catchall-Dwo94U32.js → auth-catchall-BZvzipnV.js} +1 -1
  63. package/dist/client/assets/{auth-entry-CsuZU0Hz.js → auth-entry-BLM6BHE1.js} +1 -1
  64. package/dist/client/assets/{auth-split-layout-HOd3Qhyr.js → auth-split-layout-CsaahkY7.js} +1 -1
  65. package/dist/client/assets/{authenticate-and-persist-oauth-BuaZSTeD.js → authenticate-and-persist-oauth-DxQqW3T-.js} +1 -1
  66. package/dist/client/assets/{automation-list-row-BuCXNsSo.js → automation-list-row-f7HB0lEO.js} +1 -1
  67. package/dist/client/assets/{automation-runs-nQ99AMoV.js → automation-runs-C0bPxXfe.js} +1 -1
  68. package/dist/client/assets/automations-CZpHalR8.js +1 -0
  69. package/dist/client/assets/{autosend-CIDdvZqc.js → autosend-pcmp17-1.js} +1 -1
  70. package/dist/client/assets/{avatar-DJpRqbqg.js → avatar-BaaCzkz5.js} +1 -1
  71. package/dist/client/assets/{badge-zT-Fh3qN.js → badge-DDX6uCig.js} +1 -1
  72. package/dist/client/assets/{block-document-2XwXLkCF.js → block-document-DivAhnA1.js} +1 -1
  73. package/dist/client/assets/{brand-context-CzRgrT9p.js → brand-context-BTW63ubn.js} +1 -1
  74. package/dist/client/assets/{buckets-BbJLX44L.js → buckets-dkoo4cSZ.js} +1 -1
  75. package/dist/client/assets/{bulk-category-panel-CAMc8JnB.js → bulk-category-panel-BKU51QgX.js} +1 -1
  76. package/dist/client/assets/{calendar-CibxNjt0.js → calendar-CtB-1ORd.js} +1 -1
  77. package/dist/client/assets/{capability-load-error-BEzrfkB_.js → capability-load-error-BQX8z6t0.js} +1 -1
  78. package/dist/client/assets/{card-CEUspnmz.js → card-zqYafqG3.js} +1 -1
  79. package/dist/client/assets/category-editor-DIxkWtHT.js +1 -0
  80. package/dist/client/assets/{chat-context-CAoh3qxf.js → chat-context-C_Qfrzll.js} +1 -1
  81. package/dist/client/assets/{checkbox-C7atZRmN.js → checkbox-D33J0J5s.js} +1 -1
  82. package/dist/client/assets/{cli-auth-success-DAwaPZJZ.js → cli-auth-success-a675Crj5.js} +1 -1
  83. package/dist/client/assets/{collection-detail-D0xuaTFw.js → collection-detail-DOr4XVAb.js} +1 -1
  84. package/dist/client/assets/{collection-display-button-WEEgaqOV.js → collection-display-button-DRpwr1d2.js} +1 -1
  85. package/dist/client/assets/{collection-search-BLJH2aa6.js → collection-search-BBYUHwp3.js} +1 -1
  86. package/dist/client/assets/{collection-table-wrapper-Bs9ViQbC.js → collection-table-wrapper-DG4oL_XO.js} +1 -1
  87. package/dist/client/assets/{collection-tabs-D10lR104.js → collection-tabs-CM7SC5Ph.js} +1 -1
  88. package/dist/client/assets/{command-Cih9cb-G.js → command-BgHIgal-.js} +1 -1
  89. package/dist/client/assets/commerce-onboarding-DEDSkHug.js +1 -0
  90. package/dist/client/assets/companions-core-BKQjoMFT.js +1 -0
  91. package/dist/client/assets/{connect-desktop-dialog-B4c48mz3.js → connect-desktop-dialog-C3MAVbqi.js} +1 -1
  92. package/dist/client/assets/{connection-card-DPw_9IvV.js → connection-card-akwzMfSt.js} +1 -1
  93. package/dist/client/assets/{connection-detail-CDG1VEQ1.js → connection-detail-CRcTfmPM.js} +1 -1
  94. package/dist/client/assets/{connection-form-helpers-svNTHB1P.js → connection-form-helpers-D-nDOfy5.js} +1 -1
  95. package/dist/client/assets/{connections-DOceib-0.js → connections-BpPH-rGd.js} +1 -1
  96. package/dist/client/assets/{decopilot-sse-pool-pi1pVqbX.js → decopilot-sse-pool-_1OoFfRR.js} +1 -1
  97. package/dist/client/assets/{dialog-BboVhzku.js → dialog-C_G4Nj_a.js} +1 -1
  98. package/dist/client/assets/{domain-settings-Dg0Enr4v.js → domain-settings-BU3PLHXT.js} +1 -1
  99. package/dist/client/assets/{drawer-D5XLtSzP.js → drawer-DIzHaW1L.js} +1 -1
  100. package/dist/client/assets/{dropdown-menu-DcV4HAvf.js → dropdown-menu-C3HeQI9N.js} +1 -1
  101. package/dist/client/assets/{empty-state-C6JrR5eZ.js → empty-state-Bn6jIdxN.js} +1 -1
  102. package/dist/client/assets/{extract-connection-data-DEmXsdA0.js → extract-connection-data-DoTSwnq5.js} +1 -1
  103. package/dist/client/assets/file-explorer-C7jnlKJt.js +2 -0
  104. package/dist/client/assets/{file-type-icon-BR1G8n26.js → file-type-icon-Chdi7BrE.js} +1 -1
  105. package/dist/client/assets/{files-uX2RLUIk.js → files-CDQzPvRQ.js} +1 -1
  106. package/dist/client/assets/{form-p6ZihW38.js → form-CqMXK7Rg.js} +1 -1
  107. package/dist/client/assets/{general-pRqMY7to.js → general-BHXdL9DJ.js} +1 -1
  108. package/dist/client/assets/github-repo-picker-iGTmhvfh.js +1 -0
  109. package/dist/client/assets/github-repo-scope-DjMZbiKa.js +1 -0
  110. package/dist/client/assets/{hooks-DYM3Q-Vq.js → hooks-B2bKZJz3.js} +1 -1
  111. package/dist/client/assets/{index-BN6_Cjv8.js → index-94TmFXEM.js} +1 -1
  112. package/dist/client/assets/{index-Bbk1PCkR.js → index-B5PgsjuZ.js} +1 -1
  113. package/dist/client/assets/{index-BEqdT-CX.js → index-BB5lA5jj.js} +3 -3
  114. package/dist/client/assets/{index-DmYBKzjc.js → index-BKb79pgL.js} +1 -1
  115. package/dist/client/assets/index-BcGQg-Kx.js +2 -0
  116. package/dist/client/assets/{index-Bnro1Vjb.js → index-Bvhurd-Z.js} +28 -28
  117. package/dist/client/assets/{index-BXTPhNSj.js → index-CuPxvnMd.js} +1 -1
  118. package/dist/client/assets/{index-BTfVRtBq.js → index-DZrgCtW9.js} +1 -1
  119. package/dist/client/assets/index-DvVn4R_K.js +1 -0
  120. package/dist/client/assets/{index-hWnZ5W-G.js → index-IeYTwdqM.js} +1 -1
  121. package/dist/client/assets/{index-S6xdCjXr.js → index-JYMtN_ka.js} +1 -1
  122. package/dist/client/assets/{index-Dz8rxMiO.js → index-OTCSzql6.js} +1 -1
  123. package/dist/client/assets/{index-B06wwOYR.js → index-nfm9K1x2.js} +1 -1
  124. package/dist/client/assets/{index-redirect-CTPXAnic.js → index-redirect-9xlH9kRG.js} +1 -1
  125. package/dist/client/assets/{index-BXfKOYdf.js → index-xN4b_CkF.js} +1 -1
  126. package/dist/client/assets/{input-CqfDyI-C.js → input-CcKrVAr2.js} +1 -1
  127. package/dist/client/assets/{integration-icon-Dhyv93zr.js → integration-icon-BFsmKVHF.js} +1 -1
  128. package/dist/client/assets/{invite-member-dialog-BhSkjT-N.js → invite-member-dialog-6XRVfRTx.js} +1 -1
  129. package/dist/client/assets/{label-DbwTUWd9.js → label-CW15sZLz.js} +1 -1
  130. package/dist/client/assets/{layout-BBgXJHVj.js → layout-C1yYJmDo.js} +1 -1
  131. package/dist/client/assets/{login-Ml29AK4n.js → login-B35xc8Gt.js} +1 -1
  132. package/dist/client/assets/{mcp-oauth-CeGeftbL.js → mcp-oauth-Bx9msuxY.js} +1 -1
  133. package/dist/client/assets/{members-D5IT4H1V.js → members-CtdxOI6T.js} +1 -1
  134. package/dist/client/assets/{monaco-editor-YwujFe9g.js → monaco-editor-tITHyCTj.js} +1 -1
  135. package/dist/client/assets/{monitoring-stats-row-CQqHLPvk.js → monitoring-stats-row-5NJQerF_.js} +1 -1
  136. package/dist/client/assets/{multi-select-B1FaaLCf.js → multi-select-DjU5xocW.js} +1 -1
  137. package/dist/client/assets/{oauth-callback-B-ebprV-.js → oauth-callback-DMSxm1aa.js} +1 -1
  138. package/dist/client/assets/{oauth-callback-ai-provider-DPqgkHzz.js → oauth-callback-ai-provider-DNKUFr1T.js} +1 -1
  139. package/dist/client/assets/{onboarding-3CEMDgie.js → onboarding-DhudMezE.js} +1 -1
  140. package/dist/client/assets/{org-install-C-mvhkMd.js → org-install-BI6Tqb8M.js} +1 -1
  141. package/dist/client/assets/{org-layout-CXafMRKl.js → org-layout-BzM8m0Yo.js} +1 -1
  142. package/dist/client/assets/{organization-choice-D3k9ZPpO.js → organization-choice-CLoSaGiq.js} +1 -1
  143. package/dist/client/assets/{orgs-Xyph7dZi.js → orgs-BXyQQf2t.js} +1 -1
  144. package/dist/client/assets/{page-seo-form-55rMBIi9.js → page-seo-form-b_KQgaAh.js} +1 -1
  145. package/dist/client/assets/page-seo-sheet-ClLCRUIN.js +1 -0
  146. package/dist/client/assets/{popover-BJYBT3EY.js → popover-BhnGTRIN.js} +1 -1
  147. package/dist/client/assets/post-editor-BftvN04C.js +1 -0
  148. package/dist/client/assets/{primitives-QqbAbc1Q.js → primitives-ueS43w85.js} +1 -1
  149. package/dist/client/assets/{profile-CgJpwyXB.js → profile-BQf3SBqt.js} +1 -1
  150. package/dist/client/assets/project-app-view-DjP2PmND.js +1 -0
  151. package/dist/client/assets/provision-repo-scoped-github-connection-2iDn-wQ1.js +1 -0
  152. package/dist/client/assets/record-editor-Du8LTIQ8.js +1 -0
  153. package/dist/client/assets/redirect-editor-CZu9GWo3.js +1 -0
  154. package/dist/client/assets/registry-g2WwGfcO.js +2 -0
  155. package/dist/client/assets/{registry-layout-qd98OrCw.js → registry-layout-DupWO7LC.js} +1 -1
  156. package/dist/client/assets/{reports-Don6tc4i.js → reports-BlIjKH8H.js} +1 -1
  157. package/dist/client/assets/{require-capability-9_BT8d0_.js → require-capability-D7ZefDTd.js} +1 -1
  158. package/dist/client/assets/{required-auth-layout-BXaZVxWQ.js → required-auth-layout-COJ1HesY.js} +1 -1
  159. package/dist/client/assets/{reset-password-BTQg39kb.js → reset-password-ByTmxDaH.js} +1 -1
  160. package/dist/client/assets/{roles-CMByu1Mi.js → roles-Cgr1guoV.js} +1 -1
  161. package/dist/client/assets/{search-input-CYwO2ZSV.js → search-input-IdLCT-wl.js} +1 -1
  162. package/dist/client/assets/{secrets-BHEJh0I9.js → secrets-DF0jWkhd.js} +1 -1
  163. package/dist/client/assets/{sections-editor-BjlPsEWB.js → sections-editor-Br2ZrjF9.js} +2 -2
  164. package/dist/client/assets/{select-Bh2Z8rK3.js → select-BDKopoZs.js} +1 -1
  165. package/dist/client/assets/{select-model-BHB_Fir_.js → select-model-DQ3GcF2Q.js} +1 -1
  166. package/dist/client/assets/{self-tool-result-BkP7cEqy.js → self-tool-result-Dehaso5-.js} +1 -1
  167. package/dist/client/assets/seo-editor-DxU1V_q7.js +1 -0
  168. package/dist/client/assets/{settings-layout-DX2Oqcs9.js → settings-layout-BTr-31q1.js} +1 -1
  169. package/dist/client/assets/{settings-section-HiisdE7T.js → settings-section-Bs2y0W38.js} +1 -1
  170. package/dist/client/assets/{shell-controls-Dsv9TiVE.js → shell-controls-BNwC-U3m.js} +1 -1
  171. package/dist/client/assets/{shell-layout-CcPRSmgX.js → shell-layout-DBwpg5fa.js} +1 -1
  172. package/dist/client/assets/{sidebar-CRtkHPvX.js → sidebar-BiKcuUlz.js} +1 -1
  173. package/dist/client/assets/{skeleton-C-LbiBGP.js → skeleton-DO-zgL8S.js} +1 -1
  174. package/dist/client/assets/{sso-CHr6NXev.js → sso-BVw4m6Is.js} +1 -1
  175. package/dist/client/assets/{store-CJu8MR_n.js → store-BBq6XldJ.js} +1 -1
  176. package/dist/client/assets/store-registry-BIIvqrwe.js +2 -0
  177. package/dist/client/assets/{studio-tools-Cdt3UzXo.js → studio-tools-QgTnVt0y.js} +1 -1
  178. package/dist/client/assets/{switch-BL8XQR8K.js → switch-7KE_HjZk.js} +1 -1
  179. package/dist/client/assets/{table-VOE9WRkg.js → table-C23nDXu-.js} +1 -1
  180. package/dist/client/assets/{tabs-DPmfTv0c.js → tabs-B0oOCjef.js} +1 -1
  181. package/dist/client/assets/{textarea-B9g6Z2-r.js → textarea-D3iFRZ9o.js} +1 -1
  182. package/dist/client/assets/{toggle-group-BnuMLJr8.js → toggle-group-MA_94m4S.js} +1 -1
  183. package/dist/client/assets/{toolbar-icon-button-BBh2Csxi.js → toolbar-icon-button-Be0Xxrx6.js} +1 -1
  184. package/dist/client/assets/{toolbar-65iromlk.js → toolbar-w5KxuBt-.js} +1 -1
  185. package/dist/client/assets/{tooltip-C7c-Tgru.js → tooltip-LRHFL41r.js} +1 -1
  186. package/dist/client/assets/{use-ai-providers-C7iVrgY-.js → use-ai-providers-BeYG-EjG.js} +1 -1
  187. package/dist/client/assets/{use-automations-CELpHT79.js → use-automations-CAUzSd8j.js} +1 -1
  188. package/dist/client/assets/{use-autosave-B1tnyn5H.js → use-autosave-C6ffzJDR.js} +1 -1
  189. package/dist/client/assets/{use-capability-DsC1r5oD.js → use-capability-Dch03R8X.js} +1 -1
  190. package/dist/client/assets/{use-clock-tick-F8Oybd0p.js → use-clock-tick-CVibzfL9.js} +1 -1
  191. package/dist/client/assets/{use-collections-Dy7WD_eH.js → use-collections-D9omaJJu.js} +1 -1
  192. package/dist/client/assets/{use-connection-DUpx0NEA.js → use-connection-hO51hV8J.js} +1 -1
  193. package/dist/client/assets/{use-copy-C0FUXmsm.js → use-copy-tGW1Vaes.js} +1 -1
  194. package/dist/client/assets/{use-create-virtual-mcp-Bbp45Sum.js → use-create-virtual-mcp-CdWTTl06.js} +1 -1
  195. package/dist/client/assets/{use-debounced-autosave-IEMI4Muz.js → use-debounced-autosave-cTAMJ-st.js} +1 -1
  196. package/dist/client/assets/{use-debounced-value-BqHYI-kn.js → use-debounced-value-C8BZDtz1.js} +1 -1
  197. package/dist/client/assets/{use-deco-credits-56-eyw-E.js → use-deco-credits-D8dtxTPg.js} +1 -1
  198. package/dist/client/assets/{use-decopilot-events-btxE-D2k.js → use-decopilot-events-4o9NNSez.js} +1 -1
  199. package/dist/client/assets/{use-delete-connection-BCTMhr9Z.js → use-delete-connection-BqJkmcK6.js} +1 -1
  200. package/dist/client/assets/{use-deployment-admin-D9-LjGCb.js → use-deployment-admin-D_HkirOy.js} +1 -1
  201. package/dist/client/assets/{use-file-configs-CYmkQ98g.js → use-file-configs-CZiarNuS.js} +1 -1
  202. package/dist/client/assets/{use-infinite-scroll-DYbbFqLK.js → use-infinite-scroll-DgcSj6JD.js} +1 -1
  203. package/dist/client/assets/{use-join-requests-DZ4YwkLh.js → use-join-requests-BqCHI8Zj.js} +1 -1
  204. package/dist/client/assets/{use-mcp-auth-status-Dy_Y2kKR.js → use-mcp-auth-status-CLsbHDCg.js} +1 -1
  205. package/dist/client/assets/{use-mcp-client-DvvHwezb.js → use-mcp-client-W9fEi0Ml.js} +1 -1
  206. package/dist/client/assets/{use-mcp-tools-Be4djRS3.js → use-mcp-tools-uwmJZn0p.js} +1 -1
  207. package/dist/client/assets/{use-members-BZPSqMOT.js → use-members-B6EJ964p.js} +1 -1
  208. package/dist/client/assets/{use-mobile-DbBFg2WD.js → use-mobile-BQOMgKS3.js} +1 -1
  209. package/dist/client/assets/{use-navigate-to-agent-CBi1-FBB.js → use-navigate-to-agent-DqqHYLVD.js} +1 -1
  210. package/dist/client/assets/{use-org-auth-client-PHOIKqSH.js → use-org-auth-client-Y5-GC6qM.js} +1 -1
  211. package/dist/client/assets/{use-org-sso-BA_UxewI.js → use-org-sso-Dqg59TFA.js} +1 -1
  212. package/dist/client/assets/{use-organization-roles-DDd0H73X.js → use-organization-roles-CeuO8sTI.js} +1 -1
  213. package/dist/client/assets/{use-organization-settings-CpbybQHD.js → use-organization-settings-CQJ8RPRh.js} +1 -1
  214. package/dist/client/assets/use-registry-app-DVOJoUv5.js +1 -0
  215. package/dist/client/assets/{use-registry-connections-CX_dlku1.js → use-registry-connections-DdQfbjwO.js} +1 -1
  216. package/dist/client/assets/{use-secrets-ChIMRFxc.js → use-secrets-CIsNwBX2.js} +1 -1
  217. package/dist/client/assets/{use-status-sounds-BrRSDeZW.js → use-status-sounds-DFGyya-5.js} +1 -1
  218. package/dist/client/assets/{use-view-mode-C9HP0iNa.js → use-view-mode-DJMiJaWa.js} +1 -1
  219. package/dist/client/assets/{use-virtual-mcp-CNKe_WaY.js → use-virtual-mcp-DpSXhS0n.js} +1 -1
  220. package/dist/client/assets/useInfiniteQuery-CyvFYQl8.js +1 -0
  221. package/dist/client/assets/{useRouterState-Bq6lDwd7.js → useRouterState-DpJ4EK7e.js} +1 -1
  222. package/dist/client/assets/useSuspenseInfiniteQuery-C33XLke-.js +1 -0
  223. package/dist/client/assets/{users-DMEyTKsO.js → users-EWx6DB7t.js} +1 -1
  224. package/dist/client/assets/{variant-calendar-CYVo9qj3.js → variant-calendar-DchPOrHH.js} +1 -1
  225. package/dist/client/assets/{view-mode-toggle-CyQ3mWd3.js → view-mode-toggle-hMQMe6tZ.js} +1 -1
  226. package/dist/client/index.html +1 -1
  227. package/dist/server/cli.js +1 -1
  228. package/dist/server/server.js +1 -1
  229. package/package.json +1 -1
  230. package/dist/client/assets/agents-list-DZ3h25ic.js +0 -1
  231. package/dist/client/assets/app-editor-Be08LQCr.js +0 -1
  232. package/dist/client/assets/automations-DB43wI7K.js +0 -1
  233. package/dist/client/assets/category-editor-DSqWbwsH.js +0 -1
  234. package/dist/client/assets/commerce-onboarding-OnAQudmo.js +0 -1
  235. package/dist/client/assets/companions-core-Zwoux9HO.js +0 -1
  236. package/dist/client/assets/file-explorer-LHYs3ZjT.js +0 -2
  237. package/dist/client/assets/github-repo-picker-B_QoRL-b.js +0 -1
  238. package/dist/client/assets/index-BoB4jtNg.js +0 -1
  239. package/dist/client/assets/index-CbMrlBFr.js +0 -2
  240. package/dist/client/assets/page-seo-sheet-D7RIqvrG.js +0 -1
  241. package/dist/client/assets/post-editor-DLBj2cKN.js +0 -1
  242. package/dist/client/assets/project-app-view-9_icLawb.js +0 -1
  243. package/dist/client/assets/provision-repo-scoped-github-connection-CB4ICKHq.js +0 -1
  244. package/dist/client/assets/record-editor-oee2Qj_I.js +0 -1
  245. package/dist/client/assets/redirect-editor-BtYgxzY9.js +0 -1
  246. package/dist/client/assets/registry-Dl1tv9V3.js +0 -2
  247. package/dist/client/assets/seo-editor-DwFM6IEi.js +0 -1
  248. package/dist/client/assets/store-registry-EZCYrXqX.js +0 -2
  249. package/dist/client/assets/useInfiniteQuery-BnNR1NVs.js +0 -1
  250. package/dist/client/assets/useSuspenseInfiniteQuery-3QrNhYz_.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "decocms",
3
- "version": "4.77.3",
3
+ "version": "4.78.0",
4
4
  "description": "Deco CMS — Self-hostable MCP Gateway for managing AI connections and tools",
5
5
  "author": "Deco team",
6
6
  "repository": {
@@ -1 +0,0 @@
1
- import{c as ie,j as s,B as J,C as ce,n as fe,a as he,r as K,m as ge,K as ee,d as xe,p as $,t as te,l as je}from"./index-BEqdT-CX.js";import{d as Y,c as de,a as se,D as oe}from"./dropdown-menu-DcV4HAvf.js";import{a as be}from"./Users03-Iz-TpUuJ.js";import{a as me,b as Ce,G as ye}from"./github-repo-picker-B_QoRL-b.js";import{u as we,b as _e,c as Ne}from"./use-virtual-mcp-CNKe_WaY.js";import{P as X}from"./index-BXTPhNSj.js";import{i as Se}from"./DotsVertical-BFfMlorx.js";import{a as ve,b as Ie}from"./Settings02-D5c8FtUa.js";import{s as De}from"./Trash01-DZTkGJqE.js";import{A as Ae,aw as Ee}from"./agent-icon-jdj2JAEm.js";import{c as ue}from"./use-navigate-to-agent-CBi1-FBB.js";import{C as Te}from"./card-CEUspnmz.js";import{f as ne}from"./formatDistanceToNow-Cb2QZZJn.js";import{u as ke}from"./use-capability-DsC1r5oD.js";import{E as Le}from"./empty-state-C6JrR5eZ.js";import{u as Ge}from"./use-create-virtual-mcp-Bbp45Sum.js";import{u as Oe}from"./use-connection-DUpx0NEA.js";import{u as re}from"./use-mcp-client-DvvHwezb.js";import{S as Pe}from"./constants-D_FQAPnt.js";import{g as ze,f as Me,a as $e,p as He}from"./provision-repo-scoped-github-connection-CB4ICKHq.js";import{e as Fe,d as Re,D as Ue,a as Be,c as Ve}from"./dialog-BboVhzku.js";import{C as Ke}from"./collection-search-BLJH2aa6.js";import{c as qe,b as Qe,d as Je,A as We,e as Ye,g as Xe,a as Ze,f as et}from"./alert-dialog-DtmlB9JL.js";import{S as tt}from"./search-input-CYwO2ZSV.js";import{s as le}from"./Plus-C8FiAr3i.js";import"./Check-BAiULwRg.js";import"./ChevronRight-UlscOqp6.js";import"./Circle-pOPoWDQn.js";import"./use-debounced-value-BqHYI-kn.js";import"./authenticate-and-persist-oauth-BuaZSTeD.js";import"./mcp-oauth-CeGeftbL.js";import"./auth-BR_fNNK7.js";import"./use-mcp-tools-Be4djRS3.js";import"./extract-connection-data-DEmXsdA0.js";import"./use-collections-Dy7WD_eH.js";import"./sidebar-CRtkHPvX.js";import"./LayoutLeft-CNWN8tpf.js";import"./use-mobile-DbBFg2WD.js";import"./X-CTTK5Zj2.js";import"./tooltip-C7c-Tgru.js";import"./AlertCircle-DFFB807G.js";import"./UserPlus01-DjFNU1Mn.js";import"./Tool01-CSravChF.js";import"./ArrowUp-CFU7eduC.js";import"./Tool02-csu1mOp1.js";import"./XCircle-CiVL5z-e.js";import"./ArrowUpRight-D37SsWBk.js";import"./TrendUp01-Dw2DNRxA.js";import"./ZapSquare-BDp8YrcS.js";import"./ZoomOut-CvmU5uj5.js";import"./CheckCircle-BwwAyNzV.js";import"./ChevronDown-Cpk84lU5.js";import"./ChevronUp-CqCnswy_.js";import"./Stars02-CzKVb8lE.js";import"./Copy01-BEB5hDKQ.js";import"./Globe01-DVm51A__.js";import"./Eye-Bbh_ejV6.js";import"./FilterLines-Dm0WP1zI.js";import"./Flag01-e55mynPF.js";import"./Star01-C32-NjaL.js";import"./Globe04-DA8QsMrW.js";import"./SwitchHorizontal01-C8Rnw5uG.js";import"./HardDrive-BJ2MS6we.js";import"./Image01-Y4d3ZI2r.js";import"./Key01-xPUeBTf6.js";import"./LinkExternal01-B6bTrNoI.js";import"./List-gTaMGV9z.js";import"./Monitor01-BdI_dCjX.js";import"./Sun-BPhwV-Eh.js";import"./Package-WlP_SelV.js";import"./Palette-DwivsXKp.js";import"./Play-BPQdBfbt.js";import"./SearchLg-CMWIHllt.js";import"./SearchMd-Gwm-384G.js";import"./Shield01-Dn6encQp.js";import"./Stars01-C8WemEnv.js";import"./Upload01-s2ES1URH.js";import"./User01-D0_zDlJM.js";import"./Users01-CAC4FOXB.js";import"./XClose-DxMKQUUD.js";import"./Zap-CrYnUVJy.js";import"./hooks-DYM3Q-Vq.js";import"./decopilot-sse-pool-pi1pVqbX.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./differenceInSeconds-NQ4PDo0z.js";function ae(t){const e=ie.c(19),{onCreateFromScratch:i,onImportGitHub:n,onImportDeco:l,isCreating:b,align:C,side:d,showBetaBadge:g}=t,y=C===void 0?"end":C;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(be,{size:14}),e[0]=x):x=e[0];let m;e[1]!==b||e[2]!==i?(m=s.jsxs(Y,{disabled:b,onClick:i,children:[x,"Create from scratch"]}),e[1]=b,e[2]=i,e[3]=m):m=e[3];let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(me,{className:"size-3.5"}),e[4]=f):f=e[4];let a;e[5]!==g?(a=g&&s.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[5]=g,e[6]=a):a=e[6];let h;e[7]!==n||e[8]!==a?(h=s.jsxs(Y,{onClick:n,children:[f,"Import from GitHub",a]}),e[7]=n,e[8]=a,e[9]=h):h=e[9];let c;e[10]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[10]=c):c=e[10];let r;e[11]!==l?(r=s.jsxs(Y,{onClick:l,children:[c,"Import from deco.cx"]}),e[11]=l,e[12]=r):r=e[12];let u;return e[13]!==y||e[14]!==d||e[15]!==m||e[16]!==h||e[17]!==r?(u=s.jsxs(de,{side:d,align:y,className:"w-48",children:[m,h,r]}),e[13]=y,e[14]=d,e[15]=m,e[16]=h,e[17]=r,e[18]=u):u=e[18],u}function st(t){const e=ie.c(45),{project:i,lastUsedAt:n,onDeleteClick:l}=t,b=ue();let C;e[0]!==b||e[1]!==i.id?(C=()=>b(i.id),e[0]=b,e[1]=i.id,e[2]=C):C=e[2];let d;e[3]!==i.title||e[4]!==C?(d=s.jsx("button",{type:"button",onClick:C,className:"absolute inset-0 z-0","aria-label":i.title}),e[3]=i.title,e[4]=C,e[5]=d):d=e[5];let g;e[6]!==i.icon||e[7]!==i.title?(g=s.jsx(Ae,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),e[6]=i.icon,e[7]=i.title,e[8]=g):g=e[8];let y;e[9]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(se,{asChild:!0,children:s.jsx(J,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:s.jsx(Se,{size:20})})}),e[9]=y):y=e[9];let x;e[10]!==b||e[11]!==i.id?(x=()=>b(i.id,{search:{main:"settings"}}),e[10]=b,e[11]=i.id,e[12]=x):x=e[12];let m;e[13]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(ve,{size:16}),e[13]=m):m=e[13];let f;e[14]!==x?(f=s.jsxs(Y,{onClick:x,children:[m,"Settings"]}),e[14]=x,e[15]=f):f=e[15];let a;e[16]!==l?(a=l&&s.jsxs(Y,{variant:"destructive",onClick:L=>{L.stopPropagation(),l(L)},children:[s.jsx(De,{size:16}),"Delete"]}),e[16]=l,e[17]=a):a=e[17];let h;e[18]!==f||e[19]!==a?(h=s.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:s.jsxs(oe,{children:[y,s.jsxs(de,{align:"end",children:[f,a]})]})}),e[18]=f,e[19]=a,e[20]=h):h=e[20];let c;e[21]!==g||e[22]!==h?(c=s.jsxs("div",{className:"flex items-start justify-between",children:[g,h]}),e[21]=g,e[22]=h,e[23]=c):c=e[23];let r;e[24]!==i.title?(r=s.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[24]=i.title,e[25]=r):r=e[25];const u=i.description||"No description";let I;e[26]!==u?(I=s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:u}),e[26]=u,e[27]=I):I=e[27];let D;e[28]!==r||e[29]!==I?(D=s.jsxs("div",{className:"flex flex-col gap-1",children:[r,I]}),e[28]=r,e[29]=I,e[30]=D):D=e[30];let w;e[31]!==c||e[32]!==D?(w=s.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[c,D]}),e[31]=c,e[32]=D,e[33]=w):w=e[33];let E;e[34]!==n||e[35]!==i.updated_at?(E=n?`Last used ${ne(new Date(n),{addSuffix:!0})}`:`Updated ${ne(new Date(i.updated_at),{addSuffix:!0})}`,e[34]=n,e[35]=i.updated_at,e[36]=E):E=e[36];let N;e[37]!==E?(N=s.jsx("div",{className:"border-t border-border mt-auto",children:s.jsx("div",{className:"h-10 flex items-center px-4.5",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:E})})}),e[37]=E,e[38]=N):N=e[38];let T;e[39]!==w||e[40]!==N?(T=s.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[w,N]}),e[39]=w,e[40]=N,e[41]=T):T=e[41];let S;return e[42]!==T||e[43]!==d?(S=s.jsxs(Te,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[d,T]}),e[42]=T,e[43]=d,e[44]=S):S=e[44],S}const ot="deco-sites";function it(t){if(!t||typeof t!="object")return null;const e=t.github;if(!e||typeof e!="object")return null;const i=e.owner,n=e.repo;return typeof i!="string"||typeof n!="string"||i.length===0||n.length===0?null:{owner:i,repo:n}}function nt(t,e){const i=e?it(e):null,n=i?.owner??ot,l=i?.repo??t;return{owner:n,name:l,url:`https://github.com/${n}/${l}`}}function rt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function pe(t,e,i){const n=await fetch(t,e),l=await n.json().catch(()=>({}));if(!n.ok)throw new Error(l.error??`${i} (${n.status})`);return l}function lt(t){return pe(`/api/${t}/deco-sites`,void 0,"Failed to load sites")}function at({open:t,onOpenChange:e,onBack:i}){const{org:n}=ce(),l=ue(),b=fe(),{data:C}=he.useSession(),[d,g]=K.useState(null),[y,x]=K.useState(null),[m,f]=K.useState(""),a=re({connectionId:Pe,orgId:n.id,orgSlug:n.slug}),h=Oe({slug:"mcp-github"}),c=ze(h),r=Ce({enabled:t&&c.length===0}),u=c.length===1?c[0]??null:y,I=c.length>1&&!u,D=re({connectionId:u?.id??"",orgId:n.id,orgSlug:n.slug}),w=t&&c.length===0&&(r.status==="installing"||r.status==="authenticating"||r.status==="idle"),{data:E,isLoading:N,error:T}=ge({queryKey:ee.decoSites(C?.user?.email),queryFn:()=>lt(n.slug),enabled:t&&!!C?.user?.email,staleTime:6e4,retry:!1}),S=E?.sites??[],L=o=>{o||(g(null),x(null),f("")),e(o)},P=S.filter(o=>o.name.toLowerCase().includes(m.toLowerCase())||(o.domains?.[0]?.domain?.toLowerCase().includes(m.toLowerCase())??!1)),R=!d||P.some(o=>o.name===d),G=xe({mutationFn:async o=>{if(!u)throw new Error("GitHub is not connected. Complete GitHub setup and try again.");$("deco_site_import_started",{site_name:o});const{installations:k,appSlug:v}=await Me(_=>a.callTool(_),u.id),A=S.find(_=>_.name===o);if(!A)throw new Error("Selected site is no longer available");const j=nt(o,A.metadata),z=$e(k,j.owner);if(!z){const _=v?`https://github.com/apps/${v}/installations/new`:"https://github.com/settings/installations";throw new Error(`Install the GitHub App on the "${j.owner}" organization to import this site. ${_}`)}let V=null,U=null,B=null;const W=async()=>{B&&await a.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:B}}).catch(()=>{}),U&&await a.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:U,force:!0}}).catch(()=>{}),V&&await a.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:V,force:!0}}).catch(()=>{})};try{const _=await pe(`/api/${n.slug}/deco-sites/connection`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:o})},"Failed to create connection"),O=_.connId;if(!O)throw new Error("Server did not return a connection ID");V=O;const{childConnectionId:M}=await He({orgSlug:n.slug,sourceConnection:u,installationId:z.installationId,owner:j.owner,repo:j.name,githubCallTool:Z=>D.callTool(Z),selfCallTool:Z=>a.callTool(Z)});U=M;const H=_.icon??null,F=rt(o),q=o.toLowerCase(),p=await a.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:o,description:"Imported from deco.cx",pinned:!1,icon:H??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],siteSlug:q,githubRepo:{owner:j.owner,name:j.name,url:j.url,installationId:z.installationId,connectionId:M},ui:{banner:null,bannerColor:"#22C55E",icon:H,themeColor:"#22C55E",slug:F,pinnedViews:[{connectionId:O,toolName:"fetch_assets",label:"Assets",icon:null},{connectionId:O,toolName:"get_monitor_data",label:"Monitor",icon:null}],layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:O},{connection_id:M}]}}}),Q=p.structuredContent??p;if(!Q.item?.id)throw new Error("Failed to create the imported agent");return B=Q.item.id,{slug:F,virtualMcpId:Q.item.id,connId:O,item:Q.item}}catch(_){throw await W(),_}},onSuccess:({slug:o,virtualMcpId:k,item:v})=>{$("deco_site_import_succeeded",{site_name:v.title,virtual_mcp_id:k,slug:o}),b.setQueryData(ee.collectionItem(a,n.id,"","VIRTUAL_MCP",k),{item:v}),b.invalidateQueries({predicate:A=>{const j=A.queryKey;return j[1]===n.id&&j[3]==="collection"&&j[4]==="VIRTUAL_MCP"}}),b.invalidateQueries({queryKey:ee.projects(n.id)}),te.success(`Imported ${o} from deco.cx`),L(!1),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),l(k)},onError:o=>{$("deco_site_import_failed",{error:o instanceof Error?o.message:"Unknown error"}),te.error("Import failed: "+(o instanceof Error?o.message:"Unknown error"))}});return s.jsx(Fe,{open:t,onOpenChange:L,children:s.jsxs(Re,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[s.jsx(Ue,{className:"sr-only",children:s.jsx(Be,{children:"Import from deco.cx"})}),s.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[i&&s.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":"Go back",children:s.jsx(Ie,{size:18})}),s.jsx("span",{className:"text-sm font-medium text-foreground",children:"Import from deco.cx"})]}),s.jsx("div",{children:s.jsx(Ke,{value:m,onChange:f,placeholder:"Search sites...",onKeyDown:o=>{o.key==="Escape"&&f("")}})}),s.jsxs("div",{className:"pb-0 min-h-[300px]",children:[r.status==="error"&&s.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 h-48 px-8 text-center",children:[s.jsx("p",{className:"text-sm text-destructive",children:r.error??"Failed to connect GitHub"}),s.jsx(J,{variant:"outline",size:"sm",onClick:r.retry,children:"Retry GitHub setup"})]}),w&&r.status!=="error"&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Setting up GitHub connection..."}),I&&!w&&r.status!=="error"&&s.jsxs("div",{className:"flex flex-col py-2",children:[s.jsx("div",{className:"px-8 py-2",children:s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Select a GitHub connection"})}),c.map(o=>s.jsxs("button",{type:"button",onClick:()=>x(o),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[o.icon?s.jsx("img",{src:o.icon,alt:o.title,className:"size-7 rounded-full shrink-0"}):s.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:s.jsx(me,{className:"size-3.5 text-muted-foreground"})}),s.jsx("span",{className:"text-sm font-medium",children:o.title})]},o.id))]}),N&&!w&&r.status!=="error"&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Loading sites..."}),!N&&!w&&!I&&r.status!=="error"&&!T&&S.length===0&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"No sites found for this account."}),!N&&!w&&!I&&r.status!=="error"&&S.length>0&&s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-h-[420px] overflow-y-auto py-4 px-8 [scrollbar-gutter:stable]",children:[P.length===0&&s.jsxs("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:["No sites match “",m,"”"]}),P.map(o=>{const k=o.domains?.find(A=>A.production)?.domain??o.domains?.[0]?.domain,v=d===o.name;return s.jsxs("button",{type:"button",onClick:()=>g(o.name),className:je("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",v?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[s.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:o.thumb_url?s.jsx("img",{src:o.thumb_url,alt:o.name,className:"w-full h-full object-cover",loading:"lazy"}):s.jsx("div",{className:"w-full h-full bg-muted"})}),s.jsxs("div",{className:"px-4 py-3",children:[s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:o.name}),k&&s.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:k})]})]},o.name)})]})]}),s.jsxs(Ve,{className:"px-8 py-5 border-t border-border",children:[s.jsx(J,{variant:"outline",onClick:()=>L(!1),disabled:G.isPending,children:"Cancel"}),s.jsx(J,{disabled:!d||!R||G.isPending||N||w||I||!u||r.status==="error",onClick:()=>d&&G.mutate(d),children:G.isPending?"Importing...":"Import"})]})]})})}function Us(){const t=ie.c(46),{org:e}=ce(),i=we(),n=_e(),[l,b]=K.useState("");let C;t[0]===Symbol.for("react.memo_cache_sentinel")?(C={navigateOnCreate:!0},t[0]=C):C=t[0];const{createVirtualMCP:d,isCreating:g}=Ge(C),[y,x]=K.useState(null),[m,f]=K.useState(!1),[a,h]=K.useState(!1),{granted:c}=ke("agents:manage"),r=l.toLowerCase(),u=i.filter(p=>p.id!==e.id&&(p.title.toLowerCase().includes(r)||p.description?.toLowerCase().includes(r))),{data:I}=Ne(u.map(ct));let D;t[1]!==n||t[2]!==y?(D=async()=>{if(!y)return;const{id:p,title:Q}=y;x(null);try{await n.delete.mutateAsync(p),$("agent_deleted",{agent_id:p,source:"agents_list"}),te.success(`Deleted "${Q}"`)}catch{}},t[1]=n,t[2]=y,t[3]=D):D=t[3];const w=D,E=X,N=X,T=X;let S;t[4]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(X.Title,{children:"Agents"}),t[4]=S):S=t[4];let L;t[5]===Symbol.for("react.memo_cache_sentinel")?(L=p=>{p.key==="Escape"&&(b(""),p.target.blur())},t[5]=L):L=t[5];let P;t[6]!==l?(P=s.jsx(tt,{value:l,onChange:b,placeholder:"Search for an agent...",className:"w-full md:w-[375px]",onKeyDown:L}),t[6]=l,t[7]=P):P=t[7];let R;t[8]!==c||t[9]!==d||t[10]!==g?(R=c&&s.jsxs(oe,{children:[s.jsx(se,{asChild:!0,children:s.jsxs(J,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{$("agent_create_clicked",{source:"agents_list",method:"scratch"}),d()},onImportGitHub:()=>{$("agent_create_clicked",{source:"agents_list",method:"github"}),h(!0)},onImportDeco:()=>{$("agent_create_clicked",{source:"agents_list",method:"deco"}),f(!0)},isCreating:g,align:"end"})]}),t[8]=c,t[9]=d,t[10]=g,t[11]=R):R=t[11];let G;t[12]!==P||t[13]!==R?(G=s.jsxs("div",{className:"flex flex-col gap-6",children:[S,s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[P,R]})]}),t[12]=P,t[13]=R,t[14]=G):G=t[14];const o=u.length===0&&s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Le,{image:s.jsx(Ee,{size:48,className:"text-muted-foreground"}),title:l?"No agents found":"No agents yet",description:l?`No agents match "${l}"`:c?"Create an agent to get started.":"Ask an organization admin to create one.",actions:!l&&c&&s.jsxs(oe,{children:[s.jsx(se,{asChild:!0,children:s.jsxs(J,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{$("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),d()},onImportGitHub:()=>{$("agent_create_clicked",{source:"agents_list_empty",method:"github"}),h(!0)},onImportDeco:()=>{$("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),f(!0)},isCreating:g,align:"center",showBetaBadge:!0})]})})}),k=u.length>0&&s.jsxs("div",{className:"mt-6 @container",children:[s.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:"Agents"}),s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:u.map(p=>s.jsx(st,{project:p,lastUsedAt:I?.get(p.id)?.last_used_at,onDeleteClick:c?()=>x({id:p.id,title:p.title}):void 0},p.id))})]});let v;t[15]!==k||t[16]!==T.Body||t[17]!==G||t[18]!==o?(v=s.jsxs(T.Body,{children:[G,o,k]}),t[15]=k,t[16]=T.Body,t[17]=G,t[18]=o,t[19]=v):v=t[19];let A;t[20]!==v||t[21]!==N.Content?(A=s.jsx(N.Content,{children:v}),t[20]=v,t[21]=N.Content,t[22]=A):A=t[22];let j;t[23]!==a?(j=s.jsx(ye,{open:a,onOpenChange:h}),t[23]=a,t[24]=j):j=t[24];let z;t[25]!==m?(z=s.jsx(at,{open:m,onOpenChange:f}),t[25]=m,t[26]=z):z=t[26];const V=!!y;let U;t[27]===Symbol.for("react.memo_cache_sentinel")?(U=p=>!p&&x(null),t[27]=U):U=t[27];let B;t[28]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(qe,{children:"Delete Agent?"}),t[28]=B):B=t[28];const W=y?.title;let _;t[29]!==W?(_=s.jsxs(Qe,{children:[B,s.jsxs(Je,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:W}),"."]})]}),t[29]=W,t[30]=_):_=t[30];let O;t[31]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(We,{children:"Cancel"}),t[31]=O):O=t[31];let M;t[32]!==w?(M=s.jsxs(Ye,{children:[O,s.jsx(Xe,{onClick:w,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[32]=w,t[33]=M):M=t[33];let H;t[34]!==_||t[35]!==M?(H=s.jsxs(Ze,{children:[_,M]}),t[34]=_,t[35]=M,t[36]=H):H=t[36];let F;t[37]!==V||t[38]!==H?(F=s.jsx(et,{open:V,onOpenChange:U,children:H}),t[37]=V,t[38]=H,t[39]=F):F=t[39];let q;return t[40]!==E||t[41]!==A||t[42]!==j||t[43]!==z||t[44]!==F?(q=s.jsxs(E,{children:[A,j,z,F]}),t[40]=E,t[41]=A,t[42]=j,t[43]=z,t[44]=F,t[45]=q):q=t[45],q}function ct(t){return t.id}export{Us as default};
@@ -1 +0,0 @@
1
- import{c as gt,r as w,j as o,l as yt,t as ut,i as St}from"./index-BEqdT-CX.js";import{i as jt}from"./ChevronRight-UlscOqp6.js";import{A as kt}from"./automation-runs-nQ99AMoV.js";import{A as _t}from"./add-section-modal-BUwFQaqb.js";import{n as Bt,h as wt,j as At,e as Nt,k as Rt,l as Ct,m as Et,o as Kt,S as Tt}from"./index-Bnro1Vjb.js";import"./select-Bh2Z8rK3.js";import"./tooltip-C7c-Tgru.js";import"./Check-BAiULwRg.js";import"./ChevronDown-Cpk84lU5.js";import"./ChevronUp-CqCnswy_.js";import"./useInfiniteQuery-BnNR1NVs.js";import"./use-infinite-scroll-DYbbFqLK.js";import"./use-connection-DUpx0NEA.js";import"./use-collections-Dy7WD_eH.js";import"./use-mcp-client-DvvHwezb.js";import"./constants-D_FQAPnt.js";import"./auth-BR_fNNK7.js";import"./use-virtual-mcp-CNKe_WaY.js";import"./card-CEUspnmz.js";import"./sidebar-CRtkHPvX.js";import"./LayoutLeft-CNWN8tpf.js";import"./use-mobile-DbBFg2WD.js";import"./X-CTTK5Zj2.js";import"./table-VOE9WRkg.js";import"./empty-state-C6JrR5eZ.js";import"./use-members-BZPSqMOT.js";import"./use-org-auth-client-PHOIKqSH.js";import"./use-clock-tick-F8Oybd0p.js";import"./AlertCircle-DFFB807G.js";import"./CheckCircle-BwwAyNzV.js";import"./Circle-pOPoWDQn.js";import"./agent-icon-jdj2JAEm.js";import"./UserPlus01-DjFNU1Mn.js";import"./Tool01-CSravChF.js";import"./ArrowUp-CFU7eduC.js";import"./Settings02-D5c8FtUa.js";import"./Tool02-csu1mOp1.js";import"./XCircle-CiVL5z-e.js";import"./ArrowUpRight-D37SsWBk.js";import"./TrendUp01-Dw2DNRxA.js";import"./ZapSquare-BDp8YrcS.js";import"./ZoomOut-CvmU5uj5.js";import"./Users03-Iz-TpUuJ.js";import"./Stars02-CzKVb8lE.js";import"./Copy01-BEB5hDKQ.js";import"./DotsVertical-BFfMlorx.js";import"./Globe01-DVm51A__.js";import"./Eye-Bbh_ejV6.js";import"./FilterLines-Dm0WP1zI.js";import"./Flag01-e55mynPF.js";import"./Star01-C32-NjaL.js";import"./Globe04-DA8QsMrW.js";import"./SwitchHorizontal01-C8Rnw5uG.js";import"./HardDrive-BJ2MS6we.js";import"./Image01-Y4d3ZI2r.js";import"./Key01-xPUeBTf6.js";import"./LinkExternal01-B6bTrNoI.js";import"./List-gTaMGV9z.js";import"./Monitor01-BdI_dCjX.js";import"./Sun-BPhwV-Eh.js";import"./Package-WlP_SelV.js";import"./Palette-DwivsXKp.js";import"./Play-BPQdBfbt.js";import"./Plus-C8FiAr3i.js";import"./SearchLg-CMWIHllt.js";import"./SearchMd-Gwm-384G.js";import"./Shield01-Dn6encQp.js";import"./Stars01-C8WemEnv.js";import"./Trash01-DZTkGJqE.js";import"./Upload01-s2ES1URH.js";import"./User01-D0_zDlJM.js";import"./Users01-CAC4FOXB.js";import"./XClose-DxMKQUUD.js";import"./Zap-CrYnUVJy.js";import"./use-automations-CELpHT79.js";import"./studio-tools-Cdt3UzXo.js";import"./useSuspenseInfiniteQuery-3QrNhYz_.js";import"./avatar-DJpRqbqg.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-C0FUXmsm.js";import"./file-type-icon-BR1G8n26.js";import"./dialog-BboVhzku.js";import"./tab-id-BijBBRwE.js";import"./hooks-DYM3Q-Vq.js";import"./decopilot-sse-pool-pi1pVqbX.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./chat-context-CAoh3qxf.js";import"./autosend-CIDdvZqc.js";import"./use-ai-providers-C7iVrgY-.js";import"./use-decopilot-events-btxE-D2k.js";import"./use-organization-settings-CpbybQHD.js";import"./monaco-editor-YwujFe9g.js";import"./index-BTfVRtBq.js";import"./index-BXfKOYdf.js";import"./shell-layout-CcPRSmgX.js";import"./alert-dialog-DtmlB9JL.js";import"./required-auth-layout-BXaZVxWQ.js";import"./use-org-sso-BA_UxewI.js";import"./integration-icon-Dhyv93zr.js";import"./use-navigate-to-agent-CBi1-FBB.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-oIJCSonG.js";import"./form-p6ZihW38.js";import"./label-DbwTUWd9.js";import"./input-CqfDyI-C.js";import"./drawer-D5XLtSzP.js";import"./collection-search-BLJH2aa6.js";import"./tabs-DPmfTv0c.js";import"./toggle-group-BnuMLJr8.js";import"./use-deco-credits-56-eyw-E.js";import"./extract-connection-data-DEmXsdA0.js";import"./connection-card-DPw_9IvV.js";import"./use-registry-connections-CX_dlku1.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-B9g6Z2-r.js";import"./connection-form-helpers-svNTHB1P.js";import"./authenticate-and-persist-oauth-BuaZSTeD.js";import"./mcp-oauth-CeGeftbL.js";import"./collection-tabs-D10lR104.js";import"./badge-zT-Fh3qN.js";import"./connect-desktop-dialog-B4c48mz3.js";import"./select-model-BHB_Fir_.js";import"./checkbox-C7atZRmN.js";import"./skeleton-C-LbiBGP.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-HiisdE7T.js";import"./command-Cih9cb-G.js";import"./index-Dz8rxMiO.js";import"./popover-BJYBT3EY.js";import"./dropdown-menu-DcV4HAvf.js";import"./index-S6xdCjXr.js";import"./toolbar-65iromlk.js";import"./use-debounced-value-BqHYI-kn.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BrRSDeZW.js";import"./use-mcp-tools-Be4djRS3.js";import"./use-capability-DsC1r5oD.js";import"./use-debounced-autosave-IEMI4Muz.js";import"./index-BXTPhNSj.js";import"./search-input-CYwO2ZSV.js";import"./use-mcp-auth-status-Dy_Y2kKR.js";import"./switch-BL8XQR8K.js";import"./github-repo-picker-B_QoRL-b.js";import"./provision-repo-scoped-github-connection-CB4ICKHq.js";import"./use-secrets-ChIMRFxc.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./companions-core-Zwoux9HO.js";import"./index-CbMrlBFr.js";import"./get-initials-D-f_fDFw.js";import"./calendar-CibxNjt0.js";import"./toolbar-icon-button-BBh2Csxi.js";import"./use-file-configs-CYmkQ98g.js";import"./automation-list-row-BuCXNsSo.js";function $t(l,t){const s=(l.title||l.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),f=/^[A-Za-z]/.test(s)&&s.length>0?s:"Section",n=Bt(t,f);return{blockKey:n,data:{__resolveType:l.resolveType,name:n}}}function Kr(l){const t=gt.c(77),{orgSlug:s,virtualMcpId:f,branch:n,blockKey:i,block:a,meta:m,decofile:c,title:D,excludeFields:H,schemaPending:nt,previewBaseUrl:at}=l,G=nt===void 0?!1:nt,u=at===void 0?null:at,x=typeof a?.__resolveType=="string"?a.__resolveType:"";let R;t[0]!==H||t[1]!==m||t[2]!==x?(R=wt(x,m,H),t[0]=H,t[1]=m,t[2]=x,t[3]=R):R=t[3];const h=R;let C;t[4]!==h?(C=!!h&&Object.keys(h.properties??{}).length>0,t[4]=h,t[5]=C):C=t[5];const J=C;let E;t[6]!==a||t[7]!==i||t[8]!==m||t[9]!==D?(E=D??(a?At(i,a,m):i),t[6]=a,t[7]=i,t[8]=m,t[9]=D,t[10]=E):E=t[10];const v=E;let K;t[11]!==n||t[12]!==s||t[13]!==f?(K={orgSlug:s,virtualMcpId:f,branch:n},t[11]=n,t[12]=s,t[13]=f,t[14]=K):K=t[14];const{save:b,flush:Q,isPending:W}=Nt(K);let T;t[15]!==n||t[16]!==s||t[17]!==f?(T={orgSlug:s,virtualMcpId:f,branch:n},t[15]=n,t[16]=s,t[17]=f,t[18]=T):T=t[18];const X=Rt(T);let $;t[19]!==b?($=Et((e,r)=>b(e,r)),t[19]=b,t[20]=$):$=t[20];const Y=$,[ht,xt]=w.useState(i),[tt,ct]=w.useState(null),[et,dt]=w.useState(0);let F;t[21]===Symbol.for("react.memo_cache_sentinel")?(F=[],t[21]=F):F=t[21];const[p,ft]=w.useState(F),[ot,rt]=w.useState(!1),P=w.useRef(null);ht!==i&&(xt(i),ct(null),dt(Pt),ft([]));let O;t[22]!==a?(O=a??{},t[22]=a,t[23]=O):O=t[23];const it=O;let g;t[24]!==tt?(g=tt??{},t[24]=tt,t[25]=g):g=t[25];let z;t[26]!==it||t[27]!==g?(z={...it,...g},t[26]=it,t[27]=g,t[28]=z):z=t[28];const mt=z;let L;t[29]!==i||t[30]!==x||t[31]!==b?(L=e=>{const r=e;ct(r),b(i,{...r,__resolveType:x})},t[29]=i,t[30]=x,t[31]=b,t[32]=L):L=t[32];const st=L;let V;t[33]===Symbol.for("react.memo_cache_sentinel")?(V=e=>{ft(e)},t[33]=V):V=t[33];const pt=V;let q;t[34]!==c||t[35]!==Q||t[36]!==X?(q=async(e,r)=>{try{const{blockKey:d,data:N}=$t(e,c);await X.mutateAsync({blockKey:d,data:N}),ut.success(`Created section "${d}"`),r({__resolveType:d}),Q()}catch(d){const N=d,bt=N instanceof Error?N.message:"Could not add section";throw ut.error(bt),N}},t[34]=c,t[35]=Q,t[36]=X,t[37]=q):q=t[37];const y=q;let I;t[38]===Symbol.for("react.memo_cache_sentinel")?(I=e=>{P.current=e.append,rt(!0)},t[38]=I):I=t[38];const vt=I;let U;t[39]!==y?(U=async e=>{const r=P.current;if(r)try{await y(e,d=>{r(d),rt(!1),P.current=null})}catch{}},t[39]=y,t[40]=U):U=t[40];const lt=U;let M;t[41]!==p||t[42]!==v?(M=p.length>0?[v,...p]:[],t[41]=p,t[42]=v,t[43]=M):M=t[43];const A=M;let S;t[44]!==p||t[45]!==A||t[46]!==v?(S=A.length>0?o.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:A.map((e,r)=>{const d=r===A.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(jt,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{pt(r===0?[]:Ct(p,r)),dt(Ft)},title:e,className:yt("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",d?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:e})]},`${e}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:v}),t[44]=p,t[45]=A,t[46]=v,t[47]=S):S=t[47];let j;t[48]!==W?(j=o.jsx(Kt,{isPending:W,isError:!1}),t[48]=W,t[49]=j):j=t[49];let k;t[50]!==S||t[51]!==j?(k=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[S,j]}),t[50]=S,t[51]=j,t[52]=k):k=t[52];let _;t[53]!==i||t[54]!==p||t[55]!==c||t[56]!==mt||t[57]!==et||t[58]!==y||t[59]!==st||t[60]!==J||t[61]!==m||t[62]!==u||t[63]!==Y||t[64]!==h||t[65]!==G?(_=o.jsx(kt,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:J?o.jsx(Tt,{schema:h,value:mt,onChange:st,basePath:"",breadcrumbPath:p,onBreadcrumbChange:pt,decofile:c,meta:m,onSaveReferencedBlock:Y,previewBaseUrl:u,onAddSectionItem:y,onRequestAddSection:vt},`${i}:${et}`):G?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(St,{size:16,className:"animate-spin"}),"Loading app schema…"]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"No editable schema found for this app."})})})}),t[53]=i,t[54]=p,t[55]=c,t[56]=mt,t[57]=et,t[58]=y,t[59]=st,t[60]=J,t[61]=m,t[62]=u,t[63]=Y,t[64]=h,t[65]=G,t[66]=_):_=t[66];let B;t[67]!==ot||t[68]!==c||t[69]!==lt||t[70]!==m||t[71]!==u?(B=u&&o.jsx(_t,{open:ot,onOpenChange:e=>{rt(e),e||(P.current=null)},meta:m,decofile:c,previewBaseUrl:u,onSelect:e=>{lt(e)}}),t[67]=ot,t[68]=c,t[69]=lt,t[70]=m,t[71]=u,t[72]=B):B=t[72];let Z;return t[73]!==k||t[74]!==_||t[75]!==B?(Z=o.jsxs("div",{className:"flex h-full flex-col",children:[k,_,B]}),t[73]=k,t[74]=_,t[75]=B,t[76]=Z):Z=t[76],Z}function Ft(l){return l+1}function Pt(l){return l+1}export{Kr as AppEditor};
@@ -1 +0,0 @@
1
- import{c as B,j as o,C as L,b as T,r as $,B as M,p as N}from"./index-BEqdT-CX.js";import{s as q}from"./Plus-C8FiAr3i.js";import{i as S}from"./Zap-CrYnUVJy.js";import{S as D}from"./search-input-CYwO2ZSV.js";import{P as l}from"./index-BXTPhNSj.js";import{E as b}from"./empty-state-C6JrR5eZ.js";import{c as O}from"./use-automations-CELpHT79.js";import{c as V}from"./use-navigate-to-agent-CBi1-FBB.js";import{A as F}from"./automation-list-row-BuCXNsSo.js";import{f as G}from"./constants-D_FQAPnt.js";import{u as H}from"./use-virtual-mcp-CNKe_WaY.js";import{R as J}from"./require-capability-9_BT8d0_.js";import"./SearchMd-Gwm-384G.js";import"./sidebar-CRtkHPvX.js";import"./LayoutLeft-CNWN8tpf.js";import"./use-mobile-DbBFg2WD.js";import"./X-CTTK5Zj2.js";import"./tooltip-C7c-Tgru.js";import"./use-mcp-client-DvvHwezb.js";import"./auth-BR_fNNK7.js";import"./studio-tools-Cdt3UzXo.js";import"./hooks-DYM3Q-Vq.js";import"./decopilot-sse-pool-pi1pVqbX.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./alert-dialog-DtmlB9JL.js";import"./dropdown-menu-DcV4HAvf.js";import"./Check-BAiULwRg.js";import"./ChevronRight-UlscOqp6.js";import"./Circle-pOPoWDQn.js";import"./Stars02-CzKVb8lE.js";import"./DotsVertical-BFfMlorx.js";import"./Trash01-DZTkGJqE.js";import"./agent-icon-jdj2JAEm.js";import"./AlertCircle-DFFB807G.js";import"./UserPlus01-DjFNU1Mn.js";import"./Tool01-CSravChF.js";import"./ArrowUp-CFU7eduC.js";import"./Settings02-D5c8FtUa.js";import"./Tool02-csu1mOp1.js";import"./XCircle-CiVL5z-e.js";import"./ArrowUpRight-D37SsWBk.js";import"./TrendUp01-Dw2DNRxA.js";import"./ZapSquare-BDp8YrcS.js";import"./ZoomOut-CvmU5uj5.js";import"./Users03-Iz-TpUuJ.js";import"./CheckCircle-BwwAyNzV.js";import"./ChevronDown-Cpk84lU5.js";import"./ChevronUp-CqCnswy_.js";import"./Copy01-BEB5hDKQ.js";import"./Globe01-DVm51A__.js";import"./Eye-Bbh_ejV6.js";import"./FilterLines-Dm0WP1zI.js";import"./Flag01-e55mynPF.js";import"./Star01-C32-NjaL.js";import"./Globe04-DA8QsMrW.js";import"./SwitchHorizontal01-C8Rnw5uG.js";import"./HardDrive-BJ2MS6we.js";import"./Image01-Y4d3ZI2r.js";import"./Key01-xPUeBTf6.js";import"./LinkExternal01-B6bTrNoI.js";import"./List-gTaMGV9z.js";import"./Monitor01-BdI_dCjX.js";import"./Sun-BPhwV-Eh.js";import"./Package-WlP_SelV.js";import"./Palette-DwivsXKp.js";import"./Play-BPQdBfbt.js";import"./SearchLg-CMWIHllt.js";import"./Shield01-Dn6encQp.js";import"./Stars01-C8WemEnv.js";import"./Upload01-s2ES1URH.js";import"./User01-D0_zDlJM.js";import"./Users01-CAC4FOXB.js";import"./XClose-DxMKQUUD.js";import"./use-collections-Dy7WD_eH.js";import"./use-capability-DsC1r5oD.js";import"./access-gate-Bw06fv-s.js";import"./capability-load-error-BEzrfkB_.js";function K(){const t=B.c(16),{org:e}=L(),{data:w}=O(void 0),u=w===void 0?[]:w,R=H(),k=V(),d=T(),[f,E]=$.useState(""),g=f.toLowerCase(),y=new Map(R.map(Q)),C=u.filter(i=>{if(!g||i.name.toLowerCase().includes(g))return!0;if(i.virtual_mcp_id){const a=y.get(i.virtual_mcp_id);if(a&&a.title.toLowerCase().includes(g))return!0}return!1}),P=(i,a)=>{const A=a&&y.has(a)?a:G(e.id);N("automations_list_row_clicked",{automation_id:i,agent_id:A,source:"settings_automations"}),k(A,{search:{main:"automation:"+i}})};let n;t[0]!==d||t[1]!==e.slug?(n=()=>{N("automations_empty_state_browse_agents_clicked"),d({to:"/$org/settings/agents",params:{org:e.slug}})},t[0]=d,t[1]=e.slug,t[2]=n):n=t[2];const z=n,x=l,h=l,j=l;let p;t[3]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(l.Title,{children:"Automations"}),t[3]=p):p=t[3];const _=u.length>0&&o.jsx(D,{value:f,onChange:E,placeholder:"Search automations...",className:"w-full md:w-[375px]"});let r;t[4]!==_?(r=o.jsxs("div",{className:"flex flex-col gap-6",children:[p,_]}),t[4]=_,t[5]=r):r=t[5];const v=u.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations yet",description:"Automations are created per agent. Open an agent and add one from its Automations tab.",actions:o.jsxs(M,{size:"sm",onClick:z,children:[o.jsx(q,{size:14}),"Browse agents"]})})}):C.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations found",description:`No automations match "${f}"`})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:C.map(i=>o.jsx(F,{automation:i,showAgent:!0,onClick:()=>P(i.id,i.virtual_mcp_id)},i.id))});let s;t[6]!==j.Body||t[7]!==r||t[8]!==v?(s=o.jsxs(j.Body,{children:[r,v]}),t[6]=j.Body,t[7]=r,t[8]=v,t[9]=s):s=t[9];let m;t[10]!==h.Content||t[11]!==s?(m=o.jsx(h.Content,{children:s}),t[10]=h.Content,t[11]=s,t[12]=m):m=t[12];let c;return t[13]!==x||t[14]!==m?(c=o.jsx(x,{children:m}),t[13]=x,t[14]=m,t[15]=c):c=t[15],c}function Q(t){return[t.id,t]}function vo(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(J,{capability:"automations:manage",area:"automations",children:o.jsx(K,{})}),t[0]=e):e=t[0],e}export{vo as default};
@@ -1 +0,0 @@
1
- import{c as q,r as S,l as G,j as t,B as I,i as Q,t as U}from"./index-BEqdT-CX.js";import{i as X}from"./XCircle-CiVL5z-e.js";import{c as T}from"./ZoomOut-CvmU5uj5.js";import{n as Y}from"./LinkExternal01-B6bTrNoI.js";import{az as Z}from"./agent-icon-jdj2JAEm.js";import{f as K,a as _,b as tt,c as et,d as ot,e as rt,A as it,g as st}from"./alert-dialog-DtmlB9JL.js";import{I as M}from"./input-CqfDyI-C.js";import{L}from"./label-DbwTUWd9.js";import{v as at,w as mt,V as nt,o as lt,x as R,A as pt,W as ct,y as dt}from"./index-Bnro1Vjb.js";import{c as ut,B as gt,a as xt}from"./block-document-2XwXLkCF.js";import{u as ft}from"./use-autosave-B1tnyn5H.js";import{t as ht}from"./ChevronDown-Cpk84lU5.js";import{J as yt,K as jt,I as vt}from"./automation-runs-nQ99AMoV.js";import{s as v,E as bt}from"./primitives-QqbAbc1Q.js";import"./AlertCircle-DFFB807G.js";import"./UserPlus01-DjFNU1Mn.js";import"./Tool01-CSravChF.js";import"./ArrowUp-CFU7eduC.js";import"./Settings02-D5c8FtUa.js";import"./Tool02-csu1mOp1.js";import"./ArrowUpRight-D37SsWBk.js";import"./TrendUp01-Dw2DNRxA.js";import"./ZapSquare-BDp8YrcS.js";import"./Users03-Iz-TpUuJ.js";import"./CheckCircle-BwwAyNzV.js";import"./Check-BAiULwRg.js";import"./ChevronRight-UlscOqp6.js";import"./ChevronUp-CqCnswy_.js";import"./Circle-pOPoWDQn.js";import"./Stars02-CzKVb8lE.js";import"./Copy01-BEB5hDKQ.js";import"./DotsVertical-BFfMlorx.js";import"./Globe01-DVm51A__.js";import"./Eye-Bbh_ejV6.js";import"./FilterLines-Dm0WP1zI.js";import"./Flag01-e55mynPF.js";import"./Star01-C32-NjaL.js";import"./Globe04-DA8QsMrW.js";import"./SwitchHorizontal01-C8Rnw5uG.js";import"./HardDrive-BJ2MS6we.js";import"./Image01-Y4d3ZI2r.js";import"./Key01-xPUeBTf6.js";import"./LayoutLeft-CNWN8tpf.js";import"./List-gTaMGV9z.js";import"./Monitor01-BdI_dCjX.js";import"./Sun-BPhwV-Eh.js";import"./Package-WlP_SelV.js";import"./Palette-DwivsXKp.js";import"./Play-BPQdBfbt.js";import"./Plus-C8FiAr3i.js";import"./SearchLg-CMWIHllt.js";import"./SearchMd-Gwm-384G.js";import"./Shield01-Dn6encQp.js";import"./Stars01-C8WemEnv.js";import"./Trash01-DZTkGJqE.js";import"./Upload01-s2ES1URH.js";import"./User01-D0_zDlJM.js";import"./Users01-CAC4FOXB.js";import"./XClose-DxMKQUUD.js";import"./X-CTTK5Zj2.js";import"./Zap-CrYnUVJy.js";import"./chat-context-CAoh3qxf.js";import"./autosend-CIDdvZqc.js";import"./hooks-DYM3Q-Vq.js";import"./use-mcp-client-DvvHwezb.js";import"./constants-D_FQAPnt.js";import"./auth-BR_fNNK7.js";import"./decopilot-sse-pool-pi1pVqbX.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-Cdt3UzXo.js";import"./use-virtual-mcp-CNKe_WaY.js";import"./use-collections-Dy7WD_eH.js";import"./use-ai-providers-C7iVrgY-.js";import"./use-decopilot-events-btxE-D2k.js";import"./tab-id-BijBBRwE.js";import"./use-organization-settings-CpbybQHD.js";import"./tooltip-C7c-Tgru.js";import"./dialog-BboVhzku.js";import"./drawer-D5XLtSzP.js";import"./collection-search-BLJH2aa6.js";import"./use-mobile-DbBFg2WD.js";import"./AreaChart-oIJCSonG.js";import"./index-BXfKOYdf.js";import"./shell-layout-CcPRSmgX.js";import"./avatar-DJpRqbqg.js";import"./required-auth-layout-BXaZVxWQ.js";import"./use-org-sso-BA_UxewI.js";import"./form-p6ZihW38.js";import"./select-Bh2Z8rK3.js";import"./tabs-DPmfTv0c.js";import"./toggle-group-BnuMLJr8.js";import"./use-deco-credits-56-eyw-E.js";import"./extract-connection-data-DEmXsdA0.js";import"./connection-card-DPw_9IvV.js";import"./use-registry-connections-CX_dlku1.js";import"./use-connection-DUpx0NEA.js";import"./useInfiniteQuery-BnNR1NVs.js";import"./use-infinite-scroll-DYbbFqLK.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-CEUspnmz.js";import"./integration-icon-Dhyv93zr.js";import"./textarea-B9g6Z2-r.js";import"./connection-form-helpers-svNTHB1P.js";import"./authenticate-and-persist-oauth-BuaZSTeD.js";import"./mcp-oauth-CeGeftbL.js";import"./collection-tabs-D10lR104.js";import"./badge-zT-Fh3qN.js";import"./useSuspenseInfiniteQuery-3QrNhYz_.js";import"./connect-desktop-dialog-B4c48mz3.js";import"./select-model-BHB_Fir_.js";import"./checkbox-C7atZRmN.js";import"./skeleton-C-LbiBGP.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-HiisdE7T.js";import"./command-Cih9cb-G.js";import"./index-Dz8rxMiO.js";import"./popover-BJYBT3EY.js";import"./dropdown-menu-DcV4HAvf.js";import"./index-S6xdCjXr.js";import"./file-type-icon-BR1G8n26.js";import"./toolbar-65iromlk.js";import"./use-debounced-value-BqHYI-kn.js";import"./index-BTfVRtBq.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BrRSDeZW.js";import"./empty-state-C6JrR5eZ.js";import"./use-mcp-tools-Be4djRS3.js";import"./use-capability-DsC1r5oD.js";import"./use-debounced-autosave-IEMI4Muz.js";import"./index-BXTPhNSj.js";import"./sidebar-CRtkHPvX.js";import"./search-input-CYwO2ZSV.js";import"./use-mcp-auth-status-Dy_Y2kKR.js";import"./switch-BL8XQR8K.js";import"./github-repo-picker-B_QoRL-b.js";import"./use-navigate-to-agent-CBi1-FBB.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-CB4ICKHq.js";import"./use-secrets-ChIMRFxc.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./companions-core-Zwoux9HO.js";import"./format-time-BnbuEtat.js";import"./use-members-BZPSqMOT.js";import"./use-org-auth-client-PHOIKqSH.js";import"./index-CbMrlBFr.js";import"./get-initials-D-f_fDFw.js";import"./calendar-CibxNjt0.js";import"./use-copy-C0FUXmsm.js";import"./toolbar-icon-button-BBh2Csxi.js";import"./monaco-editor-YwujFe9g.js";import"./use-file-configs-CYmkQ98g.js";import"./use-automations-CELpHT79.js";import"./automation-list-row-BuCXNsSo.js";import"./table-VOE9WRkg.js";import"./use-clock-tick-F8Oybd0p.js";function Ct(k){const e=q.c(18),{icon:f,title:n,defaultOpen:b,children:d}=k,A=b===void 0?!1:b,[x,D]=S.useState(A);let l;e[0]!==f?(l=t.jsx(f,{size:15}),e[0]=f,e[1]=l):l=e[1];let i;e[2]!==n?(i=t.jsx("span",{className:"flex-1 text-left",children:n}),e[2]=n,e[3]=i):i=e[3];const h=x&&"rotate-180";let r;e[4]!==h?(r=G("transition-transform",h),e[4]=h,e[5]=r):r=e[5];let p;e[6]!==r?(p=t.jsx(ht,{size:15,className:r}),e[6]=r,e[7]=p):p=e[7];let c;e[8]!==l||e[9]!==i||e[10]!==p?(c=t.jsx(yt,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[l,i,p]})}),e[8]=l,e[9]=i,e[10]=p,e[11]=c):c=e[11];let s;e[12]!==d?(s=t.jsx(jt,{className:"px-2 pt-4",children:d}),e[12]=d,e[13]=s):s=e[13];let u;return e[14]!==x||e[15]!==c||e[16]!==s?(u=t.jsxs(vt,{open:x,onOpenChange:D,className:"mt-4",children:[c,s]}),e[14]=x,e[15]=c,e[16]=s,e[17]=u):u=e[17],u}function vr({orgSlug:k,virtualMcpId:e,branch:f,blockKey:n,block:b,decofile:d,meta:A,onManagePosts:x,onOpenPost:D,previewBaseUrl:l}){const i=at({orgSlug:k,virtualMcpId:e,branch:f}),h=mt(b,"categories"),[r,p,c]=ft(h,o=>{i.mutate({blockKey:n,data:R(n,"categories",o)})}),s=(o,w)=>p({...r,[o]:w}),u=ut({decofile:d,category:r,previewBaseUrl:l}),a=v(r.slug),[B,y]=S.useState(a),[m,C]=S.useState(null),[N,z]=S.useState(!1),P=a?nt(d).filter(o=>o.categorySlugs.includes(a)):[],j=P.length,W=o=>s("slug",o),H=async(o,w)=>{const V=v(r.name);z(!0);try{let g=0;for(const{key:E,payload:O}of pt(d,"posts")){const F=ct(O,o,{name:V,slug:w});F!==O&&(await i.mutateAsync({blockKey:E,data:R(E,"posts",dt(F))}),g+=1)}const $={...r,slug:w};await i.mutateAsync({blockKey:n,data:R(n,"categories",$)}),c($),U.success(g>0?`Renamed slug and updated ${g} ${g===1?"post":"posts"}`:"Renamed slug"),C(null)}catch(g){y(o),C(null),U.error(g instanceof Error?g.message:"Rename failed")}finally{z(!1)}},J=()=>{const o=B.trim();if(o===a){B!==o&&y(o);return}if(!o){y(a);return}if(j===0){W(o);return}C({oldSlug:a,newSlug:o,count:j})};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:v(r.name)||"Untitled category"}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(lt,{isPending:i.isPending,isError:i.isError}),u&&t.jsxs(I,{type:"button",variant:"outline",size:"sm",title:"Open the category preview in a new tab",onClick:()=>window.open(u,"_blank","noopener,noreferrer"),children:[t.jsx(Y,{size:14}),"See category preview"]})]})]}),t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[t.jsx(bt,{value:v(r.name),onChange:o=>s("name",o),placeholder:"Category name",className:"py-1 text-3xl font-bold text-foreground"}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(L,{htmlFor:"category-slug",children:"Slug"}),t.jsx(M,{id:"category-slug",value:B,onChange:o=>y(o.target.value),onBlur:J,placeholder:"my-category",className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(L,{htmlFor:"category-description",children:"Description"}),t.jsx(M,{id:"category-description",value:v(r.description),onChange:o=>s("description",o.target.value),placeholder:"Short description for this category",className:"h-10"})]}),t.jsx(Ct,{icon:Z,title:"Content",defaultOpen:!0,children:t.jsx(gt,{value:xt(r.sections),onChange:o=>s("sections",o),meta:A,emptyMessage:"This category has no content yet. Use ⊕ to add your first block."})}),t.jsxs("div",{className:"mt-6 overflow-hidden rounded-lg border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(T,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"text-sm",children:[j," ",j===1?"post":"posts"," in this category"]})]}),t.jsxs(I,{type:"button",variant:"outline",size:"sm",disabled:!a,title:a?"Pick posts to add to this category":"Set a slug to add posts to this category",onClick:()=>x(a),children:["Add posts",t.jsx(X,{size:14})]})]}),j>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:P.map(o=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>D(o.key),className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[t.jsx(T,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:o.title||"Untitled post"}),o.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:o.slug})]})]})},o.key))})]})]})})]}),t.jsx(K,{open:!!m,onOpenChange:o=>{o||N||(y(a),C(null))},children:t.jsxs(_,{children:[t.jsxs(tt,{children:[t.jsx(et,{children:"Rename category slug?"}),t.jsx(ot,{children:m?`Changing the slug from "${m.oldSlug}" to "${m.newSlug}" will update ${m.count} ${m.count===1?"post":"posts"} that reference this category.`:null})]}),t.jsxs(rt,{children:[t.jsx(it,{disabled:N,children:"Cancel"}),t.jsx(st,{onClick:o=>{o.preventDefault(),m&&H(m.oldSlug,m.newSlug)},disabled:N,children:N?t.jsxs(t.Fragment,{children:[t.jsx(Q,{size:14,className:"animate-spin"}),"Renaming…"]}):"Rename & update posts"})]})]})})]})}export{vr as CategoryEditor};
@@ -1 +0,0 @@
1
- import{c as E,j as o,u as Ie,o as De,p as se,r as M,a as Se,b as Fe,q as qe,d as Te,s as Le,Q as He,E as Ve,K as _e,v as Ue,B as je,N as Be}from"./index-BEqdT-CX.js";import{L as Ke,s as ve,S as Pe,a as Ne,b as Ce,c as be,i as Qe,n as pe,C as we,p as xe}from"./self-tool-result-BkP7cEqy.js";import{A as We}from"./auth-entry-CsuZU0Hz.js";import{A as Ge}from"./auth-split-layout-HOd3Qhyr.js";import{O as Re}from"./organization-choice-D3k9ZPpO.js";import{I as Ye}from"./input-CqfDyI-C.js";import{u as Je}from"./use-mcp-client-DvvHwezb.js";import{S as Xe,W as Ze,g as et,a as tt}from"./constants-D_FQAPnt.js";import{i as it}from"./XCircle-CiVL5z-e.js";import"./integration-icon-Dhyv93zr.js";import"./Tool02-csu1mOp1.js";import"./agent-icon-jdj2JAEm.js";import"./AlertCircle-DFFB807G.js";import"./UserPlus01-DjFNU1Mn.js";import"./Tool01-CSravChF.js";import"./ArrowUp-CFU7eduC.js";import"./Settings02-D5c8FtUa.js";import"./ArrowUpRight-D37SsWBk.js";import"./TrendUp01-Dw2DNRxA.js";import"./ZapSquare-BDp8YrcS.js";import"./ZoomOut-CvmU5uj5.js";import"./Users03-Iz-TpUuJ.js";import"./CheckCircle-BwwAyNzV.js";import"./Check-BAiULwRg.js";import"./ChevronDown-Cpk84lU5.js";import"./ChevronRight-UlscOqp6.js";import"./ChevronUp-CqCnswy_.js";import"./Circle-pOPoWDQn.js";import"./Stars02-CzKVb8lE.js";import"./Copy01-BEB5hDKQ.js";import"./DotsVertical-BFfMlorx.js";import"./Globe01-DVm51A__.js";import"./Eye-Bbh_ejV6.js";import"./FilterLines-Dm0WP1zI.js";import"./Flag01-e55mynPF.js";import"./Star01-C32-NjaL.js";import"./Globe04-DA8QsMrW.js";import"./SwitchHorizontal01-C8Rnw5uG.js";import"./HardDrive-BJ2MS6we.js";import"./Image01-Y4d3ZI2r.js";import"./Key01-xPUeBTf6.js";import"./LayoutLeft-CNWN8tpf.js";import"./LinkExternal01-B6bTrNoI.js";import"./List-gTaMGV9z.js";import"./Monitor01-BdI_dCjX.js";import"./Sun-BPhwV-Eh.js";import"./Package-WlP_SelV.js";import"./Palette-DwivsXKp.js";import"./Play-BPQdBfbt.js";import"./Plus-C8FiAr3i.js";import"./SearchLg-CMWIHllt.js";import"./SearchMd-Gwm-384G.js";import"./Shield01-Dn6encQp.js";import"./Stars01-C8WemEnv.js";import"./Trash01-DZTkGJqE.js";import"./Upload01-s2ES1URH.js";import"./User01-D0_zDlJM.js";import"./Users01-CAC4FOXB.js";import"./XClose-DxMKQUUD.js";import"./X-CTTK5Zj2.js";import"./Zap-CrYnUVJy.js";import"./dialog-BboVhzku.js";import"./tooltip-C7c-Tgru.js";import"./companions-core-Zwoux9HO.js";import"./extract-connection-data-DEmXsdA0.js";import"./provision-repo-scoped-github-connection-CB4ICKHq.js";import"./form-p6ZihW38.js";import"./label-DbwTUWd9.js";import"./use-debounced-value-BqHYI-kn.js";import"./authenticate-and-persist-oauth-BuaZSTeD.js";import"./mcp-oauth-CeGeftbL.js";import"./auth-BR_fNNK7.js";import"./retry-CErkP7V6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-DJpRqbqg.js";const ot={workspace:"Preparando seu workspace de commerce...",generic:"Preparando..."};function nt(l){return ot[l]}function ye(l){const e=E.c(4),{variant:i}=l;let t;e[0]!==i?(t=nt(i),e[0]=i,e[1]=t):t=e[1];let s;return e[2]!==t?(s=o.jsx("div",{className:"flex justify-center py-4",role:"status","aria-live":"polite",children:o.jsx(Ke,{label:t,className:"text-muted-foreground"})}),e[2]=t,e[3]=s):s=e[3],s}function $i(){const l=E.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(st,{}),l[0]=e):e=l[0],e}const Me=M.createContext(null),$e=()=>M.useContext(Me);function R(l){const e=E.c(13);let i,t;e[0]!==l?({visual:t,...i}=l,e[0]=l,e[1]=i,e[2]=t):(i=e[1],t=e[2]);let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/commerce-onboarding"},e[3]=s):s=e[3];const c=Ie(s),{data:a}=Se.useSession(),n=a?.user?.email;let m;e[4]!==c.siteUrl||e[5]!==n?(m=Ce({siteUrl:c.siteUrl,email:n}),e[4]=c.siteUrl,e[5]=n,e[6]=m):m=e[6];const d=m;let u;e[7]!==d||e[8]!==t?(u=t??o.jsx(be,{href:d}),e[7]=d,e[8]=t,e[9]=u):u=e[9];let v;return e[10]!==i||e[11]!==u?(v=o.jsx(Ge,{...i,visual:u}),e[10]=i,e[11]=u,e[12]=v):v=e[12],v}const rt={signUpFailed:"Falha ao criar conta",signInFailed:"Falha ao entrar",authenticationFailed:"Falha na autenticação",resetEmailFailed:"Não foi possível enviar o e-mail de redefinição",otpSendFailed:"Não foi possível enviar o código",invalidCode:"Código inválido",invalidEmail:"E-mail inválido",invalidEmailOrPassword:"E-mail ou senha inválidos. Tente novamente.",accountExists:"Já existe uma conta com este e-mail. Tente entrar em vez de criar uma nova conta.",networkError:"Erro de rede. Verifique sua conexão e tente novamente.",tooManyAttempts:"Muitas tentativas. Aguarde um momento e tente novamente.",invalidOrExpiredCode:"Código inválido ou expirado. Tente novamente.",genericError:"Algo deu errado. Tente novamente.",resetPasswordTitle:"Redefinir sua senha",verificationCodeTitle:"Informe o código de verificação",welcomeTitle:"Bem-vindo à deco",resetPasswordSubtitle:"Enviaremos um link de redefinição",codeSentTo:l=>`Código enviado para ${l}`,defaultSubtitle:"Entre ou crie uma nova conta",resetEmailSent:"Verifique seu e-mail para redefinir a senha.",continueWith:l=>`Continuar com ${l}`,divider:"ou",emailLabel:"E-mail",emailPlaceholder:"Endereço de e-mail",sending:"Enviando...",sendCode:"Enviar código",verificationCodeLabel:"Código de verificação",enterCodePlaceholder:"Informe o código",verifying:"Verificando...",verify:"Verificar",useDifferentEmail:"Usar outro e-mail",sendResetLink:"Enviar link de redefinição",nameLabel:"Nome",namePlaceholder:"Seu nome",passwordLabel:"Senha",forgotPassword:"Esqueceu a senha?",creatingAccount:"Criando conta...",signingIn:"Entrando...",continue:"Continuar",backToSignIn:"Voltar para entrar",signInWithPassword:"Entrar com senha",alreadyHaveAccount:"Já tem uma conta? ",dontHaveAccount:"Não tem uma conta? ",signIn:"Entrar",signUp:"Criar conta",signInWithEmailCode:"Entrar com código por e-mail"};function Oe(l){switch(l){case"Enter a website URL.":return"Informe a URL de um site.";case"Use an HTTP or HTTPS website URL.":return"Use uma URL de site HTTP ou HTTPS.";case"Enter a valid website URL.":return"Informe uma URL de site válida.";default:return l}}let ze=!1;function st(){const l=Ie({from:"/commerce-onboarding"}),{org:e,siteUrl:i}=l,t=ve(i);return!ze&&De()&&(ze=!0,se("commerce_onboarding_viewed",{site_url:i,domain:t??void 0,...t?{$set:{last_scanned_domain:t}}:{}})),o.jsx(Me.Provider,{value:t,children:o.jsx(at,{requestedOrgSlug:e,siteUrl:i})})}function at(l){const e=E.c(8),{requestedOrgSlug:i,siteUrl:t}=l,{data:s,isPending:c}=Se.useSession(),a=$e();if(c){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx(R,{children:o.jsx(ye,{variant:"generic"})}),e[0]=m):m=e[0],m}if(!s){const m=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let d;e[1]!==a?(d=a?o.jsx(Pe,{host:a}):void 0,e[1]=a,e[2]=d):d=e[2];let u;return e[3]!==d?(u=o.jsx(R,{children:o.jsx(We,{callbackUrl:m,allowAutoLogin:!1,title:"Desbloqueie seu diagnóstico completo",subtitle:null,brand:d,copy:rt})}),e[3]=d,e[4]=u):u=e[4],u}let n;return e[5]!==i||e[6]!==t?(n=o.jsx(lt,{requestedOrgSlug:i,siteUrl:t}),e[5]=i,e[6]=t,e[7]=n):n=e[7],n}function lt(l){const e=E.c(43),{requestedOrgSlug:i,siteUrl:t}=l,s=Fe(),c=qe(),[a,n]=M.useState(null),[m,d]=M.useState(null),u=c.data?.map(mt)??[];let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v={mutationFn:ct,retry:!1,onSuccess:r=>{d(r)}},e[0]=v):v=e[0];const p=Te(v);if(c.isPending){let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(R,{children:o.jsx(ye,{variant:"workspace"})}),e[1]=r):r=e[1],r}if(c.error){let r;return e[2]!==c?(r=o.jsx(ae,{title:"Não foi possível carregar suas organizações",description:"Tente novamente para continuar a configuração de commerce nesta página.",actionLabel:"Tentar novamente",onRetry:()=>c.refetch()}),e[2]=c,e[3]=r):r=e[3],r}const j=i?u.find(r=>r.slug===i):null;if(j){let r;return e[4]!==j||e[5]!==t?(r=o.jsx(re,{org:j,initialSiteUrl:t}),e[4]=j,e[5]=t,e[6]=r):r=e[6],r}if(i){let r;return e[7]!==c?(r=o.jsx(ae,{title:"Organização não encontrada",description:"Não conseguimos encontrar essa organização na sua conta.",actionLabel:"Tentar novamente",onRetry:()=>c.refetch()}),e[7]=c,e[8]=r):r=e[8],r}if(a){let r;return e[9]!==a||e[10]!==t?(r=o.jsx(re,{org:a,initialSiteUrl:t}),e[9]=a,e[10]=t,e[11]=r):r=e[11],r}if(u.length===1&&u[0]){let r;return e[12]!==u[0]||e[13]!==t?(r=o.jsx(re,{org:u[0],initialSiteUrl:t}),e[12]=u[0],e[13]=t,e[14]=r):r=e[14],r}if(u.length>1){let r;e[15]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(k,{title:"Escolha uma organização",description:"Selecione onde o diagnóstico de commerce deve continuar."}),e[15]=r):r=e[15];let h;e[16]!==s||e[17]!==t?(h=O=>s({to:"/commerce-onboarding",search:{org:O.slug,siteUrl:t}}),e[16]=s,e[17]=t,e[18]=h):h=e[18];let C;return e[19]!==u||e[20]!==h?(C=o.jsx(R,{children:o.jsxs("div",{className:"grid gap-10",children:[r,o.jsx(Ne,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:o.jsx(Re,{organizations:u,selectLabel:"Continuar",onSelected:h})})]})}),e[19]=u,e[20]=h,e[21]=C):C=e[21],C}if(!m){let r;e[22]!==p?(r=()=>{p.reset(),p.mutate()},e[22]=p,e[23]=r):r=e[23];let h;return e[24]!==p||e[25]!==r?(h=o.jsx(dt,{mutation:p,onRetry:r}),e[24]=p,e[25]=r,e[26]=h):h=e[26],h}const g=m;if(g?.success&&(g.status==="created"||g.status==="joined"||g.status==="already_has_organization")&&g.organization){let r;return e[27]!==g.organization||e[28]!==t?(r=o.jsx(re,{org:g.organization,initialSiteUrl:t}),e[27]=g.organization,e[28]=t,e[29]=r):r=e[29],r}if(g?.status==="ambiguous"&&g.organizations&&g.organizations.length>0){let r;e[30]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(k,{title:"Escolha uma organização",description:"Seu e-mail pode acessar mais de uma organização. Escolha onde a configuração de commerce deve continuar."}),e[30]=r):r=e[30];const h=g.domain??void 0;let C;e[31]!==s||e[32]!==t?(C=($,P)=>{Le(),n({...$,slug:P}),s({to:"/commerce-onboarding",search:{org:P,siteUrl:t}})},e[31]=s,e[32]=t,e[33]=C):C=e[33];let O;return e[34]!==g.organizations||e[35]!==h||e[36]!==C?(O=o.jsx(R,{children:o.jsxs("div",{className:"grid gap-10",children:[r,o.jsx(Ne,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:o.jsx(Re,{organizations:g.organizations,domain:h,onJoined:C})})]})}),e[34]=g.organizations,e[35]=h,e[36]=C,e[37]=O):O=e[37],O}const S=g?.error??"Não conseguimos determinar uma organização de commerce para esta conta.";let _;e[38]!==p?(_=()=>{d(null),p.reset()},e[38]=p,e[39]=_):_=e[39];let I;return e[40]!==S||e[41]!==_?(I=o.jsx(ae,{title:"O onboarding de commerce precisa de suporte",description:S,actionLabel:"Tentar novamente",onRetry:_}),e[40]=S,e[41]=_,e[42]=I):I=e[42],I}async function ct(){const e=await(await fetch("/api/auth/custom/ensure-organization",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}})).json();return e.success&&(e.status==="created"||e.status==="joined"||e.status==="already_has_organization")&&e.organization&&Le(),e}function mt(l){return{id:l.id,name:l.name,slug:l.slug,logo:l.logo??null}}function dt(l){const e=E.c(7),{mutation:i,onRetry:t}=l,s=M.useRef(!1);let c;e[0]!==i?(c=d=>{!d||s.current||(s.current=!0,i.mutate())},e[0]=i,e[1]=c):c=e[1];const a=c;if(i.error){let d;return e[2]!==t?(d=o.jsx(ae,{title:"Onboarding de commerce indisponível",description:"Não foi possível preparar uma organização para a configuração de commerce. Tente novamente por esta página ou fale com o suporte.",actionLabel:"Tentar novamente",onRetry:t}),e[2]=t,e[3]=d):d=e[3],d}let n;e[4]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx(ye,{variant:"generic"}),e[4]=n):n=e[4];let m;return e[5]!==a?(m=o.jsx(R,{children:o.jsx("div",{ref:a,children:n})}),e[5]=a,e[6]=m):m=e[6],m}function k(l){const e=E.c(8),{title:i,description:t}=l,s=$e();let c;e[0]!==s?(c=s?o.jsx(Pe,{host:s}):o.jsxs("div",{children:[o.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),o.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e[0]=s,e[1]=c):c=e[1];let a;e[2]!==t||e[3]!==i?(a=(i||t)&&o.jsxs("div",{className:"space-y-2",children:[i&&o.jsx("h1",{className:"text-2xl font-medium leading-8",children:i}),t&&o.jsx("p",{className:"text-base text-muted-foreground leading-6",children:t})]}),e[2]=t,e[3]=i,e[4]=a):a=e[4];let n;return e[5]!==c||e[6]!==a?(n=o.jsxs("div",{className:"grid gap-10",children:[c,a]}),e[5]=c,e[6]=a,e[7]=n):n=e[7],n}function ae(l){const e=E.c(9),{title:i,description:t,actionLabel:s,onRetry:c}=l;let a;e[0]!==t||e[1]!==i?(a=o.jsx(k,{title:i,description:t}),e[0]=t,e[1]=i,e[2]=a):a=e[2];let n;e[3]!==s||e[4]!==c?(n=o.jsx(je,{type:"button",size:"xl",className:"w-full",onClick:c,children:s}),e[3]=s,e[4]=c,e[5]=n):n=e[5];let m;return e[6]!==a||e[7]!==n?(m=o.jsx(R,{children:o.jsxs("div",{className:"grid gap-10",children:[a,n]})}),e[6]=a,e[7]=n,e[8]=m):m=e[8],m}function re(l){const e=E.c(11),{org:i,initialSiteUrl:t}=l,{data:s}=Se.useSession(),c=s?.user?.email;let a;e[0]!==t||e[1]!==c?(a=Ce({siteUrl:t,email:c}),e[0]=t,e[1]=c,e[2]=a):a=e[2];const n=a;let m;e[3]!==n||e[4]!==i.id?(m=o.jsx(be,{href:n,orgId:i.id}),e[3]=n,e[4]=i.id,e[5]=m):m=e[5];const d=m;let u;return e[6]!==t||e[7]!==d||e[8]!==i||e[9]!==s?.user?.email?(u=o.jsx(He,{children:v=>{const{reset:p}=v;return o.jsx(Ve,{fallback:j=>{const{error:g,resetError:S}=j;return o.jsx(R,{visual:d,children:o.jsx(ut,{orgName:i.name,message:g instanceof Error?g.message:"Não foi possível verificar a configuração do Commerce Discovery.",onRetry:()=>{p(),S()}})})},children:o.jsx(M.Suspense,{fallback:o.jsx(ke,{visual:d}),children:o.jsx(ft,{org:i,initialSiteUrl:t,sessionEmail:s?.user?.email},`${i.id}:${t??""}`)})})}}),e[6]=t,e[7]=d,e[8]=i,e[9]=s?.user?.email,e[10]=u):u=e[10],u}function ke(l){const e=E.c(3),{visual:i}=l;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=o.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[o.jsx(k,{}),o.jsx(we,{})]}),e[0]=t):t=e[0];let s;return e[1]!==i?(s=o.jsx(R,{align:"fill",visual:i,children:t}),e[1]=i,e[2]=s):s=e[2],s}function ut(l){const e=E.c(10),{orgName:i,message:t,onRetry:s}=l,c=`A configuração de commerce continuará em ${i}.`;let a;e[0]!==c?(a=o.jsx(k,{title:"Diagnóstico de commerce",description:c}),e[0]=c,e[1]=a):a=e[1];let n;e[2]!==t?(n=o.jsx(le,{message:t}),e[2]=t,e[3]=n):n=e[3];let m;e[4]!==s?(m=o.jsx(je,{type:"button",size:"xl",className:"w-full",onClick:s,children:"Tentar novamente"}),e[4]=s,e[5]=m):m=e[5];let d;return e[6]!==a||e[7]!==n||e[8]!==m?(d=o.jsxs("div",{className:"grid gap-10",children:[a,n,m]}),e[6]=a,e[7]=n,e[8]=m,e[9]=d):d=e[9],d}function ft(l){const e=E.c(109),{org:i,initialSiteUrl:t,sessionEmail:s}=l;let c;e[0]!==i.id||e[1]!==i.slug?(c={connectionId:Xe,orgId:i.id,orgSlug:i.slug},e[0]=i.id,e[1]=i.slug,e[2]=c):c=e[2];const a=Je(c),[n,m]=M.useState(t??""),[d,u]=M.useState(null),v=M.useRef(!1),p=Ze.COMMERCE_DISCOVERY(i.id),j=et(i.id),g=_e.commerceDiscoveryConnection(i.id,p);let S;e[3]!==p||e[4]!==a?(S=async()=>{const f=await a.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:p}});return xe(f)},e[3]=p,e[4]=a,e[5]=S):S=e[5];let _;e[6]!==g||e[7]!==S?(_={queryKey:g,queryFn:S,retry:!1},e[6]=g,e[7]=S,e[8]=_):_=e[8];const I=Ue(_),r=_e.commerceDiscoveryVirtualMcp(i.id,j);let h;e[9]!==a||e[10]!==j?(h=async()=>{const f=await a.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:j}});return xe(f)},e[9]=a,e[10]=j,e[11]=h):h=e[11];let C;e[12]!==r||e[13]!==h?(C={queryKey:r,queryFn:h,retry:!1},e[12]=r,e[13]=h,e[14]=C):C=e[14];const O=Ue(C);let $;e[15]!==a?($=async f=>{const x=await a.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:f}});return xe(x)},e[15]=a,e[16]=$):$=e[16];let P;e[17]!==I||e[18]!==i.id||e[19]!==O?(P=(f,x)=>{se("commerce_onboarding_setup_succeeded",{domain:ve(x)??void 0,organization_id:i.id}),u(null),I.refetch(),O.refetch()},e[17]=I,e[18]=i.id,e[19]=O,e[20]=P):P=e[20];let A;e[21]!==i.id?(A=(f,x)=>{se("commerce_onboarding_setup_failed",{domain:ve(x)??void 0,organization_id:i.id,error:f instanceof Error?f.message:String(f)}),u(f instanceof Error?f.message:"A configuração do Commerce Discovery falhou.")},e[21]=i.id,e[22]=A):A=e[22];let Q;e[23]!==A||e[24]!==$||e[25]!==P?(Q={mutationFn:$,retry:!1,onSuccess:P,onError:A},e[23]=A,e[24]=$,e[25]=P,e[26]=Q):Q=e[26];const b=Te(Q),Ae=!!I.data.item&&!!O.data.item,Ee=I.data.item,W=typeof Ee?.metadata?.siteUrl=="string"?Ee.metadata.siteUrl:void 0,ce=t||n||"";let G;e[27]!==W||e[28]!==ce?(G=Qe(ce,W),e[27]=W,e[28]=ce,e[29]=G):G=e[29];const Y=Ae&&G,J=t||n||W||"";let X;e[30]!==J||e[31]!==s?(X=Ce({siteUrl:J,email:s}),e[30]=J,e[31]=s,e[32]=X):X=e[32];const me=X;let Z;e[33]!==me||e[34]!==i.id?(Z=o.jsx(be,{href:me,orgId:i.id}),e[33]=me,e[34]=i.id,e[35]=Z):Z=e[35];const y=Z;let ee;e[36]!==b?(ee=f=>{const x=pe(f);if(!x.ok){u(Oe(x.error));return}u(null),b.mutate(x.value)},e[36]=b,e[37]=ee):ee=e[37];const D=ee;let te;e[38]!==t||e[39]!==D||e[40]!==Y?(te=f=>{!f||v.current||Y||!t||(v.current=!0,D(t))},e[38]=t,e[39]=D,e[40]=Y,e[41]=te):te=e[41];const de=te;let ie;e[42]!==i.id||e[43]!==D||e[44]!==n?(ie=f=>{f.preventDefault();const x=pe(n);x.ok&&se("commerce_onboarding_site_url_submitted",{domain:new URL(x.value).hostname,organization_id:i.id}),D(n)},e[42]=i.id,e[43]=D,e[44]=n,e[45]=ie):ie=e[45];const z=ie;if(Y){const f=i.slug;let x;e[46]===Symbol.for("react.memo_cache_sentinel")?(x=crypto.randomUUID(),e[46]=x):x=e[46];let T;e[47]!==i.slug?(T={org:f,taskId:x},e[47]=i.slug,e[48]=T):T=e[48];let U;e[49]!==i.id?(U=tt(i.id),e[49]=i.id,e[50]=U):U=e[50];const L=J||void 0;let N;e[51]!==U.id||e[52]!==L?(N={virtualmcpid:U.id,connect:"1",siteUrl:L},e[51]=U.id,e[52]=L,e[53]=N):N=e[53];let w;return e[54]!==T||e[55]!==N?(w=o.jsx(Be,{to:"/$org/$taskId",params:T,search:N,replace:!0}),e[54]=T,e[55]=N,e[56]=w):w=e[56],w}if(b.isPending){let f;return e[57]!==y?(f=o.jsx(ke,{visual:y}),e[57]=y,e[58]=f):f=e[58],f}if(t){let f,x;if(e[59]!==y||e[60]!==z||e[61]!==t||e[62]!==d||e[63]!==i.name||e[64]!==b.isPending||e[65]!==n){x=Symbol.for("react.early_return_sentinel");e:if(f=pe(t),!f.ok){const fe=`A configuração de commerce continuará em ${i.name}.`;let V;e[68]!==fe?(V=o.jsx(k,{title:"Diagnóstico de commerce",description:fe}),e[68]=fe,e[69]=V):V=e[69];const ge=o.jsx(le,{message:Oe(f.error)});let B;e[70]!==z||e[71]!==d||e[72]!==b.isPending||e[73]!==n?(B=o.jsx(he,{siteUrl:n,error:d,isSubmitting:b.isPending,onSiteUrlChange:m,onSubmit:z}),e[70]=z,e[71]=d,e[72]=b.isPending,e[73]=n,e[74]=B):B=e[74];let K;e[75]!==V||e[76]!==ge||e[77]!==B?(K=o.jsxs("div",{className:"grid gap-10",children:[V,ge,B]}),e[75]=V,e[76]=ge,e[77]=B,e[78]=K):K=e[78];let ne;e[79]!==y||e[80]!==K?(ne=o.jsx(R,{visual:y,children:K}),e[79]=y,e[80]=K,e[81]=ne):ne=e[81],x=ne;break e}e[59]=y,e[60]=z,e[61]=t,e[62]=d,e[63]=i.name,e[64]=b.isPending,e[65]=n,e[66]=f,e[67]=x}else f=e[66],x=e[67];if(x!==Symbol.for("react.early_return_sentinel"))return x;const T=`O Commerce Discovery está sendo preparado para ${f.value}.`;let U;e[82]!==T?(U=o.jsx(k,{title:"Diagnóstico de commerce",description:T}),e[82]=T,e[83]=U):U=e[83];let L;e[84]!==z||e[85]!==d||e[86]!==b.isPending||e[87]!==n?(L=d?o.jsxs(o.Fragment,{children:[o.jsx(le,{message:d}),o.jsx(he,{siteUrl:n,error:null,isSubmitting:b.isPending,onSiteUrlChange:m,onSubmit:z})]}):o.jsx(we,{}),e[84]=z,e[85]=d,e[86]=b.isPending,e[87]=n,e[88]=L):L=e[88];let N;e[89]!==U||e[90]!==L||e[91]!==de?(N=o.jsxs("div",{ref:de,className:"grid gap-10",children:[U,L]}),e[89]=U,e[90]=L,e[91]=de,e[92]=N):N=e[92];let w;return e[93]!==y||e[94]!==N?(w=o.jsx(R,{visual:y,children:N}),e[93]=y,e[94]=N,e[95]=w):w=e[95],w}const ue=`A configuração de commerce continuará em ${i.name}.`;let F;e[96]!==ue?(F=o.jsx(k,{title:"Diagnóstico de commerce",description:ue}),e[96]=ue,e[97]=F):F=e[97];let q;e[98]!==z||e[99]!==d||e[100]!==b.isPending||e[101]!==n?(q=o.jsx(he,{siteUrl:n,error:d,isSubmitting:b.isPending,onSiteUrlChange:m,onSubmit:z}),e[98]=z,e[99]=d,e[100]=b.isPending,e[101]=n,e[102]=q):q=e[102];let H;e[103]!==F||e[104]!==q?(H=o.jsxs("div",{className:"grid gap-10",children:[F,q]}),e[103]=F,e[104]=q,e[105]=H):H=e[105];let oe;return e[106]!==y||e[107]!==H?(oe=o.jsx(R,{visual:y,children:H}),e[106]=y,e[107]=H,e[108]=oe):oe=e[108],oe}function he(l){const e=E.c(20),{siteUrl:i,error:t,isSubmitting:s,onSiteUrlChange:c,onSubmit:a}=l;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:"URL do site"}),e[0]=n):n=e[0];let m;e[1]!==c?(m=_=>c(_.target.value),e[1]=c,e[2]=m):m=e[2];const d=!!t;let u;e[3]!==s||e[4]!==i||e[5]!==m||e[6]!==d?(u=o.jsx(Ye,{id:"commerce-site-url",type:"text",inputMode:"url",value:i,onChange:m,placeholder:"https://example.com","aria-invalid":d,disabled:s}),e[3]=s,e[4]=i,e[5]=m,e[6]=d,e[7]=u):u=e[7];let v;e[8]!==t?(v=t?o.jsx(le,{message:t}):null,e[8]=t,e[9]=v):v=e[9];let p;e[10]!==u||e[11]!==v?(p=o.jsxs("div",{className:"grid gap-2",children:[n,u,v]}),e[10]=u,e[11]=v,e[12]=p):p=e[12];let j;e[13]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(it,{size:16}),e[13]=j):j=e[13];let g;e[14]!==s?(g=o.jsxs(je,{type:"submit",size:"xl",className:"w-full",disabled:s,children:["Continuar",j]}),e[14]=s,e[15]=g):g=e[15];let S;return e[16]!==a||e[17]!==p||e[18]!==g?(S=o.jsxs("form",{className:"grid gap-4",onSubmit:a,children:[p,g]}),e[16]=a,e[17]=p,e[18]=g,e[19]=S):S=e[19],S}function le(l){const e=E.c(2),{message:i}=l;let t;return e[0]!==i?(t=o.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:i}),e[0]=i,e[1]=t):t=e[1],t}export{$i as default};
@@ -1 +0,0 @@
1
- import{b as m}from"./extract-connection-data-DEmXsdA0.js";import{b as g}from"./provision-repo-scoped-github-connection-CB4ICKHq.js";function I(n){const e=n.properties;if(!e)return[];const t=[];for(const[r,i]of Object.entries(e)){const a=i?.properties?.__type?.const;typeof a=="string"&&a.length>0&&t.push({fieldKey:r,bindingType:a})}return t}const N=[{fieldKey:"vtex",bindingType:"vtex"},{fieldKey:"ga4",bindingType:"google-analytics"},{fieldKey:"gsc",bindingType:"google-search-console"},{fieldKey:"github",bindingType:"github"}];function S(n,e){const t=[];if(n.length&&t.push({field:["id"],operator:"in",value:n}),e.length&&t.push({field:["name"],operator:"in",value:e}),t.length!==0)return t.length===1?t[0]:{operator:"or",conditions:t}}function w(n){const e=n;if(e.isError)throw new Error(e.content?.find(t=>t.text)?.text??"Tool call failed");return e.structuredContent??n}function R(n,e,t,r){return{...n??{},[e]:{__type:t,value:r}}}function p(n){return n==null?!1:typeof n=="string"?n.trim().length>0:typeof n=="number"||typeof n=="boolean"?!0:Array.isArray(n)?n.some(p):typeof n=="object"?Object.entries(n).some(([e,t])=>!e.startsWith("__")&&p(t)):!1}function h(n){const e={accountName:"Nome da conta",appKey:"App Key",appToken:"App Token",propertyId:"Propriedade",siteUrl:"Site"};return e[n]?e[n]:n.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase())}function b(n){return p(n)?typeof n=="string"?n.trim():typeof n=="number"||typeof n=="boolean"?String(n):JSON.stringify(n):null}function B(n){return n?Object.entries(n).flatMap(([e,t])=>{if(e.startsWith("__"))return[];const r=b(t);return r?[{key:e,label:h(e),value:r}]:[]}):[]}function O({autoOpenFieldKey:n,card:e}){return n===e.fieldKey&&e.satisfied&&!!e.linkedConnectionId}function _(n,e,t){const r=n.filter(i=>(i.app_name===e||!!t&&i.app_id===t)&&g(i)===null);return r.length===0?null:(r.sort((i,o)=>{const s=a=>a.status==="active"?0:1;return s(i)!==s(o)?s(i)-s(o):(o.updated_at??"").localeCompare(i.updated_at??"")}),r[0].id)}function C(n){return n.server?.icons?.[0]?.src??m(n.server?.repository)??null}function T(n,e){const t=n._meta?.["mcp.mesh"];return t?.friendlyName||t?.friendly_name||n.title||n.server?.title||n.server?.name||e}function E(n){const e=[],t=new Map(n.connections.map(r=>[r.id,r]));for(const r of n.requirements){const i=n.curated[r.bindingType],o=i?n.itemsById[i.registryAppId]:n.itemsByName[r.bindingType];if(!o)continue;const s=n.configurationState?.[r.fieldKey]?.value,a=s?t.get(s):void 0,u=s&&a?s:null,d=u?n.connectionReadiness?.[u]!==!1:!1,c=!!u&&d,l=c?void 0:n.saBindings?.[r.bindingType],f=c||!!l,y=c?"oauth":l?"sa":null;e.push({fieldKey:r.fieldKey,bindingType:r.bindingType,registryItem:o,title:T(o,r.bindingType),icon:C(o),headline:i?.headline??o._meta?.["mcp.mesh"]?.short_description??null,area:i?.area??null,bullets:i?.bullets??[],satisfied:f,candidateConnectionId:f?null:u||_(n.connections,r.bindingType,i?.registryAppId),linkedConnectionId:u,configurationState:a?.configuration_state??null,boundVia:y,boundResource:l?.resource??null})}return e}function U(n,e){if(!n)return null;const t=i=>{const o=i.startsWith("sc-domain:")?i.substring(10):(()=>{try{return new URL(i.startsWith("http")?i:`https://${i}`).hostname}catch{return null}})();return o===null?i:o.startsWith("www.")?o.substring(4):o},r=t(n);for(const i of e)if(t(i.siteUrl)===r)return i.siteUrl;return null}function W(n){return(n?.response?.accountSummaries??[]).map(r=>({account:r.account,options:(r.propertySummaries??[]).map(i=>({value:i.property,label:`${i.displayName} (${r.displayName})`}))}))}export{N as F,E as a,S as b,R as c,B as g,U as m,I as p,O as s,W as t,w as u};
@@ -1,2 +0,0 @@
1
- import{c as Y,r as u,j as r,i as oe,B as pe,d$ as jt,aO as Nt,aU as re,e0 as St,e1 as Mt,e2 as Dt,e3 as Rt,bO as Pt,e4 as Et,e5 as Be,aQ as kt,e6 as Tt,e7 as Ot,e8 as At,e9 as Lt,ea as Ft,eb as $t,ec as It,ed as _t,ee as zt,l as ie,n as Gt,t as Q,K as Le}from"./index-BEqdT-CX.js";import{F as Kt,l as Bt}from"./index-BTfVRtBq.js";import{d as Vt,ax as Ut,ay as Wt}from"./agent-icon-jdj2JAEm.js";import{s as Qt}from"./XClose-DxMKQUUD.js";import{A as qt}from"./automation-runs-nQ99AMoV.js";import{b as Fe,T as $e,a as Ie}from"./tooltip-C7c-Tgru.js";import{b as Ht}from"./chat-context-CAoh3qxf.js";import{u as Xt}from"./shell-layout-CcPRSmgX.js";import{s as de,a as _e,f as Yt}from"./index-Bnro1Vjb.js";import{a as Jt,h as Zt,D as en,c as tn,d as nn,e as rn}from"./dialog-BboVhzku.js";import{I as ze}from"./input-CqfDyI-C.js";import{c as on,d as an,b as sn,A as ln,g as cn,e as dn,a as un,f as fn}from"./alert-dialog-DtmlB9JL.js";import{t as mn}from"./ChevronDown-Cpk84lU5.js";import{i as pn}from"./ChevronRight-UlscOqp6.js";import{a as xn}from"./ZoomOut-CvmU5uj5.js";import{v as hn,E as gn,w as Ge,x as ve,y as vn,z as yn,A as Cn,C as H,D as ue,G as wn,g as ye,I as Ce,J as bn,K as jn,M as we,N as fe,O as be,P as Nn,Q as Sn}from"./index-S6xdCjXr.js";import"./AlertCircle-DFFB807G.js";import"./UserPlus01-DjFNU1Mn.js";import"./Tool01-CSravChF.js";import"./ArrowUp-CFU7eduC.js";import"./Settings02-D5c8FtUa.js";import"./Tool02-csu1mOp1.js";import"./XCircle-CiVL5z-e.js";import"./ArrowUpRight-D37SsWBk.js";import"./TrendUp01-Dw2DNRxA.js";import"./ZapSquare-BDp8YrcS.js";import"./Users03-Iz-TpUuJ.js";import"./CheckCircle-BwwAyNzV.js";import"./Check-BAiULwRg.js";import"./ChevronUp-CqCnswy_.js";import"./Circle-pOPoWDQn.js";import"./Stars02-CzKVb8lE.js";import"./Copy01-BEB5hDKQ.js";import"./DotsVertical-BFfMlorx.js";import"./Globe01-DVm51A__.js";import"./Eye-Bbh_ejV6.js";import"./FilterLines-Dm0WP1zI.js";import"./Flag01-e55mynPF.js";import"./Star01-C32-NjaL.js";import"./Globe04-DA8QsMrW.js";import"./SwitchHorizontal01-C8Rnw5uG.js";import"./HardDrive-BJ2MS6we.js";import"./Image01-Y4d3ZI2r.js";import"./Key01-xPUeBTf6.js";import"./LayoutLeft-CNWN8tpf.js";import"./LinkExternal01-B6bTrNoI.js";import"./List-gTaMGV9z.js";import"./Monitor01-BdI_dCjX.js";import"./Sun-BPhwV-Eh.js";import"./Package-WlP_SelV.js";import"./Palette-DwivsXKp.js";import"./Play-BPQdBfbt.js";import"./Plus-C8FiAr3i.js";import"./SearchLg-CMWIHllt.js";import"./SearchMd-Gwm-384G.js";import"./Shield01-Dn6encQp.js";import"./Stars01-C8WemEnv.js";import"./Trash01-DZTkGJqE.js";import"./Upload01-s2ES1URH.js";import"./User01-D0_zDlJM.js";import"./Users01-CAC4FOXB.js";import"./X-CTTK5Zj2.js";import"./Zap-CrYnUVJy.js";import"./select-Bh2Z8rK3.js";import"./useInfiniteQuery-BnNR1NVs.js";import"./use-infinite-scroll-DYbbFqLK.js";import"./use-connection-DUpx0NEA.js";import"./use-collections-Dy7WD_eH.js";import"./use-mcp-client-DvvHwezb.js";import"./constants-D_FQAPnt.js";import"./auth-BR_fNNK7.js";import"./use-virtual-mcp-CNKe_WaY.js";import"./card-CEUspnmz.js";import"./sidebar-CRtkHPvX.js";import"./use-mobile-DbBFg2WD.js";import"./table-VOE9WRkg.js";import"./empty-state-C6JrR5eZ.js";import"./use-members-BZPSqMOT.js";import"./use-org-auth-client-PHOIKqSH.js";import"./use-clock-tick-F8Oybd0p.js";import"./use-automations-CELpHT79.js";import"./studio-tools-Cdt3UzXo.js";import"./useSuspenseInfiniteQuery-3QrNhYz_.js";import"./avatar-DJpRqbqg.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-C0FUXmsm.js";import"./file-type-icon-BR1G8n26.js";import"./tab-id-BijBBRwE.js";import"./hooks-DYM3Q-Vq.js";import"./decopilot-sse-pool-pi1pVqbX.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./monaco-editor-YwujFe9g.js";import"./index-BXfKOYdf.js";import"./integration-icon-Dhyv93zr.js";import"./use-navigate-to-agent-CBi1-FBB.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-oIJCSonG.js";import"./form-p6ZihW38.js";import"./label-DbwTUWd9.js";import"./autosend-CIDdvZqc.js";import"./use-ai-providers-C7iVrgY-.js";import"./use-decopilot-events-btxE-D2k.js";import"./use-organization-settings-CpbybQHD.js";import"./required-auth-layout-BXaZVxWQ.js";import"./use-org-sso-BA_UxewI.js";import"./drawer-D5XLtSzP.js";import"./collection-search-BLJH2aa6.js";import"./tabs-DPmfTv0c.js";import"./toggle-group-BnuMLJr8.js";import"./use-deco-credits-56-eyw-E.js";import"./extract-connection-data-DEmXsdA0.js";import"./connection-card-DPw_9IvV.js";import"./use-registry-connections-CX_dlku1.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-B9g6Z2-r.js";import"./connection-form-helpers-svNTHB1P.js";import"./authenticate-and-persist-oauth-BuaZSTeD.js";import"./mcp-oauth-CeGeftbL.js";import"./collection-tabs-D10lR104.js";import"./badge-zT-Fh3qN.js";import"./connect-desktop-dialog-B4c48mz3.js";import"./select-model-BHB_Fir_.js";import"./checkbox-C7atZRmN.js";import"./skeleton-C-LbiBGP.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-HiisdE7T.js";import"./command-Cih9cb-G.js";import"./index-Dz8rxMiO.js";import"./popover-BJYBT3EY.js";import"./dropdown-menu-DcV4HAvf.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BrRSDeZW.js";import"./toolbar-65iromlk.js";import"./use-mcp-tools-Be4djRS3.js";import"./use-capability-DsC1r5oD.js";import"./use-debounced-autosave-IEMI4Muz.js";import"./index-BXTPhNSj.js";import"./search-input-CYwO2ZSV.js";import"./use-mcp-auth-status-Dy_Y2kKR.js";import"./switch-BL8XQR8K.js";import"./github-repo-picker-B_QoRL-b.js";import"./use-debounced-value-BqHYI-kn.js";import"./provision-repo-scoped-github-connection-CB4ICKHq.js";import"./use-secrets-ChIMRFxc.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./companions-core-Zwoux9HO.js";import"./index-CbMrlBFr.js";import"./get-initials-D-f_fDFw.js";import"./calendar-CibxNjt0.js";import"./toolbar-icon-button-BBh2Csxi.js";import"./use-file-configs-CYmkQ98g.js";import"./automation-list-row-BuCXNsSo.js";const Mn={"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 Dn(s){const e=Y.c(51),{open:i,mode:a,initialName:c,parentLabel:f,isPending:h,onSubmit:p,onOpenChange:v}=s,y=c===void 0?"":c,d=h===void 0?!1:h,[x,C]=u.useState(y),[D,k]=u.useState(i),g=Mn[a];i!==D&&(k(i),i&&C(y));let b;e[0]!==d||e[1]!==v?(b=V=>{!V&&!d&&v(!1)},e[0]=d,e[1]=v,e[2]=b):b=e[2];const U=b;let T;e[3]!==d||e[4]!==x||e[5]!==p?(T=async V=>{V.preventDefault();const q=x.trim();!q||d||await p(q)},e[3]=d,e[4]=x,e[5]=p,e[6]=T):T=e[6];const O=T;let j;e[7]!==g.title?(j=r.jsx(Jt,{children:g.title}),e[7]=g.title,e[8]=j):j=e[8];let w;e[9]!==g.description?(w=r.jsx(Zt,{children:g.description}),e[9]=g.description,e[10]=w):w=e[10];let A;e[11]!==j||e[12]!==w?(A=r.jsxs(en,{children:[j,w]}),e[11]=j,e[12]=w,e[13]=A):A=e[13];let L;e[14]!==f?(L=f&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),r.jsx(ze,{value:f,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=f,e[15]=L):L=e[15];let G;e[16]===Symbol.for("react.memo_cache_sentinel")?(G=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=G):G=e[16];let $;e[17]===Symbol.for("react.memo_cache_sentinel")?($=V=>C(V.target.value),e[17]=$):$=e[17];let I;e[18]!==g.placeholder||e[19]!==d||e[20]!==x?(I=r.jsxs("div",{className:"space-y-1.5",children:[G,r.jsx(ze,{id:"file-explorer-name",value:x,onChange:$,placeholder:g.placeholder,autoFocus:!0,disabled:d})]}),e[18]=g.placeholder,e[19]=d,e[20]=x,e[21]=I):I=e[21];let R;e[22]!==I||e[23]!==L?(R=r.jsxs("div",{className:"space-y-4 py-4",children:[L,I]}),e[22]=I,e[23]=L,e[24]=R):R=e[24];let P;e[25]!==v?(P=()=>v(!1),e[25]=v,e[26]=P):P=e[26];let _;e[27]!==d||e[28]!==P?(_=r.jsx(pe,{type:"button",variant:"outline",onClick:P,disabled:d,children:"Cancel"}),e[27]=d,e[28]=P,e[29]=_):_=e[29];let z;e[30]!==d||e[31]!==x?(z=!x.trim()||d,e[30]=d,e[31]=x,e[32]=z):z=e[32];let N;e[33]!==g.submit||e[34]!==d?(N=d?r.jsxs(r.Fragment,{children:[r.jsx(oe,{size:14,className:"animate-spin"}),"Saving…"]}):g.submit,e[33]=g.submit,e[34]=d,e[35]=N):N=e[35];let K;e[36]!==z||e[37]!==N?(K=r.jsx(pe,{type:"submit",disabled:z,children:N}),e[36]=z,e[37]=N,e[38]=K):K=e[38];let S;e[39]!==_||e[40]!==K?(S=r.jsxs(tn,{children:[_,K]}),e[39]=_,e[40]=K,e[41]=S):S=e[41];let E;e[42]!==O||e[43]!==R||e[44]!==S||e[45]!==A?(E=r.jsx(nn,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:O,children:[A,R,S]})}),e[42]=O,e[43]=R,e[44]=S,e[45]=A,e[46]=E):E=e[46];let W;return e[47]!==U||e[48]!==i||e[49]!==E?(W=r.jsx(rn,{open:i,onOpenChange:U,children:E}),e[47]=U,e[48]=i,e[49]=E,e[50]=W):W=e[50],W}function Rn(s){const e=Y.c(31),{deleteTarget:i,deleteDirtyPaths:a,fsActionPending:c,onOpenChange:f,onConfirm:h}=s,p=i!==null,v=i?.kind==="directory"?"folder":"file";let y;e[0]!==v?(y=r.jsxs(on,{children:["Delete ",v,"?"]}),e[0]=v,e[1]=y):y=e[1];const d=i?.name;let x;e[2]!==d?(x=r.jsx("span",{className:"font-mono",children:d}),e[2]=d,e[3]=x):x=e[3];const C=i?.kind==="directory"?" and everything inside it.":".";let D;e[4]!==a.length?(D=a.length>0&&r.jsxs(r.Fragment,{children:[" ",a.length===1?"One open file has unsaved changes that will be lost.":`${a.length} open files have unsaved changes that will be lost.`]}),e[4]=a.length,e[5]=D):D=e[5];let k;e[6]!==x||e[7]!==C||e[8]!==D?(k=r.jsxs(an,{children:["This will permanently delete"," ",x,C,D]}),e[6]=x,e[7]=C,e[8]=D,e[9]=k):k=e[9];let g;e[10]!==y||e[11]!==k?(g=r.jsxs(sn,{children:[y,k]}),e[10]=y,e[11]=k,e[12]=g):g=e[12];let b;e[13]!==c?(b=r.jsx(ln,{disabled:c,children:"Cancel"}),e[13]=c,e[14]=b):b=e[14];const U=c||!i;let T;e[15]!==i||e[16]!==h?(T=L=>{L.preventDefault(),i&&h(i)},e[15]=i,e[16]=h,e[17]=T):T=e[17];let O;e[18]!==U||e[19]!==T?(O=r.jsx(cn,{disabled:U,onClick:T,children:"Delete"}),e[18]=U,e[19]=T,e[20]=O):O=e[20];let j;e[21]!==b||e[22]!==O?(j=r.jsxs(dn,{children:[b,O]}),e[21]=b,e[22]=O,e[23]=j):j=e[23];let w;e[24]!==j||e[25]!==g?(w=r.jsxs(un,{children:[g,j]}),e[24]=j,e[25]=g,e[26]=w):w=e[26];let A;return e[27]!==f||e[28]!==p||e[29]!==w?(A=r.jsx(fn,{open:p,onOpenChange:f,children:w}),e[27]=f,e[28]=p,e[29]=w,e[30]=A):A=e[30],A}var je="ContextMenu",[Pn]=kt(je,[Be]),B=Be(),[En,Ve]=Pn(je),Ue=s=>{const{__scopeContextMenu:e,children:i,onOpenChange:a,dir:c,modal:f=!0}=s,[h,p]=u.useState(!1),v=B(e),y=Pt(a),d=u.useCallback(x=>{p(x),y(x)},[y]);return r.jsx(En,{scope:e,open:h,onOpenChange:d,modal:f,children:r.jsx(Et,{...v,dir:c,open:h,onOpenChange:d,modal:f,children:i})})};Ue.displayName=je;var We="ContextMenuTrigger",Qe=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,disabled:a=!1,...c}=s,f=Ve(We,i),h=B(i),p=u.useRef({x:0,y:0}),v=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...p.current})}),y=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(y.current),[]),x=C=>{p.current={x:C.clientX,y:C.clientY},f.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(jt,{...h,virtualRef:v}),r.jsx(Nt.span,{"data-state":f.open?"open":"closed","data-disabled":a?"":void 0,...c,ref:e,style:{WebkitTouchCallout:"none",...s.style},onContextMenu:a?s.onContextMenu:re(s.onContextMenu,C=>{d(),x(C),C.preventDefault()}),onPointerDown:a?s.onPointerDown:re(s.onPointerDown,me(C=>{d(),y.current=window.setTimeout(()=>x(C),700)})),onPointerMove:a?s.onPointerMove:re(s.onPointerMove,me(d)),onPointerCancel:a?s.onPointerCancel:re(s.onPointerCancel,me(d)),onPointerUp:a?s.onPointerUp:re(s.onPointerUp,me(d))})]})});Qe.displayName=We;var kn="ContextMenuPortal",qe=s=>{const{__scopeContextMenu:e,...i}=s,a=B(e);return r.jsx(Dt,{...a,...i})};qe.displayName=kn;var He="ContextMenuContent",Xe=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=Ve(He,i),f=B(i),h=u.useRef(!1);return r.jsx(Rt,{...f,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:p=>{s.onCloseAutoFocus?.(p),!p.defaultPrevented&&h.current&&p.preventDefault(),h.current=!1},onInteractOutside:p=>{s.onInteractOutside?.(p),!p.defaultPrevented&&!c.modal&&(h.current=!0)},style:{...s.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Xe.displayName=He;var Tn="ContextMenuGroup",On=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(Tt,{...c,...a,ref:e})});On.displayName=Tn;var An="ContextMenuLabel",Ln=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(Ot,{...c,...a,ref:e})});Ln.displayName=An;var Fn="ContextMenuItem",Ye=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(St,{...c,...a,ref:e})});Ye.displayName=Fn;var $n="ContextMenuCheckboxItem",In=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(At,{...c,...a,ref:e})});In.displayName=$n;var _n="ContextMenuRadioGroup",zn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(Lt,{...c,...a,ref:e})});zn.displayName=_n;var Gn="ContextMenuRadioItem",Kn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(Ft,{...c,...a,ref:e})});Kn.displayName=Gn;var Bn="ContextMenuItemIndicator",Vn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx($t,{...c,...a,ref:e})});Vn.displayName=Bn;var Un="ContextMenuSeparator",Je=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(Mt,{...c,...a,ref:e})});Je.displayName=Un;var Wn="ContextMenuArrow",Qn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(It,{...c,...a,ref:e})});Qn.displayName=Wn;var qn="ContextMenuSubTrigger",Hn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(_t,{...c,...a,ref:e})});Hn.displayName=qn;var Xn="ContextMenuSubContent",Yn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(zt,{...c,...a,ref:e,style:{...s.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Yn.displayName=Xn;function me(s){return e=>e.pointerType!=="mouse"?s(e):void 0}var Jn=Ue,Zn=Qe,er=qe,tr=Xe,nr=Ye,rr=Je;function or(s){const e=Y.c(4);let i;e[0]!==s?({...i}=s,e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==i?(a=r.jsx(Jn,{"data-slot":"context-menu",...i}),e[2]=i,e[3]=a):a=e[3],a}function ir(s){const e=Y.c(4);let i;e[0]!==s?({...i}=s,e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==i?(a=r.jsx(Zn,{"data-slot":"context-menu-trigger",...i}),e[2]=i,e[3]=a):a=e[3],a}function ar(s){const e=Y.c(8);let i,a;e[0]!==s?({className:i,...a}=s,e[0]=s,e[1]=i,e[2]=a):(i=e[1],a=e[2]);let c;e[3]!==i?(c=ie("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-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",i),e[3]=i,e[4]=c):c=e[4];let f;return e[5]!==a||e[6]!==c?(f=r.jsx(er,{children:r.jsx(tr,{"data-slot":"context-menu-content",className:c,...a})}),e[5]=a,e[6]=c,e[7]=f):f=e[7],f}function ee(s){const e=Y.c(12);let i,a,c,f;e[0]!==s?({className:i,inset:a,variant:f,...c}=s,e[0]=s,e[1]=i,e[2]=a,e[3]=c,e[4]=f):(i=e[1],a=e[2],c=e[3],f=e[4]);const h=f===void 0?"default":f;let p;e[5]!==i?(p=ie("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-default items-center gap-2 rounded-sm 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",i),e[5]=i,e[6]=p):p=e[6];let v;return e[7]!==a||e[8]!==c||e[9]!==p||e[10]!==h?(v=r.jsx(nr,{"data-slot":"context-menu-item","data-inset":a,"data-variant":h,className:p,...c}),e[7]=a,e[8]=c,e[9]=p,e[10]=h,e[11]=v):v=e[11],v}function Ke(s){const e=Y.c(8);let i,a;e[0]!==s?({className:i,...a}=s,e[0]=s,e[1]=i,e[2]=a):(i=e[1],a=e[2]);let c;e[3]!==i?(c=ie("bg-border -mx-1 my-1 h-px",i),e[3]=i,e[4]=c):c=e[4];let f;return e[5]!==a||e[6]!==c?(f=r.jsx(rr,{"data-slot":"context-menu-separator",className:c,...a}),e[5]=a,e[6]=c,e[7]=f):f=e[7],f}const sr="#d9a441";function lr(s){const e=Y.c(45),{node:i,depth:a,isExpanded:c,isSelected:f,isLoading:h,fileVisual:p,onOpen:v,onSelect:y,onNewFile:d,onNewFolder:x,onCopyPath:C,onCopyRelativePath:D,onRename:k,onDelete:g}=s,b=h===void 0?!1:h,U=i.kind==="directory",{Icon:T,color:O}=p,j=f&&"bg-accent";let w;e[0]!==j?(w=ie("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",j),e[0]=j,e[1]=w):w=e[1];const A=`${a*14+8}px`;let L;e[2]!==A?(L={paddingLeft:A},e[2]=A,e[3]=L):L=e[3];let G;e[4]!==v||e[5]!==y?(G=()=>{y(),v()},e[4]=v,e[5]=y,e[6]=G):G=e[6];let $;e[7]!==T||e[8]!==O||e[9]!==U||e[10]!==c||e[11]!==b?($=U?r.jsxs(r.Fragment,{children:[b?r.jsx(oe,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):c?r.jsx(mn,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(pn,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(xn,{size:16,className:"shrink-0",style:{color:sr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(T,{size:16,className:"shrink-0",style:{color:O}})]}),e[7]=T,e[8]=O,e[9]=U,e[10]=c,e[11]=b,e[12]=$):$=e[12];let I;e[13]!==i.name?(I=r.jsx("span",{className:"truncate",children:i.name}),e[13]=i.name,e[14]=I):I=e[14];let R;e[15]!==w||e[16]!==L||e[17]!==G||e[18]!==$||e[19]!==I?(R=r.jsx(ir,{asChild:!0,children:r.jsxs("button",{type:"button",className:w,style:L,onClick:G,children:[$,I]})}),e[15]=w,e[16]=L,e[17]=G,e[18]=$,e[19]=I,e[20]=R):R=e[20];let P;e[21]!==d?(P=r.jsx(ee,{onSelect:d,children:"New File"}),e[21]=d,e[22]=P):P=e[22];let _;e[23]!==x?(_=r.jsx(ee,{onSelect:x,children:"New Folder"}),e[23]=x,e[24]=_):_=e[24];let z;e[25]===Symbol.for("react.memo_cache_sentinel")?(z=r.jsx(Ke,{}),e[25]=z):z=e[25];let N;e[26]!==C?(N=r.jsx(ee,{onSelect:C,children:"Copy Path"}),e[26]=C,e[27]=N):N=e[27];let K;e[28]!==D?(K=r.jsx(ee,{onSelect:D,children:"Copy Relative Path"}),e[28]=D,e[29]=K):K=e[29];let S;e[30]===Symbol.for("react.memo_cache_sentinel")?(S=r.jsx(Ke,{}),e[30]=S):S=e[30];let E;e[31]!==k?(E=r.jsx(ee,{onSelect:k,children:"Rename"}),e[31]=k,e[32]=E):E=e[32];let W;e[33]!==g?(W=r.jsx(ee,{variant:"destructive",onSelect:g,children:"Delete"}),e[33]=g,e[34]=W):W=e[34];let V;e[35]!==P||e[36]!==_||e[37]!==N||e[38]!==K||e[39]!==E||e[40]!==W?(V=r.jsxs(ar,{className:"w-52",children:[P,_,z,N,K,S,E,W]}),e[35]=P,e[36]=_,e[37]=N,e[38]=K,e[39]=E,e[40]=W,e[41]=V):V=e[41];let q;return e[42]!==V||e[43]!==R?(q=r.jsxs(or,{children:[R,V]}),e[42]=V,e[43]=R,e[44]=q):q=e[44],q}Bt.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function cr(s,e,i,a){return`/api/${s}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(i)}/${a}`}function oa({orgSlug:s,virtualMcpId:e,branch:i,openPath:a}){const[c,f]=u.useState({files:[],directories:[],truncated:!1}),{files:h,directories:p}=c,[v,y]=u.useState(new Set),[d,x]=u.useState(null),[C,D]=u.useState(null),[k,g]=u.useState([]),[b,U]=u.useState(""),[T,O]=u.useState(!1),[j,w]=u.useState(!1),[,A]=u.useState(new Set),[L,G]=u.useState(new Set),$=u.useRef(0),I=u.useRef(null),R=u.useRef(new Set),P=u.useRef(new Map);function _(t){A(n=>{const o=typeof t=="function"?t(n):t;return R.current=o,o})}const[z,N]=u.useState(new Map),K=u.useRef(null),[S,E]=u.useState(null),{sendMessage:W}=Ht(),{openSidePanel:V}=Xt(),q=Gt(),[F,X]=u.useState(null),[xe,he]=u.useState(null),[ae,se]=u.useState(!1);async function J(t,n){const o=await fetch(cr(s,e,i,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const l=await o.json().catch(()=>({}));throw new Error(l.error??`Request failed (${o.status})`)}return o.json()}async function le(){q.invalidateQueries({queryKey:_e(s,e,i)})}function Ne(t,n){navigator.clipboard.writeText(n).then(()=>Q.success(`${t} copied`),()=>Q.error(`Failed to copy ${t.toLowerCase()}`))}function Ze(t){const n=Nn(t);if(!n)return;const o=`${s}/${e}/${i}`;q.setQueryData(Le.decofile(o),l=>{if(!l)return l;const{[n]:m,...M}=l;return M}),q.invalidateQueries({queryKey:Le.liveMeta(s,e,i)})}function et(t){const n=t.kind==="file"?[t.path]:h.filter(o=>o.startsWith(".deco/blocks/")).map(o=>ue(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)Ze(o)}function tt(t){const n=ue(t);return k.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const l=z.get(o);return!!(l?.loaded&&l.editorValue!==l.savedContent)})}function Se(t){g(n=>n.map(o=>t(o)).filter(o=>o!==null)),x(n=>n&&t(n)),N(n=>{const o=new Map;for(const[l,m]of n){const M=t(l);M&&o.set(M,m)}return o}),D(n=>{if(!n)return n;const o=t(n.path);return o?o===n.path?n:{...n,path:o,name:o.split("/").pop()??o}:null})}function nt(t){const n=ue(t);D(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Se(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function rt(t){if(!F)return;const n=fe(F.parentDir,t);if(be(n,h,p))throw new Error(`"${t}" already exists`);await J("write",{path:H(n),content:""}),await te(),await le(),X(null),ge(n)}async function ot(t){if(!F)return;const n=fe(F.parentDir,t);if(be(n,h,p))throw new Error(`"${t}" already exists`);const o=H(n);await J("mkdir",{path:o}),f(l=>({...l,directories:l.directories.includes(o)?l.directories:[...l.directories,o]})),await te(),await le(),X(null),y(l=>{const m=new Set(l);for(const M of ve(n))m.add(M);return m.add(n),m}),D({name:t,path:n,kind:"directory",children:[]})}async function it(t){if(!F)return;const n=F.node.path,o=we(n),l=fe(o,t);if(l===n){X(null);return}if(be(l,h,p))throw new Error(`"${t}" already exists`);await J("rename",{from:H(n),to:H(l)}),Se(m=>m===n?l:m.startsWith(`${n}/`)?fe(l,m.slice(n.length+1)):m),await te(),await le(),X(null)}async function at(t){se(!0);try{await J("unlink",{path:H(t.path),recursive:t.kind==="directory"}),et(t),nt(t.path),await te(),await le(),he(null),Q.success(`Deleted "${t.name}"`)}catch(n){Q.error(n instanceof Error?n.message:"Delete failed")}finally{se(!1)}}async function st(t){const n=jn(t);if(n){Q.error(n);return}se(!0);try{F?.mode==="new-file"?(await rt(t),Q.success(`Created "${t}"`)):F?.mode==="new-folder"?(await ot(t),Q.success(`Created folder "${t}"`)):F?.mode==="rename"&&(await it(t),Q.success(`Renamed to "${t}"`))}catch(o){Q.error(o instanceof Error?o.message:"Operation failed")}finally{se(!1)}}const Me=u.useRef(!1);Me.current||(Me.current=!0,I.current=te());const[lt,ct]=u.useState(null);if(a&&a!==lt){ct(a);const t=a;queueMicrotask(()=>{hn(t)&&ge(t).catch(n=>{Q.error(n instanceof Error?n.message:"Failed to open file")})})}async function De(t){const n=await J("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Re(t,n,o){if(o!==$.current)return!1;let l=!1;return f(m=>{const M=n?Sn(m.files,m.directories,t,m.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return l=!!M.truncated,{files:M.files,directories:M.directories,truncated:l}}),l&&Q.warning("File list truncated — some files may be hidden"),l}async function dt(t){const n=P.current.get(t);if(n)return n;const o=$.current,l=(async()=>{const m=await De({pattern:"**/*",path:H(t),limit:Ge}),M=Re(m,!0,o);return!M&&o===$.current&&_(ne=>{const ce=new Set(ne);return ce.add(t),ce}),M})();P.current.set(t,l);try{return await l}finally{P.current.delete(t)}}async function Pe(t){if(!Ce(t,R.current))return!1;G(n=>new Set(n).add(t));try{return await dt(t)}finally{G(n=>{const o=new Set(n);return o.delete(t),o})}}async function ut(t){const n=new Set(R.current);for(const o of ve(t)){if(!Ce(o,n))continue;if(await Pe(o))throw new Error("Folder listing truncated — expand again to load more");n.add(o)}}async function te(){const t=++$.current;P.current.clear(),O(!0),_(new Set),y(new Set),G(new Set);try{const n=await De({pattern:"**/*",limit:Ge,maxDepth:gn});Re(n,!1,t),w(!0)}catch{j&&Q.error("Failed to refresh file tree")}finally{O(!1)}}async function Ee(t){if(!z.get(t)?.loaded){N(o=>{const l=new Map(o);return l.set(t,{savedContent:"",editorValue:"",loaded:!1}),l});try{const o=await J("read",{path:H(t),full:!0}),l=bn(o.content??"");N(m=>{const M=new Map(m);return M.set(t,{savedContent:l,editorValue:l,loaded:!0}),M})}catch{}}}async function ft(t,n){try{await J("write",{path:H(t),content:n}),de("file saved via sandbox /write",{path:t}),q.invalidateQueries({queryKey:_e(s,e,i)});try{const o=await Yt(s,e,i);de("git status after save",o)}catch(o){de("git status after save failed",{path:t,error:o instanceof Error?o.message:String(o)})}N(o=>{const l=new Map(o),m=l.get(t);return m&&l.set(t,{...m,savedContent:n}),l})}catch(o){de("file save failed",{path:t,error:o instanceof Error?o.message:String(o)})}}function mt(t){x(t),D({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),E(null),k.includes(t)||g(n=>[...n,t]),Ee(t)}function pt(t){g(n=>{const o=n.filter(l=>l!==t);return d===t&&x(o[o.length-1]??null),o}),N(n=>{const o=new Map(n);return o.delete(t),o})}function ke(t){y(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function xt(t){if(Ce(t,R.current))try{if(await Pe(t))return}catch(n){Q.error(n instanceof Error?n.message:"Failed to load folder");return}ke(t)}async function ht(t,n){if(n){ke(t);return}await xt(t)}async function ge(t){await I.current,await ut(t);const n=ve(t);y(o=>{const l=new Set(o);for(const m of n)l.add(m);return l}),mt(t)}function gt(){return C?.kind==="directory"?C.path:C?.kind==="file"?we(C.path):d?we(d):"/"}function Te(t){const n=gt();X({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const vt=vn(h,p),Oe=yn(vt,v),Ae=b?Oe.filter(t=>t.node.name.toLowerCase().includes(b.toLowerCase())):Oe,Z=d?z.get(d):null,yt=Z?.loaded&&Z.editorValue!==Z.savedContent,Ct=xe?tt(xe.path):[],wt=(t,n)=>{K.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await ft(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),l=t.getModel();if(!o||!l||!d)return;const m=l.getValueInRange(o);E({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:m})})};function bt(t){if(!S)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${S.filePath}\``,`**Lines:** ${S.lineStart}–${S.lineEnd}`];if(S.selectedCode){const o=ye(S.filePath),l=S.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,l,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),V("chat"),W({parts:[{type:"text",text:n.join(`
2
- `)}]}),E(null)}return T&&!j?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(oe,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[r.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[r.jsxs("div",{className:"relative min-w-0 flex-1",children:[r.jsx(Vt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",value:b,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"})]}),r.jsxs(Fe,{children:[r.jsx($e,{asChild:!0,children:r.jsx(pe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New file",onClick:()=>Te("new-file"),children:r.jsx(Ut,{size:14})})}),r.jsx(Ie,{side:"bottom",children:"New file"})]}),r.jsxs(Fe,{children:[r.jsx($e,{asChild:!0,children:r.jsx(pe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New folder",onClick:()=>Te("new-folder"),children:r.jsx(Wt,{size:14})})}),r.jsx(Ie,{side:"bottom",children:"New folder"})]})]}),r.jsx(qt,{className:"flex-1",children:r.jsxs("div",{className:"py-1",children:[Ae.map(t=>{const{node:n,depth:o}=t,l=n.kind==="directory",m=v.has(n.path),M=C?.path===n.path,ne=Cn(n.path,n.kind),ce=l&&L.has(n.path);return r.jsx(lr,{node:n,depth:o,isExpanded:m,isSelected:M,isLoading:ce,fileVisual:wn(n.name),onSelect:()=>D(n),onOpen:()=>{l?ht(n.path,m):ge(n.path)},onNewFile:()=>X({mode:"new-file",node:n,parentDir:ne}),onNewFolder:()=>X({mode:"new-folder",node:n,parentDir:ne}),onCopyPath:()=>Ne("Path",ue(n.path)),onCopyRelativePath:()=>Ne("Relative path",H(n.path)),onRename:()=>X({mode:"rename",node:n,parentDir:ne}),onDelete:()=>he(n)},n.path)}),j&&Ae.length===0&&r.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:b?`No files match "${b}"`:"No files found"})]})})]}),r.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[k.length>0&&r.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:k.map(t=>{const n=z.get(t),o=n?.loaded&&n.editorValue!==n.savedContent,l=d===t,m=t.split("/").pop()??t;return r.jsxs("div",{className:ie("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",l?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{x(t),Ee(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":l,children:[r.jsx("span",{className:"truncate max-w-32",children:m}),o&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),r.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:M=>{M.stopPropagation(),pt(t)},children:r.jsx(Qt,{size:12})})]},t)})}),S&&r.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:r.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 o=t.currentTarget.elements.namedItem("askAiInput");o.value.trim()&&bt(o.value)},children:[r.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"&&E(null)}}),r.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:r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[r.jsx("title",{children:"Send"}),r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),r.jsx("div",{className:"flex-1 overflow-hidden",children:d&&Z?.loaded?r.jsx(Kt,{language:ye(d),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:Z.editorValue,path:d,onChange:t=>{const n=d;n&&N(o=>{const l=new Map(o),m=l.get(n);return m&&l.set(n,{...m,editorValue:t??""}),l})},onMount:wt,loading:r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(oe,{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}}},d):d&&!Z?.loaded?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(oe,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:"Select a file to edit"})}),d&&r.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[r.jsx("span",{className:"truncate",children:d}),r.jsxs("span",{children:[yt?"Modified":"Saved"," ·"," ",ye(d)]})]})]}),r.jsx(Dn,{open:F!==null,mode:F?.mode??"new-file",initialName:F?.mode==="rename"?F.node.name:"",parentLabel:F&&F.mode!=="rename"?F.parentDir==="/"?"/":H(F.parentDir):void 0,isPending:ae,onSubmit:st,onOpenChange:t=>{!t&&!ae&&X(null)}}),r.jsx(Rn,{deleteTarget:xe,deleteDirtyPaths:Ct,fsActionPending:ae,onOpenChange:t=>{!t&&!ae&&he(null)},onConfirm:t=>{at(t)}})]})}export{oa as FileExplorer};
@@ -1 +0,0 @@
1
- import{c as A,j as t,C as F,a as Y,n as M,r as T,ac as H,i as z,d as B,t as U,dH as W,K as R,m as X,B as Z,l as D,v as ee,w as te}from"./index-BEqdT-CX.js";import{D as ne,a as se,d as oe,e as ie}from"./dialog-BboVhzku.js";import{C as le}from"./collection-search-BLJH2aa6.js";import{u as re}from"./use-debounced-value-BqHYI-kn.js";import{b as Q,u as ae}from"./use-connection-DUpx0NEA.js";import{u as L}from"./use-mcp-client-DvvHwezb.js";import{W as ce,S as V}from"./constants-D_FQAPnt.js";import{a as K}from"./authenticate-and-persist-oauth-BuaZSTeD.js";import{b as J}from"./Settings02-D5c8FtUa.js";import{I as ue}from"./agent-icon-jdj2JAEm.js";import{u as de}from"./use-mcp-tools-Be4djRS3.js";import{e as me}from"./extract-connection-data-DEmXsdA0.js";import{c as fe}from"./use-navigate-to-agent-CBi1-FBB.js";import{g as xe,p as q,f as ge}from"./provision-repo-scoped-github-connection-CB4ICKHq.js";function G(y){const e=A.c(4),{size:n,className:i}=y;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=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]=h):h=e[0];let r;return e[1]!==i||e[2]!==n?(r=t.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:i,children:h}),e[1]=i,e[2]=n,e[3]=r):r=e[3],r}function he(y,e){const n=A.c(12),{org:i}=F();let h;n[0]!==i.id?(h=ce.REGISTRY(i.id),n[0]=i.id,n[1]=h):h=n[1];const r=h;let o;n[2]!==i.id||n[3]!==i.slug||n[4]!==r?(o={connectionId:r,orgId:i.id,orgSlug:i.slug},n[2]=i.id,n[3]=i.slug,n[4]=r,n[5]=o):o=n[5];const p=L(o);let c;n[6]!==y?(c={name:y},n[6]=y,n[7]=c):c=n[7];const b=e?.enabled??!0;let C;return n[8]!==p||n[9]!==c||n[10]!==b?(C={client:p,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:c,enabled:b,staleTime:3e5,select:pe},n[8]=p,n[9]=c,n[10]=b,n[11]=C):C=n[11],de(C)}function pe(y){return y.structuredContent?.item??null}const be="deco/mcp-github";function ye(y){const{org:e}=F(),{data:n}=Y.useSession(),i=Q(),h=M(),[r,o]=T.useState("idle"),[p,c]=T.useState(null),[b,C]=T.useState(null),{data:j,isLoading:u}=he(be,{enabled:y.enabled}),l=T.useRef(!1);y.enabled&&j&&!u&&!l.current&&n?.user?.id&&r==="idle"&&(l.current=!0,d());async function d(){if(!(!j||!n?.user?.id||!e))try{o("installing"),c(null);const a=me(j,e.id,n.user.id,{remoteIndex:0});if(!a.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:N}=await i.create.mutateAsync(a);o("authenticating");const x=await K({connectionId:N,orgId:e.id,orgSlug:e.slug,persistFallback:s=>i.update.mutateAsync({id:N,data:{connection_token:s}}).then(()=>{})});if(x.ran&&!x.ok){try{await i.delete.mutateAsync(N)}catch{}throw new Error(x.error&&x.error!=="no token received"?x.error:"No token received from GitHub")}H(h,e.id),C(a),o("ready")}catch(a){c(a instanceof Error?a.message:String(a)),o("error")}}function m(){o("idle"),c(null),C(null),l.current=!1}return y.enabled&&u&&r==="idle"?{status:"installing",error:null,connection:null,retry:m}:{status:r,error:p,connection:b,retry:m}}function De(y){const e=A.c(22),{open:n,onOpenChange:i,title:h,onImportComplete:r,mode:o}=y,p=o===void 0?"agent":o,c=h??(p==="connection"?"Add repo":"Import from GitHub"),[b,C]=T.useState(null);let j;e[0]!==c?(j=t.jsx(ne,{className:"sr-only",children:t.jsx(se,{children:c})}),e[0]=c,e[1]=j):j=e[1];let u;e[2]!==c||e[3]!==b?(u=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:b?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>C(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(J,{size:16})}),t.jsx("img",{src:b.avatarUrl,alt:b.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:b.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(G,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:c})]})}),e[2]=c,e[3]=b,e[4]=u):u=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(z,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=l):l=e[5];let d;e[6]!==i?(d=()=>i(!1),e[6]=i,e[7]=d):d=e[7];let m;e[8]!==p||e[9]!==r||e[10]!==n||e[11]!==b||e[12]!==d?(m=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(T.Suspense,{fallback:l,children:t.jsx(je,{open:n,onComplete:d,selectedInstallation:b,onSelectInstallation:C,onImportComplete:r,mode:p})})}),e[8]=p,e[9]=r,e[10]=n,e[11]=b,e[12]=d,e[13]=m):m=e[13];let a;e[14]!==j||e[15]!==u||e[16]!==m?(a=t.jsxs(oe,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[j,u,m]}),e[14]=j,e[15]=u,e[16]=m,e[17]=a):a=e[17];let f;return e[18]!==i||e[19]!==n||e[20]!==a?(f=t.jsx(ie,{open:n,onOpenChange:i,children:a}),e[18]=i,e[19]=n,e[20]=a,e[21]=f):f=e[21],f}function je({open:y,onComplete:e,selectedInstallation:n,onSelectInstallation:i,onImportComplete:h,mode:r="agent"}){const{org:o}=F(),p=M(),c=fe(),[b,C]=T.useState(null),j=ae({slug:"mcp-github"}),u=xe(j),l=ye({enabled:y&&u.length===0}),d=u.length===1?u[0]??null:b,m=L({connectionId:d?.id??"",orgId:o.id,orgSlug:o.slug}),a=L({connectionId:V,orgId:o.id,orgSlug:o.slug}),f=async(s,v)=>{try{const _=await m.callTool({name:"get_file_contents",arguments:{owner:s.owner,repo:s.name,path:v}});if(_.isError)return null;const I=_.content?.find(g=>g.type==="resource")?.resource?.text;if(!I)return null;try{const g=JSON.parse(I);return typeof g=="string"?g:JSON.stringify(g)}catch{return I}}catch{return null}},N=(s,v)=>{Promise.all([f(v,"AGENTS.md"),f(v,"CLAUDE.md")]).then(async([S,_])=>{const w=S??_??null;w&&(await a.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:s,data:{metadata:{instructions:w}}}}),H(p,o.id))}).catch(S=>{console.error("GitHub instructions fetch failed:",S)})},x=B({mutationFn:async s=>{if(!d||!n)throw new Error("No GitHub connection or installation");const v=n.installationId;if(r==="connection"){const{childConnectionId:w}=await q({orgSlug:o.slug,sourceConnection:d,installationId:v,owner:s.owner,repo:s.name,githubCallTool:I=>m.callTool(I),selfCallTool:I=>a.callTool(I),orgShared:!0});return{virtualMcpId:null,repo:s,connectionId:w,item:null}}const{childConnectionId:S}=await q({orgSlug:o.slug,sourceConnection:d,installationId:v,owner:s.owner,repo:s.name,githubCallTool:w=>m.callTool(w),selfCallTool:w=>a.callTool(w)});let _=null;try{const w=await a.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:s.name,description:s.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:s.owner,name:s.name,url:s.url,installationId:v,connectionId:S},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:S}]}}}),I=w.structuredContent??w,g=I.item?.id;if(!I.item||!g)throw new Error("Failed to create the imported agent");return _=g,{virtualMcpId:g,repo:s,connectionId:S,item:I.item}}catch(w){throw _&&await a.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:_}}).catch(()=>{}),await a.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:S,force:!0}}).catch(()=>{}),w}},onSuccess:({virtualMcpId:s,repo:v,connectionId:S,item:_})=>{if(r==="connection"||!s||!_){H(p,o.id),W(p,o.id),U.success(`Added ${v.name}`),e();return}if(p.setQueryData(R.collectionItem(a,o.id,"","VIRTUAL_MCP",s),{item:_}),H(p,o.id),N(s,v),h){h({virtualMcpId:s,repo:v,connectionId:S});return}U.success(`Imported ${v.name} from GitHub`),e(),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),c(s)},onError:s=>{U.error("Failed to import repo: "+(s instanceof Error?s.message:"Unknown error"))}});return l.status==="installing"||l.status==="authenticating"?t.jsx($,{status:l.status,error:null,retry:l.retry}):l.status==="error"?t.jsx($,{status:"error",error:l.error,retry:l.retry}):u.length===0&&l.status==="idle"?t.jsx($,{status:"installing",error:null,retry:l.retry}):u.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"})}),u.map(s=>t.jsxs("button",{type:"button",onClick:()=>C(s),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[s.icon?t.jsx("img",{src:s.icon,alt:s.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(G,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:s.title})]},s.id))]}):d?n?t.jsx(we,{connectionId:d.id,orgId:o.id,orgSlug:o.slug,installation:n,onSelectRepo:s=>x.mutate(s),isSaving:x.isPending}):t.jsx(Ne,{connectionId:d.id,orgId:o.id,orgSlug:o.slug,onSelect:i,showBackButton:u.length>1,onBack:()=>C(null)}):null}function Ne(y){const e=A.c(47),{connectionId:n,orgId:i,orgSlug:h,onSelect:r,showBackButton:o,onBack:p}=y;let c;e[0]!==i||e[1]!==h?(c={connectionId:V,orgId:i,orgSlug:h},e[0]=i,e[1]=h,e[2]=c):c=e[2];const b=L(c),C=M(),j=Q();let u;e[3]!==n||e[4]!==i?(u=R.githubUserOrgs(i,n),e[3]=n,e[4]=i,e[5]=u):u=e[5];let l;e[6]!==n||e[7]!==b?(l=()=>ge(g=>b.callTool(g),n),e[6]=n,e[7]=b,e[8]=l):l=e[8];let d;e[9]!==u||e[10]!==l?(d={queryKey:u,queryFn:l},e[9]=u,e[10]=l,e[11]=d):d=e[11];const m=X(d);let a;e[12]!==j||e[13]!==n||e[14]!==m||e[15]!==i||e[16]!==h||e[17]!==C?(a={mutationFn:async()=>{const g=await K({connectionId:n,orgId:i,orgSlug:h,persistFallback:E=>j.update.mutateAsync({id:n,data:{connection_token:E}}).then(Ce)});if(g.ran&&!g.ok)throw new Error(g.error??"no token received");const k=new URL(`/api/${h}/mcp/${n}`,window.location.origin);await C.invalidateQueries({queryKey:R.isMCPAuthenticated(k.href,null)}),await C.invalidateQueries({queryKey:R.mcpClientPrefix()}),await m.refetch()},onError:ve},e[12]=j,e[13]=n,e[14]=m,e[15]=i,e[16]=h,e[17]=C,e[18]=a):a=e[18];const f=B(a);if(m.isLoading){let g;return e[19]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(z,{size:18,className:"animate-spin text-muted-foreground"})}),e[19]=g):g=e[19],g}if(m.isError){let g,k;e[20]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load GitHub accounts"}),k=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[280px] leading-relaxed",children:"Your GitHub connection may have expired. Reconnect to restore access."}),e[20]=g,e[21]=k):(g=e[20],k=e[21]);let E;e[22]!==f?(E=()=>f.mutate(),e[22]=f,e[23]=E):E=e[23];let P;e[24]!==f.isPending?(P=f.isPending?t.jsx(z,{size:14,className:"animate-spin"}):t.jsx(G,{className:"size-3.5"}),e[24]=f.isPending,e[25]=P):P=e[25];let O;return e[26]!==f.isPending||e[27]!==E||e[28]!==P?(O=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 text-center",children:[g,k,t.jsxs(Z,{type:"button",variant:"outline",size:"sm",onClick:E,disabled:f.isPending,children:[P,"Reconnect GitHub"]})]}),e[26]=f.isPending,e[27]=E,e[28]=P,e[29]=O):O=e[29],O}const N=m.data;if(!N)return null;let x;e[30]!==p||e[31]!==o?(x=o&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:p,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(J,{size:12}),"Change connection"]})}),e[30]=p,e[31]=o,e[32]=x):x=e[32];let s;if(e[33]!==N.installations||e[34]!==r){let g;e[36]!==r?(g=k=>t.jsxs("button",{type:"button",onClick:()=>r(k),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:k.avatarUrl,alt:k.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:k.login}),k.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 →"})]},k.installationId),e[36]=r,e[37]=g):g=e[37],s=N.installations.map(g),e[33]=N.installations,e[34]=r,e[35]=s}else s=e[35];let v;e[38]!==s?(v=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:s}),e[38]=s,e[39]=v):v=e[39];const S=N.appSlug?`https://github.com/apps/${N.appSlug}/installations/new`:"https://github.com/settings/installations";let _;e[40]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx("span",{className:"underline underline-offset-2",children:"Install the GitHub App"}),e[40]=_):_=e[40];let w;e[41]!==S?(w=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:S,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:["Account not listed?"," ",_]})}),e[41]=S,e[42]=w):w=e[42];let I;return e[43]!==w||e[44]!==x||e[45]!==v?(I=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[x,v,w]}),e[43]=w,e[44]=x,e[45]=v,e[46]=I):I=e[46],I}function ve(y){U.error("Failed to reconnect GitHub: "+(y instanceof Error?y.message:"Unknown error"))}function Ce(){}function we(y){const e=A.c(20),{connectionId:n,orgId:i,orgSlug:h,installation:r,onSelectRepo:o,isSaving:p}=y,[c,b]=T.useState(""),C=re(c,300),j=T.useDeferredValue(C),u=c!==j;let l;e[0]!==u||e[1]!==c?(l=t.jsx(le,{placeholder:"Search repositories...",value:c,onChange:b,isSearching:u}),e[0]=u,e[1]=c,e[2]=l):l=e[2];const d=u?"opacity-40":"opacity-100";let m;e[3]!==d?(m=D("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",d),e[3]=d,e[4]=m):m=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(z,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=a):a=e[5];let f;e[6]!==n||e[7]!==j||e[8]!==r||e[9]!==p||e[10]!==o||e[11]!==i||e[12]!==h?(f=t.jsx(T.Suspense,{fallback:a,children:t.jsx(Se,{connectionId:n,orgId:i,orgSlug:h,installation:r,query:j,onSelectRepo:o,isSaving:p})}),e[6]=n,e[7]=j,e[8]=r,e[9]=p,e[10]=o,e[11]=i,e[12]=h,e[13]=f):f=e[13];let N;e[14]!==m||e[15]!==f?(N=t.jsx("div",{className:m,children:f}),e[14]=m,e[15]=f,e[16]=N):N=e[16];let x;return e[17]!==l||e[18]!==N?(x=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[l,N]}),e[17]=l,e[18]=N,e[19]=x):x=e[19],x}function Se(y){const e=A.c(29),{connectionId:n,orgId:i,orgSlug:h,installation:r,query:o,onSelectRepo:p,isSaving:c}=y;let b;e[0]!==n||e[1]!==i||e[2]!==h?(b={connectionId:n,orgId:i,orgSlug:h},e[0]=n,e[1]=i,e[2]=h,e[3]=b):b=e[3];const C=L(b),j=r.type==="User"?"user":"org",u=o?`${j}:${r.login} ${o} in:name`:`${j}:${r.login}`;let l;e[4]!==n||e[5]!==r.login||e[6]!==i||e[7]!==o?(l=R.githubOrgRepos(i,n,r.login,o),e[4]=n,e[5]=r.login,e[6]=i,e[7]=o,e[8]=l):l=e[8];let d;e[9]!==C||e[10]!==u?(d=async x=>{const{signal:s}=x,S=(await C.callTool({name:"search_repositories",arguments:{query:u,page:1,perPage:30}},void 0,{signal:s})).content?.[0]?.text;if(!S)throw new Error("No response from search_repositories");return(JSON.parse(S).items??[]).map(Ie)},e[9]=C,e[10]=u,e[11]=d):d=e[11];let m;e[12]!==l||e[13]!==d?(m={queryKey:l,queryFn:d},e[12]=l,e[13]=d,e[14]=m):m=e[14];const{data:a}=ee(m);if(a.length===0){let x;e[15]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("p",{className:"text-sm text-muted-foreground",children:"No repositories found"}),e[15]=x):x=e[15];let s;e[16]!==o?(s=o&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Try a different search term"}),e[16]=o,e[17]=s):s=e[17];let v;return e[18]!==s?(v=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[x,s]}),e[18]=s,e[19]=v):v=e[19],v}let f;if(e[20]!==c||e[21]!==p||e[22]!==a){let x;e[24]!==c||e[25]!==p?(x=s=>t.jsxs("button",{type:"button",onClick:()=>p(s),disabled:c,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(G,{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:s.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:[s.private?t.jsx(te,{size:10}):t.jsx(ue,{size:10}),s.private?"Private":"Public"]})]},s.fullName),e[24]=c,e[25]=p,e[26]=x):x=e[26],f=a.map(x),e[20]=c,e[21]=p,e[22]=a,e[23]=f}else f=e[23];let N;return e[27]!==f?(N=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:f}),e[27]=f,e[28]=N):N=e[28],N}function Ie(y){return{name:y.name,fullName:y.full_name,owner:y.full_name.split("/")[0]??"",url:y.html_url,private:y.private,description:y.description,updatedAt:y.updated_at}}function $(y){const e=A.c(33),{status:n,error:i,retry:h}=y;if(n==="error"){let S;e[0]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(G,{className:"size-5 text-destructive"})}),e[0]=S):S=e[0];let _;e[1]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx("p",{className:"text-sm font-medium",children:"Connection failed"}),e[1]=_):_=e[1];const w=i??"Something went wrong while connecting to GitHub.";let I;e[2]!==w?(I=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[_,t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:w})]}),e[2]=w,e[3]=I):I=e[3];let g;e[4]!==h?(g=t.jsx("button",{type:"button",onClick:h,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]=h,e[5]=g):g=e[5];let k;return e[6]!==I||e[7]!==g?(k=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[S,I,g]}),e[6]=I,e[7]=g,e[8]=k):k=e[8],k}const r=n==="authenticating";let o;e[9]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(G,{className:"size-5 text-foreground"})}),e[9]=o):o=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsxs("div",{className:"relative size-10",children:[o,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(z,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[10]=p):p=e[10];const c=r?"Authenticating with GitHub":"Setting up GitHub";let b;e[11]!==c?(b=t.jsx("p",{className:"text-sm font-medium",children:c}),e[11]=c,e[12]=b):b=e[12];const C=r?"Complete the OAuth flow in your browser":"Installing the GitHub connection...";let j;e[13]!==C?(j=t.jsx("p",{className:"text-xs text-muted-foreground",children:C}),e[13]=C,e[14]=j):j=e[14];let u;e[15]!==b||e[16]!==j?(u=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[b,j]}),e[15]=b,e[16]=j,e[17]=u):u=e[17];const l=r?"bg-muted-foreground/30":"bg-foreground animate-pulse";let d;e[18]!==l?(d=D("size-1.5 rounded-full",l),e[18]=l,e[19]=d):d=e[19];let m;e[20]!==d?(m=t.jsx("span",{className:d}),e[20]=d,e[21]=m):m=e[21];const a=r?"bg-foreground animate-pulse":"bg-muted-foreground/30";let f;e[22]!==a?(f=D("size-1.5 rounded-full",a),e[22]=a,e[23]=f):f=e[23];let N;e[24]!==f?(N=t.jsx("span",{className:f}),e[24]=f,e[25]=N):N=e[25];let x;e[26]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[26]=x):x=e[26];let s;e[27]!==m||e[28]!==N?(s=t.jsxs("div",{className:"flex items-center gap-1.5",children:[m,N,x]}),e[27]=m,e[28]=N,e[29]=s):s=e[29];let v;return e[30]!==s||e[31]!==u?(v=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[p,u,s]}),e[30]=s,e[31]=u,e[32]=v):v=e[32],v}export{De as G,G as a,ye as b,he as u};