decocms 2.186.8 → 2.186.9

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 (206) hide show
  1. package/dist/client/assets/{AlertCircle-BD5gSXQu.js → AlertCircle-DoDnREQU.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-DN3D0Zrv.js → ArrowLeft-1uQ4hoAA.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-D6ltkV3R.js → ArrowUp-CiCCsmLU.js} +1 -1
  4. package/dist/client/assets/{Check-Dczm9Dfw.js → Check-DsqqbwRv.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-CDxBhn_l.js → ChevronDown-DMIUCeXF.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-Dxvchjxo.js → ChevronRight-BvErZvXV.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-BLNd6dNq.js → ChevronUp-BPTkFtVQ.js} +1 -1
  8. package/dist/client/assets/{Container-CMPDG7Cp.js → Container-D8gJR-V9.js} +1 -1
  9. package/dist/client/assets/{Dataflow03-slF1Ax9G.js → Dataflow03-D9B0IMv1.js} +1 -1
  10. package/dist/client/assets/{FolderClosed-BKB_NgWm.js → FolderClosed-DtTyOuV-.js} +1 -1
  11. package/dist/client/assets/{Loading01-BVCg1O_G.js → Loading01-DTPGNGDe.js} +1 -1
  12. package/dist/client/assets/{Play-Bb4cvvVL.js → Play-BSN624z4.js} +1 -1
  13. package/dist/client/assets/{Plus-DcVtqCMV.js → Plus-VNSvGQN9.js} +1 -1
  14. package/dist/client/assets/{RefreshCcw01-Co0-i94o.js → RefreshCcw01-Dbe0-ztA.js} +1 -1
  15. package/dist/client/assets/{SearchMd-CVvF1HpM.js → SearchMd-BVguqJPF.js} +1 -1
  16. package/dist/client/assets/{Settings01-DpZ_tsoX.js → Settings01-BKawEeOc.js} +1 -1
  17. package/dist/client/assets/{Trash01-CBP9WLeP.js → Trash01-p_-P7rrZ.js} +1 -1
  18. package/dist/client/assets/{Type01-CySkENi6.js → Type01-D1knZTdC.js} +1 -1
  19. package/dist/client/assets/{Upload01-BzGPegBj.js → Upload01-D-cgBdXK.js} +1 -1
  20. package/dist/client/assets/{User01-CItwHvE1.js → User01-C1Py8RLi.js} +1 -1
  21. package/dist/client/assets/{X-Dr-hR03I.js → X-AnvD8fGN.js} +1 -1
  22. package/dist/client/assets/{XCircle-Z-JTmQ8v.js → XCircle-Of71XlDY.js} +1 -1
  23. package/dist/client/assets/{XClose-BLvk3pvY.js → XClose-CIHCEBuc.js} +1 -1
  24. package/dist/client/assets/{Zap-CiHJmamA.js → Zap-Cbf8Gxw3.js} +1 -1
  25. package/dist/client/assets/{agent-connections-preview-BQSZMPrI.js → agent-connections-preview-9beskZXW.js} +1 -1
  26. package/dist/client/assets/{agent-detail-eyC4qU2J.js → agent-detail-CpQCW--v.js} +1 -1
  27. package/dist/client/assets/{agents-DrhC84qH.js → agents-C4-J6TQS.js} +1 -1
  28. package/dist/client/assets/{ai-providers-logos-idzpcoUr.js → ai-providers-logos-Du8KzWpH.js} +1 -1
  29. package/dist/client/assets/{alert-dialog-Bke1xnyn.js → alert-dialog-BIZOEctM.js} +1 -1
  30. package/dist/client/assets/{auth-catchall-omtOF0fb.js → auth-catchall-BjYN1-n9.js} +1 -1
  31. package/dist/client/assets/{automation-detail-Bc9ASowB.js → automation-detail-Ca2mfThk.js} +1 -1
  32. package/dist/client/assets/{automations-Bp3tAuBH.js → automations-D_MLQzBu.js} +1 -1
  33. package/dist/client/assets/{avatar-BZ4Frci2.js → avatar-BDzYYIB_.js} +1 -1
  34. package/dist/client/assets/{badge-DGQ0gFlp.js → badge-CintUB2m.js} +1 -1
  35. package/dist/client/assets/{breadcrumb-BBMvtdg-.js → breadcrumb-CCT_gYCX.js} +1 -1
  36. package/dist/client/assets/{card-CKN-JP9M.js → card-DiqqquYR.js} +1 -1
  37. package/dist/client/assets/{checkbox-Dzy6oaRF.js → checkbox-B5yMaD1U.js} +1 -1
  38. package/dist/client/assets/{collapsible-D84K6rP8.js → collapsible-CUnNCwaM.js} +1 -1
  39. package/dist/client/assets/{collection-detail-w8yO-_Ye.js → collection-detail-DYyODume.js} +1 -1
  40. package/dist/client/assets/{collection-display-button-ZvHBt_eA.js → collection-display-button-6w4fqzbK.js} +1 -1
  41. package/dist/client/assets/{collection-search-fzGK39qM.js → collection-search-R3szwhKc.js} +1 -1
  42. package/dist/client/assets/{collection-table-wrapper-DsHGysPH.js → collection-table-wrapper-BYkH4l2b.js} +1 -1
  43. package/dist/client/assets/{collection-tabs-vUhndfXI.js → collection-tabs-CTpzw-QP.js} +1 -1
  44. package/dist/client/assets/{collections-BsFnKFn5.js → collections-Md0axhBZ.js} +1 -1
  45. package/dist/client/assets/{command-BnzawGxz.js → command-oqXofzFf.js} +1 -1
  46. package/dist/client/assets/{connection-card-D7msIZJv.js → connection-card-u3N2FMhV.js} +1 -1
  47. package/dist/client/assets/{connection-detail-D84CXhKZ.js → connection-detail-DkArP4xi.js} +1 -1
  48. package/dist/client/assets/{connections-CbWHLS_c.js → connections-DYEJw6-9.js} +1 -1
  49. package/dist/client/assets/constants-B4UGdbkn.js +1 -0
  50. package/dist/client/assets/{constants-TLV7MTwP.js → constants-Cf6w8uWj.js} +1 -1
  51. package/dist/client/assets/{context-BSzlpoxW.js → context-BNN0sjtQ.js} +1 -1
  52. package/dist/client/assets/{create-organization-dialog-OZCitfn2.js → create-organization-dialog-Dxw___Aq.js} +1 -1
  53. package/dist/client/assets/{create-project-dialog-RIITFpVV.js → create-project-dialog-Db-cXCFP.js} +1 -1
  54. package/dist/client/assets/{danger-DuoByYJO.js → danger-D0MixhKB.js} +1 -1
  55. package/dist/client/assets/{danger-zone-CEP2ON89.js → danger-zone-DJu8uIZo.js} +1 -1
  56. package/dist/client/assets/{dependencies-LZwXzbBO.js → dependencies-DKpj5-z2.js} +1 -1
  57. package/dist/client/assets/{dialog-DCrLu7TC.js → dialog-B_ZBKGcK.js} +1 -1
  58. package/dist/client/assets/{drawer-CwKj53Jm.js → drawer-DxTGqDKY.js} +1 -1
  59. package/dist/client/assets/{dropdown-menu-BK29e1o0.js → dropdown-menu-BGBf4SQr.js} +1 -1
  60. package/dist/client/assets/{dynamic-plugin-layout-C5CHlaVD.js → dynamic-plugin-layout-BwaaiDL6.js} +1 -1
  61. package/dist/client/assets/{editable-task-title-HEFeF21g.js → editable-task-title-mwJckul7.js} +1 -1
  62. package/dist/client/assets/{empty-state-B8NhLY9v.js → empty-state-5hCgVmoA.js} +1 -1
  63. package/dist/client/assets/{empty-state-D4ck9NGY.js → empty-state-Dt5CC_E7.js} +1 -1
  64. package/dist/client/assets/{env-vars-editor-CvqhjBEu.js → env-vars-editor-CSLx760Y.js} +1 -1
  65. package/dist/client/assets/{extract-connection-data-NSojo21r.js → extract-connection-data-BdJfym5q.js} +1 -1
  66. package/dist/client/assets/{form-DPsme8JL.js → form-BAfFoDTS.js} +1 -1
  67. package/dist/client/assets/{general-CPYyC5Rn.js → general-ihPcNIOb.js} +1 -1
  68. package/dist/client/assets/{home-Cg6y-M7X.js → home-BSU9U8m-.js} +1 -1
  69. package/dist/client/assets/{import-from-deco-dialog-CBUqBAZP.js → import-from-deco-dialog-CxiHwpr_.js} +1 -1
  70. package/dist/client/assets/{index-D_CXrtwd.js → index-ALdwmNA1.js} +1 -1
  71. package/dist/client/assets/{index-CoIN7QlF.js → index-BB9dnQ8g.js} +1 -1
  72. package/dist/client/assets/{index-Bgix03M4.js → index-BUla3j6g.js} +1 -1
  73. package/dist/client/assets/{index-2hR_U2H-.js → index-BclDkWx8.js} +1 -1
  74. package/dist/client/assets/{index-CtkIjbbq.js → index-BlVIyhiN.js} +1 -1
  75. package/dist/client/assets/{index-DxaXuxCe.js → index-CGKC8BVy.js} +1 -1
  76. package/dist/client/assets/{index-BkAoKVx8.js → index-CT7BYuwf.js} +1 -1
  77. package/dist/client/assets/{index-3WTtRDrt.js → index-D2soXfaG.js} +1 -1
  78. package/dist/client/assets/{index-BZyxukAe.js → index-DzY5efun.js} +1 -1
  79. package/dist/client/assets/{index-Dg9iIj2F.js → index-TzbVkru2.js} +1 -1
  80. package/dist/client/assets/{index-D49VqQ7Q.js → index-Y_g6-sbQ.js} +2 -2
  81. package/dist/client/assets/{infiniteQueryObserver-DiY9IZXI.js → infiniteQueryObserver-BvNG1QG_.js} +1 -1
  82. package/dist/client/assets/{input-BoNWsfmK.js → input-BJjZBSH8.js} +1 -1
  83. package/dist/client/assets/{integration-icon-ByIZ-Vgj.js → integration-icon-7Bz6GmNv.js} +1 -1
  84. package/dist/client/assets/{label-DF2jcg2U.js → label-BagqgWUv.js} +1 -1
  85. package/dist/client/assets/{layout-Dp8uiQPy.js → layout-BL6sB2DL.js} +1 -1
  86. package/dist/client/assets/{layout-CgN1mZAZ.js → layout-BPbh2R4B.js} +1 -1
  87. package/dist/client/assets/{login-EJWlcxg3.js → login-DfPhQ0qS.js} +1 -1
  88. package/dist/client/assets/{logo-upload-D5UEFEut.js → logo-upload-BlhGNrgV.js} +1 -1
  89. package/dist/client/assets/{mcp-app-renderer-C8wEMNqP.js → mcp-app-renderer-BSLoo8nT.js} +1 -1
  90. package/dist/client/assets/{mcp-server-card-xRGKpDYM.js → mcp-server-card-DV_BN-gm.js} +1 -1
  91. package/dist/client/assets/{mcp-server-detail-Dfcu5k0K.js → mcp-server-detail-CZ_j8X5E.js} +2 -2
  92. package/dist/client/assets/{members-b1hYnwix.js → members-2b6Jtq6P.js} +1 -1
  93. package/dist/client/assets/{monaco-editor-D1C0-UAW.js → monaco-editor-CzOYJf-q.js} +1 -1
  94. package/dist/client/assets/{monitoring-DmCgdBgZ.js → monitoring-B3bfHtHG.js} +1 -1
  95. package/dist/client/assets/{monitoring-dashboard-edit-DL4fVGYY.js → monitoring-dashboard-edit-BltMP3h3.js} +1 -1
  96. package/dist/client/assets/{monitoring-dashboard-view-BfDYcRJx.js → monitoring-dashboard-view-CwHqCHxn.js} +1 -1
  97. package/dist/client/assets/{monitoring-stats-row-Bzy3PCZQ.js → monitoring-stats-row-DdkGoKLi.js} +1 -1
  98. package/dist/client/assets/{oauth-callback-N1SniIFs.js → oauth-callback-Csht94Tu.js} +1 -1
  99. package/dist/client/assets/{oauth-callback-ai-provider-BZ8yDxr9.js → oauth-callback-ai-provider-4QVXXmM1.js} +1 -1
  100. package/dist/client/assets/{org-ai-providers-DFHn6TCP.js → org-ai-providers-Udjn3QRR.js} +1 -1
  101. package/dist/client/assets/{page-B721jXQm.js → page-Bu3owRsU.js} +1 -1
  102. package/dist/client/assets/{page-BgKYb-6_.js → page-CZ2WRv_I.js} +1 -1
  103. package/dist/client/assets/{plugin-empty-state-BIg-myPi.js → plugin-empty-state-2Yos5GOU.js} +1 -1
  104. package/dist/client/assets/{plugin-header-CBfXQAQ5.js → plugin-header-CqAMfljl.js} +1 -1
  105. package/dist/client/assets/plugins-CCu6p4dx.js +1 -0
  106. package/dist/client/assets/{popover-CvIauBBG.js → popover-lD-HtMf4.js} +1 -1
  107. package/dist/client/assets/{project-app-view-Wq81-D6Q.js → project-app-view-BuPOn3s0.js} +1 -1
  108. package/dist/client/assets/{project-layout-ByRNQhjx.js → project-layout-u1PVsl6x.js} +1 -1
  109. package/dist/client/assets/{project-plugins-8LQo3YBE.js → project-plugins-CIRGXDFY.js} +1 -1
  110. package/dist/client/assets/{projects-list-CfdMQhGh.js → projects-list-BcL7c7DQ.js} +1 -1
  111. package/dist/client/assets/{registry-layout-BfWTztsz.js → registry-layout-j-JX07UN.js} +1 -1
  112. package/dist/client/assets/{registry-utils-Cz03qmOa.js → registry-utils-DDsRF62n.js} +1 -1
  113. package/dist/client/assets/{reset-password-Cj1A6uL-.js → reset-password-CHFMULJN.js} +1 -1
  114. package/dist/client/assets/{resizable-BceA9DHD.js → resizable-CTPIKv4j.js} +1 -1
  115. package/dist/client/assets/{save-actions-BENpgKCD.js → save-actions-xo9lGU3J.js} +1 -1
  116. package/dist/client/assets/{scroll-area-4KH7xRn7.js → scroll-area-Dvs0ghbP.js} +1 -1
  117. package/dist/client/assets/{select-DaOZXaTi.js → select-9VPJVrM5.js} +1 -1
  118. package/dist/client/assets/{select-virtual-mcp-CjfXEnho.js → select-virtual-mcp-B6M52JVi.js} +1 -1
  119. package/dist/client/assets/{shell-layout-85fLFVwf.js → shell-layout-DO1T7Kx6.js} +2 -2
  120. package/dist/client/assets/{sidebar-settings-CvK0z-ir.js → sidebar-settings-CZn76McG.js} +1 -1
  121. package/dist/client/assets/{skeleton-CLUePAN0.js → skeleton-DPPFiXsR.js} +1 -1
  122. package/dist/client/assets/{spinner-7bhznOFa.js → spinner-DRNxYthF.js} +1 -1
  123. package/dist/client/assets/{store-invite-fWGyKl7o.js → store-invite-CrG3z_Nw.js} +1 -1
  124. package/dist/client/assets/{switch-yIP7Yj81.js → switch-BHSO5vl3.js} +1 -1
  125. package/dist/client/assets/{table-w828HACk.js → table-CvtSPXA4.js} +1 -1
  126. package/dist/client/assets/{tabs-Du7uGFqP.js → tabs-CdWME6KE.js} +1 -1
  127. package/dist/client/assets/{task-status-RaaIa42V.js → task-status-DFJ-29wD.js} +1 -1
  128. package/dist/client/assets/tasks-BlhTZX1-.js +1 -0
  129. package/dist/client/assets/{tasks-panel-CT_8gQvL.js → tasks-panel-BRc3ZfGK.js} +1 -1
  130. package/dist/client/assets/{textarea-D30IrLHN.js → textarea-Dtfhz_OA.js} +1 -1
  131. package/dist/client/assets/{time-range-picker-DVyznax9.js → time-range-picker-DcKa3AFf.js} +1 -1
  132. package/dist/client/assets/{toggle-group-DN_3BuPh.js → toggle-group-iephCdnh.js} +1 -1
  133. package/dist/client/assets/{tools-list-BQiqsKN2.js → tools-list-CDbT-l23.js} +1 -1
  134. package/dist/client/assets/{tooltip-DJkxXViN.js → tooltip-Cem552VW.js} +1 -1
  135. package/dist/client/assets/{types-llndI7Ky.js → types-DmDUXWAD.js} +1 -1
  136. package/dist/client/assets/{use-automations-DhJnP2CA.js → use-automations-DSFrBv_6.js} +1 -1
  137. package/dist/client/assets/{use-collections-Dmxer7H8.js → use-collections-D0k_QRc1.js} +1 -1
  138. package/dist/client/assets/{use-connection-Yjy9d1tW.js → use-connection-CP_xYk4Q.js} +1 -1
  139. package/dist/client/assets/{use-copy-DYNuGKRz.js → use-copy-d-3iM6J5.js} +1 -1
  140. package/dist/client/assets/{use-create-virtual-mcp-CEBO__7d.js → use-create-virtual-mcp-Dl6pqwaW.js} +1 -1
  141. package/dist/client/assets/{use-infinite-scroll-JQzncaIM.js → use-infinite-scroll-DtHbnYey.js} +1 -1
  142. package/dist/client/assets/{use-install-from-registry-Du1Xu864.js → use-install-from-registry-DZlZY82P.js} +1 -1
  143. package/dist/client/assets/{use-list-state-BG8gUSh9.js → use-list-state-DlUAsHMe.js} +1 -1
  144. package/dist/client/assets/{use-mcp-prompts-DY_yf0WC.js → use-mcp-prompts-8NM9rwku.js} +1 -1
  145. package/dist/client/assets/{use-mcp-resources-BnmpykKD.js → use-mcp-resources-CHuUMbyT.js} +1 -1
  146. package/dist/client/assets/{use-mcp-tools-CmOfbC2t.js → use-mcp-tools-BhKK8D6X.js} +1 -1
  147. package/dist/client/assets/{use-members-BZM-R1qG.js → use-members-dsS5L-Vf.js} +1 -1
  148. package/dist/client/assets/{use-project-W-5l7vWa.js → use-project-3rL77wj_.js} +1 -1
  149. package/dist/client/assets/{use-store-discovery-DfcEdPeQ.js → use-store-discovery-CbIFZaKF.js} +1 -1
  150. package/dist/client/assets/{use-view-mode-BGEJ9JzM.js → use-view-mode-CUtH8BDh.js} +1 -1
  151. package/dist/client/assets/{use-virtual-mcp-2qhGJdPe.js → use-virtual-mcp-tHRSpblC.js} +1 -1
  152. package/dist/client/assets/useInfiniteQuery-CjAl-HeV.js +1 -0
  153. package/dist/client/assets/{useMutation-BTUmJffP.js → useMutation-09-2Qwl6.js} +1 -1
  154. package/dist/client/assets/useQuery-DKMHT49Q.js +1 -0
  155. package/dist/client/assets/useSuspenseInfiniteQuery-DZTp9qX4.js +1 -0
  156. package/dist/client/assets/{user-DXILGeu2.js → user-BOuwXTIR.js} +1 -1
  157. package/dist/client/assets/{workflow-CBGVBFDu.js → workflow-BXPIrAUA.js} +1 -1
  158. package/dist/client/assets/{workflow-ClE3y6g8.js → workflow-D4GNw4Q9.js} +1 -1
  159. package/dist/client/index.html +1 -1
  160. package/dist/server/cli.js +235 -237
  161. package/dist/server/node_modules/onetime/index.d.ts +64 -0
  162. package/dist/server/node_modules/onetime/index.js +44 -0
  163. package/dist/server/node_modules/{mimic-fn → onetime}/package.json +16 -15
  164. package/dist/server/node_modules/onetime/readme.md +94 -0
  165. package/dist/server/node_modules/{postgres-interval/license → pg/LICENSE} +6 -6
  166. package/dist/server/node_modules/pg/README.md +95 -0
  167. package/dist/server/node_modules/pg/esm/index.mjs +20 -0
  168. package/dist/server/node_modules/pg/lib/client.js +743 -0
  169. package/dist/server/node_modules/pg/lib/connection-parameters.js +171 -0
  170. package/dist/server/node_modules/pg/lib/connection.js +221 -0
  171. package/dist/server/node_modules/pg/lib/crypto/cert-signatures.js +122 -0
  172. package/dist/server/node_modules/pg/lib/crypto/sasl.js +212 -0
  173. package/dist/server/node_modules/pg/lib/crypto/utils-legacy.js +43 -0
  174. package/dist/server/node_modules/pg/lib/crypto/utils-webcrypto.js +89 -0
  175. package/dist/server/node_modules/pg/lib/crypto/utils.js +9 -0
  176. package/dist/server/node_modules/pg/lib/defaults.js +91 -0
  177. package/dist/server/node_modules/pg/lib/index.js +73 -0
  178. package/dist/server/node_modules/pg/lib/native/client.js +323 -0
  179. package/dist/server/node_modules/pg/lib/native/index.js +2 -0
  180. package/dist/server/node_modules/pg/lib/native/query.js +165 -0
  181. package/dist/server/node_modules/pg/lib/query.js +252 -0
  182. package/dist/server/node_modules/pg/lib/result.js +109 -0
  183. package/dist/server/node_modules/pg/lib/stream.js +83 -0
  184. package/dist/server/node_modules/pg/lib/type-overrides.js +35 -0
  185. package/dist/server/node_modules/pg/lib/utils.js +217 -0
  186. package/dist/server/node_modules/pg/package.json +76 -0
  187. package/package.json +1 -1
  188. package/dist/client/assets/constants-BqeudQjB.js +0 -1
  189. package/dist/client/assets/plugins-D7XVdEz7.js +0 -1
  190. package/dist/client/assets/tasks-x-XNinod.js +0 -1
  191. package/dist/client/assets/useInfiniteQuery-D8TjRj27.js +0 -1
  192. package/dist/client/assets/useQuery-CvkH2gG1.js +0 -1
  193. package/dist/client/assets/useSuspenseInfiniteQuery-DRfcYfXZ.js +0 -1
  194. package/dist/server/node_modules/ansi-styles/index.d.ts +0 -236
  195. package/dist/server/node_modules/ansi-styles/index.js +0 -223
  196. package/dist/server/node_modules/ansi-styles/package.json +0 -54
  197. package/dist/server/node_modules/ansi-styles/readme.md +0 -173
  198. package/dist/server/node_modules/mimic-fn/index.d.ts +0 -54
  199. package/dist/server/node_modules/mimic-fn/index.js +0 -13
  200. package/dist/server/node_modules/mimic-fn/license +0 -9
  201. package/dist/server/node_modules/mimic-fn/readme.md +0 -69
  202. package/dist/server/node_modules/postgres-interval/index.d.ts +0 -20
  203. package/dist/server/node_modules/postgres-interval/index.js +0 -125
  204. package/dist/server/node_modules/postgres-interval/package.json +0 -36
  205. package/dist/server/node_modules/postgres-interval/readme.md +0 -48
  206. /package/dist/server/node_modules/{ansi-styles → onetime}/license +0 -0
