@decocms/mesh 1.0.16 → 1.0.18

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 (108) hide show
  1. package/dist/client/assets/{AlertCircle-cYjr_0xB.js → AlertCircle-CAH7G7Fc.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-CBi8stO3.js → ArrowLeft-DYJU0sRd.js} +1 -1
  3. package/dist/client/assets/{Calendar-cB-o1wit.js → Calendar-Ba37VUfB.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-7kPeUreU.js → ChevronDown-BtaAznAf.js} +1 -1
  5. package/dist/client/assets/{Clock-D4OCvk0s.js → Clock-BYv8XFdU.js} +1 -1
  6. package/dist/client/assets/{Copy01-DmZIDbuC.js → Copy01-DZzyV7nE.js} +1 -1
  7. package/dist/client/assets/{CpuChip02-CvUOZekE.js → CpuChip02-SXr5nJdo.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-CugHspqx.js → DotsVertical-BJS2t7Tg.js} +1 -1
  9. package/dist/client/assets/{File06-B9Csx588.js → File06-NpiRHtR-.js} +1 -1
  10. package/dist/client/assets/{GitBranch01-DGYWk3k6.js → GitBranch01-iTqlzLTs.js} +1 -1
  11. package/dist/client/assets/{Inbox01-x47sKUjp.js → Inbox01-BHWd6y2Z.js} +1 -1
  12. package/dist/client/assets/{InfoCircle-DXZ2AFmC.js → InfoCircle-D6Oa5jFj.js} +1 -1
  13. package/dist/client/assets/{Key01-BemiGYAL.js → Key01-BYLHyZyj.js} +1 -1
  14. package/dist/client/assets/{LinkExternal01-BrZUQjLP.js → LinkExternal01-CQv3krcN.js} +1 -1
  15. package/dist/client/assets/{Loading01-CZ--C9o4.js → Loading01-DdJTgVpp.js} +1 -1
  16. package/dist/client/assets/Lock01-CVeVWkZB.js +1 -0
  17. package/dist/client/assets/{Plus-B87V-eUk.js → Plus-DF_8yoMD.js} +1 -1
  18. package/dist/client/assets/{SearchMd-C_x78fQD.js → SearchMd-DDy8E2Sf.js} +1 -1
  19. package/dist/client/assets/{Terminal-Bp8rdp_p.js → Terminal-CyVXhceX.js} +1 -1
  20. package/dist/client/assets/{Trash01-kv9nDzIp.js → Trash01-3l-2SGXg.js} +1 -1
  21. package/dist/client/assets/{Upload01-BkY8x2qR.js → Upload01-BY1Megy0.js} +1 -1
  22. package/dist/client/assets/{X-BI6-CrX0.js → X-EkD3fVWA.js} +1 -1
  23. package/dist/client/assets/{XClose-CPlecLXh.js → XClose-BQyXK7EC.js} +1 -1
  24. package/dist/client/assets/{alert-dialog-DLlk9oGk.js → alert-dialog-TgVzKfkb.js} +1 -1
  25. package/dist/client/assets/{auth-O7mzDtBv.js → auth-CPnNaHvV.js} +1 -1
  26. package/dist/client/assets/{auth-catchall-Cj2BmrFb.js → auth-catchall-LOKV6UAh.js} +1 -1
  27. package/dist/client/assets/{avatar-yEkJ_N8H.js → avatar-DSEJrCNe.js} +1 -1
  28. package/dist/client/assets/{badge-CzGd9Js-.js → badge-B1dobCRY.js} +1 -1
  29. package/dist/client/assets/{button-RGWd1X_P.js → button-Cu7Gpj_2.js} +1 -1
  30. package/dist/client/assets/{card-Bch45nKF.js → card-BMKHMTDj.js} +1 -1
  31. package/dist/client/assets/{checkbox-Bkz-wJOC.js → checkbox-DbkRP74v.js} +1 -1
  32. package/dist/client/assets/{collection-detail-BrxtwdmN.js → collection-detail-ngjte1c4.js} +1 -1
  33. package/dist/client/assets/{collection-display-button-s3SUZ2ky.js → collection-display-button-CfJOFOy4.js} +1 -1
  34. package/dist/client/assets/{collection-header-g7B4v38B.js → collection-header-6vROlIaL.js} +1 -1
  35. package/dist/client/assets/{collection-page-CXQu5PW5.js → collection-page-DPG4FVyY.js} +1 -1
  36. package/dist/client/assets/{collection-search-B_ze9BPw.js → collection-search-Dt3csPYy.js} +1 -1
  37. package/dist/client/assets/{collection-table-wrapper-yPDs4QFo.js → collection-table-wrapper-B3zYvq_F.js} +1 -1
  38. package/dist/client/assets/{connection-card-B2ZNmA6T.js → connection-card-CjOjxUED.js} +1 -1
  39. package/dist/client/assets/{connection-detail-D98NZkPb.js → connection-detail-BTYUiiKA.js} +1 -1
  40. package/dist/client/assets/{connections-CdxYZab0.js → connections-C46XykEA.js} +1 -1
  41. package/dist/client/assets/{core-GvCAeL42.js → core-BFzlzP8F.js} +1 -1
  42. package/dist/client/assets/{create-organization-dialog-c2EjUvFE.js → create-organization-dialog-CdptfMRb.js} +1 -1
  43. package/dist/client/assets/{dialog-xbeC24qR.js → dialog-CC7Romxu.js} +1 -1
  44. package/dist/client/assets/{dropdown-menu-Dz-Cfe4c.js → dropdown-menu-De2MFXzP.js} +1 -1
  45. package/dist/client/assets/{env-vars-editor-B-ADXMkg.js → env-vars-editor-DKJqlIK-.js} +1 -1
  46. package/dist/client/assets/{error-boundary-IlI5HY5C.js → error-boundary-BlfwOQWs.js} +1 -1
  47. package/dist/client/assets/{extract-connection-data-3bWrIOWG.js → extract-connection-data-D7ePP-S9.js} +1 -1
  48. package/dist/client/assets/{form-C0miQmjx.js → form-C9aG8a9_.js} +1 -1
  49. package/dist/client/assets/{formatDistanceToNow-BgvVIEk6.js → formatDistanceToNow-7bwQqEEJ.js} +1 -1
  50. package/dist/client/assets/{gateway-detail-C1Vlo23c.js → gateway-detail-D1TGQ1-a.js} +1 -1
  51. package/dist/client/assets/{gateways-BphVjp-r.js → gateways-CicECNcG.js} +1 -1
  52. package/dist/client/assets/{home-GBkZhhXc.js → home-6S0sFGwA.js} +1 -1
  53. package/dist/client/assets/{index-KVbZU2bI.js → index-BC4DFDP4.js} +1 -1
  54. package/dist/client/assets/{index-RUqw7d0T.js → index-BEpExDaW.js} +1 -1
  55. package/dist/client/assets/{index-Ce0bVa0I.js → index-CqA7I8ME.js} +16 -16
  56. package/dist/client/assets/{index-CbrmpR2c.js → index-rXoeRhPD.js} +1 -1
  57. package/dist/client/assets/{input-Cc7Y8Lsj.js → input-DHGUS5vj.js} +1 -1
  58. package/dist/client/assets/json-DY5VamDr.js +1 -0
  59. package/dist/client/assets/{json-syntax-highlighter-Bc0wDiKJ.js → json-syntax-highlighter-Dykx_AFd.js} +2 -2
  60. package/dist/client/assets/layout-zE8Dp2X0.js +1 -0
  61. package/dist/client/assets/{lazy-highlighter-tp_1h6Wp.js → lazy-highlighter-CioqVtm3.js} +1 -1
  62. package/dist/client/assets/{localstorage-keys-C2n4sqaz.js → localstorage-keys-DECG1iSi.js} +1 -1
  63. package/dist/client/assets/{login-BI3qBB8Y.js → login-Cx3k8N36.js} +1 -1
  64. package/dist/client/assets/{mcp-oauth-BrdcIayH.js → mcp-oauth-tlLalwei.js} +1 -1
  65. package/dist/client/assets/members-Bng4JPo_.js +3 -0
  66. package/dist/client/assets/{monitoring-BXnIcCQV.js → monitoring-gTR9Celr.js} +1 -1
  67. package/dist/client/assets/{oauth-callback-uokDqdRF.js → oauth-callback-DWHntj-c.js} +1 -1
  68. package/dist/client/assets/{page-D8Upjw8L.js → page-BNqzvH_D.js} +1 -1
  69. package/dist/client/assets/{popover-gYOPU7b5.js → popover-DqxbH01z.js} +1 -1
  70. package/dist/client/assets/prism-light-YTNk6MZn.js +1 -0
  71. package/dist/client/assets/{resizable-0evkHPjb.js → resizable-1LBVjTrf.js} +4 -4
  72. package/dist/client/assets/{resource-tabs-Bp2LCK5n.js → resource-tabs-CeU00pMP.js} +1 -1
  73. package/dist/client/assets/{select-B-74Vw7Q.js → select-Dg5JPxAc.js} +1 -1
  74. package/dist/client/assets/{settings-DZGZ9pQP.js → settings-Bpm9SXP6.js} +1 -1
  75. package/dist/client/assets/shell-layout-hhV4DGMT.js +17 -0
  76. package/dist/client/assets/{spinner-B6Gpa1lS.js → spinner-CyJuCfoJ.js} +1 -1
  77. package/dist/client/assets/store-DrnwLSGT.js +1 -0
  78. package/dist/client/assets/{store-app-detail-Cr8HLsme.js → store-app-detail-CFp562AP.js} +1 -1
  79. package/dist/client/assets/{switch-C6VfIG9f.js → switch-C28m6eWV.js} +1 -1
  80. package/dist/client/assets/{tools-list-6PdjsEP-.js → tools-list-NuJ6i7mN.js} +1 -1
  81. package/dist/client/assets/{tooltip-B77piVwL.js → tooltip-BGO9FrAb.js} +1 -1
  82. package/dist/client/assets/{types-0U77q4OL.js → types-B38t86fr.js} +1 -1
  83. package/dist/client/assets/{use-binding-DOHpn0td.js → use-binding-BSrLFa69.js} +1 -1
  84. package/dist/client/assets/{use-connection-CcfriG4b.js → use-connection-CRNsw_EM.js} +1 -1
  85. package/dist/client/assets/{use-connection-resources-C-ecJARs.js → use-connection-resources-CuRCIUIA.js} +1 -1
  86. package/dist/client/assets/{use-gateway-CCphplYZ.js → use-gateway-BDLgsIti.js} +1 -1
  87. package/dist/client/assets/{use-list-state-Bcpc0dEc.js → use-list-state-Bu3fDY_D.js} +1 -1
  88. package/dist/client/assets/{use-mcp-B7yS6xB_.js → use-mcp-C6M7GJsU.js} +1 -1
  89. package/dist/client/assets/{use-members-ii7q5pxE.js → use-members-BjVwiFSf.js} +1 -1
  90. package/dist/client/assets/{use-mobile-DYo2aQNt.js → use-mobile-DWX_zGvO.js} +1 -1
  91. package/dist/client/assets/{use-organization-settings-uQsDNKHC.js → use-organization-settings-BjHeWH30.js} +1 -1
  92. package/dist/client/assets/{use-tool-call-CI1nZAFC.js → use-tool-call-hxvro7CP.js} +1 -1
  93. package/dist/client/assets/useQuery-DYX0Erl2.js +1 -0
  94. package/dist/client/assets/{view-mode-toggle-BGpxvqYI.js → view-mode-toggle-CwRfmI4H.js} +1 -1
  95. package/dist/client/assets/well-known-mcp-DX3tGGx0.js +1 -0
  96. package/dist/client/index.html +1 -1
  97. package/dist/server/cli.js +146 -146
  98. package/dist/server/migrate.js +92 -92
  99. package/dist/server/server.js +125 -125
  100. package/package.json +1 -1
  101. package/dist/client/assets/json-zc228CLg.js +0 -1
  102. package/dist/client/assets/layout-k5sx-zLk.js +0 -1
  103. package/dist/client/assets/members-ClQFNkDC.js +0 -3
  104. package/dist/client/assets/prism-light-BmyQu-TG.js +0 -1
  105. package/dist/client/assets/shell-layout-CmBAtkbZ.js +0 -17
  106. package/dist/client/assets/store-CZ1oyjvA.js +0 -1
  107. package/dist/client/assets/useQuery-CF3kr9sY.js +0 -1
  108. package/dist/client/assets/well-known-mcp-B16sbKCU.js +0 -1
