@decocms/mesh 2.40.0 → 2.40.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/dist/client/assets/{AlertCircle-BGhlDWk2.js → AlertCircle-BzWtrrJ5.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-DiPZV3an.js → ArrowLeft-DbjxH-TA.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-CxSqAFHI.js → ArrowUp-bzciqS-L.js} +1 -1
  4. package/dist/client/assets/{Check-fIeUq0Tl.js → Check-0BeRG3Sh.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-aJJ6RgWv.js → ChevronDown-DSaGHwzQ.js} +1 -1
  6. package/dist/client/assets/{Code01-Ckl-ddC5.js → Code01-B2alevwS.js} +1 -1
  7. package/dist/client/assets/{Copy01-CdhhOoSD.js → Copy01-CnmNi70D.js} +1 -1
  8. package/dist/client/assets/{CpuChip02-B5a9K48n.js → CpuChip02-wjDh7ig3.js} +1 -1
  9. package/dist/client/assets/{DotsHorizontal-gjRK9bmC.js → DotsHorizontal-DWjq5QvT.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-1JZvMgtG.js → DotsVertical-kAKCLT6g.js} +1 -1
  11. package/dist/client/assets/{Download01-3VU6vngg.js → Download01-jhC_FqkW.js} +1 -1
  12. package/dist/client/assets/{Edit01-F53eAMKI.js → Edit01-Cw7nvLlE.js} +1 -1
  13. package/dist/client/assets/{File06-BpUf605-.js → File06-Di7-0Zhi.js} +1 -1
  14. package/dist/client/assets/{FilterLines-BM5N4VAM.js → FilterLines-B-fhbYYb.js} +1 -1
  15. package/dist/client/assets/{FlipBackward-__aw6tTy.js → FlipBackward-sWClYMgE.js} +1 -1
  16. package/dist/client/assets/{GitBranch01-CphPKbYc.js → GitBranch01-DgvnuUj6.js} +1 -1
  17. package/dist/client/assets/{Grid01-D89OcY09.js → Grid01-BV5dHi3R.js} +1 -1
  18. package/dist/client/assets/{Home02-CvY65VhH.js → Home02-D5m9YGJE.js} +1 -1
  19. package/dist/client/assets/{Image01-DlxjetON.js → Image01-Bidy-9ro.js} +1 -1
  20. package/dist/client/assets/{Inbox01-CxsccOrS.js → Inbox01-C7pMAXQN.js} +1 -1
  21. package/dist/client/assets/{InfoCircle-Bcvi8VQY.js → InfoCircle-BfdTTja1.js} +1 -1
  22. package/dist/client/assets/{Key01-BMhwGxr8.js → Key01-C8fGnb_s.js} +1 -1
  23. package/dist/client/assets/{LinkExternal01-BF9uACMs.js → LinkExternal01-l0m7CCNG.js} +1 -1
  24. package/dist/client/assets/{List-G-H7B3e1.js → List-B-KIt-jD.js} +1 -1
  25. package/dist/client/assets/{Loading01-BOeR2B8B.js → Loading01-BJHzsSlY.js} +1 -1
  26. package/dist/client/assets/{Lock01-Bxcblt1i.js → Lock01-Bchq9Nzc.js} +1 -1
  27. package/dist/client/assets/{Play-BmnNjAyT.js → Play-BfQSNVUe.js} +1 -1
  28. package/dist/client/assets/{Plus-CROcV2-u.js → Plus-DOEL_hbF.js} +1 -1
  29. package/dist/client/assets/{SearchMd-D74Sf-27.js → SearchMd-4iIwSESe.js} +1 -1
  30. package/dist/client/assets/{Terminal-DGXkCDiq.js → Terminal-BBj7QyID.js} +1 -1
  31. package/dist/client/assets/{Trash01-DHhhoDHD.js → Trash01-Wrvcbt0u.js} +1 -1
  32. package/dist/client/assets/{Upload01-C2CuGT1-.js → Upload01-OU5jPfJY.js} +1 -1
  33. package/dist/client/assets/{X-BAy7Mfyd.js → X-CgDprUQG.js} +1 -1
  34. package/dist/client/assets/{XClose-CE5BsdL1.js → XClose-BhLEWkEW.js} +1 -1
  35. package/dist/client/assets/{agent-detail-D2jPAyzE.js → agent-detail-BPiBnkF6.js} +1 -1
  36. package/dist/client/assets/{agents-BnJBjaH8.js → agents-VC4dO1xF.js} +1 -1
  37. package/dist/client/assets/{alert-dialog-DCgyNkDL.js → alert-dialog-BsUKy6x1.js} +1 -1
  38. package/dist/client/assets/{auth-catchall-CFWeOKHi.js → auth-catchall-BMt2K2Y3.js} +1 -1
  39. package/dist/client/assets/{avatar-DyhTRBi5.js → avatar-B2I6mHo7.js} +1 -1
  40. package/dist/client/assets/{badge-BfOFucuW.js → badge-Cg-cVOUM.js} +1 -1
  41. package/dist/client/assets/{binder-D14T3-AY.js → binder-DLTRuBUr.js} +1 -1
  42. package/dist/client/assets/{button-DMKajqX_.js → button-BJ3HWp7I.js} +1 -1
  43. package/dist/client/assets/{card-Cx64whKR.js → card-VfXRHGnT.js} +1 -1
  44. package/dist/client/assets/{checkbox-BCZJI_DJ.js → checkbox-Bd8ffR4d.js} +1 -1
  45. package/dist/client/assets/{circle-alert-CMl9VinB.js → circle-alert-Dns8Lwr3.js} +1 -1
  46. package/dist/client/assets/{collection-detail-p9qkl9qa.js → collection-detail-B7lj3q-_.js} +4 -4
  47. package/dist/client/assets/{collection-display-button-BVh1TgBj.js → collection-display-button-D900xq_7.js} +1 -1
  48. package/dist/client/assets/{collection-header-Dc5LPFVH.js → collection-header-BxJ-Ykas.js} +1 -1
  49. package/dist/client/assets/{collection-page-DGyQ3ZNG.js → collection-page-DgidS8rt.js} +1 -1
  50. package/dist/client/assets/{collection-search-Di76L1bf.js → collection-search-DITQLAqZ.js} +1 -1
  51. package/dist/client/assets/{collection-tab--167XVPq.js → collection-tab-DiAv1BlF.js} +1 -1
  52. package/dist/client/assets/{collection-table-wrapper-DHB_EgNT.js → collection-table-wrapper-CD2w-c2k.js} +1 -1
  53. package/dist/client/assets/{connect-CXcmZCG1.js → connect-DUorlCtw.js} +1 -1
  54. package/dist/client/assets/{connection-card-DQrk1HXS.js → connection-card-BOJTYC0z.js} +1 -1
  55. package/dist/client/assets/{connection-detail-nzhWhLWV.js → connection-detail-GNZd312l.js} +1 -1
  56. package/dist/client/assets/{connections-ByUZtUgd.js → connections-C-D02KTB.js} +1 -1
  57. package/dist/client/assets/{constants-fPyH6C9l.js → constants-BVdHh4aD.js} +1 -1
  58. package/dist/client/assets/constants-ao3kqMSk.js +1 -0
  59. package/dist/client/assets/{create-organization-dialog-D77RxEh5.js → create-organization-dialog-_CXtGha1.js} +1 -1
  60. package/dist/client/assets/{dialog-ztR7gCh9.js → dialog-DsV8m8rX.js} +1 -1
  61. package/dist/client/assets/{dropdown-menu-ClnDILPk.js → dropdown-menu-B1OcMuo7.js} +1 -1
  62. package/dist/client/assets/{dynamic-plugin-layout-A1dILRX9.js → dynamic-plugin-layout-BoThwu5u.js} +1 -1
  63. package/dist/client/assets/{empty-state-bLy612i3.js → empty-state-C1AOcdcD.js} +1 -1
  64. package/dist/client/assets/{empty-state-BnO7A9lc.js → empty-state-mW4i8Pk5.js} +1 -1
  65. package/dist/client/assets/{env-vars-editor-BcnJ-LB5.js → env-vars-editor-f0zQEaJU.js} +1 -1
  66. package/dist/client/assets/{error-boundary-BmoPYDr9.js → error-boundary-BhvmEiaO.js} +1 -1
  67. package/dist/client/assets/{extract-connection-data-BmKY6Xwr.js → extract-connection-data-DeAFFhRc.js} +1 -1
  68. package/dist/client/assets/{file-browser-qwFJR9E8.js → file-browser-Dva-Utu8.js} +2 -2
  69. package/dist/client/assets/{form-ndfdAtTI.js → form-D6hs_qye.js} +1 -1
  70. package/dist/client/assets/{grid-view-BvcNXtON.js → grid-view-CDYOgpOI.js} +1 -1
  71. package/dist/client/assets/{home-BuQVPeAU.js → home-CirnHaZG.js} +1 -1
  72. package/dist/client/assets/{index-Dtt3Ixsj.js → index-98urlcvX.js} +1 -1
  73. package/dist/client/assets/{index-DuakjG98.js → index-D9YoVuZK.js} +1 -1
  74. package/dist/client/assets/{index-B_JsA4Kj.js → index-DFxQb7a9.js} +1 -1
  75. package/dist/client/assets/{index-DZ0WP9Uu.js → index-DHBTmGle.js} +2 -2
  76. package/dist/client/assets/{index-CsefZjgp.js → index-RzZtkQ3Q.js} +1 -1
  77. package/dist/client/assets/{index-C2RcJiSR.js → index-g80C_Gec.js} +1 -1
  78. package/dist/client/assets/{infiniteQueryObserver-BbTATuuq.js → infiniteQueryObserver-8idXPZ5W.js} +1 -1
  79. package/dist/client/assets/{input-B0NJeiuT.js → input-7ruC6uFX.js} +1 -1
  80. package/dist/client/assets/{layout-DfJ4yUAY.js → layout-BNPUEoId.js} +1 -1
  81. package/dist/client/assets/{localstorage-keys-peJWGFoJ.js → localstorage-keys-D6bFEMDt.js} +1 -1
  82. package/dist/client/assets/{login-aZLO4ovp.js → login-CFf8-jXY.js} +1 -1
  83. package/dist/client/assets/{mcp-oauth-pM6hRYfR.js → mcp-oauth-BAnajqJL.js} +1 -1
  84. package/dist/client/assets/{mcp-server-card-DHzfT3Ej.js → mcp-server-card--rrCcr_f.js} +1 -1
  85. package/dist/client/assets/{mcp-server-detail-Bw5soC6_.js → mcp-server-detail-B7slX2RS.js} +2 -2
  86. package/dist/client/assets/{members-7Q8DX6Lb.js → members-cwfclVIm.js} +1 -1
  87. package/dist/client/assets/{monaco-editor-Dv9cb_Fm.js → monaco-editor-GHN1rtUS.js} +1 -1
  88. package/dist/client/assets/{monitoring-BC6v2u5z.js → monitoring-rKA5jDuf.js} +1 -1
  89. package/dist/client/assets/{oauth-callback-Cadz6rw5.js → oauth-callback-CLzmBEx9.js} +1 -1
  90. package/dist/client/assets/{page-BNxkmB8w.js → page-DnuspCox.js} +1 -1
  91. package/dist/client/assets/{page-tk64pthv.js → page-Z84D_p1f.js} +1 -1
  92. package/dist/client/assets/{pin-to-sidebar-button-Cgw1E6xL.js → pin-to-sidebar-button-B9E6PQjp.js} +1 -1
  93. package/dist/client/assets/{plugin-empty-state-BS367vfH.js → plugin-empty-state-BnQmqDTO.js} +1 -1
  94. package/dist/client/assets/{plugin-header-CUs1tx4q.js → plugin-header-C-T4sDQA.js} +1 -1
  95. package/dist/client/assets/{plugins-bBiQTZ8C.js → plugins-BnxfB2J2.js} +1 -1
  96. package/dist/client/assets/{popover-Bz6616No.js → popover-D7YWI5Cf.js} +1 -1
  97. package/dist/client/assets/{registry-utils-CpCQJuef.js → registry-utils-BCHz1L7j.js} +1 -1
  98. package/dist/client/assets/{resizable-DIm_hRMc.js → resizable-06VLRzXj.js} +1 -1
  99. package/dist/client/assets/{resource-tabs-cEMTKUzi.js → resource-tabs-loCNqUq6.js} +1 -1
  100. package/dist/client/assets/{select-2zWNvmE1.js → select-BWkItg_a.js} +1 -1
  101. package/dist/client/assets/{settings-BfF0KNyp.js → settings-DoehzXY3.js} +1 -1
  102. package/dist/client/assets/{shell-layout-hoToOJQP.js → shell-layout-sNHiL105.js} +1 -1
  103. package/dist/client/assets/{spinner-YcNewNcW.js → spinner-DEICAlhU.js} +1 -1
  104. package/dist/client/assets/{switch-C6NVbbW1.js → switch-C6DiRa1B.js} +1 -1
  105. package/dist/client/assets/{textarea-BE-RZN1V.js → textarea-vxMnbGid.js} +1 -1
  106. package/dist/client/assets/{tool-set-selector-CoFCawdz.js → tool-set-selector-CxTiwMI8.js} +1 -1
  107. package/dist/client/assets/{tools-list-DMgjdEKU.js → tools-list-taSvhPFS.js} +1 -1
  108. package/dist/client/assets/{tooltip-CzB50oKO.js → tooltip-BuUNB1mb.js} +1 -1
  109. package/dist/client/assets/{typewriter-title-BGVtH7qI.js → typewriter-title-C6DR7Eze.js} +1 -1
  110. package/dist/client/assets/{use-binding-BhZjQhNo.js → use-binding-C_F3xeC_.js} +1 -1
  111. package/dist/client/assets/{use-collections-Drr6_6fb.js → use-collections-CToBNrWq.js} +1 -1
  112. package/dist/client/assets/{use-connection-Bp7t1xn3.js → use-connection-DAX6ty9k.js} +1 -1
  113. package/dist/client/assets/{use-create-virtual-mcp-OU_v2YUB.js → use-create-virtual-mcp-te-5zxHj.js} +1 -1
  114. package/dist/client/assets/{use-list-state-Zs89S-QA.js → use-list-state-BOP_Nd4C.js} +1 -1
  115. package/dist/client/assets/{use-mcp-prompts-CSWg69Uu.js → use-mcp-prompts-D9dGnuXY.js} +1 -1
  116. package/dist/client/assets/{use-members-CjhBeBkC.js → use-members-D8gXijKr.js} +1 -1
  117. package/dist/client/assets/{use-mobile-BrgiFD7w.js → use-mobile-B7Yc-x5B.js} +1 -1
  118. package/dist/client/assets/{use-organization-settings-BCjNGEBN.js → use-organization-settings--qcz6AHX.js} +1 -1
  119. package/dist/client/assets/{use-virtual-mcp-DQzFD2uZ.js → use-virtual-mcp-CZvW7LdD.js} +1 -1
  120. package/dist/client/assets/useInfiniteQuery-C0JrAp_w.js +1 -0
  121. package/dist/client/assets/{useMutation-BSgCoYc_.js → useMutation-BL6IQ2sq.js} +1 -1
  122. package/dist/client/assets/useQuery-6rF_dd3c.js +1 -0
  123. package/dist/client/assets/{value-Cq0O3NJH.js → value-CXwf_TMX.js} +1 -1
  124. package/dist/client/assets/{view-mode-toggle-BrT5iiCv.js → view-mode-toggle-P81vIwwH.js} +1 -1
  125. package/dist/client/assets/{workflow-DiPsBlj7.js → workflow-B6WGA_r4.js} +1 -1
  126. package/dist/client/index.html +1 -1
  127. package/dist/server/cli.js +2 -2
  128. package/dist/server/migrate.js +2 -2
  129. package/dist/server/server.js +1 -1
  130. package/package.json +1 -1
  131. package/dist/client/assets/constants-BxAQzeE8.js +0 -1
  132. package/dist/client/assets/useInfiniteQuery-CZQ71w-T.js +0 -1
  133. package/dist/client/assets/useQuery-CpAu1eM3.js +0 -1
