@decocms/mesh 2.125.0 → 2.125.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-BzYW4X7z.js → AlertCircle-DxaosN_f.js} +1 -1
- package/dist/client/assets/{AlertOctagon-CUysWl_m.js → AlertOctagon-cUZLNABf.js} +1 -1
- package/dist/client/assets/{AlertTriangle-DniGvpwb.js → AlertTriangle-4A_giHV7.js} +1 -1
- package/dist/client/assets/{ArrowDown-B35oswmj.js → ArrowDown-BCC90_2r.js} +1 -1
- package/dist/client/assets/{ArrowLeft-dS1h2Fqu.js → ArrowLeft-CPy9b3-I.js} +1 -1
- package/dist/client/assets/{ArrowUp-G8RCE5_O.js → ArrowUp-095f00XC.js} +1 -1
- package/dist/client/assets/{Check-Bv0pZ3gl.js → Check-DX81M4UN.js} +1 -1
- package/dist/client/assets/{CheckCircle-lzDHXhkH.js → CheckCircle-CIh-eFaM.js} +1 -1
- package/dist/client/assets/{CheckDone01-BrxNvWbF.js → CheckDone01-B4S514Pm.js} +1 -1
- package/dist/client/assets/{CheckVerified02-6wwLRSRQ.js → CheckVerified02-BZWM283O.js} +1 -1
- package/dist/client/assets/{ChevronDown-CggIFEVQ.js → ChevronDown-C_pFRqX8.js} +1 -1
- package/dist/client/assets/{ChevronRight-DgAfR8pA.js → ChevronRight-DY1xiCUb.js} +1 -1
- package/dist/client/assets/{Clock-IA7N95Qq.js → Clock-vSHk4lRO.js} +1 -1
- package/dist/client/assets/{Code01-DP2jwP0n.js → Code01-D3JhXTPK.js} +1 -1
- package/dist/client/assets/{Container-jfv9L6Hc.js → Container-adXBBWtI.js} +1 -1
- package/dist/client/assets/{Copy01-Dq7Edhtu.js → Copy01-y1kUbB69.js} +1 -1
- package/dist/client/assets/{Dataflow03-C6KAN8vb.js → Dataflow03-CGMAE4CD.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-CQ-MbYsC.js → DotsHorizontal-B48pfMoL.js} +1 -1
- package/dist/client/assets/{DotsVertical-PhooMqUv.js → DotsVertical-fI7whvq1.js} +1 -1
- package/dist/client/assets/{Download01-CA9RmYjX.js → Download01-CQdpB9dg.js} +1 -1
- package/dist/client/assets/{Edit01-DRruZKzG.js → Edit01-DV7i6b_1.js} +1 -1
- package/dist/client/assets/{Eye-B9ZDOUkE.js → Eye-0EEXzuIs.js} +1 -1
- package/dist/client/assets/{File02-B2t2I1sM.js → File02-DDGoV-pJ.js} +1 -1
- package/dist/client/assets/{File06-2US99J_V.js → File06-vlWs29hO.js} +1 -1
- package/dist/client/assets/{FilterLines-BFeSNY4D.js → FilterLines-C6hE4dxD.js} +1 -1
- package/dist/client/assets/{Globe01-Dxe6Kj1c.js → Globe01-YUJRKhi7.js} +1 -1
- package/dist/client/assets/{Globe02-BPmEw10H.js → Globe02-McmndEy1.js} +1 -1
- package/dist/client/assets/{Grid01-CJW4ZLO5.js → Grid01-D-UJvJ4U.js} +1 -1
- package/dist/client/assets/{Hash02-CIZbsu7P.js → Hash02-BsuEn6Tr.js} +1 -1
- package/dist/client/assets/{Home02-Doo3wLuN.js → Home02-BzWLDni0.js} +1 -1
- package/dist/client/assets/{Image01-C9h8llDV.js → Image01-D37M36hG.js} +1 -1
- package/dist/client/assets/{Inbox01-BweXezQd.js → Inbox01-A36zOoLA.js} +1 -1
- package/dist/client/assets/{InfoCircle-DBbArWGV.js → InfoCircle-BptNWRbo.js} +1 -1
- package/dist/client/assets/{Key01-CfL5jY3W.js → Key01-DTOaoO9L.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DAvzaXYE.js → LinkExternal01-s5AS-l6s.js} +1 -1
- package/dist/client/assets/{List-sG42OZ_v.js → List-ChBrkSt3.js} +1 -1
- package/dist/client/assets/{Loading01-BHMOj-H5.js → Loading01-C_dZ70Y_.js} +1 -1
- package/dist/client/assets/{Lock01-CQ3bhGvR.js → Lock01-BgYAZD0M.js} +1 -1
- package/dist/client/assets/{Pin01-8MTlfWD2.js → Pin01-m8Usx-G2.js} +1 -1
- package/dist/client/assets/{Play-APj1Lxit.js → Play-Dj27C0Pj.js} +1 -1
- package/dist/client/assets/{Plus-DNqvDLOK.js → Plus-Cqqd1qB7.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-4dzpBOob.js → RefreshCcw01-aEpj51K0.js} +1 -1
- package/dist/client/assets/{RefreshCw01-DHXbMDcX.js → RefreshCw01-CND9qgYc.js} +1 -1
- package/dist/client/assets/{Rows03-Cdgrgsit.js → Rows03-YSN8NfTb.js} +1 -1
- package/dist/client/assets/{Save01-D-T2SbCx.js → Save01-Cvritm34.js} +1 -1
- package/dist/client/assets/{SearchMd-BLcaRHQs.js → SearchMd-C2TJxhWh.js} +1 -1
- package/dist/client/assets/{Settings01-DKXbh8uh.js → Settings01-CUb7_xIo.js} +1 -1
- package/dist/client/assets/{Shield01-B89AcbSX.js → Shield01-BmOROuXR.js} +1 -1
- package/dist/client/assets/{Terminal-BblMM2fp.js → Terminal-Z3ZvfZjV.js} +1 -1
- package/dist/client/assets/{Trash01-CkTOgej8.js → Trash01-DGNEPK6E.js} +1 -1
- package/dist/client/assets/{Upload01-gcuuVZ2S.js → Upload01-Bu2dTgTN.js} +1 -1
- package/dist/client/assets/{Users03-C1B58zTV.js → Users03-21KXT9Tr.js} +1 -1
- package/dist/client/assets/{XCircle-DneNZUk0.js → XCircle-DtxTTf3G.js} +1 -1
- package/dist/client/assets/{XClose-Dgr_gyyv.js → XClose-aBNfOQCP.js} +1 -1
- package/dist/client/assets/{agent-connections-preview-Dq0jl9Fh.js → agent-connections-preview-CUZdrftq.js} +1 -1
- package/dist/client/assets/{agent-detail-BNn3Uyo0.js → agent-detail-CQ93FkhV.js} +1 -1
- package/dist/client/assets/{agents-BAZxaM_m.js → agents-DH13svFw.js} +1 -1
- package/dist/client/assets/{alert-dialog-BvNipqK_.js → alert-dialog-CqcaYkiJ.js} +1 -1
- package/dist/client/assets/{auth-catchall-BoSUXTLZ.js → auth-catchall-D1O9ygtz.js} +1 -1
- package/dist/client/assets/{avatar-BNKSN34R.js → avatar-CLwmO-iu.js} +1 -1
- package/dist/client/assets/{badge-Do8iK9u9.js → badge-COxDM0wU.js} +1 -1
- package/dist/client/assets/{binder-BBB8LQyx.js → binder-BnqkDZhr.js} +1 -1
- package/dist/client/assets/{breadcrumb-DeYbtjMk.js → breadcrumb-DNLwlIVn.js} +1 -1
- package/dist/client/assets/{button-D6YZfFzy.js → button-Bh5FwGIY.js} +1 -1
- package/dist/client/assets/{card-BNyCnFpQ.js → card-CQpD36Cd.js} +1 -1
- package/dist/client/assets/{chart--8-symKO.js → chart-CJ0LfYbL.js} +1 -1
- package/dist/client/assets/{checkbox-BZwARXIv.js → checkbox-2aSR3jmV.js} +1 -1
- package/dist/client/assets/{circle-alert-YjViK8VE.js → circle-alert-CkvRYvnb.js} +1 -1
- package/dist/client/assets/{collection-detail-LkGK1rw-.js → collection-detail-egzLIo3p.js} +1 -1
- package/dist/client/assets/{collection-search-CBYSITVU.js → collection-search-By6ZMwtA.js} +1 -1
- package/dist/client/assets/{collection-tab-BrrYAQmN.js → collection-tab-DFeE5Fu9.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-fNhnYl-G.js → collection-table-wrapper-BRK1q11U.js} +1 -1
- package/dist/client/assets/{collection-tabs-D0bfkNrY.js → collection-tabs-BtVgWqaS.js} +1 -1
- package/dist/client/assets/{command-Dt3t7o57.js → command-BaS-0Wfh.js} +1 -1
- package/dist/client/assets/{connect-DPEGql6L.js → connect-3VJmRE1h.js} +1 -1
- package/dist/client/assets/{connection-card-Cwh5xUmA.js → connection-card-B91SZISg.js} +1 -1
- package/dist/client/assets/{connection-detail-DgHwxZSJ.js → connection-detail-mo3MA2Xi.js} +1 -1
- package/dist/client/assets/{connections-D2AuzZXu.js → connections-CE3xmstM.js} +1 -1
- package/dist/client/assets/constants-Bg8UqzBy.js +1 -0
- package/dist/client/assets/{constants-8URKDp4Y.js → constants-DnuxEo5s.js} +1 -1
- package/dist/client/assets/{context-DHicyHl4.js → context-DKu_mHFC.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-Cb3EQpzl.js → create-organization-dialog-De0OX1Zl.js} +1 -1
- package/dist/client/assets/{create-project-dialog-BjqZAjhY.js → create-project-dialog-lv0TRMx_.js} +1 -1
- package/dist/client/assets/{deco-constants-CyaJG-D1.js → deco-constants-CTtPnJzR.js} +1 -1
- package/dist/client/assets/{dialog-DSPMVHyJ.js → dialog-BYwNnwwA.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CRT7qGQ9.js → dropdown-menu-usbHDlIZ.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-Dj3hkiA6.js → dynamic-plugin-layout-d2sr4Zos.js} +1 -1
- package/dist/client/assets/{empty-state-BA6UkF4p.js → empty-state-BmmycNCG.js} +1 -1
- package/dist/client/assets/{empty-state-sMx3NP6e.js → empty-state-D0ORcC9s.js} +1 -1
- package/dist/client/assets/{env-vars-editor-DuW-Il-b.js → env-vars-editor-CEsz7coi.js} +1 -1
- package/dist/client/assets/{error-boundary-lFjWy2-n.js → error-boundary-BLEw7xWo.js} +1 -1
- package/dist/client/assets/{extract-connection-data-B39uuFqG.js → extract-connection-data-BReoF993.js} +1 -1
- package/dist/client/assets/{file-browser-BIF8ssgw.js → file-browser-BwHr0_f-.js} +2 -2
- package/dist/client/assets/{form-BMtUcs2k.js → form-Cci_0GHL.js} +1 -1
- package/dist/client/assets/{grid-view-e1dnT7b5.js → grid-view-DxVImF1W.js} +1 -1
- package/dist/client/assets/{home-1A3rDo1n.js → home-EcK31mDl.js} +1 -1
- package/dist/client/assets/{index-CjGa0AXv.js → index-B9KDyGv1.js} +1 -1
- package/dist/client/assets/{index-QQ-XmLlG.js → index-CJPy6tkz.js} +1 -1
- package/dist/client/assets/{index-DnrfuViL.js → index-Cqq1nFO_.js} +1 -1
- package/dist/client/assets/{index-DmoBx0VC.js → index-CzbRSFGS.js} +1 -1
- package/dist/client/assets/{index-DwBgLSti.js → index-D52JGBSW.js} +24 -24
- package/dist/client/assets/{index-B_nMIrSY.js → index-DH9RHGRj.js} +1 -1
- package/dist/client/assets/{index-DJ_LDW-E.js → index-DMSLkGyV.js} +1 -1
- package/dist/client/assets/{index-CCjxSJ1y.js → index-TP7Ym6Gi.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-Yvt0ZTml.js → infiniteQueryObserver-DXqCWbrQ.js} +1 -1
- package/dist/client/assets/{input-B7id4I1j.js → input--zCus1rn.js} +1 -1
- package/dist/client/assets/{integration-icon-qV_BsBQR.js → integration-icon-B4lXAd2V.js} +1 -1
- package/dist/client/assets/{label-29qY4FPs.js → label-Dt9hwfoA.js} +1 -1
- package/dist/client/assets/{layout-Ck3H2-cu.js → layout-Desge4fu.js} +1 -1
- package/dist/client/assets/{localstorage-keys-Ct4C992S.js → localstorage-keys-DFOUclc3.js} +1 -1
- package/dist/client/assets/{login-DO8QasPa.js → login-ZxDL_xXY.js} +1 -1
- package/dist/client/assets/{markdown-jp5pFlBz.js → markdown-B_rkr1OY.js} +1 -1
- package/dist/client/assets/{mcp-oauth-Bb9gvF4o.js → mcp-oauth-g19aHl5R.js} +1 -1
- package/dist/client/assets/{mcp-server-card-D_Epc4aH.js → mcp-server-card-PYGzaKTV.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-Dut9IDFd.js → mcp-server-detail-sq3Zve-q.js} +2 -2
- package/dist/client/assets/{members-4s3A4PQH.js → members-Dko3OMBs.js} +1 -1
- package/dist/client/assets/{monitoring-gEkChCwS.js → monitoring-25vjnX5K.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-edit-DyFCcJjq.js → monitoring-dashboard-edit-APi27Lyy.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-view-Bc4tCiDF.js → monitoring-dashboard-view-BTgDG7Qr.js} +1 -1
- package/dist/client/assets/{oauth-callback-tz7MTdrq.js → oauth-callback-C2TJ9rrs.js} +1 -1
- package/dist/client/assets/{page-YrzfNFn-.js → page-BuCrRSmo.js} +1 -1
- package/dist/client/assets/{page-pkTyp5rB.js → page-C2P203ja.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-dEbxXjO6.js → plugin-empty-state-BiS9FDyZ.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-YsTdKC2B.js → plugin-empty-state-CJIaoSBt.js} +1 -1
- package/dist/client/assets/{plugin-header-Di-tZc0h.js → plugin-header-BMhkjONo.js} +1 -1
- package/dist/client/assets/{plugin-header-Djvd0-eL.js → plugin-header-Be_rW9BG.js} +1 -1
- package/dist/client/assets/{popover-pjzQQlLd.js → popover-C4pJDbzd.js} +1 -1
- package/dist/client/assets/project-layout-a9ZljoS8.js +1 -0
- package/dist/client/assets/{projects-list-DcozT0tR.js → projects-list-bxq1MrSm.js} +1 -1
- package/dist/client/assets/{ranking-layout-D3PvNfv7.js → ranking-layout-DEmm60_H.js} +1 -1
- package/dist/client/assets/{readme-viewer-BmO5RwRH.js → readme-viewer-5tvDeQHi.js} +1 -1
- package/dist/client/assets/{registry-layout-DEN2jHtD.js → registry-layout-CJhj9rcX.js} +1 -1
- package/dist/client/assets/{registry-utils-DMdc5PTp.js → registry-utils-DEhTjpqF.js} +1 -1
- package/dist/client/assets/{reports-layout-DziFQRp_.js → reports-layout-fQTBEwe0.js} +1 -1
- package/dist/client/assets/{reset-password-CrHLBBwi.js → reset-password-ez0ppaGq.js} +1 -1
- package/dist/client/assets/{resizable-jXkpfiVS.js → resizable-C26aI2AS.js} +1 -1
- package/dist/client/assets/{save-actions-BPg_8VMI.js → save-actions-Dv1nRyHY.js} +1 -1
- package/dist/client/assets/{scroll-area-CcejXaMp.js → scroll-area-DcJFHDMz.js} +1 -1
- package/dist/client/assets/{select-CkeKfTEx.js → select-DEG2HUsU.js} +1 -1
- package/dist/client/assets/shell-layout-BXZeCKqs.js +3 -0
- package/dist/client/assets/{skeleton-DNLZ4Kho.js → skeleton-_QoQu65Z.js} +1 -1
- package/dist/client/assets/{spinner-DZtD-MX0.js → spinner-CpcUYhT9.js} +1 -1
- package/dist/client/assets/{store-invite-B_jz8YSY.js → store-invite-BI-C3Ger.js} +1 -1
- package/dist/client/assets/{switch-DFKxfcc5.js → switch-Yifr4LYd.js} +1 -1
- package/dist/client/assets/{table-Csfk_VXo.js → table-BE49uKeW.js} +1 -1
- package/dist/client/assets/{tasks-Dv2Dq-cV.js → tasks-_TSvuWWo.js} +1 -1
- package/dist/client/assets/{textarea-GWXLFYfv.js → textarea-DGrDCMYg.js} +1 -1
- package/dist/client/assets/{time-range-picker-DnUGZRLa.js → time-range-picker-D-bxceyA.js} +1 -1
- package/dist/client/assets/{toggle-group-CojJ3wZ4.js → toggle-group-BDPgnYqc.js} +1 -1
- package/dist/client/assets/{tools-list-BPGP3JUO.js → tools-list-DmG41xlg.js} +1 -1
- package/dist/client/assets/{tooltip-D71dCz4E.js → tooltip-DJR7bz1l.js} +1 -1
- package/dist/client/assets/{topbar-portal-BKT0Es8i.js → topbar-portal-CoIDsv0w.js} +1 -1
- package/dist/client/assets/{typewriter-title-DqLjhGgL.js → typewriter-title-EJB9gire.js} +1 -1
- package/dist/client/assets/{use-binding-DbH4Xe03.js → use-binding-Cs2Y-PcQ.js} +1 -1
- package/dist/client/assets/{use-connection-BEGrPCmR.js → use-connection-Dj9QSNVL.js} +1 -1
- package/dist/client/assets/{use-copy-DsHlaDHD.js → use-copy-D7PzOc0z.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BzTARjrD.js → use-create-virtual-mcp-B-HizY93.js} +1 -1
- package/dist/client/assets/{use-deco-chat-open-CxG3qwlT.js → use-deco-chat-open-C86CtM_I.js} +1 -1
- package/dist/client/assets/{use-install-from-registry-CSDJ0ZgD.js → use-install-from-registry-C8e-6Etm.js} +1 -1
- package/dist/client/assets/{use-list-state-DvpdPuz-.js → use-list-state-CmfVe0Sz.js} +1 -1
- package/dist/client/assets/{use-llm-BbYG_RIr.js → use-llm-C_wGfF_N.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-qD8uHlkj.js → use-mcp-prompts-CFUruqMt.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BAsmCzEJ.js → use-mcp-tools-CjZtbvY1.js} +1 -1
- package/dist/client/assets/{use-mobile-Bs0AkxK7.js → use-mobile-DBGLvQCZ.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BJ9tNAL9.js → use-organization-settings-DFBQM6OB.js} +1 -1
- package/dist/client/assets/{use-project-CXHCn5kp.js → use-project-cfHYfzp_.js} +1 -1
- package/dist/client/assets/{use-settings-modal-Dx8IF1Gs.js → use-settings-modal-D3XdLMRO.js} +1 -1
- package/dist/client/assets/{use-view-mode-DMPiUC22.js → use-view-mode-DyCv_xrc.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DBzFAk7J.js → use-virtual-mcp-ctHrpgTx.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BSv9hDZn.js +1 -0
- package/dist/client/assets/{useMutation-DgG1LVg-.js → useMutation-B8qgpkUA.js} +1 -1
- package/dist/client/assets/useQuery--0jbogka.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-DU-5JWKq.js +1 -0
- package/dist/client/assets/{view-mode-toggle-2-qyK3LU.js → view-mode-toggle-DnPBouL3.js} +1 -1
- package/dist/client/assets/{workflow-YppA7Sxi.js → workflow-Dfnb1_XD.js} +1 -1
- package/dist/client/index.html +1 -1
- package/package.json +1 -1
- package/dist/client/assets/constants-oXq_cTdm.js +0 -1
- package/dist/client/assets/project-layout-Bp5s1iI1.js +0 -1
- package/dist/client/assets/shell-layout-C4PQ301W.js +0 -3
- package/dist/client/assets/useInfiniteQuery-DXQ7BtjQ.js +0 -1
- package/dist/client/assets/useQuery-CPsXfVfR.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CuH1Eku2.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aV as l,aW as p,aX as n,aY as d,aZ as h,m as b,r as o,a_ as m,a$ as f}from"./index-
|
|
1
|
+
import{aV as l,aW as p,aX as n,aY as d,aZ as h,m as b,r as o,a_ as m,a$ as f}from"./index-D52JGBSW.js";var v=class extends l{#s;#i=void 0;#t;#e;constructor(t,s){super(),this.#s=t,this.setOptions(s),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const s=this.options;this.options=this.#s.defaultMutationOptions(t),p(this.options,s)||this.#s.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#t,observer:this}),s?.mutationKey&&this.options.mutationKey&&n(s.mutationKey)!==n(this.options.mutationKey)?this.reset():this.#t?.state.status==="pending"&&this.#t.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#t?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#o(t)}getCurrentResult(){return this.#i}reset(){this.#t?.removeObserver(this),this.#t=void 0,this.#r(),this.#o()}mutate(t,s){return this.#e=s,this.#t?.removeObserver(this),this.#t=this.#s.getMutationCache().build(this.#s,this.options),this.#t.addObserver(this),this.#t.execute(t)}#r(){const t=this.#t?.state??d();this.#i={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){h.batch(()=>{if(this.#e&&this.hasListeners()){const s=this.#i.variables,i=this.#i.context,e={client:this.#s,meta:this.options.meta,mutationKey:this.options.mutationKey};t?.type==="success"?(this.#e.onSuccess?.(t.data,s,i,e),this.#e.onSettled?.(t.data,null,s,i,e)):t?.type==="error"&&(this.#e.onError?.(t.error,s,i,e),this.#e.onSettled?.(void 0,t.error,s,i,e))}this.listeners.forEach(s=>{s(this.#i)})})}};function O(t,s){const i=b(s),[e]=o.useState(()=>new v(i,t));o.useEffect(()=>{e.setOptions(t)},[e,t]);const r=o.useSyncExternalStore(o.useCallback(a=>e.subscribe(h.batchCalls(a)),[e]),()=>e.getCurrentResult(),()=>e.getCurrentResult()),u=o.useCallback((a,c)=>{e.mutate(a,c).catch(m)},[e]);if(r.error&&f(e.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:u,mutateAsync:r.mutate}}export{O as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{z as u,a8 as s}from"./index-D52JGBSW.js";function o(e,r){return u(e,s,r)}export{o as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as s}from"./infiniteQueryObserver-DXqCWbrQ.js";import{z as u,B as n}from"./index-D52JGBSW.js";function a(r,e){return u({...r,enabled:!0,suspense:!0,throwOnError:n},s,e)}export{a as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as Y,r as V,j as i}from"./index-
|
|
1
|
+
import{c as Y,r as V,j as i}from"./index-D52JGBSW.js";import{c as n}from"./button-Bh5FwGIY.js";const Z={sm:{button:"size-7",icon:"size-4"},md:{button:"size-9",icon:"size-5"},lg:{button:"size-12",icon:"size-6"}};function oe(J){const e=Y.c(66),{value:o,onValueChange:l,options:t,size:D,fullWidth:F,className:W}=J,K=D===void 0?"sm":D,w=F===void 0?!1:F,G=V.useRef(null),H=V.useRef(null);let R;e[0]===Symbol.for("react.memo_cache_sentinel")?(R={left:0,width:0,opacity:0},e[0]=R):R=e[0];const[N,O]=V.useState(R);let _;e[1]===Symbol.for("react.memo_cache_sentinel")?(_=S=>{if(!S.current)return;const{offsetLeft:U,offsetWidth:X}=S.current;O({left:U,width:X,opacity:1})},e[1]=_):_=e[1];const Q=_;let C;e[2]!==t[0].value||e[3]!==o?(C=()=>{const S=o===t[0].value?G:H;Q(S)},e[2]=t[0].value,e[3]=o,e[4]=C):C=e[4];let E;e[5]!==t||e[6]!==o?(E=[o,t],e[5]=t,e[6]=o,e[7]=E):E=e[7],V.useEffect(C,E);const s=Z[K];let a;e[8]!==W?(a=n("relative flex gap-0 bg-muted rounded-lg",W),e[8]=W,e[9]=a):a=e[9];let c;e[10]!==l||e[11]!==t[0].value?(c=()=>l(t[0].value),e[10]=l,e[11]=t[0].value,e[12]=c):c=e[12];const $=w?"flex-1 h-12 px-4":s.button,I=!w&&t[0].label?"px-3":"";let r;e[13]!==I||e[14]!==$?(r=n("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",$,I),e[13]=I,e[14]=$,e[15]=r):r=e[15];const P=o===t[0].value?"text-foreground":"text-muted-foreground";let u;e[16]!==s.icon||e[17]!==P?(u=n("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",s.icon,P),e[16]=s.icon,e[17]=P,e[18]=u):u=e[18];let f;e[19]!==t[0].icon||e[20]!==u?(f=i.jsx("span",{className:u,children:t[0].icon}),e[19]=t[0].icon,e[20]=u,e[21]=f):f=e[21];let d;e[22]!==t[0].label||e[23]!==t[0].value||e[24]!==o?(d=t[0].label&&i.jsx("span",{className:n("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[0].value?"text-foreground":"text-muted-foreground"),children:t[0].label}),e[22]=t[0].label,e[23]=t[0].value,e[24]=o,e[25]=d):d=e[25];let m;e[26]!==r||e[27]!==f||e[28]!==d||e[29]!==c?(m=i.jsxs("button",{ref:G,type:"button",onClick:c,className:r,children:[f,d]}),e[26]=r,e[27]=f,e[28]=d,e[29]=c,e[30]=m):m=e[30];let x;e[31]!==l||e[32]!==t[1].value?(x=()=>l(t[1].value),e[31]=l,e[32]=t[1].value,e[33]=x):x=e[33];const L=w?"flex-1 h-12 px-4":s.button,M=!w&&t[1].label?"px-3":"";let p;e[34]!==L||e[35]!==M?(p=n("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",L,M),e[34]=L,e[35]=M,e[36]=p):p=e[36];const T=o===t[1].value?"text-foreground":"text-muted-foreground";let b;e[37]!==s.icon||e[38]!==T?(b=n("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",s.icon,T),e[37]=s.icon,e[38]=T,e[39]=b):b=e[39];let v;e[40]!==t[1].icon||e[41]!==b?(v=i.jsx("span",{className:b,children:t[1].icon}),e[40]=t[1].icon,e[41]=b,e[42]=v):v=e[42];let g;e[43]!==t[1].label||e[44]!==t[1].value||e[45]!==o?(g=t[1].label&&i.jsx("span",{className:n("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[1].value?"text-foreground":"text-muted-foreground"),children:t[1].label}),e[43]=t[1].label,e[44]=t[1].value,e[45]=o,e[46]=g):g=e[46];let h;e[47]!==x||e[48]!==p||e[49]!==v||e[50]!==g?(h=i.jsxs("button",{ref:H,type:"button",onClick:x,className:p,children:[v,g]}),e[47]=x,e[48]=p,e[49]=v,e[50]=g,e[51]=h):h=e[51];const q=w?"h-12":s.button;let y;e[52]!==q?(y=n("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",q),e[52]=q,e[53]=y):y=e[53];const A=`${N.left}px`,B=`${N.width}px`;let j;e[54]!==N.opacity||e[55]!==A||e[56]!==B?(j={left:A,width:B,opacity:N.opacity},e[54]=N.opacity,e[55]=A,e[56]=B,e[57]=j):j=e[57];let z;e[58]!==y||e[59]!==j?(z=i.jsx("div",{className:y,style:j}),e[58]=y,e[59]=j,e[60]=z):z=e[60];let k;return e[61]!==m||e[62]!==h||e[63]!==z||e[64]!==a?(k=i.jsxs("div",{className:a,children:[m,h,z]}),e[61]=m,e[62]=h,e[63]=z,e[64]=a,e[65]=k):k=e[65],k}export{oe as V};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as N,u as w,d as q,b as G,j as t,O as B,c as L,aE as Q,m as J,K as W,t as A}from"./index-
|
|
1
|
+
import{r as N,u as w,d as q,b as G,j as t,O as B,c as L,aE as Q,m as J,K as W,t as A}from"./index-D52JGBSW.js";import{a as Z,u as V,e as Y}from"./constants-DnuxEo5s.js";import{C as X}from"./collection-tab-DFeE5Fu9.js";import{g as ee,h as te}from"./use-connection-Dj9QSNVL.js";import{B as I}from"./button-Bh5FwGIY.js";import{E as R}from"./empty-state-D0ORcC9s.js";import{E as ne}from"./error-boundary-BLEw7xWo.js";import{P as x}from"./index-DH9RHGRj.js";import{B as F,a as M,b as z,c as T}from"./breadcrumb-DNLwlIVn.js";import{a as se,b as ie}from"./use-binding-Cs2Y-PcQ.js";import{i as oe}from"./AlertTriangle-4A_giHV7.js";import{i as le}from"./Loading01-C_dZ70Y_.js";import{s as re}from"./RefreshCcw01-aEpj51K0.js";import{u as ae}from"./useMutation-B8qgpkUA.js";import{e as ce}from"./Dataflow03-CGMAE4CD.js";import"./generate-id-Dyweu44Y.js";import"./collection-table-wrapper-BRK1q11U.js";import"./dropdown-menu-usbHDlIZ.js";import"./Check-DX81M4UN.js";import"./ChevronRight-DY1xiCUb.js";import"./ArrowDown-BCC90_2r.js";import"./ArrowUp-095f00XC.js";import"./Grid01-D-UJvJ4U.js";import"./List-ChBrkSt3.js";import"./tooltip-DJR7bz1l.js";import"./view-mode-toggle-DnPBouL3.js";import"./table-BE49uKeW.js";import"./collection-search-By6ZMwtA.js";import"./SearchMd-C2TJxhWh.js";import"./input--zCus1rn.js";import"./card-CQpD36Cd.js";import"./integration-icon-B4lXAd2V.js";import"./Container-adXBBWtI.js";import"./Copy01-y1kUbB69.js";import"./DotsVertical-fI7whvq1.js";import"./Edit01-DV7i6b_1.js";import"./Eye-0EEXzuIs.js";import"./Trash01-DGNEPK6E.js";import"./empty-state-BmmycNCG.js";import"./Inbox01-A36zOoLA.js";import"./use-list-state-CmfVe0Sz.js";import"./avatar-CLwmO-iu.js";import"./useQuery--0jbogka.js";import"./use-view-mode-DyCv_xrc.js";import"./use-mobile-DBGLvQCZ.js";import"./constants-Bg8UqzBy.js";import"./alert-dialog-CqcaYkiJ.js";import"./Plus-Cqqd1qB7.js";import"./layout-Desge4fu.js";import"./binder-BnqkDZhr.js";const U=({size:n=24,color:e="currentColor",...i})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},N.createElement("path",{d:"m9.395 19.371.585 1.315a2.212 2.212 0 0 0 4.044 0l.584-1.315a2.426 2.426 0 0 1 2.47-1.423l1.43.152a2.212 2.212 0 0 0 2.023-3.502l-.847-1.164a2.428 2.428 0 0 1-.46-1.434c0-.513.163-1.014.464-1.429l.847-1.163a2.211 2.211 0 0 0-2.022-3.502l-1.43.152a2.433 2.433 0 0 1-1.47-.312 2.426 2.426 0 0 1-1-1.117l-.589-1.315a2.212 2.212 0 0 0-4.044 0L9.395 4.63c-.207.468-.557.86-1 1.117-.445.256-.96.365-1.47.312l-1.434-.152a2.212 2.212 0 0 0-2.023 3.502l.847 1.163a2.43 2.43 0 0 1 0 2.858l-.847 1.163a2.21 2.21 0 0 0 .786 3.273c.382.195.811.274 1.237.23l1.43-.153a2.434 2.434 0 0 1 2.474 1.43Z"}),N.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}));U.displayName="Settings02";function de({title:n,description:e,wellKnownMcp:i,imageSrc:a,onConnected:o}){const c=ee(),{org:{slug:s}}=w(),{data:r}=q.useSession(),d=G(),[m,p]=N.useState(!1),l=async()=>{if(!(!i||!r?.user?.id)){p(!0);try{const f=await c.create.mutateAsync(i);o?.(f.id),d({to:"/$org/$project/mcps/$connectionId",params:{org:s,project:B,connectionId:f.id}})}finally{p(!1)}}},u=()=>{d({to:"/$org/$project/mcps",params:{org:s,project:B},search:{action:"create"}})};return t.jsx(R,{image:a?t.jsx("img",{src:a,alt:n,width:336,height:320,className:"max-w-full h-auto"}):null,title:n,description:e,actions:t.jsxs(t.Fragment,{children:[t.jsxs(I,{variant:"outline",onClick:l,disabled:m||!i,children:[i?.icon&&t.jsx("img",{src:i.icon,alt:"",className:"size-4"}),m?"Installing...":`Install ${i?.title||"MCP"}`]}),t.jsx(I,{variant:"outline",onClick:u,children:"Custom Connection"})]})})}function me(n){const e=L.c(35),{bindingName:i,collectionName:a,title:o,emptyState:c,wellKnownMcp:s}=n,{org:r}=w(),d=te();let m;e[0]!==d||e[1]!==i?(m={connections:d,binding:i},e[0]=d,e[1]=i,e[2]=m):m=e[2];const l=se(m)[0],u=ie(l);let f;if(e[3]!==a||e[4]!==u){let g;e[6]!==a?(g=$=>$.name.toLowerCase()===a.toLowerCase(),e[6]=a,e[7]=g):g=e[7],f=u.find(g),e[3]=a,e[4]=u,e[5]=f}else f=e[5];const S=f,[D,H]=N.useState(null),_=l&&S&&(l.id||D);let h;e[8]!==o?(h=t.jsx(x.Header,{children:t.jsx(x.Header.Left,{children:t.jsx(F,{children:t.jsx(M,{children:t.jsx(z,{children:t.jsx(T,{children:o})})})})})}),e[8]=o,e[9]=h):h=e[9];let j;e[10]!==l||e[11]!==r||e[12]!==o?(j=g=>{const{error:$,resetError:K}=g;return t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(oe,{className:"h-6 w-6 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs("h3",{className:"text-lg font-medium",children:["Failed to load ",o.toLowerCase()]}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:$?.message||"Unable to connect to the server. Please check that it is running and accessible."})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs(I,{variant:"outline",onClick:K,children:[t.jsx(re,{className:"size-4"}),"Try again"]}),l&&t.jsx(I,{variant:"outline",asChild:!0,children:t.jsxs(Q,{to:"/$org/$project/mcps/$connectionId",params:{org:r.slug,project:B,connectionId:l.id},search:{tab:"settings"},children:[t.jsx(U,{className:"size-4"}),"Connection Settings"]})})]})]})},e[10]=l,e[11]=r,e[12]=o,e[13]=j):j=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(le,{size:32,className:"animate-spin text-muted-foreground mb-4"}),e[14]=k):k=e[14];let b;e[15]!==o?(b=o.toLowerCase(),e[15]=o,e[16]=b):b=e[16];let C;e[17]!==b?(C=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[k,t.jsxs("p",{className:"text-sm text-muted-foreground",children:["Loading ",b,"..."]})]}),e[17]=b,e[18]=C):C=e[18];let y;e[19]!==S||e[20]!==l||e[21]!==c||e[22]!==r||e[23]!==_||e[24]!==s?(y=_?t.jsx(X,{connectionId:l.id,org:r.slug,activeCollection:S}):t.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:t.jsx(de,{title:c.title,description:c.description,wellKnownMcp:s,imageSrc:c.imageSrc,onConnected:g=>{H(g)}})}),e[19]=S,e[20]=l,e[21]=c,e[22]=r,e[23]=_,e[24]=s,e[25]=y):y=e[25];let P;e[26]!==C||e[27]!==y?(P=t.jsx(N.Suspense,{fallback:C,children:y}),e[26]=C,e[27]=y,e[28]=P):P=e[28];let E;e[29]!==j||e[30]!==P?(E=t.jsx(x.Content,{children:t.jsx(ne,{fallback:j,children:P})}),e[29]=j,e[30]=P,e[31]=E):E=e[31];let v;return e[32]!==E||e[33]!==h?(v=t.jsxs(x,{children:[h,E]}),e[32]=E,e[33]=h,e[34]=v):v=e[34],v}function ue(){const n=L.c(12),{org:e,project:i}=w(),a=J();let o;n[0]!==e.id?(o={connectionId:Z,orgId:e.id},n[0]=e.id,n[1]=o):o=n[1];const c=V(o);let s;n[2]!==c||n[3]!==i?(s=async p=>{const l=i.enabledPlugins??[];if(l.includes(p))return;const u=[...l,p],f=await c.callTool({name:"PROJECT_UPDATE",arguments:{projectId:i.id,enabledPlugins:u}});return f.structuredContent??f},n[2]=c,n[3]=i,n[4]=s):s=n[4];let r;n[5]!==e.id||n[6]!==i||n[7]!==a?(r=()=>{a.invalidateQueries({queryKey:W.project(e.id,i.slug)}),a.invalidateQueries({queryKey:W.projects(e.id)})},n[5]=e.id,n[6]=i,n[7]=a,n[8]=r):r=n[8];let d;return n[9]!==s||n[10]!==r?(d={mutationFn:s,onSuccess:r,onError:pe},n[9]=s,n[10]=r,n[11]=d):d=n[11],ae(d)}function pe(n){A.error("Failed to enable plugin: "+(n instanceof Error?n.message:"Unknown error"))}function fe(n){const e=L.c(12),{pluginId:i,title:a,description:o,icon:c}=n,s=ue();let r;e[0]!==s||e[1]!==i?(r=async()=>{try{await s.mutateAsync(i),A.success("Plugin enabled!")}catch{}},e[0]=s,e[1]=i,e[2]=r):r=e[2];const d=r,m=c??null,p=s.isPending?"Enabling…":"Enable plugin";let l;e[3]!==s.isPending||e[4]!==d||e[5]!==p?(l=t.jsx(I,{onClick:d,disabled:s.isPending,children:p}),e[3]=s.isPending,e[4]=d,e[5]=p,e[6]=l):l=e[6];let u;return e[7]!==o||e[8]!==m||e[9]!==l||e[10]!==a?(u=t.jsx(R,{image:m,title:a,description:o,actions:l}),e[7]=o,e[8]=m,e[9]=l,e[10]=a,e[11]=u):u=e[11],u}const O="workflows";function mt(){const n=L.c(3),{project:e}=w();if(!(e.enabledPlugins??[]).includes(O)){let c;n[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(x.Header,{children:t.jsx(x.Header.Left,{children:t.jsx(F,{children:t.jsx(M,{children:t.jsx(z,{children:t.jsx(T,{children:"Workflows"})})})})})}),n[0]=c):c=n[0];let s;return n[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs(x,{children:[c,t.jsx(x.Content,{children:t.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:t.jsx(fe,{pluginId:O,title:"Enable Workflows",description:"Automate multi-step processes by enabling the Workflows plugin. Once enabled you can create, run, and monitor workflows.",icon:t.jsx("div",{className:"bg-muted p-4 rounded-full",children:t.jsx(ce,{className:"size-8 text-muted-foreground"})})})})})]}),n[1]=s):s=n[1],s}let o;return n[2]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(me,{bindingName:"WORKFLOW",collectionName:"workflow",title:"Workflows",emptyState:{title:"Create Workflows",description:"Run durable MCP tool calls in background."},wellKnownMcp:Y()}),n[2]=o):o=n[2],o}export{mt as default};
|
package/dist/client/index.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<title>MCP Mesh</title>
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
6
|
-
<script type="module" crossorigin src="/assets/index-
|
|
6
|
+
<script type="module" crossorigin src="/assets/index-D52JGBSW.js"></script>
|
|
7
7
|
<link rel="stylesheet" crossorigin href="/assets/index-BMDGI420.css">
|
|
8
8
|
</head>
|
|
9
9
|
<body>
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{D as t,E as a}from"./index-DwBgLSti.js";const e=t(a,{target:"draft-7"});export{e as B};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as v,c as L,d as et,j as i,u as X,O as ee,t as V,H as zr,o as Lt,s as be,b as $e,m as Fe,l as $t,k as Ft,K as Q,aF as Ge,bG as Lr,b1 as ne,P as Mt,S as Ye,e as $r,aD as Fr}from"./index-DwBgLSti.js";import{u as Mr,a as Bt}from"./use-project-CXHCn5kp.js";import{c as ie,B as Y}from"./button-D6YZfFzy.js";import{a as Rt,b as Br,c as Rr,d as Wr,D as Wt}from"./dialog-DSPMVHyJ.js";import{a as Gr,b as Ur,c as Kr,T as qr,i as Gt}from"./tooltip-D71dCz4E.js";import{u as tt,S as re}from"./skeleton-DNLZ4Kho.js";import{p as Ut,a as mt,t as Yr,u as Hr}from"./use-settings-modal-Dx8IF1Gs.js";import{A as Kt}from"./avatar-BNKSN34R.js";import{a as rt,i as Vr}from"./deco-constants-CyaJG-D1.js";import{t as qt}from"./Settings01-DKXbh8uh.js";import{i as Xr}from"./Check-Bv0pZ3gl.js";import{a as Qr}from"./Copy01-Dq7Edhtu.js";import{S as _e}from"./switch-DFKxfcc5.js";import{S as Yt,a as Ht,d as Ae,c as Vt,b as Jr}from"./select-CkeKfTEx.js";import{i as Zr}from"./Code01-DP2jwP0n.js";import{i as en}from"./Shield01-B89AcbSX.js";import{n as tn}from"./CheckDone01-BrxNvWbF.js";import{u as Me}from"./useMutation-DgG1LVg-.js";import{a as Xt,F as je,b as le,c as oe,d as ce,f as ke,e as He}from"./form-BMtUcs2k.js";import{I as ae}from"./input-B7id4I1j.js";import{i as rn}from"./Upload01-gcuuVZ2S.js";import{a as nt,u as Se}from"./constants-8URKDp4Y.js";import{T as nn}from"./textarea-GWXLFYfv.js";import{c as an,h as sn,d as ln,b as on,A as cn,e as dn,g as un,a as mn,f as fn}from"./alert-dialog-BvNipqK_.js";import{u as hn}from"./useQuery-CPsXfVfR.js";import{L as Oe}from"./label-29qY4FPs.js";import{n as xn}from"./Container-jfv9L6Hc.js";import{h as Qt}from"./use-connection-BEGrPCmR.js";import{a as pn,c as gn}from"./use-binding-DbH4Xe03.js";import{u as vn}from"./use-install-from-registry-CSDJ0ZgD.js";import{i as yn}from"./Loading01-BHMOj-H5.js";import{s as Jt}from"./Plus-DNqvDLOK.js";import{i as q,G as Zt,g as Ue,m as bn,D as Be,r as we,Z as Re,L as me,s as Ne,C as jn,a as kn,b as er,c as Sn,d as wn,T as Nn,u as Pn,e as Cn,f as An,h as Ie,j as H,k as ft,l as ht,n as tr,o as rr,p as We,q as it,t as _n,v as On,w as nr,x as at,y as st,z as ir,A as En,B as ar,E as xt,F as In,H as Dn,I as sr,R as Tn,S as zn,J as Ln,K as $n,M as lr,N as Fn,O as Mn,P as Bn,Q as Rn,U as Wn,V as Gn,W as Un,X as Kn,Y as qn,_ as pt,$ as gt,a0 as vt,a1 as Yn,a2 as lt,a3 as Hn,a4 as ve,a5 as Vn,a6 as Xn,a7 as Qn,a8 as Jn,a9 as Zn,aa as Ke,ab as ei,ac as Te,ad as W,ae as ot,af as ti,ag as ri,ah as ni,ai as or,aj as cr,ak as ii,al as ai,am as si,an as dr,ao as G,ap as li,aq as oi,ar as ci,as as di,at as ui,au as mi,av as fi,aw as hi,ax as xi,ay as pi,az as gi,aA as vi,aB as yi}from"./chart--8-symKO.js";import{B as ur}from"./badge-Do8iK9u9.js";import{i as bi}from"./AlertCircle-BzYW4X7z.js";import{b as ji,a as mr}from"./use-mcp-tools-BAsmCzEJ.js";import"./localstorage-keys-Ct4C992S.js";import"./ChevronDown-CggIFEVQ.js";import"./binder-BBB8LQyx.js";import"./extract-connection-data-B39uuFqG.js";import"./constants-oXq_cTdm.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-DMdc5PTp.js";import"./generate-id-Dyweu44Y.js";import"./index-DJ_LDW-E.js";const fr=({size:t=24,color:e="currentColor",...r})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},v.createElement("path",{d:"M10 2v4.66c0 .218 0 .326-.033.413a.47.47 0 0 1-.138.198c-.07.06-.183.102-.409.185a7.5 7.5 0 1 0 5.16 0c-.226-.083-.339-.125-.409-.185a.469.469 0 0 1-.138-.198C14 6.986 14 6.878 14 6.66V2M8.5 2h7"}));fr.displayName="Beaker01";const hr=({size:t=24,color:e="currentColor",...r})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},v.createElement("path",{d:"M9.354 21c.705.622 1.632 1 2.646 1s1.94-.378 2.646-1M18 8A6 6 0 1 0 6 8c0 3.09-.78 5.206-1.65 6.605-.735 1.18-1.102 1.771-1.089 1.936.015.182.054.252.2.36.133.099.732.099 1.928.099H18.61c1.196 0 1.795 0 1.927-.098.147-.11.186-.179.2-.361.014-.165-.353-.755-1.088-1.936C18.78 13.206 18 11.09 18 8Z"}));hr.displayName="Bell01";const ct=({size:t=24,color:e="currentColor",...r})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},v.createElement("path",{d:"M13 2 4.093 12.688c-.348.418-.523.628-.525.804a.5.5 0 0 0 .185.397c.138.111.41.111.955.111H12l-1 8 8.907-10.688c.348-.418.523-.628.525-.804a.5.5 0 0 0-.185-.397c-.138-.111-.41-.111-.955-.111H12l1-8Z"}));ct.displayName="Zap";const ki=[{key:"general",label:"General",icon:i.jsx(qt,{size:14})},{key:"plugins",label:"Plugins",icon:i.jsx(ct,{size:14})}];function Si(t){const e=L.c(14),{activeSection:r,onNavigate:n}=t,{org:s}=X();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={suspense:!0},e[0]=a):a=e[0];const{data:l}=Mr(s.id,a);let o;e[1]!==r?(o=Ut(r),e[1]=r,e[2]=o):o=e[2];const u=o;let d;if(e[3]!==u?.slug||e[4]!==r||e[5]!==n||e[6]!==l){let f;e[8]!==u?.slug||e[9]!==r||e[10]!==n?(f=m=>{const x=u?.slug===m.slug;return i.jsxs("div",{className:"flex flex-col gap-0.5",children:[i.jsxs("button",{type:"button",onClick:()=>n(mt(m.slug,"general")),className:ie("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",x?"text-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[i.jsx("div",{className:"size-4 shrink-0 rounded-[3px] flex items-center justify-center overflow-hidden border border-border/50",style:{backgroundColor:m.ui?.themeColor??"#60a5fa"},children:m.ui?.icon?i.jsx("img",{src:m.ui.icon,alt:"",className:"size-full object-cover"}):i.jsx("span",{className:"text-[8px] font-semibold text-white leading-none",children:(m.name??m.slug).charAt(0).toUpperCase()})}),i.jsx("span",{className:"truncate",children:m.name??m.slug})]}),x&&i.jsx("div",{className:"ml-3 flex flex-col gap-0.5 border-l border-border pl-2.5",children:ki.map(h=>{const g=mt(m.slug,h.key);return i.jsxs("button",{type:"button",onClick:()=>n(g),className:ie("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",r===g?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[i.jsx("span",{className:"shrink-0",children:h.icon}),i.jsx("span",{className:"truncate",children:h.label})]},h.key)})})]},m.slug)},e[8]=u?.slug,e[9]=r,e[10]=n,e[11]=f):f=e[11],d=(l??[]).filter(wi).map(f),e[3]=u?.slug,e[4]=r,e[5]=n,e[6]=l,e[7]=d}else d=e[7];let c;return e[12]!==d?(c=i.jsx(i.Fragment,{children:d}),e[12]=d,e[13]=c):c=e[13],c}function wi(t){return t.slug!==ee}function Ni(t){const e=L.c(30),{activeSection:r,onNavigate:n}=t,{data:s}=et.useSession(),[a]=tt(),l=s?.user,o=l?.image,u=l?.name??"Profile",d=l?.name??"U";let c;e[0]!==d||e[1]!==o?(c=i.jsx(Kt,{url:o,fallback:d,shape:"circle",size:"2xs",className:"size-4 shrink-0"}),e[0]=d,e[1]=o,e[2]=c):c=e[2];let f;e[3]!==u||e[4]!==c?(f={key:"account.profile",label:u,icon:c},e[3]=u,e[4]=c,e[5]=f):f=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m={key:"account.preferences",label:"Preferences",icon:i.jsx(qt,{size:14})},e[6]=m):m=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x={key:"account.experimental",label:"Experimental",icon:i.jsx(fr,{size:14})},e[7]=x):x=e[7];let h;e[8]!==f?(h=[f,m,x],e[8]=f,e[9]=h):h=e[9];const g=h;let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y={key:"org.general",label:"General",icon:i.jsx(Yr,{size:14})},e[10]=y):y=e[10];let S;e[11]===Symbol.for("react.memo_cache_sentinel")?(S={key:"org.plugins",label:"Plugins",icon:i.jsx(ct,{size:14})},e[11]=S):S=e[11];let w;e[12]===Symbol.for("react.memo_cache_sentinel")?(w=[y,S,{key:"org.billing",label:"Billing",icon:i.jsx(rt,{size:14})}],e[12]=w):w=e[12];const P=w;let j;e[13]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Account"}),e[13]=j):j=e[13];let p;e[14]!==g||e[15]!==r||e[16]!==n?(p=i.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[j,g.map(A=>i.jsxs("button",{type:"button",onClick:()=>n(A.key),className:ie("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",r===A.key?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[i.jsx("span",{className:"shrink-0",children:A.icon}),i.jsx("span",{className:"truncate",children:A.label})]},A.key))]}),e[14]=g,e[15]=r,e[16]=n,e[17]=p):p=e[17];let b;e[18]===Symbol.for("react.memo_cache_sentinel")?(b=i.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Organization"}),e[18]=b):b=e[18];let k;e[19]!==r||e[20]!==n?(k=i.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[b,P.map(A=>i.jsxs("button",{type:"button",onClick:()=>n(A.key),className:ie("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",r===A.key?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[i.jsx("span",{className:"shrink-0",children:A.icon}),i.jsx("span",{className:"truncate",children:A.label})]},A.key))]}),e[19]=r,e[20]=n,e[21]=k):k=e[21];let N;e[22]!==r||e[23]!==n||e[24]!==a.experimental_projects?(N=a.experimental_projects&&i.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[i.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Projects"}),i.jsx(v.Suspense,{fallback:i.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground/50",children:"Loading…"}),children:i.jsx(Si,{activeSection:r,onNavigate:n})})]}),e[22]=r,e[23]=n,e[24]=a.experimental_projects,e[25]=N):N=e[25];let C;return e[26]!==p||e[27]!==k||e[28]!==N?(C=i.jsxs("div",{className:"w-52 shrink-0 border-r border-border bg-sidebar/50 overflow-y-auto py-3 flex flex-col gap-4",children:[p,k,N]}),e[26]=p,e[27]=k,e[28]=N,e[29]=C):C=e[29],C}function Pi(){const t=L.c(32),{data:e}=et.useSession(),[r,n]=v.useState(!1),s=e?.user,a=s?.image;let l;t[0]!==s?(l=()=>{s?.id&&navigator.clipboard.writeText(s.id).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)})},t[0]=s,t[1]=l):l=t[1];const o=l;let u;t[2]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx("div",{children:i.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Profile"})}),t[2]=u):u=t[2];const d=s?.name??"U";let c;t[3]!==d||t[4]!==a?(c=i.jsx(Kt,{url:a,fallback:d,shape:"circle",size:"xl",className:"size-16 shrink-0"}),t[3]=d,t[4]=a,t[5]=c):c=t[5];const f=s?.name??"User";let m;t[6]!==f?(m=i.jsx("span",{className:"text-sm font-semibold text-foreground truncate",children:f}),t[6]=f,t[7]=m):m=t[7];const x=s?.email;let h;t[8]!==x?(h=i.jsx("span",{className:"text-sm text-muted-foreground truncate",children:x}),t[8]=x,t[9]=h):h=t[9];let g;t[10]!==m||t[11]!==h?(g=i.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[m,h]}),t[10]=m,t[11]=h,t[12]=g):g=t[12];let y;t[13]!==c||t[14]!==g?(y=i.jsxs("div",{className:"flex items-center gap-4",children:[c,g]}),t[13]=c,t[14]=g,t[15]=y):y=t[15];let S;t[16]===Symbol.for("react.memo_cache_sentinel")?(S=i.jsx("p",{className:"py-4 text-base font-semibold text-foreground border-b border-border",children:"User ID"}),t[16]=S):S=t[16];let w;t[17]===Symbol.for("react.memo_cache_sentinel")?(w=i.jsx("p",{className:"text-sm text-muted-foreground",children:"User ID"}),t[17]=w):w=t[17];const P=s?.id;let j;t[18]!==P?(j=i.jsx("span",{className:"font-mono text-sm",children:P}),t[18]=P,t[19]=j):j=t[19];let p;t[20]!==r?(p=r?i.jsx(Xr,{size:14,className:"text-green-600 shrink-0"}):i.jsx(Qr,{size:14,className:"shrink-0 opacity-70 group-hover:opacity-100 transition-opacity"}),t[20]=r,t[21]=p):p=t[21];let b;t[22]!==o||t[23]!==j||t[24]!==p?(b=i.jsx(Gr,{asChild:!0,children:i.jsxs("button",{type:"button",onClick:o,className:"group flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors",children:[j,p]})}),t[22]=o,t[23]=j,t[24]=p,t[25]=b):b=t[25];let k;t[26]===Symbol.for("react.memo_cache_sentinel")?(k=i.jsx(Ur,{side:"left",children:i.jsx("p",{className:"text-xs",children:"Copy user ID"})}),t[26]=k):k=t[26];let N;t[27]!==b?(N=i.jsxs("div",{className:"flex flex-col",children:[S,i.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[w,i.jsx(Kr,{children:i.jsxs(qr,{children:[b,k]})})]})]}),t[27]=b,t[28]=N):N=t[28];let C;return t[29]!==N||t[30]!==y?(C=i.jsxs("div",{className:"flex flex-col gap-8",children:[u,y,N]}),t[29]=N,t[30]=y,t[31]=C):C=t[31],C}function qe(t){const e=L.c(27),{icon:r,label:n,description:s,control:a,onClick:l,disabled:o}=t,u=o?void 0:l,d=l?"button":void 0,c=l&&!o?0:void 0;let f;e[0]!==o||e[1]!==l?(f=l&&!o?p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),l())}:void 0,e[0]=o,e[1]=l,e[2]=f):f=e[2];const m=l&&!o?"pointer":void 0;let x;e[3]!==m?(x={cursor:m},e[3]=m,e[4]=x):x=e[4];let h;e[5]!==r?(h=i.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0",children:r}),e[5]=r,e[6]=h):h=e[6];let g;e[7]!==n?(g=i.jsx("p",{className:"text-sm font-medium text-foreground",children:n}),e[7]=n,e[8]=g):g=e[8];let y;e[9]!==s?(y=i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:s}),e[9]=s,e[10]=y):y=e[10];let S;e[11]!==g||e[12]!==y?(S=i.jsxs("div",{className:"min-w-0",children:[g,y]}),e[11]=g,e[12]=y,e[13]=S):S=e[13];let w;e[14]!==S||e[15]!==h?(w=i.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[h,S]}),e[14]=S,e[15]=h,e[16]=w):w=e[16];let P;e[17]!==a?(P=i.jsx("div",{onClick:Ci,className:"shrink-0",children:a}),e[17]=a,e[18]=P):P=e[18];let j;return e[19]!==u||e[20]!==w||e[21]!==P||e[22]!==d||e[23]!==c||e[24]!==f||e[25]!==x?(j=i.jsxs("div",{className:"flex items-center justify-between gap-6 py-4 border-b border-border last:border-0",onClick:u,role:d,tabIndex:c,onKeyDown:f,style:x,children:[w,P]}),e[19]=u,e[20]=w,e[21]=P,e[22]=d,e[23]=c,e[24]=f,e[25]=x,e[26]=j):j=e[26],j}function Ci(t){return t.stopPropagation()}function yt(){const t=L.c(35),[e,r]=tt();let n;t[0]!==r?(n=async k=>{if(k&&await Notification.requestPermission()!=="granted"){V.error("Notifications denied. Please enable them in your browser settings."),r(_i);return}r(N=>({...N,enableNotifications:k}))},t[0]=r,t[1]=n):n=t[1];const s=n;let a;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx("div",{children:i.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Preferences"})}),t[2]=a):a=t[2];let l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(Zr,{size:16}),t[3]=l):l=t[3];let o;t[4]!==r?(o=()=>r(Ai),t[4]=r,t[5]=o):o=t[5];let u;t[6]!==r?(u=k=>r(N=>({...N,devMode:k})),t[6]=r,t[7]=u):u=t[7];let d;t[8]!==e.devMode||t[9]!==u?(d=i.jsx(_e,{checked:e.devMode,onCheckedChange:u}),t[8]=e.devMode,t[9]=u,t[10]=d):d=t[10];let c;t[11]!==o||t[12]!==d?(c=i.jsx(qe,{icon:l,label:"Developer Mode",description:"Show technical details like JSON input/output for tool calls.",onClick:o,control:d}),t[11]=o,t[12]=d,t[13]=c):c=t[13];let f;t[14]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(hr,{size:16}),t[14]=f):f=t[14];let m;t[15]!==s||t[16]!==e.enableNotifications?(m=i.jsx(qe,{icon:f,label:"Notifications",description:"Play a sound and show a notification when chat messages complete while the app is unfocused.",disabled:typeof Notification>"u",onClick:()=>s(!e.enableNotifications),control:i.jsx(_e,{disabled:typeof Notification>"u",checked:e.enableNotifications,onCheckedChange:s})}),t[15]=s,t[16]=e.enableNotifications,t[17]=m):m=t[17];let x;t[18]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx(en,{size:16}),t[18]=x):x=t[18];let h;t[19]!==r?(h=k=>r(N=>({...N,toolApprovalLevel:k})),t[19]=r,t[20]=h):h=t[20];let g;t[21]===Symbol.for("react.memo_cache_sentinel")?(g={none:"Always ask",readonly:"Skip read-only",yolo:"Auto-approve all"},t[21]=g):g=t[21];const y=g[e.toolApprovalLevel];let S;t[22]!==y?(S=i.jsx(Ht,{className:"w-36",children:i.jsx("span",{children:y})}),t[22]=y,t[23]=S):S=t[23];let w;t[24]===Symbol.for("react.memo_cache_sentinel")?(w=i.jsx(Ae,{value:"none",textValue:"Always ask",children:i.jsxs("div",{className:"flex flex-col gap-0.5",children:[i.jsx("span",{className:"font-medium",children:"Always ask"}),i.jsx("span",{className:"text-xs text-muted-foreground",children:"Require approval for all tool calls"})]})}),t[24]=w):w=t[24];let P;t[25]===Symbol.for("react.memo_cache_sentinel")?(P=i.jsx(Ae,{value:"readonly",textValue:"Skip read-only",children:i.jsxs("div",{className:"flex flex-col gap-0.5",children:[i.jsx("span",{className:"font-medium",children:"Skip read-only"}),i.jsx("span",{className:"text-xs text-muted-foreground",children:"Auto-approve read-only tools"})]})}),t[25]=P):P=t[25];let j;t[26]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsxs(Vt,{children:[w,P,i.jsx(Ae,{value:"yolo",textValue:"Auto-approve all",children:i.jsxs("div",{className:"flex flex-col gap-0.5",children:[i.jsx("span",{className:"font-medium",children:"Auto-approve all"}),i.jsx("span",{className:"text-xs text-muted-foreground",children:"Execute all tools without approval"})]})})]}),t[26]=j):j=t[26];let p;t[27]!==e.toolApprovalLevel||t[28]!==h||t[29]!==S?(p=i.jsx(qe,{icon:x,label:"Tool Approval",description:"Choose when to require approval before tools execute.",control:i.jsxs(Yt,{value:e.toolApprovalLevel,onValueChange:h,children:[S,j]})}),t[27]=e.toolApprovalLevel,t[28]=h,t[29]=S,t[30]=p):p=t[30];let b;return t[31]!==p||t[32]!==c||t[33]!==m?(b=i.jsxs("div",{className:"flex flex-col gap-6",children:[a,i.jsxs("div",{className:"flex flex-col",children:[c,m,p]})]}),t[31]=p,t[32]=c,t[33]=m,t[34]=b):b=t[34],b}function Ai(t){return{...t,devMode:!t.devMode}}function _i(t){return{...t,enableNotifications:!1}}function bt(t){const e=L.c(22),{icon:r,label:n,description:s,checked:a,onCheckedChange:l}=t;let o;e[0]!==a||e[1]!==l?(o=()=>l(!a),e[0]=a,e[1]=l,e[2]=o):o=e[2];let u;e[3]!==r?(u=i.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0",children:r}),e[3]=r,e[4]=u):u=e[4];let d;e[5]!==n?(d=i.jsx("p",{className:"text-sm font-medium text-foreground",children:n}),e[5]=n,e[6]=d):d=e[6];let c;e[7]!==s?(c=i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:s}),e[7]=s,e[8]=c):c=e[8];let f;e[9]!==d||e[10]!==c?(f=i.jsxs("div",{className:"min-w-0",children:[d,c]}),e[9]=d,e[10]=c,e[11]=f):f=e[11];let m;e[12]!==u||e[13]!==f?(m=i.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[u,f]}),e[12]=u,e[13]=f,e[14]=m):m=e[14];let x;e[15]!==a||e[16]!==l?(x=i.jsx("div",{onClick:Oi,className:"shrink-0",children:i.jsx(_e,{checked:a,onCheckedChange:l})}),e[15]=a,e[16]=l,e[17]=x):x=e[17];let h;return e[18]!==o||e[19]!==m||e[20]!==x?(h=i.jsxs("div",{className:"flex items-center justify-between gap-6 py-4 border-b border-border last:border-0 cursor-pointer",onClick:o,children:[m,x]}),e[18]=o,e[19]=m,e[20]=x,e[21]=h):h=e[21],h}function Oi(t){return t.stopPropagation()}function Ei(){const t=L.c(16),[e,r]=tt();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{children:[i.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Experimental"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"These features are unstable and may change or stop working at any time."})]}),t[0]=n):n=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx(zr,{size:16}),t[1]=s):s=t[1];let a;t[2]!==r?(a=f=>r(m=>({...m,experimental_projects:f})),t[2]=r,t[3]=a):a=t[3];let l;t[4]!==e.experimental_projects||t[5]!==a?(l=i.jsx(bt,{icon:s,label:"Projects",description:"Enable the projects feature in the sidebar.",checked:e.experimental_projects,onCheckedChange:a}),t[4]=e.experimental_projects,t[5]=a,t[6]=l):l=t[6];let o;t[7]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(tn,{size:16}),t[7]=o):o=t[7];let u;t[8]!==r?(u=f=>r(m=>({...m,experimental_tasks:f})),t[8]=r,t[9]=u):u=t[9];let d;t[10]!==e.experimental_tasks||t[11]!==u?(d=i.jsx(bt,{icon:o,label:"Tasks",description:"Enable the tasks feature in the sidebar.",checked:e.experimental_tasks,onCheckedChange:u}),t[10]=e.experimental_tasks,t[11]=u,t[12]=d):d=t[12];let c;return t[13]!==l||t[14]!==d?(c=i.jsxs("div",{className:"flex flex-col gap-6",children:[n,i.jsxs("div",{className:"flex flex-col rounded-lg border border-border bg-muted/25 px-4",children:[l,d]})]}),t[13]=l,t[14]=d,t[15]=c):c=t[15],c}const Ii=Lt({name:be().min(1,"Name is required").max(255,"Name is too long"),slug:be().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:be().optional()});function Di(t){const e=L.c(24),{value:r,onChange:n,name:s}=t,a=v.useRef(null);let l;e[0]!==n?(l=j=>{const p=j.target.files?.[0];if(p){if(p.size>2097152){V.error("Image must be smaller than 2MB");return}const b=new FileReader;b.onerror=()=>{const k=b.error;console.error("FileReader error:",k),V.error(k?.message||"Failed to read image file. Please try again."),a.current&&(a.current.value="")},b.onloadend=()=>{if(b.readyState===FileReader.DONE&&b.result){const k=b.result;n(k)}},b.readAsDataURL(p)}},e[0]=n,e[1]=l):l=e[1];const o=l;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{a.current?.click()},e[2]=u):u=e[2];const d=u;let c;e[3]!==n?(c=j=>{j.stopPropagation(),n("")},e[3]=n,e[4]=c):c=e[4];const f=c;let m;e[5]!==o?(m=i.jsx("input",{type:"file",ref:a,className:"hidden",accept:"image/*",onChange:o}),e[5]=o,e[6]=m):m=e[6];let x;e[7]!==f||e[8]!==s||e[9]!==r?(x=r?i.jsxs("div",{className:"relative group",children:[i.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:i.jsx("img",{src:r,alt:s||"Organization logo",className:"w-full h-full object-cover"})}),i.jsx("button",{type:"button",onClick:f,className:"absolute -top-2 -right-2 h-6 w-6 rounded-full bg-destructive text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:i.jsx(Gt,{className:"h-3 w-3"})})]}):i.jsxs("button",{type:"button",onClick:d,className:"h-20 w-20 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-1 text-muted-foreground hover:text-foreground",children:[i.jsx(rn,{className:"h-5 w-5"}),i.jsx("span",{className:"text-xs",children:"Upload"})]}),e[7]=f,e[8]=s,e[9]=r,e[10]=x):x=e[10];const h=r?"Change Logo":"Upload Logo";let g;e[11]!==h?(g=i.jsx(Y,{type:"button",variant:"outline",size:"sm",onClick:d,className:"mb-2",children:h}),e[11]=h,e[12]=g):g=e[12];let y;e[13]!==f||e[14]!==r?(y=r&&i.jsx(Y,{type:"button",variant:"ghost",size:"sm",onClick:f,className:"ml-2",children:"Remove"}),e[13]=f,e[14]=r,e[15]=y):y=e[15];let S;e[16]===Symbol.for("react.memo_cache_sentinel")?(S=i.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),e[16]=S):S=e[16];let w;e[17]!==g||e[18]!==y?(w=i.jsxs("div",{className:"flex-1",children:[g,y,S]}),e[17]=g,e[18]=y,e[19]=w):w=e[19];let P;return e[20]!==w||e[21]!==m||e[22]!==x?(P=i.jsxs("div",{className:"flex items-start gap-4",children:[m,x,w]}),e[20]=w,e[21]=m,e[22]=x,e[23]=P):P=e[23],P}function Ti(){const t=$e(),{org:e,project:r}=X(),n=Fe(),[s,a]=v.useState(!1),l=$t({resolver:Ft(Ii),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),o=Me({mutationFn:async c=>{const f={name:c.name,slug:c.slug};c.logo&&(f.logo=c.logo);const m=await et.organization.update({organizationId:e.id,data:f});if(m?.error)throw new Error(m.error.message||"Failed to update organization");return m},onSuccess:c=>{n.invalidateQueries({queryKey:Q.organizations()}),n.invalidateQueries({queryKey:Q.activeOrganization(e.slug)}),V.success("Organization settings updated successfully"),c?.data?.slug&&c.data.slug!==e.slug&&t({to:"/$org/$project/settings",params:{org:c.data.slug,project:r.slug}})},onError:c=>{V.error(c instanceof Error?c.message:"Failed to update organization")},onSettled:()=>{a(!1)}}),u=c=>{a(!0),o.mutate(c)},d=l.formState.isDirty;return i.jsx(Xt,{...l,children:i.jsxs("form",{onSubmit:l.handleSubmit(u),className:"space-y-6",children:[i.jsx(je,{control:l.control,name:"name",render:({field:c})=>i.jsxs(le,{children:[i.jsx(oe,{children:"Organization Name"}),i.jsx(ce,{children:i.jsx(ae,{placeholder:"My Organization",...c,disabled:s})}),i.jsx(ke,{})]})}),i.jsx(je,{control:l.control,name:"slug",render:({field:c})=>i.jsxs(le,{children:[i.jsx(oe,{children:"Organization Slug"}),i.jsx(ce,{children:i.jsx(ae,{placeholder:"my-organization",...c,disabled:s,onChange:f=>{const m=f.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");c.onChange(m)}})}),i.jsx(He,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),i.jsx(ke,{})]})}),i.jsx(je,{control:l.control,name:"logo",render:({field:c})=>i.jsxs(le,{children:[i.jsx(oe,{children:"Logo"}),i.jsx(ce,{children:i.jsx(Di,{value:c.value,onChange:c.onChange,name:l.watch("name")})}),i.jsx(ke,{})]})}),i.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[i.jsx(Y,{type:"submit",disabled:!d||s,className:"min-w-24",children:s?"Saving...":"Save Changes"}),d&&i.jsx(Y,{type:"button",variant:"outline",onClick:()=>l.reset(),disabled:s,children:"Cancel"})]})]})})}function zi(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex flex-col gap-6",children:[i.jsx("div",{children:i.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Organization"})}),i.jsx(Ti,{})]}),t[0]=e):e=t[0],e}const Li=Lt({name:be().min(1,"Name is required").max(200,"Name is too long"),description:be().max(1e3,"Description is too long").nullable(),themeColor:be().nullable()});function $i(){const t=L.c(63),{org:e,project:r}=X(),n=Fe(),s=r.slug===ee;let a;t[0]!==e.id?(a={connectionId:nt,orgId:e.id},t[0]=e.id,t[1]=a):a=t[1];const l=Se(a);let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=Ft(Li),t[2]=o):o=t[2];const u=r.name??"",d=r.description??"",c=r.ui?.themeColor??"#60a5fa";let f;t[3]!==u||t[4]!==d||t[5]!==c?(f={resolver:o,values:{name:u,description:d,themeColor:c}},t[3]=u,t[4]=d,t[5]=c,t[6]=f):f=t[6];const m=$t(f);let x;t[7]!==l||t[8]!==r.id||t[9]!==r.ui?.banner||t[10]!==r.ui?.bannerColor||t[11]!==r.ui?.icon?(x=async D=>{const T=await l.callTool({name:"PROJECT_UPDATE",arguments:{projectId:r.id,name:D.name,description:D.description||null,ui:{themeColor:D.themeColor||null,banner:r.ui?.banner??null,bannerColor:r.ui?.bannerColor??null,icon:r.ui?.icon??null}}});return T.structuredContent??T},t[7]=l,t[8]=r.id,t[9]=r.ui?.banner,t[10]=r.ui?.bannerColor,t[11]=r.ui?.icon,t[12]=x):x=t[12];let h;t[13]!==m||t[14]!==e.id||t[15]!==r.slug||t[16]!==n?(h=()=>{n.invalidateQueries({queryKey:Q.project(e.id,r.slug)}),n.invalidateQueries({queryKey:Q.projects(e.id)}),m.reset(m.getValues())},t[13]=m,t[14]=e.id,t[15]=r.slug,t[16]=n,t[17]=h):h=t[17];let g;t[18]!==x||t[19]!==h?(g={mutationFn:x,onSuccess:h,onError:Fi},t[18]=x,t[19]=h,t[20]=g):g=t[20];const y=Me(g);let S;t[21]!==y?(S=async D=>{await y.mutateAsync(D)},t[21]=y,t[22]=S):S=t[22];const w=S;let P;t[23]!==m||t[24]!==w?(P=D=>{D(),m.handleSubmit(w)()},t[23]=m,t[24]=w,t[25]=P):P=t[25];const j=P;let p;t[26]!==m||t[27]!==w?(p=m.handleSubmit(w),t[26]=m,t[27]=w,t[28]=p):p=t[28];let b;t[29]!==s||t[30]!==y.isPending||t[31]!==j?(b=D=>{const{field:T}=D;return i.jsxs(le,{children:[i.jsx(oe,{children:"Project Name"}),i.jsx(ce,{children:i.jsx(ae,{placeholder:"My Project",...T,onBlur:()=>j(T.onBlur),disabled:s||y.isPending})}),s&&i.jsx(He,{children:"The organization admin project name cannot be changed."}),i.jsx(ke,{})]})},t[29]=s,t[30]=y.isPending,t[31]=j,t[32]=b):b=t[32];let k;t[33]!==m.control||t[34]!==b?(k=i.jsx(je,{control:m.control,name:"name",render:b}),t[33]=m.control,t[34]=b,t[35]=k):k=t[35];let N;t[36]===Symbol.for("react.memo_cache_sentinel")?(N=i.jsx(oe,{children:"Slug"}),t[36]=N):N=t[36];let C;t[37]!==r.slug?(C=i.jsx(ce,{children:i.jsx(ae,{value:r.slug,disabled:!0,className:"bg-muted"})}),t[37]=r.slug,t[38]=C):C=t[38];let A;t[39]===Symbol.for("react.memo_cache_sentinel")?(A=i.jsx(He,{children:"The project slug cannot be changed after creation."}),t[39]=A):A=t[39];let O;t[40]!==C?(O=i.jsxs(le,{children:[N,C,A]}),t[40]=C,t[41]=O):O=t[41];let _;t[42]!==y.isPending||t[43]!==j?(_=D=>{const{field:T}=D;return i.jsxs(le,{children:[i.jsx(oe,{children:"Description"}),i.jsx(ce,{children:i.jsx(nn,{placeholder:"Optional project description...",rows:3,...T,value:T.value??"",onBlur:()=>j(T.onBlur),disabled:y.isPending})}),i.jsx(ke,{})]})},t[42]=y.isPending,t[43]=j,t[44]=_):_=t[44];let E;t[45]!==m.control||t[46]!==_?(E=i.jsx(je,{control:m.control,name:"description",render:_}),t[45]=m.control,t[46]=_,t[47]=E):E=t[47];let I;t[48]!==y.isPending||t[49]!==j?(I=D=>{const{field:T}=D;return i.jsxs(le,{children:[i.jsx(oe,{children:"Color"}),i.jsx(ce,{children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"size-9 rounded-md border border-input overflow-hidden cursor-pointer shrink-0",style:{backgroundColor:T.value??"#60a5fa"},children:i.jsx("input",{type:"color",value:T.value??"#60a5fa",onChange:B=>T.onChange(B.target.value),onBlur:()=>j(T.onBlur),disabled:y.isPending,className:"opacity-0 w-full h-full cursor-pointer"})}),i.jsx("span",{className:"font-mono text-sm text-muted-foreground",children:T.value??"#60a5fa"})]})}),i.jsx(ke,{})]})},t[48]=y.isPending,t[49]=j,t[50]=I):I=t[50];let z;t[51]!==m.control||t[52]!==I?(z=i.jsx(je,{control:m.control,name:"themeColor",render:I}),t[51]=m.control,t[52]=I,t[53]=z):z=t[53];let F;t[54]!==p||t[55]!==k||t[56]!==O||t[57]!==E||t[58]!==z?(F=i.jsxs("form",{onSubmit:p,className:"space-y-6",children:[k,O,E,z]}),t[54]=p,t[55]=k,t[56]=O,t[57]=E,t[58]=z,t[59]=F):F=t[59];let $;return t[60]!==m||t[61]!==F?($=i.jsx("div",{className:"flex flex-col",children:i.jsx(Xt,{...m,children:F})}),t[60]=m,t[61]=F,t[62]=$):$=t[62],$}function Fi(t){V.error("Failed to update project: "+(t instanceof Error?t.message:"Unknown error"))}function xr(){const t=L.c(45),{org:e,project:r}=X(),n=$e(),s=Fe(),[a,l]=v.useState(""),[o,u]=v.useState(!1),d=r.slug===ee;let c;t[0]!==e.id?(c={connectionId:nt,orgId:e.id},t[0]=e.id,t[1]=c):c=t[1];const f=Se(c);let m;t[2]!==f||t[3]!==r.id?(m=async()=>{const M=await f.callTool({name:"PROJECT_DELETE",arguments:{projectId:r.id}});return M.structuredContent??M},t[2]=f,t[3]=r.id,t[4]=m):m=t[4];let x;t[5]!==n||t[6]!==e.id||t[7]!==e.slug||t[8]!==s?(x=M=>{M.success?(s.invalidateQueries({queryKey:Q.projects(e.id)}),V.success("Project deleted"),n({to:"/$org/$project",params:{org:e.slug,project:ee}})):V.error(M.message??"Failed to delete project")},t[5]=n,t[6]=e.id,t[7]=e.slug,t[8]=s,t[9]=x):x=t[9];let h;t[10]!==m||t[11]!==x?(h={mutationFn:m,onSuccess:x,onError:Mi},t[10]=m,t[11]=x,t[12]=h):h=t[12];const g=Me(h);if(d)return null;const y=a===r.name;let S;t[13]!==g?(S=()=>{g.mutate()},t[13]=g,t[14]=S):S=t[14];const w=S;let P;t[15]===Symbol.for("react.memo_cache_sentinel")?(P=M=>{u(M),M||l("")},t[15]=P):P=t[15];const j=P;let p;t[16]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx("p",{className:"py-4 text-base font-semibold text-foreground border-b border-border",children:"Danger Zone"}),t[16]=p):p=t[16];let b;t[17]===Symbol.for("react.memo_cache_sentinel")?(b=i.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[i.jsx("p",{className:"text-sm font-medium text-foreground",children:"Delete Project"}),i.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Permanently delete this project and all its data. This action cannot be undone."})]}),t[17]=b):b=t[17];let k;t[18]===Symbol.for("react.memo_cache_sentinel")?(k=i.jsx(sn,{asChild:!0,children:i.jsx(Y,{variant:"outline",className:"shrink-0 bg-destructive/10 text-destructive border-0 hover:bg-destructive/15 hover:text-destructive",children:"Delete Project"})}),t[18]=k):k=t[18];let N;t[19]!==r.name?(N=i.jsxs(an,{children:['Delete "',r.name,'"?']}),t[19]=r.name,t[20]=N):N=t[20];let C;t[21]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(ln,{children:"This action cannot be undone. All project data will be permanently deleted."}),t[21]=C):C=t[21];let A;t[22]!==N?(A=i.jsxs(on,{children:[N,C]}),t[22]=N,t[23]=A):A=t[23];let O;t[24]!==r.name?(O=i.jsxs("p",{className:"text-sm mb-2",children:["Type ",i.jsx("strong",{children:r.name})," to confirm:"]}),t[24]=r.name,t[25]=O):O=t[25];let _;t[26]===Symbol.for("react.memo_cache_sentinel")?(_=M=>l(M.target.value),t[26]=_):_=t[26];let E;t[27]!==a||t[28]!==r.name?(E=i.jsx(ae,{value:a,onChange:_,placeholder:r.name}),t[27]=a,t[28]=r.name,t[29]=E):E=t[29];let I;t[30]!==O||t[31]!==E?(I=i.jsxs("div",{className:"py-4",children:[O,E]}),t[30]=O,t[31]=E,t[32]=I):I=t[32];let z;t[33]===Symbol.for("react.memo_cache_sentinel")?(z=i.jsx(cn,{children:"Cancel"}),t[33]=z):z=t[33];const F=!y||g.isPending,$=g.isPending?"Deleting...":"Delete Project";let D;t[34]!==w||t[35]!==F||t[36]!==$?(D=i.jsxs(dn,{children:[z,i.jsx(un,{onClick:w,disabled:F,className:"bg-destructive/10 text-destructive hover:bg-destructive/15 hover:text-destructive border-0",children:$})]}),t[34]=w,t[35]=F,t[36]=$,t[37]=D):D=t[37];let T;t[38]!==A||t[39]!==I||t[40]!==D?(T=i.jsxs(mn,{children:[A,I,D]}),t[38]=A,t[39]=I,t[40]=D,t[41]=T):T=t[41];let B;return t[42]!==o||t[43]!==T?(B=i.jsxs("div",{className:"flex flex-col",children:[p,i.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[b,i.jsxs(fn,{open:o,onOpenChange:j,children:[k,T]})]})]}),t[42]=o,t[43]=T,t[44]=B):B=t[44],B}function Mi(t){V.error("Failed to delete project: "+(t instanceof Error?t.message:"Unknown error"))}function Bi(){const t=L.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("p",{className:"py-4 text-base font-semibold text-foreground border-b border-border",children:"General"}),t[0]=e):e=t[0];let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsxs("div",{className:"flex flex-col",children:[e,i.jsxs("div",{className:"pt-6 flex flex-col gap-6",children:[i.jsx($i,{}),i.jsx(xr,{})]})]}),t[1]=r):r=t[1],r}function Ri({value:t,onValueChange:e,placeholder:r="Select a connection...",binding:n,bindingType:s,onAddNew:a,className:l,disabled:o=!1}){const[u,d]=v.useState(!1),{installByBinding:c,isInstalling:f}=vn(),m=u||f,x=Qt(),h=pn({connections:x,binding:typeof n=="string"?n:void 0}),g=!n||!x?x??[]:typeof n=="string"?h:Array.isArray(n)&&n.length>0?x.filter(p=>gn(p,n)):x,y=(()=>{if(!s?.startsWith("@"))return null;const[p,b]=s.replace("@","").split("/");return p&&b?{scope:p,appName:b}:null})(),S=(()=>{let p=g;const b=Array.isArray(n)&&n.length>0;if(y&&!b&&(p=p.filter(k=>{const N=k.app_name,C=k.metadata?.scopeName;return N===y.appName&&C===y.scope})),t&&!p.some(k=>k.id===t)){const k=x?.find(N=>N.id===t);if(k)return[k,...p]}return p})(),w=s?.startsWith("@"),P=async()=>{if(w&&s){d(!0);try{const p=await c(s);p&&e(p.id)}finally{d(!1)}return}a?.()},j=S.find(p=>p.id===t);return i.jsxs(Yt,{value:t??"none",onValueChange:p=>e(p==="none"?null:p),disabled:o,children:[i.jsx(Ht,{size:"sm",className:ie("w-[200px]",l),children:i.jsx(Jr,{placeholder:r,children:j?i.jsxs("div",{className:"flex items-center gap-2",children:[j.icon?i.jsx("img",{src:j.icon,alt:j.title,className:"w-4 h-4 rounded shrink-0"}):i.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary shrink-0",children:j.title.slice(0,1).toUpperCase()}),i.jsx("span",{className:"truncate",children:j.title})]}):r})}),i.jsxs(Vt,{children:[i.jsx(Ae,{value:"none",children:"No connection"}),S.length===0?i.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No compatible connections found"}):S.map(p=>i.jsx(Ae,{value:p.id,children:i.jsxs("div",{className:"flex items-center gap-2",children:[p.icon?i.jsx("img",{src:p.icon,alt:p.title,className:"w-4 h-4 rounded"}):i.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:p.title.slice(0,1).toUpperCase()}),i.jsx("span",{children:p.title})]})},p.id)),(a||w)&&i.jsx("div",{className:"border-t border-border",children:i.jsx(Y,{onPointerDown:p=>p.stopPropagation(),onClick:p=>{p.preventDefault(),p.stopPropagation(),P()},disabled:m||o,variant:"ghost",className:"w-full justify-start gap-2 px-2 py-2 h-auto hover:bg-muted rounded-md text-sm disabled:opacity-50 disabled:cursor-not-allowed",type:"button",children:m?i.jsxs(i.Fragment,{children:[i.jsx(yn,{size:16,className:"animate-spin"}),i.jsx("span",{children:"Connecting..."})]}):i.jsxs(i.Fragment,{children:[i.jsx(Jt,{size:16}),i.jsx("span",{children:"Add Connection"})]})})})]})]})}const Wi=t=>{if(!t||typeof t!="object")return!1;const e=t;return e.type==="text"&&typeof e.text=="string"&&e.text.trim().toLowerCase().startsWith("error")},Ve=t=>{const e=t.structuredContent??t,r=e&&typeof e=="object"?e:null,n=r?.content?.[0]?.text&&typeof r.content[0].text=="string"?r.content[0].text:null;if(r?.isError)throw new Error(n??"Tool call failed");if(Wi(e))throw new Error(e.text);return e};function Gi(t){return t.requiresMcpBinding===!0?!0:t.binding!==void 0}function Ui(t){const e=L.c(57),{plugin:r,isEnabled:n,isSaving:s,pendingBinding:a,description:l,label:o,icon:u,projectId:d,client:c,onBindingChange:f,onToggle:m}=t;let x;e[0]!==r?(x=Gi(r),e[0]=r,e[1]=x):x=e[1];const h=x;let g;e[2]!==r.id||e[3]!==d?(g=Q.projectPluginConfig(d??"",r.id),e[2]=r.id,e[3]=d,e[4]=g):g=e[4];let y;e[5]!==c||e[6]!==r.id||e[7]!==d?(y=async()=>{if(!d)throw new Error("Project ID is required to load plugin config.");const B=await c.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:d,pluginId:r.id}});return Ve(B)},e[5]=c,e[6]=r.id,e[7]=d,e[8]=y):y=e[8];const S=!!d&&h;let w;e[9]!==g||e[10]!==y||e[11]!==S?(w={queryKey:g,queryFn:y,enabled:S},e[9]=g,e[10]=y,e[11]=S,e[12]=w):w=e[12];const{data:P,isLoading:j}=hn(w),p=P?.config?.connectionId??null,b=a!==void 0?a:p;let k;e[13]!==n||e[14]!==s||e[15]!==m||e[16]!==r.id?(k=()=>!s&&m(r.id,!n),e[13]=n,e[14]=s,e[15]=m,e[16]=r.id,e[17]=k):k=e[17];const N=s?void 0:"pointer";let C;e[18]!==N?(C={cursor:N},e[18]=N,e[19]=C):C=e[19];let A;e[20]!==u?(A=u&&i.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0 [&>svg]:size-4",children:u}),e[20]=u,e[21]=A):A=e[21];let O;e[22]!==o?(O=i.jsx("p",{className:"text-sm font-medium text-foreground",children:o}),e[22]=o,e[23]=O):O=e[23];let _;e[24]!==l?(_=l&&i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:l}),e[24]=l,e[25]=_):_=e[25];let E;e[26]!==O||e[27]!==_?(E=i.jsxs("div",{className:"min-w-0",children:[O,_]}),e[26]=O,e[27]=_,e[28]=E):E=e[28];let I;e[29]!==E||e[30]!==A?(I=i.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[A,E]}),e[29]=E,e[30]=A,e[31]=I):I=e[31];let z;e[32]!==m||e[33]!==r.id?(z=B=>m(r.id,B),e[32]=m,e[33]=r.id,e[34]=z):z=e[34];let F;e[35]!==n||e[36]!==s||e[37]!==z?(F=i.jsx("div",{onClick:qi,className:"shrink-0",children:i.jsx(_e,{checked:n,onCheckedChange:z,disabled:s})}),e[35]=n,e[36]=s,e[37]=z,e[38]=F):F=e[38];let $;e[39]!==I||e[40]!==F?($=i.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[I,F]}),e[39]=I,e[40]=F,e[41]=$):$=e[41];let D;e[42]!==j||e[43]!==n||e[44]!==s||e[45]!==h||e[46]!==f||e[47]!==r.binding||e[48]!==r.id||e[49]!==b||e[50]!==p?(D=n&&h&&i.jsxs("div",{onClick:Ki,className:"pb-4 pl-7 flex items-center gap-3",children:[i.jsx(Oe,{className:"text-xs text-muted-foreground w-24",children:"Connection"}),i.jsx(Ri,{value:b??null,onValueChange:B=>f(r.id,B,p),binding:r.binding,placeholder:"Select connection...",className:"w-56",disabled:s||j})]}),e[42]=j,e[43]=n,e[44]=s,e[45]=h,e[46]=f,e[47]=r.binding,e[48]=r.id,e[49]=b,e[50]=p,e[51]=D):D=e[51];let T;return e[52]!==$||e[53]!==D||e[54]!==k||e[55]!==C?(T=i.jsxs("div",{className:"flex flex-col border-b border-border last:border-0",onClick:k,style:C,children:[$,D]}),e[52]=$,e[53]=D,e[54]=k,e[55]=C,e[56]=T):T=e[56],T}function Ki(t){return t.stopPropagation()}function qi(t){return t.stopPropagation()}function Yi(){const{org:t,project:e}=X(),r=Fe(),n=Se({connectionId:nt,orgId:t.id}),[s,a]=v.useState({}),[l,o]=v.useState({}),[u,d]=v.useState(!1),c=e.enabledPlugins??[],f=p=>{const b=s[p];return b!==void 0?b:c.includes(p)},m=()=>{const p=new Set(c);for(const[b,k]of Object.entries(s))k?p.add(b):p.delete(b);return Array.from(p)},x=Object.keys(s).length>0||Object.keys(l).length>0,h=(p,b)=>{const k=c.includes(p);a(b===k?N=>{const{[p]:C,...A}=N;return A}:N=>({...N,[p]:b}))},g=(p,b,k)=>{if(b===k){o(N=>{const{[p]:C,...A}=N;return A});return}o(N=>({...N,[p]:b}))},y=Me({mutationFn:async p=>{const b=[];if(p.updatePlugins){const k=await n.callTool({name:"PROJECT_UPDATE",arguments:{projectId:e.id,enabledPlugins:p.enabledPlugins}});b.push(Ve(k))}if(p.bindingUpdates.length>0){const k=await Promise.all(p.bindingUpdates.map(async({pluginId:N,connectionId:C})=>{const A=await n.callTool({name:"PROJECT_PLUGIN_CONFIG_UPDATE",arguments:{projectId:e.id,pluginId:N,connectionId:C}});return Ve(A)}));b.push(...k)}return b},onSuccess:(p,b)=>{b.updatePlugins&&(r.invalidateQueries({queryKey:Q.project(t.id,e.slug)}),r.invalidateQueries({queryKey:Q.projects(t.id)})),b.bindingUpdates.forEach(({pluginId:k})=>{r.invalidateQueries({queryKey:Q.projectPluginConfig(e.id??"",k)})}),a({}),o({}),V.success("Plugins updated successfully")},onError:p=>{V.error("Failed to update plugins: "+(p instanceof Error?p.message:"Unknown error"))},onSettled:()=>{d(!1)}}),S=()=>{d(!0),y.mutate({enabledPlugins:m(),updatePlugins:Object.keys(s).length>0,bindingUpdates:Object.entries(l).map(([p,b])=>({pluginId:p,connectionId:b}))})},w=()=>{a({}),o({})},P=p=>{const b=Lr.find(k=>k.pluginId===p);return b?{label:b.label,icon:b.items[0]?.icon}:null},j=p=>Ge.find(k=>k.id===p)?.description??null;return Ge.length===0?i.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}):i.jsxs("div",{className:"space-y-4",children:[i.jsx("div",{className:"flex flex-col",children:Ge.map(p=>{const b=P(p.id),k=j(p.id),N=f(p.id);return i.jsx(Ui,{plugin:p,isEnabled:N,isSaving:u,pendingBinding:l[p.id],description:k,label:b?.label??p.id,icon:b?.icon??i.jsx(xn,{size:14}),projectId:e.id,client:n,onBindingChange:g,onToggle:h},p.id)})}),i.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[i.jsx(Y,{variant:"outline",onClick:w,disabled:!x||u,children:"Cancel"}),i.jsx(Y,{onClick:S,disabled:!x||u,className:"min-w-24",children:u?"Saving...":"Save Changes"})]})]})}function jt(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex flex-col gap-6",children:[i.jsx("div",{children:i.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Plugins"})}),i.jsx(Yi,{})]}),t[0]=e):e=t[0],e}function Hi(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex flex-col gap-6",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Danger Zone"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Irreversible and destructive actions."})]}),i.jsx(xr,{})]}),t[0]=e):e=t[0],e}var kt=function(e,r){for(var n=arguments.length,s=new Array(n>2?n-2:0),a=2;a<n;a++)s[a-2]=arguments[a];if(typeof console<"u"&&console.warn&&(r===void 0&&console.warn("LogUtils requires an error message argument"),!e))if(r===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=0;console.warn(r.replace(/%s/g,()=>s[l++]))}};function Vi(t){return t&&typeof t=="object"&&"className"in t&&typeof t.className=="string"?t.className:""}function Xi(t){return(t%180+180)%180}var Qi=function(e){var{width:r,height:n}=e,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Xi(s),l=a*Math.PI/180,o=Math.atan(n/r),u=l>o&&l<Math.PI-o?n/Math.sin(l):r/Math.cos(l);return Math.abs(u)};function pr(t,e){if(e<1)return[];if(e===1)return t;for(var r=[],n=0;n<t.length;n+=e){var s=t[n];s!==void 0&&r.push(s)}return r}function Ji(t,e,r){var n={width:t.width+e.width,height:t.height+e.height};return Qi(n,r)}function Zi(t,e,r){var n=r==="width",{x:s,y:a,width:l,height:o}=t;return e===1?{start:n?s:a,end:n?s+l:a+o}:{start:n?s+l:a+o,end:n?s:a}}function Ee(t,e,r,n,s){if(t*e<t*n||t*e>t*s)return!1;var a=r();return t*(e-t*a/2-n)>=0&&t*(e+t*a/2-s)<=0}function ea(t,e){return pr(t,e+1)}function ta(t,e,r,n,s){for(var a=(n||[]).slice(),{start:l,end:o}=e,u=0,d=1,c=l,f=function(){var h=n?.[u];if(h===void 0)return{v:pr(n,d)};var g=u,y,S=()=>(y===void 0&&(y=r(h,g)),y),w=h.coordinate,P=u===0||Ee(t,w,S,c,o);P||(u=0,c=l,d+=1),P&&(c=w+t*(S()/2+s),u+=d)},m;d<=a.length;)if(m=f(),m)return m.v;return[]}function ra(t,e,r,n,s){var a=(n||[]).slice(),l=a.length;if(l===0)return[];for(var{start:o,end:u}=e,d=1;d<=l;d++){for(var c=(l-1)%d,f=o,m=!0,x=function(){var j=n[g];if(j==null)return 0;var p=g,b,k=()=>(b===void 0&&(b=r(j,p)),b),N=j.coordinate,C=g===c||Ee(t,N,k,f,u);if(!C)return m=!1,1;C&&(f=N+t*(k()/2+s))},h,g=c;g<l&&(h=x(),!(h!==0&&h===1));g+=d);if(m){for(var y=[],S=c;S<l;S+=d){var w=n[S];w!=null&&y.push(w)}return y}}return[]}function St(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function U(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?St(Object(r),!0).forEach(function(n){na(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):St(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function na(t,e,r){return(e=ia(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ia(t){var e=aa(t,"string");return typeof e=="symbol"?e:e+""}function aa(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function sa(t,e,r,n,s){for(var a=(n||[]).slice(),l=a.length,{start:o}=e,{end:u}=e,d=function(m){var x=a[m];if(x==null)return 1;var h=x,g,y=()=>(g===void 0&&(g=r(x,m)),g);if(m===l-1){var S=t*(h.coordinate+t*y()/2-u);a[m]=h=U(U({},h),{},{tickCoord:S>0?h.coordinate-S*t:h.coordinate})}else a[m]=h=U(U({},h),{},{tickCoord:h.coordinate});if(h.tickCoord!=null){var w=Ee(t,h.tickCoord,y,o,u);w&&(u=h.tickCoord-t*(y()/2+s),a[m]=U(U({},h),{},{isShow:!0}))}},c=l-1;c>=0;c--)d(c);return a}function la(t,e,r,n,s,a){var l=(n||[]).slice(),o=l.length,{start:u,end:d}=e;if(a){var c=n[o-1];if(c!=null){var f=r(c,o-1),m=t*(c.coordinate+t*f/2-d);if(l[o-1]=c=U(U({},c),{},{tickCoord:m>0?c.coordinate-m*t:c.coordinate}),c.tickCoord!=null){var x=Ee(t,c.tickCoord,()=>f,u,d);x&&(d=c.tickCoord-t*(f/2+s),l[o-1]=U(U({},c),{},{isShow:!0}))}}}for(var h=a?o-1:o,g=function(w){var P=l[w];if(P==null)return 1;var j=P,p,b=()=>(p===void 0&&(p=r(P,w)),p);if(w===0){var k=t*(j.coordinate-t*b()/2-u);l[w]=j=U(U({},j),{},{tickCoord:k<0?j.coordinate-k*t:j.coordinate})}else l[w]=j=U(U({},j),{},{tickCoord:j.coordinate});if(j.tickCoord!=null){var N=Ee(t,j.tickCoord,b,u,d);N&&(u=j.tickCoord+t*(b()/2+s),l[w]=U(U({},j),{},{isShow:!0}))}},y=0;y<h;y++)g(y);return l}function dt(t,e,r){var{tick:n,ticks:s,viewBox:a,minTickGap:l,orientation:o,interval:u,tickFormatter:d,unit:c,angle:f}=t;if(!s||!s.length||!n)return[];if(q(u)||Zt.isSsr){var m;return(m=ea(s,q(u)?u:0))!==null&&m!==void 0?m:[]}var x=[],h=o==="top"||o==="bottom"?"width":"height",g=c&&h==="width"?Ue(c,{fontSize:e,letterSpacing:r}):{width:0,height:0},y=(p,b)=>{var k=typeof d=="function"?d(p.value,b):p.value;return h==="width"?Ji(Ue(k,{fontSize:e,letterSpacing:r}),g,f):Ue(k,{fontSize:e,letterSpacing:r})[h]},S=s[0],w=s[1],P=s.length>=2&&S!=null&&w!=null?bn(w.coordinate-S.coordinate):1,j=Zi(a,P,h);return u==="equidistantPreserveStart"?ta(P,j,y,s,l):u==="equidistantPreserveEnd"?ra(P,j,y,s,l):(u==="preserveStart"||u==="preserveStartEnd"?x=la(P,j,y,s,l,u==="preserveStartEnd"):x=sa(P,j,y,s,l),x.filter(p=>p.isShow))}var oa=t=>{var{ticks:e,label:r,labelGapWithTick:n=5,tickSize:s=0,tickMargin:a=0}=t,l=0;if(e){Array.from(e).forEach(c=>{if(c){var f=c.getBoundingClientRect();f.width>l&&(l=f.width)}});var o=r?r.getBoundingClientRect().width:0,u=s+a,d=l+u+o+(r?n:0);return Math.round(d)}return 0},ca=["axisLine","width","height","className","hide","ticks","axisType"];function da(t,e){if(t==null)return{};var r,n,s=ua(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(s[r]=t[r])}return s}function ua(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}function fe(){return fe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},fe.apply(null,arguments)}function wt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function R(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?wt(Object(r),!0).forEach(function(n){ma(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ma(t,e,r){return(e=fa(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function fa(t){var e=ha(t,"string");return typeof e=="symbol"?e:e+""}function ha(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var J={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd",zIndex:Be.axis};function xa(t){var{x:e,y:r,width:n,height:s,orientation:a,mirror:l,axisLine:o,otherSvgProps:u}=t;if(!o)return null;var d=R(R(R({},u),Ne(o)),{},{fill:"none"});if(a==="top"||a==="bottom"){var c=+(a==="top"&&!l||a==="bottom"&&l);d=R(R({},d),{},{x1:e,y1:r+c*s,x2:e+n,y2:r+c*s})}else{var f=+(a==="left"&&!l||a==="right"&&l);d=R(R({},d),{},{x1:e+f*n,y1:r,x2:e+f*n,y2:r+s})}return v.createElement("line",fe({},d,{className:ne("recharts-cartesian-axis-line",er(o,"className"))}))}function pa(t,e,r,n,s,a,l,o,u){var d,c,f,m,x,h,g=o?-1:1,y=t.tickSize||l,S=q(t.tickCoord)?t.tickCoord:t.coordinate;switch(a){case"top":d=c=t.coordinate,m=r+ +!o*s,f=m-g*y,h=f-g*u,x=S;break;case"left":f=m=t.coordinate,c=e+ +!o*n,d=c-g*y,x=d-g*u,h=S;break;case"right":f=m=t.coordinate,c=e+ +o*n,d=c+g*y,x=d+g*u,h=S;break;default:d=c=t.coordinate,m=r+ +o*s,f=m+g*y,h=f+g*u,x=S;break}return{line:{x1:d,y1:f,x2:c,y2:m},tick:{x,y:h}}}function ga(t,e){switch(t){case"left":return e?"start":"end";case"right":return e?"end":"start";default:return"middle"}}function va(t,e){switch(t){case"left":case"right":return"middle";case"top":return e?"start":"end";default:return e?"end":"start"}}function ya(t){var{option:e,tickProps:r,value:n}=t,s,a=ne(r.className,"recharts-cartesian-axis-tick-value");if(v.isValidElement(e))s=v.cloneElement(e,R(R({},r),{},{className:a}));else if(typeof e=="function")s=e(R(R({},r),{},{className:a}));else{var l="recharts-cartesian-axis-tick-value";typeof e!="boolean"&&(l=ne(l,Vi(e))),s=v.createElement(Nn,fe({},r,{className:l}),n)}return s}var ba=v.forwardRef((t,e)=>{var{ticks:r=[],tick:n,tickLine:s,stroke:a,tickFormatter:l,unit:o,padding:u,tickTextProps:d,orientation:c,mirror:f,x:m,y:x,width:h,height:g,tickSize:y,tickMargin:S,fontSize:w,letterSpacing:P,getTicksConfig:j,events:p,axisType:b}=t,k=dt(R(R({},j),{},{ticks:r}),w,P),N=ga(c,f),C=va(c,f),A=Ne(j),O=Sn(n),_={};typeof s=="object"&&(_=s);var E=R(R({},A),{},{fill:"none"},_),I=k.map($=>R({entry:$},pa($,m,x,h,g,c,y,f,S))),z=I.map($=>{var{entry:D,line:T}=$;return v.createElement(me,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(D.value,"-").concat(D.coordinate,"-").concat(D.tickCoord)},s&&v.createElement("line",fe({},E,T,{className:ne("recharts-cartesian-axis-tick-line",er(s,"className"))})))}),F=I.map(($,D)=>{var T,B,{entry:M,tick:te}=$,Pe=R(R(R(R({verticalAnchor:C},A),{},{textAnchor:N,stroke:"none",fill:a},te),{},{index:D,payload:M,visibleTicksCount:k.length,tickFormatter:l,padding:u},d),{},{angle:(T=(B=d?.angle)!==null&&B!==void 0?B:A.angle)!==null&&T!==void 0?T:0}),Ce=R(R({},Pe),O);return v.createElement(me,fe({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(M.value,"-").concat(M.coordinate,"-").concat(M.tickCoord)},wn(p,M,D)),n&&v.createElement(ya,{option:n,tickProps:Ce,value:"".concat(typeof l=="function"?l(M.value,D):M.value).concat(o||"")}))});return v.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(b,"-ticks")},F.length>0&&v.createElement(Re,{zIndex:Be.label},v.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(b,"-tick-labels"),ref:e},F)),z.length>0&&v.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(b,"-tick-lines")},z))}),ja=v.forwardRef((t,e)=>{var{axisLine:r,width:n,height:s,className:a,hide:l,ticks:o,axisType:u}=t,d=da(t,ca),[c,f]=v.useState(""),[m,x]=v.useState(""),h=v.useRef(null);v.useImperativeHandle(e,()=>({getCalculatedWidth:()=>{var y;return oa({ticks:h.current,label:(y=t.labelRef)===null||y===void 0?void 0:y.current,labelGapWithTick:5,tickSize:t.tickSize,tickMargin:t.tickMargin})}}));var g=v.useCallback(y=>{if(y){var S=y.getElementsByClassName("recharts-cartesian-axis-tick-value");h.current=S;var w=S[0];if(w){var P=window.getComputedStyle(w),j=P.fontSize,p=P.letterSpacing;(j!==c||p!==m)&&(f(j),x(p))}}},[c,m]);return l||n!=null&&n<=0||s!=null&&s<=0?null:v.createElement(Re,{zIndex:t.zIndex},v.createElement(me,{className:ne("recharts-cartesian-axis",a)},v.createElement(xa,{x:t.x,y:t.y,width:n,height:s,orientation:t.orientation,mirror:t.mirror,axisLine:r,otherSvgProps:Ne(t)}),v.createElement(ba,{ref:g,axisType:u,events:d,fontSize:c,getTicksConfig:t,height:t.height,letterSpacing:m,mirror:t.mirror,orientation:t.orientation,padding:t.padding,stroke:t.stroke,tick:t.tick,tickFormatter:t.tickFormatter,tickLine:t.tickLine,tickMargin:t.tickMargin,tickSize:t.tickSize,tickTextProps:t.tickTextProps,ticks:o,unit:t.unit,width:t.width,x:t.x,y:t.y}),v.createElement(jn,{x:t.x,y:t.y,width:t.width,height:t.height,lowerWidth:t.width,upperWidth:t.width},v.createElement(kn,{label:t.label,labelRef:t.labelRef}),t.children)))}),ut=v.forwardRef((t,e)=>{var r=we(t,J);return v.createElement(ja,fe({},r,{ref:e}))});ut.displayName="CartesianAxis";var ka=["x1","y1","x2","y2","key"],Sa=["offset"],wa=["xAxisId","yAxisId"],Na=["xAxisId","yAxisId"];function Nt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function K(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Nt(Object(r),!0).forEach(function(n){Pa(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Nt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Pa(t,e,r){return(e=Ca(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ca(t){var e=Aa(t,"string");return typeof e=="symbol"?e:e+""}function Aa(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function de(){return de=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},de.apply(null,arguments)}function ze(t,e){if(t==null)return{};var r,n,s=_a(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(s[r]=t[r])}return s}function _a(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}var Oa=t=>{var{fill:e}=t;if(!e||e==="none")return null;var{fillOpacity:r,x:n,y:s,width:a,height:l,ry:o}=t;return v.createElement("rect",{x:n,y:s,ry:o,width:a,height:l,stroke:"none",fill:e,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function gr(t){var{option:e,lineItemProps:r}=t,n;if(v.isValidElement(e))n=v.cloneElement(e,r);else if(typeof e=="function")n=e(r);else{var s,{x1:a,y1:l,x2:o,y2:u,key:d}=r,c=ze(r,ka),f=(s=Ne(c))!==null&&s!==void 0?s:{},{offset:m}=f,x=ze(f,Sa);n=v.createElement("line",de({},x,{x1:a,y1:l,x2:o,y2:u,fill:"none",key:d}))}return n}function Ea(t){var{x:e,width:r,horizontal:n=!0,horizontalPoints:s}=t;if(!n||!s||!s.length)return null;var{xAxisId:a,yAxisId:l}=t,o=ze(t,wa),u=s.map((d,c)=>{var f=K(K({},o),{},{x1:e,y1:d,x2:e+r,y2:d,key:"line-".concat(c),index:c});return v.createElement(gr,{key:"line-".concat(c),option:n,lineItemProps:f})});return v.createElement("g",{className:"recharts-cartesian-grid-horizontal"},u)}function Ia(t){var{y:e,height:r,vertical:n=!0,verticalPoints:s}=t;if(!n||!s||!s.length)return null;var{xAxisId:a,yAxisId:l}=t,o=ze(t,Na),u=s.map((d,c)=>{var f=K(K({},o),{},{x1:d,y1:e,x2:d,y2:e+r,key:"line-".concat(c),index:c});return v.createElement(gr,{option:n,lineItemProps:f,key:"line-".concat(c)})});return v.createElement("g",{className:"recharts-cartesian-grid-vertical"},u)}function Da(t){var{horizontalFill:e,fillOpacity:r,x:n,y:s,width:a,height:l,horizontalPoints:o,horizontal:u=!0}=t;if(!u||!e||!e.length||o==null)return null;var d=o.map(f=>Math.round(f+s-s)).sort((f,m)=>f-m);s!==d[0]&&d.unshift(0);var c=d.map((f,m)=>{var x=d[m+1],h=x==null,g=h?s+l-f:x-f;if(g<=0)return null;var y=m%e.length;return v.createElement("rect",{key:"react-".concat(m),y:f,x:n,height:g,width:a,stroke:"none",fill:e[y],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},c)}function Ta(t){var{vertical:e=!0,verticalFill:r,fillOpacity:n,x:s,y:a,width:l,height:o,verticalPoints:u}=t;if(!e||!r||!r.length)return null;var d=u.map(f=>Math.round(f+s-s)).sort((f,m)=>f-m);s!==d[0]&&d.unshift(0);var c=d.map((f,m)=>{var x=d[m+1],h=x==null,g=h?s+l-f:x-f;if(g<=0)return null;var y=m%r.length;return v.createElement("rect",{key:"react-".concat(m),x:f,y:a,width:g,height:o,stroke:"none",fill:r[y],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},c)}var za=(t,e)=>{var{xAxis:r,width:n,height:s,offset:a}=t;return tr(dt(K(K(K({},J),r),{},{ticks:rr(r),viewBox:{x:0,y:0,width:n,height:s}})),a.left,a.left+a.width,e)},La=(t,e)=>{var{yAxis:r,width:n,height:s,offset:a}=t;return tr(dt(K(K(K({},J),r),{},{ticks:rr(r),viewBox:{x:0,y:0,width:n,height:s}})),a.top,a.top+a.height,e)},$a={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Be.grid};function vr(t){var e=Pn(),r=Cn(),n=An(),s=K(K({},we(t,$a)),{},{x:q(t.x)?t.x:n.left,y:q(t.y)?t.y:n.top,width:q(t.width)?t.width:n.width,height:q(t.height)?t.height:n.height}),{xAxisId:a,yAxisId:l,x:o,y:u,width:d,height:c,syncWithTicks:f,horizontalValues:m,verticalValues:x}=s,h=Ie(),g=H(C=>ft(C,"xAxis",a,h)),y=H(C=>ft(C,"yAxis",l,h));if(!ht(d)||!ht(c)||!q(o)||!q(u))return null;var S=s.verticalCoordinatesGenerator||za,w=s.horizontalCoordinatesGenerator||La,{horizontalPoints:P,verticalPoints:j}=s;if((!P||!P.length)&&typeof w=="function"){var p=m&&m.length,b=w({yAxis:y?K(K({},y),{},{ticks:p?m:y.ticks}):void 0,width:e??d,height:r??c,offset:n},p?!0:f);kt(Array.isArray(b),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof b,"]")),Array.isArray(b)&&(P=b)}if((!j||!j.length)&&typeof S=="function"){var k=x&&x.length,N=S({xAxis:g?K(K({},g),{},{ticks:k?x:g.ticks}):void 0,width:e??d,height:r??c,offset:n},k?!0:f);kt(Array.isArray(N),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof N,"]")),Array.isArray(N)&&(j=N)}return v.createElement(Re,{zIndex:s.zIndex},v.createElement("g",{className:"recharts-cartesian-grid"},v.createElement(Oa,{fill:s.fill,fillOpacity:s.fillOpacity,x:s.x,y:s.y,width:s.width,height:s.height,ry:s.ry}),v.createElement(Da,de({},s,{horizontalPoints:P})),v.createElement(Ta,de({},s,{verticalPoints:j})),v.createElement(Ea,de({},s,{offset:n,horizontalPoints:P,xAxis:g,yAxis:y})),v.createElement(Ia,de({},s,{offset:n,verticalPoints:j,xAxis:g,yAxis:y}))))}vr.displayName="CartesianGrid";var yr=(t,e,r)=>nr(t,"xAxis",at(t,e),r),br=(t,e,r)=>ir(t,"xAxis",at(t,e),r),jr=(t,e,r)=>nr(t,"yAxis",st(t,e),r),kr=(t,e,r)=>ir(t,"yAxis",st(t,e),r),Fa=We([it,yr,jr,br,kr],(t,e,r,n,s)=>ar(t,"xAxis")?xt(e,n,!1):xt(r,s,!1)),Ma=(t,e)=>e,Sr=We([In,Ma],(t,e)=>t.filter(r=>r.type==="area").find(r=>r.id===e)),wr=t=>{var e=it(t),r=ar(e,"xAxis");return r?"yAxis":"xAxis"},Ba=(t,e)=>{var r=wr(t);return r==="yAxis"?st(t,e):at(t,e)},Ra=(t,e,r)=>Dn(t,wr(t),Ba(t,e),r),Wa=We([Sr,Ra],(t,e)=>{var r;if(!(t==null||e==null)){var{stackId:n}=t,s=En(t);if(!(n==null||s==null)){var a=(r=e[n])===null||r===void 0?void 0:r.stackedData,l=a?.find(o=>o.key===s);if(l!=null)return l.map(o=>[o[0],o[1]])}}}),Ga=We([it,yr,jr,br,kr,Wa,_n,Fa,Sr,On],(t,e,r,n,s,a,l,o,u,d)=>{var{chartData:c,dataStartIndex:f,dataEndIndex:m}=l;if(!(u==null||t!=="horizontal"&&t!=="vertical"||e==null||r==null||n==null||s==null||n.length===0||s.length===0||o==null)){var{data:x}=u,h;if(x&&x.length>0?h=x:h=c?.slice(f,m+1),h!=null)return os({layout:t,xAxis:e,yAxis:r,xAxisTicks:n,yAxisTicks:s,dataStartIndex:f,areaSettings:u,stackedData:a,displayedData:h,chartBaseValue:d,bandSize:o})}}),Ua=["id"],Ka=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function ue(){return ue=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ue.apply(null,arguments)}function Nr(t,e){if(t==null)return{};var r,n,s=qa(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(s[r]=t[r])}return s}function qa(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}function Pt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function ye(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Pt(Object(r),!0).forEach(function(n){Ya(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Pt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Ya(t,e,r){return(e=Ha(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ha(t){var e=Va(t,"string");return typeof e=="symbol"?e:e+""}function Va(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Le(t,e){return t&&t!=="none"?t:e}var Xa=t=>{var{dataKey:e,name:r,stroke:n,fill:s,legendType:a,hide:l}=t;return[{inactive:l,dataKey:e,type:a,color:Le(n,s),value:lr(r,e),payload:t}]},Qa=v.memo(t=>{var{dataKey:e,data:r,stroke:n,strokeWidth:s,fill:a,name:l,hide:o,unit:u,tooltipType:d,id:c}=t,f={dataDefinedOnItem:r,getPosition:Mn,settings:{stroke:n,strokeWidth:s,fill:a,dataKey:e,nameKey:void 0,name:lr(l,e),hide:o,type:d,color:Le(n,a),unit:u,graphicalItemId:c}};return v.createElement(Fn,{tooltipEntrySettings:f})});function Ja(t){var{clipPathId:e,points:r,props:n}=t,{needClip:s,dot:a,dataKey:l}=n,o=Ne(n);return v.createElement(ei,{points:r,dot:a,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:l,baseProps:o,needClip:s,clipPathId:e})}function Za(t){var{showLabels:e,children:r,points:n}=t,s=n.map(a=>{var l,o,u={x:(l=a.x)!==null&&l!==void 0?l:0,y:(o=a.y)!==null&&o!==void 0?o:0,width:0,lowerWidth:0,upperWidth:0,height:0};return ye(ye({},u),{},{value:a.value,payload:a.payload,parentViewBox:void 0,viewBox:u,fill:void 0})});return v.createElement(Jn,{value:e?s:void 0},r)}function Ct(t){var{points:e,baseLine:r,needClip:n,clipPathId:s,props:a}=t,{layout:l,type:o,stroke:u,connectNulls:d,isRange:c}=a,{id:f}=a,m=Nr(a,Ua),x=Ne(m),h=Zn(m);return v.createElement(v.Fragment,null,e?.length>1&&v.createElement(me,{clipPath:n?"url(#clipPath-".concat(s,")"):void 0},v.createElement(Ke,ue({},h,{id:f,points:e,connectNulls:d,type:o,baseLine:r,layout:l,stroke:"none",className:"recharts-area-area"})),u!=="none"&&v.createElement(Ke,ue({},x,{className:"recharts-area-curve",layout:l,type:o,connectNulls:d,fill:"none",points:e})),u!=="none"&&c&&v.createElement(Ke,ue({},x,{className:"recharts-area-curve",layout:l,type:o,connectNulls:d,fill:"none",points:r}))),v.createElement(Ja,{points:e,props:m,clipPathId:s}))}function es(t){var e,r,{alpha:n,baseLine:s,points:a,strokeWidth:l}=t,o=(e=a[0])===null||e===void 0?void 0:e.y,u=(r=a[a.length-1])===null||r===void 0?void 0:r.y;if(!Te(o)||!Te(u))return null;var d=n*Math.abs(o-u),c=Math.max(...a.map(f=>f.x||0));return q(s)?c=Math.max(s,c):s&&Array.isArray(s)&&s.length&&(c=Math.max(...s.map(f=>f.x||0),c)),q(c)?v.createElement("rect",{x:0,y:o<u?o:o-d,width:c+(l?parseInt("".concat(l),10):1),height:Math.floor(d)}):null}function ts(t){var e,r,{alpha:n,baseLine:s,points:a,strokeWidth:l}=t,o=(e=a[0])===null||e===void 0?void 0:e.x,u=(r=a[a.length-1])===null||r===void 0?void 0:r.x;if(!Te(o)||!Te(u))return null;var d=n*Math.abs(o-u),c=Math.max(...a.map(f=>f.y||0));return q(s)?c=Math.max(s,c):s&&Array.isArray(s)&&s.length&&(c=Math.max(...s.map(f=>f.y||0),c)),q(c)?v.createElement("rect",{x:o<u?o:o-d,y:0,width:d,height:Math.floor(c+(l?parseInt("".concat(l),10):1))}):null}function rs(t){var{alpha:e,layout:r,points:n,baseLine:s,strokeWidth:a}=t;return r==="vertical"?v.createElement(es,{alpha:e,points:n,baseLine:s,strokeWidth:a}):v.createElement(ts,{alpha:e,points:n,baseLine:s,strokeWidth:a})}function ns(t){var{needClip:e,clipPathId:r,props:n,previousPointsRef:s,previousBaselineRef:a}=t,{points:l,baseLine:o,isAnimationActive:u,animationBegin:d,animationDuration:c,animationEasing:f,onAnimationStart:m,onAnimationEnd:x}=n,h=v.useMemo(()=>({points:l,baseLine:o}),[l,o]),g=Yn(h,"recharts-area-"),y=lt(),[S,w]=v.useState(!1),P=!S,j=v.useCallback(()=>{typeof x=="function"&&x(),w(!1)},[x]),p=v.useCallback(()=>{typeof m=="function"&&m(),w(!0)},[m]);if(y==null)return null;var b=s.current,k=a.current;return v.createElement(Za,{showLabels:P,points:l},n.children,v.createElement(Hn,{animationId:g,begin:d,duration:c,isActive:u,easing:f,onAnimationEnd:j,onAnimationStart:p,key:g},N=>{if(b){var C=b.length/l.length,A=N===1?l:l.map((_,E)=>{var I=Math.floor(E*C);if(b[I]){var z=b[I];return ye(ye({},_),{},{x:ve(z.x,_.x,N),y:ve(z.y,_.y,N)})}return _}),O;return q(o)?O=ve(k,o,N):Vn(o)||Xn(o)?O=ve(k,0,N):O=o.map((_,E)=>{var I=Math.floor(E*C);if(Array.isArray(k)&&k[I]){var z=k[I];return ye(ye({},_),{},{x:ve(z.x,_.x,N),y:ve(z.y,_.y,N)})}return _}),N>0&&(s.current=A,a.current=O),v.createElement(Ct,{points:A,baseLine:O,needClip:e,clipPathId:r,props:n})}return N>0&&(s.current=l,a.current=o),v.createElement(me,null,u&&v.createElement("defs",null,v.createElement("clipPath",{id:"animationClipPath-".concat(r)},v.createElement(rs,{alpha:N,points:l,baseLine:o,layout:y,strokeWidth:n.strokeWidth}))),v.createElement(me,{clipPath:"url(#animationClipPath-".concat(r,")")},v.createElement(Ct,{points:l,baseLine:o,needClip:e,clipPathId:r,props:n})))}),v.createElement(Qn,{label:n.label}))}function is(t){var{needClip:e,clipPathId:r,props:n}=t,s=v.useRef(null),a=v.useRef();return v.createElement(ns,{needClip:e,clipPathId:r,props:n,previousPointsRef:s,previousBaselineRef:a})}class as extends v.PureComponent{render(){var{hide:e,dot:r,points:n,className:s,top:a,left:l,needClip:o,xAxisId:u,yAxisId:d,width:c,height:f,id:m,baseLine:x,zIndex:h}=this.props;if(e)return null;var g=ne("recharts-area",s),y=m,{r:S,strokeWidth:w}=Un(r),P=Kn(r),j=S*2+w,p=o?"url(#clipPath-".concat(P?"":"dots-").concat(y,")"):void 0;return v.createElement(Re,{zIndex:h},v.createElement(me,{className:g},o&&v.createElement("defs",null,v.createElement(qn,{clipPathId:y,xAxisId:u,yAxisId:d}),!P&&v.createElement("clipPath",{id:"clipPath-dots-".concat(y)},v.createElement("rect",{x:l-j/2,y:a-j/2,width:c+j,height:f+j}))),v.createElement(is,{needClip:o,clipPathId:y,props:this.props})),v.createElement(pt,{points:n,mainColor:Le(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:p}),this.props.isRange&&Array.isArray(x)&&v.createElement(pt,{points:x,mainColor:Le(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:p}))}}var Pr={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,xAxisId:0,yAxisId:0,zIndex:Be.area};function ss(t){var e,r=we(t,Pr),{activeDot:n,animationBegin:s,animationDuration:a,animationEasing:l,connectNulls:o,dot:u,fill:d,fillOpacity:c,hide:f,isAnimationActive:m,legendType:x,stroke:h,xAxisId:g,yAxisId:y}=r,S=Nr(r,Ka),w=Bn(),P=Rn(),{needClip:j}=Wn(g,y),p=Ie(),{points:b,isRange:k,baseLine:N}=(e=H(I=>Ga(I,t.id,p)))!==null&&e!==void 0?e:{},C=Gn();if(w!=="horizontal"&&w!=="vertical"||C==null||P!=="AreaChart"&&P!=="ComposedChart")return null;var{height:A,width:O,x:_,y:E}=C;return!b||!b.length?null:v.createElement(as,ue({},S,{activeDot:n,animationBegin:s,animationDuration:a,animationEasing:l,baseLine:N,connectNulls:o,dot:u,fill:d,fillOpacity:c,height:A,hide:f,layout:w,isAnimationActive:m==="auto"?!Zt.isSsr:m,isRange:k,legendType:x,needClip:j,points:b,stroke:h,width:O,left:_,top:E,xAxisId:g,yAxisId:y}))}var ls=(t,e,r,n,s)=>{var a=r??e;if(q(a))return a;var l=t==="horizontal"?s:n,o=l.scale.domain();if(l.type==="number"){var u=Math.max(o[0],o[1]),d=Math.min(o[0],o[1]);return a==="dataMin"?d:a==="dataMax"||u<0?u:Math.max(Math.min(o[0],o[1]),0)}return a==="dataMin"?o[0]:a==="dataMax"?o[1]:o[0]};function os(t){var{areaSettings:{connectNulls:e,baseValue:r,dataKey:n},stackedData:s,layout:a,chartBaseValue:l,xAxis:o,yAxis:u,displayedData:d,dataStartIndex:c,xAxisTicks:f,yAxisTicks:m,bandSize:x}=t,h=s&&s.length,g=ls(a,l,r,o,u),y=a==="horizontal",S=!1,w=d.map((j,p)=>{var b,k,N,C;if(h)C=s[c+p];else{var A=gt(j,n);Array.isArray(A)?(C=A,S=!0):C=[g,A]}var O=(b=(k=C)===null||k===void 0?void 0:k[1])!==null&&b!==void 0?b:null,_=O==null||h&&!e&>(j,n)==null;if(y){var E;return{x:vt({axis:o,ticks:f,bandSize:x,entry:j,index:p}),y:_?null:(E=u.scale.map(O))!==null&&E!==void 0?E:null,value:C,payload:j}}return{x:_?null:(N=o.scale.map(O))!==null&&N!==void 0?N:null,y:vt({axis:u,ticks:m,bandSize:x,entry:j,index:p}),value:C,payload:j}}),P;return h||S?P=w.map(j=>{var p,b=Array.isArray(j.value)?j.value[0]:null;if(y){var k;return{x:j.x,y:b!=null&&j.y!=null&&(k=u.scale.map(b))!==null&&k!==void 0?k:null,payload:j.payload}}return{x:b!=null&&(p=o.scale.map(b))!==null&&p!==void 0?p:null,y:j.y,payload:j.payload}}):P=y?u.scale.map(g):o.scale.map(g),{points:w,baseLine:P??0,isRange:S}}function cs(t){var e=we(t,Pr),r=Ie();return v.createElement(Tn,{id:e.id,type:"area"},n=>v.createElement(v.Fragment,null,v.createElement(zn,{legendPayload:Xa(e)}),v.createElement(Qa,{dataKey:e.dataKey,data:e.data,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,unit:e.unit,tooltipType:e.tooltipType,id:n}),v.createElement(Ln,{type:"area",id:n,data:e.data,dataKey:e.dataKey,xAxisId:e.xAxisId,yAxisId:e.yAxisId,zAxisId:0,stackId:$n(e.stackId),hide:e.hide,barSize:void 0,baseValue:e.baseValue,isPanorama:r,connectNulls:e.connectNulls}),v.createElement(ss,ue({},e,{id:n}))))}var Cr=v.memo(cs,sr);Cr.displayName="Area";var ds=["domain","range"],us=["domain","range"];function At(t,e){if(t==null)return{};var r,n,s=ms(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(s[r]=t[r])}return s}function ms(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}function _t(t,e){return t===e?!0:Array.isArray(t)&&t.length===2&&Array.isArray(e)&&e.length===2?t[0]===e[0]&&t[1]===e[1]:!1}function Ar(t,e){if(t===e)return!0;var{domain:r,range:n}=t,s=At(t,ds),{domain:a,range:l}=e,o=At(e,us);return!_t(r,a)||!_t(n,l)?!1:sr(s,o)}var fs=["type"],hs=["dangerouslySetInnerHTML","ticks","scale"],xs=["id","scale"];function Xe(){return Xe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Xe.apply(null,arguments)}function Ot(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function Et(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ot(Object(r),!0).forEach(function(n){ps(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ot(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ps(t,e,r){return(e=gs(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function gs(t){var e=vs(t,"string");return typeof e=="symbol"?e:e+""}function vs(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Qe(t,e){if(t==null)return{};var r,n,s=ys(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(s[r]=t[r])}return s}function ys(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}function bs(t){var e=ot(),r=v.useRef(null),n=lt(),{type:s}=t,a=Qe(t,fs),l=dr(n,"xAxis",s),o=v.useMemo(()=>{if(l!=null)return Et(Et({},a),{},{type:l})},[a,l]);return v.useLayoutEffect(()=>{o!=null&&(r.current===null?e(ti(o)):r.current!==o&&e(ri({prev:r.current,next:o})),r.current=o)},[o,e]),v.useLayoutEffect(()=>()=>{r.current&&(e(ni(r.current)),r.current=null)},[e]),null}var js=t=>{var{xAxisId:e,className:r}=t,n=H(or),s=Ie(),a="xAxis",l=H(S=>cr(S,a,e,s)),o=H(S=>ii(S,e)),u=H(S=>ai(S,e)),d=H(S=>si(S,e));if(o==null||u==null||d==null)return null;var{dangerouslySetInnerHTML:c,ticks:f,scale:m}=t,x=Qe(t,hs),{id:h,scale:g}=d,y=Qe(d,xs);return v.createElement(ut,Xe({},x,y,{x:u.x,y:u.y,width:o.width,height:o.height,className:ne("recharts-".concat(a," ").concat(a),r),viewBox:n,ticks:l,axisType:a}))},ks={allowDataOverflow:W.allowDataOverflow,allowDecimals:W.allowDecimals,allowDuplicatedCategory:W.allowDuplicatedCategory,angle:W.angle,axisLine:J.axisLine,height:W.height,hide:!1,includeHidden:W.includeHidden,interval:W.interval,label:!1,minTickGap:W.minTickGap,mirror:W.mirror,orientation:W.orientation,padding:W.padding,reversed:W.reversed,scale:W.scale,tick:W.tick,tickCount:W.tickCount,tickLine:J.tickLine,tickSize:J.tickSize,type:W.type,xAxisId:0},Ss=t=>{var e=we(t,ks);return v.createElement(v.Fragment,null,v.createElement(bs,{allowDataOverflow:e.allowDataOverflow,allowDecimals:e.allowDecimals,allowDuplicatedCategory:e.allowDuplicatedCategory,angle:e.angle,dataKey:e.dataKey,domain:e.domain,height:e.height,hide:e.hide,id:e.xAxisId,includeHidden:e.includeHidden,interval:e.interval,minTickGap:e.minTickGap,mirror:e.mirror,name:e.name,orientation:e.orientation,padding:e.padding,reversed:e.reversed,scale:e.scale,tick:e.tick,tickCount:e.tickCount,tickFormatter:e.tickFormatter,ticks:e.ticks,type:e.type,unit:e.unit}),v.createElement(js,e))},_r=v.memo(Ss,Ar);_r.displayName="XAxis";var ws=["type"],Ns=["dangerouslySetInnerHTML","ticks","scale"],Ps=["id","scale"];function Je(){return Je=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Je.apply(null,arguments)}function It(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function Dt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?It(Object(r),!0).forEach(function(n){Cs(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):It(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Cs(t,e,r){return(e=As(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function As(t){var e=_s(t,"string");return typeof e=="symbol"?e:e+""}function _s(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ze(t,e){if(t==null)return{};var r,n,s=Os(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(s[r]=t[r])}return s}function Os(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}function Es(t){var e=ot(),r=v.useRef(null),n=lt(),{type:s}=t,a=Ze(t,ws),l=dr(n,"yAxis",s),o=v.useMemo(()=>{if(l!=null)return Dt(Dt({},a),{},{type:l})},[l,a]);return v.useLayoutEffect(()=>{o!=null&&(r.current===null?e(li(o)):r.current!==o&&e(oi({prev:r.current,next:o})),r.current=o)},[o,e]),v.useLayoutEffect(()=>()=>{r.current&&(e(ci(r.current)),r.current=null)},[e]),null}function Is(t){var{yAxisId:e,className:r,width:n,label:s}=t,a=v.useRef(null),l=v.useRef(null),o=H(or),u=Ie(),d=ot(),c="yAxis",f=H(b=>di(b,e)),m=H(b=>ui(b,e)),x=H(b=>cr(b,c,e,u)),h=H(b=>mi(b,e));if(v.useLayoutEffect(()=>{if(!(n!=="auto"||!f||fi(s)||v.isValidElement(s)||h==null)){var b=a.current;if(b){var k=b.getCalculatedWidth();Math.round(f.width)!==Math.round(k)&&d(hi({id:e,width:k}))}}},[x,f,d,s,e,n,h]),f==null||m==null||h==null)return null;var{dangerouslySetInnerHTML:g,ticks:y,scale:S}=t,w=Ze(t,Ns),{id:P,scale:j}=h,p=Ze(h,Ps);return v.createElement(ut,Je({},w,p,{ref:a,labelRef:l,x:m.x,y:m.y,tickTextProps:n==="auto"?{width:void 0}:{width:n},width:f.width,height:f.height,className:ne("recharts-".concat(c," ").concat(c),r),viewBox:o,ticks:x,axisType:c}))}var Ds={allowDataOverflow:G.allowDataOverflow,allowDecimals:G.allowDecimals,allowDuplicatedCategory:G.allowDuplicatedCategory,angle:G.angle,axisLine:J.axisLine,hide:!1,includeHidden:G.includeHidden,interval:G.interval,label:!1,minTickGap:G.minTickGap,mirror:G.mirror,orientation:G.orientation,padding:G.padding,reversed:G.reversed,scale:G.scale,tick:G.tick,tickCount:G.tickCount,tickLine:J.tickLine,tickSize:J.tickSize,type:G.type,width:G.width,yAxisId:0},Ts=t=>{var e=we(t,Ds);return v.createElement(v.Fragment,null,v.createElement(Es,{interval:e.interval,id:e.yAxisId,scale:e.scale,type:e.type,domain:e.domain,allowDataOverflow:e.allowDataOverflow,dataKey:e.dataKey,allowDuplicatedCategory:e.allowDuplicatedCategory,allowDecimals:e.allowDecimals,tickCount:e.tickCount,padding:e.padding,includeHidden:e.includeHidden,reversed:e.reversed,ticks:e.ticks,width:e.width,orientation:e.orientation,mirror:e.mirror,hide:e.hide,unit:e.unit,name:e.name,angle:e.angle,minTickGap:e.minTickGap,tick:e.tick,tickFormatter:e.tickFormatter}),v.createElement(Is,e))},Or=v.memo(Ts,Ar);Or.displayName="YAxis";var zs=["axis"],Ls=v.forwardRef((t,e)=>v.createElement(xi,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:zs,tooltipPayloadSearcher:pi,categoricalChartProps:t,ref:e}));function Z(t){return`$${t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function $s(t,e){const r=new Date,n=[];if(t==="day"){for(let s=29;s>=0;s--){const a=new Date(r);a.setDate(a.getDate()-s),n.push({date:a.toLocaleDateString("en-US",{month:"short",day:"numeric"}),amount:s===0?e.daily:0})}n[n.length-1]={date:n[n.length-1]?.date??"Today",amount:e.daily}}else if(t==="week"){for(let s=11;s>=0;s--){const a=new Date(r);a.setDate(a.getDate()-s*7),n.push({date:`W${String(52-s)}`,amount:s===0?e.weekly:0})}n[n.length-1]={date:n[n.length-1]?.date??"This week",amount:e.weekly}}else{for(let s=11;s>=0;s--){const a=new Date(r);a.setMonth(a.getMonth()-s),n.push({date:a.toLocaleDateString("en-US",{month:"short",year:"2-digit"}),amount:s===0?e.monthly:0})}n[n.length-1]={date:n[n.length-1]?.date??"This month",amount:e.monthly}}return n}const Fs={low:"Low confidence",medium:"Medium confidence",high:"High confidence"},Ms=[5,10,25,50,100];function Bs(t){const e=L.c(25),{open:r,onOpenChange:n,connectionId:s,currentLimitUsd:a}=t,{org:l}=X(),[o,u]=v.useState(null),[d,c]=v.useState(""),[f,m]=v.useState(null),[x,h]=v.useState(null);let g;e[0]!==s||e[1]!==l.id?(g={connectionId:s,orgId:l.id},e[0]=s,e[1]=l.id,e[2]=g):g=e[2];const y=Se(g);let S;e[3]!==y?(S={client:y},e[3]=y,e[4]=S):S=e[4];const{mutate:w,isPending:P}=mr(S),j=o??(d?parseFloat(d):null);let p,b;e[5]!==a||e[6]!==j||e[7]!==w||e[8]!==n?(b=()=>{if(!j||j<=0)return;const A=a+j;h(null),w({name:"GATEWAY_SET_LIMIT",arguments:{limit_usd:A,return_url:window.location.href}},{onSuccess:O=>{const _=O.structuredContent;_?.checkout_url?m(_.checkout_url):_?.billing_mode==="postpaid"&&p()},onError:O=>{h(O.message??"Failed to create payment link.")}})},p=()=>{u(null),c(""),m(null),h(null),n(!1)},e[5]=a,e[6]=j,e[7]=w,e[8]=n,e[9]=p,e[10]=b):(p=e[9],b=e[10]);let k;e[11]===Symbol.for("react.memo_cache_sentinel")?(k=i.jsxs(Br,{children:[i.jsx(Rr,{children:"Add Credit"}),i.jsx(Wr,{children:"Choose how much credit to add to your AI Gateway."})]}),e[11]=k):k=e[11];let N;e[12]!==f||e[13]!==a||e[14]!==d||e[15]!==j||e[16]!==x||e[17]!==b||e[18]!==P||e[19]!==o?(N=i.jsxs(Rt,{className:"sm:max-w-md",children:[k,f?i.jsxs("div",{className:"flex flex-col gap-4 pt-2",children:[i.jsx("p",{className:"text-sm text-muted-foreground",children:"Your payment link is ready. Click below to complete the purchase. You'll be redirected back here after payment."}),i.jsx(Y,{asChild:!0,className:"gap-2",children:i.jsxs("a",{href:f,children:[i.jsx(rt,{size:15}),"Complete Payment"]})})]}):i.jsxs("div",{className:"flex flex-col gap-5 pt-2",children:[i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsx(Oe,{className:"text-xs text-muted-foreground",children:"Select amount"}),i.jsx("div",{className:"grid grid-cols-5 gap-2",children:Ms.map(A=>i.jsxs("button",{type:"button",onClick:()=>{u(A),c("")},className:ie("rounded-md border px-3 py-2 text-sm font-medium transition-colors",o===A?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted"),children:["$",A]},A))})]}),i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsx(Oe,{htmlFor:"custom-amount",className:"text-xs text-muted-foreground",children:"Or enter a custom amount"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:"$"}),i.jsx(ae,{id:"custom-amount",type:"number",min:"1",step:"1",placeholder:"0.00",className:"pl-7",value:d,onChange:A=>{c(A.target.value),u(null)}})]})]}),x&&i.jsx("p",{className:"text-xs text-destructive",children:x}),i.jsxs("div",{className:"flex items-center justify-between pt-1",children:[i.jsxs("p",{className:"text-xs text-muted-foreground",children:["Current limit:"," ",i.jsx("span",{className:"font-medium text-foreground",children:Z(a)})]}),i.jsx(Y,{onClick:b,disabled:P||!j||j<=0,className:"gap-2",children:P?"Generating...":"Continue"})]})]})]}),e[12]=f,e[13]=a,e[14]=d,e[15]=j,e[16]=x,e[17]=b,e[18]=P,e[19]=o,e[20]=N):N=e[20];let C;return e[21]!==p||e[22]!==r||e[23]!==N?(C=i.jsx(Wt,{open:r,onOpenChange:p,children:N}),e[21]=p,e[22]=r,e[23]=N,e[24]=C):C=e[24],C}function Rs(t){const e=L.c(22),{estimation:r}=t;if(!r)return null;const{estimatedDaysRemaining:n,estimatedDepletionDate:s,avgDailySpend:a}=r;if(n==null)return null;let l;e[0]!==s?(l=s?new Date(s).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):null,e[0]=s,e[1]=l):l=e[1];const o=l,u=n!==1?"s":"";let d;e[2]!==n||e[3]!==u?(d=i.jsxs("span",{className:"tabular-nums font-medium text-foreground",children:["~",n," day",u," ","remaining"]}),e[2]=n,e[3]=u,e[4]=d):d=e[4];let c;e[5]!==o?(c=o&&i.jsxs("span",{children:["(until ",o,")"]}),e[5]=o,e[6]=c):c=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx("span",{className:"text-muted-foreground/60",children:"|"}),e[7]=f):f=e[7];let m;e[8]!==a?(m=Z(a),e[8]=a,e[9]=m):m=e[9];let x;e[10]!==m?(x=i.jsxs("span",{className:"tabular-nums",children:["avg ",m,"/day"]}),e[10]=m,e[11]=x):x=e[11];let h;e[12]!==r.resetsBeforeDepletion?(h=r.resetsBeforeDepletion&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-muted-foreground/60",children:"|"}),i.jsx("span",{className:"text-green-600 dark:text-green-400",children:"Resets before depletion"})]}),e[12]=r.resetsBeforeDepletion,e[13]=h):h=e[13];const g=Fs[r.confidence];let y;e[14]!==g?(y=i.jsx(ur,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-4 font-normal",children:g}),e[14]=g,e[15]=y):y=e[15];let S;return e[16]!==y||e[17]!==d||e[18]!==c||e[19]!==x||e[20]!==h?(S=i.jsxs("div",{className:"mt-3 flex items-center gap-2 flex-wrap text-xs text-muted-foreground",children:[d,c,f,x,h,y]}),e[16]=y,e[17]=d,e[18]=c,e[19]=x,e[20]=h,e[21]=S):S=e[21],S}function Ws(t){const e=L.c(26),{available:r,total:n,estimation:s,onAddCredit:a}=t,l=n>0?Math.max(0,Math.min(100,(n-r)/n*100)):0;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Available Credit"}),e[0]=o):o=e[0];let u;e[1]!==r?(u=Z(r),e[1]=r,e[2]=u):u=e[2];let d;e[3]!==u?(d=i.jsx("p",{className:"text-3xl font-bold tabular-nums text-foreground tracking-tight",children:u}),e[3]=u,e[4]=d):d=e[4];let c;e[5]!==n?(c=n>0&&i.jsxs("p",{className:"text-xs text-muted-foreground",children:["of ",Z(n)," total"]}),e[5]=n,e[6]=c):c=e[6];let f;e[7]!==d||e[8]!==c?(f=i.jsxs("div",{className:"flex flex-col gap-1",children:[o,d,c]}),e[7]=d,e[8]=c,e[9]=f):f=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(Jt,{size:16}),e[10]=m):m=e[10];let x;e[11]!==a?(x=i.jsxs(Y,{onClick:a,className:"gap-2 px-5",children:[m,"Add Credit"]}),e[11]=a,e[12]=x):x=e[12];let h;e[13]!==f||e[14]!==x?(h=i.jsxs("div",{className:"flex items-center justify-between",children:[f,x]}),e[13]=f,e[14]=x,e[15]=h):h=e[15];let g;e[16]!==r||e[17]!==n||e[18]!==l?(g=n>0&&i.jsxs("div",{className:"mt-4",children:[i.jsx("div",{className:"h-1.5 w-full rounded-full bg-muted overflow-hidden",children:i.jsx("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:`${l}%`}})}),i.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[Z(Math.max(0,n-r))," used"]})]}),e[16]=r,e[17]=n,e[18]=l,e[19]=g):g=e[19];let y;e[20]!==s?(y=i.jsx(Rs,{estimation:s}),e[20]=s,e[21]=y):y=e[21];let S;return e[22]!==y||e[23]!==h||e[24]!==g?(S=i.jsxs("div",{className:"relative overflow-hidden rounded-xl border border-border bg-gradient-to-br from-card via-card to-muted/30 p-6",children:[h,g,y]}),e[22]=y,e[23]=h,e[24]=g,e[25]=S):S=e[25],S}function Gs(t){const e=L.c(54),{connectionId:r,alert:n}=t,{org:s}=X(),[a,l]=v.useState(n.enabled),[o,u]=v.useState(String(n.threshold_usd)),[d,c]=v.useState(n.email??""),[f,m]=v.useState(!1),[x,h]=v.useState(null);let g;e[0]!==r||e[1]!==s.id?(g={connectionId:r,orgId:s.id},e[0]=r,e[1]=s.id,e[2]=g):g=e[2];const y=Se(g);let S;e[3]!==y?(S={client:y},e[3]=y,e[4]=S):S=e[4];const{mutate:w,isPending:P}=mr(S),j=a!==n.enabled||o!==String(n.threshold_usd)||d!==(n.email??"");let p;e[5]!==d||e[6]!==a||e[7]!==w||e[8]!==o?(p=()=>{h(null),m(!1);const se=parseFloat(o);if(a&&(!d||!d.includes("@"))){h("A valid email is required to enable alerts.");return}if(Number.isNaN(se)||se<=0){h("Threshold must be a positive number.");return}w({name:"GATEWAY_SET_ALERT",arguments:{enabled:a,threshold_usd:se,...d?{email:d}:{}}},{onSuccess:()=>{m(!0),setTimeout(()=>m(!1),3e3)},onError:Tr=>{h(Tr.message??"Failed to save alert config.")}})},e[5]=d,e[6]=a,e[7]=w,e[8]=o,e[9]=p):p=e[9];const b=p;let k;e[10]===Symbol.for("react.memo_cache_sentinel")?(k=i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(bi,{size:16,className:"text-muted-foreground"}),i.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Low-Balance Alert"})]}),e[10]=k):k=e[10];let N;e[11]!==a?(N=i.jsxs("div",{className:"flex items-center justify-between",children:[k,i.jsx(_e,{checked:a,onCheckedChange:l})]}),e[11]=a,e[12]=N):N=e[12];const C=!a&&"opacity-50 pointer-events-none";let A;e[13]!==C?(A=ie("flex flex-col gap-3 transition-opacity",C),e[13]=C,e[14]=A):A=e[14];let O;e[15]===Symbol.for("react.memo_cache_sentinel")?(O=i.jsx(Oe,{htmlFor:"alert-threshold",className:"text-xs text-muted-foreground",children:"Alert threshold"}),e[15]=O):O=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=i.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:"$"}),e[16]=_):_=e[16];let E;e[17]===Symbol.for("react.memo_cache_sentinel")?(E=se=>u(se.target.value),e[17]=E):E=e[17];let I;e[18]!==o?(I=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[O,i.jsxs("div",{className:"relative",children:[_,i.jsx(ae,{id:"alert-threshold",type:"number",min:"1",step:"1",className:"pl-7",value:o,onChange:E})]})]}),e[18]=o,e[19]=I):I=e[19];let z;e[20]===Symbol.for("react.memo_cache_sentinel")?(z=i.jsx(Oe,{htmlFor:"alert-email",className:"text-xs text-muted-foreground",children:"Email"}),e[20]=z):z=e[20];let F;e[21]===Symbol.for("react.memo_cache_sentinel")?(F=se=>c(se.target.value),e[21]=F):F=e[21];let $;e[22]!==d?($=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[z,i.jsx(ae,{id:"alert-email",type:"email",placeholder:"you@example.com",value:d,onChange:F})]}),e[22]=d,e[23]=$):$=e[23];let D;e[24]!==I||e[25]!==$?(D=i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[I,$]}),e[24]=I,e[25]=$,e[26]=D):D=e[26];let T;e[27]!==x?(T=x&&i.jsx("p",{className:"text-xs text-destructive",children:x}),e[27]=x,e[28]=T):T=e[28];let B;e[29]!==a||e[30]!==o?(B=a?`Notify when credit drops below ${Z(parseFloat(o)||0)}`:"Alerts are disabled",e[29]=a,e[30]=o,e[31]=B):B=e[31];let M;e[32]!==B?(M=i.jsx("p",{className:"text-xs text-muted-foreground",children:B}),e[32]=B,e[33]=M):M=e[33];let te;e[34]!==f?(te=f&&i.jsx("span",{className:"text-xs text-green-600 dark:text-green-400",children:"Saved"}),e[34]=f,e[35]=te):te=e[35];const Pe=P||!j,Ce=P?"Saving...":"Save";let he;e[36]!==b||e[37]!==Pe||e[38]!==Ce?(he=i.jsx(Y,{size:"sm",variant:"outline",onClick:b,disabled:Pe,children:Ce}),e[36]=b,e[37]=Pe,e[38]=Ce,e[39]=he):he=e[39];let xe;e[40]!==te||e[41]!==he?(xe=i.jsxs("div",{className:"flex items-center gap-2",children:[te,he]}),e[40]=te,e[41]=he,e[42]=xe):xe=e[42];let pe;e[43]!==M||e[44]!==xe?(pe=i.jsxs("div",{className:"flex items-center justify-between",children:[M,xe]}),e[43]=M,e[44]=xe,e[45]=pe):pe=e[45];let ge;e[46]!==D||e[47]!==T||e[48]!==pe||e[49]!==A?(ge=i.jsxs("div",{className:A,children:[D,T,pe]}),e[46]=D,e[47]=T,e[48]=pe,e[49]=A,e[50]=ge):ge=e[50];let De;return e[51]!==ge||e[52]!==N?(De=i.jsxs("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-5",children:[N,ge]}),e[51]=ge,e[52]=N,e[53]=De):De=e[53],De}const Tt={day:"Daily",week:"Weekly",month:"Monthly"},Us={day:"daily",week:"weekly",month:"monthly"},Ks={amount:{label:"Spend",color:"var(--chart-1)"}};function qs(t){const e=L.c(38),{usage:r}=t,[n,s]=v.useState("day");let a;e[0]!==n||e[1]!==r?(a=$s(n,r),e[0]=n,e[1]=r,e[2]=a):a=e[2];const l=a,o=r[Us[n]];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Usage"}),e[3]=u):u=e[3];let d;e[4]!==o?(d=Z(o),e[4]=o,e[5]=d):d=e[5];let c;e[6]!==d?(c=i.jsx("p",{className:"text-2xl font-bold tabular-nums text-foreground tracking-tight",children:d}),e[6]=d,e[7]=c):c=e[7];const f=n==="day"?"today":n==="week"?"this week":"this month";let m;e[8]!==f?(m=i.jsx("p",{className:"text-xs text-muted-foreground",children:f}),e[8]=f,e[9]=m):m=e[9];let x;e[10]!==c||e[11]!==m?(x=i.jsxs("div",{className:"flex items-baseline gap-2",children:[c,m]}),e[10]=c,e[11]=m,e[12]=x):x=e[12];let h;e[13]!==r.total?(h=Z(r.total),e[13]=r.total,e[14]=h):h=e[14];let g;e[15]!==h?(g=i.jsxs("p",{className:"text-xs text-muted-foreground tabular-nums",children:[h," all-time"]}),e[15]=h,e[16]=g):g=e[16];let y;e[17]!==x||e[18]!==g?(y=i.jsxs("div",{className:"flex flex-col gap-0.5",children:[u,x,g]}),e[17]=x,e[18]=g,e[19]=y):y=e[19];let S;e[20]===Symbol.for("react.memo_cache_sentinel")?(S=Object.keys(Tt),e[20]=S):S=e[20];let w;e[21]!==n?(w=i.jsx("div",{className:"flex items-center rounded-md border border-border bg-muted/50 p-0.5",children:S.map(E=>i.jsx("button",{type:"button",onClick:()=>s(E),className:ie("px-2.5 py-1 text-xs font-medium rounded-sm transition-colors",n===E?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:Tt[E]},E))}),e[21]=n,e[22]=w):w=e[22];let P;e[23]!==y||e[24]!==w?(P=i.jsxs("div",{className:"flex items-center justify-between",children:[y,w]}),e[23]=y,e[24]=w,e[25]=P):P=e[25];let j;e[26]===Symbol.for("react.memo_cache_sentinel")?(j={top:4,right:4,bottom:0,left:0},e[26]=j):j=e[26];let p,b,k,N;e[27]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx("defs",{children:i.jsxs("linearGradient",{id:"fillAmount",x1:"0",y1:"0",x2:"0",y2:"1",children:[i.jsx("stop",{offset:"5%",stopColor:"var(--color-amount)",stopOpacity:.3}),i.jsx("stop",{offset:"95%",stopColor:"var(--color-amount)",stopOpacity:0})]})}),b=i.jsx(vr,{vertical:!1,strokeDasharray:"3 3"}),k=i.jsx(_r,{dataKey:"date",tickLine:!1,axisLine:!1,tickMargin:8,fontSize:11}),N=i.jsx(Or,{tickLine:!1,axisLine:!1,tickMargin:4,fontSize:11,tickFormatter:Hs}),e[27]=p,e[28]=b,e[29]=k,e[30]=N):(p=e[27],b=e[28],k=e[29],N=e[30]);let C,A;e[31]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(gi,{content:i.jsx(vi,{formatter:Ys})}),A=i.jsx(Cr,{type:"monotone",dataKey:"amount",stroke:"var(--color-amount)",fill:"url(#fillAmount)",strokeWidth:2}),e[31]=C,e[32]=A):(C=e[31],A=e[32]);let O;e[33]!==l?(O=i.jsx(yi,{config:Ks,className:"h-[280px] w-full",children:i.jsxs(Ls,{data:l,margin:j,children:[p,b,k,N,C,A]})}),e[33]=l,e[34]=O):O=e[34];let _;return e[35]!==P||e[36]!==O?(_=i.jsxs("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-5",children:[P,O]}),e[35]=P,e[36]=O,e[37]=_):_=e[37],_}function Ys(t){return Z(t)}function Hs(t){return`$${t}`}function Vs(t){const e=L.c(37),{connectionId:r}=t,{org:n}=X(),[s,a]=v.useState(!1);let l;e[0]!==r||e[1]!==n.id?(l={connectionId:r,orgId:n.id},e[0]=r,e[1]=n.id,e[2]=l):l=e[2];const o=Se(l);let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u={},e[3]=u):u=e[3];let d;e[4]!==o?(d={client:o,toolName:"GATEWAY_USAGE",toolArguments:u,staleTime:3e4,select:Xs},e[4]=o,e[5]=d):d=e[5];const{data:c,isLoading:f}=ji(d);if(f){let z;return e[6]===Symbol.for("react.memo_cache_sentinel")?(z=i.jsx(Er,{}),e[6]=z):z=e[6],z}const m=c?.limit.remaining??0,x=c?.limit.total??0;let h;e[7]!==c?.usage?(h=c?.usage??{total:0,daily:0,weekly:0,monthly:0},e[7]=c?.usage,e[8]=h):h=e[8];const g=h,y=c?.billing.mode??"prepaid",S=c?.estimation??null;let w;e[9]!==c?.alert?(w=c?.alert??{enabled:!1,threshold_usd:10,email:null},e[9]=c?.alert,e[10]=w):w=e[10];const P=w,j=x;let p;e[11]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Billing"}),e[11]=p):p=e[11];let b;e[12]!==y?(b=y==="postpaid"&&i.jsx(ur,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-4 font-normal capitalize",children:"Postpaid"}),e[12]=y,e[13]=b):b=e[13];let k;e[14]!==b?(k=i.jsxs("div",{className:"flex items-center gap-2",children:[p,b]}),e[14]=b,e[15]=k):k=e[15];let N;e[16]===Symbol.for("react.memo_cache_sentinel")?(N=()=>a(!0),e[16]=N):N=e[16];let C;e[17]!==m||e[18]!==S||e[19]!==x?(C=i.jsx(Ws,{available:m,total:x,estimation:S,onAddCredit:N}),e[17]=m,e[18]=S,e[19]=x,e[20]=C):C=e[20];let A;e[21]!==g?(A=i.jsx(qs,{usage:g}),e[21]=g,e[22]=A):A=e[22];const O=`${P.enabled}-${P.threshold_usd}-${P.email}`;let _;e[23]!==P||e[24]!==r||e[25]!==O?(_=i.jsx(Gs,{connectionId:r,alert:P},O),e[23]=P,e[24]=r,e[25]=O,e[26]=_):_=e[26];let E;e[27]!==s||e[28]!==r||e[29]!==j?(E=i.jsx(Bs,{open:s,onOpenChange:a,connectionId:r,currentLimitUsd:j}),e[27]=s,e[28]=r,e[29]=j,e[30]=E):E=e[30];let I;return e[31]!==C||e[32]!==A||e[33]!==_||e[34]!==E||e[35]!==k?(I=i.jsxs(i.Fragment,{children:[k,C,A,_,E]}),e[31]=C,e[32]=A,e[33]=_,e[34]=E,e[35]=k,e[36]=I):I=e[36],I}function Xs(t){return t.structuredContent}function Er(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex flex-col gap-6",children:[i.jsxs("div",{children:[i.jsx(re,{className:"h-5 w-32"}),i.jsx(re,{className:"h-4 w-64 mt-1.5"})]}),i.jsx(re,{className:"h-28 rounded-xl"}),i.jsx(re,{className:"h-[260px] rounded-lg"})]}),t[0]=e):e=t[0],e}function Ir(){const t=L.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{children:[i.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Billing"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Monitor usage and manage credits for your organization."})]}),t[0]=e):e=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("div",{className:"flex items-center justify-center size-10 rounded-full bg-muted",children:i.jsx(rt,{size:20,className:"text-muted-foreground"})}),t[1]=r):r=t[1];let n;return t[2]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{className:"flex flex-col gap-6",children:[e,i.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-12 rounded-lg border border-dashed border-border",children:[r,i.jsxs("div",{className:"text-center",children:[i.jsx("p",{className:"text-sm font-medium text-foreground",children:"No AI Gateway configured"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-[300px]",children:"Install the Deco AI Gateway MCP to start tracking usage and managing credits."})]})]})]}),t[2]=n):n=t[2],n}class Qs extends v.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,r){}render(){return this.state.hasError?i.jsx(Ir,{}):this.props.children}}function Js(){const t=L.c(5),e=Qt();let r;t[0]!==e?(r=e.find(Zs),t[0]=e,t[1]=r):r=t[1];const n=r;if(!n?.id){let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(Ir,{}),t[2]=a):a=t[2],a}let s;return t[3]!==n.id?(s=i.jsx(i.Fragment,{children:i.jsx(Vs,{connectionId:n.id})}),t[3]=n.id,t[4]=s):s=t[4],s}function Zs(t){return Vr(t.connection_url)}function el(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"flex flex-col gap-6",children:i.jsx(Qs,{children:i.jsx(v.Suspense,{fallback:i.jsx(Er,{}),children:i.jsx(Js,{})})})}),t[0]=e):e=t[0],e}function Dr(){const t=L.c(3);let e,r;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(re,{className:"h-6 w-48"}),r=i.jsx(re,{className:"h-4 w-80"}),t[0]=e,t[1]=r):(e=t[0],r=t[1]);let n;return t[2]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{className:"flex flex-col gap-4 pt-2",children:[e,r,i.jsxs("div",{className:"mt-4 flex flex-col gap-3",children:[i.jsx(re,{className:"h-12 w-full"}),i.jsx(re,{className:"h-12 w-full"})]})]}),t[2]=n):n=t[2],n}function zt(t){const e=L.c(14),{projectSlug:r,children:n}=t,{org:s}=X(),{data:a,isLoading:l}=Bt(s.id,r);if(l||!a){let f;return e[0]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(Dr,{}),e[0]=f):f=e[0],f}const o=r===ee;let u;e[1]!==a.description||e[2]!==a.enabledPlugins||e[3]!==a.id||e[4]!==a.name||e[5]!==a.organizationId||e[6]!==a.slug||e[7]!==a.ui||e[8]!==o?(u={id:a.id,organizationId:a.organizationId,slug:a.slug,name:a.name,description:a.description,enabledPlugins:a.enabledPlugins,ui:a.ui,isOrgAdmin:o},e[1]=a.description,e[2]=a.enabledPlugins,e[3]=a.id,e[4]=a.name,e[5]=a.organizationId,e[6]=a.slug,e[7]=a.ui,e[8]=o,e[9]=u):u=e[9];const d=u;let c;return e[10]!==n||e[11]!==d||e[12]!==s?(c=i.jsx(Mt,{org:s,project:d,children:n}),e[10]=n,e[11]=d,e[12]=s,e[13]=c):c=e[13],c}function tl(t){const e=L.c(20),{section:r}=t;let n;e[0]!==r?(n=Ut(r),e[0]=r,e[1]=n):n=e[1];const s=n;if(s){let a;e[2]!==s.sub?(a=s.sub==="general"&&i.jsx(Bi,{}),e[2]=s.sub,e[3]=a):a=e[3];let l;e[4]!==s.sub?(l=s.sub==="plugins"&&i.jsx(jt,{}),e[4]=s.sub,e[5]=l):l=e[5];let o;e[6]!==s.sub?(o=s.sub==="danger"&&i.jsx(Hi,{}),e[6]=s.sub,e[7]=o):o=e[7];let u;return e[8]!==s.slug||e[9]!==a||e[10]!==l||e[11]!==o?(u=i.jsxs(zt,{projectSlug:s.slug,children:[a,l,o]}),e[8]=s.slug,e[9]=a,e[10]=l,e[11]=o,e[12]=u):u=e[12],u}switch(r){case"account.profile":{let a;return e[13]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(Pi,{}),e[13]=a):a=e[13],a}case"account.preferences":{let a;return e[14]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(yt,{}),e[14]=a):a=e[14],a}case"account.experimental":{let a;return e[15]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(Ei,{}),e[15]=a):a=e[15],a}case"org.general":{let a;return e[16]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(zi,{}),e[16]=a):a=e[16],a}case"org.plugins":{let a;return e[17]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(zt,{projectSlug:ee,children:i.jsx(jt,{})}),e[17]=a):a=e[17],a}case"org.billing":{let a;return e[18]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(el,{}),e[18]=a):a=e[18],a}default:{let a;return e[19]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(yt,{}),e[19]=a):a=e[19],a}}}function rl(){const t=L.c(23),{isOpen:e,activeSection:r,open:n,close:s}=Hr();let a;t[0]!==s?(a=y=>!y&&s(),t[0]=s,t[1]=a):a=t[1];let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"w-52 shrink-0 border-r border-border"}),t[2]=l):l=t[2];let o;t[3]!==r||t[4]!==n?(o=i.jsx(v.Suspense,{fallback:l,children:i.jsx(Ni,{activeSection:r,onNavigate:n})}),t[3]=r,t[4]=n,t[5]=o):o=t[5];let u,d;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(Gt,{size:16}),d=i.jsx("span",{className:"sr-only",children:"Close"}),t[6]=u,t[7]=d):(u=t[6],d=t[7]);let c;t[8]!==s?(c=i.jsxs("button",{type:"button",onClick:s,className:"absolute top-4 right-4 rounded-md p-1 opacity-70 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-ring",children:[u,d]}),t[8]=s,t[9]=c):c=t[9];let f;t[10]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(Dr,{}),t[10]=f):f=t[10];let m;t[11]!==r?(m=i.jsx(v.Suspense,{fallback:f,children:i.jsx(tl,{section:r})}),t[11]=r,t[12]=m):m=t[12];let x;t[13]!==c||t[14]!==m?(x=i.jsxs("div",{className:"flex-1 overflow-y-auto p-8 min-w-0 relative",children:[c,m]}),t[13]=c,t[14]=m,t[15]=x):x=t[15];let h;t[16]!==o||t[17]!==x?(h=i.jsx(Rt,{className:"sm:max-w-[1100px] h-[85vh] p-0 overflow-hidden flex flex-col gap-0",closeButtonClassName:"hidden",children:i.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[o,x]})}),t[16]=o,t[17]=x,t[18]=h):h=t[18];let g;return t[19]!==e||t[20]!==a||t[21]!==h?(g=i.jsx(Wt,{open:e,onOpenChange:a,children:h}),t[19]=e,t[20]=a,t[21]=h,t[22]=g):g=t[22],g}function nl(t){const e=L.c(12),{projectSlug:r,orgSlug:n,error:s}=t,a=$e();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("h1",{className:"text-xl font-semibold",children:"Failed to load project"}),e[0]=l):l=e[0];let o;e[1]!==r?(o=i.jsxs("p",{className:"text-muted-foreground text-center",children:['There was an error loading the project "',r,'".']}),e[1]=r,e[2]=o):o=e[2];let u;e[3]!==s.message?(u=i.jsx("p",{className:"text-sm text-muted-foreground",children:s.message}),e[3]=s.message,e[4]=u):u=e[4];let d;e[5]!==a||e[6]!==n?(d=i.jsx(Y,{variant:"link",onClick:()=>a({to:"/$org/$project",params:{org:n,project:ee}}),children:"Go to organization home"}),e[5]=a,e[6]=n,e[7]=d):d=e[7];let c;return e[8]!==o||e[9]!==u||e[10]!==d?(c=i.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[l,o,u,d]}),e[8]=o,e[9]=u,e[10]=d,e[11]=c):c=e[11],c}function il(t){const e=L.c(9),{projectSlug:r,orgSlug:n}=t,s=$e();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx("h1",{className:"text-xl font-semibold",children:"Project not found"}),e[0]=a):a=e[0];let l;e[1]!==r?(l=i.jsxs("p",{className:"text-muted-foreground text-center",children:['The project "',r,'" does not exist in this organization.']}),e[1]=r,e[2]=l):l=e[2];let o;e[3]!==s||e[4]!==n?(o=i.jsx(Y,{variant:"link",onClick:()=>s({to:"/$org/$project",params:{org:n,project:ee}}),children:"Go to organization home"}),e[3]=s,e[4]=n,e[5]=o):o=e[5];let u;return e[6]!==l||e[7]!==o?(u=i.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[a,l,o]}),e[6]=l,e[7]=o,e[8]=u):u=e[8],u}function al(){const t=L.c(23);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const r=$r(e),{org:n}=X(),s=r.org,a=r.project,{data:l,isLoading:o,error:u}=Bt(n.id,a);if(o){let g;return t[1]===Symbol.for("react.memo_cache_sentinel")?(g=i.jsx(Ye,{}),t[1]=g):g=t[1],g}if(u){let g;return t[2]!==u||t[3]!==s||t[4]!==a?(g=i.jsx(nl,{projectSlug:a,orgSlug:s,error:u}),t[2]=u,t[3]=s,t[4]=a,t[5]=g):g=t[5],g}if(!l){let g;return t[6]!==s||t[7]!==a?(g=i.jsx(il,{projectSlug:a,orgSlug:s}),t[6]=s,t[7]=a,t[8]=g):g=t[8],g}const d=l.slug===ee;let c;t[9]!==l.description||t[10]!==l.enabledPlugins||t[11]!==l.id||t[12]!==l.name||t[13]!==l.organizationId||t[14]!==l.slug||t[15]!==l.ui||t[16]!==d?(c={id:l.id,organizationId:l.organizationId,slug:l.slug,name:l.name,description:l.description,enabledPlugins:l.enabledPlugins,ui:l.ui,isOrgAdmin:d},t[9]=l.description,t[10]=l.enabledPlugins,t[11]=l.id,t[12]=l.name,t[13]=l.organizationId,t[14]=l.slug,t[15]=l.ui,t[16]=d,t[17]=c):c=t[17];const f=c;let m,x;t[18]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(v.Suspense,{fallback:i.jsx(Ye,{}),children:i.jsx(Fr,{})}),x=i.jsx(rl,{}),t[18]=m,t[19]=x):(m=t[18],x=t[19]);let h;return t[20]!==f||t[21]!==n?(h=i.jsxs(Mt,{org:n,project:f,children:[m,x]}),t[20]=f,t[21]=n,t[22]=h):h=t[22],h}function Ql(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(v.Suspense,{fallback:i.jsx(Ye,{}),children:i.jsx(al,{})}),t[0]=e):e=t[0],e}export{Ql as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{r as z,c as _,j as s,u as le,b as Ce,by as _e,L as Ie,bF as xt,bG as ht,O as V,H as gt,e as Oe,d as ce,t as ae,bH as jt,b6 as bt,m as Nt,A as yt,S as He,f as vt,h as St,N as kt,n as Ct,K as _t,aD as Ue,P as wt}from"./index-DwBgLSti.js";import{C as X}from"./index-QQ-XmLlG.js";import{I as $t}from"./integration-icon-qV_BsBQR.js";import{P as me,u as Ge,d as ie,e as ee,f as we,g as ge,h as je,i as We,j as zt,k as It,l as Be,m as Pt,n as At,o as Ot,p as Tt}from"./index-B_nMIrSY.js";import{u as Te,C as Mt,f as Et,g as Lt}from"./use-deco-chat-open-CxG3qwlT.js";import{c as G,B as Se}from"./button-D6YZfFzy.js";import{d as Dt,u as Ft}from"./constants-8URKDp4Y.js";import{T as Rt,i as Ht,b as Ut}from"./typewriter-title-DqLjhGgL.js";import{s as xe}from"./Plus-DNqvDLOK.js";import{t as Me}from"./Users03-C1B58zTV.js";import{i as Pe,a as Gt,b as Wt,T as Bt}from"./tooltip-D71dCz4E.js";import{E as qe}from"./error-boundary-lFjWy2-n.js";import{b as qt,i as Vt}from"./context-DHicyHl4.js";import{C as Ve}from"./create-project-dialog-BjqZAjhY.js";import{u as $e,S as Z}from"./skeleton-DNLZ4Kho.js";import{t as Ke,u as Qe}from"./use-settings-modal-Dx8IF1Gs.js";import{n as De}from"./CheckDone01-BrxNvWbF.js";import{n as Kt}from"./Container-jfv9L6Hc.js";import{e as Qt}from"./Dataflow03-C6KAN8vb.js";import{a as Yt}from"./Home02-Doo3wLuN.js";import{t as ke}from"./Settings01-DKXbh8uh.js";import{a as Ye,u as Ze}from"./use-project-CXHCn5kp.js";import{t as Je}from"./ChevronDown-CggIFEVQ.js";import{A as ue}from"./avatar-BNKSN34R.js";import{c as Q,g as he,d as Zt,e as Jt,f as Xt,b as Xe,D as et,a as tt}from"./dropdown-menu-CRT7qGQ9.js";import{i as fe}from"./Check-Bv0pZ3gl.js";import{C as es}from"./create-organization-dialog-Cb3EQpzl.js";import{a as ts}from"./Copy01-Dq7Edhtu.js";import{i as st}from"./File06-2US99J_V.js";import{i as ss}from"./Globe01-Dxe6Kj1c.js";import{n as pe}from"./LinkExternal01-DAvzaXYE.js";import{i as rs}from"./Shield01-B89AcbSX.js";import{a as ns,P as is,b as os}from"./popover-pjzQQlLd.js";import{i as ls,a as as}from"./deco-constants-CyaJG-D1.js";import{n as Fe}from"./Inbox01-BweXezQd.js";import{s as cs}from"./XClose-Dgr_gyyv.js";import{h as ds}from"./use-connection-BEGrPCmR.js";import{b as ms}from"./use-mcp-tools-BAsmCzEJ.js";import{u as rt,a as us}from"./use-organization-settings-BJ9tNAL9.js";import{i as fs}from"./ChevronRight-DgAfR8pA.js";import{u as Ee,L as Le}from"./localstorage-keys-Ct4C992S.js";import{R as ps,a as nt,b as xs}from"./resizable-jXkpfiVS.js";import"./spinner-DZtD-MX0.js";import"./use-mcp-prompts-qD8uHlkj.js";import"./useQuery-CPsXfVfR.js";import"./dialog-DSPMVHyJ.js";import"./form-BMtUcs2k.js";import"./label-29qY4FPs.js";import"./input-B7id4I1j.js";import"./usage-B8eRkRZY.js";import"./ArrowUp-G8RCE5_O.js";import"./Edit01-DRruZKzG.js";import"./XCircle-DneNZUk0.js";import"./AlertCircle-BzYW4X7z.js";import"./AlertTriangle-DniGvpwb.js";import"./ArrowLeft-dS1h2Fqu.js";import"./use-copy-DsHlaDHD.js";import"./badge-Do8iK9u9.js";import"./Code01-DP2jwP0n.js";import"./use-virtual-mcp-DBzFAk7J.js";import"./SearchMd-BLcaRHQs.js";import"./use-create-virtual-mcp-BzTARjrD.js";import"./marked.esm-BaswSlok.js";import"./markdown-jp5pFlBz.js";import"./Eye-B9ZDOUkE.js";import"./Globe02-BPmEw10H.js";import"./select-CkeKfTEx.js";import"./empty-state-sMx3NP6e.js";import"./generate-id-Dyweu44Y.js";import"./Clock-IA7N95Qq.js";import"./Trash01-CkTOgej8.js";import"./use-mobile-Bs0AkxK7.js";import"./collection-search-CBYSITVU.js";import"./Loading01-BHMOj-H5.js";import"./decopilot-events-Brt4gAR6.js";import"./use-llm-BbYG_RIr.js";import"./use-binding-DbH4Xe03.js";import"./binder-BBB8LQyx.js";import"./Grid01-CJW4ZLO5.js";import"./Image01-C9h8llDV.js";import"./RefreshCcw01-4dzpBOob.js";import"./useSuspenseInfiniteQuery-CuH1Eku2.js";import"./infiniteQueryObserver-Yvt0ZTml.js";import"./useMutation-DgG1LVg-.js";import"./textarea-GWXLFYfv.js";import"./alert-dialog-BvNipqK_.js";const it=({size:t=24,color:e="currentColor",...r})=>z.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},z.createElement("path",{d:"M9 7H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 7.76 3 8.04 3 8.6v10.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 21 4.04 21 4.6 21H9m0 0h6m-6 0V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C9.76 3 10.04 3 10.6 3h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C15 3.76 15 4.04 15 4.6V21m0-10h4.4c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C21 11.76 21 12.04 21 12.6v6.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C20.24 21 19.96 21 19.4 21H15"}));it.displayName="BarChart10";const ot=({size:t=24,color:e="currentColor",...r})=>z.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},z.createElement("path",{d:"M8 14s1.5 2 4 2 4-2 4-2m-1-5h.01M9 9h.01M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-6.5-3a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Zm-6 0a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Z"}));ot.displayName="FaceSmile";const lt=({size:t=24,color:e="currentColor",...r})=>z.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},z.createElement("path",{d:"m16 17 5-5m0 0-5-5m5 5H9m0-9H7.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 21H9"}));lt.displayName="LogOut01";const at=({size:t=24,color:e="currentColor",...r})=>z.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},z.createElement("path",{d:"M8 9.5h4M8 13h7m-3 8a9 9 0 1 0-8.342-5.616c.081.2.122.3.14.381a.907.907 0 0 1 .024.219c0 .083-.015.173-.045.353l-.593 3.558c-.062.373-.093.56-.035.694a.5.5 0 0 0 .262.262c.135.058.321.027.694-.035l3.558-.593c.18-.03.27-.045.353-.045.081 0 .14.006.219.024.08.018.18.059.38.14A8.973 8.973 0 0 0 12 21Z"}));at.displayName="MessageTextCircle02";function hs(){const t=_.c(65),{org:e}=le(),[,r]=Te(),{selectedVirtualMcp:o,modelsConnections:i,isChatEmpty:l,activeThreadId:n,createThread:a,switchToThread:m,threads:c}=qt();let d;if(t[0]!==n||t[1]!==c){let U;t[3]!==n?(U=B=>B.id===n,t[3]=n,t[4]=U):U=t[4],d=c.find(U),t[0]=n,t[1]=c,t[2]=d}else d=t[2];const f=d,[u,g]=z.useState(!1),[x,h]=z.useTransition();let j;t[5]!==e.id?(j=Dt(e.id),t[5]=e.id,t[6]=j):j=t[6];const p=o??j;let N;t[7]!==a?(N=()=>{h(()=>{a()})},t[7]=a,t[8]=N):N=t[8];const S=N;if(i.length===0){let U;t[9]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(me.Header.Left,{className:"gap-2"}),t[9]=U):U=t[9];let B;t[10]!==r?(B=()=>r(!1),t[10]=r,t[11]=B):B=t[11];let k;t[12]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Pe,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[12]=k):k=t[12];let q;t[13]!==B?(q=s.jsxs(me.Header,{className:"flex-none",hideSidebarTrigger:!0,children:[U,s.jsx(me.Header.Right,{className:"gap-1",children:s.jsx("button",{type:"button",onClick:B,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:k})})]}),t[13]=B,t[14]=q):q=t[14];let ne;t[15]!==e?(ne=s.jsx(X.Main,{className:"flex flex-col items-center",children:s.jsx(X.EmptyState,{children:s.jsx(X.NoLlmBindingEmptyState,{title:"No model provider connected",description:"Connect to a model provider to unlock AI-powered features.",org:e})})}),t[15]=e,t[16]=ne):ne=t[16];let de;return t[17]!==q||t[18]!==ne?(de=s.jsxs(X,{className:"animate-in fade-in-0 duration-200",children:[q,ne]}),t[17]=q,t[18]=ne,t[19]=de):de=t[19],de}const v=u?"duration-300 opacity-0 -translate-x-4 pointer-events-none":x?"duration-150 opacity-0 pointer-events-none":"duration-300 opacity-100 translate-x-0";let C;t[20]!==v?(C=G("absolute inset-0 flex flex-col transition-[opacity,transform] ease-[var(--ease-out-quart)]",v),t[20]=v,t[21]=C):C=t[21];let y;t[22]!==f||t[23]!==l?(y=!l&&f?.title&&s.jsx(Rt,{text:f.title,className:"text-sm font-medium text-foreground"}),t[22]=f,t[23]=l,t[24]=y):y=t[24];let I;t[25]!==y?(I=s.jsx(me.Header.Left,{className:"gap-2",children:y}),t[25]=y,t[26]=I):I=t[26];let T;t[27]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(xe,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[27]=T):T=t[27];let E;t[28]!==S||t[29]!==x?(E=s.jsx("button",{type:"button",onClick:S,disabled:x,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",title:"New chat",children:T}),t[28]=S,t[29]=x,t[30]=E):E=t[30];let M;t[31]===Symbol.for("react.memo_cache_sentinel")?(M=()=>g(!0),t[31]=M):M=t[31];let W;t[32]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx("button",{type:"button",onClick:M,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",title:"Chat history",children:s.jsx(Ht,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})}),t[32]=W):W=t[32];let D;t[33]!==r?(D=()=>r(!1),t[33]=r,t[34]=D):D=t[34];let F;t[35]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(Pe,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[35]=F):F=t[35];let P;t[36]!==D?(P=s.jsx("button",{type:"button",onClick:D,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:F}),t[36]=D,t[37]=P):P=t[37];let L;t[38]!==P||t[39]!==E?(L=s.jsxs(me.Header.Right,{className:"gap-1",children:[E,W,P]}),t[38]=P,t[39]=E,t[40]=L):L=t[40];let $;t[41]!==L||t[42]!==I?($=s.jsxs(me.Header,{className:"flex-none",hideSidebarTrigger:!0,children:[I,L]}),t[41]=L,t[42]=I,t[43]=$):$=t[43];let A;t[44]!==p||t[45]!==l?(A=s.jsx(X.Main,{children:l?s.jsx(X.EmptyState,{children:s.jsxs("div",{className:"flex flex-col items-center gap-6 w-full px-4",children:[s.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-0 text-center",children:[s.jsx($t,{icon:p.icon,name:p.title,size:"lg",fallbackIcon:s.jsx(Me,{size:32}),className:"size-[60px]! rounded-[18px]!"}),s.jsx("h3",{className:"text-xl font-medium text-foreground",children:p.title}),s.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:p.description??"Ask anything about configuring model providers or using MCP Mesh."})]}),s.jsx(X.IceBreakers,{})]})}):s.jsx(X.Messages,{})}),t[44]=p,t[45]=l,t[46]=A):A=t[46];let O;t[47]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(X.Footer,{children:s.jsx(X.Input,{})}),t[47]=O):O=t[47];let R;t[48]!==$||t[49]!==A||t[50]!==C?(R=s.jsxs("div",{className:C,children:[$,A,O]}),t[48]=$,t[49]=A,t[50]=C,t[51]=R):R=t[51];const re=u?"opacity-100 translate-x-0":"opacity-0 translate-x-4 pointer-events-none";let te;t[52]!==re?(te=G("absolute inset-0 flex flex-col transition-[opacity,transform] duration-300 ease-[var(--ease-out-quart)]",re),t[52]=re,t[53]=te):te=t[53];let se;t[54]===Symbol.for("react.memo_cache_sentinel")?(se=()=>g(!1),t[54]=se):se=t[54];let K;t[55]!==n||t[56]!==m||t[57]!==c?(K=s.jsx(Ut,{threads:c,activeThreadId:n,onThreadSelect:m,onClose:se}),t[55]=n,t[56]=m,t[57]=c,t[58]=K):K=t[58];let H;t[59]!==te||t[60]!==K?(H=s.jsx("div",{className:te,children:K}),t[59]=te,t[60]=K,t[61]=H):H=t[61];let Y;return t[62]!==R||t[63]!==H?(Y=s.jsxs(X,{className:"relative overflow-hidden animate-in fade-in-0 duration-200",children:[R,H]}),t[62]=R,t[63]=H,t[64]=Y):Y=t[64],Y}function gs(){const t=_.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(X.Skeleton,{}),t[0]=e):e=t[0];let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(qe,{fallback:e,children:s.jsx(z.Suspense,{fallback:s.jsx(X.Skeleton,{}),children:s.jsx(hs,{})})}),t[1]=r):r=t[1],r}function js(){const t=_.c(54),[e]=$e(),{locator:r,org:o}=le(),i=Ce(),l=_e(),{org:n,project:a}=Ie.parse(r),m=Ie.isOrgAdminProject(r),{data:c}=Ye(o.id,a);let d;t[0]!==c?.enabledPlugins?(d=c?.enabledPlugins??[],t[0]=c?.enabledPlugins,t[1]=d):d=t[1];const f=d;let u;t[2]!==f?(u=w=>f.includes(w.pluginId),t[2]=f,t[3]=u):u=t[3];const g=xt.filter(u),x=l.location.pathname,h=`/${n}/${a}`,j=x===h||x===`${h}/`;let b;t[4]!==h||t[5]!==x?(b=w=>x.startsWith(`${h}/${w}`),t[4]=h,t[5]=x,t[6]=b):b=t[6];const p=b;let N;t[7]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(Yt,{}),t[7]=N):N=t[7];const S={key:"home",label:"Home",icon:N,isActive:j,onClick:()=>{j?window.dispatchEvent(new CustomEvent("reset-home-view")):i({to:"/$org/$project",params:{org:n,project:a}})}};let v;t[8]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(De,{}),t[8]=v):v=t[8];const C={key:"tasks",label:"Tasks",icon:v,isActive:p("tasks"),onClick:()=>i({to:"/$org/$project/tasks",params:{org:n,project:V}})};let y;t[9]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Kt,{}),t[9]=y):y=t[9];const I={key:"mcps",label:"Connections",icon:y,isActive:p("mcps"),onClick:()=>i({to:"/$org/$project/mcps",params:{org:n,project:V}})};let T;t[10]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(gt,{}),t[10]=T):T=t[10];const E={key:"projects",label:"Projects",icon:T,isActive:p("projects"),onClick:()=>i({to:"/$org/$project/projects",params:{org:n,project:V}})};let M;t[11]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx(Ke,{}),t[11]=M):M=t[11];const W={key:"store",label:"Store",icon:M,isActive:p("store"),onClick:()=>i({to:"/$org/$project/store",params:{org:n,project:V}})};let D;t[12]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(Me,{}),t[12]=D):D=t[12];const F={key:"agents",label:"Agents",icon:D,isActive:p("agents"),onClick:()=>i({to:"/$org/$project/agents",params:{org:n,project:V}})};let P;t[13]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(it,{}),t[13]=P):P=t[13];const L={key:"monitoring",label:"Monitor",icon:P,isActive:p("monitoring"),onClick:()=>i({to:"/$org/$project/monitoring",params:{org:n,project:V}})};let $;t[14]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx(ot,{}),t[14]=$):$=t[14];const A={key:"members",label:"Members",icon:$,isActive:p("members"),onClick:()=>i({to:"/$org/$project/members",params:{org:n,project:V}})},O=g.map(w=>({key:w.pluginId,label:w.label,icon:w.icon,isActive:p(w.pluginId),onClick:()=>i({to:"/$org/$project/$pluginId",params:{org:n,project:a,pluginId:w.pluginId}})}));let R;t[15]!==f?(R=w=>f.includes(w.pluginId),t[15]=f,t[16]=R):R=t[16];const te=ht.filter(R).map(w=>({type:"group",group:{id:`${w.pluginId}-${w.id}`,label:w.label,items:w.items.map((J,oe)=>({key:`${w.pluginId}-${w.id}-${oe}`,label:J.label,icon:J.icon,isActive:p(w.pluginId),onClick:()=>i({to:"/$org/$project/$pluginId",params:{org:n,project:a,pluginId:w.pluginId}})})),defaultExpanded:w.defaultExpanded??!0}}));if(m){let w;t[17]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(ke,{}),t[17]=w):w=t[17];let J;t[18]!==p?(J=p("settings"),t[18]=p,t[19]=J):J=t[19];let oe;t[20]!==i||t[21]!==n?(oe=()=>i({to:"/$org/$project/settings",params:{org:n,project:V}}),t[20]=i,t[21]=n,t[22]=oe):oe=t[22];let ye;t[23]!==J||t[24]!==oe?(ye={key:"settings",label:"Settings",icon:w,isActive:J,onClick:oe},t[23]=J,t[24]=oe,t[25]=ye):ye=t[25];const pt=ye,ze=[{type:"items",items:[S,...e.experimental_tasks?[C]:[],...e.experimental_projects?[E]:[]]},{type:"group",group:{id:"build",label:"Build",items:[F,I,W],defaultExpanded:!0}},{type:"group",group:{id:"manage",label:"Manage",items:[L,A,pt],defaultExpanded:!0}}];if(O.length>0){let ve;t[26]!==O?(ve={type:"items",items:O},t[26]=O,t[27]=ve):ve=t[27],ze.push(ve)}return te.length>0&&ze.push(...te),ze}let se;t[28]===Symbol.for("react.memo_cache_sentinel")?(se=s.jsx(De,{}),t[28]=se):se=t[28];let K;t[29]!==p?(K=p("tasks"),t[29]=p,t[30]=K):K=t[30];let H;t[31]!==i||t[32]!==n||t[33]!==a?(H=()=>i({to:"/$org/$project/tasks",params:{org:n,project:a}}),t[31]=i,t[32]=n,t[33]=a,t[34]=H):H=t[34];let Y;t[35]!==K||t[36]!==H?(Y={key:"tasks",label:"Tasks",icon:se,isActive:K,onClick:H},t[35]=K,t[36]=H,t[37]=Y):Y=t[37];const U=Y;let B;t[38]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(Qt,{}),t[38]=B):B=t[38];let k;t[39]!==p?(k=p("workflows"),t[39]=p,t[40]=k):k=t[40];let q;t[41]!==i||t[42]!==n||t[43]!==a?(q=()=>i({to:"/$org/$project/workflows",params:{org:n,project:a}}),t[41]=i,t[42]=n,t[43]=a,t[44]=q):q=t[44];let ne;t[45]!==k||t[46]!==q?(ne={key:"workflows",label:"Workflows",icon:B,isActive:k,onClick:q},t[45]=k,t[46]=q,t[47]=ne):ne=t[47];const de=ne;let be;t[48]!==e.experimental_tasks||t[49]!==U?(be=e.experimental_tasks?[U]:[],t[48]=e.experimental_tasks,t[49]=U,t[50]=be):be=t[50];const Ne=[{type:"items",items:[S,...be,de]}];if(O.length>0){let w;t[51]===Symbol.for("react.memo_cache_sentinel")?(w={type:"divider"},t[51]=w):w=t[51],Ne.push(w);let J;t[52]!==O?(J={type:"items",items:O},t[52]=O,t[53]=J):J=t[53],Ne.push(J)}return te.length>0&&Ne.push(...te),Ne}function bs(t){const e=_.c(11),{label:r,children:o,defaultExpanded:i}=t,l=i===void 0?!0:i,[n,a]=z.useState(l),{state:m}=Ge(),c=m==="collapsed";let d;e[0]!==n||e[1]!==c||e[2]!==r?(d=c?s.jsx("div",{className:"flex h-6 items-center",children:s.jsx("div",{className:"h-0.5 w-8 rounded-full bg-sidebar-foreground/15"})}):s.jsx(ie,{children:s.jsx(ee,{children:s.jsxs(we,{className:"h-6 cursor-pointer select-none gap-1 [&>svg]:size-3",onClick:()=>a(!n),children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:r}),s.jsx(Je,{size:12,className:G("text-muted-foreground transition-transform duration-200",!n&&"-rotate-90")})]})})}),e[0]=n,e[1]=c,e[2]=r,e[3]=d):d=e[3];let f;e[4]!==o||e[5]!==n||e[6]!==c?(f=(c||n)&&s.jsx(ge,{children:s.jsx(ie,{className:"gap-0.5",children:o})}),e[4]=o,e[5]=n,e[6]=c,e[7]=f):f=e[7];let u;return e[8]!==d||e[9]!==f?(u=s.jsxs(je,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[d,f]}),e[8]=d,e[9]=f,e[10]=u):u=e[10],u}function ct(t){const e=_.c(13),{item:r}=t;let o;e[0]!==r.icon?(o=s.jsx("span",{className:"[&>svg]:size-4",children:r.icon}),e[0]=r.icon,e[1]=o):o=e[1];let i;e[2]!==r.label?(i=s.jsx("span",{className:"truncate group-data-[collapsible=icon]:hidden",children:r.label}),e[2]=r.label,e[3]=i):i=e[3];let l;e[4]!==r.isActive||e[5]!==r.label||e[6]!==r.onClick||e[7]!==o||e[8]!==i?(l=s.jsxs(we,{onClick:r.onClick,isActive:r.isActive,tooltip:r.label,children:[o,i]}),e[4]=r.isActive,e[5]=r.label,e[6]=r.onClick,e[7]=o,e[8]=i,e[9]=l):l=e[9];let n;return e[10]!==r.key||e[11]!==l?(n=s.jsx(ee,{children:l},r.key),e[10]=r.key,e[11]=l,e[12]=n):n=e[12],n}function Ns(t){const e=_.c(12),{section:r}=t;switch(r.type){case"divider":{let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(We,{className:"my-2"}),e[0]=o):o=e[0],o}case"spacer":{let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1"}),e[1]=o):o=e[1],o}case"group":{const o=r.group.label,i=r.group.defaultExpanded;let l;e[2]!==r.group.items?(l=r.group.items.map(vs),e[2]=r.group.items,e[3]=l):l=e[3];let n;return e[4]!==r.group.defaultExpanded||e[5]!==r.group.label||e[6]!==l?(n=s.jsx(bs,{label:o,defaultExpanded:i,children:l}),e[4]=r.group.defaultExpanded,e[5]=r.group.label,e[6]=l,e[7]=n):n=e[7],n}case"items":{let o;e[8]!==r.items?(o=r.items.map(ys),e[8]=r.items,e[9]=o):o=e[9];let i;return e[10]!==o?(i=s.jsx(je,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(ge,{children:s.jsx(ie,{className:"gap-0.5",children:o})})}),e[10]=o,e[11]=i):i=e[11],i}}}function ys(t){return s.jsx(ct,{item:t},t.key)}function vs(t){return s.jsx(ct,{item:t},t.key)}function dt(t){const e=_.c(14),{sections:r,header:o,footer:i,additionalContent:l,variant:n,collapsible:a,contentClassName:m}=t,c=n===void 0?"sidebar":n,d=a===void 0?"icon":a;let f;e[0]!==m?(f=G("flex flex-col flex-1 overflow-x-hidden mt-1 px-3.5 pb-2 group-data-[collapsible=icon]:px-2",m),e[0]=m,e[1]=f):f=e[1];let u;e[2]!==r?(u=r.map(Ss),e[2]=r,e[3]=u):u=e[3];let g;e[4]!==l||e[5]!==f||e[6]!==u?(g=s.jsxs(zt,{className:f,children:[u,l]}),e[4]=l,e[5]=f,e[6]=u,e[7]=g):g=e[7];let x;return e[8]!==d||e[9]!==i||e[10]!==o||e[11]!==g||e[12]!==c?(x=s.jsxs(It,{variant:c,collapsible:d,children:[o,g,i]}),e[8]=d,e[9]=i,e[10]=o,e[11]=g,e[12]=c,e[13]=x):x=e[13],x}function Ss(t,e){return s.jsx(Ns,{section:t},e)}dt.Skeleton=function(){return s.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,r)=>s.jsx("div",{className:"w-full h-8",children:s.jsx(Z,{className:"h-full bg-sidebar-accent rounded-md"})},r))})};function ks(){const t=_.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"space-y-0.5 px-1 py-1",children:[s.jsx(Z,{className:"h-8 w-full rounded-lg"}),s.jsx(Z,{className:"h-8 w-full rounded-lg"})]}),t[0]=e):e=t[0],e}function Cs(t){const e=_.c(12),{organizationId:r,currentProjectSlug:o,onSelect:i}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={suspense:!0},e[0]=l):l=e[0];const{data:n}=Ze(r,l);let a,m;if(e[1]!==o||e[2]!==i||e[3]!==n){m=Symbol.for("react.early_return_sentinel");e:{const d=n?.filter(_s)??[];if(d.length===0){let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("div",{className:"px-2 py-3 text-center text-xs text-muted-foreground",children:"No projects yet"}),e[6]=u):u=e[6],m=u;break e}let f;e[7]!==o||e[8]!==i?(f=u=>{const g=o===u.slug,x=u.ui?.themeColor??"#3B82F6";return s.jsxs(Q,{className:G("gap-2.5",g&&"bg-accent"),onClick:()=>i(u.slug),children:[s.jsx("div",{className:"size-6 rounded-md shrink-0 flex items-center justify-center overflow-hidden border border-border/50",style:{backgroundColor:x},children:u.ui?.icon?s.jsx("img",{src:u.ui.icon,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"text-xs font-semibold text-white",children:u.name.charAt(0).toUpperCase()})}),s.jsx("span",{className:"flex-1 truncate",children:u.name}),g&&s.jsx(fe,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},u.id)},e[7]=o,e[8]=i,e[9]=f):f=e[9],a=d.map(f)}e[1]=o,e[2]=i,e[3]=n,e[4]=a,e[5]=m}else a=e[4],m=e[5];if(m!==Symbol.for("react.early_return_sentinel"))return m;let c;return e[10]!==a?(c=s.jsx(s.Fragment,{children:a}),e[10]=a,e[11]=c):c=e[11],c}function _s(t){return t.slug!==V}function ws(t){let e=0;for(let o=0;o<t.length;o++)e=t.charCodeAt(o)+((e<<5)-e);const r=Math.abs(e)%360;return{backgroundColor:`hsl(${r} 55% 70%)`,color:`hsl(${r} 55% 20%)`}}function mt(t){const e=_.c(44),{isCollapsed:r,onCreateProject:o}=t,i=r===void 0?!1:r;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},e[0]=l):l=e[0];const{org:n,project:a}=Oe(l),{data:m}=ce.useListOrganizations(),c=Ce(),d=m?.find(k=>k.slug===n),[f,u]=z.useState(!1),[g]=$e(),x=g.experimental_projects,h=a===V,{data:j}=Ye(d?.id??"",h?"":a??"");let b;e[1]!==n?(b=(k,q)=>k.slug===n?-1:q.slug===n?1:k.name.localeCompare(q.name),e[1]=n,e[2]=b):b=e[2];const p=[...m??[]].sort(b);let N;e[3]!==c||e[4]!==n?(N=()=>{n&&c({to:"/$org/$project",params:{org:n,project:V}})},e[3]=c,e[4]=n,e[5]=N):N=e[5];const S=N;let v;e[6]!==c||e[7]!==n?(v=k=>{n&&c({to:"/$org/$project",params:{org:n,project:k}})},e[6]=c,e[7]=n,e[8]=v):v=e[8];const C=v;let y;e[9]!==c?(y=k=>{c({to:"/$org/$project",params:{org:k,project:V}})},e[9]=c,e[10]=y):y=e[10];const I=y;let T;e[11]!==o?(T=o?()=>o():void 0,e[11]=o,e[12]=T):T=e[12];const E=T;let M;e[13]!==c||e[14]!==n||e[15]!==a?(M=()=>{if(!n||!a)return;const k=a===V;c({to:"/$org/$project",params:{org:n,project:a},search:q=>({...q,settings:k?"org.general":`project:${a}:general`})})},e[13]=c,e[14]=n,e[15]=a,e[16]=M):M=e[16];const W=M,D=et,F=i?"w-auto pr-1.5":"w-full";let P;e[17]!==F?(P=G("flex items-center gap-3 rounded-md p-1.5 pr-2 text-left hover:bg-sidebar-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring min-h-[2.75rem]",F),e[17]=F,e[18]=P):P=e[18];const L=h?s.jsx("div",{className:G("shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden transition-[width,height] duration-300 ease-[var(--ease-out-quart)]",i?"size-6":"size-8"),style:d?.logo?void 0:ws(d?.name??""),children:d?.logo?s.jsx("img",{src:d.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:G("font-semibold leading-none",i?"text-[9px]":"text-xs"),children:(d?.name??"?").slice(0,2).toUpperCase()})}):s.jsx("div",{className:G("shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden transition-[width,height] duration-300 ease-[var(--ease-out-quart)]",i?"size-6":"size-8"),style:{backgroundColor:j?.ui?.themeColor??"#60a5fa"},children:j?.ui?.icon?s.jsx("img",{src:j.ui.icon,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:G("font-semibold text-white",i?"text-xs":"text-lg"),children:(j?.name??a??"?").charAt(0).toUpperCase()})});let $;e[19]!==d?.name||e[20]!==j?.name||e[21]!==x||e[22]!==i||e[23]!==h||e[24]!==a?($=!i&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:x?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"block text-[11px] text-sidebar-foreground/50 leading-tight truncate",children:d?.name??"Select org"}),s.jsx("span",{className:"block text-sm font-semibold text-sidebar-foreground truncate leading-tight",children:h?"Studio":j?.name??a??""})]}):s.jsx("span",{className:"block text-sm font-semibold text-sidebar-foreground truncate leading-tight",children:d?.name??"Select org"})}),s.jsx(Vt,{size:16,className:"shrink-0 text-sidebar-foreground/40"})]}),e[19]=d?.name,e[20]=j?.name,e[21]=x,e[22]=i,e[23]=h,e[24]=a,e[25]=$):$=e[25];let A;e[26]!==P||e[27]!==L||e[28]!==$?(A=s.jsx(tt,{asChild:!0,children:s.jsxs("button",{type:"button",className:P,children:[L,$]})}),e[26]=P,e[27]=L,e[28]=$,e[29]=A):A=e[29];const O=Xe,R="start",re="bottom",te="w-64 flex flex-col gap-0.5",se=$s,K=x?s.jsxs(s.Fragment,{children:[s.jsxs(Q,{className:G("gap-2.5",h&&"bg-accent"),onClick:S,children:[s.jsx(ue,{url:d?.logo??"",fallback:d?.name??"",size:"sm",className:"size-6 rounded-md shrink-0",objectFit:"cover"}),s.jsxs("span",{className:"flex-1 truncate",children:["Studio · ",d?.name]}),h&&s.jsx(fe,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]}),s.jsx("p",{className:"px-2 pt-2 pb-0.5 text-[11px] font-medium text-muted-foreground/50 uppercase tracking-wider",children:"Projects"}),d&&s.jsx(z.Suspense,{fallback:s.jsx(ks,{}),children:s.jsx(Cs,{organizationId:d.id,currentProjectSlug:a,orgSlug:n??"",onSelect:C})}),E&&s.jsxs(Q,{className:"gap-2.5",onClick:E,children:[s.jsx(xe,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Create project"})]}),s.jsx(he,{}),s.jsxs(Zt,{children:[s.jsxs(Jt,{className:"gap-2.5",children:[s.jsx(Ke,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Switch organization"})]}),s.jsxs(Xt,{className:"w-48 flex flex-col gap-0.5",children:[p.map(k=>s.jsxs(Q,{className:G("gap-2.5",k.slug===n&&"bg-accent"),onClick:()=>I(k.slug),children:[s.jsx(ue,{url:k.logo??"",fallback:k.name,size:"xs",className:"size-5 rounded-md shrink-0",objectFit:"cover"}),s.jsx("span",{className:"flex-1 truncate",children:k.name}),k.slug===n&&s.jsx(fe,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},k.id)),s.jsx(he,{}),s.jsxs(Q,{className:"gap-2.5",onClick:()=>u(!0),children:[s.jsx(xe,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Create organization"})]})]})]}),s.jsxs(Q,{className:"gap-2.5",onClick:W,children:[s.jsx(ke,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Settings"})]})]}):s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"px-2 pt-2 pb-0.5 text-[11px] font-medium text-muted-foreground/50 uppercase tracking-wider",children:"Organizations"}),p.map(k=>s.jsxs(Q,{className:G("gap-2.5",k.slug===n&&"bg-accent"),onClick:()=>I(k.slug),children:[s.jsx(ue,{url:k.logo??"",fallback:k.name,size:"sm",className:"size-6 rounded-md shrink-0",objectFit:"cover"}),s.jsx("span",{className:"flex-1 truncate",children:k.name}),k.slug===n&&s.jsx(fe,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},k.id)),s.jsxs(Q,{className:"gap-2.5",onClick:()=>u(!0),children:[s.jsx(xe,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Create organization"})]}),s.jsx(he,{}),s.jsxs(Q,{className:"gap-2.5",onClick:W,children:[s.jsx(ke,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Settings"})]})]});let H;e[30]!==O||e[31]!==se||e[32]!==K?(H=s.jsx(O,{align:R,side:re,className:te,onCloseAutoFocus:se,children:K}),e[30]=O,e[31]=se,e[32]=K,e[33]=H):H=e[33];let Y;e[34]!==D||e[35]!==A||e[36]!==H?(Y=s.jsxs(D,{children:[A,H]}),e[34]=D,e[35]=A,e[36]=H,e[37]=Y):Y=e[37];let U;e[38]!==f||e[39]!==u?(U=s.jsx(es,{open:f,onOpenChange:u}),e[38]=f,e[39]=u,e[40]=U):U=e[40];let B;return e[41]!==Y||e[42]!==U?(B=s.jsxs(s.Fragment,{children:[Y,U]}),e[41]=Y,e[42]=U,e[43]=B):B=e[43],B}function $s(t){return t.preventDefault()}mt.Skeleton=function(){return s.jsxs("div",{className:"flex items-center gap-1.5 h-7 px-1.5 w-full",children:[s.jsx(Z,{className:"size-5 rounded-[5px] shrink-0 bg-sidebar-accent"}),s.jsx(Z,{className:"h-3.5 flex-1 bg-sidebar-accent"})]})};function Ae(t){const e=_.c(23),{onCreateProject:r}=t,{state:o}=Ge(),i=o==="collapsed",[l,n]=Te();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const{org:m,project:c}=Oe(a),{location:d}=_e(),f=d.pathname===`/${m}/${c}`||d.pathname===`/${m}/${c}/`;let u;e[1]!==n?(u=()=>{n(zs)},e[1]=n,e[2]=u):u=e[2];const g=u;let x;e[3]!==i||e[4]!==r?(x=s.jsx("div",{className:"min-w-0 flex-1",children:s.jsx(mt,{isCollapsed:i,onCreateProject:r})}),e[3]=i,e[4]=r,e[5]=x):x=e[5];const h=i||f?"max-w-0 opacity-0 pointer-events-none":"max-w-[2rem] opacity-100";let j;e[6]!==h?(j=G("flex items-center gap-0.5 shrink-0 overflow-hidden transition-[max-width,opacity] duration-300 ease-[var(--ease-out-quart)]",h),e[6]=h,e[7]=j):j=e[7];const b=l&&"bg-sidebar-accent text-sidebar-foreground";let p;e[8]!==b?(p=G("size-7 hover:bg-sidebar-accent text-sidebar-foreground/50 hover:text-sidebar-foreground",b),e[8]=b,e[9]=p):p=e[9];let N;e[10]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(at,{size:14,className:"text-inherit"}),e[10]=N):N=e[10];let S;e[11]!==p||e[12]!==g?(S=s.jsx(Gt,{asChild:!0,children:s.jsx(Se,{variant:"ghost",size:"icon",className:p,onClick:g,"aria-label":"Toggle Decopilot",children:N})}),e[11]=p,e[12]=g,e[13]=S):S=e[13];let v;e[14]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(Wt,{side:"bottom",children:"Toggle Decopilot"}),e[14]=v):v=e[14];let C;e[15]!==S?(C=s.jsxs(Bt,{children:[S,v]}),e[15]=S,e[16]=C):C=e[16];let y;e[17]!==C||e[18]!==j?(y=s.jsx("div",{className:j,children:C}),e[17]=C,e[18]=j,e[19]=y):y=e[19];let I;return e[20]!==y||e[21]!==x?(I=s.jsx(Be,{className:"px-3 group-data-[collapsible=icon]:px-2 animate-in fade-in-0 duration-200",children:s.jsx(ie,{children:s.jsx(ee,{children:s.jsxs("div",{className:"flex items-center justify-between w-full gap-1",children:[x,y]})})})}),e[20]=y,e[21]=x,e[22]=I):I=e[22],I}function zs(t){return!t}Ae.Skeleton=function(){return s.jsx(Be,{className:"px-3",children:s.jsx(ie,{children:s.jsx(ee,{children:s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1 p-1.5",children:[s.jsx(Z,{className:"size-8 rounded-md shrink-0 bg-sidebar-accent"}),s.jsx(Z,{className:"h-3.5 w-16 bg-sidebar-accent"})]}),s.jsxs("div",{className:"flex items-center gap-0.5",children:[s.jsx(Z,{className:"size-7 rounded-lg bg-sidebar-accent"}),s.jsx(Z,{className:"size-7 rounded-lg bg-sidebar-accent"})]})]})})})})};function Is(t){const e=_.c(49),{user:r,userImage:o}=t,{open:i}=Qe(),[l,n]=z.useState(!1);let a;e[0]!==r.email||e[1]!==r.id||e[2]!==r.name?(a=()=>{const R=`ID: ${r.id}
|
|
2
|
-
Name: ${r.name||"N/A"}
|
|
3
|
-
Email: ${r.email}`;navigator.clipboard.writeText(R),n(!0),ae.success("User info copied to clipboard"),setTimeout(()=>n(!1),2e3)},e[0]=r.email,e[1]=r.id,e[2]=r.name,e[3]=a):a=e[3];const m=a,c=r.name||r.email||"U";let d;e[4]!==c||e[5]!==o?(d=s.jsx(ue,{url:o,fallback:c,shape:"circle",size:"2xs",className:"shrink-0 size-5"}),e[4]=c,e[5]=o,e[6]=d):d=e[6];const f=r.name||"User";let u;e[7]!==f?(u=s.jsx("div",{className:"flex-1 min-w-0 group-data-[collapsible=icon]:hidden",children:s.jsx("div",{className:"text-sm font-medium truncate text-sidebar-foreground leading-none",children:f})}),e[7]=f,e[8]=u):u=e[8];let g;e[9]!==d||e[10]!==u?(g=s.jsx(tt,{asChild:!0,children:s.jsxs("button",{className:"flex w-full h-8 items-center gap-2 rounded-md px-1 hover:bg-sidebar-accent transition-colors text-left min-w-0",children:[d,u]})}),e[9]=d,e[10]=u,e[11]=g):g=e[11];const x=r.name||r.email||"U";let h;e[12]!==x||e[13]!==o?(h=s.jsx(ue,{url:o,fallback:x,shape:"circle",size:"sm",className:"shrink-0"}),e[12]=x,e[13]=o,e[14]=h):h=e[14];const j=r.name||"User";let b;e[15]!==j?(b=s.jsx("div",{className:"text-sm font-medium truncate",children:j}),e[15]=j,e[16]=b):b=e[16];let p;e[17]!==r.email?(p=s.jsx("div",{className:"text-xs text-muted-foreground truncate",children:r.email}),e[17]=r.email,e[18]=p):p=e[18];let N;e[19]!==b||e[20]!==p?(N=s.jsxs("div",{className:"flex-1 min-w-0",children:[b,p]}),e[19]=b,e[20]=p,e[21]=N):N=e[21];let S;e[22]!==l?(S=s.jsx("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:l?s.jsx(fe,{size:14,className:"text-green-600"}):s.jsx(ts,{size:14,className:"text-muted-foreground"})}),e[22]=l,e[23]=S):S=e[23];let v;e[24]!==m||e[25]!==N||e[26]!==S||e[27]!==h?(v=s.jsxs(Q,{onClick:m,className:"gap-2.5 group",children:[h,N,S]}),e[24]=m,e[25]=N,e[26]=S,e[27]=h,e[28]=v):v=e[28];let C;e[29]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(he,{}),e[29]=C):C=e[29];let y;e[30]!==i?(y=()=>i("account.preferences"),e[30]=i,e[31]=y):y=e[31];let I,T;e[32]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(ke,{size:14,className:"shrink-0 text-muted-foreground"}),T=s.jsx("span",{children:"Settings"}),e[32]=I,e[33]=T):(I=e[32],T=e[33]);let E;e[34]!==y?(E=s.jsxs(Q,{className:"gap-2.5",onClick:y,children:[I,T]}),e[34]=y,e[35]=E):E=e[35];let M;e[36]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx(Q,{asChild:!0,children:s.jsxs("a",{href:"https://www.decocms.com/terms-of-use",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2.5 group",children:[s.jsx(st,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{className:"flex-1",children:"Terms of Use"}),s.jsx(pe,{size:14,className:"shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})}),e[36]=M):M=e[36];let W;e[37]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx(Q,{asChild:!0,children:s.jsxs("a",{href:"https://www.decocms.com/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2.5 group",children:[s.jsx(rs,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{className:"flex-1",children:"Privacy Policy"}),s.jsx(pe,{size:14,className:"shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})}),e[37]=W):W=e[37];let D;e[38]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(Q,{asChild:!0,children:s.jsxs("a",{href:"https://github.com/decocms/mesh",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2.5 group",children:[s.jsx(jt,{className:"w-3.5 h-3.5 shrink-0 text-muted-foreground"}),s.jsx("span",{className:"flex-1",children:"decocms/mesh"}),s.jsx(pe,{size:14,className:"shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})}),e[38]=D):D=e[38];let F;e[39]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(Q,{asChild:!0,children:s.jsxs("a",{href:"https://decocms.com/discord",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2.5 group",children:[s.jsx(Me,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{className:"flex-1",children:"Community"}),s.jsx(pe,{size:14,className:"shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})}),e[39]=F):F=e[39];let P,L;e[40]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(Q,{asChild:!0,children:s.jsxs("a",{href:"https://decocms.com",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2.5 group",children:[s.jsx(ss,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{className:"flex-1",children:"Homepage"}),s.jsx(pe,{size:14,className:"shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})}),L=s.jsx(he,{}),e[40]=P,e[41]=L):(P=e[40],L=e[41]);let $;e[42]===Symbol.for("react.memo_cache_sentinel")?($=s.jsxs(Q,{className:"gap-2.5",onClick:Ps,children:[s.jsx(lt,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Sign out"})]}),e[42]=$):$=e[42];let A;e[43]!==v||e[44]!==E?(A=s.jsxs(Xe,{side:"top",align:"end",collisionPadding:8,className:"w-64 flex flex-col gap-0.5",onCloseAutoFocus:As,children:[v,C,E,M,W,D,F,P,L,$]}),e[43]=v,e[44]=E,e[45]=A):A=e[45];let O;return e[46]!==A||e[47]!==g?(O=s.jsxs(et,{children:[g,A]}),e[46]=A,e[47]=g,e[48]=O):O=e[48],O}function Ps(){return ce.signOut()}function As(t){return t.preventDefault()}function ut(){const t=_.c(7),{data:e}=ce.useSession();if(!e?.user){let m;return t[0]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(ue,{url:void 0,fallback:"U",shape:"circle",size:"sm",className:"cursor-pointer h-7 w-7",muted:!0}),t[0]=m):m=t[0],m}const r=e.user,o=r.name??void 0;let i;t[1]!==o||t[2]!==r?(i={...r,name:o},t[1]=o,t[2]=r,t[3]=i):i=t[3];const l=i,n=r.image;let a;return t[4]!==n||t[5]!==l?(a=s.jsx(Is,{user:l,userImage:n}),t[4]=n,t[5]=l,t[6]=a):a=t[6],a}function Os({invitation:t}){const[e,r]=z.useState(!1),[o,i]=z.useState(!1),l=Nt(),n=async()=>{r(!0);try{const m=await ce.organization.acceptInvitation({invitationId:t.id});if(m.error)ae.error(m.error.message),r(!1);else{const c=await ce.organization.setActive({organizationId:t.organizationId});ae.success("Invitation accepted!");const d=c?.data?.slug;window.location.href=d?`/${d}`:"/"}}catch{ae.error("Failed to accept invitation"),r(!1)}},a=async()=>{i(!0);try{const m=await ce.organization.rejectInvitation({invitationId:t.id});m.error?(ae.error(m.error.message),i(!1)):(ae.success("Invitation declined"),l.invalidateQueries())}catch{ae.error("Failed to decline invitation"),i(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"You've been invited to join"}),s.jsx("p",{className:"text-sm font-medium truncate",children:t.organizationName??"Unknown organization"})]}),s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[s.jsx(Se,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:n,disabled:e||o,"aria-label":"Accept invitation",children:s.jsx(fe,{size:14})}),s.jsx(Se,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:a,disabled:e||o,"aria-label":"Decline invitation",children:s.jsx(cs,{size:14})})]})]})}function Ts(){const t=z.useContext(bt),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(o=>o.status==="pending"&&new Date(o.expiresAt)>new Date)}class Ms extends z.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,r){}render(){return this.state.hasError?null:this.props.children}}function Es(t,e){if(!e||e<=0)return"text-foreground/70";const r=t/e;return r<=.05?"text-destructive":r<=.2?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Ls(t){const e=_.c(20),{connectionId:r}=t,{open:o}=Qe(),{org:i}=le();let l;e[0]!==r||e[1]!==i.id?(l={connectionId:r,orgId:i.id},e[0]=r,e[1]=i.id,e[2]=l):l=e[2];const n=Ft(l);let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a={},e[3]=a):a=e[3];let m;e[4]!==n?(m={client:n,toolName:"GATEWAY_USAGE",toolArguments:a,staleTime:6e4,select:Ds},e[4]=n,e[5]=m):m=e[5];const{data:c}=ms(m),d=c?.limit.remaining??0,f=c?.limit.total??null;let u;e[6]!==o?(u=()=>o("org.billing"),e[6]=o,e[7]=u):u=e[7];let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(as,{size:13,className:"text-muted-foreground/60 shrink-0"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Credits"})]}),e[8]=g):g=e[8];let x;e[9]!==d||e[10]!==f?(x=G("text-xs font-medium tabular-nums",Es(d,f)),e[9]=d,e[10]=f,e[11]=x):x=e[11];let h;e[12]!==d?(h=d.toFixed(2),e[12]=d,e[13]=h):h=e[13];let j;e[14]!==x||e[15]!==h?(j=s.jsxs("span",{className:x,children:["$",h]}),e[14]=x,e[15]=h,e[16]=j):j=e[16];let b;return e[17]!==u||e[18]!==j?(b=s.jsxs("button",{type:"button",onClick:u,className:"group-data-[collapsible=icon]:hidden flex items-center justify-between w-full px-2 py-1.5 rounded-md hover:bg-sidebar-accent transition-colors",children:[g,j]}),e[17]=u,e[18]=j,e[19]=b):b=e[19],b}function Ds(t){return t.structuredContent}function Fs(){const t=_.c(4),e=ds();let r;t[0]!==e?(r=e.find(Rs),t[0]=e,t[1]=r):r=t[1];const o=r;if(!o?.id)return null;let i;return t[2]!==o.id?(i=s.jsx(Ls,{connectionId:o.id}),t[2]=o.id,t[3]=i):i=t[3],i}function Rs(t){return ls(t.connection_url)}function Hs(){const t=_.c(13),e=Ts();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Ms,{children:s.jsx(z.Suspense,{fallback:null,children:s.jsx(Fs,{})})}),t[0]=r):r=t[0];let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(ut,{})}),t[1]=o):o=t[1];let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(is,{asChild:!0,children:s.jsx(Se,{variant:"ghost",size:"icon",className:"size-8 text-sidebar-foreground/50 hover:text-sidebar-foreground hover:bg-sidebar-accent","aria-label":"Open inbox",children:s.jsx(Fe,{size:16})})}),t[2]=i):i=t[2];let l;t[3]!==e.length?(l=e.length>0&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-red-500 ring-2 ring-sidebar pointer-events-none"}),t[3]=e.length,t[4]=l):l=t[4];let n;t[5]!==l?(n=s.jsxs("div",{className:"relative",children:[i,l]}),t[5]=l,t[6]=n):n=t[6];let a;t[7]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"px-4 py-3 border-b border-border shrink-0",children:s.jsx("h3",{className:"text-sm font-medium",children:"Inbox"})}),t[7]=a):a=t[7];let m;t[8]!==e?(m=s.jsxs(ns,{side:"right",align:"end",sideOffset:24,className:"w-[400px] p-0 h-[650px] flex flex-col",children:[a,e.length===0?s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[s.jsx(Fe,{size:24,className:"text-muted-foreground/50"}),s.jsx("p",{className:"text-sm font-medium text-foreground",children:"No messages or invites pending"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Messages, workspace and project invitations will appear here"})]}):s.jsx("div",{className:"overflow-y-auto flex-1",children:e.map(Us)})]}),t[8]=e,t[9]=m):m=t[9];let c;return t[10]!==n||t[11]!==m?(c=s.jsxs(Pt,{className:"px-3.5 pb-3 group-data-[collapsible=icon]:px-2",children:[r,s.jsx(ie,{children:s.jsx(ee,{children:s.jsxs("div",{className:"flex items-center w-full gap-1",children:[o,s.jsx("div",{className:"group-data-[collapsible=icon]:hidden",children:s.jsxs(os,{children:[n,m]})})]})})})]}),t[10]=n,t[11]=m,t[12]=c):c=t[12],c}function Us(t){return s.jsx(Os,{invitation:t},t.id)}function ft(t){const e=_.c(4),{children:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(We,{className:"my-2"}),e[0]=o):o=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ee,{children:s.jsx("div",{className:"group-data-[collapsible=icon]:hidden px-2 py-0 text-xs font-medium h-6 text-muted-foreground flex items-center justify-between",children:s.jsx("span",{className:"whitespace-nowrap",children:"Pinned Views"})})}),e[1]=i):i=e[1];let l;return e[2]!==r?(l=s.jsxs(s.Fragment,{children:[o,i,r]}),e[2]=r,e[3]=l):l=e[3],l}function Gs(t){const e=_.c(26),{item:r}=t,o=Ce(),{org:i}=le(),l=rt(i.id),n=us(i.id);let a;e[0]!==n.update||e[1]!==r.url||e[2]!==l?.sidebar_items?(a=async()=>{const S=(l?.sidebar_items||[]).filter(v=>v.url!==r.url);await n.update.mutateAsync({sidebar_items:S})},e[0]=n.update,e[1]=r.url,e[2]=l?.sidebar_items,e[3]=a):a=e[3];const m=a;let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=/^https?:\/\/.+/,e[4]=c):c=e[4];let d;e[5]!==r.icon?(d=c.test(r.icon),e[5]=r.icon,e[6]=d):d=e[6];const f=d;let u;e[7]!==r.url||e[8]!==o?(u=()=>{o({to:r.url})},e[7]=r.url,e[8]=o,e[9]=u):u=e[9];const g=r.title;let x;e[10]!==f||e[11]!==r.icon||e[12]!==r.title?(x=s.jsx("div",{className:"flex items-center justify-center shrink-0",children:f?s.jsx("img",{src:r.icon,alt:r.title,className:"h-4 w-4 rounded object-cover"}):s.jsx(st,{size:16,className:"text-muted-foreground group-hover/item:text-foreground transition-colors"})}),e[10]=f,e[11]=r.icon,e[12]=r.title,e[13]=x):x=e[13];let h;e[14]!==r.title?(h=r.title.toLocaleLowerCase(),e[14]=r.title,e[15]=h):h=e[15];let j;e[16]!==h?(j=s.jsx("div",{className:"flex-1 min-w-0 flex flex-col items-start",children:s.jsx("span",{className:"truncate text-sm w-full capitalize",children:h})}),e[16]=h,e[17]=j):j=e[17];let b;e[18]!==m?(b=s.jsx(Pe,{size:16,className:"text-muted-foreground opacity-0 group-hover/item:opacity-50 hover:opacity-100 cursor-pointer",onClick:N=>{N.preventDefault(),N.stopPropagation(),m()}}),e[18]=m,e[19]=b):b=e[19];let p;return e[20]!==r.title||e[21]!==u||e[22]!==x||e[23]!==j||e[24]!==b?(p=s.jsx(ee,{children:s.jsxs(we,{className:"w-full pr-2 group/item relative cursor-pointer text-foreground/90 hover:text-foreground",onClick:u,tooltip:g,children:[x,j,b]})}),e[20]=r.title,e[21]=u,e[22]=x,e[23]=j,e[24]=b,e[25]=p):p=e[25],p}function Re(){const t=_.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ee,{children:s.jsx("div",{className:"flex items-center gap-2 px-4 py-2",children:s.jsx(Z,{className:"h-4 flex-1"})})}),t[0]=e):e=t[0],e}function Ws(){const t=_.c(4),{org:e}=le(),o=rt(e.id)?.sidebar_items;if(!o?.length)return null;let i;t[0]!==o?(i=o.map(Bs),t[0]=o,t[1]=i):i=t[1];let l;return t[2]!==i?(l=s.jsx(ft,{children:i}),t[2]=i,t[3]=l):l=t[3],l}function Bs(t){return s.jsx(Gs,{item:t},t.url)}function qs(){const t=_.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(z.Suspense,{fallback:s.jsxs(ft,{children:[s.jsx(Re,{}),s.jsx(Re,{})]}),children:s.jsx(Ws,{})}),t[0]=e):e=t[0],e}function Vs(t){const e=_.c(11),{project:r}=t,o=r.ui?.themeColor??"#60a5fa";if(r.ui?.icon){let m;return e[0]!==r.ui.icon?(m=s.jsx("img",{src:r.ui.icon,alt:"",className:"size-4 rounded object-cover border border-border/50"}),e[0]=r.ui.icon,e[1]=m):m=e[1],m}let i;e[2]!==o?(i={backgroundColor:o},e[2]=o,e[3]=i):i=e[3];let l;e[4]!==r.name?(l=r.name.charAt(0).toUpperCase(),e[4]=r.name,e[5]=l):l=e[5];let n;e[6]!==l?(n=s.jsx("span",{className:"text-[10px] font-medium text-white",children:l}),e[6]=l,e[7]=n):n=e[7];let a;return e[8]!==i||e[9]!==n?(a=s.jsx("div",{className:"size-4 rounded flex items-center justify-center border border-border/50",style:i,children:n}),e[8]=i,e[9]=n,e[10]=a):a=e[10],a}function Ks(t){const e=_.c(14),{project:r}=t,o=Ce(),{org:i}=le();let l;e[0]!==o||e[1]!==i.slug||e[2]!==r.slug?(l=()=>{o({to:"/$org/$project",params:{org:i.slug,project:r.slug}})},e[0]=o,e[1]=i.slug,e[2]=r.slug,e[3]=l):l=e[3];let n;e[4]!==r?(n=s.jsx(Vs,{project:r}),e[4]=r,e[5]=n):n=e[5];let a;e[6]!==r.name?(a=s.jsx("span",{className:"truncate flex-1 group-data-[collapsible=icon]:hidden",children:r.name}),e[6]=r.name,e[7]=a):a=e[7];let m;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(fs,{size:12,className:"text-muted-foreground opacity-0 group-hover/item:opacity-100 transition-opacity group-data-[collapsible=icon]:hidden"}),e[8]=m):m=e[8];let c;return e[9]!==r.name||e[10]!==l||e[11]!==n||e[12]!==a?(c=s.jsx(ee,{children:s.jsxs(we,{onClick:l,tooltip:r.name,children:[n,a,m]})}),e[9]=r.name,e[10]=l,e[11]=n,e[12]=a,e[13]=c):c=e[13],c}function Qs(){const t=_.c(55),{org:e}=le(),{data:r,isLoading:o}=Ze(e.id),[i,l]=z.useState(!0),[n,a]=z.useState(!1);let m,c,d,f,u,g,x,h,j,b,p,N,S;if(t[0]!==o||t[1]!==i||t[2]!==r){S=Symbol.for("react.early_return_sentinel");e:{const D=r?.filter(Zs)??[];if(o){let R;t[16]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(ee,{children:s.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[s.jsx(Z,{className:"h-4 w-4 rounded"}),s.jsx(Z,{className:"h-4 flex-1"})]})}),t[16]=R):R=t[16];let re;t[17]===Symbol.for("react.memo_cache_sentinel")?(re=s.jsx(je,{className:"py-0 px-0",children:s.jsx(ge,{children:s.jsxs(ie,{className:"gap-0.5",children:[R,s.jsx(ee,{children:s.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[s.jsx(Z,{className:"h-4 w-4 rounded"}),s.jsx(Z,{className:"h-4 flex-1"})]})})]})})}),t[17]=re):re=t[17],S=re;break e}N="group/projects-section mt-2",u=Mt,b=i,p=l,f=je,j="py-0 px-0",d=ge,c=ie,x="gap-0.5";let F;t[18]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Projects"}),t[18]=F):F=t[18];const P=!i&&"-rotate-90";let L;t[19]!==P?(L=G("text-muted-foreground shrink-0 transition-transform duration-200",P),t[19]=P,t[20]=L):L=t[20];let $;t[21]!==L?($=s.jsx(Et,{asChild:!0,children:s.jsxs("button",{type:"button",className:"flex flex-1 items-center gap-1 cursor-pointer min-w-0",children:[F,s.jsx(Je,{size:12,className:L})]})}),t[21]=L,t[22]=$):$=t[22];let A;t[23]===Symbol.for("react.memo_cache_sentinel")?(A=()=>a(!0),t[23]=A):A=t[23];let O;t[24]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx("button",{type:"button",onClick:A,title:"Create new project",className:"opacity-0 group-hover/projects-section:opacity-100 transition-opacity text-muted-foreground hover:text-foreground flex items-center justify-center h-4 rounded shrink-0",children:s.jsx(xe,{size:16})}),t[24]=O):O=t[24],t[25]!==$?(h=s.jsx(ee,{className:"group-data-[collapsible=icon]:hidden",children:s.jsxs("div",{className:"flex h-6 w-full items-center gap-1 rounded-md pl-1.5 pr-0.5 hover:bg-sidebar-accent transition-colors",children:[$,O]})}),t[25]=$,t[26]=h):h=t[26],m=Lt,g=D.length===0?s.jsx(ee,{children:s.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:"No projects yet"})}):D.map(Ys)}t[0]=o,t[1]=i,t[2]=r,t[3]=m,t[4]=c,t[5]=d,t[6]=f,t[7]=u,t[8]=g,t[9]=x,t[10]=h,t[11]=j,t[12]=b,t[13]=p,t[14]=N,t[15]=S}else m=t[3],c=t[4],d=t[5],f=t[6],u=t[7],g=t[8],x=t[9],h=t[10],j=t[11],b=t[12],p=t[13],N=t[14],S=t[15];if(S!==Symbol.for("react.early_return_sentinel"))return S;let v;t[27]!==m||t[28]!==g?(v=s.jsx(m,{children:g}),t[27]=m,t[28]=g,t[29]=v):v=t[29];let C;t[30]!==c||t[31]!==x||t[32]!==h||t[33]!==v?(C=s.jsxs(c,{className:x,children:[h,v]}),t[30]=c,t[31]=x,t[32]=h,t[33]=v,t[34]=C):C=t[34];let y;t[35]!==d||t[36]!==C?(y=s.jsx(d,{children:C}),t[35]=d,t[36]=C,t[37]=y):y=t[37];let I;t[38]!==f||t[39]!==y||t[40]!==j?(I=s.jsx(f,{className:j,children:y}),t[38]=f,t[39]=y,t[40]=j,t[41]=I):I=t[41];let T;t[42]!==u||t[43]!==I||t[44]!==b||t[45]!==p?(T=s.jsx(u,{open:b,onOpenChange:p,children:I}),t[42]=u,t[43]=I,t[44]=b,t[45]=p,t[46]=T):T=t[46];let E;t[47]!==T||t[48]!==N?(E=s.jsx("div",{className:N,children:T}),t[47]=T,t[48]=N,t[49]=E):E=t[49];let M;t[50]!==n?(M=s.jsx(Ve,{open:n,onOpenChange:a}),t[50]=n,t[51]=M):M=t[51];let W;return t[52]!==E||t[53]!==M?(W=s.jsxs(s.Fragment,{children:[E,M]}),t[52]=E,t[53]=M,t[54]=W):W=t[54],W}function Ys(t){return s.jsx(Ks,{project:t},t.id)}function Zs(t){return t.slug!==V}function Js(){const t=_.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(z.Suspense,{fallback:s.jsx(je,{className:"py-0 px-0",children:s.jsx(ge,{children:s.jsx(ie,{className:"gap-0.5",children:s.jsx(ee,{children:s.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[s.jsx(Z,{className:"h-4 w-4 rounded"}),s.jsx(Z,{className:"h-4 flex-1"})]})})})})}),children:s.jsx(Qs,{})}),t[0]=e):e=t[0],e}function Xs(t){const e=_.c(15),{onCreateProject:r}=t,[o]=$e(),i=js(),{locator:l}=le();let n;e[0]!==l?(n=Ie.isOrgAdminProject(l),e[0]=l,e[1]=n):n=e[1];const a=n;let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Ae.Skeleton,{}),e[2]=m):m=e[2];let c;e[3]!==r?(c=s.jsx(z.Suspense,{fallback:m,children:s.jsx(Ae,{onCreateProject:r})}),e[3]=r,e[4]=c):c=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Hs,{}),e[5]=d):d=e[5];let f;e[6]!==a||e[7]!==o?(f=a?o.experimental_projects?s.jsx(Js,{}):null:s.jsx(qs,{}),e[6]=a,e[7]=o,e[8]=f):f=e[8];let u;e[9]!==f?(u=s.jsx(qe,{children:s.jsx(z.Suspense,{fallback:null,children:f})}),e[9]=f,e[10]=u):u=e[10];let g;return e[11]!==i||e[12]!==c||e[13]!==u?(g=s.jsx(dt,{sections:i,header:c,footer:d,additionalContent:u}),e[11]=i,e[12]=c,e[13]=u,e[14]=g):g=e[14],g}function er(){const t=_.c(2),r=_e().location.href;let o;return t[0]!==r?(o=s.jsx(kt,{to:"/login",search:{next:r},replace:!0}),t[0]=r,t[1]=o):o=t[1],o}function tr(t){const e=_.c(6),{children:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(yt,{children:s.jsx(He,{})}),e[0]=o):o=e[0];let i;e[1]!==r?(i=s.jsx(vt,{children:r}),e[1]=r,e[2]=i):i=e[2];let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(St,{children:s.jsx(er,{})}),e[3]=l):l=e[3];let n;return e[4]!==i?(n=s.jsxs(s.Fragment,{children:[o,i,l]}),e[4]=i,e[5]=n):n=e[5],n}function sr(t){const e=_.c(10),{children:r,className:o}=t,[,i]=z.useTransition();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=Le.decoChatPanelWidth(),e[0]=l):l=e[0];const[n,a]=Ee(l,30);let m;e[1]!==a?(m=u=>i(()=>a(u)),e[1]=a,e[2]=m):m=e[2];const c=m;let d;e[3]!==o?(d=G("min-w-0",o),e[3]=o,e[4]=d):d=e[4];let f;return e[5]!==n||e[6]!==r||e[7]!==c||e[8]!==d?(f=s.jsx(nt,{defaultSize:n,minSize:20,className:d,onResize:c,children:r}),e[5]=n,e[6]=r,e[7]=c,e[8]=d,e[9]=f):f=e[9],f}function rr(t){const e=_.c(5),{children:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=Le.sidebarOpen(),e[0]=o):o=e[0];const[i,l]=Ee(o,!0);let n;return e[1]!==r||e[2]!==l||e[3]!==i?(n=s.jsx(At,{open:i,onOpenChange:l,children:r}),e[1]=r,e[2]=l,e[3]=i,e[4]=n):n=e[4],n}function nr(t){const e=_.c(24),{isStudio:r,isHomeRoute:o,onCreateProject:i}=t,[l]=Te();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Le.decoChatPanelWidth(),e[0]=n):n=e[0];const[a]=Ee(n,30),[m]=$e(),c=r&&m.experimental_projects?"":void 0,d=`${a}cqi`;let f;e[1]!==d?(f={"--sidebar-width":"13.5rem","--sidebar-width-mobile":"11rem","--chat-panel-w":d},e[1]=d,e[2]=f):f=e[2];const u=f;let g;e[3]!==i?(g=s.jsx(Xs,{onCreateProject:i}),e[3]=i,e[4]=g):g=e[4];let x;e[5]===Symbol.for("react.memo_cache_sentinel")?(x={background:"transparent",containerType:"inline-size"},e[5]=x):x=e[5];let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h={overflow:"visible"},e[6]=h):h=e[6];let j;e[7]===Symbol.for("react.memo_cache_sentinel")?(j={overflow:"visible"},e[7]=j):j=e[7];const b=l&&"rounded-tr-[0.75rem] border-r";let p;e[8]!==b?(p=G("flex flex-col flex-1 min-h-0 bg-card overflow-hidden","border-t border-l border-sidebar-border","rounded-tl-[0.75rem]","transition-[border-radius] duration-200 ease-[var(--ease-out-quart)]",b),e[8]=b,e[9]=p):p=e[9];let N;e[10]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx("div",{className:"flex-1 overflow-hidden",children:s.jsx(Ue,{})}),e[10]=N):N=e[10];let S;e[11]!==p?(S=s.jsx(nt,{className:"min-w-0 flex flex-col",style:j,children:s.jsx("div",{className:p,children:N})}),e[11]=p,e[12]=S):S=e[12];let v;e[13]!==l||e[14]!==o?(v=!o&&s.jsxs(s.Fragment,{children:[s.jsx(ps,{className:"bg-sidebar"}),s.jsx(sr,{className:G("transition-[max-width] duration-200 ease-[var(--ease-out-quart)] overflow-hidden",l?"max-w-[var(--chat-panel-w)] bg-sidebar":"max-w-0"),children:s.jsx("div",{className:"h-full min-w-[var(--chat-panel-w)] pl-1.5 pr-1.5 pb-1.5",children:s.jsx("div",{className:"h-full bg-background rounded-[0.75rem] overflow-hidden border border-sidebar-border shadow-sm",children:s.jsx(gs,{})})})})]}),e[13]=l,e[14]=o,e[15]=v):v=e[15];let C;e[16]!==S||e[17]!==v?(C=s.jsx(Ot,{className:"pt-1.5",style:x,children:s.jsxs(xs,{direction:"horizontal",className:"h-full",style:h,children:[S,v]})}),e[16]=S,e[17]=v,e[18]=C):C=e[18];let y;return e[19]!==C||e[20]!==c||e[21]!==u||e[22]!==g?(y=s.jsxs(Tt,{className:"flex-1 bg-sidebar","data-studio":c,style:u,children:[g,C]}),e[19]=C,e[20]=c,e[21]=u,e[22]=g,e[23]=y):y=e[23],y}function ir(){const{org:t,project:e}=Oe({strict:!1}),r=_e(),[o,i]=z.useState(!1),l=r.location.pathname===`/${t}/${e}`||r.location.pathname===`/${t}/${e}/`,n=e??V,{data:a}=Ct({queryKey:_t.activeOrganization(t),queryFn:async()=>{if(!t)return null;const{data:d}=await ce.organization.setActive({organizationSlug:t});return{org:d,project:{slug:n,isOrgAdmin:n===V}}},gcTime:1/0,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1});if(!a)return s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx("header",{className:"h-12 flex items-center justify-end px-4 border-b border-border",children:s.jsx("div",{className:"w-fit",children:s.jsx(ut,{})})}),s.jsx(Ue,{})]});if(!a.org)return window.location.pathname!=="/"&&(window.location.href="/"),null;const m={...a,project:{...a.project,slug:n,isOrgAdmin:n===V}},c=n===V;return s.jsxs(wt,{...m,children:[s.jsx(rr,{children:s.jsx("div",{className:"flex flex-col h-screen overflow-hidden",children:s.jsx(X.Provider,{children:s.jsx(nr,{isStudio:c,isHomeRoute:l,onCreateProject:()=>i(!0)})})})}),s.jsx(Ve,{open:o,onOpenChange:i})]})}function Rn(){const t=_.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(tr,{children:s.jsx(z.Suspense,{fallback:s.jsx(He,{}),children:s.jsx(ir,{})})}),t[0]=e):e=t[0],e}export{Rn as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as u}from"./infiniteQueryObserver-Yvt0ZTml.js";import{z as i}from"./index-DwBgLSti.js";function t(e,r){return i(e,u,r)}export{t as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{z as u,a8 as s}from"./index-DwBgLSti.js";function o(e,r){return u(e,s,r)}export{o as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as s}from"./infiniteQueryObserver-Yvt0ZTml.js";import{z as u,B as n}from"./index-DwBgLSti.js";function a(r,e){return u({...r,enabled:!0,suspense:!0,throwOnError:n},s,e)}export{a as u};
|