@decocms/mesh 2.20.1 → 2.20.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/dist/client/assets/{AlertCircle-DeGhTF84.js → AlertCircle-CI2U-jkN.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-m6KeIjPT.js → ArrowLeft-B3km7toT.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-BDjaIiFu.js → ArrowUp-BF7mM4C2.js} +1 -1
  4. package/dist/client/assets/{Check-Cs5AiVxS.js → Check-BQkm1TiP.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-7pGjkuTY.js → ChevronDown-DP6jvip7.js} +1 -1
  6. package/dist/client/assets/{Code01-BdN1qNoI.js → Code01-qXTn9GK9.js} +1 -1
  7. package/dist/client/assets/{Copy01-B_oHlu2-.js → Copy01-CEYn2daS.js} +1 -1
  8. package/dist/client/assets/{DotsHorizontal-B-RZHKDt.js → DotsHorizontal-C2Nr-D-f.js} +1 -1
  9. package/dist/client/assets/{DotsVertical-HKe7Lpcg.js → DotsVertical-BPP4U4GQ.js} +1 -1
  10. package/dist/client/assets/{Download01-4uLxYlt-.js → Download01-BkDXja2z.js} +1 -1
  11. package/dist/client/assets/{Edit01-CcxqoKWW.js → Edit01-Cq0mQDLh.js} +1 -1
  12. package/dist/client/assets/{File06-K5gpmB1y.js → File06-KMD38I-q.js} +1 -1
  13. package/dist/client/assets/{FilterLines-BCus583X.js → FilterLines-Bojt6HPl.js} +1 -1
  14. package/dist/client/assets/{FlipBackward-MuxfY5vX.js → FlipBackward-C-K9FamE.js} +1 -1
  15. package/dist/client/assets/{GitBranch01-ClkRJDdk.js → GitBranch01-DGTCzEh5.js} +1 -1
  16. package/dist/client/assets/{Grid01-XLGz76ym.js → Grid01-D4lXvveX.js} +1 -1
  17. package/dist/client/assets/{Home02-CeVIG1t0.js → Home02-DPdZvu8L.js} +1 -1
  18. package/dist/client/assets/{Image01-CycaMeSm.js → Image01-C0R6SF_P.js} +1 -1
  19. package/dist/client/assets/{Inbox01-1DQwZbO-.js → Inbox01-BsOUYwQZ.js} +1 -1
  20. package/dist/client/assets/{InfoCircle-DXvgKrQ3.js → InfoCircle-BgIkbjJr.js} +1 -1
  21. package/dist/client/assets/{Key01-B8mxyE2f.js → Key01-DTwk4FpG.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-B4WpWXG7.js → LinkExternal01-DmruqAb9.js} +1 -1
  23. package/dist/client/assets/{List-DWWQESNh.js → List-BsSZz32j.js} +1 -1
  24. package/dist/client/assets/{Loading01-BtKovu_m.js → Loading01-Ae5ezbtD.js} +1 -1
  25. package/dist/client/assets/{Lock01-CDOVc6ZJ.js → Lock01-BuQSktMF.js} +1 -1
  26. package/dist/client/assets/{Play-DYDE6oE1.js → Play-DKlNHVjf.js} +1 -1
  27. package/dist/client/assets/{Plus-CPExS1G1.js → Plus-CdG75X26.js} +1 -1
  28. package/dist/client/assets/{SearchMd-DwKDi1yz.js → SearchMd-GFaonOaJ.js} +1 -1
  29. package/dist/client/assets/{Terminal-LP4GeLJv.js → Terminal-C6mZx-5A.js} +1 -1
  30. package/dist/client/assets/{Trash01-DCb3R_1E.js → Trash01-BWIN9RL_.js} +1 -1
  31. package/dist/client/assets/{Upload01-BKDlh_J7.js → Upload01-CaBE4VYK.js} +1 -1
  32. package/dist/client/assets/{X-DWXiZn3v.js → X-C18ho617.js} +1 -1
  33. package/dist/client/assets/{XClose-s9vu-dQj.js → XClose-CfwoKknl.js} +1 -1
  34. package/dist/client/assets/{alert-dialog-CNXrLp-S.js → alert-dialog-CCJCsKzK.js} +1 -1
  35. package/dist/client/assets/{auth-catchall-M9fqis8u.js → auth-catchall-C33VWmDE.js} +1 -1
  36. package/dist/client/assets/{avatar-noXapmql.js → avatar-B7xnPXuk.js} +1 -1
  37. package/dist/client/assets/{badge-ChGpQW0J.js → badge-BVO6I0sW.js} +1 -1
  38. package/dist/client/assets/{binder-DZT62WgB.js → binder-By0LBK9Y.js} +1 -1
  39. package/dist/client/assets/{button-Dh_UOMtF.js → button-CGmrzkpY.js} +1 -1
  40. package/dist/client/assets/{card-Bjs7HBa2.js → card-DIjMh1NO.js} +1 -1
  41. package/dist/client/assets/{checkbox-DiEhrfCa.js → checkbox-DYViXeUc.js} +1 -1
  42. package/dist/client/assets/{collection-detail-BHOMTlVb.js → collection-detail-DtlOJm8P.js} +1 -1
  43. package/dist/client/assets/{collection-display-button-DKfm8yFW.js → collection-display-button-CtkxsCB_.js} +1 -1
  44. package/dist/client/assets/{collection-header-Cn-YMrm9.js → collection-header-B4qcjEt5.js} +1 -1
  45. package/dist/client/assets/{collection-page-A6cy4ewQ.js → collection-page-s-RR5fU6.js} +1 -1
  46. package/dist/client/assets/{collection-search-Bm9HY_m8.js → collection-search-BVb42O45.js} +1 -1
  47. package/dist/client/assets/{collection-tab-BQzpUnQW.js → collection-tab-CvrhLJCU.js} +1 -1
  48. package/dist/client/assets/{collection-table-wrapper-CnCS_a8f.js → collection-table-wrapper-BohFZqii.js} +1 -1
  49. package/dist/client/assets/{connection-DuIRkEvB.js → connection-ChwHK0-S.js} +1 -1
  50. package/dist/client/assets/{connection-card-Db71-JIc.js → connection-card-DMMfNQUo.js} +1 -1
  51. package/dist/client/assets/{connection-detail-C1yH43Km.js → connection-detail-D9bORT-_.js} +1 -1
  52. package/dist/client/assets/{connections-Bd35VTO7.js → connections-CRhyn7eO.js} +1 -1
  53. package/dist/client/assets/constants-J0aH6mLs.js +1 -0
  54. package/dist/client/assets/{create-organization-dialog-B19KPYZ1.js → create-organization-dialog-CtbMd6S_.js} +1 -1
  55. package/dist/client/assets/{dialog-BFNjB_wS.js → dialog-DJJ2cvEE.js} +1 -1
  56. package/dist/client/assets/{dropdown-menu-T7u8fl7N.js → dropdown-menu-CAeD2aIb.js} +1 -1
  57. package/dist/client/assets/{dynamic-plugin-layout-CaPvL2ak.js → dynamic-plugin-layout-BeSg8wRq.js} +1 -1
  58. package/dist/client/assets/{empty-state-ylKJe6-v.js → empty-state-BkAB-hls.js} +1 -1
  59. package/dist/client/assets/{empty-state-DhpaMqQD.js → empty-state-wP9uukGJ.js} +1 -1
  60. package/dist/client/assets/{env-vars-editor-BwDtTYE8.js → env-vars-editor-DuH6BBdA.js} +1 -1
  61. package/dist/client/assets/{error-boundary-_npCfvs4.js → error-boundary-BUvK8Sry.js} +1 -1
  62. package/dist/client/assets/{extract-connection-data-DfFE7uXb.js → extract-connection-data-BLs0SRok.js} +1 -1
  63. package/dist/client/assets/{file-browser-NWpg0oN1.js → file-browser-DuR45yyf.js} +2 -2
  64. package/dist/client/assets/{form-BEM8UzSv.js → form-DiGzBnRK.js} +1 -1
  65. package/dist/client/assets/{gateway-detail-BrjbS3jo.js → gateway-detail-BCBmyW-G.js} +1 -1
  66. package/dist/client/assets/{gateways-DhcOJhD5.js → gateways-BgSVXbfx.js} +1 -1
  67. package/dist/client/assets/{grid-view-BUF5kath.js → grid-view-Db741zGU.js} +1 -1
  68. package/dist/client/assets/{home-DyK0jpSk.js → home-BtJc_wcZ.js} +1 -1
  69. package/dist/client/assets/{index-Dh8Y3NBs.js → index-CL_rL7XJ.js} +4 -4
  70. package/dist/client/assets/{index-DanqEyuv.js → index-D4QCsSzb.js} +1 -1
  71. package/dist/client/assets/index-DUA-vRuy.js +1 -0
  72. package/dist/client/assets/{index-skH-OUyO.js → index-Diww4UW3.js} +2 -2
  73. package/dist/client/assets/{index-BRipTsvS.js → index-DjRWdLI4.js} +1 -1
  74. package/dist/client/assets/{infiniteQueryObserver-Dvgbvv4A.js → infiniteQueryObserver-BmbQcWdI.js} +1 -1
  75. package/dist/client/assets/{input-CdlPz8Vq.js → input-CrURMEZe.js} +1 -1
  76. package/dist/client/assets/{layout-DopLDDPE.js → layout-kp8TTJc9.js} +1 -1
  77. package/dist/client/assets/{lazy-highlighter-CQ8gN0d3.js → lazy-highlighter-dN3WcL6s.js} +1 -1
  78. package/dist/client/assets/{localstorage-keys-B_H3St2R.js → localstorage-keys-BVANkONM.js} +1 -1
  79. package/dist/client/assets/{login-1cuD6_Oo.js → login-CnuJ6k4x.js} +1 -1
  80. package/dist/client/assets/{mcp-oauth-B6eUt4Mr.js → mcp-oauth-CdcIczUJ.js} +1 -1
  81. package/dist/client/assets/{mcp-server-card-DTQIT3pj.js → mcp-server-card-VZUBDTRj.js} +1 -1
  82. package/dist/client/assets/{mcp-server-detail-BB_FT5IH.js → mcp-server-detail-CIR0FKMd.js} +1 -1
  83. package/dist/client/assets/{members-Cy4UaFKY.js → members-bQTH1spX.js} +1 -1
  84. package/dist/client/assets/{monaco-editor-CKUC5K4P.js → monaco-editor-CDRbE4GY.js} +1 -1
  85. package/dist/client/assets/{monitoring-DOZ3Tm1E.js → monitoring-Cb41cf-X.js} +1 -1
  86. package/dist/client/assets/{oauth-callback-DxWqmOqk.js → oauth-callback-z6t0OToi.js} +1 -1
  87. package/dist/client/assets/{page-wGlLXgmM.js → page-CcKdSzCp.js} +1 -1
  88. package/dist/client/assets/{page-zq0-MjKt.js → page-SWPgLEpC.js} +1 -1
  89. package/dist/client/assets/{pin-to-sidebar-button-C5qdidS1.js → pin-to-sidebar-button-DIwkO0Tx.js} +1 -1
  90. package/dist/client/assets/{plugin-empty-state-cSLsH0S-.js → plugin-empty-state-B-glkOMH.js} +1 -1
  91. package/dist/client/assets/{plugin-header-CzG38AxU.js → plugin-header-BA0z5mBU.js} +1 -1
  92. package/dist/client/assets/{plugins-BqbdQ0eM.js → plugins-Cq62fkYj.js} +1 -1
  93. package/dist/client/assets/{popover-B4iU4oXK.js → popover-Bx7diZ86.js} +1 -1
  94. package/dist/client/assets/{project-context-provider-Ci1EHyGR.js → project-context-provider-DulCVL2k.js} +1 -1
  95. package/dist/client/assets/{registry-utils-8goOeMwE.js → registry-utils-8Lvx2XTy.js} +1 -1
  96. package/dist/client/assets/{resizable-BteAr06H.js → resizable-Gk1RjNnW.js} +1 -1
  97. package/dist/client/assets/{resource-tabs-Dzc9tSXU.js → resource-tabs-ACbF96qo.js} +1 -1
  98. package/dist/client/assets/{select-B4aq4vxk.js → select-C8LOz7vA.js} +1 -1
  99. package/dist/client/assets/{settings-B6nAEWR5.js → settings-BXJ6BGel.js} +1 -1
  100. package/dist/client/assets/{shell-layout-CNkO6ROG.js → shell-layout-CFRw9Ru3.js} +1 -1
  101. package/dist/client/assets/{spinner-DwVZzFPC.js → spinner-BF56RAKQ.js} +1 -1
  102. package/dist/client/assets/{switch-PB1r01nO.js → switch-DJBd8Fzb.js} +1 -1
  103. package/dist/client/assets/{textarea-B7no0HbU.js → textarea-C_zgj3Sp.js} +1 -1
  104. package/dist/client/assets/{tool-set-selector-Cl3nu1df.js → tool-set-selector-B9rTBahU.js} +1 -1
  105. package/dist/client/assets/{tools-list-DNdG8U23.js → tools-list-mr-l2d8l.js} +1 -1
  106. package/dist/client/assets/{tooltip-DgJ4R-G6.js → tooltip-Suu_Gpqh.js} +1 -1
  107. package/dist/client/assets/{typewriter-title-YmbwonUg.js → typewriter-title-DM-oRxie.js} +1 -1
  108. package/dist/client/assets/{use-binding-R6SoNecZ.js → use-binding-D6wv_5fO.js} +1 -1
  109. package/dist/client/assets/{use-collections-CC15C_nK.js → use-collections-CXETocKO.js} +1 -1
  110. package/dist/client/assets/{use-connection-BY9aOm7H.js → use-connection-CCXutWLD.js} +1 -1
  111. package/dist/client/assets/{use-connection-resources-D2N-7Fdh.js → use-connection-resources-D0st76bP.js} +1 -1
  112. package/dist/client/assets/{use-create-gateway-D4_8vfl-.js → use-create-gateway-BlLsktgc.js} +1 -1
  113. package/dist/client/assets/{use-gateway-CmDE4xLF.js → use-gateway-DD-xEZju.js} +1 -1
  114. package/dist/client/assets/{use-gateway-system-prompt-nzDoNyO-.js → use-gateway-system-prompt-zGJSEzce.js} +1 -1
  115. package/dist/client/assets/{use-list-state-B0HVVNOr.js → use-list-state-AndcW8aD.js} +1 -1
  116. package/dist/client/assets/{use-mcp-DUgnx05H.js → use-mcp-D9llr83X.js} +1 -1
  117. package/dist/client/assets/{use-members-DEeTkVb7.js → use-members-CB2ebBfn.js} +1 -1
  118. package/dist/client/assets/{use-mobile-CZeMkOxo.js → use-mobile-DssCtDl6.js} +1 -1
  119. package/dist/client/assets/{use-organization-settings-8tWqPbhq.js → use-organization-settings-CQXtXtZs.js} +1 -1
  120. package/dist/client/assets/{use-tool-call-_jHZu2qb.js → use-tool-call-BmvKn7jp.js} +1 -1
  121. package/dist/client/assets/useInfiniteQuery-BttwTOfK.js +1 -0
  122. package/dist/client/assets/{useMutation-n0xwrWOz.js → useMutation-Dl1MMkEC.js} +1 -1
  123. package/dist/client/assets/useQuery-Bvk0U2ed.js +1 -0
  124. package/dist/client/assets/{value-BOu8imSs.js → value-DaPOjTmC.js} +1 -1
  125. package/dist/client/assets/{view-mode-toggle-Z5AVjYj0.js → view-mode-toggle-BLClM-0g.js} +1 -1
  126. package/dist/client/assets/{workflow-CZ2JUtj_.js → workflow-CQ7PQ7Dg.js} +1 -1
  127. package/dist/client/index.html +1 -1
  128. package/dist/server/cli.js +1 -1
  129. package/dist/server/node_modules/kysely/README.md +3 -1
  130. package/dist/server/node_modules/kysely/dist/cjs/index.d.ts +3 -1
  131. package/dist/server/node_modules/kysely/dist/cjs/migration/migrator.d.ts +1 -1
  132. package/dist/server/node_modules/kysely/dist/cjs/migration/migrator.js +75 -68
  133. package/dist/server/node_modules/kysely/dist/esm/index.d.ts +3 -1
  134. package/dist/server/node_modules/kysely/dist/esm/migration/migrator.d.ts +1 -1
  135. package/dist/server/node_modules/kysely/dist/esm/migration/migrator.js +75 -68
  136. package/dist/server/node_modules/kysely/package.json +13 -13
  137. package/dist/server/server.js +1 -1
  138. package/package.json +1 -1
  139. package/dist/client/assets/constants-C1rpewgJ.js +0 -1
  140. package/dist/client/assets/index-C6eYxyql.js +0 -1
  141. package/dist/client/assets/useInfiniteQuery-x4_y1w34.js +0 -1
  142. package/dist/client/assets/useQuery-FRehIqtM.js +0 -1
