decocms 4.74.0 → 4.74.2

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 (247) hide show
  1. package/dist/client/assets/{AlertCircle-BaauQIwC.js → AlertCircle-7Nt6pK3u.js} +1 -1
  2. package/dist/client/assets/{AreaChart-5GoV9SRg.js → AreaChart-B_EqFBTf.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-C814v0pE.js → ArrowUp-BXJFmEZc.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-BLP3DLju.js → ArrowUpRight-BP--4ucj.js} +1 -1
  5. package/dist/client/assets/{Check-DYPRi7NO.js → Check-D0mBSrjH.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-D_t3rWUI.js → CheckCircle-Cwk3XPAS.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-wHLuFr3i.js → ChevronDown-PmGFsMpL.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-BARfL9-W.js → ChevronRight-B-vLdw8q.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-CRmxYAjE.js → ChevronUp-BHUOn26n.js} +1 -1
  10. package/dist/client/assets/{Circle-DuelqjM2.js → Circle-DApmycTB.js} +1 -1
  11. package/dist/client/assets/{Copy01-BwtpNAKR.js → Copy01-YKEDguCl.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-B_jKX962.js → DotsVertical-DmdjQQ_H.js} +1 -1
  13. package/dist/client/assets/{Eye-CM4SfxEo.js → Eye-BMt91Y28.js} +1 -1
  14. package/dist/client/assets/{FilterLines-CwEBxGZP.js → FilterLines-BQWL5JTu.js} +1 -1
  15. package/dist/client/assets/{Flag01-RtD7xNTJ.js → Flag01-Bvh5iRqx.js} +1 -1
  16. package/dist/client/assets/{Globe01-B-4z45oj.js → Globe01-CN1f6WBv.js} +1 -1
  17. package/dist/client/assets/{Globe04-D7ZgONc6.js → Globe04-qC3ih0ZL.js} +1 -1
  18. package/dist/client/assets/{HardDrive-DNueik1y.js → HardDrive-BwJlKgJ6.js} +1 -1
  19. package/dist/client/assets/{Key01-DrwX5nx2.js → Key01-C1LLnj6q.js} +1 -1
  20. package/dist/client/assets/{LayoutLeft-CHLKhLgL.js → LayoutLeft-DPXJOfef.js} +1 -1
  21. package/dist/client/assets/{LinkExternal01-022iaJNF.js → LinkExternal01-7ka-zpyj.js} +1 -1
  22. package/dist/client/assets/{List-jObuFUL_.js → List-Bx8txb9K.js} +1 -1
  23. package/dist/client/assets/{Monitor01-BkHN4rM2.js → Monitor01-DJD9nEcj.js} +1 -1
  24. package/dist/client/assets/{Package-DYdmCLl6.js → Package-D5z_WcDc.js} +1 -1
  25. package/dist/client/assets/{Palette-BWa7ee-4.js → Palette-qT1fhobG.js} +1 -1
  26. package/dist/client/assets/{Play-DYP9-OJo.js → Play-GvZ0_iyw.js} +1 -1
  27. package/dist/client/assets/{Plus-DKATXnIq.js → Plus-C4ZEipYr.js} +1 -1
  28. package/dist/client/assets/{SearchLg-crE3yQZJ.js → SearchLg-BBYByRTt.js} +1 -1
  29. package/dist/client/assets/{SearchMd-CbytZ1-S.js → SearchMd-CUL7QlM0.js} +1 -1
  30. package/dist/client/assets/{Settings02-1LTNhTXj.js → Settings02-kgu7_M6O.js} +1 -1
  31. package/dist/client/assets/{Shield01-CULBCC4Z.js → Shield01-BISWnawB.js} +1 -1
  32. package/dist/client/assets/{Star01-CtWX4nA3.js → Star01-Ba-daWZ-.js} +1 -1
  33. package/dist/client/assets/{Stars01-COE1U6xi.js → Stars01-D7DsKu7S.js} +1 -1
  34. package/dist/client/assets/{Stars02-BzQc7fZz.js → Stars02-CH3Kk6h-.js} +1 -1
  35. package/dist/client/assets/{Sun-CyoL1WFK.js → Sun-BPy5rxZW.js} +1 -1
  36. package/dist/client/assets/{SwitchHorizontal01-QNGjYcml.js → SwitchHorizontal01-D_tcQJ73.js} +1 -1
  37. package/dist/client/assets/{Tool01-BWGVYfev.js → Tool01-CXy9L9vf.js} +1 -1
  38. package/dist/client/assets/{Tool02-DkTMVP4f.js → Tool02-BAfdT5B8.js} +1 -1
  39. package/dist/client/assets/{Trash01-iPP4w9gK.js → Trash01-APUCP4GX.js} +1 -1
  40. package/dist/client/assets/{TrendUp01-C3q3M7MG.js → TrendUp01-CLAFKqVO.js} +1 -1
  41. package/dist/client/assets/{Upload01-CoVAXfWg.js → Upload01-CmRDGAjs.js} +1 -1
  42. package/dist/client/assets/{User01-2QspS0s6.js → User01-CpMNTHj6.js} +1 -1
  43. package/dist/client/assets/{UserPlus01-DoBolndD.js → UserPlus01-mMfR4YMV.js} +1 -1
  44. package/dist/client/assets/{Users01-C3FOprDj.js → Users01-zx9lM6Kg.js} +1 -1
  45. package/dist/client/assets/{Users03-BYqJADve.js → Users03-D11AqwMx.js} +1 -1
  46. package/dist/client/assets/{X-Bqs01fCh.js → X-BRf1CuwT.js} +1 -1
  47. package/dist/client/assets/{XCircle-DHCvZwgH.js → XCircle-Bx3h3ov4.js} +1 -1
  48. package/dist/client/assets/{XClose-P0NM9uUE.js → XClose-6eVK9gjQ.js} +1 -1
  49. package/dist/client/assets/{Zap-CI5WhuKJ.js → Zap-CKjhc3zs.js} +1 -1
  50. package/dist/client/assets/{ZapSquare-BhWmmFEB.js → ZapSquare-BntLBw72.js} +1 -1
  51. package/dist/client/assets/{ZoomOut-C7W-ZWAB.js → ZoomOut-5mlqDR-t.js} +1 -1
  52. package/dist/client/assets/{access-gate-BK7GcTMo.js → access-gate-Zzwbhi5g.js} +1 -1
  53. package/dist/client/assets/{add-section-modal-CfvYLCg2.js → add-section-modal-Ciwr9vqD.js} +1 -1
  54. package/dist/client/assets/{agent-icon-5pSyq_FH.js → agent-icon-Bm6aaEo_.js} +1 -1
  55. package/dist/client/assets/agents-list-CX5CGH-y.js +1 -0
  56. package/dist/client/assets/{ai-providers-CRHCw5VF.js → ai-providers-Bb8yB23r.js} +1 -1
  57. package/dist/client/assets/{alert-D4ttbBAt.js → alert-BvEEzv9b.js} +1 -1
  58. package/dist/client/assets/{alert-dialog-GCrUNzbs.js → alert-dialog-BWfVJWo6.js} +1 -1
  59. package/dist/client/assets/app-editor-CVIUKWY7.js +1 -0
  60. package/dist/client/assets/{auth-Cf4In3Ce.js → auth-DUNMp2q9.js} +1 -1
  61. package/dist/client/assets/{auth-catchall-CL7qcaW-.js → auth-catchall-CXy5AK9w.js} +1 -1
  62. package/dist/client/assets/{auth-entry-BBn3Oy3I.js → auth-entry-BzVS8HQW.js} +1 -1
  63. package/dist/client/assets/{auth-split-layout-ClDCjxcR.js → auth-split-layout-aUT-uzAh.js} +1 -1
  64. package/dist/client/assets/{authenticate-and-persist-oauth-DeTua2ma.js → authenticate-and-persist-oauth-CBGP3HRu.js} +1 -1
  65. package/dist/client/assets/{automation-list-row-bCHP9GaB.js → automation-list-row-BRHz9zkz.js} +1 -1
  66. package/dist/client/assets/{automation-runs-K5fQtR3Q.js → automation-runs-D2vNR23X.js} +1 -1
  67. package/dist/client/assets/automations-4SdYvOdx.js +1 -0
  68. package/dist/client/assets/{autosend-CnfmH4zE.js → autosend-HLDOzs25.js} +1 -1
  69. package/dist/client/assets/{avatar-BB1BJsL_.js → avatar-ODfMrOSw.js} +1 -1
  70. package/dist/client/assets/{badge-miK_gWS7.js → badge-DqelMuvl.js} +1 -1
  71. package/dist/client/assets/{block-document-BnBi9DlX.js → block-document-VXj-kuOr.js} +1 -1
  72. package/dist/client/assets/{brand-context-Bwk8h-AT.js → brand-context-7qf_1G0Q.js} +1 -1
  73. package/dist/client/assets/{buckets-BVny45s4.js → buckets-D7doUMsO.js} +1 -1
  74. package/dist/client/assets/{bulk-category-panel-CI-tBRB_.js → bulk-category-panel-DP0FmV8B.js} +1 -1
  75. package/dist/client/assets/{calendar-i7Bgz_TN.js → calendar-rMb-ODp7.js} +1 -1
  76. package/dist/client/assets/{capability-load-error-ykEHLKnb.js → capability-load-error-DDrbVf9Z.js} +1 -1
  77. package/dist/client/assets/{card-BjD2_XuX.js → card-6dPhvUw3.js} +1 -1
  78. package/dist/client/assets/category-editor-P9vCoT62.js +1 -0
  79. package/dist/client/assets/{chat-context-De0V13yX.js → chat-context-BdWFa_ae.js} +5 -5
  80. package/dist/client/assets/{checkbox-DnsQEgvs.js → checkbox-BAEBF-lp.js} +1 -1
  81. package/dist/client/assets/{cli-auth-success-DlpvQRp0.js → cli-auth-success-thW0JcOC.js} +1 -1
  82. package/dist/client/assets/{collection-detail-HRLTqsYR.js → collection-detail-BMWq1If8.js} +1 -1
  83. package/dist/client/assets/{collection-display-button-CNmqBrih.js → collection-display-button-IE8Ni7uy.js} +1 -1
  84. package/dist/client/assets/{collection-search-MTrnV0Y_.js → collection-search-c9oirDKJ.js} +1 -1
  85. package/dist/client/assets/{collection-table-wrapper-CZMGnyXO.js → collection-table-wrapper-fal4CYGm.js} +1 -1
  86. package/dist/client/assets/{collection-tabs-Dvz33uvw.js → collection-tabs-Cx_qr9p2.js} +1 -1
  87. package/dist/client/assets/{command-DpdcRmV-.js → command-CMohXiY9.js} +1 -1
  88. package/dist/client/assets/commerce-onboarding-BjJyVAeU.js +1 -0
  89. package/dist/client/assets/companions-core-BaAHCjLB.js +1 -0
  90. package/dist/client/assets/{connect-desktop-dialog-BASAvtSw.js → connect-desktop-dialog-BnMQnI9Q.js} +1 -1
  91. package/dist/client/assets/{connection-card-DQ8XLP8C.js → connection-card-jq-X-joO.js} +1 -1
  92. package/dist/client/assets/{connection-detail-CwpaZMQ9.js → connection-detail-Bi8xUt2a.js} +1 -1
  93. package/dist/client/assets/{connection-form-helpers-B4Lj6wNN.js → connection-form-helpers-D8Y-iC7G.js} +1 -1
  94. package/dist/client/assets/{connections-C4IOF63g.js → connections-BG-UjvGH.js} +1 -1
  95. package/dist/client/assets/{decopilot-sse-pool-_LHJFrBF.js → decopilot-sse-pool-4Coc0RZf.js} +1 -1
  96. package/dist/client/assets/{dialog-CUb_uQeJ.js → dialog-CIsOZrM9.js} +1 -1
  97. package/dist/client/assets/{domain-settings-Cj1WoInJ.js → domain-settings-tEDfHeLX.js} +1 -1
  98. package/dist/client/assets/{drawer-BSFvVMvA.js → drawer-CPiGkXxI.js} +1 -1
  99. package/dist/client/assets/{dropdown-menu-D-nlMdm5.js → dropdown-menu-B5Zph68E.js} +1 -1
  100. package/dist/client/assets/{empty-state-C_IbZdBr.js → empty-state-CssJRHRY.js} +1 -1
  101. package/dist/client/assets/{extract-connection-data-BIadZZgr.js → extract-connection-data-udtq7ldu.js} +1 -1
  102. package/dist/client/assets/file-explorer-BkuM2LZ9.js +2 -0
  103. package/dist/client/assets/{file-type-icon-mrfxFHRk.js → file-type-icon-BDsT4NsE.js} +1 -1
  104. package/dist/client/assets/{files-B6sMQ0N9.js → files-P4YoAM_Q.js} +1 -1
  105. package/dist/client/assets/{form-CEO5VtKG.js → form-DO3brjC6.js} +1 -1
  106. package/dist/client/assets/{general-CpcExAES.js → general-9kseFLhw.js} +1 -1
  107. package/dist/client/assets/github-repo-picker-BIKsB9fh.js +1 -0
  108. package/dist/client/assets/{hooks-G1nBJ-F3.js → hooks-CDl8lixj.js} +1 -1
  109. package/dist/client/assets/{index-BZjBKD1m.js → index-60vpzjoP.js} +5 -5
  110. package/dist/client/assets/{index-C7cs-gci.js → index-BEa0XcuM.js} +2 -2
  111. package/dist/client/assets/{index-CTpTvSxb.js → index-BjO160yJ.js} +1 -1
  112. package/dist/client/assets/{index-BlItCfDb.js → index-BmB9QsuH.js} +1 -1
  113. package/dist/client/assets/{index-BW23Hqv6.js → index-CNa9GbwP.js} +1 -1
  114. package/dist/client/assets/{index-B_nVJPYO.js → index-Cabias0z.js} +1 -1
  115. package/dist/client/assets/{index-B3_jWN9S.js → index-CnI2YHm_.js} +1 -1
  116. package/dist/client/assets/{index-DxwLi9-g.js → index-DGL5NlRf.js} +1 -1
  117. package/dist/client/assets/index-DVS6dCOq.js +1 -0
  118. package/dist/client/assets/{index-DFuynMdy.js → index-D_sYzPoS.js} +1 -1
  119. package/dist/client/assets/{index-C9P6Y57L.js → index-De7Vrw1B.js} +1 -1
  120. package/dist/client/assets/{index-DQVI41jj.js → index-DjZlwvG-.js} +1 -1
  121. package/dist/client/assets/{index-lRedQ_8t.js → index-LdekSll3.js} +3 -3
  122. package/dist/client/assets/{index-DAFjHwsT.js → index-dlw0nWwT.js} +1 -1
  123. package/dist/client/assets/{index-redirect-Mh7_3AcS.js → index-redirect-Durt0uGm.js} +1 -1
  124. package/dist/client/assets/{input-DOZlS9i9.js → input-Ahc5_8w6.js} +1 -1
  125. package/dist/client/assets/{integration-icon-CN9OtiIm.js → integration-icon-yl-4tv2q.js} +1 -1
  126. package/dist/client/assets/{invite-member-dialog-LDdBeQZc.js → invite-member-dialog-Cr4_AjST.js} +1 -1
  127. package/dist/client/assets/{label-u5PrAFB7.js → label-B-N4D4el.js} +1 -1
  128. package/dist/client/assets/{layout-46QoqgX4.js → layout-DduIkC_1.js} +1 -1
  129. package/dist/client/assets/{login-BdT0h30g.js → login-BEj0pR8n.js} +1 -1
  130. package/dist/client/assets/{mcp-oauth-DHDPNOkD.js → mcp-oauth-DYEOf_NB.js} +1 -1
  131. package/dist/client/assets/{members-RcOcNeXi.js → members-BTIjkH3t.js} +1 -1
  132. package/dist/client/assets/{monaco-editor-D2naC6ph.js → monaco-editor-BAkcna7Z.js} +1 -1
  133. package/dist/client/assets/{monitoring-stats-row-CztePoJD.js → monitoring-stats-row-CCXtKjzQ.js} +1 -1
  134. package/dist/client/assets/{oauth-callback-BSA-GLPM.js → oauth-callback-CbknNfun.js} +1 -1
  135. package/dist/client/assets/{oauth-callback-ai-provider-DgPoj4r4.js → oauth-callback-ai-provider-B8wm8Z91.js} +1 -1
  136. package/dist/client/assets/{onboarding-Br3afGr-.js → onboarding-WOBNvMNa.js} +1 -1
  137. package/dist/client/assets/{org-install-C190-hBM.js → org-install-PFEnxCFZ.js} +1 -1
  138. package/dist/client/assets/{org-layout-cPdojne_.js → org-layout-B4eM_cAm.js} +1 -1
  139. package/dist/client/assets/{organization-choice-Csr-kPrj.js → organization-choice-D0qBuG6H.js} +1 -1
  140. package/dist/client/assets/{orgs-WjQsKIGK.js → orgs-B9ECvLek.js} +1 -1
  141. package/dist/client/assets/{page-seo-form-BocKaLGp.js → page-seo-form-D93VcSbg.js} +1 -1
  142. package/dist/client/assets/page-seo-sheet-B0DLHoZV.js +1 -0
  143. package/dist/client/assets/{popover-BlN-L-7w.js → popover-B9HWZYb2.js} +1 -1
  144. package/dist/client/assets/post-editor-DBkV3r9Y.js +1 -0
  145. package/dist/client/assets/{primitives-C1zKVkUs.js → primitives-tVaEBsAv.js} +1 -1
  146. package/dist/client/assets/{profile-B1TQAd_m.js → profile-Z8Ki-oOg.js} +1 -1
  147. package/dist/client/assets/project-app-view-BqKt7pji.js +1 -0
  148. package/dist/client/assets/provision-repo-scoped-github-connection-CB4ICKHq.js +1 -0
  149. package/dist/client/assets/record-editor-CUTmCbI9.js +1 -0
  150. package/dist/client/assets/redirect-editor-BTOo2ipS.js +1 -0
  151. package/dist/client/assets/registry-Btp_DOOo.js +2 -0
  152. package/dist/client/assets/{registry-layout-BjGbzV73.js → registry-layout-CiSIqBb4.js} +1 -1
  153. package/dist/client/assets/{reports-DEwGwzSI.js → reports-D_uyJHbu.js} +1 -1
  154. package/dist/client/assets/{require-capability-B_dSH45y.js → require-capability-DSvw1X4X.js} +1 -1
  155. package/dist/client/assets/{required-auth-layout-czUUgGrX.js → required-auth-layout-CMMguY8J.js} +1 -1
  156. package/dist/client/assets/{reset-password-Md6XPqI1.js → reset-password-D2EOsNEe.js} +1 -1
  157. package/dist/client/assets/{roles-jjnXT7oA.js → roles-BfDzp1dZ.js} +1 -1
  158. package/dist/client/assets/{search-input-BQOeLOTi.js → search-input-B87p-N3Q.js} +1 -1
  159. package/dist/client/assets/{secrets-CWkoKQMY.js → secrets-oWRvJyNS.js} +1 -1
  160. package/dist/client/assets/{sections-editor-DJYtpXox.js → sections-editor-CdMkUBnn.js} +1 -1
  161. package/dist/client/assets/{select-CxRcXiYy.js → select-BK2fSAGa.js} +1 -1
  162. package/dist/client/assets/{select-model-CJ1n8oWC.js → select-model-DyYklQhq.js} +1 -1
  163. package/dist/client/assets/self-tool-result-nBf7_4aQ.js +1 -0
  164. package/dist/client/assets/seo-editor-CYBdDfVF.js +1 -0
  165. package/dist/client/assets/{settings-layout-BXO3VMKS.js → settings-layout-DhW1zJN8.js} +1 -1
  166. package/dist/client/assets/{settings-section-Bs1JjdR4.js → settings-section-C1Acpu_v.js} +1 -1
  167. package/dist/client/assets/{shell-controls-BoSvKLlP.js → shell-controls-Cp2Tzxyd.js} +1 -1
  168. package/dist/client/assets/{shell-layout-DamsdnEZ.js → shell-layout-cvOWu3Bb.js} +1 -1
  169. package/dist/client/assets/{sidebar-joQ3ZQPE.js → sidebar-D6wZQMs1.js} +1 -1
  170. package/dist/client/assets/{skeleton-BxJ_vH4t.js → skeleton--iEBiL2O.js} +1 -1
  171. package/dist/client/assets/{sso-CoEL8qOV.js → sso-BlD_fs9m.js} +1 -1
  172. package/dist/client/assets/{store-mvrTZUgb.js → store-BIFu6366.js} +1 -1
  173. package/dist/client/assets/store-registry-eGJ8V8iX.js +2 -0
  174. package/dist/client/assets/{studio-tools-BMyTPyPy.js → studio-tools-C6CclkE9.js} +1 -1
  175. package/dist/client/assets/{switch-C6-Jkvpv.js → switch-D7EBUFwg.js} +1 -1
  176. package/dist/client/assets/{table-BBmNComr.js → table-BMd4rGjA.js} +1 -1
  177. package/dist/client/assets/{tabs-kApe5O6i.js → tabs-C6mEKLrC.js} +1 -1
  178. package/dist/client/assets/{textarea-C5puqxj1.js → textarea-CnsXYno3.js} +1 -1
  179. package/dist/client/assets/{toggle-group-DScHdpkW.js → toggle-group-CHiT2zi8.js} +1 -1
  180. package/dist/client/assets/{toolbar-zpMjKMlc.js → toolbar-B57zOF1P.js} +1 -1
  181. package/dist/client/assets/{toolbar-icon-button-D3Y1-YHW.js → toolbar-icon-button-BvFJpYeK.js} +1 -1
  182. package/dist/client/assets/{tools-list-BOMB05RR.js → tools-list-DEK41qXq.js} +1 -1
  183. package/dist/client/assets/{tooltip-REPIyd2Z.js → tooltip-BGm-IgA-.js} +1 -1
  184. package/dist/client/assets/{use-ai-providers-Bo4wIQxq.js → use-ai-providers-D5XAQyc9.js} +1 -1
  185. package/dist/client/assets/{use-automations-DA7j42Hg.js → use-automations-lcgzv2am.js} +1 -1
  186. package/dist/client/assets/{use-autosave-DBERSs2x.js → use-autosave-GrI-CtYt.js} +1 -1
  187. package/dist/client/assets/{use-capability-CCJ-X1mC.js → use-capability-D3kXXKk7.js} +1 -1
  188. package/dist/client/assets/{use-clock-tick-MLdLuh40.js → use-clock-tick-BY1pm89W.js} +1 -1
  189. package/dist/client/assets/{use-collections-D-OJag2e.js → use-collections-BtybZGh0.js} +1 -1
  190. package/dist/client/assets/{use-connection-DmUK9JRy.js → use-connection--eZlhK3I.js} +1 -1
  191. package/dist/client/assets/{use-copy-DzWDd5On.js → use-copy-B6jV0HNR.js} +1 -1
  192. package/dist/client/assets/{use-create-virtual-mcp-BqyRJeCT.js → use-create-virtual-mcp-CuTto1BH.js} +1 -1
  193. package/dist/client/assets/{use-debounced-autosave-JbhBBkyc.js → use-debounced-autosave-Rhccxzrn.js} +1 -1
  194. package/dist/client/assets/{use-debounced-value-DxBZ974h.js → use-debounced-value-BsrFA4Fu.js} +1 -1
  195. package/dist/client/assets/{use-deco-credits-DR4kDN3B.js → use-deco-credits-DkWCOBhO.js} +1 -1
  196. package/dist/client/assets/{use-decopilot-events-BhVWtKJy.js → use-decopilot-events-ijeneFBZ.js} +1 -1
  197. package/dist/client/assets/{use-delete-connection-Ds3puvR-.js → use-delete-connection-D2mQQjVk.js} +1 -1
  198. package/dist/client/assets/{use-deployment-admin-C5hKFITD.js → use-deployment-admin-R973eJt7.js} +1 -1
  199. package/dist/client/assets/{use-file-configs-t6weWLBN.js → use-file-configs-C5YTi-f0.js} +1 -1
  200. package/dist/client/assets/{use-infinite-scroll-B4v-_NDY.js → use-infinite-scroll-CMZ6xVYY.js} +1 -1
  201. package/dist/client/assets/{use-join-requests-nORXzBkG.js → use-join-requests-D329QH2z.js} +1 -1
  202. package/dist/client/assets/{use-mcp-client-D6H50Mmm.js → use-mcp-client-DL7RwW_0.js} +1 -1
  203. package/dist/client/assets/{use-mcp-tools-Cs2tX1fK.js → use-mcp-tools-K3veuXIg.js} +1 -1
  204. package/dist/client/assets/{use-members-Bz6iBsM4.js → use-members-CjpUW6ut.js} +1 -1
  205. package/dist/client/assets/{use-mobile-RU-Nn_Un.js → use-mobile-BO0IkFF-.js} +1 -1
  206. package/dist/client/assets/{use-navigate-to-agent-DYPKcx_j.js → use-navigate-to-agent-DollRSI0.js} +1 -1
  207. package/dist/client/assets/{use-org-auth-client-DrmuxI_m.js → use-org-auth-client-Do6ICXxA.js} +1 -1
  208. package/dist/client/assets/use-org-sso-Bq11wDiI.js +1 -0
  209. package/dist/client/assets/{use-organization-roles-DU1BIeXK.js → use-organization-roles-DZZWVozd.js} +1 -1
  210. package/dist/client/assets/{use-organization-settings-CHx_I7VH.js → use-organization-settings-D5GZ0amo.js} +1 -1
  211. package/dist/client/assets/{use-registry-connections-C9dbuMZN.js → use-registry-connections-DF6MEH42.js} +1 -1
  212. package/dist/client/assets/{use-secrets-Cs1UIn3n.js → use-secrets-DQ9xlX5K.js} +1 -1
  213. package/dist/client/assets/{use-status-sounds-C3Efc5TW.js → use-status-sounds-BN6Xde6g.js} +1 -1
  214. package/dist/client/assets/{use-view-mode-y0S1o9OD.js → use-view-mode-CNTXd6H3.js} +1 -1
  215. package/dist/client/assets/{use-virtual-mcp-D9inM-9h.js → use-virtual-mcp-wv33_-SX.js} +1 -1
  216. package/dist/client/assets/useInfiniteQuery-Cg8SDgJQ.js +1 -0
  217. package/dist/client/assets/{useRouterState-DB6AEQYy.js → useRouterState-W11XLSXd.js} +1 -1
  218. package/dist/client/assets/useSuspenseInfiniteQuery-l2LxobU8.js +1 -0
  219. package/dist/client/assets/{users-DV3bsEcg.js → users-CG11TxHM.js} +1 -1
  220. package/dist/client/assets/{variant-calendar-B7qy61Jb.js → variant-calendar-YbJ2ipqR.js} +1 -1
  221. package/dist/client/assets/{view-mode-toggle-BIom5MzH.js → view-mode-toggle-dgcz-Fs1.js} +1 -1
  222. package/dist/client/index.html +1 -1
  223. package/dist/server/cli.js +1 -1
  224. package/dist/server/server.js +1 -1
  225. package/package.json +1 -1
  226. package/dist/client/assets/agents-list-pNinhUjp.js +0 -1
  227. package/dist/client/assets/app-editor-DqcvDhID.js +0 -1
  228. package/dist/client/assets/automations-BchD7Vmn.js +0 -1
  229. package/dist/client/assets/category-editor-CSZtSGt6.js +0 -1
  230. package/dist/client/assets/commerce-onboarding-QSGTn2pK.js +0 -1
  231. package/dist/client/assets/companions-core-CgTHLTTN.js +0 -1
  232. package/dist/client/assets/file-explorer-BWAl04Ll.js +0 -2
  233. package/dist/client/assets/github-installations-ChFezl8I.js +0 -1
  234. package/dist/client/assets/github-repo-picker-CH-zkM68.js +0 -1
  235. package/dist/client/assets/index-B8fJFfFf.js +0 -1
  236. package/dist/client/assets/page-seo-sheet-BTjq4xGR.js +0 -1
  237. package/dist/client/assets/post-editor-DD6k2jq_.js +0 -1
  238. package/dist/client/assets/project-app-view-DlsPCtAC.js +0 -1
  239. package/dist/client/assets/record-editor-CE1EwunZ.js +0 -1
  240. package/dist/client/assets/redirect-editor-OokObJNP.js +0 -1
  241. package/dist/client/assets/registry-OH_DROyn.js +0 -2
  242. package/dist/client/assets/self-tool-result-BCQjUWN7.js +0 -1
  243. package/dist/client/assets/seo-editor-DYp9hHSY.js +0 -1
  244. package/dist/client/assets/store-registry-C-81qMOw.js +0 -2
  245. package/dist/client/assets/use-org-sso-BLc80T83.js +0 -1
  246. package/dist/client/assets/useInfiniteQuery-XeUdT1mI.js +0 -1
  247. package/dist/client/assets/useSuspenseInfiniteQuery-DnwWEYgY.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "decocms",
