decocms 2.364.3 → 2.365.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-BNCl7-KE.js → AlertCircle-BUiQNi1g.js} +1 -1
- package/dist/client/assets/{ArrowNarrowLeft-DoLG4rPk.js → ArrowNarrowLeft-B-iJgi5p.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-dM_balV_.js → ArrowUpRight-Bcc2ZOuq.js} +1 -1
- package/dist/client/assets/{Check-CVcAPsxw.js → Check-C6XoKiD0.js} +1 -1
- package/dist/client/assets/{CheckCircle-LNun5awz.js → CheckCircle-EJQkwVx_.js} +1 -1
- package/dist/client/assets/{ChevronDown-BrQ5SMJr.js → ChevronDown-BG0-uii1.js} +1 -1
- package/dist/client/assets/{ChevronRight-Cv88p4ps.js → ChevronRight-lpVCFpWI.js} +1 -1
- package/dist/client/assets/{ChevronUp-BEXPurOi.js → ChevronUp-C7MKl1aH.js} +1 -1
- package/dist/client/assets/{Container-UyfewUfa.js → Container-CCYhpski.js} +1 -1
- package/dist/client/assets/{DotsVertical-SlSMdJkj.js → DotsVertical-DUwrRRrO.js} +1 -1
- package/dist/client/assets/{FilterLines-D43-OQwr.js → FilterLines-C2GeuQuW.js} +1 -1
- package/dist/client/assets/{HardDrive-9oRtZKUj.js → HardDrive-JbvyX314.js} +1 -1
- package/dist/client/assets/{Key01-CR3cW4Ic.js → Key01-CDidhnng.js} +1 -1
- package/dist/client/assets/{LayoutLeft-DCkIyObc.js → LayoutLeft-D-a-mZcm.js} +1 -1
- package/dist/client/assets/{LinkExternal01-Di-5czt2.js → LinkExternal01-BgvZEm-X.js} +1 -1
- package/dist/client/assets/{Lock01-7UEvqN90.js → Lock01-DukFRLhX.js} +1 -1
- package/dist/client/assets/{Monitor01-B9n70Cxg.js → Monitor01-BBeIQXwu.js} +1 -1
- package/dist/client/assets/{Palette-CM8YcCMA.js → Palette-Cbp9TooA.js} +1 -1
- package/dist/client/assets/{Play-D-B65aXH.js → Play-Bu5xn8xm.js} +1 -1
- package/dist/client/assets/{Plus-Cy8cBKs0.js → Plus-D8dMVCG8.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-DmmbBsed.js → RefreshCcw01-NZxMXXUu.js} +1 -1
- package/dist/client/assets/{SearchMd-DBFtSrcv.js → SearchMd-CZrB4Udl.js} +1 -1
- package/dist/client/assets/{Settings02-3MysM1BG.js → Settings02-DW-Wnk61.js} +1 -1
- package/dist/client/assets/{Shield01-HdcY4mrx.js → Shield01-BF1LUqlj.js} +1 -1
- package/dist/client/assets/{Star01-D8HBHDwu.js → Star01-Dsz3MamR.js} +1 -1
- package/dist/client/assets/{Stars02-GxNmnBiz.js → Stars02-DU-eReiu.js} +1 -1
- package/dist/client/assets/{Sun-CydVR3Ev.js → Sun-CjOl_eIW.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BnKnieWk.js → SwitchHorizontal01-DgnU6UpK.js} +1 -1
- package/dist/client/assets/{Tool01-A_tsfqwo.js → Tool01-B6glW0Sz.js} +1 -1
- package/dist/client/assets/{Trash01-ycnKf74n.js → Trash01-D5iQjfZH.js} +1 -1
- package/dist/client/assets/{Upload01-DYToW9Zt.js → Upload01-CRbIaVuw.js} +1 -1
- package/dist/client/assets/{User01-C3BOLDRp.js → User01-D-0COLHD.js} +1 -1
- package/dist/client/assets/{Users01-hicb3AcK.js → Users01-BXsiu59O.js} +1 -1
- package/dist/client/assets/{Users03-ZMVhIoHM.js → Users03-DxI7m72W.js} +1 -1
- package/dist/client/assets/{X-DPY2mUo2.js → X-CghOqPiW.js} +1 -1
- package/dist/client/assets/{XCircle-B83XL35R.js → XCircle-BAnMq3y8.js} +1 -1
- package/dist/client/assets/{XClose-4axhqxBQ.js → XClose-BtlseQCi.js} +1 -1
- package/dist/client/assets/{Zap-4q67D7Av.js → Zap-B9Rztg2v.js} +1 -1
- package/dist/client/assets/{ZapSquare-CLINFtDR.js → ZapSquare-B5X0r34a.js} +1 -1
- package/dist/client/assets/{accordion-DXkONO_m.js → accordion-B48sZGNg.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-NHQqvsnL.js → add-connection-dialog-DeWWtS5l.js} +1 -1
- package/dist/client/assets/{agent-icon-iDRgsF6L.js → agent-icon-BtPamQTT.js} +1 -1
- package/dist/client/assets/{agent-icons-Cwm2SWG5.js → agent-icons-CfjWsNtB.js} +1 -1
- package/dist/client/assets/{agents-list-DzlzrVg4.js → agents-list-B0rifguo.js} +1 -1
- package/dist/client/assets/{ai-providers-vL31NHHj.js → ai-providers-CjAJVDeU.js} +1 -1
- package/dist/client/assets/{alert-DD3DsnPG.js → alert-DHu2hPyK.js} +1 -1
- package/dist/client/assets/{alert-dialog-30grTlQF.js → alert-dialog-B9ApqUuI.js} +1 -1
- package/dist/client/assets/{auth-catchall-CXal-oGb.js → auth-catchall-magvcZeO.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DN4fv3Ih.js → auth-split-layout-DA4q8Bfk.js} +1 -1
- package/dist/client/assets/{automation-list-row-BHcl4Ohg.js → automation-list-row-9A_MZJgx.js} +1 -1
- package/dist/client/assets/{automations-BqqECuTg.js → automations-DiW8ArAp.js} +1 -1
- package/dist/client/assets/{avatar-KlYDn7qS.js → avatar-CC5qXjgF.js} +1 -1
- package/dist/client/assets/{badge-DuiHx46w.js → badge-BI7NQRYo.js} +1 -1
- package/dist/client/assets/{brand-context-BRwHlDBf.js → brand-context-DV3p99_h.js} +1 -1
- package/dist/client/assets/{card-BES0SMqR.js → card-BM5zwIyB.js} +1 -1
- package/dist/client/assets/{chat-context-DaCqMkjZ.js → chat-context-C7AI4EyX.js} +1 -1
- package/dist/client/assets/{checkbox-CjSQbGdc.js → checkbox-_FPlFvnC.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CeBdZNYb.js → cli-auth-success-DxSIo4al.js} +1 -1
- package/dist/client/assets/{collection-detail-BMjP1kqy.js → collection-detail-ycc2WFgn.js} +1 -1
- package/dist/client/assets/{collection-display-button-D2FlqPoI.js → collection-display-button-CeEGick7.js} +1 -1
- package/dist/client/assets/{collection-search-C18GHA2r.js → collection-search-CRj5GlN2.js} +1 -1
- package/dist/client/assets/{collection-search-DVpwXfK_.js → collection-search-DvDmML5v.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BCrn8XHN.js → collection-table-wrapper-CcVgetdF.js} +1 -1
- package/dist/client/assets/{collection-tabs-sb0bPFTC.js → collection-tabs-CkTIDC3A.js} +1 -1
- package/dist/client/assets/{collections-fkPfVMTg.js → collections-DYNhGJEX.js} +1 -1
- package/dist/client/assets/{command-CMqZx43I.js → command-CbYTzmrk.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-BBezLAIc.js → connect-desktop-dialog-C_jFFd_F.js} +1 -1
- package/dist/client/assets/{connection-card-Dmdx8kTx.js → connection-card-BswapS_C.js} +1 -1
- package/dist/client/assets/{connection-detail-BO3q4d5o.js → connection-detail-DK4A8YWW.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-DKAyPoDI.js → connection-form-helpers-Dn61c3nC.js} +1 -1
- package/dist/client/assets/{connections-BGh_njtW.js → connections-DuzgzZyf.js} +1 -1
- package/dist/client/assets/{constants-C4WRW-LO.js → constants-V3SVDRSK.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-Cuj_gJYe.js → decopilot-sse-pool-DbOmfpLW.js} +1 -1
- package/dist/client/assets/{dialog-CEusfHMX.js → dialog-bygvGgb9.js} +1 -1
- package/dist/client/assets/{domain-settings-y81S8hCO.js → domain-settings-4vKE7ncf.js} +1 -1
- package/dist/client/assets/{drawer-T83Srv96.js → drawer-Bjmg0RR1.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CT0lW-r3.js → dropdown-menu-CkTzcUR8.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-SdaMuY0y.js → dynamic-plugin-layout-D8yyBotc.js} +1 -1
- package/dist/client/assets/{empty-state-wvWmfCHy.js → empty-state-DW3JI1nZ.js} +1 -1
- package/dist/client/assets/{empty-state-DF748yNH.js → empty-state-Dg_dlwBN.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DPlzs4kv.js → extract-connection-data-D3z53YWV.js} +1 -1
- package/dist/client/assets/{features-_BHWNmKI.js → features-ChVbD0gB.js} +1 -1
- package/dist/client/assets/{file-explorer-DO5wAK7w.js → file-explorer-0CMEQXCR.js} +1 -1
- package/dist/client/assets/{files-CjljowlM.js → files-hwxe9QZr.js} +1 -1
- package/dist/client/assets/{form-w71mMA8g.js → form-D_08NHUD.js} +1 -1
- package/dist/client/assets/{general-C_e5zcVD.js → general-BE7htsNN.js} +1 -1
- package/dist/client/assets/{generate-id-7pqGD8tV.js → generate-id-DtDqQvIv.js} +1 -1
- package/dist/client/assets/{github-repo-picker-BeChvUwA.js → github-repo-picker-TJIVPHBK.js} +1 -1
- package/dist/client/assets/{hooks-4Fwh9Blb.js → hooks-BXgqK-cH.js} +1 -1
- package/dist/client/assets/{hover-card-CYskLAbg.js → hover-card-TYrElsp0.js} +1 -1
- package/dist/client/assets/{index-LZKnK7-L.js → index-B6XA74F9.js} +1 -1
- package/dist/client/assets/{index-CVkezZw-.js → index-B6pGpYG6.js} +1 -1
- package/dist/client/assets/{index-Dd-6eUgN.js → index-B8fvR6LT.js} +1 -1
- package/dist/client/assets/{index-B8hvScUv.js → index-BtA594Jz.js} +1 -1
- package/dist/client/assets/{index-COBzfRZi.js → index-CNE80A83.js} +1 -1
- package/dist/client/assets/{index-BxHwWiH7.js → index-CkxTcifU.js} +1 -1
- package/dist/client/assets/{index-CYLlX3M9.js → index-D40kOj2v.js} +1 -1
- package/dist/client/assets/{index-vxjov_Cc.js → index-DBjlNX3z.js} +1 -1
- package/dist/client/assets/{index-gG2GSDDp.js → index-DFLHG9Oe.js} +1 -1
- package/dist/client/assets/{index-n2o4du3Y.js → index-DgmKj-EK.js} +1 -1
- package/dist/client/assets/{index-B_W9Dr0z.js → index-DiUgXBaI.js} +4 -4
- package/dist/client/assets/{index-DfaUClFh.js → index-KugLBWj9.js} +1 -1
- package/dist/client/assets/{index-BIUYFQag.js → index-P-hLEHL2.js} +1 -1
- package/dist/client/assets/{index-BQhmgiEq.js → index-c9Pbt5D9.js} +2 -2
- package/dist/client/assets/{index-BvtnVXmy.js → index-dXxsh3Iz.js} +1 -1
- package/dist/client/assets/index-zzGnf4We.js +1 -0
- package/dist/client/assets/{infiniteQueryObserver-CbM0kgNm.js → infiniteQueryObserver-CFFNkbfX.js} +1 -1
- package/dist/client/assets/{input-DZxKc7J0.js → input-BGaLq3ax.js} +1 -1
- package/dist/client/assets/{integration-icon-DewzWl2m.js → integration-icon-8egQk7i2.js} +1 -1
- package/dist/client/assets/{label-B1la-fci.js → label-BUt9seyW.js} +1 -1
- package/dist/client/assets/{layout-CKEXWCBb.js → layout-BQK7K5Pq.js} +1 -1
- package/dist/client/assets/{login-X1PhOapo.js → login-DwjnK22s.js} +1 -1
- package/dist/client/assets/{members-BzY4jGpr.js → members-DDG_y2wg.js} +1 -1
- package/dist/client/assets/{monaco-editor-UMtzBWTI.js → monaco-editor-6TmJdiGm.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CYnzq1NO.js → monitoring-stats-row-D5sxIGbz.js} +1 -1
- package/dist/client/assets/{oauth-callback-D4lrgj7R.js → oauth-callback-B1F9NMJm.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CPKDMOtX.js → oauth-callback-ai-provider-DYl02pPg.js} +1 -1
- package/dist/client/assets/{onboarding-H8vSkvF8.js → onboarding-D6jujOMz.js} +1 -1
- package/dist/client/assets/{org-layout-C7b-Ct9H.js → org-layout-DKyZtL1W.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-wOnrH2kj.js → org-plugin-layout-BVq0stpE.js} +1 -1
- package/dist/client/assets/{pair-Bfj0tAv6.js → pair-DbOJR5nL.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-CwgJ7jY5.js → plugin-empty-state-lHHHsoKY.js} +1 -1
- package/dist/client/assets/{plugin-header-Cj7-LT8-.js → plugin-header-DgU6XRJp.js} +1 -1
- package/dist/client/assets/{plugin-layout-DLKyTrDc.js → plugin-layout-_zCxsn_M.js} +1 -1
- package/dist/client/assets/{popover-mJmOGcvZ.js → popover-BLsl1Wwx.js} +1 -1
- package/dist/client/assets/{profile-nye86xbC.js → profile-Ca8D8jB_.js} +1 -1
- package/dist/client/assets/{project-app-view-BEJERKGL.js → project-app-view-dfCAAazi.js} +1 -1
- package/dist/client/assets/registry-Bg-4_N8V.js +2 -0
- package/dist/client/assets/{registry-layout-BjSveN7C.js → registry-layout-C-YkiCiQ.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BQrAafe2.js → required-auth-layout-DH-f2CaU.js} +1 -1
- package/dist/client/assets/{reset-password-Qhu37IkB.js → reset-password-B9rKZimn.js} +1 -1
- package/dist/client/assets/{roles-D5ciZufw.js → roles-8uscquIf.js} +1 -1
- package/dist/client/assets/{search-input-BqlqV-_0.js → search-input-DZC3FA9U.js} +1 -1
- package/dist/client/assets/{secrets-7Jk6eNEc.js → secrets-Bl71TYuF.js} +1 -1
- package/dist/client/assets/{sections-editor-D_2uvu0E.js → sections-editor-CtrNziR9.js} +1 -1
- package/dist/client/assets/{select-C-gPp7G9.js → select-btdbQqQB.js} +1 -1
- package/dist/client/assets/{settings-layout-Cw-_d_nm.js → settings-layout-Dqdbrajv.js} +1 -1
- package/dist/client/assets/{settings-section-DApFkTeu.js → settings-section-B8Od5ijm.js} +1 -1
- package/dist/client/assets/{shell-controls-DeJL2a7u.js → shell-controls-Cpc7zjLw.js} +1 -1
- package/dist/client/assets/{shell-layout-BOxsGjDb.js → shell-layout-DpoJLGrK.js} +1 -1
- package/dist/client/assets/{sidebar-D6d-v_Pc.js → sidebar-D-_ciNlc.js} +1 -1
- package/dist/client/assets/{skeleton-RfCTKn6Y.js → skeleton-CCsx--iC.js} +1 -1
- package/dist/client/assets/{sortable.esm-BXIgGJxQ.js → sortable.esm-DWCPENgE.js} +1 -1
- package/dist/client/assets/{spinner-NqyTThDx.js → spinner-Dbsg4e4M.js} +1 -1
- package/dist/client/assets/{sso-BK6CSnRS.js → sso-DKBw_dCD.js} +1 -1
- package/dist/client/assets/{store-C5VGH9Ff.js → store-DRHB__wC.js} +1 -1
- package/dist/client/assets/store-registry-DnyJL09S.js +2 -0
- package/dist/client/assets/{switch-BqVfJaaE.js → switch-BPaF7GST.js} +1 -1
- package/dist/client/assets/{table-RmWD5bZv.js → table-TcgYyI5g.js} +1 -1
- package/dist/client/assets/{tabs-C84e7ZOt.js → tabs-CArqhjUQ.js} +1 -1
- package/dist/client/assets/{task-status-Dl8gKUMi.js → task-status-Cosx-AHw.js} +1 -1
- package/dist/client/assets/{textarea-D08XpeH3.js → textarea-CLLp6KTK.js} +1 -1
- package/dist/client/assets/{toggle-group-D8XVv0W2.js → toggle-group-CyhRMoao.js} +1 -1
- package/dist/client/assets/{toolbar-DcHaxh2N.js → toolbar-BXyHZxUa.js} +1 -1
- package/dist/client/assets/{tools-list-rsD1aCdR.js → tools-list-CIfKFLCC.js} +1 -1
- package/dist/client/assets/{tooltip-IAEIrTVw.js → tooltip-DuHhGuNb.js} +1 -1
- package/dist/client/assets/{types-THJHjNYw.js → types-CKyex3WY.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BtEkhdod.js → use-ai-providers-DXY8w1gk.js} +1 -1
- package/dist/client/assets/{use-collections-B5chukT1.js → use-collections-DV-Yw7Rl.js} +1 -1
- package/dist/client/assets/{use-connection-CqLc2kCT.js → use-connection-DPPCfeow.js} +1 -1
- package/dist/client/assets/{use-copy-x4stjSR_.js → use-copy-CObefyk7.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-B2e6V1M8.js → use-create-virtual-mcp-ClMf9M2U.js} +1 -1
- package/dist/client/assets/{use-create-website-agent-DO3Reh-r.js → use-create-website-agent-D_7O7M84.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-sCbU6V0n.js → use-debounced-autosave-CYLSA65X.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CQU3mfvU.js → use-delete-connection-2Y6JpaXB.js} +1 -1
- package/dist/client/assets/{use-file-configs-jYMYwC9U.js → use-file-configs-CkJCW_0J.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CgCif0T0.js → use-infinite-scroll-BIl8Btbp.js} +1 -1
- package/dist/client/assets/{use-list-state-D6p_uKvt.js → use-list-state-BCQHlt2C.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-e9YFDYF0.js → use-mcp-prompts-D707fXp5.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BsnzIOtc.js → use-mcp-tools-BpkMOXfX.js} +1 -1
- package/dist/client/assets/{use-members-MgBmqs7x.js → use-members-BBMhepEt.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-BtQa4OwG.js → use-navigate-to-agent-CeGlZmmn.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BXGwtUzc.js → use-org-auth-client-DnKeoeEP.js} +1 -1
- package/dist/client/assets/{use-org-sso-JuaVORNY.js → use-org-sso-4uCrf8x0.js} +1 -1
- package/dist/client/assets/{use-organization-roles-CbkFJiRw.js → use-organization-roles-B4hkYRiT.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DoIv1zqR.js → use-organization-settings-AWz6cpVk.js} +1 -1
- package/dist/client/assets/{use-registry-connections-C8o36UIG.js → use-registry-connections-BLF2Iu3j.js} +1 -1
- package/dist/client/assets/{use-secrets-BAKSVIhF.js → use-secrets-DE0Aqna8.js} +1 -1
- package/dist/client/assets/{use-status-sounds-BvXs5nVW.js → use-status-sounds-SJ0KRIgZ.js} +1 -1
- package/dist/client/assets/{use-view-mode-2VzWrKsP.js → use-view-mode-DPdHQRdb.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DPVntSu2.js → use-virtual-mcp-BzxmTmXo.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-B_xNiJ7y.js +1 -0
- package/dist/client/assets/{useRouterState-DZLFFWHa.js → useRouterState-DXQ9JAOk.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-B2fx93nW.js +1 -0
- package/dist/client/assets/{user-BIhwSu8_.js → user-BDVV447T.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-D1dUZXpK.js → view-mode-toggle-BeU9M-dx.js} +1 -1
- package/dist/client/assets/{workflow-CYYTNdIs.js → workflow-6p4Uluo2.js} +1 -1
- package/dist/client/assets/workflow-detail-CZNMnpz0.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/node_modules/@opentelemetry/core/build/esm/baggage/utils.js +9 -22
- package/dist/server/node_modules/@opentelemetry/core/build/esm/baggage/utils.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/core/build/esm/common/time.d.ts +0 -3
- package/dist/server/node_modules/@opentelemetry/core/build/esm/common/time.js +8 -6
- package/dist/server/node_modules/@opentelemetry/core/build/esm/common/time.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/core/build/esm/common/types.d.ts +10 -0
- package/dist/server/node_modules/@opentelemetry/core/build/esm/common/types.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/core/build/esm/platform/browser/globalThis.d.ts +10 -0
- package/dist/server/node_modules/@opentelemetry/core/build/esm/platform/browser/globalThis.js +35 -0
- package/dist/server/node_modules/@opentelemetry/core/build/esm/platform/browser/globalThis.js.map +1 -0
- package/dist/server/node_modules/@opentelemetry/core/build/esm/platform/browser/index.d.ts +2 -5
- package/dist/server/node_modules/@opentelemetry/core/build/esm/platform/browser/index.js +2 -5
- package/dist/server/node_modules/@opentelemetry/core/build/esm/platform/browser/index.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/core/build/esm/platform/browser/performance.d.ts +5 -0
- package/dist/server/node_modules/@opentelemetry/core/build/esm/{common/globalThis.js → platform/browser/performance.js} +2 -5
- package/dist/server/node_modules/@opentelemetry/core/build/esm/platform/browser/performance.js.map +1 -0
- package/dist/server/node_modules/@opentelemetry/core/build/esm/platform/node/globalThis.d.ts +3 -0
- package/dist/server/node_modules/@opentelemetry/core/build/esm/platform/node/globalThis.js +19 -0
- package/dist/server/node_modules/@opentelemetry/core/build/esm/platform/node/globalThis.js.map +1 -0
- package/dist/server/node_modules/@opentelemetry/core/build/esm/platform/node/index.d.ts +2 -8
- package/dist/server/node_modules/@opentelemetry/core/build/esm/platform/node/index.js +2 -5
- package/dist/server/node_modules/@opentelemetry/core/build/esm/platform/node/index.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/core/build/esm/platform/node/performance.d.ts +5 -0
- package/dist/server/node_modules/@opentelemetry/core/build/{esnext/common/globalThis.js → esm/platform/node/performance.js} +3 -5
- package/dist/server/node_modules/@opentelemetry/core/build/esm/platform/node/performance.js.map +1 -0
- package/dist/server/node_modules/@opentelemetry/core/build/esm/utils/callback.d.ts +3 -3
- package/dist/server/node_modules/@opentelemetry/core/build/esm/utils/callback.js +5 -5
- package/dist/server/node_modules/@opentelemetry/core/build/esm/utils/callback.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/core/build/esm/version.d.ts +1 -1
- package/dist/server/node_modules/@opentelemetry/core/build/esm/version.js +1 -1
- package/dist/server/node_modules/@opentelemetry/core/build/esm/version.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/core/build/esnext/baggage/utils.js +9 -22
- package/dist/server/node_modules/@opentelemetry/core/build/esnext/baggage/utils.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/core/build/esnext/common/time.d.ts +0 -3
- package/dist/server/node_modules/@opentelemetry/core/build/esnext/common/time.js +8 -6
- package/dist/server/node_modules/@opentelemetry/core/build/esnext/common/time.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/core/build/esnext/common/types.d.ts +10 -0
- package/dist/server/node_modules/@opentelemetry/core/build/esnext/common/types.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/browser/globalThis.d.ts +10 -0
- package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/browser/globalThis.js +35 -0
- package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/browser/globalThis.js.map +1 -0
- package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/browser/index.d.ts +2 -5
- package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/browser/index.js +2 -5
- package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/browser/index.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/browser/performance.d.ts +5 -0
- package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/browser/performance.js +17 -0
- package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/browser/performance.js.map +1 -0
- package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/node/globalThis.d.ts +3 -0
- package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/node/globalThis.js +19 -0
- package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/node/globalThis.js.map +1 -0
- package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/node/index.d.ts +2 -8
- package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/node/index.js +2 -5
- package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/node/index.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/node/performance.d.ts +5 -0
- package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/node/performance.js +18 -0
- package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/node/performance.js.map +1 -0
- package/dist/server/node_modules/@opentelemetry/core/build/esnext/utils/callback.d.ts +3 -3
- package/dist/server/node_modules/@opentelemetry/core/build/esnext/utils/callback.js +5 -5
- package/dist/server/node_modules/@opentelemetry/core/build/esnext/utils/callback.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/core/build/esnext/version.d.ts +1 -1
- package/dist/server/node_modules/@opentelemetry/core/build/esnext/version.js +1 -1
- package/dist/server/node_modules/@opentelemetry/core/build/esnext/version.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/core/build/src/baggage/utils.js +9 -22
- package/dist/server/node_modules/@opentelemetry/core/build/src/baggage/utils.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/core/build/src/common/time.d.ts +0 -3
- package/dist/server/node_modules/@opentelemetry/core/build/src/common/time.js +8 -6
- package/dist/server/node_modules/@opentelemetry/core/build/src/common/time.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/core/build/src/common/types.d.ts +10 -0
- package/dist/server/node_modules/@opentelemetry/core/build/src/common/types.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/core/build/src/platform/browser/globalThis.d.ts +10 -0
- package/dist/server/node_modules/@opentelemetry/core/build/src/platform/browser/globalThis.js +38 -0
- package/dist/server/node_modules/@opentelemetry/core/build/src/platform/browser/globalThis.js.map +1 -0
- package/dist/server/node_modules/@opentelemetry/core/build/src/platform/browser/index.d.ts +2 -5
- package/dist/server/node_modules/@opentelemetry/core/build/src/platform/browser/index.js +4 -6
- package/dist/server/node_modules/@opentelemetry/core/build/src/platform/browser/index.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/core/build/src/platform/browser/performance.d.ts +5 -0
- package/dist/server/node_modules/@opentelemetry/core/build/src/{common/globalThis.js → platform/browser/performance.js} +3 -6
- package/dist/server/node_modules/@opentelemetry/core/build/src/platform/browser/performance.js.map +1 -0
- package/dist/server/node_modules/@opentelemetry/core/build/src/platform/node/globalThis.d.ts +3 -0
- package/dist/server/node_modules/@opentelemetry/core/build/src/platform/node/globalThis.js +22 -0
- package/dist/server/node_modules/@opentelemetry/core/build/src/platform/node/globalThis.js.map +1 -0
- package/dist/server/node_modules/@opentelemetry/core/build/src/platform/node/index.d.ts +2 -8
- package/dist/server/node_modules/@opentelemetry/core/build/src/platform/node/index.js +4 -6
- package/dist/server/node_modules/@opentelemetry/core/build/src/platform/node/index.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/core/build/src/platform/node/performance.d.ts +5 -0
- package/dist/server/node_modules/@opentelemetry/core/build/src/platform/node/performance.js +21 -0
- package/dist/server/node_modules/@opentelemetry/core/build/src/platform/node/performance.js.map +1 -0
- package/dist/server/node_modules/@opentelemetry/core/build/src/utils/callback.d.ts +3 -3
- package/dist/server/node_modules/@opentelemetry/core/build/src/utils/callback.js +5 -5
- package/dist/server/node_modules/@opentelemetry/core/build/src/utils/callback.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/core/build/src/version.d.ts +1 -1
- package/dist/server/node_modules/@opentelemetry/core/build/src/version.js +1 -1
- package/dist/server/node_modules/@opentelemetry/core/build/src/version.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/core/package.json +4 -5
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esm/generated/root.js +6 -36
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esm/generated/root.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esm/trace/internal.js +0 -15
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esm/trace/internal.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esnext/generated/root.js +6 -36
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esnext/generated/root.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esnext/trace/internal.js +0 -15
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esnext/trace/internal.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/src/generated/root.js +6 -36
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/src/generated/root.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/src/trace/internal.js +0 -15
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/src/trace/internal.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/package.json +14 -12
- package/dist/server/node_modules/@opentelemetry/resources/build/esm/ResourceImpl.js +1 -1
- package/dist/server/node_modules/@opentelemetry/resources/build/esm/ResourceImpl.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/resources/build/esm/index.d.ts +1 -1
- package/dist/server/node_modules/@opentelemetry/resources/build/esm/index.js +1 -1
- package/dist/server/node_modules/@opentelemetry/resources/build/esm/index.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/browser/default-service-name.d.ts +2 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/browser/default-service-name.js +19 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/browser/default-service-name.js.map +1 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/browser/index.d.ts +2 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/browser/index.js +17 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/browser/index.js.map +1 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/index.d.ts +2 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/index.js +17 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/index.js.map +1 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/node/default-service-name.d.ts +2 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/node/default-service-name.js +19 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/node/default-service-name.js.map +1 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/node/index.d.ts +2 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/node/index.js +17 -0
- package/dist/server/node_modules/@opentelemetry/{core/build/src/common/globalThis.js.map → resources/build/esm/platform/node/index.js.map} +1 -1
- package/dist/server/node_modules/@opentelemetry/resources/build/esm/utils.d.ts +1 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/esm/utils.js +3 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/esm/utils.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/resources/build/esm/version.d.ts +1 -1
- package/dist/server/node_modules/@opentelemetry/resources/build/esm/version.js +1 -1
- package/dist/server/node_modules/@opentelemetry/resources/build/esm/version.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/resources/build/esnext/ResourceImpl.js +1 -1
- package/dist/server/node_modules/@opentelemetry/resources/build/esnext/ResourceImpl.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/resources/build/esnext/index.d.ts +1 -1
- package/dist/server/node_modules/@opentelemetry/resources/build/esnext/index.js +1 -1
- package/dist/server/node_modules/@opentelemetry/resources/build/esnext/index.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/browser/default-service-name.d.ts +2 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/browser/default-service-name.js +19 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/browser/default-service-name.js.map +1 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/browser/index.d.ts +2 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/browser/index.js +17 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/browser/index.js.map +1 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/index.d.ts +2 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/index.js +17 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/index.js.map +1 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/node/default-service-name.d.ts +2 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/node/default-service-name.js +19 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/node/default-service-name.js.map +1 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/node/index.d.ts +2 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/node/index.js +17 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/node/index.js.map +1 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/esnext/utils.d.ts +1 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/esnext/utils.js +3 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/esnext/utils.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/resources/build/esnext/version.d.ts +1 -1
- package/dist/server/node_modules/@opentelemetry/resources/build/esnext/version.js +1 -1
- package/dist/server/node_modules/@opentelemetry/resources/build/esnext/version.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/resources/build/src/ResourceImpl.js +2 -2
- package/dist/server/node_modules/@opentelemetry/resources/build/src/ResourceImpl.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/resources/build/src/index.d.ts +1 -1
- package/dist/server/node_modules/@opentelemetry/resources/build/src/index.js +2 -2
- package/dist/server/node_modules/@opentelemetry/resources/build/src/index.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/browser/default-service-name.d.ts +2 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/browser/default-service-name.js +23 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/browser/default-service-name.js.map +1 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/browser/index.d.ts +2 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/browser/index.js +21 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/browser/index.js.map +1 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/index.d.ts +2 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/index.js +21 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/index.js.map +1 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/node/default-service-name.d.ts +2 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/node/default-service-name.js +23 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/node/default-service-name.js.map +1 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/node/index.d.ts +2 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/node/index.js +21 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/node/index.js.map +1 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/src/utils.d.ts +1 -0
- package/dist/server/node_modules/@opentelemetry/resources/build/src/utils.js +5 -1
- package/dist/server/node_modules/@opentelemetry/resources/build/src/utils.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/resources/build/src/version.d.ts +1 -1
- package/dist/server/node_modules/@opentelemetry/resources/build/src/version.js +1 -1
- package/dist/server/node_modules/@opentelemetry/resources/build/src/version.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/resources/package.json +9 -5
- package/dist/server/node_modules/get-east-asian-width/index.d.ts +60 -0
- package/dist/server/node_modules/get-east-asian-width/index.js +30 -0
- package/dist/server/node_modules/get-east-asian-width/lookup-data.js +18 -0
- package/dist/server/node_modules/get-east-asian-width/lookup.js +135 -0
- package/dist/server/node_modules/get-east-asian-width/package.json +71 -0
- package/dist/server/node_modules/get-east-asian-width/readme.md +65 -0
- package/dist/server/node_modules/get-east-asian-width/utilities.js +24 -0
- package/dist/server/node_modules/protobufjs/dist/light/protobuf.js +13 -10
- package/dist/server/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
- package/dist/server/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
- package/dist/server/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
- package/dist/server/node_modules/protobufjs/dist/minimal/protobuf.js +2 -2
- package/dist/server/node_modules/protobufjs/dist/minimal/protobuf.min.js +2 -2
- package/dist/server/node_modules/protobufjs/dist/protobuf.js +14 -55
- package/dist/server/node_modules/protobufjs/dist/protobuf.js.map +1 -1
- package/dist/server/node_modules/protobufjs/dist/protobuf.min.js +3 -3
- package/dist/server/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
- package/dist/server/node_modules/protobufjs/package.json +1 -1
- package/dist/server/node_modules/protobufjs/src/message.js +7 -3
- package/dist/server/node_modules/protobufjs/src/object.js +3 -6
- package/dist/server/node_modules/protobufjs/src/parse.js +1 -45
- package/dist/server/node_modules/protobufjs/src/type.js +1 -0
- package/dist/server/node_modules/xtend/.jshintrc +30 -0
- package/dist/server/node_modules/{postgres-date/license → xtend/LICENSE} +1 -2
- package/dist/server/node_modules/xtend/README.md +32 -0
- package/dist/server/node_modules/xtend/immutable.js +19 -0
- package/dist/server/node_modules/xtend/mutable.js +17 -0
- package/dist/server/node_modules/xtend/package.json +55 -0
- package/dist/server/node_modules/xtend/test.js +103 -0
- package/package.json +1 -1
- package/dist/client/assets/index-DOK7_ohT.js +0 -1
- package/dist/client/assets/registry-bNkBISAa.js +0 -2
- package/dist/client/assets/store-registry-CVqLvY0j.js +0 -2
- package/dist/client/assets/useInfiniteQuery-DKkhiiov.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-m9tx-DXA.js +0 -1
- package/dist/client/assets/workflow-detail-BI1YgTJB.js +0 -1
- package/dist/server/node_modules/@opentelemetry/core/build/esm/common/globalThis.d.ts +0 -5
- package/dist/server/node_modules/@opentelemetry/core/build/esm/common/globalThis.js.map +0 -1
- package/dist/server/node_modules/@opentelemetry/core/build/esnext/common/globalThis.d.ts +0 -5
- package/dist/server/node_modules/@opentelemetry/core/build/esnext/common/globalThis.js.map +0 -1
- package/dist/server/node_modules/@opentelemetry/core/build/src/common/globalThis.d.ts +0 -5
- package/dist/server/node_modules/@opentelemetry/resources/build/esm/default-service-name.d.ts +0 -9
- package/dist/server/node_modules/@opentelemetry/resources/build/esm/default-service-name.js +0 -38
- package/dist/server/node_modules/@opentelemetry/resources/build/esm/default-service-name.js.map +0 -1
- package/dist/server/node_modules/@opentelemetry/resources/build/esnext/default-service-name.d.ts +0 -9
- package/dist/server/node_modules/@opentelemetry/resources/build/esnext/default-service-name.js +0 -38
- package/dist/server/node_modules/@opentelemetry/resources/build/esnext/default-service-name.js.map +0 -1
- package/dist/server/node_modules/@opentelemetry/resources/build/src/default-service-name.d.ts +0 -9
- package/dist/server/node_modules/@opentelemetry/resources/build/src/default-service-name.js +0 -43
- package/dist/server/node_modules/@opentelemetry/resources/build/src/default-service-name.js.map +0 -1
- package/dist/server/node_modules/@protobufjs/inquire/LICENSE +0 -26
- package/dist/server/node_modules/@protobufjs/inquire/README.md +0 -13
- package/dist/server/node_modules/@protobufjs/inquire/index.d.ts +0 -9
- package/dist/server/node_modules/@protobufjs/inquire/index.js +0 -37
- package/dist/server/node_modules/@protobufjs/inquire/package.json +0 -21
- package/dist/server/node_modules/@protobufjs/inquire/tests/data/array.js +0 -1
- package/dist/server/node_modules/@protobufjs/inquire/tests/data/emptyArray.js +0 -1
- package/dist/server/node_modules/@protobufjs/inquire/tests/data/emptyObject.js +0 -1
- package/dist/server/node_modules/@protobufjs/inquire/tests/data/object.js +0 -1
- package/dist/server/node_modules/@protobufjs/inquire/tests/index.js +0 -20
- package/dist/server/node_modules/ansi-styles/index.d.ts +0 -236
- package/dist/server/node_modules/ansi-styles/index.js +0 -223
- package/dist/server/node_modules/ansi-styles/package.json +0 -54
- package/dist/server/node_modules/ansi-styles/readme.md +0 -173
- package/dist/server/node_modules/is-fullwidth-code-point/index.d.ts +0 -17
- package/dist/server/node_modules/is-fullwidth-code-point/index.js +0 -12
- package/dist/server/node_modules/is-fullwidth-code-point/license +0 -9
- package/dist/server/node_modules/is-fullwidth-code-point/package.json +0 -53
- package/dist/server/node_modules/is-fullwidth-code-point/readme.md +0 -31
- package/dist/server/node_modules/postgres-date/index.js +0 -116
- package/dist/server/node_modules/postgres-date/package.json +0 -33
- package/dist/server/node_modules/postgres-date/readme.md +0 -49
- /package/dist/server/node_modules/{ansi-styles → get-east-asian-width}/license +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{dl as Fe,bo as Os,P as oe,M as ge,aq as ti,bV as _i,an as Ie,bm as mt,aY as qe,ao as mr,dm as rn,J as _e,dn as Ii,dp as ws,dq as ec,bT as tc,dr as ia,ds as nc,dt as rc,du as ic,cS as fn,cT as Cr,cU as xs,bM as sa,bE as sc,aM as ze,bU as oc,ap as On,b9 as Ti,dv as ac,r as N,j as w,dw as oa,cF as lc}from"./index-BQhmgiEq.js";import{b as cc,d as uc,n as fc,e as dc,C as hc,A as pc}from"./constants-C4WRW-LO.js";import{B as Ci,c as Pi}from"./collections-fkPfVMTg.js";import{R as Es}from"./index-gG2GSDDp.js";var mc=class{apply(e,t){if(!t.type)return;const n=Array.isArray(t.type)?t.type:[t.type],r=new Set(n);if(r.has("string")||(e.string=!1),!r.has("number")&&!r.has("integer")&&(e.number=!1),r.has("boolean")||(e.boolean=!1),r.has("null")||(e.null=!1),r.has("array")||(e.array=!1),r.has("object")||(e.object=!1),r.has("integer")&&e.number!==!1){const i=e.number||ge();i instanceof rn&&(e.number=i.int())}}},yc=class{apply(e,t){if(t.const===void 0)return;const n=t.const;e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1,typeof n=="string"?e.string=qe(n):typeof n=="number"?e.number=qe(n):typeof n=="boolean"?e.boolean=qe(n):n===null?e.null=_i():Array.isArray(n)?e.array=void 0:typeof n=="object"&&(e.object=void 0)}},gc=class{apply(e,t){if(!t.enum)return;if(t.enum.length===0){t.type||(e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1);return}const n={string:t.enum.filter(r=>typeof r=="string"),number:t.enum.filter(r=>typeof r=="number"),boolean:t.enum.filter(r=>typeof r=="boolean"),null:t.enum.filter(r=>r===null),array:t.enum.filter(r=>Array.isArray(r)),object:t.enum.filter(r=>typeof r=="object"&&r!==null&&!Array.isArray(r))};e.string=this.createTypeSchema(n.string,"string"),e.number=this.createTypeSchema(n.number,"number"),e.boolean=this.createTypeSchema(n.boolean,"boolean"),e.null=n.null.length>0?_i():!1,e.array=n.array.length>0?void 0:!1,e.object=n.object.length>0?void 0:!1}createTypeSchema(e,t){if(e.length===0)return!1;if(e.length===1)return qe(e[0]);if(t==="string")return mr(e);if(t==="number"){const[n,r,...i]=e;return mt([qe(n),qe(r),...i.map(s=>qe(s))])}return t==="boolean"?mt([qe(!0),qe(!1)]):!1}},bc=class{apply(e,t){const n=t;if(n.type==="string"&&n.format==="binary"&&n.contentEncoding==="binary"){let r=ic();n.minLength!==void 0&&(r=r.min(n.minLength)),n.maxLength!==void 0&&(r=r.max(n.maxLength)),n.contentMediaType!==void 0&&(r=r.mime(n.contentMediaType)),e.file=r,e.string=!1}}},Sc=class{apply(e,t){const n=t;t.type===void 0&&(n.minLength!==void 0||n.maxLength!==void 0||n.pattern!==void 0)&&e.string===void 0&&(e.string=oe())}},vc=class{apply(e,t){const n=t;if(n.minLength!==void 0&&e.string!==!1){const r=e.string||oe();r instanceof Ii&&(e.string=r.refine(i=>Array.from(i).length>=n.minLength,{message:`String must be at least ${n.minLength} characters long`}))}}},Oc=class{apply(e,t){const n=t;if(n.maxLength!==void 0&&e.string!==!1){const r=e.string||oe();r instanceof Ii&&(e.string=r.refine(i=>Array.from(i).length<=n.maxLength,{message:`String must be at most ${n.maxLength} characters long`}))}}},wc=class{apply(e,t){const n=t;if(n.pattern&&e.string!==!1){const r=e.string||oe();if(r instanceof Ii){const i=new RegExp(n.pattern);e.string=r.regex(i)}}}},xc=class{apply(e,t){const n=t;if(n.minimum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.min(n.minimum))}}},Ec=class{apply(e,t){const n=t;if(n.maximum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.max(n.maximum))}}},Ac=class{apply(e,t){const n=t;if(n.exclusiveMinimum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(typeof n.exclusiveMinimum=="number"?e.number=r.gt(n.exclusiveMinimum):e.number=!1)}}},_c=class{apply(e,t){const n=t;if(n.exclusiveMaximum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(typeof n.exclusiveMaximum=="number"?e.number=r.lt(n.exclusiveMaximum):e.number=!1)}}},Ic=class{apply(e,t){const n=t;if(n.multipleOf!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.refine(i=>{if(n.multipleOf===0)return!1;const s=i/n.multipleOf,o=Math.round(s),a=Math.min(Math.abs(i)*Number.EPSILON*10,Math.abs(n.multipleOf)*Number.EPSILON*10);return Math.abs(s-o)<=a/Math.abs(n.multipleOf)},{message:`Must be a multiple of ${n.multipleOf}`}))}}},Tc=class{apply(e,t){const n=t;t.type===void 0&&(n.minItems!==void 0||n.maxItems!==void 0||n.items!==void 0||n.prefixItems!==void 0)&&e.array===void 0&&(e.array=Ie(Fe()))}},Cc=class{apply(e,t){const n=t;n.minItems!==void 0&&e.array!==!1&&(e.array=(e.array||Ie(Fe())).min(n.minItems))}},Pc=class{apply(e,t){const n=t;n.maxItems!==void 0&&e.array!==!1&&(e.array=(e.array||Ie(Fe())).max(n.maxItems))}},Fc=class{apply(e,t){const n=t;if(e.array!==!1)if(Array.isArray(n.items))e.array=e.array||Ie(Fe());else if(n.items&&typeof n.items!="boolean"&&!n.prefixItems){const r=Ae(n.items);let i=Ie(r);if(e.array&&e.array instanceof ec){const s=e.array._def;s.checks&&s.checks.forEach(o=>{if(o._zod&&o._zod.def){const a=o._zod.def;a.check==="min_length"&&a.minimum!==void 0?i=i.min(a.minimum):a.check==="max_length"&&a.maximum!==void 0&&(i=i.max(a.maximum))}})}e.array=i}else typeof n.items=="boolean"&&n.items===!1?n.prefixItems?e.array=e.array||Ie(Fe()):e.array=Ie(Fe()).max(0):typeof n.items=="boolean"&&n.items===!0?e.array=e.array||Ie(Fe()):n.prefixItems&&(e.array=e.array||Ie(Fe()))}},jc=class{apply(e,t){if(t.type!=="array")return;const n=t;if(!Array.isArray(n.items)||e.array===!1)return;const r=n.items.map(s=>Ae(s));let i;r.length===0?i=ws([]):i=ws(r),n.minItems!==void 0&&n.minItems>r.length&&(i=!1),n.maxItems!==void 0&&n.maxItems<r.length&&(i=!1),e.tuple=i,e.array=!1}},$c=class{apply(e,t){const n=t;e.object!==!1&&(n.properties||n.required||n.additionalProperties!==void 0)&&(e.object=e.object||_e({}).passthrough())}},Dc=class{apply(e,t){const n=t;t.type===void 0&&(n.maxProperties!==void 0||n.minProperties!==void 0)&&e.object===void 0&&(e.object=_e({}).passthrough())}},Nc=class{apply(e,t){const n=t;if(n.maxProperties!==void 0&&e.object!==!1){const r=e.object||_e({}).passthrough();e.object=r.refine(i=>Object.keys(i).length<=n.maxProperties,{message:`Object must have at most ${n.maxProperties} properties`})}}},Rc=class{apply(e,t){const n=t;if(n.minProperties!==void 0&&e.object!==!1){const r=e.object||_e({}).passthrough();e.object=r.refine(i=>Object.keys(i).length>=n.minProperties,{message:`Object must have at least ${n.minProperties} properties`})}}};function Cn(e,t){if(e===t)return!0;if(e==null||t==null)return e===t;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((n,r)=>Cn(n,t[r]));if(typeof e=="object"&&typeof t=="object"){const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(i=>r.includes(i)&&Cn(e[i],t[i]))}return!1}function Mc(){return e=>{if(!Array.isArray(e))return!0;const t=[];return e.every(n=>t.some(i=>Cn(n,i))?!1:(t.push(n),!0))}}function cr(e,t){return e.safeParse(t).success}var Uc=class{apply(e,t){if(!t.not)return e;const n=Ae(t.not);return e.refine(r=>!cr(n,r),{message:"Value must not match the 'not' schema"})}},kc=class{apply(e,t){return t.uniqueItems!==!0?e:e.refine(Mc(),{message:"Array items must be unique"})}},Lc=class{apply(e,t){return!t.allOf||t.allOf.length===0?e:t.allOf.map(r=>Ae(r)).reduce((r,i)=>ia(r,i),e)}},Bc=class{apply(e,t){if(!t.anyOf||t.anyOf.length===0)return e;const n=t.anyOf.length===1?Ae(t.anyOf[0]):mt([Ae(t.anyOf[0]),Ae(t.anyOf[1]),...t.anyOf.slice(2).map(r=>Ae(r))]);return ia(e,n)}},Wc=class{apply(e,t){if(!t.oneOf||t.oneOf.length===0)return e;const n=t.oneOf.map(r=>Ae(r));return e.refine(r=>{let i=0;for(const s of n)if(s.safeParse(r).success&&(i++,i>1))return!1;return i===1},{message:"Value must match exactly one of the oneOf schemas"})}},qc=class{apply(e,t){const n=t;if(n.prefixItems&&Array.isArray(n.prefixItems)){const i=n.prefixItems.map(s=>Ae(s));return e.refine(s=>{if(!Array.isArray(s))return!0;for(let o=0;o<Math.min(s.length,i.length);o++)if(!cr(i[o],s[o]))return!1;if(s.length>i.length){if(typeof n.items=="boolean"&&n.items===!1)return!1;if(n.items&&typeof n.items=="object"&&!Array.isArray(n.items)){const o=Ae(n.items);for(let a=i.length;a<s.length;a++)if(!cr(o,s[a]))return!1}}return!0},{message:"Array does not match prefixItems schema"})}return e}},Vc=class{apply(e,t){const n=t;if(!n.properties&&!n.required&&n.additionalProperties!==!1)return e;if(e instanceof nc||e instanceof rc){const r={};if(n.properties)for(const[i,s]of Object.entries(n.properties))s!==void 0&&(r[i]=Ae(s));if(n.required&&Array.isArray(n.required)){const i=new Set(n.required);for(const s of Object.keys(r))i.has(s)||(r[s]=r[s].optional())}else for(const i of Object.keys(r))r[i]=r[i].optional();return n.additionalProperties===!1?_e(r):_e(r).passthrough()}return e.refine(r=>{if(typeof r!="object"||r===null||Array.isArray(r))return!0;if(n.properties){for(const[i,s]of Object.entries(n.properties))if(s!==void 0&&Object.getOwnPropertyDescriptor(r,i)!==void 0&&!Ae(s).safeParse(r[i]).success)return!1}if(n.required&&Array.isArray(n.required)){for(const i of n.required)if(!(Object.getOwnPropertyDescriptor(r,i)!==void 0))return!1}if(n.additionalProperties===!1&&n.properties){const i=new Set(Object.keys(n.properties));for(const s in r)if(!i.has(s))return!1}return!0},{message:"Object constraints validation failed"})}},Hc=class{apply(e,t){if(!t.enum||t.enum.length===0)return e;const n=t.enum.filter(r=>Array.isArray(r)||typeof r=="object"&&r!==null);return n.length===0?e:e.refine(r=>typeof r!="object"||r===null?!0:n.some(i=>Cn(r,i)),{message:"Value must match one of the enum values"})}},Kc=class{apply(e,t){if(t.const===void 0)return e;const n=t.const;return typeof n!="object"||n===null?e:e.refine(r=>Cn(r,n),{message:"Value must equal the const value"})}},Gc=class{apply(e,t){return t.description&&(e=e.describe(t.description)),e}},zc=class{apply(e,t){var n;const r=t;return!((n=r.required)!=null&&n.includes("__proto__"))||t.type!==void 0?e:Fe().refine(i=>this.validateRequired(i,r.required),{message:"Missing required properties"})}validateRequired(e,t){return typeof e!="object"||e===null||Array.isArray(e)?!0:t.every(n=>Object.prototype.hasOwnProperty.call(e,n))}},Yc=class{apply(e,t){var n;const r=t;if(r.contains===void 0)return e;const i=Ae(r.contains),s=(n=r.minContains)!=null?n:1,o=r.maxContains;return e.refine(a=>{if(!Array.isArray(a))return!0;let l=0;for(const c of a)cr(i,c)&&l++;return!(l<s||o!==void 0&&l>o)},{message:"Array must contain required items matching the schema"})}},Jc=class{apply(e,t){const{default:n}=t;return n===void 0||!e.safeParse(n).success?e:e.default(n)}},Zc=[new yc,new gc,new mc,new bc,new Sc,new Tc,new Dc,new vc,new Oc,new wc,new xc,new Ec,new Ac,new _c,new Ic,new jc,new Cc,new Pc,new Fc,new Nc,new Rc,new $c],Xc=[new zc,new Hc,new Kc,new Lc,new Bc,new Wc,new qc,new Vc,new Yc,new Uc,new kc,new Jc,new Gc];function Ae(e){if(typeof e=="boolean")return e?Fe():Os();const t={};for(const i of Zc)i.apply(t,e);const n=[];if(t.string!==!1&&n.push(t.string||oe()),t.number!==!1&&n.push(t.number||ge()),t.boolean!==!1&&n.push(t.boolean||ti()),t.null!==!1&&n.push(t.null||_i()),t.array!==!1&&n.push(t.array||Ie(Fe())),t.tuple!==!1&&t.tuple!==void 0&&n.push(t.tuple),t.object!==!1)if(t.object)n.push(t.object);else{const i=tc(s=>typeof s=="object"&&s!==null&&!Array.isArray(s),"Must be an object, not an array");n.push(i)}t.file!==!1&&t.file!==void 0&&n.push(t.file);let r;n.length===0?r=Os():n.length===1?r=n[0]:Object.keys(e).some(s=>s!=="$schema"&&s!=="title"&&s!=="description")?r=mt(n):r=Fe();for(const i of Xc)r=i.apply(r,e);return r}class As extends Event{constructor(t,n){var r,i;super(t),this.code=(r=n?.code)!=null?r:void 0,this.message=(i=n?.message)!=null?i:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,r){return r(_s(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(_s(this),n)}}function Qc(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function ni(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(ni).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${ni(e.cause)}`:e.message:`${e}`}function _s(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var aa=e=>{throw TypeError(e)},Fi=(e,t,n)=>t.has(e)||aa("Cannot "+n),G=(e,t,n)=>(Fi(e,t,"read from private field"),n?n.call(e):t.get(e)),Se=(e,t,n)=>t.has(e)?aa("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),he=(e,t,n,r)=>(Fi(e,t,"write to private field"),t.set(e,n),n),Qe=(e,t,n)=>(Fi(e,t,"access private method"),n),Te,Et,kt,Qn,ur,wn,qt,xn,ct,Lt,Gt,Bt,mn,Re,ri,ii,si,Is,oi,ai,yn,li,ci;class er extends EventTarget{constructor(t,n){var r,i;super(),Se(this,Re),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Se(this,Te),Se(this,Et),Se(this,kt),Se(this,Qn),Se(this,ur),Se(this,wn),Se(this,qt),Se(this,xn,null),Se(this,ct),Se(this,Lt),Se(this,Gt,null),Se(this,Bt,null),Se(this,mn,null),Se(this,ii,async s=>{var o;G(this,Lt).reset();const{body:a,redirected:l,status:c,headers:u}=s;if(c===204){Qe(this,Re,yn).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?he(this,kt,new URL(s.url)):he(this,kt,void 0),c!==200){Qe(this,Re,yn).call(this,`Non-200 status code (${c})`,c);return}if(!(u.get("content-type")||"").startsWith("text/event-stream")){Qe(this,Re,yn).call(this,'Invalid content type, expected "text/event-stream"',c);return}if(G(this,Te)===this.CLOSED)return;he(this,Te,this.OPEN);const f=new Event("open");if((o=G(this,mn))==null||o.call(this,f),this.dispatchEvent(f),typeof a!="object"||!a||!("getReader"in a)){Qe(this,Re,yn).call(this,"Invalid response body, expected a web ReadableStream",c),this.close();return}const h=new TextDecoder,m=a.getReader();let d=!0;do{const{done:p,value:y}=await m.read();y&&G(this,Lt).feed(h.decode(y,{stream:!p})),p&&(d=!1,G(this,Lt).reset(),Qe(this,Re,li).call(this))}while(d)}),Se(this,si,s=>{he(this,ct,void 0),!(s.name==="AbortError"||s.type==="aborted")&&Qe(this,Re,li).call(this,ni(s))}),Se(this,oi,s=>{typeof s.id=="string"&&he(this,xn,s.id);const o=new MessageEvent(s.event||"message",{data:s.data,origin:G(this,kt)?G(this,kt).origin:G(this,Et).origin,lastEventId:s.id||""});G(this,Bt)&&(!s.event||s.event==="message")&&G(this,Bt).call(this,o),this.dispatchEvent(o)}),Se(this,ai,s=>{he(this,wn,s)}),Se(this,ci,()=>{he(this,qt,void 0),G(this,Te)===this.CONNECTING&&Qe(this,Re,ri).call(this)});try{if(t instanceof URL)he(this,Et,t);else if(typeof t=="string")he(this,Et,new URL(t,eu()));else throw new Error("Invalid URL")}catch{throw Qc("An invalid or illegal string was specified")}he(this,Lt,cc({onEvent:G(this,oi),onRetry:G(this,ai)})),he(this,Te,this.CONNECTING),he(this,wn,3e3),he(this,ur,(r=n?.fetch)!=null?r:globalThis.fetch),he(this,Qn,(i=n?.withCredentials)!=null?i:!1),Qe(this,Re,ri).call(this)}get readyState(){return G(this,Te)}get url(){return G(this,Et).href}get withCredentials(){return G(this,Qn)}get onerror(){return G(this,Gt)}set onerror(t){he(this,Gt,t)}get onmessage(){return G(this,Bt)}set onmessage(t){he(this,Bt,t)}get onopen(){return G(this,mn)}set onopen(t){he(this,mn,t)}addEventListener(t,n,r){const i=n;super.addEventListener(t,i,r)}removeEventListener(t,n,r){const i=n;super.removeEventListener(t,i,r)}close(){G(this,qt)&&clearTimeout(G(this,qt)),G(this,Te)!==this.CLOSED&&(G(this,ct)&&G(this,ct).abort(),he(this,Te,this.CLOSED),he(this,ct,void 0))}}Te=new WeakMap,Et=new WeakMap,kt=new WeakMap,Qn=new WeakMap,ur=new WeakMap,wn=new WeakMap,qt=new WeakMap,xn=new WeakMap,ct=new WeakMap,Lt=new WeakMap,Gt=new WeakMap,Bt=new WeakMap,mn=new WeakMap,Re=new WeakSet,ri=function(){he(this,Te,this.CONNECTING),he(this,ct,new AbortController),G(this,ur)(G(this,Et),Qe(this,Re,Is).call(this)).then(G(this,ii)).catch(G(this,si))},ii=new WeakMap,si=new WeakMap,Is=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...G(this,xn)?{"Last-Event-ID":G(this,xn)}:void 0},cache:"no-store",signal:(e=G(this,ct))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},oi=new WeakMap,ai=new WeakMap,yn=function(e,t){var n;G(this,Te)!==this.CLOSED&&he(this,Te,this.CLOSED);const r=new As("error",{code:t,message:e});(n=G(this,Gt))==null||n.call(this,r),this.dispatchEvent(r)},li=function(e,t){var n;if(G(this,Te)===this.CLOSED)return;he(this,Te,this.CONNECTING);const r=new As("error",{code:t,message:e});(n=G(this,Gt))==null||n.call(this,r),this.dispatchEvent(r),he(this,qt,setTimeout(G(this,ci),G(this,wn)))},ci=new WeakMap,er.CONNECTING=0,er.OPEN=1,er.CLOSED=2;function eu(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}class tu extends Error{constructor(t,n,r){super(`SSE error: ${n}`),this.code=t,this.event=r}}class nu{constructor(t,n){this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._eventSourceInit=n?.eventSourceInit,this._requestInit=n?.requestInit,this._authProvider=n?.authProvider,this._fetch=n?.fetch,this._fetchWithInit=uc(n?.fetch,n?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new fn("No auth provider");let t;try{t=await Cr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(n){throw this.onerror?.(n),n}if(t!=="AUTHORIZED")throw new fn;return await this._startOrAuth()}async _commonHeaders(){const t={};if(this._authProvider){const r=await this._authProvider.tokens();r&&(t.Authorization=`Bearer ${r.access_token}`)}this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);const n=fc(this._requestInit?.headers);return new Headers({...t,...n})}_startOrAuth(){const t=this?._eventSourceInit?.fetch??this._fetch??fetch;return new Promise((n,r)=>{this._eventSource=new er(this._url.href,{...this._eventSourceInit,fetch:async(i,s)=>{const o=await this._commonHeaders();o.set("Accept","text/event-stream");const a=await t(i,{...s,headers:o});if(a.status===401&&a.headers.has("www-authenticate")){const{resourceMetadataUrl:l,scope:c}=xs(a);this._resourceMetadataUrl=l,this._scope=c}return a}}),this._abortController=new AbortController,this._eventSource.onerror=i=>{if(i.code===401&&this._authProvider){this._authThenStart().then(n,r);return}const s=new tu(i.code,i.message,i);r(s),this.onerror?.(s)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",i=>{const s=i;try{if(this._endpoint=new URL(s.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(o){r(o),this.onerror?.(o),this.close();return}n()}),this._eventSource.onmessage=i=>{const s=i;let o;try{o=sa.parse(JSON.parse(s.data))}catch(a){this.onerror?.(a);return}this.onmessage?.(o)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(t){if(!this._authProvider)throw new fn("No auth provider");if(await Cr(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fn("Failed to authorize")}async close(){this._abortController?.abort(),this._eventSource?.close(),this.onclose?.()}async send(t){if(!this._endpoint)throw new Error("Not connected");try{const n=await this._commonHeaders();n.set("content-type","application/json");const r={...this._requestInit,method:"POST",headers:n,body:JSON.stringify(t),signal:this._abortController?.signal},i=await(this._fetch??fetch)(this._endpoint,r);if(!i.ok){const s=await i.text().catch(()=>null);if(i.status===401&&this._authProvider){const{resourceMetadataUrl:o,scope:a}=xs(i);if(this._resourceMetadataUrl=o,this._scope=a,await Cr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fn;return this.send(t)}throw new Error(`Error POSTing to endpoint (HTTP ${i.status}): ${s}`)}await i.body?.cancel()}catch(n){throw this.onerror?.(n),n}}setProtocolVersion(t){this._protocolVersion=t}}const ru="mcp";class iu{constructor(t){this._url=t}start(){if(this._socket)throw new Error("WebSocketClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((t,n)=>{this._socket=new WebSocket(this._url,ru),this._socket.onerror=r=>{const i="error"in r?r.error:new Error(`WebSocket error: ${JSON.stringify(r)}`);n(i),this.onerror?.(i)},this._socket.onopen=()=>{t()},this._socket.onclose=()=>{this.onclose?.()},this._socket.onmessage=r=>{let i;try{i=sa.parse(JSON.parse(r.data))}catch(s){this.onerror?.(s);return}this.onmessage?.(i)}})}async close(){this._socket?.close()}send(t){return new Promise((n,r)=>{if(!this._socket){r(new Error("Not connected"));return}this._socket?.send(JSON.stringify(t)),n()})}}class su extends dc{constructor(t,n){super(t,n)}send(t,n){const r=ou(t);return r?.type==="emit"?(this.onmessage?.(r.message),Promise.resolve()):r?.type==="suppress"?Promise.resolve():super.send(t,n)}}function ou(e){const t=e;if(!t||typeof t!="object"||!("method"in t))return null;switch(t.method){case"initialize":{const n=t?.params?.protocolVersion;return n?{type:"emit",message:{result:{protocolVersion:n,capabilities:{tools:{}},serverInfo:{name:"deco-chat-server",version:"1.0.0"}},jsonrpc:t.jsonrpc??"2.0",id:t.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}class au extends hc{constructor(t,n){super(t,n)}async listTools(t,n){return await this.request({method:"tools/list",params:t},sc,n)}}const lu=async(e,t,n)=>{const r=cu(e.connection,t,n);if(!r)throw new Error("Unknown MCP connection type");const i=new au({name:e?.name??"MCP Client",version:"1.0.0"});return await i.connect(r),{client:i}},cu=(e,t,n)=>{if(e.type==="Websocket")return new iu(new URL(e.url));if(e.type!=="SSE"&&e.type!=="HTTP")return null;const i={...e.token?{authorization:`Bearer ${e.token}`}:{},...n??{},..."headers"in e?e.headers||{}:{}};if(e.type==="SSE"){const s={requestInit:{headers:i,signal:t}};return e.token&&(s.eventSourceInit={fetch:(o,a)=>fetch(o,{...a,headers:{...i,Accept:"text/event-stream"},signal:t})}),new nu(new URL(e.url),s)}return new su(new URL(e.url),{requestInit:{headers:i,signal:t,credentials:"include"}})},Ts=e=>{try{return JSON.parse(e)}catch{return e}},zn=new Map,Cs=(e,t)=>({...e,id:e.name,inputSchema:e.inputSchema?Ae(e.inputSchema):void 0,outputSchema:e.outputSchema?Ae(e.outputSchema):void 0,execute:n=>t(n.context,e.name)});function uu(e){const t=n=>"connection"in e?lu({connection:e.connection},void 0,n):e.client;return new Proxy({},{get(n,r){if(r==="toJSON")return null;if(typeof r!="string")throw new Error("Name must be a string");if(r==="listTools")return a;async function i(l,c=r){const u=e?.debugId?.(),f=u?{"x-trace-debug-id":u}:void 0,{client:h}=await t(f),{structuredContent:m,isError:d,content:p}=await h.callTool({name:String(c),arguments:l});if(d){const S=p?.[0]?.text,O=typeof S=="string"?Ts(S):null,E=O?.code&&typeof e?.getErrorByStatusCode=="function"?e.getErrorByStatusCode(O.code,O.message,O.traceId):null;throw E||new Error(`Tool ${String(c)} returned an error: ${JSON.stringify(m??p)}`)}if(m!==void 0)return m;const y=p?.[0]?.text;return typeof y=="string"?Ts(y):void 0}async function s(){const{client:l}=await t(),{tools:c}=await l.listTools();return c}async function o(){if(!("connection"in e))return s();const l=e.connection,c=JSON.stringify(l);try{return zn.has(c)||zn.set(c,s()),await zn.get(c)}catch(u){console.error("Failed to list tools",u),zn.delete(c);return}}async function a(){return(await o()??[]).map(c=>Cs(c,i))}return i.asTool=async()=>{const c=(await o()??[]).find(u=>u.name===r);if(!c)throw new Error(`Tool ${r} not found`);return Cs(c,i)},i}})}new Proxy({},{get(e,t){return t==="toJSON"?null:t==="forConnection"?n=>fu({connection:n}):global[t]}});function fu(e){return uu(e)}const du=_e({toolName:oe().describe("Name of the tool to invoke on that connection"),transformCode:oe().optional().describe("Pure TypeScript function for data transformation of the tool call result. Must be a TypeScript file that declares the Output interface and exports a default function: `interface Output { ... } export default async function(stepInput): Output { ... }`\n The stepInput will match with the tool call outputSchema. If transformCode is not provided, the tool call result will be used as the step output.\n Providing an transformCode is recommended because it both allows you to transform the data and validate it against a JSON Schema - tools are ephemeral and may return unexpected data.")}),hu=_e({code:oe().describe(`Pure TypeScript function for data transformation. Useful to merge data from multiple steps and transform it. Must be a TypeScript file that declares the Output interface and exports a default function: \`interface Output { ... } export default async function(stepInput): Output { ... }\`
|
|
1
|
+
import{dl as Fe,bo as Os,P as oe,M as ge,aq as ti,bV as _i,an as Ie,bm as mt,aY as qe,ao as mr,dm as rn,J as _e,dn as Ii,dp as ws,dq as ec,bT as tc,dr as ia,ds as nc,dt as rc,du as ic,cS as fn,cT as Cr,cU as xs,bM as sa,bE as sc,aM as ze,bU as oc,ap as On,b9 as Ti,dv as ac,r as N,j as w,dw as oa,cF as lc}from"./index-c9Pbt5D9.js";import{b as cc,d as uc,n as fc,e as dc,C as hc,A as pc}from"./constants-V3SVDRSK.js";import{B as Ci,c as Pi}from"./collections-DYNhGJEX.js";import{R as Es}from"./index-DFLHG9Oe.js";var mc=class{apply(e,t){if(!t.type)return;const n=Array.isArray(t.type)?t.type:[t.type],r=new Set(n);if(r.has("string")||(e.string=!1),!r.has("number")&&!r.has("integer")&&(e.number=!1),r.has("boolean")||(e.boolean=!1),r.has("null")||(e.null=!1),r.has("array")||(e.array=!1),r.has("object")||(e.object=!1),r.has("integer")&&e.number!==!1){const i=e.number||ge();i instanceof rn&&(e.number=i.int())}}},yc=class{apply(e,t){if(t.const===void 0)return;const n=t.const;e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1,typeof n=="string"?e.string=qe(n):typeof n=="number"?e.number=qe(n):typeof n=="boolean"?e.boolean=qe(n):n===null?e.null=_i():Array.isArray(n)?e.array=void 0:typeof n=="object"&&(e.object=void 0)}},gc=class{apply(e,t){if(!t.enum)return;if(t.enum.length===0){t.type||(e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1);return}const n={string:t.enum.filter(r=>typeof r=="string"),number:t.enum.filter(r=>typeof r=="number"),boolean:t.enum.filter(r=>typeof r=="boolean"),null:t.enum.filter(r=>r===null),array:t.enum.filter(r=>Array.isArray(r)),object:t.enum.filter(r=>typeof r=="object"&&r!==null&&!Array.isArray(r))};e.string=this.createTypeSchema(n.string,"string"),e.number=this.createTypeSchema(n.number,"number"),e.boolean=this.createTypeSchema(n.boolean,"boolean"),e.null=n.null.length>0?_i():!1,e.array=n.array.length>0?void 0:!1,e.object=n.object.length>0?void 0:!1}createTypeSchema(e,t){if(e.length===0)return!1;if(e.length===1)return qe(e[0]);if(t==="string")return mr(e);if(t==="number"){const[n,r,...i]=e;return mt([qe(n),qe(r),...i.map(s=>qe(s))])}return t==="boolean"?mt([qe(!0),qe(!1)]):!1}},bc=class{apply(e,t){const n=t;if(n.type==="string"&&n.format==="binary"&&n.contentEncoding==="binary"){let r=ic();n.minLength!==void 0&&(r=r.min(n.minLength)),n.maxLength!==void 0&&(r=r.max(n.maxLength)),n.contentMediaType!==void 0&&(r=r.mime(n.contentMediaType)),e.file=r,e.string=!1}}},Sc=class{apply(e,t){const n=t;t.type===void 0&&(n.minLength!==void 0||n.maxLength!==void 0||n.pattern!==void 0)&&e.string===void 0&&(e.string=oe())}},vc=class{apply(e,t){const n=t;if(n.minLength!==void 0&&e.string!==!1){const r=e.string||oe();r instanceof Ii&&(e.string=r.refine(i=>Array.from(i).length>=n.minLength,{message:`String must be at least ${n.minLength} characters long`}))}}},Oc=class{apply(e,t){const n=t;if(n.maxLength!==void 0&&e.string!==!1){const r=e.string||oe();r instanceof Ii&&(e.string=r.refine(i=>Array.from(i).length<=n.maxLength,{message:`String must be at most ${n.maxLength} characters long`}))}}},wc=class{apply(e,t){const n=t;if(n.pattern&&e.string!==!1){const r=e.string||oe();if(r instanceof Ii){const i=new RegExp(n.pattern);e.string=r.regex(i)}}}},xc=class{apply(e,t){const n=t;if(n.minimum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.min(n.minimum))}}},Ec=class{apply(e,t){const n=t;if(n.maximum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.max(n.maximum))}}},Ac=class{apply(e,t){const n=t;if(n.exclusiveMinimum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(typeof n.exclusiveMinimum=="number"?e.number=r.gt(n.exclusiveMinimum):e.number=!1)}}},_c=class{apply(e,t){const n=t;if(n.exclusiveMaximum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(typeof n.exclusiveMaximum=="number"?e.number=r.lt(n.exclusiveMaximum):e.number=!1)}}},Ic=class{apply(e,t){const n=t;if(n.multipleOf!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.refine(i=>{if(n.multipleOf===0)return!1;const s=i/n.multipleOf,o=Math.round(s),a=Math.min(Math.abs(i)*Number.EPSILON*10,Math.abs(n.multipleOf)*Number.EPSILON*10);return Math.abs(s-o)<=a/Math.abs(n.multipleOf)},{message:`Must be a multiple of ${n.multipleOf}`}))}}},Tc=class{apply(e,t){const n=t;t.type===void 0&&(n.minItems!==void 0||n.maxItems!==void 0||n.items!==void 0||n.prefixItems!==void 0)&&e.array===void 0&&(e.array=Ie(Fe()))}},Cc=class{apply(e,t){const n=t;n.minItems!==void 0&&e.array!==!1&&(e.array=(e.array||Ie(Fe())).min(n.minItems))}},Pc=class{apply(e,t){const n=t;n.maxItems!==void 0&&e.array!==!1&&(e.array=(e.array||Ie(Fe())).max(n.maxItems))}},Fc=class{apply(e,t){const n=t;if(e.array!==!1)if(Array.isArray(n.items))e.array=e.array||Ie(Fe());else if(n.items&&typeof n.items!="boolean"&&!n.prefixItems){const r=Ae(n.items);let i=Ie(r);if(e.array&&e.array instanceof ec){const s=e.array._def;s.checks&&s.checks.forEach(o=>{if(o._zod&&o._zod.def){const a=o._zod.def;a.check==="min_length"&&a.minimum!==void 0?i=i.min(a.minimum):a.check==="max_length"&&a.maximum!==void 0&&(i=i.max(a.maximum))}})}e.array=i}else typeof n.items=="boolean"&&n.items===!1?n.prefixItems?e.array=e.array||Ie(Fe()):e.array=Ie(Fe()).max(0):typeof n.items=="boolean"&&n.items===!0?e.array=e.array||Ie(Fe()):n.prefixItems&&(e.array=e.array||Ie(Fe()))}},jc=class{apply(e,t){if(t.type!=="array")return;const n=t;if(!Array.isArray(n.items)||e.array===!1)return;const r=n.items.map(s=>Ae(s));let i;r.length===0?i=ws([]):i=ws(r),n.minItems!==void 0&&n.minItems>r.length&&(i=!1),n.maxItems!==void 0&&n.maxItems<r.length&&(i=!1),e.tuple=i,e.array=!1}},$c=class{apply(e,t){const n=t;e.object!==!1&&(n.properties||n.required||n.additionalProperties!==void 0)&&(e.object=e.object||_e({}).passthrough())}},Dc=class{apply(e,t){const n=t;t.type===void 0&&(n.maxProperties!==void 0||n.minProperties!==void 0)&&e.object===void 0&&(e.object=_e({}).passthrough())}},Nc=class{apply(e,t){const n=t;if(n.maxProperties!==void 0&&e.object!==!1){const r=e.object||_e({}).passthrough();e.object=r.refine(i=>Object.keys(i).length<=n.maxProperties,{message:`Object must have at most ${n.maxProperties} properties`})}}},Rc=class{apply(e,t){const n=t;if(n.minProperties!==void 0&&e.object!==!1){const r=e.object||_e({}).passthrough();e.object=r.refine(i=>Object.keys(i).length>=n.minProperties,{message:`Object must have at least ${n.minProperties} properties`})}}};function Cn(e,t){if(e===t)return!0;if(e==null||t==null)return e===t;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((n,r)=>Cn(n,t[r]));if(typeof e=="object"&&typeof t=="object"){const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(i=>r.includes(i)&&Cn(e[i],t[i]))}return!1}function Mc(){return e=>{if(!Array.isArray(e))return!0;const t=[];return e.every(n=>t.some(i=>Cn(n,i))?!1:(t.push(n),!0))}}function cr(e,t){return e.safeParse(t).success}var Uc=class{apply(e,t){if(!t.not)return e;const n=Ae(t.not);return e.refine(r=>!cr(n,r),{message:"Value must not match the 'not' schema"})}},kc=class{apply(e,t){return t.uniqueItems!==!0?e:e.refine(Mc(),{message:"Array items must be unique"})}},Lc=class{apply(e,t){return!t.allOf||t.allOf.length===0?e:t.allOf.map(r=>Ae(r)).reduce((r,i)=>ia(r,i),e)}},Bc=class{apply(e,t){if(!t.anyOf||t.anyOf.length===0)return e;const n=t.anyOf.length===1?Ae(t.anyOf[0]):mt([Ae(t.anyOf[0]),Ae(t.anyOf[1]),...t.anyOf.slice(2).map(r=>Ae(r))]);return ia(e,n)}},Wc=class{apply(e,t){if(!t.oneOf||t.oneOf.length===0)return e;const n=t.oneOf.map(r=>Ae(r));return e.refine(r=>{let i=0;for(const s of n)if(s.safeParse(r).success&&(i++,i>1))return!1;return i===1},{message:"Value must match exactly one of the oneOf schemas"})}},qc=class{apply(e,t){const n=t;if(n.prefixItems&&Array.isArray(n.prefixItems)){const i=n.prefixItems.map(s=>Ae(s));return e.refine(s=>{if(!Array.isArray(s))return!0;for(let o=0;o<Math.min(s.length,i.length);o++)if(!cr(i[o],s[o]))return!1;if(s.length>i.length){if(typeof n.items=="boolean"&&n.items===!1)return!1;if(n.items&&typeof n.items=="object"&&!Array.isArray(n.items)){const o=Ae(n.items);for(let a=i.length;a<s.length;a++)if(!cr(o,s[a]))return!1}}return!0},{message:"Array does not match prefixItems schema"})}return e}},Vc=class{apply(e,t){const n=t;if(!n.properties&&!n.required&&n.additionalProperties!==!1)return e;if(e instanceof nc||e instanceof rc){const r={};if(n.properties)for(const[i,s]of Object.entries(n.properties))s!==void 0&&(r[i]=Ae(s));if(n.required&&Array.isArray(n.required)){const i=new Set(n.required);for(const s of Object.keys(r))i.has(s)||(r[s]=r[s].optional())}else for(const i of Object.keys(r))r[i]=r[i].optional();return n.additionalProperties===!1?_e(r):_e(r).passthrough()}return e.refine(r=>{if(typeof r!="object"||r===null||Array.isArray(r))return!0;if(n.properties){for(const[i,s]of Object.entries(n.properties))if(s!==void 0&&Object.getOwnPropertyDescriptor(r,i)!==void 0&&!Ae(s).safeParse(r[i]).success)return!1}if(n.required&&Array.isArray(n.required)){for(const i of n.required)if(!(Object.getOwnPropertyDescriptor(r,i)!==void 0))return!1}if(n.additionalProperties===!1&&n.properties){const i=new Set(Object.keys(n.properties));for(const s in r)if(!i.has(s))return!1}return!0},{message:"Object constraints validation failed"})}},Hc=class{apply(e,t){if(!t.enum||t.enum.length===0)return e;const n=t.enum.filter(r=>Array.isArray(r)||typeof r=="object"&&r!==null);return n.length===0?e:e.refine(r=>typeof r!="object"||r===null?!0:n.some(i=>Cn(r,i)),{message:"Value must match one of the enum values"})}},Kc=class{apply(e,t){if(t.const===void 0)return e;const n=t.const;return typeof n!="object"||n===null?e:e.refine(r=>Cn(r,n),{message:"Value must equal the const value"})}},Gc=class{apply(e,t){return t.description&&(e=e.describe(t.description)),e}},zc=class{apply(e,t){var n;const r=t;return!((n=r.required)!=null&&n.includes("__proto__"))||t.type!==void 0?e:Fe().refine(i=>this.validateRequired(i,r.required),{message:"Missing required properties"})}validateRequired(e,t){return typeof e!="object"||e===null||Array.isArray(e)?!0:t.every(n=>Object.prototype.hasOwnProperty.call(e,n))}},Yc=class{apply(e,t){var n;const r=t;if(r.contains===void 0)return e;const i=Ae(r.contains),s=(n=r.minContains)!=null?n:1,o=r.maxContains;return e.refine(a=>{if(!Array.isArray(a))return!0;let l=0;for(const c of a)cr(i,c)&&l++;return!(l<s||o!==void 0&&l>o)},{message:"Array must contain required items matching the schema"})}},Jc=class{apply(e,t){const{default:n}=t;return n===void 0||!e.safeParse(n).success?e:e.default(n)}},Zc=[new yc,new gc,new mc,new bc,new Sc,new Tc,new Dc,new vc,new Oc,new wc,new xc,new Ec,new Ac,new _c,new Ic,new jc,new Cc,new Pc,new Fc,new Nc,new Rc,new $c],Xc=[new zc,new Hc,new Kc,new Lc,new Bc,new Wc,new qc,new Vc,new Yc,new Uc,new kc,new Jc,new Gc];function Ae(e){if(typeof e=="boolean")return e?Fe():Os();const t={};for(const i of Zc)i.apply(t,e);const n=[];if(t.string!==!1&&n.push(t.string||oe()),t.number!==!1&&n.push(t.number||ge()),t.boolean!==!1&&n.push(t.boolean||ti()),t.null!==!1&&n.push(t.null||_i()),t.array!==!1&&n.push(t.array||Ie(Fe())),t.tuple!==!1&&t.tuple!==void 0&&n.push(t.tuple),t.object!==!1)if(t.object)n.push(t.object);else{const i=tc(s=>typeof s=="object"&&s!==null&&!Array.isArray(s),"Must be an object, not an array");n.push(i)}t.file!==!1&&t.file!==void 0&&n.push(t.file);let r;n.length===0?r=Os():n.length===1?r=n[0]:Object.keys(e).some(s=>s!=="$schema"&&s!=="title"&&s!=="description")?r=mt(n):r=Fe();for(const i of Xc)r=i.apply(r,e);return r}class As extends Event{constructor(t,n){var r,i;super(t),this.code=(r=n?.code)!=null?r:void 0,this.message=(i=n?.message)!=null?i:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,r){return r(_s(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(_s(this),n)}}function Qc(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function ni(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(ni).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${ni(e.cause)}`:e.message:`${e}`}function _s(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var aa=e=>{throw TypeError(e)},Fi=(e,t,n)=>t.has(e)||aa("Cannot "+n),G=(e,t,n)=>(Fi(e,t,"read from private field"),n?n.call(e):t.get(e)),Se=(e,t,n)=>t.has(e)?aa("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),he=(e,t,n,r)=>(Fi(e,t,"write to private field"),t.set(e,n),n),Qe=(e,t,n)=>(Fi(e,t,"access private method"),n),Te,Et,kt,Qn,ur,wn,qt,xn,ct,Lt,Gt,Bt,mn,Re,ri,ii,si,Is,oi,ai,yn,li,ci;class er extends EventTarget{constructor(t,n){var r,i;super(),Se(this,Re),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Se(this,Te),Se(this,Et),Se(this,kt),Se(this,Qn),Se(this,ur),Se(this,wn),Se(this,qt),Se(this,xn,null),Se(this,ct),Se(this,Lt),Se(this,Gt,null),Se(this,Bt,null),Se(this,mn,null),Se(this,ii,async s=>{var o;G(this,Lt).reset();const{body:a,redirected:l,status:c,headers:u}=s;if(c===204){Qe(this,Re,yn).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?he(this,kt,new URL(s.url)):he(this,kt,void 0),c!==200){Qe(this,Re,yn).call(this,`Non-200 status code (${c})`,c);return}if(!(u.get("content-type")||"").startsWith("text/event-stream")){Qe(this,Re,yn).call(this,'Invalid content type, expected "text/event-stream"',c);return}if(G(this,Te)===this.CLOSED)return;he(this,Te,this.OPEN);const f=new Event("open");if((o=G(this,mn))==null||o.call(this,f),this.dispatchEvent(f),typeof a!="object"||!a||!("getReader"in a)){Qe(this,Re,yn).call(this,"Invalid response body, expected a web ReadableStream",c),this.close();return}const h=new TextDecoder,m=a.getReader();let d=!0;do{const{done:p,value:y}=await m.read();y&&G(this,Lt).feed(h.decode(y,{stream:!p})),p&&(d=!1,G(this,Lt).reset(),Qe(this,Re,li).call(this))}while(d)}),Se(this,si,s=>{he(this,ct,void 0),!(s.name==="AbortError"||s.type==="aborted")&&Qe(this,Re,li).call(this,ni(s))}),Se(this,oi,s=>{typeof s.id=="string"&&he(this,xn,s.id);const o=new MessageEvent(s.event||"message",{data:s.data,origin:G(this,kt)?G(this,kt).origin:G(this,Et).origin,lastEventId:s.id||""});G(this,Bt)&&(!s.event||s.event==="message")&&G(this,Bt).call(this,o),this.dispatchEvent(o)}),Se(this,ai,s=>{he(this,wn,s)}),Se(this,ci,()=>{he(this,qt,void 0),G(this,Te)===this.CONNECTING&&Qe(this,Re,ri).call(this)});try{if(t instanceof URL)he(this,Et,t);else if(typeof t=="string")he(this,Et,new URL(t,eu()));else throw new Error("Invalid URL")}catch{throw Qc("An invalid or illegal string was specified")}he(this,Lt,cc({onEvent:G(this,oi),onRetry:G(this,ai)})),he(this,Te,this.CONNECTING),he(this,wn,3e3),he(this,ur,(r=n?.fetch)!=null?r:globalThis.fetch),he(this,Qn,(i=n?.withCredentials)!=null?i:!1),Qe(this,Re,ri).call(this)}get readyState(){return G(this,Te)}get url(){return G(this,Et).href}get withCredentials(){return G(this,Qn)}get onerror(){return G(this,Gt)}set onerror(t){he(this,Gt,t)}get onmessage(){return G(this,Bt)}set onmessage(t){he(this,Bt,t)}get onopen(){return G(this,mn)}set onopen(t){he(this,mn,t)}addEventListener(t,n,r){const i=n;super.addEventListener(t,i,r)}removeEventListener(t,n,r){const i=n;super.removeEventListener(t,i,r)}close(){G(this,qt)&&clearTimeout(G(this,qt)),G(this,Te)!==this.CLOSED&&(G(this,ct)&&G(this,ct).abort(),he(this,Te,this.CLOSED),he(this,ct,void 0))}}Te=new WeakMap,Et=new WeakMap,kt=new WeakMap,Qn=new WeakMap,ur=new WeakMap,wn=new WeakMap,qt=new WeakMap,xn=new WeakMap,ct=new WeakMap,Lt=new WeakMap,Gt=new WeakMap,Bt=new WeakMap,mn=new WeakMap,Re=new WeakSet,ri=function(){he(this,Te,this.CONNECTING),he(this,ct,new AbortController),G(this,ur)(G(this,Et),Qe(this,Re,Is).call(this)).then(G(this,ii)).catch(G(this,si))},ii=new WeakMap,si=new WeakMap,Is=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...G(this,xn)?{"Last-Event-ID":G(this,xn)}:void 0},cache:"no-store",signal:(e=G(this,ct))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},oi=new WeakMap,ai=new WeakMap,yn=function(e,t){var n;G(this,Te)!==this.CLOSED&&he(this,Te,this.CLOSED);const r=new As("error",{code:t,message:e});(n=G(this,Gt))==null||n.call(this,r),this.dispatchEvent(r)},li=function(e,t){var n;if(G(this,Te)===this.CLOSED)return;he(this,Te,this.CONNECTING);const r=new As("error",{code:t,message:e});(n=G(this,Gt))==null||n.call(this,r),this.dispatchEvent(r),he(this,qt,setTimeout(G(this,ci),G(this,wn)))},ci=new WeakMap,er.CONNECTING=0,er.OPEN=1,er.CLOSED=2;function eu(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}class tu extends Error{constructor(t,n,r){super(`SSE error: ${n}`),this.code=t,this.event=r}}class nu{constructor(t,n){this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._eventSourceInit=n?.eventSourceInit,this._requestInit=n?.requestInit,this._authProvider=n?.authProvider,this._fetch=n?.fetch,this._fetchWithInit=uc(n?.fetch,n?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new fn("No auth provider");let t;try{t=await Cr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(n){throw this.onerror?.(n),n}if(t!=="AUTHORIZED")throw new fn;return await this._startOrAuth()}async _commonHeaders(){const t={};if(this._authProvider){const r=await this._authProvider.tokens();r&&(t.Authorization=`Bearer ${r.access_token}`)}this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);const n=fc(this._requestInit?.headers);return new Headers({...t,...n})}_startOrAuth(){const t=this?._eventSourceInit?.fetch??this._fetch??fetch;return new Promise((n,r)=>{this._eventSource=new er(this._url.href,{...this._eventSourceInit,fetch:async(i,s)=>{const o=await this._commonHeaders();o.set("Accept","text/event-stream");const a=await t(i,{...s,headers:o});if(a.status===401&&a.headers.has("www-authenticate")){const{resourceMetadataUrl:l,scope:c}=xs(a);this._resourceMetadataUrl=l,this._scope=c}return a}}),this._abortController=new AbortController,this._eventSource.onerror=i=>{if(i.code===401&&this._authProvider){this._authThenStart().then(n,r);return}const s=new tu(i.code,i.message,i);r(s),this.onerror?.(s)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",i=>{const s=i;try{if(this._endpoint=new URL(s.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(o){r(o),this.onerror?.(o),this.close();return}n()}),this._eventSource.onmessage=i=>{const s=i;let o;try{o=sa.parse(JSON.parse(s.data))}catch(a){this.onerror?.(a);return}this.onmessage?.(o)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(t){if(!this._authProvider)throw new fn("No auth provider");if(await Cr(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fn("Failed to authorize")}async close(){this._abortController?.abort(),this._eventSource?.close(),this.onclose?.()}async send(t){if(!this._endpoint)throw new Error("Not connected");try{const n=await this._commonHeaders();n.set("content-type","application/json");const r={...this._requestInit,method:"POST",headers:n,body:JSON.stringify(t),signal:this._abortController?.signal},i=await(this._fetch??fetch)(this._endpoint,r);if(!i.ok){const s=await i.text().catch(()=>null);if(i.status===401&&this._authProvider){const{resourceMetadataUrl:o,scope:a}=xs(i);if(this._resourceMetadataUrl=o,this._scope=a,await Cr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fn;return this.send(t)}throw new Error(`Error POSTing to endpoint (HTTP ${i.status}): ${s}`)}await i.body?.cancel()}catch(n){throw this.onerror?.(n),n}}setProtocolVersion(t){this._protocolVersion=t}}const ru="mcp";class iu{constructor(t){this._url=t}start(){if(this._socket)throw new Error("WebSocketClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((t,n)=>{this._socket=new WebSocket(this._url,ru),this._socket.onerror=r=>{const i="error"in r?r.error:new Error(`WebSocket error: ${JSON.stringify(r)}`);n(i),this.onerror?.(i)},this._socket.onopen=()=>{t()},this._socket.onclose=()=>{this.onclose?.()},this._socket.onmessage=r=>{let i;try{i=sa.parse(JSON.parse(r.data))}catch(s){this.onerror?.(s);return}this.onmessage?.(i)}})}async close(){this._socket?.close()}send(t){return new Promise((n,r)=>{if(!this._socket){r(new Error("Not connected"));return}this._socket?.send(JSON.stringify(t)),n()})}}class su extends dc{constructor(t,n){super(t,n)}send(t,n){const r=ou(t);return r?.type==="emit"?(this.onmessage?.(r.message),Promise.resolve()):r?.type==="suppress"?Promise.resolve():super.send(t,n)}}function ou(e){const t=e;if(!t||typeof t!="object"||!("method"in t))return null;switch(t.method){case"initialize":{const n=t?.params?.protocolVersion;return n?{type:"emit",message:{result:{protocolVersion:n,capabilities:{tools:{}},serverInfo:{name:"deco-chat-server",version:"1.0.0"}},jsonrpc:t.jsonrpc??"2.0",id:t.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}class au extends hc{constructor(t,n){super(t,n)}async listTools(t,n){return await this.request({method:"tools/list",params:t},sc,n)}}const lu=async(e,t,n)=>{const r=cu(e.connection,t,n);if(!r)throw new Error("Unknown MCP connection type");const i=new au({name:e?.name??"MCP Client",version:"1.0.0"});return await i.connect(r),{client:i}},cu=(e,t,n)=>{if(e.type==="Websocket")return new iu(new URL(e.url));if(e.type!=="SSE"&&e.type!=="HTTP")return null;const i={...e.token?{authorization:`Bearer ${e.token}`}:{},...n??{},..."headers"in e?e.headers||{}:{}};if(e.type==="SSE"){const s={requestInit:{headers:i,signal:t}};return e.token&&(s.eventSourceInit={fetch:(o,a)=>fetch(o,{...a,headers:{...i,Accept:"text/event-stream"},signal:t})}),new nu(new URL(e.url),s)}return new su(new URL(e.url),{requestInit:{headers:i,signal:t,credentials:"include"}})},Ts=e=>{try{return JSON.parse(e)}catch{return e}},zn=new Map,Cs=(e,t)=>({...e,id:e.name,inputSchema:e.inputSchema?Ae(e.inputSchema):void 0,outputSchema:e.outputSchema?Ae(e.outputSchema):void 0,execute:n=>t(n.context,e.name)});function uu(e){const t=n=>"connection"in e?lu({connection:e.connection},void 0,n):e.client;return new Proxy({},{get(n,r){if(r==="toJSON")return null;if(typeof r!="string")throw new Error("Name must be a string");if(r==="listTools")return a;async function i(l,c=r){const u=e?.debugId?.(),f=u?{"x-trace-debug-id":u}:void 0,{client:h}=await t(f),{structuredContent:m,isError:d,content:p}=await h.callTool({name:String(c),arguments:l});if(d){const S=p?.[0]?.text,O=typeof S=="string"?Ts(S):null,E=O?.code&&typeof e?.getErrorByStatusCode=="function"?e.getErrorByStatusCode(O.code,O.message,O.traceId):null;throw E||new Error(`Tool ${String(c)} returned an error: ${JSON.stringify(m??p)}`)}if(m!==void 0)return m;const y=p?.[0]?.text;return typeof y=="string"?Ts(y):void 0}async function s(){const{client:l}=await t(),{tools:c}=await l.listTools();return c}async function o(){if(!("connection"in e))return s();const l=e.connection,c=JSON.stringify(l);try{return zn.has(c)||zn.set(c,s()),await zn.get(c)}catch(u){console.error("Failed to list tools",u),zn.delete(c);return}}async function a(){return(await o()??[]).map(c=>Cs(c,i))}return i.asTool=async()=>{const c=(await o()??[]).find(u=>u.name===r);if(!c)throw new Error(`Tool ${r} not found`);return Cs(c,i)},i}})}new Proxy({},{get(e,t){return t==="toJSON"?null:t==="forConnection"?n=>fu({connection:n}):global[t]}});function fu(e){return uu(e)}const du=_e({toolName:oe().describe("Name of the tool to invoke on that connection"),transformCode:oe().optional().describe("Pure TypeScript function for data transformation of the tool call result. Must be a TypeScript file that declares the Output interface and exports a default function: `interface Output { ... } export default async function(stepInput): Output { ... }`\n The stepInput will match with the tool call outputSchema. If transformCode is not provided, the tool call result will be used as the step output.\n Providing an transformCode is recommended because it both allows you to transform the data and validate it against a JSON Schema - tools are ephemeral and may return unexpected data.")}),hu=_e({code:oe().describe(`Pure TypeScript function for data transformation. Useful to merge data from multiple steps and transform it. Must be a TypeScript file that declares the Output interface and exports a default function: \`interface Output { ... } export default async function(stepInput): Output { ... }\`
|
|
2
2
|
The stepInput is the resolved value of the references in the input field. Example:
|
|
3
3
|
{
|
|
4
4
|
"input": {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as C,r as $,j as s,t as V,q as $e,T as Rt,f as Oe,g as Dt,d as zs,L as Ts,c as X,W as Os,X as Ps,Y as Es,J as Rs,P as Ds,G as Fs,F as Gs,a as Bs,B as ot,b as Be,Z as Ls,o as Ge,$ as Us,D as Hs,a0 as Ks,K as Ys,n as qs,a1 as Ws,a2 as Xs,a3 as Qs,a4 as Js,a5 as Ve,a6 as Vs,a7 as Zs,a8 as en,a9 as tn,aa as Ft,ab as sn,ac as nn,ad as rn,ae as on,af as ln,ag as an,ah as cn,ai as dn,aj as un,ak as mn,p as fn,E as Gt}from"./index-c9Pbt5D9.js";import{u as xn}from"./useRouterState-DXQ9JAOk.js";import{A as Te,I as pn,J as _t,K as yt,G as hn,L as Bt,M as gn,N as bn}from"./agent-icon-BtPamQTT.js";import{u as Je,f as pe,g as Ae,h as lt,i as it,j as Le,k as Lt,l as Ut,m as jn,n as vn,o as ut}from"./sidebar-D-_ciNlc.js";import{T as ze}from"./toolbar-BXyHZxUa.js";import{S as Ht}from"./skeleton-CCsx--iC.js";import{P as at,a as Qe,b as ct}from"./popover-BLsl1Wwx.js";import{b as Kt,a as Yt,D as qt}from"./drawer-Bjmg0RR1.js";import{u as Wt,T as He,a as Ke,c as St,b as Ye}from"./tooltip-DuHhGuNb.js";import{C as _n}from"./collection-search-CRj5GlN2.js";import{s as yn}from"./Star01-Dsz3MamR.js";import{s as Ie}from"./Plus-D8dMVCG8.js";import{i as Sn,S as pt,u as ht,g as Cn}from"./constants-V3SVDRSK.js";import{b as Nn,u as Ze}from"./use-virtual-mcp-BzxmTmXo.js";import{u as wn,a as kn}from"./use-navigate-to-agent-CeGlZmmn.js";import{u as In}from"./use-create-virtual-mcp-ClMf9M2U.js";import{u as An,W as $n,H as Mn,S as zn}from"./use-create-website-agent-D_7O7M84.js";import{I as Tn,a as On,G as Pn}from"./github-repo-picker-TJIVPHBK.js";import{u as Xt,b as En}from"./hooks-BXgqK-cH.js";import{r as Rn,a as Dn,R as Fn,b as Gn,u as Qt}from"./shell-layout-DpoJLGrK.js";import{A as Ct}from"./avatar-CC5qXjgF.js";import{i as Jt}from"./Check-C6XoKiD0.js";import{a as Nt,i as Bn,b as Ln}from"./RefreshCcw01-NZxMXXUu.js";import{a as Un}from"./XCircle-BAnMq3y8.js";import{i as Hn,a as Vt}from"./ZapSquare-B5X0r34a.js";import{i as Kn}from"./Monitor01-BBeIQXwu.js";import{n as Yn,a as qn}from"./Sun-CjOl_eIW.js";import{a as et}from"./Settings02-DW-Wnk61.js";import{i as Wn}from"./Shield01-BF1LUqlj.js";import{a as Xn}from"./Users03-DxI7m72W.js";import{f as Qn,a as Jn,b as Vn,c as Zn,d as er,e as tr,A as sr}from"./alert-dialog-B9ApqUuI.js";import{F as nr,a as rr,b as or,c as lr,d as ir,e as ar,f as cr}from"./form-D_08NHUD.js";import{I as dr}from"./input-BGaLq3ax.js";import{S as ur}from"./spinner-Dbsg4e4M.js";import"./index-KugLBWj9.js";import{n as gt,i as mr}from"./Stars02-DU-eReiu.js";import{A as Zt}from"./add-connection-dialog-DeWWtS5l.js";import{s as fr}from"./XClose-BtlseQCi.js";import{i as bt}from"./ChevronRight-lpVCFpWI.js";import{a as es}from"./use-mcp-tools-BpkMOXfX.js";import{u as ts}from"./use-ai-providers-DXY8w1gk.js";import{i as xr}from"./FilterLines-C2GeuQuW.js";import{t as pr}from"./Users01-BXsiu59O.js";import{c as wt,d as ss,a as kt,b as It,S as At}from"./select-btdbQqQB.js";import{u as hr}from"./use-infinite-scroll-BIl8Btbp.js";import{c as gr,d as br,e as jr,a as vr,b as _r}from"./dialog-bygvGgb9.js";import{C as yr,a as Sr,b as Cr,c as Nr,d as wr}from"./command-CbYTzmrk.js";import{i as ns}from"./Zap-B9Rztg2v.js";import{H as kr,a as Ir,b as Ar}from"./hover-card-TYrElsp0.js";import{g as $r,S as Mr}from"./task-status-Cosx-AHw.js";import{f as zr}from"./format-time-GeUngI9C.js";import{g as Tr}from"./chat-context-C7AI4EyX.js";import{t as rs}from"./ChevronDown-BG0-uii1.js";function Or(t){const e=Oe(),{create:n}=Xt(),{locator:r}=$e(),o=Dt({strict:!1}),l=zs({strict:!1});return async i=>{const a=crypto.randomUUID(),c=i===l.virtualmcpid?Rn(t,r,o.taskId??""):null;try{await n({id:a,virtual_mcp_id:i,...c?{branch:c}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:a},search:{virtualmcpid:i}})}}function Pr(t){const e=C.c(9),{agent:n,onClick:r}=t;let o;e[0]!==n.icon||e[1]!==n.title?(o=s.jsx(Te,{icon:n.icon,name:n.title,size:"md",className:"transition-transform group-hover:scale-105"}),e[0]=n.icon,e[1]=n.title,e[2]=o):o=e[2];let l;e[3]!==n.title?(l=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground line-clamp-2 w-full",children:n.title}),e[3]=n.title,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==l?(i=s.jsxs("button",{type:"button",onClick:r,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[o,l]}),e[5]=r,e[6]=o,e[7]=l,e[8]=i):i=e[8],i}function Er(t){const e=C.c(92),{onClose:n,onOpenGithubImport:r}=t,[o,l]=$.useState(""),i=Nn(),{org:a}=$e();let c;e[0]!==i?(c=i.filter(Fr).map(Dr),e[0]=i,e[1]=c):c=e[1];const u=c,{pin:d,isPinned:m}=wn(a.id,u);let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f={navigateOnCreate:!0},e[2]=f):f=e[2];const{createVirtualMCP:p,isCreating:x}=In(f),{createFromTemplate:g,isCreating:h}=An(),[v]=Rt(),b=Or(a.slug);let j,_,S,y,k,N,M,I,z,A,P;if(e[3]!==i||e[4]!==g||e[5]!==p||e[6]!==x||e[7]!==h||e[8]!==m||e[9]!==b||e[10]!==n||e[11]!==r||e[12]!==d||e[13]!==v.experimental_vibecode||e[14]!==o){const K=o.toLowerCase();P=i.filter(Rr).filter(q=>!o||q.title.toLowerCase().includes(K));let R;e[26]!==m||e[27]!==b||e[28]!==n||e[29]!==d?(R=q=>{m(q.id)||d(q.id),n(),l(""),b(q.id)},e[26]=m,e[27]=b,e[28]=n,e[29]=d,e[30]=R):R=e[30];const ne=R;_="flex flex-col max-h-[min(640px,80dvh)]",e[31]!==o?(S=s.jsx(_n,{value:o,onChange:l,placeholder:"Search agents..."}),e[31]=o,e[32]=S):S=e[32],A="overflow-y-auto flex-1 min-h-0 px-3 pb-3",e[33]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("div",{className:"px-1 pt-3 pb-2",children:s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Agents"})}),e[33]=j):j=e[33],y="grid grid-cols-3 gap-1";let Q;e[34]!==p||e[35]!==n?(Q=async()=>{V("agent_create_new_clicked",{source:"browse_popover"}),await p(),n()},e[34]=p,e[35]=n,e[36]=Q):Q=e[36];let W,Z;e[37]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-dashed border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(Ie,{size:16,className:"text-muted-foreground"})}),Z=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Create new"}),e[37]=W,e[38]=Z):(W=e[37],Z=e[38]),e[39]!==x||e[40]!==Q?(k=s.jsxs("button",{type:"button",disabled:x,onClick:Q,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[W,Z]}),e[39]=x,e[40]=Q,e[41]=k):k=e[41];let ee;e[42]!==g||e[43]!==n?(ee=async()=>{V("agent_create_clicked",{source:"browse_popover",method:"website"}),await g($n),n()},e[42]=g,e[43]=n,e[44]=ee):ee=e[44];let L,Y;e[45]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(yn,{className:"size-5 text-muted-foreground"})}),Y=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Start Website"}),e[45]=L,e[46]=Y):(L=e[45],Y=e[46]),e[47]!==h||e[48]!==ee?(N=s.jsxs("button",{type:"button",disabled:h,onClick:ee,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[L,Y]}),e[47]=h,e[48]=ee,e[49]=N):N=e[49];let U;e[50]!==g||e[51]!==n?(U=async()=>{V("agent_create_clicked",{source:"browse_popover",method:"hydrogen"}),await g(Mn),n()},e[50]=g,e[51]=n,e[52]=U):U=e[52];let J,te;e[53]===Symbol.for("react.memo_cache_sentinel")?(J=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx("img",{src:zn,alt:"",className:"size-5 object-contain"})}),te=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Shopify Headless Store"}),e[53]=J,e[54]=te):(J=e[53],te=e[54]),e[55]!==h||e[56]!==U?(M=s.jsxs("button",{type:"button",disabled:h,onClick:U,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[J,te]}),e[55]=h,e[56]=U,e[57]=M):M=e[57],e[58]!==n||e[59]!==r||e[60]!==v.experimental_vibecode?(I=v.experimental_vibecode&&s.jsxs("button",{type:"button",onClick:()=>{V("agent_import_clicked",{source:"github"}),r(),n()},className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(Pn,{className:"size-5 text-muted-foreground"})}),s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import GitHub"})]}),e[58]=n,e[59]=r,e[60]=v.experimental_vibecode,e[61]=I):I=e[61];let se;e[62]!==ne?(se=q=>s.jsx(Pr,{agent:q,onClick:()=>ne(q)},q.id),e[62]=ne,e[63]=se):se=e[63],z=P.map(se),e[3]=i,e[4]=g,e[5]=p,e[6]=x,e[7]=h,e[8]=m,e[9]=b,e[10]=n,e[11]=r,e[12]=d,e[13]=v.experimental_vibecode,e[14]=o,e[15]=j,e[16]=_,e[17]=S,e[18]=y,e[19]=k,e[20]=N,e[21]=M,e[22]=I,e[23]=z,e[24]=A,e[25]=P}else j=e[15],_=e[16],S=e[17],y=e[18],k=e[19],N=e[20],M=e[21],I=e[22],z=e[23],A=e[24],P=e[25];let w;e[64]!==y||e[65]!==k||e[66]!==N||e[67]!==M||e[68]!==I||e[69]!==z?(w=s.jsxs("div",{className:y,children:[k,N,M,I,z]}),e[64]=y,e[65]=k,e[66]=N,e[67]=M,e[68]=I,e[69]=z,e[70]=w):w=e[70];let E;e[71]!==x||e[72]!==o||e[73]!==P.length?(E=P.length===0&&!x&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:o?"No agents found":"No agents yet"}),e[71]=x,e[72]=o,e[73]=P.length,e[74]=E):E=e[74];let T;e[75]!==j||e[76]!==w||e[77]!==E||e[78]!==A?(T=s.jsxs("div",{className:A,children:[j,w,E]}),e[75]=j,e[76]=w,e[77]=E,e[78]=A,e[79]=T):T=e[79];let D;e[80]!==a.slug?(D={org:a.slug},e[80]=a.slug,e[81]=D):D=e[81];let G;e[82]!==n?(G=()=>n(),e[82]=n,e[83]=G):G=e[83];let F;e[84]!==D||e[85]!==G?(F=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Ts,{to:"/$org/settings/agents",params:D,onClick:G,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[84]=D,e[85]=G,e[86]=F):F=e[86];let B;return e[87]!==_||e[88]!==S||e[89]!==T||e[90]!==F?(B=s.jsxs("div",{className:_,children:[S,T,F]}),e[87]=_,e[88]=S,e[89]=T,e[90]=F,e[91]=B):B=e[91],B}function Rr(t){return!Sn(t.id)}function Dr(t){return t.id}function Fr(t){return t.pinned}function os(t){const e=C.c(21);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:r}=n,o=r===void 0?!1:r,[l,i]=$.useState(!1),[a,c]=$.useState(!1),[u,d]=$.useState(!1),m=Wt(),{setOpenMobile:f}=Je();let p;e[2]!==m||e[3]!==f?(p=()=>{i(!1),m&&f(!1)},e[2]=m,e[3]=f,e[4]=p):p=e[4];const x=p;let g;e[5]!==x||e[6]!==l?(g=l&&s.jsx($.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(Ht,{className:"h-4 w-24"})}),children:s.jsx(Er,{onClose:x,onOpenImportDeco:()=>c(!0),onOpenGithubImport:()=>{d(!0),x()}})}),e[5]=x,e[6]=l,e[7]=g):g=e[7];const h=g;let v;e[8]!==o||e[9]!==m||e[10]!==l||e[11]!==h?(v=m?s.jsxs(s.Fragment,{children:[o?s.jsx(ze,{"aria-label":"Browse agents",onClick:()=>{V("agent_browser_opened",{surface:"mobile_drawer"}),i(!0)},children:s.jsx(Ie,{className:"size-4"})}):s.jsx(pe,{children:s.jsxs(Ae,{tooltip:"Browse agents",onClick:()=>{V("agent_browser_opened",{surface:"mobile_drawer"}),i(!0)},children:[s.jsx(Ie,{}),s.jsx("span",{children:"New agent"})]})}),s.jsx(Kt,{open:l,onOpenChange:i,direction:"bottom",children:s.jsxs(Yt,{className:"max-h-[85dvh] p-0",children:[s.jsx(qt,{className:"sr-only",children:"Browse agents"}),h]})})]}):s.jsxs(at,{open:l,onOpenChange:S=>{S&&!l&&V("agent_browser_opened",{surface:"desktop_popover"}),i(S)},children:[o?s.jsx(Qe,{asChild:!0,children:s.jsx(ze,{"aria-label":"Browse agents",children:s.jsx(Ie,{className:"size-4"})})}):s.jsx(pe,{children:s.jsx(Qe,{asChild:!0,children:s.jsxs(Ae,{tooltip:"Browse agents",children:[s.jsx(Ie,{}),s.jsx("span",{children:"New agent"})]})})}),s.jsx(ct,{className:"w-[380px] p-0 overflow-hidden",side:"right",align:"start",children:h})]}),e[8]=o,e[9]=m,e[10]=l,e[11]=h,e[12]=v):v=e[12];let b;e[13]!==a?(b=s.jsx(Tn,{open:a,onOpenChange:c}),e[13]=a,e[14]=b):b=e[14];let j;e[15]!==u?(j=s.jsx(On,{open:u,onOpenChange:d}),e[15]=u,e[16]=j):j=e[16];let _;return e[17]!==v||e[18]!==b||e[19]!==j?(_=s.jsxs(s.Fragment,{children:[v,b,j]}),e[17]=v,e[18]=b,e[19]=j,e[20]=_):_=e[20],_}function ls(){const t=C.c(13),{org:e}=$e(),n=Oe(),o=xn().location.pathname,l=e.slug,{state:i,isMobile:a}=Je(),c=!a&&i==="collapsed";let u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(pn,{className:"size-4!"}),t[0]=u):u=t[0];const d=o===`/${l}`||o===`/${l}/`;let m;t[1]!==n||t[2]!==l?(m=()=>{n({to:"/$org",params:{org:l}})},t[1]=n,t[2]=l,t[3]=m):m=t[3];let f;t[4]!==d||t[5]!==m?(f={key:"home",label:"Home",icon:u,isActive:d,onClick:m},t[4]=d,t[5]=m,t[6]=f):f=t[6];const p=f;let x;t[7]!==p?(x={type:"items",items:[p]},t[7]=p,t[8]=x):x=t[8];let g;if(t[9]!==c||t[10]!==x){if(g=[x],c){let h;t[12]===Symbol.for("react.memo_cache_sentinel")?(h={type:"custom",key:"new-task",content:s.jsx(lt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(it,{children:s.jsx(Le,{className:"gap-1.5",children:s.jsx(os,{})})})})},t[12]=h):h=t[12],g.push(h)}t[9]=c,t[10]=x,t[11]=g}else g=t[11];return g}function is(t){const e=C.c(12);let n,r,o,l;e[0]!==t?({className:n,orientation:o,decorative:l,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=l):(n=e[1],r=e[2],o=e[3],l=e[4]);const i=o===void 0?"horizontal":o,a=l===void 0?!0:l;let c;e[5]!==n?(c=X("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",n),e[5]=n,e[6]=c):c=e[6];let u;return e[7]!==a||e[8]!==i||e[9]!==r||e[10]!==c?(u=s.jsx(Os,{"data-slot":"separator-root",decorative:a,orientation:i,className:c,...r}),e[7]=a,e[8]=i,e[9]=r,e[10]=c,e[11]=u):u=e[11],u}function as(t){const e=C.c(3),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex h-6 items-center",children:s.jsx("div",{className:"h-0.5 w-16 rounded-full bg-sidebar-foreground/15"})}),e[0]=r):r=e[0];let o;return e[1]!==n?(o=s.jsxs(lt,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[r,s.jsx(it,{children:s.jsx(Le,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=o):o=e[2],o}function cs(t){const e=C.c(18),{item:n}=t,{isMobile:r,setOpenMobile:o}=Je();let l;e[0]!==r||e[1]!==n||e[2]!==o?(l=()=>{V("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:r}),n.onClick?.(),r&&o(!1)},e[0]=r,e[1]=n,e[2]=o,e[3]=l):l=e[3];const i=l,a=n.key,c=n.isActive&&"z-10";let u;e[4]!==c?(u=X(c),e[4]=c,e[5]=u):u=e[5];let d;e[6]!==n.label?(d=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=d):d=e[7];let m;e[8]!==i||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==d?(m=s.jsxs(Ae,{onClick:i,isActive:n.isActive,tooltip:n.label,children:[n.icon,d]}),e[8]=i,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=d,e[13]=m):m=e[13];let f;return e[14]!==n.key||e[15]!==u||e[16]!==m?(f=s.jsx(pe,{className:u,children:m},a),e[14]=n.key,e[15]=u,e[16]=m,e[17]=f):f=e[17],f}function Gr(t){const e=C.c(12),{section:n}=t;switch(n.type){case"divider":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Lt,{className:"my-2"}),e[0]=r):r=e[0],r}case"spacer":{let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex-1"}),e[1]=r):r=e[1],r}case"group":{const r=n.group.label,o=n.group.defaultExpanded;let l;e[2]!==n.group.items?(l=n.group.items.map(Lr),e[2]=n.group.items,e[3]=l):l=e[3];let i;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==l?(i=s.jsx(as,{label:r,defaultExpanded:o,children:l}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=l,e[7]=i):i=e[7],i}case"items":{let r;e[8]!==n.items?(r=n.items.map(Br),e[8]=n.items,e[9]=r):r=e[9];let o;return e[10]!==r?(o=s.jsx(lt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(it,{children:s.jsx(Le,{className:"gap-1.5",children:r})})}),e[10]=r,e[11]=o):o=e[11],o}case"custom":return n.content}}function Br(t){return s.jsx(cs,{item:t},t.key)}function Lr(t){return s.jsx(cs,{item:t},t.key)}function Ur(t){const e=C.c(14),{sections:n,footer:r,additionalContent:o,variant:l,contentClassName:i}=t,a=l===void 0?"sidebar":l;let c;e[0]!==i?(c=X("flex flex-col flex-1 px-2 py-2 gap-0.5",i),e[0]=i,e[1]=c):c=e[1];let u;e[2]!==n?(u=n.map(Hr),e[2]=n,e[3]=u):u=e[3];let d;e[4]!==o?(d=o&&s.jsx("div",{className:"flex flex-col flex-1 min-h-0 group-data-[state=collapsed]/sidebar:mt-1 group-data-[state=expanded]/sidebar:mt-2",children:o}),e[4]=o,e[5]=d):d=e[5];let m;e[6]!==c||e[7]!==u||e[8]!==d?(m=s.jsxs(Ut,{className:c,children:[u,d]}),e[6]=c,e[7]=u,e[8]=d,e[9]=m):m=e[9];let f;return e[10]!==r||e[11]!==m||e[12]!==a?(f=s.jsxs(jn,{variant:a,children:[m,r]}),e[10]=r,e[11]=m,e[12]=a,e[13]=f):f=e[13],f}function Hr(t,e){return s.jsx(Gr,{section:t},e)}function ds(t){const e=C.c(2);let n;return e[0]!==t?(n=s.jsx(Ur,{...t}),e[0]=t,e[1]=n):n=e[1],n}ds.Skeleton=function(){return s.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,n)=>s.jsx("div",{className:"w-full h-8",children:s.jsx(Ht,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function Kr(){const t=C.c(7),n=Ps().logo??Es,r=typeof n=="string"?n:n.light,o=typeof n=="string"?n:n.dark;let l;t[0]!==r?(l=s.jsx("img",{src:r,alt:"Logo",className:"size-6 object-contain dark:hidden"}),t[0]=r,t[1]=l):l=t[1];let i;t[2]!==o?(i=s.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),t[2]=o,t[3]=i):i=t[3];let a;return t[4]!==l||t[5]!==i?(a=s.jsxs(vn,{className:"flex flex-row items-center shrink-0 h-12 px-3 pb-0",children:[l,i]}),t[4]=l,t[5]=i,t[6]=a):a=t[6],a}function $t(t){const e=C.c(18),{item:n,onClose:r}=t,o=n.isActive&&"z-10";let l;e[0]!==o?(l=X(o),e[0]=o,e[1]=l):l=e[1];let i;e[2]!==n||e[3]!==r?(i=()=>{n.onClick?.(),r()},e[2]=n,e[3]=r,e[4]=i):i=e[4];let a;e[5]!==n.icon?(a=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=a):a=e[6];let c;e[7]!==n.label?(c=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=c):c=e[8];let u;e[9]!==n.isActive||e[10]!==n.label||e[11]!==i||e[12]!==a||e[13]!==c?(u=s.jsxs(Ae,{onClick:i,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[a,c]}),e[9]=n.isActive,e[10]=n.label,e[11]=i,e[12]=a,e[13]=c,e[14]=u):u=e[14];let d;return e[15]!==l||e[16]!==u?(d=s.jsx(pe,{className:l,children:u}),e[15]=l,e[16]=u,e[17]=d):d=e[17],d}function Yr(t){const e=C.c(18),{section:n,onClose:r}=t;switch(n.type){case"divider":{let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Lt,{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=n.group.label,l=n.group.defaultExpanded;let i;if(e[2]!==r||e[3]!==n.group.items){let c;e[5]!==r?(c=u=>s.jsx($t,{item:u,onClose:r},u.key),e[5]=r,e[6]=c):c=e[6],i=n.group.items.map(c),e[2]=r,e[3]=n.group.items,e[4]=i}else i=e[4];let a;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==i?(a=s.jsx(as,{label:o,defaultExpanded:l,children:i}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=i,e[10]=a):a=e[10],a}case"items":{let o;if(e[11]!==r||e[12]!==n.items){let i;e[14]!==r?(i=a=>s.jsx($t,{item:a,onClose:r},a.key),e[14]=r,e[15]=i):i=e[15],o=n.items.map(i),e[11]=r,e[12]=n.items,e[13]=o}else o=e[13];let l;return e[16]!==o?(l=s.jsx(lt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(it,{children:s.jsx(Le,{className:"gap-1.5",children:o})})}),e[16]=o,e[17]=l):l=e[17],l}case"custom":return n.content}}function qr(t){const e=C.c(14),{sections:n,onClose:r,footer:o,additionalContent:l}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx($.Suspense,{fallback:s.jsx("div",{className:"h-10 shrink-0"}),children:s.jsx(Kr,{})}),e[0]=i):i=e[0];let a;if(e[1]!==r||e[2]!==n){let m;e[4]!==r?(m=(f,p)=>s.jsx(Yr,{section:f,onClose:r},p),e[4]=r,e[5]=m):m=e[5],a=n.map(m),e[1]=r,e[2]=n,e[3]=a}else a=e[3];let c;e[6]!==l?(c=l&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:l}),e[6]=l,e[7]=c):c=e[7];let u;e[8]!==a||e[9]!==c?(u=s.jsxs(Ut,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[a,c]}),e[8]=a,e[9]=c,e[10]=u):u=e[10];let d;return e[11]!==o||e[12]!==u?(d=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[i,u,o]}),e[11]=o,e[12]=u,e[13]=d):d=e[13],d}function us(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Wr=Rs({name:Ds().min(2,"Organization name is required")});function Xr(t){const e=C.c(41),{open:n,onOpenChange:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={resolver:Fs(Wr),defaultValues:{name:""}},e[0]=o):o=e[0];const l=Gs(o);let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={mutationFn:Jr,onSuccess:Qr},e[1]=i):i=e[1];const a=Bs(i),c=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs(Vn,{children:[s.jsx(Zn,{children:"Create a new organization"}),s.jsx(er,{children:"Set up a new organization to collaborate with others."})]}),e[2]=u):u=e[2];let d;if(e[3]!==a||e[4]!==l){let k;e[6]!==a?(k=N=>a.mutateAsync(N),e[6]=a,e[7]=k):k=e[7],d=l.handleSubmit(k),e[3]=a,e[4]=l,e[5]=d}else d=e[5];let m;e[8]!==l.formState.isSubmitting?(m=k=>{const{field:N}=k;return s.jsxs(or,{children:[s.jsx(lr,{children:"Organization Name"}),s.jsx(ir,{children:s.jsx(dr,{...N,placeholder:"Acme Inc.",disabled:l.formState.isSubmitting})}),s.jsx(ar,{children:"The name of your company or organization"}),N.value&&s.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",s.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",us(N.value)]})]}),s.jsx(cr,{})]})},e[8]=l.formState.isSubmitting,e[9]=m):m=e[9];let f;e[10]!==l.control||e[11]!==m?(f=s.jsx(nr,{control:l.control,name:"name",render:m}),e[10]=l.control,e[11]=m,e[12]=f):f=e[12];let p;e[13]!==c?(p=c&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:c}),e[13]=c,e[14]=p):p=e[14];let x;e[15]!==a||e[16]!==l?(x=()=>{a.reset(),l.reset()},e[15]=a,e[16]=l,e[17]=x):x=e[17];let g;e[18]!==l.formState.isSubmitting||e[19]!==x?(g=s.jsx(Qn,{disabled:l.formState.isSubmitting,onClick:x,children:"Cancel"}),e[18]=l.formState.isSubmitting,e[19]=x,e[20]=g):g=e[20];const h=!l.formState.isValid||l.formState.isSubmitting;let v;e[21]!==l.formState.isSubmitting?(v=l.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(ur,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=l.formState.isSubmitting,e[22]=v):v=e[22];let b;e[23]!==h||e[24]!==v?(b=s.jsx(ot,{type:"submit",variant:"default",disabled:h,children:v}),e[23]=h,e[24]=v,e[25]=b):b=e[25];let j;e[26]!==b||e[27]!==g?(j=s.jsxs(tr,{children:[g,b]}),e[26]=b,e[27]=g,e[28]=j):j=e[28];let _;e[29]!==j||e[30]!==d||e[31]!==f||e[32]!==p?(_=s.jsxs("form",{className:"space-y-6",onSubmit:d,autoComplete:"off",children:[f,p,j]}),e[29]=j,e[30]=d,e[31]=f,e[32]=p,e[33]=_):_=e[33];let S;e[34]!==l||e[35]!==_?(S=s.jsxs(Jn,{children:[u,s.jsx(rr,{...l,children:_})]}),e[34]=l,e[35]=_,e[36]=S):S=e[36];let y;return e[37]!==r||e[38]!==n||e[39]!==S?(y=s.jsx(sr,{open:n,onOpenChange:r,children:S}),e[37]=r,e[38]=n,e[39]=S,e[40]=y):y=e[40],y}function Qr(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function Jr(t){const e=us(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await Be.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const r=n?.data?.slug??e;if(!r)throw new Error("Failed to create organization");return{orgSlug:r}}function mt(t){let e=0;for(let r=0;r<t.length;r++)e=t.charCodeAt(r)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function Vr(t){const e=C.c(13),{org:n,size:r}=t,o=r===void 0?"sm":r,l=o==="xs"?"size-5":"size-6",i=o==="xs"?"text-[9px]":"text-xs";let a;e[0]!==l?(a=X(l,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=l,e[1]=a):a=e[1];let c;e[2]!==n.logo||e[3]!==n.name?(c=n.logo?void 0:mt(n.name),e[2]=n.logo,e[3]=n.name,e[4]=c):c=e[4];let u;e[5]!==n.logo||e[6]!==n.name||e[7]!==i?(u=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:X("font-semibold leading-none",i),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=i,e[8]=u):u=e[8];let d;return e[9]!==a||e[10]!==c||e[11]!==u?(d=s.jsx("div",{className:a,style:c,children:u}),e[9]=a,e[10]=c,e[11]=u,e[12]=d):d=e[12],d}function st(t){const e=C.c(22),{item:n,onClose:r}=t;if(n.href){const c=n.external?"_blank":void 0,u=n.external?"noopener noreferrer":void 0;let d;e[0]!==n.icon?(d=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[0]=n.icon,e[1]=d):d=e[1];let m;e[2]!==n.label?(m=s.jsx("span",{className:"flex-1",children:n.label}),e[2]=n.label,e[3]=m):m=e[3];let f;return e[4]!==n.href||e[5]!==r||e[6]!==c||e[7]!==u||e[8]!==d||e[9]!==m?(f=s.jsxs("a",{href:n.href,target:c,rel:u,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",onClick:r,children:[d,m]}),e[4]=n.href,e[5]=r,e[6]=c,e[7]=u,e[8]=d,e[9]=m,e[10]=f):f=e[10],f}let o;e[11]!==n||e[12]!==r?(o=()=>{n.onClick?.(),r()},e[11]=n,e[12]=r,e[13]=o):o=e[13];let l;e[14]!==n.icon?(l=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[14]=n.icon,e[15]=l):l=e[15];let i;e[16]!==n.label?(i=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=i):i=e[17];let a;return e[18]!==o||e[19]!==l||e[20]!==i?(a=s.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",children:[l,i]}),e[18]=o,e[19]=l,e[20]=i,e[21]=a):a=e[21],a}function Mt(t){const e=C.c(16),{sortedOrgs:n,orgParam:r,onSelectOrg:o,onCreateOrg:l}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("span",{className:"text-sm font-medium text-muted-foreground/60",children:"Your Organizations"}),e[0]=i):i=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Ie,{size:16}),e[1]=a):a=e[1];let c;e[2]!==l?(c=s.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[i,s.jsx("button",{type:"button",onClick:l,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:a})]}),e[2]=l,e[3]=c):c=e[3];let u;if(e[4]!==o||e[5]!==r||e[6]!==n){let f;e[8]!==o||e[9]!==r?(f=p=>s.jsxs("button",{type:"button",onClick:()=>o(p.slug),className:X("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",p.slug===r?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(Vr,{org:p,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:p.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:p.slug})]}),p.slug===r&&s.jsx(Jt,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},p.id),e[8]=o,e[9]=r,e[10]=f):f=e[10],u=n.map(f),e[4]=o,e[5]=r,e[6]=n,e[7]=u}else u=e[7];let d;e[11]!==u?(d=s.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1",children:u}),e[11]=u,e[12]=d):d=e[12];let m;return e[13]!==c||e[14]!==d?(m=s.jsxs(s.Fragment,{children:[c,d]}),e[13]=c,e[14]=d,e[15]=m):m=e[15],m}function zt(t){const e=C.c(142),{user:n,userImage:r,menuItems:o,signOutItem:l,themeOptions:i,preferences:a,setPreferences:c,sortedOrgs:u,orgParam:d,onSelectOrg:m,onCreateOrg:f,close:p,isMobile:x}=t;if(x){const Y=n?.name??"U";let U;e[0]!==Y||e[1]!==r?(U=s.jsx(Ct,{url:r,fallback:Y,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=Y,e[1]=r,e[2]=U):U=e[2];const J=n?.name??"User";let te;e[3]!==J?(te=s.jsx("p",{className:"text-sm font-medium truncate",children:J}),e[3]=J,e[4]=te):te=e[4];const se=n?.email;let q;e[5]!==se?(q=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:se}),e[5]=se,e[6]=q):q=e[6];let he;e[7]!==te||e[8]!==q?(he=s.jsxs("div",{className:"flex-1 min-w-0",children:[te,q]}),e[7]=te,e[8]=q,e[9]=he):he=e[9];let Ne;e[10]!==n?(Ne=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(so)},e[10]=n,e[11]=Ne):Ne=e[11];let Pe;e[12]===Symbol.for("react.memo_cache_sentinel")?(Pe=s.jsx(Nt,{size:14}),e[12]=Pe):Pe=e[12];let ge;e[13]!==Ne?(ge=s.jsx(He,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:Ne,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:Pe})}),e[13]=Ne,e[14]=ge):ge=e[14];let Ee;e[15]===Symbol.for("react.memo_cache_sentinel")?(Ee=s.jsx(Ke,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=Ee):Ee=e[15];let le;e[16]!==ge?(le=s.jsx(St,{delayDuration:300,children:s.jsxs(Ye,{children:[ge,Ee]})}),e[16]=ge,e[17]=le):le=e[17];let ie;e[18]!==le||e[19]!==U||e[20]!==he?(ie=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[U,he,le]}),e[18]=le,e[19]=U,e[20]=he,e[21]=ie):ie=e[21];let ae;e[22]!==f||e[23]!==m||e[24]!==d||e[25]!==u?(ae=s.jsx("div",{className:"border-b border-border pb-2",children:s.jsx(Mt,{sortedOrgs:u,orgParam:d,onSelectOrg:m,onCreateOrg:f})}),e[22]=f,e[23]=m,e[24]=d,e[25]=u,e[26]=ae):ae=e[26];let be;if(e[27]!==p||e[28]!==o){let re;e[30]!==p?(re=qe=>s.jsx(st,{item:qe,onClose:p},qe.key),e[30]=p,e[31]=re):re=e[31],be=o.map(re),e[27]=p,e[28]=o,e[29]=be}else be=e[29];let ce;e[32]!==p||e[33]!==l?(ce=s.jsx(st,{item:l,onClose:p}),e[32]=p,e[33]=l,e[34]=ce):ce=e[34];let de;e[35]!==be||e[36]!==ce?(de=s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[be,ce]}),e[35]=be,e[36]=ce,e[37]=de):de=e[37];let je;e[38]!==ae||e[39]!==de?(je=s.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[ae,de]}),e[38]=ae,e[39]=de,e[40]=je):je=e[40];let ve;if(e[41]!==a.theme||e[42]!==c||e[43]!==i){let re;e[45]!==a.theme||e[46]!==c?(re=qe=>{const{value:Ue,icon:De,label:Fe}=qe;return s.jsx("button",{type:"button","aria-label":Fe,onClick:()=>c(We=>({...We,theme:Ue})),className:X("size-8 rounded-md flex items-center justify-center transition-colors",a.theme===Ue?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:De},Ue)},e[45]=a.theme,e[46]=c,e[47]=re):re=e[47],ve=i.map(re),e[41]=a.theme,e[42]=c,e[43]=i,e[44]=ve}else ve=e[44];let _e;e[48]!==ve?(_e=s.jsx("div",{className:"flex items-center gap-0.5",children:ve}),e[48]=ve,e[49]=_e):_e=e[49];const we=a.enableSounds?"Disable sounds":"Enable sounds";let ue;e[50]!==c?(ue=()=>c(to),e[50]=c,e[51]=ue):ue=e[51];const Re=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let ye;e[52]!==Re?(ye=X("size-8 rounded-md flex items-center justify-center transition-colors",Re),e[52]=Re,e[53]=ye):ye=e[53];let Se;e[54]!==a.enableSounds?(Se=a.enableSounds?s.jsx(_t,{size:14}):s.jsx(yt,{size:14}),e[54]=a.enableSounds,e[55]=Se):Se=e[55];let me;e[56]!==we||e[57]!==ue||e[58]!==ye||e[59]!==Se?(me=s.jsx("button",{type:"button","aria-label":we,onClick:ue,className:ye,children:Se}),e[56]=we,e[57]=ue,e[58]=ye,e[59]=Se,e[60]=me):me=e[60];let Ce;e[61]===Symbol.for("react.memo_cache_sentinel")?(Ce=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","2.365.0"]}),e[61]=Ce):Ce=e[61];let fe;e[62]!==me?(fe=s.jsxs("div",{className:"flex items-center gap-2",children:[me,Ce]}),e[62]=me,e[63]=fe):fe=e[63];let xe;e[64]!==_e||e[65]!==fe?(xe=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[_e,fe]}),e[64]=_e,e[65]=fe,e[66]=xe):xe=e[66];let Me;return e[67]!==ie||e[68]!==je||e[69]!==xe?(Me=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[ie,je,xe]}),e[67]=ie,e[68]=je,e[69]=xe,e[70]=Me):Me=e[70],Me}const g=n?.name??"U";let h;e[71]!==g||e[72]!==r?(h=s.jsx(Ct,{url:r,fallback:g,shape:"circle",size:"sm",className:"shrink-0"}),e[71]=g,e[72]=r,e[73]=h):h=e[73];const v=n?.name??"User";let b;e[74]!==v?(b=s.jsx("p",{className:"text-sm font-medium truncate",children:v}),e[74]=v,e[75]=b):b=e[75];const j=n?.email;let _;e[76]!==j?(_=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:j}),e[76]=j,e[77]=_):_=e[77];let S;e[78]!==b||e[79]!==_?(S=s.jsxs("div",{className:"flex-1 min-w-0",children:[b,_]}),e[78]=b,e[79]=_,e[80]=S):S=e[80];let y;e[81]!==n?(y=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(eo)},e[81]=n,e[82]=y):y=e[82];let k;e[83]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Nt,{size:14}),e[83]=k):k=e[83];let N;e[84]!==y?(N=s.jsx(He,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:y,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:k})}),e[84]=y,e[85]=N):N=e[85];let M;e[86]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx(Ke,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[86]=M):M=e[86];let I;e[87]!==N?(I=s.jsx(St,{delayDuration:300,children:s.jsxs(Ye,{children:[N,M]})}),e[87]=N,e[88]=I):I=e[88];let z;e[89]!==I||e[90]!==h||e[91]!==S?(z=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[h,S,I]}),e[89]=I,e[90]=h,e[91]=S,e[92]=z):z=e[92];let A;if(e[93]!==p||e[94]!==o){let Y;e[96]!==p?(Y=U=>s.jsx(st,{item:U,onClose:p},U.key),e[96]=p,e[97]=Y):Y=e[97],A=o.map(Y),e[93]=p,e[94]=o,e[95]=A}else A=e[95];let P;e[98]!==p||e[99]!==l?(P=s.jsx(st,{item:l,onClose:p}),e[98]=p,e[99]=l,e[100]=P):P=e[100];let w;e[101]!==A||e[102]!==P?(w=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[A,P]}),e[101]=A,e[102]=P,e[103]=w):w=e[103];let E;if(e[104]!==a.theme||e[105]!==c||e[106]!==i){let Y;e[108]!==a.theme||e[109]!==c?(Y=U=>{const{value:J,icon:te,label:se}=U;return s.jsx("button",{type:"button","aria-label":se,onClick:()=>c(q=>({...q,theme:J})),className:X("size-7 rounded-md flex items-center justify-center transition-colors",a.theme===J?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:te},J)},e[108]=a.theme,e[109]=c,e[110]=Y):Y=e[110],E=i.map(Y),e[104]=a.theme,e[105]=c,e[106]=i,e[107]=E}else E=e[107];let T;e[111]!==E?(T=s.jsx("div",{className:"flex items-center gap-0.5",children:E}),e[111]=E,e[112]=T):T=e[112];const D=a.enableSounds?"Disable sounds":"Enable sounds";let G;e[113]!==c?(G=()=>c(Zr),e[113]=c,e[114]=G):G=e[114];const F=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let B;e[115]!==F?(B=X("size-7 rounded-md flex items-center justify-center transition-colors",F),e[115]=F,e[116]=B):B=e[116];let K;e[117]!==a.enableSounds?(K=a.enableSounds?s.jsx(_t,{size:14}):s.jsx(yt,{size:14}),e[117]=a.enableSounds,e[118]=K):K=e[118];let R;e[119]!==D||e[120]!==G||e[121]!==B||e[122]!==K?(R=s.jsx("button",{type:"button","aria-label":D,onClick:G,className:B,children:K}),e[119]=D,e[120]=G,e[121]=B,e[122]=K,e[123]=R):R=e[123];let ne;e[124]===Symbol.for("react.memo_cache_sentinel")?(ne=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","2.365.0"]}),e[124]=ne):ne=e[124];let Q;e[125]!==R?(Q=s.jsxs("div",{className:"flex items-center gap-2",children:[R,ne]}),e[125]=R,e[126]=Q):Q=e[126];let W;e[127]!==T||e[128]!==Q?(W=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[T,Q]}),e[127]=T,e[128]=Q,e[129]=W):W=e[129];let Z;e[130]!==z||e[131]!==w||e[132]!==W?(Z=s.jsxs("div",{className:"w-60 shrink-0 flex flex-col border-r border-border bg-sidebar/75",children:[z,w,W]}),e[130]=z,e[131]=w,e[132]=W,e[133]=Z):Z=e[133];let ee;e[134]!==f||e[135]!==m||e[136]!==d||e[137]!==u?(ee=s.jsx("div",{className:"flex-1 flex flex-col min-w-0 min-h-0 overflow-hidden",children:s.jsx(Mt,{sortedOrgs:u,orgParam:d,onSelectOrg:m,onCreateOrg:f})}),e[134]=f,e[135]=m,e[136]=d,e[137]=u,e[138]=ee):ee=e[138];let L;return e[139]!==Z||e[140]!==ee?(L=s.jsxs("div",{className:"flex min-h-[380px] w-full overflow-hidden",children:[Z,ee]}),e[139]=Z,e[140]=ee,e[141]=L):L=e[141],L}function Zr(t){return{...t,enableSounds:!t.enableSounds}}function eo(){Ge.success("User ID copied")}function to(t){return{...t,enableSounds:!t.enableSounds}}function so(){Ge.success("User ID copied")}function ft(){const t=C.c(50),{data:e}=Be.useSession(),{data:n}=Be.useListOrganizations(),r=Oe();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org",shouldThrow:!1},t[0]=o):o=t[0];const i=Ls(o)?.params.org,[a,c]=Rt(),u=Wt(),[d,m]=$.useState(!1),[f,p]=$.useState(!1),x=e?.user,g=x?.image;let h;if(t[1]!==u||t[2]!==r||t[3]!==d||t[4]!==i||t[5]!==n||t[6]!==a||t[7]!==c||t[8]!==x||t[9]!==g){const j=n?.find(L=>L.slug===i);let _;if(t[11]!==i||t[12]!==n){let L;t[14]!==i?(L=(Y,U)=>Y.slug===i?-1:U.slug===i?1:Y.name.localeCompare(U.name),t[14]=i,t[15]=L):L=t[15],_=[...n??[]].sort(L),t[11]=i,t[12]=n,t[13]=_}else _=t[13];const S=_;let y;t[16]!==r?(y=L=>{m(!1),r({to:"/$org",params:{org:L}})},t[16]=r,t[17]=y):y=t[17];const k=y;let N;t[18]===Symbol.for("react.memo_cache_sentinel")?(N=()=>m(!1),t[18]=N):N=t[18];const M=N;let I;t[19]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(et,{size:16}),t[19]=I):I=t[19];let z;t[20]!==r||t[21]!==i?(z={key:"preferences",label:"Preferences",icon:I,onClick:()=>{r({to:"/$org/settings/profile",params:{org:i??""}})}},t[20]=r,t[21]=i,t[22]=z):z=t[22];let A;t[23]===Symbol.for("react.memo_cache_sentinel")?(A={key:"terms",label:"Terms of Use",icon:s.jsx(hn,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[23]=A):A=t[23];let P;t[24]===Symbol.for("react.memo_cache_sentinel")?(P={key:"privacy",label:"Privacy Policy",icon:s.jsx(Wn,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[24]=P):P=t[24];let w;t[25]===Symbol.for("react.memo_cache_sentinel")?(w={key:"github",label:"decocms/studio",icon:s.jsx(Us,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[25]=w):w=t[25];let E;t[26]===Symbol.for("react.memo_cache_sentinel")?(E={key:"community",label:"Community",icon:s.jsx(Xn,{size:16}),href:"https://decocms.com/discord",external:!0},t[26]=E):E=t[26];let T;t[27]===Symbol.for("react.memo_cache_sentinel")?(T={key:"homepage",label:"Homepage",icon:s.jsx(Un,{size:16}),href:"https://decocms.com",external:!0},t[27]=T):T=t[27];let D;t[28]!==z?(D=[z,A,P,w,E,T],t[28]=z,t[29]=D):D=t[29];const G=D;let F;t[30]===Symbol.for("react.memo_cache_sentinel")?(F={key:"logout",label:"Sign out",icon:s.jsx(Hn,{size:16}),onClick:ro},t[30]=F):F=t[30];const B=F;let K;t[31]===Symbol.for("react.memo_cache_sentinel")?(K={value:"light",icon:s.jsx(Yn,{size:14}),label:"Light theme"},t[31]=K):K=t[31];let R;t[32]===Symbol.for("react.memo_cache_sentinel")?(R={value:"dark",icon:s.jsx(qn,{size:14}),label:"Dark theme"},t[32]=R):R=t[32];let ne;t[33]===Symbol.for("react.memo_cache_sentinel")?(ne=[K,R,{value:"system",icon:s.jsx(Kn,{size:14}),label:"System theme"}],t[33]=ne):ne=t[33];const Q=ne;let W;t[34]===Symbol.for("react.memo_cache_sentinel")?(W=()=>{m(!1),p(!0)},t[34]=W):W=t[34];let Z;t[35]!==k||t[36]!==u||t[37]!==G||t[38]!==i||t[39]!==a||t[40]!==c||t[41]!==S||t[42]!==x||t[43]!==g?(Z={user:x,userImage:g,menuItems:G,signOutItem:B,themeOptions:Q,preferences:a,setPreferences:c,sortedOrgs:S,orgParam:i,onSelectOrg:k,onCreateOrg:W,close:M,isMobile:u},t[35]=k,t[36]=u,t[37]=G,t[38]=i,t[39]=a,t[40]=c,t[41]=S,t[42]=x,t[43]=g,t[44]=Z):Z=t[44];const ee=Z;h=u?s.jsxs(Kt,{open:d,onOpenChange:m,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>m(!0),className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx("div",{className:"shrink-0 size-5 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:j?.logo?void 0:mt(j?.name??""),children:j?.logo?s.jsx("img",{src:j.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[8px]",children:(j?.name??"?").slice(0,2).toUpperCase()})}),s.jsx("span",{className:"truncate",children:j?.name??"Account"})]}),s.jsxs(Yt,{className:"h-[80dvh] p-0",children:[s.jsx(qt,{className:"sr-only",children:"Account"}),s.jsx(zt,{...ee})]})]}):s.jsxs(at,{open:d,onOpenChange:m,children:[s.jsx(Qe,{asChild:!0,children:s.jsxs(Ae,{tooltip:j?.name??"Account",className:"rounded-md",children:[s.jsx("div",{className:"shrink-0 size-6 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:j?.logo?void 0:mt(j?.name??""),children:j?.logo?s.jsx("img",{src:j.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[9px]",children:(j?.name??"?").slice(0,2).toUpperCase()})}),s.jsx("span",{className:"truncate",children:j?.name??"Account"})]})}),s.jsx(ct,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[520px] p-0 flex max-h-[520px]",onCloseAutoFocus:no,children:s.jsx(zt,{...ee})})]}),t[1]=u,t[2]=r,t[3]=d,t[4]=i,t[5]=n,t[6]=a,t[7]=c,t[8]=x,t[9]=g,t[10]=h}else h=t[10];let v;t[45]!==f?(v=s.jsx(Xr,{open:f,onOpenChange:p}),t[45]=f,t[46]=v):v=t[46];let b;return t[47]!==h||t[48]!==v?(b=s.jsxs(s.Fragment,{children:[h,v]}),t[47]=h,t[48]=v,t[49]=b):b=t[49],b}function no(t){return t.preventDefault()}function ro(){V("signed_out",{source:"account_popover"}),Be.signOut()}function oo({invitation:t}){const[e,n]=$.useState(!1),[r,o]=$.useState(!1),l=Hs(),i=async()=>{n(!0);try{const u=await Be.organization.acceptInvitation({invitationId:t.id});if(u.error){Ge.error(u.error.message),n(!1);return}}catch{Ge.error("Failed to accept invitation"),n(!1);return}Ge.success("Invitation accepted!");let c;try{c=(await Be.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},a=async()=>{o(!0);try{const c=await Be.organization.rejectInvitation({invitationId:t.id});c.error?(Ge.error(c.error.message),o(!1)):(Ge.success("Invitation declined"),l.invalidateQueries())}catch{Ge.error("Failed to decline invitation"),o(!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(ot,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:i,disabled:e||r,"aria-label":"Accept invitation",children:s.jsx(Jt,{size:14})}),s.jsx(ot,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:a,disabled:e||r,"aria-label":"Decline invitation",children:s.jsx(fr,{size:14})})]})]})}function lo(t){const e=C.c(14),{release:n,isSeen:r,onSelect:o}=t;let l;e[0]!==r?(l=!r&&s.jsx("span",{"aria-label":"New release",className:"absolute left-2 top-1/2 -translate-y-1/2 size-1.5 rounded-full bg-primary"}),e[0]=r,e[1]=l):l=e[1];let i;e[2]!==n.eyebrow?(i=n.eyebrow&&s.jsx("p",{className:"text-xs text-muted-foreground",children:n.eyebrow}),e[2]=n.eyebrow,e[3]=i):i=e[3];let a;e[4]!==n.title?(a=s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[4]=n.title,e[5]=a):a=e[5];let c;e[6]!==i||e[7]!==a?(c=s.jsxs("div",{className:"flex-1 min-w-0",children:[i,a]}),e[6]=i,e[7]=a,e[8]=c):c=e[8];let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(bt,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=u):u=e[9];let d;return e[10]!==o||e[11]!==l||e[12]!==c?(d=s.jsxs("button",{type:"button",onClick:o,className:"relative w-full flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors text-left",children:[l,c,u]}),e[10]=o,e[11]=l,e[12]=c,e[13]=d):d=e[13],d}function io(){const t=$.useContext(Ks),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(r=>r.status==="pending"&&new Date(r.expiresAt)>new Date)}function ms(){const t=C.c(10),{isSeen:e,markSeen:n,unseenCount:r}=Dn(),o=io();let l;if(t[0]!==e||t[1]!==o){const c=[...o].sort(uo).map(co);let u;t[3]!==e?(u=m=>({type:"release",release:m,isSeen:e(m.id)}),t[3]=e,t[4]=u):u=t[4];const d=[...Fn].sort(ao).map(u);l=[...c,...d],t[0]=e,t[1]=o,t[2]=l}else l=t[2];const i=r+o.length;let a;return t[5]!==n||t[6]!==o||t[7]!==l||t[8]!==i?(a={items:l,pendingInvitations:o,redDotCount:i,markReleaseSeen:n},t[5]=n,t[6]=o,t[7]=l,t[8]=i,t[9]=a):a=t[9],a}function ao(t,e){return new Date(e.date).getTime()-new Date(t.date).getTime()}function co(t){return{type:"invitation",invitation:t}}function uo(t,e){return new Date(t.expiresAt).getTime()-new Date(e.expiresAt).getTime()}class fs extends $.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,n){}render(){return this.state.hasError?null:this.props.children}}function xs(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function mo(){const t=C.c(25),e=Oe(),{org:n}=$e();let r;t[0]!==n.id||t[1]!==n.slug?(r={connectionId:pt,orgId:n.id,orgSlug:n.slug},t[0]=n.id,t[1]=n.slug,t[2]=r):r=t[2];const o=ht(r);let l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l={providerId:"deco"},t[3]=l):l=t[3];let i;t[4]!==o?(i={client:o,toolName:"AI_PROVIDER_CREDITS",toolArguments:l,staleTime:6e4,select:fo},t[4]=o,t[5]=i):i=t[5];const{data:a,isPending:c,isError:u}=es(i),d=a?.balanceCents!=null?a.balanceCents/100:null;let m;t[6]!==d||t[7]!==u||t[8]!==c?(m=c||u||d==null?"Credits":`Credits: $${d.toFixed(2)}`,t[6]=d,t[7]=u,t[8]=c,t[9]=m):m=t[9];const f=m;let p;t[10]!==d?(p=X(d!=null&&xs(d)),t[10]=d,t[11]=p):p=t[11];let x;t[12]!==e||t[13]!==n.slug?(x=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[12]=e,t[13]=n.slug,t[14]=x):x=t[14];let g;t[15]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Bt,{}),t[15]=g):g=t[15];let h;t[16]!==d?(h=d!=null?`$${d.toFixed(2)}`:"Credits",t[16]=d,t[17]=h):h=t[17];let v;t[18]!==h?(v=s.jsx("span",{children:h}),t[18]=h,t[19]=v):v=t[19];let b;return t[20]!==p||t[21]!==x||t[22]!==v||t[23]!==f?(b=s.jsx(Le,{children:s.jsx(pe,{children:s.jsxs(Ae,{tooltip:f,className:p,onClick:x,children:[g,v]})})}),t[20]=p,t[21]=x,t[22]=v,t[23]=f,t[24]=b):b=t[24],b}function fo(t){return t.structuredContent}function xo(){const t=C.c(1);if(!ts().some(po))return null;let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(mo,{}),t[0]=r):r=t[0],r}function po(t){return t.providerId==="deco"}function ho(){const t=C.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(fs,{children:s.jsx($.Suspense,{fallback:null,children:s.jsx(xo,{})})}),t[0]=e):e=t[0],e}function go(){const t=C.c(28),e=Oe(),{org:n}=$e();let r;t[0]!==n.id||t[1]!==n.slug?(r={connectionId:pt,orgId:n.id,orgSlug:n.slug},t[0]=n.id,t[1]=n.slug,t[2]=r):r=t[2];const o=ht(r);let l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l={providerId:"deco"},t[3]=l):l=t[3];let i;t[4]!==o?(i={client:o,toolName:"AI_PROVIDER_CREDITS",toolArguments:l,staleTime:6e4,select:bo},t[4]=o,t[5]=i):i=t[5];const{data:a,isPending:c,isError:u}=es(i),d=a?.balanceCents!=null?a.balanceCents/100:null;let m;t[6]!==d||t[7]!==u||t[8]!==c?(m=c||u||d==null?"Credits":`Credits: $${d.toFixed(2)}`,t[6]=d,t[7]=u,t[8]=c,t[9]=m):m=t[9];const f=m;let p;t[10]!==e||t[11]!==n.slug?(p=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[10]=e,t[11]=n.slug,t[12]=p):p=t[12];let x;t[13]!==d?(x=X("relative flex h-10 md:h-7 shrink-0 items-center gap-1 rounded-md px-2 text-xs font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50","hover:bg-sidebar-accent hover:text-sidebar-foreground",d!=null?xs(d):"text-sidebar-foreground/60"),t[13]=d,t[14]=x):x=t[14];let g;t[15]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Bt,{className:"size-4"}),t[15]=g):g=t[15];let h;t[16]!==d?(h=d!=null&&s.jsx("span",{children:`$${d.toFixed(2)}`}),t[16]=d,t[17]=h):h=t[17];let v;t[18]!==p||t[19]!==x||t[20]!==h||t[21]!==f?(v=s.jsx(He,{asChild:!0,children:s.jsxs("button",{type:"button","aria-label":f,onClick:p,className:x,children:[g,h]})}),t[18]=p,t[19]=x,t[20]=h,t[21]=f,t[22]=v):v=t[22];let b;t[23]!==f?(b=s.jsx(Ke,{side:"top",children:f}),t[23]=f,t[24]=b):b=t[24];let j;return t[25]!==v||t[26]!==b?(j=s.jsxs(Ye,{delayDuration:300,children:[v,b]}),t[25]=v,t[26]=b,t[27]=j):j=t[27],j}function bo(t){return t.structuredContent}function jo(){const t=C.c(1);if(!ts().some(vo))return null;let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(go,{}),t[0]=r):r=t[0],r}function vo(t){return t.providerId==="deco"}function _o(){const t=C.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(fs,{children:s.jsx($.Suspense,{fallback:null,children:s.jsx(jo,{})})}),t[0]=e):e=t[0],e}function ps(t){const e=C.c(15),{children:n}=t,{items:r,markReleaseSeen:o}=ms(),[l,i]=$.useState(null);let a;if(e[0]!==r||e[1]!==l){let g;e[3]!==l?(g=h=>h.type==="release"&&h.release.id===l,e[3]=l,e[4]=g):g=e[4],a=r.find(g),e[0]=r,e[1]=l,e[2]=a}else a=e[2];const c=a,u=c?.type==="release"?c.release:null;let d;e[5]!==o?(d=g=>{i(g),o(g)},e[5]=o,e[6]=d):d=e[6];const m=d;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=g=>{g||i(null)},e[7]=f):f=e[7];let p;e[8]!==m||e[9]!==r||e[10]!==u?(p=s.jsx(ct,{side:"right",align:"start",sideOffset:16,collisionPadding:16,className:"w-[min(400px,calc(100vw-2rem))] p-0 h-[min(650px,calc(100dvh-4rem))] flex flex-col",children:u?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 border-b border-border shrink-0",children:[s.jsx(ot,{size:"icon",variant:"ghost","aria-label":"Back to inbox",className:"size-7 text-muted-foreground",onClick:()=>i(null),children:s.jsx(Bn,{size:16})}),s.jsx("h3",{className:"text-sm font-medium truncate",children:u.title})]}),s.jsx("div",{className:"overflow-y-auto flex-1 p-5",children:s.jsx(Gn,{release:u})})]}):s.jsxs(s.Fragment,{children:[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"})}),r.length===0?s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[s.jsx(gt,{size:24,className:"text-muted-foreground/50"}),s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Nothing here yet"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Invitations and release updates will appear here"})]}):s.jsx("div",{className:"overflow-y-auto flex-1",children:r.map(g=>g.type==="invitation"?s.jsx(oo,{invitation:g.invitation},`inv-${g.invitation.id}`):s.jsx(lo,{release:g.release,isSeen:g.isSeen,onSelect:()=>m(g.release.id)},`rel-${g.release.id}`))})]})}),e[8]=m,e[9]=r,e[10]=u,e[11]=p):p=e[11];let x;return e[12]!==n||e[13]!==p?(x=s.jsxs(at,{onOpenChange:f,children:[n,p]}),e[12]=n,e[13]=p,e[14]=x):x=e[14],x}function hs(){const{redDotCount:t}=ms();return t>0}function yo(){const t=C.c(6),e=hs();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(gt,{}),t[0]=n):n=t[0];let r;t[1]!==e?(r=e&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=r):r=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("span",{children:"Inbox"}),t[3]=o):o=t[3];let l;return t[4]!==r?(l=s.jsx(ps,{children:s.jsx(Qe,{asChild:!0,children:s.jsxs(Ae,{tooltip:"Inbox",className:"relative",children:[n,r,o]})})}),t[4]=r,t[5]=l):l=t[5],l}function So(){const t=C.c(8),e=hs();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(gt,{className:"size-4"}),t[0]=n):n=t[0];let r;t[1]!==e?(r=e&&s.jsx("span",{className:"absolute top-0.5 right-0.5 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=r):r=t[2];let o;t[3]!==r?(o=s.jsx(Qe,{asChild:!0,children:s.jsx(He,{asChild:!0,children:s.jsxs(ze,{"aria-label":"Inbox",children:[n,r]})})}),t[3]=r,t[4]=o):o=t[4];let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Ke,{side:"top",children:"Inbox"}),t[5]=l):l=t[5];let i;return t[6]!==o?(i=s.jsx(ps,{children:s.jsxs(Ye,{delayDuration:300,children:[o,l]})}),t[6]=o,t[7]=i):i=t[7],i}function Co(){const t=C.c(3),[e,n]=$.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(Ae,{tooltip:"Connections",onClick:()=>{V("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:[s.jsx(Vt,{}),s.jsx("span",{children:"Connections"})]}),t[0]=r):r=t[0];let o;return t[1]!==e?(o=s.jsxs(s.Fragment,{children:[r,s.jsx(Zt,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function No(){const t=C.c(3),[e,n]=$.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(Ye,{delayDuration:300,children:[s.jsx(He,{asChild:!0,children:s.jsx(ze,{"aria-label":"Connections",onClick:()=>{V("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:s.jsx(Vt,{className:"size-4"})})}),s.jsx(Ke,{side:"top",children:"Connections"})]}),t[0]=r):r=t[0];let o;return t[1]!==e?(o=s.jsxs(s.Fragment,{children:[r,s.jsx(Zt,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function wo(){const t=C.c(7),e=Oe(),{org:n}=$e();let r;t[0]!==e||t[1]!==n.slug?(r=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=r):r=t[2];let o,l;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(et,{}),l=s.jsx("span",{children:"Settings"}),t[3]=o,t[4]=l):(o=t[3],l=t[4]);let i;return t[5]!==r?(i=s.jsxs(Ae,{tooltip:"Settings",onClick:r,children:[o,l]}),t[5]=r,t[6]=i):i=t[6],i}function ko(){const t=C.c(9),e=Oe(),{org:n}=$e();let r;t[0]!==e||t[1]!==n.slug?(r=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=r):r=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(et,{className:"size-4"}),t[3]=o):o=t[3];let l;t[4]!==r?(l=s.jsx(He,{asChild:!0,children:s.jsx(ze,{"aria-label":"Settings",onClick:r,children:o})}),t[4]=r,t[5]=l):l=t[5];let i;t[6]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ke,{side:"top",children:"Settings"}),t[6]=i):i=t[6];let a;return t[7]!==l?(a=s.jsxs(Ye,{delayDuration:300,children:[l,i]}),t[7]=l,t[8]=a):a=t[8],a}function Io(){const t=C.c(6),{state:e}=Je();if(e==="collapsed"){let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(ho,{}),t[0]=o):o=t[0];let l;t[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(pe,{children:s.jsx(Co,{})}),t[1]=l):l=t[1];let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(pe,{children:s.jsx(yo,{})}),t[2]=i):i=t[2];let a;t[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(pe,{children:s.jsx(wo,{})}),t[3]=a):a=t[3];let c;return t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(ut,{className:"px-2 pb-3 gap-1",children:[o,s.jsxs(Le,{children:[l,i,a,s.jsx(pe,{children:s.jsx(ft,{})})]})]}),t[4]=c):c=t[4],c}let r;return t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ut,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(Le,{children:s.jsx(pe,{children:s.jsx(ft,{})})})}),s.jsx(ko,{}),s.jsx(So,{}),s.jsx(No,{}),s.jsx(_o,{})]})}),t[5]=r):r=t[5],r}function Ao(){const t=C.c(8),e=Oe(),{org:n}=$e(),{setOpenMobile:r}=Je();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(Le,{children:s.jsx(pe,{children:s.jsx(ft,{})})})}),t[0]=o):o=t[0];let l;t[1]!==e||t[2]!==n.slug||t[3]!==r?(l=()=>{e({to:"/$org/settings",params:{org:n.slug}}),r(!1)},t[1]=e,t[2]=n.slug,t[3]=r,t[4]=l):l=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(et,{className:"size-4"}),t[5]=i):i=t[5];let a;return t[6]!==l?(a=s.jsx(ut,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[o,s.jsx(ze,{"aria-label":"Settings",onClick:l,children:i})]})}),t[6]=l,t[7]=a):a=t[7],a}function $o(t,e){return t.filter(n=>!(e.ownerUserId!==void 0&&n.created_by!==e.ownerUserId||e.hasTrigger!==void 0&&!!n.trigger_id!==e.hasTrigger||!!n.hidden!==e.hidden))}function Mo(t){const e=C.c(8),{virtualMcpId:n,size:r,showAutomationBadge:o}=t,l=r===void 0?"sm":r;let i;e[0]!==l||e[1]!==n?(i=n?s.jsx(zo,{virtualMcpId:n,size:l}):s.jsx(Te,{icon:null,name:"?",size:l}),e[0]=l,e[1]=n,e[2]=i):i=e[2];let a;e[3]!==o?(a=o&&s.jsx("span",{"aria-label":"Automation-triggered",className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:s.jsx(ns,{size:10,className:"text-white"})}),e[3]=o,e[4]=a):a=e[4];let c;return e[5]!==i||e[6]!==a?(c=s.jsxs("div",{className:"relative shrink-0",children:[i,a]}),e[5]=i,e[6]=a,e[7]=c):c=e[7],c}function zo(t){const e=C.c(6),{virtualMcpId:n,size:r}=t,o=Ze(n);if(!o){let a;return e[0]!==r?(a=s.jsx(Te,{icon:null,name:"?",size:r}),e[0]=r,e[1]=a):a=e[1],a}const l=o.icon??null;let i;return e[2]!==o.title||e[3]!==r||e[4]!==l?(i=s.jsx(Te,{icon:l,name:o.title,size:r}),e[2]=o.title,e[3]=r,e[4]=l,e[5]=i):i=e[5],i}function To(t){const e=C.c(39),{open:n,onOpenChange:r}=t,[o,l]=$.useState(""),{org:i}=$e(),{setTaskId:a}=Qt();let c;e[0]!==i.id||e[1]!==i.slug?(c={connectionId:pt,orgId:i.id,orgSlug:i.slug},e[0]=i.id,e[1]=i.slug,e[2]=c):c=e[2];const u=ht(c);let d,m,f;e[3]!==i.id||e[4]!==o?(f=o.trim(),m=qs,d=Ys.globalSearch(i.id,f),e[3]=i.id,e[4]=o,e[5]=d,e[6]=m,e[7]=f):(d=e[5],m=e[6],f=e[7]);const p=n&&f.length>0;let x;e[8]!==u||e[9]!==f?(x=async()=>{if(!u)throw new Error("MCP client unavailable");const w=await u.callTool({name:"GLOBAL_SEARCH",arguments:{query:f,limit:20}});return w.structuredContent??w},e[8]=u,e[9]=f,e[10]=x):x=e[10];let g;e[11]!==d||e[12]!==p||e[13]!==x?(g={queryKey:d,enabled:p,queryFn:x,staleTime:1e4},e[11]=d,e[12]=p,e[13]=x,e[14]=g):g=e[14];const{data:h,isFetching:v}=m(g);let b;e[15]!==h?.items?(b=h?.items??[],e[15]=h?.items,e[16]=b):b=e[16];const j=b;let _;e[17]!==r?(_=w=>{w||l(""),r(w)},e[17]=r,e[18]=_):_=e[18];const S=_;let y;e[19]!==S||e[20]!==a?(y=w=>{S(!1),a(w.id,w.virtual_mcp_id??void 0)},e[19]=S,e[20]=a,e[21]=y):y=e[21];const k=y;let N;e[22]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsxs(gr,{className:"sr-only",children:[s.jsx(br,{children:"Search"}),s.jsx(jr,{children:"Search across your organization's resources."})]}),e[22]=N):N=e[22];let M;e[23]!==o?(M=s.jsx(Cr,{value:o,onValueChange:l,placeholder:"Search..."}),e[23]=o,e[24]=M):M=e[24];let I;e[25]!==k||e[26]!==v||e[27]!==j||e[28]!==f?(I=f?v&&j.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):j.length===0?s.jsx(yr,{children:"No results."}):j.map(w=>w.type==="thread"?s.jsxs(Sr,{value:`thread:${w.id}:${w.title}`,onSelect:()=>k(w),className:"gap-2.5",children:[s.jsx(Mo,{virtualMcpId:w.virtual_mcp_id,size:"xs"}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("div",{className:"text-sm text-foreground truncate",children:w.title||"Untitled thread"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(w.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${w.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[25]=k,e[26]=v,e[27]=j,e[28]=f,e[29]=I):I=e[29];let z;e[30]!==I?(z=s.jsx(Nr,{children:I}),e[30]=I,e[31]=z):z=e[31];let A;e[32]!==M||e[33]!==z?(A=s.jsxs(vr,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[N,s.jsxs(wr,{shouldFilter:!1,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:[M,z]})]}),e[32]=M,e[33]=z,e[34]=A):A=e[34];let P;return e[35]!==S||e[36]!==n||e[37]!==A?(P=s.jsx(_r,{open:n,onOpenChange:S,children:A}),e[35]=S,e[36]=n,e[37]=A,e[38]=P):P=e[38],P}function Oo(t){return t==="ephemeral"||t.startsWith("thread:")}const Tt=new Map;function gs(t){let e=Tt.get(t);return e||(e={tick:0,subscribers:new Set,intervalId:null},Tt.set(t,e)),e}function Po(t,e){const n=gs(t);return n.subscribers.add(e),n.intervalId===null&&(n.intervalId=setInterval(()=>{n.tick+=1;for(const r of n.subscribers)r()},t)),()=>{n.subscribers.delete(e),n.subscribers.size===0&&n.intervalId!==null&&(clearInterval(n.intervalId),n.intervalId=null)}}function Eo(t){const e=C.c(3),n=t;let r,o;return e[0]!==n?(r=l=>Po(n,l),o=()=>gs(n).tick,e[0]=n,e[1]=r,e[2]=o):(r=e[1],o=e[2]),$.useSyncExternalStore(r,o,Ro)}function Ro(){return 0}function jt(t){const e=C.c(45),{task:n,isActive:r,onClick:o,onArchive:l,showAutomationBadge:i,showAgentIcon:a,hideStatusIdle:c}=t,u=$r(n.status),d=u.icon,m=n.metadata?.kind==="tool_call_run",f=Ze(m?void 0:n.virtual_mcp_id);let p;e[0]!==f?(p=Tr(f),e[0]=f,e[1]=p):p=e[1];const x=p;Eo(6e4);const g=i||!!n.trigger_id,h=n.id,v="button",b=0;let j;e[2]!==o?(j=R=>{R.target===R.currentTarget&&(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),o())},e[2]=o,e[3]=j):j=e[3];const _=r?"bg-accent text-accent-foreground":"hover:bg-accent/60";let S;e[4]!==_?(S=X("group/row flex items-center gap-2 px-2 py-1.5 rounded-md cursor-pointer transition-colors","focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",_),e[4]=_,e[5]=S):S=e[5];let y;e[6]!==m||e[7]!==a||e[8]!==f?.icon||e[9]!==f?.title?(y=a&&!m&&s.jsx(Te,{icon:f?.icon??null,name:f?.title??"?",size:"2xs"}),e[6]=m,e[7]=a,e[8]=f?.icon,e[9]=f?.title,e[10]=y):y=e[10];let k;e[11]!==g?(k=g&&s.jsx(ns,{size:12,"aria-label":"Automation-triggered",className:"shrink-0 text-blue-500"}),e[11]=g,e[12]=k):k=e[12];const N=n.title||"Untitled task";let M;e[13]!==N?(M=s.jsx("div",{className:"text-sm text-foreground truncate",children:N}),e[13]=N,e[14]=M):M=e[14];let I;e[15]!==M||e[16]!==k?(I=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[k,M]}),e[15]=M,e[16]=k,e[17]=I):I=e[17];let z;e[18]!==x||e[19]!==r||e[20]!==n.branch||e[21]!==n.updated_at?(z=n.updated_at&&s.jsxs("div",{className:X("flex items-center gap-1 text-[11px] min-w-0",r?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!Oo(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):x?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[x.owner,"/",x.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:zr(new Date(n.updated_at))})]}),e[18]=x,e[19]=r,e[20]=n.branch,e[21]=n.updated_at,e[22]=z):z=e[22];let A;e[23]!==I||e[24]!==z?(A=s.jsxs("div",{className:"flex-1 min-w-0",children:[I,z]}),e[23]=I,e[24]=z,e[25]=A):A=e[25];const P="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",w=!c&&s.jsx("span",{className:"[grid-area:slot] flex size-7 items-center justify-center pointer-events-none transition-opacity group-hover/row:opacity-0","aria-label":u.label,children:s.jsx(d,{size:14,className:X(u.iconClassName,n.status==="in_progress"&&"animate-spin")})});let E;e[26]!==l?(E=R=>{R.stopPropagation(),l()},e[26]=l,e[27]=E):E=e[27];let T;e[28]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(mr,{size:14}),e[28]=T):T=e[28];let D;e[29]!==E?(D=s.jsx(He,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Archive task",onClick:E,className:"[grid-area:slot] opacity-0 pointer-events-none group-hover/row:opacity-100 group-hover/row:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto transition-opacity flex size-7 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:T})}),e[29]=E,e[30]=D):D=e[30];let G;e[31]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsx(Ke,{side:"right",children:"Archive"}),e[31]=G):G=e[31];let F;e[32]!==D?(F=s.jsxs(Ye,{children:[D,G]}),e[32]=D,e[33]=F):F=e[33];let B;e[34]!==w||e[35]!==F?(B=s.jsxs("div",{className:P,children:[w,F]}),e[34]=w,e[35]=F,e[36]=B):B=e[36];let K;return e[37]!==o||e[38]!==A||e[39]!==B||e[40]!==j||e[41]!==S||e[42]!==y||e[43]!==n.id?(K=s.jsxs("div",{"data-task-id":h,role:v,tabIndex:b,onClick:o,onKeyDown:j,className:S,children:[y,A,B]}),e[37]=o,e[38]=A,e[39]=B,e[40]=j,e[41]=S,e[42]=y,e[43]=n.id,e[44]=K):K=e[44],K}function Do(t){const e=C.c(39),{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:l,onArchiveTask:i,onNewTaskInGroup:a}=t,c=Ze(n),u=r[0];let d;e[0]!==u||e[1]!==a||e[2]!==l||e[3]!==n?(d=()=>{u?l(u):a(n)},e[0]=u,e[1]=a,e[2]=l,e[3]=n,e[4]=d):d=e[4];const m=d;let f;e[5]!==n?(f=A=>{A&&V("sidebar_group_hover_popover_opened",{virtual_mcp_id:n})},e[5]=n,e[6]=f):f=e[6];const p=!!(u&&o&&u.id===o),x=c?.icon??null,g=c?.title??"?";let h;e[7]!==x||e[8]!==g?(h=s.jsx(Te,{icon:x,name:g,size:"sm+"}),e[7]=x,e[8]=g,e[9]=h):h=e[9];let v;e[10]!==m||e[11]!==p||e[12]!==h?(v=s.jsx(pe,{children:s.jsx(kr,{asChild:!0,children:s.jsx(Ae,{onClick:m,isActive:p,children:h})})}),e[10]=m,e[11]=p,e[12]=h,e[13]=v):v=e[13];const b=c?.title??"Agent";let j;e[14]!==b?(j=s.jsx("span",{className:"truncate",children:b}),e[14]=b,e[15]=j):j=e[15];let _;e[16]!==a||e[17]!==n?(_=()=>a(n),e[16]=a,e[17]=n,e[18]=_):_=e[18];let S;e[19]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Ie,{size:14}),e[19]=S):S=e[19];let y;e[20]!==_?(y=s.jsx("button",{type:"button","aria-label":"New task in this agent",onClick:_,className:"flex size-6 items-center justify-center rounded-md hover:bg-accent text-muted-foreground hover:text-foreground",children:S}),e[20]=_,e[21]=y):y=e[21];let k;e[22]!==y||e[23]!==j?(k=s.jsxs("div",{className:"flex items-center justify-between px-1 pb-1 text-xs font-medium",children:[j,y]}),e[22]=y,e[23]=j,e[24]=k):k=e[24];let N;e[25]!==o||e[26]!==i||e[27]!==l||e[28]!==r?(N=r.length===0?s.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:"No tasks yet"}):r.map(A=>s.jsx(jt,{task:A,isActive:o===A.id,onClick:()=>l(A),onArchive:()=>i(A),showAutomationBadge:!!A.trigger_id},A.id)),e[25]=o,e[26]=i,e[27]=l,e[28]=r,e[29]=N):N=e[29];let M;e[30]!==N?(M=s.jsx("div",{className:"flex flex-col gap-0.5 max-h-[60vh] overflow-y-auto",children:N}),e[30]=N,e[31]=M):M=e[31];let I;e[32]!==k||e[33]!==M?(I=s.jsxs(Ir,{side:"right",align:"start",sideOffset:8,className:"w-72 p-2",children:[k,M]}),e[32]=k,e[33]=M,e[34]=I):I=e[34];let z;return e[35]!==I||e[36]!==f||e[37]!==v?(z=s.jsxs(Ar,{openDelay:120,closeDelay:150,onOpenChange:f,children:[v,I]}),e[35]=I,e[36]=f,e[37]=v,e[38]=z):z=e[38],z}const rt="__tool_call_runs__",Ot=["requires_action","in_progress","failed","expired","completed"];function Fo(t){const e=new Map(Ot.map(n=>[n,[]]));for(const n of t){const r=n.status??"completed";(e.get(r)??e.get("completed")).push(n)}return Ot.map(n=>({status:n,threads:e.get(n)})).filter(n=>n.threads.length>0)}function Go(t,e){const n=new Map;for(const a of t){if(a.id.startsWith("thrd_welcome_"))continue;const c=a.virtual_mcp_id??rt,u=n.get(c);u?(u.threads.push(a),(a.updated_at??"")>u.latestUpdatedAt&&(u.latestUpdatedAt=a.updated_at??"")):n.set(c,{virtualMcpId:c,threads:[a],latestUpdatedAt:a.updated_at??""})}e&&!n.has(e)&&n.set(e,{virtualMcpId:e,threads:[],latestUpdatedAt:""});const r=e!==null?n.get(e):void 0;r&&e&&n.delete(e);const o=n.get(rt);o&&n.delete(rt);const l=[...n.values()].sort((a,c)=>c.latestUpdatedAt.localeCompare(a.latestUpdatedAt)),i=[];return r&&i.push(r),i.push(...l),o&&i.push(o),i}const bs="sidebar.group-order.",xt=new Map;function Bo(t){const e=xt.get(t);if(e)return e;try{const n=localStorage.getItem(`${bs}${t}`),r=n?JSON.parse(n):[],o=Array.isArray(r)?r.filter(l=>typeof l=="string"):[];return xt.set(t,o),o}catch{return[]}}function Lo(t,e){xt.set(t,e);try{localStorage.setItem(`${bs}${t}`,JSON.stringify(e))}catch{}}function Uo(t,e,n){let r=Bo(t);const o=new Set(r),i=e.map(c=>c.virtualMcpId).filter(c=>!o.has(c));if(i.length>0){const u=n!==null&&r[0]===n?1:0;r=[...r.slice(0,u),...i,...r.slice(u)],Lo(t,r)}const a=new Map(e.map(c=>[c.virtualMcpId,c]));return r.map(c=>{const u=a.get(c);return u||{virtualMcpId:c,threads:[],latestUpdatedAt:""}})}var vt="ContextMenu",[Ho]=sn(vt,[Ft]),oe=Ft(),[Ko,js]=Ho(vt),vs=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,dir:o,modal:l=!0}=t,[i,a]=$.useState(!1),c=oe(e),u=Ws(r),d=$.useCallback(m=>{a(m),u(m)},[u]);return s.jsx(Ko,{scope:e,open:i,onOpenChange:d,modal:l,children:s.jsx(Xs,{...c,dir:o,open:i,onOpenChange:d,modal:l,children:n})})};vs.displayName=vt;var _s="ContextMenuTrigger",ys=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...o}=t,l=js(_s,n),i=oe(n),a=$.useRef({x:0,y:0}),c=$.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),u=$.useRef(0),d=$.useCallback(()=>window.clearTimeout(u.current),[]),m=f=>{a.current={x:f.clientX,y:f.clientY},l.onOpenChange(!0)};return $.useEffect(()=>d,[d]),$.useEffect(()=>{r&&d()},[r,d]),s.jsxs(s.Fragment,{children:[s.jsx(Qs,{...i,virtualRef:c}),s.jsx(Js.span,{"data-state":l.open?"open":"closed","data-disabled":r?"":void 0,...o,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:Ve(t.onContextMenu,f=>{d(),m(f),f.preventDefault()}),onPointerDown:r?t.onPointerDown:Ve(t.onPointerDown,nt(f=>{d(),u.current=window.setTimeout(()=>m(f),700)})),onPointerMove:r?t.onPointerMove:Ve(t.onPointerMove,nt(d)),onPointerCancel:r?t.onPointerCancel:Ve(t.onPointerCancel,nt(d)),onPointerUp:r?t.onPointerUp:Ve(t.onPointerUp,nt(d))})]})});ys.displayName=_s;var Yo="ContextMenuPortal",Ss=t=>{const{__scopeContextMenu:e,...n}=t,r=oe(e);return s.jsx(Vs,{...r,...n})};Ss.displayName=Yo;var Cs="ContextMenuContent",Ns=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=js(Cs,n),l=oe(n),i=$.useRef(!1);return s.jsx(Zs,{...l,...r,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),!a.defaultPrevented&&i.current&&a.preventDefault(),i.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),!a.defaultPrevented&&!o.modal&&(i.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Ns.displayName=Cs;var qo="ContextMenuGroup",Wo=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=oe(n);return s.jsx(nn,{...o,...r,ref:e})});Wo.displayName=qo;var Xo="ContextMenuLabel",Qo=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=oe(n);return s.jsx(rn,{...o,...r,ref:e})});Qo.displayName=Xo;var Jo="ContextMenuItem",ws=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=oe(n);return s.jsx(en,{...o,...r,ref:e})});ws.displayName=Jo;var Vo="ContextMenuCheckboxItem",Zo=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=oe(n);return s.jsx(on,{...o,...r,ref:e})});Zo.displayName=Vo;var el="ContextMenuRadioGroup",tl=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=oe(n);return s.jsx(ln,{...o,...r,ref:e})});tl.displayName=el;var sl="ContextMenuRadioItem",nl=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=oe(n);return s.jsx(an,{...o,...r,ref:e})});nl.displayName=sl;var rl="ContextMenuItemIndicator",ol=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=oe(n);return s.jsx(cn,{...o,...r,ref:e})});ol.displayName=rl;var ll="ContextMenuSeparator",ks=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=oe(n);return s.jsx(tn,{...o,...r,ref:e})});ks.displayName=ll;var il="ContextMenuArrow",al=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=oe(n);return s.jsx(dn,{...o,...r,ref:e})});al.displayName=il;var cl="ContextMenuSubTrigger",dl=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=oe(n);return s.jsx(un,{...o,...r,ref:e})});dl.displayName=cl;var ul="ContextMenuSubContent",ml=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=oe(n);return s.jsx(mn,{...o,...r,ref:e,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});ml.displayName=ul;function nt(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var fl=vs,xl=ys,pl=Ss,hl=Ns,gl=ws,bl=ks;function jl(t){const e=C.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=s.jsx(fl,{"data-slot":"context-menu",...n}),e[2]=n,e[3]=r):r=e[3],r}function vl(t){const e=C.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=s.jsx(xl,{"data-slot":"context-menu-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function _l(t){const e=C.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=X("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=s.jsx(pl,{children:s.jsx(hl,{"data-slot":"context-menu-content",className:o,...r})}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function dt(t){const e=C.c(12);let n,r,o,l;e[0]!==t?({className:n,inset:r,variant:l,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=l):(n=e[1],r=e[2],o=e[3],l=e[4]);const i=l===void 0?"default":l;let a;e[5]!==n?(a=X("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n),e[5]=n,e[6]=a):a=e[6];let c;return e[7]!==r||e[8]!==o||e[9]!==a||e[10]!==i?(c=s.jsx(gl,{"data-slot":"context-menu-item","data-inset":r,"data-variant":i,className:a,...o}),e[7]=r,e[8]=o,e[9]=a,e[10]=i,e[11]=c):c=e[11],c}function yl(t){const e=C.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=X("bg-border -mx-1 my-1 h-px",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=s.jsx(bl,{"data-slot":"context-menu-separator",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}const Sl="sidebar.group.expanded.";function Is(t,e){const n=C.c(3),[r,o]=fn(`${Sl}${t}`,e);let l;return n[0]!==r||n[1]!==o?(l=[r,o],n[0]=r,n[1]=o,n[2]=l):l=n[2],l}function Cl(t){const e=C.c(50),{virtualMcpId:n,threads:r,isDecopilot:o,hasActiveTask:l,activeTaskId:i,onSelectTask:a,onArchiveTask:c,onNewTaskInGroup:u,onShowSettings:d,onHideGroup:m,dimmed:f}=t,p=o||l,[x,g]=Is(n,p),h=n===rt;let v,b;e[0]!==x||e[1]!==g?(v=()=>g(!x),b=T=>{T.target===T.currentTarget&&(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),g(!x))},e[0]=x,e[1]=g,e[2]=v,e[3]=b):(v=e[2],b=e[3]);let j;e[4]===Symbol.for("react.memo_cache_sentinel")?(j=X("group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground","cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors"),e[4]=j):j=e[4];let _;e[5]!==h||e[6]!==n?(_=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(Nl,{virtualMcpId:n,isToolCallRuns:h})}),e[5]=h,e[6]=n,e[7]=_):_=e[7];let S;e[8]!==x?(S=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:x?s.jsx(rs,{size:14}):s.jsx(bt,{size:14})}),e[8]=x,e[9]=S):S=e[9];let y;e[10]!==_||e[11]!==S?(y=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[_,S]}),e[10]=_,e[11]=S,e[12]=y):y=e[12];let k;e[13]!==h||e[14]!==n?(k=s.jsx("span",{className:"flex-1 truncate",children:s.jsx(kl,{virtualMcpId:n,isToolCallRuns:h})}),e[13]=h,e[14]=n,e[15]=k):k=e[15];let N;e[16]!==f||e[17]!==h||e[18]!==u||e[19]!==n?(N=!h&&!f&&s.jsx("button",{type:"button","aria-label":"New task in this agent",onClick:T=>{T.stopPropagation(),u(n)},className:"opacity-0 group-hover/group:opacity-100 focus-visible:opacity-100 transition-opacity flex size-7 items-center justify-center rounded-md hover:bg-accent text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:s.jsx(Ie,{size:14})}),e[16]=f,e[17]=h,e[18]=u,e[19]=n,e[20]=N):N=e[20];let M;e[21]!==x||e[22]!==v||e[23]!==b||e[24]!==y||e[25]!==k||e[26]!==N?(M=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":x,onClick:v,onKeyDown:b,className:j,children:[y,k,N]}),e[21]=x,e[22]=v,e[23]=b,e[24]=y,e[25]=k,e[26]=N,e[27]=M):M=e[27];const I=M,z=f&&"opacity-50";let A;e[28]!==z?(A=X("flex flex-col gap-0.5",z),e[28]=z,e[29]=A):A=e[29];let P;e[30]!==I||e[31]!==h||e[32]!==m||e[33]!==u||e[34]!==d||e[35]!==n?(P=h?I:s.jsxs(jl,{children:[s.jsx(vl,{asChild:!0,children:I}),s.jsxs(_l,{className:"w-56",children:[s.jsxs(dt,{onSelect:()=>u(n),children:[s.jsx(Ie,{size:14,className:"mr-2"}),"New task"]}),s.jsxs(dt,{onSelect:()=>d(n),children:[s.jsx(et,{size:14,className:"mr-2"}),"Settings"]}),s.jsx(yl,{}),s.jsxs(dt,{onSelect:()=>m(n),children:[s.jsx(Ln,{size:14,className:"mr-2"}),"Hide"]})]})]}),e[30]=I,e[31]=h,e[32]=m,e[33]=u,e[34]=d,e[35]=n,e[36]=P):P=e[36];let w;e[37]!==i||e[38]!==x||e[39]!==h||e[40]!==c||e[41]!==u||e[42]!==a||e[43]!==r||e[44]!==n?(w=x&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:r.length===0&&!h?s.jsxs("button",{type:"button",onClick:()=>u(n),className:"flex items-center gap-2 px-2 py-1.5 rounded-md cursor-pointer text-sm text-muted-foreground hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[s.jsx(Ie,{size:14}),s.jsx("span",{children:"New thread"})]}):r.map(T=>s.jsx(jt,{task:T,isActive:i===T.id,onClick:()=>a(T),onArchive:()=>c(T),showAutomationBadge:!!T.trigger_id},T.id))}),e[37]=i,e[38]=x,e[39]=h,e[40]=c,e[41]=u,e[42]=a,e[43]=r,e[44]=n,e[45]=w):w=e[45];let E;return e[46]!==A||e[47]!==P||e[48]!==w?(E=s.jsxs("div",{className:A,children:[P,w]}),e[46]=A,e[47]=P,e[48]=w,e[49]=E):E=e[49],E}function Nl(t){const e=C.c(3),{virtualMcpId:n,isToolCallRuns:r}=t;if(r){let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Te,{icon:null,name:"⚙",size:"2xs"}),e[0]=l):l=e[0],l}let o;return e[1]!==n?(o=s.jsx(wl,{virtualMcpId:n}),e[1]=n,e[2]=o):o=e[2],o}function wl(t){const e=C.c(4),{virtualMcpId:n}=t,r=Ze(n);if(!r){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Te,{icon:null,name:"?",size:"2xs"}),e[0]=i):i=e[0],i}const o=r.icon??null;let l;return e[1]!==r.title||e[2]!==o?(l=s.jsx(Te,{icon:o,name:r.title,size:"2xs"}),e[1]=r.title,e[2]=o,e[3]=l):l=e[3],l}function kl(t){const e=C.c(3),{virtualMcpId:n,isToolCallRuns:r}=t;if(r){let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(s.Fragment,{children:"Automation runs"}),e[0]=l):l=e[0],l}let o;return e[1]!==n?(o=s.jsx(Il,{virtualMcpId:n}),e[1]=n,e[2]=o):o=e[2],o}function Il(t){const e=C.c(2),{virtualMcpId:n}=t,o=Ze(n)?.title??"Agent";let l;return e[0]!==o?(l=s.jsx(s.Fragment,{children:o}),e[0]=o,e[1]=l):l=e[1],l}function Al(t){const e=C.c(32),{status:n,threads:r,activeTaskId:o,onSelectTask:l,onArchiveTask:i}=t,a=Mr[n],c=a.icon,u=n==="requires_action"||n==="in_progress",[d,m]=Is(`status-${n}`,u);let f,p;e[0]!==d||e[1]!==m?(f=()=>m(!d),p=y=>{y.target===y.currentTarget&&(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),m(!d))},e[0]=d,e[1]=m,e[2]=f,e[3]=p):(f=e[2],p=e[3]);let x;e[4]!==c||e[5]!==a.iconClassName?(x=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(c,{size:12,className:a.iconClassName})}),e[4]=c,e[5]=a.iconClassName,e[6]=x):x=e[6];let g;e[7]!==d?(g=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:d?s.jsx(rs,{size:14}):s.jsx(bt,{size:14})}),e[7]=d,e[8]=g):g=e[8];let h;e[9]!==x||e[10]!==g?(h=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[x,g]}),e[9]=x,e[10]=g,e[11]=h):h=e[11];let v;e[12]!==a.label?(v=s.jsx("span",{className:"flex-1 truncate",children:a.label}),e[12]=a.label,e[13]=v):v=e[13];let b;e[14]!==r.length?(b=s.jsx("div",{className:"size-5 shrink-0 flex items-center justify-center",children:s.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:r.length})}),e[14]=r.length,e[15]=b):b=e[15];let j;e[16]!==d||e[17]!==f||e[18]!==p||e[19]!==h||e[20]!==v||e[21]!==b?(j=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":d,onClick:f,onKeyDown:p,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[h,v,b]}),e[16]=d,e[17]=f,e[18]=p,e[19]=h,e[20]=v,e[21]=b,e[22]=j):j=e[22];let _;e[23]!==o||e[24]!==d||e[25]!==i||e[26]!==l||e[27]!==r?(_=d&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:r.map(y=>s.jsx(jt,{task:y,isActive:o===y.id,onClick:()=>l(y),onArchive:()=>i(y),showAutomationBadge:!!y.trigger_id,showAgentIcon:!0,hideStatusIdle:!0},y.id))}),e[23]=o,e[24]=d,e[25]=i,e[26]=l,e[27]=r,e[28]=_):_=e[28];let S;return e[29]!==j||e[30]!==_?(S=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[j,_]}),e[29]=j,e[30]=_,e[31]=S):S=e[31],S}const As={all:"All tasks",manual:"Chats",automation:"Automation"},$s={all:"All members",mine:"Mine only"},Pt={agent:"Agent",status:"Status"};function Ms(){const t=C.c(71),{data:e}=Be.useSession(),n=e?.user?.id,{org:r}=$e(),o=Cn(r.id).id,{threads:l,hasMore:i,isFetchingMore:a,fetchNextPage:c}=En(),u=$o(l,{hidden:!1}),{hide:d}=Xt(),{setTaskId:m,createNewTask:f}=Qt(),p=Oe();let x;t[0]===Symbol.for("react.memo_cache_sentinel")?(x={strict:!1},t[0]=x):x=t[0];const g=Dt(x),h=g.taskId??null,v=[...u].sort(Ol),[b,j]=$.useState("all"),[_,S]=$.useState("mine"),[y,k]=$.useState("agent"),[N,M]=$.useState(!1),[I,z]=$.useState(!1),{state:A}=Je(),P=$.useRef(null);let w;t[1]!==c?(w=()=>c(),t[1]=c,t[2]=w):w=t[2];const E=hr(w,i,a,P),T=Uo(r.id,Go(v,o),o);let D;t[3]!==n||t[4]!==_?(D=O=>_==="mine"&&n?O.filter(H=>H.created_by===n):O,t[3]=n,t[4]=_,t[5]=D):D=t[5];const G=D;let F;t[6]!==b?(F=O=>b==="automation"?O.filter(Tl):b==="manual"?O.filter(zl):O,t[6]=b,t[7]=F):F=t[7];const B=F,K=O=>{const H=O.id===h;if(d(O.id),!H)return;const ke=v.find(Xe=>Xe.id!==O.id);ke?m(ke.id,ke.virtual_mcp_id):g.org&&p({to:"/$org",params:{org:g.org}})};let R;t[8]!==f?(R=O=>{V("sidebar_group_new_clicked",{virtual_mcp_id:O}),f(O)},t[8]=f,t[9]=R):R=t[9];const ne=R,Q=kn();let W;t[10]!==Q?(W=O=>{V("sidebar_group_settings_clicked",{virtual_mcp_id:O}),Q(O,{search:{main:"instructions"}})},t[10]=Q,t[11]=W):W=t[11];const Z=W,ee=O=>{V("sidebar_group_hide_clicked",{virtual_mcp_id:O});const H=T.find(ke=>ke.virtualMcpId===O);if(H)for(const ke of H.threads)d(ke.id)},L=b!=="all"||_!=="mine";if(A==="collapsed")return s.jsx("div",{className:"flex flex-col min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:T.map(O=>{const H=B(G(O.threads));return L&&H.length===0?null:s.jsx(Do,{virtualMcpId:O.virtualMcpId,threads:H,activeTaskId:h,onSelectTask:Xe=>m(Xe.id,Xe.virtual_mcp_id),onArchiveTask:K,onNewTaskInGroup:ne},O.virtualMcpId)})});const U="flex flex-col h-full min-h-0";let J;t[12]!==M?(J=()=>{V("tasks_panel_search_opened"),z(!0),M(!0)},t[12]=M,t[13]=J):J=t[13];let te;t[14]===Symbol.for("react.memo_cache_sentinel")?(te=s.jsx(gn,{size:16}),t[14]=te):te=t[14];let se;t[15]!==J?(se=s.jsx(ze,{"aria-label":"Search threads",onClick:J,children:te}),t[15]=J,t[16]=se):se=t[16];const q=Pt[y==="agent"?"status":"agent"];let he;t[17]!==q?(he=q.toLowerCase(),t[17]=q,t[18]=he):he=t[18];const Ne=`Group by ${he}`,Pe=Pt[y];let ge;t[19]!==Pe?(ge=Pe.toLowerCase(),t[19]=Pe,t[20]=ge):ge=t[20];const Ee=`Grouped by ${ge}`;let le,ie;t[21]!==y?(le=()=>{const O=y==="agent"?"status":"agent";V("tasks_panel_group_by_changed",{to_value:O}),k(O)},ie=y==="agent"?s.jsx(pr,{size:16}):s.jsx(bn,{size:16}),t[21]=y,t[22]=le,t[23]=ie):(le=t[22],ie=t[23]);let ae;t[24]!==Ne||t[25]!==Ee||t[26]!==le||t[27]!==ie?(ae=s.jsx(ze,{"aria-label":Ne,title:Ee,onClick:le,children:ie}),t[24]=Ne,t[25]=Ee,t[26]=le,t[27]=ie,t[28]=ae):ae=t[28];let be;t[29]===Symbol.for("react.memo_cache_sentinel")?(be=s.jsx(xr,{size:16}),t[29]=be):be=t[29];let ce;t[30]!==L?(ce=s.jsx(Qe,{asChild:!0,children:s.jsx(ze,{"aria-label":"Filter tasks",active:L,children:be})}),t[30]=L,t[31]=ce):ce=t[31];let de;t[32]!==_?(de=O=>{const H=O;H!==_&&V("tasks_panel_member_filter_changed",{to_value:H}),S(H)},t[32]=_,t[33]=de):de=t[33];let je;t[34]===Symbol.for("react.memo_cache_sentinel")?(je=s.jsx(kt,{size:"sm",className:"w-full",children:s.jsx(It,{})}),t[34]=je):je=t[34];let ve;t[35]===Symbol.for("react.memo_cache_sentinel")?(ve=Object.keys($s),t[35]=ve):ve=t[35];let _e;t[36]===Symbol.for("react.memo_cache_sentinel")?(_e=s.jsx(wt,{children:ve.map(Ml)}),t[36]=_e):_e=t[36];let we;t[37]!==_||t[38]!==de?(we=s.jsx(Et,{label:"Members",children:s.jsxs(At,{value:_,onValueChange:de,children:[je,_e]})}),t[37]=_,t[38]=de,t[39]=we):we=t[39];let ue;t[40]!==b?(ue=O=>{const H=O;H!==b&&V("tasks_panel_filter_changed",{to_value:H}),j(H)},t[40]=b,t[41]=ue):ue=t[41];let Re;t[42]===Symbol.for("react.memo_cache_sentinel")?(Re=s.jsx(kt,{size:"sm",className:"w-full",children:s.jsx(It,{})}),t[42]=Re):Re=t[42];let ye;t[43]===Symbol.for("react.memo_cache_sentinel")?(ye=Object.keys(As),t[43]=ye):ye=t[43];let Se;t[44]===Symbol.for("react.memo_cache_sentinel")?(Se=s.jsx(wt,{children:ye.map($l)}),t[44]=Se):Se=t[44];let me;t[45]!==ue||t[46]!==b?(me=s.jsx(Et,{label:"Type",children:s.jsxs(At,{value:b,onValueChange:ue,children:[Re,Se]})}),t[45]=ue,t[46]=b,t[47]=me):me=t[47];let Ce;t[48]!==we||t[49]!==me?(Ce=s.jsx(ct,{align:"start",sideOffset:8,collisionPadding:16,className:"w-72 p-3",children:s.jsxs("div",{className:"flex flex-col gap-2",children:[we,me]})}),t[48]=we,t[49]=me,t[50]=Ce):Ce=t[50];let fe;t[51]!==ce||t[52]!==Ce?(fe=s.jsxs(at,{children:[ce,Ce]}),t[51]=ce,t[52]=Ce,t[53]=fe):fe=t[53];let xe;t[54]!==ae||t[55]!==fe||t[56]!==se?(xe=s.jsxs("div",{className:"flex items-center gap-0.5",children:[se,ae,fe]}),t[54]=ae,t[55]=fe,t[56]=se,t[57]=xe):xe=t[57];let Me;t[58]===Symbol.for("react.memo_cache_sentinel")?(Me=s.jsx(os,{compact:!0}),t[58]=Me):Me=t[58];let re;t[59]!==xe?(re=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[xe,Me]}),t[59]=xe,t[60]=re):re=t[60];const qe="flex-1 min-h-0 overflow-y-auto overscroll-contain flex flex-col gap-0.5 -mr-2 pr-2",Ue=y==="status"?s.jsxs(s.Fragment,{children:[Fo(B(G(v))).map(O=>s.jsx(Al,{status:O.status,threads:O.threads,activeTaskId:h,onSelectTask:H=>m(H.id,H.virtual_mcp_id),onArchiveTask:K},O.status)),a&&s.jsx("div",{className:"py-2 text-center text-xs text-muted-foreground",children:"Loading more…"}),i&&s.jsx("div",{ref:E,"aria-hidden":!0})]}):s.jsxs(s.Fragment,{children:[T.map(O=>{const H=B(G(O.threads)),ke=O.threads.some(tt=>tt.id===h),Xe=L&&H.length===0;return s.jsx(Cl,{virtualMcpId:O.virtualMcpId,threads:H,isDecopilot:O.virtualMcpId===o,hasActiveTask:ke,activeTaskId:h,onSelectTask:tt=>m(tt.id,tt.virtual_mcp_id),onArchiveTask:K,onNewTaskInGroup:ne,onShowSettings:Z,onHideGroup:ee,dimmed:Xe},O.virtualMcpId)}),a&&s.jsx("div",{className:"py-2 text-center text-xs text-muted-foreground",children:"Loading more…"}),i&&s.jsx("div",{ref:E,"aria-hidden":!0})]});let De;t[61]!==Ue?(De=s.jsx("div",{ref:P,className:qe,children:Ue}),t[61]=Ue,t[62]=De):De=t[62];let Fe;t[63]!==I||t[64]!==N||t[65]!==M?(Fe=I&&s.jsx(To,{open:N,onOpenChange:M}),t[63]=I,t[64]=N,t[65]=M,t[66]=Fe):Fe=t[66];let We;return t[67]!==re||t[68]!==De||t[69]!==Fe?(We=s.jsxs("div",{className:U,children:[re,De,Fe]}),t[67]=re,t[68]=De,t[69]=Fe,t[70]=We):We=t[70],We}function $l(t){return s.jsx(ss,{value:t,children:As[t]},t)}function Ml(t){return s.jsx(ss,{value:t,children:$s[t]},t)}function zl(t){return!t.trigger_id}function Tl(t){return!!t.trigger_id}function Ol(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function Et(t){const e=C.c(7),{label:n,children:r}=t;let o;e[0]!==n?(o=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=o):o=e[1];let l;e[2]!==r?(l=s.jsx("div",{className:"w-36 shrink-0",children:r}),e[2]=r,e[3]=l):l=e[3];let i;return e[4]!==o||e[5]!==l?(i=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o,l]}),e[4]=o,e[5]=l,e[6]=i):i=e[6],i}function Oi(){const t=C.c(4),e=ls();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Io,{}),t[0]=n):n=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Gt,{children:s.jsxs($.Suspense,{fallback:s.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:"Loading tasks…"}),children:[s.jsx(is,{className:"mb-2"}),s.jsx(Ms,{})]})}),t[1]=r):r=t[1];let o;return t[2]!==e?(o=s.jsx(ds,{sections:e,footer:n,additionalContent:r}),t[2]=e,t[3]=o):o=t[3],o}function Pi(t){const e=C.c(5),{onClose:n}=t,r=ls();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Ao,{}),e[0]=o):o=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Gt,{children:s.jsxs($.Suspense,{fallback:null,children:[s.jsx(is,{className:"mb-2"}),s.jsx(Ms,{})]})}),e[1]=l):l=e[1];let i;return e[2]!==n||e[3]!==r?(i=s.jsx(qr,{sections:r,onClose:n,footer:o,additionalContent:l}),e[2]=n,e[3]=r,e[4]=i):i=e[4],i}export{Oi as S,Pi as a,is as b};
|
package/dist/client/assets/{infiniteQueryObserver-CbM0kgNm.js → infiniteQueryObserver-CFFNkbfX.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d2 as g,d3 as d,d4 as v}from"./index-
|
|
1
|
+
import{d2 as g,d3 as d,d4 as v}from"./index-c9Pbt5D9.js";var b=class extends g{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:s}=e,i=super.createResult(e,t),{isFetching:c,isRefetching:u,isError:a,isRefetchError:P}=i,r=s.fetchMeta?.fetchMore?.direction,h=a&&r==="forward",o=c&&r==="forward",n=a&&r==="backward",f=c&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:v(t,s.data),hasPreviousPage:d(t,s.data),isFetchNextPageError:h,isFetchingNextPage:o,isFetchPreviousPageError:n,isFetchingPreviousPage:f,isRefetchError:P&&!h&&!n,isRefetching:u&&!o&&!f}}};export{b as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as s,c as a,j as d}from"./index-
|
|
1
|
+
import{e as s,c as a,j as d}from"./index-c9Pbt5D9.js";function f(l){const e=s.c(10);let i,t,r;e[0]!==l?({className:i,type:r,...t}=l,e[0]=l,e[1]=i,e[2]=t,e[3]=r):(i=e[1],t=e[2],r=e[3]);let n;e[4]!==i?(n=a("file:text-foreground text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-9 w-full min-w-0 rounded-lg bg-background dark:bg-input/30 px-3 py-1 text-sm transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:opacity-50 card-shadow","focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i),e[4]=i,e[5]=n):n=e[5];let o;return e[6]!==t||e[7]!==n||e[8]!==r?(o=d.jsx("input",{type:r,"data-slot":"input",className:n,...t}),e[6]=t,e[7]=n,e[8]=r,e[9]=o):o=e[9],o}export{f as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as A,j as h,r as z,c as _}from"./index-
|
|
1
|
+
import{e as A,j as h,r as z,c as _}from"./index-c9Pbt5D9.js";import{n as L}from"./Container-CCYhpski.js";import{A as k}from"./agent-icon-BtPamQTT.js";const C={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-9 w-9",md:"h-12 w-12",lg:"h-16 w-16",xl:"h-14 w-14"},Z={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-9",md:"min-w-12",lg:"min-w-16",xl:"min-w-14"},y={"2xs":8,xs:12,sm:16,md:24,lg:32,xl:28},M={"2xs":"xs",xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"lg"};function q(E){const e=A.c(12),{icon:t,name:s,size:w,className:o,fallbackIcon:c}=E,n=w===void 0?"md":w;if(t?.startsWith("icon://")||t?.includes("#agentcolor=")){const r=M[n];let l;return e[0]!==o||e[1]!==t||e[2]!==s||e[3]!==r?(l=h.jsx(k,{icon:t,name:s,size:r,className:o}),e[0]=o,e[1]=t,e[2]=s,e[3]=r,e[4]=l):l=e[4],l}const g=t??"no-icon";let i;return e[5]!==o||e[6]!==c||e[7]!==t||e[8]!==s||e[9]!==n||e[10]!==g?(i=h.jsx(R,{icon:t,name:s,size:n,className:o,fallbackIcon:c},g),e[5]=o,e[6]=c,e[7]=t,e[8]=s,e[9]=n,e[10]=g,e[11]=i):i=e[11],i}function R(E){const e=A.c(24),{icon:t,name:s,size:w,className:o,fallbackIcon:c}=E,n=w===void 0?"md":w,[g,i]=z.useState(!1),r=!!t&&g,l=C[n],b=Z[n];let a;e[0]!==o||e[1]!==l||e[2]!==b?(a=_("rounded-lg border border-border shrink-0 overflow-hidden aspect-square bg-white",l,b,o),e[0]=o,e[1]=l,e[2]=b,e[3]=a):a=e[3];const p=t||void 0,N=!r&&"hidden";let m;e[4]!==N?(m=_("h-full w-full object-cover",N),e[4]=N,e[5]=m):m=e[5];let I,S;e[6]===Symbol.for("react.memo_cache_sentinel")?(I=()=>i(!1),S=()=>i(!0),e[6]=I,e[7]=S):(I=e[6],S=e[7]);let d;e[8]!==s||e[9]!==p||e[10]!==m?(d=h.jsx("img",{src:p,alt:s,className:m,onError:I,onLoad:S}),e[8]=s,e[9]=p,e[10]=m,e[11]=d):d=e[11];const v=r&&"hidden";let f;e[12]!==v?(f=_("h-full w-full flex items-center justify-center bg-muted/20",v),e[12]=v,e[13]=f):f=e[13];let x;e[14]!==c||e[15]!==n?(x=c??h.jsx(L,{size:y[n],className:"text-muted-foreground"}),e[14]=c,e[15]=n,e[16]=x):x=e[16];let u;e[17]!==f||e[18]!==x?(u=h.jsx("div",{className:f,children:x}),e[17]=f,e[18]=x,e[19]=u):u=e[19];let j;return e[20]!==d||e[21]!==u||e[22]!==a?(j=h.jsxs("div",{className:a,children:[d,u]}),e[20]=d,e[21]=u,e[22]=a,e[23]=j):j=e[23],j}export{q as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as n,c as r,j as i,b3 as p}from"./index-
|
|
1
|
+
import{e as n,c as r,j as i,b3 as p}from"./index-c9Pbt5D9.js";function c(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=r("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(p,{"data-slot":"label",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{c as L};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as C,r as i,c as z,j as a,az as V}from"./index-
|
|
1
|
+
import{e as C,r as i,c as z,j as a,az as V}from"./index-c9Pbt5D9.js";import{P as E}from"./index-CNE80A83.js";const H=i.createContext(null);function q(x){const e=C.c(3),{children:l}=x,s=i.useContext(H);if(!s?.tabsEl)return null;let c;return e[0]!==l||e[1]!==s.tabsEl?(c=V.createPortal(l,s.tabsEl),e[0]=l,e[1]=s.tabsEl,e[2]=c):c=e[2],c}function A(x){const e=C.c(3),{children:l}=x,s=i.useContext(H);if(!s?.actionsEl)return null;let c;return e[0]!==l||e[1]!==s.actionsEl?(c=V.createPortal(l,s.actionsEl),e[0]=l,e[1]=s.actionsEl,e[2]=c):c=e[2],c}const B=A;function F(x){const e=C.c(21),{children:l,breadcrumb:s,hideHeader:c}=x;let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={leftEl:null,tabsEl:null,actionsEl:null},e[0]=b):b=e[0];const[w,g]=i.useState(b),N=i.useRef(null),P=i.useRef(null),L=i.useRef(null);let h;e[1]===Symbol.for("react.memo_cache_sentinel")?(h=t=>{N.current=t,t&&g(n=>n.leftEl===t?n:{...n,leftEl:t})},e[1]=h):h=e[1];const $=h;let R;e[2]===Symbol.for("react.memo_cache_sentinel")?(R=t=>{P.current=t,t&&g(n=>n.tabsEl===t?n:{...n,tabsEl:t})},e[2]=R):R=e[2];const _=R;let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=t=>{L.current=t,t&&g(n=>n.actionsEl===t?n:{...n,actionsEl:t})},e[3]=d):d=e[3];const k=d,p=c&&"hidden";let o;e[4]!==p?(o=z(p),e[4]=p,e[5]=o):o=e[5];let j;e[6]===Symbol.for("react.memo_cache_sentinel")?(j=a.jsx("div",{ref:$,className:"flex items-center gap-2 min-w-0"}),e[6]=j):j=e[6];let r;e[7]!==s?(r=a.jsxs(E.Header.Left,{children:[s,j]}),e[7]=s,e[8]=r):r=e[8];let y;e[9]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsxs(E.Header.Right,{children:[a.jsx("div",{ref:_,className:"flex items-center gap-2 overflow-x-auto min-w-0"}),a.jsx("div",{ref:k,className:"flex items-center gap-2 shrink-0"})]}),e[9]=y):y=e[9];let f;e[10]!==o||e[11]!==r?(f=a.jsxs(E.Header,{className:o,children:[r,y]}),e[10]=o,e[11]=r,e[12]=f):f=e[12];let m;e[13]!==l?(m=a.jsx(E.Content,{children:l}),e[13]=l,e[14]=m):m=e[14];let u;e[15]!==f||e[16]!==m?(u=a.jsxs(E,{children:[f,m]}),e[15]=f,e[16]=m,e[17]=u):u=e[17];let S;return e[18]!==w||e[19]!==u?(S=a.jsx(H,{value:w,children:u}),e[18]=w,e[19]=u,e[20]=S):S=e[20],S}export{F as V,B as a,q as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as X,r as m,a as z,t as P,b,j as e,c as B,B as Q,d as ie,S as W,N as oe,e as le}from"./index-BQhmgiEq.js";import{I}from"./input-DZxKc7J0.js";import{A as de}from"./auth-split-layout-DN4fv3Ih.js";function ce({redirectUrl:s,callbackUrl:n="/"}){const{emailAndPassword:d,resetPassword:u,emailOtp:i,socialProviders:l}=X(),[r,j]=m.useState(""),[y,D]=m.useState(""),[w,C]=m.useState(""),[A,O]=m.useState(""),[f,L]=m.useState(!1),[F,N]=m.useState(()=>i.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[c,S]=m.useState(""),[$,Y]=m.useState(!1),h=F==="signUp",p=F==="forgotPassword",x=F==="emailOtp",R=z({mutationFn:async({email:t,password:a,name:q})=>{try{if(h){const g=await b.signUp.email({email:t,password:a,name:q||""});if(g.error)throw new Error(g.error.message||"Sign up failed");return g}else{const g=await b.signIn.email({email:t,password:a});if(g.error)throw new Error(g.error.message||"Sign in failed");return g}}catch(g){throw g instanceof Error?g:new Error("Authentication failed")}},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=s??n},onError:t=>{P(h?"user_signup_failed":"user_signin_failed",{error:t instanceof Error?t.message:String(t)})}}),U=z({mutationFn:async({email:t})=>{const a=await b.requestPasswordReset({email:t,redirectTo:"/reset-password"});if(a.error)throw new Error(a.error.message||"Failed to send reset email");return a},onSuccess:()=>{P("password_reset_requested"),Y(!0)},onError:t=>{P("password_reset_request_failed",{error:t instanceof Error?t.message:String(t)})}}),E=z({mutationFn:async({email:t})=>{const a=await b.emailOtp.sendVerificationOtp({email:t,type:"sign-in"});if(a.error)throw new Error(a.error.message||"Failed to send code");return a},onSuccess:()=>{P("email_otp_sent"),L(!0)},onError:t=>{P("email_otp_send_failed",{error:t instanceof Error?t.message:String(t)})}}),_=z({mutationFn:async({email:t,otp:a})=>{const q=await b.signIn.emailOtp({email:t,otp:a});if(q.error)throw new Error(q.error.message||"Invalid code");return q},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=s??n},onError:t=>{P("email_otp_verify_failed",{error:t instanceof Error?t.message:String(t)})}}),T=t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t),V=()=>{r.trim()&&!T(r)&&S("Invalid email address")},Z=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}R.mutate({email:r,password:y,name:w})},ee=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}U.mutate({email:r})},te=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}E.mutate({email:r})},se=t=>{t.preventDefault(),_.mutate({email:r,otp:A})},k=t=>a=>{t(a.target.value),G&&R.reset(),H&&U.reset(),J&&(E.reset(),_.reset()),t===j&&c&&S("")},M=t=>{N(t),C(""),O(""),L(!1),S(""),Y(!1),R.reset(),U.reset(),E.reset(),_.reset()},o=R.isPending||U.isPending||E.isPending||_.isPending,G=R.error,H=U.error,J=E.error||_.error,v=h?r.trim()&&y.trim()&&w.trim():p?r.trim():x?f?A.trim():r.trim():r.trim()&&y.trim(),ne=t=>{if(!t)return null;const a=t.message.toLowerCase();return a.includes("unauthorized")||a.includes("401")?"Invalid email or password. Please try again.":a.includes("already exists")||a.includes("409")?"An account with this email already exists. Try signing in instead.":a.includes("network")||a.includes("fetch")?"Network error. Please check your connection and try again.":a.includes("rate limit")||a.includes("429")?"Too many attempts. Please wait a moment and try again.":a.includes("invalid")&&a.includes("otp")?"Invalid or expired code. Please try again.":t.message||"An error occurred. Please try again."},K=G||H||J,re=p?"Reset your password":x&&f?"Enter verification code":"Welcome to deco",ae=p?"We'll send you a reset link":x&&f?`Code sent to ${r}`:"Sign in or create a new account";return e.jsxs("div",{className:"w-full grid gap-10",children:[e.jsxs("div",{children:[e.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),e.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-2xl font-medium leading-8",children:re}),e.jsx("p",{className:"text-base text-muted-foreground leading-6",children:ae})]}),K&&e.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:ne(K)}),$&&e.jsx("div",{className:"rounded-xl bg-emerald-500/10 p-3 text-sm text-emerald-600 dark:text-emerald-400 text-center",children:"Check your email for a password reset link."}),!p&&!(x&&f)&&l.enabled&&e.jsx("div",{className:"grid gap-2",children:l.providers.map(t=>e.jsxs("button",{type:"button",disabled:o,onClick:()=>{b.signIn.social({provider:t.name,callbackURL:s??n})},className:"flex h-12 w-full items-center justify-center gap-3 rounded-xl bg-background dark:bg-input/30 px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 disabled:opacity-50 disabled:pointer-events-none",children:[t.icon&&e.jsx("img",{src:t.icon,alt:"",className:B("h-5 w-5",t.name==="github"&&"dark:invert"),"aria-hidden":"true"}),"Continue with"," ",t.name.charAt(0).toUpperCase()+t.name.slice(1)]},t.name))}),!p&&!(x&&f)&&l.enabled&&(d.enabled||i.enabled)&&e.jsxs("div",{className:"flex items-center gap-2.5 -my-4",children:[e.jsx("div",{className:"h-px flex-1 bg-border"}),e.jsx("span",{className:"text-base text-muted-foreground",children:"or"}),e.jsx("div",{className:"h-px flex-1 bg-border"})]}),x&&i.enabled&&e.jsx(e.Fragment,{children:f?e.jsxs("form",{onSubmit:se,className:"grid gap-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Verification code"}),e.jsx(I,{type:"text",placeholder:"Enter code",value:A,onChange:k(O),required:!0,disabled:o,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),e.jsx("button",{type:"submit",disabled:o||!v,className:"flex h-12 w-full items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:opacity-50 disabled:pointer-events-none",children:o?"Verifying...":"Verify"}),e.jsx("button",{type:"button",onClick:()=>{L(!1),O(""),E.reset(),_.reset()},disabled:o,className:"mt-1 text-sm text-muted-foreground hover:text-foreground transition-colors",children:"Use a different email"})]}):e.jsxs("form",{onSubmit:te,className:"grid gap-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Email"}),e.jsx(I,{type:"email",placeholder:"Email address",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive",children:c})]}),e.jsx("button",{type:"submit",disabled:o||!v,className:"flex h-12 w-full items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:opacity-50 disabled:pointer-events-none",children:o?"Sending...":"Send code"})]})}),p&&d.enabled&&!$&&e.jsxs("form",{onSubmit:ee,className:"grid gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsx(Q,{type:"submit",disabled:o||!v,className:"w-full font-semibold",size:"xl",children:o?"Sending...":"Send reset link"})]}),!p&&!x&&d.enabled&&e.jsxs("form",{onSubmit:Z,className:"grid gap-5",children:[h&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Name"}),e.jsx(I,{type:"text",placeholder:"Your name",value:w,onChange:k(C),required:!0,disabled:o,className:"h-11 rounded-lg"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"block text-sm font-medium text-foreground",children:"Password"}),!h&&u.enabled&&e.jsx("button",{type:"button",onClick:()=>M("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Forgot password?"})]}),e.jsx(I,{type:"password",placeholder:"••••••••",value:y,onChange:k(D),required:!0,disabled:o,className:"h-11 rounded-lg"})]}),e.jsx("div",{className:B("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",v?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsx("div",{className:B("p-1",!v&&"pointer-events-none"),children:e.jsx(Q,{type:"submit",disabled:o||!v,className:B("w-full font-semibold"),size:"xl","aria-hidden":!v,children:o?h?"Creating account...":"Signing in...":"Continue"})})})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:p?e.jsx("button",{type:"button",onClick:()=>M("signIn"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Back to sign in"}):x&&d.enabled?e.jsx("button",{type:"button",onClick:()=>M("signIn"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Sign in with password instead"}):!x&&d.enabled?e.jsxs(e.Fragment,{children:[h?"Already have an account? ":"Don't have an account? ",e.jsx("button",{type:"button",onClick:()=>M(h?"signIn":"signUp"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:h?"Sign in":"Sign up"}),i.enabled&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mx-2",children:"·"}),e.jsx("button",{type:"button",onClick:()=>M("emailOtp"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Sign in with email code"})]})]}):null})]})}function ue({redirectTo:s}){const[n,d]=m.useState(null);return m.useEffect(()=>{let u=!1;return(async()=>{try{let i;for(let l=0;l<5&&(i=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"}),!(i.ok||i.status<500));l++)await new Promise(r=>setTimeout(r,Math.min(1e3*2**l,1e4)));if(!i?.ok){const l=await i?.json().catch(()=>({}));throw new Error(l?.error||"Auto-login failed")}if(!u){const l=s.startsWith("/")&&!s.startsWith("//")?s:"/";window.location.href=l}}catch(i){u||d(i instanceof Error?i.message:"Auto-login failed")}})(),()=>{u=!0}},[s]),n?e.jsx("div",{className:"flex min-h-screen items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-destructive mb-2",children:["Auto-login failed: ",n]}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Try restarting the server."})]})}):e.jsx(W,{})}function me(s){if(!s.client_id||s.response_type!=="code")return null;const n=new URLSearchParams;return s.client_id&&n.set("client_id",s.client_id),s.redirect_uri&&n.set("redirect_uri",s.redirect_uri),s.response_type&&n.set("response_type",s.response_type),s.state&&n.set("state",s.state),s.scope&&n.set("scope",s.scope),s.code_challenge&&n.set("code_challenge",s.code_challenge),s.code_challenge_method&&n.set("code_challenge_method",s.code_challenge_method),`/api/auth/mcp/authorize?${n.toString()}`}function ge(s){const n=le.c(5),{callbackURL:d,providerId:u}=s;let i,l;n[0]!==d||n[1]!==u?(i=()=>{(async()=>await b.signIn.sso({providerId:u,callbackURL:d}))()},l=[u,d],n[0]=d,n[1]=u,n[2]=i,n[3]=l):(i=n[2],l=n[3]),m.useEffect(i,l);let r;return n[4]===Symbol.for("react.memo_cache_sentinel")?(r=e.jsx(W,{}),n[4]=r):r=n[4],r}function pe(){const s=b.useSession(),n=ie({from:"/login"}),{next:d="/",client_id:u,redirect_uri:i,response_type:l,state:r,scope:j,code_challenge:y,code_challenge_method:D}=n,w=d.startsWith("/")&&!d.startsWith("//")?d:"/",{sso:C,emailAndPassword:A,magicLink:O,emailOtp:f,socialProviders:L,localMode:F}=X(),N=me({client_id:u,redirect_uri:i,response_type:l,state:r,scope:j,code_challenge:y,code_challenge_method:D}),c=N||w;return s.data?N?(window.location.href=N,e.jsx(W,{})):e.jsx(oe,{to:w}):F?e.jsx(ue,{redirectTo:c}):C.enabled?e.jsx(ge,{callbackURL:c,providerId:C.providerId}):A.enabled||O.enabled||f.enabled||L.enabled?e.jsx(de,{children:e.jsx(ce,{redirectUrl:N,callbackUrl:w})}):e.jsx("div",{children:"No login options available"})}export{pe as default};
|
|
1
|
+
import{u as X,r as m,a as z,t as P,b,j as e,c as B,B as Q,d as ie,S as W,N as oe,e as le}from"./index-c9Pbt5D9.js";import{I}from"./input-BGaLq3ax.js";import{A as de}from"./auth-split-layout-DA4q8Bfk.js";function ce({redirectUrl:s,callbackUrl:n="/"}){const{emailAndPassword:d,resetPassword:u,emailOtp:i,socialProviders:l}=X(),[r,j]=m.useState(""),[y,D]=m.useState(""),[w,C]=m.useState(""),[A,O]=m.useState(""),[f,L]=m.useState(!1),[F,N]=m.useState(()=>i.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[c,S]=m.useState(""),[$,Y]=m.useState(!1),h=F==="signUp",p=F==="forgotPassword",x=F==="emailOtp",R=z({mutationFn:async({email:t,password:a,name:q})=>{try{if(h){const g=await b.signUp.email({email:t,password:a,name:q||""});if(g.error)throw new Error(g.error.message||"Sign up failed");return g}else{const g=await b.signIn.email({email:t,password:a});if(g.error)throw new Error(g.error.message||"Sign in failed");return g}}catch(g){throw g instanceof Error?g:new Error("Authentication failed")}},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=s??n},onError:t=>{P(h?"user_signup_failed":"user_signin_failed",{error:t instanceof Error?t.message:String(t)})}}),U=z({mutationFn:async({email:t})=>{const a=await b.requestPasswordReset({email:t,redirectTo:"/reset-password"});if(a.error)throw new Error(a.error.message||"Failed to send reset email");return a},onSuccess:()=>{P("password_reset_requested"),Y(!0)},onError:t=>{P("password_reset_request_failed",{error:t instanceof Error?t.message:String(t)})}}),E=z({mutationFn:async({email:t})=>{const a=await b.emailOtp.sendVerificationOtp({email:t,type:"sign-in"});if(a.error)throw new Error(a.error.message||"Failed to send code");return a},onSuccess:()=>{P("email_otp_sent"),L(!0)},onError:t=>{P("email_otp_send_failed",{error:t instanceof Error?t.message:String(t)})}}),_=z({mutationFn:async({email:t,otp:a})=>{const q=await b.signIn.emailOtp({email:t,otp:a});if(q.error)throw new Error(q.error.message||"Invalid code");return q},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=s??n},onError:t=>{P("email_otp_verify_failed",{error:t instanceof Error?t.message:String(t)})}}),T=t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t),V=()=>{r.trim()&&!T(r)&&S("Invalid email address")},Z=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}R.mutate({email:r,password:y,name:w})},ee=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}U.mutate({email:r})},te=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}E.mutate({email:r})},se=t=>{t.preventDefault(),_.mutate({email:r,otp:A})},k=t=>a=>{t(a.target.value),G&&R.reset(),H&&U.reset(),J&&(E.reset(),_.reset()),t===j&&c&&S("")},M=t=>{N(t),C(""),O(""),L(!1),S(""),Y(!1),R.reset(),U.reset(),E.reset(),_.reset()},o=R.isPending||U.isPending||E.isPending||_.isPending,G=R.error,H=U.error,J=E.error||_.error,v=h?r.trim()&&y.trim()&&w.trim():p?r.trim():x?f?A.trim():r.trim():r.trim()&&y.trim(),ne=t=>{if(!t)return null;const a=t.message.toLowerCase();return a.includes("unauthorized")||a.includes("401")?"Invalid email or password. Please try again.":a.includes("already exists")||a.includes("409")?"An account with this email already exists. Try signing in instead.":a.includes("network")||a.includes("fetch")?"Network error. Please check your connection and try again.":a.includes("rate limit")||a.includes("429")?"Too many attempts. Please wait a moment and try again.":a.includes("invalid")&&a.includes("otp")?"Invalid or expired code. Please try again.":t.message||"An error occurred. Please try again."},K=G||H||J,re=p?"Reset your password":x&&f?"Enter verification code":"Welcome to deco",ae=p?"We'll send you a reset link":x&&f?`Code sent to ${r}`:"Sign in or create a new account";return e.jsxs("div",{className:"w-full grid gap-10",children:[e.jsxs("div",{children:[e.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),e.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-2xl font-medium leading-8",children:re}),e.jsx("p",{className:"text-base text-muted-foreground leading-6",children:ae})]}),K&&e.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:ne(K)}),$&&e.jsx("div",{className:"rounded-xl bg-emerald-500/10 p-3 text-sm text-emerald-600 dark:text-emerald-400 text-center",children:"Check your email for a password reset link."}),!p&&!(x&&f)&&l.enabled&&e.jsx("div",{className:"grid gap-2",children:l.providers.map(t=>e.jsxs("button",{type:"button",disabled:o,onClick:()=>{b.signIn.social({provider:t.name,callbackURL:s??n})},className:"flex h-12 w-full items-center justify-center gap-3 rounded-xl bg-background dark:bg-input/30 px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 disabled:opacity-50 disabled:pointer-events-none",children:[t.icon&&e.jsx("img",{src:t.icon,alt:"",className:B("h-5 w-5",t.name==="github"&&"dark:invert"),"aria-hidden":"true"}),"Continue with"," ",t.name.charAt(0).toUpperCase()+t.name.slice(1)]},t.name))}),!p&&!(x&&f)&&l.enabled&&(d.enabled||i.enabled)&&e.jsxs("div",{className:"flex items-center gap-2.5 -my-4",children:[e.jsx("div",{className:"h-px flex-1 bg-border"}),e.jsx("span",{className:"text-base text-muted-foreground",children:"or"}),e.jsx("div",{className:"h-px flex-1 bg-border"})]}),x&&i.enabled&&e.jsx(e.Fragment,{children:f?e.jsxs("form",{onSubmit:se,className:"grid gap-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Verification code"}),e.jsx(I,{type:"text",placeholder:"Enter code",value:A,onChange:k(O),required:!0,disabled:o,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),e.jsx("button",{type:"submit",disabled:o||!v,className:"flex h-12 w-full items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:opacity-50 disabled:pointer-events-none",children:o?"Verifying...":"Verify"}),e.jsx("button",{type:"button",onClick:()=>{L(!1),O(""),E.reset(),_.reset()},disabled:o,className:"mt-1 text-sm text-muted-foreground hover:text-foreground transition-colors",children:"Use a different email"})]}):e.jsxs("form",{onSubmit:te,className:"grid gap-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Email"}),e.jsx(I,{type:"email",placeholder:"Email address",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive",children:c})]}),e.jsx("button",{type:"submit",disabled:o||!v,className:"flex h-12 w-full items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:opacity-50 disabled:pointer-events-none",children:o?"Sending...":"Send code"})]})}),p&&d.enabled&&!$&&e.jsxs("form",{onSubmit:ee,className:"grid gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsx(Q,{type:"submit",disabled:o||!v,className:"w-full font-semibold",size:"xl",children:o?"Sending...":"Send reset link"})]}),!p&&!x&&d.enabled&&e.jsxs("form",{onSubmit:Z,className:"grid gap-5",children:[h&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Name"}),e.jsx(I,{type:"text",placeholder:"Your name",value:w,onChange:k(C),required:!0,disabled:o,className:"h-11 rounded-lg"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"block text-sm font-medium text-foreground",children:"Password"}),!h&&u.enabled&&e.jsx("button",{type:"button",onClick:()=>M("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Forgot password?"})]}),e.jsx(I,{type:"password",placeholder:"••••••••",value:y,onChange:k(D),required:!0,disabled:o,className:"h-11 rounded-lg"})]}),e.jsx("div",{className:B("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",v?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsx("div",{className:B("p-1",!v&&"pointer-events-none"),children:e.jsx(Q,{type:"submit",disabled:o||!v,className:B("w-full font-semibold"),size:"xl","aria-hidden":!v,children:o?h?"Creating account...":"Signing in...":"Continue"})})})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:p?e.jsx("button",{type:"button",onClick:()=>M("signIn"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Back to sign in"}):x&&d.enabled?e.jsx("button",{type:"button",onClick:()=>M("signIn"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Sign in with password instead"}):!x&&d.enabled?e.jsxs(e.Fragment,{children:[h?"Already have an account? ":"Don't have an account? ",e.jsx("button",{type:"button",onClick:()=>M(h?"signIn":"signUp"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:h?"Sign in":"Sign up"}),i.enabled&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mx-2",children:"·"}),e.jsx("button",{type:"button",onClick:()=>M("emailOtp"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Sign in with email code"})]})]}):null})]})}function ue({redirectTo:s}){const[n,d]=m.useState(null);return m.useEffect(()=>{let u=!1;return(async()=>{try{let i;for(let l=0;l<5&&(i=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"}),!(i.ok||i.status<500));l++)await new Promise(r=>setTimeout(r,Math.min(1e3*2**l,1e4)));if(!i?.ok){const l=await i?.json().catch(()=>({}));throw new Error(l?.error||"Auto-login failed")}if(!u){const l=s.startsWith("/")&&!s.startsWith("//")?s:"/";window.location.href=l}}catch(i){u||d(i instanceof Error?i.message:"Auto-login failed")}})(),()=>{u=!0}},[s]),n?e.jsx("div",{className:"flex min-h-screen items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-destructive mb-2",children:["Auto-login failed: ",n]}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Try restarting the server."})]})}):e.jsx(W,{})}function me(s){if(!s.client_id||s.response_type!=="code")return null;const n=new URLSearchParams;return s.client_id&&n.set("client_id",s.client_id),s.redirect_uri&&n.set("redirect_uri",s.redirect_uri),s.response_type&&n.set("response_type",s.response_type),s.state&&n.set("state",s.state),s.scope&&n.set("scope",s.scope),s.code_challenge&&n.set("code_challenge",s.code_challenge),s.code_challenge_method&&n.set("code_challenge_method",s.code_challenge_method),`/api/auth/mcp/authorize?${n.toString()}`}function ge(s){const n=le.c(5),{callbackURL:d,providerId:u}=s;let i,l;n[0]!==d||n[1]!==u?(i=()=>{(async()=>await b.signIn.sso({providerId:u,callbackURL:d}))()},l=[u,d],n[0]=d,n[1]=u,n[2]=i,n[3]=l):(i=n[2],l=n[3]),m.useEffect(i,l);let r;return n[4]===Symbol.for("react.memo_cache_sentinel")?(r=e.jsx(W,{}),n[4]=r):r=n[4],r}function pe(){const s=b.useSession(),n=ie({from:"/login"}),{next:d="/",client_id:u,redirect_uri:i,response_type:l,state:r,scope:j,code_challenge:y,code_challenge_method:D}=n,w=d.startsWith("/")&&!d.startsWith("//")?d:"/",{sso:C,emailAndPassword:A,magicLink:O,emailOtp:f,socialProviders:L,localMode:F}=X(),N=me({client_id:u,redirect_uri:i,response_type:l,state:r,scope:j,code_challenge:y,code_challenge_method:D}),c=N||w;return s.data?N?(window.location.href=N,e.jsx(W,{})):e.jsx(oe,{to:w}):F?e.jsx(ue,{redirectTo:c}):C.enabled?e.jsx(ge,{callbackURL:c,providerId:C.providerId}):A.enabled||O.enabled||f.enabled||L.enabled?e.jsx(de,{children:e.jsx(ce,{redirectUrl:N,callbackUrl:w})}):e.jsx("div",{children:"No login options available"})}export{pe as default};
|