@@ -1,4 +1,4 @@
1
- import{ag as We,r as O,y as mh,z as lo,c as I,j as m,k as Ci,E as gh,h as yh,d as Et,b as xh,t as Ec,H as ee,F as bh,ah as Tc,$ as kh,Z as Sh,ai as wh,a5 as Mc,aj as Ac,ak as vh,a6 as Ni,a8 as Ge,a7 as Oc,al as Ch,aa as Ei,am as Nh,a3 as Ic,an as Eh,ao as Th,ap as Mh,aq as Ti,ar as Ah,as as Oh,at as Ih,a4 as Rh,au as jh,af as Rc}from"./index-skH-OUyO.js";import{U as qt,c as qe}from"./connection-DuIRkEvB.js";import{E as jc,I as js,n as Dh}from"./empty-state-DhpaMqQD.js";import{E as Dc}from"./error-boundary-_npCfvs4.js";import{u as Mi,a as Ai}from"./use-collections-CC15C_nK.js";import{P as Oi}from"./pin-to-sidebar-button-C5qdidS1.js";import{B as me,c as U}from"./button-Dh_UOMtF.js";import{F as ao,a as Ph,b as Ii,d as Ri}from"./form-BEM8UzSv.js";import{I as ji}from"./input-CdlPz8Vq.js";import{T as Ho}from"./textarea-B7no0HbU.js";import{b as Lt,T as $t,a as zt,c as _t}from"./tooltip-DgJ4R-G6.js";import{i as Pc}from"./FlipBackward-MuxfY5vX.js";import{a as Lc,V as Di,b as Sn}from"./layout-DopLDDPE.js";import{b as Pi,u as Lh}from"./use-connection-BY9aOm7H.js";import{i as $h}from"./AlertCircle-DeGhTF84.js";import{s as zh,M as On}from"./monaco-editor-CKUC5K4P.js";import{i as _h}from"./Code01-BdN1qNoI.js";import{a as Bh}from"./Copy01-B_oHlu2-.js";import{i as tr}from"./Loading01-BtKovu_m.js";import{i as Li,n as Fh}from"./Play-DYDE6oE1.js";import{s as $i}from"./XClose-s9vu-dQj.js";import{u as Vh,O as Hh,M as Wh,F as qh,v as Uh}from"./index-BRipTsvS.js";import{u as zi}from"./use-mcp-DUgnx05H.js";import{E as _i}from"./empty-state-ylKJe6-v.js";import{D as Kh,b as Jh}from"./use-binding-R6SoNecZ.js";import{u as Gh}from"./use-gateway-CmDE4xLF.js";import{b as Xh,R as Bl,a as Yh}from"./resizable-BteAr06H.js";import{a as Qh,b as Zh,c as $c,R as ep,d as tp,T as np}from"./index-Dh8Y3NBs.js";import{d as rp,b as sp,a as op,c as ip,S as lp}from"./select-B4aq4vxk.js";import{S as Ds}from"./spinner-DwVZzFPC.js";import{V as ap}from"./view-mode-toggle-Z5AVjYj0.js";import{i as cp}from"./GitBranch01-ClkRJDdk.js";import{a as Bi,b as Fi}from"./use-tool-call-_jHZu2qb.js";import"./project-context-provider-Ci1EHyGR.js";import{a as dp,D as up,g as fp,f as hp,c as pp,d as mp}from"./dialog-BFNjB_wS.js";import"./index-DanqEyuv.js";import{s as zc}from"./Plus-CPExS1G1.js";import{i as Vi}from"./Check-Cs5AiVxS.js";import{i as gp}from"./DotsHorizontal-B-RZHKDt.js";import{b as yp,D as xp,a as bp,c as Fl}from"./dropdown-menu-T7u8fl7N.js";import{i as kp}from"./Grid01-XLGz76ym.js";import{B as un}from"./badge-ChGpQW0J.js";import{i as _c}from"./X-DWXiZn3v.js";import"./useMutation-n0xwrWOz.js";import"./use-organization-settings-8tWqPbhq.js";import"./ArrowLeft-m6KeIjPT.js";import"./mcp-oauth-B6eUt4Mr.js";import"./env-vars-editor-BwDtTYE8.js";import"./Trash01-DCb3R_1E.js";import"./File06-K5gpmB1y.js";import"./Key01-B8mxyE2f.js";import"./extract-connection-data-DfFE7uXb.js";import"./constants-C1rpewgJ.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-8goOeMwE.js";import"./generate-id-Dyweu44Y.js";import"./Terminal-LP4GeLJv.js";import"./index-C6eYxyql.js";import"./useQuery-FRehIqtM.js";import"./binder-DZT62WgB.js";import"./popover-B4iU4oXK.js";import"./ArrowUp-BDjaIiFu.js";import"./ChevronDown-7pGjkuTY.js";import"./Edit01-CcxqoKWW.js";import"./use-gateway-system-prompt-nzDoNyO-.js";import"./localstorage-keys-B_H3St2R.js";import"./SearchMd-DwKDi1yz.js";import"./use-create-gateway-D4_8vfl-.js";import"./Image01-CycaMeSm.js";import"./alert-dialog-CNXrLp-S.js";import"./well-known-mcp-DOEdYmKO.js";const Bc=We("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const Fc=We("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const Hi=We("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const Wi=We("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const Sp=We("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const wp=We("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const Vc=We("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const Hc=We("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const Wc=We("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const qc=We("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const Uc=We("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]),qi=({size:n=24,color:e="currentColor",...t})=>O.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},O.createElement("path",{d:"M12 8v4m0 4h.01M2 8.523v6.954c0 .245 0 .367.028.482a1 1 0 0 0 .12.29c.061.1.148.187.32.36l4.923 4.922c.173.173.26.26.36.322.09.054.188.095.29.12.115.027.237.027.482.027h6.954c.245 0 .367 0 .482-.028a.998.998 0 0 0 .29-.12c.1-.061.187-.148.36-.32l4.922-4.923c.173-.173.26-.26.322-.36a.998.998 0 0 0 .12-.29c.027-.115.027-.237.027-.482V8.523c0-.245 0-.367-.028-.482a.998.998 0 0 0-.12-.29c-.061-.1-.148-.187-.32-.36L16.608 2.47c-.173-.173-.26-.26-.36-.322a1 1 0 0 0-.29-.12C15.844 2 15.722 2 15.477 2H8.523c-.245 0-.367 0-.482.028a1 1 0 0 0-.29.12c-.1.061-.187.148-.36.32L2.47 7.392c-.173.173-.26.26-.322.36a1 1 0 0 0-.12.29C2 8.156 2 8.278 2 8.523Z"}));qi.displayName="AlertOctagon";const Kc=({size:n=24,color:e="currentColor",...t})=>O.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},O.createElement("path",{d:"M20.5 8v8.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.22 21 17.38 21 15.7 21H8.3c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3.5 18.72 3.5 17.88 3.5 16.2V8m.1-5h16.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C22 3.76 22 4.04 22 4.6v1.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C21.24 8 20.96 8 20.4 8H3.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C2 7.24 2 6.96 2 6.4V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C2.76 3 3.04 3 3.6 3Zm6 8.5h4.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C16 12.26 16 12.54 16 13.1v.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437c-.214.109-.494.109-1.054.109H9.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C8 14.74 8 14.46 8 13.9v-.8c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C8.76 11.5 9.04 11.5 9.6 11.5Z"}));Kc.displayName="Box";const Jc=({size:n=24,color:e="currentColor",...t})=>O.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},O.createElement("path",{d:"m22.7 11.5-2 2-2-2m2.245 1.5A9 9 0 1 0 19 17.657M12 7v5l3 2"}));Jc.displayName="ClockFastForward";const Gc=({size:n=24,color:e="currentColor",...t})=>O.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},O.createElement("path",{d:"m17 17 5-5-5-5M7 7l-5 5 5 5m7-14-4 18"}));Gc.displayName="Code02";const jr=({size:n=24,color:e="currentColor",...t})=>O.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},O.createElement("path",{d:"M6.8 3h-.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C3 4.52 3 5.08 3 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21h.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C10 19.48 10 18.92 10 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C8.48 3 7.92 3 6.8 3Zm11 0h-.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C14 4.52 14 5.08 14 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C15.52 21 16.08 21 17.2 21h.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C19.48 3 18.92 3 17.8 3Z"}));jr.displayName="Columns01";const Xc=({size:n=24,color:e="currentColor",...t})=>O.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},O.createElement("path",{d:"M4 4v1.4c0 3.36 0 5.04.654 6.324a6 6 0 0 0 2.622 2.622C8.56 15 10.24 15 13.6 15H20m0 0-5-5m5 5-5 5"}));Xc.displayName="CornerDownRight";const Yc=({size:n=24,color:e="currentColor",...t})=>O.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},O.createElement("path",{d:"M21 5c0 1.657-4.03 3-9 3S3 6.657 3 5m18 0c0-1.657-4.03-3-9-3S3 3.343 3 5m18 0v14c0 1.66-4 3-9 3s-9-1.34-9-3V5m18 7c0 1.66-4 3-9 3s-9-1.34-9-3"}));Yc.displayName="Database01";const Qc=({size:n=24,color:e="currentColor",...t})=>O.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},O.createElement("path",{d:"m13 22-3-3m0 0 3-3m-3 3h5a7 7 0 0 0 3-13.326M6 18.326A7 7 0 0 1 9 5h5m0 0-3-3m3 3-3 3"}));Qc.displayName="Repeat03";const Ui=({size:n=24,color:e="currentColor",...t})=>O.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},O.createElement("path",{d:"M15 8H8.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C7 7.24 7 6.96 7 6.4V3m10 18v-6.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C16.24 13 15.96 13 15.4 13H8.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C7 13.76 7 14.04 7 14.6V21M21 9.325V16.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h6.875c.489 0 .733 0 .963.055.204.05.4.13.579.24.201.123.374.296.72.642l3.126 3.126c.346.346.519.519.642.72.11.18.19.374.24.579.055.23.055.474.055.963Z"}));Ui.displayName="Save02";const Zc=({size:n=24,color:e="currentColor",...t})=>O.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},O.createElement("path",{d:"M15.631 7.631c-.396-.396-.594-.594-.668-.822a1 1 0 0 1 0-.618c.074-.228.272-.426.668-.822L18.47 2.53a6 6 0 0 0-8.3 6.895c.12.49.179.734.168.888a.849.849 0 0 1-.11.392c-.07.138-.207.274-.48.547L3.5 17.5a2.121 2.121 0 0 0 3 3l6.248-6.248c.273-.273.41-.41.547-.48a.849.849 0 0 1 .392-.11c.154-.011.399.049.888.168a6 6 0 0 0 6.895-8.3l-2.84 2.84c-.396.396-.594.594-.822.668a1 1 0 0 1-.618 0c-.228-.074-.426-.272-.822-.668l-.738-.738Z"}));Zc.displayName="Tool01";const{getOwnPropertyNames:vp,getOwnPropertySymbols:Cp}=Object,{hasOwnProperty:Np}=Object.prototype;function co(n,e){return function(r,s,o){return n(r,s,o)&&e(r,s,o)}}function kr(n){return function(t,r,s){if(!t||!r||typeof t!="object"||typeof r!="object")return n(t,r,s);const{cache:o}=s,i=o.get(t),l=o.get(r);if(i&&l)return i===r&&l===t;o.set(t,r),o.set(r,t);const a=n(t,r,s);return o.delete(t),o.delete(r),a}}function Ep(n){return n?.[Symbol.toStringTag]}function Vl(n){return vp(n).concat(Cp(n))}const Tp=Object.hasOwn||((n,e)=>Np.call(n,e));function Yt(n,e){return n===e||!n&&!e&&n!==n&&e!==e}const Mp="__v",Ap="__o",Op="_owner",{getOwnPropertyDescriptor:Hl,keys:Wl}=Object;function Ip(n,e){return n.byteLength===e.byteLength&&Br(new Uint8Array(n),new Uint8Array(e))}function Rp(n,e,t){let r=n.length;if(e.length!==r)return!1;for(;r-- >0;)if(!t.equals(n[r],e[r],r,r,n,e,t))return!1;return!0}function jp(n,e){return n.byteLength===e.byteLength&&Br(new Uint8Array(n.buffer,n.byteOffset,n.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function Dp(n,e){return Yt(n.getTime(),e.getTime())}function Pp(n,e){return n.name===e.name&&n.message===e.message&&n.cause===e.cause&&n.stack===e.stack}function Lp(n,e){return n===e}function ql(n,e,t){const r=n.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),o=n.entries();let i,l,a=0;for(;(i=o.next())&&!i.done;){const c=e.entries();let d=!1,u=0;for(;(l=c.next())&&!l.done;){if(s[u]){u++;continue}const f=i.value,h=l.value;if(t.equals(f[0],h[0],a,u,n,e,t)&&t.equals(f[1],h[1],f[0],h[0],n,e,t)){d=s[u]=!0;break}u++}if(!d)return!1;a++}return!0}const $p=Yt;function zp(n,e,t){const r=Wl(n);let s=r.length;if(Wl(e).length!==s)return!1;for(;s-- >0;)if(!ed(n,e,t,r[s]))return!1;return!0}function zn(n,e,t){const r=Vl(n);let s=r.length;if(Vl(e).length!==s)return!1;let o,i,l;for(;s-- >0;)if(o=r[s],!ed(n,e,t,o)||(i=Hl(n,o),l=Hl(e,o),(i||l)&&(!i||!l||i.configurable!==l.configurable||i.enumerable!==l.enumerable||i.writable!==l.writable)))return!1;return!0}function _p(n,e){return Yt(n.valueOf(),e.valueOf())}function Bp(n,e){return n.source===e.source&&n.flags===e.flags}function Ul(n,e,t){const r=n.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),o=n.values();let i,l;for(;(i=o.next())&&!i.done;){const a=e.values();let c=!1,d=0;for(;(l=a.next())&&!l.done;){if(!s[d]&&t.equals(i.value,l.value,i.value,l.value,n,e,t)){c=s[d]=!0;break}d++}if(!c)return!1}return!0}function Br(n,e){let t=n.byteLength;if(e.byteLength!==t||n.byteOffset!==e.byteOffset)return!1;for(;t-- >0;)if(n[t]!==e[t])return!1;return!0}function Fp(n,e){return n.hostname===e.hostname&&n.pathname===e.pathname&&n.protocol===e.protocol&&n.port===e.port&&n.hash===e.hash&&n.username===e.username&&n.password===e.password}function ed(n,e,t,r){return(r===Op||r===Ap||r===Mp)&&(n.$$typeof||e.$$typeof)?!0:Tp(e,r)&&t.equals(n[r],e[r],r,r,n,e,t)}const Vp="[object ArrayBuffer]",Hp="[object Arguments]",Wp="[object Boolean]",qp="[object DataView]",Up="[object Date]",Kp="[object Error]",Jp="[object Map]",Gp="[object Number]",Xp="[object Object]",Yp="[object RegExp]",Qp="[object Set]",Zp="[object String]",em={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},tm="[object URL]",nm=Object.prototype.toString;function rm({areArrayBuffersEqual:n,areArraysEqual:e,areDataViewsEqual:t,areDatesEqual:r,areErrorsEqual:s,areFunctionsEqual:o,areMapsEqual:i,areNumbersEqual:l,areObjectsEqual:a,arePrimitiveWrappersEqual:c,areRegExpsEqual:d,areSetsEqual:u,areTypedArraysEqual:f,areUrlsEqual:h,unknownTagComparators:p}){return function(g,x,b){if(g===x)return!0;if(g==null||x==null)return!1;const S=typeof g;if(S!==typeof x)return!1;if(S!=="object")return S==="number"?l(g,x,b):S==="function"?o(g,x,b):!1;const v=g.constructor;if(v!==x.constructor)return!1;if(v===Object)return a(g,x,b);if(Array.isArray(g))return e(g,x,b);if(v===Date)return r(g,x,b);if(v===RegExp)return d(g,x,b);if(v===Map)return i(g,x,b);if(v===Set)return u(g,x,b);const k=nm.call(g);if(k===Up)return r(g,x,b);if(k===Yp)return d(g,x,b);if(k===Jp)return i(g,x,b);if(k===Qp)return u(g,x,b);if(k===Xp)return typeof g.then!="function"&&typeof x.then!="function"&&a(g,x,b);if(k===tm)return h(g,x,b);if(k===Kp)return s(g,x,b);if(k===Hp)return a(g,x,b);if(em[k])return f(g,x,b);if(k===Vp)return n(g,x,b);if(k===qp)return t(g,x,b);if(k===Wp||k===Gp||k===Zp)return c(g,x,b);if(p){let w=p[k];if(!w){const C=Ep(g);C&&(w=p[C])}if(w)return w(g,x,b)}return!1}}function sm({circular:n,createCustomConfig:e,strict:t}){let r={areArrayBuffersEqual:Ip,areArraysEqual:t?zn:Rp,areDataViewsEqual:jp,areDatesEqual:Dp,areErrorsEqual:Pp,areFunctionsEqual:Lp,areMapsEqual:t?co(ql,zn):ql,areNumbersEqual:$p,areObjectsEqual:t?zn:zp,arePrimitiveWrappersEqual:_p,areRegExpsEqual:Bp,areSetsEqual:t?co(Ul,zn):Ul,areTypedArraysEqual:t?co(Br,zn):Br,areUrlsEqual:Fp,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),n){const s=kr(r.areArraysEqual),o=kr(r.areMapsEqual),i=kr(r.areObjectsEqual),l=kr(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:s,areMapsEqual:o,areObjectsEqual:i,areSetsEqual:l})}return r}function om(n){return function(e,t,r,s,o,i,l){return n(e,t,l)}}function im({circular:n,comparator:e,createState:t,equals:r,strict:s}){if(t)return function(l,a){const{cache:c=n?new WeakMap:void 0,meta:d}=t();return e(l,a,{cache:c,equals:r,meta:d,strict:s})};if(n)return function(l,a){return e(l,a,{cache:new WeakMap,equals:r,meta:void 0,strict:s})};const o={cache:void 0,equals:r,meta:void 0,strict:s};return function(l,a){return e(l,a,o)}}const lm=Tt();Tt({strict:!0});Tt({circular:!0});Tt({circular:!0,strict:!0});Tt({createInternalComparator:()=>Yt});Tt({strict:!0,createInternalComparator:()=>Yt});Tt({circular:!0,createInternalComparator:()=>Yt});Tt({circular:!0,createInternalComparator:()=>Yt,strict:!0});function Tt(n={}){const{circular:e=!1,createInternalComparator:t,createState:r,strict:s=!1}=n,o=sm(n),i=rm(o),l=t?t(i):om(i);return im({circular:e,comparator:i,createState:r,equals:l,strict:s})}mh({title:lo().min(1),description:lo().nullable(),body:lo()});function uo(n){for(const e of n.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function am(){const n=window.location.pathname.split("/").filter(Boolean),e=n.findIndex(r=>r==="mcps"),t=e>=0?n[e+1]:void 0;return t?decodeURIComponent(t):void 0}function cm(n){const e=I.c(13),{form:t}=n;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=r):r=e[0];let s;e[1]!==t.control?(s=m.jsxs("div",{className:"flex flex-col gap-4",children:[r,m.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[m.jsx(ao,{control:t.control,name:"title",render:fm}),m.jsx(ao,{control:t.control,name:"description",render:um})]})]}),e[1]=t.control,e[2]=s):s=e[2];let o,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),i=m.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=o,e[4]=i):(o=e[3],i=e[4]);let l;e[5]!==t.control?(l=m.jsxs("div",{className:"flex flex-col gap-2",children:[o,i,m.jsx(ao,{control:t.control,name:"body",render:dm})]}),e[5]=t.control,e[6]=l):l=e[6];let a;e[7]!==s||e[8]!==l?(a=m.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[s,l]}),e[7]=s,e[8]=l,e[9]=a):a=e[9];let c;return e[10]!==t||e[11]!==a?(c=m.jsx(Ph,{...t,children:a}),e[10]=t,e[11]=a,e[12]=c):c=e[12],c}function dm(n){const{field:e}=n;return m.jsx(Ii,{children:m.jsx(Ri,{children:m.jsx(Ho,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function um(n){const{field:e}=n;return m.jsxs(Ii,{children:[m.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),m.jsx(Ri,{children:m.jsx(ji,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function fm(n){const{field:e}=n;return m.jsxs(Ii,{children:[m.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),m.jsx(Ri,{children:m.jsx(ji,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function hm(n){const e=I.c(51),{providerId:t,promptId:r,onBack:s}=n,i=Ci().location.href,l=t||qt;let a;e[0]!==l?(a=qe(l),e[0]=l,e[1]=a):a=e[1];const c=a,d=Mi(t,"PROMPT",r,c),u=Ai(t,"PROMPT",c),f=u.update.isPending;let h;e[2]!==d?(h=d?{title:d.title,description:d.description??null,body:uo(d)}:void 0,e[2]=d,e[3]=h):h=e[3];let p;e[4]!==h?(p={values:h},e[4]=h,e[5]=p):p=e[5];const y=gh(p);let g;e[6]!==y||e[7]!==d?(g=()=>{d&&y.reset({title:d.title,description:d.description??null,body:uo(d)})},e[6]=y,e[7]=d,e[8]=g):g=e[8];const x=g;let b;e[9]!==u.update||e[10]!==y||e[11]!==r?(b=y.handleSubmit(async X=>{const fe=await u.update.mutateAsync({id:r,data:{title:X.title,description:X.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:X.body}}]}});y.reset({title:fe.title,description:fe.description??null,body:uo(fe)})}),e[9]=u.update,e[10]=y,e[11]=r,e[12]=b):b=e[12];const S=b;if(!d){let X;return e[13]===Symbol.for("react.memo_cache_sentinel")?(X=m.jsx("div",{className:"flex h-full w-full bg-background",children:m.jsx(jc,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[13]=X):X=e[13],X}let v;e[14]!==d.title?(v=m.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:d.title}),e[14]=d.title,e[15]=v):v=e[15];let k;e[16]!==d.description?(k=d.description?m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),m.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:d.description})]}):null,e[16]=d.description,e[17]=k):k=e[17];let w;e[18]!==v||e[19]!==k?(w=m.jsx(Lc,{children:m.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[v,k]})}),e[18]=v,e[19]=k,e[20]=w):w=e[20];let C;e[21]!==d.title||e[22]!==i?(C=m.jsx(Oi,{title:d.title,url:i,icon:"description"}),e[21]=d.title,e[22]=i,e[23]=C):C=e[23];const T=!y.formState.isDirty||f;let A;e[24]===Symbol.for("react.memo_cache_sentinel")?(A=m.jsx(Pc,{size:14}),e[24]=A):A=e[24];let D;e[25]!==x||e[26]!==T?(D=m.jsx(Lt,{asChild:!0,children:m.jsx("span",{className:"inline-block",children:m.jsx(me,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:T,onClick:x,"aria-label":"Cancel",children:A})})}),e[25]=x,e[26]=T,e[27]=D):D=e[27];let j;e[28]===Symbol.for("react.memo_cache_sentinel")?(j=m.jsx($t,{side:"bottom",children:"Cancel"}),e[28]=j):j=e[28];let _;e[29]!==D?(_=m.jsx(zt,{children:m.jsxs(_t,{delayDuration:0,children:[D,j]})}),e[29]=D,e[30]=_):_=e[30];const V=!y.formState.isDirty||f;let B;e[31]!==S?(B=()=>{S()},e[31]=S,e[32]=B):B=e[32];let H;e[33]===Symbol.for("react.memo_cache_sentinel")?(H=m.jsx(Ui,{size:14}),e[33]=H):H=e[33];let N;e[34]!==V||e[35]!==B?(N=m.jsx(Lt,{asChild:!0,children:m.jsx("span",{className:"inline-block",children:m.jsx(me,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:V,onClick:B,"aria-label":"Save",children:H})})}),e[34]=V,e[35]=B,e[36]=N):N=e[36];let z;e[37]===Symbol.for("react.memo_cache_sentinel")?(z=m.jsx($t,{side:"bottom",children:"Save"}),e[37]=z):z=e[37];let P;e[38]!==N?(P=m.jsx(zt,{children:m.jsxs(_t,{delayDuration:0,children:[N,z]})}),e[38]=N,e[39]=P):P=e[39];let K;e[40]!==C||e[41]!==_||e[42]!==P?(K=m.jsxs(Di,{children:[C,_,P]}),e[40]=C,e[41]=_,e[42]=P,e[43]=K):K=e[43];let Q;e[44]!==y?(Q=m.jsx("div",{className:"h-full",children:m.jsx(cm,{form:y})}),e[44]=y,e[45]=Q):Q=e[45];let le;return e[46]!==s||e[47]!==K||e[48]!==Q||e[49]!==w?(le=m.jsxs(Sn,{onBack:s,children:[w,K,Q]}),e[46]=s,e[47]=K,e[48]=Q,e[49]=w,e[50]=le):le=e[50],le}function pm(n){const e=I.c(5),{itemId:t,onBack:r}=n;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=am()??qt,e[0]=s):s=e[0];const o=s;if(!o||o===qt){let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=m.jsx("div",{className:"flex h-full w-full bg-background",children:m.jsx(jc,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=l):l=e[1],l}let i;return e[2]!==t||e[3]!==r?(i=m.jsx(Dc,{children:m.jsx(O.Suspense,{fallback:null,children:m.jsx(hm,{providerId:o,promptId:t,onBack:r})})}),e[2]=t,e[3]=r,e[4]=i):i=e[4],i}const mm=yh("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function gm(n){const e=I.c(10);let t,r,s;e[0]!==n?({className:t,variant:s,...r}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=s):(t=e[1],r=e[2],s=e[3]);let o;e[4]!==t||e[5]!==s?(o=U(mm({variant:s}),t),e[4]=t,e[5]=s,e[6]=o):o=e[6];let i;return e[7]!==r||e[8]!==o?(i=m.jsx("div",{"data-slot":"alert",role:"alert",className:o,...r}),e[7]=r,e[8]=o,e[9]=i):i=e[9],i}function ym(n){const e=I.c(8);let t,r;e[0]!==n?({className:t,...r}=n,e[0]=n,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=U("line-clamp-1 min-h-4 font-medium tracking-tight",t),e[3]=t,e[4]=s):s=e[4];let o;return e[5]!==r||e[6]!==s?(o=m.jsx("div",{"data-slot":"alert-title",className:s,...r}),e[5]=r,e[6]=s,e[7]=o):o=e[7],o}function xm(n){const e=I.c(8);let t,r;e[0]!==n?({className:t,...r}=n,e[0]=n,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=U("text-muted-foreground leading-relaxed",t),e[3]=t,e[4]=s):s=e[4];let o;return e[5]!==r||e[6]!==s?(o=m.jsx("div",{"data-slot":"alert-description",className:s,...r}),e[5]=r,e[6]=s,e[7]=o):o=e[7],o}const bm=n=>n.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function km(n){const e=I.c(13),{toolName:t,connectionId:r,onBack:s}=n,o=`/mcp/${r}`;let i;e[0]!==o?(i=new URL(o,window.location.origin),e[0]=o,e[1]=i):i=e[1];const l=i;let a;e[2]!==r?(a={connectionId:r},e[2]=r,e[3]=a):a=e[3];const c=Vh(a);if(!c.isAuthenticated){let f;return e[4]!==c.supportsOAuth||e[5]!==s?(f=m.jsx("div",{className:"flex h-full items-center justify-center",children:c.supportsOAuth?m.jsx(Hh,{onAuthenticate:()=>s(),buttonText:"Go back to authenticate"}):m.jsx(Wh,{hasReadme:!1})}),e[4]=c.supportsOAuth,e[5]=s,e[6]=f):f=e[6],f}const d=`${r}:${t}`;let u;return e[7]!==r||e[8]!==l||e[9]!==s||e[10]!==d||e[11]!==t?(u=m.jsx(Sm,{toolName:t,connectionId:r,mcpProxyUrl:l,onBack:s},d),e[7]=r,e[8]=l,e[9]=s,e[10]=d,e[11]=t,e[12]=u):u=e[12],u}function Sm({toolName:n,connectionId:e,mcpProxyUrl:t,onBack:r}){const o=Ci().location.href,{replayId:i}=xh({strict:!1}),l=(()=>{if(!i)return null;const N=`replay-${i}`,z=sessionStorage.getItem(N);if(!z)return null;sessionStorage.removeItem(N);try{return JSON.parse(z)}catch{return null}})(),a=(()=>{if(!l)return null;const N={};for(const[z,P]of Object.entries(l))P!==null&&typeof P=="object"?N[z]=JSON.stringify(P,null,2):N[z]=P;return N})(),[c,d]=O.useState(a??{}),[u,f]=O.useState(l?JSON.stringify(l,null,2):"{}"),[h,p]=O.useState(null),[y,g]=O.useState(null),[x,b]=O.useState(!1),[S,v]=O.useState(null),k=Pi(e),w=zi({url:t.href});O.useEffect(()=>{w.error&&console.error("MCP Error:",w.error)},[w.error]);const C=w.tools?.find(N=>N.name===n),T=C?.inputSchema?.properties,A=T?Object.keys(T):[],D=A.length>0,j={};if(D&&C?.inputSchema?.properties)for(const N of A)j[N]=C.inputSchema.required?.includes(N)?"":void 0;const _=N=>Object.prototype.hasOwnProperty.call(c,N),V=async()=>{b(!0),g(null),p(null),v(null);const N=performance.now(),z=qe(e);try{const P=D?{...j,...c}:(()=>{const se=u.trim();if(!se)return{};const J=JSON.parse(se);if(J&&typeof J=="object")return J;throw new Error("Raw JSON input must be an object.")})();D&&C?.inputSchema?.properties&&Object.entries(C.inputSchema.properties).forEach(([se,J])=>{if((J.type==="object"||J.type==="array")&&typeof P[se]=="string")try{P[se]=JSON.parse(P[se])}catch{}});const K=await z(n,P),Q=performance.now(),le=Math.round(Q-N);p(K);const X=JSON.stringify(K),fe=new TextEncoder().encode(X).length;v({duration:`${le}ms`,bytes:`${fe} bytes`,tokens:`~${Math.ceil(fe/4)} tokens`,cost:"$0.0000"})}catch(P){const K=P instanceof Error?P.message:String(P);g(K||"Unknown error occurred");const Q=performance.now();v({duration:`${Math.round(Q-N)}ms`})}finally{b(!1)}},B=(N,z)=>{d(P=>({...P,[N]:z}))},H=()=>{p(null),g(null),v(null)};return m.jsxs(Sn,{onBack:r,children:[m.jsx(Di,{children:m.jsx(Oi,{title:C?.name??bm(n),url:o,icon:"build"})}),m.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 h-full",children:[m.jsx("div",{className:"flex flex-col border-r border-border overflow-hidden",children:m.jsxs("div",{className:"flex-1 overflow-auto",children:[m.jsx("div",{className:"flex flex-col gap-4 p-6 border-b border-border min-h-28",children:m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx(js,{icon:k?.icon||null,name:k?.title||n,size:"sm",className:"shadow-sm shrink-0"}),m.jsx("h1",{className:"text-lg font-medium text-foreground leading-none",children:n}),m.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit",children:[w.state==="ready"?m.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):w.state==="connecting"?m.jsx(tr,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):m.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),m.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:w.state.replace("_"," ")})]})]}),m.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:C?.description||"No description available"})]})}),m.jsxs("div",{className:"flex flex-col p-6 gap-4",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),C?.inputSchema?.required&&C.inputSchema.required.length>0&&m.jsxs("span",{className:"text-xs text-muted-foreground",children:[m.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),m.jsx("div",{className:"space-y-4",children:D&&C?.inputSchema?.properties?Object.entries(C.inputSchema.properties).map(([N,z])=>m.jsxs("div",{className:"space-y-2",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[N,C.inputSchema?.required?.includes(N)&&m.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),m.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:z.type})]}),z.description&&m.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:z.description}),z.type==="object"||z.type==="array"?m.jsx(Ho,{className:"font-mono text-xs",value:_(N)?c[N]??"":j[N]??"",onChange:P=>B(N,P.target.value),placeholder:`Enter ${N} as JSON...`,rows:3}):m.jsx(ji,{value:_(N)?c[N]??"":j[N]??"",onChange:P=>B(N,P.target.value),placeholder:`Enter ${N}...`})]},N)):C?.inputSchema&&!D?m.jsxs("div",{className:"space-y-2",children:[m.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),m.jsx(Ho,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:N=>f(N.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):m.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:m.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})})]})]})}),m.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[m.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-t lg:border-t-0 border-b border-border bg-background",children:[m.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),S&&m.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(zh,{className:"h-3 w-3 text-muted-foreground"}),m.jsx("span",{className:"font-mono text-foreground",children:S.duration})]}),S.tokens&&m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(Kc,{className:"h-3 w-3 text-muted-foreground"}),m.jsx("span",{className:"font-mono text-foreground",children:S.tokens})]}),S.bytes&&m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(Yc,{className:"h-3 w-3 text-muted-foreground"}),m.jsx("span",{className:"font-mono text-foreground",children:S.bytes})]}),S.cost&&m.jsx("div",{className:"flex items-center gap-1.5",children:m.jsx("span",{className:"font-mono text-foreground",children:S.cost})})]})]}),m.jsx("div",{className:"flex items-center justify-end lg:justify-between px-4 h-14 border-b border-border bg-background",children:m.jsxs("div",{className:"flex items-center gap-2 w-full lg:w-auto",children:[m.jsx(me,{size:"sm",variant:"default",className:"h-8 gap-2 flex-1 lg:flex-none",onClick:V,disabled:x,children:x?m.jsxs(m.Fragment,{children:[m.jsx(tr,{size:14,className:"animate-spin"}),"Executing..."]}):m.jsxs(m.Fragment,{children:[m.jsx(Li,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})}),m.jsx(zt,{children:m.jsxs(_t,{children:[m.jsx(Lt,{asChild:!0,children:m.jsx(me,{size:"icon",variant:"outline",className:"h-8 w-8 shrink-0",onClick:H,disabled:!h&&!y,children:m.jsx($i,{size:14})})}),m.jsx($t,{children:m.jsx("p",{children:"Clear results"})})]})})]})}),y&&m.jsx("div",{className:"px-6 py-4 bg-background",children:m.jsx(gm,{variant:"destructive",children:m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx($h,{className:"h-4 w-4"}),m.jsx(ym,{className:"mb-0",children:"Execution Failed"})]}),m.jsx(xm,{className:"text-xs text-destructive",children:y})]})})}),m.jsx("div",{className:"relative flex-1 overflow-auto bg-muted/50",children:h?m.jsxs(m.Fragment,{children:[m.jsx(On,{code:JSON.stringify(h,null,2),language:"json",height:"100%",readOnly:!0}),m.jsx(me,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(h,null,2)),Ec.success("Copied to clipboard")},children:m.jsx(Bh,{className:"h-3.5 w-3.5"})})]}):m.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[m.jsx(_h,{className:"h-12 w-12 mb-3 opacity-40"}),m.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]})]})]})}function wm(n){const e=I.c(7),{itemId:t,onBack:r}=n;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},e[0]=s):s=e[0];const i=Et(s).connectionId??qt;if(!Pi(i)){let d;return e[1]===Symbol.for("react.memo_cache_sentinel")?(d=m.jsx("div",{className:"flex h-full items-center justify-center",children:m.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[m.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),m.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[1]=d):d=e[1],d}let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx("div",{className:"flex h-full items-center justify-center",children:m.jsx(tr,{size:32,className:"animate-spin text-muted-foreground"})}),e[2]=a):a=e[2];let c;return e[3]!==i||e[4]!==r||e[5]!==t?(c=m.jsx(O.Suspense,{fallback:a,children:m.jsx(km,{toolName:t,connectionId:i,onBack:r})}),e[3]=i,e[4]=r,e[5]=t,e[6]=c):c=e[6],c}const Kl=n=>{let e;const t=new Set,r=(c,d)=>{const u=typeof c=="function"?c(e):c;if(!Object.is(u,e)){const f=e;e=d??(typeof u!="object"||u===null)?u:Object.assign({},e,u),t.forEach(h=>h(e,f))}},s=()=>e,l={setState:r,getState:s,getInitialState:()=>a,subscribe:c=>(t.add(c),()=>t.delete(c))},a=e=n(r,s,l);return l},Ki=(n=>n?Kl(n):Kl),vm=n=>n;function Wo(n,e=vm){const t=ee.useSyncExternalStore(n.subscribe,ee.useCallback(()=>e(n.getState()),[n,e]),ee.useCallback(()=>e(n.getInitialState()),[n,e]));return ee.useDebugValue(t),t}const Cm=n=>{const e=Ki(n),t=r=>Wo(e,r);return Object.assign(t,e),t},Nm=(n=>Cm);function td(n,e){let t;try{t=n()}catch{return}return{getItem:s=>{var o;const i=a=>a===null?null:JSON.parse(a,void 0),l=(o=t.getItem(s))!=null?o:null;return l instanceof Promise?l.then(i):i(l)},setItem:(s,o)=>t.setItem(s,JSON.stringify(o,void 0)),removeItem:s=>t.removeItem(s)}}const qo=n=>e=>{try{const t=n(e);return t instanceof Promise?t:{then(r){return qo(r)(t)},catch(r){return this}}}catch(t){return{then(r){return this},catch(r){return qo(r)(t)}}}},Em=(n,e)=>(t,r,s)=>{let o={storage:td(()=>localStorage),partialize:g=>g,version:0,merge:(g,x)=>({...x,...g}),...e},i=!1,l=0;const a=new Set,c=new Set;let d=o.storage;if(!d)return n((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),t(...g)},r,s);const u=()=>{const g=o.partialize({...r()});return d.setItem(o.name,{state:g,version:o.version})},f=s.setState;s.setState=(g,x)=>(f(g,x),u());const h=n((...g)=>(t(...g),u()),r,s);s.getInitialState=()=>h;let p;const y=()=>{var g,x;if(!d)return;const b=++l;i=!1,a.forEach(v=>{var k;return v((k=r())!=null?k:h)});const S=((x=o.onRehydrateStorage)==null?void 0:x.call(o,(g=r())!=null?g:h))||void 0;return qo(d.getItem.bind(d))(o.name).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==o.version){if(o.migrate){const k=o.migrate(v.state,v.version);return k instanceof Promise?k.then(w=>[!0,w]):[!0,k]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,v.state];return[!1,void 0]}).then(v=>{var k;if(b!==l)return;const[w,C]=v;if(p=o.merge(C,(k=r())!=null?k:h),t(p,!0),w)return u()}).then(()=>{b===l&&(S?.(p,void 0),p=r(),i=!0,c.forEach(v=>v(p)))}).catch(v=>{b===l&&S?.(void 0,v)})};return s.persist={setOptions:g=>{o={...o,...g},g.storage&&(d=g.storage)},clearStorage:()=>{d?.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>y(),hasHydrated:()=>i,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(c.add(g),()=>{c.delete(g)})},o.skipHydration||y(),p||h},nd=Em,{useSyncExternalStoreWithSelector:Tm}=bh,Mm=n=>n;function Am(n,e=Mm,t){const r=Tm(n.subscribe,n.getState,n.getInitialState,e,t);return ee.useDebugValue(r),r}const Jl=n=>Symbol.iterator in n,Gl=n=>"entries"in n,Xl=(n,e)=>{const t=n instanceof Map?n:new Map(n.entries()),r=e instanceof Map?e:new Map(e.entries());if(t.size!==r.size)return!1;for(const[s,o]of t)if(!r.has(s)||!Object.is(o,r.get(s)))return!1;return!0},Om=(n,e)=>{const t=n[Symbol.iterator](),r=e[Symbol.iterator]();let s=t.next(),o=r.next();for(;!s.done&&!o.done;){if(!Object.is(s.value,o.value))return!1;s=t.next(),o=r.next()}return!!s.done&&!!o.done};function Im(n,e){return Object.is(n,e)?!0:typeof n!="object"||n===null||typeof e!="object"||e===null||Object.getPrototypeOf(n)!==Object.getPrototypeOf(e)?!1:Jl(n)&&Jl(e)?Gl(n)&&Gl(e)?Xl(n,e):Om(n,e):Xl({entries:()=>Object.entries(n)},{entries:()=>Object.entries(e)})}function Rm(n,e="Output"){if(!n)return`interface ${e} {}`;function t(o){if(!o||typeof o!="object")return"unknown";const i=o.type;if(Array.isArray(i))return i.map(l=>r(l)).join(" | ");switch(i){case"string":return o.enum?o.enum.map(l=>`"${l}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const l=o.items;return l?`${t(l)}[]`:"unknown[]"}case"object":return s(o);default:return o.anyOf?o.anyOf.map(t).join(" | "):o.oneOf?o.oneOf.map(t).join(" | "):o.allOf?o.allOf.map(t).join(" & "):"unknown"}}function r(o){switch(o){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function s(o){const i=o.properties;if(!i)return"Record<string, unknown>";const l=new Set(o.required||[]);return`{
1
+ import{ag as We,r as O,y as mh,z as lo,c as I,j as m,k as Ci,E as gh,h as yh,d as Et,b as xh,t as Ec,H as ee,F as bh,ah as Tc,$ as kh,Z as Sh,ai as wh,a5 as Mc,aj as Ac,ak as vh,a6 as Ni,a8 as Ge,a7 as Oc,al as Ch,aa as Ei,am as Nh,a3 as Ic,an as Eh,ao as Th,ap as Mh,aq as Ti,ar as Ah,as as Oh,at as Ih,a4 as Rh,au as jh,af as Rc}from"./index-Diww4UW3.js";import{U as qt,c as qe}from"./connection-ChwHK0-S.js";import{E as jc,I as js,n as Dh}from"./empty-state-wP9uukGJ.js";import{E as Dc}from"./error-boundary-BUvK8Sry.js";import{u as Mi,a as Ai}from"./use-collections-CXETocKO.js";import{P as Oi}from"./pin-to-sidebar-button-DIwkO0Tx.js";import{B as me,c as U}from"./button-CGmrzkpY.js";import{F as ao,a as Ph,b as Ii,d as Ri}from"./form-DiGzBnRK.js";import{I as ji}from"./input-CrURMEZe.js";import{T as Ho}from"./textarea-C_zgj3Sp.js";import{b as Lt,T as $t,a as zt,c as _t}from"./tooltip-Suu_Gpqh.js";import{i as Pc}from"./FlipBackward-C-K9FamE.js";import{a as Lc,V as Di,b as Sn}from"./layout-kp8TTJc9.js";import{b as Pi,u as Lh}from"./use-connection-CCXutWLD.js";import{i as $h}from"./AlertCircle-CI2U-jkN.js";import{s as zh,M as On}from"./monaco-editor-CDRbE4GY.js";import{i as _h}from"./Code01-qXTn9GK9.js";import{a as Bh}from"./Copy01-CEYn2daS.js";import{i as tr}from"./Loading01-Ae5ezbtD.js";import{i as Li,n as Fh}from"./Play-DKlNHVjf.js";import{s as $i}from"./XClose-CfwoKknl.js";import{u as Vh,O as Hh,M as Wh,F as qh,v as Uh}from"./index-DjRWdLI4.js";import{u as zi}from"./use-mcp-D9llr83X.js";import{E as _i}from"./empty-state-BkAB-hls.js";import{D as Kh,b as Jh}from"./use-binding-D6wv_5fO.js";import{u as Gh}from"./use-gateway-DD-xEZju.js";import{b as Xh,R as Bl,a as Yh}from"./resizable-Gk1RjNnW.js";import{a as Qh,b as Zh,c as $c,R as ep,d as tp,T as np}from"./index-CL_rL7XJ.js";import{d as rp,b as sp,a as op,c as ip,S as lp}from"./select-C8LOz7vA.js";import{S as Ds}from"./spinner-BF56RAKQ.js";import{V as ap}from"./view-mode-toggle-BLClM-0g.js";import{i as cp}from"./GitBranch01-DGTCzEh5.js";import{a as Bi,b as Fi}from"./use-tool-call-BmvKn7jp.js";import"./project-context-provider-DulCVL2k.js";import{a as dp,D as up,g as fp,f as hp,c as pp,d as mp}from"./dialog-DJJ2cvEE.js";import"./index-D4QCsSzb.js";import{s as zc}from"./Plus-CdG75X26.js";import{i as Vi}from"./Check-BQkm1TiP.js";import{i as gp}from"./DotsHorizontal-C2Nr-D-f.js";import{b as yp,D as xp,a as bp,c as Fl}from"./dropdown-menu-CAeD2aIb.js";import{i as kp}from"./Grid01-D4lXvveX.js";import{B as un}from"./badge-BVO6I0sW.js";import{i as _c}from"./X-C18ho617.js";import"./useMutation-Dl1MMkEC.js";import"./use-organization-settings-CQXtXtZs.js";import"./ArrowLeft-B3km7toT.js";import"./mcp-oauth-CdcIczUJ.js";import"./env-vars-editor-DuH6BBdA.js";import"./Trash01-BWIN9RL_.js";import"./File06-KMD38I-q.js";import"./Key01-DTwk4FpG.js";import"./extract-connection-data-BLs0SRok.js";import"./constants-J0aH6mLs.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-8Lvx2XTy.js";import"./generate-id-Dyweu44Y.js";import"./Terminal-C6mZx-5A.js";import"./index-DUA-vRuy.js";import"./useQuery-Bvk0U2ed.js";import"./binder-By0LBK9Y.js";import"./popover-Bx7diZ86.js";import"./ArrowUp-BF7mM4C2.js";import"./ChevronDown-DP6jvip7.js";import"./Edit01-Cq0mQDLh.js";import"./use-gateway-system-prompt-zGJSEzce.js";import"./localstorage-keys-BVANkONM.js";import"./SearchMd-GFaonOaJ.js";import"./use-create-gateway-BlLsktgc.js";import"./Image01-C0R6SF_P.js";import"./alert-dialog-CCJCsKzK.js";import"./well-known-mcp-DOEdYmKO.js";const Bc=We("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const Fc=We("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const Hi=We("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const Wi=We("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const Sp=We("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const wp=We("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const Vc=We("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const Hc=We("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const Wc=We("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const qc=We("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const Uc=We("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]),qi=({size:n=24,color:e="currentColor",...t})=>O.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},O.createElement("path",{d:"M12 8v4m0 4h.01M2 8.523v6.954c0 .245 0 .367.028.482a1 1 0 0 0 .12.29c.061.1.148.187.32.36l4.923 4.922c.173.173.26.26.36.322.09.054.188.095.29.12.115.027.237.027.482.027h6.954c.245 0 .367 0 .482-.028a.998.998 0 0 0 .29-.12c.1-.061.187-.148.36-.32l4.922-4.923c.173-.173.26-.26.322-.36a.998.998 0 0 0 .12-.29c.027-.115.027-.237.027-.482V8.523c0-.245 0-.367-.028-.482a.998.998 0 0 0-.12-.29c-.061-.1-.148-.187-.32-.36L16.608 2.47c-.173-.173-.26-.26-.36-.322a1 1 0 0 0-.29-.12C15.844 2 15.722 2 15.477 2H8.523c-.245 0-.367 0-.482.028a1 1 0 0 0-.29.12c-.1.061-.187.148-.36.32L2.47 7.392c-.173.173-.26.26-.322.36a1 1 0 0 0-.12.29C2 8.156 2 8.278 2 8.523Z"}));qi.displayName="AlertOctagon";const Kc=({size:n=24,color:e="currentColor",...t})=>O.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},O.createElement("path",{d:"M20.5 8v8.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.22 21 17.38 21 15.7 21H8.3c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3.5 18.72 3.5 17.88 3.5 16.2V8m.1-5h16.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C22 3.76 22 4.04 22 4.6v1.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C21.24 8 20.96 8 20.4 8H3.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C2 7.24 2 6.96 2 6.4V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C2.76 3 3.04 3 3.6 3Zm6 8.5h4.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C16 12.26 16 12.54 16 13.1v.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437c-.214.109-.494.109-1.054.109H9.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C8 14.74 8 14.46 8 13.9v-.8c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C8.76 11.5 9.04 11.5 9.6 11.5Z"}));Kc.displayName="Box";const Jc=({size:n=24,color:e="currentColor",...t})=>O.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},O.createElement("path",{d:"m22.7 11.5-2 2-2-2m2.245 1.5A9 9 0 1 0 19 17.657M12 7v5l3 2"}));Jc.displayName="ClockFastForward";const Gc=({size:n=24,color:e="currentColor",...t})=>O.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},O.createElement("path",{d:"m17 17 5-5-5-5M7 7l-5 5 5 5m7-14-4 18"}));Gc.displayName="Code02";const jr=({size:n=24,color:e="currentColor",...t})=>O.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},O.createElement("path",{d:"M6.8 3h-.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C3 4.52 3 5.08 3 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21h.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C10 19.48 10 18.92 10 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C8.48 3 7.92 3 6.8 3Zm11 0h-.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C14 4.52 14 5.08 14 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C15.52 21 16.08 21 17.2 21h.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C19.48 3 18.92 3 17.8 3Z"}));jr.displayName="Columns01";const Xc=({size:n=24,color:e="currentColor",...t})=>O.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},O.createElement("path",{d:"M4 4v1.4c0 3.36 0 5.04.654 6.324a6 6 0 0 0 2.622 2.622C8.56 15 10.24 15 13.6 15H20m0 0-5-5m5 5-5 5"}));Xc.displayName="CornerDownRight";const Yc=({size:n=24,color:e="currentColor",...t})=>O.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},O.createElement("path",{d:"M21 5c0 1.657-4.03 3-9 3S3 6.657 3 5m18 0c0-1.657-4.03-3-9-3S3 3.343 3 5m18 0v14c0 1.66-4 3-9 3s-9-1.34-9-3V5m18 7c0 1.66-4 3-9 3s-9-1.34-9-3"}));Yc.displayName="Database01";const Qc=({size:n=24,color:e="currentColor",...t})=>O.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},O.createElement("path",{d:"m13 22-3-3m0 0 3-3m-3 3h5a7 7 0 0 0 3-13.326M6 18.326A7 7 0 0 1 9 5h5m0 0-3-3m3 3-3 3"}));Qc.displayName="Repeat03";const Ui=({size:n=24,color:e="currentColor",...t})=>O.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},O.createElement("path",{d:"M15 8H8.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C7 7.24 7 6.96 7 6.4V3m10 18v-6.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C16.24 13 15.96 13 15.4 13H8.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C7 13.76 7 14.04 7 14.6V21M21 9.325V16.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h6.875c.489 0 .733 0 .963.055.204.05.4.13.579.24.201.123.374.296.72.642l3.126 3.126c.346.346.519.519.642.72.11.18.19.374.24.579.055.23.055.474.055.963Z"}));Ui.displayName="Save02";const Zc=({size:n=24,color:e="currentColor",...t})=>O.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},O.createElement("path",{d:"M15.631 7.631c-.396-.396-.594-.594-.668-.822a1 1 0 0 1 0-.618c.074-.228.272-.426.668-.822L18.47 2.53a6 6 0 0 0-8.3 6.895c.12.49.179.734.168.888a.849.849 0 0 1-.11.392c-.07.138-.207.274-.48.547L3.5 17.5a2.121 2.121 0 0 0 3 3l6.248-6.248c.273-.273.41-.41.547-.48a.849.849 0 0 1 .392-.11c.154-.011.399.049.888.168a6 6 0 0 0 6.895-8.3l-2.84 2.84c-.396.396-.594.594-.822.668a1 1 0 0 1-.618 0c-.228-.074-.426-.272-.822-.668l-.738-.738Z"}));Zc.displayName="Tool01";const{getOwnPropertyNames:vp,getOwnPropertySymbols:Cp}=Object,{hasOwnProperty:Np}=Object.prototype;function co(n,e){return function(r,s,o){return n(r,s,o)&&e(r,s,o)}}function kr(n){return function(t,r,s){if(!t||!r||typeof t!="object"||typeof r!="object")return n(t,r,s);const{cache:o}=s,i=o.get(t),l=o.get(r);if(i&&l)return i===r&&l===t;o.set(t,r),o.set(r,t);const a=n(t,r,s);return o.delete(t),o.delete(r),a}}function Ep(n){return n?.[Symbol.toStringTag]}function Vl(n){return vp(n).concat(Cp(n))}const Tp=Object.hasOwn||((n,e)=>Np.call(n,e));function Yt(n,e){return n===e||!n&&!e&&n!==n&&e!==e}const Mp="__v",Ap="__o",Op="_owner",{getOwnPropertyDescriptor:Hl,keys:Wl}=Object;function Ip(n,e){return n.byteLength===e.byteLength&&Br(new Uint8Array(n),new Uint8Array(e))}function Rp(n,e,t){let r=n.length;if(e.length!==r)return!1;for(;r-- >0;)if(!t.equals(n[r],e[r],r,r,n,e,t))return!1;return!0}function jp(n,e){return n.byteLength===e.byteLength&&Br(new Uint8Array(n.buffer,n.byteOffset,n.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function Dp(n,e){return Yt(n.getTime(),e.getTime())}function Pp(n,e){return n.name===e.name&&n.message===e.message&&n.cause===e.cause&&n.stack===e.stack}function Lp(n,e){return n===e}function ql(n,e,t){const r=n.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),o=n.entries();let i,l,a=0;for(;(i=o.next())&&!i.done;){const c=e.entries();let d=!1,u=0;for(;(l=c.next())&&!l.done;){if(s[u]){u++;continue}const f=i.value,h=l.value;if(t.equals(f[0],h[0],a,u,n,e,t)&&t.equals(f[1],h[1],f[0],h[0],n,e,t)){d=s[u]=!0;break}u++}if(!d)return!1;a++}return!0}const $p=Yt;function zp(n,e,t){const r=Wl(n);let s=r.length;if(Wl(e).length!==s)return!1;for(;s-- >0;)if(!ed(n,e,t,r[s]))return!1;return!0}function zn(n,e,t){const r=Vl(n);let s=r.length;if(Vl(e).length!==s)return!1;let o,i,l;for(;s-- >0;)if(o=r[s],!ed(n,e,t,o)||(i=Hl(n,o),l=Hl(e,o),(i||l)&&(!i||!l||i.configurable!==l.configurable||i.enumerable!==l.enumerable||i.writable!==l.writable)))return!1;return!0}function _p(n,e){return Yt(n.valueOf(),e.valueOf())}function Bp(n,e){return n.source===e.source&&n.flags===e.flags}function Ul(n,e,t){const r=n.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),o=n.values();let i,l;for(;(i=o.next())&&!i.done;){const a=e.values();let c=!1,d=0;for(;(l=a.next())&&!l.done;){if(!s[d]&&t.equals(i.value,l.value,i.value,l.value,n,e,t)){c=s[d]=!0;break}d++}if(!c)return!1}return!0}function Br(n,e){let t=n.byteLength;if(e.byteLength!==t||n.byteOffset!==e.byteOffset)return!1;for(;t-- >0;)if(n[t]!==e[t])return!1;return!0}function Fp(n,e){return n.hostname===e.hostname&&n.pathname===e.pathname&&n.protocol===e.protocol&&n.port===e.port&&n.hash===e.hash&&n.username===e.username&&n.password===e.password}function ed(n,e,t,r){return(r===Op||r===Ap||r===Mp)&&(n.$$typeof||e.$$typeof)?!0:Tp(e,r)&&t.equals(n[r],e[r],r,r,n,e,t)}const Vp="[object ArrayBuffer]",Hp="[object Arguments]",Wp="[object Boolean]",qp="[object DataView]",Up="[object Date]",Kp="[object Error]",Jp="[object Map]",Gp="[object Number]",Xp="[object Object]",Yp="[object RegExp]",Qp="[object Set]",Zp="[object String]",em={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},tm="[object URL]",nm=Object.prototype.toString;function rm({areArrayBuffersEqual:n,areArraysEqual:e,areDataViewsEqual:t,areDatesEqual:r,areErrorsEqual:s,areFunctionsEqual:o,areMapsEqual:i,areNumbersEqual:l,areObjectsEqual:a,arePrimitiveWrappersEqual:c,areRegExpsEqual:d,areSetsEqual:u,areTypedArraysEqual:f,areUrlsEqual:h,unknownTagComparators:p}){return function(g,x,b){if(g===x)return!0;if(g==null||x==null)return!1;const S=typeof g;if(S!==typeof x)return!1;if(S!=="object")return S==="number"?l(g,x,b):S==="function"?o(g,x,b):!1;const v=g.constructor;if(v!==x.constructor)return!1;if(v===Object)return a(g,x,b);if(Array.isArray(g))return e(g,x,b);if(v===Date)return r(g,x,b);if(v===RegExp)return d(g,x,b);if(v===Map)return i(g,x,b);if(v===Set)return u(g,x,b);const k=nm.call(g);if(k===Up)return r(g,x,b);if(k===Yp)return d(g,x,b);if(k===Jp)return i(g,x,b);if(k===Qp)return u(g,x,b);if(k===Xp)return typeof g.then!="function"&&typeof x.then!="function"&&a(g,x,b);if(k===tm)return h(g,x,b);if(k===Kp)return s(g,x,b);if(k===Hp)return a(g,x,b);if(em[k])return f(g,x,b);if(k===Vp)return n(g,x,b);if(k===qp)return t(g,x,b);if(k===Wp||k===Gp||k===Zp)return c(g,x,b);if(p){let w=p[k];if(!w){const C=Ep(g);C&&(w=p[C])}if(w)return w(g,x,b)}return!1}}function sm({circular:n,createCustomConfig:e,strict:t}){let r={areArrayBuffersEqual:Ip,areArraysEqual:t?zn:Rp,areDataViewsEqual:jp,areDatesEqual:Dp,areErrorsEqual:Pp,areFunctionsEqual:Lp,areMapsEqual:t?co(ql,zn):ql,areNumbersEqual:$p,areObjectsEqual:t?zn:zp,arePrimitiveWrappersEqual:_p,areRegExpsEqual:Bp,areSetsEqual:t?co(Ul,zn):Ul,areTypedArraysEqual:t?co(Br,zn):Br,areUrlsEqual:Fp,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),n){const s=kr(r.areArraysEqual),o=kr(r.areMapsEqual),i=kr(r.areObjectsEqual),l=kr(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:s,areMapsEqual:o,areObjectsEqual:i,areSetsEqual:l})}return r}function om(n){return function(e,t,r,s,o,i,l){return n(e,t,l)}}function im({circular:n,comparator:e,createState:t,equals:r,strict:s}){if(t)return function(l,a){const{cache:c=n?new WeakMap:void 0,meta:d}=t();return e(l,a,{cache:c,equals:r,meta:d,strict:s})};if(n)return function(l,a){return e(l,a,{cache:new WeakMap,equals:r,meta:void 0,strict:s})};const o={cache:void 0,equals:r,meta:void 0,strict:s};return function(l,a){return e(l,a,o)}}const lm=Tt();Tt({strict:!0});Tt({circular:!0});Tt({circular:!0,strict:!0});Tt({createInternalComparator:()=>Yt});Tt({strict:!0,createInternalComparator:()=>Yt});Tt({circular:!0,createInternalComparator:()=>Yt});Tt({circular:!0,createInternalComparator:()=>Yt,strict:!0});function Tt(n={}){const{circular:e=!1,createInternalComparator:t,createState:r,strict:s=!1}=n,o=sm(n),i=rm(o),l=t?t(i):om(i);return im({circular:e,comparator:i,createState:r,equals:l,strict:s})}mh({title:lo().min(1),description:lo().nullable(),body:lo()});function uo(n){for(const e of n.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function am(){const n=window.location.pathname.split("/").filter(Boolean),e=n.findIndex(r=>r==="mcps"),t=e>=0?n[e+1]:void 0;return t?decodeURIComponent(t):void 0}function cm(n){const e=I.c(13),{form:t}=n;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=r):r=e[0];let s;e[1]!==t.control?(s=m.jsxs("div",{className:"flex flex-col gap-4",children:[r,m.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[m.jsx(ao,{control:t.control,name:"title",render:fm}),m.jsx(ao,{control:t.control,name:"description",render:um})]})]}),e[1]=t.control,e[2]=s):s=e[2];let o,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),i=m.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=o,e[4]=i):(o=e[3],i=e[4]);let l;e[5]!==t.control?(l=m.jsxs("div",{className:"flex flex-col gap-2",children:[o,i,m.jsx(ao,{control:t.control,name:"body",render:dm})]}),e[5]=t.control,e[6]=l):l=e[6];let a;e[7]!==s||e[8]!==l?(a=m.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[s,l]}),e[7]=s,e[8]=l,e[9]=a):a=e[9];let c;return e[10]!==t||e[11]!==a?(c=m.jsx(Ph,{...t,children:a}),e[10]=t,e[11]=a,e[12]=c):c=e[12],c}function dm(n){const{field:e}=n;return m.jsx(Ii,{children:m.jsx(Ri,{children:m.jsx(Ho,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function um(n){const{field:e}=n;return m.jsxs(Ii,{children:[m.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),m.jsx(Ri,{children:m.jsx(ji,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function fm(n){const{field:e}=n;return m.jsxs(Ii,{children:[m.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),m.jsx(Ri,{children:m.jsx(ji,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function hm(n){const e=I.c(51),{providerId:t,promptId:r,onBack:s}=n,i=Ci().location.href,l=t||qt;let a;e[0]!==l?(a=qe(l),e[0]=l,e[1]=a):a=e[1];const c=a,d=Mi(t,"PROMPT",r,c),u=Ai(t,"PROMPT",c),f=u.update.isPending;let h;e[2]!==d?(h=d?{title:d.title,description:d.description??null,body:uo(d)}:void 0,e[2]=d,e[3]=h):h=e[3];let p;e[4]!==h?(p={values:h},e[4]=h,e[5]=p):p=e[5];const y=gh(p);let g;e[6]!==y||e[7]!==d?(g=()=>{d&&y.reset({title:d.title,description:d.description??null,body:uo(d)})},e[6]=y,e[7]=d,e[8]=g):g=e[8];const x=g;let b;e[9]!==u.update||e[10]!==y||e[11]!==r?(b=y.handleSubmit(async X=>{const fe=await u.update.mutateAsync({id:r,data:{title:X.title,description:X.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:X.body}}]}});y.reset({title:fe.title,description:fe.description??null,body:uo(fe)})}),e[9]=u.update,e[10]=y,e[11]=r,e[12]=b):b=e[12];const S=b;if(!d){let X;return e[13]===Symbol.for("react.memo_cache_sentinel")?(X=m.jsx("div",{className:"flex h-full w-full bg-background",children:m.jsx(jc,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[13]=X):X=e[13],X}let v;e[14]!==d.title?(v=m.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:d.title}),e[14]=d.title,e[15]=v):v=e[15];let k;e[16]!==d.description?(k=d.description?m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),m.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:d.description})]}):null,e[16]=d.description,e[17]=k):k=e[17];let w;e[18]!==v||e[19]!==k?(w=m.jsx(Lc,{children:m.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[v,k]})}),e[18]=v,e[19]=k,e[20]=w):w=e[20];let C;e[21]!==d.title||e[22]!==i?(C=m.jsx(Oi,{title:d.title,url:i,icon:"description"}),e[21]=d.title,e[22]=i,e[23]=C):C=e[23];const T=!y.formState.isDirty||f;let A;e[24]===Symbol.for("react.memo_cache_sentinel")?(A=m.jsx(Pc,{size:14}),e[24]=A):A=e[24];let D;e[25]!==x||e[26]!==T?(D=m.jsx(Lt,{asChild:!0,children:m.jsx("span",{className:"inline-block",children:m.jsx(me,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:T,onClick:x,"aria-label":"Cancel",children:A})})}),e[25]=x,e[26]=T,e[27]=D):D=e[27];let j;e[28]===Symbol.for("react.memo_cache_sentinel")?(j=m.jsx($t,{side:"bottom",children:"Cancel"}),e[28]=j):j=e[28];let _;e[29]!==D?(_=m.jsx(zt,{children:m.jsxs(_t,{delayDuration:0,children:[D,j]})}),e[29]=D,e[30]=_):_=e[30];const V=!y.formState.isDirty||f;let B;e[31]!==S?(B=()=>{S()},e[31]=S,e[32]=B):B=e[32];let H;e[33]===Symbol.for("react.memo_cache_sentinel")?(H=m.jsx(Ui,{size:14}),e[33]=H):H=e[33];let N;e[34]!==V||e[35]!==B?(N=m.jsx(Lt,{asChild:!0,children:m.jsx("span",{className:"inline-block",children:m.jsx(me,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:V,onClick:B,"aria-label":"Save",children:H})})}),e[34]=V,e[35]=B,e[36]=N):N=e[36];let z;e[37]===Symbol.for("react.memo_cache_sentinel")?(z=m.jsx($t,{side:"bottom",children:"Save"}),e[37]=z):z=e[37];let P;e[38]!==N?(P=m.jsx(zt,{children:m.jsxs(_t,{delayDuration:0,children:[N,z]})}),e[38]=N,e[39]=P):P=e[39];let K;e[40]!==C||e[41]!==_||e[42]!==P?(K=m.jsxs(Di,{children:[C,_,P]}),e[40]=C,e[41]=_,e[42]=P,e[43]=K):K=e[43];let Q;e[44]!==y?(Q=m.jsx("div",{className:"h-full",children:m.jsx(cm,{form:y})}),e[44]=y,e[45]=Q):Q=e[45];let le;return e[46]!==s||e[47]!==K||e[48]!==Q||e[49]!==w?(le=m.jsxs(Sn,{onBack:s,children:[w,K,Q]}),e[46]=s,e[47]=K,e[48]=Q,e[49]=w,e[50]=le):le=e[50],le}function pm(n){const e=I.c(5),{itemId:t,onBack:r}=n;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=am()??qt,e[0]=s):s=e[0];const o=s;if(!o||o===qt){let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=m.jsx("div",{className:"flex h-full w-full bg-background",children:m.jsx(jc,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=l):l=e[1],l}let i;return e[2]!==t||e[3]!==r?(i=m.jsx(Dc,{children:m.jsx(O.Suspense,{fallback:null,children:m.jsx(hm,{providerId:o,promptId:t,onBack:r})})}),e[2]=t,e[3]=r,e[4]=i):i=e[4],i}const mm=yh("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function gm(n){const e=I.c(10);let t,r,s;e[0]!==n?({className:t,variant:s,...r}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=s):(t=e[1],r=e[2],s=e[3]);let o;e[4]!==t||e[5]!==s?(o=U(mm({variant:s}),t),e[4]=t,e[5]=s,e[6]=o):o=e[6];let i;return e[7]!==r||e[8]!==o?(i=m.jsx("div",{"data-slot":"alert",role:"alert",className:o,...r}),e[7]=r,e[8]=o,e[9]=i):i=e[9],i}function ym(n){const e=I.c(8);let t,r;e[0]!==n?({className:t,...r}=n,e[0]=n,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=U("line-clamp-1 min-h-4 font-medium tracking-tight",t),e[3]=t,e[4]=s):s=e[4];let o;return e[5]!==r||e[6]!==s?(o=m.jsx("div",{"data-slot":"alert-title",className:s,...r}),e[5]=r,e[6]=s,e[7]=o):o=e[7],o}function xm(n){const e=I.c(8);let t,r;e[0]!==n?({className:t,...r}=n,e[0]=n,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=U("text-muted-foreground leading-relaxed",t),e[3]=t,e[4]=s):s=e[4];let o;return e[5]!==r||e[6]!==s?(o=m.jsx("div",{"data-slot":"alert-description",className:s,...r}),e[5]=r,e[6]=s,e[7]=o):o=e[7],o}const bm=n=>n.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function km(n){const e=I.c(13),{toolName:t,connectionId:r,onBack:s}=n,o=`/mcp/${r}`;let i;e[0]!==o?(i=new URL(o,window.location.origin),e[0]=o,e[1]=i):i=e[1];const l=i;let a;e[2]!==r?(a={connectionId:r},e[2]=r,e[3]=a):a=e[3];const c=Vh(a);if(!c.isAuthenticated){let f;return e[4]!==c.supportsOAuth||e[5]!==s?(f=m.jsx("div",{className:"flex h-full items-center justify-center",children:c.supportsOAuth?m.jsx(Hh,{onAuthenticate:()=>s(),buttonText:"Go back to authenticate"}):m.jsx(Wh,{hasReadme:!1})}),e[4]=c.supportsOAuth,e[5]=s,e[6]=f):f=e[6],f}const d=`${r}:${t}`;let u;return e[7]!==r||e[8]!==l||e[9]!==s||e[10]!==d||e[11]!==t?(u=m.jsx(Sm,{toolName:t,connectionId:r,mcpProxyUrl:l,onBack:s},d),e[7]=r,e[8]=l,e[9]=s,e[10]=d,e[11]=t,e[12]=u):u=e[12],u}function Sm({toolName:n,connectionId:e,mcpProxyUrl:t,onBack:r}){const o=Ci().location.href,{replayId:i}=xh({strict:!1}),l=(()=>{if(!i)return null;const N=`replay-${i}`,z=sessionStorage.getItem(N);if(!z)return null;sessionStorage.removeItem(N);try{return JSON.parse(z)}catch{return null}})(),a=(()=>{if(!l)return null;const N={};for(const[z,P]of Object.entries(l))P!==null&&typeof P=="object"?N[z]=JSON.stringify(P,null,2):N[z]=P;return N})(),[c,d]=O.useState(a??{}),[u,f]=O.useState(l?JSON.stringify(l,null,2):"{}"),[h,p]=O.useState(null),[y,g]=O.useState(null),[x,b]=O.useState(!1),[S,v]=O.useState(null),k=Pi(e),w=zi({url:t.href});O.useEffect(()=>{w.error&&console.error("MCP Error:",w.error)},[w.error]);const C=w.tools?.find(N=>N.name===n),T=C?.inputSchema?.properties,A=T?Object.keys(T):[],D=A.length>0,j={};if(D&&C?.inputSchema?.properties)for(const N of A)j[N]=C.inputSchema.required?.includes(N)?"":void 0;const _=N=>Object.prototype.hasOwnProperty.call(c,N),V=async()=>{b(!0),g(null),p(null),v(null);const N=performance.now(),z=qe(e);try{const P=D?{...j,...c}:(()=>{const se=u.trim();if(!se)return{};const J=JSON.parse(se);if(J&&typeof J=="object")return J;throw new Error("Raw JSON input must be an object.")})();D&&C?.inputSchema?.properties&&Object.entries(C.inputSchema.properties).forEach(([se,J])=>{if((J.type==="object"||J.type==="array")&&typeof P[se]=="string")try{P[se]=JSON.parse(P[se])}catch{}});const K=await z(n,P),Q=performance.now(),le=Math.round(Q-N);p(K);const X=JSON.stringify(K),fe=new TextEncoder().encode(X).length;v({duration:`${le}ms`,bytes:`${fe} bytes`,tokens:`~${Math.ceil(fe/4)} tokens`,cost:"$0.0000"})}catch(P){const K=P instanceof Error?P.message:String(P);g(K||"Unknown error occurred");const Q=performance.now();v({duration:`${Math.round(Q-N)}ms`})}finally{b(!1)}},B=(N,z)=>{d(P=>({...P,[N]:z}))},H=()=>{p(null),g(null),v(null)};return m.jsxs(Sn,{onBack:r,children:[m.jsx(Di,{children:m.jsx(Oi,{title:C?.name??bm(n),url:o,icon:"build"})}),m.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 h-full",children:[m.jsx("div",{className:"flex flex-col border-r border-border overflow-hidden",children:m.jsxs("div",{className:"flex-1 overflow-auto",children:[m.jsx("div",{className:"flex flex-col gap-4 p-6 border-b border-border min-h-28",children:m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx(js,{icon:k?.icon||null,name:k?.title||n,size:"sm",className:"shadow-sm shrink-0"}),m.jsx("h1",{className:"text-lg font-medium text-foreground leading-none",children:n}),m.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit",children:[w.state==="ready"?m.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):w.state==="connecting"?m.jsx(tr,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):m.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),m.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:w.state.replace("_"," ")})]})]}),m.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:C?.description||"No description available"})]})}),m.jsxs("div",{className:"flex flex-col p-6 gap-4",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),C?.inputSchema?.required&&C.inputSchema.required.length>0&&m.jsxs("span",{className:"text-xs text-muted-foreground",children:[m.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),m.jsx("div",{className:"space-y-4",children:D&&C?.inputSchema?.properties?Object.entries(C.inputSchema.properties).map(([N,z])=>m.jsxs("div",{className:"space-y-2",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[N,C.inputSchema?.required?.includes(N)&&m.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),m.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:z.type})]}),z.description&&m.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:z.description}),z.type==="object"||z.type==="array"?m.jsx(Ho,{className:"font-mono text-xs",value:_(N)?c[N]??"":j[N]??"",onChange:P=>B(N,P.target.value),placeholder:`Enter ${N} as JSON...`,rows:3}):m.jsx(ji,{value:_(N)?c[N]??"":j[N]??"",onChange:P=>B(N,P.target.value),placeholder:`Enter ${N}...`})]},N)):C?.inputSchema&&!D?m.jsxs("div",{className:"space-y-2",children:[m.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),m.jsx(Ho,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:N=>f(N.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):m.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:m.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})})]})]})}),m.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[m.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-t lg:border-t-0 border-b border-border bg-background",children:[m.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),S&&m.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(zh,{className:"h-3 w-3 text-muted-foreground"}),m.jsx("span",{className:"font-mono text-foreground",children:S.duration})]}),S.tokens&&m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(Kc,{className:"h-3 w-3 text-muted-foreground"}),m.jsx("span",{className:"font-mono text-foreground",children:S.tokens})]}),S.bytes&&m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(Yc,{className:"h-3 w-3 text-muted-foreground"}),m.jsx("span",{className:"font-mono text-foreground",children:S.bytes})]}),S.cost&&m.jsx("div",{className:"flex items-center gap-1.5",children:m.jsx("span",{className:"font-mono text-foreground",children:S.cost})})]})]}),m.jsx("div",{className:"flex items-center justify-end lg:justify-between px-4 h-14 border-b border-border bg-background",children:m.jsxs("div",{className:"flex items-center gap-2 w-full lg:w-auto",children:[m.jsx(me,{size:"sm",variant:"default",className:"h-8 gap-2 flex-1 lg:flex-none",onClick:V,disabled:x,children:x?m.jsxs(m.Fragment,{children:[m.jsx(tr,{size:14,className:"animate-spin"}),"Executing..."]}):m.jsxs(m.Fragment,{children:[m.jsx(Li,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})}),m.jsx(zt,{children:m.jsxs(_t,{children:[m.jsx(Lt,{asChild:!0,children:m.jsx(me,{size:"icon",variant:"outline",className:"h-8 w-8 shrink-0",onClick:H,disabled:!h&&!y,children:m.jsx($i,{size:14})})}),m.jsx($t,{children:m.jsx("p",{children:"Clear results"})})]})})]})}),y&&m.jsx("div",{className:"px-6 py-4 bg-background",children:m.jsx(gm,{variant:"destructive",children:m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx($h,{className:"h-4 w-4"}),m.jsx(ym,{className:"mb-0",children:"Execution Failed"})]}),m.jsx(xm,{className:"text-xs text-destructive",children:y})]})})}),m.jsx("div",{className:"relative flex-1 overflow-auto bg-muted/50",children:h?m.jsxs(m.Fragment,{children:[m.jsx(On,{code:JSON.stringify(h,null,2),language:"json",height:"100%",readOnly:!0}),m.jsx(me,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(h,null,2)),Ec.success("Copied to clipboard")},children:m.jsx(Bh,{className:"h-3.5 w-3.5"})})]}):m.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[m.jsx(_h,{className:"h-12 w-12 mb-3 opacity-40"}),m.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]})]})]})}function wm(n){const e=I.c(7),{itemId:t,onBack:r}=n;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},e[0]=s):s=e[0];const i=Et(s).connectionId??qt;if(!Pi(i)){let d;return e[1]===Symbol.for("react.memo_cache_sentinel")?(d=m.jsx("div",{className:"flex h-full items-center justify-center",children:m.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[m.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),m.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[1]=d):d=e[1],d}let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx("div",{className:"flex h-full items-center justify-center",children:m.jsx(tr,{size:32,className:"animate-spin text-muted-foreground"})}),e[2]=a):a=e[2];let c;return e[3]!==i||e[4]!==r||e[5]!==t?(c=m.jsx(O.Suspense,{fallback:a,children:m.jsx(km,{toolName:t,connectionId:i,onBack:r})}),e[3]=i,e[4]=r,e[5]=t,e[6]=c):c=e[6],c}const Kl=n=>{let e;const t=new Set,r=(c,d)=>{const u=typeof c=="function"?c(e):c;if(!Object.is(u,e)){const f=e;e=d??(typeof u!="object"||u===null)?u:Object.assign({},e,u),t.forEach(h=>h(e,f))}},s=()=>e,l={setState:r,getState:s,getInitialState:()=>a,subscribe:c=>(t.add(c),()=>t.delete(c))},a=e=n(r,s,l);return l},Ki=(n=>n?Kl(n):Kl),vm=n=>n;function Wo(n,e=vm){const t=ee.useSyncExternalStore(n.subscribe,ee.useCallback(()=>e(n.getState()),[n,e]),ee.useCallback(()=>e(n.getInitialState()),[n,e]));return ee.useDebugValue(t),t}const Cm=n=>{const e=Ki(n),t=r=>Wo(e,r);return Object.assign(t,e),t},Nm=(n=>Cm);function td(n,e){let t;try{t=n()}catch{return}return{getItem:s=>{var o;const i=a=>a===null?null:JSON.parse(a,void 0),l=(o=t.getItem(s))!=null?o:null;return l instanceof Promise?l.then(i):i(l)},setItem:(s,o)=>t.setItem(s,JSON.stringify(o,void 0)),removeItem:s=>t.removeItem(s)}}const qo=n=>e=>{try{const t=n(e);return t instanceof Promise?t:{then(r){return qo(r)(t)},catch(r){return this}}}catch(t){return{then(r){return this},catch(r){return qo(r)(t)}}}},Em=(n,e)=>(t,r,s)=>{let o={storage:td(()=>localStorage),partialize:g=>g,version:0,merge:(g,x)=>({...x,...g}),...e},i=!1,l=0;const a=new Set,c=new Set;let d=o.storage;if(!d)return n((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),t(...g)},r,s);const u=()=>{const g=o.partialize({...r()});return d.setItem(o.name,{state:g,version:o.version})},f=s.setState;s.setState=(g,x)=>(f(g,x),u());const h=n((...g)=>(t(...g),u()),r,s);s.getInitialState=()=>h;let p;const y=()=>{var g,x;if(!d)return;const b=++l;i=!1,a.forEach(v=>{var k;return v((k=r())!=null?k:h)});const S=((x=o.onRehydrateStorage)==null?void 0:x.call(o,(g=r())!=null?g:h))||void 0;return qo(d.getItem.bind(d))(o.name).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==o.version){if(o.migrate){const k=o.migrate(v.state,v.version);return k instanceof Promise?k.then(w=>[!0,w]):[!0,k]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,v.state];return[!1,void 0]}).then(v=>{var k;if(b!==l)return;const[w,C]=v;if(p=o.merge(C,(k=r())!=null?k:h),t(p,!0),w)return u()}).then(()=>{b===l&&(S?.(p,void 0),p=r(),i=!0,c.forEach(v=>v(p)))}).catch(v=>{b===l&&S?.(void 0,v)})};return s.persist={setOptions:g=>{o={...o,...g},g.storage&&(d=g.storage)},clearStorage:()=>{d?.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>y(),hasHydrated:()=>i,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(c.add(g),()=>{c.delete(g)})},o.skipHydration||y(),p||h},nd=Em,{useSyncExternalStoreWithSelector:Tm}=bh,Mm=n=>n;function Am(n,e=Mm,t){const r=Tm(n.subscribe,n.getState,n.getInitialState,e,t);return ee.useDebugValue(r),r}const Jl=n=>Symbol.iterator in n,Gl=n=>"entries"in n,Xl=(n,e)=>{const t=n instanceof Map?n:new Map(n.entries()),r=e instanceof Map?e:new Map(e.entries());if(t.size!==r.size)return!1;for(const[s,o]of t)if(!r.has(s)||!Object.is(o,r.get(s)))return!1;return!0},Om=(n,e)=>{const t=n[Symbol.iterator](),r=e[Symbol.iterator]();let s=t.next(),o=r.next();for(;!s.done&&!o.done;){if(!Object.is(s.value,o.value))return!1;s=t.next(),o=r.next()}return!!s.done&&!!o.done};function Im(n,e){return Object.is(n,e)?!0:typeof n!="object"||n===null||typeof e!="object"||e===null||Object.getPrototypeOf(n)!==Object.getPrototypeOf(e)?!1:Jl(n)&&Jl(e)?Gl(n)&&Gl(e)?Xl(n,e):Om(n,e):Xl({entries:()=>Object.entries(n)},{entries:()=>Object.entries(e)})}function Rm(n,e="Output"){if(!n)return`interface ${e} {}`;function t(o){if(!o||typeof o!="object")return"unknown";const i=o.type;if(Array.isArray(i))return i.map(l=>r(l)).join(" | ");switch(i){case"string":return o.enum?o.enum.map(l=>`"${l}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const l=o.items;return l?`${t(l)}[]`:"unknown[]"}case"object":return s(o);default:return o.anyOf?o.anyOf.map(t).join(" | "):o.oneOf?o.oneOf.map(t).join(" | "):o.allOf?o.allOf.map(t).join(" & "):"unknown"}}function r(o){switch(o){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function s(o){const i=o.properties;if(!i)return"Record<string, unknown>";const l=new Set(o.required||[]);return`{
2
2
  ${Object.entries(i).map(([c,d])=>{const u=l.has(c)?"":"?";return`${d.description?` /** ${d.description} */
3
3
  `:""} ${c}${u}: ${t(d)};`}).join(`
4
4
  `)}
@@ -1 +1 @@
1
- import{r as j,c as k,j as s}from"./index-skH-OUyO.js";import{c as N,B as C}from"./button-Dh_UOMtF.js";import{c as y,D as M,b as z,a as D}from"./dropdown-menu-T7u8fl7N.js";import{i as S}from"./ArrowUp-BDjaIiFu.js";import{i as T}from"./Check-Cs5AiVxS.js";import{c as E}from"./Grid01-XLGz76ym.js";import{i as V}from"./List-DWWQESNh.js";import{a as _,c as B,b as L,T as $}from"./tooltip-DgJ4R-G6.js";import{V as W}from"./view-mode-toggle-Z5AVjYj0.js";const w=({size:r=24,color:e="currentColor",...o})=>j.createElement("svg",{viewBox:"0 0 24 24",width:r,height:r,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},j.createElement("path",{d:"M12 5v14m0 0 7-7m-7 7-7-7"}));w.displayName="ArrowDown";const b=({size:r=24,color:e="currentColor",...o})=>j.createElement("svg",{viewBox:"0 0 24 24",width:r,height:r,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},j.createElement("path",{d:"M5 21v-7m0-4V3m7 18v-9m0-4V3m7 18v-5m0-4V3M2 14h6m1-6h6m1 8h6"}));b.displayName="Sliders01";function H(r){const e=k.c(16),{viewMode:o,onViewModeChange:g,sortKey:v,sortDirection:n,onSort:l,sortOptions:a}=r;let c;e[0]!==a?(c=a===void 0?[]:a,e[0]=a,e[1]=c):c=e[1];const d=c;let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(_,{children:s.jsxs(B,{children:[s.jsx(L,{asChild:!0,children:s.jsx(M,{asChild:!0,children:s.jsx(C,{variant:"outline",size:"icon",className:"size-7 border border-input",children:s.jsx(b,{size:16})})})}),s.jsx($,{children:"Search filters"})]})}),e[2]=m):m=e[2];let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p={value:"table",icon:s.jsx(V,{})},e[3]=p):p=e[3];let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=[p,{value:"cards",icon:s.jsx(E,{})}],e[4]=h):h=e[4];let t;e[5]!==g||e[6]!==o?(t=s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(W,{value:o,onValueChange:g,fullWidth:!0,options:h})}),e[5]=g,e[6]=o,e[7]=t):t=e[7];let i;e[8]!==l||e[9]!==n||e[10]!==v||e[11]!==d?(i=d.length>0&&l&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),d.map(u=>{const f=v===u.id;return s.jsx(y,{onClick:()=>l(u.id),className:N("h-8 px-2 py-0 cursor-pointer",f&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[f&&s.jsx(T,{size:16,className:"text-foreground shrink-0"}),!f&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:u.label}),f&&n&&(n==="asc"?s.jsx(S,{size:16,className:"text-foreground shrink-0"}):s.jsx(w,{size:16,className:"text-foreground shrink-0"}))]})},u.id)})]}),e[8]=l,e[9]=n,e[10]=v,e[11]=d,e[12]=i):i=e[12];let x;return e[13]!==t||e[14]!==i?(x=s.jsxs(z,{children:[m,s.jsxs(D,{align:"end",className:"w-[200px] p-0 gap-0",children:[t,i]})]}),e[13]=t,e[14]=i,e[15]=x):x=e[15],x}export{H as C,w as n};
1
+ import{r as j,c as k,j as s}from"./index-Diww4UW3.js";import{c as N,B as C}from"./button-CGmrzkpY.js";import{c as y,D as M,b as z,a as D}from"./dropdown-menu-CAeD2aIb.js";import{i as S}from"./ArrowUp-BF7mM4C2.js";import{i as T}from"./Check-BQkm1TiP.js";import{c as E}from"./Grid01-D4lXvveX.js";import{i as V}from"./List-BsSZz32j.js";import{a as _,c as B,b as L,T as $}from"./tooltip-Suu_Gpqh.js";import{V as W}from"./view-mode-toggle-BLClM-0g.js";const w=({size:r=24,color:e="currentColor",...o})=>j.createElement("svg",{viewBox:"0 0 24 24",width:r,height:r,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},j.createElement("path",{d:"M12 5v14m0 0 7-7m-7 7-7-7"}));w.displayName="ArrowDown";const b=({size:r=24,color:e="currentColor",...o})=>j.createElement("svg",{viewBox:"0 0 24 24",width:r,height:r,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},j.createElement("path",{d:"M5 21v-7m0-4V3m7 18v-9m0-4V3m7 18v-5m0-4V3M2 14h6m1-6h6m1 8h6"}));b.displayName="Sliders01";function H(r){const e=k.c(16),{viewMode:o,onViewModeChange:g,sortKey:v,sortDirection:n,onSort:l,sortOptions:a}=r;let c;e[0]!==a?(c=a===void 0?[]:a,e[0]=a,e[1]=c):c=e[1];const d=c;let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(_,{children:s.jsxs(B,{children:[s.jsx(L,{asChild:!0,children:s.jsx(M,{asChild:!0,children:s.jsx(C,{variant:"outline",size:"icon",className:"size-7 border border-input",children:s.jsx(b,{size:16})})})}),s.jsx($,{children:"Search filters"})]})}),e[2]=m):m=e[2];let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p={value:"table",icon:s.jsx(V,{})},e[3]=p):p=e[3];let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=[p,{value:"cards",icon:s.jsx(E,{})}],e[4]=h):h=e[4];let t;e[5]!==g||e[6]!==o?(t=s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(W,{value:o,onValueChange:g,fullWidth:!0,options:h})}),e[5]=g,e[6]=o,e[7]=t):t=e[7];let i;e[8]!==l||e[9]!==n||e[10]!==v||e[11]!==d?(i=d.length>0&&l&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),d.map(u=>{const f=v===u.id;return s.jsx(y,{onClick:()=>l(u.id),className:N("h-8 px-2 py-0 cursor-pointer",f&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[f&&s.jsx(T,{size:16,className:"text-foreground shrink-0"}),!f&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:u.label}),f&&n&&(n==="asc"?s.jsx(S,{size:16,className:"text-foreground shrink-0"}):s.jsx(w,{size:16,className:"text-foreground shrink-0"}))]})},u.id)})]}),e[8]=l,e[9]=n,e[10]=v,e[11]=d,e[12]=i):i=e[12];let x;return e[13]!==t||e[14]!==i?(x=s.jsxs(z,{children:[m,s.jsxs(D,{align:"end",className:"w-[200px] p-0 gap-0",children:[t,i]})]}),e[13]=t,e[14]=i,e[15]=x):x=e[15],x}export{H as C,w as n};
@@ -1 +1 @@
1
- import{c as v,j as l}from"./index-skH-OUyO.js";import{C as b}from"./collection-display-button-DKfm8yFW.js";function w(g){const e=v.c(20),{title:r,viewMode:n,onViewModeChange:c,sortKey:f,sortDirection:x,onSort:p,sortOptions:a,ctaButton:h,leftElement:u}=g;let m;e[0]!==a?(m=a===void 0?[]:a,e[0]=a,e[1]=m):m=e[1];const j=m;let t;e[2]!==r?(t=typeof r=="string"?l.jsx("h1",{className:"text-sm font-medium text-foreground",children:r}):r,e[2]=r,e[3]=t):t=e[3];let s;e[4]!==u||e[5]!==t?(s=l.jsxs("div",{className:"flex items-center gap-2",children:[u,t]}),e[4]=u,e[5]=t,e[6]=s):s=e[6];let i;e[7]!==p||e[8]!==c||e[9]!==x||e[10]!==f||e[11]!==j||e[12]!==n?(i=n&&c&&l.jsx(b,{viewMode:n,onViewModeChange:c,sortKey:f,sortDirection:x,onSort:p,sortOptions:j}),e[7]=p,e[8]=c,e[9]=x,e[10]=f,e[11]=j,e[12]=n,e[13]=i):i=e[13];let o;e[14]!==h||e[15]!==i?(o=l.jsxs("div",{className:"flex items-center gap-2",children:[i,h]}),e[14]=h,e[15]=i,e[16]=o):o=e[16];let d;return e[17]!==s||e[18]!==o?(d=l.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:l.jsxs("div",{className:"flex items-center justify-between gap-3 h-12 px-4",children:[s,o]})}),e[17]=s,e[18]=o,e[19]=d):d=e[19],d}export{w as C};
1
+ import{c as v,j as l}from"./index-Diww4UW3.js";import{C as b}from"./collection-display-button-CtkxsCB_.js";function w(g){const e=v.c(20),{title:r,viewMode:n,onViewModeChange:c,sortKey:f,sortDirection:x,onSort:p,sortOptions:a,ctaButton:h,leftElement:u}=g;let m;e[0]!==a?(m=a===void 0?[]:a,e[0]=a,e[1]=m):m=e[1];const j=m;let t;e[2]!==r?(t=typeof r=="string"?l.jsx("h1",{className:"text-sm font-medium text-foreground",children:r}):r,e[2]=r,e[3]=t):t=e[3];let s;e[4]!==u||e[5]!==t?(s=l.jsxs("div",{className:"flex items-center gap-2",children:[u,t]}),e[4]=u,e[5]=t,e[6]=s):s=e[6];let i;e[7]!==p||e[8]!==c||e[9]!==x||e[10]!==f||e[11]!==j||e[12]!==n?(i=n&&c&&l.jsx(b,{viewMode:n,onViewModeChange:c,sortKey:f,sortDirection:x,onSort:p,sortOptions:j}),e[7]=p,e[8]=c,e[9]=x,e[10]=f,e[11]=j,e[12]=n,e[13]=i):i=e[13];let o;e[14]!==h||e[15]!==i?(o=l.jsxs("div",{className:"flex items-center gap-2",children:[i,h]}),e[14]=h,e[15]=i,e[16]=o):o=e[16];let d;return e[17]!==s||e[18]!==o?(d=l.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:l.jsxs("div",{className:"flex items-center justify-between gap-3 h-12 px-4",children:[s,o]})}),e[17]=s,e[18]=o,e[19]=d):d=e[19],d}export{w as C};
@@ -1 +1 @@
1
- import{c as s,j as c}from"./index-skH-OUyO.js";function r(t){const e=s.c(2),{children:l}=t;let o;return e[0]!==l?(o=c.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden",children:l}),e[0]=l,e[1]=o):o=e[1],o}export{r as C};
1
+ import{c as s,j as c}from"./index-Diww4UW3.js";function r(t){const e=s.c(2),{children:l}=t;let o;return e[0]!==l?(o=c.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden",children:l}),e[0]=l,e[1]=o):o=e[1],o}export{r as C};
@@ -1 +1 @@
1
- import{c as g,j as a}from"./index-skH-OUyO.js";import{i as b}from"./Loading01-BtKovu_m.js";import{i as j}from"./SearchMd-DwKDi1yz.js";import{I as N}from"./input-CdlPz8Vq.js";import{c as v}from"./button-Dh_UOMtF.js";function E(h){const e=g.c(17),{value:n,onChange:c,placeholder:x,onKeyDown:m,className:f,isSearching:d}=h,p=x===void 0?"Search...":x;let s;e[0]!==f?(s=v("shrink-0 w-full border-b border-border h-12",f),e[0]=f,e[1]=s):s=e[1];let t;e[2]!==d?(t=d?a.jsx(b,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):a.jsx(j,{size:16,className:"text-muted-foreground shrink-0"}),e[2]=d,e[3]=t):t=e[3];let r;e[4]!==c?(r=u=>c(u.target.value),e[4]=c,e[5]=r):r=e[5];let o;e[6]!==m||e[7]!==p||e[8]!==r||e[9]!==n?(o=a.jsx(N,{value:n,onChange:r,onKeyDown:m,placeholder:p,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[6]=m,e[7]=p,e[8]=r,e[9]=n,e[10]=o):o=e[10];let l;e[11]!==t||e[12]!==o?(l=a.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 cursor-text",children:[t,o]}),e[11]=t,e[12]=o,e[13]=l):l=e[13];let i;return e[14]!==s||e[15]!==l?(i=a.jsx("div",{className:s,children:l}),e[14]=s,e[15]=l,e[16]=i):i=e[16],i}export{E as C};
1
+ import{c as g,j as a}from"./index-Diww4UW3.js";import{i as b}from"./Loading01-Ae5ezbtD.js";import{i as j}from"./SearchMd-GFaonOaJ.js";import{I as N}from"./input-CrURMEZe.js";import{c as v}from"./button-CGmrzkpY.js";function E(h){const e=g.c(17),{value:n,onChange:c,placeholder:x,onKeyDown:m,className:f,isSearching:d}=h,p=x===void 0?"Search...":x;let s;e[0]!==f?(s=v("shrink-0 w-full border-b border-border h-12",f),e[0]=f,e[1]=s):s=e[1];let t;e[2]!==d?(t=d?a.jsx(b,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):a.jsx(j,{size:16,className:"text-muted-foreground shrink-0"}),e[2]=d,e[3]=t):t=e[3];let r;e[4]!==c?(r=u=>c(u.target.value),e[4]=c,e[5]=r):r=e[5];let o;e[6]!==m||e[7]!==p||e[8]!==r||e[9]!==n?(o=a.jsx(N,{value:n,onChange:r,onKeyDown:m,placeholder:p,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[6]=m,e[7]=p,e[8]=r,e[9]=n,e[10]=o):o=e[10];let l;e[11]!==t||e[12]!==o?(l=a.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 cursor-text",children:[t,o]}),e[11]=t,e[12]=o,e[13]=l):l=e[13];let i;return e[14]!==s||e[15]!==l?(i=a.jsx("div",{className:s,children:l}),e[14]=s,e[15]=l,e[16]=i):i=e[16],i}export{E as C};
@@ -1 +1 @@
1
- import{c as ne,j as t,K as nt,f as lt,k as rt,a as at,r as ct,t as dt}from"./index-skH-OUyO.js";import{g as Me}from"./generate-id-Dyweu44Y.js";import{c as Re}from"./connection-DuIRkEvB.js";import{C as Ve}from"./collection-display-button-DKfm8yFW.js";import{C as mt}from"./collection-search-Bm9HY_m8.js";import{C as ft}from"./card-Bjs7HBa2.js";import{I as qe,E as ut}from"./empty-state-DhpaMqQD.js";import{b as Ge,D as We,a as He,c as F}from"./dropdown-menu-T7u8fl7N.js";import{B as ke,c as ze}from"./button-Dh_UOMtF.js";import{a as Je}from"./Copy01-B_oHlu2-.js";import{i as Qe}from"./DotsVertical-HKe7Lpcg.js";import{i as Ye}from"./Edit01-CcxqoKWW.js";import{s as Xe,u as pt}from"./use-list-state-B0HVVNOr.js";import{s as Ze}from"./Trash01-DCb3R_1E.js";import{C as ht}from"./collection-table-wrapper-CnCS_a8f.js";import{E as Ue}from"./empty-state-ylKJe6-v.js";import{n as Be}from"./Inbox01-1DQwZbO-.js";import{A as Oe}from"./avatar-noXapmql.js";import{u as xt}from"./useQuery-FRehIqtM.js";import{P as gt}from"./pin-to-sidebar-button-C5qdidS1.js";import{b as jt}from"./use-connection-BY9aOm7H.js";import{a as Ct,b as vt}from"./use-collections-CC15C_nK.js";import{B as bt}from"./constants-C1rpewgJ.js";import{A as yt,g as Nt,c as wt,b as St,d as _t,e as Dt,a as At,f as Tt}from"./alert-dialog-CNXrLp-S.js";import{s as It}from"./Plus-CPExS1G1.js";import{V as Pt}from"./layout-DopLDDPE.js";function $t(n,e){const s=n.properties||{};for(const o in s){const l=s[o];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&o in e&&e[o])return e[o]}const d=["image","img","avatar","icon","logo","thumbnail","cover"];for(const o of d)if(e&&typeof e=="object"&&o in e&&typeof e[o]=="string")return e[o]}function Et(n){const e=ne.c(25),{item:s,schema:d,actions:o}=n;let l;e[0]!==s||e[1]!==d?(l=$t(d,s),e[0]=s,e[1]=d,e[2]=l):l=e[2];const a=l,c=s&&typeof s=="object"&&"description"in s&&typeof s.description=="string"?s.description:void 0;let f;e[3]!==o?(f=o&&Object.keys(o).length>0,e[3]=o,e[4]=f):f=e[4];const i=f;let u;e[5]!==a||e[6]!==s.title?(u=t.jsx(qe,{icon:a,name:s.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=a,e[6]=s.title,e[7]=u):u=e[7];let j;e[8]!==s.title?(j=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=j):j=e[9];const h=c||"No description";let m;e[10]!==h?(m=t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:h}),e[10]=h,e[11]=m):m=e[11];let x;e[12]!==j||e[13]!==m?(x=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[j,m]}),e[12]=j,e[13]=m,e[14]=x):x=e[14];let y;e[15]!==u||e[16]!==x?(y=t.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[u,x]}),e[15]=u,e[16]=x,e[17]=y):y=e[17];let C;e[18]!==o||e[19]!==i||e[20]!==s?(C=i&&t.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:Ft,onMouseDown:kt,children:t.jsxs(Ge,{children:[t.jsx(We,{asChild:!0,children:t.jsx(ke,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Ot,children:t.jsx(Qe,{size:20})})}),t.jsxs(He,{align:"end",onClick:zt,children:[o.open&&t.jsxs(F,{onClick:r=>{r.stopPropagation(),o.open?.(s)},children:[t.jsx(Xe,{size:16}),"Open"]}),o.edit&&t.jsxs(F,{onClick:r=>{r.stopPropagation(),o.edit?.(s)},children:[t.jsx(Ye,{size:16}),"Edit"]}),o.duplicate&&t.jsxs(F,{onClick:r=>{r.stopPropagation(),o.duplicate?.(s)},children:[t.jsx(Je,{size:16}),"Duplicate"]}),o.delete&&t.jsxs(F,{variant:"destructive",onClick:r=>{r.stopPropagation(),o.delete?.(s)},children:[t.jsx(Ze,{size:16}),"Delete"]})]})]})}),e[18]=o,e[19]=i,e[20]=s,e[21]=C):C=e[21];let S;return e[22]!==y||e[23]!==C?(S=t.jsxs(ft,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[y,C]}),e[22]=y,e[23]=C,e[24]=S):S=e[24],S}function zt(n){return n.stopPropagation()}function Ot(n){return n.stopPropagation()}function kt(n){return n.stopPropagation()}function Ft(n){return n.stopPropagation()}function Kt(n){const e=ne.c(9);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=Re(),e[0]=s):s=e[0];const d=s;let o;e[1]!==n?(o=nt.user(n),e[1]=n,e[2]=o):o=e[2];let l;e[3]!==n?(l=async()=>(await d("USER_GET",{id:n})).user,e[3]=n,e[4]=l):l=e[4];const a=!!n;let c;return e[5]!==o||e[6]!==l||e[7]!==a?(c={queryKey:o,queryFn:l,staleTime:3e5,retry:1,enabled:a},e[5]=o,e[6]=l,e[7]=a,e[8]=c):c=e[8],xt(c)}function Mt(n){const e=ne.c(39),{id:s,size:d,showEmail:o,className:l}=n,a=d===void 0?"xs":d,c=o===void 0?!1:o,{data:f,isLoading:i,isError:u}=Kt(s);if(i){let r;e[0]!==l?(r=ze("flex items-center gap-2",l),e[0]=l,e[1]=r):r=e[1];let g;e[2]!==a?(g=t.jsx(Oe.Skeleton,{shape:"circle",size:a}),e[2]=a,e[3]=g):g=e[3];let v;e[4]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"h-3 w-24 bg-muted animate-pulse rounded"}),e[4]=v):v=e[4];let p;e[5]!==c?(p=c&&t.jsx("div",{className:"h-2 w-32 bg-muted animate-pulse rounded"}),e[5]=c,e[6]=p):p=e[6];let _;e[7]!==p?(_=t.jsxs("div",{className:"flex flex-col gap-1",children:[v,p]}),e[7]=p,e[8]=_):_=e[8];let b;return e[9]!==r||e[10]!==g||e[11]!==_?(b=t.jsxs("div",{className:r,children:[g,_]}),e[9]=r,e[10]=g,e[11]=_,e[12]=b):b=e[12],b}if(u||!f){let r;e[13]!==l?(r=ze("flex items-center gap-2",l),e[13]=l,e[14]=r):r=e[14];let g;e[15]!==a?(g=t.jsx(Oe,{shape:"circle",size:a,fallback:"?",muted:!0}),e[15]=a,e[16]=g):g=e[16];let v;e[17]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"flex flex-col",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Unknown User"})}),e[17]=v):v=e[17];let p;return e[18]!==r||e[19]!==g?(p=t.jsxs("div",{className:r,children:[g,v]}),e[18]=r,e[19]=g,e[20]=p):p=e[20],p}let j;e[21]!==l?(j=ze("flex items-center gap-2",l),e[21]=l,e[22]=j):j=e[22];const h=f.image??void 0;let m;e[23]!==a||e[24]!==h||e[25]!==f.name?(m=t.jsx(Oe,{shape:"circle",size:a,url:h,fallback:f.name}),e[23]=a,e[24]=h,e[25]=f.name,e[26]=m):m=e[26];let x;e[27]!==f.name?(x=t.jsx("div",{className:"text-sm font-medium",children:f.name}),e[27]=f.name,e[28]=x):x=e[28];let y;e[29]!==c||e[30]!==f.email?(y=c&&t.jsx("div",{className:"text-xs text-muted-foreground",children:f.email}),e[29]=c,e[30]=f.email,e[31]=y):y=e[31];let C;e[32]!==x||e[33]!==y?(C=t.jsxs("div",{className:"flex flex-col",children:[x,y]}),e[32]=x,e[33]=y,e[34]=C):C=e[34];let S;return e[35]!==j||e[36]!==m||e[37]!==C?(S=t.jsxs("div",{className:j,children:[m,C]}),e[35]=j,e[36]=m,e[37]=C,e[38]=S):S=e[38],S}const Ut=["icon","avatar","logo"],Le=["created_at","created_by","id"];function Bt(n){return Object.keys(n).find(e=>Ut.includes(e.toLowerCase()))}function et(n,e){return Object.keys(n.properties||{}).filter(s=>["id","created_at","updated_at","created_by","updated_by"].includes(s)?!1:e?e.includes(s):!0).map(s=>({id:s,label:s.charAt(0).toUpperCase()+s.slice(1).replace(/_/g," ")}))}function Lt(n){const e=ne.c(32),{data:s,schema:d,viewMode:o,onViewModeChange:l,search:a,sortKey:c,sortDirection:f,onSort:i,actions:u,onItemClick:j,headerActions:h,emptyState:m,readOnly:x,columns:y,hideToolbar:C,sortableFields:S}=n,r=l===void 0?Wt:l,g=f===void 0?"asc":f,v=i===void 0?Gt:i;let p;e[0]!==u?(p=u===void 0?{}:u,e[0]=u,e[1]=p):p=e[1];const _=p,b=j===void 0?qt:j,P=h===void 0?null:h,T=m===void 0?null:m,E=x===void 0?!1:x,N=y===void 0?void 0:y,$=C===void 0?!1:C,D=S===void 0?void 0:S;let z;e[2]!==N||e[3]!==d||e[4]!==D?(z=N?N.filter(Vt).filter(k=>!D||D.includes(k.id)).map(Rt):et(d,D),e[2]=N,e[3]=d,e[4]=D,e[5]=z):z=e[5];const K=z;let I;e[6]!==P||e[7]!==$||e[8]!==v||e[9]!==r||e[10]!==g||e[11]!==c||e[12]!==K||e[13]!==o?(I=!$&&t.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:t.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[t.jsx("div",{className:"flex items-center gap-2 flex-1",children:P}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(Ve,{viewMode:o,onViewModeChange:r,sortKey:c,sortDirection:g,onSort:v,sortOptions:K})})]})}),e[6]=P,e[7]=$,e[8]=v,e[9]=r,e[10]=g,e[11]=c,e[12]=K,e[13]=o,e[14]=I):I=e[14];let A;e[15]!==_||e[16]!==N||e[17]!==s||e[18]!==T||e[19]!==b||e[20]!==v||e[21]!==E||e[22]!==d||e[23]!==a||e[24]!==g||e[25]!==c||e[26]!==D||e[27]!==o?(A=o==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:s.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:T||t.jsx(Ue,{icon:t.jsx(Be,{size:36,className:"text-muted-foreground"}),title:"No items found",description:a?"Try adjusting your search":"No items to display"})}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:s.map(k=>t.jsx("div",{onClick:()=>b?.(k),className:"cursor-pointer h-full",children:t.jsx(Et,{item:k,schema:d,readOnly:E,actions:_})},k.id))})}):t.jsx(ht,{columns:Qt(N,d,D,_),data:s,sortKey:c,sortDirection:g,onSort:v,onRowClick:b,emptyState:T||t.jsx(Ue,{icon:t.jsx(Be,{size:36,className:"text-muted-foreground"}),title:"No items found",description:a?"Try adjusting your search":"No items to display"})}),e[15]=_,e[16]=N,e[17]=s,e[18]=T,e[19]=b,e[20]=v,e[21]=E,e[22]=d,e[23]=a,e[24]=g,e[25]=c,e[26]=D,e[27]=o,e[28]=A):A=e[28];let O;return e[29]!==I||e[30]!==A?(O=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[I,A]}),e[29]=I,e[30]=A,e[31]=O):O=e[31],O}function Rt(n){return{id:n.id,label:typeof n.header=="string"?n.header:n.id}}function Vt(n){return n.sortable!==!1}function qt(){}function Gt(){}function Wt(){}function Ht(n){return{id:"actions",header:"",render:e=>t.jsxs(Ge,{children:[t.jsx(We,{asChild:!0,children:t.jsx(ke,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:t.jsx(Qe,{size:20})})}),t.jsxs(He,{align:"end",onClick:s=>s.stopPropagation(),children:[n.open&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.open?.(e)},children:[t.jsx(Xe,{size:16}),"Open"]}),n.edit&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.edit?.(e)},children:[t.jsx(Ye,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.duplicate?.(e)},children:[t.jsx(Je,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(F,{variant:"destructive",onClick:s=>{s.stopPropagation(),n.delete?.(e)},children:[t.jsx(Ze,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function tt(n){const e=n.type;return Array.isArray(e)?e.every(s=>tt({type:s})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function Jt(n,e){const s=n.properties||{},d=Object.keys(s).filter(i=>{const u=s[i];return u&&tt(u)}),o=Bt(s),l=[],a=new Set;o&&d.includes(o)&&(l.push(o),a.add(o));const c=["title","description","updated_at","updated_by"];for(const i of c)d.includes(i)&&!a.has(i)&&(l.push(i),a.add(i));const f=d.filter(i=>!a.has(i)&&!Le.includes(i)).sort((i,u)=>i.localeCompare(u));for(const i of f)l.push(i),a.add(i);for(const i of Le)d.includes(i)&&!a.has(i)&&(l.push(i),a.add(i));return l.map(i=>{const u=s[i],j=e?e.includes(i):!["id"].includes(i);return i===o?{id:i,header:"",render:h=>{const m=h[i];return t.jsx(qe,{icon:m,name:h.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:i==="description"?{id:i,header:"Description",render:h=>{const m=h[i];return m==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(m)})},sortable:j,cellClassName:"max-w-[50ch]"}:i==="created_by"||i==="updated_by"?{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m?t.jsx(Mt,{id:String(m),size:"xs"}):"—"},sortable:j,cellClassName:"max-w-[250px]"}:u?.format==="date-time"||i.endsWith("_at")?{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m?t.jsx("span",{className:"block truncate max-w-full",children:new Date(m).toLocaleDateString()}):"—"},sortable:j,cellClassName:"max-w-[200px]"}:{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(m)})},sortable:j,cellClassName:"max-w-[200px]"}})}function Qt(n,e,s,d){const o=n||Jt(e,s);return o.some(c=>c.id==="actions")?o:Object.keys(d).length>0?[...o,Ht(d)]:o}function ws(n){const e=ne.c(117),{connectionId:s,org:d,activeCollection:o}=n,l=o.name,a=o.schema??bt,c=o.hasCreateTool,f=o.hasUpdateTool,i=o.hasDeleteTool,u=lt(),h=rt().location.href,{data:m}=at.useSession(),x=m?.user?.id||"unknown",y=jt(s);let C;e[0]!==s?(C=Re(s),e[0]=s,e[1]=C):C=e[1];const S=C,r=Ct(s,l,S),g=`${s}-${l}`;let v;e[2]!==d||e[3]!==g?(v={namespace:d,resource:g,defaultSortKey:"updated_at"},e[2]=d,e[3]=g,e[4]=v):v=e[4];const{search:p,searchTerm:_,setSearch:b,viewMode:P,setViewMode:T,sortKey:E,sortDirection:N,handleSort:$}=pt(v);let D;e[5]!==_||e[6]!==N||e[7]!==E?(D={searchTerm:_,sortKey:E,sortDirection:N},e[5]=_,e[6]=N,e[7]=E,e[8]=D):D=e[8];const z=vt(s,l,S,D),K=!c&&!f&&!i;let I;e[9]!==l||e[10]!==s||e[11]!==u||e[12]!==d?(I=w=>{u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:d,connectionId:s,collectionName:l,itemId:w.id}})},e[9]=l,e[10]=s,e[11]=u,e[12]=d,e[13]=I):I=e[13];const A=I;let O;e[14]!==r.create||e[15]!==x?(O=async w=>{const he=new Date().toISOString();await r.create.mutateAsync({...w,id:Me("conn"),title:`${w.title} (Copy)`,created_at:he,updated_at:he,created_by:x,updated_by:x})},e[14]=r.create,e[15]=x,e[16]=O):O=e[16];const k=O,[M,xe]=ct.useState(null);let le;e[17]===Symbol.for("react.memo_cache_sentinel")?(le=w=>{xe(w)},e[17]=le):le=e[17];const st=le;let U;e[18]!==A||e[19]!==f?(U=f&&{edit:A},e[18]=A,e[19]=f,e[20]=U):U=e[20];let B;e[21]!==k||e[22]!==c?(B=c&&{duplicate:k},e[21]=k,e[22]=c,e[23]=B):B=e[23];let L;e[24]!==i?(L=i&&{delete:st},e[24]=i,e[25]=L):L=e[25];let re;e[26]!==L||e[27]!==U||e[28]!==B?(re={...U,...B,...L},e[26]=L,e[27]=U,e[28]=B,e[29]=re):re=e[29];const ge=re;let ae;e[30]!==r.delete||e[31]!==M?(ae=async()=>{M&&(await r.delete.mutateAsync(M.id),xe(null))},e[30]=r.delete,e[31]=M,e[32]=ae):ae=e[32];const je=ae;let ce;e[33]!==r.create||e[34]!==l||e[35]!==s||e[36]!==c||e[37]!==u||e[38]!==d||e[39]!==x?(ce=async()=>{if(!c){dt.error("Create operation is not available for this collection");return}const w=new Date().toISOString(),he={id:Me("conn"),title:"New Item",description:"A brief description of the item",created_at:w,updated_at:w,created_by:x,updated_by:x};try{const Ee=await r.create.mutateAsync(he);u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:d,connectionId:s,collectionName:l,itemId:Ee.id}})}catch(Ee){console.error("Failed to create item:",Ee)}},e[33]=r.create,e[34]=l,e[35]=s,e[36]=c,e[37]=u,e[38]=d,e[39]=x,e[40]=ce):ce=e[40];const Ce=ce;let de;e[41]!==a?(de=et(a),e[41]=a,e[42]=de):de=e[42];const ve=de,Fe=(z?.length??0)>0,it=c&&Fe,ot=c&&!Fe&&!p;let me;e[43]!==r.create||e[44]!==Ce||e[45]!==c?(me=c?t.jsxs(ke,{onClick:Ce,size:"sm",disabled:r.create.isPending,className:"h-7",children:[t.jsx(It,{className:"mr-2 h-4 w-4"}),r.create.isPending?"Creating...":"Create"]}):null,e[43]=r.create,e[44]=Ce,e[45]=c,e[46]=me):me=e[46];const Ke=me,be=E;let R;e[47]!==$||e[48]!==T||e[49]!==N||e[50]!==ve||e[51]!==be||e[52]!==P?(R=t.jsx(Ve,{viewMode:P,onViewModeChange:T,sortKey:be,sortDirection:N,onSort:$,sortOptions:ve}),e[47]=$,e[48]=T,e[49]=N,e[50]=ve,e[51]=be,e[52]=P,e[53]=R):R=e[53];const ye=`${l}s`,Ne=y?.icon??"grid_view";let V;e[54]!==ye||e[55]!==Ne||e[56]!==h?(V=t.jsx(gt,{title:ye,url:h,icon:Ne}),e[54]=ye,e[55]=Ne,e[56]=h,e[57]=V):V=e[57];const we=it&&Ke;let q;e[58]!==R||e[59]!==V||e[60]!==we?(q=t.jsxs(Pt,{children:[R,V,we]}),e[58]=R,e[59]=V,e[60]=we,e[61]=q):q=e[61];const Se=`Search ${l}...`;let G;e[62]!==b?(G=w=>{w.key==="Escape"&&(b(""),w.target.blur())},e[62]=b,e[63]=G):G=e[63];let W;e[64]!==p||e[65]!==b||e[66]!==Se||e[67]!==G?(W=t.jsx(mt,{value:p,onChange:b,placeholder:Se,onKeyDown:G}),e[64]=p,e[65]=b,e[66]=Se,e[67]=G,e[68]=W):W=e[68];let H;e[69]!==z?(H=z??[],e[69]=z,e[70]=H):H=e[70];const _e=E;let J;e[71]!==A?(J=w=>A(w),e[71]=A,e[72]=J):J=e[72];const De="No items found",Ae=p?"Try adjusting your search terms":"This collection doesn't have any items yet.",Te=ot?Ke:void 0;let Q;e[73]!==De||e[74]!==Ae||e[75]!==Te?(Q=t.jsx(ut,{image:null,title:De,description:Ae,actions:Te}),e[73]=De,e[74]=Ae,e[75]=Te,e[76]=Q):Q=e[76];let Y;e[77]!==$||e[78]!==K||e[79]!==ge||e[80]!==a||e[81]!==p||e[82]!==b||e[83]!==T||e[84]!==N||e[85]!==H||e[86]!==_e||e[87]!==J||e[88]!==Q||e[89]!==P?(Y=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(Lt,{hideToolbar:!0,data:H,schema:a,viewMode:P,onViewModeChange:T,search:p,onSearchChange:b,sortKey:_e,sortDirection:N,onSort:$,actions:ge,onItemClick:J,readOnly:K,emptyState:Q})}),e[77]=$,e[78]=K,e[79]=ge,e[80]=a,e[81]=p,e[82]=b,e[83]=T,e[84]=N,e[85]=H,e[86]=_e,e[87]=J,e[88]=Q,e[89]=P,e[90]=Y):Y=e[90];let X;e[91]!==W||e[92]!==Y?(X=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[W,Y]}),e[91]=W,e[92]=Y,e[93]=X):X=e[93];const Ie=!!M;let fe;e[94]===Symbol.for("react.memo_cache_sentinel")?(fe=w=>{w||xe(null)},e[94]=fe):fe=e[94];let ue;e[95]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(wt,{children:"Delete item?"}),e[95]=ue):ue=e[95];const Pe=M?.title;let Z;e[96]!==Pe?(Z=t.jsxs(St,{children:[ue,t.jsxs(_t,{children:['Are you sure you want to delete "',Pe,'"? This action cannot be undone.']})]}),e[96]=Pe,e[97]=Z):Z=e[97];let ee;e[98]!==r.delete.isPending?(ee=t.jsx(yt,{disabled:r.delete.isPending,children:"Cancel"}),e[98]=r.delete.isPending,e[99]=ee):ee=e[99];const $e=r.delete.isPending?"Deleting...":"Delete";let te;e[100]!==r.delete.isPending||e[101]!==je||e[102]!==$e?(te=t.jsx(Nt,{onClick:je,disabled:r.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:$e}),e[100]=r.delete.isPending,e[101]=je,e[102]=$e,e[103]=te):te=e[103];let se;e[104]!==ee||e[105]!==te?(se=t.jsxs(Dt,{children:[ee,te]}),e[104]=ee,e[105]=te,e[106]=se):se=e[106];let ie;e[107]!==Z||e[108]!==se?(ie=t.jsxs(At,{children:[Z,se]}),e[107]=Z,e[108]=se,e[109]=ie):ie=e[109];let oe;e[110]!==Ie||e[111]!==ie?(oe=t.jsx(Tt,{open:Ie,onOpenChange:fe,children:ie}),e[110]=Ie,e[111]=ie,e[112]=oe):oe=e[112];let pe;return e[113]!==q||e[114]!==X||e[115]!==oe?(pe=t.jsxs(t.Fragment,{children:[q,X,oe]}),e[113]=q,e[114]=X,e[115]=oe,e[116]=pe):pe=e[116],pe}export{ws as C};
1
+ import{c as ne,j as t,K as nt,f as lt,k as rt,a as at,r as ct,t as dt}from"./index-Diww4UW3.js";import{g as Me}from"./generate-id-Dyweu44Y.js";import{c as Re}from"./connection-ChwHK0-S.js";import{C as Ve}from"./collection-display-button-CtkxsCB_.js";import{C as mt}from"./collection-search-BVb42O45.js";import{C as ft}from"./card-DIjMh1NO.js";import{I as qe,E as ut}from"./empty-state-wP9uukGJ.js";import{b as Ge,D as We,a as He,c as F}from"./dropdown-menu-CAeD2aIb.js";import{B as ke,c as ze}from"./button-CGmrzkpY.js";import{a as Je}from"./Copy01-CEYn2daS.js";import{i as Qe}from"./DotsVertical-BPP4U4GQ.js";import{i as Ye}from"./Edit01-Cq0mQDLh.js";import{s as Xe,u as pt}from"./use-list-state-AndcW8aD.js";import{s as Ze}from"./Trash01-BWIN9RL_.js";import{C as ht}from"./collection-table-wrapper-BohFZqii.js";import{E as Ue}from"./empty-state-BkAB-hls.js";import{n as Be}from"./Inbox01-BsOUYwQZ.js";import{A as Oe}from"./avatar-B7xnPXuk.js";import{u as xt}from"./useQuery-Bvk0U2ed.js";import{P as gt}from"./pin-to-sidebar-button-DIwkO0Tx.js";import{b as jt}from"./use-connection-CCXutWLD.js";import{a as Ct,b as vt}from"./use-collections-CXETocKO.js";import{B as bt}from"./constants-J0aH6mLs.js";import{A as yt,g as Nt,c as wt,b as St,d as _t,e as Dt,a as At,f as Tt}from"./alert-dialog-CCJCsKzK.js";import{s as It}from"./Plus-CdG75X26.js";import{V as Pt}from"./layout-kp8TTJc9.js";function $t(n,e){const s=n.properties||{};for(const o in s){const l=s[o];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&o in e&&e[o])return e[o]}const d=["image","img","avatar","icon","logo","thumbnail","cover"];for(const o of d)if(e&&typeof e=="object"&&o in e&&typeof e[o]=="string")return e[o]}function Et(n){const e=ne.c(25),{item:s,schema:d,actions:o}=n;let l;e[0]!==s||e[1]!==d?(l=$t(d,s),e[0]=s,e[1]=d,e[2]=l):l=e[2];const a=l,c=s&&typeof s=="object"&&"description"in s&&typeof s.description=="string"?s.description:void 0;let f;e[3]!==o?(f=o&&Object.keys(o).length>0,e[3]=o,e[4]=f):f=e[4];const i=f;let u;e[5]!==a||e[6]!==s.title?(u=t.jsx(qe,{icon:a,name:s.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=a,e[6]=s.title,e[7]=u):u=e[7];let j;e[8]!==s.title?(j=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=j):j=e[9];const h=c||"No description";let m;e[10]!==h?(m=t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:h}),e[10]=h,e[11]=m):m=e[11];let x;e[12]!==j||e[13]!==m?(x=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[j,m]}),e[12]=j,e[13]=m,e[14]=x):x=e[14];let y;e[15]!==u||e[16]!==x?(y=t.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[u,x]}),e[15]=u,e[16]=x,e[17]=y):y=e[17];let C;e[18]!==o||e[19]!==i||e[20]!==s?(C=i&&t.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:Ft,onMouseDown:kt,children:t.jsxs(Ge,{children:[t.jsx(We,{asChild:!0,children:t.jsx(ke,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Ot,children:t.jsx(Qe,{size:20})})}),t.jsxs(He,{align:"end",onClick:zt,children:[o.open&&t.jsxs(F,{onClick:r=>{r.stopPropagation(),o.open?.(s)},children:[t.jsx(Xe,{size:16}),"Open"]}),o.edit&&t.jsxs(F,{onClick:r=>{r.stopPropagation(),o.edit?.(s)},children:[t.jsx(Ye,{size:16}),"Edit"]}),o.duplicate&&t.jsxs(F,{onClick:r=>{r.stopPropagation(),o.duplicate?.(s)},children:[t.jsx(Je,{size:16}),"Duplicate"]}),o.delete&&t.jsxs(F,{variant:"destructive",onClick:r=>{r.stopPropagation(),o.delete?.(s)},children:[t.jsx(Ze,{size:16}),"Delete"]})]})]})}),e[18]=o,e[19]=i,e[20]=s,e[21]=C):C=e[21];let S;return e[22]!==y||e[23]!==C?(S=t.jsxs(ft,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[y,C]}),e[22]=y,e[23]=C,e[24]=S):S=e[24],S}function zt(n){return n.stopPropagation()}function Ot(n){return n.stopPropagation()}function kt(n){return n.stopPropagation()}function Ft(n){return n.stopPropagation()}function Kt(n){const e=ne.c(9);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=Re(),e[0]=s):s=e[0];const d=s;let o;e[1]!==n?(o=nt.user(n),e[1]=n,e[2]=o):o=e[2];let l;e[3]!==n?(l=async()=>(await d("USER_GET",{id:n})).user,e[3]=n,e[4]=l):l=e[4];const a=!!n;let c;return e[5]!==o||e[6]!==l||e[7]!==a?(c={queryKey:o,queryFn:l,staleTime:3e5,retry:1,enabled:a},e[5]=o,e[6]=l,e[7]=a,e[8]=c):c=e[8],xt(c)}function Mt(n){const e=ne.c(39),{id:s,size:d,showEmail:o,className:l}=n,a=d===void 0?"xs":d,c=o===void 0?!1:o,{data:f,isLoading:i,isError:u}=Kt(s);if(i){let r;e[0]!==l?(r=ze("flex items-center gap-2",l),e[0]=l,e[1]=r):r=e[1];let g;e[2]!==a?(g=t.jsx(Oe.Skeleton,{shape:"circle",size:a}),e[2]=a,e[3]=g):g=e[3];let v;e[4]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"h-3 w-24 bg-muted animate-pulse rounded"}),e[4]=v):v=e[4];let p;e[5]!==c?(p=c&&t.jsx("div",{className:"h-2 w-32 bg-muted animate-pulse rounded"}),e[5]=c,e[6]=p):p=e[6];let _;e[7]!==p?(_=t.jsxs("div",{className:"flex flex-col gap-1",children:[v,p]}),e[7]=p,e[8]=_):_=e[8];let b;return e[9]!==r||e[10]!==g||e[11]!==_?(b=t.jsxs("div",{className:r,children:[g,_]}),e[9]=r,e[10]=g,e[11]=_,e[12]=b):b=e[12],b}if(u||!f){let r;e[13]!==l?(r=ze("flex items-center gap-2",l),e[13]=l,e[14]=r):r=e[14];let g;e[15]!==a?(g=t.jsx(Oe,{shape:"circle",size:a,fallback:"?",muted:!0}),e[15]=a,e[16]=g):g=e[16];let v;e[17]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"flex flex-col",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Unknown User"})}),e[17]=v):v=e[17];let p;return e[18]!==r||e[19]!==g?(p=t.jsxs("div",{className:r,children:[g,v]}),e[18]=r,e[19]=g,e[20]=p):p=e[20],p}let j;e[21]!==l?(j=ze("flex items-center gap-2",l),e[21]=l,e[22]=j):j=e[22];const h=f.image??void 0;let m;e[23]!==a||e[24]!==h||e[25]!==f.name?(m=t.jsx(Oe,{shape:"circle",size:a,url:h,fallback:f.name}),e[23]=a,e[24]=h,e[25]=f.name,e[26]=m):m=e[26];let x;e[27]!==f.name?(x=t.jsx("div",{className:"text-sm font-medium",children:f.name}),e[27]=f.name,e[28]=x):x=e[28];let y;e[29]!==c||e[30]!==f.email?(y=c&&t.jsx("div",{className:"text-xs text-muted-foreground",children:f.email}),e[29]=c,e[30]=f.email,e[31]=y):y=e[31];let C;e[32]!==x||e[33]!==y?(C=t.jsxs("div",{className:"flex flex-col",children:[x,y]}),e[32]=x,e[33]=y,e[34]=C):C=e[34];let S;return e[35]!==j||e[36]!==m||e[37]!==C?(S=t.jsxs("div",{className:j,children:[m,C]}),e[35]=j,e[36]=m,e[37]=C,e[38]=S):S=e[38],S}const Ut=["icon","avatar","logo"],Le=["created_at","created_by","id"];function Bt(n){return Object.keys(n).find(e=>Ut.includes(e.toLowerCase()))}function et(n,e){return Object.keys(n.properties||{}).filter(s=>["id","created_at","updated_at","created_by","updated_by"].includes(s)?!1:e?e.includes(s):!0).map(s=>({id:s,label:s.charAt(0).toUpperCase()+s.slice(1).replace(/_/g," ")}))}function Lt(n){const e=ne.c(32),{data:s,schema:d,viewMode:o,onViewModeChange:l,search:a,sortKey:c,sortDirection:f,onSort:i,actions:u,onItemClick:j,headerActions:h,emptyState:m,readOnly:x,columns:y,hideToolbar:C,sortableFields:S}=n,r=l===void 0?Wt:l,g=f===void 0?"asc":f,v=i===void 0?Gt:i;let p;e[0]!==u?(p=u===void 0?{}:u,e[0]=u,e[1]=p):p=e[1];const _=p,b=j===void 0?qt:j,P=h===void 0?null:h,T=m===void 0?null:m,E=x===void 0?!1:x,N=y===void 0?void 0:y,$=C===void 0?!1:C,D=S===void 0?void 0:S;let z;e[2]!==N||e[3]!==d||e[4]!==D?(z=N?N.filter(Vt).filter(k=>!D||D.includes(k.id)).map(Rt):et(d,D),e[2]=N,e[3]=d,e[4]=D,e[5]=z):z=e[5];const K=z;let I;e[6]!==P||e[7]!==$||e[8]!==v||e[9]!==r||e[10]!==g||e[11]!==c||e[12]!==K||e[13]!==o?(I=!$&&t.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:t.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[t.jsx("div",{className:"flex items-center gap-2 flex-1",children:P}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(Ve,{viewMode:o,onViewModeChange:r,sortKey:c,sortDirection:g,onSort:v,sortOptions:K})})]})}),e[6]=P,e[7]=$,e[8]=v,e[9]=r,e[10]=g,e[11]=c,e[12]=K,e[13]=o,e[14]=I):I=e[14];let A;e[15]!==_||e[16]!==N||e[17]!==s||e[18]!==T||e[19]!==b||e[20]!==v||e[21]!==E||e[22]!==d||e[23]!==a||e[24]!==g||e[25]!==c||e[26]!==D||e[27]!==o?(A=o==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:s.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:T||t.jsx(Ue,{icon:t.jsx(Be,{size:36,className:"text-muted-foreground"}),title:"No items found",description:a?"Try adjusting your search":"No items to display"})}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:s.map(k=>t.jsx("div",{onClick:()=>b?.(k),className:"cursor-pointer h-full",children:t.jsx(Et,{item:k,schema:d,readOnly:E,actions:_})},k.id))})}):t.jsx(ht,{columns:Qt(N,d,D,_),data:s,sortKey:c,sortDirection:g,onSort:v,onRowClick:b,emptyState:T||t.jsx(Ue,{icon:t.jsx(Be,{size:36,className:"text-muted-foreground"}),title:"No items found",description:a?"Try adjusting your search":"No items to display"})}),e[15]=_,e[16]=N,e[17]=s,e[18]=T,e[19]=b,e[20]=v,e[21]=E,e[22]=d,e[23]=a,e[24]=g,e[25]=c,e[26]=D,e[27]=o,e[28]=A):A=e[28];let O;return e[29]!==I||e[30]!==A?(O=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[I,A]}),e[29]=I,e[30]=A,e[31]=O):O=e[31],O}function Rt(n){return{id:n.id,label:typeof n.header=="string"?n.header:n.id}}function Vt(n){return n.sortable!==!1}function qt(){}function Gt(){}function Wt(){}function Ht(n){return{id:"actions",header:"",render:e=>t.jsxs(Ge,{children:[t.jsx(We,{asChild:!0,children:t.jsx(ke,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:t.jsx(Qe,{size:20})})}),t.jsxs(He,{align:"end",onClick:s=>s.stopPropagation(),children:[n.open&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.open?.(e)},children:[t.jsx(Xe,{size:16}),"Open"]}),n.edit&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.edit?.(e)},children:[t.jsx(Ye,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.duplicate?.(e)},children:[t.jsx(Je,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(F,{variant:"destructive",onClick:s=>{s.stopPropagation(),n.delete?.(e)},children:[t.jsx(Ze,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function tt(n){const e=n.type;return Array.isArray(e)?e.every(s=>tt({type:s})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function Jt(n,e){const s=n.properties||{},d=Object.keys(s).filter(i=>{const u=s[i];return u&&tt(u)}),o=Bt(s),l=[],a=new Set;o&&d.includes(o)&&(l.push(o),a.add(o));const c=["title","description","updated_at","updated_by"];for(const i of c)d.includes(i)&&!a.has(i)&&(l.push(i),a.add(i));const f=d.filter(i=>!a.has(i)&&!Le.includes(i)).sort((i,u)=>i.localeCompare(u));for(const i of f)l.push(i),a.add(i);for(const i of Le)d.includes(i)&&!a.has(i)&&(l.push(i),a.add(i));return l.map(i=>{const u=s[i],j=e?e.includes(i):!["id"].includes(i);return i===o?{id:i,header:"",render:h=>{const m=h[i];return t.jsx(qe,{icon:m,name:h.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:i==="description"?{id:i,header:"Description",render:h=>{const m=h[i];return m==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(m)})},sortable:j,cellClassName:"max-w-[50ch]"}:i==="created_by"||i==="updated_by"?{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m?t.jsx(Mt,{id:String(m),size:"xs"}):"—"},sortable:j,cellClassName:"max-w-[250px]"}:u?.format==="date-time"||i.endsWith("_at")?{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m?t.jsx("span",{className:"block truncate max-w-full",children:new Date(m).toLocaleDateString()}):"—"},sortable:j,cellClassName:"max-w-[200px]"}:{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(m)})},sortable:j,cellClassName:"max-w-[200px]"}})}function Qt(n,e,s,d){const o=n||Jt(e,s);return o.some(c=>c.id==="actions")?o:Object.keys(d).length>0?[...o,Ht(d)]:o}function ws(n){const e=ne.c(117),{connectionId:s,org:d,activeCollection:o}=n,l=o.name,a=o.schema??bt,c=o.hasCreateTool,f=o.hasUpdateTool,i=o.hasDeleteTool,u=lt(),h=rt().location.href,{data:m}=at.useSession(),x=m?.user?.id||"unknown",y=jt(s);let C;e[0]!==s?(C=Re(s),e[0]=s,e[1]=C):C=e[1];const S=C,r=Ct(s,l,S),g=`${s}-${l}`;let v;e[2]!==d||e[3]!==g?(v={namespace:d,resource:g,defaultSortKey:"updated_at"},e[2]=d,e[3]=g,e[4]=v):v=e[4];const{search:p,searchTerm:_,setSearch:b,viewMode:P,setViewMode:T,sortKey:E,sortDirection:N,handleSort:$}=pt(v);let D;e[5]!==_||e[6]!==N||e[7]!==E?(D={searchTerm:_,sortKey:E,sortDirection:N},e[5]=_,e[6]=N,e[7]=E,e[8]=D):D=e[8];const z=vt(s,l,S,D),K=!c&&!f&&!i;let I;e[9]!==l||e[10]!==s||e[11]!==u||e[12]!==d?(I=w=>{u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:d,connectionId:s,collectionName:l,itemId:w.id}})},e[9]=l,e[10]=s,e[11]=u,e[12]=d,e[13]=I):I=e[13];const A=I;let O;e[14]!==r.create||e[15]!==x?(O=async w=>{const he=new Date().toISOString();await r.create.mutateAsync({...w,id:Me("conn"),title:`${w.title} (Copy)`,created_at:he,updated_at:he,created_by:x,updated_by:x})},e[14]=r.create,e[15]=x,e[16]=O):O=e[16];const k=O,[M,xe]=ct.useState(null);let le;e[17]===Symbol.for("react.memo_cache_sentinel")?(le=w=>{xe(w)},e[17]=le):le=e[17];const st=le;let U;e[18]!==A||e[19]!==f?(U=f&&{edit:A},e[18]=A,e[19]=f,e[20]=U):U=e[20];let B;e[21]!==k||e[22]!==c?(B=c&&{duplicate:k},e[21]=k,e[22]=c,e[23]=B):B=e[23];let L;e[24]!==i?(L=i&&{delete:st},e[24]=i,e[25]=L):L=e[25];let re;e[26]!==L||e[27]!==U||e[28]!==B?(re={...U,...B,...L},e[26]=L,e[27]=U,e[28]=B,e[29]=re):re=e[29];const ge=re;let ae;e[30]!==r.delete||e[31]!==M?(ae=async()=>{M&&(await r.delete.mutateAsync(M.id),xe(null))},e[30]=r.delete,e[31]=M,e[32]=ae):ae=e[32];const je=ae;let ce;e[33]!==r.create||e[34]!==l||e[35]!==s||e[36]!==c||e[37]!==u||e[38]!==d||e[39]!==x?(ce=async()=>{if(!c){dt.error("Create operation is not available for this collection");return}const w=new Date().toISOString(),he={id:Me("conn"),title:"New Item",description:"A brief description of the item",created_at:w,updated_at:w,created_by:x,updated_by:x};try{const Ee=await r.create.mutateAsync(he);u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:d,connectionId:s,collectionName:l,itemId:Ee.id}})}catch(Ee){console.error("Failed to create item:",Ee)}},e[33]=r.create,e[34]=l,e[35]=s,e[36]=c,e[37]=u,e[38]=d,e[39]=x,e[40]=ce):ce=e[40];const Ce=ce;let de;e[41]!==a?(de=et(a),e[41]=a,e[42]=de):de=e[42];const ve=de,Fe=(z?.length??0)>0,it=c&&Fe,ot=c&&!Fe&&!p;let me;e[43]!==r.create||e[44]!==Ce||e[45]!==c?(me=c?t.jsxs(ke,{onClick:Ce,size:"sm",disabled:r.create.isPending,className:"h-7",children:[t.jsx(It,{className:"mr-2 h-4 w-4"}),r.create.isPending?"Creating...":"Create"]}):null,e[43]=r.create,e[44]=Ce,e[45]=c,e[46]=me):me=e[46];const Ke=me,be=E;let R;e[47]!==$||e[48]!==T||e[49]!==N||e[50]!==ve||e[51]!==be||e[52]!==P?(R=t.jsx(Ve,{viewMode:P,onViewModeChange:T,sortKey:be,sortDirection:N,onSort:$,sortOptions:ve}),e[47]=$,e[48]=T,e[49]=N,e[50]=ve,e[51]=be,e[52]=P,e[53]=R):R=e[53];const ye=`${l}s`,Ne=y?.icon??"grid_view";let V;e[54]!==ye||e[55]!==Ne||e[56]!==h?(V=t.jsx(gt,{title:ye,url:h,icon:Ne}),e[54]=ye,e[55]=Ne,e[56]=h,e[57]=V):V=e[57];const we=it&&Ke;let q;e[58]!==R||e[59]!==V||e[60]!==we?(q=t.jsxs(Pt,{children:[R,V,we]}),e[58]=R,e[59]=V,e[60]=we,e[61]=q):q=e[61];const Se=`Search ${l}...`;let G;e[62]!==b?(G=w=>{w.key==="Escape"&&(b(""),w.target.blur())},e[62]=b,e[63]=G):G=e[63];let W;e[64]!==p||e[65]!==b||e[66]!==Se||e[67]!==G?(W=t.jsx(mt,{value:p,onChange:b,placeholder:Se,onKeyDown:G}),e[64]=p,e[65]=b,e[66]=Se,e[67]=G,e[68]=W):W=e[68];let H;e[69]!==z?(H=z??[],e[69]=z,e[70]=H):H=e[70];const _e=E;let J;e[71]!==A?(J=w=>A(w),e[71]=A,e[72]=J):J=e[72];const De="No items found",Ae=p?"Try adjusting your search terms":"This collection doesn't have any items yet.",Te=ot?Ke:void 0;let Q;e[73]!==De||e[74]!==Ae||e[75]!==Te?(Q=t.jsx(ut,{image:null,title:De,description:Ae,actions:Te}),e[73]=De,e[74]=Ae,e[75]=Te,e[76]=Q):Q=e[76];let Y;e[77]!==$||e[78]!==K||e[79]!==ge||e[80]!==a||e[81]!==p||e[82]!==b||e[83]!==T||e[84]!==N||e[85]!==H||e[86]!==_e||e[87]!==J||e[88]!==Q||e[89]!==P?(Y=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(Lt,{hideToolbar:!0,data:H,schema:a,viewMode:P,onViewModeChange:T,search:p,onSearchChange:b,sortKey:_e,sortDirection:N,onSort:$,actions:ge,onItemClick:J,readOnly:K,emptyState:Q})}),e[77]=$,e[78]=K,e[79]=ge,e[80]=a,e[81]=p,e[82]=b,e[83]=T,e[84]=N,e[85]=H,e[86]=_e,e[87]=J,e[88]=Q,e[89]=P,e[90]=Y):Y=e[90];let X;e[91]!==W||e[92]!==Y?(X=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[W,Y]}),e[91]=W,e[92]=Y,e[93]=X):X=e[93];const Ie=!!M;let fe;e[94]===Symbol.for("react.memo_cache_sentinel")?(fe=w=>{w||xe(null)},e[94]=fe):fe=e[94];let ue;e[95]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(wt,{children:"Delete item?"}),e[95]=ue):ue=e[95];const Pe=M?.title;let Z;e[96]!==Pe?(Z=t.jsxs(St,{children:[ue,t.jsxs(_t,{children:['Are you sure you want to delete "',Pe,'"? This action cannot be undone.']})]}),e[96]=Pe,e[97]=Z):Z=e[97];let ee;e[98]!==r.delete.isPending?(ee=t.jsx(yt,{disabled:r.delete.isPending,children:"Cancel"}),e[98]=r.delete.isPending,e[99]=ee):ee=e[99];const $e=r.delete.isPending?"Deleting...":"Delete";let te;e[100]!==r.delete.isPending||e[101]!==je||e[102]!==$e?(te=t.jsx(Nt,{onClick:je,disabled:r.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:$e}),e[100]=r.delete.isPending,e[101]=je,e[102]=$e,e[103]=te):te=e[103];let se;e[104]!==ee||e[105]!==te?(se=t.jsxs(Dt,{children:[ee,te]}),e[104]=ee,e[105]=te,e[106]=se):se=e[106];let ie;e[107]!==Z||e[108]!==se?(ie=t.jsxs(At,{children:[Z,se]}),e[107]=Z,e[108]=se,e[109]=ie):ie=e[109];let oe;e[110]!==Ie||e[111]!==ie?(oe=t.jsx(Tt,{open:Ie,onOpenChange:fe,children:ie}),e[110]=Ie,e[111]=ie,e[112]=oe):oe=e[112];let pe;return e[113]!==q||e[114]!==X||e[115]!==oe?(pe=t.jsxs(t.Fragment,{children:[q,X,oe]}),e[113]=q,e[114]=X,e[115]=oe,e[116]=pe):pe=e[116],pe}export{ws as C};
@@ -1 +1 @@
1
- import{c as g,j as o}from"./index-skH-OUyO.js";import{c as u}from"./button-Dh_UOMtF.js";import{n as T}from"./collection-display-button-DKfm8yFW.js";import{i as $}from"./ArrowUp-BDjaIiFu.js";function R(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("w-full caption-bottom text-sm min-w-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("div",{"data-slot":"table-container",className:"relative w-full min-w-0",children:o.jsx("table",{"data-slot":"table",className:l,...s})}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function H(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("[&_tr]:border-b",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("thead",{"data-slot":"table-header",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function L(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("[&_tr:last-child]:border-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("tbody",{"data-slot":"table-body",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function S(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("data-[state=selected]:bg-muted border-b transition-colors",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("tr",{"data-slot":"table-row",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function z(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("th",{"data-slot":"table-head",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function D(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("td",{"data-slot":"table-cell",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function E(a){const e=g.c(29),{columns:t,data:s,sortKey:l,sortDirection:r,onSort:f,onRowClick:c,rowClassName:x}=a;let h;e[0]!==r?(h=function(n,N){return o.jsx("div",{className:"w-4 flex items-center justify-center",children:N&&r&&(r==="asc"?o.jsx($,{size:16,className:"text-muted-foreground transition-colors"}):o.jsx(T,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=r,e[1]=h):h=e[1];const w=h;let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=function(n,N){let C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider";return n===N-1&&(C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider w-8"),C},e[2]=p):p=e[2];const i=p;let d;if(e[3]!==t||e[4]!==f||e[5]!==w||e[6]!==l){let m;e[8]!==t.length||e[9]!==f||e[10]!==w||e[11]!==l?(m=(n,N)=>{const C=l===n.id;return o.jsx(z,{className:u(i(N,t.length),"group transition-colors select-none",n.sortable&&"hover:bg-accent cursor-pointer",n.rowClassName,n.cellClassName),onClick:n.sortable&&f?()=>f(n.id):void 0,children:o.jsxs("span",{className:"flex items-center gap-1",children:[n.header,n.sortable&&w(n.id,C)]})},n.id)},e[8]=t.length,e[9]=f,e[10]=w,e[11]=l,e[12]=m):m=e[12],d=t.map(m),e[3]=t,e[4]=f,e[5]=w,e[6]=l,e[7]=d}else d=e[7];let j;e[13]!==d?(j=o.jsx(H,{className:"sticky top-0 z-10 border-b-0 bg-muted/30",children:o.jsx(S,{className:"h-9 hover:bg-transparent border-b border-border",children:d})}),e[13]=d,e[14]=j):j=e[14];let v;if(e[15]!==t||e[16]!==s||e[17]!==c||e[18]!==x){let m;e[20]!==t||e[21]!==c||e[22]!==x?(m=(n,N)=>{const C=x?.(n);return o.jsx(S,{"data-row-index":N,className:u("group/data-row transition-colors border-b-0 hover:bg-accent/50",c?"cursor-pointer":"",C),onClick:c?()=>c(n):void 0,children:t.map(b=>o.jsx(D,{className:u("px-5 py-4 h-16 align-middle text-sm text-foreground",b.cellClassName,b.wrap?"whitespace-normal wrap-break-word":""),children:o.jsx("div",{className:u(b.wrap?"w-full":"min-w-0 w-full",!b.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:b.render?b.render(n):b.accessor?b.accessor(n):null})},b.id))},N)},e[20]=t,e[21]=c,e[22]=x,e[23]=m):m=e[23],v=s.map(m),e[15]=t,e[16]=s,e[17]=c,e[18]=x,e[19]=v}else v=e[19];let y;e[24]!==v?(y=o.jsx(L,{children:v}),e[24]=v,e[25]=y):y=e[25];let k;return e[26]!==j||e[27]!==y?(k=o.jsx("div",{className:"w-full bg-background min-w-0",children:o.jsxs(R,{className:"w-full border-collapse",children:[j,y]})}),e[26]=j,e[27]=y,e[28]=k):k=e[28],k}function W(a){const e=g.c(12),{columns:t,data:s,isLoading:l,sortKey:r,sortDirection:f,onSort:c,onRowClick:x,emptyState:h}=a;if(l===void 0?!1:l){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=i):i=e[0],i}if(s.length===0){let i;e[1]!==h?(i=h||o.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=h,e[2]=i):i=e[2];let d;return e[3]!==i?(d=o.jsx("div",{className:"flex items-center justify-center h-full",children:i}),e[3]=i,e[4]=d):d=e[4],d}let p;return e[5]!==t||e[6]!==s||e[7]!==x||e[8]!==c||e[9]!==f||e[10]!==r?(p=o.jsx("div",{className:"flex-1 overflow-auto",children:o.jsx(E,{columns:t,data:s,sortKey:r,sortDirection:f,onSort:c,onRowClick:x})}),e[5]=t,e[6]=s,e[7]=x,e[8]=c,e[9]=f,e[10]=r,e[11]=p):p=e[11],p}export{W as C};
1
+ import{c as g,j as o}from"./index-Diww4UW3.js";import{c as u}from"./button-CGmrzkpY.js";import{n as T}from"./collection-display-button-CtkxsCB_.js";import{i as $}from"./ArrowUp-BF7mM4C2.js";function R(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("w-full caption-bottom text-sm min-w-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("div",{"data-slot":"table-container",className:"relative w-full min-w-0",children:o.jsx("table",{"data-slot":"table",className:l,...s})}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function H(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("[&_tr]:border-b",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("thead",{"data-slot":"table-header",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function L(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("[&_tr:last-child]:border-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("tbody",{"data-slot":"table-body",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function S(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("data-[state=selected]:bg-muted border-b transition-colors",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("tr",{"data-slot":"table-row",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function z(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("th",{"data-slot":"table-head",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function D(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("td",{"data-slot":"table-cell",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function E(a){const e=g.c(29),{columns:t,data:s,sortKey:l,sortDirection:r,onSort:f,onRowClick:c,rowClassName:x}=a;let h;e[0]!==r?(h=function(n,N){return o.jsx("div",{className:"w-4 flex items-center justify-center",children:N&&r&&(r==="asc"?o.jsx($,{size:16,className:"text-muted-foreground transition-colors"}):o.jsx(T,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=r,e[1]=h):h=e[1];const w=h;let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=function(n,N){let C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider";return n===N-1&&(C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider w-8"),C},e[2]=p):p=e[2];const i=p;let d;if(e[3]!==t||e[4]!==f||e[5]!==w||e[6]!==l){let m;e[8]!==t.length||e[9]!==f||e[10]!==w||e[11]!==l?(m=(n,N)=>{const C=l===n.id;return o.jsx(z,{className:u(i(N,t.length),"group transition-colors select-none",n.sortable&&"hover:bg-accent cursor-pointer",n.rowClassName,n.cellClassName),onClick:n.sortable&&f?()=>f(n.id):void 0,children:o.jsxs("span",{className:"flex items-center gap-1",children:[n.header,n.sortable&&w(n.id,C)]})},n.id)},e[8]=t.length,e[9]=f,e[10]=w,e[11]=l,e[12]=m):m=e[12],d=t.map(m),e[3]=t,e[4]=f,e[5]=w,e[6]=l,e[7]=d}else d=e[7];let j;e[13]!==d?(j=o.jsx(H,{className:"sticky top-0 z-10 border-b-0 bg-muted/30",children:o.jsx(S,{className:"h-9 hover:bg-transparent border-b border-border",children:d})}),e[13]=d,e[14]=j):j=e[14];let v;if(e[15]!==t||e[16]!==s||e[17]!==c||e[18]!==x){let m;e[20]!==t||e[21]!==c||e[22]!==x?(m=(n,N)=>{const C=x?.(n);return o.jsx(S,{"data-row-index":N,className:u("group/data-row transition-colors border-b-0 hover:bg-accent/50",c?"cursor-pointer":"",C),onClick:c?()=>c(n):void 0,children:t.map(b=>o.jsx(D,{className:u("px-5 py-4 h-16 align-middle text-sm text-foreground",b.cellClassName,b.wrap?"whitespace-normal wrap-break-word":""),children:o.jsx("div",{className:u(b.wrap?"w-full":"min-w-0 w-full",!b.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:b.render?b.render(n):b.accessor?b.accessor(n):null})},b.id))},N)},e[20]=t,e[21]=c,e[22]=x,e[23]=m):m=e[23],v=s.map(m),e[15]=t,e[16]=s,e[17]=c,e[18]=x,e[19]=v}else v=e[19];let y;e[24]!==v?(y=o.jsx(L,{children:v}),e[24]=v,e[25]=y):y=e[25];let k;return e[26]!==j||e[27]!==y?(k=o.jsx("div",{className:"w-full bg-background min-w-0",children:o.jsxs(R,{className:"w-full border-collapse",children:[j,y]})}),e[26]=j,e[27]=y,e[28]=k):k=e[28],k}function W(a){const e=g.c(12),{columns:t,data:s,isLoading:l,sortKey:r,sortDirection:f,onSort:c,onRowClick:x,emptyState:h}=a;if(l===void 0?!1:l){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=i):i=e[0],i}if(s.length===0){let i;e[1]!==h?(i=h||o.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=h,e[2]=i):i=e[2];let d;return e[3]!==i?(d=o.jsx("div",{className:"flex items-center justify-center h-full",children:i}),e[3]=i,e[4]=d):d=e[4],d}let p;return e[5]!==t||e[6]!==s||e[7]!==x||e[8]!==c||e[9]!==f||e[10]!==r?(p=o.jsx("div",{className:"flex-1 overflow-auto",children:o.jsx(E,{columns:t,data:s,sortKey:r,sortDirection:f,onSort:c,onRowClick:x})}),e[5]=t,e[6]=s,e[7]=x,e[8]=c,e[9]=f,e[10]=r,e[11]=p):p=e[11],p}export{W as C};
@@ -1,2 +1,2 @@
1
- import{r as b,y as r,_ as d,I as a,z as e,J as n,aG as s,aK as m}from"./index-skH-OUyO.js";b.createContext(void 0);const h="UNKNOWN_CONNECTION_ID",_=async o=>{const i=(await o.text()).split(`
1
+ import{r as b,y as r,_ as d,I as a,z as e,J as n,aG as s,aK as m}from"./index-Diww4UW3.js";b.createContext(void 0);const h="UNKNOWN_CONNECTION_ID",_=async o=>{const i=(await o.text()).split(`
2
2
  `).find(t=>t.startsWith("data: "));if(!i)throw new Error("No data received from the server");return JSON.parse(i.replace("data: ",""))};function w(o){if(o===h)return(async()=>{});const l=o?`/mcp/${o}`:"/mcp";return async(i,u)=>{const t=await fetch(l,{method:"POST",body:JSON.stringify({jsonrpc:"2.0",id:1,method:"tools/call",params:{name:i,arguments:u}}),headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream"},credentials:"include"});if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);const c=(t.headers.get("Content-Type")??"").startsWith("application/json")?await t.json():await _(t);if(c.result?.isError)throw new Error(c.result.content?.[0]?.text||"Tool call failed");return c.result?.structuredContent||c.result}}const f=r({authorizationEndpoint:e().url(),tokenEndpoint:e().url(),introspectionEndpoint:e().url().optional(),clientId:e(),clientSecret:e().optional(),scopes:a(e()),grantType:d(["authorization_code","client_credentials"])}),g=r({name:e(),description:e().optional(),inputSchema:n(e(),s()),outputSchema:n(e(),s()).optional()}),T=r({headers:n(e(),e()).optional()}),y=r({command:e().describe("Command to run (e.g., 'npx', 'node')"),args:a(e()).optional().describe("Command arguments"),cwd:e().optional().describe("Working directory"),envVars:n(e(),e()).optional().describe("Environment variables (encrypted in storage)")}),p=r({id:e().describe("Unique identifier for the connection"),title:e().describe("Human-readable name for the connection"),created_at:e().describe("When the connection was created"),updated_at:e().describe("When the connection was last updated"),created_by:e().describe("User ID who created the connection"),updated_by:e().optional().describe("User ID who last updated the connection"),organization_id:e().describe("Organization ID this connection belongs to"),description:e().nullable().describe("Description of the connection"),icon:e().nullable().describe("Icon URL for the connection"),app_name:e().nullable().describe("Associated app name"),app_id:e().nullable().describe("Associated app ID"),connection_type:d(["HTTP","SSE","Websocket","STDIO"]).describe("Type of connection"),connection_url:e().nullable().describe("URL for HTTP/SSE/WebSocket connections. Null for STDIO."),connection_token:e().nullable().describe("Authentication token (for HTTP connections)"),connection_headers:m([y,T]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:f.nullable().describe("OAuth configuration"),configuration_state:n(e(),s()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:a(e()).nullable().optional().describe("Configuration scopes"),metadata:n(e(),s()).nullable().describe("Additional metadata (includes repository info)"),tools:a(g).nullable().describe("Discovered tools from MCP"),bindings:a(e()).nullable().describe("Detected bindings"),status:d(["active","inactive","error"]).describe("Current status")});p.omit({created_at:!0,updated_at:!0,created_by:!0,updated_by:!0,organization_id:!0,tools:!0,bindings:!0,status:!0}).partial({id:!0,description:!0,icon:!0,app_name:!0,app_id:!0,connection_url:!0,connection_token:!0,connection_headers:!0,oauth_config:!0,configuration_state:!0,configuration_scopes:!0,metadata:!0});p.partial();export{h as U,w as c};
@@ -1 +1 @@
1
- import{c as S,j as s}from"./index-skH-OUyO.js";import{C as _}from"./card-Bjs7HBa2.js";import{c as j}from"./button-Dh_UOMtF.js";import{I as A}from"./empty-state-DhpaMqQD.js";function H(h){const e=S.c(40),{connection:t,onClick:g,headerActions:v,footer:C,className:k,size:R,fallbackIcon:z}=h,b=R===void 0?"md":R,y=b==="sm"?"p-4":"p-6",I=b==="sm"?"text-sm":"text-base",w=b==="sm"?"text-xs":"text-sm",E=g&&"hover:bg-muted/50";let i;e[0]!==k||e[1]!==E?(i=j("cursor-pointer transition-colors group",E,k),e[0]=k,e[1]=E,e[2]=i):i=e[2];let l;e[3]!==y?(l=j("flex flex-col gap-4 relative",y),e[3]=y,e[4]=l):l=e[4];let o;e[5]!==t.icon||e[6]!==t.title||e[7]!==z?(o=s.jsx(A,{icon:t.icon,name:t.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:z}),e[5]=t.icon,e[6]=t.title,e[7]=z,e[8]=o):o=e[8];let n;e[9]!==v?(n=v&&s.jsx("div",{className:j("transition-opacity","opacity-0 group-hover:opacity-100"),onClick:q,children:v}),e[9]=v,e[10]=n):n=e[10];let c;e[11]!==n?(c=s.jsx("div",{className:"relative",children:n}),e[11]=n,e[12]=c):c=e[12];let r;e[13]!==o||e[14]!==c?(r=s.jsxs("div",{className:"flex items-start justify-between",children:[o,c]}),e[13]=o,e[14]=c,e[15]=r):r=e[15];let a;e[16]!==I?(a=j("font-medium text-foreground truncate",I),e[16]=I,e[17]=a):a=e[17];let m;e[18]!==t.title||e[19]!==a?(m=s.jsx("h3",{className:a,children:t.title}),e[18]=t.title,e[19]=a,e[20]=m):m=e[20];let d;e[21]!==w?(d=j("text-muted-foreground line-clamp-2",w),e[21]=w,e[22]=d):d=e[22];const P=t.description||"No description";let f;e[23]!==d||e[24]!==P?(f=s.jsx("p",{className:d,children:P}),e[23]=d,e[24]=P,e[25]=f):f=e[25];let p;e[26]!==m||e[27]!==f?(p=s.jsxs("div",{className:"flex flex-col gap-0",children:[m,f]}),e[26]=m,e[27]=f,e[28]=p):p=e[28];let x;e[29]!==C?(x=C&&s.jsx("div",{onClick:$,children:C}),e[29]=C,e[30]=x):x=e[30];let u;e[31]!==p||e[32]!==x||e[33]!==l||e[34]!==r?(u=s.jsxs("div",{className:l,children:[r,p,x]}),e[31]=p,e[32]=x,e[33]=l,e[34]=r,e[35]=u):u=e[35];let N;return e[36]!==g||e[37]!==u||e[38]!==i?(N=s.jsx(_,{className:i,onClick:g,children:u}),e[36]=g,e[37]=u,e[38]=i,e[39]=N):N=e[39],N}function $(h){return h.stopPropagation()}function q(h){return h.stopPropagation()}export{H as C};
1
+ import{c as S,j as s}from"./index-Diww4UW3.js";import{C as _}from"./card-DIjMh1NO.js";import{c as j}from"./button-CGmrzkpY.js";import{I as A}from"./empty-state-wP9uukGJ.js";function H(h){const e=S.c(40),{connection:t,onClick:g,headerActions:v,footer:C,className:k,size:R,fallbackIcon:z}=h,b=R===void 0?"md":R,y=b==="sm"?"p-4":"p-6",I=b==="sm"?"text-sm":"text-base",w=b==="sm"?"text-xs":"text-sm",E=g&&"hover:bg-muted/50";let i;e[0]!==k||e[1]!==E?(i=j("cursor-pointer transition-colors group",E,k),e[0]=k,e[1]=E,e[2]=i):i=e[2];let l;e[3]!==y?(l=j("flex flex-col gap-4 relative",y),e[3]=y,e[4]=l):l=e[4];let o;e[5]!==t.icon||e[6]!==t.title||e[7]!==z?(o=s.jsx(A,{icon:t.icon,name:t.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:z}),e[5]=t.icon,e[6]=t.title,e[7]=z,e[8]=o):o=e[8];let n;e[9]!==v?(n=v&&s.jsx("div",{className:j("transition-opacity","opacity-0 group-hover:opacity-100"),onClick:q,children:v}),e[9]=v,e[10]=n):n=e[10];let c;e[11]!==n?(c=s.jsx("div",{className:"relative",children:n}),e[11]=n,e[12]=c):c=e[12];let r;e[13]!==o||e[14]!==c?(r=s.jsxs("div",{className:"flex items-start justify-between",children:[o,c]}),e[13]=o,e[14]=c,e[15]=r):r=e[15];let a;e[16]!==I?(a=j("font-medium text-foreground truncate",I),e[16]=I,e[17]=a):a=e[17];let m;e[18]!==t.title||e[19]!==a?(m=s.jsx("h3",{className:a,children:t.title}),e[18]=t.title,e[19]=a,e[20]=m):m=e[20];let d;e[21]!==w?(d=j("text-muted-foreground line-clamp-2",w),e[21]=w,e[22]=d):d=e[22];const P=t.description||"No description";let f;e[23]!==d||e[24]!==P?(f=s.jsx("p",{className:d,children:P}),e[23]=d,e[24]=P,e[25]=f):f=e[25];let p;e[26]!==m||e[27]!==f?(p=s.jsxs("div",{className:"flex flex-col gap-0",children:[m,f]}),e[26]=m,e[27]=f,e[28]=p):p=e[28];let x;e[29]!==C?(x=C&&s.jsx("div",{onClick:$,children:C}),e[29]=C,e[30]=x):x=e[30];let u;e[31]!==p||e[32]!==x||e[33]!==l||e[34]!==r?(u=s.jsxs("div",{className:l,children:[r,p,x]}),e[31]=p,e[32]=x,e[33]=l,e[34]=r,e[35]=u):u=e[35];let N;return e[36]!==g||e[37]!==u||e[38]!==i?(N=s.jsx(_,{className:i,onClick:g,children:u}),e[36]=g,e[37]=u,e[38]=i,e[39]=N):N=e[39],N}function $(h){return h.stopPropagation()}function q(h){return h.stopPropagation()}export{H as C};
@@ -1 +1 @@
1
- import{c as q,j as o,f as W,k as J,r as z,d as ce,b as ae,af as le}from"./index-skH-OUyO.js";import{E as F,I as Q}from"./empty-state-DhpaMqQD.js";import{E as X}from"./error-boundary-_npCfvs4.js";import{b as G,a as me}from"./use-connection-BY9aOm7H.js";import{a as de}from"./use-binding-R6SoNecZ.js";import{u as ue,S as pe}from"./index-BRipTsvS.js";import{u as fe,a as he}from"./use-connection-resources-D2N-7Fdh.js";import{B as xe}from"./button-Dh_UOMtF.js";import{i as Y}from"./Loading01-BtKovu_m.js";import{R as ge}from"./resource-tabs-Dzc9tSXU.js";import{V as Z,a as be,b as je}from"./layout-DopLDDPE.js";import{C as ye}from"./collection-tab-BQzpUnQW.js";import{C as ee}from"./collection-display-button-DKfm8yFW.js";import{C as te}from"./collection-search-Bm9HY_m8.js";import{C as oe}from"./collection-table-wrapper-CnCS_a8f.js";import{P as se}from"./pin-to-sidebar-button-C5qdidS1.js";import{C as ne}from"./card-Bjs7HBa2.js";import{R as Se,T as Ce}from"./tools-list-DNdG8U23.js";import"./connection-DuIRkEvB.js";import"./project-context-provider-Ci1EHyGR.js";import"./use-collections-CC15C_nK.js";import"./useMutation-n0xwrWOz.js";import"./binder-DZT62WgB.js";import"./mcp-oauth-B6eUt4Mr.js";import"./env-vars-editor-BwDtTYE8.js";import"./input-CdlPz8Vq.js";import"./Plus-CPExS1G1.js";import"./Trash01-DCb3R_1E.js";import"./use-tool-call-_jHZu2qb.js";import"./useQuery-FRehIqtM.js";import"./File06-K5gpmB1y.js";import"./Key01-B8mxyE2f.js";import"./badge-ChGpQW0J.js";import"./form-BEM8UzSv.js";import"./select-B4aq4vxk.js";import"./tooltip-DgJ4R-G6.js";import"./Check-Cs5AiVxS.js";import"./ChevronDown-7pGjkuTY.js";import"./extract-connection-data-DfFE7uXb.js";import"./constants-C1rpewgJ.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-8goOeMwE.js";import"./generate-id-Dyweu44Y.js";import"./Terminal-LP4GeLJv.js";import"./use-gateway-CmDE4xLF.js";import"./Grid01-XLGz76ym.js";import"./index-C6eYxyql.js";import"./index-DanqEyuv.js";import"./index-Dh8Y3NBs.js";import"./X-DWXiZn3v.js";import"./popover-B4iU4oXK.js";import"./textarea-B7no0HbU.js";import"./AlertCircle-DeGhTF84.js";import"./ArrowUp-BDjaIiFu.js";import"./Edit01-CcxqoKWW.js";import"./use-gateway-system-prompt-nzDoNyO-.js";import"./localstorage-keys-B_H3St2R.js";import"./SearchMd-DwKDi1yz.js";import"./use-create-gateway-D4_8vfl-.js";import"./Image01-CycaMeSm.js";import"./spinner-DwVZzFPC.js";import"./Copy01-B_oHlu2-.js";import"./monaco-editor-CKUC5K4P.js";import"./alert-dialog-CNXrLp-S.js";import"./well-known-mcp-DOEdYmKO.js";import"./ArrowLeft-m6KeIjPT.js";import"./dropdown-menu-T7u8fl7N.js";import"./DotsVertical-HKe7Lpcg.js";import"./use-list-state-B0HVVNOr.js";import"./use-mobile-CZeMkOxo.js";import"./empty-state-ylKJe6-v.js";import"./Inbox01-1DQwZbO-.js";import"./avatar-noXapmql.js";import"./List-DWWQESNh.js";import"./view-mode-toggle-Z5AVjYj0.js";import"./use-organization-settings-8tWqPbhq.js";function ve(t){const e=q.c(42),{prompts:r,connectionId:n,org:s,connectionTitle:a,connectionIcon:f,onPromptClick:j,showToolbar:g,emptyMessage:N}=t,V=g===void 0?!0:g,L=N===void 0?"This connection doesn't have any prompts yet.":N,p=W(),y=J().location.href,[l,i]=z.useState(""),[w,m]=z.useState("table"),[h,R]=z.useState("name"),[u,_]=z.useState("asc");let b;e[0]!==u||e[1]!==h?(b=x=>{h===x?(_(Ie),u==="desc"&&R(void 0)):(R(x),_("asc"))},e[0]=u,e[1]=h,e[2]=b):b=e[2];const T=b;let P;e[3]!==n||e[4]!==p||e[5]!==j||e[6]!==s?(P=x=>{j?j(x):n&&s&&p({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:s,connectionId:n,collectionName:"prompts",itemId:encodeURIComponent(x.name)}})},e[3]=n,e[4]=p,e[5]=j,e[6]=s,e[7]=P):P=e[7];const M=P;let O;if(e[8]!==r||e[9]!==l||e[10]!==u||e[11]!==h){const x=!r||r.length===0?[]:l.trim()?(()=>{const S=l.toLowerCase();return r.filter(B=>B.name.toLowerCase().includes(S)||B.description&&B.description.toLowerCase().includes(S))})():r;O=!h||!u?x:[...x].sort((S,B)=>{const re=S[h]||"",ie=B[h]||"",H=String(re).localeCompare(String(ie));return u==="asc"?H:-H}),e[8]=r,e[9]=l,e[10]=u,e[11]=h,e[12]=O}else O=e[12];const d=O;let K;e[13]===Symbol.for("react.memo_cache_sentinel")?(K=[{id:"name",header:"Name",render:$e,sortable:!0},{id:"description",header:"Description",render:Te,cellClassName:"flex-1",sortable:!0}],e[13]=K):K=e[13];const A=K;let E;e[14]===Symbol.for("react.memo_cache_sentinel")?(E=A.filter(we).map(Ne),e[14]=E):E=e[14];const D=E;let $;e[15]!==f||e[16]!==a||e[17]!==T||e[18]!==V||e[19]!==u||e[20]!==h||e[21]!==y||e[22]!==w?($=V&&o.jsxs(Z,{children:[o.jsx(ee,{viewMode:w,onViewModeChange:m,sortKey:h,sortDirection:u,onSort:T,sortOptions:D}),o.jsx(se,{title:a?`${a}: Prompts`:"Prompts",url:y,icon:f??"description"})]}),e[15]=f,e[16]=a,e[17]=T,e[18]=V,e[19]=u,e[20]=h,e[21]=y,e[22]=w,e[23]=$):$=e[23];let I;e[24]===Symbol.for("react.memo_cache_sentinel")?(I=x=>{x.key==="Escape"&&(i(""),x.target.blur())},e[24]=I):I=e[24];let k;e[25]!==l?(k=o.jsx(te,{value:l,onChange:i,placeholder:"Search prompts...",onKeyDown:I}),e[25]=l,e[26]=k):k=e[26];let c;e[27]!==L||e[28]!==M||e[29]!==T||e[30]!==l||e[31]!==u||e[32]!==h||e[33]!==d||e[34]!==w?(c=w==="cards"?o.jsx("div",{className:"flex-1 overflow-auto p-5",children:d.length===0?o.jsx(F,{image:null,title:l?"No prompts found":"No prompts available",description:l?"Try adjusting your search terms":L}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:d.map(x=>o.jsx(ne,{className:"cursor-pointer transition-colors",onClick:()=>M(x),children:o.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[o.jsx(Q,{icon:null,name:x.name,size:"md",className:"shrink-0 shadow-sm"}),o.jsxs("div",{className:"flex flex-col gap-0",children:[o.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:x.name}),o.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:x.description||"No description"})]})]})},x.name))})}):o.jsx(oe,{columns:A,data:d,isLoading:!1,sortKey:h,sortDirection:u,onSort:T,onRowClick:x=>M(x),emptyState:o.jsx(F,{image:null,title:l?"No prompts found":"No prompts available",description:l?"Try adjusting your search terms":L})}),e[27]=L,e[28]=M,e[29]=T,e[30]=l,e[31]=u,e[32]=h,e[33]=d,e[34]=w,e[35]=c):c=e[35];let C;e[36]!==k||e[37]!==c?(C=o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[k,c]}),e[36]=k,e[37]=c,e[38]=C):C=e[38];let v;return e[39]!==C||e[40]!==$?(v=o.jsxs(o.Fragment,{children:[$,C]}),e[39]=C,e[40]=$,e[41]=v):v=e[41],v}function Ne(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function we(t){return t.sortable}function Te(t){return o.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function $e(t){return o.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:t.name})}function Ie(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function ke(t){const e=q.c(6),{prompts:r,connectionId:n,org:s}=t,a=G(n),f=a?.title,j=a?.icon;let g;return e[0]!==n||e[1]!==s||e[2]!==r||e[3]!==f||e[4]!==j?(g=o.jsx(ve,{prompts:r,connectionId:n,org:s,connectionTitle:f,connectionIcon:j}),e[0]=n,e[1]=s,e[2]=r,e[3]=f,e[4]=j,e[5]=g):g=e[5],g}function Re(t){const e=q.c(2),{repository:r}=t;let n;return e[0]!==r?(n=o.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:o.jsx(Se,{repository:r})}),e[0]=r,e[1]=n):n=e[1],n}function _e(t){const e=q.c(39),{resources:r,connectionTitle:n,connectionIcon:s,onResourceClick:a,showToolbar:f,emptyMessage:j}=t,g=f===void 0?!0:f,N=j===void 0?"This connection doesn't have any resources yet.":j,L=J().location.href,[p,U]=z.useState(""),[y,l]=z.useState("table"),[i,w]=z.useState("name"),[m,h]=z.useState("asc");let R;e[0]!==m||e[1]!==i?(R=c=>{i===c?(h(De),m==="desc"&&w(void 0)):(w(c),h("asc"))},e[0]=m,e[1]=i,e[2]=R):R=e[2];const u=R;let _;e[3]!==a?(_=c=>{a&&a(c)},e[3]=a,e[4]=_):_=e[4];const b=_;let T;if(e[5]!==r||e[6]!==p||e[7]!==m||e[8]!==i){const c=!r||r.length===0?[]:p.trim()?(()=>{const C=p.toLowerCase();return r.filter(v=>v.uri.toLowerCase().includes(C)||v.name&&v.name.toLowerCase().includes(C)||v.description&&v.description.toLowerCase().includes(C))})():r;T=!i||!m?c:[...c].sort((C,v)=>{const x=C[i]||"",S=v[i]||"",B=String(x).localeCompare(String(S));return m==="asc"?B:-B}),e[5]=r,e[6]=p,e[7]=m,e[8]=i,e[9]=T}else T=e[9];const P=T;let M;e[10]===Symbol.for("react.memo_cache_sentinel")?(M=[{id:"name",header:"Name",render:Me,sortable:!0},{id:"uri",header:"URI",render:Ee,sortable:!0},{id:"description",header:"Description",render:Ae,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:Le,sortable:!0}],e[10]=M):M=e[10];const O=M;let d;e[11]===Symbol.for("react.memo_cache_sentinel")?(d=O.filter(Ve).map(Pe),e[11]=d):d=e[11];const K=d;let A;e[12]!==s||e[13]!==n||e[14]!==u||e[15]!==g||e[16]!==m||e[17]!==i||e[18]!==L||e[19]!==y?(A=g&&o.jsxs(Z,{children:[o.jsx(ee,{viewMode:y,onViewModeChange:l,sortKey:i,sortDirection:m,onSort:u,sortOptions:K}),o.jsx(se,{title:n?`${n}: Resources`:"Resources",url:L,icon:s??"folder"})]}),e[12]=s,e[13]=n,e[14]=u,e[15]=g,e[16]=m,e[17]=i,e[18]=L,e[19]=y,e[20]=A):A=e[20];let E;e[21]===Symbol.for("react.memo_cache_sentinel")?(E=c=>{c.key==="Escape"&&(U(""),c.target.blur())},e[21]=E):E=e[21];let D;e[22]!==p?(D=o.jsx(te,{value:p,onChange:U,placeholder:"Search resources...",onKeyDown:E}),e[22]=p,e[23]=D):D=e[23];let $;e[24]!==N||e[25]!==b||e[26]!==u||e[27]!==p||e[28]!==m||e[29]!==i||e[30]!==P||e[31]!==y?($=y==="cards"?o.jsx("div",{className:"flex-1 overflow-auto p-5",children:P.length===0?o.jsx(F,{image:null,title:p?"No resources found":"No resources available",description:p?"Try adjusting your search terms":N}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:P.map(c=>o.jsx(ne,{className:"cursor-pointer transition-colors",onClick:()=>b(c),children:o.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[o.jsx(Q,{icon:null,name:c.name||c.uri,size:"md",className:"shrink-0 shadow-sm"}),o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:c.name||c.uri}),o.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:c.uri}),c.description&&o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:c.description})]})]})},c.uri))})}):o.jsx(oe,{columns:O,data:P,isLoading:!1,sortKey:i,sortDirection:m,onSort:u,onRowClick:c=>b(c),emptyState:o.jsx(F,{image:null,title:p?"No resources found":"No resources available",description:p?"Try adjusting your search terms":N})}),e[24]=N,e[25]=b,e[26]=u,e[27]=p,e[28]=m,e[29]=i,e[30]=P,e[31]=y,e[32]=$):$=e[32];let I;e[33]!==D||e[34]!==$?(I=o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[D,$]}),e[33]=D,e[34]=$,e[35]=I):I=e[35];let k;return e[36]!==I||e[37]!==A?(k=o.jsxs(o.Fragment,{children:[A,I]}),e[36]=I,e[37]=A,e[38]=k):k=e[38],k}function Pe(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Ve(t){return t.sortable}function Le(t){return o.jsx("span",{className:"text-sm text-muted-foreground",children:t.mimeType||"—"})}function Ae(t){return o.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function Ee(t){return o.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:t.uri})}function Me(t){return o.jsx("span",{className:"text-sm font-medium text-foreground",children:t.name||t.uri})}function De(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Oe(t){const e=q.c(6),{resources:r,connectionId:n,org:s}=t,a=G(n),f=a?.title,j=a?.icon;let g;return e[0]!==n||e[1]!==s||e[2]!==r||e[3]!==f||e[4]!==j?(g=o.jsx(_e,{resources:r,connectionId:n,org:s,connectionTitle:f,connectionIcon:j}),e[0]=n,e[1]=s,e[2]=r,e[3]=f,e[4]=j,e[5]=g):g=e[5],g}function Be(t){const e=q.c(4),{tools:r,connectionId:n,org:s}=t;let a;return e[0]!==n||e[1]!==s||e[2]!==r?(a=o.jsx(Ce,{tools:r,connectionId:n,org:s}),e[0]=n,e[1]=s,e[2]=r,e[3]=a):a=e[3],a}function Ue(t){const e=q.c(62),{connection:r,connectionId:n,org:s,requestedTabId:a,collections:f,onUpdate:j,isUpdating:g,prompts:N,resources:V}=t,L=le();let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={from:"/$org/mcps/$connectionId"},e[0]=p):p=e[0];const U=W(p);let y;e[1]!==n?(y={connectionId:n},e[1]=n,e[2]=y):y=e[2];const l=ue(y),i=l.isAuthenticated,w=r?.metadata?.repository,m=!!w?.url,h=r?.tools?.length??0,R=N.length,u=V.length;let _;e[3]===Symbol.for("react.memo_cache_sentinel")?(_={id:"settings",label:"Settings"},e[3]=_):_=e[3];let b;e[4]!==i||e[5]!==h?(b=i&&h>0?[{id:"tools",label:"Tools",count:h}]:[],e[4]=i,e[5]=h,e[6]=b):b=e[6];let T;e[7]!==i||e[8]!==R?(T=i&&R>0?[{id:"prompts",label:"Prompts",count:R}]:[],e[7]=i,e[8]=R,e[9]=T):T=e[9];let P;e[10]!==i||e[11]!==u?(P=i&&u>0?[{id:"resources",label:"Resources",count:u}]:[],e[10]=i,e[11]=u,e[12]=P):P=e[12];let M;if(e[13]!==f||e[14]!==m||e[15]!==i||e[16]!==b||e[17]!==T||e[18]!==P){let S;e[20]!==m?(S=m?[{id:"readme",label:"README"}]:[],e[20]=m,e[21]=S):S=e[21],M=[_,...b,...T,...P,...i?(f||[]).map(Ke):[],...S],e[13]=f,e[14]=m,e[15]=i,e[16]=b,e[17]=T,e[18]=P,e[19]=M}else M=e[19];const O=M,d=O.some(S=>S.id===a)?a:"settings";let K;e[22]!==U?(K=S=>{U({search:B=>({...B,tab:S}),replace:!0})},e[22]=U,e[23]=K):K=e[23];const A=K;let E;e[24]!==f?(E=f||[],e[24]=f,e[25]=E):E=e[25];let D;if(e[26]!==d||e[27]!==E){let S;e[29]!==d?(S=B=>B.name===d,e[29]=d,e[30]=S):S=e[30],D=E.find(S),e[26]=d,e[27]=E,e[28]=D}else D=e[28];const $=D;let I;e[31]!==L.history?(I=()=>L.history.back(),e[31]=L.history,e[32]=I):I=e[32];let k;e[33]!==d||e[34]!==A||e[35]!==O?(k=o.jsx(be,{children:o.jsx(ge,{tabs:O,activeTab:d,onTabChange:A})}),e[33]=d,e[34]=A,e[35]=O,e[36]=k):k=e[36];let c;e[37]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}),e[37]=c):c=e[37];let C;e[38]!==$||e[39]!==d||e[40]!==l.hasOAuthToken||e[41]!==l.isServerError||e[42]!==l.supportsOAuth||e[43]!==r||e[44]!==n||e[45]!==A||e[46]!==m||e[47]!==i||e[48]!==g||e[49]!==j||e[50]!==s||e[51]!==N||e[52]!==w||e[53]!==V?(C=o.jsx(z.Suspense,{fallback:c,children:d==="tools"?o.jsx(Be,{tools:r.tools??void 0,connectionId:n,org:s}):d==="prompts"?o.jsx(ke,{prompts:N,connectionId:n,org:s}):d==="resources"?o.jsx(Oe,{resources:V,connectionId:n,org:s}):d==="settings"?o.jsx(pe,{connection:r,onUpdate:j,isUpdating:g,isMCPAuthenticated:i,supportsOAuth:l.supportsOAuth,hasOAuthToken:l.hasOAuthToken,isServerError:l.isServerError,onViewReadme:m?()=>A("readme"):void 0}):d==="readme"&&m?o.jsx(Re,{repository:w}):$&&i?o.jsx(ye,{connectionId:n,org:s,activeCollection:$},d):o.jsx(F,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[38]=$,e[39]=d,e[40]=l.hasOAuthToken,e[41]=l.isServerError,e[42]=l.supportsOAuth,e[43]=r,e[44]=n,e[45]=A,e[46]=m,e[47]=i,e[48]=g,e[49]=j,e[50]=s,e[51]=N,e[52]=w,e[53]=V,e[54]=C):C=e[54];let v;e[55]!==d||e[56]!==C?(v=o.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:o.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-auto",children:o.jsx(X,{children:C},d)})}),e[55]=d,e[56]=C,e[57]=v):v=e[57];let x;return e[58]!==I||e[59]!==k||e[60]!==v?(x=o.jsxs(je,{onBack:I,children:[k,v]}),e[58]=I,e[59]=k,e[60]=v,e[61]=x):x=e[61],x}function Ke(t){return{id:t.name,label:t.displayName}}function ze(){const t=q.c(29);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/mcps/$connectionId"},t[0]=e):e=t[0];const r=W(e);let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/mcps/$connectionId"},t[1]=n):n=t[1];const{connectionId:s,org:a}=ce(n);let f;t[2]===Symbol.for("react.memo_cache_sentinel")?(f={from:"/shell/$org/mcps/$connectionId"},t[2]=f):f=t[2];const g=ae(f).tab||"settings",N=G(s),V=me(),L=de(N??void 0);let p;t[3]!==s?(p=[s],t[3]=s,t[4]=p):p=t[4];const{promptsMap:U}=fe(p);let y;t[5]!==s?(y=[s],t[5]=s,t[6]=y):y=t[6];const{resourcesMap:l}=he(y);let i;t[7]!==s||t[8]!==U?(i=U.get(s)??[],t[7]=s,t[8]=U,t[9]=i):i=t[9];const w=i;let m;t[10]!==s||t[11]!==l?(m=l.get(s)??[],t[10]=s,t[11]=l,t[12]=m):m=t[12];const h=m;let R;t[13]!==V.update||t[14]!==s?(R=async b=>{await V.update.mutateAsync({id:s,data:b})},t[13]=V.update,t[14]=s,t[15]=R):R=t[15];const u=R;if(!N){let b;return t[16]!==r||t[17]!==a?(b=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(F,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:o.jsx(xe,{variant:"outline",onClick:()=>r({to:"/$org/mcps",params:{org:a}}),children:"Back to connections"})})}),t[16]=r,t[17]=a,t[18]=b):b=t[18],b}let _;return t[19]!==V.update.isPending||t[20]!==L||t[21]!==N||t[22]!==s||t[23]!==u||t[24]!==a||t[25]!==w||t[26]!==g||t[27]!==h?(_=o.jsx(Ue,{org:a,connection:N,connectionId:s,requestedTabId:g,collections:L,onUpdate:u,isUpdating:V.update.isPending,prompts:w,resources:h}),t[19]=V.update.isPending,t[20]=L,t[21]=N,t[22]=s,t[23]=u,t[24]=a,t[25]=w,t[26]=g,t[27]=h,t[28]=_):_=t[28],_}function qe(){const t=q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(X,{children:o.jsx(z.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:o.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}),children:o.jsx(ze,{})})}),t[0]=e):e=t[0],e}function fo(){const t=q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(qe,{}),t[0]=e):e=t[0],e}export{fo as default};
1
+ import{c as q,j as o,f as W,k as J,r as z,d as ce,b as ae,af as le}from"./index-Diww4UW3.js";import{E as F,I as Q}from"./empty-state-wP9uukGJ.js";import{E as X}from"./error-boundary-BUvK8Sry.js";import{b as G,a as me}from"./use-connection-CCXutWLD.js";import{a as de}from"./use-binding-D6wv_5fO.js";import{u as ue,S as pe}from"./index-DjRWdLI4.js";import{u as fe,a as he}from"./use-connection-resources-D0st76bP.js";import{B as xe}from"./button-CGmrzkpY.js";import{i as Y}from"./Loading01-Ae5ezbtD.js";import{R as ge}from"./resource-tabs-ACbF96qo.js";import{V as Z,a as be,b as je}from"./layout-kp8TTJc9.js";import{C as ye}from"./collection-tab-CvrhLJCU.js";import{C as ee}from"./collection-display-button-CtkxsCB_.js";import{C as te}from"./collection-search-BVb42O45.js";import{C as oe}from"./collection-table-wrapper-BohFZqii.js";import{P as se}from"./pin-to-sidebar-button-DIwkO0Tx.js";import{C as ne}from"./card-DIjMh1NO.js";import{R as Se,T as Ce}from"./tools-list-mr-l2d8l.js";import"./connection-ChwHK0-S.js";import"./project-context-provider-DulCVL2k.js";import"./use-collections-CXETocKO.js";import"./useMutation-Dl1MMkEC.js";import"./binder-By0LBK9Y.js";import"./mcp-oauth-CdcIczUJ.js";import"./env-vars-editor-DuH6BBdA.js";import"./input-CrURMEZe.js";import"./Plus-CdG75X26.js";import"./Trash01-BWIN9RL_.js";import"./use-tool-call-BmvKn7jp.js";import"./useQuery-Bvk0U2ed.js";import"./File06-KMD38I-q.js";import"./Key01-DTwk4FpG.js";import"./badge-BVO6I0sW.js";import"./form-DiGzBnRK.js";import"./select-C8LOz7vA.js";import"./tooltip-Suu_Gpqh.js";import"./Check-BQkm1TiP.js";import"./ChevronDown-DP6jvip7.js";import"./extract-connection-data-BLs0SRok.js";import"./constants-J0aH6mLs.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-8Lvx2XTy.js";import"./generate-id-Dyweu44Y.js";import"./Terminal-C6mZx-5A.js";import"./use-gateway-DD-xEZju.js";import"./Grid01-D4lXvveX.js";import"./index-DUA-vRuy.js";import"./index-D4QCsSzb.js";import"./index-CL_rL7XJ.js";import"./X-C18ho617.js";import"./popover-Bx7diZ86.js";import"./textarea-C_zgj3Sp.js";import"./AlertCircle-CI2U-jkN.js";import"./ArrowUp-BF7mM4C2.js";import"./Edit01-Cq0mQDLh.js";import"./use-gateway-system-prompt-zGJSEzce.js";import"./localstorage-keys-BVANkONM.js";import"./SearchMd-GFaonOaJ.js";import"./use-create-gateway-BlLsktgc.js";import"./Image01-C0R6SF_P.js";import"./spinner-BF56RAKQ.js";import"./Copy01-CEYn2daS.js";import"./monaco-editor-CDRbE4GY.js";import"./alert-dialog-CCJCsKzK.js";import"./well-known-mcp-DOEdYmKO.js";import"./ArrowLeft-B3km7toT.js";import"./dropdown-menu-CAeD2aIb.js";import"./DotsVertical-BPP4U4GQ.js";import"./use-list-state-AndcW8aD.js";import"./use-mobile-DssCtDl6.js";import"./empty-state-BkAB-hls.js";import"./Inbox01-BsOUYwQZ.js";import"./avatar-B7xnPXuk.js";import"./List-BsSZz32j.js";import"./view-mode-toggle-BLClM-0g.js";import"./use-organization-settings-CQXtXtZs.js";function ve(t){const e=q.c(42),{prompts:r,connectionId:n,org:s,connectionTitle:a,connectionIcon:f,onPromptClick:j,showToolbar:g,emptyMessage:N}=t,V=g===void 0?!0:g,L=N===void 0?"This connection doesn't have any prompts yet.":N,p=W(),y=J().location.href,[l,i]=z.useState(""),[w,m]=z.useState("table"),[h,R]=z.useState("name"),[u,_]=z.useState("asc");let b;e[0]!==u||e[1]!==h?(b=x=>{h===x?(_(Ie),u==="desc"&&R(void 0)):(R(x),_("asc"))},e[0]=u,e[1]=h,e[2]=b):b=e[2];const T=b;let P;e[3]!==n||e[4]!==p||e[5]!==j||e[6]!==s?(P=x=>{j?j(x):n&&s&&p({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:s,connectionId:n,collectionName:"prompts",itemId:encodeURIComponent(x.name)}})},e[3]=n,e[4]=p,e[5]=j,e[6]=s,e[7]=P):P=e[7];const M=P;let O;if(e[8]!==r||e[9]!==l||e[10]!==u||e[11]!==h){const x=!r||r.length===0?[]:l.trim()?(()=>{const S=l.toLowerCase();return r.filter(B=>B.name.toLowerCase().includes(S)||B.description&&B.description.toLowerCase().includes(S))})():r;O=!h||!u?x:[...x].sort((S,B)=>{const re=S[h]||"",ie=B[h]||"",H=String(re).localeCompare(String(ie));return u==="asc"?H:-H}),e[8]=r,e[9]=l,e[10]=u,e[11]=h,e[12]=O}else O=e[12];const d=O;let K;e[13]===Symbol.for("react.memo_cache_sentinel")?(K=[{id:"name",header:"Name",render:$e,sortable:!0},{id:"description",header:"Description",render:Te,cellClassName:"flex-1",sortable:!0}],e[13]=K):K=e[13];const A=K;let E;e[14]===Symbol.for("react.memo_cache_sentinel")?(E=A.filter(we).map(Ne),e[14]=E):E=e[14];const D=E;let $;e[15]!==f||e[16]!==a||e[17]!==T||e[18]!==V||e[19]!==u||e[20]!==h||e[21]!==y||e[22]!==w?($=V&&o.jsxs(Z,{children:[o.jsx(ee,{viewMode:w,onViewModeChange:m,sortKey:h,sortDirection:u,onSort:T,sortOptions:D}),o.jsx(se,{title:a?`${a}: Prompts`:"Prompts",url:y,icon:f??"description"})]}),e[15]=f,e[16]=a,e[17]=T,e[18]=V,e[19]=u,e[20]=h,e[21]=y,e[22]=w,e[23]=$):$=e[23];let I;e[24]===Symbol.for("react.memo_cache_sentinel")?(I=x=>{x.key==="Escape"&&(i(""),x.target.blur())},e[24]=I):I=e[24];let k;e[25]!==l?(k=o.jsx(te,{value:l,onChange:i,placeholder:"Search prompts...",onKeyDown:I}),e[25]=l,e[26]=k):k=e[26];let c;e[27]!==L||e[28]!==M||e[29]!==T||e[30]!==l||e[31]!==u||e[32]!==h||e[33]!==d||e[34]!==w?(c=w==="cards"?o.jsx("div",{className:"flex-1 overflow-auto p-5",children:d.length===0?o.jsx(F,{image:null,title:l?"No prompts found":"No prompts available",description:l?"Try adjusting your search terms":L}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:d.map(x=>o.jsx(ne,{className:"cursor-pointer transition-colors",onClick:()=>M(x),children:o.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[o.jsx(Q,{icon:null,name:x.name,size:"md",className:"shrink-0 shadow-sm"}),o.jsxs("div",{className:"flex flex-col gap-0",children:[o.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:x.name}),o.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:x.description||"No description"})]})]})},x.name))})}):o.jsx(oe,{columns:A,data:d,isLoading:!1,sortKey:h,sortDirection:u,onSort:T,onRowClick:x=>M(x),emptyState:o.jsx(F,{image:null,title:l?"No prompts found":"No prompts available",description:l?"Try adjusting your search terms":L})}),e[27]=L,e[28]=M,e[29]=T,e[30]=l,e[31]=u,e[32]=h,e[33]=d,e[34]=w,e[35]=c):c=e[35];let C;e[36]!==k||e[37]!==c?(C=o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[k,c]}),e[36]=k,e[37]=c,e[38]=C):C=e[38];let v;return e[39]!==C||e[40]!==$?(v=o.jsxs(o.Fragment,{children:[$,C]}),e[39]=C,e[40]=$,e[41]=v):v=e[41],v}function Ne(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function we(t){return t.sortable}function Te(t){return o.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function $e(t){return o.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:t.name})}function Ie(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function ke(t){const e=q.c(6),{prompts:r,connectionId:n,org:s}=t,a=G(n),f=a?.title,j=a?.icon;let g;return e[0]!==n||e[1]!==s||e[2]!==r||e[3]!==f||e[4]!==j?(g=o.jsx(ve,{prompts:r,connectionId:n,org:s,connectionTitle:f,connectionIcon:j}),e[0]=n,e[1]=s,e[2]=r,e[3]=f,e[4]=j,e[5]=g):g=e[5],g}function Re(t){const e=q.c(2),{repository:r}=t;let n;return e[0]!==r?(n=o.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:o.jsx(Se,{repository:r})}),e[0]=r,e[1]=n):n=e[1],n}function _e(t){const e=q.c(39),{resources:r,connectionTitle:n,connectionIcon:s,onResourceClick:a,showToolbar:f,emptyMessage:j}=t,g=f===void 0?!0:f,N=j===void 0?"This connection doesn't have any resources yet.":j,L=J().location.href,[p,U]=z.useState(""),[y,l]=z.useState("table"),[i,w]=z.useState("name"),[m,h]=z.useState("asc");let R;e[0]!==m||e[1]!==i?(R=c=>{i===c?(h(De),m==="desc"&&w(void 0)):(w(c),h("asc"))},e[0]=m,e[1]=i,e[2]=R):R=e[2];const u=R;let _;e[3]!==a?(_=c=>{a&&a(c)},e[3]=a,e[4]=_):_=e[4];const b=_;let T;if(e[5]!==r||e[6]!==p||e[7]!==m||e[8]!==i){const c=!r||r.length===0?[]:p.trim()?(()=>{const C=p.toLowerCase();return r.filter(v=>v.uri.toLowerCase().includes(C)||v.name&&v.name.toLowerCase().includes(C)||v.description&&v.description.toLowerCase().includes(C))})():r;T=!i||!m?c:[...c].sort((C,v)=>{const x=C[i]||"",S=v[i]||"",B=String(x).localeCompare(String(S));return m==="asc"?B:-B}),e[5]=r,e[6]=p,e[7]=m,e[8]=i,e[9]=T}else T=e[9];const P=T;let M;e[10]===Symbol.for("react.memo_cache_sentinel")?(M=[{id:"name",header:"Name",render:Me,sortable:!0},{id:"uri",header:"URI",render:Ee,sortable:!0},{id:"description",header:"Description",render:Ae,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:Le,sortable:!0}],e[10]=M):M=e[10];const O=M;let d;e[11]===Symbol.for("react.memo_cache_sentinel")?(d=O.filter(Ve).map(Pe),e[11]=d):d=e[11];const K=d;let A;e[12]!==s||e[13]!==n||e[14]!==u||e[15]!==g||e[16]!==m||e[17]!==i||e[18]!==L||e[19]!==y?(A=g&&o.jsxs(Z,{children:[o.jsx(ee,{viewMode:y,onViewModeChange:l,sortKey:i,sortDirection:m,onSort:u,sortOptions:K}),o.jsx(se,{title:n?`${n}: Resources`:"Resources",url:L,icon:s??"folder"})]}),e[12]=s,e[13]=n,e[14]=u,e[15]=g,e[16]=m,e[17]=i,e[18]=L,e[19]=y,e[20]=A):A=e[20];let E;e[21]===Symbol.for("react.memo_cache_sentinel")?(E=c=>{c.key==="Escape"&&(U(""),c.target.blur())},e[21]=E):E=e[21];let D;e[22]!==p?(D=o.jsx(te,{value:p,onChange:U,placeholder:"Search resources...",onKeyDown:E}),e[22]=p,e[23]=D):D=e[23];let $;e[24]!==N||e[25]!==b||e[26]!==u||e[27]!==p||e[28]!==m||e[29]!==i||e[30]!==P||e[31]!==y?($=y==="cards"?o.jsx("div",{className:"flex-1 overflow-auto p-5",children:P.length===0?o.jsx(F,{image:null,title:p?"No resources found":"No resources available",description:p?"Try adjusting your search terms":N}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:P.map(c=>o.jsx(ne,{className:"cursor-pointer transition-colors",onClick:()=>b(c),children:o.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[o.jsx(Q,{icon:null,name:c.name||c.uri,size:"md",className:"shrink-0 shadow-sm"}),o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:c.name||c.uri}),o.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:c.uri}),c.description&&o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:c.description})]})]})},c.uri))})}):o.jsx(oe,{columns:O,data:P,isLoading:!1,sortKey:i,sortDirection:m,onSort:u,onRowClick:c=>b(c),emptyState:o.jsx(F,{image:null,title:p?"No resources found":"No resources available",description:p?"Try adjusting your search terms":N})}),e[24]=N,e[25]=b,e[26]=u,e[27]=p,e[28]=m,e[29]=i,e[30]=P,e[31]=y,e[32]=$):$=e[32];let I;e[33]!==D||e[34]!==$?(I=o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[D,$]}),e[33]=D,e[34]=$,e[35]=I):I=e[35];let k;return e[36]!==I||e[37]!==A?(k=o.jsxs(o.Fragment,{children:[A,I]}),e[36]=I,e[37]=A,e[38]=k):k=e[38],k}function Pe(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Ve(t){return t.sortable}function Le(t){return o.jsx("span",{className:"text-sm text-muted-foreground",children:t.mimeType||"—"})}function Ae(t){return o.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function Ee(t){return o.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:t.uri})}function Me(t){return o.jsx("span",{className:"text-sm font-medium text-foreground",children:t.name||t.uri})}function De(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Oe(t){const e=q.c(6),{resources:r,connectionId:n,org:s}=t,a=G(n),f=a?.title,j=a?.icon;let g;return e[0]!==n||e[1]!==s||e[2]!==r||e[3]!==f||e[4]!==j?(g=o.jsx(_e,{resources:r,connectionId:n,org:s,connectionTitle:f,connectionIcon:j}),e[0]=n,e[1]=s,e[2]=r,e[3]=f,e[4]=j,e[5]=g):g=e[5],g}function Be(t){const e=q.c(4),{tools:r,connectionId:n,org:s}=t;let a;return e[0]!==n||e[1]!==s||e[2]!==r?(a=o.jsx(Ce,{tools:r,connectionId:n,org:s}),e[0]=n,e[1]=s,e[2]=r,e[3]=a):a=e[3],a}function Ue(t){const e=q.c(62),{connection:r,connectionId:n,org:s,requestedTabId:a,collections:f,onUpdate:j,isUpdating:g,prompts:N,resources:V}=t,L=le();let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={from:"/$org/mcps/$connectionId"},e[0]=p):p=e[0];const U=W(p);let y;e[1]!==n?(y={connectionId:n},e[1]=n,e[2]=y):y=e[2];const l=ue(y),i=l.isAuthenticated,w=r?.metadata?.repository,m=!!w?.url,h=r?.tools?.length??0,R=N.length,u=V.length;let _;e[3]===Symbol.for("react.memo_cache_sentinel")?(_={id:"settings",label:"Settings"},e[3]=_):_=e[3];let b;e[4]!==i||e[5]!==h?(b=i&&h>0?[{id:"tools",label:"Tools",count:h}]:[],e[4]=i,e[5]=h,e[6]=b):b=e[6];let T;e[7]!==i||e[8]!==R?(T=i&&R>0?[{id:"prompts",label:"Prompts",count:R}]:[],e[7]=i,e[8]=R,e[9]=T):T=e[9];let P;e[10]!==i||e[11]!==u?(P=i&&u>0?[{id:"resources",label:"Resources",count:u}]:[],e[10]=i,e[11]=u,e[12]=P):P=e[12];let M;if(e[13]!==f||e[14]!==m||e[15]!==i||e[16]!==b||e[17]!==T||e[18]!==P){let S;e[20]!==m?(S=m?[{id:"readme",label:"README"}]:[],e[20]=m,e[21]=S):S=e[21],M=[_,...b,...T,...P,...i?(f||[]).map(Ke):[],...S],e[13]=f,e[14]=m,e[15]=i,e[16]=b,e[17]=T,e[18]=P,e[19]=M}else M=e[19];const O=M,d=O.some(S=>S.id===a)?a:"settings";let K;e[22]!==U?(K=S=>{U({search:B=>({...B,tab:S}),replace:!0})},e[22]=U,e[23]=K):K=e[23];const A=K;let E;e[24]!==f?(E=f||[],e[24]=f,e[25]=E):E=e[25];let D;if(e[26]!==d||e[27]!==E){let S;e[29]!==d?(S=B=>B.name===d,e[29]=d,e[30]=S):S=e[30],D=E.find(S),e[26]=d,e[27]=E,e[28]=D}else D=e[28];const $=D;let I;e[31]!==L.history?(I=()=>L.history.back(),e[31]=L.history,e[32]=I):I=e[32];let k;e[33]!==d||e[34]!==A||e[35]!==O?(k=o.jsx(be,{children:o.jsx(ge,{tabs:O,activeTab:d,onTabChange:A})}),e[33]=d,e[34]=A,e[35]=O,e[36]=k):k=e[36];let c;e[37]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}),e[37]=c):c=e[37];let C;e[38]!==$||e[39]!==d||e[40]!==l.hasOAuthToken||e[41]!==l.isServerError||e[42]!==l.supportsOAuth||e[43]!==r||e[44]!==n||e[45]!==A||e[46]!==m||e[47]!==i||e[48]!==g||e[49]!==j||e[50]!==s||e[51]!==N||e[52]!==w||e[53]!==V?(C=o.jsx(z.Suspense,{fallback:c,children:d==="tools"?o.jsx(Be,{tools:r.tools??void 0,connectionId:n,org:s}):d==="prompts"?o.jsx(ke,{prompts:N,connectionId:n,org:s}):d==="resources"?o.jsx(Oe,{resources:V,connectionId:n,org:s}):d==="settings"?o.jsx(pe,{connection:r,onUpdate:j,isUpdating:g,isMCPAuthenticated:i,supportsOAuth:l.supportsOAuth,hasOAuthToken:l.hasOAuthToken,isServerError:l.isServerError,onViewReadme:m?()=>A("readme"):void 0}):d==="readme"&&m?o.jsx(Re,{repository:w}):$&&i?o.jsx(ye,{connectionId:n,org:s,activeCollection:$},d):o.jsx(F,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[38]=$,e[39]=d,e[40]=l.hasOAuthToken,e[41]=l.isServerError,e[42]=l.supportsOAuth,e[43]=r,e[44]=n,e[45]=A,e[46]=m,e[47]=i,e[48]=g,e[49]=j,e[50]=s,e[51]=N,e[52]=w,e[53]=V,e[54]=C):C=e[54];let v;e[55]!==d||e[56]!==C?(v=o.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:o.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-auto",children:o.jsx(X,{children:C},d)})}),e[55]=d,e[56]=C,e[57]=v):v=e[57];let x;return e[58]!==I||e[59]!==k||e[60]!==v?(x=o.jsxs(je,{onBack:I,children:[k,v]}),e[58]=I,e[59]=k,e[60]=v,e[61]=x):x=e[61],x}function Ke(t){return{id:t.name,label:t.displayName}}function ze(){const t=q.c(29);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/mcps/$connectionId"},t[0]=e):e=t[0];const r=W(e);let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/mcps/$connectionId"},t[1]=n):n=t[1];const{connectionId:s,org:a}=ce(n);let f;t[2]===Symbol.for("react.memo_cache_sentinel")?(f={from:"/shell/$org/mcps/$connectionId"},t[2]=f):f=t[2];const g=ae(f).tab||"settings",N=G(s),V=me(),L=de(N??void 0);let p;t[3]!==s?(p=[s],t[3]=s,t[4]=p):p=t[4];const{promptsMap:U}=fe(p);let y;t[5]!==s?(y=[s],t[5]=s,t[6]=y):y=t[6];const{resourcesMap:l}=he(y);let i;t[7]!==s||t[8]!==U?(i=U.get(s)??[],t[7]=s,t[8]=U,t[9]=i):i=t[9];const w=i;let m;t[10]!==s||t[11]!==l?(m=l.get(s)??[],t[10]=s,t[11]=l,t[12]=m):m=t[12];const h=m;let R;t[13]!==V.update||t[14]!==s?(R=async b=>{await V.update.mutateAsync({id:s,data:b})},t[13]=V.update,t[14]=s,t[15]=R):R=t[15];const u=R;if(!N){let b;return t[16]!==r||t[17]!==a?(b=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(F,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:o.jsx(xe,{variant:"outline",onClick:()=>r({to:"/$org/mcps",params:{org:a}}),children:"Back to connections"})})}),t[16]=r,t[17]=a,t[18]=b):b=t[18],b}let _;return t[19]!==V.update.isPending||t[20]!==L||t[21]!==N||t[22]!==s||t[23]!==u||t[24]!==a||t[25]!==w||t[26]!==g||t[27]!==h?(_=o.jsx(Ue,{org:a,connection:N,connectionId:s,requestedTabId:g,collections:L,onUpdate:u,isUpdating:V.update.isPending,prompts:w,resources:h}),t[19]=V.update.isPending,t[20]=L,t[21]=N,t[22]=s,t[23]=u,t[24]=a,t[25]=w,t[26]=g,t[27]=h,t[28]=_):_=t[28],_}function qe(){const t=q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(X,{children:o.jsx(z.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:o.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}),children:o.jsx(ze,{})})}),t[0]=e):e=t[0],e}function fo(){const t=q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(qe,{}),t[0]=e):e=t[0],e}export{fo as default};