decocms 4.72.2 → 4.72.3
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-ByBCiqKB.js → AlertCircle-CX23NCuO.js} +1 -1
- package/dist/client/assets/{AreaChart-BI0I4Ppq.js → AreaChart-CRvFGO5O.js} +1 -1
- package/dist/client/assets/{ArrowUp-ByYzOCim.js → ArrowUp-ChoUWc1b.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-bzoxt9p8.js → ArrowUpRight-Bq-zX9ha.js} +1 -1
- package/dist/client/assets/{Check-HTVpA4p1.js → Check-BbAbdPfp.js} +1 -1
- package/dist/client/assets/{CheckCircle-DjPfWLKl.js → CheckCircle-Day5nLHt.js} +1 -1
- package/dist/client/assets/{ChevronDown-DP2FJuCW.js → ChevronDown-BsEi-r9q.js} +1 -1
- package/dist/client/assets/{ChevronRight-ZJK5BM1-.js → ChevronRight-B9mybD1s.js} +1 -1
- package/dist/client/assets/{ChevronUp-CgGHK9HJ.js → ChevronUp-BWoVqFrM.js} +1 -1
- package/dist/client/assets/{Circle-7izIVcsR.js → Circle-Bj_xS3WU.js} +1 -1
- package/dist/client/assets/{DotsVertical-C4Zezcv2.js → DotsVertical-BQRa2EB9.js} +1 -1
- package/dist/client/assets/{Eye-C1sMKajK.js → Eye-CyP9kYwn.js} +1 -1
- package/dist/client/assets/{FilterLines-3aw0CY5E.js → FilterLines-C5i4i3WB.js} +1 -1
- package/dist/client/assets/{Flag01-DcRM5q1C.js → Flag01-C7YxvVFh.js} +1 -1
- package/dist/client/assets/{Globe01-DT864WlC.js → Globe01-CC0A4U7g.js} +1 -1
- package/dist/client/assets/{Globe04-EItN49Uy.js → Globe04-BV89vsfi.js} +1 -1
- package/dist/client/assets/{HardDrive-D2GUS0Qz.js → HardDrive-CA9cG4ej.js} +1 -1
- package/dist/client/assets/{Key01-DK4hbjEO.js → Key01-Y2tTMtA8.js} +1 -1
- package/dist/client/assets/{LayoutLeft-C5txNoe8.js → LayoutLeft-C6uN3ryJ.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DeqEyWEm.js → LinkExternal01-CbW1jJhi.js} +1 -1
- package/dist/client/assets/{List-BdZn4mFB.js → List-MOccGrJp.js} +1 -1
- package/dist/client/assets/{Monitor01-K5RkPuES.js → Monitor01-DBUBWT-e.js} +1 -1
- package/dist/client/assets/{Package-XvqhUoDi.js → Package-BL3B6ONo.js} +1 -1
- package/dist/client/assets/{Palette-Td18xlyZ.js → Palette-B0oAitOJ.js} +1 -1
- package/dist/client/assets/{Play-BDn2qAlu.js → Play-zjQOd6w0.js} +1 -1
- package/dist/client/assets/{Plus-DqtLAmHa.js → Plus-DATZ4-ND.js} +1 -1
- package/dist/client/assets/{SearchLg-DxHDbs0K.js → SearchLg-B4W4xrFH.js} +1 -1
- package/dist/client/assets/{SearchMd-CdBgMmXA.js → SearchMd-CKL74aOj.js} +1 -1
- package/dist/client/assets/{Settings02-DEAh_DT6.js → Settings02-DAAnVZLO.js} +1 -1
- package/dist/client/assets/{Shield01-dj09LnbE.js → Shield01-IlYcL8Fi.js} +1 -1
- package/dist/client/assets/{Star01-DtKCKhjn.js → Star01-Bb61R21H.js} +1 -1
- package/dist/client/assets/{Stars01-B1VQUilg.js → Stars01-Bnuoinbt.js} +1 -1
- package/dist/client/assets/{Stars02-Co9H-HBz.js → Stars02-B9xmjTkg.js} +1 -1
- package/dist/client/assets/{Sun-QqDe-E1B.js → Sun-wOtTFTOd.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-C6m25wvW.js → SwitchHorizontal01-C90B2Auk.js} +1 -1
- package/dist/client/assets/{Tool01-BjTjc1wh.js → Tool01-BT4kICfE.js} +1 -1
- package/dist/client/assets/{Tool02-DEgRWOZe.js → Tool02-vM8N2pYB.js} +1 -1
- package/dist/client/assets/{Trash01-CgH2Xu1T.js → Trash01-CrwbV8c_.js} +1 -1
- package/dist/client/assets/{TrendUp01-zbSYjm9k.js → TrendUp01-CBDxjtVg.js} +1 -1
- package/dist/client/assets/{Upload01-CszhNxUd.js → Upload01-Lp0wJMYr.js} +1 -1
- package/dist/client/assets/{User01-C5unDYhX.js → User01-CQV6kRtR.js} +1 -1
- package/dist/client/assets/{UserPlus01-Cp0uzbD2.js → UserPlus01-13KHecKW.js} +1 -1
- package/dist/client/assets/{Users01-BcikhJfb.js → Users01-CDDfUziK.js} +1 -1
- package/dist/client/assets/{Users03-C-rX5qrp.js → Users03-ZlQye2vY.js} +1 -1
- package/dist/client/assets/{X-mDOEL8z7.js → X-CNdIeej8.js} +1 -1
- package/dist/client/assets/{XCircle-DolRLvoN.js → XCircle-C9sRiEE0.js} +1 -1
- package/dist/client/assets/{XClose-B_df4uSV.js → XClose-4pjmwtT4.js} +1 -1
- package/dist/client/assets/{Zap-BxqbSAmo.js → Zap-DHGChPV2.js} +1 -1
- package/dist/client/assets/{ZapSquare-opAhBrNo.js → ZapSquare-BV8kr37_.js} +1 -1
- package/dist/client/assets/{ZoomOut-BAgZXjYN.js → ZoomOut-7nLppLEs.js} +1 -1
- package/dist/client/assets/{access-gate-nYIMk1Ax.js → access-gate-BAwcBNbs.js} +1 -1
- package/dist/client/assets/{add-section-modal-D9KFl6cA.js → add-section-modal-lhtrhXMg.js} +1 -1
- package/dist/client/assets/{agent-icon-CyXwOhxa.js → agent-icon-DMtjBPX3.js} +1 -1
- package/dist/client/assets/{agents-list-DKESyf5R.js → agents-list-BUXICXib.js} +1 -1
- package/dist/client/assets/{ai-providers-BmW-h5_h.js → ai-providers-DCgzVaX6.js} +1 -1
- package/dist/client/assets/{alert-BE4pPomm.js → alert-BhYIEI2X.js} +1 -1
- package/dist/client/assets/{alert-dialog-EgP6niMw.js → alert-dialog-IVNf28U9.js} +1 -1
- package/dist/client/assets/{app-editor-DFp3TUDK.js → app-editor-D59Q_5eI.js} +1 -1
- package/dist/client/assets/{auth-xbCJi39A.js → auth-DIzgjm9h.js} +1 -1
- package/dist/client/assets/{auth-catchall-CqXIKcng.js → auth-catchall-CwgiOIdP.js} +1 -1
- package/dist/client/assets/{auth-entry-C5eWF52H.js → auth-entry-DhEOJXIL.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DEZlvBMh.js → auth-split-layout-B-Ji1dsx.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-BMNwMmAj.js → authenticate-and-persist-oauth-Bb5P11Gd.js} +1 -1
- package/dist/client/assets/{automation-list-row-CNPVJKDB.js → automation-list-row-BrrHJBg_.js} +1 -1
- package/dist/client/assets/{automation-runs-BrAZdZn6.js → automation-runs-_xFJy_Wv.js} +1 -1
- package/dist/client/assets/{automations-1sb-bW_9.js → automations-BaGIRfvu.js} +1 -1
- package/dist/client/assets/{autosend-CC491WEW.js → autosend-BX8nQnW3.js} +1 -1
- package/dist/client/assets/{avatar-CBSgn8Tn.js → avatar-CfHetrJ0.js} +1 -1
- package/dist/client/assets/{badge-Dgl1dSWq.js → badge-BR8ZoQPH.js} +1 -1
- package/dist/client/assets/{block-document-DZfn47Vv.js → block-document-BeMgCoP0.js} +1 -1
- package/dist/client/assets/{brand-context-BpIRAQfd.js → brand-context-Dfa00_kA.js} +1 -1
- package/dist/client/assets/{buckets-CYqr15Gu.js → buckets-BJ3UCF_c.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-DaGYJFZ2.js → bulk-category-panel-DYbnXnND.js} +1 -1
- package/dist/client/assets/{calendar-DtZ36eG9.js → calendar-D9BWcxij.js} +1 -1
- package/dist/client/assets/{capability-load-error-DKk21fnQ.js → capability-load-error-CWaH-_Bd.js} +1 -1
- package/dist/client/assets/{card-DgjJGkWr.js → card-1ZIM8JYb.js} +1 -1
- package/dist/client/assets/{category-editor-BIo2yBu8.js → category-editor-DzbcKPof.js} +1 -1
- package/dist/client/assets/{chat-context-BTyBzQFH.js → chat-context-BhPkOl45.js} +1 -1
- package/dist/client/assets/{checkbox-BJv9sq-q.js → checkbox-YuHG4ViR.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DGLXjlUv.js → cli-auth-success-CP82qKpR.js} +1 -1
- package/dist/client/assets/{collection-detail-CBwnVygA.js → collection-detail-DIz6zskG.js} +1 -1
- package/dist/client/assets/{collection-display-button-B58oGez4.js → collection-display-button-CbTgXJt9.js} +1 -1
- package/dist/client/assets/{collection-search-CTKwU4DT.js → collection-search-D4kzf4BZ.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-VYn6zPir.js → collection-table-wrapper-Cyqk04aC.js} +1 -1
- package/dist/client/assets/{collection-tabs-DM27wkZU.js → collection-tabs-CwblhJGY.js} +1 -1
- package/dist/client/assets/{command-CMaINJIs.js → command-DRUw9pTQ.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-DiMa4pyJ.js → commerce-onboarding-e-v-lCWx.js} +1 -1
- package/dist/client/assets/{companions-core-Bo-W_fm7.js → companions-core-CrqiPrVn.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-KqGLsruV.js → connect-desktop-dialog-BSEnA0YE.js} +1 -1
- package/dist/client/assets/{connection-card-p5woNpPL.js → connection-card-BddaDWk3.js} +1 -1
- package/dist/client/assets/{connection-detail-D6QXgBV2.js → connection-detail-B8oW9DNb.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BOaetESA.js → connection-form-helpers-B3t0vd0x.js} +1 -1
- package/dist/client/assets/{connections-B0RWhk8Q.js → connections-DXcLr2b7.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DQL401QF.js → decopilot-sse-pool-B1izZBf2.js} +1 -1
- package/dist/client/assets/{dialog-DPTAPgNV.js → dialog-DfnhzCwv.js} +1 -1
- package/dist/client/assets/{domain-settings-mCQtajjn.js → domain-settings-Dw-3NGKK.js} +1 -1
- package/dist/client/assets/{drawer-DeXSMxBA.js → drawer-Cu1H6Zpl.js} +1 -1
- package/dist/client/assets/{dropdown-menu-FPqLLz-n.js → dropdown-menu-BlorfjU6.js} +1 -1
- package/dist/client/assets/{empty-state-xWLZ2eZc.js → empty-state-D0Yjh42T.js} +1 -1
- package/dist/client/assets/{extract-connection-data-Dm0lbsif.js → extract-connection-data-DkYKg47U.js} +1 -1
- package/dist/client/assets/{file-explorer-IEntfMzq.js → file-explorer-C3OUWmFe.js} +1 -1
- package/dist/client/assets/{file-type-icon-BWa_J5_r.js → file-type-icon-CyQSc8WD.js} +1 -1
- package/dist/client/assets/{files-Dvdxw-C4.js → files-C98dPcEM.js} +1 -1
- package/dist/client/assets/{form-eZMSU-U6.js → form-ZPjO3One.js} +1 -1
- package/dist/client/assets/{general-BSQSVJFY.js → general-mC0-nMIz.js} +1 -1
- package/dist/client/assets/{github-repo-picker-BROJzTPQ.js → github-repo-picker-DneVvY3I.js} +1 -1
- package/dist/client/assets/{hooks-6uUQw8C_.js → hooks-DsQUp7L9.js} +1 -1
- package/dist/client/assets/{index-CoGxwL7l.js → index-1xWIMGUU.js} +1 -1
- package/dist/client/assets/{index-DeuS50TV.js → index-76rFpqug.js} +1 -1
- package/dist/client/assets/{index-B4zRpWC1.js → index-B8Idfh3P.js} +1 -1
- package/dist/client/assets/{index-BFFzCRS9.js → index-BHjtHKuw.js} +1 -1
- package/dist/client/assets/{index-DtqfR5Qd.js → index-BOaCGG-5.js} +1 -1
- package/dist/client/assets/{index-DvLE3v8k.js → index-BeTttHS9.js} +1 -1
- package/dist/client/assets/{index-C_UKaIla.js → index-ByObdePs.js} +1 -1
- package/dist/client/assets/{index-NdOF7DAS.js → index-C5JCmVQ0.js} +3 -3
- package/dist/client/assets/{index-BKPBegF_.js → index-CrWfdotU.js} +1 -1
- package/dist/client/assets/{index-Ddeo1WM2.js → index-CtT9oMhI.js} +1 -1
- package/dist/client/assets/{index-3B7w3S2F.js → index-D-JmKBPU.js} +2 -2
- package/dist/client/assets/{index-BnPMKhI3.js → index-DZp5yHGX.js} +1 -1
- package/dist/client/assets/{index-DHLmUnrM.js → index-PCoZIk-M.js} +27 -27
- package/dist/client/assets/{index-CZeTMF4a.js → index-emjsrsD0.js} +1 -1
- package/dist/client/assets/{index-redirect-BMCVjE9O.js → index-redirect-Dog_XssD.js} +1 -1
- package/dist/client/assets/{input-zBZ4DgDP.js → input-DWv95vY4.js} +1 -1
- package/dist/client/assets/{integration-icon-DykNdsSZ.js → integration-icon-D74EpYgv.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-Bdnif9D6.js → invite-member-dialog-DGmwAQAA.js} +1 -1
- package/dist/client/assets/{label-BEAS39uu.js → label-CjR-YPrA.js} +1 -1
- package/dist/client/assets/{layout-BF1SaClV.js → layout-BvMp9WH9.js} +1 -1
- package/dist/client/assets/{login-B7QToRsO.js → login-C4VBhHZf.js} +1 -1
- package/dist/client/assets/{mcp-oauth-C5mY9Wco.js → mcp-oauth-CDqgI2Xn.js} +1 -1
- package/dist/client/assets/{members-Wh0CTmSG.js → members-NXDCco5L.js} +1 -1
- package/dist/client/assets/{monaco-editor-CT21TZSl.js → monaco-editor-DYdw6m6P.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BOve2eh4.js → monitoring-stats-row-D0csDfCQ.js} +1 -1
- package/dist/client/assets/{oauth-callback-DyQyeQSC.js → oauth-callback-D-qdOpL-.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-hn0-CvkZ.js → oauth-callback-ai-provider-CKZ-Ikk0.js} +1 -1
- package/dist/client/assets/{onboarding-Dl0TNFA_.js → onboarding-0XZpcTRa.js} +1 -1
- package/dist/client/assets/{org-install-KB-RI8mO.js → org-install-BHAQ5v4F.js} +1 -1
- package/dist/client/assets/{org-layout-GoX_k2tJ.js → org-layout-x9tM7YJ0.js} +1 -1
- package/dist/client/assets/{organization-choice-CwNef7oe.js → organization-choice-CRDRv9IH.js} +1 -1
- package/dist/client/assets/{orgs-E9rlvbKV.js → orgs-B4dQ6uWB.js} +1 -1
- package/dist/client/assets/{page-seo-form-BZ3m9IIS.js → page-seo-form-BoV5cy5K.js} +1 -1
- package/dist/client/assets/page-seo-sheet-BgE0-fxQ.js +1 -0
- package/dist/client/assets/{popover-CW9y-q2H.js → popover-DL95paTt.js} +1 -1
- package/dist/client/assets/{post-editor-Doi2xnhC.js → post-editor-Byy_Ap7S.js} +1 -1
- package/dist/client/assets/{primitives-YSrEbm7N.js → primitives-CnjPXZBb.js} +1 -1
- package/dist/client/assets/{profile-ZLa_zj-v.js → profile-CCbdBUdo.js} +1 -1
- package/dist/client/assets/project-app-view-3TNqVL2p.js +1 -0
- package/dist/client/assets/record-editor-TOFRK4bb.js +1 -0
- package/dist/client/assets/redirect-editor-luJZRzL9.js +1 -0
- package/dist/client/assets/registry-B_upSRSY.js +2 -0
- package/dist/client/assets/{registry-layout-DF8wUvPw.js → registry-layout-C2G4koz9.js} +1 -1
- package/dist/client/assets/{reports-BnJeQ4g2.js → reports-CPxel0Tp.js} +1 -1
- package/dist/client/assets/{require-capability-C6GCyR0Q.js → require-capability-Coot4cTo.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DQknUSbe.js → required-auth-layout-BLRuxjNn.js} +1 -1
- package/dist/client/assets/{reset-password-BNvf6Xxy.js → reset-password-BHfCVVq_.js} +1 -1
- package/dist/client/assets/{roles-Bf184cYv.js → roles-Cbr82vAy.js} +1 -1
- package/dist/client/assets/{search-input-BUzTBcnJ.js → search-input-B9lRxCGI.js} +1 -1
- package/dist/client/assets/{secrets-Bvjy-FZU.js → secrets-C7tLxfHf.js} +1 -1
- package/dist/client/assets/{sections-editor-DGgqJ-J7.js → sections-editor-CEVFpdKw.js} +1 -1
- package/dist/client/assets/{select-sRWADeqn.js → select-D59HzWyb.js} +1 -1
- package/dist/client/assets/{select-model-Cz0bq4qm.js → select-model-D8LB7zlx.js} +1 -1
- package/dist/client/assets/{self-tool-result-Bfo9nOzY.js → self-tool-result-BPaV8G2-.js} +1 -1
- package/dist/client/assets/{seo-editor-DdM7NtNr.js → seo-editor-Dtca_H4G.js} +1 -1
- package/dist/client/assets/{settings-layout-B9Z77nEt.js → settings-layout-LbxIWaT0.js} +1 -1
- package/dist/client/assets/{settings-section-CQbeJndy.js → settings-section-CHSsdIIo.js} +1 -1
- package/dist/client/assets/{shell-controls-BO9-QP5U.js → shell-controls-C3TSKK-x.js} +1 -1
- package/dist/client/assets/{shell-layout-4MJ9_aLq.js → shell-layout-TAILJ-da.js} +1 -1
- package/dist/client/assets/{sidebar-B7kZ9zKG.js → sidebar-i7yNFNs9.js} +1 -1
- package/dist/client/assets/{skeleton-DSrLXHTO.js → skeleton-D824Y8b-.js} +1 -1
- package/dist/client/assets/{sso-B07-BWTN.js → sso-BzsdnWCZ.js} +1 -1
- package/dist/client/assets/{store-CQRHqjPq.js → store-BNZtOJXh.js} +1 -1
- package/dist/client/assets/store-registry-DzS8hV6Q.js +2 -0
- package/dist/client/assets/{studio-tools-B8sW30No.js → studio-tools--pllMpfK.js} +1 -1
- package/dist/client/assets/{switch-CppAT8uS.js → switch-DLw5svpB.js} +1 -1
- package/dist/client/assets/tab-id-BijBBRwE.js +1 -0
- package/dist/client/assets/{table-CW4fBcey.js → table-B8kPpHAC.js} +1 -1
- package/dist/client/assets/{tabs-DzYXYhGE.js → tabs-C19FaLXY.js} +1 -1
- package/dist/client/assets/{textarea-BexryihF.js → textarea-DGICe7Jx.js} +1 -1
- package/dist/client/assets/{toggle-group-BzvG2qVj.js → toggle-group-SYBG9bZR.js} +1 -1
- package/dist/client/assets/{toolbar-TUI1uFUV.js → toolbar-V6M48IQV.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-XX6J_GcF.js → toolbar-icon-button-DapYdi-A.js} +1 -1
- package/dist/client/assets/{tools-list-Bpsj2zsa.js → tools-list-CvZ2H4zV.js} +1 -1
- package/dist/client/assets/{tooltip-Dh0oD9Np.js → tooltip-DjWNMg5T.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BIjs_ekM.js → use-ai-providers-CQmOOELp.js} +1 -1
- package/dist/client/assets/{use-automations-o0ceSj23.js → use-automations-kY9mTa0N.js} +1 -1
- package/dist/client/assets/{use-autosave-UT9QD4Ig.js → use-autosave-DhXH8ptD.js} +1 -1
- package/dist/client/assets/{use-capability-r0dxMobw.js → use-capability-BtQYj-6N.js} +1 -1
- package/dist/client/assets/{use-clock-tick-DpgZSTVx.js → use-clock-tick-BNpEZMto.js} +1 -1
- package/dist/client/assets/{use-collections-fBsznfOB.js → use-collections-Kwxr6RPv.js} +1 -1
- package/dist/client/assets/{use-connection-BAT3TQ2g.js → use-connection-DhRKlWkl.js} +1 -1
- package/dist/client/assets/{use-copy-CtuAM4eT.js → use-copy-C62zVzDi.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DppQFiqo.js → use-create-virtual-mcp-B-2yNc1r.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BQjKkPcA.js → use-debounced-autosave-Cumlh74L.js} +1 -1
- package/dist/client/assets/{use-debounced-value-B6KZOzMt.js → use-debounced-value-DEfVi-aN.js} +1 -1
- package/dist/client/assets/{use-deco-credits-D8ipRh7Q.js → use-deco-credits-rxapxW2c.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-sKy4PGYV.js → use-decopilot-events-Cww7ZCTK.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BYjbULGM.js → use-delete-connection-DehUW7zF.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-E3V_03qw.js → use-deployment-admin-DI6Yo_2O.js} +1 -1
- package/dist/client/assets/{use-file-configs-BXTwEoph.js → use-file-configs-BaRnwcsF.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DUsa1aU8.js → use-infinite-scroll-WwPPe2Wp.js} +1 -1
- package/dist/client/assets/{use-join-requests-C4lgEBLL.js → use-join-requests-B29gIAVf.js} +1 -1
- package/dist/client/assets/{use-mcp-client-B7M85o8B.js → use-mcp-client-DlCO79GA.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-ZNBa1k65.js → use-mcp-tools-PUeX7iQD.js} +1 -1
- package/dist/client/assets/{use-members-D7cW9VTR.js → use-members-CP1GrgsV.js} +1 -1
- package/dist/client/assets/{use-mobile-CahDHUGA.js → use-mobile-vXwkCjTm.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-Dr4UXoYr.js → use-navigate-to-agent-DZwula5s.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DnwU6IUJ.js → use-org-auth-client-BeUafwOm.js} +1 -1
- package/dist/client/assets/{use-org-sso-CBi5gUYV.js → use-org-sso-CpksLDM-.js} +1 -1
- package/dist/client/assets/{use-organization-roles-CmudBkvB.js → use-organization-roles-BGu4f7lA.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CIZY8cRV.js → use-organization-settings-BFGZ9YuD.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CwKNMwm1.js → use-registry-connections-ml5ez91l.js} +1 -1
- package/dist/client/assets/{use-secrets-BPudMz_v.js → use-secrets-DXp4vVpG.js} +1 -1
- package/dist/client/assets/{use-status-sounds-BJrjgi4h.js → use-status-sounds-DUjqcw9j.js} +1 -1
- package/dist/client/assets/{use-view-mode-BEbVo7vR.js → use-view-mode-CJMBEHOJ.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DjphJcO_.js → use-virtual-mcp-KZlYJNMn.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-D-yVKxn2.js +1 -0
- package/dist/client/assets/{useRouterState-Cao37saq.js → useRouterState-ClIV-prS.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-QFUkmQtZ.js +1 -0
- package/dist/client/assets/{users-bGpaj6Ap.js → users-CliPNaM4.js} +1 -1
- package/dist/client/assets/{variant-calendar-Z1wPY-DB.js → variant-calendar-DsUFadYs.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-Uja7CKAQ.js → view-mode-toggle-BVGFEj0-.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/page-seo-sheet-CHH1sPKT.js +0 -1
- package/dist/client/assets/project-app-view-CVrygiTs.js +0 -1
- package/dist/client/assets/record-editor-_m2-vBlx.js +0 -1
- package/dist/client/assets/redirect-editor-CBXxSNbY.js +0 -1
- package/dist/client/assets/registry-DOgiK96v.js +0 -2
- package/dist/client/assets/store-registry-CY3beEqC.js +0 -2
- package/dist/client/assets/tab-id-bb-jjgGv.js +0 -1
- package/dist/client/assets/useInfiniteQuery-B5xx8bPh.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CwQHCH51.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{bi as f,bj as t,ae as R,I as l,c2 as z,H as s,af as y,ac as g,aW as b,b3 as H,bg as V,c3 as ve,c4 as xe,c5 as K,c6 as W,c7 as we,c8 as Ce,c9 as Z,ca as ke,cb as Pe,cc as qe,cd as Te,ce as Ie,cf as Ee,cg as Le,ch as ze,bu as Ae,ci as De,cj as Ue,ck as Ne,cl as $e,cm as Oe,cn as je,co as Be,bt as Fe,r as oe,c as J,j as w,cp as Ve,cq as We,p as Ke,l as se,bx as Ze}from"./index-
|
|
1
|
+
import{bi as f,bj as t,ae as R,I as l,c2 as z,H as s,af as y,ac as g,aW as b,b3 as H,bg as V,c3 as ve,c4 as xe,c5 as K,c6 as W,c7 as we,c8 as Ce,c9 as Z,ca as ke,cb as Pe,cc as qe,cd as Te,ce as Ie,cf as Ee,cg as Le,ch as ze,bu as Ae,ci as De,cj as Ue,ck as Ne,cl as $e,cm as Oe,cn as je,co as Be,bt as Fe,r as oe,c as J,j as w,cp as Ve,cq as We,p as Ke,l as se,bx as Ze}from"./index-C5JCmVQ0.js";import{P as Je}from"./use-mcp-client-DlCO79GA.js";const de=["default-src 'none'","script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'","style-src 'unsafe-inline'","img-src * data: blob:","media-src * data: blob:","font-src data:","connect-src 'none'","frame-src 'none'","worker-src blob:","form-action 'none'","base-uri 'none'"].join("; ");function Ye(r,e={}){const i=`<meta http-equiv="Content-Security-Policy" content="${Ge(e)}">`,n=/<head(\s[^>]*)?>|<HEAD(\s[^>]*)?>/i,c=r.match(n);if(c){const m=(c.index??0)+c[0].length;return r.slice(0,m)+`
|
|
2
2
|
`+i+r.slice(m)}const d=/<html(\s[^>]*)?>|<HTML(\s[^>]*)?>/i,u=r.match(d);if(u){const m=(u.index??0)+u[0].length;return r.slice(0,m)+`
|
|
3
3
|
<head>
|
|
4
4
|
`+i+`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as g,e as p,j as s,i as u,N as a}from"./index-
|
|
1
|
+
import{c as g,e as p,j as s,i as u,N as a}from"./index-C5JCmVQ0.js";import{a as x}from"./use-capability-BtQYj-6N.js";import{C as j}from"./capability-load-error-CWaH-_Bd.js";function v(){const t=g.c(21);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org"},t[0]=o):o=t[0];const{org:r}=p(o),{capabilities:l,isPrivileged:m,loading:c,error:f}=x();if(c){let e;return t[1]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:s.jsx(u,{size:20,className:"animate-spin text-muted-foreground"})}),t[1]=e):e=t[1],e}if(f){let e;return t[2]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(j,{}),t[2]=e):e=t[2],e}const i=e=>m||l[e]===!0;if(i("org:manage")){let e;return t[3]!==r?(e=s.jsx(a,{to:"/$org/settings/general",params:{org:r},replace:!0}),t[3]=r,t[4]=e):e=t[4],e}if(i("ai-providers:manage")){let e;return t[5]!==r?(e=s.jsx(a,{to:"/$org/settings/ai-providers",params:{org:r},replace:!0}),t[5]=r,t[6]=e):e=t[6],e}if(i("secrets:manage")){let e;return t[7]!==r?(e=s.jsx(a,{to:"/$org/settings/secrets",params:{org:r},replace:!0}),t[7]=r,t[8]=e):e=t[8],e}if(i("file-configs:manage")){let e;return t[9]!==r?(e=s.jsx(a,{to:"/$org/settings/buckets",params:{org:r},replace:!0}),t[9]=r,t[10]=e):e=t[10],e}if(i("automations:manage")){let e;return t[11]!==r?(e=s.jsx(a,{to:"/$org/settings/automations",params:{org:r},replace:!0}),t[11]=r,t[12]=e):e=t[12],e}if(i("registry:manage")){let e;return t[13]!==r?(e=s.jsx(a,{to:"/$org/settings/store",params:{org:r},replace:!0}),t[13]=r,t[14]=e):e=t[14],e}if(i("monitoring:view")){let e;return t[15]!==r?(e=s.jsx(a,{to:"/$org/settings/monitor",params:{org:r},replace:!0}),t[15]=r,t[16]=e):e=t[16],e}if(i("members:manage")){let e;return t[17]!==r?(e=s.jsx(a,{to:"/$org/settings/members",params:{org:r},replace:!0}),t[17]=r,t[18]=e):e=t[18],e}let n;return t[19]!==r?(n=s.jsx(a,{to:"/$org/settings/profile",params:{org:r},replace:!0}),t[19]=r,t[20]=n):n=t[20],n}export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as s,l as a,j as d}from"./index-
|
|
1
|
+
import{c as s,l as a,j as d}from"./index-C5JCmVQ0.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{c as k,j as h,r as C,l as L}from"./index-
|
|
1
|
+
import{c as k,j as h,r as C,l as L}from"./index-C5JCmVQ0.js";import{n as Z}from"./Tool02-vM8N2pYB.js";import{A as y}from"./agent-icon-DMtjBPX3.js";const M={"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"},R={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-9",md:"min-w-12",lg:"min-w-16",xl:"min-w-14"},T={"2xs":8,xs:12,sm:16,md:24,lg:32,xl:28},W={"2xs":"xs",xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"lg"};function G(E){const t=k.c(13),{icon:e,name:s,size:w,className:o,fallbackIcon:c,fit:g}=E,n=w===void 0?"md":w,I=g===void 0?"cover":g;if(e?.startsWith("icon://")||e?.includes("#agentcolor=")){const r=W[n];let l;return t[0]!==o||t[1]!==e||t[2]!==s||t[3]!==r?(l=h.jsx(y,{icon:e,name:s,size:r,className:o}),t[0]=o,t[1]=e,t[2]=s,t[3]=r,t[4]=l):l=t[4],l}const S=e??"no-icon";let i;return t[5]!==o||t[6]!==c||t[7]!==I||t[8]!==e||t[9]!==s||t[10]!==n||t[11]!==S?(i=h.jsx($,{icon:e,name:s,size:n,className:o,fallbackIcon:c,fit:I},S),t[5]=o,t[6]=c,t[7]=I,t[8]=e,t[9]=s,t[10]=n,t[11]=S,t[12]=i):i=t[12],i}function $(E){const t=k.c(25),{icon:e,name:s,size:w,className:o,fallbackIcon:c,fit:g}=E,n=w===void 0?"md":w,I=g===void 0?"cover":g,[S,i]=C.useState(!1),r=!!e&&S,l=M[n],p=R[n];let a;t[0]!==o||t[1]!==l||t[2]!==p?(a=L("rounded-lg border border-border shrink-0 overflow-hidden aspect-square bg-white",l,p,o),t[0]=o,t[1]=l,t[2]=p,t[3]=a):a=t[3];const N=e||void 0,_=I==="contain"?"object-contain":"object-cover",A=!r&&"hidden";let m;t[4]!==_||t[5]!==A?(m=L("h-full w-full",_,A),t[4]=_,t[5]=A,t[6]=m):m=t[6];let v,j;t[7]===Symbol.for("react.memo_cache_sentinel")?(v=()=>i(!1),j=()=>i(!0),t[7]=v,t[8]=j):(v=t[7],j=t[8]);let d;t[9]!==s||t[10]!==N||t[11]!==m?(d=h.jsx("img",{src:N,alt:s,className:m,onError:v,onLoad:j}),t[9]=s,t[10]=N,t[11]=m,t[12]=d):d=t[12];const z=r&&"hidden";let f;t[13]!==z?(f=L("h-full w-full flex items-center justify-center bg-muted/20",z),t[13]=z,t[14]=f):f=t[14];let x;t[15]!==c||t[16]!==n?(x=c??h.jsx(Z,{size:T[n],className:"text-muted-foreground"}),t[15]=c,t[16]=n,t[17]=x):x=t[17];let u;t[18]!==f||t[19]!==x?(u=h.jsx("div",{className:f,children:x}),t[18]=f,t[19]=x,t[20]=u):u=t[20];let b;return t[21]!==d||t[22]!==u||t[23]!==a?(b=h.jsxs("div",{className:a,children:[d,u]}),t[21]=d,t[22]=u,t[23]=a,t[24]=b):b=t[24],b}export{G as I};
|
package/dist/client/assets/{invite-member-dialog-Bdnif9D6.js → invite-member-dialog-DGmwAQAA.js}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{I as M,r as N,C as R,n as L,a as V,M as B,d as K,p,t as c,K as j,j as s,B as C}from"./index-
|
|
1
|
+
import{I as M,r as N,C as R,n as L,a as V,M as B,d as K,p,t as c,K as j,j as s,B as C}from"./index-C5JCmVQ0.js";import{e as O,b as q,d as z,D as Q,a as k,c as H}from"./dialog-DfnhzCwv.js";import{a as U,F as b,b as v,c as Y,d as w,f as S}from"./form-ZPjO3One.js";import{S as G,a as J,b as W,c as X,d as Z}from"./select-D59HzWyb.js";import{T as _}from"./textarea-DGICe7Jx.js";import{u as ee}from"./use-org-auth-client-BeUafwOm.js";import{u as se}from"./use-organization-roles-BGu4f7lA.js";const te=M().email("Invalid email address");function ne(r){if(!r.trim())return[];const m=r.split(/[,;\n]/).map(a=>a.trim().toLowerCase()).filter(a=>a.length>0);return Array.from(new Set(m))}function de({trigger:r}){const[m,a]=N.useState(!1),{locator:g}=R(),E=ee(),x=L(),{data:F}=V.useSession(),f=F?.user?.email,{roles:P,isLoading:y}=se(),T=P.filter(t=>t.role!=="owner"),i=B({mode:"onChange",defaultValues:{emailsText:"",role:"user"}}),$=i.watch("emailsText"),I=i.watch("role"),l=ne($).filter(t=>{const e=te.safeParse(t).success,n=!f||t!==f.toLowerCase();return e&&n}),o=K({mutationFn:async({emails:t,role:e})=>{if(!e)throw new Error("Please select a role");const n=await Promise.allSettled(t.map(async d=>{const h=await E.organization.inviteMember({email:d,role:e});if(h.error)throw new Error(h.error.message);return h.data})),u=n.filter(d=>d.status==="rejected");if(u.length>0)throw new Error(`Failed to invite ${u.length} member${u.length>1?"s":""}`);return n},onSuccess:(t,{emails:e,role:n})=>{p("member_invited",{count:e.length,role:n}),x.invalidateQueries({queryKey:j.members(g)}),x.invalidateQueries({queryKey:j.invitations(g)}),c.success(e.length===1?"Member invited successfully!":`${e.length} members invited successfully!`),i.reset({emailsText:"",role:"user"}),a(!1)},onError:(t,{emails:e,role:n})=>{p("member_invite_failed",{count:e.length,role:n,error:t instanceof Error?t.message:String(t)}),c.error(t instanceof Error?t.message:"Failed to invite members")}}),A=t=>{if(l.length===0){c.error("Please enter at least one valid email address");return}if(!t.role){c.error("Please select a role");return}o.mutate({emails:l,role:t.role})},D=l.length>0&&!!I;return s.jsxs(O,{open:m,onOpenChange:a,children:[s.jsx(q,{asChild:!0,children:r}),s.jsxs(z,{className:"sm:max-w-lg",children:[s.jsx(Q,{children:s.jsx(k,{children:"Invite members"})}),s.jsx(U,{...i,children:s.jsxs("form",{onSubmit:i.handleSubmit(A),className:"space-y-4",children:[s.jsx(b,{control:i.control,name:"emailsText",render:({field:t})=>s.jsxs(v,{children:[s.jsx(Y,{children:"Email addresses"}),s.jsx(w,{children:s.jsx(_,{...t,disabled:o.isPending,placeholder:`Enter email addresses separated by commas or new lines
|
|
2
2
|
e.g. user1@example.com, user2@example.com
|
|
3
3
|
or one per line`,className:"min-h-[120px] resize-none"})}),s.jsx(S,{})]})}),s.jsx(b,{control:i.control,name:"role",render:({field:t})=>s.jsxs(v,{children:[s.jsx(w,{children:s.jsxs(G,{value:t.value,onValueChange:t.onChange,disabled:o.isPending||y,children:[s.jsx(J,{className:"w-full",children:s.jsx(W,{placeholder:"Select a role"})}),s.jsx(X,{children:T.map(e=>{const n=[];return e.isBuiltin||(e.allowsAllStaticPermissions?n.push("Full org access"):e.staticPermissionCount&&e.staticPermissionCount>0&&n.push(`${e.staticPermissionCount} org perm${e.staticPermissionCount!==1?"s":""}`),e.allowsAllConnections?n.push("All connections"):e.connectionCount&&e.connectionCount>0&&n.push(`${e.connectionCount} connection${e.connectionCount!==1?"s":""}`),(e.connectionCount!==0||e.allowsAllConnections)&&(e.allowsAllTools?n.push("all tools"):e.toolCount&&e.toolCount>0&&n.push(`${e.toolCount} tool${e.toolCount!==1?"s":""}`))),s.jsx(Z,{value:e.role,children:s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{children:e.label}),!e.isBuiltin&&n.length>0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:n.join(", ")})]})},e.role)})})]})}),s.jsx(S,{})]})}),s.jsxs(H,{children:[s.jsx(C,{variant:"outline",onClick:()=>{i.reset({emailsText:"",role:"user"}),a(!1)},type:"button",disabled:o.isPending,children:"Cancel"}),s.jsx(C,{type:"submit",disabled:o.isPending||!D,children:o.isPending?"Inviting...":`Invite ${l.length||0} Member${l.length!==1?"s":""}`})]})]})})]})]})}export{de as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n,l as r,j as i,bG as p}from"./index-
|
|
1
|
+
import{c as n,l as r,j as i,bG as p}from"./index-C5JCmVQ0.js";function c(o){const e=n.c(8);let t,s;e[0]!==o?({className:t,...s}=o,e[0]=o,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 l;return e[5]!==s||e[6]!==a?(l=i.jsx(p,{"data-slot":"label",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}export{c as L};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as d,j as t,i as u,B as h,L as f,k as x,O as p,l as b}from"./index-
|
|
1
|
+
import{c as d,j as t,i as u,B as h,L as f,k as x,O as p,l as b}from"./index-C5JCmVQ0.js";import{u as j}from"./useRouterState-ClIV-prS.js";import{R as _}from"./required-auth-layout-BLRuxjNn.js";import{u as y}from"./use-deployment-admin-DI6Yo_2O.js";const g=[{to:"/_admin/users",label:"Users"},{to:"/_admin/orgs",label:"Organizations"}];function v(){const e=d.c(5);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={select:N},e[0]=s):s=e[0];const a=j(s);let n;e[1]!==a?(n=g.map(r=>t.jsx(f,{to:r.to,className:b("-mb-px border-b-2 px-3 py-2.5 text-sm font-medium transition-colors",a.startsWith(r.to)?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:r.label},r.to)),e[1]=a,e[2]=n):n=e[2];let o;return e[3]!==n?(o=t.jsx("nav",{className:"flex items-center gap-1 border-b border-border px-4 md:px-10",children:n}),e[3]=n,e[4]=o):o=e[4],o}function N(e){return e.location.pathname}function S(){const e=d.c(7),{isAdmin:s,loading:a,needsEmailVerification:n}=y();if(a){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"flex h-dvh flex-1 items-center justify-center",children:t.jsx(u,{size:20,className:"animate-spin text-muted-foreground"})}),e[0]=i):i=e[0],i}if(!s){const i=n?"Verify your email address to access the admin dashboard.":"This dashboard is restricted to deployment admins.";let m;e[1]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(h,{variant:"outline",size:"sm",asChild:!0,children:t.jsx(f,{to:"/",children:"Go home"})}),e[1]=m):m=e[1];let c;return e[2]!==i?(c=t.jsx(x,{area:"the admin dashboard",description:i,action:m}),e[2]=i,e[3]=c):c=e[3],c}let o,r;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"shrink-0 px-4 pt-6 md:px-10",children:t.jsx("h1",{className:"pb-4 text-xl font-medium",children:"Admin Dashboard"})}),r=t.jsx(v,{}),e[4]=o,e[5]=r):(o=e[4],r=e[5]);let l;return e[6]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsxs("div",{className:"flex h-dvh flex-col overflow-hidden bg-background",children:[o,r,t.jsx("div",{className:"flex-1 overflow-hidden",children:t.jsx(p,{})})]}),e[6]=l):l=e[6],l}function z(){const e=d.c(1);let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(_,{children:t.jsx(S,{})}),e[0]=s):s=e[0],s}export{z as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,u as f,j as o,S as g,N as p}from"./index-
|
|
1
|
+
import{a,u as f,j as o,S as g,N as p}from"./index-C5JCmVQ0.js";import{A as x}from"./auth-entry-DhEOJXIL.js";import{A as S}from"./auth-split-layout-B-Ji1dsx.js";import"./input-DWv95vY4.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";function y(e){if(!e.client_id||e.response_type!=="code")return null;const t=new URLSearchParams;return e.client_id&&t.set("client_id",e.client_id),e.redirect_uri&&t.set("redirect_uri",e.redirect_uri),e.response_type&&t.set("response_type",e.response_type),e.state&&t.set("state",e.state),e.scope&&t.set("scope",e.scope),e.code_challenge&&t.set("code_challenge",e.code_challenge),e.code_challenge_method&&t.set("code_challenge_method",e.code_challenge_method),`/api/auth/mcp/authorize?${t.toString()}`}function L(){const e=a.useSession(),t=f({from:"/login"}),{next:i="/",client_id:r,redirect_uri:s,response_type:l,state:h,scope:u,code_challenge:d,code_challenge_method:_}=t,n=i.startsWith("/")&&!i.startsWith("//")?i:"/",c=y({client_id:r,redirect_uri:s,response_type:l,state:h,scope:u,code_challenge:d,code_challenge_method:_});return e.data?c?(window.location.href=c,o.jsx(g,{})):o.jsx(p,{to:n}):o.jsx(S,{children:o.jsx(x,{callbackUrl:n,redirectUrl:c})})}export{L as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as x,b as N,c as z,a as D}from"./auth-
|
|
1
|
+
import{d as x,b as N,c as z,a as D}from"./auth-DIzgjm9h.js";function E(t){let e=0;for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return Math.abs(e).toString(16)}function H(){return window.location.origin}function C(){try{const t=window.location.hostname;return t==="localhost"||t.endsWith(".localhost")||t==="127.0.0.1"||t==="::1"}catch{return!1}}const M=new Map,R="mcp:oauth:callback:";class W{serverUrl;_clientMetadata;_redirectUrl;_windowMode;_state=null;_codeVerifier=null;_clientInfo=null;_tokens=null;constructor(e){this.serverUrl=e.serverUrl,this._redirectUrl=e.callbackUrl??`${H()}/oauth/callback`,this._windowMode=e.windowMode??"popup";const n=e.scope?Array.isArray(e.scope)?e.scope.join(" "):e.scope:void 0;this._clientMetadata={redirect_uris:[this._redirectUrl],token_endpoint_auth_method:"none",grant_types:["authorization_code","refresh_token"],response_types:["code"],client_name:e.clientName??"@decocms/mesh MCP client",...n&&{scope:n}},M.set(E(this.serverUrl),this)}get redirectUrl(){return this._redirectUrl}get clientMetadata(){return this._clientMetadata}state(){return this._state||(this._state=crypto.randomUUID()),this._state}getStoredState(){return this._state}clientInformation(){return this._clientInfo??void 0}saveClientInformation(e){this._clientInfo=e}tokens(){return this._tokens??void 0}saveTokens(e){this._tokens=e}redirectToAuthorization(e){if(this._windowMode==="tab"){if(!window.open(e.toString(),"_blank"))throw new Error("Tab was blocked")}else{const o=window.screenX+(window.outerWidth-600)/2,s=window.screenY+(window.outerHeight-700)/2;if(!window.open(e.toString(),"mcp-oauth",`width=600,height=700,left=${o},top=${s},popup=yes`)&&!window.open(e.toString(),"_blank"))throw new Error("Popup was blocked")}}saveCodeVerifier(e){this._codeVerifier=e}codeVerifier(){if(!this._codeVerifier)throw new Error("Code verifier not found");return this._codeVerifier}invalidateCredentials(){this._clientInfo=null,this._tokens=null,this._codeVerifier=null,this._state=null}getServerUrl(){return this.serverUrl}cleanup(){M.delete(E(this.serverUrl))}}async function G(t){const e=t.meshUrl??window.location.origin,n=t.orgSlug?`/api/${encodeURIComponent(t.orgSlug)}/mcp/${t.connectionId}`:`/mcp/${t.connectionId}`,r=new URL(n,e),o=new W({serverUrl:r.href,clientName:t.clientName,clientUri:t.clientUri,callbackUrl:t.callbackUrl,scope:t.scope,windowMode:t.windowMode}),s={fn:null};try{const i=new Promise((l,d)=>{const k=t.timeout||12e4;let b,p=!1;const L=o.state(),A=`${R}${L}`,h=()=>{window.removeEventListener("message",v),window.removeEventListener("storage",O),clearTimeout(b);try{localStorage.removeItem(A)}catch{}};s.fn=u=>{p||(p=!0,h(),d(u))};const U=async u=>{if(p)return;if(p=!0,!u.success){h(),d(new Error(u.error||"OAuth authentication failed"));return}const{code:m,state:$}=u;if(!m){h(),d(new Error("Missing authorization code"));return}if(o.getStoredState()!==$){h(),d(new Error("OAuth state mismatch - possible CSRF attack"));return}try{const T=(await x(r))?.authorization_servers?.[0]||r,S=await N(T),g=o.clientInformation();if(!g){h(),d(new Error("Client information not found"));return}const P=o.codeVerifier(),V=await z(T,{metadata:S,clientInformation:g,authorizationCode:m,codeVerifier:P,redirectUri:o.redirectUrl,resource:new URL(r)});h(),l({tokens:V,clientId:g.client_id??null,clientSecret:"client_secret"in g?g.client_secret:null,tokenEndpoint:S?.token_endpoint??null,userinfoEndpoint:S?.userinfo_endpoint??null})}catch(I){h(),d(I)}},v=async u=>{!C()&&u.origin!==window.location.origin||u.data?.type==="mcp:oauth:callback"&&await U(u.data)},O=async u=>{if(!(u.key!==A||!u.newValue))try{const m=JSON.parse(u.newValue);await U(m)}catch{}};window.addEventListener("message",v),window.addEventListener("storage",O),b=setTimeout(()=>{p||(p=!0,h(),d(new Error("OAuth authentication timeout")))},k)});if(i.catch(()=>{}),await D(o,{serverUrl:r})==="REDIRECT"){const l=await i,d=l.tokens;return{token:l.tokens.access_token,tokenInfo:{accessToken:l.tokens.access_token,refreshToken:l.tokens.refresh_token??null,expiresIn:l.tokens.expires_in??null,scope:l.tokens.scope??null,clientId:l.clientId,clientSecret:l.clientSecret,tokenEndpoint:l.tokenEndpoint,userinfoEndpoint:l.userinfoEndpoint,idToken:typeof d.id_token=="string"?d.id_token:null},error:null}}const a=o.tokens(),w=o.clientInformation(),f=a;return{token:a?.access_token||null,tokenInfo:a?{accessToken:a.access_token,refreshToken:a.refresh_token??null,expiresIn:a.expires_in??null,scope:a.scope??null,clientId:w?.client_id??null,clientSecret:w&&"client_secret"in w?w.client_secret:null,tokenEndpoint:null,userinfoEndpoint:null,idToken:f&&typeof f.id_token=="string"?f.id_token:null}:null,error:null}}catch(i){return s.fn&&s.fn(i instanceof Error?i:new Error(String(i))),{token:null,tokenInfo:null,error:i instanceof Error?i.message:String(i)}}finally{o.cleanup()}}function y(t,e){if(window.opener&&!window.opener.closed){const n=C()?"*":window.location.origin;return window.opener.postMessage(t,n),!0}if(e)try{const n=`${R}${e}`;return localStorage.setItem(n,JSON.stringify(t)),!0}catch{}return!1}async function X(){const t=new URLSearchParams(window.location.search),e=t.get("code");let n=t.get("state");const r=t.get("error"),o=t.get("error_description");let s=n;if(n)try{const c=atob(n),a=JSON.parse(c);a.clientState&&(s=a.clientState)}catch{}if(r){const c=o||r;return y({type:"mcp:oauth:callback",success:!1,error:c},s),{success:!1,error:c}}if(!e||!n){const c="Missing code or state parameter";return y({type:"mcp:oauth:callback",success:!1,error:c},s),{success:!1,error:c}}return n=s||n,y({type:"mcp:oauth:callback",success:!0,code:e,state:n},n)?{success:!0}:{success:!1,error:"Parent window not available"}}function _(){if(typeof window<"u"&&window.location?.origin)return window.location.origin}function j(t){try{const e=_(),n=e?new URL(t,e):new URL(t),r=n.pathname.match(/^\/api\/[^/]+\/mcp\/([^/]+)/);return r?r[1]??null:n.pathname.match(/^\/mcp\/([^/]+)/)?.[1]??null}catch{return null}}function J(t){try{const e=_();return(e?new URL(t,e):new URL(t)).pathname.match(/^\/api\/([^/]+)\/mcp\//)?.[1]??null}catch{return null}}async function K(t,e,n){try{const r=`/api/${encodeURIComponent(e)}/connections/${t}/oauth-token/status`,o=n?new URL(r,n).href:r,s=_(),i=!n||new URL(n).origin===s,c=await fetch(o,{credentials:i?"include":"omit"});return c.ok?{hasToken:(await c.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}}async function q({url:t,token:e,orgId:n,meshUrl:r}){try{const o=new Headers;o.set("Content-Type","application/json"),o.set("Accept","application/json, text/event-stream");const s=await fetch(t,{method:"POST",headers:o,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"@decocms/mesh MCP client",version:"1.0.0"}}})}),i=j(t),c=J(t),a=_(),w=r??(a?new URL(t,a).origin:new URL(t).origin);if(s.ok)return{isAuthenticated:!0,supportsOAuth:!1,hasOAuthToken:(i&&c?await K(i,c,w):{hasToken:!1}).hasToken};let f;try{const k=await s.json();f=k.error||k.message}catch{}return s.status>=500?{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:f||`HTTP ${s.status}`,isServerError:!0}:{isAuthenticated:!1,supportsOAuth:!!s.headers.get("WWW-Authenticate"),hasOAuthToken:!1,error:f||`HTTP ${s.status}`}}catch(o){return console.error("[isConnectionAuthenticated] Error:",o),{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:o.message}}}export{G as a,X as h,q as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as U,j as s,B as ze,C as pe,v as Mt,n as Qe,d as Me,K as ce,t as oe,m as Ct,r as re,l as ke,i as Xe,E as Rt,p as Re}from"./index-NdOF7DAS.js";import{C as zt}from"./collection-display-button-B58oGez4.js";import{S as Pt}from"./search-input-BUzTBcnJ.js";import{P as Ae}from"./index-CoGxwL7l.js";import{C as Et}from"./collection-table-wrapper-VYn6zPir.js";import{E as We}from"./empty-state-xWLZ2eZc.js";import{I as kt}from"./invite-member-dialog-Bdnif9D6.js";import{b as Dt,S as $t,a as Ot}from"./settings-section-CQbeJndy.js";import{u as qt,a as Lt}from"./use-join-requests-C4lgEBLL.js";import{A as De}from"./avatar-CBSgn8Tn.js";import{f as Ft}from"./format-time-BnbuEtat.js";import{g as Ve}from"./get-initials-D-f_fDFw.js";import{u as Bt}from"./use-members-D7cW9VTR.js";import{u as $e}from"./studio-tools-B8sW30No.js";import{u as yt}from"./use-org-auth-client-DnwU6IUJ.js";import{u as Kt}from"./use-organization-roles-CmudBkvB.js";import{T as Vt,a as Qt,c as Gt,b as Ut}from"./tooltip-Dh0oD9Np.js";import{a as st,e as nt,g as it,b as at,c as lt,d as ot,A as rt,f as ct}from"./alert-dialog-EgP6niMw.js";import{B as Ge}from"./badge-Dgl1dSWq.js";import{C as mt}from"./card-DgjJGkWr.js";import{D as St,a as Nt,c as wt,e as Jt,f as Ht,g as Wt,d as et,j as Yt}from"./dropdown-menu-FPqLLz-n.js";import{i as _t}from"./DotsVertical-C4Zezcv2.js";import{i as Zt}from"./Key01-DK4hbjEO.js";import{i as Xt}from"./Shield01-dj09LnbE.js";import{a as es}from"./SwitchHorizontal01-C6m25wvW.js";import{s as ts}from"./Trash01-CgH2Xu1T.js";import{s as Tt}from"./XClose-B_df4uSV.js";import{b as dt,a as ut,d as ft,c as pt,S as ht}from"./select-sRWADeqn.js";import{C as gt}from"./checkbox-BJv9sq-q.js";import{e as Ye,a as Ze,f as xt,C as ss,c as ns,d as is,b as as}from"./command-CMaINJIs.js";import{a as ls,b as os,P as rs}from"./popover-CW9y-q2H.js";import{t as cs}from"./ChevronDown-DP2FJuCW.js";import{s as ms}from"./Plus-DqtLAmHa.js";import{R as ds}from"./require-capability-C6GCyR0Q.js";import"./ArrowUp-ByYzOCim.js";import"./Check-HTVpA4p1.js";import"./List-BdZn4mFB.js";import"./view-mode-toggle-Uja7CKAQ.js";import"./SearchMd-CdBgMmXA.js";import"./sidebar-B7kZ9zKG.js";import"./LayoutLeft-C5txNoe8.js";import"./use-mobile-CahDHUGA.js";import"./X-mDOEL8z7.js";import"./table-CW4fBcey.js";import"./dialog-DPTAPgNV.js";import"./form-eZMSU-U6.js";import"./label-BEAS39uu.js";import"./textarea-BexryihF.js";import"./ArrowUpRight-bzoxt9p8.js";import"./use-capability-r0dxMobw.js";import"./User01-C5unDYhX.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./ChevronRight-ZJK5BM1-.js";import"./Circle-7izIVcsR.js";import"./ChevronUp-CgGHK9HJ.js";import"./index-DtqfR5Qd.js";import"./access-gate-nYIMk1Ax.js";import"./capability-load-error-DKk21fnQ.js";function us(){const t=U.c(9),e=qt(),{approve:n,deny:l}=Lt();if(e.length===0)return null;let i;if(t[0]!==n||t[1]!==l||t[2]!==e){let o;t[4]!==n||t[5]!==l?(o=r=>s.jsx(Dt,{icon:s.jsx(De,{url:r.user?.image??void 0,fallback:(r.user?.name??r.user?.email??"?").charAt(0).toUpperCase(),shape:"circle",size:"sm"}),title:r.user?.name??r.user?.email??r.userId,description:r.user?.email,action:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ze,{size:"sm",variant:"outline",onClick:()=>l.mutate(r.id),disabled:l.isPending||n.isPending,children:"Deny"}),s.jsx(ze,{size:"sm",onClick:()=>n.mutate(r.id),disabled:n.isPending||l.isPending,children:"Approve"})]})},r.id),t[4]=n,t[5]=l,t[6]=o):o=t[6],i=e.map(o),t[0]=n,t[1]=l,t[2]=e,t[3]=i}else i=t[3];let a;return t[7]!==i?(a=s.jsx($t,{title:"Join requests",description:"People who requested to join via a domain in approval mode.",children:s.jsx(Ot,{children:i})}),t[7]=i,t[8]=a):a=t[8],a}function fs(){const t=U.c(7),{locator:e}=pe(),n=$e();let l;t[0]!==e?(l=ce.invitations(e),t[0]=e,t[1]=l):l=t[1];let i;t[2]!==n?(i=async()=>(await n.call("ORGANIZATION_GET",{}))?.invitations??[],t[2]=n,t[3]=i):i=t[3];let a;return t[4]!==l||t[5]!==i?(a={queryKey:l,queryFn:i},t[4]=l,t[5]=i,t[6]=a):a=t[6],Mt(a)}function ps(){const t=U.c(10),{locator:e}=pe(),n=yt(),l=Qe();let i;t[0]!==n?(i=async f=>{const g=await n.organization.cancelInvitation({invitationId:f});if(g?.error)throw new Error(g.error.message);return g.data},t[0]=n,t[1]=i):i=t[1];let a;t[2]!==e||t[3]!==l?(a=()=>{l.invalidateQueries({queryKey:ce.invitations(e)}),oe.success("Invitation cancelled")},t[2]=e,t[3]=l,t[4]=a):a=t[4];let o;t[5]!==i||t[6]!==a?(o={mutationFn:i,onSuccess:a,onError:hs},t[5]=i,t[6]=a,t[7]=o):o=t[7];const r=Me(o);let u;return t[8]!==r?(u={cancel:r},t[8]=r,t[9]=u):u=t[9],u}function hs(t){oe.error(t instanceof Error?t.message:"Failed to cancel invitation")}function gs(){const t=U.c(7),{locator:e}=pe(),n=$e();let l;t[0]!==e?(l=ce.tags(e),t[0]=e,t[1]=l):l=t[1];let i;t[2]!==n?(i=async()=>{const{tags:o}=await n.call("TAGS_LIST",{});return o},t[2]=n,t[3]=i):i=t[3];let a;return t[4]!==l||t[5]!==i?(a={queryKey:l,queryFn:i,staleTime:3e4},t[4]=l,t[5]=i,t[6]=a):a=t[6],Ct(a)}function xs(){const t=U.c(8),e=Qe(),{locator:n}=pe(),l=$e();let i;t[0]!==l?(i=async r=>{const{tag:u}=await l.call("TAGS_CREATE",{name:r});return u},t[0]=l,t[1]=i):i=t[1];let a;t[2]!==n||t[3]!==e?(a=()=>{e.invalidateQueries({queryKey:ce.tags(n)})},t[2]=n,t[3]=e,t[4]=a):a=t[4];let o;return t[5]!==i||t[6]!==a?(o={mutationFn:i,onSuccess:a,onError:bs},t[5]=i,t[6]=a,t[7]=o):o=t[7],Me(o)}function bs(t){oe.error(t instanceof Error?t.message:"Failed to create tag")}function js(t){const e=U.c(10),{locator:n}=pe(),l=$e();let i;e[0]!==n||e[1]!==t?(i=ce.memberTags(n,t),e[0]=n,e[1]=t,e[2]=i):i=e[2];let a;e[3]!==t||e[4]!==l?(a=async()=>{const{tags:u}=await l.call("MEMBER_TAGS_GET",{memberId:t});return u},e[3]=t,e[4]=l,e[5]=a):a=e[5];const o=!!t;let r;return e[6]!==i||e[7]!==a||e[8]!==o?(r={queryKey:i,queryFn:a,staleTime:3e4,enabled:o},e[6]=i,e[7]=a,e[8]=o,e[9]=r):r=e[9],Ct(r)}function vs(){const t=U.c(8),e=Qe(),{locator:n}=pe(),l=$e();let i;t[0]!==l?(i=async r=>{const{memberId:u,tagIds:f}=r;return await l.call("MEMBER_TAGS_SET",{memberId:u,tagIds:f})},t[0]=l,t[1]=i):i=t[1];let a;t[2]!==n||t[3]!==e?(a=(r,u)=>{e.invalidateQueries({queryKey:ce.memberTags(n,u.memberId)})},t[2]=n,t[3]=e,t[4]=a):a=t[4];let o;return t[5]!==i||t[6]!==a?(o={mutationFn:i,onSuccess:a,onError:Cs},t[5]=i,t[6]=a,t[7]=o):o=t[7],Me(o)}function Cs(t){oe.error(t instanceof Error?t.message:"Failed to update member tags")}function It(t){const e=U.c(44),{memberId:n,className:l,disabled:i,placeholder:a,maxDisplay:o}=t,r=i===void 0?!1:i,u=a===void 0?"Add tags...":a,f=o===void 0?2:o,[g,b]=re.useState(!1),[p,I]=re.useState(""),{data:M,isLoading:j}=gs(),D=M===void 0?[]:M,{data:v,isLoading:$}=js(n),C=v===void 0?[]:v,E=xs(),N=vs(),R=j||$,S=C.map(Ss);let z;e[0]!==p?(z=x=>x.name.toLowerCase().includes(p.toLowerCase()),e[0]=p,e[1]=z):z=e[1];const A=D.filter(z);let y;e[2]!==p?(y=x=>x.name.toLowerCase()===p.toLowerCase(),e[2]=p,e[3]=y):y=e[3];const K=D.find(y),w=p.trim()&&!K,k=async x=>{const fe=S.includes(x.id)?S.filter(xe=>xe!==x.id):[...S,x.id];await N.mutateAsync({memberId:n,tagIds:fe})},_=async()=>{if(!p.trim())return;const x=await E.mutateAsync(p.trim());await N.mutateAsync({memberId:n,tagIds:[...S,x.id]}),I("")},c=async x=>{const se=S.filter(fe=>fe!==x);await N.mutateAsync({memberId:n,tagIds:se})},h=E.isPending||N.isPending,L=os;let P;e[4]!==g?(P=()=>b(!g),e[4]=g,e[5]=P):P=e[5];let O;e[6]!==l?(O=ke("h-auto min-h-8 px-2 py-1 justify-start font-normal","hover:bg-accent/50",l),e[6]=l,e[7]=O):O=e[7];const V=r||R,q=R?s.jsx(Xe,{size:14,className:"animate-spin text-muted-foreground"}):C.length>0?s.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[C.slice(0,f).map(ys),C.length>f&&s.jsxs(Ge,{variant:"secondary",className:"text-xs px-1.5 py-0 h-5",children:["+",C.length-f]})]}):s.jsx("span",{className:"text-muted-foreground text-xs",children:u});let Q;e[8]===Symbol.for("react.memo_cache_sentinel")?(Q=s.jsx(cs,{size:14,className:"ml-1 shrink-0 opacity-50"}),e[8]=Q):Q=e[8];let F;e[9]!==V||e[10]!==q||e[11]!==P||e[12]!==O?(F=s.jsx(rs,{asChild:!0,children:s.jsxs(ze,{variant:"ghost",size:"sm",onClick:P,className:O,disabled:V,children:[q,Q]})}),e[9]=V,e[10]=q,e[11]=P,e[12]=O,e[13]=F):F=e[13];const G=ls,J="w-56 p-0",H="start";let W;e[14]===Symbol.for("react.memo_cache_sentinel")?(W=()=>b(!1),e[14]=W):W=e[14];const ne=is,he=!1;let Y;e[15]!==p?(Y=s.jsx(as,{placeholder:"Search or create...",value:p,onValueChange:I,className:"h-9"}),e[15]=p,e[16]=Y):Y=e[16];const ie=ns,me=C.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(Ye,{heading:"Selected",children:C.map(x=>s.jsx(Ze,{onSelect:()=>k(x),className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(gt,{checked:!0,className:"[&_svg]:!text-primary-foreground"}),s.jsx("span",{children:x.name})]}),s.jsx("button",{onClick:se=>{se.stopPropagation(),c(x.id)},className:"opacity-50 hover:opacity-100",disabled:h,children:s.jsx(Tt,{size:14})})]})},x.id))}),s.jsx(xt,{})]}),Pe=Ye,ge="Available",Ee=A.length===0&&!w&&s.jsx(ss,{children:"No tags found."}),ue=A.filter(x=>!S.includes(x.id)).map(x=>s.jsx(Ze,{onSelect:()=>k(x),className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(gt,{checked:!1,className:"[&_svg]:!text-primary-foreground"}),s.jsx("span",{children:x.name})]})},x.id));let ae;e[17]!==Pe||e[18]!==Ee||e[19]!==ue?(ae=s.jsxs(Pe,{heading:ge,children:[Ee,ue]}),e[17]=Pe,e[18]=Ee,e[19]=ue,e[20]=ae):ae=e[20];let le;e[21]!==_||e[22]!==h||e[23]!==p||e[24]!==w?(le=w&&s.jsxs(s.Fragment,{children:[s.jsx(xt,{}),s.jsx(Ye,{children:s.jsx(Ze,{onSelect:_,className:"cursor-pointer",disabled:h,children:s.jsxs("div",{className:"flex items-center gap-2 text-primary",children:[h?s.jsx(Xe,{size:14,className:"animate-spin"}):s.jsx(ms,{size:14}),s.jsxs("span",{children:['Create "',p.trim(),'"']})]})})})]}),e[21]=_,e[22]=h,e[23]=p,e[24]=w,e[25]=le):le=e[25];let Z;e[26]!==ie||e[27]!==me||e[28]!==ae||e[29]!==le?(Z=s.jsxs(ie,{children:[me,ae,le]}),e[26]=ie,e[27]=me,e[28]=ae,e[29]=le,e[30]=Z):Z=e[30];let X;e[31]!==ne||e[32]!==Y||e[33]!==Z?(X=s.jsxs(ne,{shouldFilter:he,children:[Y,Z]}),e[31]=ne,e[32]=Y,e[33]=Z,e[34]=X):X=e[34];let ee;e[35]!==G||e[36]!==W||e[37]!==X?(ee=s.jsx(G,{className:J,align:H,onEscapeKeyDown:W,children:X}),e[35]=G,e[36]=W,e[37]=X,e[38]=ee):ee=e[38];let te;return e[39]!==L||e[40]!==g||e[41]!==F||e[42]!==ee?(te=s.jsxs(L,{open:g,onOpenChange:b,children:[F,ee]}),e[39]=L,e[40]=g,e[41]=F,e[42]=ee,e[43]=te):te=e[43],te}function ys(t){return s.jsx(Ge,{variant:"secondary",className:"text-xs px-1.5 py-0 h-5",children:t.name},t.id)}function Ss(t){return t.id}const bt=["bg-neutral-400","bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500","bg-slate-500"],Ns={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function ws(t){const e=new Map;for(const[n,l]of Object.entries(Ns))e.set(n,l);for(let n=0;n<t.length;n++){const l=t[n];l&&!e.has(l.role)&&e.set(l.role,bt[n%bt.length]??"bg-neutral-400")}return e}function Ke(t){const e=U.c(79),{role:n,memberId:l,isOwner:i,roleColorMap:a,selectableRoles:o,onRoleChange:r,size:u,className:f}=t,g=u===void 0?"xs":u;let b,p,I,M,j,D,v,$,C,E,N;if(e[0]!==f||e[1]!==i||e[2]!==l||e[3]!==r||e[4]!==n||e[5]!==a||e[6]!==o||e[7]!==g){N=Symbol.for("react.early_return_sentinel");e:{const _=a.get(n)??"bg-neutral-400";if(i){let c;e[19]!==l||e[20]!==r?(c=J=>r(l,J),e[19]=l,e[20]=r,e[21]=c):c=e[21];let h;e[22]!==n?(h=s.jsx("span",{className:"capitalize truncate",children:n}),e[22]=n,e[23]=h):h=e[23];const L=s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx("div",{className:ke("size-2 rounded-full shrink-0",_)}),h]});let P;e[24]!==L?(P=s.jsx(dt,{children:L}),e[24]=L,e[25]=P):P=e[25];let O;e[26]!==f||e[27]!==g||e[28]!==P?(O=s.jsx(ut,{size:g,className:f,children:P}),e[26]=f,e[27]=g,e[28]=P,e[29]=O):O=e[29];let V;if(e[30]!==a||e[31]!==o){let J;e[33]!==a?(J=H=>{const W=a.get(H.role)??"bg-neutral-400";return s.jsx(ft,{value:H.role,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:ke("size-3 rounded-full",W)}),s.jsx("span",{className:"capitalize",children:H.label})]})},H.role)},e[33]=a,e[34]=J):J=e[34],V=o.map(J),e[30]=a,e[31]=o,e[32]=V}else V=e[32];let q;e[35]!==V?(q=s.jsx(pt,{children:V}),e[35]=V,e[36]=q):q=e[36];let Q;e[37]!==i||e[38]!==n||e[39]!==c||e[40]!==O||e[41]!==q?(Q=s.jsx(Vt,{asChild:!0,children:s.jsx("div",{className:"w-fit",children:s.jsxs(ht,{value:n,onValueChange:c,disabled:i,children:[O,q]})})}),e[37]=i,e[38]=n,e[39]=c,e[40]=O,e[41]=q,e[42]=Q):Q=e[42];let F;e[43]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(Qt,{children:s.jsx("p",{children:"The owner role cannot be changed"})}),e[43]=F):F=e[43];let G;e[44]!==Q?(G=s.jsx(Gt,{children:s.jsxs(Ut,{children:[Q,F]})}),e[44]=Q,e[45]=G):G=e[45],N=G;break e}I=ht,$=n,e[46]!==l||e[47]!==r?(C=c=>r(l,c),e[46]=l,e[47]=r,e[48]=C):C=e[48],E=i,p=ut,D=g,v=f,b=dt,j="flex items-center gap-2 min-w-0",M=ke("size-2 rounded-full shrink-0",_)}e[0]=f,e[1]=i,e[2]=l,e[3]=r,e[4]=n,e[5]=a,e[6]=o,e[7]=g,e[8]=b,e[9]=p,e[10]=I,e[11]=M,e[12]=j,e[13]=D,e[14]=v,e[15]=$,e[16]=C,e[17]=E,e[18]=N}else b=e[8],p=e[9],I=e[10],M=e[11],j=e[12],D=e[13],v=e[14],$=e[15],C=e[16],E=e[17],N=e[18];if(N!==Symbol.for("react.early_return_sentinel"))return N;let R;e[49]!==M?(R=s.jsx("div",{className:M}),e[49]=M,e[50]=R):R=e[50];let S;e[51]!==n?(S=s.jsx("span",{className:"capitalize truncate",children:n}),e[51]=n,e[52]=S):S=e[52];let z;e[53]!==R||e[54]!==S||e[55]!==j?(z=s.jsxs("div",{className:j,children:[R,S]}),e[53]=R,e[54]=S,e[55]=j,e[56]=z):z=e[56];let A;e[57]!==b||e[58]!==z?(A=s.jsx(b,{children:z}),e[57]=b,e[58]=z,e[59]=A):A=e[59];let y;e[60]!==p||e[61]!==A||e[62]!==D||e[63]!==v?(y=s.jsx(p,{size:D,className:v,children:A}),e[60]=p,e[61]=A,e[62]=D,e[63]=v,e[64]=y):y=e[64];let K;if(e[65]!==a||e[66]!==o){let _;e[68]!==a?(_=c=>{const h=a.get(c.role)??"bg-neutral-400";return s.jsx(ft,{value:c.role,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:ke("size-3 rounded-full",h)}),s.jsx("span",{className:"capitalize",children:c.label})]})},c.role)},e[68]=a,e[69]=_):_=e[69],K=o.map(_),e[65]=a,e[66]=o,e[67]=K}else K=e[67];let w;e[70]!==K?(w=s.jsx(pt,{children:K}),e[70]=K,e[71]=w):w=e[71];let k;return e[72]!==I||e[73]!==y||e[74]!==w||e[75]!==$||e[76]!==C||e[77]!==E?(k=s.jsxs(I,{value:$,onValueChange:C,disabled:E,children:[y,w]}),e[72]=I,e[73]=y,e[74]=w,e[75]=$,e[76]=C,e[77]=E,e[78]=k):k=e[78],k}function jt(t){const e=U.c(51),{member:n,roles:l,onChangeRole:i,onRemove:a,isUpdating:o}=t,r=o===void 0?!1:o,u=n.role==="owner";let f,g,b,p,I,M,j,D,v;if(e[0]!==u||e[1]!==r||e[2]!==n.id||e[3]!==n.role||e[4]!==i||e[5]!==l){let y;e[15]!==n.role?(y=c=>c.role!==n.role&&c.role!=="owner",e[15]=n.role,e[16]=y):y=e[16];const K=l.filter(y);p=St;let w;e[17]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(_t,{size:20}),e[17]=w):w=e[17],e[18]!==u?(v=s.jsx(Nt,{asChild:!0,children:s.jsx(ze,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",disabled:u,onClick:Ts,children:w})}),e[18]=u,e[19]=v):v=e[19],b=wt,j="end",D=_s,g=Jt;let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(es,{size:16}),e[20]=k):k=e[20],e[21]!==r?(M=s.jsxs(Ht,{disabled:r,children:[k,"Change Role"]}),e[21]=r,e[22]=M):M=e[22],f=Wt;let _;e[23]!==r||e[24]!==n.id||e[25]!==i?(_=c=>{const h=[];return c.isBuiltin||(c.allowsAllStaticPermissions?h.push("Full org access"):c.staticPermissionCount&&c.staticPermissionCount>0&&h.push(`${c.staticPermissionCount} org perm${c.staticPermissionCount!==1?"s":""}`),c.allowsAllConnections?h.push("All connections"):c.connectionCount&&c.connectionCount>0&&h.push(`${c.connectionCount} connection${c.connectionCount!==1?"s":""}`),(c.connectionCount!==0||c.allowsAllConnections)&&(c.allowsAllTools?h.push("all tools"):c.toolCount&&c.toolCount>0&&h.push(`${c.toolCount} tool${c.toolCount!==1?"s":""}`))),s.jsxs(et,{onClick:L=>{L.stopPropagation(),i(n.id,c.role)},disabled:r,children:[c.isBuiltin?s.jsx(Xt,{size:16}):s.jsx(Zt,{size:16}),s.jsxs("span",{className:"flex flex-col",children:[s.jsx("span",{children:c.label}),!c.isBuiltin&&h.length>0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:h.join(", ")})]})]},c.role)},e[23]=r,e[24]=n.id,e[25]=i,e[26]=_):_=e[26],I=K.map(_),e[0]=u,e[1]=r,e[2]=n.id,e[3]=n.role,e[4]=i,e[5]=l,e[6]=f,e[7]=g,e[8]=b,e[9]=p,e[10]=I,e[11]=M,e[12]=j,e[13]=D,e[14]=v}else f=e[6],g=e[7],b=e[8],p=e[9],I=e[10],M=e[11],j=e[12],D=e[13],v=e[14];let $;e[27]!==f||e[28]!==I?($=s.jsx(f,{children:I}),e[27]=f,e[28]=I,e[29]=$):$=e[29];let C;e[30]!==g||e[31]!==M||e[32]!==$?(C=s.jsxs(g,{children:[M,$]}),e[30]=g,e[31]=M,e[32]=$,e[33]=C):C=e[33];let E;e[34]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(Yt,{}),e[34]=E):E=e[34];let N;e[35]!==n.id||e[36]!==a?(N=y=>{y.stopPropagation(),a(n.id)},e[35]=n.id,e[36]=a,e[37]=N):N=e[37];let R;e[38]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(ts,{size:16}),e[38]=R):R=e[38];let S;e[39]!==N?(S=s.jsxs(et,{variant:"destructive",onClick:N,children:[R,"Remove Member"]}),e[39]=N,e[40]=S):S=e[40];let z;e[41]!==b||e[42]!==S||e[43]!==j||e[44]!==D||e[45]!==C?(z=s.jsxs(b,{align:j,onClick:D,children:[C,E,S]}),e[41]=b,e[42]=S,e[43]=j,e[44]=D,e[45]=C,e[46]=z):z=e[46];let A;return e[47]!==p||e[48]!==z||e[49]!==v?(A=s.jsxs(p,{children:[v,z]}),e[47]=p,e[48]=z,e[49]=v,e[50]=A):A=e[50],A}function _s(t){return t.stopPropagation()}function Ts(t){return t.stopPropagation()}function vt(t){const e=U.c(8),{invitationId:n,onCancel:l,isCancelling:i}=t,a=i===void 0?!1:i;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Nt,{asChild:!0,children:s.jsx(ze,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:As,children:s.jsx(_t,{size:20})})}),e[0]=o):o=e[0];let r;e[1]!==n||e[2]!==l?(r=g=>{g.stopPropagation(),l(n)},e[1]=n,e[2]=l,e[3]=r):r=e[3];let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Tt,{size:16}),e[4]=u):u=e[4];let f;return e[5]!==a||e[6]!==r?(f=s.jsxs(St,{children:[o,s.jsx(wt,{align:"end",onClick:Is,children:s.jsxs(et,{variant:"destructive",onClick:r,disabled:a,children:[u,"Cancel Invitation"]})})]}),e[5]=a,e[6]=r,e[7]=f):f=e[7],f}function Is(t){return t.stopPropagation()}function As(t){return t.stopPropagation()}function Ms(){const t=U.c(103),{data:e}=Bt(),{data:n}=fs(),l=ps(),i=Qe(),{locator:a}=pe(),o=yt(),[r,u]=re.useState(null),[f,g]=re.useState(null),[b,p]=re.useState(""),[I,M]=re.useState("table"),[j,D]=re.useState("member"),[v,$]=re.useState("asc"),C=e?.data?.members;let E;t[0]!==j?(E=m=>{j===m?$(Fs):(D(m),$("asc"))},t[0]=j,t[1]=E):E=t[1];const N=E;let R=C??[],S=n??[];if(b){const m=b.toLowerCase();R=R.filter(d=>d.user?.name?.toLowerCase().includes(m)||d.user?.email?.toLowerCase().includes(m)||d.role?.toLowerCase().includes(m)),S=S.filter(d=>d.email?.toLowerCase().includes(m)||d.role?.toLowerCase().includes(m))}if(j&&v){let m;t[2]!==v||t[3]!==j?(m=(d,T)=>{let B,de;e:switch(j){case"member":{B=d.user?.name||"",de=T.user?.name||"";break e}case"role":{B=d.role||"",de=T.role||"";break e}case"joined":{B=d.createdAt?typeof d.createdAt=="string"?d.createdAt:d.createdAt.toISOString():"",de=T.createdAt?typeof T.createdAt=="string"?T.createdAt:T.createdAt.toISOString():"";break e}default:return 0}return v==="asc"?B.localeCompare(de):de.localeCompare(B)},t[2]=v,t[3]=j,t[4]=m):m=t[4],R=[...R].sort(m)}const z=R;let A;t[5]!==o?(A=async m=>{const d=await o.organization.removeMember({memberIdOrEmail:m});if(d?.error)throw new Error(d.error.message)},t[5]=o,t[6]=A):A=t[6];let y;t[7]!==a||t[8]!==i?(y=()=>{Re("member_removed"),i.invalidateQueries({queryKey:ce.members(a)}),oe.success("Member has been removed from the organization"),u(null)},t[7]=a,t[8]=i,t[9]=y):y=t[9];let K;t[10]!==A||t[11]!==y?(K={mutationFn:A,onSuccess:y,onError:Ls},t[10]=A,t[11]=y,t[12]=K):K=t[12];const w=Me(K);let k;t[13]!==o?(k=async m=>{const{memberId:d,role:T}=m,B=await o.organization.updateMemberRole({memberId:d,role:[T]});if(B?.error)throw new Error(B.error.message)},t[13]=o,t[14]=k):k=t[14];let _;t[15]!==a||t[16]!==i?(_=(m,d)=>{Re("member_role_updated",{new_role:d.role}),i.invalidateQueries({queryKey:ce.members(a)}),oe.success("Member's role has been updated")},t[15]=a,t[16]=i,t[17]=_):_=t[17];let c;t[18]!==k||t[19]!==_?(c={mutationFn:k,onSuccess:_,onError:qs},t[18]=k,t[19]=_,t[20]=c):c=t[20];const h=Me(c);let L;t[21]!==o?(L=async m=>{const{invitationId:d,role:T,email:B}=m,de=await o.organization.cancelInvitation({invitationId:d});if(de?.error)throw new Error(de.error.message);const tt=await o.organization.inviteMember({email:B,role:T});if(tt?.error)throw new Error(tt.error.message)},t[21]=o,t[22]=L):L=t[22];let P;t[23]!==a||t[24]!==i?(P=(m,d)=>{Re("invitation_role_updated",{new_role:d.role}),i.invalidateQueries({queryKey:ce.invitations(a)}),oe.success("Invitation role has been updated")},t[23]=a,t[24]=i,t[25]=P):P=t[25];let O;t[26]!==L||t[27]!==P?(O={mutationFn:L,onSuccess:P,onError:Os},t[26]=L,t[27]=P,t[28]=O):O=t[28];const V=Me(O),{roles:q,customRoles:Q}=Kt();let F;t[29]!==Q?(F=ws(Q),t[29]=Q,t[30]=F):F=t[30];const G=F;let J;t[31]!==q?(J=q.filter($s),t[31]=q,t[32]=J):J=t[32];const H=J;let W;t[33]===Symbol.for("react.memo_cache_sentinel")?(W={id:"member",header:"Member",render:Ds,cellClassName:"flex-1 min-w-0",sortable:!0},t[33]=W):W=t[33];let ne;t[34]!==G||t[35]!==H||t[36]!==V||t[37]!==h?(ne={id:"role",header:"Role",render:m=>m.type==="member"?s.jsx(Ke,{role:m.data.role,memberId:m.data.id,isOwner:m.data.role==="owner",roleColorMap:G,selectableRoles:H,onRoleChange:(d,T)=>h.mutate({memberId:d,role:T}),className:"w-36"}):s.jsx(Ke,{role:m.data.role,memberId:m.data.id,isOwner:!1,roleColorMap:G,selectableRoles:H,onRoleChange:(d,T)=>V.mutate({invitationId:d,role:T,email:m.data.email}),className:"w-36"}),cellClassName:"w-36 shrink-0",sortable:!0},t[34]=G,t[35]=H,t[36]=V,t[37]=h,t[38]=ne):ne=t[38];let he,Y;t[39]===Symbol.for("react.memo_cache_sentinel")?(he={id:"tags",header:"Tags",render:ks,cellClassName:"w-40 shrink-0"},Y={id:"joined",header:"Joined",render:Es,cellClassName:"w-48 shrink-0",sortable:!0},t[39]=he,t[40]=Y):(he=t[39],Y=t[40]);let ie;t[41]!==l.cancel.isPending||t[42]!==q||t[43]!==h?(ie={id:"actions",header:"",render:m=>m.type==="member"?s.jsx(jt,{member:m.data,roles:q,onChangeRole:(d,T)=>h.mutate({memberId:d,role:T}),onRemove:u,isUpdating:h.isPending}):s.jsx(vt,{invitationId:m.data.id,onCancel:g,isCancelling:l.cancel.isPending}),cellClassName:"w-12 shrink-0"},t[41]=l.cancel.isPending,t[42]=q,t[43]=h,t[44]=ie):ie=t[44];let me;t[45]!==ne||t[46]!==ie?(me=[W,ne,he,Y,ie],t[45]=ne,t[46]=ie,t[47]=me):me=t[47];const Pe=me;let ge;t[48]===Symbol.for("react.memo_cache_sentinel")?(ge=s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(kt,{trigger:s.jsx(ze,{children:"Invite Member"})})}),t[48]=ge):ge=t[48];const Ee=ge,ue=[...z.map(Ps),...S.filter(zs).map(Rs)],ae=Ae,le=!!f;let Z;t[49]===Symbol.for("react.memo_cache_sentinel")?(Z=()=>g(null),t[49]=Z):Z=t[49];let X;t[50]===Symbol.for("react.memo_cache_sentinel")?(X=s.jsxs(at,{children:[s.jsx(lt,{children:"Cancel Invitation"}),s.jsx(ot,{children:"Are you sure you want to cancel this invitation? The invitee will no longer be able to join the organization with this invitation."})]}),t[50]=X):X=t[50];let ee;t[51]===Symbol.for("react.memo_cache_sentinel")?(ee=s.jsx(rt,{children:"Keep Invitation"}),t[51]=ee):ee=t[51];let te;t[52]!==l.cancel||t[53]!==f?(te=()=>{f&&(l.cancel.mutate(f),g(null))},t[52]=l.cancel,t[53]=f,t[54]=te):te=t[54];let x;t[55]!==l.cancel.isPending||t[56]!==te?(x=s.jsxs(st,{children:[X,s.jsxs(nt,{children:[ee,s.jsx(it,{onClick:te,disabled:l.cancel.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Cancel Invitation"})]})]}),t[55]=l.cancel.isPending,t[56]=te,t[57]=x):x=t[57];let se;t[58]!==le||t[59]!==x?(se=s.jsx(ct,{open:le,onOpenChange:Z,children:x}),t[58]=le,t[59]=x,t[60]=se):se=t[60];const fe=!!r;let xe;t[61]===Symbol.for("react.memo_cache_sentinel")?(xe=()=>u(null),t[61]=xe):xe=t[61];let Oe;t[62]===Symbol.for("react.memo_cache_sentinel")?(Oe=s.jsxs(at,{children:[s.jsx(lt,{children:"Remove Member"}),s.jsx(ot,{children:"Are you sure you want to remove this member from the organization? This action cannot be undone."})]}),t[62]=Oe):Oe=t[62];let qe;t[63]===Symbol.for("react.memo_cache_sentinel")?(qe=s.jsx(rt,{children:"Cancel"}),t[63]=qe):qe=t[63];let be;t[64]!==r||t[65]!==w?(be=()=>r&&w.mutate(r),t[64]=r,t[65]=w,t[66]=be):be=t[66];let je;t[67]!==w.isPending||t[68]!==be?(je=s.jsxs(st,{children:[Oe,s.jsxs(nt,{children:[qe,s.jsx(it,{onClick:be,disabled:w.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]}),t[67]=w.isPending,t[68]=be,t[69]=je):je=t[69];let ve;t[70]!==fe||t[71]!==je?(ve=s.jsx(ct,{open:fe,onOpenChange:xe,children:je}),t[70]=fe,t[71]=je,t[72]=ve):ve=t[72];const Ue=Ae,Je=Ae,At="flex flex-col gap-6";let Ce,ye;t[73]===Symbol.for("react.memo_cache_sentinel")?(Ce=s.jsx(us,{}),ye=s.jsx(Ae.Title,{children:"Members"}),t[73]=Ce,t[74]=ye):(Ce=t[73],ye=t[74]);let Le;t[75]===Symbol.for("react.memo_cache_sentinel")?(Le=m=>{m.key==="Escape"&&(p(""),m.target.blur())},t[75]=Le):Le=t[75];let Se;t[76]!==b?(Se=s.jsx(Pt,{value:b,onChange:p,placeholder:"Search members...",className:"w-full md:w-[375px]",onKeyDown:Le}),t[76]=b,t[77]=Se):Se=t[77];let Fe;t[78]===Symbol.for("react.memo_cache_sentinel")?(Fe=[{id:"member",label:"Name"},{id:"role",label:"Role"},{id:"joined",label:"Joined"}],t[78]=Fe):Fe=t[78];let Ne;t[79]!==N||t[80]!==v||t[81]!==j||t[82]!==I?(Ne=s.jsx(zt,{viewMode:I,onViewModeChange:M,sortKey:j,sortDirection:v,onSort:N,sortOptions:Fe}),t[79]=N,t[80]=v,t[81]=j,t[82]=I,t[83]=Ne):Ne=t[83];let we;t[84]!==Se||t[85]!==Ne?(we=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[Se,Ne]}),Ee]}),t[84]=Se,t[85]=Ne,t[86]=we):we=t[86];const He=I==="cards"?s.jsx("div",{children:ue.length===0?s.jsx(We,{title:"No members found",description:b?`No members match "${b}"`:"Invite members to get started."}):s.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:ue.map(m=>{if(m.type==="invitation")return s.jsxs(mt,{className:"transition-colors relative opacity-75",children:[s.jsx("div",{className:"absolute top-4 right-4 z-10",children:s.jsx(vt,{invitationId:m.data.id,onCancel:g,isCancelling:l.cancel.isPending})}),s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(De,{fallback:Ve(m.data.email),shape:"circle",size:"lg",className:"shrink-0"}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:m.data.email}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(Ge,{variant:"outline",className:"w-fit text-amber-600 border-amber-400",children:"Pending"})}),s.jsx(Ke,{role:m.data.role,memberId:m.data.id,isOwner:!1,roleColorMap:G,selectableRoles:H,onRoleChange:(T,B)=>V.mutate({invitationId:T,role:B,email:m.data.email}),className:"w-fit"})]})]})]},`inv-${m.data.id}`);const d=m.data;return s.jsxs(mt,{className:"transition-colors relative",children:[s.jsx("div",{className:"absolute top-4 right-4 z-10",children:s.jsx(jt,{member:d,roles:q,onChangeRole:(T,B)=>h.mutate({memberId:T,role:B}),onRemove:u,isUpdating:h.isPending})}),s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(De,{url:d.user?.image??void 0,fallback:Ve(d.user?.name),shape:"circle",size:"lg",className:"shrink-0"}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:d.user?.name||"Unknown"}),s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:d.user?.email}),s.jsx(Ke,{role:d.role,memberId:d.id,isOwner:d.role==="owner",roleColorMap:G,selectableRoles:H,onRoleChange:(T,B)=>h.mutate({memberId:T,role:B}),className:"w-fit"}),s.jsx(It,{memberId:d.id,maxDisplay:3})]})]})]},d.id)})})}):s.jsx(Et,{columns:Pe,data:ue,isLoading:!1,sortKey:j,sortDirection:v,onSort:N,emptyState:b?s.jsx(We,{title:"No members found",description:`No members match "${b}"`}):s.jsx(We,{title:"No members found",description:"Invite members to get started."})});let _e;t[87]!==Ce||t[88]!==ye||t[89]!==we||t[90]!==He?(_e=s.jsxs("div",{className:At,children:[Ce,ye,we,He]}),t[87]=Ce,t[88]=ye,t[89]=we,t[90]=He,t[91]=_e):_e=t[91];let Te;t[92]!==Je.Body||t[93]!==_e?(Te=s.jsx(Je.Body,{children:_e}),t[92]=Je.Body,t[93]=_e,t[94]=Te):Te=t[94];let Ie;t[95]!==Ue.Content||t[96]!==Te?(Ie=s.jsx(Ue.Content,{children:Te}),t[95]=Ue.Content,t[96]=Te,t[97]=Ie):Ie=t[97];let Be;return t[98]!==ae||t[99]!==se||t[100]!==ve||t[101]!==Ie?(Be=s.jsxs(ae,{children:[se,ve,Ie]}),t[98]=ae,t[99]=se,t[100]=ve,t[101]=Ie,t[102]=Be):Be=t[102],Be}function Rs(t){return{type:"invitation",data:t}}function zs(t){return t.status==="pending"}function Ps(t){return{type:"member",data:t}}function Es(t){return t.type==="member"?s.jsx("span",{className:"text-sm text-foreground",children:t.data.createdAt?Ft(t.data.createdAt):"N/A"}):s.jsx(Ge,{variant:"outline",children:"Pending"})}function ks(t){return t.type==="member"?s.jsx(It,{memberId:t.data.id,maxDisplay:2}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"-"})}function Ds(t){return t.type==="member"?s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(De,{url:t.data.user?.image??void 0,fallback:Ve(t.data.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:t.data.user?.name||"Unknown"}),s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:t.data.user?.email})]})]}):s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(De,{fallback:Ve(t.data.email),shape:"circle",size:"sm"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:t.data.email}),s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:"Invitation sent"})]})]})}function $s(t){return t.role!=="owner"}function Os(t,e){Re("invitation_role_update_failed",{new_role:e.role,error:t instanceof Error?t.message:String(t)}),oe.error(t instanceof Error?t.message:"Failed to update invitation role")}function qs(t,e){Re("member_role_update_failed",{new_role:e.role,error:t instanceof Error?t.message:String(t)}),oe.error(t instanceof Error?t.message:"Failed to update role")}function Ls(t){Re("member_remove_failed",{error:t instanceof Error?t.message:String(t)}),oe.error(t instanceof Error?t.message:"Failed to remove member")}function Fs(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Bs(){const t=U.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Ae,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:"Failed to load members"})})}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Rt,{fallback:e,children:s.jsx(re.Suspense,{fallback:s.jsx(Ae,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Xe,{size:32,className:"animate-spin text-muted-foreground"})})}),children:s.jsx(Ms,{})})}),t[1]=n):n=t[1],n}function Jn(){const t=U.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ds,{capability:"members:manage",area:"members",children:s.jsx(Bs,{})}),t[0]=e):e=t[0],e}export{Jn as default};
|
|
1
|
+
import{c as U,j as s,B as ze,C as pe,v as Mt,n as Qe,d as Me,K as ce,t as oe,m as Ct,r as re,l as ke,i as Xe,E as Rt,p as Re}from"./index-C5JCmVQ0.js";import{C as zt}from"./collection-display-button-CbTgXJt9.js";import{S as Pt}from"./search-input-B9lRxCGI.js";import{P as Ae}from"./index-1xWIMGUU.js";import{C as Et}from"./collection-table-wrapper-Cyqk04aC.js";import{E as We}from"./empty-state-D0Yjh42T.js";import{I as kt}from"./invite-member-dialog-DGmwAQAA.js";import{b as Dt,S as $t,a as Ot}from"./settings-section-CHSsdIIo.js";import{u as qt,a as Lt}from"./use-join-requests-B29gIAVf.js";import{A as De}from"./avatar-CfHetrJ0.js";import{f as Ft}from"./format-time-BnbuEtat.js";import{g as Ve}from"./get-initials-D-f_fDFw.js";import{u as Bt}from"./use-members-CP1GrgsV.js";import{u as $e}from"./studio-tools--pllMpfK.js";import{u as yt}from"./use-org-auth-client-BeUafwOm.js";import{u as Kt}from"./use-organization-roles-BGu4f7lA.js";import{T as Vt,a as Qt,c as Gt,b as Ut}from"./tooltip-DjWNMg5T.js";import{a as st,e as nt,g as it,b as at,c as lt,d as ot,A as rt,f as ct}from"./alert-dialog-IVNf28U9.js";import{B as Ge}from"./badge-BR8ZoQPH.js";import{C as mt}from"./card-1ZIM8JYb.js";import{D as St,a as Nt,c as wt,e as Jt,f as Ht,g as Wt,d as et,j as Yt}from"./dropdown-menu-BlorfjU6.js";import{i as _t}from"./DotsVertical-BQRa2EB9.js";import{i as Zt}from"./Key01-Y2tTMtA8.js";import{i as Xt}from"./Shield01-IlYcL8Fi.js";import{a as es}from"./SwitchHorizontal01-C90B2Auk.js";import{s as ts}from"./Trash01-CrwbV8c_.js";import{s as Tt}from"./XClose-4pjmwtT4.js";import{b as dt,a as ut,d as ft,c as pt,S as ht}from"./select-D59HzWyb.js";import{C as gt}from"./checkbox-YuHG4ViR.js";import{e as Ye,a as Ze,f as xt,C as ss,c as ns,d as is,b as as}from"./command-DRUw9pTQ.js";import{a as ls,b as os,P as rs}from"./popover-DL95paTt.js";import{t as cs}from"./ChevronDown-BsEi-r9q.js";import{s as ms}from"./Plus-DATZ4-ND.js";import{R as ds}from"./require-capability-Coot4cTo.js";import"./ArrowUp-ChoUWc1b.js";import"./Check-BbAbdPfp.js";import"./List-MOccGrJp.js";import"./view-mode-toggle-BVGFEj0-.js";import"./SearchMd-CKL74aOj.js";import"./sidebar-i7yNFNs9.js";import"./LayoutLeft-C6uN3ryJ.js";import"./use-mobile-vXwkCjTm.js";import"./X-CNdIeej8.js";import"./table-B8kPpHAC.js";import"./dialog-DfnhzCwv.js";import"./form-ZPjO3One.js";import"./label-CjR-YPrA.js";import"./textarea-DGICe7Jx.js";import"./ArrowUpRight-Bq-zX9ha.js";import"./use-capability-BtQYj-6N.js";import"./User01-CQV6kRtR.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./ChevronRight-B9mybD1s.js";import"./Circle-Bj_xS3WU.js";import"./ChevronUp-BWoVqFrM.js";import"./index-BOaCGG-5.js";import"./access-gate-BAwcBNbs.js";import"./capability-load-error-CWaH-_Bd.js";function us(){const t=U.c(9),e=qt(),{approve:n,deny:l}=Lt();if(e.length===0)return null;let i;if(t[0]!==n||t[1]!==l||t[2]!==e){let o;t[4]!==n||t[5]!==l?(o=r=>s.jsx(Dt,{icon:s.jsx(De,{url:r.user?.image??void 0,fallback:(r.user?.name??r.user?.email??"?").charAt(0).toUpperCase(),shape:"circle",size:"sm"}),title:r.user?.name??r.user?.email??r.userId,description:r.user?.email,action:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ze,{size:"sm",variant:"outline",onClick:()=>l.mutate(r.id),disabled:l.isPending||n.isPending,children:"Deny"}),s.jsx(ze,{size:"sm",onClick:()=>n.mutate(r.id),disabled:n.isPending||l.isPending,children:"Approve"})]})},r.id),t[4]=n,t[5]=l,t[6]=o):o=t[6],i=e.map(o),t[0]=n,t[1]=l,t[2]=e,t[3]=i}else i=t[3];let a;return t[7]!==i?(a=s.jsx($t,{title:"Join requests",description:"People who requested to join via a domain in approval mode.",children:s.jsx(Ot,{children:i})}),t[7]=i,t[8]=a):a=t[8],a}function fs(){const t=U.c(7),{locator:e}=pe(),n=$e();let l;t[0]!==e?(l=ce.invitations(e),t[0]=e,t[1]=l):l=t[1];let i;t[2]!==n?(i=async()=>(await n.call("ORGANIZATION_GET",{}))?.invitations??[],t[2]=n,t[3]=i):i=t[3];let a;return t[4]!==l||t[5]!==i?(a={queryKey:l,queryFn:i},t[4]=l,t[5]=i,t[6]=a):a=t[6],Mt(a)}function ps(){const t=U.c(10),{locator:e}=pe(),n=yt(),l=Qe();let i;t[0]!==n?(i=async f=>{const g=await n.organization.cancelInvitation({invitationId:f});if(g?.error)throw new Error(g.error.message);return g.data},t[0]=n,t[1]=i):i=t[1];let a;t[2]!==e||t[3]!==l?(a=()=>{l.invalidateQueries({queryKey:ce.invitations(e)}),oe.success("Invitation cancelled")},t[2]=e,t[3]=l,t[4]=a):a=t[4];let o;t[5]!==i||t[6]!==a?(o={mutationFn:i,onSuccess:a,onError:hs},t[5]=i,t[6]=a,t[7]=o):o=t[7];const r=Me(o);let u;return t[8]!==r?(u={cancel:r},t[8]=r,t[9]=u):u=t[9],u}function hs(t){oe.error(t instanceof Error?t.message:"Failed to cancel invitation")}function gs(){const t=U.c(7),{locator:e}=pe(),n=$e();let l;t[0]!==e?(l=ce.tags(e),t[0]=e,t[1]=l):l=t[1];let i;t[2]!==n?(i=async()=>{const{tags:o}=await n.call("TAGS_LIST",{});return o},t[2]=n,t[3]=i):i=t[3];let a;return t[4]!==l||t[5]!==i?(a={queryKey:l,queryFn:i,staleTime:3e4},t[4]=l,t[5]=i,t[6]=a):a=t[6],Ct(a)}function xs(){const t=U.c(8),e=Qe(),{locator:n}=pe(),l=$e();let i;t[0]!==l?(i=async r=>{const{tag:u}=await l.call("TAGS_CREATE",{name:r});return u},t[0]=l,t[1]=i):i=t[1];let a;t[2]!==n||t[3]!==e?(a=()=>{e.invalidateQueries({queryKey:ce.tags(n)})},t[2]=n,t[3]=e,t[4]=a):a=t[4];let o;return t[5]!==i||t[6]!==a?(o={mutationFn:i,onSuccess:a,onError:bs},t[5]=i,t[6]=a,t[7]=o):o=t[7],Me(o)}function bs(t){oe.error(t instanceof Error?t.message:"Failed to create tag")}function js(t){const e=U.c(10),{locator:n}=pe(),l=$e();let i;e[0]!==n||e[1]!==t?(i=ce.memberTags(n,t),e[0]=n,e[1]=t,e[2]=i):i=e[2];let a;e[3]!==t||e[4]!==l?(a=async()=>{const{tags:u}=await l.call("MEMBER_TAGS_GET",{memberId:t});return u},e[3]=t,e[4]=l,e[5]=a):a=e[5];const o=!!t;let r;return e[6]!==i||e[7]!==a||e[8]!==o?(r={queryKey:i,queryFn:a,staleTime:3e4,enabled:o},e[6]=i,e[7]=a,e[8]=o,e[9]=r):r=e[9],Ct(r)}function vs(){const t=U.c(8),e=Qe(),{locator:n}=pe(),l=$e();let i;t[0]!==l?(i=async r=>{const{memberId:u,tagIds:f}=r;return await l.call("MEMBER_TAGS_SET",{memberId:u,tagIds:f})},t[0]=l,t[1]=i):i=t[1];let a;t[2]!==n||t[3]!==e?(a=(r,u)=>{e.invalidateQueries({queryKey:ce.memberTags(n,u.memberId)})},t[2]=n,t[3]=e,t[4]=a):a=t[4];let o;return t[5]!==i||t[6]!==a?(o={mutationFn:i,onSuccess:a,onError:Cs},t[5]=i,t[6]=a,t[7]=o):o=t[7],Me(o)}function Cs(t){oe.error(t instanceof Error?t.message:"Failed to update member tags")}function It(t){const e=U.c(44),{memberId:n,className:l,disabled:i,placeholder:a,maxDisplay:o}=t,r=i===void 0?!1:i,u=a===void 0?"Add tags...":a,f=o===void 0?2:o,[g,b]=re.useState(!1),[p,I]=re.useState(""),{data:M,isLoading:j}=gs(),D=M===void 0?[]:M,{data:v,isLoading:$}=js(n),C=v===void 0?[]:v,E=xs(),N=vs(),R=j||$,S=C.map(Ss);let z;e[0]!==p?(z=x=>x.name.toLowerCase().includes(p.toLowerCase()),e[0]=p,e[1]=z):z=e[1];const A=D.filter(z);let y;e[2]!==p?(y=x=>x.name.toLowerCase()===p.toLowerCase(),e[2]=p,e[3]=y):y=e[3];const K=D.find(y),w=p.trim()&&!K,k=async x=>{const fe=S.includes(x.id)?S.filter(xe=>xe!==x.id):[...S,x.id];await N.mutateAsync({memberId:n,tagIds:fe})},_=async()=>{if(!p.trim())return;const x=await E.mutateAsync(p.trim());await N.mutateAsync({memberId:n,tagIds:[...S,x.id]}),I("")},c=async x=>{const se=S.filter(fe=>fe!==x);await N.mutateAsync({memberId:n,tagIds:se})},h=E.isPending||N.isPending,L=os;let P;e[4]!==g?(P=()=>b(!g),e[4]=g,e[5]=P):P=e[5];let O;e[6]!==l?(O=ke("h-auto min-h-8 px-2 py-1 justify-start font-normal","hover:bg-accent/50",l),e[6]=l,e[7]=O):O=e[7];const V=r||R,q=R?s.jsx(Xe,{size:14,className:"animate-spin text-muted-foreground"}):C.length>0?s.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[C.slice(0,f).map(ys),C.length>f&&s.jsxs(Ge,{variant:"secondary",className:"text-xs px-1.5 py-0 h-5",children:["+",C.length-f]})]}):s.jsx("span",{className:"text-muted-foreground text-xs",children:u});let Q;e[8]===Symbol.for("react.memo_cache_sentinel")?(Q=s.jsx(cs,{size:14,className:"ml-1 shrink-0 opacity-50"}),e[8]=Q):Q=e[8];let F;e[9]!==V||e[10]!==q||e[11]!==P||e[12]!==O?(F=s.jsx(rs,{asChild:!0,children:s.jsxs(ze,{variant:"ghost",size:"sm",onClick:P,className:O,disabled:V,children:[q,Q]})}),e[9]=V,e[10]=q,e[11]=P,e[12]=O,e[13]=F):F=e[13];const G=ls,J="w-56 p-0",H="start";let W;e[14]===Symbol.for("react.memo_cache_sentinel")?(W=()=>b(!1),e[14]=W):W=e[14];const ne=is,he=!1;let Y;e[15]!==p?(Y=s.jsx(as,{placeholder:"Search or create...",value:p,onValueChange:I,className:"h-9"}),e[15]=p,e[16]=Y):Y=e[16];const ie=ns,me=C.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(Ye,{heading:"Selected",children:C.map(x=>s.jsx(Ze,{onSelect:()=>k(x),className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(gt,{checked:!0,className:"[&_svg]:!text-primary-foreground"}),s.jsx("span",{children:x.name})]}),s.jsx("button",{onClick:se=>{se.stopPropagation(),c(x.id)},className:"opacity-50 hover:opacity-100",disabled:h,children:s.jsx(Tt,{size:14})})]})},x.id))}),s.jsx(xt,{})]}),Pe=Ye,ge="Available",Ee=A.length===0&&!w&&s.jsx(ss,{children:"No tags found."}),ue=A.filter(x=>!S.includes(x.id)).map(x=>s.jsx(Ze,{onSelect:()=>k(x),className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(gt,{checked:!1,className:"[&_svg]:!text-primary-foreground"}),s.jsx("span",{children:x.name})]})},x.id));let ae;e[17]!==Pe||e[18]!==Ee||e[19]!==ue?(ae=s.jsxs(Pe,{heading:ge,children:[Ee,ue]}),e[17]=Pe,e[18]=Ee,e[19]=ue,e[20]=ae):ae=e[20];let le;e[21]!==_||e[22]!==h||e[23]!==p||e[24]!==w?(le=w&&s.jsxs(s.Fragment,{children:[s.jsx(xt,{}),s.jsx(Ye,{children:s.jsx(Ze,{onSelect:_,className:"cursor-pointer",disabled:h,children:s.jsxs("div",{className:"flex items-center gap-2 text-primary",children:[h?s.jsx(Xe,{size:14,className:"animate-spin"}):s.jsx(ms,{size:14}),s.jsxs("span",{children:['Create "',p.trim(),'"']})]})})})]}),e[21]=_,e[22]=h,e[23]=p,e[24]=w,e[25]=le):le=e[25];let Z;e[26]!==ie||e[27]!==me||e[28]!==ae||e[29]!==le?(Z=s.jsxs(ie,{children:[me,ae,le]}),e[26]=ie,e[27]=me,e[28]=ae,e[29]=le,e[30]=Z):Z=e[30];let X;e[31]!==ne||e[32]!==Y||e[33]!==Z?(X=s.jsxs(ne,{shouldFilter:he,children:[Y,Z]}),e[31]=ne,e[32]=Y,e[33]=Z,e[34]=X):X=e[34];let ee;e[35]!==G||e[36]!==W||e[37]!==X?(ee=s.jsx(G,{className:J,align:H,onEscapeKeyDown:W,children:X}),e[35]=G,e[36]=W,e[37]=X,e[38]=ee):ee=e[38];let te;return e[39]!==L||e[40]!==g||e[41]!==F||e[42]!==ee?(te=s.jsxs(L,{open:g,onOpenChange:b,children:[F,ee]}),e[39]=L,e[40]=g,e[41]=F,e[42]=ee,e[43]=te):te=e[43],te}function ys(t){return s.jsx(Ge,{variant:"secondary",className:"text-xs px-1.5 py-0 h-5",children:t.name},t.id)}function Ss(t){return t.id}const bt=["bg-neutral-400","bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500","bg-slate-500"],Ns={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function ws(t){const e=new Map;for(const[n,l]of Object.entries(Ns))e.set(n,l);for(let n=0;n<t.length;n++){const l=t[n];l&&!e.has(l.role)&&e.set(l.role,bt[n%bt.length]??"bg-neutral-400")}return e}function Ke(t){const e=U.c(79),{role:n,memberId:l,isOwner:i,roleColorMap:a,selectableRoles:o,onRoleChange:r,size:u,className:f}=t,g=u===void 0?"xs":u;let b,p,I,M,j,D,v,$,C,E,N;if(e[0]!==f||e[1]!==i||e[2]!==l||e[3]!==r||e[4]!==n||e[5]!==a||e[6]!==o||e[7]!==g){N=Symbol.for("react.early_return_sentinel");e:{const _=a.get(n)??"bg-neutral-400";if(i){let c;e[19]!==l||e[20]!==r?(c=J=>r(l,J),e[19]=l,e[20]=r,e[21]=c):c=e[21];let h;e[22]!==n?(h=s.jsx("span",{className:"capitalize truncate",children:n}),e[22]=n,e[23]=h):h=e[23];const L=s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx("div",{className:ke("size-2 rounded-full shrink-0",_)}),h]});let P;e[24]!==L?(P=s.jsx(dt,{children:L}),e[24]=L,e[25]=P):P=e[25];let O;e[26]!==f||e[27]!==g||e[28]!==P?(O=s.jsx(ut,{size:g,className:f,children:P}),e[26]=f,e[27]=g,e[28]=P,e[29]=O):O=e[29];let V;if(e[30]!==a||e[31]!==o){let J;e[33]!==a?(J=H=>{const W=a.get(H.role)??"bg-neutral-400";return s.jsx(ft,{value:H.role,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:ke("size-3 rounded-full",W)}),s.jsx("span",{className:"capitalize",children:H.label})]})},H.role)},e[33]=a,e[34]=J):J=e[34],V=o.map(J),e[30]=a,e[31]=o,e[32]=V}else V=e[32];let q;e[35]!==V?(q=s.jsx(pt,{children:V}),e[35]=V,e[36]=q):q=e[36];let Q;e[37]!==i||e[38]!==n||e[39]!==c||e[40]!==O||e[41]!==q?(Q=s.jsx(Vt,{asChild:!0,children:s.jsx("div",{className:"w-fit",children:s.jsxs(ht,{value:n,onValueChange:c,disabled:i,children:[O,q]})})}),e[37]=i,e[38]=n,e[39]=c,e[40]=O,e[41]=q,e[42]=Q):Q=e[42];let F;e[43]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(Qt,{children:s.jsx("p",{children:"The owner role cannot be changed"})}),e[43]=F):F=e[43];let G;e[44]!==Q?(G=s.jsx(Gt,{children:s.jsxs(Ut,{children:[Q,F]})}),e[44]=Q,e[45]=G):G=e[45],N=G;break e}I=ht,$=n,e[46]!==l||e[47]!==r?(C=c=>r(l,c),e[46]=l,e[47]=r,e[48]=C):C=e[48],E=i,p=ut,D=g,v=f,b=dt,j="flex items-center gap-2 min-w-0",M=ke("size-2 rounded-full shrink-0",_)}e[0]=f,e[1]=i,e[2]=l,e[3]=r,e[4]=n,e[5]=a,e[6]=o,e[7]=g,e[8]=b,e[9]=p,e[10]=I,e[11]=M,e[12]=j,e[13]=D,e[14]=v,e[15]=$,e[16]=C,e[17]=E,e[18]=N}else b=e[8],p=e[9],I=e[10],M=e[11],j=e[12],D=e[13],v=e[14],$=e[15],C=e[16],E=e[17],N=e[18];if(N!==Symbol.for("react.early_return_sentinel"))return N;let R;e[49]!==M?(R=s.jsx("div",{className:M}),e[49]=M,e[50]=R):R=e[50];let S;e[51]!==n?(S=s.jsx("span",{className:"capitalize truncate",children:n}),e[51]=n,e[52]=S):S=e[52];let z;e[53]!==R||e[54]!==S||e[55]!==j?(z=s.jsxs("div",{className:j,children:[R,S]}),e[53]=R,e[54]=S,e[55]=j,e[56]=z):z=e[56];let A;e[57]!==b||e[58]!==z?(A=s.jsx(b,{children:z}),e[57]=b,e[58]=z,e[59]=A):A=e[59];let y;e[60]!==p||e[61]!==A||e[62]!==D||e[63]!==v?(y=s.jsx(p,{size:D,className:v,children:A}),e[60]=p,e[61]=A,e[62]=D,e[63]=v,e[64]=y):y=e[64];let K;if(e[65]!==a||e[66]!==o){let _;e[68]!==a?(_=c=>{const h=a.get(c.role)??"bg-neutral-400";return s.jsx(ft,{value:c.role,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:ke("size-3 rounded-full",h)}),s.jsx("span",{className:"capitalize",children:c.label})]})},c.role)},e[68]=a,e[69]=_):_=e[69],K=o.map(_),e[65]=a,e[66]=o,e[67]=K}else K=e[67];let w;e[70]!==K?(w=s.jsx(pt,{children:K}),e[70]=K,e[71]=w):w=e[71];let k;return e[72]!==I||e[73]!==y||e[74]!==w||e[75]!==$||e[76]!==C||e[77]!==E?(k=s.jsxs(I,{value:$,onValueChange:C,disabled:E,children:[y,w]}),e[72]=I,e[73]=y,e[74]=w,e[75]=$,e[76]=C,e[77]=E,e[78]=k):k=e[78],k}function jt(t){const e=U.c(51),{member:n,roles:l,onChangeRole:i,onRemove:a,isUpdating:o}=t,r=o===void 0?!1:o,u=n.role==="owner";let f,g,b,p,I,M,j,D,v;if(e[0]!==u||e[1]!==r||e[2]!==n.id||e[3]!==n.role||e[4]!==i||e[5]!==l){let y;e[15]!==n.role?(y=c=>c.role!==n.role&&c.role!=="owner",e[15]=n.role,e[16]=y):y=e[16];const K=l.filter(y);p=St;let w;e[17]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(_t,{size:20}),e[17]=w):w=e[17],e[18]!==u?(v=s.jsx(Nt,{asChild:!0,children:s.jsx(ze,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",disabled:u,onClick:Ts,children:w})}),e[18]=u,e[19]=v):v=e[19],b=wt,j="end",D=_s,g=Jt;let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(es,{size:16}),e[20]=k):k=e[20],e[21]!==r?(M=s.jsxs(Ht,{disabled:r,children:[k,"Change Role"]}),e[21]=r,e[22]=M):M=e[22],f=Wt;let _;e[23]!==r||e[24]!==n.id||e[25]!==i?(_=c=>{const h=[];return c.isBuiltin||(c.allowsAllStaticPermissions?h.push("Full org access"):c.staticPermissionCount&&c.staticPermissionCount>0&&h.push(`${c.staticPermissionCount} org perm${c.staticPermissionCount!==1?"s":""}`),c.allowsAllConnections?h.push("All connections"):c.connectionCount&&c.connectionCount>0&&h.push(`${c.connectionCount} connection${c.connectionCount!==1?"s":""}`),(c.connectionCount!==0||c.allowsAllConnections)&&(c.allowsAllTools?h.push("all tools"):c.toolCount&&c.toolCount>0&&h.push(`${c.toolCount} tool${c.toolCount!==1?"s":""}`))),s.jsxs(et,{onClick:L=>{L.stopPropagation(),i(n.id,c.role)},disabled:r,children:[c.isBuiltin?s.jsx(Xt,{size:16}):s.jsx(Zt,{size:16}),s.jsxs("span",{className:"flex flex-col",children:[s.jsx("span",{children:c.label}),!c.isBuiltin&&h.length>0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:h.join(", ")})]})]},c.role)},e[23]=r,e[24]=n.id,e[25]=i,e[26]=_):_=e[26],I=K.map(_),e[0]=u,e[1]=r,e[2]=n.id,e[3]=n.role,e[4]=i,e[5]=l,e[6]=f,e[7]=g,e[8]=b,e[9]=p,e[10]=I,e[11]=M,e[12]=j,e[13]=D,e[14]=v}else f=e[6],g=e[7],b=e[8],p=e[9],I=e[10],M=e[11],j=e[12],D=e[13],v=e[14];let $;e[27]!==f||e[28]!==I?($=s.jsx(f,{children:I}),e[27]=f,e[28]=I,e[29]=$):$=e[29];let C;e[30]!==g||e[31]!==M||e[32]!==$?(C=s.jsxs(g,{children:[M,$]}),e[30]=g,e[31]=M,e[32]=$,e[33]=C):C=e[33];let E;e[34]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(Yt,{}),e[34]=E):E=e[34];let N;e[35]!==n.id||e[36]!==a?(N=y=>{y.stopPropagation(),a(n.id)},e[35]=n.id,e[36]=a,e[37]=N):N=e[37];let R;e[38]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(ts,{size:16}),e[38]=R):R=e[38];let S;e[39]!==N?(S=s.jsxs(et,{variant:"destructive",onClick:N,children:[R,"Remove Member"]}),e[39]=N,e[40]=S):S=e[40];let z;e[41]!==b||e[42]!==S||e[43]!==j||e[44]!==D||e[45]!==C?(z=s.jsxs(b,{align:j,onClick:D,children:[C,E,S]}),e[41]=b,e[42]=S,e[43]=j,e[44]=D,e[45]=C,e[46]=z):z=e[46];let A;return e[47]!==p||e[48]!==z||e[49]!==v?(A=s.jsxs(p,{children:[v,z]}),e[47]=p,e[48]=z,e[49]=v,e[50]=A):A=e[50],A}function _s(t){return t.stopPropagation()}function Ts(t){return t.stopPropagation()}function vt(t){const e=U.c(8),{invitationId:n,onCancel:l,isCancelling:i}=t,a=i===void 0?!1:i;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Nt,{asChild:!0,children:s.jsx(ze,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:As,children:s.jsx(_t,{size:20})})}),e[0]=o):o=e[0];let r;e[1]!==n||e[2]!==l?(r=g=>{g.stopPropagation(),l(n)},e[1]=n,e[2]=l,e[3]=r):r=e[3];let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Tt,{size:16}),e[4]=u):u=e[4];let f;return e[5]!==a||e[6]!==r?(f=s.jsxs(St,{children:[o,s.jsx(wt,{align:"end",onClick:Is,children:s.jsxs(et,{variant:"destructive",onClick:r,disabled:a,children:[u,"Cancel Invitation"]})})]}),e[5]=a,e[6]=r,e[7]=f):f=e[7],f}function Is(t){return t.stopPropagation()}function As(t){return t.stopPropagation()}function Ms(){const t=U.c(103),{data:e}=Bt(),{data:n}=fs(),l=ps(),i=Qe(),{locator:a}=pe(),o=yt(),[r,u]=re.useState(null),[f,g]=re.useState(null),[b,p]=re.useState(""),[I,M]=re.useState("table"),[j,D]=re.useState("member"),[v,$]=re.useState("asc"),C=e?.data?.members;let E;t[0]!==j?(E=m=>{j===m?$(Fs):(D(m),$("asc"))},t[0]=j,t[1]=E):E=t[1];const N=E;let R=C??[],S=n??[];if(b){const m=b.toLowerCase();R=R.filter(d=>d.user?.name?.toLowerCase().includes(m)||d.user?.email?.toLowerCase().includes(m)||d.role?.toLowerCase().includes(m)),S=S.filter(d=>d.email?.toLowerCase().includes(m)||d.role?.toLowerCase().includes(m))}if(j&&v){let m;t[2]!==v||t[3]!==j?(m=(d,T)=>{let B,de;e:switch(j){case"member":{B=d.user?.name||"",de=T.user?.name||"";break e}case"role":{B=d.role||"",de=T.role||"";break e}case"joined":{B=d.createdAt?typeof d.createdAt=="string"?d.createdAt:d.createdAt.toISOString():"",de=T.createdAt?typeof T.createdAt=="string"?T.createdAt:T.createdAt.toISOString():"";break e}default:return 0}return v==="asc"?B.localeCompare(de):de.localeCompare(B)},t[2]=v,t[3]=j,t[4]=m):m=t[4],R=[...R].sort(m)}const z=R;let A;t[5]!==o?(A=async m=>{const d=await o.organization.removeMember({memberIdOrEmail:m});if(d?.error)throw new Error(d.error.message)},t[5]=o,t[6]=A):A=t[6];let y;t[7]!==a||t[8]!==i?(y=()=>{Re("member_removed"),i.invalidateQueries({queryKey:ce.members(a)}),oe.success("Member has been removed from the organization"),u(null)},t[7]=a,t[8]=i,t[9]=y):y=t[9];let K;t[10]!==A||t[11]!==y?(K={mutationFn:A,onSuccess:y,onError:Ls},t[10]=A,t[11]=y,t[12]=K):K=t[12];const w=Me(K);let k;t[13]!==o?(k=async m=>{const{memberId:d,role:T}=m,B=await o.organization.updateMemberRole({memberId:d,role:[T]});if(B?.error)throw new Error(B.error.message)},t[13]=o,t[14]=k):k=t[14];let _;t[15]!==a||t[16]!==i?(_=(m,d)=>{Re("member_role_updated",{new_role:d.role}),i.invalidateQueries({queryKey:ce.members(a)}),oe.success("Member's role has been updated")},t[15]=a,t[16]=i,t[17]=_):_=t[17];let c;t[18]!==k||t[19]!==_?(c={mutationFn:k,onSuccess:_,onError:qs},t[18]=k,t[19]=_,t[20]=c):c=t[20];const h=Me(c);let L;t[21]!==o?(L=async m=>{const{invitationId:d,role:T,email:B}=m,de=await o.organization.cancelInvitation({invitationId:d});if(de?.error)throw new Error(de.error.message);const tt=await o.organization.inviteMember({email:B,role:T});if(tt?.error)throw new Error(tt.error.message)},t[21]=o,t[22]=L):L=t[22];let P;t[23]!==a||t[24]!==i?(P=(m,d)=>{Re("invitation_role_updated",{new_role:d.role}),i.invalidateQueries({queryKey:ce.invitations(a)}),oe.success("Invitation role has been updated")},t[23]=a,t[24]=i,t[25]=P):P=t[25];let O;t[26]!==L||t[27]!==P?(O={mutationFn:L,onSuccess:P,onError:Os},t[26]=L,t[27]=P,t[28]=O):O=t[28];const V=Me(O),{roles:q,customRoles:Q}=Kt();let F;t[29]!==Q?(F=ws(Q),t[29]=Q,t[30]=F):F=t[30];const G=F;let J;t[31]!==q?(J=q.filter($s),t[31]=q,t[32]=J):J=t[32];const H=J;let W;t[33]===Symbol.for("react.memo_cache_sentinel")?(W={id:"member",header:"Member",render:Ds,cellClassName:"flex-1 min-w-0",sortable:!0},t[33]=W):W=t[33];let ne;t[34]!==G||t[35]!==H||t[36]!==V||t[37]!==h?(ne={id:"role",header:"Role",render:m=>m.type==="member"?s.jsx(Ke,{role:m.data.role,memberId:m.data.id,isOwner:m.data.role==="owner",roleColorMap:G,selectableRoles:H,onRoleChange:(d,T)=>h.mutate({memberId:d,role:T}),className:"w-36"}):s.jsx(Ke,{role:m.data.role,memberId:m.data.id,isOwner:!1,roleColorMap:G,selectableRoles:H,onRoleChange:(d,T)=>V.mutate({invitationId:d,role:T,email:m.data.email}),className:"w-36"}),cellClassName:"w-36 shrink-0",sortable:!0},t[34]=G,t[35]=H,t[36]=V,t[37]=h,t[38]=ne):ne=t[38];let he,Y;t[39]===Symbol.for("react.memo_cache_sentinel")?(he={id:"tags",header:"Tags",render:ks,cellClassName:"w-40 shrink-0"},Y={id:"joined",header:"Joined",render:Es,cellClassName:"w-48 shrink-0",sortable:!0},t[39]=he,t[40]=Y):(he=t[39],Y=t[40]);let ie;t[41]!==l.cancel.isPending||t[42]!==q||t[43]!==h?(ie={id:"actions",header:"",render:m=>m.type==="member"?s.jsx(jt,{member:m.data,roles:q,onChangeRole:(d,T)=>h.mutate({memberId:d,role:T}),onRemove:u,isUpdating:h.isPending}):s.jsx(vt,{invitationId:m.data.id,onCancel:g,isCancelling:l.cancel.isPending}),cellClassName:"w-12 shrink-0"},t[41]=l.cancel.isPending,t[42]=q,t[43]=h,t[44]=ie):ie=t[44];let me;t[45]!==ne||t[46]!==ie?(me=[W,ne,he,Y,ie],t[45]=ne,t[46]=ie,t[47]=me):me=t[47];const Pe=me;let ge;t[48]===Symbol.for("react.memo_cache_sentinel")?(ge=s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(kt,{trigger:s.jsx(ze,{children:"Invite Member"})})}),t[48]=ge):ge=t[48];const Ee=ge,ue=[...z.map(Ps),...S.filter(zs).map(Rs)],ae=Ae,le=!!f;let Z;t[49]===Symbol.for("react.memo_cache_sentinel")?(Z=()=>g(null),t[49]=Z):Z=t[49];let X;t[50]===Symbol.for("react.memo_cache_sentinel")?(X=s.jsxs(at,{children:[s.jsx(lt,{children:"Cancel Invitation"}),s.jsx(ot,{children:"Are you sure you want to cancel this invitation? The invitee will no longer be able to join the organization with this invitation."})]}),t[50]=X):X=t[50];let ee;t[51]===Symbol.for("react.memo_cache_sentinel")?(ee=s.jsx(rt,{children:"Keep Invitation"}),t[51]=ee):ee=t[51];let te;t[52]!==l.cancel||t[53]!==f?(te=()=>{f&&(l.cancel.mutate(f),g(null))},t[52]=l.cancel,t[53]=f,t[54]=te):te=t[54];let x;t[55]!==l.cancel.isPending||t[56]!==te?(x=s.jsxs(st,{children:[X,s.jsxs(nt,{children:[ee,s.jsx(it,{onClick:te,disabled:l.cancel.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Cancel Invitation"})]})]}),t[55]=l.cancel.isPending,t[56]=te,t[57]=x):x=t[57];let se;t[58]!==le||t[59]!==x?(se=s.jsx(ct,{open:le,onOpenChange:Z,children:x}),t[58]=le,t[59]=x,t[60]=se):se=t[60];const fe=!!r;let xe;t[61]===Symbol.for("react.memo_cache_sentinel")?(xe=()=>u(null),t[61]=xe):xe=t[61];let Oe;t[62]===Symbol.for("react.memo_cache_sentinel")?(Oe=s.jsxs(at,{children:[s.jsx(lt,{children:"Remove Member"}),s.jsx(ot,{children:"Are you sure you want to remove this member from the organization? This action cannot be undone."})]}),t[62]=Oe):Oe=t[62];let qe;t[63]===Symbol.for("react.memo_cache_sentinel")?(qe=s.jsx(rt,{children:"Cancel"}),t[63]=qe):qe=t[63];let be;t[64]!==r||t[65]!==w?(be=()=>r&&w.mutate(r),t[64]=r,t[65]=w,t[66]=be):be=t[66];let je;t[67]!==w.isPending||t[68]!==be?(je=s.jsxs(st,{children:[Oe,s.jsxs(nt,{children:[qe,s.jsx(it,{onClick:be,disabled:w.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]}),t[67]=w.isPending,t[68]=be,t[69]=je):je=t[69];let ve;t[70]!==fe||t[71]!==je?(ve=s.jsx(ct,{open:fe,onOpenChange:xe,children:je}),t[70]=fe,t[71]=je,t[72]=ve):ve=t[72];const Ue=Ae,Je=Ae,At="flex flex-col gap-6";let Ce,ye;t[73]===Symbol.for("react.memo_cache_sentinel")?(Ce=s.jsx(us,{}),ye=s.jsx(Ae.Title,{children:"Members"}),t[73]=Ce,t[74]=ye):(Ce=t[73],ye=t[74]);let Le;t[75]===Symbol.for("react.memo_cache_sentinel")?(Le=m=>{m.key==="Escape"&&(p(""),m.target.blur())},t[75]=Le):Le=t[75];let Se;t[76]!==b?(Se=s.jsx(Pt,{value:b,onChange:p,placeholder:"Search members...",className:"w-full md:w-[375px]",onKeyDown:Le}),t[76]=b,t[77]=Se):Se=t[77];let Fe;t[78]===Symbol.for("react.memo_cache_sentinel")?(Fe=[{id:"member",label:"Name"},{id:"role",label:"Role"},{id:"joined",label:"Joined"}],t[78]=Fe):Fe=t[78];let Ne;t[79]!==N||t[80]!==v||t[81]!==j||t[82]!==I?(Ne=s.jsx(zt,{viewMode:I,onViewModeChange:M,sortKey:j,sortDirection:v,onSort:N,sortOptions:Fe}),t[79]=N,t[80]=v,t[81]=j,t[82]=I,t[83]=Ne):Ne=t[83];let we;t[84]!==Se||t[85]!==Ne?(we=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[Se,Ne]}),Ee]}),t[84]=Se,t[85]=Ne,t[86]=we):we=t[86];const He=I==="cards"?s.jsx("div",{children:ue.length===0?s.jsx(We,{title:"No members found",description:b?`No members match "${b}"`:"Invite members to get started."}):s.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:ue.map(m=>{if(m.type==="invitation")return s.jsxs(mt,{className:"transition-colors relative opacity-75",children:[s.jsx("div",{className:"absolute top-4 right-4 z-10",children:s.jsx(vt,{invitationId:m.data.id,onCancel:g,isCancelling:l.cancel.isPending})}),s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(De,{fallback:Ve(m.data.email),shape:"circle",size:"lg",className:"shrink-0"}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:m.data.email}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(Ge,{variant:"outline",className:"w-fit text-amber-600 border-amber-400",children:"Pending"})}),s.jsx(Ke,{role:m.data.role,memberId:m.data.id,isOwner:!1,roleColorMap:G,selectableRoles:H,onRoleChange:(T,B)=>V.mutate({invitationId:T,role:B,email:m.data.email}),className:"w-fit"})]})]})]},`inv-${m.data.id}`);const d=m.data;return s.jsxs(mt,{className:"transition-colors relative",children:[s.jsx("div",{className:"absolute top-4 right-4 z-10",children:s.jsx(jt,{member:d,roles:q,onChangeRole:(T,B)=>h.mutate({memberId:T,role:B}),onRemove:u,isUpdating:h.isPending})}),s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(De,{url:d.user?.image??void 0,fallback:Ve(d.user?.name),shape:"circle",size:"lg",className:"shrink-0"}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:d.user?.name||"Unknown"}),s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:d.user?.email}),s.jsx(Ke,{role:d.role,memberId:d.id,isOwner:d.role==="owner",roleColorMap:G,selectableRoles:H,onRoleChange:(T,B)=>h.mutate({memberId:T,role:B}),className:"w-fit"}),s.jsx(It,{memberId:d.id,maxDisplay:3})]})]})]},d.id)})})}):s.jsx(Et,{columns:Pe,data:ue,isLoading:!1,sortKey:j,sortDirection:v,onSort:N,emptyState:b?s.jsx(We,{title:"No members found",description:`No members match "${b}"`}):s.jsx(We,{title:"No members found",description:"Invite members to get started."})});let _e;t[87]!==Ce||t[88]!==ye||t[89]!==we||t[90]!==He?(_e=s.jsxs("div",{className:At,children:[Ce,ye,we,He]}),t[87]=Ce,t[88]=ye,t[89]=we,t[90]=He,t[91]=_e):_e=t[91];let Te;t[92]!==Je.Body||t[93]!==_e?(Te=s.jsx(Je.Body,{children:_e}),t[92]=Je.Body,t[93]=_e,t[94]=Te):Te=t[94];let Ie;t[95]!==Ue.Content||t[96]!==Te?(Ie=s.jsx(Ue.Content,{children:Te}),t[95]=Ue.Content,t[96]=Te,t[97]=Ie):Ie=t[97];let Be;return t[98]!==ae||t[99]!==se||t[100]!==ve||t[101]!==Ie?(Be=s.jsxs(ae,{children:[se,ve,Ie]}),t[98]=ae,t[99]=se,t[100]=ve,t[101]=Ie,t[102]=Be):Be=t[102],Be}function Rs(t){return{type:"invitation",data:t}}function zs(t){return t.status==="pending"}function Ps(t){return{type:"member",data:t}}function Es(t){return t.type==="member"?s.jsx("span",{className:"text-sm text-foreground",children:t.data.createdAt?Ft(t.data.createdAt):"N/A"}):s.jsx(Ge,{variant:"outline",children:"Pending"})}function ks(t){return t.type==="member"?s.jsx(It,{memberId:t.data.id,maxDisplay:2}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"-"})}function Ds(t){return t.type==="member"?s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(De,{url:t.data.user?.image??void 0,fallback:Ve(t.data.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:t.data.user?.name||"Unknown"}),s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:t.data.user?.email})]})]}):s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(De,{fallback:Ve(t.data.email),shape:"circle",size:"sm"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:t.data.email}),s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:"Invitation sent"})]})]})}function $s(t){return t.role!=="owner"}function Os(t,e){Re("invitation_role_update_failed",{new_role:e.role,error:t instanceof Error?t.message:String(t)}),oe.error(t instanceof Error?t.message:"Failed to update invitation role")}function qs(t,e){Re("member_role_update_failed",{new_role:e.role,error:t instanceof Error?t.message:String(t)}),oe.error(t instanceof Error?t.message:"Failed to update role")}function Ls(t){Re("member_remove_failed",{error:t instanceof Error?t.message:String(t)}),oe.error(t instanceof Error?t.message:"Failed to remove member")}function Fs(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Bs(){const t=U.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Ae,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:"Failed to load members"})})}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Rt,{fallback:e,children:s.jsx(re.Suspense,{fallback:s.jsx(Ae,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Xe,{size:32,className:"animate-spin text-muted-foreground"})})}),children:s.jsx(Ms,{})})}),t[1]=n):n=t[1],n}function Jn(){const t=U.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ds,{capability:"members:manage",area:"members",children:s.jsx(Bs,{})}),t[0]=e):e=t[0],e}export{Jn as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as D,j as p,r as d,aX as O}from"./index-
|
|
1
|
+
import{c as D,j as p,r as d,aX as O}from"./index-C5JCmVQ0.js";import{l as I,F as L}from"./index-B8Idfh3P.js";import{S as N}from"./chat-context-BhPkOl45.js";import{d as K}from"./delay-CnY5UFtP.js";function C(t){return Math.ceil(t.length*3/4)}function Y(t){const e=[];for(const r of t)switch(r.type){case"text":r.text?.trim()&&e.push({type:"paragraph",content:[{type:"text",text:r.text}]});break;case"image":case"audio":r.data&&r.mimeType&&e.push({type:"paragraph",content:[{type:"file",attrs:{id:crypto.randomUUID(),name:`${r.type}.${r.mimeType.split("/")[1]??"bin"}`,mimeType:r.mimeType,size:C(r.data),data:r.data}}]});break;case"resource":{const n=r.resource;"text"in n&&n.text?e.push({type:"paragraph",content:[{type:"text",text:n.text}]}):"blob"in n&&n.blob&&e.push({type:"paragraph",content:[{type:"file",attrs:{id:crypto.randomUUID(),name:String(n.uri),mimeType:n.mimeType??"application/octet-stream",size:C(n.blob),data:n.blob}}]});break}case"resource_link":e.push({type:"paragraph",content:[{type:"text",text:r.name??r.uri}]});break}return{type:"doc",content:e}}async function z(t){const e=t.getModel();if(!e)throw new Error("[Monaco] No model found in editor");const r=e.getValue(),i=r.replace(/export default (async )?function/,"export default $1function __default")+`
|
|
2
2
|
type __ExpandRecursively<T> = T extends (...args: infer A) => infer R
|
|
3
3
|
? (...args: __ExpandRecursively<A>) => __ExpandRecursively<R>
|
|
4
4
|
: T extends object
|
package/dist/client/assets/{monitoring-stats-row-BOve2eh4.js → monitoring-stats-row-D0csDfCQ.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as d,bB as me,bx as Gr,c as cr,l as st,j as w}from"./index-
|
|
1
|
+
import{r as d,bB as me,bx as Gr,c as cr,l as st,j as w}from"./index-C5JCmVQ0.js";import{w as Yr,e as Ae,s as fe,i as V,f as ur,r as ye,h as at,j as fr,J as nt,k as D,m as _,n as ue,o as we,p as Se,q as re,R as ct,L as de,t as Hr,v as Oe,x as Vr,y as qr,z as Ur,B as Zr,D as Le,E as He,F as Xr,G as Jr,H as Qr,I as ea,K as Ne,M as ze,N as q,O as ut,P as ft,Z as Ke,Q as dr,S as vr,T as pr,U as xe,V as mr,W as te,Y as ta,_ as yr,$ as he,a0 as ra,a1 as ie,a2 as ve,a3 as oe,a4 as pe,a5 as hr,a6 as gr,a7 as br,a8 as aa,a9 as na,aa as dt,ab as ia,ac as vt,ad as oa,ae as la,af as sa,ag as ca,ah as ua,ai as xr,aj as fa,ak as da,al as va,am as pa,an as ma,ao as Or,ap as ya,aq as Pr,ar as ha,as as jr,at as ga,au as ba,av as pt,aw as xa,ax as Oa,ay as Pa,az as ja,aA as $,aB as Aa,aC as ka,aD as Ia,aE as wa,aF as Sa,aG as Ea,aH as Ta,aI as Ca,aJ as Da,aK as Ma,aL as Ba,aM as $a,aN as _a,aO as La,aP as Na,X as mt,C as yt,A as za,b as Ka,c as ht}from"./AreaChart-CRvFGO5O.js";const Ar=Math.cos,Ee=Math.sin,U=Math.sqrt,Te=Math.PI,We=2*Te,it={draw(t,e){const r=U(e/Te);t.moveTo(r,0),t.arc(0,0,r,0,We)}},Wa={draw(t,e){const r=U(e/5)/2;t.moveTo(-3*r,-r),t.lineTo(-r,-r),t.lineTo(-r,-3*r),t.lineTo(r,-3*r),t.lineTo(r,-r),t.lineTo(3*r,-r),t.lineTo(3*r,r),t.lineTo(r,r),t.lineTo(r,3*r),t.lineTo(-r,3*r),t.lineTo(-r,r),t.lineTo(-3*r,r),t.closePath()}},kr=U(1/3),Ra=kr*2,Fa={draw(t,e){const r=U(e/Ra),a=r*kr;t.moveTo(0,-r),t.lineTo(a,0),t.lineTo(0,r),t.lineTo(-a,0),t.closePath()}},Ga={draw(t,e){const r=U(e),a=-r/2;t.rect(a,a,r,r)}},Ya=.8908130915292852,Ir=Ee(Te/10)/Ee(7*Te/10),Ha=Ee(We/10)*Ir,Va=-Ar(We/10)*Ir,qa={draw(t,e){const r=U(e*Ya),a=Ha*r,n=Va*r;t.moveTo(0,-r),t.lineTo(a,n);for(let i=1;i<5;++i){const l=We*i/5,f=Ar(l),o=Ee(l);t.lineTo(o*r,-f*r),t.lineTo(f*a-o*n,o*a+f*n)}t.closePath()}},Fe=U(3),Ua={draw(t,e){const r=-U(e/(Fe*3));t.moveTo(0,r*2),t.lineTo(-Fe*r,-r),t.lineTo(Fe*r,-r),t.closePath()}},G=-.5,Y=U(3)/2,Ve=1/U(12),Za=(Ve/2+1)*3,Xa={draw(t,e){const r=U(e/Za),a=r/2,n=r*Ve,i=a,l=r*Ve+r,f=-i,o=l;t.moveTo(a,n),t.lineTo(i,l),t.lineTo(f,o),t.lineTo(G*a-Y*n,Y*a+G*n),t.lineTo(G*i-Y*l,Y*i+G*l),t.lineTo(G*f-Y*o,Y*f+G*o),t.lineTo(G*a+Y*n,G*n-Y*a),t.lineTo(G*i+Y*l,G*l-Y*i),t.lineTo(G*f+Y*o,G*o-Y*f),t.closePath()}};function Ja(t,e){let r=null,a=Yr(n);t=typeof t=="function"?t:Ae(t||it),e=typeof e=="function"?e:Ae(e===void 0?64:+e);function n(){let i;if(r||(r=i=a()),t.apply(this,arguments).draw(r,+e.apply(this,arguments)),i)return r=null,i+""||null}return n.type=function(i){return arguments.length?(t=typeof i=="function"?i:Ae(i),n):t},n.size=function(i){return arguments.length?(e=typeof i=="function"?i:Ae(+i),n):e},n.context=function(i){return arguments.length?(r=i??null,n):r},n}var Qa="Invariant failed";function en(t,e){throw new Error(Qa)}var tn=["type","size","sizeType"];function qe(){return qe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},qe.apply(null,arguments)}function gt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,a)}return r}function bt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?gt(Object(r),!0).forEach(function(a){rn(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):gt(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function rn(t,e,r){return(e=an(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function an(t){var e=nn(t,"string");return typeof e=="symbol"?e:e+""}function nn(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function on(t,e){if(t==null)return{};var r,a,n=ln(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)r=i[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function ln(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}var wr={symbolCircle:it,symbolCross:Wa,symbolDiamond:Fa,symbolSquare:Ga,symbolStar:qa,symbolTriangle:Ua,symbolWye:Xa},sn=Math.PI/180,cn=t=>{var e="symbol".concat(ur(t));return wr[e]||it},un=(t,e,r)=>{if(e==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var a=18*sn;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.tan(a)**2)}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},fn=(t,e)=>{wr["symbol".concat(ur(t))]=e},Sr=t=>{var{type:e="circle",size:r=64,sizeType:a="area"}=t,n=on(t,tn),i=bt(bt({},n),{},{type:e,size:r,sizeType:a}),l="circle";typeof e=="string"&&(l=e);var f=()=>{var v=cn(l),m=Ja().type(v).size(un(r,a,l)),y=m();if(y!==null)return y},{className:o,cx:s,cy:c}=i,u=fe(i);return V(s)&&V(c)&&V(r)?d.createElement("path",qe({},u,{className:me("recharts-symbols",o),transform:"translate(".concat(s,", ").concat(c,")"),d:f()})):null};Sr.registerSymbol=fn;var xt=function(e,r){for(var a=arguments.length,n=new Array(a>2?a-2:0),i=2;i<a;i++)n[i-2]=arguments[i];if(typeof console<"u"&&console.warn&&(r===void 0&&console.warn("LogUtils requires an error message argument"),!e))if(r===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=0;console.warn(r.replace(/%s/g,()=>n[l++]))}},dn=["radius"],vn=["radius"],Ot,Pt,jt,At,kt,It,wt,St,Et,Tt;function Ct(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,a)}return r}function Dt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ct(Object(r),!0).forEach(function(a){pn(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ct(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function pn(t,e,r){return(e=mn(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function mn(t){var e=yn(t,"string");return typeof e=="symbol"?e:e+""}function yn(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ce(){return Ce=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},Ce.apply(null,arguments)}function Mt(t,e){if(t==null)return{};var r,a,n=hn(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)r=i[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function hn(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}function J(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var Bt=(t,e,r,a,n)=>{var i=ue(r),l=ue(a),f=Math.min(Math.abs(i)/2,Math.abs(l)/2),o=l>=0?1:-1,s=i>=0?1:-1,c=l>=0&&i>=0||l<0&&i<0?1:0,u;if(f>0&&Array.isArray(n)){for(var v=[0,0,0,0],m=0,y=4;m<y;m++){var h,b=(h=n[m])!==null&&h!==void 0?h:0;v[m]=b>f?f:b}u=D(Ot||(Ot=J(["M",",",""])),t,e+o*v[0]),v[0]>0&&(u+=D(Pt||(Pt=J(["A ",",",",0,0,",",",",",""])),v[0],v[0],c,t+s*v[0],e)),u+=D(jt||(jt=J(["L ",",",""])),t+r-s*v[1],e),v[1]>0&&(u+=D(At||(At=J(["A ",",",",0,0,",`,
|
|
2
2
|
`,",",""])),v[1],v[1],c,t+r,e+o*v[1])),u+=D(kt||(kt=J(["L ",",",""])),t+r,e+a-o*v[2]),v[2]>0&&(u+=D(It||(It=J(["A ",",",",0,0,",`,
|
|
3
3
|
`,",",""])),v[2],v[2],c,t+r-s*v[2],e+a)),u+=D(wt||(wt=J(["L ",",",""])),t+s*v[3],e+a),v[3]>0&&(u+=D(St||(St=J(["A ",",",",0,0,",`,
|
|
4
4
|
`,",",""])),v[3],v[3],c,t,e+a-o*v[3])),u+="Z"}else if(f>0&&n===+n&&n>0){var p=Math.min(f,n);u=D(Et||(Et=J(["M ",",",`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,j as e,i as n}from"./index-
|
|
1
|
+
import{r,j as e,i as n}from"./index-C5JCmVQ0.js";import{h as l}from"./mcp-oauth-CDqgI2Xn.js";import"./auth-DIzgjm9h.js";function h(){const[s,c]=r.useState(null),[i,a]=r.useState(!1);return r.useEffect(()=>{(async()=>{try{const t=await l();if(!t.success){c(t.error||"MCP authentication failed"),setTimeout(()=>{window.close()},3e3);return}a(!0),setTimeout(()=>{window.close()},1500)}catch(t){c(t instanceof Error?t.message:String(t)),setTimeout(()=>{window.close()},3e3)}})()},[]),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[i&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),!i&&!s&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(n,{size:32,className:"animate-spin text-primary"})}),s&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:s?"Authentication Failed":i?"Authentication Successful":"Authentication in progress..."}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:"An error occurred during authentication:"}),e.jsx("p",{className:"text-destructive",children:s}),e.jsxs("p",{className:"mt-2",children:[e.jsx("br",{}),"This window will close automatically."]})]}):i?e.jsxs("p",{children:["Authentication complete.",e.jsx("br",{}),"This window will close automatically."]}):e.jsx("p",{children:"Processing authentication..."})})]})]})})}export{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,j as e,i as d}from"./index-
|
|
1
|
+
import{r,j as e,i as d}from"./index-C5JCmVQ0.js";function m(){const[s,i]=r.useState("loading"),[o,l]=r.useState(null),c=r.useRef(!1);return c.current||(c.current=!0,queueMicrotask(()=>{try{const t=new URLSearchParams(window.location.search),a=t.get("code"),n=t.get("state");if(!a||!n)throw new Error("Missing code or state parameter");if(window.opener)window.opener.postMessage({type:"AI_PROVIDER_OAUTH_CALLBACK",code:a,stateToken:n},window.location.origin),i("success"),setTimeout(()=>window.close(),1500);else throw new Error("No opener window found")}catch(t){console.error("OAuth callback error:",t),l(t instanceof Error?t.message:String(t)),i("error"),setTimeout(()=>window.close(),3e3)}})),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[s==="success"&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),s==="loading"&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(d,{size:32,className:"animate-spin text-primary"})}),s==="error"&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:s==="error"?"Authentication Failed":s==="success"?"Authentication Successful":"Authentication in progress..."}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s==="error"?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:"An error occurred during authentication:"}),e.jsx("p",{className:"text-destructive",children:o}),e.jsx("p",{className:"mt-2",children:"This window will close automatically."})]}):s==="success"?e.jsx("p",{children:"Authentication complete. This window will close automatically."}):e.jsx("p",{children:"Processing authentication..."})})]})]})})}export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as I,j as t,a as re,i as X,r as O,m as ge,K as pe,d as oe,B as he,l as K,t as ce}from"./index-NdOF7DAS.js";import{R as xe}from"./required-auth-layout-DQknUSbe.js";import{A as G}from"./auth-split-layout-DEZlvBMh.js";import{O as be}from"./organization-choice-CwNef7oe.js";import{A as me}from"./avatar-CBSgn8Tn.js";import{I as je}from"./input-zBZ4DgDP.js";import{L as ye}from"./label-BEAS39uu.js";import{S as ve}from"./switch-CppAT8uS.js";import{t as Ne,a as Se}from"./Users03-C-rX5qrp.js";import{i as we}from"./CheckCircle-DjPfWLKl.js";import{t as ze}from"./Globe04-EItN49Uy.js";import{a as _e}from"./Palette-Td18xlyZ.js";import{i as Ce}from"./Upload01-CszhNxUd.js";import"./User01-C5unDYhX.js";const ke=new Set(["gmail.com","googlemail.com","outlook.com","hotmail.com","live.com","yahoo.com","yahoo.co.uk","icloud.com","me.com","mac.com","aol.com","protonmail.com","proton.me","zoho.com","yandex.com","mail.com","gmx.com","gmx.net","tutanota.com","fastmail.com"]);function se(i){return i.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function Xe(){const i=I.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(xe,{children:t.jsx(Oe,{})}),i[0]=e):e=i[0],e}function ie(i){const e=I.c(13),{title:g,description:r,logoUrl:m,logoFallback:o}=i;let a;e[0]!==o||e[1]!==m?(a=t.jsx("div",{children:m?t.jsx(me,{url:m,fallback:o??"?",shape:"square",size:"base",className:"h-12 w-12"}):t.jsxs(t.Fragment,{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]})}),e[0]=o,e[1]=m,e[2]=a):a=e[2];let l;e[3]!==g?(l=t.jsx("h1",{className:"text-2xl font-medium leading-8",children:g}),e[3]=g,e[4]=l):l=e[4];let n;e[5]!==r?(n=t.jsx("p",{className:"text-base text-muted-foreground leading-6",children:r}),e[5]=r,e[6]=n):n=e[6];let f;e[7]!==l||e[8]!==n?(f=t.jsxs("div",{className:"space-y-2",children:[l,n]}),e[7]=l,e[8]=n,e[9]=f):f=e[9];let s;return e[10]!==a||e[11]!==f?(s=t.jsxs("div",{className:"grid gap-10",children:[a,f]}),e[10]=a,e[11]=f,e[12]=s):s=e[12],s}function Oe(){const i=I.c(4),{data:e,isPending:g}=re.useSession();if(g){let a;return i[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(G,{children:t.jsx("div",{className:"flex items-center gap-2",children:t.jsx(X,{size:14,className:"animate-spin text-muted-foreground"})})}),i[0]=a):a=i[0],a}const r=e?.user?.email??"",m=e?.user?.name;let o;return i[1]!==m||i[2]!==r?(o=t.jsx(Ee,{email:r,userName:m}),i[1]=m,i[2]=r,i[3]=o):o=i[3],o}function Ee(i){const e=I.c(47),{email:g,userName:r}=i;let m,o,a,l,n,f;if(e[0]!==g||e[1]!==r){a=g.split("@")[1]?.toLowerCase()??"",l=!!a&&!ke.has(a);const d=a.split(".")[0]??"";o=d.charAt(0).toUpperCase()+d.slice(1);let u;e[8]!==o||e[9]!==l||e[10]!==r?(u=l?o:r?.split(" ")[0]??"",e[8]=o,e[9]=l,e[10]=r,e[11]=u):u=e[11],m=u,f=ge,n=pe.domainLookup(a),e[0]=g,e[1]=r,e[2]=m,e[3]=o,e[4]=a,e[5]=l,e[6]=n,e[7]=f}else m=e[2],o=e[3],a=e[4],l=e[5],n=e[6],f=e[7];let s;e[12]!==l||e[13]!==n?(s={queryKey:n,queryFn:Re,enabled:l},e[12]=l,e[13]=n,e[14]=s):s=e[14];const{data:y,isLoading:c}=f(s);let v;e[15]===Symbol.for("react.memo_cache_sentinel")?(v=new Set,e[15]=v):v=e[15];const[p,B]=O.useState(v),[E,z]=O.useState(!1);if(c){let d;e[16]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(X,{size:14,className:"animate-spin text-muted-foreground"}),e[16]=d):d=e[16];let u;return e[17]!==a?(u=t.jsx(G,{children:t.jsxs("div",{className:"flex items-center gap-2 py-4",children:[d,t.jsxs("span",{className:"text-sm text-muted-foreground",children:["Checking ",a,"..."]})]})}),e[17]=a,e[18]=u):u=e[18],u}let j,S;e[19]!==y?.organizations?(j=(y?.organizations??[]).flatMap(Pe),S=j.some(Ae),e[19]=y?.organizations,e[20]=j,e[21]=S):(j=e[20],S=e[21]);const L=S;if(E){let d;e[22]!==r?(d=r?.split(" ")[0]??"",e[22]=r,e[23]=d):d=e[23];let u;e[24]===Symbol.for("react.memo_cache_sentinel")?(u=()=>z(!1),e[24]=u):u=e[24];let h;return e[25]!==o||e[26]!==a||e[27]!==l||e[28]!==d?(h=t.jsx(ne,{isCorporateEmail:l,emailDomain:a,domainLabel:o,defaultName:d,allowDomainClaim:!1,onBack:u}),e[25]=o,e[26]=a,e[27]=l,e[28]=d,e[29]=h):h=e[29],h}if(j.length>0){const d=L?j.length===1?"You have access to an organization":"You have access to multiple organizations":"Request access to an organization",u=L?"Your email domain matches an existing organization.":"Your email domain matches an organization that requires admin approval to join.";let h;e[30]!==d||e[31]!==u?(h=t.jsx(ie,{title:d,description:u}),e[30]=d,e[31]=u,e[32]=h):h=e[32];let C;e[33]===Symbol.for("react.memo_cache_sentinel")?(C=Y=>B(A=>new Set(A).add(Y)),e[33]=C):C=e[33];let w;e[34]!==j||e[35]!==a||e[36]!==p?(w=t.jsx(be,{organizations:j,domain:a,requestedSlugs:p,onRequestedSlug:C,onJoined:Le}),e[34]=j,e[35]=a,e[36]=p,e[37]=w):w=e[37];let _;e[38]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:()=>z(!0),children:"Create a new organization instead"}),e[38]=_):_=e[38];let k;return e[39]!==w||e[40]!==h?(k=t.jsx(G,{children:t.jsxs("div",{className:"grid gap-10",children:[h,w,_]})}),e[39]=w,e[40]=h,e[41]=k):k=e[41],k}let b;return e[42]!==m||e[43]!==o||e[44]!==a||e[45]!==l?(b=t.jsx(ne,{isCorporateEmail:l,emailDomain:a,domainLabel:o,defaultName:m}),e[42]=m,e[43]=o,e[44]=a,e[45]=l,e[46]=b):b=e[46],b}function Le(i,e){window.location.href=`/${e}`}function Ae(i){return i.joinMode==="auto"}function Pe(i){return i.joinMode==="auto"||i.joinMode==="request"?[{id:i.id,name:i.name,slug:i.slug,logo:i.logo,joinMode:i.joinMode}]:[]}async function Re(){return(await fetch("/api/auth/custom/domain-lookup",{credentials:"include"})).json()}function ne(i){const e=I.c(70),{isCorporateEmail:g,emailDomain:r,domainLabel:m,defaultName:o,allowDomainClaim:a,onBack:l}=i,n=a===void 0?!0:a,f=g&&n?`https://www.google.com/s2/favicons?domain=${r}&sz=128`:null,[s,y]=O.useState(o),[c,v]=O.useState(f),[p,B]=O.useState(!0),[E,z]=O.useState(null);let j;e[0]!==p||e[1]!==c||e[2]!==s?(j=async()=>{const x=await fetch("/api/auth/custom/domain-setup",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s.trim()||void 0,logo:c??void 0,claimDomain:p})}),N=await x.json();if(!x.ok||!N.success)throw new Error(N.error||"Failed to set up organization");return N},e[0]=p,e[1]=c,e[2]=s,e[3]=j):j=e[3];let S;e[4]!==p?(S=x=>{if(!x.slug)return;const N=de.filter(fe=>p||!fe.claimOnly).length,J=ue*(N-1)+800;z(x.slug),setTimeout(()=>{window.location.href=`/${x.slug}`},J)},e[4]=p,e[5]=S):S=e[5];let L;e[6]!==j||e[7]!==S?(L={mutationFn:j,onSuccess:S},e[6]=j,e[7]=S,e[8]=L):L=e[8];const b=oe(L);let d;e[9]!==c||e[10]!==s?(d={mutationFn:async()=>{const x=s.trim(),N=se(x);if(!N)throw new Error("Invalid organization name");const J=await re.organization.create({name:x,slug:N,...c?{logo:c}:{}});if(J?.error)throw new Error(J.error.message||"Failed to create organization");window.location.href=`/${J?.data?.slug??N}`}},e[9]=c,e[10]=s,e[11]=d):d=e[11];const u=oe(d);if(b.isPending||E){let x;e[12]!==m||e[13]!==s?(x=s.trim()||m,e[12]=m,e[13]=s,e[14]=x):x=e[14];let N;return e[15]!==p||e[16]!==r||e[17]!==c||e[18]!==x?(N=t.jsx(G,{children:t.jsx(Fe,{orgName:x,domain:r,claimDomain:p,logoUrl:c})}),e[15]=p,e[16]=r,e[17]=c,e[18]=x,e[19]=N):N=e[19],N}const h=u.isPending;let C;e[20]!==s?(C=se(s.trim()),e[20]=s,e[21]=C):C=e[21];const w=!!C,_=b.error||u.error||null;let k;e[22]!==n||e[23]!==w||e[24]!==u||e[25]!==b||e[26]!==g?(k=x=>{x.preventDefault(),w&&(g&&n?b.mutate():u.mutate())},e[22]=n,e[23]=w,e[24]=u,e[25]=b,e[26]=g,e[27]=k):k=e[27];const Y=k;let A;e[28]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(ie,{title:"Welcome to deco",description:"Set up your organization to get started"}),e[28]=A):A=e[28];let W;e[29]===Symbol.for("react.memo_cache_sentinel")?(W=t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-sm font-medium",children:"Organization avatar"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Optional"})]}),e[29]=W):W=e[29];let P;e[30]!==o||e[31]!==s?(P=(s.trim()||o||"?").charAt(0).toUpperCase(),e[30]=o,e[31]=s,e[32]=P):P=e[32];const Z=h||b.isPending;let R;e[33]!==c||e[34]!==P||e[35]!==Z?(R=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[W,t.jsx($e,{value:c,fallback:P,onChange:v,disabled:Z})]}),e[33]=c,e[34]=P,e[35]=Z,e[36]=R):R=e[36];let H;e[37]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx(ye,{htmlFor:"org-name",className:"text-sm font-medium shrink-0",children:"Organization name"}),e[37]=H):H=e[37];let Q;e[38]===Symbol.for("react.memo_cache_sentinel")?(Q=x=>y(x.target.value),e[38]=Q):Q=e[38];const ee=o||"My Organization",te=h||b.isPending;let $;e[39]!==s||e[40]!==ee||e[41]!==te?($=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[H,t.jsx(je,{id:"org-name",value:s,onChange:Q,placeholder:ee,disabled:te,className:"h-10 max-w-[220px]"})]}),e[39]=s,e[40]=ee,e[41]=te,e[42]=$):$=e[42];let D;e[43]!==n||e[44]!==p||e[45]!==b.isPending||e[46]!==r||e[47]!==g||e[48]!==h?(D=g&&n&&t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[t.jsxs("div",{className:"space-y-0.5",children:[t.jsxs("p",{className:"text-sm font-medium",children:["Allow @",r," sign-ups"]}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Anyone with a verified @",r," email can join this org"]})]}),t.jsx(ve,{checked:p,onCheckedChange:B,disabled:h||b.isPending})]}),e[43]=n,e[44]=p,e[45]=b.isPending,e[46]=r,e[47]=g,e[48]=h,e[49]=D):D=e[49];let F;e[50]!==R||e[51]!==$||e[52]!==D?(F=t.jsxs("div",{className:"rounded-xl card-shadow bg-background dark:bg-input/30 divide-y divide-border",children:[R,$,D]}),e[50]=R,e[51]=$,e[52]=D,e[53]=F):F=e[53];let M;e[54]!==_?(M=_&&t.jsx("p",{className:"text-xs text-destructive",children:_ instanceof Error?_.message:"Failed to create organization"}),e[54]=_,e[55]=M):M=e[55];const ae=!w||h||b.isPending;let q;e[56]!==b.isPending||e[57]!==h?(q=h||b.isPending?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(X,{size:14,className:"animate-spin"})," Creating..."]}):"Continue",e[56]=b.isPending,e[57]=h,e[58]=q):q=e[58];let U;e[59]!==ae||e[60]!==q?(U=t.jsx(he,{type:"submit",size:"xl",className:"w-full",disabled:ae,children:q}),e[59]=ae,e[60]=q,e[61]=U):U=e[61];let T;e[62]!==l?(T=l&&t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:l,children:"See available organizations"}),e[62]=l,e[63]=T):T=e[63];let V;return e[64]!==Y||e[65]!==F||e[66]!==M||e[67]!==U||e[68]!==T?(V=t.jsx(G,{children:t.jsxs("form",{onSubmit:Y,className:"grid gap-10",children:[A,F,M,U,T]})}),e[64]=Y,e[65]=F,e[66]=M,e[67]=U,e[68]=T,e[69]=V):V=e[69],V}function $e(i){const e=I.c(14),{value:g,fallback:r,onChange:m,disabled:o}=i,a=O.useRef(null);let l;e[0]!==m?(l=B=>{const E=B.target.files?.[0];if(!E)return;if(E.size>2097152){ce.error("Image must be smaller than 2MB"),a.current&&(a.current.value="");return}const z=new FileReader;z.onerror=De,z.onloadend=()=>{z.result&&m(z.result),a.current&&(a.current.value="")},z.readAsDataURL(E)},e[0]=m,e[1]=l):l=e[1];const n=l;let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=()=>a.current?.click(),e[2]=f):f=e[2];let s;e[3]!==o||e[4]!==n?(s=t.jsx("input",{ref:a,type:"file",accept:"image/*",onChange:n,className:"hidden",disabled:o}),e[3]=o,e[4]=n,e[5]=s):s=e[5];const y=g??void 0;let c;e[6]!==r||e[7]!==y?(c=t.jsx(me,{url:y,fallback:r,shape:"square",size:"base"}),e[6]=r,e[7]=y,e[8]=c):c=e[8];let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("span",{className:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(Ce,{size:14,className:"text-white"})}),e[9]=v):v=e[9];let p;return e[10]!==o||e[11]!==s||e[12]!==c?(p=t.jsxs("button",{type:"button",onClick:f,disabled:o,className:"relative rounded-lg overflow-hidden ring-1 ring-border hover:ring-2 hover:ring-ring/40 transition-all disabled:opacity-50 group","aria-label":"Upload organization logo",children:[s,c,v]}),e[10]=o,e[11]=s,e[12]=c,e[13]=p):p=e[13],p}function De(){return ce.error("Failed to read image")}const de=[{icon:Ne,label:"Creating organization",claimOnly:!1},{icon:ze,label:"Claiming email domain",claimOnly:!0},{icon:Se,label:"Enabling auto-join for your team",claimOnly:!0},{icon:_e,label:"Extracting brand context",claimOnly:!1}],ue=1500,le=[{bg:"var(--brand-green-light)",fg:"var(--brand-green-dark)"},{bg:"var(--brand-purple-light)",fg:"var(--brand-purple-dark)"},{bg:"var(--brand-yellow-light)",fg:"var(--brand-yellow-dark)"}];function Fe({orgName:i,domain:e,claimDomain:g,logoUrl:r}){const m=de.filter(n=>g||!n.claimOnly),[o,a]=O.useState(0),l=O.useRef(!1);if(!l.current){l.current=!0;for(let n=1;n<m.length;n++)setTimeout(()=>a(n),ue*n)}return t.jsxs("div",{className:"grid gap-10",children:[t.jsx(ie,{title:`Setting up ${i}`,description:`Getting everything ready from ${e}`,logoUrl:r??null,logoFallback:i.charAt(0).toUpperCase()||"?"}),t.jsx("ul",{className:"grid gap-5",children:m.map((n,f)=>{const s=n.icon,y=f===o,c=f<o,v=le[f%le.length];return t.jsxs("li",{className:"flex items-center gap-4 motion-safe:transition-opacity motion-safe:duration-300 motion-safe:ease-out",style:{opacity:c||y?1:.4},children:[t.jsxs("span",{className:K("relative grid h-8 w-8 shrink-0 place-items-center rounded-lg","motion-safe:transition-colors motion-safe:duration-300",!c&&(y?"bg-muted text-foreground":"bg-muted text-muted-foreground")),style:c?{backgroundColor:v.bg,color:v.fg}:void 0,children:[t.jsx(we,{size:16,className:K("absolute motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out",c?"scale-100 opacity-100":"scale-75 opacity-0"),"aria-hidden":"true"}),t.jsx(X,{size:16,className:K("absolute animate-spin","motion-safe:transition-opacity motion-safe:duration-200",y?"opacity-100":"opacity-0"),"aria-hidden":"true"}),t.jsx(s,{size:16,className:K("absolute motion-safe:transition-opacity motion-safe:duration-200",!c&&!y?"opacity-100":"opacity-0"),"aria-hidden":"true"})]}),t.jsx("span",{className:K("text-base leading-6 motion-safe:transition-colors motion-safe:duration-300",y||c?"text-foreground":"text-muted-foreground"),children:n.label})]},n.label)})})]})}export{Xe as default};
|
|
1
|
+
import{c as I,j as t,a as re,i as X,r as O,m as ge,K as pe,d as oe,B as he,l as K,t as ce}from"./index-C5JCmVQ0.js";import{R as xe}from"./required-auth-layout-BLRuxjNn.js";import{A as G}from"./auth-split-layout-B-Ji1dsx.js";import{O as be}from"./organization-choice-CRDRv9IH.js";import{A as me}from"./avatar-CfHetrJ0.js";import{I as je}from"./input-DWv95vY4.js";import{L as ye}from"./label-CjR-YPrA.js";import{S as ve}from"./switch-DLw5svpB.js";import{t as Ne,a as Se}from"./Users03-ZlQye2vY.js";import{i as we}from"./CheckCircle-Day5nLHt.js";import{t as ze}from"./Globe04-BV89vsfi.js";import{a as _e}from"./Palette-B0oAitOJ.js";import{i as Ce}from"./Upload01-Lp0wJMYr.js";import"./User01-CQV6kRtR.js";const ke=new Set(["gmail.com","googlemail.com","outlook.com","hotmail.com","live.com","yahoo.com","yahoo.co.uk","icloud.com","me.com","mac.com","aol.com","protonmail.com","proton.me","zoho.com","yandex.com","mail.com","gmx.com","gmx.net","tutanota.com","fastmail.com"]);function se(i){return i.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function Xe(){const i=I.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(xe,{children:t.jsx(Oe,{})}),i[0]=e):e=i[0],e}function ie(i){const e=I.c(13),{title:g,description:r,logoUrl:m,logoFallback:o}=i;let a;e[0]!==o||e[1]!==m?(a=t.jsx("div",{children:m?t.jsx(me,{url:m,fallback:o??"?",shape:"square",size:"base",className:"h-12 w-12"}):t.jsxs(t.Fragment,{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]})}),e[0]=o,e[1]=m,e[2]=a):a=e[2];let l;e[3]!==g?(l=t.jsx("h1",{className:"text-2xl font-medium leading-8",children:g}),e[3]=g,e[4]=l):l=e[4];let n;e[5]!==r?(n=t.jsx("p",{className:"text-base text-muted-foreground leading-6",children:r}),e[5]=r,e[6]=n):n=e[6];let f;e[7]!==l||e[8]!==n?(f=t.jsxs("div",{className:"space-y-2",children:[l,n]}),e[7]=l,e[8]=n,e[9]=f):f=e[9];let s;return e[10]!==a||e[11]!==f?(s=t.jsxs("div",{className:"grid gap-10",children:[a,f]}),e[10]=a,e[11]=f,e[12]=s):s=e[12],s}function Oe(){const i=I.c(4),{data:e,isPending:g}=re.useSession();if(g){let a;return i[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(G,{children:t.jsx("div",{className:"flex items-center gap-2",children:t.jsx(X,{size:14,className:"animate-spin text-muted-foreground"})})}),i[0]=a):a=i[0],a}const r=e?.user?.email??"",m=e?.user?.name;let o;return i[1]!==m||i[2]!==r?(o=t.jsx(Ee,{email:r,userName:m}),i[1]=m,i[2]=r,i[3]=o):o=i[3],o}function Ee(i){const e=I.c(47),{email:g,userName:r}=i;let m,o,a,l,n,f;if(e[0]!==g||e[1]!==r){a=g.split("@")[1]?.toLowerCase()??"",l=!!a&&!ke.has(a);const d=a.split(".")[0]??"";o=d.charAt(0).toUpperCase()+d.slice(1);let u;e[8]!==o||e[9]!==l||e[10]!==r?(u=l?o:r?.split(" ")[0]??"",e[8]=o,e[9]=l,e[10]=r,e[11]=u):u=e[11],m=u,f=ge,n=pe.domainLookup(a),e[0]=g,e[1]=r,e[2]=m,e[3]=o,e[4]=a,e[5]=l,e[6]=n,e[7]=f}else m=e[2],o=e[3],a=e[4],l=e[5],n=e[6],f=e[7];let s;e[12]!==l||e[13]!==n?(s={queryKey:n,queryFn:Re,enabled:l},e[12]=l,e[13]=n,e[14]=s):s=e[14];const{data:y,isLoading:c}=f(s);let v;e[15]===Symbol.for("react.memo_cache_sentinel")?(v=new Set,e[15]=v):v=e[15];const[p,B]=O.useState(v),[E,z]=O.useState(!1);if(c){let d;e[16]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(X,{size:14,className:"animate-spin text-muted-foreground"}),e[16]=d):d=e[16];let u;return e[17]!==a?(u=t.jsx(G,{children:t.jsxs("div",{className:"flex items-center gap-2 py-4",children:[d,t.jsxs("span",{className:"text-sm text-muted-foreground",children:["Checking ",a,"..."]})]})}),e[17]=a,e[18]=u):u=e[18],u}let j,S;e[19]!==y?.organizations?(j=(y?.organizations??[]).flatMap(Pe),S=j.some(Ae),e[19]=y?.organizations,e[20]=j,e[21]=S):(j=e[20],S=e[21]);const L=S;if(E){let d;e[22]!==r?(d=r?.split(" ")[0]??"",e[22]=r,e[23]=d):d=e[23];let u;e[24]===Symbol.for("react.memo_cache_sentinel")?(u=()=>z(!1),e[24]=u):u=e[24];let h;return e[25]!==o||e[26]!==a||e[27]!==l||e[28]!==d?(h=t.jsx(ne,{isCorporateEmail:l,emailDomain:a,domainLabel:o,defaultName:d,allowDomainClaim:!1,onBack:u}),e[25]=o,e[26]=a,e[27]=l,e[28]=d,e[29]=h):h=e[29],h}if(j.length>0){const d=L?j.length===1?"You have access to an organization":"You have access to multiple organizations":"Request access to an organization",u=L?"Your email domain matches an existing organization.":"Your email domain matches an organization that requires admin approval to join.";let h;e[30]!==d||e[31]!==u?(h=t.jsx(ie,{title:d,description:u}),e[30]=d,e[31]=u,e[32]=h):h=e[32];let C;e[33]===Symbol.for("react.memo_cache_sentinel")?(C=Y=>B(A=>new Set(A).add(Y)),e[33]=C):C=e[33];let w;e[34]!==j||e[35]!==a||e[36]!==p?(w=t.jsx(be,{organizations:j,domain:a,requestedSlugs:p,onRequestedSlug:C,onJoined:Le}),e[34]=j,e[35]=a,e[36]=p,e[37]=w):w=e[37];let _;e[38]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:()=>z(!0),children:"Create a new organization instead"}),e[38]=_):_=e[38];let k;return e[39]!==w||e[40]!==h?(k=t.jsx(G,{children:t.jsxs("div",{className:"grid gap-10",children:[h,w,_]})}),e[39]=w,e[40]=h,e[41]=k):k=e[41],k}let b;return e[42]!==m||e[43]!==o||e[44]!==a||e[45]!==l?(b=t.jsx(ne,{isCorporateEmail:l,emailDomain:a,domainLabel:o,defaultName:m}),e[42]=m,e[43]=o,e[44]=a,e[45]=l,e[46]=b):b=e[46],b}function Le(i,e){window.location.href=`/${e}`}function Ae(i){return i.joinMode==="auto"}function Pe(i){return i.joinMode==="auto"||i.joinMode==="request"?[{id:i.id,name:i.name,slug:i.slug,logo:i.logo,joinMode:i.joinMode}]:[]}async function Re(){return(await fetch("/api/auth/custom/domain-lookup",{credentials:"include"})).json()}function ne(i){const e=I.c(70),{isCorporateEmail:g,emailDomain:r,domainLabel:m,defaultName:o,allowDomainClaim:a,onBack:l}=i,n=a===void 0?!0:a,f=g&&n?`https://www.google.com/s2/favicons?domain=${r}&sz=128`:null,[s,y]=O.useState(o),[c,v]=O.useState(f),[p,B]=O.useState(!0),[E,z]=O.useState(null);let j;e[0]!==p||e[1]!==c||e[2]!==s?(j=async()=>{const x=await fetch("/api/auth/custom/domain-setup",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s.trim()||void 0,logo:c??void 0,claimDomain:p})}),N=await x.json();if(!x.ok||!N.success)throw new Error(N.error||"Failed to set up organization");return N},e[0]=p,e[1]=c,e[2]=s,e[3]=j):j=e[3];let S;e[4]!==p?(S=x=>{if(!x.slug)return;const N=de.filter(fe=>p||!fe.claimOnly).length,J=ue*(N-1)+800;z(x.slug),setTimeout(()=>{window.location.href=`/${x.slug}`},J)},e[4]=p,e[5]=S):S=e[5];let L;e[6]!==j||e[7]!==S?(L={mutationFn:j,onSuccess:S},e[6]=j,e[7]=S,e[8]=L):L=e[8];const b=oe(L);let d;e[9]!==c||e[10]!==s?(d={mutationFn:async()=>{const x=s.trim(),N=se(x);if(!N)throw new Error("Invalid organization name");const J=await re.organization.create({name:x,slug:N,...c?{logo:c}:{}});if(J?.error)throw new Error(J.error.message||"Failed to create organization");window.location.href=`/${J?.data?.slug??N}`}},e[9]=c,e[10]=s,e[11]=d):d=e[11];const u=oe(d);if(b.isPending||E){let x;e[12]!==m||e[13]!==s?(x=s.trim()||m,e[12]=m,e[13]=s,e[14]=x):x=e[14];let N;return e[15]!==p||e[16]!==r||e[17]!==c||e[18]!==x?(N=t.jsx(G,{children:t.jsx(Fe,{orgName:x,domain:r,claimDomain:p,logoUrl:c})}),e[15]=p,e[16]=r,e[17]=c,e[18]=x,e[19]=N):N=e[19],N}const h=u.isPending;let C;e[20]!==s?(C=se(s.trim()),e[20]=s,e[21]=C):C=e[21];const w=!!C,_=b.error||u.error||null;let k;e[22]!==n||e[23]!==w||e[24]!==u||e[25]!==b||e[26]!==g?(k=x=>{x.preventDefault(),w&&(g&&n?b.mutate():u.mutate())},e[22]=n,e[23]=w,e[24]=u,e[25]=b,e[26]=g,e[27]=k):k=e[27];const Y=k;let A;e[28]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(ie,{title:"Welcome to deco",description:"Set up your organization to get started"}),e[28]=A):A=e[28];let W;e[29]===Symbol.for("react.memo_cache_sentinel")?(W=t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-sm font-medium",children:"Organization avatar"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Optional"})]}),e[29]=W):W=e[29];let P;e[30]!==o||e[31]!==s?(P=(s.trim()||o||"?").charAt(0).toUpperCase(),e[30]=o,e[31]=s,e[32]=P):P=e[32];const Z=h||b.isPending;let R;e[33]!==c||e[34]!==P||e[35]!==Z?(R=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[W,t.jsx($e,{value:c,fallback:P,onChange:v,disabled:Z})]}),e[33]=c,e[34]=P,e[35]=Z,e[36]=R):R=e[36];let H;e[37]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx(ye,{htmlFor:"org-name",className:"text-sm font-medium shrink-0",children:"Organization name"}),e[37]=H):H=e[37];let Q;e[38]===Symbol.for("react.memo_cache_sentinel")?(Q=x=>y(x.target.value),e[38]=Q):Q=e[38];const ee=o||"My Organization",te=h||b.isPending;let $;e[39]!==s||e[40]!==ee||e[41]!==te?($=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[H,t.jsx(je,{id:"org-name",value:s,onChange:Q,placeholder:ee,disabled:te,className:"h-10 max-w-[220px]"})]}),e[39]=s,e[40]=ee,e[41]=te,e[42]=$):$=e[42];let D;e[43]!==n||e[44]!==p||e[45]!==b.isPending||e[46]!==r||e[47]!==g||e[48]!==h?(D=g&&n&&t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[t.jsxs("div",{className:"space-y-0.5",children:[t.jsxs("p",{className:"text-sm font-medium",children:["Allow @",r," sign-ups"]}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Anyone with a verified @",r," email can join this org"]})]}),t.jsx(ve,{checked:p,onCheckedChange:B,disabled:h||b.isPending})]}),e[43]=n,e[44]=p,e[45]=b.isPending,e[46]=r,e[47]=g,e[48]=h,e[49]=D):D=e[49];let F;e[50]!==R||e[51]!==$||e[52]!==D?(F=t.jsxs("div",{className:"rounded-xl card-shadow bg-background dark:bg-input/30 divide-y divide-border",children:[R,$,D]}),e[50]=R,e[51]=$,e[52]=D,e[53]=F):F=e[53];let M;e[54]!==_?(M=_&&t.jsx("p",{className:"text-xs text-destructive",children:_ instanceof Error?_.message:"Failed to create organization"}),e[54]=_,e[55]=M):M=e[55];const ae=!w||h||b.isPending;let q;e[56]!==b.isPending||e[57]!==h?(q=h||b.isPending?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(X,{size:14,className:"animate-spin"})," Creating..."]}):"Continue",e[56]=b.isPending,e[57]=h,e[58]=q):q=e[58];let U;e[59]!==ae||e[60]!==q?(U=t.jsx(he,{type:"submit",size:"xl",className:"w-full",disabled:ae,children:q}),e[59]=ae,e[60]=q,e[61]=U):U=e[61];let T;e[62]!==l?(T=l&&t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:l,children:"See available organizations"}),e[62]=l,e[63]=T):T=e[63];let V;return e[64]!==Y||e[65]!==F||e[66]!==M||e[67]!==U||e[68]!==T?(V=t.jsx(G,{children:t.jsxs("form",{onSubmit:Y,className:"grid gap-10",children:[A,F,M,U,T]})}),e[64]=Y,e[65]=F,e[66]=M,e[67]=U,e[68]=T,e[69]=V):V=e[69],V}function $e(i){const e=I.c(14),{value:g,fallback:r,onChange:m,disabled:o}=i,a=O.useRef(null);let l;e[0]!==m?(l=B=>{const E=B.target.files?.[0];if(!E)return;if(E.size>2097152){ce.error("Image must be smaller than 2MB"),a.current&&(a.current.value="");return}const z=new FileReader;z.onerror=De,z.onloadend=()=>{z.result&&m(z.result),a.current&&(a.current.value="")},z.readAsDataURL(E)},e[0]=m,e[1]=l):l=e[1];const n=l;let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=()=>a.current?.click(),e[2]=f):f=e[2];let s;e[3]!==o||e[4]!==n?(s=t.jsx("input",{ref:a,type:"file",accept:"image/*",onChange:n,className:"hidden",disabled:o}),e[3]=o,e[4]=n,e[5]=s):s=e[5];const y=g??void 0;let c;e[6]!==r||e[7]!==y?(c=t.jsx(me,{url:y,fallback:r,shape:"square",size:"base"}),e[6]=r,e[7]=y,e[8]=c):c=e[8];let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("span",{className:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(Ce,{size:14,className:"text-white"})}),e[9]=v):v=e[9];let p;return e[10]!==o||e[11]!==s||e[12]!==c?(p=t.jsxs("button",{type:"button",onClick:f,disabled:o,className:"relative rounded-lg overflow-hidden ring-1 ring-border hover:ring-2 hover:ring-ring/40 transition-all disabled:opacity-50 group","aria-label":"Upload organization logo",children:[s,c,v]}),e[10]=o,e[11]=s,e[12]=c,e[13]=p):p=e[13],p}function De(){return ce.error("Failed to read image")}const de=[{icon:Ne,label:"Creating organization",claimOnly:!1},{icon:ze,label:"Claiming email domain",claimOnly:!0},{icon:Se,label:"Enabling auto-join for your team",claimOnly:!0},{icon:_e,label:"Extracting brand context",claimOnly:!1}],ue=1500,le=[{bg:"var(--brand-green-light)",fg:"var(--brand-green-dark)"},{bg:"var(--brand-purple-light)",fg:"var(--brand-purple-dark)"},{bg:"var(--brand-yellow-light)",fg:"var(--brand-yellow-dark)"}];function Fe({orgName:i,domain:e,claimDomain:g,logoUrl:r}){const m=de.filter(n=>g||!n.claimOnly),[o,a]=O.useState(0),l=O.useRef(!1);if(!l.current){l.current=!0;for(let n=1;n<m.length;n++)setTimeout(()=>a(n),ue*n)}return t.jsxs("div",{className:"grid gap-10",children:[t.jsx(ie,{title:`Setting up ${i}`,description:`Getting everything ready from ${e}`,logoUrl:r??null,logoFallback:i.charAt(0).toUpperCase()||"?"}),t.jsx("ul",{className:"grid gap-5",children:m.map((n,f)=>{const s=n.icon,y=f===o,c=f<o,v=le[f%le.length];return t.jsxs("li",{className:"flex items-center gap-4 motion-safe:transition-opacity motion-safe:duration-300 motion-safe:ease-out",style:{opacity:c||y?1:.4},children:[t.jsxs("span",{className:K("relative grid h-8 w-8 shrink-0 place-items-center rounded-lg","motion-safe:transition-colors motion-safe:duration-300",!c&&(y?"bg-muted text-foreground":"bg-muted text-muted-foreground")),style:c?{backgroundColor:v.bg,color:v.fg}:void 0,children:[t.jsx(we,{size:16,className:K("absolute motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out",c?"scale-100 opacity-100":"scale-75 opacity-0"),"aria-hidden":"true"}),t.jsx(X,{size:16,className:K("absolute animate-spin","motion-safe:transition-opacity motion-safe:duration-200",y?"opacity-100":"opacity-0"),"aria-hidden":"true"}),t.jsx(s,{size:16,className:K("absolute motion-safe:transition-opacity motion-safe:duration-200",!c&&!y?"opacity-100":"opacity-0"),"aria-hidden":"true"})]}),t.jsx("span",{className:K("text-base leading-6 motion-safe:transition-colors motion-safe:duration-300",y||c?"text-foreground":"text-muted-foreground"),children:n.label})]},n.label)})})]})}export{Xe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as k,r as z,b1 as S,e as _,q as E,b2 as T,j as o,L as $}from"./index-
|
|
1
|
+
import{c as k,r as z,b1 as S,e as _,q as E,b2 as T,j as o,L as $}from"./index-C5JCmVQ0.js";const L="#f6f4ed",P="#ffffff",H=[{src:"/icons/icon-192.png",sizes:"192x192",type:"image/png"},{src:"/icons/icon-512.png",sizes:"512x512",type:"image/png"}];function R(e,n){const t=`${n}/${e.slug}`,i=[...e.logo?[{src:e.logo,sizes:"192x192",purpose:"any"},{src:e.logo,sizes:"512x512",purpose:"any"},{src:e.logo,sizes:"any",purpose:"any"}]:[],...H],l={id:t,name:e.name,short_name:e.name,start_url:t,scope:t,display:"standalone",display_override:["window-controls-overlay"],background_color:P,theme_color:L,icons:i};return`data:application/manifest+json,${encodeURIComponent(JSON.stringify(l))}`}function O(e){const n=document.querySelector(`link[rel="${e}"]`);if(n)return n;const t=document.createElement("link");return t.rel=e,document.head.appendChild(t),t}function U(e){const n=document.querySelector(`meta[name="${e}"]`);if(n)return n;const t=document.createElement("meta");return t.name=e,document.head.appendChild(t),t}function M(e){const n=k.c(5),t=e?.name??"",i=e?.slug??"",l=e?.logo??"";let a,c;n[0]!==l||n[1]!==t||n[2]!==i?(a=()=>{if(!i||!t||typeof document>"u"||typeof window>"u")return;const d=O("manifest"),m=O("apple-touch-icon"),u=U("apple-mobile-web-app-title"),r={manifest:d.getAttribute("href"),appleIcon:m.getAttribute("href"),appleTitle:u.getAttribute("content"),title:document.title};return d.setAttribute("href",R({name:t,slug:i,logo:l||null},window.location.origin)),l&&m.setAttribute("href",l),u.setAttribute("content",t),document.title=t,S(),()=>{r.manifest!==null&&d.setAttribute("href",r.manifest),r.appleIcon!==null&&m.setAttribute("href",r.appleIcon),r.appleTitle!==null&&u.setAttribute("content",r.appleTitle),document.title=r.title,S()}},c=[t,i,l],n[0]=l,n[1]=t,n[2]=i,n[3]=a,n[4]=c):(a=n[3],c=n[4]),z.useLayoutEffect(a,c)}function D(){const e=k.c(31);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},e[0]=n):n=e[0];const{org:t}=_(n),{data:i}=E();let l;e[1]!==i||e[2]!==t?(l=i?.find(N=>N.slug===t),e[1]=i,e[2]=t,e[3]=l):l=e[3];const a=l;let c;e[4]!==a?(c=a?{name:a.name,slug:a.slug,logo:a.logo??null}:null,e[4]=a,e[5]=c):c=e[5],M(c);const{canPrompt:d,installed:m,ios:u,promptInstall:r}=T(),[y,w]=z.useState(null),s=a?.name??"this organization",C=a?.logo;let b;e[6]!==s||e[7]!==r?(b=async()=>{const N=await r();w(N==="accepted"?`Installing ${s}…`:N==="dismissed"?"Install dismissed.":null)},e[6]=s,e[7]=r,e[8]=b):b=e[8];const A=b,I=C||"/icons/icon-192.png";let p;e[9]!==s||e[10]!==I?(p=o.jsx("img",{src:I,alt:s,className:"size-20 rounded-2xl border border-border/50 object-cover"}),e[9]=s,e[10]=I,e[11]=p):p=e[11];let f;e[12]!==s?(f=o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("h1",{className:"text-xl font-semibold text-foreground",children:["Add ",s," to your Home Screen"]}),o.jsxs("p",{className:"text-sm text-muted-foreground",children:["Install ",s," as its own app — a standalone window that opens straight into this organization. To install the full deco Studio app instead, use your browser's “Add to Home Screen” from any other page."]})]}),e[12]=s,e[13]=f):f=e[13];let g;e[14]!==d||e[15]!==A||e[16]!==m||e[17]!==u||e[18]!==s||e[19]!==y?(g=m?o.jsxs("p",{className:"rounded-lg bg-muted px-4 py-3 text-sm text-foreground",children:[s," is already installed on this device."]}):u?o.jsxs("div",{className:"flex flex-col gap-2 rounded-lg bg-muted px-4 py-3 text-sm text-foreground",children:[o.jsx("p",{className:"font-medium",children:"Install on iOS"}),o.jsxs("p",{className:"text-muted-foreground",children:["Tap the ",o.jsx("span",{className:"font-medium",children:"Share"})," button, then choose ",o.jsx("span",{className:"font-medium",children:"Add to Home Screen"}),"."]})]}):d?o.jsxs("div",{className:"flex flex-col items-center gap-3",children:[o.jsxs("button",{type:"button",onClick:A,className:"rounded-lg bg-primary px-5 py-2.5 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90",children:["Add ",s," to Home Screen"]}),y&&o.jsx("p",{className:"text-sm text-muted-foreground",children:y})]}):o.jsxs("p",{className:"rounded-lg bg-muted px-4 py-3 text-sm text-muted-foreground",children:["To install, open your browser's menu and choose"," ",o.jsxs("span",{className:"font-medium text-foreground",children:["Install ",s]})," ","(or “Add to Home Screen”). If you don't see it yet, interact with the app for a moment and try again."]}),e[14]=d,e[15]=A,e[16]=m,e[17]=u,e[18]=s,e[19]=y,e[20]=g):g=e[20];const v=t??"";let x;e[21]!==v?(x={org:v},e[21]=v,e[22]=x):x=e[22];let h;e[23]!==s||e[24]!==x?(h=o.jsxs($,{to:"/$org",params:x,className:"text-sm text-primary hover:underline",replace:!0,children:["Back to ",s]}),e[23]=s,e[24]=x,e[25]=h):h=e[25];let j;return e[26]!==h||e[27]!==p||e[28]!==f||e[29]!==g?(j=o.jsx("div",{className:"flex min-h-dvh items-center justify-center bg-background p-6",children:o.jsxs("div",{className:"flex w-full max-w-md flex-col items-center gap-6 text-center",children:[p,f,g,h]})}),e[26]=h,e[27]=p,e[28]=f,e[29]=g,e[30]=j):j=e[30],j}export{D as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as o,j as r,O as s}from"./index-
|
|
1
|
+
import{c as o,j as r,O as s}from"./index-C5JCmVQ0.js";function c(){const e=o.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=r.jsx(s,{}),e[0]=t):t=e[0],t}export{c as default};
|
package/dist/client/assets/{organization-choice-CwNef7oe.js → organization-choice-CRDRv9IH.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as L,r as B,d as O,j as t,B as M,i as F}from"./index-
|
|
1
|
+
import{c as L,r as B,d as O,j as t,B as M,i as F}from"./index-C5JCmVQ0.js";import{A as U}from"./avatar-CfHetrJ0.js";function I(r){const e=L.c(41),{organizations:i,domain:l,requestedSlugs:v,onRequestedSlug:y,onSelected:p,onJoined:c,onRequestCompleted:k,selectLabel:E}=r,x=E===void 0?"Select":E;let q;e[0]===Symbol.for("react.memo_cache_sentinel")?(q=new Set,e[0]=q):q=e[0];const[_,P]=B.useState(q);let b;e[1]!==y?(b=o=>{P(s=>new Set(s).add(o)),y?.(o)},e[1]=y,e[2]=b):b=e[2];const C=b;let w;e[3]!==c?(w={mutationFn:D,onSuccess:o=>{const{organization:s,slug:f}=o;c?.(s,f)}},e[3]=c,e[4]=w):w=e[4];const n=O(w);let z;e[5]!==C||e[6]!==c||e[7]!==k?(z={mutationFn:$,onSuccess:o=>{const{organization:s,slug:f,alreadyMember:J}=o;if(J&&f){c?.(s,f);return}C(s.slug),k?.(s)}},e[5]=C,e[6]=c,e[7]=k,e[8]=z):z=e[8];const a=O(z);let u;e[9]!==v?(u=v??[],e[9]=v,e[10]=u):u=e[10];let N;e[11]!==_||e[12]!==u?(N=new Set([...u,..._]),e[11]=_,e[12]=u,e[13]=N):N=e[13];const h=N,j=n.variables?.slug??null,S=a.variables?.slug??null;let d;if(e[14]!==l||e[15]!==h||e[16]!==n||e[17]!==p||e[18]!==i||e[19]!==j||e[20]!==S||e[21]!==a||e[22]!==x){let o;e[24]!==l||e[25]!==h||e[26]!==n||e[27]!==p||e[28]!==j||e[29]!==S||e[30]!==a||e[31]!==x?(o=s=>{const f=n.isPending&&j===s.slug,J=a.isPending&&S===s.slug,T=h.has(s.slug),A=s.logo??(l?`https://www.google.com/s2/favicons?domain=${l}&sz=128`:null);return t.jsxs("div",{className:"rounded-xl card-shadow bg-background dark:bg-input/30 p-4 flex items-center gap-4",children:[t.jsx(U,{url:A??void 0,fallback:s.name.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-10 w-10 shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:s.name}),l&&t.jsxs("p",{className:"text-xs text-muted-foreground truncate",children:["@",l]})]}),s.joinMode==="auto"?t.jsx(M,{size:"default",onClick:()=>n.mutate(s),disabled:n.isPending,children:f?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(F,{size:14,className:"animate-spin"})," Joining..."]}):"Join"}):s.joinMode==="request"?T?t.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:"Request sent"}):t.jsx(M,{size:"default",variant:"outline",onClick:()=>a.mutate(s),disabled:a.isPending,children:J?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(F,{size:14,className:"animate-spin"})," ","Requesting..."]}):"Request to join"}):t.jsx(M,{size:"default",onClick:()=>p?.(s),children:x})]},s.id)},e[24]=l,e[25]=h,e[26]=n,e[27]=p,e[28]=j,e[29]=S,e[30]=a,e[31]=x,e[32]=o):o=e[32],d=i.map(o),e[14]=l,e[15]=h,e[16]=n,e[17]=p,e[18]=i,e[19]=j,e[20]=S,e[21]=a,e[22]=x,e[23]=d}else d=e[23];let m;e[33]!==n.error?(m=n.error&&t.jsx("p",{className:"text-xs text-destructive",role:"alert",children:n.error instanceof Error?n.error.message:"Failed to join organization"}),e[33]=n.error,e[34]=m):m=e[34];let g;e[35]!==a.error?(g=a.error&&t.jsx("p",{className:"text-xs text-destructive",role:"alert",children:a.error instanceof Error?a.error.message:"Failed to request access"}),e[35]=a.error,e[36]=g):g=e[36];let R;return e[37]!==g||e[38]!==d||e[39]!==m?(R=t.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[d,m,g]}),e[37]=g,e[38]=d,e[39]=m,e[40]=R):R=e[40],R}async function $(r){const e=await fetch("/api/auth/custom/domain-request-join",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:r.slug})}),i=await e.json();if(!e.ok||!i.success)throw new Error(i.error||"Failed to request access");return{organization:r,slug:i.slug,alreadyMember:i.alreadyMember}}async function D(r){const e=await fetch("/api/auth/custom/domain-join",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:r.slug})}),i=await e.json();if(!e.ok||!i.success)throw new Error(i.error||"Failed to join organization");return{organization:r,slug:i.slug??r.slug}}export{I as O};
|