@@ -1 +1 @@
1
- import{r as j,c as k,j as s}from"./index-DZ0WP9Uu.js";import{c as N,B as C}from"./button-DMKajqX_.js";import{c as y,a as M,D as z,b as D}from"./dropdown-menu-ClnDILPk.js";import{i as S}from"./ArrowUp-CxSqAFHI.js";import{i as T}from"./Check-fIeUq0Tl.js";import{c as E}from"./Grid01-D89OcY09.js";import{i as V}from"./List-G-H7B3e1.js";import{b as _,c as B,T as L,a as $}from"./tooltip-CzB50oKO.js";import{V as W}from"./view-mode-toggle-BrT5iiCv.js";const w=({size:r=24,color:e="currentColor",...o})=>j.createElement("svg",{viewBox:"0 0 24 24",width:r,height:r,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},j.createElement("path",{d:"M12 5v14m0 0 7-7m-7 7-7-7"}));w.displayName="ArrowDown";const b=({size:r=24,color:e="currentColor",...o})=>j.createElement("svg",{viewBox:"0 0 24 24",width:r,height:r,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},j.createElement("path",{d:"M5 21v-7m0-4V3m7 18v-9m0-4V3m7 18v-5m0-4V3M2 14h6m1-6h6m1 8h6"}));b.displayName="Sliders01";function H(r){const e=k.c(16),{viewMode:o,onViewModeChange:g,sortKey:v,sortDirection:n,onSort:l,sortOptions:a}=r;let c;e[0]!==a?(c=a===void 0?[]:a,e[0]=a,e[1]=c):c=e[1];const d=c;let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(_,{children:s.jsxs(B,{children:[s.jsx(L,{asChild:!0,children:s.jsx(M,{asChild:!0,children:s.jsx(C,{variant:"outline",size:"icon",className:"size-7 border border-input",children:s.jsx(b,{size:16})})})}),s.jsx($,{children:"Search filters"})]})}),e[2]=m):m=e[2];let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p={value:"table",icon:s.jsx(V,{})},e[3]=p):p=e[3];let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=[p,{value:"cards",icon:s.jsx(E,{})}],e[4]=h):h=e[4];let t;e[5]!==g||e[6]!==o?(t=s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(W,{value:o,onValueChange:g,fullWidth:!0,options:h})}),e[5]=g,e[6]=o,e[7]=t):t=e[7];let i;e[8]!==l||e[9]!==n||e[10]!==v||e[11]!==d?(i=d.length>0&&l&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),d.map(u=>{const f=v===u.id;return s.jsx(y,{onClick:()=>l(u.id),className:N("h-8 px-2 py-0 cursor-pointer",f&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[f&&s.jsx(T,{size:16,className:"text-foreground shrink-0"}),!f&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:u.label}),f&&n&&(n==="asc"?s.jsx(S,{size:16,className:"text-foreground shrink-0"}):s.jsx(w,{size:16,className:"text-foreground shrink-0"}))]})},u.id)})]}),e[8]=l,e[9]=n,e[10]=v,e[11]=d,e[12]=i):i=e[12];let x;return e[13]!==t||e[14]!==i?(x=s.jsxs(z,{children:[m,s.jsxs(D,{align:"end",className:"w-[200px] p-0 gap-0",children:[t,i]})]}),e[13]=t,e[14]=i,e[15]=x):x=e[15],x}export{H as C,w as n};
1
+ import{r as j,c as k,j as s}from"./index-DHBTmGle.js";import{c as N,B as C}from"./button-BJ3HWp7I.js";import{c as y,a as M,D as z,b as D}from"./dropdown-menu-B1OcMuo7.js";import{i as S}from"./ArrowUp-bzciqS-L.js";import{i as T}from"./Check-0BeRG3Sh.js";import{c as E}from"./Grid01-BV5dHi3R.js";import{i as V}from"./List-B-KIt-jD.js";import{b as _,c as B,T as L,a as $}from"./tooltip-BuUNB1mb.js";import{V as W}from"./view-mode-toggle-P81vIwwH.js";const w=({size:r=24,color:e="currentColor",...o})=>j.createElement("svg",{viewBox:"0 0 24 24",width:r,height:r,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},j.createElement("path",{d:"M12 5v14m0 0 7-7m-7 7-7-7"}));w.displayName="ArrowDown";const b=({size:r=24,color:e="currentColor",...o})=>j.createElement("svg",{viewBox:"0 0 24 24",width:r,height:r,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},j.createElement("path",{d:"M5 21v-7m0-4V3m7 18v-9m0-4V3m7 18v-5m0-4V3M2 14h6m1-6h6m1 8h6"}));b.displayName="Sliders01";function H(r){const e=k.c(16),{viewMode:o,onViewModeChange:g,sortKey:v,sortDirection:n,onSort:l,sortOptions:a}=r;let c;e[0]!==a?(c=a===void 0?[]:a,e[0]=a,e[1]=c):c=e[1];const d=c;let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(_,{children:s.jsxs(B,{children:[s.jsx(L,{asChild:!0,children:s.jsx(M,{asChild:!0,children:s.jsx(C,{variant:"outline",size:"icon",className:"size-7 border border-input",children:s.jsx(b,{size:16})})})}),s.jsx($,{children:"Search filters"})]})}),e[2]=m):m=e[2];let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p={value:"table",icon:s.jsx(V,{})},e[3]=p):p=e[3];let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=[p,{value:"cards",icon:s.jsx(E,{})}],e[4]=h):h=e[4];let t;e[5]!==g||e[6]!==o?(t=s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(W,{value:o,onValueChange:g,fullWidth:!0,options:h})}),e[5]=g,e[6]=o,e[7]=t):t=e[7];let i;e[8]!==l||e[9]!==n||e[10]!==v||e[11]!==d?(i=d.length>0&&l&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),d.map(u=>{const f=v===u.id;return s.jsx(y,{onClick:()=>l(u.id),className:N("h-8 px-2 py-0 cursor-pointer",f&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[f&&s.jsx(T,{size:16,className:"text-foreground shrink-0"}),!f&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:u.label}),f&&n&&(n==="asc"?s.jsx(S,{size:16,className:"text-foreground shrink-0"}):s.jsx(w,{size:16,className:"text-foreground shrink-0"}))]})},u.id)})]}),e[8]=l,e[9]=n,e[10]=v,e[11]=d,e[12]=i):i=e[12];let x;return e[13]!==t||e[14]!==i?(x=s.jsxs(z,{children:[m,s.jsxs(D,{align:"end",className:"w-[200px] p-0 gap-0",children:[t,i]})]}),e[13]=t,e[14]=i,e[15]=x):x=e[15],x}export{H as C,w as n};
@@ -1 +1 @@
1
- import{c as v,j as l}from"./index-DZ0WP9Uu.js";import{C as b}from"./collection-display-button-BVh1TgBj.js";function w(g){const e=v.c(20),{title:r,viewMode:n,onViewModeChange:c,sortKey:f,sortDirection:x,onSort:p,sortOptions:a,ctaButton:h,leftElement:u}=g;let m;e[0]!==a?(m=a===void 0?[]:a,e[0]=a,e[1]=m):m=e[1];const j=m;let t;e[2]!==r?(t=typeof r=="string"?l.jsx("h1",{className:"text-sm font-medium text-foreground",children:r}):r,e[2]=r,e[3]=t):t=e[3];let s;e[4]!==u||e[5]!==t?(s=l.jsxs("div",{className:"flex items-center gap-2",children:[u,t]}),e[4]=u,e[5]=t,e[6]=s):s=e[6];let i;e[7]!==p||e[8]!==c||e[9]!==x||e[10]!==f||e[11]!==j||e[12]!==n?(i=n&&c&&l.jsx(b,{viewMode:n,onViewModeChange:c,sortKey:f,sortDirection:x,onSort:p,sortOptions:j}),e[7]=p,e[8]=c,e[9]=x,e[10]=f,e[11]=j,e[12]=n,e[13]=i):i=e[13];let o;e[14]!==h||e[15]!==i?(o=l.jsxs("div",{className:"flex items-center gap-2",children:[i,h]}),e[14]=h,e[15]=i,e[16]=o):o=e[16];let d;return e[17]!==s||e[18]!==o?(d=l.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:l.jsxs("div",{className:"flex items-center justify-between gap-3 h-12 px-4",children:[s,o]})}),e[17]=s,e[18]=o,e[19]=d):d=e[19],d}export{w as C};
1
+ import{c as v,j as l}from"./index-DHBTmGle.js";import{C as b}from"./collection-display-button-D900xq_7.js";function w(g){const e=v.c(20),{title:r,viewMode:n,onViewModeChange:c,sortKey:f,sortDirection:x,onSort:p,sortOptions:a,ctaButton:h,leftElement:u}=g;let m;e[0]!==a?(m=a===void 0?[]:a,e[0]=a,e[1]=m):m=e[1];const j=m;let t;e[2]!==r?(t=typeof r=="string"?l.jsx("h1",{className:"text-sm font-medium text-foreground",children:r}):r,e[2]=r,e[3]=t):t=e[3];let s;e[4]!==u||e[5]!==t?(s=l.jsxs("div",{className:"flex items-center gap-2",children:[u,t]}),e[4]=u,e[5]=t,e[6]=s):s=e[6];let i;e[7]!==p||e[8]!==c||e[9]!==x||e[10]!==f||e[11]!==j||e[12]!==n?(i=n&&c&&l.jsx(b,{viewMode:n,onViewModeChange:c,sortKey:f,sortDirection:x,onSort:p,sortOptions:j}),e[7]=p,e[8]=c,e[9]=x,e[10]=f,e[11]=j,e[12]=n,e[13]=i):i=e[13];let o;e[14]!==h||e[15]!==i?(o=l.jsxs("div",{className:"flex items-center gap-2",children:[i,h]}),e[14]=h,e[15]=i,e[16]=o):o=e[16];let d;return e[17]!==s||e[18]!==o?(d=l.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:l.jsxs("div",{className:"flex items-center justify-between gap-3 h-12 px-4",children:[s,o]})}),e[17]=s,e[18]=o,e[19]=d):d=e[19],d}export{w as C};
@@ -1 +1 @@
1
- import{c as s,j as c}from"./index-DZ0WP9Uu.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-DHBTmGle.js";function r(t){const e=s.c(2),{children:l}=t;let o;return e[0]!==l?(o=c.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden",children:l}),e[0]=l,e[1]=o):o=e[1],o}export{r as C};
@@ -1 +1 @@
1
- import{c as g,j as a}from"./index-DZ0WP9Uu.js";import{i as b}from"./Loading01-BOeR2B8B.js";import{i as j}from"./SearchMd-D74Sf-27.js";import{I as N}from"./input-B0NJeiuT.js";import{c as v}from"./button-DMKajqX_.js";function E(h){const e=g.c(17),{value:n,onChange:c,placeholder:x,onKeyDown:m,className:f,isSearching:d}=h,p=x===void 0?"Search...":x;let s;e[0]!==f?(s=v("shrink-0 w-full border-b border-border h-12",f),e[0]=f,e[1]=s):s=e[1];let t;e[2]!==d?(t=d?a.jsx(b,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):a.jsx(j,{size:16,className:"text-muted-foreground shrink-0"}),e[2]=d,e[3]=t):t=e[3];let r;e[4]!==c?(r=u=>c(u.target.value),e[4]=c,e[5]=r):r=e[5];let o;e[6]!==m||e[7]!==p||e[8]!==r||e[9]!==n?(o=a.jsx(N,{value:n,onChange:r,onKeyDown:m,placeholder:p,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[6]=m,e[7]=p,e[8]=r,e[9]=n,e[10]=o):o=e[10];let l;e[11]!==t||e[12]!==o?(l=a.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 cursor-text",children:[t,o]}),e[11]=t,e[12]=o,e[13]=l):l=e[13];let i;return e[14]!==s||e[15]!==l?(i=a.jsx("div",{className:s,children:l}),e[14]=s,e[15]=l,e[16]=i):i=e[16],i}export{E as C};
1
+ import{c as g,j as a}from"./index-DHBTmGle.js";import{i as b}from"./Loading01-BJHzsSlY.js";import{i as j}from"./SearchMd-4iIwSESe.js";import{I as N}from"./input-7ruC6uFX.js";import{c as v}from"./button-BJ3HWp7I.js";function E(h){const e=g.c(17),{value:n,onChange:c,placeholder:x,onKeyDown:m,className:f,isSearching:d}=h,p=x===void 0?"Search...":x;let s;e[0]!==f?(s=v("shrink-0 w-full border-b border-border h-12",f),e[0]=f,e[1]=s):s=e[1];let t;e[2]!==d?(t=d?a.jsx(b,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):a.jsx(j,{size:16,className:"text-muted-foreground shrink-0"}),e[2]=d,e[3]=t):t=e[3];let r;e[4]!==c?(r=u=>c(u.target.value),e[4]=c,e[5]=r):r=e[5];let o;e[6]!==m||e[7]!==p||e[8]!==r||e[9]!==n?(o=a.jsx(N,{value:n,onChange:r,onKeyDown:m,placeholder:p,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[6]=m,e[7]=p,e[8]=r,e[9]=n,e[10]=o):o=e[10];let l;e[11]!==t||e[12]!==o?(l=a.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 cursor-text",children:[t,o]}),e[11]=t,e[12]=o,e[13]=l):l=e[13];let i;return e[14]!==s||e[15]!==l?(i=a.jsx("div",{className:s,children:l}),e[14]=s,e[15]=l,e[16]=i):i=e[16],i}export{E as C};
@@ -1 +1 @@
1
- import{c as ne,j as t,u as Ve,K as rt,f as at,bg as ct,e as dt,r as mt,a8 as ft}from"./index-DZ0WP9Uu.js";import{g as Ue}from"./generate-id-Dyweu44Y.js";import{C as qe}from"./collection-display-button-BVh1TgBj.js";import{C as ut}from"./collection-search-Di76L1bf.js";import{C as pt}from"./card-Cx64whKR.js";import{I as Ge,E as ht}from"./empty-state-BnO7A9lc.js";import{D as We,a as He,b as Je,c as F}from"./dropdown-menu-ClnDILPk.js";import{B as ke,c as Oe}from"./button-DMKajqX_.js";import{a as Qe}from"./Copy01-CdhhOoSD.js";import{i as Ye}from"./DotsVertical-1JZvMgtG.js";import{i as Xe}from"./Edit01-F53eAMKI.js";import{s as Ze,u as xt}from"./use-list-state-Zs89S-QA.js";import{s as et}from"./Trash01-DHhhoDHD.js";import{C as gt}from"./collection-table-wrapper-DHB_EgNT.js";import{E as Le}from"./empty-state-bLy612i3.js";import{n as Be}from"./Inbox01-CxsccOrS.js";import{A as Me}from"./avatar-DyhTRBi5.js";import{u as jt}from"./useQuery-CpAu1eM3.js";import{a as Ct,u as tt}from"./constants-fPyH6C9l.js";import{P as vt}from"./pin-to-sidebar-button-Cgw1E6xL.js";import{u as bt,b as yt}from"./use-collections-Drr6_6fb.js";import{u as Nt}from"./use-connection-Bp7t1xn3.js";import{B as wt}from"./constants-BxAQzeE8.js";import{A as St,g as _t,c as Dt,b as At,d as It,e as Pt,a as Tt,f as $t}from"./alert-dialog-DCgyNkDL.js";import{s as Et}from"./Plus-CROcV2-u.js";import{V as zt}from"./layout-DfJ4yUAY.js";function Ot(n,e){const s=n.properties||{};for(const o in s){const l=s[o];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&o in e&&e[o])return e[o]}const c=["image","img","avatar","icon","logo","thumbnail","cover"];for(const o of c)if(e&&typeof e=="object"&&o in e&&typeof e[o]=="string")return e[o]}function Mt(n){const e=ne.c(25),{item:s,schema:c,actions:o}=n;let l;e[0]!==s||e[1]!==c?(l=Ot(c,s),e[0]=s,e[1]=c,e[2]=l):l=e[2];const r=l,d=s&&typeof s=="object"&&"description"in s&&typeof s.description=="string"?s.description:void 0;let f;e[3]!==o?(f=o&&Object.keys(o).length>0,e[3]=o,e[4]=f):f=e[4];const i=f;let u;e[5]!==r||e[6]!==s.title?(u=t.jsx(Ge,{icon:r,name:s.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=r,e[6]=s.title,e[7]=u):u=e[7];let g;e[8]!==s.title?(g=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=g):g=e[9];const h=d||"No description";let m;e[10]!==h?(m=t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:h}),e[10]=h,e[11]=m):m=e[11];let x;e[12]!==g||e[13]!==m?(x=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[g,m]}),e[12]=g,e[13]=m,e[14]=x):x=e[14];let y;e[15]!==u||e[16]!==x?(y=t.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[u,x]}),e[15]=u,e[16]=x,e[17]=y):y=e[17];let v;e[18]!==o||e[19]!==i||e[20]!==s?(v=i&&t.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:Ut,onMouseDown:Kt,children:t.jsxs(We,{children:[t.jsx(He,{asChild:!0,children:t.jsx(ke,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Ft,children:t.jsx(Ye,{size:20})})}),t.jsxs(Je,{align:"end",onClick:kt,children:[o.open&&t.jsxs(F,{onClick:p=>{p.stopPropagation(),o.open?.(s)},children:[t.jsx(Ze,{size:16}),"Open"]}),o.edit&&t.jsxs(F,{onClick:p=>{p.stopPropagation(),o.edit?.(s)},children:[t.jsx(Xe,{size:16}),"Edit"]}),o.duplicate&&t.jsxs(F,{onClick:p=>{p.stopPropagation(),o.duplicate?.(s)},children:[t.jsx(Qe,{size:16}),"Duplicate"]}),o.delete&&t.jsxs(F,{variant:"destructive",onClick:p=>{p.stopPropagation(),o.delete?.(s)},children:[t.jsx(et,{size:16}),"Delete"]})]})]})}),e[18]=o,e[19]=i,e[20]=s,e[21]=v):v=e[21];let N;return e[22]!==y||e[23]!==v?(N=t.jsxs(pt,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[y,v]}),e[22]=y,e[23]=v,e[24]=N):N=e[24],N}function kt(n){return n.stopPropagation()}function Ft(n){return n.stopPropagation()}function Kt(n){return n.stopPropagation()}function Ut(n){return n.stopPropagation()}function Lt(n){const e=ne.c(11),{org:s}=Ve();let c;e[0]!==s.id?(c={connectionId:Ct,orgId:s.id},e[0]=s.id,e[1]=c):c=e[1];const o=tt(c);let l;e[2]!==n?(l=rt.user(n),e[2]=n,e[3]=l):l=e[3];let r;e[4]!==o||e[5]!==n?(r=async()=>{const i=await o.callTool({name:"USER_GET",arguments:{id:n}});return(i.structuredContent??i).user},e[4]=o,e[5]=n,e[6]=r):r=e[6];const d=!!n;let f;return e[7]!==l||e[8]!==r||e[9]!==d?(f={queryKey:l,queryFn:r,staleTime:3e5,retry:1,enabled:d},e[7]=l,e[8]=r,e[9]=d,e[10]=f):f=e[10],jt(f)}function Bt(n){const e=ne.c(39),{id:s,size:c,showEmail:o,className:l}=n,r=c===void 0?"xs":c,d=o===void 0?!1:o,{data:f,isLoading:i,isError:u}=Lt(s);if(i){let p;e[0]!==l?(p=Oe("flex items-center gap-2",l),e[0]=l,e[1]=p):p=e[1];let a;e[2]!==r?(a=t.jsx(Me.Skeleton,{shape:"circle",size:r}),e[2]=r,e[3]=a):a=e[3];let b;e[4]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{className:"h-3 w-24 bg-muted animate-pulse rounded"}),e[4]=b):b=e[4];let j;e[5]!==d?(j=d&&t.jsx("div",{className:"h-2 w-32 bg-muted animate-pulse rounded"}),e[5]=d,e[6]=j):j=e[6];let C;e[7]!==j?(C=t.jsxs("div",{className:"flex flex-col gap-1",children:[b,j]}),e[7]=j,e[8]=C):C=e[8];let _;return e[9]!==p||e[10]!==a||e[11]!==C?(_=t.jsxs("div",{className:p,children:[a,C]}),e[9]=p,e[10]=a,e[11]=C,e[12]=_):_=e[12],_}if(u||!f){let p;e[13]!==l?(p=Oe("flex items-center gap-2",l),e[13]=l,e[14]=p):p=e[14];let a;e[15]!==r?(a=t.jsx(Me,{shape:"circle",size:r,fallback:"?",muted:!0}),e[15]=r,e[16]=a):a=e[16];let b;e[17]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{className:"flex flex-col",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Unknown User"})}),e[17]=b):b=e[17];let j;return e[18]!==p||e[19]!==a?(j=t.jsxs("div",{className:p,children:[a,b]}),e[18]=p,e[19]=a,e[20]=j):j=e[20],j}let g;e[21]!==l?(g=Oe("flex items-center gap-2",l),e[21]=l,e[22]=g):g=e[22];const h=f.image??void 0;let m;e[23]!==r||e[24]!==h||e[25]!==f.name?(m=t.jsx(Me,{shape:"circle",size:r,url:h,fallback:f.name}),e[23]=r,e[24]=h,e[25]=f.name,e[26]=m):m=e[26];let x;e[27]!==f.name?(x=t.jsx("div",{className:"text-sm font-medium",children:f.name}),e[27]=f.name,e[28]=x):x=e[28];let y;e[29]!==d||e[30]!==f.email?(y=d&&t.jsx("div",{className:"text-xs text-muted-foreground",children:f.email}),e[29]=d,e[30]=f.email,e[31]=y):y=e[31];let v;e[32]!==x||e[33]!==y?(v=t.jsxs("div",{className:"flex flex-col",children:[x,y]}),e[32]=x,e[33]=y,e[34]=v):v=e[34];let N;return e[35]!==g||e[36]!==m||e[37]!==v?(N=t.jsxs("div",{className:g,children:[m,v]}),e[35]=g,e[36]=m,e[37]=v,e[38]=N):N=e[38],N}const Rt=["icon","avatar","logo"],Re=["created_at","created_by","id"];function Vt(n){return Object.keys(n).find(e=>Rt.includes(e.toLowerCase()))}function st(n,e){return Object.keys(n.properties||{}).filter(s=>["id","created_at","updated_at","created_by","updated_by"].includes(s)?!1:e?e.includes(s):!0).map(s=>({id:s,label:s.charAt(0).toUpperCase()+s.slice(1).replace(/_/g," ")}))}function qt(n){const e=ne.c(32),{data:s,schema:c,viewMode:o,onViewModeChange:l,search:r,sortKey:d,sortDirection:f,onSort:i,actions:u,onItemClick:g,headerActions:h,emptyState:m,readOnly:x,columns:y,hideToolbar:v,sortableFields:N}=n,p=l===void 0?Qt:l,a=f===void 0?"asc":f,b=i===void 0?Jt:i;let j;e[0]!==u?(j=u===void 0?{}:u,e[0]=u,e[1]=j):j=e[1];const C=j,_=g===void 0?Ht:g,D=h===void 0?null:h,P=m===void 0?null:m,E=x===void 0?!1:x,A=y===void 0?void 0:y,I=v===void 0?!1:v,S=N===void 0?void 0:N;let M;e[2]!==A||e[3]!==c||e[4]!==S?(M=A?A.filter(Wt).filter(O=>!S||S.includes(O.id)).map(Gt):st(c,S),e[2]=A,e[3]=c,e[4]=S,e[5]=M):M=e[5];const k=M;let z;e[6]!==D||e[7]!==I||e[8]!==b||e[9]!==p||e[10]!==a||e[11]!==d||e[12]!==k||e[13]!==o?(z=!I&&t.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:t.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[t.jsx("div",{className:"flex items-center gap-2 flex-1",children:D}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(qe,{viewMode:o,onViewModeChange:p,sortKey:d,sortDirection:a,onSort:b,sortOptions:k})})]})}),e[6]=D,e[7]=I,e[8]=b,e[9]=p,e[10]=a,e[11]=d,e[12]=k,e[13]=o,e[14]=z):z=e[14];let T;e[15]!==C||e[16]!==A||e[17]!==s||e[18]!==P||e[19]!==_||e[20]!==b||e[21]!==E||e[22]!==c||e[23]!==r||e[24]!==a||e[25]!==d||e[26]!==S||e[27]!==o?(T=o==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:s.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:P||t.jsx(Le,{icon:t.jsx(Be,{size:36,className:"text-muted-foreground"}),title:"No items found",description:r?"Try adjusting your search":"No items to display"})}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:s.map(O=>t.jsx("div",{onClick:()=>_?.(O),className:"cursor-pointer h-full",children:t.jsx(Mt,{item:O,schema:c,readOnly:E,actions:C})},O.id))})}):t.jsx(gt,{columns:Zt(A,c,S,C),data:s,sortKey:d,sortDirection:a,onSort:b,onRowClick:_,emptyState:P||t.jsx(Le,{icon:t.jsx(Be,{size:36,className:"text-muted-foreground"}),title:"No items found",description:r?"Try adjusting your search":"No items to display"})}),e[15]=C,e[16]=A,e[17]=s,e[18]=P,e[19]=_,e[20]=b,e[21]=E,e[22]=c,e[23]=r,e[24]=a,e[25]=d,e[26]=S,e[27]=o,e[28]=T):T=e[28];let $;return e[29]!==z||e[30]!==T?($=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[z,T]}),e[29]=z,e[30]=T,e[31]=$):$=e[31],$}function Gt(n){return{id:n.id,label:typeof n.header=="string"?n.header:n.id}}function Wt(n){return n.sortable!==!1}function Ht(){}function Jt(){}function Qt(){}function Yt(n){return{id:"actions",header:"",render:e=>t.jsxs(We,{children:[t.jsx(He,{asChild:!0,children:t.jsx(ke,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:t.jsx(Ye,{size:20})})}),t.jsxs(Je,{align:"end",onClick:s=>s.stopPropagation(),children:[n.open&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.open?.(e)},children:[t.jsx(Ze,{size:16}),"Open"]}),n.edit&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.edit?.(e)},children:[t.jsx(Xe,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.duplicate?.(e)},children:[t.jsx(Qe,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(F,{variant:"destructive",onClick:s=>{s.stopPropagation(),n.delete?.(e)},children:[t.jsx(et,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function it(n){const e=n.type;return Array.isArray(e)?e.every(s=>it({type:s})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function Xt(n,e){const s=n.properties||{},c=Object.keys(s).filter(i=>{const u=s[i];return u&&it(u)}),o=Vt(s),l=[],r=new Set;o&&c.includes(o)&&(l.push(o),r.add(o));const d=["title","description","updated_at","updated_by"];for(const i of d)c.includes(i)&&!r.has(i)&&(l.push(i),r.add(i));const f=c.filter(i=>!r.has(i)&&!Re.includes(i)).sort((i,u)=>i.localeCompare(u));for(const i of f)l.push(i),r.add(i);for(const i of Re)c.includes(i)&&!r.has(i)&&(l.push(i),r.add(i));return l.map(i=>{const u=s[i],g=e?e.includes(i):!["id"].includes(i);return i===o?{id:i,header:"",render:h=>{const m=h[i];return t.jsx(Ge,{icon:m,name:h.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:i==="description"?{id:i,header:"Description",render:h=>{const m=h[i];return m==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(m)})},sortable:g,cellClassName:"max-w-[50ch]"}:i==="created_by"||i==="updated_by"?{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m?t.jsx(Bt,{id:String(m),size:"xs"}):"—"},sortable:g,cellClassName:"max-w-[250px]"}:u?.format==="date-time"||i.endsWith("_at")?{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m?t.jsx("span",{className:"block truncate max-w-full",children:new Date(m).toLocaleDateString()}):"—"},sortable:g,cellClassName:"max-w-[200px]"}:{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(m)})},sortable:g,cellClassName:"max-w-[200px]"}})}function Zt(n,e,s,c){const o=n||Xt(e,s);return o.some(d=>d.id==="actions")?o:Object.keys(c).length>0?[...o,Yt(c)]:o}function Ds(n){const e=ne.c(118),{connectionId:s,org:c,activeCollection:o}=n,l=o.name,r=o.schema??wt,d=o.hasCreateTool,f=o.hasUpdateTool,i=o.hasDeleteTool,u=at(),h=ct().location.href,{data:m}=dt.useSession(),x=m?.user?.id||"unknown",y=Nt(s),{org:v}=Ve();let N;e[0]!==s||e[1]!==v.id?(N={connectionId:s,orgId:v.id},e[0]=s,e[1]=v.id,e[2]=N):N=e[2];const p=tt(N),a=bt(s,l,p),b=`${s}-${l}`;let j;e[3]!==c||e[4]!==b?(j={namespace:c,resource:b,defaultSortKey:"updated_at"},e[3]=c,e[4]=b,e[5]=j):j=e[5];const{search:C,searchTerm:_,setSearch:D,viewMode:P,setViewMode:E,sortKey:A,sortDirection:I,handleSort:S}=xt(j);let M;e[6]!==_||e[7]!==I||e[8]!==A?(M={searchTerm:_,sortKey:A,sortDirection:I},e[6]=_,e[7]=I,e[8]=A,e[9]=M):M=e[9];const k=yt(s,l,p,M),z=!d&&!f&&!i;let T;e[10]!==l||e[11]!==s||e[12]!==u||e[13]!==c?(T=w=>{u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:c,connectionId:s,collectionName:l,itemId:w.id}})},e[10]=l,e[11]=s,e[12]=u,e[13]=c,e[14]=T):T=e[14];const $=T;let O;e[15]!==a.create||e[16]!==x?(O=async w=>{const he=new Date().toISOString();await a.create.mutateAsync({...w,id:Ue("conn"),title:`${w.title} (Copy)`,created_at:he,updated_at:he,created_by:x,updated_by:x})},e[15]=a.create,e[16]=x,e[17]=O):O=e[17];const xe=O,[K,ge]=mt.useState(null);let le;e[18]===Symbol.for("react.memo_cache_sentinel")?(le=w=>{ge(w)},e[18]=le):le=e[18];const ot=le;let U;e[19]!==$||e[20]!==f?(U=f&&{edit:$},e[19]=$,e[20]=f,e[21]=U):U=e[21];let L;e[22]!==xe||e[23]!==d?(L=d&&{duplicate:xe},e[22]=xe,e[23]=d,e[24]=L):L=e[24];let B;e[25]!==i?(B=i&&{delete:ot},e[25]=i,e[26]=B):B=e[26];let re;e[27]!==B||e[28]!==U||e[29]!==L?(re={...U,...L,...B},e[27]=B,e[28]=U,e[29]=L,e[30]=re):re=e[30];const je=re;let ae;e[31]!==a.delete||e[32]!==K?(ae=async()=>{K&&(await a.delete.mutateAsync(K.id),ge(null))},e[31]=a.delete,e[32]=K,e[33]=ae):ae=e[33];const Ce=ae;let ce;e[34]!==a.create||e[35]!==l||e[36]!==s||e[37]!==d||e[38]!==u||e[39]!==c||e[40]!==x?(ce=async()=>{if(!d){ft.error("Create operation is not available for this collection");return}const w=new Date().toISOString(),he={id:Ue("conn"),title:"New Item",description:"A brief description of the item",created_at:w,updated_at:w,created_by:x,updated_by:x};try{const ze=await a.create.mutateAsync(he);u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:c,connectionId:s,collectionName:l,itemId:ze.id}})}catch(ze){console.error("Failed to create item:",ze)}},e[34]=a.create,e[35]=l,e[36]=s,e[37]=d,e[38]=u,e[39]=c,e[40]=x,e[41]=ce):ce=e[41];const ve=ce;let de;e[42]!==r?(de=st(r),e[42]=r,e[43]=de):de=e[43];const be=de,Fe=(k?.length??0)>0,nt=d&&Fe,lt=d&&!Fe&&!C;let me;e[44]!==a.create||e[45]!==ve||e[46]!==d?(me=d?t.jsxs(ke,{onClick:ve,size:"sm",disabled:a.create.isPending,className:"h-7",children:[t.jsx(Et,{className:"mr-2 h-4 w-4"}),a.create.isPending?"Creating...":"Create"]}):null,e[44]=a.create,e[45]=ve,e[46]=d,e[47]=me):me=e[47];const Ke=me,ye=A;let R;e[48]!==S||e[49]!==E||e[50]!==I||e[51]!==be||e[52]!==ye||e[53]!==P?(R=t.jsx(qe,{viewMode:P,onViewModeChange:E,sortKey:ye,sortDirection:I,onSort:S,sortOptions:be}),e[48]=S,e[49]=E,e[50]=I,e[51]=be,e[52]=ye,e[53]=P,e[54]=R):R=e[54];const Ne=`${l}s`,we=y?.icon??"grid_view";let V;e[55]!==Ne||e[56]!==we||e[57]!==h?(V=t.jsx(vt,{title:Ne,url:h,icon:we}),e[55]=Ne,e[56]=we,e[57]=h,e[58]=V):V=e[58];const Se=nt&&Ke;let q;e[59]!==R||e[60]!==V||e[61]!==Se?(q=t.jsxs(zt,{children:[R,V,Se]}),e[59]=R,e[60]=V,e[61]=Se,e[62]=q):q=e[62];const _e=`Search ${l}...`;let G;e[63]!==D?(G=w=>{w.key==="Escape"&&(D(""),w.target.blur())},e[63]=D,e[64]=G):G=e[64];let W;e[65]!==C||e[66]!==D||e[67]!==_e||e[68]!==G?(W=t.jsx(ut,{value:C,onChange:D,placeholder:_e,onKeyDown:G}),e[65]=C,e[66]=D,e[67]=_e,e[68]=G,e[69]=W):W=e[69];let H;e[70]!==k?(H=k??[],e[70]=k,e[71]=H):H=e[71];const De=A;let J;e[72]!==$?(J=w=>$(w),e[72]=$,e[73]=J):J=e[73];const Ae="No items found",Ie=C?"Try adjusting your search terms":"This collection doesn't have any items yet.",Pe=lt?Ke:void 0;let Q;e[74]!==Ae||e[75]!==Ie||e[76]!==Pe?(Q=t.jsx(ht,{image:null,title:Ae,description:Ie,actions:Pe}),e[74]=Ae,e[75]=Ie,e[76]=Pe,e[77]=Q):Q=e[77];let Y;e[78]!==S||e[79]!==z||e[80]!==je||e[81]!==r||e[82]!==C||e[83]!==D||e[84]!==E||e[85]!==I||e[86]!==H||e[87]!==De||e[88]!==J||e[89]!==Q||e[90]!==P?(Y=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(qt,{hideToolbar:!0,data:H,schema:r,viewMode:P,onViewModeChange:E,search:C,onSearchChange:D,sortKey:De,sortDirection:I,onSort:S,actions:je,onItemClick:J,readOnly:z,emptyState:Q})}),e[78]=S,e[79]=z,e[80]=je,e[81]=r,e[82]=C,e[83]=D,e[84]=E,e[85]=I,e[86]=H,e[87]=De,e[88]=J,e[89]=Q,e[90]=P,e[91]=Y):Y=e[91];let X;e[92]!==W||e[93]!==Y?(X=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[W,Y]}),e[92]=W,e[93]=Y,e[94]=X):X=e[94];const Te=!!K;let fe;e[95]===Symbol.for("react.memo_cache_sentinel")?(fe=w=>{w||ge(null)},e[95]=fe):fe=e[95];let ue;e[96]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(Dt,{children:"Delete item?"}),e[96]=ue):ue=e[96];const $e=K?.title;let Z;e[97]!==$e?(Z=t.jsxs(At,{children:[ue,t.jsxs(It,{children:['Are you sure you want to delete "',$e,'"? This action cannot be undone.']})]}),e[97]=$e,e[98]=Z):Z=e[98];let ee;e[99]!==a.delete.isPending?(ee=t.jsx(St,{disabled:a.delete.isPending,children:"Cancel"}),e[99]=a.delete.isPending,e[100]=ee):ee=e[100];const Ee=a.delete.isPending?"Deleting...":"Delete";let te;e[101]!==a.delete.isPending||e[102]!==Ce||e[103]!==Ee?(te=t.jsx(_t,{onClick:Ce,disabled:a.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ee}),e[101]=a.delete.isPending,e[102]=Ce,e[103]=Ee,e[104]=te):te=e[104];let se;e[105]!==ee||e[106]!==te?(se=t.jsxs(Pt,{children:[ee,te]}),e[105]=ee,e[106]=te,e[107]=se):se=e[107];let ie;e[108]!==Z||e[109]!==se?(ie=t.jsxs(Tt,{children:[Z,se]}),e[108]=Z,e[109]=se,e[110]=ie):ie=e[110];let oe;e[111]!==Te||e[112]!==ie?(oe=t.jsx($t,{open:Te,onOpenChange:fe,children:ie}),e[111]=Te,e[112]=ie,e[113]=oe):oe=e[113];let pe;return e[114]!==q||e[115]!==X||e[116]!==oe?(pe=t.jsxs(t.Fragment,{children:[q,X,oe]}),e[114]=q,e[115]=X,e[116]=oe,e[117]=pe):pe=e[117],pe}export{Ds as C};
1
+ import{c as ne,j as t,u as Ve,K as rt,f as at,bg as ct,e as dt,r as mt,a8 as ft}from"./index-DHBTmGle.js";import{g as Ue}from"./generate-id-Dyweu44Y.js";import{C as qe}from"./collection-display-button-D900xq_7.js";import{C as ut}from"./collection-search-DITQLAqZ.js";import{C as pt}from"./card-VfXRHGnT.js";import{I as Ge,E as ht}from"./empty-state-mW4i8Pk5.js";import{D as We,a as He,b as Je,c as F}from"./dropdown-menu-B1OcMuo7.js";import{B as ke,c as Oe}from"./button-BJ3HWp7I.js";import{a as Qe}from"./Copy01-CnmNi70D.js";import{i as Ye}from"./DotsVertical-kAKCLT6g.js";import{i as Xe}from"./Edit01-Cw7nvLlE.js";import{s as Ze,u as xt}from"./use-list-state-BOP_Nd4C.js";import{s as et}from"./Trash01-Wrvcbt0u.js";import{C as gt}from"./collection-table-wrapper-CD2w-c2k.js";import{E as Le}from"./empty-state-C1AOcdcD.js";import{n as Be}from"./Inbox01-C7pMAXQN.js";import{A as Me}from"./avatar-B2I6mHo7.js";import{u as jt}from"./useQuery-6rF_dd3c.js";import{a as Ct,u as tt}from"./constants-BVdHh4aD.js";import{P as vt}from"./pin-to-sidebar-button-B9E6PQjp.js";import{u as bt,b as yt}from"./use-collections-CToBNrWq.js";import{u as Nt}from"./use-connection-DAX6ty9k.js";import{B as wt}from"./constants-ao3kqMSk.js";import{A as St,g as _t,c as Dt,b as At,d as It,e as Pt,a as Tt,f as $t}from"./alert-dialog-BsUKy6x1.js";import{s as Et}from"./Plus-DOEL_hbF.js";import{V as zt}from"./layout-BNPUEoId.js";function Ot(n,e){const s=n.properties||{};for(const o in s){const l=s[o];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&o in e&&e[o])return e[o]}const c=["image","img","avatar","icon","logo","thumbnail","cover"];for(const o of c)if(e&&typeof e=="object"&&o in e&&typeof e[o]=="string")return e[o]}function Mt(n){const e=ne.c(25),{item:s,schema:c,actions:o}=n;let l;e[0]!==s||e[1]!==c?(l=Ot(c,s),e[0]=s,e[1]=c,e[2]=l):l=e[2];const r=l,d=s&&typeof s=="object"&&"description"in s&&typeof s.description=="string"?s.description:void 0;let f;e[3]!==o?(f=o&&Object.keys(o).length>0,e[3]=o,e[4]=f):f=e[4];const i=f;let u;e[5]!==r||e[6]!==s.title?(u=t.jsx(Ge,{icon:r,name:s.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=r,e[6]=s.title,e[7]=u):u=e[7];let g;e[8]!==s.title?(g=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=g):g=e[9];const h=d||"No description";let m;e[10]!==h?(m=t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:h}),e[10]=h,e[11]=m):m=e[11];let x;e[12]!==g||e[13]!==m?(x=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[g,m]}),e[12]=g,e[13]=m,e[14]=x):x=e[14];let y;e[15]!==u||e[16]!==x?(y=t.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[u,x]}),e[15]=u,e[16]=x,e[17]=y):y=e[17];let v;e[18]!==o||e[19]!==i||e[20]!==s?(v=i&&t.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:Ut,onMouseDown:Kt,children:t.jsxs(We,{children:[t.jsx(He,{asChild:!0,children:t.jsx(ke,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Ft,children:t.jsx(Ye,{size:20})})}),t.jsxs(Je,{align:"end",onClick:kt,children:[o.open&&t.jsxs(F,{onClick:p=>{p.stopPropagation(),o.open?.(s)},children:[t.jsx(Ze,{size:16}),"Open"]}),o.edit&&t.jsxs(F,{onClick:p=>{p.stopPropagation(),o.edit?.(s)},children:[t.jsx(Xe,{size:16}),"Edit"]}),o.duplicate&&t.jsxs(F,{onClick:p=>{p.stopPropagation(),o.duplicate?.(s)},children:[t.jsx(Qe,{size:16}),"Duplicate"]}),o.delete&&t.jsxs(F,{variant:"destructive",onClick:p=>{p.stopPropagation(),o.delete?.(s)},children:[t.jsx(et,{size:16}),"Delete"]})]})]})}),e[18]=o,e[19]=i,e[20]=s,e[21]=v):v=e[21];let N;return e[22]!==y||e[23]!==v?(N=t.jsxs(pt,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[y,v]}),e[22]=y,e[23]=v,e[24]=N):N=e[24],N}function kt(n){return n.stopPropagation()}function Ft(n){return n.stopPropagation()}function Kt(n){return n.stopPropagation()}function Ut(n){return n.stopPropagation()}function Lt(n){const e=ne.c(11),{org:s}=Ve();let c;e[0]!==s.id?(c={connectionId:Ct,orgId:s.id},e[0]=s.id,e[1]=c):c=e[1];const o=tt(c);let l;e[2]!==n?(l=rt.user(n),e[2]=n,e[3]=l):l=e[3];let r;e[4]!==o||e[5]!==n?(r=async()=>{const i=await o.callTool({name:"USER_GET",arguments:{id:n}});return(i.structuredContent??i).user},e[4]=o,e[5]=n,e[6]=r):r=e[6];const d=!!n;let f;return e[7]!==l||e[8]!==r||e[9]!==d?(f={queryKey:l,queryFn:r,staleTime:3e5,retry:1,enabled:d},e[7]=l,e[8]=r,e[9]=d,e[10]=f):f=e[10],jt(f)}function Bt(n){const e=ne.c(39),{id:s,size:c,showEmail:o,className:l}=n,r=c===void 0?"xs":c,d=o===void 0?!1:o,{data:f,isLoading:i,isError:u}=Lt(s);if(i){let p;e[0]!==l?(p=Oe("flex items-center gap-2",l),e[0]=l,e[1]=p):p=e[1];let a;e[2]!==r?(a=t.jsx(Me.Skeleton,{shape:"circle",size:r}),e[2]=r,e[3]=a):a=e[3];let b;e[4]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{className:"h-3 w-24 bg-muted animate-pulse rounded"}),e[4]=b):b=e[4];let j;e[5]!==d?(j=d&&t.jsx("div",{className:"h-2 w-32 bg-muted animate-pulse rounded"}),e[5]=d,e[6]=j):j=e[6];let C;e[7]!==j?(C=t.jsxs("div",{className:"flex flex-col gap-1",children:[b,j]}),e[7]=j,e[8]=C):C=e[8];let _;return e[9]!==p||e[10]!==a||e[11]!==C?(_=t.jsxs("div",{className:p,children:[a,C]}),e[9]=p,e[10]=a,e[11]=C,e[12]=_):_=e[12],_}if(u||!f){let p;e[13]!==l?(p=Oe("flex items-center gap-2",l),e[13]=l,e[14]=p):p=e[14];let a;e[15]!==r?(a=t.jsx(Me,{shape:"circle",size:r,fallback:"?",muted:!0}),e[15]=r,e[16]=a):a=e[16];let b;e[17]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{className:"flex flex-col",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Unknown User"})}),e[17]=b):b=e[17];let j;return e[18]!==p||e[19]!==a?(j=t.jsxs("div",{className:p,children:[a,b]}),e[18]=p,e[19]=a,e[20]=j):j=e[20],j}let g;e[21]!==l?(g=Oe("flex items-center gap-2",l),e[21]=l,e[22]=g):g=e[22];const h=f.image??void 0;let m;e[23]!==r||e[24]!==h||e[25]!==f.name?(m=t.jsx(Me,{shape:"circle",size:r,url:h,fallback:f.name}),e[23]=r,e[24]=h,e[25]=f.name,e[26]=m):m=e[26];let x;e[27]!==f.name?(x=t.jsx("div",{className:"text-sm font-medium",children:f.name}),e[27]=f.name,e[28]=x):x=e[28];let y;e[29]!==d||e[30]!==f.email?(y=d&&t.jsx("div",{className:"text-xs text-muted-foreground",children:f.email}),e[29]=d,e[30]=f.email,e[31]=y):y=e[31];let v;e[32]!==x||e[33]!==y?(v=t.jsxs("div",{className:"flex flex-col",children:[x,y]}),e[32]=x,e[33]=y,e[34]=v):v=e[34];let N;return e[35]!==g||e[36]!==m||e[37]!==v?(N=t.jsxs("div",{className:g,children:[m,v]}),e[35]=g,e[36]=m,e[37]=v,e[38]=N):N=e[38],N}const Rt=["icon","avatar","logo"],Re=["created_at","created_by","id"];function Vt(n){return Object.keys(n).find(e=>Rt.includes(e.toLowerCase()))}function st(n,e){return Object.keys(n.properties||{}).filter(s=>["id","created_at","updated_at","created_by","updated_by"].includes(s)?!1:e?e.includes(s):!0).map(s=>({id:s,label:s.charAt(0).toUpperCase()+s.slice(1).replace(/_/g," ")}))}function qt(n){const e=ne.c(32),{data:s,schema:c,viewMode:o,onViewModeChange:l,search:r,sortKey:d,sortDirection:f,onSort:i,actions:u,onItemClick:g,headerActions:h,emptyState:m,readOnly:x,columns:y,hideToolbar:v,sortableFields:N}=n,p=l===void 0?Qt:l,a=f===void 0?"asc":f,b=i===void 0?Jt:i;let j;e[0]!==u?(j=u===void 0?{}:u,e[0]=u,e[1]=j):j=e[1];const C=j,_=g===void 0?Ht:g,D=h===void 0?null:h,P=m===void 0?null:m,E=x===void 0?!1:x,A=y===void 0?void 0:y,I=v===void 0?!1:v,S=N===void 0?void 0:N;let M;e[2]!==A||e[3]!==c||e[4]!==S?(M=A?A.filter(Wt).filter(O=>!S||S.includes(O.id)).map(Gt):st(c,S),e[2]=A,e[3]=c,e[4]=S,e[5]=M):M=e[5];const k=M;let z;e[6]!==D||e[7]!==I||e[8]!==b||e[9]!==p||e[10]!==a||e[11]!==d||e[12]!==k||e[13]!==o?(z=!I&&t.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:t.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[t.jsx("div",{className:"flex items-center gap-2 flex-1",children:D}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(qe,{viewMode:o,onViewModeChange:p,sortKey:d,sortDirection:a,onSort:b,sortOptions:k})})]})}),e[6]=D,e[7]=I,e[8]=b,e[9]=p,e[10]=a,e[11]=d,e[12]=k,e[13]=o,e[14]=z):z=e[14];let T;e[15]!==C||e[16]!==A||e[17]!==s||e[18]!==P||e[19]!==_||e[20]!==b||e[21]!==E||e[22]!==c||e[23]!==r||e[24]!==a||e[25]!==d||e[26]!==S||e[27]!==o?(T=o==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:s.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:P||t.jsx(Le,{icon:t.jsx(Be,{size:36,className:"text-muted-foreground"}),title:"No items found",description:r?"Try adjusting your search":"No items to display"})}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:s.map(O=>t.jsx("div",{onClick:()=>_?.(O),className:"cursor-pointer h-full",children:t.jsx(Mt,{item:O,schema:c,readOnly:E,actions:C})},O.id))})}):t.jsx(gt,{columns:Zt(A,c,S,C),data:s,sortKey:d,sortDirection:a,onSort:b,onRowClick:_,emptyState:P||t.jsx(Le,{icon:t.jsx(Be,{size:36,className:"text-muted-foreground"}),title:"No items found",description:r?"Try adjusting your search":"No items to display"})}),e[15]=C,e[16]=A,e[17]=s,e[18]=P,e[19]=_,e[20]=b,e[21]=E,e[22]=c,e[23]=r,e[24]=a,e[25]=d,e[26]=S,e[27]=o,e[28]=T):T=e[28];let $;return e[29]!==z||e[30]!==T?($=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[z,T]}),e[29]=z,e[30]=T,e[31]=$):$=e[31],$}function Gt(n){return{id:n.id,label:typeof n.header=="string"?n.header:n.id}}function Wt(n){return n.sortable!==!1}function Ht(){}function Jt(){}function Qt(){}function Yt(n){return{id:"actions",header:"",render:e=>t.jsxs(We,{children:[t.jsx(He,{asChild:!0,children:t.jsx(ke,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:t.jsx(Ye,{size:20})})}),t.jsxs(Je,{align:"end",onClick:s=>s.stopPropagation(),children:[n.open&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.open?.(e)},children:[t.jsx(Ze,{size:16}),"Open"]}),n.edit&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.edit?.(e)},children:[t.jsx(Xe,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.duplicate?.(e)},children:[t.jsx(Qe,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(F,{variant:"destructive",onClick:s=>{s.stopPropagation(),n.delete?.(e)},children:[t.jsx(et,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function it(n){const e=n.type;return Array.isArray(e)?e.every(s=>it({type:s})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function Xt(n,e){const s=n.properties||{},c=Object.keys(s).filter(i=>{const u=s[i];return u&&it(u)}),o=Vt(s),l=[],r=new Set;o&&c.includes(o)&&(l.push(o),r.add(o));const d=["title","description","updated_at","updated_by"];for(const i of d)c.includes(i)&&!r.has(i)&&(l.push(i),r.add(i));const f=c.filter(i=>!r.has(i)&&!Re.includes(i)).sort((i,u)=>i.localeCompare(u));for(const i of f)l.push(i),r.add(i);for(const i of Re)c.includes(i)&&!r.has(i)&&(l.push(i),r.add(i));return l.map(i=>{const u=s[i],g=e?e.includes(i):!["id"].includes(i);return i===o?{id:i,header:"",render:h=>{const m=h[i];return t.jsx(Ge,{icon:m,name:h.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:i==="description"?{id:i,header:"Description",render:h=>{const m=h[i];return m==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(m)})},sortable:g,cellClassName:"max-w-[50ch]"}:i==="created_by"||i==="updated_by"?{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m?t.jsx(Bt,{id:String(m),size:"xs"}):"—"},sortable:g,cellClassName:"max-w-[250px]"}:u?.format==="date-time"||i.endsWith("_at")?{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m?t.jsx("span",{className:"block truncate max-w-full",children:new Date(m).toLocaleDateString()}):"—"},sortable:g,cellClassName:"max-w-[200px]"}:{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(m)})},sortable:g,cellClassName:"max-w-[200px]"}})}function Zt(n,e,s,c){const o=n||Xt(e,s);return o.some(d=>d.id==="actions")?o:Object.keys(c).length>0?[...o,Yt(c)]:o}function Ds(n){const e=ne.c(118),{connectionId:s,org:c,activeCollection:o}=n,l=o.name,r=o.schema??wt,d=o.hasCreateTool,f=o.hasUpdateTool,i=o.hasDeleteTool,u=at(),h=ct().location.href,{data:m}=dt.useSession(),x=m?.user?.id||"unknown",y=Nt(s),{org:v}=Ve();let N;e[0]!==s||e[1]!==v.id?(N={connectionId:s,orgId:v.id},e[0]=s,e[1]=v.id,e[2]=N):N=e[2];const p=tt(N),a=bt(s,l,p),b=`${s}-${l}`;let j;e[3]!==c||e[4]!==b?(j={namespace:c,resource:b,defaultSortKey:"updated_at"},e[3]=c,e[4]=b,e[5]=j):j=e[5];const{search:C,searchTerm:_,setSearch:D,viewMode:P,setViewMode:E,sortKey:A,sortDirection:I,handleSort:S}=xt(j);let M;e[6]!==_||e[7]!==I||e[8]!==A?(M={searchTerm:_,sortKey:A,sortDirection:I},e[6]=_,e[7]=I,e[8]=A,e[9]=M):M=e[9];const k=yt(s,l,p,M),z=!d&&!f&&!i;let T;e[10]!==l||e[11]!==s||e[12]!==u||e[13]!==c?(T=w=>{u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:c,connectionId:s,collectionName:l,itemId:w.id}})},e[10]=l,e[11]=s,e[12]=u,e[13]=c,e[14]=T):T=e[14];const $=T;let O;e[15]!==a.create||e[16]!==x?(O=async w=>{const he=new Date().toISOString();await a.create.mutateAsync({...w,id:Ue("conn"),title:`${w.title} (Copy)`,created_at:he,updated_at:he,created_by:x,updated_by:x})},e[15]=a.create,e[16]=x,e[17]=O):O=e[17];const xe=O,[K,ge]=mt.useState(null);let le;e[18]===Symbol.for("react.memo_cache_sentinel")?(le=w=>{ge(w)},e[18]=le):le=e[18];const ot=le;let U;e[19]!==$||e[20]!==f?(U=f&&{edit:$},e[19]=$,e[20]=f,e[21]=U):U=e[21];let L;e[22]!==xe||e[23]!==d?(L=d&&{duplicate:xe},e[22]=xe,e[23]=d,e[24]=L):L=e[24];let B;e[25]!==i?(B=i&&{delete:ot},e[25]=i,e[26]=B):B=e[26];let re;e[27]!==B||e[28]!==U||e[29]!==L?(re={...U,...L,...B},e[27]=B,e[28]=U,e[29]=L,e[30]=re):re=e[30];const je=re;let ae;e[31]!==a.delete||e[32]!==K?(ae=async()=>{K&&(await a.delete.mutateAsync(K.id),ge(null))},e[31]=a.delete,e[32]=K,e[33]=ae):ae=e[33];const Ce=ae;let ce;e[34]!==a.create||e[35]!==l||e[36]!==s||e[37]!==d||e[38]!==u||e[39]!==c||e[40]!==x?(ce=async()=>{if(!d){ft.error("Create operation is not available for this collection");return}const w=new Date().toISOString(),he={id:Ue("conn"),title:"New Item",description:"A brief description of the item",created_at:w,updated_at:w,created_by:x,updated_by:x};try{const ze=await a.create.mutateAsync(he);u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:c,connectionId:s,collectionName:l,itemId:ze.id}})}catch(ze){console.error("Failed to create item:",ze)}},e[34]=a.create,e[35]=l,e[36]=s,e[37]=d,e[38]=u,e[39]=c,e[40]=x,e[41]=ce):ce=e[41];const ve=ce;let de;e[42]!==r?(de=st(r),e[42]=r,e[43]=de):de=e[43];const be=de,Fe=(k?.length??0)>0,nt=d&&Fe,lt=d&&!Fe&&!C;let me;e[44]!==a.create||e[45]!==ve||e[46]!==d?(me=d?t.jsxs(ke,{onClick:ve,size:"sm",disabled:a.create.isPending,className:"h-7",children:[t.jsx(Et,{className:"mr-2 h-4 w-4"}),a.create.isPending?"Creating...":"Create"]}):null,e[44]=a.create,e[45]=ve,e[46]=d,e[47]=me):me=e[47];const Ke=me,ye=A;let R;e[48]!==S||e[49]!==E||e[50]!==I||e[51]!==be||e[52]!==ye||e[53]!==P?(R=t.jsx(qe,{viewMode:P,onViewModeChange:E,sortKey:ye,sortDirection:I,onSort:S,sortOptions:be}),e[48]=S,e[49]=E,e[50]=I,e[51]=be,e[52]=ye,e[53]=P,e[54]=R):R=e[54];const Ne=`${l}s`,we=y?.icon??"grid_view";let V;e[55]!==Ne||e[56]!==we||e[57]!==h?(V=t.jsx(vt,{title:Ne,url:h,icon:we}),e[55]=Ne,e[56]=we,e[57]=h,e[58]=V):V=e[58];const Se=nt&&Ke;let q;e[59]!==R||e[60]!==V||e[61]!==Se?(q=t.jsxs(zt,{children:[R,V,Se]}),e[59]=R,e[60]=V,e[61]=Se,e[62]=q):q=e[62];const _e=`Search ${l}...`;let G;e[63]!==D?(G=w=>{w.key==="Escape"&&(D(""),w.target.blur())},e[63]=D,e[64]=G):G=e[64];let W;e[65]!==C||e[66]!==D||e[67]!==_e||e[68]!==G?(W=t.jsx(ut,{value:C,onChange:D,placeholder:_e,onKeyDown:G}),e[65]=C,e[66]=D,e[67]=_e,e[68]=G,e[69]=W):W=e[69];let H;e[70]!==k?(H=k??[],e[70]=k,e[71]=H):H=e[71];const De=A;let J;e[72]!==$?(J=w=>$(w),e[72]=$,e[73]=J):J=e[73];const Ae="No items found",Ie=C?"Try adjusting your search terms":"This collection doesn't have any items yet.",Pe=lt?Ke:void 0;let Q;e[74]!==Ae||e[75]!==Ie||e[76]!==Pe?(Q=t.jsx(ht,{image:null,title:Ae,description:Ie,actions:Pe}),e[74]=Ae,e[75]=Ie,e[76]=Pe,e[77]=Q):Q=e[77];let Y;e[78]!==S||e[79]!==z||e[80]!==je||e[81]!==r||e[82]!==C||e[83]!==D||e[84]!==E||e[85]!==I||e[86]!==H||e[87]!==De||e[88]!==J||e[89]!==Q||e[90]!==P?(Y=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(qt,{hideToolbar:!0,data:H,schema:r,viewMode:P,onViewModeChange:E,search:C,onSearchChange:D,sortKey:De,sortDirection:I,onSort:S,actions:je,onItemClick:J,readOnly:z,emptyState:Q})}),e[78]=S,e[79]=z,e[80]=je,e[81]=r,e[82]=C,e[83]=D,e[84]=E,e[85]=I,e[86]=H,e[87]=De,e[88]=J,e[89]=Q,e[90]=P,e[91]=Y):Y=e[91];let X;e[92]!==W||e[93]!==Y?(X=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[W,Y]}),e[92]=W,e[93]=Y,e[94]=X):X=e[94];const Te=!!K;let fe;e[95]===Symbol.for("react.memo_cache_sentinel")?(fe=w=>{w||ge(null)},e[95]=fe):fe=e[95];let ue;e[96]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(Dt,{children:"Delete item?"}),e[96]=ue):ue=e[96];const $e=K?.title;let Z;e[97]!==$e?(Z=t.jsxs(At,{children:[ue,t.jsxs(It,{children:['Are you sure you want to delete "',$e,'"? This action cannot be undone.']})]}),e[97]=$e,e[98]=Z):Z=e[98];let ee;e[99]!==a.delete.isPending?(ee=t.jsx(St,{disabled:a.delete.isPending,children:"Cancel"}),e[99]=a.delete.isPending,e[100]=ee):ee=e[100];const Ee=a.delete.isPending?"Deleting...":"Delete";let te;e[101]!==a.delete.isPending||e[102]!==Ce||e[103]!==Ee?(te=t.jsx(_t,{onClick:Ce,disabled:a.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ee}),e[101]=a.delete.isPending,e[102]=Ce,e[103]=Ee,e[104]=te):te=e[104];let se;e[105]!==ee||e[106]!==te?(se=t.jsxs(Pt,{children:[ee,te]}),e[105]=ee,e[106]=te,e[107]=se):se=e[107];let ie;e[108]!==Z||e[109]!==se?(ie=t.jsxs(Tt,{children:[Z,se]}),e[108]=Z,e[109]=se,e[110]=ie):ie=e[110];let oe;e[111]!==Te||e[112]!==ie?(oe=t.jsx($t,{open:Te,onOpenChange:fe,children:ie}),e[111]=Te,e[112]=ie,e[113]=oe):oe=e[113];let pe;return e[114]!==q||e[115]!==X||e[116]!==oe?(pe=t.jsxs(t.Fragment,{children:[q,X,oe]}),e[114]=q,e[115]=X,e[116]=oe,e[117]=pe):pe=e[117],pe}export{Ds as C};
@@ -1 +1 @@
1
- import{c as g,j as o}from"./index-DZ0WP9Uu.js";import{c as u}from"./button-DMKajqX_.js";import{n as T}from"./collection-display-button-BVh1TgBj.js";import{i as $}from"./ArrowUp-CxSqAFHI.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-DHBTmGle.js";import{c as u}from"./button-BJ3HWp7I.js";import{n as T}from"./collection-display-button-D900xq_7.js";import{i as $}from"./ArrowUp-bzciqS-L.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 T,bu as M,j as e,bv as P,N as q,r as R,a8 as h,a as O}from"./index-DZ0WP9Uu.js";import{u as A}from"./useQuery-CpAu1eM3.js";import{u as _}from"./useMutation-BSgCoYc_.js";import{B as y}from"./button-DMKajqX_.js";import{C as N,a as v}from"./card-Cx64whKR.js";import{i as L,a as U}from"./mcp-oauth-pM6hRYfR.js";import{c as C,C as K,a as k}from"./circle-alert-CMl9VinB.js";const Q=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],D=C("external-link",Q);const H=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],w=C("loader-circle",H);const J=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],B=C("refresh-cw",J),Y=t=>{const n=T.c(6);let i;n[0]!==t?({...i}=t,n[0]=t,n[1]=i):i=n[1];const{theme:a}=M(),d=a===void 0?"system":a;let r;n[2]===Symbol.for("react.memo_cache_sentinel")?(r={"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},n[2]=r):r=n[2];let m;return n[3]!==i||n[4]!==d?(m=e.jsx(P,{theme:d,className:"toaster group",style:r,...i}),n[3]=i,n[4]=d,n[5]=m):m=n[5],m},b={session:t=>["user-sandbox-session",t]};function V({sessionId:t,onComplete:n,onError:i}){const a=q(),[p,d]=R.useState(null),{data:r,isLoading:m,error:j}=A({queryKey:b.session(t),queryFn:async()=>{const s=await fetch(`/api/user-sandbox/sessions/${t}`);if(!s.ok){const o=await s.json();throw new Error(o.error||"Failed to load session")}return s.json()}}),F=_({mutationFn:async({appName:s,connectionId:o})=>{const l=await fetch(`/api/user-sandbox/sessions/${t}/configure`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:s,connection_id:o})});if(!l.ok){const u=await l.json();throw new Error(u.error||"Configuration failed")}return l.json()},onSuccess:()=>{a.invalidateQueries({queryKey:b.session(t)})}}),x=_({mutationFn:async()=>{const s=await fetch(`/api/user-sandbox/sessions/${t}/complete`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!s.ok){const o=await s.json();throw new Error(o.error||"Failed to complete")}return s.json()},onSuccess:s=>{s.redirectUrl?window.location.href=s.redirectUrl:(h.success("Setup complete!"),a.invalidateQueries({queryKey:b.session(t)}),n?.({agentId:s.agentId,redirectUrl:s.redirectUrl}))},onError:s=>{const o=s instanceof Error?s:new Error("Failed to complete");h.error(o.message),i?.(o)}}),S=async s=>{d(s.app_name);try{const o=await fetch(`/api/user-sandbox/sessions/${t}/provision`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:s.app_name})});if(!o.ok){const g=await o.json();throw new Error(g.error||"Failed to provision connection")}const u=(await o.json()).connection_id;if(s.connection_type==="HTTP"||s.connection_type==="SSE"||s.connection_type==="Websocket"){const g=`/mcp/${u}`,z=await L({url:g,token:null});if(!z.isAuthenticated&&z.supportsOAuth){h.info("Opening authentication window...");const c=await U({connectionId:u,clientName:s.title,timeout:3e5});if(c.error)throw new Error(c.error);if(c.tokenInfo){const E=await fetch(`/api/connections/${u}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accessToken:c.tokenInfo.accessToken,refreshToken:c.tokenInfo.refreshToken,expiresIn:c.tokenInfo.expiresIn,scope:c.tokenInfo.scope,clientId:c.tokenInfo.clientId,clientSecret:c.tokenInfo.clientSecret,tokenEndpoint:c.tokenInfo.tokenEndpoint})});if(!E.ok){const $=await E.json().catch(()=>({}));throw new Error($.error||"Failed to save authentication tokens. Please try again.")}}}}await F.mutateAsync({appName:s.app_name,connectionId:u}),h.success(`${s.title} connected successfully`)}catch(o){console.error("Connection error:",o);const l=o instanceof Error?o:new Error("Failed to connect");h.error(l.message),i?.(l)}finally{d(null)}},I=r?.apps.every(s=>s.status.configured),f=r?.session.status==="completed";return m?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsx(w,{className:"size-8 animate-spin text-muted-foreground"})}):j?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:e.jsx(N,{className:"max-w-md w-full",children:e.jsx(v,{className:"pt-6",children:e.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[e.jsx("div",{className:"size-12 rounded-full bg-destructive/10 flex items-center justify-center",children:e.jsx(K,{className:"size-6 text-destructive"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Session Error"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:j instanceof Error?j.message:"Failed to load"})]})]})})})}):r?e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(Y,{}),e.jsxs("div",{className:"max-w-lg mx-auto px-4 py-12",children:[e.jsxs("div",{className:"text-center mb-8",children:[r.template.icon&&e.jsx("div",{className:"size-16 mx-auto mb-4 rounded-xl bg-muted flex items-center justify-center overflow-hidden",children:e.jsx("img",{src:r.template.icon,alt:"",className:"size-10 object-contain"})}),e.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:r.template.title}),r.template.description&&e.jsx("p",{className:"text-muted-foreground mt-2",children:r.template.description})]}),f&&e.jsx(N,{className:"mb-6 border-green-500/20 bg-green-500/5",children:e.jsx(v,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"size-10 rounded-full bg-green-500/10 flex items-center justify-center",children:e.jsx(k,{className:"size-5 text-green-500"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Setup Complete"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Your integrations are ready to use."})]})]})})}),e.jsx("div",{className:"space-y-3",children:r.apps.map(s=>e.jsx(N,{children:e.jsx(v,{className:"py-4",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"size-10 rounded-lg bg-muted flex items-center justify-center shrink-0 overflow-hidden",children:s.icon?e.jsx("img",{src:s.icon,alt:"",className:"size-6 object-contain"}):e.jsx("span",{className:"text-lg",children:"📦"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium truncate",children:s.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.status.configured?e.jsxs("span",{className:"text-green-600 dark:text-green-400 flex items-center gap-1",children:[e.jsx(k,{className:"size-3"})," Connected"]}):s.requires_oauth?"Requires authentication":"Ready to connect"})]}),!s.status.configured&&!f&&e.jsx(y,{size:"sm",onClick:()=>S(s),disabled:p!==null||x.isPending,children:p===s.app_name?e.jsxs(e.Fragment,{children:[e.jsx(w,{className:"size-4 mr-2 animate-spin"}),"Connecting..."]}):e.jsxs(e.Fragment,{children:[e.jsx(D,{className:"size-4 mr-2"}),"Connect"]})}),s.status.configured&&!f&&e.jsxs(y,{size:"sm",variant:"outline",onClick:()=>S(s),disabled:p!==null||x.isPending,children:[e.jsx(B,{className:"size-4 mr-2"}),"Reconnect"]}),f&&e.jsx("div",{className:"size-8 rounded-full bg-green-500/10 flex items-center justify-center",children:e.jsx(k,{className:"size-4 text-green-500"})})]})})},s.app_name))}),I&&!f&&e.jsx("div",{className:"mt-6",children:e.jsx(y,{className:"w-full",size:"lg",onClick:()=>x.mutate(),disabled:x.isPending,children:x.isPending?e.jsxs(e.Fragment,{children:[e.jsx(w,{className:"size-4 mr-2 animate-spin"}),"Completing..."]}):"Complete Setup"})}),e.jsx("div",{className:"mt-8 pt-6 border-t text-center",children:e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Session expires:"," ",new Date(r.session.expires_at).toLocaleString()]})})]})]}):null}function oe(){const t=T.c(3);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/connect/$sessionId"},t[0]=n):n=t[0];const{sessionId:i}=O(n);let a;return t[1]!==i?(a=e.jsx(V,{sessionId:i}),t[1]=i,t[2]=a):a=t[2],a}export{oe as default};
1
+ import{c as T,bu as M,j as e,bv as P,N as q,r as R,a8 as h,a as O}from"./index-DHBTmGle.js";import{u as A}from"./useQuery-6rF_dd3c.js";import{u as _}from"./useMutation-BL6IQ2sq.js";import{B as y}from"./button-BJ3HWp7I.js";import{C as N,a as v}from"./card-VfXRHGnT.js";import{i as L,a as U}from"./mcp-oauth-BAnajqJL.js";import{c as C,C as K,a as k}from"./circle-alert-Dns8Lwr3.js";const Q=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],D=C("external-link",Q);const H=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],w=C("loader-circle",H);const J=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],B=C("refresh-cw",J),Y=t=>{const n=T.c(6);let i;n[0]!==t?({...i}=t,n[0]=t,n[1]=i):i=n[1];const{theme:a}=M(),d=a===void 0?"system":a;let r;n[2]===Symbol.for("react.memo_cache_sentinel")?(r={"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},n[2]=r):r=n[2];let m;return n[3]!==i||n[4]!==d?(m=e.jsx(P,{theme:d,className:"toaster group",style:r,...i}),n[3]=i,n[4]=d,n[5]=m):m=n[5],m},b={session:t=>["user-sandbox-session",t]};function V({sessionId:t,onComplete:n,onError:i}){const a=q(),[p,d]=R.useState(null),{data:r,isLoading:m,error:j}=A({queryKey:b.session(t),queryFn:async()=>{const s=await fetch(`/api/user-sandbox/sessions/${t}`);if(!s.ok){const o=await s.json();throw new Error(o.error||"Failed to load session")}return s.json()}}),F=_({mutationFn:async({appName:s,connectionId:o})=>{const l=await fetch(`/api/user-sandbox/sessions/${t}/configure`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:s,connection_id:o})});if(!l.ok){const u=await l.json();throw new Error(u.error||"Configuration failed")}return l.json()},onSuccess:()=>{a.invalidateQueries({queryKey:b.session(t)})}}),x=_({mutationFn:async()=>{const s=await fetch(`/api/user-sandbox/sessions/${t}/complete`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!s.ok){const o=await s.json();throw new Error(o.error||"Failed to complete")}return s.json()},onSuccess:s=>{s.redirectUrl?window.location.href=s.redirectUrl:(h.success("Setup complete!"),a.invalidateQueries({queryKey:b.session(t)}),n?.({agentId:s.agentId,redirectUrl:s.redirectUrl}))},onError:s=>{const o=s instanceof Error?s:new Error("Failed to complete");h.error(o.message),i?.(o)}}),S=async s=>{d(s.app_name);try{const o=await fetch(`/api/user-sandbox/sessions/${t}/provision`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:s.app_name})});if(!o.ok){const g=await o.json();throw new Error(g.error||"Failed to provision connection")}const u=(await o.json()).connection_id;if(s.connection_type==="HTTP"||s.connection_type==="SSE"||s.connection_type==="Websocket"){const g=`/mcp/${u}`,z=await L({url:g,token:null});if(!z.isAuthenticated&&z.supportsOAuth){h.info("Opening authentication window...");const c=await U({connectionId:u,clientName:s.title,timeout:3e5});if(c.error)throw new Error(c.error);if(c.tokenInfo){const E=await fetch(`/api/connections/${u}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accessToken:c.tokenInfo.accessToken,refreshToken:c.tokenInfo.refreshToken,expiresIn:c.tokenInfo.expiresIn,scope:c.tokenInfo.scope,clientId:c.tokenInfo.clientId,clientSecret:c.tokenInfo.clientSecret,tokenEndpoint:c.tokenInfo.tokenEndpoint})});if(!E.ok){const $=await E.json().catch(()=>({}));throw new Error($.error||"Failed to save authentication tokens. Please try again.")}}}}await F.mutateAsync({appName:s.app_name,connectionId:u}),h.success(`${s.title} connected successfully`)}catch(o){console.error("Connection error:",o);const l=o instanceof Error?o:new Error("Failed to connect");h.error(l.message),i?.(l)}finally{d(null)}},I=r?.apps.every(s=>s.status.configured),f=r?.session.status==="completed";return m?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsx(w,{className:"size-8 animate-spin text-muted-foreground"})}):j?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:e.jsx(N,{className:"max-w-md w-full",children:e.jsx(v,{className:"pt-6",children:e.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[e.jsx("div",{className:"size-12 rounded-full bg-destructive/10 flex items-center justify-center",children:e.jsx(K,{className:"size-6 text-destructive"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Session Error"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:j instanceof Error?j.message:"Failed to load"})]})]})})})}):r?e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(Y,{}),e.jsxs("div",{className:"max-w-lg mx-auto px-4 py-12",children:[e.jsxs("div",{className:"text-center mb-8",children:[r.template.icon&&e.jsx("div",{className:"size-16 mx-auto mb-4 rounded-xl bg-muted flex items-center justify-center overflow-hidden",children:e.jsx("img",{src:r.template.icon,alt:"",className:"size-10 object-contain"})}),e.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:r.template.title}),r.template.description&&e.jsx("p",{className:"text-muted-foreground mt-2",children:r.template.description})]}),f&&e.jsx(N,{className:"mb-6 border-green-500/20 bg-green-500/5",children:e.jsx(v,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"size-10 rounded-full bg-green-500/10 flex items-center justify-center",children:e.jsx(k,{className:"size-5 text-green-500"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Setup Complete"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Your integrations are ready to use."})]})]})})}),e.jsx("div",{className:"space-y-3",children:r.apps.map(s=>e.jsx(N,{children:e.jsx(v,{className:"py-4",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"size-10 rounded-lg bg-muted flex items-center justify-center shrink-0 overflow-hidden",children:s.icon?e.jsx("img",{src:s.icon,alt:"",className:"size-6 object-contain"}):e.jsx("span",{className:"text-lg",children:"📦"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium truncate",children:s.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.status.configured?e.jsxs("span",{className:"text-green-600 dark:text-green-400 flex items-center gap-1",children:[e.jsx(k,{className:"size-3"})," Connected"]}):s.requires_oauth?"Requires authentication":"Ready to connect"})]}),!s.status.configured&&!f&&e.jsx(y,{size:"sm",onClick:()=>S(s),disabled:p!==null||x.isPending,children:p===s.app_name?e.jsxs(e.Fragment,{children:[e.jsx(w,{className:"size-4 mr-2 animate-spin"}),"Connecting..."]}):e.jsxs(e.Fragment,{children:[e.jsx(D,{className:"size-4 mr-2"}),"Connect"]})}),s.status.configured&&!f&&e.jsxs(y,{size:"sm",variant:"outline",onClick:()=>S(s),disabled:p!==null||x.isPending,children:[e.jsx(B,{className:"size-4 mr-2"}),"Reconnect"]}),f&&e.jsx("div",{className:"size-8 rounded-full bg-green-500/10 flex items-center justify-center",children:e.jsx(k,{className:"size-4 text-green-500"})})]})})},s.app_name))}),I&&!f&&e.jsx("div",{className:"mt-6",children:e.jsx(y,{className:"w-full",size:"lg",onClick:()=>x.mutate(),disabled:x.isPending,children:x.isPending?e.jsxs(e.Fragment,{children:[e.jsx(w,{className:"size-4 mr-2 animate-spin"}),"Completing..."]}):"Complete Setup"})}),e.jsx("div",{className:"mt-8 pt-6 border-t text-center",children:e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Session expires:"," ",new Date(r.session.expires_at).toLocaleString()]})})]})]}):null}function oe(){const t=T.c(3);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/connect/$sessionId"},t[0]=n):n=t[0];const{sessionId:i}=O(n);let a;return t[1]!==i?(a=e.jsx(V,{sessionId:i}),t[1]=i,t[2]=a):a=t[2],a}export{oe as default};
@@ -1 +1 @@
1
- import{c as S,j as s}from"./index-DZ0WP9Uu.js";import{C as _}from"./card-Cx64whKR.js";import{c as j}from"./button-DMKajqX_.js";import{I as A}from"./empty-state-BnO7A9lc.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-DHBTmGle.js";import{C as _}from"./card-VfXRHGnT.js";import{c as j}from"./button-BJ3HWp7I.js";import{I as A}from"./empty-state-mW4i8Pk5.js";function H(h){const e=S.c(40),{connection:t,onClick:g,headerActions:v,footer:C,className:k,size:R,fallbackIcon:z}=h,b=R===void 0?"md":R,y=b==="sm"?"p-4":"p-6",I=b==="sm"?"text-sm":"text-base",w=b==="sm"?"text-xs":"text-sm",E=g&&"hover:bg-muted/50";let i;e[0]!==k||e[1]!==E?(i=j("cursor-pointer transition-colors group",E,k),e[0]=k,e[1]=E,e[2]=i):i=e[2];let l;e[3]!==y?(l=j("flex flex-col gap-4 relative",y),e[3]=y,e[4]=l):l=e[4];let o;e[5]!==t.icon||e[6]!==t.title||e[7]!==z?(o=s.jsx(A,{icon:t.icon,name:t.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:z}),e[5]=t.icon,e[6]=t.title,e[7]=z,e[8]=o):o=e[8];let n;e[9]!==v?(n=v&&s.jsx("div",{className:j("transition-opacity","opacity-0 group-hover:opacity-100"),onClick:q,children:v}),e[9]=v,e[10]=n):n=e[10];let c;e[11]!==n?(c=s.jsx("div",{className:"relative",children:n}),e[11]=n,e[12]=c):c=e[12];let r;e[13]!==o||e[14]!==c?(r=s.jsxs("div",{className:"flex items-start justify-between",children:[o,c]}),e[13]=o,e[14]=c,e[15]=r):r=e[15];let a;e[16]!==I?(a=j("font-medium text-foreground truncate",I),e[16]=I,e[17]=a):a=e[17];let m;e[18]!==t.title||e[19]!==a?(m=s.jsx("h3",{className:a,children:t.title}),e[18]=t.title,e[19]=a,e[20]=m):m=e[20];let d;e[21]!==w?(d=j("text-muted-foreground line-clamp-2",w),e[21]=w,e[22]=d):d=e[22];const P=t.description||"No description";let f;e[23]!==d||e[24]!==P?(f=s.jsx("p",{className:d,children:P}),e[23]=d,e[24]=P,e[25]=f):f=e[25];let p;e[26]!==m||e[27]!==f?(p=s.jsxs("div",{className:"flex flex-col gap-0",children:[m,f]}),e[26]=m,e[27]=f,e[28]=p):p=e[28];let x;e[29]!==C?(x=C&&s.jsx("div",{onClick:$,children:C}),e[29]=C,e[30]=x):x=e[30];let u;e[31]!==p||e[32]!==x||e[33]!==l||e[34]!==r?(u=s.jsxs("div",{className:l,children:[r,p,x]}),e[31]=p,e[32]=x,e[33]=l,e[34]=r,e[35]=u):u=e[35];let N;return e[36]!==g||e[37]!==u||e[38]!==i?(N=s.jsx(_,{className:i,onClick:g,children:u}),e[36]=g,e[37]=u,e[38]=i,e[39]=N):N=e[39],N}function $(h){return h.stopPropagation()}function q(h){return h.stopPropagation()}export{H as C};
@@ -1 +1 @@
1
- import{c as Q,j as o,f as H,bg as X,r as q,a as ce,u as ae,g as le,bq as me}from"./index-DZ0WP9Uu.js";import{E as G,I as Y}from"./empty-state-BnO7A9lc.js";import{E as Z}from"./error-boundary-BmoPYDr9.js";import{b as de}from"./use-binding-BhZjQhNo.js";import{u as ue,S as pe}from"./index-B_JsA4Kj.js";import{f as fe}from"./use-collections-Drr6_6fb.js";import{u as J,a as he}from"./use-connection-Bp7t1xn3.js";import{u as xe}from"./constants-fPyH6C9l.js";import{b as ge,c as be}from"./use-mcp-prompts-CSWg69Uu.js";import{B as je}from"./button-DMKajqX_.js";import{R as ye}from"./resource-tabs-cEMTKUzi.js";import{i as ee}from"./Loading01-BOeR2B8B.js";import{V as te,a as Se,b as Ce}from"./layout-DfJ4yUAY.js";import{C as ve}from"./collection-tab--167XVPq.js";import{C as oe}from"./collection-display-button-BVh1TgBj.js";import{C as se}from"./collection-search-Di76L1bf.js";import{C as ne}from"./collection-table-wrapper-DHB_EgNT.js";import{P as re}from"./pin-to-sidebar-button-Cgw1E6xL.js";import{C as ie}from"./card-Cx64whKR.js";import{R as Ne,T as Te}from"./tools-list-DMgjdEKU.js";import"./binder-D14T3-AY.js";import"./mcp-oauth-pM6hRYfR.js";import"./env-vars-editor-BcnJ-LB5.js";import"./input-B0NJeiuT.js";import"./Plus-CROcV2-u.js";import"./Trash01-DHhhoDHD.js";import"./File06-BpUf605-.js";import"./Key01-BMhwGxr8.js";import"./badge-BfOFucuW.js";import"./form-ndfdAtTI.js";import"./select-2zWNvmE1.js";import"./tooltip-CzB50oKO.js";import"./Check-fIeUq0Tl.js";import"./ChevronDown-aJJ6RgWv.js";import"./extract-connection-data-BmKY6Xwr.js";import"./constants-BxAQzeE8.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-CpCQJuef.js";import"./generate-id-Dyweu44Y.js";import"./CpuChip02-B5a9K48n.js";import"./Terminal-DGXkCDiq.js";import"./use-virtual-mcp-DQzFD2uZ.js";import"./Grid01-D89OcY09.js";import"./index-CsefZjgp.js";import"./index-C2RcJiSR.js";import"./circle-alert-CMl9VinB.js";import"./index-Dtt3Ixsj.js";import"./X-BAy7Mfyd.js";import"./monaco-editor-Dv9cb_Fm.js";import"./infiniteQueryObserver-BbTATuuq.js";import"./spinner-YcNewNcW.js";import"./localstorage-keys-peJWGFoJ.js";import"./useQuery-CpAu1eM3.js";import"./useMutation-BSgCoYc_.js";import"./popover-Bz6616No.js";import"./Image01-DlxjetON.js";import"./SearchMd-D74Sf-27.js";import"./dialog-ztR7gCh9.js";import"./AlertCircle-BGhlDWk2.js";import"./ArrowUp-CxSqAFHI.js";import"./Edit01-F53eAMKI.js";import"./Copy01-CdhhOoSD.js";import"./use-create-virtual-mcp-OU_v2YUB.js";import"./ArrowLeft-DiPZV3an.js";import"./dropdown-menu-ClnDILPk.js";import"./DotsVertical-1JZvMgtG.js";import"./use-list-state-Zs89S-QA.js";import"./use-mobile-BrgiFD7w.js";import"./empty-state-bLy612i3.js";import"./Inbox01-CxsccOrS.js";import"./avatar-DyhTRBi5.js";import"./alert-dialog-DCgyNkDL.js";import"./List-G-H7B3e1.js";import"./view-mode-toggle-BrT5iiCv.js";import"./use-organization-settings-BCjNGEBN.js";function we(t){const e=Q.c(42),{prompts:n,connectionId:s,org:r,connectionTitle:d,connectionIcon:l,onPromptClick:b,showToolbar:T,emptyMessage:E}=t,I=T===void 0?!0:T,R=E===void 0?"This connection doesn't have any prompts yet.":E,u=H(),x=X().location.href,[j,f]=q.useState(""),[g,i]=q.useState("table"),[p,w]=q.useState("name"),[m,D]=q.useState("asc");let V;e[0]!==m||e[1]!==p?(V=h=>{p===h?(D(_e),m==="desc"&&w(void 0)):(w(h),D("asc"))},e[0]=m,e[1]=p,e[2]=V):V=e[2];const v=V;let k;e[3]!==s||e[4]!==u||e[5]!==b||e[6]!==r?(k=h=>{b?b(h):s&&r&&u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:r,connectionId:s,collectionName:"prompts",itemId:encodeURIComponent(h.name)}})},e[3]=s,e[4]=u,e[5]=b,e[6]=r,e[7]=k):k=e[7];const _=k;let $;if(e[8]!==n||e[9]!==j||e[10]!==m||e[11]!==p){const h=!n||n.length===0?[]:j.trim()?(()=>{const K=j.toLowerCase();return n.filter(B=>B.name.toLowerCase().includes(K)||B.description&&B.description.toLowerCase().includes(K))})():n;$=!p||!m?h:[...h].sort((K,B)=>{const F=K[p]||"",U=B[p]||"",W=String(F).localeCompare(String(U));return m==="asc"?W:-W}),e[8]=n,e[9]=j,e[10]=m,e[11]=p,e[12]=$}else $=e[12];const N=$;let O;e[13]===Symbol.for("react.memo_cache_sentinel")?(O=[{id:"name",header:"Name",render:ke,sortable:!0},{id:"description",header:"Description",render:Re,cellClassName:"flex-1",sortable:!0}],e[13]=O):O=e[13];const L=O;let a;e[14]===Symbol.for("react.memo_cache_sentinel")?(a=L.filter(Ie).map($e),e[14]=a):a=e[14];const A=a;let y;e[15]!==l||e[16]!==d||e[17]!==v||e[18]!==I||e[19]!==m||e[20]!==p||e[21]!==x||e[22]!==g?(y=I&&o.jsxs(te,{children:[o.jsx(oe,{viewMode:g,onViewModeChange:i,sortKey:p,sortDirection:m,onSort:v,sortOptions:A}),o.jsx(re,{title:d?`${d}: Prompts`:"Prompts",url:x,icon:l??"description"})]}),e[15]=l,e[16]=d,e[17]=v,e[18]=I,e[19]=m,e[20]=p,e[21]=x,e[22]=g,e[23]=y):y=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S=h=>{h.key==="Escape"&&(f(""),h.target.blur())},e[24]=S):S=e[24];let C;e[25]!==j?(C=o.jsx(se,{value:j,onChange:f,placeholder:"Search prompts...",onKeyDown:S}),e[25]=j,e[26]=C):C=e[26];let c;e[27]!==R||e[28]!==_||e[29]!==v||e[30]!==j||e[31]!==m||e[32]!==p||e[33]!==N||e[34]!==g?(c=g==="cards"?o.jsx("div",{className:"flex-1 overflow-auto p-5",children:N.length===0?o.jsx(G,{image:null,title:j?"No prompts found":"No prompts available",description:j?"Try adjusting your search terms":R}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:N.map(h=>o.jsx(ie,{className:"cursor-pointer transition-colors",onClick:()=>_(h),children:o.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[o.jsx(Y,{icon:null,name:h.name,size:"md",className:"shrink-0 shadow-sm"}),o.jsxs("div",{className:"flex flex-col gap-0",children:[o.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:h.name}),o.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:h.description||"No description"})]})]})},h.name))})}):o.jsx(ne,{columns:L,data:N,isLoading:!1,sortKey:p,sortDirection:m,onSort:v,onRowClick:h=>_(h),emptyState:o.jsx(G,{image:null,title:j?"No prompts found":"No prompts available",description:j?"Try adjusting your search terms":R})}),e[27]=R,e[28]=_,e[29]=v,e[30]=j,e[31]=m,e[32]=p,e[33]=N,e[34]=g,e[35]=c):c=e[35];let P;e[36]!==C||e[37]!==c?(P=o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[C,c]}),e[36]=C,e[37]=c,e[38]=P):P=e[38];let M;return e[39]!==P||e[40]!==y?(M=o.jsxs(o.Fragment,{children:[y,P]}),e[39]=P,e[40]=y,e[41]=M):M=e[41],M}function $e(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Ie(t){return t.sortable}function Re(t){return o.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function ke(t){return o.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:t.name})}function _e(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Le(t){const e=Q.c(6),{prompts:n,connectionId:s,org:r}=t,d=J(s),l=d?.title,b=d?.icon;let T;return e[0]!==s||e[1]!==r||e[2]!==n||e[3]!==l||e[4]!==b?(T=o.jsx(we,{prompts:n,connectionId:s,org:r,connectionTitle:l,connectionIcon:b}),e[0]=s,e[1]=r,e[2]=n,e[3]=l,e[4]=b,e[5]=T):T=e[5],T}function Pe(t){const e=Q.c(2),{repository:n}=t;let s;return e[0]!==n?(s=o.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:o.jsx(Ne,{repository:n})}),e[0]=n,e[1]=s):s=e[1],s}function Me(t){const e=Q.c(39),{resources:n,connectionTitle:s,connectionIcon:r,onResourceClick:d,showToolbar:l,emptyMessage:b}=t,T=l===void 0?!0:l,E=b===void 0?"This connection doesn't have any resources yet.":b,R=X().location.href,[u,z]=q.useState(""),[x,j]=q.useState("table"),[f,g]=q.useState("name"),[i,p]=q.useState("asc");let w;e[0]!==i||e[1]!==f?(w=c=>{f===c?(p(Ue),i==="desc"&&g(void 0)):(g(c),p("asc"))},e[0]=i,e[1]=f,e[2]=w):w=e[2];const m=w;let D;e[3]!==d?(D=c=>{d&&d(c)},e[3]=d,e[4]=D):D=e[4];const V=D;let v;if(e[5]!==n||e[6]!==u||e[7]!==i||e[8]!==f){const c=!n||n.length===0?[]:u.trim()?(()=>{const P=u.toLowerCase();return n.filter(M=>M.uri.toLowerCase().includes(P)||M.name&&M.name.toLowerCase().includes(P)||M.description&&M.description.toLowerCase().includes(P))})():n;v=!f||!i?c:[...c].sort((P,M)=>{const h=P[f]||"",K=M[f]||"",B=String(h).localeCompare(String(K));return i==="asc"?B:-B}),e[5]=n,e[6]=u,e[7]=i,e[8]=f,e[9]=v}else v=e[9];const k=v;let _;e[10]===Symbol.for("react.memo_cache_sentinel")?(_=[{id:"name",header:"Name",render:Be,sortable:!0},{id:"uri",header:"URI",render:Oe,sortable:!0},{id:"description",header:"Description",render:De,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:Ee,sortable:!0}],e[10]=_):_=e[10];const $=_;let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=$.filter(Ae).map(Ve),e[11]=N):N=e[11];const O=N;let L;e[12]!==r||e[13]!==s||e[14]!==m||e[15]!==T||e[16]!==i||e[17]!==f||e[18]!==R||e[19]!==x?(L=T&&o.jsxs(te,{children:[o.jsx(oe,{viewMode:x,onViewModeChange:j,sortKey:f,sortDirection:i,onSort:m,sortOptions:O}),o.jsx(re,{title:s?`${s}: Resources`:"Resources",url:R,icon:r??"folder"})]}),e[12]=r,e[13]=s,e[14]=m,e[15]=T,e[16]=i,e[17]=f,e[18]=R,e[19]=x,e[20]=L):L=e[20];let a;e[21]===Symbol.for("react.memo_cache_sentinel")?(a=c=>{c.key==="Escape"&&(z(""),c.target.blur())},e[21]=a):a=e[21];let A;e[22]!==u?(A=o.jsx(se,{value:u,onChange:z,placeholder:"Search resources...",onKeyDown:a}),e[22]=u,e[23]=A):A=e[23];let y;e[24]!==E||e[25]!==V||e[26]!==m||e[27]!==u||e[28]!==i||e[29]!==f||e[30]!==k||e[31]!==x?(y=x==="cards"?o.jsx("div",{className:"flex-1 overflow-auto p-5",children:k.length===0?o.jsx(G,{image:null,title:u?"No resources found":"No resources available",description:u?"Try adjusting your search terms":E}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:k.map(c=>o.jsx(ie,{className:"cursor-pointer transition-colors",onClick:()=>V(c),children:o.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[o.jsx(Y,{icon:null,name:c.name||c.uri,size:"md",className:"shrink-0 shadow-sm"}),o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:c.name||c.uri}),o.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:c.uri}),c.description&&o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:c.description})]})]})},c.uri))})}):o.jsx(ne,{columns:$,data:k,isLoading:!1,sortKey:f,sortDirection:i,onSort:m,onRowClick:c=>V(c),emptyState:o.jsx(G,{image:null,title:u?"No resources found":"No resources available",description:u?"Try adjusting your search terms":E})}),e[24]=E,e[25]=V,e[26]=m,e[27]=u,e[28]=i,e[29]=f,e[30]=k,e[31]=x,e[32]=y):y=e[32];let S;e[33]!==A||e[34]!==y?(S=o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[A,y]}),e[33]=A,e[34]=y,e[35]=S):S=e[35];let C;return e[36]!==S||e[37]!==L?(C=o.jsxs(o.Fragment,{children:[L,S]}),e[36]=S,e[37]=L,e[38]=C):C=e[38],C}function Ve(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Ae(t){return t.sortable}function Ee(t){return o.jsx("span",{className:"text-sm text-muted-foreground",children:t.mimeType||"—"})}function De(t){return o.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function Oe(t){return o.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:t.uri})}function Be(t){return o.jsx("span",{className:"text-sm font-medium text-foreground",children:t.name||t.uri})}function Ue(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Ke(t){const e=Q.c(6),{resources:n,connectionId:s,org:r}=t,d=J(s),l=d?.title,b=d?.icon;let T;return e[0]!==s||e[1]!==r||e[2]!==n||e[3]!==l||e[4]!==b?(T=o.jsx(Me,{resources:n,connectionId:s,org:r,connectionTitle:l,connectionIcon:b}),e[0]=s,e[1]=r,e[2]=n,e[3]=l,e[4]=b,e[5]=T):T=e[5],T}function ze(t){const e=Q.c(5),{tools:n,connectionId:s,org:r,isLoading:d}=t;let l;return e[0]!==s||e[1]!==d||e[2]!==r||e[3]!==n?(l=o.jsx(Te,{tools:n,connectionId:s,org:r,isLoading:d}),e[0]=s,e[1]=d,e[2]=r,e[3]=n,e[4]=l):l=e[4],l}function qe(t){const e=Q.c(66),{connection:n,connectionId:s,org:r,requestedTabId:d,collections:l,onUpdate:b,isUpdating:T,prompts:E,resources:I,tools:R,isLoadingTools:u}=t,z=me();let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x={from:"/$org/mcps/$connectionId"},e[0]=x):x=e[0];const j=H(x);let f;e[1]!==s?(f={connectionId:s},e[1]=s,e[2]=f):f=e[2];const g=ue(f),i=g.isAuthenticated,p=n?.metadata?.repository,w=!!p?.url,m=R.length,D=E.length,V=I.length,v=m>0||u;let k;e[3]===Symbol.for("react.memo_cache_sentinel")?(k={id:"settings",label:"Settings"},e[3]=k):k=e[3];let _;e[4]!==u||e[5]!==i||e[6]!==v||e[7]!==m?(_=i&&v?[{id:"tools",label:"Tools",count:u?void 0:m}]:[],e[4]=u,e[5]=i,e[6]=v,e[7]=m,e[8]=_):_=e[8];let $;e[9]!==i||e[10]!==D?($=i&&D>0?[{id:"prompts",label:"Prompts",count:D}]:[],e[9]=i,e[10]=D,e[11]=$):$=e[11];let N;e[12]!==i||e[13]!==V?(N=i&&V>0?[{id:"resources",label:"Resources",count:V}]:[],e[12]=i,e[13]=V,e[14]=N):N=e[14];let O;if(e[15]!==l||e[16]!==w||e[17]!==i||e[18]!==_||e[19]!==$||e[20]!==N){let U;e[22]!==w?(U=w?[{id:"readme",label:"README"}]:[],e[22]=w,e[23]=U):U=e[23],O=[k,..._,...$,...N,...i?(l||[]).map(Qe):[],...U],e[15]=l,e[16]=w,e[17]=i,e[18]=_,e[19]=$,e[20]=N,e[21]=O}else O=e[21];const L=O,a=L.some(U=>U.id===d)?d:"settings";let A;e[24]!==j?(A=U=>{j({search:W=>({...W,tab:U}),replace:!0})},e[24]=j,e[25]=A):A=e[25];const y=A;let S;e[26]!==l?(S=l||[],e[26]=l,e[27]=S):S=e[27];let C;if(e[28]!==a||e[29]!==S){let U;e[31]!==a?(U=W=>W.name===a,e[31]=a,e[32]=U):U=e[32],C=S.find(U),e[28]=a,e[29]=S,e[30]=C}else C=e[30];const c=C;let P;e[33]!==z.history?(P=()=>z.history.back(),e[33]=z.history,e[34]=P):P=e[34];let M;e[35]!==a||e[36]!==y||e[37]!==L?(M=o.jsx(Se,{children:o.jsx(ye,{tabs:L,activeTab:a,onTabChange:y})}),e[35]=a,e[36]=y,e[37]=L,e[38]=M):M=e[38];let h;e[39]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ee,{size:32,className:"animate-spin text-muted-foreground"})}),e[39]=h):h=e[39];let K;e[40]!==c||e[41]!==a||e[42]!==g.hasOAuthToken||e[43]!==g.isServerError||e[44]!==g.supportsOAuth||e[45]!==n||e[46]!==s||e[47]!==y||e[48]!==w||e[49]!==u||e[50]!==i||e[51]!==T||e[52]!==b||e[53]!==r||e[54]!==E||e[55]!==p||e[56]!==I||e[57]!==R?(K=o.jsx(q.Suspense,{fallback:h,children:a==="tools"?o.jsx(ze,{tools:R,connectionId:s,org:r,isLoading:u}):a==="prompts"?o.jsx(Le,{prompts:E,connectionId:s,org:r}):a==="resources"?o.jsx(Ke,{resources:I,connectionId:s,org:r}):a==="settings"?o.jsx(pe,{connection:n,onUpdate:b,isUpdating:T,isMCPAuthenticated:i,supportsOAuth:g.supportsOAuth,hasOAuthToken:g.hasOAuthToken,isServerError:g.isServerError,onViewReadme:w?()=>y("readme"):void 0}):a==="readme"&&w?o.jsx(Pe,{repository:p}):c&&i?o.jsx(ve,{connectionId:s,org:r,activeCollection:c},a):o.jsx(G,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[40]=c,e[41]=a,e[42]=g.hasOAuthToken,e[43]=g.isServerError,e[44]=g.supportsOAuth,e[45]=n,e[46]=s,e[47]=y,e[48]=w,e[49]=u,e[50]=i,e[51]=T,e[52]=b,e[53]=r,e[54]=E,e[55]=p,e[56]=I,e[57]=R,e[58]=K):K=e[58];let B;e[59]!==a||e[60]!==K?(B=o.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:o.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-auto",children:o.jsx(Z,{children:K},a)})}),e[59]=a,e[60]=K,e[61]=B):B=e[61];let F;return e[62]!==P||e[63]!==M||e[64]!==B?(F=o.jsxs(Ce,{onBack:P,children:[M,B]}),e[62]=P,e[63]=M,e[64]=B,e[65]=F):F=e[65],F}function Qe(t){return{id:t.name,label:t.displayName}}function Fe(){const t=Q.c(43);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/mcps/$connectionId"},t[0]=e):e=t[0];const n=H(e);let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/mcps/$connectionId"},t[1]=s):s=t[1];const{connectionId:r,org:d}=ce(s),{org:l}=ae();let b;t[2]===Symbol.for("react.memo_cache_sentinel")?(b={from:"/shell/$org/mcps/$connectionId"},t[2]=b):b=t[2];const E=le(b).tab||"settings",I=J(r),R=he(),u=de(I??void 0);let z;t[3]!==r||t[4]!==l.id?(z={connectionId:r,orgId:l.id},t[3]=r,t[4]=l.id,t[5]=z):z=t[5];const x=xe(z);let j;t[6]!==x?(j={client:x},t[6]=x,t[7]=j):j=t[7];const{data:f}=ge(j);let g;t[8]!==x?(g={client:x},t[8]=x,t[9]=g):g=t[9];const{data:i}=be(g),p=I?.tools&&I.tools.length>0,w=!p;let m;t[10]!==x||t[11]!==w?(m={client:x,enabled:w},t[10]=x,t[11]=w,t[12]=m):m=t[12];const{data:D,isLoading:V}=fe(m);let v;t[13]!==f?.prompts?(v=f?.prompts??[],t[13]=f?.prompts,t[14]=v):v=t[14];let k;t[15]!==v?(k=v.map(He),t[15]=v,t[16]=k):k=t[16];const _=k;let $;t[17]!==i?.resources?($=i?.resources??[],t[17]=i?.resources,t[18]=$):$=t[18];let N;t[19]!==$?(N=$.map(Ge),t[19]=$,t[20]=N):N=t[20];const O=N;let L;t[21]!==I||t[22]!==p||t[23]!==D?.tools?(L=p?I.tools??[]:(D?.tools??[]).map(We),t[21]=I,t[22]=p,t[23]=D?.tools,t[24]=L):L=t[24];const a=L;let A;t[25]!==R.update||t[26]!==r?(A=async C=>{await R.update.mutateAsync({id:r,data:C})},t[25]=R.update,t[26]=r,t[27]=A):A=t[27];const y=A;if(!I){let C;return t[28]!==n||t[29]!==d?(C=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(G,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:o.jsx(je,{variant:"outline",onClick:()=>n({to:"/$org/mcps",params:{org:d}}),children:"Back to connections"})})}),t[28]=n,t[29]=d,t[30]=C):C=t[30],C}let S;return t[31]!==R.update.isPending||t[32]!==u||t[33]!==I||t[34]!==r||t[35]!==y||t[36]!==V||t[37]!==d||t[38]!==_||t[39]!==E||t[40]!==O||t[41]!==a?(S=o.jsx(qe,{org:d,connection:I,connectionId:r,requestedTabId:E,collections:u,onUpdate:y,isUpdating:R.update.isPending,prompts:_,resources:O,tools:a,isLoadingTools:V}),t[31]=R.update.isPending,t[32]=u,t[33]=I,t[34]=r,t[35]=y,t[36]=V,t[37]=d,t[38]=_,t[39]=E,t[40]=O,t[41]=a,t[42]=S):S=t[42],S}function We(t){return{name:t.name,description:t.description,inputSchema:t.inputSchema}}function Ge(t){return{uri:t.uri,name:t.name,description:t.description}}function He(t){return{name:t.name,description:t.description}}function Je(){const t=Q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(Z,{children:o.jsx(q.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:o.jsx(ee,{size:32,className:"animate-spin text-muted-foreground"})}),children:o.jsx(Fe,{})})}),t[0]=e):e=t[0],e}function jo(){const t=Q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(Je,{}),t[0]=e):e=t[0],e}export{jo as default};
1
+ import{c as Q,j as o,f as H,bg as X,r as q,a as ce,u as ae,g as le,bq as me}from"./index-DHBTmGle.js";import{E as G,I as Y}from"./empty-state-mW4i8Pk5.js";import{E as Z}from"./error-boundary-BhvmEiaO.js";import{b as de}from"./use-binding-C_F3xeC_.js";import{u as ue,S as pe}from"./index-DFxQb7a9.js";import{f as fe}from"./use-collections-CToBNrWq.js";import{u as J,a as he}from"./use-connection-DAX6ty9k.js";import{u as xe}from"./constants-BVdHh4aD.js";import{b as ge,c as be}from"./use-mcp-prompts-D9dGnuXY.js";import{B as je}from"./button-BJ3HWp7I.js";import{R as ye}from"./resource-tabs-loCNqUq6.js";import{i as ee}from"./Loading01-BJHzsSlY.js";import{V as te,a as Se,b as Ce}from"./layout-BNPUEoId.js";import{C as ve}from"./collection-tab-DiAv1BlF.js";import{C as oe}from"./collection-display-button-D900xq_7.js";import{C as se}from"./collection-search-DITQLAqZ.js";import{C as ne}from"./collection-table-wrapper-CD2w-c2k.js";import{P as re}from"./pin-to-sidebar-button-B9E6PQjp.js";import{C as ie}from"./card-VfXRHGnT.js";import{R as Ne,T as Te}from"./tools-list-taSvhPFS.js";import"./binder-DLTRuBUr.js";import"./mcp-oauth-BAnajqJL.js";import"./env-vars-editor-f0zQEaJU.js";import"./input-7ruC6uFX.js";import"./Plus-DOEL_hbF.js";import"./Trash01-Wrvcbt0u.js";import"./File06-Di7-0Zhi.js";import"./Key01-C8fGnb_s.js";import"./badge-Cg-cVOUM.js";import"./form-D6hs_qye.js";import"./select-BWkItg_a.js";import"./tooltip-BuUNB1mb.js";import"./Check-0BeRG3Sh.js";import"./ChevronDown-DSaGHwzQ.js";import"./extract-connection-data-DeAFFhRc.js";import"./constants-ao3kqMSk.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-BCHz1L7j.js";import"./generate-id-Dyweu44Y.js";import"./CpuChip02-wjDh7ig3.js";import"./Terminal-BBj7QyID.js";import"./use-virtual-mcp-CZvW7LdD.js";import"./Grid01-BV5dHi3R.js";import"./index-RzZtkQ3Q.js";import"./index-g80C_Gec.js";import"./circle-alert-Dns8Lwr3.js";import"./index-98urlcvX.js";import"./X-CgDprUQG.js";import"./monaco-editor-GHN1rtUS.js";import"./infiniteQueryObserver-8idXPZ5W.js";import"./spinner-DEICAlhU.js";import"./localstorage-keys-D6bFEMDt.js";import"./useQuery-6rF_dd3c.js";import"./useMutation-BL6IQ2sq.js";import"./popover-D7YWI5Cf.js";import"./Image01-Bidy-9ro.js";import"./SearchMd-4iIwSESe.js";import"./dialog-DsV8m8rX.js";import"./AlertCircle-BzWtrrJ5.js";import"./ArrowUp-bzciqS-L.js";import"./Edit01-Cw7nvLlE.js";import"./Copy01-CnmNi70D.js";import"./use-create-virtual-mcp-te-5zxHj.js";import"./ArrowLeft-DbjxH-TA.js";import"./dropdown-menu-B1OcMuo7.js";import"./DotsVertical-kAKCLT6g.js";import"./use-list-state-BOP_Nd4C.js";import"./use-mobile-B7Yc-x5B.js";import"./empty-state-C1AOcdcD.js";import"./Inbox01-C7pMAXQN.js";import"./avatar-B2I6mHo7.js";import"./alert-dialog-BsUKy6x1.js";import"./List-B-KIt-jD.js";import"./view-mode-toggle-P81vIwwH.js";import"./use-organization-settings--qcz6AHX.js";function we(t){const e=Q.c(42),{prompts:n,connectionId:s,org:r,connectionTitle:d,connectionIcon:l,onPromptClick:b,showToolbar:T,emptyMessage:E}=t,I=T===void 0?!0:T,R=E===void 0?"This connection doesn't have any prompts yet.":E,u=H(),x=X().location.href,[j,f]=q.useState(""),[g,i]=q.useState("table"),[p,w]=q.useState("name"),[m,D]=q.useState("asc");let V;e[0]!==m||e[1]!==p?(V=h=>{p===h?(D(_e),m==="desc"&&w(void 0)):(w(h),D("asc"))},e[0]=m,e[1]=p,e[2]=V):V=e[2];const v=V;let k;e[3]!==s||e[4]!==u||e[5]!==b||e[6]!==r?(k=h=>{b?b(h):s&&r&&u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:r,connectionId:s,collectionName:"prompts",itemId:encodeURIComponent(h.name)}})},e[3]=s,e[4]=u,e[5]=b,e[6]=r,e[7]=k):k=e[7];const _=k;let $;if(e[8]!==n||e[9]!==j||e[10]!==m||e[11]!==p){const h=!n||n.length===0?[]:j.trim()?(()=>{const K=j.toLowerCase();return n.filter(B=>B.name.toLowerCase().includes(K)||B.description&&B.description.toLowerCase().includes(K))})():n;$=!p||!m?h:[...h].sort((K,B)=>{const F=K[p]||"",U=B[p]||"",W=String(F).localeCompare(String(U));return m==="asc"?W:-W}),e[8]=n,e[9]=j,e[10]=m,e[11]=p,e[12]=$}else $=e[12];const N=$;let O;e[13]===Symbol.for("react.memo_cache_sentinel")?(O=[{id:"name",header:"Name",render:ke,sortable:!0},{id:"description",header:"Description",render:Re,cellClassName:"flex-1",sortable:!0}],e[13]=O):O=e[13];const L=O;let a;e[14]===Symbol.for("react.memo_cache_sentinel")?(a=L.filter(Ie).map($e),e[14]=a):a=e[14];const A=a;let y;e[15]!==l||e[16]!==d||e[17]!==v||e[18]!==I||e[19]!==m||e[20]!==p||e[21]!==x||e[22]!==g?(y=I&&o.jsxs(te,{children:[o.jsx(oe,{viewMode:g,onViewModeChange:i,sortKey:p,sortDirection:m,onSort:v,sortOptions:A}),o.jsx(re,{title:d?`${d}: Prompts`:"Prompts",url:x,icon:l??"description"})]}),e[15]=l,e[16]=d,e[17]=v,e[18]=I,e[19]=m,e[20]=p,e[21]=x,e[22]=g,e[23]=y):y=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S=h=>{h.key==="Escape"&&(f(""),h.target.blur())},e[24]=S):S=e[24];let C;e[25]!==j?(C=o.jsx(se,{value:j,onChange:f,placeholder:"Search prompts...",onKeyDown:S}),e[25]=j,e[26]=C):C=e[26];let c;e[27]!==R||e[28]!==_||e[29]!==v||e[30]!==j||e[31]!==m||e[32]!==p||e[33]!==N||e[34]!==g?(c=g==="cards"?o.jsx("div",{className:"flex-1 overflow-auto p-5",children:N.length===0?o.jsx(G,{image:null,title:j?"No prompts found":"No prompts available",description:j?"Try adjusting your search terms":R}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:N.map(h=>o.jsx(ie,{className:"cursor-pointer transition-colors",onClick:()=>_(h),children:o.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[o.jsx(Y,{icon:null,name:h.name,size:"md",className:"shrink-0 shadow-sm"}),o.jsxs("div",{className:"flex flex-col gap-0",children:[o.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:h.name}),o.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:h.description||"No description"})]})]})},h.name))})}):o.jsx(ne,{columns:L,data:N,isLoading:!1,sortKey:p,sortDirection:m,onSort:v,onRowClick:h=>_(h),emptyState:o.jsx(G,{image:null,title:j?"No prompts found":"No prompts available",description:j?"Try adjusting your search terms":R})}),e[27]=R,e[28]=_,e[29]=v,e[30]=j,e[31]=m,e[32]=p,e[33]=N,e[34]=g,e[35]=c):c=e[35];let P;e[36]!==C||e[37]!==c?(P=o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[C,c]}),e[36]=C,e[37]=c,e[38]=P):P=e[38];let M;return e[39]!==P||e[40]!==y?(M=o.jsxs(o.Fragment,{children:[y,P]}),e[39]=P,e[40]=y,e[41]=M):M=e[41],M}function $e(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Ie(t){return t.sortable}function Re(t){return o.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function ke(t){return o.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:t.name})}function _e(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Le(t){const e=Q.c(6),{prompts:n,connectionId:s,org:r}=t,d=J(s),l=d?.title,b=d?.icon;let T;return e[0]!==s||e[1]!==r||e[2]!==n||e[3]!==l||e[4]!==b?(T=o.jsx(we,{prompts:n,connectionId:s,org:r,connectionTitle:l,connectionIcon:b}),e[0]=s,e[1]=r,e[2]=n,e[3]=l,e[4]=b,e[5]=T):T=e[5],T}function Pe(t){const e=Q.c(2),{repository:n}=t;let s;return e[0]!==n?(s=o.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:o.jsx(Ne,{repository:n})}),e[0]=n,e[1]=s):s=e[1],s}function Me(t){const e=Q.c(39),{resources:n,connectionTitle:s,connectionIcon:r,onResourceClick:d,showToolbar:l,emptyMessage:b}=t,T=l===void 0?!0:l,E=b===void 0?"This connection doesn't have any resources yet.":b,R=X().location.href,[u,z]=q.useState(""),[x,j]=q.useState("table"),[f,g]=q.useState("name"),[i,p]=q.useState("asc");let w;e[0]!==i||e[1]!==f?(w=c=>{f===c?(p(Ue),i==="desc"&&g(void 0)):(g(c),p("asc"))},e[0]=i,e[1]=f,e[2]=w):w=e[2];const m=w;let D;e[3]!==d?(D=c=>{d&&d(c)},e[3]=d,e[4]=D):D=e[4];const V=D;let v;if(e[5]!==n||e[6]!==u||e[7]!==i||e[8]!==f){const c=!n||n.length===0?[]:u.trim()?(()=>{const P=u.toLowerCase();return n.filter(M=>M.uri.toLowerCase().includes(P)||M.name&&M.name.toLowerCase().includes(P)||M.description&&M.description.toLowerCase().includes(P))})():n;v=!f||!i?c:[...c].sort((P,M)=>{const h=P[f]||"",K=M[f]||"",B=String(h).localeCompare(String(K));return i==="asc"?B:-B}),e[5]=n,e[6]=u,e[7]=i,e[8]=f,e[9]=v}else v=e[9];const k=v;let _;e[10]===Symbol.for("react.memo_cache_sentinel")?(_=[{id:"name",header:"Name",render:Be,sortable:!0},{id:"uri",header:"URI",render:Oe,sortable:!0},{id:"description",header:"Description",render:De,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:Ee,sortable:!0}],e[10]=_):_=e[10];const $=_;let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=$.filter(Ae).map(Ve),e[11]=N):N=e[11];const O=N;let L;e[12]!==r||e[13]!==s||e[14]!==m||e[15]!==T||e[16]!==i||e[17]!==f||e[18]!==R||e[19]!==x?(L=T&&o.jsxs(te,{children:[o.jsx(oe,{viewMode:x,onViewModeChange:j,sortKey:f,sortDirection:i,onSort:m,sortOptions:O}),o.jsx(re,{title:s?`${s}: Resources`:"Resources",url:R,icon:r??"folder"})]}),e[12]=r,e[13]=s,e[14]=m,e[15]=T,e[16]=i,e[17]=f,e[18]=R,e[19]=x,e[20]=L):L=e[20];let a;e[21]===Symbol.for("react.memo_cache_sentinel")?(a=c=>{c.key==="Escape"&&(z(""),c.target.blur())},e[21]=a):a=e[21];let A;e[22]!==u?(A=o.jsx(se,{value:u,onChange:z,placeholder:"Search resources...",onKeyDown:a}),e[22]=u,e[23]=A):A=e[23];let y;e[24]!==E||e[25]!==V||e[26]!==m||e[27]!==u||e[28]!==i||e[29]!==f||e[30]!==k||e[31]!==x?(y=x==="cards"?o.jsx("div",{className:"flex-1 overflow-auto p-5",children:k.length===0?o.jsx(G,{image:null,title:u?"No resources found":"No resources available",description:u?"Try adjusting your search terms":E}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:k.map(c=>o.jsx(ie,{className:"cursor-pointer transition-colors",onClick:()=>V(c),children:o.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[o.jsx(Y,{icon:null,name:c.name||c.uri,size:"md",className:"shrink-0 shadow-sm"}),o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:c.name||c.uri}),o.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:c.uri}),c.description&&o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:c.description})]})]})},c.uri))})}):o.jsx(ne,{columns:$,data:k,isLoading:!1,sortKey:f,sortDirection:i,onSort:m,onRowClick:c=>V(c),emptyState:o.jsx(G,{image:null,title:u?"No resources found":"No resources available",description:u?"Try adjusting your search terms":E})}),e[24]=E,e[25]=V,e[26]=m,e[27]=u,e[28]=i,e[29]=f,e[30]=k,e[31]=x,e[32]=y):y=e[32];let S;e[33]!==A||e[34]!==y?(S=o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[A,y]}),e[33]=A,e[34]=y,e[35]=S):S=e[35];let C;return e[36]!==S||e[37]!==L?(C=o.jsxs(o.Fragment,{children:[L,S]}),e[36]=S,e[37]=L,e[38]=C):C=e[38],C}function Ve(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Ae(t){return t.sortable}function Ee(t){return o.jsx("span",{className:"text-sm text-muted-foreground",children:t.mimeType||"—"})}function De(t){return o.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function Oe(t){return o.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:t.uri})}function Be(t){return o.jsx("span",{className:"text-sm font-medium text-foreground",children:t.name||t.uri})}function Ue(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Ke(t){const e=Q.c(6),{resources:n,connectionId:s,org:r}=t,d=J(s),l=d?.title,b=d?.icon;let T;return e[0]!==s||e[1]!==r||e[2]!==n||e[3]!==l||e[4]!==b?(T=o.jsx(Me,{resources:n,connectionId:s,org:r,connectionTitle:l,connectionIcon:b}),e[0]=s,e[1]=r,e[2]=n,e[3]=l,e[4]=b,e[5]=T):T=e[5],T}function ze(t){const e=Q.c(5),{tools:n,connectionId:s,org:r,isLoading:d}=t;let l;return e[0]!==s||e[1]!==d||e[2]!==r||e[3]!==n?(l=o.jsx(Te,{tools:n,connectionId:s,org:r,isLoading:d}),e[0]=s,e[1]=d,e[2]=r,e[3]=n,e[4]=l):l=e[4],l}function qe(t){const e=Q.c(66),{connection:n,connectionId:s,org:r,requestedTabId:d,collections:l,onUpdate:b,isUpdating:T,prompts:E,resources:I,tools:R,isLoadingTools:u}=t,z=me();let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x={from:"/$org/mcps/$connectionId"},e[0]=x):x=e[0];const j=H(x);let f;e[1]!==s?(f={connectionId:s},e[1]=s,e[2]=f):f=e[2];const g=ue(f),i=g.isAuthenticated,p=n?.metadata?.repository,w=!!p?.url,m=R.length,D=E.length,V=I.length,v=m>0||u;let k;e[3]===Symbol.for("react.memo_cache_sentinel")?(k={id:"settings",label:"Settings"},e[3]=k):k=e[3];let _;e[4]!==u||e[5]!==i||e[6]!==v||e[7]!==m?(_=i&&v?[{id:"tools",label:"Tools",count:u?void 0:m}]:[],e[4]=u,e[5]=i,e[6]=v,e[7]=m,e[8]=_):_=e[8];let $;e[9]!==i||e[10]!==D?($=i&&D>0?[{id:"prompts",label:"Prompts",count:D}]:[],e[9]=i,e[10]=D,e[11]=$):$=e[11];let N;e[12]!==i||e[13]!==V?(N=i&&V>0?[{id:"resources",label:"Resources",count:V}]:[],e[12]=i,e[13]=V,e[14]=N):N=e[14];let O;if(e[15]!==l||e[16]!==w||e[17]!==i||e[18]!==_||e[19]!==$||e[20]!==N){let U;e[22]!==w?(U=w?[{id:"readme",label:"README"}]:[],e[22]=w,e[23]=U):U=e[23],O=[k,..._,...$,...N,...i?(l||[]).map(Qe):[],...U],e[15]=l,e[16]=w,e[17]=i,e[18]=_,e[19]=$,e[20]=N,e[21]=O}else O=e[21];const L=O,a=L.some(U=>U.id===d)?d:"settings";let A;e[24]!==j?(A=U=>{j({search:W=>({...W,tab:U}),replace:!0})},e[24]=j,e[25]=A):A=e[25];const y=A;let S;e[26]!==l?(S=l||[],e[26]=l,e[27]=S):S=e[27];let C;if(e[28]!==a||e[29]!==S){let U;e[31]!==a?(U=W=>W.name===a,e[31]=a,e[32]=U):U=e[32],C=S.find(U),e[28]=a,e[29]=S,e[30]=C}else C=e[30];const c=C;let P;e[33]!==z.history?(P=()=>z.history.back(),e[33]=z.history,e[34]=P):P=e[34];let M;e[35]!==a||e[36]!==y||e[37]!==L?(M=o.jsx(Se,{children:o.jsx(ye,{tabs:L,activeTab:a,onTabChange:y})}),e[35]=a,e[36]=y,e[37]=L,e[38]=M):M=e[38];let h;e[39]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ee,{size:32,className:"animate-spin text-muted-foreground"})}),e[39]=h):h=e[39];let K;e[40]!==c||e[41]!==a||e[42]!==g.hasOAuthToken||e[43]!==g.isServerError||e[44]!==g.supportsOAuth||e[45]!==n||e[46]!==s||e[47]!==y||e[48]!==w||e[49]!==u||e[50]!==i||e[51]!==T||e[52]!==b||e[53]!==r||e[54]!==E||e[55]!==p||e[56]!==I||e[57]!==R?(K=o.jsx(q.Suspense,{fallback:h,children:a==="tools"?o.jsx(ze,{tools:R,connectionId:s,org:r,isLoading:u}):a==="prompts"?o.jsx(Le,{prompts:E,connectionId:s,org:r}):a==="resources"?o.jsx(Ke,{resources:I,connectionId:s,org:r}):a==="settings"?o.jsx(pe,{connection:n,onUpdate:b,isUpdating:T,isMCPAuthenticated:i,supportsOAuth:g.supportsOAuth,hasOAuthToken:g.hasOAuthToken,isServerError:g.isServerError,onViewReadme:w?()=>y("readme"):void 0}):a==="readme"&&w?o.jsx(Pe,{repository:p}):c&&i?o.jsx(ve,{connectionId:s,org:r,activeCollection:c},a):o.jsx(G,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[40]=c,e[41]=a,e[42]=g.hasOAuthToken,e[43]=g.isServerError,e[44]=g.supportsOAuth,e[45]=n,e[46]=s,e[47]=y,e[48]=w,e[49]=u,e[50]=i,e[51]=T,e[52]=b,e[53]=r,e[54]=E,e[55]=p,e[56]=I,e[57]=R,e[58]=K):K=e[58];let B;e[59]!==a||e[60]!==K?(B=o.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:o.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-auto",children:o.jsx(Z,{children:K},a)})}),e[59]=a,e[60]=K,e[61]=B):B=e[61];let F;return e[62]!==P||e[63]!==M||e[64]!==B?(F=o.jsxs(Ce,{onBack:P,children:[M,B]}),e[62]=P,e[63]=M,e[64]=B,e[65]=F):F=e[65],F}function Qe(t){return{id:t.name,label:t.displayName}}function Fe(){const t=Q.c(43);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/mcps/$connectionId"},t[0]=e):e=t[0];const n=H(e);let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/mcps/$connectionId"},t[1]=s):s=t[1];const{connectionId:r,org:d}=ce(s),{org:l}=ae();let b;t[2]===Symbol.for("react.memo_cache_sentinel")?(b={from:"/shell/$org/mcps/$connectionId"},t[2]=b):b=t[2];const E=le(b).tab||"settings",I=J(r),R=he(),u=de(I??void 0);let z;t[3]!==r||t[4]!==l.id?(z={connectionId:r,orgId:l.id},t[3]=r,t[4]=l.id,t[5]=z):z=t[5];const x=xe(z);let j;t[6]!==x?(j={client:x},t[6]=x,t[7]=j):j=t[7];const{data:f}=ge(j);let g;t[8]!==x?(g={client:x},t[8]=x,t[9]=g):g=t[9];const{data:i}=be(g),p=I?.tools&&I.tools.length>0,w=!p;let m;t[10]!==x||t[11]!==w?(m={client:x,enabled:w},t[10]=x,t[11]=w,t[12]=m):m=t[12];const{data:D,isLoading:V}=fe(m);let v;t[13]!==f?.prompts?(v=f?.prompts??[],t[13]=f?.prompts,t[14]=v):v=t[14];let k;t[15]!==v?(k=v.map(He),t[15]=v,t[16]=k):k=t[16];const _=k;let $;t[17]!==i?.resources?($=i?.resources??[],t[17]=i?.resources,t[18]=$):$=t[18];let N;t[19]!==$?(N=$.map(Ge),t[19]=$,t[20]=N):N=t[20];const O=N;let L;t[21]!==I||t[22]!==p||t[23]!==D?.tools?(L=p?I.tools??[]:(D?.tools??[]).map(We),t[21]=I,t[22]=p,t[23]=D?.tools,t[24]=L):L=t[24];const a=L;let A;t[25]!==R.update||t[26]!==r?(A=async C=>{await R.update.mutateAsync({id:r,data:C})},t[25]=R.update,t[26]=r,t[27]=A):A=t[27];const y=A;if(!I){let C;return t[28]!==n||t[29]!==d?(C=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(G,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:o.jsx(je,{variant:"outline",onClick:()=>n({to:"/$org/mcps",params:{org:d}}),children:"Back to connections"})})}),t[28]=n,t[29]=d,t[30]=C):C=t[30],C}let S;return t[31]!==R.update.isPending||t[32]!==u||t[33]!==I||t[34]!==r||t[35]!==y||t[36]!==V||t[37]!==d||t[38]!==_||t[39]!==E||t[40]!==O||t[41]!==a?(S=o.jsx(qe,{org:d,connection:I,connectionId:r,requestedTabId:E,collections:u,onUpdate:y,isUpdating:R.update.isPending,prompts:_,resources:O,tools:a,isLoadingTools:V}),t[31]=R.update.isPending,t[32]=u,t[33]=I,t[34]=r,t[35]=y,t[36]=V,t[37]=d,t[38]=_,t[39]=E,t[40]=O,t[41]=a,t[42]=S):S=t[42],S}function We(t){return{name:t.name,description:t.description,inputSchema:t.inputSchema}}function Ge(t){return{uri:t.uri,name:t.name,description:t.description}}function He(t){return{name:t.name,description:t.description}}function Je(){const t=Q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(Z,{children:o.jsx(q.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:o.jsx(ee,{size:32,className:"animate-spin text-muted-foreground"})}),children:o.jsx(Fe,{})})}),t[0]=e):e=t[0],e}function jo(){const t=Q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(Je,{}),t[0]=e):e=t[0],e}export{jo as default};
@@ -1 +1 @@
1
- import{c as ge,j as e,r as B,u as xe,f as je,g as fe,e as ye,h as ve,d as _e,b as Ce,o as se,k as ke,s as y,_ as Ne}from"./index-DZ0WP9Uu.js";import{C as Se}from"./collection-header-Dc5LPFVH.js";import{C as be}from"./collection-page-DGyQ3ZNG.js";import{C as we}from"./collection-search-Di76L1bf.js";import{C as De}from"./collection-table-wrapper-DHB_EgNT.js";import{C as Te}from"./connection-card-DQrk1HXS.js";import{n as O,E as H,I as Pe}from"./empty-state-BnO7A9lc.js";import{E as Ie}from"./error-boundary-BmoPYDr9.js";import{u as Ve}from"./use-binding-BhZjQhNo.js";import{u as $e,s as Q}from"./use-list-state-Zs89S-QA.js";import{e as Ae}from"./use-collections-Drr6_6fb.js";import{a as Ee,b as Fe}from"./use-connection-Bp7t1xn3.js";import{u as Oe}from"./constants-fPyH6C9l.js";import{f as He,a as Me,b as Be,c as ze,d as Re,e as Ue,A as Xe,g as Le}from"./alert-dialog-DCgyNkDL.js";import{B as We}from"./badge-BfOFucuW.js";import{B as _}from"./button-DMKajqX_.js";import{D as Ke,a as Ge,b as qe,c as Ye,d as Qe,e as Je}from"./dialog-ztR7gCh9.js";import{D as J,a as Z,b as ee,c as $}from"./dropdown-menu-ClnDILPk.js";import{a as Ze,F as h,b as g,c as x,d as j,f}from"./form-ndfdAtTI.js";import{i as te}from"./DotsVertical-1JZvMgtG.js";import{f as et,e as tt,s as M}from"./registry-utils-CpCQJuef.js";import{i as nt}from"./Loading01-BOeR2B8B.js";import{i as ot}from"./Terminal-DGXkCDiq.js";import{s as ne}from"./Trash01-DHhhoDHD.js";import{I as k}from"./input-B0NJeiuT.js";import{S as st,a as rt,b as it,c as at,d as P}from"./select-2zWNvmE1.js";import{T as ct}from"./textarea-BE-RZN1V.js";import{g as lt}from"./generate-id-Dyweu44Y.js";import{i as dt,r as ut,E as mt,e as re}from"./env-vars-editor-BcnJ-LB5.js";import"./collection-display-button-BVh1TgBj.js";import"./ArrowUp-CxSqAFHI.js";import"./Check-fIeUq0Tl.js";import"./Grid01-D89OcY09.js";import"./List-G-H7B3e1.js";import"./tooltip-CzB50oKO.js";import"./view-mode-toggle-BrT5iiCv.js";import"./SearchMd-D74Sf-27.js";import"./card-Cx64whKR.js";import"./binder-D14T3-AY.js";import"./use-mobile-BrgiFD7w.js";import"./useMutation-BSgCoYc_.js";import"./useQuery-CpAu1eM3.js";import"./X-BAy7Mfyd.js";import"./ChevronDown-aJJ6RgWv.js";import"./Plus-CROcV2-u.js";const pt=se({key:y(),value:y()}),ht=se({title:y().min(1,"Name is required"),description:y().nullable().optional(),ui_type:Ne(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:y().optional(),connection_token:y().nullable().optional(),npx_package:y().optional(),stdio_command:y().optional(),stdio_args:y().optional(),stdio_cwd:y().optional(),env_vars:ke(pt).optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function E(n){const s=n.trim();if(!s)return"";try{const i=new URL(s),d=i.pathname.length>1?i.pathname.replace(/\/+$/,""):i.pathname;return`${i.origin}${d}`}catch{return s.replace(/\/+$/,"")}}function gt(n){const s=n.trim().split(/\s+/).filter(Boolean);if(s.length<2)return null;const i=s[0]?.toLowerCase();if(i!=="npx"&&i!=="bunx")return null;const m=s.slice(1).find(a=>!a.startsWith("-"));return m?{packageName:m}:null}function A(n){const{uiType:s}=n,i=E(n.connectionUrl??"");if((s==="HTTP"||s==="SSE"||s==="Websocket")&&i===E("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const d=(n.npxPackage??"").trim();return s==="NPX"&&d==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function oe(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const s=E(n.connectionUrl??"");if(!s)return null;const i=n.registryItems.find(a=>(a.server?.remotes??[]).some(N=>E(N.url??"")===s));if(!i)return null;const d=i.title||i.name||i.server?.title||i.server?.name||"",m=i.server?.description||i.description||i.summary||null;return d?{id:"registry",title:d,description:m}:null}function xt(n,s){const i={command:"npx",args:["-y",n]},d=re(s);return Object.keys(d).length>0&&(i.envVars=d),i}function jt(n,s,i,d){const m={command:n};s.trim()&&(m.args=s.trim().split(/\s+/)),i?.trim()&&(m.cwd=i.trim());const a=re(d);return Object.keys(a).length>0&&(m.envVars=a),m}function ft(n){return n.command==="npx"}function yt(n){return n.args?.find(s=>!s.startsWith("-"))??""}function vt(n){return{command:n.command,args:n.args?.join(" ")??"",cwd:n.cwd??""}}function _t(n,s){switch(s.type){case"edit":return{mode:"editing",connection:s.connection};case"delete":return{mode:"deleting",connection:s.connection};case"close":return{mode:"idle"}}}function Ct(){const{org:n}=xe(),s=je(),i=fe({strict:!1}),{data:d}=ye.useSession(),{stdioEnabled:m}=ve(),a=$e({namespace:n.slug,resource:"connections"}),I=Ee(),N=Fe(a),[v,S]=B.useReducer(_t,{mode:"idle"}),z=Ve(N)[0],R=z?.id??"",U=et(z?.tools),ie=Oe({connectionId:R||null,orgId:n.id}),{data:ae}=Ae({client:ie,toolName:U,toolArguments:{limit:200},enabled:!!(R&&U),staleTime:3600*1e3,select:t=>t.structuredContent??t}),X=tt(ae??[]),L=i.action==="create",ce=()=>{s({to:"/$org/mcps",params:{org:n.slug},search:{action:"create"}})},W=()=>{s({to:"/$org/mcps",params:{org:n.slug},search:{}})},r=_e({resolver:Ce(ht),defaultValues:{title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),u=r.watch("ui_type"),K=r.watch("connection_url"),le=r.watch("npx_package"),D=A({uiType:u,connectionUrl:K??"",npxPackage:le??""})??oe({uiType:u,connectionUrl:K??"",registryItems:X}),l=v.mode==="editing"?v.connection:null;B.useEffect(()=>{if(l){const t=dt(l.connection_headers)?l.connection_headers:null;if(t&&l.connection_type==="STDIO"){const o=ut(t.envVars);if(ft(t)){const c=yt(t);r.reset({title:l.title,description:l.description,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:c,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:o})}else{const c=vt(t);r.reset({title:l.title,description:l.description,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:c.command,stdio_args:c.args,stdio_cwd:c.cwd,env_vars:o})}}else r.reset({title:l.title,description:l.description,ui_type:l.connection_type,connection_url:l.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})}else r.reset({title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})},[l,r]);const de=async()=>{if(v.mode!=="deleting")return;const t=v.connection.id;S({type:"close"});try{await I.delete.mutateAsync(t)}catch{}},ue=async t=>{let o,c=null,b=null,C=null;if(t.ui_type==="NPX"?(o="STDIO",c="",C=xt(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(o="STDIO",c="",C=jt(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(o=t.ui_type,c=t.connection_url||"",b=t.connection_token||null),l){await I.update.mutateAsync({id:l.id,data:{title:t.title,description:t.description||null,connection_type:o,connection_url:c,...b&&{connection_token:b},...C&&{connection_headers:C}}}),S({type:"close"}),r.reset();return}const w=lt("conn");await I.create.mutateAsync({id:w,title:t.title,description:t.description||null,connection_type:o,connection_url:c,connection_token:b,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:d?.user?.id||"system",organization_id:n.id,icon:null,app_name:null,app_id:null,connection_headers:C,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),W(),r.reset(),s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:w}})},G=t=>{t||(L?W():S({type:"close"}),r.reset())},V=t=>{const o=t.trim();if(!o)return;const c=!!r.formState.dirtyFields.title,b=!!r.formState.dirtyFields.description,C=!!r.formState.dirtyFields.env_vars,w=p=>{if(p&&(!c&&!r.getValues("title").trim()&&p.title&&r.setValue("title",p.title,{shouldDirty:!1}),!b&&!(r.getValues("description")??"").trim()&&p.description&&r.setValue("description",p.description,{shouldDirty:!1}),!C&&p.envVarKeys?.length)){const q=r.getValues("env_vars")??[],he=new Set(q.map(T=>T.key)),Y=p.envVarKeys.filter(T=>!he.has(T));Y.length>0&&r.setValue("env_vars",[...q,...Y.map(T=>({key:T,value:""}))],{shouldDirty:!0})}},F=gt(o);if(F&&m){r.setValue("ui_type","NPX",{shouldDirty:!0}),r.setValue("npx_package",F.packageName,{shouldDirty:!0}),r.setValue("connection_url","",{shouldDirty:!0}),r.setValue("connection_token",null,{shouldDirty:!0}),w(A({uiType:"NPX",npxPackage:F.packageName}));return}if(o.startsWith("http://")||o.startsWith("https://")){const p=u==="HTTP"||u==="SSE"||u==="Websocket"?u:"HTTP";r.setValue("ui_type",p,{shouldDirty:!0}),r.setValue("connection_url",o,{shouldDirty:!0}),w(A({uiType:p,connectionUrl:o})??oe({uiType:p,connectionUrl:o,registryItems:X}));return}u==="NPX"&&w(A({uiType:"NPX",npxPackage:o}))},me=[{id:"icon",header:"",render:t=>e.jsx(Pe,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:e.jsx(O,{})}),cellClassName:"w-16 shrink-0",wrap:!0},{id:"title",header:"Name",render:t=>e.jsx("span",{className:"text-sm font-medium text-foreground truncate block",title:t.title,children:t.title}),cellClassName:"w-48 max-w-48 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:t=>e.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:t.description||"—"}),cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},{id:"connection_type",header:"Type",accessor:t=>e.jsx("span",{className:"text-sm font-medium",children:t.connection_type}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"connection_url",header:"URL",render:t=>{const o=t.connection_url??"",c=o.length>40?`${o.slice(0,40)}...`:o;return e.jsx("span",{className:"text-sm text-muted-foreground",children:c})},cellClassName:"w-48 min-w-0 shrink-0"},{id:"status",header:"Status",render:t=>e.jsx(We,{variant:t.status==="active"?"success":"outline",children:t.status}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:t=>e.jsxs(J,{children:[e.jsx(Z,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:e.jsx(te,{size:20})})}),e.jsxs(ee,{align:"end",onClick:o=>o.stopPropagation(),children:[e.jsxs($,{onClick:o=>{o.stopPropagation(),s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}})},children:[e.jsx(Q,{size:16}),"Open"]}),e.jsxs($,{variant:"destructive",onClick:o=>{o.stopPropagation(),S({type:"delete",connection:t})},children:[e.jsx(ne,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],pe=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{variant:"outline",onClick:()=>s({to:"/$org/store",params:{org:n.slug}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e.jsx(_,{onClick:ce,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})]});return e.jsxs(be,{children:[e.jsx(Ke,{open:L||v.mode==="editing",onOpenChange:G,children:e.jsxs(Ge,{className:"sm:max-w-[525px]",children:[e.jsxs(qe,{children:[e.jsx(Ye,{children:l?"Edit Connection":"Create Connection"}),e.jsx(Qe,{children:l?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),e.jsx(Ze,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(ue),children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsx(h,{control:r.control,name:"ui_type",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Type *"}),e.jsxs(st,{value:t.value,onValueChange:t.onChange,children:[e.jsx(j,{children:e.jsx(rt,{children:e.jsx(it,{})})}),e.jsxs(at,{children:[e.jsx(P,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx(P,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"w-4 h-4"}),"SSE"]})}),e.jsx(P,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"w-4 h-4"}),"Websocket"]})}),m&&e.jsxs(e.Fragment,{children:[e.jsx(P,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(O,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx(P,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(ot,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(f,{})]})}),u==="NPX"&&e.jsx(e.Fragment,{children:e.jsx(h,{control:r.control,name:"npx_package",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"NPM Package *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"@perplexity-ai/mcp-server",...t,value:t.value??"",onPaste:o=>{const c=o.clipboardData.getData("text");c&&(o.preventDefault(),r.setValue("npx_package",c.trim(),{shouldDirty:!0}),V(c))},onBlur:o=>{V(o.target.value),t.onBlur()}})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The npm package to run with npx"}),e.jsx(f,{})]})})}),u==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(h,{control:r.control,name:"stdio_command",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Command *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"node, bun, python...",...t,value:t.value??""})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"stdio_args",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Arguments"}),e.jsx(j,{children:e.jsx(k,{placeholder:"arg1 arg2 --flag value",...t,value:t.value??""})}),e.jsx(f,{})]})})]}),e.jsx(h,{control:r.control,name:"stdio_cwd",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Working Directory"}),e.jsx(j,{children:e.jsx(k,{placeholder:"/path/to/project (optional)",...t,value:t.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(f,{})]})})]}),(u==="NPX"||u==="STDIO")&&e.jsx(h,{control:r.control,name:"env_vars",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Environment Variables"}),e.jsx(j,{children:e.jsx(mt,{value:t.value??[],onChange:t.onChange})}),e.jsx(f,{})]})}),u!=="NPX"&&u!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(h,{control:r.control,name:"connection_url",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"URL *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"https://example.com/mcp",...t,value:t.value??"",onPaste:o=>{const c=o.clipboardData.getData("text");c&&(o.preventDefault(),r.setValue("connection_url",c.trim(),{shouldDirty:!0}),V(c))},onBlur:o=>{V(o.target.value),t.onBlur()}})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"connection_token",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:D?.token?.label??"Token (optional)"}),e.jsx(j,{children:e.jsx(k,{type:"password",placeholder:D?.token?.placeholder??"Bearer token or API key",...t,value:t.value??""})}),D?.token?.helperText&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[D.token.helperText,D.id==="github"&&e.jsxs(e.Fragment,{children:[" ","·"," ",e.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),e.jsx(f,{})]})})]}),e.jsx(h,{control:r.control,name:"title",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Name *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"My Connection",...t})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"description",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Description"}),e.jsx(j,{children:e.jsx(ct,{placeholder:"A brief description of this connection",rows:3,...t,value:t.value??""})}),e.jsx(f,{})]})})]}),e.jsxs(Je,{children:[e.jsx(_,{type:"button",variant:"outline",onClick:()=>G(!1),children:"Cancel"}),e.jsx(_,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:r.formState.isSubmitting?"Saving...":l?"Update Connection":"Create Connection"})]})]})})]})}),e.jsx(He,{open:v.mode==="deleting",onOpenChange:t=>!t&&S({type:"close"}),children:e.jsxs(Me,{children:[e.jsxs(Be,{children:[e.jsx(ze,{children:"Delete Connection?"}),e.jsxs(Re,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:v.mode==="deleting"&&v.connection.title}),"."]})]}),e.jsxs(Ue,{children:[e.jsx(Xe,{children:"Cancel"}),e.jsx(Le,{onClick:de,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),e.jsx(Se,{title:"Connections",viewMode:a.viewMode,onViewModeChange:a.setViewMode,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"status",label:"Status"}],ctaButton:pe}),e.jsx(we,{value:a.search,onChange:a.setSearch,placeholder:"Search for a Connection...",onKeyDown:t=>{t.key==="Escape"&&(a.setSearch(""),t.target.blur())}}),a.viewMode==="cards"?e.jsx("div",{className:"flex-1 overflow-auto p-5",children:N.length===0?e.jsx(H,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:(a.search,"No Connections found"),description:a.search?`No Connections match "${a.search}"`:"Create a connection to get started.",actions:!a.search&&e.jsx(_,{variant:"outline",onClick:()=>s({to:"/$org/store",params:{org:n.slug}}),children:"Browse Store"})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:N.map(t=>e.jsx(Te,{connection:t,fallbackIcon:e.jsx(O,{}),onClick:()=>s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}}),headerActions:e.jsxs(J,{children:[e.jsx(Z,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:e.jsx(te,{size:20})})}),e.jsxs(ee,{align:"end",onClick:o=>o.stopPropagation(),children:[e.jsxs($,{onClick:o=>{o.stopPropagation(),s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}})},children:[e.jsx(Q,{size:16}),"Open"]}),e.jsxs($,{variant:"destructive",onClick:o=>{o.stopPropagation(),S({type:"delete",connection:t})},children:[e.jsx(ne,{size:16}),"Delete"]})]})]})},t.id))})}):e.jsx(De,{columns:me,data:N,isLoading:!1,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,onRowClick:t=>s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}}),emptyState:a.search?e.jsx(H,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:`No Connections match "${a.search}"`}):e.jsx(H,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:"Create a connection to get started.",actions:e.jsx(_,{variant:"outline",onClick:()=>s({to:"/$org/store",params:{org:n.slug}}),children:"Browse Store"})})})]})}function gn(){const n=ge.c(1);let s;return n[0]===Symbol.for("react.memo_cache_sentinel")?(s=e.jsx(Ie,{children:e.jsx(B.Suspense,{fallback:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(nt,{size:32,className:"animate-spin text-muted-foreground"})}),children:e.jsx(Ct,{})})}),n[0]=s):s=n[0],s}export{gn as default};
1
+ import{c as ge,j as e,r as B,u as xe,f as je,g as fe,e as ye,h as ve,d as _e,b as Ce,o as se,k as ke,s as y,_ as Ne}from"./index-DHBTmGle.js";import{C as Se}from"./collection-header-BxJ-Ykas.js";import{C as be}from"./collection-page-DgidS8rt.js";import{C as we}from"./collection-search-DITQLAqZ.js";import{C as De}from"./collection-table-wrapper-CD2w-c2k.js";import{C as Te}from"./connection-card-BOJTYC0z.js";import{n as O,E as H,I as Pe}from"./empty-state-mW4i8Pk5.js";import{E as Ie}from"./error-boundary-BhvmEiaO.js";import{u as Ve}from"./use-binding-C_F3xeC_.js";import{u as $e,s as Q}from"./use-list-state-BOP_Nd4C.js";import{e as Ae}from"./use-collections-CToBNrWq.js";import{a as Ee,b as Fe}from"./use-connection-DAX6ty9k.js";import{u as Oe}from"./constants-BVdHh4aD.js";import{f as He,a as Me,b as Be,c as ze,d as Re,e as Ue,A as Xe,g as Le}from"./alert-dialog-BsUKy6x1.js";import{B as We}from"./badge-Cg-cVOUM.js";import{B as _}from"./button-BJ3HWp7I.js";import{D as Ke,a as Ge,b as qe,c as Ye,d as Qe,e as Je}from"./dialog-DsV8m8rX.js";import{D as J,a as Z,b as ee,c as $}from"./dropdown-menu-B1OcMuo7.js";import{a as Ze,F as h,b as g,c as x,d as j,f}from"./form-D6hs_qye.js";import{i as te}from"./DotsVertical-kAKCLT6g.js";import{f as et,e as tt,s as M}from"./registry-utils-BCHz1L7j.js";import{i as nt}from"./Loading01-BJHzsSlY.js";import{i as ot}from"./Terminal-BBj7QyID.js";import{s as ne}from"./Trash01-Wrvcbt0u.js";import{I as k}from"./input-7ruC6uFX.js";import{S as st,a as rt,b as it,c as at,d as P}from"./select-BWkItg_a.js";import{T as ct}from"./textarea-vxMnbGid.js";import{g as lt}from"./generate-id-Dyweu44Y.js";import{i as dt,r as ut,E as mt,e as re}from"./env-vars-editor-f0zQEaJU.js";import"./collection-display-button-D900xq_7.js";import"./ArrowUp-bzciqS-L.js";import"./Check-0BeRG3Sh.js";import"./Grid01-BV5dHi3R.js";import"./List-B-KIt-jD.js";import"./tooltip-BuUNB1mb.js";import"./view-mode-toggle-P81vIwwH.js";import"./SearchMd-4iIwSESe.js";import"./card-VfXRHGnT.js";import"./binder-DLTRuBUr.js";import"./use-mobile-B7Yc-x5B.js";import"./useMutation-BL6IQ2sq.js";import"./useQuery-6rF_dd3c.js";import"./X-CgDprUQG.js";import"./ChevronDown-DSaGHwzQ.js";import"./Plus-DOEL_hbF.js";const pt=se({key:y(),value:y()}),ht=se({title:y().min(1,"Name is required"),description:y().nullable().optional(),ui_type:Ne(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:y().optional(),connection_token:y().nullable().optional(),npx_package:y().optional(),stdio_command:y().optional(),stdio_args:y().optional(),stdio_cwd:y().optional(),env_vars:ke(pt).optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function E(n){const s=n.trim();if(!s)return"";try{const i=new URL(s),d=i.pathname.length>1?i.pathname.replace(/\/+$/,""):i.pathname;return`${i.origin}${d}`}catch{return s.replace(/\/+$/,"")}}function gt(n){const s=n.trim().split(/\s+/).filter(Boolean);if(s.length<2)return null;const i=s[0]?.toLowerCase();if(i!=="npx"&&i!=="bunx")return null;const m=s.slice(1).find(a=>!a.startsWith("-"));return m?{packageName:m}:null}function A(n){const{uiType:s}=n,i=E(n.connectionUrl??"");if((s==="HTTP"||s==="SSE"||s==="Websocket")&&i===E("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const d=(n.npxPackage??"").trim();return s==="NPX"&&d==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function oe(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const s=E(n.connectionUrl??"");if(!s)return null;const i=n.registryItems.find(a=>(a.server?.remotes??[]).some(N=>E(N.url??"")===s));if(!i)return null;const d=i.title||i.name||i.server?.title||i.server?.name||"",m=i.server?.description||i.description||i.summary||null;return d?{id:"registry",title:d,description:m}:null}function xt(n,s){const i={command:"npx",args:["-y",n]},d=re(s);return Object.keys(d).length>0&&(i.envVars=d),i}function jt(n,s,i,d){const m={command:n};s.trim()&&(m.args=s.trim().split(/\s+/)),i?.trim()&&(m.cwd=i.trim());const a=re(d);return Object.keys(a).length>0&&(m.envVars=a),m}function ft(n){return n.command==="npx"}function yt(n){return n.args?.find(s=>!s.startsWith("-"))??""}function vt(n){return{command:n.command,args:n.args?.join(" ")??"",cwd:n.cwd??""}}function _t(n,s){switch(s.type){case"edit":return{mode:"editing",connection:s.connection};case"delete":return{mode:"deleting",connection:s.connection};case"close":return{mode:"idle"}}}function Ct(){const{org:n}=xe(),s=je(),i=fe({strict:!1}),{data:d}=ye.useSession(),{stdioEnabled:m}=ve(),a=$e({namespace:n.slug,resource:"connections"}),I=Ee(),N=Fe(a),[v,S]=B.useReducer(_t,{mode:"idle"}),z=Ve(N)[0],R=z?.id??"",U=et(z?.tools),ie=Oe({connectionId:R||null,orgId:n.id}),{data:ae}=Ae({client:ie,toolName:U,toolArguments:{limit:200},enabled:!!(R&&U),staleTime:3600*1e3,select:t=>t.structuredContent??t}),X=tt(ae??[]),L=i.action==="create",ce=()=>{s({to:"/$org/mcps",params:{org:n.slug},search:{action:"create"}})},W=()=>{s({to:"/$org/mcps",params:{org:n.slug},search:{}})},r=_e({resolver:Ce(ht),defaultValues:{title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),u=r.watch("ui_type"),K=r.watch("connection_url"),le=r.watch("npx_package"),D=A({uiType:u,connectionUrl:K??"",npxPackage:le??""})??oe({uiType:u,connectionUrl:K??"",registryItems:X}),l=v.mode==="editing"?v.connection:null;B.useEffect(()=>{if(l){const t=dt(l.connection_headers)?l.connection_headers:null;if(t&&l.connection_type==="STDIO"){const o=ut(t.envVars);if(ft(t)){const c=yt(t);r.reset({title:l.title,description:l.description,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:c,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:o})}else{const c=vt(t);r.reset({title:l.title,description:l.description,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:c.command,stdio_args:c.args,stdio_cwd:c.cwd,env_vars:o})}}else r.reset({title:l.title,description:l.description,ui_type:l.connection_type,connection_url:l.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})}else r.reset({title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})},[l,r]);const de=async()=>{if(v.mode!=="deleting")return;const t=v.connection.id;S({type:"close"});try{await I.delete.mutateAsync(t)}catch{}},ue=async t=>{let o,c=null,b=null,C=null;if(t.ui_type==="NPX"?(o="STDIO",c="",C=xt(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(o="STDIO",c="",C=jt(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(o=t.ui_type,c=t.connection_url||"",b=t.connection_token||null),l){await I.update.mutateAsync({id:l.id,data:{title:t.title,description:t.description||null,connection_type:o,connection_url:c,...b&&{connection_token:b},...C&&{connection_headers:C}}}),S({type:"close"}),r.reset();return}const w=lt("conn");await I.create.mutateAsync({id:w,title:t.title,description:t.description||null,connection_type:o,connection_url:c,connection_token:b,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:d?.user?.id||"system",organization_id:n.id,icon:null,app_name:null,app_id:null,connection_headers:C,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),W(),r.reset(),s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:w}})},G=t=>{t||(L?W():S({type:"close"}),r.reset())},V=t=>{const o=t.trim();if(!o)return;const c=!!r.formState.dirtyFields.title,b=!!r.formState.dirtyFields.description,C=!!r.formState.dirtyFields.env_vars,w=p=>{if(p&&(!c&&!r.getValues("title").trim()&&p.title&&r.setValue("title",p.title,{shouldDirty:!1}),!b&&!(r.getValues("description")??"").trim()&&p.description&&r.setValue("description",p.description,{shouldDirty:!1}),!C&&p.envVarKeys?.length)){const q=r.getValues("env_vars")??[],he=new Set(q.map(T=>T.key)),Y=p.envVarKeys.filter(T=>!he.has(T));Y.length>0&&r.setValue("env_vars",[...q,...Y.map(T=>({key:T,value:""}))],{shouldDirty:!0})}},F=gt(o);if(F&&m){r.setValue("ui_type","NPX",{shouldDirty:!0}),r.setValue("npx_package",F.packageName,{shouldDirty:!0}),r.setValue("connection_url","",{shouldDirty:!0}),r.setValue("connection_token",null,{shouldDirty:!0}),w(A({uiType:"NPX",npxPackage:F.packageName}));return}if(o.startsWith("http://")||o.startsWith("https://")){const p=u==="HTTP"||u==="SSE"||u==="Websocket"?u:"HTTP";r.setValue("ui_type",p,{shouldDirty:!0}),r.setValue("connection_url",o,{shouldDirty:!0}),w(A({uiType:p,connectionUrl:o})??oe({uiType:p,connectionUrl:o,registryItems:X}));return}u==="NPX"&&w(A({uiType:"NPX",npxPackage:o}))},me=[{id:"icon",header:"",render:t=>e.jsx(Pe,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:e.jsx(O,{})}),cellClassName:"w-16 shrink-0",wrap:!0},{id:"title",header:"Name",render:t=>e.jsx("span",{className:"text-sm font-medium text-foreground truncate block",title:t.title,children:t.title}),cellClassName:"w-48 max-w-48 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:t=>e.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:t.description||"—"}),cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},{id:"connection_type",header:"Type",accessor:t=>e.jsx("span",{className:"text-sm font-medium",children:t.connection_type}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"connection_url",header:"URL",render:t=>{const o=t.connection_url??"",c=o.length>40?`${o.slice(0,40)}...`:o;return e.jsx("span",{className:"text-sm text-muted-foreground",children:c})},cellClassName:"w-48 min-w-0 shrink-0"},{id:"status",header:"Status",render:t=>e.jsx(We,{variant:t.status==="active"?"success":"outline",children:t.status}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:t=>e.jsxs(J,{children:[e.jsx(Z,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:e.jsx(te,{size:20})})}),e.jsxs(ee,{align:"end",onClick:o=>o.stopPropagation(),children:[e.jsxs($,{onClick:o=>{o.stopPropagation(),s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}})},children:[e.jsx(Q,{size:16}),"Open"]}),e.jsxs($,{variant:"destructive",onClick:o=>{o.stopPropagation(),S({type:"delete",connection:t})},children:[e.jsx(ne,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],pe=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{variant:"outline",onClick:()=>s({to:"/$org/store",params:{org:n.slug}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e.jsx(_,{onClick:ce,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})]});return e.jsxs(be,{children:[e.jsx(Ke,{open:L||v.mode==="editing",onOpenChange:G,children:e.jsxs(Ge,{className:"sm:max-w-[525px]",children:[e.jsxs(qe,{children:[e.jsx(Ye,{children:l?"Edit Connection":"Create Connection"}),e.jsx(Qe,{children:l?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),e.jsx(Ze,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(ue),children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsx(h,{control:r.control,name:"ui_type",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Type *"}),e.jsxs(st,{value:t.value,onValueChange:t.onChange,children:[e.jsx(j,{children:e.jsx(rt,{children:e.jsx(it,{})})}),e.jsxs(at,{children:[e.jsx(P,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx(P,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"w-4 h-4"}),"SSE"]})}),e.jsx(P,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"w-4 h-4"}),"Websocket"]})}),m&&e.jsxs(e.Fragment,{children:[e.jsx(P,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(O,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx(P,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(ot,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(f,{})]})}),u==="NPX"&&e.jsx(e.Fragment,{children:e.jsx(h,{control:r.control,name:"npx_package",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"NPM Package *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"@perplexity-ai/mcp-server",...t,value:t.value??"",onPaste:o=>{const c=o.clipboardData.getData("text");c&&(o.preventDefault(),r.setValue("npx_package",c.trim(),{shouldDirty:!0}),V(c))},onBlur:o=>{V(o.target.value),t.onBlur()}})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The npm package to run with npx"}),e.jsx(f,{})]})})}),u==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(h,{control:r.control,name:"stdio_command",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Command *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"node, bun, python...",...t,value:t.value??""})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"stdio_args",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Arguments"}),e.jsx(j,{children:e.jsx(k,{placeholder:"arg1 arg2 --flag value",...t,value:t.value??""})}),e.jsx(f,{})]})})]}),e.jsx(h,{control:r.control,name:"stdio_cwd",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Working Directory"}),e.jsx(j,{children:e.jsx(k,{placeholder:"/path/to/project (optional)",...t,value:t.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(f,{})]})})]}),(u==="NPX"||u==="STDIO")&&e.jsx(h,{control:r.control,name:"env_vars",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Environment Variables"}),e.jsx(j,{children:e.jsx(mt,{value:t.value??[],onChange:t.onChange})}),e.jsx(f,{})]})}),u!=="NPX"&&u!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(h,{control:r.control,name:"connection_url",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"URL *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"https://example.com/mcp",...t,value:t.value??"",onPaste:o=>{const c=o.clipboardData.getData("text");c&&(o.preventDefault(),r.setValue("connection_url",c.trim(),{shouldDirty:!0}),V(c))},onBlur:o=>{V(o.target.value),t.onBlur()}})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"connection_token",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:D?.token?.label??"Token (optional)"}),e.jsx(j,{children:e.jsx(k,{type:"password",placeholder:D?.token?.placeholder??"Bearer token or API key",...t,value:t.value??""})}),D?.token?.helperText&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[D.token.helperText,D.id==="github"&&e.jsxs(e.Fragment,{children:[" ","·"," ",e.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),e.jsx(f,{})]})})]}),e.jsx(h,{control:r.control,name:"title",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Name *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"My Connection",...t})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"description",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Description"}),e.jsx(j,{children:e.jsx(ct,{placeholder:"A brief description of this connection",rows:3,...t,value:t.value??""})}),e.jsx(f,{})]})})]}),e.jsxs(Je,{children:[e.jsx(_,{type:"button",variant:"outline",onClick:()=>G(!1),children:"Cancel"}),e.jsx(_,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:r.formState.isSubmitting?"Saving...":l?"Update Connection":"Create Connection"})]})]})})]})}),e.jsx(He,{open:v.mode==="deleting",onOpenChange:t=>!t&&S({type:"close"}),children:e.jsxs(Me,{children:[e.jsxs(Be,{children:[e.jsx(ze,{children:"Delete Connection?"}),e.jsxs(Re,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:v.mode==="deleting"&&v.connection.title}),"."]})]}),e.jsxs(Ue,{children:[e.jsx(Xe,{children:"Cancel"}),e.jsx(Le,{onClick:de,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),e.jsx(Se,{title:"Connections",viewMode:a.viewMode,onViewModeChange:a.setViewMode,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"status",label:"Status"}],ctaButton:pe}),e.jsx(we,{value:a.search,onChange:a.setSearch,placeholder:"Search for a Connection...",onKeyDown:t=>{t.key==="Escape"&&(a.setSearch(""),t.target.blur())}}),a.viewMode==="cards"?e.jsx("div",{className:"flex-1 overflow-auto p-5",children:N.length===0?e.jsx(H,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:(a.search,"No Connections found"),description:a.search?`No Connections match "${a.search}"`:"Create a connection to get started.",actions:!a.search&&e.jsx(_,{variant:"outline",onClick:()=>s({to:"/$org/store",params:{org:n.slug}}),children:"Browse Store"})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:N.map(t=>e.jsx(Te,{connection:t,fallbackIcon:e.jsx(O,{}),onClick:()=>s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}}),headerActions:e.jsxs(J,{children:[e.jsx(Z,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:e.jsx(te,{size:20})})}),e.jsxs(ee,{align:"end",onClick:o=>o.stopPropagation(),children:[e.jsxs($,{onClick:o=>{o.stopPropagation(),s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}})},children:[e.jsx(Q,{size:16}),"Open"]}),e.jsxs($,{variant:"destructive",onClick:o=>{o.stopPropagation(),S({type:"delete",connection:t})},children:[e.jsx(ne,{size:16}),"Delete"]})]})]})},t.id))})}):e.jsx(De,{columns:me,data:N,isLoading:!1,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,onRowClick:t=>s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}}),emptyState:a.search?e.jsx(H,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:`No Connections match "${a.search}"`}):e.jsx(H,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:"Create a connection to get started.",actions:e.jsx(_,{variant:"outline",onClick:()=>s({to:"/$org/store",params:{org:n.slug}}),children:"Browse Store"})})})]})}function gn(){const n=ge.c(1);let s;return n[0]===Symbol.for("react.memo_cache_sentinel")?(s=e.jsx(Ie,{children:e.jsx(B.Suspense,{fallback:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(nt,{size:32,className:"animate-spin text-muted-foreground"})}),children:e.jsx(Ct,{})})}),n[0]=s):s=n[0],s}export{gn as default};
@@ -1 +1 @@
1
- import{be as u,c as m,l as d,bf as g}from"./index-DZ0WP9Uu.js";const l={authConfig:()=>["authConfig"],threads:e=>["threads",e],virtualMcpThreads:(e,t)=>["threads",e,"virtual-mcp",t],thread:(e,t)=>["thread",e,t],threadMessages:(e,t)=>["thread-messages",e,t],messages:e=>["messages",e],organizations:()=>["organizations"],members:e=>[e,"members"],invitations:e=>[e,"invitations"],organizationRoles:e=>[e,"organization-roles"],connections:e=>[e,"connections"],connectionsByBinding:(e,t)=>[e,"connections",`binding:${t}`],connection:(e,t)=>[e,"connection",t],isMCPAuthenticated:(e,t)=>["is-mcp-authenticated",e,t],mcpTools:(e,t)=>["mcp","tools",e,t],mcpClient:(e,t,n)=>["mcp","client",e,t,n],mcpToolsList:e=>["mcp","client",e,"tools"],mcpResourcesList:e=>["mcp","client",e,"resources"],mcpPromptsList:e=>["mcp","client",e,"prompts"],mcpReadResource:(e,t)=>["mcp","client",e,"resource",t],mcpGetPrompt:(e,t,n)=>["mcp","client",e,"prompt",t,n],mcpToolCall:(e,t,n)=>["mcp","client",e,"tool-call",t,n],organizationSettings:e=>["organization-settings",e],activeOrganization:e=>["activeOrganization",e],modelsList:e=>["models-list",e],connectionCollections:e=>[e,"collections","discovery"],toolCall:(e,t,n)=>["tool-call",e,t,n],collectionItems:(e,t)=>["collection",e,t],collection:(e,t,n)=>[e,t,"collection",n],collectionItem:(e,t,n,o,i)=>[e,t,n,"collection",o,i],collectionList:(e,t,n,o,i)=>[e,t,n,"collection",o,"list",i],collectionListInfinite:(e,t,n,o,i)=>[e,t,n,"collection",o,"list-infinite",i],githubReadme:(e,t)=>["github-readme",e,t],monitoringStats:()=>["monitoring","stats"],monitoringLogs:e=>["monitoring","logs",e],monitoringLogsInfinite:(e,t)=>["monitoring","logs-infinite",e,t],virtualMcpPrompts:e=>["virtual-mcp",e,"prompts"],connectionPrompts:e=>["connection",e,"prompts"],connectionResources:e=>["connection",e,"resources"],user:e=>["user",e]};class f extends u{constructor(t,n){super(t,n)}send(t,n){const o=h(t);return o?.type==="emit"?(this.onmessage?.(o.message),Promise.resolve()):o?.type==="suppress"?Promise.resolve():super.send(t,n)}}function h(e){const t=e;if(!t||typeof t!="object"||!("method"in t))return null;switch(t.method){case"initialize":{const n=t?.params?.protocolVersion;return n?{type:"emit",message:{result:{protocolVersion:n,capabilities:{tools:{},resources:{},prompts:{},tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}},serverInfo:{name:"mesh-virtual-mcp",version:"1.0.0"}},jsonrpc:t.jsonrpc??"2.0",id:t.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}const _={name:"mesh-sdk",version:"1.0.0"};function y(e){if(typeof window>"u")throw new Error("MCP client requires a browser environment.");const t=e?`/mcp/${e}`:"/mcp";return new URL(t,window.location.origin).href}async function C({connectionId:e,orgId:t,token:n}){const o=y(e),i=new g(_,{capabilities:{tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}}}),c=new f(new URL(o),{requestInit:{headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream","x-org-id":t,...n?{Authorization:`Bearer ${n}`}:{}}}});await i.connect(c);const r=l.mcpClient(t,e??"self",n??"");return i.toJSON=()=>`mcp-client:${r.join(":")}`,i}function P(e){const t=m.c(11),{connectionId:n,orgId:o,token:i}=e;let c;t[0]!==n||t[1]!==o||t[2]!==i?(c=l.mcpClient(o,n??"",i??""),t[0]=n,t[1]=o,t[2]=i,t[3]=c):c=t[3];const r=c;let s;t[4]!==n||t[5]!==o||t[6]!==i?(s=()=>C({connectionId:n,orgId:o,token:i}),t[4]=n,t[5]=o,t[6]=i,t[7]=s):s=t[7];let a;t[8]!==r||t[9]!==s?(a={queryKey:r,queryFn:s,staleTime:1/0,gcTime:0},t[8]=r,t[9]=s,t[10]=a):a=t[10];const{data:p}=d(a);return p}const b={SELF:e=>`${e}_self`,REGISTRY:e=>`${e}_registry`,COMMUNITY_REGISTRY:e=>`${e}_community-registry`},w="self";function M(e){return{id:b.REGISTRY(e),title:"Deco Store",description:"Official deco MCP registry with curated integrations",connection_type:"HTTP",connection_url:"https://api.decocms.com/mcp/registry",icon:"https://assets.decocache.com/decocms/00ccf6c3-9e13-4517-83b0-75ab84554bb9/596364c63320075ca58483660156b6d9de9b526e.png",app_name:"deco-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}function v(){return{id:"community-registry",title:"MCP Registry",description:"Community MCP registry with thousands of handy MCPs",connection_type:"HTTP",connection_url:"https://sites-registry.decocache.com/mcp",icon:"https://assets.decocache.com/decocms/cd7ca472-0f72-463a-b0de-6e44bdd0f9b4/mcp.png",app_name:"mcp-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}function R(e={}){return{id:e.id,title:"OpenRouter",description:"Access hundreds of LLM models from a single API",icon:"https://openrouter.ai/favicon.ico",app_name:"openrouter",app_id:"openrouter",connection_type:"HTTP",connection_url:"https://sites-openrouter.decocache.com/mcp",connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{source:"chat",verified:!1,scopeName:"deco",toolsCount:0,publishedAt:null,repository:null}}}function L(){return{title:"MCP Studio",description:"An app that allows you to create and manage MCPs",icon:"https://assets.decocache.com/mcp/09e44283-f47d-4046-955f-816d227c626f/app.png",app_name:"mcp-studio",app_id:"65a1b407-b6af-41e2-a89f-ce9450c05bbc",connection_type:"HTTP",connection_url:"https://sites-vibemcp.decocache.com/mcp",connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!1,type:"mcp-studio"}}}export{l as K,f as S,b as W,w as a,L as b,C as c,R as d,M as e,v as g,P as u};
1
+ import{be as u,c as m,l as d,bf as g}from"./index-DHBTmGle.js";const l={authConfig:()=>["authConfig"],threads:e=>["threads",e],virtualMcpThreads:(e,t)=>["threads",e,"virtual-mcp",t],thread:(e,t)=>["thread",e,t],threadMessages:(e,t)=>["thread-messages",e,t],messages:e=>["messages",e],organizations:()=>["organizations"],members:e=>[e,"members"],invitations:e=>[e,"invitations"],organizationRoles:e=>[e,"organization-roles"],connections:e=>[e,"connections"],connectionsByBinding:(e,t)=>[e,"connections",`binding:${t}`],connection:(e,t)=>[e,"connection",t],isMCPAuthenticated:(e,t)=>["is-mcp-authenticated",e,t],mcpTools:(e,t)=>["mcp","tools",e,t],mcpClient:(e,t,n)=>["mcp","client",e,t,n],mcpToolsList:e=>["mcp","client",e,"tools"],mcpResourcesList:e=>["mcp","client",e,"resources"],mcpPromptsList:e=>["mcp","client",e,"prompts"],mcpReadResource:(e,t)=>["mcp","client",e,"resource",t],mcpGetPrompt:(e,t,n)=>["mcp","client",e,"prompt",t,n],mcpToolCall:(e,t,n)=>["mcp","client",e,"tool-call",t,n],organizationSettings:e=>["organization-settings",e],activeOrganization:e=>["activeOrganization",e],modelsList:e=>["models-list",e],connectionCollections:e=>[e,"collections","discovery"],toolCall:(e,t,n)=>["tool-call",e,t,n],collectionItems:(e,t)=>["collection",e,t],collection:(e,t,n)=>[e,t,"collection",n],collectionItem:(e,t,n,o,i)=>[e,t,n,"collection",o,i],collectionList:(e,t,n,o,i)=>[e,t,n,"collection",o,"list",i],collectionListInfinite:(e,t,n,o,i)=>[e,t,n,"collection",o,"list-infinite",i],githubReadme:(e,t)=>["github-readme",e,t],monitoringStats:()=>["monitoring","stats"],monitoringLogs:e=>["monitoring","logs",e],monitoringLogsInfinite:(e,t)=>["monitoring","logs-infinite",e,t],virtualMcpPrompts:e=>["virtual-mcp",e,"prompts"],connectionPrompts:e=>["connection",e,"prompts"],connectionResources:e=>["connection",e,"resources"],user:e=>["user",e]};class f extends u{constructor(t,n){super(t,n)}send(t,n){const o=h(t);return o?.type==="emit"?(this.onmessage?.(o.message),Promise.resolve()):o?.type==="suppress"?Promise.resolve():super.send(t,n)}}function h(e){const t=e;if(!t||typeof t!="object"||!("method"in t))return null;switch(t.method){case"initialize":{const n=t?.params?.protocolVersion;return n?{type:"emit",message:{result:{protocolVersion:n,capabilities:{tools:{},resources:{},prompts:{},tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}},serverInfo:{name:"mesh-virtual-mcp",version:"1.0.0"}},jsonrpc:t.jsonrpc??"2.0",id:t.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}const _={name:"mesh-sdk",version:"1.0.0"};function y(e){if(typeof window>"u")throw new Error("MCP client requires a browser environment.");const t=e?`/mcp/${e}`:"/mcp";return new URL(t,window.location.origin).href}async function C({connectionId:e,orgId:t,token:n}){const o=y(e),i=new g(_,{capabilities:{tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}}}),c=new f(new URL(o),{requestInit:{headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream","x-org-id":t,...n?{Authorization:`Bearer ${n}`}:{}}}});await i.connect(c);const r=l.mcpClient(t,e??"self",n??"");return i.toJSON=()=>`mcp-client:${r.join(":")}`,i}function P(e){const t=m.c(11),{connectionId:n,orgId:o,token:i}=e;let c;t[0]!==n||t[1]!==o||t[2]!==i?(c=l.mcpClient(o,n??"",i??""),t[0]=n,t[1]=o,t[2]=i,t[3]=c):c=t[3];const r=c;let s;t[4]!==n||t[5]!==o||t[6]!==i?(s=()=>C({connectionId:n,orgId:o,token:i}),t[4]=n,t[5]=o,t[6]=i,t[7]=s):s=t[7];let a;t[8]!==r||t[9]!==s?(a={queryKey:r,queryFn:s,staleTime:1/0,gcTime:0},t[8]=r,t[9]=s,t[10]=a):a=t[10];const{data:p}=d(a);return p}const b={SELF:e=>`${e}_self`,REGISTRY:e=>`${e}_registry`,COMMUNITY_REGISTRY:e=>`${e}_community-registry`},w="self";function M(e){return{id:b.REGISTRY(e),title:"Deco Store",description:"Official deco MCP registry with curated integrations",connection_type:"HTTP",connection_url:"https://api.decocms.com/mcp/registry",icon:"https://assets.decocache.com/decocms/00ccf6c3-9e13-4517-83b0-75ab84554bb9/596364c63320075ca58483660156b6d9de9b526e.png",app_name:"deco-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}function v(){return{id:"community-registry",title:"MCP Registry",description:"Community MCP registry with thousands of handy MCPs",connection_type:"HTTP",connection_url:"https://sites-registry.decocache.com/mcp",icon:"https://assets.decocache.com/decocms/cd7ca472-0f72-463a-b0de-6e44bdd0f9b4/mcp.png",app_name:"mcp-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}function R(e={}){return{id:e.id,title:"OpenRouter",description:"Access hundreds of LLM models from a single API",icon:"https://openrouter.ai/favicon.ico",app_name:"openrouter",app_id:"openrouter",connection_type:"HTTP",connection_url:"https://sites-openrouter.decocache.com/mcp",connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{source:"chat",verified:!1,scopeName:"deco",toolsCount:0,publishedAt:null,repository:null}}}function L(){return{title:"MCP Studio",description:"An app that allows you to create and manage MCPs",icon:"https://assets.decocache.com/mcp/09e44283-f47d-4046-955f-816d227c626f/app.png",app_name:"mcp-studio",app_id:"65a1b407-b6af-41e2-a89f-ce9450c05bbc",connection_type:"HTTP",connection_url:"https://sites-vibemcp.decocache.com/mcp",connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!1,type:"mcp-studio"}}}export{l as K,f as S,b as W,w as a,L as b,C as c,R as d,M as e,v as g,P as u};
@@ -0,0 +1 @@
1
+ import{x as t,B as a}from"./index-DHBTmGle.js";const e=t(a,{target:"draft-7"});export{e as B};
@@ -1 +1 @@
1
- import{o as A,s as D,c as O,b as v,d as E,j as r,e as N}from"./index-DZ0WP9Uu.js";import{A as I,a as M,b as L,c as R,d as T,e as $,f as B}from"./alert-dialog-DCgyNkDL.js";import{B as V}from"./button-DMKajqX_.js";import{F as k,a as q,b as H,c as U,d as G,e as J,f as K}from"./form-ndfdAtTI.js";import{I as P}from"./input-B0NJeiuT.js";import{S as Q}from"./spinner-YcNewNcW.js";import{u as W}from"./useMutation-BSgCoYc_.js";function _(o){return o.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const X=A({name:D().min(2,"Organization name is required")});function ne(o){const e=O.c(41),{open:a,onOpenChange:s}=o;let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={resolver:v(X),defaultValues:{name:""}},e[0]=j):j=e[0];const t=E(j);let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w={mutationFn:Z,onSuccess:Y},e[1]=w):w=e[1];const i=W(w),z=i.error instanceof Error?i.error.message:i.error?"Failed to create organization.":null;let F;e[2]===Symbol.for("react.memo_cache_sentinel")?(F=r.jsxs(L,{children:[r.jsx(R,{children:"Create a new organization"}),r.jsx(T,{children:"Set up a new organization to collaborate with others."})]}),e[2]=F):F=e[2];let n;if(e[3]!==i||e[4]!==t){let x;e[6]!==i?(x=b=>i.mutateAsync(b),e[6]=i,e[7]=x):x=e[7],n=t.handleSubmit(x),e[3]=i,e[4]=t,e[5]=n}else n=e[5];let l;e[8]!==t.formState.isSubmitting?(l=x=>{const{field:b}=x;return r.jsxs(H,{children:[r.jsx(U,{children:"Organization Name"}),r.jsx(G,{children:r.jsx(P,{...b,placeholder:"Acme Inc.",disabled:t.formState.isSubmitting})}),r.jsx(J,{children:"The name of your company or organization"}),b.value&&r.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",r.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",_(b.value)]})]}),r.jsx(K,{})]})},e[8]=t.formState.isSubmitting,e[9]=l):l=e[9];let m;e[10]!==t.control||e[11]!==l?(m=r.jsx(k,{control:t.control,name:"name",render:l}),e[10]=t.control,e[11]=l,e[12]=m):m=e[12];let c;e[13]!==z?(c=z&&r.jsx("div",{className:"text-destructive text-sm mt-2",children:z}),e[13]=z,e[14]=c):c=e[14];let f;e[15]!==i||e[16]!==t?(f=()=>{i.reset(),t.reset()},e[15]=i,e[16]=t,e[17]=f):f=e[17];let g;e[18]!==t.formState.isSubmitting||e[19]!==f?(g=r.jsx(I,{disabled:t.formState.isSubmitting,onClick:f,children:"Cancel"}),e[18]=t.formState.isSubmitting,e[19]=f,e[20]=g):g=e[20];const y=!t.formState.isValid||t.formState.isSubmitting;let u;e[21]!==t.formState.isSubmitting?(u=t.formState.isSubmitting?r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Q,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=t.formState.isSubmitting,e[22]=u):u=e[22];let d;e[23]!==y||e[24]!==u?(d=r.jsx(V,{type:"submit",variant:"default",disabled:y,children:u}),e[23]=y,e[24]=u,e[25]=d):d=e[25];let S;e[26]!==d||e[27]!==g?(S=r.jsxs($,{children:[g,d]}),e[26]=d,e[27]=g,e[28]=S):S=e[28];let h;e[29]!==S||e[30]!==n||e[31]!==m||e[32]!==c?(h=r.jsxs("form",{className:"space-y-6",onSubmit:n,autoComplete:"off",children:[m,c,S]}),e[29]=S,e[30]=n,e[31]=m,e[32]=c,e[33]=h):h=e[33];let p;e[34]!==t||e[35]!==h?(p=r.jsxs(M,{children:[F,r.jsx(q,{...t,children:h})]}),e[34]=t,e[35]=h,e[36]=p):p=e[36];let C;return e[37]!==s||e[38]!==a||e[39]!==p?(C=r.jsx(B,{open:a,onOpenChange:s,children:p}),e[37]=s,e[38]=a,e[39]=p,e[40]=C):C=e[40],C}function Y(o){const{orgSlug:e}=o;window.location.href=`/${e}`}async function Z(o){const e=_(o.name);if(!e)throw new Error("Organization slug is invalid");const a=await N.organization.create({name:o.name,slug:e});if(a?.error)throw new Error(a.error.message||"Failed to create organization");const s=a?.data?.slug??e;if(!s)throw new Error("Failed to create organization");return{orgSlug:s}}export{ne as C};
1
+ import{o as A,s as D,c as O,b as v,d as E,j as r,e as N}from"./index-DHBTmGle.js";import{A as I,a as M,b as L,c as R,d as T,e as $,f as B}from"./alert-dialog-BsUKy6x1.js";import{B as V}from"./button-BJ3HWp7I.js";import{F as k,a as q,b as H,c as U,d as G,e as J,f as K}from"./form-D6hs_qye.js";import{I as P}from"./input-7ruC6uFX.js";import{S as Q}from"./spinner-DEICAlhU.js";import{u as W}from"./useMutation-BL6IQ2sq.js";function _(o){return o.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const X=A({name:D().min(2,"Organization name is required")});function ne(o){const e=O.c(41),{open:a,onOpenChange:s}=o;let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={resolver:v(X),defaultValues:{name:""}},e[0]=j):j=e[0];const t=E(j);let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w={mutationFn:Z,onSuccess:Y},e[1]=w):w=e[1];const i=W(w),z=i.error instanceof Error?i.error.message:i.error?"Failed to create organization.":null;let F;e[2]===Symbol.for("react.memo_cache_sentinel")?(F=r.jsxs(L,{children:[r.jsx(R,{children:"Create a new organization"}),r.jsx(T,{children:"Set up a new organization to collaborate with others."})]}),e[2]=F):F=e[2];let n;if(e[3]!==i||e[4]!==t){let x;e[6]!==i?(x=b=>i.mutateAsync(b),e[6]=i,e[7]=x):x=e[7],n=t.handleSubmit(x),e[3]=i,e[4]=t,e[5]=n}else n=e[5];let l;e[8]!==t.formState.isSubmitting?(l=x=>{const{field:b}=x;return r.jsxs(H,{children:[r.jsx(U,{children:"Organization Name"}),r.jsx(G,{children:r.jsx(P,{...b,placeholder:"Acme Inc.",disabled:t.formState.isSubmitting})}),r.jsx(J,{children:"The name of your company or organization"}),b.value&&r.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",r.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",_(b.value)]})]}),r.jsx(K,{})]})},e[8]=t.formState.isSubmitting,e[9]=l):l=e[9];let m;e[10]!==t.control||e[11]!==l?(m=r.jsx(k,{control:t.control,name:"name",render:l}),e[10]=t.control,e[11]=l,e[12]=m):m=e[12];let c;e[13]!==z?(c=z&&r.jsx("div",{className:"text-destructive text-sm mt-2",children:z}),e[13]=z,e[14]=c):c=e[14];let f;e[15]!==i||e[16]!==t?(f=()=>{i.reset(),t.reset()},e[15]=i,e[16]=t,e[17]=f):f=e[17];let g;e[18]!==t.formState.isSubmitting||e[19]!==f?(g=r.jsx(I,{disabled:t.formState.isSubmitting,onClick:f,children:"Cancel"}),e[18]=t.formState.isSubmitting,e[19]=f,e[20]=g):g=e[20];const y=!t.formState.isValid||t.formState.isSubmitting;let u;e[21]!==t.formState.isSubmitting?(u=t.formState.isSubmitting?r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Q,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=t.formState.isSubmitting,e[22]=u):u=e[22];let d;e[23]!==y||e[24]!==u?(d=r.jsx(V,{type:"submit",variant:"default",disabled:y,children:u}),e[23]=y,e[24]=u,e[25]=d):d=e[25];let S;e[26]!==d||e[27]!==g?(S=r.jsxs($,{children:[g,d]}),e[26]=d,e[27]=g,e[28]=S):S=e[28];let h;e[29]!==S||e[30]!==n||e[31]!==m||e[32]!==c?(h=r.jsxs("form",{className:"space-y-6",onSubmit:n,autoComplete:"off",children:[m,c,S]}),e[29]=S,e[30]=n,e[31]=m,e[32]=c,e[33]=h):h=e[33];let p;e[34]!==t||e[35]!==h?(p=r.jsxs(M,{children:[F,r.jsx(q,{...t,children:h})]}),e[34]=t,e[35]=h,e[36]=p):p=e[36];let C;return e[37]!==s||e[38]!==a||e[39]!==p?(C=r.jsx(B,{open:a,onOpenChange:s,children:p}),e[37]=s,e[38]=a,e[39]=p,e[40]=C):C=e[40],C}function Y(o){const{orgSlug:e}=o;window.location.href=`/${e}`}async function Z(o){const e=_(o.name);if(!e)throw new Error("Organization slug is invalid");const a=await N.organization.create({name:o.name,slug:e});if(a?.error)throw new Error(a.error.message||"Failed to create organization");const s=a?.data?.slug??e;if(!s)throw new Error("Failed to create organization");return{orgSlug:s}}export{ne as C};
@@ -1 +1 @@
1
- import{c as n,j as i,R as u,n as m,T as x,D as j,q as N,t as D,v as b,w as g}from"./index-DZ0WP9Uu.js";import{i as h}from"./X-BAy7Mfyd.js";import{c}from"./button-DMKajqX_.js";function z(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(b,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-background/60 backdrop-blur-[0.5px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(D,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(g,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function R(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function P(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{z as D,R as a,B as b,O as c,P as d,E as e,k as f,T as g};
1
+ import{c as n,j as i,R as u,n as m,T as x,D as j,q as N,t as D,v as b,w as g}from"./index-DHBTmGle.js";import{i as h}from"./X-CgDprUQG.js";import{c}from"./button-BJ3HWp7I.js";function z(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(b,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-background/60 backdrop-blur-[0.5px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(D,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(g,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function R(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function P(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{z as D,R as a,B as b,O as c,P as d,E as e,k as f,T as g};
@@ -1 +1 @@
1
- import{c,j as i,y as p,z as f,E as m,F as g,I as x,G as v,H as b,J as w,M as h}from"./index-DZ0WP9Uu.js";import{i as j}from"./Grid01-D89OcY09.js";import{c as u}from"./button-DMKajqX_.js";function M(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(p,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=o):o=e[3],o}function S(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(f,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=o):o=e[3],o}function $(s){const e=c.c(10);let t,o,a;e[0]!==s?({className:t,sideOffset:a,...o}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a):(t=e[1],o=e[2],a=e[3]);const n=a===void 0?4:a;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let d;return e[6]!==o||e[7]!==n||e[8]!==r?(d=i.jsx(m,{children:i.jsx(g,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...o})}),e[6]=o,e[7]=n,e[8]=r,e[9]=d):d=e[9],d}function y(s){const e=c.c(12);let t,o,a,n;e[0]!==s?({className:t,inset:o,variant:n,...a}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a,e[4]=n):(t=e[1],o=e[2],a=e[3],n=e[4]);const r=n===void 0?"default":n;let d;e[5]!==t?(d=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=d):d=e[6];let l;return e[7]!==o||e[8]!==a||e[9]!==d||e[10]!==r?(l=i.jsx(x,{"data-slot":"dropdown-menu-item","data-inset":o,"data-variant":r,className:d,...a}),e[7]=o,e[8]=a,e[9]=d,e[10]=r,e[11]=l):l=e[11],l}function _(s){const e=c.c(8);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let a;e[3]!==t?(a=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=a):a=e[4];let n;return e[5]!==o||e[6]!==a?(n=i.jsx(h,{"data-slot":"dropdown-menu-separator",className:a,...o}),e[5]=o,e[6]=a,e[7]=n):n=e[7],n}function C(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(v,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=o):o=e[3],o}function T(s){const e=c.c(13);let t,o,a,n;e[0]!==s?({className:o,inset:a,children:t,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a,e[4]=n):(t=e[1],o=e[2],a=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",o),e[5]=o,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(j,{className:"ml-auto size-4"}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==a||e[10]!==n||e[11]!==r?(l=i.jsxs(b,{"data-slot":"dropdown-menu-sub-trigger","data-inset":a,className:r,...n,children:[t,d]}),e[8]=t,e[9]=a,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function E(s){const e=c.c(8);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let a;e[3]!==t?(a=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=a):a=e[4];let n;return e[5]!==o||e[6]!==a?(n=i.jsx(w,{"data-slot":"dropdown-menu-sub-content",className:a,...o}),e[5]=o,e[6]=a,e[7]=n):n=e[7],n}export{M as D,S as a,$ as b,y as c,C as d,T as e,E as f,_ as g};
1
+ import{c,j as i,y as p,z as f,E as m,F as g,I as x,G as v,H as b,J as w,M as h}from"./index-DHBTmGle.js";import{i as j}from"./Grid01-BV5dHi3R.js";import{c as u}from"./button-BJ3HWp7I.js";function M(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(p,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=o):o=e[3],o}function S(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(f,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=o):o=e[3],o}function $(s){const e=c.c(10);let t,o,a;e[0]!==s?({className:t,sideOffset:a,...o}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a):(t=e[1],o=e[2],a=e[3]);const n=a===void 0?4:a;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let d;return e[6]!==o||e[7]!==n||e[8]!==r?(d=i.jsx(m,{children:i.jsx(g,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...o})}),e[6]=o,e[7]=n,e[8]=r,e[9]=d):d=e[9],d}function y(s){const e=c.c(12);let t,o,a,n;e[0]!==s?({className:t,inset:o,variant:n,...a}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a,e[4]=n):(t=e[1],o=e[2],a=e[3],n=e[4]);const r=n===void 0?"default":n;let d;e[5]!==t?(d=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=d):d=e[6];let l;return e[7]!==o||e[8]!==a||e[9]!==d||e[10]!==r?(l=i.jsx(x,{"data-slot":"dropdown-menu-item","data-inset":o,"data-variant":r,className:d,...a}),e[7]=o,e[8]=a,e[9]=d,e[10]=r,e[11]=l):l=e[11],l}function _(s){const e=c.c(8);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let a;e[3]!==t?(a=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=a):a=e[4];let n;return e[5]!==o||e[6]!==a?(n=i.jsx(h,{"data-slot":"dropdown-menu-separator",className:a,...o}),e[5]=o,e[6]=a,e[7]=n):n=e[7],n}function C(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(v,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=o):o=e[3],o}function T(s){const e=c.c(13);let t,o,a,n;e[0]!==s?({className:o,inset:a,children:t,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a,e[4]=n):(t=e[1],o=e[2],a=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",o),e[5]=o,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(j,{className:"ml-auto size-4"}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==a||e[10]!==n||e[11]!==r?(l=i.jsxs(b,{"data-slot":"dropdown-menu-sub-trigger","data-inset":a,className:r,...n,children:[t,d]}),e[8]=t,e[9]=a,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function E(s){const e=c.c(8);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let a;e[3]!==t?(a=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=a):a=e[4];let n;return e[5]!==o||e[6]!==a?(n=i.jsx(w,{"data-slot":"dropdown-menu-sub-content",className:a,...o}),e[5]=o,e[6]=a,e[7]=n):n=e[7],n}export{M as D,S as a,$ as b,y as c,C as d,T as e,E as f,_ as g};