@@ -1 +1 @@
1
- import{d as xe,j as s,E as ut,r as K,c as ft,f as pt,B as E,y as V,w as gt,O as jt}from"./index-D49VqQ7Q.js";import{C as bt}from"./collection-display-button-ZvHBt_eA.js";import{C as vt}from"./collection-search-fzGK39qM.js";import{P as fe,S as Nt,b as Ct,c as wt,d as yt,e as kt}from"./index-CtkIjbbq.js";import{B as St,a as Dt,b as _t,c as zt}from"./breadcrumb-BBMvtdg-.js";import{C as ct}from"./connection-card-D7msIZJv.js";import{B as J}from"./badge-DGQ0gFlp.js";import{i as At}from"./AlertCircle-BD5gSXQu.js";import{c as Mt}from"./XCircle-Z-JTmQ8v.js";import{E as Ye}from"./empty-state-B8NhLY9v.js";import{t as Be,A as ce,a as Tt}from"./integration-icon-ByIZ-Vgj.js";import{u as $t}from"./use-list-state-BG8gUSh9.js";import{u as Pt}from"./use-create-virtual-mcp-CEBO__7d.js";import{i as de}from"./constants-TLV7MTwP.js";import{b as Ot,a as Bt}from"./use-virtual-mcp-2qhGJdPe.js";import{c as Ze,b as et,d as tt,A as st,e as nt,h as it,a as at,f as rt}from"./alert-dialog-Bke1xnyn.js";import{C as Ie}from"./checkbox-Dzy6oaRF.js";import{a as It,D as Et,b as Rt,c as Vt,e as Kt}from"./dialog-DCrLu7TC.js";import{u as Gt}from"./tooltip-DJkxXViN.js";import{c as Ht,a as Ut,b as Oe,e as H,d as Ft,T as Lt}from"./table-w828HACk.js";import{D as Ee,a as Re,b as Ve,c as U}from"./dropdown-menu-BK29e1o0.js";import{i as qt,n as Jt}from"./ArrowUp-D6ltkV3R.js";import{t as Qt}from"./ChevronDown-CDxBhn_l.js";import{i as Ke,s as Ge}from"./RefreshCcw01-Co0-i94o.js";import{i as Wt}from"./Loading01-BVCg1O_G.js";import{s as Xe}from"./Plus-DcVtqCMV.js";import{s as pe}from"./Trash01-CBP9WLeP.js";import{s as dt}from"./XClose-BLvk3pvY.js";import{U as me}from"./user-DXILGeu2.js";import{A as lt}from"./agent-connections-preview-BQSZMPrI.js";import{f as he}from"./format-time-CMKyl-GC.js";import"./Check-Dczm9Dfw.js";import"./Type01-CySkENi6.js";import"./SearchMd-CVvF1HpM.js";import"./input-BoNWsfmK.js";import"./useQuery-CvkH2gG1.js";import"./useMutation-BTUmJffP.js";import"./X-Dr-hR03I.js";import"./ChevronRight-Dxvchjxo.js";import"./card-CKN-JP9M.js";import"./Container-CMPDG7Cp.js";import"./ArrowLeft-DN3D0Zrv.js";import"./ChevronUp-BLNd6dNq.js";import"./Play-Bb4cvvVL.js";import"./Dataflow03-slF1Ax9G.js";import"./FolderClosed-BKB_NgWm.js";import"./Settings01-DpZ_tsoX.js";import"./Upload01-BzGPegBj.js";import"./User01-CItwHvE1.js";import"./Zap-CiHJmamA.js";import"./use-view-mode-BGEJ9JzM.js";import"./use-collections-Dmxer7H8.js";import"./index-BkAoKVx8.js";import"./avatar-BZ4Frci2.js";import"./use-connection-Yjy9d1tW.js";import"./differenceInSeconds-NQ4PDo0z.js";function Xt(e){const t=xe.c(3),{status:n}=e;if(n==="active"){let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(J,{variant:"success",className:"gap-1.5 text-success border-success/40 bg-background",children:[s.jsx(Mt,{size:12}),"Active"]}),t[0]=i):i=t[0],i}if(n==="error"){let i;return t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(J,{variant:"outline",className:"gap-1.5 text-destructive border-destructive/40 bg-background",children:[s.jsx(At,{size:12}),"Error"]}),t[1]=i):i=t[1],i}let c;return t[2]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(J,{variant:"outline",className:"text-muted-foreground",children:"Inactive"}),t[2]=c):c=t[2],c}function ot(e){return e.title.trim().replace(/\s+\(\d+\)$/,"")}function Yt(e){const t=new Map;for(const i of e){const l=ot(i),r=t.get(l);r?r.push(i):t.set(l,[i])}const n=[],c=new Set;for(const i of e){const l=ot(i);if(c.has(l))continue;c.add(l);const r=t.get(l),x=r[0];r.length===1?n.push({type:"single",agent:x}):n.push({type:"group",key:l,icon:x.icon,title:x.title.replace(/\s*\(\d+\)\s*$/,""),agents:r})}return n}function mt(e){const t=new Set,n=[];for(const c of e)c.created_by&&!t.has(c.created_by)&&(t.add(c.created_by),n.push(c.created_by));return n}function Zt(e,t){switch(t.type){case"delete":return{mode:"deleting",virtualMcp:t.virtualMcp};case"close":return{mode:"idle"}}}function es(e){const t=xe.c(77),{group:n,onNavigate:c,onDelete:i,selectionMode:l,selectedIds:r,onToggleSelect:x}=e,[g,u]=K.useState(!1),k=Gt();let b;if(t[0]!==n.agents||t[1]!==r){let a;t[3]!==r?(a=o=>r.has(o.id),t[3]=r,t[4]=a):a=t[4],b=n.agents.every(a),t[0]=n.agents,t[1]=r,t[2]=b}else b=t[2];const v=b;let d;if(t[5]!==n.agents||t[6]!==r){let a;t[8]!==r?(a=o=>r.has(o.id),t[8]=r,t[9]=a):a=t[9],d=n.agents.some(a),t[5]=n.agents,t[6]=r,t[7]=d}else d=t[7];const O=d;let S,m,C,A,P,M,D,T,p,f;if(t[10]!==v||t[11]!==n.agents||t[12]!==n.icon||t[13]!==n.title||t[14]!==x||t[15]!==r||t[16]!==l||t[17]!==O){const a=mt(n.agents),o=n.agents.reduce(as,n.agents[0]),N=o.updated_at??o.created_at;S=ct;const _=`${n.agents.length} instances`;t[28]!==n.icon||t[29]!==n.title||t[30]!==_?(T={title:n.title,icon:n.icon,description:_},t[28]=n.icon,t[29]=n.title,t[30]=_,t[31]=T):T=t[31],t[32]!==v||t[33]!==n.agents||t[34]!==x||t[35]!==r||t[36]!==l?(p=()=>l?(()=>{for(const w of n.agents)v?r.has(w.id)&&x(w.id):r.has(w.id)||x(w.id)})():u(!0),t[32]=v,t[33]=n.agents,t[34]=x,t[35]=r,t[36]=l,t[37]=p):p=t[37];const G=l&&v&&"ring-2 ring-primary",R=l&&O&&!v&&"ring-1 ring-primary/50";t[38]!==G||t[39]!==R?(f=V(G,R),t[38]=G,t[39]=R,t[40]=f):f=t[40],t[41]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Be,{}),t[41]=m):m=t[41],t[42]!==v||t[43]!==n.agents||t[44]!==x||t[45]!==r||t[46]!==l||t[47]!==O?(C=l?s.jsx(Ie,{checked:v?!0:O?"indeterminate":!1,onCheckedChange:()=>{for(const w of n.agents)v?r.has(w.id)&&x(w.id):r.has(w.id)||x(w.id)}}):s.jsxs(J,{variant:"secondary",className:"text-xs tabular-nums",children:["x",n.agents.length]}),t[42]=v,t[43]=n.agents,t[44]=x,t[45]=r,t[46]=l,t[47]=O,t[48]=C):C=t[48],M="flex items-center justify-between text-xs text-muted-foreground w-full min-w-0";const F=a.map(w=>s.jsx(me,{id:w,size:"3xs",avatarOnly:a.length>1},w));t[49]!==F?(D=s.jsx("div",{className:"flex items-center -space-x-1.5",children:F}),t[49]=F,t[50]=D):D=t[50],A="shrink-0 ml-2",P=N?he(new Date(N)):"—",t[10]=v,t[11]=n.agents,t[12]=n.icon,t[13]=n.title,t[14]=x,t[15]=r,t[16]=l,t[17]=O,t[18]=S,t[19]=m,t[20]=C,t[21]=A,t[22]=P,t[23]=M,t[24]=D,t[25]=T,t[26]=p,t[27]=f}else S=t[18],m=t[19],C=t[20],A=t[21],P=t[22],M=t[23],D=t[24],T=t[25],p=t[26],f=t[27];let h;t[51]!==A||t[52]!==P?(h=s.jsx("span",{className:A,children:P}),t[51]=A,t[52]=P,t[53]=h):h=t[53];let $;t[54]!==h||t[55]!==M||t[56]!==D?($=s.jsxs("div",{className:M,children:[D,h]}),t[54]=h,t[55]=M,t[56]=D,t[57]=$):$=t[57];let z;t[58]!==S||t[59]!==m||t[60]!==C||t[61]!==$||t[62]!==T||t[63]!==p||t[64]!==f?(z=s.jsx(S,{connection:T,onClick:p,className:f,fallbackIcon:m,headerActions:C,footer:$}),t[58]=S,t[59]=m,t[60]=C,t[61]=$,t[62]=T,t[63]=p,t[64]=f,t[65]=z):z=t[65];let I;t[66]!==g||t[67]!==n.agents||t[68]!==n.icon||t[69]!==n.title||t[70]!==k||t[71]!==i||t[72]!==c?(I=k?s.jsx(Nt,{open:g,onOpenChange:u,children:s.jsxs(Ct,{side:"bottom",className:"p-0 flex flex-col max-h-[80vh]",children:[s.jsx(wt,{className:"px-6 pt-6 pb-4 border-b border-border shrink-0",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(ce,{icon:n.icon,name:n.title,size:"md",className:"shrink-0"}),s.jsxs("div",{children:[s.jsxs(yt,{children:[n.title,s.jsxs(J,{variant:"secondary",className:"ml-2 text-xs tabular-nums",children:["x",n.agents.length]})]}),s.jsxs(kt,{children:[n.agents.length," instances"]})]})]})}),s.jsx("div",{className:"divide-y overflow-auto",children:n.agents.map(a=>s.jsxs("div",{className:"flex items-center gap-3 px-6 py-3 hover:bg-muted/30 cursor-pointer transition-colors",onClick:()=>{u(!1),c(a.id)},children:[s.jsx(ce,{icon:a.icon,name:a.title,size:"sm",className:"shrink-0"}),s.jsx("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:a.title})}),s.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground shrink-0",children:[s.jsx(me,{id:a.created_by,size:"3xs"}),s.jsx("span",{children:a.created_at?he(new Date(a.created_at)):"—"})]}),s.jsxs(Ee,{children:[s.jsx(Re,{asChild:!0,children:s.jsx(E,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:is,children:s.jsx(Ke,{size:16})})}),s.jsxs(Ve,{align:"end",onClick:ns,children:[s.jsxs(U,{onClick:()=>{u(!1),c(a.id)},children:[s.jsx(Ge,{size:16}),"Open"]}),!de(a.id)&&s.jsxs(U,{variant:"destructive",onClick:()=>i(a),children:[s.jsx(pe,{size:16}),"Delete"]})]})]})]},a.id))})]})}):s.jsx(It,{open:g,onOpenChange:u,children:s.jsxs(Et,{className:"sm:max-w-lg p-0 gap-0",children:[s.jsx(Rt,{className:"px-6 pt-6 pb-4",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(ce,{icon:n.icon,name:n.title,size:"md",className:"shrink-0"}),s.jsxs("div",{children:[s.jsxs(Vt,{children:[n.title,s.jsxs(J,{variant:"secondary",className:"ml-2 text-xs tabular-nums",children:["x",n.agents.length]})]}),s.jsxs(Kt,{children:[n.agents.length," instances"]})]})]})}),s.jsx("div",{className:"divide-y max-h-80 overflow-auto",children:n.agents.map(a=>s.jsxs("div",{className:"flex items-center gap-3 px-6 py-3 hover:bg-muted/30 cursor-pointer transition-colors",onClick:()=>{u(!1),c(a.id)},children:[s.jsx(ce,{icon:a.icon,name:a.title,size:"sm",className:"shrink-0"}),s.jsx("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:a.title})}),s.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground shrink-0",children:[s.jsx(me,{id:a.created_by,size:"3xs"}),s.jsx("span",{children:a.created_at?he(new Date(a.created_at)):"—"})]}),s.jsxs(Ee,{children:[s.jsx(Re,{asChild:!0,children:s.jsx(E,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:ss,children:s.jsx(Ke,{size:16})})}),s.jsxs(Ve,{align:"end",onClick:ts,children:[s.jsxs(U,{onClick:()=>{u(!1),c(a.id)},children:[s.jsx(Ge,{size:16}),"Open"]}),!de(a.id)&&s.jsxs(U,{variant:"destructive",onClick:()=>i(a),children:[s.jsx(pe,{size:16}),"Delete"]})]})]})]},a.id))})]})}),t[66]=g,t[67]=n.agents,t[68]=n.icon,t[69]=n.title,t[70]=k,t[71]=i,t[72]=c,t[73]=I):I=t[73];let B;return t[74]!==z||t[75]!==I?(B=s.jsxs(s.Fragment,{children:[z,I]}),t[74]=z,t[75]=I,t[76]=B):B=t[76],B}function ts(e){return e.stopPropagation()}function ss(e){return e.stopPropagation()}function ns(e){return e.stopPropagation()}function is(e){return e.stopPropagation()}function as(e,t){const n=t.updated_at??t.created_at,c=e.updated_at??e.created_at;return n?c?new Date(n)>new Date(c)?t:e:t:e}function rs(e){const t=xe.c(21),{count:n,total:c,onSelectAll:i,onDeselectAll:l,onDelete:r,onCancel:x}=e;if(n===0)return null;let g;t[0]!==n?(g=s.jsxs("span",{className:"text-sm font-medium tabular-nums",children:[n," selected"]}),t[0]=n,t[1]=g):g=t[1];let u;t[2]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("div",{className:"h-4 w-px bg-border"}),t[2]=u):u=t[2];let k;t[3]!==n||t[4]!==l||t[5]!==i||t[6]!==c?(k=n<c?s.jsxs(E,{variant:"ghost",size:"sm",onClick:i,children:["Select all (",c,")"]}):s.jsx(E,{variant:"ghost",size:"sm",onClick:l,children:"Clear selection"}),t[3]=n,t[4]=l,t[5]=i,t[6]=c,t[7]=k):k=t[7];let b;t[8]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("div",{className:"h-4 w-px bg-border"}),t[8]=b):b=t[8];let v;t[9]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(pe,{size:14}),t[9]=v):v=t[9];let d;t[10]!==r?(d=s.jsxs(E,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",onClick:r,children:[v,"Delete"]}),t[10]=r,t[11]=d):d=t[11];let O;t[12]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx("div",{className:"h-4 w-px bg-border"}),t[12]=O):O=t[12];let S;t[13]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(dt,{size:14}),t[13]=S):S=t[13];let m;t[14]!==x?(m=s.jsxs(E,{variant:"ghost",size:"sm",onClick:x,children:[S,"Cancel"]}),t[14]=x,t[15]=m):m=t[15];let C;return t[16]!==g||t[17]!==k||t[18]!==d||t[19]!==m?(C=s.jsxs("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2 flex items-center gap-3 rounded-xl border border-border bg-background/95 backdrop-blur px-4 py-2.5 shadow-lg",children:[g,u,k,b,d,O,m]}),t[16]=g,t[17]=k,t[18]=d,t[19]=m,t[20]=C):C=t[20],C}function ls(e){const t=xe.c(37),{columns:n,grouped:c,sortKey:i,sortDirection:l,onSort:r,onRowClick:x,selectionMode:g,selectedIds:u,onToggleSelect:k,emptyState:b}=e;let v;t[0]===Symbol.for("react.memo_cache_sentinel")?(v=new Set,t[0]=v):v=t[0];const[d,O]=K.useState(v);let S;t[1]===Symbol.for("react.memo_cache_sentinel")?(S=p=>{O(f=>{const h=new Set(f);return h.has(p)?h.delete(p):h.add(p),h})},t[1]=S):S=t[1];const m=S;if(c.length===0&&b){let p;return t[2]!==b?(p=s.jsx("div",{className:"flex items-center justify-center h-full",children:b}),t[2]=b,t[3]=p):p=t[3],p}const C=n.length;let A;if(t[4]!==C||t[5]!==n||t[6]!==r||t[7]!==l||t[8]!==i){let p;t[10]!==C||t[11]!==r||t[12]!==l||t[13]!==i?(p=(f,h)=>{const $=i===f.id,z=h===C-1;return s.jsx(Ht,{className:V("px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider",z&&"w-8","group transition-colors select-none",f.sortable&&"hover:bg-accent cursor-pointer",f.cellClassName),onClick:f.sortable&&r?()=>r(f.id):void 0,children:s.jsxs("span",{className:"flex items-center gap-1",children:[f.header,f.sortable&&s.jsx("span",{className:"w-4 flex items-center justify-center",children:$&&l&&(l==="asc"?s.jsx(qt,{size:16,className:"text-muted-foreground"}):s.jsx(Jt,{size:16,className:"text-muted-foreground"}))})]})},f.id)},t[10]=C,t[11]=r,t[12]=l,t[13]=i,t[14]=p):p=t[14],A=n.map(p),t[4]=C,t[5]=n,t[6]=r,t[7]=l,t[8]=i,t[9]=A}else A=t[9];let P;t[15]!==A?(P=s.jsx(Ut,{className:"border-b-0",children:s.jsx(Oe,{className:"h-9 hover:bg-transparent border-b border-border",children:A})}),t[15]=A,t[16]=P):P=t[16];let M;if(t[17]!==n||t[18]!==d||t[19]!==c||t[20]!==x||t[21]!==k||t[22]!==u||t[23]!==g){let p;t[25]!==n||t[26]!==d||t[27]!==x||t[28]!==k||t[29]!==u||t[30]!==g?(p=f=>{if(f.type==="single"){const o=f.agent;return s.jsx(Oe,{className:V("group/data-row transition-colors border-b-0 hover:bg-accent/50 cursor-pointer",g&&u.has(o.id)&&"bg-primary/5"),onClick:()=>x(o),children:n.map(N=>s.jsx(H,{className:V("px-5 py-4 h-16 align-middle text-sm text-foreground",N.cellClassName),children:s.jsx("div",{className:"min-w-0 w-full truncate overflow-hidden whitespace-nowrap",children:N.render?N.render(o):null})},N.id))},o.id)}const h=f,$=d.has(h.key),z=h.agents.every(o=>u.has(o.id)),I=h.agents.some(o=>u.has(o.id)),B=mt(h.agents),a=h.agents.reduce(cs,h.agents[0]);return s.jsxs(K.Fragment,{children:[s.jsx(Oe,{className:"border-b-0 hover:bg-accent/50 cursor-pointer transition-colors",onClick:()=>m(h.key),children:n.map(o=>{const N=V("px-5 py-3 h-14 align-middle text-sm",o.cellClassName);if(o.id==="select")return s.jsx(H,{className:N,children:s.jsx(Ie,{checked:z?!0:I?"indeterminate":!1,onCheckedChange:()=>{for(const _ of h.agents)z?u.has(_.id)&&k(_.id):u.has(_.id)||k(_.id)},onClick:os})},o.id);if(o.id==="title")return s.jsx(H,{className:N,children:s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx(ce,{icon:h.icon,name:h.title,size:"sm"}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:h.title}),s.jsxs(J,{variant:"secondary",className:"text-xs tabular-nums",children:["x",h.agents.length]})]})},o.id);if(o.id==="updated_by")return s.jsx(H,{className:N,children:s.jsx("div",{className:"flex items-center -space-x-1.5",children:B.map(_=>s.jsx(me,{id:_,size:"3xs",avatarOnly:B.length>1},_))})},o.id);if(o.id==="updated_at"){const _=a.updated_at??a.created_at;return s.jsx(H,{className:N,children:s.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:_?he(new Date(_)):"—"})},o.id)}return o.id==="actions"?s.jsx(H,{className:N,children:s.jsx(Qt,{size:16,className:V("text-muted-foreground transition-transform",$&&"rotate-180")})},o.id):s.jsx(H,{className:N},o.id)})}),$&&h.agents.map(o=>s.jsx(Oe,{className:V("group/data-row transition-colors border-b-0 hover:bg-accent/50 cursor-pointer bg-muted/20",g&&u.has(o.id)&&"bg-primary/5"),onClick:()=>x(o),children:n.map(N=>s.jsx(H,{className:V("px-5 py-3 h-14 align-middle text-sm text-foreground",N.cellClassName,N.id==="title"&&"pl-12"),children:s.jsx("div",{className:"min-w-0 w-full truncate overflow-hidden whitespace-nowrap",children:N.render?N.render(o):null})},N.id))},o.id))]},h.key)},t[25]=n,t[26]=d,t[27]=x,t[28]=k,t[29]=u,t[30]=g,t[31]=p):p=t[31],M=c.map(p),t[17]=n,t[18]=d,t[19]=c,t[20]=x,t[21]=k,t[22]=u,t[23]=g,t[24]=M}else M=t[24];let D;t[32]!==M?(D=s.jsx(Ft,{children:M}),t[32]=M,t[33]=D):D=t[33];let T;return t[34]!==P||t[35]!==D?(T=s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsxs(Lt,{className:"w-full border-collapse",children:[P,D]})}),t[34]=P,t[35]=D,t[36]=T):T=t[36],T}function os(e){return e.stopPropagation()}function cs(e,t){const n=t.updated_at??t.created_at,c=e.updated_at??e.created_at;return n?c?new Date(n)>new Date(c)?t:e:t:e}function ds(){const e=xe.c(130),{org:t}=ft(),n=pt();let c;e[0]!==t.slug?(c={namespace:t.slug,resource:"agents",defaultViewMode:"cards"},e[0]=t.slug,e[1]=c):c=e[1];const i=$t(c),l=Ot(i);let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r={navigateOnCreate:!0},e[2]=r):r=e[2];const{createVirtualMCP:x,isCreating:g}=Pt(r),u=Bt();let k;e[3]===Symbol.for("react.memo_cache_sentinel")?(k={mode:"idle"},e[3]=k):k=e[3];const[b,v]=K.useReducer(Zt,k),[d,O]=K.useState(!1);let S;e[4]===Symbol.for("react.memo_cache_sentinel")?(S=new Set,e[4]=S):S=e[4];const[m,C]=K.useState(S),[A,P]=K.useState(!1);let M;e[5]===Symbol.for("react.memo_cache_sentinel")?(M=R=>{C(F=>{const w=new Set(F);return w.has(R)?w.delete(R):w.add(R),w})},e[5]=M):M=e[5];const D=M;let T;e[6]===Symbol.for("react.memo_cache_sentinel")?(T=()=>{O(!1),C(new Set)},e[6]=T):T=e[6];const p=T,f=l;let h,$,z,I,B,a,o;if(e[7]!==u||e[8]!==A||e[9]!==x||e[10]!==b.mode||e[11]!==b.virtualMcp||e[12]!==f||e[13]!==g||e[14]!==i||e[15]!==n||e[16]!==t.slug||e[17]!==m||e[18]!==d||e[19]!==l){const R=Yt(f),F=l.length;let w;e[27]!==l?(w=l.filter(ks),e[27]=l,e[28]=w):w=e[28];const ht=w.length;let Q;e[29]!==l?(Q=l.filter(ys),e[29]=l,e[30]=Q):Q=e[30];let ge;e[31]!==w.length||e[32]!==Q.length||e[33]!==l.length?(ge={total:F,active:ht,inactive:Q.length},e[31]=w.length,e[32]=Q.length,e[33]=l.length,e[34]=ge):ge=e[34];const L=ge;let je;e[35]!==u||e[36]!==b.mode||e[37]!==b.virtualMcp?(je=async()=>{if(b.mode!=="deleting")return;const j=b.virtualMcp.id;if(v({type:"close"}),!(!j||de(j)))try{await u.delete.mutateAsync(j)}catch{}},e[35]=u,e[36]=b.mode,e[37]=b.virtualMcp,e[38]=je):je=e[38];const He=je;let be;e[39]!==u||e[40]!==m?(be=async()=>{P(!1);let j=0;for(const y of m)if(!de(y))try{await u.delete.mutateAsync(y),j++}catch{}gt.success(`Deleted ${j} agent${j!==1?"s":""}`),p()},e[39]=u,e[40]=m,e[41]=be):be=e[41];const Ue=be;let ve;e[42]!==n||e[43]!==t.slug||e[44]!==d?(ve=j=>{if(d){D(j);return}n({to:"/$org/$project/agents/$agentId",params:{org:t.slug,project:jt,agentId:j}})},e[42]=n,e[43]=t.slug,e[44]=d,e[45]=ve):ve=e[45];const q=ve;let W;e[46]!==m||e[47]!==d?(W=d?[{id:"select",header:"",render:j=>s.jsx(Ie,{checked:m.has(j.id),onCheckedChange:()=>D(j.id),onClick:ws}),cellClassName:"w-10 shrink-0"}]:[],e[46]=m,e[47]=d,e[48]=W):W=e[48];let Ne,Ce,we,ye,ke,Se;e[49]===Symbol.for("react.memo_cache_sentinel")?(Ne={id:"title",header:"Name",render:Cs,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},Ce={id:"description",header:"Description",render:Ns,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},we={id:"connections",header:"Connections",render:bs,cellClassName:"w-28 shrink-0"},ye={id:"status",header:"Status",render:js,cellClassName:"w-24 shrink-0"},ke={id:"updated_by",header:"Updated by",render:gs,cellClassName:"w-32 shrink-0",sortable:!0},Se={id:"updated_at",header:"Updated",render:ps,cellClassName:"max-w-24 w-24 shrink-0",sortable:!0},e[49]=Ne,e[50]=Ce,e[51]=we,e[52]=ye,e[53]=ke,e[54]=Se):(Ne=e[49],Ce=e[50],we=e[51],ye=e[52],ke=e[53],Se=e[54]);let X;e[55]!==q?(X={id:"actions",header:"",render:j=>s.jsxs(Ee,{children:[s.jsx(Re,{asChild:!0,children:s.jsx(E,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:fs,children:s.jsx(Ke,{size:20})})}),s.jsxs(Ve,{align:"end",onClick:us,children:[s.jsxs(U,{onClick:y=>{y.stopPropagation(),q(j.id)},children:[s.jsx(Ge,{size:16}),"Open"]}),!de(j.id)&&s.jsxs(U,{variant:"destructive",onClick:y=>{y.stopPropagation(),v({type:"delete",virtualMcp:j})},children:[s.jsx(pe,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"},e[55]=q,e[56]=X):X=e[56];let De;e[57]!==W||e[58]!==X?(De=[...W,Ne,Ce,we,ye,ke,Se,X],e[57]=W,e[58]=X,e[59]=De):De=e[59];const xt=De;let _e;e[60]!==x||e[61]!==g||e[62]!==d?(_e=s.jsx("div",{className:"flex items-center gap-2",children:d?s.jsxs(E,{variant:"ghost",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",onClick:p,children:[s.jsx(dt,{size:14}),"Cancel"]}):s.jsxs(s.Fragment,{children:[s.jsxs(E,{variant:"outline",size:"sm",className:"hidden sm:flex h-7 w-7 px-0 sm:w-auto sm:px-3 rounded-lg text-sm font-medium",onClick:()=>O(!0),children:[s.jsx(Tt,{size:14}),s.jsx("span",{className:"hidden sm:inline",children:"Select"})]}),s.jsxs(E,{onClick:x,size:"sm",className:"h-7 w-7 px-0 sm:w-auto sm:px-3 rounded-lg text-sm font-medium",disabled:g,children:[s.jsx(Xe,{size:14}),s.jsx("span",{className:"hidden sm:inline",children:g?"Creating...":"Create Agent"})]})]})}),e[60]=x,e[61]=g,e[62]=d,e[63]=_e):_e=e[63];const Fe=_e;$=fe;const Le=b.mode==="deleting";let ze;e[64]===Symbol.for("react.memo_cache_sentinel")?(ze=j=>!j&&v({type:"close"}),e[64]=ze):ze=e[64];let Ae;e[65]===Symbol.for("react.memo_cache_sentinel")?(Ae=s.jsx(Ze,{children:"Delete Agent?"}),e[65]=Ae):Ae=e[65];const qe=b.mode==="deleting"&&b.virtualMcp.title;let Y;e[66]!==qe?(Y=s.jsxs(et,{children:[Ae,s.jsxs(tt,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:qe}),"."]})]}),e[66]=qe,e[67]=Y):Y=e[67];let Me;e[68]===Symbol.for("react.memo_cache_sentinel")?(Me=s.jsx(st,{children:"Cancel"}),e[68]=Me):Me=e[68];let Z;e[69]!==He?(Z=s.jsxs(nt,{children:[Me,s.jsx(it,{onClick:He,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[69]=He,e[70]=Z):Z=e[70];let ee;e[71]!==Y||e[72]!==Z?(ee=s.jsxs(at,{children:[Y,Z]}),e[71]=Y,e[72]=Z,e[73]=ee):ee=e[73],e[74]!==Le||e[75]!==ee?(B=s.jsx(rt,{open:Le,onOpenChange:ze,children:ee}),e[74]=Le,e[75]=ee,e[76]=B):B=e[76];const Je=m.size!==1?"s":"";let te;e[77]!==m.size||e[78]!==Je?(te=s.jsxs(Ze,{children:["Delete ",m.size," agent",Je,"?"]}),e[77]=m.size,e[78]=Je,e[79]=te):te=e[79];let Te;e[80]===Symbol.for("react.memo_cache_sentinel")?(Te=s.jsx(tt,{children:"This action cannot be undone. This will permanently delete the selected agents."}),e[80]=Te):Te=e[80];let se;e[81]!==te?(se=s.jsxs(et,{children:[te,Te]}),e[81]=te,e[82]=se):se=e[82];let $e;e[83]===Symbol.for("react.memo_cache_sentinel")?($e=s.jsx(st,{children:"Cancel"}),e[83]=$e):$e=e[83];let ne;e[84]!==Ue?(ne=s.jsxs(nt,{children:[$e,s.jsx(it,{onClick:Ue,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[84]=Ue,e[85]=ne):ne=e[85];let ie;e[86]!==se||e[87]!==ne?(ie=s.jsxs(at,{children:[se,ne]}),e[86]=se,e[87]=ne,e[88]=ie):ie=e[88],e[89]!==A||e[90]!==ie?(a=s.jsx(rt,{open:A,onOpenChange:P,children:ie}),e[89]=A,e[90]=ie,e[91]=a):a=e[91];const Qe=L.active>0&&` · ${L.active} active`,We=L.inactive>0&&` · ${L.inactive} inactive`;let ae;e[92]!==L.total||e[93]!==Qe||e[94]!==We?(ae=s.jsx(fe.Header.Left,{children:s.jsx(St,{children:s.jsx(Dt,{children:s.jsx(_t,{children:s.jsxs(zt,{className:"flex items-center gap-2",children:["Agents",s.jsxs("span",{className:"hidden sm:inline text-xs font-normal text-muted-foreground tabular-nums",children:[L.total," total",Qe,We]})]})})})})}),e[92]=L.total,e[93]=Qe,e[94]=We,e[95]=ae):ae=e[95];let Pe;e[96]===Symbol.for("react.memo_cache_sentinel")?(Pe=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],e[96]=Pe):Pe=e[96];let re;e[97]!==i.handleSort||e[98]!==i.setViewMode||e[99]!==i.sortDirection||e[100]!==i.sortKey||e[101]!==i.viewMode?(re=s.jsx(bt,{viewMode:i.viewMode,onViewModeChange:i.setViewMode,sortKey:i.sortKey,sortDirection:i.sortDirection,onSort:i.handleSort,sortOptions:Pe}),e[97]=i.handleSort,e[98]=i.setViewMode,e[99]=i.sortDirection,e[100]=i.sortKey,e[101]=i.viewMode,e[102]=re):re=e[102];let le;e[103]!==Fe||e[104]!==re?(le=s.jsxs(fe.Header.Right,{children:[re,Fe]}),e[103]=Fe,e[104]=re,e[105]=le):le=e[105],e[106]!==ae||e[107]!==le?(o=s.jsxs(fe.Header,{children:[ae,le]}),e[106]=ae,e[107]=le,e[108]=o):o=e[108];let oe;e[109]!==i?(oe=j=>{j.key==="Escape"&&(i.setSearch(""),j.target.blur())},e[109]=i,e[110]=oe):oe=e[110],e[111]!==i.search||e[112]!==i.setSearch||e[113]!==oe?(z=s.jsx("div",{className:"flex items-center gap-3 px-5 pb-0",children:s.jsx("div",{className:"flex-1",children:s.jsx(vt,{value:i.search,onChange:i.setSearch,placeholder:"Search for an agent...",onKeyDown:oe})})}),e[111]=i.search,e[112]=i.setSearch,e[113]=oe,e[114]=z):z=e[114],h=fe.Content,I=i.viewMode==="cards"?s.jsx("div",{className:"flex-1 overflow-auto p-5",children:f.length===0?s.jsx("div",{className:"flex items-center justify-center min-h-[60vh]",children:s.jsx(Ye,{image:s.jsx(Be,{size:48,className:"text-muted-foreground"}),title:i.search?"No agents found":"No agents yet",description:i.search?`No agents match "${i.search}"`:"Create an agent to aggregate tools from multiple Connections.",actions:!i.search&&s.jsxs(E,{size:"sm",onClick:x,disabled:g,children:[s.jsx(Xe,{size:14}),g?"Creating...":"Create Agent"]})})}):s.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:R.map(j=>{if(j.type==="group")return s.jsx(es,{group:j,onNavigate:q,onDelete:ue=>v({type:"delete",virtualMcp:ue}),selectionMode:d,selectedIds:m,onToggleSelect:D},j.key);const y=j.agent;return s.jsxs("div",{className:"relative",children:[d&&s.jsx("div",{className:"absolute top-3 left-3 z-10",children:s.jsx(Ie,{checked:m.has(y.id),onCheckedChange:()=>D(y.id)})}),s.jsx(ct,{connection:{id:y.id??"",title:y.title,description:y.description,icon:y.icon,status:y.status},fallbackIcon:s.jsx(Be,{}),onClick:()=>q(y.id),className:V(d&&m.has(y.id)&&"ring-2 ring-primary"),footer:s.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground w-full min-w-0",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(me,{id:y.updated_by??y.created_by,size:"3xs"})}),s.jsx("span",{className:"shrink-0 ml-2",children:y.updated_at?he(new Date(y.updated_at)):"—"})]}),headerActions:d?void 0:s.jsxs(Ee,{children:[s.jsx(Re,{asChild:!0,children:s.jsx(E,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:xs,children:s.jsx(Ke,{size:20})})}),s.jsxs(Ve,{align:"end",onClick:hs,children:[s.jsxs(U,{onClick:ue=>{ue.stopPropagation(),q(y.id)},children:[s.jsx(Ge,{size:16}),"Open"]}),!de(y.id)&&s.jsxs(U,{variant:"destructive",onClick:ue=>{ue.stopPropagation(),v({type:"delete",virtualMcp:y})},children:[s.jsx(pe,{size:16}),"Delete"]})]})]})})]},y.id)})})}):s.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:s.jsx("div",{className:"flex-1 overflow-auto min-w-0",children:R.length===0?s.jsx("div",{className:"flex items-center justify-center min-h-[60vh]",children:s.jsx(Ye,{image:s.jsx(Be,{size:48,className:"text-muted-foreground"}),title:i.search?"No agents found":"No agents yet",description:i.search?`No agents match "${i.search}"`:"Create an agent to aggregate tools from multiple Connections.",actions:!i.search&&s.jsxs(E,{size:"sm",onClick:x,disabled:g,children:[s.jsx(Xe,{size:14}),g?"Creating...":"Create Agent"]})})}):s.jsx("div",{className:"min-w-[1000px]",children:s.jsx(ls,{columns:xt,grouped:R,sortKey:i.sortKey,sortDirection:i.sortDirection,onSort:i.handleSort,onRowClick:j=>q(j.id),selectionMode:d,selectedIds:m,onToggleSelect:D})})})}),e[7]=u,e[8]=A,e[9]=x,e[10]=b.mode,e[11]=b.virtualMcp,e[12]=f,e[13]=g,e[14]=i,e[15]=n,e[16]=t.slug,e[17]=m,e[18]=d,e[19]=l,e[20]=h,e[21]=$,e[22]=z,e[23]=I,e[24]=B,e[25]=a,e[26]=o}else h=e[20],$=e[21],z=e[22],I=e[23],B=e[24],a=e[25],o=e[26];let N;e[115]!==h||e[116]!==I?(N=s.jsx(h,{children:I}),e[115]=h,e[116]=I,e[117]=N):N=e[117];let _;e[118]!==f||e[119]!==m.size||e[120]!==d?(_=d&&s.jsx(rs,{count:m.size,total:f.length,onSelectAll:()=>C(new Set(f.map(ms))),onDeselectAll:()=>C(new Set),onDelete:()=>P(!0),onCancel:p}),e[118]=f,e[119]=m.size,e[120]=d,e[121]=_):_=e[121];let G;return e[122]!==$||e[123]!==z||e[124]!==N||e[125]!==_||e[126]!==B||e[127]!==a||e[128]!==o?(G=s.jsxs($,{children:[B,a,o,z,N,_]}),e[122]=$,e[123]=z,e[124]=N,e[125]=_,e[126]=B,e[127]=a,e[128]=o,e[129]=G):G=e[129],G}function ms(e){return e.id}function hs(e){return e.stopPropagation()}function xs(e){return e.stopPropagation()}function us(e){return e.stopPropagation()}function fs(e){return e.stopPropagation()}function ps(e){return s.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:e.updated_at?he(new Date(e.updated_at)):"—"})}function gs(e){return s.jsx(me,{id:e.updated_by??e.created_by,size:"3xs"})}function js(e){return s.jsx(Xt,{status:e.status})}function bs(e){return s.jsx(K.Suspense,{fallback:s.jsx(lt.Fallback,{}),children:s.jsx(lt,{connectionIds:e.connections.map(vs),maxVisibleIcons:2})})}function vs(e){return e.connection_id}function Ns(e){return s.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function Cs(e){return s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx(ce,{icon:e.icon,name:e.title,size:"sm"}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})]})}function ws(e){return e.stopPropagation()}function ys(e){return e.status==="inactive"}function ks(e){return e.status==="active"}function zn(){const e=xe.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(ut,{children:s.jsx(K.Suspense,{fallback:s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx(Wt,{size:32,className:"animate-spin text-muted-foreground"})}),children:s.jsx(ds,{})})}),e[0]=t):t=e[0],t}export{zn as default};
1
+ import{d as xe,j as s,E as ut,r as K,c as ft,f as pt,B as E,y as V,w as gt,O as jt}from"./index-Y_g6-sbQ.js";import{C as bt}from"./collection-display-button-6w4fqzbK.js";import{C as vt}from"./collection-search-R3szwhKc.js";import{P as fe,S as Nt,b as Ct,c as wt,d as yt,e as kt}from"./index-BlVIyhiN.js";import{B as St,a as Dt,b as _t,c as zt}from"./breadcrumb-CCT_gYCX.js";import{C as ct}from"./connection-card-u3N2FMhV.js";import{B as J}from"./badge-CintUB2m.js";import{i as At}from"./AlertCircle-DoDnREQU.js";import{c as Mt}from"./XCircle-Of71XlDY.js";import{E as Ye}from"./empty-state-5hCgVmoA.js";import{t as Be,A as ce,a as Tt}from"./integration-icon-7Bz6GmNv.js";import{u as $t}from"./use-list-state-DlUAsHMe.js";import{u as Pt}from"./use-create-virtual-mcp-Dl6pqwaW.js";import{i as de}from"./constants-Cf6w8uWj.js";import{b as Ot,a as Bt}from"./use-virtual-mcp-tHRSpblC.js";import{c as Ze,b as et,d as tt,A as st,e as nt,h as it,a as at,f as rt}from"./alert-dialog-BIZOEctM.js";import{C as Ie}from"./checkbox-B5yMaD1U.js";import{a as It,D as Et,b as Rt,c as Vt,e as Kt}from"./dialog-B_ZBKGcK.js";import{u as Gt}from"./tooltip-Cem552VW.js";import{c as Ht,a as Ut,b as Oe,e as H,d as Ft,T as Lt}from"./table-CvtSPXA4.js";import{D as Ee,a as Re,b as Ve,c as U}from"./dropdown-menu-BGBf4SQr.js";import{i as qt,n as Jt}from"./ArrowUp-CiCCsmLU.js";import{t as Qt}from"./ChevronDown-DMIUCeXF.js";import{i as Ke,s as Ge}from"./RefreshCcw01-Dbe0-ztA.js";import{i as Wt}from"./Loading01-DTPGNGDe.js";import{s as Xe}from"./Plus-VNSvGQN9.js";import{s as pe}from"./Trash01-p_-P7rrZ.js";import{s as dt}from"./XClose-CIHCEBuc.js";import{U as me}from"./user-BOuwXTIR.js";import{A as lt}from"./agent-connections-preview-9beskZXW.js";import{f as he}from"./format-time-CMKyl-GC.js";import"./Check-DsqqbwRv.js";import"./Type01-D1knZTdC.js";import"./SearchMd-BVguqJPF.js";import"./input-BJjZBSH8.js";import"./useQuery-DKMHT49Q.js";import"./useMutation-09-2Qwl6.js";import"./X-AnvD8fGN.js";import"./ChevronRight-BvErZvXV.js";import"./card-DiqqquYR.js";import"./Container-D8gJR-V9.js";import"./ArrowLeft-1uQ4hoAA.js";import"./ChevronUp-BPTkFtVQ.js";import"./Play-BSN624z4.js";import"./Dataflow03-D9B0IMv1.js";import"./FolderClosed-DtTyOuV-.js";import"./Settings01-BKawEeOc.js";import"./Upload01-D-cgBdXK.js";import"./User01-C1Py8RLi.js";import"./Zap-Cbf8Gxw3.js";import"./use-view-mode-CUtH8BDh.js";import"./use-collections-D0k_QRc1.js";import"./index-CT7BYuwf.js";import"./avatar-BDzYYIB_.js";import"./use-connection-CP_xYk4Q.js";import"./differenceInSeconds-NQ4PDo0z.js";function Xt(e){const t=xe.c(3),{status:n}=e;if(n==="active"){let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(J,{variant:"success",className:"gap-1.5 text-success border-success/40 bg-background",children:[s.jsx(Mt,{size:12}),"Active"]}),t[0]=i):i=t[0],i}if(n==="error"){let i;return t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(J,{variant:"outline",className:"gap-1.5 text-destructive border-destructive/40 bg-background",children:[s.jsx(At,{size:12}),"Error"]}),t[1]=i):i=t[1],i}let c;return t[2]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(J,{variant:"outline",className:"text-muted-foreground",children:"Inactive"}),t[2]=c):c=t[2],c}function ot(e){return e.title.trim().replace(/\s+\(\d+\)$/,"")}function Yt(e){const t=new Map;for(const i of e){const l=ot(i),r=t.get(l);r?r.push(i):t.set(l,[i])}const n=[],c=new Set;for(const i of e){const l=ot(i);if(c.has(l))continue;c.add(l);const r=t.get(l),x=r[0];r.length===1?n.push({type:"single",agent:x}):n.push({type:"group",key:l,icon:x.icon,title:x.title.replace(/\s*\(\d+\)\s*$/,""),agents:r})}return n}function mt(e){const t=new Set,n=[];for(const c of e)c.created_by&&!t.has(c.created_by)&&(t.add(c.created_by),n.push(c.created_by));return n}function Zt(e,t){switch(t.type){case"delete":return{mode:"deleting",virtualMcp:t.virtualMcp};case"close":return{mode:"idle"}}}function es(e){const t=xe.c(77),{group:n,onNavigate:c,onDelete:i,selectionMode:l,selectedIds:r,onToggleSelect:x}=e,[g,u]=K.useState(!1),k=Gt();let b;if(t[0]!==n.agents||t[1]!==r){let a;t[3]!==r?(a=o=>r.has(o.id),t[3]=r,t[4]=a):a=t[4],b=n.agents.every(a),t[0]=n.agents,t[1]=r,t[2]=b}else b=t[2];const v=b;let d;if(t[5]!==n.agents||t[6]!==r){let a;t[8]!==r?(a=o=>r.has(o.id),t[8]=r,t[9]=a):a=t[9],d=n.agents.some(a),t[5]=n.agents,t[6]=r,t[7]=d}else d=t[7];const O=d;let S,m,C,A,P,M,D,T,p,f;if(t[10]!==v||t[11]!==n.agents||t[12]!==n.icon||t[13]!==n.title||t[14]!==x||t[15]!==r||t[16]!==l||t[17]!==O){const a=mt(n.agents),o=n.agents.reduce(as,n.agents[0]),N=o.updated_at??o.created_at;S=ct;const _=`${n.agents.length} instances`;t[28]!==n.icon||t[29]!==n.title||t[30]!==_?(T={title:n.title,icon:n.icon,description:_},t[28]=n.icon,t[29]=n.title,t[30]=_,t[31]=T):T=t[31],t[32]!==v||t[33]!==n.agents||t[34]!==x||t[35]!==r||t[36]!==l?(p=()=>l?(()=>{for(const w of n.agents)v?r.has(w.id)&&x(w.id):r.has(w.id)||x(w.id)})():u(!0),t[32]=v,t[33]=n.agents,t[34]=x,t[35]=r,t[36]=l,t[37]=p):p=t[37];const G=l&&v&&"ring-2 ring-primary",R=l&&O&&!v&&"ring-1 ring-primary/50";t[38]!==G||t[39]!==R?(f=V(G,R),t[38]=G,t[39]=R,t[40]=f):f=t[40],t[41]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Be,{}),t[41]=m):m=t[41],t[42]!==v||t[43]!==n.agents||t[44]!==x||t[45]!==r||t[46]!==l||t[47]!==O?(C=l?s.jsx(Ie,{checked:v?!0:O?"indeterminate":!1,onCheckedChange:()=>{for(const w of n.agents)v?r.has(w.id)&&x(w.id):r.has(w.id)||x(w.id)}}):s.jsxs(J,{variant:"secondary",className:"text-xs tabular-nums",children:["x",n.agents.length]}),t[42]=v,t[43]=n.agents,t[44]=x,t[45]=r,t[46]=l,t[47]=O,t[48]=C):C=t[48],M="flex items-center justify-between text-xs text-muted-foreground w-full min-w-0";const F=a.map(w=>s.jsx(me,{id:w,size:"3xs",avatarOnly:a.length>1},w));t[49]!==F?(D=s.jsx("div",{className:"flex items-center -space-x-1.5",children:F}),t[49]=F,t[50]=D):D=t[50],A="shrink-0 ml-2",P=N?he(new Date(N)):"—",t[10]=v,t[11]=n.agents,t[12]=n.icon,t[13]=n.title,t[14]=x,t[15]=r,t[16]=l,t[17]=O,t[18]=S,t[19]=m,t[20]=C,t[21]=A,t[22]=P,t[23]=M,t[24]=D,t[25]=T,t[26]=p,t[27]=f}else S=t[18],m=t[19],C=t[20],A=t[21],P=t[22],M=t[23],D=t[24],T=t[25],p=t[26],f=t[27];let h;t[51]!==A||t[52]!==P?(h=s.jsx("span",{className:A,children:P}),t[51]=A,t[52]=P,t[53]=h):h=t[53];let $;t[54]!==h||t[55]!==M||t[56]!==D?($=s.jsxs("div",{className:M,children:[D,h]}),t[54]=h,t[55]=M,t[56]=D,t[57]=$):$=t[57];let z;t[58]!==S||t[59]!==m||t[60]!==C||t[61]!==$||t[62]!==T||t[63]!==p||t[64]!==f?(z=s.jsx(S,{connection:T,onClick:p,className:f,fallbackIcon:m,headerActions:C,footer:$}),t[58]=S,t[59]=m,t[60]=C,t[61]=$,t[62]=T,t[63]=p,t[64]=f,t[65]=z):z=t[65];let I;t[66]!==g||t[67]!==n.agents||t[68]!==n.icon||t[69]!==n.title||t[70]!==k||t[71]!==i||t[72]!==c?(I=k?s.jsx(Nt,{open:g,onOpenChange:u,children:s.jsxs(Ct,{side:"bottom",className:"p-0 flex flex-col max-h-[80vh]",children:[s.jsx(wt,{className:"px-6 pt-6 pb-4 border-b border-border shrink-0",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(ce,{icon:n.icon,name:n.title,size:"md",className:"shrink-0"}),s.jsxs("div",{children:[s.jsxs(yt,{children:[n.title,s.jsxs(J,{variant:"secondary",className:"ml-2 text-xs tabular-nums",children:["x",n.agents.length]})]}),s.jsxs(kt,{children:[n.agents.length," instances"]})]})]})}),s.jsx("div",{className:"divide-y overflow-auto",children:n.agents.map(a=>s.jsxs("div",{className:"flex items-center gap-3 px-6 py-3 hover:bg-muted/30 cursor-pointer transition-colors",onClick:()=>{u(!1),c(a.id)},children:[s.jsx(ce,{icon:a.icon,name:a.title,size:"sm",className:"shrink-0"}),s.jsx("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:a.title})}),s.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground shrink-0",children:[s.jsx(me,{id:a.created_by,size:"3xs"}),s.jsx("span",{children:a.created_at?he(new Date(a.created_at)):"—"})]}),s.jsxs(Ee,{children:[s.jsx(Re,{asChild:!0,children:s.jsx(E,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:is,children:s.jsx(Ke,{size:16})})}),s.jsxs(Ve,{align:"end",onClick:ns,children:[s.jsxs(U,{onClick:()=>{u(!1),c(a.id)},children:[s.jsx(Ge,{size:16}),"Open"]}),!de(a.id)&&s.jsxs(U,{variant:"destructive",onClick:()=>i(a),children:[s.jsx(pe,{size:16}),"Delete"]})]})]})]},a.id))})]})}):s.jsx(It,{open:g,onOpenChange:u,children:s.jsxs(Et,{className:"sm:max-w-lg p-0 gap-0",children:[s.jsx(Rt,{className:"px-6 pt-6 pb-4",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(ce,{icon:n.icon,name:n.title,size:"md",className:"shrink-0"}),s.jsxs("div",{children:[s.jsxs(Vt,{children:[n.title,s.jsxs(J,{variant:"secondary",className:"ml-2 text-xs tabular-nums",children:["x",n.agents.length]})]}),s.jsxs(Kt,{children:[n.agents.length," instances"]})]})]})}),s.jsx("div",{className:"divide-y max-h-80 overflow-auto",children:n.agents.map(a=>s.jsxs("div",{className:"flex items-center gap-3 px-6 py-3 hover:bg-muted/30 cursor-pointer transition-colors",onClick:()=>{u(!1),c(a.id)},children:[s.jsx(ce,{icon:a.icon,name:a.title,size:"sm",className:"shrink-0"}),s.jsx("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:a.title})}),s.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground shrink-0",children:[s.jsx(me,{id:a.created_by,size:"3xs"}),s.jsx("span",{children:a.created_at?he(new Date(a.created_at)):"—"})]}),s.jsxs(Ee,{children:[s.jsx(Re,{asChild:!0,children:s.jsx(E,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:ss,children:s.jsx(Ke,{size:16})})}),s.jsxs(Ve,{align:"end",onClick:ts,children:[s.jsxs(U,{onClick:()=>{u(!1),c(a.id)},children:[s.jsx(Ge,{size:16}),"Open"]}),!de(a.id)&&s.jsxs(U,{variant:"destructive",onClick:()=>i(a),children:[s.jsx(pe,{size:16}),"Delete"]})]})]})]},a.id))})]})}),t[66]=g,t[67]=n.agents,t[68]=n.icon,t[69]=n.title,t[70]=k,t[71]=i,t[72]=c,t[73]=I):I=t[73];let B;return t[74]!==z||t[75]!==I?(B=s.jsxs(s.Fragment,{children:[z,I]}),t[74]=z,t[75]=I,t[76]=B):B=t[76],B}function ts(e){return e.stopPropagation()}function ss(e){return e.stopPropagation()}function ns(e){return e.stopPropagation()}function is(e){return e.stopPropagation()}function as(e,t){const n=t.updated_at??t.created_at,c=e.updated_at??e.created_at;return n?c?new Date(n)>new Date(c)?t:e:t:e}function rs(e){const t=xe.c(21),{count:n,total:c,onSelectAll:i,onDeselectAll:l,onDelete:r,onCancel:x}=e;if(n===0)return null;let g;t[0]!==n?(g=s.jsxs("span",{className:"text-sm font-medium tabular-nums",children:[n," selected"]}),t[0]=n,t[1]=g):g=t[1];let u;t[2]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("div",{className:"h-4 w-px bg-border"}),t[2]=u):u=t[2];let k;t[3]!==n||t[4]!==l||t[5]!==i||t[6]!==c?(k=n<c?s.jsxs(E,{variant:"ghost",size:"sm",onClick:i,children:["Select all (",c,")"]}):s.jsx(E,{variant:"ghost",size:"sm",onClick:l,children:"Clear selection"}),t[3]=n,t[4]=l,t[5]=i,t[6]=c,t[7]=k):k=t[7];let b;t[8]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("div",{className:"h-4 w-px bg-border"}),t[8]=b):b=t[8];let v;t[9]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(pe,{size:14}),t[9]=v):v=t[9];let d;t[10]!==r?(d=s.jsxs(E,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",onClick:r,children:[v,"Delete"]}),t[10]=r,t[11]=d):d=t[11];let O;t[12]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx("div",{className:"h-4 w-px bg-border"}),t[12]=O):O=t[12];let S;t[13]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(dt,{size:14}),t[13]=S):S=t[13];let m;t[14]!==x?(m=s.jsxs(E,{variant:"ghost",size:"sm",onClick:x,children:[S,"Cancel"]}),t[14]=x,t[15]=m):m=t[15];let C;return t[16]!==g||t[17]!==k||t[18]!==d||t[19]!==m?(C=s.jsxs("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2 flex items-center gap-3 rounded-xl border border-border bg-background/95 backdrop-blur px-4 py-2.5 shadow-lg",children:[g,u,k,b,d,O,m]}),t[16]=g,t[17]=k,t[18]=d,t[19]=m,t[20]=C):C=t[20],C}function ls(e){const t=xe.c(37),{columns:n,grouped:c,sortKey:i,sortDirection:l,onSort:r,onRowClick:x,selectionMode:g,selectedIds:u,onToggleSelect:k,emptyState:b}=e;let v;t[0]===Symbol.for("react.memo_cache_sentinel")?(v=new Set,t[0]=v):v=t[0];const[d,O]=K.useState(v);let S;t[1]===Symbol.for("react.memo_cache_sentinel")?(S=p=>{O(f=>{const h=new Set(f);return h.has(p)?h.delete(p):h.add(p),h})},t[1]=S):S=t[1];const m=S;if(c.length===0&&b){let p;return t[2]!==b?(p=s.jsx("div",{className:"flex items-center justify-center h-full",children:b}),t[2]=b,t[3]=p):p=t[3],p}const C=n.length;let A;if(t[4]!==C||t[5]!==n||t[6]!==r||t[7]!==l||t[8]!==i){let p;t[10]!==C||t[11]!==r||t[12]!==l||t[13]!==i?(p=(f,h)=>{const $=i===f.id,z=h===C-1;return s.jsx(Ht,{className:V("px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider",z&&"w-8","group transition-colors select-none",f.sortable&&"hover:bg-accent cursor-pointer",f.cellClassName),onClick:f.sortable&&r?()=>r(f.id):void 0,children:s.jsxs("span",{className:"flex items-center gap-1",children:[f.header,f.sortable&&s.jsx("span",{className:"w-4 flex items-center justify-center",children:$&&l&&(l==="asc"?s.jsx(qt,{size:16,className:"text-muted-foreground"}):s.jsx(Jt,{size:16,className:"text-muted-foreground"}))})]})},f.id)},t[10]=C,t[11]=r,t[12]=l,t[13]=i,t[14]=p):p=t[14],A=n.map(p),t[4]=C,t[5]=n,t[6]=r,t[7]=l,t[8]=i,t[9]=A}else A=t[9];let P;t[15]!==A?(P=s.jsx(Ut,{className:"border-b-0",children:s.jsx(Oe,{className:"h-9 hover:bg-transparent border-b border-border",children:A})}),t[15]=A,t[16]=P):P=t[16];let M;if(t[17]!==n||t[18]!==d||t[19]!==c||t[20]!==x||t[21]!==k||t[22]!==u||t[23]!==g){let p;t[25]!==n||t[26]!==d||t[27]!==x||t[28]!==k||t[29]!==u||t[30]!==g?(p=f=>{if(f.type==="single"){const o=f.agent;return s.jsx(Oe,{className:V("group/data-row transition-colors border-b-0 hover:bg-accent/50 cursor-pointer",g&&u.has(o.id)&&"bg-primary/5"),onClick:()=>x(o),children:n.map(N=>s.jsx(H,{className:V("px-5 py-4 h-16 align-middle text-sm text-foreground",N.cellClassName),children:s.jsx("div",{className:"min-w-0 w-full truncate overflow-hidden whitespace-nowrap",children:N.render?N.render(o):null})},N.id))},o.id)}const h=f,$=d.has(h.key),z=h.agents.every(o=>u.has(o.id)),I=h.agents.some(o=>u.has(o.id)),B=mt(h.agents),a=h.agents.reduce(cs,h.agents[0]);return s.jsxs(K.Fragment,{children:[s.jsx(Oe,{className:"border-b-0 hover:bg-accent/50 cursor-pointer transition-colors",onClick:()=>m(h.key),children:n.map(o=>{const N=V("px-5 py-3 h-14 align-middle text-sm",o.cellClassName);if(o.id==="select")return s.jsx(H,{className:N,children:s.jsx(Ie,{checked:z?!0:I?"indeterminate":!1,onCheckedChange:()=>{for(const _ of h.agents)z?u.has(_.id)&&k(_.id):u.has(_.id)||k(_.id)},onClick:os})},o.id);if(o.id==="title")return s.jsx(H,{className:N,children:s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx(ce,{icon:h.icon,name:h.title,size:"sm"}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:h.title}),s.jsxs(J,{variant:"secondary",className:"text-xs tabular-nums",children:["x",h.agents.length]})]})},o.id);if(o.id==="updated_by")return s.jsx(H,{className:N,children:s.jsx("div",{className:"flex items-center -space-x-1.5",children:B.map(_=>s.jsx(me,{id:_,size:"3xs",avatarOnly:B.length>1},_))})},o.id);if(o.id==="updated_at"){const _=a.updated_at??a.created_at;return s.jsx(H,{className:N,children:s.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:_?he(new Date(_)):"—"})},o.id)}return o.id==="actions"?s.jsx(H,{className:N,children:s.jsx(Qt,{size:16,className:V("text-muted-foreground transition-transform",$&&"rotate-180")})},o.id):s.jsx(H,{className:N},o.id)})}),$&&h.agents.map(o=>s.jsx(Oe,{className:V("group/data-row transition-colors border-b-0 hover:bg-accent/50 cursor-pointer bg-muted/20",g&&u.has(o.id)&&"bg-primary/5"),onClick:()=>x(o),children:n.map(N=>s.jsx(H,{className:V("px-5 py-3 h-14 align-middle text-sm text-foreground",N.cellClassName,N.id==="title"&&"pl-12"),children:s.jsx("div",{className:"min-w-0 w-full truncate overflow-hidden whitespace-nowrap",children:N.render?N.render(o):null})},N.id))},o.id))]},h.key)},t[25]=n,t[26]=d,t[27]=x,t[28]=k,t[29]=u,t[30]=g,t[31]=p):p=t[31],M=c.map(p),t[17]=n,t[18]=d,t[19]=c,t[20]=x,t[21]=k,t[22]=u,t[23]=g,t[24]=M}else M=t[24];let D;t[32]!==M?(D=s.jsx(Ft,{children:M}),t[32]=M,t[33]=D):D=t[33];let T;return t[34]!==P||t[35]!==D?(T=s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsxs(Lt,{className:"w-full border-collapse",children:[P,D]})}),t[34]=P,t[35]=D,t[36]=T):T=t[36],T}function os(e){return e.stopPropagation()}function cs(e,t){const n=t.updated_at??t.created_at,c=e.updated_at??e.created_at;return n?c?new Date(n)>new Date(c)?t:e:t:e}function ds(){const e=xe.c(130),{org:t}=ft(),n=pt();let c;e[0]!==t.slug?(c={namespace:t.slug,resource:"agents",defaultViewMode:"cards"},e[0]=t.slug,e[1]=c):c=e[1];const i=$t(c),l=Ot(i);let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r={navigateOnCreate:!0},e[2]=r):r=e[2];const{createVirtualMCP:x,isCreating:g}=Pt(r),u=Bt();let k;e[3]===Symbol.for("react.memo_cache_sentinel")?(k={mode:"idle"},e[3]=k):k=e[3];const[b,v]=K.useReducer(Zt,k),[d,O]=K.useState(!1);let S;e[4]===Symbol.for("react.memo_cache_sentinel")?(S=new Set,e[4]=S):S=e[4];const[m,C]=K.useState(S),[A,P]=K.useState(!1);let M;e[5]===Symbol.for("react.memo_cache_sentinel")?(M=R=>{C(F=>{const w=new Set(F);return w.has(R)?w.delete(R):w.add(R),w})},e[5]=M):M=e[5];const D=M;let T;e[6]===Symbol.for("react.memo_cache_sentinel")?(T=()=>{O(!1),C(new Set)},e[6]=T):T=e[6];const p=T,f=l;let h,$,z,I,B,a,o;if(e[7]!==u||e[8]!==A||e[9]!==x||e[10]!==b.mode||e[11]!==b.virtualMcp||e[12]!==f||e[13]!==g||e[14]!==i||e[15]!==n||e[16]!==t.slug||e[17]!==m||e[18]!==d||e[19]!==l){const R=Yt(f),F=l.length;let w;e[27]!==l?(w=l.filter(ks),e[27]=l,e[28]=w):w=e[28];const ht=w.length;let Q;e[29]!==l?(Q=l.filter(ys),e[29]=l,e[30]=Q):Q=e[30];let ge;e[31]!==w.length||e[32]!==Q.length||e[33]!==l.length?(ge={total:F,active:ht,inactive:Q.length},e[31]=w.length,e[32]=Q.length,e[33]=l.length,e[34]=ge):ge=e[34];const L=ge;let je;e[35]!==u||e[36]!==b.mode||e[37]!==b.virtualMcp?(je=async()=>{if(b.mode!=="deleting")return;const j=b.virtualMcp.id;if(v({type:"close"}),!(!j||de(j)))try{await u.delete.mutateAsync(j)}catch{}},e[35]=u,e[36]=b.mode,e[37]=b.virtualMcp,e[38]=je):je=e[38];const He=je;let be;e[39]!==u||e[40]!==m?(be=async()=>{P(!1);let j=0;for(const y of m)if(!de(y))try{await u.delete.mutateAsync(y),j++}catch{}gt.success(`Deleted ${j} agent${j!==1?"s":""}`),p()},e[39]=u,e[40]=m,e[41]=be):be=e[41];const Ue=be;let ve;e[42]!==n||e[43]!==t.slug||e[44]!==d?(ve=j=>{if(d){D(j);return}n({to:"/$org/$project/agents/$agentId",params:{org:t.slug,project:jt,agentId:j}})},e[42]=n,e[43]=t.slug,e[44]=d,e[45]=ve):ve=e[45];const q=ve;let W;e[46]!==m||e[47]!==d?(W=d?[{id:"select",header:"",render:j=>s.jsx(Ie,{checked:m.has(j.id),onCheckedChange:()=>D(j.id),onClick:ws}),cellClassName:"w-10 shrink-0"}]:[],e[46]=m,e[47]=d,e[48]=W):W=e[48];let Ne,Ce,we,ye,ke,Se;e[49]===Symbol.for("react.memo_cache_sentinel")?(Ne={id:"title",header:"Name",render:Cs,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},Ce={id:"description",header:"Description",render:Ns,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},we={id:"connections",header:"Connections",render:bs,cellClassName:"w-28 shrink-0"},ye={id:"status",header:"Status",render:js,cellClassName:"w-24 shrink-0"},ke={id:"updated_by",header:"Updated by",render:gs,cellClassName:"w-32 shrink-0",sortable:!0},Se={id:"updated_at",header:"Updated",render:ps,cellClassName:"max-w-24 w-24 shrink-0",sortable:!0},e[49]=Ne,e[50]=Ce,e[51]=we,e[52]=ye,e[53]=ke,e[54]=Se):(Ne=e[49],Ce=e[50],we=e[51],ye=e[52],ke=e[53],Se=e[54]);let X;e[55]!==q?(X={id:"actions",header:"",render:j=>s.jsxs(Ee,{children:[s.jsx(Re,{asChild:!0,children:s.jsx(E,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:fs,children:s.jsx(Ke,{size:20})})}),s.jsxs(Ve,{align:"end",onClick:us,children:[s.jsxs(U,{onClick:y=>{y.stopPropagation(),q(j.id)},children:[s.jsx(Ge,{size:16}),"Open"]}),!de(j.id)&&s.jsxs(U,{variant:"destructive",onClick:y=>{y.stopPropagation(),v({type:"delete",virtualMcp:j})},children:[s.jsx(pe,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"},e[55]=q,e[56]=X):X=e[56];let De;e[57]!==W||e[58]!==X?(De=[...W,Ne,Ce,we,ye,ke,Se,X],e[57]=W,e[58]=X,e[59]=De):De=e[59];const xt=De;let _e;e[60]!==x||e[61]!==g||e[62]!==d?(_e=s.jsx("div",{className:"flex items-center gap-2",children:d?s.jsxs(E,{variant:"ghost",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",onClick:p,children:[s.jsx(dt,{size:14}),"Cancel"]}):s.jsxs(s.Fragment,{children:[s.jsxs(E,{variant:"outline",size:"sm",className:"hidden sm:flex h-7 w-7 px-0 sm:w-auto sm:px-3 rounded-lg text-sm font-medium",onClick:()=>O(!0),children:[s.jsx(Tt,{size:14}),s.jsx("span",{className:"hidden sm:inline",children:"Select"})]}),s.jsxs(E,{onClick:x,size:"sm",className:"h-7 w-7 px-0 sm:w-auto sm:px-3 rounded-lg text-sm font-medium",disabled:g,children:[s.jsx(Xe,{size:14}),s.jsx("span",{className:"hidden sm:inline",children:g?"Creating...":"Create Agent"})]})]})}),e[60]=x,e[61]=g,e[62]=d,e[63]=_e):_e=e[63];const Fe=_e;$=fe;const Le=b.mode==="deleting";let ze;e[64]===Symbol.for("react.memo_cache_sentinel")?(ze=j=>!j&&v({type:"close"}),e[64]=ze):ze=e[64];let Ae;e[65]===Symbol.for("react.memo_cache_sentinel")?(Ae=s.jsx(Ze,{children:"Delete Agent?"}),e[65]=Ae):Ae=e[65];const qe=b.mode==="deleting"&&b.virtualMcp.title;let Y;e[66]!==qe?(Y=s.jsxs(et,{children:[Ae,s.jsxs(tt,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:qe}),"."]})]}),e[66]=qe,e[67]=Y):Y=e[67];let Me;e[68]===Symbol.for("react.memo_cache_sentinel")?(Me=s.jsx(st,{children:"Cancel"}),e[68]=Me):Me=e[68];let Z;e[69]!==He?(Z=s.jsxs(nt,{children:[Me,s.jsx(it,{onClick:He,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[69]=He,e[70]=Z):Z=e[70];let ee;e[71]!==Y||e[72]!==Z?(ee=s.jsxs(at,{children:[Y,Z]}),e[71]=Y,e[72]=Z,e[73]=ee):ee=e[73],e[74]!==Le||e[75]!==ee?(B=s.jsx(rt,{open:Le,onOpenChange:ze,children:ee}),e[74]=Le,e[75]=ee,e[76]=B):B=e[76];const Je=m.size!==1?"s":"";let te;e[77]!==m.size||e[78]!==Je?(te=s.jsxs(Ze,{children:["Delete ",m.size," agent",Je,"?"]}),e[77]=m.size,e[78]=Je,e[79]=te):te=e[79];let Te;e[80]===Symbol.for("react.memo_cache_sentinel")?(Te=s.jsx(tt,{children:"This action cannot be undone. This will permanently delete the selected agents."}),e[80]=Te):Te=e[80];let se;e[81]!==te?(se=s.jsxs(et,{children:[te,Te]}),e[81]=te,e[82]=se):se=e[82];let $e;e[83]===Symbol.for("react.memo_cache_sentinel")?($e=s.jsx(st,{children:"Cancel"}),e[83]=$e):$e=e[83];let ne;e[84]!==Ue?(ne=s.jsxs(nt,{children:[$e,s.jsx(it,{onClick:Ue,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[84]=Ue,e[85]=ne):ne=e[85];let ie;e[86]!==se||e[87]!==ne?(ie=s.jsxs(at,{children:[se,ne]}),e[86]=se,e[87]=ne,e[88]=ie):ie=e[88],e[89]!==A||e[90]!==ie?(a=s.jsx(rt,{open:A,onOpenChange:P,children:ie}),e[89]=A,e[90]=ie,e[91]=a):a=e[91];const Qe=L.active>0&&` · ${L.active} active`,We=L.inactive>0&&` · ${L.inactive} inactive`;let ae;e[92]!==L.total||e[93]!==Qe||e[94]!==We?(ae=s.jsx(fe.Header.Left,{children:s.jsx(St,{children:s.jsx(Dt,{children:s.jsx(_t,{children:s.jsxs(zt,{className:"flex items-center gap-2",children:["Agents",s.jsxs("span",{className:"hidden sm:inline text-xs font-normal text-muted-foreground tabular-nums",children:[L.total," total",Qe,We]})]})})})})}),e[92]=L.total,e[93]=Qe,e[94]=We,e[95]=ae):ae=e[95];let Pe;e[96]===Symbol.for("react.memo_cache_sentinel")?(Pe=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],e[96]=Pe):Pe=e[96];let re;e[97]!==i.handleSort||e[98]!==i.setViewMode||e[99]!==i.sortDirection||e[100]!==i.sortKey||e[101]!==i.viewMode?(re=s.jsx(bt,{viewMode:i.viewMode,onViewModeChange:i.setViewMode,sortKey:i.sortKey,sortDirection:i.sortDirection,onSort:i.handleSort,sortOptions:Pe}),e[97]=i.handleSort,e[98]=i.setViewMode,e[99]=i.sortDirection,e[100]=i.sortKey,e[101]=i.viewMode,e[102]=re):re=e[102];let le;e[103]!==Fe||e[104]!==re?(le=s.jsxs(fe.Header.Right,{children:[re,Fe]}),e[103]=Fe,e[104]=re,e[105]=le):le=e[105],e[106]!==ae||e[107]!==le?(o=s.jsxs(fe.Header,{children:[ae,le]}),e[106]=ae,e[107]=le,e[108]=o):o=e[108];let oe;e[109]!==i?(oe=j=>{j.key==="Escape"&&(i.setSearch(""),j.target.blur())},e[109]=i,e[110]=oe):oe=e[110],e[111]!==i.search||e[112]!==i.setSearch||e[113]!==oe?(z=s.jsx("div",{className:"flex items-center gap-3 px-5 pb-0",children:s.jsx("div",{className:"flex-1",children:s.jsx(vt,{value:i.search,onChange:i.setSearch,placeholder:"Search for an agent...",onKeyDown:oe})})}),e[111]=i.search,e[112]=i.setSearch,e[113]=oe,e[114]=z):z=e[114],h=fe.Content,I=i.viewMode==="cards"?s.jsx("div",{className:"flex-1 overflow-auto p-5",children:f.length===0?s.jsx("div",{className:"flex items-center justify-center min-h-[60vh]",children:s.jsx(Ye,{image:s.jsx(Be,{size:48,className:"text-muted-foreground"}),title:i.search?"No agents found":"No agents yet",description:i.search?`No agents match "${i.search}"`:"Create an agent to aggregate tools from multiple Connections.",actions:!i.search&&s.jsxs(E,{size:"sm",onClick:x,disabled:g,children:[s.jsx(Xe,{size:14}),g?"Creating...":"Create Agent"]})})}):s.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:R.map(j=>{if(j.type==="group")return s.jsx(es,{group:j,onNavigate:q,onDelete:ue=>v({type:"delete",virtualMcp:ue}),selectionMode:d,selectedIds:m,onToggleSelect:D},j.key);const y=j.agent;return s.jsxs("div",{className:"relative",children:[d&&s.jsx("div",{className:"absolute top-3 left-3 z-10",children:s.jsx(Ie,{checked:m.has(y.id),onCheckedChange:()=>D(y.id)})}),s.jsx(ct,{connection:{id:y.id??"",title:y.title,description:y.description,icon:y.icon,status:y.status},fallbackIcon:s.jsx(Be,{}),onClick:()=>q(y.id),className:V(d&&m.has(y.id)&&"ring-2 ring-primary"),footer:s.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground w-full min-w-0",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(me,{id:y.updated_by??y.created_by,size:"3xs"})}),s.jsx("span",{className:"shrink-0 ml-2",children:y.updated_at?he(new Date(y.updated_at)):"—"})]}),headerActions:d?void 0:s.jsxs(Ee,{children:[s.jsx(Re,{asChild:!0,children:s.jsx(E,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:xs,children:s.jsx(Ke,{size:20})})}),s.jsxs(Ve,{align:"end",onClick:hs,children:[s.jsxs(U,{onClick:ue=>{ue.stopPropagation(),q(y.id)},children:[s.jsx(Ge,{size:16}),"Open"]}),!de(y.id)&&s.jsxs(U,{variant:"destructive",onClick:ue=>{ue.stopPropagation(),v({type:"delete",virtualMcp:y})},children:[s.jsx(pe,{size:16}),"Delete"]})]})]})})]},y.id)})})}):s.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:s.jsx("div",{className:"flex-1 overflow-auto min-w-0",children:R.length===0?s.jsx("div",{className:"flex items-center justify-center min-h-[60vh]",children:s.jsx(Ye,{image:s.jsx(Be,{size:48,className:"text-muted-foreground"}),title:i.search?"No agents found":"No agents yet",description:i.search?`No agents match "${i.search}"`:"Create an agent to aggregate tools from multiple Connections.",actions:!i.search&&s.jsxs(E,{size:"sm",onClick:x,disabled:g,children:[s.jsx(Xe,{size:14}),g?"Creating...":"Create Agent"]})})}):s.jsx("div",{className:"min-w-[1000px]",children:s.jsx(ls,{columns:xt,grouped:R,sortKey:i.sortKey,sortDirection:i.sortDirection,onSort:i.handleSort,onRowClick:j=>q(j.id),selectionMode:d,selectedIds:m,onToggleSelect:D})})})}),e[7]=u,e[8]=A,e[9]=x,e[10]=b.mode,e[11]=b.virtualMcp,e[12]=f,e[13]=g,e[14]=i,e[15]=n,e[16]=t.slug,e[17]=m,e[18]=d,e[19]=l,e[20]=h,e[21]=$,e[22]=z,e[23]=I,e[24]=B,e[25]=a,e[26]=o}else h=e[20],$=e[21],z=e[22],I=e[23],B=e[24],a=e[25],o=e[26];let N;e[115]!==h||e[116]!==I?(N=s.jsx(h,{children:I}),e[115]=h,e[116]=I,e[117]=N):N=e[117];let _;e[118]!==f||e[119]!==m.size||e[120]!==d?(_=d&&s.jsx(rs,{count:m.size,total:f.length,onSelectAll:()=>C(new Set(f.map(ms))),onDeselectAll:()=>C(new Set),onDelete:()=>P(!0),onCancel:p}),e[118]=f,e[119]=m.size,e[120]=d,e[121]=_):_=e[121];let G;return e[122]!==$||e[123]!==z||e[124]!==N||e[125]!==_||e[126]!==B||e[127]!==a||e[128]!==o?(G=s.jsxs($,{children:[B,a,o,z,N,_]}),e[122]=$,e[123]=z,e[124]=N,e[125]=_,e[126]=B,e[127]=a,e[128]=o,e[129]=G):G=e[129],G}function ms(e){return e.id}function hs(e){return e.stopPropagation()}function xs(e){return e.stopPropagation()}function us(e){return e.stopPropagation()}function fs(e){return e.stopPropagation()}function ps(e){return s.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:e.updated_at?he(new Date(e.updated_at)):"—"})}function gs(e){return s.jsx(me,{id:e.updated_by??e.created_by,size:"3xs"})}function js(e){return s.jsx(Xt,{status:e.status})}function bs(e){return s.jsx(K.Suspense,{fallback:s.jsx(lt.Fallback,{}),children:s.jsx(lt,{connectionIds:e.connections.map(vs),maxVisibleIcons:2})})}function vs(e){return e.connection_id}function Ns(e){return s.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function Cs(e){return s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx(ce,{icon:e.icon,name:e.title,size:"sm"}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})]})}function ws(e){return e.stopPropagation()}function ys(e){return e.status==="inactive"}function ks(e){return e.status==="active"}function zn(){const e=xe.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(ut,{children:s.jsx(K.Suspense,{fallback:s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx(Wt,{size:32,className:"animate-spin text-muted-foreground"})}),children:s.jsx(ds,{})})}),e[0]=t):t=e[0],t}export{zn as default};
@@ -1 +1 @@
1
- import{d as b,c as g,z as P,K as h}from"./index-D49VqQ7Q.js";import{u as S}from"./useQuery-CvkH2gG1.js";import{a as u,u as _}from"./constants-TLV7MTwP.js";function E(){const c=b.c(9),{locator:e,org:i}=g();let o;c[0]!==i.id?(o={connectionId:u,orgId:i.id},c[0]=i.id,c[1]=o):o=c[1];const d=_(o);let a;c[2]!==e?(a=h.aiProviders(e),c[2]=e,c[3]=a):a=c[3];let s;c[4]!==d?(s=async()=>(await d.callTool({name:"AI_PROVIDERS_LIST",arguments:{}})).structuredContent,c[4]=d,c[5]=s):s=c[5];let t;c[6]!==a||c[7]!==s?(t={queryKey:a,staleTime:1/0,queryFn:s},c[6]=a,c[7]=s,c[8]=t):t=c[8];const{data:n}=P(t);return n}function C(){const c=b.c(11),{locator:e,org:i}=g();let o;c[0]!==i.id?(o={connectionId:u,orgId:i.id},c[0]=i.id,c[1]=o):o=c[1];const d=_(o);let a;c[2]!==e?(a=h.aiProviderKeys(e),c[2]=e,c[3]=a):a=c[3];let s;c[4]!==d?(s=async()=>(await d.callTool({name:"AI_PROVIDER_KEY_LIST",arguments:{}})).structuredContent??null,c[4]=d,c[5]=s):s=c[5];let t;c[6]!==a||c[7]!==s?(t={queryKey:a,staleTime:6e4,queryFn:s},c[6]=a,c[7]=s,c[8]=t):t=c[8];const{data:n}=P(t);let m;return c[9]!==n?.keys?(m=n?.keys??[],c[9]=n?.keys,c[10]=m):m=c[10],m}function q(c){const e=b.c(17),{locator:i,org:o}=g();let d;e[0]!==o.id?(d={connectionId:u,orgId:o.id},e[0]=o.id,e[1]=d):d=e[1];const a=_(d);let s;e[2]!==c||e[3]!==i?(s=h.aiProviderModels(i,c??""),e[2]=c,e[3]=i,e[4]=s):s=e[4];const t=!!c;let n;e[5]!==a||e[6]!==c?(n=async()=>(await a.callTool({name:"AI_PROVIDERS_LIST_MODELS",arguments:{keyId:c}})).structuredContent??null,e[5]=a,e[6]=c,e[7]=n):n=e[7];let m;e[8]!==s||e[9]!==t||e[10]!==n?(m={queryKey:s,enabled:t,staleTime:6e4,queryFn:n},e[8]=s,e[9]=t,e[10]=n,e[11]=m):m=e[11];const{data:f,isLoading:I}=S(m);let l;e[12]!==f?.models?(l=f?.models??[],e[12]=f?.models,e[13]=l):l=e[13];const v=!!c&&I;let p;return e[14]!==l||e[15]!==v?(p={models:l,isLoading:v},e[14]=l,e[15]=v,e[16]=p):p=e[16],p}function D(c){const e=b.c(13),{locator:i,org:o}=g();let d;e[0]!==o.id?(d={connectionId:u,orgId:o.id},e[0]=o.id,e[1]=d):d=e[1];const a=_(d);let s;e[2]!==c||e[3]!==i?(s=h.aiProviderModels(i,c),e[2]=c,e[3]=i,e[4]=s):s=e[4];let t;e[5]!==a||e[6]!==c?(t=async()=>(await a.callTool({name:"AI_PROVIDERS_LIST_MODELS",arguments:{keyId:c}})).structuredContent??null,e[5]=a,e[6]=c,e[7]=t):t=e[7];let n;e[8]!==s||e[9]!==t?(n={queryKey:s,staleTime:6e4,queryFn:t},e[8]=s,e[9]=t,e[10]=n):n=e[10];const{data:m}=P(n);let f;return e[11]!==m?.models?(f=m?.models??[],e[11]=m?.models,e[12]=f):f=e[12],f}const r="https://assets.decocache.com/decocms/bc2ca488-2bae-4aac-8d3e-ead262dad764/agent.png",L="https://assets.decocache.com/decocms/b2e2f64f-6025-45f7-9e8c-3b3ebdd073d8/openrouter_logojpg.jpg",O="https://assets.decocache.com/decocms/51a209ae-14bc-4b6f-8216-8eb670695bd7/Anthropic-Icon--Streamline-Svg-Logos.svg";function j(c){const e=c.modelId.includes("/")?c.modelId.split("/")[0]:null;return e&&y[e]||y[c.providerId]||r}const y={"aion-labs":"https://assets.decocache.com/decocms/6da18da8-0160-4b85-8bca-84eefffebe12/images-(6).png",ai21:"https://assets.decocache.com/decocms/5d8388e9-027b-4b23-b816-90cee1cd28ad/images-(5).png",alfredpros:"https://assets.decocache.com/decocms/76eaa620-ce73-43d6-8817-272c1d498b53/images-(19).png",alibaba:"https://assets.decocache.com/decocms/4d113b13-5412-4d3b-96ec-3c2e7c1f7a5f/images-(8).png",allenai:"https://assets.decocache.com/decocms/21d6071a-e0da-4919-9f35-902b1d0b85b8/allen.png",alpindale:"https://assets.decocache.com/decocms/76eaa620-ce73-43d6-8817-272c1d498b53/images-(19).png",amazon:"https://assets.decocache.com/decocms/31e7b260-6cf0-4753-bb32-bd062b15c5f1/Amazon_icon.png",anthropic:O,"claude-code":"https://assets.decocache.com/decocms/2b91e6f8-5151-4b4f-bdf9-037ee769e6ff/Claude_AI_symbol.svg.png","anthracite-org":r,"arcee-ai":"https://assets.decocache.com/decocms/ee325839-6acc-48dc-8cf7-8bab74698015/126496414.png",baidu:"https://assets.decocache.com/decocms/cf4c19f1-39b5-499e-87b7-e16dc5da2b50/images-(9).png",bytedance:"https://assets.decocache.com/decocms/1c111a26-8e1d-4a48-9d3c-fe9fb728af06/images-(18).png","bytedance-seed":"https://assets.decocache.com/decocms/1c111a26-8e1d-4a48-9d3c-fe9fb728af06/images-(18).png",cognitivecomputations:r,cohere:"https://assets.decocache.com/decocms/c942091b-b3bf-4c46-af37-fc2c1086d9f7/cohere-color.png",deepcogito:"https://assets.decocache.com/decocms/4ee77a8f-a36a-4933-8cdf-d2e8676b88d8/images-(13).png",deepseek:"https://assets.decocache.com/decocms/3611e8ac-4cad-4b0e-a1f8-8f791288ce03/images-(1).png",eleutherai:"https://assets.decocache.com/decocms/76eaa620-ce73-43d6-8817-272c1d498b53/images-(19).png",essentialai:"https://assets.decocache.com/decocms/c5afc6de-1e41-457e-a6dd-91810d92541e/images-(1).jpeg",google:"https://assets.decocache.com/webdraw/17df85af-1578-42ef-ae07-4300de0d1723/gemini.svg",gryphe:"https://assets.decocache.com/decocms/a5503d3b-2056-47f2-a76c-611b7416bdc8/6798c7dccaaadd0a1318d66a_66f41d1fd146c3b0b9c76453_gryphe-logo.webp","ibm-granite":"https://assets.decocache.com/decocms/2c50018d-6f70-472d-be30-65a5e8e249f0/images-(10).png",inflection:r,inception:"https://assets.decocache.com/decocms/ff9822b8-a914-482b-bd7d-b0e46b9d5a56/images-(6).jpeg",kwaipilot:"https://assets.decocache.com/decocms/cd576e1d-1184-45ba-8162-cf2bd06d684f/images-(14).png",liquid:r,mancer:"https://assets.decocache.com/decocms/79762356-a0c5-4546-b268-ad4a0b51db51/Screenshot-2026-01-08-at-18.49.42.png",meituan:r,"meta-llama":"https://assets.decocache.com/decocms/56421cb3-488c-4cc3-83a5-16d9a303850e/images-(11).png",microsoft:"https://assets.decocache.com/decocms/0e352a51-4ea5-4f35-802e-fd82bf266683/images-(12).png",minimax:"https://assets.decocache.com/decocms/f362cc4f-7ccc-4317-afda-92e6f348fdfd/images-(2).png",mistralai:"https://assets.decocache.com/decocms/73ab9971-bbbc-40dc-99a3-5fddd9a0f340/images-(3).png",morph:r,moonshotai:"https://assets.decocache.com/decocms/b8abfea7-e8b4-4b72-b653-fdf11c9e3b66/moonshot.png",neversleep:r,"nex-agi":"https://assets.decocache.com/decocms/d2ada265-160d-4959-981d-e90210d71713/241570229.jpeg",nousresearch:"https://assets.decocache.com/decocms/496acb3d-9b5d-4759-b764-16c9ca7eb6b2/nousresearch.png",nvidia:"https://assets.decocache.com/decocms/ecca3238-fa79-4648-bb55-738f13a4293f/nvidia-7.svg",opengvlab:"https://assets.decocache.com/decocms/fb2d0c32-85f1-410a-87f4-9731dfafd248/images-(2).jpeg",openai:"https://assets.decocache.com/webdraw/15dc381c-23b4-4f6b-9ceb-9690f77a7cf5/openai.svg",openrouter:L,perplexity:"https://assets.decocache.com/decocms/3a134746-f370-4089-a3c9-fe545be0441c/images-(15).png","prime-intellect":r,qwen:"https://assets.decocache.com/decocms/ab94208c-4439-4aec-a06c-c51747120e43/Qwen_logo.svg.png",raifle:r,relace:"https://assets.decocache.com/decocms/c5dbae73-3ce0-40ca-8433-c38783fb13a9/Screenshot-2026-01-08-at-18.52.09.png",sao10k:"https://assets.decocache.com/decocms/76eaa620-ce73-43d6-8817-272c1d498b53/images-(19).png","stepfun-ai":"https://assets.decocache.com/decocms/8892b883-4905-444e-b554-648565dc7fab/images-(16).png",switchpoint:"https://assets.decocache.com/decocms/0319d595-e0dd-4d8e-a0a3-b20ff4cbddcb/images-(4).jpeg",tencent:"https://assets.decocache.com/decocms/80f2f7bd-f9ea-4fcf-b89c-c58823a389ed/images-(3).jpeg",thedrummer:"https://assets.decocache.com/decocms/5c6c09fc-cf9d-43a1-a1c3-4a1ef367b824/images-(17).png",thudm:r,tngtech:"https://assets.decocache.com/decocms/5b5648ad-f858-4687-b67b-212cf186b62d/images-(7).png",undi95:r,xiaomi:"https://assets.decocache.com/decocms/2d7191b7-fc80-4867-a431-6d443d691cfc/images-(4).png","x-ai":"https://assets.decocache.com/webdraw/7a8003ff-8f2d-4988-8693-3feb20e87eca/xai.svg","z-ai":"https://assets.decocache.com/decocms/12a0877f-c978-4880-88d1-09097e606e2f/Z.ai_(company_logo).svg.png"};export{r as D,y as P,E as a,C as b,D as c,j as g,q as u};
1
+ import{d as b,c as g,z as P,K as h}from"./index-Y_g6-sbQ.js";import{u as S}from"./useQuery-DKMHT49Q.js";import{a as u,u as _}from"./constants-Cf6w8uWj.js";function E(){const c=b.c(9),{locator:e,org:i}=g();let o;c[0]!==i.id?(o={connectionId:u,orgId:i.id},c[0]=i.id,c[1]=o):o=c[1];const d=_(o);let a;c[2]!==e?(a=h.aiProviders(e),c[2]=e,c[3]=a):a=c[3];let s;c[4]!==d?(s=async()=>(await d.callTool({name:"AI_PROVIDERS_LIST",arguments:{}})).structuredContent,c[4]=d,c[5]=s):s=c[5];let t;c[6]!==a||c[7]!==s?(t={queryKey:a,staleTime:1/0,queryFn:s},c[6]=a,c[7]=s,c[8]=t):t=c[8];const{data:n}=P(t);return n}function C(){const c=b.c(11),{locator:e,org:i}=g();let o;c[0]!==i.id?(o={connectionId:u,orgId:i.id},c[0]=i.id,c[1]=o):o=c[1];const d=_(o);let a;c[2]!==e?(a=h.aiProviderKeys(e),c[2]=e,c[3]=a):a=c[3];let s;c[4]!==d?(s=async()=>(await d.callTool({name:"AI_PROVIDER_KEY_LIST",arguments:{}})).structuredContent??null,c[4]=d,c[5]=s):s=c[5];let t;c[6]!==a||c[7]!==s?(t={queryKey:a,staleTime:6e4,queryFn:s},c[6]=a,c[7]=s,c[8]=t):t=c[8];const{data:n}=P(t);let m;return c[9]!==n?.keys?(m=n?.keys??[],c[9]=n?.keys,c[10]=m):m=c[10],m}function q(c){const e=b.c(17),{locator:i,org:o}=g();let d;e[0]!==o.id?(d={connectionId:u,orgId:o.id},e[0]=o.id,e[1]=d):d=e[1];const a=_(d);let s;e[2]!==c||e[3]!==i?(s=h.aiProviderModels(i,c??""),e[2]=c,e[3]=i,e[4]=s):s=e[4];const t=!!c;let n;e[5]!==a||e[6]!==c?(n=async()=>(await a.callTool({name:"AI_PROVIDERS_LIST_MODELS",arguments:{keyId:c}})).structuredContent??null,e[5]=a,e[6]=c,e[7]=n):n=e[7];let m;e[8]!==s||e[9]!==t||e[10]!==n?(m={queryKey:s,enabled:t,staleTime:6e4,queryFn:n},e[8]=s,e[9]=t,e[10]=n,e[11]=m):m=e[11];const{data:f,isLoading:I}=S(m);let l;e[12]!==f?.models?(l=f?.models??[],e[12]=f?.models,e[13]=l):l=e[13];const v=!!c&&I;let p;return e[14]!==l||e[15]!==v?(p={models:l,isLoading:v},e[14]=l,e[15]=v,e[16]=p):p=e[16],p}function D(c){const e=b.c(13),{locator:i,org:o}=g();let d;e[0]!==o.id?(d={connectionId:u,orgId:o.id},e[0]=o.id,e[1]=d):d=e[1];const a=_(d);let s;e[2]!==c||e[3]!==i?(s=h.aiProviderModels(i,c),e[2]=c,e[3]=i,e[4]=s):s=e[4];let t;e[5]!==a||e[6]!==c?(t=async()=>(await a.callTool({name:"AI_PROVIDERS_LIST_MODELS",arguments:{keyId:c}})).structuredContent??null,e[5]=a,e[6]=c,e[7]=t):t=e[7];let n;e[8]!==s||e[9]!==t?(n={queryKey:s,staleTime:6e4,queryFn:t},e[8]=s,e[9]=t,e[10]=n):n=e[10];const{data:m}=P(n);let f;return e[11]!==m?.models?(f=m?.models??[],e[11]=m?.models,e[12]=f):f=e[12],f}const r="https://assets.decocache.com/decocms/bc2ca488-2bae-4aac-8d3e-ead262dad764/agent.png",L="https://assets.decocache.com/decocms/b2e2f64f-6025-45f7-9e8c-3b3ebdd073d8/openrouter_logojpg.jpg",O="https://assets.decocache.com/decocms/51a209ae-14bc-4b6f-8216-8eb670695bd7/Anthropic-Icon--Streamline-Svg-Logos.svg";function j(c){const e=c.modelId.includes("/")?c.modelId.split("/")[0]:null;return e&&y[e]||y[c.providerId]||r}const y={"aion-labs":"https://assets.decocache.com/decocms/6da18da8-0160-4b85-8bca-84eefffebe12/images-(6).png",ai21:"https://assets.decocache.com/decocms/5d8388e9-027b-4b23-b816-90cee1cd28ad/images-(5).png",alfredpros:"https://assets.decocache.com/decocms/76eaa620-ce73-43d6-8817-272c1d498b53/images-(19).png",alibaba:"https://assets.decocache.com/decocms/4d113b13-5412-4d3b-96ec-3c2e7c1f7a5f/images-(8).png",allenai:"https://assets.decocache.com/decocms/21d6071a-e0da-4919-9f35-902b1d0b85b8/allen.png",alpindale:"https://assets.decocache.com/decocms/76eaa620-ce73-43d6-8817-272c1d498b53/images-(19).png",amazon:"https://assets.decocache.com/decocms/31e7b260-6cf0-4753-bb32-bd062b15c5f1/Amazon_icon.png",anthropic:O,"claude-code":"https://assets.decocache.com/decocms/2b91e6f8-5151-4b4f-bdf9-037ee769e6ff/Claude_AI_symbol.svg.png","anthracite-org":r,"arcee-ai":"https://assets.decocache.com/decocms/ee325839-6acc-48dc-8cf7-8bab74698015/126496414.png",baidu:"https://assets.decocache.com/decocms/cf4c19f1-39b5-499e-87b7-e16dc5da2b50/images-(9).png",bytedance:"https://assets.decocache.com/decocms/1c111a26-8e1d-4a48-9d3c-fe9fb728af06/images-(18).png","bytedance-seed":"https://assets.decocache.com/decocms/1c111a26-8e1d-4a48-9d3c-fe9fb728af06/images-(18).png",cognitivecomputations:r,cohere:"https://assets.decocache.com/decocms/c942091b-b3bf-4c46-af37-fc2c1086d9f7/cohere-color.png",deepcogito:"https://assets.decocache.com/decocms/4ee77a8f-a36a-4933-8cdf-d2e8676b88d8/images-(13).png",deepseek:"https://assets.decocache.com/decocms/3611e8ac-4cad-4b0e-a1f8-8f791288ce03/images-(1).png",eleutherai:"https://assets.decocache.com/decocms/76eaa620-ce73-43d6-8817-272c1d498b53/images-(19).png",essentialai:"https://assets.decocache.com/decocms/c5afc6de-1e41-457e-a6dd-91810d92541e/images-(1).jpeg",google:"https://assets.decocache.com/webdraw/17df85af-1578-42ef-ae07-4300de0d1723/gemini.svg",gryphe:"https://assets.decocache.com/decocms/a5503d3b-2056-47f2-a76c-611b7416bdc8/6798c7dccaaadd0a1318d66a_66f41d1fd146c3b0b9c76453_gryphe-logo.webp","ibm-granite":"https://assets.decocache.com/decocms/2c50018d-6f70-472d-be30-65a5e8e249f0/images-(10).png",inflection:r,inception:"https://assets.decocache.com/decocms/ff9822b8-a914-482b-bd7d-b0e46b9d5a56/images-(6).jpeg",kwaipilot:"https://assets.decocache.com/decocms/cd576e1d-1184-45ba-8162-cf2bd06d684f/images-(14).png",liquid:r,mancer:"https://assets.decocache.com/decocms/79762356-a0c5-4546-b268-ad4a0b51db51/Screenshot-2026-01-08-at-18.49.42.png",meituan:r,"meta-llama":"https://assets.decocache.com/decocms/56421cb3-488c-4cc3-83a5-16d9a303850e/images-(11).png",microsoft:"https://assets.decocache.com/decocms/0e352a51-4ea5-4f35-802e-fd82bf266683/images-(12).png",minimax:"https://assets.decocache.com/decocms/f362cc4f-7ccc-4317-afda-92e6f348fdfd/images-(2).png",mistralai:"https://assets.decocache.com/decocms/73ab9971-bbbc-40dc-99a3-5fddd9a0f340/images-(3).png",morph:r,moonshotai:"https://assets.decocache.com/decocms/b8abfea7-e8b4-4b72-b653-fdf11c9e3b66/moonshot.png",neversleep:r,"nex-agi":"https://assets.decocache.com/decocms/d2ada265-160d-4959-981d-e90210d71713/241570229.jpeg",nousresearch:"https://assets.decocache.com/decocms/496acb3d-9b5d-4759-b764-16c9ca7eb6b2/nousresearch.png",nvidia:"https://assets.decocache.com/decocms/ecca3238-fa79-4648-bb55-738f13a4293f/nvidia-7.svg",opengvlab:"https://assets.decocache.com/decocms/fb2d0c32-85f1-410a-87f4-9731dfafd248/images-(2).jpeg",openai:"https://assets.decocache.com/webdraw/15dc381c-23b4-4f6b-9ceb-9690f77a7cf5/openai.svg",openrouter:L,perplexity:"https://assets.decocache.com/decocms/3a134746-f370-4089-a3c9-fe545be0441c/images-(15).png","prime-intellect":r,qwen:"https://assets.decocache.com/decocms/ab94208c-4439-4aec-a06c-c51747120e43/Qwen_logo.svg.png",raifle:r,relace:"https://assets.decocache.com/decocms/c5dbae73-3ce0-40ca-8433-c38783fb13a9/Screenshot-2026-01-08-at-18.52.09.png",sao10k:"https://assets.decocache.com/decocms/76eaa620-ce73-43d6-8817-272c1d498b53/images-(19).png","stepfun-ai":"https://assets.decocache.com/decocms/8892b883-4905-444e-b554-648565dc7fab/images-(16).png",switchpoint:"https://assets.decocache.com/decocms/0319d595-e0dd-4d8e-a0a3-b20ff4cbddcb/images-(4).jpeg",tencent:"https://assets.decocache.com/decocms/80f2f7bd-f9ea-4fcf-b89c-c58823a389ed/images-(3).jpeg",thedrummer:"https://assets.decocache.com/decocms/5c6c09fc-cf9d-43a1-a1c3-4a1ef367b824/images-(17).png",thudm:r,tngtech:"https://assets.decocache.com/decocms/5b5648ad-f858-4687-b67b-212cf186b62d/images-(7).png",undi95:r,xiaomi:"https://assets.decocache.com/decocms/2d7191b7-fc80-4867-a431-6d443d691cfc/images-(4).png","x-ai":"https://assets.decocache.com/webdraw/7a8003ff-8f2d-4988-8693-3feb20e87eca/xai.svg","z-ai":"https://assets.decocache.com/decocms/12a0877f-c978-4880-88d1-09097e606e2f/Z.ai_(company_logo).svg.png"};export{r as D,y as P,E as a,C as b,D as c,j as g,q as u};
@@ -1,4 +1,4 @@
1
- import{j as r,ac as w,r as n,a0 as m,bi as O,ad as M,a2 as I,ae as z,af as F,ai as A,bj as D,ag as L,bk as k,a5 as G,aj as H,ah as V,d as i,y as p,bl as v}from"./index-D49VqQ7Q.js";var x="AlertDialog",[W]=G(x,[D]),d=D(),N=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(w,{...a,...t,modal:!0})};N.displayName=x;var Y="AlertDialogTrigger",y=n.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(H,{...o,...a,ref:e})});y.displayName=Y;var q="AlertDialogPortal",j=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(L,{...a,...t})};j.displayName=q;var B="AlertDialogOverlay",_=n.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(V,{...o,...a,ref:e})});_.displayName=B;var g="AlertDialogContent",[J,K]=W(g),Q=k("AlertDialogContent"),b=n.forwardRef((l,e)=>{const{__scopeAlertDialog:t,children:a,...o}=l,s=d(t),c=n.useRef(null),T=m(e,c),u=n.useRef(null);return r.jsx(O,{contentName:g,titleName:h,docsSlug:"alert-dialog",children:r.jsx(J,{scope:t,cancelRef:u,children:r.jsxs(M,{role:"alertdialog",...s,...o,ref:T,onOpenAutoFocus:I(o.onOpenAutoFocus,f=>{f.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[r.jsx(Q,{children:a}),r.jsx(X,{contentRef:c})]})})})});b.displayName=g;var h="AlertDialogTitle",$=n.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(z,{...o,...a,ref:e})});$.displayName=h;var E="AlertDialogDescription",R=n.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(F,{...o,...a,ref:e})});R.displayName=E;var U="AlertDialogAction",C=n.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(A,{...o,...a,ref:e})});C.displayName=U;var S="AlertDialogCancel",P=n.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,{cancelRef:o}=K(S,t),s=d(t),c=m(e,o);return r.jsx(A,{...s,...a,ref:c})});P.displayName=S;var X=({contentRef:l})=>{const e=`\`${g}\` requires a description for the component to be accessible for screen reader users.
1
+ import{j as r,ac as w,r as n,a0 as m,bi as O,ad as M,a2 as I,ae as z,af as F,ai as A,bj as D,ag as L,bk as k,a5 as G,aj as H,ah as V,d as i,y as p,bl as v}from"./index-Y_g6-sbQ.js";var x="AlertDialog",[W]=G(x,[D]),d=D(),N=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(w,{...a,...t,modal:!0})};N.displayName=x;var Y="AlertDialogTrigger",y=n.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(H,{...o,...a,ref:e})});y.displayName=Y;var q="AlertDialogPortal",j=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(L,{...a,...t})};j.displayName=q;var B="AlertDialogOverlay",_=n.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(V,{...o,...a,ref:e})});_.displayName=B;var g="AlertDialogContent",[J,K]=W(g),Q=k("AlertDialogContent"),b=n.forwardRef((l,e)=>{const{__scopeAlertDialog:t,children:a,...o}=l,s=d(t),c=n.useRef(null),T=m(e,c),u=n.useRef(null);return r.jsx(O,{contentName:g,titleName:h,docsSlug:"alert-dialog",children:r.jsx(J,{scope:t,cancelRef:u,children:r.jsxs(M,{role:"alertdialog",...s,...o,ref:T,onOpenAutoFocus:I(o.onOpenAutoFocus,f=>{f.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[r.jsx(Q,{children:a}),r.jsx(X,{contentRef:c})]})})})});b.displayName=g;var h="AlertDialogTitle",$=n.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(z,{...o,...a,ref:e})});$.displayName=h;var E="AlertDialogDescription",R=n.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(F,{...o,...a,ref:e})});R.displayName=E;var U="AlertDialogAction",C=n.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(A,{...o,...a,ref:e})});C.displayName=U;var S="AlertDialogCancel",P=n.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,{cancelRef:o}=K(S,t),s=d(t),c=m(e,o);return r.jsx(A,{...s,...a,ref:c})});P.displayName=S;var X=({contentRef:l})=>{const e=`\`${g}\` requires a description for the component to be accessible for screen reader users.
2
2
 
3
3
  You can add a description to the \`${g}\` by passing a \`${E}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
4
4
 
@@ -1 +1 @@
1
- import{d as l,k as m,j as t,A as f,S as h,l as x,m as r,n as p,N as u}from"./index-D49VqQ7Q.js";function d(){const e=l.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(u,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function g(){const e=l.c(6);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=m(a);if(n==="accept-invitation"){let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(f,{children:t.jsx(h,{})}),e[1]=c):c=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(x,{children:t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(r,{pathname:"accept-invitation"})})}),e[2]=i):i=e[2];let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs(t.Fragment,{children:[c,i,t.jsx(p,{children:t.jsx(d,{})})]}),e[3]=o):o=e[3],o}let s;return e[4]!==n?(s=t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(r,{pathname:n})}),e[4]=n,e[5]=s):s=e[5],s}export{g as default};
1
+ import{d as l,k as m,j as t,A as f,S as h,l as x,m as r,n as p,N as u}from"./index-Y_g6-sbQ.js";function d(){const e=l.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(u,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function g(){const e=l.c(6);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=m(a);if(n==="accept-invitation"){let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(f,{children:t.jsx(h,{})}),e[1]=c):c=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(x,{children:t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(r,{pathname:"accept-invitation"})})}),e[2]=i):i=e[2];let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs(t.Fragment,{children:[c,i,t.jsx(p,{children:t.jsx(d,{})})]}),e[3]=o):o=e[3],o}let s;return e[4]!==n?(s=t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(r,{pathname:n})}),e[4]=n,e[5]=s):s=e[5],s}export{g as default};
@@ -1 +1 @@
1
- import{d as B,k as ve,f as be,c as ie,r as T,j as t,H as _e,O as X,w as I,B as U,v as Ce,J as Ne,x as Se,K as G}from"./index-D49VqQ7Q.js";import{E as le}from"./empty-state-B8NhLY9v.js";import{a as ce,V as we}from"./layout-Dp8uiQPy.js";import{S as ke}from"./save-actions-BENpgKCD.js";import{u as De}from"./ai-providers-logos-idzpcoUr.js";import{T as Ae,a as Te,M as Ie,S as Z}from"./task-status-RaaIa42V.js";import{V as ee}from"./select-virtual-mcp-CjfXEnho.js";import{I as Me,e as Ee,t as te}from"./integration-icon-ByIZ-Vgj.js";import{U as $e}from"./user-DXILGeu2.js";import{c as ze,b as Oe,d as Re,e as J,f as Pe}from"./use-automations-DhJnP2CA.js";import{a as de}from"./index-CtkIjbbq.js";import{b as me,d as ue,c as pe,A as fe,e as xe,h as he,a as ge,f as ye}from"./alert-dialog-Bke1xnyn.js";import{b as se,d as Ve,c as Fe,e as Le,B as Ue,a as Be}from"./breadcrumb-BBMvtdg-.js";import{I as He}from"./input-BoNWsfmK.js";import{c as re,a as Ke,d as We,e as qe,f as Ge,b as Je,D as Qe}from"./dropdown-menu-BK29e1o0.js";import{a as ne,b as oe,P as ae}from"./popover-CvIauBBG.js";import{S as Ye}from"./switch-yIP7Yj81.js";import{T as Xe,a as Ze,b as et}from"./tooltip-DJkxXViN.js";import{u as tt}from"./useQuery-CvkH2gG1.js";import{i as st,u as rt,a as nt}from"./constants-TLV7MTwP.js";import{b as ot}from"./use-virtual-mcp-2qhGJdPe.js";import{i as at}from"./ArrowUp-D6ltkV3R.js";import{s as H}from"./Type01-CySkENi6.js";import{i as W}from"./Loading01-BVCg1O_G.js";import{s as it}from"./Plus-DcVtqCMV.js";import{s as lt}from"./Trash01-CBP9WLeP.js";import{s as Q}from"./XClose-BLvk3pvY.js";import{a as je,t as ct,b as dt}from"./context-BSzlpoxW.js";import{f as mt}from"./formatDistanceToNow-Cb2QZZJn.js";import"./XCircle-Z-JTmQ8v.js";import"./skeleton-CLUePAN0.js";import"./spinner-7bhznOFa.js";import"./use-mcp-prompts-DY_yf0WC.js";import"./dialog-DCrLu7TC.js";import"./X-Dr-hR03I.js";import"./form-DPsme8JL.js";import"./label-DF2jcg2U.js";import"./index-Bgix03M4.js";import"./usage-BW6ztpN6.js";import"./ChevronDown-CDxBhn_l.js";import"./org-ai-providers-DFHn6TCP.js";import"./useMutation-BTUmJffP.js";import"./AlertCircle-BD5gSXQu.js";import"./RefreshCcw01-Co0-i94o.js";import"./Play-Bb4cvvVL.js";import"./card-CKN-JP9M.js";import"./toggle-group-DN_3BuPh.js";import"./avatar-BZ4Frci2.js";import"./User01-CItwHvE1.js";import"./select-DaOZXaTi.js";import"./index-BdQq_4o_.js";import"./index-BkAoKVx8.js";import"./Check-Dczm9Dfw.js";import"./ChevronUp-BLNd6dNq.js";import"./ArrowLeft-DN3D0Zrv.js";import"./use-copy-DYNuGKRz.js";import"./marked.esm-BaswSlok.js";import"./tabs-Du7uGFqP.js";import"./checkbox-Dzy6oaRF.js";import"./drawer-CwKj53Jm.js";import"./SearchMd-CVvF1HpM.js";import"./Settings01-DpZ_tsoX.js";import"./use-mcp-resources-BnmpykKD.js";import"./ChevronRight-Dxvchjxo.js";import"./collapsible-D84K6rP8.js";import"./index-Dg9iIj2F.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-C8wEMNqP.js";import"./types-llndI7Ky.js";import"./use-collections-Dmxer7H8.js";import"./useSuspenseInfiniteQuery-DRfcYfXZ.js";import"./infiniteQueryObserver-DiY9IZXI.js";import"./use-create-virtual-mcp-CEBO__7d.js";import"./Container-CMPDG7Cp.js";import"./Dataflow03-slF1Ax9G.js";import"./FolderClosed-BKB_NgWm.js";import"./Upload01-BzGPegBj.js";import"./Zap-CiHJmamA.js";import"./decopilot-events-Brt4gAR6.js";import"./index-2hR_U2H-.js";import"./differenceInSeconds-NQ4PDo0z.js";function K(s){const e=s.trim().split(/\s+/);return e.length!==5?!1:e.every(r=>/^[\d*/,\-]+$/.test(r))}function ut(s){if(!s)return"Unknown schedule";const e=s.trim();if(e==="* * * * *")return"Every minute";if(e==="0 * * * *")return"Every hour";if(e==="0 0 * * *")return"Every day";if(e==="0 0 * * 1")return"Every week";const r=e.match(/^\*\/(\d+)\s+\*\s+\*\s+\*\s+\*$/);if(r)return`Every ${r[1]} minutes`;const n=e.match(/^0\s+\*\/(\d+)\s+\*\s+\*\s+\*$/);if(n)return`Every ${n[1]} hours`;const o=e.match(/^0\s+0\s+\*\/(\d+)\s+\*\s+\*$/);if(o){const f=parseInt(o[1]??"1");return f%7===0?`Every ${f/7} weeks`:`Every ${f} days`}const i=e.match(/^(\d+)\s+(\d+)\s+\*\s+\*\s+\*$/);if(i){const f=(i[2]??"0").padStart(2,"0"),d=(i[1]??"0").padStart(2,"0");return`Every day at ${f}:${d} UTC`}const x=e.match(/^(\d+)\s+(\d+)\s+\*\s+\*\s+(\d)$/);if(x){const d=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][parseInt(x[3]??"0")]??"day",l=(x[2]??"0").padStart(2,"0"),y=(x[1]??"0").padStart(2,"0");return`Every ${d} at ${l}:${y} UTC`}return s}function pt(s,e){const r=Math.max(1,s);switch(e){case"minutes":return r===1?"* * * * *":`*/${r} * * * *`;case"hours":return r===1?"0 * * * *":`0 */${r} * * *`;case"days":return r===1?"0 0 * * *":`0 0 */${r} * *`;case"weeks":return r===1?"0 0 * * 1":`0 0 */${r*7} * *`}}function ft(s){const e=s.trim();if(e==="* * * * *")return{count:1,unit:"minutes"};if(e==="0 * * * *")return{count:1,unit:"hours"};if(e==="0 0 * * *")return{count:1,unit:"days"};if(e==="0 0 * * 1")return{count:1,unit:"weeks"};const r=e.match(/^\*\/(\d+)\s+\*\s+\*\s+\*\s+\*$/);if(r)return{count:parseInt(r[1]),unit:"minutes"};const n=e.match(/^0\s+\*\/(\d+)\s+\*\s+\*\s+\*$/);if(n)return{count:parseInt(n[1]),unit:"hours"};const o=e.match(/^0\s+0\s+\*\/(\d+)\s+\*\s+\*$/);if(o){const i=parseInt(o[1]);return i%7===0?{count:i/7,unit:"weeks"}:{count:i,unit:"days"}}return null}function xt(s,e){return e===1?{minutes:"minute",hours:"hour",days:"day",weeks:"week"}[s]??s:s}const ht=[{label:"Minute",cron:"* * * * *"},{label:"Hour",cron:"0 * * * *"},{label:"Day",cron:"0 0 * * *"},{label:"Week",cron:"0 0 * * 1"}];function gt(s){const e=B.c(26),{automationId:r,open:n,onOpenChange:o,onCustomSelect:i}=s,x=J(),[f,d]=T.useState(!1),l=n??f;let y;e[0]!==o?(y=N=>{o?o(N):d(N)},e[0]=o,e[1]=y):y=e[1];const m=y;let j;e[2]!==x||e[3]!==r||e[4]!==m?(j=async N=>{try{await x.mutateAsync({automation_id:r,type:"cron",cron_expression:N}),I.success("Starter added"),m(!1)}catch(D){const A=D,g=A instanceof Error?A.message:"Failed to add starter";I.error(g)}},e[2]=x,e[3]=r,e[4]=m,e[5]=j):j=e[5];const S=j;let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Ke,{asChild:!0,children:t.jsxs(U,{variant:"outline",size:"sm",children:[t.jsx(it,{size:14}),"Add Starter"]})}),e[6]=p):p=e[6];let _;e[7]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsxs(We,{className:"gap-2.5",children:[t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),"Every..."]}),e[7]=_):_=e[7];let v;e[8]!==x||e[9]!==S?(v=ht.map(N=>t.jsxs(re,{className:"gap-2.5",onSelect:()=>S(N.cron),disabled:x.isPending,children:[t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),"Every ",N.label]},N.cron)),e[8]=x,e[9]=S,e[10]=v):v=e[10];let a;e[11]!==v?(a=t.jsxs(qe,{children:[_,t.jsx(Ge,{className:"w-[160px]",children:v})]}),e[11]=v,e[12]=a):a=e[12];let u;e[13]!==m||e[14]!==i?(u=()=>{m(!1),i?.()},e[13]=m,e[14]=i,e[15]=u):u=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),e[16]=b):b=e[16];let h;e[17]!==u?(h=t.jsxs(re,{className:"gap-2.5",onSelect:u,children:[b,"Custom (cron)"]}),e[17]=u,e[18]=h):h=e[18];let C;e[19]!==a||e[20]!==h?(C=t.jsxs(Je,{align:"end",className:"w-[200px]",children:[a,h]}),e[19]=a,e[20]=h,e[21]=C):C=e[21];let w;return e[22]!==m||e[23]!==l||e[24]!==C?(w=t.jsxs(Qe,{open:l,onOpenChange:m,children:[p,C]}),e[22]=m,e[23]=l,e[24]=C,e[25]=w):w=e[25],w}function yt(s){const e=B.c(56),{trigger:r,automationId:n}=s,o=Pe(),i=J(),[x,f]=T.useState(!1);let d;e[0]!==r.cron_expression?(d=r.cron_expression?ft(r.cron_expression):null,e[0]=r.cron_expression,e[1]=d):d=e[1];const l=d,[y,m]=T.useState(l?.count??1),[j,S]=T.useState(!1),[p,_]=T.useState(r.cron_expression??""),v=o.isPending||i.isPending,a=r.type==="cron";let u;e[2]!==n||e[3]!==o||e[4]!==r.id?(u=async()=>{try{await o.mutateAsync({trigger_id:r.id,automation_id:n}),I.success("Starter removed")}catch{I.error("Failed to remove starter")}f(!1)},e[2]=n,e[3]=o,e[4]=r.id,e[5]=u):u=e[5];const b=u;let h;e[6]!==i||e[7]!==n||e[8]!==p||e[9]!==o||e[10]!==r.cron_expression||e[11]!==r.id?(h=async()=>{const k=p.trim();if(!k||!K(k)||k===r.cron_expression){S(!1),_(r.cron_expression??"");return}try{await i.mutateAsync({automation_id:n,type:"cron",cron_expression:k}),await o.mutateAsync({trigger_id:r.id,automation_id:n}),S(!1)}catch{I.error("Failed to update starter"),_(r.cron_expression??""),S(!1)}},e[6]=i,e[7]=n,e[8]=p,e[9]=o,e[10]=r.cron_expression,e[11]=r.id,e[12]=h):h=e[12];const C=h;let w;e[13]!==i||e[14]!==n||e[15]!==l||e[16]!==o||e[17]!==r.cron_expression||e[18]!==r.id?(w=async k=>{if(!l)return;const q=Math.max(1,k),c=pt(q,l.unit);if(c!==r.cron_expression)try{await i.mutateAsync({automation_id:n,type:"cron",cron_expression:c}),await o.mutateAsync({trigger_id:r.id,automation_id:n})}catch{I.error("Failed to update starter"),m(l.count)}},e[13]=i,e[14]=n,e[15]=l,e[16]=o,e[17]=r.cron_expression,e[18]=r.id,e[19]=w):w=e[19];const N=w;let D;e[20]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),e[20]=D):D=e[20];let A;e[21]!==y||e[22]!==p||e[23]!==N||e[24]!==C||e[25]!==l||e[26]!==a||e[27]!==j||e[28]!==v||e[29]!==r.cron_expression||e[30]!==r.event_type?(A=l&&a?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:"Every"}),t.jsx("input",{type:"number",min:1,value:y,onChange:k=>m(parseInt(k.target.value)||1),onBlur:()=>N(y),onKeyDown:k=>{k.key==="Enter"&&k.target.blur(),k.key==="Escape"&&m(l.count)},disabled:v,className:"w-12 text-center text-sm h-7 border border-border rounded-md bg-background px-1 focus:outline-none focus:ring-1 focus:ring-ring"}),t.jsx("span",{className:"text-sm",children:xt(l.unit,y)})]}):a&&j?t.jsxs(t.Fragment,{children:[t.jsx("input",{type:"text",value:p,onChange:k=>_(k.target.value),onBlur:C,onKeyDown:k=>{k.key==="Enter"&&k.target.blur(),k.key==="Escape"&&(S(!1),_(r.cron_expression??""))},className:"flex-1 text-sm font-mono bg-transparent outline-none",autoFocus:!0}),p&&!K(p)&&t.jsx("span",{className:"text-xs text-muted-foreground/60 shrink-0",children:"invalid"})]}):t.jsx("span",{className:"text-sm flex-1 font-mono text-xs text-muted-foreground",children:a?ut(r.cron_expression??""):`${r.event_type} event`}),e[21]=y,e[22]=p,e[23]=N,e[24]=C,e[25]=l,e[26]=a,e[27]=j,e[28]=v,e[29]=r.cron_expression,e[30]=r.event_type,e[31]=A):A=e[31];let g;e[32]!==v?(g=v&&t.jsx(W,{size:13,className:"animate-spin text-muted-foreground"}),e[32]=v,e[33]=g):g=e[33];let z;e[34]!==l||e[35]!==a||e[36]!==j||e[37]!==r.cron_expression?(z=a&&!l&&!j&&t.jsx(U,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>{_(r.cron_expression??""),S(!0)},children:t.jsx(Ee,{size:13,className:"text-muted-foreground"})}),e[34]=l,e[35]=a,e[36]=j,e[37]=r.cron_expression,e[38]=z):z=e[38];let R;e[39]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(U,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>f(!0),children:t.jsx(Q,{size:13,className:"text-muted-foreground"})}),e[39]=R):R=e[39];let M;e[40]!==g||e[41]!==z?(M=t.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[g,z,R]}),e[40]=g,e[41]=z,e[42]=M):M=e[42];let O;e[43]!==M||e[44]!==A?(O=t.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5 rounded-lg border border-border bg-background group",children:[D,A,M]}),e[43]=M,e[44]=A,e[45]=O):O=e[45];let P;e[46]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsxs(me,{children:[t.jsx(pe,{children:"Remove Starter"}),t.jsx(ue,{children:"Are you sure you want to remove this starter?"})]}),e[46]=P):P=e[46];let V;e[47]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(fe,{children:"Cancel"}),e[47]=V):V=e[47];let E;e[48]!==b?(E=t.jsxs(ge,{children:[P,t.jsxs(xe,{children:[V,t.jsx(he,{onClick:b,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]}),e[48]=b,e[49]=E):E=e[49];let $;e[50]!==x||e[51]!==E?($=t.jsx(ye,{open:x,onOpenChange:f,children:E}),e[50]=x,e[51]=E,e[52]=$):$=e[52];let F;return e[53]!==O||e[54]!==$?(F=t.jsxs(t.Fragment,{children:[O,$]}),e[53]=O,e[54]=$,e[55]=F):F=e[55],F}function jt(s){const e=B.c(41),{selectedId:r,onChange:n}=s,[o,i]=T.useState(!1),x=ot();let f,d;e[0]!==x||e[1]!==r?(d=x.filter(vt),f=r?d.find(p=>p.id===r):null,e[0]=x,e[1]=r,e[2]=f,e[3]=d):(f=e[2],d=e[3]);const l=f;if(l){let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(te,{size:16}),e[4]=p):p=e[4];let _;e[5]!==l.icon||e[6]!==l.title?(_=t.jsx(Me,{icon:l.icon,name:l.title,size:"sm",fallbackIcon:p,className:"rounded-md shrink-0"}),e[5]=l.icon,e[6]=l.title,e[7]=_):_=e[7];let v;e[8]!==l.title?(v=t.jsx("span",{className:"text-sm font-medium truncate",children:l.title}),e[8]=l.title,e[9]=v):v=e[9];let a;e[10]!==_||e[11]!==v?(a=t.jsx(ne,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex items-center gap-3 flex-1 min-w-0 text-left cursor-pointer",children:[_,v]})}),e[10]=_,e[11]=v,e[12]=a):a=e[12];let u;e[13]!==n?(u=A=>{n(A),i(!1)},e[13]=n,e[14]=u):u=e[14];let b;e[15]!==r||e[16]!==u||e[17]!==d?(b=t.jsx(oe,{className:"w-[550px] p-0 overflow-hidden",align:"start",sideOffset:8,children:t.jsx(ee,{virtualMcps:d,selectedVirtualMcpId:r,onVirtualMcpChange:u})}),e[15]=r,e[16]=u,e[17]=d,e[18]=b):b=e[18];let h;e[19]!==o||e[20]!==a||e[21]!==b?(h=t.jsxs(ae,{open:o,onOpenChange:i,children:[a,b]}),e[19]=o,e[20]=a,e[21]=b,e[22]=h):h=e[22];let C;e[23]!==n?(C=()=>n(null),e[23]=n,e[24]=C):C=e[24];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(Q,{size:13}),e[25]=w):w=e[25];let N;e[26]!==C?(N=t.jsx(U,{type:"button",variant:"ghost",size:"icon",className:"shrink-0 size-7 text-muted-foreground hover:text-foreground",onClick:C,title:"Remove agent",children:w}),e[26]=C,e[27]=N):N=e[27];let D;return e[28]!==N||e[29]!==h?(D=t.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-border bg-background hover:bg-accent/50 transition-colors",children:[h,N]}),e[28]=N,e[29]=h,e[30]=D):D=e[30],D}let y;e[31]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(ne,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-border hover:bg-accent/50 transition-colors w-full text-left cursor-pointer",children:[t.jsxs("div",{className:"relative flex items-center justify-center size-8 rounded-md text-muted-foreground/75 shrink-0",children:[t.jsxs("svg",{className:"absolute inset-0 size-full",fill:"none",children:[t.jsx("defs",{children:t.jsxs("linearGradient",{id:"agent-picker-border-gradient",gradientUnits:"userSpaceOnUse",x1:"0",y1:"0",x2:"32",y2:"32",children:[t.jsx("animateTransform",{attributeName:"gradientTransform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"6s",repeatCount:"indefinite"}),t.jsx("stop",{offset:"0%",stopColor:"var(--chart-1)"}),t.jsx("stop",{offset:"100%",stopColor:"var(--chart-4)"})]})}),t.jsx("rect",{x:"0.5",y:"0.5",width:"31",height:"31",rx:"5.5",stroke:"url(#agent-picker-border-gradient)",strokeWidth:"1",strokeDasharray:"3 3"})]}),t.jsx(te,{size:16})]}),t.jsx("span",{className:"text-sm text-muted-foreground",children:"No agent selected. All connections available."})]})}),e[31]=y):y=e[31];let m;e[32]!==n?(m=p=>{n(p),i(!1)},e[32]=n,e[33]=m):m=e[33];let j;e[34]!==r||e[35]!==m||e[36]!==d?(j=t.jsx(oe,{className:"w-[550px] p-0 overflow-hidden",align:"start",sideOffset:8,children:t.jsx(ee,{virtualMcps:d,selectedVirtualMcpId:r,onVirtualMcpChange:m})}),e[34]=r,e[35]=m,e[36]=d,e[37]=j):j=e[37];let S;return e[38]!==o||e[39]!==j?(S=t.jsxs(ae,{open:o,onOpenChange:i,children:[y,j]}),e[38]=o,e[39]=j,e[40]=S):S=e[40],S}function vt(s){return!s.id||!st(s.id)}function bt({automationId:s,automation:e}){const r=Re(),{createTask:n,setVirtualMcpId:o,setSelectedModel:i,sendMessage:x,credentialId:f,model:d}=je(),[,l]=de(),y=e.messages?.[0]?.metadata?.tiptapDoc??void 0,[m,j]=T.useState(y),[S,p]=T.useState(y),[_,v]=T.useState(!1),[a,u]=T.useState(!1),[b,h]=T.useState(""),C=J(),w=T.useRef(!1),N=c=>{j(c),w.current||(w.current=!0,y||p(c))},D=e.models?.credentialId||f||"",A=e.models?.thinking?.id||d?.modelId||"",g=Ce({defaultValues:{name:e.name,active:e.active,agent_id:e.agent?.id??"",credential_id:D,model_id:A}}),z=g.watch("active"),R=g.watch("agent_id"),M=g.watch("credential_id"),O=g.watch("model_id"),{models:P,isLoading:V}=De(M||void 0),E=P.find(c=>c.modelId===O)??null,$=async()=>{const c=g.getValues();try{const L=c.credential_id&&c.model_id?c.credential_id:"",Y=c.credential_id&&c.model_id?c.model_id:"";return await r.mutateAsync({id:s,name:c.name,active:c.active,agent:{id:c.agent_id},models:{credentialId:L,thinking:{id:Y}},messages:ct(m),temperature:0}),g.reset({...c,credential_id:L,model_id:Y}),p(m),I.success("Automation saved"),!0}catch{return I.error("Failed to save automation"),!1}},F=()=>{g.reset(),N(S)},k=g.formState.isDirty||JSON.stringify(m??null)!==JSON.stringify(S??null),q=async()=>{if(k&&!await $())return;if(!m){I.error("No instructions configured for this automation");return}const c=g.getValues();o(c.agent_id||null),E&&M&&i({...E,keyId:M}),l(!0),n(),setTimeout(()=>{x(m,{toolApprovalLevel:"auto"})},0)};return t.jsxs(t.Fragment,{children:[t.jsx(ce,{children:t.jsx(ke,{onSave:async()=>{await $()},onUndo:F,isDirty:k,isSaving:r.isPending})}),t.jsxs("div",{className:"max-w-2xl mx-auto w-full px-6 py-6 flex flex-col gap-8",children:[t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(He,{...g.register("name"),placeholder:"Automation name",className:"border border-transparent shadow-none px-0 text-2xl md:text-2xl font-semibold h-auto focus-visible:ring-0 focus-visible:border-border bg-transparent"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Ne,{control:g.control,name:"active",render:({field:c})=>t.jsx(Ye,{checked:c.value,onCheckedChange:c.onChange,className:"cursor-pointer"})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:z?"Active":"Inactive"}),t.jsx("span",{className:"text-muted-foreground/50 text-sm",children:"·"}),t.jsx($e,{id:e.created_by,size:"2xs",className:"text-sm text-muted-foreground"})]})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Starter"}),t.jsx(gt,{automationId:s,open:_,onOpenChange:v,onCustomSelect:()=>{u(!0),h("")}})]}),e.triggers.length===0&&!a?t.jsx("div",{className:"rounded-lg border border-dashed border-border px-4 py-6 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["When should this automation run?"," ",t.jsx("button",{type:"button",className:"text-foreground underline underline-offset-2 cursor-pointer hover:text-foreground/80 transition-colors",onClick:()=>v(!0),children:"Add a starter"})," ","to get going."]})}):t.jsx("div",{className:"flex flex-col gap-2",children:e.triggers.map(c=>t.jsx(yt,{trigger:c,automationId:s},c.id))}),a&&t.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5 rounded-lg border border-border bg-background group",children:[t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),t.jsx("input",{type:"text",value:b,onChange:c=>h(c.target.value),onBlur:async()=>{const c=b.trim();if(!(!c||!K(c)))try{await C.mutateAsync({automation_id:s,type:"cron",cron_expression:c}),I.success("Starter added"),u(!1),h("")}catch{I.error("Failed to add starter")}},onKeyDown:async c=>{const L=b.trim();c.key==="Enter"&&L&&K(L)&&c.target.blur(),c.key==="Escape"&&(u(!1),h(""))},placeholder:"0 9 * * 1-5",className:"flex-1 text-sm font-mono bg-transparent outline-none placeholder:text-muted-foreground/40",autoFocus:!0}),b&&!K(b)&&t.jsx("span",{className:"text-xs text-muted-foreground/60 shrink-0",children:"invalid"}),C.isPending&&t.jsx(W,{size:13,className:"animate-spin text-muted-foreground shrink-0"}),t.jsx("button",{type:"button",className:"shrink-0 p-0.5 rounded text-muted-foreground opacity-0 group-hover:opacity-100 hover:text-foreground transition-opacity",onClick:()=>{u(!1),h("")},children:t.jsx(Q,{size:13})})]})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Agent"}),t.jsx(jt,{selectedId:R||null,onChange:c=>g.setValue("agent_id",c??"",{shouldDirty:!0})})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Instructions"}),t.jsx(Ae,{tiptapDoc:m,setTiptapDoc:N,placeholder:"What should this automation do?",children:t.jsxs("div",{className:"rounded-xl border border-border min-h-[120px] flex flex-col",children:[t.jsx(Te,{virtualMcpId:R||null}),t.jsxs("div",{className:"flex items-center justify-end gap-1.5 p-2.5",children:[t.jsx(Ie,{model:E,isLoading:V,credentialId:M||null,onCredentialChange:c=>{g.setValue("credential_id",c??"",{shouldDirty:!0}),g.setValue("model_id","",{shouldDirty:!0})},onModelChange:c=>g.setValue("model_id",c.modelId,{shouldDirty:!0}),placeholder:"Model"}),t.jsxs(Xe,{children:[t.jsx(Ze,{asChild:!0,children:t.jsxs(U,{type:"button",variant:"default",className:"h-8 gap-1.5 rounded-md px-3 text-sm font-medium",onClick:q,children:[t.jsx(at,{size:16}),"Test"]})}),t.jsx(et,{children:"Test Automation"})]})]})]})})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Run History"}),t.jsx(Ct,{automationId:s,triggerIds:e.triggers.map(c=>c.id)})]})]})]})}function _t(s,e,r){const n=B.c(13);let o;n[0]!==s?(o={connectionId:nt,orgId:s},n[0]=s,n[1]=o):o=n[1];const i=rt(o);let x;n[2]!==e||n[3]!==s||n[4]!==r?(x=G.automationRuns(s,e,r),n[2]=e,n[3]=s,n[4]=r,n[5]=x):x=n[5];let f;n[6]!==i||n[7]!==r?(f=async()=>{if(!i)throw new Error("MCP client not available");const y=await i.callTool({name:"COLLECTION_THREADS_LIST",arguments:{where:{trigger_ids:r},limit:20}});return(y.structuredContent??y).items??[]},n[6]=i,n[7]=r,n[8]=f):f=n[8];const d=r.length>0;let l;return n[9]!==x||n[10]!==f||n[11]!==d?(l={queryKey:x,queryFn:f,enabled:d},n[9]=x,n[10]=f,n[11]=d,n[12]=l):l=n[12],tt(l)}function Ct(s){const e=B.c(22),{automationId:r,triggerIds:n}=s,{org:o}=ie(),{switchToTask:i}=je(),[,x]=de(),f=Se(),{data:d,isLoading:l}=_t(o.id,r,n),y=n.length>0;let m;e[0]!==r||e[1]!==o.id||e[2]!==f||e[3]!==d||e[4]!==n?(m=a=>{const u=a.subject,b=d??[];b.find(C=>C.id===u)?f.setQueryData(G.automationRuns(o.id,r,n),b.map(C=>C.id===u?{...C,status:a.data.status,updated_at:new Date().toISOString()}:C)):f.invalidateQueries({queryKey:G.automationRuns(o.id,r,n)})},e[0]=r,e[1]=o.id,e[2]=f,e[3]=d,e[4]=n,e[5]=m):m=e[5];let j;if(e[6]!==o.id||e[7]!==y||e[8]!==m?(j={orgId:o.id,enabled:y,onTaskStatus:m},e[6]=o.id,e[7]=y,e[8]=m,e[9]=j):j=e[9],dt(j),l){let a;return e[10]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(W,{size:18,className:"animate-spin text-muted-foreground"})}),e[10]=a):a=e[10],a}if(!d||d.length===0){let a;return e[11]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(le,{image:null,className:"mt-6",title:"No run history",description:"Run history will appear here when the automation has been triggered."}),e[11]=a):a=e[11],a}let S;e[12]!==x||e[13]!==i?(S=async a=>{await i(a),x(!0)},e[12]=x,e[13]=i,e[14]=S):S=e[14];const p=S;let _;if(e[15]!==p||e[16]!==d){let a;e[18]!==p?(a=u=>{const b=Z[u.status]??Z.completed,h=b.icon;return t.jsxs("button",{type:"button",className:"flex items-center gap-3 px-1 py-2.5 text-left hover:bg-accent/50 transition-colors cursor-pointer rounded-sm",onClick:()=>p(u.id),children:[t.jsx(h,{size:16,className:b.iconClassName}),t.jsx("span",{className:"flex-1 min-w-0 text-sm truncate",children:u.title}),t.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:mt(new Date(u.updated_at),{addSuffix:!0})})]},u.id)},e[18]=p,e[19]=a):a=e[19],_=d.map(a),e[15]=p,e[16]=d,e[17]=_}else _=e[17];let v;return e[20]!==_?(v=t.jsx("div",{className:"flex flex-col divide-y divide-border",children:_}),e[20]=_,e[21]=v):v=e[21],v}function Ys(){const s=B.c(36);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},s[0]=e):e=s[0];const{automationId:r}=ve(e),n=be(),{org:o}=ie(),{data:i,isLoading:x}=ze(r),f=Oe(),[d,l]=T.useState(!1);let y;s[1]!==r||s[2]!==f||s[3]!==n||s[4]!==o?(y=async()=>{try{await f.mutateAsync(r),I.success("Automation deleted"),n({to:"/$org/$project/automations",params:{org:o.slug,project:X}})}catch{I.error("Failed to delete automation")}l(!1)},s[1]=r,s[2]=f,s[3]=n,s[4]=o,s[5]=y):y=s[5];const m=y;if(x){let g;return s[6]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx(W,{size:24,className:"animate-spin text-muted-foreground"})}),s[6]=g):g=s[6],g}if(!i){let g;return s[7]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(le,{title:"Automation not found",description:"This automation may have been deleted."}),s[7]=g):g=s[7],g}let j;s[8]!==o.slug?(j=t.jsx(se,{children:t.jsx(Ve,{asChild:!0,children:t.jsx(_e,{to:"/$org/$project/automations",params:{org:o.slug,project:X},children:"Automations"})})}),s[8]=o.slug,s[9]=j):j=s[9];let S;s[10]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Le,{}),s[10]=S):S=s[10];let p;s[11]!==i.name?(p=t.jsx(se,{children:t.jsx(Fe,{children:i.name})}),s[11]=i.name,s[12]=p):p=s[12];let _;s[13]!==j||s[14]!==p?(_=t.jsx(Ue,{children:t.jsxs(Be,{children:[j,S,p]})}),s[13]=j,s[14]=p,s[15]=_):_=s[15];const v=_;let a;s[16]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(ce,{children:t.jsxs(U,{variant:"ghost",size:"sm",className:"h-7 text-destructive hover:text-destructive",onClick:()=>l(!0),children:[t.jsx(lt,{size:14}),"Delete"]})}),s[16]=a):a=s[16];let u;s[17]!==i||s[18]!==r?(u=t.jsx(bt,{automationId:r,automation:i},r),s[17]=i,s[18]=r,s[19]=u):u=s[19];let b;s[20]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(pe,{children:"Delete Automation"}),s[20]=b):b=s[20];let h;s[21]!==i.name?(h=t.jsxs(me,{children:[b,t.jsxs(ue,{children:['Are you sure you want to delete "',i.name,'"? This action cannot be undone.']})]}),s[21]=i.name,s[22]=h):h=s[22];let C;s[23]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(fe,{children:"Cancel"}),s[23]=C):C=s[23];let w;s[24]!==m?(w=t.jsxs(xe,{children:[C,t.jsx(he,{onClick:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),s[24]=m,s[25]=w):w=s[25];let N;s[26]!==w||s[27]!==h?(N=t.jsxs(ge,{children:[h,w]}),s[26]=w,s[27]=h,s[28]=N):N=s[28];let D;s[29]!==d||s[30]!==N?(D=t.jsx(ye,{open:d,onOpenChange:l,children:N}),s[29]=d,s[30]=N,s[31]=D):D=s[31];let A;return s[32]!==v||s[33]!==D||s[34]!==u?(A=t.jsxs(we,{breadcrumb:v,children:[a,u,D]}),s[32]=v,s[33]=D,s[34]=u,s[35]=A):A=s[35],A}export{Ys as default};
1
+ import{d as B,k as ve,f as be,c as ie,r as T,j as t,H as _e,O as X,w as I,B as U,v as Ce,J as Ne,x as Se,K as G}from"./index-Y_g6-sbQ.js";import{E as le}from"./empty-state-5hCgVmoA.js";import{a as ce,V as we}from"./layout-BL6sB2DL.js";import{S as ke}from"./save-actions-xo9lGU3J.js";import{u as De}from"./ai-providers-logos-Du8KzWpH.js";import{T as Ae,a as Te,M as Ie,S as Z}from"./task-status-DFJ-29wD.js";import{V as ee}from"./select-virtual-mcp-B6M52JVi.js";import{I as Me,e as Ee,t as te}from"./integration-icon-7Bz6GmNv.js";import{U as $e}from"./user-BOuwXTIR.js";import{c as ze,b as Oe,d as Re,e as J,f as Pe}from"./use-automations-DSFrBv_6.js";import{a as de}from"./index-BlVIyhiN.js";import{b as me,d as ue,c as pe,A as fe,e as xe,h as he,a as ge,f as ye}from"./alert-dialog-BIZOEctM.js";import{b as se,d as Ve,c as Fe,e as Le,B as Ue,a as Be}from"./breadcrumb-CCT_gYCX.js";import{I as He}from"./input-BJjZBSH8.js";import{c as re,a as Ke,d as We,e as qe,f as Ge,b as Je,D as Qe}from"./dropdown-menu-BGBf4SQr.js";import{a as ne,b as oe,P as ae}from"./popover-lD-HtMf4.js";import{S as Ye}from"./switch-BHSO5vl3.js";import{T as Xe,a as Ze,b as et}from"./tooltip-Cem552VW.js";import{u as tt}from"./useQuery-DKMHT49Q.js";import{i as st,u as rt,a as nt}from"./constants-Cf6w8uWj.js";import{b as ot}from"./use-virtual-mcp-tHRSpblC.js";import{i as at}from"./ArrowUp-CiCCsmLU.js";import{s as H}from"./Type01-D1knZTdC.js";import{i as W}from"./Loading01-DTPGNGDe.js";import{s as it}from"./Plus-VNSvGQN9.js";import{s as lt}from"./Trash01-p_-P7rrZ.js";import{s as Q}from"./XClose-CIHCEBuc.js";import{a as je,t as ct,b as dt}from"./context-BNN0sjtQ.js";import{f as mt}from"./formatDistanceToNow-Cb2QZZJn.js";import"./XCircle-Of71XlDY.js";import"./skeleton-DPPFiXsR.js";import"./spinner-DRNxYthF.js";import"./use-mcp-prompts-8NM9rwku.js";import"./dialog-B_ZBKGcK.js";import"./X-AnvD8fGN.js";import"./form-BAfFoDTS.js";import"./label-BagqgWUv.js";import"./index-BUla3j6g.js";import"./usage-BW6ztpN6.js";import"./ChevronDown-DMIUCeXF.js";import"./org-ai-providers-Udjn3QRR.js";import"./useMutation-09-2Qwl6.js";import"./AlertCircle-DoDnREQU.js";import"./RefreshCcw01-Dbe0-ztA.js";import"./Play-BSN624z4.js";import"./card-DiqqquYR.js";import"./toggle-group-iephCdnh.js";import"./avatar-BDzYYIB_.js";import"./User01-C1Py8RLi.js";import"./select-9VPJVrM5.js";import"./index-BdQq_4o_.js";import"./index-CT7BYuwf.js";import"./Check-DsqqbwRv.js";import"./ChevronUp-BPTkFtVQ.js";import"./ArrowLeft-1uQ4hoAA.js";import"./use-copy-d-3iM6J5.js";import"./marked.esm-BaswSlok.js";import"./tabs-CdWME6KE.js";import"./checkbox-B5yMaD1U.js";import"./drawer-DxTGqDKY.js";import"./SearchMd-BVguqJPF.js";import"./Settings01-BKawEeOc.js";import"./use-mcp-resources-CHuUMbyT.js";import"./ChevronRight-BvErZvXV.js";import"./collapsible-CUnNCwaM.js";import"./index-TzbVkru2.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-BSLoo8nT.js";import"./types-DmDUXWAD.js";import"./use-collections-D0k_QRc1.js";import"./useSuspenseInfiniteQuery-DZTp9qX4.js";import"./infiniteQueryObserver-BvNG1QG_.js";import"./use-create-virtual-mcp-Dl6pqwaW.js";import"./Container-D8gJR-V9.js";import"./Dataflow03-D9B0IMv1.js";import"./FolderClosed-DtTyOuV-.js";import"./Upload01-D-cgBdXK.js";import"./Zap-Cbf8Gxw3.js";import"./decopilot-events-Brt4gAR6.js";import"./index-BclDkWx8.js";import"./differenceInSeconds-NQ4PDo0z.js";function K(s){const e=s.trim().split(/\s+/);return e.length!==5?!1:e.every(r=>/^[\d*/,\-]+$/.test(r))}function ut(s){if(!s)return"Unknown schedule";const e=s.trim();if(e==="* * * * *")return"Every minute";if(e==="0 * * * *")return"Every hour";if(e==="0 0 * * *")return"Every day";if(e==="0 0 * * 1")return"Every week";const r=e.match(/^\*\/(\d+)\s+\*\s+\*\s+\*\s+\*$/);if(r)return`Every ${r[1]} minutes`;const n=e.match(/^0\s+\*\/(\d+)\s+\*\s+\*\s+\*$/);if(n)return`Every ${n[1]} hours`;const o=e.match(/^0\s+0\s+\*\/(\d+)\s+\*\s+\*$/);if(o){const f=parseInt(o[1]??"1");return f%7===0?`Every ${f/7} weeks`:`Every ${f} days`}const i=e.match(/^(\d+)\s+(\d+)\s+\*\s+\*\s+\*$/);if(i){const f=(i[2]??"0").padStart(2,"0"),d=(i[1]??"0").padStart(2,"0");return`Every day at ${f}:${d} UTC`}const x=e.match(/^(\d+)\s+(\d+)\s+\*\s+\*\s+(\d)$/);if(x){const d=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][parseInt(x[3]??"0")]??"day",l=(x[2]??"0").padStart(2,"0"),y=(x[1]??"0").padStart(2,"0");return`Every ${d} at ${l}:${y} UTC`}return s}function pt(s,e){const r=Math.max(1,s);switch(e){case"minutes":return r===1?"* * * * *":`*/${r} * * * *`;case"hours":return r===1?"0 * * * *":`0 */${r} * * *`;case"days":return r===1?"0 0 * * *":`0 0 */${r} * *`;case"weeks":return r===1?"0 0 * * 1":`0 0 */${r*7} * *`}}function ft(s){const e=s.trim();if(e==="* * * * *")return{count:1,unit:"minutes"};if(e==="0 * * * *")return{count:1,unit:"hours"};if(e==="0 0 * * *")return{count:1,unit:"days"};if(e==="0 0 * * 1")return{count:1,unit:"weeks"};const r=e.match(/^\*\/(\d+)\s+\*\s+\*\s+\*\s+\*$/);if(r)return{count:parseInt(r[1]),unit:"minutes"};const n=e.match(/^0\s+\*\/(\d+)\s+\*\s+\*\s+\*$/);if(n)return{count:parseInt(n[1]),unit:"hours"};const o=e.match(/^0\s+0\s+\*\/(\d+)\s+\*\s+\*$/);if(o){const i=parseInt(o[1]);return i%7===0?{count:i/7,unit:"weeks"}:{count:i,unit:"days"}}return null}function xt(s,e){return e===1?{minutes:"minute",hours:"hour",days:"day",weeks:"week"}[s]??s:s}const ht=[{label:"Minute",cron:"* * * * *"},{label:"Hour",cron:"0 * * * *"},{label:"Day",cron:"0 0 * * *"},{label:"Week",cron:"0 0 * * 1"}];function gt(s){const e=B.c(26),{automationId:r,open:n,onOpenChange:o,onCustomSelect:i}=s,x=J(),[f,d]=T.useState(!1),l=n??f;let y;e[0]!==o?(y=N=>{o?o(N):d(N)},e[0]=o,e[1]=y):y=e[1];const m=y;let j;e[2]!==x||e[3]!==r||e[4]!==m?(j=async N=>{try{await x.mutateAsync({automation_id:r,type:"cron",cron_expression:N}),I.success("Starter added"),m(!1)}catch(D){const A=D,g=A instanceof Error?A.message:"Failed to add starter";I.error(g)}},e[2]=x,e[3]=r,e[4]=m,e[5]=j):j=e[5];const S=j;let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Ke,{asChild:!0,children:t.jsxs(U,{variant:"outline",size:"sm",children:[t.jsx(it,{size:14}),"Add Starter"]})}),e[6]=p):p=e[6];let _;e[7]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsxs(We,{className:"gap-2.5",children:[t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),"Every..."]}),e[7]=_):_=e[7];let v;e[8]!==x||e[9]!==S?(v=ht.map(N=>t.jsxs(re,{className:"gap-2.5",onSelect:()=>S(N.cron),disabled:x.isPending,children:[t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),"Every ",N.label]},N.cron)),e[8]=x,e[9]=S,e[10]=v):v=e[10];let a;e[11]!==v?(a=t.jsxs(qe,{children:[_,t.jsx(Ge,{className:"w-[160px]",children:v})]}),e[11]=v,e[12]=a):a=e[12];let u;e[13]!==m||e[14]!==i?(u=()=>{m(!1),i?.()},e[13]=m,e[14]=i,e[15]=u):u=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),e[16]=b):b=e[16];let h;e[17]!==u?(h=t.jsxs(re,{className:"gap-2.5",onSelect:u,children:[b,"Custom (cron)"]}),e[17]=u,e[18]=h):h=e[18];let C;e[19]!==a||e[20]!==h?(C=t.jsxs(Je,{align:"end",className:"w-[200px]",children:[a,h]}),e[19]=a,e[20]=h,e[21]=C):C=e[21];let w;return e[22]!==m||e[23]!==l||e[24]!==C?(w=t.jsxs(Qe,{open:l,onOpenChange:m,children:[p,C]}),e[22]=m,e[23]=l,e[24]=C,e[25]=w):w=e[25],w}function yt(s){const e=B.c(56),{trigger:r,automationId:n}=s,o=Pe(),i=J(),[x,f]=T.useState(!1);let d;e[0]!==r.cron_expression?(d=r.cron_expression?ft(r.cron_expression):null,e[0]=r.cron_expression,e[1]=d):d=e[1];const l=d,[y,m]=T.useState(l?.count??1),[j,S]=T.useState(!1),[p,_]=T.useState(r.cron_expression??""),v=o.isPending||i.isPending,a=r.type==="cron";let u;e[2]!==n||e[3]!==o||e[4]!==r.id?(u=async()=>{try{await o.mutateAsync({trigger_id:r.id,automation_id:n}),I.success("Starter removed")}catch{I.error("Failed to remove starter")}f(!1)},e[2]=n,e[3]=o,e[4]=r.id,e[5]=u):u=e[5];const b=u;let h;e[6]!==i||e[7]!==n||e[8]!==p||e[9]!==o||e[10]!==r.cron_expression||e[11]!==r.id?(h=async()=>{const k=p.trim();if(!k||!K(k)||k===r.cron_expression){S(!1),_(r.cron_expression??"");return}try{await i.mutateAsync({automation_id:n,type:"cron",cron_expression:k}),await o.mutateAsync({trigger_id:r.id,automation_id:n}),S(!1)}catch{I.error("Failed to update starter"),_(r.cron_expression??""),S(!1)}},e[6]=i,e[7]=n,e[8]=p,e[9]=o,e[10]=r.cron_expression,e[11]=r.id,e[12]=h):h=e[12];const C=h;let w;e[13]!==i||e[14]!==n||e[15]!==l||e[16]!==o||e[17]!==r.cron_expression||e[18]!==r.id?(w=async k=>{if(!l)return;const q=Math.max(1,k),c=pt(q,l.unit);if(c!==r.cron_expression)try{await i.mutateAsync({automation_id:n,type:"cron",cron_expression:c}),await o.mutateAsync({trigger_id:r.id,automation_id:n})}catch{I.error("Failed to update starter"),m(l.count)}},e[13]=i,e[14]=n,e[15]=l,e[16]=o,e[17]=r.cron_expression,e[18]=r.id,e[19]=w):w=e[19];const N=w;let D;e[20]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),e[20]=D):D=e[20];let A;e[21]!==y||e[22]!==p||e[23]!==N||e[24]!==C||e[25]!==l||e[26]!==a||e[27]!==j||e[28]!==v||e[29]!==r.cron_expression||e[30]!==r.event_type?(A=l&&a?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:"Every"}),t.jsx("input",{type:"number",min:1,value:y,onChange:k=>m(parseInt(k.target.value)||1),onBlur:()=>N(y),onKeyDown:k=>{k.key==="Enter"&&k.target.blur(),k.key==="Escape"&&m(l.count)},disabled:v,className:"w-12 text-center text-sm h-7 border border-border rounded-md bg-background px-1 focus:outline-none focus:ring-1 focus:ring-ring"}),t.jsx("span",{className:"text-sm",children:xt(l.unit,y)})]}):a&&j?t.jsxs(t.Fragment,{children:[t.jsx("input",{type:"text",value:p,onChange:k=>_(k.target.value),onBlur:C,onKeyDown:k=>{k.key==="Enter"&&k.target.blur(),k.key==="Escape"&&(S(!1),_(r.cron_expression??""))},className:"flex-1 text-sm font-mono bg-transparent outline-none",autoFocus:!0}),p&&!K(p)&&t.jsx("span",{className:"text-xs text-muted-foreground/60 shrink-0",children:"invalid"})]}):t.jsx("span",{className:"text-sm flex-1 font-mono text-xs text-muted-foreground",children:a?ut(r.cron_expression??""):`${r.event_type} event`}),e[21]=y,e[22]=p,e[23]=N,e[24]=C,e[25]=l,e[26]=a,e[27]=j,e[28]=v,e[29]=r.cron_expression,e[30]=r.event_type,e[31]=A):A=e[31];let g;e[32]!==v?(g=v&&t.jsx(W,{size:13,className:"animate-spin text-muted-foreground"}),e[32]=v,e[33]=g):g=e[33];let z;e[34]!==l||e[35]!==a||e[36]!==j||e[37]!==r.cron_expression?(z=a&&!l&&!j&&t.jsx(U,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>{_(r.cron_expression??""),S(!0)},children:t.jsx(Ee,{size:13,className:"text-muted-foreground"})}),e[34]=l,e[35]=a,e[36]=j,e[37]=r.cron_expression,e[38]=z):z=e[38];let R;e[39]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(U,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>f(!0),children:t.jsx(Q,{size:13,className:"text-muted-foreground"})}),e[39]=R):R=e[39];let M;e[40]!==g||e[41]!==z?(M=t.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[g,z,R]}),e[40]=g,e[41]=z,e[42]=M):M=e[42];let O;e[43]!==M||e[44]!==A?(O=t.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5 rounded-lg border border-border bg-background group",children:[D,A,M]}),e[43]=M,e[44]=A,e[45]=O):O=e[45];let P;e[46]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsxs(me,{children:[t.jsx(pe,{children:"Remove Starter"}),t.jsx(ue,{children:"Are you sure you want to remove this starter?"})]}),e[46]=P):P=e[46];let V;e[47]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(fe,{children:"Cancel"}),e[47]=V):V=e[47];let E;e[48]!==b?(E=t.jsxs(ge,{children:[P,t.jsxs(xe,{children:[V,t.jsx(he,{onClick:b,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]}),e[48]=b,e[49]=E):E=e[49];let $;e[50]!==x||e[51]!==E?($=t.jsx(ye,{open:x,onOpenChange:f,children:E}),e[50]=x,e[51]=E,e[52]=$):$=e[52];let F;return e[53]!==O||e[54]!==$?(F=t.jsxs(t.Fragment,{children:[O,$]}),e[53]=O,e[54]=$,e[55]=F):F=e[55],F}function jt(s){const e=B.c(41),{selectedId:r,onChange:n}=s,[o,i]=T.useState(!1),x=ot();let f,d;e[0]!==x||e[1]!==r?(d=x.filter(vt),f=r?d.find(p=>p.id===r):null,e[0]=x,e[1]=r,e[2]=f,e[3]=d):(f=e[2],d=e[3]);const l=f;if(l){let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(te,{size:16}),e[4]=p):p=e[4];let _;e[5]!==l.icon||e[6]!==l.title?(_=t.jsx(Me,{icon:l.icon,name:l.title,size:"sm",fallbackIcon:p,className:"rounded-md shrink-0"}),e[5]=l.icon,e[6]=l.title,e[7]=_):_=e[7];let v;e[8]!==l.title?(v=t.jsx("span",{className:"text-sm font-medium truncate",children:l.title}),e[8]=l.title,e[9]=v):v=e[9];let a;e[10]!==_||e[11]!==v?(a=t.jsx(ne,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex items-center gap-3 flex-1 min-w-0 text-left cursor-pointer",children:[_,v]})}),e[10]=_,e[11]=v,e[12]=a):a=e[12];let u;e[13]!==n?(u=A=>{n(A),i(!1)},e[13]=n,e[14]=u):u=e[14];let b;e[15]!==r||e[16]!==u||e[17]!==d?(b=t.jsx(oe,{className:"w-[550px] p-0 overflow-hidden",align:"start",sideOffset:8,children:t.jsx(ee,{virtualMcps:d,selectedVirtualMcpId:r,onVirtualMcpChange:u})}),e[15]=r,e[16]=u,e[17]=d,e[18]=b):b=e[18];let h;e[19]!==o||e[20]!==a||e[21]!==b?(h=t.jsxs(ae,{open:o,onOpenChange:i,children:[a,b]}),e[19]=o,e[20]=a,e[21]=b,e[22]=h):h=e[22];let C;e[23]!==n?(C=()=>n(null),e[23]=n,e[24]=C):C=e[24];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(Q,{size:13}),e[25]=w):w=e[25];let N;e[26]!==C?(N=t.jsx(U,{type:"button",variant:"ghost",size:"icon",className:"shrink-0 size-7 text-muted-foreground hover:text-foreground",onClick:C,title:"Remove agent",children:w}),e[26]=C,e[27]=N):N=e[27];let D;return e[28]!==N||e[29]!==h?(D=t.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-border bg-background hover:bg-accent/50 transition-colors",children:[h,N]}),e[28]=N,e[29]=h,e[30]=D):D=e[30],D}let y;e[31]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(ne,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-border hover:bg-accent/50 transition-colors w-full text-left cursor-pointer",children:[t.jsxs("div",{className:"relative flex items-center justify-center size-8 rounded-md text-muted-foreground/75 shrink-0",children:[t.jsxs("svg",{className:"absolute inset-0 size-full",fill:"none",children:[t.jsx("defs",{children:t.jsxs("linearGradient",{id:"agent-picker-border-gradient",gradientUnits:"userSpaceOnUse",x1:"0",y1:"0",x2:"32",y2:"32",children:[t.jsx("animateTransform",{attributeName:"gradientTransform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"6s",repeatCount:"indefinite"}),t.jsx("stop",{offset:"0%",stopColor:"var(--chart-1)"}),t.jsx("stop",{offset:"100%",stopColor:"var(--chart-4)"})]})}),t.jsx("rect",{x:"0.5",y:"0.5",width:"31",height:"31",rx:"5.5",stroke:"url(#agent-picker-border-gradient)",strokeWidth:"1",strokeDasharray:"3 3"})]}),t.jsx(te,{size:16})]}),t.jsx("span",{className:"text-sm text-muted-foreground",children:"No agent selected. All connections available."})]})}),e[31]=y):y=e[31];let m;e[32]!==n?(m=p=>{n(p),i(!1)},e[32]=n,e[33]=m):m=e[33];let j;e[34]!==r||e[35]!==m||e[36]!==d?(j=t.jsx(oe,{className:"w-[550px] p-0 overflow-hidden",align:"start",sideOffset:8,children:t.jsx(ee,{virtualMcps:d,selectedVirtualMcpId:r,onVirtualMcpChange:m})}),e[34]=r,e[35]=m,e[36]=d,e[37]=j):j=e[37];let S;return e[38]!==o||e[39]!==j?(S=t.jsxs(ae,{open:o,onOpenChange:i,children:[y,j]}),e[38]=o,e[39]=j,e[40]=S):S=e[40],S}function vt(s){return!s.id||!st(s.id)}function bt({automationId:s,automation:e}){const r=Re(),{createTask:n,setVirtualMcpId:o,setSelectedModel:i,sendMessage:x,credentialId:f,model:d}=je(),[,l]=de(),y=e.messages?.[0]?.metadata?.tiptapDoc??void 0,[m,j]=T.useState(y),[S,p]=T.useState(y),[_,v]=T.useState(!1),[a,u]=T.useState(!1),[b,h]=T.useState(""),C=J(),w=T.useRef(!1),N=c=>{j(c),w.current||(w.current=!0,y||p(c))},D=e.models?.credentialId||f||"",A=e.models?.thinking?.id||d?.modelId||"",g=Ce({defaultValues:{name:e.name,active:e.active,agent_id:e.agent?.id??"",credential_id:D,model_id:A}}),z=g.watch("active"),R=g.watch("agent_id"),M=g.watch("credential_id"),O=g.watch("model_id"),{models:P,isLoading:V}=De(M||void 0),E=P.find(c=>c.modelId===O)??null,$=async()=>{const c=g.getValues();try{const L=c.credential_id&&c.model_id?c.credential_id:"",Y=c.credential_id&&c.model_id?c.model_id:"";return await r.mutateAsync({id:s,name:c.name,active:c.active,agent:{id:c.agent_id},models:{credentialId:L,thinking:{id:Y}},messages:ct(m),temperature:0}),g.reset({...c,credential_id:L,model_id:Y}),p(m),I.success("Automation saved"),!0}catch{return I.error("Failed to save automation"),!1}},F=()=>{g.reset(),N(S)},k=g.formState.isDirty||JSON.stringify(m??null)!==JSON.stringify(S??null),q=async()=>{if(k&&!await $())return;if(!m){I.error("No instructions configured for this automation");return}const c=g.getValues();o(c.agent_id||null),E&&M&&i({...E,keyId:M}),l(!0),n(),setTimeout(()=>{x(m,{toolApprovalLevel:"auto"})},0)};return t.jsxs(t.Fragment,{children:[t.jsx(ce,{children:t.jsx(ke,{onSave:async()=>{await $()},onUndo:F,isDirty:k,isSaving:r.isPending})}),t.jsxs("div",{className:"max-w-2xl mx-auto w-full px-6 py-6 flex flex-col gap-8",children:[t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(He,{...g.register("name"),placeholder:"Automation name",className:"border border-transparent shadow-none px-0 text-2xl md:text-2xl font-semibold h-auto focus-visible:ring-0 focus-visible:border-border bg-transparent"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Ne,{control:g.control,name:"active",render:({field:c})=>t.jsx(Ye,{checked:c.value,onCheckedChange:c.onChange,className:"cursor-pointer"})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:z?"Active":"Inactive"}),t.jsx("span",{className:"text-muted-foreground/50 text-sm",children:"·"}),t.jsx($e,{id:e.created_by,size:"2xs",className:"text-sm text-muted-foreground"})]})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Starter"}),t.jsx(gt,{automationId:s,open:_,onOpenChange:v,onCustomSelect:()=>{u(!0),h("")}})]}),e.triggers.length===0&&!a?t.jsx("div",{className:"rounded-lg border border-dashed border-border px-4 py-6 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["When should this automation run?"," ",t.jsx("button",{type:"button",className:"text-foreground underline underline-offset-2 cursor-pointer hover:text-foreground/80 transition-colors",onClick:()=>v(!0),children:"Add a starter"})," ","to get going."]})}):t.jsx("div",{className:"flex flex-col gap-2",children:e.triggers.map(c=>t.jsx(yt,{trigger:c,automationId:s},c.id))}),a&&t.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5 rounded-lg border border-border bg-background group",children:[t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),t.jsx("input",{type:"text",value:b,onChange:c=>h(c.target.value),onBlur:async()=>{const c=b.trim();if(!(!c||!K(c)))try{await C.mutateAsync({automation_id:s,type:"cron",cron_expression:c}),I.success("Starter added"),u(!1),h("")}catch{I.error("Failed to add starter")}},onKeyDown:async c=>{const L=b.trim();c.key==="Enter"&&L&&K(L)&&c.target.blur(),c.key==="Escape"&&(u(!1),h(""))},placeholder:"0 9 * * 1-5",className:"flex-1 text-sm font-mono bg-transparent outline-none placeholder:text-muted-foreground/40",autoFocus:!0}),b&&!K(b)&&t.jsx("span",{className:"text-xs text-muted-foreground/60 shrink-0",children:"invalid"}),C.isPending&&t.jsx(W,{size:13,className:"animate-spin text-muted-foreground shrink-0"}),t.jsx("button",{type:"button",className:"shrink-0 p-0.5 rounded text-muted-foreground opacity-0 group-hover:opacity-100 hover:text-foreground transition-opacity",onClick:()=>{u(!1),h("")},children:t.jsx(Q,{size:13})})]})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Agent"}),t.jsx(jt,{selectedId:R||null,onChange:c=>g.setValue("agent_id",c??"",{shouldDirty:!0})})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Instructions"}),t.jsx(Ae,{tiptapDoc:m,setTiptapDoc:N,placeholder:"What should this automation do?",children:t.jsxs("div",{className:"rounded-xl border border-border min-h-[120px] flex flex-col",children:[t.jsx(Te,{virtualMcpId:R||null}),t.jsxs("div",{className:"flex items-center justify-end gap-1.5 p-2.5",children:[t.jsx(Ie,{model:E,isLoading:V,credentialId:M||null,onCredentialChange:c=>{g.setValue("credential_id",c??"",{shouldDirty:!0}),g.setValue("model_id","",{shouldDirty:!0})},onModelChange:c=>g.setValue("model_id",c.modelId,{shouldDirty:!0}),placeholder:"Model"}),t.jsxs(Xe,{children:[t.jsx(Ze,{asChild:!0,children:t.jsxs(U,{type:"button",variant:"default",className:"h-8 gap-1.5 rounded-md px-3 text-sm font-medium",onClick:q,children:[t.jsx(at,{size:16}),"Test"]})}),t.jsx(et,{children:"Test Automation"})]})]})]})})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Run History"}),t.jsx(Ct,{automationId:s,triggerIds:e.triggers.map(c=>c.id)})]})]})]})}function _t(s,e,r){const n=B.c(13);let o;n[0]!==s?(o={connectionId:nt,orgId:s},n[0]=s,n[1]=o):o=n[1];const i=rt(o);let x;n[2]!==e||n[3]!==s||n[4]!==r?(x=G.automationRuns(s,e,r),n[2]=e,n[3]=s,n[4]=r,n[5]=x):x=n[5];let f;n[6]!==i||n[7]!==r?(f=async()=>{if(!i)throw new Error("MCP client not available");const y=await i.callTool({name:"COLLECTION_THREADS_LIST",arguments:{where:{trigger_ids:r},limit:20}});return(y.structuredContent??y).items??[]},n[6]=i,n[7]=r,n[8]=f):f=n[8];const d=r.length>0;let l;return n[9]!==x||n[10]!==f||n[11]!==d?(l={queryKey:x,queryFn:f,enabled:d},n[9]=x,n[10]=f,n[11]=d,n[12]=l):l=n[12],tt(l)}function Ct(s){const e=B.c(22),{automationId:r,triggerIds:n}=s,{org:o}=ie(),{switchToTask:i}=je(),[,x]=de(),f=Se(),{data:d,isLoading:l}=_t(o.id,r,n),y=n.length>0;let m;e[0]!==r||e[1]!==o.id||e[2]!==f||e[3]!==d||e[4]!==n?(m=a=>{const u=a.subject,b=d??[];b.find(C=>C.id===u)?f.setQueryData(G.automationRuns(o.id,r,n),b.map(C=>C.id===u?{...C,status:a.data.status,updated_at:new Date().toISOString()}:C)):f.invalidateQueries({queryKey:G.automationRuns(o.id,r,n)})},e[0]=r,e[1]=o.id,e[2]=f,e[3]=d,e[4]=n,e[5]=m):m=e[5];let j;if(e[6]!==o.id||e[7]!==y||e[8]!==m?(j={orgId:o.id,enabled:y,onTaskStatus:m},e[6]=o.id,e[7]=y,e[8]=m,e[9]=j):j=e[9],dt(j),l){let a;return e[10]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(W,{size:18,className:"animate-spin text-muted-foreground"})}),e[10]=a):a=e[10],a}if(!d||d.length===0){let a;return e[11]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(le,{image:null,className:"mt-6",title:"No run history",description:"Run history will appear here when the automation has been triggered."}),e[11]=a):a=e[11],a}let S;e[12]!==x||e[13]!==i?(S=async a=>{await i(a),x(!0)},e[12]=x,e[13]=i,e[14]=S):S=e[14];const p=S;let _;if(e[15]!==p||e[16]!==d){let a;e[18]!==p?(a=u=>{const b=Z[u.status]??Z.completed,h=b.icon;return t.jsxs("button",{type:"button",className:"flex items-center gap-3 px-1 py-2.5 text-left hover:bg-accent/50 transition-colors cursor-pointer rounded-sm",onClick:()=>p(u.id),children:[t.jsx(h,{size:16,className:b.iconClassName}),t.jsx("span",{className:"flex-1 min-w-0 text-sm truncate",children:u.title}),t.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:mt(new Date(u.updated_at),{addSuffix:!0})})]},u.id)},e[18]=p,e[19]=a):a=e[19],_=d.map(a),e[15]=p,e[16]=d,e[17]=_}else _=e[17];let v;return e[20]!==_?(v=t.jsx("div",{className:"flex flex-col divide-y divide-border",children:_}),e[20]=_,e[21]=v):v=e[21],v}function Ys(){const s=B.c(36);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},s[0]=e):e=s[0];const{automationId:r}=ve(e),n=be(),{org:o}=ie(),{data:i,isLoading:x}=ze(r),f=Oe(),[d,l]=T.useState(!1);let y;s[1]!==r||s[2]!==f||s[3]!==n||s[4]!==o?(y=async()=>{try{await f.mutateAsync(r),I.success("Automation deleted"),n({to:"/$org/$project/automations",params:{org:o.slug,project:X}})}catch{I.error("Failed to delete automation")}l(!1)},s[1]=r,s[2]=f,s[3]=n,s[4]=o,s[5]=y):y=s[5];const m=y;if(x){let g;return s[6]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx(W,{size:24,className:"animate-spin text-muted-foreground"})}),s[6]=g):g=s[6],g}if(!i){let g;return s[7]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(le,{title:"Automation not found",description:"This automation may have been deleted."}),s[7]=g):g=s[7],g}let j;s[8]!==o.slug?(j=t.jsx(se,{children:t.jsx(Ve,{asChild:!0,children:t.jsx(_e,{to:"/$org/$project/automations",params:{org:o.slug,project:X},children:"Automations"})})}),s[8]=o.slug,s[9]=j):j=s[9];let S;s[10]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Le,{}),s[10]=S):S=s[10];let p;s[11]!==i.name?(p=t.jsx(se,{children:t.jsx(Fe,{children:i.name})}),s[11]=i.name,s[12]=p):p=s[12];let _;s[13]!==j||s[14]!==p?(_=t.jsx(Ue,{children:t.jsxs(Be,{children:[j,S,p]})}),s[13]=j,s[14]=p,s[15]=_):_=s[15];const v=_;let a;s[16]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(ce,{children:t.jsxs(U,{variant:"ghost",size:"sm",className:"h-7 text-destructive hover:text-destructive",onClick:()=>l(!0),children:[t.jsx(lt,{size:14}),"Delete"]})}),s[16]=a):a=s[16];let u;s[17]!==i||s[18]!==r?(u=t.jsx(bt,{automationId:r,automation:i},r),s[17]=i,s[18]=r,s[19]=u):u=s[19];let b;s[20]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(pe,{children:"Delete Automation"}),s[20]=b):b=s[20];let h;s[21]!==i.name?(h=t.jsxs(me,{children:[b,t.jsxs(ue,{children:['Are you sure you want to delete "',i.name,'"? This action cannot be undone.']})]}),s[21]=i.name,s[22]=h):h=s[22];let C;s[23]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(fe,{children:"Cancel"}),s[23]=C):C=s[23];let w;s[24]!==m?(w=t.jsxs(xe,{children:[C,t.jsx(he,{onClick:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),s[24]=m,s[25]=w):w=s[25];let N;s[26]!==w||s[27]!==h?(N=t.jsxs(ge,{children:[h,w]}),s[26]=w,s[27]=h,s[28]=N):N=s[28];let D;s[29]!==d||s[30]!==N?(D=t.jsx(ye,{open:d,onOpenChange:l,children:N}),s[29]=d,s[30]=N,s[31]=D):D=s[31];let A;return s[32]!==v||s[33]!==D||s[34]!==u?(A=t.jsxs(we,{breadcrumb:v,children:[a,u,D]}),s[32]=v,s[33]=D,s[34]=u,s[35]=A):A=s[35],A}export{Ys as default};
@@ -1 +1 @@
1
- import{f as S,c as _,r as $,O as u,j as e,B as p,y as B,w as h}from"./index-D49VqQ7Q.js";import{C as I}from"./collection-search-fzGK39qM.js";import{E as L}from"./empty-state-B8NhLY9v.js";import{P as l}from"./index-CtkIjbbq.js";import{u as M,a as E,b as H}from"./use-automations-DhJnP2CA.js";import{u as O}from"./use-list-state-BG8gUSh9.js";import{U as R}from"./user-DXILGeu2.js";import{f as F,a as K,b as U,c as G,d as J,e as V,A as q,h as Q}from"./alert-dialog-Bke1xnyn.js";import{B as W}from"./badge-DGQ0gFlp.js";import{B as X,a as Y,b as Z,c as ee}from"./breadcrumb-BBMvtdg-.js";import{D as se,a as te,b as ae,c as y}from"./dropdown-menu-BK29e1o0.js";import{T as re,a as ie,b as C,c as ne,d as oe,e as c}from"./table-w828HACk.js";import{i as le,n as ce}from"./ArrowUp-D6ltkV3R.js";import{a as de,i as me,s as ue}from"./RefreshCcw01-Co0-i94o.js";import{i as x}from"./Loading01-BVCg1O_G.js";import{s as A}from"./Plus-DcVtqCMV.js";import{s as pe}from"./Trash01-CBP9WLeP.js";import"./SearchMd-CVvF1HpM.js";import"./input-BoNWsfmK.js";import"./useQuery-CvkH2gG1.js";import"./useMutation-BTUmJffP.js";import"./tooltip-DJkxXViN.js";import"./index-BkAoKVx8.js";import"./X-Dr-hR03I.js";import"./constants-TLV7MTwP.js";import"./use-view-mode-BGEJ9JzM.js";import"./avatar-BZ4Frci2.js";import"./User01-CItwHvE1.js";import"./ChevronRight-Dxvchjxo.js";import"./Check-Dczm9Dfw.js";function Ue(){const g=S(),{org:j,locator:D}=_(),{data:r,isLoading:k}=M(),n=E(),T=H(),[d,m]=$.useState(null),t=O({namespace:j.slug,resource:"automations",defaultViewMode:"table"}),f=D.split("/")[0]??j.slug??u,b=async()=>{try{const s=await n.mutateAsync({name:"New Automation",agent:{id:"",mode:"passthrough"},messages:[],models:{credentialId:"",thinking:{id:""}},temperature:.5,active:!0});g({to:"/$org/$project/automations/$automationId",params:{org:f,project:u,automationId:s.id}})}catch{h.error("Failed to create automation")}},z=async()=>{if(d)try{await T.mutateAsync(d.id),h.success("Automation deleted")}catch{h.error("Failed to delete automation")}finally{m(null)}},N=s=>{g({to:"/$org/$project/automations/$automationId",params:{org:f,project:u,automationId:s}})},w=(r??[]).filter(s=>t.searchTerm?s.name.toLowerCase().includes(t.searchTerm.toLowerCase()):!0).sort((s,a)=>{if(!t.sortDirection)return 0;const o=t.sortDirection==="asc"?1:-1,i=t.sortKey;return i==="name"?s.name.localeCompare(a.name)*o:i==="active"?((s.active?1:0)-(a.active?1:0))*o:i==="trigger_count"?((s.trigger_count??0)-(a.trigger_count??0))*o:0}),P="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider group transition-colors select-none";return e.jsxs(l,{children:[e.jsxs(l.Header,{children:[e.jsx(l.Header.Left,{children:e.jsx(X,{children:e.jsx(Y,{children:e.jsx(Z,{children:e.jsxs(ee,{className:"flex items-center gap-2",children:["Automations",r&&r.length>0&&e.jsxs("span",{className:"hidden sm:inline text-xs font-normal text-muted-foreground tabular-nums",children:[r.length," total"]})]})})})})}),e.jsx(l.Header.Right,{children:e.jsxs(p,{size:"sm",onClick:b,disabled:n.isPending,className:"h-7 w-7 px-0 sm:w-auto sm:px-3",children:[n.isPending?e.jsx(x,{size:14,className:"animate-spin"}):e.jsx(A,{size:14}),e.jsx("span",{className:"hidden sm:inline",children:"Create Automation"})]})})]}),e.jsx(I,{value:t.search,onChange:t.setSearch,placeholder:"Search automations...",onKeyDown:s=>{s.key==="Escape"&&(t.setSearch(""),s.target.blur())}}),e.jsxs(l.Content,{children:[k?e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx(x,{size:24,className:"animate-spin text-muted-foreground"})}):!r||r.length===0?e.jsx("div",{className:"flex items-center h-full",children:e.jsx(L,{image:e.jsx(de,{size:48,className:"text-muted-foreground"}),title:"No automations yet",description:"Automations run tasks on a schedule or in response to events.",actions:e.jsxs(p,{size:"sm",onClick:b,disabled:n.isPending,children:[n.isPending?e.jsx(x,{size:14,className:"animate-spin"}):e.jsx(A,{size:14}),"Create Automation"]})})}):e.jsxs(re,{className:"w-full border-collapse",children:[e.jsx(ie,{className:"border-b-0",children:e.jsx(C,{className:"h-9 hover:bg-transparent border-b border-border",children:[{id:"name",label:"Name",className:"flex-1 min-w-0 cursor-pointer hover:bg-accent"},{id:"active",label:"Status",className:"w-24 shrink-0 cursor-pointer hover:bg-accent"},{id:"trigger_count",label:"Triggers",className:"w-24 shrink-0 cursor-pointer hover:bg-accent"},{id:"created_by",label:"Created by",className:"w-40 shrink-0"},{id:"_actions",label:"",className:"w-12 shrink-0"}].map(({id:s,label:a,className:o})=>{const i=t.sortKey===s,v=s!=="created_by"&&s!=="_actions";return e.jsx(ne,{className:B(P,o),onClick:v?()=>t.handleSort(s):void 0,children:e.jsxs("span",{className:"flex items-center gap-1",children:[a,v&&e.jsxs("span",{className:"w-4 flex items-center justify-center",children:[i&&t.sortDirection==="asc"&&e.jsx(le,{size:12,className:"text-muted-foreground"}),i&&t.sortDirection==="desc"&&e.jsx(ce,{size:12,className:"text-muted-foreground"})]})]})},s)})})}),e.jsx(oe,{children:w.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:5,className:"py-16 text-center",children:e.jsxs("span",{className:"text-sm text-muted-foreground",children:['No automations match "',t.search,'"']})})}):w.map(s=>e.jsxs(C,{className:"group/data-row border-b-0 hover:bg-accent/50 cursor-pointer transition-colors",onClick:()=>N(s.id),children:[e.jsx(c,{className:"px-5 py-4 h-16 align-middle text-sm font-medium text-foreground flex-1 min-w-0",children:s.name}),e.jsx(c,{className:"px-5 py-4 h-16 align-middle w-24 shrink-0",children:e.jsx(W,{variant:s.active?"default":"secondary",children:s.active?"Active":"Inactive"})}),e.jsx(c,{className:"px-5 py-4 h-16 align-middle text-sm text-muted-foreground w-24 shrink-0",children:s.trigger_count}),e.jsx(c,{className:"px-5 py-4 h-16 align-middle w-40 shrink-0",children:e.jsx(R,{id:s.created_by})}),e.jsx(c,{className:"px-5 py-4 h-16 align-middle w-12 shrink-0",children:e.jsxs(se,{children:[e.jsx(te,{asChild:!0,children:e.jsx(p,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:a=>a.stopPropagation(),children:e.jsx(me,{size:20})})}),e.jsxs(ae,{align:"end",onClick:a=>a.stopPropagation(),children:[e.jsxs(y,{onClick:a=>{a.stopPropagation(),N(s.id)},children:[e.jsx(ue,{size:16}),"Open"]}),e.jsxs(y,{variant:"destructive",onClick:a=>{a.stopPropagation(),m({id:s.id,name:s.name})},children:[e.jsx(pe,{size:16}),"Delete"]})]})]})})]},s.id))})]}),e.jsx(F,{open:!!d,onOpenChange:s=>!s&&m(null),children:e.jsxs(K,{children:[e.jsxs(U,{children:[e.jsx(G,{children:"Delete Automation?"}),e.jsxs(J,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:d?.name}),". All triggers will be removed."]})]}),e.jsxs(V,{children:[e.jsx(q,{children:"Cancel"}),e.jsx(Q,{onClick:z,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})]})}export{Ue as default};
1
+ import{f as S,c as _,r as $,O as u,j as e,B as p,y as B,w as h}from"./index-Y_g6-sbQ.js";import{C as I}from"./collection-search-R3szwhKc.js";import{E as L}from"./empty-state-5hCgVmoA.js";import{P as l}from"./index-BlVIyhiN.js";import{u as M,a as E,b as H}from"./use-automations-DSFrBv_6.js";import{u as O}from"./use-list-state-DlUAsHMe.js";import{U as R}from"./user-BOuwXTIR.js";import{f as F,a as K,b as U,c as G,d as J,e as V,A as q,h as Q}from"./alert-dialog-BIZOEctM.js";import{B as W}from"./badge-CintUB2m.js";import{B as X,a as Y,b as Z,c as ee}from"./breadcrumb-CCT_gYCX.js";import{D as se,a as te,b as ae,c as y}from"./dropdown-menu-BGBf4SQr.js";import{T as re,a as ie,b as C,c as ne,d as oe,e as c}from"./table-CvtSPXA4.js";import{i as le,n as ce}from"./ArrowUp-CiCCsmLU.js";import{a as de,i as me,s as ue}from"./RefreshCcw01-Dbe0-ztA.js";import{i as x}from"./Loading01-DTPGNGDe.js";import{s as A}from"./Plus-VNSvGQN9.js";import{s as pe}from"./Trash01-p_-P7rrZ.js";import"./SearchMd-BVguqJPF.js";import"./input-BJjZBSH8.js";import"./useQuery-DKMHT49Q.js";import"./useMutation-09-2Qwl6.js";import"./tooltip-Cem552VW.js";import"./index-CT7BYuwf.js";import"./X-AnvD8fGN.js";import"./constants-Cf6w8uWj.js";import"./use-view-mode-CUtH8BDh.js";import"./avatar-BDzYYIB_.js";import"./User01-C1Py8RLi.js";import"./ChevronRight-BvErZvXV.js";import"./Check-DsqqbwRv.js";function Ue(){const g=S(),{org:j,locator:D}=_(),{data:r,isLoading:k}=M(),n=E(),T=H(),[d,m]=$.useState(null),t=O({namespace:j.slug,resource:"automations",defaultViewMode:"table"}),f=D.split("/")[0]??j.slug??u,b=async()=>{try{const s=await n.mutateAsync({name:"New Automation",agent:{id:"",mode:"passthrough"},messages:[],models:{credentialId:"",thinking:{id:""}},temperature:.5,active:!0});g({to:"/$org/$project/automations/$automationId",params:{org:f,project:u,automationId:s.id}})}catch{h.error("Failed to create automation")}},z=async()=>{if(d)try{await T.mutateAsync(d.id),h.success("Automation deleted")}catch{h.error("Failed to delete automation")}finally{m(null)}},N=s=>{g({to:"/$org/$project/automations/$automationId",params:{org:f,project:u,automationId:s}})},w=(r??[]).filter(s=>t.searchTerm?s.name.toLowerCase().includes(t.searchTerm.toLowerCase()):!0).sort((s,a)=>{if(!t.sortDirection)return 0;const o=t.sortDirection==="asc"?1:-1,i=t.sortKey;return i==="name"?s.name.localeCompare(a.name)*o:i==="active"?((s.active?1:0)-(a.active?1:0))*o:i==="trigger_count"?((s.trigger_count??0)-(a.trigger_count??0))*o:0}),P="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider group transition-colors select-none";return e.jsxs(l,{children:[e.jsxs(l.Header,{children:[e.jsx(l.Header.Left,{children:e.jsx(X,{children:e.jsx(Y,{children:e.jsx(Z,{children:e.jsxs(ee,{className:"flex items-center gap-2",children:["Automations",r&&r.length>0&&e.jsxs("span",{className:"hidden sm:inline text-xs font-normal text-muted-foreground tabular-nums",children:[r.length," total"]})]})})})})}),e.jsx(l.Header.Right,{children:e.jsxs(p,{size:"sm",onClick:b,disabled:n.isPending,className:"h-7 w-7 px-0 sm:w-auto sm:px-3",children:[n.isPending?e.jsx(x,{size:14,className:"animate-spin"}):e.jsx(A,{size:14}),e.jsx("span",{className:"hidden sm:inline",children:"Create Automation"})]})})]}),e.jsx(I,{value:t.search,onChange:t.setSearch,placeholder:"Search automations...",onKeyDown:s=>{s.key==="Escape"&&(t.setSearch(""),s.target.blur())}}),e.jsxs(l.Content,{children:[k?e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx(x,{size:24,className:"animate-spin text-muted-foreground"})}):!r||r.length===0?e.jsx("div",{className:"flex items-center h-full",children:e.jsx(L,{image:e.jsx(de,{size:48,className:"text-muted-foreground"}),title:"No automations yet",description:"Automations run tasks on a schedule or in response to events.",actions:e.jsxs(p,{size:"sm",onClick:b,disabled:n.isPending,children:[n.isPending?e.jsx(x,{size:14,className:"animate-spin"}):e.jsx(A,{size:14}),"Create Automation"]})})}):e.jsxs(re,{className:"w-full border-collapse",children:[e.jsx(ie,{className:"border-b-0",children:e.jsx(C,{className:"h-9 hover:bg-transparent border-b border-border",children:[{id:"name",label:"Name",className:"flex-1 min-w-0 cursor-pointer hover:bg-accent"},{id:"active",label:"Status",className:"w-24 shrink-0 cursor-pointer hover:bg-accent"},{id:"trigger_count",label:"Triggers",className:"w-24 shrink-0 cursor-pointer hover:bg-accent"},{id:"created_by",label:"Created by",className:"w-40 shrink-0"},{id:"_actions",label:"",className:"w-12 shrink-0"}].map(({id:s,label:a,className:o})=>{const i=t.sortKey===s,v=s!=="created_by"&&s!=="_actions";return e.jsx(ne,{className:B(P,o),onClick:v?()=>t.handleSort(s):void 0,children:e.jsxs("span",{className:"flex items-center gap-1",children:[a,v&&e.jsxs("span",{className:"w-4 flex items-center justify-center",children:[i&&t.sortDirection==="asc"&&e.jsx(le,{size:12,className:"text-muted-foreground"}),i&&t.sortDirection==="desc"&&e.jsx(ce,{size:12,className:"text-muted-foreground"})]})]})},s)})})}),e.jsx(oe,{children:w.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:5,className:"py-16 text-center",children:e.jsxs("span",{className:"text-sm text-muted-foreground",children:['No automations match "',t.search,'"']})})}):w.map(s=>e.jsxs(C,{className:"group/data-row border-b-0 hover:bg-accent/50 cursor-pointer transition-colors",onClick:()=>N(s.id),children:[e.jsx(c,{className:"px-5 py-4 h-16 align-middle text-sm font-medium text-foreground flex-1 min-w-0",children:s.name}),e.jsx(c,{className:"px-5 py-4 h-16 align-middle w-24 shrink-0",children:e.jsx(W,{variant:s.active?"default":"secondary",children:s.active?"Active":"Inactive"})}),e.jsx(c,{className:"px-5 py-4 h-16 align-middle text-sm text-muted-foreground w-24 shrink-0",children:s.trigger_count}),e.jsx(c,{className:"px-5 py-4 h-16 align-middle w-40 shrink-0",children:e.jsx(R,{id:s.created_by})}),e.jsx(c,{className:"px-5 py-4 h-16 align-middle w-12 shrink-0",children:e.jsxs(se,{children:[e.jsx(te,{asChild:!0,children:e.jsx(p,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:a=>a.stopPropagation(),children:e.jsx(me,{size:20})})}),e.jsxs(ae,{align:"end",onClick:a=>a.stopPropagation(),children:[e.jsxs(y,{onClick:a=>{a.stopPropagation(),N(s.id)},children:[e.jsx(ue,{size:16}),"Open"]}),e.jsxs(y,{variant:"destructive",onClick:a=>{a.stopPropagation(),m({id:s.id,name:s.name})},children:[e.jsx(pe,{size:16}),"Delete"]})]})]})})]},s.id))})]}),e.jsx(F,{open:!!d,onOpenChange:s=>!s&&m(null),children:e.jsxs(K,{children:[e.jsxs(U,{children:[e.jsx(G,{children:"Delete Automation?"}),e.jsxs(J,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:d?.name}),". All triggers will be removed."]})]}),e.jsxs(V,{children:[e.jsx(q,{children:"Cancel"}),e.jsx(Q,{onClick:z,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})]})}export{Ue as default};
@@ -1 +1 @@
1
- import{d as k,j as i,r as V,y as m,X as S,az as $,aA as O,aB as U}from"./index-D49VqQ7Q.js";import{s as L}from"./User01-CItwHvE1.js";function M(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("relative flex size-8 shrink-0 overflow-hidden rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(U,{"data-slot":"avatar",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function T(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("aspect-square size-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx($,{"data-slot":"avatar-image",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function _(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("bg-muted flex size-full items-center justify-center rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(O,{"data-slot":"avatar-fallback",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}const R=["drop-shadow-lg bg-gradient-to-br from-red-100 to-red-300 text-red-800 shadow-lg shadow-red-300/40 ring-1 ring-red-300/30","drop-shadow-lg bg-gradient-to-br from-lime-100 to-lime-300 text-lime-800 shadow-lg shadow-lime-300/40 ring-1 ring-lime-300/30","drop-shadow-lg bg-gradient-to-br from-emerald-100 to-emerald-300 text-emerald-800 shadow-lg shadow-emerald-300/40 ring-1 ring-emerald-300/30","drop-shadow-lg bg-gradient-to-br from-orange-100 to-orange-300 text-orange-800 shadow-lg shadow-orange-300/40 ring-1 ring-orange-300/30","drop-shadow-lg bg-gradient-to-br from-amber-100 to-amber-300 text-amber-800 shadow-lg shadow-amber-300/40 ring-1 ring-amber-300/30","drop-shadow-lg bg-gradient-to-br from-yellow-100 to-yellow-300 text-yellow-800 shadow-lg shadow-yellow-300/40 ring-1 ring-yellow-300/30","drop-shadow-lg bg-gradient-to-br from-green-100 to-green-300 text-green-800 shadow-lg shadow-green-300/40 ring-1 ring-green-300/30","drop-shadow-lg bg-gradient-to-br from-teal-100 to-teal-300 text-teal-800 shadow-lg shadow-teal-300/40 ring-1 ring-teal-300/30","drop-shadow-lg bg-gradient-to-br from-cyan-100 to-cyan-300 text-cyan-800 shadow-lg shadow-cyan-300/40 ring-1 ring-cyan-300/30","drop-shadow-lg bg-gradient-to-br from-sky-100 to-sky-300 text-sky-800 shadow-lg shadow-sky-300/40 ring-1 ring-sky-300/30","drop-shadow-lg bg-gradient-to-br from-blue-100 to-blue-300 text-blue-800 shadow-lg shadow-blue-300/40 ring-1 ring-blue-300/30","drop-shadow-lg bg-gradient-to-br from-indigo-100 to-indigo-300 text-indigo-800 shadow-lg shadow-indigo-300/40 ring-1 ring-indigo-300/30","drop-shadow-lg bg-gradient-to-br from-violet-100 to-violet-300 text-violet-800 shadow-lg shadow-violet-300/40 ring-1 ring-violet-300/30","drop-shadow-lg bg-gradient-to-br from-purple-100 to-purple-300 text-purple-800 shadow-lg shadow-purple-300/40 ring-1 ring-purple-300/30","drop-shadow-lg bg-gradient-to-br from-fuchsia-100 to-fuchsia-300 text-fuchsia-800 shadow-lg shadow-fuchsia-300/40 ring-1 ring-fuchsia-300/30","drop-shadow-lg bg-gradient-to-br from-pink-100 to-pink-300 text-pink-800 shadow-lg shadow-pink-300/40 ring-1 ring-pink-300/30","drop-shadow-lg bg-gradient-to-br from-rose-100 to-rose-300 text-rose-800 shadow-lg shadow-rose-300/40 ring-1 ring-rose-300/30"],B="drop-shadow-lg text-muted-foreground bg-muted shadow-lg";function D(r){let e=0;for(let t=0;t<r.length;t++)e=r.charCodeAt(t)+((e<<5)-e);const s=Math.abs(e)%R.length;return R[s]}const I=S("border border-border",{variants:{shape:{circle:"rounded-full",square:""},size:{"3xs":"w-3 h-3 text-[7px] font-semibold","2xs":"w-4 h-4 text-[9px] font-semibold",xs:"w-6 h-6 text-sm font-semibold",sm:"w-8 h-8 text-lg font-semibold",base:"w-10 h-10 text-2xl font-semibold",lg:"w-12 h-12 text-3xl font-semibold",xl:"w-16 h-16 text-4xl font-semibold","2xl":"w-20 h-20 text-5xl font-semibold","3xl":"w-32 h-32 text-7xl font-semibold"}},compoundVariants:[{shape:"square",size:"xs",class:"rounded-lg"},{shape:"square",size:"sm",class:"rounded-xl"},{shape:"square",size:"base",class:"rounded-xl"},{shape:"square",size:"lg",class:"rounded-xl"},{shape:"square",size:"xl",class:"rounded-2xl"},{shape:"square",size:"2xl",class:"rounded-3xl"},{shape:"square",size:"3xl",class:"rounded-[40px]"}],defaultVariants:{shape:"square",size:"base"}}),W=S("",{variants:{objectFit:{contain:"object-contain",cover:"object-cover"}},defaultVariants:{objectFit:"cover"}}),X=r=>{const e={"3xs":8,"2xs":8,xs:12,sm:16,base:24,lg:28,xl:36,"2xl":48,"3xl":80};return e[r]||e.base};function G(r){const e=k.c(35);let s,t,o,a,n,d,g,l;e[0]!==r?({url:l,fallback:t,shape:a,size:n,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,[f,x]=V.useState(!1);let F;e:{if(typeof t=="string"){let c;e[9]!==t?(c=t.trim().slice(0,2).toUpperCase(),e[9]=t,e[10]=c):c=e[10],F=c;break e}F=t}const C=F;let z;e:{if(j){z=B;break e}if(typeof t=="string"){let c;e[11]!==t?(c=D(t),e[11]=t,e[12]=c):c=e[12],z=c;break e}z=R[0]}const y=z;let N;e[13]!==l?(N=l?.startsWith("icon://"),e[13]=l,e[14]=N):N=e[14];const p=N;let q;e[15]!==p||e[16]!==l?(q=p?l?.replace("icon://",""):void 0,e[15]=p,e[16]=l,e[17]=q):q=e[17];const E=q;let w;e[18]!==s||e[19]!==b||e[20]!==h?(w=m(I({shape:b,size:h}),s),e[18]=s,e[19]=b,e[20]=h,e[21]=w):w=e[21];let v;e[22]!==y||e[23]!==C||e[24]!==E||e[25]!==f||e[26]!==p||e[27]!==u||e[28]!==h||e[29]!==l?(v=p&&E?i.jsx("div",{className:m("flex items-center justify-center w-full h-full",y),children:i.jsx(L,{size:X(h)})}):i.jsxs(i.Fragment,{children:[l&&!f&&i.jsx(T,{src:l,loading:"lazy",alt:"Avatar",className:m(W({objectFit:u})),onError:()=>x(!0)}),(!l||f)&&i.jsx(_,{className:m(y,"rounded-none"),children:C})]}),e[22]=y,e[23]=C,e[24]=E,e[25]=f,e[26]=p,e[27]=u,e[28]=h,e[29]=l,e[30]=v):v=e[30];let A;return e[31]!==o||e[32]!==v||e[33]!==w?(A=i.jsx(M,{className:w,...o,children:v}),e[31]=o,e[32]=v,e[33]=w,e[34]=A):A=e[34],A}function H(r){const e=k.c(18);let s,t,o,a,n,d,g,l;e[0]!==r?({shape:a,size:n,url:l,fallback:t,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,f=h??"base";let x;return e[9]!==s||e[10]!==t||e[11]!==j||e[12]!==u||e[13]!==o||e[14]!==b||e[15]!==f||e[16]!==l?(x=i.jsx(G,{shape:b,url:l,fallback:t,size:f,objectFit:u,className:s,muted:j,...o}),e[9]=s,e[10]=t,e[11]=j,e[12]=u,e[13]=o,e[14]=b,e[15]=f,e[16]=l,e[17]=x):x=e[17],x}H.Skeleton=function({shape:e="square",size:s="base",className:t}){return i.jsx("div",{className:m(I({shape:e,size:s}),"bg-muted animate-pulse",t)})};export{H as A};
1
+ import{d as k,j as i,r as V,y as m,X as S,az as $,aA as O,aB as U}from"./index-Y_g6-sbQ.js";import{s as L}from"./User01-C1Py8RLi.js";function M(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("relative flex size-8 shrink-0 overflow-hidden rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(U,{"data-slot":"avatar",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function T(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("aspect-square size-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx($,{"data-slot":"avatar-image",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function _(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("bg-muted flex size-full items-center justify-center rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(O,{"data-slot":"avatar-fallback",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}const R=["drop-shadow-lg bg-gradient-to-br from-red-100 to-red-300 text-red-800 shadow-lg shadow-red-300/40 ring-1 ring-red-300/30","drop-shadow-lg bg-gradient-to-br from-lime-100 to-lime-300 text-lime-800 shadow-lg shadow-lime-300/40 ring-1 ring-lime-300/30","drop-shadow-lg bg-gradient-to-br from-emerald-100 to-emerald-300 text-emerald-800 shadow-lg shadow-emerald-300/40 ring-1 ring-emerald-300/30","drop-shadow-lg bg-gradient-to-br from-orange-100 to-orange-300 text-orange-800 shadow-lg shadow-orange-300/40 ring-1 ring-orange-300/30","drop-shadow-lg bg-gradient-to-br from-amber-100 to-amber-300 text-amber-800 shadow-lg shadow-amber-300/40 ring-1 ring-amber-300/30","drop-shadow-lg bg-gradient-to-br from-yellow-100 to-yellow-300 text-yellow-800 shadow-lg shadow-yellow-300/40 ring-1 ring-yellow-300/30","drop-shadow-lg bg-gradient-to-br from-green-100 to-green-300 text-green-800 shadow-lg shadow-green-300/40 ring-1 ring-green-300/30","drop-shadow-lg bg-gradient-to-br from-teal-100 to-teal-300 text-teal-800 shadow-lg shadow-teal-300/40 ring-1 ring-teal-300/30","drop-shadow-lg bg-gradient-to-br from-cyan-100 to-cyan-300 text-cyan-800 shadow-lg shadow-cyan-300/40 ring-1 ring-cyan-300/30","drop-shadow-lg bg-gradient-to-br from-sky-100 to-sky-300 text-sky-800 shadow-lg shadow-sky-300/40 ring-1 ring-sky-300/30","drop-shadow-lg bg-gradient-to-br from-blue-100 to-blue-300 text-blue-800 shadow-lg shadow-blue-300/40 ring-1 ring-blue-300/30","drop-shadow-lg bg-gradient-to-br from-indigo-100 to-indigo-300 text-indigo-800 shadow-lg shadow-indigo-300/40 ring-1 ring-indigo-300/30","drop-shadow-lg bg-gradient-to-br from-violet-100 to-violet-300 text-violet-800 shadow-lg shadow-violet-300/40 ring-1 ring-violet-300/30","drop-shadow-lg bg-gradient-to-br from-purple-100 to-purple-300 text-purple-800 shadow-lg shadow-purple-300/40 ring-1 ring-purple-300/30","drop-shadow-lg bg-gradient-to-br from-fuchsia-100 to-fuchsia-300 text-fuchsia-800 shadow-lg shadow-fuchsia-300/40 ring-1 ring-fuchsia-300/30","drop-shadow-lg bg-gradient-to-br from-pink-100 to-pink-300 text-pink-800 shadow-lg shadow-pink-300/40 ring-1 ring-pink-300/30","drop-shadow-lg bg-gradient-to-br from-rose-100 to-rose-300 text-rose-800 shadow-lg shadow-rose-300/40 ring-1 ring-rose-300/30"],B="drop-shadow-lg text-muted-foreground bg-muted shadow-lg";function D(r){let e=0;for(let t=0;t<r.length;t++)e=r.charCodeAt(t)+((e<<5)-e);const s=Math.abs(e)%R.length;return R[s]}const I=S("border border-border",{variants:{shape:{circle:"rounded-full",square:""},size:{"3xs":"w-3 h-3 text-[7px] font-semibold","2xs":"w-4 h-4 text-[9px] font-semibold",xs:"w-6 h-6 text-sm font-semibold",sm:"w-8 h-8 text-lg font-semibold",base:"w-10 h-10 text-2xl font-semibold",lg:"w-12 h-12 text-3xl font-semibold",xl:"w-16 h-16 text-4xl font-semibold","2xl":"w-20 h-20 text-5xl font-semibold","3xl":"w-32 h-32 text-7xl font-semibold"}},compoundVariants:[{shape:"square",size:"xs",class:"rounded-lg"},{shape:"square",size:"sm",class:"rounded-xl"},{shape:"square",size:"base",class:"rounded-xl"},{shape:"square",size:"lg",class:"rounded-xl"},{shape:"square",size:"xl",class:"rounded-2xl"},{shape:"square",size:"2xl",class:"rounded-3xl"},{shape:"square",size:"3xl",class:"rounded-[40px]"}],defaultVariants:{shape:"square",size:"base"}}),W=S("",{variants:{objectFit:{contain:"object-contain",cover:"object-cover"}},defaultVariants:{objectFit:"cover"}}),X=r=>{const e={"3xs":8,"2xs":8,xs:12,sm:16,base:24,lg:28,xl:36,"2xl":48,"3xl":80};return e[r]||e.base};function G(r){const e=k.c(35);let s,t,o,a,n,d,g,l;e[0]!==r?({url:l,fallback:t,shape:a,size:n,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,[f,x]=V.useState(!1);let F;e:{if(typeof t=="string"){let c;e[9]!==t?(c=t.trim().slice(0,2).toUpperCase(),e[9]=t,e[10]=c):c=e[10],F=c;break e}F=t}const C=F;let z;e:{if(j){z=B;break e}if(typeof t=="string"){let c;e[11]!==t?(c=D(t),e[11]=t,e[12]=c):c=e[12],z=c;break e}z=R[0]}const y=z;let N;e[13]!==l?(N=l?.startsWith("icon://"),e[13]=l,e[14]=N):N=e[14];const p=N;let q;e[15]!==p||e[16]!==l?(q=p?l?.replace("icon://",""):void 0,e[15]=p,e[16]=l,e[17]=q):q=e[17];const E=q;let w;e[18]!==s||e[19]!==b||e[20]!==h?(w=m(I({shape:b,size:h}),s),e[18]=s,e[19]=b,e[20]=h,e[21]=w):w=e[21];let v;e[22]!==y||e[23]!==C||e[24]!==E||e[25]!==f||e[26]!==p||e[27]!==u||e[28]!==h||e[29]!==l?(v=p&&E?i.jsx("div",{className:m("flex items-center justify-center w-full h-full",y),children:i.jsx(L,{size:X(h)})}):i.jsxs(i.Fragment,{children:[l&&!f&&i.jsx(T,{src:l,loading:"lazy",alt:"Avatar",className:m(W({objectFit:u})),onError:()=>x(!0)}),(!l||f)&&i.jsx(_,{className:m(y,"rounded-none"),children:C})]}),e[22]=y,e[23]=C,e[24]=E,e[25]=f,e[26]=p,e[27]=u,e[28]=h,e[29]=l,e[30]=v):v=e[30];let A;return e[31]!==o||e[32]!==v||e[33]!==w?(A=i.jsx(M,{className:w,...o,children:v}),e[31]=o,e[32]=v,e[33]=w,e[34]=A):A=e[34],A}function H(r){const e=k.c(18);let s,t,o,a,n,d,g,l;e[0]!==r?({shape:a,size:n,url:l,fallback:t,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,f=h??"base";let x;return e[9]!==s||e[10]!==t||e[11]!==j||e[12]!==u||e[13]!==o||e[14]!==b||e[15]!==f||e[16]!==l?(x=i.jsx(G,{shape:b,url:l,fallback:t,size:f,objectFit:u,className:s,muted:j,...o}),e[9]=s,e[10]=t,e[11]=j,e[12]=u,e[13]=o,e[14]=b,e[15]=f,e[16]=l,e[17]=x):x=e[17],x}H.Skeleton=function({shape:e="square",size:s="base",className:t}){return i.jsx("div",{className:m(I({shape:e,size:s}),"bg-muted animate-pulse",t)})};export{H as A};
@@ -1 +1 @@
1
- import{d,y as u,j as l,Q as v,X as g}from"./index-D49VqQ7Q.js";const b=g("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function x(o){const e=d.c(12);let r,s,a,t;e[0]!==o?({className:r,variant:t,asChild:a,...s}=o,e[0]=o,e[1]=r,e[2]=s,e[3]=a,e[4]=t):(r=e[1],s=e[2],a=e[3],t=e[4]);const c=(a===void 0?!1:a)?v:"span";let i;e[5]!==r||e[6]!==t?(i=u(b({variant:t}),r),e[5]=r,e[6]=t,e[7]=i):i=e[7];let n;return e[8]!==c||e[9]!==s||e[10]!==i?(n=l.jsx(c,{"data-slot":"badge",className:i,...s}),e[8]=c,e[9]=s,e[10]=i,e[11]=n):n=e[11],n}export{x as B};
1
+ import{d,y as u,j as l,Q as v,X as g}from"./index-Y_g6-sbQ.js";const b=g("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function x(o){const e=d.c(12);let r,s,a,t;e[0]!==o?({className:r,variant:t,asChild:a,...s}=o,e[0]=o,e[1]=r,e[2]=s,e[3]=a,e[4]=t):(r=e[1],s=e[2],a=e[3],t=e[4]);const c=(a===void 0?!1:a)?v:"span";let i;e[5]!==r||e[6]!==t?(i=u(b({variant:t}),r),e[5]=r,e[6]=t,e[7]=i):i=e[7];let n;return e[8]!==c||e[9]!==s||e[10]!==i?(n=l.jsx(c,{"data-slot":"badge",className:i,...s}),e[8]=c,e[9]=s,e[10]=i,e[11]=n):n=e[11],n}export{x as B};
@@ -1 +1 @@
1
- import{d as c,y as m,j as o,Q as d}from"./index-D49VqQ7Q.js";import{i as u}from"./ChevronRight-Dxvchjxo.js";function b(r){const e=c.c(8);let a,t;e[0]!==r?({className:a,...t}=r,e[0]=r,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let s;e[3]!==a?(s=m("min-w-0 overflow-hidden",a),e[3]=a,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l=o.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:s,...t}),e[5]=t,e[6]=s,e[7]=l):l=e[7],l}function x(r){const e=c.c(8);let a,t;e[0]!==r?({className:a,...t}=r,e[0]=r,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let s;e[3]!==a?(s=m("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",a),e[3]=a,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l=o.jsx("ol",{"data-slot":"breadcrumb-list",className:s,...t}),e[5]=t,e[6]=s,e[7]=l):l=e[7],l}function N(r){const e=c.c(8);let a,t;e[0]!==r?({className:a,...t}=r,e[0]=r,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let s;e[3]!==a?(s=m("inline-flex items-center gap-1.5 min-w-0",a),e[3]=a,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l=o.jsx("li",{"data-slot":"breadcrumb-item",className:s,...t}),e[5]=t,e[6]=s,e[7]=l):l=e[7],l}function g(r){const e=c.c(10);let a,t,s;e[0]!==r?({asChild:a,className:t,...s}=r,e[0]=r,e[1]=a,e[2]=t,e[3]=s):(a=e[1],t=e[2],s=e[3]);const l=a?d:"a";let i;e[4]!==t?(i=m("hover:text-foreground transition-colors truncate",t),e[4]=t,e[5]=i):i=e[5];let n;return e[6]!==l||e[7]!==s||e[8]!==i?(n=o.jsx(l,{"data-slot":"breadcrumb-link",className:i,...s}),e[6]=l,e[7]=s,e[8]=i,e[9]=n):n=e[9],n}function j(r){const e=c.c(8);let a,t;e[0]!==r?({className:a,...t}=r,e[0]=r,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let s;e[3]!==a?(s=m("text-foreground font-medium truncate",a),e[3]=a,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l=o.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:s,...t}),e[5]=t,e[6]=s,e[7]=l):l=e[7],l}function h(r){const e=c.c(12);let a,t,s;e[0]!==r?({children:a,className:t,...s}=r,e[0]=r,e[1]=a,e[2]=t,e[3]=s):(a=e[1],t=e[2],s=e[3]);let l;e[4]!==t?(l=m("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",t),e[4]=t,e[5]=l):l=e[5];let i;e[6]!==a?(i=a??o.jsx(u,{}),e[6]=a,e[7]=i):i=e[7];let n;return e[8]!==s||e[9]!==l||e[10]!==i?(n=o.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:l,...s,children:i}),e[8]=s,e[9]=l,e[10]=i,e[11]=n):n=e[11],n}export{b as B,x as a,N as b,j as c,g as d,h as e};
1
+ import{d as c,y as m,j as o,Q as d}from"./index-Y_g6-sbQ.js";import{i as u}from"./ChevronRight-BvErZvXV.js";function b(r){const e=c.c(8);let a,t;e[0]!==r?({className:a,...t}=r,e[0]=r,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let s;e[3]!==a?(s=m("min-w-0 overflow-hidden",a),e[3]=a,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l=o.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:s,...t}),e[5]=t,e[6]=s,e[7]=l):l=e[7],l}function x(r){const e=c.c(8);let a,t;e[0]!==r?({className:a,...t}=r,e[0]=r,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let s;e[3]!==a?(s=m("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",a),e[3]=a,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l=o.jsx("ol",{"data-slot":"breadcrumb-list",className:s,...t}),e[5]=t,e[6]=s,e[7]=l):l=e[7],l}function N(r){const e=c.c(8);let a,t;e[0]!==r?({className:a,...t}=r,e[0]=r,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let s;e[3]!==a?(s=m("inline-flex items-center gap-1.5 min-w-0",a),e[3]=a,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l=o.jsx("li",{"data-slot":"breadcrumb-item",className:s,...t}),e[5]=t,e[6]=s,e[7]=l):l=e[7],l}function g(r){const e=c.c(10);let a,t,s;e[0]!==r?({asChild:a,className:t,...s}=r,e[0]=r,e[1]=a,e[2]=t,e[3]=s):(a=e[1],t=e[2],s=e[3]);const l=a?d:"a";let i;e[4]!==t?(i=m("hover:text-foreground transition-colors truncate",t),e[4]=t,e[5]=i):i=e[5];let n;return e[6]!==l||e[7]!==s||e[8]!==i?(n=o.jsx(l,{"data-slot":"breadcrumb-link",className:i,...s}),e[6]=l,e[7]=s,e[8]=i,e[9]=n):n=e[9],n}function j(r){const e=c.c(8);let a,t;e[0]!==r?({className:a,...t}=r,e[0]=r,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let s;e[3]!==a?(s=m("text-foreground font-medium truncate",a),e[3]=a,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l=o.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:s,...t}),e[5]=t,e[6]=s,e[7]=l):l=e[7],l}function h(r){const e=c.c(12);let a,t,s;e[0]!==r?({children:a,className:t,...s}=r,e[0]=r,e[1]=a,e[2]=t,e[3]=s):(a=e[1],t=e[2],s=e[3]);let l;e[4]!==t?(l=m("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",t),e[4]=t,e[5]=l):l=e[5];let i;e[6]!==a?(i=a??o.jsx(u,{}),e[6]=a,e[7]=i):i=e[7];let n;return e[8]!==s||e[9]!==l||e[10]!==i?(n=o.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:l,...s,children:i}),e[8]=s,e[9]=l,e[10]=i,e[11]=n):n=e[11],n}export{b as B,x as a,N as b,j as c,g as d,h as e};
@@ -1 +1 @@
1
- import{d as l,y as d,j as c}from"./index-D49VqQ7Q.js";function x(a){const e=l.c(8);let r,s;e[0]!==a?({className:r,...s}=a,e[0]=a,e[1]=r,e[2]=s):(r=e[1],s=e[2]);let o;e[3]!==r?(o=d("bg-card text-card-foreground hover:bg-accent/50 flex flex-col gap-6 rounded-xl border border-border shadow-xs",r),e[3]=r,e[4]=o):o=e[4];let t;return e[5]!==s||e[6]!==o?(t=c.jsx("div",{"data-slot":"card",className:o,...s}),e[5]=s,e[6]=o,e[7]=t):t=e[7],t}export{x as C};
1
+ import{d as l,y as d,j as c}from"./index-Y_g6-sbQ.js";function x(a){const e=l.c(8);let r,s;e[0]!==a?({className:r,...s}=a,e[0]=a,e[1]=r,e[2]=s):(r=e[1],s=e[2]);let o;e[3]!==r?(o=d("bg-card text-card-foreground hover:bg-accent/50 flex flex-col gap-6 rounded-xl border border-border shadow-xs",r),e[3]=r,e[4]=o):o=e[4];let t;return e[5]!==s||e[6]!==o?(t=c.jsx("div",{"data-slot":"card",className:o,...s}),e[5]=s,e[6]=o,e[7]=t):t=e[7],t}export{x as C};
@@ -1 +1 @@
1
- import{d,y as n,j as c,aF as l,aG as m}from"./index-D49VqQ7Q.js";import{i as b}from"./Check-Dczm9Dfw.js";function x(o){const e=d.c(9);let r,a;e[0]!==o?({className:r,...a}=o,e[0]=o,e[1]=r,e[2]=a):(r=e[1],a=e[2]);let i;e[3]!==r?(i=n("peer border-foreground dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",r),e[3]=r,e[4]=i):i=e[4];let t;e[5]===Symbol.for("react.memo_cache_sentinel")?(t=c.jsx(m,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-primary-foreground transition-none",children:c.jsx(b,{className:"size-3.5"})}),e[5]=t):t=e[5];let s;return e[6]!==a||e[7]!==i?(s=c.jsx(l,{"data-slot":"checkbox",className:i,...a,children:t}),e[6]=a,e[7]=i,e[8]=s):s=e[8],s}export{x as C};
1
+ import{d,y as n,j as c,aF as l,aG as m}from"./index-Y_g6-sbQ.js";import{i as b}from"./Check-DsqqbwRv.js";function x(o){const e=d.c(9);let r,a;e[0]!==o?({className:r,...a}=o,e[0]=o,e[1]=r,e[2]=a):(r=e[1],a=e[2]);let i;e[3]!==r?(i=n("peer border-foreground dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",r),e[3]=r,e[4]=i):i=e[4];let t;e[5]===Symbol.for("react.memo_cache_sentinel")?(t=c.jsx(m,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-primary-foreground transition-none",children:c.jsx(b,{className:"size-3.5"})}),e[5]=t):t=e[5];let s;return e[6]!==a||e[7]!==i?(s=c.jsx(l,{"data-slot":"checkbox",className:i,...a,children:t}),e[6]=a,e[7]=i,e[8]=s):s=e[8],s}export{x as C};
@@ -1 +1 @@
1
- import{d as t,j as i}from"./index-D49VqQ7Q.js";import{R as a,C as r,a as n}from"./index-Dg9iIj2F.js";function f(o){const l=t.c(4);let e;l[0]!==o?({...e}=o,l[0]=o,l[1]=e):e=l[1];let s;return l[2]!==e?(s=i.jsx(a,{"data-slot":"collapsible",...e}),l[2]=e,l[3]=s):s=l[3],s}function b(o){const l=t.c(4);let e;l[0]!==o?({...e}=o,l[0]=o,l[1]=e):e=l[1];let s;return l[2]!==e?(s=i.jsx(r,{"data-slot":"collapsible-trigger",...e}),l[2]=e,l[3]=s):s=l[3],s}function C(o){const l=t.c(4);let e;l[0]!==o?({...e}=o,l[0]=o,l[1]=e):e=l[1];let s;return l[2]!==e?(s=i.jsx(n,{"data-slot":"collapsible-content",...e}),l[2]=e,l[3]=s):s=l[3],s}export{f as C,b as a,C as b};
1
+ import{d as t,j as i}from"./index-Y_g6-sbQ.js";import{R as a,C as r,a as n}from"./index-TzbVkru2.js";function f(o){const l=t.c(4);let e;l[0]!==o?({...e}=o,l[0]=o,l[1]=e):e=l[1];let s;return l[2]!==e?(s=i.jsx(a,{"data-slot":"collapsible",...e}),l[2]=e,l[3]=s):s=l[3],s}function b(o){const l=t.c(4);let e;l[0]!==o?({...e}=o,l[0]=o,l[1]=e):e=l[1];let s;return l[2]!==e?(s=i.jsx(r,{"data-slot":"collapsible-trigger",...e}),l[2]=e,l[3]=s):s=l[3],s}function C(o){const l=t.c(4);let e;l[0]!==o?({...e}=o,l[0]=o,l[1]=e):e=l[1];let s;return l[2]!==e?(s=i.jsx(n,{"data-slot":"collapsible-content",...e}),l[2]=e,l[3]=s):s=l[3],s}export{f as C,b as a,C as b};