decocms 3.76.2 → 3.78.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-BZqAQZBb.js → AlertCircle-Caru_t3W.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-CUPFfker.js → ArrowUpRight-B2Dt0814.js} +1 -1
- package/dist/client/assets/{CheckCircle-DOPRdShL.js → CheckCircle-CpjuZYS5.js} +1 -1
- package/dist/client/assets/{ChevronDown-BhLFFAly.js → ChevronDown-DeW1WG4N.js} +1 -1
- package/dist/client/assets/{ChevronLeft-veOSKT91.js → ChevronLeft-DhtKqfYa.js} +1 -1
- package/dist/client/assets/{ChevronRight-tj4xbWmM.js → ChevronRight-DSC2aiCG.js} +1 -1
- package/dist/client/assets/{ChevronUp-DhHPsDAS.js → ChevronUp-CiZNoBS5.js} +1 -1
- package/dist/client/assets/{DotsVertical-kcsdrim_.js → DotsVertical-CAFbny0A.js} +1 -1
- package/dist/client/assets/{Eye-BfNssVzk.js → Eye-BSAOg3tU.js} +1 -1
- package/dist/client/assets/{FilterLines-D2obCQW_.js → FilterLines-BWsEA6cc.js} +1 -1
- package/dist/client/assets/{Globe01-CJXHyXNe.js → Globe01-B8cJAk0V.js} +1 -1
- package/dist/client/assets/{Globe04-PQ0ejRYI.js → Globe04-BHoeDf9U.js} +1 -1
- package/dist/client/assets/{HardDrive-DEG8fjxw.js → HardDrive-Ca-rpUZp.js} +1 -1
- package/dist/client/assets/{Key01-xj4UQriu.js → Key01-hqliL23I.js} +1 -1
- package/dist/client/assets/{LayoutLeft-C9-KQh8d.js → LayoutLeft-DfLCxQJZ.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DtLsAcMy.js → LinkExternal01-C-uuQSHY.js} +1 -1
- package/dist/client/assets/{Monitor01-CvNVisni.js → Monitor01-C4mUj5DO.js} +1 -1
- package/dist/client/assets/{Palette-yNiXmyHD.js → Palette-BqPdnSvn.js} +1 -1
- package/dist/client/assets/{Play-C0DhAO4u.js → Play-u3Xpo-3H.js} +1 -1
- package/dist/client/assets/{Plus-BRQannbC.js → Plus-e8vsh1yI.js} +1 -1
- package/dist/client/assets/{SearchMd-CttVjXUQ.js → SearchMd-pbTyIZQ0.js} +1 -1
- package/dist/client/assets/{Settings02-kQ4zmp5P.js → Settings02-1OASYAA8.js} +1 -1
- package/dist/client/assets/{Shield01-BZZVugf_.js → Shield01-BZP4Q_Vm.js} +1 -1
- package/dist/client/assets/{Star01-CFj5T2Jl.js → Star01-BokvC0Yc.js} +1 -1
- package/dist/client/assets/{Stars01-C4FyHP_L.js → Stars01-CM7BslwP.js} +1 -1
- package/dist/client/assets/{Stars02-Bo19XD__.js → Stars02-DTDItJ62.js} +1 -1
- package/dist/client/assets/{Sun-CcSW7Ngf.js → Sun-CO5Z2lcQ.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BVKPeJMU.js → SwitchHorizontal01-DCwdrg-O.js} +1 -1
- package/dist/client/assets/{Tool01-AyuVwnGv.js → Tool01-BDvWQGEc.js} +1 -1
- package/dist/client/assets/{Trash01-BZXmKzie.js → Trash01-C3khOwsb.js} +1 -1
- package/dist/client/assets/{Upload01-D4ez0Mu3.js → Upload01-BWq8M5mQ.js} +1 -1
- package/dist/client/assets/{User01-Dz33ODze.js → User01-B5NDreK2.js} +1 -1
- package/dist/client/assets/{Users01-aBataJ8N.js → Users01-BM4ZmEbl.js} +1 -1
- package/dist/client/assets/{Users03-C6siA5mE.js → Users03-DPSOJZh_.js} +1 -1
- package/dist/client/assets/{X-DC2HG4lX.js → X-CdcmL6WW.js} +1 -1
- package/dist/client/assets/XCircle-YOrPaSTA.js +1 -0
- package/dist/client/assets/{XClose-BcOWKb5Q.js → XClose-B1WSb9MQ.js} +1 -1
- package/dist/client/assets/{Zap-OOZsYg72.js → Zap-CJ80I152.js} +1 -1
- package/dist/client/assets/{ZapSquare-ok_KEP9c.js → ZapSquare-CgWRLEJy.js} +1 -1
- package/dist/client/assets/{ZoomOut-cYq1CP_X.js → ZoomOut-OytsIYD1.js} +1 -1
- package/dist/client/assets/{access-gate-uvqL8ENQ.js → access-gate-DqzudH0L.js} +1 -1
- package/dist/client/assets/add-section-modal-kp6f6erO.js +1 -0
- package/dist/client/assets/agent-icon-DY5w59uF.js +1 -0
- package/dist/client/assets/agents-list-DDHbeg5p.js +1 -0
- package/dist/client/assets/{ai-providers-CocgfzPQ.js → ai-providers-P8q844Dm.js} +1 -1
- package/dist/client/assets/{alert-CUg2Lij_.js → alert-FbljLOaQ.js} +1 -1
- package/dist/client/assets/{alert-dialog-BUQoXI1j.js → alert-dialog-BO7X_BMw.js} +1 -1
- package/dist/client/assets/app-editor-C4YX8u15.js +1 -0
- package/dist/client/assets/{auth-B9bEkbYh.js → auth-DpDDb6PJ.js} +1 -1
- package/dist/client/assets/{auth-catchall-CoB3zmdz.js → auth-catchall-BwEPZ9sp.js} +1 -1
- package/dist/client/assets/{auth-entry-CGeJ7qYU.js → auth-entry-9rxagxJL.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DAQR8Zen.js → auth-split-layout-6kbG-q9M.js} +1 -1
- package/dist/client/assets/authenticate-and-persist-oauth-SkR5Q2kF.js +1 -0
- package/dist/client/assets/{automation-list-row-DMPjogBl.js → automation-list-row-BZROLPDh.js} +1 -1
- package/dist/client/assets/{automation-runs-y9iHLMe2.js → automation-runs-VqVE_yW9.js} +1 -1
- package/dist/client/assets/automations-1DiKFOBq.js +1 -0
- package/dist/client/assets/{avatar-CKJB3djy.js → avatar-C7RfbSV0.js} +1 -1
- package/dist/client/assets/{badge-DUlP8HvP.js → badge-S-QCOrNN.js} +1 -1
- package/dist/client/assets/{block-document-Cft5FVFJ.js → block-document-CLeG1P-N.js} +1 -1
- package/dist/client/assets/brand-context-GZiNd5v6.js +1 -0
- package/dist/client/assets/{buckets-DXjIiLHp.js → buckets-DTeRBDWJ.js} +1 -1
- package/dist/client/assets/{calendar-DDwlGULz.js → calendar-katBc34c.js} +1 -1
- package/dist/client/assets/{capability-load-error-DTVGdoZZ.js → capability-load-error-D72JLeT1.js} +1 -1
- package/dist/client/assets/{card-D7O9yDM9.js → card-B0EjU25K.js} +1 -1
- package/dist/client/assets/category-editor-C-xyYK6m.js +1 -0
- package/dist/client/assets/{chat-context-GA_fpERN.js → chat-context-DdkEgZ9_.js} +6 -6
- package/dist/client/assets/{checkbox-DOg3LODJ.js → checkbox-DbzbLYfL.js} +1 -1
- package/dist/client/assets/{cli-auth-success-Jeg6Lv3T.js → cli-auth-success-C9MRaugF.js} +1 -1
- package/dist/client/assets/collection-detail-DU1VM1YR.js +1 -0
- package/dist/client/assets/{collection-display-button-b4s7O-gz.js → collection-display-button-BNnw7G4D.js} +1 -1
- package/dist/client/assets/{collection-search-DC-7DcrR.js → collection-search-hESxl20y.js} +1 -1
- package/dist/client/assets/{collection-tabs-CRIZ0CX_.js → collection-tabs-99Rq6QsS.js} +1 -1
- package/dist/client/assets/{command-BzTLypzr.js → command-DJiJXkzC.js} +1 -1
- package/dist/client/assets/commerce-onboarding-YO2BywhJ.js +1 -0
- package/dist/client/assets/{connect-desktop-dialog-uLnBe_nQ.js → connect-desktop-dialog-DR4-xhbf.js} +1 -1
- package/dist/client/assets/{connection-card-DPkWnrYu.js → connection-card-CJjprKft.js} +1 -1
- package/dist/client/assets/connection-detail-DZAfgvu2.js +1 -0
- package/dist/client/assets/{connection-form-helpers-B_oQdAph.js → connection-form-helpers-DT5c99yt.js} +1 -1
- package/dist/client/assets/connections-B3yso__h.js +1 -0
- package/dist/client/assets/{context-menu-DegHHWIw.js → context-menu-B3oZHh4c.js} +1 -1
- package/dist/client/assets/{decopilot-BsjqLgTH.js → decopilot-KvFscv5D.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-CZG5pZEa.js → decopilot-sse-pool-C9VeVJ93.js} +1 -1
- package/dist/client/assets/{dialog-DDL08EK8.js → dialog-jX6bYdqO.js} +1 -1
- package/dist/client/assets/{domain-settings-ctGoYy0P.js → domain-settings-DSTf_XC1.js} +1 -1
- package/dist/client/assets/{drawer-CTdCEiZw.js → drawer-EgN8HzIq.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CgCZ8Mte.js → dropdown-menu-BOrPFviJ.js} +1 -1
- package/dist/client/assets/{empty-state-BDXQKaPV.js → empty-state-BZIY4ETU.js} +1 -1
- package/dist/client/assets/{extract-connection-data-D4y9_vmi.js → extract-connection-data-Dz1SJTDF.js} +1 -1
- package/dist/client/assets/file-explorer-CtIkaECZ.js +2 -0
- package/dist/client/assets/{file-type-icon-GfohFxwW.js → file-type-icon-CiTHpOyi.js} +1 -1
- package/dist/client/assets/{files-CjZS2qVw.js → files-D4cQybZ3.js} +1 -1
- package/dist/client/assets/{form-B9v_4_lt.js → form-D-Lg2Vno.js} +1 -1
- package/dist/client/assets/{general-CMdyBBfH.js → general-BLLTGXVC.js} +1 -1
- package/dist/client/assets/github-repo-picker-BtGY0bTC.js +1 -0
- package/dist/client/assets/{hooks-BI65IXS7.js → hooks-Bq2gpnHq.js} +1 -1
- package/dist/client/assets/{image-field-CEHk9cpM.js → image-field-CopsGD8K.js} +1 -1
- package/dist/client/assets/{import-from-deco-dialog-DDUPpwIu.js → import-from-deco-dialog-DTeSs8zZ.js} +2 -2
- package/dist/client/assets/{index-B2quJDhU.js → index-BIlZxD1s.js} +1 -1
- package/dist/client/assets/{index-BUTJwxVv.js → index-BMuKOY-R.js} +1 -1
- package/dist/client/assets/{index-DBKP_KxA.js → index-B_T2Tm_n.js} +1 -1
- package/dist/client/assets/{index-Br4BSsfF.js → index-CApC7A2-.js} +1 -1
- package/dist/client/assets/index-CpN1_PlS.js +1 -0
- package/dist/client/assets/{index-DVxNbd_g.js → index-CwCkKeIW.js} +1 -1
- package/dist/client/assets/{index-Cvc1xn-4.js → index-D9cso_OE.js} +4 -4
- package/dist/client/assets/{index-B8LUbsU-.js → index-DJ0Ge3cT.js} +12 -12
- package/dist/client/assets/index-DjsYubVL.js +1 -0
- package/dist/client/assets/{index-1J83wgnT.js → index-DsuFa3M3.js} +1 -1
- package/dist/client/assets/{index-CWT26dU0.js → index-FMQJTdgj.js} +2 -2
- package/dist/client/assets/{index-BI3_fNOm.js → index-OWX18MdF.js} +2 -2
- package/dist/client/assets/{index-B3siY4Ve.js → index-TfVSao84.js} +1 -1
- package/dist/client/assets/{index-YDkX6amF.js → index-an-q9BoC.js} +1 -1
- package/dist/client/assets/{index-redirect-7dYh9FF7.js → index-redirect-B5cnslmT.js} +1 -1
- package/dist/client/assets/{input-klr_kUC2.js → input-aftZq0qp.js} +1 -1
- package/dist/client/assets/{integration-icon-gcYOl2yq.js → integration-icon-Dn8UgHow.js} +1 -1
- package/dist/client/assets/{label-hfmZhqH1.js → label-BlTB1rsr.js} +1 -1
- package/dist/client/assets/{login-BwlkI7-F.js → login-DwqD6H9f.js} +1 -1
- package/dist/client/assets/{mcp-oauth-C5QgI6bG.js → mcp-oauth-DYo7_iWt.js} +1 -1
- package/dist/client/assets/{members-DtCaJnP7.js → members-BAmGZs_l.js} +2 -2
- package/dist/client/assets/{monaco-editor-YJUBj_D_.js → monaco-editor-dFjmNtXr.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DYXC0MeT.js → monitoring-stats-row-DXzyXSPo.js} +1 -1
- package/dist/client/assets/{oauth-callback-oHGZWLTi.js → oauth-callback-BnUvVOzM.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-rWJe_yJL.js → oauth-callback-ai-provider-CtGpymDw.js} +1 -1
- package/dist/client/assets/{onboarding-C8e3_lZa.js → onboarding-tHyZv_uW.js} +1 -1
- package/dist/client/assets/{org-install-Bht2exTB.js → org-install-BJnctrXU.js} +1 -1
- package/dist/client/assets/{org-layout-DJtHiwbS.js → org-layout-DgadVfYy.js} +1 -1
- package/dist/client/assets/{organization-choice-Dye_3x23.js → organization-choice-HfpQcKxS.js} +1 -1
- package/dist/client/assets/{page-seo-form-Io0ovKiN.js → page-seo-form-j7a8Z1BY.js} +1 -1
- package/dist/client/assets/page-seo-sheet-C5rR31Cs.js +1 -0
- package/dist/client/assets/{popover-BvZF2bBr.js → popover-D43tJ8in.js} +1 -1
- package/dist/client/assets/post-editor-XU3B2wmV.js +1 -0
- package/dist/client/assets/{preview-dialog-BikVelEl.js → preview-dialog-BrHmAwG0.js} +1 -1
- package/dist/client/assets/{primitives-Bc5oh19Q.js → primitives-BRyBxVlk.js} +1 -1
- package/dist/client/assets/{profile-BoAJRU1a.js → profile-CLM3LuOb.js} +1 -1
- package/dist/client/assets/project-app-view-Bojee27q.js +1 -0
- package/dist/client/assets/record-editor-Cb2nxa0o.js +1 -0
- package/dist/client/assets/registry-DJ2WJB-k.js +2 -0
- package/dist/client/assets/{registry-layout-Dxd6kQFA.js → registry-layout-pqx5X3wF.js} +4 -4
- package/dist/client/assets/{require-capability-kyUIYw2A.js → require-capability-BQ22Wt23.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BcilPdVi.js → required-auth-layout-wApn6jVI.js} +1 -1
- package/dist/client/assets/{reset-password-CPk5rTzD.js → reset-password-deaGgEkO.js} +1 -1
- package/dist/client/assets/roles-RG2bRHsu.js +1 -0
- package/dist/client/assets/save-referenced-block-B0RkutY2.js +1 -0
- package/dist/client/assets/{save-status-De_ZSd1F.js → save-status-BiRx7JAD.js} +1 -1
- package/dist/client/assets/{schema-form-C1MMeEGC.js → schema-form-sBBUMk07.js} +1 -1
- package/dist/client/assets/{scroll-area-BvvyxqKR.js → scroll-area-BSGl-_zx.js} +7 -7
- package/dist/client/assets/{search-input-B-LDSHMx.js → search-input-Cn14rzZS.js} +1 -1
- package/dist/client/assets/{secrets-Bq5342Un.js → secrets-D-nSpmHI.js} +1 -1
- package/dist/client/assets/{sections-editor-BU6mrjAz.js → sections-editor-NjvzZlHu.js} +1 -1
- package/dist/client/assets/{select-DwFQDgcX.js → select-BGb-ZPds.js} +1 -1
- package/dist/client/assets/{select-model-BWl1FGCY.js → select-model-C_rVNd_q.js} +1 -1
- package/dist/client/assets/seo-editor-Bvd2538m.js +1 -0
- package/dist/client/assets/{settings-layout-d5QwVuj0.js → settings-layout-CrGAcHuU.js} +1 -1
- package/dist/client/assets/{settings-section-rOWH4a9G.js → settings-section-Bc3yjWcB.js} +1 -1
- package/dist/client/assets/{sheet-XVV7S5b8.js → sheet-HFHR_AuU.js} +1 -1
- package/dist/client/assets/{shell-controls-D6QH2Gpe.js → shell-controls-HLzK4I7E.js} +1 -1
- package/dist/client/assets/{shell-layout-DIXTRmN4.js → shell-layout-LI1vyNzj.js} +1 -1
- package/dist/client/assets/{shell-route-loading-B5-wAKUU.js → shell-route-loading-BDOpNoYP.js} +1 -1
- package/dist/client/assets/{sidebar-Djn7svMG.js → sidebar-BGJoJ5IQ.js} +1 -1
- package/dist/client/assets/{skeleton-C-tuNjEZ.js → skeleton-hFHnIcZ0.js} +1 -1
- package/dist/client/assets/{sortable.esm-S2exVkMt.js → sortable.esm-DIVJmvz6.js} +1 -1
- package/dist/client/assets/{sso-KnN7dzsP.js → sso-Bn468zRH.js} +1 -1
- package/dist/client/assets/{store-DcHIPBce.js → store-DytIJvdt.js} +1 -1
- package/dist/client/assets/store-registry-C32JZ3Yi.js +2 -0
- package/dist/client/assets/{studio-tools-D8q7MEyE.js → studio-tools-eP_o-Bzq.js} +1 -1
- package/dist/client/assets/{switch-skMKJ2GI.js → switch-DalcHZ66.js} +1 -1
- package/dist/client/assets/{table-DsOuzcNK.js → table-CnWjZkvw.js} +1 -1
- package/dist/client/assets/{tabs-C0Vh3iPJ.js → tabs-BhJfCfA3.js} +1 -1
- package/dist/client/assets/task-status-BwSSlnug.js +1 -0
- package/dist/client/assets/{textarea-2KmLad1y.js → textarea-DTW1SKGc.js} +1 -1
- package/dist/client/assets/{toggle-group-6FcrOIsd.js → toggle-group-CRnMovNn.js} +1 -1
- package/dist/client/assets/{toolbar-DE_I2DnI.js → toolbar-BVgga9fW.js} +1 -1
- package/dist/client/assets/{tooltip-D_DwQRbZ.js → tooltip-DVHwyu-W.js} +1 -1
- package/dist/client/assets/{types-zC94Gae_.js → types-B1E3Ybp7.js} +1 -1
- package/dist/client/assets/{use-ai-providers-0DJv4c0H.js → use-ai-providers-DP8qFD8W.js} +1 -1
- package/dist/client/assets/{use-automations-CsLMaKM0.js → use-automations-QBk1wzKE.js} +1 -1
- package/dist/client/assets/use-capability-D3mzXNBE.js +1 -0
- package/dist/client/assets/{use-clock-tick-CqrkSCF6.js → use-clock-tick-YCiBQpNz.js} +1 -1
- package/dist/client/assets/{use-collections-dA9ibOHr.js → use-collections-sgcijgPQ.js} +1 -1
- package/dist/client/assets/{use-connection-C39BUY8e.js → use-connection-CFC8WumP.js} +1 -1
- package/dist/client/assets/{use-copy-DM9BeeKg.js → use-copy-BVyzmTt4.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-q3QYUSY1.js → use-create-virtual-mcp-40n1TbuY.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BzGp2qae.js → use-debounced-autosave-tiHawAIR.js} +1 -1
- package/dist/client/assets/use-deco-credits-C1ftH3If.js +1 -0
- package/dist/client/assets/{use-delete-connection-CAqFRv-C.js → use-delete-connection-CUd76KVl.js} +1 -1
- package/dist/client/assets/{use-file-configs-CvRusjpd.js → use-file-configs-C2ceyi4L.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DM0o0Ibp.js → use-infinite-scroll-CvmJXJdB.js} +1 -1
- package/dist/client/assets/{use-join-requests-iYNw-oM8.js → use-join-requests-CRlCmWm0.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DV4dF4m3.js → use-mcp-client-DFe1X8lW.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-CspfQ-gW.js → use-mcp-prompts-4cCmLVZX.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DnBnaQLn.js → use-mcp-tools-DI9Jj-_Y.js} +1 -1
- package/dist/client/assets/{use-members-CtcSheMR.js → use-members-KDk_htTJ.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-Cs1C-DBQ.js → use-navigate-to-agent-D9iFw7Zt.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-lV24PS0n.js → use-org-auth-client-SaCcE0Qc.js} +1 -1
- package/dist/client/assets/{use-org-sso-Cygr8MWL.js → use-org-sso-4n2o97PC.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DKqp_63r.js → use-organization-roles-BXjlJlvC.js} +1 -1
- package/dist/client/assets/use-organization-settings-CJJ_tXSe.js +1 -0
- package/dist/client/assets/{use-registry-connections-yBLIjpTM.js → use-registry-connections-DGZtDiY8.js} +1 -1
- package/dist/client/assets/{use-secrets-BtkNg5h6.js → use-secrets-DOmnFlDE.js} +1 -1
- package/dist/client/assets/{use-status-sounds-Bvu0fELl.js → use-status-sounds-C7IKQ0M3.js} +1 -1
- package/dist/client/assets/{use-view-mode-CF449xEK.js → use-view-mode-5sHRttq3.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-WmAC_qSm.js → use-virtual-mcp-Dt17nZX7.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-LattvRM6.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-JNoud7Ca.js +1 -0
- package/dist/client/assets/variant-calendar-DBaInJsx.js +1 -0
- package/dist/client/assets/{view-mode-toggle-D7_rFTiD.js → view-mode-toggle-dVNz8sR0.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +344 -344
- package/dist/server/server.js +235 -235
- package/package.json +1 -1
- package/dist/client/assets/ArrowRight-6qgvW498.js +0 -1
- package/dist/client/assets/XCircle-DJDxYBys.js +0 -1
- package/dist/client/assets/add-section-modal-CZMJAFim.js +0 -1
- package/dist/client/assets/agent-icon-C4199b3i.js +0 -1
- package/dist/client/assets/agents-list-BkhDlcw_.js +0 -1
- package/dist/client/assets/app-editor-C-syiSQu.js +0 -1
- package/dist/client/assets/automations-BZ5f_VCT.js +0 -1
- package/dist/client/assets/brand-context-ozThKdwR.js +0 -1
- package/dist/client/assets/category-editor-B2u5O4dV.js +0 -1
- package/dist/client/assets/collection-detail-BDyvHjSJ.js +0 -1
- package/dist/client/assets/commerce-onboarding-Cz_Sr1Cc.js +0 -1
- package/dist/client/assets/connection-detail-DFBuqM3e.js +0 -1
- package/dist/client/assets/connections-BF1eSDFK.js +0 -1
- package/dist/client/assets/file-explorer-DTEZJaER.js +0 -2
- package/dist/client/assets/github-repo-picker-Qwduwaex.js +0 -1
- package/dist/client/assets/index-CQsWL0Jd.js +0 -1
- package/dist/client/assets/index-DMWSApoW.js +0 -1
- package/dist/client/assets/page-seo-sheet-CRKfon-Z.js +0 -1
- package/dist/client/assets/post-editor-DhYABFSS.js +0 -1
- package/dist/client/assets/project-app-view-AcWNwwqH.js +0 -1
- package/dist/client/assets/record-editor-CdJmeinf.js +0 -1
- package/dist/client/assets/registry-Cq-UMbFU.js +0 -2
- package/dist/client/assets/roles-BTjmfpAQ.js +0 -1
- package/dist/client/assets/save-referenced-block-oaxGf8K5.js +0 -1
- package/dist/client/assets/seo-editor-WJe9bB3t.js +0 -1
- package/dist/client/assets/store-registry-3V2xevo5.js +0 -2
- package/dist/client/assets/task-status-DRz_b988.js +0 -1
- package/dist/client/assets/use-capability-A3j7T78I.js +0 -1
- package/dist/client/assets/use-deco-credits-Bax6GRog.js +0 -1
- package/dist/client/assets/use-organization-settings-C6jq364X.js +0 -1
- package/dist/client/assets/useInfiniteQuery-Bwr_uznn.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-D48NS_O0.js +0 -1
- package/dist/client/assets/variant-calendar-CoVLDgg6.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{al as ot,am as he,an as lt,ao as at,ap as Oe,I as le,aq as ct,ar as dt,r as $,as as mt,at as ut,au as ft,av as ht,aw as Se,ax as pt,ay as xt,az as gt,c as k,j as n,s as J,l as G,i as ae,aA as Z,t as U,K as te,k as se,B as Y,d as bt,a6 as yt,a2 as vt,a as jt}from"./index-Cvc1xn-4.js";import{u as be}from"./tooltip-D_DwQRbZ.js";import{i as wt,u as ce,m as Nt,a as St,S as Ct}from"./use-mcp-client-DV4dF4m3.js";import{u as _t,b as It,v as Tt,a as kt}from"./use-virtual-mcp-WmAC_qSm.js";import{i as $t}from"./ChevronUp-DhHPsDAS.js";import{e as At,A as de,Q as Et,a0 as Ot,D as Pt,k as Mt}from"./agent-icon-C4199b3i.js";import{s as ye}from"./Plus-BRQannbC.js";import{i as Pe}from"./X-DC2HG4lX.js";import{C as re}from"./index-BI3_fNOm.js";import{b as zt}from"./chat-context-GA_fpERN.js";import{N as Rt}from"./decopilot-BsjqLgTH.js";import{u as Me,a as oe,K as ze,P as Re,D as Le,c as Lt,S as Ht,v as Dt,b as Ft,C as Ut,s as Qt,d as Bt,e as qt,f as Vt}from"./sortable.esm-S2exVkMt.js";import{g as Kt,u as Wt,d as Gt,h as Jt}from"./use-deco-credits-Bax6GRog.js";import{u as He,a as De,o as Xt}from"./use-organization-settings-C6jq364X.js";import{c as ve,b as Zt,h as Yt}from"./shell-layout-DIXTRmN4.js";import{I as Fe}from"./input-klr_kUC2.js";import{S as es,t as je,P as ts,h as ss,s as ns,g as is}from"./scroll-area-BvvyxqKR.js";import{S as rs,a as os,b as ls,c as as,d as cs}from"./sheet-XVV7S5b8.js";import{S as H}from"./skeleton-C-tuNjEZ.js";import{t as Ue}from"./ChevronDown-BhLFFAly.js";import{c as Qe}from"./ZoomOut-cYq1CP_X.js";import{g as Be,M as ds}from"./types-zC94Gae_.js";import{I as qe}from"./integration-icon-gcYOl2yq.js";import{b as ms,c as us,S as fs,a as Ce,d as hs}from"./select-DwFQDgcX.js";import{T as ps}from"./textarea-2KmLad1y.js";import{u as Ve}from"./studio-tools-D8q7MEyE.js";import{a as xs}from"./use-mcp-tools-DnBnaQLn.js";import{i as gs}from"./ArrowRight-6qgvW498.js";import{f as bs}from"./tab-id-BptcWVWa.js";import{g as ys}from"./use-mcp-prompts-CspfQ-gW.js";import{u as vs,w as js}from"./hooks-BI65IXS7.js";import{a as ws,g as Ns,c as Ss,b as Cs,D as _s}from"./dropdown-menu-CgCZ8Mte.js";import{s as Is}from"./Trash01-BZXmKzie.js";import{a as Ts,u as ks}from"./use-ai-providers-0DJv4c0H.js";import{u as $s}from"./connect-desktop-dialog-uLnBe_nQ.js";import{a as As}from"./toolbar-DE_I2DnI.js";import"./auth-B9bEkbYh.js";import"./use-collections-dA9ibOHr.js";import"./AlertCircle-BZqAQZBb.js";import"./Tool01-AyuVwnGv.js";import"./SwitchHorizontal01-BVKPeJMU.js";import"./Settings02-kQ4zmp5P.js";import"./XCircle-DJDxYBys.js";import"./ArrowUpRight-CUPFfker.js";import"./ZapSquare-ok_KEP9c.js";import"./Users03-C6siA5mE.js";import"./CheckCircle-DOPRdShL.js";import"./ChevronLeft-veOSKT91.js";import"./ChevronRight-tj4xbWmM.js";import"./DotsVertical-kcsdrim_.js";import"./Stars02-Bo19XD__.js";import"./Eye-BfNssVzk.js";import"./Globe01-CJXHyXNe.js";import"./FilterLines-D2obCQW_.js";import"./Star01-CFj5T2Jl.js";import"./Globe04-PQ0ejRYI.js";import"./HardDrive-DEG8fjxw.js";import"./Key01-xj4UQriu.js";import"./LayoutLeft-C9-KQh8d.js";import"./LinkExternal01-DtLsAcMy.js";import"./Monitor01-CvNVisni.js";import"./Sun-CcSW7Ngf.js";import"./Palette-yNiXmyHD.js";import"./Play-C0DhAO4u.js";import"./SearchMd-CttVjXUQ.js";import"./Shield01-BZZVugf_.js";import"./Stars01-C4FyHP_L.js";import"./Upload01-D4ez0Mu3.js";import"./User01-Dz33ODze.js";import"./Users01-aBataJ8N.js";import"./XClose-BcOWKb5Q.js";import"./Zap-OOZsYg72.js";import"./dialog-DDL08EK8.js";import"./drawer-CTdCEiZw.js";import"./collection-search-DC-7DcrR.js";import"./form-B9v_4_lt.js";import"./label-hfmZhqH1.js";import"./tabs-C0Vh3iPJ.js";import"./toggle-group-6FcrOIsd.js";import"./popover-BvZF2bBr.js";import"./command-BzTLypzr.js";import"./index-DVxNbd_g.js";import"./useInfiniteQuery-Bwr_uznn.js";import"./use-infinite-scroll-DM0o0Ibp.js";import"./question-004-sINsf4GQ.js";import"./checkbox-DOg3LODJ.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-CKJB3djy.js";import"./settings-section-rOWH4a9G.js";import"./card-D7O9yDM9.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DPkWnrYu.js";import"./use-registry-connections-yBLIjpTM.js";import"./use-connection-C39BUY8e.js";import"./extract-connection-data-D4y9_vmi.js";import"./collection-tabs-CRIZ0CX_.js";import"./badge-DUlP8HvP.js";import"./connection-form-helpers-B_oQdAph.js";import"./useSuspenseInfiniteQuery-D48NS_O0.js";import"./mcp-oauth-C5QgI6bG.js";import"./required-auth-layout-BcilPdVi.js";import"./use-org-sso-Cygr8MWL.js";import"./use-clock-tick-CqrkSCF6.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DM9BeeKg.js";import"./file-type-icon-GfohFxwW.js";import"./content-blocks-o63cs2vh.js";import"./use-navigate-to-agent-Cs1C-DBQ.js";import"./decopilot-sse-pool-CZG5pZEa.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";function _e(t,e){const s=new Set(e);return t.filter(r=>!s.has(r))}function Es(t,e,s){const r=t.slice(0);return r[e]=s,r}var Os=class extends ot{#i;#e;#r;#n;#t;#s;#o;#l;#a;#c=[];constructor(t,e,s){super(),this.#i=t,this.#n=s,this.#r=[],this.#t=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#t.forEach(t=>{t.subscribe(e=>{this.#f(t,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#t.forEach(t=>{t.destroy()})}setQueries(t,e){this.#r=t,this.#n=e,he.batch(()=>{const s=this.#t,r=this.#u(this.#r);r.forEach(c=>c.observer.setOptions(c.defaultedQueryOptions));const i=r.map(c=>c.observer),o=i.map(c=>c.getCurrentResult()),l=s.length!==i.length,d=i.some((c,u)=>c!==s[u]),a=l||d,m=a?!0:o.some((c,u)=>{const f=this.#e[u];return!f||!lt(c,f)});!a&&!m||(a&&(this.#c=r,this.#t=i),this.#e=o,this.hasListeners()&&(a&&(_e(s,i).forEach(c=>{c.destroy()}),_e(i,s).forEach(c=>{c.subscribe(u=>{this.#f(c,u)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#t.map(t=>t.getCurrentQuery())}getObservers(){return this.#t}getOptimisticResult(t,e){const s=this.#u(t),r=s.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),i=s.map(o=>o.defaultedQueryOptions.queryHash);return[r,o=>this.#m(o??r,e,i),()=>this.#d(r,s)]}#d(t,e){return e.map((s,r)=>{const i=t[r];return s.defaultedQueryOptions.notifyOnChangeProps?i:s.observer.trackResult(i,o=>{e.forEach(l=>{l.observer.trackProp(o)})})})}#m(t,e,s){if(e){const r=this.#a,i=s!==void 0&&r!==void 0&&(r.length!==s.length||s.some((o,l)=>o!==r[l]));return(!this.#s||this.#e!==this.#l||i||e!==this.#o)&&(this.#o=e,this.#l=this.#e,s!==void 0&&(this.#a=s),this.#s=at(this.#s,e(t))),this.#s}return t}#p(){return this.#n?.combine!==void 0&&this.#t.some((t,e)=>t.options.suspense&&this.#e[e]?.data===void 0)}#u(t){const e=new Map;this.#t.forEach(r=>{const i=r.options.queryHash;if(!i)return;const o=e.get(i);o?o.push(r):e.set(i,[r])});const s=[];return t.forEach(r=>{const i=this.#i.defaultQueryOptions(r),l=e.get(i.queryHash)?.shift()??new Oe(this.#i,i);s.push({defaultedQueryOptions:i,observer:l})}),s}#f(t,e){const s=this.#t.indexOf(t);s!==-1&&(this.#e=Es(this.#e,s,e),this.#h())}#h(){if(this.hasListeners()){const t=this.#d(this.#e,this.#c),e=this.#p(),s=this.#s,r=e?s:this.#m(t,this.#n?.combine);(e||s!==r)&&he.batch(()=>{this.listeners.forEach(i=>{i(this.#e)})})}}};function Ps({queries:t,...e},s){const r=le(s),i=ct(),o=dt(),l=$.useMemo(()=>t.map(p=>{const g=r.defaultQueryOptions(p);return g._optimisticResults=i?"isRestoring":"optimistic",g}),[t,r,i]);l.forEach(p=>{mt(p);const g=r.getQueryCache().get(p.queryHash);ut(p,o,g)}),ft(o);const[d]=$.useState(()=>new Os(r,l,e)),[a,m,c]=d.getOptimisticResult(l,e.combine),u=!i&&e.subscribed!==!1;$.useSyncExternalStore($.useCallback(p=>u?d.subscribe(he.batchCalls(p)):ht,[d,u]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),$.useEffect(()=>{d.setQueries(l,e)},[l,e,d]);const h=a.some((p,g)=>Se(l[g],p))?a.flatMap((p,g)=>{const y=l[g];if(y&&Se(y,p)){const j=new Oe(r,y);return pt(y,j,o)}return[]}):[];if(h.length>0)throw Promise.all(h);const x=a.find((p,g)=>{const y=l[g];return y&&xt({result:p,errorResetBoundary:o,throwOnError:y.throwOnError,query:r.getQueryCache().get(y.queryHash),suspense:y.suspense})});if(x?.error)throw x.error;return m(c())}function Ms(t,e){return Ps({...t,queries:t.queries.map(s=>({...s,suspense:!0,throwOnError:gt,enabled:!0,placeholderData:void 0}))},e)}function Ke(t){const e=k.c(11),{properties:s,required:r,values:i,onChange:o}=t;let l;e[0]!==r?(l=r??[],e[0]=r,e[1]=l):l=e[1];let d;e[2]!==l?(d=new Set(l),e[2]=l,e[3]=d):d=e[3];const a=d;let m;e[4]!==s?(m=Object.entries(s),e[4]=s,e[5]=m):m=e[5];let c;return e[6]!==o||e[7]!==a||e[8]!==m||e[9]!==i?(c=n.jsx("div",{className:"flex flex-col gap-2",children:m.map(u=>{const[f,h]=u;return n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("label",{className:"text-xs font-medium leading-none flex items-center gap-1",children:[f,a.has(f)&&n.jsx("span",{className:"text-red-500 text-[10px]",children:"*"})]}),n.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:h.type})]}),h.description&&n.jsx("p",{className:"text-[10px] text-muted-foreground leading-snug",children:h.description}),n.jsx(zs,{type:h.type,fieldKey:f,value:i[f],onChange:x=>o(f,x)})]},f)})}),e[6]=o,e[7]=a,e[8]=m,e[9]=i,e[10]=c):c=e[10],c}function zs(t){const e=k.c(19),{type:s,fieldKey:r,value:i,onChange:o}=t;if(s==="object"||s==="array"){const c=i??"";let u;e[0]!==o?(u=x=>o(x.target.value),e[0]=o,e[1]=u):u=e[1];const f=`Enter ${r} as JSON…`;let h;return e[2]!==c||e[3]!==u||e[4]!==f?(h=n.jsx(ps,{className:"font-mono text-xs h-16",value:c,onChange:u,placeholder:f,rows:2}),e[2]=c,e[3]=u,e[4]=f,e[5]=h):h=e[5],h}if(s==="boolean"){const c=i!=null?String(i):"";let u;e[6]!==o?(u=p=>o(p==="true"),e[6]=o,e[7]=u):u=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(ms,{className:"h-7 text-xs",children:n.jsx(us,{placeholder:"Select…"})}),e[8]=f):f=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsxs(fs,{children:[n.jsx(Ce,{value:"true",children:"true"}),n.jsx(Ce,{value:"false",children:"false"})]}),e[9]=h):h=e[9];let x;return e[10]!==c||e[11]!==u?(x=n.jsxs(hs,{value:c,onValueChange:u,children:[f,h]}),e[10]=c,e[11]=u,e[12]=x):x=e[12],x}const l=i??"";let d;e[13]!==o?(d=c=>o(c.target.value),e[13]=o,e[14]=d):d=e[14];const a=`Enter ${r}…`;let m;return e[15]!==l||e[16]!==d||e[17]!==a?(m=n.jsx(Fe,{className:"h-7 text-xs",value:l,onChange:d,placeholder:a}),e[15]=l,e[16]=d,e[17]=a,e[18]=m):m=e[18],m}const ne=8;function Rs(t){const e=k.c(16),{open:s,onOpenChange:r}=t,[i,o]=$.useState("");let l,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(rs,{children:"Manage home"}),d=n.jsx(os,{children:"Add agents to the home board and pin their interactive UIs or prompts."}),e[0]=l,e[1]=d):(l=e[0],d=e[1]);let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(At,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none","aria-hidden":!0}),e[2]=a):a=e[2];let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=p=>o(p.target.value),e[3]=m):m=e[3];let c;e[4]!==i?(c=n.jsxs(ls,{className:"px-5 py-4 border-b border-border",children:[l,d,n.jsxs("div",{className:"relative mt-3",children:[a,n.jsx(Fe,{value:i,onChange:m,placeholder:"Search agents…",className:"pl-8 h-8 text-sm"})]})]}),e[4]=i,e[5]=c):c=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(hn,{}),e[6]=u):u=e[6];let f;e[7]!==i?(f=n.jsx(es,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"p-3 flex flex-col gap-4",children:n.jsx($.Suspense,{fallback:u,children:n.jsx(Hs,{search:i})})})}),e[7]=i,e[8]=f):f=e[8];let h;e[9]!==c||e[10]!==f?(h=n.jsxs(as,{side:"right",className:"w-full sm:max-w-md p-0 flex flex-col",children:[c,f]}),e[9]=c,e[10]=f,e[11]=h):h=e[11];let x;return e[12]!==r||e[13]!==s||e[14]!==h?(x=n.jsx(cs,{open:s,onOpenChange:r,children:h}),e[12]=r,e[13]=s,e[14]=h,e[15]=x):x=e[15],x}function Ls(t){const e=k.c(32),{org:s}=J(),r=He();let i;e[0]!==r?.ids?(i=r?.ids??[],e[0]=r?.ids,e[1]=i):i=e[1];const o=i,l=De(),d=It(),a=le();let m;e[2]!==s||e[3]!==a?(m=()=>a.refetchQueries({queryKey:te.homeNextActions(s.slug),type:"active"}),e[2]=s,e[3]=a,e[4]=m):m=e[4];const c=m;let u;e[5]!==o?(u=C=>o.includes(C),e[5]=o,e[6]=u):u=e[6];const f=u;let h;e[7]!==o||e[8]!==t?(h=t?o.filter(C=>t.has(C)).length:o.length,e[7]=o,e[8]=t,e[9]=h):h=e[9];const p=h>=ne;let g;e[10]!==p||e[11]!==f||e[12]!==l?(g=C=>f(C)||p?Promise.resolve():l.apply(I=>I.includes(C)?null:[...I,C]),e[10]=p,e[11]=f,e[12]=l,e[13]=g):g=e[13];const y=g;let j;e[14]!==l?(j=C=>l.apply(I=>I.filter(T=>T!==C)),e[14]=l,e[15]=j):j=e[15];const w=j;let v;e[16]!==l?(v=C=>l.apply(()=>C),e[16]=l,e[17]=v):v=e[17];const b=v;let N;e[18]!==d||e[19]!==p||e[20]!==f||e[21]!==c||e[22]!==l?(N=async(C,I)=>{await d.update.mutateAsync({id:C.id,data:{metadata:I}}),!f(C.id)&&!p&&await l.apply(T=>T.includes(C.id)?null:[...T,C.id]),await c()},e[18]=d,e[19]=p,e[20]=f,e[21]=c,e[22]=l,e[23]=N):N=e[23];const S=N;let _;return e[24]!==y||e[25]!==p||e[26]!==o||e[27]!==f||e[28]!==w||e[29]!==b||e[30]!==S?(_={homeIds:o,isOnHome:f,atLimit:p,addAgent:y,removeAgent:w,reorder:b,saveAgentMetadata:S},e[24]=y,e[25]=p,e[26]=o,e[27]=f,e[28]=w,e[29]=b,e[30]=S,e[31]=_):_=e[31],_}function Hs(t){const e=k.c(21),{search:s}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={pageSize:1e3},e[0]=r):r=e[0];const i=_t(r);let o;e[1]!==i?(o=new Set(i.map(Bs)),e[1]=i,e[2]=o):o=e[2];const l=Ls(o);let d,a,m;if(e[3]!==i||e[4]!==l||e[5]!==s){const p=new Map(i.map(Qs));d=s.trim().toLowerCase();const g=w=>!d||w.title?.toLowerCase().includes(d);a=l.homeIds.map(w=>p.get(w)).filter(Us).filter(g);const y=Kt(i);let j;e[9]!==l?(j=w=>!l.isOnHome(w.id),e[9]=l,e[10]=j):j=e[10],m=i.filter(Fs).filter(w=>!y.has(w.id)).filter(j).filter(g).sort(Ds),e[3]=i,e[4]=l,e[5]=s,e[6]=d,e[7]=a,e[8]=m}else d=e[6],a=e[7],m=e[8];const c=m;let u;e[11]!==l||e[12]!==a?(u=n.jsx(qs,{home:l,agents:a}),e[11]=l,e[12]=a,e[13]=u):u=e[13];const f=!!d;let h;e[14]!==c||e[15]!==l||e[16]!==f?(h=n.jsx(Ws,{home:l,agents:c,hasSearch:f}),e[14]=c,e[15]=l,e[16]=f,e[17]=h):h=e[17];let x;return e[18]!==u||e[19]!==h?(x=n.jsxs(n.Fragment,{children:[u,h]}),e[18]=u,e[19]=h,e[20]=x):x=e[20],x}function Ds(t,e){return(t.title??"").localeCompare(e.title??"")}function Fs(t){return t.id&&!wt(t.id)}function Us(t){return!!t}function Qs(t){return[t.id,t]}function Bs(t){return t.id}function We(t){const e=k.c(7),{title:s,hint:r}=t;let i;e[0]!==s?(i=n.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:s}),e[0]=s,e[1]=i):i=e[1];let o;e[2]!==r?(o=r&&n.jsx("span",{className:"text-xs text-muted-foreground",children:r}),e[2]=r,e[3]=o):o=e[3];let l;return e[4]!==i||e[5]!==o?(l=n.jsxs("div",{className:"flex items-center justify-between px-1",children:[i,o]}),e[4]=i,e[5]=o,e[6]=l):l=e[6],l}function qs(t){const e=k.c(14),{home:s,agents:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={activationConstraint:{distance:5}},e[0]=i):i=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={coordinateGetter:Qt},e[1]=o):o=e[1];const l=Me(oe(Re,i),oe(ze,o));let d;e[2]!==s?(d=h=>{const{active:x,over:p}=h;if(!p||x.id===p.id)return;const g=s.homeIds,y=g.indexOf(x.id),j=g.indexOf(p.id);y===-1||j===-1||s.reorder(Bt([...g],y,j)).catch(Ks)},e[2]=s,e[3]=d):d=e[3];const a=d,m=`${s.homeIds.length}/${ne}`;let c;e[4]!==m?(c=n.jsx(We,{title:"On home",hint:m}),e[4]=m,e[5]=c):c=e[5];let u;e[6]!==r||e[7]!==a||e[8]!==s||e[9]!==l?(u=r.length===0?n.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"No agents on the home yet."}):n.jsx(Le,{sensors:l,collisionDetection:Lt,onDragEnd:a,children:n.jsx(Ht,{items:r.map(Vs),strategy:Dt,children:n.jsx("div",{className:"flex flex-col gap-1",children:r.map(h=>n.jsx(Js,{agent:h,home:s},h.id))})})}),e[6]=r,e[7]=a,e[8]=s,e[9]=l,e[10]=u):u=e[10];let f;return e[11]!==c||e[12]!==u?(f=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[c,u]}),e[11]=c,e[12]=u,e[13]=f):f=e[13],f}function Vs(t){return t.id}function Ks(){return U.error("Couldn't reorder home — please try again.")}function Ws(t){const e=k.c(6),{home:s,agents:r,hasSearch:i}=t,[o,l]=$.useState(20);let d;if(e[0]!==r||e[1]!==i||e[2]!==s||e[3]!==o){const a=r.slice(0,o);let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(We,{title:"Add to home"}),e[5]=m):m=e[5],d=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,r.length===0?n.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:i?"No agents match.":"Every agent is on the home."}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex flex-col gap-1",children:a.map(c=>n.jsx(Ys,{agent:c,home:s},c.id))}),r.length>o&&n.jsxs("button",{type:"button",onClick:()=>l(Gs),className:"mt-1 self-center rounded-md px-3 py-1.5 text-xs text-muted-foreground hover:bg-accent/40 hover:text-foreground",children:["Load more (",r.length-o,")"]})]})]}),e[0]=r,e[1]=i,e[2]=s,e[3]=o,e[4]=d}else d=e[4];return d}function Gs(t){return t+20}function Ge(t){const e=Z(t.metadata?.ui).filter(o=>!!o.resourceUri).length,s=t.metadata?.ui?.homePrompts,r=Array.isArray(s)?s.length:null,i=[];return e>0&&i.push(`${e} tile${e===1?"":"s"}`),r!==null&&r>0&&i.push(`${r} prompt${r===1?"":"s"}`),r===0&&i.push("prompts off"),i.join(" · ")}function Js(t){const e=k.c(57),{agent:s,home:r}=t,[i,o]=$.useState(!1);let l;e[0]!==s.id?(l={id:s.id},e[0]=s.id,e[1]=l):l=e[1];const{attributes:d,listeners:a,setNodeRef:m,transform:c,transition:u,isDragging:f}=Ft(l),h=Ge(s)||"Quick access";let x;e[2]!==c?(x=Ut.Transform.toString(c),e[2]=c,e[3]=x):x=e[3];const p=f?.5:void 0,g=f?100:void 0;let y;e[4]!==x||e[5]!==p||e[6]!==g||e[7]!==u?(y={transform:x,transition:u,opacity:p,zIndex:g},e[4]=x,e[5]=p,e[6]=g,e[7]=u,e[8]=y):y=e[8];const j=y,w=f&&"shadow-lg";let v;e[9]!==w?(v=G("rounded-lg border border-border bg-card",w),e[9]=w,e[10]=v):v=e[10];const b=`Drag to reorder ${s.title??s.id}`;let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(Qe,{size:14}),e[11]=N):N=e[11];let S;e[12]!==d||e[13]!==a||e[14]!==b?(S=n.jsx("button",{type:"button",...d,...a,className:"shrink-0 text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing outline-none focus-visible:ring-2 focus-visible:ring-ring rounded","aria-label":b,children:N}),e[12]=d,e[13]=a,e[14]=b,e[15]=S):S=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=()=>o(Zs),e[16]=_):_=e[16];const C=s.title??s.id;let I;e[17]!==s.icon||e[18]!==C?(I=n.jsx(de,{icon:s.icon,name:C,size:"sm"}),e[17]=s.icon,e[18]=C,e[19]=I):I=e[19];const T=s.title??s.id;let E;e[20]!==T?(E=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:T}),e[20]=T,e[21]=E):E=e[21];let P;e[22]!==h?(P=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:h}),e[22]=h,e[23]=P):P=e[23];let M;e[24]!==E||e[25]!==P?(M=n.jsxs("div",{className:"min-w-0 flex-1",children:[E,P]}),e[24]=E,e[25]=P,e[26]=M):M=e[26];const Q=i&&"rotate-180";let z;e[27]!==Q?(z=G("shrink-0 text-muted-foreground transition-transform",Q),e[27]=Q,e[28]=z):z=e[28];let R;e[29]!==z?(R=n.jsx(Ue,{size:16,className:z}),e[29]=z,e[30]=R):R=e[30];let q;e[31]!==i||e[32]!==I||e[33]!==M||e[34]!==R?(q=n.jsxs("button",{type:"button",onClick:_,className:"flex min-w-0 flex-1 items-center gap-2.5 text-left outline-none","aria-expanded":i,children:[I,M,R]}),e[31]=i,e[32]=I,e[33]=M,e[34]=R,e[35]=q):q=e[35];let A;e[36]!==s.id||e[37]!==r?(A=()=>r.removeAgent(s.id).catch(Xs),e[36]=s.id,e[37]=r,e[38]=A):A=e[38];const B=`Remove ${s.title??s.id} from home`;let L;e[39]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx(Pe,{size:14}),e[39]=L):L=e[39];let O;e[40]!==A||e[41]!==B?(O=n.jsx("button",{type:"button",onClick:A,"aria-label":B,title:"Remove from home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-destructive/10 hover:text-destructive",children:L}),e[40]=A,e[41]=B,e[42]=O):O=e[42];let D;e[43]!==S||e[44]!==q||e[45]!==O?(D=n.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2.5",children:[S,q,O]}),e[43]=S,e[44]=q,e[45]=O,e[46]=D):D=e[46];let F;e[47]!==s||e[48]!==i||e[49]!==r?(F=i&&n.jsx(Je,{agent:s,home:r}),e[47]=s,e[48]=i,e[49]=r,e[50]=F):F=e[50];let K;return e[51]!==m||e[52]!==j||e[53]!==D||e[54]!==F||e[55]!==v?(K=n.jsxs("div",{ref:m,style:j,className:v,children:[D,F]}),e[51]=m,e[52]=j,e[53]=D,e[54]=F,e[55]=v,e[56]=K):K=e[56],K}function Xs(){return U.error("Couldn't remove from home — please try again.")}function Zs(t){return!t}function Ys({agent:t,home:e}){const[s,r]=$.useState(!1),[i,o]=$.useState(!1),l=Ge(t),d=async()=>{if(!e.atLimit){o(!0);try{await e.addAgent(t.id)}catch{U.error("Couldn't add to home — please try again.")}finally{o(!1)}}};return n.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[n.jsxs("button",{type:"button",onClick:()=>r(a=>!a),className:"flex min-w-0 flex-1 items-center gap-3 text-left outline-none","aria-expanded":s,children:[n.jsx(de,{icon:t.icon,name:t.title??t.id,size:"sm"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.title??t.id}),l&&n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:l})]}),n.jsx(Ue,{size:16,className:G("shrink-0 text-muted-foreground transition-transform",s&&"rotate-180")})]}),n.jsx("button",{type:"button",onClick:d,disabled:i||e.atLimit,"aria-label":"Add to home",title:e.atLimit?`Home is full (${ne}) — remove an agent first`:"Add to home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md bg-foreground text-background text-xs hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed",children:i?n.jsx(ae,{size:12,className:"animate-spin"}):n.jsx(ye,{size:14})})]}),s&&n.jsx(Je,{agent:t,home:e})]})}function Je(t){const e=k.c(17),{agent:s,home:r}=t,i=s.metadata?.ui;let o;e[0]!==i?(o=Z(i),e[0]=i,e[1]=o):o=e[1];const l=o;let d;e[2]!==s.connections?(d=(s.connections??[]).map(en).sort(),e[2]=s.connections,e[3]=d):d=e[3];const a=d,m=s.metadata?.ui?.homePrompts;let c;e[4]!==s||e[5]!==a||e[6]!==r||e[7]!==l?(c=n.jsx(sn,{agent:s,home:r,connectionIds:a,pinnedTiles:l}),e[4]=s,e[5]=a,e[6]=r,e[7]=l,e[8]=c):c=e[8];let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(tn,{}),e[9]=u):u=e[9];const f=m??null;let h;e[10]!==s||e[11]!==r||e[12]!==f?(h=n.jsx($.Suspense,{fallback:u,children:n.jsx(an,{agent:s,home:r,curated:f})}),e[10]=s,e[11]=r,e[12]=f,e[13]=h):h=e[13];let x;return e[14]!==c||e[15]!==h?(x=n.jsxs("div",{className:"border-t border-border px-3 py-2 flex flex-col gap-3",children:[c,h]}),e[14]=c,e[15]=h,e[16]=x):x=e[16],x}function en(t){return t.connection_id}function tn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[n.jsx(H,{className:"h-8 w-full"}),n.jsx(H,{className:"h-8 w-2/3"})]}),t[0]=e):e=t[0],e}function sn({agent:t,home:e,connectionIds:s,pinnedTiles:r}){const i=Ve(),{data:o,isLoading:l}=se({queryKey:te.projectConnectionDetails(t.id,s),enabled:s.length>0,queryFn:async()=>(await Promise.all(s.map(async u=>{try{const{item:f}=await i.call("COLLECTION_CONNECTIONS_GET",{id:u}),h=(f?.tools??[]).flatMap(x=>{const p=Be(x._meta);return p?[{name:x.name,description:x.description,resourceUri:p,inputSchema:x.inputSchema}]:[]});return{id:u,title:f?.title??u,icon:f?.icon??null,uiTools:h}}catch{return{id:u,title:u,icon:null,uiTools:[]}}}))).filter(u=>u.uiTools.length>0)});if(s.length===0)return null;if(l)return n.jsxs("div",{className:"flex flex-col gap-1 py-0.5",children:[n.jsx(H,{className:"h-7 w-full"}),n.jsx(H,{className:"h-7 w-2/3"})]});if(!o||o.length===0)return null;const d=new Map;for(const c of o)for(const u of c.uiTools)d.set(`${c.id}:${u.name}`,{conn:c,tool:u});const a=c=>{if(c.toolName&&c.connectionId)return d.get(`${c.connectionId}:${c.toolName}`);for(const[,u]of d)if(u.conn.id===c.connectionId&&u.tool.resourceUri===c.resourceUri)return u},m=r.some(c=>!!a(c));return n.jsxs("div",{className:"flex flex-col gap-2",children:[m&&n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground px-2",children:"Pinned tiles"}),r.map(c=>{const u=a(c);return u?n.jsx(on,{agent:t,home:e,connection:u.conn,tool:u.tool,tile:c},c.tileId??`${c.connectionId}:${c.resourceUri}:${c.toolName}`):null})]}),n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground px-2",children:"Add tile"}),o.map(c=>c.uiTools.map(u=>n.jsx(ln,{agent:t,home:e,connection:c,tool:u},`add:${c.id}:${u.name}`)))]})]})}function Xe(t,e){const s={};for(const[r,i]of Object.entries(t)){const o=e[r]?.type;if((o==="object"||o==="array")&&typeof i=="string"){if(!i.trim())continue;try{s[r]=JSON.parse(i)}catch{return null}}else if((o==="number"||o==="integer")&&typeof i=="string"){if(!i.trim())continue;s[r]=Number(i)}else i!==""&&i!=null&&(s[r]=i)}return s}function nn(t,e){if(!t||!e)return{};const s={};for(const[r,i]of Object.entries(t)){const o=e[r]?.type;(o==="object"||o==="array")&&i!=null&&typeof i!="string"?s[r]=JSON.stringify(i,null,2):s[r]=i}return s}function rn(t){if(!t)return"";const e=Object.entries(t).filter(([,s])=>s!=null&&s!=="");return e.length===0?"":e.slice(0,3).map(([s,r])=>{const i=typeof r=="object"?JSON.stringify(r):String(r);return`${s}=${i.length>20?`${i.slice(0,20)}…`:i}`}).join(", ")}function on({agent:t,home:e,connection:s,tool:r,tile:i}){const[o,l]=$.useState(!1),[d,a]=$.useState(!1),m=r.inputSchema?.properties&&Object.keys(r.inputSchema.properties).length>0,[c,u]=$.useState(()=>nn(i.toolInput,r.inputSchema?.properties)),f=async()=>{l(!0);try{const p=Z(t.metadata?.ui),g=i.tileId?p.filter(j=>j.tileId!==i.tileId):p.filter(j=>j!==i),y={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:g}};await e.saveAgentMetadata(t,y),a(!1)}catch(p){console.error("[home-tiles] failed to remove tile",p),U.error("Couldn't update home — please try again.")}finally{l(!1)}},h=async()=>{l(!0);try{let p;if(m&&r.inputSchema?.properties){const w=Xe(c,r.inputSchema.properties);if(!w){U.error("Invalid JSON in one of the fields — please fix it."),l(!1);return}Object.keys(w).length>0&&(p=w)}const y=Z(t.metadata?.ui).map(w=>(i.tileId?w.tileId===i.tileId:w===i)?{...w,toolInput:p}:w),j={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:y}};await e.saveAgentMetadata(t,j),a(!1)}catch(p){console.error("[home-tiles] failed to save tile",p),U.error("Couldn't update home — please try again.")}finally{l(!1)}},x=rn(i.toolInput);return n.jsxs("div",{className:"flex flex-col rounded-md bg-accent/20",children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-2 py-1",children:[n.jsx(qe,{icon:s.icon,name:s.title,size:"xs"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-sm text-foreground",children:je(r.name)}),x&&n.jsx("div",{className:"truncate text-[10px] text-muted-foreground font-mono",children:x})]}),m&&n.jsx("button",{type:"button",onClick:()=>a(p=>!p),"aria-label":"Configure tile props",title:"Configure tile props",className:"inline-flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-accent/60",children:n.jsx(Et,{size:14})}),n.jsx(we,{isPinned:!0,submitting:o,onClick:f,label:"Remove from home"})]}),d&&m&&r.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Ke,{properties:r.inputSchema.properties,required:r.inputSchema.required,values:c,onChange:(p,g)=>u(y=>({...y,[p]:g}))}),n.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[n.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>a(!1),children:"Cancel"}),n.jsx(Y,{size:"sm",className:"h-7 text-xs",disabled:o,onClick:h,children:o?n.jsx(ae,{size:12,className:"animate-spin"}):"Save"})]})]})]})}function ln({agent:t,home:e,connection:s,tool:r}){const[i,o]=$.useState(!1),[l,d]=$.useState(!1),a=r.inputSchema?.properties&&Object.keys(r.inputSchema.properties).length>0,[m,c]=$.useState({}),u=async()=>{if(a&&!l){d(!0);return}if(!e.isOnHome(t.id)&&e.atLimit){U.error(`Home is full (${ne}) — remove an agent first`);return}await f()},f=async()=>{o(!0);try{let h;if(a&&r.inputSchema?.properties){const y=Xe(m,r.inputSchema.properties);if(!y){U.error("Invalid JSON in one of the fields — please fix it."),o(!1);return}Object.keys(y).length>0&&(h=y)}const p=[...Z(t.metadata?.ui),{tileId:crypto.randomUUID(),connectionId:s.id,resourceUri:r.resourceUri,toolName:r.name,...h?{toolInput:h}:{}}],g={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:p}};await e.saveAgentMetadata(t,g),d(!1),c({})}catch(h){console.error("[home-tiles] failed to add tile",h),U.error("Couldn't update home — please try again.")}finally{o(!1)}};return n.jsxs("div",{className:"flex flex-col rounded-md hover:bg-accent/40",children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-2 py-1",children:[n.jsx(qe,{icon:s.icon,name:s.title,size:"xs"}),n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:je(r.name)}),n.jsx(we,{isPinned:!1,submitting:i,onClick:u,label:"Add to home"})]}),l&&a&&r.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Ke,{properties:r.inputSchema.properties,required:r.inputSchema.required,values:m,onChange:(h,x)=>c(p=>({...p,[h]:x}))}),n.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[n.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>{d(!1),c({})},children:"Cancel"}),n.jsx(Y,{size:"sm",className:"h-7 text-xs",disabled:i,onClick:f,children:i?n.jsx(ae,{size:12,className:"animate-spin"}):"Pin"})]})]})]})}function we(t){const e=k.c(11),{isPinned:s,submitting:r,onClick:i,label:o}=t,l=s?"text-muted-foreground hover:bg-destructive/10 hover:text-destructive":"bg-foreground text-background hover:opacity-90";let d;e[0]!==l?(d=G("inline-flex size-7 shrink-0 items-center justify-center rounded-md text-xs transition-colors disabled:opacity-50 disabled:cursor-progress",l),e[0]=l,e[1]=d):d=e[1];let a;e[2]!==s||e[3]!==r?(a=r?n.jsx(ae,{size:12,className:"animate-spin"}):s?n.jsx(Ot,{size:14}):n.jsx(ye,{size:14}),e[2]=s,e[3]=r,e[4]=a):a=e[4];let m;return e[5]!==o||e[6]!==i||e[7]!==r||e[8]!==d||e[9]!==a?(m=n.jsx("button",{type:"button",onClick:i,disabled:r,"aria-label":o,title:o,className:d,children:a}),e[5]=o,e[6]=i,e[7]=r,e[8]=d,e[9]=a,e[10]=m):m=e[10],m}function an(t){const e=k.c(32),{agent:s,home:r,curated:i}=t,{org:o}=J();let l;e[0]!==s.id||e[1]!==o.id||e[2]!==o.slug?(l={connectionId:s.id,orgId:o.id,orgSlug:o.slug},e[0]=s.id,e[1]=o.id,e[2]=o.slug,e[3]=l):l=e[3];const d=ce(l);let a;e[4]!==s.id||e[5]!==o.id?(a=te.agentPrompts(o.id,s.id),e[4]=s.id,e[5]=o.id,e[6]=a):a=e[6];let m;e[7]!==d?(m=async()=>{const{prompts:b}=await d.listPrompts();return b.map(un)},e[7]=d,e[8]=m):m=e[8];let c;e[9]!==a||e[10]!==m?(c={queryKey:a,queryFn:m,staleTime:3e4,retry:!1},e[9]=a,e[10]=m,e[11]=c):c=e[11];const{data:u,isLoading:f,error:h}=se(c),x=ve(o.slug);let p,g;if(e[12]!==s.id||e[13]!==u||e[14]!==x.prompts){let b;e[17]!==s.id?(b=S=>S.agentId===s.id&&S.promptName,e[17]=s.id,e[18]=b):b=e[18],p=x.prompts.filter(b).map(mn);let N;e[19]!==u?(N=u??[],e[19]=u,e[20]=N):N=e[20],g=[...N];for(const S of p)g.some(_=>_.name===S.name)||g.push(S);e[12]=s.id,e[13]=u,e[14]=x.prompts,e[15]=p,e[16]=g}else p=e[15],g=e[16];if(f&&p.length===0){let b;return e[21]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(H,{className:"h-7 w-full"}),n.jsx(H,{className:"h-7 w-2/3"})]}),e[21]=b):b=e[21],b}if(h&&p.length===0)return console.error("[home-tiles] listPrompts failed for agent",s.id,h),null;if(g.length===0)return null;let y;e[22]!==i||e[23]!==g?(y=i??g.map(dn),e[22]=i,e[23]=g,e[24]=y):y=e[24];let j;e[25]!==y?(j=new Set(y),e[25]=y,e[26]=j):j=e[26];const w=j;let v;return e[27]!==s||e[28]!==r||e[29]!==g||e[30]!==w?(v=n.jsx("div",{className:"flex flex-col gap-0.5",children:g.map(b=>n.jsx(fn,{agent:s,home:r,prompt:b,allPromptNames:g.map(cn),isPinned:w.has(b.name)},b.name))}),e[27]=s,e[28]=r,e[29]=g,e[30]=w,e[31]=v):v=e[31],v}function cn(t){return t.name}function dn(t){return t.name}function mn(t){return{name:t.promptName,title:t.title,description:t.description}}function un(t){return{name:t.name,title:t.title,description:t.description}}function fn({agent:t,home:e,prompt:s,allPromptNames:r,isPinned:i}){const[o,l]=$.useState(!1),d=async()=>{if(!i&&!e.isOnHome(t.id)&&e.atLimit){U.error(`Home is full (${ne}) — remove an agent first`);return}l(!0);try{const a=t.metadata?.ui?.homePrompts;let m;Array.isArray(a)?m=i?a.filter(u=>u!==s.name):[...a,s.name]:m=i?r.filter(u=>u!==s.name):r;const c={...t.metadata??{},ui:{...t.metadata?.ui??{},homePrompts:m}};await e.saveAgentMetadata(t,c)}catch(a){console.error("[home-tiles] failed to toggle prompt",a),U.error("Couldn't update home — please try again.")}finally{l(!1)}};return n.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:s.title??je(s.name)}),n.jsx(we,{isPinned:i,submitting:o,onClick:d,label:i?"Remove from home":"Add to home"})]})}function hn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex flex-col gap-2 p-2",children:Array.from({length:4},pn)}),t[0]=e):e=t[0],e}function pn(t,e){return n.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border p-2.5",children:[n.jsx(H,{className:"size-8 rounded-md"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"h-2.5 w-1/3"})]})]},e)}const ee=1,Ze=`home-board.layout.v${ee}`;function Ye(t){return`home-board.layout.v${ee}.${t}`}const et={version:ee,tiles:{},hidden:[]};function pe(t){return!t||t.version!==ee?et:{version:ee,tiles:t.tiles??{},hidden:Array.isArray(t.hidden)?t.hidden:[]}}function xn(t){return Object.keys(t.tiles).length>0||t.hidden.length>0}function gn(t){try{const e=localStorage.getItem(Ye(t));return e?pe(JSON.parse(e)):void 0}catch{return}}function Ie(t,e){try{localStorage.setItem(Ye(t),JSON.stringify(e))}catch{}}async function Te(t,e){if(!(await fetch(`/api/${t}/kv/${Ze}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save board layout")}function bn(t){const e=k.c(24),s=le();let r;e[0]!==t?(r=te.boardLayout(t),e[0]=t,e[1]=r):r=e[1];const i=r;let o;e[2]!==t?(o=gn(t),e[2]=t,e[3]=o):o=e[3];const l=o;let d;e[4]!==l||e[5]!==t?(d=async()=>{const y=await fetch(`/api/${t}/kv/${Ze}`);if(y.status===404)return l&&xn(l)?(await Te(t,l),l):et;if(!y.ok)throw new Error("Failed to load board layout");const j=await y.json(),w=pe(j.value);return Ie(t,w),w},e[4]=l,e[5]=t,e[6]=d):d=e[6];let a;e[7]!==l||e[8]!==i||e[9]!==d?(a={queryKey:i,queryFn:d,initialData:l,staleTime:0,refetchOnWindowFocus:!1},e[7]=l,e[8]=i,e[9]=d,e[10]=a):a=e[10];const{data:m,isLoading:c}=se(a);let u;e[11]!==t?(u={mutationFn:y=>Te(t,y)},e[11]=t,e[12]=u):u=e[12];const f=bt(u);let h;e[13]!==f||e[14]!==t||e[15]!==s||e[16]!==i?(h=y=>{Ie(t,y),s.setQueryData(i,y),f.mutate(y)},e[13]=f,e[14]=t,e[15]=s,e[16]=i,e[17]=h):h=e[17];const x=h;let p;e[18]!==m?(p=pe(m),e[18]=m,e[19]=p):p=e[19];let g;return e[20]!==c||e[21]!==x||e[22]!==p?(g={layout:p,isLoading:c,save:x},e[20]=c,e[21]=x,e[22]=p,e[23]=g):g=e[23],g}const tt=$.createContext(null);function yn(t){const e=k.c(24),{children:s}=t,{org:r}=J(),i=bn(r.slug),[o,l]=$.useState(!1),[d,a]=$.useState(null);let m;e[0]!==i.layout?(m=()=>{a(i.layout),l(!0)},e[0]=i.layout,e[1]=m):m=e[1];const c=m;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{a(null),l(!1)},e[2]=u):u=e[2];const f=u;let h;e[3]!==d||e[4]!==i?(h=()=>{d&&i.save(d),a(null),l(!1)},e[3]=d,e[4]=i,e[5]=h):h=e[5];const x=h,p=o&&d!==null,g=p?d:i.layout;let y;e[6]!==d||e[7]!==p||e[8]!==i.layout?(y=p?JSON.stringify(d)!==JSON.stringify(i.layout):!1,e[6]=d,e[7]=p,e[8]=i.layout,e[9]=y):y=e[9];const j=y;let w;e[10]!==o||e[11]!==i?(w=S=>{o?a(S):i.save(S)},e[10]=o,e[11]=i,e[12]=w):w=e[12];const v=w;let b;e[13]!==v||e[14]!==c||e[15]!==j||e[16]!==o||e[17]!==g||e[18]!==x||e[19]!==i.isLoading?(b={isEditMode:o,enter:c,cancel:f,save:x,hasChanges:j,layout:g,isLayoutLoading:i.isLoading,commitLayout:v},e[13]=v,e[14]=c,e[15]=j,e[16]=o,e[17]=g,e[18]=x,e[19]=i.isLoading,e[20]=b):b=e[20];let N;return e[21]!==s||e[22]!==b?(N=n.jsx(tt.Provider,{value:b,children:s}),e[21]=s,e[22]=b,e[23]=N):N=e[23],N}function st(){const t=$.useContext(tt);if(!t)throw new Error("useHomeEdit must be used within a HomeEditProvider");return t}function vn({agentId:t}){const{org:e,locator:s}=J(),r=ce({connectionId:t,orgId:e.id,orgSlug:e.slug}),{create:i}=vs(),{setTaskId:o}=Zt(),[l,d]=$.useState(null),[a,m]=$.useState(!1),c=$.useRef(!1),u=async(g,y)=>{if(!r){U.error("MCP client not available");return}if(!c.current){c.current=!0,m(!0);try{const j=await ys(r,g.name,y),w={type:"doc",content:[{type:"paragraph",content:[ss({id:g.name,name:ns(g.name,is(g._meta)),metadata:j.messages,char:"/",kind:"prompt",args:y}),{type:"text",text:" "}]}]},v=crypto.randomUUID();js(sessionStorage,s,v,{tiptapDoc:w}),await i({id:v,virtual_mcp_id:t}),o(v,t,{autosend:!0})}catch(j){console.error("[start-thread-from-prompt] failed",j),U.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},f=async g=>{if(!c.current){if(g.arguments&&g.arguments.length>0){d(g);return}await u(g)}},h=async g=>{if(!l)return;const y=l;d(null),await u(y,g)};return{start:f,startBlank:async g=>{if(!c.current){c.current=!0,m(!0);try{const y=crypto.randomUUID();await i({id:y,virtual_mcp_id:t}),o(y,t,g?.main?{main:g.main}:void 0)}catch(y){console.error("[start-thread-from-prompt] startBlank failed",y),U.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},dialog:n.jsx(ts,{prompt:l,setPrompt:g=>d(g),onSubmit:h}),dialogPrompt:l,starting:a}}const V=4,W=100,ke=12,jn=5,wn={w:2,h:2};class xe extends $.Component{state={hasError:!1};static getDerivedStateFromError(e){return{hasError:!0,message:e instanceof Error?e.message:"Unknown error"}}componentDidCatch(e,s){console.error("[home-tiles] tile crashed:",e,s.componentStack)}render(){return this.state.hasError?n.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-center",children:[n.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-destructive/10 text-destructive",children:n.jsx(yt,{size:16})}),n.jsx("p",{className:"text-sm font-medium text-foreground",children:"This tile crashed"}),n.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:this.state.message??"Something went wrong rendering this tile."})]}):this.props.children}}function Nn(t){const e=k.c(72),{tiles:s,isEditMode:r,renderTile:i,onMove:o,onResize:l,onRemove:d}=t,a=be(),m=$.useRef(null),[c,u]=$.useState(null),[f,h]=$.useState(null);let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x={activationConstraint:{distance:4}},e[0]=x):x=e[0];const p=Me(oe(Re,x),oe(ze)),g=s.reduce(Sn,0),y=r?Math.max(g+2,4):Math.max(g,1);let j;e[1]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{const A=m.current?.getBoundingClientRect();return A?{cellWidth:A.width/V,cellHeight:W}:null},e[1]=j):j=e[1];const w=j;let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=A=>{u(String(A.active.id)),h(w())},e[2]=v):v=e[2];const b=v;let N;e[3]!==f||e[4]!==o||e[5]!==s?(N=A=>{const B=String(A.active.id),L=f??w();if(u(null),h(null),!L||L.cellWidth<=0)return;const O=s.find(K=>K.id===B);if(!O)return;const D=Math.round(A.delta.x/L.cellWidth),F=Math.round(A.delta.y/L.cellHeight);D===0&&F===0||o(B,{x:O.x+D,y:O.y+F})},e[3]=f,e[4]=o,e[5]=s,e[6]=N):N=e[6];const S=N;if(a){let A;if(e[7]!==i||e[8]!==s){let L;e[10]!==i?(L=O=>n.jsx("div",{className:"group bg-card card-shadow rounded-2xl overflow-hidden",style:{minHeight:W},children:n.jsx(xe,{children:i(O)})},O.id),e[10]=i,e[11]=L):L=e[11],A=s.map(L),e[7]=i,e[8]=s,e[9]=A}else A=e[9];let B;return e[12]!==A?(B=n.jsx("div",{className:"flex flex-col gap-3 px-4 pb-8",children:A}),e[12]=A,e[13]=B):B=e[13],B}let _,C,I,T,E,P,M,Q,z;if(e[14]!==c||e[15]!==f||e[16]!==r||e[17]!==S||e[18]!==d||e[19]!==l||e[20]!==i||e[21]!==p||e[22]!==s||e[23]!==y){const A=c?s.find(X=>X.id===c):null;C=Le,Q=p,z=b,I=S;const B=y*W,L=r?W*4:W;let O;e[33]!==B||e[34]!==L?(O={height:B,minHeight:L},e[33]=B,e[34]=L,e[35]=O):O=e[35];let D;e[36]!==r||e[37]!==s||e[38]!==y?(D=r&&n.jsx(Cn,{rows:y,tiles:s}),e[36]=r,e[37]=s,e[38]=y,e[39]=D):D=e[39];let F;if(e[40]!==c||e[41]!==r||e[42]!==d||e[43]!==l||e[44]!==i||e[45]!==s){let X;e[47]!==c||e[48]!==r||e[49]!==d||e[50]!==l||e[51]!==i?(X=ie=>n.jsx(In,{tile:ie,isEditMode:r,isDragging:c===ie.id,onResize:l,onRemove:d,children:i(ie)},ie.id),e[47]=c,e[48]=r,e[49]=d,e[50]=l,e[51]=i,e[52]=X):X=e[52],F=s.map(X),e[40]=c,e[41]=r,e[42]=d,e[43]=l,e[44]=i,e[45]=s,e[46]=F}else F=e[46];e[53]!==O||e[54]!==D||e[55]!==F?(T=n.jsxs("div",{ref:m,className:"relative w-full",style:O,children:[D,F]}),e[53]=O,e[54]=D,e[55]=F,e[56]=T):T=e[56],_=qt,E=null;const K=A&&f?A.w*f.cellWidth-ke:void 0,me=A&&f?A.h*f.cellHeight-ke:void 0;e[57]!==K||e[58]!==me?(P={width:K,height:me},e[57]=K,e[58]=me,e[59]=P):P=e[59],M=A&&n.jsx("div",{className:"bg-card card-shadow rounded-2xl shadow-2xl ring-2 ring-primary/40 h-full overflow-hidden opacity-95",children:n.jsx(xe,{children:i(A)})}),e[14]=c,e[15]=f,e[16]=r,e[17]=S,e[18]=d,e[19]=l,e[20]=i,e[21]=p,e[22]=s,e[23]=y,e[24]=_,e[25]=C,e[26]=I,e[27]=T,e[28]=E,e[29]=P,e[30]=M,e[31]=Q,e[32]=z}else _=e[24],C=e[25],I=e[26],T=e[27],E=e[28],P=e[29],M=e[30],Q=e[31],z=e[32];let R;e[60]!==_||e[61]!==E||e[62]!==P||e[63]!==M?(R=n.jsx(_,{dropAnimation:E,style:P,children:M}),e[60]=_,e[61]=E,e[62]=P,e[63]=M,e[64]=R):R=e[64];let q;return e[65]!==C||e[66]!==I||e[67]!==T||e[68]!==R||e[69]!==Q||e[70]!==z?(q=n.jsxs(C,{sensors:Q,onDragStart:z,onDragEnd:I,children:[T,R]}),e[65]=C,e[66]=I,e[67]=T,e[68]=R,e[69]=Q,e[70]=z,e[71]=q):q=e[71],q}function Sn(t,e){return Math.max(t,e.y+e.h)}function Cn(t){const e=k.c(7),{rows:s,tiles:r}=t;let i;e[0]!==r?(i=(a,m)=>r.some(c=>a>=c.x&&a<c.x+c.w&&m>=c.y&&m<c.y+c.h),e[0]=r,e[1]=i):i=e[1];const o=i;let l;if(e[2]!==o||e[3]!==s){l=[];for(let a=0;a<s;a++)for(let m=0;m<V;m++)o(m,a)||l.push({x:m,y:a});e[2]=o,e[3]=s,e[4]=l}else l=e[4];let d;return e[5]!==l?(d=n.jsx("div",{className:"absolute inset-0 pointer-events-none",children:l.map(_n)}),e[5]=l,e[6]=d):d=e[6],d}function _n(t){return n.jsx("div",{className:"absolute p-1",style:{left:`${t.x/V*100}%`,top:t.y*W,width:`${1/V*100}%`,height:W},children:n.jsx("div",{className:"h-full w-full rounded-2xl border border-dashed border-border/60"})},`${t.x}-${t.y}`)}function In(t){const e=k.c(31),{tile:s,isEditMode:r,isDragging:i,onResize:o,onRemove:l,children:d}=t,a=!r;let m;e[0]!==a||e[1]!==s.id?(m={id:s.id,disabled:a},e[0]=a,e[1]=s.id,e[2]=m):m=e[2];const{setNodeRef:c,attributes:u,listeners:f,isDragging:h}=Vt(m),x=`${s.x/V*100}%`,p=`${s.w/V*100}%`,g=s.y*W,y=s.h*W,j=h||i,w=!j&&"transition-[left,top,width,height,opacity] duration-200 ease-out",v=j&&"opacity-30";let b;e[3]!==w||e[4]!==v?(b=G("absolute p-1 will-change-[left,top,width,height,opacity]",w,v),e[3]=w,e[4]=v,e[5]=b):b=e[5];let N;e[6]!==y||e[7]!==x||e[8]!==g||e[9]!==p?(N={left:x,top:g,width:p,height:y},e[6]=y,e[7]=x,e[8]=g,e[9]=p,e[10]=N):N=e[10];const S=r&&"outline outline-1 outline-transparent hover:outline-primary/40";let _;e[11]!==S?(_=G("group relative h-full bg-card card-shadow rounded-2xl overflow-hidden",S),e[11]=S,e[12]=_):_=e[12];let C;e[13]!==u||e[14]!==r||e[15]!==f||e[16]!==l||e[17]!==o||e[18]!==s?(C=r&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",...u,...f,className:"absolute top-2 left-2 z-10 flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted cursor-grab active:cursor-grabbing","aria-label":"Drag tile",children:n.jsx(Qe,{size:16})}),n.jsx("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:n.jsx(Tn,{tile:s,onResize:o,onRemove:l})})]}),e[13]=u,e[14]=r,e[15]=f,e[16]=l,e[17]=o,e[18]=s,e[19]=C):C=e[19];let I;e[20]!==d?(I=n.jsx("div",{className:"h-full overflow-hidden",children:n.jsx(xe,{children:d})}),e[20]=d,e[21]=I):I=e[21];let T;e[22]!==I||e[23]!==_||e[24]!==C?(T=n.jsxs("div",{className:_,children:[C,I]}),e[22]=I,e[23]=_,e[24]=C,e[25]=T):T=e[25];let E;return e[26]!==c||e[27]!==T||e[28]!==b||e[29]!==N?(E=n.jsx("div",{ref:c,className:b,style:N,children:T}),e[26]=c,e[27]=T,e[28]=b,e[29]=N,e[30]=E):E=e[30],E}function Tn(t){const e=k.c(20),{tile:s,onResize:r,onRemove:i}=t,[o,l]=$.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(ws,{asChild:!0,children:n.jsx("button",{type:"button",className:"flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted","aria-label":"Tile options",children:n.jsx(Pt,{size:16})})}),e[0]=d):d=e[0];let a;e[1]!==r||e[2]!==s.id?(a=g=>{r(s.id,g),l(!1)},e[1]=r,e[2]=s.id,e[3]=a):a=e[3];let m;e[4]!==a||e[5]!==s?(m=n.jsx(kn,{tile:s,onPick:a}),e[4]=a,e[5]=s,e[6]=m):m=e[6];let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(Ns,{}),e[7]=c):c=e[7];let u;e[8]!==i||e[9]!==s.id?(u=()=>i(s.id),e[8]=i,e[9]=s.id,e[10]=u):u=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Is,{size:14,className:"mr-2"}),e[11]=f):f=e[11];let h;e[12]!==u?(h=n.jsxs(Ss,{onSelect:u,className:"text-destructive focus:text-destructive",children:[f,"Remove tile"]}),e[12]=u,e[13]=h):h=e[13];let x;e[14]!==m||e[15]!==h?(x=n.jsxs(Cs,{align:"end",className:"w-auto",children:[m,c,h]}),e[14]=m,e[15]=h,e[16]=x):x=e[16];let p;return e[17]!==o||e[18]!==x?(p=n.jsxs(_s,{open:o,onOpenChange:l,children:[d,x]}),e[17]=o,e[18]=x,e[19]=p):p=e[19],p}function kn(t){const e=k.c(19),{tile:s,onPick:r}=t,i=s.minW??1,o=s.minH??1,[l,d]=$.useState(null);let a;e[0]!==l||e[1]!==s.h||e[2]!==s.w?(a=l??{w:s.w,h:s.h},e[0]=l,e[1]=s.h,e[2]=s.w,e[3]=a):a=e[3];const m=a;let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("span",{className:"text-xs text-muted-foreground",children:"Size"}),e[4]=c):c=e[4];let u;e[5]!==m.h||e[6]!==m.w?(u=n.jsxs("div",{className:"mb-2 flex items-center justify-between gap-4",children:[c,n.jsxs("span",{className:"text-xs font-medium tabular-nums",children:[m.w," × ",m.h]})]}),e[5]=m.h,e[6]=m.w,e[7]=u):u=e[7];let f,h;e[8]===Symbol.for("react.memo_cache_sentinel")?(f={gridTemplateColumns:`repeat(${V}, 1.25rem)`},h=()=>d(null),e[8]=f,e[9]=h):(f=e[8],h=e[9]);let x;e[10]!==m.h||e[11]!==m.w||e[12]!==o||e[13]!==i||e[14]!==r?(x=n.jsx("div",{className:"grid w-max gap-1",style:f,onPointerLeave:h,children:Array.from({length:jn},(g,y)=>Array.from({length:V},(j,w)=>{const v=w+1,b=y+1,N=v<i||b<o,S=v<=m.w&&b<=m.h;return n.jsx("button",{type:"button",disabled:N,"aria-label":`${v} by ${b}`,onPointerEnter:()=>d({w:v,h:b}),onClick:()=>r({w:v,h:b}),className:G("size-5 rounded-sm border transition-colors",S?"border-primary bg-primary/30":"border-border bg-muted",N?"cursor-not-allowed opacity-40":"cursor-pointer hover:border-primary/60")},`${v}x${b}`)}))}),e[10]=m.h,e[11]=m.w,e[12]=o,e[13]=i,e[14]=r,e[15]=x):x=e[15];let p;return e[16]!==u||e[17]!==x?(p=n.jsxs("div",{className:"px-2 py-1.5",children:[u,x]}),e[16]=u,e[17]=x,e[18]=p):p=e[18],p}function $n(t,e,s){return t.some(r=>e>=r.x&&e<r.x+r.w&&s>=r.y&&s<r.y+r.h)}function ge(t,e,s){for(let r=0;r<100;r++)for(let i=0;i<=V-e;i++){let o=!0;for(let l=0;l<s&&o;l++)for(let d=0;d<e&&o;d++)$n(t,i+d,r+l)&&(o=!1);if(o)return{x:i,y:r}}return{x:0,y:0}}function ue(t,e,s={w:1,h:1}){const r=Math.max(s.w,Math.min(V,t)),i=Math.max(s.h,Math.min(6,e));return{w:r,h:i}}function fe(t,e,s){const r=Math.max(0,Math.min(V-s,t)),i=Math.max(0,e);return{x:r,y:i}}function An(t,e,s){const r=t.find(a=>a.id===e);if(!r)return t;const i=t.filter(a=>a.id!==e),o=i.find(a=>s.x>=a.x&&s.x<a.x+a.w&&s.y>=a.y&&s.y<a.y+a.h);if(o&&o.w===r.w&&o.h===r.h)return t.map(a=>a.id===e?{...a,x:o.x,y:o.y}:a.id===o.id?{...a,x:r.x,y:r.y}:a);const d=[{...r,x:s.x,y:s.y}];for(const a of i){const m=ge(d,a.w,a.h);d.push({...a,x:m.x,y:m.y})}return d}function En(t){const e=k.c(35),{layout:s,isLayoutLoading:r,commitLayout:i}=st();let o;e[0]!==s.hidden?(o=new Set(s.hidden),e[0]=s.hidden,e[1]=o):o=e[1];const l=o;let d,a;if(e[2]!==t||e[3]!==l||e[4]!==s.tiles){a=[];let j;e[7]!==l?(j=v=>v.pinned||!l.has(v.id),e[7]=l,e[8]=j):j=e[8];const w=t.filter(j);d=new Map;for(const v of t)v.minSize&&d.set(v.id,v.minSize);for(const v of w){const b=s.tiles[v.id];if(!b)continue;const N=d.get(v.id),{w:S,h:_}=ue(b.w,b.h,N),{x:C,y:I}=fe(b.x,b.y,S);a.push({id:v.id,x:C,y:I,w:S,h:_,minW:N?.w,minH:N?.h})}for(const v of w){if(a.some(I=>I.id===v.id))continue;const b=v.defaultSize??wn,N=d.get(v.id),{w:S,h:_}=ue(b.w,b.h,N),C=ge(a,S,_);a.push({id:v.id,x:C.x,y:C.y,w:S,h:_,minW:N?.w,minH:N?.h})}e[2]=t,e[3]=l,e[4]=s.tiles,e[5]=d,e[6]=a}else d=e[5],a=e[6];let m;e[9]!==t?(m=new Set(t.map(On)),e[9]=t,e[10]=m):m=e[10];const c=m;let u;e[11]!==c||e[12]!==i?(u=(j,w)=>{const v={};for(const b of j)v[b.id]={x:b.x,y:b.y,w:b.w,h:b.h};i({version:ee,tiles:v,hidden:w.filter(b=>c.has(b))})},e[11]=c,e[12]=i,e[13]=u):u=e[13];const f=u;let h;e[14]!==a?(h={visible:a},e[14]=a,e[15]=h):h=e[15];let x;e[16]!==f||e[17]!==s||e[18]!==a?(x=(j,w)=>{const v=a.find(S=>S.id===j);if(!v)return;const b=fe(w.x,w.y,v.w);if(b.x===v.x&&b.y===v.y)return;const N=An(a,j,b);f(N,s.hidden)},e[16]=f,e[17]=s,e[18]=a,e[19]=x):x=e[19];let p;e[20]!==f||e[21]!==s||e[22]!==d||e[23]!==a?(p=(j,w)=>{const v=a.find(T=>T.id===j);if(!v)return;const b=d.get(j),{w:N,h:S}=ue(w.w,w.h,b);if(N===v.w&&S===v.h)return;const _={...v,w:N,h:S,x:fe(v.x,v.y,N).x},C=a.filter(T=>T.id!==j),I=[_];for(const T of C){const E=ge(I,T.w,T.h);I.push({...T,x:E.x,y:E.y})}f(I,s.hidden)},e[20]=f,e[21]=s,e[22]=d,e[23]=a,e[24]=p):p=e[24];let g;e[25]!==f||e[26]!==s||e[27]!==a?(g=j=>{const w=a.filter(v=>v.id!==j);f(w,Array.from(new Set([...s.hidden,j])))},e[25]=f,e[26]=s,e[27]=a,e[28]=g):g=e[28];let y;return e[29]!==r||e[30]!==h||e[31]!==x||e[32]!==p||e[33]!==g?(y={snapshot:h,isLoading:r,moveTile:x,resizeTile:p,hideTile:g},e[29]=r,e[30]=h,e[31]=x,e[32]=p,e[33]=g,e[34]=y):y=e[34],y}function On(t){return t.id}const Pn={w:2,h:4},Mn={w:1,h:2},zn={w:1,h:1};function Rn(t){return`prompt:${t.agentId}:${t.promptName||"blank"}`}function Ln(t){return t.tileId?`tile:${t.tileId}`:`tile:${t.agentId}:${t.resourceUri}`}function Hn(t){return t.promptName?t.agentName:t.description}function Dn(t){return{name:t.promptName,title:t.title,description:t.description,arguments:t.arguments,_meta:t._meta}}function nt(t){const e=k.c(14),{org:s}=J();let r;e[0]!==s.id||e[1]!==s.slug||e[2]!==t.connectionId?(r=Nt({connectionId:t.connectionId,orgId:s.id,orgSlug:s.slug}),e[0]=s.id,e[1]=s.slug,e[2]=t.connectionId,e[3]=r):r=e[3];const{data:i}=se(r),o=!!i&&!t.toolName;let l;e[4]!==i||e[5]!==o?(l={client:i,enabled:o},e[4]=i,e[5]=o,e[6]=l):l=e[6];const{data:d}=xs(l);let a;e[7]!==t.resourceUri||e[8]!==t.toolName||e[9]!==d?.tools?(a=t.toolName??d?.tools.find(u=>Be(u._meta)===t.resourceUri)?.name,e[7]=t.resourceUri,e[8]=t.toolName,e[9]=d?.tools,e[10]=a):a=e[10];const m=a;let c;return e[11]!==t.connectionId||e[12]!==m?(c=m?bs(t.connectionId,m):void 0,e[11]=t.connectionId,e[12]=m,e[13]=c):c=e[13],c}function Ne(t){const e=k.c(10);let s;e[0]!==t?(s={agentId:t},e[0]=t,e[1]=s):s=e[1];const{start:r,startBlank:i,dialog:o,starting:l}=vn(s);let d;e[2]!==r||e[3]!==i?(d=c=>{if(!c.promptName){i();return}r(Dn(c))},e[2]=r,e[3]=i,e[4]=d):d=e[4];const a=d;let m;return e[5]!==o||e[6]!==a||e[7]!==i||e[8]!==l?(m={open:a,startBlank:i,dialog:o,starting:l},e[5]=o,e[6]=a,e[7]=i,e[8]=l,e[9]=m):m=e[9],m}function Fn(t){const e=k.c(32),{entry:s,isEditMode:r}=t,{open:i,dialog:o,starting:l}=Ne(s.agentId);let d;e[0]!==s||e[1]!==i?(d=()=>i(s),e[0]=s,e[1]=i,e[2]=d):d=e[2];const a=l||r,m=!r&&"cursor-pointer transition-colors hover:bg-accent/40",c=r&&"cursor-default pl-12",u=l&&"opacity-60";let f;e[3]!==m||e[4]!==c||e[5]!==u?(f=G("group/tile relative flex h-full w-full items-center gap-3 px-4 py-3 text-left bg-card",m,c,u),e[3]=m,e[4]=c,e[5]=u,e[6]=f):f=e[6];let h;e[7]!==s.agentIcon||e[8]!==s.agentName?(h=n.jsx(de,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[7]=s.agentIcon,e[8]=s.agentName,e[9]=h):h=e[9];let x;e[10]!==s.title?(x=n.jsx("div",{className:"line-clamp-2 text-sm font-medium text-foreground leading-snug",children:s.title}),e[10]=s.title,e[11]=x):x=e[11];let p;e[12]!==s?(p=Hn(s),e[12]=s,e[13]=p):p=e[13];let g;e[14]!==p?(g=n.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:p}),e[14]=p,e[15]=g):g=e[15];let y;e[16]!==g||e[17]!==x?(y=n.jsxs("div",{className:"min-w-0 flex-1",children:[x,g]}),e[16]=g,e[17]=x,e[18]=y):y=e[18];let j;e[19]!==r?(j=!r&&n.jsx(gs,{size:16,className:"shrink-0 text-muted-foreground opacity-0 -translate-x-1 transition-all duration-200 group-hover/tile:opacity-100 group-hover/tile:translate-x-0","aria-hidden":!0}),e[19]=r,e[20]=j):j=e[20];let w;e[21]!==l||e[22]!==d||e[23]!==y||e[24]!==j||e[25]!==a||e[26]!==f||e[27]!==h?(w=n.jsxs("button",{type:"button",onClick:d,disabled:a,"aria-busy":l,className:f,children:[h,y,j]}),e[21]=l,e[22]=d,e[23]=y,e[24]=j,e[25]=a,e[26]=f,e[27]=h,e[28]=w):w=e[28];let v;return e[29]!==o||e[30]!==w?(v=n.jsxs(n.Fragment,{children:[w,o]}),e[29]=o,e[30]=w,e[31]=v):v=e[31],v}function Un(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"mt-4 grid w-full grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:Array.from({length:3},Qn)}),t[0]=e):e=t[0],e}function Qn(t,e){return n.jsxs("div",{className:"flex w-full items-center gap-3 rounded-2xl bg-card card-shadow px-3 py-2.5",children:[n.jsx(H,{className:"size-10 rounded-xl"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(H,{className:"h-3 w-2/3"}),n.jsx(H,{className:"h-2.5 w-1/3"})]})]},`chip-skeleton-${e}`)}function Bn(t){const e=k.c(17),{tile:s,prompts:r,isEditMode:i,tileWidth:o}=t,{org:l}=J(),{open:d,startBlank:a,dialog:m,starting:c}=Ne(s.agentId),u=r.filter(qn),f=nt(s),h="relative flex h-full w-full flex-col p-3";let x;e[0]!==i||e[1]!==f||e[2]!==a||e[3]!==c?(x=!i&&n.jsx("button",{type:"button",onClick:()=>{a(f?{main:f}:void 0)},disabled:c,"aria-busy":c,className:"mb-1 self-start rounded-md px-2 py-1 text-[10px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:"Open chat"}),e[0]=i,e[1]=f,e[2]=a,e[3]=c,e[4]=x):x=e[4];const p="flex min-h-0 flex-1 gap-3 overflow-hidden";let g;e[5]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(Kn,{}),e[5]=g):g=e[5];let y;e[6]!==l.id||e[7]!==l.slug||e[8]!==s?(y=n.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:n.jsx($.Suspense,{fallback:g,children:n.jsx(Vn,{tile:s,orgId:l.id,orgSlug:l.slug})})}),e[6]=l.id,e[7]=l.slug,e[8]=s,e[9]=y):y=e[9];const j=u.length>0&&!i&&o>=2&&n.jsx("div",{className:"flex w-44 shrink-0 flex-col gap-2 overflow-hidden",children:u.map(b=>n.jsx("button",{type:"button",onClick:()=>d(b),disabled:c,className:"shrink-0 rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:n.jsx("span",{className:"line-clamp-2",children:b.title})},b.promptName))});let w;e[10]!==y||e[11]!==j?(w=n.jsxs("div",{className:p,children:[y,j]}),e[10]=y,e[11]=j,e[12]=w):w=e[12];let v;return e[13]!==m||e[14]!==x||e[15]!==w?(v=n.jsxs("div",{className:h,children:[x,w,m]}),e[13]=m,e[14]=x,e[15]=w,e[16]=v):v=e[16],v}function qn(t){return!!t.promptName}function Vn(t){const e=k.c(13),{tile:s,orgId:r,orgSlug:i}=t;let o;e[0]!==r||e[1]!==i||e[2]!==s.connectionId?(o={connectionId:s.connectionId,orgId:r,orgSlug:i},e[0]=r,e[1]=i,e[2]=s.connectionId,e[3]=o):o=e[3];const l=ce(o),d=s.minHeight??200,a=s.maxHeight??4e3;let m;return e[4]!==l||e[5]!==r||e[6]!==i||e[7]!==d||e[8]!==a||e[9]!==s.connectionId||e[10]!==s.resourceUri||e[11]!==s.toolInput?(m=n.jsx(ds,{resourceURI:s.resourceUri,orgId:r,orgSlug:i,connectionId:s.connectionId,client:l,toolInput:s.toolInput,displayMode:"fullscreen",minHeight:d,maxHeight:a,className:"h-full"}),e[4]=l,e[5]=r,e[6]=i,e[7]=d,e[8]=a,e[9]=s.connectionId,e[10]=s.resourceUri,e[11]=s.toolInput,e[12]=m):m=e[12],m}function Kn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex h-full w-full flex-col gap-2 p-4",children:[n.jsx(H,{className:"h-3 w-2/3"}),n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"mt-1 h-full w-full rounded-md"})]}),t[0]=e):e=t[0],e}function Wn(t){const e=k.c(14),{icon:s,name:r}=t;let i;e[0]!==s||e[1]!==r?(i=n.jsx(de,{icon:s,name:r,size:"sm+"}),e[0]=s,e[1]=r,e[2]=i):i=e[2];let o;e[3]!==r?(o=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:r}),e[3]=r,e[4]=o):o=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Loading tile…"}),e[5]=l):l=e[5];let d;e[6]!==o?(d=n.jsxs("div",{className:"min-w-0 flex-1",children:[o,l]}),e[6]=o,e[7]=d):d=e[7];let a;e[8]!==i||e[9]!==d?(a=n.jsxs("div",{className:"flex items-center gap-2.5",children:[i,d]}),e[8]=i,e[9]=d,e[10]=a):a=e[10];let m;e[11]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsxs("div",{className:"flex flex-1 flex-col gap-2 pt-1",children:[n.jsx(H,{className:"h-3 w-3/4"}),n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"h-3 w-2/3"})]}),e[11]=m):m=e[11];let c;return e[12]!==a?(c=n.jsxs("div",{className:"flex h-full w-full flex-col gap-3 p-5 opacity-60",children:[a,m]}),e[12]=a,e[13]=c):c=e[13],c}function Gn(t){const e=k.c(10),{tile:s,prompts:r,isEditMode:i}=t,{open:o,startBlank:l,dialog:d,starting:a}=Ne(s.agentId),m=r.filter(Jn),c=nt(s),u="flex h-full w-full flex-col gap-3 p-4";let f;e[0]!==c||e[1]!==l?(f=()=>{l(c?{main:c}:void 0)},e[0]=c,e[1]=l,e[2]=f):f=e[2];const h=a||i;let x;e[3]!==f||e[4]!==h?(x=n.jsx("button",{type:"button",onClick:f,disabled:h,className:"mb-1 self-start rounded-md px-2 py-1 text-[10px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:"Open chat"}),e[3]=f,e[4]=h,e[5]=x):x=e[5];const p=m.length>0&&!i&&n.jsx("div",{className:"grid grid-cols-1 gap-2 overflow-hidden sm:grid-cols-2",children:m.map(y=>n.jsx("button",{type:"button",onClick:()=>!i&&o(y),disabled:a,className:"rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:n.jsx("span",{className:"line-clamp-2",children:y.title})},y.promptName))});let g;return e[6]!==d||e[7]!==x||e[8]!==p?(g=n.jsxs("div",{className:u,children:[x,p,d]}),e[6]=d,e[7]=x,e[8]=p,e[9]=g):g=e[9],g}function Jn(t){return!!t.promptName}function it({isEditMode:t}){const{org:e}=J(),{isLoading:s,prompts:r,tiles:i}=ve(e.slug),o=He()?.ids??[],l=new Set(o),d=De(),a=Ve(),m=le(),c=new Set(i.map(b=>b.agentId)),u=new Map;for(const b of r){const N=u.get(b.agentId);N?N.push(b):u.set(b.agentId,[b])}const f=r.filter(b=>!c.has(b.agentId)),h=[...i.map(b=>({kind:"tile",id:Ln(b),data:b})),...f.map(b=>({kind:"prompt",id:Rn(b),data:b}))],x=new Map(h.map(b=>[b.id,b])),p=En(h.map(b=>({id:b.id,defaultSize:b.kind==="tile"?Pn:zn,minSize:b.kind==="tile"?Mn:void 0,pinned:l.has(b.data.agentId)}))),g=b=>{d.apply(N=>N.filter(S=>S!==b)).catch(()=>U.error("Couldn't remove from home — please try again."))},y=async b=>{if(i.filter(S=>S.agentId===b.agentId).length<=1){g(b.agentId);return}try{const _=(await a.call("COLLECTION_VIRTUAL_MCP_GET",{id:b.agentId})).item;if(!_)throw new Error("Agent not found");const C=Z(_.metadata?.ui),I=b.tileId?C.filter(T=>T.tileId!==b.tileId):C.filter(T=>T.connectionId!==b.connectionId||T.resourceUri!==b.resourceUri);await a.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:b.agentId,data:{metadata:{..._.metadata??{},ui:{..._.metadata?.ui??{},homeTile:null,homeTiles:I}}}}),m.invalidateQueries({queryKey:te.homeNextActions(e.slug)})}catch{U.error("Couldn't remove tile — please try again.")}},j=b=>{const N=x.get(b);if(N){if(!l.has(N.data.agentId)){p.hideTile(b);return}N.kind==="tile"?y(N.data):g(N.data.agentId)}},w=b=>{const N=x.get(b.id);if(!N)return null;if(N.kind==="tile"){const S=u.get(N.data.agentId)??[];return n.jsx(vt,{fallback:n.jsx(Gn,{tile:N.data,prompts:S,isEditMode:t}),children:n.jsx($.Suspense,{fallback:n.jsx(Wn,{icon:N.data.agentIcon,name:N.data.agentName}),children:n.jsx(Bn,{tile:N.data,prompts:S,isEditMode:t,tileWidth:b.w})})})}return n.jsx(Fn,{entry:N.data,isEditMode:t})};return s||p.isLoading?n.jsx(Un,{}):p.snapshot.visible.length===0&&!t?null:n.jsx("div",{className:"mt-4 flex w-full max-w-7xl flex-col gap-4",children:n.jsx(Nn,{tiles:p.snapshot.visible,isEditMode:t,renderTile:w,onMove:p.moveTile,onResize:p.resizeTile,onRemove:j})})}function Xn(t){const e=k.c(2),{prompts:s,tiles:r}=ve(t),i=r.length>0||s.length>0;let o;return e[0]!==i?(o={hasVisibleTiles:i},e[0]=i,e[1]=o):o=e[1],o}const $e=420,Ae=305;function rt(){const t=k.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("img",{src:"/home/bg-top-left.svg",alt:"",className:"absolute top-0 left-0 h-auto select-none opacity-80 dark:hidden",style:{width:$e}}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("img",{src:"/home/bg-top-left-dark.svg",alt:"",className:"absolute top-0 left-0 hidden h-auto select-none opacity-80 dark:block",style:{width:$e}}),t[1]=s):s=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx("img",{src:"/home/bg-bottom-right.svg",alt:"",className:"absolute bottom-0 right-0 h-auto select-none opacity-80 dark:hidden",style:{width:Ae}}),t[2]=r):r=t[2];let i;return t[3]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 overflow-hidden",children:[e,s,r,n.jsx("img",{src:"/home/bg-bottom-right-dark.svg",alt:"",className:"absolute bottom-0 right-0 hidden h-auto select-none opacity-80 dark:block",style:{width:Ae}})]}),t[3]=i):i=t[3],i}function Ee(){const t=k.c(33),{data:e}=jt.useSession(),{org:s}=J(),r=be(),i=$s(),{selectedVirtualMcp:o}=zt();let l;t[0]!==s.id?(l=St(s.id),t[0]=s.id,t[1]=l):l=t[1];const a=o??l;let m;t[2]!==s.slug?(m=Yt(s.slug),t[2]=s.slug,t[3]=m):m=t[3],se(m);let c;t[4]!==s.id||t[5]!==s.slug?(c={connectionId:Ct,orgId:s.id,orgSlug:s.slug},t[4]=s.id,t[5]=s.slug,t[6]=c):c=t[6];const u=ce(c);let f;t[7]!==s.id||t[8]!==s.slug?(f=Ts(s.slug,s.id),t[7]=s.id,t[8]=s.slug,t[9]=f):f=t[9];let h;t[10]!==s.id||t[11]!==s.slug?(h=Xt(s.slug,s.id),t[10]=s.id,t[11]=s.slug,t[12]=h):h=t[12];let x;t[13]!==a.id||t[14]!==s.id||t[15]!==u?(x=Tt(s.id,a.id,u),t[13]=a.id,t[14]=s.id,t[15]=u,t[16]=x):x=t[16];let p;t[17]!==f||t[18]!==h||t[19]!==x?(p={queries:[f,h,x]},t[17]=f,t[18]=h,t[19]=x,t[20]=p):p=t[20],Ms(p);const g=ks(),y=kt(a.id),{hasDecoKey:j,isZeroBalance:w,isInitialFreeCredit:v,balanceDollars:b,hasOnlyDecoProvider:N}=Wt(),{hasVisibleTiles:S}=Xn(s.slug),_=Gt(y?.metadata);if(g.length===0&&!(_&&Jt(i))){let R;return t[21]===Symbol.for("react.memo_cache_sentinel")?(R=n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsx("div",{className:"min-h-full flex items-center justify-center px-4 py-10",children:n.jsx(Rt,{})})}),t[21]=R):R=t[21],R}let I;t[22]!==e?.user?.name?(I=e?.user?.name?.split(" ")[0]||"there",t[22]=e?.user?.name,t[23]=I):I=t[23];const T=I,E=j&&v&&b!=null,P=j&&w&&N;let M;t[24]!==b||t[25]!==E||t[26]!==P?(M=E?n.jsx(re.CreditsEyebrow,{balanceDollars:b}):P?n.jsx(re.NoCreditsEyebrow,{}):null,t[24]=b,t[25]=E,t[26]=P,t[27]=M):M=t[27];const Q=M;let z;return t[28]!==Q||t[29]!==S||t[30]!==r||t[31]!==T?(z=n.jsx(yn,{children:r?n.jsx(Zn,{eyebrow:Q,userName:T}):n.jsx(Yn,{eyebrow:Q,userName:T,hasVisibleTiles:S})}),t[28]=Q,t[29]=S,t[30]=r,t[31]=T,t[32]=z):z=t[32],z}function Zn(t){const e=k.c(12),{eyebrow:s,userName:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(rt,{}),e[0]=i):i=e[0];let o;e[1]!==s?(o=s&&n.jsx("div",{className:"mb-4",children:s}),e[1]=s,e[2]=o):o=e[2];let l;e[3]!==r?(l=n.jsxs("p",{className:"text-3xl font-medium text-foreground text-center max-w-[280px]",children:["What's on your mind, ",r,"?"]}),e[3]=r,e[4]=l):l=e[4];let d;e[5]!==o||e[6]!==l?(d=n.jsxs("div",{className:"relative flex flex-col items-center justify-center w-full pt-28 pb-8 px-4",children:[o,l]}),e[5]=o,e[6]=l,e[7]=d):d=e[7];let a;e[8]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("div",{className:"relative w-full flex flex-col gap-4 pb-8 px-4",children:n.jsx(re.Input,{showConnectionsBanner:!0})}),e[8]=a):a=e[8];let m;e[9]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx("div",{className:"relative w-full px-4 pb-8",children:n.jsx(it,{isEditMode:!1})}),e[9]=m):m=e[9];let c;return e[10]!==d?(c=n.jsxs("div",{className:"flex-1 relative flex flex-col items-center overflow-y-auto",children:[i,d,a,m]}),e[10]=d,e[11]=c):c=e[11],c}function Yn(t){const e=k.c(32),{eyebrow:s,userName:r,hasVisibleTiles:i}=t,{isEditMode:o,enter:l,save:d,cancel:a,hasChanges:m}=st(),[c,u]=$.useState(!1);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),e[0]=f):f=e[0];let h;e[1]!==a||e[2]!==l||e[3]!==m||e[4]!==o||e[5]!==d?(h=n.jsx(As.Right,{children:n.jsx(ei,{isEditMode:o,hasChanges:m,onEnter:l,onSave:d,onCancel:a,onAddTile:f})}),e[1]=a,e[2]=l,e[3]=m,e[4]=o,e[5]=d,e[6]=h):h=e[6];let x;e[7]!==c?(x=n.jsx(Rs,{open:c,onOpenChange:u}),e[7]=c,e[8]=x):x=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(rt,{}),e[9]=p):p=e[9];const g=i||o?"pt-32":"flex-1 justify-center";let y;e[10]!==g?(y=G("relative flex flex-col items-center px-10 pb-4",g),e[10]=g,e[11]=y):y=e[11];let j;e[12]!==s?(j=s&&n.jsx("div",{className:"mb-4",children:s}),e[12]=s,e[13]=j):j=e[13];let w;e[14]!==r?(w=n.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",r,"?"]}),e[14]=r,e[15]=w):w=e[15];let v;e[16]!==j||e[17]!==w?(v=n.jsxs("div",{className:"text-center mb-10",children:[j,w]}),e[16]=j,e[17]=w,e[18]=v):v=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsxs("div",{className:"relative w-full",children:[n.jsx(ti,{}),n.jsx(re.Input,{showConnectionsBanner:!0})]}),e[19]=b):b=e[19];let N;e[20]!==v?(N=n.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[v,b]}),e[20]=v,e[21]=N):N=e[21];let S;e[22]!==o?(S=n.jsx("div",{className:"relative w-full mt-10 mx-auto max-w-[1280px] px-2 pb-16",children:n.jsx(it,{isEditMode:o})}),e[22]=o,e[23]=S):S=e[23];let _;e[24]!==N||e[25]!==S||e[26]!==y?(_=n.jsxs("div",{className:"flex-1 relative flex flex-col min-h-0",children:[p,n.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:n.jsxs("div",{className:y,children:[N,S]})})]}),e[24]=N,e[25]=S,e[26]=y,e[27]=_):_=e[27];let C;return e[28]!==_||e[29]!==h||e[30]!==x?(C=n.jsxs(n.Fragment,{children:[h,x,_]}),e[28]=_,e[29]=h,e[30]=x,e[31]=C):C=e[31],C}function ei(t){const e=k.c(17),{isEditMode:s,hasChanges:r,onEnter:i,onSave:o,onCancel:l,onAddTile:d}=t;if(s){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(ye,{size:14}),e[0]=c):c=e[0];let u;e[1]!==d?(u=n.jsxs("button",{type:"button",onClick:d,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Add a tile from any agent",children:[c,"Add tile"]}),e[1]=d,e[2]=u):u=e[2];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Pe,{size:14}),e[3]=f):f=e[3];let h;e[4]!==l?(h=n.jsxs(Y,{size:"sm",variant:"ghost",onClick:l,className:"gap-1.5 h-7 text-xs",children:[f,"Cancel"]}),e[4]=l,e[5]=h):h=e[5];const x=!r;let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx($t,{size:14}),e[6]=p):p=e[6];let g;e[7]!==o||e[8]!==x?(g=n.jsxs(Y,{size:"sm",onClick:o,disabled:x,className:"gap-1.5 h-7 text-xs",children:[p,"Save"]}),e[7]=o,e[8]=x,e[9]=g):g=e[9];let y;return e[10]!==u||e[11]!==h||e[12]!==g?(y=n.jsxs(n.Fragment,{children:[u,h,g]}),e[10]=u,e[11]=h,e[12]=g,e[13]=y):y=e[13],y}let a;e[14]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Mt,{size:14}),e[14]=a):a=e[14];let m;return e[15]!==i?(m=n.jsxs("button",{type:"button",onClick:i,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Customize your home",children:[a,"Customize"]}),e[15]=i,e[16]=m):m=e[16],m}function ti(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("img",{src:"/home/capybara.png",alt:"","aria-hidden":!0,className:"pointer-events-none absolute -top-16 right-6 z-20 h-20 w-auto select-none"}),t[0]=e):e=t[0],e}function ro(){const t=k.c(2);if(be()){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:n.jsx(Ee,{})}),t[0]=r):r=t[0],r}let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("div",{className:"flex-1 min-h-0 pb-1 pr-1 pl-0 pt-0",children:n.jsx("div",{className:"h-full p-0.5 pt-0.25",children:n.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:n.jsx(Ee,{})})})}),t[1]=s):s=t[1],s}export{ro as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as it,r as E,j as e,i as rt}from"./index-Cvc1xn-4.js";import{S as mt,b as pt,c as st,d as at}from"./sheet-XVV7S5b8.js";import{S as nt}from"./scroll-area-BvvyxqKR.js";import{r as lt,c as ct,u as dt,a as St,i as ft,f as ut,d as vt,P as ht,S as gt}from"./page-seo-form-Io0ovKiN.js";import{m as xt}from"./index-B8LUbsU-.js";import"./X-DC2HG4lX.js";import"./agent-icon-C4199b3i.js";import"./AlertCircle-BZqAQZBb.js";import"./Tool01-AyuVwnGv.js";import"./SwitchHorizontal01-BVKPeJMU.js";import"./Settings02-kQ4zmp5P.js";import"./XCircle-DJDxYBys.js";import"./ArrowRight-6qgvW498.js";import"./ArrowUpRight-CUPFfker.js";import"./ZapSquare-ok_KEP9c.js";import"./Users03-C6siA5mE.js";import"./CheckCircle-DOPRdShL.js";import"./ChevronUp-DhHPsDAS.js";import"./ChevronDown-BhLFFAly.js";import"./ChevronLeft-veOSKT91.js";import"./ChevronRight-tj4xbWmM.js";import"./DotsVertical-kcsdrim_.js";import"./Stars02-Bo19XD__.js";import"./Eye-BfNssVzk.js";import"./ZoomOut-cYq1CP_X.js";import"./Globe01-CJXHyXNe.js";import"./FilterLines-D2obCQW_.js";import"./Star01-CFj5T2Jl.js";import"./Globe04-PQ0ejRYI.js";import"./HardDrive-DEG8fjxw.js";import"./Key01-xj4UQriu.js";import"./LayoutLeft-C9-KQh8d.js";import"./LinkExternal01-DtLsAcMy.js";import"./Monitor01-CvNVisni.js";import"./Sun-CcSW7Ngf.js";import"./Palette-yNiXmyHD.js";import"./Play-C0DhAO4u.js";import"./Plus-BRQannbC.js";import"./SearchMd-CttVjXUQ.js";import"./Shield01-BZZVugf_.js";import"./Stars01-C4FyHP_L.js";import"./Trash01-BZXmKzie.js";import"./Upload01-D4ez0Mu3.js";import"./User01-Dz33ODze.js";import"./Users01-aBataJ8N.js";import"./XClose-BcOWKb5Q.js";import"./Zap-OOZsYg72.js";import"./use-clock-tick-CqrkSCF6.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DM9BeeKg.js";import"./tooltip-D_DwQRbZ.js";import"./file-type-icon-GfohFxwW.js";import"./dialog-DDL08EK8.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-zC94Gae_.js";import"./use-mcp-client-DV4dF4m3.js";import"./auth-B9bEkbYh.js";import"./chat-context-GA_fpERN.js";import"./hooks-BI65IXS7.js";import"./decopilot-sse-pool-CZG5pZEa.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-WmAC_qSm.js";import"./use-collections-dA9ibOHr.js";import"./use-ai-providers-0DJv4c0H.js";import"./studio-tools-D8q7MEyE.js";import"./use-organization-settings-C6jq364X.js";import"./shell-layout-DIXTRmN4.js";import"./avatar-CKJB3djy.js";import"./required-auth-layout-BcilPdVi.js";import"./use-org-sso-Cygr8MWL.js";import"./integration-icon-gcYOl2yq.js";import"./use-navigate-to-agent-Cs1C-DBQ.js";import"./use-connection-C39BUY8e.js";import"./use-mcp-prompts-CspfQ-gW.js";import"./form-B9v_4_lt.js";import"./label-hfmZhqH1.js";import"./input-klr_kUC2.js";import"./select-DwFQDgcX.js";import"./switch-skMKJ2GI.js";import"./schema-form-C1MMeEGC.js";import"./calendar-DDwlGULz.js";import"./popover-BvZF2bBr.js";import"./textarea-2KmLad1y.js";import"./sortable.esm-S2exVkMt.js";import"./dropdown-menu-CgCZ8Mte.js";import"./image-field-CEHk9cpM.js";import"./skeleton-C-tuNjEZ.js";import"./tabs-C0Vh3iPJ.js";import"./use-file-configs-CvRusjpd.js";import"./useInfiniteQuery-Bwr_uznn.js";import"./use-infinite-scroll-DM0o0Ibp.js";import"./command-BzTLypzr.js";import"./index-DVxNbd_g.js";import"./index-BI3_fNOm.js";import"./drawer-CTdCEiZw.js";import"./collection-search-DC-7DcrR.js";import"./toggle-group-6FcrOIsd.js";import"./use-deco-credits-Bax6GRog.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DPkWnrYu.js";import"./use-registry-connections-yBLIjpTM.js";import"./extract-connection-data-D4y9_vmi.js";import"./card-D7O9yDM9.js";import"./collection-tabs-CRIZ0CX_.js";import"./badge-DUlP8HvP.js";import"./connection-form-helpers-B_oQdAph.js";import"./useSuspenseInfiniteQuery-D48NS_O0.js";import"./mcp-oauth-C5QgI6bG.js";import"./connect-desktop-dialog-uLnBe_nQ.js";import"./decopilot-BsjqLgTH.js";import"./checkbox-DOg3LODJ.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-rOWH4a9G.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-Bvu0fELl.js";import"./empty-state-BDXQKaPV.js";import"./toolbar-DE_I2DnI.js";import"./preview-dialog-BikVelEl.js";import"./index-B2quJDhU.js";import"./use-mcp-tools-DnBnaQLn.js";import"./use-capability-A3j7T78I.js";import"./shell-route-loading-B5-wAKUU.js";import"./index-Br4BSsfF.js";import"./alert-dialog-BUQoXI1j.js";import"./use-debounced-autosave-BzGp2qae.js";import"./index-1J83wgnT.js";import"./sidebar-Djn7svMG.js";import"./search-input-B-LDSHMx.js";import"./github-repo-picker-Qwduwaex.js";import"./use-secrets-BtkNg5h6.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-D7_rFTiD.js";import"./select-model-BWl1FGCY.js";import"./use-automations-CsLMaKM0.js";import"./monaco-editor-YJUBj_D_.js";import"./automation-runs-y9iHLMe2.js";import"./table-DsOuzcNK.js";import"./use-members-CtcSheMR.js";import"./use-org-auth-client-lV24PS0n.js";import"./task-status-DRz_b988.js";import"./automation-list-row-DMPjogBl.js";function ri(u){const t=it.c(46),{open:N,onOpenChange:P,orgSlug:Q,virtualMcpId:U,branch:W,decofile:G,meta:s,target:m,onSaved:X}=u,o=lt(G,m,s),k=m.kind==="site"?"site":m.pageKey,[Y,Z]=E.useState(k),[tt,i]=E.useState(null),[J,g]=E.useState(void 0),[x,y]=E.useState(0);Y!==k&&(Z(k),i(null),g(void 0),y(wt));const{persistSeo:a,persistRawSeo:I,flush:K,isPending:D}=ct({orgSlug:Q,virtualMcpId:U,branch:W,target:m,resolved:o,onSaved:X}),w=m.kind==="page",ot=w?o?.rawSeoData:void 0,v=J!==void 0?J:ot,et=w?dt(v)??void 0:void 0,h=tt??et??o?.seoData??{},p=o?St(h,o):null,n=p&&(!w||ft(v))?xt(p,s):null,_=m.kind==="page"?ut(G,s)?.seoData??void 0:void 0;let j;t[0]!==s?(j=vt(s),t[0]=s,t[1]=j):j=t[1];const M=j;let R;t[2]!==a||t[3]!==o||t[4]!==i?(R=r=>{if(!o)return;const L=r;i(L),a(L)},t[2]=a,t[3]=o,t[4]=i,t[5]=R):R=t[5];const V=R;let F;t[6]!==K||t[7]!==P?(F=r=>{r||K(),P(r)},t[6]=K,t[7]=P,t[8]=F):F=t[8];const z=F,A=m.kind==="site"?"Site SEO":"Page SEO",T=w&&o,B=m.kind==="site"&&o&&n,H=m.kind==="site"?"No site-level SEO block found.":o?"SEO schema not found for this page.":"Could not load page SEO.";let C;t[9]!==i?(C=()=>i(null),t[9]=i,t[10]=C):C=t[10];const $=C;let O;t[11]!==y?(O=()=>y(yt),t[11]=y,t[12]=O):O=t[12];const q=O;let l;t[13]!==A?(l=e.jsx(mt,{className:"text-sm font-semibold",children:A}),t[13]=A,t[14]=l):l=t[14];let c;t[15]!==D?(c=D&&e.jsx(rt,{size:14,className:"animate-spin text-muted-foreground"}),t[15]=D,t[16]=c):c=t[16];let d;t[17]!==l||t[18]!==c?(d=e.jsxs(pt,{className:"px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[l,c]}),t[17]=l,t[18]=c,t[19]=d):d=t[19];let S;t[20]!==p||t[21]!==q||t[22]!==$||t[23]!==M||t[24]!==v||t[25]!==h||t[26]!==H||t[27]!==x||t[28]!==V||t[29]!==I||t[30]!==a||t[31]!==o||t[32]!==n||t[33]!==i||t[34]!==g||t[35]!==T||t[36]!==B||t[37]!==_?(S=!o||!T&&!B?e.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:H}):e.jsx(nt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:e.jsx("div",{className:"px-6 py-4",children:e.jsx("div",{className:"mx-auto max-w-sm",children:T?e.jsx(ht,{rawSeo:v,innerSeo:h,defaultResolveType:M,seoSchema:n,activeResolveType:p,seoTypeOptions:o.seoTypeOptions,formResetKey:x,siteDefaultSeo:_,onPersistRaw:r=>{g(r),I(r)},onInnerChange:r=>{i(r),a(r)},onClearForm:$,onBumpFormKey:q}):n&&p&&e.jsx(gt,{schema:n,resolveType:p,value:h,formResetKey:x,onChange:V})})})}),t[20]=p,t[21]=q,t[22]=$,t[23]=M,t[24]=v,t[25]=h,t[26]=H,t[27]=x,t[28]=V,t[29]=I,t[30]=a,t[31]=o,t[32]=n,t[33]=i,t[34]=g,t[35]=T,t[36]=B,t[37]=_,t[38]=S):S=t[38];let f;t[39]!==d||t[40]!==S?(f=e.jsxs(st,{side:"right",className:"w-[400px] sm:max-w-[440px] p-0 gap-0",children:[d,S]}),t[39]=d,t[40]=S,t[41]=f):f=t[41];let b;return t[42]!==z||t[43]!==N||t[44]!==f?(b=e.jsx(at,{open:N,onOpenChange:z,children:f}),t[42]=z,t[43]=N,t[44]=f,t[45]=b):b=t[45],b}function yt(u){return u+1}function wt(u){return u+1}export{ri as SeoSheet};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as Q,j as r,B as W,r as X,l as Z}from"./index-Cvc1xn-4.js";import{t as ee}from"./ChevronDown-BhLFFAly.js";import{n as te}from"./LinkExternal01-DtLsAcMy.js";import{Q as oe}from"./agent-icon-C4199b3i.js";import{e as re,f as ie,d as le}from"./scroll-area-BvvyxqKR.js";import{I as Y}from"./input-klr_kUC2.js";import{L as K}from"./label-hfmZhqH1.js";import{M as se}from"./automation-runs-y9iHLMe2.js";import{T as ae}from"./textarea-2KmLad1y.js";import{I as ne}from"./image-field-CEHk9cpM.js";import{g as me}from"./schema-form-C1MMeEGC.js";import{ak as pe,al as ce,am as fe,an as ue}from"./index-B8LUbsU-.js";import{u as de,s as U,I as ge,R as xe,A as he}from"./primitives-Bc5oh19Q.js";import{S as ye}from"./save-status-De_ZSd1F.js";import{a as ve,B as je,b as be}from"./block-document-Cft5FVFJ.js";import"./AlertCircle-BZqAQZBb.js";import"./Tool01-AyuVwnGv.js";import"./SwitchHorizontal01-BVKPeJMU.js";import"./Settings02-kQ4zmp5P.js";import"./XCircle-DJDxYBys.js";import"./ArrowRight-6qgvW498.js";import"./ArrowUpRight-CUPFfker.js";import"./ZapSquare-ok_KEP9c.js";import"./Users03-C6siA5mE.js";import"./CheckCircle-DOPRdShL.js";import"./ChevronUp-DhHPsDAS.js";import"./ChevronLeft-veOSKT91.js";import"./ChevronRight-tj4xbWmM.js";import"./DotsVertical-kcsdrim_.js";import"./Stars02-Bo19XD__.js";import"./Eye-BfNssVzk.js";import"./ZoomOut-cYq1CP_X.js";import"./Globe01-CJXHyXNe.js";import"./FilterLines-D2obCQW_.js";import"./Star01-CFj5T2Jl.js";import"./Globe04-PQ0ejRYI.js";import"./HardDrive-DEG8fjxw.js";import"./Key01-xj4UQriu.js";import"./LayoutLeft-C9-KQh8d.js";import"./Monitor01-CvNVisni.js";import"./Sun-CcSW7Ngf.js";import"./Palette-yNiXmyHD.js";import"./Play-C0DhAO4u.js";import"./Plus-BRQannbC.js";import"./SearchMd-CttVjXUQ.js";import"./Shield01-BZZVugf_.js";import"./Stars01-C4FyHP_L.js";import"./Trash01-BZXmKzie.js";import"./Upload01-D4ez0Mu3.js";import"./User01-Dz33ODze.js";import"./Users01-aBataJ8N.js";import"./XClose-BcOWKb5Q.js";import"./X-DC2HG4lX.js";import"./Zap-OOZsYg72.js";import"./use-clock-tick-CqrkSCF6.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DM9BeeKg.js";import"./tooltip-D_DwQRbZ.js";import"./file-type-icon-GfohFxwW.js";import"./dialog-DDL08EK8.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-zC94Gae_.js";import"./use-mcp-client-DV4dF4m3.js";import"./auth-B9bEkbYh.js";import"./chat-context-GA_fpERN.js";import"./hooks-BI65IXS7.js";import"./decopilot-sse-pool-CZG5pZEa.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-WmAC_qSm.js";import"./use-collections-dA9ibOHr.js";import"./use-ai-providers-0DJv4c0H.js";import"./studio-tools-D8q7MEyE.js";import"./use-organization-settings-C6jq364X.js";import"./shell-layout-DIXTRmN4.js";import"./avatar-CKJB3djy.js";import"./required-auth-layout-BcilPdVi.js";import"./use-org-sso-Cygr8MWL.js";import"./sheet-XVV7S5b8.js";import"./integration-icon-gcYOl2yq.js";import"./use-navigate-to-agent-Cs1C-DBQ.js";import"./use-connection-C39BUY8e.js";import"./use-mcp-prompts-CspfQ-gW.js";import"./form-B9v_4_lt.js";import"./select-DwFQDgcX.js";import"./useInfiniteQuery-Bwr_uznn.js";import"./use-infinite-scroll-DM0o0Ibp.js";import"./card-D7O9yDM9.js";import"./table-DsOuzcNK.js";import"./empty-state-BDXQKaPV.js";import"./use-members-CtcSheMR.js";import"./use-org-auth-client-lV24PS0n.js";import"./task-status-DRz_b988.js";import"./use-automations-CsLMaKM0.js";import"./useSuspenseInfiniteQuery-D48NS_O0.js";import"./badge-DUlP8HvP.js";import"./checkbox-DOg3LODJ.js";import"./command-BzTLypzr.js";import"./index-DVxNbd_g.js";import"./popover-BvZF2bBr.js";import"./dropdown-menu-CgCZ8Mte.js";import"./skeleton-C-tuNjEZ.js";import"./tabs-C0Vh3iPJ.js";import"./use-file-configs-CvRusjpd.js";import"./calendar-DDwlGULz.js";import"./switch-skMKJ2GI.js";import"./sortable.esm-S2exVkMt.js";import"./index-BI3_fNOm.js";import"./drawer-CTdCEiZw.js";import"./collection-search-DC-7DcrR.js";import"./toggle-group-6FcrOIsd.js";import"./use-deco-credits-Bax6GRog.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DPkWnrYu.js";import"./use-registry-connections-yBLIjpTM.js";import"./extract-connection-data-D4y9_vmi.js";import"./collection-tabs-CRIZ0CX_.js";import"./connection-form-helpers-B_oQdAph.js";import"./mcp-oauth-C5QgI6bG.js";import"./connect-desktop-dialog-uLnBe_nQ.js";import"./decopilot-BsjqLgTH.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-rOWH4a9G.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-Bvu0fELl.js";import"./toolbar-DE_I2DnI.js";import"./preview-dialog-BikVelEl.js";import"./index-B2quJDhU.js";import"./use-mcp-tools-DnBnaQLn.js";import"./use-capability-A3j7T78I.js";import"./shell-route-loading-B5-wAKUU.js";import"./index-Br4BSsfF.js";import"./alert-dialog-BUQoXI1j.js";import"./use-debounced-autosave-BzGp2qae.js";import"./index-1J83wgnT.js";import"./sidebar-Djn7svMG.js";import"./search-input-B-LDSHMx.js";import"./github-repo-picker-Qwduwaex.js";import"./use-secrets-BtkNg5h6.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-D7_rFTiD.js";import"./select-model-BWl1FGCY.js";import"./monaco-editor-YJUBj_D_.js";import"./automation-list-row-DMPjogBl.js";const q=f=>typeof f=="string"?f:"",Ce=/\/blog\.tsx?$/;function Se(f){for(const[e,t]of Object.entries(f)){if(e.includes("/")||!t||typeof t!="object"||Array.isArray(t))continue;const i=t;if(typeof i.__resolveType!="string"||!Ce.test(i.__resolveType))continue;const o=q(i.pageSlug);if(o)return o}return null}function _e(f){const e=f.categories;if(!Array.isArray(e)||e.length===0)return"";const t=e[0];return q(t?.slug)}function ke(f,e){let t=f;if(/:category\??/.test(t)){if(!e.category)return null;t=t.replace(/:category\??/g,encodeURIComponent(e.category))}if(/:slug\??/.test(t)){if(!e.slug)return null;t=t.replace(/:slug\??/g,encodeURIComponent(e.slug))}return t}function Ne({decofile:f,post:e,previewBaseUrl:t}){if(!t)return null;const i=Se(f);if(!i)return null;const o=ke(i,{category:_e(e),slug:q(e.slug)});if(!o)return null;try{return new URL(o,t).href}catch{return null}}function Pe(f){return Array.isArray(f)?f.map(e=>({key:U(e?.key),value:U(e?.value)})):[]}function dr(f){const e=Q.c(68),{orgSlug:t,virtualMcpId:i,branch:o,blockKey:s,block:S,decofile:m,meta:v,previewBaseUrl:x}=f;let j;e[0]!==o||e[1]!==t||e[2]!==i?(j={orgSlug:t,virtualMcpId:i,branch:o},e[0]=o,e[1]=t,e[2]=i,e[3]=j):j=e[3];const l=pe(j);let u;e[4]!==S?(u=ce(S,"posts"),e[4]=S,e[5]=u):u=e[5];const d=u;let b;e[6]!==s||e[7]!==l?(b=M=>{l.mutate({blockKey:s,data:fe(s,"posts",M)})},e[6]=s,e[7]=l,e[8]=b):b=e[8];const[a,R]=de(d,b);let _;e[9]!==a||e[10]!==R?(_=(M,J)=>R({...a,[M]:J}),e[9]=a,e[10]=R,e[11]=_):_=e[11];const p=_;let k;e[12]!==m||e[13]!==a||e[14]!==x?(k=Ne({decofile:m,post:a,previewBaseUrl:x}),e[12]=m,e[13]=a,e[14]=x,e[15]=k):k=e[15];const h=k;let n;e[16]!==a.title?(n=U(a.title)||"Untitled post",e[16]=a.title,e[17]=n):n=e[17];let c;e[18]!==n?(c=r.jsx("span",{className:"truncate text-sm font-medium",children:n}),e[18]=n,e[19]=c):c=e[19];let g;e[20]!==l.isError||e[21]!==l.isPending?(g=r.jsx(ye,{isPending:l.isPending,isError:l.isError}),e[20]=l.isError,e[21]=l.isPending,e[22]=g):g=e[22];const C=!h,z=h?"Open the post preview in a new tab":"Set the post slug (and its category) plus the blog app's pageSlug to preview";let N;e[23]!==h?(N=()=>{h&&window.open(h,"_blank","noopener,noreferrer")},e[23]=h,e[24]=N):N=e[24];let I;e[25]===Symbol.for("react.memo_cache_sentinel")?(I=r.jsx(te,{size:14}),e[25]=I):I=e[25];let L;e[26]!==z||e[27]!==N||e[28]!==C?(L=r.jsxs(W,{type:"button",variant:"outline",size:"sm",disabled:C,title:z,onClick:N,children:[I,"See preview"]}),e[26]=z,e[27]=N,e[28]=C,e[29]=L):L=e[29];let P;e[30]!==L||e[31]!==g?(P=r.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[g,L]}),e[30]=L,e[31]=g,e[32]=P):P=e[32];let B;e[33]!==P||e[34]!==c?(B=r.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[c,P]}),e[33]=P,e[34]=c,e[35]=B):B=e[35];let T;e[36]!==a.title?(T=U(a.title),e[36]=a.title,e[37]=T):T=e[37];let w;e[38]!==p?(w=M=>p("title",M),e[38]=p,e[39]=w):w=e[39];let A;e[40]!==T||e[41]!==w?(A=r.jsx(ge,{value:T,onChange:w,placeholder:"Post title",className:"py-1 text-3xl font-bold text-foreground"}),e[40]=T,e[41]=w,e[42]=A):A=e[42];let E;e[43]!==m||e[44]!==a||e[45]!==p?(E=r.jsx(Be,{post:a,decofile:m,onChange:p}),e[43]=m,e[44]=a,e[45]=p,e[46]=E):E=e[46];let $;e[47]===Symbol.for("react.memo_cache_sentinel")?($=r.jsx("div",{className:"mt-6 border-t"}),e[47]=$):$=e[47];let F;e[48]!==a.sections?(F=ve(a.sections),e[48]=a.sections,e[49]=F):F=e[49];let O;e[50]!==p?(O=M=>p("sections",M),e[50]=p,e[51]=O):O=e[51];let y;e[52]!==v||e[53]!==F||e[54]!==O?(y=r.jsx(je,{value:F,onChange:O,meta:v,emptyMessage:"This post has no content yet. Use ⊕ to add your first block."}),e[52]=v,e[53]=F,e[54]=O,e[55]=y):y=e[55];let D;e[56]!==A||e[57]!==E||e[58]!==y?(D=r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:r.jsxs("div",{className:"mx-auto max-w-3xl px-8 py-8",children:[A,E,$,y]})}),e[56]=A,e[57]=E,e[58]=y,e[59]=D):D=e[59];let V;e[60]!==B||e[61]!==D?(V=r.jsxs("div",{className:"flex h-full flex-col",children:[B,D]}),e[60]=B,e[61]=D,e[62]=V):V=e[62];let G;return e[63]!==o||e[64]!==t||e[65]!==V||e[66]!==i?(G=r.jsx(be,{orgSlug:t,virtualMcpId:i,branch:o,children:V}),e[63]=o,e[64]=t,e[65]=V,e[66]=i,e[67]=G):G=e[67],G}function Be(f){const e=Q.c(69),{post:t,decofile:i,onChange:o}=f,[s,S]=X.useState(!1);let m,v;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=r.jsx(oe,{size:15}),v=r.jsx("span",{className:"flex-1 text-left",children:"Post settings"}),e[0]=m,e[1]=v):(m=e[0],v=e[1]);const x=s&&"rotate-180";let j;e[2]!==x?(j=Z("transition-transform",x),e[2]=x,e[3]=j):j=e[3];let l;e[4]!==j?(l=r.jsx(re,{asChild:!0,children:r.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[m,v,r.jsx(ee,{size:15,className:j})]})}),e[4]=j,e[5]=l):l=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=r.jsx(K,{htmlFor:"post-excerpt",children:"Excerpt"}),e[6]=u):u=e[6];let d;e[7]!==t.excerpt?(d=U(t.excerpt),e[7]=t.excerpt,e[8]=d):d=e[8];let b;e[9]!==o?(b=y=>o("excerpt",y.target.value),e[9]=o,e[10]=b):b=e[10];let a;e[11]!==d||e[12]!==b?(a=r.jsxs("div",{className:"space-y-2",children:[u,r.jsx(ae,{id:"post-excerpt",value:d,onChange:b,rows:2})]}),e[11]=d,e[12]=b,e[13]=a):a=e[13];let R;e[14]===Symbol.for("react.memo_cache_sentinel")?(R=r.jsx(K,{htmlFor:"post-slug",children:"Slug"}),e[14]=R):R=e[14];let _;e[15]!==t.slug?(_=U(t.slug),e[15]=t.slug,e[16]=_):_=e[16];let p;e[17]!==o?(p=y=>o("slug",y.target.value),e[17]=o,e[18]=p):p=e[18];let k;e[19]!==_||e[20]!==p?(k=r.jsxs("div",{className:"space-y-2",children:[R,r.jsx(Y,{id:"post-slug",value:_,onChange:p,placeholder:"my-post",className:"h-10"})]}),e[19]=_,e[20]=p,e[21]=k):k=e[21];let h;e[22]===Symbol.for("react.memo_cache_sentinel")?(h={type:"string",format:"date",title:"Date"},e[22]=h):h=e[22];let n;e[23]!==t.date?(n=U(t.date),e[23]=t.date,e[24]=n):n=e[24];let c;e[25]!==o?(c=y=>o("date",y),e[25]=o,e[26]=c):c=e[26];let g;e[27]!==n||e[28]!==c?(g=r.jsx(me,{schema:h,value:n,onChange:c,path:"post-date",label:"Date"}),e[27]=n,e[28]=c,e[29]=g):g=e[29];let C;e[30]!==k||e[31]!==g?(C=r.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[k,g]}),e[30]=k,e[31]=g,e[32]=C):C=e[32];let z;e[33]===Symbol.for("react.memo_cache_sentinel")?(z={type:"string",format:"image-uri",title:"Cover image"},e[33]=z):z=e[33];let N;e[34]!==o?(N=y=>o("image",y),e[34]=o,e[35]=N):N=e[35];let I;e[36]!==t.image||e[37]!==N?(I=r.jsx(ne,{schema:z,value:t.image,onChange:N,path:"post-image",label:"Cover image"}),e[36]=t.image,e[37]=N,e[38]=I):I=e[38];let L;e[39]===Symbol.for("react.memo_cache_sentinel")?(L=["email"],e[39]=L):L=e[39];let P;e[40]!==o?(P=y=>o("authors",y),e[40]=o,e[41]=P):P=e[41];let B;e[42]!==i||e[43]!==t.authors||e[44]!==P?(B=r.jsx(H,{label:"Authors",decofile:i,kind:"authors",valueField:"email",extraFields:L,selected:t.authors,onChange:P}),e[42]=i,e[43]=t.authors,e[44]=P,e[45]=B):B=e[45];let T;e[46]===Symbol.for("react.memo_cache_sentinel")?(T=["slug"],e[46]=T):T=e[46];let w;e[47]!==o?(w=y=>o("categories",y),e[47]=o,e[48]=w):w=e[48];let A;e[49]!==i||e[50]!==t.categories||e[51]!==w?(A=r.jsx(H,{label:"Categories",decofile:i,kind:"categories",valueField:"slug",extraFields:T,selected:t.categories,onChange:w}),e[49]=i,e[50]=t.categories,e[51]=w,e[52]=A):A=e[52];let E;e[53]!==o?(E=y=>o("extraProps",y),e[53]=o,e[54]=E):E=e[54];let $;e[55]!==t.extraProps||e[56]!==E?($=r.jsx(we,{value:t.extraProps,onChange:E}),e[55]=t.extraProps,e[56]=E,e[57]=$):$=e[57];let F;e[58]!==C||e[59]!==I||e[60]!==B||e[61]!==A||e[62]!==$||e[63]!==a?(F=r.jsxs(ie,{className:"space-y-5 px-2 pt-4",children:[a,C,I,B,A,$]}),e[58]=C,e[59]=I,e[60]=B,e[61]=A,e[62]=$,e[63]=a,e[64]=F):F=e[64];let O;return e[65]!==s||e[66]!==F||e[67]!==l?(O=r.jsxs(le,{open:s,onOpenChange:S,className:"mt-4",children:[l,F]}),e[65]=s,e[66]=F,e[67]=l,e[68]=O):O=e[68],O}function we(f){const e=Q.c(15),{value:t,onChange:i}=f;let o,s,S,m;if(e[0]!==i||e[1]!==t){o=Pe(t);const j=(l,u)=>i(o.map((d,b)=>b===l?{...d,...u}:d));s="space-y-2",e[6]===Symbol.for("react.memo_cache_sentinel")?(S=r.jsx(K,{children:"Extra props"}),e[6]=S):S=e[6],m=o.length>0&&r.jsx("ul",{className:"space-y-2",children:o.map((l,u)=>r.jsxs("li",{className:"group/item flex items-center gap-2",children:[r.jsx(Y,{value:l.key,onChange:d=>j(u,{key:d.target.value}),placeholder:"key",className:"h-9 flex-1"}),r.jsx(Y,{value:l.value,onChange:d=>j(u,{value:d.target.value}),placeholder:"value",className:"h-9 flex-1"}),r.jsx(xe,{label:"Remove prop",onClick:()=>i(o.filter((d,b)=>b!==u))})]},u))}),e[0]=i,e[1]=t,e[2]=o,e[3]=s,e[4]=S,e[5]=m}else o=e[2],s=e[3],S=e[4],m=e[5];let v;e[7]!==o||e[8]!==i?(v=r.jsx(he,{label:"Add prop",onClick:()=>i([...o,{key:"",value:""}])}),e[7]=o,e[8]=i,e[9]=v):v=e[9];let x;return e[10]!==s||e[11]!==S||e[12]!==m||e[13]!==v?(x=r.jsxs("div",{className:s,children:[S,m,v]}),e[10]=s,e[11]=S,e[12]=m,e[13]=v,e[14]=x):x=e[14],x}function H(f){const e=Q.c(31),{label:t,decofile:i,kind:o,valueField:s,extraFields:S,selected:m,onChange:v}=f;let x,j,l;if(e[0]!==i||e[1]!==o||e[2]!==s){x=ue(i,o);let h;e[6]!==s?(h=(c,g)=>U(c[s])||g,e[6]=s,e[7]=h):h=e[7],l=h;let n;e[8]!==l?(n=c=>{const{key:g,payload:C}=c;return{value:l(C,g),label:U(C.name)||l(C,g)}},e[8]=l,e[9]=n):n=e[9],j=x.map(n),e[0]=i,e[1]=o,e[2]=s,e[3]=x,e[4]=j,e[5]=l}else x=e[3],j=e[4],l=e[5];const u=j;let d;if(e[10]!==m||e[11]!==s){const h=Array.isArray(m)?m:[];let n;e[13]!==s?(n=c=>U(c[s]),e[13]=s,e[14]=n):n=e[14],d=h.map(n).filter(Boolean),e[10]=m,e[11]=s,e[12]=d}else d=e[12];const b=d;let a;e[15]!==S||e[16]!==v||e[17]!==x||e[18]!==s||e[19]!==l?(a=h=>{v(h.map(n=>{const c=x.find(C=>{const{key:z,payload:N}=C;return l(N,z)===n});if(!c)return{name:n,[s]:n};const g={name:U(c.payload.name)};for(const C of S)g[C]=c.payload[C]??n;return g}))},e[15]=S,e[16]=v,e[17]=x,e[18]=s,e[19]=l,e[20]=a):a=e[20];const R=a;let _;e[21]!==t?(_=r.jsx(K,{children:t}),e[21]=t,e[22]=_):_=e[22];let p;e[23]!==b||e[24]!==R||e[25]!==t||e[26]!==u?(p=u.length===0?r.jsxs("p",{className:"text-xs text-muted-foreground",children:["No ",t.toLowerCase()," yet — create some in the"," ",t.toLowerCase()," collection."]}):r.jsx(se,{options:u,defaultValue:b,onValueChange:R,placeholder:`Select ${t.toLowerCase()}`,maxCount:4}),e[23]=b,e[24]=R,e[25]=t,e[26]=u,e[27]=p):p=e[27];let k;return e[28]!==_||e[29]!==p?(k=r.jsxs("div",{className:"space-y-2",children:[_,p]}),e[28]=_,e[29]=p,e[30]=k):k=e[30],k}export{dr as PostEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as $,s as H,j as v}from"./index-Cvc1xn-4.js";import{j as L,g as E,s as y}from"./scroll-area-BvvyxqKR.js";import{p as O,u as k}from"./use-mcp-client-DV4dF4m3.js";import{b as q,c as B}from"./use-mcp-tools-DnBnaQLn.js";import{u as Y}from"./index-B8LUbsU-.js";import{c as G}from"./content-blocks-o63cs2vh.js";import{g as K,M as V,a as w}from"./types-zC94Gae_.js";import{u as z,b as F}from"./chat-context-GA_fpERN.js";import{b as J}from"./shell-layout-DIXTRmN4.js";import"./agent-icon-C4199b3i.js";import"./AlertCircle-BZqAQZBb.js";import"./Tool01-AyuVwnGv.js";import"./SwitchHorizontal01-BVKPeJMU.js";import"./Settings02-kQ4zmp5P.js";import"./XCircle-DJDxYBys.js";import"./ArrowRight-6qgvW498.js";import"./ArrowUpRight-CUPFfker.js";import"./ZapSquare-ok_KEP9c.js";import"./Users03-C6siA5mE.js";import"./CheckCircle-DOPRdShL.js";import"./ChevronUp-DhHPsDAS.js";import"./ChevronDown-BhLFFAly.js";import"./ChevronLeft-veOSKT91.js";import"./ChevronRight-tj4xbWmM.js";import"./DotsVertical-kcsdrim_.js";import"./Stars02-Bo19XD__.js";import"./Eye-BfNssVzk.js";import"./ZoomOut-cYq1CP_X.js";import"./Globe01-CJXHyXNe.js";import"./FilterLines-D2obCQW_.js";import"./Star01-CFj5T2Jl.js";import"./Globe04-PQ0ejRYI.js";import"./HardDrive-DEG8fjxw.js";import"./Key01-xj4UQriu.js";import"./LayoutLeft-C9-KQh8d.js";import"./LinkExternal01-DtLsAcMy.js";import"./Monitor01-CvNVisni.js";import"./Sun-CcSW7Ngf.js";import"./Palette-yNiXmyHD.js";import"./Play-C0DhAO4u.js";import"./Plus-BRQannbC.js";import"./SearchMd-CttVjXUQ.js";import"./Shield01-BZZVugf_.js";import"./Stars01-C4FyHP_L.js";import"./Trash01-BZXmKzie.js";import"./Upload01-D4ez0Mu3.js";import"./User01-Dz33ODze.js";import"./Users01-aBataJ8N.js";import"./XClose-BcOWKb5Q.js";import"./X-DC2HG4lX.js";import"./Zap-OOZsYg72.js";import"./use-clock-tick-CqrkSCF6.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DM9BeeKg.js";import"./tooltip-D_DwQRbZ.js";import"./file-type-icon-GfohFxwW.js";import"./dialog-DDL08EK8.js";import"./tab-id-BptcWVWa.js";import"./hooks-BI65IXS7.js";import"./decopilot-sse-pool-CZG5pZEa.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-D8q7MEyE.js";import"./sheet-XVV7S5b8.js";import"./integration-icon-gcYOl2yq.js";import"./use-virtual-mcp-WmAC_qSm.js";import"./use-collections-dA9ibOHr.js";import"./use-navigate-to-agent-Cs1C-DBQ.js";import"./use-connection-C39BUY8e.js";import"./use-mcp-prompts-CspfQ-gW.js";import"./form-B9v_4_lt.js";import"./label-hfmZhqH1.js";import"./input-klr_kUC2.js";import"./select-DwFQDgcX.js";import"./auth-B9bEkbYh.js";import"./index-BI3_fNOm.js";import"./drawer-CTdCEiZw.js";import"./collection-search-DC-7DcrR.js";import"./tabs-C0Vh3iPJ.js";import"./toggle-group-6FcrOIsd.js";import"./use-deco-credits-Bax6GRog.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DPkWnrYu.js";import"./use-registry-connections-yBLIjpTM.js";import"./use-organization-settings-C6jq364X.js";import"./useInfiniteQuery-Bwr_uznn.js";import"./use-infinite-scroll-DM0o0Ibp.js";import"./extract-connection-data-D4y9_vmi.js";import"./card-D7O9yDM9.js";import"./collection-tabs-CRIZ0CX_.js";import"./badge-DUlP8HvP.js";import"./textarea-2KmLad1y.js";import"./connection-form-helpers-B_oQdAph.js";import"./useSuspenseInfiniteQuery-D48NS_O0.js";import"./mcp-oauth-C5QgI6bG.js";import"./use-ai-providers-0DJv4c0H.js";import"./connect-desktop-dialog-uLnBe_nQ.js";import"./decopilot-BsjqLgTH.js";import"./checkbox-DOg3LODJ.js";import"./skeleton-C-tuNjEZ.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-CKJB3djy.js";import"./settings-section-rOWH4a9G.js";import"./popover-BvZF2bBr.js";import"./command-BzTLypzr.js";import"./index-DVxNbd_g.js";import"./dropdown-menu-CgCZ8Mte.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-Bvu0fELl.js";import"./empty-state-BDXQKaPV.js";import"./toolbar-DE_I2DnI.js";import"./preview-dialog-BikVelEl.js";import"./index-B2quJDhU.js";import"./use-capability-A3j7T78I.js";import"./shell-route-loading-B5-wAKUU.js";import"./index-Br4BSsfF.js";import"./alert-dialog-BUQoXI1j.js";import"./switch-skMKJ2GI.js";import"./use-debounced-autosave-BzGp2qae.js";import"./index-1J83wgnT.js";import"./sidebar-Djn7svMG.js";import"./search-input-B-LDSHMx.js";import"./github-repo-picker-Qwduwaex.js";import"./use-secrets-BtkNg5h6.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-D7_rFTiD.js";import"./select-model-BWl1FGCY.js";import"./use-automations-CsLMaKM0.js";import"./monaco-editor-YJUBj_D_.js";import"./automation-runs-y9iHLMe2.js";import"./table-DsOuzcNK.js";import"./use-members-CtcSheMR.js";import"./use-org-auth-client-lV24PS0n.js";import"./task-status-DRz_b988.js";import"./automation-list-row-DMPjogBl.js";import"./required-auth-layout-BcilPdVi.js";import"./use-org-sso-Cygr8MWL.js";const Q={};function W(A){const t=$.c(37),{client:r,resourceURI:h,tool:o,connectionId:p,orgId:l,args:M}=A,{sendMessage:I}=z(),{setAppContext:u,clearAppContext:n}=F(),{setChatOpen:f,openTab:g}=J(),e=`${p}:${o.name}`;let a;t[0]!==g?(a=C=>C==="inline"?(g("0"),"inline"):"fullscreen",t[0]=g,t[1]=a):a=t[1];const m=a,s=M??Q;let c;t[2]!==r||t[3]!==o.name||t[4]!==s?(c={client:r,toolName:o.name,toolArguments:s},t[2]=r,t[3]=o.name,t[4]=s,t[5]=c):c=t[5];const{data:i}=B(c);let x;if(t[6]!==o._meta||t[7]!==o.name){const C=E(o._meta);x=y(o.name,C),t[6]=o._meta,t[7]=o.name,t[8]=x}else x=t[8];const U=x;let d;t[9]!==o.inputSchema?(d=o.inputSchema??{type:"object"},t[9]=o.inputSchema,t[10]=d):d=t[10];let N;t[11]!==U||t[12]!==d||t[13]!==o?(N={...o,name:U,inputSchema:d},t[11]=U,t[12]=d,t[13]=o,t[14]=N):N=t[14];const S=N;let _;t[15]!==I||t[16]!==f?(_=C=>{const D=G(C.content);D.content.length>0&&(f(!0),I({tiptapDoc:D}))},t[15]=I,t[16]=f,t[17]=_):_=t[17];const b=_;let P;t[18]!==S?(P={tool:S},t[18]=S,t[19]=P):P=t[19];let T;t[20]!==u||t[21]!==e?(T=C=>u(e,C),t[20]=u,t[21]=e,t[22]=T):T=t[22];let R;t[23]!==n||t[24]!==e?(R=()=>n(e),t[23]=n,t[24]=e,t[25]=R):R=t[25];let j;return t[26]!==r||t[27]!==b||t[28]!==m||t[29]!==l||t[30]!==h||t[31]!==P||t[32]!==T||t[33]!==R||t[34]!==s||t[35]!==i?(j=v.jsx(V,{resourceURI:h,orgId:l,toolInfo:P,toolInput:s,toolResult:i,displayMode:"fullscreen",minHeight:w.fullscreen.minHeight,maxHeight:w.fullscreen.maxHeight,client:r,onMessage:b,onUpdateModelContext:T,onTeardown:R,onRequestDisplayMode:m,className:"h-full"}),t[26]=r,t[27]=b,t[28]=m,t[29]=l,t[30]=h,t[31]=P,t[32]=T,t[33]=R,t[34]=s,t[35]=i,t[36]=j):j=t[36],j}function ve(A){const t=$.c(24),{connectionId:r,toolName:h,args:o}=A,{org:p}=H(),l=Y();let M;t[0]!==r||t[1]!==l?(M=O(r)&&l.vmEntry?.sandboxProviderKind==="user-desktop"&&l.previewUrl?`${l.previewUrl.replace(/\/+$/,"")}/api/mcp`:void 0,t[0]=r,t[1]=l,t[2]=M):M=t[2];const I=M;let u;t[3]!==r||t[4]!==I||t[5]!==p.id||t[6]!==p.slug?(u={connectionId:r,orgId:p.id,orgSlug:p.slug,mcpUrl:I},t[3]=r,t[4]=I,t[5]=p.id,t[6]=p.slug,t[7]=u):u=t[7];const n=k(u);let f;t[8]!==n?(f={client:n},t[8]=n,t[9]=f):f=t[9];const{data:g}=q(f);let e,a,m;t[10]!==h||t[11]!==g.tools?(e=L(decodeURIComponent(h)),m=g.tools.find(i=>i.name===e)??g.tools.find(i=>{const x=E(i._meta);if(!x)return!1;if(y(i.name,x)===e)return!0;const d=y(e,x);return d!==e&&i.name===d}),a=m?._meta?K(m._meta):void 0,t[10]=h,t[11]=g.tools,t[12]=e,t[13]=a,t[14]=m):(e=t[12],a=t[13],m=t[14]);const s=a;if(!m||!s){let i;return t[15]!==e?(i=v.jsx("div",{className:"flex items-center justify-center h-full w-full",children:v.jsxs("p",{className:"text-sm text-muted-foreground",children:['Tool "',e,'" not found or has no UI']})}),t[15]=e,t[16]=i):i=t[16],i}let c;return t[17]!==o||t[18]!==n||t[19]!==r||t[20]!==p.id||t[21]!==s||t[22]!==m?(c=v.jsx(W,{client:n,resourceURI:s,tool:m,connectionId:r,orgId:p.id,args:o}),t[17]=o,t[18]=n,t[19]=r,t[20]=p.id,t[21]=s,t[22]=m,t[23]=c):c=t[23],c}export{ve as AppViewContent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as F,j as r}from"./index-Cvc1xn-4.js";import{I as T}from"./input-klr_kUC2.js";import{L as C}from"./label-hfmZhqH1.js";import{T as L}from"./textarea-2KmLad1y.js";import{I as A}from"./image-field-CEHk9cpM.js";import{ak as R,al as D,am as J}from"./index-B8LUbsU-.js";import{u as K,s as P}from"./primitives-Bc5oh19Q.js";import{S as M}from"./save-status-De_ZSd1F.js";import"./Tool01-AyuVwnGv.js";import"./Trash01-BZXmKzie.js";import"./Upload01-D4ez0Mu3.js";import"./AlertCircle-BZqAQZBb.js";import"./ChevronUp-DhHPsDAS.js";import"./Eye-BfNssVzk.js";import"./DotsVertical-kcsdrim_.js";import"./agent-icon-C4199b3i.js";import"./SwitchHorizontal01-BVKPeJMU.js";import"./Settings02-kQ4zmp5P.js";import"./XCircle-DJDxYBys.js";import"./ArrowRight-6qgvW498.js";import"./ArrowUpRight-CUPFfker.js";import"./ZapSquare-ok_KEP9c.js";import"./Users03-C6siA5mE.js";import"./CheckCircle-DOPRdShL.js";import"./ChevronDown-BhLFFAly.js";import"./ChevronLeft-veOSKT91.js";import"./ChevronRight-tj4xbWmM.js";import"./Stars02-Bo19XD__.js";import"./ZoomOut-cYq1CP_X.js";import"./Globe01-CJXHyXNe.js";import"./FilterLines-D2obCQW_.js";import"./Star01-CFj5T2Jl.js";import"./Globe04-PQ0ejRYI.js";import"./HardDrive-DEG8fjxw.js";import"./Key01-xj4UQriu.js";import"./LayoutLeft-C9-KQh8d.js";import"./LinkExternal01-DtLsAcMy.js";import"./Monitor01-CvNVisni.js";import"./Sun-CcSW7Ngf.js";import"./Palette-yNiXmyHD.js";import"./Play-C0DhAO4u.js";import"./Plus-BRQannbC.js";import"./SearchMd-CttVjXUQ.js";import"./Shield01-BZZVugf_.js";import"./Stars01-C4FyHP_L.js";import"./User01-Dz33ODze.js";import"./Users01-aBataJ8N.js";import"./XClose-BcOWKb5Q.js";import"./X-DC2HG4lX.js";import"./Zap-OOZsYg72.js";import"./dialog-DDL08EK8.js";import"./dropdown-menu-CgCZ8Mte.js";import"./skeleton-C-tuNjEZ.js";import"./tabs-C0Vh3iPJ.js";import"./use-file-configs-CvRusjpd.js";import"./studio-tools-D8q7MEyE.js";import"./useInfiniteQuery-Bwr_uznn.js";import"./use-infinite-scroll-DM0o0Ibp.js";import"./index-BI3_fNOm.js";import"./chat-context-GA_fpERN.js";import"./hooks-BI65IXS7.js";import"./use-mcp-client-DV4dF4m3.js";import"./auth-B9bEkbYh.js";import"./decopilot-sse-pool-CZG5pZEa.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-WmAC_qSm.js";import"./use-collections-dA9ibOHr.js";import"./use-ai-providers-0DJv4c0H.js";import"./tab-id-BptcWVWa.js";import"./use-organization-settings-C6jq364X.js";import"./scroll-area-BvvyxqKR.js";import"./use-clock-tick-CqrkSCF6.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DM9BeeKg.js";import"./tooltip-D_DwQRbZ.js";import"./file-type-icon-GfohFxwW.js";import"./content-blocks-o63cs2vh.js";import"./types-zC94Gae_.js";import"./shell-layout-DIXTRmN4.js";import"./avatar-CKJB3djy.js";import"./required-auth-layout-BcilPdVi.js";import"./use-org-sso-Cygr8MWL.js";import"./sheet-XVV7S5b8.js";import"./integration-icon-gcYOl2yq.js";import"./use-navigate-to-agent-Cs1C-DBQ.js";import"./use-connection-C39BUY8e.js";import"./use-mcp-prompts-CspfQ-gW.js";import"./form-B9v_4_lt.js";import"./select-DwFQDgcX.js";import"./drawer-CTdCEiZw.js";import"./collection-search-DC-7DcrR.js";import"./toggle-group-6FcrOIsd.js";import"./use-deco-credits-Bax6GRog.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DPkWnrYu.js";import"./use-registry-connections-yBLIjpTM.js";import"./extract-connection-data-D4y9_vmi.js";import"./card-D7O9yDM9.js";import"./collection-tabs-CRIZ0CX_.js";import"./badge-DUlP8HvP.js";import"./connection-form-helpers-B_oQdAph.js";import"./useSuspenseInfiniteQuery-D48NS_O0.js";import"./mcp-oauth-C5QgI6bG.js";import"./connect-desktop-dialog-uLnBe_nQ.js";import"./decopilot-BsjqLgTH.js";import"./checkbox-DOg3LODJ.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-rOWH4a9G.js";import"./popover-BvZF2bBr.js";import"./command-BzTLypzr.js";import"./index-DVxNbd_g.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-Bvu0fELl.js";import"./empty-state-BDXQKaPV.js";import"./toolbar-DE_I2DnI.js";import"./preview-dialog-BikVelEl.js";import"./index-B2quJDhU.js";import"./use-mcp-tools-DnBnaQLn.js";import"./use-capability-A3j7T78I.js";import"./shell-route-loading-B5-wAKUU.js";import"./index-Br4BSsfF.js";import"./alert-dialog-BUQoXI1j.js";import"./switch-skMKJ2GI.js";import"./use-debounced-autosave-BzGp2qae.js";import"./index-1J83wgnT.js";import"./sidebar-Djn7svMG.js";import"./search-input-B-LDSHMx.js";import"./github-repo-picker-Qwduwaex.js";import"./use-secrets-BtkNg5h6.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-D7_rFTiD.js";import"./select-model-BWl1FGCY.js";import"./use-automations-CsLMaKM0.js";import"./monaco-editor-YJUBj_D_.js";import"./automation-runs-y9iHLMe2.js";import"./table-DsOuzcNK.js";import"./use-members-CtcSheMR.js";import"./use-org-auth-client-lV24PS0n.js";import"./task-status-DRz_b988.js";import"./automation-list-row-DMPjogBl.js";const $={authors:[{key:"name",label:"Name",widget:"text"},{key:"email",label:"Email",widget:"text",placeholder:"author@example.com"},{key:"jobTitle",label:"Job title",widget:"text"},{key:"company",label:"Company",widget:"text"},{key:"avatar",label:"Avatar",widget:"image"}]},q={authors:"Author"};function fr(S){const t=F.c(34),{orgSlug:v,virtualMcpId:j,branch:f,kind:p,blockKey:g,block:w}=S;let y;t[0]!==f||t[1]!==v||t[2]!==j?(y={orgSlug:v,virtualMcpId:j,branch:f},t[0]=f,t[1]=v,t[2]=j,t[3]=y):y=t[3];const m=R(y);let d;t[4]!==w||t[5]!==p?(d=D(w,p),t[4]=w,t[5]=p,t[6]=d):d=t[6];const B=d;let h;t[7]!==g||t[8]!==p||t[9]!==m?(h=e=>{m.mutate({blockKey:g,data:J(g,p,e)})},t[7]=g,t[8]=p,t[9]=m,t[10]=h):h=t[10];const[i,E]=K(B,h);let k;t[11]!==i||t[12]!==E?(k=(e,o)=>E({...i,[e]:o}),t[11]=i,t[12]=E,t[13]=k):k=t[13];const a=k,N=q[p];let s;t[14]!==N?(s=r.jsx("span",{className:"text-sm font-medium",children:N}),t[14]=N,t[15]=s):s=t[15];let l;t[16]!==m.isError||t[17]!==m.isPending?(l=r.jsx(M,{isPending:m.isPending,isError:m.isError}),t[16]=m.isError,t[17]=m.isPending,t[18]=l):l=t[18];let n;t[19]!==s||t[20]!==l?(n=r.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[s,l]}),t[19]=s,t[20]=l,t[21]=n):n=t[21];const I=$[p];let c;if(t[22]!==i||t[23]!==a||t[24]!==I){let e;t[26]!==i||t[27]!==a?(e=o=>r.jsx("div",{className:"space-y-2",children:o.widget==="image"?r.jsx(A,{schema:{type:"string",format:"image-uri",title:o.label},value:i[o.key],onChange:u=>a(o.key,u),path:o.key,label:o.label}):r.jsxs(r.Fragment,{children:[r.jsx(C,{htmlFor:o.key,children:o.label}),o.widget==="textarea"?r.jsx(L,{id:o.key,value:P(i[o.key]),onChange:u=>a(o.key,u.target.value),rows:3}):r.jsx(T,{id:o.key,value:P(i[o.key]),placeholder:o.placeholder,onChange:u=>a(o.key,u.target.value),className:"h-10"})]})},o.key),t[26]=i,t[27]=a,t[28]=e):e=t[28],c=I.map(e),t[22]=i,t[23]=a,t[24]=I,t[25]=c}else c=t[25];let x;t[29]!==c?(x=r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto px-6 py-6",children:r.jsx("div",{className:"mx-auto max-w-xl space-y-6",children:c})}),t[29]=c,t[30]=x):x=t[30];let b;return t[31]!==x||t[32]!==n?(b=r.jsxs("div",{className:"flex h-full flex-col",children:[n,x]}),t[31]=x,t[32]=n,t[33]=b):b=t[33],b}export{fr as RecordEditor};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-Dxd6kQFA.js","assets/index-Cvc1xn-4.js","assets/index-BITgxoqa.css","assets/XCircle-DJDxYBys.js","assets/CheckCircle-DOPRdShL.js","assets/Settings02-kQ4zmp5P.js","assets/use-mcp-client-DV4dF4m3.js","assets/auth-B9bEkbYh.js","assets/useInfiniteQuery-Bwr_uznn.js","assets/use-infinite-scroll-DM0o0Ibp.js","assets/studio-tools-D8q7MEyE.js","assets/badge-DUlP8HvP.js","assets/input-klr_kUC2.js","assets/dropdown-menu-CgCZ8Mte.js","assets/ChevronUp-DhHPsDAS.js","assets/ChevronRight-tj4xbWmM.js","assets/DotsVertical-kcsdrim_.js","assets/table-DsOuzcNK.js","assets/toggle-group-6FcrOIsd.js","assets/use-view-mode-CF449xEK.js","assets/tooltip-D_DwQRbZ.js","assets/FilterLines-D2obCQW_.js","assets/Globe01-CJXHyXNe.js","assets/SearchMd-CttVjXUQ.js","assets/dialog-DDL08EK8.js","assets/X-DC2HG4lX.js","assets/AlertCircle-BZqAQZBb.js","assets/Upload01-D4ez0Mu3.js","assets/alert-dialog-BUQoXI1j.js","assets/card-D7O9yDM9.js","assets/Trash01-BZXmKzie.js","assets/label-hfmZhqH1.js","assets/select-DwFQDgcX.js","assets/ChevronDown-BhLFFAly.js","assets/switch-skMKJ2GI.js","assets/textarea-2KmLad1y.js","assets/ArrowRight-6qgvW498.js","assets/checkbox-DOg3LODJ.js","assets/Eye-BfNssVzk.js","assets/LinkExternal01-DtLsAcMy.js","assets/use-copy-DM9BeeKg.js","assets/Key01-xj4UQriu.js","assets/Plus-BRQannbC.js","assets/mcp-oauth-C5QgI6bG.js","assets/Play-C0DhAO4u.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{c as s,j as e,r as i,i as a,ak as o}from"./index-Cvc1xn-4.js";import{R as m}from"./require-capability-kyUIYw2A.js";import"./use-capability-A3j7T78I.js";import"./access-gate-uvqL8ENQ.js";import"./capability-load-error-DTVGdoZZ.js";const n=i.lazy(()=>o(()=>import("./registry-layout-Dxd6kQFA.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44])));function f(){const r=s.c(1);let t;return r[0]===Symbol.for("react.memo_cache_sentinel")?(t=e.jsx(m,{capability:"registry:manage",area:"the registry",children:e.jsx(i.Suspense,{fallback:e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx(a,{size:20,className:"animate-spin text-muted-foreground"})}),children:e.jsx(n,{})})}),r[0]=t):t=r[0],t}export{f as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as $,s as Ne,K as re,b6 as dt,k as Oe,j as s,l as K,i as fe,B as ne,c as q,x as Pe,aB as Ie,y as se,aD as De,aE as ke,I as $e,C as mt,z as ut,d as Fe,t as he,p as Re,ae as Ke,a6 as ft,a2 as ht,b as gt,u as xt}from"./index-Cvc1xn-4.js";import{u as pt,C as bt}from"./use-organization-roles-DKqp_63r.js";import{u as je}from"./use-org-auth-client-lV24PS0n.js";import{B as ge}from"./badge-DUlP8HvP.js";import{f as Qe,a as qe,b as He,c as Ze,d as Xe,A as Je,e as We,g as et}from"./alert-dialog-BUQoXI1j.js";import{D as Tt,a as Et,b as _t,c as It}from"./dropdown-menu-CgCZ8Mte.js";import{a as Nt}from"./DotsVertical-kcsdrim_.js";import{s as Ae}from"./Plus-BRQannbC.js";import{s as St}from"./Trash01-BZXmKzie.js";import{P as te}from"./index-1J83wgnT.js";import{E as Ge}from"./empty-state-BDXQKaPV.js";import{S as ve}from"./search-input-B-LDSHMx.js";import{P as tt,D as st}from"./ai-providers-logos-DD3qZ33J.js";import{I as ye}from"./integration-icon-gcYOl2yq.js";import{u as Ct}from"./use-infinite-scroll-DM0o0Ibp.js";import{C as we}from"./checkbox-DOg3LODJ.js";import{i as At}from"./Settings02-kQ4zmp5P.js";import{u as Ot}from"./useSuspenseInfiniteQuery-D48NS_O0.js";import{u as Rt,S as jt}from"./use-mcp-client-DV4dF4m3.js";import{C as vt}from"./collection-search-DC-7DcrR.js";import{u as nt}from"./use-members-CtcSheMR.js";import{u as yt}from"./use-connection-C39BUY8e.js";import{u as wt,d as Mt}from"./use-ai-providers-0DJv4c0H.js";import{A as lt}from"./avatar-CKJB3djy.js";import{S as xe}from"./switch-skMKJ2GI.js";import{c as pe,b as be,T as Te,a as Ee}from"./tooltip-D_DwQRbZ.js";import{S as Ue,a as Be,b as Ve}from"./settings-section-rOWH4a9G.js";import{t as Lt}from"./ChevronDown-BhLFFAly.js";import{i as Pt}from"./ChevronRight-tj4xbWmM.js";import{i as ze}from"./X-DC2HG4lX.js";import{a as Dt}from"./use-capability-A3j7T78I.js";import{A as kt}from"./access-gate-uvqL8ENQ.js";import"./table-DsOuzcNK.js";import"./SwitchHorizontal01-BVKPeJMU.js";import"./ChevronUp-DhHPsDAS.js";import"./sidebar-Djn7svMG.js";import"./LayoutLeft-C9-KQh8d.js";import"./sheet-XVV7S5b8.js";import"./SearchMd-CttVjXUQ.js";import"./XCircle-DJDxYBys.js";import"./agent-icon-C4199b3i.js";import"./AlertCircle-BZqAQZBb.js";import"./Tool01-AyuVwnGv.js";import"./ArrowRight-6qgvW498.js";import"./ArrowUpRight-CUPFfker.js";import"./ZapSquare-ok_KEP9c.js";import"./Users03-C6siA5mE.js";import"./CheckCircle-DOPRdShL.js";import"./ChevronLeft-veOSKT91.js";import"./Stars02-Bo19XD__.js";import"./Eye-BfNssVzk.js";import"./ZoomOut-cYq1CP_X.js";import"./Globe01-CJXHyXNe.js";import"./FilterLines-D2obCQW_.js";import"./Star01-CFj5T2Jl.js";import"./Globe04-PQ0ejRYI.js";import"./HardDrive-DEG8fjxw.js";import"./Key01-xj4UQriu.js";import"./LinkExternal01-DtLsAcMy.js";import"./Monitor01-CvNVisni.js";import"./Sun-CcSW7Ngf.js";import"./Palette-yNiXmyHD.js";import"./Play-C0DhAO4u.js";import"./Shield01-BZZVugf_.js";import"./Stars01-C4FyHP_L.js";import"./Upload01-D4ez0Mu3.js";import"./User01-Dz33ODze.js";import"./Users01-aBataJ8N.js";import"./XClose-BcOWKb5Q.js";import"./Zap-OOZsYg72.js";import"./auth-B9bEkbYh.js";import"./use-collections-dA9ibOHr.js";import"./studio-tools-D8q7MEyE.js";import"./card-D7O9yDM9.js";import"./capability-load-error-DTVGdoZZ.js";const Me="basic-usage",Le=[{id:Me,label:"Basic Usage",description:"Tools all org members can access by default",section:"Basic Usage",tools:["COLLECTION_CONNECTIONS_LIST","COLLECTION_CONNECTIONS_GET","CONNECTION_TEST","COLLECTION_VIRTUAL_MCP_LIST","COLLECTION_VIRTUAL_MCP_GET","VIRTUAL_MCP_PLUGIN_CONFIG_GET","VIRTUAL_MCP_LAST_USED_LIST","AUTOMATION_GET","AUTOMATION_LIST","AUTOMATION_RUN_STATS","AI_PROVIDERS_LIST","AI_PROVIDERS_LIST_MODELS","AI_PROVIDERS_ACTIVE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_CREDITS","AI_PROVIDER_TOPUP_URL","LIST_OBJECTS","GET_OBJECT_METADATA","GET_PRESIGNED_URL","PUT_PRESIGNED_URL","FILE_OBJECTS_LIST","SANDBOX_START","SANDBOX_DELETE","GLOBAL_SEARCH","ORGANIZATION_SETTINGS_GET","USER_GET","LINK_CURRENT_GET","LINK_DISCONNECT","BRAND_CONTEXT_LIST","COLLECTION_THREADS_CREATE","COLLECTION_THREADS_LIST","COLLECTION_THREADS_GET","COLLECTION_THREADS_UPDATE","COLLECTION_THREADS_DELETE","COLLECTION_THREAD_MESSAGES_LIST","THREAD_BACKGROUND_TOOL_START","THREAD_SUBTASK_DELIVER"]},{id:"org:manage",label:"Manage organization",description:"Edit organization settings, brand context, and domain configuration",section:"Organization",tools:["ORGANIZATION_GET","ORGANIZATION_LIST","ORGANIZATION_UPDATE","ORGANIZATION_SETTINGS_GET","ORGANIZATION_SETTINGS_UPDATE","BRAND_CONTEXT_LIST","BRAND_CONTEXT_GET","BRAND_CONTEXT_CREATE","BRAND_CONTEXT_UPDATE","BRAND_CONTEXT_DELETE","BRAND_CONTEXT_EXTRACT","BRAND_GET","BRAND_LIST","ORGANIZATION_DOMAIN_LIST","ORGANIZATION_DOMAIN_ADD","ORGANIZATION_DOMAIN_UPDATE","ORGANIZATION_DOMAIN_VERIFY","ORGANIZATION_DOMAIN_REMOVE"]},{id:"members:manage",label:"Manage members",description:"Invite members, remove them, and change their roles",section:"Organization",tools:["ORGANIZATION_MEMBER_LIST","ORGANIZATION_MEMBER_ADD","ORGANIZATION_MEMBER_REMOVE","ORGANIZATION_MEMBER_UPDATE_ROLE","ORGANIZATION_JOIN_REQUEST_LIST","ORGANIZATION_JOIN_REQUEST_APPROVE","ORGANIZATION_JOIN_REQUEST_DENY"],dangerous:!0},{id:"connections:manage",label:"Manage connections",description:"Create, update, and delete connections",section:"Connections & Agents",tools:["COLLECTION_CONNECTIONS_CREATE","COLLECTION_CONNECTIONS_UPDATE","COLLECTION_CONNECTIONS_DELETE","COMMERCE_DISCOVERY_SETUP"],dangerous:!0},{id:"agents:manage",label:"Manage agents",description:"Create, configure, and delete agents",section:"Connections & Agents",tools:["COLLECTION_VIRTUAL_MCP_CREATE","COLLECTION_VIRTUAL_MCP_UPDATE","COLLECTION_VIRTUAL_MCP_DELETE","VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE","VIRTUAL_MCP_PINNED_VIEWS_UPDATE"],dangerous:!0},{id:"automations:manage",label:"Manage automations",description:"Create, update, run, and delete automations",section:"Automations",tools:["AUTOMATION_CREATE","AUTOMATION_UPDATE","AUTOMATION_DELETE","AUTOMATION_TRIGGER_ADD","AUTOMATION_TRIGGER_REMOVE","AUTOMATION_TRIGGER_ROTATE_TOKEN","AUTOMATION_RUN"],dangerous:!0},{id:"monitoring:view",label:"View monitoring",description:"Access logs and usage statistics",section:"Monitoring",tools:["MONITORING_LOG_GET","MONITORING_LOGS_LIST","MONITORING_STATS","MONITORING_THREAD_USAGE"]},{id:"secrets:manage",label:"Manage secrets",description:"Create and list secrets stored in the credential vault",section:"Organization",tools:["SECRET_CREATE","SECRET_LIST"]},{id:"file-configs:manage",label:"Manage file configs",description:"Create, list, update and delete S3 bucket configurations",section:"Organization",tools:["FILE_CONFIG_CREATE","FILE_CONFIG_LIST","FILE_CONFIG_UPDATE","FILE_CONFIG_DELETE","FILE_OBJECTS_LIST"]},{id:"ai-providers:manage",label:"Manage AI providers",description:"Add or remove API keys and provision provider credentials",section:"AI Providers",tools:["AI_PROVIDER_KEY_CREATE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_KEY_DELETE","AI_PROVIDER_KEY_UPDATE","AI_PROVIDER_KEY_PREVIEW","AI_PROVIDER_OAUTH_URL","AI_PROVIDER_OAUTH_EXCHANGE","AI_PROVIDER_PROVISION_KEY","AI_PROVIDER_TOPUP_URL","AI_PROVIDER_CREDITS"]},{id:"tags:manage",label:"Manage tags",description:"Create, assign, and delete organization tags",section:"Organization",tools:["TAGS_LIST","TAGS_CREATE","TAGS_DELETE","MEMBER_TAGS_GET","MEMBER_TAGS_SET"]},{id:"registry:manage",label:"Manage registry",description:"Browse, publish, and manage items in the registry",section:"Store & Registry",tools:["COLLECTION_REGISTRY_APP_LIST","COLLECTION_REGISTRY_APP_GET","COLLECTION_REGISTRY_APP_VERSIONS","COLLECTION_REGISTRY_APP_FILTERS","REGISTRY_ITEM_LIST","REGISTRY_ITEM_SEARCH","REGISTRY_ITEM_GET","REGISTRY_ITEM_VERSIONS","REGISTRY_ITEM_FILTERS","REGISTRY_DISCOVER_TOOLS","REGISTRY_ITEM_CREATE","REGISTRY_ITEM_BULK_CREATE","REGISTRY_ITEM_UPDATE","REGISTRY_ITEM_DELETE","REGISTRY_AI_GENERATE","REGISTRY_PUBLISH_REQUEST_LIST","REGISTRY_PUBLISH_REQUEST_REVIEW","REGISTRY_PUBLISH_REQUEST_COUNT","REGISTRY_PUBLISH_REQUEST_DELETE","REGISTRY_PUBLISH_API_KEY_GENERATE","REGISTRY_PUBLISH_API_KEY_LIST","REGISTRY_PUBLISH_API_KEY_REVOKE"],dangerous:!0},{id:"registry:monitor",label:"Monitor registry health",description:"Run health checks on registry connections and view results",section:"Store & Registry",tools:["REGISTRY_MONITOR_RUN_START","REGISTRY_MONITOR_RUN_LIST","REGISTRY_MONITOR_RUN_GET","REGISTRY_MONITOR_RUN_CANCEL","REGISTRY_MONITOR_RESULT_LIST","REGISTRY_MONITOR_CONNECTION_LIST","REGISTRY_MONITOR_CONNECTION_SYNC","REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH"]},{id:"api-keys:manage",label:"Manage API keys",description:"Create, update, and revoke API keys",section:"Developer",tools:["API_KEY_CREATE","API_KEY_LIST","API_KEY_UPDATE","API_KEY_DELETE"]},{id:"storage:delete",label:"Delete from storage",description:"Permanently delete files from object storage",section:"Developer",tools:["DELETE_OBJECT","DELETE_OBJECTS"],dangerous:!0},{id:"connections:sql",label:"Run SQL queries",description:"Execute raw SQL against connected databases",section:"Developer",tools:["DATABASES_RUN_SQL"],dangerous:!0}];[...Le.find(t=>t.id===Me)?.tools??[]];const Gt=["agents:manage","connections:manage"];new Set(Le.filter(t=>Gt.includes(t.id)).flatMap(t=>t.tools));function Ut(){const t=new Map;for(const e of Le){if(e.id===Me)continue;const n=t.get(e.section)??[];n.push(e),t.set(e.section,n)}return Array.from(t.entries()).map(([e,n])=>({section:e,capabilities:n}))}function Bt(t,e,n){return n?!0:t.tools.every(l=>e.includes(l))}function Vt(t,e,n){if(n){const i=new Set(e);for(const r of t.tools)i.add(r);return Array.from(i)}const l=new Set(e);for(const i of t.tools)l.delete(i);return Array.from(l)}function zt(t){const e=q.c(21),{connection:n,isSelected:l,hasToolsEnabled:i,activeToolsCount:r,totalToolsCount:d,onSelect:h,onToggle:c}=t,g=l?"bg-accent/50":"hover:bg-muted/50";let f;e[0]!==g?(f=K("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",g),e[0]=g,e[1]=f):f=e[1];let a;e[2]!==n.icon||e[3]!==n.title?(a=s.jsx(ye,{icon:n.icon,name:n.title,size:"xs"}),e[2]=n.icon,e[3]=n.title,e[4]=a):a=e[4];let x;e[5]!==n.title?(x=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title})}),e[5]=n.title,e[6]=x):x=e[6];let o;e[7]!==h||e[8]!==a||e[9]!==x?(o=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:h,children:[a,x]}),e[7]=h,e[8]=a,e[9]=x,e[10]=o):o=e[10];let m;e[11]!==r||e[12]!==n.tools||e[13]!==i||e[14]!==c||e[15]!==d?(m=n.tools&&n.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[r,"/",d]}),s.jsx(we,{checked:i,onCheckedChange:c,onClick:Yt})]}),e[11]=r,e[12]=n.tools,e[13]=i,e[14]=c,e[15]=d,e[16]=m):m=e[16];let N;return e[17]!==f||e[18]!==o||e[19]!==m?(N=s.jsxs("div",{className:f,children:[o,m]}),e[17]=f,e[18]=o,e[19]=m,e[20]=N):N=e[20],N}function Yt(t){return t.stopPropagation()}function $t(t){const e=q.c(18),{connectionId:n,tool:l,isSelected:i,onToggle:r}=t,d=`tool-${n}-${l.name}`,h=i?"text-foreground":"text-muted-foreground";let c;e[0]!==h?(c=K("text-sm font-medium",h),e[0]=h,e[1]=c):c=e[1];let g;e[2]!==c||e[3]!==l.name?(g=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:c,children:l.name})}),e[2]=c,e[3]=l.name,e[4]=g):g=e[4];let f;e[5]!==l.description?(f=l.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:l.description}),e[5]=l.description,e[6]=f):f=e[6];let a;e[7]!==g||e[8]!==f?(a=s.jsxs("div",{className:"flex-1 min-w-0",children:[g,f]}),e[7]=g,e[8]=f,e[9]=a):a=e[9];const x=`tool-${n}-${l.name}`;let o;e[10]!==i||e[11]!==r||e[12]!==x?(o=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(we,{id:x,checked:i,onCheckedChange:r,onClick:Ft})}),e[10]=i,e[11]=r,e[12]=x,e[13]=o):o=e[13];let m;return e[14]!==d||e[15]!==a||e[16]!==o?(m=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:d,children:[a,o]}),e[14]=d,e[15]=a,e[16]=o,e[17]=m):m=e[17],m}function Ft(t){return t.stopPropagation()}function Kt({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:n,searchQuery:l}){const[i,r]=$.useState(""),d=l!==void 0?l:i,h=$.useDeferredValue(d),[c,g]=$.useState("all"),[f,a]=$.useState(!1),x=$.useRef(new Set(Object.keys(t))),{org:o}=Ne(),m=Rt({connectionId:jt,orgId:o.id,orgSlug:o.slug}),N=100,E=h.trim(),T=E?{operator:"or",conditions:[{field:["title"],operator:"contains",value:E},{field:["description"],operator:"contains",value:E}]}:void 0,S=!!n,C={...T&&{where:T},orderBy:[{field:["updated_at"],direction:"asc"}],limit:N,offset:0,...S&&{include_virtual:!0}},v=JSON.stringify(C),{data:_,fetchNextPage:O,hasNextPage:p,isFetchingNextPage:R}=Ot({queryKey:re.collectionListInfinite(m,o.id,"","CONNECTIONS",v),queryFn:async({pageParam:b=0})=>(await m.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...T&&{where:T},orderBy:[{field:["updated_at"],direction:"asc"}],limit:N,offset:b,...S&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(b,D)=>{if(b?.hasMore)return D.reduce((Q,H)=>Q+(H?.items?.length??0),0)},staleTime:3e4}),I=_?.pages.flatMap(b=>b?.items??[])??[],j=Ct(O,p??!1,R),u=n?I.filter(b=>b.connection_type!=="VIRTUAL"?!0:dt(b.connection_url)!==n):I,w=x.current,A=[...w.values()].map(b=>u.find(D=>D.id===b)).filter(b=>b!==void 0),k=u.filter(b=>!w.has(b.id)),G=[...A,...k],U=b=>{const D=t[b];return D!==void 0&&D.length>0},B=G.filter(b=>{if(c==="all")return!0;const D=U(b.id);return c==="selected"?D:c==="unselected"?!D:!0}),[M,z]=$.useState(G[0]?.id??null),y=M?G.find(b=>b.id===M)??null:null,{data:L,isFetching:Y}=Oe({queryKey:re.collectionItem(m,o.id,"","CONNECTIONS",M??""),queryFn:async()=>M?(await m.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:M}})).structuredContent?.item??null:null,enabled:!!M,staleTime:3e4}),F=L?.tools??[],X=(b,D)=>t[b]?.includes(D)??!1,J=(b,D)=>{const Q=t[b]??[],H=Q.includes(D),W={...t};if(H){const Z=Q.filter(ee=>ee!==D);Z.length===0?delete W[b]:W[b]=Z}else W[b]=[...Q,D];e(W)},le=b=>{const D=b===M?F:[];if(!D.length)return;const Q=t[b]??[],H=D.map(ee=>ee.name),W=Q.length>0&&H.every(ee=>Q.includes(ee)),Z={...t};W?delete Z[b]:(Z[b]=H,z(b)),e(Z)},oe=b=>{z(b),a(!0)},ie=()=>{a(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:K("w-full md:w-80 border-r border-border flex flex-col",f&&"hidden md:flex"),children:[l===void 0&&s.jsx(vt,{value:i,onChange:r,placeholder:"Search MCP Servers..."}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>g("all"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),s.jsx("button",{onClick:()=>g("selected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),s.jsx("button",{onClick:()=>g("unselected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:B.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:d?"No connections found":c==="selected"?"No servers selected":c==="unselected"?"No unselected servers":"No connections available"}):s.jsxs("div",{className:"p-2 space-y-1",children:[B.map(b=>{const D=M===b.id,Q=D?F.length:0,H=t[b.id]?.length??0;return s.jsx(zt,{connection:{...b,tools:D?F:b.tools},isSelected:D,hasToolsEnabled:U(b.id),activeToolsCount:H,totalToolsCount:Q,onSelect:()=>oe(b.id),onToggle:()=>le(b.id)},b.id)}),s.jsx("div",{ref:j,className:"h-4"}),R&&s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(fe,{size:18,className:"animate-spin text-muted-foreground"})})]})})]}),s.jsx("div",{className:K("flex-1 flex-col",f?"flex":"hidden md:flex"),children:y?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[s.jsx(ne,{variant:"ghost",size:"sm",onClick:ie,className:"h-8 w-8 p-0 shrink-0",children:s.jsx(At,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(ye,{icon:y.icon,name:y.title,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:y.title}),y.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:y.description})]})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-4",children:Y?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(fe,{size:18,className:"animate-spin text-muted-foreground"})}):F.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:"This connection has no tools available"}):s.jsx("div",{className:"space-y-2",children:F.map(b=>s.jsx($t,{connectionId:y.id,tool:b,isSelected:X(y.id,b.name),onToggle:()=>J(y.id,b.name)},b.name))})})]}):s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"Select a connection to view its tools"})})})]})}const Se=["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"],Qt={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function qt(t){if(!t)return"bg-neutral-400";let e=0;for(let l=0;l<t.length;l++){const i=t.charCodeAt(l);e=(e<<5)-e+i,e=e&e}const n=Math.abs(e)%Se.length;return Se[n]??Se[0]}function Ht(t,e){return Qt[t]??"bg-neutral-400"}const Zt=Pe({role:Pe({id:se().optional(),slug:se().optional(),label:se()}),allowAllStaticPermissions:ke(),staticPermissions:Ie(se()),toolSet:De(se(),Ie(se())),allowAllModels:ke(),modelSet:De(se(),Ie(se())),memberIds:Ie(se())});function ot(t){return t?t.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):"?"}function Ye(t,e,n){const l=s.jsx(xe,{checked:t,disabled:e,onCheckedChange:n});return e?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:l})}),s.jsx(Ee,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):l}function Xt(t){const e=q.c(28),{allowAllStaticPermissions:n,staticPermissions:l,onAllowAllChange:i,onPermissionsChange:r,readOnly:d,searchQuery:h}=t,c=d===void 0?!1:d;let g;e[0]!==h?(g=h.trim().toLowerCase(),e[0]=h,e[1]=g):g=e[1];const f=$.useDeferredValue(g);let a;if(e[2]!==n||e[3]!==f||e[4]!==i||e[5]!==r||e[6]!==c||e[7]!==h||e[8]!==l){const x=Ut(),o=(v,_)=>{if(!c){if(n&&_){const O=x.flatMap(es).flatMap(Wt);i(!1),r(O.filter(p=>!v.tools.includes(p)));return}n||r(Vt(v,l,!_))}};let m;e[10]!==f?(m=v=>{const{section:_,capabilities:O}=v;return{section:_,capabilities:O.filter(p=>!f||p.label.toLowerCase().includes(f)||p.description.toLowerCase().includes(f))}},e[10]=f,e[11]=m):m=e[11];const N=x.map(m).filter(Jt);let E;e[12]!==n||e[13]!==i||e[14]!==r?(E=()=>{i(!n),r([])},e[12]=n,e[13]=i,e[14]=r,e[15]=E):E=e[15];let T;e[16]!==n||e[17]!==c||e[18]!==E?(T=Ye(n,c,E),e[16]=n,e[17]=c,e[18]=E,e[19]=T):T=e[19];let S;e[20]!==n||e[21]!==i||e[22]!==r||e[23]!==c?(S=c?void 0:()=>{i(!n),r([])},e[20]=n,e[21]=i,e[22]=r,e[23]=c,e[24]=S):S=e[24];let C;e[25]!==T||e[26]!==S?(C=s.jsx(Ue,{title:"General",children:s.jsx(Be,{children:s.jsx(Ve,{title:"All organization permissions",description:"Grant full access to all features below",action:T,onClick:S})})}),e[25]=T,e[26]=S,e[27]=C):C=e[27],a=s.jsx("div",{children:s.jsxs("div",{className:"flex flex-col gap-10 py-4",children:[C,N.length===0&&f?s.jsxs("p",{className:"text-sm text-muted-foreground py-4",children:["No permissions match “",h,"”"]}):N.map(v=>{const{section:_,capabilities:O}=v;return s.jsx(Ue,{title:_,children:s.jsx(Be,{children:O.map(p=>{const R=Bt(p,l,n);return s.jsx(Ve,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[p.label,p.dangerous&&s.jsx(ft,{size:12,className:"text-amber-500 shrink-0"})]}),description:p.description,action:Ye(R,c,()=>o(p,R)),onClick:c?void 0:()=>o(p,R)},p.id)})})},_)})]})}),e[2]=n,e[3]=f,e[4]=i,e[5]=r,e[6]=c,e[7]=h,e[8]=l,e[9]=a}else a=e[9];return a}function Jt(t){return t.capabilities.length>0}function Wt(t){return t.tools}function es(t){return t.capabilities}const it={anthropic:"Anthropic",openrouter:"OpenRouter"},ts={openai:"OpenAI",anthropic:"Anthropic",google:"Google","meta-llama":"Meta",mistralai:"Mistral","x-ai":"xAI",deepseek:"DeepSeek",qwen:"Qwen",moonshotai:"MoonshotAI",nvidia:"NVIDIA",perplexity:"Perplexity",cohere:"Cohere",amazon:"Amazon",microsoft:"Microsoft","z-ai":"Z.ai","ibm-granite":"IBM Granite",alibaba:"Alibaba",baidu:"Baidu",bytedance:"ByteDance",tencent:"Tencent",minimax:"MiniMax",nousresearch:"Nous Research",allenai:"Allen AI",inception:"Inception"};function ss(t,e){const n=t.indexOf("/"),l=n>0?t.slice(0,n):e;return l.startsWith("~")?l.slice(1):l}function ns(t){return ts[t]??it[t]??t}function ls(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const rt=30;function os(t){const e=q.c(44),{connectionId:n,subProviderId:l,subProviderName:i,groupLogo:r,models:d,allConnectionModelIds:h,selectedModels:c,allowAllModels:g,allConnectionModelsSelected:f,onToggleModel:a,onExitAllowAll:x,readOnly:o,defaultExpanded:m}=t,[N,E]=$.useState(m),T=m||N,S=E,[C,v]=$.useState(rt);let _;e[0]!==f||e[1]!==g||e[2]!==c?(_=j=>g||f||c.includes("*")||c.includes(j),e[0]=f,e[1]=g,e[2]=c,e[3]=_):_=e[3];const O=_;let p;if(e[4]!==O||e[5]!==d){let j;e[7]!==O?(j=u=>O(u.id),e[7]=O,e[8]=j):j=e[8],p=d.filter(j),e[4]=O,e[5]=d,e[6]=p}else p=e[6];const R=p.length;let I;if(e[9]!==h||e[10]!==g||e[11]!==n||e[12]!==R||e[13]!==T||e[14]!==r||e[15]!==O||e[16]!==d||e[17]!==x||e[18]!==a||e[19]!==o||e[20]!==l||e[21]!==i||e[22]!==C){const j=d.slice(0,C),u=d.length>C;let w;e[24]===Symbol.for("react.memo_cache_sentinel")?(w=()=>S(cs),e[24]=w):w=e[24];const A=r??tt[l]??st;let k;e[25]!==i||e[26]!==A?(k=s.jsx(ye,{icon:A,name:i,size:"sm"}),e[25]=i,e[26]=A,e[27]=k):k=e[27];let G;e[28]!==i?(G=s.jsx("span",{className:"text-sm font-medium truncate",children:i}),e[28]=i,e[29]=G):G=e[29];let U;e[30]!==k||e[31]!==G?(U=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[k,G]}),e[30]=k,e[31]=G,e[32]=U):U=e[32];let B;e[33]!==R||e[34]!==d.length?(B=s.jsxs(ge,{variant:"secondary",className:"text-xs text-muted-foreground",children:[R,"/",d.length," enabled"]}),e[33]=R,e[34]=d.length,e[35]=B):B=e[35];let M;e[36]!==T?(M=T?s.jsx(Lt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(Pt,{size:16,className:"text-muted-foreground shrink-0"}),e[36]=T,e[37]=M):M=e[37];let z;e[38]!==M||e[39]!==B?(z=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[B,M]}),e[38]=M,e[39]=B,e[40]=z):z=e[40];let y;e[41]!==z||e[42]!==U?(y=s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted/50 cursor-pointer",onClick:w,children:[U,z]}),e[41]=z,e[42]=U,e[43]=y):y=e[43],I=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[y,T&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[j.map(L=>{const Y=O(L.id),F=()=>{if(!o){if(g){x(n,h,L.id);return}a(n,L.id)}};return s.jsxs("div",{className:K("flex items-center justify-between gap-3 px-4 py-3 border-b border-border last:border-b-0",!o&&"hover:bg-muted/50 cursor-pointer"),onClick:F,children:[s.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:s.jsx("span",{className:"text-sm truncate",children:L.title})}),s.jsx("div",{onClick:as,children:o?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:s.jsx(xe,{checked:Y,disabled:!0,onCheckedChange:rs})})}),s.jsx(Ee,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(xe,{checked:Y,onCheckedChange:F})})]},L.id)}),u&&s.jsxs("button",{type:"button",className:"w-full px-4 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",onClick:()=>v(is),children:["Show more (",d.length-C," remaining)"]})]})]}),e[9]=h,e[10]=g,e[11]=n,e[12]=R,e[13]=T,e[14]=r,e[15]=O,e[16]=d,e[17]=x,e[18]=a,e[19]=o,e[20]=l,e[21]=i,e[22]=C,e[23]=I}else I=e[23];return I}function is(t){return t+rt}function rs(){}function as(t){return t.stopPropagation()}function cs(t){return!t}function ds(t){const e=q.c(33),{connection:n,selectedModels:l,allowAllModels:i,onToggleModel:r,onExitAllowAll:d,allConnectionModelsSelected:h,searchQuery:c,readOnly:g}=t,f=Mt(n.id);let a,x,o,m,N;if(e[0]!==h||e[1]!==i||e[2]!==n.id||e[3]!==n.label||e[4]!==n.providerId||e[5]!==d||e[6]!==r||e[7]!==f||e[8]!==g||e[9]!==c||e[10]!==l){N=Symbol.for("react.early_return_sentinel");e:{let S;e[16]!==n.label?(S=A=>({...A,id:A.modelId,provider:n.label}),e[16]=n.label,e[17]=S):S=e[17];const C=f.filter(hs).map(S),v=c.trim().toLowerCase(),_=v?C.filter(A=>A.title.toLowerCase().includes(v)||A.id.toLowerCase().includes(v)||A.provider?.toLowerCase().includes(v)):C;if(_.length===0){N=null;break e}const O=new Map;for(const A of _){const k=ss(A.id,n.providerId),G=O.get(k)??{models:[],logo:null};G.models.push({id:A.id,title:ls(A.title),logo:A.logo}),!G.logo&&A.logo&&(G.logo=A.logo),O.set(k,G)}const p=Array.from(O.entries()).map(fs).sort(us),R=p.length===1||v.length>0;o="flex flex-col gap-3";const I=tt[n.providerId]??st;let j;e[18]!==n.providerId||e[19]!==I?(j=s.jsx("img",{src:I,alt:n.providerId,className:"w-4 h-4 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),e[18]=n.providerId,e[19]=I,e[20]=j):j=e[20];const u=it[n.providerId]??n.providerId;let w;e[21]!==u?(w=s.jsx("h4",{className:"text-sm font-medium",children:u}),e[21]=u,e[22]=w):w=e[22],e[23]!==w||e[24]!==j?(m=s.jsxs("div",{className:"flex items-center gap-2",children:[j,w]}),e[23]=w,e[24]=j,e[25]=m):m=e[25],a="flex flex-col gap-3",x=p.map(A=>s.jsx(os,{connectionId:n.id,subProviderId:A.id,subProviderName:A.name,groupLogo:A.logo,models:A.models,allConnectionModelIds:C.map(ms),selectedModels:l,allowAllModels:i,allConnectionModelsSelected:h,onToggleModel:r,onExitAllowAll:d,readOnly:g,defaultExpanded:R},A.id))}e[0]=h,e[1]=i,e[2]=n.id,e[3]=n.label,e[4]=n.providerId,e[5]=d,e[6]=r,e[7]=f,e[8]=g,e[9]=c,e[10]=l,e[11]=a,e[12]=x,e[13]=o,e[14]=m,e[15]=N}else a=e[11],x=e[12],o=e[13],m=e[14],N=e[15];if(N!==Symbol.for("react.early_return_sentinel"))return N;let E;e[26]!==a||e[27]!==x?(E=s.jsx("div",{className:a,children:x}),e[26]=a,e[27]=x,e[28]=E):E=e[28];let T;return e[29]!==o||e[30]!==m||e[31]!==E?(T=s.jsxs("div",{className:o,children:[m,E]}),e[29]=o,e[30]=m,e[31]=E,e[32]=T):T=e[32],T}function ms(t){return t.id}function us(t,e){return t.name.localeCompare(e.name)}function fs(t){const[e,n]=t;return{id:e,name:ns(e),logo:n.logo,models:n.models}}function hs(t,e,n){return n.findIndex(l=>l.modelId===t.modelId)===e}function gs(t){const e=q.c(35),{allowAllModels:n,modelSet:l,onAllowAllChange:i,onModelSetChange:r,readOnly:d,searchQuery:h}=t,c=d===void 0?!1:d,g=$.useDeferredValue(h),f=wt();let a;e[0]!==l||e[1]!==r?(a=(p,R)=>{const I=l[p]??[],j={...l};if(I.includes(R)){const u=I.filter(w=>w!==R);u.length===0?delete j[p]:j[p]=u}else j[p]=[...I,R];r(j)},e[0]=l,e[1]=r,e[2]=a):a=e[2];const x=a;let o;e[3]!==l||e[4]!==i||e[5]!==r?(o=(p,R,I)=>{i(!1),r({...l,[p]:R.filter(j=>j!==I)})},e[3]=l,e[4]=i,e[5]=r,e[6]=o):o=e[6];const m=o,N=!c&&"hover:bg-muted/50 cursor-pointer";let E;e[7]!==N?(E=K("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",N),e[7]=N,e[8]=E):E=e[8];let T;e[9]!==n||e[10]!==i||e[11]!==r||e[12]!==c?(T=()=>{if(c)return;const p=!n;i(p),p&&r({})},e[9]=n,e[10]=i,e[11]=r,e[12]=c,e[13]=T):T=e[13];let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("span",{className:"text-sm font-medium",children:"All models"}),e[14]=S):S=e[14];let C;e[15]!==n||e[16]!==i||e[17]!==r||e[18]!==c?(C=s.jsx("div",{onClick:ps,children:c?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:s.jsx(xe,{checked:n,disabled:!0,onCheckedChange:xs})})}),s.jsx(Ee,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(xe,{checked:n,onCheckedChange:p=>{i(p),p&&r({})}})}),e[15]=n,e[16]=i,e[17]=r,e[18]=c,e[19]=C):C=e[19];let v;e[20]!==E||e[21]!==T||e[22]!==C?(v=s.jsxs("div",{className:E,onClick:T,children:[S,C]}),e[20]=E,e[21]=T,e[22]=C,e[23]=v):v=e[23];let _;e[24]!==f||e[25]!==n||e[26]!==g||e[27]!==m||e[28]!==l||e[29]!==c||e[30]!==x?(_=f.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No LLM connections configured"}):f.map(p=>s.jsx($.Suspense,{fallback:s.jsxs("div",{className:"px-4 py-3 flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(fe,{className:"size-4 animate-spin"}),"Loading models..."]}),children:s.jsx(ds,{connection:p,selectedModels:l[p.id]??[],allowAllModels:n,onToggleModel:x,onExitAllowAll:m,allConnectionModelsSelected:(l[p.id]??[]).includes("*"),searchQuery:g,readOnly:c})},p.id)),e[24]=f,e[25]=n,e[26]=g,e[27]=m,e[28]=l,e[29]=c,e[30]=x,e[31]=_):_=e[31];let O;return e[32]!==_||e[33]!==v?(O=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[v,_]}),e[32]=_,e[33]=v,e[34]=O):O=e[34],O}function xs(){}function ps(t){return t.stopPropagation()}function bs(t){const e=q.c(52),{open:n,onOpenChange:l,selectedMemberIds:i,onAddMembers:r}=t,[d,h]=$.useState(""),c=$.useDeferredValue(d);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];const[f,a]=$.useState(g),{data:x}=nt();let o,m,N,E,T,S,C,v,_,O,p;if(e[1]!==x?.data?.members||e[2]!==c||e[3]!==r||e[4]!==l||e[5]!==n||e[6]!==f||e[7]!==d||e[8]!==i){const U=x?.data?.members??[];let B;e[20]!==c?(B=y=>{const L=c.toLowerCase();return y.user?.name?.toLowerCase().includes(L)||y.user?.email?.toLowerCase().includes(L)},e[20]=c,e[21]=B):B=e[21];const M=U.filter(B);let z;e[22]!==r||e[23]!==l||e[24]!==f?(z=()=>{r(f),a([]),l(!1)},e[22]=r,e[23]=l,e[24]=f,e[25]=z):z=e[25],N=z,m=Qe,O=n,p=l,o=qe,v="sm:max-w-md p-0",e[26]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs(He,{className:"px-6 pt-6",children:[s.jsx(Ze,{children:"Add Members to Role"}),s.jsx(Xe,{children:"Select members to add to this role."})]}),e[26]=_):_=e[26],S="flex flex-col h-80",e[27]!==d?(C=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(ve,{value:d,onChange:h,placeholder:"Search members...",className:"w-full"})}),e[27]=d,e[28]=C):C=e[28],E="flex-1 overflow-auto",T=M.length===0?s.jsx("div",{className:"flex items-center justify-center h-full px-6",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:d?"No members found":"No members available"})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:M.map(y=>{const L=y.role!=="owner",Y=i.includes(y.id),F=f.includes(y.id);return s.jsxs("label",{className:K("flex items-center gap-3 p-2 rounded-lg",!L||Y?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(we,{checked:F||Y,onCheckedChange:()=>{!L||Y||a(X=>X.includes(y.id)?X.filter(J=>J!==y.id):[...X,y.id])},disabled:!L||Y}),s.jsx(lt,{url:y.user?.image??void 0,fallback:ot(y.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:y.user?.name||"Unknown"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y.user?.email})]}),!L&&s.jsx(ge,{variant:"secondary",className:"shrink-0",children:"Owner"}),Y&&L&&s.jsx(ge,{variant:"outline",className:"shrink-0",children:"Added"})]},y.id)})}),e[1]=x?.data?.members,e[2]=c,e[3]=r,e[4]=l,e[5]=n,e[6]=f,e[7]=d,e[8]=i,e[9]=o,e[10]=m,e[11]=N,e[12]=E,e[13]=T,e[14]=S,e[15]=C,e[16]=v,e[17]=_,e[18]=O,e[19]=p}else o=e[9],m=e[10],N=e[11],E=e[12],T=e[13],S=e[14],C=e[15],v=e[16],_=e[17],O=e[18],p=e[19];let R;e[29]!==E||e[30]!==T?(R=s.jsx("div",{className:E,children:T}),e[29]=E,e[30]=T,e[31]=R):R=e[31];let I;e[32]!==R||e[33]!==S||e[34]!==C?(I=s.jsxs("div",{className:S,children:[C,R]}),e[32]=R,e[33]=S,e[34]=C,e[35]=I):I=e[35];let j;e[36]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Je,{children:"Cancel"}),e[36]=j):j=e[36];const u=f.length===0,w=f.length>0&&`(${f.length})`;let A;e[37]!==N||e[38]!==u||e[39]!==w?(A=s.jsxs(We,{className:"px-6 pb-6",children:[j,s.jsxs(et,{onClick:N,disabled:u,children:["Add ",w]})]}),e[37]=N,e[38]=u,e[39]=w,e[40]=A):A=e[40];let k;e[41]!==o||e[42]!==I||e[43]!==A||e[44]!==v||e[45]!==_?(k=s.jsxs(o,{className:v,children:[_,I,A]}),e[41]=o,e[42]=I,e[43]=A,e[44]=v,e[45]=_,e[46]=k):k=e[46];let G;return e[47]!==m||e[48]!==k||e[49]!==O||e[50]!==p?(G=s.jsx(m,{open:O,onOpenChange:p,children:k}),e[47]=m,e[48]=k,e[49]=O,e[50]=p,e[51]=G):G=e[51],G}function Ts(t){const e=q.c(29),{memberIds:n,onMemberIdsChange:l,readOnly:i,readOnlyMessage:r,searchQuery:d,addMemberDialogOpen:h,onAddMemberDialogOpenChange:c}=t,g=i===void 0?!1:i,f=r===void 0?"Owner membership cannot be changed":r,a=$.useDeferredValue(d),{data:x}=nt();let o,m,N;if(e[0]!==x?.data?.members||e[1]!==a||e[2]!==n||e[3]!==l||e[4]!==g||e[5]!==f||e[6]!==d){const v=x?.data?.members??[];let _;e[10]!==n?(_=I=>n.includes(I.id),e[10]=n,e[11]=_):_=e[11];const O=v.filter(_);let p;e[12]!==a?(p=I=>{const j=a.toLowerCase();return I.user?.name?.toLowerCase().includes(j)||I.user?.email?.toLowerCase().includes(j)},e[12]=a,e[13]=p):p=e[13];const R=O.filter(p);N="flex flex-col h-full",o="flex-1 overflow-auto",m=O.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h3",{className:"text-base font-medium mb-1",children:"No members"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Add members to grant them the configured permissions."})]})}):R.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("p",{className:"text-sm text-muted-foreground",children:['No members match "',d,'"']})}):s.jsx("div",{className:"p-4 space-y-2",children:R.map(I=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(lt,{url:I.user?.image??void 0,fallback:ot(I.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:I.user?.name||"Unknown"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:I.user?.email})]}),g?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:s.jsx(ne,{variant:"ghost",size:"sm",disabled:!0,children:s.jsx(ze,{size:16})})})}),s.jsx(Ee,{children:s.jsx("p",{children:f})})]})}):s.jsx(ne,{variant:"ghost",size:"sm",onClick:()=>l(n.filter(j=>j!==I.id)),children:s.jsx(ze,{size:16})})]},I.id))}),e[0]=x?.data?.members,e[1]=a,e[2]=n,e[3]=l,e[4]=g,e[5]=f,e[6]=d,e[7]=o,e[8]=m,e[9]=N}else o=e[7],m=e[8],N=e[9];let E;e[14]!==o||e[15]!==m?(E=s.jsx("div",{className:o,children:m}),e[14]=o,e[15]=m,e[16]=E):E=e[16];let T;e[17]!==n||e[18]!==l?(T=v=>l([...n,...v]),e[17]=n,e[18]=l,e[19]=T):T=e[19];let S;e[20]!==h||e[21]!==n||e[22]!==c||e[23]!==T?(S=s.jsx(bs,{open:h,onOpenChange:c,selectedMemberIds:n,onAddMembers:T}),e[20]=h,e[21]=n,e[22]=c,e[23]=T,e[24]=S):S=e[24];let C;return e[25]!==N||e[26]!==E||e[27]!==S?(C=s.jsxs("div",{className:N,children:[E,S]}),e[25]=N,e[26]=E,e[27]=S,e[28]=C):C=e[28],C}function Es(t){const e=q.c(3);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(fe,{size:24,className:"animate-spin text-muted-foreground"})}),e[0]=n):n=e[0];let l;return e[1]!==t?(l=s.jsx($.Suspense,{fallback:n,children:s.jsx(Ts,{...t})}),e[1]=t,e[2]=l):l=e[2],l}const _s={owner:[],admin:[],user:[]};function Is(t,e,n,l){const i=t==="owner"||t==="admin";return{role:{id:n?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:i,staticPermissions:_s[t],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:e.filter(r=>r.role===t).map(r=>r.id)}}function Ns(t,e,n){const l=t.permission||{},i=l.self||[],r=i.includes("*"),d=r?[]:i.filter(a=>a!=="*"),h={};for(const[a,x]of Object.entries(l))if(!(a==="self"||a==="models"))if(a==="*")for(const o of n)h[o.id]=x.includes("*")?o.tools?.map(m=>m.name)??[]:x;else{const o=n.find(m=>m.id===a);o&&(h[a]=x.includes("*")?o.tools?.map(m=>m.name)??[]:x)}const c=l.models||[],g=c.length===0||c.includes("*:*"),f={};if(!g)for(const a of c){const x=a.indexOf(":");if(x===-1)continue;const o=a.slice(0,x),m=a.slice(x+1);f[o]||(f[o]=[]),f[o].push(m)}return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:r,staticPermissions:d,toolSet:h,allowAllModels:g,modelSet:f,memberIds:e.filter(a=>a.role===t.role).map(a=>a.id)}}function Ss(t,e){const n={};t.allowAllStaticPermissions?n.self=["*"]:t.staticPermissions.length>0&&(n.self=t.staticPermissions);for(const[l,i]of Object.entries(t.toolSet))if(i.length>0){const d=e.find(h=>h.id===l)?.tools?.map(h=>h.name)??[];n[l]=d.length>0&&d.every(h=>i.includes(h))?["*"]:i}if(t.allowAllModels)n.models=["*:*"];else{const l=[];for(const[i,r]of Object.entries(t.modelSet))for(const d of r)l.push(`${i}:${d}`);l.length>0&&(n.models=l)}return n}function Cs(t,e,n){return t.kind==="builtin"?Is(t.role,e,void 0):t.kind==="custom"?Ns(t.role,e,n):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:[]}}function As(t){const e=q.c(6),{readOnly:n,readOnlyMessage:l,onOpen:i}=t,r=l===void 0?"Owner membership cannot be changed":l;if(n){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ne,{variant:"outline",size:"sm",disabled:!0,children:[s.jsx(Ae,{size:16}),"Add Member"]})})}),e[0]=c):c=e[0];let g;return e[1]!==r?(g=s.jsx(pe,{children:s.jsxs(be,{children:[c,s.jsx(Ee,{children:s.jsx("p",{children:r})})]})}),e[1]=r,e[2]=g):g=e[2],g}let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ae,{size:16}),e[3]=d):d=e[3];let h;return e[4]!==i?(h=s.jsxs(ne,{variant:"outline",size:"sm",onClick:i,children:[d,"Add Member"]}),e[4]=i,e[5]=h):h=e[5],h}function Os(t){const e=q.c(14),{locator:n}=Ne(),l=je(),i=yt();let r;e[0]!==n?(r=re.members(n),e[0]=n,e[1]=r):r=e[1];let d;e[2]!==l?(d=()=>l.organization.listMembers(),e[2]=l,e[3]=d):d=e[3];let h;e[4]!==r||e[5]!==d?(h={queryKey:r,queryFn:d},e[4]=r,e[5]=d,e[6]=h):h=e[6];const{data:c,isPending:g}=Oe(h);if(g||!i){let o;return e[7]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(fe,{size:32,className:"animate-spin text-muted-foreground"})})}),e[7]=o):o=e[7],o}let f;e[8]!==c?.data?.members?(f=c?.data?.members??[],e[8]=c?.data?.members,e[9]=f):f=e[9];const a=f;let x;return e[10]!==i||e[11]!==a||e[12]!==t?(x=s.jsx(Rs,{...t,members:a,connections:i}),e[10]=i,e[11]=a,e[12]=t,e[13]=x):x=e[13],x}function Rs({target:t,onBack:e,onSaved:n,members:l,connections:i}){const{locator:r}=Ne(),d=je(),h=$e(),c=t.kind==="builtin",g=t.kind==="builtin"&&t.role==="owner",f=t.kind==="new",[a,x]=$.useState(c?"org":"mcp"),o=mt({resolver:ut(Zt),defaultValues:Cs(t,l,i)}),m=o.formState.isValid,N=o.formState.isDirty,E=Fe({mutationFn:async u=>{const w=Ss(u,i),A=u.role.slug||u.role.label.toLowerCase().replace(/\s+/g,"-"),k=(u.role.slug==="owner"||u.role.slug==="admin"||u.role.slug==="user")&&!u.role.id,G=async(U,B)=>{const M=l.filter(L=>L.role===(B??U)).map(L=>L.id),z=u.memberIds.filter(L=>!M.includes(L)),y=M.filter(L=>!u.memberIds.includes(L));for(const L of z){const Y=await d.organization.updateMemberRole({memberId:L,role:[U]});if(Y?.error)throw new Error(Y.error.message??"Something went wrong")}for(const L of y){const Y=await d.organization.updateMemberRole({memberId:L,role:["user"]});if(Y?.error)throw new Error(Y.error.message??"Something went wrong")}};if(k)return await G(u.role.slug),u;if(u.role.id){const U=u.role.label.toLowerCase().replace(/\s+/g,"-"),B=u.role.slug,M=U!==B,z=await d.organization.updateRole({roleId:u.role.id,data:{permission:w,...M?{roleName:U}:{}}});if(z?.error)throw new Error(z.error.message??"Something went wrong");return await G(M?U:B,M?B:void 0),M?{...u,role:{...u.role,slug:U}}:u}else{const U=await d.organization.createRole({role:A,permission:w});if(U?.error)throw new Error(U.error.message??"Something went wrong");for(const B of u.memberIds){const M=await d.organization.updateMemberRole({memberId:B,role:[A]});if(M?.error)throw new Error(M.error.message)}return{...u,role:{...u.role,id:U.data?.roleData?.id,slug:A}}}},onSuccess:(u,w)=>{h.invalidateQueries({queryKey:re.members(r)}),h.invalidateQueries({queryKey:re.organizationRoles(r)});const A=!w.role.id&&!w.role.slug,k=w.role.slug==="owner"&&!w.role.id;Re(k?"role_members_updated":A?"role_created":"role_updated",{role_slug:w.role.slug??null}),he.success(k?"Members updated successfully!":A?"Role created successfully!":"Role updated successfully!"),o.reset(u),n(u.role.id)},onError:u=>{he.error(u instanceof Error?u.message:"Failed to save role")}}),T=o.handleSubmit(u=>{if(!u.role.label.trim()){he.error("Role name is required"),o.setFocus("role.label");return}E.mutate(u)}),S=!g,C=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",v=[...g?[]:[{id:"mcp",label:"MCP Permissions"}],{id:"org",label:"Organization Permissions"},{id:"models",label:"Models"},{id:"members",label:"Members"}],[_,O]=$.useState(""),[p,R]=$.useState(!1),I=u=>{x(u),O("")},j={mcp:"Search MCP servers...",org:"Search permissions...",models:"Search models...",members:"Search members..."};return s.jsx(te,{children:s.jsxs(te.Content,{className:K("flex flex-col",a!=="org"&&"overflow-hidden"),children:[s.jsx("div",{className:"shrink-0 mx-auto w-full max-w-[1200px] px-4 md:px-10 pt-8 md:pt-12 pb-4",children:s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(te.Title,{actions:S&&s.jsxs(s.Fragment,{children:[s.jsx(ne,{variant:"outline",size:"sm",onClick:e,disabled:E.isPending,children:"Cancel"}),s.jsx(ne,{size:"sm",onClick:T,disabled:E.isPending||!m||!N,children:E.isPending?"Saving...":f?"Create Role":"Save Changes"})]}),children:s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:K("size-2.5 rounded-full shrink-0",t.kind==="builtin"?Ht(t.role):qt(o.watch("role.label")))}),g&&s.jsx(Ke,{size:16,className:"text-muted-foreground shrink-0"}),f||t.kind==="custom"?s.jsx("input",{...o.register("role.label"),placeholder:"Role name",className:"leading-tight text-foreground bg-transparent border-none outline-none px-1 -mx-1 rounded hover:bg-input/25 focus:bg-input/25 transition-colors w-64 placeholder:text-muted-foreground/50",autoFocus:f}):s.jsx("span",{className:"truncate",children:C})]})}),s.jsx("div",{className:"flex items-center gap-2",children:v.map(u=>s.jsx("button",{type:"button",onClick:()=>I(u.id),className:K("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex items-center",a===u.id?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:u.label},u.id))}),s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(ve,{value:_,onChange:O,placeholder:j[a]??"Search...",className:"w-full md:w-[375px]"}),a==="members"&&s.jsx(As,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>R(!0)})]})]})}),s.jsx("div",{className:K("mx-auto w-full max-w-[1200px] px-4 md:px-10 pb-6",a!=="org"&&"flex-1 min-h-0"),children:s.jsxs("div",{className:K(a!=="org"&&"h-full overflow-hidden",a!=="models"&&a!=="org"&&"border border-border rounded-xl bg-card"),children:[a==="mcp"&&!g&&s.jsx(Kt,{toolSet:o.watch("toolSet"),onToolSetChange:u=>o.setValue("toolSet",u,{shouldDirty:!0}),searchQuery:_}),a==="org"&&s.jsx(Xt,{allowAllStaticPermissions:o.watch("allowAllStaticPermissions"),staticPermissions:o.watch("staticPermissions"),onAllowAllChange:u=>o.setValue("allowAllStaticPermissions",u,{shouldDirty:!0}),onPermissionsChange:u=>o.setValue("staticPermissions",u,{shouldDirty:!0}),readOnly:g,searchQuery:_}),a==="models"&&s.jsx(gs,{allowAllModels:o.watch("allowAllModels"),modelSet:o.watch("modelSet"),onAllowAllChange:u=>o.setValue("allowAllModels",u,{shouldDirty:!0}),onModelSetChange:u=>o.setValue("modelSet",u,{shouldDirty:!0}),readOnly:g,searchQuery:_}),a==="members"&&s.jsx(Es,{memberIds:o.watch("memberIds"),onMemberIdsChange:u=>o.setValue("memberIds",u,{shouldDirty:!0}),readOnly:t.kind==="builtin"&&(t.role==="owner"||t.role==="user"),readOnlyMessage:t.kind==="builtin"&&t.role==="user"?"User is the default role — members can't be removed from it; assign another role to change their access":"Owner membership cannot be changed",searchQuery:_,addMemberDialogOpen:p,onAddMemberDialogOpenChange:R})]})})]})})}function js(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function vs(t){const e=q.c(6),{area:n,children:l}=t,{isPrivileged:i,loading:r,error:d}=Dt();let h;return e[0]!==n||e[1]!==l||e[2]!==d||e[3]!==i||e[4]!==r?(h=s.jsx(kt,{granted:i,loading:r,error:d,area:n,children:l}),e[0]=n,e[1]=l,e[2]=d,e[3]=i,e[4]=r,e[5]=h):h=e[5],h}const ys=[{role:"owner",label:"Owner",color:"bg-red-500"},{role:"admin",label:"Admin",color:"bg-blue-500"},{role:"user",label:"User",color:"bg-green-500"}],Ce=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"];function ws(t){if(!t)return"bg-neutral-400";let e=0;for(let l=0;l<t.length;l++){const i=t.charCodeAt(l);e=(e<<5)-e+i,e=e&e}const n=Math.abs(e)%Ce.length;return Ce[n]??Ce[0]}const Ms={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function Ls(t,e){return e?Ms[t]??"bg-neutral-400":ws(t)}function Ps(){const t=q.c(77),[e,n]=$.useState(""),[l,i]=$.useState(null),r=gt();let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d={strict:!1},t[0]=d):d=t[0];const{role:h}=xt(d),{locator:c}=Ne(),g=je(),f=$e(),{customRoles:a,refetch:x}=pt();let o;t[1]!==r?(o=P=>r({to:".",search:V=>({...V,role:P})}),t[1]=r,t[2]=o):o=t[2];const m=o;let N;e:{if(!h){N=null;break e}if(h==="new"){N={kind:"new"};break e}if(h.startsWith("builtin-")){N={kind:"builtin",role:h.slice(8)};break e}let P;t[3]!==h?(P=ae=>ae.id===h,t[3]=h,t[4]=P):P=t[4];const V=a.find(P);N=V?{kind:"custom",role:V}:null}const E=N;let T;t[5]!==c?(T=re.members(c),t[5]=c,t[6]=T):T=t[6];let S;t[7]!==g?(S=()=>g.organization.listMembers(),t[7]=g,t[8]=S):S=t[8];let C;t[9]!==T||t[10]!==S?(C={queryKey:T,queryFn:S},t[9]=T,t[10]=S,t[11]=C):C=t[11];const{data:v}=Oe(C);let _;t[12]!==v?.data?.members?(_=v?.data?.members??[],t[12]=v?.data?.members,t[13]=_):_=t[13];const O=_;let p;t[14]!==O?(p=P=>O.filter(V=>V.role===P).length,t[14]=O,t[15]=p):p=t[15];const R=p;let I;if(t[16]!==a||t[17]!==R||t[18]!==e){let P;t[20]!==R?(P=ce=>({kind:"builtin",role:{...ce,memberCount:R(ce.role)}}),t[20]=R,t[21]=P):P=t[21];const V=ys.map(P);let ae;t[22]!==R?(ae=ce=>({kind:"custom",role:{...ce,memberCount:R(ce.role)}}),t[22]=R,t[23]=ae):ae=t[23];const at=a.map(ae);if(I=[...V,...at],e){const ce=e.toLowerCase();I=I.filter(ct=>ct.role.label.toLowerCase().includes(ce))}t[16]=a,t[17]=R,t[18]=e,t[19]=I}else I=t[19];let j;t[24]!==g?(j=async P=>{const V=await g.organization.deleteRole({roleId:P});if(V?.error)throw new Error(V.error.message);return V?.data},t[24]=g,t[25]=j):j=t[25];const u=Fe({mutationFn:j,onSuccess:(P,V)=>{Re("role_deleted",{role_id:V}),f.invalidateQueries({queryKey:re.members(c)}),f.invalidateQueries({queryKey:re.organizationRoles(c)}),he.success("Role deleted successfully!"),x(),E?.kind==="custom"&&E.role.id===V&&m(void 0)},onError:zs});let w,A,k,G;t[26]===Symbol.for("react.memo_cache_sentinel")?(G={id:"role",header:"Role",render:Vs,cellClassName:"flex-1 min-w-0",sortable:!0},w={id:"type",header:"Type",render:Bs,cellClassName:"w-28 shrink-0"},A={id:"permissions",header:"Permissions",render:Us,cellClassName:"flex-1 min-w-0"},k={id:"members",header:"Members",render:Gs,cellClassName:"w-24 shrink-0"},t[26]=w,t[27]=A,t[28]=k,t[29]=G):(w=t[26],A=t[27],k=t[28],G=t[29]);let U;t[30]===Symbol.for("react.memo_cache_sentinel")?(U=[G,w,A,k,{id:"actions",header:"",render:P=>P.kind==="builtin"?null:s.jsxs(Tt,{children:[s.jsx(Et,{asChild:!0,children:s.jsx(ne,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:ks,children:s.jsx(Nt,{size:16})})}),s.jsx(_t,{align:"end",onClick:Ds,children:s.jsxs(It,{variant:"destructive",onClick:()=>{const V=P.role;V.id&&i({id:V.id,label:V.label})},children:[s.jsx(St,{size:16}),"Delete"]})})]}),cellClassName:"w-12 shrink-0"}],t[30]=U):U=t[30];const B=U;let M;t[31]!==m?(M=P=>{if(P.kind==="builtin")m(`builtin-${P.role.role}`);else{const V=P.role;m(V.id)}},t[31]=m,t[32]=M):M=t[32];const z=M;if(E){let P;t[33]!==m?(P=()=>m(void 0),t[33]=m,t[34]=P):P=t[34];let V;return t[35]!==x||t[36]!==m?(V=()=>{x(),m(void 0)},t[35]=x,t[36]=m,t[37]=V):V=t[37],s.jsx(Os,{target:E,onBack:P,onSaved:V},js(E))}let y;t[38]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(te.Title,{children:"Roles"}),t[38]=y):y=t[38];let L;t[39]===Symbol.for("react.memo_cache_sentinel")?(L=P=>{P.key==="Escape"&&(n(""),P.target.blur())},t[39]=L):L=t[39];let Y;t[40]!==e?(Y=s.jsx(ve,{value:e,onChange:n,placeholder:"Search roles...",className:"w-full md:w-[375px]",onKeyDown:L}),t[40]=e,t[41]=Y):Y=t[41];let F;t[42]!==m?(F=()=>m("new"),t[42]=m,t[43]=F):F=t[43];let X;t[44]===Symbol.for("react.memo_cache_sentinel")?(X=s.jsx(Ae,{size:16}),t[44]=X):X=t[44];let J;t[45]!==F?(J=s.jsxs(ne,{onClick:F,children:[X,"Create Role"]}),t[45]=F,t[46]=J):J=t[46];let le;t[47]!==Y||t[48]!==J?(le=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[Y,J]}),t[47]=Y,t[48]=J,t[49]=le):le=t[49];let oe;t[50]!==e?(oe=e?s.jsx(Ge,{title:"No roles found",description:`No roles match "${e}"`}):s.jsx(Ge,{title:"No roles",description:"Create a role to get started."}),t[50]=e,t[51]=oe):oe=t[51];let ie;t[52]!==I||t[53]!==B||t[54]!==z||t[55]!==oe?(ie=s.jsx(bt,{columns:B,data:I,isLoading:!1,onRowClick:z,emptyState:oe}),t[52]=I,t[53]=B,t[54]=z,t[55]=oe,t[56]=ie):ie=t[56];let b;t[57]!==le||t[58]!==ie?(b=s.jsx(te.Content,{children:s.jsx(te.Body,{children:s.jsxs("div",{className:"flex flex-col gap-6",children:[y,le,ie]})})}),t[57]=le,t[58]=ie,t[59]=b):b=t[59];const D=l!==null;let Q;t[60]===Symbol.for("react.memo_cache_sentinel")?(Q=P=>!P&&i(null),t[60]=Q):Q=t[60];let H;t[61]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Ze,{children:"Delete Role"}),t[61]=H):H=t[61];const W=l?.label;let Z;t[62]!==W?(Z=s.jsxs(He,{children:[H,s.jsxs(Xe,{children:['Are you sure you want to delete the "',W,'" role? This action cannot be undone.']})]}),t[62]=W,t[63]=Z):Z=t[63];let ee;t[64]===Symbol.for("react.memo_cache_sentinel")?(ee=s.jsx(Je,{children:"Cancel"}),t[64]=ee):ee=t[64];let de;t[65]!==u||t[66]!==l?(de=s.jsxs(We,{children:[ee,s.jsx(et,{onClick:()=>{l?.id&&u.mutate(l.id),i(null)},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[65]=u,t[66]=l,t[67]=de):de=t[67];let me;t[68]!==Z||t[69]!==de?(me=s.jsxs(qe,{children:[Z,de]}),t[68]=Z,t[69]=de,t[70]=me):me=t[70];let ue;t[71]!==D||t[72]!==me?(ue=s.jsx(Qe,{open:D,onOpenChange:Q,children:me}),t[71]=D,t[72]=me,t[73]=ue):ue=t[73];let _e;return t[74]!==b||t[75]!==ue?(_e=s.jsxs(te,{children:[b,ue]}),t[74]=b,t[75]=ue,t[76]=_e):_e=t[76],_e}function Ds(t){return t.stopPropagation()}function ks(t){return t.stopPropagation()}function Gs(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function Us(t){if(t.kind==="builtin")return t.role.role==="owner"||t.role.role==="admin"?s.jsx("span",{className:"text-sm text-muted-foreground",children:"Full access"}):s.jsx("span",{className:"text-sm text-muted-foreground",children:"Basic access"});const e=t.role,n=[];return 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":""}`),s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:n.length>0?n.join(", "):"No permissions"})}function Bs(t){return t.kind==="builtin"?s.jsx(ge,{variant:"secondary",className:"text-xs",children:"Built-in"}):s.jsx(ge,{variant:"outline",className:"text-xs",children:"Custom"})}function Vs(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:K("size-2.5 rounded-full shrink-0",Ls(t.role.role,t.kind==="builtin"))}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.role.label}),t.kind==="builtin"&&s.jsx(Ke,{size:12,className:"text-muted-foreground shrink-0"})]})}function zs(t,e){Re("role_delete_failed",{role_id:e,error:t instanceof Error?t.message:String(t)}),he.error(t instanceof Error?t.message:"Failed to delete role")}function Ys(){const t=q.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(te,{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 roles"})})}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ht,{fallback:e,children:s.jsx($.Suspense,{fallback:s.jsx(te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(fe,{size:32,className:"animate-spin text-muted-foreground"})})}),children:s.jsx(Ps,{})})}),t[1]=n):n=t[1],n}function ul(){const t=q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(vs,{area:"roles",children:s.jsx(Ys,{})}),t[0]=e):e=t[0],e}export{ul as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{y as c}from"./preview-dialog-BikVelEl.js";function t(r){return(e,a)=>{c(e),r(e,a)}}export{t as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as T,j as t,r as Q,B as je,i as Se}from"./index-Cvc1xn-4.js";import{i as be}from"./ChevronRight-tj4xbWmM.js";import{L as fe}from"./agent-icon-C4199b3i.js";import{S as ue}from"./scroll-area-BvvyxqKR.js";import{r as Ne,c as ke,u as _e,a as we,i as Ce,d as Te,f as Fe,P as Re,S as Ee}from"./page-seo-form-Io0ovKiN.js";import{m as ze}from"./index-B8LUbsU-.js";import{a as ge}from"./Tool01-AyuVwnGv.js";import{s as xe}from"./schema-form-C1MMeEGC.js";import"./AlertCircle-BZqAQZBb.js";import"./SwitchHorizontal01-BVKPeJMU.js";import"./Settings02-kQ4zmp5P.js";import"./XCircle-DJDxYBys.js";import"./ArrowRight-6qgvW498.js";import"./ArrowUpRight-CUPFfker.js";import"./ZapSquare-ok_KEP9c.js";import"./Users03-C6siA5mE.js";import"./CheckCircle-DOPRdShL.js";import"./ChevronUp-DhHPsDAS.js";import"./ChevronDown-BhLFFAly.js";import"./ChevronLeft-veOSKT91.js";import"./DotsVertical-kcsdrim_.js";import"./Stars02-Bo19XD__.js";import"./Eye-BfNssVzk.js";import"./ZoomOut-cYq1CP_X.js";import"./Globe01-CJXHyXNe.js";import"./FilterLines-D2obCQW_.js";import"./Star01-CFj5T2Jl.js";import"./Globe04-PQ0ejRYI.js";import"./HardDrive-DEG8fjxw.js";import"./Key01-xj4UQriu.js";import"./LayoutLeft-C9-KQh8d.js";import"./LinkExternal01-DtLsAcMy.js";import"./Monitor01-CvNVisni.js";import"./Sun-CcSW7Ngf.js";import"./Palette-yNiXmyHD.js";import"./Play-C0DhAO4u.js";import"./Plus-BRQannbC.js";import"./SearchMd-CttVjXUQ.js";import"./Shield01-BZZVugf_.js";import"./Stars01-C4FyHP_L.js";import"./Trash01-BZXmKzie.js";import"./Upload01-D4ez0Mu3.js";import"./User01-Dz33ODze.js";import"./Users01-aBataJ8N.js";import"./XClose-BcOWKb5Q.js";import"./X-DC2HG4lX.js";import"./Zap-OOZsYg72.js";import"./use-clock-tick-CqrkSCF6.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DM9BeeKg.js";import"./tooltip-D_DwQRbZ.js";import"./file-type-icon-GfohFxwW.js";import"./dialog-DDL08EK8.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-zC94Gae_.js";import"./use-mcp-client-DV4dF4m3.js";import"./auth-B9bEkbYh.js";import"./chat-context-GA_fpERN.js";import"./hooks-BI65IXS7.js";import"./decopilot-sse-pool-CZG5pZEa.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-WmAC_qSm.js";import"./use-collections-dA9ibOHr.js";import"./use-ai-providers-0DJv4c0H.js";import"./studio-tools-D8q7MEyE.js";import"./use-organization-settings-C6jq364X.js";import"./shell-layout-DIXTRmN4.js";import"./avatar-CKJB3djy.js";import"./required-auth-layout-BcilPdVi.js";import"./use-org-sso-Cygr8MWL.js";import"./sheet-XVV7S5b8.js";import"./integration-icon-gcYOl2yq.js";import"./use-navigate-to-agent-Cs1C-DBQ.js";import"./use-connection-C39BUY8e.js";import"./use-mcp-prompts-CspfQ-gW.js";import"./form-B9v_4_lt.js";import"./label-hfmZhqH1.js";import"./input-klr_kUC2.js";import"./select-DwFQDgcX.js";import"./switch-skMKJ2GI.js";import"./index-BI3_fNOm.js";import"./drawer-CTdCEiZw.js";import"./collection-search-DC-7DcrR.js";import"./tabs-C0Vh3iPJ.js";import"./toggle-group-6FcrOIsd.js";import"./use-deco-credits-Bax6GRog.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DPkWnrYu.js";import"./use-registry-connections-yBLIjpTM.js";import"./useInfiniteQuery-Bwr_uznn.js";import"./use-infinite-scroll-DM0o0Ibp.js";import"./extract-connection-data-D4y9_vmi.js";import"./card-D7O9yDM9.js";import"./collection-tabs-CRIZ0CX_.js";import"./badge-DUlP8HvP.js";import"./textarea-2KmLad1y.js";import"./connection-form-helpers-B_oQdAph.js";import"./useSuspenseInfiniteQuery-D48NS_O0.js";import"./mcp-oauth-C5QgI6bG.js";import"./connect-desktop-dialog-uLnBe_nQ.js";import"./decopilot-BsjqLgTH.js";import"./checkbox-DOg3LODJ.js";import"./skeleton-C-tuNjEZ.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-rOWH4a9G.js";import"./popover-BvZF2bBr.js";import"./command-BzTLypzr.js";import"./index-DVxNbd_g.js";import"./dropdown-menu-CgCZ8Mte.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-Bvu0fELl.js";import"./empty-state-BDXQKaPV.js";import"./toolbar-DE_I2DnI.js";import"./preview-dialog-BikVelEl.js";import"./index-B2quJDhU.js";import"./use-mcp-tools-DnBnaQLn.js";import"./use-capability-A3j7T78I.js";import"./shell-route-loading-B5-wAKUU.js";import"./index-Br4BSsfF.js";import"./alert-dialog-BUQoXI1j.js";import"./use-debounced-autosave-BzGp2qae.js";import"./index-1J83wgnT.js";import"./sidebar-Djn7svMG.js";import"./search-input-B-LDSHMx.js";import"./github-repo-picker-Qwduwaex.js";import"./use-secrets-BtkNg5h6.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-D7_rFTiD.js";import"./select-model-BWl1FGCY.js";import"./use-automations-CsLMaKM0.js";import"./monaco-editor-YJUBj_D_.js";import"./automation-runs-y9iHLMe2.js";import"./table-DsOuzcNK.js";import"./use-members-CtcSheMR.js";import"./use-org-auth-client-lV24PS0n.js";import"./task-status-DRz_b988.js";import"./automation-list-row-DMPjogBl.js";import"./calendar-DDwlGULz.js";import"./sortable.esm-S2exVkMt.js";import"./image-field-CEHk9cpM.js";import"./use-file-configs-CvRusjpd.js";function U(n){return typeof n=="string"&&n.trim()?n:void 0}function he(n,e){if(n){if(e)try{const i=new URL(n,e).href;return xe(i)}catch{return}return xe(n)}}function Pe(n){if(!n)return{};const e=U(n.title),i=U(n.titleTemplate);return{title:e&&i?.includes("%s")?i.replace(/%s/g,e):e,description:U(n.description),image:U(n.image),favicon:U(n.favicon)}}function Oe(n){if(!n)return"example.com";try{return new URL(n).host}catch{return"example.com"}}const Z="Your page title",ee="Your meta description will appear here.",Le=[{id:"google",label:"Google",color:"#4285F4",layout:"search"},{id:"facebook",label:"Facebook",color:"#1877F2",layout:"card"},{id:"twitter",label:"X (Twitter)",color:"#0f1419",layout:"card"},{id:"linkedin",label:"LinkedIn",color:"#0A66C2",layout:"card"},{id:"whatsapp",label:"WhatsApp",color:"#25D366",layout:"chat"},{id:"telegram",label:"Telegram",color:"#229ED9",layout:"chat"},{id:"slack",label:"Slack",color:"#611f69",layout:"attachment"},{id:"discord",label:"Discord",color:"#5865F2",layout:"attachment"}];function pe(n){const e=T.c(10),{src:i,className:r,iconSize:h}=n,a=h===void 0?20:h;if(i){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={objectFit:"cover"},e[0]=m):m=e[0];let p;return e[1]!==r||e[2]!==i?(p=t.jsx("img",{src:i,alt:"",referrerPolicy:"no-referrer",className:r,style:m}),e[1]=r,e[2]=i,e[3]=p):p=e[3],p}let s;e[4]===Symbol.for("react.memo_cache_sentinel")?(s={display:"flex",alignItems:"center",justifyContent:"center",background:"#e5e7eb",color:"#9ca3af"},e[4]=s):s=e[4];let o;e[5]!==a?(o=t.jsx(ge,{size:a}),e[5]=a,e[6]=o):o=e[6];let l;return e[7]!==r||e[8]!==o?(l=t.jsx("div",{className:r,style:s,children:o}),e[7]=r,e[8]=o,e[9]=l):l=e[9],l}function $e(n){const e=T.c(27),{seo:i,host:r,path:h}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={background:"#fff",border:"1px solid #dadce0"},e[0]=a):a=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s={background:"#f1f3f4"},e[1]=s):s=e[1];let o;e[2]!==i.favicon?(o=t.jsx("div",{className:"flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-full",style:s,children:i.favicon?t.jsx("img",{src:i.favicon,alt:"",className:"size-full object-cover"}):t.jsx(ge,{size:12,color:"#9aa0a6"})}),e[2]=i.favicon,e[3]=o):o=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l={color:"#202124"},e[4]=l):l=e[4];let m;e[5]!==r?(m=t.jsx("div",{className:"truncate text-[13px] leading-tight",style:l,children:r}),e[5]=r,e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#4d5156"},e[7]=p):p=e[7];let d;e[8]!==r||e[9]!==h?(d=t.jsxs("div",{className:"truncate text-[12px] leading-tight",style:p,children:[r,h]}),e[8]=r,e[9]=h,e[10]=d):d=e[10];let c;e[11]!==m||e[12]!==d?(c=t.jsxs("div",{className:"min-w-0",children:[m,d]}),e[11]=m,e[12]=d,e[13]=c):c=e[13];let g;e[14]!==o||e[15]!==c?(g=t.jsxs("div",{className:"flex items-center gap-2",children:[o,c]}),e[14]=o,e[15]=c,e[16]=g):g=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f={color:"#1a0dab"},e[17]=f):f=e[17];const x=i.title??Z;let u;e[18]!==x?(u=t.jsx("div",{className:"mt-1.5 truncate text-[18px] leading-snug",style:f,children:x}),e[18]=x,e[19]=u):u=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j={color:"#4d5156"},e[20]=j):j=e[20];const v=i.description??ee;let y;e[21]!==v?(y=t.jsx("div",{className:"mt-0.5 line-clamp-2 text-[13px] leading-snug",style:j,children:v}),e[21]=v,e[22]=y):y=e[22];let S;return e[23]!==u||e[24]!==y||e[25]!==g?(S=t.jsxs("div",{className:"rounded-lg p-3 text-left",style:a,children:[g,u,y]}),e[23]=u,e[24]=y,e[25]=g,e[26]=S):S=e[26],S}function De(n){const e=T.c(20),{seo:i,host:r}=n;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={background:"#fff",border:"1px solid #e2e8f0"},e[0]=h):h=e[0];let a;e[1]!==i.image?(a=t.jsx(pe,{src:i.image,className:"h-40 w-full"}),e[1]=i.image,e[2]=a):a=e[2];let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s={borderTop:"1px solid #e2e8f0"},e[3]=s):s=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o={color:"#8a9099"},e[4]=o):o=e[4];let l;e[5]!==r?(l=t.jsx("div",{className:"truncate text-[11px]",style:o,children:r}),e[5]=r,e[6]=l):l=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m={color:"#1c2024"},e[7]=m):m=e[7];const p=i.title??Z;let d;e[8]!==p?(d=t.jsx("div",{className:"line-clamp-1 text-[14px] font-semibold",style:m,children:p}),e[8]=p,e[9]=d):d=e[9];let c;e[10]===Symbol.for("react.memo_cache_sentinel")?(c={color:"#60666c"},e[10]=c):c=e[10];const g=i.description??ee;let f;e[11]!==g?(f=t.jsx("div",{className:"line-clamp-2 text-[12px]",style:c,children:g}),e[11]=g,e[12]=f):f=e[12];let x;e[13]!==f||e[14]!==l||e[15]!==d?(x=t.jsxs("div",{className:"px-3 py-2",style:s,children:[l,d,f]}),e[13]=f,e[14]=l,e[15]=d,e[16]=x):x=e[16];let u;return e[17]!==x||e[18]!==a?(u=t.jsxs("div",{className:"overflow-hidden rounded-lg text-left",style:h,children:[a,x]}),e[17]=x,e[18]=a,e[19]=u):u=e[19],u}function Ie(n){const e=T.c(23),{seo:i,host:r,accent:h}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={background:"#f0f2f5"},e[0]=a):a=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("p",{className:"px-1 pb-1.5 text-[12px]",style:{color:"#3b4045"},children:"Here's a post you might write with the link of your website:"}),e[1]=s):s=e[1];const o=`3px solid ${h}`;let l;e[2]!==o?(l={background:"#fff",borderLeft:o},e[2]=o,e[3]=l):l=e[3];let m;e[4]!==i.image?(m=t.jsx(pe,{src:i.image,className:"h-28 w-full",iconSize:18}),e[4]=i.image,e[5]=m):m=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#1c2024"},e[6]=p):p=e[6];const d=i.title??Z;let c;e[7]!==d?(c=t.jsx("div",{className:"line-clamp-1 text-[12px] font-semibold",style:p,children:d}),e[7]=d,e[8]=c):c=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g={color:"#60666c"},e[9]=g):g=e[9];const f=i.description??ee;let x;e[10]!==f?(x=t.jsx("div",{className:"line-clamp-2 text-[11px]",style:g,children:f}),e[10]=f,e[11]=x):x=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u={color:"#8a9099"},e[12]=u):u=e[12];let j;e[13]!==r?(j=t.jsx("div",{className:"mt-0.5 text-[10px]",style:u,children:r}),e[13]=r,e[14]=j):j=e[14];let v;e[15]!==x||e[16]!==j||e[17]!==c?(v=t.jsxs("div",{className:"px-2.5 py-1.5",children:[c,x,j]}),e[15]=x,e[16]=j,e[17]=c,e[18]=v):v=e[18];let y;return e[19]!==v||e[20]!==l||e[21]!==m?(y=t.jsxs("div",{className:"rounded-lg p-2 text-left",style:a,children:[s,t.jsxs("div",{className:"overflow-hidden rounded-md",style:l,children:[m,v]})]}),e[19]=v,e[20]=l,e[21]=m,e[22]=y):y=e[22],y}function Ae(n){const e=T.c(33),{seo:i,host:r,accent:h,dark:a}=n,s=a?"#2b2d31":"#fff",o=a?"#00a8fc":"#1264a3",l=a?"#dbdee1":"#3b4045",m=a?"#949ba4":"#8a9099",p=a?"none":"1px solid #e2e8f0";let d;e[0]!==s||e[1]!==p?(d={background:s,border:p},e[0]=s,e[1]=p,e[2]=d):d=e[2];const c=`3px solid ${h}`;let g;e[3]!==c?(g={borderLeft:c,borderRadius:2},e[3]=c,e[4]=g):g=e[4];let f;e[5]!==m?(f={color:m},e[5]=m,e[6]=f):f=e[6];let x;e[7]!==r||e[8]!==f?(x=t.jsx("div",{className:"text-[10px]",style:f,children:r}),e[7]=r,e[8]=f,e[9]=x):x=e[9];let u;e[10]!==o?(u={color:o},e[10]=o,e[11]=u):u=e[11];const j=i.title??Z;let v;e[12]!==u||e[13]!==j?(v=t.jsx("div",{className:"line-clamp-1 text-[13px] font-semibold",style:u,children:j}),e[12]=u,e[13]=j,e[14]=v):v=e[14];let y;e[15]!==l?(y={color:l},e[15]=l,e[16]=y):y=e[16];const S=i.description??ee;let _;e[17]!==y||e[18]!==S?(_=t.jsx("div",{className:"line-clamp-2 text-[12px]",style:y,children:S}),e[17]=y,e[18]=S,e[19]=_):_=e[19];let N;e[20]!==_||e[21]!==x||e[22]!==v?(N=t.jsxs("div",{className:"min-w-0 flex-1",children:[x,v,_]}),e[20]=_,e[21]=x,e[22]=v,e[23]=N):N=e[23];let b;e[24]!==i.image?(b=t.jsx(pe,{src:i.image,className:"size-14 shrink-0 rounded",iconSize:16}),e[24]=i.image,e[25]=b):b=e[25];let k;e[26]!==N||e[27]!==b||e[28]!==g?(k=t.jsxs("div",{className:"flex gap-2.5 pl-2.5",style:g,children:[N,b]}),e[26]=N,e[27]=b,e[28]=g,e[29]=k):k=e[29];let C;return e[30]!==k||e[31]!==d?(C=t.jsx("div",{className:"rounded-lg p-2.5 text-left",style:d,children:k}),e[30]=k,e[31]=d,e[32]=C):C=e[32],C}function Be(n){const e=T.c(17),{platform:i,seo:r,host:h,path:a}=n;let s;e[0]!==h||e[1]!==a||e[2]!==i.color||e[3]!==i.id||e[4]!==i.layout||e[5]!==r?(s=i.layout==="search"?t.jsx($e,{seo:r,host:h,path:a}):i.layout==="card"?t.jsx(De,{seo:r,host:h,path:a}):i.layout==="chat"?t.jsx(Ie,{seo:r,host:h,path:a,accent:i.color}):t.jsx(Ae,{seo:r,host:h,path:a,accent:i.color,dark:i.id==="discord"}),e[0]=h,e[1]=a,e[2]=i.color,e[3]=i.id,e[4]=i.layout,e[5]=r,e[6]=s):s=e[6];const o=s;let l;e[7]!==i.color?(l=t.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{background:i.color}}),e[7]=i.color,e[8]=l):l=e[8];let m;e[9]!==i.label?(m=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i.label}),e[9]=i.label,e[10]=m):m=e[10];let p;e[11]!==l||e[12]!==m?(p=t.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5",children:[l,m]}),e[11]=l,e[12]=m,e[13]=p):p=e[13];let d;return e[14]!==o||e[15]!==p?(d=t.jsxs("div",{children:[p,o]}),e[14]=o,e[15]=p,e[16]=d):d=e[16],d}function Ue(n){const e=T.c(17),{seo:i,url:r,path:h}=n,a=h===void 0?"/":h;let s,o,l;if(e[0]!==i||e[1]!==r){const u=Pe(i);s=u,o=he(u.image,r),l=he(u.favicon,r),e[0]=i,e[1]=r,e[2]=s,e[3]=o,e[4]=l}else s=e[2],o=e[3],l=e[4];let m;e[5]!==s||e[6]!==o||e[7]!==l?(m={...s,image:o,favicon:l},e[5]=s,e[6]=o,e[7]=l,e[8]=m):m=e[8];const p=m;let d;e[9]!==r?(d=Oe(r),e[9]=r,e[10]=d):d=e[10];const c=d,g=a==="/"?"":a;let f;e[11]!==g||e[12]!==c||e[13]!==p?(f=Le.map(u=>t.jsx(Be,{platform:u,seo:p,host:c,path:g},u.id)),e[11]=g,e[12]=c,e[13]=p,e[14]=f):f=e[14];let x;return e[15]!==f?(x=t.jsx("div",{className:"grid grid-cols-1 gap-4 @2xl:grid-cols-2",children:f}),e[15]=f,e[16]=x):x=e[16],x}function Ti(n){const e=T.c(63),{orgSlug:i,virtualMcpId:r,branch:h,decofile:a,meta:s,target:o,previewBaseUrl:l,onSaved:m,onEditDefaultSeo:p,onBack:d}=n,c=Ne(a,o,s),g=c?.seoData,f=o.kind==="site"?"site":o.pageKey,[x,u]=Q.useState(f),[j,v]=Q.useState(null),[y,S]=Q.useState(0),[_,N]=Q.useState(void 0);x!==f&&(u(f),v(null),N(void 0),S(Me));const{persistSeo:b,persistRawSeo:k,flush:C,isPending:te}=ke({orgSlug:i,virtualMcpId:r,branch:h,target:o,resolved:c,onSaved:m}),K=o.kind==="page",ve=K?c?.rawSeoData:void 0,B=_!==void 0?_:ve,ye=K?_e(B)??void 0:void 0,w=j??ye??g??{},F=c?we(w,c):null,z=F&&(!K||Ce(B))?ze(F,s):null;let M;e[0]!==s?(M=Te(s),e[0]=s,e[1]=M):M=e[1];const oe=M;let R,G;e[2]!==a||e[3]!==w||e[4]!==s||e[5]!==o.kind?(R=o.kind==="page"?Fe(a,s)?.seoData??{}:{},G=o.kind==="page"?Ve(R,w):w,e[2]=a,e[3]=w,e[4]=s,e[5]=o.kind,e[6]=R,e[7]=G):(R=e[6],G=e[7]);const ie=G;let V;e[8]!==b||e[9]!==c||e[10]!==v?(V=E=>{if(!c)return;const de=E;v(de),b(de)},e[8]=b,e[9]=c,e[10]=v,e[11]=V):V=e[11];const se=V;let Y;e[12]!==v?(Y=()=>v(null),e[12]=v,e[13]=Y):Y=e[13];const le=Y;let H;e[14]!==S?(H=()=>S(Ke),e[14]=S,e[15]=H):H=e[15];const re=H;let W;e[16]!==C||e[17]!==d?(W=()=>{C(),d?.()},e[16]=C,e[17]=d,e[18]=W):W=e[18];const ae=W,P=o.kind==="page"?o.path:"/";let X;e[19]!==P||e[20]!==l||e[21]!==o.kind?(X=o.kind==="page"&&l?Ge(P,l):l??null,e[19]=P,e[20]=l,e[21]=o.kind,e[22]=X):X=e[22];const ne=X,ce=o.kind==="site"?"No site-level SEO block found.":c?"SEO schema not found for this page.":"Could not load page SEO.",q=K&&c,me=o.kind==="site"&&c&&z;let O;e[23]!==ae||e[24]!==o.kind||e[25]!==o.pageName?(O=o.kind==="page"?t.jsxs("nav",{className:"flex min-w-0 items-center gap-1 text-sm",children:[t.jsx("button",{type:"button",onClick:ae,title:o.pageName,className:"min-w-0 truncate rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:o.pageName}),t.jsx(be,{className:"size-3 shrink-0 text-muted-foreground/60"}),t.jsx("span",{className:"px-1 py-0.5 font-medium text-foreground",children:"SEO"})]}):t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(fe,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("span",{className:"text-sm font-medium",children:"Default SEO"}),t.jsx("span",{className:"hidden truncate text-xs text-muted-foreground sm:inline",children:"· applied to every page unless overridden"})]}),e[23]=ae,e[24]=o.kind,e[25]=o.pageName,e[26]=O):O=e[26];let L;e[27]!==te?(L=te&&t.jsx(Se,{size:14,className:"animate-spin text-muted-foreground"}),e[27]=te,e[28]=L):L=e[28];let $;e[29]!==p||e[30]!==o.kind?($=o.kind==="page"&&p&&t.jsxs(je,{type:"button",variant:"outline",size:"sm",onClick:p,children:[t.jsx(fe,{size:14}),"Edit default SEO"]}),e[29]=p,e[30]=o.kind,e[31]=$):$=e[31];let D;e[32]!==$||e[33]!==L?(D=t.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[L,$]}),e[32]=$,e[33]=L,e[34]=D):D=e[34];let I;e[35]!==D||e[36]!==O?(I=t.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[O,D]}),e[35]=D,e[36]=O,e[37]=I):I=e[37];let A;e[38]!==F||e[39]!==re||e[40]!==le||e[41]!==oe||e[42]!==B||e[43]!==w||e[44]!==ce||e[45]!==y||e[46]!==se||e[47]!==P||e[48]!==k||e[49]!==b||e[50]!==ie||e[51]!==ne||e[52]!==c||e[53]!==z||e[54]!==v||e[55]!==N||e[56]!==q||e[57]!==me||e[58]!==R?(A=!c||!q&&!me?t.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center text-sm text-muted-foreground",children:ce}):t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsx(ue,{className:"w-full max-w-md shrink-0 border-r [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"px-5 py-4",children:q?t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:"Empty fields inherit the default SEO. The preview shows the resolved result."}),t.jsx(Re,{rawSeo:B,innerSeo:w,defaultResolveType:oe,seoSchema:z,activeResolveType:F,seoTypeOptions:c.seoTypeOptions,formResetKey:y,siteDefaultSeo:R,onPersistRaw:E=>{N(E),k(E)},onInnerChange:E=>{v(E),b(E)},onClearForm:le,onBumpFormKey:re})]}):z&&F&&t.jsx(Ee,{schema:z,resolveType:F,value:w,formResetKey:y,onChange:se})})}),t.jsx(ue,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"@container px-5 py-4",children:t.jsx(Ue,{seo:ie,url:ne,path:P})})})]}),e[38]=F,e[39]=re,e[40]=le,e[41]=oe,e[42]=B,e[43]=w,e[44]=ce,e[45]=y,e[46]=se,e[47]=P,e[48]=k,e[49]=b,e[50]=ie,e[51]=ne,e[52]=c,e[53]=z,e[54]=v,e[55]=N,e[56]=q,e[57]=me,e[58]=R,e[59]=A):A=e[59];let J;return e[60]!==I||e[61]!==A?(J=t.jsxs("div",{className:"flex h-full w-full flex-col",children:[I,A]}),e[60]=I,e[61]=A,e[62]=J):J=e[62],J}function Ke(n){return n+1}function Me(n){return n+1}function Ge(n,e){try{return new URL(n,e).href}catch{return e}}function Ve(n,e){const i=e.__resolveType,r=n.__resolveType;if(typeof i=="string"&&typeof r=="string"&&i!==r)return{...e};const h={...n};for(const[a,s]of Object.entries(e))a!=="__resolveType"&&s!=null&&(typeof s=="string"&&s.trim()===""||(h[a]=s));return h}export{Ti as SeoEditor};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-Dxd6kQFA.js","assets/index-Cvc1xn-4.js","assets/index-BITgxoqa.css","assets/XCircle-DJDxYBys.js","assets/CheckCircle-DOPRdShL.js","assets/Settings02-kQ4zmp5P.js","assets/use-mcp-client-DV4dF4m3.js","assets/auth-B9bEkbYh.js","assets/useInfiniteQuery-Bwr_uznn.js","assets/use-infinite-scroll-DM0o0Ibp.js","assets/studio-tools-D8q7MEyE.js","assets/badge-DUlP8HvP.js","assets/input-klr_kUC2.js","assets/dropdown-menu-CgCZ8Mte.js","assets/ChevronUp-DhHPsDAS.js","assets/ChevronRight-tj4xbWmM.js","assets/DotsVertical-kcsdrim_.js","assets/table-DsOuzcNK.js","assets/toggle-group-6FcrOIsd.js","assets/use-view-mode-CF449xEK.js","assets/tooltip-D_DwQRbZ.js","assets/FilterLines-D2obCQW_.js","assets/Globe01-CJXHyXNe.js","assets/SearchMd-CttVjXUQ.js","assets/dialog-DDL08EK8.js","assets/X-DC2HG4lX.js","assets/AlertCircle-BZqAQZBb.js","assets/Upload01-D4ez0Mu3.js","assets/alert-dialog-BUQoXI1j.js","assets/card-D7O9yDM9.js","assets/Trash01-BZXmKzie.js","assets/label-hfmZhqH1.js","assets/select-DwFQDgcX.js","assets/ChevronDown-BhLFFAly.js","assets/switch-skMKJ2GI.js","assets/textarea-2KmLad1y.js","assets/ArrowRight-6qgvW498.js","assets/checkbox-DOg3LODJ.js","assets/Eye-BfNssVzk.js","assets/LinkExternal01-DtLsAcMy.js","assets/use-copy-DM9BeeKg.js","assets/Key01-xj4UQriu.js","assets/Plus-BRQannbC.js","assets/mcp-oauth-C5QgI6bG.js","assets/Play-C0DhAO4u.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{c as m,b as n,e as c,j as t,i as p,r as l,ak as f}from"./index-Cvc1xn-4.js";import{R as u}from"./require-capability-kyUIYw2A.js";import"./use-capability-A3j7T78I.js";import"./access-gate-uvqL8ENQ.js";import"./capability-load-error-DTVGdoZZ.js";const g=l.lazy(()=>f(()=>import("./registry-layout-Dxd6kQFA.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44])));function j(){const e=m.c(5),i=n();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org"},e[0]=s):s=e[0];const{org:o}=c(s);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"h-full flex items-center justify-center",children:t.jsx(p,{size:20,className:"animate-spin text-muted-foreground"})}),e[1]=r):r=e[1];let a;return e[2]!==i||e[3]!==o?(a=t.jsx(u,{capability:"registry:manage",area:"the registry",children:t.jsx(l.Suspense,{fallback:r,children:t.jsx(g,{onBack:()=>i({to:"/$org/settings/store",params:{org:o}})})})}),e[2]=i,e[3]=o,e[4]=a):a=e[4],a}export{j as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as o}from"./AlertCircle-BZqAQZBb.js";import{i as t}from"./CheckCircle-DOPRdShL.js";import{i as r}from"./DotsVertical-kcsdrim_.js";import{ad as a}from"./agent-icon-C4199b3i.js";import{i}from"./index-Cvc1xn-4.js";import{i as n}from"./XCircle-DJDxYBys.js";const l={requires_action:{label:"Needs review",verb:"Waiting for your review",icon:o,iconClassName:"text-orange-500",labelColor:"text-orange-600 dark:text-orange-400"},failed:{label:"Failed",verb:"Something went wrong",icon:n,iconClassName:"text-red-500",labelColor:"text-red-600 dark:text-red-400"},expired:{label:"Timed out",verb:"Stopped responding",icon:a,iconClassName:"text-amber-500",labelColor:"text-amber-600 dark:text-amber-400"},in_progress:{label:"Running",verb:"Agent is working",icon:i,iconClassName:"text-blue-500",labelColor:"text-blue-600 dark:text-blue-400"},completed:{label:"Done",verb:"Completed",icon:t,iconClassName:"text-muted-foreground/50",labelColor:"text-muted-foreground"}},m={label:"Unknown",verb:"Unknown status",icon:r,iconClassName:"text-muted-foreground",labelColor:"text-muted-foreground"};function x(e){return l[e??"completed"]??m}export{l as S,x as g};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as u,s as m,k as g,K as p}from"./index-Cvc1xn-4.js";const b=new Set(["owner","admin"]);function d(){const e=u.c(11),{org:r,locator:c}=m();let s;e[0]!==c?(s=p.myCapabilities(c),e[0]=c,e[1]=s):s=e[1];let a;e[2]!==r?(a=async()=>{const f=await fetch(`/api/auth/custom/my-capabilities/${encodeURIComponent(r.slug)}`,{credentials:"include"});if(!f.ok)throw new Error(`my-capabilities request failed: ${f.status}`);return await f.json()},e[2]=r,e[3]=a):a=e[3];let i;e[4]!==s||e[5]!==a?(i={queryKey:s,queryFn:a,staleTime:3e4,retry:2},e[4]=s,e[5]=a,e[6]=i):i=e[6];const{data:o,isLoading:l,isError:n}=g(i);let t;return e[7]!==o||e[8]!==n||e[9]!==l?(t={data:o,loading:l,error:n},e[7]=o,e[8]=n,e[9]=l,e[10]=t):t=e[10],t}function _(e){const r=u.c(8),{data:c,loading:s,error:a}=d();if(s){let t;return r[0]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!1,loading:!0,error:!1,reason:"loading"},r[0]=t):t=r[0],t}if(a){let t;return r[1]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!1,loading:!1,error:!0,reason:"error"},r[1]=t):t=r[1],t}const i=c?.role??null;if(!i){let t;return r[2]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!1,loading:!1,error:!1,reason:"denied"},r[2]=t):t=r[2],t}if(i==="owner"){let t;return r[3]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!0,loading:!1,error:!1,reason:"owner"},r[3]=t):t=r[3],t}if(i==="admin"){let t;return r[4]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!0,loading:!1,error:!1,reason:"admin"},r[4]=t):t=r[4],t}const o=c?.capabilities?.[e]===!0,l=o?"role":"denied";let n;return r[5]!==o||r[6]!==l?(n={granted:o,loading:!1,error:!1,reason:l},r[5]=o,r[6]=l,r[7]=n):n=r[7],n}function S(){const e=u.c(10),{data:r,loading:c,error:s}=d(),a=r?.role??void 0;let i;e[0]!==a?(i=a?b.has(a):!1,e[0]=a,e[1]=i):i=e[1];const o=i;let l;e[2]!==r?.capabilities?(l=r?.capabilities??{},e[2]=r?.capabilities,e[3]=l):l=e[3];const n=l;let t;return e[4]!==s||e[5]!==o||e[6]!==c||e[7]!==a||e[8]!==n?(t={capabilities:n,loading:c,error:s,isPrivileged:o,roleSlug:a},e[4]=s,e[5]=o,e[6]=c,e[7]=a,e[8]=n,e[9]=t):t=e[9],t}export{S as a,_ as u};
|