@decocms/mesh 2.136.1 → 2.137.1
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-CXJCnY_R.js → AlertCircle-CDfSbMYU.js} +1 -1
- package/dist/client/assets/{AlignLeft-Ckpqqq7X.js → AlignLeft-COBPN-dw.js} +1 -1
- package/dist/client/assets/{ArrowDown-BXCgJapO.js → ArrowDown--gkX_owV.js} +1 -1
- package/dist/client/assets/{ArrowLeft-ihbjidrQ.js → ArrowLeft-BKJmf-2C.js} +1 -1
- package/dist/client/assets/{ArrowUp-B3tPpNuu.js → ArrowUp-rrmvydrg.js} +1 -1
- package/dist/client/assets/{Check-G22LpKFd.js → Check-7GSwp3W5.js} +1 -1
- package/dist/client/assets/{CheckCircle-Dl3Eh5mw.js → CheckCircle-C5FdwcRt.js} +1 -1
- package/dist/client/assets/{CheckDone01-DQOA8kaK.js → CheckDone01-DpviC1NH.js} +1 -1
- package/dist/client/assets/{CheckVerified02-C58oaMz8.js → CheckVerified02-De5VMnDN.js} +1 -1
- package/dist/client/assets/{ChevronDown-DAk1F2Sn.js → ChevronDown-ChPT11Ez.js} +1 -1
- package/dist/client/assets/{ChevronLeft-CGPjZdmg.js → ChevronLeft-DHRHAgsy.js} +1 -1
- package/dist/client/assets/{ChevronRight-BT7U8Kip.js → ChevronRight-FmI6dMba.js} +1 -1
- package/dist/client/assets/{Clock-CPO-Cqx6.js → Clock-DDxGnELb.js} +1 -1
- package/dist/client/assets/{Code01-UXkm6aqY.js → Code01-CWyxieGp.js} +1 -1
- package/dist/client/assets/{Container-CyEPuAYL.js → Container-Cgd7ql-V.js} +1 -1
- package/dist/client/assets/{Copy01-tzx60ICS.js → Copy01-C37rMn4w.js} +1 -1
- package/dist/client/assets/{Dataflow03-mD5gBD1P.js → Dataflow03-BVFf_7xR.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-9qiIYu_T.js → DotsHorizontal-C6V9FLhq.js} +1 -1
- package/dist/client/assets/{DotsVertical-DHxrk-2J.js → DotsVertical-Dzaq8Mhx.js} +1 -1
- package/dist/client/assets/{Download01-DM18IWVp.js → Download01-DkdFaa8w.js} +1 -1
- package/dist/client/assets/{Edit01-D3PaS600.js → Edit01-DrV0fREc.js} +1 -1
- package/dist/client/assets/{Edit05-B64h7zay.js → Edit05-FWfCXRpg.js} +1 -1
- package/dist/client/assets/{Eye-C_LYW9jG.js → Eye-BI4uxtve.js} +1 -1
- package/dist/client/assets/{File02-CY9LI3Y-.js → File02-DNOFUv5K.js} +1 -1
- package/dist/client/assets/{File06-Dy7xo8XS.js → File06-HEk7XV-X.js} +1 -1
- package/dist/client/assets/{FilterLines-BvkJQ7ij.js → FilterLines-UqoZtP8f.js} +1 -1
- package/dist/client/assets/{Globe01-39jWI59e.js → Globe01-CxPi_PIR.js} +1 -1
- package/dist/client/assets/{Globe02-X-Xm1ngz.js → Globe02-CSnMRbL7.js} +1 -1
- package/dist/client/assets/{Grid01-DTf5JuyC.js → Grid01-Z_aBgjR1.js} +1 -1
- package/dist/client/assets/{Hash02-AH6eTaow.js → Hash02-BLCmp6Vt.js} +1 -1
- package/dist/client/assets/{Home02-DzIcdgJH.js → Home02-CYO3PJru.js} +1 -1
- package/dist/client/assets/{Image01-Dvb2vnmH.js → Image01-CfnZe9rg.js} +1 -1
- package/dist/client/assets/{Inbox01-CsvPcK33.js → Inbox01-DOC6mNVz.js} +1 -1
- package/dist/client/assets/{InfoCircle-D2mDfen0.js → InfoCircle-DbdenI7P.js} +1 -1
- package/dist/client/assets/{Key01-C3Fh3hes.js → Key01-DZq8Y-qx.js} +1 -1
- package/dist/client/assets/{LayersTwo01-CRgWs3EX.js → LayersTwo01--BX8EUx6.js} +1 -1
- package/dist/client/assets/{LayoutLeft-C-0_xlw0.js → LayoutLeft-DJBgHYMp.js} +1 -1
- package/dist/client/assets/{Link01-C74Jreax.js → Link01-B9k2OvXL.js} +1 -1
- package/dist/client/assets/{LinkExternal01-D6xwQf32.js → LinkExternal01-3tED60-W.js} +1 -1
- package/dist/client/assets/{List-DJEz6yKj.js → List-sGrrhtna.js} +1 -1
- package/dist/client/assets/{Loading01-B3gOoSbd.js → Loading01-C6-YM0t3.js} +1 -1
- package/dist/client/assets/{Lock01-CodP_ius.js → Lock01-CljHWjRx.js} +1 -1
- package/dist/client/assets/{Play-CxAaQi_l.js → Play-DQSwyrb3.js} +1 -1
- package/dist/client/assets/{Plus-Bo0L9uYY.js → Plus-CXLSJ2vT.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-v6pXwg6P.js → RefreshCcw01-CZCaL2cX.js} +1 -1
- package/dist/client/assets/{Save01-CU3VjXKO.js → Save01-DILOKgzP.js} +1 -1
- package/dist/client/assets/{SearchMd-Cpf31N-H.js → SearchMd-COEIH0v3.js} +1 -1
- package/dist/client/assets/{Settings01-BmEB9pVn.js → Settings01-DBWL714A.js} +1 -1
- package/dist/client/assets/{Shield01-CqrrEAw-.js → Shield01-bnbuRp_-.js} +1 -1
- package/dist/client/assets/{Terminal-BS-6VR5p.js → Terminal-BZz3wPtn.js} +1 -1
- package/dist/client/assets/{Trash01-HuK-pEft.js → Trash01--vKoTSp4.js} +1 -1
- package/dist/client/assets/{Upload01-DcyyJb_e.js → Upload01-SqOzgqHI.js} +1 -1
- package/dist/client/assets/{Users03-CPWgVi4r.js → Users03-DyVqsceZ.js} +1 -1
- package/dist/client/assets/{X-uHaUni9w.js → X-DhwUEYsK.js} +1 -1
- package/dist/client/assets/{XCircle-C4iqiznn.js → XCircle-B_RUkXkO.js} +1 -1
- package/dist/client/assets/{XClose-DGYV-4S5.js → XClose-CW5Jj6cd.js} +1 -1
- package/dist/client/assets/{Zap-5c_DBEtK.js → Zap-BGyV9Blh.js} +1 -1
- package/dist/client/assets/{agent-connections-preview-BsjSZYGn.js → agent-connections-preview-ChucuRdB.js} +1 -1
- package/dist/client/assets/agent-detail-CoksR_0D.js +2 -0
- package/dist/client/assets/agents-DpYfLQsr.js +1 -0
- package/dist/client/assets/{alert-dialog-D3oCqQtu.js → alert-dialog-CdMUELHW.js} +2 -2
- package/dist/client/assets/{auth-catchall-bz6gJ41s.js → auth-catchall-DbhfbiRT.js} +1 -1
- package/dist/client/assets/{avatar-rYlL0ZoJ.js → avatar-aThlfcuX.js} +1 -1
- package/dist/client/assets/{badge-CxJArm69.js → badge-Ct7IuYpT.js} +1 -1
- package/dist/client/assets/{binder-BXDCztlr.js → binder-C0Fce9oU.js} +1 -1
- package/dist/client/assets/{breadcrumb-CGrLS5HH.js → breadcrumb-DUSdLdjE.js} +1 -1
- package/dist/client/assets/{card-CAORA3L1.js → card-Bahv4Qty.js} +1 -1
- package/dist/client/assets/{chart-DX1_yJHY.js → chart-DfFHmfIA.js} +1 -1
- package/dist/client/assets/{checkbox-BCSzUsPR.js → checkbox-BFwO6w15.js} +1 -1
- package/dist/client/assets/{circle-alert-B4C3d1aQ.js → circle-alert-3gv1Da7I.js} +1 -1
- package/dist/client/assets/{collapsible-sQONDG4w.js → collapsible-Dz2AuNbD.js} +1 -1
- package/dist/client/assets/{collection-detail-B42SRwNb.js → collection-detail-DD8CaqQ8.js} +1 -1
- package/dist/client/assets/{collection-display-button-M7dfC2Rf.js → collection-display-button-xeP75Nbi.js} +1 -1
- package/dist/client/assets/{collection-search-q4T1hb73.js → collection-search-DKcTdIrj.js} +1 -1
- package/dist/client/assets/{collection-tab-e-VwhAzh.js → collection-tab-XETKJ01K.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DXH0yXJC.js → collection-table-wrapper-DeY8KPVc.js} +1 -1
- package/dist/client/assets/{collection-tabs-BbVq4J-5.js → collection-tabs-Bucep7_L.js} +1 -1
- package/dist/client/assets/{command-CPQN970u.js → command-Donk3LzG.js} +1 -1
- package/dist/client/assets/{connect-BGH3KdkD.js → connect-Bgx5y_wW.js} +1 -1
- package/dist/client/assets/{connection-card-DTiOZbAC.js → connection-card--5cURckx.js} +1 -1
- package/dist/client/assets/connection-detail-DmXKtOlb.js +1 -0
- package/dist/client/assets/connection-status-BYHAtPo_.js +1 -0
- package/dist/client/assets/connections-DTQDjzWQ.js +1 -0
- package/dist/client/assets/constants-DQPzgVSi.js +1 -0
- package/dist/client/assets/{constants-D9bRXDQp.js → constants-pRGR6V3c.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-Bs4zbKG7.js → create-organization-dialog-Ce6Zd1pI.js} +1 -1
- package/dist/client/assets/{create-project-dialog-BkL7vqeo.js → create-project-dialog-DNzOobPU.js} +1 -1
- package/dist/client/assets/{danger-C_vn0auF.js → danger-Dmbacq_h.js} +1 -1
- package/dist/client/assets/{danger-zone-CdUOoCFt.js → danger-zone-Dj24jmeQ.js} +1 -1
- package/dist/client/assets/{decopilot-events-DHSwekTa.js → decopilot-events-DLB0UdXm.js} +1 -1
- package/dist/client/assets/{dependencies-DTmw6OGT.js → dependencies-B2ZU3ABK.js} +1 -1
- package/dist/client/assets/{dialog-Baq_fjtR.js → dialog-Cn0qz-53.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CSqO4Mxn.js → dropdown-menu-Cb7-sbbq.js} +1 -1
- package/dist/client/assets/dynamic-plugin-layout-M5Eq8Crt.js +1 -0
- package/dist/client/assets/{editable-task-title-HUenZvZX.js → editable-task-title-DrBlByhA.js} +1 -1
- package/dist/client/assets/{empty-state-BPClkF2j.js → empty-state-DtUIUE3E.js} +1 -1
- package/dist/client/assets/{env-vars-editor-DDp7f4JN.js → env-vars-editor-3GnQaV0p.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BkJeK0tX.js → extract-connection-data-jK1gncap.js} +1 -1
- package/dist/client/assets/{file-browser-DVzV35Ko.js → file-browser-BzSo22zz.js} +2 -2
- package/dist/client/assets/{form-C5R0_qWR.js → form-CbNxgfbV.js} +1 -1
- package/dist/client/assets/{general-mBNwCpsS.js → general-2_YtUY3Z.js} +1 -1
- package/dist/client/assets/{grid-view-7eQhfO8f.js → grid-view-Cbr17gaY.js} +1 -1
- package/dist/client/assets/{home-okrTp5Gh.js → home-C9sh3vC-.js} +1 -1
- package/dist/client/assets/{icon-picker-DevrZ9IQ.js → icon-picker-CDIGURvR.js} +1 -1
- package/dist/client/assets/{index-ByA6j7_H.js → index-0E6FQmEq.js} +1 -1
- package/dist/client/assets/{index-DYY56DJY.js → index-95i0wafw.js} +1 -1
- package/dist/client/assets/{index-BWSvBz7o.js → index-B31DAXRu.js} +1 -1
- package/dist/client/assets/{index-UbeVlDrq.js → index-BYU_p-Hw.js} +1 -1
- package/dist/client/assets/{index-CvEIDmnk.js → index-CE6p8TZj.js} +1 -1
- package/dist/client/assets/{index-B_0vsVr1.js → index-CXatWfzV.js} +3 -3
- package/dist/client/assets/{index-QCmdl8uj.js → index-CrBqbeFx.js} +1 -1
- package/dist/client/assets/{index-BK6i23a9.js → index-Yw1YsXfS.js} +1 -1
- package/dist/client/assets/index-aeM3HkvM.js +1 -0
- package/dist/client/assets/{infiniteQueryObserver-DKiK82rX.js → infiniteQueryObserver-xEtOAOlf.js} +1 -1
- package/dist/client/assets/{input-CW7SVowR.js → input-DaSTALRa.js} +1 -1
- package/dist/client/assets/{integration-icon-DAFtApWT.js → integration-icon-BWGInwzE.js} +1 -1
- package/dist/client/assets/{label-DWU1nKSS.js → label-Cz1gDfZr.js} +1 -1
- package/dist/client/assets/layout-DWGAxkP7.js +1 -0
- package/dist/client/assets/{layout-CzVwolFw.js → layout-R5vuPyDk.js} +1 -1
- package/dist/client/assets/{localstorage-keys-BAzeyS9J.js → localstorage-keys-CgCmIvX_.js} +1 -1
- package/dist/client/assets/login-BmochyZ8.js +1 -0
- package/dist/client/assets/{markdown-DCSB9ejV.js → markdown-jOGmgWLE.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-BtuEhdWL.js → mcp-app-renderer-CNMPWYci.js} +1 -1
- package/dist/client/assets/{mcp-oauth-D8pA0WRM.js → mcp-oauth-CHWkyQ_o.js} +1 -1
- package/dist/client/assets/{mcp-server-card-D7xlSyX7.js → mcp-server-card-BYPRZ4Mx.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-DdKXdUu2.js → mcp-server-detail-BYnsfzlx.js} +2 -2
- package/dist/client/assets/members-_FYRV3x-.js +3 -0
- package/dist/client/assets/{monaco-editor-zyWgiZEt.js → monaco-editor-CYIuSo4G.js} +1 -1
- package/dist/client/assets/{monitoring-SM_c8qxT.js → monitoring-B4cf8LSE.js} +1 -1
- package/dist/client/assets/monitoring-dashboard-edit-CZBk43uL.js +1 -0
- package/dist/client/assets/{monitoring-dashboard-view-C3qQNwfm.js → monitoring-dashboard-view-RKXmPCbI.js} +2 -2
- package/dist/client/assets/{oauth-callback-1SC3hH5y.js → oauth-callback-CKnkEQ7I.js} +1 -1
- package/dist/client/assets/page-B6aElMOD.js +1 -0
- package/dist/client/assets/{page-hoODnFtN.js → page-BwwY8YJS.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-Cl_h_OgT.js → plugin-empty-state-C0VPjhVD.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-Doboc7Tq.js → plugin-empty-state-Cxt9cx3p.js} +1 -1
- package/dist/client/assets/{plugin-header-C4Dfehzm.js → plugin-header-CnPVI1E7.js} +1 -1
- package/dist/client/assets/{plugin-header-DNeaPoeS.js → plugin-header-rajZt28H.js} +1 -1
- package/dist/client/assets/plugins-nba08fNq.js +1 -0
- package/dist/client/assets/{popover-BNZ96bFv.js → popover-Bg87v5uw.js} +1 -1
- package/dist/client/assets/{project-app-view-Bsbq4Qf_.js → project-app-view-BAcMTkoN.js} +1 -1
- package/dist/client/assets/{project-layout-B4cnkESa.js → project-layout-Cr-ZQtUn.js} +1 -1
- package/dist/client/assets/{project-plugins-CqDaIw1P.js → project-plugins-Cja9V9PQ.js} +1 -1
- package/dist/client/assets/{projects-list-CgsVuZof.js → projects-list-EKC6iSOa.js} +1 -1
- package/dist/client/assets/{readme-viewer-CKidIXa3.js → readme-viewer-CiuKosx7.js} +1 -1
- package/dist/client/assets/{registry-layout-oUh5Zl7W.js → registry-layout-Bb804iff.js} +1 -1
- package/dist/client/assets/{registry-utils-DXJps8H7.js → registry-utils-C1Nu4ZSY.js} +1 -1
- package/dist/client/assets/{reports-layout-CFJRqv-Q.js → reports-layout-C2C1YKTp.js} +1 -1
- package/dist/client/assets/{reset-password-ZQI9gTW6.js → reset-password-C8GKwPxM.js} +1 -1
- package/dist/client/assets/{resizable-CWRglWOX.js → resizable-Wmol2aQw.js} +1 -1
- package/dist/client/assets/{save-actions-eGQZXGI3.js → save-actions-B12AYLia.js} +1 -1
- package/dist/client/assets/{scroll-area-By1z4ZyY.js → scroll-area-BdzrbesB.js} +1 -1
- package/dist/client/assets/{select-CYY4CENz.js → select-CGgfvTrg.js} +1 -1
- package/dist/client/assets/{shell-layout-DMKfJTmj.js → shell-layout-BKYJe5-g.js} +2 -2
- package/dist/client/assets/{sidebar-settings-ILgspCqY.js → sidebar-settings-BOmOauW6.js} +1 -1
- package/dist/client/assets/{skeleton-C4ZMp7sl.js → skeleton-s6eVgNBV.js} +1 -1
- package/dist/client/assets/{spinner-oA3jiJW_.js → spinner-D9P8FdgJ.js} +1 -1
- package/dist/client/assets/{store-invite-Bfy0Alsf.js → store-invite-Cc-Zoxvh.js} +1 -1
- package/dist/client/assets/switch-C1FVDNR_.js +1 -0
- package/dist/client/assets/{table-RFgqEt_E.js → table-Br2b7C40.js} +1 -1
- package/dist/client/assets/tabs-abEgAew6.js +1 -0
- package/dist/client/assets/tasks-CVXnSiIP.js +1 -0
- package/dist/client/assets/{tasks-panel-C7RwVTDD.js → tasks-panel-CK2OIyGv.js} +1 -1
- package/dist/client/assets/{textarea-4HpXofT0.js → textarea-D_7AK-CT.js} +1 -1
- package/dist/client/assets/{time-range-picker-Cx2A-Fs_.js → time-range-picker-VuSy_OC_.js} +1 -1
- package/dist/client/assets/{toggle-group-CVFHcp8K.js → toggle-group-27bAoVQM.js} +1 -1
- package/dist/client/assets/tools-list-CRyZEJKw.js +1 -0
- package/dist/client/assets/tooltip-BCRsDd6i.js +1 -0
- package/dist/client/assets/{topbar-portal-DOwsTUY4.js → topbar-portal-CGCqpxtq.js} +1 -1
- package/dist/client/assets/{types-B46wd5bS.js → types-BP-6JxYu.js} +1 -1
- package/dist/client/assets/use-binding-DaX_BB_N.js +1 -0
- package/dist/client/assets/{use-collections-vccihohV.js → use-collections-DIbZKU1B.js} +1 -1
- package/dist/client/assets/{use-connection-DeEn4qfI.js → use-connection-pr8Jgck6.js} +1 -1
- package/dist/client/assets/{use-copy-CykDvxn6.js → use-copy-Dg5u2n7f.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DB14T-Ft.js → use-create-virtual-mcp-CrgEt_WQ.js} +1 -1
- package/dist/client/assets/{use-install-from-registry-BeHRHLDl.js → use-install-from-registry-CzttwsCD.js} +1 -1
- package/dist/client/assets/{use-list-state-ykkfYLR3.js → use-list-state-DbdrQ-0O.js} +1 -1
- package/dist/client/assets/{use-llm-B_iPCa-K.js → use-llm-ReiQCdap.js} +1 -1
- package/dist/client/assets/{use-mcp-resources-Rqzq7A0J.js → use-mcp-resources-CU0mYqts.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BXihKxpu.js → use-mcp-tools-BlnxuTzH.js} +1 -1
- package/dist/client/assets/{use-members-DAcqcxDX.js → use-members-DFQZCKcr.js} +1 -1
- package/dist/client/assets/{use-mobile-B2VAoWT2.js → use-mobile-CYYKyaPB.js} +1 -1
- package/dist/client/assets/{use-project-D96OXk4y.js → use-project-C8RwUN1L.js} +1 -1
- package/dist/client/assets/{use-settings-modal-CouKpdi3.js → use-settings-modal-C_vV9Mlv.js} +1 -1
- package/dist/client/assets/{use-view-mode-DyK0fMBe.js → use-view-mode-NEbAgy4l.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-OwU65kyR.js → use-virtual-mcp-BkOaVgdQ.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Bu2NxA3C.js +1 -0
- package/dist/client/assets/{useMutation-lBFQDcxE.js → useMutation-DCvGByVi.js} +1 -1
- package/dist/client/assets/useQuery-Uh-6SoWk.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-DERz4rRP.js +1 -0
- package/dist/client/assets/{user-C73vNaiS.js → user-D-A6OtIP.js} +1 -1
- package/dist/client/assets/{workflow-S9BhswBs.js → workflow-CcIkWy0M.js} +1 -1
- package/dist/client/index.html +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-detail-BxRuQLTH.js +0 -2
- package/dist/client/assets/agents-KBFzt520.js +0 -1
- package/dist/client/assets/connection-detail-DznxU3SC.js +0 -1
- package/dist/client/assets/connections-AQfSUAp3.js +0 -1
- package/dist/client/assets/constants-DvJZMaim.js +0 -1
- package/dist/client/assets/dynamic-plugin-layout-d0KDA7MF.js +0 -1
- package/dist/client/assets/index-B-STjJpH.js +0 -1
- package/dist/client/assets/layout-DEcRD72T.js +0 -1
- package/dist/client/assets/login-OPfY3bsF.js +0 -1
- package/dist/client/assets/members-YKyOsCaT.js +0 -3
- package/dist/client/assets/monitoring-dashboard-edit-cexdjvMw.js +0 -1
- package/dist/client/assets/page-DfTTOYQt.js +0 -1
- package/dist/client/assets/plugins-H9eiCXso.js +0 -1
- package/dist/client/assets/switch-BSc4dVNg.js +0 -1
- package/dist/client/assets/tabs-BZ-xfLNG.js +0 -1
- package/dist/client/assets/tasks-Cy-gkHRX.js +0 -1
- package/dist/client/assets/tools-list-BYphEqhu.js +0 -1
- package/dist/client/assets/tooltip-Cz-bAWiO.js +0 -1
- package/dist/client/assets/use-binding-Dz1SRdBY.js +0 -1
- package/dist/client/assets/useInfiniteQuery-Cl9EtkM0.js +0 -1
- package/dist/client/assets/useQuery-DcRkCB2j.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DdSDu-rZ.js +0 -1
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{r as D,c as oe,v as H,j as s,p as Yt,B as ie,u as je,d as me,K as ue,o as Et,bb as Xe,s as Ce,bI as vt,bO as yt,n as Me,l as kt,k as Wt,t as le,m as Xt,E as es}from"./index-B_0vsVr1.js";import{C as ts}from"./collection-display-button-M7dfC2Rf.js";import{C as De,E as ct}from"./collection-search-q4T1hb73.js";import{P as ve}from"./index-QCmdl8uj.js";import{B as ss,a as ns,b as os,c as rs}from"./breadcrumb-CGrLS5HH.js";import{C as is}from"./collection-table-wrapper-DXH0yXJC.js";import{I as zt}from"./integration-icon-DAFtApWT.js";import{C as ze}from"./checkbox-BCSzUsPR.js";import{i as ls}from"./ArrowLeft-ihbjidrQ.js";import{b as Ut}from"./use-connection-DeEn4qfI.js";import{u as bt}from"./use-members-DAcqcxDX.js";import{u as it}from"./useQuery-DcRkCB2j.js";import{u as Ee}from"./useMutation-lBFQDcxE.js";import{u as as,a as cs}from"./use-llm-B_iPCa-K.js";import{A as Pe}from"./avatar-rYlL0ZoJ.js";import{B as ye}from"./badge-CxJArm69.js";import{f as Ue,a as Ve,b as Ge,c as Be,d as $e,e as Fe,A as Ke,h as Qe}from"./alert-dialog-D3oCqQtu.js";import{D as Vt,f as Gt,a as Bt,b as ds,c as ms,e as us}from"./dialog-Baq_fjtR.js";import{D as Ct,a as jt,b as Tt,c as nt,d as fs,e as hs,f as gs,g as xs}from"./dropdown-menu-CSqO4Mxn.js";import{i as ps}from"./DotsHorizontal-9qiIYu_T.js";import{i as He}from"./Loading01-B3gOoSbd.js";import{i as bs}from"./Lock01-CodP_ius.js";import{s as ot}from"./Plus-Bo0L9uYY.js";import{s as $t}from"./Trash01-HuK-pEft.js";import{i as St}from"./X-uHaUni9w.js";import{I as Cs}from"./input-CW7SVowR.js";import{S as Ne}from"./switch-BSc4dVNg.js";import{c as Se,T as Oe,a as Ie,b as Ae}from"./tooltip-Cz-bAWiO.js";import{a as js,F as Ot,b as It,c as Ts,d as At,f as _t}from"./form-C5R0_qWR.js";import{S as ft,a as ht,b as gt,c as xt,d as pt}from"./select-CYY4CENz.js";import{T as Ns}from"./textarea-4HpXofT0.js";import{a as qe,u as Je}from"./constants-D9bRXDQp.js";import{C as wt}from"./card-CAORA3L1.js";import{i as Ft}from"./DotsVertical-DHxrk-2J.js";import{i as Es}from"./Key01-C3Fh3hes.js";import{i as Kt}from"./Shield01-CqrrEAw-.js";import{s as Qt}from"./XClose-DGYV-4S5.js";import{C as dt,e as mt,f as Rt,d as vs,a as ys,b as Ss,c as Os}from"./command-CPQN970u.js";import{P as Is,a as As,b as _s}from"./popover-BNZ96bFv.js";import{t as ws}from"./ChevronDown-DAk1F2Sn.js";import"./ArrowDown-BXCgJapO.js";import"./ArrowUp-B3tPpNuu.js";import"./Check-G22LpKFd.js";import"./Grid01-DTf5JuyC.js";import"./List-DJEz6yKj.js";import"./SearchMd-Cpf31N-H.js";import"./localstorage-keys-BAzeyS9J.js";import"./ChevronRight-BT7U8Kip.js";import"./table-RFgqEt_E.js";import"./Container-CyEPuAYL.js";import"./use-collections-vccihohV.js";import"./use-binding-Dz1SRdBY.js";import"./binder-BXDCztlr.js";import"./index-CvEIDmnk.js";import"./label-DWU1nKSS.js";import"./index-ByA6j7_H.js";const Ht=({size:t=24,color:e="currentColor",...n})=>D.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},D.createElement("path",{d:"M20 17H4m0 0 4-4m-4 4 4 4M4 7h16m0 0-4-4m4 4-4 4"}));Ht.displayName="SwitchHorizontal01";const qt=[{name:"ORGANIZATION_CREATE",description:"Create a new organization",category:"Organizations"},{name:"ORGANIZATION_LIST",description:"List organizations",category:"Organizations"},{name:"ORGANIZATION_GET",description:"View organization details",category:"Organizations"},{name:"ORGANIZATION_UPDATE",description:"Update organization",category:"Organizations"},{name:"ORGANIZATION_DELETE",description:"Delete organization",category:"Organizations",dangerous:!0},{name:"ORGANIZATION_SETTINGS_GET",description:"View organization settings",category:"Organizations"},{name:"ORGANIZATION_SETTINGS_UPDATE",description:"Update organization settings",category:"Organizations"},{name:"ORGANIZATION_MEMBER_ADD",description:"Add members",category:"Organizations"},{name:"ORGANIZATION_MEMBER_REMOVE",description:"Remove members",category:"Organizations",dangerous:!0},{name:"ORGANIZATION_MEMBER_LIST",description:"List members",category:"Organizations"},{name:"ORGANIZATION_MEMBER_UPDATE_ROLE",description:"Update member roles",category:"Organizations"},{name:"COLLECTION_CONNECTIONS_CREATE",description:"Create connections",category:"Connections"},{name:"COLLECTION_CONNECTIONS_LIST",description:"List connections",category:"Connections"},{name:"COLLECTION_CONNECTIONS_GET",description:"View connection details",category:"Connections"},{name:"COLLECTION_CONNECTIONS_UPDATE",description:"Update connections",category:"Connections"},{name:"COLLECTION_CONNECTIONS_DELETE",description:"Delete connections",category:"Connections",dangerous:!0},{name:"CONNECTION_TEST",description:"Test connections",category:"Connections"},{name:"DATABASES_RUN_SQL",description:"Run SQL queries",category:"Connections",dangerous:!0},{name:"COLLECTION_VIRTUAL_MCP_CREATE",description:"Create virtual MCPs",category:"Virtual MCPs"},{name:"COLLECTION_VIRTUAL_MCP_LIST",description:"List virtual MCPs",category:"Virtual MCPs"},{name:"COLLECTION_VIRTUAL_MCP_GET",description:"View virtual MCP details",category:"Virtual MCPs"},{name:"COLLECTION_VIRTUAL_MCP_UPDATE",description:"Update virtual MCPs",category:"Virtual MCPs"},{name:"COLLECTION_VIRTUAL_MCP_DELETE",description:"Delete virtual MCPs",category:"Virtual MCPs",dangerous:!0},{name:"COLLECTION_VIRTUAL_TOOLS_CREATE",description:"Create virtual tools on Virtual MCPs",category:"Virtual Tools"},{name:"COLLECTION_VIRTUAL_TOOLS_LIST",description:"List virtual tools",category:"Virtual Tools"},{name:"COLLECTION_VIRTUAL_TOOLS_GET",description:"View virtual tool details",category:"Virtual Tools"},{name:"COLLECTION_VIRTUAL_TOOLS_UPDATE",description:"Update virtual tools",category:"Virtual Tools"},{name:"COLLECTION_VIRTUAL_TOOLS_DELETE",description:"Delete virtual tools",category:"Virtual Tools",dangerous:!0},{name:"MONITORING_LOGS_LIST",description:"List monitoring logs",category:"Monitoring"},{name:"MONITORING_STATS",description:"View monitoring statistics",category:"Monitoring"},{name:"MONITORING_DASHBOARD_CREATE",description:"Create monitoring dashboards",category:"Monitoring"},{name:"MONITORING_DASHBOARD_GET",description:"View dashboard details",category:"Monitoring"},{name:"MONITORING_DASHBOARD_LIST",description:"List monitoring dashboards",category:"Monitoring"},{name:"MONITORING_DASHBOARD_UPDATE",description:"Update monitoring dashboards",category:"Monitoring"},{name:"MONITORING_DASHBOARD_DELETE",description:"Delete monitoring dashboards",category:"Monitoring",dangerous:!0},{name:"MONITORING_DASHBOARD_QUERY",description:"Query dashboard widget data",category:"Monitoring"},{name:"MONITORING_WIDGET_PREVIEW",description:"Preview widget aggregation",category:"Monitoring"},{name:"API_KEY_CREATE",description:"Create API key",category:"API Keys"},{name:"API_KEY_LIST",description:"List API keys",category:"API Keys"},{name:"API_KEY_UPDATE",description:"Update API key",category:"API Keys"},{name:"API_KEY_DELETE",description:"Delete API key",category:"API Keys",dangerous:!0},{name:"EVENT_PUBLISH",description:"Publish events",category:"Event Bus"},{name:"EVENT_SUBSCRIBE",description:"Subscribe to events",category:"Event Bus"},{name:"EVENT_UNSUBSCRIBE",description:"Unsubscribe from events",category:"Event Bus"},{name:"EVENT_CANCEL",description:"Cancel recurring events",category:"Event Bus"},{name:"EVENT_ACK",description:"Acknowledge event delivery",category:"Event Bus"},{name:"EVENT_SUBSCRIPTION_LIST",description:"List event subscriptions",category:"Event Bus"},{name:"EVENT_SYNC_SUBSCRIPTIONS",description:"Sync subscriptions to desired state",category:"Event Bus"},{name:"USER_GET",description:"Get a user by id",category:"Users"},{name:"CODE_EXECUTION_SEARCH_TOOLS",description:"Search available tools by name or description",category:"Code Execution"},{name:"CODE_EXECUTION_DESCRIBE_TOOLS",description:"Get detailed schemas for specific tools",category:"Code Execution"},{name:"CODE_EXECUTION_RUN_CODE",description:"Run JavaScript code in a sandbox with tool access",category:"Code Execution",dangerous:!0},{name:"COLLECTION_THREADS_CREATE",description:"Create threads",category:"Threads"},{name:"COLLECTION_THREADS_LIST",description:"List threads",category:"Threads"},{name:"COLLECTION_THREADS_GET",description:"View thread details",category:"Threads"},{name:"COLLECTION_THREADS_UPDATE",description:"Update threads",category:"Threads"},{name:"COLLECTION_THREADS_DELETE",description:"Delete threads",category:"Threads",dangerous:!0},{name:"COLLECTION_THREAD_MESSAGES_LIST",description:"List thread messages",category:"Threads"},{name:"TAGS_LIST",description:"List organization tags",category:"Tags"},{name:"TAGS_CREATE",description:"Create organization tag",category:"Tags"},{name:"TAGS_DELETE",description:"Delete organization tag",category:"Tags",dangerous:!0},{name:"MEMBER_TAGS_GET",description:"Get member tags",category:"Tags"},{name:"MEMBER_TAGS_SET",description:"Set member tags",category:"Tags"},{name:"PROJECT_LIST",description:"List projects in organization",category:"Projects"},{name:"PROJECT_GET",description:"View project details",category:"Projects"},{name:"PROJECT_CREATE",description:"Create new project",category:"Projects"},{name:"PROJECT_UPDATE",description:"Update project",category:"Projects"},{name:"PROJECT_DELETE",description:"Delete project",category:"Projects",dangerous:!0},{name:"PROJECT_PLUGIN_CONFIG_GET",description:"View project plugin configuration",category:"Projects"},{name:"PROJECT_PLUGIN_CONFIG_UPDATE",description:"Update project plugin configuration",category:"Projects"},{name:"PROJECT_CONNECTION_LIST",description:"List project connections",category:"Projects"},{name:"PROJECT_CONNECTION_ADD",description:"Add connection to project",category:"Projects"},{name:"PROJECT_CONNECTION_REMOVE",description:"Remove connection from project",category:"Projects"},{name:"PROJECT_PINNED_VIEWS_UPDATE",description:"Update project pinned sidebar views",category:"Projects"}],Rs={ORGANIZATION_CREATE:"Create organization",ORGANIZATION_LIST:"List organizations",ORGANIZATION_GET:"View organization details",ORGANIZATION_UPDATE:"Update organization",ORGANIZATION_DELETE:"Delete organization",ORGANIZATION_SETTINGS_GET:"View organization settings",ORGANIZATION_SETTINGS_UPDATE:"Update organization settings",ORGANIZATION_MEMBER_LIST:"List members",ORGANIZATION_MEMBER_ADD:"Add members",ORGANIZATION_MEMBER_REMOVE:"Remove members",ORGANIZATION_MEMBER_UPDATE_ROLE:"Update member roles",COLLECTION_CONNECTIONS_LIST:"List connections",COLLECTION_CONNECTIONS_GET:"View connection details",COLLECTION_CONNECTIONS_CREATE:"Create connections",COLLECTION_CONNECTIONS_UPDATE:"Update connections",COLLECTION_CONNECTIONS_DELETE:"Delete connections",CONNECTION_TEST:"Test connections",DATABASES_RUN_SQL:"Run SQL queries",COLLECTION_VIRTUAL_MCP_CREATE:"Create virtual MCPs",COLLECTION_VIRTUAL_MCP_LIST:"List virtual MCPs",COLLECTION_VIRTUAL_MCP_GET:"View virtual MCP details",COLLECTION_VIRTUAL_MCP_UPDATE:"Update virtual MCPs",COLLECTION_VIRTUAL_MCP_DELETE:"Delete virtual MCPs",COLLECTION_VIRTUAL_TOOLS_CREATE:"Create virtual tools",COLLECTION_VIRTUAL_TOOLS_LIST:"List virtual tools",COLLECTION_VIRTUAL_TOOLS_GET:"View virtual tool details",COLLECTION_VIRTUAL_TOOLS_UPDATE:"Update virtual tools",COLLECTION_VIRTUAL_TOOLS_DELETE:"Delete virtual tools",MONITORING_LOGS_LIST:"List monitoring logs",MONITORING_STATS:"View monitoring statistics",MONITORING_DASHBOARD_CREATE:"Create monitoring dashboards",MONITORING_DASHBOARD_GET:"View dashboard details",MONITORING_DASHBOARD_LIST:"List monitoring dashboards",MONITORING_DASHBOARD_UPDATE:"Update monitoring dashboards",MONITORING_DASHBOARD_DELETE:"Delete monitoring dashboards",MONITORING_DASHBOARD_QUERY:"Query dashboard widget data",MONITORING_WIDGET_PREVIEW:"Preview widget aggregation",API_KEY_CREATE:"Create API key",API_KEY_LIST:"List API keys",API_KEY_UPDATE:"Update API key",API_KEY_DELETE:"Delete API key",EVENT_PUBLISH:"Publish events",EVENT_SUBSCRIBE:"Subscribe to events",EVENT_UNSUBSCRIBE:"Unsubscribe from events",EVENT_CANCEL:"Cancel recurring events",EVENT_ACK:"Acknowledge event delivery",EVENT_SUBSCRIPTION_LIST:"List event subscriptions",EVENT_SYNC_SUBSCRIPTIONS:"Sync subscriptions to desired state",USER_GET:"Get user by id",CODE_EXECUTION_SEARCH_TOOLS:"Search tools",CODE_EXECUTION_DESCRIBE_TOOLS:"Describe tools",CODE_EXECUTION_RUN_CODE:"Run code",COLLECTION_THREADS_CREATE:"Create threads",COLLECTION_THREADS_LIST:"List threads",COLLECTION_THREADS_GET:"View thread details",COLLECTION_THREADS_UPDATE:"Update threads",COLLECTION_THREADS_DELETE:"Delete threads",COLLECTION_THREAD_MESSAGES_LIST:"List thread messages",TAGS_LIST:"List organization tags",TAGS_CREATE:"Create organization tag",TAGS_DELETE:"Delete organization tag",MEMBER_TAGS_GET:"Get member tags",MEMBER_TAGS_SET:"Set member tags",PROJECT_LIST:"List projects",PROJECT_GET:"View project details",PROJECT_CREATE:"Create project",PROJECT_UPDATE:"Update project",PROJECT_DELETE:"Delete project",PROJECT_PLUGIN_CONFIG_GET:"View plugin config",PROJECT_PLUGIN_CONFIG_UPDATE:"Update plugin config",PROJECT_CONNECTION_LIST:"List project connections",PROJECT_CONNECTION_ADD:"Add project connection",PROJECT_CONNECTION_REMOVE:"Remove project connection",PROJECT_PINNED_VIEWS_UPDATE:"Update pinned views"};function Ls(){const t={Organizations:[],Connections:[],"Virtual MCPs":[],"Virtual Tools":[],Threads:[],Monitoring:[],Users:[],"API Keys":[],"Event Bus":[],"Code Execution":[],Tags:[],Projects:[]};for(const e of qt)t[e.category]?.push(e);return t}function Ps(){return qt.map(t=>({value:t.name,label:Rs[t.name],dangerous:t.dangerous}))}const Ms=D.memo(function(e){const n=oe.c(21),{connection:o,isSelected:l,hasToolsEnabled:r,activeToolsCount:d,totalToolsCount:i,onSelect:f,onToggle:x}=e,m=l?"bg-accent/50":"hover:bg-muted/50";let b;n[0]!==m?(b=H("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",m),n[0]=m,n[1]=b):b=n[1];let a;n[2]!==o.icon||n[3]!==o.title?(a=s.jsx(zt,{icon:o.icon,name:o.title,size:"xs"}),n[2]=o.icon,n[3]=o.title,n[4]=a):a=n[4];let T;n[5]!==o.title?(T=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:o.title})}),n[5]=o.title,n[6]=T):T=n[6];let h;n[7]!==f||n[8]!==a||n[9]!==T?(h=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:f,children:[a,T]}),n[7]=f,n[8]=a,n[9]=T,n[10]=h):h=n[10];let E;n[11]!==d||n[12]!==o.tools||n[13]!==r||n[14]!==x||n[15]!==i?(E=o.tools&&o.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[d,"/",i]}),s.jsx(ze,{checked:r,onCheckedChange:x,onClick:zs})]}),n[11]=d,n[12]=o.tools,n[13]=r,n[14]=x,n[15]=i,n[16]=E):E=n[16];let p;return n[17]!==b||n[18]!==h||n[19]!==E?(p=s.jsxs("div",{className:b,children:[h,E]}),n[17]=b,n[18]=h,n[19]=E,n[20]=p):p=n[20],p}),Ds=D.memo(function(e){const n=oe.c(18),{connectionId:o,tool:l,isSelected:r,onToggle:d}=e,i=`tool-${o}-${l.name}`,f=r?"text-foreground":"text-muted-foreground";let x;n[0]!==f?(x=H("text-sm font-medium",f),n[0]=f,n[1]=x):x=n[1];let m;n[2]!==x||n[3]!==l.name?(m=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:x,children:l.name})}),n[2]=x,n[3]=l.name,n[4]=m):m=n[4];let b;n[5]!==l.description?(b=l.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:l.description}),n[5]=l.description,n[6]=b):b=n[6];let a;n[7]!==m||n[8]!==b?(a=s.jsxs("div",{className:"flex-1 min-w-0",children:[m,b]}),n[7]=m,n[8]=b,n[9]=a):a=n[9];const T=`tool-${o}-${l.name}`;let h;n[10]!==r||n[11]!==d||n[12]!==T?(h=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(ze,{id:T,checked:r,onCheckedChange:d,onClick:Us})}),n[10]=r,n[11]=d,n[12]=T,n[13]=h):h=n[13];let E;return n[14]!==i||n[15]!==a||n[16]!==h?(E=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:i,children:[a,h]}),n[14]=i,n[15]=a,n[16]=h,n[17]=E):E=n[17],E});function ks({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:n}){const[o,l]=D.useState(""),r=D.useDeferredValue(o),[d,i]=D.useState("all"),[f,x]=D.useState(!1),m=D.useRef(new Set(Object.keys(t))),b=Ut({searchTerm:r.trim()||void 0}),a=n?b.filter(g=>g.connection_type!=="VIRTUAL"?!0:Yt(g.connection_url)!==n):b,T=m.current,h=[...T.values()].map(g=>a.find(_=>_.id===g)).filter(g=>g!==void 0),E=a.filter(g=>!T.has(g.id)),p=[...h,...E],v=g=>{const _=t[g];return _!==void 0&&_.length>0},j=p.filter(g=>{if(d==="all")return!0;const _=v(g.id);return d==="selected"?_:d==="unselected"?!_:!0}),[u,y]=D.useState(p[0]?.id??null),N=u?p.find(g=>g.id===u)??null:null,P=N?.tools??[],O=(g,_)=>t[g]?.includes(_)??!1,A=(g,_)=>{const S=t[g]??[],C=S.includes(_),M={...t};if(C){const z=S.filter(G=>G!==_);z.length===0?delete M[g]:M[g]=z}else M[g]=[...S,_];e(M)},R=g=>{const _=p.find(G=>G.id===g);if(!_?.tools)return;const S=t[g]??[],C=_.tools.map(G=>G.name),M=S.length>0&&C.every(G=>S.includes(G)),z={...t};M?delete z[g]:(z[g]=C,y(g)),e(z)},I=g=>{y(g),x(!0)},L=()=>{x(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:H("w-full md:w-80 border-r border-border flex flex-col",f&&"hidden md:flex"),children:[s.jsx(De,{value:o,onChange:l,placeholder:"Search MCP Servers..."}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>i("all"),className:H("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),s.jsx("button",{onClick:()=>i("selected"),className:H("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),s.jsx("button",{onClick:()=>i("unselected"),className:H("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:j.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:o?"No connections found":d==="selected"?"No servers selected":d==="unselected"?"No unselected servers":"No connections available"}):s.jsx("div",{className:"p-2 space-y-1",children:j.map(g=>{const _=g.tools?.length??0,S=t[g.id]?.length??0;return s.jsx(Ms,{connection:g,isSelected:u===g.id,hasToolsEnabled:v(g.id),activeToolsCount:S,totalToolsCount:_,onSelect:()=>I(g.id),onToggle:()=>R(g.id)},g.id)})})})]}),s.jsx("div",{className:H("flex-1 flex-col",f?"flex":"hidden md:flex"),children:N?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[s.jsx(ie,{variant:"ghost",size:"sm",onClick:L,className:"h-8 w-8 p-0 shrink-0",children:s.jsx(ls,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(zt,{icon:N.icon,name:N.title,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:N.title}),N.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:N.description})]})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-4",children:P.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:"This connection has no tools available"}):s.jsx("div",{className:"space-y-2",children:P.map(g=>s.jsx(Ds,{connectionId:N.id,tool:g,isSelected:O(N.id,g.name),onToggle:()=>A(N.id,g.name)},g.name))})})]}):s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"Select a connection to view its tools"})})})]})}function zs(t){return t.stopPropagation()}function Us(t){return t.stopPropagation()}const Lt=[{value:"owner",label:"Owner",isBuiltin:!0},{value:"admin",label:"Admin",isBuiltin:!0},{value:"user",label:"User",isBuiltin:!0}];function Vs(t){return t.replace(/-/g," ")}function Gs(t){if(!t)return{staticPermissions:[],allowsAllStaticPermissions:!1,connectionIds:[],allowsAllConnections:!1,toolNames:[],allowsAllTools:!1,modelCount:0,allowsAllModels:!1};const e=[];let n=!1;const o=[];let l=!1;const r=new Set;let d=!1,i=0,f=!1;for(const[x,m]of Object.entries(t)){if(x==="self"){m.includes("*")?n=!0:e.push(...m);continue}if(x==="models"){m.includes("*:*")?f=!0:i=m.length;continue}if(x==="*"){if(l=!0,m.includes("*"))d=!0;else for(const b of m)r.add(b);continue}if(o.push(x),m.includes("*"))d=!0;else for(const b of m)r.add(b)}return{staticPermissions:e,allowsAllStaticPermissions:n,connectionIds:o,allowsAllConnections:l,toolNames:Array.from(r),allowsAllTools:d,modelCount:i,allowsAllModels:f}}function Nt(){const{locator:t}=je(),{data:e,isLoading:n,error:o,refetch:l}=it({queryKey:ue.organizationRoles(t),queryFn:async()=>{try{const i=await me.organization.listRoles();return i?.error?(console.error("[useOrganizationRoles] API error:",i.error),[]):i?.data??[]}catch(i){return console.error("[useOrganizationRoles] Fetch error:",i),[]}},staleTime:3e4}),r=Lt.map(i=>({role:i.value,label:i.label,isBuiltin:i.isBuiltin}));if(e&&Array.isArray(e))for(const i of e){const f=i.role;if(!f||Lt.some(v=>v.value===f))continue;const{staticPermissions:x,allowsAllStaticPermissions:m,connectionIds:b,allowsAllConnections:a,toolNames:T,allowsAllTools:h,modelCount:E,allowsAllModels:p}=Gs(i.permission);r.push({id:i.id,role:f,label:Vs(f),isBuiltin:!1,permission:i.permission??void 0,staticPermissionCount:m?-1:x.length,allowsAllStaticPermissions:m,connectionCount:a?-1:b.length,allowsAllConnections:a,toolCount:h?-1:T.length,allowsAllTools:h,modelCount:p?-1:E,allowsAllModels:p})}const d=r.filter(i=>!i.isBuiltin);return{roles:r,customRoles:d,builtinRoles:r.filter(i=>i.isBuiltin),isLoading:n,error:o,refetch:l}}const Bs=Et({role:Et({id:Ce().optional(),slug:Ce().optional(),label:Ce()}),allowAllStaticPermissions:yt(),staticPermissions:Xe(Ce()),toolSet:vt(Ce(),Xe(Ce())),allowAllModels:yt(),modelSet:vt(Ce(),Xe(Ce())),memberIds:Xe(Ce())});function Jt(t){return t?t.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):"?"}const $s=[{role:"owner",label:"Owner",color:"bg-red-500"},{role:"admin",label:"Admin",color:"bg-blue-500"},{role:"user",label:"User",color:"bg-green-500"}],ut=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"];function Fs(t){if(!t)return"bg-neutral-400";let e=0;for(let o=0;o<t.length;o++){const l=t.charCodeAt(o);e=(e<<5)-e+l,e=e&e}const n=Math.abs(e)%ut.length;return ut[n]??ut[0]}function et(){return{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:[]}}function Ks(t){const e=oe.c(39),{allowAllStaticPermissions:n,staticPermissions:o,onAllowAllChange:l,onPermissionsChange:r,readOnly:d}=t,i=d===void 0?!1:d,[f,x]=D.useState(""),m=D.useDeferredValue(f);let b,a,T,h,E;if(e[0]!==n||e[1]!==m||e[2]!==l||e[3]!==r||e[4]!==i||e[5]!==f||e[6]!==o){const j=Ls(),u=Ps(),y=u.filter(L=>L.label.toLowerCase().includes(m.toLowerCase())),N=L=>{if(o.includes(L))r(o.filter(g=>g!==L));else{const g=[...o,L];g.length===u.length?(l(!0),r([])):r(g)}};T="flex flex-col h-full",e[12]!==f?(h=s.jsx("div",{className:"border-b border-border",children:s.jsx(De,{value:f,onChange:x,placeholder:"Search permissions...",className:"border-b-0"})}),e[12]=f,e[13]=h):h=e[13];const P=!i&&"hover:bg-muted/50 cursor-pointer";let O;e[14]!==P?(O=H("flex items-center justify-between px-4 py-3 rounded-lg",P),e[14]=P,e[15]=O):O=e[15];let A;e[16]!==n||e[17]!==l||e[18]!==r||e[19]!==i?(A=()=>{if(i)return;l(!n),r([])},e[16]=n,e[17]=l,e[18]=r,e[19]=i,e[20]=A):A=e[20];let R;e[21]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx("span",{className:"text-sm font-medium",children:"All organization permissions"}),e[21]=R):R=e[21];let I;e[22]!==n||e[23]!==l||e[24]!==r||e[25]!==i?(I=s.jsx("div",{onClick:Zs,children:i?s.jsx(Se,{children:s.jsxs(Oe,{children:[s.jsx(Ie,{asChild:!0,children:s.jsx("div",{children:s.jsx(Ne,{checked:n,disabled:i,onCheckedChange:L=>{i||(l(L),r([]))}})})}),s.jsx(Ae,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(Ne,{checked:n,disabled:i,onCheckedChange:L=>{i||(l(L),r([]))}})}),e[22]=n,e[23]=l,e[24]=r,e[25]=i,e[26]=I):I=e[26],e[27]!==I||e[28]!==O||e[29]!==A?(E=s.jsx("div",{className:"border-b border-border",children:s.jsxs("div",{className:O,onClick:A,children:[R,I]})}),e[27]=I,e[28]=O,e[29]=A,e[30]=E):E=e[30],b="flex-1 overflow-auto",a=Object.entries(j).map(L=>{const[g,_]=L,S=y.filter(C=>_.some(M=>M.name===C.value));return S.length===0?null:s.jsxs("div",{className:"mb-6 last:mb-0",children:[s.jsx("h4",{className:"text-sm font-medium p-3 pb-1.5 text-muted-foreground/75",children:g}),s.jsx("div",{className:"space-y-1",children:S.map(C=>s.jsxs("div",{className:H("flex items-center justify-between gap-3 px-4 py-3",!i&&"hover:bg-muted/50 cursor-pointer"),onClick:()=>{if(!i)if(n){l(!1);const M=u.map(Js);r(M.filter(z=>z!==C.value))}else N(C.value)},children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("span",{className:"text-sm",children:C.label})}),s.jsx("div",{onClick:qs,children:i?s.jsx(Se,{children:s.jsxs(Oe,{children:[s.jsx(Ie,{asChild:!0,children:s.jsx("div",{children:s.jsx(Ne,{checked:n||o.includes(C.value),disabled:i,onCheckedChange:()=>{if(!i)if(n){l(!1);const M=u.map(Hs);r(M.filter(z=>z!==C.value))}else N(C.value)}})})}),s.jsx(Ae,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(Ne,{checked:n||o.includes(C.value),disabled:i,onCheckedChange:()=>{if(!i)if(n){l(!1);const M=u.map(Qs);r(M.filter(z=>z!==C.value))}else N(C.value)}})})]},C.value))})]},g)}),e[0]=n,e[1]=m,e[2]=l,e[3]=r,e[4]=i,e[5]=f,e[6]=o,e[7]=b,e[8]=a,e[9]=T,e[10]=h,e[11]=E}else b=e[7],a=e[8],T=e[9],h=e[10],E=e[11];let p;e[31]!==b||e[32]!==a?(p=s.jsx("div",{className:b,children:a}),e[31]=b,e[32]=a,e[33]=p):p=e[33];let v;return e[34]!==T||e[35]!==h||e[36]!==E||e[37]!==p?(v=s.jsxs("div",{className:T,children:[h,E,p]}),e[34]=T,e[35]=h,e[36]=E,e[37]=p,e[38]=v):v=e[38],v}function Qs(t){return t.value}function Hs(t){return t.value}function qs(t){return t.stopPropagation()}function Js(t){return t.value}function Zs(t){return t.stopPropagation()}function Ys(t){const e=oe.c(45),{connection:n,selectedModels:o,allowAllModels:l,onToggleModel:r,onToggleConnectionAll:d,allConnectionModelsSelected:i,searchQuery:f,readOnly:x}=t;let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={pageSize:999},e[0]=m):m=e[0];const b=cs(n.id,m);let a;e[1]!==b||e[2]!==f?(a=f.trim()?b.filter(A=>A.title.toLowerCase().includes(f.toLowerCase())||A.id.toLowerCase().includes(f.toLowerCase())||A.provider?.toLowerCase().includes(f.toLowerCase())):b,e[1]=b,e[2]=f,e[3]=a):a=e[3];const T=a;if(T.length===0)return null;let h;e[4]!==i||e[5]!==l||e[6]!==T||e[7]!==o?(h=l||i||o.includes("*")&&!l||T.every(A=>o.includes(A.id)||o.includes("*")),e[4]=i,e[5]=l,e[6]=T,e[7]=o,e[8]=h):h=e[8];const E=h;let p;e[9]!==n.icon||e[10]!==n.title?(p=n.icon?s.jsx("img",{src:n.icon,alt:n.title,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:n.title.slice(0,1).toUpperCase()}),e[9]=n.icon,e[10]=n.title,e[11]=p):p=e[11];let v;e[12]!==n.title?(v=s.jsx("h4",{className:"text-sm font-medium text-muted-foreground/75",children:n.title}),e[12]=n.title,e[13]=v):v=e[13];let j;e[14]!==p||e[15]!==v?(j=s.jsxs("div",{className:"flex items-center gap-2",children:[p,v]}),e[14]=p,e[15]=v,e[16]=j):j=e[16];let u;e[17]!==E||e[18]!==l||e[19]!==n.id||e[20]!==b||e[21]!==d||e[22]!==x?(u=!x&&!l&&s.jsx(Ne,{checked:E,onCheckedChange:()=>d(n.id,b)}),e[17]=E,e[18]=l,e[19]=n.id,e[20]=b,e[21]=d,e[22]=x,e[23]=u):u=e[23];let y;e[24]!==j||e[25]!==u?(y=s.jsxs("div",{className:"flex items-center justify-between px-4 py-2",children:[j,u]}),e[24]=j,e[25]=u,e[26]=y):y=e[26];let N;if(e[27]!==l||e[28]!==n.id||e[29]!==T||e[30]!==r||e[31]!==x||e[32]!==o){let A;e[34]!==l||e[35]!==n.id||e[36]!==r||e[37]!==x||e[38]!==o?(A=R=>{const I=l||o.includes("*")||o.includes(R.id);return s.jsxs("div",{className:H("flex items-center justify-between gap-3 px-4 py-3",!x&&"hover:bg-muted/50 cursor-pointer"),onClick:()=>{x||l||r(n.id,R.id)},children:[s.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[R.logo&&s.jsx("img",{src:R.logo,className:"w-4 h-4 shrink-0 rounded-sm",alt:R.title}),s.jsx("span",{className:"text-sm truncate",children:R.title})]}),s.jsx("div",{onClick:Ws,children:x?s.jsx(Se,{children:s.jsxs(Oe,{children:[s.jsx(Ie,{asChild:!0,children:s.jsx("div",{children:s.jsx(Ne,{checked:I,disabled:!0})})}),s.jsx(Ae,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(Ne,{checked:I,disabled:x||l,onCheckedChange:()=>{x||l||r(n.id,R.id)}})})]},R.id)},e[34]=l,e[35]=n.id,e[36]=r,e[37]=x,e[38]=o,e[39]=A):A=e[39],N=T.map(A),e[27]=l,e[28]=n.id,e[29]=T,e[30]=r,e[31]=x,e[32]=o,e[33]=N}else N=e[33];let P;e[40]!==N?(P=s.jsx("div",{className:"space-y-1",children:N}),e[40]=N,e[41]=P):P=e[41];let O;return e[42]!==P||e[43]!==y?(O=s.jsxs("div",{className:"mb-6 last:mb-0",children:[y,P]}),e[42]=P,e[43]=y,e[44]=O):O=e[44],O}function Ws(t){return t.stopPropagation()}function Xs(){const t=oe.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"px-4 py-3 flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(He,{className:"size-4 animate-spin"}),"Loading models..."]}),t[0]=e):e=t[0],e}function en(t){const e=oe.c(39),{allowAllModels:n,modelSet:o,onAllowAllChange:l,onModelSetChange:r,readOnly:d}=t,i=d===void 0?!1:d,[f,x]=D.useState(""),m=D.useDeferredValue(f),b=as();let a;e[0]!==o||e[1]!==r?(a=(I,L)=>{const g=o[I]??[],_={...o};if(g.includes(L)){const S=g.filter(C=>C!==L);S.length===0?delete _[I]:_[I]=S}else _[I]=[...g,L];r(_)},e[0]=o,e[1]=r,e[2]=a):a=e[2];const T=a;let h;e[3]!==o||e[4]!==r?(h=(I,L)=>{const g=o[I]??[],_=L.map(sn),S=g.includes("*")||_.every(M=>g.includes(M)),C={...o};S?delete C[I]:C[I]=_,r(C)},e[3]=o,e[4]=r,e[5]=h):h=e[5];const E=h;let p;e[6]!==f?(p=s.jsx("div",{className:"border-b border-border",children:s.jsx(De,{value:f,onChange:x,placeholder:"Search models...",className:"border-b-0"})}),e[6]=f,e[7]=p):p=e[7];const v=!i&&"hover:bg-muted/50 cursor-pointer";let j;e[8]!==v?(j=H("flex items-center justify-between px-4 py-3 rounded-lg",v),e[8]=v,e[9]=j):j=e[9];let u;e[10]!==n||e[11]!==l||e[12]!==r||e[13]!==i?(u=()=>{if(i)return;const I=!n;l(I),I&&r({})},e[10]=n,e[11]=l,e[12]=r,e[13]=i,e[14]=u):u=e[14];let y;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("span",{className:"text-sm font-medium",children:"All models"}),e[15]=y):y=e[15];let N;e[16]!==n||e[17]!==l||e[18]!==r||e[19]!==i?(N=s.jsx("div",{onClick:tn,children:i?s.jsx(Se,{children:s.jsxs(Oe,{children:[s.jsx(Ie,{asChild:!0,children:s.jsx("div",{children:s.jsx(Ne,{checked:n,disabled:!0})})}),s.jsx(Ae,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(Ne,{checked:n,onCheckedChange:I=>{i||(l(I),I&&r({}))}})}),e[16]=n,e[17]=l,e[18]=r,e[19]=i,e[20]=N):N=e[20];let P;e[21]!==j||e[22]!==u||e[23]!==N?(P=s.jsx("div",{className:"border-b border-border",children:s.jsxs("div",{className:j,onClick:u,children:[y,N]})}),e[21]=j,e[22]=u,e[23]=N,e[24]=P):P=e[24];let O;e[25]!==n||e[26]!==m||e[27]!==b||e[28]!==o||e[29]!==i||e[30]!==E||e[31]!==T?(O=b.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No LLM connections configured"}):b.map(I=>s.jsx(D.Suspense,{fallback:s.jsx(Xs,{}),children:s.jsx(Ys,{connection:I,selectedModels:o[I.id]??[],allowAllModels:n,onToggleModel:T,onToggleConnectionAll:E,allConnectionModelsSelected:(o[I.id]??[]).includes("*"),searchQuery:m,readOnly:i})},I.id)),e[25]=n,e[26]=m,e[27]=b,e[28]=o,e[29]=i,e[30]=E,e[31]=T,e[32]=O):O=e[32];let A;e[33]!==O?(A=s.jsx("div",{className:"flex-1 overflow-auto",children:O}),e[33]=O,e[34]=A):A=e[34];let R;return e[35]!==P||e[36]!==A||e[37]!==p?(R=s.jsxs("div",{className:"flex flex-col h-full",children:[p,P,A]}),e[35]=P,e[36]=A,e[37]=p,e[38]=R):R=e[38],R}function tn(t){return t.stopPropagation()}function sn(t){return t.id}function nn(t){const e=oe.c(56),{open:n,onOpenChange:o,selectedMemberIds:l,onAddMembers:r}=t,[d,i]=D.useState(""),f=D.useDeferredValue(d);let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=[],e[0]=x):x=e[0];const[m,b]=D.useState(x),{data:a}=bt();let T,h,E,p,v,j,u,y,N,P,O;if(e[1]!==a?.data?.members||e[2]!==f||e[3]!==r||e[4]!==o||e[5]!==n||e[6]!==m||e[7]!==d||e[8]!==l){const M=a?.data?.members??[];let z;e[20]!==f?(z=U=>{const c=f.toLowerCase();return U.user?.name?.toLowerCase().includes(c)||U.user?.email?.toLowerCase().includes(c)},e[20]=f,e[21]=z):z=e[21];const G=M.filter(z),K=on;let W;e[22]!==l?(W=U=>l.includes(U),e[22]=l,e[23]=W):W=e[23];const X=W;let ee;e[24]!==m?(ee=U=>{m.includes(U)?b(m.filter(c=>c!==U)):b([...m,U])},e[24]=m,e[25]=ee):ee=e[25];const re=ee;let te;e[26]!==r||e[27]!==o||e[28]!==m?(te=()=>{r(m),b([]),o(!1)},e[26]=r,e[27]=o,e[28]=m,e[29]=te):te=e[29],E=te,h=Ue,P=n,O=o,T=Ve,y="sm:max-w-md p-0 overflow-hidden",e[30]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsxs(Ge,{className:"px-6 pt-6",children:[s.jsx(Be,{children:"Add Members to Role"}),s.jsx($e,{children:"Select members to add to this role."})]}),e[30]=N):N=e[30],j="flex flex-col h-80",e[31]!==d?(u=s.jsx(De,{value:d,onChange:i,placeholder:"Search members...",className:"border-b border-t-0 border-x-0 rounded-none"}),e[31]=d,e[32]=u):u=e[32],p="flex-1 overflow-auto",v=G.length===0?s.jsx("div",{className:"flex items-center justify-center h-full px-6",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:d?"No members found":"No members available"})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:G.map(U=>{const c=K(U),w=X(U.id),V=m.includes(U.id);return s.jsxs("label",{className:H("flex items-center gap-3 p-2 rounded-lg",!c||w?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(ze,{checked:V||w,onCheckedChange:()=>{c&&!w&&re(U.id)},disabled:!c||w}),s.jsx(Pe,{url:U.user?.image??void 0,fallback:Jt(U.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:U.user?.name||"Unknown"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:U.user?.email})]}),!c&&s.jsx(ye,{variant:"secondary",className:"shrink-0",children:"Owner"}),w&&c&&s.jsx(ye,{variant:"outline",className:"shrink-0",children:"Added"})]},U.id)})}),e[1]=a?.data?.members,e[2]=f,e[3]=r,e[4]=o,e[5]=n,e[6]=m,e[7]=d,e[8]=l,e[9]=T,e[10]=h,e[11]=E,e[12]=p,e[13]=v,e[14]=j,e[15]=u,e[16]=y,e[17]=N,e[18]=P,e[19]=O}else T=e[9],h=e[10],E=e[11],p=e[12],v=e[13],j=e[14],u=e[15],y=e[16],N=e[17],P=e[18],O=e[19];let A;e[33]!==p||e[34]!==v?(A=s.jsx("div",{className:p,children:v}),e[33]=p,e[34]=v,e[35]=A):A=e[35];let R;e[36]!==A||e[37]!==j||e[38]!==u?(R=s.jsxs("div",{className:j,children:[u,A]}),e[36]=A,e[37]=j,e[38]=u,e[39]=R):R=e[39];let I;e[40]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(Ke,{children:"Cancel"}),e[40]=I):I=e[40];const L=m.length===0,g=m.length>0&&`(${m.length})`;let _;e[41]!==E||e[42]!==L||e[43]!==g?(_=s.jsxs(Fe,{className:"px-6 pb-6",children:[I,s.jsxs(Qe,{onClick:E,disabled:L,children:["Add ",g]})]}),e[41]=E,e[42]=L,e[43]=g,e[44]=_):_=e[44];let S;e[45]!==T||e[46]!==R||e[47]!==_||e[48]!==y||e[49]!==N?(S=s.jsxs(T,{className:y,children:[N,R,_]}),e[45]=T,e[46]=R,e[47]=_,e[48]=y,e[49]=N,e[50]=S):S=e[50];let C;return e[51]!==h||e[52]!==S||e[53]!==P||e[54]!==O?(C=s.jsx(h,{open:P,onOpenChange:O,children:S}),e[51]=h,e[52]=S,e[53]=P,e[54]=O,e[55]=C):C=e[55],C}function on(t){return t.role!=="owner"}function rn(t){const e=oe.c(40),{memberIds:n,onMemberIdsChange:o,readOnly:l}=t,r=l===void 0?!1:l,[d,i]=D.useState(""),f=D.useDeferredValue(d),[x,m]=D.useState(!1),{data:b}=bt();let a,T,h,E,p;if(e[0]!==b?.data?.members||e[1]!==f||e[2]!==n||e[3]!==o||e[4]!==r||e[5]!==d){const y=b?.data?.members??[];let N;e[11]!==n?(N=S=>n.includes(S.id),e[11]=n,e[12]=N):N=e[12];const P=y.filter(N);let O;e[13]!==f?(O=S=>{const C=f.toLowerCase();return S.user?.name?.toLowerCase().includes(C)||S.user?.email?.toLowerCase().includes(C)},e[13]=f,e[14]=O):O=e[14];const A=P.filter(O);let R;e[15]!==n||e[16]!==o?(R=S=>{o(n.filter(C=>C!==S))},e[15]=n,e[16]=o,e[17]=R):R=e[17];const I=R;let L;e[18]!==n||e[19]!==o?(L=S=>{o([...n,...S])},e[18]=n,e[19]=o,e[20]=L):L=e[20],a=L,E="flex flex-col h-full";let g;e[21]!==d?(g=s.jsx(De,{value:d,onChange:i,placeholder:"Search members...",className:"flex-1 border-b-0"}),e[21]=d,e[22]=g):g=e[22];let _;e[23]!==r?(_=r?s.jsx("div",{className:"pr-4",children:s.jsx(Se,{children:s.jsxs(Oe,{children:[s.jsx(Ie,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ie,{variant:"outline",size:"sm",disabled:!0,children:[s.jsx(ot,{size:16}),"Add Member"]})})}),s.jsx(Ae,{children:s.jsx("p",{children:"Owner membership cannot be changed"})})]})})}):s.jsx("div",{className:"pr-4",children:s.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>m(!0),children:[s.jsx(ot,{size:16}),"Add Member"]})}),e[23]=r,e[24]=_):_=e[24],e[25]!==g||e[26]!==_?(p=s.jsxs("div",{className:"flex items-center border-b border-border",children:[g,_]}),e[25]=g,e[26]=_,e[27]=p):p=e[27],T="flex-1 overflow-auto",h=P.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No members"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Add members to this role to grant them the configured permissions."})]})}):A.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("p",{className:"text-sm text-muted-foreground",children:['No members match "',d,'"']})}):s.jsx("div",{className:"p-4 space-y-2",children:A.map(S=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(Pe,{url:S.user?.image??void 0,fallback:Jt(S.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:S.user?.name||"Unknown"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:S.user?.email})]}),r?s.jsx(Se,{children:s.jsxs(Oe,{children:[s.jsx(Ie,{asChild:!0,children:s.jsx("div",{children:s.jsx(ie,{variant:"ghost",size:"sm",disabled:!0,children:s.jsx(St,{size:16})})})}),s.jsx(Ae,{children:s.jsx("p",{children:"Owner membership cannot be changed"})})]})}):s.jsx(ie,{variant:"ghost",size:"sm",onClick:()=>I(S.id),children:s.jsx(St,{size:16})})]},S.id))}),e[0]=b?.data?.members,e[1]=f,e[2]=n,e[3]=o,e[4]=r,e[5]=d,e[6]=a,e[7]=T,e[8]=h,e[9]=E,e[10]=p}else a=e[6],T=e[7],h=e[8],E=e[9],p=e[10];let v;e[28]!==T||e[29]!==h?(v=s.jsx("div",{className:T,children:h}),e[28]=T,e[29]=h,e[30]=v):v=e[30];let j;e[31]!==x||e[32]!==a||e[33]!==n?(j=s.jsx(nn,{open:x,onOpenChange:m,selectedMemberIds:n,onAddMembers:a}),e[31]=x,e[32]=a,e[33]=n,e[34]=j):j=e[34];let u;return e[35]!==E||e[36]!==p||e[37]!==v||e[38]!==j?(u=s.jsxs("div",{className:E,children:[p,v,j]}),e[35]=E,e[36]=p,e[37]=v,e[38]=j,e[39]=u):u=e[39],u}function ln(t){const e=oe.c(3);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(He,{size:24,className:"animate-spin text-muted-foreground"})}),e[0]=n):n=e[0];let o;return e[1]!==t?(o=s.jsx(D.Suspense,{fallback:n,children:s.jsx(rn,{...t})}),e[1]=t,e[2]=o):o=e[2],o}const an={owner:[],admin:[],user:[]};function tt(t,e){const n=t==="owner"||t==="admin",o=e.filter(l=>l.role===t);return{role:{slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:n,staticPermissions:an[t],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:o.map(l=>l.id)}}function cn({trigger:t,onSuccess:e}){const[n,o]=D.useState(!1),[l,r]=D.useState("mcp"),{locator:d}=je(),i=Me(),f=Ut()??[],{customRoles:x,refetch:m}=Nt(),{data:b}=it({queryKey:ue.members(d),queryFn:()=>me.organization.listMembers()}),a=kt({resolver:Wt(Bs),defaultValues:et()}),T=a.formState.isValid,h=a.formState.isDirty,[E,p]=D.useState(null),[v,j]=D.useState(null),u=!a.watch("role.id")&&!a.watch("role.slug")&&!v,[y,N]=D.useState(null),[P,O]=D.useState(!1),[A,R]=D.useState(null),I=c=>{const w=c.permission||{},V=w.self||[],fe=V.includes("*"),Z=fe?[]:V.filter(B=>B!=="*"),Y={};for(const[B,se]of Object.entries(w))if(!(B==="self"||B==="models"))if(B==="*")for(const ne of f)se.includes("*")?Y[ne.id]=ne.tools?.map(ae=>ae.name)??[]:Y[ne.id]=se;else{const ne=f.find(ae=>ae.id===B);ne&&(se.includes("*")?Y[B]=ne.tools?.map(ae=>ae.name)??[]:Y[B]=se)}const q=w.models||[],he=q.length===0||q.includes("*:*"),J={};if(!he)for(const B of q){const se=B.indexOf(":");if(se===-1)continue;const ne=B.slice(0,se),ae=B.slice(se+1);J[ne]||(J[ne]=[]),J[ne].push(ae)}const ce=(b?.data?.members??[]).filter(B=>B.role===c.role).map(B=>B.id);return{role:{id:c.id,slug:c.role,label:c.label},allowAllStaticPermissions:fe,staticPermissions:Z,toolSet:Y,allowAllModels:he,modelSet:J,memberIds:ce}},L=c=>{const w=I(c);a.reset(w),p(c.id??null),j(null)},g=()=>{a.reset(et()),p(null),j(null),r("mcp")},_=c=>{h&&T?(R(()=>()=>L(c)),O(!0)):L(c)},S=async()=>{h&&T&&await ee(),g()},C=c=>{if(h&&T)R(()=>()=>{const w=tt(c,b?.data?.members??[]);a.reset(w),j(c),p(null),r("org")}),O(!0);else{const w=tt(c,b?.data?.members??[]);a.reset(w),j(c),p(null),r("org")}},M=c=>{if(!c&&a.formState.isDirty&&T){R(()=>()=>{o(!1),a.reset(et()),j(null)}),O(!0);return}if(o(c),!c)a.reset(et()),j(null),p(null);else{const w=x[0];if(w)L(w);else{const V=tt("user",b?.data?.members??[]);a.reset(V),j("user"),p(null),r("org")}}},z=()=>{O(!1),A&&(A(),R(null))},G=c=>{const w={};c.allowAllStaticPermissions?w.self=["*"]:c.staticPermissions.length>0&&(w.self=c.staticPermissions);for(const[V,fe]of Object.entries(c.toolSet))if(fe.length>0){const Y=f.find(q=>q.id===V)?.tools?.map(q=>q.name)??[];Y.length>0&&Y.every(q=>fe.includes(q))?w[V]=["*"]:w[V]=fe}if(c.allowAllModels)w.models=["*:*"];else{const V=[];for(const[fe,Z]of Object.entries(c.modelSet))if(Z.length>0)for(const Y of Z)V.push(`${fe}:${Y}`);w.models=V}return w},K=Ee({mutationFn:async c=>{const w=G(c),V=c.role.slug||c.role.label.toLowerCase().replace(/\s+/g,"-");if(c.role.slug&&!c.role.id){const Y=(b?.data?.members??[]).filter(J=>J.role===c.role.slug).map(J=>J.id),q=c.memberIds.filter(J=>!Y.includes(J)),he=Y.filter(J=>!c.memberIds.includes(J));for(const J of q){const Q=await me.organization.updateMemberRole({memberId:J,role:[c.role.slug]});if(Q?.error)throw new Error(Q.error.message)}for(const J of he){const Q=await me.organization.updateMemberRole({memberId:J,role:["user"]});if(Q?.error)throw new Error(Q.error.message)}return c}else if(c.role.id){const Z=await me.organization.updateRole({roleId:c.role.id,data:{permission:w}});if(Z?.error)throw new Error(Z.error.message);const q=(b?.data?.members??[]).filter(Q=>Q.role===c.role.slug).map(Q=>Q.id),he=c.memberIds.filter(Q=>!q.includes(Q)),J=q.filter(Q=>!c.memberIds.includes(Q));for(const Q of he){const ce=await me.organization.updateMemberRole({memberId:Q,role:[c.role.slug]});if(ce?.error)throw new Error(ce.error.message)}for(const Q of J){const ce=await me.organization.updateMemberRole({memberId:Q,role:["user"]});if(ce?.error)throw new Error(ce.error.message)}return c}else{const Z=await me.organization.createRole({role:V,permission:w});if(Z?.error)throw new Error(Z.error.message);for(const Y of c.memberIds){const q=await me.organization.updateMemberRole({memberId:Y,role:[V]});if(q?.error)throw new Error(q.error.message)}return{...c,role:{...c.role,id:Z.data?.roleData?.id,slug:V}}}},onSuccess:(c,w)=>{i.invalidateQueries({queryKey:ue.members(d)}),i.invalidateQueries({queryKey:ue.organizationRoles(d)});const V=!w.role.id&&!w.role.slug,fe=w.role.slug&&!w.role.id;le.success(fe?"Members updated successfully!":V?"Role created successfully!":"Role updated successfully!"),m(),a.reset(c),c.role.id&&p(c.role.id),e?.()},onError:c=>{le.error(c instanceof Error?c.message:"Failed to save role")}}),W=Ee({mutationFn:async c=>{const w=await me.organization.deleteRole({roleId:c});if(w?.error)throw new Error(w.error.message);return w?.data},onSuccess:()=>{if(i.invalidateQueries({queryKey:ue.members(d)}),i.invalidateQueries({queryKey:ue.organizationRoles(d)}),le.success("Role deleted successfully!"),m(),y?.id===E){const c=x.filter(w=>w.id!==y?.id);if(c[0])L(c[0]);else{const w=tt("user",b?.data?.members??[]);a.reset(w),j("user"),p(null),r("org")}}},onError:c=>{le.error(c instanceof Error?c.message:"Failed to delete role")}}),X=K.isPending||W.isPending,ee=async()=>{const c=a.getValues();if(!c.role.label.trim()){le.error("Role name is required"),a.setFocus("role.label");return}await K.mutateAsync(c)},re=a.handleSubmit(c=>{if(!c.role.label.trim()){le.error("Role name is required"),a.setFocus("role.label");return}K.mutate(c)}),te=c=>{c.id&&N({id:c.id,label:c.label})},U=()=>{y?.id&&W.mutate(y.id),N(null)};return s.jsxs(Vt,{open:n,onOpenChange:M,children:[s.jsx(Gt,{asChild:!0,children:t}),s.jsx(Bt,{className:"sm:max-w-5xl h-[80vh] max-h-[80vh] flex flex-col p-0 overflow-hidden w-[95vw]",children:s.jsxs("div",{className:"flex-1 flex overflow-hidden min-h-0 flex-col sm:flex-row",children:[s.jsxs("div",{className:"w-full sm:w-64 sm:border-r border-b sm:border-b-0 border-border flex flex-col bg-background sm:h-full max-h-[40vh] sm:max-h-full",children:[s.jsx("div",{className:"flex-1 overflow-auto px-3.5 py-3.5 pt-3.5",children:s.jsxs("div",{className:"flex flex-col gap-1",children:[$s.map(c=>{const w=v===c.role;return s.jsxs("div",{className:H("flex items-center gap-2 px-2 py-1.5 rounded-lg overflow-hidden cursor-pointer transition-colors",w?"bg-accent":"hover:bg-muted/50"),onClick:()=>C(c.role),children:[s.jsx("div",{className:H("shrink-0 size-3 rounded-full",c.color)}),s.jsx("p",{className:"text-sm font-medium truncate flex-1",children:c.label}),s.jsx(bs,{size:14,className:"text-muted-foreground shrink-0"})]},c.role)}),x.map(c=>{const w=E===c.id;return s.jsxs("div",{className:H("group flex items-center gap-2 px-2 py-1.5 rounded-lg overflow-hidden transition-colors cursor-pointer",w?"bg-accent":"hover:bg-muted/50"),onClick:()=>_(c),children:[s.jsx("div",{className:H("shrink-0 size-3 rounded-full",Fs(c.label))}),s.jsx("p",{className:"text-sm font-medium truncate flex-1",children:c.label}),s.jsxs(Ct,{children:[s.jsx(jt,{asChild:!0,children:s.jsx(ie,{variant:"ghost",size:"icon",className:H("size-5 shrink-0 transition-opacity opacity-0 pointer-events-none","group-hover:opacity-100 group-hover:pointer-events-auto",w&&"opacity-100 pointer-events-auto"),onClick:V=>V.stopPropagation(),children:s.jsx(ps,{size:14})})}),s.jsx(Tt,{align:"end",children:s.jsxs(nt,{className:"text-destructive",onClick:V=>{V.stopPropagation(),te(c)},children:[s.jsx($t,{size:16}),"Delete"]})})]})]},c.id)}),u&&s.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded-lg overflow-hidden bg-accent",children:[s.jsx("div",{className:"shrink-0 size-3 rounded-full bg-neutral-400"}),s.jsx(Cs,{...a.register("role.label"),placeholder:"Enter role name",className:"flex-1 text-sm font-medium border-0 shadow-none h-auto px-0 py-0 focus-visible:ring-0 bg-transparent",autoFocus:!0}),s.jsx(ye,{variant:"secondary",className:"shrink-0 text-xs px-1.5 py-0",children:"New"})]})]})}),s.jsx("div",{className:"px-3.5 pb-3.5",children:s.jsxs(ie,{variant:"outline",size:"default",onClick:S,disabled:X||h,className:"w-full h-10",children:[s.jsx(ot,{size:16}),"Create new role"]})})]}),s.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[s.jsxs("div",{className:"h-12 border-b border-border px-4 py-3.5 flex items-center gap-2 shrink-0",children:[!v&&s.jsx(ie,{variant:"outline",size:"sm",onClick:()=>r("mcp"),className:H("h-7 rounded-lg px-2 border border-input transition-colors",l==="mcp"?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:"MCP Permissions"}),s.jsx(ie,{variant:"outline",size:"sm",onClick:()=>r("org"),className:H("h-7 rounded-lg px-2 border border-input transition-colors",l==="org"?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:"Organization Permissions"}),s.jsx(ie,{variant:"outline",size:"sm",onClick:()=>r("models"),className:H("h-7 rounded-lg px-2 border border-input transition-colors",l==="models"?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:"Models"}),s.jsx(ie,{variant:"outline",size:"sm",onClick:()=>r("members"),className:H("h-7 rounded-lg px-2 border border-input transition-colors",l==="members"?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:"Members"})]}),s.jsxs("div",{className:"flex-1 overflow-hidden min-h-0",children:[l==="mcp"&&!v&&s.jsx(ks,{toolSet:a.watch("toolSet"),onToolSetChange:c=>a.setValue("toolSet",c,{shouldDirty:!0})}),l==="org"&&s.jsx(Ks,{allowAllStaticPermissions:a.watch("allowAllStaticPermissions"),staticPermissions:a.watch("staticPermissions"),onAllowAllChange:c=>a.setValue("allowAllStaticPermissions",c,{shouldDirty:!0}),onPermissionsChange:c=>a.setValue("staticPermissions",c,{shouldDirty:!0}),readOnly:!!v}),l==="models"&&s.jsx(en,{allowAllModels:a.watch("allowAllModels"),modelSet:a.watch("modelSet"),onAllowAllChange:c=>a.setValue("allowAllModels",c,{shouldDirty:!0}),onModelSetChange:c=>a.setValue("modelSet",c,{shouldDirty:!0}),readOnly:!!v}),l==="members"&&s.jsx(ln,{memberIds:a.watch("memberIds"),onMemberIdsChange:c=>a.setValue("memberIds",c,{shouldDirty:!0}),readOnly:v==="owner"})]}),(!v||v!=="owner")&&s.jsxs("div",{className:"border-t border-border px-5 py-5 flex items-center justify-end gap-2.5 shrink-0",children:[s.jsx(ie,{variant:"outline",onClick:()=>M(!1),disabled:X,className:"h-10",children:"Cancel"}),s.jsx(ie,{onClick:re,disabled:X||!T||!a.formState.isDirty,className:"h-10",children:K.isPending?"Saving...":u?"Create Role":"Save Changes"})]})]})]})}),s.jsx(Ue,{open:y!==null,onOpenChange:c=>!c&&N(null),children:s.jsxs(Ve,{children:[s.jsxs(Ge,{children:[s.jsx(Be,{children:"Delete Role"}),s.jsxs($e,{children:['Are you sure you want to delete the "',y?.label,'" role? This action cannot be undone.']})]}),s.jsxs(Fe,{children:[s.jsx(Ke,{children:"Cancel"}),s.jsx(Qe,{onClick:U,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),s.jsx(Ue,{open:P,onOpenChange:O,children:s.jsxs(Ve,{children:[s.jsxs(Ge,{children:[s.jsx(Be,{children:"Discard Changes"}),s.jsx($e,{children:"You have unsaved changes. Are you sure you want to discard them?"})]}),s.jsxs(Fe,{children:[s.jsx(Ke,{onClick:()=>R(null),children:"Keep Editing"}),s.jsx(Qe,{onClick:z,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Discard"})]})]})})]})}const dn=Ce().email("Invalid email address");function mn(t){if(!t.trim())return[];const e=t.split(/[,;\n]/).map(n=>n.trim().toLowerCase()).filter(n=>n.length>0);return Array.from(new Set(e))}function un({trigger:t}){const[e,n]=D.useState(!1),{locator:o}=je(),l=Me(),{data:r}=me.useSession(),d=r?.user?.email,{roles:i,isLoading:f}=Nt(),x=i.filter(j=>j.role!=="owner"),m=kt({mode:"onChange",defaultValues:{emailsText:"",role:"user"}}),b=m.watch("emailsText"),a=m.watch("role"),h=mn(b).filter(j=>{const u=dn.safeParse(j).success,y=!d||j!==d.toLowerCase();return u&&y}),E=Ee({mutationFn:async({emails:j,role:u})=>{if(!u)throw new Error("Please select a role");const y=await Promise.allSettled(j.map(async P=>{const O=await me.organization.inviteMember({email:P,role:u});if(O.error)throw new Error(O.error.message);return O.data})),N=y.filter(P=>P.status==="rejected");if(N.length>0)throw new Error(`Failed to invite ${N.length} member${N.length>1?"s":""}`);return y},onSuccess:(j,{emails:u})=>{l.invalidateQueries({queryKey:ue.members(o)}),l.invalidateQueries({queryKey:ue.invitations(o)}),le.success(u.length===1?"Member invited successfully!":`${u.length} members invited successfully!`),m.reset({emailsText:"",role:"user"}),n(!1)},onError:j=>{le.error(j instanceof Error?j.message:"Failed to invite members")}}),p=j=>{if(h.length===0){le.error("Please enter at least one valid email address");return}if(!j.role){le.error("Please select a role");return}E.mutate({emails:h,role:j.role})},v=h.length>0&&!!a;return s.jsxs(Vt,{open:e,onOpenChange:n,children:[s.jsx(Gt,{asChild:!0,children:t}),s.jsxs(Bt,{className:"sm:max-w-lg",children:[s.jsx(ds,{children:s.jsx(ms,{children:"Invite members"})}),s.jsx(js,{...m,children:s.jsxs("form",{onSubmit:m.handleSubmit(p),className:"space-y-4",children:[s.jsx(Ot,{control:m.control,name:"emailsText",render:({field:j})=>s.jsxs(It,{children:[s.jsx(Ts,{children:"Email addresses"}),s.jsx(At,{children:s.jsx(Ns,{...j,disabled:E.isPending,placeholder:`Enter email addresses separated by commas or new lines
|
|
2
|
-
e.g. user1@example.com, user2@example.com
|
|
3
|
-
or one per line`,className:"min-h-[120px] resize-none"})}),s.jsx(_t,{})]})}),s.jsx(Ot,{control:m.control,name:"role",render:({field:j})=>s.jsxs(It,{children:[s.jsx(At,{children:s.jsxs(ft,{value:j.value,onValueChange:j.onChange,disabled:E.isPending||f,children:[s.jsx(ht,{className:"w-full",children:s.jsx(gt,{placeholder:"Select a role"})}),s.jsx(xt,{children:x.map(u=>{const y=[];return u.isBuiltin||(u.allowsAllStaticPermissions?y.push("Full org access"):u.staticPermissionCount&&u.staticPermissionCount>0&&y.push(`${u.staticPermissionCount} org perm${u.staticPermissionCount!==1?"s":""}`),u.allowsAllConnections?y.push("All connections"):u.connectionCount&&u.connectionCount>0&&y.push(`${u.connectionCount} connection${u.connectionCount!==1?"s":""}`),(u.connectionCount!==0||u.allowsAllConnections)&&(u.allowsAllTools?y.push("all tools"):u.toolCount&&u.toolCount>0&&y.push(`${u.toolCount} tool${u.toolCount!==1?"s":""}`))),s.jsx(pt,{value:u.role,children:s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{children:u.label}),!u.isBuiltin&&y.length>0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:y.join(", ")})]})},u.role)})})]})}),s.jsx(_t,{})]})}),s.jsxs(us,{children:[s.jsx(ie,{variant:"outline",onClick:()=>{m.reset({emailsText:"",role:"user"}),n(!1)},type:"button",disabled:E.isPending,children:"Cancel"}),s.jsx(ie,{type:"submit",disabled:E.isPending||!v,children:E.isPending?"Inviting...":`Invite ${h.length||0} Member${h.length!==1?"s":""}`})]})]})})]})]})}function fn(){const t=oe.c(9),{org:e,locator:n}=je();let o;t[0]!==e.id?(o={connectionId:qe,orgId:e.id},t[0]=e.id,t[1]=o):o=t[1];const l=Je(o);let r;t[2]!==n?(r=ue.invitations(n),t[2]=n,t[3]=r):r=t[3];let d;t[4]!==l?(d=async()=>{const f=await l.callTool({name:"ORGANIZATION_GET",arguments:{}});return(f.structuredContent??f)?.invitations??[]},t[4]=l,t[5]=d):d=t[5];let i;return t[6]!==r||t[7]!==d?(i={queryKey:r,queryFn:d},t[6]=r,t[7]=d,t[8]=i):i=t[8],Xt(i)}function hn(){const t=oe.c(5),{locator:e}=je(),n=Me();let o;t[0]!==e||t[1]!==n?(o={mutationFn:xn,onSuccess:()=>{n.invalidateQueries({queryKey:ue.invitations(e)}),le.success("Invitation cancelled")},onError:gn},t[0]=e,t[1]=n,t[2]=o):o=t[2];const l=Ee(o);let r;return t[3]!==l?(r={cancel:l},t[3]=l,t[4]=r):r=t[4],r}function gn(t){le.error(t instanceof Error?t.message:"Failed to cancel invitation")}async function xn(t){const e=await me.organization.cancelInvitation({invitationId:t});if(e?.error)throw new Error(e.error.message);return e.data}function pn(){const t=oe.c(9),{org:e,locator:n}=je();let o;t[0]!==e.id?(o={connectionId:qe,orgId:e.id},t[0]=e.id,t[1]=o):o=t[1];const l=Je(o);let r;t[2]!==n?(r=ue.tags(n),t[2]=n,t[3]=r):r=t[3];let d;t[4]!==l?(d=async()=>{const f=await l.callTool({name:"TAGS_LIST",arguments:{}});return(f.structuredContent??f).tags},t[4]=l,t[5]=d):d=t[5];let i;return t[6]!==r||t[7]!==d?(i={queryKey:r,queryFn:d,staleTime:3e4},t[6]=r,t[7]=d,t[8]=i):i=t[8],it(i)}function bn(){const t=oe.c(10),e=Me(),{org:n,locator:o}=je();let l;t[0]!==n.id?(l={connectionId:qe,orgId:n.id},t[0]=n.id,t[1]=l):l=t[1];const r=Je(l);let d;t[2]!==r?(d=async x=>{const m=await r.callTool({name:"TAGS_CREATE",arguments:{name:x}});return(m.structuredContent??m).tag},t[2]=r,t[3]=d):d=t[3];let i;t[4]!==o||t[5]!==e?(i=()=>{e.invalidateQueries({queryKey:ue.tags(o)})},t[4]=o,t[5]=e,t[6]=i):i=t[6];let f;return t[7]!==d||t[8]!==i?(f={mutationFn:d,onSuccess:i,onError:Cn},t[7]=d,t[8]=i,t[9]=f):f=t[9],Ee(f)}function Cn(t){le.error(t instanceof Error?t.message:"Failed to create tag")}function jn(t){const e=oe.c(12),{org:n,locator:o}=je();let l;e[0]!==n.id?(l={connectionId:qe,orgId:n.id},e[0]=n.id,e[1]=l):l=e[1];const r=Je(l);let d;e[2]!==o||e[3]!==t?(d=ue.memberTags(o,t),e[2]=o,e[3]=t,e[4]=d):d=e[4];let i;e[5]!==r||e[6]!==t?(i=async()=>{const m=await r.callTool({name:"MEMBER_TAGS_GET",arguments:{memberId:t}});return(m.structuredContent??m).tags},e[5]=r,e[6]=t,e[7]=i):i=e[7];const f=!!t;let x;return e[8]!==d||e[9]!==i||e[10]!==f?(x={queryKey:d,queryFn:i,staleTime:3e4,enabled:f},e[8]=d,e[9]=i,e[10]=f,e[11]=x):x=e[11],it(x)}function Tn(){const t=oe.c(10),e=Me(),{org:n,locator:o}=je();let l;t[0]!==n.id?(l={connectionId:qe,orgId:n.id},t[0]=n.id,t[1]=l):l=t[1];const r=Je(l);let d;t[2]!==r?(d=async x=>{const{memberId:m,tagIds:b}=x,a=await r.callTool({name:"MEMBER_TAGS_SET",arguments:{memberId:m,tagIds:b}});return a.structuredContent??a},t[2]=r,t[3]=d):d=t[3];let i;t[4]!==o||t[5]!==e?(i=(x,m)=>{e.invalidateQueries({queryKey:ue.memberTags(o,m.memberId)})},t[4]=o,t[5]=e,t[6]=i):i=t[6];let f;return t[7]!==d||t[8]!==i?(f={mutationFn:d,onSuccess:i,onError:Nn},t[7]=d,t[8]=i,t[9]=f):f=t[9],Ee(f)}function Nn(t){le.error(t instanceof Error?t.message:"Failed to update member tags")}function Zt(t){const e=oe.c(44),{memberId:n,className:o,disabled:l,placeholder:r,maxDisplay:d}=t,i=l===void 0?!1:l,f=r===void 0?"Add tags...":r,x=d===void 0?2:d,[m,b]=D.useState(!1),[a,T]=D.useState(""),{data:h,isLoading:E}=pn(),p=h===void 0?[]:h,{data:v,isLoading:j}=jn(n),u=v===void 0?[]:v,y=bn(),N=Tn(),P=E||j,O=u.map(vn);let A;e[0]!==a?(A=F=>F.name.toLowerCase().includes(a.toLowerCase()),e[0]=a,e[1]=A):A=e[1];const R=p.filter(A);let I;e[2]!==a?(I=F=>F.name.toLowerCase()===a.toLowerCase(),e[2]=a,e[3]=I):I=e[3];const L=p.find(I),g=a.trim()&&!L,_=async F=>{const be=O.includes(F.id)?O.filter(_e=>_e!==F.id):[...O,F.id];await N.mutateAsync({memberId:n,tagIds:be})},S=async()=>{if(!a.trim())return;const F=await y.mutateAsync(a.trim());await N.mutateAsync({memberId:n,tagIds:[...O,F.id]}),T("")},C=async F=>{const xe=O.filter(be=>be!==F);await N.mutateAsync({memberId:n,tagIds:xe})},M=y.isPending||N.isPending,z=As;let G;e[4]!==m?(G=()=>b(!m),e[4]=m,e[5]=G):G=e[5];let K;e[6]!==o?(K=H("h-auto min-h-8 px-2 py-1 justify-start font-normal","hover:bg-accent/50",o),e[6]=o,e[7]=K):K=e[7];const W=i||P,X=P?s.jsx(He,{size:14,className:"animate-spin text-muted-foreground"}):u.length>0?s.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[u.slice(0,x).map(En),u.length>x&&s.jsxs(ye,{variant:"secondary",className:"text-xs px-1.5 py-0 h-5",children:["+",u.length-x]})]}):s.jsx("span",{className:"text-muted-foreground text-xs",children:f});let ee;e[8]===Symbol.for("react.memo_cache_sentinel")?(ee=s.jsx(ws,{size:14,className:"ml-1 shrink-0 opacity-50"}),e[8]=ee):ee=e[8];let re;e[9]!==W||e[10]!==X||e[11]!==G||e[12]!==K?(re=s.jsx(_s,{asChild:!0,children:s.jsxs(ie,{variant:"ghost",size:"sm",onClick:G,className:K,disabled:W,children:[X,ee]})}),e[9]=W,e[10]=X,e[11]=G,e[12]=K,e[13]=re):re=e[13];const te=Is,U="w-56 p-0",c="start";let w;e[14]===Symbol.for("react.memo_cache_sentinel")?(w=()=>b(!1),e[14]=w):w=e[14];const V=Ss,fe=!1;let Z;e[15]!==a?(Z=s.jsx(Os,{placeholder:"Search or create...",value:a,onValueChange:T,className:"h-9"}),e[15]=a,e[16]=Z):Z=e[16];const Y=ys,q=u.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(dt,{heading:"Selected",children:u.map(F=>s.jsx(mt,{onSelect:()=>_(F),className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ze,{checked:!0,className:"[&_svg]:!text-primary-foreground"}),s.jsx("span",{children:F.name})]}),s.jsx("button",{onClick:xe=>{xe.stopPropagation(),C(F.id)},className:"opacity-50 hover:opacity-100",disabled:M,children:s.jsx(Qt,{size:14})})]})},F.id))}),s.jsx(Rt,{})]}),he=dt,J="Available",Q=R.length===0&&!g&&s.jsx(vs,{children:"No tags found."}),ce=R.filter(F=>!O.includes(F.id)).map(F=>s.jsx(mt,{onSelect:()=>_(F),className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ze,{checked:!1,className:"[&_svg]:!text-primary-foreground"}),s.jsx("span",{children:F.name})]})},F.id));let B;e[17]!==he||e[18]!==Q||e[19]!==ce?(B=s.jsxs(he,{heading:J,children:[Q,ce]}),e[17]=he,e[18]=Q,e[19]=ce,e[20]=B):B=e[20];let se;e[21]!==S||e[22]!==M||e[23]!==a||e[24]!==g?(se=g&&s.jsxs(s.Fragment,{children:[s.jsx(Rt,{}),s.jsx(dt,{children:s.jsx(mt,{onSelect:S,className:"cursor-pointer",disabled:M,children:s.jsxs("div",{className:"flex items-center gap-2 text-primary",children:[M?s.jsx(He,{size:14,className:"animate-spin"}):s.jsx(ot,{size:14}),s.jsxs("span",{children:['Create "',a.trim(),'"']})]})})})]}),e[21]=S,e[22]=M,e[23]=a,e[24]=g,e[25]=se):se=e[25];let ne;e[26]!==Y||e[27]!==q||e[28]!==B||e[29]!==se?(ne=s.jsxs(Y,{children:[q,B,se]}),e[26]=Y,e[27]=q,e[28]=B,e[29]=se,e[30]=ne):ne=e[30];let ae;e[31]!==V||e[32]!==Z||e[33]!==ne?(ae=s.jsxs(V,{shouldFilter:fe,children:[Z,ne]}),e[31]=V,e[32]=Z,e[33]=ne,e[34]=ae):ae=e[34];let ge;e[35]!==te||e[36]!==w||e[37]!==ae?(ge=s.jsx(te,{className:U,align:c,onEscapeKeyDown:w,children:ae}),e[35]=te,e[36]=w,e[37]=ae,e[38]=ge):ge=e[38];let Te;return e[39]!==z||e[40]!==m||e[41]!==re||e[42]!==ge?(Te=s.jsxs(z,{open:m,onOpenChange:b,children:[re,ge]}),e[39]=z,e[40]=m,e[41]=re,e[42]=ge,e[43]=Te):Te=e[43],Te}function En(t){return s.jsx(ye,{variant:"secondary",className:"text-xs px-1.5 py-0 h-5",children:t.name},t.id)}function vn(t){return t.id}const Pt=["bg-neutral-400","bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500","bg-slate-500"],yn={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function rt(t){return t?t.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):"?"}function Sn(t){const e=new Map;for(const[n,o]of Object.entries(yn))e.set(n,o);for(let n=0;n<t.length;n++){const o=t[n];o&&!e.has(o.role)&&e.set(o.role,Pt[n%Pt.length]??"bg-neutral-400")}return e}function On(t){return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}function st(t){const e=oe.c(79),{role:n,memberId:o,isOwner:l,roleColorMap:r,selectableRoles:d,onRoleChange:i,size:f,className:x}=t,m=f===void 0?"xs":f;let b,a,T,h,E,p,v,j,u,y,N;if(e[0]!==x||e[1]!==l||e[2]!==o||e[3]!==i||e[4]!==n||e[5]!==r||e[6]!==d||e[7]!==m){N=Symbol.for("react.early_return_sentinel");e:{const S=r.get(n)??"bg-neutral-400";if(l){let C;e[19]!==o||e[20]!==i?(C=U=>i(o,U),e[19]=o,e[20]=i,e[21]=C):C=e[21];let M;e[22]!==n?(M=s.jsx("span",{className:"capitalize truncate",children:n}),e[22]=n,e[23]=M):M=e[23];const z=s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx("div",{className:H("size-2 rounded-full shrink-0",S)}),M]});let G;e[24]!==z?(G=s.jsx(gt,{children:z}),e[24]=z,e[25]=G):G=e[25];let K;e[26]!==x||e[27]!==m||e[28]!==G?(K=s.jsx(ht,{size:m,className:x,children:G}),e[26]=x,e[27]=m,e[28]=G,e[29]=K):K=e[29];let W;if(e[30]!==r||e[31]!==d){let U;e[33]!==r?(U=c=>{const w=r.get(c.role)??"bg-neutral-400";return s.jsx(pt,{value:c.role,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:H("size-3 rounded-full",w)}),s.jsx("span",{className:"capitalize",children:c.label})]})},c.role)},e[33]=r,e[34]=U):U=e[34],W=d.map(U),e[30]=r,e[31]=d,e[32]=W}else W=e[32];let X;e[35]!==W?(X=s.jsx(xt,{children:W}),e[35]=W,e[36]=X):X=e[36];let ee;e[37]!==l||e[38]!==n||e[39]!==C||e[40]!==K||e[41]!==X?(ee=s.jsx(Ie,{asChild:!0,children:s.jsx("div",{className:"w-fit",children:s.jsxs(ft,{value:n,onValueChange:C,disabled:l,children:[K,X]})})}),e[37]=l,e[38]=n,e[39]=C,e[40]=K,e[41]=X,e[42]=ee):ee=e[42];let re;e[43]===Symbol.for("react.memo_cache_sentinel")?(re=s.jsx(Ae,{children:s.jsx("p",{children:"The owner role cannot be changed"})}),e[43]=re):re=e[43];let te;e[44]!==ee?(te=s.jsx(Se,{children:s.jsxs(Oe,{children:[ee,re]})}),e[44]=ee,e[45]=te):te=e[45],N=te;break e}T=ft,j=n,e[46]!==o||e[47]!==i?(u=C=>i(o,C),e[46]=o,e[47]=i,e[48]=u):u=e[48],y=l,a=ht,p=m,v=x,b=gt,E="flex items-center gap-2 min-w-0",h=H("size-2 rounded-full shrink-0",S)}e[0]=x,e[1]=l,e[2]=o,e[3]=i,e[4]=n,e[5]=r,e[6]=d,e[7]=m,e[8]=b,e[9]=a,e[10]=T,e[11]=h,e[12]=E,e[13]=p,e[14]=v,e[15]=j,e[16]=u,e[17]=y,e[18]=N}else b=e[8],a=e[9],T=e[10],h=e[11],E=e[12],p=e[13],v=e[14],j=e[15],u=e[16],y=e[17],N=e[18];if(N!==Symbol.for("react.early_return_sentinel"))return N;let P;e[49]!==h?(P=s.jsx("div",{className:h}),e[49]=h,e[50]=P):P=e[50];let O;e[51]!==n?(O=s.jsx("span",{className:"capitalize truncate",children:n}),e[51]=n,e[52]=O):O=e[52];let A;e[53]!==P||e[54]!==O||e[55]!==E?(A=s.jsxs("div",{className:E,children:[P,O]}),e[53]=P,e[54]=O,e[55]=E,e[56]=A):A=e[56];let R;e[57]!==b||e[58]!==A?(R=s.jsx(b,{children:A}),e[57]=b,e[58]=A,e[59]=R):R=e[59];let I;e[60]!==a||e[61]!==R||e[62]!==p||e[63]!==v?(I=s.jsx(a,{size:p,className:v,children:R}),e[60]=a,e[61]=R,e[62]=p,e[63]=v,e[64]=I):I=e[64];let L;if(e[65]!==r||e[66]!==d){let S;e[68]!==r?(S=C=>{const M=r.get(C.role)??"bg-neutral-400";return s.jsx(pt,{value:C.role,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:H("size-3 rounded-full",M)}),s.jsx("span",{className:"capitalize",children:C.label})]})},C.role)},e[68]=r,e[69]=S):S=e[69],L=d.map(S),e[65]=r,e[66]=d,e[67]=L}else L=e[67];let g;e[70]!==L?(g=s.jsx(xt,{children:L}),e[70]=L,e[71]=g):g=e[71];let _;return e[72]!==T||e[73]!==I||e[74]!==g||e[75]!==j||e[76]!==u||e[77]!==y?(_=s.jsxs(T,{value:j,onValueChange:u,disabled:y,children:[I,g]}),e[72]=T,e[73]=I,e[74]=g,e[75]=j,e[76]=u,e[77]=y,e[78]=_):_=e[78],_}function Mt(t){const e=oe.c(51),{member:n,roles:o,onChangeRole:l,onRemove:r,isUpdating:d}=t,i=d===void 0?!1:d,f=n.role==="owner";let x,m,b,a,T,h,E,p,v;if(e[0]!==f||e[1]!==i||e[2]!==n.id||e[3]!==n.role||e[4]!==l||e[5]!==o){let I;e[15]!==n.role?(I=C=>C.role!==n.role&&C.role!=="owner",e[15]=n.role,e[16]=I):I=e[16];const L=o.filter(I);a=Ct;let g;e[17]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Ft,{size:20}),e[17]=g):g=e[17],e[18]!==f?(v=s.jsx(jt,{asChild:!0,children:s.jsx(ie,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",disabled:f,onClick:An,children:g})}),e[18]=f,e[19]=v):v=e[19],b=Tt,E="end",p=In,m=fs;let _;e[20]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(Ht,{size:16}),e[20]=_):_=e[20],e[21]!==i?(h=s.jsxs(hs,{disabled:i,children:[_,"Change Role"]}),e[21]=i,e[22]=h):h=e[22],x=gs;let S;e[23]!==i||e[24]!==n.id||e[25]!==l?(S=C=>{const M=[];return C.isBuiltin||(C.allowsAllStaticPermissions?M.push("Full org access"):C.staticPermissionCount&&C.staticPermissionCount>0&&M.push(`${C.staticPermissionCount} org perm${C.staticPermissionCount!==1?"s":""}`),C.allowsAllConnections?M.push("All connections"):C.connectionCount&&C.connectionCount>0&&M.push(`${C.connectionCount} connection${C.connectionCount!==1?"s":""}`),(C.connectionCount!==0||C.allowsAllConnections)&&(C.allowsAllTools?M.push("all tools"):C.toolCount&&C.toolCount>0&&M.push(`${C.toolCount} tool${C.toolCount!==1?"s":""}`))),s.jsxs(nt,{onClick:z=>{z.stopPropagation(),l(n.id,C.role)},disabled:i,children:[C.isBuiltin?s.jsx(Kt,{size:16}):s.jsx(Es,{size:16}),s.jsxs("span",{className:"flex flex-col",children:[s.jsx("span",{children:C.label}),!C.isBuiltin&&M.length>0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:M.join(", ")})]})]},C.role)},e[23]=i,e[24]=n.id,e[25]=l,e[26]=S):S=e[26],T=L.map(S),e[0]=f,e[1]=i,e[2]=n.id,e[3]=n.role,e[4]=l,e[5]=o,e[6]=x,e[7]=m,e[8]=b,e[9]=a,e[10]=T,e[11]=h,e[12]=E,e[13]=p,e[14]=v}else x=e[6],m=e[7],b=e[8],a=e[9],T=e[10],h=e[11],E=e[12],p=e[13],v=e[14];let j;e[27]!==x||e[28]!==T?(j=s.jsx(x,{children:T}),e[27]=x,e[28]=T,e[29]=j):j=e[29];let u;e[30]!==m||e[31]!==h||e[32]!==j?(u=s.jsxs(m,{children:[h,j]}),e[30]=m,e[31]=h,e[32]=j,e[33]=u):u=e[33];let y;e[34]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(xs,{}),e[34]=y):y=e[34];let N;e[35]!==n.id||e[36]!==r?(N=I=>{I.stopPropagation(),r(n.id)},e[35]=n.id,e[36]=r,e[37]=N):N=e[37];let P;e[38]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx($t,{size:16}),e[38]=P):P=e[38];let O;e[39]!==N?(O=s.jsxs(nt,{variant:"destructive",onClick:N,children:[P,"Remove Member"]}),e[39]=N,e[40]=O):O=e[40];let A;e[41]!==b||e[42]!==O||e[43]!==E||e[44]!==p||e[45]!==u?(A=s.jsxs(b,{align:E,onClick:p,children:[u,y,O]}),e[41]=b,e[42]=O,e[43]=E,e[44]=p,e[45]=u,e[46]=A):A=e[46];let R;return e[47]!==a||e[48]!==A||e[49]!==v?(R=s.jsxs(a,{children:[v,A]}),e[47]=a,e[48]=A,e[49]=v,e[50]=R):R=e[50],R}function In(t){return t.stopPropagation()}function An(t){return t.stopPropagation()}function Dt(t){const e=oe.c(8),{invitationId:n,onCancel:o,isCancelling:l}=t,r=l===void 0?!1:l;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(jt,{asChild:!0,children:s.jsx(ie,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:wn,children:s.jsx(Ft,{size:20})})}),e[0]=d):d=e[0];let i;e[1]!==n||e[2]!==o?(i=m=>{m.stopPropagation(),o(n)},e[1]=n,e[2]=o,e[3]=i):i=e[3];let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Qt,{size:16}),e[4]=f):f=e[4];let x;return e[5]!==r||e[6]!==i?(x=s.jsxs(Ct,{children:[d,s.jsx(Tt,{align:"end",onClick:_n,children:s.jsxs(nt,{variant:"destructive",onClick:i,disabled:r,children:[f,"Cancel Invitation"]})})]}),e[5]=r,e[6]=i,e[7]=x):x=e[7],x}function _n(t){return t.stopPropagation()}function wn(t){return t.stopPropagation()}function Rn(){const t=oe.c(79),{data:e}=bt(),{data:n}=fn(),o=hn(),l=Me(),{locator:r}=je(),[d,i]=D.useState(null),[f,x]=D.useState(null),[m,b]=D.useState(""),[a,T]=D.useState("table"),[h,E]=D.useState("member"),[p,v]=D.useState("asc"),j=e?.data?.members;let u;t[0]!==h?(u=k=>{h===k?v(Qn):(E(k),v("asc"))},t[0]=h,t[1]=u):u=t[1];const y=u;let N=j??[],P=n??[];if(m){const k=m.toLowerCase();N=N.filter($=>$.user?.name?.toLowerCase().includes(k)||$.user?.email?.toLowerCase().includes(k)||$.role?.toLowerCase().includes(k)),P=P.filter($=>$.email?.toLowerCase().includes(k)||$.role?.toLowerCase().includes(k))}if(h&&p){let k;t[2]!==p||t[3]!==h?(k=($,de)=>{let pe,ke;e:switch(h){case"member":{pe=$.user?.name||"",ke=de.user?.name||"";break e}case"role":{pe=$.role||"",ke=de.role||"";break e}case"joined":{pe=$.createdAt?typeof $.createdAt=="string"?$.createdAt:$.createdAt.toISOString():"",ke=de.createdAt?typeof de.createdAt=="string"?de.createdAt:de.createdAt.toISOString():"";break e}default:return 0}return p==="asc"?pe.localeCompare(ke):ke.localeCompare(pe)},t[2]=p,t[3]=h,t[4]=k):k=t[4],N=[...N].sort(k)}const O=N;let A;t[5]!==r||t[6]!==l?(A={mutationFn:Kn,onSuccess:()=>{l.invalidateQueries({queryKey:ue.members(r)}),le.success("Member has been removed from the organization"),i(null)},onError:Fn},t[5]=r,t[6]=l,t[7]=A):A=t[7];const R=Ee(A);let I;t[8]!==r||t[9]!==l?(I={mutationFn:$n,onSuccess:()=>{l.invalidateQueries({queryKey:ue.members(r)}),le.success("Member's role has been updated")},onError:Bn},t[8]=r,t[9]=l,t[10]=I):I=t[10];const L=Ee(I);let g;t[11]!==r||t[12]!==l?(g={mutationFn:Gn,onSuccess:()=>{l.invalidateQueries({queryKey:ue.invitations(r)}),le.success("Invitation role has been updated")},onError:Vn},t[11]=r,t[12]=l,t[13]=g):g=t[13];const _=Ee(g),{roles:S,customRoles:C}=Nt();let M;t[14]!==C?(M=Sn(C),t[14]=C,t[15]=M):M=t[15];const z=M;let G;t[16]!==S?(G=S.filter(Un),t[16]=S,t[17]=G):G=t[17];const K=G;let W;t[18]===Symbol.for("react.memo_cache_sentinel")?(W={id:"member",header:"Member",render:zn,cellClassName:"flex-1 min-w-0",sortable:!0},t[18]=W):W=t[18];let X;t[19]!==z||t[20]!==K||t[21]!==_||t[22]!==L?(X={id:"role",header:"Role",render:k=>k.type==="member"?s.jsx(st,{role:k.data.role,memberId:k.data.id,isOwner:k.data.role==="owner",roleColorMap:z,selectableRoles:K,onRoleChange:($,de)=>L.mutate({memberId:$,role:de}),className:"w-36"}):s.jsx(st,{role:k.data.role,memberId:k.data.id,isOwner:!1,roleColorMap:z,selectableRoles:K,onRoleChange:($,de)=>_.mutate({invitationId:$,role:de,email:k.data.email}),className:"w-36"}),cellClassName:"w-36 shrink-0",sortable:!0},t[19]=z,t[20]=K,t[21]=_,t[22]=L,t[23]=X):X=t[23];let ee,re;t[24]===Symbol.for("react.memo_cache_sentinel")?(ee={id:"tags",header:"Tags",render:kn,cellClassName:"w-40 shrink-0"},re={id:"joined",header:"Joined",render:Dn,cellClassName:"w-48 shrink-0",sortable:!0},t[24]=ee,t[25]=re):(ee=t[24],re=t[25]);let te;t[26]!==o.cancel.isPending||t[27]!==S||t[28]!==L?(te={id:"actions",header:"",render:k=>k.type==="member"?s.jsx(Mt,{member:k.data,roles:S,onChangeRole:($,de)=>L.mutate({memberId:$,role:de}),onRemove:i,isUpdating:L.isPending}):s.jsx(Dt,{invitationId:k.data.id,onCancel:x,isCancelling:o.cancel.isPending}),cellClassName:"w-12 shrink-0"},t[26]=o.cancel.isPending,t[27]=S,t[28]=L,t[29]=te):te=t[29];let U;t[30]!==te||t[31]!==X?(U=[W,X,ee,re,te],t[30]=te,t[31]=X,t[32]=U):U=t[32];const c=U;let w;t[33]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(cn,{trigger:s.jsxs(ie,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:[s.jsx(Kt,{size:16}),"Manage Roles"]})}),t[33]=w):w=t[33];let V;t[34]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsxs("div",{className:"flex items-center gap-2",children:[w,s.jsx(un,{trigger:s.jsx(ie,{size:"sm",children:"Invite Member"})})]}),t[34]=V):V=t[34];const fe=V,Z=[...O.map(Mn),...P.filter(Pn).map(Ln)],Y=ve,q=!!f;let he;t[35]===Symbol.for("react.memo_cache_sentinel")?(he=()=>x(null),t[35]=he):he=t[35];let J;t[36]===Symbol.for("react.memo_cache_sentinel")?(J=s.jsxs(Ge,{children:[s.jsx(Be,{children:"Cancel Invitation"}),s.jsx($e,{children:"Are you sure you want to cancel this invitation? The invitee will no longer be able to join the organization with this invitation."})]}),t[36]=J):J=t[36];let Q;t[37]===Symbol.for("react.memo_cache_sentinel")?(Q=s.jsx(Ke,{children:"Keep Invitation"}),t[37]=Q):Q=t[37];let ce;t[38]!==o.cancel||t[39]!==f?(ce=()=>{f&&(o.cancel.mutate(f),x(null))},t[38]=o.cancel,t[39]=f,t[40]=ce):ce=t[40];let B;t[41]!==o.cancel.isPending||t[42]!==ce?(B=s.jsxs(Ve,{children:[J,s.jsxs(Fe,{children:[Q,s.jsx(Qe,{onClick:ce,disabled:o.cancel.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Cancel Invitation"})]})]}),t[41]=o.cancel.isPending,t[42]=ce,t[43]=B):B=t[43];let se;t[44]!==q||t[45]!==B?(se=s.jsx(Ue,{open:q,onOpenChange:he,children:B}),t[44]=q,t[45]=B,t[46]=se):se=t[46];const ne=!!d;let ae;t[47]===Symbol.for("react.memo_cache_sentinel")?(ae=()=>i(null),t[47]=ae):ae=t[47];let ge;t[48]===Symbol.for("react.memo_cache_sentinel")?(ge=s.jsxs(Ge,{children:[s.jsx(Be,{children:"Remove Member"}),s.jsx($e,{children:"Are you sure you want to remove this member from the organization? This action cannot be undone."})]}),t[48]=ge):ge=t[48];let Te;t[49]===Symbol.for("react.memo_cache_sentinel")?(Te=s.jsx(Ke,{children:"Cancel"}),t[49]=Te):Te=t[49];let F;t[50]!==d||t[51]!==R?(F=()=>d&&R.mutate(d),t[50]=d,t[51]=R,t[52]=F):F=t[52];let xe;t[53]!==R.isPending||t[54]!==F?(xe=s.jsxs(Ve,{children:[ge,s.jsxs(Fe,{children:[Te,s.jsx(Qe,{onClick:F,disabled:R.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]}),t[53]=R.isPending,t[54]=F,t[55]=xe):xe=t[55];let be;t[56]!==ne||t[57]!==xe?(be=s.jsx(Ue,{open:ne,onOpenChange:ae,children:xe}),t[56]=ne,t[57]=xe,t[58]=be):be=t[58];let _e;t[59]===Symbol.for("react.memo_cache_sentinel")?(_e=s.jsx(ve.Header.Left,{children:s.jsx(ss,{children:s.jsx(ns,{children:s.jsx(os,{children:s.jsx(rs,{children:"Members"})})})})}),t[59]=_e):_e=t[59];let Ze;t[60]===Symbol.for("react.memo_cache_sentinel")?(Ze=[{id:"member",label:"Name"},{id:"role",label:"Role"},{id:"joined",label:"Joined"}],t[60]=Ze):Ze=t[60];let we;t[61]!==y||t[62]!==p||t[63]!==h||t[64]!==a?(we=s.jsxs(ve.Header,{children:[_e,s.jsxs(ve.Header.Right,{children:[s.jsx(ts,{viewMode:a,onViewModeChange:T,sortKey:h,sortDirection:p,onSort:y,sortOptions:Ze}),fe]})]}),t[61]=y,t[62]=p,t[63]=h,t[64]=a,t[65]=we):we=t[65];let Ye;t[66]===Symbol.for("react.memo_cache_sentinel")?(Ye=k=>{k.key==="Escape"&&(b(""),k.target.blur())},t[66]=Ye):Ye=t[66];let Re;t[67]!==m?(Re=s.jsx(De,{value:m,onChange:b,placeholder:"Search members...",onKeyDown:Ye}),t[67]=m,t[68]=Re):Re=t[68];const lt=ve,at=a==="cards"?s.jsx("div",{className:"flex-1 overflow-auto p-5",children:Z.length===0?s.jsx(ct,{title:"No members found",description:m?`No members match "${m}"`:"Invite members to get started."}):s.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:Z.map(k=>{if(k.type==="invitation")return s.jsxs(wt,{className:"transition-colors relative opacity-75",children:[s.jsx("div",{className:"absolute top-4 right-4 z-10",children:s.jsx(Dt,{invitationId:k.data.id,onCancel:x,isCancelling:o.cancel.isPending})}),s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(Pe,{fallback:rt(k.data.email),shape:"circle",size:"lg",className:"shrink-0"}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:k.data.email}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(ye,{variant:"outline",className:"w-fit text-amber-600 border-amber-400",children:"Pending"})}),s.jsx(st,{role:k.data.role,memberId:k.data.id,isOwner:!1,roleColorMap:z,selectableRoles:K,onRoleChange:(de,pe)=>_.mutate({invitationId:de,role:pe,email:k.data.email}),className:"w-fit"})]})]})]},`inv-${k.data.id}`);const $=k.data;return s.jsxs(wt,{className:"transition-colors relative",children:[s.jsx("div",{className:"absolute top-4 right-4 z-10",children:s.jsx(Mt,{member:$,roles:S,onChangeRole:(de,pe)=>L.mutate({memberId:de,role:pe}),onRemove:i,isUpdating:L.isPending})}),s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(Pe,{url:$.user?.image??void 0,fallback:rt($.user?.name),shape:"circle",size:"lg",className:"shrink-0"}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:$.user?.name||"Unknown"}),s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:$.user?.email}),s.jsx(st,{role:$.role,memberId:$.id,isOwner:$.role==="owner",roleColorMap:z,selectableRoles:K,onRoleChange:(de,pe)=>L.mutate({memberId:de,role:pe}),className:"w-fit"}),s.jsx(Zt,{memberId:$.id,maxDisplay:3})]})]})]},$.id)})})}):s.jsx(is,{columns:c,data:Z,isLoading:!1,sortKey:h,sortDirection:p,onSort:y,emptyState:m?s.jsx(ct,{title:"No members found",description:`No members match "${m}"`}):s.jsx(ct,{title:"No members found",description:"Invite members to get started."})});let Le;t[69]!==lt.Content||t[70]!==at?(Le=s.jsx(lt.Content,{children:at}),t[69]=lt.Content,t[70]=at,t[71]=Le):Le=t[71];let We;return t[72]!==Y||t[73]!==se||t[74]!==be||t[75]!==we||t[76]!==Re||t[77]!==Le?(We=s.jsxs(Y,{children:[se,be,we,Re,Le]}),t[72]=Y,t[73]=se,t[74]=be,t[75]=we,t[76]=Re,t[77]=Le,t[78]=We):We=t[78],We}function Ln(t){return{type:"invitation",data:t}}function Pn(t){return t.status==="pending"}function Mn(t){return{type:"member",data:t}}function Dn(t){return t.type==="member"?s.jsx("span",{className:"text-sm text-foreground",children:t.data.createdAt?On(t.data.createdAt):"N/A"}):s.jsx(ye,{variant:"outline",children:"Pending"})}function kn(t){return t.type==="member"?s.jsx(Zt,{memberId:t.data.id,maxDisplay:2}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"-"})}function zn(t){return t.type==="member"?s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Pe,{url:t.data.user?.image??void 0,fallback:rt(t.data.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:t.data.user?.name||"Unknown"}),s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:t.data.user?.email})]})]}):s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Pe,{fallback:rt(t.data.email),shape:"circle",size:"sm"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:t.data.email}),s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:"Invitation sent"})]})]})}function Un(t){return t.role!=="owner"}function Vn(t){le.error(t instanceof Error?t.message:"Failed to update invitation role")}async function Gn(t){const{invitationId:e,role:n,email:o}=t,l=await me.organization.cancelInvitation({invitationId:e});if(l?.error)throw new Error(l.error.message);const r=await me.organization.inviteMember({email:o,role:n});if(r?.error)throw new Error(r.error.message)}function Bn(t){le.error(t instanceof Error?t.message:"Failed to update role")}async function $n(t){const{memberId:e,role:n}=t,o=await me.organization.updateMemberRole({memberId:e,role:[n]});if(o?.error)throw new Error(o.error.message)}function Fn(t){le.error(t instanceof Error?t.message:"Failed to remove member")}async function Kn(t){const e=await me.organization.removeMember({memberIdOrEmail:t});if(e?.error)throw new Error(e.error.message)}function Qn(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Zo(){const t=oe.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ve,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:"Failed to load members"})})}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(es,{fallback:e,children:s.jsx(D.Suspense,{fallback:s.jsx(ve,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(He,{size:32,className:"animate-spin text-muted-foreground"})})}),children:s.jsx(Rn,{})})}),t[1]=n):n=t[1],n}export{Zo as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as C,c as we,e as Be,j as t,$ as Fe,E as Te,u as Ee,n as Me,m as Re,K as ve,aD as ze,B as re,t as pe}from"./index-B_0vsVr1.js";import{b as $e}from"./use-connection-DeEn4qfI.js";import{u as Oe,a as Ae}from"./constants-D9bRXDQp.js";import{I as le}from"./input-CW7SVowR.js";import{I as ke}from"./integration-icon-DAFtApWT.js";import{C as We}from"./checkbox-BCSzUsPR.js";import{a as Le,b as Ve,P as Ue}from"./popover-BNZ96bFv.js";import{i as Ge}from"./AlignLeft-Ckpqqq7X.js";import{t as Ie}from"./ChevronDown-DAk1F2Sn.js";import{S as je,a as be,b as ye,c as Ne,d as w,n as Ke}from"./select-CYY4CENz.js";import{s as qe}from"./Hash02-AH6eTaow.js";import{i as He}from"./Play-CxAaQi_l.js";import{s as Qe}from"./Plus-Bo0L9uYY.js";import{s as Je}from"./Trash01-HuK-pEft.js";import{T as Ye,a as Se}from"./toggle-group-CVFHcp8K.js";import{a as Ze,V as Xe}from"./layout-CzVwolFw.js";import{S as et}from"./save-actions-eGQZXGI3.js";import{B as tt,a as st,b as Pe,d as rt,e as lt,c as at}from"./breadcrumb-CGrLS5HH.js";import"./use-collections-vccihohV.js";import"./useMutation-lBFQDcxE.js";import"./Container-CyEPuAYL.js";import"./Check-G22LpKFd.js";import"./index-CvEIDmnk.js";import"./index-QCmdl8uj.js";import"./localstorage-keys-BAzeyS9J.js";import"./useQuery-DcRkCB2j.js";import"./tooltip-Cz-bAWiO.js";import"./Save01-CU3VjXKO.js";import"./Loading01-B3gOoSbd.js";import"./ChevronRight-BT7U8Kip.js";const _e=({size:l=24,color:e="currentColor",...s})=>C.createElement("svg",{viewBox:"0 0 24 24",width:l,height:l,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},C.createElement("path",{d:"M8 15v2m4-6v6m4-10v10m-8.2 4h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C21 18.72 21 17.88 21 16.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C18.72 3 17.88 3 16.2 3H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21Z"}));_e.displayName="BarChartSquare02";function De(l){return{id:l.id,name:l.name,type:l.type,sourcePath:l.source.path,sourceFrom:l.source.from,aggregationFn:l.aggregation.fn,groupBy:l.aggregation.groupBy||"",interval:l.aggregation.interval||""}}function it(l){return{id:l.id,name:l.name,type:l.type,source:{path:l.sourcePath,from:l.sourceFrom},aggregation:{fn:l.aggregationFn,groupBy:l.type==="table"&&l.groupBy?l.groupBy:void 0,interval:l.type==="timeseries"&&l.interval?l.interval:void 0}}}const Ce={id:crypto.randomUUID(),name:"",type:"metric",sourcePath:"$.usage.total_tokens",sourceFrom:"output",aggregationFn:"sum",groupBy:"",interval:""};function nt(l){const e=we.c(36),{result:s,widget:o}=l;if(s.error){let i;return e[0]!==s.error?(i=t.jsx("div",{className:"text-sm text-destructive bg-destructive/10 rounded p-3",children:s.error}),e[0]=s.error,e[1]=i):i=e[1],i}if(o.type==="metric"){const i=s.value??0;let d;e[2]!==i?(d=i>=1e6?`${(i/1e6).toFixed(2)}M`:i>=1e3?`${(i/1e3).toFixed(2)}K`:typeof i=="number"?i.toFixed(2):String(i),e[2]=i,e[3]=d):d=e[3];const c=d;let m;e[4]!==c?(m=t.jsx("div",{className:"text-3xl font-bold tabular-nums",children:c}),e[4]=c,e[5]=m):m=e[5];const x=s.matchedRecords??0;let h;e[6]!==x?(h=t.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[x," records matched"]}),e[6]=x,e[7]=h):h=e[7];let f;return e[8]!==m||e[9]!==h?(f=t.jsxs("div",{className:"text-center py-4",children:[m,h]}),e[8]=m,e[9]=h,e[10]=f):f=e[10],f}if(o.type==="table"&&s.groups){let i;e[11]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("thead",{className:"bg-muted/50 sticky top-0",children:t.jsxs("tr",{children:[t.jsx("th",{className:"text-left px-3 py-1.5 text-xs font-medium",children:"Key"}),t.jsx("th",{className:"text-right px-3 py-1.5 text-xs font-medium",children:"Value"})]})}),e[11]=i):i=e[11];let d;e[12]!==s.groups?(d=s.groups.length===0?t.jsx("tr",{children:t.jsx("td",{colSpan:2,className:"px-3 py-4 text-center text-muted-foreground text-xs",children:"No data"})}):s.groups.slice(0,10).map(ct),e[12]=s.groups,e[13]=d):d=e[13];let c;e[14]!==d?(c=t.jsxs("table",{className:"w-full text-sm",children:[i,t.jsx("tbody",{children:d})]}),e[14]=d,e[15]=c):c=e[15];let m;e[16]!==s.groups.length?(m=s.groups.length>10&&t.jsxs("div",{className:"text-xs text-muted-foreground text-center py-2",children:["+",s.groups.length-10," more rows"]}),e[16]=s.groups.length,e[17]=m):m=e[17];let x;return e[18]!==c||e[19]!==m?(x=t.jsxs("div",{className:"max-h-[200px] overflow-auto",children:[c,m]}),e[18]=c,e[19]=m,e[20]=x):x=e[20],x}if(o.type==="timeseries"&&s.timeseries){let i;e[21]!==s.timeseries?(i=Math.max(...s.timeseries.map(ot),1),e[21]=s.timeseries,e[22]=i):i=e[22];const d=i;let c;if(e[23]!==d||e[24]!==s.timeseries){let f;e[26]!==d?(f=(u,N)=>t.jsx("div",{className:"flex-1 bg-primary/80 rounded-t",style:{height:`${u.value/d*100}%`,minHeight:u.value>0?"2px":"0px"},title:`${new Date(u.timestamp).toLocaleString()}: ${u.value}`},N),e[26]=d,e[27]=f):f=e[27],c=s.timeseries.slice(-24).map(f),e[23]=d,e[24]=s.timeseries,e[25]=c}else c=e[25];let m;e[28]!==c?(m=t.jsx("div",{className:"flex items-end gap-0.5 h-[80px]",children:c}),e[28]=c,e[29]=m):m=e[29];let x;e[30]!==s.timeseries.length?(x=t.jsxs("div",{className:"text-xs text-muted-foreground text-center mt-2",children:[s.timeseries.length," data points"]}),e[30]=s.timeseries.length,e[31]=x):x=e[31];let h;return e[32]!==m||e[33]!==x?(h=t.jsxs("div",{className:"py-2",children:[m,x]}),e[32]=m,e[33]=x,e[34]=h):h=e[34],h}let j;return e[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"text-sm text-muted-foreground text-center py-4",children:"No preview data"}),e[35]=j):j=e[35],j}function ot(l){return l.value}function ct(l,e){return t.jsxs("tr",{className:"border-t",children:[t.jsx("td",{className:"px-3 py-1.5 font-mono text-xs",children:l.key}),t.jsx("td",{className:"px-3 py-1.5 text-right tabular-nums text-xs",children:l.value.toLocaleString()})]},e)}function mt(l){const e=we.c(113),{widget:s,onChange:o,onRemove:j,canRemove:i,onMoveUp:d,onMoveDown:c,canMoveUp:m,canMoveDown:x,onPreview:h,previewResult:f,isPreviewing:u}=l,N=!m;let z;e[0]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(Ke,{size:14}),e[0]=z):z=e[0];let D;e[1]!==d||e[2]!==N?(D=t.jsx(re,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:d,disabled:N,children:z}),e[1]=d,e[2]=N,e[3]=D):D=e[3];const ae=!x;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Ie,{size:14}),e[4]=g):g=e[4];let p;e[5]!==c||e[6]!==ae?(p=t.jsx(re,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:c,disabled:ae,children:g}),e[5]=c,e[6]=ae,e[7]=p):p=e[7];let k;e[8]!==D||e[9]!==p?(k=t.jsxs("div",{className:"flex items-center gap-0.5",children:[D,p]}),e[8]=D,e[9]=p,e[10]=k):k=e[10];let S;e[11]!==s.type?(S=t.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:s.type}),e[11]=s.type,e[12]=S):S=e[12];let F;e[13]!==s.name?(F=s.name&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-muted-foreground",children:"·"}),t.jsx("span",{className:"text-sm font-medium",children:s.name})]}),e[13]=s.name,e[14]=F):F=e[14];let _;e[15]!==k||e[16]!==S||e[17]!==F?(_=t.jsxs("div",{className:"flex items-center gap-2",children:[k,S,F]}),e[15]=k,e[16]=S,e[17]=F,e[18]=_):_=e[18];let P;e[19]!==u?(P=u?t.jsx(Fe,{size:14,className:"animate-spin"}):t.jsx(He,{size:14}),e[19]=u,e[20]=P):P=e[20];let B;e[21]!==u||e[22]!==h||e[23]!==P?(B=t.jsx(re,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:h,disabled:u,children:P}),e[21]=u,e[22]=h,e[23]=P,e[24]=B):B=e[24];const $=!i,ie=i?"visible":"hidden";let T;e[25]!==ie?(T={visibility:ie},e[25]=ie,e[26]=T):T=e[26];let O;e[27]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(Je,{size:14}),e[27]=O):O=e[27];let E;e[28]!==j||e[29]!==$||e[30]!==T?(E=t.jsx(re,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:j,disabled:$,style:T,children:O}),e[28]=j,e[29]=$,e[30]=T,e[31]=E):E=e[31];let M;e[32]!==B||e[33]!==E?(M=t.jsxs("div",{className:"flex items-center gap-1",children:[B,E]}),e[32]=B,e[33]=E,e[34]=M):M=e[34];let R;e[35]!==_||e[36]!==M?(R=t.jsxs("div",{className:"flex items-center justify-between px-4 h-11 border-b bg-muted/30",children:[_,M]}),e[35]=_,e[36]=M,e[37]=R):R=e[37];let r;e[38]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Widget Name"}),e[38]=r):r=e[38];let a;e[39]!==o||e[40]!==s?(a=b=>o({...s,name:b.target.value}),e[39]=o,e[40]=s,e[41]=a):a=e[41];let n;e[42]!==a||e[43]!==s.name?(n=t.jsxs("div",{children:[r,t.jsx(le,{placeholder:"e.g., Total Tokens",value:s.name,onChange:a})]}),e[42]=a,e[43]=s.name,e[44]=n):n=e[44];let v;e[45]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Type"}),e[45]=v):v=e[45];let y;e[46]!==o||e[47]!==s?(y=b=>{b&&o({...s,type:b,groupBy:b==="table"?s.groupBy:"",interval:b==="timeseries"?s.interval||"1h":""})},e[46]=o,e[47]=s,e[48]=y):y=e[48];let I;e[49]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(Se,{value:"metric",className:"flex-1 h-full data-[state=on]:!bg-accent/70","aria-label":"Metric",children:t.jsx(qe,{size:14})}),e[49]=I):I=e[49];let A;e[50]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Se,{value:"timeseries",className:"flex-1 h-full data-[state=on]:!bg-accent/70","aria-label":"Timeseries",children:t.jsx(_e,{size:14})}),e[50]=A):A=e[50];let ne;e[51]===Symbol.for("react.memo_cache_sentinel")?(ne=t.jsx(Se,{value:"table",className:"flex-1 h-full data-[state=on]:!bg-accent/70","aria-label":"Table",children:t.jsx(Ge,{size:14})}),e[51]=ne):ne=e[51];let W;e[52]!==y||e[53]!==s.type?(W=t.jsxs("div",{children:[v,t.jsxs(Ye,{type:"single",variant:"outline",size:"sm",value:s.type,onValueChange:y,className:"w-full h-10",children:[I,A,ne]})]}),e[52]=y,e[53]=s.type,e[54]=W):W=e[54];let L;e[55]!==n||e[56]!==W?(L=t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n,W]}),e[55]=n,e[56]=W,e[57]=L):L=e[57];let oe;e[58]===Symbol.for("react.memo_cache_sentinel")?(oe=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"JSONPath Expression"}),e[58]=oe):oe=e[58];let V;e[59]!==o||e[60]!==s?(V=b=>o({...s,sourcePath:b.target.value}),e[59]=o,e[60]=s,e[61]=V):V=e[61];let U;e[62]!==V||e[63]!==s.sourcePath?(U=t.jsx(le,{placeholder:"$.usage.total_tokens",value:s.sourcePath,onChange:V,className:"font-mono text-sm"}),e[62]=V,e[63]=s.sourcePath,e[64]=U):U=e[64];let G;e[65]!==s.sourceFrom?(G=t.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Path to extract from tool call ",s.sourceFrom]}),e[65]=s.sourceFrom,e[66]=G):G=e[66];let K;e[67]!==U||e[68]!==G?(K=t.jsxs("div",{children:[oe,U,G]}),e[67]=U,e[68]=G,e[69]=K):K=e[69];let ce;e[70]===Symbol.for("react.memo_cache_sentinel")?(ce=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Extract From"}),e[70]=ce):ce=e[70];let q;e[71]!==o||e[72]!==s?(q=b=>o({...s,sourceFrom:b}),e[71]=o,e[72]=s,e[73]=q):q=e[73];let me;e[74]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx(be,{children:t.jsx(ye,{})}),e[74]=me):me=e[74];let de;e[75]===Symbol.for("react.memo_cache_sentinel")?(de=t.jsxs(Ne,{children:[t.jsx(w,{value:"output",children:"Output"}),t.jsx(w,{value:"input",children:"Input"})]}),e[75]=de):de=e[75];let H;e[76]!==q||e[77]!==s.sourceFrom?(H=t.jsxs("div",{children:[ce,t.jsxs(je,{value:s.sourceFrom,onValueChange:q,children:[me,de]})]}),e[76]=q,e[77]=s.sourceFrom,e[78]=H):H=e[78];let ue;e[79]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Aggregation"}),e[79]=ue):ue=e[79];let Q;e[80]!==o||e[81]!==s?(Q=b=>o({...s,aggregationFn:b}),e[80]=o,e[81]=s,e[82]=Q):Q=e[82];let xe;e[83]===Symbol.for("react.memo_cache_sentinel")?(xe=t.jsx(be,{children:t.jsx(ye,{})}),e[83]=xe):xe=e[83];let he;e[84]===Symbol.for("react.memo_cache_sentinel")?(he=t.jsxs(Ne,{children:[t.jsx(w,{value:"sum",children:"Sum"}),t.jsx(w,{value:"avg",children:"Average"}),t.jsx(w,{value:"min",children:"Minimum"}),t.jsx(w,{value:"max",children:"Maximum"}),t.jsx(w,{value:"count",children:"Count"}),t.jsx(w,{value:"last",children:"Last"})]}),e[84]=he):he=e[84];let J;e[85]!==Q||e[86]!==s.aggregationFn?(J=t.jsxs("div",{children:[ue,t.jsxs(je,{value:s.aggregationFn,onValueChange:Q,children:[xe,he]})]}),e[85]=Q,e[86]=s.aggregationFn,e[87]=J):J=e[87];let Y;e[88]!==H||e[89]!==J?(Y=t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[H,J]}),e[88]=H,e[89]=J,e[90]=Y):Y=e[90];let Z;e[91]!==o||e[92]!==s?(Z=s.type==="table"&&t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Group By (JSONPath)"}),t.jsx(le,{placeholder:"$.model",value:s.groupBy,onChange:b=>o({...s,groupBy:b.target.value}),className:"font-mono text-sm"})]}),e[91]=o,e[92]=s,e[93]=Z):Z=e[93];let X;e[94]!==o||e[95]!==s?(X=s.type==="timeseries"&&t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Time Interval"}),t.jsxs(je,{value:s.interval||"1h",onValueChange:b=>o({...s,interval:b}),children:[t.jsx(be,{children:t.jsx(ye,{})}),t.jsxs(Ne,{children:[t.jsx(w,{value:"15m",children:"15 minutes"}),t.jsx(w,{value:"1h",children:"1 hour"}),t.jsx(w,{value:"1d",children:"1 day"})]})]})]}),e[94]=o,e[95]=s,e[96]=X):X=e[96];let ee;e[97]!==L||e[98]!==K||e[99]!==Y||e[100]!==Z||e[101]!==X?(ee=t.jsxs("div",{className:"space-y-4",children:[L,K,Y,Z,X]}),e[97]=L,e[98]=K,e[99]=Y,e[100]=Z,e[101]=X,e[102]=ee):ee=e[102];let fe;e[103]===Symbol.for("react.memo_cache_sentinel")?(fe=t.jsx("div",{className:"px-3 py-2 border-b text-xs font-medium text-muted-foreground",children:"Preview (last 24h)"}),e[103]=fe):fe=e[103];let te;e[104]!==f||e[105]!==s?(te=t.jsxs("div",{className:"border rounded-lg bg-muted/20 flex flex-col",children:[fe,t.jsx("div",{className:"p-3 flex-1 flex items-center justify-center",children:f?t.jsx(nt,{result:f,widget:s}):t.jsx("div",{className:"text-sm text-muted-foreground text-center",children:'Click "Preview" to test your aggregation'})})]}),e[104]=f,e[105]=s,e[106]=te):te=e[106];let se;e[107]!==ee||e[108]!==te?(se=t.jsx("div",{className:"p-4",children:t.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[ee,te]})}),e[107]=ee,e[108]=te,e[109]=se):se=e[109];let ge;return e[110]!==R||e[111]!==se?(ge=t.jsxs("div",{className:"border rounded-lg bg-card overflow-hidden",children:[R,se]}),e[110]=R,e[111]=se,e[112]=ge):ge=e[112],ge}function dt({dashboardId:l}){const{org:e,project:s,locator:o}=Ee(),j=Me(),i=Oe({connectionId:Ae,orgId:e.id}),d=$e(),{data:c}=Re({queryKey:ve.monitoringDashboardDetails(o,l),queryFn:async()=>{if(!i)throw new Error("MCP client not available");const r=await i.callTool({name:"MONITORING_DASHBOARD_GET",arguments:{id:l}});return r.structuredContent??r}}),[m,x]=C.useState(c?.name??""),[h,f]=C.useState(c?.description??""),[u,N]=C.useState(c?.widgets?.map(De)??[{...Ce}]),[z,D]=C.useState(!1),[ae,g]=C.useState(!1),[p,k]=C.useState(c?.filters?.connectionIds??[]),[S,F]=C.useState(c?.filters?.toolNames?.[0]??""),[_,P]=C.useState({}),[B,$]=C.useState(new Set),ie=()=>{N([...u,{...Ce,id:crypto.randomUUID()}]),g(!0)},T=r=>{N(u.filter((a,n)=>n!==r)),g(!0)},O=(r,a)=>{const n=[...u];n[r]=a,N(n),g(!0),P(v=>{const y={...v};return delete y[a.id],y})},E=async r=>{if(i){$(a=>new Set(a).add(r.id));try{const a=new Date,n=new Date(a.getTime()-1440*60*1e3),v={};p.length>0&&(v.connectionIds=p),S.trim()&&(v.toolNames=[S.trim()]);const I=(await i.callTool({name:"MONITORING_WIDGET_PREVIEW",arguments:{widget:{type:r.type,source:{path:r.sourcePath,from:r.sourceFrom},aggregation:{fn:r.aggregationFn,groupBy:r.type==="table"&&r.groupBy?r.groupBy:void 0,interval:r.type==="timeseries"&&r.interval?r.interval:void 0},filter:Object.keys(v).length>0?v:void 0},timeRange:{startDate:n.toISOString(),endDate:a.toISOString()}}})).structuredContent;P(A=>({...A,[r.id]:{value:I?.value,groups:I?.groups,timeseries:I?.timeseries,matchedRecords:I?.matchedRecords??0}}))}catch(a){console.error("Preview failed:",a),P(n=>({...n,[r.id]:{error:"Preview failed. Check your JSONPath expression."}}))}finally{$(a=>{const n=new Set(a);return n.delete(r.id),n})}}},M=async()=>{if(i){if(!m.trim()){pe.error("Please enter a dashboard name");return}if(u.some(r=>!r.name.trim())){pe.error("Please enter a name for all widgets");return}D(!0);try{const r={};p.length>0&&(r.connectionIds=p),S.trim()&&(r.toolNames=[S.trim()]),await i.callTool({name:"MONITORING_DASHBOARD_UPDATE",arguments:{id:l,name:m.trim(),description:h.trim()||null,filters:Object.keys(r).length>0?r:null,widgets:u.map(it)}}),pe.success("Dashboard saved"),g(!1),j.invalidateQueries({queryKey:ve.monitoringDashboards(o)}),j.invalidateQueries({queryKey:ve.monitoringDashboardDetails(o,l)})}catch(r){pe.error("Failed to save dashboard"),console.error(r)}finally{D(!1)}}};if(!c)return t.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Dashboard not found"});const R=t.jsx(tt,{children:t.jsxs(st,{children:[t.jsx(Pe,{children:t.jsx(rt,{asChild:!0,children:t.jsx(ze,{to:"/$org/$project/monitoring",params:{org:e.slug,project:s.slug},search:{tab:"dashboards"},children:"Monitoring"})})}),t.jsx(lt,{}),t.jsx(Pe,{children:t.jsxs(at,{children:["Edit ",c.name]})})]})});return t.jsxs(Ze,{breadcrumb:R,children:[t.jsx(Xe,{children:t.jsx(et,{onSave:M,onUndo:()=>{x(c?.name??""),f(c?.description??""),N(c?.widgets?.map(De)??[{...Ce}]),k(c?.filters?.connectionIds??[]),F(c?.filters?.toolNames?.[0]??""),g(!1)},isDirty:ae,isSaving:z})}),t.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:t.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Dashboard Name"}),t.jsx(le,{placeholder:"e.g., LLM Usage Overview",value:m,onChange:r=>{x(r.target.value),g(!0)}})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Description"}),t.jsx(le,{placeholder:"What does this dashboard show?",value:h,onChange:r=>{f(r.target.value),g(!0)}})]})]}),t.jsxs("div",{className:"border rounded-lg p-4 bg-muted/30",children:[t.jsxs("h2",{className:"text-sm font-medium mb-3",children:["Dashboard Filters",t.jsx("span",{className:"text-muted-foreground font-normal ml-2",children:"(applied to all widgets)"})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Servers"}),t.jsxs(Le,{children:[t.jsx(Ve,{asChild:!0,children:t.jsxs(re,{variant:"outline",className:"w-full justify-between font-normal",children:[t.jsx("span",{className:"flex items-center gap-2 truncate",children:p.length===0?t.jsx("span",{className:"text-muted-foreground",children:"All servers"}):t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"flex items-center -space-x-1",children:p.slice(0,3).map(r=>{const a=(d??[]).find(n=>n.id===r);return a?t.jsx(ke,{icon:a.icon,name:a.title||a.id,size:"xs"},r):null})}),t.jsxs("span",{children:[p.length," server",p.length!==1?"s":""]})]})}),t.jsx(Ie,{size:14,className:"text-muted-foreground shrink-0"})]})}),t.jsxs(Ue,{align:"start",className:"w-72 p-1",children:[t.jsx("div",{className:"max-h-[240px] overflow-y-auto",children:(d??[]).map(r=>{const a=p.includes(r.id);return t.jsxs("button",{type:"button",className:"flex items-center gap-3 w-full rounded-md px-2 py-2 text-sm hover:bg-muted transition-colors",onClick:()=>{k(n=>a?n.filter(v=>v!==r.id):[...n,r.id]),g(!0)},children:[t.jsx(We,{checked:a}),t.jsx(ke,{icon:r.icon,name:r.title||r.id,size:"xs"}),t.jsx("span",{className:"truncate",children:r.title||r.id})]},r.id)})}),p.length>0&&t.jsx("div",{className:"border-t p-1",children:t.jsx("button",{type:"button",className:"w-full text-xs text-muted-foreground hover:text-foreground py-1.5 transition-colors",onClick:()=>{k([]),g(!0)},children:"Clear selection"})})]})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Tool Name Filter"}),t.jsx(le,{placeholder:"e.g., openai_chat",value:S,onChange:r=>{F(r.target.value),g(!0)},className:"font-mono text-sm"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Filter to specific tool names (partial match)"})]})]})]}),t.jsxs("div",{className:"mt-12",children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsx("h2",{className:"text-lg font-medium",children:"Widgets"}),t.jsxs(re,{variant:"outline",size:"sm",onClick:ie,children:[t.jsx(Qe,{size:14,className:"mr-1.5"}),"Add Widget"]})]}),t.jsx("div",{className:"space-y-4",children:u.map((r,a)=>t.jsx(mt,{widget:r,onChange:n=>O(a,n),onRemove:()=>T(a),canRemove:u.length>1,onMoveUp:()=>{const n=[...u],v=n[a-1],y=n[a];n[a-1]=y,n[a]=v,N(n),g(!0)},onMoveDown:()=>{const n=[...u],v=n[a],y=n[a+1];n[a]=y,n[a+1]=v,N(n),g(!0)},canMoveUp:a>0,canMoveDown:a<u.length-1,onPreview:()=>E(r),previewResult:_[r.id]??null,isPreviewing:B.has(r.id)},r.id))})]})]})})]})}function Lt(){const l=we.c(5);let e;l[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},l[0]=e):e=l[0];const{dashboardId:s}=Be(e);let o;l[1]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Failed to load dashboard editor"}),l[1]=o):o=l[1];let j;l[2]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Fe,{size:24,className:"animate-spin text-muted-foreground"})}),l[2]=j):j=l[2];let i;return l[3]!==s?(i=t.jsx(Te,{fallback:o,children:t.jsx(C.Suspense,{fallback:j,children:t.jsx(dt,{dashboardId:s})})}),l[3]=s,l[4]=i):i=l[4],i}export{Lt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as Q,r as U,u as re,K as ie,b_ as we,j as t,v as oe,B as Y,b as de,_ as me,$ as ue,O as fe,d as Ie,aC as Te,b$ as ne,E as Re,aE as Pe}from"./index-B_0vsVr1.js";import{P as X}from"./index-QCmdl8uj.js";import{B as $e,a as ke,b as ze,c as Le}from"./breadcrumb-CGrLS5HH.js";import{i as xe}from"./FilterLines-BvkJQ7ij.js";import{n as ge}from"./Inbox01-CsvPcK33.js";import{i as se}from"./Loading01-B3gOoSbd.js";import{i as pe}from"./SearchMd-Cpf31N-H.js";import{u as he}from"./useQuery-DcRkCB2j.js";import{u as Fe}from"./useInfiniteQuery-Cl9EtkM0.js";import{a as Ee,f as _e,b as Oe}from"./registry-utils-DXJps8H7.js";import{u as je,W as Ke,a as Ae,f as Me,b as Be}from"./constants-D9bRXDQp.js";import{u as De,a as ye,b as Ge}from"./use-connection-DeEn4qfI.js";import{s as We}from"./slugify-CEUa2lfQ.js";import{C as Ve,E as qe}from"./collection-search-q4T1hb73.js";import{M as ae}from"./mcp-server-card-D7xlSyX7.js";import{I as Ue}from"./input-CW7SVowR.js";import{a as ve,b as be,P as Ne}from"./popover-BNZ96bFv.js";import{i as Ce}from"./Check-G22LpKFd.js";import{t as Se}from"./ChevronDown-DAk1F2Sn.js";import{s as te}from"./XClose-DGYV-4S5.js";import{s as He}from"./Plus-Bo0L9uYY.js";import{u as Je}from"./use-binding-Dz1SRdBY.js";import{L as Qe,u as Ye}from"./localstorage-keys-BAzeyS9J.js";import"./tooltip-Cz-bAWiO.js";import"./index-CvEIDmnk.js";import"./ChevronRight-BT7U8Kip.js";import"./infiniteQueryObserver-DKiK82rX.js";import"./use-collections-vccihohV.js";import"./useMutation-lBFQDcxE.js";import"./CheckVerified02-C58oaMz8.js";import"./Globe02-X-Xm1ngz.js";import"./Lock01-CodP_ius.js";import"./Terminal-BS-6VR5p.js";import"./card-CAORA3L1.js";import"./integration-icon-DAFtApWT.js";import"./Container-CyEPuAYL.js";import"./github-icon-Dp3wHhYE.js";import"./binder-BXDCztlr.js";function Ze(s,e){const r=Q.c(4),[l,d]=U.useState(s),n=U.useRef(null),i=U.useRef(!0);let c,a;return r[0]!==e||r[1]!==s?(c=()=>{if(i.current){i.current=!1;return}return n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{d(s)},e),()=>{n.current&&clearTimeout(n.current)}},a=[s,e],r[0]=e,r[1]=s,r[2]=c,r[3]=a):(c=r[2],a=r[3]),U.useEffect(c,a),l}function Xe(s){const e=Q.c(14),r=U.useRef(null),l=`scroll-position:${s}`,d=U.useRef(null);let n;e[0]!==l?(n=()=>{r.current&&sessionStorage.setItem(l,String(r.current.scrollTop))},e[0]=l,e[1]=n):n=e[1];const i=n;let c;e[2]!==l?(c=()=>{if(d.current===l)return;const j=sessionStorage.getItem(l);if(j&&r.current){const S=Number.parseInt(j,10);r.current.scrollTop=S}d.current=l},e[2]=l,e[3]=c):c=e[3];const a=c;let g;e[4]!==a||e[5]!==l?(g=()=>{d.current!==l&&a()},e[4]=a,e[5]=l,e[6]=g):g=e[6];const I=g;let o;e[7]!==a||e[8]!==l?(o=j=>{r.current=j,j&&d.current!==l&&requestAnimationFrame(()=>{a()})},e[7]=a,e[8]=l,e[9]=o):o=e[9];const p=o;let m;return e[10]!==I||e[11]!==i||e[12]!==p?(m={scrollRef:p,saveScrollPosition:i,handleScroll:I},e[10]=I,e[11]=i,e[12]=p,e[13]=m):m=e[13],m}const et=24;function tt(s){const e=Q.c(54),{registryId:r,listToolName:l,filtersToolName:d,search:n}=s,{org:i}=re();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=[],e[0]=c):c=e[0];const[a,g]=U.useState(c);let I;e[1]===Symbol.for("react.memo_cache_sentinel")?(I=[],e[1]=I):I=e[1];const[o,p]=U.useState(I),m=r||null;let j;e[2]!==i.id||e[3]!==m?(j={connectionId:m,orgId:i.id},e[2]=i.id,e[3]=m,e[4]=j):j=e[4];const S=je(j),R=!!d;let b;e[5]!==d||e[6]!==r?(b=ie.toolCall(r,d||"no-filters","{}"),e[5]=d,e[6]=r,e[7]=b):b=e[7];let N;e[8]!==S||e[9]!==d?(N=async()=>{if(!d)return{tags:[],categories:[]};const f=await S.callTool({name:d,arguments:{}});return f.structuredContent??f},e[8]=S,e[9]=d,e[10]=N):N=e[10];let P;e[11]!==b||e[12]!==N?(P={queryKey:b,queryFn:N,staleTime:36e5,retry:2},e[11]=b,e[12]=N,e[13]=P):P=e[13];const{data:$}=he(P);let h,C,k;if(e[14]!==l||e[15]!==r||e[16]!==n||e[17]!==o||e[18]!==a){const f=n?.trim()?{operator:"or",conditions:[{field:["name"],operator:"contains",value:n},{field:["title"],operator:"contains",value:n},{field:["description"],operator:"contains",value:n}]}:void 0;h={limit:et,...a.length>0&&{tags:a},...o.length>0&&{categories:o},...f&&{where:f}},k=Fe,C=ie.toolCall(r,l,JSON.stringify(h)),e[14]=l,e[15]=r,e[16]=n,e[17]=o,e[18]=a,e[19]=h,e[20]=C,e[21]=k}else h=e[19],C=e[20],k=e[21];let v;e[22]!==S||e[23]!==h||e[24]!==l?(v=async f=>{const{pageParam:Z}=f,le=Z?{...h,cursor:Z}:h,ee=await S.callTool({name:l,arguments:le});return ee.structuredContent??ee},e[22]=S,e[23]=h,e[24]=l,e[25]=v):v=e[25];let z;e[26]!==v||e[27]!==C?(z={queryKey:C,queryFn:v,initialPageParam:void 0,getNextPageParam:st,staleTime:36e5,placeholderData:we,retry:2},e[26]=v,e[27]=C,e[28]=z):z=e[28];const{data:w,fetchNextPage:x,hasNextPage:y,isFetchingNextPage:u,isFetching:T,isLoading:L,error:F}=k(z);let O;e:{if(!w?.pages||w.pages.length===0){O=null;break e}const f=w.pages[0];if(typeof f=="object"&&f!==null&&"totalCount"in f&&typeof f.totalCount=="number"){O=f.totalCount;break e}O=null}const K=O,E=w?.pages;let G;e[29]!==E?(G=Ee(E),e[29]=E,e[30]=G):G=e[30];const H=G;let W;e[31]!==n||e[32]!==o.length||e[33]!==a.length?(W=a.length>0||o.length>0||!!n?.trim(),e[31]=n,e[32]=o.length,e[33]=a.length,e[34]=W):W=e[34];const D=W,B=T&&!u&&!L&&D;let A;e[35]!==x||e[36]!==y||e[37]!==u?(A=()=>{y&&!u&&x()},e[35]=x,e[36]=y,e[37]=u,e[38]=A):A=e[38];const V=A,_=y??!1,M=R?$?.tags:void 0,q=R?$?.categories:void 0;let J;return e[39]!==D||e[40]!==T||e[41]!==u||e[42]!==B||e[43]!==L||e[44]!==H||e[45]!==F||e[46]!==V||e[47]!==o||e[48]!==a||e[49]!==_||e[50]!==M||e[51]!==q||e[52]!==K?(J={items:H,totalCount:K,hasMore:_,isLoadingMore:u,isFiltering:B,isInitialLoading:L,isFetching:T,error:F,loadMore:V,availableTags:M,availableCategories:q,selectedTags:a,selectedCategories:o,setSelectedTags:g,setSelectedCategories:p,hasActiveFilters:D},e[39]=D,e[40]=T,e[41]=u,e[42]=B,e[43]=L,e[44]=H,e[45]=F,e[46]=V,e[47]=o,e[48]=a,e[49]=_,e[50]=M,e[51]=q,e[52]=K,e[53]=J):J=e[53],J}function st(s){if(typeof s=="object"&&s!==null){const e=s.nextCursor||s.cursor;if(e)return e}}function rt(s,e){return[...s].sort((r,l)=>l.count-r.count).slice(0,e)}function ce(s){const e=Q.c(52),{label:r,items:l,selectedItems:d,onToggle:n,onClear:i}=s,[c,a]=U.useState(""),[g,I]=U.useState(!1);let o,p,m,j,S,R,b,N,P,$,h;if(e[0]!==l||e[1]!==r||e[2]!==n||e[3]!==g||e[4]!==c||e[5]!==d){const x=[...c?l.filter(E=>E.value.toLowerCase().includes(c.toLowerCase())):l].sort(lt);m=d.length,p=ve,P=g,$=I;let y;e[17]!==r?(y=t.jsx("span",{children:r}),e[17]=r,e[18]=y):y=e[18];let u;e[19]!==m?(u=m>0&&t.jsx("span",{className:"ml-1 rounded-full bg-primary text-primary-foreground px-1.5 py-0.5 text-[10px] font-medium",children:m}),e[19]=m,e[20]=u):u=e[20];let T;e[21]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(Se,{size:14,className:"opacity-50"}),e[21]=T):T=e[21],e[22]!==u||e[23]!==y?(h=t.jsx(be,{asChild:!0,children:t.jsxs(Y,{variant:"outline",size:"sm",className:"h-7 px-3 gap-1.5 text-xs font-normal flex-1",children:[y,u,T]})}),e[22]=u,e[23]=y,e[24]=h):h=e[24],o=Ne,R="w-64 p-0",b="start";let L;e[25]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx(pe,{size:16,className:"text-muted-foreground shrink-0"}),e[25]=L):L=e[25];let F;e[26]!==r?(F=r.toLowerCase(),e[26]=r,e[27]=F):F=e[27];const O=`Search ${F}...`;let K;e[28]===Symbol.for("react.memo_cache_sentinel")?(K=E=>a(E.target.value),e[28]=K):K=e[28],e[29]!==c||e[30]!==O?(N=t.jsx("div",{className:"shrink-0 w-full border-b border-border h-10",children:t.jsxs("label",{className:"flex items-center gap-2.5 h-10 px-4 cursor-text",children:[L,t.jsx(Ue,{type:"text",placeholder:O,value:c,onChange:K,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]})}),e[29]=c,e[30]=O,e[31]=N):N=e[31],j="max-h-64 overflow-y-auto p-1 flex flex-col gap-1",S=x.length===0?t.jsx("div",{className:"px-2 py-4 text-sm text-muted-foreground text-center",children:"No results found"}):x.map(E=>{const G=d.includes(E.value);return t.jsxs("button",{onClick:()=>n(E.value),className:oe("w-full flex items-center justify-between px-2 py-1.5 text-sm rounded cursor-pointer transition-colors",G?"bg-accent/50 text-foreground":"hover:bg-muted text-foreground"),children:[t.jsxs("span",{className:"truncate flex items-center gap-2",children:[G&&t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0"}),E.value]}),t.jsx("span",{className:"text-xs text-muted-foreground ml-2 shrink-0",children:E.count})]},E.value)}),e[0]=l,e[1]=r,e[2]=n,e[3]=g,e[4]=c,e[5]=d,e[6]=o,e[7]=p,e[8]=m,e[9]=j,e[10]=S,e[11]=R,e[12]=b,e[13]=N,e[14]=P,e[15]=$,e[16]=h}else o=e[6],p=e[7],m=e[8],j=e[9],S=e[10],R=e[11],b=e[12],N=e[13],P=e[14],$=e[15],h=e[16];let C;e[32]!==j||e[33]!==S?(C=t.jsx("div",{className:j,children:S}),e[32]=j,e[33]=S,e[34]=C):C=e[34];let k;e[35]!==r||e[36]!==i||e[37]!==m?(k=m>0&&t.jsx("div",{className:"p-2 border-t border-border",children:t.jsxs(Y,{variant:"ghost",size:"sm",onClick:i,className:"w-full text-xs text-muted-foreground hover:text-foreground",children:["Clear ",r.toLowerCase()]})}),e[35]=r,e[36]=i,e[37]=m,e[38]=k):k=e[38];let v;e[39]!==o||e[40]!==k||e[41]!==R||e[42]!==b||e[43]!==N||e[44]!==C?(v=t.jsxs(o,{className:R,align:b,children:[N,C,k]}),e[39]=o,e[40]=k,e[41]=R,e[42]=b,e[43]=N,e[44]=C,e[45]=v):v=e[45];let z;return e[46]!==p||e[47]!==v||e[48]!==P||e[49]!==$||e[50]!==h?(z=t.jsxs(p,{open:P,onOpenChange:$,children:[h,v]}),e[46]=p,e[47]=v,e[48]=P,e[49]=$,e[50]=h,e[51]=z):z=e[51],z}function lt(s,e){return e.count-s.count}function nt(s){const e=Q.c(67),{availableTags:r,availableCategories:l,selectedTags:d,selectedCategories:n,onTagChange:i,onCategoryChange:c}=s,a=r&&r.length>0||l&&l.length>0,g=d.length>0||n.length>0;if(!a)return null;let I;e[0]!==i||e[1]!==d?(I=y=>{d.includes(y)?i(d.filter(u=>u!==y)):i([...d,y])},e[0]=i,e[1]=d,e[2]=I):I=e[2];const o=I;let p;e[3]!==c||e[4]!==n?(p=y=>{n.includes(y)?c(n.filter(u=>u!==y)):c([...n,y])},e[3]=c,e[4]=n,e[5]=p):p=e[5];const m=p;let j;e[6]!==c||e[7]!==i?(j=()=>{i([]),c([])},e[6]=c,e[7]=i,e[8]=j):j=e[8];const S=j;let R,b,N,P,$,h,C;if(e[9]!==l||e[10]!==r||e[11]!==c||e[12]!==i||e[13]!==n||e[14]!==d||e[15]!==m||e[16]!==o){const y=l?rt(l,6):[];R=n,b=d,C=new Set(y.map(it)),$="flex items-center border-b border-border";let u;e[24]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("div",{className:"flex items-center gap-2 text-muted-foreground",children:t.jsx(xe,{size:16})}),e[24]=u):u=e[24];let T;e[25]!==l||e[26]!==c||e[27]!==n||e[28]!==m?(T=l&&l.length>0&&t.jsx(ce,{label:"Categories",items:l,selectedItems:n,onToggle:m,onClear:()=>c([])}),e[25]=l,e[26]=c,e[27]=n,e[28]=m,e[29]=T):T=e[29];let L;e[30]!==r||e[31]!==i||e[32]!==d||e[33]!==o?(L=r&&r.length>0&&t.jsx(ce,{label:"Tags",items:r,selectedItems:d,onToggle:o,onClear:()=>i([])}),e[30]=r,e[31]=i,e[32]=d,e[33]=o,e[34]=L):L=e[34],e[35]!==L||e[36]!==T?(h=t.jsxs("div",{className:"flex items-center gap-3 flex-wrap px-5 py-3 border-r border-border",children:[u,T,L]}),e[35]=L,e[36]=T,e[37]=h):h=e[37],N="flex items-center gap-3 flex-wrap px-5 py-3";let F;e[38]!==n||e[39]!==m?(F=O=>{const K=n.includes(O.value);return t.jsxs("div",{onClick:()=>m(O.value),className:oe("inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer",K?"bg-primary text-primary-foreground hover:bg-primary/80":"bg-muted hover:bg-accent text-muted-foreground"),children:[t.jsx("span",{children:O.value}),K&&t.jsx("span",{onClick:E=>{E.stopPropagation(),m(O.value)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:t.jsx(te,{size:12})})]},O.value)},e[38]=n,e[39]=m,e[40]=F):F=e[40],P=y.map(F),e[9]=l,e[10]=r,e[11]=c,e[12]=i,e[13]=n,e[14]=d,e[15]=m,e[16]=o,e[17]=R,e[18]=b,e[19]=N,e[20]=P,e[21]=$,e[22]=h,e[23]=C}else R=e[17],b=e[18],N=e[19],P=e[20],$=e[21],h=e[22],C=e[23];let k;if(e[41]!==R||e[42]!==m||e[43]!==C){let y;e[45]!==C?(y=T=>!C.has(T),e[45]=C,e[46]=y):y=e[46];let u;e[47]!==m?(u=T=>t.jsxs("div",{onClick:()=>m(T),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[t.jsx("span",{children:T}),t.jsx("span",{onClick:L=>{L.stopPropagation(),m(T)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:t.jsx(te,{size:12})})]},`cat-${T}`),e[47]=m,e[48]=u):u=e[48],k=R.filter(y).map(u),e[41]=R,e[42]=m,e[43]=C,e[44]=k}else k=e[44];let v;if(e[49]!==b||e[50]!==o){let y;e[52]!==o?(y=u=>t.jsxs("div",{onClick:()=>o(u),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[t.jsx("span",{children:u}),t.jsx("span",{onClick:T=>{T.stopPropagation(),o(u)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:t.jsx(te,{size:12})})]},`tag-${u}`),e[52]=o,e[53]=y):y=e[53],v=b.map(y),e[49]=b,e[50]=o,e[51]=v}else v=e[51];let z;e[54]!==S||e[55]!==g?(z=g&&t.jsxs(Y,{variant:"ghost",size:"sm",onClick:S,className:"h-7 text-xs text-muted-foreground hover:text-foreground gap-1 px-2",children:[t.jsx(te,{size:14}),"Clear all"]}),e[54]=S,e[55]=g,e[56]=z):z=e[56];let w;e[57]!==z||e[58]!==N||e[59]!==P||e[60]!==k||e[61]!==v?(w=t.jsxs("div",{className:N,children:[P,k,v,z]}),e[57]=z,e[58]=N,e[59]=P,e[60]=k,e[61]=v,e[62]=w):w=e[62];let x;return e[63]!==w||e[64]!==$||e[65]!==h?(x=t.jsxs("div",{className:$,children:[h,w]}),e[63]=w,e[64]=$,e[65]=h,e[66]=x):x=e[66],x}function it(s){return s.value}function ot(s,e){if(!e)return s;const r=e.toLowerCase();return s.filter(l=>(l.name||l.title||"").toLowerCase().includes(r)||(l.description||l.server?.description||"").toLowerCase().includes(r))}function at(s){return s.verified===!0||s._meta?.["mcp.mesh"]?.verified===!0}function ct(s){const e=Q.c(55),{registryId:r,listToolName:l,filtersToolName:d,storePrivateOnly:n}=s,[i,c]=U.useState(""),a=Ze(i,300),g=de(),{org:I}=re(),{scrollRef:o,saveScrollPosition:p,handleScroll:m}=Xe(`store-discovery:${r}`);let j;e[0]!==a||e[1]!==d||e[2]!==l||e[3]!==r?(j={registryId:r,listToolName:l,filtersToolName:d,search:a},e[0]=a,e[1]=d,e[2]=l,e[3]=r,e[4]=j):j=e[4];const{items:S,hasMore:R,isLoadingMore:b,isInitialLoading:N,isFetching:P,error:$,loadMore:h,availableTags:C,availableCategories:k,selectedTags:v,selectedCategories:z,setSelectedTags:w,setSelectedCategories:x,hasActiveFilters:y}=tt(j);let u,T,L,F;if(e[5]!==a||e[6]!==P||e[7]!==N||e[8]!==S||e[9]!==i||e[10]!==n){const _=i?ot(S,i):S;F=n?_.filter(mt):_,u=(i!==a||P)&&!N&&!!i,L=F.filter(at),T=F.filter(M=>!L.find(q=>q.id===M.id)),e[5]=a,e[6]=P,e[7]=N,e[8]=S,e[9]=i,e[10]=n,e[11]=u,e[12]=T,e[13]=L,e[14]=F}else u=e[11],T=e[12],L=e[13],F=e[14];const O=T;let K;e[15]!==g||e[16]!==I.slug||e[17]!==r||e[18]!==p?(K=_=>{p();const M=We(_.name||_.title||_.server?.title||""),q=typeof _.id=="string"&&_.id.includes("/"),J=typeof _.server?.name=="string"&&_.server.name.includes("/"),f=q&&!J?_.id:_.server?.name||_.id||"";g({to:"/$org/$project/store/$appName",params:{org:I.slug,project:fe,appName:M},search:{registryId:r,serverName:f}})},e[15]=g,e[16]=I.slug,e[17]=r,e[18]=p,e[19]=K):K=e[19];const E=K;let G;e[20]!==m||e[21]!==R||e[22]!==b||e[23]!==h?(G=_=>{if(m(),!R||b)return;const M=_.currentTarget;M.scrollHeight-M.scrollTop-M.clientHeight<200&&h()},e[20]=m,e[21]=R,e[22]=b,e[23]=h,e[24]=G):G=e[24];const H=G;let W;e[25]!==u||e[26]!==i?(W=t.jsx(Ve,{value:i,onChange:c,placeholder:"Search for an MCP Server...",isSearching:u}),e[25]=u,e[26]=i,e[27]=W):W=e[27];let D;e[28]!==k||e[29]!==C||e[30]!==z||e[31]!==v||e[32]!==x||e[33]!==w?(D=t.jsx(nt,{availableTags:C,availableCategories:k,selectedTags:v,selectedCategories:z,onTagChange:w,onCategoryChange:x}),e[28]=k,e[29]=C,e[30]=z,e[31]=v,e[32]=x,e[33]=w,e[34]=D):D=e[34];let B;e[35]!==O||e[36]!==$||e[37]!==E||e[38]!==y||e[39]!==R||e[40]!==N||e[41]!==b||e[42]!==u||e[43]!==i||e[44]!==L||e[45]!==F?(B=t.jsx("div",{className:"p-5",children:t.jsx("div",{children:$&&!N?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(me,{className:"size-8 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Registry unavailable"}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:"Could not load items from this registry. It may be temporarily offline."}),$.message&&t.jsx("p",{className:"text-xs text-muted-foreground/60 font-mono max-w-md mx-auto truncate",children:$.message})]}),t.jsxs(Y,{variant:"outline",size:"sm",onClick:dt,children:[t.jsx(ue,{className:"size-4"}),"Try again"]})]}):N?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(se,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading items..."})]}):F.length===0&&!y?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(ge,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No items available"}),t.jsx("p",{className:"text-muted-foreground",children:"This store doesn't have any available items yet."})]}):F.length===0&&y&&!i?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(xe,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No matching items"}),t.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your filters to find more results."})]}):i&&F.length===0&&!u?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(pe,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No results found"}),t.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your search terms."})]}):t.jsxs("div",{className:"flex flex-col gap-8",children:[u&&F.length===0&&t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(se,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Searching..."})]}),L.length>0&&t.jsx(ae,{items:L,title:"Verified",onItemClick:E}),O.length>0&&t.jsx(ae,{items:O,title:L.length>0?"All":"",onItemClick:E}),R&&b&&t.jsx("div",{className:"flex justify-center py-8",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx(se,{size:20,className:"animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading more items..."})]})})]})})}),e[35]=O,e[36]=$,e[37]=E,e[38]=y,e[39]=R,e[40]=N,e[41]=b,e[42]=u,e[43]=i,e[44]=L,e[45]=F,e[46]=B):B=e[46];let A;e[47]!==H||e[48]!==o||e[49]!==B?(A=t.jsx("div",{ref:o,className:"flex-1 overflow-y-auto",onScroll:H,children:B}),e[47]=H,e[48]=o,e[49]=B,e[50]=A):A=e[50];let V;return e[51]!==W||e[52]!==D||e[53]!==A?(V=t.jsxs("div",{className:"flex flex-col h-full",children:[W,D,A]}),e[51]=W,e[52]=D,e[53]=A,e[54]=V):V=e[54],V}function dt(){return window.location.reload()}function mt(s){return s.is_public!==!0}function ut(s){const e=Q.c(11),{registryId:r,storePrivateOnly:l}=s,d=De(r),n=d?.tools;let i;e[0]!==n?(i=_e(n),e[0]=n,e[1]=i):i=e[1];const c=i;if(!c){let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"bg-muted p-3 rounded-full",children:t.jsx(ge,{className:"size-8 text-muted-foreground"})}),e[2]=m):m=e[2];let j;return e[3]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-12 text-center space-y-4",children:[m,t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Registry not available"}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:"This registry does not support listing store items, or the connection is not responding."})]})]}),e[3]=j):j=e[3],j}const a=d?.tools;let g;e[4]!==a?(g=Oe(a),e[4]=a,e[5]=g):g=e[5];const o=g||void 0;let p;return e[6]!==c||e[7]!==r||e[8]!==l||e[9]!==o?(p=t.jsx(ct,{registryId:r,listToolName:c,filtersToolName:o,storePrivateOnly:l}),e[6]=c,e[7]=r,e[8]=l,e[9]=o,e[10]=p):p=e[10],p}function ft(s){const e=Q.c(43),{registries:r,value:l,onValueChange:d,onAddWellKnown:n,wellKnownRegistries:i,placeholder:c}=s,a=c===void 0?"Select a registry...":c,[g,I]=U.useState(!1);let o,p,m,j,S,R,b,N;if(e[0]!==g||e[1]!==a||e[2]!==r||e[3]!==l){let w;e[12]!==l?(w=y=>y.id===l,e[12]=l,e[13]=w):w=e[13];const x=r.find(w);p=ve,b=g,N=I,o=be,R=!0,m="button",e[14]===Symbol.for("react.memo_cache_sentinel")?(j=oe("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg border bg-transparent px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] h-7 min-w-[160px]"),e[14]=j):j=e[14],S=x?t.jsxs("span",{className:"flex items-center gap-2",children:[x.icon?t.jsx("img",{src:x.icon,alt:x.name,className:"w-4 h-4 rounded"}):t.jsx("span",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:x.name.slice(0,1).toUpperCase()}),t.jsx("span",{children:x.name})]}):t.jsx("span",{className:"text-muted-foreground",children:a}),e[0]=g,e[1]=a,e[2]=r,e[3]=l,e[4]=o,e[5]=p,e[6]=m,e[7]=j,e[8]=S,e[9]=R,e[10]=b,e[11]=N}else o=e[4],p=e[5],m=e[6],j=e[7],S=e[8],R=e[9],b=e[10],N=e[11];let P;e[15]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Se,{className:"size-4 opacity-50"}),e[15]=P):P=e[15];let $;e[16]!==m||e[17]!==j||e[18]!==S?($=t.jsxs("button",{type:m,className:j,children:[S,P]}),e[16]=m,e[17]=j,e[18]=S,e[19]=$):$=e[19];let h;e[20]!==o||e[21]!==R||e[22]!==$?(h=t.jsx(o,{asChild:R,children:$}),e[20]=o,e[21]=R,e[22]=$,e[23]=h):h=e[23];let C;if(e[24]!==d||e[25]!==r||e[26]!==l){let w;e[28]!==d||e[29]!==l?(w=x=>t.jsxs("button",{type:"button",onClick:()=>{d(x.id??x.name),I(!1)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[x.icon?t.jsx("img",{src:x.icon,alt:x.name,className:"w-4 h-4 rounded"}):t.jsx("span",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:x.name.slice(0,1).toUpperCase()}),t.jsx("span",{children:x.name})]}),l===(x.id??x.name)&&t.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:t.jsx(Ce,{className:"size-4"})})]},x.id??x.name),e[28]=d,e[29]=l,e[30]=w):w=e[30],C=r.map(w),e[24]=d,e[25]=r,e[26]=l,e[27]=C}else C=e[27];let k;e[31]!==n||e[32]!==i?(k=i.length>0&&t.jsxs("div",{className:"border-t border-border pt-1 mt-1",children:[t.jsx("p",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Other known registries"}),i.map(w=>t.jsxs("button",{type:"button",onClick:()=>{n(w),I(!1)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[w.icon?t.jsx("img",{src:w.icon,alt:w.title,className:"w-4 h-4 rounded"}):t.jsx("span",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:w.title.slice(0,1).toUpperCase()}),t.jsx("span",{className:"flex-1",children:w.title})]}),t.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center text-muted-foreground",children:t.jsx(He,{size:16})})]},w.id??w.title))]}),e[31]=n,e[32]=i,e[33]=k):k=e[33];let v;e[34]!==C||e[35]!==k?(v=t.jsxs(Ne,{align:"end",className:"w-auto min-w-[200px] p-1",children:[C,k]}),e[34]=C,e[35]=k,e[36]=v):v=e[36];let z;return e[37]!==p||e[38]!==h||e[39]!==v||e[40]!==b||e[41]!==N?(z=t.jsxs(p,{open:b,onOpenChange:N,children:[h,v]}),e[37]=p,e[38]=h,e[39]=v,e[40]=b,e[41]=N,e[42]=z):z=e[42],z}function xt({registries:s,onConnected:e}){const r=ye(),{org:{slug:l}}=re(),{data:d}=Ie.useSession(),n=de(),[i,c]=U.useState(!1),a=s[0],g=async()=>{if(!(!a||!d?.user?.id)){c(!0);try{const o=await r.create.mutateAsync(a);e?.(o.id)}finally{c(!1)}}},I=()=>{n({to:"/$org/$project/mcps",params:{org:l,project:fe},search:{action:"create"}})};return t.jsx(qe,{image:t.jsx("img",{src:"/store-empty-state.svg",alt:"No store connected",width:336,height:320,className:"max-w-full h-auto"}),title:"Connect to registry",description:"Connect to discover and use Connections from the community.",actions:t.jsxs(t.Fragment,{children:[t.jsxs(Y,{variant:"outline",onClick:g,disabled:i||!a,children:[a?.icon&&t.jsx("img",{src:a.icon,alt:"",className:"size-4"}),i?"Installing...":"Install Registry"]}),t.jsx(Y,{variant:"outline",onClick:I,children:"Custom Connection"})]})})}function gt(s){const e=Q.c(15),{error:r,onRetry:l,registryName:d}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(me,{className:"h-6 w-6 text-destructive"})}),e[0]=n):n=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("h3",{className:"text-lg font-medium",children:"Unable to load store"}),e[1]=i):i=e[1];let c;e[2]!==d?(c=t.jsxs("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:["The ",t.jsx("strong",{children:d})," registry is currently unreachable. This may be a temporary issue — try again in a moment."]}),e[2]=d,e[3]=c):c=e[3];let a;e[4]!==r?(a=r?.message&&t.jsx("p",{className:"text-xs text-muted-foreground/60 font-mono max-w-md mx-auto truncate",children:r.message}),e[4]=r,e[5]=a):a=e[5];let g;e[6]!==c||e[7]!==a?(g=t.jsxs("div",{className:"space-y-2",children:[i,c,a]}),e[6]=c,e[7]=a,e[8]=g):g=e[8];let I;e[9]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(ue,{className:"size-4"}),e[9]=I):I=e[9];let o;e[10]!==l?(o=t.jsxs(Y,{variant:"outline",size:"sm",onClick:l,children:[I,"Try again"]}),e[10]=l,e[11]=o):o=e[11];let p;return e[12]!==g||e[13]!==o?(p=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[n,g,o]}),e[12]=g,e[13]=o,e[14]=p):p=e[14],p}function ss(){const s=Q.c(49),{org:e,project:r}=re(),l=Ge(),d=ye(),n=Te(),i=n.location.pathname.includes("/store/")&&n.location.pathname.split("/").length>3,c=Je(l);let a;s[0]!==e.id?(a=Ke.SELF(e.id),s[0]=e.id,s[1]=a):a=s[1];const g=a,I=r.enabledPlugins,o=I==null||I.includes(ne),p=c.filter(f=>f.id!==g?!0:o);let m;s[2]!==g?(m=f=>f.id===g,s[2]=g,s[3]=m):m=s[3];const j=p.some(m);let S;s[4]!==e.id?(S={connectionId:Ae,orgId:e.id},s[4]=e.id,s[5]=S):S=s[5];const R=je(S);let b;s[6]!==r.id||s[7]!==R?(b=async()=>{const f=await R.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:r.id,pluginId:ne}});return f.structuredContent??f},s[6]=r.id,s[7]=R,s[8]=b):b=s[8];const{data:N}=he({queryKey:ie.projectPluginConfig(r.id??"",ne),queryFn:b,enabled:j&&!!r.id,staleTime:6e4}),P=N?.config?.settings;let $;s[9]!==P||s[10]!==g?($=f=>f.id===g&&P?{id:f.id,name:P.registryName||f.title,icon:P.registryIcon||f.icon||void 0}:{id:f.id,name:f.title,icon:f.icon||void 0},s[9]=P,s[10]=g,s[11]=$):$=s[11];const h=p.map($);let C;s[12]!==e.slug?(C=Qe.selectedRegistry(e.slug),s[12]=e.slug,s[13]=C):C=s[13];const[k,v]=Ye(C,ht);let z;s[14]!==k?(z=f=>f.id===k,s[14]=k,s[15]=z):z=s[15];const x=p.find(z)?.id||p[0]?.id||"",y=x===g&&P?.storePrivateOnly===!0;let u;s[16]!==e.id?(u=Me(e.id),s[16]=e.id,s[17]=u):u=s[17];let T;s[18]!==u?(T=[u],s[18]=u,s[19]=T):T=s[19];const L=T;let F;s[20]===Symbol.for("react.memo_cache_sentinel")?(F=[Be()],s[20]=F):F=s[20];const O=F;let K;s[21]!==d.create||s[22]!==v?(K=async f=>{const Z=await d.create.mutateAsync(f);v(Z.id)},s[21]=d.create,s[22]=v,s[23]=K):K=s[23];const E=K,G=new Set(p.map(pt)),H=L.filter(f=>f.id&&!G.has(f.id)),W=O.filter(f=>f.id&&!G.has(f.id));if(i){let f;return s[24]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Pe,{}),s[24]=f):f=s[24],f}let D;s[25]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(X.Header.Left,{children:t.jsx($e,{children:t.jsx(ke,{children:t.jsx(ze,{children:t.jsx(Le,{children:"Store"})})})})}),s[25]=D):D=s[25];let B;s[26]!==E?(B=async f=>E(f),s[26]=E,s[27]=B):B=s[27];let A;s[28]!==H||s[29]!==x||s[30]!==h||s[31]!==v||s[32]!==B?(A=t.jsxs(X.Header,{children:[D,t.jsx(X.Header.Right,{children:t.jsx(ft,{wellKnownRegistries:H,registries:h,value:x,onValueChange:v,onAddWellKnown:B,placeholder:"Select store..."})})]}),s[28]=H,s[29]=x,s[30]=h,s[31]=v,s[32]=B,s[33]=A):A=s[33];let V;s[34]!==x||s[35]!==h?(V=f=>{const{error:Z,resetError:le}=f;return t.jsx(gt,{error:Z,onRetry:le,registryName:h.find(ee=>ee.id===x)?.name??"registry"})},s[34]=x,s[35]=h,s[36]=V):V=s[36];let _;s[37]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[t.jsx(se,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading store items..."})]}),s[37]=_):_=s[37];let M;s[38]!==W||s[39]!==x||s[40]!==v||s[41]!==y?(M=t.jsx(U.Suspense,{fallback:_,children:x?t.jsx(ut,{registryId:x,storePrivateOnly:y}):t.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:t.jsx(xt,{registries:W,onConnected:f=>{v(f)}})})}),s[38]=W,s[39]=x,s[40]=v,s[41]=y,s[42]=M):M=s[42];let q;s[43]!==V||s[44]!==M?(q=t.jsx(X.Content,{children:t.jsx(Re,{fallback:V,children:M})}),s[43]=V,s[44]=M,s[45]=q):q=s[45];let J;return s[46]!==A||s[47]!==q?(J=t.jsxs(X,{children:[A,q]}),s[46]=A,s[47]=q,s[48]=J):J=s[48],J}function pt(s){return s.id}function ht(s){return s??""}export{ss as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as r,j as i}from"./index-B_0vsVr1.js";import{P as m}from"./project-plugins-CqDaIw1P.js";import"./useQuery-DcRkCB2j.js";import"./useMutation-lBFQDcxE.js";import"./constants-D9bRXDQp.js";import"./switch-BSc4dVNg.js";import"./label-DWU1nKSS.js";import"./Container-CyEPuAYL.js";import"./use-connection-DeEn4qfI.js";import"./use-collections-vccihohV.js";import"./use-binding-Dz1SRdBY.js";import"./binder-BXDCztlr.js";import"./use-install-from-registry-BeHRHLDl.js";import"./extract-connection-data-BkJeK0tX.js";import"./constants-DvJZMaim.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-DXJps8H7.js";import"./generate-id-Dyweu44Y.js";import"./Loading01-B3gOoSbd.js";import"./Plus-Bo0L9uYY.js";import"./select-CYY4CENz.js";import"./index-CvEIDmnk.js";import"./Check-G22LpKFd.js";import"./ChevronDown-DAk1F2Sn.js";function v(){const o=r.c(1);let t;return o[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(m,{}),o[0]=t):t=o[0],t}export{v as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as c,j as i,H as C,I as y,G as I,M as T,W as M,X as H,U,c as z,v as g}from"./index-B_0vsVr1.js";var m="Switch",[A]=U(m),[q,L]=A(m),E=c.forwardRef((a,e)=>{const{__scopeSwitch:t,name:r,checked:s,defaultChecked:n,required:o,disabled:d,value:u="on",onCheckedChange:k,form:l,...w}=a,[p,h]=c.useState(null),v=y(e,b=>h(b)),x=c.useRef(!1),S=p?l||!!p.closest("form"):!0,[f,N]=I({prop:s,defaultProp:n??!1,onChange:k,caller:m});return i.jsxs(q,{scope:t,checked:f,disabled:d,children:[i.jsx(C.button,{type:"button",role:"switch","aria-checked":f,"aria-required":o,"data-state":j(f),"data-disabled":d?"":void 0,disabled:d,value:u,...w,ref:v,onClick:T(a.onClick,b=>{N(B=>!B),S&&(x.current=b.isPropagationStopped(),x.current||b.stopPropagation())})}),S&&i.jsx(_,{control:p,bubbles:!x.current,name:r,value:u,checked:f,required:o,disabled:d,form:l,style:{transform:"translateX(-100%)"}})]})});E.displayName=m;var P="SwitchThumb",R=c.forwardRef((a,e)=>{const{__scopeSwitch:t,...r}=a,s=L(P,t);return i.jsx(C.span,{"data-state":j(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:e})});R.displayName=P;var O="SwitchBubbleInput",_=c.forwardRef(({__scopeSwitch:a,control:e,checked:t,bubbles:r=!0,...s},n)=>{const o=c.useRef(null),d=y(o,n),u=M(t),k=H(e);return c.useEffect(()=>{const l=o.current;if(!l)return;const w=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(w,"checked").set;if(u!==t&&h){const v=new Event("click",{bubbles:r});h.call(l,t),l.dispatchEvent(v)}},[u,t,r]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...s,tabIndex:-1,ref:d,style:{...s.style,...k,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});_.displayName=O;function j(a){return a?"checked":"unchecked"}var W=E,X=R;function D(a){const e=z.c(9);let t,r;e[0]!==a?({className:t,...r}=a,e[0]=a,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=g("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),e[3]=t,e[4]=s):s=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(X,{"data-slot":"switch-thumb",className:g("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")}),e[5]=n):n=e[5];let o;return e[6]!==r||e[7]!==s?(o=i.jsx(W,{"data-slot":"switch",className:s,...r,children:n}),e[6]=r,e[7]=s,e[8]=o):o=e[8],o}export{D as S};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as v,r as p,D as $,G as F,j as d,H as m,aF as M,T as P,U as L,Q as y,J as k,M as T,R as D,v as x}from"./index-B_0vsVr1.js";import{u as V,L as G}from"./localstorage-keys-BAzeyS9J.js";const K={devMode:!1,experimental_projects:!1,toolApprovalLevel:"none",enableNotifications:typeof Notification<"u"};function W(){const a=v.c(1);let e;return a[0]===Symbol.for("react.memo_cache_sentinel")?(e=G.preferences(),a[0]=e):e=a[0],V(e,z)}function z(a){return{...K,...a}}var g="Tabs",[O]=L(g,[y]),_=y(),[B,h]=O(g),N=p.forwardRef((a,e)=>{const{__scopeTabs:r,value:t,onValueChange:n,defaultValue:o,orientation:s="horizontal",dir:i,activationMode:l="automatic",...b}=a,u=$(i),[c,f]=F({prop:t,onChange:n,defaultProp:o??"",caller:g});return d.jsx(B,{scope:r,baseId:M(),value:c,onValueChange:f,orientation:s,dir:u,activationMode:l,children:d.jsx(m.div,{dir:u,"data-orientation":s,...b,ref:e})})});N.displayName=g;var C="TabsList",E=p.forwardRef((a,e)=>{const{__scopeTabs:r,loop:t=!0,...n}=a,o=h(C,r),s=_(r);return d.jsx(D,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:t,children:d.jsx(m.div,{role:"tablist","aria-orientation":o.orientation,...n,ref:e})})});E.displayName=C;var w="TabsTrigger",R=p.forwardRef((a,e)=>{const{__scopeTabs:r,value:t,disabled:n=!1,...o}=a,s=h(w,r),i=_(r),l=I(s.baseId,t),b=S(s.baseId,t),u=t===s.value;return d.jsx(k,{asChild:!0,...i,focusable:!n,active:u,children:d.jsx(m.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":b,"data-state":u?"active":"inactive","data-disabled":n?"":void 0,disabled:n,id:l,...o,ref:e,onMouseDown:T(a.onMouseDown,c=>{!n&&c.button===0&&c.ctrlKey===!1?s.onValueChange(t):c.preventDefault()}),onKeyDown:T(a.onKeyDown,c=>{[" ","Enter"].includes(c.key)&&s.onValueChange(t)}),onFocus:T(a.onFocus,()=>{const c=s.activationMode!=="manual";!u&&!n&&c&&s.onValueChange(t)})})})});R.displayName=w;var j="TabsContent",A=p.forwardRef((a,e)=>{const{__scopeTabs:r,value:t,forceMount:n,children:o,...s}=a,i=h(j,r),l=I(i.baseId,t),b=S(i.baseId,t),u=t===i.value,c=p.useRef(u);return p.useEffect(()=>{const f=requestAnimationFrame(()=>c.current=!1);return()=>cancelAnimationFrame(f)},[]),d.jsx(P,{present:n||u,children:({present:f})=>d.jsx(m.div,{"data-state":u?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":l,hidden:!f,id:b,tabIndex:0,...s,ref:e,style:{...a.style,animationDuration:c.current?"0s":void 0},children:f&&o})})});A.displayName=j;function I(a,e){return`${a}-trigger-${e}`}function S(a,e){return`${a}-content-${e}`}var H=N,U=E,q=R,J=A;function X(a){const e=v.c(10);let r,t,n;e[0]!==a?({className:r,variant:n,...t}=a,e[0]=a,e[1]=r,e[2]=t,e[3]=n):(r=e[1],t=e[2],n=e[3]);const o=n===void 0?"pill":n;let s;e[4]!==r?(s=x("flex flex-col gap-2",r),e[4]=r,e[5]=s):s=e[5];let i;return e[6]!==t||e[7]!==s||e[8]!==o?(i=d.jsx(H,{"data-slot":"tabs","data-variant":o,className:s,...t}),e[6]=t,e[7]=s,e[8]=o,e[9]=i):i=e[9],i}function Z(a){const e=v.c(11);let r,t,n;e[0]!==a?({className:r,variant:n,...t}=a,e[0]=a,e[1]=r,e[2]=t,e[3]=n):(r=e[1],t=e[2],n=e[3]);const o=n||"pill",s=o==="underline"?"flex h-[52px] items-center border-b border-border":o==="canvas"?"flex h-10 items-center bg-background relative":"bg-muted text-muted-foreground inline-flex h-10 w-fit items-center justify-center rounded-xl p-[3px]";let i;e[4]!==r||e[5]!==s?(i=x(s,r),e[4]=r,e[5]=s,e[6]=i):i=e[6];let l;return e[7]!==o||e[8]!==t||e[9]!==i?(l=d.jsx(U,{"data-slot":"tabs-list","data-variant":o,className:i,...t}),e[7]=o,e[8]=t,e[9]=i,e[10]=l):l=e[10],l}function ee(a){const e=v.c(11);let r,t,n;e[0]!==a?({className:r,variant:n,...t}=a,e[0]=a,e[1]=r,e[2]=t,e[3]=n):(r=e[1],t=e[2],n=e[3]);const o=n||"pill",s=o==="underline"?"cursor-pointer flex items-center h-full px-3 relative text-sm whitespace-nowrap border-b-2 mb-[-1px] transition-all text-muted-foreground border-transparent hover:text-foreground data-[state=active]:text-foreground data-[state=active]:border-primary disabled:pointer-events-none disabled:opacity-50":o==="canvas"?"cursor-pointer flex items-center h-full px-3 gap-2.5 text-sm whitespace-nowrap transition-all border-r border-b border-border [&>*]:opacity-50 data-[state=active]:[&>*]:opacity-100 data-[state=active]:border-b-0 last:border-r-0 disabled:pointer-events-none max-w-2xs":"data-[state=active]:bg-background dark:data-[state=active]:text-foreground cursor-pointer focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-lg border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4";let i;e[4]!==r||e[5]!==s?(i=x(s,r),e[4]=r,e[5]=s,e[6]=i):i=e[6];let l;return e[7]!==o||e[8]!==t||e[9]!==i?(l=d.jsx(q,{"data-slot":"tabs-trigger","data-variant":o,className:i,...t}),e[7]=o,e[8]=t,e[9]=i,e[10]=l):l=e[10],l}function te(a){const e=v.c(8);let r,t;e[0]!==a?({className:r,...t}=a,e[0]=a,e[1]=r,e[2]=t):(r=e[1],t=e[2]);let n;e[3]!==r?(n=x("flex-1 outline-none h-full",r),e[3]=r,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o=d.jsx(J,{"data-slot":"tabs-content",className:n,...t}),e[5]=t,e[6]=n,e[7]=o):o=e[7],o}export{ee as T,Z as a,te as b,X as c,W as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as n,j as r,E as d,r as f,u as x,b as j}from"./index-B_0vsVr1.js";import{T as h}from"./tasks-panel-C7RwVTDD.js";import{P as p}from"./index-QCmdl8uj.js";import{B as g,a as b,b as T,c as k}from"./breadcrumb-CGrLS5HH.js";import{i as B}from"./Loading01-B3gOoSbd.js";import{u as S}from"./collapsible-sQONDG4w.js";import"./index-UbeVlDrq.js";import"./popover-BNZ96bFv.js";import"./skeleton-C4ZMp7sl.js";import"./spinner-oA3jiJW_.js";import"./tooltip-Cz-bAWiO.js";import"./index-CvEIDmnk.js";import"./constants-D9bRXDQp.js";import"./decopilot-events-DHSwekTa.js";import"./useQuery-DcRkCB2j.js";import"./dialog-Baq_fjtR.js";import"./X-uHaUni9w.js";import"./form-C5R0_qWR.js";import"./label-DWU1nKSS.js";import"./input-CW7SVowR.js";import"./usage-B8eRkRZY.js";import"./ArrowUp-B3tPpNuu.js";import"./ChevronDown-DAk1F2Sn.js";import"./Edit01-D3PaS600.js";import"./Users03-CPWgVi4r.js";import"./XCircle-C4iqiznn.js";import"./AlertCircle-CXJCnY_R.js";import"./select-CYY4CENz.js";import"./Check-G22LpKFd.js";import"./tabs-BZ-xfLNG.js";import"./localstorage-keys-BAzeyS9J.js";import"./useMutation-lBFQDcxE.js";import"./ArrowLeft-ihbjidrQ.js";import"./use-copy-CykDvxn6.js";import"./badge-CxJArm69.js";import"./Code01-UXkm6aqY.js";import"./integration-icon-DAFtApWT.js";import"./Container-CyEPuAYL.js";import"./use-virtual-mcp-OwU65kyR.js";import"./use-collections-vccihohV.js";import"./SearchMd-Cpf31N-H.js";import"./use-create-virtual-mcp-DB14T-Ft.js";import"./use-mcp-resources-Rqzq7A0J.js";import"./ChevronRight-BT7U8Kip.js";import"./Copy01-tzx60ICS.js";import"./marked.esm-BaswSlok.js";import"./markdown-DCSB9ejV.js";import"./mcp-app-renderer-BtuEhdWL.js";import"./types-B46wd5bS.js";import"./Eye-C_LYW9jG.js";import"./Globe02-X-Xm1ngz.js";import"./LayersTwo01-CRgWs3EX.js";import"./XClose-DGYV-4S5.js";import"./collection-search-q4T1hb73.js";import"./use-connection-DeEn4qfI.js";import"./generate-id-Dyweu44Y.js";import"./Clock-CPO-Cqx6.js";import"./Trash01-HuK-pEft.js";import"./user-C73vNaiS.js";import"./avatar-rYlL0ZoJ.js";import"./format-time-CMKyl-GC.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./CheckCircle-Dl3Eh5mw.js";import"./Plus-Bo0L9uYY.js";import"./use-llm-B_iPCa-K.js";import"./use-binding-Dz1SRdBY.js";import"./binder-BXDCztlr.js";import"./checkbox-BCSzUsPR.js";import"./AlignLeft-Ckpqqq7X.js";import"./Image01-Dvb2vnmH.js";import"./RefreshCcw01-v6pXwg6P.js";import"./Settings01-BmEB9pVn.js";import"./useSuspenseInfiniteQuery-DdSDu-rZ.js";import"./infiniteQueryObserver-DKiK82rX.js";function v(){const t=n.c(8),{org:o,project:s}=x(),a=j(),{switchToTask:c}=S();let i;t[0]!==a||t[1]!==o.slug||t[2]!==s.slug||t[3]!==c?(i=async u=>{await c(u),a({to:"/$org/$project",params:{org:o.slug,project:s.slug}})},t[0]=a,t[1]=o.slug,t[2]=s.slug,t[3]=c,t[4]=i):i=t[4];const l=i;let m;t[5]===Symbol.for("react.memo_cache_sentinel")?(m=r.jsx(p.Header,{children:r.jsx(p.Header.Left,{children:r.jsx(g,{children:r.jsx(b,{children:r.jsx(T,{children:r.jsx(k,{children:"Tasks"})})})})})}),t[5]=m):m=t[5];let e;return t[6]!==l?(e=r.jsxs(p,{children:[m,r.jsx(p.Content,{children:r.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:r.jsx(h,{onTaskSelect:l})})})]}),t[6]=l,t[7]=e):e=t[7],e}function Mt(){const t=n.c(1);let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=r.jsx(d,{children:r.jsx(f.Suspense,{fallback:r.jsx("div",{className:"flex h-full items-center justify-center",children:r.jsx(B,{size:32,className:"animate-spin text-muted-foreground"})}),children:r.jsx(v,{})})}),t[0]=o):o=t[0],o}export{Mt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as z,b as X,r as H,j as t,_ as Y,$ as Z,O as ee}from"./index-B_0vsVr1.js";import{C as te}from"./collection-display-button-M7dfC2Rf.js";import{E as B,C as se}from"./collection-search-q4T1hb73.js";import{C as oe}from"./collection-table-wrapper-DXH0yXJC.js";import{I as ne}from"./integration-icon-DAFtApWT.js";import{B as K}from"./badge-CxJArm69.js";import{C as re}from"./card-CAORA3L1.js";import{T as G,a as P,b as W,c as ae}from"./tooltip-Cz-bAWiO.js";import{g as ie}from"./types-B46wd5bS.js";import{s as le}from"./Eye-C_LYW9jG.js";import{s as ce}from"./Globe02-X-Xm1ngz.js";import{s as me}from"./LayersTwo01-CRgWs3EX.js";import{V as de}from"./layout-CzVwolFw.js";const fe=[{key:"readOnlyHint",label:"Read-only",Icon:le,variant:"secondary"},{key:"destructiveHint",label:"Destructive",Icon:Y,variant:"destructive"},{key:"idempotentHint",label:"Idempotent",Icon:Z,variant:"secondary"},{key:"openWorldHint",label:"Open-world",Icon:ce,variant:"outline"}];function pe(s){const e=z.c(18),{annotations:a,_meta:d}=s;let u;e[0]!==d?(u=ie(d),e[0]=d,e[1]=u):u=e[1];const l=!!u;let h,x,c,f,m;if(e[2]!==a||e[3]!==l){m=Symbol.for("react.early_return_sentinel");e:{const n=a?fe.filter(I=>a[I.key]===!0):[];if(n.length===0&&!l){m=null;break e}h=ae,x="flex gap-1 flex-nowrap",e[9]!==l?(c=l&&t.jsxs(G,{children:[t.jsx(P,{asChild:!0,children:t.jsx(K,{asChild:!0,variant:"secondary",className:"size-6 p-1",children:t.jsx(me,{})})}),t.jsx(W,{children:"Interactive"})]}),e[9]=l,e[10]=c):c=e[10],f=n.map(ue)}e[2]=a,e[3]=l,e[4]=h,e[5]=x,e[6]=c,e[7]=f,e[8]=m}else h=e[4],x=e[5],c=e[6],f=e[7],m=e[8];if(m!==Symbol.for("react.early_return_sentinel"))return m;let p;e[11]!==x||e[12]!==c||e[13]!==f?(p=t.jsxs("div",{className:x,children:[c,f]}),e[11]=x,e[12]=c,e[13]=f,e[14]=p):p=e[14];let g;return e[15]!==h||e[16]!==p?(g=t.jsx(h,{children:p}),e[15]=h,e[16]=p,e[17]=g):g=e[17],g}function ue(s){const{label:e,Icon:a,variant:d}=s;return t.jsxs(G,{children:[t.jsx(P,{asChild:!0,children:t.jsx(K,{asChild:!0,variant:d,className:"size-6 p-1",children:t.jsx(a,{})})}),t.jsx(W,{children:e})]},e)}function De(s){const e=z.c(40),{tools:a,connectionId:d,org:u,onToolClick:l,showToolbar:h,emptyMessage:x,isLoading:c}=s,f=h===void 0?!0:h,m=x===void 0?"This connection doesn't have any tools yet.":x,p=c===void 0?!1:c,g=X(),[n,I]=H.useState(""),[j,F]=H.useState("table"),[r,M]=H.useState("name"),[i,V]=H.useState("asc");let w;e[0]!==i||e[1]!==r?(w=o=>{r===o?(V(Ne),i==="desc"&&M(void 0)):(M(o),V("asc"))},e[0]=i,e[1]=r,e[2]=w):w=e[2];const y=w;let _;e[3]!==d||e[4]!==g||e[5]!==l||e[6]!==u?(_=o=>{l?l(o):d&&u&&g({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:u,project:ee,connectionId:d,collectionName:"tools",itemId:encodeURIComponent(o.name)}})},e[3]=d,e[4]=g,e[5]=l,e[6]=u,e[7]=_):_=e[7];const k=_;let $;if(e[8]!==n||e[9]!==i||e[10]!==r||e[11]!==a){const o=!a||a.length===0?[]:n.trim()?(()=>{const E=n.toLowerCase();return a.filter(S=>S.name.toLowerCase().includes(E)||S.description&&S.description.toLowerCase().includes(E))})():a;$=!r||!i?o:[...o].sort((E,S)=>{const q=E[r]||"",Q=S[r]||"",U=String(q).localeCompare(String(Q));return i==="asc"?U:-U}),e[8]=n,e[9]=i,e[10]=r,e[11]=a,e[12]=$}else $=e[12];const T=$;let L;e[13]===Symbol.for("react.memo_cache_sentinel")?(L=[{id:"name",header:"Name",render:ye,sortable:!0},{id:"annotations",header:"Hints",render:je,cellClassName:"w-32 shrink-0"},{id:"description",header:"Description",render:ge,cellClassName:"flex-1",sortable:!0}],e[13]=L):L=e[13];const A=L;let O;e[14]===Symbol.for("react.memo_cache_sentinel")?(O=A.filter(xe).map(he),e[14]=O):O=e[14];const J=O;let N;e[15]!==y||e[16]!==f||e[17]!==i||e[18]!==r||e[19]!==j?(N=f&&t.jsx(de,{children:t.jsx(te,{viewMode:j,onViewModeChange:F,sortKey:r,sortDirection:i,onSort:y,sortOptions:J})}),e[15]=y,e[16]=f,e[17]=i,e[18]=r,e[19]=j,e[20]=N):N=e[20];let R;e[21]===Symbol.for("react.memo_cache_sentinel")?(R=o=>{o.key==="Escape"&&(I(""),o.target.blur())},e[21]=R):R=e[21];let v;e[22]!==n?(v=t.jsx(se,{value:n,onChange:I,placeholder:"Search tools...",onKeyDown:R}),e[22]=n,e[23]=v):v=e[23];let b;e[24]!==m||e[25]!==y||e[26]!==k||e[27]!==p||e[28]!==n||e[29]!==i||e[30]!==r||e[31]!==T||e[32]!==j?(b=j==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:T.length===0?t.jsx(B,{image:null,title:n?"No tools found":"No tools available",description:n?"Try adjusting your search terms":m}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:T.map(o=>t.jsx(re,{className:"cursor-pointer transition-colors",onClick:()=>k(o),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(ne,{icon:null,name:o.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:o.name}),t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:o.description||"No description"})]})]})},o.name))})}):t.jsx(oe,{columns:A,data:T,isLoading:p,sortKey:r,sortDirection:i,onSort:y,onRowClick:o=>k(o),emptyState:t.jsx(B,{image:null,title:n?"No tools found":"No tools available",description:n?"Try adjusting your search terms":m})}),e[24]=m,e[25]=y,e[26]=k,e[27]=p,e[28]=n,e[29]=i,e[30]=r,e[31]=T,e[32]=j,e[33]=b):b=e[33];let C;e[34]!==v||e[35]!==b?(C=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[v,b]}),e[34]=v,e[35]=b,e[36]=C):C=e[36];let D;return e[37]!==C||e[38]!==N?(D=t.jsxs(t.Fragment,{children:[N,C]}),e[37]=C,e[38]=N,e[39]=D):D=e[39],D}function he(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function xe(s){return s.sortable}function ge(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function je(s){return t.jsx(pe,{annotations:s.annotations,_meta:s._meta})}function ye(s){return t.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:s.name})}function Ne(s){return s==="asc"?"desc":s==="desc"?null:"asc"}export{De as T,pe as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,I as H,j as c,aU as W,H as K,M as C,T as S,aV as Z,aF as J,G as Q,aW as ee,aX as $,aY as te,aZ as oe,U as re,a_ as ne,a$ as se,c as j,v as ae}from"./index-B_0vsVr1.js";import{R as ie}from"./index-CvEIDmnk.js";var[O]=re("Tooltip",[$]),D=$(),G="TooltipProvider",le=700,A="tooltip.open",[ce,k]=O(G),F=o=>{const{__scopeTooltip:e,delayDuration:t=le,skipDelayDuration:r=300,disableHoverableContent:n=!1,children:s}=o,l=i.useRef(!0),d=i.useRef(!1),a=i.useRef(0);return i.useEffect(()=>{const p=a.current;return()=>window.clearTimeout(p)},[]),c.jsx(ce,{scope:e,isOpenDelayedRef:l,delayDuration:t,onOpen:i.useCallback(()=>{window.clearTimeout(a.current),l.current=!1},[]),onClose:i.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:d,onPointerInTransitChange:i.useCallback(p=>{d.current=p},[]),disableHoverableContent:n,children:s})};F.displayName=G;var R="Tooltip",[ue,_]=O(R),z=o=>{const{__scopeTooltip:e,children:t,open:r,defaultOpen:n,onOpenChange:s,disableHoverableContent:l,delayDuration:d}=o,a=k(R,o.__scopeTooltip),p=D(e),[u,v]=i.useState(null),x=J(),f=i.useRef(0),h=l??a.disableHoverableContent,T=d??a.delayDuration,g=i.useRef(!1),[y,m]=Q({prop:r,defaultProp:n??!1,onChange:N=>{N?(a.onOpen(),document.dispatchEvent(new CustomEvent(A))):a.onClose(),s?.(N)},caller:R}),w=i.useMemo(()=>y?g.current?"delayed-open":"instant-open":"closed",[y]),E=i.useCallback(()=>{window.clearTimeout(f.current),f.current=0,g.current=!1,m(!0)},[m]),P=i.useCallback(()=>{window.clearTimeout(f.current),f.current=0,m(!1)},[m]),I=i.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{g.current=!0,m(!0),f.current=0},T)},[T,m]);return i.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),c.jsx(ee,{...p,children:c.jsx(ue,{scope:e,contentId:x,open:y,stateAttribute:w,trigger:u,onTriggerChange:v,onTriggerEnter:i.useCallback(()=>{a.isOpenDelayedRef.current?I():E()},[a.isOpenDelayedRef,I,E]),onTriggerLeave:i.useCallback(()=>{h?P():(window.clearTimeout(f.current),f.current=0)},[P,h]),onOpen:E,onClose:P,disableHoverableContent:h,children:t})})};z.displayName=R;var L="TooltipTrigger",U=i.forwardRef((o,e)=>{const{__scopeTooltip:t,...r}=o,n=_(L,t),s=k(L,t),l=D(t),d=i.useRef(null),a=H(e,d,n.onTriggerChange),p=i.useRef(!1),u=i.useRef(!1),v=i.useCallback(()=>p.current=!1,[]);return i.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),c.jsx(W,{asChild:!0,...l,children:c.jsx(K.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...r,ref:a,onPointerMove:C(o.onPointerMove,x=>{x.pointerType!=="touch"&&!u.current&&!s.isPointerInTransitRef.current&&(n.onTriggerEnter(),u.current=!0)}),onPointerLeave:C(o.onPointerLeave,()=>{n.onTriggerLeave(),u.current=!1}),onPointerDown:C(o.onPointerDown,()=>{n.open&&n.onClose(),p.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:C(o.onFocus,()=>{p.current||n.onOpen()}),onBlur:C(o.onBlur,n.onClose),onClick:C(o.onClick,n.onClose)})})});U.displayName=L;var M="TooltipPortal",[de,pe]=O(M,{forceMount:void 0}),B=o=>{const{__scopeTooltip:e,forceMount:t,children:r,container:n}=o,s=_(M,e);return c.jsx(de,{scope:e,forceMount:t,children:c.jsx(S,{present:t||s.open,children:c.jsx(Z,{asChild:!0,container:n,children:r})})})};B.displayName=M;var b="TooltipContent",V=i.forwardRef((o,e)=>{const t=pe(b,o.__scopeTooltip),{forceMount:r=t.forceMount,side:n="top",...s}=o,l=_(b,o.__scopeTooltip);return c.jsx(S,{present:r||l.open,children:l.disableHoverableContent?c.jsx(Y,{side:n,...s,ref:e}):c.jsx(fe,{side:n,...s,ref:e})})}),fe=i.forwardRef((o,e)=>{const t=_(b,o.__scopeTooltip),r=k(b,o.__scopeTooltip),n=i.useRef(null),s=H(e,n),[l,d]=i.useState(null),{trigger:a,onClose:p}=t,u=n.current,{onPointerInTransitChange:v}=r,x=i.useCallback(()=>{d(null),v(!1)},[v]),f=i.useCallback((h,T)=>{const g=h.currentTarget,y={x:h.clientX,y:h.clientY},m=ge(y,g.getBoundingClientRect()),w=Te(y,m),E=me(T.getBoundingClientRect()),P=Ce([...w,...E]);d(P),v(!0)},[v]);return i.useEffect(()=>()=>x(),[x]),i.useEffect(()=>{if(a&&u){const h=g=>f(g,u),T=g=>f(g,a);return a.addEventListener("pointerleave",h),u.addEventListener("pointerleave",T),()=>{a.removeEventListener("pointerleave",h),u.removeEventListener("pointerleave",T)}}},[a,u,f,x]),i.useEffect(()=>{if(l){const h=T=>{const g=T.target,y={x:T.clientX,y:T.clientY},m=a?.contains(g)||u?.contains(g),w=!ye(y,l);m?x():w&&(x(),p())};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)}},[a,u,l,p,x]),c.jsx(Y,{...o,ref:s})}),[ve,xe]=O(R,{isInside:!1}),he=ne("TooltipContent"),Y=i.forwardRef((o,e)=>{const{__scopeTooltip:t,children:r,"aria-label":n,onEscapeKeyDown:s,onPointerDownOutside:l,...d}=o,a=_(b,t),p=D(t),{onClose:u}=a;return i.useEffect(()=>(document.addEventListener(A,u),()=>document.removeEventListener(A,u)),[u]),i.useEffect(()=>{if(a.trigger){const v=x=>{x.target?.contains(a.trigger)&&u()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[a.trigger,u]),c.jsx(te,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:v=>v.preventDefault(),onDismiss:u,children:c.jsxs(oe,{"data-state":a.stateAttribute,...p,...d,ref:e,style:{...d.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:[c.jsx(he,{children:r}),c.jsx(ve,{scope:t,isInside:!0,children:c.jsx(ie,{id:a.contentId,role:"tooltip",children:n||r})})]})})});V.displayName=b;var X="TooltipArrow",q=i.forwardRef((o,e)=>{const{__scopeTooltip:t,...r}=o,n=D(t);return xe(X,t).isInside?null:c.jsx(se,{...n,...r,ref:e})});q.displayName=X;function ge(o,e){const t=Math.abs(e.top-o.y),r=Math.abs(e.bottom-o.y),n=Math.abs(e.right-o.x),s=Math.abs(e.left-o.x);switch(Math.min(t,r,n,s)){case s:return"left";case n:return"right";case t:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Te(o,e,t=5){const r=[];switch(e){case"top":r.push({x:o.x-t,y:o.y+t},{x:o.x+t,y:o.y+t});break;case"bottom":r.push({x:o.x-t,y:o.y-t},{x:o.x+t,y:o.y-t});break;case"left":r.push({x:o.x+t,y:o.y-t},{x:o.x+t,y:o.y+t});break;case"right":r.push({x:o.x-t,y:o.y-t},{x:o.x-t,y:o.y+t});break}return r}function me(o){const{top:e,right:t,bottom:r,left:n}=o;return[{x:n,y:e},{x:t,y:e},{x:t,y:r},{x:n,y:r}]}function ye(o,e){const{x:t,y:r}=o;let n=!1;for(let s=0,l=e.length-1;s<e.length;l=s++){const d=e[s],a=e[l],p=d.x,u=d.y,v=a.x,x=a.y;u>r!=x>r&&t<(v-p)*(r-u)/(x-u)+p&&(n=!n)}return n}function Ce(o){const e=o.slice();return e.sort((t,r)=>t.x<r.x?-1:t.x>r.x?1:t.y<r.y?-1:t.y>r.y?1:0),be(e)}function be(o){if(o.length<=1)return o.slice();const e=[];for(let r=0;r<o.length;r++){const n=o[r];for(;e.length>=2;){const s=e[e.length-1],l=e[e.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))e.pop();else break}e.push(n)}e.pop();const t=[];for(let r=o.length-1;r>=0;r--){const n=o[r];for(;t.length>=2;){const s=t[t.length-1],l=t[t.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))t.pop();else break}t.push(n)}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 we=F,Ee=z,Pe=U,Re=B,_e=V,je=q;function Oe(o){const e=j.c(6);let t,r;e[0]!==o?({delayDuration:r,...t}=o,e[0]=o,e[1]=t,e[2]=r):(t=e[1],r=e[2]);const n=r===void 0?0:r;let s;return e[3]!==n||e[4]!==t?(s=c.jsx(we,{"data-slot":"tooltip-provider",delayDuration:n,...t}),e[3]=n,e[4]=t,e[5]=s):s=e[5],s}function Le(o){const e=j.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=c.jsx(Oe,{children:c.jsx(Ee,{"data-slot":"tooltip",...t})}),e[2]=t,e[3]=r):r=e[3],r}function ke(o){const e=j.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=c.jsx(Pe,{"data-slot":"tooltip-trigger",...t}),e[2]=t,e[3]=r):r=e[3],r}function Me(o){const e=j.c(13);let t,r,n,s;e[0]!==o?({className:r,sideOffset:s,children:t,...n}=o,e[0]=o,e[1]=t,e[2]=r,e[3]=n,e[4]=s):(t=e[1],r=e[2],n=e[3],s=e[4]);const l=s===void 0?0:s;let d;e[5]!==r?(d=ae("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",r),e[5]=r,e[6]=d):d=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(je,{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 p;return e[8]!==t||e[9]!==n||e[10]!==l||e[11]!==d?(p=c.jsx(Re,{children:c.jsxs(_e,{"data-slot":"tooltip-content",sideOffset:l,className:d,...n,children:[t,a]})}),e[8]=t,e[9]=n,e[10]=l,e[11]=d,e[12]=p):p=e[12],p}export{Le as T,ke as a,Me as b,Oe as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as v}from"./binder-BXDCztlr.js";import{bH as O,a1 as C,o as t,s as e,bI as g,bb as c,bJ as l,bK as M,bL as D,bM as i,bc as y,bN as m,bO as T,bP as n,bQ as _,bR as k,bS as w,bT as G,bU as U,bV as A}from"./index-B_0vsVr1.js";const B=C.extend({avatar:e().describe("URL or data URI to the assistant's avatar image"),system_prompt:e().describe("System prompt that defines the assistant's behavior"),virtual_mcp_id:e().describe("Virtual MCP ID to use for this assistant"),model:t({id:e().describe("Model ID"),connectionId:e().describe("Connection ID that provides the model")}).describe("Selected model reference for this assistant")}),W=O("assistant",B),F=[...W],I=k(()=>m([w(),e(),i(),T(),g(e(),I),c(I)])),h=g(e(),g(e(),I)).optional().describe("Additional provider-specific options. Outer record keyed by provider name, inner by option key"),E=t({type:n("text"),text:e().describe("The text content"),providerOptions:h}),j=t({type:n("text"),text:e().describe("The text content"),providerMetadata:l().optional().describe("Additional provider-specific metadata")}),q=e().describe("File data as URL string"),R=t({type:n("file"),filename:e().optional().describe("Optional filename of the file"),data:q,mediaType:e().describe("IANA media type of the file (e.g., image/png, audio/mp3)"),providerOptions:h}),Y=t({type:n("file"),mediaType:e().describe("IANA media type of the file (e.g., image/png, audio/mp3)"),data:e().describe("Generated file data as base64 encoded string")}),$=t({type:n("reasoning"),text:e().describe("The reasoning text"),providerOptions:h}),J=t({type:n("reasoning"),text:e().describe("The reasoning text"),providerMetadata:l().optional().describe("Additional provider-specific metadata")}),K=t({type:n("tool-call"),toolCallId:e().describe("ID of the tool call, used to match with tool result"),toolName:e().describe("Name of the tool being called"),input:e().describe("Arguments of the tool call (JSON-serializable object matching tool input schema)"),providerExecuted:T().optional().describe("Whether the tool call will be executed by the provider"),providerOptions:h}),V=t({type:n("tool-call"),toolCallId:e().describe("ID of the tool call"),toolName:e().describe("Name of the tool being called"),input:e().describe("Stringified JSON object with the tool call arguments"),providerExecuted:T().optional().describe("Whether the tool call will be executed by the provider"),providerMetadata:l().optional().describe("Additional provider-specific metadata")}),z=m([t({type:n("text"),value:e()}),t({type:n("json"),value:I}),t({type:n("error-text"),value:e()}),t({type:n("error-json"),value:I}),t({type:n("content"),value:c(m([t({type:n("text"),text:e().describe("Text content")}),t({type:n("media"),data:e().describe("Base-64 encoded media data"),mediaType:e().describe("IANA media type")})]))}),t({type:n("execution-denied"),reason:e().optional()}),e().describe("Raw or JSON-serialized output (e.g. from AI SDK mapToolResultOutput)")]),x=t({type:n("tool-result"),toolCallId:e().describe("ID of the tool call that this result is associated with"),toolName:e().describe("Name of the tool that generated this result"),output:z.describe("Result of the tool call"),result:_().describe("Unknown result of the tool call"),providerOptions:h}),H=t({type:n("tool-result"),toolCallId:e().describe("ID of the tool call that this result is associated with"),toolName:e().describe("Name of the tool that generated this result"),result:l().describe("Result of the tool call (JSON-serializable)"),isError:T().optional().describe("Whether the result is an error or error message"),providerExecuted:T().optional().describe("Whether the tool result was generated by the provider"),providerMetadata:l().optional().describe("Additional provider-specific metadata")}),X=m([t({type:n("source"),sourceType:n("url"),id:e().describe("The ID of the source"),url:e().describe("The URL of the source"),title:e().optional().describe("The title of the source"),providerMetadata:l().optional().describe("Additional provider-specific metadata")}),t({type:n("source"),sourceType:n("document"),id:e().describe("The ID of the source"),mediaType:e().describe("IANA media type of the document (e.g., application/pdf)"),title:e().describe("The title of the document"),filename:e().optional().describe("Optional filename of the document"),providerMetadata:l().optional().describe("Additional provider-specific metadata")})]),Q=t({role:n("system"),content:e().describe("System message content"),providerOptions:h}),Z=t({role:n("user"),content:c(m([E,R])).describe("User message content parts (text or file)"),providerOptions:h}),ee=t({role:n("assistant"),content:c(m([E,R,$,K,x])).describe("Assistant message content parts (text, file, reasoning, tool-call, or tool-result)"),providerOptions:h}),te=t({role:n("tool"),content:c(x).describe("Tool message content (tool results)"),providerOptions:h}),oe=m([Q,Z,ee,te]),ae=c(oe).describe("A list of messages forming the prompt"),ne=t({prompt:ae.describe("A language model prompt is a standardized prompt type (array of messages with roles: system, user, assistant, tool)"),maxOutputTokens:i().optional().describe("Maximum number of tokens to generate"),temperature:i().optional().describe("Temperature setting. The range depends on the provider and model"),topP:i().optional().describe("Nucleus sampling parameter"),topK:i().optional().describe("Only sample from the top K options for each subsequent token. Used to remove long tail low probability responses"),presencePenalty:i().optional().describe("Presence penalty setting. It affects the likelihood of the model to repeat information that is already in the prompt"),frequencyPenalty:i().optional().describe("Frequency penalty setting. It affects the likelihood of the model to repeatedly use the same words or phrases"),seed:i().optional().describe("The seed (integer) to use for random sampling. If set and supported by the model, calls will generate deterministic results"),stopSequences:c(e()).optional().describe("Stop sequences. If set, the model will stop generating text when one of the stop sequences is generated"),responseFormat:m([t({type:n("text")}),t({type:n("json"),schema:l().optional().describe("JSON schema that the generated output should conform to"),name:e().optional().describe("Name of output that should be generated"),description:e().optional().describe("Description of the output that should be generated")})]).optional().describe("Response format. The output can either be text or JSON. Default is text"),tools:c(l()).optional().describe("The tools that are available for the model"),toolChoice:l().optional().describe("Specifies how the tool should be selected. Defaults to 'auto'"),includeRawChunks:T().optional().describe("Include raw chunks in the stream. Only applicable for streaming calls"),abortSignal:l().optional().describe("Abort signal for cancelling the operation"),providerOptions:l().optional().describe("Additional provider-specific options")}),ie=t({content:c(m([j,Y,J,V,H,X])).describe("Ordered content that the model has generated (text, tool-calls, reasoning, files, sources)"),finishReason:y(["stop","length","content-filter","tool-calls","error","other","unknown"]).describe("Reason why generation stopped"),usage:D({inputTokens:i().optional(),outputTokens:i().optional(),totalTokens:i().optional(),reasoningTokens:i().optional()}).describe("Usage information for the language model call"),providerMetadata:l().optional().describe("Additional provider-specific metadata"),request:t({body:l().optional().describe("Request HTTP body sent to the provider API")}).optional().describe("Optional request information for telemetry and debugging"),response:t({id:e().optional().describe("ID for the generated response"),timestamp:M().optional().describe("Timestamp for the start of the generated response"),modelId:e().optional().describe("The ID of the response model that was used"),headers:g(e(),e()).optional().describe("Response headers"),body:l().optional().describe("Response HTTP body")}).optional().describe("Optional response information for telemetry and debugging"),warnings:c(l()).describe("Warnings for the call, e.g. unsupported settings")});t({stream:l().describe("ReadableStream of LanguageModelV2StreamPart"),request:t({body:l().optional().describe("Request HTTP body sent to the provider API")}).optional().describe("Optional request information for telemetry and debugging"),response:t({headers:g(e(),e()).optional().describe("Response headers")}).optional().describe("Optional response data")});const re=t({supportedUrls:g(e(),c(e())).describe("Supported URL patterns by media type for the provider")});t({modelId:e().describe("The ID of the model"),logo:e().nullable(),description:e().nullable(),capabilities:c(e()),limits:t({contextWindow:i(),maxOutputTokens:i()}).nullable(),costs:t({input:i(),output:i()}).nullable(),provider:y(["openai","anthropic","google","x-ai","deepseek","openai-compatible","openrouter"]).nullable()});const N=t({modelId:e().describe("The ID of the model"),callOptions:ne}),se=C.extend({logo:e().nullable(),description:e().nullable(),capabilities:c(e()),limits:t({contextWindow:i(),maxOutputTokens:i()}).nullable(),costs:t({input:i(),output:i()}).nullable(),provider:y(["openai","anthropic","google","xai","deepseek","openai-compatible","openrouter"]).nullable()}),le=O("llm",se,{readOnly:!0}),ce=[{name:"LLM_METADATA",inputSchema:t({modelId:e().describe("The ID of the model")}),outputSchema:re},{name:"LLM_DO_STREAM",inputSchema:N,streamable:!0},{name:"LLM_DO_GENERATE",inputSchema:N,outputSchema:ie},...le],de=t({scopes:c(e()).describe("List of scopes available"),stateSchema:g(e(),_()).describe("JSON Schema (draft-07) defining the state structure")}),pe=[{name:"MCP_CONFIGURATION",inputSchema:t({}),outputSchema:de}],ue=t({}).strict(),me=t({billing:t({mode:y(["prepaid","postpaid"]),limitPeriod:y(["daily","weekly","monthly"]).nullable()}),limit:t({total:i().nullable(),remaining:i().nullable(),reset:e().nullable()}),usage:t({total:i(),daily:i(),weekly:i(),monthly:i()}),alert:t({enabled:T(),threshold_usd:i(),email:e().nullable()}),connectionId:e()}),he=[{name:"GATEWAY_USAGE",inputSchema:ue,outputSchema:me},{name:"GATEWAY_SET_LIMIT",inputSchema:t({}),outputSchema:t({}),opt:!0},{name:"GATEWAY_SET_ALERT",inputSchema:t({}),outputSchema:t({}),opt:!0}],L={LLMS:ce,WORKFLOW:U,WORKFLOW_EXECUTION:G,ASSISTANTS:F,MCP:pe,AI_GATEWAY_BILLING:he};function be(o){return o.map(a=>({name:a.name,inputSchema:a.inputSchema?(()=>{try{return A(a.inputSchema)}catch(s){return console.error(`Failed to convert input schema for ${a.name}:`,s),t({})}})():t({}),outputSchema:a.outputSchema?(()=>{try{return A(a.outputSchema)}catch(s){return console.error(`Failed to convert output schema for ${a.name}:`,s),t({})}})():t({})}))}function fe(o,a){const s=o.tools;if(!s||s.length===0)return!1;const r=s.map(p=>({name:p.name,inputSchema:p.inputSchema})),d=a.map(p=>({name:p.name,inputSchema:p.inputSchema,opt:p.opt}));return v(d).isImplementedBy(r)}function Ae({connections:o,binding:a}){const s=(()=>{if(a){if(typeof a=="string"){const r=a.toUpperCase(),d=L[r];if(!d){console.warn(`[useBindingConnections] Unknown binding "${a}". Available bindings: ${Object.keys(L).join(", ")}. Returning all connections without filtering.`);return}return d}if(a.length===0){console.warn("[useBindingConnections] Empty binding array provided. Returning all connections without filtering.");return}return be(a)}})();return o?s?o.filter(r=>fe(r,s)):o:[]}function ge(o){return o.toLowerCase().split("_").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" ")}function P(o){if(!o||o.length===0)return[];const a=/^COLLECTION_(.+)_LIST$/,s=[];for(const r of o){const d=r.name.match(a);d?.[1]&&s.push(d[1])}return s}function Te(o){return!o||o.length===0?!1:o.some(a=>a.name==="REGISTRY_ITEM_LIST"||a.name==="COLLECTION_REGISTRY_APP_LIST"?!0:a.name.startsWith("COLLECTION_REGISTRY_APP_"))}function Se(o,a){const r=o.find(u=>u.name===`COLLECTION_${a}_CREATE`)?.inputSchema?.properties;if(r&&typeof r=="object"&&"data"in r)return r.data;const b=o.find(u=>u.name===`COLLECTION_${a}_UPDATE`)?.inputSchema?.properties;if(b&&typeof b=="object"&&"data"in b)return b.data;const S=o.find(u=>u.name===`COLLECTION_${a}_LIST`)?.outputSchema?.properties;if(S&&typeof S=="object"&&"items"in S){const u=S.items;if(u.items)return u.items}}function ye(o,a){const s=a.toUpperCase();return{hasCreateTool:o.some(r=>r.name===`COLLECTION_${s}_CREATE`),hasUpdateTool:o.some(r=>r.name===`COLLECTION_${s}_UPDATE`),hasDeleteTool:o.some(r=>r.name===`COLLECTION_${s}_DELETE`)}}function Ie(o){if(!o||o.length===0)return[];const a=P(o);if(a.length===0)return[];const s=[];for(const r of a)try{const d=O(r.toLowerCase(),C,{readOnly:!0}),b=o.map(f=>({name:f.name,inputSchema:f.inputSchema})),p=d.map(f=>({name:f.name,inputSchema:f.inputSchema}));if(v(p).isImplementedBy(b)){const f=ye(o,r);s.push({name:r,displayName:ge(r),schema:Se(o,r),...f})}}catch{}return s}function Ne(o){return Ie(o?.tools??null)}function Le(o){return o?o.filter(a=>P(a.tools).includes("REGISTRY_APP")||Te(a.tools)):[]}export{he as A,Ae as a,Ne as b,fe as c,Le as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as u}from"./infiniteQueryObserver-DKiK82rX.js";import{Y as i}from"./index-B_0vsVr1.js";function t(e,r){return i(e,u,r)}export{t as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Y as u,a3 as s}from"./index-B_0vsVr1.js";function o(e,r){return u(e,s,r)}export{o as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as s}from"./infiniteQueryObserver-DKiK82rX.js";import{Y as u,Z as n}from"./index-B_0vsVr1.js";function a(r,e){return u({...r,enabled:!0,suspense:!0,throwOnError:n},s,e)}export{a as u};
|