@decocms/mesh 2.96.2 → 2.96.3

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 (170) hide show
  1. package/dist/client/assets/{AlertCircle-4DBdKyiN.js → AlertCircle-B74h0Me5.js} +1 -1
  2. package/dist/client/assets/{AlertOctagon-CJ4814e4.js → AlertOctagon-ChhphFDk.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-BbUXsmjT.js → ArrowLeft-ruL5WSCw.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-Cf0ZCNqn.js → ArrowUp-BTMunjeO.js} +1 -1
  5. package/dist/client/assets/{Check-DVZrDl7E.js → Check-Dy1kSzwX.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-CA3HsvdF.js → CheckCircle-BFGOeCKZ.js} +1 -1
  7. package/dist/client/assets/{CheckDone01-CDAeIQ63.js → CheckDone01-CIq1TziU.js} +1 -1
  8. package/dist/client/assets/{ChevronDown-BrnUqul2.js → ChevronDown-CEjoikg0.js} +1 -1
  9. package/dist/client/assets/{ChevronRight-lTpPQGwH.js → ChevronRight-CVpzq9SE.js} +1 -1
  10. package/dist/client/assets/{Clock-BpIUYvY9.js → Clock-BFqtZfyI.js} +1 -1
  11. package/dist/client/assets/{Code01-CgOGThgh.js → Code01-ztcPrUdW.js} +1 -1
  12. package/dist/client/assets/{Container-CMQiv6Ns.js → Container-D5gdKEFc.js} +1 -1
  13. package/dist/client/assets/{Copy01-CMA5_oKx.js → Copy01-eBFwMxtu.js} +1 -1
  14. package/dist/client/assets/{Dataflow03-CJHUSZDC.js → Dataflow03-By6KEPGS.js} +1 -1
  15. package/dist/client/assets/{DotsHorizontal-bihG3j6i.js → DotsHorizontal-BHB6MwwO.js} +1 -1
  16. package/dist/client/assets/{DotsVertical-XqPeTgM4.js → DotsVertical-DDpixXKv.js} +1 -1
  17. package/dist/client/assets/{Download01-COYP-wbM.js → Download01-B-vJTp2a.js} +1 -1
  18. package/dist/client/assets/{Edit01-CN-BVNm7.js → Edit01-DS8TXF8v.js} +1 -1
  19. package/dist/client/assets/{Eye-DBhpblAN.js → Eye-DFOdFQT-.js} +1 -1
  20. package/dist/client/assets/{File02-C2olsFnm.js → File02-CY_WqD-0.js} +1 -1
  21. package/dist/client/assets/{File06-CyuQ1kk7.js → File06-uox_o6En.js} +1 -1
  22. package/dist/client/assets/{FilterLines-DNMtf_47.js → FilterLines-DcDy1u8y.js} +1 -1
  23. package/dist/client/assets/{Globe01-S1shXduq.js → Globe01-W_ezcOw6.js} +1 -1
  24. package/dist/client/assets/{Grid01-BB6GzE_H.js → Grid01-pmpn_yyH.js} +1 -1
  25. package/dist/client/assets/{Home02-9-Cl82ip.js → Home02-BK4iA9ga.js} +1 -1
  26. package/dist/client/assets/{Image01-Bllq3U2e.js → Image01-CjBWTpk6.js} +1 -1
  27. package/dist/client/assets/{Inbox01-_QG6HIJd.js → Inbox01-1y9TGDAK.js} +1 -1
  28. package/dist/client/assets/{InfoCircle-BzKPKNIV.js → InfoCircle-B2WmuOEX.js} +1 -1
  29. package/dist/client/assets/{Key01-kq7PX1YS.js → Key01-DXWjoaTE.js} +1 -1
  30. package/dist/client/assets/{LinkExternal01-B7R1mSP2.js → LinkExternal01-CiZoO6oB.js} +1 -1
  31. package/dist/client/assets/{List-ByKRHbSO.js → List-Yy4oZaIm.js} +1 -1
  32. package/dist/client/assets/{Loading01-C30bDA9h.js → Loading01-BclS8iWV.js} +1 -1
  33. package/dist/client/assets/{Lock01-CMTkVFHx.js → Lock01-D8RoH81a.js} +1 -1
  34. package/dist/client/assets/{Pin01-DpTPW-9K.js → Pin01-DaSjWctK.js} +1 -1
  35. package/dist/client/assets/{Play-BweooOYS.js → Play-P0DrvK6F.js} +1 -1
  36. package/dist/client/assets/{Plus-q5YWe4us.js → Plus-C5LR6cck.js} +1 -1
  37. package/dist/client/assets/{RefreshCcw01-DRWlmqw5.js → RefreshCcw01-DxpF0pWy.js} +1 -1
  38. package/dist/client/assets/{RefreshCw01-Bb8t9XLS.js → RefreshCw01-Cvn_Sesf.js} +1 -1
  39. package/dist/client/assets/{Save01-DXWV5nj4.js → Save01-CAo15i_T.js} +1 -1
  40. package/dist/client/assets/{SearchMd-hERLZOdx.js → SearchMd-DhDCnDEk.js} +1 -1
  41. package/dist/client/assets/{Settings01-K_PXf5Q7.js → Settings01-Di__7g37.js} +1 -1
  42. package/dist/client/assets/{Settings02-ZV7r5q4D.js → Settings02-Cs4oKE9x.js} +1 -1
  43. package/dist/client/assets/{Share07-Dx2Rb32N.js → Share07-CNOl6few.js} +1 -1
  44. package/dist/client/assets/{Terminal-VY7qOx_i.js → Terminal-DhXZE8tI.js} +1 -1
  45. package/dist/client/assets/{Tool01-BP_mkdy3.js → Tool01-D6uiZqcI.js} +1 -1
  46. package/dist/client/assets/{Trash01-Dk9pv506.js → Trash01-fpfGO2En.js} +1 -1
  47. package/dist/client/assets/{Upload01-BokmTptz.js → Upload01-BK6OrHOB.js} +1 -1
  48. package/dist/client/assets/{Users03-C_ymlzx3.js → Users03-9Yj1Oct5.js} +1 -1
  49. package/dist/client/assets/{X-BofIsacr.js → X-D-vCW-FP.js} +1 -1
  50. package/dist/client/assets/{XClose-B9jvydA5.js → XClose-CwzH0SGu.js} +1 -1
  51. package/dist/client/assets/{agent-connections-preview-CcWJACAV.js → agent-connections-preview-Bm7_QMu6.js} +1 -1
  52. package/dist/client/assets/{agent-detail-BTNxaZph.js → agent-detail-C4sYOZn2.js} +1 -1
  53. package/dist/client/assets/{agents-isWhMnyk.js → agents-UG-TRZOf.js} +1 -1
  54. package/dist/client/assets/alert-dialog-C2eeNa17.js +7 -0
  55. package/dist/client/assets/{auth-catchall-BmUeke0B.js → auth-catchall-DsmRXLAK.js} +1 -1
  56. package/dist/client/assets/{avatar-DbtnoOEU.js → avatar-DVIfFxjv.js} +1 -1
  57. package/dist/client/assets/{badge-D_aixLlt.js → badge-Ce8oucop.js} +1 -1
  58. package/dist/client/assets/{binder-BeHB3-7Y.js → binder-B_Z7E1sw.js} +1 -1
  59. package/dist/client/assets/{breadcrumb-ClGbT9Pe.js → breadcrumb-DTOs2A-I.js} +1 -1
  60. package/dist/client/assets/{button-D-PerQqC.js → button-Cxd9D7GZ.js} +1 -1
  61. package/dist/client/assets/{card-ZafkYtyj.js → card-U5Qqs_wY.js} +1 -1
  62. package/dist/client/assets/{checkbox-DGTMQZYw.js → checkbox-QmtfqLqJ.js} +1 -1
  63. package/dist/client/assets/{circle-alert-B5MH-I2D.js → circle-alert-p06JWO6x.js} +1 -1
  64. package/dist/client/assets/{collection-detail-D7K7KZ3j.js → collection-detail-WxZ2NZBP.js} +1 -1
  65. package/dist/client/assets/{collection-search-CFO7XWxi.js → collection-search-BEKSlJnh.js} +1 -1
  66. package/dist/client/assets/{collection-tab-ZK9qGzbi.js → collection-tab-CXhYQfuQ.js} +1 -1
  67. package/dist/client/assets/{collection-table-wrapper-aEUpSjNT.js → collection-table-wrapper-Bq9YQNWy.js} +1 -1
  68. package/dist/client/assets/{collection-tabs-zYgpPtAl.js → collection-tabs-D6wgvS1J.js} +1 -1
  69. package/dist/client/assets/{command-riBVGEeS.js → command-17BNeKxr.js} +1 -1
  70. package/dist/client/assets/{connect-CxlD4pzc.js → connect-D6XC7UNZ.js} +1 -1
  71. package/dist/client/assets/{connection-card-DibEpgAJ.js → connection-card-CHDbSQUC.js} +1 -1
  72. package/dist/client/assets/{connection-detail-VawJXFkM.js → connection-detail-91YS9aaX.js} +1 -1
  73. package/dist/client/assets/{connections-rTehwMXP.js → connections-CH561e8o.js} +1 -1
  74. package/dist/client/assets/{constants-CH9byiKA.js → constants-7tHIXjuz.js} +1 -1
  75. package/dist/client/assets/constants-B1QaD4GY.js +1 -0
  76. package/dist/client/assets/{create-organization-dialog-DBHZfDPt.js → create-organization-dialog-BIJfN6rY.js} +1 -1
  77. package/dist/client/assets/{create-project-dialog-Yqgc0Gmy.js → create-project-dialog-W-9Wb58U.js} +1 -1
  78. package/dist/client/assets/{dialog-CFptoDdD.js → dialog-D36Sp9vM.js} +1 -1
  79. package/dist/client/assets/{dropdown-menu-C8QhWQVm.js → dropdown-menu-D1SDd-O9.js} +1 -1
  80. package/dist/client/assets/{dynamic-plugin-layout-DYwd3Z58.js → dynamic-plugin-layout-iqk4NK_8.js} +1 -1
  81. package/dist/client/assets/{empty-state-DyXzPX9E.js → empty-state-DmFtndPA.js} +1 -1
  82. package/dist/client/assets/{empty-state-DoBcZdM-.js → empty-state-x18Ct7Bg.js} +1 -1
  83. package/dist/client/assets/{env-vars-editor-DyPP_8RR.js → env-vars-editor-CxTFyVmJ.js} +1 -1
  84. package/dist/client/assets/{error-boundary-8guJh7VT.js → error-boundary-BuSNQDm9.js} +1 -1
  85. package/dist/client/assets/{extract-connection-data-DkrrvIEC.js → extract-connection-data-Bxl9-N57.js} +1 -1
  86. package/dist/client/assets/{file-browser-Fvr2IbiZ.js → file-browser-Ca7lIx_M.js} +2 -2
  87. package/dist/client/assets/{form-CtFhf1V_.js → form-C7gcuapm.js} +1 -1
  88. package/dist/client/assets/{grid-view-Ce3NoRpj.js → grid-view-CioJM2m4.js} +1 -1
  89. package/dist/client/assets/{home-BjMglPl-.js → home-CO_-lcJ6.js} +1 -1
  90. package/dist/client/assets/{index-D1S818JH.js → index-APqurMYH.js} +1 -1
  91. package/dist/client/assets/{index-B29giag9.js → index-B0lAKtRh.js} +2 -2
  92. package/dist/client/assets/{index-V777tuW4.js → index-C1cLa9Gd.js} +1 -1
  93. package/dist/client/assets/{index-CwR6GYR2.js → index-C4SaT72q.js} +1 -1
  94. package/dist/client/assets/{index-CrTEMTct.js → index-CuPKLB9d.js} +1 -1
  95. package/dist/client/assets/{index-BCTs9n6O.js → index-CypvbRZN.js} +1 -1
  96. package/dist/client/assets/{index-Bourcgd_.js → index-DCBC9Z8D.js} +1 -1
  97. package/dist/client/assets/{index-BlBYI35m.js → index-Da6ccH2V.js} +1 -1
  98. package/dist/client/assets/{index-D8tHe059.js → index-uvODQDQz.js} +1 -1
  99. package/dist/client/assets/{infiniteQueryObserver-Dzcc9UjY.js → infiniteQueryObserver-B5jHce9f.js} +1 -1
  100. package/dist/client/assets/{input-Cxci79To.js → input-BTRdl8wU.js} +1 -1
  101. package/dist/client/assets/{integration-icon-ByKWru2D.js → integration-icon-Qol0n8Yu.js} +1 -1
  102. package/dist/client/assets/{label-BN7IWnf6.js → label-B-xKop8p.js} +1 -1
  103. package/dist/client/assets/{layout-DUHhpHXf.js → layout-DQVjOYgA.js} +1 -1
  104. package/dist/client/assets/{localstorage-keys-CwGoMvvj.js → localstorage-keys-DE1N3_0b.js} +1 -1
  105. package/dist/client/assets/{login-Ty0R4DxW.js → login-CEoLgQ5J.js} +1 -1
  106. package/dist/client/assets/{mcp-oauth-ChVLA9f3.js → mcp-oauth-fVu6jtVi.js} +1 -1
  107. package/dist/client/assets/{mcp-server-card-DBYZ33HR.js → mcp-server-card-DUsbBMD4.js} +1 -1
  108. package/dist/client/assets/{mcp-server-detail-Du-GkpxI.js → mcp-server-detail-Dc_FNQcM.js} +2 -2
  109. package/dist/client/assets/{members-DsiwYbO8.js → members-6JeadSC6.js} +1 -1
  110. package/dist/client/assets/{monitoring-BlxCJU8J.js → monitoring-B6aMBTbK.js} +2 -2
  111. package/dist/client/assets/{monitoring-dashboard-edit-DSM3xa4Q.js → monitoring-dashboard-edit-D0LJi6WO.js} +1 -1
  112. package/dist/client/assets/{monitoring-dashboard-view-CJ1f1bB7.js → monitoring-dashboard-view-B9KgxuRn.js} +2 -2
  113. package/dist/client/assets/{oauth-callback-DmySymdW.js → oauth-callback-Bao0-Lp_.js} +1 -1
  114. package/dist/client/assets/{page-D0Sa9mFI.js → page-D3AoRnua.js} +1 -1
  115. package/dist/client/assets/{page-Tih4SWMI.js → page-tBi1gMVm.js} +1 -1
  116. package/dist/client/assets/{plugin-empty-state-D05hsZ5h.js → plugin-empty-state-DgG7XCmo.js} +1 -1
  117. package/dist/client/assets/{plugin-empty-state-hheYGSVX.js → plugin-empty-state-KJVP3Tbc.js} +1 -1
  118. package/dist/client/assets/{plugin-header-CE-bMrP6.js → plugin-header-CRttRDjI.js} +1 -1
  119. package/dist/client/assets/{plugin-header-CmN2-mKw.js → plugin-header-gmQgvWvo.js} +1 -1
  120. package/dist/client/assets/{popover-Bq8aZ27v.js → popover-CdY9eVBh.js} +1 -1
  121. package/dist/client/assets/{project-layout-ByRKYVau.js → project-layout-CIS1pzpd.js} +1 -1
  122. package/dist/client/assets/{project-settings-ByYa3pFP.js → project-settings-Dpll6cAV.js} +1 -1
  123. package/dist/client/assets/{projects-list-CDpKF2Ed.js → projects-list-D8CKizs8.js} +1 -1
  124. package/dist/client/assets/{registry-layout-CfGazoo8.js → registry-layout-DV5n9jEh.js} +3 -3
  125. package/dist/client/assets/{registry-utils-6Y4tQn0C.js → registry-utils-icgkdXTH.js} +1 -1
  126. package/dist/client/assets/{resizable-DfSFqzWY.js → resizable-CQB3xYuP.js} +1 -1
  127. package/dist/client/assets/{save-actions-htT4YoqX.js → save-actions-BCWYpxCn.js} +1 -1
  128. package/dist/client/assets/{scroll-area-BJ5bePQ1.js → scroll-area-B6cIs4dW.js} +1 -1
  129. package/dist/client/assets/{select-D6oaQfJS.js → select-vvkW2wBk.js} +1 -1
  130. package/dist/client/assets/{shell-layout-GR3VdFoR.js → shell-layout-Do1GEQEt.js} +3 -3
  131. package/dist/client/assets/{spinner-BstVffOp.js → spinner-BsQXvc2Y.js} +1 -1
  132. package/dist/client/assets/{store-invite-C4VxiywO.js → store-invite-CfCVsnuu.js} +1 -1
  133. package/dist/client/assets/{switch-Bi5F4S-5.js → switch-BezvOOLk.js} +1 -1
  134. package/dist/client/assets/{table-C576YCZw.js → table-Bhjp6CI9.js} +1 -1
  135. package/dist/client/assets/{tasks-BDnJjeaX.js → tasks-DGTypMJH.js} +1 -1
  136. package/dist/client/assets/{textarea-DhETf1og.js → textarea-D0RfPnUt.js} +1 -1
  137. package/dist/client/assets/{time-range-picker-CG48KHqL.js → time-range-picker-BTAPhqft.js} +1 -1
  138. package/dist/client/assets/{toggle-group-BdU9v1nm.js → toggle-group-CTeIuV4q.js} +1 -1
  139. package/dist/client/assets/{tools-list-DhfY_SNs.js → tools-list-K8xKTQ3C.js} +1 -1
  140. package/dist/client/assets/{tooltip-D-FT-fCa.js → tooltip-DkOvFQ7D.js} +1 -1
  141. package/dist/client/assets/{topbar-portal-IUe4pf8g.js → topbar-portal-B2pXZeiz.js} +1 -1
  142. package/dist/client/assets/{typewriter-title-cc0Pz_LM.js → typewriter-title-fOoA67kV.js} +1 -1
  143. package/dist/client/assets/{use-binding-B7W2mOcc.js → use-binding-Dvp-m6Vz.js} +1 -1
  144. package/dist/client/assets/{use-connection-DrWeJHXu.js → use-connection-t2lORAui.js} +1 -1
  145. package/dist/client/assets/{use-copy-BNoj9l5V.js → use-copy-tAcjwV9Y.js} +1 -1
  146. package/dist/client/assets/{use-create-virtual-mcp-DhPfPD_b.js → use-create-virtual-mcp-BUseoHRu.js} +1 -1
  147. package/dist/client/assets/{use-deco-chat-open-B0b2QgDS.js → use-deco-chat-open-BVQclAcG.js} +5 -5
  148. package/dist/client/assets/{use-install-from-registry-BMfOY5TA.js → use-install-from-registry-BcVvP9yq.js} +1 -1
  149. package/dist/client/assets/{use-list-state-qDaPNHfK.js → use-list-state-Lbcc4L0H.js} +1 -1
  150. package/dist/client/assets/{use-llm-DjYTM2HW.js → use-llm-CJX1SR85.js} +1 -1
  151. package/dist/client/assets/{use-mcp-prompts-BMZQCyj7.js → use-mcp-prompts-BjSsl1qM.js} +1 -1
  152. package/dist/client/assets/{use-mcp-tools-CdAhr98j.js → use-mcp-tools-BPlzUo29.js} +1 -1
  153. package/dist/client/assets/{use-mobile-DcwTOp-X.js → use-mobile-BKPcRCzM.js} +1 -1
  154. package/dist/client/assets/{use-organization-settings-6xOluKFM.js → use-organization-settings-CUcA5y45.js} +1 -1
  155. package/dist/client/assets/{use-project-DY_ihdkL.js → use-project-BTuyMFkB.js} +1 -1
  156. package/dist/client/assets/{use-view-mode-CY4TLkHz.js → use-view-mode-CDTkXCJs.js} +1 -1
  157. package/dist/client/assets/{use-virtual-mcp-IiP1g_wm.js → use-virtual-mcp-BPuNbW-j.js} +1 -1
  158. package/dist/client/assets/useInfiniteQuery-Cb7WWrkC.js +1 -0
  159. package/dist/client/assets/{useMutation-WNJB1RXH.js → useMutation-DTtaBOsy.js} +1 -1
  160. package/dist/client/assets/useQuery-Cx1KUbzW.js +1 -0
  161. package/dist/client/assets/useSuspenseInfiniteQuery-CeqWcmOh.js +1 -0
  162. package/dist/client/assets/{view-mode-toggle-CRrDEnZy.js → view-mode-toggle-CPbxqbKZ.js} +1 -1
  163. package/dist/client/assets/{workflow-CD5ePGpY.js → workflow-BOVimVc9.js} +1 -1
  164. package/dist/client/index.html +1 -1
  165. package/package.json +1 -1
  166. package/dist/client/assets/alert-dialog-Cl76sYVz.js +0 -7
  167. package/dist/client/assets/constants-kLsxGUtY.js +0 -1
  168. package/dist/client/assets/useInfiniteQuery-eF9xXIkq.js +0 -1
  169. package/dist/client/assets/useQuery-BO0TdkAU.js +0 -1
  170. package/dist/client/assets/useSuspenseInfiniteQuery-DfH90Jor.js +0 -1