3
- "version": "4.74.0",
3
+ "version": "4.74.2",
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 ne,j as s,B as Q,C as de,n as fe,a as he,r as q,m as ge,K as te,d as xe,p as $,t as se,l as je}from"./index-lRedQ_8t.js";import{d as W,c as me,a as oe,D as ie}from"./dropdown-menu-D-nlMdm5.js";import{a as be}from"./Users03-BYqJADve.js";import{a as ue,b as Ce,p as ye,G as we}from"./github-repo-picker-CH-zkM68.js";import{u as _e,b as Ne,c as Se}from"./use-virtual-mcp-D9inM-9h.js";import{P as Z}from"./index-C9P6Y57L.js";import{i as ve}from"./DotsVertical-B_jKX962.js";import{a as Ie,b as De}from"./Settings02-1LTNhTXj.js";import{s as Ee}from"./Trash01-iPP4w9gK.js";import{A as Ae,ay as Te}from"./agent-icon-5pSyq_FH.js";import{c as pe}from"./use-navigate-to-agent-DYPKcx_j.js";import{C as ke}from"./card-BjD2_XuX.js";import{f as re}from"./formatDistanceToNow-Cb2QZZJn.js";import{u as Le}from"./use-capability-CCJ-X1mC.js";import{E as Ge}from"./empty-state-C_IbZdBr.js";import{u as Oe}from"./use-create-virtual-mcp-BqyRJeCT.js";import{u as Pe}from"./use-connection-DmUK9JRy.js";import{u as le}from"./use-mcp-client-D6H50Mmm.js";import{S as ze}from"./constants-D_FQAPnt.js";import{g as Me,f as $e,b as He}from"./github-installations-ChFezl8I.js";import{e as Re,d as Fe,D as Ue,a as Be,c as Ve}from"./dialog-CUb_uQeJ.js";import{C as Ke}from"./collection-search-MTrnV0Y_.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-GCrUNzbs.js";import{S as tt}from"./search-input-BQOeLOTi.js";import{s as ae}from"./Plus-DKATXnIq.js";import"./Check-DYPRi7NO.js";import"./ChevronRight-BARfL9-W.js";import"./Circle-DuelqjM2.js";import"./use-debounced-value-DxBZ974h.js";import"./authenticate-and-persist-oauth-DeTua2ma.js";import"./mcp-oauth-DHDPNOkD.js";import"./auth-Cf4In3Ce.js";import"./use-mcp-tools-Cs2tX1fK.js";import"./extract-connection-data-BIadZZgr.js";import"./use-collections-D-OJag2e.js";import"./sidebar-joQ3ZQPE.js";import"./LayoutLeft-CHLKhLgL.js";import"./use-mobile-RU-Nn_Un.js";import"./X-Bqs01fCh.js";import"./tooltip-REPIyd2Z.js";import"./AlertCircle-BaauQIwC.js";import"./UserPlus01-DoBolndD.js";import"./Tool01-BWGVYfev.js";import"./ArrowUp-C814v0pE.js";import"./Tool02-DkTMVP4f.js";import"./XCircle-DHCvZwgH.js";import"./ArrowUpRight-BLP3DLju.js";import"./TrendUp01-C3q3M7MG.js";import"./ZapSquare-BhWmmFEB.js";import"./CheckCircle-D_t3rWUI.js";import"./ChevronDown-wHLuFr3i.js";import"./ChevronUp-CRmxYAjE.js";import"./Stars02-BzQc7fZz.js";import"./Copy01-BwtpNAKR.js";import"./ZoomOut-C7W-ZWAB.js";import"./Globe01-B-4z45oj.js";import"./Eye-CM4SfxEo.js";import"./FilterLines-CwEBxGZP.js";import"./Flag01-RtD7xNTJ.js";import"./Star01-CtWX4nA3.js";import"./Globe04-D7ZgONc6.js";import"./SwitchHorizontal01-QNGjYcml.js";import"./HardDrive-DNueik1y.js";import"./Key01-DrwX5nx2.js";import"./LinkExternal01-022iaJNF.js";import"./List-jObuFUL_.js";import"./Monitor01-BkHN4rM2.js";import"./Sun-CyoL1WFK.js";import"./Package-DYdmCLl6.js";import"./Palette-BWa7ee-4.js";import"./Play-DYP9-OJo.js";import"./SearchLg-crE3yQZJ.js";import"./SearchMd-CbytZ1-S.js";import"./Shield01-CULBCC4Z.js";import"./Stars01-COE1U6xi.js";import"./Upload01-CoVAXfWg.js";import"./User01-2QspS0s6.js";import"./Users01-C3FOprDj.js";import"./XClose-P0NM9uUE.js";import"./Zap-CI5WhuKJ.js";import"./hooks-G1nBJ-F3.js";import"./decopilot-sse-pool-_LHJFrBF.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./differenceInSeconds-NQ4PDo0z.js";function ce(t){const e=ne.c(19),{onCreateFromScratch:i,onImportGitHub:n,onImportDeco:c,isCreating:C,align:y,side:d,showBetaBadge:g}=t,w=y===void 0?"end":y;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]!==C||e[2]!==i?(m=s.jsxs(W,{disabled:C,onClick:i,children:[x,"Create from scratch"]}),e[1]=C,e[2]=i,e[3]=m):m=e[3];let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(ue,{className:"size-3.5"}),e[4]=p):p=e[4];let l;e[5]!==g?(l=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]=l):l=e[6];let f;e[7]!==n||e[8]!==l?(f=s.jsxs(W,{onClick:n,children:[p,"Import from GitHub",l]}),e[7]=n,e[8]=l,e[9]=f):f=e[9];let a;e[10]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[10]=a):a=e[10];let r;e[11]!==c?(r=s.jsxs(W,{onClick:c,children:[a,"Import from deco.cx"]}),e[11]=c,e[12]=r):r=e[12];let u;return e[13]!==w||e[14]!==d||e[15]!==m||e[16]!==f||e[17]!==r?(u=s.jsxs(me,{side:d,align:w,className:"w-48",children:[m,f,r]}),e[13]=w,e[14]=d,e[15]=m,e[16]=f,e[17]=r,e[18]=u):u=e[18],u}function st(t){const e=ne.c(45),{project:i,lastUsedAt:n,onDeleteClick:c}=t,C=pe();let y;e[0]!==C||e[1]!==i.id?(y=()=>C(i.id),e[0]=C,e[1]=i.id,e[2]=y):y=e[2];let d;e[3]!==i.title||e[4]!==y?(d=s.jsx("button",{type:"button",onClick:y,className:"absolute inset-0 z-0","aria-label":i.title}),e[3]=i.title,e[4]=y,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 w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(oe,{asChild:!0,children:s.jsx(Q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:s.jsx(ve,{size:20})})}),e[9]=w):w=e[9];let x;e[10]!==C||e[11]!==i.id?(x=()=>C(i.id,{search:{main:"settings"}}),e[10]=C,e[11]=i.id,e[12]=x):x=e[12];let m;e[13]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Ie,{size:16}),e[13]=m):m=e[13];let p;e[14]!==x?(p=s.jsxs(W,{onClick:x,children:[m,"Settings"]}),e[14]=x,e[15]=p):p=e[15];let l;e[16]!==c?(l=c&&s.jsxs(W,{variant:"destructive",onClick:G=>{G.stopPropagation(),c(G)},children:[s.jsx(Ee,{size:16}),"Delete"]}),e[16]=c,e[17]=l):l=e[17];let f;e[18]!==p||e[19]!==l?(f=s.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:s.jsxs(ie,{children:[w,s.jsxs(me,{align:"end",children:[p,l]})]})}),e[18]=p,e[19]=l,e[20]=f):f=e[20];let a;e[21]!==g||e[22]!==f?(a=s.jsxs("div",{className:"flex items-start justify-between",children:[g,f]}),e[21]=g,e[22]=f,e[23]=a):a=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 _;e[31]!==a||e[32]!==D?(_=s.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[a,D]}),e[31]=a,e[32]=D,e[33]=_):_=e[33];let T;e[34]!==n||e[35]!==i.updated_at?(T=n?`Last used ${re(new Date(n),{addSuffix:!0})}`:`Updated ${re(new Date(i.updated_at),{addSuffix:!0})}`,e[34]=n,e[35]=i.updated_at,e[36]=T):T=e[36];let N;e[37]!==T?(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:T})})}),e[37]=T,e[38]=N):N=e[38];let k;e[39]!==_||e[40]!==N?(k=s.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[_,N]}),e[39]=_,e[40]=N,e[41]=k):k=e[41];let S;return e[42]!==k||e[43]!==d?(S=s.jsxs(ke,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[d,k]}),e[42]=k,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,c=i?.repo??t;return{owner:n,name:c,url:`https://github.com/${n}/${c}`}}function rt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function lt(t){const e=await fetch(`/api/${t}/deco-sites`);if(!e.ok){const i=await e.json().catch(()=>({}));throw new Error(i.error??`Failed to load sites (${e.status})`)}return e.json()}function at({open:t,onOpenChange:e,onBack:i}){const{org:n}=de(),c=pe(),C=fe(),{data:y}=he.useSession(),[d,g]=q.useState(null),[w,x]=q.useState(null),[m,p]=q.useState(""),l=le({connectionId:ze,orgId:n.id,orgSlug:n.slug}),f=Pe({slug:"mcp-github"}),a=Me(f),r=Ce({enabled:t&&a.length===0}),u=a.length===1?a[0]??null:w,I=a.length>1&&!u,D=le({connectionId:u?.id??"",orgId:n.id,orgSlug:n.slug}),_=t&&a.length===0&&(r.status==="installing"||r.status==="authenticating"||r.status==="idle"),{data:T,isLoading:N,error:k}=ge({queryKey:te.decoSites(y?.user?.email),queryFn:()=>lt(n.slug),enabled:t&&!!y?.user?.email,staleTime:6e4,retry:!1}),S=T?.sites??[],G=o=>{o||(g(null),x(null),p("")),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),O=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:L,appSlug:v}=await $e(b=>l.callTool(b),u.id),E=S.find(b=>b.name===o);if(!E)throw new Error("Selected site is no longer available");const j=nt(o,E.metadata),z=He(L,j.owner);if(!z){const b=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. ${b}`)}let V=null,F=null,U=null;const J=async()=>{U&&await l.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:U}}).catch(()=>{}),F&&await l.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:F,force:!0}}).catch(()=>{}),V&&await l.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:V,force:!0}}).catch(()=>{})};try{const b=await fetch(`/api/${n.slug}/deco-sites/connection`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:o})}),B=await b.json().catch(()=>({}));if(!b.ok)throw new Error(B.error??`Failed to create connection (${b.status})`);const A=B.connId;if(!A)throw new Error("Server did not return a connection ID");V=A;const{childConnectionId:M}=await ye({orgSlug:n.slug,sourceConnection:u,installationId:z.installationId,owner:j.owner,repo:j.name,githubCallTool:ee=>D.callTool(ee),selfCallTool:ee=>l.callTool(ee)});F=M;const H=B.icon??null,K=rt(o),h=o.toLowerCase(),Y=await l.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:h,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:K,pinnedViews:[{connectionId:A,toolName:"fetch_assets",label:"Assets",icon:null},{connectionId:A,toolName:"get_monitor_data",label:"Monitor",icon:null}],layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:A},{connection_id:M}]}}}),X=Y.structuredContent??Y;if(!X.item?.id)throw new Error("Failed to create the imported agent");return U=X.item.id,{slug:K,virtualMcpId:X.item.id,connId:A,item:X.item}}catch(b){throw await J(),b}},onSuccess:({slug:o,virtualMcpId:L,item:v})=>{$("deco_site_import_succeeded",{site_name:v.title,virtual_mcp_id:L,slug:o}),C.setQueryData(te.collectionItem(l,n.id,"","VIRTUAL_MCP",L),{item:v}),C.invalidateQueries({predicate:E=>{const j=E.queryKey;return j[1]===n.id&&j[3]==="collection"&&j[4]==="VIRTUAL_MCP"}}),C.invalidateQueries({queryKey:te.projects(n.id)}),se.success(`Imported ${o} from deco.cx`),G(!1),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),c(L)},onError:o=>{$("deco_site_import_failed",{error:o instanceof Error?o.message:"Unknown error"}),se.error("Import failed: "+(o instanceof Error?o.message:"Unknown error"))}});return s.jsx(Re,{open:t,onOpenChange:G,children:s.jsxs(Fe,{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(De,{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:p,placeholder:"Search sites...",onKeyDown:o=>{o.key==="Escape"&&p("")}})}),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(Q,{variant:"outline",size:"sm",onClick:r.retry,children:"Retry GitHub setup"})]}),_&&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&&!_&&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"})}),a.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(ue,{className:"size-3.5 text-muted-foreground"})}),s.jsx("span",{className:"text-sm font-medium",children:o.title})]},o.id))]}),N&&!_&&r.status!=="error"&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Loading sites..."}),!N&&!_&&!I&&r.status!=="error"&&!k&&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&&!_&&!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 L=o.domains?.find(E=>E.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}),L&&s.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:L})]})]},o.name)})]})]}),s.jsxs(Ve,{className:"px-8 py-5 border-t border-border",children:[s.jsx(Q,{variant:"outline",onClick:()=>G(!1),disabled:O.isPending,children:"Cancel"}),s.jsx(Q,{disabled:!d||!R||O.isPending||N||_||I||!u||r.status==="error",onClick:()=>d&&O.mutate(d),children:O.isPending?"Importing...":"Import"})]})]})})}function Fs(){const t=ne.c(46),{org:e}=de(),i=_e(),n=Ne(),[c,C]=q.useState("");let y;t[0]===Symbol.for("react.memo_cache_sentinel")?(y={navigateOnCreate:!0},t[0]=y):y=t[0];const{createVirtualMCP:d,isCreating:g}=Oe(y),[w,x]=q.useState(null),[m,p]=q.useState(!1),[l,f]=q.useState(!1),{granted:a}=Le("agents:manage"),r=c.toLowerCase(),u=i.filter(h=>h.id!==e.id&&(h.title.toLowerCase().includes(r)||h.description?.toLowerCase().includes(r))),{data:I}=Se(u.map(ct));let D;t[1]!==n||t[2]!==w?(D=async()=>{if(!w)return;const{id:h,title:Y}=w;x(null);try{await n.delete.mutateAsync(h),$("agent_deleted",{agent_id:h,source:"agents_list"}),se.success(`Deleted "${Y}"`)}catch{}},t[1]=n,t[2]=w,t[3]=D):D=t[3];const _=D,T=Z,N=Z,k=Z;let S;t[4]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Z.Title,{children:"Agents"}),t[4]=S):S=t[4];let G;t[5]===Symbol.for("react.memo_cache_sentinel")?(G=h=>{h.key==="Escape"&&(C(""),h.target.blur())},t[5]=G):G=t[5];let P;t[6]!==c?(P=s.jsx(tt,{value:c,onChange:C,placeholder:"Search for an agent...",className:"w-full md:w-[375px]",onKeyDown:G}),t[6]=c,t[7]=P):P=t[7];let R;t[8]!==a||t[9]!==d||t[10]!==g?(R=a&&s.jsxs(ie,{children:[s.jsx(oe,{asChild:!0,children:s.jsxs(Q,{size:"sm",children:[s.jsx(ae,{size:14}),"Create Agent"]})}),s.jsx(ce,{onCreateFromScratch:()=>{$("agent_create_clicked",{source:"agents_list",method:"scratch"}),d()},onImportGitHub:()=>{$("agent_create_clicked",{source:"agents_list",method:"github"}),f(!0)},onImportDeco:()=>{$("agent_create_clicked",{source:"agents_list",method:"deco"}),p(!0)},isCreating:g,align:"end"})]}),t[8]=a,t[9]=d,t[10]=g,t[11]=R):R=t[11];let O;t[12]!==P||t[13]!==R?(O=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]=O):O=t[14];const o=u.length===0&&s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Ge,{image:s.jsx(Te,{size:48,className:"text-muted-foreground"}),title:c?"No agents found":"No agents yet",description:c?`No agents match "${c}"`:a?"Create an agent to get started.":"Ask an organization admin to create one.",actions:!c&&a&&s.jsxs(ie,{children:[s.jsx(oe,{asChild:!0,children:s.jsxs(Q,{size:"sm",children:[s.jsx(ae,{size:14}),"Create Agent"]})}),s.jsx(ce,{onCreateFromScratch:()=>{$("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),d()},onImportGitHub:()=>{$("agent_create_clicked",{source:"agents_list_empty",method:"github"}),f(!0)},onImportDeco:()=>{$("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),p(!0)},isCreating:g,align:"center",showBetaBadge:!0})]})})}),L=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(h=>s.jsx(st,{project:h,lastUsedAt:I?.get(h.id)?.last_used_at,onDeleteClick:a?()=>x({id:h.id,title:h.title}):void 0},h.id))})]});let v;t[15]!==L||t[16]!==k.Body||t[17]!==O||t[18]!==o?(v=s.jsxs(k.Body,{children:[O,o,L]}),t[15]=L,t[16]=k.Body,t[17]=O,t[18]=o,t[19]=v):v=t[19];let E;t[20]!==v||t[21]!==N.Content?(E=s.jsx(N.Content,{children:v}),t[20]=v,t[21]=N.Content,t[22]=E):E=t[22];let j;t[23]!==l?(j=s.jsx(we,{open:l,onOpenChange:f}),t[23]=l,t[24]=j):j=t[24];let z;t[25]!==m?(z=s.jsx(at,{open:m,onOpenChange:p}),t[25]=m,t[26]=z):z=t[26];const V=!!w;let F;t[27]===Symbol.for("react.memo_cache_sentinel")?(F=h=>!h&&x(null),t[27]=F):F=t[27];let U;t[28]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(qe,{children:"Delete Agent?"}),t[28]=U):U=t[28];const J=w?.title;let b;t[29]!==J?(b=s.jsxs(Qe,{children:[U,s.jsxs(Je,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:J}),"."]})]}),t[29]=J,t[30]=b):b=t[30];let B;t[31]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(We,{children:"Cancel"}),t[31]=B):B=t[31];let A;t[32]!==_?(A=s.jsxs(Ye,{children:[B,s.jsx(Xe,{onClick:_,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[32]=_,t[33]=A):A=t[33];let M;t[34]!==b||t[35]!==A?(M=s.jsxs(Ze,{children:[b,A]}),t[34]=b,t[35]=A,t[36]=M):M=t[36];let H;t[37]!==V||t[38]!==M?(H=s.jsx(et,{open:V,onOpenChange:F,children:M}),t[37]=V,t[38]=M,t[39]=H):H=t[39];let K;return t[40]!==T||t[41]!==E||t[42]!==j||t[43]!==z||t[44]!==H?(K=s.jsxs(T,{children:[E,j,z,H]}),t[40]=T,t[41]=E,t[42]=j,t[43]=z,t[44]=H,t[45]=K):K=t[45],K}function ct(t){return t.id}export{Fs 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-lRedQ_8t.js";import{i as jt}from"./ChevronRight-BARfL9-W.js";import{A as kt}from"./automation-runs-K5fQtR3Q.js";import{A as _t}from"./add-section-modal-CfvYLCg2.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-BZjBKD1m.js";import"./select-CxRcXiYy.js";import"./tooltip-REPIyd2Z.js";import"./Check-DYPRi7NO.js";import"./ChevronDown-wHLuFr3i.js";import"./ChevronUp-CRmxYAjE.js";import"./useInfiniteQuery-XeUdT1mI.js";import"./use-infinite-scroll-B4v-_NDY.js";import"./use-connection-DmUK9JRy.js";import"./use-collections-D-OJag2e.js";import"./use-mcp-client-D6H50Mmm.js";import"./constants-D_FQAPnt.js";import"./auth-Cf4In3Ce.js";import"./use-virtual-mcp-D9inM-9h.js";import"./card-BjD2_XuX.js";import"./sidebar-joQ3ZQPE.js";import"./LayoutLeft-CHLKhLgL.js";import"./use-mobile-RU-Nn_Un.js";import"./X-Bqs01fCh.js";import"./table-BBmNComr.js";import"./empty-state-C_IbZdBr.js";import"./use-members-Bz6iBsM4.js";import"./use-org-auth-client-DrmuxI_m.js";import"./use-clock-tick-MLdLuh40.js";import"./AlertCircle-BaauQIwC.js";import"./CheckCircle-D_t3rWUI.js";import"./Circle-DuelqjM2.js";import"./agent-icon-5pSyq_FH.js";import"./UserPlus01-DoBolndD.js";import"./Tool01-BWGVYfev.js";import"./ArrowUp-C814v0pE.js";import"./Settings02-1LTNhTXj.js";import"./Tool02-DkTMVP4f.js";import"./XCircle-DHCvZwgH.js";import"./ArrowUpRight-BLP3DLju.js";import"./TrendUp01-C3q3M7MG.js";import"./ZapSquare-BhWmmFEB.js";import"./Users03-BYqJADve.js";import"./Stars02-BzQc7fZz.js";import"./Copy01-BwtpNAKR.js";import"./ZoomOut-C7W-ZWAB.js";import"./DotsVertical-B_jKX962.js";import"./Globe01-B-4z45oj.js";import"./Eye-CM4SfxEo.js";import"./FilterLines-CwEBxGZP.js";import"./Flag01-RtD7xNTJ.js";import"./Star01-CtWX4nA3.js";import"./Globe04-D7ZgONc6.js";import"./SwitchHorizontal01-QNGjYcml.js";import"./HardDrive-DNueik1y.js";import"./Key01-DrwX5nx2.js";import"./LinkExternal01-022iaJNF.js";import"./List-jObuFUL_.js";import"./Monitor01-BkHN4rM2.js";import"./Sun-CyoL1WFK.js";import"./Package-DYdmCLl6.js";import"./Palette-BWa7ee-4.js";import"./Play-DYP9-OJo.js";import"./Plus-DKATXnIq.js";import"./SearchLg-crE3yQZJ.js";import"./SearchMd-CbytZ1-S.js";import"./Shield01-CULBCC4Z.js";import"./Stars01-COE1U6xi.js";import"./Trash01-iPP4w9gK.js";import"./Upload01-CoVAXfWg.js";import"./User01-2QspS0s6.js";import"./Users01-C3FOprDj.js";import"./XClose-P0NM9uUE.js";import"./Zap-CI5WhuKJ.js";import"./use-automations-DA7j42Hg.js";import"./studio-tools-BMyTPyPy.js";import"./useSuspenseInfiniteQuery-DnwWEYgY.js";import"./badge-miK_gWS7.js";import"./checkbox-DnsQEgvs.js";import"./command-DpdcRmV-.js";import"./index-B3_jWN9S.js";import"./dialog-CUb_uQeJ.js";import"./popover-BlN-L-7w.js";import"./avatar-BB1BJsL_.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DzWDd5On.js";import"./file-type-icon-mrfxFHRk.js";import"./tab-id-BijBBRwE.js";import"./monaco-editor-D2naC6ph.js";import"./index-B_nVJPYO.js";import"./chat-context-De0V13yX.js";import"./autosend-CnfmH4zE.js";import"./hooks-G1nBJ-F3.js";import"./decopilot-sse-pool-_LHJFrBF.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-Bo4wIQxq.js";import"./use-decopilot-events-BhVWtKJy.js";import"./use-organization-settings-CHx_I7VH.js";import"./index-DAFjHwsT.js";import"./shell-layout-DamsdnEZ.js";import"./alert-dialog-GCrUNzbs.js";import"./required-auth-layout-czUUgGrX.js";import"./use-org-sso-BLc80T83.js";import"./integration-icon-CN9OtiIm.js";import"./use-navigate-to-agent-DYPKcx_j.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-5GoV9SRg.js";import"./form-CEO5VtKG.js";import"./label-u5PrAFB7.js";import"./input-DOZlS9i9.js";import"./drawer-BSFvVMvA.js";import"./collection-search-MTrnV0Y_.js";import"./tabs-kApe5O6i.js";import"./toggle-group-DScHdpkW.js";import"./use-deco-credits-DR4kDN3B.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DQ8XLP8C.js";import"./use-registry-connections-C9dbuMZN.js";import"./extract-connection-data-BIadZZgr.js";import"./collection-tabs-Dvz33uvw.js";import"./textarea-C5puqxj1.js";import"./connection-form-helpers-B4Lj6wNN.js";import"./authenticate-and-persist-oauth-DeTua2ma.js";import"./mcp-oauth-DHDPNOkD.js";import"./connect-desktop-dialog-BASAvtSw.js";import"./select-model-CJ1n8oWC.js";import"./skeleton-BxJ_vH4t.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-Bs1JjdR4.js";import"./dropdown-menu-D-nlMdm5.js";import"./index-BW23Hqv6.js";import"./toolbar-zpMjKMlc.js";import"./use-debounced-value-DxBZ974h.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-C3Efc5TW.js";import"./use-mcp-tools-Cs2tX1fK.js";import"./use-capability-CCJ-X1mC.js";import"./tools-list-BOMB05RR.js";import"./switch-C6-Jkvpv.js";import"./use-debounced-autosave-JbhBBkyc.js";import"./index-C9P6Y57L.js";import"./search-input-BQOeLOTi.js";import"./github-repo-picker-CH-zkM68.js";import"./github-installations-ChFezl8I.js";import"./use-secrets-Cs1UIn3n.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./companions-core-CgTHLTTN.js";import"./index-C7cs-gci.js";import"./get-initials-D-f_fDFw.js";import"./calendar-i7Bgz_TN.js";import"./toolbar-icon-button-D3Y1-YHW.js";import"./use-file-configs-t6weWLBN.js";import"./automation-list-row-bCHP9GaB.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 Cr(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{Cr 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-lRedQ_8t.js";import{s as q}from"./Plus-DKATXnIq.js";import{i as S}from"./Zap-CI5WhuKJ.js";import{S as D}from"./search-input-BQOeLOTi.js";import{P as l}from"./index-C9P6Y57L.js";import{E as b}from"./empty-state-C_IbZdBr.js";import{c as O}from"./use-automations-DA7j42Hg.js";import{c as V}from"./use-navigate-to-agent-DYPKcx_j.js";import{A as F}from"./automation-list-row-bCHP9GaB.js";import{f as G}from"./constants-D_FQAPnt.js";import{u as H}from"./use-virtual-mcp-D9inM-9h.js";import{R as J}from"./require-capability-B_dSH45y.js";import"./SearchMd-CbytZ1-S.js";import"./sidebar-joQ3ZQPE.js";import"./LayoutLeft-CHLKhLgL.js";import"./use-mobile-RU-Nn_Un.js";import"./X-Bqs01fCh.js";import"./tooltip-REPIyd2Z.js";import"./use-mcp-client-D6H50Mmm.js";import"./auth-Cf4In3Ce.js";import"./studio-tools-BMyTPyPy.js";import"./hooks-G1nBJ-F3.js";import"./decopilot-sse-pool-_LHJFrBF.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./alert-dialog-GCrUNzbs.js";import"./dropdown-menu-D-nlMdm5.js";import"./Check-DYPRi7NO.js";import"./ChevronRight-BARfL9-W.js";import"./Circle-DuelqjM2.js";import"./Stars02-BzQc7fZz.js";import"./DotsVertical-B_jKX962.js";import"./Trash01-iPP4w9gK.js";import"./agent-icon-5pSyq_FH.js";import"./AlertCircle-BaauQIwC.js";import"./UserPlus01-DoBolndD.js";import"./Tool01-BWGVYfev.js";import"./ArrowUp-C814v0pE.js";import"./Settings02-1LTNhTXj.js";import"./Tool02-DkTMVP4f.js";import"./XCircle-DHCvZwgH.js";import"./ArrowUpRight-BLP3DLju.js";import"./TrendUp01-C3q3M7MG.js";import"./ZapSquare-BhWmmFEB.js";import"./Users03-BYqJADve.js";import"./CheckCircle-D_t3rWUI.js";import"./ChevronDown-wHLuFr3i.js";import"./ChevronUp-CRmxYAjE.js";import"./Copy01-BwtpNAKR.js";import"./ZoomOut-C7W-ZWAB.js";import"./Globe01-B-4z45oj.js";import"./Eye-CM4SfxEo.js";import"./FilterLines-CwEBxGZP.js";import"./Flag01-RtD7xNTJ.js";import"./Star01-CtWX4nA3.js";import"./Globe04-D7ZgONc6.js";import"./SwitchHorizontal01-QNGjYcml.js";import"./HardDrive-DNueik1y.js";import"./Key01-DrwX5nx2.js";import"./LinkExternal01-022iaJNF.js";import"./List-jObuFUL_.js";import"./Monitor01-BkHN4rM2.js";import"./Sun-CyoL1WFK.js";import"./Package-DYdmCLl6.js";import"./Palette-BWa7ee-4.js";import"./Play-DYP9-OJo.js";import"./SearchLg-crE3yQZJ.js";import"./Shield01-CULBCC4Z.js";import"./Stars01-COE1U6xi.js";import"./Upload01-CoVAXfWg.js";import"./User01-2QspS0s6.js";import"./Users01-C3FOprDj.js";import"./XClose-P0NM9uUE.js";import"./use-collections-D-OJag2e.js";import"./use-capability-CCJ-X1mC.js";import"./access-gate-BK7GcTMo.js";import"./capability-load-error-ykEHLKnb.js";function K(){const t=B.c(16),{org:i}=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(e=>{if(!g||e.name.toLowerCase().includes(g))return!0;if(e.virtual_mcp_id){const a=y.get(e.virtual_mcp_id);if(a&&a.title.toLowerCase().includes(g))return!0}return!1}),P=(e,a)=>{const A=a&&y.has(a)?a:G(i.id);N("automations_list_row_clicked",{automation_id:e,agent_id:A,source:"settings_automations"}),k(A,{search:{main:"automation:"+e}})};let n;t[0]!==d||t[1]!==i.slug?(n=()=>{N("automations_empty_state_browse_agents_clicked"),d({to:"/$org/settings/agents",params:{org:i.slug}})},t[0]=d,t[1]=i.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(e=>o.jsx(F,{automation:e,showAgent:!0,onClick:()=>P(e.id,e.virtual_mcp_id)},e.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 _o(){const t=B.c(1);let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(J,{capability:"automations:manage",area:"automations",children:o.jsx(K,{})}),t[0]=i):i=t[0],i}export{_o 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-lRedQ_8t.js";import{i as X}from"./XCircle-DHCvZwgH.js";import{aD as Y,a8 as T}from"./agent-icon-5pSyq_FH.js";import{n as Z}from"./LinkExternal01-022iaJNF.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-GCrUNzbs.js";import{I as M}from"./input-DOZlS9i9.js";import{L}from"./label-u5PrAFB7.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-BZjBKD1m.js";import{c as ut,B as gt,a as xt}from"./block-document-BnBi9DlX.js";import{u as ft}from"./use-autosave-DBERSs2x.js";import{t as ht}from"./ChevronDown-wHLuFr3i.js";import{J as yt,K as jt,I as vt}from"./automation-runs-K5fQtR3Q.js";import{s as v,E as bt}from"./primitives-C1zKVkUs.js";import"./AlertCircle-BaauQIwC.js";import"./UserPlus01-DoBolndD.js";import"./Tool01-BWGVYfev.js";import"./ArrowUp-C814v0pE.js";import"./Settings02-1LTNhTXj.js";import"./Tool02-DkTMVP4f.js";import"./ArrowUpRight-BLP3DLju.js";import"./TrendUp01-C3q3M7MG.js";import"./ZapSquare-BhWmmFEB.js";import"./Users03-BYqJADve.js";import"./CheckCircle-D_t3rWUI.js";import"./Check-DYPRi7NO.js";import"./ChevronRight-BARfL9-W.js";import"./ChevronUp-CRmxYAjE.js";import"./Circle-DuelqjM2.js";import"./Stars02-BzQc7fZz.js";import"./Copy01-BwtpNAKR.js";import"./ZoomOut-C7W-ZWAB.js";import"./DotsVertical-B_jKX962.js";import"./Globe01-B-4z45oj.js";import"./Eye-CM4SfxEo.js";import"./FilterLines-CwEBxGZP.js";import"./Flag01-RtD7xNTJ.js";import"./Star01-CtWX4nA3.js";import"./Globe04-D7ZgONc6.js";import"./SwitchHorizontal01-QNGjYcml.js";import"./HardDrive-DNueik1y.js";import"./Key01-DrwX5nx2.js";import"./LayoutLeft-CHLKhLgL.js";import"./List-jObuFUL_.js";import"./Monitor01-BkHN4rM2.js";import"./Sun-CyoL1WFK.js";import"./Package-DYdmCLl6.js";import"./Palette-BWa7ee-4.js";import"./Play-DYP9-OJo.js";import"./Plus-DKATXnIq.js";import"./SearchLg-crE3yQZJ.js";import"./SearchMd-CbytZ1-S.js";import"./Shield01-CULBCC4Z.js";import"./Stars01-COE1U6xi.js";import"./Trash01-iPP4w9gK.js";import"./Upload01-CoVAXfWg.js";import"./User01-2QspS0s6.js";import"./Users01-C3FOprDj.js";import"./XClose-P0NM9uUE.js";import"./X-Bqs01fCh.js";import"./Zap-CI5WhuKJ.js";import"./chat-context-De0V13yX.js";import"./autosend-CnfmH4zE.js";import"./hooks-G1nBJ-F3.js";import"./use-mcp-client-D6H50Mmm.js";import"./constants-D_FQAPnt.js";import"./auth-Cf4In3Ce.js";import"./decopilot-sse-pool-_LHJFrBF.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-BMyTPyPy.js";import"./use-virtual-mcp-D9inM-9h.js";import"./use-collections-D-OJag2e.js";import"./use-ai-providers-Bo4wIQxq.js";import"./use-decopilot-events-BhVWtKJy.js";import"./tab-id-BijBBRwE.js";import"./use-organization-settings-CHx_I7VH.js";import"./tooltip-REPIyd2Z.js";import"./dialog-CUb_uQeJ.js";import"./drawer-BSFvVMvA.js";import"./collection-search-MTrnV0Y_.js";import"./use-mobile-RU-Nn_Un.js";import"./AreaChart-5GoV9SRg.js";import"./index-DAFjHwsT.js";import"./shell-layout-DamsdnEZ.js";import"./avatar-BB1BJsL_.js";import"./required-auth-layout-czUUgGrX.js";import"./use-org-sso-BLc80T83.js";import"./form-CEO5VtKG.js";import"./select-CxRcXiYy.js";import"./tabs-kApe5O6i.js";import"./toggle-group-DScHdpkW.js";import"./use-deco-credits-DR4kDN3B.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DQ8XLP8C.js";import"./use-registry-connections-C9dbuMZN.js";import"./use-connection-DmUK9JRy.js";import"./useInfiniteQuery-XeUdT1mI.js";import"./use-infinite-scroll-B4v-_NDY.js";import"./extract-connection-data-BIadZZgr.js";import"./card-BjD2_XuX.js";import"./integration-icon-CN9OtiIm.js";import"./collection-tabs-Dvz33uvw.js";import"./badge-miK_gWS7.js";import"./textarea-C5puqxj1.js";import"./connection-form-helpers-B4Lj6wNN.js";import"./authenticate-and-persist-oauth-DeTua2ma.js";import"./mcp-oauth-DHDPNOkD.js";import"./useSuspenseInfiniteQuery-DnwWEYgY.js";import"./connect-desktop-dialog-BASAvtSw.js";import"./select-model-CJ1n8oWC.js";import"./checkbox-DnsQEgvs.js";import"./skeleton-BxJ_vH4t.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-Bs1JjdR4.js";import"./command-DpdcRmV-.js";import"./index-B3_jWN9S.js";import"./popover-BlN-L-7w.js";import"./dropdown-menu-D-nlMdm5.js";import"./index-BW23Hqv6.js";import"./file-type-icon-mrfxFHRk.js";import"./toolbar-zpMjKMlc.js";import"./use-debounced-value-DxBZ974h.js";import"./index-B_nVJPYO.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-C3Efc5TW.js";import"./empty-state-C_IbZdBr.js";import"./use-mcp-tools-Cs2tX1fK.js";import"./use-capability-CCJ-X1mC.js";import"./tools-list-BOMB05RR.js";import"./switch-C6-Jkvpv.js";import"./use-debounced-autosave-JbhBBkyc.js";import"./index-C9P6Y57L.js";import"./sidebar-joQ3ZQPE.js";import"./search-input-BQOeLOTi.js";import"./github-repo-picker-CH-zkM68.js";import"./use-navigate-to-agent-DYPKcx_j.js";import"./reusable-new-chat-CouMjkYR.js";import"./github-installations-ChFezl8I.js";import"./use-secrets-Cs1UIn3n.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./companions-core-CgTHLTTN.js";import"./format-time-BnbuEtat.js";import"./use-members-Bz6iBsM4.js";import"./use-org-auth-client-DrmuxI_m.js";import"./index-C7cs-gci.js";import"./get-initials-D-f_fDFw.js";import"./calendar-i7Bgz_TN.js";import"./use-copy-DzWDd5On.js";import"./toolbar-icon-button-D3Y1-YHW.js";import"./use-file-configs-t6weWLBN.js";import"./monaco-editor-D2naC6ph.js";import"./use-automations-DA7j42Hg.js";import"./automation-list-row-bCHP9GaB.js";import"./table-BBmNComr.js";import"./use-clock-tick-MLdLuh40.js";function Ct(k){const e=q.c(18),{icon:f,title:n,defaultOpen:b,children:d}=k,D=b===void 0?!1:b,[x,A]=S.useState(D);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:A,className:"mt-4",children:[c,s]}),e[14]=x,e[15]=c,e[16]=s,e[17]=u):u=e[17],u}function yr({orgSlug:k,virtualMcpId:e,branch:f,blockKey:n,block:b,decofile:d,meta:D,onManagePosts:x,onOpenPost:A,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,P]=S.useState(!1),$=a?nt(d).filter(o=>o.categorySlugs.includes(a)):[],j=$.length,W=o=>s("slug",o),H=async(o,w)=>{const V=v(r.name);P(!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 z={...r,slug:w};await i.mutateAsync({blockKey:n,data:R(n,"categories",z)}),c(z),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{P(!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(Z,{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:Y,title:"Content",defaultOpen:!0,children:t.jsx(gt,{value:xt(r.sections),onChange:o=>s("sections",o),meta:D,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:$.map(o=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>A(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{yr as CategoryEditor};
@@ -1 +0,0 @@
1
- import{c as E,j as n,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-lRedQ_8t.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-BCQjUWN7.js";import{A as We}from"./auth-entry-BBn3Oy3I.js";import{A as Ge}from"./auth-split-layout-ClDCjxcR.js";import{O as Re}from"./organization-choice-Csr-kPrj.js";import{I as Ye}from"./input-DOZlS9i9.js";import{u as Je}from"./use-mcp-client-D6H50Mmm.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-DHCvZwgH.js";import"./integration-icon-CN9OtiIm.js";import"./Tool02-DkTMVP4f.js";import"./agent-icon-5pSyq_FH.js";import"./AlertCircle-BaauQIwC.js";import"./UserPlus01-DoBolndD.js";import"./Tool01-BWGVYfev.js";import"./ArrowUp-C814v0pE.js";import"./Settings02-1LTNhTXj.js";import"./ArrowUpRight-BLP3DLju.js";import"./TrendUp01-C3q3M7MG.js";import"./ZapSquare-BhWmmFEB.js";import"./Users03-BYqJADve.js";import"./CheckCircle-D_t3rWUI.js";import"./Check-DYPRi7NO.js";import"./ChevronDown-wHLuFr3i.js";import"./ChevronRight-BARfL9-W.js";import"./ChevronUp-CRmxYAjE.js";import"./Circle-DuelqjM2.js";import"./Stars02-BzQc7fZz.js";import"./Copy01-BwtpNAKR.js";import"./ZoomOut-C7W-ZWAB.js";import"./DotsVertical-B_jKX962.js";import"./Globe01-B-4z45oj.js";import"./Eye-CM4SfxEo.js";import"./FilterLines-CwEBxGZP.js";import"./Flag01-RtD7xNTJ.js";import"./Star01-CtWX4nA3.js";import"./Globe04-D7ZgONc6.js";import"./SwitchHorizontal01-QNGjYcml.js";import"./HardDrive-DNueik1y.js";import"./Key01-DrwX5nx2.js";import"./LayoutLeft-CHLKhLgL.js";import"./LinkExternal01-022iaJNF.js";import"./List-jObuFUL_.js";import"./Monitor01-BkHN4rM2.js";import"./Sun-CyoL1WFK.js";import"./Package-DYdmCLl6.js";import"./Palette-BWa7ee-4.js";import"./Play-DYP9-OJo.js";import"./Plus-DKATXnIq.js";import"./SearchLg-crE3yQZJ.js";import"./SearchMd-CbytZ1-S.js";import"./Shield01-CULBCC4Z.js";import"./Stars01-COE1U6xi.js";import"./Trash01-iPP4w9gK.js";import"./Upload01-CoVAXfWg.js";import"./User01-2QspS0s6.js";import"./Users01-C3FOprDj.js";import"./XClose-P0NM9uUE.js";import"./X-Bqs01fCh.js";import"./Zap-CI5WhuKJ.js";import"./dialog-CUb_uQeJ.js";import"./tooltip-REPIyd2Z.js";import"./companions-core-CgTHLTTN.js";import"./extract-connection-data-BIadZZgr.js";import"./github-installations-ChFezl8I.js";import"./form-CEO5VtKG.js";import"./label-u5PrAFB7.js";import"./use-debounced-value-DxBZ974h.js";import"./authenticate-and-persist-oauth-DeTua2ma.js";import"./mcp-oauth-DHDPNOkD.js";import"./auth-Cf4In3Ce.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-BB1BJsL_.js";const nt={workspace:"Preparando seu workspace de commerce...",generic:"Preparando..."};function ot(l){return nt[l]}function ye(l){const e=E.c(4),{variant:i}=l;let t;e[0]!==i?(t=ot(i),e[0]=i,e[1]=t):t=e[1];let s;return e[2]!==t?(s=n.jsx("div",{className:"flex justify-center py-4",role:"status","aria-live":"polite",children:n.jsx(Ke,{label:t,className:"text-muted-foreground"})}),e[2]=t,e[3]=s):s=e[3],s}function wi(){const l=E.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.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(),o=a?.user?.email;let m;e[4]!==c.siteUrl||e[5]!==o?(m=Ce({siteUrl:c.siteUrl,email:o}),e[4]=c.siteUrl,e[5]=o,e[6]=m):m=e[6];const d=m;let u;e[7]!==d||e[8]!==t?(u=t??n.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=n.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}}:{}})),n.jsx(Me.Provider,{value:t,children:n.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=n.jsx(R,{children:n.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?n.jsx(Pe,{host:a}):void 0,e[1]=a,e[2]=d):d=e[2];let u;return e[3]!==d?(u=n.jsx(R,{children:n.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 o;return e[5]!==i||e[6]!==t?(o=n.jsx(lt,{requestedOrgSlug:i,siteUrl:t}),e[5]=i,e[6]=t,e[7]=o):o=e[7],o}function lt(l){const e=E.c(43),{requestedOrgSlug:i,siteUrl:t}=l,s=Fe(),c=qe(),[a,o]=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=n.jsx(R,{children:n.jsx(ye,{variant:"workspace"})}),e[1]=r):r=e[1],r}if(c.error){let r;return e[2]!==c?(r=n.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=n.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=n.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=n.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=n.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=n.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=n.jsx(R,{children:n.jsxs("div",{className:"grid gap-10",children:[r,n.jsx(Ne,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:n.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=n.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=n.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=n.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(),o({...$,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=n.jsx(R,{children:n.jsxs("div",{className:"grid gap-10",children:[r,n.jsx(Ne,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:n.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=n.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=n.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 o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(ye,{variant:"generic"}),e[4]=o):o=e[4];let m;return e[5]!==a?(m=n.jsx(R,{children:n.jsx("div",{ref:a,children:o})}),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?n.jsx(Pe,{host:s}):n.jsxs("div",{children:[n.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),n.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)&&n.jsxs("div",{className:"space-y-2",children:[i&&n.jsx("h1",{className:"text-2xl font-medium leading-8",children:i}),t&&n.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 o;return e[5]!==c||e[6]!==a?(o=n.jsxs("div",{className:"grid gap-10",children:[c,a]}),e[5]=c,e[6]=a,e[7]=o):o=e[7],o}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=n.jsx(k,{title:i,description:t}),e[0]=t,e[1]=i,e[2]=a):a=e[2];let o;e[3]!==s||e[4]!==c?(o=n.jsx(je,{type:"button",size:"xl",className:"w-full",onClick:c,children:s}),e[3]=s,e[4]=c,e[5]=o):o=e[5];let m;return e[6]!==a||e[7]!==o?(m=n.jsx(R,{children:n.jsxs("div",{className:"grid gap-10",children:[a,o]})}),e[6]=a,e[7]=o,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 o=a;let m;e[3]!==o||e[4]!==i.id?(m=n.jsx(be,{href:o,orgId:i.id}),e[3]=o,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=n.jsx(He,{children:v=>{const{reset:p}=v;return n.jsx(Ve,{fallback:j=>{const{error:g,resetError:S}=j;return n.jsx(R,{visual:d,children:n.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:n.jsx(M.Suspense,{fallback:n.jsx(ke,{visual:d}),children:n.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=n.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[n.jsx(k,{}),n.jsx(we,{})]}),e[0]=t):t=e[0];let s;return e[1]!==i?(s=n.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=n.jsx(k,{title:"Diagnóstico de commerce",description:c}),e[0]=c,e[1]=a):a=e[1];let o;e[2]!==t?(o=n.jsx(le,{message:t}),e[2]=t,e[3]=o):o=e[3];let m;e[4]!==s?(m=n.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]!==o||e[8]!==m?(d=n.jsxs("div",{className:"grid gap-10",children:[a,o,m]}),e[6]=a,e[7]=o,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),[o,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||o||"";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||o||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=n.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]!==o?(ie=f=>{f.preventDefault();const x=pe(o);x.ok&&se("commerce_onboarding_site_url_submitted",{domain:new URL(x.value).hostname,organization_id:i.id}),D(o)},e[42]=i.id,e[43]=D,e[44]=o,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=n.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=n.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]!==o){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=n.jsx(k,{title:"Diagnóstico de commerce",description:fe}),e[68]=fe,e[69]=V):V=e[69];const ge=n.jsx(le,{message:Oe(f.error)});let B;e[70]!==z||e[71]!==d||e[72]!==b.isPending||e[73]!==o?(B=n.jsx(he,{siteUrl:o,error:d,isSubmitting:b.isPending,onSiteUrlChange:m,onSubmit:z}),e[70]=z,e[71]=d,e[72]=b.isPending,e[73]=o,e[74]=B):B=e[74];let K;e[75]!==V||e[76]!==ge||e[77]!==B?(K=n.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 oe;e[79]!==y||e[80]!==K?(oe=n.jsx(R,{visual:y,children:K}),e[79]=y,e[80]=K,e[81]=oe):oe=e[81],x=oe;break e}e[59]=y,e[60]=z,e[61]=t,e[62]=d,e[63]=i.name,e[64]=b.isPending,e[65]=o,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=n.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]!==o?(L=d?n.jsxs(n.Fragment,{children:[n.jsx(le,{message:d}),n.jsx(he,{siteUrl:o,error:null,isSubmitting:b.isPending,onSiteUrlChange:m,onSubmit:z})]}):n.jsx(we,{}),e[84]=z,e[85]=d,e[86]=b.isPending,e[87]=o,e[88]=L):L=e[88];let N;e[89]!==U||e[90]!==L||e[91]!==de?(N=n.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=n.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=n.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]!==o?(q=n.jsx(he,{siteUrl:o,error:d,isSubmitting:b.isPending,onSiteUrlChange:m,onSubmit:z}),e[98]=z,e[99]=d,e[100]=b.isPending,e[101]=o,e[102]=q):q=e[102];let H;e[103]!==F||e[104]!==q?(H=n.jsxs("div",{className:"grid gap-10",children:[F,q]}),e[103]=F,e[104]=q,e[105]=H):H=e[105];let ne;return e[106]!==y||e[107]!==H?(ne=n.jsx(R,{visual:y,children:H}),e[106]=y,e[107]=H,e[108]=ne):ne=e[108],ne}function he(l){const e=E.c(20),{siteUrl:i,error:t,isSubmitting:s,onSiteUrlChange:c,onSubmit:a}=l;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:"URL do site"}),e[0]=o):o=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=n.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?n.jsx(le,{message:t}):null,e[8]=t,e[9]=v):v=e[9];let p;e[10]!==u||e[11]!==v?(p=n.jsxs("div",{className:"grid gap-2",children:[o,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=n.jsx(it,{size:16}),e[13]=j):j=e[13];let g;e[14]!==s?(g=n.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=n.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=n.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:i}),e[0]=i,e[1]=t):t=e[1],t}export{wi as default};
@@ -1 +0,0 @@
1
- import{b as m}from"./extract-connection-data-BIadZZgr.js";import{a as g}from"./github-installations-ChFezl8I.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 Z,r as u,j as r,i as se,B as he,d$ as Mt,aO as Dt,aU as ie,e0 as Rt,e1 as Pt,e2 as Et,e3 as kt,bO as Ot,e4 as Tt,e5 as qe,aQ as At,e6 as Lt,e7 as Ft,e8 as It,e9 as $t,ea as _t,eb as zt,ec as Wt,ed as Gt,ee as Kt,l as ae,n as Bt,t as W,K as $e}from"./index-lRedQ_8t.js";import{F as Ut,l as Vt}from"./index-B_nVJPYO.js";import{d as qt,az as Qt,aA as Ht,aB as ue,aC as Xt,a8 as _e}from"./agent-icon-5pSyq_FH.js";import{a as Jt}from"./Tool01-BWGVYfev.js";import{s as Yt}from"./XClose-P0NM9uUE.js";import{A as Zt}from"./automation-runs-K5fQtR3Q.js";import{b as ze,T as We,a as Ge}from"./tooltip-REPIyd2Z.js";import{f as en,a as tn,b as nn,c as rn,d as on,e as sn,A as an,g as ln}from"./alert-dialog-GCrUNzbs.js";import{b as cn}from"./chat-context-De0V13yX.js";import{u as dn}from"./shell-layout-DamsdnEZ.js";import{s as fe,a as Ke,f as un}from"./index-BZjBKD1m.js";import{a as fn,h as mn,D as pn,c as xn,d as hn,e as gn}from"./dialog-CUb_uQeJ.js";import{I as Be}from"./input-DOZlS9i9.js";import{t as vn}from"./ChevronDown-wHLuFr3i.js";import{i as yn}from"./ChevronRight-BARfL9-W.js";import{a as Cn}from"./ZoomOut-C7W-ZWAB.js";import{E as wn,v as Ue,w as Ce,x as bn,y as jn,z as Nn,A as U,C as me,g as we,D as be,G as Sn,I as Mn,J as je,K as pe,M as Ne,N as Dn,O as Rn}from"./index-BW23Hqv6.js";import"./AlertCircle-BaauQIwC.js";import"./UserPlus01-DoBolndD.js";import"./ArrowUp-C814v0pE.js";import"./Settings02-1LTNhTXj.js";import"./Tool02-DkTMVP4f.js";import"./XCircle-DHCvZwgH.js";import"./ArrowUpRight-BLP3DLju.js";import"./TrendUp01-C3q3M7MG.js";import"./ZapSquare-BhWmmFEB.js";import"./Users03-BYqJADve.js";import"./CheckCircle-D_t3rWUI.js";import"./Check-DYPRi7NO.js";import"./ChevronUp-CRmxYAjE.js";import"./Circle-DuelqjM2.js";import"./Stars02-BzQc7fZz.js";import"./Copy01-BwtpNAKR.js";import"./DotsVertical-B_jKX962.js";import"./Globe01-B-4z45oj.js";import"./Eye-CM4SfxEo.js";import"./FilterLines-CwEBxGZP.js";import"./Flag01-RtD7xNTJ.js";import"./Star01-CtWX4nA3.js";import"./Globe04-D7ZgONc6.js";import"./SwitchHorizontal01-QNGjYcml.js";import"./HardDrive-DNueik1y.js";import"./Key01-DrwX5nx2.js";import"./LayoutLeft-CHLKhLgL.js";import"./LinkExternal01-022iaJNF.js";import"./List-jObuFUL_.js";import"./Monitor01-BkHN4rM2.js";import"./Sun-CyoL1WFK.js";import"./Package-DYdmCLl6.js";import"./Palette-BWa7ee-4.js";import"./Play-DYP9-OJo.js";import"./Plus-DKATXnIq.js";import"./SearchLg-crE3yQZJ.js";import"./SearchMd-CbytZ1-S.js";import"./Shield01-CULBCC4Z.js";import"./Stars01-COE1U6xi.js";import"./Trash01-iPP4w9gK.js";import"./Upload01-CoVAXfWg.js";import"./User01-2QspS0s6.js";import"./Users01-C3FOprDj.js";import"./X-Bqs01fCh.js";import"./Zap-CI5WhuKJ.js";import"./select-CxRcXiYy.js";import"./useInfiniteQuery-XeUdT1mI.js";import"./use-infinite-scroll-B4v-_NDY.js";import"./use-connection-DmUK9JRy.js";import"./use-collections-D-OJag2e.js";import"./use-mcp-client-D6H50Mmm.js";import"./constants-D_FQAPnt.js";import"./auth-Cf4In3Ce.js";import"./use-virtual-mcp-D9inM-9h.js";import"./card-BjD2_XuX.js";import"./sidebar-joQ3ZQPE.js";import"./use-mobile-RU-Nn_Un.js";import"./table-BBmNComr.js";import"./empty-state-C_IbZdBr.js";import"./use-members-Bz6iBsM4.js";import"./use-org-auth-client-DrmuxI_m.js";import"./use-clock-tick-MLdLuh40.js";import"./use-automations-DA7j42Hg.js";import"./studio-tools-BMyTPyPy.js";import"./useSuspenseInfiniteQuery-DnwWEYgY.js";import"./badge-miK_gWS7.js";import"./checkbox-DnsQEgvs.js";import"./command-DpdcRmV-.js";import"./index-B3_jWN9S.js";import"./popover-BlN-L-7w.js";import"./avatar-BB1BJsL_.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DzWDd5On.js";import"./file-type-icon-mrfxFHRk.js";import"./tab-id-BijBBRwE.js";import"./monaco-editor-D2naC6ph.js";import"./delay-CnY5UFtP.js";import"./index-DAFjHwsT.js";import"./hooks-G1nBJ-F3.js";import"./decopilot-sse-pool-_LHJFrBF.js";import"./backoff-CrEUbyZT.js";import"./integration-icon-CN9OtiIm.js";import"./use-navigate-to-agent-DYPKcx_j.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-5GoV9SRg.js";import"./form-CEO5VtKG.js";import"./label-u5PrAFB7.js";import"./autosend-CnfmH4zE.js";import"./use-ai-providers-Bo4wIQxq.js";import"./use-decopilot-events-BhVWtKJy.js";import"./use-organization-settings-CHx_I7VH.js";import"./required-auth-layout-czUUgGrX.js";import"./use-org-sso-BLc80T83.js";import"./drawer-BSFvVMvA.js";import"./collection-search-MTrnV0Y_.js";import"./tabs-kApe5O6i.js";import"./toggle-group-DScHdpkW.js";import"./use-deco-credits-DR4kDN3B.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DQ8XLP8C.js";import"./use-registry-connections-C9dbuMZN.js";import"./extract-connection-data-BIadZZgr.js";import"./collection-tabs-Dvz33uvw.js";import"./textarea-C5puqxj1.js";import"./connection-form-helpers-B4Lj6wNN.js";import"./authenticate-and-persist-oauth-DeTua2ma.js";import"./mcp-oauth-DHDPNOkD.js";import"./connect-desktop-dialog-BASAvtSw.js";import"./select-model-CJ1n8oWC.js";import"./skeleton-BxJ_vH4t.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-Bs1JjdR4.js";import"./dropdown-menu-D-nlMdm5.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-C3Efc5TW.js";import"./toolbar-zpMjKMlc.js";import"./use-mcp-tools-Cs2tX1fK.js";import"./use-capability-CCJ-X1mC.js";import"./tools-list-BOMB05RR.js";import"./switch-C6-Jkvpv.js";import"./use-debounced-autosave-JbhBBkyc.js";import"./index-C9P6Y57L.js";import"./search-input-BQOeLOTi.js";import"./github-repo-picker-CH-zkM68.js";import"./use-debounced-value-DxBZ974h.js";import"./github-installations-ChFezl8I.js";import"./use-secrets-Cs1UIn3n.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./companions-core-CgTHLTTN.js";import"./index-C7cs-gci.js";import"./get-initials-D-f_fDFw.js";import"./calendar-i7Bgz_TN.js";import"./toolbar-icon-button-D3Y1-YHW.js";import"./use-file-configs-t6weWLBN.js";import"./automation-list-row-bCHP9GaB.js";const Pn={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function En(s){const e=Z.c(51),{open:i,mode:a,initialName:c,parentLabel:m,isPending:x,onSubmit:p,onOpenChange:g}=s,M=c===void 0?"":c,d=x===void 0?!1:x,[h,y]=u.useState(M),[B,V]=u.useState(i),C=Pn[a];i!==B&&(V(i),i&&y(M));let I;e[0]!==d||e[1]!==g?(I=_=>{!_&&!d&&g(!1)},e[0]=d,e[1]=g,e[2]=I):I=e[2];const H=I;let q;e[3]!==d||e[4]!==h||e[5]!==p?(q=async _=>{_.preventDefault();const K=h.trim();!K||d||await p(K)},e[3]=d,e[4]=h,e[5]=p,e[6]=q):q=e[6];const Q=q;let $;e[7]!==C.title?($=r.jsx(fn,{children:C.title}),e[7]=C.title,e[8]=$):$=e[8];let O;e[9]!==C.description?(O=r.jsx(mn,{children:C.description}),e[9]=C.description,e[10]=O):O=e[10];let G;e[11]!==$||e[12]!==O?(G=r.jsxs(pn,{children:[$,O]}),e[11]=$,e[12]=O,e[13]=G):G=e[13];let T;e[14]!==m?(T=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),r.jsx(Be,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=m,e[15]=T):T=e[15];let A;e[16]===Symbol.for("react.memo_cache_sentinel")?(A=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=A):A=e[16];let R;e[17]===Symbol.for("react.memo_cache_sentinel")?(R=_=>y(_.target.value),e[17]=R):R=e[17];let P;e[18]!==C.placeholder||e[19]!==d||e[20]!==h?(P=r.jsxs("div",{className:"space-y-1.5",children:[A,r.jsx(Be,{id:"file-explorer-name",value:h,onChange:R,placeholder:C.placeholder,autoFocus:!0,disabled:d})]}),e[18]=C.placeholder,e[19]=d,e[20]=h,e[21]=P):P=e[21];let j;e[22]!==P||e[23]!==T?(j=r.jsxs("div",{className:"space-y-4 py-4",children:[T,P]}),e[22]=P,e[23]=T,e[24]=j):j=e[24];let N;e[25]!==g?(N=()=>g(!1),e[25]=g,e[26]=N):N=e[26];let E;e[27]!==d||e[28]!==N?(E=r.jsx(he,{type:"button",variant:"outline",onClick:N,disabled:d,children:"Cancel"}),e[27]=d,e[28]=N,e[29]=E):E=e[29];let k;e[30]!==d||e[31]!==h?(k=!h.trim()||d,e[30]=d,e[31]=h,e[32]=k):k=e[32];let w;e[33]!==C.submit||e[34]!==d?(w=d?r.jsxs(r.Fragment,{children:[r.jsx(se,{size:14,className:"animate-spin"}),"Saving…"]}):C.submit,e[33]=C.submit,e[34]=d,e[35]=w):w=e[35];let L;e[36]!==k||e[37]!==w?(L=r.jsx(he,{type:"submit",disabled:k,children:w}),e[36]=k,e[37]=w,e[38]=L):L=e[38];let b;e[39]!==E||e[40]!==L?(b=r.jsxs(xn,{children:[E,L]}),e[39]=E,e[40]=L,e[41]=b):b=e[41];let S;e[42]!==Q||e[43]!==j||e[44]!==b||e[45]!==G?(S=r.jsx(hn,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:Q,children:[G,j,b]})}),e[42]=Q,e[43]=j,e[44]=b,e[45]=G,e[46]=S):S=e[46];let z;return e[47]!==H||e[48]!==i||e[49]!==S?(z=r.jsx(gn,{open:i,onOpenChange:H,children:S}),e[47]=H,e[48]=i,e[49]=S,e[50]=z):z=e[50],z}var Me="ContextMenu",[kn]=At(Me,[qe]),F=qe(),[On,Qe]=kn(Me),He=s=>{const{__scopeContextMenu:e,children:i,onOpenChange:a,dir:c,modal:m=!0}=s,[x,p]=u.useState(!1),g=F(e),M=Ot(a),d=u.useCallback(h=>{p(h),M(h)},[M]);return r.jsx(On,{scope:e,open:x,onOpenChange:d,modal:m,children:r.jsx(Tt,{...g,dir:c,open:x,onOpenChange:d,modal:m,children:i})})};He.displayName=Me;var Xe="ContextMenuTrigger",Je=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,disabled:a=!1,...c}=s,m=Qe(Xe,i),x=F(i),p=u.useRef({x:0,y:0}),g=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...p.current})}),M=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(M.current),[]),h=y=>{p.current={x:y.clientX,y:y.clientY},m.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(Mt,{...x,virtualRef:g}),r.jsx(Dt.span,{"data-state":m.open?"open":"closed","data-disabled":a?"":void 0,...c,ref:e,style:{WebkitTouchCallout:"none",...s.style},onContextMenu:a?s.onContextMenu:ie(s.onContextMenu,y=>{d(),h(y),y.preventDefault()}),onPointerDown:a?s.onPointerDown:ie(s.onPointerDown,xe(y=>{d(),M.current=window.setTimeout(()=>h(y),700)})),onPointerMove:a?s.onPointerMove:ie(s.onPointerMove,xe(d)),onPointerCancel:a?s.onPointerCancel:ie(s.onPointerCancel,xe(d)),onPointerUp:a?s.onPointerUp:ie(s.onPointerUp,xe(d))})]})});Je.displayName=Xe;var Tn="ContextMenuPortal",Ye=s=>{const{__scopeContextMenu:e,...i}=s,a=F(e);return r.jsx(Et,{...a,...i})};Ye.displayName=Tn;var Ze="ContextMenuContent",et=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=Qe(Ze,i),m=F(i),x=u.useRef(!1);return r.jsx(kt,{...m,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:p=>{s.onCloseAutoFocus?.(p),!p.defaultPrevented&&x.current&&p.preventDefault(),x.current=!1},onInteractOutside:p=>{s.onInteractOutside?.(p),!p.defaultPrevented&&!c.modal&&(x.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)"}})});et.displayName=Ze;var An="ContextMenuGroup",Ln=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Lt,{...c,...a,ref:e})});Ln.displayName=An;var Fn="ContextMenuLabel",In=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Ft,{...c,...a,ref:e})});In.displayName=Fn;var $n="ContextMenuItem",tt=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Rt,{...c,...a,ref:e})});tt.displayName=$n;var _n="ContextMenuCheckboxItem",zn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(It,{...c,...a,ref:e})});zn.displayName=_n;var Wn="ContextMenuRadioGroup",Gn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx($t,{...c,...a,ref:e})});Gn.displayName=Wn;var Kn="ContextMenuRadioItem",Bn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(_t,{...c,...a,ref:e})});Bn.displayName=Kn;var Un="ContextMenuItemIndicator",Vn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(zt,{...c,...a,ref:e})});Vn.displayName=Un;var qn="ContextMenuSeparator",nt=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Pt,{...c,...a,ref:e})});nt.displayName=qn;var Qn="ContextMenuArrow",Hn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Wt,{...c,...a,ref:e})});Hn.displayName=Qn;var Xn="ContextMenuSubTrigger",Jn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Gt,{...c,...a,ref:e})});Jn.displayName=Xn;var Yn="ContextMenuSubContent",Zn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Kt,{...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)"}})});Zn.displayName=Yn;function xe(s){return e=>e.pointerType!=="mouse"?s(e):void 0}var er=He,tr=Je,nr=Ye,rr=et,or=tt,ir=nt;function sr(s){const e=Z.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(er,{"data-slot":"context-menu",...i}),e[2]=i,e[3]=a):a=e[3],a}function ar(s){const e=Z.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(tr,{"data-slot":"context-menu-trigger",...i}),e[2]=i,e[3]=a):a=e[3],a}function lr(s){const e=Z.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=ae("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 m;return e[5]!==a||e[6]!==c?(m=r.jsx(nr,{children:r.jsx(rr,{"data-slot":"context-menu-content",className:c,...a})}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}function te(s){const e=Z.c(12);let i,a,c,m;e[0]!==s?({className:i,inset:a,variant:m,...c}=s,e[0]=s,e[1]=i,e[2]=a,e[3]=c,e[4]=m):(i=e[1],a=e[2],c=e[3],m=e[4]);const x=m===void 0?"default":m;let p;e[5]!==i?(p=ae("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 g;return e[7]!==a||e[8]!==c||e[9]!==p||e[10]!==x?(g=r.jsx(or,{"data-slot":"context-menu-item","data-inset":a,"data-variant":x,className:p,...c}),e[7]=a,e[8]=c,e[9]=p,e[10]=x,e[11]=g):g=e[11],g}function Ve(s){const e=Z.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=ae("bg-border -mx-1 my-1 h-px",i),e[3]=i,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(ir,{"data-slot":"context-menu-separator",className:c,...a}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}const cr="#d9a441";function dr(s){const e=Z.c(45),{node:i,depth:a,isExpanded:c,isSelected:m,isLoading:x,fileVisual:p,onOpen:g,onSelect:M,onNewFile:d,onNewFolder:h,onCopyPath:y,onCopyRelativePath:B,onRename:V,onDelete:C}=s,I=x===void 0?!1:x,H=i.kind==="directory",{Icon:q,color:Q}=p,$=m&&"bg-accent";let O;e[0]!==$?(O=ae("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",$),e[0]=$,e[1]=O):O=e[1];const G=`${a*14+8}px`;let T;e[2]!==G?(T={paddingLeft:G},e[2]=G,e[3]=T):T=e[3];let A;e[4]!==g||e[5]!==M?(A=()=>{M(),g()},e[4]=g,e[5]=M,e[6]=A):A=e[6];let R;e[7]!==q||e[8]!==Q||e[9]!==H||e[10]!==c||e[11]!==I?(R=H?r.jsxs(r.Fragment,{children:[I?r.jsx(se,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):c?r.jsx(vn,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(yn,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(Cn,{size:16,className:"shrink-0",style:{color:cr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(q,{size:16,className:"shrink-0",style:{color:Q}})]}),e[7]=q,e[8]=Q,e[9]=H,e[10]=c,e[11]=I,e[12]=R):R=e[12];let P;e[13]!==i.name?(P=r.jsx("span",{className:"truncate",children:i.name}),e[13]=i.name,e[14]=P):P=e[14];let j;e[15]!==O||e[16]!==T||e[17]!==A||e[18]!==R||e[19]!==P?(j=r.jsx(ar,{asChild:!0,children:r.jsxs("button",{type:"button",className:O,style:T,onClick:A,children:[R,P]})}),e[15]=O,e[16]=T,e[17]=A,e[18]=R,e[19]=P,e[20]=j):j=e[20];let N;e[21]!==d?(N=r.jsx(te,{onSelect:d,children:"New File"}),e[21]=d,e[22]=N):N=e[22];let E;e[23]!==h?(E=r.jsx(te,{onSelect:h,children:"New Folder"}),e[23]=h,e[24]=E):E=e[24];let k;e[25]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Ve,{}),e[25]=k):k=e[25];let w;e[26]!==y?(w=r.jsx(te,{onSelect:y,children:"Copy Path"}),e[26]=y,e[27]=w):w=e[27];let L;e[28]!==B?(L=r.jsx(te,{onSelect:B,children:"Copy Relative Path"}),e[28]=B,e[29]=L):L=e[29];let b;e[30]===Symbol.for("react.memo_cache_sentinel")?(b=r.jsx(Ve,{}),e[30]=b):b=e[30];let S;e[31]!==V?(S=r.jsx(te,{onSelect:V,children:"Rename"}),e[31]=V,e[32]=S):S=e[32];let z;e[33]!==C?(z=r.jsx(te,{variant:"destructive",onSelect:C,children:"Delete"}),e[33]=C,e[34]=z):z=e[34];let _;e[35]!==N||e[36]!==E||e[37]!==w||e[38]!==L||e[39]!==S||e[40]!==z?(_=r.jsxs(lr,{className:"w-52",children:[N,E,k,w,L,b,S,z]}),e[35]=N,e[36]=E,e[37]=w,e[38]=L,e[39]=S,e[40]=z,e[41]=_):_=e[41];let K;return e[42]!==_||e[43]!==j?(K=r.jsxs(sr,{children:[j,_]}),e[42]=_,e[43]=j,e[44]=K):K=e[44],K}Vt.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function Se(s,e,i,a){return`/api/${s}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(i)}/${a}`}function ur(s){const e=U(s);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const fr="#94a3b8";function mr(s){const e=s.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ue,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ue,color:"#d9a441"}:e.endsWith(".json")?{Icon:Xt,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ue,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ue,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:Jt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:_e,color:"#64748b"}:{Icon:_e,color:fr}}function ss({orgSlug:s,virtualMcpId:e,branch:i,openPath:a}){const[c,m]=u.useState({files:[],directories:[],truncated:!1}),{files:x,directories:p}=c,[g,M]=u.useState(new Set),[d,h]=u.useState(null),[y,B]=u.useState(null),[V,C]=u.useState([]),[I,H]=u.useState(""),[q,Q]=u.useState(!1),[$,O]=u.useState(!1),[,G]=u.useState(new Set),[T,A]=u.useState(new Set),R=u.useRef(0),P=u.useRef(null),j=u.useRef(new Set),N=u.useRef(new Map);function E(t){G(n=>{const o=typeof t=="function"?t(n):t;return j.current=o,o})}const[k,w]=u.useState(new Map),L=u.useRef(null),[b,S]=u.useState(null),{sendMessage:z}=cn(),{openSidePanel:_}=dn(),K=Bt(),[D,X]=u.useState(null),[J,ge]=u.useState(null),[ne,le]=u.useState(!1);async function re(t,n){const o=await fetch(Se(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 ce(){K.invalidateQueries({queryKey:Ke(s,e,i)})}function De(t,n){navigator.clipboard.writeText(n).then(()=>W.success(`${t} copied`),()=>W.error(`Failed to copy ${t.toLowerCase()}`))}function rt(t){const n=Dn(t);if(!n)return;const o=`${s}/${e}/${i}`;K.setQueryData($e.decofile(o),l=>{if(!l)return l;const{[n]:f,...v}=l;return v}),K.invalidateQueries({queryKey:$e.liveMeta(o)})}function ot(t){const n=t.kind==="file"?[t.path]:x.filter(o=>o.startsWith(".deco/blocks/")).map(o=>me(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)rt(o)}function it(t){const n=me(t);return V.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const l=k.get(o);return!!(l?.loaded&&l.editorValue!==l.savedContent)})}function Re(t){C(n=>n.map(o=>t(o)).filter(o=>o!==null)),h(n=>n&&t(n)),w(n=>{const o=new Map;for(const[l,f]of n){const v=t(l);v&&o.set(v,f)}return o}),B(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 st(t){const n=me(t);B(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Re(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function at(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);await re("write",{path:U(n),content:""}),await oe(),await ce(),X(null),ve(n)}async function lt(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);const o=U(n);await re("mkdir",{path:o}),m(l=>({...l,directories:l.directories.includes(o)?l.directories:[...l.directories,o]})),await oe(),await ce(),X(null),M(l=>{const f=new Set(l);for(const v of Ce(n))f.add(v);return f.add(n),f}),B({name:t,path:n,kind:"directory",children:[]})}async function ct(t){if(!D)return;const n=D.node.path,o=je(n),l=pe(o,t);if(l===n){X(null);return}if(Ne(l,x,p))throw new Error(`"${t}" already exists`);await re("rename",{from:U(n),to:U(l)}),Re(f=>f===n?l:f.startsWith(`${n}/`)?pe(l,f.slice(n.length+1)):f),await oe(),await ce(),X(null)}async function dt(t){le(!0);try{await re("unlink",{path:U(t.path),recursive:t.kind==="directory"}),ot(t),st(t.path),await oe(),await ce(),ge(null),W.success(`Deleted "${t.name}"`)}catch(n){W.error(n instanceof Error?n.message:"Delete failed")}finally{le(!1)}}async function ut(t){const n=Mn(t);if(n){W.error(n);return}le(!0);try{D?.mode==="new-file"?(await at(t),W.success(`Created "${t}"`)):D?.mode==="new-folder"?(await lt(t),W.success(`Created folder "${t}"`)):D?.mode==="rename"&&(await ct(t),W.success(`Renamed to "${t}"`))}catch(o){W.error(o instanceof Error?o.message:"Operation failed")}finally{le(!1)}}const Pe=u.useRef(!1);Pe.current||(Pe.current=!0,P.current=oe());const[ft,mt]=u.useState(null);if(a&&a!==ft){mt(a);const t=a;queueMicrotask(()=>{ur(t)&&ve(t).catch(n=>{W.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ee(t){const n=await re("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function ke(t,n,o){if(o!==R.current)return!1;let l=!1;return m(f=>{const v=n?Rn(f.files,f.directories,t,f.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return l=!!v.truncated,{files:v.files,directories:v.directories,truncated:l}}),l&&W.warning("File list truncated — some files may be hidden"),l}async function pt(t){const n=N.current.get(t);if(n)return n;const o=R.current,l=(async()=>{const f=await Ee({pattern:"**/*",path:U(t),limit:Ue}),v=ke(f,!0,o);return!v&&o===R.current&&E(Y=>{const de=new Set(Y);return de.add(t),de}),v})();N.current.set(t,l);try{return await l}finally{N.current.delete(t)}}async function Oe(t){if(!be(t,j.current))return!1;A(n=>new Set(n).add(t));try{return await pt(t)}finally{A(n=>{const o=new Set(n);return o.delete(t),o})}}async function xt(t){const n=new Set(j.current);for(const o of Ce(t)){if(!be(o,n))continue;if(await Oe(o))throw new Error("Folder listing truncated — expand again to load more");n.add(o)}}async function oe(){const t=++R.current;N.current.clear(),Q(!0),E(new Set),M(new Set),A(new Set);try{const n=await Ee({pattern:"**/*",limit:Ue,maxDepth:wn});ke(n,!1,t),O(!0)}catch{$&&W.error("Failed to refresh file tree")}finally{Q(!1)}}async function Te(t){if(!k.get(t)?.loaded){w(o=>{const l=new Map(o);return l.set(t,{savedContent:"",editorValue:"",loaded:!1}),l});try{const o=await fetch(Se(s,e,i,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:U(t),full:!0})});if(!o.ok)return;const l=await o.json(),f=Sn(l.content??"");w(v=>{const Y=new Map(v);return Y.set(t,{savedContent:f,editorValue:f,loaded:!0}),Y})}catch{}}}async function ht(t,n){try{const o=await fetch(Se(s,e,i,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:U(t),content:n})});if(!o.ok){fe("file save failed",{path:t,status:o.status});return}fe("file saved via sandbox /write",{path:t}),K.invalidateQueries({queryKey:Ke(s,e,i)});try{const l=await un(s,e,i);fe("git status after save",l)}catch(l){fe("git status after save failed",{path:t,error:l instanceof Error?l.message:String(l)})}w(l=>{const f=new Map(l),v=f.get(t);return v&&f.set(t,{...v,savedContent:n}),f})}catch{}}function gt(t){h(t),B({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),S(null),V.includes(t)||C(n=>[...n,t]),Te(t)}function vt(t){C(n=>{const o=n.filter(l=>l!==t);return d===t&&h(o[o.length-1]??null),o}),w(n=>{const o=new Map(n);return o.delete(t),o})}function Ae(t){M(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function yt(t){if(be(t,j.current))try{if(await Oe(t))return}catch(n){W.error(n instanceof Error?n.message:"Failed to load folder");return}Ae(t)}async function Ct(t,n){if(n){Ae(t);return}await yt(t)}async function ve(t){await P.current,await xt(t);const n=Ce(t);M(o=>{const l=new Set(o);for(const f of n)l.add(f);return l}),gt(t)}function wt(){return y?.kind==="directory"?y.path:y?.kind==="file"?je(y.path):d?je(d):"/"}function Le(t){const n=wt();X({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const bt=bn(x,p),Fe=jn(bt,g),Ie=I?Fe.filter(t=>t.node.name.toLowerCase().includes(I.toLowerCase())):Fe,ee=d?k.get(d):null,jt=ee?.loaded&&ee.editorValue!==ee.savedContent,ye=J?it(J.path):[],Nt=(t,n)=>{L.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await ht(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),l=t.getModel();if(!o||!l||!d)return;const f=l.getValueInRange(o);S({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:f})})};function St(t){if(!b)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${b.filePath}\``,`**Lines:** ${b.lineStart}–${b.lineEnd}`];if(b.selectedCode){const o=we(b.filePath),l=b.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,l,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),_("chat"),z({parts:[{type:"text",text:n.join(`
2
- `)}]}),S(null)}return q&&!$?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(se,{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(qt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",value:I,onChange:t=>H(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(ze,{children:[r.jsx(We,{asChild:!0,children:r.jsx(he,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New file",onClick:()=>Le("new-file"),children:r.jsx(Qt,{size:14})})}),r.jsx(Ge,{side:"bottom",children:"New file"})]}),r.jsxs(ze,{children:[r.jsx(We,{asChild:!0,children:r.jsx(he,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New folder",onClick:()=>Le("new-folder"),children:r.jsx(Ht,{size:14})})}),r.jsx(Ge,{side:"bottom",children:"New folder"})]})]}),r.jsx(Zt,{className:"flex-1",children:r.jsxs("div",{className:"py-1",children:[Ie.map(t=>{const{node:n,depth:o}=t,l=n.kind==="directory",f=g.has(n.path),v=y?.path===n.path,Y=Nn(n.path,n.kind),de=l&&T.has(n.path);return r.jsx(dr,{node:n,depth:o,isExpanded:f,isSelected:v,isLoading:de,fileVisual:mr(n.name),onSelect:()=>B(n),onOpen:()=>{l?Ct(n.path,f):ve(n.path)},onNewFile:()=>X({mode:"new-file",node:n,parentDir:Y}),onNewFolder:()=>X({mode:"new-folder",node:n,parentDir:Y}),onCopyPath:()=>De("Path",me(n.path)),onCopyRelativePath:()=>De("Relative path",U(n.path)),onRename:()=>X({mode:"rename",node:n,parentDir:Y}),onDelete:()=>ge(n)},n.path)}),$&&Ie.length===0&&r.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:I?`No files match "${I}"`:"No files found"})]})})]}),r.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[V.length>0&&r.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:V.map(t=>{const n=k.get(t),o=n?.loaded&&n.editorValue!==n.savedContent,l=d===t,f=t.split("/").pop()??t;return r.jsxs("div",{className:ae("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:()=>{h(t),Te(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":l,children:[r.jsx("span",{className:"truncate max-w-32",children:f}),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:v=>{v.stopPropagation(),vt(t)},children:r.jsx(Yt,{size:12})})]},t)})}),b&&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()&&St(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"&&S(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&&ee?.loaded?r.jsx(Ut,{language:we(d),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:ee.editorValue,path:d,onChange:t=>{const n=d;n&&w(o=>{const l=new Map(o),f=l.get(n);return f&&l.set(n,{...f,editorValue:t??""}),l})},onMount:Nt,loading:r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(se,{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&&!ee?.loaded?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(se,{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:[jt?"Modified":"Saved"," ·"," ",we(d)]})]})]}),r.jsx(En,{open:D!==null,mode:D?.mode??"new-file",initialName:D?.mode==="rename"?D.node.name:"",parentLabel:D&&D.mode!=="rename"?D.parentDir==="/"?"/":U(D.parentDir):void 0,isPending:ne,onSubmit:ut,onOpenChange:t=>{!t&&!ne&&X(null)}}),r.jsx(en,{open:J!==null,onOpenChange:t=>{!t&&!ne&&ge(null)},children:r.jsxs(tn,{children:[r.jsxs(nn,{children:[r.jsxs(rn,{children:["Delete ",J?.kind==="directory"?"folder":"file","?"]}),r.jsxs(on,{children:["This will permanently delete"," ",r.jsx("span",{className:"font-mono",children:J?.name}),J?.kind==="directory"?" and everything inside it.":".",ye.length>0&&r.jsxs(r.Fragment,{children:[" ",ye.length===1?"One open file has unsaved changes that will be lost.":`${ye.length} open files have unsaved changes that will be lost.`]})]})]}),r.jsxs(sn,{children:[r.jsx(an,{disabled:ne,children:"Cancel"}),r.jsx(ln,{disabled:ne||!J,onClick:t=>{t.preventDefault(),J&&dt(J)},children:"Delete"})]})]})})]})}export{ss as FileExplorer};
@@ -1 +0,0 @@
1
- const o={contents:"write",metadata:"read",pull_requests:"write",issues:"write"};function i(e){if(!e||typeof e!="object"||Array.isArray(e))return o;const t=e;return Object.values(t).some(n=>typeof n!="string")?o:t}function s(e){if(!(typeof e!="number"||!Number.isFinite(e)||!Number.isInteger(e)||e<=0))return e}function a(e){const t=e.metadata?.repoScope;if(!t||typeof t.installationId!="number"||!Number.isFinite(t.installationId)||!Number.isInteger(t.installationId)||t.installationId<=0||typeof t.owner!="string"||typeof t.repo!="string"||t.owner.length===0||t.repo.length===0)return null;const n=s(t.repositoryId);return{sourceConnectionId:typeof t.sourceConnectionId=="string"?t.sourceConnectionId:void 0,installationId:t.installationId,repositoryId:n,owner:t.owner,repo:t.repo,permissions:i(t.permissions),grantProvider:t.grantProvider==="github-mcp"?"github-mcp":void 0}}function u(e){return(e??[]).filter(t=>a(t)===null)}async function c(e,t){const r=(await e({name:"GITHUB_LIST_USER_ORGS",arguments:{connectionId:t}})).content?.[0]?.text;if(!r)throw new Error("No response from GITHUB_LIST_USER_ORGS");try{return JSON.parse(r)}catch{throw new Error("Invalid response from GITHUB_LIST_USER_ORGS")}}function l(e,t){const n=t.toLowerCase();return e.find(r=>r.login.toLowerCase()===n)}export{o as G,a,l as b,c as f,u as g};
@@ -1 +0,0 @@
1
- import{c as R,j as t,C as U,a as Z,n as B,r as T,am as $,i as L,d as K,t as F,dH as ee,K as P,m as te,B as ne,l as D,v as se,w as oe}from"./index-lRedQ_8t.js";import{D as re,a as ie,d as le,e as ae}from"./dialog-CUb_uQeJ.js";import{C as ce}from"./collection-search-MTrnV0Y_.js";import{u as ue}from"./use-debounced-value-DxBZ974h.js";import{b as J,u as de}from"./use-connection-DmUK9JRy.js";import{u as H}from"./use-mcp-client-D6H50Mmm.js";import{W as me,S as Y}from"./constants-D_FQAPnt.js";import{a as W}from"./authenticate-and-persist-oauth-DeTua2ma.js";import{b as X}from"./Settings02-1LTNhTXj.js";import{J as fe}from"./agent-icon-5pSyq_FH.js";import{u as xe}from"./use-mcp-tools-Cs2tX1fK.js";import{e as pe}from"./extract-connection-data-BIadZZgr.js";import{c as ge}from"./use-navigate-to-agent-DYPKcx_j.js";import{G as q,g as he,f as ye}from"./github-installations-ChFezl8I.js";function G(i){const e=R.c(4),{size:n,className:r}=i;let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=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]=f):f=e[0];let l;return e[1]!==r||e[2]!==n?(l=t.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:r,children:f}),e[1]=r,e[2]=n,e[3]=l):l=e[3],l}function be(i,e){const n=R.c(12),{org:r}=U();let f;n[0]!==r.id?(f=me.REGISTRY(r.id),n[0]=r.id,n[1]=f):f=n[1];const l=f;let o;n[2]!==r.id||n[3]!==r.slug||n[4]!==l?(o={connectionId:l,orgId:r.id,orgSlug:r.slug},n[2]=r.id,n[3]=r.slug,n[4]=l,n[5]=o):o=n[5];const N=H(o);let x;n[6]!==i?(x={name:i},n[6]=i,n[7]=x):x=n[7];const y=e?.enabled??!0;let a;return n[8]!==N||n[9]!==x||n[10]!==y?(a={client:N,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:x,enabled:y,staleTime:3e5,select:Ne},n[8]=N,n[9]=x,n[10]=y,n[11]=a):a=n[11],xe(a)}function Ne(i){return i.structuredContent?.item??null}const je="deco/mcp-github";function we(i){const{org:e}=U(),{data:n}=Z.useSession(),r=J(),f=B(),[l,o]=T.useState("idle"),[N,x]=T.useState(null),[y,a]=T.useState(null),{data:j,isLoading:u}=be(je,{enabled:i.enabled}),c=T.useRef(!1);i.enabled&&j&&!u&&!c.current&&n?.user?.id&&l==="idle"&&(c.current=!0,m());async function m(){if(!(!j||!n?.user?.id||!e))try{o("installing"),x(null);const d=pe(j,e.id,n.user.id,{remoteIndex:0});if(!d.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:w}=await r.create.mutateAsync(d);o("authenticating");const b=await W({connectionId:w,orgId:e.id,orgSlug:e.slug,persistFallback:s=>r.update.mutateAsync({id:w,data:{connection_token:s}}).then(()=>{})});if(b.ran&&!b.ok){try{await r.delete.mutateAsync(w)}catch{}throw new Error(b.error&&b.error!=="no token received"?b.error:"No token received from GitHub")}$(f,e.id),a(d),o("ready")}catch(d){x(d instanceof Error?d.message:String(d)),o("error")}}function p(){o("idle"),x(null),a(null),c.current=!1}return i.enabled&&u&&l==="idle"?{status:"installing",error:null,connection:null,retry:p}:{status:l,error:N,connection:y,retry:p}}const Q="GitHub MCP did not return refreshable repo grant metadata";function O(i){if(typeof i!="string")return null;const e=i.trim();return e.length>0?e:null}function Ce(i){try{const e=new URL(i);return(e.protocol==="http:"||e.protocol==="https:")&&!e.username&&!e.password}catch{return!1}}function Ie(i){return typeof i=="number"&&Number.isFinite(i)&&Number.isInteger(i)&&i>0?i:void 0}async function V(i){const{orgSlug:e,sourceConnection:n,installationId:r,owner:f,repo:l,githubCallTool:o,selfCallTool:N,orgShared:x}=i,y=await o({name:"MINT_REPO_TOKEN",arguments:{installationId:r,owner:f,repo:l,permissions:q}}),a=y.structuredContent;if(y.isError||!a?.token){const h=y.content?.find(_=>_.type==="text")?.text;throw new Error(h?`Failed to mint a repo-scoped GitHub token: ${h}`:"Failed to mint a repo-scoped GitHub token")}const j=O(a.refreshToken),u=O(a.tokenEndpoint),c=O(a.clientId);if(!j||!u||!c)throw new Error(Q);if(!Ce(u))throw new Error(Q);const m=O(a.repository?.owner),p=O(a.repository?.name),d="GitHub MCP returned refresh metadata for a different repository";if(a.repository?.owner!==void 0&&(!m||m.toLowerCase()!==f.toLowerCase()))throw new Error(d);if(a.repository?.name!==void 0&&(!p||p.toLowerCase()!==l.toLowerCase()))throw new Error(d);const g=Ie(a.repository?.id),w=a.expiresAt?Date.parse(a.expiresAt):NaN,b=Number.isFinite(w)?Math.max(0,Math.floor((w-Date.now())/1e3)):null,C=(typeof a.expiresIn=="number"&&Number.isFinite(a.expiresIn)&&Number.isInteger(a.expiresIn)&&a.expiresIn>0?a.expiresIn:null)??b,S=await N({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:{title:`GitHub: ${f}/${l}`,description:`Repo-scoped GitHub access for ${f}/${l}`,icon:n.icon,app_name:n.app_name,app_id:n.app_id,connection_type:n.connection_type,connection_url:n.connection_url,metadata:{...x?{orgShared:!0}:{},repoScope:{installationId:r,repositoryId:g,owner:f,repo:l,permissions:q,grantProvider:"github-mcp"}}}}}),v=S.structuredContent??S,I=v.item?.id??v.id;if(!I)throw new Error("Failed to create the repo-scoped GitHub connection");if(!(await fetch(`/api/${e}/connections/${I}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:a.token,refreshToken:j,expiresIn:C,scope:a.scope??null,clientId:c,tokenEndpoint:u})})).ok)throw await N({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:I,force:!0}}).catch(()=>{}),new Error("Failed to persist the repo-scoped token");return{childConnectionId:I}}function Qe(i){const e=R.c(22),{open:n,onOpenChange:r,title:f,onImportComplete:l,mode:o}=i,N=o===void 0?"agent":o,x=f??(N==="connection"?"Add repo":"Import from GitHub"),[y,a]=T.useState(null);let j;e[0]!==x?(j=t.jsx(re,{className:"sr-only",children:t.jsx(ie,{children:x})}),e[0]=x,e[1]=j):j=e[1];let u;e[2]!==x||e[3]!==y?(u=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:y?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>a(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(X,{size:16})}),t.jsx("img",{src:y.avatarUrl,alt:y.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:y.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:x})]})}),e[2]=x,e[3]=y,e[4]=u):u=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(L,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=c):c=e[5];let m;e[6]!==r?(m=()=>r(!1),e[6]=r,e[7]=m):m=e[7];let p;e[8]!==N||e[9]!==l||e[10]!==n||e[11]!==y||e[12]!==m?(p=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(T.Suspense,{fallback:c,children:t.jsx(Se,{open:n,onComplete:m,selectedInstallation:y,onSelectInstallation:a,onImportComplete:l,mode:N})})}),e[8]=N,e[9]=l,e[10]=n,e[11]=y,e[12]=m,e[13]=p):p=e[13];let d;e[14]!==j||e[15]!==u||e[16]!==p?(d=t.jsxs(le,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[j,u,p]}),e[14]=j,e[15]=u,e[16]=p,e[17]=d):d=e[17];let g;return e[18]!==r||e[19]!==n||e[20]!==d?(g=t.jsx(ae,{open:n,onOpenChange:r,children:d}),e[18]=r,e[19]=n,e[20]=d,e[21]=g):g=e[21],g}function Se({open:i,onComplete:e,selectedInstallation:n,onSelectInstallation:r,onImportComplete:f,mode:l="agent"}){const{org:o}=U(),N=B(),x=ge(),[y,a]=T.useState(null),j=de({slug:"mcp-github"}),u=he(j),c=we({enabled:i&&u.length===0}),m=u.length===1?u[0]??null:y,p=H({connectionId:m?.id??"",orgId:o.id,orgSlug:o.slug}),d=H({connectionId:Y,orgId:o.id,orgSlug:o.slug}),g=async(s,C)=>{try{const v=await p.callTool({name:"get_file_contents",arguments:{owner:s.owner,repo:s.name,path:C}});if(v.isError)return null;const E=v.content?.find(h=>h.type==="resource")?.resource?.text;if(!E)return null;try{const h=JSON.parse(E);return typeof h=="string"?h:JSON.stringify(h)}catch{return E}}catch{return null}},w=(s,C)=>{Promise.all([g(C,"AGENTS.md"),g(C,"CLAUDE.md")]).then(async([S,v])=>{const I=S??v??null;I&&(await d.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:s,data:{metadata:{instructions:I}}}}),$(N,o.id))}).catch(S=>{console.error("GitHub instructions fetch failed:",S)})},b=K({mutationFn:async s=>{if(!m||!n)throw new Error("No GitHub connection or installation");const C=n.installationId;if(l==="connection"){const{childConnectionId:I}=await V({orgSlug:o.slug,sourceConnection:m,installationId:C,owner:s.owner,repo:s.name,githubCallTool:E=>p.callTool(E),selfCallTool:E=>d.callTool(E),orgShared:!0});return{virtualMcpId:null,repo:s,connectionId:I,item:null}}const{childConnectionId:S}=await V({orgSlug:o.slug,sourceConnection:m,installationId:C,owner:s.owner,repo:s.name,githubCallTool:I=>p.callTool(I),selfCallTool:I=>d.callTool(I)});let v=null;try{const I=await d.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:C,connectionId:S},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:S}]}}}),E=I.structuredContent??I,h=E.item?.id;if(!E.item||!h)throw new Error("Failed to create the imported agent");return v=h,{virtualMcpId:h,repo:s,connectionId:S,item:E.item}}catch(I){throw v&&await d.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:v}}).catch(()=>{}),await d.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:S,force:!0}}).catch(()=>{}),I}},onSuccess:({virtualMcpId:s,repo:C,connectionId:S,item:v})=>{if(l==="connection"||!s||!v){$(N,o.id),ee(N,o.id),F.success(`Added ${C.name}`),e();return}if(N.setQueryData(P.collectionItem(d,o.id,"","VIRTUAL_MCP",s),{item:v}),$(N,o.id),w(s,C),f){f({virtualMcpId:s,repo:C,connectionId:S});return}F.success(`Imported ${C.name} from GitHub`),e(),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),x(s)},onError:s=>{F.error("Failed to import repo: "+(s instanceof Error?s.message:"Unknown error"))}});return c.status==="installing"||c.status==="authenticating"?t.jsx(M,{status:c.status,error:null,retry:c.retry}):c.status==="error"?t.jsx(M,{status:"error",error:c.error,retry:c.retry}):u.length===0&&c.status==="idle"?t.jsx(M,{status:"installing",error:null,retry:c.retry}):u.length>1&&!m?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:()=>a(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))]}):m?n?t.jsx(Te,{connectionId:m.id,orgId:o.id,orgSlug:o.slug,installation:n,onSelectRepo:s=>b.mutate(s),isSaving:b.isPending}):t.jsx(ve,{connectionId:m.id,orgId:o.id,orgSlug:o.slug,onSelect:r,showBackButton:u.length>1,onBack:()=>a(null)}):null}function ve(i){const e=R.c(47),{connectionId:n,orgId:r,orgSlug:f,onSelect:l,showBackButton:o,onBack:N}=i;let x;e[0]!==r||e[1]!==f?(x={connectionId:Y,orgId:r,orgSlug:f},e[0]=r,e[1]=f,e[2]=x):x=e[2];const y=H(x),a=B(),j=J();let u;e[3]!==n||e[4]!==r?(u=P.githubUserOrgs(r,n),e[3]=n,e[4]=r,e[5]=u):u=e[5];let c;e[6]!==n||e[7]!==y?(c=()=>ye(h=>y.callTool(h),n),e[6]=n,e[7]=y,e[8]=c):c=e[8];let m;e[9]!==u||e[10]!==c?(m={queryKey:u,queryFn:c},e[9]=u,e[10]=c,e[11]=m):m=e[11];const p=te(m);let d;e[12]!==j||e[13]!==n||e[14]!==p||e[15]!==r||e[16]!==f||e[17]!==a?(d={mutationFn:async()=>{const h=await W({connectionId:n,orgId:r,orgSlug:f,persistFallback:k=>j.update.mutateAsync({id:n,data:{connection_token:k}}).then(_e)});if(h.ran&&!h.ok)throw new Error(h.error??"no token received");const _=new URL(`/api/${f}/mcp/${n}`,window.location.origin);await a.invalidateQueries({queryKey:P.isMCPAuthenticated(_.href,null)}),await a.invalidateQueries({queryKey:P.mcpClientPrefix()}),await p.refetch()},onError:Ee},e[12]=j,e[13]=n,e[14]=p,e[15]=r,e[16]=f,e[17]=a,e[18]=d):d=e[18];const g=K(d);if(p.isLoading){let h;return e[19]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(L,{size:18,className:"animate-spin text-muted-foreground"})}),e[19]=h):h=e[19],h}if(p.isError){let h,_;e[20]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load GitHub accounts"}),_=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]=h,e[21]=_):(h=e[20],_=e[21]);let k;e[22]!==g?(k=()=>g.mutate(),e[22]=g,e[23]=k):k=e[23];let A;e[24]!==g.isPending?(A=g.isPending?t.jsx(L,{size:14,className:"animate-spin"}):t.jsx(G,{className:"size-3.5"}),e[24]=g.isPending,e[25]=A):A=e[25];let z;return e[26]!==g.isPending||e[27]!==k||e[28]!==A?(z=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 text-center",children:[h,_,t.jsxs(ne,{type:"button",variant:"outline",size:"sm",onClick:k,disabled:g.isPending,children:[A,"Reconnect GitHub"]})]}),e[26]=g.isPending,e[27]=k,e[28]=A,e[29]=z):z=e[29],z}const w=p.data;if(!w)return null;let b;e[30]!==N||e[31]!==o?(b=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:N,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(X,{size:12}),"Change connection"]})}),e[30]=N,e[31]=o,e[32]=b):b=e[32];let s;if(e[33]!==w.installations||e[34]!==l){let h;e[36]!==l?(h=_=>t.jsxs("button",{type:"button",onClick:()=>l(_),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:_.avatarUrl,alt:_.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:_.login}),_.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 →"})]},_.installationId),e[36]=l,e[37]=h):h=e[37],s=w.installations.map(h),e[33]=w.installations,e[34]=l,e[35]=s}else s=e[35];let C;e[38]!==s?(C=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:s}),e[38]=s,e[39]=C):C=e[39];const S=w.appSlug?`https://github.com/apps/${w.appSlug}/installations/new`:"https://github.com/settings/installations";let v;e[40]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("span",{className:"underline underline-offset-2",children:"Install the GitHub App"}),e[40]=v):v=e[40];let I;e[41]!==S?(I=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?"," ",v]})}),e[41]=S,e[42]=I):I=e[42];let E;return e[43]!==I||e[44]!==b||e[45]!==C?(E=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[b,C,I]}),e[43]=I,e[44]=b,e[45]=C,e[46]=E):E=e[46],E}function Ee(i){F.error("Failed to reconnect GitHub: "+(i instanceof Error?i.message:"Unknown error"))}function _e(){}function Te(i){const e=R.c(20),{connectionId:n,orgId:r,orgSlug:f,installation:l,onSelectRepo:o,isSaving:N}=i,[x,y]=T.useState(""),a=ue(x,300),j=T.useDeferredValue(a),u=x!==j;let c;e[0]!==u||e[1]!==x?(c=t.jsx(ce,{placeholder:"Search repositories...",value:x,onChange:y,isSearching:u}),e[0]=u,e[1]=x,e[2]=c):c=e[2];const m=u?"opacity-40":"opacity-100";let p;e[3]!==m?(p=D("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",m),e[3]=m,e[4]=p):p=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(L,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=d):d=e[5];let g;e[6]!==n||e[7]!==j||e[8]!==l||e[9]!==N||e[10]!==o||e[11]!==r||e[12]!==f?(g=t.jsx(T.Suspense,{fallback:d,children:t.jsx(ke,{connectionId:n,orgId:r,orgSlug:f,installation:l,query:j,onSelectRepo:o,isSaving:N})}),e[6]=n,e[7]=j,e[8]=l,e[9]=N,e[10]=o,e[11]=r,e[12]=f,e[13]=g):g=e[13];let w;e[14]!==p||e[15]!==g?(w=t.jsx("div",{className:p,children:g}),e[14]=p,e[15]=g,e[16]=w):w=e[16];let b;return e[17]!==c||e[18]!==w?(b=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[c,w]}),e[17]=c,e[18]=w,e[19]=b):b=e[19],b}function ke(i){const e=R.c(29),{connectionId:n,orgId:r,orgSlug:f,installation:l,query:o,onSelectRepo:N,isSaving:x}=i;let y;e[0]!==n||e[1]!==r||e[2]!==f?(y={connectionId:n,orgId:r,orgSlug:f},e[0]=n,e[1]=r,e[2]=f,e[3]=y):y=e[3];const a=H(y),j=l.type==="User"?"user":"org",u=o?`${j}:${l.login} ${o} in:name`:`${j}:${l.login}`;let c;e[4]!==n||e[5]!==l.login||e[6]!==r||e[7]!==o?(c=P.githubOrgRepos(r,n,l.login,o),e[4]=n,e[5]=l.login,e[6]=r,e[7]=o,e[8]=c):c=e[8];let m;e[9]!==a||e[10]!==u?(m=async b=>{const{signal:s}=b,S=(await a.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(Re)},e[9]=a,e[10]=u,e[11]=m):m=e[11];let p;e[12]!==c||e[13]!==m?(p={queryKey:c,queryFn:m},e[12]=c,e[13]=m,e[14]=p):p=e[14];const{data:d}=se(p);if(d.length===0){let b;e[15]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("p",{className:"text-sm text-muted-foreground",children:"No repositories found"}),e[15]=b):b=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 C;return e[18]!==s?(C=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[b,s]}),e[18]=s,e[19]=C):C=e[19],C}let g;if(e[20]!==x||e[21]!==N||e[22]!==d){let b;e[24]!==x||e[25]!==N?(b=s=>t.jsxs("button",{type:"button",onClick:()=>N(s),disabled:x,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(oe,{size:10}):t.jsx(fe,{size:10}),s.private?"Private":"Public"]})]},s.fullName),e[24]=x,e[25]=N,e[26]=b):b=e[26],g=d.map(b),e[20]=x,e[21]=N,e[22]=d,e[23]=g}else g=e[23];let w;return e[27]!==g?(w=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:g}),e[27]=g,e[28]=w):w=e[28],w}function Re(i){return{name:i.name,fullName:i.full_name,owner:i.full_name.split("/")[0]??"",url:i.html_url,private:i.private,description:i.description,updatedAt:i.updated_at}}function M(i){const e=R.c(33),{status:n,error:r,retry:f}=i;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 v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("p",{className:"text-sm font-medium",children:"Connection failed"}),e[1]=v):v=e[1];const I=r??"Something went wrong while connecting to GitHub.";let E;e[2]!==I?(E=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[v,t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:I})]}),e[2]=I,e[3]=E):E=e[3];let h;e[4]!==f?(h=t.jsx("button",{type:"button",onClick:f,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]=f,e[5]=h):h=e[5];let _;return e[6]!==E||e[7]!==h?(_=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[S,E,h]}),e[6]=E,e[7]=h,e[8]=_):_=e[8],_}const l=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 N;e[10]===Symbol.for("react.memo_cache_sentinel")?(N=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(L,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[10]=N):N=e[10];const x=l?"Authenticating with GitHub":"Setting up GitHub";let y;e[11]!==x?(y=t.jsx("p",{className:"text-sm font-medium",children:x}),e[11]=x,e[12]=y):y=e[12];const a=l?"Complete the OAuth flow in your browser":"Installing the GitHub connection...";let j;e[13]!==a?(j=t.jsx("p",{className:"text-xs text-muted-foreground",children:a}),e[13]=a,e[14]=j):j=e[14];let u;e[15]!==y||e[16]!==j?(u=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[y,j]}),e[15]=y,e[16]=j,e[17]=u):u=e[17];const c=l?"bg-muted-foreground/30":"bg-foreground animate-pulse";let m;e[18]!==c?(m=D("size-1.5 rounded-full",c),e[18]=c,e[19]=m):m=e[19];let p;e[20]!==m?(p=t.jsx("span",{className:m}),e[20]=m,e[21]=p):p=e[21];const d=l?"bg-foreground animate-pulse":"bg-muted-foreground/30";let g;e[22]!==d?(g=D("size-1.5 rounded-full",d),e[22]=d,e[23]=g):g=e[23];let w;e[24]!==g?(w=t.jsx("span",{className:g}),e[24]=g,e[25]=w):w=e[25];let b;e[26]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[26]=b):b=e[26];let s;e[27]!==p||e[28]!==w?(s=t.jsxs("div",{className:"flex items-center gap-1.5",children:[p,w,b]}),e[27]=p,e[28]=w,e[29]=s):s=e[29];let C;return e[30]!==s||e[31]!==u?(C=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[N,u,s]}),e[30]=s,e[31]=u,e[32]=C):C=e[32],C}export{Qe as G,G as a,we as b,V as p,be as u};