@decocms/mesh 2.72.1 → 2.74.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-BOIQEKjW.js → AlertCircle-C_hR5usO.js} +1 -1
- package/dist/client/assets/{ArrowUp-BRclUYsx.js → ArrowUp-DnJUZ1OS.js} +1 -1
- package/dist/client/assets/{Calendar-DydX5uRn.js → Calendar-Dnf0_EY9.js} +1 -1
- package/dist/client/assets/{Check-Bkb61eVw.js → Check-Sa4xK5Hg.js} +1 -1
- package/dist/client/assets/{CheckCircle-ZkjIkaWv.js → CheckCircle-DRhauZbp.js} +1 -1
- package/dist/client/assets/{CheckDone01-BusS8ANA.js → CheckDone01-I6GfoGdi.js} +1 -1
- package/dist/client/assets/{ChevronDown-DqJTvBdv.js → ChevronDown-DmXLJeAy.js} +1 -1
- package/dist/client/assets/{ChevronRight-BBcOJkyP.js → ChevronRight-By4KEpZh.js} +1 -1
- package/dist/client/assets/{Code01-DEMYMNLO.js → Code01-h_k8K-1e.js} +1 -1
- package/dist/client/assets/{Copy01-BvgMlJ5t.js → Copy01-jvqvZrKj.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-C3Pu-YCA.js → DotsHorizontal-CQJNqVgu.js} +1 -1
- package/dist/client/assets/{DotsVertical-DMOP2SMU.js → DotsVertical-gLXmVMYI.js} +1 -1
- package/dist/client/assets/{Download01-VwSgop8U.js → Download01-BKmVPJWY.js} +1 -1
- package/dist/client/assets/{Edit01-ByF-cYbh.js → Edit01-BT8zEtQL.js} +1 -1
- package/dist/client/assets/{File02-D6OcKUS4.js → File02-BNE7fmK0.js} +1 -1
- package/dist/client/assets/{File06-CkTcogsG.js → File06-WU23pV9H.js} +1 -1
- package/dist/client/assets/{FilterLines-BL17m8OO.js → FilterLines-DJEB3mgx.js} +1 -1
- package/dist/client/assets/{Globe02-CwdZK2H5.js → Globe02-Dp5eUbS2.js} +1 -1
- package/dist/client/assets/{Grid01-zbmmdox0.js → Grid01-CSAsqBFD.js} +1 -1
- package/dist/client/assets/{Home02-DPzckV1r.js → Home02-BUr926Eo.js} +1 -1
- package/dist/client/assets/{Image01-BuXlAy8i.js → Image01-BnbXZOf7.js} +1 -1
- package/dist/client/assets/{Inbox01-Czow08Bp.js → Inbox01-XFeiQPbg.js} +1 -1
- package/dist/client/assets/{InfoCircle-C8GtqndP.js → InfoCircle-5xWfOa8P.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DJasjN8P.js → LinkExternal01-BJLPX8tt.js} +1 -1
- package/dist/client/assets/{List-BvAv-Mbv.js → List-kXpaJIIp.js} +1 -1
- package/dist/client/assets/{Loading01-DOPFYU4m.js → Loading01-D8zw0cyg.js} +1 -1
- package/dist/client/assets/{Lock01-BALKEl0l.js → Lock01-DCDiY4HG.js} +1 -1
- package/dist/client/assets/{Pin01-Dk_x7uai.js → Pin01-DWsvacVo.js} +1 -1
- package/dist/client/assets/{Play-CjfPPVn_.js → Play-Yhg_pcqU.js} +1 -1
- package/dist/client/assets/{Plus-WaQ7hmj5.js → Plus-BBD2SckJ.js} +1 -1
- package/dist/client/assets/{SearchMd-Ds-ERWzq.js → SearchMd-CGuwiAQe.js} +1 -1
- package/dist/client/assets/{Settings01-CMNXJNnf.js → Settings01-D7-sGWon.js} +1 -1
- package/dist/client/assets/{Share07-w2-wABEW.js → Share07-C8iek9k4.js} +1 -1
- package/dist/client/assets/{Terminal-CrrxpXUI.js → Terminal-CyioLjuI.js} +1 -1
- package/dist/client/assets/{Tool01-Cn8FHCpZ.js → Tool01-DF-lT9RC.js} +1 -1
- package/dist/client/assets/{Trash01-C-euKa34.js → Trash01-CLqhrRia.js} +1 -1
- package/dist/client/assets/{Upload01-Dc0hOrKX.js → Upload01-DrtXkSgF.js} +1 -1
- package/dist/client/assets/{Users03-zsvZ9QWQ.js → Users03-oV4Gx6fu.js} +1 -1
- package/dist/client/assets/{X-DUGfq2_H.js → X-CuhyLwhM.js} +1 -1
- package/dist/client/assets/{XClose-Cv_qbaYN.js → XClose-BFt2trBc.js} +1 -1
- package/dist/client/assets/{agent-connections-preview-C15fpCN8.js → agent-connections-preview-D4bn0NTx.js} +1 -1
- package/dist/client/assets/{agent-detail-BQXrWX9M.js → agent-detail-D8YR1Y7H.js} +1 -1
- package/dist/client/assets/{agents-NgYS-NWl.js → agents-BMyluA59.js} +1 -1
- package/dist/client/assets/{alert-dialog-B4H6MrIT.js → alert-dialog-BxcV0D_1.js} +2 -2
- package/dist/client/assets/{auth-catchall-GUc2KujY.js → auth-catchall-DLJkIPQ0.js} +1 -1
- package/dist/client/assets/{avatar-B-AS-16N.js → avatar-D3z5_V3I.js} +1 -1
- package/dist/client/assets/{badge-BFm6jM0d.js → badge-BklHLRcK.js} +1 -1
- package/dist/client/assets/{binder-C4CQlgMb.js → binder-ak1AkjZY.js} +1 -1
- package/dist/client/assets/{breadcrumb-Cvo4WJJ5.js → breadcrumb-B_Yxwj4p.js} +1 -1
- package/dist/client/assets/{button-Cl3WMTWk.js → button-CcO5M7F7.js} +1 -1
- package/dist/client/assets/{card-B-73zAje.js → card-BNt4WjQv.js} +1 -1
- package/dist/client/assets/{checkbox-kN_xGJfO.js → checkbox-CirsSPdM.js} +1 -1
- package/dist/client/assets/{circle-alert-BEtzK3t3.js → circle-alert-BcHtOytY.js} +1 -1
- package/dist/client/assets/{collection-detail-C9AV2Fn9.js → collection-detail-iX-6m_0X.js} +2 -2
- package/dist/client/assets/{collection-search-Aeh0FXZR.js → collection-search-Cyt8_oQV.js} +1 -1
- package/dist/client/assets/{collection-tab-CgMRLj1Y.js → collection-tab-Cbay3Q2-.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CmBNNf0K.js → collection-table-wrapper-CFNweZN1.js} +1 -1
- package/dist/client/assets/{collection-tabs-2AUf3kZ2.js → collection-tabs-Dh2bhvAY.js} +1 -1
- package/dist/client/assets/{command-DICG2vo0.js → command-8Q_FGz0v.js} +1 -1
- package/dist/client/assets/{connect-DoxLTvbh.js → connect-1mhMrmD4.js} +1 -1
- package/dist/client/assets/{connection-card-ChzuU2dT.js → connection-card-BGd7kcn-.js} +1 -1
- package/dist/client/assets/connection-detail-dEdcHJ4u.js +1 -0
- package/dist/client/assets/connections-DmGFiu1f.js +1 -0
- package/dist/client/assets/{constants-1q3hobyw.js → constants-DuSOM18S.js} +1 -1
- package/dist/client/assets/constants-QC26G_cT.js +1 -0
- package/dist/client/assets/{create-organization-dialog-DWV2eGAF.js → create-organization-dialog-j_P7xuhv.js} +1 -1
- package/dist/client/assets/create-project-dialog-C-mSn_Ux.js +1 -0
- package/dist/client/assets/{dialog-BmGDp4UV.js → dialog-B_iTVR3h.js} +1 -1
- package/dist/client/assets/dropdown-menu-BTPpCOPE.js +1 -0
- package/dist/client/assets/{dynamic-plugin-layout-C_HHJRk0.js → dynamic-plugin-layout-BsqDni3U.js} +1 -1
- package/dist/client/assets/{empty-state-oU8PNga_.js → empty-state--JD6ZxUc.js} +1 -1
- package/dist/client/assets/{empty-state-DFIrBrC-.js → empty-state-Ct1fZFlf.js} +1 -1
- package/dist/client/assets/{env-vars-editor-Bmnp2cvo.js → env-vars-editor-B4EebJEK.js} +1 -1
- package/dist/client/assets/{error-boundary-D7C5xzme.js → error-boundary-DlgelpJG.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CQQ4ZZEG.js → extract-connection-data-BM37afPK.js} +1 -1
- package/dist/client/assets/file-browser-DQeqPq9E.js +2 -0
- package/dist/client/assets/form-CSsv2IBt.js +1 -0
- package/dist/client/assets/grid-view-DBKftgaD.js +1 -0
- package/dist/client/assets/home-D16zlSya.js +1 -0
- package/dist/client/assets/{index-9vOB29ZB.js → index-BHu7Lc_d.js} +1 -1
- package/dist/client/assets/{index-BV-rIyOx.js → index-Bn2rDd42.js} +6 -6
- package/dist/client/assets/{index-CxyQJKsK.js → index-Bo7hWTur.js} +1 -1
- package/dist/client/assets/{index-5T3tdhiA.js → index-CHcJPAjT.js} +1 -1
- package/dist/client/assets/{index-BA6gcyzW.js → index-CZtqakWK.js} +14 -14
- package/dist/client/assets/{index-Dolyg0HI.js → index-DJCm-wAr.js} +1 -1
- package/dist/client/assets/index-DZ7G-bvr.js +1 -0
- package/dist/client/assets/index-a2nqbblp.js +1 -0
- package/dist/client/assets/{index-fCCl5Un_.js → index-fr6MaGoE.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-CrYps4St.js → infiniteQueryObserver-VnhrjjoH.js} +1 -1
- package/dist/client/assets/{input-Dv5qvD5N.js → input-DBvMwxwE.js} +1 -1
- package/dist/client/assets/integration-icon-C8seGsuO.js +1 -0
- package/dist/client/assets/label-BjQxQJkg.js +1 -0
- package/dist/client/assets/layout-ZTsfxACA.js +1 -0
- package/dist/client/assets/{localstorage-keys-Ds2uOTRP.js → localstorage-keys-BhunmwZg.js} +1 -1
- package/dist/client/assets/{login-BpnfmGBt.js → login-H0BwFxqL.js} +1 -1
- package/dist/client/assets/{mcp-oauth-C_XpjqFg.js → mcp-oauth-ZUujauBG.js} +1 -1
- package/dist/client/assets/{mcp-server-card-CiGvO9aP.js → mcp-server-card-KgRAONYw.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-SQfpDpYc.js → mcp-server-detail-Ce9SGjoZ.js} +2 -2
- package/dist/client/assets/members-C925BdC6.js +3 -0
- package/dist/client/assets/{monaco-editor-q53ZLBJ5.js → monaco-editor-D7Ghoc8y.js} +1 -1
- package/dist/client/assets/{monitoring-CK4xcQzM.js → monitoring-DI8QAuDx.js} +19 -19
- package/dist/client/assets/{oauth-callback-CeLfnx5m.js → oauth-callback-DqKFxIqr.js} +1 -1
- package/dist/client/assets/page-B2cjdb1f.js +1 -0
- package/dist/client/assets/{page-jzi-88Nr.js → page-DCfXF14g.js} +1 -1
- package/dist/client/assets/plugin-empty-state-BYB8Yhjv.js +1 -0
- package/dist/client/assets/plugin-header-CLRCQ1W3.js +1 -0
- package/dist/client/assets/popover-BkKSdvGf.js +1 -0
- package/dist/client/assets/{project-layout-CH4wXxX2.js → project-layout-DzX_Lv0I.js} +1 -1
- package/dist/client/assets/project-settings-lapjGGi3.js +1 -0
- package/dist/client/assets/projects-list-DZgOrcLS.js +1 -0
- package/dist/client/assets/{registry-utils-CqOx6XXE.js → registry-utils-BsLp7zXK.js} +1 -1
- package/dist/client/assets/{resizable-CZuYHBhW.js → resizable-CdUSPFqv.js} +1 -1
- package/dist/client/assets/select-J2aavKNi.js +1 -0
- package/dist/client/assets/{shell-layout-BxNK1bDI.js → shell-layout-DOBmQ9ah.js} +2 -2
- package/dist/client/assets/{spinner-BPZfVVyD.js → spinner-Bn-tqgsf.js} +1 -1
- package/dist/client/assets/{store-invite-ICTVmn8_.js → store-invite-C8stGp_k.js} +1 -1
- package/dist/client/assets/switch-CG0LWjwI.js +1 -0
- package/dist/client/assets/{table-BBnlXDKe.js → table-BNxQWMxG.js} +1 -1
- package/dist/client/assets/{tasks-CpdqRpYU.js → tasks-C_RAoHGr.js} +1 -1
- package/dist/client/assets/{textarea-DK_SwVx9.js → textarea-CKlKOzV4.js} +1 -1
- package/dist/client/assets/{tools-list-B5iaOgKy.js → tools-list-D0G5KWHg.js} +1 -1
- package/dist/client/assets/{typewriter-title-C_OsyMAQ.js → typewriter-title-BqfnndCW.js} +2 -2
- package/dist/client/assets/{use-binding-BVOuBiur.js → use-binding-Dgjl_Htk.js} +1 -1
- package/dist/client/assets/{use-connection-B8DnjeO8.js → use-connection-CVk8Bzpz.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-7fubOknm.js → use-create-virtual-mcp-BpXLuk-p.js} +1 -1
- package/dist/client/assets/{use-deco-chat-open-cMRvRYVG.js → use-deco-chat-open-CfZI9mqc.js} +5 -5
- package/dist/client/assets/{use-install-from-registry-ClVbT6BY.js → use-install-from-registry-5UUqPBO7.js} +1 -1
- package/dist/client/assets/{use-list-state-DjV5kR97.js → use-list-state-D_1V56-b.js} +1 -1
- package/dist/client/assets/{use-llm-H-K3anTg.js → use-llm-Ca3pgrIB.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-Chz_2-6S.js → use-mcp-prompts-Cn7tm6ug.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CXMetymP.js → use-mcp-tools-Ddi2i1Nb.js} +1 -1
- package/dist/client/assets/{use-mobile-B2CDnK8i.js → use-mobile-p03CcGW0.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Bu92wRjl.js → use-organization-settings-DHZKDAPt.js} +1 -1
- package/dist/client/assets/{use-project-CzroiUzj.js → use-project-D-mK4K9b.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-ayu_K6US.js → use-virtual-mcp-C83o4Rih.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DDUEUpOZ.js +1 -0
- package/dist/client/assets/{useMutation-BOrtlNTb.js → useMutation-CnTeRHmv.js} +1 -1
- package/dist/client/assets/useQuery-Ct96KcZp.js +1 -0
- package/dist/client/assets/utils-Ckc2UwOp.js +1 -0
- package/dist/client/assets/{view-mode-toggle-CHHKGadJ.js → view-mode-toggle-CJkT6m07.js} +1 -1
- package/dist/client/assets/{workflow-BBKpGvON.js → workflow-2rDY9uo2.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +150 -150
- package/dist/server/migrate.js +1 -1
- package/dist/server/server.js +129 -129
- package/package.json +1 -1
- package/dist/client/assets/connection-detail-CVNpoyUm.js +0 -1
- package/dist/client/assets/connections-BHOwcUB0.js +0 -1
- package/dist/client/assets/constants-DzWq-50V.js +0 -1
- package/dist/client/assets/create-project-dialog-49RtElmv.js +0 -1
- package/dist/client/assets/dropdown-menu-6IaHSzwJ.js +0 -1
- package/dist/client/assets/file-browser-CHtfSNHu.js +0 -2
- package/dist/client/assets/form-qYB4UriD.js +0 -1
- package/dist/client/assets/grid-view-B4Eut3Xi.js +0 -1
- package/dist/client/assets/home-BYm3DFU4.js +0 -1
- package/dist/client/assets/index-BYzsWn1B.js +0 -1
- package/dist/client/assets/index-Vp0uDDij.js +0 -1
- package/dist/client/assets/integration-icon-DKM9NBX1.js +0 -1
- package/dist/client/assets/layout-B7afTuaN.js +0 -1
- package/dist/client/assets/members-CQSBREQS.js +0 -3
- package/dist/client/assets/page-CrfNBuC7.js +0 -1
- package/dist/client/assets/plugin-empty-state-Bnssy2Oj.js +0 -1
- package/dist/client/assets/plugin-header-DoQQAOys.js +0 -1
- package/dist/client/assets/popover-DuZ2ZN5J.js +0 -1
- package/dist/client/assets/project-settings-CKgnjrBp.js +0 -1
- package/dist/client/assets/projects-list-D0sSao6e.js +0 -1
- package/dist/client/assets/select-ODRW9YrY.js +0 -1
- package/dist/client/assets/switch-B-1QAIh-.js +0 -1
- package/dist/client/assets/useInfiniteQuery-TqDHdib1.js +0 -1
- package/dist/client/assets/useQuery-DDYln2BW.js +0 -1
- package/dist/client/assets/utils-CfR4kXxZ.js +0 -1
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as X,j as t,m as Ee,O as Se,aN as ct,u as at,bu as Ge,ad as vt,p as Nt,bt as ze,r as Y,o as lt,ba as yt,bi as _t,s as W,ae as Je,af as Ct,a as St,f as wt,v as Tt,h as kt,k as Pt,i as It,t as Ce,K as Ye}from"./index-BV-rIyOx.js";import{E as ye}from"./empty-state-oU8PNga_.js";import{E as dt}from"./error-boundary-D7C5xzme.js";import{E as $t,r as At,e as mt}from"./env-vars-editor-Bmnp2cvo.js";import{P as Xe,S as Vt}from"./index-Vp0uDDij.js";import{b as Mt,a as Dt}from"./use-binding-BVOuBiur.js";import{u as Ot,S as Rt}from"./index-Dolyg0HI.js";import{f as Ke,g as ut}from"./use-connection-B8DnjeO8.js";import{u as Et}from"./constants-1q3hobyw.js";import{d as Lt}from"./use-mcp-tools-CXMetymP.js";import{b as Ut,d as Ft}from"./use-mcp-prompts-Chz_2-6S.js";import{a as Bt}from"./mcp-oauth-C_XpjqFg.js";import{b as Ze,c as zt,d as Xt,e as Kt,B as Wt,a as qt}from"./breadcrumb-Cvo4WJJ5.js";import{B as Fe}from"./button-Cl3WMTWk.js";import{C as Ht}from"./collection-tabs-2AUf3kZ2.js";import{i as Re}from"./Loading01-DOPFYU4m.js";import{V as We,a as Qt}from"./layout-B7afTuaN.js";import{C as Gt}from"./collection-tab-CgMRLj1Y.js";import{I as qe,n as Jt}from"./integration-icon-DKM9NBX1.js";import{B as Be}from"./badge-BFm6jM0d.js";import{D as Yt,a as Zt,b as es,c as et}from"./dropdown-menu-6IaHSzwJ.js";import{F as G,a as ts,b as J,d as q,f as Z,c as te,e as ss}from"./form-qYB4UriD.js";import{I as ee}from"./input-Dv5qvD5N.js";import{S as tt,a as st,b as nt,c as ot,d as Q}from"./select-ODRW9YrY.js";import{i as pt}from"./CheckCircle-ZkjIkaWv.js";import{t as ns}from"./ChevronDown-DqJTvBdv.js";import{s as Oe}from"./Globe02-CwdZK2H5.js";import{s as os}from"./use-deco-chat-open-cMRvRYVG.js";import{i as rs}from"./Terminal-CrrxpXUI.js";import{s as is}from"./Trash01-C-euKa34.js";import{t as He}from"./Users03-zsvZ9QWQ.js";import{s as cs}from"./XClose-Cv_qbaYN.js";import{U as as}from"./use-list-state-DjV5kR97.js";import{b as ls,a as ds}from"./use-virtual-mcp-ayu_K6US.js";import{i as ms}from"./ChevronRight-BBcOJkyP.js";import{s as us}from"./Plus-WaQ7hmj5.js";import{f as ps}from"./formatDistanceToNow-Cb2QZZJn.js";import{a as ft,C as xt}from"./collection-table-wrapper-CmBNNf0K.js";import{C as ht}from"./collection-search-Aeh0FXZR.js";import{C as gt}from"./card-B-73zAje.js";import{R as fs,T as xs}from"./tools-list-B5iaOgKy.js";import"./utils-CfR4kXxZ.js";import"./Pin01-Dk_x7uai.js";import"./use-organization-settings-Bu92wRjl.js";import"./useMutation-BOrtlNTb.js";import"./binder-C4CQlgMb.js";import"./File06-CkTcogsG.js";import"./index-5T3tdhiA.js";import"./constants-DzWq-50V.js";import"./registry-utils-CqOx6XXE.js";import"./extract-connection-data-CQQ4ZZEG.js";import"./github-icon-Dp3wHhYE.js";import"./generate-id-Dyweu44Y.js";import"./use-install-from-registry-ClVbT6BY.js";import"./index-CxyQJKsK.js";import"./circle-alert-BEtzK3t3.js";import"./index-BA6gcyzW.js";import"./X-DUGfq2_H.js";import"./popover-DuZ2ZN5J.js";import"./spinner-BPZfVVyD.js";import"./dialog-BmGDp4UV.js";import"./AlertCircle-BOIQEKjW.js";import"./ArrowUp-BRclUYsx.js";import"./Edit01-ByF-cYbh.js";import"./Check-Bkb61eVw.js";import"./Copy01-BvgMlJ5t.js";import"./monaco-editor-q53ZLBJ5.js";import"./localstorage-keys-Ds2uOTRP.js";import"./useQuery-DDYln2BW.js";import"./SearchMd-Ds-ERWzq.js";import"./Code01-DEMYMNLO.js";import"./infiniteQueryObserver-CrYps4St.js";import"./use-create-virtual-mcp-7fubOknm.js";import"./index-9vOB29ZB.js";import"./DotsVertical-DMOP2SMU.js";import"./empty-state-DFIrBrC-.js";import"./Inbox01-Czow08Bp.js";import"./alert-dialog-B4H6MrIT.js";import"./index-BYzsWn1B.js";import"./use-llm-H-K3anTg.js";import"./Grid01-zbmmdox0.js";import"./Image01-BuXlAy8i.js";import"./avatar-B-AS-16N.js";import"./use-mobile-B2CDnK8i.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./List-BvAv-Mbv.js";import"./view-mode-toggle-CHHKGadJ.js";import"./table-BBnlXDKe.js";function hs(s){const e=X.c(13),{virtualMcp:n,org:o}=s;let r;e[0]!==o||e[1]!==n.id?(r={org:o,project:Se,agentId:n.id},e[0]=o,e[1]=n.id,e[2]=r):r=e[2];let c;e[3]!==n.icon||e[4]!==n.title?(c=n.icon?t.jsx("img",{src:n.icon,alt:n.title,className:"w-5 h-5 rounded-md object-cover shrink-0"}):t.jsx("div",{className:"w-8 h-8 rounded-md bg-primary/10 flex items-center justify-center shrink-0",children:t.jsx(He,{size:16,className:"text-primary"})}),e[3]=n.icon,e[4]=n.title,e[5]=c):c=e[5];let a;e[6]!==n.title?(a=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[6]=n.title,e[7]=a):a=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(ms,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[8]=f):f=e[8];let u;return e[9]!==r||e[10]!==c||e[11]!==a?(u=t.jsxs(ct,{to:"/$org/$project/agents/$agentId",params:r,className:"flex items-center gap-3 p-2 pr-1 rounded-lg hover:bg-muted/50 transition-colors group",children:[c,a,f]}),e[9]=r,e[10]=c,e[11]=a,e[12]=u):u=e[12],u}function rt(s){const e=X.c(20),{connectionId:n,connectionTitle:o,connectionDescription:r,connectionIcon:c,org:a,hasExistingVirtualMcps:f}=s,u=Ee(),p=ds();let x;e[0]!==p.create||e[1]!==r||e[2]!==c||e[3]!==n||e[4]!==o||e[5]!==u||e[6]!==a?(x=async()=>{const d=await p.create.mutateAsync({title:`${o} Agent`,description:r??null,icon:c??null,status:"active",connections:[{connection_id:n,selected_tools:null,selected_resources:null,selected_prompts:null}]});u({to:"/$org/$project/agents/$agentId",params:{org:a,project:Se,agentId:d.id}})},e[0]=p.create,e[1]=r,e[2]=c,e[3]=n,e[4]=o,e[5]=u,e[6]=a,e[7]=x):x=e[7];const m=x;if(f){let d;e[8]!==p.create.isPending?(d=p.create.isPending?t.jsx(Re,{size:16,className:"animate-spin"}):t.jsx(us,{size:16}),e[8]=p.create.isPending,e[9]=d):d=e[9];let l;return e[10]!==p.create.isPending||e[11]!==m||e[12]!==d?(l=t.jsx(Fe,{variant:"ghost",className:"size-6 p-0",onClick:m,disabled:p.create.isPending,children:d}),e[10]=p.create.isPending,e[11]=m,e[12]=d,e[13]=l):l=e[13],l}let i;e[14]!==p.create.isPending?(i=p.create.isPending?t.jsx(Re,{className:"animate-spin text-muted-foreground"}):t.jsx(He,{className:"size-3 text-muted-foreground"}),e[14]=p.create.isPending,e[15]=i):i=e[15];let b;return e[16]!==p.create.isPending||e[17]!==m||e[18]!==i?(b=t.jsxs(Fe,{variant:"outline",size:"sm",onClick:m,disabled:p.create.isPending,children:[i,"Create an agent"]}),e[16]=p.create.isPending,e[17]=m,e[18]=i,e[19]=b):b=e[19],b}function gs(s){const e=X.c(26),{connectionId:n,connectionTitle:o,connectionDescription:r,connectionIcon:c,org:a}=s;let f;e[0]!==n?(f={filters:[{column:"connection_id",value:n}]},e[0]=n,e[1]=f):f=e[1];const u=ls(f);if(!(u.length>0)){let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Use in your IDE"}),e[2]=l):l=e[2];let j;return e[3]!==r||e[4]!==c||e[5]!==n||e[6]!==o||e[7]!==a?(j=t.jsxs("div",{className:"p-5 flex items-center justify-between gap-3",children:[l,t.jsx(rt,{connectionId:n,connectionTitle:o,connectionDescription:r,connectionIcon:c,org:a,hasExistingVirtualMcps:!1})]}),e[3]=r,e[4]=c,e[5]=n,e[6]=o,e[7]=a,e[8]=j):j=e[8],j}let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Agents"}),e[9]=x):x=e[9];let m;e[10]!==r||e[11]!==c||e[12]!==n||e[13]!==o||e[14]!==a?(m=t.jsx("div",{className:"flex flex-col gap-1",children:t.jsxs("div",{className:"flex items-center justify-between",children:[x,t.jsx(rt,{connectionId:n,connectionTitle:o,connectionDescription:r,connectionIcon:c,org:a,hasExistingVirtualMcps:!0})]})}),e[10]=r,e[11]=c,e[12]=n,e[13]=o,e[14]=a,e[15]=m):m=e[15];let i;if(e[16]!==a||e[17]!==u){let l;e[19]!==a?(l=j=>t.jsx(hs,{virtualMcp:j,org:a},j.id),e[19]=a,e[20]=l):l=e[20],i=u.map(l),e[16]=a,e[17]=u,e[18]=i}else i=e[18];let b;e[21]!==i?(b=t.jsx("div",{className:"flex flex-col gap-2",children:i}),e[21]=i,e[22]=b):b=e[22];let d;return e[23]!==m||e[24]!==b?(d=t.jsxs("div",{className:"p-5 flex flex-col gap-3",children:[m,b]}),e[23]=m,e[24]=b,e[25]=d):d=e[25],d}function js({form:s,connection:e,hasOAuthToken:n,onReauthenticate:o,onRemoveOAuth:r}){const c=Ge({control:s.control,name:"ui_type"}),a=Ge({control:s.control,name:"connection_url"}),{stdioEnabled:f}=vt(),u=(()=>{if(typeof a!="string"||!a)return!1;try{const i=new URL(a);return i.hostname==="api.githubcopilot.com"&&i.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),p=f||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",m=x?Nt(e.connection_url):null;return x?t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(He,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),m&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:m})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsx(G,{control:s.control,name:"ui_type",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),c!=="NPX"&&c!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(tt,{value:i.value,onValueChange:i.onChange,children:[t.jsx(q,{children:t.jsxs(st,{className:"h-10 w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(Oe,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(nt,{})]})}),t.jsxs(ot,{children:[t.jsx(Q,{value:"HTTP",children:"HTTP"}),t.jsx(Q,{value:"SSE",children:"SSE"}),t.jsx(Q,{value:"Websocket",children:"Websocket"}),p&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{value:"NPX",children:"NPX Package"}),t.jsx(Q,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(G,{control:s.control,name:"connection_url",render:({field:b})=>t.jsx(J,{className:"flex-1 min-w-0",children:t.jsx(q,{children:t.jsx(ee,{placeholder:"https://example.com/mcp",...b,value:b.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(tt,{value:i.value,onValueChange:i.onChange,children:[t.jsx(q,{children:t.jsx(st,{className:"h-10",children:t.jsx(nt,{})})}),t.jsxs(ot,{children:[t.jsx(Q,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Oe,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(Q,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Oe,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(Q,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Oe,{className:"w-4 h-4"}),"Websocket"]})}),p&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Jt,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(Q,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(rs,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(Z,{})]})}),c==="NPX"&&t.jsx(G,{control:s.control,name:"npx_package",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(q,{children:t.jsx(ee,{placeholder:"@perplexity-ai/mcp-server",...i,value:i.value||"",className:"h-10 rounded-lg"})}),t.jsx(Z,{})]})}),c==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(G,{control:s.control,name:"stdio_command",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(q,{children:t.jsx(ee,{placeholder:"node, bun, python...",...i,value:i.value||"",className:"h-10 rounded-lg"})}),t.jsx(Z,{})]})}),t.jsx(G,{control:s.control,name:"stdio_args",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(q,{children:t.jsx(ee,{placeholder:"arg1 arg2 --flag value",...i,value:i.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(Z,{})]})})]}),t.jsx(G,{control:s.control,name:"stdio_cwd",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(q,{children:t.jsx(ee,{placeholder:"/path/to/project (optional)",...i,value:i.value||"",className:"h-10 rounded-lg"})}),t.jsx(Z,{})]})})]}),(c==="NPX"||c==="STDIO")&&t.jsx(G,{control:s.control,name:"env_vars",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(q,{children:t.jsx($t,{value:i.value??[],onChange:i.onChange})}),t.jsx(Z,{})]})}),c!=="NPX"&&c!=="STDIO"&&t.jsx(G,{control:s.control,name:"connection_token",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:u?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Yt,{children:[t.jsx(Zt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Be,{variant:"success",className:"gap-1.5",children:[t.jsx(pt,{size:12}),"Authenticated via OAuth",t.jsx(ns,{size:12})]})})}),t.jsxs(es,{align:"start",children:[t.jsxs(et,{onClick:o,children:[t.jsx(os,{size:16}),"Re-authenticate"]}),t.jsxs(et,{variant:"destructive",onClick:r,children:[t.jsx(is,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&i.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>i.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(cs,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(ee,{type:"password",placeholder:u?"Paste your GitHub PAT":"Enter access token...",...i,value:i.value||"",className:"h-10 rounded-lg"})}),u&&t.jsxs(ss,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(Z,{})]})})]})}function bs(s){const e=X.c(43),{form:n,connection:o,isMCPAuthenticated:r,hasOAuthToken:c,onReauthenticate:a,onRemoveOAuth:f}=s,{org:u}=at();let p;e[0]!==o.icon||e[1]!==o.title?(p=t.jsx(qe,{icon:o.icon,name:o.title,size:"lg",className:"shadow-sm"}),e[0]=o.icon,e[1]=o.title,e[2]=p):p=e[2];let x;e[3]!==n.control?(x=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(G,{control:n.control,name:"title",render:Ns}),t.jsx(G,{control:n.control,name:"description",render:vs})]}),e[3]=n.control,e[4]=x):x=e[4];let m;e[5]!==p||e[6]!==x?(m=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[p,x]}),e[5]=p,e[6]=x,e[7]=m):m=e[7];let i;e[8]!==o||e[9]!==n||e[10]!==c||e[11]!==a||e[12]!==f?(i=t.jsx(js,{form:n,connection:o,hasOAuthToken:c,onReauthenticate:a,onRemoveOAuth:f}),e[8]=o,e[9]=n,e[10]=c,e[11]=a,e[12]=f,e[13]=i):i=e[13];let b;e[14]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Status"}),e[14]=b):b=e[14];let d;e[15]!==r?(d=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[b,r?t.jsxs(Be,{variant:"success",className:"gap-1.5 bg-success-foreground text-success",children:[t.jsx(pt,{size:12}),"Connected"]}):t.jsx(Be,{variant:"outline",className:"text-muted-foreground",children:"Not connected"})]}),e[15]=r,e[16]=d):d=e[16];let l;e[17]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Created by"}),e[17]=l):l=e[17];let j;e[18]!==o.created_by?(j=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[l,t.jsx(as,{id:o.created_by,size:"2xs"})]}),e[18]=o.created_by,e[19]=j):j=e[19];let T;e[20]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Updated"}),e[20]=T):T=e[20];let v;e[21]!==o.updated_at?(v=o.updated_at?ps(new Date(o.updated_at),{addSuffix:!0}):"Unknown",e[21]=o.updated_at,e[22]=v):v=e[22];let y;e[23]!==v?(y=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[T,t.jsx("span",{className:"text-sm text-foreground",children:v})]}),e[23]=v,e[24]=y):y=e[24];let _;e[25]!==y||e[26]!==d||e[27]!==j?(_=t.jsxs("div",{className:"flex flex-col gap-2 p-5 border-b border-border",children:[d,j,y]}),e[25]=y,e[26]=d,e[27]=j,e[28]=_):_=e[28];let N;e[29]!==o.description||e[30]!==o.icon||e[31]!==o.id||e[32]!==o.title||e[33]!==u.slug?(N=t.jsx(gs,{connectionId:o.id,connectionTitle:o.title,connectionDescription:o.description,connectionIcon:o.icon,org:u.slug}),e[29]=o.description,e[30]=o.icon,e[31]=o.id,e[32]=o.title,e[33]=u.slug,e[34]=N):N=e[34];let h;e[35]!==_||e[36]!==N||e[37]!==m||e[38]!==i?(h=t.jsxs("div",{className:"flex flex-col h-full overflow-auto",children:[m,i,_,N]}),e[35]=_,e[36]=N,e[37]=m,e[38]=i,e[39]=h):h=e[39];let k;return e[40]!==n||e[41]!==h?(k=t.jsx(ts,{...n,children:h}),e[40]=n,e[41]=h,e[42]=k):k=e[42],k}function vs(s){const{field:e}=s;return t.jsxs(J,{className:"w-full space-y-0",children:[t.jsx(q,{children:t.jsx(ee,{...e,value:e.value||"",className:"h-auto py-0.5 text-base text-muted-foreground leading-6 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),t.jsx(Z,{})]})}function Ns(s){const{field:e}=s;return t.jsxs(J,{className:"flex-1 space-y-0",children:[t.jsx(q,{children:t.jsx(ee,{...e,className:"h-auto py-0.5 text-lg! font-medium leading-7 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Connection Name"})}),t.jsx(Z,{})]})}function ys(s){const e=X.c(42),{prompts:n,connectionId:o,org:r,connectionTitle:c,connectionIcon:a,onPromptClick:f,showToolbar:u,emptyMessage:p}=s,x=u===void 0?!0:u,m=p===void 0?"This connection doesn't have any prompts yet.":p,i=Ee(),d=ze().location.href,[l,j]=Y.useState(""),[T,v]=Y.useState("table"),[y,_]=Y.useState("name"),[N,h]=Y.useState("asc");let k;e[0]!==N||e[1]!==y?(k=S=>{y===S?(h(Ts),N==="desc"&&_(void 0)):(_(S),h("asc"))},e[0]=N,e[1]=y,e[2]=k):k=e[2];const B=k;let $;e[3]!==o||e[4]!==i||e[5]!==f||e[6]!==r?($=S=>{f?f(S):o&&r&&i({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:r,project:Se,connectionId:o,collectionName:"prompts",itemId:encodeURIComponent(S.name)}})},e[3]=o,e[4]=i,e[5]=f,e[6]=r,e[7]=$):$=e[7];const M=$;let A;if(e[8]!==n||e[9]!==l||e[10]!==N||e[11]!==y){const S=!n||n.length===0?[]:l.trim()?(()=>{const H=l.toLowerCase();return n.filter(K=>K.name.toLowerCase().includes(H)||K.description&&K.description.toLowerCase().includes(H))})():n;A=!y||!N?S:[...S].sort((H,K)=>{const se=H[y]||"",ne=K[y]||"",oe=String(se).localeCompare(String(ne));return N==="asc"?oe:-oe}),e[8]=n,e[9]=l,e[10]=N,e[11]=y,e[12]=A}else A=e[12];const I=A;let E;e[13]===Symbol.for("react.memo_cache_sentinel")?(E=[{id:"name",header:"Name",render:ws,sortable:!0},{id:"description",header:"Description",render:Ss,cellClassName:"flex-1",sortable:!0}],e[13]=E):E=e[13];const L=E;let C;e[14]===Symbol.for("react.memo_cache_sentinel")?(C=L.filter(Cs).map(_s),e[14]=C):C=e[14];const z=C;let P;e[15]!==a||e[16]!==c||e[17]!==B||e[18]!==x||e[19]!==N||e[20]!==y||e[21]!==d||e[22]!==T?(P=x&&t.jsxs(We,{children:[t.jsx(xt,{viewMode:T,onViewModeChange:v,sortKey:y,sortDirection:N,onSort:B,sortOptions:z}),t.jsx(Xe,{title:c?`${c}: Prompts`:"Prompts",url:d,icon:a??"description"})]}),e[15]=a,e[16]=c,e[17]=B,e[18]=x,e[19]=N,e[20]=y,e[21]=d,e[22]=T,e[23]=P):P=e[23];let D;e[24]===Symbol.for("react.memo_cache_sentinel")?(D=S=>{S.key==="Escape"&&(j(""),S.target.blur())},e[24]=D):D=e[24];let V;e[25]!==l?(V=t.jsx(ht,{value:l,onChange:j,placeholder:"Search prompts...",onKeyDown:D}),e[25]=l,e[26]=V):V=e[26];let g;e[27]!==m||e[28]!==M||e[29]!==B||e[30]!==l||e[31]!==N||e[32]!==y||e[33]!==I||e[34]!==T?(g=T==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:I.length===0?t.jsx(ye,{image:null,title:l?"No prompts found":"No prompts available",description:l?"Try adjusting your search terms":m}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:I.map(S=>t.jsx(gt,{className:"cursor-pointer transition-colors",onClick:()=>M(S),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(qe,{icon:null,name:S.name,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:S.name}),t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:S.description||"No description"})]})]})},S.name))})}):t.jsx(ft,{columns:L,data:I,isLoading:!1,sortKey:y,sortDirection:N,onSort:B,onRowClick:S=>M(S),emptyState:t.jsx(ye,{image:null,title:l?"No prompts found":"No prompts available",description:l?"Try adjusting your search terms":m})}),e[27]=m,e[28]=M,e[29]=B,e[30]=l,e[31]=N,e[32]=y,e[33]=I,e[34]=T,e[35]=g):g=e[35];let F;e[36]!==V||e[37]!==g?(F=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[V,g]}),e[36]=V,e[37]=g,e[38]=F):F=e[38];let O;return e[39]!==F||e[40]!==P?(O=t.jsxs(t.Fragment,{children:[P,F]}),e[39]=F,e[40]=P,e[41]=O):O=e[41],O}function _s(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function Cs(s){return s.sortable}function Ss(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function ws(s){return t.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:s.name})}function Ts(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function ks(s){const e=X.c(6),{prompts:n,connectionId:o,org:r}=s,c=Ke(o),a=c?.title,f=c?.icon;let u;return e[0]!==o||e[1]!==r||e[2]!==n||e[3]!==a||e[4]!==f?(u=t.jsx(ys,{prompts:n,connectionId:o,org:r,connectionTitle:a,connectionIcon:f}),e[0]=o,e[1]=r,e[2]=n,e[3]=a,e[4]=f,e[5]=u):u=e[5],u}function Ps(s){const e=X.c(2),{repository:n}=s;let o;return e[0]!==n?(o=t.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:t.jsx(fs,{repository:n})}),e[0]=n,e[1]=o):o=e[1],o}function Is(s){const e=X.c(39),{resources:n,connectionTitle:o,connectionIcon:r,onResourceClick:c,showToolbar:a,emptyMessage:f}=s,u=a===void 0?!0:a,p=f===void 0?"This connection doesn't have any resources yet.":f,m=ze().location.href,[i,b]=Y.useState(""),[d,l]=Y.useState("table"),[j,T]=Y.useState("name"),[v,y]=Y.useState("asc");let _;e[0]!==v||e[1]!==j?(_=g=>{j===g?(y(Rs),v==="desc"&&T(void 0)):(T(g),y("asc"))},e[0]=v,e[1]=j,e[2]=_):_=e[2];const N=_;let h;e[3]!==c?(h=g=>{c&&c(g)},e[3]=c,e[4]=h):h=e[4];const k=h;let B;if(e[5]!==n||e[6]!==i||e[7]!==v||e[8]!==j){const g=!n||n.length===0?[]:i.trim()?(()=>{const F=i.toLowerCase();return n.filter(O=>O.uri.toLowerCase().includes(F)||O.name&&O.name.toLowerCase().includes(F)||O.description&&O.description.toLowerCase().includes(F))})():n;B=!j||!v?g:[...g].sort((F,O)=>{const S=F[j]||"",H=O[j]||"",K=String(S).localeCompare(String(H));return v==="asc"?K:-K}),e[5]=n,e[6]=i,e[7]=v,e[8]=j,e[9]=B}else B=e[9];const $=B;let M;e[10]===Symbol.for("react.memo_cache_sentinel")?(M=[{id:"name",header:"Name",render:Os,sortable:!0},{id:"uri",header:"URI",render:Ds,sortable:!0},{id:"description",header:"Description",render:Ms,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:Vs,sortable:!0}],e[10]=M):M=e[10];const A=M;let I;e[11]===Symbol.for("react.memo_cache_sentinel")?(I=A.filter(As).map($s),e[11]=I):I=e[11];const E=I;let L;e[12]!==r||e[13]!==o||e[14]!==N||e[15]!==u||e[16]!==v||e[17]!==j||e[18]!==m||e[19]!==d?(L=u&&t.jsxs(We,{children:[t.jsx(xt,{viewMode:d,onViewModeChange:l,sortKey:j,sortDirection:v,onSort:N,sortOptions:E}),t.jsx(Xe,{title:o?`${o}: Resources`:"Resources",url:m,icon:r??"folder"})]}),e[12]=r,e[13]=o,e[14]=N,e[15]=u,e[16]=v,e[17]=j,e[18]=m,e[19]=d,e[20]=L):L=e[20];let C;e[21]===Symbol.for("react.memo_cache_sentinel")?(C=g=>{g.key==="Escape"&&(b(""),g.target.blur())},e[21]=C):C=e[21];let z;e[22]!==i?(z=t.jsx(ht,{value:i,onChange:b,placeholder:"Search resources...",onKeyDown:C}),e[22]=i,e[23]=z):z=e[23];let P;e[24]!==p||e[25]!==k||e[26]!==N||e[27]!==i||e[28]!==v||e[29]!==j||e[30]!==$||e[31]!==d?(P=d==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:$.length===0?t.jsx(ye,{image:null,title:i?"No resources found":"No resources available",description:i?"Try adjusting your search terms":p}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:$.map(g=>t.jsx(gt,{className:"cursor-pointer transition-colors",onClick:()=>k(g),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(qe,{icon:null,name:g.name||g.uri,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:g.name||g.uri}),t.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:g.uri}),g.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:g.description})]})]})},g.uri))})}):t.jsx(ft,{columns:A,data:$,isLoading:!1,sortKey:j,sortDirection:v,onSort:N,onRowClick:g=>k(g),emptyState:t.jsx(ye,{image:null,title:i?"No resources found":"No resources available",description:i?"Try adjusting your search terms":p})}),e[24]=p,e[25]=k,e[26]=N,e[27]=i,e[28]=v,e[29]=j,e[30]=$,e[31]=d,e[32]=P):P=e[32];let D;e[33]!==z||e[34]!==P?(D=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[z,P]}),e[33]=z,e[34]=P,e[35]=D):D=e[35];let V;return e[36]!==D||e[37]!==L?(V=t.jsxs(t.Fragment,{children:[L,D]}),e[36]=D,e[37]=L,e[38]=V):V=e[38],V}function $s(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function As(s){return s.sortable}function Vs(s){return t.jsx("span",{className:"text-sm text-muted-foreground",children:s.mimeType||"—"})}function Ms(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function Ds(s){return t.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:s.uri})}function Os(s){return t.jsx("span",{className:"text-sm font-medium text-foreground",children:s.name||s.uri})}function Rs(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function Es(s){const e=X.c(6),{resources:n,connectionId:o,org:r}=s,c=Ke(o),a=c?.title,f=c?.icon;let u;return e[0]!==o||e[1]!==r||e[2]!==n||e[3]!==a||e[4]!==f?(u=t.jsx(Is,{resources:n,connectionId:o,org:r,connectionTitle:a,connectionIcon:f}),e[0]=o,e[1]=r,e[2]=n,e[3]=a,e[4]=f,e[5]=u):u=e[5],u}const Ls=lt({key:W().min(1,"Key is required"),value:W()}),Us=lt({title:W().min(1,"Name is required"),description:W().nullable().optional(),ui_type:Ct(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:W().optional(),connection_token:W().nullable().optional(),npx_package:W().optional(),stdio_command:W().optional(),stdio_args:W().optional(),stdio_cwd:W().optional(),env_vars:Je(Ls).optional(),configuration_scopes:Je(W()).nullable().optional(),configuration_state:yt(W(),_t()).nullable().optional()}).refine(s=>s.ui_type==="NPX"?!!s.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(s=>s.ui_type==="STDIO"?!!s.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(s=>s.ui_type==="HTTP"||s.ui_type==="SSE"||s.ui_type==="Websocket"?!!s.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function Fs(s){const e=X.c(5),{tools:n,connectionId:o,org:r,isLoading:c}=s;let a;return e[0]!==o||e[1]!==c||e[2]!==r||e[3]!==n?(a=t.jsx(xs,{tools:n,connectionId:o,org:r,isLoading:c}),e[0]=o,e[1]=c,e[2]=r,e[3]=n,e[4]=a):a=e[4],a}function Bs(s){return s.command==="npx"}function zs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Xs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function Ks(s,e){const n={command:"npx",args:["-y",s]},o=mt(e);return Object.keys(o).length>0&&(n.envVars=o),n}function Ws(s,e,n,o){const r={command:s};e.trim()&&(r.args=e.trim().split(/\s+/)),n?.trim()&&(r.cwd=n.trim());const c=mt(o);return Object.keys(c).length>0&&(r.envVars=c),r}function it(s,e){const n={title:s.title,description:s.description??"",configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&It(s.connection_headers)){const o=s.connection_headers,r=At(o.envVars);if(Bs(o)){const a=zs(o);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:a,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const c=Xs(o);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:c.command,stdio_args:c.args,stdio_cwd:c.cwd,env_vars:r}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function qs(s){let e,n=null,o=null,r=null;return s.ui_type==="NPX"?(e="STDIO",n="",r=Ks(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",r=Ws(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",o=s.connection_token||null),{title:s.title,description:s.description||null,connection_type:e,connection_url:n,...o&&{connection_token:o},...r&&{connection_headers:r},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function Hs(s){const e=X.c(117),{connection:n,connectionId:o,org:r,requestedTabId:c,collections:a,onUpdate:f,isUpdating:u,prompts:p,resources:x,tools:m,isLoadingTools:i}=s;let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={from:"/$org/$project/mcps/$connectionId"},e[0]=b):b=e[0];const d=Ee(b),l=Tt(),T=ze().location.href,v=ut();let y;e[1]!==o?(y={connectionId:o},e[1]=o,e[2]=y):y=e[2];const _=Ot(y),h=n?.connection_type==="VIRTUAL"||_.isAuthenticated;let k;e[3]!==n?(k={connections:[n],binding:"MCP"},e[3]=n,e[4]=k):k=e[4];const $=Dt(k).length>0,M=n?.metadata?.repository,A=!!M?.url;let I;e[5]===Symbol.for("react.memo_cache_sentinel")?(I=kt(Us),e[5]=I):I=e[5];let E;e[6]!==n?(E=it(n),e[6]=n,e[7]=E):E=e[7];let L;e[8]!==E?(L={resolver:I,values:E},e[8]=E,e[9]=L):L=e[9];const C=Pt(L),z=C.formState.isDirty;let P;e[10]!==C||e[11]!==f?(P=async()=>{if(!await C.trigger())return;const U=C.getValues(),Ne=qs(U);await f(Ne),C.reset(U)},e[10]=C,e[11]=f,e[12]=P):P=e[12];const D=P;let V;e[13]!==n||e[14]!==C?(V=()=>{C.reset(it(n))},e[13]=n,e[14]=C,e[15]=V):V=e[15];const g=V;let F;e[16]!==n.id||e[17]!==v||e[18]!==l?(F=async()=>{const{token:w,tokenInfo:U,error:Ne}=await Bt({connectionId:n.id});if(Ne||!w){Ce.error(`Authentication failed: ${Ne}`);return}if(U)try{const De=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:U.accessToken,refreshToken:U.refreshToken,expiresIn:U.expiresIn,scope:U.scope,clientId:U.clientId,clientSecret:U.clientSecret,tokenEndpoint:U.tokenEndpoint})});if(!De.ok)console.error("Failed to save OAuth token:",await De.text()),await v.update.mutateAsync({id:n.id,data:{connection_token:w}});else try{await v.update.mutateAsync({id:n.id,data:{}})}catch(Qe){console.warn("Failed to refresh connection tools after OAuth:",Qe)}}catch(De){console.error("Error saving OAuth token:",De),await v.update.mutateAsync({id:n.id,data:{connection_token:w}})}else await v.update.mutateAsync({id:n.id,data:{connection_token:w}});const bt=new URL(`/mcp/${n.id}`,window.location.origin);await l.invalidateQueries({queryKey:Ye.isMCPAuthenticated(bt.href,null)}),Ce.success("Authentication successful")},e[16]=n.id,e[17]=v,e[18]=l,e[19]=F):F=e[19];const O=F;let S;e[20]!==n.id||e[21]!==l?(S=async()=>{try{const w=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!w.ok){const Ne=await w.text();Ce.error(`Failed to remove OAuth: ${Ne}`);return}const U=new URL(`/mcp/${n.id}`,window.location.origin);await l.invalidateQueries({queryKey:Ye.isMCPAuthenticated(U.href,null)}),Ce.success("OAuth removed. You can now re-authenticate with a different account.")}catch(w){console.error("Error removing OAuth token:",w),Ce.error("Failed to remove OAuth")}},e[20]=n.id,e[21]=l,e[22]=S):S=e[22];const H=S,K=m.length,se=p.length,ne=x.length,oe=K>0||i;let we;e[23]===Symbol.for("react.memo_cache_sentinel")?(we={id:"settings",label:"Settings"},e[23]=we):we=e[23];let re;e[24]!==i||e[25]!==h||e[26]!==oe||e[27]!==K?(re=h&&oe?[{id:"tools",label:"Tools",count:i?void 0:K}]:[],e[24]=i,e[25]=h,e[26]=oe,e[27]=K,e[28]=re):re=e[28];let ie;e[29]!==h||e[30]!==se?(ie=h&&se>0?[{id:"prompts",label:"Prompts",count:se}]:[],e[29]=h,e[30]=se,e[31]=ie):ie=e[31];let ce;e[32]!==h||e[33]!==ne?(ce=h&&ne>0?[{id:"resources",label:"Resources",count:ne}]:[],e[32]=h,e[33]=ne,e[34]=ce):ce=e[34];let Te;if(e[35]!==a||e[36]!==A||e[37]!==h||e[38]!==re||e[39]!==ie||e[40]!==ce){let w;e[42]!==A?(w=A?[{id:"readme",label:"README"}]:[],e[42]=A,e[43]=w):w=e[43],Te=[we,...re,...ie,...ce,...h?(a||[]).map(Gs):[],...w],e[35]=a,e[36]=A,e[37]=h,e[38]=re,e[39]=ie,e[40]=ce,e[41]=Te}else Te=e[41];const _e=Te,jt=h&&_e.some(Qs)?"tools":"settings",R=_e.some(w=>w.id===c)?c:jt;let ke;e[44]!==d?(ke=w=>{d({search:U=>({...U,tab:w}),replace:!0})},e[44]=d,e[45]=ke):ke=e[45];const ae=ke;let le;e[46]!==a?(le=a||[],e[46]=a,e[47]=le):le=e[47];let Pe;if(e[48]!==R||e[49]!==le){let w;e[51]!==R?(w=U=>U.name===R,e[51]=R,e[52]=w):w=e[52],Pe=le.find(w),e[48]=R,e[49]=le,e[50]=Pe}else Pe=e[50];const Ie=Pe;let de;e[53]!==r?(de=t.jsx(Ze,{children:t.jsx(Xt,{asChild:!0,children:t.jsx(ct,{to:"/$org/$project/mcps",params:{org:r,project:Se},children:"Connections"})})}),e[53]=r,e[54]=de):de=e[54];let $e;e[55]===Symbol.for("react.memo_cache_sentinel")?($e=t.jsx(Kt,{}),e[55]=$e):$e=e[55];let me;e[56]!==n.title?(me=t.jsx(Ze,{children:t.jsx(zt,{children:n.title})}),e[56]=n.title,e[57]=me):me=e[57];let Ae;e[58]!==de||e[59]!==me?(Ae=t.jsx(Wt,{children:t.jsxs(qt,{children:[de,$e,me]})}),e[58]=de,e[59]=me,e[60]=Ae):Ae=e[60];const Le=Ae;let ue;e[61]!==D||e[62]!==g||e[63]!==z||e[64]!==u?(ue=t.jsx(Vt,{onSave:D,onUndo:g,isDirty:z,isSaving:u}),e[61]=D,e[62]=g,e[63]=z,e[64]=u,e[65]=ue):ue=e[65];const Ue=n.icon??"settings";let pe;e[66]!==n.title||e[67]!==Ue||e[68]!==T?(pe=t.jsx(Xe,{title:n.title,url:T,icon:Ue}),e[66]=n.title,e[67]=Ue,e[68]=T,e[69]=pe):pe=e[69];let fe;e[70]!==ue||e[71]!==pe?(fe=t.jsxs(We,{children:[ue,pe]}),e[70]=ue,e[71]=pe,e[72]=fe):fe=e[72];let xe;e[73]!==_.hasOAuthToken||e[74]!==n||e[75]!==C||e[76]!==O||e[77]!==H||e[78]!==h?(xe=t.jsx("div",{className:"w-100 shrink-0 border-r border-border bg-background",children:t.jsx(bs,{form:C,connection:n,isMCPAuthenticated:h,hasOAuthToken:_.hasOAuthToken,onReauthenticate:O,onRemoveOAuth:H})}),e[73]=_.hasOAuthToken,e[74]=n,e[75]=C,e[76]=O,e[77]=H,e[78]=h,e[79]=xe):xe=e[79];let he;e[80]!==R||e[81]!==ae||e[82]!==_e?(he=t.jsx("div",{className:"shrink-0 flex items-center gap-4 px-5 py-3 border-b border-border",children:t.jsx(Ht,{tabs:_e,activeTab:R,onTabChange:ae,className:"flex-1"})}),e[80]=R,e[81]=ae,e[82]=_e,e[83]=he):he=e[83];let Ve;e[84]===Symbol.for("react.memo_cache_sentinel")?(Ve=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Re,{size:32,className:"animate-spin text-muted-foreground"})}),e[84]=Ve):Ve=e[84];let ge;e[85]!==Ie||e[86]!==R||e[87]!==_.isServerError||e[88]!==_.supportsOAuth||e[89]!==n||e[90]!==o||e[91]!==C||e[92]!==O||e[93]!==ae||e[94]!==$||e[95]!==A||e[96]!==i||e[97]!==h||e[98]!==r||e[99]!==p||e[100]!==M||e[101]!==x||e[102]!==m?(ge=t.jsx(Y.Suspense,{fallback:Ve,children:R==="tools"?t.jsx(Fs,{tools:m,connectionId:o,org:r,isLoading:i}):R==="prompts"?t.jsx(ks,{prompts:p,connectionId:o,org:r}):R==="resources"?t.jsx(Es,{resources:x,connectionId:o,org:r}):R==="settings"?t.jsx(Rt,{connection:n,form:C,hasMcpBinding:$,isMCPAuthenticated:h,supportsOAuth:_.supportsOAuth,isServerError:_.isServerError,onAuthenticate:O,onViewReadme:A?()=>ae("readme"):void 0}):R==="readme"&&A?t.jsx(Ps,{repository:M}):Ie&&h?t.jsx(Gt,{connectionId:o,org:r,activeCollection:Ie},R):t.jsx(ye,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[85]=Ie,e[86]=R,e[87]=_.isServerError,e[88]=_.supportsOAuth,e[89]=n,e[90]=o,e[91]=C,e[92]=O,e[93]=ae,e[94]=$,e[95]=A,e[96]=i,e[97]=h,e[98]=r,e[99]=p,e[100]=M,e[101]=x,e[102]=m,e[103]=ge):ge=e[103];let je;e[104]!==R||e[105]!==ge?(je=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(dt,{children:ge},R)}),e[104]=R,e[105]=ge,e[106]=je):je=e[106];let be;e[107]!==he||e[108]!==je?(be=t.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:[he,je]}),e[107]=he,e[108]=je,e[109]=be):be=e[109];let ve;e[110]!==xe||e[111]!==be?(ve=t.jsxs("div",{className:"flex h-full w-full bg-background overflow-hidden",children:[xe,be]}),e[110]=xe,e[111]=be,e[112]=ve):ve=e[112];let Me;return e[113]!==Le||e[114]!==fe||e[115]!==ve?(Me=t.jsxs(Qt,{breadcrumb:Le,children:[fe,ve]}),e[113]=Le,e[114]=fe,e[115]=ve,e[116]=Me):Me=e[116],Me}function Qs(s){return s.id==="tools"}function Gs(s){return{id:s.name,label:s.displayName}}function Js(){const s=X.c(43);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/$project/mcps/$connectionId"},s[0]=e):e=s[0];const n=Ee(e);let o;s[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/$project/mcps/$connectionId"},s[1]=o):o=s[1];const{connectionId:r,org:c}=St(o),{org:a}=at();let f;s[2]===Symbol.for("react.memo_cache_sentinel")?(f={from:"/shell/$org/$project/mcps/$connectionId"},s[2]=f):f=s[2];const p=wt(f).tab??"",x=Ke(r),m=ut(),i=Mt(x??void 0);let b;s[3]!==r||s[4]!==a.id?(b={connectionId:r,orgId:a.id},s[3]=r,s[4]=a.id,s[5]=b):b=s[5];const d=Et(b);let l;s[6]!==d?(l={client:d},s[6]=d,s[7]=l):l=s[7];const{data:j}=Ut(l);let T;s[8]!==d?(T={client:d},s[8]=d,s[9]=T):T=s[9];const{data:v}=Ft(T),_=!(x?.connection_type==="VIRTUAL")&&x?.tools&&x.tools.length>0,N=!_;let h;s[10]!==d||s[11]!==N?(h={client:d,enabled:N},s[10]=d,s[11]=N,s[12]=h):h=s[12];const{data:k,isLoading:B}=Lt(h);let $;s[13]!==j?.prompts?($=j?.prompts??[],s[13]=j?.prompts,s[14]=$):$=s[14];let M;s[15]!==$?(M=$.map(en),s[15]=$,s[16]=M):M=s[16];const A=M;let I;s[17]!==v?.resources?(I=v?.resources??[],s[17]=v?.resources,s[18]=I):I=s[18];let E;s[19]!==I?(E=I.map(Zs),s[19]=I,s[20]=E):E=s[20];const L=E;let C;s[21]!==x||s[22]!==_||s[23]!==k?.tools?(C=_?x.tools??[]:(k?.tools??[]).map(Ys),s[21]=x,s[22]=_,s[23]=k?.tools,s[24]=C):C=s[24];const z=C;let P;s[25]!==m.update||s[26]!==r?(P=async g=>{await m.update.mutateAsync({id:r,data:g})},s[25]=m.update,s[26]=r,s[27]=P):P=s[27];const D=P;if(!x){let g;return s[28]!==n||s[29]!==c?(g=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ye,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(Fe,{variant:"outline",onClick:()=>n({to:"/$org/$project/mcps",params:{org:c,project:Se}}),children:"Back to connections"})})}),s[28]=n,s[29]=c,s[30]=g):g=s[30],g}let V;return s[31]!==m.update.isPending||s[32]!==i||s[33]!==x||s[34]!==r||s[35]!==D||s[36]!==B||s[37]!==c||s[38]!==A||s[39]!==p||s[40]!==L||s[41]!==z?(V=t.jsx(Hs,{org:c,connection:x,connectionId:r,requestedTabId:p,collections:i,onUpdate:D,isUpdating:m.update.isPending,prompts:A,resources:L,tools:z,isLoadingTools:B}),s[31]=m.update.isPending,s[32]=i,s[33]=x,s[34]=r,s[35]=D,s[36]=B,s[37]=c,s[38]=A,s[39]=p,s[40]=L,s[41]=z,s[42]=V):V=s[42],V}function Ys(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema}}function Zs(s){return{uri:s.uri,name:s.name,description:s.description}}function en(s){return{name:s.name,description:s.description}}function tn(){const s=X.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(dt,{children:t.jsx(Y.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Re,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Js,{})})}),s[0]=e):e=s[0],e}function Lo(){const s=X.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(tn,{}),s[0]=e):e=s[0],e}export{Lo as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as de,j as e,r as R,u as Ce,m as be,f as ke,g as Ne,ad as we,k as Se,h as De,i as Pe,O as h,o as me,ae as Te,s as v,af as Ie}from"./index-BV-rIyOx.js";import{g as $e}from"./generate-id-Dyweu44Y.js";import{C as Ve,a as Ae}from"./collection-table-wrapper-CmBNNf0K.js";import{C as Ee}from"./collection-search-Aeh0FXZR.js";import{C as Me}from"./connection-card-ChzuU2dT.js";import{B as F}from"./badge-BFm6jM0d.js";import{i as Oe}from"./AlertCircle-BOIQEKjW.js";import{i as Be}from"./CheckCircle-ZkjIkaWv.js";import{E as H}from"./empty-state-oU8PNga_.js";import{E as Fe}from"./error-boundary-D7C5xzme.js";import{n as z,I as He}from"./integration-icon-DKM9NBX1.js";import{P as I}from"./index-9vOB29ZB.js";import{u as ze,U as ee,s as te}from"./use-list-state-DjV5kR97.js";import{u as Ue}from"./use-binding-BVOuBiur.js";import{f as Re,e as Le}from"./registry-utils-CqOx6XXE.js";import{f as Xe,a as We,b as Ke,c as Ge,d as qe,e as Ye,A as Je,g as Qe}from"./alert-dialog-B4H6MrIT.js";import{B as Ze,a as et,b as tt,c as nt}from"./breadcrumb-Cvo4WJJ5.js";import{B as C}from"./button-Cl3WMTWk.js";import{D as st,a as ot,b as rt,c as it,d as at,e as ct}from"./dialog-BmGDp4UV.js";import{D as ne,a as se,b as oe,c as E}from"./dropdown-menu-6IaHSzwJ.js";import{a as lt,F as x,b as g,c as f,d as j,f as y}from"./form-qYB4UriD.js";import{I as k}from"./input-Dv5qvD5N.js";import{S as dt,a as mt,b as ut,c as pt,d as $}from"./select-ODRW9YrY.js";import{T as ht}from"./textarea-DK_SwVx9.js";import{g as xt,h as gt}from"./use-connection-B8DnjeO8.js";import{u as ft}from"./constants-1q3hobyw.js";import{b as jt}from"./use-mcp-tools-CXMetymP.js";import{i as re}from"./DotsVertical-DMOP2SMU.js";import{s as U}from"./Globe02-CwdZK2H5.js";import{i as yt}from"./Loading01-DOPFYU4m.js";import{i as vt}from"./Terminal-CrrxpXUI.js";import{s as ie}from"./Trash01-C-euKa34.js";import{r as _t,E as Ct,e as ue}from"./env-vars-editor-Bmnp2cvo.js";import{d as bt}from"./differenceInSeconds-NQ4PDo0z.js";import"./ArrowUp-BRclUYsx.js";import"./Check-Bkb61eVw.js";import"./Grid01-zbmmdox0.js";import"./List-BvAv-Mbv.js";import"./view-mode-toggle-CHHKGadJ.js";import"./utils-CfR4kXxZ.js";import"./table-BBnlXDKe.js";import"./SearchMd-Ds-ERWzq.js";import"./card-B-73zAje.js";import"./index-BYzsWn1B.js";import"./avatar-B-AS-16N.js";import"./useQuery-DDYln2BW.js";import"./use-mobile-B2CDnK8i.js";import"./binder-C4CQlgMb.js";import"./ChevronRight-BBcOJkyP.js";import"./X-DUGfq2_H.js";import"./ChevronDown-DqJTvBdv.js";import"./useMutation-BOrtlNTb.js";import"./Plus-WaQ7hmj5.js";function ae(s){const n=de.c(3),{status:i}=s;if(i==="active"){let c;return n[0]===Symbol.for("react.memo_cache_sentinel")?(c=e.jsxs(F,{variant:"success",className:"gap-1.5 text-success border-success/40 bg-background",children:[e.jsx(Be,{size:12}),"Active"]}),n[0]=c):c=n[0],c}if(i==="error"){let c;return n[1]===Symbol.for("react.memo_cache_sentinel")?(c=e.jsxs(F,{variant:"outline",className:"gap-1.5 text-destructive border-destructive/40 bg-background",children:[e.jsx(Oe,{size:12}),"Error"]}),n[1]=c):c=n[1],c}let d;return n[2]===Symbol.for("react.memo_cache_sentinel")?(d=e.jsx(F,{variant:"outline",className:"text-muted-foreground",children:"Inactive"}),n[2]=d):d=n[2],d}function ce(s){const n=bt(new Date,s);return n<60?"<1m":n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:n<604800?`${Math.floor(n/86400)}d ago`:n<2592e3?`${Math.floor(n/604800)}w ago`:n<31536e3?`${Math.floor(n/2592e3)}mo ago`:`${Math.floor(n/31536e3)}y ago`}const kt=me({key:v(),value:v()}),Nt=me({title:v().min(1,"Name is required"),description:v().nullable().optional(),ui_type:Ie(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:v().optional(),connection_token:v().nullable().optional(),npx_package:v().optional(),stdio_command:v().optional(),stdio_args:v().optional(),stdio_cwd:v().optional(),env_vars:Te(kt).optional()}).refine(s=>s.ui_type==="NPX"?!!s.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(s=>s.ui_type==="STDIO"?!!s.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(s=>s.ui_type==="HTTP"||s.ui_type==="SSE"||s.ui_type==="Websocket"?!!s.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function O(s){const n=s.trim();if(!n)return"";try{const i=new URL(n),d=i.pathname.length>1?i.pathname.replace(/\/+$/,""):i.pathname;return`${i.origin}${d}`}catch{return n.replace(/\/+$/,"")}}function wt(s){const n=s.trim().split(/\s+/).filter(Boolean);if(n.length<2)return null;const i=n[0]?.toLowerCase();if(i!=="npx"&&i!=="bunx")return null;const c=n.slice(1).find(a=>!a.startsWith("-"));return c?{packageName:c}:null}function M(s){const{uiType:n}=s,i=O(s.connectionUrl??"");if((n==="HTTP"||n==="SSE"||n==="Websocket")&&i===O("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const d=(s.npxPackage??"").trim();return n==="NPX"&&d==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function le(s){if(s.registryItems.length===0||s.uiType!=="HTTP"&&s.uiType!=="SSE"&&s.uiType!=="Websocket")return null;const n=O(s.connectionUrl??"");if(!n)return null;const i=s.registryItems.find(a=>(a.server?.remotes??[]).some(N=>O(N.url??"")===n));if(!i)return null;const d=i.title||i.name||i.server?.title||i.server?.name||"",c=i.server?.description||i.description||i.summary||null;return d?{id:"registry",title:d,description:c}:null}function St(s,n){const i={command:"npx",args:["-y",s]},d=ue(n);return Object.keys(d).length>0&&(i.envVars=d),i}function Dt(s,n,i,d){const c={command:s};n.trim()&&(c.args=n.trim().split(/\s+/)),i?.trim()&&(c.cwd=i.trim());const a=ue(d);return Object.keys(a).length>0&&(c.envVars=a),c}function Pt(s){return s.command==="npx"}function Tt(s){return s.args?.find(n=>!n.startsWith("-"))??""}function It(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function $t(s,n){switch(n.type){case"edit":return{mode:"editing",connection:n.connection};case"delete":return{mode:"deleting",connection:n.connection};case"close":return{mode:"idle"}}}function Vt(){const{org:s}=Ce(),n=be(),i=ke({strict:!1}),{data:d}=Ne.useSession(),{stdioEnabled:c}=we(),a=ze({namespace:s.slug,resource:"connections"}),V=xt(),N=gt(a),[_,w]=R.useReducer($t,{mode:"idle"}),L=Ue(N)[0],X=L?.id??"",W=Re(L?.tools),pe=ft({connectionId:X||null,orgId:s.id}),{data:he}=jt({client:pe,toolName:W,toolArguments:{limit:200},enabled:!!(X&&W),staleTime:3600*1e3,select:t=>t.structuredContent??t}),K=Le(he??[]),G=i.action==="create",xe=()=>{n({to:"/$org/$project/mcps",params:{org:s.slug,project:h},search:{action:"create"}})},q=()=>{n({to:"/$org/$project/mcps",params:{org:s.slug,project:h},search:{}})},r=Se({resolver:De(Nt),defaultValues:{title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),u=r.watch("ui_type"),Y=r.watch("connection_url"),ge=r.watch("npx_package"),P=M({uiType:u,connectionUrl:Y??"",npxPackage:ge??""})??le({uiType:u,connectionUrl:Y??"",registryItems:K}),m=_.mode==="editing"?_.connection:null;R.useEffect(()=>{if(m){const t=Pe(m.connection_headers)?m.connection_headers:null;if(t&&m.connection_type==="STDIO"){const o=_t(t.envVars);if(Pt(t)){const l=Tt(t);r.reset({title:m.title,description:m.description,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:o})}else{const l=It(t);r.reset({title:m.title,description:m.description,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:l.command,stdio_args:l.args,stdio_cwd:l.cwd,env_vars:o})}}else r.reset({title:m.title,description:m.description,ui_type:m.connection_type,connection_url:m.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})}else r.reset({title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})},[m,r]);const fe=async()=>{if(_.mode!=="deleting")return;const t=_.connection.id;w({type:"close"});try{await V.delete.mutateAsync(t)}catch{}},je=async t=>{let o,l=null,S=null,b=null;if(t.ui_type==="NPX"?(o="STDIO",l="",b=St(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(o="STDIO",l="",b=Dt(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(o=t.ui_type,l=t.connection_url||"",S=t.connection_token||null),m){await V.update.mutateAsync({id:m.id,data:{title:t.title,description:t.description||null,connection_type:o,connection_url:l,...S&&{connection_token:S},...b&&{connection_headers:b}}}),w({type:"close"}),r.reset();return}const D=$e("conn");await V.create.mutateAsync({id:D,title:t.title,description:t.description||null,connection_type:o,connection_url:l,connection_token:S,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:d?.user?.id||"system",organization_id:s.id,icon:null,app_name:null,app_id:null,connection_headers:b,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),q(),r.reset(),n({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:h,connectionId:D}})},J=t=>{t||(G?q():w({type:"close"}),r.reset())},A=t=>{const o=t.trim();if(!o)return;const l=!!r.formState.dirtyFields.title,S=!!r.formState.dirtyFields.description,b=!!r.formState.dirtyFields.env_vars,D=p=>{if(p&&(!l&&!r.getValues("title").trim()&&p.title&&r.setValue("title",p.title,{shouldDirty:!1}),!S&&!(r.getValues("description")??"").trim()&&p.description&&r.setValue("description",p.description,{shouldDirty:!1}),!b&&p.envVarKeys?.length)){const Q=r.getValues("env_vars")??[],_e=new Set(Q.map(T=>T.key)),Z=p.envVarKeys.filter(T=>!_e.has(T));Z.length>0&&r.setValue("env_vars",[...Q,...Z.map(T=>({key:T,value:""}))],{shouldDirty:!0})}},B=wt(o);if(B&&c){r.setValue("ui_type","NPX",{shouldDirty:!0}),r.setValue("npx_package",B.packageName,{shouldDirty:!0}),r.setValue("connection_url","",{shouldDirty:!0}),r.setValue("connection_token",null,{shouldDirty:!0}),D(M({uiType:"NPX",npxPackage:B.packageName}));return}if(o.startsWith("http://")||o.startsWith("https://")){const p=u==="HTTP"||u==="SSE"||u==="Websocket"?u:"HTTP";r.setValue("ui_type",p,{shouldDirty:!0}),r.setValue("connection_url",o,{shouldDirty:!0}),D(M({uiType:p,connectionUrl:o})??le({uiType:p,connectionUrl:o,registryItems:K}));return}u==="NPX"&&D(M({uiType:"NPX",npxPackage:o}))},ye=[{id:"title",header:"Name",render:t=>e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(He,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:e.jsx(z,{})}),e.jsx("span",{className:"text-sm font-medium text-foreground truncate block",title:t.title,children:t.title})]}),cellClassName:"w-32 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:t=>e.jsx("span",{className:"text-sm text-muted-foreground truncate block",title:t.description||"",children:t.description||"—"}),cellClassName:"flex-1 min-w-0 max-w-0",wrap:!1,sortable:!0},{id:"connection_type",header:"Type",accessor:t=>e.jsx("span",{className:"text-xs font-medium",children:t.connection_type}),cellClassName:"w-16 shrink-0",sortable:!0},{id:"status",header:"Status",render:t=>e.jsx(ae,{status:t.status}),cellClassName:"w-28 shrink-0",sortable:!1},{id:"updated_by",header:"Updated by",render:t=>e.jsx(ee,{id:t.updated_by??t.created_by,size:"3xs"}),cellClassName:"w-32 shrink-0",sortable:!0},{id:"updated_at",header:"Updated",render:t=>e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:t.updated_at?ce(new Date(t.updated_at)):"—"}),cellClassName:"max-w-24 w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:t=>e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,children:e.jsx(C,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:e.jsx(re,{size:20})})}),e.jsxs(oe,{align:"end",onClick:o=>o.stopPropagation(),children:[e.jsxs(E,{onClick:o=>{o.stopPropagation(),n({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:h,connectionId:t.id}})},children:[e.jsx(te,{size:16}),"Open"]}),e.jsxs(E,{variant:"destructive",onClick:o=>{o.stopPropagation(),w({type:"delete",connection:t})},children:[e.jsx(ie,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],ve=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(C,{variant:"outline",onClick:()=>n({to:"/$org/$project/store",params:{org:s.slug,project:h}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e.jsx(C,{onClick:xe,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})]});return e.jsxs(I,{children:[e.jsx(st,{open:G||_.mode==="editing",onOpenChange:J,children:e.jsxs(ot,{className:"sm:max-w-[525px]",children:[e.jsxs(rt,{children:[e.jsx(it,{children:m?"Edit Connection":"Create Connection"}),e.jsx(at,{children:m?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),e.jsx(lt,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(je),children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsx(x,{control:r.control,name:"ui_type",render:({field:t})=>e.jsxs(g,{children:[e.jsx(f,{children:"Type *"}),e.jsxs(dt,{value:t.value,onValueChange:t.onChange,children:[e.jsx(j,{children:e.jsx(mt,{children:e.jsx(ut,{})})}),e.jsxs(pt,{children:[e.jsx($,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(U,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx($,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(U,{className:"w-4 h-4"}),"SSE"]})}),e.jsx($,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(U,{className:"w-4 h-4"}),"Websocket"]})}),c&&e.jsxs(e.Fragment,{children:[e.jsx($,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx($,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(vt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(y,{})]})}),u==="NPX"&&e.jsx(e.Fragment,{children:e.jsx(x,{control:r.control,name:"npx_package",render:({field:t})=>e.jsxs(g,{children:[e.jsx(f,{children:"NPM Package *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"@perplexity-ai/mcp-server",...t,value:t.value??"",onPaste:o=>{const l=o.clipboardData.getData("text");l&&(o.preventDefault(),r.setValue("npx_package",l.trim(),{shouldDirty:!0}),A(l))},onBlur:o=>{A(o.target.value),t.onBlur()}})}),e.jsx(y,{})]})})}),u==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(x,{control:r.control,name:"stdio_command",render:({field:t})=>e.jsxs(g,{children:[e.jsx(f,{children:"Command *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"node, bun, python...",...t,value:t.value??""})}),e.jsx(y,{})]})}),e.jsx(x,{control:r.control,name:"stdio_args",render:({field:t})=>e.jsxs(g,{children:[e.jsx(f,{children:"Arguments"}),e.jsx(j,{children:e.jsx(k,{placeholder:"arg1 arg2 --flag value",...t,value:t.value??""})}),e.jsx(y,{})]})})]}),e.jsx(x,{control:r.control,name:"stdio_cwd",render:({field:t})=>e.jsxs(g,{children:[e.jsx(f,{children:"Working Directory"}),e.jsx(j,{children:e.jsx(k,{placeholder:"/path/to/project (optional)",...t,value:t.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(y,{})]})})]}),(u==="NPX"||u==="STDIO")&&e.jsx(x,{control:r.control,name:"env_vars",render:({field:t})=>e.jsxs(g,{children:[e.jsx(f,{children:"Environment Variables"}),e.jsx(j,{children:e.jsx(Ct,{value:t.value??[],onChange:t.onChange})}),e.jsx(y,{})]})}),u!=="NPX"&&u!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(x,{control:r.control,name:"connection_url",render:({field:t})=>e.jsxs(g,{children:[e.jsx(f,{children:"URL *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"https://example.com/mcp",...t,value:t.value??"",onPaste:o=>{const l=o.clipboardData.getData("text");l&&(o.preventDefault(),r.setValue("connection_url",l.trim(),{shouldDirty:!0}),A(l))},onBlur:o=>{A(o.target.value),t.onBlur()}})}),e.jsx(y,{})]})}),e.jsx(x,{control:r.control,name:"connection_token",render:({field:t})=>e.jsxs(g,{children:[e.jsx(f,{children:P?.token?.label??"Token (optional)"}),e.jsx(j,{children:e.jsx(k,{type:"password",placeholder:P?.token?.placeholder??"Bearer token or API key",...t,value:t.value??""})}),P?.token?.helperText&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[P.token.helperText,P.id==="github"&&e.jsxs(e.Fragment,{children:[" ","·"," ",e.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),e.jsx(y,{})]})})]}),e.jsx(x,{control:r.control,name:"title",render:({field:t})=>e.jsxs(g,{children:[e.jsx(f,{children:"Name *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"My Connection",...t})}),e.jsx(y,{})]})}),e.jsx(x,{control:r.control,name:"description",render:({field:t})=>e.jsxs(g,{children:[e.jsx(f,{children:"Description"}),e.jsx(j,{children:e.jsx(ht,{placeholder:"A brief description of this connection",rows:3,...t,value:t.value??""})}),e.jsx(y,{})]})})]}),e.jsxs(ct,{children:[e.jsx(C,{type:"button",variant:"outline",onClick:()=>J(!1),children:"Cancel"}),e.jsx(C,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:r.formState.isSubmitting?"Saving...":m?"Update Connection":"Create Connection"})]})]})})]})}),e.jsx(Xe,{open:_.mode==="deleting",onOpenChange:t=>!t&&w({type:"close"}),children:e.jsxs(We,{children:[e.jsxs(Ke,{children:[e.jsx(Ge,{children:"Delete Connection?"}),e.jsxs(qe,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:_.mode==="deleting"&&_.connection.title}),"."]})]}),e.jsxs(Ye,{children:[e.jsx(Je,{children:"Cancel"}),e.jsx(Qe,{onClick:fe,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),e.jsxs(I.Header,{children:[e.jsx(I.Header.Left,{children:e.jsx(Ze,{children:e.jsx(et,{children:e.jsx(tt,{children:e.jsx(nt,{children:"Connections"})})})})}),e.jsxs(I.Header.Right,{children:[e.jsx(Ve,{viewMode:a.viewMode,onViewModeChange:a.setViewMode,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}]}),ve]})]}),e.jsx(Ee,{value:a.search,onChange:a.setSearch,placeholder:"Search for a Connection...",onKeyDown:t=>{t.key==="Escape"&&(a.setSearch(""),t.target.blur())}}),e.jsx(I.Content,{children:a.viewMode==="cards"?e.jsx("div",{className:"flex-1 overflow-auto p-5",children:N.length===0?e.jsx(H,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:(a.search,"No Connections found"),description:a.search?`No Connections match "${a.search}"`:"Create a connection to get started.",actions:!a.search&&e.jsx(C,{variant:"outline",onClick:()=>n({to:"/$org/$project/store",params:{org:s.slug,project:h}}),children:"Browse Store"})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:N.map(t=>e.jsx(Me,{connection:t,fallbackIcon:e.jsx(z,{}),onClick:()=>n({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:h,connectionId:t.id}}),headerActions:e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,children:e.jsx(C,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:e.jsx(re,{size:20})})}),e.jsxs(oe,{align:"end",onClick:o=>o.stopPropagation(),children:[e.jsxs(E,{onClick:o=>{o.stopPropagation(),n({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:h,connectionId:t.id}})},children:[e.jsx(te,{size:16}),"Open"]}),e.jsxs(E,{variant:"destructive",onClick:o=>{o.stopPropagation(),w({type:"delete",connection:t})},children:[e.jsx(ie,{size:16}),"Delete"]})]})]}),body:e.jsx(ae,{status:t.status}),footer:e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground w-full min-w-0",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(ee,{id:t.updated_by??t.created_by,size:"3xs"})}),e.jsx("span",{className:"shrink-0 ml-2",children:t.updated_at?ce(new Date(t.updated_at)):"—"})]})},t.id))})}):e.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:e.jsx("div",{className:"flex-1 overflow-auto min-w-0",children:e.jsx("div",{className:"min-w-[1000px]",children:e.jsx(Ae,{columns:ye,data:N,isLoading:!1,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,onRowClick:t=>n({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:h,connectionId:t.id}}),emptyState:a.search?e.jsx(H,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:`No Connections match "${a.search}"`}):e.jsx(H,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:"Create a connection to get started.",actions:e.jsx(C,{variant:"outline",onClick:()=>n({to:"/$org/$project/store",params:{org:s.slug,project:h}}),children:"Browse Store"})})})})})})})]})}function An(){const s=de.c(1);let n;return s[0]===Symbol.for("react.memo_cache_sentinel")?(n=e.jsx(Fe,{children:e.jsx(R.Suspense,{fallback:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(yt,{size:32,className:"animate-spin text-muted-foreground"})}),children:e.jsx(Vt,{})})}),s[0]=n):n=s[0],n}export{An as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as t,G as a}from"./index-BV-rIyOx.js";const e=t(a,{target:"draft-7"});export{e as B};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as k,j as e,u as A,m as L,v as R,r as z,k as M,t as B,K as T,O as j,o as V,s as f}from"./index-BV-rIyOx.js";import{u as $}from"./useMutation-BOrtlNTb.js";import{u as q,a as O}from"./constants-1q3hobyw.js";import{D as K,a as U,b as G,c as J,d as Q,e as Y}from"./dialog-BmGDp4UV.js";import{B as D}from"./button-Cl3WMTWk.js";import{a as H,L as W,F as v,b as F,c as N,d as S,f as w}from"./form-qYB4UriD.js";import{I}from"./input-Dv5qvD5N.js";import{T as X}from"./textarea-DK_SwVx9.js";import{i as Z}from"./Check-Bkb61eVw.js";import{c as ee}from"./utils-CfR4kXxZ.js";function se(l){return l.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function _(l){return/^[a-z0-9-]+$/.test(l)&&l.length>0&&l.length<=100}const te=["#3B82F6","#8B5CF6","#EC4899","#EF4444","#F97316","#EAB308","#22C55E","#14B8A6","#06B6D4","#6366F1","#64748B","#000000"];function re(l){const s=k.c(16),{value:n,onChange:i}=l;let c;s[0]!==i||s[1]!==n?(c=te.map(o=>e.jsx("button",{type:"button",onClick:()=>i(o),className:ee("size-8 rounded-lg transition-all",n===o&&"ring-2 ring-offset-2 ring-primary"),style:{backgroundColor:o},children:n===o&&e.jsx(Z,{className:"size-4 text-white mx-auto"})},o)),s[0]=i,s[1]=n,s[2]=c):c=s[2];let u;s[3]!==c?(u=e.jsx("div",{className:"grid grid-cols-6 gap-2",children:c}),s[3]=c,s[4]=u):u=s[4];const g=n??"#3B82F6";let d;s[5]!==i?(d=o=>i(o.target.value),s[5]=i,s[6]=d):d=s[6];let t;s[7]!==g||s[8]!==d?(t=e.jsx("input",{type:"color",value:g,onChange:d,className:"size-8 rounded cursor-pointer"}),s[7]=g,s[8]=d,s[9]=t):t=s[9];let a;s[10]===Symbol.for("react.memo_cache_sentinel")?(a=e.jsx("span",{className:"text-sm text-muted-foreground",children:"Custom color"}),s[10]=a):a=s[10];let m;s[11]!==t?(m=e.jsxs("div",{className:"flex items-center gap-2",children:[t,a]}),s[11]=t,s[12]=m):m=s[12];let x;return s[13]!==u||s[14]!==m?(x=e.jsxs("div",{className:"space-y-3",children:[u,m]}),s[13]=u,s[14]=m,s[15]=x):x=s[15],x}V({name:f().min(1,"Name is required").max(200),slug:f().min(1,"Slug is required").max(100),description:f().max(1e3).optional(),bannerColor:f().nullable().optional()});function xe({open:l,onOpenChange:s}){const{org:n}=A(),i=L(),c=R(),[u,g]=z.useState(!1),d=q({connectionId:O,orgId:n.id}),t=M({mode:"onChange",defaultValues:{name:"",slug:"",description:"",bannerColor:"#3B82F6"}}),a=$({mutationFn:async r=>{const h=await d.callTool({name:"PROJECT_CREATE",arguments:{organizationId:n.id,slug:r.slug,name:r.name,description:r.description||null,enabledPlugins:[],ui:{banner:null,bannerColor:r.bannerColor??null,icon:null,themeColor:r.bannerColor??null}}});return h.structuredContent??h},onSuccess:r=>{c.invalidateQueries({queryKey:T.projects(n.id)}),B.success("Project created successfully"),s(!1),t.reset({name:"",slug:"",description:"",bannerColor:"#3B82F6"}),g(!1),i({to:"/$org/$project",params:{org:n.slug,project:r.project.slug}})},onError:r=>{B.error("Failed to create project: "+(r instanceof Error?r.message:"Unknown error"))}}),m=async r=>{if(!_(r.slug)){t.setError("slug",{message:"Slug must be lowercase alphanumeric with hyphens only"});return}if(r.slug===j){t.setError("slug",{message:`"${j}" is a reserved slug`});return}await a.mutateAsync(r)},x=r=>{const h=r.target.value;if(t.setValue("name",h),!u){const P=se(h);t.setValue("slug",P)}},o=r=>{g(!0),t.setValue("slug",r.target.value.toLowerCase().replace(/[^a-z0-9-]/g,""))},C=t.watch("bannerColor"),p=t.watch("slug"),b=t.watch("name"),y=p===j,E=p.length>0&&!_(p);return e.jsx(K,{open:l,onOpenChange:s,children:e.jsxs(U,{className:"max-w-lg max-h-[90vh] overflow-y-auto",children:[e.jsxs(G,{children:[e.jsx(J,{children:"Create New Project"}),e.jsxs(Q,{children:["Set up a new project in ",n.name,". You can configure plugins and settings after creation."]})]}),e.jsx(H,{...t,children:e.jsxs("form",{onSubmit:t.handleSubmit(m),className:"space-y-6",children:[e.jsx("div",{className:"h-20 rounded-lg relative",style:{backgroundColor:C??"#3B82F6"},children:e.jsx("div",{className:"absolute -bottom-4 left-4",children:e.jsx("div",{className:"size-12 rounded-lg border-2 border-background flex items-center justify-center text-lg font-semibold text-white",style:{backgroundColor:C??"#3B82F6"},children:b?.charAt(0)?.toUpperCase()||"P"})})}),e.jsxs("div",{className:"space-y-2 pt-4",children:[e.jsx(W,{children:"Banner Color"}),e.jsx(re,{value:C??null,onChange:r=>t.setValue("bannerColor",r)})]}),e.jsx(v,{control:t.control,name:"name",render:()=>e.jsxs(F,{children:[e.jsx(N,{children:"Project Name *"}),e.jsx(S,{children:e.jsx(I,{value:b,onChange:x,placeholder:"My Awesome Project",autoFocus:!0,disabled:a.isPending})}),e.jsx(w,{})]})}),e.jsx(v,{control:t.control,name:"slug",render:()=>e.jsxs(F,{children:[e.jsx(N,{children:"Slug *"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-sm text-muted-foreground",children:["/",n.slug,"/"]}),e.jsx(S,{children:e.jsx(I,{value:p,onChange:o,placeholder:"my-awesome-project",className:"flex-1",disabled:a.isPending})})]}),y&&e.jsxs("p",{className:"text-xs text-destructive",children:['"',j,'" is a reserved slug']}),E&&!y&&e.jsx("p",{className:"text-xs text-destructive",children:"Slug must be lowercase alphanumeric with hyphens only"}),e.jsx(w,{})]})}),e.jsx(v,{control:t.control,name:"description",render:({field:r})=>e.jsxs(F,{children:[e.jsx(N,{children:"Description"}),e.jsx(S,{children:e.jsx(X,{...r,placeholder:"What is this project for?",rows:2,disabled:a.isPending})}),e.jsx(w,{})]})}),e.jsxs(Y,{children:[e.jsx(D,{type:"button",variant:"outline",onClick:()=>s(!1),disabled:a.isPending,children:"Cancel"}),e.jsx(D,{type:"submit",disabled:a.isPending||y||E||!b||!p,children:a.isPending?"Creating...":"Create Project"})]})]})})]})})}export{xe as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c,j as i,H as p,I as f,J as m,M as g,Q as x,U as v,W as b,X as w,Y as h}from"./index-BV-rIyOx.js";import{i as j}from"./ChevronRight-BBcOJkyP.js";import{c as u}from"./utils-CfR4kXxZ.js";function M(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(p,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=o):o=e[3],o}function S(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(f,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=o):o=e[3],o}function $(s){const e=c.c(10);let t,o,a;e[0]!==s?({className:t,sideOffset:a,...o}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a):(t=e[1],o=e[2],a=e[3]);const n=a===void 0?4:a;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let d;return e[6]!==o||e[7]!==n||e[8]!==r?(d=i.jsx(m,{children:i.jsx(g,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...o})}),e[6]=o,e[7]=n,e[8]=r,e[9]=d):d=e[9],d}function y(s){const e=c.c(12);let t,o,a,n;e[0]!==s?({className:t,inset:o,variant:n,...a}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a,e[4]=n):(t=e[1],o=e[2],a=e[3],n=e[4]);const r=n===void 0?"default":n;let d;e[5]!==t?(d=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=d):d=e[6];let l;return e[7]!==o||e[8]!==a||e[9]!==d||e[10]!==r?(l=i.jsx(x,{"data-slot":"dropdown-menu-item","data-inset":o,"data-variant":r,className:d,...a}),e[7]=o,e[8]=a,e[9]=d,e[10]=r,e[11]=l):l=e[11],l}function _(s){const e=c.c(8);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let a;e[3]!==t?(a=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=a):a=e[4];let n;return e[5]!==o||e[6]!==a?(n=i.jsx(h,{"data-slot":"dropdown-menu-separator",className:a,...o}),e[5]=o,e[6]=a,e[7]=n):n=e[7],n}function C(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(v,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=o):o=e[3],o}function T(s){const e=c.c(13);let t,o,a,n;e[0]!==s?({className:o,inset:a,children:t,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a,e[4]=n):(t=e[1],o=e[2],a=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",o),e[5]=o,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(j,{className:"ml-auto size-4"}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==a||e[10]!==n||e[11]!==r?(l=i.jsxs(b,{"data-slot":"dropdown-menu-sub-trigger","data-inset":a,className:r,...n,children:[t,d]}),e[8]=t,e[9]=a,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function I(s){const e=c.c(8);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let a;e[3]!==t?(a=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=a):a=e[4];let n;return e[5]!==o||e[6]!==a?(n=i.jsx(w,{"data-slot":"dropdown-menu-sub-content",className:a,...o}),e[5]=o,e[6]=a,e[7]=n):n=e[7],n}export{M as D,S as a,$ as b,y as c,C as d,T as e,I as f,_ as g};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/grid-view-B4Eut3Xi.js","assets/index-BV-rIyOx.js","assets/index--g69ISoA.css","assets/button-Cl3WMTWk.js","assets/utils-CfR4kXxZ.js","assets/AlertCircle-BOIQEKjW.js","assets/Download01-VwSgop8U.js","assets/File02-D6OcKUS4.js","assets/File06-CkTcogsG.js","assets/Image01-BuXlAy8i.js","assets/Loading01-DOPFYU4m.js","assets/Trash01-C-euKa34.js","assets/Upload01-Dc0hOrKX.js","assets/useMutation-BOrtlNTb.js","assets/useQuery-DDYln2BW.js","assets/useInfiniteQuery-TqDHdib1.js","assets/infiniteQueryObserver-CrYps4St.js","assets/checkbox-kN_xGJfO.js","assets/Check-Bkb61eVw.js","assets/ChevronRight-BBcOJkyP.js","assets/Grid01-zbmmdox0.js","assets/Home02-DPzckV1r.js","assets/List-BvAv-Mbv.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as M,c as K,bm as Q,bn as A,v as Y,j as t,t as D,bo as X,$ as ee}from"./index-BV-rIyOx.js";import{u as te}from"./useInfiniteQuery-TqDHdib1.js";import{B as _}from"./button-Cl3WMTWk.js";import{C as L}from"./checkbox-kN_xGJfO.js";import{c as J}from"./utils-CfR4kXxZ.js";import{i as se}from"./AlertCircle-BOIQEKjW.js";import{i as ae}from"./ChevronRight-BBcOJkyP.js";import{n as ie}from"./Download01-VwSgop8U.js";import{i as re}from"./File02-D6OcKUS4.js";import{c as G}from"./Grid01-zbmmdox0.js";import{a as oe}from"./Home02-DPzckV1r.js";import{i as V}from"./List-BvAv-Mbv.js";import{i as $}from"./Loading01-DOPFYU4m.js";import{s as W}from"./Trash01-C-euKa34.js";import{i as U}from"./Upload01-Dc0hOrKX.js";import{u as q}from"./useMutation-BOrtlNTb.js";const Z=({size:s=24,color:e="currentColor",...i})=>M.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},M.createElement("path",{d:"m13 7-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 0 0-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2V7Zm10 10v-6m-3 3h6"}));Z.displayName="FolderPlus";const R={objects:(s,e,i=!1,o=100)=>["object-storage","objects",s,e,{flat:i,pageSize:o}],metadata:(s,e)=>["object-storage","metadata",s,e],imagePreview:(s,e)=>["object-storage","image-preview",s,e]},ne=100;function le(s){const e=K.c(30);let i;e[0]!==s?(i=s===void 0?{}:s,e[0]=s,e[1]=i):i=e[1];const o=i,{prefix:n,flat:x,pageSize:d}=o,m=n===void 0?"":n,l=x===void 0?!1:x,c=d===void 0?ne:d,{connectionId:b,toolCaller:S}=Q();let f;e[2]!==b||e[3]!==l||e[4]!==c||e[5]!==m?(f=R.objects(b,m,l,c),e[2]=b,e[3]=l,e[4]=c,e[5]=m,e[6]=f):f=e[6];let u;e[7]!==l||e[8]!==c||e[9]!==m||e[10]!==S?(u=async a=>{const{pageParam:r}=a;return await S("LIST_OBJECTS",{prefix:m||void 0,maxKeys:c,continuationToken:r,delimiter:l?void 0:"/"})},e[7]=l,e[8]=c,e[9]=m,e[10]=S,e[11]=u):u=e[11];let E;e[12]!==f||e[13]!==u?(E={queryKey:f,queryFn:u,initialPageParam:void 0,getNextPageParam:ge,staleTime:3e4},e[12]=f,e[13]=u,e[14]=E):E=e[14];const{data:p,isLoading:z,isFetchingNextPage:g,hasNextPage:y,fetchNextPage:h,error:w}=te(E);let v;if(l){let a;e[15]!==p?.pages?(a=p?.pages.flatMap(he).filter(pe).map(xe)??[],e[15]=p?.pages,e[16]=a):a=e[16],v=a}else{let a;if(e[17]!==p?.pages){const r=p?.pages[0]?.commonPrefixes?.map(ue)??[],j=p?.pages.flatMap(de)??[];a=[...r.sort(ce),...j],e[17]=p?.pages,e[18]=a}else a=e[18];v=a}let N;e[19]!==h||e[20]!==y||e[21]!==g?(N=()=>{y&&!g&&h()},e[19]=h,e[20]=y,e[21]=g,e[22]=N):N=e[22];const C=N,F=y??!1,P=w;let k;return e[23]!==g||e[24]!==z||e[25]!==C||e[26]!==v||e[27]!==P||e[28]!==F?(k={objects:v,isLoading:z,isFetchingMore:g,hasMore:F,loadMore:C,error:P},e[23]=g,e[24]=z,e[25]=C,e[26]=v,e[27]=P,e[28]=F,e[29]=k):k=e[29],k}function ce(s,e){return s.key.localeCompare(e.key)}function de(s){return s.objects.filter(fe).map(me)}function me(s){return{key:s.key,size:s.size,lastModified:s.lastModified,etag:s.etag,isFolder:!1}}function fe(s){return!s.key.endsWith("/")}function ue(s){return{key:s,size:0,lastModified:"",etag:"",isFolder:!0}}function xe(s){return{key:s.key,size:s.size,lastModified:s.lastModified,etag:s.etag,isFolder:!1}}function pe(s){return!s.key.endsWith("/")}function he(s){return s.objects}function ge(s){return s.nextContinuationToken}function I(s){const e=s.split("/").filter(Boolean);return e[e.length-1]||s}function je(s){if(s===0)return"0 B";const e=["B","KB","MB","GB","TB"],i=1024,o=Math.floor(Math.log(s)/Math.log(i));return`${parseFloat((s/Math.pow(i,o)).toFixed(1))} ${e[o]}`}function ye(s){return new Date(s).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function ve(s){const e=[],i=s.split("/").filter(Boolean);let o="";for(const n of i)o+=n+"/",e.push({name:n,path:o});return e}function Ie(s,e){switch(s.split(".").pop()?.toLowerCase()){case"jpg":case"jpeg":case"png":case"gif":case"webp":case"svg":return"Image01";case"mp4":case"mov":case"avi":case"webm":return"VideoRecorder";case"mp3":case"wav":case"ogg":return"Music01";case"pdf":return"File06";case"zip":case"tar":case"gz":case"rar":return"File07";case"js":case"ts":case"tsx":case"jsx":case"json":case"html":case"css":return"FileCode01";case"md":case"txt":return"File04";default:return"File02"}}const Ne=M.lazy(()=>X(()=>import("./grid-view-B4Eut3Xi.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22])));function be(s){const e=K.c(50),{item:i,selected:o,showFullPath:n,onSelect:x,onNavigate:d,onDownload:m,onDelete:l}=s,c=n===void 0?!1:n;let b;e[0]!==i.key||e[1]!==c?(b=c?i.key:I(i.key),e[0]=i.key,e[1]=c,e[2]=b):b=e[2];const S=b;let f;e[3]!==x||e[4]!==o?(f=t.jsx(L,{checked:o,onCheckedChange:x,className:"opacity-0 group-hover:opacity-100 focus:opacity-100 data-[state=checked]:opacity-100"}),e[3]=x,e[4]=o,e[5]=f):f=e[5];let u;e[6]!==i.isFolder||e[7]!==i.key||e[8]!==d?(u=()=>i.isFolder?d(i.key):void 0,e[6]=i.isFolder,e[7]=i.key,e[8]=d,e[9]=u):u=e[9];const E=i.isFolder&&"cursor-pointer hover:text-primary";let p;e[10]!==E?(p=J("flex items-center gap-2 flex-1 min-w-0 text-left",E),e[10]=E,e[11]=p):p=e[11];let z;e[12]!==i.isFolder?(z=i.isFolder?t.jsx(ee,{size:18,className:"text-amber-500 shrink-0"}):t.jsx(re,{size:18,className:"text-muted-foreground shrink-0"}),e[12]=i.isFolder,e[13]=z):z=e[13];let g;e[14]!==S?(g=t.jsx("span",{className:"truncate",children:S}),e[14]=S,e[15]=g):g=e[15];let y;e[16]!==u||e[17]!==p||e[18]!==z||e[19]!==g?(y=t.jsxs("button",{type:"button",onClick:u,className:p,children:[z,g]}),e[16]=u,e[17]=p,e[18]=z,e[19]=g,e[20]=y):y=e[20];let h;e[21]!==i.isFolder||e[22]!==i.size?(h=i.isFolder?"-":je(i.size),e[21]=i.isFolder,e[22]=i.size,e[23]=h):h=e[23];let w;e[24]!==h?(w=t.jsx("span",{className:"text-sm text-muted-foreground w-20 text-right shrink-0",children:h}),e[24]=h,e[25]=w):w=e[25];let v;e[26]!==i.isFolder||e[27]!==i.lastModified?(v=i.isFolder?"-":ye(i.lastModified),e[26]=i.isFolder,e[27]=i.lastModified,e[28]=v):v=e[28];let N;e[29]!==v?(N=t.jsx("span",{className:"text-sm text-muted-foreground w-28 text-right shrink-0",children:v}),e[29]=v,e[30]=N):N=e[30];let C;e[31]!==i.isFolder||e[32]!==i.key||e[33]!==m?(C=!i.isFolder&&t.jsx(_,{variant:"ghost",size:"sm",className:"size-7 p-0",onClick:()=>m(i.key),children:t.jsx(ie,{size:14})}),e[31]=i.isFolder,e[32]=i.key,e[33]=m,e[34]=C):C=e[34];let F;e[35]!==i.key||e[36]!==l?(F=()=>l(i.key),e[35]=i.key,e[36]=l,e[37]=F):F=e[37];let P;e[38]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(W,{size:14}),e[38]=P):P=e[38];let k;e[39]!==F?(k=t.jsx(_,{variant:"ghost",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:F,children:P}),e[39]=F,e[40]=k):k=e[40];let a;e[41]!==C||e[42]!==k?(a=t.jsxs("div",{className:"flex items-center gap-1 w-16 justify-end shrink-0 opacity-0 group-hover:opacity-100",children:[C,k]}),e[41]=C,e[42]=k,e[43]=a):a=e[43];let r;return e[44]!==w||e[45]!==N||e[46]!==a||e[47]!==f||e[48]!==y?(r=t.jsxs("div",{className:"group flex items-center gap-3 px-4 py-2 hover:bg-muted/50 border-b border-border last:border-b-0",children:[f,y,w,N,a]}),e[44]=w,e[45]=N,e[46]=a,e[47]=f,e[48]=y,e[49]=r):r=e[49],r}function H(s){const e=K.c(8),{prefix:i,onNavigate:o}=s;let n;if(e[0]!==o||e[1]!==i){const x=ve(i);let d;e[3]!==o?(d=()=>o(""),e[3]=o,e[4]=d):d=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(oe,{size:16}),e[5]=m):m=e[5];let l;e[6]!==d?(l=t.jsx("button",{type:"button",onClick:d,className:"flex items-center gap-1 text-muted-foreground hover:text-foreground",children:m}),e[6]=d,e[7]=l):l=e[7],n=t.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[l,x.map((c,b)=>t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(ae,{size:14,className:"text-muted-foreground"}),t.jsx("button",{type:"button",onClick:()=>o(c.path),className:J("hover:text-primary",b===x.length-1?"font-medium text-foreground":"text-muted-foreground"),children:c.name})]},c.path))]}),e[0]=o,e[1]=i,e[2]=n}else n=e[2];return n}function ke(){const{path:s="",flat:e=!1,view:i="table"}=A.useSearch({from:"/"}),o=A.useNavigate(),[n,x]=M.useState(new Set),d=a=>{x(new Set),o({to:"/",search:{path:a||void 0,flat:e,view:i}})},m=a=>{x(new Set),o({to:"/",search:{path:a?void 0:s||void 0,flat:a,view:i}})},l=a=>{x(new Set),o({to:"/",search:{path:s||void 0,flat:e,view:a}})},c=M.useRef(null),b=Y(),{connectionId:S,toolCaller:f}=Q(),{objects:u,isLoading:E,isFetchingMore:p,hasMore:z,loadMore:g,error:y}=le({prefix:s,flat:e}),h=q({mutationFn:async a=>{const r=s+a.name,{url:j}=await f("PUT_PRESIGNED_URL",{key:r,contentType:a.type||"application/octet-stream"}),T=await fetch(j,{method:"PUT",body:a,headers:{"Content-Type":a.type||"application/octet-stream"}});if(!T.ok)throw new Error(`Upload failed: ${T.statusText}`);return r},onSuccess:a=>{D.success(`Uploaded ${I(a)}`),b.invalidateQueries({queryKey:R.objects(S,s)})},onError:a=>{D.error(`Upload failed: ${a.message}`)}}),w=q({mutationFn:async a=>a.length===1&&a[0]?f("DELETE_OBJECT",{key:a[0]}):f("DELETE_OBJECTS",{keys:a}),onSuccess:()=>{D.success("Deleted successfully"),x(new Set),b.invalidateQueries({queryKey:R.objects(S,s)})},onError:a=>{D.error(`Delete failed: ${a.message}`)}}),v=async a=>{try{const{url:r}=await f("GET_PRESIGNED_URL",{key:a}),j=await fetch(r);if(!j.ok)throw new Error(`Failed to fetch file: ${j.statusText}`);const T=await j.blob(),O=URL.createObjectURL(T),B=document.createElement("a");B.href=O,B.download=I(a),document.body.appendChild(B),B.click(),document.body.removeChild(B),URL.revokeObjectURL(O)}catch(r){D.error(`Download failed: ${r instanceof Error?r.message:"Unknown error"}`)}},N=a=>{const r=a.target.files;if(r){for(const j of Array.from(r))h.mutate(j);a.target.value=""}},C=(a,r)=>{const j=new Set(n);r?j.add(a):j.delete(a),x(j)},F=a=>{x(a?new Set(u.map(r=>r.key)):new Set)},P=()=>{n.size!==0&&w.mutate(Array.from(n))},k=a=>{if(!z||p)return;const r=a.currentTarget;r.scrollHeight-r.scrollTop-r.clientHeight<200&&g()};return y?t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(se,{size:48,className:"text-destructive mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading files"}),t.jsx("p",{className:"text-muted-foreground text-center",children:y.message})]}):i==="grid"?t.jsxs("div",{className:"flex flex-col h-full",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-background",children:[e?t.jsx("span",{className:"text-sm text-muted-foreground",children:"All files (flat)"}):t.jsx(H,{prefix:s,onNavigate:d}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[t.jsx(L,{checked:!e,onCheckedChange:a=>m(!a)}),t.jsx("span",{className:"text-muted-foreground",children:"Show as directories"})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(_,{variant:i==="grid"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("grid"),children:t.jsx(G,{size:16})}),t.jsx(_,{variant:i==="table"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("table"),children:t.jsx(V,{size:16})})]}),t.jsx("input",{ref:c,type:"file",multiple:!0,className:"hidden",onChange:N}),t.jsxs(_,{variant:"outline",size:"sm",onClick:()=>c.current?.click(),disabled:h.isPending,children:[h.isPending?t.jsx($,{size:14,className:"mr-1 animate-spin"}):t.jsx(U,{size:14,className:"mr-1"}),"Upload"]})]})]}),t.jsx(M.Suspense,{fallback:t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx($,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Ne,{prefix:s,flat:e,onNavigate:d})})]}):t.jsxs("div",{className:"flex flex-col h-full",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-background",children:[e?t.jsx("span",{className:"text-sm text-muted-foreground",children:"All files (flat)"}):t.jsx(H,{prefix:s,onNavigate:d}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[t.jsx(L,{checked:!e,onCheckedChange:a=>m(!a)}),t.jsx("span",{className:"text-muted-foreground",children:"Show as directories"})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(_,{variant:i==="grid"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("grid"),children:t.jsx(G,{size:16})}),t.jsx(_,{variant:i==="table"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("table"),children:t.jsx(V,{size:16})})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[n.size>0&&t.jsxs(_,{variant:"outline",size:"sm",className:"text-destructive",onClick:P,disabled:w.isPending,children:[t.jsx(W,{size:14,className:"mr-1"}),"Delete (",n.size,")"]}),t.jsx("input",{ref:c,type:"file",multiple:!0,className:"hidden",onChange:N}),t.jsxs(_,{variant:"outline",size:"sm",onClick:()=>c.current?.click(),disabled:h.isPending,children:[h.isPending?t.jsx($,{size:14,className:"mr-1 animate-spin"}):t.jsx(U,{size:14,className:"mr-1"}),"Upload"]})]})]})]}),t.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-b border-border bg-muted/30 text-sm font-medium text-muted-foreground",children:[t.jsx(L,{checked:n.size>0&&n.size===u.length,onCheckedChange:F}),t.jsx("span",{className:"flex-1",children:"Name"}),t.jsx("span",{className:"w-20 text-right",children:"Size"}),t.jsx("span",{className:"w-28 text-right",children:"Modified"}),t.jsx("span",{className:"w-16"})]}),t.jsx("div",{className:"flex-1 overflow-y-auto",onScroll:k,children:E?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[t.jsx($,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading files..."})]}):u.length===0?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(Z,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"This folder is empty"}),t.jsx("p",{className:"text-muted-foreground mb-4",children:"Upload files to get started"}),t.jsxs(_,{variant:"outline",onClick:()=>c.current?.click(),children:[t.jsx(U,{size:14,className:"mr-1"}),"Upload files"]})]}):t.jsxs(t.Fragment,{children:[u.map(a=>t.jsx(be,{item:a,selected:n.has(a.key),showFullPath:e,onSelect:r=>C(a.key,r),onNavigate:d,onDownload:v,onDelete:r=>w.mutate([r])},a.key)),p&&t.jsx("div",{className:"flex justify-center py-4",children:t.jsx($,{size:20,className:"animate-spin text-muted-foreground"})})]})})]})}const Ke=Object.freeze(Object.defineProperty({__proto__:null,default:ke},Symbol.toStringTag,{value:"Module"}));export{R as K,Ie as a,Ke as b,je as f,I as g,Z as s,le as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as d,j as m,ag as b,ah as j,ai as C,r as f,E as v,aj as N,ak as h}from"./index-BV-rIyOx.js";import{c as u}from"./utils-CfR4kXxZ.js";function S(t){const e=d.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let a;e[3]!==s?(a=u("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",s),e[3]=s,e[4]=a):a=e[4];let r;return e[5]!==o||e[6]!==a?(r=m.jsx(b,{"data-slot":"label",className:a,...o}),e[5]=o,e[6]=a,e[7]=r):r=e[7],r}const y=j,I=f.createContext({}),D=t=>{const e=d.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let a;e[4]!==s?(a=m.jsx(C,{...s}),e[4]=s,e[5]=a):a=e[5];let r;return e[6]!==o||e[7]!==a?(r=m.jsx(I.Provider,{value:o,children:a}),e[6]=o,e[7]=a,e[8]=r):r=e[8],r},x=()=>{const t=d.c(13),e=f.useContext(I),s=f.useContext($),{getFieldState:o}=N();let a;t[0]!==e.name?(a={name:e.name},t[0]=e.name,t[1]=a):a=t[1];const r=h(a);let n;t[2]!==e.name||t[3]!==r||t[4]!==o?(n=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=n):n=t[5];const l=n;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,c=`${i}-form-item`,F=`${i}-form-item-description`,g=`${i}-form-item-message`;let p;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==c||t[10]!==F||t[11]!==g?(p={id:i,name:e.name,formItemId:c,formDescriptionId:F,formMessageId:g,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=c,t[10]=F,t[11]=g,t[12]=p):p=t[12],p},$=f.createContext({});function M(t){const e=d.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const a=f.useId();let r;e[3]!==a?(r={id:a},e[3]=a,e[4]=r):r=e[4];let n;e[5]!==s?(n=u("grid gap-2",s),e[5]=s,e[6]=n):n=e[6];let l;e[7]!==o||e[8]!==n?(l=m.jsx("div",{"data-slot":"form-item",className:n,...o}),e[7]=o,e[8]=n,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=m.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function L(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:a,formItemId:r}=x(),n=!!a;let l;e[3]!==s?(l=u("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==n||e[8]!==l?(i=m.jsx(S,{"data-slot":"form-label","data-error":n,className:l,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=n,e[8]=l,e[9]=i):i=e[9],i}function P(t){const e=d.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:a,formDescriptionId:r,formMessageId:n}=x(),l=o?`${r} ${n}`:`${r}`,i=!!o;let c;return e[2]!==a||e[3]!==s||e[4]!==l||e[5]!==i?(c=m.jsx(v,{"data-slot":"form-control",id:a,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=a,e[3]=s,e[4]=l,e[5]=i,e[6]=c):c=e[6],c}function R(t){const e=d.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:a}=x();let r;e[3]!==s?(r=u("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let n;return e[5]!==a||e[6]!==o||e[7]!==r?(n=m.jsx("p",{"data-slot":"form-description",id:a,className:r,...o}),e[5]=a,e[6]=o,e[7]=r,e[8]=n):n=e[8],n}function k(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:a,formMessageId:r}=x(),n=a?String(a?.message??""):o.children;if(!n)return null;let l;e[3]!==s?(l=u("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==n||e[6]!==r||e[7]!==o||e[8]!==l?(i=m.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:n}),e[5]=n,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{D as F,S as L,y as a,M as b,L as c,P as d,R as e,k as f};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as v,c as M,bm as D,j as s,v as q,t as w,$ as H}from"./index-BV-rIyOx.js";import{K as L,u as Z,g as R,s as Q,a as W,f as U}from"./file-browser-CHtfSNHu.js";import{B as E}from"./button-Cl3WMTWk.js";import{c as I}from"./utils-CfR4kXxZ.js";import{i as S}from"./AlertCircle-BOIQEKjW.js";import{n as A}from"./Download01-VwSgop8U.js";import{i as $}from"./File02-D6OcKUS4.js";import{i as J}from"./File06-CkTcogsG.js";import{a as P}from"./Image01-BuXlAy8i.js";import{i as T}from"./Loading01-DOPFYU4m.js";import{s as V}from"./Trash01-C-euKa34.js";import{i as Y}from"./Upload01-Dc0hOrKX.js";import{u as _}from"./useMutation-BOrtlNTb.js";import{u as X}from"./useQuery-DDYln2BW.js";import"./useInfiniteQuery-TqDHdib1.js";import"./infiniteQueryObserver-CrYps4St.js";import"./checkbox-kN_xGJfO.js";import"./Check-Bkb61eVw.js";import"./ChevronRight-BBcOJkyP.js";import"./Grid01-zbmmdox0.js";import"./Home02-DPzckV1r.js";import"./List-BvAv-Mbv.js";const B=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C14.76 8 15.04 8 15.6 8h4.13M20 9.988V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));B.displayName="File04";const G=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437c.214.11.494.11 1.054.11h4.13M8 15v3m8-5v5m-4-7.5V18m8-8.012V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));G.displayName="File07";const K=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437c.214.11.494.11 1.054.11h4.13M14 17.5l2.5-2.5-2.5-2.5m-4 0L7.5 15l2.5 2.5m10-7.512V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));K.displayName="FileCode01";const O=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M22 8.931c0-.605 0-.908-.12-1.049a.5.5 0 0 0-.42-.173c-.183.014-.397.228-.826.657L17 12l3.634 3.634c.429.429.643.643.827.657a.5.5 0 0 0 .42-.173c.119-.14.119-.444.119-1.05V8.932ZM2 9.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C4.28 5 5.12 5 6.8 5h5.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C17 7.28 17 8.12 17 9.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C14.72 19 13.88 19 12.2 19H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 16.72 2 15.88 2 14.2V9.8Z"}));O.displayName="VideoRecorder";function ee(i){const e=M.c(5),[t,g]=v.useState(!1),a=v.useRef(null),d=v.useRef(!1);let n;e[0]!==i?(n=u=>{a.current&&(a.current.disconnect(),a.current=null),u&&!d.current&&(a.current=new IntersectionObserver(y=>{const[c]=y;c?.isIntersecting&&!d.current&&(d.current=!0,g(!0),a.current?.disconnect(),a.current=null)},i),a.current.observe(u))},e[0]=i,e[1]=n):n=e[1];const l=n;let h;return e[2]!==t||e[3]!==l?(h=[t,l],e[2]=t,e[3]=l,e[4]=h):h=e[4],h}function te(i){const e=M.c(24),{objectKey:t,alt:g,className:a}=i,d=a===void 0?"":a,{connectionId:n,toolCaller:l}=D();let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={rootMargin:"100px",threshold:0},e[0]=h):h=e[0];const[u,y]=ee(h);let c;e[1]!==n||e[2]!==t?(c=L.imagePreview(n,t),e[1]=n,e[2]=t,e[3]=c):c=e[3];let f;e[4]!==t||e[5]!==l?(f=async()=>{const{url:m}=await l("GET_PRESIGNED_URL",{key:t});return m},e[4]=t,e[5]=l,e[6]=f):f=e[6];let k;e[7]!==u||e[8]!==c||e[9]!==f?(k={queryKey:c,queryFn:f,enabled:u,staleTime:3e5,gcTime:6e5},e[7]=u,e[8]=c,e[9]=f,e[10]=k):k=e[10];const{data:b,isLoading:x,error:j}=X(k);let p;e[11]!==d?(p=I("relative w-full h-full flex items-center justify-center overflow-hidden",d),e[11]=d,e[12]=p):p=e[12];let r;e[13]!==g||e[14]!==j||e[15]!==b||e[16]!==x||e[17]!==u||e[18]!==t?(r=!u||x?s.jsx("div",{className:"flex flex-col items-center justify-center text-muted-foreground",children:x?s.jsx(T,{size:24,className:"animate-spin"}):s.jsx(P,{size:48})}):j?s.jsx("div",{className:"flex flex-col items-center justify-center text-muted-foreground",children:s.jsx(S,{size:24})}):b?s.jsx("img",{src:b,alt:g||t,className:"w-full h-full object-cover",loading:"lazy"}):null,e[13]=g,e[14]=j,e[15]=b,e[16]=x,e[17]=u,e[18]=t,e[19]=r):r=e[19];let o;return e[20]!==y||e[21]!==p||e[22]!==r?(o=s.jsx("div",{ref:y,className:p,children:r}),e[20]=y,e[21]=p,e[22]=r,e[23]=o):o=e[23],o}const z=12,se={Image01:P,VideoRecorder:O,Music01:$,File02:$,File04:B,File06:J,File07:G,FileCode01:K,Folder:H};function re(i){const e=i.split(".").pop()?.toLowerCase();return["jpg","jpeg","png","gif","webp","svg","bmp","ico"].includes(e||"")}function oe(i){const e=M.c(41),{item:t,onNavigate:g,onDownload:a,onDelete:d}=i;let n;e[0]!==t.key?(n=R(t.key),e[0]=t.key,e[1]=n):n=e[1];const l=n,h=t.isFolder?"Folder":W(t.key),u=se[h]||$;let y;e[2]!==t.isFolder||e[3]!==t.key?(y=!t.isFolder&&re(t.key),e[2]=t.isFolder,e[3]=t.key,e[4]=y):y=e[4];const c=y;let f;e[5]!==t.isFolder||e[6]!==t.key||e[7]!==g?(f=()=>t.isFolder?g(t.key):void 0,e[5]=t.isFolder,e[6]=t.key,e[7]=g,e[8]=f):f=e[8];const k=!c&&"p-4",b=t.isFolder?"cursor-pointer":"cursor-default";let x;e[9]!==k||e[10]!==b?(x=I("flex flex-col items-center justify-center w-full h-full",k,b),e[9]=k,e[10]=b,e[11]=x):x=e[11];let j;e[12]!==u||e[13]!==c||e[14]!==t.isFolder||e[15]!==t.key||e[16]!==l?(j=c?s.jsx("div",{className:"absolute inset-0",children:s.jsx(te,{objectKey:t.key,alt:l})}):s.jsx(u,{size:48,className:I(t.isFolder?"text-amber-500":"text-muted-foreground")}),e[12]=u,e[13]=c,e[14]=t.isFolder,e[15]=t.key,e[16]=l,e[17]=j):j=e[17];let p;e[18]!==c||e[19]!==t.isFolder||e[20]!==t.size||e[21]!==l?(p=c?s.jsxs("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2 pt-6",children:[s.jsx("span",{className:"text-sm text-white text-center line-clamp-1 block",children:l}),s.jsx("span",{className:"text-xs text-white/70 text-center block",children:U(t.size)})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"mt-3 text-sm text-center line-clamp-2 px-2",children:l}),!t.isFolder&&s.jsx("span",{className:"mt-1 text-xs text-muted-foreground",children:U(t.size)})]}),e[18]=c,e[19]=t.isFolder,e[20]=t.size,e[21]=l,e[22]=p):p=e[22];let r;e[23]!==f||e[24]!==x||e[25]!==j||e[26]!==p?(r=s.jsxs("button",{type:"button",onClick:f,className:x,children:[j,p]}),e[23]=f,e[24]=x,e[25]=j,e[26]=p,e[27]=r):r=e[27];let o;e[28]!==t.isFolder||e[29]!==t.key||e[30]!==d||e[31]!==a?(o=!t.isFolder&&s.jsxs("div",{className:"absolute top-2 right-2 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[s.jsx(E,{variant:"secondary",size:"sm",className:"size-7 p-0",onClick:F=>{F.stopPropagation(),a(t.key)},children:s.jsx(A,{size:14})}),s.jsx(E,{variant:"secondary",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:F=>{F.stopPropagation(),d(t.key)},children:s.jsx(V,{size:14})})]}),e[28]=t.isFolder,e[29]=t.key,e[30]=d,e[31]=a,e[32]=o):o=e[32];let m;e[33]!==t.isFolder||e[34]!==t.key||e[35]!==d?(m=t.isFolder&&s.jsx("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:s.jsx(E,{variant:"secondary",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:F=>{F.stopPropagation(),d(t.key)},children:s.jsx(V,{size:14})})}),e[33]=t.isFolder,e[34]=t.key,e[35]=d,e[36]=m):m=e[36];let N;return e[37]!==o||e[38]!==m||e[39]!==r?(N=s.jsxs("div",{className:"group relative aspect-square bg-muted/30 rounded-lg border border-border hover:border-primary/50 hover:bg-muted/50 transition-colors overflow-hidden",children:[r,o,m]}),e[37]=o,e[38]=m,e[39]=r,e[40]=N):N=e[40],N}function Ee({prefix:i,flat:e,onNavigate:t}){const g=v.useRef(null),a=q(),{connectionId:d,toolCaller:n}=D(),{objects:l,isLoading:h,isFetchingMore:u,hasMore:y,loadMore:c,error:f}=Z({prefix:i,flat:e,pageSize:z}),k=_({mutationFn:async r=>{const o=i+r.name,{url:m}=await n("PUT_PRESIGNED_URL",{key:o,contentType:r.type||"application/octet-stream"}),N=await fetch(m,{method:"PUT",body:r,headers:{"Content-Type":r.type||"application/octet-stream"}});if(!N.ok)throw new Error(`Upload failed: ${N.statusText}`);return o},onSuccess:r=>{w.success(`Uploaded ${R(r)}`),a.invalidateQueries({queryKey:L.objects(d,i,e,z)})},onError:r=>{w.error(`Upload failed: ${r.message}`)}}),b=_({mutationFn:async r=>r.length===1&&r[0]?n("DELETE_OBJECT",{key:r[0]}):n("DELETE_OBJECTS",{keys:r}),onSuccess:()=>{w.success("Deleted successfully"),a.invalidateQueries({queryKey:L.objects(d,i,e,z)})},onError:r=>{w.error(`Delete failed: ${r.message}`)}}),x=async r=>{try{const{url:o}=await n("GET_PRESIGNED_URL",{key:r}),m=await fetch(o);if(!m.ok)throw new Error(`Failed to fetch file: ${m.statusText}`);const N=await m.blob(),F=URL.createObjectURL(N),C=document.createElement("a");C.href=F,C.download=R(r),document.body.appendChild(C),C.click(),document.body.removeChild(C),URL.revokeObjectURL(F)}catch(o){w.error(`Download failed: ${o instanceof Error?o.message:"Unknown error"}`)}},j=r=>{const o=r.target.files;if(o){for(const m of Array.from(o))k.mutate(m);r.target.value=""}},p=r=>{if(!y||u)return;const o=r.currentTarget;o.scrollHeight-o.scrollTop-o.clientHeight<200&&c()};return f?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[s.jsx(S,{size:48,className:"text-destructive mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading files"}),s.jsx("p",{className:"text-muted-foreground text-center",children:f.message})]}):s.jsx("div",{className:"flex-1 overflow-y-auto p-4",onScroll:p,children:h?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[s.jsx(T,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading files..."})]}):l.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(Q,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"This folder is empty"}),s.jsx("p",{className:"text-muted-foreground mb-4",children:"Upload files to get started"}),s.jsx("input",{ref:g,type:"file",multiple:!0,className:"hidden",onChange:j}),s.jsxs(E,{variant:"outline",onClick:()=>g.current?.click(),children:[s.jsx(Y,{size:14,className:"mr-1"}),"Upload files"]})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4",children:l.map(r=>s.jsx(oe,{item:r,onNavigate:t,onDownload:x,onDelete:o=>b.mutate([o])},r.key))}),u&&s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(T,{size:24,className:"animate-spin text-muted-foreground"})})]})})}export{Ee as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as f,j as s,g as _,r as C,a_ as F,m as E,v as O,t as w}from"./index-BV-rIyOx.js";import{C as k}from"./card-B-73zAje.js";import{c as y}from"./utils-CfR4kXxZ.js";import{A as R}from"./avatar-B-AS-16N.js";import{i as D}from"./AlertCircle-BOIQEKjW.js";import{i as H}from"./Check-Bkb61eVw.js";import{s as G}from"./Plus-WaQ7hmj5.js";import{i as Q}from"./SearchMd-Ds-ERWzq.js";import{s as q}from"./XClose-Cv_qbaYN.js";import{B as $}from"./button-Cl3WMTWk.js";import{I as B}from"./input-Dv5qvD5N.js";import{C as T}from"./create-organization-dialog-DWV2eGAF.js";import"./alert-dialog-B4H6MrIT.js";import"./form-qYB4UriD.js";import"./spinner-BPZfVVyD.js";import"./useMutation-BOrtlNTb.js";function U(t){const e=f.c(10),{children:n,className:l,onNavigate:i,showHoverRing:r}=t,d=r===void 0?!1:r;let o;e[0]!==i?(o=p=>{i&&i(p)},e[0]=i,e[1]=o):o=e[1];const m=o,x=i&&"cursor-pointer",a=d&&"hover:ring-2 hover:ring-primary";let c;e[2]!==l||e[3]!==x||e[4]!==a?(c=y("group transition-all flex flex-col gap-0",x,a,l),e[2]=l,e[3]=x,e[4]=a,e[5]=c):c=e[5];let g;return e[6]!==n||e[7]!==m||e[8]!==c?(g=s.jsx(k,{className:c,onClick:m,children:n}),e[6]=n,e[7]=m,e[8]=c,e[9]=g):g=e[9],g}function M(t){const e=f.c(7),{url:n,fallback:l,shape:i,size:r,objectFit:d,className:o}=t,m=i===void 0?"square":i,x=r===void 0?"lg":r,a=d===void 0?"contain":d;let c;return e[0]!==o||e[1]!==l||e[2]!==a||e[3]!==m||e[4]!==x||e[5]!==n?(c=s.jsx(R,{url:n,fallback:l,shape:m,size:x,objectFit:a,className:o}),e[0]=o,e[1]=l,e[2]=a,e[3]=m,e[4]=x,e[5]=n,e[6]=c):c=e[6],c}function P(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("p-4 flex flex-col gap-4",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function V(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("font-medium truncate",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("p",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function X(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("text-sm text-muted-foreground truncate",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("h3",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function Y(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex flex-col gap-[2px]",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function J(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex justify-between items-start",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function K(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("p-4 border-t border-border flex justify-between items-center",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function W(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex items-center text-xs text-muted-foreground",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function Z(){const t=f.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex justify-between items-start",children:s.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg animate-pulse"})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[e,s.jsxs("div",{className:"flex flex-col gap-[2px]",children:[s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg animate-pulse"}),s.jsx("div",{className:"h-4 w-40 bg-muted rounded-lg animate-pulse"})]})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs(k,{className:"group transition-colors flex flex-col",children:[n,s.jsxs("div",{className:"p-4 border-t border-border flex justify-between items-center",children:[s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]}),t[2]=l):l=t[2],l}const u=Object.assign(U,{Avatar:M,AvatarSection:J,Header:P,Title:V,Subtitle:X,Content:Y,Footer:K,Badge:W,Skeleton:Z}),ee={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",5:"gap-5",6:"gap-6",8:"gap-8"},te={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8"},se={1:"@min-3xl:grid-cols-1",2:"@min-3xl:grid-cols-2",3:"@min-3xl:grid-cols-3",4:"@min-3xl:grid-cols-4",5:"@min-3xl:grid-cols-5",6:"@min-3xl:grid-cols-6",7:"@min-3xl:grid-cols-7",8:"@min-3xl:grid-cols-8"},ie={1:"@min-6xl:grid-cols-1",2:"@min-6xl:grid-cols-2",3:"@min-6xl:grid-cols-3",4:"@min-6xl:grid-cols-4",5:"@min-6xl:grid-cols-5",6:"@min-6xl:grid-cols-6",7:"@min-6xl:grid-cols-7",8:"@min-6xl:grid-cols-8"},le={1:"@min-7xl:grid-cols-1",2:"@min-7xl:grid-cols-2",3:"@min-7xl:grid-cols-3",4:"@min-7xl:grid-cols-4",5:"@min-7xl:grid-cols-5",6:"@min-7xl:grid-cols-6",7:"@min-7xl:grid-cols-7",8:"@min-7xl:grid-cols-8"},ne={1:"@min-8xl:grid-cols-1",2:"@min-8xl:grid-cols-2",3:"@min-8xl:grid-cols-3",4:"@min-8xl:grid-cols-4",5:"@min-8xl:grid-cols-5",6:"@min-8xl:grid-cols-6",7:"@min-8xl:grid-cols-7",8:"@min-8xl:grid-cols-8"};function L(t){const e=f.c(13),{children:n,columns:l,gap:i,className:r}=t;let d;e[0]!==l?(d=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=d):d=e[1];const o=d,x=ee[i===void 0?4:i],a=o.sm&&te[o.sm],c=o.md&&se[o.md],g=o.lg&&ie[o.lg],p=o.xl&&le[o.xl],v=o["2xl"]&&ne[o["2xl"]];let N;e[2]!==r||e[3]!==x||e[4]!==a||e[5]!==c||e[6]!==g||e[7]!==p||e[8]!==v?(N=y("w-full grid",x,a,c,g,p,v,r),e[2]=r,e[3]=x,e[4]=a,e[5]=c,e[6]=g,e[7]=p,e[8]=v,e[9]=N):N=e[9];const b=N;let h;return e[10]!==n||e[11]!==b?(h=s.jsx("div",{className:b,children:n}),e[10]=n,e[11]=b,e[12]=h):h=e[12],h}function re(t){const e=f.c(9),{count:n,columns:l,gap:i,className:r}=t,d=n===void 0?8:n;let o;e[0]!==l?(o=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=o):o=e[1];const m=o,x=i===void 0?4:i;let a;e[2]!==d?(a=Array.from({length:d}).map(ae),e[2]=d,e[3]=a):a=e[3];let c;return e[4]!==r||e[5]!==m||e[6]!==x||e[7]!==a?(c=s.jsx(L,{columns:m,gap:x,className:r,children:a}),e[4]=r,e[5]=m,e[6]=x,e[7]=a,e[8]=c):c=e[8],c}function ae(t,e){return s.jsxs("div",{className:"bg-card hover:bg-accent transition-colors flex flex-col rounded-lg animate-pulse",children:[s.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[s.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg"}),s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"}),s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"})]}),s.jsxs("div",{className:"p-4 border-t border-border flex items-center",children:[s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]},e)}const A=Object.assign(L,{Skeleton:re});function oe({invitation:t}){const[e,n]=C.useState(!1),[l,i]=C.useState(!1),r=O(),d=E(),o=async()=>{n(!0);try{const a=await _.organization.acceptInvitation({invitationId:t.id});if(a.error)w.error(a.error.message),n(!1);else{const c=await _.organization.setActive({organizationId:t.organizationId});c?.data?.slug?(w.success("Invitation accepted!"),d({to:"/$org",params:{org:c.data.slug}})):(w.success("Invitation accepted! Redirecting..."),d({to:"/"}))}}catch{w.error("Failed to accept invitation"),n(!1)}},m=async()=>{i(!0);try{const a=await _.organization.rejectInvitation({invitationId:t.id});a.error?(w.error(a.error.message),i(!1)):(w.success("Invitation rejected"),await r.invalidateQueries(),i(!1))}catch{w.error("Failed to reject invitation"),i(!1)}},x=t.organizationName||t.organizationId;return s.jsxs(u,{className:"border-dashed",children:[s.jsxs(u.Header,{children:[s.jsx(u.AvatarSection,{children:s.jsx(u.Avatar,{url:"",fallback:x,size:"lg",objectFit:"contain"})}),s.jsxs(u.Content,{children:[s.jsx(u.Subtitle,{children:"You've been invited to join"}),s.jsx(u.Title,{children:x})]})]}),s.jsx(u.Footer,{className:"border-t border-dashed",children:s.jsxs("div",{className:"flex h-3.5 items-center gap-2 w-full",children:[s.jsx($,{onClick:o,disabled:e||l,className:"flex-1",size:"sm",children:e?"Accepting...":s.jsxs(s.Fragment,{children:[s.jsx(H,{size:16}),"Accept"]})}),s.jsx($,{variant:"outline",onClick:m,disabled:e||l,className:"flex-1",size:"sm",children:l?"Declining...":s.jsxs(s.Fragment,{children:[s.jsx(q,{size:16}),"Decline"]})})]})})]})}function ce({query:t}){const e=C.useContext(F),{data:n}=e.hooks.useListUserInvitations(),i=(n??[]).filter(d=>d.status==="pending"&&new Date(d.expiresAt)>new Date),r=t?(()=>{const d=t.toLowerCase();return i.filter(o=>o.organizationName?.toLowerCase().includes(d)||o.organizationId.toLowerCase().includes(d))})():i;return r.length===0?null:s.jsxs("div",{className:"mb-16",children:[s.jsx("h2",{className:"text-lg font-medium pb-2 border-b border-border/50 mb-6 px-2",children:"Invitations"}),s.jsx(A,{columns:{sm:2,md:3,lg:4},children:r.map(d=>s.jsx(oe,{invitation:d},d.id))})]})}function de(t){const e=f.c(14),{query:n}=t,{data:l}=_.useListOrganizations(),i=E();let r;e[0]!==l||e[1]!==n?(r=l?n?(()=>{const a=n.toLowerCase();return l.filter(c=>c.name.toLowerCase().includes(a)||c.slug.toLowerCase().includes(a))})():l:[],e[0]=l,e[1]=n,e[2]=r):r=e[2];const d=r;if(!l||l.length===0){let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"No organizations yet. Create your first organization to get started."})}),e[3]=a):a=e[3],a}if(d.length===0){let a;return e[4]!==n?(a=s.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:s.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:['No organizations found matching "',n,'".']})}),e[4]=n,e[5]=a):a=e[5],a}let o;e[6]===Symbol.for("react.memo_cache_sentinel")?(o={sm:2,md:3,lg:4},e[6]=o):o=e[6];let m;if(e[7]!==d||e[8]!==i){let a;e[10]!==i?(a=c=>s.jsxs(u,{onNavigate:()=>i({to:"/$org",params:{org:c.slug}}),children:[s.jsxs(u.Header,{children:[s.jsx(u.AvatarSection,{children:s.jsx(u.Avatar,{url:c.logo||"",fallback:c.name,size:"lg",objectFit:"contain"})}),s.jsxs(u.Content,{children:[s.jsxs(u.Subtitle,{children:["@",c.slug]}),s.jsx(u.Title,{children:c.name})]})]}),s.jsx(u.Footer,{children:s.jsxs("div",{className:"flex h-3.5 items-center text-xs text-muted-foreground",children:["Created:"," ",new Date(c.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})]})})]},c.id),e[10]=i,e[11]=a):a=e[11],m=d.map(a),e[7]=d,e[8]=i,e[9]=m}else m=e[9];let x;return e[12]!==m?(x=s.jsx(A,{columns:o,children:m}),e[12]=m,e[13]=x):x=e[13],x}function me(t){const e=f.c(3),{error:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(D,{size:24,className:"text-destructive"}),e[0]=l):l=e[0];let i;return e[1]!==n.message?(i=s.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:[l,s.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Error loading organizations: ",n.message]})]}),e[1]=n.message,e[2]=i):i=e[2],i}function xe(){const t=f.c(27),{error:e,isPending:n}=_.useListOrganizations(),[l,i]=C.useState(""),[r,d]=C.useState(!1),o=C.useDeferredValue(l);if(n){let j;return t[0]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("div",{className:"max-w-6xl mx-auto p-8",children:s.jsx("div",{className:"@container",children:s.jsx(A.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}})})}),t[0]=j):j=t[0],j}if(e){let j;return t[1]!==e?(j=s.jsx("div",{className:"max-w-6xl mx-auto p-8",children:s.jsx(me,{error:e})}),t[1]=e,t[2]=j):j=t[2],j}let m;t[3]!==o?(m=s.jsx(C.Suspense,{fallback:null,children:s.jsx(ce,{query:o})}),t[3]=o,t[4]=m):m=t[4];let x;t[5]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("h2",{className:"text-lg font-medium",children:"My organizations"}),t[5]=x):x=t[5];let a;t[6]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Q,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),t[6]=a):a=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=j=>i(j.target.value),t[7]=c):c=t[7];let g;t[8]!==l?(g=s.jsxs("div",{className:"relative",children:[a,s.jsx(B,{className:"pl-8 h-8 w-52 border-none shadow-none focus-visible:ring-0",placeholder:"Search organizations...",value:l,onChange:c})]}),t[8]=l,t[9]=g):g=t[9];let p;t[10]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsxs($,{size:"sm",onClick:()=>d(!0),children:[s.jsx(G,{size:16}),s.jsx("span",{children:"New organization"})]}),t[10]=p):p=t[10];let v;t[11]!==g?(v=s.jsxs("div",{className:"flex items-center justify-between pb-2 border-b border-border/50 mb-6 px-2",children:[x,s.jsxs("div",{className:"flex items-center gap-3",children:[g,p]})]}),t[11]=g,t[12]=v):v=t[12];let N;t[13]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(A.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}}),t[13]=N):N=t[13];let b;t[14]!==o?(b=s.jsx(C.Suspense,{fallback:N,children:s.jsx(de,{query:o})}),t[14]=o,t[15]=b):b=t[15];let h;t[16]!==v||t[17]!==b?(h=s.jsxs("div",{children:[v,b]}),t[16]=v,t[17]=b,t[18]=h):h=t[18];let S;t[19]!==m||t[20]!==h?(S=s.jsxs("div",{className:"@container",children:[m,h]}),t[19]=m,t[20]=h,t[21]=S):S=t[21];let z;t[22]!==r?(z=s.jsx(T,{open:r,onOpenChange:d}),t[22]=r,t[23]=z):z=t[23];let I;return t[24]!==S||t[25]!==z?(I=s.jsxs("div",{className:"max-w-6xl mx-auto p-8",children:[S,z]}),t[24]=S,t[25]=z,t[26]=I):I=t[26],I}function Ae(){const t=f.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"min-h-full",children:s.jsx(xe,{})}),t[0]=e):e=t[0],e}export{Ae as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,j as t,_ as o}from"./index-BV-rIyOx.js";var s=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),d="VisuallyHidden",e=i.forwardRef((r,a)=>t.jsx(o.span,{...r,ref:a,style:{...s,...r.style}}));e.displayName=d;var n=e;export{n as R,s as V};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as v,c as S,u as K,j as a,a$ as $,am as W,b6 as X,_ as g,al as E,b7 as Y,an as k,b8 as w,av as Z,aq as I,ao as J,ap as Q}from"./index-BV-rIyOx.js";import{B as j}from"./button-Cl3WMTWk.js";import{T as ee,a as oe,c as te,b as re}from"./integration-icon-DKM9NBX1.js";import{c as ae}from"./Pin01-Dk_x7uai.js";import{u as se,a as ie}from"./use-organization-settings-Bu92wRjl.js";import{i as ne}from"./Loading01-DOPFYU4m.js";const A=({size:n=24,color:e="currentColor",...o})=>v.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},v.createElement("path",{d:"M3 9h13.5a4.5 4.5 0 1 1 0 9H12M3 9l4-4M3 9l4 4"}));A.displayName="FlipBackward";const N=({size:n=24,color:e="currentColor",...o})=>v.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},v.createElement("path",{d:"M7 3v3.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C7.76 8 8.04 8 8.6 8h6.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C17 7.24 17 6.96 17 6.4V4m0 17v-6.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C16.24 13 15.96 13 15.4 13H8.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C7 13.76 7 14.04 7 14.6V21M21 9.325V16.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h6.875c.489 0 .733 0 .963.055.204.05.4.13.579.24.201.123.374.296.72.642l3.126 3.126c.346.346.519.519.642.72.11.18.19.374.24.579.055.23.055.474.055.963Z"}));N.displayName="Save01";function ye(n){const e=S.c(19),{title:o,url:s,icon:r}=n,{org:t}=K(),c=se(t.id),R=ie(t.id);let p;e[0]!==c?.sidebar_items||e[1]!==s?(p=c?.sidebar_items?.some(C=>C.url===s),e[0]=c?.sidebar_items,e[1]=s,e[2]=p):p=e[2];const u=!!p;let f;e[3]!==R.update||e[4]!==r||e[5]!==u||e[6]!==c?.sidebar_items||e[7]!==o||e[8]!==s?(f=async()=>{const C=c?.sidebar_items||[];let y;u?y=C.filter(H=>H.url!==s):y=[...C,{title:o,url:s,icon:r}],await R.update.mutateAsync({sidebar_items:y})},e[3]=R.update,e[4]=r,e[5]=u,e[6]=c?.sidebar_items,e[7]=o,e[8]=s,e[9]=f):f=e[9];const l=f,m=u?"secondary":"outline";let i;e[10]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx(ae,{size:16}),e[10]=i):i=e[10];let d;e[11]!==l||e[12]!==m?(d=a.jsx(ee,{asChild:!0,children:a.jsx(j,{onClick:l,size:"icon",variant:m,className:"size-7 border border-input",children:i})}),e[11]=l,e[12]=m,e[13]=d):d=e[13];const b=u?"Pinned":"Pin to sidebar";let h;e[14]!==b?(h=a.jsx(oe,{children:b}),e[14]=b,e[15]=h):h=e[15];let x;return e[16]!==d||e[17]!==h?(x=a.jsx(te,{children:a.jsxs(re,{children:[d,h]})}),e[16]=d,e[17]=h,e[18]=x):x=e[18],x}function ke(n){const e=S.c(15),{onSave:o,onUndo:s,isDirty:r,isSaving:t,saveLabel:c,undoLabel:R}=n,p=c===void 0?"Save":c,u=R===void 0?"Undo":R;if(!r)return null;let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=a.jsx(A,{size:14}),e[0]=f):f=e[0];let l;e[1]!==t||e[2]!==s||e[3]!==u?(l=a.jsxs(j,{variant:"outline",size:"sm",onClick:s,disabled:t,"aria-label":u,children:[f,u]}),e[1]=t,e[2]=s,e[3]=u,e[4]=l):l=e[4];let m;e[5]!==t?(m=t?a.jsx(ne,{size:14,className:"animate-spin"}):a.jsx(N,{size:14}),e[5]=t,e[6]=m):m=e[6];let i;e[7]!==t||e[8]!==o||e[9]!==p||e[10]!==m?(i=a.jsxs(j,{variant:"default",size:"sm",onClick:o,disabled:t,"aria-label":p,children:[m,p]}),e[7]=t,e[8]=o,e[9]=p,e[10]=m,e[11]=i):i=e[11];let d;return e[12]!==l||e[13]!==i?(d=a.jsxs(a.Fragment,{children:[l,i]}),e[12]=l,e[13]=i,e[14]=d):d=e[14],d}var P="Radio",[ce,G]=I(P),[de,le]=ce(P),L=v.forwardRef((n,e)=>{const{__scopeRadio:o,name:s,checked:r=!1,required:t,disabled:c,value:R="on",onCheck:p,form:u,...f}=n,[l,m]=v.useState(null),i=E(e,h=>m(h)),d=v.useRef(!1),b=l?u||!!l.closest("form"):!0;return a.jsxs(de,{scope:o,checked:r,disabled:c,children:[a.jsx(g.button,{type:"button",role:"radio","aria-checked":r,"data-state":B(r),"data-disabled":c?"":void 0,disabled:c,value:R,...f,ref:i,onClick:k(n.onClick,h=>{r||p?.(),b&&(d.current=h.isPropagationStopped(),d.current||h.stopPropagation())})}),b&&a.jsx(T,{control:l,bubbles:!d.current,name:s,value:R,checked:r,required:t,disabled:c,form:u,style:{transform:"translateX(-100%)"}})]})});L.displayName=P;var z="RadioIndicator",M=v.forwardRef((n,e)=>{const{__scopeRadio:o,forceMount:s,...r}=n,t=le(z,o);return a.jsx(Z,{present:s||t.checked,children:a.jsx(g.span,{"data-state":B(t.checked),"data-disabled":t.disabled?"":void 0,...r,ref:e})})});M.displayName=z;var ue="RadioBubbleInput",T=v.forwardRef(({__scopeRadio:n,control:e,checked:o,bubbles:s=!0,...r},t)=>{const c=v.useRef(null),R=E(c,t),p=J(o),u=Q(e);return v.useEffect(()=>{const f=c.current;if(!f)return;const l=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(l,"checked").set;if(p!==o&&i){const d=new Event("click",{bubbles:s});i.call(f,o),f.dispatchEvent(d)}},[p,o,s]),a.jsx(g.input,{type:"radio","aria-hidden":!0,defaultChecked:o,...r,tabIndex:-1,ref:R,style:{...r.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});T.displayName=ue;function B(n){return n?"checked":"unchecked"}var pe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],_="RadioGroup",[fe]=I(_,[w,G]),D=w(),O=G(),[me,ve]=fe(_),F=v.forwardRef((n,e)=>{const{__scopeRadioGroup:o,name:s,defaultValue:r,value:t,required:c=!1,disabled:R=!1,orientation:p,dir:u,loop:f=!0,onValueChange:l,...m}=n,i=D(o),d=$(u),[b,h]=W({prop:t,defaultProp:r??null,onChange:l,caller:_});return a.jsx(me,{scope:o,name:s,required:c,disabled:R,value:b,onValueChange:h,children:a.jsx(X,{asChild:!0,...i,orientation:p,dir:d,loop:f,children:a.jsx(g.div,{role:"radiogroup","aria-required":c,"aria-orientation":p,"data-disabled":R?"":void 0,dir:d,...m,ref:e})})})});F.displayName=_;var V="RadioGroupItem",U=v.forwardRef((n,e)=>{const{__scopeRadioGroup:o,disabled:s,...r}=n,t=ve(V,o),c=t.disabled||s,R=D(o),p=O(o),u=v.useRef(null),f=E(e,u),l=t.value===r.value,m=v.useRef(!1);return v.useEffect(()=>{const i=b=>{pe.includes(b.key)&&(m.current=!0)},d=()=>m.current=!1;return document.addEventListener("keydown",i),document.addEventListener("keyup",d),()=>{document.removeEventListener("keydown",i),document.removeEventListener("keyup",d)}},[]),a.jsx(Y,{asChild:!0,...R,focusable:!c,active:l,children:a.jsx(L,{disabled:c,required:t.required,checked:l,...p,...r,name:t.name,ref:f,onCheck:()=>t.onValueChange(r.value),onKeyDown:k(i=>{i.key==="Enter"&&i.preventDefault()}),onFocus:k(r.onFocus,()=>{m.current&&u.current?.click()})})})});U.displayName=V;var Re="RadioGroupIndicator",q=v.forwardRef((n,e)=>{const{__scopeRadioGroup:o,...s}=n,r=O(o);return a.jsx(M,{...r,...s,ref:e})});q.displayName=Re;var je=F,Ee=U,Pe=q;export{Ee as I,ye as P,je as R,ke as S,Pe as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as d,av as z,aw as J,r as l,at as Q,am as ee,as as te,al as $,au as oe,_ as ne,an as R,aD as re,aE as se,ax as G,aq as ae,aI as ie,aF as le,c as j}from"./index-BV-rIyOx.js";import{R as ce}from"./index-BYzsWn1B.js";import{c as O}from"./utils-CfR4kXxZ.js";var[D]=ae("Tooltip",[G]),N=G(),F="TooltipProvider",ue=700,S="tooltip.open",[de,M]=D(F),B=o=>{const{__scopeTooltip:e,delayDuration:t=ue,skipDelayDuration:n=300,disableHoverableContent:r=!1,children:s}=o,i=l.useRef(!0),c=l.useRef(!1),a=l.useRef(0);return l.useEffect(()=>{const u=a.current;return()=>window.clearTimeout(u)},[]),d.jsx(de,{scope:e,isOpenDelayedRef:i,delayDuration:t,onOpen:l.useCallback(()=>{window.clearTimeout(a.current),i.current=!1},[]),onClose:l.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.current=!0,n)},[n]),isPointerInTransitRef:c,onPointerInTransitChange:l.useCallback(u=>{c.current=u},[]),disableHoverableContent:r,children:s})};B.displayName=F;var I="Tooltip",[pe,L]=D(I),q=o=>{const{__scopeTooltip:e,children:t,open:n,defaultOpen:r,onOpenChange:s,disableHoverableContent:i,delayDuration:c}=o,a=M(I,o.__scopeTooltip),u=N(e),[p,m]=l.useState(null),x=Q(),f=l.useRef(0),v=i??a.disableHoverableContent,g=c??a.delayDuration,h=l.useRef(!1),[y,T]=ee({prop:n,defaultProp:r??!1,onChange:P=>{P?(a.onOpen(),document.dispatchEvent(new CustomEvent(S))):a.onClose(),s?.(P)},caller:I}),C=l.useMemo(()=>y?h.current?"delayed-open":"instant-open":"closed",[y]),w=l.useCallback(()=>{window.clearTimeout(f.current),f.current=0,h.current=!1,T(!0)},[T]),b=l.useCallback(()=>{window.clearTimeout(f.current),f.current=0,T(!1)},[T]),E=l.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{h.current=!0,T(!0),f.current=0},g)},[g,T]);return l.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),d.jsx(te,{...u,children:d.jsx(pe,{scope:e,contentId:x,open:y,stateAttribute:C,trigger:p,onTriggerChange:m,onTriggerEnter:l.useCallback(()=>{a.isOpenDelayedRef.current?E():w()},[a.isOpenDelayedRef,E,w]),onTriggerLeave:l.useCallback(()=>{v?b():(window.clearTimeout(f.current),f.current=0)},[b,v]),onOpen:w,onClose:b,disableHoverableContent:v,children:t})})};q.displayName=I;var A="TooltipTrigger",V=l.forwardRef((o,e)=>{const{__scopeTooltip:t,...n}=o,r=L(A,t),s=M(A,t),i=N(t),c=l.useRef(null),a=$(e,c,r.onTriggerChange),u=l.useRef(!1),p=l.useRef(!1),m=l.useCallback(()=>u.current=!1,[]);return l.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),d.jsx(oe,{asChild:!0,...i,children:d.jsx(ne.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...n,ref:a,onPointerMove:R(o.onPointerMove,x=>{x.pointerType!=="touch"&&!p.current&&!s.isPointerInTransitRef.current&&(r.onTriggerEnter(),p.current=!0)}),onPointerLeave:R(o.onPointerLeave,()=>{r.onTriggerLeave(),p.current=!1}),onPointerDown:R(o.onPointerDown,()=>{r.open&&r.onClose(),u.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:R(o.onFocus,()=>{u.current||r.onOpen()}),onBlur:R(o.onBlur,r.onClose),onClick:R(o.onClick,r.onClose)})})});V.displayName=A;var H="TooltipPortal",[fe,me]=D(H,{forceMount:void 0}),U=o=>{const{__scopeTooltip:e,forceMount:t,children:n,container:r}=o,s=L(H,e);return d.jsx(fe,{scope:e,forceMount:t,children:d.jsx(z,{present:t||s.open,children:d.jsx(J,{asChild:!0,container:r,children:n})})})};U.displayName=H;var _="TooltipContent",W=l.forwardRef((o,e)=>{const t=me(_,o.__scopeTooltip),{forceMount:n=t.forceMount,side:r="top",...s}=o,i=L(_,o.__scopeTooltip);return d.jsx(z,{present:n||i.open,children:i.disableHoverableContent?d.jsx(Y,{side:r,...s,ref:e}):d.jsx(xe,{side:r,...s,ref:e})})}),xe=l.forwardRef((o,e)=>{const t=L(_,o.__scopeTooltip),n=M(_,o.__scopeTooltip),r=l.useRef(null),s=$(e,r),[i,c]=l.useState(null),{trigger:a,onClose:u}=t,p=r.current,{onPointerInTransitChange:m}=n,x=l.useCallback(()=>{c(null),m(!1)},[m]),f=l.useCallback((v,g)=>{const h=v.currentTarget,y={x:v.clientX,y:v.clientY},T=Te(y,h.getBoundingClientRect()),C=ye(y,T),w=Ce(g.getBoundingClientRect()),b=we([...C,...w]);c(b),m(!0)},[m]);return l.useEffect(()=>()=>x(),[x]),l.useEffect(()=>{if(a&&p){const v=h=>f(h,p),g=h=>f(h,a);return a.addEventListener("pointerleave",v),p.addEventListener("pointerleave",g),()=>{a.removeEventListener("pointerleave",v),p.removeEventListener("pointerleave",g)}}},[a,p,f,x]),l.useEffect(()=>{if(i){const v=g=>{const h=g.target,y={x:g.clientX,y:g.clientY},T=a?.contains(h)||p?.contains(h),C=!be(y,i);T?x():C&&(x(),u())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[a,p,i,u,x]),d.jsx(Y,{...o,ref:s})}),[he,ve]=D(I,{isInside:!1}),ge=ie("TooltipContent"),Y=l.forwardRef((o,e)=>{const{__scopeTooltip:t,children:n,"aria-label":r,onEscapeKeyDown:s,onPointerDownOutside:i,...c}=o,a=L(_,t),u=N(t),{onClose:p}=a;return l.useEffect(()=>(document.addEventListener(S,p),()=>document.removeEventListener(S,p)),[p]),l.useEffect(()=>{if(a.trigger){const m=x=>{x.target?.contains(a.trigger)&&p()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[a.trigger,p]),d.jsx(re,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:m=>m.preventDefault(),onDismiss:p,children:d.jsxs(se,{"data-state":a.stateAttribute,...u,...c,ref:e,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[d.jsx(ge,{children:n}),d.jsx(he,{scope:t,isInside:!0,children:d.jsx(ce,{id:a.contentId,role:"tooltip",children:r||n})})]})})});W.displayName=_;var Z="TooltipArrow",X=l.forwardRef((o,e)=>{const{__scopeTooltip:t,...n}=o,r=N(t);return ve(Z,t).isInside?null:d.jsx(le,{...r,...n,ref:e})});X.displayName=Z;function Te(o,e){const t=Math.abs(e.top-o.y),n=Math.abs(e.bottom-o.y),r=Math.abs(e.right-o.x),s=Math.abs(e.left-o.x);switch(Math.min(t,n,r,s)){case s:return"left";case r:return"right";case t:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function ye(o,e,t=5){const n=[];switch(e){case"top":n.push({x:o.x-t,y:o.y+t},{x:o.x+t,y:o.y+t});break;case"bottom":n.push({x:o.x-t,y:o.y-t},{x:o.x+t,y:o.y-t});break;case"left":n.push({x:o.x+t,y:o.y-t},{x:o.x+t,y:o.y+t});break;case"right":n.push({x:o.x-t,y:o.y-t},{x:o.x-t,y:o.y+t});break}return n}function Ce(o){const{top:e,right:t,bottom:n,left:r}=o;return[{x:r,y:e},{x:t,y:e},{x:t,y:n},{x:r,y:n}]}function be(o,e){const{x:t,y:n}=o;let r=!1;for(let s=0,i=e.length-1;s<e.length;i=s++){const c=e[s],a=e[i],u=c.x,p=c.y,m=a.x,x=a.y;p>n!=x>n&&t<(m-u)*(n-p)/(x-p)+u&&(r=!r)}return r}function we(o){const e=o.slice();return e.sort((t,n)=>t.x<n.x?-1:t.x>n.x?1:t.y<n.y?-1:t.y>n.y?1:0),Ee(e)}function Ee(o){if(o.length<=1)return o.slice();const e=[];for(let n=0;n<o.length;n++){const r=o[n];for(;e.length>=2;){const s=e[e.length-1],i=e[e.length-2];if((s.x-i.x)*(r.y-i.y)>=(s.y-i.y)*(r.x-i.x))e.pop();else break}e.push(r)}e.pop();const t=[];for(let n=o.length-1;n>=0;n--){const r=o[n];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(r.y-i.y)>=(s.y-i.y)*(r.x-i.x))t.pop();else break}t.push(r)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}var Pe=B,Re=q,_e=V,je=U,Ie=W,Le=X;const K=({size:o=24,color:e="currentColor",...t})=>l.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},l.createElement("path",{d:"M20.5 7.278 12 12m0 0L3.5 7.278M12 12v9.5m9-5.441V7.942c0-.343 0-.514-.05-.667a1 1 0 0 0-.215-.364c-.109-.119-.258-.202-.558-.368l-7.4-4.111c-.284-.158-.425-.237-.575-.267a1 1 0 0 0-.403 0c-.15.03-.292.11-.576.267l-7.4 4.11c-.3.167-.45.25-.558.369a1 1 0 0 0-.215.364C3 7.428 3 7.599 3 7.942v8.117c0 .342 0 .514.05.666a1 1 0 0 0 .215.364c.109.119.258.202.558.368l7.4 4.111c.284.158.425.237.576.268.133.027.27.027.402 0 .15-.031.292-.11.576-.268l7.4-4.11c.3-.167.45-.25.558-.369a.999.999 0 0 0 .215-.364c.05-.152.05-.324.05-.666Z"}));K.displayName="Container";function ke(o){const e=j.c(6);let t,n;e[0]!==o?({delayDuration:n,...t}=o,e[0]=o,e[1]=t,e[2]=n):(t=e[1],n=e[2]);const r=n===void 0?0:n;let s;return e[3]!==r||e[4]!==t?(s=d.jsx(Pe,{"data-slot":"tooltip-provider",delayDuration:r,...t}),e[3]=r,e[4]=t,e[5]=s):s=e[5],s}function ze(o){const e=j.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let n;return e[2]!==t?(n=d.jsx(ke,{children:d.jsx(Re,{"data-slot":"tooltip",...t})}),e[2]=t,e[3]=n):n=e[3],n}function $e(o){const e=j.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let n;return e[2]!==t?(n=d.jsx(_e,{"data-slot":"tooltip-trigger",...t}),e[2]=t,e[3]=n):n=e[3],n}function Ge(o){const e=j.c(13);let t,n,r,s;e[0]!==o?({className:n,sideOffset:s,children:t,...r}=o,e[0]=o,e[1]=t,e[2]=n,e[3]=r,e[4]=s):(t=e[1],n=e[2],r=e[3],s=e[4]);const i=s===void 0?0:s;let c;e[5]!==n?(c=O("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",n),e[5]=n,e[6]=c):c=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Le,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==i||e[11]!==c?(u=d.jsx(je,{children:d.jsxs(Ie,{"data-slot":"tooltip-content",sideOffset:i,className:c,...r,children:[t,a]})}),e[8]=t,e[9]=r,e[10]=i,e[11]=c,e[12]=u):u=e[12],u}const Oe={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-8 w-8",md:"h-12 w-12",lg:"h-16 w-16"},De={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-8",md:"min-w-12",lg:"min-w-16"},Ne={"2xs":8,xs:12,sm:16,md:24,lg:32};function Fe(o){const e=j.c(7),{icon:t,name:n,size:r,className:s,fallbackIcon:i}=o,c=r===void 0?"md":r,a=t??"no-icon";let u;return e[0]!==s||e[1]!==i||e[2]!==t||e[3]!==n||e[4]!==c||e[5]!==a?(u=d.jsx(Se,{icon:t,name:n,size:c,className:s,fallbackIcon:i},a),e[0]=s,e[1]=i,e[2]=t,e[3]=n,e[4]=c,e[5]=a,e[6]=u):u=e[6],u}function Se(o){const e=j.c(24),{icon:t,name:n,size:r,className:s,fallbackIcon:i}=o,c=r===void 0?"md":r,[a,u]=l.useState(!1),p=!!t&&a,m=Oe[c],x=De[c];let f;e[0]!==s||e[1]!==m||e[2]!==x?(f=O("rounded-lg border border-border shrink-0 overflow-hidden aspect-square",m,x,s),e[0]=s,e[1]=m,e[2]=x,e[3]=f):f=e[3];const v=t||void 0,g=!p&&"hidden";let h;e[4]!==g?(h=O("h-full w-full object-cover",g),e[4]=g,e[5]=h):h=e[5];let y,T;e[6]===Symbol.for("react.memo_cache_sentinel")?(y=()=>u(!1),T=()=>u(!0),e[6]=y,e[7]=T):(y=e[6],T=e[7]);let C;e[8]!==n||e[9]!==v||e[10]!==h?(C=d.jsx("img",{src:v,alt:n,className:h,onError:y,onLoad:T}),e[8]=n,e[9]=v,e[10]=h,e[11]=C):C=e[11];const w=p&&"hidden";let b;e[12]!==w?(b=O("h-full w-full flex items-center justify-center bg-muted/20",w),e[12]=w,e[13]=b):b=e[13];let E;e[14]!==i||e[15]!==c?(E=i??d.jsx(K,{size:Ne[c],className:"text-muted-foreground"}),e[14]=i,e[15]=c,e[16]=E):E=e[16];let P;e[17]!==b||e[18]!==E?(P=d.jsx("div",{className:b,children:E}),e[17]=b,e[18]=E,e[19]=P):P=e[19];let k;return e[20]!==C||e[21]!==P||e[22]!==f?(k=d.jsxs("div",{className:f,children:[C,P]}),e[20]=C,e[21]=P,e[22]=f,e[23]=k):k=e[23],k}export{Fe as I,$e as T,Ge as a,ze as b,ke as c,K as n};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r,c as p,Z as w,j as n}from"./index-BV-rIyOx.js";import{P as x}from"./index-9vOB29ZB.js";const R=r.createContext(null);function H(m){const e=p.c(3),{children:l}=m,t=r.useContext(R);if(!t?.tabsEl)return null;let s;return e[0]!==l||e[1]!==t.tabsEl?(s=w.createPortal(l,t.tabsEl),e[0]=l,e[1]=t.tabsEl,e[2]=s):s=e[2],s}function L(m){const e=p.c(3),{children:l}=m,t=r.useContext(R);if(!t?.actionsEl)return null;let s;return e[0]!==l||e[1]!==t.actionsEl?(s=w.createPortal(l,t.actionsEl),e[0]=l,e[1]=t.actionsEl,e[2]=s):s=e[2],s}function $(m){const e=p.c(18),{children:l,breadcrumb:t}=m,[s,y]=r.useState(null),[j,C]=r.useState(null),S=r.useRef(null),V=r.useRef(null);let E;e[0]===Symbol.for("react.memo_cache_sentinel")?(E=c=>{S.current=c,c&&y(c)},e[0]=E):E=e[0];const g=E;let b;e[1]===Symbol.for("react.memo_cache_sentinel")?(b=c=>{V.current=c,c&&C(c)},e[1]=b):b=e[1];const v=b;let a;e[2]!==j||e[3]!==s?(a={tabsEl:s,actionsEl:j},e[2]=j,e[3]=s,e[4]=a):a=e[4];let o;e[5]!==t?(o=n.jsx(x.Header.Left,{children:t}),e[5]=t,e[6]=o):o=e[6];let h;e[7]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsxs(x.Header.Right,{children:[n.jsx("div",{ref:g,className:"flex items-center gap-2 overflow-x-auto min-w-0"}),n.jsx("div",{ref:v,className:"flex items-center gap-2 shrink-0"})]}),e[7]=h):h=e[7];let i;e[8]!==o?(i=n.jsxs(x.Header,{children:[o,h]}),e[8]=o,e[9]=i):i=e[9];let f;e[10]!==l?(f=n.jsx(x.Content,{children:l}),e[10]=l,e[11]=f):f=e[11];let u;e[12]!==i||e[13]!==f?(u=n.jsxs(x,{children:[i,f]}),e[12]=i,e[13]=f,e[14]=u):u=e[14];let d;return e[15]!==a||e[16]!==u?(d=n.jsx(R,{value:a,children:u}),e[15]=a,e[16]=u,e[17]=d):d=e[17],d}export{L as V,$ as a,H as b};
|