@decocms/mesh 2.76.0 → 2.78.0
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-TbirTaeA.js → AlertCircle-BppvLQSd.js} +1 -1
- package/dist/client/assets/{ArrowUp-DVhz9MPT.js → ArrowUp-D26ZQKRa.js} +1 -1
- package/dist/client/assets/{Calendar-BhleOqT-.js → Calendar-DDieAsd2.js} +1 -1
- package/dist/client/assets/{Check-BIlnRzi6.js → Check-bgVFNRDs.js} +1 -1
- package/dist/client/assets/{CheckCircle-CSYoAEm3.js → CheckCircle-D5tJhsvc.js} +1 -1
- package/dist/client/assets/{CheckDone01-gZo2F6uL.js → CheckDone01-dY3WtOge.js} +1 -1
- package/dist/client/assets/{ChevronDown-jAfIG9nZ.js → ChevronDown-DY4fpd0G.js} +1 -1
- package/dist/client/assets/{ChevronRight-CNYkXy1u.js → ChevronRight-DMzFQQCc.js} +1 -1
- package/dist/client/assets/{Code01-DeVT5m93.js → Code01-7hV4ZDjZ.js} +1 -1
- package/dist/client/assets/{Copy01-BJPi2nBZ.js → Copy01-C35WeFYE.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-CZIcl0Ye.js → DotsHorizontal-LbVwX-Tq.js} +1 -1
- package/dist/client/assets/{DotsVertical-CPJps54j.js → DotsVertical-BNqPYTki.js} +1 -1
- package/dist/client/assets/{Download01-BVA62GFI.js → Download01-Cihql6Z7.js} +1 -1
- package/dist/client/assets/{Edit01-CLT1AKyh.js → Edit01-DDrpQJgk.js} +1 -1
- package/dist/client/assets/{File02-M7e4eeKQ.js → File02-GEmd_G7y.js} +1 -1
- package/dist/client/assets/{File06-BUOJeS0C.js → File06-888BgyfZ.js} +1 -1
- package/dist/client/assets/{FilterLines-CDkZPaiO.js → FilterLines-Bvkz4XO7.js} +1 -1
- package/dist/client/assets/{Globe02-CNtZ4Mz7.js → Globe02-DSX2gzp_.js} +1 -1
- package/dist/client/assets/{Grid01-BhCIE3UE.js → Grid01-CfSiTcO8.js} +1 -1
- package/dist/client/assets/{Home02-Zp_wVezk.js → Home02-PhQXF8P6.js} +1 -1
- package/dist/client/assets/{Image01-Bmljn0R6.js → Image01-BUR65REQ.js} +1 -1
- package/dist/client/assets/{Inbox01-Bz-1SNbb.js → Inbox01-Bhe6QhSW.js} +1 -1
- package/dist/client/assets/{InfoCircle-DutDNmXq.js → InfoCircle-5NZyA5WD.js} +1 -1
- package/dist/client/assets/{LinkExternal01-npl2D9IH.js → LinkExternal01-Cr89LzOE.js} +1 -1
- package/dist/client/assets/{List-B95opsr5.js → List-BBkbo-oe.js} +1 -1
- package/dist/client/assets/{Loading01-CudhqwtJ.js → Loading01-C2vqzEw-.js} +1 -1
- package/dist/client/assets/{Lock01-C3j5poil.js → Lock01-ClMI2bMm.js} +1 -1
- package/dist/client/assets/{Pin01-DpTwe7GO.js → Pin01-uiXGtZsb.js} +1 -1
- package/dist/client/assets/{Play-BxFFyAEF.js → Play-Bm8SKfhZ.js} +1 -1
- package/dist/client/assets/{Plus-BVPnBK8D.js → Plus-BMOTPGqH.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-Dzlid7sh.js → RefreshCcw01-B1tus5Lj.js} +1 -1
- package/dist/client/assets/{SearchMd-yRVgOeax.js → SearchMd-BqVXNd65.js} +1 -1
- package/dist/client/assets/{Settings01-DGIrqZBI.js → Settings01-CYRp4gjN.js} +1 -1
- package/dist/client/assets/{Settings02-CW4MK9LY.js → Settings02-BiTxgSpC.js} +1 -1
- package/dist/client/assets/{Share07-BKNvns4q.js → Share07-BZVoNuS6.js} +1 -1
- package/dist/client/assets/{Terminal-DV_yPRWa.js → Terminal-DRpoCIsG.js} +1 -1
- package/dist/client/assets/{Tool01-C0EKLKq5.js → Tool01-djk7g7Hv.js} +1 -1
- package/dist/client/assets/{Trash01-py7ft8Od.js → Trash01-d4v7i3Ze.js} +1 -1
- package/dist/client/assets/{Upload01-CCoXEdI4.js → Upload01-Ci_jklEk.js} +1 -1
- package/dist/client/assets/{Users03-D2F2bran.js → Users03-Bw7fWrTD.js} +1 -1
- package/dist/client/assets/{X-CixxHrye.js → X-CslJd5Ib.js} +1 -1
- package/dist/client/assets/{XClose-S1Me7eeg.js → XClose-CjpNuP8c.js} +1 -1
- package/dist/client/assets/{agent-connections-preview-DZgc-mir.js → agent-connections-preview-qFrRTce9.js} +1 -1
- package/dist/client/assets/{agent-detail-DPLDxB9n.js → agent-detail-BqrAf6oD.js} +1 -1
- package/dist/client/assets/{agents-CynO2-IY.js → agents-DUQt1GSW.js} +1 -1
- package/dist/client/assets/{alert-dialog-B1nWkQHx.js → alert-dialog-DRso9X1m.js} +1 -1
- package/dist/client/assets/{auth-catchall-CJ49F7Eq.js → auth-catchall-CBFb2pC-.js} +1 -1
- package/dist/client/assets/{avatar-BbH9O0kN.js → avatar-kY9raA-l.js} +1 -1
- package/dist/client/assets/{badge-C898LHvV.js → badge-DBw6AEaX.js} +1 -1
- package/dist/client/assets/{binder-xcUkLvPC.js → binder-Jddq1y1v.js} +1 -1
- package/dist/client/assets/{breadcrumb-t_Ccp20G.js → breadcrumb-ChH6wfcA.js} +1 -1
- package/dist/client/assets/{button-C1iesapY.js → button-D_OpQIQm.js} +1 -1
- package/dist/client/assets/{card-DKzkS6ji.js → card-DAZxrY9k.js} +1 -1
- package/dist/client/assets/{checkbox-B82l7mBw.js → checkbox-C1Sx9y02.js} +1 -1
- package/dist/client/assets/{circle-alert-_5s_KbQk.js → circle-alert-DHI8xRUj.js} +1 -1
- package/dist/client/assets/{collection-detail-B-hnHfhu.js → collection-detail-mD5cqpxJ.js} +1 -1
- package/dist/client/assets/{collection-search-D3a5_1zR.js → collection-search-Bkd4qN8a.js} +1 -1
- package/dist/client/assets/{collection-tab-Y58MHDMK.js → collection-tab-Dw5b9EM9.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-B6XWzQ-4.js → collection-table-wrapper-DFTdnQhc.js} +1 -1
- package/dist/client/assets/{collection-tabs-BPHWDFL4.js → collection-tabs-N53MF1Jz.js} +1 -1
- package/dist/client/assets/{command-DepzRVHX.js → command-B5nNM5RC.js} +1 -1
- package/dist/client/assets/{connect-OP0J5SPJ.js → connect--hPmG576.js} +1 -1
- package/dist/client/assets/{connection-card-DkCny6Ez.js → connection-card-Ci3H_H7r.js} +1 -1
- package/dist/client/assets/{connection-detail-CdLleACg.js → connection-detail-8nT6j66Y.js} +1 -1
- package/dist/client/assets/{connections-BZUVvBGs.js → connections-ShazCLrP.js} +1 -1
- package/dist/client/assets/constants-1u4R2d-I.js +1 -0
- package/dist/client/assets/{constants-BEco_-y7.js → constants-DisdEZ3l.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-58b_GUv7.js → create-organization-dialog-Ca5pwwfH.js} +1 -1
- package/dist/client/assets/{create-project-dialog-C5GAJOOY.js → create-project-dialog-BDfz4rOz.js} +1 -1
- package/dist/client/assets/{dialog-CpkgwzHW.js → dialog-BPL7ZvPc.js} +1 -1
- package/dist/client/assets/{dropdown-menu-D6YYwFq7.js → dropdown-menu-BxLN4KkF.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-BMgNBEQS.js → dynamic-plugin-layout-D9dQ0ajA.js} +1 -1
- package/dist/client/assets/{empty-state-BQPtoYZe.js → empty-state-CbIU_RrP.js} +1 -1
- package/dist/client/assets/{empty-state-CH3e4Xzf.js → empty-state-DXJM9xrV.js} +1 -1
- package/dist/client/assets/{env-vars-editor-Vpi1vdW2.js → env-vars-editor-BbjrljLQ.js} +1 -1
- package/dist/client/assets/{error-boundary-BGFWaL1J.js → error-boundary-BMH0CjEH.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CDmQ7rLP.js → extract-connection-data-wB5jtXsg.js} +1 -1
- package/dist/client/assets/{file-browser-DUDclrRh.js → file-browser-DBOCTon5.js} +2 -2
- package/dist/client/assets/{form-NA0-x5iN.js → form-BpiblhO1.js} +1 -1
- package/dist/client/assets/{grid-view-DbtTgaoS.js → grid-view-Bty4YwjE.js} +1 -1
- package/dist/client/assets/{home-DtmWz3MA.js → home-BIvstm5O.js} +1 -1
- package/dist/client/assets/{index-Kq8ytqk9.js → index--vZ0X2xS.js} +1 -1
- package/dist/client/assets/{index-wUnd_o-U.js → index-B9-4goiW.js} +1 -1
- package/dist/client/assets/{index-HxeE9C0A.js → index-BKpxPW_G.js} +2 -2
- package/dist/client/assets/{index-GRocoNYa.js → index-BV_k_ZyP.js} +1 -1
- package/dist/client/assets/{index-C9Dn0opW.js → index-B_142IPp.js} +1 -1
- package/dist/client/assets/{index-DlY6KFzI.js → index-CnNzyZrg.js} +1 -1
- package/dist/client/assets/{index-43_iGxlN.js → index-D-_nr7La.js} +1 -1
- package/dist/client/assets/{index-Dv4saiJc.js → index-D0nVkmnC.js} +1 -1
- package/dist/client/assets/{index-ByJoFAq_.js → index-fVGDVKMq.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-CSOdbqFL.js → infiniteQueryObserver-B8M15Jhm.js} +1 -1
- package/dist/client/assets/{input-DBGu1Yhi.js → input-lpAGMNlp.js} +1 -1
- package/dist/client/assets/{integration-icon-CmJggqPx.js → integration-icon-DFSc5_D8.js} +1 -1
- package/dist/client/assets/{label-11d5Pe_w.js → label-h0it3r-G.js} +1 -1
- package/dist/client/assets/{layout-BQSZy0Ao.js → layout-DaBTH10o.js} +1 -1
- package/dist/client/assets/{localstorage-keys-BxVB7BFB.js → localstorage-keys-CrJngaoW.js} +1 -1
- package/dist/client/assets/{login-CMpn2tdR.js → login-DX4NlTrd.js} +1 -1
- package/dist/client/assets/{mcp-oauth-JrpxCLx4.js → mcp-oauth-DQYLB8aB.js} +1 -1
- package/dist/client/assets/{mcp-server-card-8DET7nVd.js → mcp-server-card-fBAhOAUG.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-CMrzxsYv.js → mcp-server-detail-BZkrf0kt.js} +2 -2
- package/dist/client/assets/{members-CUWgr5ku.js → members-BigA6ZKR.js} +1 -1
- package/dist/client/assets/{monaco-editor-DvJ6AQm-.js → monaco-editor-DZSx9WV6.js} +1 -1
- package/dist/client/assets/{monitoring-Db1K0NxK.js → monitoring-cMb0Xapp.js} +1 -1
- package/dist/client/assets/{oauth-callback-Bh-LWKIz.js → oauth-callback-CjSC6FG1.js} +1 -1
- package/dist/client/assets/{page-Bx3m0Nlj.js → page-BDwNfQ-N.js} +1 -1
- package/dist/client/assets/{page-79TZOOqo.js → page-jq7pkske.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-34Wj3C93.js → plugin-empty-state-CIjn_En1.js} +1 -1
- package/dist/client/assets/{plugin-header-KrvIXXbF.js → plugin-header-DxKd-JRE.js} +1 -1
- package/dist/client/assets/{popover-BbAo_V3q.js → popover-ESVk6nXT.js} +1 -1
- package/dist/client/assets/{project-layout-QE2hcM6x.js → project-layout-DOGEQwDl.js} +1 -1
- package/dist/client/assets/{project-settings-2bxHgR8P.js → project-settings-DPjoRdOS.js} +1 -1
- package/dist/client/assets/{projects-list-CSrfAb2G.js → projects-list-BSPk4OqL.js} +1 -1
- package/dist/client/assets/{registry-utils-CLfG2KJO.js → registry-utils-yxVJe3X4.js} +1 -1
- package/dist/client/assets/{resizable-D5fgPQWp.js → resizable-fcBWjaSA.js} +1 -1
- package/dist/client/assets/{select-CnIfeZ9k.js → select-BbzYJ4VF.js} +1 -1
- package/dist/client/assets/{shell-layout-DIuzNmm5.js → shell-layout-DlF3XvPK.js} +1 -1
- package/dist/client/assets/{spinner-BbdUl9_5.js → spinner-Lv2khbLw.js} +1 -1
- package/dist/client/assets/{store-invite-eQ6O_LcC.js → store-invite-Bg3OdZwq.js} +1 -1
- package/dist/client/assets/{switch-7wa9WQCt.js → switch-sdaV-SJo.js} +1 -1
- package/dist/client/assets/{table-F_F9uG31.js → table-BxUix49E.js} +1 -1
- package/dist/client/assets/{tasks-Bo849zPQ.js → tasks-Bl2i_lGW.js} +1 -1
- package/dist/client/assets/{textarea-CX1AXmSo.js → textarea-BRJpMcB0.js} +1 -1
- package/dist/client/assets/{tools-list-CeBZ5K9_.js → tools-list-Cmzz8Wet.js} +1 -1
- package/dist/client/assets/{topbar-portal-DTnSGvrH.js → topbar-portal-bqTUj07t.js} +1 -1
- package/dist/client/assets/{typewriter-title-CydscG0b.js → typewriter-title-BPMIdq0b.js} +1 -1
- package/dist/client/assets/{use-binding-BIvDtNoa.js → use-binding-DMsO_03X.js} +1 -1
- package/dist/client/assets/{use-connection-DWpxH8iy.js → use-connection-B0740Saa.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CMegJpH_.js → use-create-virtual-mcp-lh01_aoW.js} +1 -1
- package/dist/client/assets/{use-deco-chat-open-DeBMXnMx.js → use-deco-chat-open-B2KYtTue.js} +2 -2
- package/dist/client/assets/{use-install-from-registry-CNdLBCwL.js → use-install-from-registry-BjKzt3Pz.js} +1 -1
- package/dist/client/assets/{use-list-state-CqdwrHCA.js → use-list-state-DNfSCsX5.js} +1 -1
- package/dist/client/assets/{use-llm-B2BVGott.js → use-llm-D28vq8-j.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-CUow6VVK.js → use-mcp-prompts-FoVTG9k7.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DO_-llbI.js → use-mcp-tools-DF65_5AL.js} +1 -1
- package/dist/client/assets/{use-mobile-CqANtQ4e.js → use-mobile-Cu9U-yCu.js} +1 -1
- package/dist/client/assets/{use-organization-settings-ANLw4ex1.js → use-organization-settings-CPNBbiln.js} +1 -1
- package/dist/client/assets/{use-project-C1G7xlcy.js → use-project-CuNldV92.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DaI2d98r.js → use-virtual-mcp-BUCuQhrG.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CsMrU_k5.js +1 -0
- package/dist/client/assets/{useMutation-M3-wug2Q.js → useMutation-Bnsod7M-.js} +1 -1
- package/dist/client/assets/useQuery-Bo6lCSyK.js +1 -0
- package/dist/client/assets/utils-Ckp7rFN8.js +1 -0
- package/dist/client/assets/{view-mode-toggle-JVmuLwXe.js → view-mode-toggle-4jMhv4Z3.js} +1 -1
- package/dist/client/assets/{workflow-BKKAfuJP.js → workflow-BrBoF9SG.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +152 -149
- package/dist/server/server.js +127 -124
- package/package.json +1 -1
- package/dist/client/assets/constants-gwxE8_b0.js +0 -1
- package/dist/client/assets/useInfiniteQuery-CL3o6Gdm.js +0 -1
- package/dist/client/assets/useQuery-jRtVXI31.js +0 -1
- package/dist/client/assets/utils-D1Qd9-I_.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aV as G,r as k,o as Hs,s as xt,c as C,j as o,br as $t,u as X,k as Vs,x as Bs,a as re,f as Us,aM as qe,O as Ke,t as Sn,bt as W,bE as qs,au as Ks,a3 as Tt,an as te,av as wn,aw as Js,am as Et,as as Gs,ax as Nn,al as Cn,aD as Xs,aE as Zs,aq as kn,aF as Qs,bF as Ot,bG as Ys,at as eo,b0 as to,a_ as no,bH as so,bI as In}from"./index-HxeE9C0A.js";import{E as _n}from"./empty-state-CH3e4Xzf.js";import{E as $n}from"./error-boundary-BGFWaL1J.js";import{d as Rt,u as At,f as Ye,h as oo}from"./use-connection-DWpxH8iy.js";import{u as Z,i as ro}from"./constants-BEco_-y7.js";import{S as Tn,P as Mt}from"./index-GRocoNYa.js";import{F as ht,a as io,b as Pt,d as Lt}from"./form-NA0-x5iN.js";import{I as Dt}from"./input-DBGu1Yhi.js";import{T as wt}from"./textarea-CX1AXmSo.js";import{b as En,V as zt,a as ce}from"./layout-BQSZy0Ao.js";import{c as O}from"./utils-D1Qd9-I_.js";import{B as U}from"./button-C1iesapY.js";import{S as On,a as Rn,b as An,c as Mn,d as Nt}from"./select-CnIfeZ9k.js";import{I as et,c as Wt,b as Ft,T as Ht,a as Vt,n as lo}from"./integration-icon-CmJggqPx.js";import{i as co}from"./AlertCircle-TbirTaeA.js";import{s as ao,M as Te}from"./monaco-editor-DvJ6AQm-.js";import{i as uo}from"./Code01-DeVT5m93.js";import{a as fo}from"./Copy01-BJPi2nBZ.js";import{i as Me}from"./Loading01-CudhqwtJ.js";import{i as Bt}from"./Play-BxFFyAEF.js";import{s as Ut}from"./XClose-S1Me7eeg.js";import{B as Pn,a as Ln,b as $e,d as Je,e as Ge,c as Dn}from"./breadcrumb-t_Ccp20G.js";import{u as mo,O as po,M as xo,F as ho,v as go}from"./index-Dv4saiJc.js";import{d as qt,b as Kt,a as Jt}from"./use-mcp-tools-DO_-llbI.js";import{E as Gt}from"./empty-state-BQPtoYZe.js";import{D as bo,a as jo}from"./use-binding-BIvDtNoa.js";import{b as zn}from"./use-virtual-mcp-DaI2d98r.js";import{b as vo,a as dn,R as yo}from"./resizable-D5fgPQWp.js";import{S as tt}from"./spinner-BbdUl9_5.js";import{V as So}from"./view-mode-toggle-JVmuLwXe.js";import{N as wo,S as No,a as Co,c as ko,m as Ve,P as Io,b as _o,R as $o,d as To,e as Eo,f as un,E as Oo,g as Ro}from"./index-C9Dn0opW.js";import{b as Ao,c as Mo,d as Po,e as Lo,a as Do,D as zo}from"./dialog-CpkgwzHW.js";import"./index-Kq8ytqk9.js";import{s as Wn}from"./Plus-BVPnBK8D.js";import{n as Wo}from"./Calendar-BhleOqT-.js";import{i as Xt}from"./Check-BIlnRzi6.js";import{i as Fo}from"./DotsHorizontal-CZIcl0Ye.js";import{a as Ho}from"./Tool01-C0EKLKq5.js";import{D as Vo,a as Bo,b as Uo,c as fn}from"./dropdown-menu-D6YYwFq7.js";import{T as qo,R as Ko,e as Jo,f as Fn}from"./use-deco-chat-open-DeBMXnMx.js";import{i as Go}from"./ChevronRight-CNYkXy1u.js";import{B as _e}from"./badge-C898LHvV.js";import{i as Hn}from"./X-CixxHrye.js";import"./useMutation-M3-wug2Q.js";import"./Pin01-DpTwe7GO.js";import"./use-organization-settings-ANLw4ex1.js";import"./label-11d5Pe_w.js";import"./index-wUnd_o-U.js";import"./index-ByJoFAq_.js";import"./ChevronDown-jAfIG9nZ.js";import"./infiniteQueryObserver-CSOdbqFL.js";import"./mcp-oauth-JrpxCLx4.js";import"./File06-BUOJeS0C.js";import"./index-DlY6KFzI.js";import"./constants-gwxE8_b0.js";import"./registry-utils-CLfG2KJO.js";import"./extract-connection-data-CDmQ7rLP.js";import"./github-icon-Dp3wHhYE.js";import"./generate-id-Dyweu44Y.js";import"./use-install-from-registry-CNdLBCwL.js";import"./circle-alert-_5s_KbQk.js";import"./useQuery-jRtVXI31.js";import"./binder-xcUkLvPC.js";import"./popover-BbAo_V3q.js";import"./use-mcp-prompts-CUow6VVK.js";import"./ArrowUp-DVhz9MPT.js";import"./Edit01-CLT1AKyh.js";import"./Users03-D2F2bran.js";import"./Terminal-DV_yPRWa.js";import"./localstorage-keys-BxVB7BFB.js";import"./SearchMd-yRVgOeax.js";import"./Trash01-py7ft8Od.js";import"./use-create-virtual-mcp-CMegJpH_.js";import"./use-llm-B2BVGott.js";import"./Grid01-BhCIE3UE.js";import"./Image01-Bmljn0R6.js";import"./RefreshCcw01-Dzlid7sh.js";const Vn=G("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 Bn=G("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 Zt=G("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const Qt=G("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const Xo=G("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Zo=G("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const Qo=G("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 Un=G("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 qn=G("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 Kn=G("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 Jn=G("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 Gn=G("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"}]]),Yt=({size:t=24,color:e="currentColor",...n})=>k.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},k.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"}));Yt.displayName="AlertOctagon";const Xn=({size:t=24,color:e="currentColor",...n})=>k.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},k.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"}));Xn.displayName="Box";const Zn=({size:t=24,color:e="currentColor",...n})=>k.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},k.createElement("path",{d:"m22.7 11.5-2 2-2-2m2.245 1.5A9 9 0 1 0 19 17.657M12 7v5l3 2"}));Zn.displayName="ClockFastForward";const Qn=({size:t=24,color:e="currentColor",...n})=>k.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},k.createElement("path",{d:"m17 17 5-5-5-5M7 7l-5 5 5 5m7-14-4 18"}));Qn.displayName="Code02";const Be=({size:t=24,color:e="currentColor",...n})=>k.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},k.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"}));Be.displayName="Columns01";const Yn=({size:t=24,color:e="currentColor",...n})=>k.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},k.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"}));Yn.displayName="CornerDownRight";const es=({size:t=24,color:e="currentColor",...n})=>k.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},k.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"}));es.displayName="Database01";const ts=({size:t=24,color:e="currentColor",...n})=>k.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},k.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"}));ts.displayName="GitBranch01";const ns=({size:t=24,color:e="currentColor",...n})=>k.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},k.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"}));ns.displayName="Repeat03";Hs({title:xt().min(1),description:xt().nullable(),body:xt()});function gt(t){for(const e of t.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Yo(){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 er(t){const e=C.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(ht,{control:n.control,name:"title",render:sr}),o.jsx(ht,{control:n.control,name:"description",render:nr})]})]}),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(ht,{control:n.control,name:"body",render:tr})]}),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 u;return e[10]!==n||e[11]!==a?(u=o.jsx(io,{...n,children:a}),e[10]=n,e[11]=a,e[12]=u):u=e[12],u}function tr(t){const{field:e}=t;return o.jsx(Pt,{children:o.jsx(Lt,{children:o.jsx(wt,{...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 nr(t){const{field:e}=t;return o.jsxs(Pt,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),o.jsx(Lt,{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 sr(t){const{field:e}=t;return o.jsxs(Pt,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),o.jsx(Lt,{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 or(t){const e=C.c(41),{providerId:n,promptId:s}=t,r=$t().location.href,{org:l}=X(),c=n||null;let a;e[0]!==l.id||e[1]!==c?(a={connectionId:c,orgId:l.id},e[0]=l.id,e[1]=c,e[2]=a):a=e[2];const u=Z(a),d=Rt(n,"PROMPT",s,u),f=At(n,"PROMPT",u),m=f.update.isPending;let x;e[3]!==d?(x=d?{title:d.title,description:d.description??null,body:gt(d)}:void 0,e[3]=d,e[4]=x):x=e[4];let p;e[5]!==x?(p={values:x},e[5]=x,e[6]=p):p=e[6];const h=Vs(p);let g;e[7]!==h||e[8]!==d?(g=()=>{d&&h.reset({title:d.title,description:d.description??null,body:gt(d)})},e[7]=h,e[8]=d,e[9]=g):g=e[9];const b=g;let j;e[10]!==f.update||e[11]!==h||e[12]!==s?(j=h.handleSubmit(async M=>{const L=await f.update.mutateAsync({id:s,data:{title:M.title,description:M.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:M.body}}]}});h.reset({title:L.title,description:L.description??null,body:gt(L)})}),e[10]=f.update,e[11]=h,e[12]=s,e[13]=j):j=e[13];const y=j;if(!d){let M;return e[14]===Symbol.for("react.memo_cache_sentinel")?(M=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(_n,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[14]=M):M=e[14],M}let S;e[15]!==d.title?(S=o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:d.title}),e[15]=d.title,e[16]=S):S=e[16];let v;e[17]!==d.description?(v=d.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:d.description})]}):null,e[17]=d.description,e[18]=v):v=e[18];let w;e[19]!==S||e[20]!==v?(w=o.jsx(En,{children:o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[S,v]})}),e[19]=S,e[20]=v,e[21]=w):w=e[21];let N;e[22]!==y?(N=()=>{y()},e[22]=y,e[23]=N):N=e[23];let _;e[24]!==h.formState.isDirty||e[25]!==m||e[26]!==b||e[27]!==N?(_=o.jsx(Tn,{onSave:N,onUndo:b,isDirty:h.formState.isDirty,isSaving:m}),e[24]=h.formState.isDirty,e[25]=m,e[26]=b,e[27]=N,e[28]=_):_=e[28];let I;e[29]!==d.title||e[30]!==r?(I=o.jsx(Mt,{title:d.title,url:r,icon:"description"}),e[29]=d.title,e[30]=r,e[31]=I):I=e[31];let E;e[32]!==_||e[33]!==I?(E=o.jsxs(zt,{children:[_,I]}),e[32]=_,e[33]=I,e[34]=E):E=e[34];let R;e[35]!==h?(R=o.jsx("div",{className:"h-full",children:o.jsx(er,{form:h})}),e[35]=h,e[36]=R):R=e[36];let P;return e[37]!==E||e[38]!==R||e[39]!==w?(P=o.jsxs(ce,{children:[w,E,R]}),e[37]=E,e[38]=R,e[39]=w,e[40]=P):P=e[40],P}function rr(t){const e=C.c(4),{itemId:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=Yo(),e[0]=s):s=e[0];const i=s;if(!i){let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(_n,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=l):l=e[1],l}let r;return e[2]!==n?(r=o.jsx($n,{children:o.jsx(k.Suspense,{fallback:null,children:o.jsx(or,{providerId:i,promptId:n})})}),e[2]=n,e[3]=r):r=e[3],r}const ir=Bs("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 lr(t){const e=C.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(ir({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 cr(t){const e=C.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 ar(t){const e=C.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 mn=t=>t.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function dr(t){const e=C.c(9),{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=mo(r);if(!l.isAuthenticated){let u;return e[2]!==l.supportsOAuth||e[3]!==i?(u=o.jsx("div",{className:"flex h-full items-center justify-center",children:l.supportsOAuth?o.jsx(po,{onAuthenticate:()=>i(),buttonText:"Go back to authenticate"}):o.jsx(xo,{hasReadme:!1})}),e[2]=l.supportsOAuth,e[3]=i,e[4]=u):u=e[4],u}const c=`${s}:${n}`;let a;return e[5]!==s||e[6]!==c||e[7]!==n?(a=o.jsx(ur,{toolName:n,connectionId:s},c),e[5]=s,e[6]=c,e[7]=n,e[8]=a):a=e[8],a}function ur({toolName:t,connectionId:e}){const s=$t().location.href,{replayId:i}=Us({strict:!1}),r=(()=>{if(!i)return null;const $=`replay-${i}`,T=sessionStorage.getItem($);if(!T)return null;sessionStorage.removeItem($);try{return JSON.parse(T)}catch{return null}})(),l=(()=>{if(!r)return null;const $={};for(const[T,A]of Object.entries(r))A!==null&&typeof A=="object"?$[T]=JSON.stringify(A,null,2):$[T]=A;return $})(),[c,a]=k.useState(l??{}),[u,d]=k.useState(r?JSON.stringify(r,null,2):"{}"),[f,m]=k.useState(null),[x,p]=k.useState(null),[h,g]=k.useState(!1),[b,j]=k.useState(null),{org:y}=X(),S=Ye(e),v=Z({connectionId:e,orgId:y.id}),w=qt({client:v}),N=w.data?.tools?.find($=>$.name===t),_=N?.inputSchema?.properties,I=_?Object.keys(_):[],E=I.length>0,R={};if(E&&N?.inputSchema?.properties)for(const $ of I)R[$]=N.inputSchema.required?.includes($)?"":void 0;const P=$=>Object.prototype.hasOwnProperty.call(c,$),M=async()=>{g(!0),p(null),m(null),j(null);const $=performance.now();try{if(!v)throw new Error("MCP client is not available");const T=E?{...R,...c}:(()=>{const V=u.trim();if(!V)return{};const J=JSON.parse(V);if(J&&typeof J=="object")return J;throw new Error("Raw JSON input must be an object.")})();E&&N?.inputSchema?.properties&&Object.entries(N.inputSchema.properties).forEach(([V,J])=>{if((J.type==="object"||J.type==="array")&&typeof T[V]=="string")try{T[V]=JSON.parse(T[V])}catch{}});const A=await v.callTool({name:t,arguments:T}),B=A.structuredContent??A,oe=performance.now(),Q=Math.round(oe-$);m(B);const se=JSON.stringify(B),K=new TextEncoder().encode(se).length;j({duration:`${Q}ms`,bytes:`${K} bytes`,tokens:`~${Math.ceil(K/4)} tokens`,cost:"$0.0000"})}catch(T){const A=T instanceof Error?T.message:String(T);p(A||"Unknown error occurred");const B=performance.now();j({duration:`${Math.round(B-$)}ms`})}finally{g(!1)}},L=($,T)=>{a(A=>({...A,[$]:T}))},D=()=>{m(null),p(null),j(null)},F=N?.name??mn(t),ee=o.jsx(Pn,{children:o.jsxs(Ln,{children:[o.jsx($e,{children:o.jsx(Je,{asChild:!0,children:o.jsx(qe,{to:"/$org/$project/mcps",params:{org:y.slug,project:Ke},children:"Connections"})})}),o.jsx(Ge,{}),S&&o.jsxs(o.Fragment,{children:[o.jsx($e,{children:o.jsx(Je,{asChild:!0,children:o.jsx(qe,{to:"/$org/$project/mcps/$connectionId",params:{org:y.slug,project:Ke,connectionId:e},search:{tab:"tools"},children:S.title})})}),o.jsx(Ge,{})]}),o.jsx($e,{children:o.jsx(Dn,{children:F})})]})});return o.jsxs(ce,{breadcrumb:ee,children:[o.jsx(zt,{children:o.jsx(Mt,{title:N?.name??mn(t),url:s,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(et,{icon:S?.icon||null,name:S?.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:[w.isSuccess?o.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):w.isLoading?o.jsx(Me,{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:w.isSuccess?"ready":w.isLoading?"connecting":"error"})]})]}),o.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:N?.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"}),N?.inputSchema?.required&&N.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:E&&N?.inputSchema?.properties?Object.entries(N.inputSchema.properties).map(([$,T])=>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:[$,N.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:T.type})]}),T.description&&o.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:T.description}),T.type==="object"||T.type==="array"?o.jsx(wt,{className:"font-mono text-xs",value:P($)?c[$]??"":R[$]??"",onChange:A=>L($,A.target.value),placeholder:`Enter ${$} as JSON...`,rows:3}):T.type==="boolean"?o.jsxs(On,{value:P($)?String(c[$]??""):"",onValueChange:A=>L($,A==="true"),children:[o.jsx(Rn,{children:o.jsx(An,{placeholder:"Select true or false..."})}),o.jsxs(Mn,{children:[o.jsx(Nt,{value:"true",children:"true"}),o.jsx(Nt,{value:"false",children:"false"})]})]}):o.jsx(Dt,{value:P($)?c[$]??"":R[$]??"",onChange:A=>L($,A.target.value),placeholder:`Enter ${$}...`})]},$)):N?.inputSchema&&!E?o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),o.jsx(wt,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:$=>d($.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"}),b&&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(ao,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(Xn,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(es,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&o.jsx("div",{className:"flex items-center gap-1.5",children:o.jsx("span",{className:"font-mono text-foreground",children:b.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(U,{size:"sm",variant:"default",className:"h-8 gap-2 flex-1 lg:flex-none",onClick:M,disabled:h,children:h?o.jsxs(o.Fragment,{children:[o.jsx(Me,{size:14,className:"animate-spin"}),"Executing..."]}):o.jsxs(o.Fragment,{children:[o.jsx(Bt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})}),o.jsx(Wt,{children:o.jsxs(Ft,{children:[o.jsx(Ht,{asChild:!0,children:o.jsx(U,{size:"icon",variant:"outline",className:"h-8 w-8 shrink-0",onClick:D,disabled:!f&&!x,children:o.jsx(Ut,{size:14})})}),o.jsx(Vt,{children:o.jsx("p",{children:"Clear results"})})]})})]})}),x&&o.jsx("div",{className:"px-6 py-4 bg-background",children:o.jsx(lr,{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(co,{className:"h-4 w-4"}),o.jsx(cr,{className:"mb-0",children:"Execution Failed"})]}),o.jsx(ar,{className:"text-xs text-destructive",children:x})]})})}),o.jsx("div",{className:"relative flex-1 overflow-auto bg-muted/50",children:f?o.jsxs(o.Fragment,{children:[o.jsx(Te,{code:JSON.stringify(f,null,2),language:"json",height:"100%",readOnly:!0}),o.jsx(U,{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(f,null,2)),Sn.success("Copied to clipboard")},children:o.jsx(fo,{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(uo,{className:"h-12 w-12 mb-3 opacity-40"}),o.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]})]})]})}function fr(t){const e=C.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=re(i).connectionId;if(!Ye(l)||!l){let d;return e[1]===Symbol.for("react.memo_cache_sentinel")?(d=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]=d):d=e[1],d}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(Me,{size:32,className:"animate-spin text-muted-foreground"})}),e[2]=a):a=e[2];let u;return e[3]!==l||e[4]!==s||e[5]!==n?(u=o.jsx(k.Suspense,{fallback:a,children:o.jsx(dr,{toolName:n,connectionId:l,onBack:s})}),e[3]=l,e[4]=s,e[5]=n,e[6]=u):u=e[6],u}const pn=t=>{let e;const n=new Set,s=(u,d)=>{const f=typeof u=="function"?u(e):u;if(!Object.is(f,e)){const m=e;e=d??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(x=>x(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:u=>(n.add(u),()=>n.delete(u))},a=e=t(s,i,c);return c},en=(t=>t?pn(t):pn),mr=t=>t;function Ct(t,e=mr){const n=W.useSyncExternalStore(t.subscribe,W.useCallback(()=>e(t.getState()),[t,e]),W.useCallback(()=>e(t.getInitialState()),[t,e]));return W.useDebugValue(n),n}const pr=t=>{const e=en(t),n=s=>Ct(e,s);return Object.assign(n,e),n},xr=(t=>pr);function ss(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 kt=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return kt(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return kt(s)(n)}}}},hr=(t,e)=>(n,s,i)=>{let r={storage:ss(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,u=new Set;let d=r.storage;if(!d)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 d.setItem(r.name,{state:g,version:r.version})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const x=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>x;let p;const h=()=>{var g,b;if(!d)return;const j=++c;l=!1,a.forEach(S=>{var v;return S((v=s())!=null?v:x)});const y=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:x))||void 0;return kt(d.getItem.bind(d))(r.name).then(S=>{if(S)if(typeof S.version=="number"&&S.version!==r.version){if(r.migrate){const v=r.migrate(S.state,S.version);return v instanceof Promise?v.then(w=>[!0,w]):[!0,v]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,S.state];return[!1,void 0]}).then(S=>{var v;if(j!==c)return;const[w,N]=S;if(p=r.merge(N,(v=s())!=null?v:x),n(p,!0),w)return f()}).then(()=>{j===c&&(y?.(p,void 0),p=s(),l=!0,u.forEach(S=>S(p)))}).catch(S=>{j===c&&y?.(void 0,S)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(d=g.storage)},clearStorage:()=>{d?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(u.add(g),()=>{u.delete(g)})},r.skipHydration||h(),p||x},os=hr,{useSyncExternalStoreWithSelector:gr}=qs,br=t=>t;function jr(t,e=br,n){const s=gr(t.subscribe,t.getState,t.getInitialState,e,n);return W.useDebugValue(s),s}const xn=t=>Symbol.iterator in t,hn=t=>"entries"in t,gn=(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},vr=(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 yr(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:xn(t)&&xn(e)?hn(t)&&hn(e)?gn(t,e):vr(t,e):gn({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Sr(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{aV as G,r as k,o as Hs,s as xt,c as C,j as o,br as $t,u as X,k as Vs,x as Bs,a as re,f as Us,aM as qe,O as Ke,t as Sn,bt as W,bE as qs,au as Ks,a3 as Tt,an as te,av as wn,aw as Js,am as Et,as as Gs,ax as Nn,al as Cn,aD as Xs,aE as Zs,aq as kn,aF as Qs,bF as Ot,bG as Ys,at as eo,b0 as to,a_ as no,bH as so,bI as In}from"./index-BKpxPW_G.js";import{E as _n}from"./empty-state-DXJM9xrV.js";import{E as $n}from"./error-boundary-BMH0CjEH.js";import{d as Rt,u as At,f as Ye,h as oo}from"./use-connection-B0740Saa.js";import{u as Z,i as ro}from"./constants-DisdEZ3l.js";import{S as Tn,P as Mt}from"./index-BV_k_ZyP.js";import{F as ht,a as io,b as Pt,d as Lt}from"./form-BpiblhO1.js";import{I as Dt}from"./input-lpAGMNlp.js";import{T as wt}from"./textarea-BRJpMcB0.js";import{b as En,V as zt,a as ce}from"./layout-DaBTH10o.js";import{c as O}from"./utils-Ckp7rFN8.js";import{B as U}from"./button-D_OpQIQm.js";import{S as On,a as Rn,b as An,c as Mn,d as Nt}from"./select-BbzYJ4VF.js";import{I as et,c as Wt,b as Ft,T as Ht,a as Vt,n as lo}from"./integration-icon-DFSc5_D8.js";import{i as co}from"./AlertCircle-BppvLQSd.js";import{s as ao,M as Te}from"./monaco-editor-DZSx9WV6.js";import{i as uo}from"./Code01-7hV4ZDjZ.js";import{a as fo}from"./Copy01-C35WeFYE.js";import{i as Me}from"./Loading01-C2vqzEw-.js";import{i as Bt}from"./Play-Bm8SKfhZ.js";import{s as Ut}from"./XClose-CjpNuP8c.js";import{B as Pn,a as Ln,b as $e,d as Je,e as Ge,c as Dn}from"./breadcrumb-ChH6wfcA.js";import{u as mo,O as po,M as xo,F as ho,v as go}from"./index-D0nVkmnC.js";import{d as qt,b as Kt,a as Jt}from"./use-mcp-tools-DF65_5AL.js";import{E as Gt}from"./empty-state-CbIU_RrP.js";import{D as bo,a as jo}from"./use-binding-DMsO_03X.js";import{b as zn}from"./use-virtual-mcp-BUCuQhrG.js";import{b as vo,a as dn,R as yo}from"./resizable-fcBWjaSA.js";import{S as tt}from"./spinner-Lv2khbLw.js";import{V as So}from"./view-mode-toggle-4jMhv4Z3.js";import{N as wo,S as No,a as Co,c as ko,m as Ve,P as Io,b as _o,R as $o,d as To,e as Eo,f as un,E as Oo,g as Ro}from"./index-B_142IPp.js";import{b as Ao,c as Mo,d as Po,e as Lo,a as Do,D as zo}from"./dialog-BPL7ZvPc.js";import"./index--vZ0X2xS.js";import{s as Wn}from"./Plus-BMOTPGqH.js";import{n as Wo}from"./Calendar-DDieAsd2.js";import{i as Xt}from"./Check-bgVFNRDs.js";import{i as Fo}from"./DotsHorizontal-LbVwX-Tq.js";import{a as Ho}from"./Tool01-djk7g7Hv.js";import{D as Vo,a as Bo,b as Uo,c as fn}from"./dropdown-menu-BxLN4KkF.js";import{T as qo,R as Ko,e as Jo,f as Fn}from"./use-deco-chat-open-B2KYtTue.js";import{i as Go}from"./ChevronRight-DMzFQQCc.js";import{B as _e}from"./badge-DBw6AEaX.js";import{i as Hn}from"./X-CslJd5Ib.js";import"./useMutation-Bnsod7M-.js";import"./Pin01-uiXGtZsb.js";import"./use-organization-settings-CPNBbiln.js";import"./label-h0it3r-G.js";import"./index-B9-4goiW.js";import"./index-fVGDVKMq.js";import"./ChevronDown-DY4fpd0G.js";import"./infiniteQueryObserver-B8M15Jhm.js";import"./mcp-oauth-DQYLB8aB.js";import"./File06-888BgyfZ.js";import"./index-CnNzyZrg.js";import"./constants-1u4R2d-I.js";import"./registry-utils-yxVJe3X4.js";import"./extract-connection-data-wB5jtXsg.js";import"./github-icon-Dp3wHhYE.js";import"./generate-id-Dyweu44Y.js";import"./use-install-from-registry-BjKzt3Pz.js";import"./circle-alert-DHI8xRUj.js";import"./useQuery-Bo6lCSyK.js";import"./binder-Jddq1y1v.js";import"./popover-ESVk6nXT.js";import"./use-mcp-prompts-FoVTG9k7.js";import"./ArrowUp-D26ZQKRa.js";import"./Edit01-DDrpQJgk.js";import"./Users03-Bw7fWrTD.js";import"./Terminal-DRpoCIsG.js";import"./localstorage-keys-CrJngaoW.js";import"./SearchMd-BqVXNd65.js";import"./Trash01-d4v7i3Ze.js";import"./use-create-virtual-mcp-lh01_aoW.js";import"./use-llm-D28vq8-j.js";import"./Grid01-CfSiTcO8.js";import"./Image01-BUR65REQ.js";import"./RefreshCcw01-B1tus5Lj.js";const Vn=G("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 Bn=G("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 Zt=G("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const Qt=G("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const Xo=G("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Zo=G("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const Qo=G("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 Un=G("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 qn=G("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 Kn=G("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 Jn=G("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 Gn=G("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"}]]),Yt=({size:t=24,color:e="currentColor",...n})=>k.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},k.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"}));Yt.displayName="AlertOctagon";const Xn=({size:t=24,color:e="currentColor",...n})=>k.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},k.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"}));Xn.displayName="Box";const Zn=({size:t=24,color:e="currentColor",...n})=>k.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},k.createElement("path",{d:"m22.7 11.5-2 2-2-2m2.245 1.5A9 9 0 1 0 19 17.657M12 7v5l3 2"}));Zn.displayName="ClockFastForward";const Qn=({size:t=24,color:e="currentColor",...n})=>k.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},k.createElement("path",{d:"m17 17 5-5-5-5M7 7l-5 5 5 5m7-14-4 18"}));Qn.displayName="Code02";const Be=({size:t=24,color:e="currentColor",...n})=>k.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},k.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"}));Be.displayName="Columns01";const Yn=({size:t=24,color:e="currentColor",...n})=>k.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},k.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"}));Yn.displayName="CornerDownRight";const es=({size:t=24,color:e="currentColor",...n})=>k.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},k.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"}));es.displayName="Database01";const ts=({size:t=24,color:e="currentColor",...n})=>k.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},k.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"}));ts.displayName="GitBranch01";const ns=({size:t=24,color:e="currentColor",...n})=>k.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},k.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"}));ns.displayName="Repeat03";Hs({title:xt().min(1),description:xt().nullable(),body:xt()});function gt(t){for(const e of t.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Yo(){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 er(t){const e=C.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(ht,{control:n.control,name:"title",render:sr}),o.jsx(ht,{control:n.control,name:"description",render:nr})]})]}),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(ht,{control:n.control,name:"body",render:tr})]}),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 u;return e[10]!==n||e[11]!==a?(u=o.jsx(io,{...n,children:a}),e[10]=n,e[11]=a,e[12]=u):u=e[12],u}function tr(t){const{field:e}=t;return o.jsx(Pt,{children:o.jsx(Lt,{children:o.jsx(wt,{...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 nr(t){const{field:e}=t;return o.jsxs(Pt,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),o.jsx(Lt,{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 sr(t){const{field:e}=t;return o.jsxs(Pt,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),o.jsx(Lt,{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 or(t){const e=C.c(41),{providerId:n,promptId:s}=t,r=$t().location.href,{org:l}=X(),c=n||null;let a;e[0]!==l.id||e[1]!==c?(a={connectionId:c,orgId:l.id},e[0]=l.id,e[1]=c,e[2]=a):a=e[2];const u=Z(a),d=Rt(n,"PROMPT",s,u),f=At(n,"PROMPT",u),m=f.update.isPending;let x;e[3]!==d?(x=d?{title:d.title,description:d.description??null,body:gt(d)}:void 0,e[3]=d,e[4]=x):x=e[4];let p;e[5]!==x?(p={values:x},e[5]=x,e[6]=p):p=e[6];const h=Vs(p);let g;e[7]!==h||e[8]!==d?(g=()=>{d&&h.reset({title:d.title,description:d.description??null,body:gt(d)})},e[7]=h,e[8]=d,e[9]=g):g=e[9];const b=g;let j;e[10]!==f.update||e[11]!==h||e[12]!==s?(j=h.handleSubmit(async M=>{const L=await f.update.mutateAsync({id:s,data:{title:M.title,description:M.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:M.body}}]}});h.reset({title:L.title,description:L.description??null,body:gt(L)})}),e[10]=f.update,e[11]=h,e[12]=s,e[13]=j):j=e[13];const y=j;if(!d){let M;return e[14]===Symbol.for("react.memo_cache_sentinel")?(M=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(_n,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[14]=M):M=e[14],M}let S;e[15]!==d.title?(S=o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:d.title}),e[15]=d.title,e[16]=S):S=e[16];let v;e[17]!==d.description?(v=d.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:d.description})]}):null,e[17]=d.description,e[18]=v):v=e[18];let w;e[19]!==S||e[20]!==v?(w=o.jsx(En,{children:o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[S,v]})}),e[19]=S,e[20]=v,e[21]=w):w=e[21];let N;e[22]!==y?(N=()=>{y()},e[22]=y,e[23]=N):N=e[23];let _;e[24]!==h.formState.isDirty||e[25]!==m||e[26]!==b||e[27]!==N?(_=o.jsx(Tn,{onSave:N,onUndo:b,isDirty:h.formState.isDirty,isSaving:m}),e[24]=h.formState.isDirty,e[25]=m,e[26]=b,e[27]=N,e[28]=_):_=e[28];let I;e[29]!==d.title||e[30]!==r?(I=o.jsx(Mt,{title:d.title,url:r,icon:"description"}),e[29]=d.title,e[30]=r,e[31]=I):I=e[31];let E;e[32]!==_||e[33]!==I?(E=o.jsxs(zt,{children:[_,I]}),e[32]=_,e[33]=I,e[34]=E):E=e[34];let R;e[35]!==h?(R=o.jsx("div",{className:"h-full",children:o.jsx(er,{form:h})}),e[35]=h,e[36]=R):R=e[36];let P;return e[37]!==E||e[38]!==R||e[39]!==w?(P=o.jsxs(ce,{children:[w,E,R]}),e[37]=E,e[38]=R,e[39]=w,e[40]=P):P=e[40],P}function rr(t){const e=C.c(4),{itemId:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=Yo(),e[0]=s):s=e[0];const i=s;if(!i){let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(_n,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=l):l=e[1],l}let r;return e[2]!==n?(r=o.jsx($n,{children:o.jsx(k.Suspense,{fallback:null,children:o.jsx(or,{providerId:i,promptId:n})})}),e[2]=n,e[3]=r):r=e[3],r}const ir=Bs("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 lr(t){const e=C.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(ir({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 cr(t){const e=C.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 ar(t){const e=C.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 mn=t=>t.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function dr(t){const e=C.c(9),{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=mo(r);if(!l.isAuthenticated){let u;return e[2]!==l.supportsOAuth||e[3]!==i?(u=o.jsx("div",{className:"flex h-full items-center justify-center",children:l.supportsOAuth?o.jsx(po,{onAuthenticate:()=>i(),buttonText:"Go back to authenticate"}):o.jsx(xo,{hasReadme:!1})}),e[2]=l.supportsOAuth,e[3]=i,e[4]=u):u=e[4],u}const c=`${s}:${n}`;let a;return e[5]!==s||e[6]!==c||e[7]!==n?(a=o.jsx(ur,{toolName:n,connectionId:s},c),e[5]=s,e[6]=c,e[7]=n,e[8]=a):a=e[8],a}function ur({toolName:t,connectionId:e}){const s=$t().location.href,{replayId:i}=Us({strict:!1}),r=(()=>{if(!i)return null;const $=`replay-${i}`,T=sessionStorage.getItem($);if(!T)return null;sessionStorage.removeItem($);try{return JSON.parse(T)}catch{return null}})(),l=(()=>{if(!r)return null;const $={};for(const[T,A]of Object.entries(r))A!==null&&typeof A=="object"?$[T]=JSON.stringify(A,null,2):$[T]=A;return $})(),[c,a]=k.useState(l??{}),[u,d]=k.useState(r?JSON.stringify(r,null,2):"{}"),[f,m]=k.useState(null),[x,p]=k.useState(null),[h,g]=k.useState(!1),[b,j]=k.useState(null),{org:y}=X(),S=Ye(e),v=Z({connectionId:e,orgId:y.id}),w=qt({client:v}),N=w.data?.tools?.find($=>$.name===t),_=N?.inputSchema?.properties,I=_?Object.keys(_):[],E=I.length>0,R={};if(E&&N?.inputSchema?.properties)for(const $ of I)R[$]=N.inputSchema.required?.includes($)?"":void 0;const P=$=>Object.prototype.hasOwnProperty.call(c,$),M=async()=>{g(!0),p(null),m(null),j(null);const $=performance.now();try{if(!v)throw new Error("MCP client is not available");const T=E?{...R,...c}:(()=>{const V=u.trim();if(!V)return{};const J=JSON.parse(V);if(J&&typeof J=="object")return J;throw new Error("Raw JSON input must be an object.")})();E&&N?.inputSchema?.properties&&Object.entries(N.inputSchema.properties).forEach(([V,J])=>{if((J.type==="object"||J.type==="array")&&typeof T[V]=="string")try{T[V]=JSON.parse(T[V])}catch{}});const A=await v.callTool({name:t,arguments:T}),B=A.structuredContent??A,oe=performance.now(),Q=Math.round(oe-$);m(B);const se=JSON.stringify(B),K=new TextEncoder().encode(se).length;j({duration:`${Q}ms`,bytes:`${K} bytes`,tokens:`~${Math.ceil(K/4)} tokens`,cost:"$0.0000"})}catch(T){const A=T instanceof Error?T.message:String(T);p(A||"Unknown error occurred");const B=performance.now();j({duration:`${Math.round(B-$)}ms`})}finally{g(!1)}},L=($,T)=>{a(A=>({...A,[$]:T}))},D=()=>{m(null),p(null),j(null)},F=N?.name??mn(t),ee=o.jsx(Pn,{children:o.jsxs(Ln,{children:[o.jsx($e,{children:o.jsx(Je,{asChild:!0,children:o.jsx(qe,{to:"/$org/$project/mcps",params:{org:y.slug,project:Ke},children:"Connections"})})}),o.jsx(Ge,{}),S&&o.jsxs(o.Fragment,{children:[o.jsx($e,{children:o.jsx(Je,{asChild:!0,children:o.jsx(qe,{to:"/$org/$project/mcps/$connectionId",params:{org:y.slug,project:Ke,connectionId:e},search:{tab:"tools"},children:S.title})})}),o.jsx(Ge,{})]}),o.jsx($e,{children:o.jsx(Dn,{children:F})})]})});return o.jsxs(ce,{breadcrumb:ee,children:[o.jsx(zt,{children:o.jsx(Mt,{title:N?.name??mn(t),url:s,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(et,{icon:S?.icon||null,name:S?.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:[w.isSuccess?o.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):w.isLoading?o.jsx(Me,{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:w.isSuccess?"ready":w.isLoading?"connecting":"error"})]})]}),o.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:N?.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"}),N?.inputSchema?.required&&N.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:E&&N?.inputSchema?.properties?Object.entries(N.inputSchema.properties).map(([$,T])=>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:[$,N.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:T.type})]}),T.description&&o.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:T.description}),T.type==="object"||T.type==="array"?o.jsx(wt,{className:"font-mono text-xs",value:P($)?c[$]??"":R[$]??"",onChange:A=>L($,A.target.value),placeholder:`Enter ${$} as JSON...`,rows:3}):T.type==="boolean"?o.jsxs(On,{value:P($)?String(c[$]??""):"",onValueChange:A=>L($,A==="true"),children:[o.jsx(Rn,{children:o.jsx(An,{placeholder:"Select true or false..."})}),o.jsxs(Mn,{children:[o.jsx(Nt,{value:"true",children:"true"}),o.jsx(Nt,{value:"false",children:"false"})]})]}):o.jsx(Dt,{value:P($)?c[$]??"":R[$]??"",onChange:A=>L($,A.target.value),placeholder:`Enter ${$}...`})]},$)):N?.inputSchema&&!E?o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),o.jsx(wt,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:$=>d($.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"}),b&&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(ao,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(Xn,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(es,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&o.jsx("div",{className:"flex items-center gap-1.5",children:o.jsx("span",{className:"font-mono text-foreground",children:b.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(U,{size:"sm",variant:"default",className:"h-8 gap-2 flex-1 lg:flex-none",onClick:M,disabled:h,children:h?o.jsxs(o.Fragment,{children:[o.jsx(Me,{size:14,className:"animate-spin"}),"Executing..."]}):o.jsxs(o.Fragment,{children:[o.jsx(Bt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})}),o.jsx(Wt,{children:o.jsxs(Ft,{children:[o.jsx(Ht,{asChild:!0,children:o.jsx(U,{size:"icon",variant:"outline",className:"h-8 w-8 shrink-0",onClick:D,disabled:!f&&!x,children:o.jsx(Ut,{size:14})})}),o.jsx(Vt,{children:o.jsx("p",{children:"Clear results"})})]})})]})}),x&&o.jsx("div",{className:"px-6 py-4 bg-background",children:o.jsx(lr,{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(co,{className:"h-4 w-4"}),o.jsx(cr,{className:"mb-0",children:"Execution Failed"})]}),o.jsx(ar,{className:"text-xs text-destructive",children:x})]})})}),o.jsx("div",{className:"relative flex-1 overflow-auto bg-muted/50",children:f?o.jsxs(o.Fragment,{children:[o.jsx(Te,{code:JSON.stringify(f,null,2),language:"json",height:"100%",readOnly:!0}),o.jsx(U,{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(f,null,2)),Sn.success("Copied to clipboard")},children:o.jsx(fo,{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(uo,{className:"h-12 w-12 mb-3 opacity-40"}),o.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]})]})]})}function fr(t){const e=C.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=re(i).connectionId;if(!Ye(l)||!l){let d;return e[1]===Symbol.for("react.memo_cache_sentinel")?(d=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]=d):d=e[1],d}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(Me,{size:32,className:"animate-spin text-muted-foreground"})}),e[2]=a):a=e[2];let u;return e[3]!==l||e[4]!==s||e[5]!==n?(u=o.jsx(k.Suspense,{fallback:a,children:o.jsx(dr,{toolName:n,connectionId:l,onBack:s})}),e[3]=l,e[4]=s,e[5]=n,e[6]=u):u=e[6],u}const pn=t=>{let e;const n=new Set,s=(u,d)=>{const f=typeof u=="function"?u(e):u;if(!Object.is(f,e)){const m=e;e=d??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(x=>x(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:u=>(n.add(u),()=>n.delete(u))},a=e=t(s,i,c);return c},en=(t=>t?pn(t):pn),mr=t=>t;function Ct(t,e=mr){const n=W.useSyncExternalStore(t.subscribe,W.useCallback(()=>e(t.getState()),[t,e]),W.useCallback(()=>e(t.getInitialState()),[t,e]));return W.useDebugValue(n),n}const pr=t=>{const e=en(t),n=s=>Ct(e,s);return Object.assign(n,e),n},xr=(t=>pr);function ss(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 kt=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return kt(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return kt(s)(n)}}}},hr=(t,e)=>(n,s,i)=>{let r={storage:ss(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,u=new Set;let d=r.storage;if(!d)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 d.setItem(r.name,{state:g,version:r.version})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const x=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>x;let p;const h=()=>{var g,b;if(!d)return;const j=++c;l=!1,a.forEach(S=>{var v;return S((v=s())!=null?v:x)});const y=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:x))||void 0;return kt(d.getItem.bind(d))(r.name).then(S=>{if(S)if(typeof S.version=="number"&&S.version!==r.version){if(r.migrate){const v=r.migrate(S.state,S.version);return v instanceof Promise?v.then(w=>[!0,w]):[!0,v]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,S.state];return[!1,void 0]}).then(S=>{var v;if(j!==c)return;const[w,N]=S;if(p=r.merge(N,(v=s())!=null?v:x),n(p,!0),w)return f()}).then(()=>{j===c&&(y?.(p,void 0),p=s(),l=!0,u.forEach(S=>S(p)))}).catch(S=>{j===c&&y?.(void 0,S)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(d=g.storage)},clearStorage:()=>{d?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(u.add(g),()=>{u.delete(g)})},r.skipHydration||h(),p||x},os=hr,{useSyncExternalStoreWithSelector:gr}=qs,br=t=>t;function jr(t,e=br,n){const s=gr(t.subscribe,t.getState,t.getInitialState,e,n);return W.useDebugValue(s),s}const xn=t=>Symbol.iterator in t,hn=t=>"entries"in t,gn=(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},vr=(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 yr(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:xn(t)&&xn(e)?hn(t)&&hn(e)?gn(t,e):vr(t,e):gn({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Sr(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(([u,d])=>{const f=c.has(u)?"":"?";return`${d.description?` /** ${d.description} */
|
|
3
3
|
`:""} ${u}${f}: ${n(d)};`}).join(`
|
|
4
4
|
`)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as v,j as i}from"./index-
|
|
1
|
+
import{c as v,j as i}from"./index-BKpxPW_G.js";import{i as w}from"./Loading01-C2vqzEw-.js";import{i as C}from"./SearchMd-BqVXNd65.js";import{I as k}from"./input-lpAGMNlp.js";import{c as b}from"./utils-Ckp7rFN8.js";function R(j){const e=v.c(21),{value:m,onChange:d,placeholder:g,onKeyDown:f,className:p,isSearching:u,disabled:n}=j,x=g===void 0?"Search...":g;let t;e[0]!==p?(t=b("shrink-0 w-full border-b border-border h-12",p),e[0]=p,e[1]=t):t=e[1];const h=n?"cursor-not-allowed opacity-50":"cursor-text";let s;e[2]!==h?(s=b("flex items-center gap-2.5 h-12 px-4",h),e[2]=h,e[3]=s):s=e[3];let r;e[4]!==u?(r=u?i.jsx(w,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):i.jsx(C,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=u,e[5]=r):r=e[5];let o;e[6]!==d?(o=N=>d(N.target.value),e[6]=d,e[7]=o):o=e[7];let l;e[8]!==n||e[9]!==f||e[10]!==x||e[11]!==o||e[12]!==m?(l=i.jsx(k,{value:m,onChange:o,onKeyDown:f,placeholder:x,disabled:n,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[8]=n,e[9]=f,e[10]=x,e[11]=o,e[12]=m,e[13]=l):l=e[13];let a;e[14]!==s||e[15]!==r||e[16]!==l?(a=i.jsxs("label",{className:s,children:[r,l]}),e[14]=s,e[15]=r,e[16]=l,e[17]=a):a=e[17];let c;return e[18]!==t||e[19]!==a?(c=i.jsx("div",{className:t,children:a}),e[18]=t,e[19]=a,e[20]=c):c=e[20],c}export{R as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as Ae,j as t,m as Ye,g as Ze,u as et,r as tt,O as $e,t as st}from"./index-HxeE9C0A.js";import{g as Oe}from"./generate-id-Dyweu44Y.js";import{a as ot,C as Fe}from"./collection-table-wrapper-B6XWzQ-4.js";import{C as it}from"./collection-search-D3a5_1zR.js";import{C as nt}from"./card-DKzkS6ji.js";import{I as ke}from"./integration-icon-CmJggqPx.js";import{D as Ke,a as Ue,b as Le,c as k}from"./dropdown-menu-D6YYwFq7.js";import{B as Ie}from"./button-C1iesapY.js";import{a as Be}from"./Copy01-BJPi2nBZ.js";import{i as Re}from"./DotsVertical-CPJps54j.js";import{i as Ve}from"./Edit01-CLT1AKyh.js";import{s as Ge,U as rt,u as lt}from"./use-list-state-CqdwrHCA.js";import{s as Je}from"./Trash01-py7ft8Od.js";import{E as ze}from"./empty-state-BQPtoYZe.js";import{n as Ee}from"./Inbox01-Bz-1SNbb.js";import{E as at}from"./empty-state-CH3e4Xzf.js";import{B as ct}from"./constants-gwxE8_b0.js";import{A as dt,g as pt,c as mt,b as ut,d as ft,e as ht,a as xt,f as gt}from"./alert-dialog-B1nWkQHx.js";import{u as jt,e as Ct}from"./use-connection-DWpxH8iy.js";import{u as vt}from"./constants-BEco_-y7.js";import{s as bt}from"./Plus-BVPnBK8D.js";import{V as yt}from"./layout-BQSZy0Ao.js";function Nt(n,e){const s=n.properties||{};for(const i in s){const l=s[i];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&i in e&&e[i])return e[i]}const r=["image","img","avatar","icon","logo","thumbnail","cover"];for(const i of r)if(e&&typeof e=="object"&&i in e&&typeof e[i]=="string")return e[i]}function wt(n){const e=Ae.c(25),{item:s,schema:r,actions:i}=n;let l;e[0]!==s||e[1]!==r?(l=Nt(r,s),e[0]=s,e[1]=r,e[2]=l):l=e[2];const u=l,p=s&&typeof s=="object"&&"description"in s&&typeof s.description=="string"?s.description:void 0;let j;e[3]!==i?(j=i&&Object.keys(i).length>0,e[3]=i,e[4]=j):j=e[4];const o=j;let m;e[5]!==u||e[6]!==s.title?(m=t.jsx(ke,{icon:u,name:s.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=u,e[6]=s.title,e[7]=m):m=e[7];let f;e[8]!==s.title?(f=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=f):f=e[9];const d=p||"No description";let c;e[10]!==d?(c=t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:d}),e[10]=d,e[11]=c):c=e[11];let C;e[12]!==f||e[13]!==c?(C=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[f,c]}),e[12]=f,e[13]=c,e[14]=C):C=e[14];let y;e[15]!==m||e[16]!==C?(y=t.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[m,C]}),e[15]=m,e[16]=C,e[17]=y):y=e[17];let a;e[18]!==i||e[19]!==o||e[20]!==s?(a=o&&t.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:At,onMouseDown:_t,children:t.jsxs(Ke,{children:[t.jsx(Ue,{asChild:!0,children:t.jsx(Ie,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Dt,children:t.jsx(Re,{size:20})})}),t.jsxs(Le,{align:"end",onClick:St,children:[i.open&&t.jsxs(k,{onClick:h=>{h.stopPropagation(),i.open?.(s)},children:[t.jsx(Ge,{size:16}),"Open"]}),i.edit&&t.jsxs(k,{onClick:h=>{h.stopPropagation(),i.edit?.(s)},children:[t.jsx(Ve,{size:16}),"Edit"]}),i.duplicate&&t.jsxs(k,{onClick:h=>{h.stopPropagation(),i.duplicate?.(s)},children:[t.jsx(Be,{size:16}),"Duplicate"]}),i.delete&&t.jsxs(k,{variant:"destructive",onClick:h=>{h.stopPropagation(),i.delete?.(s)},children:[t.jsx(Je,{size:16}),"Delete"]})]})]})}),e[18]=i,e[19]=o,e[20]=s,e[21]=a):a=e[21];let S;return e[22]!==y||e[23]!==a?(S=t.jsxs(nt,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[y,a]}),e[22]=y,e[23]=a,e[24]=S):S=e[24],S}function St(n){return n.stopPropagation()}function Dt(n){return n.stopPropagation()}function _t(n){return n.stopPropagation()}function At(n){return n.stopPropagation()}const It=["icon","avatar","logo"],Me=["created_at","created_by","id"];function Pt(n){return Object.keys(n).find(e=>It.includes(e.toLowerCase()))}function We(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 Tt(n){const e=Ae.c(32),{data:s,schema:r,viewMode:i,onViewModeChange:l,search:u,sortKey:p,sortDirection:j,onSort:o,actions:m,onItemClick:f,headerActions:d,emptyState:c,readOnly:C,columns:y,hideToolbar:a,sortableFields:S}=n,h=l===void 0?Mt:l,x=j===void 0?"asc":j,P=o===void 0?Et:o;let v;e[0]!==m?(v=m===void 0?{}:m,e[0]=m,e[1]=v):v=e[1];const D=v,_=f===void 0?zt:f,z=d===void 0?null:d,b=c===void 0?null:c,T=C===void 0?!1:C,N=y===void 0?void 0:y,F=a===void 0?!1:a,w=S===void 0?void 0:S;let E;e[2]!==N||e[3]!==r||e[4]!==w?(E=N?N.filter(Ot).filter(M=>!w||w.includes(M.id)).map($t):We(r,w),e[2]=N,e[3]=r,e[4]=w,e[5]=E):E=e[5];const $=E;let A;e[6]!==z||e[7]!==F||e[8]!==P||e[9]!==h||e[10]!==x||e[11]!==p||e[12]!==$||e[13]!==i?(A=!F&&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:z}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(Fe,{viewMode:i,onViewModeChange:h,sortKey:p,sortDirection:x,onSort:P,sortOptions:$})})]})}),e[6]=z,e[7]=F,e[8]=P,e[9]=h,e[10]=x,e[11]=p,e[12]=$,e[13]=i,e[14]=A):A=e[14];let O;e[15]!==D||e[16]!==N||e[17]!==s||e[18]!==b||e[19]!==_||e[20]!==P||e[21]!==T||e[22]!==r||e[23]!==u||e[24]!==x||e[25]!==p||e[26]!==w||e[27]!==i?(O=i==="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:b||t.jsx(ze,{icon:t.jsx(Ee,{size:36,className:"text-muted-foreground"}),title:"No items found",description:u?"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(M=>t.jsx("div",{onClick:()=>_?.(M),className:"cursor-pointer h-full",children:t.jsx(wt,{item:M,schema:r,readOnly:T,actions:D})},M.id))})}):t.jsx(ot,{columns:Kt(N,r,w,D),data:s,sortKey:p,sortDirection:x,onSort:P,onRowClick:_,emptyState:b||t.jsx(ze,{icon:t.jsx(Ee,{size:36,className:"text-muted-foreground"}),title:"No items found",description:u?"Try adjusting your search":"No items to display"})}),e[15]=D,e[16]=N,e[17]=s,e[18]=b,e[19]=_,e[20]=P,e[21]=T,e[22]=r,e[23]=u,e[24]=x,e[25]=p,e[26]=w,e[27]=i,e[28]=O):O=e[28];let I;return e[29]!==A||e[30]!==O?(I=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[A,O]}),e[29]=A,e[30]=O,e[31]=I):I=e[31],I}function $t(n){return{id:n.id,label:typeof n.header=="string"?n.header:n.id}}function Ot(n){return n.sortable!==!1}function zt(){}function Et(){}function Mt(){}function Ft(n){return{id:"actions",header:"",render:e=>t.jsxs(Ke,{children:[t.jsx(Ue,{asChild:!0,children:t.jsx(Ie,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:t.jsx(Re,{size:20})})}),t.jsxs(Le,{align:"end",onClick:s=>s.stopPropagation(),children:[n.open&&t.jsxs(k,{onClick:s=>{s.stopPropagation(),n.open?.(e)},children:[t.jsx(Ge,{size:16}),"Open"]}),n.edit&&t.jsxs(k,{onClick:s=>{s.stopPropagation(),n.edit?.(e)},children:[t.jsx(Ve,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(k,{onClick:s=>{s.stopPropagation(),n.duplicate?.(e)},children:[t.jsx(Be,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(k,{variant:"destructive",onClick:s=>{s.stopPropagation(),n.delete?.(e)},children:[t.jsx(Je,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function He(n){const e=n.type;return Array.isArray(e)?e.every(s=>He({type:s})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function kt(n,e){const s=n.properties||{},r=Object.keys(s).filter(o=>{const m=s[o];return m&&He(m)}),i=Pt(s),l=[],u=new Set;i&&r.includes(i)&&(l.push(i),u.add(i));const p=["title","description","updated_at","updated_by"];for(const o of p)r.includes(o)&&!u.has(o)&&(l.push(o),u.add(o));const j=r.filter(o=>!u.has(o)&&!Me.includes(o)).sort((o,m)=>o.localeCompare(m));for(const o of j)l.push(o),u.add(o);for(const o of Me)r.includes(o)&&!u.has(o)&&(l.push(o),u.add(o));return l.map(o=>{const m=s[o],f=e?e.includes(o):!["id"].includes(o);return o===i?{id:o,header:"",render:d=>{const c=d[o];return t.jsx(ke,{icon:c,name:d.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:o==="description"?{id:o,header:"Description",render:d=>{const c=d[o];return c==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(c)})},sortable:f,cellClassName:"max-w-[50ch]"}:o==="created_by"||o==="updated_by"?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:d=>{const c=d[o];return c?t.jsx(rt,{id:String(c),size:"xs"}):"—"},sortable:f,cellClassName:"max-w-[250px]"}:m?.format==="date-time"||o.endsWith("_at")?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:d=>{const c=d[o];return c?t.jsx("span",{className:"block truncate max-w-full",children:new Date(c).toLocaleDateString()}):"—"},sortable:f,cellClassName:"max-w-[200px]"}:{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:d=>{const c=d[o];return c==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(c)})},sortable:f,cellClassName:"max-w-[200px]"}})}function Kt(n,e,s,r){const i=n||kt(e,s);return i.some(p=>p.id==="actions")?i:Object.keys(r).length>0?[...i,Ft(r)]:i}function cs(n){const e=Ae.c(113),{connectionId:s,org:r,activeCollection:i}=n,l=i.name,u=i.schema??ct,p=i.hasCreateTool,j=i.hasUpdateTool,o=i.hasDeleteTool,m=Ye(),{data:f}=Ze.useSession(),d=f?.user?.id||"unknown",{org:c}=et();let C;e[0]!==s||e[1]!==c.id?(C={connectionId:s,orgId:c.id},e[0]=s,e[1]=c.id,e[2]=C):C=e[2];const y=vt(C),a=jt(s,l,y),S=`${s}-${l}`;let h;e[3]!==r||e[4]!==S?(h={namespace:r,resource:S,defaultSortKey:"updated_at"},e[3]=r,e[4]=S,e[5]=h):h=e[5];const{search:x,searchTerm:P,setSearch:v,viewMode:D,setViewMode:_,sortKey:z,sortDirection:b,handleSort:T}=lt(h);let N;e[6]!==P||e[7]!==b||e[8]!==z?(N={searchTerm:P,sortKey:z,sortDirection:b},e[6]=P,e[7]=b,e[8]=z,e[9]=N):N=e[9];const F=Ct(s,l,y,N),w=!p&&!j&&!o;let E;e[10]!==l||e[11]!==s||e[12]!==m||e[13]!==r?(E=g=>{m({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:r,project:$e,connectionId:s,collectionName:l,itemId:g.id}})},e[10]=l,e[11]=s,e[12]=m,e[13]=r,e[14]=E):E=e[14];const $=E;let A;e[15]!==a.create||e[16]!==d?(A=async g=>{const me=new Date().toISOString();await a.create.mutateAsync({...g,id:Oe("conn"),title:`${g.title} (Copy)`,created_at:me,updated_at:me,created_by:d,updated_by:d})},e[15]=a.create,e[16]=d,e[17]=A):A=e[17];const O=A,[I,M]=tt.useState(null);let oe;e[18]===Symbol.for("react.memo_cache_sentinel")?(oe=g=>{M(g)},e[18]=oe):oe=e[18];const qe=oe;let K;e[19]!==$||e[20]!==j?(K=j&&{edit:$},e[19]=$,e[20]=j,e[21]=K):K=e[21];let U;e[22]!==O||e[23]!==p?(U=p&&{duplicate:O},e[22]=O,e[23]=p,e[24]=U):U=e[24];let L;e[25]!==o?(L=o&&{delete:qe},e[25]=o,e[26]=L):L=e[26];let ie;e[27]!==L||e[28]!==K||e[29]!==U?(ie={...K,...U,...L},e[27]=L,e[28]=K,e[29]=U,e[30]=ie):ie=e[30];const ue=ie;let ne;e[31]!==a.delete||e[32]!==I?(ne=async()=>{I&&(await a.delete.mutateAsync(I.id),M(null))},e[31]=a.delete,e[32]=I,e[33]=ne):ne=e[33];const fe=ne;let re;e[34]!==a.create||e[35]!==l||e[36]!==s||e[37]!==p||e[38]!==m||e[39]!==r||e[40]!==d?(re=async()=>{if(!p){st.error("Create operation is not available for this collection");return}const g=new Date().toISOString(),me={id:Oe("conn"),title:"New Item",description:"A brief description of the item",created_at:g,updated_at:g,created_by:d,updated_by:d};try{const _e=await a.create.mutateAsync(me);m({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:r,project:$e,connectionId:s,collectionName:l,itemId:_e.id}})}catch(_e){console.error("Failed to create item:",_e)}},e[34]=a.create,e[35]=l,e[36]=s,e[37]=p,e[38]=m,e[39]=r,e[40]=d,e[41]=re):re=e[41];const he=re;let le;e[42]!==u?(le=We(u),e[42]=u,e[43]=le):le=e[43];const xe=le,Pe=(F?.length??0)>0,Qe=p&&Pe,Xe=p&&!Pe&&!x;let ae;e[44]!==a.create||e[45]!==he||e[46]!==p?(ae=p?t.jsxs(Ie,{onClick:he,size:"sm",disabled:a.create.isPending,className:"h-7",children:[t.jsx(bt,{className:"mr-2 h-4 w-4"}),a.create.isPending?"Creating...":"Create"]}):null,e[44]=a.create,e[45]=he,e[46]=p,e[47]=ae):ae=e[47];const Te=ae,ge=z;let B;e[48]!==T||e[49]!==_||e[50]!==b||e[51]!==xe||e[52]!==ge||e[53]!==D?(B=t.jsx(Fe,{viewMode:D,onViewModeChange:_,sortKey:ge,sortDirection:b,onSort:T,sortOptions:xe}),e[48]=T,e[49]=_,e[50]=b,e[51]=xe,e[52]=ge,e[53]=D,e[54]=B):B=e[54];const je=Qe&&Te;let R;e[55]!==B||e[56]!==je?(R=t.jsxs(yt,{children:[B,je]}),e[55]=B,e[56]=je,e[57]=R):R=e[57];const Ce=`Search ${l}...`;let V;e[58]!==v?(V=g=>{g.key==="Escape"&&(v(""),g.target.blur())},e[58]=v,e[59]=V):V=e[59];let G;e[60]!==x||e[61]!==v||e[62]!==Ce||e[63]!==V?(G=t.jsx(it,{value:x,onChange:v,placeholder:Ce,onKeyDown:V}),e[60]=x,e[61]=v,e[62]=Ce,e[63]=V,e[64]=G):G=e[64];let J;e[65]!==F?(J=F??[],e[65]=F,e[66]=J):J=e[66];const ve=z;let W;e[67]!==$?(W=g=>$(g),e[67]=$,e[68]=W):W=e[68];const be="No items found",ye=x?"Try adjusting your search terms":"This collection doesn't have any items yet.",Ne=Xe?Te:void 0;let H;e[69]!==be||e[70]!==ye||e[71]!==Ne?(H=t.jsx(at,{image:null,title:be,description:ye,actions:Ne}),e[69]=be,e[70]=ye,e[71]=Ne,e[72]=H):H=e[72];let q;e[73]!==T||e[74]!==w||e[75]!==ue||e[76]!==u||e[77]!==x||e[78]!==v||e[79]!==_||e[80]!==b||e[81]!==J||e[82]!==ve||e[83]!==W||e[84]!==H||e[85]!==D?(q=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(Tt,{hideToolbar:!0,data:J,schema:u,viewMode:D,onViewModeChange:_,search:x,onSearchChange:v,sortKey:ve,sortDirection:b,onSort:T,actions:ue,onItemClick:W,readOnly:w,emptyState:H})}),e[73]=T,e[74]=w,e[75]=ue,e[76]=u,e[77]=x,e[78]=v,e[79]=_,e[80]=b,e[81]=J,e[82]=ve,e[83]=W,e[84]=H,e[85]=D,e[86]=q):q=e[86];let Q;e[87]!==G||e[88]!==q?(Q=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[G,q]}),e[87]=G,e[88]=q,e[89]=Q):Q=e[89];const we=!!I;let ce;e[90]===Symbol.for("react.memo_cache_sentinel")?(ce=g=>{g||M(null)},e[90]=ce):ce=e[90];let de;e[91]===Symbol.for("react.memo_cache_sentinel")?(de=t.jsx(mt,{children:"Delete item?"}),e[91]=de):de=e[91];const Se=I?.title;let X;e[92]!==Se?(X=t.jsxs(ut,{children:[de,t.jsxs(ft,{children:['Are you sure you want to delete "',Se,'"? This action cannot be undone.']})]}),e[92]=Se,e[93]=X):X=e[93];let Y;e[94]!==a.delete.isPending?(Y=t.jsx(dt,{disabled:a.delete.isPending,children:"Cancel"}),e[94]=a.delete.isPending,e[95]=Y):Y=e[95];const De=a.delete.isPending?"Deleting...":"Delete";let Z;e[96]!==a.delete.isPending||e[97]!==fe||e[98]!==De?(Z=t.jsx(pt,{onClick:fe,disabled:a.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:De}),e[96]=a.delete.isPending,e[97]=fe,e[98]=De,e[99]=Z):Z=e[99];let ee;e[100]!==Y||e[101]!==Z?(ee=t.jsxs(ht,{children:[Y,Z]}),e[100]=Y,e[101]=Z,e[102]=ee):ee=e[102];let te;e[103]!==X||e[104]!==ee?(te=t.jsxs(xt,{children:[X,ee]}),e[103]=X,e[104]=ee,e[105]=te):te=e[105];let se;e[106]!==we||e[107]!==te?(se=t.jsx(gt,{open:we,onOpenChange:ce,children:te}),e[106]=we,e[107]=te,e[108]=se):se=e[108];let pe;return e[109]!==R||e[110]!==Q||e[111]!==se?(pe=t.jsxs(t.Fragment,{children:[R,Q,se]}),e[109]=R,e[110]=Q,e[111]=se,e[112]=pe):pe=e[112],pe}export{cs as C};
|
|
1
|
+
import{c as Ae,j as t,m as Ye,g as Ze,u as et,r as tt,O as $e,t as st}from"./index-BKpxPW_G.js";import{g as Oe}from"./generate-id-Dyweu44Y.js";import{a as ot,C as Fe}from"./collection-table-wrapper-DFTdnQhc.js";import{C as it}from"./collection-search-Bkd4qN8a.js";import{C as nt}from"./card-DAZxrY9k.js";import{I as ke}from"./integration-icon-DFSc5_D8.js";import{D as Ke,a as Ue,b as Le,c as k}from"./dropdown-menu-BxLN4KkF.js";import{B as Ie}from"./button-D_OpQIQm.js";import{a as Be}from"./Copy01-C35WeFYE.js";import{i as Re}from"./DotsVertical-BNqPYTki.js";import{i as Ve}from"./Edit01-DDrpQJgk.js";import{s as Ge,U as rt,u as lt}from"./use-list-state-DNfSCsX5.js";import{s as Je}from"./Trash01-d4v7i3Ze.js";import{E as ze}from"./empty-state-CbIU_RrP.js";import{n as Ee}from"./Inbox01-Bhe6QhSW.js";import{E as at}from"./empty-state-DXJM9xrV.js";import{B as ct}from"./constants-1u4R2d-I.js";import{A as dt,g as pt,c as mt,b as ut,d as ft,e as ht,a as xt,f as gt}from"./alert-dialog-DRso9X1m.js";import{u as jt,e as Ct}from"./use-connection-B0740Saa.js";import{u as vt}from"./constants-DisdEZ3l.js";import{s as bt}from"./Plus-BMOTPGqH.js";import{V as yt}from"./layout-DaBTH10o.js";function Nt(n,e){const s=n.properties||{};for(const i in s){const l=s[i];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&i in e&&e[i])return e[i]}const r=["image","img","avatar","icon","logo","thumbnail","cover"];for(const i of r)if(e&&typeof e=="object"&&i in e&&typeof e[i]=="string")return e[i]}function wt(n){const e=Ae.c(25),{item:s,schema:r,actions:i}=n;let l;e[0]!==s||e[1]!==r?(l=Nt(r,s),e[0]=s,e[1]=r,e[2]=l):l=e[2];const u=l,p=s&&typeof s=="object"&&"description"in s&&typeof s.description=="string"?s.description:void 0;let j;e[3]!==i?(j=i&&Object.keys(i).length>0,e[3]=i,e[4]=j):j=e[4];const o=j;let m;e[5]!==u||e[6]!==s.title?(m=t.jsx(ke,{icon:u,name:s.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=u,e[6]=s.title,e[7]=m):m=e[7];let f;e[8]!==s.title?(f=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=f):f=e[9];const d=p||"No description";let c;e[10]!==d?(c=t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:d}),e[10]=d,e[11]=c):c=e[11];let C;e[12]!==f||e[13]!==c?(C=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[f,c]}),e[12]=f,e[13]=c,e[14]=C):C=e[14];let y;e[15]!==m||e[16]!==C?(y=t.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[m,C]}),e[15]=m,e[16]=C,e[17]=y):y=e[17];let a;e[18]!==i||e[19]!==o||e[20]!==s?(a=o&&t.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:At,onMouseDown:_t,children:t.jsxs(Ke,{children:[t.jsx(Ue,{asChild:!0,children:t.jsx(Ie,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Dt,children:t.jsx(Re,{size:20})})}),t.jsxs(Le,{align:"end",onClick:St,children:[i.open&&t.jsxs(k,{onClick:h=>{h.stopPropagation(),i.open?.(s)},children:[t.jsx(Ge,{size:16}),"Open"]}),i.edit&&t.jsxs(k,{onClick:h=>{h.stopPropagation(),i.edit?.(s)},children:[t.jsx(Ve,{size:16}),"Edit"]}),i.duplicate&&t.jsxs(k,{onClick:h=>{h.stopPropagation(),i.duplicate?.(s)},children:[t.jsx(Be,{size:16}),"Duplicate"]}),i.delete&&t.jsxs(k,{variant:"destructive",onClick:h=>{h.stopPropagation(),i.delete?.(s)},children:[t.jsx(Je,{size:16}),"Delete"]})]})]})}),e[18]=i,e[19]=o,e[20]=s,e[21]=a):a=e[21];let S;return e[22]!==y||e[23]!==a?(S=t.jsxs(nt,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[y,a]}),e[22]=y,e[23]=a,e[24]=S):S=e[24],S}function St(n){return n.stopPropagation()}function Dt(n){return n.stopPropagation()}function _t(n){return n.stopPropagation()}function At(n){return n.stopPropagation()}const It=["icon","avatar","logo"],Me=["created_at","created_by","id"];function Pt(n){return Object.keys(n).find(e=>It.includes(e.toLowerCase()))}function We(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 Tt(n){const e=Ae.c(32),{data:s,schema:r,viewMode:i,onViewModeChange:l,search:u,sortKey:p,sortDirection:j,onSort:o,actions:m,onItemClick:f,headerActions:d,emptyState:c,readOnly:C,columns:y,hideToolbar:a,sortableFields:S}=n,h=l===void 0?Mt:l,x=j===void 0?"asc":j,P=o===void 0?Et:o;let v;e[0]!==m?(v=m===void 0?{}:m,e[0]=m,e[1]=v):v=e[1];const D=v,_=f===void 0?zt:f,z=d===void 0?null:d,b=c===void 0?null:c,T=C===void 0?!1:C,N=y===void 0?void 0:y,F=a===void 0?!1:a,w=S===void 0?void 0:S;let E;e[2]!==N||e[3]!==r||e[4]!==w?(E=N?N.filter(Ot).filter(M=>!w||w.includes(M.id)).map($t):We(r,w),e[2]=N,e[3]=r,e[4]=w,e[5]=E):E=e[5];const $=E;let A;e[6]!==z||e[7]!==F||e[8]!==P||e[9]!==h||e[10]!==x||e[11]!==p||e[12]!==$||e[13]!==i?(A=!F&&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:z}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(Fe,{viewMode:i,onViewModeChange:h,sortKey:p,sortDirection:x,onSort:P,sortOptions:$})})]})}),e[6]=z,e[7]=F,e[8]=P,e[9]=h,e[10]=x,e[11]=p,e[12]=$,e[13]=i,e[14]=A):A=e[14];let O;e[15]!==D||e[16]!==N||e[17]!==s||e[18]!==b||e[19]!==_||e[20]!==P||e[21]!==T||e[22]!==r||e[23]!==u||e[24]!==x||e[25]!==p||e[26]!==w||e[27]!==i?(O=i==="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:b||t.jsx(ze,{icon:t.jsx(Ee,{size:36,className:"text-muted-foreground"}),title:"No items found",description:u?"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(M=>t.jsx("div",{onClick:()=>_?.(M),className:"cursor-pointer h-full",children:t.jsx(wt,{item:M,schema:r,readOnly:T,actions:D})},M.id))})}):t.jsx(ot,{columns:Kt(N,r,w,D),data:s,sortKey:p,sortDirection:x,onSort:P,onRowClick:_,emptyState:b||t.jsx(ze,{icon:t.jsx(Ee,{size:36,className:"text-muted-foreground"}),title:"No items found",description:u?"Try adjusting your search":"No items to display"})}),e[15]=D,e[16]=N,e[17]=s,e[18]=b,e[19]=_,e[20]=P,e[21]=T,e[22]=r,e[23]=u,e[24]=x,e[25]=p,e[26]=w,e[27]=i,e[28]=O):O=e[28];let I;return e[29]!==A||e[30]!==O?(I=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[A,O]}),e[29]=A,e[30]=O,e[31]=I):I=e[31],I}function $t(n){return{id:n.id,label:typeof n.header=="string"?n.header:n.id}}function Ot(n){return n.sortable!==!1}function zt(){}function Et(){}function Mt(){}function Ft(n){return{id:"actions",header:"",render:e=>t.jsxs(Ke,{children:[t.jsx(Ue,{asChild:!0,children:t.jsx(Ie,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:t.jsx(Re,{size:20})})}),t.jsxs(Le,{align:"end",onClick:s=>s.stopPropagation(),children:[n.open&&t.jsxs(k,{onClick:s=>{s.stopPropagation(),n.open?.(e)},children:[t.jsx(Ge,{size:16}),"Open"]}),n.edit&&t.jsxs(k,{onClick:s=>{s.stopPropagation(),n.edit?.(e)},children:[t.jsx(Ve,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(k,{onClick:s=>{s.stopPropagation(),n.duplicate?.(e)},children:[t.jsx(Be,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(k,{variant:"destructive",onClick:s=>{s.stopPropagation(),n.delete?.(e)},children:[t.jsx(Je,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function He(n){const e=n.type;return Array.isArray(e)?e.every(s=>He({type:s})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function kt(n,e){const s=n.properties||{},r=Object.keys(s).filter(o=>{const m=s[o];return m&&He(m)}),i=Pt(s),l=[],u=new Set;i&&r.includes(i)&&(l.push(i),u.add(i));const p=["title","description","updated_at","updated_by"];for(const o of p)r.includes(o)&&!u.has(o)&&(l.push(o),u.add(o));const j=r.filter(o=>!u.has(o)&&!Me.includes(o)).sort((o,m)=>o.localeCompare(m));for(const o of j)l.push(o),u.add(o);for(const o of Me)r.includes(o)&&!u.has(o)&&(l.push(o),u.add(o));return l.map(o=>{const m=s[o],f=e?e.includes(o):!["id"].includes(o);return o===i?{id:o,header:"",render:d=>{const c=d[o];return t.jsx(ke,{icon:c,name:d.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:o==="description"?{id:o,header:"Description",render:d=>{const c=d[o];return c==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(c)})},sortable:f,cellClassName:"max-w-[50ch]"}:o==="created_by"||o==="updated_by"?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:d=>{const c=d[o];return c?t.jsx(rt,{id:String(c),size:"xs"}):"—"},sortable:f,cellClassName:"max-w-[250px]"}:m?.format==="date-time"||o.endsWith("_at")?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:d=>{const c=d[o];return c?t.jsx("span",{className:"block truncate max-w-full",children:new Date(c).toLocaleDateString()}):"—"},sortable:f,cellClassName:"max-w-[200px]"}:{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:d=>{const c=d[o];return c==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(c)})},sortable:f,cellClassName:"max-w-[200px]"}})}function Kt(n,e,s,r){const i=n||kt(e,s);return i.some(p=>p.id==="actions")?i:Object.keys(r).length>0?[...i,Ft(r)]:i}function cs(n){const e=Ae.c(113),{connectionId:s,org:r,activeCollection:i}=n,l=i.name,u=i.schema??ct,p=i.hasCreateTool,j=i.hasUpdateTool,o=i.hasDeleteTool,m=Ye(),{data:f}=Ze.useSession(),d=f?.user?.id||"unknown",{org:c}=et();let C;e[0]!==s||e[1]!==c.id?(C={connectionId:s,orgId:c.id},e[0]=s,e[1]=c.id,e[2]=C):C=e[2];const y=vt(C),a=jt(s,l,y),S=`${s}-${l}`;let h;e[3]!==r||e[4]!==S?(h={namespace:r,resource:S,defaultSortKey:"updated_at"},e[3]=r,e[4]=S,e[5]=h):h=e[5];const{search:x,searchTerm:P,setSearch:v,viewMode:D,setViewMode:_,sortKey:z,sortDirection:b,handleSort:T}=lt(h);let N;e[6]!==P||e[7]!==b||e[8]!==z?(N={searchTerm:P,sortKey:z,sortDirection:b},e[6]=P,e[7]=b,e[8]=z,e[9]=N):N=e[9];const F=Ct(s,l,y,N),w=!p&&!j&&!o;let E;e[10]!==l||e[11]!==s||e[12]!==m||e[13]!==r?(E=g=>{m({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:r,project:$e,connectionId:s,collectionName:l,itemId:g.id}})},e[10]=l,e[11]=s,e[12]=m,e[13]=r,e[14]=E):E=e[14];const $=E;let A;e[15]!==a.create||e[16]!==d?(A=async g=>{const me=new Date().toISOString();await a.create.mutateAsync({...g,id:Oe("conn"),title:`${g.title} (Copy)`,created_at:me,updated_at:me,created_by:d,updated_by:d})},e[15]=a.create,e[16]=d,e[17]=A):A=e[17];const O=A,[I,M]=tt.useState(null);let oe;e[18]===Symbol.for("react.memo_cache_sentinel")?(oe=g=>{M(g)},e[18]=oe):oe=e[18];const qe=oe;let K;e[19]!==$||e[20]!==j?(K=j&&{edit:$},e[19]=$,e[20]=j,e[21]=K):K=e[21];let U;e[22]!==O||e[23]!==p?(U=p&&{duplicate:O},e[22]=O,e[23]=p,e[24]=U):U=e[24];let L;e[25]!==o?(L=o&&{delete:qe},e[25]=o,e[26]=L):L=e[26];let ie;e[27]!==L||e[28]!==K||e[29]!==U?(ie={...K,...U,...L},e[27]=L,e[28]=K,e[29]=U,e[30]=ie):ie=e[30];const ue=ie;let ne;e[31]!==a.delete||e[32]!==I?(ne=async()=>{I&&(await a.delete.mutateAsync(I.id),M(null))},e[31]=a.delete,e[32]=I,e[33]=ne):ne=e[33];const fe=ne;let re;e[34]!==a.create||e[35]!==l||e[36]!==s||e[37]!==p||e[38]!==m||e[39]!==r||e[40]!==d?(re=async()=>{if(!p){st.error("Create operation is not available for this collection");return}const g=new Date().toISOString(),me={id:Oe("conn"),title:"New Item",description:"A brief description of the item",created_at:g,updated_at:g,created_by:d,updated_by:d};try{const _e=await a.create.mutateAsync(me);m({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:r,project:$e,connectionId:s,collectionName:l,itemId:_e.id}})}catch(_e){console.error("Failed to create item:",_e)}},e[34]=a.create,e[35]=l,e[36]=s,e[37]=p,e[38]=m,e[39]=r,e[40]=d,e[41]=re):re=e[41];const he=re;let le;e[42]!==u?(le=We(u),e[42]=u,e[43]=le):le=e[43];const xe=le,Pe=(F?.length??0)>0,Qe=p&&Pe,Xe=p&&!Pe&&!x;let ae;e[44]!==a.create||e[45]!==he||e[46]!==p?(ae=p?t.jsxs(Ie,{onClick:he,size:"sm",disabled:a.create.isPending,className:"h-7",children:[t.jsx(bt,{className:"mr-2 h-4 w-4"}),a.create.isPending?"Creating...":"Create"]}):null,e[44]=a.create,e[45]=he,e[46]=p,e[47]=ae):ae=e[47];const Te=ae,ge=z;let B;e[48]!==T||e[49]!==_||e[50]!==b||e[51]!==xe||e[52]!==ge||e[53]!==D?(B=t.jsx(Fe,{viewMode:D,onViewModeChange:_,sortKey:ge,sortDirection:b,onSort:T,sortOptions:xe}),e[48]=T,e[49]=_,e[50]=b,e[51]=xe,e[52]=ge,e[53]=D,e[54]=B):B=e[54];const je=Qe&&Te;let R;e[55]!==B||e[56]!==je?(R=t.jsxs(yt,{children:[B,je]}),e[55]=B,e[56]=je,e[57]=R):R=e[57];const Ce=`Search ${l}...`;let V;e[58]!==v?(V=g=>{g.key==="Escape"&&(v(""),g.target.blur())},e[58]=v,e[59]=V):V=e[59];let G;e[60]!==x||e[61]!==v||e[62]!==Ce||e[63]!==V?(G=t.jsx(it,{value:x,onChange:v,placeholder:Ce,onKeyDown:V}),e[60]=x,e[61]=v,e[62]=Ce,e[63]=V,e[64]=G):G=e[64];let J;e[65]!==F?(J=F??[],e[65]=F,e[66]=J):J=e[66];const ve=z;let W;e[67]!==$?(W=g=>$(g),e[67]=$,e[68]=W):W=e[68];const be="No items found",ye=x?"Try adjusting your search terms":"This collection doesn't have any items yet.",Ne=Xe?Te:void 0;let H;e[69]!==be||e[70]!==ye||e[71]!==Ne?(H=t.jsx(at,{image:null,title:be,description:ye,actions:Ne}),e[69]=be,e[70]=ye,e[71]=Ne,e[72]=H):H=e[72];let q;e[73]!==T||e[74]!==w||e[75]!==ue||e[76]!==u||e[77]!==x||e[78]!==v||e[79]!==_||e[80]!==b||e[81]!==J||e[82]!==ve||e[83]!==W||e[84]!==H||e[85]!==D?(q=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(Tt,{hideToolbar:!0,data:J,schema:u,viewMode:D,onViewModeChange:_,search:x,onSearchChange:v,sortKey:ve,sortDirection:b,onSort:T,actions:ue,onItemClick:W,readOnly:w,emptyState:H})}),e[73]=T,e[74]=w,e[75]=ue,e[76]=u,e[77]=x,e[78]=v,e[79]=_,e[80]=b,e[81]=J,e[82]=ve,e[83]=W,e[84]=H,e[85]=D,e[86]=q):q=e[86];let Q;e[87]!==G||e[88]!==q?(Q=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[G,q]}),e[87]=G,e[88]=q,e[89]=Q):Q=e[89];const we=!!I;let ce;e[90]===Symbol.for("react.memo_cache_sentinel")?(ce=g=>{g||M(null)},e[90]=ce):ce=e[90];let de;e[91]===Symbol.for("react.memo_cache_sentinel")?(de=t.jsx(mt,{children:"Delete item?"}),e[91]=de):de=e[91];const Se=I?.title;let X;e[92]!==Se?(X=t.jsxs(ut,{children:[de,t.jsxs(ft,{children:['Are you sure you want to delete "',Se,'"? This action cannot be undone.']})]}),e[92]=Se,e[93]=X):X=e[93];let Y;e[94]!==a.delete.isPending?(Y=t.jsx(dt,{disabled:a.delete.isPending,children:"Cancel"}),e[94]=a.delete.isPending,e[95]=Y):Y=e[95];const De=a.delete.isPending?"Deleting...":"Delete";let Z;e[96]!==a.delete.isPending||e[97]!==fe||e[98]!==De?(Z=t.jsx(pt,{onClick:fe,disabled:a.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:De}),e[96]=a.delete.isPending,e[97]=fe,e[98]=De,e[99]=Z):Z=e[99];let ee;e[100]!==Y||e[101]!==Z?(ee=t.jsxs(ht,{children:[Y,Z]}),e[100]=Y,e[101]=Z,e[102]=ee):ee=e[102];let te;e[103]!==X||e[104]!==ee?(te=t.jsxs(xt,{children:[X,ee]}),e[103]=X,e[104]=ee,e[105]=te):te=e[105];let se;e[106]!==we||e[107]!==te?(se=t.jsx(gt,{open:we,onOpenChange:ce,children:te}),e[106]=we,e[107]=te,e[108]=se):se=e[108];let pe;return e[109]!==R||e[110]!==Q||e[111]!==se?(pe=t.jsxs(t.Fragment,{children:[R,Q,se]}),e[109]=R,e[110]=Q,e[111]=se,e[112]=pe):pe=e[112],pe}export{cs as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as k,c as T,j as t}from"./index-
|
|
1
|
+
import{r as k,c as T,j as t}from"./index-BKpxPW_G.js";import{B as L}from"./button-D_OpQIQm.js";import{c as E,a as V,D as B,b as $}from"./dropdown-menu-BxLN4KkF.js";import{i as D}from"./ArrowUp-D26ZQKRa.js";import{i as R}from"./Check-bgVFNRDs.js";import{c as H}from"./Grid01-CfSiTcO8.js";import{i as W}from"./List-BBkbo-oe.js";import{c as I,b as K,T as _,a as A}from"./integration-icon-DFSc5_D8.js";import{V as O}from"./view-mode-toggle-4jMhv4Z3.js";import{c as y}from"./utils-Ckp7rFN8.js";import{T as P,a as q,b as z,c as F,d as G,e as J}from"./table-BxUix49E.js";const S=({size:p=24,color:e="currentColor",...s})=>k.createElement("svg",{viewBox:"0 0 24 24",width:p,height:p,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},k.createElement("path",{d:"M12 5v14m0 0 7-7m-7 7-7-7"}));S.displayName="ArrowDown";const M=({size:p=24,color:e="currentColor",...s})=>k.createElement("svg",{viewBox:"0 0 24 24",width:p,height:p,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},k.createElement("path",{d:"M5 21v-7m0-4V3m7 18v-9m0-4V3m7 18v-5m0-4V3M2 14h6m1-6h6m1 8h6"}));M.displayName="Sliders01";function ae(p){const e=T.c(16),{viewMode:s,onViewModeChange:x,sortKey:u,sortDirection:d,onSort:a,sortOptions:i}=p;let l;e[0]!==i?(l=i===void 0?[]:i,e[0]=i,e[1]=l):l=e[1];const m=l;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(I,{children:t.jsxs(K,{children:[t.jsx(_,{asChild:!0,children:t.jsx(V,{asChild:!0,children:t.jsx(L,{variant:"outline",size:"icon",className:"size-7 border border-input",children:t.jsx(M,{size:16})})})}),t.jsx(A,{children:"Search filters"})]})}),e[2]=h):h=e[2];let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c={value:"table",icon:t.jsx(W,{})},e[3]=c):c=e[3];let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=[c,{value:"cards",icon:t.jsx(H,{})}],e[4]=r):r=e[4];let o;e[5]!==x||e[6]!==s?(o=t.jsx("div",{className:"p-2 border-b border-border",children:t.jsx(O,{value:s,onValueChange:x,fullWidth:!0,options:r})}),e[5]=x,e[6]=s,e[7]=o):o=e[7];let f;e[8]!==a||e[9]!==d||e[10]!==u||e[11]!==m?(f=m.length>0&&a&&t.jsxs("div",{className:"p-1 flex flex-col gap-0.5",children:[t.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),m.map(j=>{const w=u===j.id;return t.jsx(E,{onClick:()=>a(j.id),className:y("h-8 px-2 py-0 cursor-pointer",w&&"bg-accent"),children:t.jsxs("div",{className:"flex items-center gap-2 w-full",children:[w&&t.jsx(R,{size:16,className:"text-foreground shrink-0"}),!w&&t.jsx("div",{className:"w-4 shrink-0"}),t.jsx("span",{className:"text-sm text-foreground flex-1",children:j.label}),w&&d&&(d==="asc"?t.jsx(D,{size:16,className:"text-foreground shrink-0"}):t.jsx(S,{size:16,className:"text-foreground shrink-0"}))]})},j.id)})]}),e[8]=a,e[9]=d,e[10]=u,e[11]=m,e[12]=f):f=e[12];let g;return e[13]!==o||e[14]!==f?(g=t.jsxs(B,{children:[h,t.jsxs($,{align:"end",className:"w-[200px] p-0 gap-0",children:[o,f]})]}),e[13]=o,e[14]=f,e[15]=g):g=e[15],g}function Q(p){const e=T.c(29),{columns:s,data:x,sortKey:u,sortDirection:d,onSort:a,onRowClick:i,rowClassName:l}=p;let m;e[0]!==d?(m=function(n,N){return t.jsx("div",{className:"w-4 flex items-center justify-center",children:N&&d&&(d==="asc"?t.jsx(D,{size:16,className:"text-muted-foreground transition-colors"}):t.jsx(S,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=d,e[1]=m):m=e[1];const h=m;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=function(n,N){let C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider";return n===N-1&&(C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider w-8"),C},e[2]=c):c=e[2];const r=c;let o;if(e[3]!==s||e[4]!==a||e[5]!==h||e[6]!==u){let b;e[8]!==s.length||e[9]!==a||e[10]!==h||e[11]!==u?(b=(n,N)=>{const C=u===n.id;return t.jsx(P,{className:y(r(N,s.length),"group transition-colors select-none",n.sortable&&"hover:bg-accent cursor-pointer",n.rowClassName,n.cellClassName),onClick:n.sortable&&a?()=>a(n.id):void 0,children:t.jsxs("span",{className:"flex items-center gap-1",children:[n.header,n.sortable&&h(n.id,C)]})},n.id)},e[8]=s.length,e[9]=a,e[10]=h,e[11]=u,e[12]=b):b=e[12],o=s.map(b),e[3]=s,e[4]=a,e[5]=h,e[6]=u,e[7]=o}else o=e[7];let f;e[13]!==o?(f=t.jsx(q,{className:"border-b-0",children:t.jsx(z,{className:"h-9 hover:bg-transparent border-b border-border",children:o})}),e[13]=o,e[14]=f):f=e[14];let g;if(e[15]!==s||e[16]!==x||e[17]!==i||e[18]!==l){let b;e[20]!==s||e[21]!==i||e[22]!==l?(b=(n,N)=>{const C=l?.(n);return t.jsx(z,{"data-row-index":N,className:y("group/data-row transition-colors border-b-0 hover:bg-accent/50",i?"cursor-pointer":"",C),onClick:i?()=>i(n):void 0,children:s.map(v=>t.jsx(F,{className:y("px-5 py-4 h-16 align-middle text-sm text-foreground",v.cellClassName,v.wrap?"whitespace-normal wrap-break-word":""),children:t.jsx("div",{className:y(v.wrap?"w-full":"min-w-0 w-full",!v.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:v.render?v.render(n):v.accessor?v.accessor(n):null})},v.id))},N)},e[20]=s,e[21]=i,e[22]=l,e[23]=b):b=e[23],g=x.map(b),e[15]=s,e[16]=x,e[17]=i,e[18]=l,e[19]=g}else g=e[19];let j;e[24]!==g?(j=t.jsx(G,{children:g}),e[24]=g,e[25]=j):j=e[25];let w;return e[26]!==f||e[27]!==j?(w=t.jsxs(J,{className:"w-full border-collapse",children:[f,j]}),e[26]=f,e[27]=j,e[28]=w):w=e[28],w}function le(p){const e=T.c(12),{columns:s,data:x,isLoading:u,sortKey:d,sortDirection:a,onSort:i,onRowClick:l,emptyState:m}=p;if(u===void 0?!1:u){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=r):r=e[0],r}if(x.length===0){let r;e[1]!==m?(r=m||t.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=m,e[2]=r):r=e[2];let o;return e[3]!==r?(o=t.jsx("div",{className:"flex items-center justify-center h-full",children:r}),e[3]=r,e[4]=o):o=e[4],o}let c;return e[5]!==s||e[6]!==x||e[7]!==l||e[8]!==i||e[9]!==a||e[10]!==d?(c=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(Q,{columns:s,data:x,sortKey:d,sortDirection:a,onSort:i,onRowClick:l})}),e[5]=s,e[6]=x,e[7]=l,e[8]=i,e[9]=a,e[10]=d,e[11]=c):c=e[11],c}export{ae as C,le as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as x,j as u}from"./index-
|
|
1
|
+
import{c as x,j as u}from"./index-BKpxPW_G.js";import{c as m}from"./utils-Ckp7rFN8.js";import{B as g}from"./badge-DBw6AEaX.js";function v(f){const e=x.c(12),{tabs:l,activeTab:n,onTabChange:s,className:a}=f;let t;e[0]!==a?(t=m("flex items-center gap-2 overflow-x-auto no-scrollbar",a),e[0]=a,e[1]=t):t=e[1];let r;if(e[2]!==n||e[3]!==s||e[4]!==l){let c;e[6]!==n||e[7]!==s?(c=o=>{const d=n===o.id;return u.jsxs("button",{type:"button",onClick:()=>s(o.id),className:m("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center",d&&"bg-accent border-border text-foreground",!d&&"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:[o.label,o.count!==void 0&&u.jsx(g,{variant:"secondary",className:m("h-5 min-w-5 px-1 rounded-full text-[10px] font-mono inline-flex items-center justify-center",d?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:o.count})]},o.id)},e[6]=n,e[7]=s,e[8]=c):c=e[8],r=l.map(c),e[2]=n,e[3]=s,e[4]=l,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=u.jsx("div",{className:t,children:r}),e[9]=t,e[10]=r,e[11]=i):i=e[11],i}export{v as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as r,u as i,y as u,K as p,g as f,j as n}from"./index-
|
|
1
|
+
import{c as r,u as i,y as u,K as p,g as f,j as n}from"./index-BKpxPW_G.js";import{_ as m}from"./index-CnNzyZrg.js";import{c}from"./utils-Ckp7rFN8.js";import{i as x}from"./SearchMd-BqVXNd65.js";function v(){const a=r.c(4),{locator:e}=i();let t;a[0]!==e?(t=p.members(e),a[0]=e,a[1]=t):t=a[1];let s;return a[2]!==t?(s={queryKey:t,queryFn:g},a[2]=t,a[3]=s):s=a[3],u(s)}function g(){return f.organization.listMembers()}function _(a){const e=r.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 o;e[3]!==t?(o=c("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m,{"data-slot":"command",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function j(a){const e=r.c(9);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 o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(x,{className:"size-5 shrink-0 text-foreground"}),e[3]=o):o=e[3];let l;e[4]!==t?(l=c("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),e[4]=t,e[5]=l):l=e[5];let d;return e[6]!==s||e[7]!==l?(d=n.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-10 items-center gap-2 border-b px-3",children:[o,n.jsx(m.Input,{"data-slot":"command-input",className:l,...s})]}),e[6]=s,e[7]=l,e[8]=d):d=e[8],d}function C(a){const e=r.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 o;e[3]!==t?(o=c("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.List,{"data-slot":"command-list",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function w(a){const e=r.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=n.jsx(m.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t}),e[2]=t,e[3]=s):s=e[3],s}function $(a){const e=r.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 o;e[3]!==t?(o=c("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Group,{"data-slot":"command-group",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function k(a){const e=r.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 o;e[3]!==t?(o=c("bg-border -mx-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Separator,{"data-slot":"command-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function E(a){const e=r.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 o;e[3]!==t?(o=c("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Item,{"data-slot":"command-item",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}export{$ as C,E as a,k as b,w as c,C as d,_ as e,j as f,v as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as T,bo as M,j as e,bp as P,z as q,r as R,t as h,a as O}from"./index-
|
|
1
|
+
import{c as T,bo as M,j as e,bp as P,z as q,r as R,t as h,a as O}from"./index-BKpxPW_G.js";import{u as A}from"./useQuery-Bo6lCSyK.js";import{u as _}from"./useMutation-Bnsod7M-.js";import{B as y}from"./button-D_OpQIQm.js";import{C as N,a as v}from"./card-DAZxrY9k.js";import{i as L,a as U}from"./mcp-oauth-DQYLB8aB.js";import{c as C,C as K,a as k}from"./circle-alert-DHI8xRUj.js";import"./utils-Ckp7rFN8.js";const Q=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],D=C("external-link",Q);const H=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],w=C("loader-circle",H);const J=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],B=C("refresh-cw",J),Y=t=>{const n=T.c(6);let i;n[0]!==t?({...i}=t,n[0]=t,n[1]=i):i=n[1];const{theme:a}=M(),d=a===void 0?"system":a;let r;n[2]===Symbol.for("react.memo_cache_sentinel")?(r={"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},n[2]=r):r=n[2];let m;return n[3]!==i||n[4]!==d?(m=e.jsx(P,{theme:d,className:"toaster group",style:r,...i}),n[3]=i,n[4]=d,n[5]=m):m=n[5],m},b={session:t=>["user-sandbox-session",t]};function V({sessionId:t,onComplete:n,onError:i}){const a=q(),[p,d]=R.useState(null),{data:r,isLoading:m,error:j}=A({queryKey:b.session(t),queryFn:async()=>{const s=await fetch(`/api/user-sandbox/sessions/${t}`);if(!s.ok){const o=await s.json();throw new Error(o.error||"Failed to load session")}return s.json()}}),F=_({mutationFn:async({appName:s,connectionId:o})=>{const l=await fetch(`/api/user-sandbox/sessions/${t}/configure`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:s,connection_id:o})});if(!l.ok){const u=await l.json();throw new Error(u.error||"Configuration failed")}return l.json()},onSuccess:()=>{a.invalidateQueries({queryKey:b.session(t)})}}),x=_({mutationFn:async()=>{const s=await fetch(`/api/user-sandbox/sessions/${t}/complete`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!s.ok){const o=await s.json();throw new Error(o.error||"Failed to complete")}return s.json()},onSuccess:s=>{s.redirectUrl?window.location.href=s.redirectUrl:(h.success("Setup complete!"),a.invalidateQueries({queryKey:b.session(t)}),n?.({agentId:s.agentId,redirectUrl:s.redirectUrl}))},onError:s=>{const o=s instanceof Error?s:new Error("Failed to complete");h.error(o.message),i?.(o)}}),S=async s=>{d(s.app_name);try{const o=await fetch(`/api/user-sandbox/sessions/${t}/provision`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:s.app_name})});if(!o.ok){const g=await o.json();throw new Error(g.error||"Failed to provision connection")}const u=(await o.json()).connection_id;if(s.connection_type==="HTTP"||s.connection_type==="SSE"||s.connection_type==="Websocket"){const g=`/mcp/${u}`,z=await L({url:g,token:null});if(!z.isAuthenticated&&z.supportsOAuth){h.info("Opening authentication window...");const c=await U({connectionId:u,clientName:s.title,timeout:3e5});if(c.error)throw new Error(c.error);if(c.tokenInfo){const E=await fetch(`/api/connections/${u}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accessToken:c.tokenInfo.accessToken,refreshToken:c.tokenInfo.refreshToken,expiresIn:c.tokenInfo.expiresIn,scope:c.tokenInfo.scope,clientId:c.tokenInfo.clientId,clientSecret:c.tokenInfo.clientSecret,tokenEndpoint:c.tokenInfo.tokenEndpoint})});if(!E.ok){const $=await E.json().catch(()=>({}));throw new Error($.error||"Failed to save authentication tokens. Please try again.")}}}}await F.mutateAsync({appName:s.app_name,connectionId:u}),h.success(`${s.title} connected successfully`)}catch(o){console.error("Connection error:",o);const l=o instanceof Error?o:new Error("Failed to connect");h.error(l.message),i?.(l)}finally{d(null)}},I=r?.apps.every(s=>s.status.configured),f=r?.session.status==="completed";return m?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsx(w,{className:"size-8 animate-spin text-muted-foreground"})}):j?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:e.jsx(N,{className:"max-w-md w-full",children:e.jsx(v,{className:"pt-6",children:e.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[e.jsx("div",{className:"size-12 rounded-full bg-destructive/10 flex items-center justify-center",children:e.jsx(K,{className:"size-6 text-destructive"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Session Error"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:j instanceof Error?j.message:"Failed to load"})]})]})})})}):r?e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(Y,{}),e.jsxs("div",{className:"max-w-lg mx-auto px-4 py-12",children:[e.jsxs("div",{className:"text-center mb-8",children:[r.template.icon&&e.jsx("div",{className:"size-16 mx-auto mb-4 rounded-xl bg-muted flex items-center justify-center overflow-hidden",children:e.jsx("img",{src:r.template.icon,alt:"",className:"size-10 object-contain"})}),e.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:r.template.title}),r.template.description&&e.jsx("p",{className:"text-muted-foreground mt-2",children:r.template.description})]}),f&&e.jsx(N,{className:"mb-6 border-green-500/20 bg-green-500/5",children:e.jsx(v,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"size-10 rounded-full bg-green-500/10 flex items-center justify-center",children:e.jsx(k,{className:"size-5 text-green-500"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Setup Complete"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Your integrations are ready to use."})]})]})})}),e.jsx("div",{className:"space-y-3",children:r.apps.map(s=>e.jsx(N,{children:e.jsx(v,{className:"py-4",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"size-10 rounded-lg bg-muted flex items-center justify-center shrink-0 overflow-hidden",children:s.icon?e.jsx("img",{src:s.icon,alt:"",className:"size-6 object-contain"}):e.jsx("span",{className:"text-lg",children:"📦"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium truncate",children:s.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.status.configured?e.jsxs("span",{className:"text-green-600 dark:text-green-400 flex items-center gap-1",children:[e.jsx(k,{className:"size-3"})," Connected"]}):s.requires_oauth?"Requires authentication":"Ready to connect"})]}),!s.status.configured&&!f&&e.jsx(y,{size:"sm",onClick:()=>S(s),disabled:p!==null||x.isPending,children:p===s.app_name?e.jsxs(e.Fragment,{children:[e.jsx(w,{className:"size-4 mr-2 animate-spin"}),"Connecting..."]}):e.jsxs(e.Fragment,{children:[e.jsx(D,{className:"size-4 mr-2"}),"Connect"]})}),s.status.configured&&!f&&e.jsxs(y,{size:"sm",variant:"outline",onClick:()=>S(s),disabled:p!==null||x.isPending,children:[e.jsx(B,{className:"size-4 mr-2"}),"Reconnect"]}),f&&e.jsx("div",{className:"size-8 rounded-full bg-green-500/10 flex items-center justify-center",children:e.jsx(k,{className:"size-4 text-green-500"})})]})})},s.app_name))}),I&&!f&&e.jsx("div",{className:"mt-6",children:e.jsx(y,{className:"w-full",size:"lg",onClick:()=>x.mutate(),disabled:x.isPending,children:x.isPending?e.jsxs(e.Fragment,{children:[e.jsx(w,{className:"size-4 mr-2 animate-spin"}),"Completing..."]}):"Complete Setup"})}),e.jsx("div",{className:"mt-8 pt-6 border-t text-center",children:e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Session expires:"," ",new Date(r.session.expires_at).toLocaleString()]})})]})]}):null}function re(){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{re as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as $,j as t}from"./index-
|
|
1
|
+
import{c as $,j as t}from"./index-BKpxPW_G.js";import{C as q}from"./card-DAZxrY9k.js";import{c as N}from"./utils-Ckp7rFN8.js";import{I as B}from"./integration-icon-DFSc5_D8.js";function L(g){const e=$.c(46),{connection:s,onClick:C,headerActions:b,body:k,footer:y,className:I,size:A,fallbackIcon:w}=g,E=A===void 0?"md":A,i=E==="sm"?"p-4":"p-6",P=E==="sm"?"text-sm":"text-base",R=E==="sm"?"text-xs":"text-sm",S=C&&"hover:bg-muted/50";let l;e[0]!==I||e[1]!==S?(l=N("cursor-pointer transition-colors group overflow-hidden flex flex-col",S,I),e[0]=I,e[1]=S,e[2]=l):l=e[2];let o;e[3]!==i?(o=N("flex flex-col gap-4",i),e[3]=i,e[4]=o):o=e[4];let n;e[5]!==s.icon||e[6]!==s.title||e[7]!==w?(n=t.jsx(B,{icon:s.icon,name:s.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:w}),e[5]=s.icon,e[6]=s.title,e[7]=w,e[8]=n):n=e[8];let c;e[9]!==b?(c=b&&t.jsx("div",{className:N("transition-opacity","opacity-0 group-hover:opacity-100"),onClick:F,children:b}),e[9]=b,e[10]=c):c=e[10];let r;e[11]!==c?(r=t.jsx("div",{className:"relative",children:c}),e[11]=c,e[12]=r):r=e[12];let a;e[13]!==n||e[14]!==r?(a=t.jsxs("div",{className:"flex items-start justify-between",children:[n,r]}),e[13]=n,e[14]=r,e[15]=a):a=e[15];let d;e[16]!==P?(d=N("font-medium text-foreground truncate",P),e[16]=P,e[17]=d):d=e[17];let m;e[18]!==s.title||e[19]!==d?(m=t.jsx("h3",{className:d,children:s.title}),e[18]=s.title,e[19]=d,e[20]=m):m=e[20];let f;e[21]!==R?(f=N("text-muted-foreground line-clamp-2",R),e[21]=R,e[22]=f):f=e[22];const _=s.description||"No description";let x;e[23]!==f||e[24]!==_?(x=t.jsx("p",{className:f,children:_}),e[23]=f,e[24]=_,e[25]=x):x=e[25];let p;e[26]!==m||e[27]!==x?(p=t.jsxs("div",{className:"flex flex-col gap-0",children:[m,x]}),e[26]=m,e[27]=x,e[28]=p):p=e[28];let h;e[29]!==k?(h=k&&t.jsx("div",{children:k}),e[29]=k,e[30]=h):h=e[30];let u;e[31]!==p||e[32]!==h||e[33]!==o||e[34]!==a?(u=t.jsxs("div",{className:o,children:[a,p,h]}),e[31]=p,e[32]=h,e[33]=o,e[34]=a,e[35]=u):u=e[35];let j;e[36]!==y||e[37]!==i?(j=y&&t.jsx("div",{className:"border-t border-border mt-auto",children:t.jsx("div",{className:N("h-14 flex items-center",i),onClick:D,children:y})}),e[36]=y,e[37]=i,e[38]=j):j=e[38];let v;e[39]!==u||e[40]!==j?(v=t.jsxs("div",{className:"flex flex-col flex-1",children:[u,j]}),e[39]=u,e[40]=j,e[41]=v):v=e[41];let z;return e[42]!==C||e[43]!==v||e[44]!==l?(z=t.jsx(q,{className:l,onClick:C,children:v}),e[42]=C,e[43]=v,e[44]=l,e[45]=z):z=e[45],z}function D(g){return g.stopPropagation()}function F(g){return g.stopPropagation()}export{L as C};
|