@@ -1,4 +1,4 @@
1
- import{aw as It,r as N,c as P,d as jn,j as p,f as Us,av as Yi,x as ip,y as ru,v as lp,w as jo,i as ap,b as cp,t as up,F as Q,Q as dp,ax as Ro,ay as su,al as fp,ak as hp,az as pp,H as Xi,a5 as ou,a8 as mp,B as Rn,E as Ve,a2 as Qi,a9 as gp,z as Ks,a6 as yp,a1 as Zi,af as xp,ag as bp,ah as kp,aA as el,aB as vp,a7 as iu,a4 as wp,aC as Sp,L as Cp,aD as Np,aE as Ep}from"./index-Ce0bVa0I.js";import{U as dt,f as tl,d as Js,c as jt,b as nl,I as Gs,u as Tp,n as Mp}from"./use-connection-CcfriG4b.js";import{d as Op,C as dn,e as Ap,I as Ip,l as ca,G as lu,M as jp,m as Rp,R as ua,k as Dp}from"./resizable-0evkHPjb.js";import{E as kr,i as Pp}from"./SearchMd-C_x78fQD.js";import{E as lr}from"./error-boundary-IlI5HY5C.js";import{P as Ys}from"./formatDistanceToNow-BgvVIEk6.js";import{u as Lp,L as $p}from"./localstorage-keys-C2n4sqaz.js";import{u as _p,a as We,c as qe,b as Ue,T as Ke,i as rl}from"./tooltip-B77piVwL.js";import{B as ce,c as X}from"./button-RGWd1X_P.js";import{F as lt,a as au,b as Rt,c as vr,d as Dn}from"./form-C0miQmjx.js";import{I as Pn}from"./input-Cc7Y8Lsj.js";import{T as Qr,D as zp,a as Bp,b as Fp,f as Vp,c as Hp,d as Wp}from"./dialog-xbeC24qR.js";import{A as qp,D as Up,u as Kp}from"./use-binding-DOHpn0td.js";import{i as Gt}from"./Loading01-CZ--C9o4.js";import{s as sl}from"./Plus-B87V-eUk.js";import{i as Jp}from"./Upload01-BkY8x2qR.js";import{b as Cn,a as ol,V as Xs}from"./layout-k5sx-zLk.js";import{i as Gp}from"./AlertCircle-cYjr_0xB.js";import{s as Yp}from"./Clock-D4OCvk0s.js";import{a as Xp}from"./Copy01-DmZIDbuC.js";import{i as il,J as Qp}from"./json-syntax-highlighter-Bc0wDiKJ.js";import{s as ll,i as cu}from"./XClose-CPlecLXh.js";import{u as Zp,O as em,M as tm,F as nm,v as rm,E as sm}from"./index-RUqw7d0T.js";import{u as al}from"./use-mcp-B7yS6xB_.js";import{S as Ln}from"./spinner-B6Gpa1lS.js";import{V as om}from"./view-mode-toggle-BGpxvqYI.js";import{i as im}from"./GitBranch01-DGYWk3k6.js";import{a as uu,b as lm}from"./use-tool-call-CI1nZAFC.js";import"./index-KVbZU2bI.js";import{n as am}from"./Calendar-cB-o1wit.js";import{b as cm,D as um,a as dm,d as da,i as fm}from"./dropdown-menu-Dz-Cfe4c.js";import{B as fn}from"./badge-CzGd9Js-.js";import{i as du}from"./X-BI6-CrX0.js";import"./CpuChip02-CvUOZekE.js";import"./select-B-74Vw7Q.js";import"./ChevronDown-7kPeUreU.js";import"./use-mobile-DYo2aQNt.js";import"./use-gateway-CCphplYZ.js";import"./Terminal-Bp8rdp_p.js";import"./connection-card-B2ZNmA6T.js";import"./card-Bch45nKF.js";import"./LinkExternal01-BrZUQjLP.js";import"./File06-B9Csx588.js";import"./InfoCircle-DXZ2AFmC.js";import"./use-organization-settings-uQsDNKHC.js";import"./useQuery-CF3kr9sY.js";import"./auth-O7mzDtBv.js";import"./ArrowLeft-CBi8stO3.js";import"./mcp-oauth-BrdcIayH.js";import"./env-vars-editor-B-ADXMkg.js";import"./Trash01-kv9nDzIp.js";import"./Key01-BemiGYAL.js";import"./extract-connection-data-3bWrIOWG.js";import"./registry-utils-ulDDT0d8.js";import"./generate-id-Dyweu44Y.js";import"./index-CbrmpR2c.js";const fu=It("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 hu=It("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 hm=It("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const pm=It("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 pu=It("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 mu=It("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 gu=It("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 yu=It("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"}]]),cl=({size:n=24,color:e="currentColor",...t})=>N.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},N.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"}));cl.displayName="AlertOctagon";const xu=({size:n=24,color:e="currentColor",...t})=>N.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},N.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"}));xu.displayName="Box";const bu=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"m22.7 11.5-2 2-2-2m2.245 1.5A9 9 0 1 0 19 17.657M12 7v5l3 2"}));bu.displayName="ClockFastForward";const ku=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"m16 18 6-6-6-6M8 6l-6 6 6 6"}));ku.displayName="Code01";const vu=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"m17 17 5-5-5-5M7 7l-5 5 5 5m7-14-4 18"}));vu.displayName="Code02";const wu=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"M12 17a5 5 0 1 0 10 0 5 5 0 0 0-10 0Zm0 0c0-1.126.372-2.165 1-3V5m-1 12c0 .825.2 1.604.554 2.29-.842.712-2.788 1.21-5.054 1.21-3.038 0-5.5-.895-5.5-2V5m11 0c0 1.105-2.462 2-5.5 2S2 6.105 2 5m11 0c0-1.105-2.462-2-5.5-2S2 3.895 2 5m0 9c0 1.105 2.462 2 5.5 2 2.189 0 4.08-.465 4.965-1.138M13 9.5c0 1.105-2.462 2-5.5 2S2 10.605 2 9.5"}));wu.displayName="CoinsStacked01";const qr=({size:n=24,color:e="currentColor",...t})=>N.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},N.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"}));qr.displayName="Columns01";const Su=({size:n=24,color:e="currentColor",...t})=>N.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},N.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"}));Su.displayName="CornerDownRight";const Cu=({size:n=24,color:e="currentColor",...t})=>N.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},N.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"}));Cu.displayName="Database01";const Nu=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"M11 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 6.28 2 7.12 2 8.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 22 5.12 22 6.8 22h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C20 19.72 20 18.88 20 17.2V13M8 16h1.675c.489 0 .733 0 .963-.055.204-.05.4-.13.579-.24.201-.123.374-.296.72-.642L21.5 5.5a2.121 2.121 0 0 0-3-3l-9.563 9.563c-.346.346-.519.519-.642.72a2 2 0 0 0-.24.579c-.055.23-.055.474-.055.963V16Z"}));Nu.displayName="Edit05";const Qs=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"M3 9h13.5a4.5 4.5 0 1 1 0 9H12M3 9l4-4M3 9l4 4"}));Qs.displayName="FlipBackward";const Eu=({size:n=24,color:e="currentColor",...t})=>N.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},N.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"}));Eu.displayName="Repeat03";const Zs=({size:n=24,color:e="currentColor",...t})=>N.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},N.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"}));Zs.displayName="Save02";const Tu=({size:n=24,color:e="currentColor",...t})=>N.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},N.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"}));Tu.displayName="Tool01";const eo=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"M16 3.468a4.5 4.5 0 0 1 0 8.064m2 5.234c1.512.684 2.872 1.799 4 3.234M2 20c1.946-2.477 4.59-4 7.5-4s5.553 1.523 7.5 4M14 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));eo.displayName="Users02";const{getOwnPropertyNames:mm,getOwnPropertySymbols:gm}=Object,{hasOwnProperty:ym}=Object.prototype;function Do(n,e){return function(r,s,o){return n(r,s,o)&&e(r,s,o)}}function Ar(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 xm(n){return n?.[Symbol.toStringTag]}function fa(n){return mm(n).concat(gm(n))}const bm=Object.hasOwn||((n,e)=>ym.call(n,e));function tn(n,e){return n===e||!n&&!e&&n!==n&&e!==e}const km="__v",vm="__o",wm="_owner",{getOwnPropertyDescriptor:ha,keys:pa}=Object;function Sm(n,e){return n.byteLength===e.byteLength&&Zr(new Uint8Array(n),new Uint8Array(e))}function Cm(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 Nm(n,e){return n.byteLength===e.byteLength&&Zr(new Uint8Array(n.buffer,n.byteOffset,n.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function Em(n,e){return tn(n.getTime(),e.getTime())}function Tm(n,e){return n.name===e.name&&n.message===e.message&&n.cause===e.cause&&n.stack===e.stack}function Mm(n,e){return n===e}function ma(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 u=!1,d=0;for(;(l=c.next())&&!l.done;){if(s[d]){d++;continue}const f=i.value,h=l.value;if(t.equals(f[0],h[0],a,d,n,e,t)&&t.equals(f[1],h[1],f[0],h[0],n,e,t)){u=s[d]=!0;break}d++}if(!u)return!1;a++}return!0}const Om=tn;function Am(n,e,t){const r=pa(n);let s=r.length;if(pa(e).length!==s)return!1;for(;s-- >0;)if(!Mu(n,e,t,r[s]))return!1;return!0}function Vn(n,e,t){const r=fa(n);let s=r.length;if(fa(e).length!==s)return!1;let o,i,l;for(;s-- >0;)if(o=r[s],!Mu(n,e,t,o)||(i=ha(n,o),l=ha(e,o),(i||l)&&(!i||!l||i.configurable!==l.configurable||i.enumerable!==l.enumerable||i.writable!==l.writable)))return!1;return!0}function Im(n,e){return tn(n.valueOf(),e.valueOf())}function jm(n,e){return n.source===e.source&&n.flags===e.flags}function ga(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,u=0;for(;(l=a.next())&&!l.done;){if(!s[u]&&t.equals(i.value,l.value,i.value,l.value,n,e,t)){c=s[u]=!0;break}u++}if(!c)return!1}return!0}function Zr(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 Rm(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 Mu(n,e,t,r){return(r===wm||r===vm||r===km)&&(n.$$typeof||e.$$typeof)?!0:bm(e,r)&&t.equals(n[r],e[r],r,r,n,e,t)}const Dm="[object ArrayBuffer]",Pm="[object Arguments]",Lm="[object Boolean]",$m="[object DataView]",_m="[object Date]",zm="[object Error]",Bm="[object Map]",Fm="[object Number]",Vm="[object Object]",Hm="[object RegExp]",Wm="[object Set]",qm="[object String]",Um={"[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},Km="[object URL]",Jm=Object.prototype.toString;function Gm({areArrayBuffersEqual:n,areArraysEqual:e,areDataViewsEqual:t,areDatesEqual:r,areErrorsEqual:s,areFunctionsEqual:o,areMapsEqual:i,areNumbersEqual:l,areObjectsEqual:a,arePrimitiveWrappersEqual:c,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:h,unknownTagComparators:m}){return function(y,x,b){if(y===x)return!0;if(y==null||x==null)return!1;const v=typeof y;if(v!==typeof x)return!1;if(v!=="object")return v==="number"?l(y,x,b):v==="function"?o(y,x,b):!1;const C=y.constructor;if(C!==x.constructor)return!1;if(C===Object)return a(y,x,b);if(Array.isArray(y))return e(y,x,b);if(C===Date)return r(y,x,b);if(C===RegExp)return u(y,x,b);if(C===Map)return i(y,x,b);if(C===Set)return d(y,x,b);const k=Jm.call(y);if(k===_m)return r(y,x,b);if(k===Hm)return u(y,x,b);if(k===Bm)return i(y,x,b);if(k===Wm)return d(y,x,b);if(k===Vm)return typeof y.then!="function"&&typeof x.then!="function"&&a(y,x,b);if(k===Km)return h(y,x,b);if(k===zm)return s(y,x,b);if(k===Pm)return a(y,x,b);if(Um[k])return f(y,x,b);if(k===Dm)return n(y,x,b);if(k===$m)return t(y,x,b);if(k===Lm||k===Fm||k===qm)return c(y,x,b);if(m){let w=m[k];if(!w){const S=xm(y);S&&(w=m[S])}if(w)return w(y,x,b)}return!1}}function Ym({circular:n,createCustomConfig:e,strict:t}){let r={areArrayBuffersEqual:Sm,areArraysEqual:t?Vn:Cm,areDataViewsEqual:Nm,areDatesEqual:Em,areErrorsEqual:Tm,areFunctionsEqual:Mm,areMapsEqual:t?Do(ma,Vn):ma,areNumbersEqual:Om,areObjectsEqual:t?Vn:Am,arePrimitiveWrappersEqual:Im,areRegExpsEqual:jm,areSetsEqual:t?Do(ga,Vn):ga,areTypedArraysEqual:t?Do(Zr,Vn):Zr,areUrlsEqual:Rm,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),n){const s=Ar(r.areArraysEqual),o=Ar(r.areMapsEqual),i=Ar(r.areObjectsEqual),l=Ar(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:s,areMapsEqual:o,areObjectsEqual:i,areSetsEqual:l})}return r}function Xm(n){return function(e,t,r,s,o,i,l){return n(e,t,l)}}function Qm({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:u}=t();return e(l,a,{cache:c,equals:r,meta:u,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 Zm=Dt();Dt({strict:!0});Dt({circular:!0});Dt({circular:!0,strict:!0});Dt({createInternalComparator:()=>tn});Dt({strict:!0,createInternalComparator:()=>tn});Dt({circular:!0,createInternalComparator:()=>tn});Dt({circular:!0,createInternalComparator:()=>tn,strict:!0});function Dt(n={}){const{circular:e=!1,createInternalComparator:t,createState:r,strict:s=!1}=n,o=Ym(n),i=Gm(o),l=t?t(i):Xm(i);return Qm({circular:e,comparator:i,createState:r,equals:l,strict:s})}function eg(n){const e=P.c(3),{gatewayId:t,onSelect:r}=n,{data:s}=Ap(t);if(s.length===0)return null;let o;return e[0]!==r||e[1]!==s?(o=p.jsx(Ip,{prompts:s,onSelect:r,className:"mt-6"}),e[0]=r,e[1]=s,e[2]=o):o=e[2],o}function tg(n){const e=P.c(20),{form:t}=n;let r;e[0]!==t?(r=d=>{const{field:f}=d;return p.jsx(cg,{size:"md",value:f.value,onChange:f.onChange,alt:t.watch("title")})},e[0]=t,e[1]=r):r=e[1];let s;e[2]!==t.control||e[3]!==r?(s=p.jsx(lt,{control:t.control,name:"avatar",render:r}),e[2]=t.control,e[3]=r,e[4]=s):s=e[4];let o;e[5]!==t.control?(o=p.jsxs("div",{className:"flex flex-col gap-3 flex-1 min-w-0",children:[p.jsx(lt,{control:t.control,name:"title",render:ig}),p.jsx(lt,{control:t.control,name:"description",render:og})]}),e[5]=t.control,e[6]=o):o=e[6];let i;e[7]!==s||e[8]!==o?(i=p.jsxs("div",{className:"flex gap-4 items-start",children:[s,o]}),e[7]=s,e[8]=o,e[9]=i):i=e[9];let l,a;e[10]!==t.control?(l=p.jsxs("div",{className:"flex gap-4",children:[p.jsx(lt,{control:t.control,name:"gateway_id",render:sg}),p.jsx(lt,{control:t.control,name:"model",render:rg})]}),a=p.jsx(lt,{control:t.control,name:"system_prompt",render:ng}),e[10]=t.control,e[11]=l,e[12]=a):(l=e[11],a=e[12]);let c;e[13]!==i||e[14]!==l||e[15]!==a?(c=p.jsxs("div",{className:"h-full py-6 flex flex-col max-w-2xl mx-auto w-full min-w-0 gap-6 overflow-y-auto",children:[i,l,a]}),e[13]=i,e[14]=l,e[15]=a,e[16]=c):c=e[16];let u;return e[17]!==t||e[18]!==c?(u=p.jsx(au,{...t,children:c}),e[17]=t,e[18]=c,e[19]=u):u=e[19],u}function ng(n){const{field:e}=n;return p.jsxs(Rt,{className:"flex-1 flex flex-col min-h-0",children:[p.jsx(vr,{className:"text-xs text-muted-foreground",children:"System prompt"}),p.jsx(Dn,{children:p.jsx(Qr,{...e,placeholder:"You are a helpful assistant...",className:"flex-1 min-h-[200px] 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 rg(n){const{field:e}=n;return p.jsxs(Rt,{className:"flex-1",children:[p.jsx(vr,{className:"text-xs text-muted-foreground",children:"Model"}),p.jsx(jp,{selectedModel:e.value?{id:e.value.id,connectionId:e.value.connectionId}:void 0,onModelChange:t=>e.onChange({id:t.id,connectionId:t.connectionId}),placeholder:"Select model",variant:"bordered",className:"w-full"})]})}function sg(n){const{field:e}=n;return p.jsxs(Rt,{className:"flex-1",children:[p.jsx(vr,{className:"text-xs text-muted-foreground",children:"Gateway"}),p.jsx(lu,{selectedGatewayId:e.value,onGatewayChange:e.onChange,placeholder:"Select gateway",variant:"bordered",className:"w-full"})]})}function og(n){const{field:e}=n;return p.jsxs(Rt,{children:[p.jsx(vr,{className:"text-xs text-muted-foreground",children:"Description"}),p.jsx(Dn,{children:p.jsx(Pn,{...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 ig(n){const{field:e}=n;return p.jsxs(Rt,{children:[p.jsx(vr,{className:"text-xs text-muted-foreground",children:"Name"}),p.jsx(Dn,{children:p.jsx(Pn,{...e,placeholder:"Untitled assistant",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function lg(n){const e=P.c(62),{activeThreadId:t,mode:r,assistant:s,form:o}=n;let i;e[0]!==t||e[1]!==s.system_prompt?(i={threadId:t,systemPrompt:s.system_prompt},e[0]=t,e[1]=s.system_prompt,e[2]=i):i=e[2];const l=Op(i),a=!!s.gateway_id&&!!s.model?.id&&!!s.model?.connectionId;let c;e[3]!==t||e[4]!==s.gateway_id||e[5]!==s.model||e[6]!==l||e[7]!==a?(c=async H=>{if(!a)return;const K={created_at:new Date().toISOString(),thread_id:t,model:{id:s.model.id,connectionId:s.model.connectionId},gateway:{id:s.gateway_id??""},user:{name:"you"}};await l.sendMessage(H,K)},e[3]=t,e[4]=s.gateway_id,e[5]=s.model,e[6]=l,e[7]=a,e[8]=c):c=e[8];const u=c;let d;e[9]!==s.avatar||e[10]!==s.title?(d=s.avatar?p.jsx("div",{className:"size-[60px] rounded-[18px] border border-border shrink-0 overflow-hidden",children:p.jsx("img",{src:s.avatar,alt:s.title,className:"h-full w-full object-cover"})}):p.jsx("div",{className:"size-[60px] rounded-[18px] border border-border shrink-0 overflow-hidden bg-muted/20 flex items-center justify-center",children:p.jsx(eo,{size:28,className:"text-muted-foreground"})}),e[9]=s.avatar,e[10]=s.title,e[11]=d):d=e[11];let f;e[12]!==s.title?(f=p.jsx("h3",{className:"text-xl font-medium text-foreground",children:s.title}),e[12]=s.title,e[13]=f):f=e[13];let h;e[14]!==s.description?(h=s.description?p.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:s.description}):null,e[14]=s.description,e[15]=h):h=e[15];let m;e[16]!==d||e[17]!==f||e[18]!==h?(m=p.jsxs("div",{className:"flex flex-col items-center gap-4",children:[d,f,h]}),e[16]=d,e[17]=f,e[18]=h,e[19]=m):m=e[19];let g;e[20]!==s.gateway_id||e[21]!==u?(g=s.gateway_id&&p.jsx(lr,{fallback:null,children:p.jsx(N.Suspense,{fallback:p.jsx("div",{className:"flex justify-center mt-6",children:p.jsx(Gt,{size:20,className:"animate-spin text-muted-foreground"})}),children:p.jsx(eg,{gatewayId:s.gateway_id,onSelect:H=>{u(H.description??H.name)}})})}),e[20]=s.gateway_id,e[21]=u,e[22]=g):g=e[22];let y;e[23]!==m||e[24]!==g?(y=p.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-4 text-center",children:[m,g]}),e[23]=m,e[24]=g,e[25]=y):y=e[25];const x=y;let b;e[26]!==l.messages?(b=l.messages.filter(ag),e[26]=l.messages,e[27]=b):b=e[27];const v=b,C=r==="edit",k=C?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none";let w;e[28]!==k?(w=X("absolute inset-0 px-2 transition-opacity duration-200 ease-out",k),e[28]=k,e[29]=w):w=e[29];let S;e[30]!==o?(S=p.jsx(tg,{form:o}),e[30]=o,e[31]=S):S=e[31];let M;e[32]!==w||e[33]!==S?(M=p.jsx("div",{className:w,children:S}),e[32]=w,e[33]=S,e[34]=M):M=e[34];const T=C?"opacity-0 pointer-events-none":"opacity-100";let E;e[35]!==T?(E=X("h-full transition-opacity duration-200 ease-out",T),e[35]=T,e[36]=E):E=e[36];let R;e[37]!==l.messages||e[38]!==l.status||e[39]!==x||e[40]!==v.length?(R=v.length===0?p.jsx(dn.EmptyState,{children:x}):p.jsx(dn.Messages,{messages:l.messages,status:l.status,minHeightOffset:240}),e[37]=l.messages,e[38]=l.status,e[39]=x,e[40]=v.length,e[41]=R):R=e[41];let D;e[42]!==E||e[43]!==R?(D=p.jsx("div",{className:E,children:R}),e[42]=E,e[43]=R,e[44]=D):D=e[44];let B;e[45]!==M||e[46]!==D?(B=p.jsxs(dn.Main,{className:"h-full relative overflow-hidden",children:[M,D]}),e[45]=M,e[46]=D,e[47]=B):B=e[47];const _=C?"translate-y-full":"translate-y-0";let O;e[48]!==_?(O=X("transition-transform duration-300 ease-out",_),e[48]=_,e[49]=O):O=e[49];const A=!a,L=l.status==="submitted"||l.status==="streaming";let z;e[50]!==l.messages||e[51]!==l.stop||e[52]!==u||e[53]!==A||e[54]!==L?(z=p.jsx(dn.Footer,{children:p.jsx("div",{className:"max-w-2xl mx-auto w-full min-w-0",children:p.jsx(dn.Input,{onSubmit:u,onStop:l.stop,disabled:A,isStreaming:L,placeholder:"Ask anything or @ for context",usageMessages:l.messages})})}),e[50]=l.messages,e[51]=l.stop,e[52]=u,e[53]=A,e[54]=L,e[55]=z):z=e[55];let U;e[56]!==O||e[57]!==z?(U=p.jsx("div",{className:O,children:z}),e[56]=O,e[57]=z,e[58]=U):U=e[58];let W;return e[59]!==B||e[60]!==U?(W=p.jsxs(dn,{children:[B,U]}),e[59]=B,e[60]=U,e[61]=W):W=e[61],W}function ag(n){return n.role!=="system"}function cg(n){const e=P.c(18),{value:t,onChange:r,alt:s,size:o}=n,i=o===void 0?"md":o,l=N.useRef(null),a=i==="xs"?"h-6 w-6":i==="sm"?"h-8 w-8":"h-16 w-16",c=i==="xs"?"h-3 w-3":i==="sm"?"h-4 w-4":"h-6 w-6",u=i==="xs"?"h-3 w-3":i==="sm"?"h-3.5 w-3.5":"h-5 w-5";let d;e[0]!==r?(d=w=>{const S=w.target.files?.[0];if(!S)return;const M=new FileReader;M.onloadend=()=>{const T=M.result;r(T)},M.readAsDataURL(S)},e[0]=r,e[1]=d):d=e[1];const f=d;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{l.current?.click()},e[2]=h):h=e[2];const m=h,g=`relative ${a} shrink-0 cursor-pointer group`;let y;e[3]!==f?(y=p.jsx("input",{type:"file",ref:l,className:"hidden",accept:"image/*",onChange:f}),e[3]=f,e[4]=y):y=e[4];let x;e[5]!==s||e[6]!==c||e[7]!==t?(x=t?p.jsx("img",{src:t,alt:s||"Avatar",className:"w-full h-full object-cover"}):p.jsx("div",{className:"w-full h-full flex items-center justify-center text-muted-foreground",children:p.jsx(eo,{className:c})}),e[5]=s,e[6]=c,e[7]=t,e[8]=x):x=e[8];const b=`${u} text-white`;let v;e[9]!==b?(v=p.jsx("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center rounded-xl",children:p.jsx(Jp,{className:b})}),e[9]=b,e[10]=v):v=e[10];let C;e[11]!==x||e[12]!==v?(C=p.jsxs("div",{className:"h-full w-full rounded-xl border border-border bg-muted/20 overflow-hidden relative",children:[x,v]}),e[11]=x,e[12]=v,e[13]=C):C=e[13];let k;return e[14]!==g||e[15]!==y||e[16]!==C?(k=p.jsxs("div",{className:g,onClick:m,children:[y,C]}),e[14]=g,e[15]=y,e[16]=C,e[17]=k):k=e[17],k}function ug(n){const e=P.c(56),{providerId:t,assistantId:r,onBack:s}=n,i=Us().location.href,l=Yi();let a;e[0]!==s||e[1]!==l?(a=s??(()=>l.history.back()),e[0]=s,e[1]=l,e[2]=a):a=e[2];const c=a,{locator:u}=_p();let d;e[3]!==r||e[4]!==u?(d=$p.assistantChatActiveThread(u,r),e[3]=r,e[4]=u,e[5]=d):d=e[5];const[f,h]=Lp(d,dg),m=t||dt;let g;e[6]!==m?(g=jt(m),e[6]=m,e[7]=g):g=e[7];const y=g,x=tl(t,"ASSISTANT",r,y),b=Js(t,"ASSISTANT",y),v=b.update.isPending,[C,k]=N.useState(x?.model.id&&x?.gateway_id?"chat":"edit");let w;e[8]===Symbol.for("react.memo_cache_sentinel")?(w=ip(qp),e[8]=w):w=e[8];const S=x??void 0;let M;e[9]!==S?(M={resolver:w,values:S},e[9]=S,e[10]=M):M=e[10];const T=ru(M);let E;e[11]!==b.update||e[12]!==r||e[13]!==T?(E=T.handleSubmit(async Y=>{const te=await b.update.mutateAsync({id:r,data:Y});T.reset(te),k("chat")}),e[11]=b.update,e[12]=r,e[13]=T,e[14]=E):E=e[14];const R=E;if(!x){let Y;e[15]===Symbol.for("react.memo_cache_sentinel")?(Y=p.jsx(ca,{}),e[15]=Y):Y=e[15];let te;e[16]===Symbol.for("react.memo_cache_sentinel")?(te=p.jsx("div",{className:"flex h-full w-full bg-background",children:p.jsx(kr,{title:"Assistant not found",description:"This assistant may have been deleted or you may not have access to it."})}),e[16]=te):te=e[16];let fe;return e[17]!==c?(fe=p.jsx(lr,{children:p.jsx(N.Suspense,{fallback:Y,children:p.jsx(Cn,{onBack:c,children:te})})}),e[17]=c,e[18]=fe):fe=e[18],fe}let D;e[19]===Symbol.for("react.memo_cache_sentinel")?(D=p.jsx(ca,{}),e[19]=D):D=e[19];let B;e[20]!==x.avatar||e[21]!==x.title?(B=p.jsx("div",{className:"h-6 w-6 min-w-6 rounded-lg border border-border bg-muted/20 overflow-hidden shrink-0",children:x.avatar?p.jsx("img",{src:x.avatar,alt:x.title,className:"h-full w-full object-cover"}):p.jsx("div",{className:"h-full w-full flex items-center justify-center text-muted-foreground",children:p.jsx(eo,{size:12,className:"text-muted-foreground"})})}),e[20]=x.avatar,e[21]=x.title,e[22]=B):B=e[22];let _;e[23]!==x.title?(_=p.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:x.title}),e[23]=x.title,e[24]=_):_=e[24];let O;e[25]!==x.description?(O=x.description?p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),p.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:x.description})]}):null,e[25]=x.description,e[26]=O):O=e[26];let A;e[27]!==_||e[28]!==O?(A=p.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[_,O]}),e[27]=_,e[28]=O,e[29]=A):A=e[29];let L;e[30]!==B||e[31]!==A?(L=p.jsx(ol,{children:p.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[B,A]})}),e[30]=B,e[31]=A,e[32]=L):L=e[32];const z=x.avatar??"assistant";let U;e[33]!==x.title||e[34]!==z||e[35]!==i?(U=p.jsx(Ys,{title:x.title,url:i,icon:z}),e[33]=x.title,e[34]=z,e[35]=i,e[36]=U):U=e[36];let W;e[37]!==T.formState.isDirty||e[38]!==v||e[39]!==C||e[40]!==R||e[41]!==h?(W=C==="chat"?p.jsxs(p.Fragment,{children:[p.jsx(We,{children:p.jsxs(qe,{children:[p.jsx(Ue,{asChild:!0,children:p.jsx(ce,{type:"button",onClick:()=>h(crypto.randomUUID()),"aria-label":"New thread",variant:"outline",size:"icon",className:"size-7 border border-input",children:p.jsx(sl,{size:16})})}),p.jsx(Ke,{children:"New thread"})]})}),p.jsx(We,{children:p.jsxs(qe,{children:[p.jsx(Ue,{asChild:!0,children:p.jsx(ce,{type:"button",onClick:()=>k("edit"),"aria-label":"Edit",variant:"outline",size:"icon",className:"size-7 border border-input",children:p.jsx(Nu,{size:16})})}),p.jsx(Ke,{children:"Edit"})]})})]}):p.jsxs(p.Fragment,{children:[p.jsx(We,{children:p.jsxs(qe,{delayDuration:0,children:[p.jsx(Ue,{asChild:!0,children:p.jsx("span",{className:"inline-block",children:p.jsx(ce,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:v,onClick:()=>k("chat"),"aria-label":"Cancel",children:p.jsx(Qs,{size:14})})})}),p.jsx(Ke,{side:"bottom",children:"Cancel"})]})}),p.jsx(We,{children:p.jsxs(qe,{delayDuration:0,children:[p.jsx(Ue,{asChild:!0,children:p.jsx("span",{className:"inline-block",children:p.jsx(ce,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:!T.formState.isDirty||v,onClick:()=>{R()},"aria-label":"Save",children:v?p.jsx(Gt,{size:14,className:"animate-spin"}):p.jsx(Zs,{size:14})})})}),p.jsx(Ke,{side:"bottom",children:"Save"})]})})]}),e[37]=T.formState.isDirty,e[38]=v,e[39]=C,e[40]=R,e[41]=h,e[42]=W):W=e[42];let H;e[43]!==U||e[44]!==W?(H=p.jsxs(Xs,{children:[U,W]}),e[43]=U,e[44]=W,e[45]=H):H=e[45];let K;e[46]!==f||e[47]!==x||e[48]!==T||e[49]!==C?(K=p.jsx("div",{className:"h-full",children:p.jsx(lg,{activeThreadId:f,mode:C,assistant:x,form:T},T.formState.submitCount)}),e[46]=f,e[47]=x,e[48]=T,e[49]=C,e[50]=K):K=e[50];let Z;return e[51]!==c||e[52]!==L||e[53]!==H||e[54]!==K?(Z=p.jsx(lr,{children:p.jsx(N.Suspense,{fallback:D,children:p.jsxs(Cn,{onBack:c,children:[L,H,K]})})}),e[51]=c,e[52]=L,e[53]=H,e[54]=K,e[55]=Z):Z=e[55],Z}function dg(n){return n||crypto.randomUUID()}function fg(n){const e=P.c(6),{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=jn(s).connectionId??dt;if(!i||i===dt){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=p.jsx("div",{className:"flex h-full w-full bg-background",children:p.jsx(kr,{title:"Assistant not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let l;return e[2]!==i||e[3]!==t||e[4]!==r?(l=p.jsx(ug,{providerId:i,assistantId:t,onBack:r}),e[2]=i,e[3]=t,e[4]=r,e[5]=l):l=e[5],l}lp({title:jo().min(1),description:jo().nullable(),body:jo()});function Po(n){for(const e of n.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function hg(){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 pg(n){const e=P.c(13),{form:t}=n;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=p.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=r):r=e[0];let s;e[1]!==t.control?(s=p.jsxs("div",{className:"flex flex-col gap-4",children:[r,p.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[p.jsx(lt,{control:t.control,name:"title",render:yg}),p.jsx(lt,{control:t.control,name:"description",render:gg})]})]}),e[1]=t.control,e[2]=s):s=e[2];let o,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=p.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),i=p.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=p.jsxs("div",{className:"flex flex-col gap-2",children:[o,i,p.jsx(lt,{control:t.control,name:"body",render:mg})]}),e[5]=t.control,e[6]=l):l=e[6];let a;e[7]!==s||e[8]!==l?(a=p.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=p.jsx(au,{...t,children:a}),e[10]=t,e[11]=a,e[12]=c):c=e[12],c}function mg(n){const{field:e}=n;return p.jsx(Rt,{children:p.jsx(Dn,{children:p.jsx(Qr,{...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 gg(n){const{field:e}=n;return p.jsxs(Rt,{children:[p.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),p.jsx(Dn,{children:p.jsx(Pn,{...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 yg(n){const{field:e}=n;return p.jsxs(Rt,{children:[p.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),p.jsx(Dn,{children:p.jsx(Pn,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function xg(n){const e=P.c(51),{providerId:t,promptId:r,onBack:s}=n,i=Us().location.href,l=t||dt;let a;e[0]!==l?(a=jt(l),e[0]=l,e[1]=a):a=e[1];const c=a,u=tl(t,"PROMPT",r,c),d=Js(t,"PROMPT",c),f=d.update.isPending;let h;e[2]!==u?(h=u?{title:u.title,description:u.description??null,body:Po(u)}:void 0,e[2]=u,e[3]=h):h=e[3];let m;e[4]!==h?(m={values:h},e[4]=h,e[5]=m):m=e[5];const g=ru(m);let y;e[6]!==g||e[7]!==u?(y=()=>{u&&g.reset({title:u.title,description:u.description??null,body:Po(u)})},e[6]=g,e[7]=u,e[8]=y):y=e[8];const x=y;let b;e[9]!==d.update||e[10]!==g||e[11]!==r?(b=g.handleSubmit(async K=>{const Z=await d.update.mutateAsync({id:r,data:{title:K.title,description:K.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:K.body}}]}});g.reset({title:Z.title,description:Z.description??null,body:Po(Z)})}),e[9]=d.update,e[10]=g,e[11]=r,e[12]=b):b=e[12];const v=b;if(!u){let K;return e[13]===Symbol.for("react.memo_cache_sentinel")?(K=p.jsx("div",{className:"flex h-full w-full bg-background",children:p.jsx(kr,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[13]=K):K=e[13],K}let C;e[14]!==u.title?(C=p.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:u.title}),e[14]=u.title,e[15]=C):C=e[15];let k;e[16]!==u.description?(k=u.description?p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),p.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:u.description})]}):null,e[16]=u.description,e[17]=k):k=e[17];let w;e[18]!==C||e[19]!==k?(w=p.jsx(ol,{children:p.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[C,k]})}),e[18]=C,e[19]=k,e[20]=w):w=e[20];let S;e[21]!==u.title||e[22]!==i?(S=p.jsx(Ys,{title:u.title,url:i,icon:"description"}),e[21]=u.title,e[22]=i,e[23]=S):S=e[23];const M=!g.formState.isDirty||f;let T;e[24]===Symbol.for("react.memo_cache_sentinel")?(T=p.jsx(Qs,{size:14}),e[24]=T):T=e[24];let E;e[25]!==x||e[26]!==M?(E=p.jsx(Ue,{asChild:!0,children:p.jsx("span",{className:"inline-block",children:p.jsx(ce,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:M,onClick:x,"aria-label":"Cancel",children:T})})}),e[25]=x,e[26]=M,e[27]=E):E=e[27];let R;e[28]===Symbol.for("react.memo_cache_sentinel")?(R=p.jsx(Ke,{side:"bottom",children:"Cancel"}),e[28]=R):R=e[28];let D;e[29]!==E?(D=p.jsx(We,{children:p.jsxs(qe,{delayDuration:0,children:[E,R]})}),e[29]=E,e[30]=D):D=e[30];const B=!g.formState.isDirty||f;let _;e[31]!==v?(_=()=>{v()},e[31]=v,e[32]=_):_=e[32];let O;e[33]===Symbol.for("react.memo_cache_sentinel")?(O=p.jsx(Zs,{size:14}),e[33]=O):O=e[33];let A;e[34]!==B||e[35]!==_?(A=p.jsx(Ue,{asChild:!0,children:p.jsx("span",{className:"inline-block",children:p.jsx(ce,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:B,onClick:_,"aria-label":"Save",children:O})})}),e[34]=B,e[35]=_,e[36]=A):A=e[36];let L;e[37]===Symbol.for("react.memo_cache_sentinel")?(L=p.jsx(Ke,{side:"bottom",children:"Save"}),e[37]=L):L=e[37];let z;e[38]!==A?(z=p.jsx(We,{children:p.jsxs(qe,{delayDuration:0,children:[A,L]})}),e[38]=A,e[39]=z):z=e[39];let U;e[40]!==S||e[41]!==D||e[42]!==z?(U=p.jsxs(Xs,{children:[S,D,z]}),e[40]=S,e[41]=D,e[42]=z,e[43]=U):U=e[43];let W;e[44]!==g?(W=p.jsx("div",{className:"h-full",children:p.jsx(pg,{form:g})}),e[44]=g,e[45]=W):W=e[45];let H;return e[46]!==s||e[47]!==U||e[48]!==W||e[49]!==w?(H=p.jsxs(Cn,{onBack:s,children:[w,U,W]}),e[46]=s,e[47]=U,e[48]=W,e[49]=w,e[50]=H):H=e[50],H}function bg(n){const e=P.c(5),{itemId:t,onBack:r}=n;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=hg()??dt,e[0]=s):s=e[0];const o=s;if(!o||o===dt){let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=p.jsx("div",{className:"flex h-full w-full bg-background",children:p.jsx(kr,{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=p.jsx(lr,{children:p.jsx(N.Suspense,{fallback:null,children:p.jsx(xg,{providerId:o,promptId:t,onBack:r})})}),e[2]=t,e[3]=r,e[4]=i):i=e[4],i}const kg=ap("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 vg(n){const e=P.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=X(kg({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=p.jsx("div",{"data-slot":"alert",role:"alert",className:o,...r}),e[7]=r,e[8]=o,e[9]=i):i=e[9],i}function wg(n){const e=P.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=X("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=p.jsx("div",{"data-slot":"alert-title",className:s,...r}),e[5]=r,e[6]=s,e[7]=o):o=e[7],o}function Sg(n){const e=P.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=X("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=p.jsx("div",{"data-slot":"alert-description",className:s,...r}),e[5]=r,e[6]=s,e[7]=o):o=e[7],o}const Cg=n=>n.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ng(n){const e=P.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=Zp(a);if(!c.isAuthenticated){let f;return e[4]!==c.supportsOAuth||e[5]!==s?(f=p.jsx("div",{className:"flex h-full items-center justify-center",children:c.supportsOAuth?p.jsx(em,{onAuthenticate:()=>s(),buttonText:"Go back to authenticate"}):p.jsx(tm,{hasReadme:!1})}),e[4]=c.supportsOAuth,e[5]=s,e[6]=f):f=e[6],f}const u=`${r}:${t}`;let d;return e[7]!==r||e[8]!==l||e[9]!==s||e[10]!==u||e[11]!==t?(d=p.jsx(Eg,{toolName:t,connectionId:r,mcpProxyUrl:l,onBack:s},u),e[7]=r,e[8]=l,e[9]=s,e[10]=u,e[11]=t,e[12]=d):d=e[12],d}function Eg({toolName:n,connectionId:e,mcpProxyUrl:t,onBack:r}){const o=Us().location.href,{replayId:i}=cp({strict:!1}),l=(()=>{if(!i)return null;const A=`replay-${i}`,L=sessionStorage.getItem(A);if(!L)return null;sessionStorage.removeItem(A);try{return JSON.parse(L)}catch{return null}})(),a=(()=>{if(!l)return null;const A={};for(const[L,z]of Object.entries(l))z!==null&&typeof z=="object"?A[L]=JSON.stringify(z,null,2):A[L]=z;return A})(),[c,u]=N.useState(a??{}),[d,f]=N.useState(l?JSON.stringify(l,null,2):"{}"),[h,m]=N.useState(null),[g,y]=N.useState(null),[x,b]=N.useState(!1),[v,C]=N.useState(null),k=nl(e),w=al({url:t.href});N.useEffect(()=>{w.error&&console.error("MCP Error:",w.error)},[w.error]);const S=w.tools?.find(A=>A.name===n),M=S?.inputSchema?.properties,T=M?Object.keys(M):[],E=T.length>0,R={};if(E&&S?.inputSchema?.properties)for(const A of T)R[A]=S.inputSchema.required?.includes(A)?"":void 0;const D=A=>Object.prototype.hasOwnProperty.call(c,A),B=async()=>{b(!0),y(null),m(null),C(null);const A=performance.now(),L=jt(e);try{const z=E?{...R,...c}:(()=>{const Y=d.trim();if(!Y)return{};const te=JSON.parse(Y);if(te&&typeof te=="object")return te;throw new Error("Raw JSON input must be an object.")})();E&&S?.inputSchema?.properties&&Object.entries(S.inputSchema.properties).forEach(([Y,te])=>{if((te.type==="object"||te.type==="array")&&typeof z[Y]=="string")try{z[Y]=JSON.parse(z[Y])}catch{}});const U=await L(n,z),W=performance.now(),H=Math.round(W-A);m(U);const K=JSON.stringify(U),Z=new TextEncoder().encode(K).length;C({duration:`${H}ms`,bytes:`${Z} bytes`,tokens:`~${Math.ceil(Z/4)} tokens`,cost:"$0.0000"})}catch(z){const U=z instanceof Error?z.message:String(z);y(U||"Unknown error occurred");const W=performance.now();C({duration:`${Math.round(W-A)}ms`})}finally{b(!1)}},_=(A,L)=>{u(z=>({...z,[A]:L}))},O=()=>{m(null),y(null),C(null)};return p.jsxs(Cn,{onBack:r,children:[p.jsx(Xs,{children:p.jsx(Ys,{title:S?.name??Cg(n),url:o,icon:"build"})}),p.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 h-full",children:[p.jsx("div",{className:"flex flex-col border-r border-border overflow-hidden",children:p.jsxs("div",{className:"flex-1 overflow-auto",children:[p.jsx("div",{className:"flex flex-col gap-4 p-6 border-b border-border min-h-28",children:p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(Gs,{icon:k?.icon||null,name:k?.title||n,size:"sm",className:"shadow-sm shrink-0"}),p.jsx("h1",{className:"text-lg font-medium text-foreground leading-none",children:n}),p.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit",children:[w.state==="ready"?p.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):w.state==="connecting"?p.jsx(Gt,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):p.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),p.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:w.state.replace("_"," ")})]})]}),p.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:S?.description||"No description available"})]})}),p.jsxs("div",{className:"flex flex-col p-6 gap-4",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),S?.inputSchema?.required&&S.inputSchema.required.length>0&&p.jsxs("span",{className:"text-xs text-muted-foreground",children:[p.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),p.jsx("div",{className:"space-y-4",children:E&&S?.inputSchema?.properties?Object.entries(S.inputSchema.properties).map(([A,L])=>p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[A,S.inputSchema?.required?.includes(A)&&p.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),p.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:L.type})]}),L.description&&p.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:L.description}),L.type==="object"||L.type==="array"?p.jsx(Qr,{className:"font-mono text-xs",value:D(A)?c[A]??"":R[A]??"",onChange:z=>_(A,z.target.value),placeholder:`Enter ${A} as JSON...`,rows:3}):p.jsx(Pn,{value:D(A)?c[A]??"":R[A]??"",onChange:z=>_(A,z.target.value),placeholder:`Enter ${A}...`})]},A)):S?.inputSchema&&!E?p.jsxs("div",{className:"space-y-2",children:[p.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),p.jsx(Qr,{className:"font-mono text-xs min-h-[120px]",value:d,onChange:A=>f(A.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):p.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:p.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})})]})]})}),p.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[p.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:[p.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),v&&p.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(Yp,{className:"h-3 w-3 text-muted-foreground"}),p.jsx("span",{className:"font-mono text-foreground",children:v.duration})]}),v.tokens&&p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(xu,{className:"h-3 w-3 text-muted-foreground"}),p.jsx("span",{className:"font-mono text-foreground",children:v.tokens})]}),v.bytes&&p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(Cu,{className:"h-3 w-3 text-muted-foreground"}),p.jsx("span",{className:"font-mono text-foreground",children:v.bytes})]}),v.cost&&p.jsx("div",{className:"flex items-center gap-1.5",children:p.jsx("span",{className:"font-mono text-foreground",children:v.cost})})]})]}),p.jsx("div",{className:"flex items-center justify-end lg:justify-between px-4 h-14 border-b border-border bg-background",children:p.jsxs("div",{className:"flex items-center gap-2 w-full lg:w-auto",children:[p.jsx(ce,{size:"sm",variant:"default",className:"h-8 gap-2 flex-1 lg:flex-none",onClick:B,disabled:x,children:x?p.jsxs(p.Fragment,{children:[p.jsx(Gt,{size:14,className:"animate-spin"}),"Executing..."]}):p.jsxs(p.Fragment,{children:[p.jsx(il,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})}),p.jsx(We,{children:p.jsxs(qe,{children:[p.jsx(Ue,{asChild:!0,children:p.jsx(ce,{size:"icon",variant:"outline",className:"h-8 w-8 shrink-0",onClick:O,disabled:!h&&!g,children:p.jsx(ll,{size:14})})}),p.jsx(Ke,{children:p.jsx("p",{children:"Clear results"})})]})})]})}),g&&p.jsx("div",{className:"px-6 py-4 bg-background",children:p.jsx(vg,{variant:"destructive",children:p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Gp,{className:"h-4 w-4"}),p.jsx(wg,{className:"mb-0",children:"Execution Failed"})]}),p.jsx(Sg,{className:"text-xs text-destructive",children:g})]})})}),p.jsx("div",{className:"relative flex-1 overflow-auto bg-muted/50",children:h?p.jsxs(p.Fragment,{children:[p.jsx(Qp,{jsonString:JSON.stringify(h,null,2),padding:"1.5rem"}),p.jsx(ce,{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)),up.success("Copied to clipboard")},children:p.jsx(Xp,{className:"h-3.5 w-3.5"})})]}):p.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[p.jsx(ku,{className:"h-12 w-12 mb-3 opacity-40"}),p.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]})]})]})}function Tg(n){const e=P.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=jn(s).connectionId??dt;if(!nl(i)){let u;return e[1]===Symbol.for("react.memo_cache_sentinel")?(u=p.jsx("div",{className:"flex h-full items-center justify-center",children:p.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[p.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),p.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[1]=u):u=e[1],u}let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=p.jsx("div",{className:"flex h-full items-center justify-center",children:p.jsx(Gt,{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=p.jsx(N.Suspense,{fallback:a,children:p.jsx(Ng,{toolName:t,connectionId:i,onBack:r})}),e[3]=i,e[4]=r,e[5]=t,e[6]=c):c=e[6],c}const ya=n=>{let e;const t=new Set,r=(c,u)=>{const d=typeof c=="function"?c(e):c;if(!Object.is(d,e)){const f=e;e=u??(typeof d!="object"||d===null)?d:Object.assign({},e,d),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},ul=(n=>n?ya(n):ya),Mg=n=>n;function yi(n,e=Mg){const t=Q.useSyncExternalStore(n.subscribe,Q.useCallback(()=>e(n.getState()),[n,e]),Q.useCallback(()=>e(n.getInitialState()),[n,e]));return Q.useDebugValue(t),t}const Og=n=>{const e=ul(n),t=r=>yi(e,r);return Object.assign(t,e),t},Ag=(n=>Og);function Ou(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 xi=n=>e=>{try{const t=n(e);return t instanceof Promise?t:{then(r){return xi(r)(t)},catch(r){return this}}}catch(t){return{then(r){return this},catch(r){return xi(r)(t)}}}},Ig=(n,e)=>(t,r,s)=>{let o={storage:Ou(()=>localStorage),partialize:g=>g,version:0,merge:(g,y)=>({...y,...g}),...e},i=!1;const l=new Set,a=new Set;let c=o.storage;if(!c)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 c.setItem(o.name,{state:g,version:o.version})},d=s.setState;s.setState=(g,y)=>(d(g,y),u());const f=n((...g)=>(t(...g),u()),r,s);s.getInitialState=()=>f;let h;const m=()=>{var g,y;if(!c)return;i=!1,l.forEach(b=>{var v;return b((v=r())!=null?v:f)});const x=((y=o.onRehydrateStorage)==null?void 0:y.call(o,(g=r())!=null?g:f))||void 0;return xi(c.getItem.bind(c))(o.name).then(b=>{if(b)if(typeof b.version=="number"&&b.version!==o.version){if(o.migrate){const v=o.migrate(b.state,b.version);return v instanceof Promise?v.then(C=>[!0,C]):[!0,v]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,b.state];return[!1,void 0]}).then(b=>{var v;const[C,k]=b;if(h=o.merge(k,(v=r())!=null?v:f),t(h,!0),C)return u()}).then(()=>{x?.(h,void 0),h=r(),i=!0,a.forEach(b=>b(h))}).catch(b=>{x?.(void 0,b)})};return s.persist={setOptions:g=>{o={...o,...g},g.storage&&(c=g.storage)},clearStorage:()=>{c?.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>i,onHydrate:g=>(l.add(g),()=>{l.delete(g)}),onFinishHydration:g=>(a.add(g),()=>{a.delete(g)})},o.skipHydration||m(),h||f},Au=Ig,{useSyncExternalStoreWithSelector:jg}=dp,Rg=n=>n;function Dg(n,e=Rg,t){const r=jg(n.subscribe,n.getState,n.getInitialState,e,t);return Q.useDebugValue(r),r}const xa=n=>Symbol.iterator in n,ba=n=>"entries"in n,ka=(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},Pg=(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 Lg(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:xa(n)&&xa(e)?ba(n)&&ba(e)?ka(n,e):Pg(n,e):ka({entries:()=>Object.entries(n)},{entries:()=>Object.entries(e)})}function $g(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{aw as It,r as N,c as P,d as jn,j as p,g as Us,av as Yi,x as ip,y as ru,v as lp,w as jo,i as ap,b as cp,t as up,F as Q,Q as dp,ax as Ro,ay as su,al as fp,ak as hp,az as pp,H as Xi,a5 as ou,a8 as mp,B as Rn,E as Ve,a2 as Qi,a9 as gp,z as Ks,a6 as yp,a1 as Zi,af as xp,ag as bp,ah as kp,aA as el,aB as vp,a7 as iu,a4 as wp,aC as Sp,L as Cp,aD as Np,aE as Ep}from"./index-CqA7I8ME.js";import{U as dt,f as tl,d as Js,c as jt,b as nl,I as Gs,u as Tp,n as Mp}from"./use-connection-CRNsw_EM.js";import{d as Op,C as dn,e as Ap,I as Ip,l as ca,G as lu,M as jp,m as Rp,R as ua,k as Dp}from"./resizable-1LBVjTrf.js";import{E as kr,i as Pp}from"./SearchMd-DDy8E2Sf.js";import{E as lr}from"./error-boundary-BlfwOQWs.js";import{P as Ys}from"./formatDistanceToNow-7bwQqEEJ.js";import{u as Lp,L as $p}from"./localstorage-keys-DECG1iSi.js";import{u as _p,a as We,c as qe,b as Ue,T as Ke,i as rl}from"./tooltip-BGO9FrAb.js";import{B as ce,c as X}from"./button-Cu7Gpj_2.js";import{F as lt,a as au,b as Rt,c as vr,d as Dn}from"./form-C9aG8a9_.js";import{I as Pn}from"./input-DHGUS5vj.js";import{T as Qr,D as zp,a as Bp,b as Fp,f as Vp,c as Hp,d as Wp}from"./dialog-CC7Romxu.js";import{A as qp,D as Up,u as Kp}from"./use-binding-BSrLFa69.js";import{i as Gt}from"./Loading01-DdJTgVpp.js";import{s as sl}from"./Plus-DF_8yoMD.js";import{i as Jp}from"./Upload01-BY1Megy0.js";import{b as Cn,a as ol,V as Xs}from"./layout-zE8Dp2X0.js";import{i as Gp}from"./AlertCircle-CAH7G7Fc.js";import{s as Yp}from"./Clock-BYv8XFdU.js";import{a as Xp}from"./Copy01-DZzyV7nE.js";import{i as il,J as Qp}from"./json-syntax-highlighter-Dykx_AFd.js";import{s as ll,i as cu}from"./XClose-BQyXK7EC.js";import{u as Zp,O as em,M as tm,F as nm,v as rm,E as sm}from"./index-BEpExDaW.js";import{u as al}from"./use-mcp-C6M7GJsU.js";import{S as Ln}from"./spinner-CyJuCfoJ.js";import{V as om}from"./view-mode-toggle-CwRfmI4H.js";import{i as im}from"./GitBranch01-iTqlzLTs.js";import{a as uu,b as lm}from"./use-tool-call-hxvro7CP.js";import"./index-BC4DFDP4.js";import{n as am}from"./Calendar-Ba37VUfB.js";import{b as cm,D as um,a as dm,d as da,i as fm}from"./dropdown-menu-De2MFXzP.js";import{B as fn}from"./badge-B1dobCRY.js";import{i as du}from"./X-EkD3fVWA.js";import"./CpuChip02-SXr5nJdo.js";import"./select-Dg5JPxAc.js";import"./ChevronDown-BtaAznAf.js";import"./use-mobile-DWX_zGvO.js";import"./use-gateway-BDLgsIti.js";import"./Terminal-CyVXhceX.js";import"./connection-card-CjOjxUED.js";import"./card-BMKHMTDj.js";import"./LinkExternal01-CQv3krcN.js";import"./File06-NpiRHtR-.js";import"./InfoCircle-D6Oa5jFj.js";import"./use-organization-settings-BjHeWH30.js";import"./useQuery-DYX0Erl2.js";import"./auth-CPnNaHvV.js";import"./ArrowLeft-DYJU0sRd.js";import"./mcp-oauth-tlLalwei.js";import"./env-vars-editor-DKJqlIK-.js";import"./Trash01-3l-2SGXg.js";import"./Key01-BYLHyZyj.js";import"./extract-connection-data-D7ePP-S9.js";import"./registry-utils-ulDDT0d8.js";import"./generate-id-Dyweu44Y.js";import"./index-rXoeRhPD.js";const fu=It("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 hu=It("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 hm=It("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const pm=It("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 pu=It("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 mu=It("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 gu=It("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 yu=It("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"}]]),cl=({size:n=24,color:e="currentColor",...t})=>N.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},N.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"}));cl.displayName="AlertOctagon";const xu=({size:n=24,color:e="currentColor",...t})=>N.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},N.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"}));xu.displayName="Box";const bu=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"m22.7 11.5-2 2-2-2m2.245 1.5A9 9 0 1 0 19 17.657M12 7v5l3 2"}));bu.displayName="ClockFastForward";const ku=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"m16 18 6-6-6-6M8 6l-6 6 6 6"}));ku.displayName="Code01";const vu=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"m17 17 5-5-5-5M7 7l-5 5 5 5m7-14-4 18"}));vu.displayName="Code02";const wu=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"M12 17a5 5 0 1 0 10 0 5 5 0 0 0-10 0Zm0 0c0-1.126.372-2.165 1-3V5m-1 12c0 .825.2 1.604.554 2.29-.842.712-2.788 1.21-5.054 1.21-3.038 0-5.5-.895-5.5-2V5m11 0c0 1.105-2.462 2-5.5 2S2 6.105 2 5m11 0c0-1.105-2.462-2-5.5-2S2 3.895 2 5m0 9c0 1.105 2.462 2 5.5 2 2.189 0 4.08-.465 4.965-1.138M13 9.5c0 1.105-2.462 2-5.5 2S2 10.605 2 9.5"}));wu.displayName="CoinsStacked01";const qr=({size:n=24,color:e="currentColor",...t})=>N.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},N.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"}));qr.displayName="Columns01";const Su=({size:n=24,color:e="currentColor",...t})=>N.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},N.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"}));Su.displayName="CornerDownRight";const Cu=({size:n=24,color:e="currentColor",...t})=>N.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},N.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"}));Cu.displayName="Database01";const Nu=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"M11 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 6.28 2 7.12 2 8.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 22 5.12 22 6.8 22h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C20 19.72 20 18.88 20 17.2V13M8 16h1.675c.489 0 .733 0 .963-.055.204-.05.4-.13.579-.24.201-.123.374-.296.72-.642L21.5 5.5a2.121 2.121 0 0 0-3-3l-9.563 9.563c-.346.346-.519.519-.642.72a2 2 0 0 0-.24.579c-.055.23-.055.474-.055.963V16Z"}));Nu.displayName="Edit05";const Qs=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"M3 9h13.5a4.5 4.5 0 1 1 0 9H12M3 9l4-4M3 9l4 4"}));Qs.displayName="FlipBackward";const Eu=({size:n=24,color:e="currentColor",...t})=>N.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},N.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"}));Eu.displayName="Repeat03";const Zs=({size:n=24,color:e="currentColor",...t})=>N.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},N.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"}));Zs.displayName="Save02";const Tu=({size:n=24,color:e="currentColor",...t})=>N.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},N.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"}));Tu.displayName="Tool01";const eo=({size:n=24,color:e="currentColor",...t})=>N.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},N.createElement("path",{d:"M16 3.468a4.5 4.5 0 0 1 0 8.064m2 5.234c1.512.684 2.872 1.799 4 3.234M2 20c1.946-2.477 4.59-4 7.5-4s5.553 1.523 7.5 4M14 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));eo.displayName="Users02";const{getOwnPropertyNames:mm,getOwnPropertySymbols:gm}=Object,{hasOwnProperty:ym}=Object.prototype;function Do(n,e){return function(r,s,o){return n(r,s,o)&&e(r,s,o)}}function Ar(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 xm(n){return n?.[Symbol.toStringTag]}function fa(n){return mm(n).concat(gm(n))}const bm=Object.hasOwn||((n,e)=>ym.call(n,e));function tn(n,e){return n===e||!n&&!e&&n!==n&&e!==e}const km="__v",vm="__o",wm="_owner",{getOwnPropertyDescriptor:ha,keys:pa}=Object;function Sm(n,e){return n.byteLength===e.byteLength&&Zr(new Uint8Array(n),new Uint8Array(e))}function Cm(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 Nm(n,e){return n.byteLength===e.byteLength&&Zr(new Uint8Array(n.buffer,n.byteOffset,n.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function Em(n,e){return tn(n.getTime(),e.getTime())}function Tm(n,e){return n.name===e.name&&n.message===e.message&&n.cause===e.cause&&n.stack===e.stack}function Mm(n,e){return n===e}function ma(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 u=!1,d=0;for(;(l=c.next())&&!l.done;){if(s[d]){d++;continue}const f=i.value,h=l.value;if(t.equals(f[0],h[0],a,d,n,e,t)&&t.equals(f[1],h[1],f[0],h[0],n,e,t)){u=s[d]=!0;break}d++}if(!u)return!1;a++}return!0}const Om=tn;function Am(n,e,t){const r=pa(n);let s=r.length;if(pa(e).length!==s)return!1;for(;s-- >0;)if(!Mu(n,e,t,r[s]))return!1;return!0}function Vn(n,e,t){const r=fa(n);let s=r.length;if(fa(e).length!==s)return!1;let o,i,l;for(;s-- >0;)if(o=r[s],!Mu(n,e,t,o)||(i=ha(n,o),l=ha(e,o),(i||l)&&(!i||!l||i.configurable!==l.configurable||i.enumerable!==l.enumerable||i.writable!==l.writable)))return!1;return!0}function Im(n,e){return tn(n.valueOf(),e.valueOf())}function jm(n,e){return n.source===e.source&&n.flags===e.flags}function ga(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,u=0;for(;(l=a.next())&&!l.done;){if(!s[u]&&t.equals(i.value,l.value,i.value,l.value,n,e,t)){c=s[u]=!0;break}u++}if(!c)return!1}return!0}function Zr(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 Rm(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 Mu(n,e,t,r){return(r===wm||r===vm||r===km)&&(n.$$typeof||e.$$typeof)?!0:bm(e,r)&&t.equals(n[r],e[r],r,r,n,e,t)}const Dm="[object ArrayBuffer]",Pm="[object Arguments]",Lm="[object Boolean]",$m="[object DataView]",_m="[object Date]",zm="[object Error]",Bm="[object Map]",Fm="[object Number]",Vm="[object Object]",Hm="[object RegExp]",Wm="[object Set]",qm="[object String]",Um={"[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},Km="[object URL]",Jm=Object.prototype.toString;function Gm({areArrayBuffersEqual:n,areArraysEqual:e,areDataViewsEqual:t,areDatesEqual:r,areErrorsEqual:s,areFunctionsEqual:o,areMapsEqual:i,areNumbersEqual:l,areObjectsEqual:a,arePrimitiveWrappersEqual:c,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:h,unknownTagComparators:m}){return function(y,x,b){if(y===x)return!0;if(y==null||x==null)return!1;const v=typeof y;if(v!==typeof x)return!1;if(v!=="object")return v==="number"?l(y,x,b):v==="function"?o(y,x,b):!1;const C=y.constructor;if(C!==x.constructor)return!1;if(C===Object)return a(y,x,b);if(Array.isArray(y))return e(y,x,b);if(C===Date)return r(y,x,b);if(C===RegExp)return u(y,x,b);if(C===Map)return i(y,x,b);if(C===Set)return d(y,x,b);const k=Jm.call(y);if(k===_m)return r(y,x,b);if(k===Hm)return u(y,x,b);if(k===Bm)return i(y,x,b);if(k===Wm)return d(y,x,b);if(k===Vm)return typeof y.then!="function"&&typeof x.then!="function"&&a(y,x,b);if(k===Km)return h(y,x,b);if(k===zm)return s(y,x,b);if(k===Pm)return a(y,x,b);if(Um[k])return f(y,x,b);if(k===Dm)return n(y,x,b);if(k===$m)return t(y,x,b);if(k===Lm||k===Fm||k===qm)return c(y,x,b);if(m){let w=m[k];if(!w){const S=xm(y);S&&(w=m[S])}if(w)return w(y,x,b)}return!1}}function Ym({circular:n,createCustomConfig:e,strict:t}){let r={areArrayBuffersEqual:Sm,areArraysEqual:t?Vn:Cm,areDataViewsEqual:Nm,areDatesEqual:Em,areErrorsEqual:Tm,areFunctionsEqual:Mm,areMapsEqual:t?Do(ma,Vn):ma,areNumbersEqual:Om,areObjectsEqual:t?Vn:Am,arePrimitiveWrappersEqual:Im,areRegExpsEqual:jm,areSetsEqual:t?Do(ga,Vn):ga,areTypedArraysEqual:t?Do(Zr,Vn):Zr,areUrlsEqual:Rm,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),n){const s=Ar(r.areArraysEqual),o=Ar(r.areMapsEqual),i=Ar(r.areObjectsEqual),l=Ar(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:s,areMapsEqual:o,areObjectsEqual:i,areSetsEqual:l})}return r}function Xm(n){return function(e,t,r,s,o,i,l){return n(e,t,l)}}function Qm({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:u}=t();return e(l,a,{cache:c,equals:r,meta:u,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 Zm=Dt();Dt({strict:!0});Dt({circular:!0});Dt({circular:!0,strict:!0});Dt({createInternalComparator:()=>tn});Dt({strict:!0,createInternalComparator:()=>tn});Dt({circular:!0,createInternalComparator:()=>tn});Dt({circular:!0,createInternalComparator:()=>tn,strict:!0});function Dt(n={}){const{circular:e=!1,createInternalComparator:t,createState:r,strict:s=!1}=n,o=Ym(n),i=Gm(o),l=t?t(i):Xm(i);return Qm({circular:e,comparator:i,createState:r,equals:l,strict:s})}function eg(n){const e=P.c(3),{gatewayId:t,onSelect:r}=n,{data:s}=Ap(t);if(s.length===0)return null;let o;return e[0]!==r||e[1]!==s?(o=p.jsx(Ip,{prompts:s,onSelect:r,className:"mt-6"}),e[0]=r,e[1]=s,e[2]=o):o=e[2],o}function tg(n){const e=P.c(20),{form:t}=n;let r;e[0]!==t?(r=d=>{const{field:f}=d;return p.jsx(cg,{size:"md",value:f.value,onChange:f.onChange,alt:t.watch("title")})},e[0]=t,e[1]=r):r=e[1];let s;e[2]!==t.control||e[3]!==r?(s=p.jsx(lt,{control:t.control,name:"avatar",render:r}),e[2]=t.control,e[3]=r,e[4]=s):s=e[4];let o;e[5]!==t.control?(o=p.jsxs("div",{className:"flex flex-col gap-3 flex-1 min-w-0",children:[p.jsx(lt,{control:t.control,name:"title",render:ig}),p.jsx(lt,{control:t.control,name:"description",render:og})]}),e[5]=t.control,e[6]=o):o=e[6];let i;e[7]!==s||e[8]!==o?(i=p.jsxs("div",{className:"flex gap-4 items-start",children:[s,o]}),e[7]=s,e[8]=o,e[9]=i):i=e[9];let l,a;e[10]!==t.control?(l=p.jsxs("div",{className:"flex gap-4",children:[p.jsx(lt,{control:t.control,name:"gateway_id",render:sg}),p.jsx(lt,{control:t.control,name:"model",render:rg})]}),a=p.jsx(lt,{control:t.control,name:"system_prompt",render:ng}),e[10]=t.control,e[11]=l,e[12]=a):(l=e[11],a=e[12]);let c;e[13]!==i||e[14]!==l||e[15]!==a?(c=p.jsxs("div",{className:"h-full py-6 flex flex-col max-w-2xl mx-auto w-full min-w-0 gap-6 overflow-y-auto",children:[i,l,a]}),e[13]=i,e[14]=l,e[15]=a,e[16]=c):c=e[16];let u;return e[17]!==t||e[18]!==c?(u=p.jsx(au,{...t,children:c}),e[17]=t,e[18]=c,e[19]=u):u=e[19],u}function ng(n){const{field:e}=n;return p.jsxs(Rt,{className:"flex-1 flex flex-col min-h-0",children:[p.jsx(vr,{className:"text-xs text-muted-foreground",children:"System prompt"}),p.jsx(Dn,{children:p.jsx(Qr,{...e,placeholder:"You are a helpful assistant...",className:"flex-1 min-h-[200px] 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 rg(n){const{field:e}=n;return p.jsxs(Rt,{className:"flex-1",children:[p.jsx(vr,{className:"text-xs text-muted-foreground",children:"Model"}),p.jsx(jp,{selectedModel:e.value?{id:e.value.id,connectionId:e.value.connectionId}:void 0,onModelChange:t=>e.onChange({id:t.id,connectionId:t.connectionId}),placeholder:"Select model",variant:"bordered",className:"w-full"})]})}function sg(n){const{field:e}=n;return p.jsxs(Rt,{className:"flex-1",children:[p.jsx(vr,{className:"text-xs text-muted-foreground",children:"Gateway"}),p.jsx(lu,{selectedGatewayId:e.value,onGatewayChange:e.onChange,placeholder:"Select gateway",variant:"bordered",className:"w-full"})]})}function og(n){const{field:e}=n;return p.jsxs(Rt,{children:[p.jsx(vr,{className:"text-xs text-muted-foreground",children:"Description"}),p.jsx(Dn,{children:p.jsx(Pn,{...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 ig(n){const{field:e}=n;return p.jsxs(Rt,{children:[p.jsx(vr,{className:"text-xs text-muted-foreground",children:"Name"}),p.jsx(Dn,{children:p.jsx(Pn,{...e,placeholder:"Untitled assistant",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function lg(n){const e=P.c(62),{activeThreadId:t,mode:r,assistant:s,form:o}=n;let i;e[0]!==t||e[1]!==s.system_prompt?(i={threadId:t,systemPrompt:s.system_prompt},e[0]=t,e[1]=s.system_prompt,e[2]=i):i=e[2];const l=Op(i),a=!!s.gateway_id&&!!s.model?.id&&!!s.model?.connectionId;let c;e[3]!==t||e[4]!==s.gateway_id||e[5]!==s.model||e[6]!==l||e[7]!==a?(c=async H=>{if(!a)return;const K={created_at:new Date().toISOString(),thread_id:t,model:{id:s.model.id,connectionId:s.model.connectionId},gateway:{id:s.gateway_id??""},user:{name:"you"}};await l.sendMessage(H,K)},e[3]=t,e[4]=s.gateway_id,e[5]=s.model,e[6]=l,e[7]=a,e[8]=c):c=e[8];const u=c;let d;e[9]!==s.avatar||e[10]!==s.title?(d=s.avatar?p.jsx("div",{className:"size-[60px] rounded-[18px] border border-border shrink-0 overflow-hidden",children:p.jsx("img",{src:s.avatar,alt:s.title,className:"h-full w-full object-cover"})}):p.jsx("div",{className:"size-[60px] rounded-[18px] border border-border shrink-0 overflow-hidden bg-muted/20 flex items-center justify-center",children:p.jsx(eo,{size:28,className:"text-muted-foreground"})}),e[9]=s.avatar,e[10]=s.title,e[11]=d):d=e[11];let f;e[12]!==s.title?(f=p.jsx("h3",{className:"text-xl font-medium text-foreground",children:s.title}),e[12]=s.title,e[13]=f):f=e[13];let h;e[14]!==s.description?(h=s.description?p.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:s.description}):null,e[14]=s.description,e[15]=h):h=e[15];let m;e[16]!==d||e[17]!==f||e[18]!==h?(m=p.jsxs("div",{className:"flex flex-col items-center gap-4",children:[d,f,h]}),e[16]=d,e[17]=f,e[18]=h,e[19]=m):m=e[19];let g;e[20]!==s.gateway_id||e[21]!==u?(g=s.gateway_id&&p.jsx(lr,{fallback:null,children:p.jsx(N.Suspense,{fallback:p.jsx("div",{className:"flex justify-center mt-6",children:p.jsx(Gt,{size:20,className:"animate-spin text-muted-foreground"})}),children:p.jsx(eg,{gatewayId:s.gateway_id,onSelect:H=>{u(H.description??H.name)}})})}),e[20]=s.gateway_id,e[21]=u,e[22]=g):g=e[22];let y;e[23]!==m||e[24]!==g?(y=p.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-4 text-center",children:[m,g]}),e[23]=m,e[24]=g,e[25]=y):y=e[25];const x=y;let b;e[26]!==l.messages?(b=l.messages.filter(ag),e[26]=l.messages,e[27]=b):b=e[27];const v=b,C=r==="edit",k=C?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none";let w;e[28]!==k?(w=X("absolute inset-0 px-2 transition-opacity duration-200 ease-out",k),e[28]=k,e[29]=w):w=e[29];let S;e[30]!==o?(S=p.jsx(tg,{form:o}),e[30]=o,e[31]=S):S=e[31];let M;e[32]!==w||e[33]!==S?(M=p.jsx("div",{className:w,children:S}),e[32]=w,e[33]=S,e[34]=M):M=e[34];const T=C?"opacity-0 pointer-events-none":"opacity-100";let E;e[35]!==T?(E=X("h-full transition-opacity duration-200 ease-out",T),e[35]=T,e[36]=E):E=e[36];let R;e[37]!==l.messages||e[38]!==l.status||e[39]!==x||e[40]!==v.length?(R=v.length===0?p.jsx(dn.EmptyState,{children:x}):p.jsx(dn.Messages,{messages:l.messages,status:l.status,minHeightOffset:240}),e[37]=l.messages,e[38]=l.status,e[39]=x,e[40]=v.length,e[41]=R):R=e[41];let D;e[42]!==E||e[43]!==R?(D=p.jsx("div",{className:E,children:R}),e[42]=E,e[43]=R,e[44]=D):D=e[44];let B;e[45]!==M||e[46]!==D?(B=p.jsxs(dn.Main,{className:"h-full relative overflow-hidden",children:[M,D]}),e[45]=M,e[46]=D,e[47]=B):B=e[47];const _=C?"translate-y-full":"translate-y-0";let O;e[48]!==_?(O=X("transition-transform duration-300 ease-out",_),e[48]=_,e[49]=O):O=e[49];const A=!a,L=l.status==="submitted"||l.status==="streaming";let z;e[50]!==l.messages||e[51]!==l.stop||e[52]!==u||e[53]!==A||e[54]!==L?(z=p.jsx(dn.Footer,{children:p.jsx("div",{className:"max-w-2xl mx-auto w-full min-w-0",children:p.jsx(dn.Input,{onSubmit:u,onStop:l.stop,disabled:A,isStreaming:L,placeholder:"Ask anything or @ for context",usageMessages:l.messages})})}),e[50]=l.messages,e[51]=l.stop,e[52]=u,e[53]=A,e[54]=L,e[55]=z):z=e[55];let U;e[56]!==O||e[57]!==z?(U=p.jsx("div",{className:O,children:z}),e[56]=O,e[57]=z,e[58]=U):U=e[58];let W;return e[59]!==B||e[60]!==U?(W=p.jsxs(dn,{children:[B,U]}),e[59]=B,e[60]=U,e[61]=W):W=e[61],W}function ag(n){return n.role!=="system"}function cg(n){const e=P.c(18),{value:t,onChange:r,alt:s,size:o}=n,i=o===void 0?"md":o,l=N.useRef(null),a=i==="xs"?"h-6 w-6":i==="sm"?"h-8 w-8":"h-16 w-16",c=i==="xs"?"h-3 w-3":i==="sm"?"h-4 w-4":"h-6 w-6",u=i==="xs"?"h-3 w-3":i==="sm"?"h-3.5 w-3.5":"h-5 w-5";let d;e[0]!==r?(d=w=>{const S=w.target.files?.[0];if(!S)return;const M=new FileReader;M.onloadend=()=>{const T=M.result;r(T)},M.readAsDataURL(S)},e[0]=r,e[1]=d):d=e[1];const f=d;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{l.current?.click()},e[2]=h):h=e[2];const m=h,g=`relative ${a} shrink-0 cursor-pointer group`;let y;e[3]!==f?(y=p.jsx("input",{type:"file",ref:l,className:"hidden",accept:"image/*",onChange:f}),e[3]=f,e[4]=y):y=e[4];let x;e[5]!==s||e[6]!==c||e[7]!==t?(x=t?p.jsx("img",{src:t,alt:s||"Avatar",className:"w-full h-full object-cover"}):p.jsx("div",{className:"w-full h-full flex items-center justify-center text-muted-foreground",children:p.jsx(eo,{className:c})}),e[5]=s,e[6]=c,e[7]=t,e[8]=x):x=e[8];const b=`${u} text-white`;let v;e[9]!==b?(v=p.jsx("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center rounded-xl",children:p.jsx(Jp,{className:b})}),e[9]=b,e[10]=v):v=e[10];let C;e[11]!==x||e[12]!==v?(C=p.jsxs("div",{className:"h-full w-full rounded-xl border border-border bg-muted/20 overflow-hidden relative",children:[x,v]}),e[11]=x,e[12]=v,e[13]=C):C=e[13];let k;return e[14]!==g||e[15]!==y||e[16]!==C?(k=p.jsxs("div",{className:g,onClick:m,children:[y,C]}),e[14]=g,e[15]=y,e[16]=C,e[17]=k):k=e[17],k}function ug(n){const e=P.c(56),{providerId:t,assistantId:r,onBack:s}=n,i=Us().location.href,l=Yi();let a;e[0]!==s||e[1]!==l?(a=s??(()=>l.history.back()),e[0]=s,e[1]=l,e[2]=a):a=e[2];const c=a,{locator:u}=_p();let d;e[3]!==r||e[4]!==u?(d=$p.assistantChatActiveThread(u,r),e[3]=r,e[4]=u,e[5]=d):d=e[5];const[f,h]=Lp(d,dg),m=t||dt;let g;e[6]!==m?(g=jt(m),e[6]=m,e[7]=g):g=e[7];const y=g,x=tl(t,"ASSISTANT",r,y),b=Js(t,"ASSISTANT",y),v=b.update.isPending,[C,k]=N.useState(x?.model.id&&x?.gateway_id?"chat":"edit");let w;e[8]===Symbol.for("react.memo_cache_sentinel")?(w=ip(qp),e[8]=w):w=e[8];const S=x??void 0;let M;e[9]!==S?(M={resolver:w,values:S},e[9]=S,e[10]=M):M=e[10];const T=ru(M);let E;e[11]!==b.update||e[12]!==r||e[13]!==T?(E=T.handleSubmit(async Y=>{const te=await b.update.mutateAsync({id:r,data:Y});T.reset(te),k("chat")}),e[11]=b.update,e[12]=r,e[13]=T,e[14]=E):E=e[14];const R=E;if(!x){let Y;e[15]===Symbol.for("react.memo_cache_sentinel")?(Y=p.jsx(ca,{}),e[15]=Y):Y=e[15];let te;e[16]===Symbol.for("react.memo_cache_sentinel")?(te=p.jsx("div",{className:"flex h-full w-full bg-background",children:p.jsx(kr,{title:"Assistant not found",description:"This assistant may have been deleted or you may not have access to it."})}),e[16]=te):te=e[16];let fe;return e[17]!==c?(fe=p.jsx(lr,{children:p.jsx(N.Suspense,{fallback:Y,children:p.jsx(Cn,{onBack:c,children:te})})}),e[17]=c,e[18]=fe):fe=e[18],fe}let D;e[19]===Symbol.for("react.memo_cache_sentinel")?(D=p.jsx(ca,{}),e[19]=D):D=e[19];let B;e[20]!==x.avatar||e[21]!==x.title?(B=p.jsx("div",{className:"h-6 w-6 min-w-6 rounded-lg border border-border bg-muted/20 overflow-hidden shrink-0",children:x.avatar?p.jsx("img",{src:x.avatar,alt:x.title,className:"h-full w-full object-cover"}):p.jsx("div",{className:"h-full w-full flex items-center justify-center text-muted-foreground",children:p.jsx(eo,{size:12,className:"text-muted-foreground"})})}),e[20]=x.avatar,e[21]=x.title,e[22]=B):B=e[22];let _;e[23]!==x.title?(_=p.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:x.title}),e[23]=x.title,e[24]=_):_=e[24];let O;e[25]!==x.description?(O=x.description?p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),p.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:x.description})]}):null,e[25]=x.description,e[26]=O):O=e[26];let A;e[27]!==_||e[28]!==O?(A=p.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[_,O]}),e[27]=_,e[28]=O,e[29]=A):A=e[29];let L;e[30]!==B||e[31]!==A?(L=p.jsx(ol,{children:p.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[B,A]})}),e[30]=B,e[31]=A,e[32]=L):L=e[32];const z=x.avatar??"assistant";let U;e[33]!==x.title||e[34]!==z||e[35]!==i?(U=p.jsx(Ys,{title:x.title,url:i,icon:z}),e[33]=x.title,e[34]=z,e[35]=i,e[36]=U):U=e[36];let W;e[37]!==T.formState.isDirty||e[38]!==v||e[39]!==C||e[40]!==R||e[41]!==h?(W=C==="chat"?p.jsxs(p.Fragment,{children:[p.jsx(We,{children:p.jsxs(qe,{children:[p.jsx(Ue,{asChild:!0,children:p.jsx(ce,{type:"button",onClick:()=>h(crypto.randomUUID()),"aria-label":"New thread",variant:"outline",size:"icon",className:"size-7 border border-input",children:p.jsx(sl,{size:16})})}),p.jsx(Ke,{children:"New thread"})]})}),p.jsx(We,{children:p.jsxs(qe,{children:[p.jsx(Ue,{asChild:!0,children:p.jsx(ce,{type:"button",onClick:()=>k("edit"),"aria-label":"Edit",variant:"outline",size:"icon",className:"size-7 border border-input",children:p.jsx(Nu,{size:16})})}),p.jsx(Ke,{children:"Edit"})]})})]}):p.jsxs(p.Fragment,{children:[p.jsx(We,{children:p.jsxs(qe,{delayDuration:0,children:[p.jsx(Ue,{asChild:!0,children:p.jsx("span",{className:"inline-block",children:p.jsx(ce,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:v,onClick:()=>k("chat"),"aria-label":"Cancel",children:p.jsx(Qs,{size:14})})})}),p.jsx(Ke,{side:"bottom",children:"Cancel"})]})}),p.jsx(We,{children:p.jsxs(qe,{delayDuration:0,children:[p.jsx(Ue,{asChild:!0,children:p.jsx("span",{className:"inline-block",children:p.jsx(ce,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:!T.formState.isDirty||v,onClick:()=>{R()},"aria-label":"Save",children:v?p.jsx(Gt,{size:14,className:"animate-spin"}):p.jsx(Zs,{size:14})})})}),p.jsx(Ke,{side:"bottom",children:"Save"})]})})]}),e[37]=T.formState.isDirty,e[38]=v,e[39]=C,e[40]=R,e[41]=h,e[42]=W):W=e[42];let H;e[43]!==U||e[44]!==W?(H=p.jsxs(Xs,{children:[U,W]}),e[43]=U,e[44]=W,e[45]=H):H=e[45];let K;e[46]!==f||e[47]!==x||e[48]!==T||e[49]!==C?(K=p.jsx("div",{className:"h-full",children:p.jsx(lg,{activeThreadId:f,mode:C,assistant:x,form:T},T.formState.submitCount)}),e[46]=f,e[47]=x,e[48]=T,e[49]=C,e[50]=K):K=e[50];let Z;return e[51]!==c||e[52]!==L||e[53]!==H||e[54]!==K?(Z=p.jsx(lr,{children:p.jsx(N.Suspense,{fallback:D,children:p.jsxs(Cn,{onBack:c,children:[L,H,K]})})}),e[51]=c,e[52]=L,e[53]=H,e[54]=K,e[55]=Z):Z=e[55],Z}function dg(n){return n||crypto.randomUUID()}function fg(n){const e=P.c(6),{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=jn(s).connectionId??dt;if(!i||i===dt){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=p.jsx("div",{className:"flex h-full w-full bg-background",children:p.jsx(kr,{title:"Assistant not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let l;return e[2]!==i||e[3]!==t||e[4]!==r?(l=p.jsx(ug,{providerId:i,assistantId:t,onBack:r}),e[2]=i,e[3]=t,e[4]=r,e[5]=l):l=e[5],l}lp({title:jo().min(1),description:jo().nullable(),body:jo()});function Po(n){for(const e of n.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function hg(){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 pg(n){const e=P.c(13),{form:t}=n;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=p.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=r):r=e[0];let s;e[1]!==t.control?(s=p.jsxs("div",{className:"flex flex-col gap-4",children:[r,p.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[p.jsx(lt,{control:t.control,name:"title",render:yg}),p.jsx(lt,{control:t.control,name:"description",render:gg})]})]}),e[1]=t.control,e[2]=s):s=e[2];let o,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=p.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),i=p.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=p.jsxs("div",{className:"flex flex-col gap-2",children:[o,i,p.jsx(lt,{control:t.control,name:"body",render:mg})]}),e[5]=t.control,e[6]=l):l=e[6];let a;e[7]!==s||e[8]!==l?(a=p.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=p.jsx(au,{...t,children:a}),e[10]=t,e[11]=a,e[12]=c):c=e[12],c}function mg(n){const{field:e}=n;return p.jsx(Rt,{children:p.jsx(Dn,{children:p.jsx(Qr,{...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 gg(n){const{field:e}=n;return p.jsxs(Rt,{children:[p.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),p.jsx(Dn,{children:p.jsx(Pn,{...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 yg(n){const{field:e}=n;return p.jsxs(Rt,{children:[p.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),p.jsx(Dn,{children:p.jsx(Pn,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function xg(n){const e=P.c(51),{providerId:t,promptId:r,onBack:s}=n,i=Us().location.href,l=t||dt;let a;e[0]!==l?(a=jt(l),e[0]=l,e[1]=a):a=e[1];const c=a,u=tl(t,"PROMPT",r,c),d=Js(t,"PROMPT",c),f=d.update.isPending;let h;e[2]!==u?(h=u?{title:u.title,description:u.description??null,body:Po(u)}:void 0,e[2]=u,e[3]=h):h=e[3];let m;e[4]!==h?(m={values:h},e[4]=h,e[5]=m):m=e[5];const g=ru(m);let y;e[6]!==g||e[7]!==u?(y=()=>{u&&g.reset({title:u.title,description:u.description??null,body:Po(u)})},e[6]=g,e[7]=u,e[8]=y):y=e[8];const x=y;let b;e[9]!==d.update||e[10]!==g||e[11]!==r?(b=g.handleSubmit(async K=>{const Z=await d.update.mutateAsync({id:r,data:{title:K.title,description:K.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:K.body}}]}});g.reset({title:Z.title,description:Z.description??null,body:Po(Z)})}),e[9]=d.update,e[10]=g,e[11]=r,e[12]=b):b=e[12];const v=b;if(!u){let K;return e[13]===Symbol.for("react.memo_cache_sentinel")?(K=p.jsx("div",{className:"flex h-full w-full bg-background",children:p.jsx(kr,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[13]=K):K=e[13],K}let C;e[14]!==u.title?(C=p.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:u.title}),e[14]=u.title,e[15]=C):C=e[15];let k;e[16]!==u.description?(k=u.description?p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),p.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:u.description})]}):null,e[16]=u.description,e[17]=k):k=e[17];let w;e[18]!==C||e[19]!==k?(w=p.jsx(ol,{children:p.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[C,k]})}),e[18]=C,e[19]=k,e[20]=w):w=e[20];let S;e[21]!==u.title||e[22]!==i?(S=p.jsx(Ys,{title:u.title,url:i,icon:"description"}),e[21]=u.title,e[22]=i,e[23]=S):S=e[23];const M=!g.formState.isDirty||f;let T;e[24]===Symbol.for("react.memo_cache_sentinel")?(T=p.jsx(Qs,{size:14}),e[24]=T):T=e[24];let E;e[25]!==x||e[26]!==M?(E=p.jsx(Ue,{asChild:!0,children:p.jsx("span",{className:"inline-block",children:p.jsx(ce,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:M,onClick:x,"aria-label":"Cancel",children:T})})}),e[25]=x,e[26]=M,e[27]=E):E=e[27];let R;e[28]===Symbol.for("react.memo_cache_sentinel")?(R=p.jsx(Ke,{side:"bottom",children:"Cancel"}),e[28]=R):R=e[28];let D;e[29]!==E?(D=p.jsx(We,{children:p.jsxs(qe,{delayDuration:0,children:[E,R]})}),e[29]=E,e[30]=D):D=e[30];const B=!g.formState.isDirty||f;let _;e[31]!==v?(_=()=>{v()},e[31]=v,e[32]=_):_=e[32];let O;e[33]===Symbol.for("react.memo_cache_sentinel")?(O=p.jsx(Zs,{size:14}),e[33]=O):O=e[33];let A;e[34]!==B||e[35]!==_?(A=p.jsx(Ue,{asChild:!0,children:p.jsx("span",{className:"inline-block",children:p.jsx(ce,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:B,onClick:_,"aria-label":"Save",children:O})})}),e[34]=B,e[35]=_,e[36]=A):A=e[36];let L;e[37]===Symbol.for("react.memo_cache_sentinel")?(L=p.jsx(Ke,{side:"bottom",children:"Save"}),e[37]=L):L=e[37];let z;e[38]!==A?(z=p.jsx(We,{children:p.jsxs(qe,{delayDuration:0,children:[A,L]})}),e[38]=A,e[39]=z):z=e[39];let U;e[40]!==S||e[41]!==D||e[42]!==z?(U=p.jsxs(Xs,{children:[S,D,z]}),e[40]=S,e[41]=D,e[42]=z,e[43]=U):U=e[43];let W;e[44]!==g?(W=p.jsx("div",{className:"h-full",children:p.jsx(pg,{form:g})}),e[44]=g,e[45]=W):W=e[45];let H;return e[46]!==s||e[47]!==U||e[48]!==W||e[49]!==w?(H=p.jsxs(Cn,{onBack:s,children:[w,U,W]}),e[46]=s,e[47]=U,e[48]=W,e[49]=w,e[50]=H):H=e[50],H}function bg(n){const e=P.c(5),{itemId:t,onBack:r}=n;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=hg()??dt,e[0]=s):s=e[0];const o=s;if(!o||o===dt){let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=p.jsx("div",{className:"flex h-full w-full bg-background",children:p.jsx(kr,{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=p.jsx(lr,{children:p.jsx(N.Suspense,{fallback:null,children:p.jsx(xg,{providerId:o,promptId:t,onBack:r})})}),e[2]=t,e[3]=r,e[4]=i):i=e[4],i}const kg=ap("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 vg(n){const e=P.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=X(kg({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=p.jsx("div",{"data-slot":"alert",role:"alert",className:o,...r}),e[7]=r,e[8]=o,e[9]=i):i=e[9],i}function wg(n){const e=P.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=X("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=p.jsx("div",{"data-slot":"alert-title",className:s,...r}),e[5]=r,e[6]=s,e[7]=o):o=e[7],o}function Sg(n){const e=P.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=X("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=p.jsx("div",{"data-slot":"alert-description",className:s,...r}),e[5]=r,e[6]=s,e[7]=o):o=e[7],o}const Cg=n=>n.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ng(n){const e=P.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=Zp(a);if(!c.isAuthenticated){let f;return e[4]!==c.supportsOAuth||e[5]!==s?(f=p.jsx("div",{className:"flex h-full items-center justify-center",children:c.supportsOAuth?p.jsx(em,{onAuthenticate:()=>s(),buttonText:"Go back to authenticate"}):p.jsx(tm,{hasReadme:!1})}),e[4]=c.supportsOAuth,e[5]=s,e[6]=f):f=e[6],f}const u=`${r}:${t}`;let d;return e[7]!==r||e[8]!==l||e[9]!==s||e[10]!==u||e[11]!==t?(d=p.jsx(Eg,{toolName:t,connectionId:r,mcpProxyUrl:l,onBack:s},u),e[7]=r,e[8]=l,e[9]=s,e[10]=u,e[11]=t,e[12]=d):d=e[12],d}function Eg({toolName:n,connectionId:e,mcpProxyUrl:t,onBack:r}){const o=Us().location.href,{replayId:i}=cp({strict:!1}),l=(()=>{if(!i)return null;const A=`replay-${i}`,L=sessionStorage.getItem(A);if(!L)return null;sessionStorage.removeItem(A);try{return JSON.parse(L)}catch{return null}})(),a=(()=>{if(!l)return null;const A={};for(const[L,z]of Object.entries(l))z!==null&&typeof z=="object"?A[L]=JSON.stringify(z,null,2):A[L]=z;return A})(),[c,u]=N.useState(a??{}),[d,f]=N.useState(l?JSON.stringify(l,null,2):"{}"),[h,m]=N.useState(null),[g,y]=N.useState(null),[x,b]=N.useState(!1),[v,C]=N.useState(null),k=nl(e),w=al({url:t.href});N.useEffect(()=>{w.error&&console.error("MCP Error:",w.error)},[w.error]);const S=w.tools?.find(A=>A.name===n),M=S?.inputSchema?.properties,T=M?Object.keys(M):[],E=T.length>0,R={};if(E&&S?.inputSchema?.properties)for(const A of T)R[A]=S.inputSchema.required?.includes(A)?"":void 0;const D=A=>Object.prototype.hasOwnProperty.call(c,A),B=async()=>{b(!0),y(null),m(null),C(null);const A=performance.now(),L=jt(e);try{const z=E?{...R,...c}:(()=>{const Y=d.trim();if(!Y)return{};const te=JSON.parse(Y);if(te&&typeof te=="object")return te;throw new Error("Raw JSON input must be an object.")})();E&&S?.inputSchema?.properties&&Object.entries(S.inputSchema.properties).forEach(([Y,te])=>{if((te.type==="object"||te.type==="array")&&typeof z[Y]=="string")try{z[Y]=JSON.parse(z[Y])}catch{}});const U=await L(n,z),W=performance.now(),H=Math.round(W-A);m(U);const K=JSON.stringify(U),Z=new TextEncoder().encode(K).length;C({duration:`${H}ms`,bytes:`${Z} bytes`,tokens:`~${Math.ceil(Z/4)} tokens`,cost:"$0.0000"})}catch(z){const U=z instanceof Error?z.message:String(z);y(U||"Unknown error occurred");const W=performance.now();C({duration:`${Math.round(W-A)}ms`})}finally{b(!1)}},_=(A,L)=>{u(z=>({...z,[A]:L}))},O=()=>{m(null),y(null),C(null)};return p.jsxs(Cn,{onBack:r,children:[p.jsx(Xs,{children:p.jsx(Ys,{title:S?.name??Cg(n),url:o,icon:"build"})}),p.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 h-full",children:[p.jsx("div",{className:"flex flex-col border-r border-border overflow-hidden",children:p.jsxs("div",{className:"flex-1 overflow-auto",children:[p.jsx("div",{className:"flex flex-col gap-4 p-6 border-b border-border min-h-28",children:p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(Gs,{icon:k?.icon||null,name:k?.title||n,size:"sm",className:"shadow-sm shrink-0"}),p.jsx("h1",{className:"text-lg font-medium text-foreground leading-none",children:n}),p.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit",children:[w.state==="ready"?p.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):w.state==="connecting"?p.jsx(Gt,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):p.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),p.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:w.state.replace("_"," ")})]})]}),p.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:S?.description||"No description available"})]})}),p.jsxs("div",{className:"flex flex-col p-6 gap-4",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),S?.inputSchema?.required&&S.inputSchema.required.length>0&&p.jsxs("span",{className:"text-xs text-muted-foreground",children:[p.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),p.jsx("div",{className:"space-y-4",children:E&&S?.inputSchema?.properties?Object.entries(S.inputSchema.properties).map(([A,L])=>p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[A,S.inputSchema?.required?.includes(A)&&p.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),p.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:L.type})]}),L.description&&p.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:L.description}),L.type==="object"||L.type==="array"?p.jsx(Qr,{className:"font-mono text-xs",value:D(A)?c[A]??"":R[A]??"",onChange:z=>_(A,z.target.value),placeholder:`Enter ${A} as JSON...`,rows:3}):p.jsx(Pn,{value:D(A)?c[A]??"":R[A]??"",onChange:z=>_(A,z.target.value),placeholder:`Enter ${A}...`})]},A)):S?.inputSchema&&!E?p.jsxs("div",{className:"space-y-2",children:[p.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),p.jsx(Qr,{className:"font-mono text-xs min-h-[120px]",value:d,onChange:A=>f(A.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):p.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:p.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})})]})]})}),p.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[p.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:[p.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),v&&p.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(Yp,{className:"h-3 w-3 text-muted-foreground"}),p.jsx("span",{className:"font-mono text-foreground",children:v.duration})]}),v.tokens&&p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(xu,{className:"h-3 w-3 text-muted-foreground"}),p.jsx("span",{className:"font-mono text-foreground",children:v.tokens})]}),v.bytes&&p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(Cu,{className:"h-3 w-3 text-muted-foreground"}),p.jsx("span",{className:"font-mono text-foreground",children:v.bytes})]}),v.cost&&p.jsx("div",{className:"flex items-center gap-1.5",children:p.jsx("span",{className:"font-mono text-foreground",children:v.cost})})]})]}),p.jsx("div",{className:"flex items-center justify-end lg:justify-between px-4 h-14 border-b border-border bg-background",children:p.jsxs("div",{className:"flex items-center gap-2 w-full lg:w-auto",children:[p.jsx(ce,{size:"sm",variant:"default",className:"h-8 gap-2 flex-1 lg:flex-none",onClick:B,disabled:x,children:x?p.jsxs(p.Fragment,{children:[p.jsx(Gt,{size:14,className:"animate-spin"}),"Executing..."]}):p.jsxs(p.Fragment,{children:[p.jsx(il,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})}),p.jsx(We,{children:p.jsxs(qe,{children:[p.jsx(Ue,{asChild:!0,children:p.jsx(ce,{size:"icon",variant:"outline",className:"h-8 w-8 shrink-0",onClick:O,disabled:!h&&!g,children:p.jsx(ll,{size:14})})}),p.jsx(Ke,{children:p.jsx("p",{children:"Clear results"})})]})})]})}),g&&p.jsx("div",{className:"px-6 py-4 bg-background",children:p.jsx(vg,{variant:"destructive",children:p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Gp,{className:"h-4 w-4"}),p.jsx(wg,{className:"mb-0",children:"Execution Failed"})]}),p.jsx(Sg,{className:"text-xs text-destructive",children:g})]})})}),p.jsx("div",{className:"relative flex-1 overflow-auto bg-muted/50",children:h?p.jsxs(p.Fragment,{children:[p.jsx(Qp,{jsonString:JSON.stringify(h,null,2),padding:"1.5rem"}),p.jsx(ce,{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)),up.success("Copied to clipboard")},children:p.jsx(Xp,{className:"h-3.5 w-3.5"})})]}):p.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[p.jsx(ku,{className:"h-12 w-12 mb-3 opacity-40"}),p.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]})]})]})}function Tg(n){const e=P.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=jn(s).connectionId??dt;if(!nl(i)){let u;return e[1]===Symbol.for("react.memo_cache_sentinel")?(u=p.jsx("div",{className:"flex h-full items-center justify-center",children:p.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[p.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),p.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[1]=u):u=e[1],u}let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=p.jsx("div",{className:"flex h-full items-center justify-center",children:p.jsx(Gt,{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=p.jsx(N.Suspense,{fallback:a,children:p.jsx(Ng,{toolName:t,connectionId:i,onBack:r})}),e[3]=i,e[4]=r,e[5]=t,e[6]=c):c=e[6],c}const ya=n=>{let e;const t=new Set,r=(c,u)=>{const d=typeof c=="function"?c(e):c;if(!Object.is(d,e)){const f=e;e=u??(typeof d!="object"||d===null)?d:Object.assign({},e,d),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},ul=(n=>n?ya(n):ya),Mg=n=>n;function yi(n,e=Mg){const t=Q.useSyncExternalStore(n.subscribe,Q.useCallback(()=>e(n.getState()),[n,e]),Q.useCallback(()=>e(n.getInitialState()),[n,e]));return Q.useDebugValue(t),t}const Og=n=>{const e=ul(n),t=r=>yi(e,r);return Object.assign(t,e),t},Ag=(n=>Og);function Ou(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 xi=n=>e=>{try{const t=n(e);return t instanceof Promise?t:{then(r){return xi(r)(t)},catch(r){return this}}}catch(t){return{then(r){return this},catch(r){return xi(r)(t)}}}},Ig=(n,e)=>(t,r,s)=>{let o={storage:Ou(()=>localStorage),partialize:g=>g,version:0,merge:(g,y)=>({...y,...g}),...e},i=!1;const l=new Set,a=new Set;let c=o.storage;if(!c)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 c.setItem(o.name,{state:g,version:o.version})},d=s.setState;s.setState=(g,y)=>(d(g,y),u());const f=n((...g)=>(t(...g),u()),r,s);s.getInitialState=()=>f;let h;const m=()=>{var g,y;if(!c)return;i=!1,l.forEach(b=>{var v;return b((v=r())!=null?v:f)});const x=((y=o.onRehydrateStorage)==null?void 0:y.call(o,(g=r())!=null?g:f))||void 0;return xi(c.getItem.bind(c))(o.name).then(b=>{if(b)if(typeof b.version=="number"&&b.version!==o.version){if(o.migrate){const v=o.migrate(b.state,b.version);return v instanceof Promise?v.then(C=>[!0,C]):[!0,v]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,b.state];return[!1,void 0]}).then(b=>{var v;const[C,k]=b;if(h=o.merge(k,(v=r())!=null?v:f),t(h,!0),C)return u()}).then(()=>{x?.(h,void 0),h=r(),i=!0,a.forEach(b=>b(h))}).catch(b=>{x?.(void 0,b)})};return s.persist={setOptions:g=>{o={...o,...g},g.storage&&(c=g.storage)},clearStorage:()=>{c?.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>i,onHydrate:g=>(l.add(g),()=>{l.delete(g)}),onFinishHydration:g=>(a.add(g),()=>{a.delete(g)})},o.skipHydration||m(),h||f},Au=Ig,{useSyncExternalStoreWithSelector:jg}=dp,Rg=n=>n;function Dg(n,e=Rg,t){const r=jg(n.subscribe,n.getState,n.getInitialState,e,t);return Q.useDebugValue(r),r}const xa=n=>Symbol.iterator in n,ba=n=>"entries"in n,ka=(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},Pg=(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 Lg(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:xa(n)&&xa(e)?ba(n)&&ba(e)?ka(n,e):Pg(n,e):ka({entries:()=>Object.entries(n)},{entries:()=>Object.entries(e)})}function $g(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,u])=>{const d=l.has(c)?"":"?";return`${u.description?` /** ${u.description} */
3
3
  `:""} ${c}${d}: ${t(u)};`}).join(`
4
4
  `)}
@@ -1 +1 @@
1
- import{r as n,c as N,j as s}from"./index-Ce0bVa0I.js";import{c as C,B as y}from"./button-RGWd1X_P.js";import{d as M,j as z,D as E,c as D,b as S,a as T}from"./dropdown-menu-Dz-Cfe4c.js";import{i as L,a as V,c as B,b as _,T as W}from"./tooltip-B77piVwL.js";import{V as $}from"./view-mode-toggle-BGpxvqYI.js";const w=({size:t=24,color:e="currentColor",...r})=>n.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},n.createElement("path",{d:"M12 5v14m0 0 7-7m-7 7-7-7"}));w.displayName="ArrowDown";const k=({size:t=24,color:e="currentColor",...r})=>n.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},n.createElement("path",{d:"M21 12H9m12-6H9m12 12H9m-4-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0 12a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"}));k.displayName="List";const b=({size:t=24,color:e="currentColor",...r})=>n.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},n.createElement("path",{d:"M5 21v-7m0-4V3m7 18v-9m0-4V3m7 18v-5m0-4V3M2 14h6m1-6h6m1 8h6"}));b.displayName="Sliders01";function I(t){const e=N.c(16),{viewMode:r,onViewModeChange:g,sortKey:v,sortDirection:a,onSort:l,sortOptions:c}=t;let d;e[0]!==c?(d=c===void 0?[]:c,e[0]=c,e[1]=d):d=e[1];const m=d;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(V,{children:s.jsxs(B,{children:[s.jsx(_,{asChild:!0,children:s.jsx(E,{asChild:!0,children:s.jsx(y,{variant:"outline",size:"icon",className:"size-7 border border-input",children:s.jsx(b,{size:16})})})}),s.jsx(W,{children:"Search filters"})]})}),e[2]=h):h=e[2];let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p={value:"table",icon:s.jsx(k,{})},e[3]=p):p=e[3];let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=[p,{value:"cards",icon:s.jsx(D,{})}],e[4]=x):x=e[4];let o;e[5]!==g||e[6]!==r?(o=s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx($,{value:r,onValueChange:g,fullWidth:!0,options:x})}),e[5]=g,e[6]=r,e[7]=o):o=e[7];let i;e[8]!==l||e[9]!==a||e[10]!==v||e[11]!==m?(i=m.length>0&&l&&s.jsxs("div",{className:"p-2",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"}),m.map(f=>{const j=v===f.id;return s.jsx(M,{onClick:()=>l(f.id),className:C("h-8 px-2 py-0 cursor-pointer",j&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[j&&s.jsx(L,{size:16,className:"text-foreground shrink-0"}),!j&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:f.label}),j&&a&&(a==="asc"?s.jsx(z,{size:16,className:"text-foreground shrink-0"}):s.jsx(w,{size:16,className:"text-foreground shrink-0"}))]})},f.id)})]}),e[8]=l,e[9]=a,e[10]=v,e[11]=m,e[12]=i):i=e[12];let u;return e[13]!==o||e[14]!==i?(u=s.jsxs(S,{children:[h,s.jsxs(T,{align:"end",className:"w-[200px] p-0 gap-0",children:[o,i]})]}),e[13]=o,e[14]=i,e[15]=u):u=e[15],u}export{I as C,w as n};
1
+ import{r as n,c as N,j as s}from"./index-CqA7I8ME.js";import{c as C,B as y}from"./button-Cu7Gpj_2.js";import{d as M,j as z,D as E,c as D,b as S,a as T}from"./dropdown-menu-De2MFXzP.js";import{i as L,a as V,c as B,b as _,T as W}from"./tooltip-BGO9FrAb.js";import{V as $}from"./view-mode-toggle-CwRfmI4H.js";const w=({size:t=24,color:e="currentColor",...r})=>n.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},n.createElement("path",{d:"M12 5v14m0 0 7-7m-7 7-7-7"}));w.displayName="ArrowDown";const k=({size:t=24,color:e="currentColor",...r})=>n.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},n.createElement("path",{d:"M21 12H9m12-6H9m12 12H9m-4-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0 12a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"}));k.displayName="List";const b=({size:t=24,color:e="currentColor",...r})=>n.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},n.createElement("path",{d:"M5 21v-7m0-4V3m7 18v-9m0-4V3m7 18v-5m0-4V3M2 14h6m1-6h6m1 8h6"}));b.displayName="Sliders01";function I(t){const e=N.c(16),{viewMode:r,onViewModeChange:g,sortKey:v,sortDirection:a,onSort:l,sortOptions:c}=t;let d;e[0]!==c?(d=c===void 0?[]:c,e[0]=c,e[1]=d):d=e[1];const m=d;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(V,{children:s.jsxs(B,{children:[s.jsx(_,{asChild:!0,children:s.jsx(E,{asChild:!0,children:s.jsx(y,{variant:"outline",size:"icon",className:"size-7 border border-input",children:s.jsx(b,{size:16})})})}),s.jsx(W,{children:"Search filters"})]})}),e[2]=h):h=e[2];let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p={value:"table",icon:s.jsx(k,{})},e[3]=p):p=e[3];let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=[p,{value:"cards",icon:s.jsx(D,{})}],e[4]=x):x=e[4];let o;e[5]!==g||e[6]!==r?(o=s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx($,{value:r,onValueChange:g,fullWidth:!0,options:x})}),e[5]=g,e[6]=r,e[7]=o):o=e[7];let i;e[8]!==l||e[9]!==a||e[10]!==v||e[11]!==m?(i=m.length>0&&l&&s.jsxs("div",{className:"p-2",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"}),m.map(f=>{const j=v===f.id;return s.jsx(M,{onClick:()=>l(f.id),className:C("h-8 px-2 py-0 cursor-pointer",j&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[j&&s.jsx(L,{size:16,className:"text-foreground shrink-0"}),!j&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:f.label}),j&&a&&(a==="asc"?s.jsx(z,{size:16,className:"text-foreground shrink-0"}):s.jsx(w,{size:16,className:"text-foreground shrink-0"}))]})},f.id)})]}),e[8]=l,e[9]=a,e[10]=v,e[11]=m,e[12]=i):i=e[12];let u;return e[13]!==o||e[14]!==i?(u=s.jsxs(S,{children:[h,s.jsxs(T,{align:"end",className:"w-[200px] p-0 gap-0",children:[o,i]})]}),e[13]=o,e[14]=i,e[15]=u):u=e[15],u}export{I as C,w as n};
@@ -1 +1 @@
1
- import{c as j,j as i}from"./index-Ce0bVa0I.js";import{C as b}from"./collection-display-button-s3SUZ2ky.js";function g(h){const e=j.c(17),{title:d,viewMode:r,onViewModeChange:l,sortKey:m,sortDirection:f,onSort:x,sortOptions:n,ctaButton:p}=h;let c;e[0]!==n?(c=n===void 0?[]:n,e[0]=n,e[1]=c):c=e[1];const u=c;let t;e[2]!==d?(t=i.jsx("h1",{className:"text-sm font-medium text-foreground",children:d}),e[2]=d,e[3]=t):t=e[3];let s;e[4]!==x||e[5]!==l||e[6]!==f||e[7]!==m||e[8]!==u||e[9]!==r?(s=r&&l&&i.jsx(b,{viewMode:r,onViewModeChange:l,sortKey:m,sortDirection:f,onSort:x,sortOptions:u}),e[4]=x,e[5]=l,e[6]=f,e[7]=m,e[8]=u,e[9]=r,e[10]=s):s=e[10];let o;e[11]!==p||e[12]!==s?(o=i.jsxs("div",{className:"flex items-center gap-2",children:[s,p]}),e[11]=p,e[12]=s,e[13]=o):o=e[13];let a;return e[14]!==t||e[15]!==o?(a=i.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:i.jsxs("div",{className:"flex items-center justify-between gap-3 h-12 px-4",children:[t,o]})}),e[14]=t,e[15]=o,e[16]=a):a=e[16],a}export{g as C};
1
+ import{c as j,j as i}from"./index-CqA7I8ME.js";import{C as b}from"./collection-display-button-CfJOFOy4.js";function g(h){const e=j.c(17),{title:d,viewMode:r,onViewModeChange:l,sortKey:m,sortDirection:f,onSort:x,sortOptions:n,ctaButton:p}=h;let c;e[0]!==n?(c=n===void 0?[]:n,e[0]=n,e[1]=c):c=e[1];const u=c;let t;e[2]!==d?(t=i.jsx("h1",{className:"text-sm font-medium text-foreground",children:d}),e[2]=d,e[3]=t):t=e[3];let s;e[4]!==x||e[5]!==l||e[6]!==f||e[7]!==m||e[8]!==u||e[9]!==r?(s=r&&l&&i.jsx(b,{viewMode:r,onViewModeChange:l,sortKey:m,sortDirection:f,onSort:x,sortOptions:u}),e[4]=x,e[5]=l,e[6]=f,e[7]=m,e[8]=u,e[9]=r,e[10]=s):s=e[10];let o;e[11]!==p||e[12]!==s?(o=i.jsxs("div",{className:"flex items-center gap-2",children:[s,p]}),e[11]=p,e[12]=s,e[13]=o):o=e[13];let a;return e[14]!==t||e[15]!==o?(a=i.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:i.jsxs("div",{className:"flex items-center justify-between gap-3 h-12 px-4",children:[t,o]})}),e[14]=t,e[15]=o,e[16]=a):a=e[16],a}export{g as C};
@@ -1 +1 @@
1
- import{c as s,j as c}from"./index-Ce0bVa0I.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-CqA7I8ME.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 x,j as a}from"./index-Ce0bVa0I.js";import{i as u}from"./SearchMd-C_x78fQD.js";import{I as b}from"./input-Cc7Y8Lsj.js";import{c as g}from"./button-RGWd1X_P.js";function w(h){const e=x.c(13),{value:n,onChange:c,placeholder:d,onKeyDown:i,className:m}=h,f=d===void 0?"Search...":d;let t;e[0]!==m?(t=g("shrink-0 w-full border-b border-border h-12",m),e[0]=m,e[1]=t):t=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(u,{size:16,className:"text-muted-foreground shrink-0"}),e[2]=o):o=e[2];let r;e[3]!==c?(r=p=>c(p.target.value),e[3]=c,e[4]=r):r=e[4];let s;e[5]!==i||e[6]!==f||e[7]!==r||e[8]!==n?(s=a.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 cursor-text",children:[o,a.jsx(b,{value:n,onChange:r,onKeyDown:i,placeholder:f,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[5]=i,e[6]=f,e[7]=r,e[8]=n,e[9]=s):s=e[9];let l;return e[10]!==t||e[11]!==s?(l=a.jsx("div",{className:t,children:s}),e[10]=t,e[11]=s,e[12]=l):l=e[12],l}export{w as C};
1
+ import{c as x,j as a}from"./index-CqA7I8ME.js";import{i as u}from"./SearchMd-DDy8E2Sf.js";import{I as b}from"./input-DHGUS5vj.js";import{c as g}from"./button-Cu7Gpj_2.js";function w(h){const e=x.c(13),{value:n,onChange:c,placeholder:d,onKeyDown:i,className:m}=h,f=d===void 0?"Search...":d;let t;e[0]!==m?(t=g("shrink-0 w-full border-b border-border h-12",m),e[0]=m,e[1]=t):t=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(u,{size:16,className:"text-muted-foreground shrink-0"}),e[2]=o):o=e[2];let r;e[3]!==c?(r=p=>c(p.target.value),e[3]=c,e[4]=r):r=e[4];let s;e[5]!==i||e[6]!==f||e[7]!==r||e[8]!==n?(s=a.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 cursor-text",children:[o,a.jsx(b,{value:n,onChange:r,onKeyDown:i,placeholder:f,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[5]=i,e[6]=f,e[7]=r,e[8]=n,e[9]=s):s=e[9];let l;return e[10]!==t||e[11]!==s?(l=a.jsx("div",{className:t,children:s}),e[10]=t,e[11]=s,e[12]=l):l=e[12],l}export{w as C};
@@ -1 +1 @@
1
- import{c as g,j as o}from"./index-Ce0bVa0I.js";import{c as u}from"./button-RGWd1X_P.js";import{n as T}from"./collection-display-button-s3SUZ2ky.js";import{j as $}from"./dropdown-menu-Dz-Cfe4c.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-CqA7I8ME.js";import{c as u}from"./button-Cu7Gpj_2.js";import{n as T}from"./collection-display-button-CfJOFOy4.js";import{j as $}from"./dropdown-menu-De2MFXzP.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 +1 @@
1
- import{c as S,j as s}from"./index-Ce0bVa0I.js";import{C as _}from"./card-Bch45nKF.js";import{c as j}from"./button-RGWd1X_P.js";import{I as A}from"./use-connection-CcfriG4b.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-CqA7I8ME.js";import{C as _}from"./card-BMKHMTDj.js";import{c as j}from"./button-Cu7Gpj_2.js";import{I as A}from"./use-connection-CRNsw_EM.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{r as U,c as W,j as s,g as Ce,f as Fe,a as pt,t as ht,d as xt,b as gt,av as jt}from"./index-Ce0bVa0I.js";import{E as H}from"./SearchMd-C_x78fQD.js";import{E as tt}from"./error-boundary-IlI5HY5C.js";import{I as ve,b as Ne,d as bt,e as yt,c as Ct,a as vt}from"./use-connection-CcfriG4b.js";import{b as Nt}from"./use-binding-DOHpn0td.js";import{E as Qe,u as St,S as wt}from"./index-RUqw7d0T.js";import{u as Tt,a as $t}from"./use-connection-resources-C-ecJARs.js";import{B as Se}from"./button-RGWd1X_P.js";import{i as st}from"./Loading01-CZ--C9o4.js";import{R as _t}from"./resource-tabs-Bp2LCK5n.js";import{V as Be,a as It,b as Dt}from"./layout-k5sx-zLk.js";import{g as Xe}from"./generate-id-Dyweu44Y.js";import{C as we}from"./collection-display-button-s3SUZ2ky.js";import{C as Ue}from"./collection-search-B_ze9BPw.js";import{C as We}from"./card-Bch45nKF.js";import{b as ot,D as nt,a as it,d as G}from"./dropdown-menu-Dz-Cfe4c.js";import{a as rt}from"./Copy01-DmZIDbuC.js";import{i as lt}from"./DotsVertical-CugHspqx.js";import{s as ct,u as At}from"./use-list-state-Bcpc0dEc.js";import{s as at}from"./Trash01-kv9nDzIp.js";import{C as qe}from"./collection-table-wrapper-yPDs4QFo.js";import{n as Ye}from"./Inbox01-x47sKUjp.js";import{P as Ge}from"./formatDistanceToNow-BgvVIEk6.js";import{B as Pt}from"./extract-connection-data-3bWrIOWG.js";import{A as kt,g as Lt,c as Mt,b as Rt,d as Et,e as Ot,a as zt,f as Vt}from"./alert-dialog-DLlk9oGk.js";import{s as Kt}from"./Plus-B87V-eUk.js";import{R as Ft,T as Bt}from"./tools-list-6PdjsEP-.js";import"./tooltip-B77piVwL.js";import"./auth-O7mzDtBv.js";import"./mcp-oauth-BrdcIayH.js";import"./env-vars-editor-B-ADXMkg.js";import"./input-Cc7Y8Lsj.js";import"./use-tool-call-CI1nZAFC.js";import"./useQuery-CF3kr9sY.js";import"./File06-B9Csx588.js";import"./Key01-BemiGYAL.js";import"./form-C0miQmjx.js";import"./select-B-74Vw7Q.js";import"./ChevronDown-7kPeUreU.js";import"./Terminal-Bp8rdp_p.js";import"./use-gateway-CCphplYZ.js";import"./CpuChip02-CvUOZekE.js";import"./registry-utils-ulDDT0d8.js";import"./index-KVbZU2bI.js";import"./index-CbrmpR2c.js";import"./badge-CzGd9Js-.js";import"./ArrowLeft-CBi8stO3.js";import"./view-mode-toggle-BGpxvqYI.js";import"./use-mobile-DYo2aQNt.js";import"./use-organization-settings-uQsDNKHC.js";const He=({size:t=24,color:e="currentColor",...o})=>U.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},U.createElement("path",{d:"M2.876 18.116c.046-.414.069-.62.131-.814a2 2 0 0 1 .234-.485c.111-.17.259-.317.553-.61L17 3a2.828 2.828 0 1 1 4 4L7.794 20.206c-.294.294-.442.442-.611.553a2 2 0 0 1-.485.233c-.193.063-.4.086-.814.132L2.5 21.5l.376-3.384Z"}));He.displayName="Edit01";function Ut(t,e){const o=t.properties||{};for(const n in o){const c=o[n];if(c&&c.type==="string"&&(c.format==="url"||c.format==="uri")&&e&&typeof e=="object"&&n in e&&e[n])return e[n]}const i=["image","img","avatar","icon","logo","thumbnail","cover"];for(const n of i)if(e&&typeof e=="object"&&n in e&&typeof e[n]=="string")return e[n]}function Wt(t){const e=W.c(25),{item:o,schema:i,actions:n}=t;let c;e[0]!==o||e[1]!==i?(c=Ut(i,o),e[0]=o,e[1]=i,e[2]=c):c=e[2];const d=c,u=o&&typeof o=="object"&&"description"in o&&typeof o.description=="string"?o.description:void 0;let g;e[3]!==n?(g=n&&Object.keys(n).length>0,e[3]=n,e[4]=g):g=e[4];const r=g;let p;e[5]!==d||e[6]!==o.title?(p=s.jsx(ve,{icon:d,name:o.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=d,e[6]=o.title,e[7]=p):p=e[7];let S;e[8]!==o.title?(S=s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:o.title}),e[8]=o.title,e[9]=S):S=e[9];const m=u||"No description";let C;e[10]!==m?(C=s.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:m}),e[10]=m,e[11]=C):C=e[11];let j;e[12]!==S||e[13]!==C?(j=s.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[S,C]}),e[12]=S,e[13]=C,e[14]=j):j=e[14];let v;e[15]!==p||e[16]!==j?(v=s.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[p,j]}),e[15]=p,e[16]=j,e[17]=v):v=e[17];let a;e[18]!==n||e[19]!==r||e[20]!==o?(a=r&&s.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:Jt,onMouseDown:Ht,children:s.jsxs(ot,{children:[s.jsx(nt,{asChild:!0,children:s.jsx(Se,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Gt,children:s.jsx(lt,{size:20})})}),s.jsxs(it,{align:"end",onClick:qt,children:[n.open&&s.jsxs(G,{onClick:l=>{l.stopPropagation(),n.open?.(o)},children:[s.jsx(ct,{size:16}),"Open"]}),n.edit&&s.jsxs(G,{onClick:l=>{l.stopPropagation(),n.edit?.(o)},children:[s.jsx(He,{size:16}),"Edit"]}),n.duplicate&&s.jsxs(G,{onClick:l=>{l.stopPropagation(),n.duplicate?.(o)},children:[s.jsx(rt,{size:16}),"Duplicate"]}),n.delete&&s.jsxs(G,{variant:"destructive",onClick:l=>{l.stopPropagation(),n.delete?.(o)},children:[s.jsx(at,{size:16}),"Delete"]})]})]})}),e[18]=n,e[19]=r,e[20]=o,e[21]=a):a=e[21];let T;return e[22]!==v||e[23]!==a?(T=s.jsxs(We,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[v,a]}),e[22]=v,e[23]=a,e[24]=T):T=e[24],T}function qt(t){return t.stopPropagation()}function Gt(t){return t.stopPropagation()}function Ht(t){return t.stopPropagation()}function Jt(t){return t.stopPropagation()}const Zt=["icon","avatar","logo"],et=["created_at","created_by","id"];function Qt(t){return Object.keys(t).find(e=>Zt.includes(e.toLowerCase()))}function dt(t,e){return Object.keys(t.properties||{}).filter(o=>["id","created_at","updated_at","created_by","updated_by"].includes(o)?!1:e?e.includes(o):!0).map(o=>({id:o,label:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," ")}))}function Xt(t){const e=W.c(32),{data:o,schema:i,viewMode:n,onViewModeChange:c,search:d,sortKey:u,sortDirection:g,onSort:r,actions:p,onItemClick:S,headerActions:m,emptyState:C,readOnly:j,columns:v,hideToolbar:a,sortableFields:T}=t,l=c===void 0?os:c,y=g===void 0?"asc":g,$=r===void 0?ss:r;let f;e[0]!==p?(f=p===void 0?{}:p,e[0]=p,e[1]=f):f=e[1];const L=f,b=S===void 0?ts:S,_=m===void 0?null:m,I=C===void 0?null:C,O=j===void 0?!1:j,w=v===void 0?void 0:v,h=a===void 0?!1:a,R=T===void 0?void 0:T;let M;e[2]!==w||e[3]!==i||e[4]!==R?(M=w?w.filter(es).filter(A=>!R||R.includes(A.id)).map(Yt):dt(i,R),e[2]=w,e[3]=i,e[4]=R,e[5]=M):M=e[5];const z=M;let E;e[6]!==_||e[7]!==h||e[8]!==$||e[9]!==l||e[10]!==y||e[11]!==u||e[12]!==z||e[13]!==n?(E=!h&&s.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:s.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[s.jsx("div",{className:"flex items-center gap-2 flex-1",children:_}),s.jsx("div",{className:"flex items-center gap-2 shrink-0",children:s.jsx(we,{viewMode:n,onViewModeChange:l,sortKey:u,sortDirection:y,onSort:$,sortOptions:z})})]})}),e[6]=_,e[7]=h,e[8]=$,e[9]=l,e[10]=y,e[11]=u,e[12]=z,e[13]=n,e[14]=E):E=e[14];let N;e[15]!==L||e[16]!==w||e[17]!==o||e[18]!==I||e[19]!==b||e[20]!==$||e[21]!==O||e[22]!==i||e[23]!==d||e[24]!==y||e[25]!==u||e[26]!==R||e[27]!==n?(N=n==="cards"?s.jsx("div",{className:"flex-1 overflow-auto p-5",children:o.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:I||s.jsx(Qe,{icon:s.jsx(Ye,{size:36,className:"text-muted-foreground"}),title:"No items found",description:d?"Try adjusting your search":"No items to display"})}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:o.map(A=>s.jsx("div",{onClick:()=>b?.(A),className:"cursor-pointer h-full",children:s.jsx(Wt,{item:A,schema:i,readOnly:O,actions:L})},A.id))})}):s.jsx(qe,{columns:rs(w,i,R,L),data:o,sortKey:u,sortDirection:y,onSort:$,onRowClick:b,emptyState:I||s.jsx(Qe,{icon:s.jsx(Ye,{size:36,className:"text-muted-foreground"}),title:"No items found",description:d?"Try adjusting your search":"No items to display"})}),e[15]=L,e[16]=w,e[17]=o,e[18]=I,e[19]=b,e[20]=$,e[21]=O,e[22]=i,e[23]=d,e[24]=y,e[25]=u,e[26]=R,e[27]=n,e[28]=N):N=e[28];let D;return e[29]!==E||e[30]!==N?(D=s.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[E,N]}),e[29]=E,e[30]=N,e[31]=D):D=e[31],D}function Yt(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function es(t){return t.sortable!==!1}function ts(){}function ss(){}function os(){}function ns(t){return{id:"actions",header:"",render:e=>s.jsxs(ot,{children:[s.jsx(nt,{asChild:!0,children:s.jsx(Se,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:s.jsx(lt,{size:20})})}),s.jsxs(it,{align:"end",onClick:o=>o.stopPropagation(),children:[t.open&&s.jsxs(G,{onClick:o=>{o.stopPropagation(),t.open?.(e)},children:[s.jsx(ct,{size:16}),"Open"]}),t.edit&&s.jsxs(G,{onClick:o=>{o.stopPropagation(),t.edit?.(e)},children:[s.jsx(He,{size:16}),"Edit"]}),t.duplicate&&s.jsxs(G,{onClick:o=>{o.stopPropagation(),t.duplicate?.(e)},children:[s.jsx(rt,{size:16}),"Duplicate"]}),t.delete&&s.jsxs(G,{variant:"destructive",onClick:o=>{o.stopPropagation(),t.delete?.(e)},children:[s.jsx(at,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function mt(t){const e=t.type;return Array.isArray(e)?e.every(o=>mt({type:o})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function is(t,e){const o=t.properties||{},i=Object.keys(o).filter(r=>{const p=o[r];return p&&mt(p)}),n=Qt(o),c=[],d=new Set;n&&i.includes(n)&&(c.push(n),d.add(n));const u=["title","description","updated_at","updated_by"];for(const r of u)i.includes(r)&&!d.has(r)&&(c.push(r),d.add(r));const g=i.filter(r=>!d.has(r)&&!et.includes(r)).sort((r,p)=>r.localeCompare(p));for(const r of g)c.push(r),d.add(r);for(const r of et)i.includes(r)&&!d.has(r)&&(c.push(r),d.add(r));return c.map(r=>{const p=o[r],S=e?e.includes(r):!["id"].includes(r);return r===n?{id:r,header:"",render:m=>{const C=m[r];return s.jsx(ve,{icon:C,name:m.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:r==="description"?{id:r,header:"Description",render:m=>{const C=m[r];return C==null?"—":s.jsx("span",{className:"block truncate max-w-[50ch]",children:String(C)})},sortable:S,cellClassName:"max-w-[50ch]"}:p?.format==="date-time"||r.endsWith("_at")?{id:r,header:r.charAt(0).toUpperCase()+r.slice(1).replace(/_/g," "),render:m=>{const C=m[r];return C?s.jsx("span",{className:"block truncate max-w-full",children:new Date(C).toLocaleDateString()}):"—"},sortable:S,cellClassName:"max-w-[200px]"}:{id:r,header:r.charAt(0).toUpperCase()+r.slice(1).replace(/_/g," "),render:m=>{const C=m[r];return C==null?"—":s.jsx("span",{className:"block truncate max-w-full",children:String(C)})},sortable:S,cellClassName:"max-w-[200px]"}})}function rs(t,e,o,i){const n=t||is(e,o);return n.some(u=>u.id==="actions")?n:Object.keys(i).length>0?[...n,ns(i)]:n}function ls(t){const e=W.c(117),{connectionId:o,org:i,activeCollection:n}=t,c=n.name,d=n.schema??Pt,u=n.hasCreateTool,g=n.hasUpdateTool,r=n.hasDeleteTool,p=Ce(),m=Fe().location.href,{data:C}=pt.useSession(),j=C?.user?.id||"unknown",v=Ne(o);let a;e[0]!==o?(a=Ct(o),e[0]=o,e[1]=a):a=e[1];const T=a,l=bt(o,c,T),y=`${o}-${c}`;let $;e[2]!==i||e[3]!==y?($={namespace:i,resource:y,defaultSortKey:"updated_at"},e[2]=i,e[3]=y,e[4]=$):$=e[4];const{search:f,searchTerm:L,setSearch:b,viewMode:_,setViewMode:I,sortKey:O,sortDirection:w,handleSort:h}=At($);let R;e[5]!==L||e[6]!==w||e[7]!==O?(R={searchTerm:L,sortKey:O,sortDirection:w},e[5]=L,e[6]=w,e[7]=O,e[8]=R):R=e[8];const M=yt(o,c,T,R),z=!u&&!g&&!r;let E;e[9]!==c||e[10]!==o||e[11]!==p||e[12]!==i?(E=B=>{p({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:i,connectionId:o,collectionName:c,itemId:B.id}})},e[9]=c,e[10]=o,e[11]=p,e[12]=i,e[13]=E):E=e[13];const N=E;let D;e[14]!==l.create||e[15]!==j?(D=async B=>{const ye=new Date().toISOString();await l.create.mutateAsync({...B,id:Xe("conn"),title:`${B.title} (Copy)`,created_at:ye,updated_at:ye,created_by:j,updated_by:j})},e[14]=l.create,e[15]=j,e[16]=D):D=e[16];const A=D,[x,K]=U.useState(null);let V;e[17]===Symbol.for("react.memo_cache_sentinel")?(V=B=>{K(B)},e[17]=V):V=e[17];const P=V;let k;e[18]!==N||e[19]!==g?(k=g&&{edit:N},e[18]=N,e[19]=g,e[20]=k):k=e[20];let F;e[21]!==A||e[22]!==u?(F=u&&{duplicate:A},e[21]=A,e[22]=u,e[23]=F):F=e[23];let q;e[24]!==r?(q=r&&{delete:P},e[24]=r,e[25]=q):q=e[25];let J;e[26]!==q||e[27]!==k||e[28]!==F?(J={...k,...F,...q},e[26]=q,e[27]=k,e[28]=F,e[29]=J):J=e[29];const Z=J;let fe;e[30]!==l.delete||e[31]!==x?(fe=async()=>{x&&(await l.delete.mutateAsync(x.id),K(null))},e[30]=l.delete,e[31]=x,e[32]=fe):fe=e[32];const Te=fe;let pe;e[33]!==l.create||e[34]!==c||e[35]!==o||e[36]!==u||e[37]!==p||e[38]!==i||e[39]!==j?(pe=async()=>{if(!u){ht.error("Create operation is not available for this collection");return}const B=new Date().toISOString(),ye={id:Xe("conn"),title:"New Item",description:"A brief description of the item",created_at:B,updated_at:B,created_by:j,updated_by:j};try{const Ke=await l.create.mutateAsync(ye);p({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:i,connectionId:o,collectionName:c,itemId:Ke.id}})}catch(Ke){console.error("Failed to create item:",Ke)}},e[33]=l.create,e[34]=c,e[35]=o,e[36]=u,e[37]=p,e[38]=i,e[39]=j,e[40]=pe):pe=e[40];const $e=pe;let he;e[41]!==d?(he=dt(d),e[41]=d,e[42]=he):he=e[42];const _e=he,Je=(M?.length??0)>0,ut=u&&Je,ft=u&&!Je&&!f;let xe;e[43]!==l.create||e[44]!==$e||e[45]!==u?(xe=u?s.jsxs(Se,{onClick:$e,size:"sm",disabled:l.create.isPending,className:"h-7",children:[s.jsx(Kt,{className:"mr-2 h-4 w-4"}),l.create.isPending?"Creating...":"Create"]}):null,e[43]=l.create,e[44]=$e,e[45]=u,e[46]=xe):xe=e[46];const Ze=xe,Ie=O;let Q;e[47]!==h||e[48]!==I||e[49]!==w||e[50]!==_e||e[51]!==Ie||e[52]!==_?(Q=s.jsx(we,{viewMode:_,onViewModeChange:I,sortKey:Ie,sortDirection:w,onSort:h,sortOptions:_e}),e[47]=h,e[48]=I,e[49]=w,e[50]=_e,e[51]=Ie,e[52]=_,e[53]=Q):Q=e[53];const De=`${c}s`,Ae=v?.icon??"grid_view";let X;e[54]!==De||e[55]!==Ae||e[56]!==m?(X=s.jsx(Ge,{title:De,url:m,icon:Ae}),e[54]=De,e[55]=Ae,e[56]=m,e[57]=X):X=e[57];const Pe=ut&&Ze;let Y;e[58]!==Q||e[59]!==X||e[60]!==Pe?(Y=s.jsxs(Be,{children:[Q,X,Pe]}),e[58]=Q,e[59]=X,e[60]=Pe,e[61]=Y):Y=e[61];const ke=`Search ${c}...`;let ee;e[62]!==b?(ee=B=>{B.key==="Escape"&&(b(""),B.target.blur())},e[62]=b,e[63]=ee):ee=e[63];let te;e[64]!==f||e[65]!==b||e[66]!==ke||e[67]!==ee?(te=s.jsx(Ue,{value:f,onChange:b,placeholder:ke,onKeyDown:ee}),e[64]=f,e[65]=b,e[66]=ke,e[67]=ee,e[68]=te):te=e[68];let se;e[69]!==M?(se=M??[],e[69]=M,e[70]=se):se=e[70];const Le=O;let oe;e[71]!==N?(oe=B=>N(B),e[71]=N,e[72]=oe):oe=e[72];const Me="No items found",Re=f?"Try adjusting your search terms":"This collection doesn't have any items yet.",Ee=ft?Ze:void 0;let ne;e[73]!==Me||e[74]!==Re||e[75]!==Ee?(ne=s.jsx(H,{image:null,title:Me,description:Re,actions:Ee}),e[73]=Me,e[74]=Re,e[75]=Ee,e[76]=ne):ne=e[76];let ie;e[77]!==h||e[78]!==z||e[79]!==Z||e[80]!==d||e[81]!==f||e[82]!==b||e[83]!==I||e[84]!==w||e[85]!==se||e[86]!==Le||e[87]!==oe||e[88]!==ne||e[89]!==_?(ie=s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx(Xt,{hideToolbar:!0,data:se,schema:d,viewMode:_,onViewModeChange:I,search:f,onSearchChange:b,sortKey:Le,sortDirection:w,onSort:h,actions:Z,onItemClick:oe,readOnly:z,emptyState:ne})}),e[77]=h,e[78]=z,e[79]=Z,e[80]=d,e[81]=f,e[82]=b,e[83]=I,e[84]=w,e[85]=se,e[86]=Le,e[87]=oe,e[88]=ne,e[89]=_,e[90]=ie):ie=e[90];let re;e[91]!==te||e[92]!==ie?(re=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[te,ie]}),e[91]=te,e[92]=ie,e[93]=re):re=e[93];const Oe=!!x;let ge;e[94]===Symbol.for("react.memo_cache_sentinel")?(ge=B=>{B||K(null)},e[94]=ge):ge=e[94];let je;e[95]===Symbol.for("react.memo_cache_sentinel")?(je=s.jsx(Mt,{children:"Delete item?"}),e[95]=je):je=e[95];const ze=x?.title;let le;e[96]!==ze?(le=s.jsxs(Rt,{children:[je,s.jsxs(Et,{children:['Are you sure you want to delete "',ze,'"? This action cannot be undone.']})]}),e[96]=ze,e[97]=le):le=e[97];let ce;e[98]!==l.delete.isPending?(ce=s.jsx(kt,{disabled:l.delete.isPending,children:"Cancel"}),e[98]=l.delete.isPending,e[99]=ce):ce=e[99];const Ve=l.delete.isPending?"Deleting...":"Delete";let ae;e[100]!==l.delete.isPending||e[101]!==Te||e[102]!==Ve?(ae=s.jsx(Lt,{onClick:Te,disabled:l.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ve}),e[100]=l.delete.isPending,e[101]=Te,e[102]=Ve,e[103]=ae):ae=e[103];let de;e[104]!==ce||e[105]!==ae?(de=s.jsxs(Ot,{children:[ce,ae]}),e[104]=ce,e[105]=ae,e[106]=de):de=e[106];let me;e[107]!==le||e[108]!==de?(me=s.jsxs(zt,{children:[le,de]}),e[107]=le,e[108]=de,e[109]=me):me=e[109];let ue;e[110]!==Oe||e[111]!==me?(ue=s.jsx(Vt,{open:Oe,onOpenChange:ge,children:me}),e[110]=Oe,e[111]=me,e[112]=ue):ue=e[112];let be;return e[113]!==Y||e[114]!==re||e[115]!==ue?(be=s.jsxs(s.Fragment,{children:[Y,re,ue]}),e[113]=Y,e[114]=re,e[115]=ue,e[116]=be):be=e[116],be}function cs(t){const e=W.c(42),{prompts:o,connectionId:i,org:n,connectionTitle:c,connectionIcon:d,onPromptClick:u,showToolbar:g,emptyMessage:r}=t,p=g===void 0?!0:g,S=r===void 0?"This connection doesn't have any prompts yet.":r,m=Ce(),j=Fe().location.href,[v,a]=U.useState(""),[T,l]=U.useState("table"),[y,$]=U.useState("name"),[f,L]=U.useState("asc");let b;e[0]!==f||e[1]!==y?(b=P=>{y===P?(L(fs),f==="desc"&&$(void 0)):($(P),L("asc"))},e[0]=f,e[1]=y,e[2]=b):b=e[2];const _=b;let I;e[3]!==i||e[4]!==m||e[5]!==u||e[6]!==n?(I=P=>{u?u(P):i&&n&&m({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:n,connectionId:i,collectionName:"prompts",itemId:encodeURIComponent(P.name)}})},e[3]=i,e[4]=m,e[5]=u,e[6]=n,e[7]=I):I=e[7];const O=I;let w;if(e[8]!==o||e[9]!==v||e[10]!==f||e[11]!==y){const P=!o||o.length===0?[]:v.trim()?(()=>{const k=v.toLowerCase();return o.filter(F=>F.name.toLowerCase().includes(k)||F.description&&F.description.toLowerCase().includes(k))})():o;w=!y||!f?P:[...P].sort((k,F)=>{const q=k[y]||"",J=F[y]||"",Z=String(q).localeCompare(String(J));return f==="asc"?Z:-Z}),e[8]=o,e[9]=v,e[10]=f,e[11]=y,e[12]=w}else w=e[12];const h=w;let R;e[13]===Symbol.for("react.memo_cache_sentinel")?(R=[{id:"name",header:"Name",render:us,sortable:!0},{id:"description",header:"Description",render:ms,cellClassName:"flex-1",sortable:!0}],e[13]=R):R=e[13];const M=R;let z;e[14]===Symbol.for("react.memo_cache_sentinel")?(z=M.filter(ds).map(as),e[14]=z):z=e[14];const E=z;let N;e[15]!==d||e[16]!==c||e[17]!==_||e[18]!==p||e[19]!==f||e[20]!==y||e[21]!==j||e[22]!==T?(N=p&&s.jsxs(Be,{children:[s.jsx(we,{viewMode:T,onViewModeChange:l,sortKey:y,sortDirection:f,onSort:_,sortOptions:E}),s.jsx(Ge,{title:c?`${c}: Prompts`:"Prompts",url:j,icon:d??"description"})]}),e[15]=d,e[16]=c,e[17]=_,e[18]=p,e[19]=f,e[20]=y,e[21]=j,e[22]=T,e[23]=N):N=e[23];let D;e[24]===Symbol.for("react.memo_cache_sentinel")?(D=P=>{P.key==="Escape"&&(a(""),P.target.blur())},e[24]=D):D=e[24];let A;e[25]!==v?(A=s.jsx(Ue,{value:v,onChange:a,placeholder:"Search prompts...",onKeyDown:D}),e[25]=v,e[26]=A):A=e[26];let x;e[27]!==S||e[28]!==O||e[29]!==_||e[30]!==v||e[31]!==f||e[32]!==y||e[33]!==h||e[34]!==T?(x=T==="cards"?s.jsx("div",{className:"flex-1 overflow-auto p-5",children:h.length===0?s.jsx(H,{image:null,title:v?"No prompts found":"No prompts available",description:v?"Try adjusting your search terms":S}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:h.map(P=>s.jsx(We,{className:"cursor-pointer transition-colors",onClick:()=>O(P),children:s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(ve,{icon:null,name:P.name,size:"md",className:"shrink-0 shadow-sm"}),s.jsxs("div",{className:"flex flex-col gap-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:P.name}),s.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:P.description||"No description"})]})]})},P.name))})}):s.jsx(qe,{columns:M,data:h,isLoading:!1,sortKey:y,sortDirection:f,onSort:_,onRowClick:P=>O(P),emptyState:s.jsx(H,{image:null,title:v?"No prompts found":"No prompts available",description:v?"Try adjusting your search terms":S})}),e[27]=S,e[28]=O,e[29]=_,e[30]=v,e[31]=f,e[32]=y,e[33]=h,e[34]=T,e[35]=x):x=e[35];let K;e[36]!==A||e[37]!==x?(K=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[A,x]}),e[36]=A,e[37]=x,e[38]=K):K=e[38];let V;return e[39]!==K||e[40]!==N?(V=s.jsxs(s.Fragment,{children:[N,K]}),e[39]=K,e[40]=N,e[41]=V):V=e[41],V}function as(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function ds(t){return t.sortable}function ms(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function us(t){return s.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:t.name})}function fs(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function ps(t){const e=W.c(6),{prompts:o,connectionId:i,org:n}=t,c=Ne(i),d=c?.title,u=c?.icon;let g;return e[0]!==i||e[1]!==n||e[2]!==o||e[3]!==d||e[4]!==u?(g=s.jsx(cs,{prompts:o,connectionId:i,org:n,connectionTitle:d,connectionIcon:u}),e[0]=i,e[1]=n,e[2]=o,e[3]=d,e[4]=u,e[5]=g):g=e[5],g}function hs(t){const e=W.c(2),{repository:o}=t;let i;return e[0]!==o?(i=s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(Ft,{repository:o})}),e[0]=o,e[1]=i):i=e[1],i}function xs(t){const e=W.c(39),{resources:o,connectionTitle:i,connectionIcon:n,onResourceClick:c,showToolbar:d,emptyMessage:u}=t,g=d===void 0?!0:d,r=u===void 0?"This connection doesn't have any resources yet.":u,S=Fe().location.href,[m,C]=U.useState(""),[j,v]=U.useState("table"),[a,T]=U.useState("name"),[l,y]=U.useState("asc");let $;e[0]!==l||e[1]!==a?($=x=>{a===x?(y(Ns),l==="desc"&&T(void 0)):(T(x),y("asc"))},e[0]=l,e[1]=a,e[2]=$):$=e[2];const f=$;let L;e[3]!==c?(L=x=>{c&&c(x)},e[3]=c,e[4]=L):L=e[4];const b=L;let _;if(e[5]!==o||e[6]!==m||e[7]!==l||e[8]!==a){const x=!o||o.length===0?[]:m.trim()?(()=>{const K=m.toLowerCase();return o.filter(V=>V.uri.toLowerCase().includes(K)||V.name&&V.name.toLowerCase().includes(K)||V.description&&V.description.toLowerCase().includes(K))})():o;_=!a||!l?x:[...x].sort((K,V)=>{const P=K[a]||"",k=V[a]||"",F=String(P).localeCompare(String(k));return l==="asc"?F:-F}),e[5]=o,e[6]=m,e[7]=l,e[8]=a,e[9]=_}else _=e[9];const I=_;let O;e[10]===Symbol.for("react.memo_cache_sentinel")?(O=[{id:"name",header:"Name",render:vs,sortable:!0},{id:"uri",header:"URI",render:Cs,sortable:!0},{id:"description",header:"Description",render:ys,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:bs,sortable:!0}],e[10]=O):O=e[10];const w=O;let h;e[11]===Symbol.for("react.memo_cache_sentinel")?(h=w.filter(js).map(gs),e[11]=h):h=e[11];const R=h;let M;e[12]!==n||e[13]!==i||e[14]!==f||e[15]!==g||e[16]!==l||e[17]!==a||e[18]!==S||e[19]!==j?(M=g&&s.jsxs(Be,{children:[s.jsx(we,{viewMode:j,onViewModeChange:v,sortKey:a,sortDirection:l,onSort:f,sortOptions:R}),s.jsx(Ge,{title:i?`${i}: Resources`:"Resources",url:S,icon:n??"folder"})]}),e[12]=n,e[13]=i,e[14]=f,e[15]=g,e[16]=l,e[17]=a,e[18]=S,e[19]=j,e[20]=M):M=e[20];let z;e[21]===Symbol.for("react.memo_cache_sentinel")?(z=x=>{x.key==="Escape"&&(C(""),x.target.blur())},e[21]=z):z=e[21];let E;e[22]!==m?(E=s.jsx(Ue,{value:m,onChange:C,placeholder:"Search resources...",onKeyDown:z}),e[22]=m,e[23]=E):E=e[23];let N;e[24]!==r||e[25]!==b||e[26]!==f||e[27]!==m||e[28]!==l||e[29]!==a||e[30]!==I||e[31]!==j?(N=j==="cards"?s.jsx("div",{className:"flex-1 overflow-auto p-5",children:I.length===0?s.jsx(H,{image:null,title:m?"No resources found":"No resources available",description:m?"Try adjusting your search terms":r}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:I.map(x=>s.jsx(We,{className:"cursor-pointer transition-colors",onClick:()=>b(x),children:s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(ve,{icon:null,name:x.name||x.uri,size:"md",className:"shrink-0 shadow-sm"}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:x.name||x.uri}),s.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:x.uri}),x.description&&s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:x.description})]})]})},x.uri))})}):s.jsx(qe,{columns:w,data:I,isLoading:!1,sortKey:a,sortDirection:l,onSort:f,onRowClick:x=>b(x),emptyState:s.jsx(H,{image:null,title:m?"No resources found":"No resources available",description:m?"Try adjusting your search terms":r})}),e[24]=r,e[25]=b,e[26]=f,e[27]=m,e[28]=l,e[29]=a,e[30]=I,e[31]=j,e[32]=N):N=e[32];let D;e[33]!==E||e[34]!==N?(D=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[E,N]}),e[33]=E,e[34]=N,e[35]=D):D=e[35];let A;return e[36]!==D||e[37]!==M?(A=s.jsxs(s.Fragment,{children:[M,D]}),e[36]=D,e[37]=M,e[38]=A):A=e[38],A}function gs(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function js(t){return t.sortable}function bs(t){return s.jsx("span",{className:"text-sm text-muted-foreground",children:t.mimeType||"—"})}function ys(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function Cs(t){return s.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:t.uri})}function vs(t){return s.jsx("span",{className:"text-sm font-medium text-foreground",children:t.name||t.uri})}function Ns(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Ss(t){const e=W.c(6),{resources:o,connectionId:i,org:n}=t,c=Ne(i),d=c?.title,u=c?.icon;let g;return e[0]!==i||e[1]!==n||e[2]!==o||e[3]!==d||e[4]!==u?(g=s.jsx(xs,{resources:o,connectionId:i,org:n,connectionTitle:d,connectionIcon:u}),e[0]=i,e[1]=n,e[2]=o,e[3]=d,e[4]=u,e[5]=g):g=e[5],g}function ws(t){const e=W.c(4),{tools:o,connectionId:i,org:n}=t;let c;return e[0]!==i||e[1]!==n||e[2]!==o?(c=s.jsx(Bt,{tools:o,connectionId:i,org:n}),e[0]=i,e[1]=n,e[2]=o,e[3]=c):c=e[3],c}function Ts(t){const e=W.c(60),{connection:o,connectionId:i,org:n,requestedTabId:c,collections:d,onUpdate:u,isUpdating:g,prompts:r,resources:p}=t,S=jt();let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={from:"/$org/mcps/$connectionId"},e[0]=m):m=e[0];const C=Ce(m);let j;e[1]!==i?(j={connectionId:i},e[1]=i,e[2]=j):j=e[2];const v=St(j),a=v.isAuthenticated,T=o?.metadata?.repository,l=!!T?.url,y=o?.tools?.length??0,$=r.length,f=p.length;let L;e[3]===Symbol.for("react.memo_cache_sentinel")?(L={id:"settings",label:"Settings"},e[3]=L):L=e[3];let b;e[4]!==a||e[5]!==y?(b=a&&y>0?[{id:"tools",label:"Tools",count:y}]:[],e[4]=a,e[5]=y,e[6]=b):b=e[6];let _;e[7]!==a||e[8]!==$?(_=a&&$>0?[{id:"prompts",label:"Prompts",count:$}]:[],e[7]=a,e[8]=$,e[9]=_):_=e[9];let I;e[10]!==a||e[11]!==f?(I=a&&f>0?[{id:"resources",label:"Resources",count:f}]:[],e[10]=a,e[11]=f,e[12]=I):I=e[12];let O;if(e[13]!==d||e[14]!==l||e[15]!==a||e[16]!==b||e[17]!==_||e[18]!==I){let k;e[20]!==l?(k=l?[{id:"readme",label:"README"}]:[],e[20]=l,e[21]=k):k=e[21],O=[L,...b,..._,...I,...a?(d||[]).map($s):[],...k],e[13]=d,e[14]=l,e[15]=a,e[16]=b,e[17]=_,e[18]=I,e[19]=O}else O=e[19];const w=O,h=w.some(k=>k.id===c)?c:"settings";let R;e[22]!==C?(R=k=>{C({search:F=>({...F,tab:k}),replace:!0})},e[22]=C,e[23]=R):R=e[23];const M=R;let z;e[24]!==d?(z=d||[],e[24]=d,e[25]=z):z=e[25];let E;if(e[26]!==h||e[27]!==z){let k;e[29]!==h?(k=F=>F.name===h,e[29]=h,e[30]=k):k=e[30],E=z.find(k),e[26]=h,e[27]=z,e[28]=E}else E=e[28];const N=E;let D;e[31]!==S.history?(D=()=>S.history.back(),e[31]=S.history,e[32]=D):D=e[32];let A;e[33]!==h||e[34]!==M||e[35]!==w?(A=s.jsx(It,{children:s.jsx(_t,{tabs:w,activeTab:h,onTabChange:M})}),e[33]=h,e[34]=M,e[35]=w,e[36]=A):A=e[36];let x;e[37]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx(st,{size:32,className:"animate-spin text-muted-foreground"})}),e[37]=x):x=e[37];let K;e[38]!==N||e[39]!==h||e[40]!==v.supportsOAuth||e[41]!==o||e[42]!==i||e[43]!==M||e[44]!==l||e[45]!==a||e[46]!==g||e[47]!==u||e[48]!==n||e[49]!==r||e[50]!==T||e[51]!==p?(K=s.jsx(U.Suspense,{fallback:x,children:h==="tools"?s.jsx(ws,{tools:o.tools??void 0,connectionId:i,org:n}):h==="prompts"?s.jsx(ps,{prompts:r,connectionId:i,org:n}):h==="resources"?s.jsx(Ss,{resources:p,connectionId:i,org:n}):h==="settings"?s.jsx(wt,{connection:o,onUpdate:u,isUpdating:g,isMCPAuthenticated:a,supportsOAuth:v.supportsOAuth,onViewReadme:l?()=>M("readme"):void 0}):h==="readme"&&l?s.jsx(hs,{repository:T}):N&&a?s.jsx(ls,{connectionId:i,org:n,activeCollection:N},h):s.jsx(H,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[38]=N,e[39]=h,e[40]=v.supportsOAuth,e[41]=o,e[42]=i,e[43]=M,e[44]=l,e[45]=a,e[46]=g,e[47]=u,e[48]=n,e[49]=r,e[50]=T,e[51]=p,e[52]=K):K=e[52];let V;e[53]!==h||e[54]!==K?(V=s.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:s.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-auto",children:s.jsx(tt,{children:K},h)})}),e[53]=h,e[54]=K,e[55]=V):V=e[55];let P;return e[56]!==D||e[57]!==A||e[58]!==V?(P=s.jsxs(Dt,{onBack:D,children:[A,V]}),e[56]=D,e[57]=A,e[58]=V,e[59]=P):P=e[59],P}function $s(t){return{id:t.name,label:t.displayName}}function _s(){const t=W.c(29);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/mcps/$connectionId"},t[0]=e):e=t[0];const o=Ce(e);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org/mcps/$connectionId"},t[1]=i):i=t[1];const{connectionId:n,org:c}=xt(i);let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d={from:"/shell/$org/mcps/$connectionId"},t[2]=d):d=t[2];const g=gt(d).tab||"settings",r=Ne(n),p=vt(),S=Nt(r??void 0);let m;t[3]!==n?(m=[n],t[3]=n,t[4]=m):m=t[4];const{promptsMap:C}=Tt(m);let j;t[5]!==n?(j=[n],t[5]=n,t[6]=j):j=t[6];const{resourcesMap:v}=$t(j);let a;t[7]!==n||t[8]!==C?(a=C.get(n)??[],t[7]=n,t[8]=C,t[9]=a):a=t[9];const T=a;let l;t[10]!==n||t[11]!==v?(l=v.get(n)??[],t[10]=n,t[11]=v,t[12]=l):l=t[12];const y=l;let $;t[13]!==p.update||t[14]!==n?($=async b=>{await p.update.mutateAsync({id:n,data:b})},t[13]=p.update,t[14]=n,t[15]=$):$=t[15];const f=$;if(!r){let b;return t[16]!==o||t[17]!==c?(b=s.jsx("div",{className:"flex h-full w-full bg-background",children:s.jsx(H,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:s.jsx(Se,{variant:"outline",onClick:()=>o({to:"/$org/mcps",params:{org:c}}),children:"Back to connections"})})}),t[16]=o,t[17]=c,t[18]=b):b=t[18],b}let L;return t[19]!==p.update.isPending||t[20]!==S||t[21]!==r||t[22]!==n||t[23]!==f||t[24]!==c||t[25]!==T||t[26]!==g||t[27]!==y?(L=s.jsx(Ts,{org:c,connection:r,connectionId:n,requestedTabId:g,collections:S,onUpdate:f,isUpdating:p.update.isPending,prompts:T,resources:y}),t[19]=p.update.isPending,t[20]=S,t[21]=r,t[22]=n,t[23]=f,t[24]=c,t[25]=T,t[26]=g,t[27]=y,t[28]=L):L=t[28],L}function Is(){const t=W.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(tt,{children:s.jsx(U.Suspense,{fallback:s.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:s.jsx(st,{size:32,className:"animate-spin text-muted-foreground"})}),children:s.jsx(_s,{})})}),t[0]=e):e=t[0],e}function _o(){const t=W.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Is,{}),t[0]=e):e=t[0],e}export{_o as default};
1
+ import{r as U,c as W,j as s,f as Ce,g as Fe,a as pt,t as ht,d as xt,b as gt,av as jt}from"./index-CqA7I8ME.js";import{E as H}from"./SearchMd-DDy8E2Sf.js";import{E as tt}from"./error-boundary-BlfwOQWs.js";import{I as ve,b as Ne,d as bt,e as yt,c as Ct,a as vt}from"./use-connection-CRNsw_EM.js";import{b as Nt}from"./use-binding-BSrLFa69.js";import{E as Qe,u as St,S as wt}from"./index-BEpExDaW.js";import{u as Tt,a as $t}from"./use-connection-resources-CuRCIUIA.js";import{B as Se}from"./button-Cu7Gpj_2.js";import{i as st}from"./Loading01-DdJTgVpp.js";import{R as _t}from"./resource-tabs-CeU00pMP.js";import{V as Be,a as It,b as Dt}from"./layout-zE8Dp2X0.js";import{g as Xe}from"./generate-id-Dyweu44Y.js";import{C as we}from"./collection-display-button-CfJOFOy4.js";import{C as Ue}from"./collection-search-Dt3csPYy.js";import{C as We}from"./card-BMKHMTDj.js";import{b as ot,D as nt,a as it,d as G}from"./dropdown-menu-De2MFXzP.js";import{a as rt}from"./Copy01-DZzyV7nE.js";import{i as lt}from"./DotsVertical-BJS2t7Tg.js";import{s as ct,u as At}from"./use-list-state-Bu3fDY_D.js";import{s as at}from"./Trash01-3l-2SGXg.js";import{C as qe}from"./collection-table-wrapper-B3zYvq_F.js";import{n as Ye}from"./Inbox01-BHWd6y2Z.js";import{P as Ge}from"./formatDistanceToNow-7bwQqEEJ.js";import{B as Pt}from"./extract-connection-data-D7ePP-S9.js";import{A as kt,g as Lt,c as Mt,b as Rt,d as Et,e as Ot,a as zt,f as Vt}from"./alert-dialog-TgVzKfkb.js";import{s as Kt}from"./Plus-DF_8yoMD.js";import{R as Ft,T as Bt}from"./tools-list-NuJ6i7mN.js";import"./tooltip-BGO9FrAb.js";import"./auth-CPnNaHvV.js";import"./mcp-oauth-tlLalwei.js";import"./env-vars-editor-DKJqlIK-.js";import"./input-DHGUS5vj.js";import"./use-tool-call-hxvro7CP.js";import"./useQuery-DYX0Erl2.js";import"./File06-NpiRHtR-.js";import"./Key01-BYLHyZyj.js";import"./form-C9aG8a9_.js";import"./select-Dg5JPxAc.js";import"./ChevronDown-BtaAznAf.js";import"./Terminal-CyVXhceX.js";import"./use-gateway-BDLgsIti.js";import"./CpuChip02-SXr5nJdo.js";import"./registry-utils-ulDDT0d8.js";import"./index-BC4DFDP4.js";import"./index-rXoeRhPD.js";import"./badge-B1dobCRY.js";import"./ArrowLeft-DYJU0sRd.js";import"./view-mode-toggle-CwRfmI4H.js";import"./use-mobile-DWX_zGvO.js";import"./use-organization-settings-BjHeWH30.js";const He=({size:t=24,color:e="currentColor",...o})=>U.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},U.createElement("path",{d:"M2.876 18.116c.046-.414.069-.62.131-.814a2 2 0 0 1 .234-.485c.111-.17.259-.317.553-.61L17 3a2.828 2.828 0 1 1 4 4L7.794 20.206c-.294.294-.442.442-.611.553a2 2 0 0 1-.485.233c-.193.063-.4.086-.814.132L2.5 21.5l.376-3.384Z"}));He.displayName="Edit01";function Ut(t,e){const o=t.properties||{};for(const n in o){const c=o[n];if(c&&c.type==="string"&&(c.format==="url"||c.format==="uri")&&e&&typeof e=="object"&&n in e&&e[n])return e[n]}const i=["image","img","avatar","icon","logo","thumbnail","cover"];for(const n of i)if(e&&typeof e=="object"&&n in e&&typeof e[n]=="string")return e[n]}function Wt(t){const e=W.c(25),{item:o,schema:i,actions:n}=t;let c;e[0]!==o||e[1]!==i?(c=Ut(i,o),e[0]=o,e[1]=i,e[2]=c):c=e[2];const d=c,u=o&&typeof o=="object"&&"description"in o&&typeof o.description=="string"?o.description:void 0;let g;e[3]!==n?(g=n&&Object.keys(n).length>0,e[3]=n,e[4]=g):g=e[4];const r=g;let p;e[5]!==d||e[6]!==o.title?(p=s.jsx(ve,{icon:d,name:o.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=d,e[6]=o.title,e[7]=p):p=e[7];let S;e[8]!==o.title?(S=s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:o.title}),e[8]=o.title,e[9]=S):S=e[9];const m=u||"No description";let C;e[10]!==m?(C=s.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:m}),e[10]=m,e[11]=C):C=e[11];let j;e[12]!==S||e[13]!==C?(j=s.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[S,C]}),e[12]=S,e[13]=C,e[14]=j):j=e[14];let v;e[15]!==p||e[16]!==j?(v=s.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[p,j]}),e[15]=p,e[16]=j,e[17]=v):v=e[17];let a;e[18]!==n||e[19]!==r||e[20]!==o?(a=r&&s.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:Jt,onMouseDown:Ht,children:s.jsxs(ot,{children:[s.jsx(nt,{asChild:!0,children:s.jsx(Se,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Gt,children:s.jsx(lt,{size:20})})}),s.jsxs(it,{align:"end",onClick:qt,children:[n.open&&s.jsxs(G,{onClick:l=>{l.stopPropagation(),n.open?.(o)},children:[s.jsx(ct,{size:16}),"Open"]}),n.edit&&s.jsxs(G,{onClick:l=>{l.stopPropagation(),n.edit?.(o)},children:[s.jsx(He,{size:16}),"Edit"]}),n.duplicate&&s.jsxs(G,{onClick:l=>{l.stopPropagation(),n.duplicate?.(o)},children:[s.jsx(rt,{size:16}),"Duplicate"]}),n.delete&&s.jsxs(G,{variant:"destructive",onClick:l=>{l.stopPropagation(),n.delete?.(o)},children:[s.jsx(at,{size:16}),"Delete"]})]})]})}),e[18]=n,e[19]=r,e[20]=o,e[21]=a):a=e[21];let T;return e[22]!==v||e[23]!==a?(T=s.jsxs(We,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[v,a]}),e[22]=v,e[23]=a,e[24]=T):T=e[24],T}function qt(t){return t.stopPropagation()}function Gt(t){return t.stopPropagation()}function Ht(t){return t.stopPropagation()}function Jt(t){return t.stopPropagation()}const Zt=["icon","avatar","logo"],et=["created_at","created_by","id"];function Qt(t){return Object.keys(t).find(e=>Zt.includes(e.toLowerCase()))}function dt(t,e){return Object.keys(t.properties||{}).filter(o=>["id","created_at","updated_at","created_by","updated_by"].includes(o)?!1:e?e.includes(o):!0).map(o=>({id:o,label:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," ")}))}function Xt(t){const e=W.c(32),{data:o,schema:i,viewMode:n,onViewModeChange:c,search:d,sortKey:u,sortDirection:g,onSort:r,actions:p,onItemClick:S,headerActions:m,emptyState:C,readOnly:j,columns:v,hideToolbar:a,sortableFields:T}=t,l=c===void 0?os:c,y=g===void 0?"asc":g,$=r===void 0?ss:r;let f;e[0]!==p?(f=p===void 0?{}:p,e[0]=p,e[1]=f):f=e[1];const L=f,b=S===void 0?ts:S,_=m===void 0?null:m,I=C===void 0?null:C,O=j===void 0?!1:j,w=v===void 0?void 0:v,h=a===void 0?!1:a,R=T===void 0?void 0:T;let M;e[2]!==w||e[3]!==i||e[4]!==R?(M=w?w.filter(es).filter(A=>!R||R.includes(A.id)).map(Yt):dt(i,R),e[2]=w,e[3]=i,e[4]=R,e[5]=M):M=e[5];const z=M;let E;e[6]!==_||e[7]!==h||e[8]!==$||e[9]!==l||e[10]!==y||e[11]!==u||e[12]!==z||e[13]!==n?(E=!h&&s.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:s.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[s.jsx("div",{className:"flex items-center gap-2 flex-1",children:_}),s.jsx("div",{className:"flex items-center gap-2 shrink-0",children:s.jsx(we,{viewMode:n,onViewModeChange:l,sortKey:u,sortDirection:y,onSort:$,sortOptions:z})})]})}),e[6]=_,e[7]=h,e[8]=$,e[9]=l,e[10]=y,e[11]=u,e[12]=z,e[13]=n,e[14]=E):E=e[14];let N;e[15]!==L||e[16]!==w||e[17]!==o||e[18]!==I||e[19]!==b||e[20]!==$||e[21]!==O||e[22]!==i||e[23]!==d||e[24]!==y||e[25]!==u||e[26]!==R||e[27]!==n?(N=n==="cards"?s.jsx("div",{className:"flex-1 overflow-auto p-5",children:o.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:I||s.jsx(Qe,{icon:s.jsx(Ye,{size:36,className:"text-muted-foreground"}),title:"No items found",description:d?"Try adjusting your search":"No items to display"})}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:o.map(A=>s.jsx("div",{onClick:()=>b?.(A),className:"cursor-pointer h-full",children:s.jsx(Wt,{item:A,schema:i,readOnly:O,actions:L})},A.id))})}):s.jsx(qe,{columns:rs(w,i,R,L),data:o,sortKey:u,sortDirection:y,onSort:$,onRowClick:b,emptyState:I||s.jsx(Qe,{icon:s.jsx(Ye,{size:36,className:"text-muted-foreground"}),title:"No items found",description:d?"Try adjusting your search":"No items to display"})}),e[15]=L,e[16]=w,e[17]=o,e[18]=I,e[19]=b,e[20]=$,e[21]=O,e[22]=i,e[23]=d,e[24]=y,e[25]=u,e[26]=R,e[27]=n,e[28]=N):N=e[28];let D;return e[29]!==E||e[30]!==N?(D=s.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[E,N]}),e[29]=E,e[30]=N,e[31]=D):D=e[31],D}function Yt(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function es(t){return t.sortable!==!1}function ts(){}function ss(){}function os(){}function ns(t){return{id:"actions",header:"",render:e=>s.jsxs(ot,{children:[s.jsx(nt,{asChild:!0,children:s.jsx(Se,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:s.jsx(lt,{size:20})})}),s.jsxs(it,{align:"end",onClick:o=>o.stopPropagation(),children:[t.open&&s.jsxs(G,{onClick:o=>{o.stopPropagation(),t.open?.(e)},children:[s.jsx(ct,{size:16}),"Open"]}),t.edit&&s.jsxs(G,{onClick:o=>{o.stopPropagation(),t.edit?.(e)},children:[s.jsx(He,{size:16}),"Edit"]}),t.duplicate&&s.jsxs(G,{onClick:o=>{o.stopPropagation(),t.duplicate?.(e)},children:[s.jsx(rt,{size:16}),"Duplicate"]}),t.delete&&s.jsxs(G,{variant:"destructive",onClick:o=>{o.stopPropagation(),t.delete?.(e)},children:[s.jsx(at,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function mt(t){const e=t.type;return Array.isArray(e)?e.every(o=>mt({type:o})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function is(t,e){const o=t.properties||{},i=Object.keys(o).filter(r=>{const p=o[r];return p&&mt(p)}),n=Qt(o),c=[],d=new Set;n&&i.includes(n)&&(c.push(n),d.add(n));const u=["title","description","updated_at","updated_by"];for(const r of u)i.includes(r)&&!d.has(r)&&(c.push(r),d.add(r));const g=i.filter(r=>!d.has(r)&&!et.includes(r)).sort((r,p)=>r.localeCompare(p));for(const r of g)c.push(r),d.add(r);for(const r of et)i.includes(r)&&!d.has(r)&&(c.push(r),d.add(r));return c.map(r=>{const p=o[r],S=e?e.includes(r):!["id"].includes(r);return r===n?{id:r,header:"",render:m=>{const C=m[r];return s.jsx(ve,{icon:C,name:m.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:r==="description"?{id:r,header:"Description",render:m=>{const C=m[r];return C==null?"—":s.jsx("span",{className:"block truncate max-w-[50ch]",children:String(C)})},sortable:S,cellClassName:"max-w-[50ch]"}:p?.format==="date-time"||r.endsWith("_at")?{id:r,header:r.charAt(0).toUpperCase()+r.slice(1).replace(/_/g," "),render:m=>{const C=m[r];return C?s.jsx("span",{className:"block truncate max-w-full",children:new Date(C).toLocaleDateString()}):"—"},sortable:S,cellClassName:"max-w-[200px]"}:{id:r,header:r.charAt(0).toUpperCase()+r.slice(1).replace(/_/g," "),render:m=>{const C=m[r];return C==null?"—":s.jsx("span",{className:"block truncate max-w-full",children:String(C)})},sortable:S,cellClassName:"max-w-[200px]"}})}function rs(t,e,o,i){const n=t||is(e,o);return n.some(u=>u.id==="actions")?n:Object.keys(i).length>0?[...n,ns(i)]:n}function ls(t){const e=W.c(117),{connectionId:o,org:i,activeCollection:n}=t,c=n.name,d=n.schema??Pt,u=n.hasCreateTool,g=n.hasUpdateTool,r=n.hasDeleteTool,p=Ce(),m=Fe().location.href,{data:C}=pt.useSession(),j=C?.user?.id||"unknown",v=Ne(o);let a;e[0]!==o?(a=Ct(o),e[0]=o,e[1]=a):a=e[1];const T=a,l=bt(o,c,T),y=`${o}-${c}`;let $;e[2]!==i||e[3]!==y?($={namespace:i,resource:y,defaultSortKey:"updated_at"},e[2]=i,e[3]=y,e[4]=$):$=e[4];const{search:f,searchTerm:L,setSearch:b,viewMode:_,setViewMode:I,sortKey:O,sortDirection:w,handleSort:h}=At($);let R;e[5]!==L||e[6]!==w||e[7]!==O?(R={searchTerm:L,sortKey:O,sortDirection:w},e[5]=L,e[6]=w,e[7]=O,e[8]=R):R=e[8];const M=yt(o,c,T,R),z=!u&&!g&&!r;let E;e[9]!==c||e[10]!==o||e[11]!==p||e[12]!==i?(E=B=>{p({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:i,connectionId:o,collectionName:c,itemId:B.id}})},e[9]=c,e[10]=o,e[11]=p,e[12]=i,e[13]=E):E=e[13];const N=E;let D;e[14]!==l.create||e[15]!==j?(D=async B=>{const ye=new Date().toISOString();await l.create.mutateAsync({...B,id:Xe("conn"),title:`${B.title} (Copy)`,created_at:ye,updated_at:ye,created_by:j,updated_by:j})},e[14]=l.create,e[15]=j,e[16]=D):D=e[16];const A=D,[x,K]=U.useState(null);let V;e[17]===Symbol.for("react.memo_cache_sentinel")?(V=B=>{K(B)},e[17]=V):V=e[17];const P=V;let k;e[18]!==N||e[19]!==g?(k=g&&{edit:N},e[18]=N,e[19]=g,e[20]=k):k=e[20];let F;e[21]!==A||e[22]!==u?(F=u&&{duplicate:A},e[21]=A,e[22]=u,e[23]=F):F=e[23];let q;e[24]!==r?(q=r&&{delete:P},e[24]=r,e[25]=q):q=e[25];let J;e[26]!==q||e[27]!==k||e[28]!==F?(J={...k,...F,...q},e[26]=q,e[27]=k,e[28]=F,e[29]=J):J=e[29];const Z=J;let fe;e[30]!==l.delete||e[31]!==x?(fe=async()=>{x&&(await l.delete.mutateAsync(x.id),K(null))},e[30]=l.delete,e[31]=x,e[32]=fe):fe=e[32];const Te=fe;let pe;e[33]!==l.create||e[34]!==c||e[35]!==o||e[36]!==u||e[37]!==p||e[38]!==i||e[39]!==j?(pe=async()=>{if(!u){ht.error("Create operation is not available for this collection");return}const B=new Date().toISOString(),ye={id:Xe("conn"),title:"New Item",description:"A brief description of the item",created_at:B,updated_at:B,created_by:j,updated_by:j};try{const Ke=await l.create.mutateAsync(ye);p({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:i,connectionId:o,collectionName:c,itemId:Ke.id}})}catch(Ke){console.error("Failed to create item:",Ke)}},e[33]=l.create,e[34]=c,e[35]=o,e[36]=u,e[37]=p,e[38]=i,e[39]=j,e[40]=pe):pe=e[40];const $e=pe;let he;e[41]!==d?(he=dt(d),e[41]=d,e[42]=he):he=e[42];const _e=he,Je=(M?.length??0)>0,ut=u&&Je,ft=u&&!Je&&!f;let xe;e[43]!==l.create||e[44]!==$e||e[45]!==u?(xe=u?s.jsxs(Se,{onClick:$e,size:"sm",disabled:l.create.isPending,className:"h-7",children:[s.jsx(Kt,{className:"mr-2 h-4 w-4"}),l.create.isPending?"Creating...":"Create"]}):null,e[43]=l.create,e[44]=$e,e[45]=u,e[46]=xe):xe=e[46];const Ze=xe,Ie=O;let Q;e[47]!==h||e[48]!==I||e[49]!==w||e[50]!==_e||e[51]!==Ie||e[52]!==_?(Q=s.jsx(we,{viewMode:_,onViewModeChange:I,sortKey:Ie,sortDirection:w,onSort:h,sortOptions:_e}),e[47]=h,e[48]=I,e[49]=w,e[50]=_e,e[51]=Ie,e[52]=_,e[53]=Q):Q=e[53];const De=`${c}s`,Ae=v?.icon??"grid_view";let X;e[54]!==De||e[55]!==Ae||e[56]!==m?(X=s.jsx(Ge,{title:De,url:m,icon:Ae}),e[54]=De,e[55]=Ae,e[56]=m,e[57]=X):X=e[57];const Pe=ut&&Ze;let Y;e[58]!==Q||e[59]!==X||e[60]!==Pe?(Y=s.jsxs(Be,{children:[Q,X,Pe]}),e[58]=Q,e[59]=X,e[60]=Pe,e[61]=Y):Y=e[61];const ke=`Search ${c}...`;let ee;e[62]!==b?(ee=B=>{B.key==="Escape"&&(b(""),B.target.blur())},e[62]=b,e[63]=ee):ee=e[63];let te;e[64]!==f||e[65]!==b||e[66]!==ke||e[67]!==ee?(te=s.jsx(Ue,{value:f,onChange:b,placeholder:ke,onKeyDown:ee}),e[64]=f,e[65]=b,e[66]=ke,e[67]=ee,e[68]=te):te=e[68];let se;e[69]!==M?(se=M??[],e[69]=M,e[70]=se):se=e[70];const Le=O;let oe;e[71]!==N?(oe=B=>N(B),e[71]=N,e[72]=oe):oe=e[72];const Me="No items found",Re=f?"Try adjusting your search terms":"This collection doesn't have any items yet.",Ee=ft?Ze:void 0;let ne;e[73]!==Me||e[74]!==Re||e[75]!==Ee?(ne=s.jsx(H,{image:null,title:Me,description:Re,actions:Ee}),e[73]=Me,e[74]=Re,e[75]=Ee,e[76]=ne):ne=e[76];let ie;e[77]!==h||e[78]!==z||e[79]!==Z||e[80]!==d||e[81]!==f||e[82]!==b||e[83]!==I||e[84]!==w||e[85]!==se||e[86]!==Le||e[87]!==oe||e[88]!==ne||e[89]!==_?(ie=s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx(Xt,{hideToolbar:!0,data:se,schema:d,viewMode:_,onViewModeChange:I,search:f,onSearchChange:b,sortKey:Le,sortDirection:w,onSort:h,actions:Z,onItemClick:oe,readOnly:z,emptyState:ne})}),e[77]=h,e[78]=z,e[79]=Z,e[80]=d,e[81]=f,e[82]=b,e[83]=I,e[84]=w,e[85]=se,e[86]=Le,e[87]=oe,e[88]=ne,e[89]=_,e[90]=ie):ie=e[90];let re;e[91]!==te||e[92]!==ie?(re=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[te,ie]}),e[91]=te,e[92]=ie,e[93]=re):re=e[93];const Oe=!!x;let ge;e[94]===Symbol.for("react.memo_cache_sentinel")?(ge=B=>{B||K(null)},e[94]=ge):ge=e[94];let je;e[95]===Symbol.for("react.memo_cache_sentinel")?(je=s.jsx(Mt,{children:"Delete item?"}),e[95]=je):je=e[95];const ze=x?.title;let le;e[96]!==ze?(le=s.jsxs(Rt,{children:[je,s.jsxs(Et,{children:['Are you sure you want to delete "',ze,'"? This action cannot be undone.']})]}),e[96]=ze,e[97]=le):le=e[97];let ce;e[98]!==l.delete.isPending?(ce=s.jsx(kt,{disabled:l.delete.isPending,children:"Cancel"}),e[98]=l.delete.isPending,e[99]=ce):ce=e[99];const Ve=l.delete.isPending?"Deleting...":"Delete";let ae;e[100]!==l.delete.isPending||e[101]!==Te||e[102]!==Ve?(ae=s.jsx(Lt,{onClick:Te,disabled:l.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ve}),e[100]=l.delete.isPending,e[101]=Te,e[102]=Ve,e[103]=ae):ae=e[103];let de;e[104]!==ce||e[105]!==ae?(de=s.jsxs(Ot,{children:[ce,ae]}),e[104]=ce,e[105]=ae,e[106]=de):de=e[106];let me;e[107]!==le||e[108]!==de?(me=s.jsxs(zt,{children:[le,de]}),e[107]=le,e[108]=de,e[109]=me):me=e[109];let ue;e[110]!==Oe||e[111]!==me?(ue=s.jsx(Vt,{open:Oe,onOpenChange:ge,children:me}),e[110]=Oe,e[111]=me,e[112]=ue):ue=e[112];let be;return e[113]!==Y||e[114]!==re||e[115]!==ue?(be=s.jsxs(s.Fragment,{children:[Y,re,ue]}),e[113]=Y,e[114]=re,e[115]=ue,e[116]=be):be=e[116],be}function cs(t){const e=W.c(42),{prompts:o,connectionId:i,org:n,connectionTitle:c,connectionIcon:d,onPromptClick:u,showToolbar:g,emptyMessage:r}=t,p=g===void 0?!0:g,S=r===void 0?"This connection doesn't have any prompts yet.":r,m=Ce(),j=Fe().location.href,[v,a]=U.useState(""),[T,l]=U.useState("table"),[y,$]=U.useState("name"),[f,L]=U.useState("asc");let b;e[0]!==f||e[1]!==y?(b=P=>{y===P?(L(fs),f==="desc"&&$(void 0)):($(P),L("asc"))},e[0]=f,e[1]=y,e[2]=b):b=e[2];const _=b;let I;e[3]!==i||e[4]!==m||e[5]!==u||e[6]!==n?(I=P=>{u?u(P):i&&n&&m({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:n,connectionId:i,collectionName:"prompts",itemId:encodeURIComponent(P.name)}})},e[3]=i,e[4]=m,e[5]=u,e[6]=n,e[7]=I):I=e[7];const O=I;let w;if(e[8]!==o||e[9]!==v||e[10]!==f||e[11]!==y){const P=!o||o.length===0?[]:v.trim()?(()=>{const k=v.toLowerCase();return o.filter(F=>F.name.toLowerCase().includes(k)||F.description&&F.description.toLowerCase().includes(k))})():o;w=!y||!f?P:[...P].sort((k,F)=>{const q=k[y]||"",J=F[y]||"",Z=String(q).localeCompare(String(J));return f==="asc"?Z:-Z}),e[8]=o,e[9]=v,e[10]=f,e[11]=y,e[12]=w}else w=e[12];const h=w;let R;e[13]===Symbol.for("react.memo_cache_sentinel")?(R=[{id:"name",header:"Name",render:us,sortable:!0},{id:"description",header:"Description",render:ms,cellClassName:"flex-1",sortable:!0}],e[13]=R):R=e[13];const M=R;let z;e[14]===Symbol.for("react.memo_cache_sentinel")?(z=M.filter(ds).map(as),e[14]=z):z=e[14];const E=z;let N;e[15]!==d||e[16]!==c||e[17]!==_||e[18]!==p||e[19]!==f||e[20]!==y||e[21]!==j||e[22]!==T?(N=p&&s.jsxs(Be,{children:[s.jsx(we,{viewMode:T,onViewModeChange:l,sortKey:y,sortDirection:f,onSort:_,sortOptions:E}),s.jsx(Ge,{title:c?`${c}: Prompts`:"Prompts",url:j,icon:d??"description"})]}),e[15]=d,e[16]=c,e[17]=_,e[18]=p,e[19]=f,e[20]=y,e[21]=j,e[22]=T,e[23]=N):N=e[23];let D;e[24]===Symbol.for("react.memo_cache_sentinel")?(D=P=>{P.key==="Escape"&&(a(""),P.target.blur())},e[24]=D):D=e[24];let A;e[25]!==v?(A=s.jsx(Ue,{value:v,onChange:a,placeholder:"Search prompts...",onKeyDown:D}),e[25]=v,e[26]=A):A=e[26];let x;e[27]!==S||e[28]!==O||e[29]!==_||e[30]!==v||e[31]!==f||e[32]!==y||e[33]!==h||e[34]!==T?(x=T==="cards"?s.jsx("div",{className:"flex-1 overflow-auto p-5",children:h.length===0?s.jsx(H,{image:null,title:v?"No prompts found":"No prompts available",description:v?"Try adjusting your search terms":S}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:h.map(P=>s.jsx(We,{className:"cursor-pointer transition-colors",onClick:()=>O(P),children:s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(ve,{icon:null,name:P.name,size:"md",className:"shrink-0 shadow-sm"}),s.jsxs("div",{className:"flex flex-col gap-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:P.name}),s.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:P.description||"No description"})]})]})},P.name))})}):s.jsx(qe,{columns:M,data:h,isLoading:!1,sortKey:y,sortDirection:f,onSort:_,onRowClick:P=>O(P),emptyState:s.jsx(H,{image:null,title:v?"No prompts found":"No prompts available",description:v?"Try adjusting your search terms":S})}),e[27]=S,e[28]=O,e[29]=_,e[30]=v,e[31]=f,e[32]=y,e[33]=h,e[34]=T,e[35]=x):x=e[35];let K;e[36]!==A||e[37]!==x?(K=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[A,x]}),e[36]=A,e[37]=x,e[38]=K):K=e[38];let V;return e[39]!==K||e[40]!==N?(V=s.jsxs(s.Fragment,{children:[N,K]}),e[39]=K,e[40]=N,e[41]=V):V=e[41],V}function as(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function ds(t){return t.sortable}function ms(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function us(t){return s.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:t.name})}function fs(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function ps(t){const e=W.c(6),{prompts:o,connectionId:i,org:n}=t,c=Ne(i),d=c?.title,u=c?.icon;let g;return e[0]!==i||e[1]!==n||e[2]!==o||e[3]!==d||e[4]!==u?(g=s.jsx(cs,{prompts:o,connectionId:i,org:n,connectionTitle:d,connectionIcon:u}),e[0]=i,e[1]=n,e[2]=o,e[3]=d,e[4]=u,e[5]=g):g=e[5],g}function hs(t){const e=W.c(2),{repository:o}=t;let i;return e[0]!==o?(i=s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(Ft,{repository:o})}),e[0]=o,e[1]=i):i=e[1],i}function xs(t){const e=W.c(39),{resources:o,connectionTitle:i,connectionIcon:n,onResourceClick:c,showToolbar:d,emptyMessage:u}=t,g=d===void 0?!0:d,r=u===void 0?"This connection doesn't have any resources yet.":u,S=Fe().location.href,[m,C]=U.useState(""),[j,v]=U.useState("table"),[a,T]=U.useState("name"),[l,y]=U.useState("asc");let $;e[0]!==l||e[1]!==a?($=x=>{a===x?(y(Ns),l==="desc"&&T(void 0)):(T(x),y("asc"))},e[0]=l,e[1]=a,e[2]=$):$=e[2];const f=$;let L;e[3]!==c?(L=x=>{c&&c(x)},e[3]=c,e[4]=L):L=e[4];const b=L;let _;if(e[5]!==o||e[6]!==m||e[7]!==l||e[8]!==a){const x=!o||o.length===0?[]:m.trim()?(()=>{const K=m.toLowerCase();return o.filter(V=>V.uri.toLowerCase().includes(K)||V.name&&V.name.toLowerCase().includes(K)||V.description&&V.description.toLowerCase().includes(K))})():o;_=!a||!l?x:[...x].sort((K,V)=>{const P=K[a]||"",k=V[a]||"",F=String(P).localeCompare(String(k));return l==="asc"?F:-F}),e[5]=o,e[6]=m,e[7]=l,e[8]=a,e[9]=_}else _=e[9];const I=_;let O;e[10]===Symbol.for("react.memo_cache_sentinel")?(O=[{id:"name",header:"Name",render:vs,sortable:!0},{id:"uri",header:"URI",render:Cs,sortable:!0},{id:"description",header:"Description",render:ys,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:bs,sortable:!0}],e[10]=O):O=e[10];const w=O;let h;e[11]===Symbol.for("react.memo_cache_sentinel")?(h=w.filter(js).map(gs),e[11]=h):h=e[11];const R=h;let M;e[12]!==n||e[13]!==i||e[14]!==f||e[15]!==g||e[16]!==l||e[17]!==a||e[18]!==S||e[19]!==j?(M=g&&s.jsxs(Be,{children:[s.jsx(we,{viewMode:j,onViewModeChange:v,sortKey:a,sortDirection:l,onSort:f,sortOptions:R}),s.jsx(Ge,{title:i?`${i}: Resources`:"Resources",url:S,icon:n??"folder"})]}),e[12]=n,e[13]=i,e[14]=f,e[15]=g,e[16]=l,e[17]=a,e[18]=S,e[19]=j,e[20]=M):M=e[20];let z;e[21]===Symbol.for("react.memo_cache_sentinel")?(z=x=>{x.key==="Escape"&&(C(""),x.target.blur())},e[21]=z):z=e[21];let E;e[22]!==m?(E=s.jsx(Ue,{value:m,onChange:C,placeholder:"Search resources...",onKeyDown:z}),e[22]=m,e[23]=E):E=e[23];let N;e[24]!==r||e[25]!==b||e[26]!==f||e[27]!==m||e[28]!==l||e[29]!==a||e[30]!==I||e[31]!==j?(N=j==="cards"?s.jsx("div",{className:"flex-1 overflow-auto p-5",children:I.length===0?s.jsx(H,{image:null,title:m?"No resources found":"No resources available",description:m?"Try adjusting your search terms":r}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:I.map(x=>s.jsx(We,{className:"cursor-pointer transition-colors",onClick:()=>b(x),children:s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(ve,{icon:null,name:x.name||x.uri,size:"md",className:"shrink-0 shadow-sm"}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:x.name||x.uri}),s.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:x.uri}),x.description&&s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:x.description})]})]})},x.uri))})}):s.jsx(qe,{columns:w,data:I,isLoading:!1,sortKey:a,sortDirection:l,onSort:f,onRowClick:x=>b(x),emptyState:s.jsx(H,{image:null,title:m?"No resources found":"No resources available",description:m?"Try adjusting your search terms":r})}),e[24]=r,e[25]=b,e[26]=f,e[27]=m,e[28]=l,e[29]=a,e[30]=I,e[31]=j,e[32]=N):N=e[32];let D;e[33]!==E||e[34]!==N?(D=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[E,N]}),e[33]=E,e[34]=N,e[35]=D):D=e[35];let A;return e[36]!==D||e[37]!==M?(A=s.jsxs(s.Fragment,{children:[M,D]}),e[36]=D,e[37]=M,e[38]=A):A=e[38],A}function gs(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function js(t){return t.sortable}function bs(t){return s.jsx("span",{className:"text-sm text-muted-foreground",children:t.mimeType||"—"})}function ys(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function Cs(t){return s.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:t.uri})}function vs(t){return s.jsx("span",{className:"text-sm font-medium text-foreground",children:t.name||t.uri})}function Ns(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Ss(t){const e=W.c(6),{resources:o,connectionId:i,org:n}=t,c=Ne(i),d=c?.title,u=c?.icon;let g;return e[0]!==i||e[1]!==n||e[2]!==o||e[3]!==d||e[4]!==u?(g=s.jsx(xs,{resources:o,connectionId:i,org:n,connectionTitle:d,connectionIcon:u}),e[0]=i,e[1]=n,e[2]=o,e[3]=d,e[4]=u,e[5]=g):g=e[5],g}function ws(t){const e=W.c(4),{tools:o,connectionId:i,org:n}=t;let c;return e[0]!==i||e[1]!==n||e[2]!==o?(c=s.jsx(Bt,{tools:o,connectionId:i,org:n}),e[0]=i,e[1]=n,e[2]=o,e[3]=c):c=e[3],c}function Ts(t){const e=W.c(60),{connection:o,connectionId:i,org:n,requestedTabId:c,collections:d,onUpdate:u,isUpdating:g,prompts:r,resources:p}=t,S=jt();let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={from:"/$org/mcps/$connectionId"},e[0]=m):m=e[0];const C=Ce(m);let j;e[1]!==i?(j={connectionId:i},e[1]=i,e[2]=j):j=e[2];const v=St(j),a=v.isAuthenticated,T=o?.metadata?.repository,l=!!T?.url,y=o?.tools?.length??0,$=r.length,f=p.length;let L;e[3]===Symbol.for("react.memo_cache_sentinel")?(L={id:"settings",label:"Settings"},e[3]=L):L=e[3];let b;e[4]!==a||e[5]!==y?(b=a&&y>0?[{id:"tools",label:"Tools",count:y}]:[],e[4]=a,e[5]=y,e[6]=b):b=e[6];let _;e[7]!==a||e[8]!==$?(_=a&&$>0?[{id:"prompts",label:"Prompts",count:$}]:[],e[7]=a,e[8]=$,e[9]=_):_=e[9];let I;e[10]!==a||e[11]!==f?(I=a&&f>0?[{id:"resources",label:"Resources",count:f}]:[],e[10]=a,e[11]=f,e[12]=I):I=e[12];let O;if(e[13]!==d||e[14]!==l||e[15]!==a||e[16]!==b||e[17]!==_||e[18]!==I){let k;e[20]!==l?(k=l?[{id:"readme",label:"README"}]:[],e[20]=l,e[21]=k):k=e[21],O=[L,...b,..._,...I,...a?(d||[]).map($s):[],...k],e[13]=d,e[14]=l,e[15]=a,e[16]=b,e[17]=_,e[18]=I,e[19]=O}else O=e[19];const w=O,h=w.some(k=>k.id===c)?c:"settings";let R;e[22]!==C?(R=k=>{C({search:F=>({...F,tab:k}),replace:!0})},e[22]=C,e[23]=R):R=e[23];const M=R;let z;e[24]!==d?(z=d||[],e[24]=d,e[25]=z):z=e[25];let E;if(e[26]!==h||e[27]!==z){let k;e[29]!==h?(k=F=>F.name===h,e[29]=h,e[30]=k):k=e[30],E=z.find(k),e[26]=h,e[27]=z,e[28]=E}else E=e[28];const N=E;let D;e[31]!==S.history?(D=()=>S.history.back(),e[31]=S.history,e[32]=D):D=e[32];let A;e[33]!==h||e[34]!==M||e[35]!==w?(A=s.jsx(It,{children:s.jsx(_t,{tabs:w,activeTab:h,onTabChange:M})}),e[33]=h,e[34]=M,e[35]=w,e[36]=A):A=e[36];let x;e[37]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx(st,{size:32,className:"animate-spin text-muted-foreground"})}),e[37]=x):x=e[37];let K;e[38]!==N||e[39]!==h||e[40]!==v.supportsOAuth||e[41]!==o||e[42]!==i||e[43]!==M||e[44]!==l||e[45]!==a||e[46]!==g||e[47]!==u||e[48]!==n||e[49]!==r||e[50]!==T||e[51]!==p?(K=s.jsx(U.Suspense,{fallback:x,children:h==="tools"?s.jsx(ws,{tools:o.tools??void 0,connectionId:i,org:n}):h==="prompts"?s.jsx(ps,{prompts:r,connectionId:i,org:n}):h==="resources"?s.jsx(Ss,{resources:p,connectionId:i,org:n}):h==="settings"?s.jsx(wt,{connection:o,onUpdate:u,isUpdating:g,isMCPAuthenticated:a,supportsOAuth:v.supportsOAuth,onViewReadme:l?()=>M("readme"):void 0}):h==="readme"&&l?s.jsx(hs,{repository:T}):N&&a?s.jsx(ls,{connectionId:i,org:n,activeCollection:N},h):s.jsx(H,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[38]=N,e[39]=h,e[40]=v.supportsOAuth,e[41]=o,e[42]=i,e[43]=M,e[44]=l,e[45]=a,e[46]=g,e[47]=u,e[48]=n,e[49]=r,e[50]=T,e[51]=p,e[52]=K):K=e[52];let V;e[53]!==h||e[54]!==K?(V=s.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:s.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-auto",children:s.jsx(tt,{children:K},h)})}),e[53]=h,e[54]=K,e[55]=V):V=e[55];let P;return e[56]!==D||e[57]!==A||e[58]!==V?(P=s.jsxs(Dt,{onBack:D,children:[A,V]}),e[56]=D,e[57]=A,e[58]=V,e[59]=P):P=e[59],P}function $s(t){return{id:t.name,label:t.displayName}}function _s(){const t=W.c(29);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/mcps/$connectionId"},t[0]=e):e=t[0];const o=Ce(e);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org/mcps/$connectionId"},t[1]=i):i=t[1];const{connectionId:n,org:c}=xt(i);let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d={from:"/shell/$org/mcps/$connectionId"},t[2]=d):d=t[2];const g=gt(d).tab||"settings",r=Ne(n),p=vt(),S=Nt(r??void 0);let m;t[3]!==n?(m=[n],t[3]=n,t[4]=m):m=t[4];const{promptsMap:C}=Tt(m);let j;t[5]!==n?(j=[n],t[5]=n,t[6]=j):j=t[6];const{resourcesMap:v}=$t(j);let a;t[7]!==n||t[8]!==C?(a=C.get(n)??[],t[7]=n,t[8]=C,t[9]=a):a=t[9];const T=a;let l;t[10]!==n||t[11]!==v?(l=v.get(n)??[],t[10]=n,t[11]=v,t[12]=l):l=t[12];const y=l;let $;t[13]!==p.update||t[14]!==n?($=async b=>{await p.update.mutateAsync({id:n,data:b})},t[13]=p.update,t[14]=n,t[15]=$):$=t[15];const f=$;if(!r){let b;return t[16]!==o||t[17]!==c?(b=s.jsx("div",{className:"flex h-full w-full bg-background",children:s.jsx(H,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:s.jsx(Se,{variant:"outline",onClick:()=>o({to:"/$org/mcps",params:{org:c}}),children:"Back to connections"})})}),t[16]=o,t[17]=c,t[18]=b):b=t[18],b}let L;return t[19]!==p.update.isPending||t[20]!==S||t[21]!==r||t[22]!==n||t[23]!==f||t[24]!==c||t[25]!==T||t[26]!==g||t[27]!==y?(L=s.jsx(Ts,{org:c,connection:r,connectionId:n,requestedTabId:g,collections:S,onUpdate:f,isUpdating:p.update.isPending,prompts:T,resources:y}),t[19]=p.update.isPending,t[20]=S,t[21]=r,t[22]=n,t[23]=f,t[24]=c,t[25]=T,t[26]=g,t[27]=y,t[28]=L):L=t[28],L}function Is(){const t=W.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(tt,{children:s.jsx(U.Suspense,{fallback:s.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:s.jsx(st,{size:32,className:"animate-spin text-muted-foreground"})}),children:s.jsx(_s,{})})}),t[0]=e):e=t[0],e}function _o(){const t=W.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Is,{}),t[0]=e):e=t[0],e}export{_o as default};