@@ -1 +1 @@
1
- import{r as y,c as we,a as Ee,j as t,u as Me,z as ze,n as Re,K as ve,aM as Le,t as pe}from"./index-B29giag9.js";import{E as We}from"./error-boundary-8guJh7VT.js";import{h as Ae}from"./use-connection-DrWeJHXu.js";import{u as Oe,a as $e}from"./constants-CH9byiKA.js";import{B as re}from"./button-D-PerQqC.js";import{I as le}from"./input-Cxci79To.js";import{I as ke}from"./integration-icon-ByKWru2D.js";import{C as Ve}from"./checkbox-DGTMQZYw.js";import{b as Ue,P as He,a as Ge}from"./popover-Bq8aZ27v.js";import{t as Fe}from"./ChevronDown-BrnUqul2.js";import{S as je,a as be,b as ye,c as Ne,d as w,n as Ke}from"./select-D6oaQfJS.js";import{i as qe}from"./Play-BweooOYS.js";import{s as Qe}from"./Plus-q5YWe4us.js";import{s as Ie}from"./RefreshCw01-Bb8t9XLS.js";import{s as Je}from"./Trash01-Dk9pv506.js";import{T as Ye,a as Se}from"./toggle-group-BdU9v1nm.js";import{a as Ze,V as Xe}from"./layout-DUHhpHXf.js";import{S as et}from"./save-actions-htT4YoqX.js";import{B as tt,a as st,b as Pe,d as rt,e as lt,c as at}from"./breadcrumb-ClGbT9Pe.js";import"./useMutation-WNJB1RXH.js";import"./Container-CMQiv6Ns.js";import"./Check-DVZrDl7E.js";import"./index-V777tuW4.js";import"./index-CwR6GYR2.js";import"./Save01-DXWV5nj4.js";import"./Loading01-C30bDA9h.js";import"./ChevronRight-lTpPQGwH.js";const Be=({size:l=24,color:e="currentColor",...s})=>y.createElement("svg",{viewBox:"0 0 24 24",width:l,height:l,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},y.createElement("path",{d:"M16 10H3m17-4H3m17 8H3m13 4H3"}));Be.displayName="AlignLeft";const _e=({size:l=24,color:e="currentColor",...s})=>y.createElement("svg",{viewBox:"0 0 24 24",width:l,height:l,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},y.createElement("path",{d:"M8 15v2m4-6v6m4-10v10m-8.2 4h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C21 18.72 21 17.88 21 16.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C18.72 3 17.88 3 16.2 3H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21Z"}));_e.displayName="BarChartSquare02";const Te=({size:l=24,color:e="currentColor",...s})=>y.createElement("svg",{viewBox:"0 0 24 24",width:l,height:l,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},y.createElement("path",{d:"m9.5 3-3 18m11-18-3 18m6-13h-17m16 8h-17"}));Te.displayName="Hash02";function De(l){return{id:l.id,name:l.name,type:l.type,sourcePath:l.source.path,sourceFrom:l.source.from,aggregationFn:l.aggregation.fn,groupBy:l.aggregation.groupBy||"",interval:l.aggregation.interval||""}}function it(l){return{id:l.id,name:l.name,type:l.type,source:{path:l.sourcePath,from:l.sourceFrom},aggregation:{fn:l.aggregationFn,groupBy:l.type==="table"&&l.groupBy?l.groupBy:void 0,interval:l.type==="timeseries"&&l.interval?l.interval:void 0}}}const Ce={id:crypto.randomUUID(),name:"",type:"metric",sourcePath:"$.usage.total_tokens",sourceFrom:"output",aggregationFn:"sum",groupBy:"",interval:""};function nt(l){const e=we.c(36),{result:s,widget:o}=l;if(s.error){let i;return e[0]!==s.error?(i=t.jsx("div",{className:"text-sm text-destructive bg-destructive/10 rounded p-3",children:s.error}),e[0]=s.error,e[1]=i):i=e[1],i}if(o.type==="metric"){const i=s.value??0;let d;e[2]!==i?(d=i>=1e6?`${(i/1e6).toFixed(2)}M`:i>=1e3?`${(i/1e3).toFixed(2)}K`:typeof i=="number"?i.toFixed(2):String(i),e[2]=i,e[3]=d):d=e[3];const c=d;let m;e[4]!==c?(m=t.jsx("div",{className:"text-3xl font-bold tabular-nums",children:c}),e[4]=c,e[5]=m):m=e[5];const h=s.matchedRecords??0;let x;e[6]!==h?(x=t.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[h," records matched"]}),e[6]=h,e[7]=x):x=e[7];let f;return e[8]!==m||e[9]!==x?(f=t.jsxs("div",{className:"text-center py-4",children:[m,x]}),e[8]=m,e[9]=x,e[10]=f):f=e[10],f}if(o.type==="table"&&s.groups){let i;e[11]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("thead",{className:"bg-muted/50 sticky top-0",children:t.jsxs("tr",{children:[t.jsx("th",{className:"text-left px-3 py-1.5 text-xs font-medium",children:"Key"}),t.jsx("th",{className:"text-right px-3 py-1.5 text-xs font-medium",children:"Value"})]})}),e[11]=i):i=e[11];let d;e[12]!==s.groups?(d=s.groups.length===0?t.jsx("tr",{children:t.jsx("td",{colSpan:2,className:"px-3 py-4 text-center text-muted-foreground text-xs",children:"No data"})}):s.groups.slice(0,10).map(ct),e[12]=s.groups,e[13]=d):d=e[13];let c;e[14]!==d?(c=t.jsxs("table",{className:"w-full text-sm",children:[i,t.jsx("tbody",{children:d})]}),e[14]=d,e[15]=c):c=e[15];let m;e[16]!==s.groups.length?(m=s.groups.length>10&&t.jsxs("div",{className:"text-xs text-muted-foreground text-center py-2",children:["+",s.groups.length-10," more rows"]}),e[16]=s.groups.length,e[17]=m):m=e[17];let h;return e[18]!==c||e[19]!==m?(h=t.jsxs("div",{className:"max-h-[200px] overflow-auto",children:[c,m]}),e[18]=c,e[19]=m,e[20]=h):h=e[20],h}if(o.type==="timeseries"&&s.timeseries){let i;e[21]!==s.timeseries?(i=Math.max(...s.timeseries.map(ot),1),e[21]=s.timeseries,e[22]=i):i=e[22];const d=i;let c;if(e[23]!==d||e[24]!==s.timeseries){let f;e[26]!==d?(f=(u,S)=>t.jsx("div",{className:"flex-1 bg-primary/80 rounded-t",style:{height:`${u.value/d*100}%`,minHeight:u.value>0?"2px":"0px"},title:`${new Date(u.timestamp).toLocaleString()}: ${u.value}`},S),e[26]=d,e[27]=f):f=e[27],c=s.timeseries.slice(-24).map(f),e[23]=d,e[24]=s.timeseries,e[25]=c}else c=e[25];let m;e[28]!==c?(m=t.jsx("div",{className:"flex items-end gap-0.5 h-[80px]",children:c}),e[28]=c,e[29]=m):m=e[29];let h;e[30]!==s.timeseries.length?(h=t.jsxs("div",{className:"text-xs text-muted-foreground text-center mt-2",children:[s.timeseries.length," data points"]}),e[30]=s.timeseries.length,e[31]=h):h=e[31];let x;return e[32]!==m||e[33]!==h?(x=t.jsxs("div",{className:"py-2",children:[m,h]}),e[32]=m,e[33]=h,e[34]=x):x=e[34],x}let j;return e[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"text-sm text-muted-foreground text-center py-4",children:"No preview data"}),e[35]=j):j=e[35],j}function ot(l){return l.value}function ct(l,e){return t.jsxs("tr",{className:"border-t",children:[t.jsx("td",{className:"px-3 py-1.5 font-mono text-xs",children:l.key}),t.jsx("td",{className:"px-3 py-1.5 text-right tabular-nums text-xs",children:l.value.toLocaleString()})]},e)}function mt(l){const e=we.c(113),{widget:s,onChange:o,onRemove:j,canRemove:i,onMoveUp:d,onMoveDown:c,canMoveUp:m,canMoveDown:h,onPreview:x,previewResult:f,isPreviewing:u}=l,S=!m;let R;e[0]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(Ke,{size:14}),e[0]=R):R=e[0];let D;e[1]!==d||e[2]!==S?(D=t.jsx(re,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:d,disabled:S,children:R}),e[1]=d,e[2]=S,e[3]=D):D=e[3];const ae=!h;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Fe,{size:14}),e[4]=g):g=e[4];let p;e[5]!==c||e[6]!==ae?(p=t.jsx(re,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:c,disabled:ae,children:g}),e[5]=c,e[6]=ae,e[7]=p):p=e[7];let k;e[8]!==D||e[9]!==p?(k=t.jsxs("div",{className:"flex items-center gap-0.5",children:[D,p]}),e[8]=D,e[9]=p,e[10]=k):k=e[10];let C;e[11]!==s.type?(C=t.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:s.type}),e[11]=s.type,e[12]=C):C=e[12];let F;e[13]!==s.name?(F=s.name&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-muted-foreground",children:"·"}),t.jsx("span",{className:"text-sm font-medium",children:s.name})]}),e[13]=s.name,e[14]=F):F=e[14];let B;e[15]!==k||e[16]!==C||e[17]!==F?(B=t.jsxs("div",{className:"flex items-center gap-2",children:[k,C,F]}),e[15]=k,e[16]=C,e[17]=F,e[18]=B):B=e[18];let P;e[19]!==u?(P=u?t.jsx(Ie,{size:14,className:"animate-spin"}):t.jsx(qe,{size:14}),e[19]=u,e[20]=P):P=e[20];let _;e[21]!==u||e[22]!==x||e[23]!==P?(_=t.jsx(re,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:x,disabled:u,children:P}),e[21]=u,e[22]=x,e[23]=P,e[24]=_):_=e[24];const L=!i,ie=i?"visible":"hidden";let T;e[25]!==ie?(T={visibility:ie},e[25]=ie,e[26]=T):T=e[26];let W;e[27]===Symbol.for("react.memo_cache_sentinel")?(W=t.jsx(Je,{size:14}),e[27]=W):W=e[27];let E;e[28]!==j||e[29]!==L||e[30]!==T?(E=t.jsx(re,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:j,disabled:L,style:T,children:W}),e[28]=j,e[29]=L,e[30]=T,e[31]=E):E=e[31];let M;e[32]!==_||e[33]!==E?(M=t.jsxs("div",{className:"flex items-center gap-1",children:[_,E]}),e[32]=_,e[33]=E,e[34]=M):M=e[34];let z;e[35]!==B||e[36]!==M?(z=t.jsxs("div",{className:"flex items-center justify-between px-4 h-11 border-b bg-muted/30",children:[B,M]}),e[35]=B,e[36]=M,e[37]=z):z=e[37];let r;e[38]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Widget Name"}),e[38]=r):r=e[38];let a;e[39]!==o||e[40]!==s?(a=b=>o({...s,name:b.target.value}),e[39]=o,e[40]=s,e[41]=a):a=e[41];let n;e[42]!==a||e[43]!==s.name?(n=t.jsxs("div",{children:[r,t.jsx(le,{placeholder:"e.g., Total Tokens",value:s.name,onChange:a})]}),e[42]=a,e[43]=s.name,e[44]=n):n=e[44];let v;e[45]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Type"}),e[45]=v):v=e[45];let N;e[46]!==o||e[47]!==s?(N=b=>{b&&o({...s,type:b,groupBy:b==="table"?s.groupBy:"",interval:b==="timeseries"?s.interval||"1h":""})},e[46]=o,e[47]=s,e[48]=N):N=e[48];let I;e[49]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(Se,{value:"metric",className:"flex-1 h-full data-[state=on]:!bg-accent/70","aria-label":"Metric",children:t.jsx(Te,{size:14})}),e[49]=I):I=e[49];let A;e[50]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Se,{value:"timeseries",className:"flex-1 h-full data-[state=on]:!bg-accent/70","aria-label":"Timeseries",children:t.jsx(_e,{size:14})}),e[50]=A):A=e[50];let ne;e[51]===Symbol.for("react.memo_cache_sentinel")?(ne=t.jsx(Se,{value:"table",className:"flex-1 h-full data-[state=on]:!bg-accent/70","aria-label":"Table",children:t.jsx(Be,{size:14})}),e[51]=ne):ne=e[51];let O;e[52]!==N||e[53]!==s.type?(O=t.jsxs("div",{children:[v,t.jsxs(Ye,{type:"single",variant:"outline",size:"sm",value:s.type,onValueChange:N,className:"w-full h-10",children:[I,A,ne]})]}),e[52]=N,e[53]=s.type,e[54]=O):O=e[54];let $;e[55]!==n||e[56]!==O?($=t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n,O]}),e[55]=n,e[56]=O,e[57]=$):$=e[57];let oe;e[58]===Symbol.for("react.memo_cache_sentinel")?(oe=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"JSONPath Expression"}),e[58]=oe):oe=e[58];let V;e[59]!==o||e[60]!==s?(V=b=>o({...s,sourcePath:b.target.value}),e[59]=o,e[60]=s,e[61]=V):V=e[61];let U;e[62]!==V||e[63]!==s.sourcePath?(U=t.jsx(le,{placeholder:"$.usage.total_tokens",value:s.sourcePath,onChange:V,className:"font-mono text-sm"}),e[62]=V,e[63]=s.sourcePath,e[64]=U):U=e[64];let H;e[65]!==s.sourceFrom?(H=t.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Path to extract from tool call ",s.sourceFrom]}),e[65]=s.sourceFrom,e[66]=H):H=e[66];let G;e[67]!==U||e[68]!==H?(G=t.jsxs("div",{children:[oe,U,H]}),e[67]=U,e[68]=H,e[69]=G):G=e[69];let ce;e[70]===Symbol.for("react.memo_cache_sentinel")?(ce=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Extract From"}),e[70]=ce):ce=e[70];let K;e[71]!==o||e[72]!==s?(K=b=>o({...s,sourceFrom:b}),e[71]=o,e[72]=s,e[73]=K):K=e[73];let me;e[74]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx(be,{children:t.jsx(ye,{})}),e[74]=me):me=e[74];let de;e[75]===Symbol.for("react.memo_cache_sentinel")?(de=t.jsxs(Ne,{children:[t.jsx(w,{value:"output",children:"Output"}),t.jsx(w,{value:"input",children:"Input"})]}),e[75]=de):de=e[75];let q;e[76]!==K||e[77]!==s.sourceFrom?(q=t.jsxs("div",{children:[ce,t.jsxs(je,{value:s.sourceFrom,onValueChange:K,children:[me,de]})]}),e[76]=K,e[77]=s.sourceFrom,e[78]=q):q=e[78];let ue;e[79]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Aggregation"}),e[79]=ue):ue=e[79];let Q;e[80]!==o||e[81]!==s?(Q=b=>o({...s,aggregationFn:b}),e[80]=o,e[81]=s,e[82]=Q):Q=e[82];let he;e[83]===Symbol.for("react.memo_cache_sentinel")?(he=t.jsx(be,{children:t.jsx(ye,{})}),e[83]=he):he=e[83];let xe;e[84]===Symbol.for("react.memo_cache_sentinel")?(xe=t.jsxs(Ne,{children:[t.jsx(w,{value:"sum",children:"Sum"}),t.jsx(w,{value:"avg",children:"Average"}),t.jsx(w,{value:"min",children:"Minimum"}),t.jsx(w,{value:"max",children:"Maximum"}),t.jsx(w,{value:"count",children:"Count"}),t.jsx(w,{value:"last",children:"Last"})]}),e[84]=xe):xe=e[84];let J;e[85]!==Q||e[86]!==s.aggregationFn?(J=t.jsxs("div",{children:[ue,t.jsxs(je,{value:s.aggregationFn,onValueChange:Q,children:[he,xe]})]}),e[85]=Q,e[86]=s.aggregationFn,e[87]=J):J=e[87];let Y;e[88]!==q||e[89]!==J?(Y=t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[q,J]}),e[88]=q,e[89]=J,e[90]=Y):Y=e[90];let Z;e[91]!==o||e[92]!==s?(Z=s.type==="table"&&t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Group By (JSONPath)"}),t.jsx(le,{placeholder:"$.model",value:s.groupBy,onChange:b=>o({...s,groupBy:b.target.value}),className:"font-mono text-sm"})]}),e[91]=o,e[92]=s,e[93]=Z):Z=e[93];let X;e[94]!==o||e[95]!==s?(X=s.type==="timeseries"&&t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Time Interval"}),t.jsxs(je,{value:s.interval||"1h",onValueChange:b=>o({...s,interval:b}),children:[t.jsx(be,{children:t.jsx(ye,{})}),t.jsxs(Ne,{children:[t.jsx(w,{value:"15m",children:"15 minutes"}),t.jsx(w,{value:"1h",children:"1 hour"}),t.jsx(w,{value:"1d",children:"1 day"})]})]})]}),e[94]=o,e[95]=s,e[96]=X):X=e[96];let ee;e[97]!==$||e[98]!==G||e[99]!==Y||e[100]!==Z||e[101]!==X?(ee=t.jsxs("div",{className:"space-y-4",children:[$,G,Y,Z,X]}),e[97]=$,e[98]=G,e[99]=Y,e[100]=Z,e[101]=X,e[102]=ee):ee=e[102];let fe;e[103]===Symbol.for("react.memo_cache_sentinel")?(fe=t.jsx("div",{className:"px-3 py-2 border-b text-xs font-medium text-muted-foreground",children:"Preview (last 24h)"}),e[103]=fe):fe=e[103];let te;e[104]!==f||e[105]!==s?(te=t.jsxs("div",{className:"border rounded-lg bg-muted/20 flex flex-col",children:[fe,t.jsx("div",{className:"p-3 flex-1 flex items-center justify-center",children:f?t.jsx(nt,{result:f,widget:s}):t.jsx("div",{className:"text-sm text-muted-foreground text-center",children:'Click "Preview" to test your aggregation'})})]}),e[104]=f,e[105]=s,e[106]=te):te=e[106];let se;e[107]!==ee||e[108]!==te?(se=t.jsx("div",{className:"p-4",children:t.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[ee,te]})}),e[107]=ee,e[108]=te,e[109]=se):se=e[109];let ge;return e[110]!==z||e[111]!==se?(ge=t.jsxs("div",{className:"border rounded-lg bg-card overflow-hidden",children:[z,se]}),e[110]=z,e[111]=se,e[112]=ge):ge=e[112],ge}function dt({dashboardId:l}){const{org:e,project:s,locator:o}=Me(),j=ze(),i=Oe({connectionId:$e,orgId:e.id}),d=Ae(),{data:c}=Re({queryKey:ve.monitoringDashboardDetails(o,l),queryFn:async()=>{if(!i)throw new Error("MCP client not available");const r=await i.callTool({name:"MONITORING_DASHBOARD_GET",arguments:{id:l}});return r.structuredContent??r}}),[m,h]=y.useState(c?.name??""),[x,f]=y.useState(c?.description??""),[u,S]=y.useState(c?.widgets?.map(De)??[{...Ce}]),[R,D]=y.useState(!1),[ae,g]=y.useState(!1),[p,k]=y.useState(c?.filters?.connectionIds??[]),[C,F]=y.useState(c?.filters?.toolNames?.[0]??""),[B,P]=y.useState({}),[_,L]=y.useState(new Set),ie=()=>{S([...u,{...Ce,id:crypto.randomUUID()}]),g(!0)},T=r=>{S(u.filter((a,n)=>n!==r)),g(!0)},W=(r,a)=>{const n=[...u];n[r]=a,S(n),g(!0),P(v=>{const N={...v};return delete N[a.id],N})},E=async r=>{if(i){L(a=>new Set(a).add(r.id));try{const a=new Date,n=new Date(a.getTime()-1440*60*1e3),v={};p.length>0&&(v.connectionIds=p),C.trim()&&(v.toolNames=[C.trim()]);const I=(await i.callTool({name:"MONITORING_WIDGET_PREVIEW",arguments:{widget:{type:r.type,source:{path:r.sourcePath,from:r.sourceFrom},aggregation:{fn:r.aggregationFn,groupBy:r.type==="table"&&r.groupBy?r.groupBy:void 0,interval:r.type==="timeseries"&&r.interval?r.interval:void 0},filter:Object.keys(v).length>0?v:void 0},timeRange:{startDate:n.toISOString(),endDate:a.toISOString()}}})).structuredContent;P(A=>({...A,[r.id]:{value:I?.value,groups:I?.groups,timeseries:I?.timeseries,matchedRecords:I?.matchedRecords??0}}))}catch(a){console.error("Preview failed:",a),P(n=>({...n,[r.id]:{error:"Preview failed. Check your JSONPath expression."}}))}finally{L(a=>{const n=new Set(a);return n.delete(r.id),n})}}},M=async()=>{if(i){if(!m.trim()){pe.error("Please enter a dashboard name");return}if(u.some(r=>!r.name.trim())){pe.error("Please enter a name for all widgets");return}D(!0);try{const r={};p.length>0&&(r.connectionIds=p),C.trim()&&(r.toolNames=[C.trim()]),await i.callTool({name:"MONITORING_DASHBOARD_UPDATE",arguments:{id:l,name:m.trim(),description:x.trim()||null,filters:Object.keys(r).length>0?r:null,widgets:u.map(it)}}),pe.success("Dashboard saved"),g(!1),j.invalidateQueries({queryKey:ve.monitoringDashboards(o)}),j.invalidateQueries({queryKey:ve.monitoringDashboardDetails(o,l)})}catch(r){pe.error("Failed to save dashboard"),console.error(r)}finally{D(!1)}}};if(!c)return t.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Dashboard not found"});const z=t.jsx(tt,{children:t.jsxs(st,{children:[t.jsx(Pe,{children:t.jsx(rt,{asChild:!0,children:t.jsx(Le,{to:"/$org/$project/monitoring",params:{org:e.slug,project:s.slug},search:{tab:"dashboards"},children:"Monitoring"})})}),t.jsx(lt,{}),t.jsx(Pe,{children:t.jsxs(at,{children:["Edit ",c.name]})})]})});return t.jsxs(Ze,{breadcrumb:z,children:[t.jsx(Xe,{children:t.jsx(et,{onSave:M,onUndo:()=>{h(c?.name??""),f(c?.description??""),S(c?.widgets?.map(De)??[{...Ce}]),k(c?.filters?.connectionIds??[]),F(c?.filters?.toolNames?.[0]??""),g(!1)},isDirty:ae,isSaving:R})}),t.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:t.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Dashboard Name"}),t.jsx(le,{placeholder:"e.g., LLM Usage Overview",value:m,onChange:r=>{h(r.target.value),g(!0)}})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Description"}),t.jsx(le,{placeholder:"What does this dashboard show?",value:x,onChange:r=>{f(r.target.value),g(!0)}})]})]}),t.jsxs("div",{className:"border rounded-lg p-4 bg-muted/30",children:[t.jsxs("h2",{className:"text-sm font-medium mb-3",children:["Dashboard Filters",t.jsx("span",{className:"text-muted-foreground font-normal ml-2",children:"(applied to all widgets)"})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Servers"}),t.jsxs(Ue,{children:[t.jsx(He,{asChild:!0,children:t.jsxs(re,{variant:"outline",className:"w-full justify-between font-normal",children:[t.jsx("span",{className:"flex items-center gap-2 truncate",children:p.length===0?t.jsx("span",{className:"text-muted-foreground",children:"All servers"}):t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"flex items-center -space-x-1",children:p.slice(0,3).map(r=>{const a=(d??[]).find(n=>n.id===r);return a?t.jsx(ke,{icon:a.icon,name:a.title||a.id,size:"xs"},r):null})}),t.jsxs("span",{children:[p.length," server",p.length!==1?"s":""]})]})}),t.jsx(Fe,{size:14,className:"text-muted-foreground shrink-0"})]})}),t.jsxs(Ge,{align:"start",className:"w-72 p-1",children:[t.jsx("div",{className:"max-h-[240px] overflow-y-auto",children:(d??[]).map(r=>{const a=p.includes(r.id);return t.jsxs("button",{type:"button",className:"flex items-center gap-3 w-full rounded-md px-2 py-2 text-sm hover:bg-muted transition-colors",onClick:()=>{k(n=>a?n.filter(v=>v!==r.id):[...n,r.id]),g(!0)},children:[t.jsx(Ve,{checked:a}),t.jsx(ke,{icon:r.icon,name:r.title||r.id,size:"xs"}),t.jsx("span",{className:"truncate",children:r.title||r.id})]},r.id)})}),p.length>0&&t.jsx("div",{className:"border-t p-1",children:t.jsx("button",{type:"button",className:"w-full text-xs text-muted-foreground hover:text-foreground py-1.5 transition-colors",onClick:()=>{k([]),g(!0)},children:"Clear selection"})})]})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Tool Name Filter"}),t.jsx(le,{placeholder:"e.g., openai_chat",value:C,onChange:r=>{F(r.target.value),g(!0)},className:"font-mono text-sm"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Filter to specific tool names (partial match)"})]})]})]}),t.jsxs("div",{className:"mt-12",children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsx("h2",{className:"text-lg font-medium",children:"Widgets"}),t.jsxs(re,{variant:"outline",size:"sm",onClick:ie,children:[t.jsx(Qe,{size:14,className:"mr-1.5"}),"Add Widget"]})]}),t.jsx("div",{className:"space-y-4",children:u.map((r,a)=>t.jsx(mt,{widget:r,onChange:n=>W(a,n),onRemove:()=>T(a),canRemove:u.length>1,onMoveUp:()=>{const n=[...u],v=n[a-1],N=n[a];n[a-1]=N,n[a]=v,S(n),g(!0)},onMoveDown:()=>{const n=[...u],v=n[a],N=n[a+1];n[a]=N,n[a+1]=v,S(n),g(!0)},canMoveUp:a>0,canMoveDown:a<u.length-1,onPreview:()=>E(r),previewResult:B[r.id]??null,isPreviewing:_.has(r.id)},r.id))})]})]})})]})}function Wt(){const l=we.c(5);let e;l[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},l[0]=e):e=l[0];const{dashboardId:s}=Ee(e);let o;l[1]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Failed to load dashboard editor"}),l[1]=o):o=l[1];let j;l[2]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Ie,{size:24,className:"animate-spin text-muted-foreground"})}),l[2]=j):j=l[2];let i;return l[3]!==s?(i=t.jsx(We,{fallback:o,children:t.jsx(y.Suspense,{fallback:j,children:t.jsx(dt,{dashboardId:s})})}),l[3]=s,l[4]=i):i=l[4],i}export{Wt as default};
1
+ import{r as y,c as we,a as Ee,j as t,u as ze,z as Me,n as Re,K as ve,aL as Le,t as pe}from"./index-B0lAKtRh.js";import{E as We}from"./error-boundary-BuSNQDm9.js";import{h as Ae}from"./use-connection-t2lORAui.js";import{u as Oe,a as $e}from"./constants-7tHIXjuz.js";import{B as re}from"./button-Cxd9D7GZ.js";import{I as le}from"./input-BTRdl8wU.js";import{I as ke}from"./integration-icon-Qol0n8Yu.js";import{C as Ve}from"./checkbox-QmtfqLqJ.js";import{b as Ue,P as He,a as Ge}from"./popover-CdY9eVBh.js";import{t as Fe}from"./ChevronDown-CEjoikg0.js";import{S as je,a as be,b as ye,c as Ne,d as w,n as Ke}from"./select-vvkW2wBk.js";import{i as qe}from"./Play-P0DrvK6F.js";import{s as Qe}from"./Plus-C5LR6cck.js";import{s as Ie}from"./RefreshCw01-Cvn_Sesf.js";import{s as Je}from"./Trash01-fpfGO2En.js";import{T as Ye,a as Se}from"./toggle-group-CTeIuV4q.js";import{a as Ze,V as Xe}from"./layout-DQVjOYgA.js";import{S as et}from"./save-actions-BCWYpxCn.js";import{B as tt,a as st,b as Pe,d as rt,e as lt,c as at}from"./breadcrumb-DTOs2A-I.js";import"./useMutation-DTtaBOsy.js";import"./Container-D5gdKEFc.js";import"./Check-Dy1kSzwX.js";import"./index-C1cLa9Gd.js";import"./index-C4SaT72q.js";import"./Save01-CAo15i_T.js";import"./Loading01-BclS8iWV.js";import"./ChevronRight-CVpzq9SE.js";const Be=({size:l=24,color:e="currentColor",...s})=>y.createElement("svg",{viewBox:"0 0 24 24",width:l,height:l,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},y.createElement("path",{d:"M16 10H3m17-4H3m17 8H3m13 4H3"}));Be.displayName="AlignLeft";const _e=({size:l=24,color:e="currentColor",...s})=>y.createElement("svg",{viewBox:"0 0 24 24",width:l,height:l,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},y.createElement("path",{d:"M8 15v2m4-6v6m4-10v10m-8.2 4h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C21 18.72 21 17.88 21 16.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C18.72 3 17.88 3 16.2 3H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21Z"}));_e.displayName="BarChartSquare02";const Te=({size:l=24,color:e="currentColor",...s})=>y.createElement("svg",{viewBox:"0 0 24 24",width:l,height:l,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},y.createElement("path",{d:"m9.5 3-3 18m11-18-3 18m6-13h-17m16 8h-17"}));Te.displayName="Hash02";function De(l){return{id:l.id,name:l.name,type:l.type,sourcePath:l.source.path,sourceFrom:l.source.from,aggregationFn:l.aggregation.fn,groupBy:l.aggregation.groupBy||"",interval:l.aggregation.interval||""}}function it(l){return{id:l.id,name:l.name,type:l.type,source:{path:l.sourcePath,from:l.sourceFrom},aggregation:{fn:l.aggregationFn,groupBy:l.type==="table"&&l.groupBy?l.groupBy:void 0,interval:l.type==="timeseries"&&l.interval?l.interval:void 0}}}const Ce={id:crypto.randomUUID(),name:"",type:"metric",sourcePath:"$.usage.total_tokens",sourceFrom:"output",aggregationFn:"sum",groupBy:"",interval:""};function nt(l){const e=we.c(36),{result:s,widget:o}=l;if(s.error){let i;return e[0]!==s.error?(i=t.jsx("div",{className:"text-sm text-destructive bg-destructive/10 rounded p-3",children:s.error}),e[0]=s.error,e[1]=i):i=e[1],i}if(o.type==="metric"){const i=s.value??0;let d;e[2]!==i?(d=i>=1e6?`${(i/1e6).toFixed(2)}M`:i>=1e3?`${(i/1e3).toFixed(2)}K`:typeof i=="number"?i.toFixed(2):String(i),e[2]=i,e[3]=d):d=e[3];const c=d;let m;e[4]!==c?(m=t.jsx("div",{className:"text-3xl font-bold tabular-nums",children:c}),e[4]=c,e[5]=m):m=e[5];const h=s.matchedRecords??0;let x;e[6]!==h?(x=t.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[h," records matched"]}),e[6]=h,e[7]=x):x=e[7];let f;return e[8]!==m||e[9]!==x?(f=t.jsxs("div",{className:"text-center py-4",children:[m,x]}),e[8]=m,e[9]=x,e[10]=f):f=e[10],f}if(o.type==="table"&&s.groups){let i;e[11]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("thead",{className:"bg-muted/50 sticky top-0",children:t.jsxs("tr",{children:[t.jsx("th",{className:"text-left px-3 py-1.5 text-xs font-medium",children:"Key"}),t.jsx("th",{className:"text-right px-3 py-1.5 text-xs font-medium",children:"Value"})]})}),e[11]=i):i=e[11];let d;e[12]!==s.groups?(d=s.groups.length===0?t.jsx("tr",{children:t.jsx("td",{colSpan:2,className:"px-3 py-4 text-center text-muted-foreground text-xs",children:"No data"})}):s.groups.slice(0,10).map(ct),e[12]=s.groups,e[13]=d):d=e[13];let c;e[14]!==d?(c=t.jsxs("table",{className:"w-full text-sm",children:[i,t.jsx("tbody",{children:d})]}),e[14]=d,e[15]=c):c=e[15];let m;e[16]!==s.groups.length?(m=s.groups.length>10&&t.jsxs("div",{className:"text-xs text-muted-foreground text-center py-2",children:["+",s.groups.length-10," more rows"]}),e[16]=s.groups.length,e[17]=m):m=e[17];let h;return e[18]!==c||e[19]!==m?(h=t.jsxs("div",{className:"max-h-[200px] overflow-auto",children:[c,m]}),e[18]=c,e[19]=m,e[20]=h):h=e[20],h}if(o.type==="timeseries"&&s.timeseries){let i;e[21]!==s.timeseries?(i=Math.max(...s.timeseries.map(ot),1),e[21]=s.timeseries,e[22]=i):i=e[22];const d=i;let c;if(e[23]!==d||e[24]!==s.timeseries){let f;e[26]!==d?(f=(u,S)=>t.jsx("div",{className:"flex-1 bg-primary/80 rounded-t",style:{height:`${u.value/d*100}%`,minHeight:u.value>0?"2px":"0px"},title:`${new Date(u.timestamp).toLocaleString()}: ${u.value}`},S),e[26]=d,e[27]=f):f=e[27],c=s.timeseries.slice(-24).map(f),e[23]=d,e[24]=s.timeseries,e[25]=c}else c=e[25];let m;e[28]!==c?(m=t.jsx("div",{className:"flex items-end gap-0.5 h-[80px]",children:c}),e[28]=c,e[29]=m):m=e[29];let h;e[30]!==s.timeseries.length?(h=t.jsxs("div",{className:"text-xs text-muted-foreground text-center mt-2",children:[s.timeseries.length," data points"]}),e[30]=s.timeseries.length,e[31]=h):h=e[31];let x;return e[32]!==m||e[33]!==h?(x=t.jsxs("div",{className:"py-2",children:[m,h]}),e[32]=m,e[33]=h,e[34]=x):x=e[34],x}let j;return e[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"text-sm text-muted-foreground text-center py-4",children:"No preview data"}),e[35]=j):j=e[35],j}function ot(l){return l.value}function ct(l,e){return t.jsxs("tr",{className:"border-t",children:[t.jsx("td",{className:"px-3 py-1.5 font-mono text-xs",children:l.key}),t.jsx("td",{className:"px-3 py-1.5 text-right tabular-nums text-xs",children:l.value.toLocaleString()})]},e)}function mt(l){const e=we.c(113),{widget:s,onChange:o,onRemove:j,canRemove:i,onMoveUp:d,onMoveDown:c,canMoveUp:m,canMoveDown:h,onPreview:x,previewResult:f,isPreviewing:u}=l,S=!m;let R;e[0]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(Ke,{size:14}),e[0]=R):R=e[0];let D;e[1]!==d||e[2]!==S?(D=t.jsx(re,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:d,disabled:S,children:R}),e[1]=d,e[2]=S,e[3]=D):D=e[3];const ae=!h;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Fe,{size:14}),e[4]=g):g=e[4];let p;e[5]!==c||e[6]!==ae?(p=t.jsx(re,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:c,disabled:ae,children:g}),e[5]=c,e[6]=ae,e[7]=p):p=e[7];let k;e[8]!==D||e[9]!==p?(k=t.jsxs("div",{className:"flex items-center gap-0.5",children:[D,p]}),e[8]=D,e[9]=p,e[10]=k):k=e[10];let C;e[11]!==s.type?(C=t.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:s.type}),e[11]=s.type,e[12]=C):C=e[12];let F;e[13]!==s.name?(F=s.name&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-muted-foreground",children:"·"}),t.jsx("span",{className:"text-sm font-medium",children:s.name})]}),e[13]=s.name,e[14]=F):F=e[14];let B;e[15]!==k||e[16]!==C||e[17]!==F?(B=t.jsxs("div",{className:"flex items-center gap-2",children:[k,C,F]}),e[15]=k,e[16]=C,e[17]=F,e[18]=B):B=e[18];let P;e[19]!==u?(P=u?t.jsx(Ie,{size:14,className:"animate-spin"}):t.jsx(qe,{size:14}),e[19]=u,e[20]=P):P=e[20];let _;e[21]!==u||e[22]!==x||e[23]!==P?(_=t.jsx(re,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:x,disabled:u,children:P}),e[21]=u,e[22]=x,e[23]=P,e[24]=_):_=e[24];const L=!i,ie=i?"visible":"hidden";let T;e[25]!==ie?(T={visibility:ie},e[25]=ie,e[26]=T):T=e[26];let W;e[27]===Symbol.for("react.memo_cache_sentinel")?(W=t.jsx(Je,{size:14}),e[27]=W):W=e[27];let E;e[28]!==j||e[29]!==L||e[30]!==T?(E=t.jsx(re,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:j,disabled:L,style:T,children:W}),e[28]=j,e[29]=L,e[30]=T,e[31]=E):E=e[31];let z;e[32]!==_||e[33]!==E?(z=t.jsxs("div",{className:"flex items-center gap-1",children:[_,E]}),e[32]=_,e[33]=E,e[34]=z):z=e[34];let M;e[35]!==B||e[36]!==z?(M=t.jsxs("div",{className:"flex items-center justify-between px-4 h-11 border-b bg-muted/30",children:[B,z]}),e[35]=B,e[36]=z,e[37]=M):M=e[37];let r;e[38]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Widget Name"}),e[38]=r):r=e[38];let a;e[39]!==o||e[40]!==s?(a=b=>o({...s,name:b.target.value}),e[39]=o,e[40]=s,e[41]=a):a=e[41];let n;e[42]!==a||e[43]!==s.name?(n=t.jsxs("div",{children:[r,t.jsx(le,{placeholder:"e.g., Total Tokens",value:s.name,onChange:a})]}),e[42]=a,e[43]=s.name,e[44]=n):n=e[44];let v;e[45]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Type"}),e[45]=v):v=e[45];let N;e[46]!==o||e[47]!==s?(N=b=>{b&&o({...s,type:b,groupBy:b==="table"?s.groupBy:"",interval:b==="timeseries"?s.interval||"1h":""})},e[46]=o,e[47]=s,e[48]=N):N=e[48];let I;e[49]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(Se,{value:"metric",className:"flex-1 h-full data-[state=on]:!bg-accent/70","aria-label":"Metric",children:t.jsx(Te,{size:14})}),e[49]=I):I=e[49];let A;e[50]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Se,{value:"timeseries",className:"flex-1 h-full data-[state=on]:!bg-accent/70","aria-label":"Timeseries",children:t.jsx(_e,{size:14})}),e[50]=A):A=e[50];let ne;e[51]===Symbol.for("react.memo_cache_sentinel")?(ne=t.jsx(Se,{value:"table",className:"flex-1 h-full data-[state=on]:!bg-accent/70","aria-label":"Table",children:t.jsx(Be,{size:14})}),e[51]=ne):ne=e[51];let O;e[52]!==N||e[53]!==s.type?(O=t.jsxs("div",{children:[v,t.jsxs(Ye,{type:"single",variant:"outline",size:"sm",value:s.type,onValueChange:N,className:"w-full h-10",children:[I,A,ne]})]}),e[52]=N,e[53]=s.type,e[54]=O):O=e[54];let $;e[55]!==n||e[56]!==O?($=t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n,O]}),e[55]=n,e[56]=O,e[57]=$):$=e[57];let oe;e[58]===Symbol.for("react.memo_cache_sentinel")?(oe=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"JSONPath Expression"}),e[58]=oe):oe=e[58];let V;e[59]!==o||e[60]!==s?(V=b=>o({...s,sourcePath:b.target.value}),e[59]=o,e[60]=s,e[61]=V):V=e[61];let U;e[62]!==V||e[63]!==s.sourcePath?(U=t.jsx(le,{placeholder:"$.usage.total_tokens",value:s.sourcePath,onChange:V,className:"font-mono text-sm"}),e[62]=V,e[63]=s.sourcePath,e[64]=U):U=e[64];let H;e[65]!==s.sourceFrom?(H=t.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Path to extract from tool call ",s.sourceFrom]}),e[65]=s.sourceFrom,e[66]=H):H=e[66];let G;e[67]!==U||e[68]!==H?(G=t.jsxs("div",{children:[oe,U,H]}),e[67]=U,e[68]=H,e[69]=G):G=e[69];let ce;e[70]===Symbol.for("react.memo_cache_sentinel")?(ce=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Extract From"}),e[70]=ce):ce=e[70];let K;e[71]!==o||e[72]!==s?(K=b=>o({...s,sourceFrom:b}),e[71]=o,e[72]=s,e[73]=K):K=e[73];let me;e[74]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx(be,{children:t.jsx(ye,{})}),e[74]=me):me=e[74];let de;e[75]===Symbol.for("react.memo_cache_sentinel")?(de=t.jsxs(Ne,{children:[t.jsx(w,{value:"output",children:"Output"}),t.jsx(w,{value:"input",children:"Input"})]}),e[75]=de):de=e[75];let q;e[76]!==K||e[77]!==s.sourceFrom?(q=t.jsxs("div",{children:[ce,t.jsxs(je,{value:s.sourceFrom,onValueChange:K,children:[me,de]})]}),e[76]=K,e[77]=s.sourceFrom,e[78]=q):q=e[78];let ue;e[79]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Aggregation"}),e[79]=ue):ue=e[79];let Q;e[80]!==o||e[81]!==s?(Q=b=>o({...s,aggregationFn:b}),e[80]=o,e[81]=s,e[82]=Q):Q=e[82];let he;e[83]===Symbol.for("react.memo_cache_sentinel")?(he=t.jsx(be,{children:t.jsx(ye,{})}),e[83]=he):he=e[83];let xe;e[84]===Symbol.for("react.memo_cache_sentinel")?(xe=t.jsxs(Ne,{children:[t.jsx(w,{value:"sum",children:"Sum"}),t.jsx(w,{value:"avg",children:"Average"}),t.jsx(w,{value:"min",children:"Minimum"}),t.jsx(w,{value:"max",children:"Maximum"}),t.jsx(w,{value:"count",children:"Count"}),t.jsx(w,{value:"last",children:"Last"})]}),e[84]=xe):xe=e[84];let J;e[85]!==Q||e[86]!==s.aggregationFn?(J=t.jsxs("div",{children:[ue,t.jsxs(je,{value:s.aggregationFn,onValueChange:Q,children:[he,xe]})]}),e[85]=Q,e[86]=s.aggregationFn,e[87]=J):J=e[87];let Y;e[88]!==q||e[89]!==J?(Y=t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[q,J]}),e[88]=q,e[89]=J,e[90]=Y):Y=e[90];let Z;e[91]!==o||e[92]!==s?(Z=s.type==="table"&&t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Group By (JSONPath)"}),t.jsx(le,{placeholder:"$.model",value:s.groupBy,onChange:b=>o({...s,groupBy:b.target.value}),className:"font-mono text-sm"})]}),e[91]=o,e[92]=s,e[93]=Z):Z=e[93];let X;e[94]!==o||e[95]!==s?(X=s.type==="timeseries"&&t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Time Interval"}),t.jsxs(je,{value:s.interval||"1h",onValueChange:b=>o({...s,interval:b}),children:[t.jsx(be,{children:t.jsx(ye,{})}),t.jsxs(Ne,{children:[t.jsx(w,{value:"15m",children:"15 minutes"}),t.jsx(w,{value:"1h",children:"1 hour"}),t.jsx(w,{value:"1d",children:"1 day"})]})]})]}),e[94]=o,e[95]=s,e[96]=X):X=e[96];let ee;e[97]!==$||e[98]!==G||e[99]!==Y||e[100]!==Z||e[101]!==X?(ee=t.jsxs("div",{className:"space-y-4",children:[$,G,Y,Z,X]}),e[97]=$,e[98]=G,e[99]=Y,e[100]=Z,e[101]=X,e[102]=ee):ee=e[102];let fe;e[103]===Symbol.for("react.memo_cache_sentinel")?(fe=t.jsx("div",{className:"px-3 py-2 border-b text-xs font-medium text-muted-foreground",children:"Preview (last 24h)"}),e[103]=fe):fe=e[103];let te;e[104]!==f||e[105]!==s?(te=t.jsxs("div",{className:"border rounded-lg bg-muted/20 flex flex-col",children:[fe,t.jsx("div",{className:"p-3 flex-1 flex items-center justify-center",children:f?t.jsx(nt,{result:f,widget:s}):t.jsx("div",{className:"text-sm text-muted-foreground text-center",children:'Click "Preview" to test your aggregation'})})]}),e[104]=f,e[105]=s,e[106]=te):te=e[106];let se;e[107]!==ee||e[108]!==te?(se=t.jsx("div",{className:"p-4",children:t.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[ee,te]})}),e[107]=ee,e[108]=te,e[109]=se):se=e[109];let ge;return e[110]!==M||e[111]!==se?(ge=t.jsxs("div",{className:"border rounded-lg bg-card overflow-hidden",children:[M,se]}),e[110]=M,e[111]=se,e[112]=ge):ge=e[112],ge}function dt({dashboardId:l}){const{org:e,project:s,locator:o}=ze(),j=Me(),i=Oe({connectionId:$e,orgId:e.id}),d=Ae(),{data:c}=Re({queryKey:ve.monitoringDashboardDetails(o,l),queryFn:async()=>{if(!i)throw new Error("MCP client not available");const r=await i.callTool({name:"MONITORING_DASHBOARD_GET",arguments:{id:l}});return r.structuredContent??r}}),[m,h]=y.useState(c?.name??""),[x,f]=y.useState(c?.description??""),[u,S]=y.useState(c?.widgets?.map(De)??[{...Ce}]),[R,D]=y.useState(!1),[ae,g]=y.useState(!1),[p,k]=y.useState(c?.filters?.connectionIds??[]),[C,F]=y.useState(c?.filters?.toolNames?.[0]??""),[B,P]=y.useState({}),[_,L]=y.useState(new Set),ie=()=>{S([...u,{...Ce,id:crypto.randomUUID()}]),g(!0)},T=r=>{S(u.filter((a,n)=>n!==r)),g(!0)},W=(r,a)=>{const n=[...u];n[r]=a,S(n),g(!0),P(v=>{const N={...v};return delete N[a.id],N})},E=async r=>{if(i){L(a=>new Set(a).add(r.id));try{const a=new Date,n=new Date(a.getTime()-1440*60*1e3),v={};p.length>0&&(v.connectionIds=p),C.trim()&&(v.toolNames=[C.trim()]);const I=(await i.callTool({name:"MONITORING_WIDGET_PREVIEW",arguments:{widget:{type:r.type,source:{path:r.sourcePath,from:r.sourceFrom},aggregation:{fn:r.aggregationFn,groupBy:r.type==="table"&&r.groupBy?r.groupBy:void 0,interval:r.type==="timeseries"&&r.interval?r.interval:void 0},filter:Object.keys(v).length>0?v:void 0},timeRange:{startDate:n.toISOString(),endDate:a.toISOString()}}})).structuredContent;P(A=>({...A,[r.id]:{value:I?.value,groups:I?.groups,timeseries:I?.timeseries,matchedRecords:I?.matchedRecords??0}}))}catch(a){console.error("Preview failed:",a),P(n=>({...n,[r.id]:{error:"Preview failed. Check your JSONPath expression."}}))}finally{L(a=>{const n=new Set(a);return n.delete(r.id),n})}}},z=async()=>{if(i){if(!m.trim()){pe.error("Please enter a dashboard name");return}if(u.some(r=>!r.name.trim())){pe.error("Please enter a name for all widgets");return}D(!0);try{const r={};p.length>0&&(r.connectionIds=p),C.trim()&&(r.toolNames=[C.trim()]),await i.callTool({name:"MONITORING_DASHBOARD_UPDATE",arguments:{id:l,name:m.trim(),description:x.trim()||null,filters:Object.keys(r).length>0?r:null,widgets:u.map(it)}}),pe.success("Dashboard saved"),g(!1),j.invalidateQueries({queryKey:ve.monitoringDashboards(o)}),j.invalidateQueries({queryKey:ve.monitoringDashboardDetails(o,l)})}catch(r){pe.error("Failed to save dashboard"),console.error(r)}finally{D(!1)}}};if(!c)return t.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Dashboard not found"});const M=t.jsx(tt,{children:t.jsxs(st,{children:[t.jsx(Pe,{children:t.jsx(rt,{asChild:!0,children:t.jsx(Le,{to:"/$org/$project/monitoring",params:{org:e.slug,project:s.slug},search:{tab:"dashboards"},children:"Monitoring"})})}),t.jsx(lt,{}),t.jsx(Pe,{children:t.jsxs(at,{children:["Edit ",c.name]})})]})});return t.jsxs(Ze,{breadcrumb:M,children:[t.jsx(Xe,{children:t.jsx(et,{onSave:z,onUndo:()=>{h(c?.name??""),f(c?.description??""),S(c?.widgets?.map(De)??[{...Ce}]),k(c?.filters?.connectionIds??[]),F(c?.filters?.toolNames?.[0]??""),g(!1)},isDirty:ae,isSaving:R})}),t.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:t.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Dashboard Name"}),t.jsx(le,{placeholder:"e.g., LLM Usage Overview",value:m,onChange:r=>{h(r.target.value),g(!0)}})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Description"}),t.jsx(le,{placeholder:"What does this dashboard show?",value:x,onChange:r=>{f(r.target.value),g(!0)}})]})]}),t.jsxs("div",{className:"border rounded-lg p-4 bg-muted/30",children:[t.jsxs("h2",{className:"text-sm font-medium mb-3",children:["Dashboard Filters",t.jsx("span",{className:"text-muted-foreground font-normal ml-2",children:"(applied to all widgets)"})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Servers"}),t.jsxs(Ue,{children:[t.jsx(He,{asChild:!0,children:t.jsxs(re,{variant:"outline",className:"w-full justify-between font-normal",children:[t.jsx("span",{className:"flex items-center gap-2 truncate",children:p.length===0?t.jsx("span",{className:"text-muted-foreground",children:"All servers"}):t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"flex items-center -space-x-1",children:p.slice(0,3).map(r=>{const a=(d??[]).find(n=>n.id===r);return a?t.jsx(ke,{icon:a.icon,name:a.title||a.id,size:"xs"},r):null})}),t.jsxs("span",{children:[p.length," server",p.length!==1?"s":""]})]})}),t.jsx(Fe,{size:14,className:"text-muted-foreground shrink-0"})]})}),t.jsxs(Ge,{align:"start",className:"w-72 p-1",children:[t.jsx("div",{className:"max-h-[240px] overflow-y-auto",children:(d??[]).map(r=>{const a=p.includes(r.id);return t.jsxs("button",{type:"button",className:"flex items-center gap-3 w-full rounded-md px-2 py-2 text-sm hover:bg-muted transition-colors",onClick:()=>{k(n=>a?n.filter(v=>v!==r.id):[...n,r.id]),g(!0)},children:[t.jsx(Ve,{checked:a}),t.jsx(ke,{icon:r.icon,name:r.title||r.id,size:"xs"}),t.jsx("span",{className:"truncate",children:r.title||r.id})]},r.id)})}),p.length>0&&t.jsx("div",{className:"border-t p-1",children:t.jsx("button",{type:"button",className:"w-full text-xs text-muted-foreground hover:text-foreground py-1.5 transition-colors",onClick:()=>{k([]),g(!0)},children:"Clear selection"})})]})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Tool Name Filter"}),t.jsx(le,{placeholder:"e.g., openai_chat",value:C,onChange:r=>{F(r.target.value),g(!0)},className:"font-mono text-sm"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Filter to specific tool names (partial match)"})]})]})]}),t.jsxs("div",{className:"mt-12",children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsx("h2",{className:"text-lg font-medium",children:"Widgets"}),t.jsxs(re,{variant:"outline",size:"sm",onClick:ie,children:[t.jsx(Qe,{size:14,className:"mr-1.5"}),"Add Widget"]})]}),t.jsx("div",{className:"space-y-4",children:u.map((r,a)=>t.jsx(mt,{widget:r,onChange:n=>W(a,n),onRemove:()=>T(a),canRemove:u.length>1,onMoveUp:()=>{const n=[...u],v=n[a-1],N=n[a];n[a-1]=N,n[a]=v,S(n),g(!0)},onMoveDown:()=>{const n=[...u],v=n[a],N=n[a+1];n[a]=N,n[a+1]=v,S(n),g(!0)},canMoveUp:a>0,canMoveDown:a<u.length-1,onPreview:()=>E(r),previewResult:B[r.id]??null,isPreviewing:_.has(r.id)},r.id))})]})]})})]})}function Wt(){const l=we.c(5);let e;l[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},l[0]=e):e=l[0];const{dashboardId:s}=Ee(e);let o;l[1]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Failed to load dashboard editor"}),l[1]=o):o=l[1];let j;l[2]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Ie,{size:24,className:"animate-spin text-muted-foreground"})}),l[2]=j):j=l[2];let i;return l[3]!==s?(i=t.jsx(We,{fallback:o,children:t.jsx(y.Suspense,{fallback:j,children:t.jsx(dt,{dashboardId:s})})}),l[3]=s,l[4]=i):i=l[4],i}export{Wt as default};
@@ -1,4 +1,4 @@
1
- import{r as $,j as t,c as D,z as xe,u as fe,n as ne,K as oe,aM as ge,a as pe,m as he}from"./index-B29giag9.js";import{a as je,u as be}from"./constants-CH9byiKA.js";import{B as R}from"./button-D-PerQqC.js";import{p as ee,a as ce,s as ye,b as ve,e as me,i as Ne,T as we}from"./time-range-picker-CG48KHqL.js";import{s as re}from"./RefreshCw01-Bb8t9XLS.js";import{E as ke}from"./error-boundary-8guJh7VT.js";import{V as Se,a as Ce}from"./layout-DUHhpHXf.js";import{b as de,c as $e,d as Fe,e as Re,B as De,a as Te}from"./breadcrumb-ClGbT9Pe.js";import{B as _e}from"./badge-D_aixLlt.js";import{I as ue}from"./input-Cxci79To.js";import{b as Pe,P as Me,a as ze}from"./popover-Bq8aZ27v.js";import{S as Ie,a as Be,b as Ee,c as Oe,d as Ae}from"./select-D6oaQfJS.js";import{T as Ke}from"./textarea-DhETf1og.js";import{b as Le,T as Ve,a as qe}from"./tooltip-D-FT-fCa.js";import{i as Qe}from"./Code01-CgOGThgh.js";import{i as We}from"./FilterLines-DNMtf_47.js";import{c as Ge}from"./Grid01-BB6GzE_H.js";import{s as He}from"./Plus-q5YWe4us.js";import{s as Ye}from"./Trash01-Dk9pv506.js";import{s as Ue}from"./XClose-B9jvydA5.js";import"./Check-DVZrDl7E.js";import"./Copy01-CMA5_oKx.js";import"./Download01-COYP-wbM.js";import"./Key01-kq7PX1YS.js";import"./Play-BweooOYS.js";import"./scroll-area-BJ5bePQ1.js";import"./spinner-BstVffOp.js";import"./ChevronDown-BrnUqul2.js";import"./Clock-BpIUYvY9.js";import"./ChevronRight-lTpPQGwH.js";import"./index-CwR6GYR2.js";import"./index-V777tuW4.js";const Je=[{value:"eq",label:"equals"},{value:"contains",label:"contains"},{value:"in",label:"in (list)"},{value:"exists",label:"exists"}];function Xe({value:s,onChange:e}){const[r,i]=$.useState(!1),[l,n]=$.useState("raw"),[c,o]=$.useState(s),[m,d]=$.useState(ee(s)),g=$.useRef(s);g.current!==s&&(g.current=s,o(s),d(ee(s)));const f=()=>{e(c.filter(a=>a.key.trim()))},p=()=>{const a=ce(m);o(a),e(a)},j=()=>{if(l==="raw"){const a=ce(m);o(a),n("form")}else d(ee(c)),n("raw")},v=(a,x)=>{const u=[...c],h=u[a];h&&(u[a]={key:x.key??h.key,operator:x.operator??h.operator,value:x.value??h.value},o(u))},b=()=>{o([...c,{key:"",operator:"eq",value:""}])},w=a=>{const x=c.filter((u,h)=>h!==a);o(x),d(ee(x)),e(x.filter(u=>u.key.trim()))},y=()=>{o([]),d(""),e([]),i(!1)},k=s.filter(a=>a.key.trim()).length;return t.jsxs("div",{className:"flex items-center gap-1.5",children:[s.filter(a=>a.key.trim()).map((a,x)=>{const u=a.operator==="exists"?`${a.key}?`:a.operator==="contains"?`${a.key}~${a.value}`:a.operator==="in"?`${a.key}@${a.value}`:`${a.key}=${a.value}`;return t.jsxs(_e,{variant:"secondary",className:"gap-1 pl-2 pr-1 h-7 text-xs font-mono font-normal cursor-default",children:[u,t.jsx("button",{type:"button",className:"ml-0.5 rounded-full p-0.5 hover:bg-muted-foreground/20 transition-colors",onClick:()=>{const h=s.filter((C,F)=>F!==x);e(h)},children:t.jsx(Ue,{size:12})})]},`${a.key}-${x}`)}),t.jsxs(Pe,{open:r,onOpenChange:i,children:[t.jsx(Me,{asChild:!0,children:t.jsxs(R,{variant:"outline",size:"sm",className:"h-7 px-2 gap-1.5",children:[t.jsx(We,{className:"h-3.5 w-3.5 text-muted-foreground"}),k===0?t.jsx("span",{className:"text-sm",children:"Filter"}):t.jsx("span",{className:"text-sm",children:k})]})}),t.jsxs(ze,{className:"w-[380px] p-4",align:"end",sideOffset:4,children:[t.jsxs("div",{className:"flex items-center justify-between mb-3",children:[t.jsx("h4",{className:"text-sm font-medium",children:"Property Filters"}),t.jsxs(Le,{children:[t.jsx(Ve,{asChild:!0,children:t.jsx(R,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:j,children:l==="raw"?t.jsx(Ge,{size:14}):t.jsx(Qe,{size:14})})}),t.jsx(qe,{children:l==="raw"?"Switch to form view":"Switch to raw text"})]})]}),l==="raw"?t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(Ke,{placeholder:`Paste property filters here:
1
+ import{r as $,j as t,c as D,z as xe,u as fe,n as ne,K as oe,aL as ge,a as pe,m as he}from"./index-B0lAKtRh.js";import{a as je,u as be}from"./constants-7tHIXjuz.js";import{B as R}from"./button-Cxd9D7GZ.js";import{p as ee,a as ce,s as ye,b as ve,e as me,i as Ne,T as we}from"./time-range-picker-BTAPhqft.js";import{s as re}from"./RefreshCw01-Cvn_Sesf.js";import{E as ke}from"./error-boundary-BuSNQDm9.js";import{V as Se,a as Ce}from"./layout-DQVjOYgA.js";import{b as de,c as $e,d as Fe,e as Re,B as De,a as Te}from"./breadcrumb-DTOs2A-I.js";import{B as _e}from"./badge-Ce8oucop.js";import{I as ue}from"./input-BTRdl8wU.js";import{b as Pe,P as ze,a as Ie}from"./popover-CdY9eVBh.js";import{S as Me,a as Be,b as Ee,c as Oe,d as Le}from"./select-vvkW2wBk.js";import{T as Ae}from"./textarea-D0RfPnUt.js";import{b as Ke,T as Ve,a as qe}from"./tooltip-DkOvFQ7D.js";import{i as Qe}from"./Code01-ztcPrUdW.js";import{i as We}from"./FilterLines-DcDy1u8y.js";import{c as Ge}from"./Grid01-pmpn_yyH.js";import{s as He}from"./Plus-C5LR6cck.js";import{s as Ye}from"./Trash01-fpfGO2En.js";import{s as Ue}from"./XClose-CwzH0SGu.js";import"./Check-Dy1kSzwX.js";import"./Copy01-eBFwMxtu.js";import"./Download01-B-vJTp2a.js";import"./Key01-DXWjoaTE.js";import"./Play-P0DrvK6F.js";import"./scroll-area-B6cIs4dW.js";import"./spinner-BsQXvc2Y.js";import"./ChevronDown-CEjoikg0.js";import"./Clock-BFqtZfyI.js";import"./ChevronRight-CVpzq9SE.js";import"./index-C4SaT72q.js";import"./index-C1cLa9Gd.js";const Je=[{value:"eq",label:"equals"},{value:"contains",label:"contains"},{value:"in",label:"in (list)"},{value:"exists",label:"exists"}];function Xe({value:s,onChange:e}){const[r,i]=$.useState(!1),[l,n]=$.useState("raw"),[c,o]=$.useState(s),[m,d]=$.useState(ee(s)),g=$.useRef(s);g.current!==s&&(g.current=s,o(s),d(ee(s)));const f=()=>{e(c.filter(a=>a.key.trim()))},p=()=>{const a=ce(m);o(a),e(a)},j=()=>{if(l==="raw"){const a=ce(m);o(a),n("form")}else d(ee(c)),n("raw")},v=(a,x)=>{const u=[...c],h=u[a];h&&(u[a]={key:x.key??h.key,operator:x.operator??h.operator,value:x.value??h.value},o(u))},b=()=>{o([...c,{key:"",operator:"eq",value:""}])},w=a=>{const x=c.filter((u,h)=>h!==a);o(x),d(ee(x)),e(x.filter(u=>u.key.trim()))},y=()=>{o([]),d(""),e([]),i(!1)},k=s.filter(a=>a.key.trim()).length;return t.jsxs("div",{className:"flex items-center gap-1.5",children:[s.filter(a=>a.key.trim()).map((a,x)=>{const u=a.operator==="exists"?`${a.key}?`:a.operator==="contains"?`${a.key}~${a.value}`:a.operator==="in"?`${a.key}@${a.value}`:`${a.key}=${a.value}`;return t.jsxs(_e,{variant:"secondary",className:"gap-1 pl-2 pr-1 h-7 text-xs font-mono font-normal cursor-default",children:[u,t.jsx("button",{type:"button",className:"ml-0.5 rounded-full p-0.5 hover:bg-muted-foreground/20 transition-colors",onClick:()=>{const h=s.filter((C,F)=>F!==x);e(h)},children:t.jsx(Ue,{size:12})})]},`${a.key}-${x}`)}),t.jsxs(Pe,{open:r,onOpenChange:i,children:[t.jsx(ze,{asChild:!0,children:t.jsxs(R,{variant:"outline",size:"sm",className:"h-7 px-2 gap-1.5",children:[t.jsx(We,{className:"h-3.5 w-3.5 text-muted-foreground"}),k===0?t.jsx("span",{className:"text-sm",children:"Filter"}):t.jsx("span",{className:"text-sm",children:k})]})}),t.jsxs(Ie,{className:"w-[380px] p-4",align:"end",sideOffset:4,children:[t.jsxs("div",{className:"flex items-center justify-between mb-3",children:[t.jsx("h4",{className:"text-sm font-medium",children:"Property Filters"}),t.jsxs(Ke,{children:[t.jsx(Ve,{asChild:!0,children:t.jsx(R,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:j,children:l==="raw"?t.jsx(Ge,{size:14}):t.jsx(Qe,{size:14})})}),t.jsx(qe,{children:l==="raw"?"Switch to form view":"Switch to raw text"})]})]}),l==="raw"?t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(Ae,{placeholder:`Paste property filters here:
2
2
  thread_id=abc123
3
3
  user~test
4
- debug?`,value:m,onChange:a=>d(a.target.value),onBlur:p,onKeyDown:a=>{a.key==="Enter"&&a.metaKey&&p()},className:"font-mono text-sm min-h-[80px] resize-none"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["One per line:"," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key=value"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key~contains"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key@in_list"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key?"})]})]}):t.jsxs("div",{className:"space-y-3",children:[c.map((a,x)=>t.jsxs("div",{className:"p-2.5 rounded-md border border-border bg-muted/30 space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("span",{className:"text-xs text-muted-foreground",children:["Filter ",x+1]}),t.jsx(R,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:()=>w(x),children:t.jsx(Ye,{size:12})})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(ue,{placeholder:"Key (e.g., thread_id)",value:a.key,onChange:u=>v(x,{key:u.target.value}),onBlur:f,onKeyDown:u=>{u.key==="Enter"&&f()},className:"flex-1 font-mono text-sm"}),t.jsxs(Ie,{value:a.operator,onValueChange:u=>{const h=[...c],C=h[x];C&&(h[x]={...C,operator:u,value:u==="exists"?"":C.value},o(h),e(h.filter(F=>F.key.trim())))},children:[t.jsx(Be,{className:"w-28",children:t.jsx(Ee,{})}),t.jsx(Oe,{children:Je.map(u=>t.jsx(Ae,{value:u.value,children:u.label},u.value))})]})]}),a.operator!=="exists"&&t.jsx(ue,{placeholder:"Value",value:a.value,onChange:u=>v(x,{value:u.target.value}),onBlur:f,onKeyDown:u=>{u.key==="Enter"&&f()},className:"w-full font-mono text-sm"})]},x)),t.jsxs(R,{variant:"outline",size:"sm",className:"w-full",onClick:b,children:[t.jsx(He,{size:14,className:"mr-1.5"}),"Add filter"]})]}),k>0&&t.jsx(R,{variant:"ghost",size:"sm",className:"w-full mt-3 text-muted-foreground",onClick:y,children:"Clear all filters"})]})]})]})}function G(s,e){return e||Number.isInteger(s)?s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toLocaleString():s>=1e6?`${(s/1e6).toFixed(2)}M`:s>=1e3?`${(s/1e3).toFixed(2)}K`:s.toFixed(2)}function ae(s){return{sum:"Total",avg:"Average",min:"Minimum",max:"Maximum",count:"Count",last:"Latest"}[s]??s}function le(s){const e=D.c(7),{name:r,subtitle:i}=s;let l;e[0]!==r?(l=t.jsx("div",{className:"text-sm font-medium text-foreground",children:r}),e[0]=r,e[1]=l):l=e[1];let n;e[2]!==i?(n=t.jsx("div",{className:"text-xs text-muted-foreground",children:i}),e[2]=i,e[3]=n):n=e[3];let c;return e[4]!==l||e[5]!==n?(c=t.jsxs("div",{className:"px-4 py-3",children:[l,n]}),e[4]=l,e[5]=n,e[6]=c):c=e[6],c}function Ze(s){const e=D.c(13),{widget:r,result:i}=s,l=i?.value??0,n=r.aggregation.fn==="count",c=r.name;let o;e[0]!==r.aggregation.fn?(o=ae(r.aggregation.fn),e[0]=r.aggregation.fn,e[1]=o):o=e[1];let m;e[2]!==o||e[3]!==r.name?(m=t.jsx(le,{name:c,subtitle:o}),e[2]=o,e[3]=r.name,e[4]=m):m=e[4];let d;e[5]!==n||e[6]!==l?(d=G(l,n),e[5]=n,e[6]=l,e[7]=d):d=e[7];let g;e[8]!==d?(g=t.jsx("div",{className:"px-4 pb-4 mt-auto",children:t.jsx("div",{className:"text-4xl font-bold tabular-nums",children:d})}),e[8]=d,e[9]=g):g=e[9];let f;return e[10]!==m||e[11]!==g?(f=t.jsxs("div",{className:"border rounded-lg bg-card flex flex-col h-full",children:[m,g]}),e[10]=m,e[11]=g,e[12]=f):f=e[12],f}function et(s){const e=D.c(15),{widget:r,result:i}=s;let l,n;e[0]!==i?.groups?(l=i?.groups??[],n=Math.max(...l.map(tt),1),e[0]=i?.groups,e[1]=l,e[2]=n):(l=e[1],n=e[2]);const c=n;let o;e[3]!==r.aggregation.fn||e[4]!==r.aggregation.groupBy?(o=r.aggregation.groupBy?`Grouped by ${r.aggregation.groupBy}`:ae(r.aggregation.fn),e[3]=r.aggregation.fn,e[4]=r.aggregation.groupBy,e[5]=o):o=e[5];let m;e[6]!==o||e[7]!==r.name?(m=t.jsx(le,{name:r.name,subtitle:o}),e[6]=o,e[7]=r.name,e[8]=m):m=e[8];let d;e[9]!==l||e[10]!==c?(d=t.jsx("div",{className:"max-h-[300px] overflow-auto",children:l.length===0?t.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"No data available for this query"}):t.jsx("div",{className:"divide-y",children:l.map(f=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-2",children:[t.jsx("span",{className:"text-sm truncate flex-1 min-w-0",children:f.key||"(empty)"}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0 w-32",children:[t.jsx("div",{className:"flex-1 h-1.5 bg-muted rounded-full overflow-hidden",children:t.jsx("div",{className:"h-full bg-primary rounded-full",style:{width:`${f.value/c*100}%`}})}),t.jsx("span",{className:"text-xs tabular-nums text-muted-foreground w-10 text-right",children:G(f.value,!0)})]})]},f.key))})}),e[9]=l,e[10]=c,e[11]=d):d=e[11];let g;return e[12]!==m||e[13]!==d?(g=t.jsxs("div",{className:"border rounded-lg bg-card overflow-hidden flex flex-col h-full",children:[m,d]}),e[12]=m,e[13]=d,e[14]=g):g=e[14],g}function tt(s){return s.value}function st(s){const e=D.c(37),{widget:r,result:i}=s;let l,n,c,o,m,d,g,f,p;if(e[0]!==i?.timeseries||e[1]!==r.aggregation.fn||e[2]!==r.aggregation.interval||e[3]!==r.name){p=i?.timeseries??[],n=Math.max(...p.map(at),1);const a=p.reduce(rt,0);l=r.aggregation.fn==="count",f="border rounded-lg bg-card overflow-hidden flex flex-col h-full",d="flex items-start justify-between pr-4";const x=r.name;let u;e[13]!==r.aggregation.fn?(u=ae(r.aggregation.fn),e[13]=r.aggregation.fn,e[14]=u):u=e[14];const h=`${u} per ${r.aggregation.interval}`;e[15]!==h||e[16]!==r.name?(g=t.jsx(le,{name:x,subtitle:h}),e[15]=h,e[16]=r.name,e[17]=g):g=e[17],m="text-right pt-3",c="text-lg font-semibold tabular-nums leading-tight",o=G(a,l),e[0]=i?.timeseries,e[1]=r.aggregation.fn,e[2]=r.aggregation.interval,e[3]=r.name,e[4]=l,e[5]=n,e[6]=c,e[7]=o,e[8]=m,e[9]=d,e[10]=g,e[11]=f,e[12]=p}else l=e[4],n=e[5],c=e[6],o=e[7],m=e[8],d=e[9],g=e[10],f=e[11],p=e[12];let j;e[18]!==c||e[19]!==o?(j=t.jsx("div",{className:c,children:o}),e[18]=c,e[19]=o,e[20]=j):j=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"text-xs text-muted-foreground",children:"total"}),e[21]=v):v=e[21];let b;e[22]!==m||e[23]!==j?(b=t.jsxs("div",{className:m,children:[j,v]}),e[22]=m,e[23]=j,e[24]=b):b=e[24];let w;e[25]!==d||e[26]!==g||e[27]!==b?(w=t.jsxs("div",{className:d,children:[g,b]}),e[25]=d,e[26]=g,e[27]=b,e[28]=w):w=e[28];let y;e[29]!==l||e[30]!==n||e[31]!==p?(y=t.jsx("div",{className:"px-4 pb-3 flex-1 flex flex-col min-h-0",children:p.length===0?t.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"No data available"}):t.jsxs("div",{className:"flex-1 flex flex-col",children:[t.jsx("div",{className:"text-[10px] text-muted-foreground mb-1 tabular-nums",children:G(n,l)}),t.jsx("div",{className:"flex items-end gap-[2px] flex-1",children:p.map((a,x)=>t.jsx("div",{className:"group relative flex-1 bg-primary/70 rounded-t transition-all hover:bg-primary cursor-default",style:{height:`${a.value/n*100}%`,minHeight:a.value>0?"3px":"0px"},children:t.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1.5 hidden group-hover:block z-10 pointer-events-none",children:t.jsx("div",{className:"bg-foreground text-background text-[10px] px-1.5 py-0.5 rounded whitespace-nowrap tabular-nums",children:G(a.value,l)})})},x))}),t.jsx("div",{className:"flex justify-between text-[10px] text-muted-foreground mt-1.5 tabular-nums",children:p.length>0&&(()=>{const a=new Date(p[0].timestamp),x=new Date(p[p.length-1].timestamp),C=x.getTime()-a.getTime()>864e5?{month:"short",day:"numeric"}:{hour:"2-digit",minute:"2-digit"};return t.jsxs(t.Fragment,{children:[t.jsx("span",{children:a.toLocaleString([],C)}),t.jsx("span",{children:x.toLocaleString([],C)})]})})()})]})}),e[29]=l,e[30]=n,e[31]=p,e[32]=y):y=e[32];let k;return e[33]!==w||e[34]!==y||e[35]!==f?(k=t.jsxs("div",{className:f,children:[w,y]}),e[33]=w,e[34]=y,e[35]=f,e[36]=k):k=e[36],k}function rt(s,e){return s+e.value}function at(s){return s.value}function lt(s){const e=D.c(81),{dashboardId:r,timeRange:i,propertyFilters:l,onEdit:n,onRefresh:c,onTimeRangeChange:o,onPropertyFiltersChange:m}=s,{org:d,project:g,locator:f}=fe();let p;e[0]!==d.id?(p={connectionId:je,orgId:d.id},e[0]=d.id,e[1]=p):p=e[1];const j=be(p);let v;e[2]!==r||e[3]!==f?(v=oe.monitoringDashboardDetails(f,r),e[2]=r,e[3]=f,e[4]=v):v=e[4];let b;e[5]!==j||e[6]!==r?(b=async()=>{if(!j)throw new Error("MCP client not available");const N=await j.callTool({name:"MONITORING_DASHBOARD_GET",arguments:{id:r}});return N.structuredContent??N},e[5]=j,e[6]=r,e[7]=b):b=e[7];let w;e[8]!==v||e[9]!==b?(w={queryKey:v,queryFn:b},e[8]=v,e[9]=b,e[10]=w):w=e[10];const{data:y}=ne(w);let k,a,x;if(e[11]!==r||e[12]!==f||e[13]!==l||e[14]!==i.from||e[15]!==i.to){const N=l.filter(ot),S=ye(N);k=N.length>0?ve(N):void 0,x=ne,a=oe.monitoringDashboardQuery(f,r,i.from,i.to,S||void 0),e[11]=r,e[12]=f,e[13]=l,e[14]=i.from,e[15]=i.to,e[16]=k,e[17]=a,e[18]=x}else k=e[16],a=e[17],x=e[18];let u;e[19]!==k||e[20]!==j||e[21]!==r||e[22]!==i.from||e[23]!==i.to?(u=async()=>{if(!j)throw new Error("MCP client not available");const N=me(i.from),S=me(i.to),W=N.date||new Date(Date.now()-864e5),se=S.date||new Date,ie=await j.callTool({name:"MONITORING_DASHBOARD_QUERY",arguments:{dashboardId:r,timeRange:{startDate:W.toISOString(),endDate:se.toISOString()},...k?{propertyFilters:k}:{}}});return ie.structuredContent??ie},e[19]=k,e[20]=j,e[21]=r,e[22]=i.from,e[23]=i.to,e[24]=u):u=e[24];let h;e[25]!==a||e[26]!==u?(h={queryKey:a,queryFn:u,refetchInterval:3e4},e[25]=a,e[26]=u,e[27]=h):h=e[27];const{data:C,isRefetching:F}=x(h);if(!y){let N;return e[28]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Dashboard not found"}),e[28]=N):N=e[28],N}let H;e[29]!==C?.results?(H=new Map(C?.results?.map(nt)??[]),e[29]=C?.results,e[30]=H):H=e[30];const Q=H;let T;e[31]!==d.slug||e[32]!==g.slug?(T={org:d.slug,project:g.slug},e[31]=d.slug,e[32]=g.slug,e[33]=T):T=e[33];let Y;e[34]===Symbol.for("react.memo_cache_sentinel")?(Y={tab:"dashboards"},e[34]=Y):Y=e[34];let _;e[35]!==T?(_=t.jsx(de,{children:t.jsx(Fe,{asChild:!0,children:t.jsx(ge,{to:"/$org/$project/monitoring",params:T,search:Y,children:"Monitoring"})})}),e[35]=T,e[36]=_):_=e[36];let U;e[37]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx(Re,{}),e[37]=U):U=e[37];let P;e[38]!==y.name?(P=t.jsx(de,{children:t.jsx($e,{children:y.name})}),e[38]=y.name,e[39]=P):P=e[39];let J;e[40]!==_||e[41]!==P?(J=t.jsx(De,{children:t.jsxs(Te,{children:[_,U,P]})}),e[40]=_,e[41]=P,e[42]=J):J=e[42];const te=J;let M;e[43]!==n?(M=n&&t.jsx(R,{variant:"outline",size:"icon",className:"h-7 w-7",onClick:n,children:t.jsx(Ne,{size:14})}),e[43]=n,e[44]=M):M=e[44];let X;e[45]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx(re,{size:14}),e[45]=X):X=e[45];let z;e[46]!==c?(z=t.jsx(R,{variant:"outline",size:"icon",className:"h-7 w-7",onClick:c,children:X}),e[46]=c,e[47]=z):z=e[47];let I;e[48]!==m||e[49]!==l?(I=t.jsx(Xe,{value:l,onChange:m}),e[48]=m,e[49]=l,e[50]=I):I=e[50];let B;e[51]!==i.from||e[52]!==i.to?(B={from:i.from,to:i.to},e[51]=i.from,e[52]=i.to,e[53]=B):B=e[53];let E;e[54]!==o||e[55]!==B?(E=t.jsx(we,{value:B,onChange:o,className:"min-w-0"}),e[54]=o,e[55]=B,e[56]=E):E=e[56];let O;e[57]!==M||e[58]!==z||e[59]!==I||e[60]!==E?(O=t.jsxs(Se,{children:[M,z,I,E]}),e[57]=M,e[58]=z,e[59]=I,e[60]=E,e[61]=O):O=e[61];let A;e[62]!==y.description?(A=y.description&&t.jsx("div",{className:"mb-6",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:y.description})}),e[62]=y.description,e[63]=A):A=e[63];let K;if(e[64]!==y.widgets||e[65]!==Q){let N;e[67]!==Q?(N=S=>{const W=Q.get(S.id),se=S.type==="metric"?"":"col-span-2";return t.jsxs("div",{className:se,children:[S.type==="metric"&&t.jsx(Ze,{widget:S,result:W}),S.type==="table"&&t.jsx(et,{widget:S,result:W}),S.type==="timeseries"&&t.jsx(st,{widget:S,result:W})]},S.id)},e[67]=Q,e[68]=N):N=e[68],K=y.widgets.map(N),e[64]=y.widgets,e[65]=Q,e[66]=K}else K=e[66];let L;e[69]!==K?(L=t.jsx("div",{className:"grid grid-cols-5 gap-4",ref:it,children:K}),e[69]=K,e[70]=L):L=e[70];let V;e[71]!==F?(V=F&&t.jsxs("div",{className:"fixed bottom-4 right-4 bg-background border rounded-lg px-3 py-2 shadow-lg flex items-center gap-2 text-sm",children:[t.jsx(re,{size:14,className:"animate-spin"}),"Refreshing..."]}),e[71]=F,e[72]=V):V=e[72];let q;e[73]!==A||e[74]!==L||e[75]!==V?(q=t.jsxs("div",{className:"flex-1 flex flex-col overflow-auto p-5",children:[A,L,V]}),e[73]=A,e[74]=L,e[75]=V,e[76]=q):q=e[76];let Z;return e[77]!==te||e[78]!==O||e[79]!==q?(Z=t.jsxs(Ce,{breadcrumb:te,children:[O,q]}),e[77]=te,e[78]=O,e[79]=q,e[80]=Z):Z=e[80],Z}function it(s){if(!s)return;const e=()=>{const i=(s.clientWidth-64)/5;s.style.gridAutoRows=`${i}px`};e(),new ResizeObserver(e).observe(s)}function nt(s){return[s.widgetId,s]}function ot(s){return s.key.trim()}function ct(s){const e=D.c(13),{dashboardId:r,onEdit:i}=s,l=xe();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"now-24h",to:"now"},e[0]=n):n=e[0];const[c,o]=$.useState(n);let m;e[1]===Symbol.for("react.memo_cache_sentinel")?(m=[],e[1]=m):m=e[1];const[d,g]=$.useState(m);let f;e[2]!==r||e[3]!==l?(f=()=>{l.invalidateQueries({predicate:w=>w.queryKey[0]==="monitoringDashboardQuery"&&w.queryKey[2]===r})},e[2]=r,e[3]=l,e[4]=f):f=e[4];const p=f;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Failed to load dashboard"}),e[5]=j):j=e[5];let v;e[6]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(re,{size:24,className:"animate-spin text-muted-foreground"})}),e[6]=v):v=e[6];let b;return e[7]!==r||e[8]!==p||e[9]!==i||e[10]!==d||e[11]!==c?(b=t.jsx(ke,{fallback:j,children:t.jsx($.Suspense,{fallback:v,children:t.jsx(lt,{dashboardId:r,timeRange:c,propertyFilters:d,onEdit:i,onRefresh:p,onTimeRangeChange:o,onPropertyFiltersChange:g})})}),e[7]=r,e[8]=p,e[9]=i,e[10]=d,e[11]=c,e[12]=b):b=e[12],b}function Lt(){const s=D.c(9);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},s[0]=e):e=s[0];const{dashboardId:r}=pe(e),{org:i,project:l}=fe(),n=he();let c;s[1]!==r||s[2]!==n||s[3]!==i.slug||s[4]!==l.slug?(c=()=>{n({to:"/$org/$project/monitoring/dashboards/$dashboardId/edit",params:{org:i.slug,project:l.slug,dashboardId:r}})},s[1]=r,s[2]=n,s[3]=i.slug,s[4]=l.slug,s[5]=c):c=s[5];const o=c;let m;return s[6]!==r||s[7]!==o?(m=t.jsx(ct,{dashboardId:r,onEdit:o}),s[6]=r,s[7]=o,s[8]=m):m=s[8],m}export{Lt as default};
4
+ debug?`,value:m,onChange:a=>d(a.target.value),onBlur:p,onKeyDown:a=>{a.key==="Enter"&&a.metaKey&&p()},className:"font-mono text-sm min-h-[80px] resize-none"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["One per line:"," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key=value"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key~contains"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key@in_list"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key?"})]})]}):t.jsxs("div",{className:"space-y-3",children:[c.map((a,x)=>t.jsxs("div",{className:"p-2.5 rounded-md border border-border bg-muted/30 space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("span",{className:"text-xs text-muted-foreground",children:["Filter ",x+1]}),t.jsx(R,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:()=>w(x),children:t.jsx(Ye,{size:12})})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(ue,{placeholder:"Key (e.g., thread_id)",value:a.key,onChange:u=>v(x,{key:u.target.value}),onBlur:f,onKeyDown:u=>{u.key==="Enter"&&f()},className:"flex-1 font-mono text-sm"}),t.jsxs(Me,{value:a.operator,onValueChange:u=>{const h=[...c],C=h[x];C&&(h[x]={...C,operator:u,value:u==="exists"?"":C.value},o(h),e(h.filter(F=>F.key.trim())))},children:[t.jsx(Be,{className:"w-28",children:t.jsx(Ee,{})}),t.jsx(Oe,{children:Je.map(u=>t.jsx(Le,{value:u.value,children:u.label},u.value))})]})]}),a.operator!=="exists"&&t.jsx(ue,{placeholder:"Value",value:a.value,onChange:u=>v(x,{value:u.target.value}),onBlur:f,onKeyDown:u=>{u.key==="Enter"&&f()},className:"w-full font-mono text-sm"})]},x)),t.jsxs(R,{variant:"outline",size:"sm",className:"w-full",onClick:b,children:[t.jsx(He,{size:14,className:"mr-1.5"}),"Add filter"]})]}),k>0&&t.jsx(R,{variant:"ghost",size:"sm",className:"w-full mt-3 text-muted-foreground",onClick:y,children:"Clear all filters"})]})]})]})}function G(s,e){return e||Number.isInteger(s)?s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toLocaleString():s>=1e6?`${(s/1e6).toFixed(2)}M`:s>=1e3?`${(s/1e3).toFixed(2)}K`:s.toFixed(2)}function ae(s){return{sum:"Total",avg:"Average",min:"Minimum",max:"Maximum",count:"Count",last:"Latest"}[s]??s}function le(s){const e=D.c(7),{name:r,subtitle:i}=s;let l;e[0]!==r?(l=t.jsx("div",{className:"text-sm font-medium text-foreground",children:r}),e[0]=r,e[1]=l):l=e[1];let n;e[2]!==i?(n=t.jsx("div",{className:"text-xs text-muted-foreground",children:i}),e[2]=i,e[3]=n):n=e[3];let c;return e[4]!==l||e[5]!==n?(c=t.jsxs("div",{className:"px-4 py-3",children:[l,n]}),e[4]=l,e[5]=n,e[6]=c):c=e[6],c}function Ze(s){const e=D.c(13),{widget:r,result:i}=s,l=i?.value??0,n=r.aggregation.fn==="count",c=r.name;let o;e[0]!==r.aggregation.fn?(o=ae(r.aggregation.fn),e[0]=r.aggregation.fn,e[1]=o):o=e[1];let m;e[2]!==o||e[3]!==r.name?(m=t.jsx(le,{name:c,subtitle:o}),e[2]=o,e[3]=r.name,e[4]=m):m=e[4];let d;e[5]!==n||e[6]!==l?(d=G(l,n),e[5]=n,e[6]=l,e[7]=d):d=e[7];let g;e[8]!==d?(g=t.jsx("div",{className:"px-4 pb-4 mt-auto",children:t.jsx("div",{className:"text-4xl font-bold tabular-nums",children:d})}),e[8]=d,e[9]=g):g=e[9];let f;return e[10]!==m||e[11]!==g?(f=t.jsxs("div",{className:"border rounded-lg bg-card flex flex-col h-full",children:[m,g]}),e[10]=m,e[11]=g,e[12]=f):f=e[12],f}function et(s){const e=D.c(15),{widget:r,result:i}=s;let l,n;e[0]!==i?.groups?(l=i?.groups??[],n=Math.max(...l.map(tt),1),e[0]=i?.groups,e[1]=l,e[2]=n):(l=e[1],n=e[2]);const c=n;let o;e[3]!==r.aggregation.fn||e[4]!==r.aggregation.groupBy?(o=r.aggregation.groupBy?`Grouped by ${r.aggregation.groupBy}`:ae(r.aggregation.fn),e[3]=r.aggregation.fn,e[4]=r.aggregation.groupBy,e[5]=o):o=e[5];let m;e[6]!==o||e[7]!==r.name?(m=t.jsx(le,{name:r.name,subtitle:o}),e[6]=o,e[7]=r.name,e[8]=m):m=e[8];let d;e[9]!==l||e[10]!==c?(d=t.jsx("div",{className:"max-h-[300px] overflow-auto",children:l.length===0?t.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"No data available for this query"}):t.jsx("div",{className:"divide-y",children:l.map(f=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-2",children:[t.jsx("span",{className:"text-sm truncate flex-1 min-w-0",children:f.key||"(empty)"}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0 w-32",children:[t.jsx("div",{className:"flex-1 h-1.5 bg-muted rounded-full overflow-hidden",children:t.jsx("div",{className:"h-full bg-primary rounded-full",style:{width:`${f.value/c*100}%`}})}),t.jsx("span",{className:"text-xs tabular-nums text-muted-foreground w-10 text-right",children:G(f.value,!0)})]})]},f.key))})}),e[9]=l,e[10]=c,e[11]=d):d=e[11];let g;return e[12]!==m||e[13]!==d?(g=t.jsxs("div",{className:"border rounded-lg bg-card overflow-hidden flex flex-col h-full",children:[m,d]}),e[12]=m,e[13]=d,e[14]=g):g=e[14],g}function tt(s){return s.value}function st(s){const e=D.c(37),{widget:r,result:i}=s;let l,n,c,o,m,d,g,f,p;if(e[0]!==i?.timeseries||e[1]!==r.aggregation.fn||e[2]!==r.aggregation.interval||e[3]!==r.name){p=i?.timeseries??[],n=Math.max(...p.map(at),1);const a=p.reduce(rt,0);l=r.aggregation.fn==="count",f="border rounded-lg bg-card overflow-hidden flex flex-col h-full",d="flex items-start justify-between pr-4";const x=r.name;let u;e[13]!==r.aggregation.fn?(u=ae(r.aggregation.fn),e[13]=r.aggregation.fn,e[14]=u):u=e[14];const h=`${u} per ${r.aggregation.interval}`;e[15]!==h||e[16]!==r.name?(g=t.jsx(le,{name:x,subtitle:h}),e[15]=h,e[16]=r.name,e[17]=g):g=e[17],m="text-right pt-3",c="text-lg font-semibold tabular-nums leading-tight",o=G(a,l),e[0]=i?.timeseries,e[1]=r.aggregation.fn,e[2]=r.aggregation.interval,e[3]=r.name,e[4]=l,e[5]=n,e[6]=c,e[7]=o,e[8]=m,e[9]=d,e[10]=g,e[11]=f,e[12]=p}else l=e[4],n=e[5],c=e[6],o=e[7],m=e[8],d=e[9],g=e[10],f=e[11],p=e[12];let j;e[18]!==c||e[19]!==o?(j=t.jsx("div",{className:c,children:o}),e[18]=c,e[19]=o,e[20]=j):j=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"text-xs text-muted-foreground",children:"total"}),e[21]=v):v=e[21];let b;e[22]!==m||e[23]!==j?(b=t.jsxs("div",{className:m,children:[j,v]}),e[22]=m,e[23]=j,e[24]=b):b=e[24];let w;e[25]!==d||e[26]!==g||e[27]!==b?(w=t.jsxs("div",{className:d,children:[g,b]}),e[25]=d,e[26]=g,e[27]=b,e[28]=w):w=e[28];let y;e[29]!==l||e[30]!==n||e[31]!==p?(y=t.jsx("div",{className:"px-4 pb-3 flex-1 flex flex-col min-h-0",children:p.length===0?t.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"No data available"}):t.jsxs("div",{className:"flex-1 flex flex-col",children:[t.jsx("div",{className:"text-[10px] text-muted-foreground mb-1 tabular-nums",children:G(n,l)}),t.jsx("div",{className:"flex items-end gap-[2px] flex-1",children:p.map((a,x)=>t.jsx("div",{className:"group relative flex-1 bg-primary/70 rounded-t transition-all hover:bg-primary cursor-default",style:{height:`${a.value/n*100}%`,minHeight:a.value>0?"3px":"0px"},children:t.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1.5 hidden group-hover:block z-10 pointer-events-none",children:t.jsx("div",{className:"bg-foreground text-background text-[10px] px-1.5 py-0.5 rounded whitespace-nowrap tabular-nums",children:G(a.value,l)})})},x))}),t.jsx("div",{className:"flex justify-between text-[10px] text-muted-foreground mt-1.5 tabular-nums",children:p.length>0&&(()=>{const a=new Date(p[0].timestamp),x=new Date(p[p.length-1].timestamp),C=x.getTime()-a.getTime()>864e5?{month:"short",day:"numeric"}:{hour:"2-digit",minute:"2-digit"};return t.jsxs(t.Fragment,{children:[t.jsx("span",{children:a.toLocaleString([],C)}),t.jsx("span",{children:x.toLocaleString([],C)})]})})()})]})}),e[29]=l,e[30]=n,e[31]=p,e[32]=y):y=e[32];let k;return e[33]!==w||e[34]!==y||e[35]!==f?(k=t.jsxs("div",{className:f,children:[w,y]}),e[33]=w,e[34]=y,e[35]=f,e[36]=k):k=e[36],k}function rt(s,e){return s+e.value}function at(s){return s.value}function lt(s){const e=D.c(81),{dashboardId:r,timeRange:i,propertyFilters:l,onEdit:n,onRefresh:c,onTimeRangeChange:o,onPropertyFiltersChange:m}=s,{org:d,project:g,locator:f}=fe();let p;e[0]!==d.id?(p={connectionId:je,orgId:d.id},e[0]=d.id,e[1]=p):p=e[1];const j=be(p);let v;e[2]!==r||e[3]!==f?(v=oe.monitoringDashboardDetails(f,r),e[2]=r,e[3]=f,e[4]=v):v=e[4];let b;e[5]!==j||e[6]!==r?(b=async()=>{if(!j)throw new Error("MCP client not available");const N=await j.callTool({name:"MONITORING_DASHBOARD_GET",arguments:{id:r}});return N.structuredContent??N},e[5]=j,e[6]=r,e[7]=b):b=e[7];let w;e[8]!==v||e[9]!==b?(w={queryKey:v,queryFn:b},e[8]=v,e[9]=b,e[10]=w):w=e[10];const{data:y}=ne(w);let k,a,x;if(e[11]!==r||e[12]!==f||e[13]!==l||e[14]!==i.from||e[15]!==i.to){const N=l.filter(ot),S=ye(N);k=N.length>0?ve(N):void 0,x=ne,a=oe.monitoringDashboardQuery(f,r,i.from,i.to,S||void 0),e[11]=r,e[12]=f,e[13]=l,e[14]=i.from,e[15]=i.to,e[16]=k,e[17]=a,e[18]=x}else k=e[16],a=e[17],x=e[18];let u;e[19]!==k||e[20]!==j||e[21]!==r||e[22]!==i.from||e[23]!==i.to?(u=async()=>{if(!j)throw new Error("MCP client not available");const N=me(i.from),S=me(i.to),W=N.date||new Date(Date.now()-864e5),se=S.date||new Date,ie=await j.callTool({name:"MONITORING_DASHBOARD_QUERY",arguments:{dashboardId:r,timeRange:{startDate:W.toISOString(),endDate:se.toISOString()},...k?{propertyFilters:k}:{}}});return ie.structuredContent??ie},e[19]=k,e[20]=j,e[21]=r,e[22]=i.from,e[23]=i.to,e[24]=u):u=e[24];let h;e[25]!==a||e[26]!==u?(h={queryKey:a,queryFn:u,refetchInterval:3e4},e[25]=a,e[26]=u,e[27]=h):h=e[27];const{data:C,isRefetching:F}=x(h);if(!y){let N;return e[28]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Dashboard not found"}),e[28]=N):N=e[28],N}let H;e[29]!==C?.results?(H=new Map(C?.results?.map(nt)??[]),e[29]=C?.results,e[30]=H):H=e[30];const Q=H;let T;e[31]!==d.slug||e[32]!==g.slug?(T={org:d.slug,project:g.slug},e[31]=d.slug,e[32]=g.slug,e[33]=T):T=e[33];let Y;e[34]===Symbol.for("react.memo_cache_sentinel")?(Y={tab:"dashboards"},e[34]=Y):Y=e[34];let _;e[35]!==T?(_=t.jsx(de,{children:t.jsx(Fe,{asChild:!0,children:t.jsx(ge,{to:"/$org/$project/monitoring",params:T,search:Y,children:"Monitoring"})})}),e[35]=T,e[36]=_):_=e[36];let U;e[37]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx(Re,{}),e[37]=U):U=e[37];let P;e[38]!==y.name?(P=t.jsx(de,{children:t.jsx($e,{children:y.name})}),e[38]=y.name,e[39]=P):P=e[39];let J;e[40]!==_||e[41]!==P?(J=t.jsx(De,{children:t.jsxs(Te,{children:[_,U,P]})}),e[40]=_,e[41]=P,e[42]=J):J=e[42];const te=J;let z;e[43]!==n?(z=n&&t.jsx(R,{variant:"outline",size:"icon",className:"h-7 w-7",onClick:n,children:t.jsx(Ne,{size:14})}),e[43]=n,e[44]=z):z=e[44];let X;e[45]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx(re,{size:14}),e[45]=X):X=e[45];let I;e[46]!==c?(I=t.jsx(R,{variant:"outline",size:"icon",className:"h-7 w-7",onClick:c,children:X}),e[46]=c,e[47]=I):I=e[47];let M;e[48]!==m||e[49]!==l?(M=t.jsx(Xe,{value:l,onChange:m}),e[48]=m,e[49]=l,e[50]=M):M=e[50];let B;e[51]!==i.from||e[52]!==i.to?(B={from:i.from,to:i.to},e[51]=i.from,e[52]=i.to,e[53]=B):B=e[53];let E;e[54]!==o||e[55]!==B?(E=t.jsx(we,{value:B,onChange:o,className:"min-w-0"}),e[54]=o,e[55]=B,e[56]=E):E=e[56];let O;e[57]!==z||e[58]!==I||e[59]!==M||e[60]!==E?(O=t.jsxs(Se,{children:[z,I,M,E]}),e[57]=z,e[58]=I,e[59]=M,e[60]=E,e[61]=O):O=e[61];let L;e[62]!==y.description?(L=y.description&&t.jsx("div",{className:"mb-6",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:y.description})}),e[62]=y.description,e[63]=L):L=e[63];let A;if(e[64]!==y.widgets||e[65]!==Q){let N;e[67]!==Q?(N=S=>{const W=Q.get(S.id),se=S.type==="metric"?"":"col-span-2";return t.jsxs("div",{className:se,children:[S.type==="metric"&&t.jsx(Ze,{widget:S,result:W}),S.type==="table"&&t.jsx(et,{widget:S,result:W}),S.type==="timeseries"&&t.jsx(st,{widget:S,result:W})]},S.id)},e[67]=Q,e[68]=N):N=e[68],A=y.widgets.map(N),e[64]=y.widgets,e[65]=Q,e[66]=A}else A=e[66];let K;e[69]!==A?(K=t.jsx("div",{className:"grid grid-cols-5 gap-4",ref:it,children:A}),e[69]=A,e[70]=K):K=e[70];let V;e[71]!==F?(V=F&&t.jsxs("div",{className:"fixed bottom-4 right-4 bg-background border rounded-lg px-3 py-2 shadow-lg flex items-center gap-2 text-sm",children:[t.jsx(re,{size:14,className:"animate-spin"}),"Refreshing..."]}),e[71]=F,e[72]=V):V=e[72];let q;e[73]!==L||e[74]!==K||e[75]!==V?(q=t.jsxs("div",{className:"flex-1 flex flex-col overflow-auto p-5",children:[L,K,V]}),e[73]=L,e[74]=K,e[75]=V,e[76]=q):q=e[76];let Z;return e[77]!==te||e[78]!==O||e[79]!==q?(Z=t.jsxs(Ce,{breadcrumb:te,children:[O,q]}),e[77]=te,e[78]=O,e[79]=q,e[80]=Z):Z=e[80],Z}function it(s){if(!s)return;const e=()=>{const i=(s.clientWidth-64)/5;s.style.gridAutoRows=`${i}px`};e(),new ResizeObserver(e).observe(s)}function nt(s){return[s.widgetId,s]}function ot(s){return s.key.trim()}function ct(s){const e=D.c(13),{dashboardId:r,onEdit:i}=s,l=xe();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"now-24h",to:"now"},e[0]=n):n=e[0];const[c,o]=$.useState(n);let m;e[1]===Symbol.for("react.memo_cache_sentinel")?(m=[],e[1]=m):m=e[1];const[d,g]=$.useState(m);let f;e[2]!==r||e[3]!==l?(f=()=>{l.invalidateQueries({predicate:w=>w.queryKey[0]==="monitoringDashboardQuery"&&w.queryKey[2]===r})},e[2]=r,e[3]=l,e[4]=f):f=e[4];const p=f;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Failed to load dashboard"}),e[5]=j):j=e[5];let v;e[6]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(re,{size:24,className:"animate-spin text-muted-foreground"})}),e[6]=v):v=e[6];let b;return e[7]!==r||e[8]!==p||e[9]!==i||e[10]!==d||e[11]!==c?(b=t.jsx(ke,{fallback:j,children:t.jsx($.Suspense,{fallback:v,children:t.jsx(lt,{dashboardId:r,timeRange:c,propertyFilters:d,onEdit:i,onRefresh:p,onTimeRangeChange:o,onPropertyFiltersChange:g})})}),e[7]=r,e[8]=p,e[9]=i,e[10]=d,e[11]=c,e[12]=b):b=e[12],b}function Kt(){const s=D.c(9);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},s[0]=e):e=s[0];const{dashboardId:r}=pe(e),{org:i,project:l}=fe(),n=he();let c;s[1]!==r||s[2]!==n||s[3]!==i.slug||s[4]!==l.slug?(c=()=>{n({to:"/$org/$project/monitoring/dashboards/$dashboardId/edit",params:{org:i.slug,project:l.slug,dashboardId:r}})},s[1]=r,s[2]=n,s[3]=i.slug,s[4]=l.slug,s[5]=c):c=s[5];const o=c;let m;return s[6]!==r||s[7]!==o?(m=t.jsx(ct,{dashboardId:r,onEdit:o}),s[6]=r,s[7]=o,s[8]=m):m=s[8],m}export{Kt as default};
@@ -1 +1 @@
1
- import{r as i,j as e}from"./index-B29giag9.js";import{i as n}from"./Loading01-C30bDA9h.js";import{h as l}from"./mcp-oauth-ChVLA9f3.js";function h(){const[s,c]=i.useState(null),[r,a]=i.useState(!1);return i.useEffect(()=>{(async()=>{try{const t=await l();if(!t.success){c(t.error||"MCP authentication failed"),setTimeout(()=>{window.close()},3e3);return}a(!0),setTimeout(()=>{window.close()},1500)}catch(t){c(t instanceof Error?t.message:String(t)),setTimeout(()=>{window.close()},3e3)}})()},[]),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[r&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),!r&&!s&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(n,{size:32,className:"animate-spin text-primary"})}),s&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:s?"Authentication Failed":r?"Authentication Successful":"Authentication in progress..."}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:"An error occurred during authentication:"}),e.jsx("p",{className:"text-destructive",children:s}),e.jsxs("p",{className:"mt-2",children:[e.jsx("br",{}),"This window will close automatically."]})]}):r?e.jsxs("p",{children:["Authentication complete.",e.jsx("br",{}),"This window will close automatically."]}):e.jsx("p",{children:"Processing authentication..."})})]})]})})}export{h as default};
1
+ import{r as i,j as e}from"./index-B0lAKtRh.js";import{i as n}from"./Loading01-BclS8iWV.js";import{h as l}from"./mcp-oauth-fVu6jtVi.js";function h(){const[s,c]=i.useState(null),[r,a]=i.useState(!1);return i.useEffect(()=>{(async()=>{try{const t=await l();if(!t.success){c(t.error||"MCP authentication failed"),setTimeout(()=>{window.close()},3e3);return}a(!0),setTimeout(()=>{window.close()},1500)}catch(t){c(t instanceof Error?t.message:String(t)),setTimeout(()=>{window.close()},3e3)}})()},[]),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[r&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),!r&&!s&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(n,{size:32,className:"animate-spin text-primary"})}),s&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:s?"Authentication Failed":r?"Authentication Successful":"Authentication in progress..."}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:"An error occurred during authentication:"}),e.jsx("p",{className:"text-destructive",children:s}),e.jsxs("p",{className:"mt-2",children:[e.jsx("br",{}),"This window will close automatically."]})]}):r?e.jsxs("p",{children:["Authentication complete.",e.jsx("br",{}),"This window will close automatically."]}):e.jsx("p",{children:"Processing authentication..."})})]})]})})}export{h as default};
@@ -1 +1 @@
1
- import{c as b,j as s,r as A,u as ne,g as oe,t as ee}from"./index-B29giag9.js";import{V as ae,C as g}from"./index-BCTs9n6O.js";import{T as ce,i as me,a as de,t as fe}from"./typewriter-title-cc0Pz_LM.js";import{E as ue}from"./error-boundary-8guJh7VT.js";import{u as Z,S as Y}from"./use-deco-chat-open-B0b2QgDS.js";import{I as te}from"./integration-icon-ByKWru2D.js";import{P as pe,a as he,b as xe}from"./popover-Bq8aZ27v.js";import{c as se,B as H}from"./button-D-PerQqC.js";import{i as ge,d as je}from"./constants-CH9byiKA.js";import{b as be}from"./use-virtual-mcp-IiP1g_wm.js";import{i as ye}from"./ChevronRight-lTpPQGwH.js";import{t as ie}from"./Users03-C_ymlzx3.js";import{P as E}from"./index-CwR6GYR2.js";import{T as J,a as Q,b as X}from"./tooltip-D-FT-fCa.js";import{c as Ne}from"./Pin01-DpTPW-9K.js";import{s as _e}from"./Plus-q5YWe4us.js";import{i as Se}from"./Share07-Dx2Rb32N.js";import"./spinner-BstVffOp.js";import"./use-mcp-prompts-BMZQCyj7.js";import"./useQuery-BO0TdkAU.js";import"./dialog-CFptoDdD.js";import"./X-BofIsacr.js";import"./form-CtFhf1V_.js";import"./label-BN7IWnf6.js";import"./input-Cxci79To.js";import"./ArrowUp-Cf0ZCNqn.js";import"./ChevronDown-BrnUqul2.js";import"./Edit01-CN-BVNm7.js";import"./use-copy-BNoj9l5V.js";import"./AlertCircle-4DBdKyiN.js";import"./ArrowLeft-BbUXsmjT.js";import"./badge-D_aixLlt.js";import"./Check-DVZrDl7E.js";import"./Code01-CgOGThgh.js";import"./SearchMd-hERLZOdx.js";import"./use-create-virtual-mcp-DhPfPD_b.js";import"./usage-B8eRkRZY.js";import"./marked.esm-BaswSlok.js";import"./Copy01-CMA5_oKx.js";import"./empty-state-DoBcZdM-.js";import"./use-connection-DrWeJHXu.js";import"./useMutation-WNJB1RXH.js";import"./generate-id-Dyweu44Y.js";import"./Clock-BpIUYvY9.js";import"./Trash01-Dk9pv506.js";import"./use-llm-DjYTM2HW.js";import"./use-binding-B7W2mOcc.js";import"./binder-BeHB3-7Y.js";import"./localstorage-keys-CwGoMvvj.js";import"./select-D6oaQfJS.js";import"./index-V777tuW4.js";import"./File06-CyuQ1kk7.js";import"./Grid01-BB6GzE_H.js";import"./Image01-Bllq3U2e.js";import"./RefreshCcw01-DRWlmqw5.js";import"./useSuspenseInfiniteQuery-DfH90Jor.js";import"./infiniteQueryObserver-Dzcc9UjY.js";import"./Container-CMQiv6Ns.js";function ve(e){const t=b.c(15),{agent:i}=e,{setVirtualMcpId:p}=Z();let r;t[0]!==i.id||t[1]!==p?(r=()=>{p(i.id)},t[0]=i.id,t[1]=p,t[2]=r):r=t[2];const l=r;let m;t[3]===Symbol.for("react.memo_cache_sentinel")?(m=se("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors hover:bg-accent/30","cursor-pointer","self-stretch"),t[3]=m):m=t[3];const d=`Select agent ${i.title}`;let n;t[4]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ie,{size:20}),t[4]=n):n=t[4];let c;t[5]!==i.icon||t[6]!==i.title?(c=s.jsx(te,{icon:i.icon,name:i.title,fallbackIcon:n}),t[5]=i.icon,t[6]=i.title,t[7]=c):c=t[7];let o;t[8]!==i.title?(o=s.jsx("p",{className:"text-sm text-foreground text-center leading-tight line-clamp-2",children:i.title}),t[8]=i.title,t[9]=o):o=t[9];let a;return t[10]!==l||t[11]!==d||t[12]!==c||t[13]!==o?(a=s.jsxs("button",{type:"button",onClick:l,className:m,"aria-label":d,children:[c,o]}),t[10]=l,t[11]=d,t[12]=c,t[13]=o,t[14]=a):a=t[14],a}function Ce(e){const t=b.c(14),{virtualMcps:i,selectedVirtualMcpId:p,onVirtualMcpChange:r}=e,[l,m]=A.useState(!1),d=A.useRef(null);let n,c;t[0]!==l?(n=()=>{l&&setTimeout(()=>{d.current?.focus()},0)},c=[l],t[0]=l,t[1]=n,t[2]=c):(n=t[1],c=t[2]),A.useEffect(n,c);let o;t[3]!==r?(o=y=>{r(y),m(!1)},t[3]=r,t[4]=o):o=t[4];const a=o;let f;t[5]===Symbol.for("react.memo_cache_sentinel")?(f=se("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors hover:bg-accent/30","cursor-pointer","self-stretch"),t[5]=f):f=t[5];let u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(pe,{asChild:!0,children:s.jsxs("button",{type:"button",className:f,"aria-label":"See all agents",children:[s.jsx("div",{className:"size-12 rounded-lg bg-accent flex items-center justify-center shrink-0",children:s.jsx(ye,{size:24,className:"text-foreground"})}),s.jsx("p",{className:"text-sm text-foreground text-center leading-tight",children:"See all"})]})}),t[6]=u):u=t[6];let h;t[7]!==a||t[8]!==p||t[9]!==i?(h=s.jsx(he,{className:"w-[550px] p-0 overflow-hidden",align:"start",side:"top",sideOffset:8,children:s.jsx(ae,{virtualMcps:i,selectedVirtualMcpId:p,onVirtualMcpChange:a,searchInputRef:d})}),t[7]=a,t[8]=p,t[9]=i,t[10]=h):h=t[10];let j;return t[11]!==l||t[12]!==h?(j=s.jsxs(xe,{open:l,onOpenChange:m,children:[u,h]}),t[11]=l,t[12]=h,t[13]=j):j=t[13],j}function we(){const e=b.c(20),t=be(),{selectedVirtualMcp:i,setVirtualMcpId:p}=Z();let r,l,m,d,n,c;if(e[0]!==t){n=Symbol.for("react.early_return_sentinel");e:{const h=t.filter(ze).slice(0,6);if(h.length===0){n=null;break e}c=t.map(Te),m="w-full max-w-[800px]",e[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("h2",{className:"text-sm font-medium text-muted-foreground mb-4",children:"Recently used agents"}),e[7]=d):d=e[7],r="grid grid-cols-3 sm:grid-cols-4 md:grid-cols-7 gap-2",l=h.map(ke)}e[0]=t,e[1]=r,e[2]=l,e[3]=m,e[4]=d,e[5]=n,e[6]=c}else r=e[1],l=e[2],m=e[3],d=e[4],n=e[5],c=e[6];if(n!==Symbol.for("react.early_return_sentinel"))return n;const o=i?.id??null;let a;e[8]!==p||e[9]!==o||e[10]!==c?(a=s.jsx(Ce,{virtualMcps:c,selectedVirtualMcpId:o,onVirtualMcpChange:p}),e[8]=p,e[9]=o,e[10]=c,e[11]=a):a=e[11];let f;e[12]!==r||e[13]!==l||e[14]!==a?(f=s.jsxs("div",{className:r,children:[l,a]}),e[12]=r,e[13]=l,e[14]=a,e[15]=f):f=e[15];let u;return e[16]!==m||e[17]!==d||e[18]!==f?(u=s.jsxs("div",{className:m,children:[d,f]}),e[16]=m,e[17]=d,e[18]=f,e[19]=u):u=e[19],u}function ke(e){return s.jsx(ve,{agent:e},e.id??"default")}function Te(e){return{id:e.id,title:e.title,description:e.description,icon:e.icon}}function ze(e){return e.id!==null&&!ge(e.id)}function Me(){const e=b.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(Y,{className:"h-5 w-40 mb-4"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs("div",{className:"w-full max-w-[800px]",children:[t,s.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-4 md:grid-cols-7 gap-2",children:Array.from({length:7}).map(Ie)})]}),e[1]=i):i=e[1],i}function Ie(e,t){return s.jsxs("div",{className:"flex flex-col items-center gap-3 p-2 self-stretch",children:[s.jsx(Y,{className:"size-6 rounded-md shrink-0"}),s.jsx(Y,{className:"h-4 w-full"})]},t)}function Pe(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(A.Suspense,{fallback:s.jsx(Me,{}),children:s.jsx(we,{})}),e[0]=t):t=e[0],t}function $e(){const e=new Date().getHours();return e>=5&&e<12?"Morning":e>=12&&e<17?"Afternoon":e>=17&&e<22?"Evening":"Night"}function Ve(){const e=b.c(61),{org:t}=ne(),{data:i}=oe.useSession(),{modelsConnections:p,isChatEmpty:r,activeThreadId:l,createThread:m,switchToThread:d,threads:n,selectedVirtualMcp:c}=Z();let o;if(e[0]!==l||e[1]!==n){let x;e[3]!==l?(x=re=>re.id===l,e[3]=l,e[4]=x):x=e[4],o=n.find(x),e[0]=l,e[1]=n,e[2]=o}else o=e[2];const a=o,[f,u]=A.useState(!1);let h;e[5]!==i?.user?.name?(h=i?.user?.name?.split(" ")[0]||"there",e[5]=i?.user?.name,e[6]=h):h=e[6];const j=h;let y;e[7]===Symbol.for("react.memo_cache_sentinel")?(y=$e(),e[7]=y):y=e[7];const le=y;let R;e[8]!==t.id?(R=je(t.id),e[8]=t.id,e[9]=R):R=e[9];const B=c??R;if(p.length===0){let x;return e[10]!==t?(x=s.jsx("div",{className:"flex flex-col size-full bg-background items-center justify-center",children:s.jsx(g.NoLlmBindingEmptyState,{org:t})}),e[10]=t,e[11]=x):x=e[11],x}let N;e[12]!==a?(N=a?.title&&s.jsx(ce,{text:a.title,className:"text-sm font-medium text-foreground"}),e[12]=a,e[13]=N):N=e[13];let _;e[14]!==N?(_=s.jsx(E.Header.Left,{className:"gap-2",children:N}),e[14]=N,e[15]=_):_=e[15];let S;e[16]!==m?(S=()=>m(),e[16]=m,e[17]=S):S=e[17];let L;e[18]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(_e,{size:16}),e[18]=L):L=e[18];let v;e[19]!==r||e[20]!==S?(v=s.jsx(J,{asChild:!0,children:s.jsx(H,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input",onClick:S,disabled:r,"aria-label":"New chat",children:L})}),e[19]=r,e[20]=S,e[21]=v):v=e[21];let O;e[22]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(Q,{children:"New chat"}),e[22]=O):O=e[22];let C;e[23]!==v?(C=s.jsxs(X,{children:[v,O]}),e[23]=v,e[24]=C):C=e[24];let D;e[25]===Symbol.for("react.memo_cache_sentinel")?(D=()=>u(!0),e[25]=D):D=e[25];let F;e[26]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsxs(X,{children:[s.jsx(J,{asChild:!0,children:s.jsx(H,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input",onClick:D,"aria-label":"Chat history",children:s.jsx(me,{size:16})})}),s.jsx(Q,{children:"Chat history"})]}),e[26]=F):F=e[26];let W;e[27]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx(Ne,{size:16}),e[27]=W):W=e[27];let w;e[28]!==r?(w=s.jsx(J,{asChild:!0,children:s.jsx(H,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input",onClick:Ee,disabled:r,"aria-label":"Pin chat",children:W})}),e[28]=r,e[29]=w):w=e[29];let q;e[30]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(Q,{children:"Pin chat"}),e[30]=q):q=e[30];let k;e[31]!==w?(k=s.jsxs(X,{children:[w,q]}),e[31]=w,e[32]=k):k=e[32];let G;e[33]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsx(Se,{size:16}),e[33]=G):G=e[33];let T;e[34]!==r?(T=s.jsx(J,{asChild:!0,children:s.jsx(H,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input",onClick:Ae,disabled:r,"aria-label":"Share chat",children:G})}),e[34]=r,e[35]=T):T=e[35];let K;e[36]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(Q,{children:"Share chat"}),e[36]=K):K=e[36];let z;e[37]!==T?(z=s.jsxs(X,{children:[T,K]}),e[37]=T,e[38]=z):z=e[38];let M;e[39]!==C||e[40]!==k||e[41]!==z?(M=s.jsxs(E.Header.Right,{className:"gap-1",children:[C,F,k,z]}),e[39]=C,e[40]=k,e[41]=z,e[42]=M):M=e[42];let I;e[43]!==M||e[44]!==_?(I=s.jsxs(E.Header,{className:"flex-none z-10 bg-background",children:[_,M]}),e[43]=M,e[44]=_,e[45]=I):I=e[45];let P;e[46]!==B||e[47]!==r||e[48]!==j?(P=r?s.jsxs("div",{className:"flex-1 min-h-0 flex flex-col items-center justify-center px-10 pb-32 pt-10",children:[s.jsxs("div",{className:"flex flex-col items-center gap-3 w-full max-w-[600px]",children:[s.jsx("div",{className:"flex justify-center",children:s.jsx(te,{icon:B.icon,name:B.title,size:"md",fallbackIcon:s.jsx(ie,{size:20}),className:"size-12 rounded-xl border border-stone-200/60 shadow-sm aspect-square transition-opacity duration-200"})}),s.jsxs("div",{className:"text-center",children:[s.jsxs("p",{className:"text-lg font-medium text-foreground",children:[le," ",j,","]}),s.jsx("p",{className:"text-base text-muted-foreground opacity-50 mb-0",children:"What are we building today?"})]}),s.jsx("div",{className:"w-full -mt-1",children:s.jsx(g.Input,{})}),s.jsx(g.IceBreakers,{className:"w-full"})]}),s.jsx("div",{className:"flex flex-col items-center w-full mt-4",children:s.jsx(Pe,{})})]}):s.jsxs(s.Fragment,{children:[s.jsx(g.Main,{children:s.jsx(g.Messages,{})}),s.jsx(g.Footer,{children:s.jsx(g.Input,{})})]}),e[46]=B,e[47]=r,e[48]=j,e[49]=P):P=e[49];let $;e[50]!==d?($=async x=>{await d(x),u(!1)},e[50]=d,e[51]=$):$=e[51];let V;e[52]!==l||e[53]!==f||e[54]!==$||e[55]!==n?(V=s.jsx(de,{open:f,onOpenChange:u,threads:n,activeThreadId:l,onThreadSelect:$}),e[52]=l,e[53]=f,e[54]=$,e[55]=n,e[56]=V):V=e[56];let U;return e[57]!==I||e[58]!==P||e[59]!==V?(U=s.jsxs(g,{className:"bg-background",children:[I,P,V]}),e[57]=I,e[58]=P,e[59]=V,e[60]=U):U=e[60],U}function Ae(){ee.info("Share feature coming soon")}function Ee(){ee.info("Pin feature coming soon")}function He(e){const t=b.c(14),{error:i,onRetry:p}=e,r=i?.message?.includes("401")||i?.message?.toLowerCase().includes("unauthorized");let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs(E.Header,{className:"flex-none",children:[s.jsx(E.Header.Left,{className:"gap-2"}),s.jsx(E.Header.Right,{className:"gap-1"})]}),t[0]=l):l=t[0];let m;t[1]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"bg-destructive/10 p-3 rounded-full mx-auto w-fit",children:s.jsx(fe,{className:"h-6 w-6 text-destructive"})}),t[1]=m):m=t[1];const d=r?"Unable to load models":"Something went wrong";let n;t[2]!==d?(n=s.jsx("h3",{className:"text-lg font-medium",children:d}),t[2]=d,t[3]=n):n=t[3];const c=r?"There was an authentication error while loading the models. This might be due to an expired session or invalid API key.":i?.message||"An unexpected error occurred";let o;t[4]!==c?(o=s.jsx("p",{className:"text-sm text-muted-foreground",children:c}),t[4]=c,t[5]=o):o=t[5];let a;t[6]!==n||t[7]!==o?(a=s.jsxs("div",{className:"space-y-2",children:[n,o]}),t[6]=n,t[7]=o,t[8]=a):a=t[8];let f;t[9]!==p?(f=s.jsx(H,{variant:"outline",onClick:p,children:"Try again"}),t[9]=p,t[10]=f):f=t[10];let u;return t[11]!==a||t[12]!==f?(u=s.jsxs(g,{className:"bg-background",children:[l,s.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center",children:s.jsxs("div",{className:"max-w-sm space-y-4",children:[m,a,f]})})]}),t[11]=a,t[12]=f,t[13]=u):u=t[13],u}function Wt(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(ue,{fallback:Re,children:s.jsx(A.Suspense,{fallback:s.jsx(g.Skeleton,{className:"bg-background"}),children:s.jsx(Ve,{})})}),e[0]=t):t=e[0],t}function Re(e){const{error:t,resetError:i}=e;return s.jsx(He,{error:t,onRetry:i})}export{Wt as default};
1
+ import{c as b,j as s,r as A,u as ne,g as oe,t as ee}from"./index-B0lAKtRh.js";import{V as ae,C as g}from"./index-CypvbRZN.js";import{T as ce,i as me,a as de,t as fe}from"./typewriter-title-fOoA67kV.js";import{E as ue}from"./error-boundary-BuSNQDm9.js";import{u as Z,S as Y}from"./use-deco-chat-open-BVQclAcG.js";import{I as te}from"./integration-icon-Qol0n8Yu.js";import{P as pe,a as he,b as xe}from"./popover-CdY9eVBh.js";import{c as se,B as H}from"./button-Cxd9D7GZ.js";import{i as ge,d as je}from"./constants-7tHIXjuz.js";import{b as be}from"./use-virtual-mcp-BPuNbW-j.js";import{i as ye}from"./ChevronRight-CVpzq9SE.js";import{t as ie}from"./Users03-9Yj1Oct5.js";import{P as E}from"./index-C4SaT72q.js";import{T as J,a as Q,b as X}from"./tooltip-DkOvFQ7D.js";import{c as Ne}from"./Pin01-DaSjWctK.js";import{s as _e}from"./Plus-C5LR6cck.js";import{i as Se}from"./Share07-CNOl6few.js";import"./spinner-BsQXvc2Y.js";import"./use-mcp-prompts-BjSsl1qM.js";import"./useQuery-Cx1KUbzW.js";import"./dialog-D36Sp9vM.js";import"./X-D-vCW-FP.js";import"./form-C7gcuapm.js";import"./label-B-xKop8p.js";import"./input-BTRdl8wU.js";import"./ArrowUp-BTMunjeO.js";import"./ChevronDown-CEjoikg0.js";import"./Edit01-DS8TXF8v.js";import"./use-copy-tAcjwV9Y.js";import"./AlertCircle-B74h0Me5.js";import"./ArrowLeft-ruL5WSCw.js";import"./badge-Ce8oucop.js";import"./Check-Dy1kSzwX.js";import"./Code01-ztcPrUdW.js";import"./SearchMd-DhDCnDEk.js";import"./use-create-virtual-mcp-BUseoHRu.js";import"./usage-B8eRkRZY.js";import"./marked.esm-BaswSlok.js";import"./Copy01-eBFwMxtu.js";import"./empty-state-x18Ct7Bg.js";import"./use-connection-t2lORAui.js";import"./useMutation-DTtaBOsy.js";import"./generate-id-Dyweu44Y.js";import"./Clock-BFqtZfyI.js";import"./Trash01-fpfGO2En.js";import"./use-llm-CJX1SR85.js";import"./use-binding-Dvp-m6Vz.js";import"./binder-B_Z7E1sw.js";import"./localstorage-keys-DE1N3_0b.js";import"./select-vvkW2wBk.js";import"./index-C1cLa9Gd.js";import"./File06-uox_o6En.js";import"./Grid01-pmpn_yyH.js";import"./Image01-CjBWTpk6.js";import"./RefreshCcw01-DxpF0pWy.js";import"./useSuspenseInfiniteQuery-CeqWcmOh.js";import"./infiniteQueryObserver-B5jHce9f.js";import"./Container-D5gdKEFc.js";function ve(e){const t=b.c(15),{agent:i}=e,{setVirtualMcpId:p}=Z();let r;t[0]!==i.id||t[1]!==p?(r=()=>{p(i.id)},t[0]=i.id,t[1]=p,t[2]=r):r=t[2];const l=r;let m;t[3]===Symbol.for("react.memo_cache_sentinel")?(m=se("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors hover:bg-accent/30","cursor-pointer","self-stretch"),t[3]=m):m=t[3];const d=`Select agent ${i.title}`;let n;t[4]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ie,{size:20}),t[4]=n):n=t[4];let c;t[5]!==i.icon||t[6]!==i.title?(c=s.jsx(te,{icon:i.icon,name:i.title,fallbackIcon:n}),t[5]=i.icon,t[6]=i.title,t[7]=c):c=t[7];let o;t[8]!==i.title?(o=s.jsx("p",{className:"text-sm text-foreground text-center leading-tight line-clamp-2",children:i.title}),t[8]=i.title,t[9]=o):o=t[9];let a;return t[10]!==l||t[11]!==d||t[12]!==c||t[13]!==o?(a=s.jsxs("button",{type:"button",onClick:l,className:m,"aria-label":d,children:[c,o]}),t[10]=l,t[11]=d,t[12]=c,t[13]=o,t[14]=a):a=t[14],a}function Ce(e){const t=b.c(14),{virtualMcps:i,selectedVirtualMcpId:p,onVirtualMcpChange:r}=e,[l,m]=A.useState(!1),d=A.useRef(null);let n,c;t[0]!==l?(n=()=>{l&&setTimeout(()=>{d.current?.focus()},0)},c=[l],t[0]=l,t[1]=n,t[2]=c):(n=t[1],c=t[2]),A.useEffect(n,c);let o;t[3]!==r?(o=y=>{r(y),m(!1)},t[3]=r,t[4]=o):o=t[4];const a=o;let f;t[5]===Symbol.for("react.memo_cache_sentinel")?(f=se("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors hover:bg-accent/30","cursor-pointer","self-stretch"),t[5]=f):f=t[5];let u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(pe,{asChild:!0,children:s.jsxs("button",{type:"button",className:f,"aria-label":"See all agents",children:[s.jsx("div",{className:"size-12 rounded-lg bg-accent flex items-center justify-center shrink-0",children:s.jsx(ye,{size:24,className:"text-foreground"})}),s.jsx("p",{className:"text-sm text-foreground text-center leading-tight",children:"See all"})]})}),t[6]=u):u=t[6];let h;t[7]!==a||t[8]!==p||t[9]!==i?(h=s.jsx(he,{className:"w-[550px] p-0 overflow-hidden",align:"start",side:"top",sideOffset:8,children:s.jsx(ae,{virtualMcps:i,selectedVirtualMcpId:p,onVirtualMcpChange:a,searchInputRef:d})}),t[7]=a,t[8]=p,t[9]=i,t[10]=h):h=t[10];let j;return t[11]!==l||t[12]!==h?(j=s.jsxs(xe,{open:l,onOpenChange:m,children:[u,h]}),t[11]=l,t[12]=h,t[13]=j):j=t[13],j}function we(){const e=b.c(20),t=be(),{selectedVirtualMcp:i,setVirtualMcpId:p}=Z();let r,l,m,d,n,c;if(e[0]!==t){n=Symbol.for("react.early_return_sentinel");e:{const h=t.filter(ze).slice(0,6);if(h.length===0){n=null;break e}c=t.map(Te),m="w-full max-w-[800px]",e[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("h2",{className:"text-sm font-medium text-muted-foreground mb-4",children:"Recently used agents"}),e[7]=d):d=e[7],r="grid grid-cols-3 sm:grid-cols-4 md:grid-cols-7 gap-2",l=h.map(ke)}e[0]=t,e[1]=r,e[2]=l,e[3]=m,e[4]=d,e[5]=n,e[6]=c}else r=e[1],l=e[2],m=e[3],d=e[4],n=e[5],c=e[6];if(n!==Symbol.for("react.early_return_sentinel"))return n;const o=i?.id??null;let a;e[8]!==p||e[9]!==o||e[10]!==c?(a=s.jsx(Ce,{virtualMcps:c,selectedVirtualMcpId:o,onVirtualMcpChange:p}),e[8]=p,e[9]=o,e[10]=c,e[11]=a):a=e[11];let f;e[12]!==r||e[13]!==l||e[14]!==a?(f=s.jsxs("div",{className:r,children:[l,a]}),e[12]=r,e[13]=l,e[14]=a,e[15]=f):f=e[15];let u;return e[16]!==m||e[17]!==d||e[18]!==f?(u=s.jsxs("div",{className:m,children:[d,f]}),e[16]=m,e[17]=d,e[18]=f,e[19]=u):u=e[19],u}function ke(e){return s.jsx(ve,{agent:e},e.id??"default")}function Te(e){return{id:e.id,title:e.title,description:e.description,icon:e.icon}}function ze(e){return e.id!==null&&!ge(e.id)}function Me(){const e=b.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(Y,{className:"h-5 w-40 mb-4"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs("div",{className:"w-full max-w-[800px]",children:[t,s.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-4 md:grid-cols-7 gap-2",children:Array.from({length:7}).map(Ie)})]}),e[1]=i):i=e[1],i}function Ie(e,t){return s.jsxs("div",{className:"flex flex-col items-center gap-3 p-2 self-stretch",children:[s.jsx(Y,{className:"size-6 rounded-md shrink-0"}),s.jsx(Y,{className:"h-4 w-full"})]},t)}function Pe(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(A.Suspense,{fallback:s.jsx(Me,{}),children:s.jsx(we,{})}),e[0]=t):t=e[0],t}function $e(){const e=new Date().getHours();return e>=5&&e<12?"Morning":e>=12&&e<17?"Afternoon":e>=17&&e<22?"Evening":"Night"}function Ve(){const e=b.c(61),{org:t}=ne(),{data:i}=oe.useSession(),{modelsConnections:p,isChatEmpty:r,activeThreadId:l,createThread:m,switchToThread:d,threads:n,selectedVirtualMcp:c}=Z();let o;if(e[0]!==l||e[1]!==n){let x;e[3]!==l?(x=re=>re.id===l,e[3]=l,e[4]=x):x=e[4],o=n.find(x),e[0]=l,e[1]=n,e[2]=o}else o=e[2];const a=o,[f,u]=A.useState(!1);let h;e[5]!==i?.user?.name?(h=i?.user?.name?.split(" ")[0]||"there",e[5]=i?.user?.name,e[6]=h):h=e[6];const j=h;let y;e[7]===Symbol.for("react.memo_cache_sentinel")?(y=$e(),e[7]=y):y=e[7];const le=y;let R;e[8]!==t.id?(R=je(t.id),e[8]=t.id,e[9]=R):R=e[9];const B=c??R;if(p.length===0){let x;return e[10]!==t?(x=s.jsx("div",{className:"flex flex-col size-full bg-background items-center justify-center",children:s.jsx(g.NoLlmBindingEmptyState,{org:t})}),e[10]=t,e[11]=x):x=e[11],x}let N;e[12]!==a?(N=a?.title&&s.jsx(ce,{text:a.title,className:"text-sm font-medium text-foreground"}),e[12]=a,e[13]=N):N=e[13];let _;e[14]!==N?(_=s.jsx(E.Header.Left,{className:"gap-2",children:N}),e[14]=N,e[15]=_):_=e[15];let S;e[16]!==m?(S=()=>m(),e[16]=m,e[17]=S):S=e[17];let L;e[18]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(_e,{size:16}),e[18]=L):L=e[18];let v;e[19]!==r||e[20]!==S?(v=s.jsx(J,{asChild:!0,children:s.jsx(H,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input",onClick:S,disabled:r,"aria-label":"New chat",children:L})}),e[19]=r,e[20]=S,e[21]=v):v=e[21];let O;e[22]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(Q,{children:"New chat"}),e[22]=O):O=e[22];let C;e[23]!==v?(C=s.jsxs(X,{children:[v,O]}),e[23]=v,e[24]=C):C=e[24];let D;e[25]===Symbol.for("react.memo_cache_sentinel")?(D=()=>u(!0),e[25]=D):D=e[25];let F;e[26]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsxs(X,{children:[s.jsx(J,{asChild:!0,children:s.jsx(H,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input",onClick:D,"aria-label":"Chat history",children:s.jsx(me,{size:16})})}),s.jsx(Q,{children:"Chat history"})]}),e[26]=F):F=e[26];let W;e[27]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx(Ne,{size:16}),e[27]=W):W=e[27];let w;e[28]!==r?(w=s.jsx(J,{asChild:!0,children:s.jsx(H,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input",onClick:Ee,disabled:r,"aria-label":"Pin chat",children:W})}),e[28]=r,e[29]=w):w=e[29];let q;e[30]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(Q,{children:"Pin chat"}),e[30]=q):q=e[30];let k;e[31]!==w?(k=s.jsxs(X,{children:[w,q]}),e[31]=w,e[32]=k):k=e[32];let G;e[33]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsx(Se,{size:16}),e[33]=G):G=e[33];let T;e[34]!==r?(T=s.jsx(J,{asChild:!0,children:s.jsx(H,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input",onClick:Ae,disabled:r,"aria-label":"Share chat",children:G})}),e[34]=r,e[35]=T):T=e[35];let K;e[36]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(Q,{children:"Share chat"}),e[36]=K):K=e[36];let z;e[37]!==T?(z=s.jsxs(X,{children:[T,K]}),e[37]=T,e[38]=z):z=e[38];let M;e[39]!==C||e[40]!==k||e[41]!==z?(M=s.jsxs(E.Header.Right,{className:"gap-1",children:[C,F,k,z]}),e[39]=C,e[40]=k,e[41]=z,e[42]=M):M=e[42];let I;e[43]!==M||e[44]!==_?(I=s.jsxs(E.Header,{className:"flex-none z-10 bg-background",children:[_,M]}),e[43]=M,e[44]=_,e[45]=I):I=e[45];let P;e[46]!==B||e[47]!==r||e[48]!==j?(P=r?s.jsxs("div",{className:"flex-1 min-h-0 flex flex-col items-center justify-center px-10 pb-32 pt-10",children:[s.jsxs("div",{className:"flex flex-col items-center gap-3 w-full max-w-[600px]",children:[s.jsx("div",{className:"flex justify-center",children:s.jsx(te,{icon:B.icon,name:B.title,size:"md",fallbackIcon:s.jsx(ie,{size:20}),className:"size-12 rounded-xl border border-stone-200/60 shadow-sm aspect-square transition-opacity duration-200"})}),s.jsxs("div",{className:"text-center",children:[s.jsxs("p",{className:"text-lg font-medium text-foreground",children:[le," ",j,","]}),s.jsx("p",{className:"text-base text-muted-foreground opacity-50 mb-0",children:"What are we building today?"})]}),s.jsx("div",{className:"w-full -mt-1",children:s.jsx(g.Input,{})}),s.jsx(g.IceBreakers,{className:"w-full"})]}),s.jsx("div",{className:"flex flex-col items-center w-full mt-4",children:s.jsx(Pe,{})})]}):s.jsxs(s.Fragment,{children:[s.jsx(g.Main,{children:s.jsx(g.Messages,{})}),s.jsx(g.Footer,{children:s.jsx(g.Input,{})})]}),e[46]=B,e[47]=r,e[48]=j,e[49]=P):P=e[49];let $;e[50]!==d?($=async x=>{await d(x),u(!1)},e[50]=d,e[51]=$):$=e[51];let V;e[52]!==l||e[53]!==f||e[54]!==$||e[55]!==n?(V=s.jsx(de,{open:f,onOpenChange:u,threads:n,activeThreadId:l,onThreadSelect:$}),e[52]=l,e[53]=f,e[54]=$,e[55]=n,e[56]=V):V=e[56];let U;return e[57]!==I||e[58]!==P||e[59]!==V?(U=s.jsxs(g,{className:"bg-background",children:[I,P,V]}),e[57]=I,e[58]=P,e[59]=V,e[60]=U):U=e[60],U}function Ae(){ee.info("Share feature coming soon")}function Ee(){ee.info("Pin feature coming soon")}function He(e){const t=b.c(14),{error:i,onRetry:p}=e,r=i?.message?.includes("401")||i?.message?.toLowerCase().includes("unauthorized");let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs(E.Header,{className:"flex-none",children:[s.jsx(E.Header.Left,{className:"gap-2"}),s.jsx(E.Header.Right,{className:"gap-1"})]}),t[0]=l):l=t[0];let m;t[1]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"bg-destructive/10 p-3 rounded-full mx-auto w-fit",children:s.jsx(fe,{className:"h-6 w-6 text-destructive"})}),t[1]=m):m=t[1];const d=r?"Unable to load models":"Something went wrong";let n;t[2]!==d?(n=s.jsx("h3",{className:"text-lg font-medium",children:d}),t[2]=d,t[3]=n):n=t[3];const c=r?"There was an authentication error while loading the models. This might be due to an expired session or invalid API key.":i?.message||"An unexpected error occurred";let o;t[4]!==c?(o=s.jsx("p",{className:"text-sm text-muted-foreground",children:c}),t[4]=c,t[5]=o):o=t[5];let a;t[6]!==n||t[7]!==o?(a=s.jsxs("div",{className:"space-y-2",children:[n,o]}),t[6]=n,t[7]=o,t[8]=a):a=t[8];let f;t[9]!==p?(f=s.jsx(H,{variant:"outline",onClick:p,children:"Try again"}),t[9]=p,t[10]=f):f=t[10];let u;return t[11]!==a||t[12]!==f?(u=s.jsxs(g,{className:"bg-background",children:[l,s.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center",children:s.jsxs("div",{className:"max-w-sm space-y-4",children:[m,a,f]})})]}),t[11]=a,t[12]=f,t[13]=u):u=t[13],u}function Wt(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(ue,{fallback:Re,children:s.jsx(A.Suspense,{fallback:s.jsx(g.Skeleton,{className:"bg-background"}),children:s.jsx(Ve,{})})}),e[0]=t):t=e[0],t}function Re(e){const{error:t,resetError:i}=e;return s.jsx(He,{error:t,onRetry:i})}export{Wt as default};
@@ -1 +1 @@
1
- import{c as J,r as U,u as se,K as ne,by as we,j as t,m as me,O as de,g as Te,bz as Ie,bA as le,l as Re}from"./index-B29giag9.js";import{P as Z}from"./index-CwR6GYR2.js";import{B as Pe,a as ze,b as ke,c as $e}from"./breadcrumb-ClGbT9Pe.js";import{i as ue,E as Le}from"./error-boundary-8guJh7VT.js";import{i as fe}from"./FilterLines-DNMtf_47.js";import{n as xe}from"./Inbox01-_QG6HIJd.js";import{i as te}from"./Loading01-C30bDA9h.js";import{s as ge}from"./RefreshCw01-Bb8t9XLS.js";import{i as pe}from"./SearchMd-hERLZOdx.js";import{u as he}from"./useQuery-BO0TdkAU.js";import{u as Fe}from"./useInfiniteQuery-eF9xXIkq.js";import{a as Ee,f as _e,b as Ae}from"./registry-utils-6Y4tQn0C.js";import{u as je,W as Ke,a as Me,h as Oe,b as Be}from"./constants-CH9byiKA.js";import{f as De,g as ye,h as Ge}from"./use-connection-DrWeJHXu.js";import{s as We}from"./slugify-CEUa2lfQ.js";import{C as Ve}from"./collection-search-CFO7XWxi.js";import{M as ae}from"./mcp-server-card-DBYZ33HR.js";import{c as oe,B as Y}from"./button-D-PerQqC.js";import{I as qe}from"./input-Cxci79To.js";import{b as ve,P as be,a as Ne}from"./popover-Bq8aZ27v.js";import{i as Ce}from"./Check-DVZrDl7E.js";import{t as Se}from"./ChevronDown-BrnUqul2.js";import{s as ee}from"./XClose-B9jvydA5.js";import{s as Ue}from"./Plus-q5YWe4us.js";import{E as He}from"./empty-state-DoBcZdM-.js";import{u as Je}from"./use-binding-B7W2mOcc.js";import{L as Qe,u as Ye}from"./localstorage-keys-CwGoMvvj.js";import"./ChevronRight-lTpPQGwH.js";import"./infiniteQueryObserver-Dzcc9UjY.js";import"./useMutation-WNJB1RXH.js";import"./tooltip-D-FT-fCa.js";import"./index-V777tuW4.js";import"./Terminal-VY7qOx_i.js";import"./Lock01-CMTkVFHx.js";import"./card-ZafkYtyj.js";import"./integration-icon-ByKWru2D.js";import"./Container-CMQiv6Ns.js";import"./github-icon-Dp3wHhYE.js";import"./binder-BeHB3-7Y.js";function Ze(s,e){const r=J.c(4),[n,a]=U.useState(s),l=U.useRef(null),u=U.useRef(!0);let o,c;return r[0]!==e||r[1]!==s?(o=()=>{if(u.current){u.current=!1;return}return l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{a(s)},e),()=>{l.current&&clearTimeout(l.current)}},c=[s,e],r[0]=e,r[1]=s,r[2]=o,r[3]=c):(o=r[2],c=r[3]),U.useEffect(o,c),n}function Xe(s){const e=J.c(14),r=U.useRef(null),n=`scroll-position:${s}`,a=U.useRef(null);let l;e[0]!==n?(l=()=>{r.current&&sessionStorage.setItem(n,String(r.current.scrollTop))},e[0]=n,e[1]=l):l=e[1];const u=l;let o;e[2]!==n?(o=()=>{if(a.current===n)return;const h=sessionStorage.getItem(n);if(h&&r.current){const C=Number.parseInt(h,10);r.current.scrollTop=C}a.current=n},e[2]=n,e[3]=o):o=e[3];const c=o;let y;e[4]!==c||e[5]!==n?(y=()=>{a.current!==n&&c()},e[4]=c,e[5]=n,e[6]=y):y=e[6];const N=y;let i;e[7]!==c||e[8]!==n?(i=h=>{r.current=h,h&&a.current!==n&&requestAnimationFrame(()=>{c()})},e[7]=c,e[8]=n,e[9]=i):i=e[9];const g=i;let m;return e[10]!==N||e[11]!==u||e[12]!==g?(m={scrollRef:g,saveScrollPosition:u,handleScroll:N},e[10]=N,e[11]=u,e[12]=g,e[13]=m):m=e[13],m}const et=24;function tt(s){const e=J.c(54),{registryId:r,listToolName:n,filtersToolName:a,search:l}=s,{org:u}=se();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],e[0]=o):o=e[0];const[c,y]=U.useState(o);let N;e[1]===Symbol.for("react.memo_cache_sentinel")?(N=[],e[1]=N):N=e[1];const[i,g]=U.useState(N),m=r||null;let h;e[2]!==u.id||e[3]!==m?(h={connectionId:m,orgId:u.id},e[2]=u.id,e[3]=m,e[4]=h):h=e[4];const C=je(h),R=!!a;let v;e[5]!==a||e[6]!==r?(v=ne.toolCall(r,a||"no-filters","{}"),e[5]=a,e[6]=r,e[7]=v):v=e[7];let T;e[8]!==C||e[9]!==a?(T=async()=>{if(!a)return{tags:[],categories:[]};const D=await C.callTool({name:a,arguments:{}});return D.structuredContent??D},e[8]=C,e[9]=a,e[10]=T):T=e[10];let I;e[11]!==v||e[12]!==T?(I={queryKey:v,queryFn:T,staleTime:36e5,retry:2},e[11]=v,e[12]=T,e[13]=I):I=e[13];const{data:k}=he(I);let p,S,P;if(e[14]!==n||e[15]!==r||e[16]!==l||e[17]!==i||e[18]!==c){const D=l?.trim()?{operator:"or",conditions:[{field:["name"],operator:"contains",value:l},{field:["title"],operator:"contains",value:l},{field:["description"],operator:"contains",value:l}]}:void 0;p={limit:et,...c.length>0&&{tags:c},...i.length>0&&{categories:i},...D&&{where:D}},P=Fe,S=ne.toolCall(r,n,JSON.stringify(p)),e[14]=n,e[15]=r,e[16]=l,e[17]=i,e[18]=c,e[19]=p,e[20]=S,e[21]=P}else p=e[19],S=e[20],P=e[21];let j;e[22]!==C||e[23]!==p||e[24]!==n?(j=async D=>{const{pageParam:X}=D,re=X?{...p,cursor:X}:p,ie=await C.callTool({name:n,arguments:re});return ie.structuredContent??ie},e[22]=C,e[23]=p,e[24]=n,e[25]=j):j=e[25];let L;e[26]!==j||e[27]!==S?(L={queryKey:S,queryFn:j,initialPageParam:void 0,getNextPageParam:st,staleTime:36e5,placeholderData:we,retry:2},e[26]=j,e[27]=S,e[28]=L):L=e[28];const{data:w,fetchNextPage:x,hasNextPage:d,isFetchingNextPage:f,isFetching:$,isLoading:z,error:_}=P(L);let F;e:{if(!w?.pages||w.pages.length===0){F=null;break e}const D=w.pages[0];if(typeof D=="object"&&D!==null&&"totalCount"in D&&typeof D.totalCount=="number"){F=D.totalCount;break e}F=null}const A=F,E=w?.pages;let V;e[29]!==E?(V=Ee(E),e[29]=E,e[30]=V):V=e[30];const q=V;let G;e[31]!==l||e[32]!==i.length||e[33]!==c.length?(G=c.length>0||i.length>0||!!l?.trim(),e[31]=l,e[32]=i.length,e[33]=c.length,e[34]=G):G=e[34];const K=G,B=$&&!f&&!z&&K;let W;e[35]!==x||e[36]!==d||e[37]!==f?(W=()=>{d&&!f&&x()},e[35]=x,e[36]=d,e[37]=f,e[38]=W):W=e[38];const M=W,O=d??!1,H=R?k?.tags:void 0,Q=R?k?.categories:void 0;let b;return e[39]!==K||e[40]!==$||e[41]!==f||e[42]!==B||e[43]!==z||e[44]!==q||e[45]!==_||e[46]!==M||e[47]!==i||e[48]!==c||e[49]!==O||e[50]!==H||e[51]!==Q||e[52]!==A?(b={items:q,totalCount:A,hasMore:O,isLoadingMore:f,isFiltering:B,isInitialLoading:z,isFetching:$,error:_,loadMore:M,availableTags:H,availableCategories:Q,selectedTags:c,selectedCategories:i,setSelectedTags:y,setSelectedCategories:g,hasActiveFilters:K},e[39]=K,e[40]=$,e[41]=f,e[42]=B,e[43]=z,e[44]=q,e[45]=_,e[46]=M,e[47]=i,e[48]=c,e[49]=O,e[50]=H,e[51]=Q,e[52]=A,e[53]=b):b=e[53],b}function st(s){if(typeof s=="object"&&s!==null){const e=s.nextCursor||s.cursor;if(e)return e}}function rt(s,e){return[...s].sort((r,n)=>n.count-r.count).slice(0,e)}function ce(s){const e=J.c(52),{label:r,items:n,selectedItems:a,onToggle:l,onClear:u}=s,[o,c]=U.useState(""),[y,N]=U.useState(!1);let i,g,m,h,C,R,v,T,I,k,p;if(e[0]!==n||e[1]!==r||e[2]!==l||e[3]!==y||e[4]!==o||e[5]!==a){const x=[...o?n.filter(E=>E.value.toLowerCase().includes(o.toLowerCase())):n].sort(lt);m=a.length,g=ve,I=y,k=N;let d;e[17]!==r?(d=t.jsx("span",{children:r}),e[17]=r,e[18]=d):d=e[18];let f;e[19]!==m?(f=m>0&&t.jsx("span",{className:"ml-1 rounded-full bg-primary text-primary-foreground px-1.5 py-0.5 text-[10px] font-medium",children:m}),e[19]=m,e[20]=f):f=e[20];let $;e[21]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(Se,{size:14,className:"opacity-50"}),e[21]=$):$=e[21],e[22]!==f||e[23]!==d?(p=t.jsx(be,{asChild:!0,children:t.jsxs(Y,{variant:"outline",size:"sm",className:"h-7 px-3 gap-1.5 text-xs font-normal flex-1",children:[d,f,$]})}),e[22]=f,e[23]=d,e[24]=p):p=e[24],i=Ne,R="w-64 p-0",v="start";let z;e[25]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(pe,{size:16,className:"text-muted-foreground shrink-0"}),e[25]=z):z=e[25];let _;e[26]!==r?(_=r.toLowerCase(),e[26]=r,e[27]=_):_=e[27];const F=`Search ${_}...`;let A;e[28]===Symbol.for("react.memo_cache_sentinel")?(A=E=>c(E.target.value),e[28]=A):A=e[28],e[29]!==o||e[30]!==F?(T=t.jsx("div",{className:"shrink-0 w-full border-b border-border h-10",children:t.jsxs("label",{className:"flex items-center gap-2.5 h-10 px-4 cursor-text",children:[z,t.jsx(qe,{type:"text",placeholder:F,value:o,onChange:A,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]})}),e[29]=o,e[30]=F,e[31]=T):T=e[31],h="max-h-64 overflow-y-auto p-1 flex flex-col gap-1",C=x.length===0?t.jsx("div",{className:"px-2 py-4 text-sm text-muted-foreground text-center",children:"No results found"}):x.map(E=>{const V=a.includes(E.value);return t.jsxs("button",{onClick:()=>l(E.value),className:oe("w-full flex items-center justify-between px-2 py-1.5 text-sm rounded cursor-pointer transition-colors",V?"bg-accent/50 text-foreground":"hover:bg-muted text-foreground"),children:[t.jsxs("span",{className:"truncate flex items-center gap-2",children:[V&&t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0"}),E.value]}),t.jsx("span",{className:"text-xs text-muted-foreground ml-2 shrink-0",children:E.count})]},E.value)}),e[0]=n,e[1]=r,e[2]=l,e[3]=y,e[4]=o,e[5]=a,e[6]=i,e[7]=g,e[8]=m,e[9]=h,e[10]=C,e[11]=R,e[12]=v,e[13]=T,e[14]=I,e[15]=k,e[16]=p}else i=e[6],g=e[7],m=e[8],h=e[9],C=e[10],R=e[11],v=e[12],T=e[13],I=e[14],k=e[15],p=e[16];let S;e[32]!==h||e[33]!==C?(S=t.jsx("div",{className:h,children:C}),e[32]=h,e[33]=C,e[34]=S):S=e[34];let P;e[35]!==r||e[36]!==u||e[37]!==m?(P=m>0&&t.jsx("div",{className:"p-2 border-t border-border",children:t.jsxs(Y,{variant:"ghost",size:"sm",onClick:u,className:"w-full text-xs text-muted-foreground hover:text-foreground",children:["Clear ",r.toLowerCase()]})}),e[35]=r,e[36]=u,e[37]=m,e[38]=P):P=e[38];let j;e[39]!==i||e[40]!==P||e[41]!==R||e[42]!==v||e[43]!==T||e[44]!==S?(j=t.jsxs(i,{className:R,align:v,children:[T,S,P]}),e[39]=i,e[40]=P,e[41]=R,e[42]=v,e[43]=T,e[44]=S,e[45]=j):j=e[45];let L;return e[46]!==g||e[47]!==j||e[48]!==I||e[49]!==k||e[50]!==p?(L=t.jsxs(g,{open:I,onOpenChange:k,children:[p,j]}),e[46]=g,e[47]=j,e[48]=I,e[49]=k,e[50]=p,e[51]=L):L=e[51],L}function lt(s,e){return e.count-s.count}function nt(s){const e=J.c(67),{availableTags:r,availableCategories:n,selectedTags:a,selectedCategories:l,onTagChange:u,onCategoryChange:o}=s,c=r&&r.length>0||n&&n.length>0,y=a.length>0||l.length>0;if(!c)return null;let N;e[0]!==u||e[1]!==a?(N=d=>{a.includes(d)?u(a.filter(f=>f!==d)):u([...a,d])},e[0]=u,e[1]=a,e[2]=N):N=e[2];const i=N;let g;e[3]!==o||e[4]!==l?(g=d=>{l.includes(d)?o(l.filter(f=>f!==d)):o([...l,d])},e[3]=o,e[4]=l,e[5]=g):g=e[5];const m=g;let h;e[6]!==o||e[7]!==u?(h=()=>{u([]),o([])},e[6]=o,e[7]=u,e[8]=h):h=e[8];const C=h;let R,v,T,I,k,p,S;if(e[9]!==n||e[10]!==r||e[11]!==o||e[12]!==u||e[13]!==l||e[14]!==a||e[15]!==m||e[16]!==i){const d=n?rt(n,6):[];R=l,v=a,S=new Set(d.map(ot)),k="flex items-center border-b border-border";let f;e[24]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("div",{className:"flex items-center gap-2 text-muted-foreground",children:t.jsx(fe,{size:16})}),e[24]=f):f=e[24];let $;e[25]!==n||e[26]!==o||e[27]!==l||e[28]!==m?($=n&&n.length>0&&t.jsx(ce,{label:"Categories",items:n,selectedItems:l,onToggle:m,onClear:()=>o([])}),e[25]=n,e[26]=o,e[27]=l,e[28]=m,e[29]=$):$=e[29];let z;e[30]!==r||e[31]!==u||e[32]!==a||e[33]!==i?(z=r&&r.length>0&&t.jsx(ce,{label:"Tags",items:r,selectedItems:a,onToggle:i,onClear:()=>u([])}),e[30]=r,e[31]=u,e[32]=a,e[33]=i,e[34]=z):z=e[34],e[35]!==z||e[36]!==$?(p=t.jsxs("div",{className:"flex items-center gap-3 flex-wrap px-5 py-3 border-r border-border",children:[f,$,z]}),e[35]=z,e[36]=$,e[37]=p):p=e[37],T="flex items-center gap-3 flex-wrap px-5 py-3";let _;e[38]!==l||e[39]!==m?(_=F=>{const A=l.includes(F.value);return t.jsxs("div",{onClick:()=>m(F.value),className:oe("inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer",A?"bg-primary text-primary-foreground hover:bg-primary/80":"bg-muted hover:bg-accent text-muted-foreground"),children:[t.jsx("span",{children:F.value}),A&&t.jsx("span",{onClick:E=>{E.stopPropagation(),m(F.value)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:t.jsx(ee,{size:12})})]},F.value)},e[38]=l,e[39]=m,e[40]=_):_=e[40],I=d.map(_),e[9]=n,e[10]=r,e[11]=o,e[12]=u,e[13]=l,e[14]=a,e[15]=m,e[16]=i,e[17]=R,e[18]=v,e[19]=T,e[20]=I,e[21]=k,e[22]=p,e[23]=S}else R=e[17],v=e[18],T=e[19],I=e[20],k=e[21],p=e[22],S=e[23];let P;if(e[41]!==R||e[42]!==m||e[43]!==S){let d;e[45]!==S?(d=$=>!S.has($),e[45]=S,e[46]=d):d=e[46];let f;e[47]!==m?(f=$=>t.jsxs("div",{onClick:()=>m($),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[t.jsx("span",{children:$}),t.jsx("span",{onClick:z=>{z.stopPropagation(),m($)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:t.jsx(ee,{size:12})})]},`cat-${$}`),e[47]=m,e[48]=f):f=e[48],P=R.filter(d).map(f),e[41]=R,e[42]=m,e[43]=S,e[44]=P}else P=e[44];let j;if(e[49]!==v||e[50]!==i){let d;e[52]!==i?(d=f=>t.jsxs("div",{onClick:()=>i(f),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[t.jsx("span",{children:f}),t.jsx("span",{onClick:$=>{$.stopPropagation(),i(f)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:t.jsx(ee,{size:12})})]},`tag-${f}`),e[52]=i,e[53]=d):d=e[53],j=v.map(d),e[49]=v,e[50]=i,e[51]=j}else j=e[51];let L;e[54]!==C||e[55]!==y?(L=y&&t.jsxs(Y,{variant:"ghost",size:"sm",onClick:C,className:"h-7 text-xs text-muted-foreground hover:text-foreground gap-1 px-2",children:[t.jsx(ee,{size:14}),"Clear all"]}),e[54]=C,e[55]=y,e[56]=L):L=e[56];let w;e[57]!==L||e[58]!==T||e[59]!==I||e[60]!==P||e[61]!==j?(w=t.jsxs("div",{className:T,children:[I,P,j,L]}),e[57]=L,e[58]=T,e[59]=I,e[60]=P,e[61]=j,e[62]=w):w=e[62];let x;return e[63]!==w||e[64]!==k||e[65]!==p?(x=t.jsxs("div",{className:k,children:[p,w]}),e[63]=w,e[64]=k,e[65]=p,e[66]=x):x=e[66],x}function ot(s){return s.value}function it(s,e){if(!e)return s;const r=e.toLowerCase();return s.filter(n=>(n.name||n.title||"").toLowerCase().includes(r)||(n.description||n.server?.description||"").toLowerCase().includes(r))}function at(s){return s.verified===!0||s._meta?.["mcp.mesh"]?.verified===!0}function ct(s){const e=J.c(55),{registryId:r,listToolName:n,filtersToolName:a}=s,[l,u]=U.useState(""),o=Ze(l,300),c=me(),{org:y}=se(),{scrollRef:N,saveScrollPosition:i,handleScroll:g}=Xe(`store-discovery:${r}`);let m;e[0]!==o||e[1]!==a||e[2]!==n||e[3]!==r?(m={registryId:r,listToolName:n,filtersToolName:a,search:o},e[0]=o,e[1]=a,e[2]=n,e[3]=r,e[4]=m):m=e[4];const{items:h,hasMore:C,isLoadingMore:R,isInitialLoading:v,isFetching:T,error:I,loadMore:k,availableTags:p,availableCategories:S,selectedTags:P,selectedCategories:j,setSelectedTags:L,setSelectedCategories:w,hasActiveFilters:x}=tt(m);let d,f,$,z;e[5]!==o||e[6]!==T||e[7]!==v||e[8]!==h||e[9]!==l?(d=l?it(h,l):h,f=(l!==o||T)&&!v&&!!l,z=d.filter(at),$=d.filter(M=>!z.find(O=>O.id===M.id)),e[5]=o,e[6]=T,e[7]=v,e[8]=h,e[9]=l,e[10]=d,e[11]=f,e[12]=$,e[13]=z):(d=e[10],f=e[11],$=e[12],z=e[13]);const _=$;let F;e[14]!==c||e[15]!==y.slug||e[16]!==r||e[17]!==i?(F=M=>{i();const O=We(M.name||M.title||M.server?.title||""),H=M.server?.name||M.id;c({to:"/$org/$project/store/$appName",params:{org:y.slug,project:de,appName:O},search:{registryId:r,serverName:H}})},e[14]=c,e[15]=y.slug,e[16]=r,e[17]=i,e[18]=F):F=e[18];const A=F;let E;e[19]!==g||e[20]!==C||e[21]!==R||e[22]!==k?(E=M=>{if(g(),!C||R)return;const O=M.currentTarget;O.scrollHeight-O.scrollTop-O.clientHeight<200&&k()},e[19]=g,e[20]=C,e[21]=R,e[22]=k,e[23]=E):E=e[23];const V=E;let q;e[24]!==f||e[25]!==l?(q=t.jsx(Ve,{value:l,onChange:u,placeholder:"Search for an MCP Server...",isSearching:f}),e[24]=f,e[25]=l,e[26]=q):q=e[26];let G;e[27]!==S||e[28]!==p||e[29]!==j||e[30]!==P||e[31]!==w||e[32]!==L?(G=t.jsx(nt,{availableTags:p,availableCategories:S,selectedTags:P,selectedCategories:j,onTagChange:L,onCategoryChange:w}),e[27]=S,e[28]=p,e[29]=j,e[30]=P,e[31]=w,e[32]=L,e[33]=G):G=e[33];let K;e[34]!==_||e[35]!==I||e[36]!==d||e[37]!==A||e[38]!==x||e[39]!==C||e[40]!==v||e[41]!==R||e[42]!==f||e[43]!==h||e[44]!==l||e[45]!==z?(K=t.jsx("div",{className:"p-5",children:t.jsx("div",{children:I&&!v?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(ue,{className:"size-8 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Registry unavailable"}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:"Could not load items from this registry. It may be temporarily offline."}),I.message&&t.jsx("p",{className:"text-xs text-muted-foreground/60 font-mono max-w-md mx-auto truncate",children:I.message})]}),t.jsxs(Y,{variant:"outline",size:"sm",onClick:mt,children:[t.jsx(ge,{className:"size-4"}),"Try again"]})]}):v?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(te,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading items..."})]}):h.length===0&&!x?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(xe,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No items available"}),t.jsx("p",{className:"text-muted-foreground",children:"This store doesn't have any available items yet."})]}):h.length===0&&x&&!l?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(fe,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No matching items"}),t.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your filters to find more results."})]}):l&&d.length===0&&!f?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(pe,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No results found"}),t.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your search terms."})]}):t.jsxs("div",{className:"flex flex-col gap-8",children:[f&&d.length===0&&t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(te,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Searching..."})]}),z.length>0&&t.jsx(ae,{items:z,title:"Verified",onItemClick:A}),_.length>0&&t.jsx(ae,{items:_,title:z.length>0?"All":"",onItemClick:A}),C&&R&&t.jsx("div",{className:"flex justify-center py-8",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx(te,{size:20,className:"animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading more items..."})]})})]})})}),e[34]=_,e[35]=I,e[36]=d,e[37]=A,e[38]=x,e[39]=C,e[40]=v,e[41]=R,e[42]=f,e[43]=h,e[44]=l,e[45]=z,e[46]=K):K=e[46];let B;e[47]!==V||e[48]!==N||e[49]!==K?(B=t.jsx("div",{ref:N,className:"flex-1 overflow-y-auto",onScroll:V,children:K}),e[47]=V,e[48]=N,e[49]=K,e[50]=B):B=e[50];let W;return e[51]!==q||e[52]!==G||e[53]!==B?(W=t.jsxs("div",{className:"flex flex-col h-full",children:[q,G,B]}),e[51]=q,e[52]=G,e[53]=B,e[54]=W):W=e[54],W}function mt(){return window.location.reload()}function dt(s){const e=J.c(10),{registryId:r}=s,n=De(r),a=n?.tools;let l;e[0]!==a?(l=_e(a),e[0]=a,e[1]=l):l=e[1];const u=l;if(!u){let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"bg-muted p-3 rounded-full",children:t.jsx(xe,{className:"size-8 text-muted-foreground"})}),e[2]=g):g=e[2];let m;return e[3]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-12 text-center space-y-4",children:[g,t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Registry not available"}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:"This registry does not support listing store items, or the connection is not responding."})]})]}),e[3]=m):m=e[3],m}const o=n?.tools;let c;e[4]!==o?(c=Ae(o),e[4]=o,e[5]=c):c=e[5];const N=c||void 0;let i;return e[6]!==u||e[7]!==r||e[8]!==N?(i=t.jsx(ct,{registryId:r,listToolName:u,filtersToolName:N}),e[6]=u,e[7]=r,e[8]=N,e[9]=i):i=e[9],i}function ut(s){const e=J.c(43),{registries:r,value:n,onValueChange:a,onAddWellKnown:l,wellKnownRegistries:u,placeholder:o}=s,c=o===void 0?"Select a registry...":o,[y,N]=U.useState(!1);let i,g,m,h,C,R,v,T;if(e[0]!==y||e[1]!==c||e[2]!==r||e[3]!==n){let w;e[12]!==n?(w=d=>d.id===n,e[12]=n,e[13]=w):w=e[13];const x=r.find(w);g=ve,v=y,T=N,i=be,R=!0,m="button",e[14]===Symbol.for("react.memo_cache_sentinel")?(h=oe("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg border bg-transparent px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] h-7 min-w-[160px]"),e[14]=h):h=e[14],C=x?t.jsxs("span",{className:"flex items-center gap-2",children:[x.icon?t.jsx("img",{src:x.icon,alt:x.name,className:"w-4 h-4 rounded"}):t.jsx("span",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:x.name.slice(0,1).toUpperCase()}),t.jsx("span",{children:x.name})]}):t.jsx("span",{className:"text-muted-foreground",children:c}),e[0]=y,e[1]=c,e[2]=r,e[3]=n,e[4]=i,e[5]=g,e[6]=m,e[7]=h,e[8]=C,e[9]=R,e[10]=v,e[11]=T}else i=e[4],g=e[5],m=e[6],h=e[7],C=e[8],R=e[9],v=e[10],T=e[11];let I;e[15]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(Se,{className:"size-4 opacity-50"}),e[15]=I):I=e[15];let k;e[16]!==m||e[17]!==h||e[18]!==C?(k=t.jsxs("button",{type:m,className:h,children:[C,I]}),e[16]=m,e[17]=h,e[18]=C,e[19]=k):k=e[19];let p;e[20]!==i||e[21]!==R||e[22]!==k?(p=t.jsx(i,{asChild:R,children:k}),e[20]=i,e[21]=R,e[22]=k,e[23]=p):p=e[23];let S;if(e[24]!==a||e[25]!==r||e[26]!==n){let w;e[28]!==a||e[29]!==n?(w=x=>t.jsxs("button",{type:"button",onClick:()=>{a(x.id??x.name),N(!1)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[x.icon?t.jsx("img",{src:x.icon,alt:x.name,className:"w-4 h-4 rounded"}):t.jsx("span",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:x.name.slice(0,1).toUpperCase()}),t.jsx("span",{children:x.name})]}),n===(x.id??x.name)&&t.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:t.jsx(Ce,{className:"size-4"})})]},x.id??x.name),e[28]=a,e[29]=n,e[30]=w):w=e[30],S=r.map(w),e[24]=a,e[25]=r,e[26]=n,e[27]=S}else S=e[27];let P;e[31]!==l||e[32]!==u?(P=u.length>0&&t.jsxs("div",{className:"border-t border-border pt-1 mt-1",children:[t.jsx("p",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Other known registries"}),u.map(w=>t.jsxs("button",{type:"button",onClick:()=>{l(w),N(!1)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[w.icon?t.jsx("img",{src:w.icon,alt:w.title,className:"w-4 h-4 rounded"}):t.jsx("span",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:w.title.slice(0,1).toUpperCase()}),t.jsx("span",{className:"flex-1",children:w.title})]}),t.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center text-muted-foreground",children:t.jsx(Ue,{size:16})})]},w.id??w.title))]}),e[31]=l,e[32]=u,e[33]=P):P=e[33];let j;e[34]!==S||e[35]!==P?(j=t.jsxs(Ne,{align:"end",className:"w-auto min-w-[200px] p-1",children:[S,P]}),e[34]=S,e[35]=P,e[36]=j):j=e[36];let L;return e[37]!==g||e[38]!==p||e[39]!==j||e[40]!==v||e[41]!==T?(L=t.jsxs(g,{open:v,onOpenChange:T,children:[p,j]}),e[37]=g,e[38]=p,e[39]=j,e[40]=v,e[41]=T,e[42]=L):L=e[42],L}function ft({registries:s,onConnected:e}){const r=ye(),{org:{slug:n}}=se(),{data:a}=Te.useSession(),l=me(),[u,o]=U.useState(!1),c=s[0],y=async()=>{if(!(!c||!a?.user?.id)){o(!0);try{const i=await r.create.mutateAsync(c);e?.(i.id)}finally{o(!1)}}},N=()=>{l({to:"/$org/$project/mcps",params:{org:n,project:de},search:{action:"create"}})};return t.jsx(He,{image:t.jsx("img",{src:"/store-empty-state.svg",alt:"No store connected",width:336,height:320,className:"max-w-full h-auto"}),title:"Connect to registry",description:"Connect to discover and use Connections from the community.",actions:t.jsxs(t.Fragment,{children:[t.jsxs(Y,{variant:"outline",onClick:y,disabled:u||!c,children:[c?.icon&&t.jsx("img",{src:c.icon,alt:"",className:"size-4"}),u?"Installing...":"Install Registry"]}),t.jsx(Y,{variant:"outline",onClick:N,children:"Custom Connection"})]})})}function xt(s){const e=J.c(15),{error:r,onRetry:n,registryName:a}=s;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(ue,{className:"h-6 w-6 text-destructive"})}),e[0]=l):l=e[0];let u;e[1]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("h3",{className:"text-lg font-medium",children:"Unable to load store"}),e[1]=u):u=e[1];let o;e[2]!==a?(o=t.jsxs("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:["The ",t.jsx("strong",{children:a})," registry is currently unreachable. This may be a temporary issue — try again in a moment."]}),e[2]=a,e[3]=o):o=e[3];let c;e[4]!==r?(c=r?.message&&t.jsx("p",{className:"text-xs text-muted-foreground/60 font-mono max-w-md mx-auto truncate",children:r.message}),e[4]=r,e[5]=c):c=e[5];let y;e[6]!==o||e[7]!==c?(y=t.jsxs("div",{className:"space-y-2",children:[u,o,c]}),e[6]=o,e[7]=c,e[8]=y):y=e[8];let N;e[9]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(ge,{className:"size-4"}),e[9]=N):N=e[9];let i;e[10]!==n?(i=t.jsxs(Y,{variant:"outline",size:"sm",onClick:n,children:[N,"Try again"]}),e[10]=n,e[11]=i):i=e[11];let g;return e[12]!==y||e[13]!==i?(g=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[l,y,i]}),e[12]=y,e[13]=i,e[14]=g):g=e[14],g}function ss(){const s=J.c(48),{org:e,project:r}=se(),n=Ge(),a=ye(),l=Ie(),u=l.location.pathname.includes("/store/")&&l.location.pathname.split("/").length>3,o=Je(n);let c;s[0]!==e.id?(c=Ke.SELF(e.id),s[0]=e.id,s[1]=c):c=s[1];const y=c,N=r.enabledPlugins,i=N==null||N.includes(le),g=o.filter(b=>b.id!==y?!0:i);let m;s[2]!==y?(m=b=>b.id===y,s[2]=y,s[3]=m):m=s[3];const h=g.some(m);let C;s[4]!==e.id?(C={connectionId:Me,orgId:e.id},s[4]=e.id,s[5]=C):C=s[5];const R=je(C);let v;s[6]!==r.id||s[7]!==R?(v=async()=>{const b=await R.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:r.id,pluginId:le}});return b.structuredContent??b},s[6]=r.id,s[7]=R,s[8]=v):v=s[8];const{data:T}=he({queryKey:ne.projectPluginConfig(r.id??"",le),queryFn:v,enabled:h&&!!r.id,staleTime:6e4}),I=T?.config?.settings;let k;s[9]!==I||s[10]!==y?(k=b=>b.id===y&&I?{id:b.id,name:I.registryName||b.title,icon:I.registryIcon||b.icon||void 0}:{id:b.id,name:b.title,icon:b.icon||void 0},s[9]=I,s[10]=y,s[11]=k):k=s[11];const p=g.map(k);let S;s[12]!==e.slug?(S=Qe.selectedRegistry(e.slug),s[12]=e.slug,s[13]=S):S=s[13];const[P,j]=Ye(S,pt);let L;s[14]!==P?(L=b=>b.id===P,s[14]=P,s[15]=L):L=s[15];const x=g.find(L)?.id||g[0]?.id||"";let d;s[16]!==e.id?(d=Oe(e.id),s[16]=e.id,s[17]=d):d=s[17];let f;s[18]!==d?(f=[d],s[18]=d,s[19]=f):f=s[19];const $=f;let z;s[20]===Symbol.for("react.memo_cache_sentinel")?(z=[Be()],s[20]=z):z=s[20];const _=z;let F;s[21]!==a.create||s[22]!==j?(F=async b=>{const D=await a.create.mutateAsync(b);j(D.id)},s[21]=a.create,s[22]=j,s[23]=F):F=s[23];const A=F,E=new Set(g.map(gt)),V=$.filter(b=>b.id&&!E.has(b.id)),q=_.filter(b=>b.id&&!E.has(b.id));if(u){let b;return s[24]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Re,{}),s[24]=b):b=s[24],b}let G;s[25]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(Z.Header.Left,{children:t.jsx(Pe,{children:t.jsx(ze,{children:t.jsx(ke,{children:t.jsx($e,{children:"Store"})})})})}),s[25]=G):G=s[25];let K;s[26]!==A?(K=async b=>A(b),s[26]=A,s[27]=K):K=s[27];let B;s[28]!==V||s[29]!==x||s[30]!==p||s[31]!==j||s[32]!==K?(B=t.jsxs(Z.Header,{children:[G,t.jsx(Z.Header.Right,{children:t.jsx(ut,{wellKnownRegistries:V,registries:p,value:x,onValueChange:j,onAddWellKnown:K,placeholder:"Select store..."})})]}),s[28]=V,s[29]=x,s[30]=p,s[31]=j,s[32]=K,s[33]=B):B=s[33];let W;s[34]!==x||s[35]!==p?(W=b=>{const{error:D,resetError:X}=b;return t.jsx(xt,{error:D,onRetry:X,registryName:p.find(re=>re.id===x)?.name??"registry"})},s[34]=x,s[35]=p,s[36]=W):W=s[36];let M;s[37]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[t.jsx(te,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading store items..."})]}),s[37]=M):M=s[37];let O;s[38]!==q||s[39]!==x||s[40]!==j?(O=t.jsx(U.Suspense,{fallback:M,children:x?t.jsx(dt,{registryId:x}):t.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:t.jsx(ft,{registries:q,onConnected:b=>{j(b)}})})}),s[38]=q,s[39]=x,s[40]=j,s[41]=O):O=s[41];let H;s[42]!==W||s[43]!==O?(H=t.jsx(Z.Content,{children:t.jsx(Le,{fallback:W,children:O})}),s[42]=W,s[43]=O,s[44]=H):H=s[44];let Q;return s[45]!==B||s[46]!==H?(Q=t.jsxs(Z,{children:[B,H]}),s[45]=B,s[46]=H,s[47]=Q):Q=s[47],Q}function gt(s){return s.id}function pt(s){return s??""}export{ss as default};
1
+ import{c as J,r as U,u as se,K as ne,bx as we,j as t,m as me,O as de,g as Te,by as Ie,bz as le,l as Re}from"./index-B0lAKtRh.js";import{P as Z}from"./index-C4SaT72q.js";import{B as Pe,a as ze,b as ke,c as $e}from"./breadcrumb-DTOs2A-I.js";import{i as ue,E as Le}from"./error-boundary-BuSNQDm9.js";import{i as fe}from"./FilterLines-DcDy1u8y.js";import{n as xe}from"./Inbox01-1y9TGDAK.js";import{i as te}from"./Loading01-BclS8iWV.js";import{s as ge}from"./RefreshCw01-Cvn_Sesf.js";import{i as pe}from"./SearchMd-DhDCnDEk.js";import{u as he}from"./useQuery-Cx1KUbzW.js";import{u as Fe}from"./useInfiniteQuery-Cb7WWrkC.js";import{a as Ee,f as _e,b as Ke}from"./registry-utils-icgkdXTH.js";import{u as je,W as Ae,a as Me,h as Oe,b as Be}from"./constants-7tHIXjuz.js";import{f as De,g as ye,h as Ge}from"./use-connection-t2lORAui.js";import{s as We}from"./slugify-CEUa2lfQ.js";import{C as Ve}from"./collection-search-BEKSlJnh.js";import{M as ae}from"./mcp-server-card-DUsbBMD4.js";import{c as oe,B as Y}from"./button-Cxd9D7GZ.js";import{I as qe}from"./input-BTRdl8wU.js";import{b as ve,P as be,a as Ne}from"./popover-CdY9eVBh.js";import{i as Ce}from"./Check-Dy1kSzwX.js";import{t as Se}from"./ChevronDown-CEjoikg0.js";import{s as ee}from"./XClose-CwzH0SGu.js";import{s as Ue}from"./Plus-C5LR6cck.js";import{E as He}from"./empty-state-x18Ct7Bg.js";import{u as Je}from"./use-binding-Dvp-m6Vz.js";import{L as Qe,u as Ye}from"./localstorage-keys-DE1N3_0b.js";import"./ChevronRight-CVpzq9SE.js";import"./infiniteQueryObserver-B5jHce9f.js";import"./useMutation-DTtaBOsy.js";import"./tooltip-DkOvFQ7D.js";import"./index-C1cLa9Gd.js";import"./Terminal-DhXZE8tI.js";import"./Lock01-D8RoH81a.js";import"./card-U5Qqs_wY.js";import"./integration-icon-Qol0n8Yu.js";import"./Container-D5gdKEFc.js";import"./github-icon-Dp3wHhYE.js";import"./binder-B_Z7E1sw.js";function Ze(s,e){const r=J.c(4),[n,a]=U.useState(s),l=U.useRef(null),u=U.useRef(!0);let o,c;return r[0]!==e||r[1]!==s?(o=()=>{if(u.current){u.current=!1;return}return l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{a(s)},e),()=>{l.current&&clearTimeout(l.current)}},c=[s,e],r[0]=e,r[1]=s,r[2]=o,r[3]=c):(o=r[2],c=r[3]),U.useEffect(o,c),n}function Xe(s){const e=J.c(14),r=U.useRef(null),n=`scroll-position:${s}`,a=U.useRef(null);let l;e[0]!==n?(l=()=>{r.current&&sessionStorage.setItem(n,String(r.current.scrollTop))},e[0]=n,e[1]=l):l=e[1];const u=l;let o;e[2]!==n?(o=()=>{if(a.current===n)return;const h=sessionStorage.getItem(n);if(h&&r.current){const C=Number.parseInt(h,10);r.current.scrollTop=C}a.current=n},e[2]=n,e[3]=o):o=e[3];const c=o;let y;e[4]!==c||e[5]!==n?(y=()=>{a.current!==n&&c()},e[4]=c,e[5]=n,e[6]=y):y=e[6];const N=y;let i;e[7]!==c||e[8]!==n?(i=h=>{r.current=h,h&&a.current!==n&&requestAnimationFrame(()=>{c()})},e[7]=c,e[8]=n,e[9]=i):i=e[9];const g=i;let m;return e[10]!==N||e[11]!==u||e[12]!==g?(m={scrollRef:g,saveScrollPosition:u,handleScroll:N},e[10]=N,e[11]=u,e[12]=g,e[13]=m):m=e[13],m}const et=24;function tt(s){const e=J.c(54),{registryId:r,listToolName:n,filtersToolName:a,search:l}=s,{org:u}=se();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],e[0]=o):o=e[0];const[c,y]=U.useState(o);let N;e[1]===Symbol.for("react.memo_cache_sentinel")?(N=[],e[1]=N):N=e[1];const[i,g]=U.useState(N),m=r||null;let h;e[2]!==u.id||e[3]!==m?(h={connectionId:m,orgId:u.id},e[2]=u.id,e[3]=m,e[4]=h):h=e[4];const C=je(h),R=!!a;let v;e[5]!==a||e[6]!==r?(v=ne.toolCall(r,a||"no-filters","{}"),e[5]=a,e[6]=r,e[7]=v):v=e[7];let T;e[8]!==C||e[9]!==a?(T=async()=>{if(!a)return{tags:[],categories:[]};const D=await C.callTool({name:a,arguments:{}});return D.structuredContent??D},e[8]=C,e[9]=a,e[10]=T):T=e[10];let I;e[11]!==v||e[12]!==T?(I={queryKey:v,queryFn:T,staleTime:36e5,retry:2},e[11]=v,e[12]=T,e[13]=I):I=e[13];const{data:k}=he(I);let p,S,P;if(e[14]!==n||e[15]!==r||e[16]!==l||e[17]!==i||e[18]!==c){const D=l?.trim()?{operator:"or",conditions:[{field:["name"],operator:"contains",value:l},{field:["title"],operator:"contains",value:l},{field:["description"],operator:"contains",value:l}]}:void 0;p={limit:et,...c.length>0&&{tags:c},...i.length>0&&{categories:i},...D&&{where:D}},P=Fe,S=ne.toolCall(r,n,JSON.stringify(p)),e[14]=n,e[15]=r,e[16]=l,e[17]=i,e[18]=c,e[19]=p,e[20]=S,e[21]=P}else p=e[19],S=e[20],P=e[21];let j;e[22]!==C||e[23]!==p||e[24]!==n?(j=async D=>{const{pageParam:X}=D,re=X?{...p,cursor:X}:p,ie=await C.callTool({name:n,arguments:re});return ie.structuredContent??ie},e[22]=C,e[23]=p,e[24]=n,e[25]=j):j=e[25];let L;e[26]!==j||e[27]!==S?(L={queryKey:S,queryFn:j,initialPageParam:void 0,getNextPageParam:st,staleTime:36e5,placeholderData:we,retry:2},e[26]=j,e[27]=S,e[28]=L):L=e[28];const{data:w,fetchNextPage:x,hasNextPage:d,isFetchingNextPage:f,isFetching:$,isLoading:z,error:_}=P(L);let F;e:{if(!w?.pages||w.pages.length===0){F=null;break e}const D=w.pages[0];if(typeof D=="object"&&D!==null&&"totalCount"in D&&typeof D.totalCount=="number"){F=D.totalCount;break e}F=null}const K=F,E=w?.pages;let V;e[29]!==E?(V=Ee(E),e[29]=E,e[30]=V):V=e[30];const q=V;let G;e[31]!==l||e[32]!==i.length||e[33]!==c.length?(G=c.length>0||i.length>0||!!l?.trim(),e[31]=l,e[32]=i.length,e[33]=c.length,e[34]=G):G=e[34];const A=G,B=$&&!f&&!z&&A;let W;e[35]!==x||e[36]!==d||e[37]!==f?(W=()=>{d&&!f&&x()},e[35]=x,e[36]=d,e[37]=f,e[38]=W):W=e[38];const M=W,O=d??!1,H=R?k?.tags:void 0,Q=R?k?.categories:void 0;let b;return e[39]!==A||e[40]!==$||e[41]!==f||e[42]!==B||e[43]!==z||e[44]!==q||e[45]!==_||e[46]!==M||e[47]!==i||e[48]!==c||e[49]!==O||e[50]!==H||e[51]!==Q||e[52]!==K?(b={items:q,totalCount:K,hasMore:O,isLoadingMore:f,isFiltering:B,isInitialLoading:z,isFetching:$,error:_,loadMore:M,availableTags:H,availableCategories:Q,selectedTags:c,selectedCategories:i,setSelectedTags:y,setSelectedCategories:g,hasActiveFilters:A},e[39]=A,e[40]=$,e[41]=f,e[42]=B,e[43]=z,e[44]=q,e[45]=_,e[46]=M,e[47]=i,e[48]=c,e[49]=O,e[50]=H,e[51]=Q,e[52]=K,e[53]=b):b=e[53],b}function st(s){if(typeof s=="object"&&s!==null){const e=s.nextCursor||s.cursor;if(e)return e}}function rt(s,e){return[...s].sort((r,n)=>n.count-r.count).slice(0,e)}function ce(s){const e=J.c(52),{label:r,items:n,selectedItems:a,onToggle:l,onClear:u}=s,[o,c]=U.useState(""),[y,N]=U.useState(!1);let i,g,m,h,C,R,v,T,I,k,p;if(e[0]!==n||e[1]!==r||e[2]!==l||e[3]!==y||e[4]!==o||e[5]!==a){const x=[...o?n.filter(E=>E.value.toLowerCase().includes(o.toLowerCase())):n].sort(lt);m=a.length,g=ve,I=y,k=N;let d;e[17]!==r?(d=t.jsx("span",{children:r}),e[17]=r,e[18]=d):d=e[18];let f;e[19]!==m?(f=m>0&&t.jsx("span",{className:"ml-1 rounded-full bg-primary text-primary-foreground px-1.5 py-0.5 text-[10px] font-medium",children:m}),e[19]=m,e[20]=f):f=e[20];let $;e[21]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(Se,{size:14,className:"opacity-50"}),e[21]=$):$=e[21],e[22]!==f||e[23]!==d?(p=t.jsx(be,{asChild:!0,children:t.jsxs(Y,{variant:"outline",size:"sm",className:"h-7 px-3 gap-1.5 text-xs font-normal flex-1",children:[d,f,$]})}),e[22]=f,e[23]=d,e[24]=p):p=e[24],i=Ne,R="w-64 p-0",v="start";let z;e[25]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(pe,{size:16,className:"text-muted-foreground shrink-0"}),e[25]=z):z=e[25];let _;e[26]!==r?(_=r.toLowerCase(),e[26]=r,e[27]=_):_=e[27];const F=`Search ${_}...`;let K;e[28]===Symbol.for("react.memo_cache_sentinel")?(K=E=>c(E.target.value),e[28]=K):K=e[28],e[29]!==o||e[30]!==F?(T=t.jsx("div",{className:"shrink-0 w-full border-b border-border h-10",children:t.jsxs("label",{className:"flex items-center gap-2.5 h-10 px-4 cursor-text",children:[z,t.jsx(qe,{type:"text",placeholder:F,value:o,onChange:K,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]})}),e[29]=o,e[30]=F,e[31]=T):T=e[31],h="max-h-64 overflow-y-auto p-1 flex flex-col gap-1",C=x.length===0?t.jsx("div",{className:"px-2 py-4 text-sm text-muted-foreground text-center",children:"No results found"}):x.map(E=>{const V=a.includes(E.value);return t.jsxs("button",{onClick:()=>l(E.value),className:oe("w-full flex items-center justify-between px-2 py-1.5 text-sm rounded cursor-pointer transition-colors",V?"bg-accent/50 text-foreground":"hover:bg-muted text-foreground"),children:[t.jsxs("span",{className:"truncate flex items-center gap-2",children:[V&&t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0"}),E.value]}),t.jsx("span",{className:"text-xs text-muted-foreground ml-2 shrink-0",children:E.count})]},E.value)}),e[0]=n,e[1]=r,e[2]=l,e[3]=y,e[4]=o,e[5]=a,e[6]=i,e[7]=g,e[8]=m,e[9]=h,e[10]=C,e[11]=R,e[12]=v,e[13]=T,e[14]=I,e[15]=k,e[16]=p}else i=e[6],g=e[7],m=e[8],h=e[9],C=e[10],R=e[11],v=e[12],T=e[13],I=e[14],k=e[15],p=e[16];let S;e[32]!==h||e[33]!==C?(S=t.jsx("div",{className:h,children:C}),e[32]=h,e[33]=C,e[34]=S):S=e[34];let P;e[35]!==r||e[36]!==u||e[37]!==m?(P=m>0&&t.jsx("div",{className:"p-2 border-t border-border",children:t.jsxs(Y,{variant:"ghost",size:"sm",onClick:u,className:"w-full text-xs text-muted-foreground hover:text-foreground",children:["Clear ",r.toLowerCase()]})}),e[35]=r,e[36]=u,e[37]=m,e[38]=P):P=e[38];let j;e[39]!==i||e[40]!==P||e[41]!==R||e[42]!==v||e[43]!==T||e[44]!==S?(j=t.jsxs(i,{className:R,align:v,children:[T,S,P]}),e[39]=i,e[40]=P,e[41]=R,e[42]=v,e[43]=T,e[44]=S,e[45]=j):j=e[45];let L;return e[46]!==g||e[47]!==j||e[48]!==I||e[49]!==k||e[50]!==p?(L=t.jsxs(g,{open:I,onOpenChange:k,children:[p,j]}),e[46]=g,e[47]=j,e[48]=I,e[49]=k,e[50]=p,e[51]=L):L=e[51],L}function lt(s,e){return e.count-s.count}function nt(s){const e=J.c(67),{availableTags:r,availableCategories:n,selectedTags:a,selectedCategories:l,onTagChange:u,onCategoryChange:o}=s,c=r&&r.length>0||n&&n.length>0,y=a.length>0||l.length>0;if(!c)return null;let N;e[0]!==u||e[1]!==a?(N=d=>{a.includes(d)?u(a.filter(f=>f!==d)):u([...a,d])},e[0]=u,e[1]=a,e[2]=N):N=e[2];const i=N;let g;e[3]!==o||e[4]!==l?(g=d=>{l.includes(d)?o(l.filter(f=>f!==d)):o([...l,d])},e[3]=o,e[4]=l,e[5]=g):g=e[5];const m=g;let h;e[6]!==o||e[7]!==u?(h=()=>{u([]),o([])},e[6]=o,e[7]=u,e[8]=h):h=e[8];const C=h;let R,v,T,I,k,p,S;if(e[9]!==n||e[10]!==r||e[11]!==o||e[12]!==u||e[13]!==l||e[14]!==a||e[15]!==m||e[16]!==i){const d=n?rt(n,6):[];R=l,v=a,S=new Set(d.map(ot)),k="flex items-center border-b border-border";let f;e[24]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("div",{className:"flex items-center gap-2 text-muted-foreground",children:t.jsx(fe,{size:16})}),e[24]=f):f=e[24];let $;e[25]!==n||e[26]!==o||e[27]!==l||e[28]!==m?($=n&&n.length>0&&t.jsx(ce,{label:"Categories",items:n,selectedItems:l,onToggle:m,onClear:()=>o([])}),e[25]=n,e[26]=o,e[27]=l,e[28]=m,e[29]=$):$=e[29];let z;e[30]!==r||e[31]!==u||e[32]!==a||e[33]!==i?(z=r&&r.length>0&&t.jsx(ce,{label:"Tags",items:r,selectedItems:a,onToggle:i,onClear:()=>u([])}),e[30]=r,e[31]=u,e[32]=a,e[33]=i,e[34]=z):z=e[34],e[35]!==z||e[36]!==$?(p=t.jsxs("div",{className:"flex items-center gap-3 flex-wrap px-5 py-3 border-r border-border",children:[f,$,z]}),e[35]=z,e[36]=$,e[37]=p):p=e[37],T="flex items-center gap-3 flex-wrap px-5 py-3";let _;e[38]!==l||e[39]!==m?(_=F=>{const K=l.includes(F.value);return t.jsxs("div",{onClick:()=>m(F.value),className:oe("inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer",K?"bg-primary text-primary-foreground hover:bg-primary/80":"bg-muted hover:bg-accent text-muted-foreground"),children:[t.jsx("span",{children:F.value}),K&&t.jsx("span",{onClick:E=>{E.stopPropagation(),m(F.value)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:t.jsx(ee,{size:12})})]},F.value)},e[38]=l,e[39]=m,e[40]=_):_=e[40],I=d.map(_),e[9]=n,e[10]=r,e[11]=o,e[12]=u,e[13]=l,e[14]=a,e[15]=m,e[16]=i,e[17]=R,e[18]=v,e[19]=T,e[20]=I,e[21]=k,e[22]=p,e[23]=S}else R=e[17],v=e[18],T=e[19],I=e[20],k=e[21],p=e[22],S=e[23];let P;if(e[41]!==R||e[42]!==m||e[43]!==S){let d;e[45]!==S?(d=$=>!S.has($),e[45]=S,e[46]=d):d=e[46];let f;e[47]!==m?(f=$=>t.jsxs("div",{onClick:()=>m($),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[t.jsx("span",{children:$}),t.jsx("span",{onClick:z=>{z.stopPropagation(),m($)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:t.jsx(ee,{size:12})})]},`cat-${$}`),e[47]=m,e[48]=f):f=e[48],P=R.filter(d).map(f),e[41]=R,e[42]=m,e[43]=S,e[44]=P}else P=e[44];let j;if(e[49]!==v||e[50]!==i){let d;e[52]!==i?(d=f=>t.jsxs("div",{onClick:()=>i(f),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[t.jsx("span",{children:f}),t.jsx("span",{onClick:$=>{$.stopPropagation(),i(f)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:t.jsx(ee,{size:12})})]},`tag-${f}`),e[52]=i,e[53]=d):d=e[53],j=v.map(d),e[49]=v,e[50]=i,e[51]=j}else j=e[51];let L;e[54]!==C||e[55]!==y?(L=y&&t.jsxs(Y,{variant:"ghost",size:"sm",onClick:C,className:"h-7 text-xs text-muted-foreground hover:text-foreground gap-1 px-2",children:[t.jsx(ee,{size:14}),"Clear all"]}),e[54]=C,e[55]=y,e[56]=L):L=e[56];let w;e[57]!==L||e[58]!==T||e[59]!==I||e[60]!==P||e[61]!==j?(w=t.jsxs("div",{className:T,children:[I,P,j,L]}),e[57]=L,e[58]=T,e[59]=I,e[60]=P,e[61]=j,e[62]=w):w=e[62];let x;return e[63]!==w||e[64]!==k||e[65]!==p?(x=t.jsxs("div",{className:k,children:[p,w]}),e[63]=w,e[64]=k,e[65]=p,e[66]=x):x=e[66],x}function ot(s){return s.value}function it(s,e){if(!e)return s;const r=e.toLowerCase();return s.filter(n=>(n.name||n.title||"").toLowerCase().includes(r)||(n.description||n.server?.description||"").toLowerCase().includes(r))}function at(s){return s.verified===!0||s._meta?.["mcp.mesh"]?.verified===!0}function ct(s){const e=J.c(55),{registryId:r,listToolName:n,filtersToolName:a}=s,[l,u]=U.useState(""),o=Ze(l,300),c=me(),{org:y}=se(),{scrollRef:N,saveScrollPosition:i,handleScroll:g}=Xe(`store-discovery:${r}`);let m;e[0]!==o||e[1]!==a||e[2]!==n||e[3]!==r?(m={registryId:r,listToolName:n,filtersToolName:a,search:o},e[0]=o,e[1]=a,e[2]=n,e[3]=r,e[4]=m):m=e[4];const{items:h,hasMore:C,isLoadingMore:R,isInitialLoading:v,isFetching:T,error:I,loadMore:k,availableTags:p,availableCategories:S,selectedTags:P,selectedCategories:j,setSelectedTags:L,setSelectedCategories:w,hasActiveFilters:x}=tt(m);let d,f,$,z;e[5]!==o||e[6]!==T||e[7]!==v||e[8]!==h||e[9]!==l?(d=l?it(h,l):h,f=(l!==o||T)&&!v&&!!l,z=d.filter(at),$=d.filter(M=>!z.find(O=>O.id===M.id)),e[5]=o,e[6]=T,e[7]=v,e[8]=h,e[9]=l,e[10]=d,e[11]=f,e[12]=$,e[13]=z):(d=e[10],f=e[11],$=e[12],z=e[13]);const _=$;let F;e[14]!==c||e[15]!==y.slug||e[16]!==r||e[17]!==i?(F=M=>{i();const O=We(M.name||M.title||M.server?.title||""),H=M.server?.name||M.id;c({to:"/$org/$project/store/$appName",params:{org:y.slug,project:de,appName:O},search:{registryId:r,serverName:H}})},e[14]=c,e[15]=y.slug,e[16]=r,e[17]=i,e[18]=F):F=e[18];const K=F;let E;e[19]!==g||e[20]!==C||e[21]!==R||e[22]!==k?(E=M=>{if(g(),!C||R)return;const O=M.currentTarget;O.scrollHeight-O.scrollTop-O.clientHeight<200&&k()},e[19]=g,e[20]=C,e[21]=R,e[22]=k,e[23]=E):E=e[23];const V=E;let q;e[24]!==f||e[25]!==l?(q=t.jsx(Ve,{value:l,onChange:u,placeholder:"Search for an MCP Server...",isSearching:f}),e[24]=f,e[25]=l,e[26]=q):q=e[26];let G;e[27]!==S||e[28]!==p||e[29]!==j||e[30]!==P||e[31]!==w||e[32]!==L?(G=t.jsx(nt,{availableTags:p,availableCategories:S,selectedTags:P,selectedCategories:j,onTagChange:L,onCategoryChange:w}),e[27]=S,e[28]=p,e[29]=j,e[30]=P,e[31]=w,e[32]=L,e[33]=G):G=e[33];let A;e[34]!==_||e[35]!==I||e[36]!==d||e[37]!==K||e[38]!==x||e[39]!==C||e[40]!==v||e[41]!==R||e[42]!==f||e[43]!==h||e[44]!==l||e[45]!==z?(A=t.jsx("div",{className:"p-5",children:t.jsx("div",{children:I&&!v?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(ue,{className:"size-8 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Registry unavailable"}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:"Could not load items from this registry. It may be temporarily offline."}),I.message&&t.jsx("p",{className:"text-xs text-muted-foreground/60 font-mono max-w-md mx-auto truncate",children:I.message})]}),t.jsxs(Y,{variant:"outline",size:"sm",onClick:mt,children:[t.jsx(ge,{className:"size-4"}),"Try again"]})]}):v?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(te,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading items..."})]}):h.length===0&&!x?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(xe,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No items available"}),t.jsx("p",{className:"text-muted-foreground",children:"This store doesn't have any available items yet."})]}):h.length===0&&x&&!l?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(fe,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No matching items"}),t.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your filters to find more results."})]}):l&&d.length===0&&!f?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(pe,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No results found"}),t.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your search terms."})]}):t.jsxs("div",{className:"flex flex-col gap-8",children:[f&&d.length===0&&t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(te,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Searching..."})]}),z.length>0&&t.jsx(ae,{items:z,title:"Verified",onItemClick:K}),_.length>0&&t.jsx(ae,{items:_,title:z.length>0?"All":"",onItemClick:K}),C&&R&&t.jsx("div",{className:"flex justify-center py-8",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx(te,{size:20,className:"animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading more items..."})]})})]})})}),e[34]=_,e[35]=I,e[36]=d,e[37]=K,e[38]=x,e[39]=C,e[40]=v,e[41]=R,e[42]=f,e[43]=h,e[44]=l,e[45]=z,e[46]=A):A=e[46];let B;e[47]!==V||e[48]!==N||e[49]!==A?(B=t.jsx("div",{ref:N,className:"flex-1 overflow-y-auto",onScroll:V,children:A}),e[47]=V,e[48]=N,e[49]=A,e[50]=B):B=e[50];let W;return e[51]!==q||e[52]!==G||e[53]!==B?(W=t.jsxs("div",{className:"flex flex-col h-full",children:[q,G,B]}),e[51]=q,e[52]=G,e[53]=B,e[54]=W):W=e[54],W}function mt(){return window.location.reload()}function dt(s){const e=J.c(10),{registryId:r}=s,n=De(r),a=n?.tools;let l;e[0]!==a?(l=_e(a),e[0]=a,e[1]=l):l=e[1];const u=l;if(!u){let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"bg-muted p-3 rounded-full",children:t.jsx(xe,{className:"size-8 text-muted-foreground"})}),e[2]=g):g=e[2];let m;return e[3]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-12 text-center space-y-4",children:[g,t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Registry not available"}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:"This registry does not support listing store items, or the connection is not responding."})]})]}),e[3]=m):m=e[3],m}const o=n?.tools;let c;e[4]!==o?(c=Ke(o),e[4]=o,e[5]=c):c=e[5];const N=c||void 0;let i;return e[6]!==u||e[7]!==r||e[8]!==N?(i=t.jsx(ct,{registryId:r,listToolName:u,filtersToolName:N}),e[6]=u,e[7]=r,e[8]=N,e[9]=i):i=e[9],i}function ut(s){const e=J.c(43),{registries:r,value:n,onValueChange:a,onAddWellKnown:l,wellKnownRegistries:u,placeholder:o}=s,c=o===void 0?"Select a registry...":o,[y,N]=U.useState(!1);let i,g,m,h,C,R,v,T;if(e[0]!==y||e[1]!==c||e[2]!==r||e[3]!==n){let w;e[12]!==n?(w=d=>d.id===n,e[12]=n,e[13]=w):w=e[13];const x=r.find(w);g=ve,v=y,T=N,i=be,R=!0,m="button",e[14]===Symbol.for("react.memo_cache_sentinel")?(h=oe("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg border bg-transparent px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] h-7 min-w-[160px]"),e[14]=h):h=e[14],C=x?t.jsxs("span",{className:"flex items-center gap-2",children:[x.icon?t.jsx("img",{src:x.icon,alt:x.name,className:"w-4 h-4 rounded"}):t.jsx("span",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:x.name.slice(0,1).toUpperCase()}),t.jsx("span",{children:x.name})]}):t.jsx("span",{className:"text-muted-foreground",children:c}),e[0]=y,e[1]=c,e[2]=r,e[3]=n,e[4]=i,e[5]=g,e[6]=m,e[7]=h,e[8]=C,e[9]=R,e[10]=v,e[11]=T}else i=e[4],g=e[5],m=e[6],h=e[7],C=e[8],R=e[9],v=e[10],T=e[11];let I;e[15]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(Se,{className:"size-4 opacity-50"}),e[15]=I):I=e[15];let k;e[16]!==m||e[17]!==h||e[18]!==C?(k=t.jsxs("button",{type:m,className:h,children:[C,I]}),e[16]=m,e[17]=h,e[18]=C,e[19]=k):k=e[19];let p;e[20]!==i||e[21]!==R||e[22]!==k?(p=t.jsx(i,{asChild:R,children:k}),e[20]=i,e[21]=R,e[22]=k,e[23]=p):p=e[23];let S;if(e[24]!==a||e[25]!==r||e[26]!==n){let w;e[28]!==a||e[29]!==n?(w=x=>t.jsxs("button",{type:"button",onClick:()=>{a(x.id??x.name),N(!1)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[x.icon?t.jsx("img",{src:x.icon,alt:x.name,className:"w-4 h-4 rounded"}):t.jsx("span",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:x.name.slice(0,1).toUpperCase()}),t.jsx("span",{children:x.name})]}),n===(x.id??x.name)&&t.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:t.jsx(Ce,{className:"size-4"})})]},x.id??x.name),e[28]=a,e[29]=n,e[30]=w):w=e[30],S=r.map(w),e[24]=a,e[25]=r,e[26]=n,e[27]=S}else S=e[27];let P;e[31]!==l||e[32]!==u?(P=u.length>0&&t.jsxs("div",{className:"border-t border-border pt-1 mt-1",children:[t.jsx("p",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Other known registries"}),u.map(w=>t.jsxs("button",{type:"button",onClick:()=>{l(w),N(!1)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[w.icon?t.jsx("img",{src:w.icon,alt:w.title,className:"w-4 h-4 rounded"}):t.jsx("span",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:w.title.slice(0,1).toUpperCase()}),t.jsx("span",{className:"flex-1",children:w.title})]}),t.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center text-muted-foreground",children:t.jsx(Ue,{size:16})})]},w.id??w.title))]}),e[31]=l,e[32]=u,e[33]=P):P=e[33];let j;e[34]!==S||e[35]!==P?(j=t.jsxs(Ne,{align:"end",className:"w-auto min-w-[200px] p-1",children:[S,P]}),e[34]=S,e[35]=P,e[36]=j):j=e[36];let L;return e[37]!==g||e[38]!==p||e[39]!==j||e[40]!==v||e[41]!==T?(L=t.jsxs(g,{open:v,onOpenChange:T,children:[p,j]}),e[37]=g,e[38]=p,e[39]=j,e[40]=v,e[41]=T,e[42]=L):L=e[42],L}function ft({registries:s,onConnected:e}){const r=ye(),{org:{slug:n}}=se(),{data:a}=Te.useSession(),l=me(),[u,o]=U.useState(!1),c=s[0],y=async()=>{if(!(!c||!a?.user?.id)){o(!0);try{const i=await r.create.mutateAsync(c);e?.(i.id)}finally{o(!1)}}},N=()=>{l({to:"/$org/$project/mcps",params:{org:n,project:de},search:{action:"create"}})};return t.jsx(He,{image:t.jsx("img",{src:"/store-empty-state.svg",alt:"No store connected",width:336,height:320,className:"max-w-full h-auto"}),title:"Connect to registry",description:"Connect to discover and use Connections from the community.",actions:t.jsxs(t.Fragment,{children:[t.jsxs(Y,{variant:"outline",onClick:y,disabled:u||!c,children:[c?.icon&&t.jsx("img",{src:c.icon,alt:"",className:"size-4"}),u?"Installing...":"Install Registry"]}),t.jsx(Y,{variant:"outline",onClick:N,children:"Custom Connection"})]})})}function xt(s){const e=J.c(15),{error:r,onRetry:n,registryName:a}=s;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(ue,{className:"h-6 w-6 text-destructive"})}),e[0]=l):l=e[0];let u;e[1]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("h3",{className:"text-lg font-medium",children:"Unable to load store"}),e[1]=u):u=e[1];let o;e[2]!==a?(o=t.jsxs("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:["The ",t.jsx("strong",{children:a})," registry is currently unreachable. This may be a temporary issue — try again in a moment."]}),e[2]=a,e[3]=o):o=e[3];let c;e[4]!==r?(c=r?.message&&t.jsx("p",{className:"text-xs text-muted-foreground/60 font-mono max-w-md mx-auto truncate",children:r.message}),e[4]=r,e[5]=c):c=e[5];let y;e[6]!==o||e[7]!==c?(y=t.jsxs("div",{className:"space-y-2",children:[u,o,c]}),e[6]=o,e[7]=c,e[8]=y):y=e[8];let N;e[9]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(ge,{className:"size-4"}),e[9]=N):N=e[9];let i;e[10]!==n?(i=t.jsxs(Y,{variant:"outline",size:"sm",onClick:n,children:[N,"Try again"]}),e[10]=n,e[11]=i):i=e[11];let g;return e[12]!==y||e[13]!==i?(g=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[l,y,i]}),e[12]=y,e[13]=i,e[14]=g):g=e[14],g}function ss(){const s=J.c(48),{org:e,project:r}=se(),n=Ge(),a=ye(),l=Ie(),u=l.location.pathname.includes("/store/")&&l.location.pathname.split("/").length>3,o=Je(n);let c;s[0]!==e.id?(c=Ae.SELF(e.id),s[0]=e.id,s[1]=c):c=s[1];const y=c,N=r.enabledPlugins,i=N==null||N.includes(le),g=o.filter(b=>b.id!==y?!0:i);let m;s[2]!==y?(m=b=>b.id===y,s[2]=y,s[3]=m):m=s[3];const h=g.some(m);let C;s[4]!==e.id?(C={connectionId:Me,orgId:e.id},s[4]=e.id,s[5]=C):C=s[5];const R=je(C);let v;s[6]!==r.id||s[7]!==R?(v=async()=>{const b=await R.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:r.id,pluginId:le}});return b.structuredContent??b},s[6]=r.id,s[7]=R,s[8]=v):v=s[8];const{data:T}=he({queryKey:ne.projectPluginConfig(r.id??"",le),queryFn:v,enabled:h&&!!r.id,staleTime:6e4}),I=T?.config?.settings;let k;s[9]!==I||s[10]!==y?(k=b=>b.id===y&&I?{id:b.id,name:I.registryName||b.title,icon:I.registryIcon||b.icon||void 0}:{id:b.id,name:b.title,icon:b.icon||void 0},s[9]=I,s[10]=y,s[11]=k):k=s[11];const p=g.map(k);let S;s[12]!==e.slug?(S=Qe.selectedRegistry(e.slug),s[12]=e.slug,s[13]=S):S=s[13];const[P,j]=Ye(S,pt);let L;s[14]!==P?(L=b=>b.id===P,s[14]=P,s[15]=L):L=s[15];const x=g.find(L)?.id||g[0]?.id||"";let d;s[16]!==e.id?(d=Oe(e.id),s[16]=e.id,s[17]=d):d=s[17];let f;s[18]!==d?(f=[d],s[18]=d,s[19]=f):f=s[19];const $=f;let z;s[20]===Symbol.for("react.memo_cache_sentinel")?(z=[Be()],s[20]=z):z=s[20];const _=z;let F;s[21]!==a.create||s[22]!==j?(F=async b=>{const D=await a.create.mutateAsync(b);j(D.id)},s[21]=a.create,s[22]=j,s[23]=F):F=s[23];const K=F,E=new Set(g.map(gt)),V=$.filter(b=>b.id&&!E.has(b.id)),q=_.filter(b=>b.id&&!E.has(b.id));if(u){let b;return s[24]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Re,{}),s[24]=b):b=s[24],b}let G;s[25]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(Z.Header.Left,{children:t.jsx(Pe,{children:t.jsx(ze,{children:t.jsx(ke,{children:t.jsx($e,{children:"Store"})})})})}),s[25]=G):G=s[25];let A;s[26]!==K?(A=async b=>K(b),s[26]=K,s[27]=A):A=s[27];let B;s[28]!==V||s[29]!==x||s[30]!==p||s[31]!==j||s[32]!==A?(B=t.jsxs(Z.Header,{children:[G,t.jsx(Z.Header.Right,{children:t.jsx(ut,{wellKnownRegistries:V,registries:p,value:x,onValueChange:j,onAddWellKnown:A,placeholder:"Select store..."})})]}),s[28]=V,s[29]=x,s[30]=p,s[31]=j,s[32]=A,s[33]=B):B=s[33];let W;s[34]!==x||s[35]!==p?(W=b=>{const{error:D,resetError:X}=b;return t.jsx(xt,{error:D,onRetry:X,registryName:p.find(re=>re.id===x)?.name??"registry"})},s[34]=x,s[35]=p,s[36]=W):W=s[36];let M;s[37]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[t.jsx(te,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading store items..."})]}),s[37]=M):M=s[37];let O;s[38]!==q||s[39]!==x||s[40]!==j?(O=t.jsx(U.Suspense,{fallback:M,children:x?t.jsx(dt,{registryId:x}):t.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:t.jsx(ft,{registries:q,onConnected:b=>{j(b)}})})}),s[38]=q,s[39]=x,s[40]=j,s[41]=O):O=s[41];let H;s[42]!==W||s[43]!==O?(H=t.jsx(Z.Content,{children:t.jsx(Le,{fallback:W,children:O})}),s[42]=W,s[43]=O,s[44]=H):H=s[44];let Q;return s[45]!==B||s[46]!==H?(Q=t.jsxs(Z,{children:[B,H]}),s[45]=B,s[46]=H,s[47]=Q):Q=s[47],Q}function gt(s){return s.id}function pt(s){return s??""}export{ss as default};
@@ -1 +1 @@
1
- import{c as n,j as t,I as o}from"./index-B29giag9.js";function c(){const s=n.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(o,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No storage connected"}),t.jsx("p",{className:"text-muted-foreground text-center max-w-md",children:"Connect an S3-compatible storage service to browse and manage files."})]}),s[0]=e):e=s[0],e}export{c as default};
1
+ import{c as n,j as t,I as o}from"./index-B0lAKtRh.js";function c(){const s=n.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(o,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No storage connected"}),t.jsx("p",{className:"text-muted-foreground text-center max-w-md",children:"Connect an S3-compatible storage service to browse and manage files."})]}),s[0]=e):e=s[0],e}export{c as default};
@@ -1 +1 @@
1
- import{c as s,j as t}from"./index-B29giag9.js";import{e as r}from"./Dataflow03-CJHUSZDC.js";function a(){const o=s.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(r,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No workflows connected"}),t.jsx("p",{className:"text-muted-foreground text-center max-w-md",children:"Connect a workflow provider to create and manage automated workflows with multiple steps and integrations."})]}),o[0]=e):e=o[0],e}export{a as default};
1
+ import{c as s,j as t}from"./index-B0lAKtRh.js";import{e as r}from"./Dataflow03-By6KEPGS.js";function a(){const o=s.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(r,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No workflows connected"}),t.jsx("p",{className:"text-muted-foreground text-center max-w-md",children:"Connect a workflow provider to create and manage automated workflows with multiple steps and integrations."})]}),o[0]=e):e=o[0],e}export{a as default};
@@ -1 +1 @@
1
- import{c as S,j as s,r as w}from"./index-B29giag9.js";import{i as R}from"./Check-DVZrDl7E.js";import{t as _}from"./ChevronDown-BrnUqul2.js";import{e as y}from"./Dataflow03-CJHUSZDC.js";function E(x){const e=S.c(32),{connections:l,selectedConnectionId:r,onConnectionChange:N}=x,[n,z]=w.useState(!1),C=w.useRef(null);let p;if(e[0]!==l||e[1]!==r){let t;e[3]!==r?(t=u=>u.id===r,e[3]=r,e[4]=t):t=e[4],p=l.find(t),e[0]=l,e[1]=r,e[2]=p}else p=e[2];const i=p;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t=>{C.current?.contains(t.relatedTarget)||z(!1)},e[5]=j):j=e[5];const k=j;if(l.length===1){let t;e[6]!==i?(t=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[6]=i,e[7]=t):t=e[7];const u=i?.title||"Workflows";let f;e[8]!==u?(f=s.jsx("span",{children:u}),e[8]=u,e[9]=f):f=e[9];let h;return e[10]!==t||e[11]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t,f]}),e[10]=t,e[11]=f,e[12]=h):h=e[12],h}let o;e[13]!==n?(o=()=>z(!n),e[13]=n,e[14]=o):o=e[14];let c;e[15]!==i?(c=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[15]=i,e[16]=c):c=e[16];const v=i?.title||"Select provider";let a;e[17]!==v?(a=s.jsx("span",{children:v}),e[17]=v,e[18]=a):a=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(_,{size:14}),e[19]=b):b=e[19];let d;e[20]!==o||e[21]!==c||e[22]!==a?(d=s.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md border border-border bg-background hover:bg-accent transition-colors",children:[c,a,b]}),e[20]=o,e[21]=c,e[22]=a,e[23]=d):d=e[23];let m;e[24]!==l||e[25]!==n||e[26]!==N||e[27]!==r?(m=n&&s.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-48 rounded-md border border-border bg-popover p-1 shadow-md",children:l.map(t=>s.jsxs("button",{type:"button",onClick:()=>{N(t.id),z(!1)},className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent transition-colors",children:[t.icon?s.jsx("img",{src:t.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),s.jsx("span",{className:"flex-1 text-left",children:t.title}),t.id===r&&s.jsx(R,{size:14,className:"text-primary"})]},t.id))}),e[24]=l,e[25]=n,e[26]=N,e[27]=r,e[28]=m):m=e[28];let g;return e[29]!==d||e[30]!==m?(g=s.jsxs("div",{className:"relative",ref:C,onBlur:k,children:[d,m]}),e[29]=d,e[30]=m,e[31]=g):g=e[31],g}function H(x){const e=S.c(2);let l;return e[0]!==x?(l=s.jsx(E,{...x}),e[0]=x,e[1]=l):l=e[1],l}export{H as default};
1
+ import{c as S,j as s,r as w}from"./index-B0lAKtRh.js";import{i as R}from"./Check-Dy1kSzwX.js";import{t as _}from"./ChevronDown-CEjoikg0.js";import{e as y}from"./Dataflow03-By6KEPGS.js";function E(x){const e=S.c(32),{connections:l,selectedConnectionId:r,onConnectionChange:N}=x,[n,z]=w.useState(!1),C=w.useRef(null);let p;if(e[0]!==l||e[1]!==r){let t;e[3]!==r?(t=u=>u.id===r,e[3]=r,e[4]=t):t=e[4],p=l.find(t),e[0]=l,e[1]=r,e[2]=p}else p=e[2];const i=p;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t=>{C.current?.contains(t.relatedTarget)||z(!1)},e[5]=j):j=e[5];const k=j;if(l.length===1){let t;e[6]!==i?(t=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[6]=i,e[7]=t):t=e[7];const u=i?.title||"Workflows";let f;e[8]!==u?(f=s.jsx("span",{children:u}),e[8]=u,e[9]=f):f=e[9];let h;return e[10]!==t||e[11]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t,f]}),e[10]=t,e[11]=f,e[12]=h):h=e[12],h}let o;e[13]!==n?(o=()=>z(!n),e[13]=n,e[14]=o):o=e[14];let c;e[15]!==i?(c=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[15]=i,e[16]=c):c=e[16];const v=i?.title||"Select provider";let a;e[17]!==v?(a=s.jsx("span",{children:v}),e[17]=v,e[18]=a):a=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(_,{size:14}),e[19]=b):b=e[19];let d;e[20]!==o||e[21]!==c||e[22]!==a?(d=s.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md border border-border bg-background hover:bg-accent transition-colors",children:[c,a,b]}),e[20]=o,e[21]=c,e[22]=a,e[23]=d):d=e[23];let m;e[24]!==l||e[25]!==n||e[26]!==N||e[27]!==r?(m=n&&s.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-48 rounded-md border border-border bg-popover p-1 shadow-md",children:l.map(t=>s.jsxs("button",{type:"button",onClick:()=>{N(t.id),z(!1)},className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent transition-colors",children:[t.icon?s.jsx("img",{src:t.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),s.jsx("span",{className:"flex-1 text-left",children:t.title}),t.id===r&&s.jsx(R,{size:14,className:"text-primary"})]},t.id))}),e[24]=l,e[25]=n,e[26]=N,e[27]=r,e[28]=m):m=e[28];let g;return e[29]!==d||e[30]!==m?(g=s.jsxs("div",{className:"relative",ref:C,onBlur:k,children:[d,m]}),e[29]=d,e[30]=m,e[31]=g):g=e[31],g}function H(x){const e=S.c(2);let l;return e[0]!==x?(l=s.jsx(E,{...x}),e[0]=x,e[1]=l):l=e[1],l}export{H as default};
@@ -1 +1 @@
1
- import{c as w,j as s,r as S,I as y}from"./index-B29giag9.js";import{i as _}from"./Check-DVZrDl7E.js";import{t as k}from"./ChevronDown-BrnUqul2.js";function E(x){const e=w.c(32),{connections:l,selectedConnectionId:n,onConnectionChange:N}=x,[r,z]=S.useState(!1),C=S.useRef(null);let p;if(e[0]!==l||e[1]!==n){let t;e[3]!==n?(t=u=>u.id===n,e[3]=n,e[4]=t):t=e[4],p=l.find(t),e[0]=l,e[1]=n,e[2]=p}else p=e[2];const i=p;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t=>{C.current?.contains(t.relatedTarget)||z(!1)},e[5]=j):j=e[5];const R=j;if(l.length===1){let t;e[6]!==i?(t=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[6]=i,e[7]=t):t=e[7];const u=i?.title||"Storage";let f;e[8]!==u?(f=s.jsx("span",{children:u}),e[8]=u,e[9]=f):f=e[9];let h;return e[10]!==t||e[11]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t,f]}),e[10]=t,e[11]=f,e[12]=h):h=e[12],h}let o;e[13]!==r?(o=()=>z(!r),e[13]=r,e[14]=o):o=e[14];let a;e[15]!==i?(a=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[15]=i,e[16]=a):a=e[16];const v=i?.title||"Select storage";let c;e[17]!==v?(c=s.jsx("span",{children:v}),e[17]=v,e[18]=c):c=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(k,{size:14}),e[19]=b):b=e[19];let d;e[20]!==o||e[21]!==a||e[22]!==c?(d=s.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md border border-border bg-background hover:bg-accent transition-colors",children:[a,c,b]}),e[20]=o,e[21]=a,e[22]=c,e[23]=d):d=e[23];let m;e[24]!==l||e[25]!==r||e[26]!==N||e[27]!==n?(m=r&&s.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-48 rounded-md border border-border bg-popover p-1 shadow-md",children:l.map(t=>s.jsxs("button",{type:"button",onClick:()=>{N(t.id),z(!1)},className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent transition-colors",children:[t.icon?s.jsx("img",{src:t.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),s.jsx("span",{className:"flex-1 text-left",children:t.title}),t.id===n&&s.jsx(_,{size:14,className:"text-primary"})]},t.id))}),e[24]=l,e[25]=r,e[26]=N,e[27]=n,e[28]=m):m=e[28];let g;return e[29]!==d||e[30]!==m?(g=s.jsxs("div",{className:"relative",ref:C,onBlur:R,children:[d,m]}),e[29]=d,e[30]=m,e[31]=g):g=e[31],g}function O(x){const e=w.c(2);let l;return e[0]!==x?(l=s.jsx(E,{...x}),e[0]=x,e[1]=l):l=e[1],l}export{O as default};
1
+ import{c as w,j as s,r as S,I as y}from"./index-B0lAKtRh.js";import{i as _}from"./Check-Dy1kSzwX.js";import{t as k}from"./ChevronDown-CEjoikg0.js";function E(x){const e=w.c(32),{connections:l,selectedConnectionId:n,onConnectionChange:N}=x,[r,z]=S.useState(!1),C=S.useRef(null);let p;if(e[0]!==l||e[1]!==n){let t;e[3]!==n?(t=u=>u.id===n,e[3]=n,e[4]=t):t=e[4],p=l.find(t),e[0]=l,e[1]=n,e[2]=p}else p=e[2];const i=p;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t=>{C.current?.contains(t.relatedTarget)||z(!1)},e[5]=j):j=e[5];const R=j;if(l.length===1){let t;e[6]!==i?(t=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[6]=i,e[7]=t):t=e[7];const u=i?.title||"Storage";let f;e[8]!==u?(f=s.jsx("span",{children:u}),e[8]=u,e[9]=f):f=e[9];let h;return e[10]!==t||e[11]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t,f]}),e[10]=t,e[11]=f,e[12]=h):h=e[12],h}let o;e[13]!==r?(o=()=>z(!r),e[13]=r,e[14]=o):o=e[14];let a;e[15]!==i?(a=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[15]=i,e[16]=a):a=e[16];const v=i?.title||"Select storage";let c;e[17]!==v?(c=s.jsx("span",{children:v}),e[17]=v,e[18]=c):c=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(k,{size:14}),e[19]=b):b=e[19];let d;e[20]!==o||e[21]!==a||e[22]!==c?(d=s.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md border border-border bg-background hover:bg-accent transition-colors",children:[a,c,b]}),e[20]=o,e[21]=a,e[22]=c,e[23]=d):d=e[23];let m;e[24]!==l||e[25]!==r||e[26]!==N||e[27]!==n?(m=r&&s.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-48 rounded-md border border-border bg-popover p-1 shadow-md",children:l.map(t=>s.jsxs("button",{type:"button",onClick:()=>{N(t.id),z(!1)},className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent transition-colors",children:[t.icon?s.jsx("img",{src:t.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),s.jsx("span",{className:"flex-1 text-left",children:t.title}),t.id===n&&s.jsx(_,{size:14,className:"text-primary"})]},t.id))}),e[24]=l,e[25]=r,e[26]=N,e[27]=n,e[28]=m):m=e[28];let g;return e[29]!==d||e[30]!==m?(g=s.jsxs("div",{className:"relative",ref:C,onBlur:R,children:[d,m]}),e[29]=d,e[30]=m,e[31]=g):g=e[31],g}function O(x){const e=w.c(2);let l;return e[0]!==x?(l=s.jsx(E,{...x}),e[0]=x,e[1]=l):l=e[1],l}export{O as default};
@@ -1 +1 @@
1
- import{r as i,ar as $,j as c,aF as L,an as G,at as A,a9 as _,av as P,aG as E,ax as j,aE as H,aJ as w,aO as z,aP as K,ay as J,aQ as Q,aR as U,aS as V,aH as W,aI as Z,aL as q,c as R}from"./index-B29giag9.js";import{c as B}from"./button-D-PerQqC.js";var m="Popover",[b]=J(m,[w]),g=w(),[X,d]=b(m),N=t=>{const{__scopePopover:e,children:o,open:r,defaultOpen:n,onOpenChange:a,modal:s=!1}=t,p=g(e),l=i.useRef(null),[u,h]=i.useState(!1),[x,f]=$({prop:r,defaultProp:n??!1,onChange:a,caller:m});return c.jsx(L,{...p,children:c.jsx(X,{scope:e,contentId:G(),triggerRef:l,open:x,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(C=>!C),[f]),hasCustomAnchor:u,onCustomAnchorAdd:i.useCallback(()=>h(!0),[]),onCustomAnchorRemove:i.useCallback(()=>h(!1),[]),modal:s,children:o})})};N.displayName=m;var F="PopoverAnchor",Y=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(F,o),a=g(o),{onCustomAnchorAdd:s,onCustomAnchorRemove:p}=n;return i.useEffect(()=>(s(),()=>p()),[s,p]),c.jsx(E,{...a,...r,ref:e})});Y.displayName=F;var S="PopoverTrigger",y=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(S,o),a=g(o),s=A(e,n.triggerRef),p=c.jsx(_.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":k(n.open),...r,ref:s,onClick:P(t.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:c.jsx(E,{asChild:!0,...a,children:p})});y.displayName=S;var O="PopoverPortal",[ee,oe]=b(O,{forceMount:void 0}),D=t=>{const{__scopePopover:e,forceMount:o,children:r,container:n}=t,a=d(O,e);return c.jsx(ee,{scope:e,forceMount:o,children:c.jsx(j,{present:o||a.open,children:c.jsx(H,{asChild:!0,container:n,children:r})})})};D.displayName=O;var v="PopoverContent",M=i.forwardRef((t,e)=>{const o=oe(v,t.__scopePopover),{forceMount:r=o.forceMount,...n}=t,a=d(v,t.__scopePopover);return c.jsx(j,{present:r||a.open,children:a.modal?c.jsx(re,{...n,ref:e}):c.jsx(ne,{...n,ref:e})})});M.displayName=v;var te=Q("PopoverContent.RemoveScroll"),re=i.forwardRef((t,e)=>{const o=d(v,t.__scopePopover),r=i.useRef(null),n=A(e,r),a=i.useRef(!1);return i.useEffect(()=>{const s=r.current;if(s)return z(s)},[]),c.jsx(K,{as:te,allowPinchZoom:!0,children:c.jsx(I,{...t,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:P(t.onCloseAutoFocus,s=>{s.preventDefault(),a.current||o.triggerRef.current?.focus()}),onPointerDownOutside:P(t.onPointerDownOutside,s=>{const p=s.detail.originalEvent,l=p.button===0&&p.ctrlKey===!0,u=p.button===2||l;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:P(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),ne=i.forwardRef((t,e)=>{const o=d(v,t.__scopePopover),r=i.useRef(!1),n=i.useRef(!1);return c.jsx(I,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),a.defaultPrevented||(r.current||o.triggerRef.current?.focus(),a.preventDefault()),r.current=!1,n.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const s=a.target;o.triggerRef.current?.contains(s)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&n.current&&a.preventDefault()}})}),I=i.forwardRef((t,e)=>{const{__scopePopover:o,trapFocus:r,onOpenAutoFocus:n,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:h,...x}=t,f=d(v,o),C=g(o);return U(),c.jsx(V,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:a,children:c.jsx(W,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:h,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:c.jsx(Z,{"data-state":k(f.open),role:"dialog",id:f.contentId,...C,...x,ref:e,style:{...x.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),T="PopoverClose",ae=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(T,o);return c.jsx(_.button,{type:"button",...r,ref:e,onClick:P(t.onClick,()=>n.onOpenChange(!1))})});ae.displayName=T;var se="PopoverArrow",ce=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=g(o);return c.jsx(q,{...n,...r,ref:e})});ce.displayName=se;function k(t){return t?"open":"closed"}var ie=N,pe=y,le=D,ue=M;function ve(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(ie,{"data-slot":"popover",...o}),e[2]=o,e[3]=r):r=e[3],r}function Pe(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(pe,{"data-slot":"popover-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}function ge(t){const e=R.c(12);let o,r,n,a;e[0]!==t?({className:o,align:n,sideOffset:a,...r}=t,e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=a):(o=e[1],r=e[2],n=e[3],a=e[4]);const s=n===void 0?"center":n,p=a===void 0?4:a;let l;e[5]!==o?(l=B("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-lg overflow-hidden border p-4 shadow-md outline-hidden",o),e[5]=o,e[6]=l):l=e[6];let u;return e[7]!==s||e[8]!==r||e[9]!==p||e[10]!==l?(u=c.jsx(le,{children:c.jsx(ue,{"data-slot":"popover-content",align:s,sideOffset:p,className:l,...r})}),e[7]=s,e[8]=r,e[9]=p,e[10]=l,e[11]=u):u=e[11],u}export{Pe as P,ge as a,ve as b};
1
+ import{r as i,aq as $,j as c,aE as G,an as H,as as A,a9 as _,au as P,aF as w,aw as E,aD as L,aI as j,aN as z,aO as K,ax as q,aP as Q,aQ as U,aR as V,aG as W,aH as Z,aK as B,c as R}from"./index-B0lAKtRh.js";import{c as J}from"./button-Cxd9D7GZ.js";var m="Popover",[b]=q(m,[j]),g=j(),[X,d]=b(m),N=t=>{const{__scopePopover:e,children:o,open:r,defaultOpen:n,onOpenChange:a,modal:s=!1}=t,p=g(e),l=i.useRef(null),[u,h]=i.useState(!1),[x,f]=$({prop:r,defaultProp:n??!1,onChange:a,caller:m});return c.jsx(G,{...p,children:c.jsx(X,{scope:e,contentId:H(),triggerRef:l,open:x,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(C=>!C),[f]),hasCustomAnchor:u,onCustomAnchorAdd:i.useCallback(()=>h(!0),[]),onCustomAnchorRemove:i.useCallback(()=>h(!1),[]),modal:s,children:o})})};N.displayName=m;var F="PopoverAnchor",Y=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(F,o),a=g(o),{onCustomAnchorAdd:s,onCustomAnchorRemove:p}=n;return i.useEffect(()=>(s(),()=>p()),[s,p]),c.jsx(w,{...a,...r,ref:e})});Y.displayName=F;var S="PopoverTrigger",y=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(S,o),a=g(o),s=A(e,n.triggerRef),p=c.jsx(_.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":k(n.open),...r,ref:s,onClick:P(t.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:c.jsx(w,{asChild:!0,...a,children:p})});y.displayName=S;var O="PopoverPortal",[ee,oe]=b(O,{forceMount:void 0}),D=t=>{const{__scopePopover:e,forceMount:o,children:r,container:n}=t,a=d(O,e);return c.jsx(ee,{scope:e,forceMount:o,children:c.jsx(E,{present:o||a.open,children:c.jsx(L,{asChild:!0,container:n,children:r})})})};D.displayName=O;var v="PopoverContent",M=i.forwardRef((t,e)=>{const o=oe(v,t.__scopePopover),{forceMount:r=o.forceMount,...n}=t,a=d(v,t.__scopePopover);return c.jsx(E,{present:r||a.open,children:a.modal?c.jsx(re,{...n,ref:e}):c.jsx(ne,{...n,ref:e})})});M.displayName=v;var te=Q("PopoverContent.RemoveScroll"),re=i.forwardRef((t,e)=>{const o=d(v,t.__scopePopover),r=i.useRef(null),n=A(e,r),a=i.useRef(!1);return i.useEffect(()=>{const s=r.current;if(s)return z(s)},[]),c.jsx(K,{as:te,allowPinchZoom:!0,children:c.jsx(I,{...t,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:P(t.onCloseAutoFocus,s=>{s.preventDefault(),a.current||o.triggerRef.current?.focus()}),onPointerDownOutside:P(t.onPointerDownOutside,s=>{const p=s.detail.originalEvent,l=p.button===0&&p.ctrlKey===!0,u=p.button===2||l;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:P(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),ne=i.forwardRef((t,e)=>{const o=d(v,t.__scopePopover),r=i.useRef(!1),n=i.useRef(!1);return c.jsx(I,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),a.defaultPrevented||(r.current||o.triggerRef.current?.focus(),a.preventDefault()),r.current=!1,n.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const s=a.target;o.triggerRef.current?.contains(s)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&n.current&&a.preventDefault()}})}),I=i.forwardRef((t,e)=>{const{__scopePopover:o,trapFocus:r,onOpenAutoFocus:n,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:h,...x}=t,f=d(v,o),C=g(o);return U(),c.jsx(V,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:a,children:c.jsx(W,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:h,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:c.jsx(Z,{"data-state":k(f.open),role:"dialog",id:f.contentId,...C,...x,ref:e,style:{...x.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),T="PopoverClose",ae=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(T,o);return c.jsx(_.button,{type:"button",...r,ref:e,onClick:P(t.onClick,()=>n.onOpenChange(!1))})});ae.displayName=T;var se="PopoverArrow",ce=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=g(o);return c.jsx(B,{...n,...r,ref:e})});ce.displayName=se;function k(t){return t?"open":"closed"}var ie=N,pe=y,le=D,ue=M;function ve(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(ie,{"data-slot":"popover",...o}),e[2]=o,e[3]=r):r=e[3],r}function Pe(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(pe,{"data-slot":"popover-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}function ge(t){const e=R.c(12);let o,r,n,a;e[0]!==t?({className:o,align:n,sideOffset:a,...r}=t,e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=a):(o=e[1],r=e[2],n=e[3],a=e[4]);const s=n===void 0?"center":n,p=a===void 0?4:a;let l;e[5]!==o?(l=J("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-lg overflow-hidden border p-4 shadow-md outline-hidden",o),e[5]=o,e[6]=l):l=e[6];let u;return e[7]!==s||e[8]!==r||e[9]!==p||e[10]!==l?(u=c.jsx(le,{children:c.jsx(ue,{"data-slot":"popover-content",align:s,sideOffset:p,className:l,...r})}),e[7]=s,e[8]=r,e[9]=p,e[10]=l,e[11]=u):u=e[11],u}export{Pe as P,ge as a,ve as b};
@@ -1 +1 @@
1
- import{c as j,j as s,r as S,S as p,a as b,u as y,O as h,l as N,P as v,m as P}from"./index-B29giag9.js";import{u as $}from"./use-project-DY_ihdkL.js";import{B as _}from"./button-D-PerQqC.js";import"./useQuery-BO0TdkAU.js";import"./constants-CH9byiKA.js";function z(e){const t=j.c(12),{projectSlug:m,orgSlug:c,error:i}=e,r=P();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("h1",{className:"text-xl font-semibold",children:"Failed to load project"}),t[0]=o):o=t[0];let l;t[1]!==m?(l=s.jsxs("p",{className:"text-muted-foreground text-center",children:['There was an error loading the project "',m,'".']}),t[1]=m,t[2]=l):l=t[2];let n;t[3]!==i.message?(n=s.jsx("p",{className:"text-sm text-muted-foreground",children:i.message}),t[3]=i.message,t[4]=n):n=t[4];let u;t[5]!==r||t[6]!==c?(u=s.jsx(_,{variant:"link",onClick:()=>r({to:"/$org/$project",params:{org:c,project:h}}),children:"Go to organization home"}),t[5]=r,t[6]=c,t[7]=u):u=t[7];let d;return t[8]!==l||t[9]!==n||t[10]!==u?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[o,l,n,u]}),t[8]=l,t[9]=n,t[10]=u,t[11]=d):d=t[11],d}function k(e){const t=j.c(9),{projectSlug:m,orgSlug:c}=e,i=P();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("h1",{className:"text-xl font-semibold",children:"Project not found"}),t[0]=r):r=t[0];let o;t[1]!==m?(o=s.jsxs("p",{className:"text-muted-foreground text-center",children:['The project "',m,'" does not exist in this organization.']}),t[1]=m,t[2]=o):o=t[2];let l;t[3]!==i||t[4]!==c?(l=s.jsx(_,{variant:"link",onClick:()=>i({to:"/$org/$project",params:{org:c,project:h}}),children:"Go to organization home"}),t[3]=i,t[4]=c,t[5]=l):l=t[5];let n;return t[6]!==o||t[7]!==l?(n=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[r,o,l]}),t[6]=o,t[7]=l,t[8]=n):n=t[8],n}function C(){const e=j.c(22);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const m=b(t),{org:c}=y(),i=m.org,r=m.project,{data:o,isLoading:l,error:n}=$(c.id,r);if(l){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(p,{}),e[1]=a):a=e[1],a}if(n){let a;return e[2]!==n||e[3]!==i||e[4]!==r?(a=s.jsx(z,{projectSlug:r,orgSlug:i,error:n}),e[2]=n,e[3]=i,e[4]=r,e[5]=a):a=e[5],a}if(!o){let a;return e[6]!==i||e[7]!==r?(a=s.jsx(k,{projectSlug:r,orgSlug:i}),e[6]=i,e[7]=r,e[8]=a):a=e[8],a}const u=o.slug===h;let d;e[9]!==o.description||e[10]!==o.enabledPlugins||e[11]!==o.id||e[12]!==o.name||e[13]!==o.organizationId||e[14]!==o.slug||e[15]!==o.ui||e[16]!==u?(d={id:o.id,organizationId:o.organizationId,slug:o.slug,name:o.name,description:o.description,enabledPlugins:o.enabledPlugins,ui:o.ui,isOrgAdmin:u},e[9]=o.description,e[10]=o.enabledPlugins,e[11]=o.id,e[12]=o.name,e[13]=o.organizationId,e[14]=o.slug,e[15]=o.ui,e[16]=u,e[17]=d):d=e[17];const x=d;let f;e[18]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(S.Suspense,{fallback:s.jsx(p,{}),children:s.jsx(N,{})}),e[18]=f):f=e[18];let g;return e[19]!==x||e[20]!==c?(g=s.jsx(v,{org:c,project:x,children:f}),e[19]=x,e[20]=c,e[21]=g):g=e[21],g}function L(){const e=j.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(S.Suspense,{fallback:s.jsx(p,{}),children:s.jsx(C,{})}),e[0]=t):t=e[0],t}export{L as default};
1
+ import{c as j,j as s,r as S,S as p,a as b,u as y,O as h,l as N,P as v,m as P}from"./index-B0lAKtRh.js";import{u as $}from"./use-project-BTuyMFkB.js";import{B as _}from"./button-Cxd9D7GZ.js";import"./useQuery-Cx1KUbzW.js";import"./constants-7tHIXjuz.js";function z(e){const t=j.c(12),{projectSlug:m,orgSlug:c,error:i}=e,r=P();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("h1",{className:"text-xl font-semibold",children:"Failed to load project"}),t[0]=o):o=t[0];let l;t[1]!==m?(l=s.jsxs("p",{className:"text-muted-foreground text-center",children:['There was an error loading the project "',m,'".']}),t[1]=m,t[2]=l):l=t[2];let n;t[3]!==i.message?(n=s.jsx("p",{className:"text-sm text-muted-foreground",children:i.message}),t[3]=i.message,t[4]=n):n=t[4];let u;t[5]!==r||t[6]!==c?(u=s.jsx(_,{variant:"link",onClick:()=>r({to:"/$org/$project",params:{org:c,project:h}}),children:"Go to organization home"}),t[5]=r,t[6]=c,t[7]=u):u=t[7];let d;return t[8]!==l||t[9]!==n||t[10]!==u?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[o,l,n,u]}),t[8]=l,t[9]=n,t[10]=u,t[11]=d):d=t[11],d}function k(e){const t=j.c(9),{projectSlug:m,orgSlug:c}=e,i=P();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("h1",{className:"text-xl font-semibold",children:"Project not found"}),t[0]=r):r=t[0];let o;t[1]!==m?(o=s.jsxs("p",{className:"text-muted-foreground text-center",children:['The project "',m,'" does not exist in this organization.']}),t[1]=m,t[2]=o):o=t[2];let l;t[3]!==i||t[4]!==c?(l=s.jsx(_,{variant:"link",onClick:()=>i({to:"/$org/$project",params:{org:c,project:h}}),children:"Go to organization home"}),t[3]=i,t[4]=c,t[5]=l):l=t[5];let n;return t[6]!==o||t[7]!==l?(n=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[r,o,l]}),t[6]=o,t[7]=l,t[8]=n):n=t[8],n}function C(){const e=j.c(22);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const m=b(t),{org:c}=y(),i=m.org,r=m.project,{data:o,isLoading:l,error:n}=$(c.id,r);if(l){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(p,{}),e[1]=a):a=e[1],a}if(n){let a;return e[2]!==n||e[3]!==i||e[4]!==r?(a=s.jsx(z,{projectSlug:r,orgSlug:i,error:n}),e[2]=n,e[3]=i,e[4]=r,e[5]=a):a=e[5],a}if(!o){let a;return e[6]!==i||e[7]!==r?(a=s.jsx(k,{projectSlug:r,orgSlug:i}),e[6]=i,e[7]=r,e[8]=a):a=e[8],a}const u=o.slug===h;let d;e[9]!==o.description||e[10]!==o.enabledPlugins||e[11]!==o.id||e[12]!==o.name||e[13]!==o.organizationId||e[14]!==o.slug||e[15]!==o.ui||e[16]!==u?(d={id:o.id,organizationId:o.organizationId,slug:o.slug,name:o.name,description:o.description,enabledPlugins:o.enabledPlugins,ui:o.ui,isOrgAdmin:u},e[9]=o.description,e[10]=o.enabledPlugins,e[11]=o.id,e[12]=o.name,e[13]=o.organizationId,e[14]=o.slug,e[15]=o.ui,e[16]=u,e[17]=d):d=e[17];const x=d;let f;e[18]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(S.Suspense,{fallback:s.jsx(p,{}),children:s.jsx(N,{})}),e[18]=f):f=e[18];let g;return e[19]!==x||e[20]!==c?(g=s.jsx(v,{org:c,project:x,children:f}),e[19]=x,e[20]=c,e[21]=g):g=e[21],g}function L(){const e=j.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(S.Suspense,{fallback:s.jsx(p,{}),children:s.jsx(C,{})}),e[0]=t):t=e[0],t}export{L as default};