@decocms/mesh 2.58.0 → 2.58.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.
- package/dist/client/assets/{AlertCircle-Yil9qnEH.js → AlertCircle-BfeKUTHB.js} +1 -1
- package/dist/client/assets/{ArrowLeft-OdEDEe_C.js → ArrowLeft-C8Eu0U71.js} +1 -1
- package/dist/client/assets/{ArrowUp-Dal03NKa.js → ArrowUp-CMRYmfEj.js} +1 -1
- package/dist/client/assets/{Check-oakDJ2AF.js → Check-0HSx2q18.js} +1 -1
- package/dist/client/assets/{ChevronDown-Bap_L0Uk.js → ChevronDown-C_TMSoNY.js} +1 -1
- package/dist/client/assets/{Code01-BG3tlXRj.js → Code01-D8qtdtas.js} +1 -1
- package/dist/client/assets/{Copy01-Bu63nBOw.js → Copy01-D9ChgQky.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-B811S-jI.js → DotsHorizontal-CyQkNRcH.js} +1 -1
- package/dist/client/assets/{DotsVertical-fX_KnNQj.js → DotsVertical-DRiGtjkD.js} +1 -1
- package/dist/client/assets/{Download01-DJ7F6m36.js → Download01-FJQqYc_O.js} +1 -1
- package/dist/client/assets/{Edit01-CSIvGo0w.js → Edit01-CeBWYX1f.js} +1 -1
- package/dist/client/assets/{File06-ElvtcbN_.js → File06-CFKKek9h.js} +1 -1
- package/dist/client/assets/{FilterLines-CJ4ielUL.js → FilterLines-WOZvh-uo.js} +1 -1
- package/dist/client/assets/{FlipBackward-fTp7bHML.js → FlipBackward-C9QP9lON.js} +1 -1
- package/dist/client/assets/{Grid01-Dr_KfxW1.js → Grid01-D2GHQgH8.js} +1 -1
- package/dist/client/assets/{Home02-BzOZNY7Z.js → Home02-PyHDuaMa.js} +1 -1
- package/dist/client/assets/{Image01-5eXX0GAe.js → Image01-fZfQpIfS.js} +1 -1
- package/dist/client/assets/{Inbox01-BQOiy5jS.js → Inbox01-DB1LDaFW.js} +1 -1
- package/dist/client/assets/{InfoCircle-DgTzF72q.js → InfoCircle-BlFs-xnj.js} +1 -1
- package/dist/client/assets/{Key01-BOAbiw2j.js → Key01-C9yXGlnw.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CbRS6SXy.js → LinkExternal01-BSpxFisg.js} +1 -1
- package/dist/client/assets/{List-BaJmRjKO.js → List-GahfP4qk.js} +1 -1
- package/dist/client/assets/{Loading01-BbK7X7pB.js → Loading01-CulKrbt9.js} +1 -1
- package/dist/client/assets/{Lock01-BCLUX2Yw.js → Lock01-DJ-R95n7.js} +1 -1
- package/dist/client/assets/{Pin01-Cmat2KYq.js → Pin01-Csj4eqX2.js} +1 -1
- package/dist/client/assets/{Play-DSNBv8J3.js → Play-FVezjTHF.js} +1 -1
- package/dist/client/assets/{Plus-DUZn7G9j.js → Plus-BLRLeHqJ.js} +1 -1
- package/dist/client/assets/{SearchMd-Dqpb7vw_.js → SearchMd-CKpCIdMC.js} +1 -1
- package/dist/client/assets/{Share07-0pxdeJ9F.js → Share07-Dk9ktbDy.js} +1 -1
- package/dist/client/assets/{Terminal-DGX7jD8k.js → Terminal-BB15jMJz.js} +1 -1
- package/dist/client/assets/{Trash01-FyRIWKSN.js → Trash01-DyBbXzXG.js} +1 -1
- package/dist/client/assets/{Upload01-DlAhpCPh.js → Upload01-BBSfBSVK.js} +1 -1
- package/dist/client/assets/{Users03-CPhtgAec.js → Users03-BUBTY2DH.js} +1 -1
- package/dist/client/assets/{X-DUs80l2J.js → X-C0Q8MqB2.js} +1 -1
- package/dist/client/assets/{XClose-r2Q3_LuT.js → XClose-C8BPkkIJ.js} +1 -1
- package/dist/client/assets/{agent-detail-DX2lnojP.js → agent-detail-BrGVfUqq.js} +1 -1
- package/dist/client/assets/{agents-Dpwv3Az5.js → agents-CpSy1qAv.js} +1 -1
- package/dist/client/assets/{alert-dialog-JqkmaZeq.js → alert-dialog-ttBjGoGp.js} +1 -1
- package/dist/client/assets/{auth-catchall-DK5cw059.js → auth-catchall-8j38CW_T.js} +1 -1
- package/dist/client/assets/{avatar-DbbO_Vrc.js → avatar-DfZGbVLk.js} +1 -1
- package/dist/client/assets/{badge-Ai9GD5PG.js → badge-BonzW3UO.js} +1 -1
- package/dist/client/assets/{binder-BrVJi0Ik.js → binder-3KJD-o52.js} +1 -1
- package/dist/client/assets/{button-B-LIjJ0d.js → button-DlVdUZ44.js} +1 -1
- package/dist/client/assets/{card-XaHspUBI.js → card-DTyKddtb.js} +1 -1
- package/dist/client/assets/{checkbox-D75pxaXU.js → checkbox-Cq3f3Bsg.js} +1 -1
- package/dist/client/assets/{circle-alert-CgaIPI4d.js → circle-alert-DvRd-P4d.js} +1 -1
- package/dist/client/assets/{collection-detail-deMJDjhU.js → collection-detail-dSlhk4dp.js} +1 -1
- package/dist/client/assets/{collection-display-button-DdFsgETm.js → collection-display-button-Dl9t2uPq.js} +1 -1
- package/dist/client/assets/{collection-header-DyDhieJC.js → collection-header-CBAACURX.js} +1 -1
- package/dist/client/assets/{collection-page-CuQgqDaq.js → collection-page-DO9rMqvZ.js} +1 -1
- package/dist/client/assets/{collection-search-BdprEFJN.js → collection-search-BJKawcxK.js} +1 -1
- package/dist/client/assets/{collection-tab-BiI-iMq7.js → collection-tab-BIr6UGht.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CaRdow_V.js → collection-table-wrapper-Ca_hknwt.js} +1 -1
- package/dist/client/assets/{connect-Dz8kXZ1B.js → connect-DZ8NJjb8.js} +1 -1
- package/dist/client/assets/{connection-card-Bzv2t0pV.js → connection-card-B4rXVwLG.js} +1 -1
- package/dist/client/assets/{connection-detail-Dt0WxfOL.js → connection-detail-DbLw8QiJ.js} +1 -1
- package/dist/client/assets/{connections-5IaK481x.js → connections-BHUCXi0i.js} +1 -1
- package/dist/client/assets/{constants-C7esE5S6.js → constants-BXzi8HVW.js} +1 -1
- package/dist/client/assets/constants-Rz5BExrd.js +1 -0
- package/dist/client/assets/{create-organization-dialog-KKPKWuSg.js → create-organization-dialog-B-dkcbzd.js} +1 -1
- package/dist/client/assets/{dialog-UCxLeO_h.js → dialog-D-YL1wCt.js} +1 -1
- package/dist/client/assets/{dropdown-menu-kuIIANP5.js → dropdown-menu-I0Wtq-dL.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-DtVaKRRj.js → dynamic-plugin-layout-SoSOUjPR.js} +1 -1
- package/dist/client/assets/{empty-state-Ba47ZVsf.js → empty-state-BXZkhJxy.js} +1 -1
- package/dist/client/assets/{empty-state-DA7yVTaN.js → empty-state-D46GK6Uk.js} +1 -1
- package/dist/client/assets/{env-vars-editor-BZSzAH_1.js → env-vars-editor-wQ79cgg4.js} +1 -1
- package/dist/client/assets/{error-boundary-BkEvrItd.js → error-boundary-nXWXpjqs.js} +1 -1
- package/dist/client/assets/{extract-connection-data-D2dnQRcn.js → extract-connection-data-iwi6SKZ6.js} +1 -1
- package/dist/client/assets/{file-browser-B5MIQRKs.js → file-browser-BFiUzCuE.js} +2 -2
- package/dist/client/assets/{form-BHWppF5B.js → form-BCZDQ7AS.js} +1 -1
- package/dist/client/assets/{grid-view-Dg5b3VA4.js → grid-view-MVNuumn3.js} +1 -1
- package/dist/client/assets/{home-yc1dQ9Lq.js → home-ndSnzpEN.js} +1 -1
- package/dist/client/assets/{index-BDV46Exd.js → index-BBwSGiB0.js} +1 -1
- package/dist/client/assets/{index-BcoUfGs8.js → index-BrIXf2Hm.js} +1 -1
- package/dist/client/assets/{index-DCr6r7Yw.js → index-D2NuI3iU.js} +2 -2
- package/dist/client/assets/{index-BKkW7Unn.js → index-DAkHq7-U.js} +1 -1
- package/dist/client/assets/{index-B05deeSQ.js → index-DBSgNCJ5.js} +1 -1
- package/dist/client/assets/{index-Ci9wq6UB.js → index-F2oRJBei.js} +2 -2
- package/dist/client/assets/{infiniteQueryObserver-CcbuhEfP.js → infiniteQueryObserver-7ojtaUHB.js} +1 -1
- package/dist/client/assets/{input-BdbOsF-m.js → input-BkKQBUrk.js} +1 -1
- package/dist/client/assets/{layout-SO6IbyRc.js → layout-D6JC-ymj.js} +1 -1
- package/dist/client/assets/{localstorage-keys-DOkcu8sQ.js → localstorage-keys-D8_EA5Ep.js} +1 -1
- package/dist/client/assets/{login-BUUR0ZN-.js → login-DYNnfdjs.js} +1 -1
- package/dist/client/assets/{mcp-oauth-B8scVlEC.js → mcp-oauth-DfG-1-N6.js} +1 -1
- package/dist/client/assets/{mcp-server-card-DxAeYt3X.js → mcp-server-card-BiiecloZ.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-ByStzsBB.js → mcp-server-detail-mzM5WUQn.js} +2 -2
- package/dist/client/assets/{members-DvIXCABj.js → members-DmNqoVqp.js} +1 -1
- package/dist/client/assets/{monaco-editor-B5Aw8k_-.js → monaco-editor-CwV_zSmr.js} +1 -1
- package/dist/client/assets/{monitoring-Bqe3CbDW.js → monitoring-DCtAWTnS.js} +1 -1
- package/dist/client/assets/{oauth-callback-CNu9C9Oo.js → oauth-callback-DqKvmIx8.js} +1 -1
- package/dist/client/assets/{page-CsSxMAlL.js → page-7V2rMGhj.js} +1 -1
- package/dist/client/assets/{page-BUqDaU45.js → page-84GKlkwQ.js} +1 -1
- package/dist/client/assets/{pin-to-sidebar-button-BZ72nAEL.js → pin-to-sidebar-button-0wgpOO5S.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-DLdyL-mH.js → plugin-empty-state-DAakUOId.js} +1 -1
- package/dist/client/assets/{plugin-header-CTUed0gr.js → plugin-header-B5S8xHZR.js} +1 -1
- package/dist/client/assets/{plugins-Db0sY8EK.js → plugins-B741L0Uc.js} +1 -1
- package/dist/client/assets/{popover-DisoFbn-.js → popover-DG4RfOsm.js} +1 -1
- package/dist/client/assets/{registry-utils-Xp067sQn.js → registry-utils-DPB6aan1.js} +1 -1
- package/dist/client/assets/{resizable-C2Utw1an.js → resizable-Bn8yP8MB.js} +1 -1
- package/dist/client/assets/{resource-tabs-BgCbfh1Q.js → resource-tabs-CrTlT56-.js} +1 -1
- package/dist/client/assets/{select-DcK9kiBG.js → select-Ma6s5t-T.js} +1 -1
- package/dist/client/assets/{settings-nHPuWPgH.js → settings-AzW1eGBU.js} +1 -1
- package/dist/client/assets/{shell-layout-DvYtMesy.js → shell-layout-uTPT2UAF.js} +1 -1
- package/dist/client/assets/{spinner-CoVqlI-k.js → spinner-C63y8Nks.js} +1 -1
- package/dist/client/assets/{store-invite-A94F9maS.js → store-invite-BlFlt076.js} +1 -1
- package/dist/client/assets/{switch-7a4IJCL5.js → switch-yknQxl3u.js} +1 -1
- package/dist/client/assets/{textarea-DHc00T9T.js → textarea-C4MT8dn6.js} +1 -1
- package/dist/client/assets/{tool-set-selector-CzVhPzY2.js → tool-set-selector-D6qdOAtS.js} +1 -1
- package/dist/client/assets/{tools-list-dmNFSBw9.js → tools-list-CvAQsPfg.js} +1 -1
- package/dist/client/assets/{tooltip-C6LqelJl.js → tooltip-BiJ523EQ.js} +1 -1
- package/dist/client/assets/{typewriter-title-DsIR7tcg.js → typewriter-title-lMuqnjBw.js} +1 -1
- package/dist/client/assets/{use-binding-fpuk0ApB.js → use-binding-BDMK8q5z.js} +1 -1
- package/dist/client/assets/{use-collections-OpbhFLgE.js → use-collections-CBIy_5Qw.js} +1 -1
- package/dist/client/assets/{use-connection-eyF66tJm.js → use-connection-zb_kzrz-.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-Dlso4n1S.js → use-create-virtual-mcp-D9l-aLnA.js} +1 -1
- package/dist/client/assets/{use-list-state-DkhtaHnD.js → use-list-state-DKH2OiDg.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-Cw_2aGFv.js → use-mcp-prompts-B43-strm.js} +1 -1
- package/dist/client/assets/{use-members-Ckcz_xnb.js → use-members-DzUCKftg.js} +1 -1
- package/dist/client/assets/{use-mobile-DhlorgRC.js → use-mobile-DyRNm4Uv.js} +1 -1
- package/dist/client/assets/{use-organization-settings-QaQjoeNw.js → use-organization-settings-DwkdYEXw.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DtuFFUUi.js → use-virtual-mcp-Ci0gP59X.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-j60Q9JL0.js +1 -0
- package/dist/client/assets/{useMutation-DjlaCojA.js → useMutation-D8vdh_mW.js} +1 -1
- package/dist/client/assets/useQuery-BwUD3Nyu.js +1 -0
- package/dist/client/assets/{view-mode-toggle-4IXqr_wc.js → view-mode-toggle-D9jjzQte.js} +1 -1
- package/dist/client/assets/{workflow-BEYp-bPo.js → workflow-CrcplEov.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +179 -179
- package/dist/server/migrate.js +151 -151
- package/dist/server/server.js +164 -164
- package/package.json +1 -3
- package/dist/client/assets/constants-DqcZdoXa.js +0 -1
- package/dist/client/assets/useInfiniteQuery-DFmo1FzW.js +0 -1
- package/dist/client/assets/useQuery-Bs28vQtV.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as I,c as j,j as i,t as S,aH as $,aI as L,aJ as M}from"./index-
|
|
1
|
+
import{r as I,c as j,j as i,t as S,aH as $,aI as L,aJ as M}from"./index-D2NuI3iU.js";import{c as f}from"./button-DlVdUZ44.js";const V=({size:a=24,color:e="currentColor",...s})=>I.createElement("svg",{viewBox:"0 0 24 24",width:a,height:a,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},I.createElement("path",{d:"M20 21c0-1.396 0-2.093-.172-2.661a4 4 0 0 0-2.667-2.667c-.568-.172-1.265-.172-2.661-.172h-5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C4 18.907 4 19.604 4 21M16.5 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));V.displayName="User01";function O(a){const e=j.c(8);let s,t;e[0]!==a?({className:s,...t}=a,e[0]=a,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=f("relative flex size-8 shrink-0 overflow-hidden rounded-full",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==t||e[6]!==o?(r=i.jsx(M,{"data-slot":"avatar",className:o,...t}),e[5]=t,e[6]=o,e[7]=r):r=e[7],r}function T(a){const e=j.c(8);let s,t;e[0]!==a?({className:s,...t}=a,e[0]=a,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=f("aspect-square size-full",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==t||e[6]!==o?(r=i.jsx($,{"data-slot":"avatar-image",className:o,...t}),e[5]=t,e[6]=o,e[7]=r):r=e[7],r}function W(a){const e=j.c(8);let s,t;e[0]!==a?({className:s,...t}=a,e[0]=a,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=f("bg-muted flex size-full items-center justify-center rounded-full",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==t||e[6]!==o?(r=i.jsx(L,{"data-slot":"avatar-fallback",className:o,...t}),e[5]=t,e[6]=o,e[7]=r):r=e[7],r}const R=["drop-shadow-lg bg-gradient-to-br from-red-100 to-red-300 text-red-800 shadow-lg shadow-red-300/40 ring-1 ring-red-300/30","drop-shadow-lg bg-gradient-to-br from-lime-100 to-lime-300 text-lime-800 shadow-lg shadow-lime-300/40 ring-1 ring-lime-300/30","drop-shadow-lg bg-gradient-to-br from-emerald-100 to-emerald-300 text-emerald-800 shadow-lg shadow-emerald-300/40 ring-1 ring-emerald-300/30","drop-shadow-lg bg-gradient-to-br from-orange-100 to-orange-300 text-orange-800 shadow-lg shadow-orange-300/40 ring-1 ring-orange-300/30","drop-shadow-lg bg-gradient-to-br from-amber-100 to-amber-300 text-amber-800 shadow-lg shadow-amber-300/40 ring-1 ring-amber-300/30","drop-shadow-lg bg-gradient-to-br from-yellow-100 to-yellow-300 text-yellow-800 shadow-lg shadow-yellow-300/40 ring-1 ring-yellow-300/30","drop-shadow-lg bg-gradient-to-br from-green-100 to-green-300 text-green-800 shadow-lg shadow-green-300/40 ring-1 ring-green-300/30","drop-shadow-lg bg-gradient-to-br from-teal-100 to-teal-300 text-teal-800 shadow-lg shadow-teal-300/40 ring-1 ring-teal-300/30","drop-shadow-lg bg-gradient-to-br from-cyan-100 to-cyan-300 text-cyan-800 shadow-lg shadow-cyan-300/40 ring-1 ring-cyan-300/30","drop-shadow-lg bg-gradient-to-br from-sky-100 to-sky-300 text-sky-800 shadow-lg shadow-sky-300/40 ring-1 ring-sky-300/30","drop-shadow-lg bg-gradient-to-br from-blue-100 to-blue-300 text-blue-800 shadow-lg shadow-blue-300/40 ring-1 ring-blue-300/30","drop-shadow-lg bg-gradient-to-br from-indigo-100 to-indigo-300 text-indigo-800 shadow-lg shadow-indigo-300/40 ring-1 ring-indigo-300/30","drop-shadow-lg bg-gradient-to-br from-violet-100 to-violet-300 text-violet-800 shadow-lg shadow-violet-300/40 ring-1 ring-violet-300/30","drop-shadow-lg bg-gradient-to-br from-purple-100 to-purple-300 text-purple-800 shadow-lg shadow-purple-300/40 ring-1 ring-purple-300/30","drop-shadow-lg bg-gradient-to-br from-fuchsia-100 to-fuchsia-300 text-fuchsia-800 shadow-lg shadow-fuchsia-300/40 ring-1 ring-fuchsia-300/30","drop-shadow-lg bg-gradient-to-br from-pink-100 to-pink-300 text-pink-800 shadow-lg shadow-pink-300/40 ring-1 ring-pink-300/30","drop-shadow-lg bg-gradient-to-br from-rose-100 to-rose-300 text-rose-800 shadow-lg shadow-rose-300/40 ring-1 ring-rose-300/30"],_="drop-shadow-lg text-muted-foreground bg-muted shadow-lg";function B(a){let e=0;for(let t=0;t<a.length;t++)e=a.charCodeAt(t)+((e<<5)-e);const s=Math.abs(e)%R.length;return R[s]}const U=S("border border-border",{variants:{shape:{circle:"rounded-full",square:""},size:{"3xs":"w-3 h-3 text-xs font-semibold","2xs":"w-4 h-4 text-xs font-semibold",xs:"w-6 h-6 text-sm font-semibold",sm:"w-8 h-8 text-lg font-semibold",base:"w-10 h-10 text-2xl font-semibold",lg:"w-12 h-12 text-3xl font-semibold",xl:"w-16 h-16 text-4xl font-semibold","2xl":"w-20 h-20 text-5xl font-semibold","3xl":"w-32 h-32 text-7xl font-semibold"}},compoundVariants:[{shape:"square",size:"xs",class:"rounded-lg"},{shape:"square",size:"sm",class:"rounded-xl"},{shape:"square",size:"base",class:"rounded-xl"},{shape:"square",size:"lg",class:"rounded-xl"},{shape:"square",size:"xl",class:"rounded-2xl"},{shape:"square",size:"2xl",class:"rounded-3xl"},{shape:"square",size:"3xl",class:"rounded-[40px]"}],defaultVariants:{shape:"square",size:"base"}}),D=S("",{variants:{objectFit:{contain:"object-contain",cover:"object-cover"}},defaultVariants:{objectFit:"cover"}}),H=a=>{const e={"3xs":8,"2xs":8,xs:12,sm:16,base:24,lg:28,xl:36,"2xl":48,"3xl":80};return e[a]||e.base};function J(a){const e=j.c(35);let s,t,o,r,n,d,g,l;e[0]!==a?({url:l,fallback:t,shape:r,size:n,objectFit:d,className:s,muted:g,...o}=a,e[0]=a,e[1]=s,e[2]=t,e[3]=o,e[4]=r,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],r=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=r===void 0?"square":r,h=n===void 0?"base":n,u=d===void 0?"cover":d,k=g===void 0?!1:g,[m,x]=I.useState(!1);let F;e:{if(typeof t=="string"){let c;e[9]!==t?(c=t.trim().slice(0,2).toUpperCase(),e[9]=t,e[10]=c):c=e[10],F=c;break e}F=t}const C=F;let z;e:{if(k){z=_;break e}if(typeof t=="string"){let c;e[11]!==t?(c=B(t),e[11]=t,e[12]=c):c=e[12],z=c;break e}z=R[0]}const y=z;let N;e[13]!==l?(N=l?.startsWith("icon://"),e[13]=l,e[14]=N):N=e[14];const p=N;let q;e[15]!==p||e[16]!==l?(q=p?l?.replace("icon://",""):void 0,e[15]=p,e[16]=l,e[17]=q):q=e[17];const E=q;let w;e[18]!==s||e[19]!==b||e[20]!==h?(w=f(U({shape:b,size:h}),s),e[18]=s,e[19]=b,e[20]=h,e[21]=w):w=e[21];let v;e[22]!==y||e[23]!==C||e[24]!==E||e[25]!==m||e[26]!==p||e[27]!==u||e[28]!==h||e[29]!==l?(v=p&&E?i.jsx("div",{className:f("flex items-center justify-center w-full h-full",y),children:i.jsx(V,{size:H(h)})}):i.jsxs(i.Fragment,{children:[l&&!m&&i.jsx(T,{src:l,loading:"lazy",alt:"Avatar",className:f(D({objectFit:u})),onError:()=>x(!0)}),(!l||m)&&i.jsx(W,{className:f(y,"rounded-none"),children:C})]}),e[22]=y,e[23]=C,e[24]=E,e[25]=m,e[26]=p,e[27]=u,e[28]=h,e[29]=l,e[30]=v):v=e[30];let A;return e[31]!==o||e[32]!==v||e[33]!==w?(A=i.jsx(O,{className:w,...o,children:v}),e[31]=o,e[32]=v,e[33]=w,e[34]=A):A=e[34],A}function Z(a){const e=j.c(18);let s,t,o,r,n,d,g,l;e[0]!==a?({shape:r,size:n,url:l,fallback:t,objectFit:d,className:s,muted:g,...o}=a,e[0]=a,e[1]=s,e[2]=t,e[3]=o,e[4]=r,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],r=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=r===void 0?"square":r,h=n===void 0?"base":n,u=d===void 0?"cover":d,k=g===void 0?!1:g,m=h??"base";let x;return e[9]!==s||e[10]!==t||e[11]!==k||e[12]!==u||e[13]!==o||e[14]!==b||e[15]!==m||e[16]!==l?(x=i.jsx(J,{shape:b,url:l,fallback:t,size:m,objectFit:u,className:s,muted:k,...o}),e[9]=s,e[10]=t,e[11]=k,e[12]=u,e[13]=o,e[14]=b,e[15]=m,e[16]=l,e[17]=x):x=e[17],x}Z.Skeleton=function({shape:e="square",size:s="base",className:t}){return i.jsx("div",{className:f(U({shape:e,size:s}),"bg-muted animate-pulse",t)})};export{Z as A};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as d,j as u,B as l,t as v}from"./index-
|
|
1
|
+
import{c as d,j as u,B as l,t as v}from"./index-D2NuI3iU.js";import{c as g}from"./button-DlVdUZ44.js";const f=v("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function m(o){const e=d.c(12);let r,s,a,t;e[0]!==o?({className:r,variant:t,asChild:a,...s}=o,e[0]=o,e[1]=r,e[2]=s,e[3]=a,e[4]=t):(r=e[1],s=e[2],a=e[3],t=e[4]);const c=(a===void 0?!1:a)?l:"span";let i;e[5]!==r||e[6]!==t?(i=g(f({variant:t}),r),e[5]=r,e[6]=t,e[7]=i):i=e[7];let n;return e[8]!==c||e[9]!==s||e[10]!==i?(n=u.jsx(c,{"data-slot":"badge",className:i,...s}),e[8]=c,e[9]=s,e[10]=i,e[11]=n):n=e[11],n}export{m as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./index-
|
|
1
|
+
import"./index-D2NuI3iU.js";function a(o){return{isImplementedBy:c=>{for(const e of o){const r=typeof e.name=="string"?new RegExp(`^${e.name}$`):e.name,t=c.find(i=>r.test(i.name));if(!(!t&&e.opt)&&!t)return!1}return!0}}}function s(o,c){const e=o.tools;if(!e||e.length===0)return!1;const r=e.map(n=>({name:n.name,inputSchema:n.inputSchema})),t=c.map(n=>({name:n.name,inputSchema:n.inputSchema,opt:n.opt}));return a(t).isImplementedBy(r)}export{a,s as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aQ as g,aR as u,c as l,j as v,B as b,t as p}from"./index-
|
|
1
|
+
import{aQ as g,aR as u,c as l,j as v,B as b,t as p}from"./index-D2NuI3iU.js";function x(...a){return g(u(a))}const f=p("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border text-foreground bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-foreground/80 hover:text-foreground",brand:"bg-brand-green-light text-brand-green-dark hover:bg-brand-green-light/90"},size:{default:"h-10 px-4 py-2 has-[>svg]:px-3",sm:"h-7 gap-1.5 px-3 has-[>svg]:px-2.5",xs:"h-6 gap-1 px-2 text-xs has-[>svg]:px-1.5",lg:"h-10 px-6 has-[>svg]:px-4",icon:"size-10"}},defaultVariants:{variant:"default",size:"default"}});function k(a){const e=l.c(14);let t,r,s,o,i;e[0]!==a?({className:t,variant:i,size:s,asChild:o,...r}=a,e[0]=a,e[1]=t,e[2]=r,e[3]=s,e[4]=o,e[5]=i):(t=e[1],r=e[2],s=e[3],o=e[4],i=e[5]);const c=(o===void 0?!1:o)?b:"button";let n;e[6]!==t||e[7]!==s||e[8]!==i?(n=x(f({variant:i,size:s,className:t})),e[6]=t,e[7]=s,e[8]=i,e[9]=n):n=e[9];let d;return e[10]!==c||e[11]!==r||e[12]!==n?(d=v.jsx(c,{"data-slot":"button",className:n,...r}),e[10]=c,e[11]=r,e[12]=n,e[13]=d):d=e[13],d}export{k as B,f as b,x as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c,j as l}from"./index-
|
|
1
|
+
import{c,j as l}from"./index-D2NuI3iU.js";import{c as n}from"./button-DlVdUZ44.js";function f(o){const e=c.c(8);let r,t;e[0]!==o?({className:r,...t}=o,e[0]=o,e[1]=r,e[2]=t):(r=e[1],t=e[2]);let s;e[3]!==r?(s=n("bg-card text-card-foreground hover:bg-accent/50 flex flex-col gap-6 rounded-xl border border-border/75",r),e[3]=r,e[4]=s):s=e[4];let a;return e[5]!==t||e[6]!==s?(a=l.jsx("div",{"data-slot":"card",className:s,...t}),e[5]=t,e[6]=s,e[7]=a):a=e[7],a}function p(o){const e=c.c(4);let r;e[0]!==o?({...r}=o,e[0]=o,e[1]=r):r=e[1];let t;return e[2]!==r?(t=l.jsx("div",{"data-slot":"card-content",...r}),e[2]=r,e[3]=t):t=e[3],t}export{f as C,p as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as d,j as c,a5 as n,a6 as l}from"./index-
|
|
1
|
+
import{c as d,j as c,a5 as n,a6 as l}from"./index-D2NuI3iU.js";import{i as m}from"./Check-0HSx2q18.js";import{c as b}from"./button-DlVdUZ44.js";function f(o){const e=d.c(9);let r,a;e[0]!==o?({className:r,...a}=o,e[0]=o,e[1]=r,e[2]=a):(r=e[1],a=e[2]);let i;e[3]!==r?(i=b("peer border-foreground dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",r),e[3]=r,e[4]=i):i=e[4];let t;e[5]===Symbol.for("react.memo_cache_sentinel")?(t=c.jsx(l,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-primary-foreground transition-none",children:c.jsx(m,{className:"size-3.5"})}),e[5]=t):t=e[5];let s;return e[6]!==a||e[7]!==i?(s=c.jsx(n,{"data-slot":"checkbox",className:i,...a,children:t}),e[6]=a,e[7]=i,e[8]=s):s=e[8],s}export{f as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c}from"./index-
|
|
1
|
+
import{r as c}from"./index-D2NuI3iU.js";const h=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),y=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,r,o)=>o?o.toUpperCase():r.toLowerCase()),i=t=>{const e=y(t);return e.charAt(0).toUpperCase()+e.slice(1)},l=(...t)=>t.filter((e,r,o)=>!!e&&e.trim()!==""&&o.indexOf(e)===r).join(" ").trim(),f=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var k={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const w=c.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:s="",children:a,iconNode:p,...n},d)=>c.createElement("svg",{ref:d,...k,width:e,height:e,stroke:t,strokeWidth:o?Number(r)*24/Number(e):r,className:l("lucide",s),...!a&&!f(n)&&{"aria-hidden":"true"},...n},[...p.map(([m,C])=>c.createElement(m,C)),...Array.isArray(a)?a:[a]]));const u=(t,e)=>{const r=c.forwardRef(({className:o,...s},a)=>c.createElement(w,{ref:a,iconNode:e,className:l(`lucide-${h(i(t))}`,`lucide-${t}`,o),...s}));return r.displayName=i(t),r};const g=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],b=u("check",g);const x=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],L=u("circle-alert",x);export{L as C,b as a,u as c};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{bI as Q,r as C,o as As,s as mt,c as N,j as o,bj as It,u as Y,k as Ps,t as Ls,a as oe,f as zs,ab as gn,bE as F,bJ as Ds,an as Ws,al as _t,am as ne,ao as bn,ap as Hs,ah as Tt,ai as Fs,aq as jn,ak as vn,ax as Vs,ay as Bs,at as yn,az as Us,bK as $t,bL as qs,aj as Ks,bf as Js,b9 as Gs,bM as Zs,bt as wn}from"./index-DCr6r7Yw.js";import{E as Sn,I as Ye,n as Xs}from"./empty-state-Ba47ZVsf.js";import{E as Nn}from"./error-boundary-BkEvrItd.js";import{a as Et,u as Ot,f as Rt,e as Mt,d as At}from"./use-collections-OpbhFLgE.js";import{u as ee}from"./constants-C7esE5S6.js";import{P as Pt}from"./pin-to-sidebar-button-BZ72nAEL.js";import{B as V,c as O}from"./button-B-LIjJ0d.js";import{F as pt,a as Qs,b as Lt,d as zt}from"./form-BHWppF5B.js";import{I as Dt}from"./input-BdbOsF-m.js";import{T as yt}from"./textarea-DHc00T9T.js";import{T as le,a as ce,b as ae,c as de}from"./tooltip-C6LqelJl.js";import{i as kn}from"./FlipBackward-fTp7bHML.js";import{a as Cn,V as Wt,b as Ee}from"./layout-SO6IbyRc.js";import{S as In,a as _n,b as Tn,c as $n,d as wt}from"./select-DcK9kiBG.js";import{i as Ys}from"./AlertCircle-Yil9qnEH.js";import{s as eo,M as Oe}from"./monaco-editor-B5Aw8k_-.js";import{i as to}from"./Code01-BG3tlXRj.js";import{a as no}from"./Copy01-Bu63nBOw.js";import{i as ze}from"./Loading01-BbK7X7pB.js";import{i as Ht,n as so}from"./Play-DSNBv8J3.js";import{s as Ft}from"./XClose-r2Q3_LuT.js";import{u as oo,O as ro,M as io,F as lo,v as co}from"./index-B05deeSQ.js";import{u as Vt,b as ao}from"./use-connection-eyF66tJm.js";import{E as Bt}from"./empty-state-DA7yVTaN.js";import{D as uo,a as fo}from"./use-binding-fpuk0ApB.js";import{b as En}from"./use-virtual-mcp-DtuFFUUi.js";import{b as mo,R as rn,a as po}from"./resizable-C2Utw1an.js";import{S as De}from"./spinner-CoVqlI-k.js";import{V as xo}from"./view-mode-toggle-4IXqr_wc.js";import{N as ho,b as go,c as bo,d as jo,m as Ke,P as vo,e as yo,R as wo,f as So,g as No,h as ln,E as ko,j as Co,T as Io,k as _o,l as To,n as On}from"./index-Ci9wq6UB.js";import{b as $o,c as Eo,d as Oo,e as Ro,a as Mo,D as Ao}from"./dialog-UCxLeO_h.js";import"./index-BDV46Exd.js";import{s as Rn}from"./Plus-DUZn7G9j.js";import{i as Ut}from"./Check-oakDJ2AF.js";import{i as Po}from"./DotsHorizontal-B811S-jI.js";import{D as Lo,a as zo,b as Do,c as cn}from"./dropdown-menu-kuIIANP5.js";import{i as Wo}from"./Grid01-Dr_KfxW1.js";import{B as $e}from"./badge-Ai9GD5PG.js";import{i as Mn}from"./X-DUs80l2J.js";import"./useMutation-DjlaCojA.js";import"./useQuery-Bs28vQtV.js";import"./Pin01-Cmat2KYq.js";import"./use-organization-settings-QaQjoeNw.js";import"./ArrowLeft-OdEDEe_C.js";import"./ChevronDown-Bap_L0Uk.js";import"./infiniteQueryObserver-CcbuhEfP.js";import"./mcp-oauth-B8scVlEC.js";import"./env-vars-editor-BZSzAH_1.js";import"./Trash01-FyRIWKSN.js";import"./File06-ElvtcbN_.js";import"./Key01-BOAbiw2j.js";import"./extract-connection-data-D2dnQRcn.js";import"./constants-DqcZdoXa.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-Xp067sQn.js";import"./generate-id-Dyweu44Y.js";import"./Terminal-DGX7jD8k.js";import"./Users03-CPhtgAec.js";import"./index-BKkW7Unn.js";import"./circle-alert-CgaIPI4d.js";import"./binder-BrVJi0Ik.js";import"./localstorage-keys-DOkcu8sQ.js";import"./popover-DisoFbn-.js";import"./Image01-5eXX0GAe.js";import"./SearchMd-Dqpb7vw_.js";import"./use-mcp-prompts-Cw_2aGFv.js";import"./ArrowUp-Dal03NKa.js";import"./Edit01-CSIvGo0w.js";import"./use-create-virtual-mcp-Dlso4n1S.js";const An=Q("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const Pn=Q("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const qt=Q("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const Kt=Q("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const Ho=Q("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Fo=Q("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const Vo=Q("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const Ln=Q("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const zn=Q("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const Dn=Q("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const Wn=Q("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const Hn=Q("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]),Jt=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M12 8v4m0 4h.01M2 8.523v6.954c0 .245 0 .367.028.482a1 1 0 0 0 .12.29c.061.1.148.187.32.36l4.923 4.922c.173.173.26.26.36.322.09.054.188.095.29.12.115.027.237.027.482.027h6.954c.245 0 .367 0 .482-.028a.998.998 0 0 0 .29-.12c.1-.061.187-.148.36-.32l4.922-4.923c.173-.173.26-.26.322-.36a.998.998 0 0 0 .12-.29c.027-.115.027-.237.027-.482V8.523c0-.245 0-.367-.028-.482a.998.998 0 0 0-.12-.29c-.061-.1-.148-.187-.32-.36L16.608 2.47c-.173-.173-.26-.26-.36-.322a1 1 0 0 0-.29-.12C15.844 2 15.722 2 15.477 2H8.523c-.245 0-.367 0-.482.028a1 1 0 0 0-.29.12c-.1.061-.187.148-.36.32L2.47 7.392c-.173.173-.26.26-.322.36a1 1 0 0 0-.12.29C2 8.156 2 8.278 2 8.523Z"}));Jt.displayName="AlertOctagon";const Fn=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M20.5 8v8.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.22 21 17.38 21 15.7 21H8.3c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3.5 18.72 3.5 17.88 3.5 16.2V8m.1-5h16.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C22 3.76 22 4.04 22 4.6v1.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C21.24 8 20.96 8 20.4 8H3.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C2 7.24 2 6.96 2 6.4V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C2.76 3 3.04 3 3.6 3Zm6 8.5h4.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C16 12.26 16 12.54 16 13.1v.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437c-.214.109-.494.109-1.054.109H9.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C8 14.74 8 14.46 8 13.9v-.8c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C8.76 11.5 9.04 11.5 9.6 11.5Z"}));Fn.displayName="Box";const Vn=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"m22.7 11.5-2 2-2-2m2.245 1.5A9 9 0 1 0 19 17.657M12 7v5l3 2"}));Vn.displayName="ClockFastForward";const Bn=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"m17 17 5-5-5-5M7 7l-5 5 5 5m7-14-4 18"}));Bn.displayName="Code02";const Je=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M6.8 3h-.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C3 4.52 3 5.08 3 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21h.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C10 19.48 10 18.92 10 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C8.48 3 7.92 3 6.8 3Zm11 0h-.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C14 4.52 14 5.08 14 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C15.52 21 16.08 21 17.2 21h.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C19.48 3 18.92 3 17.8 3Z"}));Je.displayName="Columns01";const Un=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M4 4v1.4c0 3.36 0 5.04.654 6.324a6 6 0 0 0 2.622 2.622C8.56 15 10.24 15 13.6 15H20m0 0-5-5m5 5-5 5"}));Un.displayName="CornerDownRight";const qn=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M21 5c0 1.657-4.03 3-9 3S3 6.657 3 5m18 0c0-1.657-4.03-3-9-3S3 3.343 3 5m18 0v14c0 1.66-4 3-9 3s-9-1.34-9-3V5m18 7c0 1.66-4 3-9 3s-9-1.34-9-3"}));qn.displayName="Database01";const Kn=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M3 3v10.2c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 18 6.12 18 7.8 18H15m0 0a3 3 0 1 0 6 0 3 3 0 0 0-6 0ZM3 8h12m0 0a3 3 0 1 0 6 0 3 3 0 0 0-6 0Z"}));Kn.displayName="GitBranch01";const Jn=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"m13 22-3-3m0 0 3-3m-3 3h5a7 7 0 0 0 3-13.326M6 18.326A7 7 0 0 1 9 5h5m0 0-3-3m3 3-3 3"}));Jn.displayName="Repeat03";const Gt=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M15 8H8.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C7 7.24 7 6.96 7 6.4V3m10 18v-6.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C16.24 13 15.96 13 15.4 13H8.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C7 13.76 7 14.04 7 14.6V21M21 9.325V16.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h6.875c.489 0 .733 0 .963.055.204.05.4.13.579.24.201.123.374.296.72.642l3.126 3.126c.346.346.519.519.642.72.11.18.19.374.24.579.055.23.055.474.055.963Z"}));Gt.displayName="Save02";const Gn=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M15.631 7.631c-.396-.396-.594-.594-.668-.822a1 1 0 0 1 0-.618c.074-.228.272-.426.668-.822L18.47 2.53a6 6 0 0 0-8.3 6.895c.12.49.179.734.168.888a.849.849 0 0 1-.11.392c-.07.138-.207.274-.48.547L3.5 17.5a2.121 2.121 0 0 0 3 3l6.248-6.248c.273-.273.41-.41.547-.48a.849.849 0 0 1 .392-.11c.154-.011.399.049.888.168a6 6 0 0 0 6.895-8.3l-2.84 2.84c-.396.396-.594.594-.822.668a1 1 0 0 1-.618 0c-.228-.074-.426-.272-.822-.668l-.738-.738Z"}));Gn.displayName="Tool01";As({title:mt().min(1),description:mt().nullable(),body:mt()});function xt(t){for(const e of t.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Bo(){const t=window.location.pathname.split("/").filter(Boolean),e=t.findIndex(s=>s==="mcps"),n=e>=0?t[e+1]:void 0;return n?decodeURIComponent(n):void 0}function Uo(t){const e=N.c(13),{form:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=s):s=e[0];let i;e[1]!==n.control?(i=o.jsxs("div",{className:"flex flex-col gap-4",children:[s,o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[o.jsx(pt,{control:n.control,name:"title",render:Jo}),o.jsx(pt,{control:n.control,name:"description",render:Ko})]})]}),e[1]=n.control,e[2]=i):i=e[2];let r,l;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),l=o.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=l):(r=e[3],l=e[4]);let c;e[5]!==n.control?(c=o.jsxs("div",{className:"flex flex-col gap-2",children:[r,l,o.jsx(pt,{control:n.control,name:"body",render:qo})]}),e[5]=n.control,e[6]=c):c=e[6];let a;e[7]!==i||e[8]!==c?(a=o.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[i,c]}),e[7]=i,e[8]=c,e[9]=a):a=e[9];let d;return e[10]!==n||e[11]!==a?(d=o.jsx(Qs,{...n,children:a}),e[10]=n,e[11]=a,e[12]=d):d=e[12],d}function qo(t){const{field:e}=t;return o.jsx(Lt,{children:o.jsx(zt,{children:o.jsx(yt,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function Ko(t){const{field:e}=t;return o.jsxs(Lt,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),o.jsx(zt,{children:o.jsx(Dt,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Jo(t){const{field:e}=t;return o.jsxs(Lt,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),o.jsx(zt,{children:o.jsx(Dt,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Go(t){const e=N.c(52),{providerId:n,promptId:s,onBack:i}=t,l=It().location.href,{org:c}=Y(),a=n||null;let d;e[0]!==c.id||e[1]!==a?(d={connectionId:a,orgId:c.id},e[0]=c.id,e[1]=a,e[2]=d):d=e[2];const u=ee(d),f=Et(n,"PROMPT",s,u),p=Ot(n,"PROMPT",u),x=p.update.isPending;let m;e[3]!==f?(m=f?{title:f.title,description:f.description??null,body:xt(f)}:void 0,e[3]=f,e[4]=m):m=e[4];let h;e[5]!==m?(h={values:m},e[5]=m,e[6]=h):h=e[6];const g=Ps(h);let b;e[7]!==g||e[8]!==f?(b=()=>{f&&g.reset({title:f.title,description:f.description??null,body:xt(f)})},e[7]=g,e[8]=f,e[9]=b):b=e[9];const j=b;let y;e[10]!==p.update||e[11]!==g||e[12]!==s?(y=g.handleSubmit(async D=>{const G=await p.update.mutateAsync({id:s,data:{title:D.title,description:D.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:D.body}}]}});g.reset({title:G.title,description:G.description??null,body:xt(G)})}),e[10]=p.update,e[11]=g,e[12]=s,e[13]=y):y=e[13];const w=y;if(!f){let D;return e[14]===Symbol.for("react.memo_cache_sentinel")?(D=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(Sn,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[14]=D):D=e[14],D}let v;e[15]!==f.title?(v=o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:f.title}),e[15]=f.title,e[16]=v):v=e[16];let S;e[17]!==f.description?(S=f.description?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),o.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:f.description})]}):null,e[17]=f.description,e[18]=S):S=e[18];let k;e[19]!==v||e[20]!==S?(k=o.jsx(Cn,{children:o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[v,S]})}),e[19]=v,e[20]=S,e[21]=k):k=e[21];let I;e[22]!==f.title||e[23]!==l?(I=o.jsx(Pt,{title:f.title,url:l,icon:"description"}),e[22]=f.title,e[23]=l,e[24]=I):I=e[24];const T=!g.formState.isDirty||x;let A;e[25]===Symbol.for("react.memo_cache_sentinel")?(A=o.jsx(kn,{size:14}),e[25]=A):A=e[25];let R;e[26]!==j||e[27]!==T?(R=o.jsx(le,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:o.jsx(V,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:T,onClick:j,"aria-label":"Cancel",children:A})})}),e[26]=j,e[27]=T,e[28]=R):R=e[28];let P;e[29]===Symbol.for("react.memo_cache_sentinel")?(P=o.jsx(ce,{side:"bottom",children:"Cancel"}),e[29]=P):P=e[29];let z;e[30]!==R?(z=o.jsx(ae,{children:o.jsxs(de,{delayDuration:0,children:[R,P]})}),e[30]=R,e[31]=z):z=e[31];const q=!g.formState.isDirty||x;let M;e[32]!==w?(M=()=>{w()},e[32]=w,e[33]=M):M=e[33];let J;e[34]===Symbol.for("react.memo_cache_sentinel")?(J=o.jsx(Gt,{size:14}),e[34]=J):J=e[34];let _;e[35]!==q||e[36]!==M?(_=o.jsx(le,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:o.jsx(V,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:q,onClick:M,"aria-label":"Save",children:J})})}),e[35]=q,e[36]=M,e[37]=_):_=e[37];let $;e[38]===Symbol.for("react.memo_cache_sentinel")?($=o.jsx(ce,{side:"bottom",children:"Save"}),e[38]=$):$=e[38];let E;e[39]!==_?(E=o.jsx(ae,{children:o.jsxs(de,{delayDuration:0,children:[_,$]})}),e[39]=_,e[40]=E):E=e[40];let L;e[41]!==I||e[42]!==z||e[43]!==E?(L=o.jsxs(Wt,{children:[I,z,E]}),e[41]=I,e[42]=z,e[43]=E,e[44]=L):L=e[44];let H;e[45]!==g?(H=o.jsx("div",{className:"h-full",children:o.jsx(Uo,{form:g})}),e[45]=g,e[46]=H):H=e[46];let X;return e[47]!==i||e[48]!==L||e[49]!==H||e[50]!==k?(X=o.jsxs(Ee,{onBack:i,children:[k,L,H]}),e[47]=i,e[48]=L,e[49]=H,e[50]=k,e[51]=X):X=e[51],X}function Zo(t){const e=N.c(5),{itemId:n,onBack:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=Bo(),e[0]=i):i=e[0];const r=i;if(!r){let c;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(Sn,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=c):c=e[1],c}let l;return e[2]!==n||e[3]!==s?(l=o.jsx(Nn,{children:o.jsx(C.Suspense,{fallback:null,children:o.jsx(Go,{providerId:r,promptId:n,onBack:s})})}),e[2]=n,e[3]=s,e[4]=l):l=e[4],l}const Xo=Ls("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function Qo(t){const e=N.c(10);let n,s,i;e[0]!==t?({className:n,variant:i,...s}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i):(n=e[1],s=e[2],i=e[3]);let r;e[4]!==n||e[5]!==i?(r=O(Xo({variant:i}),n),e[4]=n,e[5]=i,e[6]=r):r=e[6];let l;return e[7]!==s||e[8]!==r?(l=o.jsx("div",{"data-slot":"alert",role:"alert",className:r,...s}),e[7]=s,e[8]=r,e[9]=l):l=e[9],l}function Yo(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=O("line-clamp-1 min-h-4 font-medium tracking-tight",n),e[3]=n,e[4]=i):i=e[4];let r;return e[5]!==s||e[6]!==i?(r=o.jsx("div",{"data-slot":"alert-title",className:i,...s}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}function er(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=O("text-muted-foreground leading-relaxed",n),e[3]=n,e[4]=i):i=e[4];let r;return e[5]!==s||e[6]!==i?(r=o.jsx("div",{"data-slot":"alert-description",className:i,...s}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}const tr=t=>t.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function nr(t){const e=N.c(10),{toolName:n,connectionId:s,onBack:i}=t;let r;e[0]!==s?(r={connectionId:s},e[0]=s,e[1]=r):r=e[1];const l=oo(r);if(!l.isAuthenticated){let d;return e[2]!==l.supportsOAuth||e[3]!==i?(d=o.jsx("div",{className:"flex h-full items-center justify-center",children:l.supportsOAuth?o.jsx(ro,{onAuthenticate:()=>i(),buttonText:"Go back to authenticate"}):o.jsx(io,{hasReadme:!1})}),e[2]=l.supportsOAuth,e[3]=i,e[4]=d):d=e[4],d}const c=`${s}:${n}`;let a;return e[5]!==s||e[6]!==i||e[7]!==c||e[8]!==n?(a=o.jsx(sr,{toolName:n,connectionId:s,onBack:i},c),e[5]=s,e[6]=i,e[7]=c,e[8]=n,e[9]=a):a=e[9],a}function sr({toolName:t,connectionId:e,onBack:n}){const i=It().location.href,{replayId:r}=zs({strict:!1}),l=(()=>{if(!r)return null;const _=`replay-${r}`,$=sessionStorage.getItem(_);if(!$)return null;sessionStorage.removeItem(_);try{return JSON.parse($)}catch{return null}})(),c=(()=>{if(!l)return null;const _={};for(const[$,E]of Object.entries(l))E!==null&&typeof E=="object"?_[$]=JSON.stringify(E,null,2):_[$]=E;return _})(),[a,d]=C.useState(c??{}),[u,f]=C.useState(l?JSON.stringify(l,null,2):"{}"),[p,x]=C.useState(null),[m,h]=C.useState(null),[g,b]=C.useState(!1),[j,y]=C.useState(null),{org:w}=Y(),v=Vt(e),S=ee({connectionId:e,orgId:w.id}),k=Rt({client:S}),I=k.data?.tools?.find(_=>_.name===t),T=I?.inputSchema?.properties,A=T?Object.keys(T):[],R=A.length>0,P={};if(R&&I?.inputSchema?.properties)for(const _ of A)P[_]=I.inputSchema.required?.includes(_)?"":void 0;const z=_=>Object.prototype.hasOwnProperty.call(a,_),q=async()=>{b(!0),h(null),x(null),y(null);const _=performance.now();try{if(!S)throw new Error("MCP client is not available");const $=R?{...P,...a}:(()=>{const B=u.trim();if(!B)return{};const K=JSON.parse(B);if(K&&typeof K=="object")return K;throw new Error("Raw JSON input must be an object.")})();R&&I?.inputSchema?.properties&&Object.entries(I.inputSchema.properties).forEach(([B,K])=>{if((K.type==="object"||K.type==="array")&&typeof $[B]=="string")try{$[B]=JSON.parse($[B])}catch{}});const E=await S.callTool({name:t,arguments:$}),L=E.structuredContent??E,H=performance.now(),X=Math.round(H-_);x(L);const D=JSON.stringify(L),G=new TextEncoder().encode(D).length;y({duration:`${X}ms`,bytes:`${G} bytes`,tokens:`~${Math.ceil(G/4)} tokens`,cost:"$0.0000"})}catch($){const E=$ instanceof Error?$.message:String($);h(E||"Unknown error occurred");const L=performance.now();y({duration:`${Math.round(L-_)}ms`})}finally{b(!1)}},M=(_,$)=>{d(E=>({...E,[_]:$}))},J=()=>{x(null),h(null),y(null)};return o.jsxs(Ee,{onBack:n,children:[o.jsx(Wt,{children:o.jsx(Pt,{title:I?.name??tr(t),url:i,icon:"build"})}),o.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 h-full",children:[o.jsx("div",{className:"flex flex-col border-r border-border overflow-hidden",children:o.jsxs("div",{className:"flex-1 overflow-auto",children:[o.jsx("div",{className:"flex flex-col gap-4 p-6 border-b border-border min-h-28",children:o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(Ye,{icon:v?.icon||null,name:v?.title||t,size:"sm",className:"shadow-sm shrink-0"}),o.jsx("h1",{className:"text-lg font-medium text-foreground leading-none",children:t}),o.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit",children:[k.isSuccess?o.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):k.isLoading?o.jsx(ze,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):o.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),o.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:k.isSuccess?"ready":k.isLoading?"connecting":"error"})]})]}),o.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:I?.description||"No description available"})]})}),o.jsxs("div",{className:"flex flex-col p-6 gap-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),I?.inputSchema?.required&&I.inputSchema.required.length>0&&o.jsxs("span",{className:"text-xs text-muted-foreground",children:[o.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),o.jsx("div",{className:"space-y-4",children:R&&I?.inputSchema?.properties?Object.entries(I.inputSchema.properties).map(([_,$])=>o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[_,I.inputSchema?.required?.includes(_)&&o.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),o.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:$.type})]}),$.description&&o.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:$.description}),$.type==="object"||$.type==="array"?o.jsx(yt,{className:"font-mono text-xs",value:z(_)?a[_]??"":P[_]??"",onChange:E=>M(_,E.target.value),placeholder:`Enter ${_} as JSON...`,rows:3}):$.type==="boolean"?o.jsxs(In,{value:z(_)?String(a[_]??""):"",onValueChange:E=>M(_,E==="true"),children:[o.jsx(_n,{children:o.jsx(Tn,{placeholder:"Select true or false..."})}),o.jsxs($n,{children:[o.jsx(wt,{value:"true",children:"true"}),o.jsx(wt,{value:"false",children:"false"})]})]}):o.jsx(Dt,{value:z(_)?a[_]??"":P[_]??"",onChange:E=>M(_,E.target.value),placeholder:`Enter ${_}...`})]},_)):I?.inputSchema&&!R?o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),o.jsx(yt,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:_=>f(_.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):o.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:o.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})})]})]})}),o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[o.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-t lg:border-t-0 border-b border-border bg-background",children:[o.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),j&&o.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(eo,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:j.duration})]}),j.tokens&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(Fn,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:j.tokens})]}),j.bytes&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(qn,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:j.bytes})]}),j.cost&&o.jsx("div",{className:"flex items-center gap-1.5",children:o.jsx("span",{className:"font-mono text-foreground",children:j.cost})})]})]}),o.jsx("div",{className:"flex items-center justify-end lg:justify-between px-4 h-14 border-b border-border bg-background",children:o.jsxs("div",{className:"flex items-center gap-2 w-full lg:w-auto",children:[o.jsx(V,{size:"sm",variant:"default",className:"h-8 gap-2 flex-1 lg:flex-none",onClick:q,disabled:g,children:g?o.jsxs(o.Fragment,{children:[o.jsx(ze,{size:14,className:"animate-spin"}),"Executing..."]}):o.jsxs(o.Fragment,{children:[o.jsx(Ht,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})}),o.jsx(ae,{children:o.jsxs(de,{children:[o.jsx(le,{asChild:!0,children:o.jsx(V,{size:"icon",variant:"outline",className:"h-8 w-8 shrink-0",onClick:J,disabled:!p&&!m,children:o.jsx(Ft,{size:14})})}),o.jsx(ce,{children:o.jsx("p",{children:"Clear results"})})]})})]})}),m&&o.jsx("div",{className:"px-6 py-4 bg-background",children:o.jsx(Qo,{variant:"destructive",children:o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Ys,{className:"h-4 w-4"}),o.jsx(Yo,{className:"mb-0",children:"Execution Failed"})]}),o.jsx(er,{className:"text-xs text-destructive",children:m})]})})}),o.jsx("div",{className:"relative flex-1 overflow-auto bg-muted/50",children:p?o.jsxs(o.Fragment,{children:[o.jsx(Oe,{code:JSON.stringify(p,null,2),language:"json",height:"100%",readOnly:!0}),o.jsx(V,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(p,null,2)),gn.success("Copied to clipboard")},children:o.jsx(no,{className:"h-3.5 w-3.5"})})]}):o.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[o.jsx(to,{className:"h-12 w-12 mb-3 opacity-40"}),o.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]})]})]})}function or(t){const e=N.c(7),{itemId:n,onBack:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},e[0]=i):i=e[0];const l=oe(i).connectionId;if(!Vt(l)||!l){let u;return e[1]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[1]=u):u=e[1],u}let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ze,{size:32,className:"animate-spin text-muted-foreground"})}),e[2]=a):a=e[2];let d;return e[3]!==l||e[4]!==s||e[5]!==n?(d=o.jsx(C.Suspense,{fallback:a,children:o.jsx(nr,{toolName:n,connectionId:l,onBack:s})}),e[3]=l,e[4]=s,e[5]=n,e[6]=d):d=e[6],d}const an=t=>{let e;const n=new Set,s=(d,u)=>{const f=typeof d=="function"?d(e):d;if(!Object.is(f,e)){const p=e;e=u??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(x=>x(e,p))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:d=>(n.add(d),()=>n.delete(d))},a=e=t(s,i,c);return c},Zt=(t=>t?an(t):an),rr=t=>t;function St(t,e=rr){const n=F.useSyncExternalStore(t.subscribe,F.useCallback(()=>e(t.getState()),[t,e]),F.useCallback(()=>e(t.getInitialState()),[t,e]));return F.useDebugValue(n),n}const ir=t=>{const e=Zt(t),n=s=>St(e,s);return Object.assign(n,e),n},lr=(t=>ir);function Zn(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const Nt=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return Nt(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return Nt(s)(n)}}}},cr=(t,e)=>(n,s,i)=>{let r={storage:Zn(()=>localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,d=new Set;let u=r.storage;if(!u)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return u.setItem(r.name,{state:g,version:r.version})},p=i.setState;i.setState=(g,b)=>(p(g,b),f());const x=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>x;let m;const h=()=>{var g,b;if(!u)return;const j=++c;l=!1,a.forEach(w=>{var v;return w((v=s())!=null?v:x)});const y=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:x))||void 0;return Nt(u.getItem.bind(u))(r.name).then(w=>{if(w)if(typeof w.version=="number"&&w.version!==r.version){if(r.migrate){const v=r.migrate(w.state,w.version);return v instanceof Promise?v.then(S=>[!0,S]):[!0,v]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,w.state];return[!1,void 0]}).then(w=>{var v;if(j!==c)return;const[S,k]=w;if(m=r.merge(k,(v=s())!=null?v:x),n(m,!0),S)return f()}).then(()=>{j===c&&(y?.(m,void 0),m=s(),l=!0,d.forEach(w=>w(m)))}).catch(w=>{j===c&&y?.(void 0,w)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(u=g.storage)},clearStorage:()=>{u?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(d.add(g),()=>{d.delete(g)})},r.skipHydration||h(),m||x},Xn=cr,{useSyncExternalStoreWithSelector:ar}=Ds,dr=t=>t;function ur(t,e=dr,n){const s=ar(t.subscribe,t.getState,t.getInitialState,e,n);return F.useDebugValue(s),s}const dn=t=>Symbol.iterator in t,un=t=>"entries"in t,fn=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},fr=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function mr(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:dn(t)&&dn(e)?un(t)&&un(e)?fn(t,e):fr(t,e):fn({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function pr(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
|
|
1
|
+
import{bI as Q,r as C,o as As,s as mt,c as N,j as o,bj as It,u as Y,k as Ps,t as Ls,a as oe,f as zs,ab as gn,bE as F,bJ as Ds,an as Ws,al as _t,am as ne,ao as bn,ap as Hs,ah as Tt,ai as Fs,aq as jn,ak as vn,ax as Vs,ay as Bs,at as yn,az as Us,bK as $t,bL as qs,aj as Ks,bf as Js,b9 as Gs,bM as Zs,bt as wn}from"./index-D2NuI3iU.js";import{E as Sn,I as Ye,n as Xs}from"./empty-state-BXZkhJxy.js";import{E as Nn}from"./error-boundary-nXWXpjqs.js";import{a as Et,u as Ot,f as Rt,e as Mt,d as At}from"./use-collections-CBIy_5Qw.js";import{u as ee}from"./constants-BXzi8HVW.js";import{P as Pt}from"./pin-to-sidebar-button-0wgpOO5S.js";import{B as V,c as O}from"./button-DlVdUZ44.js";import{F as pt,a as Qs,b as Lt,d as zt}from"./form-BCZDQ7AS.js";import{I as Dt}from"./input-BkKQBUrk.js";import{T as yt}from"./textarea-C4MT8dn6.js";import{T as le,a as ce,b as ae,c as de}from"./tooltip-BiJ523EQ.js";import{i as kn}from"./FlipBackward-C9QP9lON.js";import{a as Cn,V as Wt,b as Ee}from"./layout-D6JC-ymj.js";import{S as In,a as _n,b as Tn,c as $n,d as wt}from"./select-Ma6s5t-T.js";import{i as Ys}from"./AlertCircle-BfeKUTHB.js";import{s as eo,M as Oe}from"./monaco-editor-CwV_zSmr.js";import{i as to}from"./Code01-D8qtdtas.js";import{a as no}from"./Copy01-D9ChgQky.js";import{i as ze}from"./Loading01-CulKrbt9.js";import{i as Ht,n as so}from"./Play-FVezjTHF.js";import{s as Ft}from"./XClose-C8BPkkIJ.js";import{u as oo,O as ro,M as io,F as lo,v as co}from"./index-DBSgNCJ5.js";import{u as Vt,b as ao}from"./use-connection-zb_kzrz-.js";import{E as Bt}from"./empty-state-D46GK6Uk.js";import{D as uo,a as fo}from"./use-binding-BDMK8q5z.js";import{b as En}from"./use-virtual-mcp-Ci0gP59X.js";import{b as mo,R as rn,a as po}from"./resizable-Bn8yP8MB.js";import{S as De}from"./spinner-C63y8Nks.js";import{V as xo}from"./view-mode-toggle-D9jjzQte.js";import{N as ho,b as go,c as bo,d as jo,m as Ke,P as vo,e as yo,R as wo,f as So,g as No,h as ln,E as ko,j as Co,T as Io,k as _o,l as To,n as On}from"./index-F2oRJBei.js";import{b as $o,c as Eo,d as Oo,e as Ro,a as Mo,D as Ao}from"./dialog-D-YL1wCt.js";import"./index-BBwSGiB0.js";import{s as Rn}from"./Plus-BLRLeHqJ.js";import{i as Ut}from"./Check-0HSx2q18.js";import{i as Po}from"./DotsHorizontal-CyQkNRcH.js";import{D as Lo,a as zo,b as Do,c as cn}from"./dropdown-menu-I0Wtq-dL.js";import{i as Wo}from"./Grid01-D2GHQgH8.js";import{B as $e}from"./badge-BonzW3UO.js";import{i as Mn}from"./X-C0Q8MqB2.js";import"./useMutation-D8vdh_mW.js";import"./useQuery-BwUD3Nyu.js";import"./Pin01-Csj4eqX2.js";import"./use-organization-settings-DwkdYEXw.js";import"./ArrowLeft-C8Eu0U71.js";import"./ChevronDown-C_TMSoNY.js";import"./infiniteQueryObserver-7ojtaUHB.js";import"./mcp-oauth-DfG-1-N6.js";import"./env-vars-editor-wQ79cgg4.js";import"./Trash01-DyBbXzXG.js";import"./File06-CFKKek9h.js";import"./Key01-C9yXGlnw.js";import"./extract-connection-data-iwi6SKZ6.js";import"./constants-Rz5BExrd.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-DPB6aan1.js";import"./generate-id-Dyweu44Y.js";import"./Terminal-BB15jMJz.js";import"./Users03-BUBTY2DH.js";import"./index-DAkHq7-U.js";import"./circle-alert-DvRd-P4d.js";import"./binder-3KJD-o52.js";import"./localstorage-keys-D8_EA5Ep.js";import"./popover-DG4RfOsm.js";import"./Image01-fZfQpIfS.js";import"./SearchMd-CKpCIdMC.js";import"./use-mcp-prompts-B43-strm.js";import"./ArrowUp-CMRYmfEj.js";import"./Edit01-CeBWYX1f.js";import"./use-create-virtual-mcp-D9l-aLnA.js";const An=Q("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const Pn=Q("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const qt=Q("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const Kt=Q("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const Ho=Q("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Fo=Q("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const Vo=Q("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const Ln=Q("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const zn=Q("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const Dn=Q("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const Wn=Q("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const Hn=Q("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]),Jt=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M12 8v4m0 4h.01M2 8.523v6.954c0 .245 0 .367.028.482a1 1 0 0 0 .12.29c.061.1.148.187.32.36l4.923 4.922c.173.173.26.26.36.322.09.054.188.095.29.12.115.027.237.027.482.027h6.954c.245 0 .367 0 .482-.028a.998.998 0 0 0 .29-.12c.1-.061.187-.148.36-.32l4.922-4.923c.173-.173.26-.26.322-.36a.998.998 0 0 0 .12-.29c.027-.115.027-.237.027-.482V8.523c0-.245 0-.367-.028-.482a.998.998 0 0 0-.12-.29c-.061-.1-.148-.187-.32-.36L16.608 2.47c-.173-.173-.26-.26-.36-.322a1 1 0 0 0-.29-.12C15.844 2 15.722 2 15.477 2H8.523c-.245 0-.367 0-.482.028a1 1 0 0 0-.29.12c-.1.061-.187.148-.36.32L2.47 7.392c-.173.173-.26.26-.322.36a1 1 0 0 0-.12.29C2 8.156 2 8.278 2 8.523Z"}));Jt.displayName="AlertOctagon";const Fn=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M20.5 8v8.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.22 21 17.38 21 15.7 21H8.3c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3.5 18.72 3.5 17.88 3.5 16.2V8m.1-5h16.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C22 3.76 22 4.04 22 4.6v1.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C21.24 8 20.96 8 20.4 8H3.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C2 7.24 2 6.96 2 6.4V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C2.76 3 3.04 3 3.6 3Zm6 8.5h4.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C16 12.26 16 12.54 16 13.1v.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437c-.214.109-.494.109-1.054.109H9.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C8 14.74 8 14.46 8 13.9v-.8c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C8.76 11.5 9.04 11.5 9.6 11.5Z"}));Fn.displayName="Box";const Vn=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"m22.7 11.5-2 2-2-2m2.245 1.5A9 9 0 1 0 19 17.657M12 7v5l3 2"}));Vn.displayName="ClockFastForward";const Bn=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"m17 17 5-5-5-5M7 7l-5 5 5 5m7-14-4 18"}));Bn.displayName="Code02";const Je=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M6.8 3h-.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C3 4.52 3 5.08 3 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21h.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C10 19.48 10 18.92 10 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C8.48 3 7.92 3 6.8 3Zm11 0h-.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C14 4.52 14 5.08 14 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C15.52 21 16.08 21 17.2 21h.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C19.48 3 18.92 3 17.8 3Z"}));Je.displayName="Columns01";const Un=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M4 4v1.4c0 3.36 0 5.04.654 6.324a6 6 0 0 0 2.622 2.622C8.56 15 10.24 15 13.6 15H20m0 0-5-5m5 5-5 5"}));Un.displayName="CornerDownRight";const qn=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M21 5c0 1.657-4.03 3-9 3S3 6.657 3 5m18 0c0-1.657-4.03-3-9-3S3 3.343 3 5m18 0v14c0 1.66-4 3-9 3s-9-1.34-9-3V5m18 7c0 1.66-4 3-9 3s-9-1.34-9-3"}));qn.displayName="Database01";const Kn=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M3 3v10.2c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 18 6.12 18 7.8 18H15m0 0a3 3 0 1 0 6 0 3 3 0 0 0-6 0ZM3 8h12m0 0a3 3 0 1 0 6 0 3 3 0 0 0-6 0Z"}));Kn.displayName="GitBranch01";const Jn=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"m13 22-3-3m0 0 3-3m-3 3h5a7 7 0 0 0 3-13.326M6 18.326A7 7 0 0 1 9 5h5m0 0-3-3m3 3-3 3"}));Jn.displayName="Repeat03";const Gt=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M15 8H8.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C7 7.24 7 6.96 7 6.4V3m10 18v-6.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C16.24 13 15.96 13 15.4 13H8.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C7 13.76 7 14.04 7 14.6V21M21 9.325V16.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h6.875c.489 0 .733 0 .963.055.204.05.4.13.579.24.201.123.374.296.72.642l3.126 3.126c.346.346.519.519.642.72.11.18.19.374.24.579.055.23.055.474.055.963Z"}));Gt.displayName="Save02";const Gn=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M15.631 7.631c-.396-.396-.594-.594-.668-.822a1 1 0 0 1 0-.618c.074-.228.272-.426.668-.822L18.47 2.53a6 6 0 0 0-8.3 6.895c.12.49.179.734.168.888a.849.849 0 0 1-.11.392c-.07.138-.207.274-.48.547L3.5 17.5a2.121 2.121 0 0 0 3 3l6.248-6.248c.273-.273.41-.41.547-.48a.849.849 0 0 1 .392-.11c.154-.011.399.049.888.168a6 6 0 0 0 6.895-8.3l-2.84 2.84c-.396.396-.594.594-.822.668a1 1 0 0 1-.618 0c-.228-.074-.426-.272-.822-.668l-.738-.738Z"}));Gn.displayName="Tool01";As({title:mt().min(1),description:mt().nullable(),body:mt()});function xt(t){for(const e of t.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Bo(){const t=window.location.pathname.split("/").filter(Boolean),e=t.findIndex(s=>s==="mcps"),n=e>=0?t[e+1]:void 0;return n?decodeURIComponent(n):void 0}function Uo(t){const e=N.c(13),{form:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=s):s=e[0];let i;e[1]!==n.control?(i=o.jsxs("div",{className:"flex flex-col gap-4",children:[s,o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[o.jsx(pt,{control:n.control,name:"title",render:Jo}),o.jsx(pt,{control:n.control,name:"description",render:Ko})]})]}),e[1]=n.control,e[2]=i):i=e[2];let r,l;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),l=o.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=l):(r=e[3],l=e[4]);let c;e[5]!==n.control?(c=o.jsxs("div",{className:"flex flex-col gap-2",children:[r,l,o.jsx(pt,{control:n.control,name:"body",render:qo})]}),e[5]=n.control,e[6]=c):c=e[6];let a;e[7]!==i||e[8]!==c?(a=o.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[i,c]}),e[7]=i,e[8]=c,e[9]=a):a=e[9];let d;return e[10]!==n||e[11]!==a?(d=o.jsx(Qs,{...n,children:a}),e[10]=n,e[11]=a,e[12]=d):d=e[12],d}function qo(t){const{field:e}=t;return o.jsx(Lt,{children:o.jsx(zt,{children:o.jsx(yt,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function Ko(t){const{field:e}=t;return o.jsxs(Lt,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),o.jsx(zt,{children:o.jsx(Dt,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Jo(t){const{field:e}=t;return o.jsxs(Lt,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),o.jsx(zt,{children:o.jsx(Dt,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Go(t){const e=N.c(52),{providerId:n,promptId:s,onBack:i}=t,l=It().location.href,{org:c}=Y(),a=n||null;let d;e[0]!==c.id||e[1]!==a?(d={connectionId:a,orgId:c.id},e[0]=c.id,e[1]=a,e[2]=d):d=e[2];const u=ee(d),f=Et(n,"PROMPT",s,u),p=Ot(n,"PROMPT",u),x=p.update.isPending;let m;e[3]!==f?(m=f?{title:f.title,description:f.description??null,body:xt(f)}:void 0,e[3]=f,e[4]=m):m=e[4];let h;e[5]!==m?(h={values:m},e[5]=m,e[6]=h):h=e[6];const g=Ps(h);let b;e[7]!==g||e[8]!==f?(b=()=>{f&&g.reset({title:f.title,description:f.description??null,body:xt(f)})},e[7]=g,e[8]=f,e[9]=b):b=e[9];const j=b;let y;e[10]!==p.update||e[11]!==g||e[12]!==s?(y=g.handleSubmit(async D=>{const G=await p.update.mutateAsync({id:s,data:{title:D.title,description:D.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:D.body}}]}});g.reset({title:G.title,description:G.description??null,body:xt(G)})}),e[10]=p.update,e[11]=g,e[12]=s,e[13]=y):y=e[13];const w=y;if(!f){let D;return e[14]===Symbol.for("react.memo_cache_sentinel")?(D=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(Sn,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[14]=D):D=e[14],D}let v;e[15]!==f.title?(v=o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:f.title}),e[15]=f.title,e[16]=v):v=e[16];let S;e[17]!==f.description?(S=f.description?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),o.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:f.description})]}):null,e[17]=f.description,e[18]=S):S=e[18];let k;e[19]!==v||e[20]!==S?(k=o.jsx(Cn,{children:o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[v,S]})}),e[19]=v,e[20]=S,e[21]=k):k=e[21];let I;e[22]!==f.title||e[23]!==l?(I=o.jsx(Pt,{title:f.title,url:l,icon:"description"}),e[22]=f.title,e[23]=l,e[24]=I):I=e[24];const T=!g.formState.isDirty||x;let A;e[25]===Symbol.for("react.memo_cache_sentinel")?(A=o.jsx(kn,{size:14}),e[25]=A):A=e[25];let R;e[26]!==j||e[27]!==T?(R=o.jsx(le,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:o.jsx(V,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:T,onClick:j,"aria-label":"Cancel",children:A})})}),e[26]=j,e[27]=T,e[28]=R):R=e[28];let P;e[29]===Symbol.for("react.memo_cache_sentinel")?(P=o.jsx(ce,{side:"bottom",children:"Cancel"}),e[29]=P):P=e[29];let z;e[30]!==R?(z=o.jsx(ae,{children:o.jsxs(de,{delayDuration:0,children:[R,P]})}),e[30]=R,e[31]=z):z=e[31];const q=!g.formState.isDirty||x;let M;e[32]!==w?(M=()=>{w()},e[32]=w,e[33]=M):M=e[33];let J;e[34]===Symbol.for("react.memo_cache_sentinel")?(J=o.jsx(Gt,{size:14}),e[34]=J):J=e[34];let _;e[35]!==q||e[36]!==M?(_=o.jsx(le,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:o.jsx(V,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:q,onClick:M,"aria-label":"Save",children:J})})}),e[35]=q,e[36]=M,e[37]=_):_=e[37];let $;e[38]===Symbol.for("react.memo_cache_sentinel")?($=o.jsx(ce,{side:"bottom",children:"Save"}),e[38]=$):$=e[38];let E;e[39]!==_?(E=o.jsx(ae,{children:o.jsxs(de,{delayDuration:0,children:[_,$]})}),e[39]=_,e[40]=E):E=e[40];let L;e[41]!==I||e[42]!==z||e[43]!==E?(L=o.jsxs(Wt,{children:[I,z,E]}),e[41]=I,e[42]=z,e[43]=E,e[44]=L):L=e[44];let H;e[45]!==g?(H=o.jsx("div",{className:"h-full",children:o.jsx(Uo,{form:g})}),e[45]=g,e[46]=H):H=e[46];let X;return e[47]!==i||e[48]!==L||e[49]!==H||e[50]!==k?(X=o.jsxs(Ee,{onBack:i,children:[k,L,H]}),e[47]=i,e[48]=L,e[49]=H,e[50]=k,e[51]=X):X=e[51],X}function Zo(t){const e=N.c(5),{itemId:n,onBack:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=Bo(),e[0]=i):i=e[0];const r=i;if(!r){let c;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(Sn,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=c):c=e[1],c}let l;return e[2]!==n||e[3]!==s?(l=o.jsx(Nn,{children:o.jsx(C.Suspense,{fallback:null,children:o.jsx(Go,{providerId:r,promptId:n,onBack:s})})}),e[2]=n,e[3]=s,e[4]=l):l=e[4],l}const Xo=Ls("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function Qo(t){const e=N.c(10);let n,s,i;e[0]!==t?({className:n,variant:i,...s}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i):(n=e[1],s=e[2],i=e[3]);let r;e[4]!==n||e[5]!==i?(r=O(Xo({variant:i}),n),e[4]=n,e[5]=i,e[6]=r):r=e[6];let l;return e[7]!==s||e[8]!==r?(l=o.jsx("div",{"data-slot":"alert",role:"alert",className:r,...s}),e[7]=s,e[8]=r,e[9]=l):l=e[9],l}function Yo(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=O("line-clamp-1 min-h-4 font-medium tracking-tight",n),e[3]=n,e[4]=i):i=e[4];let r;return e[5]!==s||e[6]!==i?(r=o.jsx("div",{"data-slot":"alert-title",className:i,...s}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}function er(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=O("text-muted-foreground leading-relaxed",n),e[3]=n,e[4]=i):i=e[4];let r;return e[5]!==s||e[6]!==i?(r=o.jsx("div",{"data-slot":"alert-description",className:i,...s}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}const tr=t=>t.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function nr(t){const e=N.c(10),{toolName:n,connectionId:s,onBack:i}=t;let r;e[0]!==s?(r={connectionId:s},e[0]=s,e[1]=r):r=e[1];const l=oo(r);if(!l.isAuthenticated){let d;return e[2]!==l.supportsOAuth||e[3]!==i?(d=o.jsx("div",{className:"flex h-full items-center justify-center",children:l.supportsOAuth?o.jsx(ro,{onAuthenticate:()=>i(),buttonText:"Go back to authenticate"}):o.jsx(io,{hasReadme:!1})}),e[2]=l.supportsOAuth,e[3]=i,e[4]=d):d=e[4],d}const c=`${s}:${n}`;let a;return e[5]!==s||e[6]!==i||e[7]!==c||e[8]!==n?(a=o.jsx(sr,{toolName:n,connectionId:s,onBack:i},c),e[5]=s,e[6]=i,e[7]=c,e[8]=n,e[9]=a):a=e[9],a}function sr({toolName:t,connectionId:e,onBack:n}){const i=It().location.href,{replayId:r}=zs({strict:!1}),l=(()=>{if(!r)return null;const _=`replay-${r}`,$=sessionStorage.getItem(_);if(!$)return null;sessionStorage.removeItem(_);try{return JSON.parse($)}catch{return null}})(),c=(()=>{if(!l)return null;const _={};for(const[$,E]of Object.entries(l))E!==null&&typeof E=="object"?_[$]=JSON.stringify(E,null,2):_[$]=E;return _})(),[a,d]=C.useState(c??{}),[u,f]=C.useState(l?JSON.stringify(l,null,2):"{}"),[p,x]=C.useState(null),[m,h]=C.useState(null),[g,b]=C.useState(!1),[j,y]=C.useState(null),{org:w}=Y(),v=Vt(e),S=ee({connectionId:e,orgId:w.id}),k=Rt({client:S}),I=k.data?.tools?.find(_=>_.name===t),T=I?.inputSchema?.properties,A=T?Object.keys(T):[],R=A.length>0,P={};if(R&&I?.inputSchema?.properties)for(const _ of A)P[_]=I.inputSchema.required?.includes(_)?"":void 0;const z=_=>Object.prototype.hasOwnProperty.call(a,_),q=async()=>{b(!0),h(null),x(null),y(null);const _=performance.now();try{if(!S)throw new Error("MCP client is not available");const $=R?{...P,...a}:(()=>{const B=u.trim();if(!B)return{};const K=JSON.parse(B);if(K&&typeof K=="object")return K;throw new Error("Raw JSON input must be an object.")})();R&&I?.inputSchema?.properties&&Object.entries(I.inputSchema.properties).forEach(([B,K])=>{if((K.type==="object"||K.type==="array")&&typeof $[B]=="string")try{$[B]=JSON.parse($[B])}catch{}});const E=await S.callTool({name:t,arguments:$}),L=E.structuredContent??E,H=performance.now(),X=Math.round(H-_);x(L);const D=JSON.stringify(L),G=new TextEncoder().encode(D).length;y({duration:`${X}ms`,bytes:`${G} bytes`,tokens:`~${Math.ceil(G/4)} tokens`,cost:"$0.0000"})}catch($){const E=$ instanceof Error?$.message:String($);h(E||"Unknown error occurred");const L=performance.now();y({duration:`${Math.round(L-_)}ms`})}finally{b(!1)}},M=(_,$)=>{d(E=>({...E,[_]:$}))},J=()=>{x(null),h(null),y(null)};return o.jsxs(Ee,{onBack:n,children:[o.jsx(Wt,{children:o.jsx(Pt,{title:I?.name??tr(t),url:i,icon:"build"})}),o.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 h-full",children:[o.jsx("div",{className:"flex flex-col border-r border-border overflow-hidden",children:o.jsxs("div",{className:"flex-1 overflow-auto",children:[o.jsx("div",{className:"flex flex-col gap-4 p-6 border-b border-border min-h-28",children:o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(Ye,{icon:v?.icon||null,name:v?.title||t,size:"sm",className:"shadow-sm shrink-0"}),o.jsx("h1",{className:"text-lg font-medium text-foreground leading-none",children:t}),o.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit",children:[k.isSuccess?o.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):k.isLoading?o.jsx(ze,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):o.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),o.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:k.isSuccess?"ready":k.isLoading?"connecting":"error"})]})]}),o.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:I?.description||"No description available"})]})}),o.jsxs("div",{className:"flex flex-col p-6 gap-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),I?.inputSchema?.required&&I.inputSchema.required.length>0&&o.jsxs("span",{className:"text-xs text-muted-foreground",children:[o.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),o.jsx("div",{className:"space-y-4",children:R&&I?.inputSchema?.properties?Object.entries(I.inputSchema.properties).map(([_,$])=>o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[_,I.inputSchema?.required?.includes(_)&&o.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),o.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:$.type})]}),$.description&&o.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:$.description}),$.type==="object"||$.type==="array"?o.jsx(yt,{className:"font-mono text-xs",value:z(_)?a[_]??"":P[_]??"",onChange:E=>M(_,E.target.value),placeholder:`Enter ${_} as JSON...`,rows:3}):$.type==="boolean"?o.jsxs(In,{value:z(_)?String(a[_]??""):"",onValueChange:E=>M(_,E==="true"),children:[o.jsx(_n,{children:o.jsx(Tn,{placeholder:"Select true or false..."})}),o.jsxs($n,{children:[o.jsx(wt,{value:"true",children:"true"}),o.jsx(wt,{value:"false",children:"false"})]})]}):o.jsx(Dt,{value:z(_)?a[_]??"":P[_]??"",onChange:E=>M(_,E.target.value),placeholder:`Enter ${_}...`})]},_)):I?.inputSchema&&!R?o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),o.jsx(yt,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:_=>f(_.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):o.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:o.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})})]})]})}),o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[o.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-t lg:border-t-0 border-b border-border bg-background",children:[o.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),j&&o.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(eo,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:j.duration})]}),j.tokens&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(Fn,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:j.tokens})]}),j.bytes&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(qn,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:j.bytes})]}),j.cost&&o.jsx("div",{className:"flex items-center gap-1.5",children:o.jsx("span",{className:"font-mono text-foreground",children:j.cost})})]})]}),o.jsx("div",{className:"flex items-center justify-end lg:justify-between px-4 h-14 border-b border-border bg-background",children:o.jsxs("div",{className:"flex items-center gap-2 w-full lg:w-auto",children:[o.jsx(V,{size:"sm",variant:"default",className:"h-8 gap-2 flex-1 lg:flex-none",onClick:q,disabled:g,children:g?o.jsxs(o.Fragment,{children:[o.jsx(ze,{size:14,className:"animate-spin"}),"Executing..."]}):o.jsxs(o.Fragment,{children:[o.jsx(Ht,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})}),o.jsx(ae,{children:o.jsxs(de,{children:[o.jsx(le,{asChild:!0,children:o.jsx(V,{size:"icon",variant:"outline",className:"h-8 w-8 shrink-0",onClick:J,disabled:!p&&!m,children:o.jsx(Ft,{size:14})})}),o.jsx(ce,{children:o.jsx("p",{children:"Clear results"})})]})})]})}),m&&o.jsx("div",{className:"px-6 py-4 bg-background",children:o.jsx(Qo,{variant:"destructive",children:o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Ys,{className:"h-4 w-4"}),o.jsx(Yo,{className:"mb-0",children:"Execution Failed"})]}),o.jsx(er,{className:"text-xs text-destructive",children:m})]})})}),o.jsx("div",{className:"relative flex-1 overflow-auto bg-muted/50",children:p?o.jsxs(o.Fragment,{children:[o.jsx(Oe,{code:JSON.stringify(p,null,2),language:"json",height:"100%",readOnly:!0}),o.jsx(V,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(p,null,2)),gn.success("Copied to clipboard")},children:o.jsx(no,{className:"h-3.5 w-3.5"})})]}):o.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[o.jsx(to,{className:"h-12 w-12 mb-3 opacity-40"}),o.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]})]})]})}function or(t){const e=N.c(7),{itemId:n,onBack:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},e[0]=i):i=e[0];const l=oe(i).connectionId;if(!Vt(l)||!l){let u;return e[1]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[1]=u):u=e[1],u}let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ze,{size:32,className:"animate-spin text-muted-foreground"})}),e[2]=a):a=e[2];let d;return e[3]!==l||e[4]!==s||e[5]!==n?(d=o.jsx(C.Suspense,{fallback:a,children:o.jsx(nr,{toolName:n,connectionId:l,onBack:s})}),e[3]=l,e[4]=s,e[5]=n,e[6]=d):d=e[6],d}const an=t=>{let e;const n=new Set,s=(d,u)=>{const f=typeof d=="function"?d(e):d;if(!Object.is(f,e)){const p=e;e=u??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(x=>x(e,p))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:d=>(n.add(d),()=>n.delete(d))},a=e=t(s,i,c);return c},Zt=(t=>t?an(t):an),rr=t=>t;function St(t,e=rr){const n=F.useSyncExternalStore(t.subscribe,F.useCallback(()=>e(t.getState()),[t,e]),F.useCallback(()=>e(t.getInitialState()),[t,e]));return F.useDebugValue(n),n}const ir=t=>{const e=Zt(t),n=s=>St(e,s);return Object.assign(n,e),n},lr=(t=>ir);function Zn(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const Nt=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return Nt(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return Nt(s)(n)}}}},cr=(t,e)=>(n,s,i)=>{let r={storage:Zn(()=>localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,d=new Set;let u=r.storage;if(!u)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return u.setItem(r.name,{state:g,version:r.version})},p=i.setState;i.setState=(g,b)=>(p(g,b),f());const x=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>x;let m;const h=()=>{var g,b;if(!u)return;const j=++c;l=!1,a.forEach(w=>{var v;return w((v=s())!=null?v:x)});const y=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:x))||void 0;return Nt(u.getItem.bind(u))(r.name).then(w=>{if(w)if(typeof w.version=="number"&&w.version!==r.version){if(r.migrate){const v=r.migrate(w.state,w.version);return v instanceof Promise?v.then(S=>[!0,S]):[!0,v]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,w.state];return[!1,void 0]}).then(w=>{var v;if(j!==c)return;const[S,k]=w;if(m=r.merge(k,(v=s())!=null?v:x),n(m,!0),S)return f()}).then(()=>{j===c&&(y?.(m,void 0),m=s(),l=!0,d.forEach(w=>w(m)))}).catch(w=>{j===c&&y?.(void 0,w)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(u=g.storage)},clearStorage:()=>{u?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(d.add(g),()=>{d.delete(g)})},r.skipHydration||h(),m||x},Xn=cr,{useSyncExternalStoreWithSelector:ar}=Ds,dr=t=>t;function ur(t,e=dr,n){const s=ar(t.subscribe,t.getState,t.getInitialState,e,n);return F.useDebugValue(s),s}const dn=t=>Symbol.iterator in t,un=t=>"entries"in t,fn=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},fr=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function mr(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:dn(t)&&dn(e)?un(t)&&un(e)?fn(t,e):fr(t,e):fn({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function pr(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
|
|
2
2
|
${Object.entries(l).map(([d,u])=>{const f=c.has(d)?"":"?";return`${u.description?` /** ${u.description} */
|
|
3
3
|
`:""} ${d}${f}: ${n(u)};`}).join(`
|
|
4
4
|
`)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as j,c as k,j as s}from"./index-
|
|
1
|
+
import{r as j,c as k,j as s}from"./index-D2NuI3iU.js";import{c as N,B as C}from"./button-DlVdUZ44.js";import{c as y,a as M,D as z,b as D}from"./dropdown-menu-I0Wtq-dL.js";import{i as S}from"./ArrowUp-CMRYmfEj.js";import{i as T}from"./Check-0HSx2q18.js";import{c as E}from"./Grid01-D2GHQgH8.js";import{i as V}from"./List-GahfP4qk.js";import{b as _,c as B,T as L,a as $}from"./tooltip-BiJ523EQ.js";import{V as W}from"./view-mode-toggle-D9jjzQte.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-
|
|
1
|
+
import{c as v,j as l}from"./index-D2NuI3iU.js";import{C as b}from"./collection-display-button-Dl9t2uPq.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-
|
|
1
|
+
import{c as s,j as c}from"./index-D2NuI3iU.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-
|
|
1
|
+
import{c as g,j as a}from"./index-D2NuI3iU.js";import{i as b}from"./Loading01-CulKrbt9.js";import{i as j}from"./SearchMd-CKpCIdMC.js";import{I as N}from"./input-BkKQBUrk.js";import{c as v}from"./button-DlVdUZ44.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,l as at,bj as ct,g as dt,r as mt,ab as ft}from"./index-DCr6r7Yw.js";import{g as Ue}from"./generate-id-Dyweu44Y.js";import{C as qe}from"./collection-display-button-DdFsgETm.js";import{C as ut}from"./collection-search-BdprEFJN.js";import{C as pt}from"./card-XaHspUBI.js";import{I as Ge,E as ht}from"./empty-state-Ba47ZVsf.js";import{D as We,a as He,b as Je,c as F}from"./dropdown-menu-kuIIANP5.js";import{B as ke,c as Oe}from"./button-B-LIjJ0d.js";import{a as Qe}from"./Copy01-Bu63nBOw.js";import{i as Ye}from"./DotsVertical-fX_KnNQj.js";import{i as Xe}from"./Edit01-CSIvGo0w.js";import{s as Ze,u as xt}from"./use-list-state-DkhtaHnD.js";import{s as et}from"./Trash01-FyRIWKSN.js";import{C as gt}from"./collection-table-wrapper-CaRdow_V.js";import{E as Le}from"./empty-state-DA7yVTaN.js";import{n as Be}from"./Inbox01-BQOiy5jS.js";import{A as Me}from"./avatar-DbbO_Vrc.js";import{u as jt}from"./useQuery-Bs28vQtV.js";import{a as Ct,u as tt}from"./constants-C7esE5S6.js";import{P as vt}from"./pin-to-sidebar-button-BZ72nAEL.js";import{u as bt,b as yt}from"./use-collections-OpbhFLgE.js";import{u as Nt}from"./use-connection-eyF66tJm.js";import{B as wt}from"./constants-DqcZdoXa.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-JqkmaZeq.js";import{s as Et}from"./Plus-DUZn7G9j.js";import{V as zt}from"./layout-SO6IbyRc.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,l as at,bj as ct,g as dt,r as mt,ab as ft}from"./index-D2NuI3iU.js";import{g as Ue}from"./generate-id-Dyweu44Y.js";import{C as qe}from"./collection-display-button-Dl9t2uPq.js";import{C as ut}from"./collection-search-BJKawcxK.js";import{C as pt}from"./card-DTyKddtb.js";import{I as Ge,E as ht}from"./empty-state-BXZkhJxy.js";import{D as We,a as He,b as Je,c as F}from"./dropdown-menu-I0Wtq-dL.js";import{B as ke,c as Oe}from"./button-DlVdUZ44.js";import{a as Qe}from"./Copy01-D9ChgQky.js";import{i as Ye}from"./DotsVertical-DRiGtjkD.js";import{i as Xe}from"./Edit01-CeBWYX1f.js";import{s as Ze,u as xt}from"./use-list-state-DKH2OiDg.js";import{s as et}from"./Trash01-DyBbXzXG.js";import{C as gt}from"./collection-table-wrapper-Ca_hknwt.js";import{E as Le}from"./empty-state-D46GK6Uk.js";import{n as Be}from"./Inbox01-DB1LDaFW.js";import{A as Me}from"./avatar-DfZGbVLk.js";import{u as jt}from"./useQuery-BwUD3Nyu.js";import{a as Ct,u as tt}from"./constants-BXzi8HVW.js";import{P as vt}from"./pin-to-sidebar-button-0wgpOO5S.js";import{u as bt,b as yt}from"./use-collections-CBIy_5Qw.js";import{u as Nt}from"./use-connection-zb_kzrz-.js";import{B as wt}from"./constants-Rz5BExrd.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-ttBjGoGp.js";import{s as Et}from"./Plus-BLRLeHqJ.js";import{V as zt}from"./layout-D6JC-ymj.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-
|
|
1
|
+
import{c as g,j as o}from"./index-D2NuI3iU.js";import{c as u}from"./button-DlVdUZ44.js";import{n as T}from"./collection-display-button-Dl9t2uPq.js";import{i as $}from"./ArrowUp-CMRYmfEj.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,bx as M,j as e,by as P,Y as q,r as R,ab as h,a as O}from"./index-
|
|
1
|
+
import{c as T,bx as M,j as e,by as P,Y as q,r as R,ab as h,a as O}from"./index-D2NuI3iU.js";import{u as A}from"./useQuery-BwUD3Nyu.js";import{u as _}from"./useMutation-D8vdh_mW.js";import{B as y}from"./button-DlVdUZ44.js";import{C as N,a as v}from"./card-DTyKddtb.js";import{i as L,a as U}from"./mcp-oauth-DfG-1-N6.js";import{c as C,C as K,a as k}from"./circle-alert-DvRd-P4d.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"}]],Y=C("refresh-cw",J),B=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(B,{}),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(Y,{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-
|
|
1
|
+
import{c as S,j as s}from"./index-D2NuI3iU.js";import{C as _}from"./card-DTyKddtb.js";import{c as j}from"./button-DlVdUZ44.js";import{I as A}from"./empty-state-BXZkhJxy.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};
|