decocms 3.35.1 → 3.35.2
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-asB0zjf2.js → AlertCircle-DkwUf9y1.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-DRnt_VKh.js → ArrowUpRight-BUkBkD3O.js} +1 -1
- package/dist/client/assets/{Check-CNRVH6xs.js → Check-C_31_MJb.js} +1 -1
- package/dist/client/assets/{CheckCircle-B7v5_MG4.js → CheckCircle-Cpbk7Z8F.js} +1 -1
- package/dist/client/assets/{ChevronDown-BKkz3Gyp.js → ChevronDown-ciuU2nWp.js} +1 -1
- package/dist/client/assets/{ChevronLeft-DkMFugke.js → ChevronLeft-ZCv3UA1e.js} +1 -1
- package/dist/client/assets/{ChevronRight-DixPnH3V.js → ChevronRight-CFv-fKpX.js} +1 -1
- package/dist/client/assets/{ChevronUp-BeDEmrn1.js → ChevronUp-C64rGI06.js} +1 -1
- package/dist/client/assets/{Container-C41D-bwR.js → Container-BNV-9MJ8.js} +1 -1
- package/dist/client/assets/{DotsVertical-DimB1qZR.js → DotsVertical-Cv0q4Ifl.js} +1 -1
- package/dist/client/assets/{Eye-CFpoJQMe.js → Eye-BWJG0owY.js} +1 -1
- package/dist/client/assets/{FilterLines-htpqKUqo.js → FilterLines-B1BriWf_.js} +1 -1
- package/dist/client/assets/{Globe01-CxF-Z8O2.js → Globe01-BOlA5Q_4.js} +1 -1
- package/dist/client/assets/{HardDrive-TXw7C9gB.js → HardDrive-DHZcIBpx.js} +1 -1
- package/dist/client/assets/{Key01-CDAkGspz.js → Key01-5jFctNvh.js} +1 -1
- package/dist/client/assets/{LayoutLeft-BG08KNqc.js → LayoutLeft-DbIVXyve.js} +1 -1
- package/dist/client/assets/{LinkExternal01-AylVRyuU.js → LinkExternal01-CqMwbx5t.js} +1 -1
- package/dist/client/assets/{Monitor01-gdKmZQTW.js → Monitor01-gHJrCrOh.js} +1 -1
- package/dist/client/assets/{Palette-D9_6t0uI.js → Palette-DqVojGBm.js} +1 -1
- package/dist/client/assets/{Play-aa6uUei5.js → Play-BXDltgp7.js} +1 -1
- package/dist/client/assets/{Plus-DcxLSicT.js → Plus-CW5uSNYz.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-Dd5D2uNm.js → RefreshCcw01-CWaUwErM.js} +1 -1
- package/dist/client/assets/{SearchMd-2GibIebB.js → SearchMd-Bz4Ykghd.js} +1 -1
- package/dist/client/assets/{Settings02-D0kdZjJD.js → Settings02-DLDnTjHy.js} +1 -1
- package/dist/client/assets/{Shield01-CpxvRW7h.js → Shield01-BIILGcyJ.js} +1 -1
- package/dist/client/assets/{Star01-BVQUiqS1.js → Star01-Dw_jqiQj.js} +1 -1
- package/dist/client/assets/{Stars01-B2PA7s4d.js → Stars01-EGK20_72.js} +1 -1
- package/dist/client/assets/{Stars02-BFz8RQ16.js → Stars02-CyyQqj9H.js} +1 -1
- package/dist/client/assets/{Sun-DMcKqqHE.js → Sun-DjmglJiH.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-qUOmQUUG.js → SwitchHorizontal01-a-r60L2U.js} +1 -1
- package/dist/client/assets/{Tool01-DNz0OMpT.js → Tool01-B8aRmzPo.js} +1 -1
- package/dist/client/assets/{Trash01-rpak8qu1.js → Trash01-D5mmvxxB.js} +1 -1
- package/dist/client/assets/{Upload01-d_Wyw7QT.js → Upload01-CYVliRf6.js} +1 -1
- package/dist/client/assets/{User01-BWllfXHj.js → User01-igKL-FIP.js} +1 -1
- package/dist/client/assets/{Users01-DG6YdAo1.js → Users01-DGPeGDAl.js} +1 -1
- package/dist/client/assets/{Users03-B9AqN8LK.js → Users03-59Bl-ju-.js} +1 -1
- package/dist/client/assets/{X-DxE022Fo.js → X-Zx6WnCka.js} +1 -1
- package/dist/client/assets/{XCircle-B_UH_gQt.js → XCircle-BI7HvisP.js} +1 -1
- package/dist/client/assets/{XClose-DOt_DYPz.js → XClose-knQz_HAN.js} +1 -1
- package/dist/client/assets/{Zap-CyMJw7DY.js → Zap-CCChCiD-.js} +1 -1
- package/dist/client/assets/{ZapSquare-Dz4Qok6x.js → ZapSquare-BlkUA5sB.js} +1 -1
- package/dist/client/assets/{ZoomOut-BkCtUzuC.js → ZoomOut-C-DjvL5K.js} +1 -1
- package/dist/client/assets/{access-gate-u6bqRJWi.js → access-gate-DXAe84jj.js} +1 -1
- package/dist/client/assets/{accordion-B7oL0ZOw.js → accordion-BlkUK2b8.js} +1 -1
- package/dist/client/assets/{add-section-modal-DI1aX1UO.js → add-section-modal-CeJkvxLi.js} +1 -1
- package/dist/client/assets/{agent-capabilities-BxQUOIVO.js → agent-capabilities-DbrB1URH.js} +1 -1
- package/dist/client/assets/{agent-icon-BrUPk7cd.js → agent-icon-C4vLfyZT.js} +1 -1
- package/dist/client/assets/{agent-icons-oFY-K2bC.js → agent-icons-BaxWTu1S.js} +1 -1
- package/dist/client/assets/{agents-list-BOxJitnX.js → agents-list-CmTUYZJS.js} +1 -1
- package/dist/client/assets/{ai-providers-DjvmZlJ5.js → ai-providers-DHoxdiMk.js} +1 -1
- package/dist/client/assets/{alert-8WGQf_5q.js → alert-Bw1ORE7l.js} +1 -1
- package/dist/client/assets/{alert-dialog-DUUnhBc6.js → alert-dialog-DmwO1wKa.js} +1 -1
- package/dist/client/assets/app-editor-DZU371gg.js +1 -0
- package/dist/client/assets/{auth-catchall-_asaISim.js → auth-catchall-BKWUHHRQ.js} +1 -1
- package/dist/client/assets/{auth-DTxUlSLU.js → auth-jf8Ueqtd.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DU0bpIBM.js → auth-split-layout-DRwMHkyX.js} +1 -1
- package/dist/client/assets/{automation-list-row-atv_xAlK.js → automation-list-row-DjCxfkOO.js} +1 -1
- package/dist/client/assets/{automation-runs-8yvWAbAC.js → automation-runs-CW_yJDML.js} +1 -1
- package/dist/client/assets/{automations-B1IxT7Wc.js → automations-cjNb_nRD.js} +1 -1
- package/dist/client/assets/{avatar-BqYC23h9.js → avatar-DdLkUzB6.js} +1 -1
- package/dist/client/assets/{badge-CGZjMX2o.js → badge-CKyeE-oo.js} +1 -1
- package/dist/client/assets/{brand-context-Dki54pAn.js → brand-context-Dbw-HLYi.js} +1 -1
- package/dist/client/assets/{buckets-BgnqByrS.js → buckets-Bu7h0_Hd.js} +1 -1
- package/dist/client/assets/{calendar-CaIJu6mx.js → calendar-0t1uXfLL.js} +1 -1
- package/dist/client/assets/{capability-load-error-DWbE5k9a.js → capability-load-error-DY55FeJ6.js} +1 -1
- package/dist/client/assets/{card-BlzflWCA.js → card-DP32GBOf.js} +1 -1
- package/dist/client/assets/{chat-context-BUN4BStS.js → chat-context-DK-AWUQz.js} +1 -1
- package/dist/client/assets/{checkbox-C1s8UE6Y.js → checkbox-DUa9wb8T.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DOMHymP7.js → cli-auth-success-Daqunv5H.js} +1 -1
- package/dist/client/assets/{collection-detail-Fe7fYzy1.js → collection-detail-5UYGpD4U.js} +1 -1
- package/dist/client/assets/{collection-display-button-CTi0VUGU.js → collection-display-button-D6VmVMvk.js} +1 -1
- package/dist/client/assets/{collection-search-CJ5Ov7mh.js → collection-search-jOlxOkeZ.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BMZaf4HK.js → collection-table-wrapper-CM2GZd4j.js} +1 -1
- package/dist/client/assets/{collection-tabs-zuvlZo6K.js → collection-tabs-DvXat67P.js} +1 -1
- package/dist/client/assets/{collections-Dg2-DQoz.js → collections-xWz9Ka4y.js} +1 -1
- package/dist/client/assets/{command-ETJRln9I.js → command-14UC_LgG.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-Ccy-ptqT.js → connect-desktop-dialog-DVqHifor.js} +1 -1
- package/dist/client/assets/{connection-card-BryVkZk7.js → connection-card-W6kS50Xm.js} +1 -1
- package/dist/client/assets/{connection-detail-KbHJGNLa.js → connection-detail-BbS7VfwB.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-C9SsVHwd.js → connection-form-helpers-jyOtcSIt.js} +1 -1
- package/dist/client/assets/{connections-C-B_pHNS.js → connections-DmawYjy9.js} +1 -1
- package/dist/client/assets/decopilot-sse-pool-CwSrVgbm.js +1 -0
- package/dist/client/assets/{dialog-dItkri_7.js → dialog-DPVJEPrK.js} +1 -1
- package/dist/client/assets/{domain-settings-Cwl6OKHc.js → domain-settings-BdF9eKHz.js} +1 -1
- package/dist/client/assets/{drawer-CiKI2xvg.js → drawer-BXyUyCQL.js} +1 -1
- package/dist/client/assets/{dropdown-menu-DA6--pO3.js → dropdown-menu-DOlfrN75.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-DvjE2kdj.js → dynamic-plugin-layout-DIyMBeV4.js} +1 -1
- package/dist/client/assets/{empty-state-ubN3bG68.js → empty-state-CmddJMwD.js} +1 -1
- package/dist/client/assets/{empty-state-Wjey2haZ.js → empty-state-xh_20twO.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BUZFKLkD.js → extract-connection-data-DqaTmzNL.js} +1 -1
- package/dist/client/assets/{features-wYfaVlaa.js → features-DnOEdSHo.js} +1 -1
- package/dist/client/assets/{file-explorer-uNvjlPcF.js → file-explorer-C657nvDI.js} +1 -1
- package/dist/client/assets/{file-type-icon-BC52hPZD.js → file-type-icon-D93vAYh4.js} +1 -1
- package/dist/client/assets/{files-DCMyG2Qq.js → files-B8jmDdpO.js} +1 -1
- package/dist/client/assets/{form-BvrZIBZy.js → form-EYtxKS6a.js} +1 -1
- package/dist/client/assets/{general-CVh1dm4M.js → general-B2htYYmc.js} +1 -1
- package/dist/client/assets/{generate-id-BYzu1jEq.js → generate-id-BlA-3dpa.js} +1 -1
- package/dist/client/assets/{github-repo-picker-D-39cmmm.js → github-repo-picker-CN9VGWSw.js} +1 -1
- package/dist/client/assets/{header-tab-button-eoCiDxtu.js → header-tab-button-zGw57zar.js} +1 -1
- package/dist/client/assets/{hover-card-DuwXdrhz.js → hover-card-CyNrGP46.js} +1 -1
- package/dist/client/assets/{image-field-BctFTejU.js → image-field-CRg7FKDt.js} +1 -1
- package/dist/client/assets/{index-CYZk0gv3.js → index-BFzXRFgv.js} +1 -1
- package/dist/client/assets/{index-BN_h4BrS.js → index-Bql2Wqwg.js} +1 -1
- package/dist/client/assets/{index-BOvqwG23.js → index-C7fNNl96.js} +1 -1
- package/dist/client/assets/{index-BMYBcbtc.js → index-COo7MQNq.js} +1 -1
- package/dist/client/assets/{index-DkJOKUiK.js → index-D2JLfz42.js} +1 -1
- package/dist/client/assets/{index-CQVYoK7e.js → index-DFboBiZx.js} +1 -1
- package/dist/client/assets/{index-Dv-yFpKM.js → index-DnIoj8fl.js} +3 -3
- package/dist/client/assets/{index-DkBXivRM.js → index-DxTO1Vau.js} +1 -1
- package/dist/client/assets/{index-Dilf6iGE.js → index-LekHmrTG.js} +1 -1
- package/dist/client/assets/{index-CfhwhmtA.js → index-NebhiVVQ.js} +1 -1
- package/dist/client/assets/{index-DFBJ_PWq.js → index-Q2jKm_ff.js} +1 -1
- package/dist/client/assets/{index-B6rgjRY6.js → index-RgwViKsx.js} +1 -1
- package/dist/client/assets/{index-CyhU99S0.js → index-ltKXKiQ2.js} +1 -1
- package/dist/client/assets/{index-7TDtRiUY.js → index-o7c8QKYO.js} +4 -4
- package/dist/client/assets/{index-redirect-C0KSMoT0.js → index-redirect-C7lzzPeT.js} +1 -1
- package/dist/client/assets/{index-cSwj9er3.js → index-tWFPBDUb.js} +1 -1
- package/dist/client/assets/{input-B16LqKMQ.js → input-kFc4cqln.js} +1 -1
- package/dist/client/assets/{integration-icon-7cYHs9rV.js → integration-icon-D3EQp4Fu.js} +1 -1
- package/dist/client/assets/{label-DfTmRnMe.js → label-Bvw0Ied9.js} +1 -1
- package/dist/client/assets/{layout-BCfLVStg.js → layout-Ca-s_wnC.js} +1 -1
- package/dist/client/assets/{login-BQe_0Uvb.js → login-CX7-TkZm.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BoL_9gDY.js → mcp-oauth-jiIVtUUC.js} +1 -1
- package/dist/client/assets/{members-DjEZG3vo.js → members-BLERW5ar.js} +1 -1
- package/dist/client/assets/{monaco-editor-CEYWUBYY.js → monaco-editor-MWSSoG2S.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-Bn6k8FMZ.js → monitoring-stats-row-EcWn-b5L.js} +1 -1
- package/dist/client/assets/{oauth-callback-RkcrzPY9.js → oauth-callback-DErfvA_e.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-5c5f08wA.js → oauth-callback-ai-provider-B2CeVkps.js} +1 -1
- package/dist/client/assets/{onboarding-DgNS0nCK.js → onboarding-D1OquzOs.js} +1 -1
- package/dist/client/assets/{org-install-BAqLW3a2.js → org-install-CP6GafaT.js} +1 -1
- package/dist/client/assets/{org-layout--7cqwMMu.js → org-layout-BKiOkIR9.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-oYg4_27L.js → org-plugin-layout-aVdWNCe2.js} +1 -1
- package/dist/client/assets/{page-seo-form-BPPrLLbX.js → page-seo-form-63_BP4Z5.js} +1 -1
- package/dist/client/assets/page-seo-sheet-CgQ_3iup.js +1 -0
- package/dist/client/assets/{pair-rD44zBRY.js → pair-CC2q5WhY.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-BrE2fclx.js → plugin-empty-state-C8J8IuVQ.js} +1 -1
- package/dist/client/assets/{plugin-header-K2albhDB.js → plugin-header-CQ-0B9QL.js} +1 -1
- package/dist/client/assets/{plugin-layout-QWYZgGti.js → plugin-layout-1OlgHiyb.js} +1 -1
- package/dist/client/assets/{popover-BneLTlXE.js → popover-DFBV-kft.js} +1 -1
- package/dist/client/assets/{post-editor-DtVXF5Vi.js → post-editor-RC0nSinu.js} +1 -1
- package/dist/client/assets/{primitives-CGyfTuZM.js → primitives-Dj8whdvu.js} +1 -1
- package/dist/client/assets/{profile-DyIp4_Sh.js → profile-C1y0Wzbe.js} +1 -1
- package/dist/client/assets/project-app-view-CDg0Ipzu.js +1 -0
- package/dist/client/assets/record-editor-C8D-bch6.js +1 -0
- package/dist/client/assets/registry-DwqBhaO7.js +2 -0
- package/dist/client/assets/{registry-layout-D_1w2T32.js → registry-layout-CRdtAXEl.js} +1 -1
- package/dist/client/assets/{require-capability-BYMVx09Z.js → require-capability-CJqD_sNw.js} +1 -1
- package/dist/client/assets/{required-auth-layout-cXbsWfNV.js → required-auth-layout-DVQqpR9U.js} +1 -1
- package/dist/client/assets/{reset-password-CUBQj13G.js → reset-password-6kMSCjoE.js} +1 -1
- package/dist/client/assets/{resizable-DTSOtBpc.js → resizable-BCts7Hoe.js} +1 -1
- package/dist/client/assets/{roles-CNJV2xc7.js → roles-Tffk7a5z.js} +1 -1
- package/dist/client/assets/save-referenced-block-BPZ9GwRm.js +1 -0
- package/dist/client/assets/{save-status-CFFENSy0.js → save-status-CgWmFzXD.js} +1 -1
- package/dist/client/assets/{schema-form-EY1QOp8v.js → schema-form-WouwDdYp.js} +1 -1
- package/dist/client/assets/{scroll-area-CGmfUT4q.js → scroll-area-DXdZCfi_.js} +1 -1
- package/dist/client/assets/{search-input-nds5g8eq.js → search-input-B3XYdfeF.js} +1 -1
- package/dist/client/assets/{secrets-D9isT8UG.js → secrets-CbDoNw3q.js} +1 -1
- package/dist/client/assets/{sections-editor-Bdjt3M_c.js → sections-editor-BmHJWIlu.js} +1 -1
- package/dist/client/assets/{select-CXfOBpVA.js → select-B_xVBVbm.js} +1 -1
- package/dist/client/assets/{select-model-BLS2zNwN.js → select-model-DkF6uTkV.js} +1 -1
- package/dist/client/assets/{seo-editor-COMkxwHv.js → seo-editor-CSzOD8a1.js} +1 -1
- package/dist/client/assets/{settings-layout-B65ypXYb.js → settings-layout-CmjQb7Ht.js} +1 -1
- package/dist/client/assets/{settings-section-ysm1dXbe.js → settings-section-BTddWHA-.js} +1 -1
- package/dist/client/assets/{sheet-DwJxE17f.js → sheet-B3GYGLhe.js} +1 -1
- package/dist/client/assets/{shell-controls-CghaJ_r9.js → shell-controls-CD1e_u6K.js} +1 -1
- package/dist/client/assets/{shell-layout-BI3SgcG0.js → shell-layout-Cgwg5QF3.js} +1 -1
- package/dist/client/assets/{shell-route-loading-BQp4nxMc.js → shell-route-loading-COeh_aex.js} +1 -1
- package/dist/client/assets/{sidebar-nhuTSqFS.js → sidebar-kyVuWucL.js} +1 -1
- package/dist/client/assets/{skeleton-DcZkQ-WQ.js → skeleton-CyRCN25X.js} +1 -1
- package/dist/client/assets/{sortable.esm-BJmSIQN6.js → sortable.esm-C7P-vU6-.js} +1 -1
- package/dist/client/assets/{spinner-C76OMH7i.js → spinner-B62HtwxP.js} +1 -1
- package/dist/client/assets/{sso-Biwe8B2Y.js → sso-CFgdcP4X.js} +1 -1
- package/dist/client/assets/{store-DPy_WrJu.js → store-DD3q7khp.js} +1 -1
- package/dist/client/assets/store-registry-DmaUBXDq.js +2 -0
- package/dist/client/assets/{studio-tools-DP4PwlLL.js → studio-tools-CYvl10tJ.js} +1 -1
- package/dist/client/assets/{switch-Dlc-euH4.js → switch-9AraHuPG.js} +1 -1
- package/dist/client/assets/{tab-id-DrxIMKZC.js → tab-id-DiaWi79N.js} +1 -1
- package/dist/client/assets/{table-BY5hmAW9.js → table-D-eZ2Wly.js} +1 -1
- package/dist/client/assets/{tabs-MktB_dq3.js → tabs-DNIUI4W6.js} +1 -1
- package/dist/client/assets/{task-status-Bkjp3y0Q.js → task-status-CDkG-N6p.js} +1 -1
- package/dist/client/assets/{textarea-Dc7UpW7V.js → textarea-BuPx5SDQ.js} +1 -1
- package/dist/client/assets/{toggle-group-PAs-hpFv.js → toggle-group-BgDlmAc0.js} +1 -1
- package/dist/client/assets/{toolbar-CCipnjie.js → toolbar-WIS1-2Sy.js} +1 -1
- package/dist/client/assets/{tools-list-D8vEf5kn.js → tools-list-D6uq4MrN.js} +1 -1
- package/dist/client/assets/{tooltip-DyNW-AXf.js → tooltip-DG-C65pd.js} +1 -1
- package/dist/client/assets/{types-DYMMjWos.js → types-7_L4W6Tu.js} +1 -1
- package/dist/client/assets/{use-ai-providers-C1UbdVdO.js → use-ai-providers-C3HTrKhd.js} +1 -1
- package/dist/client/assets/{use-automations-DFVkTFjl.js → use-automations-QDhIwpIJ.js} +1 -1
- package/dist/client/assets/{use-capability-Bw0k887i.js → use-capability-DQgRY6_x.js} +1 -1
- package/dist/client/assets/{use-clock-tick-DMfzqE_6.js → use-clock-tick-CwR4C3CJ.js} +1 -1
- package/dist/client/assets/{use-collections-DGD5HYrs.js → use-collections-DjJTRpo_.js} +1 -1
- package/dist/client/assets/{use-connection-XtO-eFJi.js → use-connection-DUYQMDLQ.js} +1 -1
- package/dist/client/assets/{use-copy-fHv0q1pV.js → use-copy-9rW5ZwZw.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DTGwia7F.js → use-create-virtual-mcp-DZIq-rHQ.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-nDLl3CCi.js → use-debounced-autosave-4TUEEtao.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CWxG7WKN.js → use-delete-connection-BSxNsHg_.js} +1 -1
- package/dist/client/assets/{use-file-configs-DhxZBYOT.js → use-file-configs-CiOc-9XG.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-D4S3aGR5.js → use-infinite-scroll-HMRo8z7S.js} +1 -1
- package/dist/client/assets/{use-list-state-Cx82QFu_.js → use-list-state-D5-adRnk.js} +1 -1
- package/dist/client/assets/{use-mcp-client-C8ZwZB20.js → use-mcp-client-DAanazcB.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-D2owAcPE.js → use-mcp-prompts-BJhG10VU.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BW-64A4f.js → use-mcp-tools-BZ5C7mX8.js} +1 -1
- package/dist/client/assets/{use-members-DPyxvdDj.js → use-members-oxzMf6HC.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-B9d6Q1VR.js → use-navigate-to-agent-Cvb4b2dj.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BTTZUjKk.js → use-org-auth-client-4XCuGX_0.js} +1 -1
- package/dist/client/assets/{use-org-sso-B1KJDg2R.js → use-org-sso-C3JjHGLM.js} +1 -1
- package/dist/client/assets/{use-organization-roles-zS-vWU34.js → use-organization-roles-CE1F99xu.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CCLHoFg6.js → use-organization-settings-BDQcymx3.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CAyIHNjF.js → use-registry-connections-Btr8vraI.js} +1 -1
- package/dist/client/assets/{use-secrets-CtwUwXaf.js → use-secrets-aNG7boBI.js} +1 -1
- package/dist/client/assets/{use-status-sounds-B27SY7cH.js → use-status-sounds-CRlMq1Od.js} +1 -1
- package/dist/client/assets/{use-view-mode-BRITAZ4S.js → use-view-mode-DaIWDL_S.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DLQJqd7d.js → use-virtual-mcp-B4MbUdTW.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Dal3RT3l.js +1 -0
- package/dist/client/assets/{useRouterState-Y1aLUix_.js → useRouterState-DuGUZA7B.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CqnU8D2I.js +1 -0
- package/dist/client/assets/{user-CLXOG3Qm.js → user-BWs1Xtr6.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-D_5X7-ae.js → view-mode-toggle-G-KCK_xv.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-rXavNycp.js → watch-sse-pool-BVVVT94i.js} +1 -1
- package/dist/client/assets/{workflow-Bq61DMkg.js → workflow-CQ33bXoz.js} +1 -1
- package/dist/client/assets/workflow-detail-Di_0eyvg.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/app-editor-8bhdvSJz.js +0 -1
- package/dist/client/assets/decopilot-sse-pool-BYcZYovC.js +0 -1
- package/dist/client/assets/page-seo-sheet-B3ue-ZRT.js +0 -1
- package/dist/client/assets/project-app-view-LYHB1B7I.js +0 -1
- package/dist/client/assets/record-editor-CoIz7HmY.js +0 -1
- package/dist/client/assets/registry-DusjF1MY.js +0 -2
- package/dist/client/assets/save-referenced-block-R6f1-KeE.js +0 -1
- package/dist/client/assets/store-registry-D7UNS3l2.js +0 -2
- package/dist/client/assets/useInfiniteQuery-G_6i7LOo.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BhcYyKm_.js +0 -1
- package/dist/client/assets/workflow-detail-BJvoV5gO.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ao as Ze,ap as de,aq as Ye,ar as et,as as $e,F as he,at as tt,au as st,r as A,av as it,aw as nt,ax as rt,ay as ot,az as ve,aA as lt,aB as at,aC as ct,e as T,j as i,p as J,c as q,l as Ie,aD as pe,n as W,K as ne,m as re,a as dt,s as mt,E as ut,b as ft,B as je}from"./index-Dv-yFpKM.js";import{u as xe}from"./tooltip-DyNW-AXf.js";import{i as ht,u as oe,g as pt,a as xt}from"./use-mcp-client-C8ZwZB20.js";import{a as gt,b as bt,v as yt,u as vt}from"./use-virtual-mcp-DLQJqd7d.js";import{i as jt}from"./Check-CNRVH6xs.js";import{_ as wt,A as Y,a0 as Nt,v as St,c as _t}from"./agent-icon-BrUPk7cd.js";import{s as ge}from"./Plus-DcxLSicT.js";import{i as Te}from"./X-DxE022Fo.js";import{b as Ct,h as kt,C as se}from"./agent-capabilities-BxQUOIVO.js";import{u as Et,c as $t}from"./chat-context-BUN4BStS.js";import{N as It}from"./agent-icons-oFY-K2bC.js";import{a as Ae,b as ie,K as Me,P as Oe,D as Re,c as Tt,S as At,v as Mt,d as Ot,C as Rt,s as zt,e as Pt,f as Dt,h as Ht,u as Lt}from"./sortable.esm-BJmSIQN6.js";import{u as ze,a as Pe,o as Ut}from"./use-organization-settings-CCLHoFg6.js";import{c as be,u as Bt,h as Ft}from"./shell-layout-BI3SgcG0.js";import{I as Qt}from"./input-B16LqKMQ.js";import{S as Wt}from"./scroll-area-CGmfUT4q.js";import{S as qt,c as Kt,d as Gt,a as Vt,b as Jt}from"./sheet-DwJxE17f.js";import{S as H}from"./skeleton-DcZkQ-WQ.js";import{t as De}from"./ChevronDown-BKkz3Gyp.js";import{d as He}from"./ZoomOut-BkCtUzuC.js";import{g as Xt,M as Zt}from"./types-DYMMjWos.js";import{I as Yt}from"./integration-icon-7cYHs9rV.js";import{u as es}from"./studio-tools-DP4PwlLL.js";import{t as Le,P as ts,e as ss,s as is,g as ns}from"./pair-rD44zBRY.js";import{a as rs}from"./XCircle-B_UH_gQt.js";import{g as os}from"./use-mcp-prompts-D2owAcPE.js";import{u as ls,w as as}from"./tab-id-DrxIMKZC.js";import{a as cs,g as ds,c as ms,b as us,D as fs}from"./dropdown-menu-DA6--pO3.js";import{s as hs}from"./Trash01-rpak8qu1.js";import{a as ps,u as xs}from"./use-ai-providers-C1UbdVdO.js";import{a as gs}from"./toolbar-CCipnjie.js";import"./auth-DTxUlSLU.js";import"./use-collections-DGD5HYrs.js";import"./AlertCircle-asB0zjf2.js";import"./Tool01-DNz0OMpT.js";import"./SwitchHorizontal01-qUOmQUUG.js";import"./RefreshCcw01-Dd5D2uNm.js";import"./ArrowUpRight-DRnt_VKh.js";import"./ZapSquare-Dz4Qok6x.js";import"./Users03-B9AqN8LK.js";import"./CheckCircle-B7v5_MG4.js";import"./ChevronLeft-DkMFugke.js";import"./ChevronRight-DixPnH3V.js";import"./ChevronUp-BeDEmrn1.js";import"./DotsVertical-DimB1qZR.js";import"./Container-C41D-bwR.js";import"./Eye-CFpoJQMe.js";import"./Globe01-CxF-Z8O2.js";import"./FilterLines-htpqKUqo.js";import"./Star01-BVQUiqS1.js";import"./Palette-D9_6t0uI.js";import"./HardDrive-TXw7C9gB.js";import"./Stars02-BFz8RQ16.js";import"./Key01-CDAkGspz.js";import"./LayoutLeft-BG08KNqc.js";import"./LinkExternal01-AylVRyuU.js";import"./Monitor01-gdKmZQTW.js";import"./Sun-DMcKqqHE.js";import"./Play-aa6uUei5.js";import"./SearchMd-2GibIebB.js";import"./Settings02-D0kdZjJD.js";import"./Shield01-CpxvRW7h.js";import"./Stars01-B2PA7s4d.js";import"./Upload01-d_Wyw7QT.js";import"./User01-BWllfXHj.js";import"./Users01-DG6YdAo1.js";import"./XClose-DOt_DYPz.js";import"./Zap-CyMJw7DY.js";import"./spinner-C76OMH7i.js";import"./dialog-dItkri_7.js";import"./drawer-CiKI2xvg.js";import"./collection-search-CJ5Ov7mh.js";import"./form-BvrZIBZy.js";import"./label-DfTmRnMe.js";import"./select-CXfOBpVA.js";import"./tabs-MktB_dq3.js";import"./toggle-group-PAs-hpFv.js";import"./connect-desktop-dialog-Ccy-ptqT.js";import"./popover-BneLTlXE.js";import"./command-ETJRln9I.js";import"./index-BMYBcbtc.js";import"./useInfiniteQuery-G_6i7LOo.js";import"./use-infinite-scroll-D4S3aGR5.js";import"./index-DkJOKUiK.js";import"./question-004-sINsf4GQ.js";import"./checkbox-C1s8UE6Y.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-BqYC23h9.js";import"./settings-section-ysm1dXbe.js";import"./card-BlzflWCA.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BryVkZk7.js";import"./use-registry-connections-CAyIHNjF.js";import"./use-connection-XtO-eFJi.js";import"./extract-connection-data-BUZFKLkD.js";import"./generate-id-BYzu1jEq.js";import"./collections-Dg2-DQoz.js";import"./collection-tabs-zuvlZo6K.js";import"./badge-CGZjMX2o.js";import"./textarea-Dc7UpW7V.js";import"./connection-form-helpers-C9SsVHwd.js";import"./useSuspenseInfiniteQuery-BhcYyKm_.js";import"./mcp-oauth-BoL_9gDY.js";import"./required-auth-layout-cXbsWfNV.js";import"./useRouterState-Y1aLUix_.js";import"./use-org-sso-B1KJDg2R.js";import"./use-clock-tick-DMfzqE_6.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-fHv0q1pV.js";import"./file-type-icon-BC52hPZD.js";import"./content-blocks-o63cs2vh.js";import"./use-navigate-to-agent-B9d6Q1VR.js";import"./watch-sse-pool-rXavNycp.js";import"./decopilot-sse-pool-BYcZYovC.js";function we(t,e){const s=new Set(e);return t.filter(r=>!s.has(r))}function bs(t,e,s){const r=t.slice(0);return r[e]=s,r}var ys=class extends Ze{#n;#e;#r;#i;#t;#s;#o;#l;#a;#c=[];constructor(t,e,s){super(),this.#n=t,this.#i=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.#i=e,de.batch(()=>{const s=this.#t,r=this.#u(this.#r);r.forEach(m=>m.observer.setOptions(m.defaultedQueryOptions));const n=r.map(m=>m.observer),a=n.map(m=>m.getCurrentResult()),l=s.length!==n.length,c=n.some((m,u)=>m!==s[u]),o=l||c,d=o?!0:a.some((m,u)=>{const f=this.#e[u];return!f||!Ye(m,f)});!o&&!d||(o&&(this.#c=r,this.#t=n),this.#e=a,this.hasListeners()&&(o&&(we(s,n).forEach(m=>{m.destroy()}),we(n,s).forEach(m=>{m.subscribe(u=>{this.#f(m,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(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),n=s.map(a=>a.defaultedQueryOptions.queryHash);return[r,a=>this.#m(a??r,e,n),()=>this.#d(r,s)]}#d(t,e){return e.map((s,r)=>{const n=t[r];return s.defaultedQueryOptions.notifyOnChangeProps?n:s.observer.trackResult(n,a=>{e.forEach(l=>{l.observer.trackProp(a)})})})}#m(t,e,s){if(e){const r=this.#a,n=s!==void 0&&r!==void 0&&(r.length!==s.length||s.some((a,l)=>a!==r[l]));return(!this.#s||this.#e!==this.#l||n||e!==this.#o)&&(this.#o=e,this.#l=this.#e,s!==void 0&&(this.#a=s),this.#s=et(this.#s,e(t))),this.#s}return t}#p(){return this.#i?.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 n=r.options.queryHash;if(!n)return;const a=e.get(n);a?a.push(r):e.set(n,[r])});const s=[];return t.forEach(r=>{const n=this.#n.defaultQueryOptions(r),l=e.get(n.queryHash)?.shift()??new $e(this.#n,n);s.push({defaultedQueryOptions:n,observer:l})}),s}#f(t,e){const s=this.#t.indexOf(t);s!==-1&&(this.#e=bs(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.#i?.combine);(e||s!==r)&&de.batch(()=>{this.listeners.forEach(n=>{n(this.#e)})})}}};function vs({queries:t,...e},s){const r=he(s),n=tt(),a=st(),l=A.useMemo(()=>t.map(h=>{const p=r.defaultQueryOptions(h);return p._optimisticResults=n?"isRestoring":"optimistic",p}),[t,r,n]);l.forEach(h=>{it(h);const p=r.getQueryCache().get(h.queryHash);nt(h,a,p)}),rt(a);const[c]=A.useState(()=>new ys(r,l,e)),[o,d,m]=c.getOptimisticResult(l,e.combine),u=!n&&e.subscribed!==!1;A.useSyncExternalStore(A.useCallback(h=>u?c.subscribe(de.batchCalls(h)):ot,[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),A.useEffect(()=>{c.setQueries(l,e)},[l,e,c]);const x=o.some((h,p)=>ve(l[p],h))?o.flatMap((h,p)=>{const b=l[p];if(b&&ve(b,h)){const v=new $e(r,b);return lt(b,v,a)}return[]}):[];if(x.length>0)throw Promise.all(x);const g=o.find((h,p)=>{const b=l[p];return b&&at({result:h,errorResetBoundary:a,throwOnError:b.throwOnError,query:r.getQueryCache().get(b.queryHash),suspense:b.suspense})});if(g?.error)throw g.error;return d(m())}function js(t,e){return vs({...t,queries:t.queries.map(s=>({...s,suspense:!0,throwOnError:ct,enabled:!0,placeholderData:void 0}))},e)}const ee=8;function ws(t){const e=T.c(16),{open:s,onOpenChange:r}=t,[n,a]=A.useState("");let l,c;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(qt,{children:"Manage home"}),c=i.jsx(Kt,{children:"Add agents to the home board and pin their interactive UIs or prompts."}),e[0]=l,e[1]=c):(l=e[0],c=e[1]);let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(wt,{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]=o):o=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=h=>a(h.target.value),e[3]=d):d=e[3];let m;e[4]!==n?(m=i.jsxs(Gt,{className:"px-5 py-4 border-b border-border",children:[l,c,i.jsxs("div",{className:"relative mt-3",children:[o,i.jsx(Qt,{value:n,onChange:d,placeholder:"Search agents…",className:"pl-8 h-8 text-sm"})]})]}),e[4]=n,e[5]=m):m=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(Js,{}),e[6]=u):u=e[6];let f;e[7]!==n?(f=i.jsx(Wt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:i.jsx("div",{className:"p-3 flex flex-col gap-4",children:i.jsx(A.Suspense,{fallback:u,children:i.jsx(Ss,{search:n})})})}),e[7]=n,e[8]=f):f=e[8];let x;e[9]!==m||e[10]!==f?(x=i.jsxs(Vt,{side:"right",className:"w-full sm:max-w-md p-0 flex flex-col",children:[m,f]}),e[9]=m,e[10]=f,e[11]=x):x=e[11];let g;return e[12]!==r||e[13]!==s||e[14]!==x?(g=i.jsx(Jt,{open:s,onOpenChange:r,children:x}),e[12]=r,e[13]=s,e[14]=x,e[15]=g):g=e[15],g}function Ns(t){const e=T.c(32),{org:s}=J(),r=ze();let n;e[0]!==r?.ids?(n=r?.ids??[],e[0]=r?.ids,e[1]=n):n=e[1];const a=n,l=Pe(),c=bt(),o=he();let d;e[2]!==s||e[3]!==o?(d=()=>o.refetchQueries({queryKey:ne.homeNextActions(s.slug),type:"active"}),e[2]=s,e[3]=o,e[4]=d):d=e[4];const m=d;let u;e[5]!==a?(u=C=>a.includes(C),e[5]=a,e[6]=u):u=e[6];const f=u;let x;e[7]!==a||e[8]!==t?(x=t?a.filter(C=>t.has(C)).length:a.length,e[7]=a,e[8]=t,e[9]=x):x=e[9];const h=x>=ee;let p;e[10]!==h||e[11]!==f||e[12]!==l?(p=C=>f(C)||h?Promise.resolve():l.apply($=>$.includes(C)?null:[...$,C]),e[10]=h,e[11]=f,e[12]=l,e[13]=p):p=e[13];const b=p;let v;e[14]!==l?(v=C=>l.apply($=>$.filter(E=>E!==C)),e[14]=l,e[15]=v):v=e[15];const w=v;let y;e[16]!==l?(y=C=>l.apply(()=>C),e[16]=l,e[17]=y):y=e[17];const j=y;let N;e[18]!==c||e[19]!==h||e[20]!==f||e[21]!==m||e[22]!==l?(N=async(C,$)=>{await c.update.mutateAsync({id:C.id,data:{metadata:$}}),!f(C.id)&&!h&&await l.apply(E=>E.includes(C.id)?null:[...E,C.id]),await m()},e[18]=c,e[19]=h,e[20]=f,e[21]=m,e[22]=l,e[23]=N):N=e[23];const S=N;let k;return e[24]!==b||e[25]!==h||e[26]!==a||e[27]!==f||e[28]!==w||e[29]!==j||e[30]!==S?(k={homeIds:a,isOnHome:f,atLimit:h,addAgent:b,removeAgent:w,reorder:j,saveAgentMetadata:S},e[24]=b,e[25]=h,e[26]=a,e[27]=f,e[28]=w,e[29]=j,e[30]=S,e[31]=k):k=e[31],k}function Ss(t){const e=T.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 n=gt(r);let a;e[1]!==n?(a=new Set(n.map($s)),e[1]=n,e[2]=a):a=e[2];const l=Ns(a);let c,o,d;if(e[3]!==n||e[4]!==l||e[5]!==s){const h=new Map(n.map(Es));c=s.trim().toLowerCase();const p=v=>!c||v.title?.toLowerCase().includes(c);o=l.homeIds.map(v=>h.get(v)).filter(ks).filter(p);let b;e[9]!==l?(b=v=>!l.isOnHome(v.id),e[9]=l,e[10]=b):b=e[10],d=n.filter(Cs).filter(b).filter(p).sort(_s),e[3]=n,e[4]=l,e[5]=s,e[6]=c,e[7]=o,e[8]=d}else c=e[6],o=e[7],d=e[8];const m=d;let u;e[11]!==l||e[12]!==o?(u=i.jsx(Is,{home:l,agents:o}),e[11]=l,e[12]=o,e[13]=u):u=e[13];const f=!!c;let x;e[14]!==m||e[15]!==l||e[16]!==f?(x=i.jsx(Ms,{home:l,agents:m,hasSearch:f}),e[14]=m,e[15]=l,e[16]=f,e[17]=x):x=e[17];let g;return e[18]!==u||e[19]!==x?(g=i.jsxs(i.Fragment,{children:[u,x]}),e[18]=u,e[19]=x,e[20]=g):g=e[20],g}function _s(t,e){return(t.title??"").localeCompare(e.title??"")}function Cs(t){return t.id&&!ht(t.id)}function ks(t){return!!t}function Es(t){return[t.id,t]}function $s(t){return t.id}function Ue(t){const e=T.c(7),{title:s,hint:r}=t;let n;e[0]!==s?(n=i.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:s}),e[0]=s,e[1]=n):n=e[1];let a;e[2]!==r?(a=r&&i.jsx("span",{className:"text-xs text-muted-foreground",children:r}),e[2]=r,e[3]=a):a=e[3];let l;return e[4]!==n||e[5]!==a?(l=i.jsxs("div",{className:"flex items-center justify-between px-1",children:[n,a]}),e[4]=n,e[5]=a,e[6]=l):l=e[6],l}function Is(t){const e=T.c(14),{home:s,agents:r}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={activationConstraint:{distance:5}},e[0]=n):n=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={coordinateGetter:zt},e[1]=a):a=e[1];const l=Ae(ie(Oe,n),ie(Me,a));let c;e[2]!==s?(c=x=>{const{active:g,over:h}=x;if(!h||g.id===h.id)return;const p=s.homeIds,b=p.indexOf(g.id),v=p.indexOf(h.id);b===-1||v===-1||s.reorder(Pt([...p],b,v)).catch(As)},e[2]=s,e[3]=c):c=e[3];const o=c,d=`${s.homeIds.length}/${ee}`;let m;e[4]!==d?(m=i.jsx(Ue,{title:"On home",hint:d}),e[4]=d,e[5]=m):m=e[5];let u;e[6]!==r||e[7]!==o||e[8]!==s||e[9]!==l?(u=r.length===0?i.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"No agents on the home yet."}):i.jsx(Re,{sensors:l,collisionDetection:Tt,onDragEnd:o,children:i.jsx(At,{items:r.map(Ts),strategy:Mt,children:i.jsx("div",{className:"flex flex-col gap-1",children:r.map(x=>i.jsx(Rs,{agent:x,home:s},x.id))})})}),e[6]=r,e[7]=o,e[8]=s,e[9]=l,e[10]=u):u=e[10];let f;return e[11]!==m||e[12]!==u?(f=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,u]}),e[11]=m,e[12]=u,e[13]=f):f=e[13],f}function Ts(t){return t.id}function As(){return W.error("Couldn't reorder home — please try again.")}function Ms(t){const e=T.c(6),{home:s,agents:r,hasSearch:n}=t,[a,l]=A.useState(20);let c;if(e[0]!==r||e[1]!==n||e[2]!==s||e[3]!==a){const o=r.slice(0,a);let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(Ue,{title:"Add to home"}),e[5]=d):d=e[5],c=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[d,r.length===0?i.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:n?"No agents match.":"Every agent is on the home."}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex flex-col gap-1",children:o.map(m=>i.jsx(Ds,{agent:m,home:s},m.id))}),r.length>a&&i.jsxs("button",{type:"button",onClick:()=>l(Os),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-a,")"]})]})]}),e[0]=r,e[1]=n,e[2]=s,e[3]=a,e[4]=c}else c=e[4];return c}function Os(t){return t+20}function Be(t){const e=pe(t.metadata?.ui).filter(a=>!!a.resourceUri).length,s=t.metadata?.ui?.homePrompts,r=Array.isArray(s)?s.length:null,n=[];return e>0&&n.push(`${e} tile${e===1?"":"s"}`),r!==null&&r>0&&n.push(`${r} prompt${r===1?"":"s"}`),r===0&&n.push("prompts off"),n.join(" · ")}function Rs(t){const e=T.c(57),{agent:s,home:r}=t,[n,a]=A.useState(!1);let l;e[0]!==s.id?(l={id:s.id},e[0]=s.id,e[1]=l):l=e[1];const{attributes:c,listeners:o,setNodeRef:d,transform:m,transition:u,isDragging:f}=Ot(l),x=Be(s)||"Quick access";let g;e[2]!==m?(g=Rt.Transform.toString(m),e[2]=m,e[3]=g):g=e[3];const h=f?.5:void 0,p=f?100:void 0;let b;e[4]!==g||e[5]!==h||e[6]!==p||e[7]!==u?(b={transform:g,transition:u,opacity:h,zIndex:p},e[4]=g,e[5]=h,e[6]=p,e[7]=u,e[8]=b):b=e[8];const v=b,w=f&&"shadow-lg";let y;e[9]!==w?(y=q("rounded-lg border border-border bg-card",w),e[9]=w,e[10]=y):y=e[10];const j=`Drag to reorder ${s.title??s.id}`;let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=i.jsx(He,{size:14}),e[11]=N):N=e[11];let S;e[12]!==c||e[13]!==o||e[14]!==j?(S=i.jsx("button",{type:"button",...c,...o,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":j,children:N}),e[12]=c,e[13]=o,e[14]=j,e[15]=S):S=e[15];let k;e[16]===Symbol.for("react.memo_cache_sentinel")?(k=()=>a(Ps),e[16]=k):k=e[16];const C=s.title??s.id;let $;e[17]!==s.icon||e[18]!==C?($=i.jsx(Y,{icon:s.icon,name:C,size:"sm"}),e[17]=s.icon,e[18]=C,e[19]=$):$=e[19];const E=s.title??s.id;let _;e[20]!==E?(_=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:E}),e[20]=E,e[21]=_):_=e[21];let I;e[22]!==x?(I=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:x}),e[22]=x,e[23]=I):I=e[23];let O;e[24]!==_||e[25]!==I?(O=i.jsxs("div",{className:"min-w-0 flex-1",children:[_,I]}),e[24]=_,e[25]=I,e[26]=O):O=e[26];const B=n&&"rotate-180";let z;e[27]!==B?(z=q("shrink-0 text-muted-foreground transition-transform",B),e[27]=B,e[28]=z):z=e[28];let P;e[29]!==z?(P=i.jsx(De,{size:16,className:z}),e[29]=z,e[30]=P):P=e[30];let Q;e[31]!==n||e[32]!==$||e[33]!==O||e[34]!==P?(Q=i.jsxs("button",{type:"button",onClick:k,className:"flex min-w-0 flex-1 items-center gap-2.5 text-left outline-none","aria-expanded":n,children:[$,O,P]}),e[31]=n,e[32]=$,e[33]=O,e[34]=P,e[35]=Q):Q=e[35];let M;e[36]!==s.id||e[37]!==r?(M=()=>r.removeAgent(s.id).catch(zs),e[36]=s.id,e[37]=r,e[38]=M):M=e[38];const F=`Remove ${s.title??s.id} from home`;let D;e[39]===Symbol.for("react.memo_cache_sentinel")?(D=i.jsx(Te,{size:14}),e[39]=D):D=e[39];let R;e[40]!==M||e[41]!==F?(R=i.jsx("button",{type:"button",onClick:M,"aria-label":F,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:D}),e[40]=M,e[41]=F,e[42]=R):R=e[42];let L;e[43]!==S||e[44]!==Q||e[45]!==R?(L=i.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2.5",children:[S,Q,R]}),e[43]=S,e[44]=Q,e[45]=R,e[46]=L):L=e[46];let U;e[47]!==s||e[48]!==n||e[49]!==r?(U=n&&i.jsx(Fe,{agent:s,home:r}),e[47]=s,e[48]=n,e[49]=r,e[50]=U):U=e[50];let G;return e[51]!==d||e[52]!==v||e[53]!==L||e[54]!==U||e[55]!==y?(G=i.jsxs("div",{ref:d,style:v,className:y,children:[L,U]}),e[51]=d,e[52]=v,e[53]=L,e[54]=U,e[55]=y,e[56]=G):G=e[56],G}function zs(){return W.error("Couldn't remove from home — please try again.")}function Ps(t){return!t}function Ds({agent:t,home:e}){const[s,r]=A.useState(!1),[n,a]=A.useState(!1),l=Be(t),c=async()=>{if(!e.atLimit){a(!0);try{await e.addAgent(t.id)}catch{W.error("Couldn't add to home — please try again.")}finally{a(!1)}}};return i.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[i.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[i.jsxs("button",{type:"button",onClick:()=>r(o=>!o),className:"flex min-w-0 flex-1 items-center gap-3 text-left outline-none","aria-expanded":s,children:[i.jsx(Y,{icon:t.icon,name:t.title??t.id,size:"sm"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.title??t.id}),l&&i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:l})]}),i.jsx(De,{size:16,className:q("shrink-0 text-muted-foreground transition-transform",s&&"rotate-180")})]}),i.jsx("button",{type:"button",onClick:c,disabled:n||e.atLimit,"aria-label":"Add to home",title:e.atLimit?`Home is full (${ee}) — 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:n?i.jsx(Ie,{size:12,className:"animate-spin"}):i.jsx(ge,{size:14})})]}),s&&i.jsx(Fe,{agent:t,home:e})]})}function Fe(t){const e=T.c(26),{agent:s,home:r}=t;let n,a,l,c,o,d,m;if(e[0]!==s||e[1]!==r){const p=pe(s.metadata?.ui);let b;e[9]!==s.connections?(b=(s.connections??[]).map(Ls).sort(),e[9]=s.connections,e[10]=b):b=e[10];const v=b;a=s.metadata?.ui?.homePrompts,m="border-t border-border px-3 py-2 flex flex-col gap-3",n=Bs,l=s,c=r,o=v,d=new Set(p.map(Hs)),e[0]=s,e[1]=r,e[2]=n,e[3]=a,e[4]=l,e[5]=c,e[6]=o,e[7]=d,e[8]=m}else n=e[2],a=e[3],l=e[4],c=e[5],o=e[6],d=e[7],m=e[8];let u;e[11]!==n||e[12]!==l||e[13]!==c||e[14]!==o||e[15]!==d?(u=i.jsx(n,{agent:l,home:c,connectionIds:o,pinnedResourceUris:d}),e[11]=n,e[12]=l,e[13]=c,e[14]=o,e[15]=d,e[16]=u):u=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(Us,{}),e[17]=f):f=e[17];const x=a??null;let g;e[18]!==s||e[19]!==r||e[20]!==x?(g=i.jsx(A.Suspense,{fallback:f,children:i.jsx(Qs,{agent:s,home:r,curated:x})}),e[18]=s,e[19]=r,e[20]=x,e[21]=g):g=e[21];let h;return e[22]!==m||e[23]!==u||e[24]!==g?(h=i.jsxs("div",{className:m,children:[u,g]}),e[22]=m,e[23]=u,e[24]=g,e[25]=h):h=e[25],h}function Hs(t){return t.resourceUri}function Ls(t){return t.connection_id}function Us(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[i.jsx(H,{className:"h-8 w-full"}),i.jsx(H,{className:"h-8 w-2/3"})]}),t[0]=e):e=t[0],e}function Bs({agent:t,home:e,connectionIds:s,pinnedResourceUris:r}){const n=es(),{data:a,isLoading:l}=re({queryKey:ne.projectConnectionDetails(t.id,s),enabled:s.length>0,queryFn:async()=>(await Promise.all(s.map(async o=>{try{const{item:d}=await n.call("COLLECTION_CONNECTIONS_GET",{id:o}),m=(d?.tools??[]).flatMap(u=>{const f=Xt(u._meta);return f?[{name:u.name,description:u.description,resourceUri:f}]:[]});return{id:o,title:d?.title??o,icon:d?.icon??null,uiTools:m}}catch{return{id:o,title:o,icon:null,uiTools:[]}}}))).filter(o=>o.uiTools.length>0)});return s.length===0?null:l?i.jsxs("div",{className:"flex flex-col gap-1 py-0.5",children:[i.jsx(H,{className:"h-7 w-full"}),i.jsx(H,{className:"h-7 w-2/3"})]}):!a||a.length===0?null:i.jsx("div",{className:"flex flex-col gap-0.5",children:a.map(c=>c.uiTools.map(o=>i.jsx(Fs,{agent:t,home:e,connection:c,tool:o,isPinned:r.has(o.resourceUri)},`${c.id}:${o.name}`)))})}function Fs({agent:t,home:e,connection:s,tool:r,isPinned:n}){const[a,l]=A.useState(!1),c=async()=>{if(!n&&!e.isOnHome(t.id)&&e.atLimit){W.error(`Home is full (${ee}) — remove an agent first`);return}l(!0);try{const o=pe(t.metadata?.ui),d=n?o.filter(u=>u.resourceUri!==r.resourceUri):[...o,{connectionId:s.id,resourceUri:r.resourceUri}],m={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:d}};await e.saveAgentMetadata(t,m)}catch(o){console.error("[home-tiles] failed to toggle tile",o),W.error("Couldn't update home — please try again.")}finally{l(!1)}};return i.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[i.jsx(Yt,{icon:s.icon,name:s.title,size:"xs"}),i.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:Le(r.name)}),i.jsx(Qe,{isPinned:n,submitting:a,onClick:c,label:n?"Remove from home":"Add to home"})]})}function Qe(t){const e=T.c(11),{isPinned:s,submitting:r,onClick:n,label:a}=t,l=s?"text-muted-foreground hover:bg-destructive/10 hover:text-destructive":"bg-foreground text-background hover:opacity-90";let c;e[0]!==l?(c=q("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]=c):c=e[1];let o;e[2]!==s||e[3]!==r?(o=r?i.jsx(Ie,{size:12,className:"animate-spin"}):s?i.jsx(Nt,{size:14}):i.jsx(ge,{size:14}),e[2]=s,e[3]=r,e[4]=o):o=e[4];let d;return e[5]!==a||e[6]!==n||e[7]!==r||e[8]!==c||e[9]!==o?(d=i.jsx("button",{type:"button",onClick:n,disabled:r,"aria-label":a,title:a,className:c,children:o}),e[5]=a,e[6]=n,e[7]=r,e[8]=c,e[9]=o,e[10]=d):d=e[10],d}function Qs(t){const e=T.c(32),{agent:s,home:r,curated:n}=t,{org:a}=J();let l;e[0]!==s.id||e[1]!==a.id||e[2]!==a.slug?(l={connectionId:s.id,orgId:a.id,orgSlug:a.slug},e[0]=s.id,e[1]=a.id,e[2]=a.slug,e[3]=l):l=e[3];const c=oe(l);let o;e[4]!==s.id||e[5]!==a.id?(o=ne.agentPrompts(a.id,s.id),e[4]=s.id,e[5]=a.id,e[6]=o):o=e[6];let d;e[7]!==c?(d=async()=>{const{prompts:j}=await c.listPrompts();return j.map(Gs)},e[7]=c,e[8]=d):d=e[8];let m;e[9]!==o||e[10]!==d?(m={queryKey:o,queryFn:d,staleTime:3e4,retry:!1},e[9]=o,e[10]=d,e[11]=m):m=e[11];const{data:u,isLoading:f,error:x}=re(m),g=be(a.slug);let h,p;if(e[12]!==s.id||e[13]!==u||e[14]!==g.prompts){let j;e[17]!==s.id?(j=S=>S.agentId===s.id&&S.promptName,e[17]=s.id,e[18]=j):j=e[18],h=g.prompts.filter(j).map(Ks);let N;e[19]!==u?(N=u??[],e[19]=u,e[20]=N):N=e[20],p=[...N];for(const S of h)p.some(k=>k.name===S.name)||p.push(S);e[12]=s.id,e[13]=u,e[14]=g.prompts,e[15]=h,e[16]=p}else h=e[15],p=e[16];if(f&&h.length===0){let j;return e[21]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx(H,{className:"h-7 w-full"}),i.jsx(H,{className:"h-7 w-2/3"})]}),e[21]=j):j=e[21],j}if(x&&h.length===0)return console.error("[home-tiles] listPrompts failed for agent",s.id,x),null;if(p.length===0)return null;let b;e[22]!==n||e[23]!==p?(b=n??p.map(qs),e[22]=n,e[23]=p,e[24]=b):b=e[24];let v;e[25]!==b?(v=new Set(b),e[25]=b,e[26]=v):v=e[26];const w=v;let y;return e[27]!==s||e[28]!==r||e[29]!==p||e[30]!==w?(y=i.jsx("div",{className:"flex flex-col gap-0.5",children:p.map(j=>i.jsx(Vs,{agent:s,home:r,prompt:j,allPromptNames:p.map(Ws),isPinned:w.has(j.name)},j.name))}),e[27]=s,e[28]=r,e[29]=p,e[30]=w,e[31]=y):y=e[31],y}function Ws(t){return t.name}function qs(t){return t.name}function Ks(t){return{name:t.promptName,title:t.title,description:t.description}}function Gs(t){return{name:t.name,title:t.title,description:t.description}}function Vs({agent:t,home:e,prompt:s,allPromptNames:r,isPinned:n}){const[a,l]=A.useState(!1),c=async()=>{if(!n&&!e.isOnHome(t.id)&&e.atLimit){W.error(`Home is full (${ee}) — remove an agent first`);return}l(!0);try{const o=t.metadata?.ui?.homePrompts;let d;Array.isArray(o)?d=n?o.filter(u=>u!==s.name):[...o,s.name]:d=n?r.filter(u=>u!==s.name):r;const m={...t.metadata??{},ui:{...t.metadata?.ui??{},homePrompts:d}};await e.saveAgentMetadata(t,m)}catch(o){console.error("[home-tiles] failed to toggle prompt",o),W.error("Couldn't update home — please try again.")}finally{l(!1)}};return i.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[i.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:s.title??Le(s.name)}),i.jsx(Qe,{isPinned:n,submitting:a,onClick:c,label:n?"Remove from home":"Add to home"})]})}function Js(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"flex flex-col gap-2 p-2",children:Array.from({length:4},Xs)}),t[0]=e):e=t[0],e}function Xs(t,e){return i.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border p-2.5",children:[i.jsx(H,{className:"size-8 rounded-md"}),i.jsxs("div",{className:"flex-1 space-y-1.5",children:[i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"h-2.5 w-1/3"})]})]},e)}const Z=1,We=`home-board.layout.v${Z}`;function qe(t){return`home-board.layout.v${Z}.${t}`}const Ke={version:Z,tiles:{},hidden:[]};function me(t){return!t||t.version!==Z?Ke:{version:Z,tiles:t.tiles??{},hidden:Array.isArray(t.hidden)?t.hidden:[]}}function Zs(t){return Object.keys(t.tiles).length>0||t.hidden.length>0}function Ys(t){try{const e=localStorage.getItem(qe(t));return e?me(JSON.parse(e)):void 0}catch{return}}function Ne(t,e){try{localStorage.setItem(qe(t),JSON.stringify(e))}catch{}}async function Se(t,e){if(!(await fetch(`/api/${t}/kv/${We}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save board layout")}function ei(t){const e=T.c(24),s=he();let r;e[0]!==t?(r=ne.boardLayout(t),e[0]=t,e[1]=r):r=e[1];const n=r;let a;e[2]!==t?(a=Ys(t),e[2]=t,e[3]=a):a=e[3];const l=a;let c;e[4]!==l||e[5]!==t?(c=async()=>{const b=await fetch(`/api/${t}/kv/${We}`);if(b.status===404)return l&&Zs(l)?(await Se(t,l),l):Ke;if(!b.ok)throw new Error("Failed to load board layout");const v=await b.json(),w=me(v.value);return Ne(t,w),w},e[4]=l,e[5]=t,e[6]=c):c=e[6];let o;e[7]!==l||e[8]!==n||e[9]!==c?(o={queryKey:n,queryFn:c,initialData:l,staleTime:0,refetchOnWindowFocus:!1},e[7]=l,e[8]=n,e[9]=c,e[10]=o):o=e[10];const{data:d,isLoading:m}=re(o);let u;e[11]!==t?(u={mutationFn:b=>Se(t,b)},e[11]=t,e[12]=u):u=e[12];const f=dt(u);let x;e[13]!==f||e[14]!==t||e[15]!==s||e[16]!==n?(x=b=>{Ne(t,b),s.setQueryData(n,b),f.mutate(b)},e[13]=f,e[14]=t,e[15]=s,e[16]=n,e[17]=x):x=e[17];const g=x;let h;e[18]!==d?(h=me(d),e[18]=d,e[19]=h):h=e[19];let p;return e[20]!==m||e[21]!==g||e[22]!==h?(p={layout:h,isLoading:m,save:g},e[20]=m,e[21]=g,e[22]=h,e[23]=p):p=e[23],p}const Ge=A.createContext(null);function ti(t){const e=T.c(24),{children:s}=t,{org:r}=J(),n=ei(r.slug),[a,l]=A.useState(!1),[c,o]=A.useState(null);let d;e[0]!==n.layout?(d=()=>{o(n.layout),l(!0)},e[0]=n.layout,e[1]=d):d=e[1];const m=d;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{o(null),l(!1)},e[2]=u):u=e[2];const f=u;let x;e[3]!==c||e[4]!==n?(x=()=>{c&&n.save(c),o(null),l(!1)},e[3]=c,e[4]=n,e[5]=x):x=e[5];const g=x,h=a&&c!==null,p=h?c:n.layout;let b;e[6]!==c||e[7]!==h||e[8]!==n.layout?(b=h?JSON.stringify(c)!==JSON.stringify(n.layout):!1,e[6]=c,e[7]=h,e[8]=n.layout,e[9]=b):b=e[9];const v=b;let w;e[10]!==a||e[11]!==n?(w=S=>{a?o(S):n.save(S)},e[10]=a,e[11]=n,e[12]=w):w=e[12];const y=w;let j;e[13]!==y||e[14]!==m||e[15]!==v||e[16]!==a||e[17]!==p||e[18]!==g||e[19]!==n.isLoading?(j={isEditMode:a,enter:m,cancel:f,save:g,hasChanges:v,layout:p,isLayoutLoading:n.isLoading,commitLayout:y},e[13]=y,e[14]=m,e[15]=v,e[16]=a,e[17]=p,e[18]=g,e[19]=n.isLoading,e[20]=j):j=e[20];let N;return e[21]!==s||e[22]!==j?(N=i.jsx(Ge.Provider,{value:j,children:s}),e[21]=s,e[22]=j,e[23]=N):N=e[23],N}function Ve(){const t=A.useContext(Ge);if(!t)throw new Error("useHomeEdit must be used within a HomeEditProvider");return t}function si({agentId:t}){const{org:e,locator:s}=J(),r=oe({connectionId:t,orgId:e.id,orgSlug:e.slug}),{create:n}=ls(),{setTaskId:a}=Bt(),[l,c]=A.useState(null),[o,d]=A.useState(!1),m=A.useRef(!1),u=async(p,b)=>{if(!r){W.error("MCP client not available");return}if(!m.current){m.current=!0,d(!0);try{const v=await os(r,p.name,b),w={type:"doc",content:[{type:"paragraph",content:[ss({id:p.name,name:is(p.name,ns(p._meta)),metadata:v.messages,char:"/",kind:"prompt",args:b}),{type:"text",text:" "}]}]},y=crypto.randomUUID();as(sessionStorage,s,y,{tiptapDoc:w}),await n({id:y,virtual_mcp_id:t}),a(y,t,{autosend:!0})}catch(v){console.error("[start-thread-from-prompt] failed",v),W.error("Failed to start thread. Please try again.")}finally{m.current=!1,d(!1)}}},f=async p=>{if(!m.current){if(p.arguments&&p.arguments.length>0){c(p);return}await u(p)}},x=async p=>{if(!l)return;const b=l;c(null),await u(b,p)};return{start:f,startBlank:async()=>{if(!m.current){m.current=!0,d(!0);try{const p=crypto.randomUUID();await n({id:p,virtual_mcp_id:t}),a(p,t)}catch(p){console.error("[start-thread-from-prompt] startBlank failed",p),W.error("Failed to start thread. Please try again.")}finally{m.current=!1,d(!1)}}},dialog:i.jsx(ts,{prompt:l,setPrompt:p=>c(p),onSubmit:x}),dialogPrompt:l,starting:o}}const K=4,V=100,_e=12,ii=5,ni={w:2,h:2};class ue extends A.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?i.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-center",children:[i.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-destructive/10 text-destructive",children:i.jsx(mt,{size:16})}),i.jsx("p",{className:"text-sm font-medium text-foreground",children:"This tile crashed"}),i.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 ri(t){const e=T.c(72),{tiles:s,isEditMode:r,renderTile:n,onMove:a,onResize:l,onRemove:c}=t,o=xe(),d=A.useRef(null),[m,u]=A.useState(null),[f,x]=A.useState(null);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={activationConstraint:{distance:4}},e[0]=g):g=e[0];const h=Ae(ie(Oe,g),ie(Me)),p=s.reduce(oi,0),b=r?Math.max(p+2,4):Math.max(p,1);let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=()=>{const M=d.current?.getBoundingClientRect();return M?{cellWidth:M.width/K,cellHeight:V}:null},e[1]=v):v=e[1];const w=v;let y;e[2]===Symbol.for("react.memo_cache_sentinel")?(y=M=>{u(String(M.active.id)),x(w())},e[2]=y):y=e[2];const j=y;let N;e[3]!==f||e[4]!==a||e[5]!==s?(N=M=>{const F=String(M.active.id),D=f??w();if(u(null),x(null),!D||D.cellWidth<=0)return;const R=s.find(G=>G.id===F);if(!R)return;const L=Math.round(M.delta.x/D.cellWidth),U=Math.round(M.delta.y/D.cellHeight);L===0&&U===0||a(F,{x:R.x+L,y:R.y+U})},e[3]=f,e[4]=a,e[5]=s,e[6]=N):N=e[6];const S=N;if(o){let M;if(e[7]!==n||e[8]!==s){let D;e[10]!==n?(D=R=>i.jsx("div",{className:"bg-card card-shadow rounded-2xl overflow-hidden",style:{minHeight:V},children:i.jsx(ue,{children:n(R)})},R.id),e[10]=n,e[11]=D):D=e[11],M=s.map(D),e[7]=n,e[8]=s,e[9]=M}else M=e[9];let F;return e[12]!==M?(F=i.jsx("div",{className:"flex flex-col gap-3 px-4 pb-8",children:M}),e[12]=M,e[13]=F):F=e[13],F}let k,C,$,E,_,I,O,B,z;if(e[14]!==m||e[15]!==f||e[16]!==r||e[17]!==S||e[18]!==c||e[19]!==l||e[20]!==n||e[21]!==h||e[22]!==s||e[23]!==b){const M=m?s.find(X=>X.id===m):null;C=Re,B=h,z=j,$=S;const F=b*V,D=r?V*4:V;let R;e[33]!==F||e[34]!==D?(R={height:F,minHeight:D},e[33]=F,e[34]=D,e[35]=R):R=e[35];let L;e[36]!==r||e[37]!==s||e[38]!==b?(L=r&&i.jsx(li,{rows:b,tiles:s}),e[36]=r,e[37]=s,e[38]=b,e[39]=L):L=e[39];let U;if(e[40]!==m||e[41]!==r||e[42]!==c||e[43]!==l||e[44]!==n||e[45]!==s){let X;e[47]!==m||e[48]!==r||e[49]!==c||e[50]!==l||e[51]!==n?(X=te=>i.jsx(ci,{tile:te,isEditMode:r,isDragging:m===te.id,onResize:l,onRemove:c,children:n(te)},te.id),e[47]=m,e[48]=r,e[49]=c,e[50]=l,e[51]=n,e[52]=X):X=e[52],U=s.map(X),e[40]=m,e[41]=r,e[42]=c,e[43]=l,e[44]=n,e[45]=s,e[46]=U}else U=e[46];e[53]!==R||e[54]!==L||e[55]!==U?(E=i.jsxs("div",{ref:d,className:"relative w-full",style:R,children:[L,U]}),e[53]=R,e[54]=L,e[55]=U,e[56]=E):E=e[56],k=Dt,_=null;const G=M&&f?M.w*f.cellWidth-_e:void 0,le=M&&f?M.h*f.cellHeight-_e:void 0;e[57]!==G||e[58]!==le?(I={width:G,height:le},e[57]=G,e[58]=le,e[59]=I):I=e[59],O=M&&i.jsx("div",{className:"bg-card card-shadow rounded-2xl shadow-2xl ring-2 ring-primary/40 h-full overflow-hidden opacity-95",children:i.jsx(ue,{children:n(M)})}),e[14]=m,e[15]=f,e[16]=r,e[17]=S,e[18]=c,e[19]=l,e[20]=n,e[21]=h,e[22]=s,e[23]=b,e[24]=k,e[25]=C,e[26]=$,e[27]=E,e[28]=_,e[29]=I,e[30]=O,e[31]=B,e[32]=z}else k=e[24],C=e[25],$=e[26],E=e[27],_=e[28],I=e[29],O=e[30],B=e[31],z=e[32];let P;e[60]!==k||e[61]!==_||e[62]!==I||e[63]!==O?(P=i.jsx(k,{dropAnimation:_,style:I,children:O}),e[60]=k,e[61]=_,e[62]=I,e[63]=O,e[64]=P):P=e[64];let Q;return e[65]!==C||e[66]!==$||e[67]!==E||e[68]!==P||e[69]!==B||e[70]!==z?(Q=i.jsxs(C,{sensors:B,onDragStart:z,onDragEnd:$,children:[E,P]}),e[65]=C,e[66]=$,e[67]=E,e[68]=P,e[69]=B,e[70]=z,e[71]=Q):Q=e[71],Q}function oi(t,e){return Math.max(t,e.y+e.h)}function li(t){const e=T.c(7),{rows:s,tiles:r}=t;let n;e[0]!==r?(n=(o,d)=>r.some(m=>o>=m.x&&o<m.x+m.w&&d>=m.y&&d<m.y+m.h),e[0]=r,e[1]=n):n=e[1];const a=n;let l;if(e[2]!==a||e[3]!==s){l=[];for(let o=0;o<s;o++)for(let d=0;d<K;d++)a(d,o)||l.push({x:d,y:o});e[2]=a,e[3]=s,e[4]=l}else l=e[4];let c;return e[5]!==l?(c=i.jsx("div",{className:"absolute inset-0 pointer-events-none",children:l.map(ai)}),e[5]=l,e[6]=c):c=e[6],c}function ai(t){return i.jsx("div",{className:"absolute p-1",style:{left:`${t.x/K*100}%`,top:t.y*V,width:`${1/K*100}%`,height:V},children:i.jsx("div",{className:"h-full w-full rounded-2xl border border-dashed border-border/60"})},`${t.x}-${t.y}`)}function ci(t){const e=T.c(31),{tile:s,isEditMode:r,isDragging:n,onResize:a,onRemove:l,children:c}=t,o=!r;let d;e[0]!==o||e[1]!==s.id?(d={id:s.id,disabled:o},e[0]=o,e[1]=s.id,e[2]=d):d=e[2];const{setNodeRef:m,attributes:u,listeners:f,isDragging:x}=Ht(d),g=`${s.x/K*100}%`,h=`${s.w/K*100}%`,p=s.y*V,b=s.h*V,v=x||n,w=!v&&"transition-[left,top,width,height,opacity] duration-200 ease-out",y=v&&"opacity-30";let j;e[3]!==w||e[4]!==y?(j=q("absolute p-1 will-change-[left,top,width,height,opacity]",w,y),e[3]=w,e[4]=y,e[5]=j):j=e[5];let N;e[6]!==b||e[7]!==g||e[8]!==p||e[9]!==h?(N={left:g,top:p,width:h,height:b},e[6]=b,e[7]=g,e[8]=p,e[9]=h,e[10]=N):N=e[10];const S=r&&"outline outline-1 outline-transparent hover:outline-primary/40";let k;e[11]!==S?(k=q("relative h-full bg-card card-shadow rounded-2xl overflow-hidden",S),e[11]=S,e[12]=k):k=e[12];let C;e[13]!==u||e[14]!==r||e[15]!==f||e[16]!==l||e[17]!==a||e[18]!==s?(C=r&&i.jsxs(i.Fragment,{children:[i.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:i.jsx(He,{size:16})}),i.jsx("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:i.jsx(di,{tile:s,onResize:a,onRemove:l})})]}),e[13]=u,e[14]=r,e[15]=f,e[16]=l,e[17]=a,e[18]=s,e[19]=C):C=e[19];let $;e[20]!==c?($=i.jsx("div",{className:"h-full overflow-hidden",children:i.jsx(ue,{children:c})}),e[20]=c,e[21]=$):$=e[21];let E;e[22]!==$||e[23]!==k||e[24]!==C?(E=i.jsxs("div",{className:k,children:[C,$]}),e[22]=$,e[23]=k,e[24]=C,e[25]=E):E=e[25];let _;return e[26]!==m||e[27]!==E||e[28]!==j||e[29]!==N?(_=i.jsx("div",{ref:m,className:j,style:N,children:E}),e[26]=m,e[27]=E,e[28]=j,e[29]=N,e[30]=_):_=e[30],_}function di(t){const e=T.c(20),{tile:s,onResize:r,onRemove:n}=t,[a,l]=A.useState(!1);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(cs,{asChild:!0,children:i.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:i.jsx(St,{size:16})})}),e[0]=c):c=e[0];let o;e[1]!==r||e[2]!==s.id?(o=p=>{r(s.id,p),l(!1)},e[1]=r,e[2]=s.id,e[3]=o):o=e[3];let d;e[4]!==o||e[5]!==s?(d=i.jsx(mi,{tile:s,onPick:o}),e[4]=o,e[5]=s,e[6]=d):d=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(ds,{}),e[7]=m):m=e[7];let u;e[8]!==n||e[9]!==s.id?(u=()=>n(s.id),e[8]=n,e[9]=s.id,e[10]=u):u=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(hs,{size:14,className:"mr-2"}),e[11]=f):f=e[11];let x;e[12]!==u?(x=i.jsxs(ms,{onSelect:u,className:"text-destructive focus:text-destructive",children:[f,"Remove tile"]}),e[12]=u,e[13]=x):x=e[13];let g;e[14]!==d||e[15]!==x?(g=i.jsxs(us,{align:"end",className:"w-auto",children:[d,m,x]}),e[14]=d,e[15]=x,e[16]=g):g=e[16];let h;return e[17]!==a||e[18]!==g?(h=i.jsxs(fs,{open:a,onOpenChange:l,children:[c,g]}),e[17]=a,e[18]=g,e[19]=h):h=e[19],h}function mi(t){const e=T.c(19),{tile:s,onPick:r}=t,n=s.minW??1,a=s.minH??1,[l,c]=A.useState(null);let o;e[0]!==l||e[1]!==s.h||e[2]!==s.w?(o=l??{w:s.w,h:s.h},e[0]=l,e[1]=s.h,e[2]=s.w,e[3]=o):o=e[3];const d=o;let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx("span",{className:"text-xs text-muted-foreground",children:"Size"}),e[4]=m):m=e[4];let u;e[5]!==d.h||e[6]!==d.w?(u=i.jsxs("div",{className:"mb-2 flex items-center justify-between gap-4",children:[m,i.jsxs("span",{className:"text-xs font-medium tabular-nums",children:[d.w," × ",d.h]})]}),e[5]=d.h,e[6]=d.w,e[7]=u):u=e[7];let f,x;e[8]===Symbol.for("react.memo_cache_sentinel")?(f={gridTemplateColumns:`repeat(${K}, 1.25rem)`},x=()=>c(null),e[8]=f,e[9]=x):(f=e[8],x=e[9]);let g;e[10]!==d.h||e[11]!==d.w||e[12]!==a||e[13]!==n||e[14]!==r?(g=i.jsx("div",{className:"grid w-max gap-1",style:f,onPointerLeave:x,children:Array.from({length:ii},(p,b)=>Array.from({length:K},(v,w)=>{const y=w+1,j=b+1,N=y<n||j<a,S=y<=d.w&&j<=d.h;return i.jsx("button",{type:"button",disabled:N,"aria-label":`${y} by ${j}`,onPointerEnter:()=>c({w:y,h:j}),onClick:()=>r({w:y,h:j}),className:q("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")},`${y}x${j}`)}))}),e[10]=d.h,e[11]=d.w,e[12]=a,e[13]=n,e[14]=r,e[15]=g):g=e[15];let h;return e[16]!==u||e[17]!==g?(h=i.jsxs("div",{className:"px-2 py-1.5",children:[u,g]}),e[16]=u,e[17]=g,e[18]=h):h=e[18],h}function ui(t,e,s){return t.some(r=>e>=r.x&&e<r.x+r.w&&s>=r.y&&s<r.y+r.h)}function fe(t,e,s){for(let r=0;r<100;r++)for(let n=0;n<=K-e;n++){let a=!0;for(let l=0;l<s&&a;l++)for(let c=0;c<e&&a;c++)ui(t,n+c,r+l)&&(a=!1);if(a)return{x:n,y:r}}return{x:0,y:0}}function ae(t,e,s={w:1,h:1}){const r=Math.max(s.w,Math.min(K,t)),n=Math.max(s.h,Math.min(6,e));return{w:r,h:n}}function ce(t,e,s){const r=Math.max(0,Math.min(K-s,t)),n=Math.max(0,e);return{x:r,y:n}}function fi(t,e,s){const r=t.find(o=>o.id===e);if(!r)return t;const n=t.filter(o=>o.id!==e),a=n.find(o=>s.x>=o.x&&s.x<o.x+o.w&&s.y>=o.y&&s.y<o.y+o.h);if(a&&a.w===r.w&&a.h===r.h)return t.map(o=>o.id===e?{...o,x:a.x,y:a.y}:o.id===a.id?{...o,x:r.x,y:r.y}:o);const c=[{...r,x:s.x,y:s.y}];for(const o of n){const d=fe(c,o.w,o.h);c.push({...o,x:d.x,y:d.y})}return c}function hi(t){const e=T.c(35),{layout:s,isLayoutLoading:r,commitLayout:n}=Ve();let a;e[0]!==s.hidden?(a=new Set(s.hidden),e[0]=s.hidden,e[1]=a):a=e[1];const l=a;let c,o;if(e[2]!==t||e[3]!==l||e[4]!==s.tiles){o=[];let v;e[7]!==l?(v=y=>y.pinned||!l.has(y.id),e[7]=l,e[8]=v):v=e[8];const w=t.filter(v);c=new Map;for(const y of t)y.minSize&&c.set(y.id,y.minSize);for(const y of w){const j=s.tiles[y.id];if(!j)continue;const N=c.get(y.id),{w:S,h:k}=ae(j.w,j.h,N),{x:C,y:$}=ce(j.x,j.y,S);o.push({id:y.id,x:C,y:$,w:S,h:k,minW:N?.w,minH:N?.h})}for(const y of w){if(o.some($=>$.id===y.id))continue;const j=y.defaultSize??ni,N=c.get(y.id),{w:S,h:k}=ae(j.w,j.h,N),C=fe(o,S,k);o.push({id:y.id,x:C.x,y:C.y,w:S,h:k,minW:N?.w,minH:N?.h})}e[2]=t,e[3]=l,e[4]=s.tiles,e[5]=c,e[6]=o}else c=e[5],o=e[6];let d;e[9]!==t?(d=new Set(t.map(pi)),e[9]=t,e[10]=d):d=e[10];const m=d;let u;e[11]!==m||e[12]!==n?(u=(v,w)=>{const y={};for(const j of v)y[j.id]={x:j.x,y:j.y,w:j.w,h:j.h};n({version:Z,tiles:y,hidden:w.filter(j=>m.has(j))})},e[11]=m,e[12]=n,e[13]=u):u=e[13];const f=u;let x;e[14]!==o?(x={visible:o},e[14]=o,e[15]=x):x=e[15];let g;e[16]!==f||e[17]!==s||e[18]!==o?(g=(v,w)=>{const y=o.find(S=>S.id===v);if(!y)return;const j=ce(w.x,w.y,y.w);if(j.x===y.x&&j.y===y.y)return;const N=fi(o,v,j);f(N,s.hidden)},e[16]=f,e[17]=s,e[18]=o,e[19]=g):g=e[19];let h;e[20]!==f||e[21]!==s||e[22]!==c||e[23]!==o?(h=(v,w)=>{const y=o.find(E=>E.id===v);if(!y)return;const j=c.get(v),{w:N,h:S}=ae(w.w,w.h,j);if(N===y.w&&S===y.h)return;const k={...y,w:N,h:S,x:ce(y.x,y.y,N).x},C=o.filter(E=>E.id!==v),$=[k];for(const E of C){const _=fe($,E.w,E.h);$.push({...E,x:_.x,y:_.y})}f($,s.hidden)},e[20]=f,e[21]=s,e[22]=c,e[23]=o,e[24]=h):h=e[24];let p;e[25]!==f||e[26]!==s||e[27]!==o?(p=v=>{const w=o.filter(y=>y.id!==v);f(w,Array.from(new Set([...s.hidden,v])))},e[25]=f,e[26]=s,e[27]=o,e[28]=p):p=e[28];let b;return e[29]!==r||e[30]!==x||e[31]!==g||e[32]!==h||e[33]!==p?(b={snapshot:x,isLoading:r,moveTile:g,resizeTile:h,hideTile:p},e[29]=r,e[30]=x,e[31]=g,e[32]=h,e[33]=p,e[34]=b):b=e[34],b}function pi(t){return t.id}const xi={w:2,h:4},gi={w:1,h:2},bi={w:1,h:1};function yi(t){return`prompt:${t.agentId}:${t.promptName||"blank"}`}function vi(t){return`tile:${t.agentId}:${t.resourceUri}`}function ji(t){return t.promptName?t.agentName:t.description}function wi(t){return{name:t.promptName,title:t.title,description:t.description,arguments:t.arguments,_meta:t._meta}}function ye(t){const e=T.c(10);let s;e[0]!==t?(s={agentId:t},e[0]=t,e[1]=s):s=e[1];const{start:r,startBlank:n,dialog:a,starting:l}=si(s);let c;e[2]!==r||e[3]!==n?(c=m=>{if(!m.promptName){n();return}r(wi(m))},e[2]=r,e[3]=n,e[4]=c):c=e[4];const o=c;let d;return e[5]!==a||e[6]!==o||e[7]!==n||e[8]!==l?(d={open:o,startBlank:n,dialog:a,starting:l},e[5]=a,e[6]=o,e[7]=n,e[8]=l,e[9]=d):d=e[9],d}function Ni(t){const e=T.c(32),{entry:s,isEditMode:r}=t,{open:n,dialog:a,starting:l}=ye(s.agentId);let c;e[0]!==s||e[1]!==n?(c=()=>n(s),e[0]=s,e[1]=n,e[2]=c):c=e[2];const o=l||r,d=!r&&"cursor-pointer transition-colors hover:bg-accent/40",m=r&&"cursor-default pl-12",u=l&&"opacity-60";let f;e[3]!==d||e[4]!==m||e[5]!==u?(f=q("group/tile relative flex h-full w-full items-center gap-3 px-4 py-3 text-left bg-card",d,m,u),e[3]=d,e[4]=m,e[5]=u,e[6]=f):f=e[6];let x;e[7]!==s.agentIcon||e[8]!==s.agentName?(x=i.jsx(Y,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[7]=s.agentIcon,e[8]=s.agentName,e[9]=x):x=e[9];let g;e[10]!==s.title?(g=i.jsx("div",{className:"line-clamp-2 text-sm font-medium text-foreground leading-snug",children:s.title}),e[10]=s.title,e[11]=g):g=e[11];let h;e[12]!==s?(h=ji(s),e[12]=s,e[13]=h):h=e[13];let p;e[14]!==h?(p=i.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:h}),e[14]=h,e[15]=p):p=e[15];let b;e[16]!==p||e[17]!==g?(b=i.jsxs("div",{className:"min-w-0 flex-1",children:[g,p]}),e[16]=p,e[17]=g,e[18]=b):b=e[18];let v;e[19]!==r?(v=!r&&i.jsx(rs,{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]=v):v=e[20];let w;e[21]!==l||e[22]!==c||e[23]!==b||e[24]!==v||e[25]!==o||e[26]!==f||e[27]!==x?(w=i.jsxs("button",{type:"button",onClick:c,disabled:o,"aria-busy":l,className:f,children:[x,b,v]}),e[21]=l,e[22]=c,e[23]=b,e[24]=v,e[25]=o,e[26]=f,e[27]=x,e[28]=w):w=e[28];let y;return e[29]!==a||e[30]!==w?(y=i.jsxs(i.Fragment,{children:[w,a]}),e[29]=a,e[30]=w,e[31]=y):y=e[31],y}function Si(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.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},_i)}),t[0]=e):e=t[0],e}function _i(t,e){return i.jsxs("div",{className:"flex w-full items-center gap-3 rounded-2xl bg-card card-shadow px-3 py-2.5",children:[i.jsx(H,{className:"size-10 rounded-xl"}),i.jsxs("div",{className:"flex-1 space-y-1.5",children:[i.jsx(H,{className:"h-3 w-2/3"}),i.jsx(H,{className:"h-2.5 w-1/3"})]})]},`chip-skeleton-${e}`)}function Ci(t){const e=T.c(49),{tile:s,prompts:r,isEditMode:n,tileWidth:a}=t,{org:l}=J(),{open:c,startBlank:o,dialog:d,starting:m}=ye(s.agentId);let u,f,x,g,h;if(e[0]!==n||e[1]!==c||e[2]!==l.id||e[3]!==l.slug||e[4]!==r||e[5]!==o||e[6]!==m||e[7]!==s||e[8]!==a){const v=r.filter(ki);g="flex h-full w-full flex-col gap-3 p-3";let w;e[14]!==o?(w=()=>{o()},e[14]=o,e[15]=w):w=e[15];const y=m||n,j=n&&"pl-10 pr-10";let N;e[16]!==j?(N=q("flex items-center gap-3 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",j),e[16]=j,e[17]=N):N=e[17];let S;e[18]!==s.agentIcon||e[19]!==s.agentName?(S=i.jsx(Y,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[18]=s.agentIcon,e[19]=s.agentName,e[20]=S):S=e[20];let k;e[21]!==s.agentName?(k=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:s.agentName}),e[21]=s.agentName,e[22]=k):k=e[22];const C=n?"Drag to rearrange":"Open chat";let $;e[23]!==C?($=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:C}),e[23]=C,e[24]=$):$=e[24];let E;e[25]!==k||e[26]!==$?(E=i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[k,$]}),e[25]=k,e[26]=$,e[27]=E):E=e[27],e[28]!==m||e[29]!==S||e[30]!==E||e[31]!==w||e[32]!==y||e[33]!==N?(h=i.jsxs("button",{type:"button",onClick:w,disabled:y,"aria-busy":m,className:N,children:[S,E]}),e[28]=m,e[29]=S,e[30]=E,e[31]=w,e[32]=y,e[33]=N,e[34]=h):h=e[34],u="flex min-h-0 flex-1 gap-3 overflow-hidden";let _;e[35]===Symbol.for("react.memo_cache_sentinel")?(_=i.jsx($i,{}),e[35]=_):_=e[35],e[36]!==l.id||e[37]!==l.slug||e[38]!==s?(f=i.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:i.jsx(A.Suspense,{fallback:_,children:i.jsx(Ei,{tile:s,orgId:l.id,orgSlug:l.slug})})}),e[36]=l.id,e[37]=l.slug,e[38]=s,e[39]=f):f=e[39],x=v.length>0&&!n&&a>=2&&i.jsx("div",{className:"flex w-44 shrink-0 flex-col gap-2 overflow-hidden",children:v.map(I=>i.jsx("button",{type:"button",onClick:()=>c(I),disabled:m,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:i.jsx("span",{className:"line-clamp-2",children:I.title})},I.promptName))}),e[0]=n,e[1]=c,e[2]=l.id,e[3]=l.slug,e[4]=r,e[5]=o,e[6]=m,e[7]=s,e[8]=a,e[9]=u,e[10]=f,e[11]=x,e[12]=g,e[13]=h}else u=e[9],f=e[10],x=e[11],g=e[12],h=e[13];let p;e[40]!==u||e[41]!==f||e[42]!==x?(p=i.jsxs("div",{className:u,children:[f,x]}),e[40]=u,e[41]=f,e[42]=x,e[43]=p):p=e[43];let b;return e[44]!==d||e[45]!==g||e[46]!==h||e[47]!==p?(b=i.jsxs("div",{className:g,children:[h,p,d]}),e[44]=d,e[45]=g,e[46]=h,e[47]=p,e[48]=b):b=e[48],b}function ki(t){return!!t.promptName}function Ei(t){const e=T.c(12),{tile:s,orgId:r,orgSlug:n}=t;let a;e[0]!==r||e[1]!==n||e[2]!==s.connectionId?(a={connectionId:s.connectionId,orgId:r,orgSlug:n},e[0]=r,e[1]=n,e[2]=s.connectionId,e[3]=a):a=e[3];const l=oe(a),c=s.minHeight??200,o=s.maxHeight??4e3;let d;return e[4]!==l||e[5]!==r||e[6]!==n||e[7]!==c||e[8]!==o||e[9]!==s.connectionId||e[10]!==s.resourceUri?(d=i.jsx(Zt,{resourceURI:s.resourceUri,orgId:r,orgSlug:n,connectionId:s.connectionId,client:l,displayMode:"fullscreen",minHeight:c,maxHeight:o,className:"h-full"}),e[4]=l,e[5]=r,e[6]=n,e[7]=c,e[8]=o,e[9]=s.connectionId,e[10]=s.resourceUri,e[11]=d):d=e[11],d}function $i(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex h-full w-full flex-col gap-2 p-4",children:[i.jsx(H,{className:"h-3 w-2/3"}),i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"mt-1 h-full w-full rounded-md"})]}),t[0]=e):e=t[0],e}function Ii(t){const e=T.c(14),{icon:s,name:r}=t;let n;e[0]!==s||e[1]!==r?(n=i.jsx(Y,{icon:s,name:r,size:"sm+"}),e[0]=s,e[1]=r,e[2]=n):n=e[2];let a;e[3]!==r?(a=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:r}),e[3]=r,e[4]=a):a=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Loading tile…"}),e[5]=l):l=e[5];let c;e[6]!==a?(c=i.jsxs("div",{className:"min-w-0 flex-1",children:[a,l]}),e[6]=a,e[7]=c):c=e[7];let o;e[8]!==n||e[9]!==c?(o=i.jsxs("div",{className:"flex items-center gap-2.5",children:[n,c]}),e[8]=n,e[9]=c,e[10]=o):o=e[10];let d;e[11]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsxs("div",{className:"flex flex-1 flex-col gap-2 pt-1",children:[i.jsx(H,{className:"h-3 w-3/4"}),i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"h-3 w-2/3"})]}),e[11]=d):d=e[11];let m;return e[12]!==o?(m=i.jsxs("div",{className:"flex h-full w-full flex-col gap-3 p-5 opacity-60",children:[o,d]}),e[12]=o,e[13]=m):m=e[13],m}function Ti(t){const e=T.c(33),{tile:s,prompts:r,isEditMode:n}=t,{open:a,startBlank:l,dialog:c,starting:o}=ye(s.agentId);let d,m,u;if(e[0]!==n||e[1]!==a||e[2]!==r||e[3]!==l||e[4]!==o||e[5]!==s.agentIcon||e[6]!==s.agentName){const x=r.filter(Ai);d="flex h-full w-full flex-col gap-3 p-4";let g;e[10]!==l?(g=()=>{l()},e[10]=l,e[11]=g):g=e[11];const h=o||n,p=n&&"pl-10 pr-10";let b;e[12]!==p?(b=q("flex items-center gap-3 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-ring",p),e[12]=p,e[13]=b):b=e[13];let v;e[14]!==s.agentIcon||e[15]!==s.agentName?(v=i.jsx(Y,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[14]=s.agentIcon,e[15]=s.agentName,e[16]=v):v=e[16];let w;e[17]!==s.agentName?(w=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:s.agentName}),e[17]=s.agentName,e[18]=w):w=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"UI unavailable — open chat"}),e[19]=y):y=e[19];let j;e[20]!==w?(j=i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[w,y]}),e[20]=w,e[21]=j):j=e[21],e[22]!==j||e[23]!==g||e[24]!==h||e[25]!==b||e[26]!==v?(m=i.jsxs("button",{type:"button",onClick:g,disabled:h,className:b,children:[v,j]}),e[22]=j,e[23]=g,e[24]=h,e[25]=b,e[26]=v,e[27]=m):m=e[27],u=x.length>0&&!n&&i.jsx("div",{className:"grid grid-cols-1 gap-2 overflow-hidden sm:grid-cols-2",children:x.map(N=>i.jsx("button",{type:"button",onClick:()=>!n&&a(N),disabled:o,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:i.jsx("span",{className:"line-clamp-2",children:N.title})},N.promptName))}),e[0]=n,e[1]=a,e[2]=r,e[3]=l,e[4]=o,e[5]=s.agentIcon,e[6]=s.agentName,e[7]=d,e[8]=m,e[9]=u}else d=e[7],m=e[8],u=e[9];let f;return e[28]!==c||e[29]!==d||e[30]!==m||e[31]!==u?(f=i.jsxs("div",{className:d,children:[m,u,c]}),e[28]=c,e[29]=d,e[30]=m,e[31]=u,e[32]=f):f=e[32],f}function Ai(t){return!!t.promptName}function Je(t){const e=T.c(36),{isEditMode:s}=t,{org:r}=J(),{isLoading:n,prompts:a,tiles:l}=be(r.slug),c=ze()?.ids??[];let o;e[0]!==c?(o=new Set(c),e[0]=c,e[1]=o):o=e[1];const d=o,m=Pe();let u;e[2]!==l?(u=new Set(l.map(Pi)),e[2]=l,e[3]=u):u=e[3];const f=u;let x;if(e[4]!==a){x=new Map;for(const _ of a){const I=x.get(_.agentId);I?I.push(_):x.set(_.agentId,[_])}e[4]=a,e[5]=x}else x=e[5];let g;if(e[6]!==a||e[7]!==f||e[8]!==l){let _;e[10]!==f?(_=O=>!f.has(O.agentId),e[10]=f,e[11]=_):_=e[11];const I=a.filter(_);g=[...l.map(zi),...I.map(Ri)],e[6]=a,e[7]=f,e[8]=l,e[9]=g}else g=e[9];const h=g;let p;e[12]!==h?(p=new Map(h.map(Oi)),e[12]=h,e[13]=p):p=e[13];const b=p;let v;e[14]!==h||e[15]!==d?(v=h.map(_=>({id:_.id,defaultSize:_.kind==="tile"?xi:bi,minSize:_.kind==="tile"?gi:void 0,pinned:d.has(_.data.agentId)})),e[14]=h,e[15]=d,e[16]=v):v=e[16];const w=hi(v);let y;e[17]!==m?(y=_=>{m.apply(I=>I.filter(O=>O!==_)).catch(Mi)},e[17]=m,e[18]=y):y=e[18];const j=y;let N;e[19]!==b||e[20]!==w||e[21]!==d||e[22]!==j?(N=_=>{const I=b.get(_);I&&d.has(I.data.agentId)?j(I.data.agentId):w.hideTile(_)},e[19]=b,e[20]=w,e[21]=d,e[22]=j,e[23]=N):N=e[23];const S=N;let k;e[24]!==b||e[25]!==s||e[26]!==x?(k=_=>{const I=b.get(_.id);if(!I)return null;if(I.kind==="tile"){const O=x.get(I.data.agentId)??[];return i.jsx(ut,{fallback:i.jsx(Ti,{tile:I.data,prompts:O,isEditMode:s}),children:i.jsx(A.Suspense,{fallback:i.jsx(Ii,{icon:I.data.agentIcon,name:I.data.agentName}),children:i.jsx(Ci,{tile:I.data,prompts:O,isEditMode:s,tileWidth:_.w})})})}return i.jsx(Ni,{entry:I.data,isEditMode:s})},e[24]=b,e[25]=s,e[26]=x,e[27]=k):k=e[27];const C=k;if(n||w.isLoading){let _;return e[28]===Symbol.for("react.memo_cache_sentinel")?(_=i.jsx(Si,{}),e[28]=_):_=e[28],_}if(w.snapshot.visible.length===0&&!s)return null;let E;return e[29]!==s||e[30]!==w.moveTile||e[31]!==w.resizeTile||e[32]!==w.snapshot.visible||e[33]!==S||e[34]!==C?(E=i.jsx("div",{className:"mt-4 flex w-full max-w-7xl flex-col gap-4",children:i.jsx(ri,{tiles:w.snapshot.visible,isEditMode:s,renderTile:C,onMove:w.moveTile,onResize:w.resizeTile,onRemove:S})}),e[29]=s,e[30]=w.moveTile,e[31]=w.resizeTile,e[32]=w.snapshot.visible,e[33]=S,e[34]=C,e[35]=E):E=e[35],E}function Mi(){return W.error("Couldn't remove from home — please try again.")}function Oi(t){return[t.id,t]}function Ri(t){return{kind:"prompt",id:yi(t),data:t}}function zi(t){return{kind:"tile",id:vi(t),data:t}}function Pi(t){return t.agentId}function Di(t){const e=T.c(2),{prompts:s,tiles:r}=be(t),n=r.length>0||s.length>0;let a;return e[0]!==n?(a={hasVisibleTiles:n},e[0]=n,e[1]=a):a=e[1],a}const Ce=420,ke=305;function Xe(){const t=T.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.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:Ce}}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=i.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:Ce}}),t[1]=s):s=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=i.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:ke}}),t[2]=r):r=t[2];let n;return t[3]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 overflow-hidden",children:[e,s,r,i.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:ke}})]}),t[3]=n):n=t[3],n}function Ee(){const t=T.c(33),{data:e}=ft.useSession(),{org:s}=J(),r=xe(),n=Et(),{selectedVirtualMcp:a}=$t();let l;t[0]!==s.id?(l=pt(s.id),t[0]=s.id,t[1]=l):l=t[1];const o=a??l;let d;t[2]!==s.slug?(d=Ft(s.slug),t[2]=s.slug,t[3]=d):d=t[3],re(d);let m;t[4]!==s.id||t[5]!==s.slug?(m={connectionId:xt,orgId:s.id,orgSlug:s.slug},t[4]=s.id,t[5]=s.slug,t[6]=m):m=t[6];const u=oe(m);let f;t[7]!==s.id||t[8]!==u?(f=ps(u,s.id),t[7]=s.id,t[8]=u,t[9]=f):f=t[9];let x;t[10]!==s.id||t[11]!==u?(x=Ut(u,s.id),t[10]=s.id,t[11]=u,t[12]=x):x=t[12];let g;t[13]!==o.id||t[14]!==s.id||t[15]!==u?(g=yt(s.id,o.id,u),t[13]=o.id,t[14]=s.id,t[15]=u,t[16]=g):g=t[16];let h;t[17]!==f||t[18]!==x||t[19]!==g?(h={queries:[f,x,g]},t[17]=f,t[18]=x,t[19]=g,t[20]=h):h=t[20],js(h);const p=xs(),b=vt(o.id),{hasDecoKey:v,isZeroBalance:w,isInitialFreeCredit:y,balanceDollars:j,hasOnlyDecoProvider:N}=Lt(),{hasVisibleTiles:S}=Di(s.slug),k=Ct(b?.metadata);if(p.length===0&&!(k&&kt(n))){let P;return t[21]===Symbol.for("react.memo_cache_sentinel")?(P=i.jsx("div",{className:"flex-1 overflow-y-auto",children:i.jsx("div",{className:"min-h-full flex items-center justify-center px-4 py-10",children:i.jsx(It,{})})}),t[21]=P):P=t[21],P}let $;t[22]!==e?.user?.name?($=e?.user?.name?.split(" ")[0]||"there",t[22]=e?.user?.name,t[23]=$):$=t[23];const E=$,_=v&&y&&j!=null,I=v&&w&&N;let O;t[24]!==j||t[25]!==_||t[26]!==I?(O=_?i.jsx(se.CreditsEyebrow,{balanceDollars:j}):I?i.jsx(se.NoCreditsEyebrow,{}):null,t[24]=j,t[25]=_,t[26]=I,t[27]=O):O=t[27];const B=O;let z;return t[28]!==B||t[29]!==S||t[30]!==r||t[31]!==E?(z=i.jsx(ti,{children:r?i.jsx(Hi,{eyebrow:B,userName:E}):i.jsx(Li,{eyebrow:B,userName:E,hasVisibleTiles:S})}),t[28]=B,t[29]=S,t[30]=r,t[31]=E,t[32]=z):z=t[32],z}function Hi(t){const e=T.c(12),{eyebrow:s,userName:r}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(Xe,{}),e[0]=n):n=e[0];let a;e[1]!==s?(a=s&&i.jsx("div",{className:"mb-4",children:s}),e[1]=s,e[2]=a):a=e[2];let l;e[3]!==r?(l=i.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 c;e[5]!==a||e[6]!==l?(c=i.jsxs("div",{className:"relative flex flex-col items-center justify-center w-full pt-28 pb-8 px-4",children:[a,l]}),e[5]=a,e[6]=l,e[7]=c):c=e[7];let o;e[8]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx("div",{className:"relative w-full flex flex-col gap-4 pb-8 px-4",children:i.jsx(se.Input,{showConnectionsBanner:!0})}),e[8]=o):o=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx("div",{className:"relative w-full px-4 pb-8",children:i.jsx(Je,{isEditMode:!1})}),e[9]=d):d=e[9];let m;return e[10]!==c?(m=i.jsxs("div",{className:"flex-1 relative flex flex-col items-center overflow-y-auto",children:[n,c,o,d]}),e[10]=c,e[11]=m):m=e[11],m}function Li(t){const e=T.c(32),{eyebrow:s,userName:r,hasVisibleTiles:n}=t,{isEditMode:a,enter:l,save:c,cancel:o,hasChanges:d}=Ve(),[m,u]=A.useState(!1);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),e[0]=f):f=e[0];let x;e[1]!==o||e[2]!==l||e[3]!==d||e[4]!==a||e[5]!==c?(x=i.jsx(gs.Right,{children:i.jsx(Ui,{isEditMode:a,hasChanges:d,onEnter:l,onSave:c,onCancel:o,onAddTile:f})}),e[1]=o,e[2]=l,e[3]=d,e[4]=a,e[5]=c,e[6]=x):x=e[6];let g;e[7]!==m?(g=i.jsx(ws,{open:m,onOpenChange:u}),e[7]=m,e[8]=g):g=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=i.jsx(Xe,{}),e[9]=h):h=e[9];const p=n||a?"pt-32":"flex-1 justify-center";let b;e[10]!==p?(b=q("relative flex flex-col items-center px-10 pb-4",p),e[10]=p,e[11]=b):b=e[11];let v;e[12]!==s?(v=s&&i.jsx("div",{className:"mb-4",children:s}),e[12]=s,e[13]=v):v=e[13];let w;e[14]!==r?(w=i.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 y;e[16]!==v||e[17]!==w?(y=i.jsxs("div",{className:"text-center mb-10",children:[v,w]}),e[16]=v,e[17]=w,e[18]=y):y=e[18];let j;e[19]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsxs("div",{className:"relative w-full",children:[i.jsx(Bi,{}),i.jsx(se.Input,{showConnectionsBanner:!0})]}),e[19]=j):j=e[19];let N;e[20]!==y?(N=i.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[y,j]}),e[20]=y,e[21]=N):N=e[21];let S;e[22]!==a?(S=i.jsx("div",{className:"relative w-full mt-10 mx-auto max-w-[1280px] px-2 pb-16",children:i.jsx(Je,{isEditMode:a})}),e[22]=a,e[23]=S):S=e[23];let k;e[24]!==N||e[25]!==S||e[26]!==b?(k=i.jsxs("div",{className:"flex-1 relative flex flex-col min-h-0",children:[h,i.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:i.jsxs("div",{className:b,children:[N,S]})})]}),e[24]=N,e[25]=S,e[26]=b,e[27]=k):k=e[27];let C;return e[28]!==k||e[29]!==x||e[30]!==g?(C=i.jsxs(i.Fragment,{children:[x,g,k]}),e[28]=k,e[29]=x,e[30]=g,e[31]=C):C=e[31],C}function Ui(t){const e=T.c(17),{isEditMode:s,hasChanges:r,onEnter:n,onSave:a,onCancel:l,onAddTile:c}=t;if(s){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(ge,{size:14}),e[0]=m):m=e[0];let u;e[1]!==c?(u=i.jsxs("button",{type:"button",onClick:c,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:[m,"Add tile"]}),e[1]=c,e[2]=u):u=e[2];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(Te,{size:14}),e[3]=f):f=e[3];let x;e[4]!==l?(x=i.jsxs(je,{size:"sm",variant:"ghost",onClick:l,className:"gap-1.5 h-7 text-xs",children:[f,"Cancel"]}),e[4]=l,e[5]=x):x=e[5];const g=!r;let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=i.jsx(jt,{size:14}),e[6]=h):h=e[6];let p;e[7]!==a||e[8]!==g?(p=i.jsxs(je,{size:"sm",onClick:a,disabled:g,className:"gap-1.5 h-7 text-xs",children:[h,"Save"]}),e[7]=a,e[8]=g,e[9]=p):p=e[9];let b;return e[10]!==u||e[11]!==x||e[12]!==p?(b=i.jsxs(i.Fragment,{children:[u,x,p]}),e[10]=u,e[11]=x,e[12]=p,e[13]=b):b=e[13],b}let o;e[14]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(_t,{size:14}),e[14]=o):o=e[14];let d;return e[15]!==n?(d=i.jsxs("button",{type:"button",onClick:n,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:[o,"Customize"]}),e[15]=n,e[16]=d):d=e[16],d}function Bi(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.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 Jr(){const t=T.c(2);if(xe()){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:i.jsx(Ee,{})}),t[0]=r):r=t[0],r}let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("div",{className:"flex-1 min-h-0 pb-1 pr-1 pl-0 pt-0",children:i.jsx("div",{className:"h-full p-0.5 pt-0.25",children:i.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:i.jsx(Ee,{})})})}),t[1]=s):s=t[1],s}export{Jr as default};
|
|
1
|
+
import{ao as Ze,ap as de,aq as Ye,ar as et,as as $e,F as he,at as tt,au as st,r as A,av as it,aw as nt,ax as rt,ay as ot,az as ve,aA as lt,aB as at,aC as ct,e as T,j as i,p as J,c as q,l as Ie,aD as pe,n as W,K as ne,m as re,a as dt,s as mt,E as ut,b as ft,B as je}from"./index-DnIoj8fl.js";import{u as xe}from"./tooltip-DG-C65pd.js";import{i as ht,u as oe,g as pt,a as xt}from"./use-mcp-client-DAanazcB.js";import{a as gt,b as bt,v as yt,u as vt}from"./use-virtual-mcp-B4MbUdTW.js";import{i as jt}from"./Check-C_31_MJb.js";import{_ as wt,A as Y,a0 as Nt,v as St,c as _t}from"./agent-icon-C4vLfyZT.js";import{s as ge}from"./Plus-CW5uSNYz.js";import{i as Te}from"./X-Zx6WnCka.js";import{b as Ct,h as kt,C as se}from"./agent-capabilities-DbrB1URH.js";import{u as Et,c as $t}from"./chat-context-DK-AWUQz.js";import{N as It}from"./agent-icons-BaxWTu1S.js";import{a as Ae,b as ie,K as Me,P as Oe,D as Re,c as Tt,S as At,v as Mt,d as Ot,C as Rt,s as zt,e as Pt,f as Dt,h as Ht,u as Lt}from"./sortable.esm-C7P-vU6-.js";import{u as ze,a as Pe,o as Ut}from"./use-organization-settings-BDQcymx3.js";import{c as be,u as Bt,h as Ft}from"./shell-layout-Cgwg5QF3.js";import{I as Qt}from"./input-kFc4cqln.js";import{S as Wt}from"./scroll-area-DXdZCfi_.js";import{S as qt,c as Kt,d as Gt,a as Vt,b as Jt}from"./sheet-B3GYGLhe.js";import{S as H}from"./skeleton-CyRCN25X.js";import{t as De}from"./ChevronDown-ciuU2nWp.js";import{d as He}from"./ZoomOut-C-DjvL5K.js";import{g as Xt,M as Zt}from"./types-7_L4W6Tu.js";import{I as Yt}from"./integration-icon-D3EQp4Fu.js";import{u as es}from"./studio-tools-CYvl10tJ.js";import{t as Le,P as ts,e as ss,s as is,g as ns}from"./pair-CC2q5WhY.js";import{a as rs}from"./XCircle-BI7HvisP.js";import{g as os}from"./use-mcp-prompts-BJhG10VU.js";import{u as ls,w as as}from"./tab-id-DiaWi79N.js";import{a as cs,g as ds,c as ms,b as us,D as fs}from"./dropdown-menu-DOlfrN75.js";import{s as hs}from"./Trash01-D5mmvxxB.js";import{a as ps,u as xs}from"./use-ai-providers-C3HTrKhd.js";import{a as gs}from"./toolbar-WIS1-2Sy.js";import"./auth-jf8Ueqtd.js";import"./use-collections-DjJTRpo_.js";import"./AlertCircle-DkwUf9y1.js";import"./Tool01-B8aRmzPo.js";import"./SwitchHorizontal01-a-r60L2U.js";import"./RefreshCcw01-CWaUwErM.js";import"./ArrowUpRight-BUkBkD3O.js";import"./ZapSquare-BlkUA5sB.js";import"./Users03-59Bl-ju-.js";import"./CheckCircle-Cpbk7Z8F.js";import"./ChevronLeft-ZCv3UA1e.js";import"./ChevronRight-CFv-fKpX.js";import"./ChevronUp-C64rGI06.js";import"./DotsVertical-Cv0q4Ifl.js";import"./Container-BNV-9MJ8.js";import"./Eye-BWJG0owY.js";import"./Globe01-BOlA5Q_4.js";import"./FilterLines-B1BriWf_.js";import"./Star01-Dw_jqiQj.js";import"./Palette-DqVojGBm.js";import"./HardDrive-DHZcIBpx.js";import"./Stars02-CyyQqj9H.js";import"./Key01-5jFctNvh.js";import"./LayoutLeft-DbIVXyve.js";import"./LinkExternal01-CqMwbx5t.js";import"./Monitor01-gHJrCrOh.js";import"./Sun-DjmglJiH.js";import"./Play-BXDltgp7.js";import"./SearchMd-Bz4Ykghd.js";import"./Settings02-DLDnTjHy.js";import"./Shield01-BIILGcyJ.js";import"./Stars01-EGK20_72.js";import"./Upload01-CYVliRf6.js";import"./User01-igKL-FIP.js";import"./Users01-DGPeGDAl.js";import"./XClose-knQz_HAN.js";import"./Zap-CCChCiD-.js";import"./spinner-B62HtwxP.js";import"./dialog-DPVJEPrK.js";import"./drawer-BXyUyCQL.js";import"./collection-search-jOlxOkeZ.js";import"./form-EYtxKS6a.js";import"./label-Bvw0Ied9.js";import"./select-B_xVBVbm.js";import"./tabs-DNIUI4W6.js";import"./toggle-group-BgDlmAc0.js";import"./connect-desktop-dialog-DVqHifor.js";import"./popover-DFBV-kft.js";import"./command-14UC_LgG.js";import"./index-COo7MQNq.js";import"./useInfiniteQuery-Dal3RT3l.js";import"./use-infinite-scroll-HMRo8z7S.js";import"./index-D2JLfz42.js";import"./question-004-sINsf4GQ.js";import"./checkbox-DUa9wb8T.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-DdLkUzB6.js";import"./settings-section-BTddWHA-.js";import"./card-DP32GBOf.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-W6kS50Xm.js";import"./use-registry-connections-Btr8vraI.js";import"./use-connection-DUYQMDLQ.js";import"./extract-connection-data-DqaTmzNL.js";import"./generate-id-BlA-3dpa.js";import"./collections-xWz9Ka4y.js";import"./collection-tabs-DvXat67P.js";import"./badge-CKyeE-oo.js";import"./textarea-BuPx5SDQ.js";import"./connection-form-helpers-jyOtcSIt.js";import"./useSuspenseInfiniteQuery-CqnU8D2I.js";import"./mcp-oauth-jiIVtUUC.js";import"./required-auth-layout-DVQqpR9U.js";import"./useRouterState-DuGUZA7B.js";import"./use-org-sso-C3JjHGLM.js";import"./use-clock-tick-CwR4C3CJ.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-9rW5ZwZw.js";import"./file-type-icon-D93vAYh4.js";import"./content-blocks-o63cs2vh.js";import"./use-navigate-to-agent-Cvb4b2dj.js";import"./watch-sse-pool-BVVVT94i.js";import"./decopilot-sse-pool-CwSrVgbm.js";function we(t,e){const s=new Set(e);return t.filter(r=>!s.has(r))}function bs(t,e,s){const r=t.slice(0);return r[e]=s,r}var ys=class extends Ze{#n;#e;#r;#i;#t;#s;#o;#l;#a;#c=[];constructor(t,e,s){super(),this.#n=t,this.#i=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.#i=e,de.batch(()=>{const s=this.#t,r=this.#u(this.#r);r.forEach(m=>m.observer.setOptions(m.defaultedQueryOptions));const n=r.map(m=>m.observer),a=n.map(m=>m.getCurrentResult()),l=s.length!==n.length,c=n.some((m,u)=>m!==s[u]),o=l||c,d=o?!0:a.some((m,u)=>{const f=this.#e[u];return!f||!Ye(m,f)});!o&&!d||(o&&(this.#c=r,this.#t=n),this.#e=a,this.hasListeners()&&(o&&(we(s,n).forEach(m=>{m.destroy()}),we(n,s).forEach(m=>{m.subscribe(u=>{this.#f(m,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(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),n=s.map(a=>a.defaultedQueryOptions.queryHash);return[r,a=>this.#m(a??r,e,n),()=>this.#d(r,s)]}#d(t,e){return e.map((s,r)=>{const n=t[r];return s.defaultedQueryOptions.notifyOnChangeProps?n:s.observer.trackResult(n,a=>{e.forEach(l=>{l.observer.trackProp(a)})})})}#m(t,e,s){if(e){const r=this.#a,n=s!==void 0&&r!==void 0&&(r.length!==s.length||s.some((a,l)=>a!==r[l]));return(!this.#s||this.#e!==this.#l||n||e!==this.#o)&&(this.#o=e,this.#l=this.#e,s!==void 0&&(this.#a=s),this.#s=et(this.#s,e(t))),this.#s}return t}#p(){return this.#i?.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 n=r.options.queryHash;if(!n)return;const a=e.get(n);a?a.push(r):e.set(n,[r])});const s=[];return t.forEach(r=>{const n=this.#n.defaultQueryOptions(r),l=e.get(n.queryHash)?.shift()??new $e(this.#n,n);s.push({defaultedQueryOptions:n,observer:l})}),s}#f(t,e){const s=this.#t.indexOf(t);s!==-1&&(this.#e=bs(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.#i?.combine);(e||s!==r)&&de.batch(()=>{this.listeners.forEach(n=>{n(this.#e)})})}}};function vs({queries:t,...e},s){const r=he(s),n=tt(),a=st(),l=A.useMemo(()=>t.map(h=>{const p=r.defaultQueryOptions(h);return p._optimisticResults=n?"isRestoring":"optimistic",p}),[t,r,n]);l.forEach(h=>{it(h);const p=r.getQueryCache().get(h.queryHash);nt(h,a,p)}),rt(a);const[c]=A.useState(()=>new ys(r,l,e)),[o,d,m]=c.getOptimisticResult(l,e.combine),u=!n&&e.subscribed!==!1;A.useSyncExternalStore(A.useCallback(h=>u?c.subscribe(de.batchCalls(h)):ot,[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),A.useEffect(()=>{c.setQueries(l,e)},[l,e,c]);const x=o.some((h,p)=>ve(l[p],h))?o.flatMap((h,p)=>{const b=l[p];if(b&&ve(b,h)){const v=new $e(r,b);return lt(b,v,a)}return[]}):[];if(x.length>0)throw Promise.all(x);const g=o.find((h,p)=>{const b=l[p];return b&&at({result:h,errorResetBoundary:a,throwOnError:b.throwOnError,query:r.getQueryCache().get(b.queryHash),suspense:b.suspense})});if(g?.error)throw g.error;return d(m())}function js(t,e){return vs({...t,queries:t.queries.map(s=>({...s,suspense:!0,throwOnError:ct,enabled:!0,placeholderData:void 0}))},e)}const ee=8;function ws(t){const e=T.c(16),{open:s,onOpenChange:r}=t,[n,a]=A.useState("");let l,c;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(qt,{children:"Manage home"}),c=i.jsx(Kt,{children:"Add agents to the home board and pin their interactive UIs or prompts."}),e[0]=l,e[1]=c):(l=e[0],c=e[1]);let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(wt,{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]=o):o=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=h=>a(h.target.value),e[3]=d):d=e[3];let m;e[4]!==n?(m=i.jsxs(Gt,{className:"px-5 py-4 border-b border-border",children:[l,c,i.jsxs("div",{className:"relative mt-3",children:[o,i.jsx(Qt,{value:n,onChange:d,placeholder:"Search agents…",className:"pl-8 h-8 text-sm"})]})]}),e[4]=n,e[5]=m):m=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(Js,{}),e[6]=u):u=e[6];let f;e[7]!==n?(f=i.jsx(Wt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:i.jsx("div",{className:"p-3 flex flex-col gap-4",children:i.jsx(A.Suspense,{fallback:u,children:i.jsx(Ss,{search:n})})})}),e[7]=n,e[8]=f):f=e[8];let x;e[9]!==m||e[10]!==f?(x=i.jsxs(Vt,{side:"right",className:"w-full sm:max-w-md p-0 flex flex-col",children:[m,f]}),e[9]=m,e[10]=f,e[11]=x):x=e[11];let g;return e[12]!==r||e[13]!==s||e[14]!==x?(g=i.jsx(Jt,{open:s,onOpenChange:r,children:x}),e[12]=r,e[13]=s,e[14]=x,e[15]=g):g=e[15],g}function Ns(t){const e=T.c(32),{org:s}=J(),r=ze();let n;e[0]!==r?.ids?(n=r?.ids??[],e[0]=r?.ids,e[1]=n):n=e[1];const a=n,l=Pe(),c=bt(),o=he();let d;e[2]!==s||e[3]!==o?(d=()=>o.refetchQueries({queryKey:ne.homeNextActions(s.slug),type:"active"}),e[2]=s,e[3]=o,e[4]=d):d=e[4];const m=d;let u;e[5]!==a?(u=C=>a.includes(C),e[5]=a,e[6]=u):u=e[6];const f=u;let x;e[7]!==a||e[8]!==t?(x=t?a.filter(C=>t.has(C)).length:a.length,e[7]=a,e[8]=t,e[9]=x):x=e[9];const h=x>=ee;let p;e[10]!==h||e[11]!==f||e[12]!==l?(p=C=>f(C)||h?Promise.resolve():l.apply($=>$.includes(C)?null:[...$,C]),e[10]=h,e[11]=f,e[12]=l,e[13]=p):p=e[13];const b=p;let v;e[14]!==l?(v=C=>l.apply($=>$.filter(E=>E!==C)),e[14]=l,e[15]=v):v=e[15];const w=v;let y;e[16]!==l?(y=C=>l.apply(()=>C),e[16]=l,e[17]=y):y=e[17];const j=y;let N;e[18]!==c||e[19]!==h||e[20]!==f||e[21]!==m||e[22]!==l?(N=async(C,$)=>{await c.update.mutateAsync({id:C.id,data:{metadata:$}}),!f(C.id)&&!h&&await l.apply(E=>E.includes(C.id)?null:[...E,C.id]),await m()},e[18]=c,e[19]=h,e[20]=f,e[21]=m,e[22]=l,e[23]=N):N=e[23];const S=N;let k;return e[24]!==b||e[25]!==h||e[26]!==a||e[27]!==f||e[28]!==w||e[29]!==j||e[30]!==S?(k={homeIds:a,isOnHome:f,atLimit:h,addAgent:b,removeAgent:w,reorder:j,saveAgentMetadata:S},e[24]=b,e[25]=h,e[26]=a,e[27]=f,e[28]=w,e[29]=j,e[30]=S,e[31]=k):k=e[31],k}function Ss(t){const e=T.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 n=gt(r);let a;e[1]!==n?(a=new Set(n.map($s)),e[1]=n,e[2]=a):a=e[2];const l=Ns(a);let c,o,d;if(e[3]!==n||e[4]!==l||e[5]!==s){const h=new Map(n.map(Es));c=s.trim().toLowerCase();const p=v=>!c||v.title?.toLowerCase().includes(c);o=l.homeIds.map(v=>h.get(v)).filter(ks).filter(p);let b;e[9]!==l?(b=v=>!l.isOnHome(v.id),e[9]=l,e[10]=b):b=e[10],d=n.filter(Cs).filter(b).filter(p).sort(_s),e[3]=n,e[4]=l,e[5]=s,e[6]=c,e[7]=o,e[8]=d}else c=e[6],o=e[7],d=e[8];const m=d;let u;e[11]!==l||e[12]!==o?(u=i.jsx(Is,{home:l,agents:o}),e[11]=l,e[12]=o,e[13]=u):u=e[13];const f=!!c;let x;e[14]!==m||e[15]!==l||e[16]!==f?(x=i.jsx(Ms,{home:l,agents:m,hasSearch:f}),e[14]=m,e[15]=l,e[16]=f,e[17]=x):x=e[17];let g;return e[18]!==u||e[19]!==x?(g=i.jsxs(i.Fragment,{children:[u,x]}),e[18]=u,e[19]=x,e[20]=g):g=e[20],g}function _s(t,e){return(t.title??"").localeCompare(e.title??"")}function Cs(t){return t.id&&!ht(t.id)}function ks(t){return!!t}function Es(t){return[t.id,t]}function $s(t){return t.id}function Ue(t){const e=T.c(7),{title:s,hint:r}=t;let n;e[0]!==s?(n=i.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:s}),e[0]=s,e[1]=n):n=e[1];let a;e[2]!==r?(a=r&&i.jsx("span",{className:"text-xs text-muted-foreground",children:r}),e[2]=r,e[3]=a):a=e[3];let l;return e[4]!==n||e[5]!==a?(l=i.jsxs("div",{className:"flex items-center justify-between px-1",children:[n,a]}),e[4]=n,e[5]=a,e[6]=l):l=e[6],l}function Is(t){const e=T.c(14),{home:s,agents:r}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={activationConstraint:{distance:5}},e[0]=n):n=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={coordinateGetter:zt},e[1]=a):a=e[1];const l=Ae(ie(Oe,n),ie(Me,a));let c;e[2]!==s?(c=x=>{const{active:g,over:h}=x;if(!h||g.id===h.id)return;const p=s.homeIds,b=p.indexOf(g.id),v=p.indexOf(h.id);b===-1||v===-1||s.reorder(Pt([...p],b,v)).catch(As)},e[2]=s,e[3]=c):c=e[3];const o=c,d=`${s.homeIds.length}/${ee}`;let m;e[4]!==d?(m=i.jsx(Ue,{title:"On home",hint:d}),e[4]=d,e[5]=m):m=e[5];let u;e[6]!==r||e[7]!==o||e[8]!==s||e[9]!==l?(u=r.length===0?i.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"No agents on the home yet."}):i.jsx(Re,{sensors:l,collisionDetection:Tt,onDragEnd:o,children:i.jsx(At,{items:r.map(Ts),strategy:Mt,children:i.jsx("div",{className:"flex flex-col gap-1",children:r.map(x=>i.jsx(Rs,{agent:x,home:s},x.id))})})}),e[6]=r,e[7]=o,e[8]=s,e[9]=l,e[10]=u):u=e[10];let f;return e[11]!==m||e[12]!==u?(f=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,u]}),e[11]=m,e[12]=u,e[13]=f):f=e[13],f}function Ts(t){return t.id}function As(){return W.error("Couldn't reorder home — please try again.")}function Ms(t){const e=T.c(6),{home:s,agents:r,hasSearch:n}=t,[a,l]=A.useState(20);let c;if(e[0]!==r||e[1]!==n||e[2]!==s||e[3]!==a){const o=r.slice(0,a);let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(Ue,{title:"Add to home"}),e[5]=d):d=e[5],c=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[d,r.length===0?i.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:n?"No agents match.":"Every agent is on the home."}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex flex-col gap-1",children:o.map(m=>i.jsx(Ds,{agent:m,home:s},m.id))}),r.length>a&&i.jsxs("button",{type:"button",onClick:()=>l(Os),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-a,")"]})]})]}),e[0]=r,e[1]=n,e[2]=s,e[3]=a,e[4]=c}else c=e[4];return c}function Os(t){return t+20}function Be(t){const e=pe(t.metadata?.ui).filter(a=>!!a.resourceUri).length,s=t.metadata?.ui?.homePrompts,r=Array.isArray(s)?s.length:null,n=[];return e>0&&n.push(`${e} tile${e===1?"":"s"}`),r!==null&&r>0&&n.push(`${r} prompt${r===1?"":"s"}`),r===0&&n.push("prompts off"),n.join(" · ")}function Rs(t){const e=T.c(57),{agent:s,home:r}=t,[n,a]=A.useState(!1);let l;e[0]!==s.id?(l={id:s.id},e[0]=s.id,e[1]=l):l=e[1];const{attributes:c,listeners:o,setNodeRef:d,transform:m,transition:u,isDragging:f}=Ot(l),x=Be(s)||"Quick access";let g;e[2]!==m?(g=Rt.Transform.toString(m),e[2]=m,e[3]=g):g=e[3];const h=f?.5:void 0,p=f?100:void 0;let b;e[4]!==g||e[5]!==h||e[6]!==p||e[7]!==u?(b={transform:g,transition:u,opacity:h,zIndex:p},e[4]=g,e[5]=h,e[6]=p,e[7]=u,e[8]=b):b=e[8];const v=b,w=f&&"shadow-lg";let y;e[9]!==w?(y=q("rounded-lg border border-border bg-card",w),e[9]=w,e[10]=y):y=e[10];const j=`Drag to reorder ${s.title??s.id}`;let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=i.jsx(He,{size:14}),e[11]=N):N=e[11];let S;e[12]!==c||e[13]!==o||e[14]!==j?(S=i.jsx("button",{type:"button",...c,...o,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":j,children:N}),e[12]=c,e[13]=o,e[14]=j,e[15]=S):S=e[15];let k;e[16]===Symbol.for("react.memo_cache_sentinel")?(k=()=>a(Ps),e[16]=k):k=e[16];const C=s.title??s.id;let $;e[17]!==s.icon||e[18]!==C?($=i.jsx(Y,{icon:s.icon,name:C,size:"sm"}),e[17]=s.icon,e[18]=C,e[19]=$):$=e[19];const E=s.title??s.id;let _;e[20]!==E?(_=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:E}),e[20]=E,e[21]=_):_=e[21];let I;e[22]!==x?(I=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:x}),e[22]=x,e[23]=I):I=e[23];let O;e[24]!==_||e[25]!==I?(O=i.jsxs("div",{className:"min-w-0 flex-1",children:[_,I]}),e[24]=_,e[25]=I,e[26]=O):O=e[26];const B=n&&"rotate-180";let z;e[27]!==B?(z=q("shrink-0 text-muted-foreground transition-transform",B),e[27]=B,e[28]=z):z=e[28];let P;e[29]!==z?(P=i.jsx(De,{size:16,className:z}),e[29]=z,e[30]=P):P=e[30];let Q;e[31]!==n||e[32]!==$||e[33]!==O||e[34]!==P?(Q=i.jsxs("button",{type:"button",onClick:k,className:"flex min-w-0 flex-1 items-center gap-2.5 text-left outline-none","aria-expanded":n,children:[$,O,P]}),e[31]=n,e[32]=$,e[33]=O,e[34]=P,e[35]=Q):Q=e[35];let M;e[36]!==s.id||e[37]!==r?(M=()=>r.removeAgent(s.id).catch(zs),e[36]=s.id,e[37]=r,e[38]=M):M=e[38];const F=`Remove ${s.title??s.id} from home`;let D;e[39]===Symbol.for("react.memo_cache_sentinel")?(D=i.jsx(Te,{size:14}),e[39]=D):D=e[39];let R;e[40]!==M||e[41]!==F?(R=i.jsx("button",{type:"button",onClick:M,"aria-label":F,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:D}),e[40]=M,e[41]=F,e[42]=R):R=e[42];let L;e[43]!==S||e[44]!==Q||e[45]!==R?(L=i.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2.5",children:[S,Q,R]}),e[43]=S,e[44]=Q,e[45]=R,e[46]=L):L=e[46];let U;e[47]!==s||e[48]!==n||e[49]!==r?(U=n&&i.jsx(Fe,{agent:s,home:r}),e[47]=s,e[48]=n,e[49]=r,e[50]=U):U=e[50];let G;return e[51]!==d||e[52]!==v||e[53]!==L||e[54]!==U||e[55]!==y?(G=i.jsxs("div",{ref:d,style:v,className:y,children:[L,U]}),e[51]=d,e[52]=v,e[53]=L,e[54]=U,e[55]=y,e[56]=G):G=e[56],G}function zs(){return W.error("Couldn't remove from home — please try again.")}function Ps(t){return!t}function Ds({agent:t,home:e}){const[s,r]=A.useState(!1),[n,a]=A.useState(!1),l=Be(t),c=async()=>{if(!e.atLimit){a(!0);try{await e.addAgent(t.id)}catch{W.error("Couldn't add to home — please try again.")}finally{a(!1)}}};return i.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[i.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[i.jsxs("button",{type:"button",onClick:()=>r(o=>!o),className:"flex min-w-0 flex-1 items-center gap-3 text-left outline-none","aria-expanded":s,children:[i.jsx(Y,{icon:t.icon,name:t.title??t.id,size:"sm"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.title??t.id}),l&&i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:l})]}),i.jsx(De,{size:16,className:q("shrink-0 text-muted-foreground transition-transform",s&&"rotate-180")})]}),i.jsx("button",{type:"button",onClick:c,disabled:n||e.atLimit,"aria-label":"Add to home",title:e.atLimit?`Home is full (${ee}) — 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:n?i.jsx(Ie,{size:12,className:"animate-spin"}):i.jsx(ge,{size:14})})]}),s&&i.jsx(Fe,{agent:t,home:e})]})}function Fe(t){const e=T.c(26),{agent:s,home:r}=t;let n,a,l,c,o,d,m;if(e[0]!==s||e[1]!==r){const p=pe(s.metadata?.ui);let b;e[9]!==s.connections?(b=(s.connections??[]).map(Ls).sort(),e[9]=s.connections,e[10]=b):b=e[10];const v=b;a=s.metadata?.ui?.homePrompts,m="border-t border-border px-3 py-2 flex flex-col gap-3",n=Bs,l=s,c=r,o=v,d=new Set(p.map(Hs)),e[0]=s,e[1]=r,e[2]=n,e[3]=a,e[4]=l,e[5]=c,e[6]=o,e[7]=d,e[8]=m}else n=e[2],a=e[3],l=e[4],c=e[5],o=e[6],d=e[7],m=e[8];let u;e[11]!==n||e[12]!==l||e[13]!==c||e[14]!==o||e[15]!==d?(u=i.jsx(n,{agent:l,home:c,connectionIds:o,pinnedResourceUris:d}),e[11]=n,e[12]=l,e[13]=c,e[14]=o,e[15]=d,e[16]=u):u=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(Us,{}),e[17]=f):f=e[17];const x=a??null;let g;e[18]!==s||e[19]!==r||e[20]!==x?(g=i.jsx(A.Suspense,{fallback:f,children:i.jsx(Qs,{agent:s,home:r,curated:x})}),e[18]=s,e[19]=r,e[20]=x,e[21]=g):g=e[21];let h;return e[22]!==m||e[23]!==u||e[24]!==g?(h=i.jsxs("div",{className:m,children:[u,g]}),e[22]=m,e[23]=u,e[24]=g,e[25]=h):h=e[25],h}function Hs(t){return t.resourceUri}function Ls(t){return t.connection_id}function Us(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[i.jsx(H,{className:"h-8 w-full"}),i.jsx(H,{className:"h-8 w-2/3"})]}),t[0]=e):e=t[0],e}function Bs({agent:t,home:e,connectionIds:s,pinnedResourceUris:r}){const n=es(),{data:a,isLoading:l}=re({queryKey:ne.projectConnectionDetails(t.id,s),enabled:s.length>0,queryFn:async()=>(await Promise.all(s.map(async o=>{try{const{item:d}=await n.call("COLLECTION_CONNECTIONS_GET",{id:o}),m=(d?.tools??[]).flatMap(u=>{const f=Xt(u._meta);return f?[{name:u.name,description:u.description,resourceUri:f}]:[]});return{id:o,title:d?.title??o,icon:d?.icon??null,uiTools:m}}catch{return{id:o,title:o,icon:null,uiTools:[]}}}))).filter(o=>o.uiTools.length>0)});return s.length===0?null:l?i.jsxs("div",{className:"flex flex-col gap-1 py-0.5",children:[i.jsx(H,{className:"h-7 w-full"}),i.jsx(H,{className:"h-7 w-2/3"})]}):!a||a.length===0?null:i.jsx("div",{className:"flex flex-col gap-0.5",children:a.map(c=>c.uiTools.map(o=>i.jsx(Fs,{agent:t,home:e,connection:c,tool:o,isPinned:r.has(o.resourceUri)},`${c.id}:${o.name}`)))})}function Fs({agent:t,home:e,connection:s,tool:r,isPinned:n}){const[a,l]=A.useState(!1),c=async()=>{if(!n&&!e.isOnHome(t.id)&&e.atLimit){W.error(`Home is full (${ee}) — remove an agent first`);return}l(!0);try{const o=pe(t.metadata?.ui),d=n?o.filter(u=>u.resourceUri!==r.resourceUri):[...o,{connectionId:s.id,resourceUri:r.resourceUri}],m={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:d}};await e.saveAgentMetadata(t,m)}catch(o){console.error("[home-tiles] failed to toggle tile",o),W.error("Couldn't update home — please try again.")}finally{l(!1)}};return i.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[i.jsx(Yt,{icon:s.icon,name:s.title,size:"xs"}),i.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:Le(r.name)}),i.jsx(Qe,{isPinned:n,submitting:a,onClick:c,label:n?"Remove from home":"Add to home"})]})}function Qe(t){const e=T.c(11),{isPinned:s,submitting:r,onClick:n,label:a}=t,l=s?"text-muted-foreground hover:bg-destructive/10 hover:text-destructive":"bg-foreground text-background hover:opacity-90";let c;e[0]!==l?(c=q("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]=c):c=e[1];let o;e[2]!==s||e[3]!==r?(o=r?i.jsx(Ie,{size:12,className:"animate-spin"}):s?i.jsx(Nt,{size:14}):i.jsx(ge,{size:14}),e[2]=s,e[3]=r,e[4]=o):o=e[4];let d;return e[5]!==a||e[6]!==n||e[7]!==r||e[8]!==c||e[9]!==o?(d=i.jsx("button",{type:"button",onClick:n,disabled:r,"aria-label":a,title:a,className:c,children:o}),e[5]=a,e[6]=n,e[7]=r,e[8]=c,e[9]=o,e[10]=d):d=e[10],d}function Qs(t){const e=T.c(32),{agent:s,home:r,curated:n}=t,{org:a}=J();let l;e[0]!==s.id||e[1]!==a.id||e[2]!==a.slug?(l={connectionId:s.id,orgId:a.id,orgSlug:a.slug},e[0]=s.id,e[1]=a.id,e[2]=a.slug,e[3]=l):l=e[3];const c=oe(l);let o;e[4]!==s.id||e[5]!==a.id?(o=ne.agentPrompts(a.id,s.id),e[4]=s.id,e[5]=a.id,e[6]=o):o=e[6];let d;e[7]!==c?(d=async()=>{const{prompts:j}=await c.listPrompts();return j.map(Gs)},e[7]=c,e[8]=d):d=e[8];let m;e[9]!==o||e[10]!==d?(m={queryKey:o,queryFn:d,staleTime:3e4,retry:!1},e[9]=o,e[10]=d,e[11]=m):m=e[11];const{data:u,isLoading:f,error:x}=re(m),g=be(a.slug);let h,p;if(e[12]!==s.id||e[13]!==u||e[14]!==g.prompts){let j;e[17]!==s.id?(j=S=>S.agentId===s.id&&S.promptName,e[17]=s.id,e[18]=j):j=e[18],h=g.prompts.filter(j).map(Ks);let N;e[19]!==u?(N=u??[],e[19]=u,e[20]=N):N=e[20],p=[...N];for(const S of h)p.some(k=>k.name===S.name)||p.push(S);e[12]=s.id,e[13]=u,e[14]=g.prompts,e[15]=h,e[16]=p}else h=e[15],p=e[16];if(f&&h.length===0){let j;return e[21]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx(H,{className:"h-7 w-full"}),i.jsx(H,{className:"h-7 w-2/3"})]}),e[21]=j):j=e[21],j}if(x&&h.length===0)return console.error("[home-tiles] listPrompts failed for agent",s.id,x),null;if(p.length===0)return null;let b;e[22]!==n||e[23]!==p?(b=n??p.map(qs),e[22]=n,e[23]=p,e[24]=b):b=e[24];let v;e[25]!==b?(v=new Set(b),e[25]=b,e[26]=v):v=e[26];const w=v;let y;return e[27]!==s||e[28]!==r||e[29]!==p||e[30]!==w?(y=i.jsx("div",{className:"flex flex-col gap-0.5",children:p.map(j=>i.jsx(Vs,{agent:s,home:r,prompt:j,allPromptNames:p.map(Ws),isPinned:w.has(j.name)},j.name))}),e[27]=s,e[28]=r,e[29]=p,e[30]=w,e[31]=y):y=e[31],y}function Ws(t){return t.name}function qs(t){return t.name}function Ks(t){return{name:t.promptName,title:t.title,description:t.description}}function Gs(t){return{name:t.name,title:t.title,description:t.description}}function Vs({agent:t,home:e,prompt:s,allPromptNames:r,isPinned:n}){const[a,l]=A.useState(!1),c=async()=>{if(!n&&!e.isOnHome(t.id)&&e.atLimit){W.error(`Home is full (${ee}) — remove an agent first`);return}l(!0);try{const o=t.metadata?.ui?.homePrompts;let d;Array.isArray(o)?d=n?o.filter(u=>u!==s.name):[...o,s.name]:d=n?r.filter(u=>u!==s.name):r;const m={...t.metadata??{},ui:{...t.metadata?.ui??{},homePrompts:d}};await e.saveAgentMetadata(t,m)}catch(o){console.error("[home-tiles] failed to toggle prompt",o),W.error("Couldn't update home — please try again.")}finally{l(!1)}};return i.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[i.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:s.title??Le(s.name)}),i.jsx(Qe,{isPinned:n,submitting:a,onClick:c,label:n?"Remove from home":"Add to home"})]})}function Js(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"flex flex-col gap-2 p-2",children:Array.from({length:4},Xs)}),t[0]=e):e=t[0],e}function Xs(t,e){return i.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border p-2.5",children:[i.jsx(H,{className:"size-8 rounded-md"}),i.jsxs("div",{className:"flex-1 space-y-1.5",children:[i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"h-2.5 w-1/3"})]})]},e)}const Z=1,We=`home-board.layout.v${Z}`;function qe(t){return`home-board.layout.v${Z}.${t}`}const Ke={version:Z,tiles:{},hidden:[]};function me(t){return!t||t.version!==Z?Ke:{version:Z,tiles:t.tiles??{},hidden:Array.isArray(t.hidden)?t.hidden:[]}}function Zs(t){return Object.keys(t.tiles).length>0||t.hidden.length>0}function Ys(t){try{const e=localStorage.getItem(qe(t));return e?me(JSON.parse(e)):void 0}catch{return}}function Ne(t,e){try{localStorage.setItem(qe(t),JSON.stringify(e))}catch{}}async function Se(t,e){if(!(await fetch(`/api/${t}/kv/${We}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save board layout")}function ei(t){const e=T.c(24),s=he();let r;e[0]!==t?(r=ne.boardLayout(t),e[0]=t,e[1]=r):r=e[1];const n=r;let a;e[2]!==t?(a=Ys(t),e[2]=t,e[3]=a):a=e[3];const l=a;let c;e[4]!==l||e[5]!==t?(c=async()=>{const b=await fetch(`/api/${t}/kv/${We}`);if(b.status===404)return l&&Zs(l)?(await Se(t,l),l):Ke;if(!b.ok)throw new Error("Failed to load board layout");const v=await b.json(),w=me(v.value);return Ne(t,w),w},e[4]=l,e[5]=t,e[6]=c):c=e[6];let o;e[7]!==l||e[8]!==n||e[9]!==c?(o={queryKey:n,queryFn:c,initialData:l,staleTime:0,refetchOnWindowFocus:!1},e[7]=l,e[8]=n,e[9]=c,e[10]=o):o=e[10];const{data:d,isLoading:m}=re(o);let u;e[11]!==t?(u={mutationFn:b=>Se(t,b)},e[11]=t,e[12]=u):u=e[12];const f=dt(u);let x;e[13]!==f||e[14]!==t||e[15]!==s||e[16]!==n?(x=b=>{Ne(t,b),s.setQueryData(n,b),f.mutate(b)},e[13]=f,e[14]=t,e[15]=s,e[16]=n,e[17]=x):x=e[17];const g=x;let h;e[18]!==d?(h=me(d),e[18]=d,e[19]=h):h=e[19];let p;return e[20]!==m||e[21]!==g||e[22]!==h?(p={layout:h,isLoading:m,save:g},e[20]=m,e[21]=g,e[22]=h,e[23]=p):p=e[23],p}const Ge=A.createContext(null);function ti(t){const e=T.c(24),{children:s}=t,{org:r}=J(),n=ei(r.slug),[a,l]=A.useState(!1),[c,o]=A.useState(null);let d;e[0]!==n.layout?(d=()=>{o(n.layout),l(!0)},e[0]=n.layout,e[1]=d):d=e[1];const m=d;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{o(null),l(!1)},e[2]=u):u=e[2];const f=u;let x;e[3]!==c||e[4]!==n?(x=()=>{c&&n.save(c),o(null),l(!1)},e[3]=c,e[4]=n,e[5]=x):x=e[5];const g=x,h=a&&c!==null,p=h?c:n.layout;let b;e[6]!==c||e[7]!==h||e[8]!==n.layout?(b=h?JSON.stringify(c)!==JSON.stringify(n.layout):!1,e[6]=c,e[7]=h,e[8]=n.layout,e[9]=b):b=e[9];const v=b;let w;e[10]!==a||e[11]!==n?(w=S=>{a?o(S):n.save(S)},e[10]=a,e[11]=n,e[12]=w):w=e[12];const y=w;let j;e[13]!==y||e[14]!==m||e[15]!==v||e[16]!==a||e[17]!==p||e[18]!==g||e[19]!==n.isLoading?(j={isEditMode:a,enter:m,cancel:f,save:g,hasChanges:v,layout:p,isLayoutLoading:n.isLoading,commitLayout:y},e[13]=y,e[14]=m,e[15]=v,e[16]=a,e[17]=p,e[18]=g,e[19]=n.isLoading,e[20]=j):j=e[20];let N;return e[21]!==s||e[22]!==j?(N=i.jsx(Ge.Provider,{value:j,children:s}),e[21]=s,e[22]=j,e[23]=N):N=e[23],N}function Ve(){const t=A.useContext(Ge);if(!t)throw new Error("useHomeEdit must be used within a HomeEditProvider");return t}function si({agentId:t}){const{org:e,locator:s}=J(),r=oe({connectionId:t,orgId:e.id,orgSlug:e.slug}),{create:n}=ls(),{setTaskId:a}=Bt(),[l,c]=A.useState(null),[o,d]=A.useState(!1),m=A.useRef(!1),u=async(p,b)=>{if(!r){W.error("MCP client not available");return}if(!m.current){m.current=!0,d(!0);try{const v=await os(r,p.name,b),w={type:"doc",content:[{type:"paragraph",content:[ss({id:p.name,name:is(p.name,ns(p._meta)),metadata:v.messages,char:"/",kind:"prompt",args:b}),{type:"text",text:" "}]}]},y=crypto.randomUUID();as(sessionStorage,s,y,{tiptapDoc:w}),await n({id:y,virtual_mcp_id:t}),a(y,t,{autosend:!0})}catch(v){console.error("[start-thread-from-prompt] failed",v),W.error("Failed to start thread. Please try again.")}finally{m.current=!1,d(!1)}}},f=async p=>{if(!m.current){if(p.arguments&&p.arguments.length>0){c(p);return}await u(p)}},x=async p=>{if(!l)return;const b=l;c(null),await u(b,p)};return{start:f,startBlank:async()=>{if(!m.current){m.current=!0,d(!0);try{const p=crypto.randomUUID();await n({id:p,virtual_mcp_id:t}),a(p,t)}catch(p){console.error("[start-thread-from-prompt] startBlank failed",p),W.error("Failed to start thread. Please try again.")}finally{m.current=!1,d(!1)}}},dialog:i.jsx(ts,{prompt:l,setPrompt:p=>c(p),onSubmit:x}),dialogPrompt:l,starting:o}}const K=4,V=100,_e=12,ii=5,ni={w:2,h:2};class ue extends A.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?i.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-center",children:[i.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-destructive/10 text-destructive",children:i.jsx(mt,{size:16})}),i.jsx("p",{className:"text-sm font-medium text-foreground",children:"This tile crashed"}),i.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 ri(t){const e=T.c(72),{tiles:s,isEditMode:r,renderTile:n,onMove:a,onResize:l,onRemove:c}=t,o=xe(),d=A.useRef(null),[m,u]=A.useState(null),[f,x]=A.useState(null);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={activationConstraint:{distance:4}},e[0]=g):g=e[0];const h=Ae(ie(Oe,g),ie(Me)),p=s.reduce(oi,0),b=r?Math.max(p+2,4):Math.max(p,1);let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=()=>{const M=d.current?.getBoundingClientRect();return M?{cellWidth:M.width/K,cellHeight:V}:null},e[1]=v):v=e[1];const w=v;let y;e[2]===Symbol.for("react.memo_cache_sentinel")?(y=M=>{u(String(M.active.id)),x(w())},e[2]=y):y=e[2];const j=y;let N;e[3]!==f||e[4]!==a||e[5]!==s?(N=M=>{const F=String(M.active.id),D=f??w();if(u(null),x(null),!D||D.cellWidth<=0)return;const R=s.find(G=>G.id===F);if(!R)return;const L=Math.round(M.delta.x/D.cellWidth),U=Math.round(M.delta.y/D.cellHeight);L===0&&U===0||a(F,{x:R.x+L,y:R.y+U})},e[3]=f,e[4]=a,e[5]=s,e[6]=N):N=e[6];const S=N;if(o){let M;if(e[7]!==n||e[8]!==s){let D;e[10]!==n?(D=R=>i.jsx("div",{className:"bg-card card-shadow rounded-2xl overflow-hidden",style:{minHeight:V},children:i.jsx(ue,{children:n(R)})},R.id),e[10]=n,e[11]=D):D=e[11],M=s.map(D),e[7]=n,e[8]=s,e[9]=M}else M=e[9];let F;return e[12]!==M?(F=i.jsx("div",{className:"flex flex-col gap-3 px-4 pb-8",children:M}),e[12]=M,e[13]=F):F=e[13],F}let k,C,$,E,_,I,O,B,z;if(e[14]!==m||e[15]!==f||e[16]!==r||e[17]!==S||e[18]!==c||e[19]!==l||e[20]!==n||e[21]!==h||e[22]!==s||e[23]!==b){const M=m?s.find(X=>X.id===m):null;C=Re,B=h,z=j,$=S;const F=b*V,D=r?V*4:V;let R;e[33]!==F||e[34]!==D?(R={height:F,minHeight:D},e[33]=F,e[34]=D,e[35]=R):R=e[35];let L;e[36]!==r||e[37]!==s||e[38]!==b?(L=r&&i.jsx(li,{rows:b,tiles:s}),e[36]=r,e[37]=s,e[38]=b,e[39]=L):L=e[39];let U;if(e[40]!==m||e[41]!==r||e[42]!==c||e[43]!==l||e[44]!==n||e[45]!==s){let X;e[47]!==m||e[48]!==r||e[49]!==c||e[50]!==l||e[51]!==n?(X=te=>i.jsx(ci,{tile:te,isEditMode:r,isDragging:m===te.id,onResize:l,onRemove:c,children:n(te)},te.id),e[47]=m,e[48]=r,e[49]=c,e[50]=l,e[51]=n,e[52]=X):X=e[52],U=s.map(X),e[40]=m,e[41]=r,e[42]=c,e[43]=l,e[44]=n,e[45]=s,e[46]=U}else U=e[46];e[53]!==R||e[54]!==L||e[55]!==U?(E=i.jsxs("div",{ref:d,className:"relative w-full",style:R,children:[L,U]}),e[53]=R,e[54]=L,e[55]=U,e[56]=E):E=e[56],k=Dt,_=null;const G=M&&f?M.w*f.cellWidth-_e:void 0,le=M&&f?M.h*f.cellHeight-_e:void 0;e[57]!==G||e[58]!==le?(I={width:G,height:le},e[57]=G,e[58]=le,e[59]=I):I=e[59],O=M&&i.jsx("div",{className:"bg-card card-shadow rounded-2xl shadow-2xl ring-2 ring-primary/40 h-full overflow-hidden opacity-95",children:i.jsx(ue,{children:n(M)})}),e[14]=m,e[15]=f,e[16]=r,e[17]=S,e[18]=c,e[19]=l,e[20]=n,e[21]=h,e[22]=s,e[23]=b,e[24]=k,e[25]=C,e[26]=$,e[27]=E,e[28]=_,e[29]=I,e[30]=O,e[31]=B,e[32]=z}else k=e[24],C=e[25],$=e[26],E=e[27],_=e[28],I=e[29],O=e[30],B=e[31],z=e[32];let P;e[60]!==k||e[61]!==_||e[62]!==I||e[63]!==O?(P=i.jsx(k,{dropAnimation:_,style:I,children:O}),e[60]=k,e[61]=_,e[62]=I,e[63]=O,e[64]=P):P=e[64];let Q;return e[65]!==C||e[66]!==$||e[67]!==E||e[68]!==P||e[69]!==B||e[70]!==z?(Q=i.jsxs(C,{sensors:B,onDragStart:z,onDragEnd:$,children:[E,P]}),e[65]=C,e[66]=$,e[67]=E,e[68]=P,e[69]=B,e[70]=z,e[71]=Q):Q=e[71],Q}function oi(t,e){return Math.max(t,e.y+e.h)}function li(t){const e=T.c(7),{rows:s,tiles:r}=t;let n;e[0]!==r?(n=(o,d)=>r.some(m=>o>=m.x&&o<m.x+m.w&&d>=m.y&&d<m.y+m.h),e[0]=r,e[1]=n):n=e[1];const a=n;let l;if(e[2]!==a||e[3]!==s){l=[];for(let o=0;o<s;o++)for(let d=0;d<K;d++)a(d,o)||l.push({x:d,y:o});e[2]=a,e[3]=s,e[4]=l}else l=e[4];let c;return e[5]!==l?(c=i.jsx("div",{className:"absolute inset-0 pointer-events-none",children:l.map(ai)}),e[5]=l,e[6]=c):c=e[6],c}function ai(t){return i.jsx("div",{className:"absolute p-1",style:{left:`${t.x/K*100}%`,top:t.y*V,width:`${1/K*100}%`,height:V},children:i.jsx("div",{className:"h-full w-full rounded-2xl border border-dashed border-border/60"})},`${t.x}-${t.y}`)}function ci(t){const e=T.c(31),{tile:s,isEditMode:r,isDragging:n,onResize:a,onRemove:l,children:c}=t,o=!r;let d;e[0]!==o||e[1]!==s.id?(d={id:s.id,disabled:o},e[0]=o,e[1]=s.id,e[2]=d):d=e[2];const{setNodeRef:m,attributes:u,listeners:f,isDragging:x}=Ht(d),g=`${s.x/K*100}%`,h=`${s.w/K*100}%`,p=s.y*V,b=s.h*V,v=x||n,w=!v&&"transition-[left,top,width,height,opacity] duration-200 ease-out",y=v&&"opacity-30";let j;e[3]!==w||e[4]!==y?(j=q("absolute p-1 will-change-[left,top,width,height,opacity]",w,y),e[3]=w,e[4]=y,e[5]=j):j=e[5];let N;e[6]!==b||e[7]!==g||e[8]!==p||e[9]!==h?(N={left:g,top:p,width:h,height:b},e[6]=b,e[7]=g,e[8]=p,e[9]=h,e[10]=N):N=e[10];const S=r&&"outline outline-1 outline-transparent hover:outline-primary/40";let k;e[11]!==S?(k=q("relative h-full bg-card card-shadow rounded-2xl overflow-hidden",S),e[11]=S,e[12]=k):k=e[12];let C;e[13]!==u||e[14]!==r||e[15]!==f||e[16]!==l||e[17]!==a||e[18]!==s?(C=r&&i.jsxs(i.Fragment,{children:[i.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:i.jsx(He,{size:16})}),i.jsx("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:i.jsx(di,{tile:s,onResize:a,onRemove:l})})]}),e[13]=u,e[14]=r,e[15]=f,e[16]=l,e[17]=a,e[18]=s,e[19]=C):C=e[19];let $;e[20]!==c?($=i.jsx("div",{className:"h-full overflow-hidden",children:i.jsx(ue,{children:c})}),e[20]=c,e[21]=$):$=e[21];let E;e[22]!==$||e[23]!==k||e[24]!==C?(E=i.jsxs("div",{className:k,children:[C,$]}),e[22]=$,e[23]=k,e[24]=C,e[25]=E):E=e[25];let _;return e[26]!==m||e[27]!==E||e[28]!==j||e[29]!==N?(_=i.jsx("div",{ref:m,className:j,style:N,children:E}),e[26]=m,e[27]=E,e[28]=j,e[29]=N,e[30]=_):_=e[30],_}function di(t){const e=T.c(20),{tile:s,onResize:r,onRemove:n}=t,[a,l]=A.useState(!1);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(cs,{asChild:!0,children:i.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:i.jsx(St,{size:16})})}),e[0]=c):c=e[0];let o;e[1]!==r||e[2]!==s.id?(o=p=>{r(s.id,p),l(!1)},e[1]=r,e[2]=s.id,e[3]=o):o=e[3];let d;e[4]!==o||e[5]!==s?(d=i.jsx(mi,{tile:s,onPick:o}),e[4]=o,e[5]=s,e[6]=d):d=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(ds,{}),e[7]=m):m=e[7];let u;e[8]!==n||e[9]!==s.id?(u=()=>n(s.id),e[8]=n,e[9]=s.id,e[10]=u):u=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(hs,{size:14,className:"mr-2"}),e[11]=f):f=e[11];let x;e[12]!==u?(x=i.jsxs(ms,{onSelect:u,className:"text-destructive focus:text-destructive",children:[f,"Remove tile"]}),e[12]=u,e[13]=x):x=e[13];let g;e[14]!==d||e[15]!==x?(g=i.jsxs(us,{align:"end",className:"w-auto",children:[d,m,x]}),e[14]=d,e[15]=x,e[16]=g):g=e[16];let h;return e[17]!==a||e[18]!==g?(h=i.jsxs(fs,{open:a,onOpenChange:l,children:[c,g]}),e[17]=a,e[18]=g,e[19]=h):h=e[19],h}function mi(t){const e=T.c(19),{tile:s,onPick:r}=t,n=s.minW??1,a=s.minH??1,[l,c]=A.useState(null);let o;e[0]!==l||e[1]!==s.h||e[2]!==s.w?(o=l??{w:s.w,h:s.h},e[0]=l,e[1]=s.h,e[2]=s.w,e[3]=o):o=e[3];const d=o;let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx("span",{className:"text-xs text-muted-foreground",children:"Size"}),e[4]=m):m=e[4];let u;e[5]!==d.h||e[6]!==d.w?(u=i.jsxs("div",{className:"mb-2 flex items-center justify-between gap-4",children:[m,i.jsxs("span",{className:"text-xs font-medium tabular-nums",children:[d.w," × ",d.h]})]}),e[5]=d.h,e[6]=d.w,e[7]=u):u=e[7];let f,x;e[8]===Symbol.for("react.memo_cache_sentinel")?(f={gridTemplateColumns:`repeat(${K}, 1.25rem)`},x=()=>c(null),e[8]=f,e[9]=x):(f=e[8],x=e[9]);let g;e[10]!==d.h||e[11]!==d.w||e[12]!==a||e[13]!==n||e[14]!==r?(g=i.jsx("div",{className:"grid w-max gap-1",style:f,onPointerLeave:x,children:Array.from({length:ii},(p,b)=>Array.from({length:K},(v,w)=>{const y=w+1,j=b+1,N=y<n||j<a,S=y<=d.w&&j<=d.h;return i.jsx("button",{type:"button",disabled:N,"aria-label":`${y} by ${j}`,onPointerEnter:()=>c({w:y,h:j}),onClick:()=>r({w:y,h:j}),className:q("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")},`${y}x${j}`)}))}),e[10]=d.h,e[11]=d.w,e[12]=a,e[13]=n,e[14]=r,e[15]=g):g=e[15];let h;return e[16]!==u||e[17]!==g?(h=i.jsxs("div",{className:"px-2 py-1.5",children:[u,g]}),e[16]=u,e[17]=g,e[18]=h):h=e[18],h}function ui(t,e,s){return t.some(r=>e>=r.x&&e<r.x+r.w&&s>=r.y&&s<r.y+r.h)}function fe(t,e,s){for(let r=0;r<100;r++)for(let n=0;n<=K-e;n++){let a=!0;for(let l=0;l<s&&a;l++)for(let c=0;c<e&&a;c++)ui(t,n+c,r+l)&&(a=!1);if(a)return{x:n,y:r}}return{x:0,y:0}}function ae(t,e,s={w:1,h:1}){const r=Math.max(s.w,Math.min(K,t)),n=Math.max(s.h,Math.min(6,e));return{w:r,h:n}}function ce(t,e,s){const r=Math.max(0,Math.min(K-s,t)),n=Math.max(0,e);return{x:r,y:n}}function fi(t,e,s){const r=t.find(o=>o.id===e);if(!r)return t;const n=t.filter(o=>o.id!==e),a=n.find(o=>s.x>=o.x&&s.x<o.x+o.w&&s.y>=o.y&&s.y<o.y+o.h);if(a&&a.w===r.w&&a.h===r.h)return t.map(o=>o.id===e?{...o,x:a.x,y:a.y}:o.id===a.id?{...o,x:r.x,y:r.y}:o);const c=[{...r,x:s.x,y:s.y}];for(const o of n){const d=fe(c,o.w,o.h);c.push({...o,x:d.x,y:d.y})}return c}function hi(t){const e=T.c(35),{layout:s,isLayoutLoading:r,commitLayout:n}=Ve();let a;e[0]!==s.hidden?(a=new Set(s.hidden),e[0]=s.hidden,e[1]=a):a=e[1];const l=a;let c,o;if(e[2]!==t||e[3]!==l||e[4]!==s.tiles){o=[];let v;e[7]!==l?(v=y=>y.pinned||!l.has(y.id),e[7]=l,e[8]=v):v=e[8];const w=t.filter(v);c=new Map;for(const y of t)y.minSize&&c.set(y.id,y.minSize);for(const y of w){const j=s.tiles[y.id];if(!j)continue;const N=c.get(y.id),{w:S,h:k}=ae(j.w,j.h,N),{x:C,y:$}=ce(j.x,j.y,S);o.push({id:y.id,x:C,y:$,w:S,h:k,minW:N?.w,minH:N?.h})}for(const y of w){if(o.some($=>$.id===y.id))continue;const j=y.defaultSize??ni,N=c.get(y.id),{w:S,h:k}=ae(j.w,j.h,N),C=fe(o,S,k);o.push({id:y.id,x:C.x,y:C.y,w:S,h:k,minW:N?.w,minH:N?.h})}e[2]=t,e[3]=l,e[4]=s.tiles,e[5]=c,e[6]=o}else c=e[5],o=e[6];let d;e[9]!==t?(d=new Set(t.map(pi)),e[9]=t,e[10]=d):d=e[10];const m=d;let u;e[11]!==m||e[12]!==n?(u=(v,w)=>{const y={};for(const j of v)y[j.id]={x:j.x,y:j.y,w:j.w,h:j.h};n({version:Z,tiles:y,hidden:w.filter(j=>m.has(j))})},e[11]=m,e[12]=n,e[13]=u):u=e[13];const f=u;let x;e[14]!==o?(x={visible:o},e[14]=o,e[15]=x):x=e[15];let g;e[16]!==f||e[17]!==s||e[18]!==o?(g=(v,w)=>{const y=o.find(S=>S.id===v);if(!y)return;const j=ce(w.x,w.y,y.w);if(j.x===y.x&&j.y===y.y)return;const N=fi(o,v,j);f(N,s.hidden)},e[16]=f,e[17]=s,e[18]=o,e[19]=g):g=e[19];let h;e[20]!==f||e[21]!==s||e[22]!==c||e[23]!==o?(h=(v,w)=>{const y=o.find(E=>E.id===v);if(!y)return;const j=c.get(v),{w:N,h:S}=ae(w.w,w.h,j);if(N===y.w&&S===y.h)return;const k={...y,w:N,h:S,x:ce(y.x,y.y,N).x},C=o.filter(E=>E.id!==v),$=[k];for(const E of C){const _=fe($,E.w,E.h);$.push({...E,x:_.x,y:_.y})}f($,s.hidden)},e[20]=f,e[21]=s,e[22]=c,e[23]=o,e[24]=h):h=e[24];let p;e[25]!==f||e[26]!==s||e[27]!==o?(p=v=>{const w=o.filter(y=>y.id!==v);f(w,Array.from(new Set([...s.hidden,v])))},e[25]=f,e[26]=s,e[27]=o,e[28]=p):p=e[28];let b;return e[29]!==r||e[30]!==x||e[31]!==g||e[32]!==h||e[33]!==p?(b={snapshot:x,isLoading:r,moveTile:g,resizeTile:h,hideTile:p},e[29]=r,e[30]=x,e[31]=g,e[32]=h,e[33]=p,e[34]=b):b=e[34],b}function pi(t){return t.id}const xi={w:2,h:4},gi={w:1,h:2},bi={w:1,h:1};function yi(t){return`prompt:${t.agentId}:${t.promptName||"blank"}`}function vi(t){return`tile:${t.agentId}:${t.resourceUri}`}function ji(t){return t.promptName?t.agentName:t.description}function wi(t){return{name:t.promptName,title:t.title,description:t.description,arguments:t.arguments,_meta:t._meta}}function ye(t){const e=T.c(10);let s;e[0]!==t?(s={agentId:t},e[0]=t,e[1]=s):s=e[1];const{start:r,startBlank:n,dialog:a,starting:l}=si(s);let c;e[2]!==r||e[3]!==n?(c=m=>{if(!m.promptName){n();return}r(wi(m))},e[2]=r,e[3]=n,e[4]=c):c=e[4];const o=c;let d;return e[5]!==a||e[6]!==o||e[7]!==n||e[8]!==l?(d={open:o,startBlank:n,dialog:a,starting:l},e[5]=a,e[6]=o,e[7]=n,e[8]=l,e[9]=d):d=e[9],d}function Ni(t){const e=T.c(32),{entry:s,isEditMode:r}=t,{open:n,dialog:a,starting:l}=ye(s.agentId);let c;e[0]!==s||e[1]!==n?(c=()=>n(s),e[0]=s,e[1]=n,e[2]=c):c=e[2];const o=l||r,d=!r&&"cursor-pointer transition-colors hover:bg-accent/40",m=r&&"cursor-default pl-12",u=l&&"opacity-60";let f;e[3]!==d||e[4]!==m||e[5]!==u?(f=q("group/tile relative flex h-full w-full items-center gap-3 px-4 py-3 text-left bg-card",d,m,u),e[3]=d,e[4]=m,e[5]=u,e[6]=f):f=e[6];let x;e[7]!==s.agentIcon||e[8]!==s.agentName?(x=i.jsx(Y,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[7]=s.agentIcon,e[8]=s.agentName,e[9]=x):x=e[9];let g;e[10]!==s.title?(g=i.jsx("div",{className:"line-clamp-2 text-sm font-medium text-foreground leading-snug",children:s.title}),e[10]=s.title,e[11]=g):g=e[11];let h;e[12]!==s?(h=ji(s),e[12]=s,e[13]=h):h=e[13];let p;e[14]!==h?(p=i.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:h}),e[14]=h,e[15]=p):p=e[15];let b;e[16]!==p||e[17]!==g?(b=i.jsxs("div",{className:"min-w-0 flex-1",children:[g,p]}),e[16]=p,e[17]=g,e[18]=b):b=e[18];let v;e[19]!==r?(v=!r&&i.jsx(rs,{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]=v):v=e[20];let w;e[21]!==l||e[22]!==c||e[23]!==b||e[24]!==v||e[25]!==o||e[26]!==f||e[27]!==x?(w=i.jsxs("button",{type:"button",onClick:c,disabled:o,"aria-busy":l,className:f,children:[x,b,v]}),e[21]=l,e[22]=c,e[23]=b,e[24]=v,e[25]=o,e[26]=f,e[27]=x,e[28]=w):w=e[28];let y;return e[29]!==a||e[30]!==w?(y=i.jsxs(i.Fragment,{children:[w,a]}),e[29]=a,e[30]=w,e[31]=y):y=e[31],y}function Si(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.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},_i)}),t[0]=e):e=t[0],e}function _i(t,e){return i.jsxs("div",{className:"flex w-full items-center gap-3 rounded-2xl bg-card card-shadow px-3 py-2.5",children:[i.jsx(H,{className:"size-10 rounded-xl"}),i.jsxs("div",{className:"flex-1 space-y-1.5",children:[i.jsx(H,{className:"h-3 w-2/3"}),i.jsx(H,{className:"h-2.5 w-1/3"})]})]},`chip-skeleton-${e}`)}function Ci(t){const e=T.c(49),{tile:s,prompts:r,isEditMode:n,tileWidth:a}=t,{org:l}=J(),{open:c,startBlank:o,dialog:d,starting:m}=ye(s.agentId);let u,f,x,g,h;if(e[0]!==n||e[1]!==c||e[2]!==l.id||e[3]!==l.slug||e[4]!==r||e[5]!==o||e[6]!==m||e[7]!==s||e[8]!==a){const v=r.filter(ki);g="flex h-full w-full flex-col gap-3 p-3";let w;e[14]!==o?(w=()=>{o()},e[14]=o,e[15]=w):w=e[15];const y=m||n,j=n&&"pl-10 pr-10";let N;e[16]!==j?(N=q("flex items-center gap-3 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",j),e[16]=j,e[17]=N):N=e[17];let S;e[18]!==s.agentIcon||e[19]!==s.agentName?(S=i.jsx(Y,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[18]=s.agentIcon,e[19]=s.agentName,e[20]=S):S=e[20];let k;e[21]!==s.agentName?(k=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:s.agentName}),e[21]=s.agentName,e[22]=k):k=e[22];const C=n?"Drag to rearrange":"Open chat";let $;e[23]!==C?($=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:C}),e[23]=C,e[24]=$):$=e[24];let E;e[25]!==k||e[26]!==$?(E=i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[k,$]}),e[25]=k,e[26]=$,e[27]=E):E=e[27],e[28]!==m||e[29]!==S||e[30]!==E||e[31]!==w||e[32]!==y||e[33]!==N?(h=i.jsxs("button",{type:"button",onClick:w,disabled:y,"aria-busy":m,className:N,children:[S,E]}),e[28]=m,e[29]=S,e[30]=E,e[31]=w,e[32]=y,e[33]=N,e[34]=h):h=e[34],u="flex min-h-0 flex-1 gap-3 overflow-hidden";let _;e[35]===Symbol.for("react.memo_cache_sentinel")?(_=i.jsx($i,{}),e[35]=_):_=e[35],e[36]!==l.id||e[37]!==l.slug||e[38]!==s?(f=i.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:i.jsx(A.Suspense,{fallback:_,children:i.jsx(Ei,{tile:s,orgId:l.id,orgSlug:l.slug})})}),e[36]=l.id,e[37]=l.slug,e[38]=s,e[39]=f):f=e[39],x=v.length>0&&!n&&a>=2&&i.jsx("div",{className:"flex w-44 shrink-0 flex-col gap-2 overflow-hidden",children:v.map(I=>i.jsx("button",{type:"button",onClick:()=>c(I),disabled:m,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:i.jsx("span",{className:"line-clamp-2",children:I.title})},I.promptName))}),e[0]=n,e[1]=c,e[2]=l.id,e[3]=l.slug,e[4]=r,e[5]=o,e[6]=m,e[7]=s,e[8]=a,e[9]=u,e[10]=f,e[11]=x,e[12]=g,e[13]=h}else u=e[9],f=e[10],x=e[11],g=e[12],h=e[13];let p;e[40]!==u||e[41]!==f||e[42]!==x?(p=i.jsxs("div",{className:u,children:[f,x]}),e[40]=u,e[41]=f,e[42]=x,e[43]=p):p=e[43];let b;return e[44]!==d||e[45]!==g||e[46]!==h||e[47]!==p?(b=i.jsxs("div",{className:g,children:[h,p,d]}),e[44]=d,e[45]=g,e[46]=h,e[47]=p,e[48]=b):b=e[48],b}function ki(t){return!!t.promptName}function Ei(t){const e=T.c(12),{tile:s,orgId:r,orgSlug:n}=t;let a;e[0]!==r||e[1]!==n||e[2]!==s.connectionId?(a={connectionId:s.connectionId,orgId:r,orgSlug:n},e[0]=r,e[1]=n,e[2]=s.connectionId,e[3]=a):a=e[3];const l=oe(a),c=s.minHeight??200,o=s.maxHeight??4e3;let d;return e[4]!==l||e[5]!==r||e[6]!==n||e[7]!==c||e[8]!==o||e[9]!==s.connectionId||e[10]!==s.resourceUri?(d=i.jsx(Zt,{resourceURI:s.resourceUri,orgId:r,orgSlug:n,connectionId:s.connectionId,client:l,displayMode:"fullscreen",minHeight:c,maxHeight:o,className:"h-full"}),e[4]=l,e[5]=r,e[6]=n,e[7]=c,e[8]=o,e[9]=s.connectionId,e[10]=s.resourceUri,e[11]=d):d=e[11],d}function $i(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex h-full w-full flex-col gap-2 p-4",children:[i.jsx(H,{className:"h-3 w-2/3"}),i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"mt-1 h-full w-full rounded-md"})]}),t[0]=e):e=t[0],e}function Ii(t){const e=T.c(14),{icon:s,name:r}=t;let n;e[0]!==s||e[1]!==r?(n=i.jsx(Y,{icon:s,name:r,size:"sm+"}),e[0]=s,e[1]=r,e[2]=n):n=e[2];let a;e[3]!==r?(a=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:r}),e[3]=r,e[4]=a):a=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Loading tile…"}),e[5]=l):l=e[5];let c;e[6]!==a?(c=i.jsxs("div",{className:"min-w-0 flex-1",children:[a,l]}),e[6]=a,e[7]=c):c=e[7];let o;e[8]!==n||e[9]!==c?(o=i.jsxs("div",{className:"flex items-center gap-2.5",children:[n,c]}),e[8]=n,e[9]=c,e[10]=o):o=e[10];let d;e[11]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsxs("div",{className:"flex flex-1 flex-col gap-2 pt-1",children:[i.jsx(H,{className:"h-3 w-3/4"}),i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"h-3 w-2/3"})]}),e[11]=d):d=e[11];let m;return e[12]!==o?(m=i.jsxs("div",{className:"flex h-full w-full flex-col gap-3 p-5 opacity-60",children:[o,d]}),e[12]=o,e[13]=m):m=e[13],m}function Ti(t){const e=T.c(33),{tile:s,prompts:r,isEditMode:n}=t,{open:a,startBlank:l,dialog:c,starting:o}=ye(s.agentId);let d,m,u;if(e[0]!==n||e[1]!==a||e[2]!==r||e[3]!==l||e[4]!==o||e[5]!==s.agentIcon||e[6]!==s.agentName){const x=r.filter(Ai);d="flex h-full w-full flex-col gap-3 p-4";let g;e[10]!==l?(g=()=>{l()},e[10]=l,e[11]=g):g=e[11];const h=o||n,p=n&&"pl-10 pr-10";let b;e[12]!==p?(b=q("flex items-center gap-3 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-ring",p),e[12]=p,e[13]=b):b=e[13];let v;e[14]!==s.agentIcon||e[15]!==s.agentName?(v=i.jsx(Y,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[14]=s.agentIcon,e[15]=s.agentName,e[16]=v):v=e[16];let w;e[17]!==s.agentName?(w=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:s.agentName}),e[17]=s.agentName,e[18]=w):w=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"UI unavailable — open chat"}),e[19]=y):y=e[19];let j;e[20]!==w?(j=i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[w,y]}),e[20]=w,e[21]=j):j=e[21],e[22]!==j||e[23]!==g||e[24]!==h||e[25]!==b||e[26]!==v?(m=i.jsxs("button",{type:"button",onClick:g,disabled:h,className:b,children:[v,j]}),e[22]=j,e[23]=g,e[24]=h,e[25]=b,e[26]=v,e[27]=m):m=e[27],u=x.length>0&&!n&&i.jsx("div",{className:"grid grid-cols-1 gap-2 overflow-hidden sm:grid-cols-2",children:x.map(N=>i.jsx("button",{type:"button",onClick:()=>!n&&a(N),disabled:o,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:i.jsx("span",{className:"line-clamp-2",children:N.title})},N.promptName))}),e[0]=n,e[1]=a,e[2]=r,e[3]=l,e[4]=o,e[5]=s.agentIcon,e[6]=s.agentName,e[7]=d,e[8]=m,e[9]=u}else d=e[7],m=e[8],u=e[9];let f;return e[28]!==c||e[29]!==d||e[30]!==m||e[31]!==u?(f=i.jsxs("div",{className:d,children:[m,u,c]}),e[28]=c,e[29]=d,e[30]=m,e[31]=u,e[32]=f):f=e[32],f}function Ai(t){return!!t.promptName}function Je(t){const e=T.c(36),{isEditMode:s}=t,{org:r}=J(),{isLoading:n,prompts:a,tiles:l}=be(r.slug),c=ze()?.ids??[];let o;e[0]!==c?(o=new Set(c),e[0]=c,e[1]=o):o=e[1];const d=o,m=Pe();let u;e[2]!==l?(u=new Set(l.map(Pi)),e[2]=l,e[3]=u):u=e[3];const f=u;let x;if(e[4]!==a){x=new Map;for(const _ of a){const I=x.get(_.agentId);I?I.push(_):x.set(_.agentId,[_])}e[4]=a,e[5]=x}else x=e[5];let g;if(e[6]!==a||e[7]!==f||e[8]!==l){let _;e[10]!==f?(_=O=>!f.has(O.agentId),e[10]=f,e[11]=_):_=e[11];const I=a.filter(_);g=[...l.map(zi),...I.map(Ri)],e[6]=a,e[7]=f,e[8]=l,e[9]=g}else g=e[9];const h=g;let p;e[12]!==h?(p=new Map(h.map(Oi)),e[12]=h,e[13]=p):p=e[13];const b=p;let v;e[14]!==h||e[15]!==d?(v=h.map(_=>({id:_.id,defaultSize:_.kind==="tile"?xi:bi,minSize:_.kind==="tile"?gi:void 0,pinned:d.has(_.data.agentId)})),e[14]=h,e[15]=d,e[16]=v):v=e[16];const w=hi(v);let y;e[17]!==m?(y=_=>{m.apply(I=>I.filter(O=>O!==_)).catch(Mi)},e[17]=m,e[18]=y):y=e[18];const j=y;let N;e[19]!==b||e[20]!==w||e[21]!==d||e[22]!==j?(N=_=>{const I=b.get(_);I&&d.has(I.data.agentId)?j(I.data.agentId):w.hideTile(_)},e[19]=b,e[20]=w,e[21]=d,e[22]=j,e[23]=N):N=e[23];const S=N;let k;e[24]!==b||e[25]!==s||e[26]!==x?(k=_=>{const I=b.get(_.id);if(!I)return null;if(I.kind==="tile"){const O=x.get(I.data.agentId)??[];return i.jsx(ut,{fallback:i.jsx(Ti,{tile:I.data,prompts:O,isEditMode:s}),children:i.jsx(A.Suspense,{fallback:i.jsx(Ii,{icon:I.data.agentIcon,name:I.data.agentName}),children:i.jsx(Ci,{tile:I.data,prompts:O,isEditMode:s,tileWidth:_.w})})})}return i.jsx(Ni,{entry:I.data,isEditMode:s})},e[24]=b,e[25]=s,e[26]=x,e[27]=k):k=e[27];const C=k;if(n||w.isLoading){let _;return e[28]===Symbol.for("react.memo_cache_sentinel")?(_=i.jsx(Si,{}),e[28]=_):_=e[28],_}if(w.snapshot.visible.length===0&&!s)return null;let E;return e[29]!==s||e[30]!==w.moveTile||e[31]!==w.resizeTile||e[32]!==w.snapshot.visible||e[33]!==S||e[34]!==C?(E=i.jsx("div",{className:"mt-4 flex w-full max-w-7xl flex-col gap-4",children:i.jsx(ri,{tiles:w.snapshot.visible,isEditMode:s,renderTile:C,onMove:w.moveTile,onResize:w.resizeTile,onRemove:S})}),e[29]=s,e[30]=w.moveTile,e[31]=w.resizeTile,e[32]=w.snapshot.visible,e[33]=S,e[34]=C,e[35]=E):E=e[35],E}function Mi(){return W.error("Couldn't remove from home — please try again.")}function Oi(t){return[t.id,t]}function Ri(t){return{kind:"prompt",id:yi(t),data:t}}function zi(t){return{kind:"tile",id:vi(t),data:t}}function Pi(t){return t.agentId}function Di(t){const e=T.c(2),{prompts:s,tiles:r}=be(t),n=r.length>0||s.length>0;let a;return e[0]!==n?(a={hasVisibleTiles:n},e[0]=n,e[1]=a):a=e[1],a}const Ce=420,ke=305;function Xe(){const t=T.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.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:Ce}}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=i.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:Ce}}),t[1]=s):s=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=i.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:ke}}),t[2]=r):r=t[2];let n;return t[3]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 overflow-hidden",children:[e,s,r,i.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:ke}})]}),t[3]=n):n=t[3],n}function Ee(){const t=T.c(33),{data:e}=ft.useSession(),{org:s}=J(),r=xe(),n=Et(),{selectedVirtualMcp:a}=$t();let l;t[0]!==s.id?(l=pt(s.id),t[0]=s.id,t[1]=l):l=t[1];const o=a??l;let d;t[2]!==s.slug?(d=Ft(s.slug),t[2]=s.slug,t[3]=d):d=t[3],re(d);let m;t[4]!==s.id||t[5]!==s.slug?(m={connectionId:xt,orgId:s.id,orgSlug:s.slug},t[4]=s.id,t[5]=s.slug,t[6]=m):m=t[6];const u=oe(m);let f;t[7]!==s.id||t[8]!==u?(f=ps(u,s.id),t[7]=s.id,t[8]=u,t[9]=f):f=t[9];let x;t[10]!==s.id||t[11]!==u?(x=Ut(u,s.id),t[10]=s.id,t[11]=u,t[12]=x):x=t[12];let g;t[13]!==o.id||t[14]!==s.id||t[15]!==u?(g=yt(s.id,o.id,u),t[13]=o.id,t[14]=s.id,t[15]=u,t[16]=g):g=t[16];let h;t[17]!==f||t[18]!==x||t[19]!==g?(h={queries:[f,x,g]},t[17]=f,t[18]=x,t[19]=g,t[20]=h):h=t[20],js(h);const p=xs(),b=vt(o.id),{hasDecoKey:v,isZeroBalance:w,isInitialFreeCredit:y,balanceDollars:j,hasOnlyDecoProvider:N}=Lt(),{hasVisibleTiles:S}=Di(s.slug),k=Ct(b?.metadata);if(p.length===0&&!(k&&kt(n))){let P;return t[21]===Symbol.for("react.memo_cache_sentinel")?(P=i.jsx("div",{className:"flex-1 overflow-y-auto",children:i.jsx("div",{className:"min-h-full flex items-center justify-center px-4 py-10",children:i.jsx(It,{})})}),t[21]=P):P=t[21],P}let $;t[22]!==e?.user?.name?($=e?.user?.name?.split(" ")[0]||"there",t[22]=e?.user?.name,t[23]=$):$=t[23];const E=$,_=v&&y&&j!=null,I=v&&w&&N;let O;t[24]!==j||t[25]!==_||t[26]!==I?(O=_?i.jsx(se.CreditsEyebrow,{balanceDollars:j}):I?i.jsx(se.NoCreditsEyebrow,{}):null,t[24]=j,t[25]=_,t[26]=I,t[27]=O):O=t[27];const B=O;let z;return t[28]!==B||t[29]!==S||t[30]!==r||t[31]!==E?(z=i.jsx(ti,{children:r?i.jsx(Hi,{eyebrow:B,userName:E}):i.jsx(Li,{eyebrow:B,userName:E,hasVisibleTiles:S})}),t[28]=B,t[29]=S,t[30]=r,t[31]=E,t[32]=z):z=t[32],z}function Hi(t){const e=T.c(12),{eyebrow:s,userName:r}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(Xe,{}),e[0]=n):n=e[0];let a;e[1]!==s?(a=s&&i.jsx("div",{className:"mb-4",children:s}),e[1]=s,e[2]=a):a=e[2];let l;e[3]!==r?(l=i.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 c;e[5]!==a||e[6]!==l?(c=i.jsxs("div",{className:"relative flex flex-col items-center justify-center w-full pt-28 pb-8 px-4",children:[a,l]}),e[5]=a,e[6]=l,e[7]=c):c=e[7];let o;e[8]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx("div",{className:"relative w-full flex flex-col gap-4 pb-8 px-4",children:i.jsx(se.Input,{showConnectionsBanner:!0})}),e[8]=o):o=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx("div",{className:"relative w-full px-4 pb-8",children:i.jsx(Je,{isEditMode:!1})}),e[9]=d):d=e[9];let m;return e[10]!==c?(m=i.jsxs("div",{className:"flex-1 relative flex flex-col items-center overflow-y-auto",children:[n,c,o,d]}),e[10]=c,e[11]=m):m=e[11],m}function Li(t){const e=T.c(32),{eyebrow:s,userName:r,hasVisibleTiles:n}=t,{isEditMode:a,enter:l,save:c,cancel:o,hasChanges:d}=Ve(),[m,u]=A.useState(!1);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),e[0]=f):f=e[0];let x;e[1]!==o||e[2]!==l||e[3]!==d||e[4]!==a||e[5]!==c?(x=i.jsx(gs.Right,{children:i.jsx(Ui,{isEditMode:a,hasChanges:d,onEnter:l,onSave:c,onCancel:o,onAddTile:f})}),e[1]=o,e[2]=l,e[3]=d,e[4]=a,e[5]=c,e[6]=x):x=e[6];let g;e[7]!==m?(g=i.jsx(ws,{open:m,onOpenChange:u}),e[7]=m,e[8]=g):g=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=i.jsx(Xe,{}),e[9]=h):h=e[9];const p=n||a?"pt-32":"flex-1 justify-center";let b;e[10]!==p?(b=q("relative flex flex-col items-center px-10 pb-4",p),e[10]=p,e[11]=b):b=e[11];let v;e[12]!==s?(v=s&&i.jsx("div",{className:"mb-4",children:s}),e[12]=s,e[13]=v):v=e[13];let w;e[14]!==r?(w=i.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 y;e[16]!==v||e[17]!==w?(y=i.jsxs("div",{className:"text-center mb-10",children:[v,w]}),e[16]=v,e[17]=w,e[18]=y):y=e[18];let j;e[19]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsxs("div",{className:"relative w-full",children:[i.jsx(Bi,{}),i.jsx(se.Input,{showConnectionsBanner:!0})]}),e[19]=j):j=e[19];let N;e[20]!==y?(N=i.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[y,j]}),e[20]=y,e[21]=N):N=e[21];let S;e[22]!==a?(S=i.jsx("div",{className:"relative w-full mt-10 mx-auto max-w-[1280px] px-2 pb-16",children:i.jsx(Je,{isEditMode:a})}),e[22]=a,e[23]=S):S=e[23];let k;e[24]!==N||e[25]!==S||e[26]!==b?(k=i.jsxs("div",{className:"flex-1 relative flex flex-col min-h-0",children:[h,i.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:i.jsxs("div",{className:b,children:[N,S]})})]}),e[24]=N,e[25]=S,e[26]=b,e[27]=k):k=e[27];let C;return e[28]!==k||e[29]!==x||e[30]!==g?(C=i.jsxs(i.Fragment,{children:[x,g,k]}),e[28]=k,e[29]=x,e[30]=g,e[31]=C):C=e[31],C}function Ui(t){const e=T.c(17),{isEditMode:s,hasChanges:r,onEnter:n,onSave:a,onCancel:l,onAddTile:c}=t;if(s){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(ge,{size:14}),e[0]=m):m=e[0];let u;e[1]!==c?(u=i.jsxs("button",{type:"button",onClick:c,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:[m,"Add tile"]}),e[1]=c,e[2]=u):u=e[2];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(Te,{size:14}),e[3]=f):f=e[3];let x;e[4]!==l?(x=i.jsxs(je,{size:"sm",variant:"ghost",onClick:l,className:"gap-1.5 h-7 text-xs",children:[f,"Cancel"]}),e[4]=l,e[5]=x):x=e[5];const g=!r;let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=i.jsx(jt,{size:14}),e[6]=h):h=e[6];let p;e[7]!==a||e[8]!==g?(p=i.jsxs(je,{size:"sm",onClick:a,disabled:g,className:"gap-1.5 h-7 text-xs",children:[h,"Save"]}),e[7]=a,e[8]=g,e[9]=p):p=e[9];let b;return e[10]!==u||e[11]!==x||e[12]!==p?(b=i.jsxs(i.Fragment,{children:[u,x,p]}),e[10]=u,e[11]=x,e[12]=p,e[13]=b):b=e[13],b}let o;e[14]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(_t,{size:14}),e[14]=o):o=e[14];let d;return e[15]!==n?(d=i.jsxs("button",{type:"button",onClick:n,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:[o,"Customize"]}),e[15]=n,e[16]=d):d=e[16],d}function Bi(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.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 Jr(){const t=T.c(2);if(xe()){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:i.jsx(Ee,{})}),t[0]=r):r=t[0],r}let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("div",{className:"flex-1 min-h-0 pb-1 pr-1 pl-0 pt-0",children:i.jsx("div",{className:"h-full p-0.5 pt-0.25",children:i.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:i.jsx(Ee,{})})})}),t[1]=s):s=t[1],s}export{Jr as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{e as S,r as E,j as t,m as J,B as T,K as M,c as Y,f as Ce,d as Se,E as re,p as $e,F as Ge,z as Xe,n as I}from"./index-
|
|
1
|
+
import{e as S,r as E,j as t,m as J,B as T,K as M,c as Y,f as Ce,d as Se,E as re,p as $e,F as Ge,z as Xe,n as I}from"./index-DnIoj8fl.js";import{i as Qe}from"./ChevronRight-CFv-fKpX.js";import{s as De}from"./Eye-BWJG0owY.js";import{n as ae,i as We}from"./Globe01-BOlA5Q_4.js";import{i as Ye,c as Ze}from"./ZoomOut-C-DjvL5K.js";import{s as Je}from"./Plus-CW5uSNYz.js";import{t as et}from"./Stars01-EGK20_72.js";import{i as ze}from"./Upload01-CYVliRf6.js";import{b as K,T as V,a as q,u as Fe}from"./tooltip-DG-C65pd.js";import{A as tt,a as lt,b as st,c as nt,d as it,e as rt,f as ot,g as at}from"./alert-dialog-DmwO1wKa.js";import{c as Z,D as ce,a as de,f as ct,b as dt,e as ft,d as mt}from"./dialog-DPVJEPrK.js";import{I as ut}from"./input-kFc4cqln.js";import{S as H}from"./skeleton-CyRCN25X.js";import{F as A,d as _e,M as ht}from"./file-type-icon-D93vAYh4.js";import{a as xt}from"./toolbar-WIS1-2Sy.js";import{i as Oe,j as Pe,H as Te,k as Ue,h as Ae,f as fe,F as Ee,a as me,m as Me,l as pt,u as ye,b as jt,n as Le,o as gt}from"./header-tab-button-zGw57zar.js";import{i as ue}from"./DotsVertical-Cv0q4Ifl.js";import{s as he}from"./Trash01-D5mmvxxB.js";import{i as Re}from"./Zap-CCChCiD-.js";import{a as xe,c as X,b as pe,D as je}from"./dropdown-menu-DOlfrN75.js";import{R as ve,a as bt,b as yt}from"./resizable-BCts7Hoe.js";import{n as Be}from"./LinkExternal01-CqMwbx5t.js";import{s as Ie}from"./XClose-knQz_HAN.js";import{i as vt}from"./X-Zx6WnCka.js";import"./Check-C_31_MJb.js";import"./ChevronLeft-ZCv3UA1e.js";import"./index-LekHmrTG.js";import"./LayoutLeft-DbIVXyve.js";const wt=new Set(["output","upload","public","home"]),Nt=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;function kt(l){return wt.has(l)||!Nt.test(l)?"home":l}function Ct(l){const e=S.c(33);let s,i,o;e[0]!==l?({glyph:s,readOnly:o,...i}=l,e[0]=l,e[1]=s,e[2]=i,e[3]=o):(s=e[1],i=e[2],o=e[3]);const c=E.useId(),r=`${c}-back`,a=`${c}-front`,n=`url(#${r})`;let d;e[4]!==n?(d=t.jsx("path",{d:"M2.53738 2.55C1.13602 2.55 0 3.68602 0 5.08738V11.535H31.931V7.65326C31.931 6.23616 30.7822 5.08738 29.3651 5.08738H14.7681L13.8775 5.02542C13.3886 4.99141 12.9197 4.81809 12.5261 4.52596L10.7726 3.22419C10.1828 2.78638 9.46784 2.55 8.73334 2.55H2.53738Z",fill:n}),e[4]=n,e[5]=d):d=e[5];const m=`url(#${a})`;let f;e[6]!==m?(f=t.jsx("rect",{y:"8.72",width:"32",height:"21",rx:"2.566",fill:m}),e[6]=m,e[7]=f):f=e[7];let u,g,b;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("rect",{x:"0.3",y:"8.86",width:"31.4",height:"0.55",rx:"0.275",fill:"#FFFFFF",opacity:"0.25"}),g=t.jsx("rect",{y:"25.81",width:"32",height:"0.552",fill:"#84CDFB"}),b=t.jsx("rect",{y:"27.05",width:"32",height:"0.552",fill:"#84CDFB"}),e[8]=u,e[9]=g,e[10]=b):(u=e[8],g=e[9],b=e[10]);let p;e[11]!==s?(p=s&&t.jsx(s,{x:10.5,y:13.2,width:11,height:11,strokeWidth:2.2,style:{color:"#014AC9",opacity:.55}}),e[11]=s,e[12]=p):p=e[12];let x;e[13]!==o?(x=o&&t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"25.5",cy:"25.5",r:"6.2",strokeWidth:"1",className:"fill-background stroke-border"}),t.jsx(De,{x:22.1,y:22.1,width:6.8,height:6.8,strokeWidth:2.2,className:"text-muted-foreground"})]}),e[13]=o,e[14]=x):x=e[14];let h,N;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("stop",{offset:"0.3",stopColor:"#4D87DF"}),N=t.jsx("stop",{offset:"1",stopColor:"#296FE8"}),e[15]=h,e[16]=N):(h=e[15],N=e[16]);let v;e[17]!==r?(v=t.jsxs("linearGradient",{id:r,x1:"15.97",y1:"2.55",x2:"15.97",y2:"9.53",gradientUnits:"userSpaceOnUse",children:[h,N]}),e[17]=r,e[18]=v):v=e[18];let w,j;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("stop",{stopColor:"#72B6FA"}),j=t.jsx("stop",{offset:"1",stopColor:"#5BB1EF"}),e[19]=w,e[20]=j):(w=e[19],j=e[20]);let C;e[21]!==a?(C=t.jsxs("radialGradient",{id:a,cx:"0",cy:"0",r:"10",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(1.6 0 0 2.1538 16 19.22)",children:[w,j]}),e[21]=a,e[22]=C):C=e[22];let k;e[23]!==v||e[24]!==C?(k=t.jsxs("defs",{children:[v,C]}),e[23]=v,e[24]=C,e[25]=k):k=e[25];let $;return e[26]!==i||e[27]!==k||e[28]!==d||e[29]!==f||e[30]!==p||e[31]!==x?($=t.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...i,children:[d,f,u,g,b,p,x,k]}),e[26]=i,e[27]=k,e[28]=d,e[29]=f,e[30]=p,e[31]=x,e[32]=$):$=e[32],$}function St(l){const e={};for(const s of l.split(`
|
|
2
2
|
`)){const i=s.match(/^([A-Za-z][\w-]*):\s*(.*)$/);i?.[1]&&i[2]!==void 0&&(e[i[1].toLowerCase()]=i[2].trim())}return e}function we(l){for(const e of l.split(/\n\s*\n/)){const s=e.trim();if(!(!s||s.startsWith("#")))return s.replace(/\n/g," ")}return null}function He(l){const e=l.match(/^---\n([\s\S]*?)\n---\n?/);if(!e||e[1]===void 0)return{name:null,description:we(l),body:l};const s=St(e[1]),i=l.slice(e[0].length);return{name:s.name||null,description:s.description||we(i),body:i}}const $t=new Set(["png","jpg","jpeg","gif","webp","svg","avif"]),Dt=new Set(["csv","tsv"]),zt=new Set(["mp4","webm","mov","m4v"]),Ft=new Set(["txt","md","markdown","json","log","yaml","yml","xml","html","htm"]),_t=256*1024;function ee(l){const e=new Date(l);if(Number.isNaN(e.getTime()))return"";const s=Date.now()-e.getTime(),i=Math.floor(s/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;const o=Math.floor(i/60);if(o<24)return`${o}h ago`;const c=Math.floor(o/24);return c<30?`${c}d ago`:e.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function Ot(l){return l.split(".").pop()?.toLowerCase()??""}function Ke(l){const e=S.c(15),{downloadUrl:s,filename:i,onDelete:o}=l,c=`Actions for ${i}`;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(ue,{size:14}),e[0]=r):r=e[0];let a;e[1]!==c?(a=t.jsx(xe,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",className:"size-6 shrink-0 opacity-0 transition-opacity group-hover/card:opacity-100 data-[state=open]:opacity-100",onClick:Tt,"aria-label":c,children:r})}),e[1]=c,e[2]=a):a=e[2];let n;e[3]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(ae,{size:14}),e[3]=n):n=e[3];let d;e[4]!==s||e[5]!==i?(d=t.jsx(X,{asChild:!0,children:t.jsxs("a",{href:s,download:i,children:[n,"Download"]})}),e[4]=s,e[5]=i,e[6]=d):d=e[6];let m;e[7]!==o?(m=o&&t.jsxs(X,{variant:"destructive",onClick:o,children:[t.jsx(he,{size:14}),"Delete"]}),e[7]=o,e[8]=m):m=e[8];let f;e[9]!==d||e[10]!==m?(f=t.jsxs(pe,{align:"end",onClick:Pt,children:[d,m]}),e[9]=d,e[10]=m,e[11]=f):f=e[11];let u;return e[12]!==a||e[13]!==f?(u=t.jsxs(je,{children:[a,f]}),e[12]=a,e[13]=f,e[14]=u):u=e[14],u}function Pt(l){return l.stopPropagation()}function Tt(l){return l.stopPropagation()}function te(l){const e=S.c(9),{onOpen:s,children:i,className:o}=l;let c;e[0]!==s?(c=n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),s())},e[0]=s,e[1]=c):c=e[1];let r;e[2]!==o?(r=Y("group/card flex cursor-pointer flex-col gap-3 rounded-2xl border border-border bg-background p-4 text-left transition-colors hover:border-border hover:bg-muted/40",o),e[2]=o,e[3]=r):r=e[3];let a;return e[4]!==i||e[5]!==s||e[6]!==c||e[7]!==r?(a=t.jsx("div",{role:"button",tabIndex:0,onClick:s,onKeyDown:c,className:r,children:i}),e[4]=i,e[5]=s,e[6]=c,e[7]=r,e[8]=a):a=e[8],a}function le(l){const e=S.c(16),{icon:s,name:i,meta:o,subtitle:c,actions:r}=l;let a;e[0]!==i?(a=t.jsx("span",{className:"min-w-0 flex-1 truncate text-[13px] text-foreground",title:i,children:i}),e[0]=i,e[1]=a):a=e[1];let n;e[2]!==o?(n=o&&t.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=n):n=e[3];let d;e[4]!==a||e[5]!==n?(d=t.jsxs("div",{className:"flex items-start gap-3",children:[a,n]}),e[4]=a,e[5]=n,e[6]=d):d=e[6];let m;e[7]!==c?(m=c&&t.jsx("span",{className:"text-xs text-muted-foreground",children:c}),e[7]=c,e[8]=m):m=e[8];let f;e[9]!==d||e[10]!==m?(f=t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col justify-center",children:[d,m]}),e[9]=d,e[10]=m,e[11]=f):f=e[11];let u;return e[12]!==r||e[13]!==s||e[14]!==f?(u=t.jsxs("div",{className:"flex w-full items-center gap-2.5",children:[s,f,r]}),e[12]=r,e[13]=s,e[14]=f,e[15]=u):u=e[15],u}function se(l){const e=S.c(15),{name:s,meta:i,subtitle:o,glyph:c,readOnly:r,onOpen:a,onDelete:n}=l;let d;e[0]!==c||e[1]!==r?(d=t.jsx(Ct,{glyph:c,readOnly:r,className:"size-8 shrink-0"}),e[0]=c,e[1]=r,e[2]=d):d=e[2];let m;e[3]!==s||e[4]!==n?(m=n?t.jsxs(je,{children:[t.jsx(xe,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",className:"size-6 shrink-0 opacity-0 transition-opacity group-hover/card:opacity-100 data-[state=open]:opacity-100",onClick:At,"aria-label":`Actions for ${s}`,children:t.jsx(ue,{size:14})})}),t.jsx(pe,{align:"end",onClick:Ut,children:t.jsxs(X,{variant:"destructive",onClick:n,children:[t.jsx(he,{size:14}),"Delete"]})})]}):void 0,e[3]=s,e[4]=n,e[5]=m):m=e[5];let f;e[6]!==i||e[7]!==s||e[8]!==o||e[9]!==d||e[10]!==m?(f=t.jsx(le,{icon:d,name:s,meta:i,subtitle:o,actions:m}),e[6]=i,e[7]=s,e[8]=o,e[9]=d,e[10]=m,e[11]=f):f=e[11];let u;return e[12]!==a||e[13]!==f?(u=t.jsx(te,{onOpen:a,children:f}),e[12]=a,e[13]=f,e[14]=u):u=e[14],u}function Ut(l){return l.stopPropagation()}function At(l){return l.stopPropagation()}function Ve(l){const e=S.c(19),{filename:s,updatedAt:i,downloadUrl:o,onOpen:c,onDelete:r}=l;let a;e[0]!==s?(a=t.jsx(A,{filename:s,className:"h-8 w-6.5 shrink-0"}),e[0]=s,e[1]=a):a=e[1];let n;e[2]!==i?(n=ee(i),e[2]=i,e[3]=n):n=e[3];let d;e[4]!==s?(d=_e(s),e[4]=s,e[5]=d):d=e[5];let m;e[6]!==o||e[7]!==s||e[8]!==r?(m=t.jsx(Ke,{downloadUrl:o,filename:s,onDelete:r}),e[6]=o,e[7]=s,e[8]=r,e[9]=m):m=e[9];let f;e[10]!==s||e[11]!==a||e[12]!==n||e[13]!==d||e[14]!==m?(f=t.jsx(le,{icon:a,name:s,meta:n,subtitle:d,actions:m}),e[10]=s,e[11]=a,e[12]=n,e[13]=d,e[14]=m,e[15]=f):f=e[15];let u;return e[16]!==c||e[17]!==f?(u=t.jsx(te,{onOpen:c,children:f}),e[16]=c,e[17]=f,e[18]=u):u=e[18],u}function Et(l){const e=S.c(36),{dirName:s,updatedAt:i,skillMdUrl:o,onOpen:c,onBrowse:r,onDelete:a}=l;let n;e[0]!==o?(n=M.fileText(o),e[0]=o,e[1]=n):n=e[1];let d;e[2]!==o?(d=async()=>{const F=await fetch(o,{credentials:"include"});if(!F.ok)throw new Error(`fetch failed: ${F.status}`);return F.text()},e[2]=o,e[3]=d):d=e[3];let m;e[4]!==n||e[5]!==d?(m={queryKey:n,queryFn:d,staleTime:6e4,retry:!1},e[4]=n,e[5]=d,e[6]=m):m=e[6];const{data:f}=J(m);let u;e[7]!==f?(u=f?He(f):null,e[7]=f,e[8]=u):u=e[8];const g=u;let b;e[9]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:t.jsx(Re,{size:16})}),e[9]=b):b=e[9];const p=g?.name??s;let x;e[10]!==i?(x=ee(i),e[10]=i,e[11]=x):x=e[11];const h=`Actions for ${s}`;let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(ue,{size:14}),e[12]=N):N=e[12];let v;e[13]!==h?(v=t.jsx(xe,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",className:"size-6 shrink-0 opacity-0 transition-opacity group-hover/card:opacity-100 data-[state=open]:opacity-100",onClick:Lt,"aria-label":h,children:N})}),e[13]=h,e[14]=v):v=e[14];let w;e[15]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(Ye,{size:14}),e[15]=w):w=e[15];let j;e[16]!==r?(j=t.jsxs(X,{onClick:r,children:[w,"Browse files"]}),e[16]=r,e[17]=j):j=e[17];let C;e[18]!==a?(C=a&&t.jsxs(X,{variant:"destructive",onClick:a,children:[t.jsx(he,{size:14}),"Delete"]}),e[18]=a,e[19]=C):C=e[19];let k;e[20]!==j||e[21]!==C?(k=t.jsxs(pe,{align:"end",onClick:Mt,children:[j,C]}),e[20]=j,e[21]=C,e[22]=k):k=e[22];let $;e[23]!==v||e[24]!==k?($=t.jsxs(je,{children:[v,k]}),e[23]=v,e[24]=k,e[25]=$):$=e[25];let z;e[26]!==$||e[27]!==p||e[28]!==x?(z=t.jsx(le,{icon:b,name:p,meta:x,subtitle:"Skill",actions:$}),e[26]=$,e[27]=p,e[28]=x,e[29]=z):z=e[29];const P=g?.description??"";let D;e[30]!==P?(D=t.jsx("p",{className:"line-clamp-2 min-h-8 text-xs leading-4 text-muted-foreground",children:P}),e[30]=P,e[31]=D):D=e[31];let y;return e[32]!==c||e[33]!==z||e[34]!==D?(y=t.jsxs(te,{onOpen:c,children:[z,D]}),e[32]=c,e[33]=z,e[34]=D,e[35]=y):y=e[35],y}function Mt(l){return l.stopPropagation()}function Lt(l){return l.stopPropagation()}function oe(l){const e=S.c(4),{children:s}=l,[i,o]=E.useState(!1);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=()=>n=>{if(!n)return;const d=new IntersectionObserver(m=>{const[f]=m;f?.isIntersecting&&(o(!0),d.disconnect())},{rootMargin:"200px"});d.observe(n)},e[0]=c):c=e[0];const[r]=E.useState(c);if(i){let n;return e[1]!==s?(n=t.jsx(t.Fragment,{children:s}),e[1]=s,e[2]=n):n=e[2],n}let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{ref:r,className:"h-full w-full"}),e[3]=a):a=e[3],a}function Rt(l){const e=S.c(11),{url:s}=l;let i;e[0]!==s?(i=M.fileText(s),e[0]=s,e[1]=i):i=e[1];let o;e[2]!==s?(o=async()=>{const d=await fetch(s,{credentials:"include"});if(!d.ok)throw new Error(`fetch failed: ${d.status}`);return d.text()},e[2]=s,e[3]=o):o=e[3];let c;e[4]!==i||e[5]!==o?(c={queryKey:i,queryFn:o,staleTime:6e4,retry:!1},e[4]=i,e[5]=o,e[6]=c):c=e[6];const{data:r}=J(c);if(!r)return null;let a;e[7]!==r?(a=r.slice(0,2e3),e[7]=r,e[8]=a):a=e[8];let n;return e[9]!==a?(n=t.jsx("pre",{className:"pointer-events-none h-full w-full overflow-hidden bg-background p-3 font-mono text-[9px] leading-[1.5] text-muted-foreground select-none",children:a}),e[9]=a,e[10]=n):n=e[10],n}function Bt(l){const e=S.c(23),{url:s,ext:i}=l;let o;e[0]!==s?(o=M.csvThumb(s),e[0]=s,e[1]=o):o=e[1];let c;e[2]!==s?(c=async()=>{const x=await fetch(s,{credentials:"include",headers:{Range:"bytes=0-8191"}});if(!x.ok)throw new Error(`fetch failed: ${x.status}`);return x.text()},e[2]=s,e[3]=c):c=e[3];let r;e[4]!==o||e[5]!==c?(r={queryKey:o,queryFn:c,staleTime:6e4,retry:!1},e[4]=o,e[5]=c,e[6]=r):r=e[6];const{data:a}=J(r);if(!a)return null;const n=i==="tsv"?" ":",";let d,m,f,u;if(e[7]!==a||e[8]!==n){u=Symbol.for("react.early_return_sentinel");e:{let x;e[13]!==n?(x=N=>N.split(n).slice(0,6).map(Kt),e[13]=n,e[14]=x):x=e[14];const h=a.split(`
|
|
3
3
|
`).filter(Boolean).slice(0,7).map(x);if(h.length===0){u=null;break e}f="pointer-events-none h-full w-full overflow-hidden bg-background p-2 select-none",m="w-full border-collapse",d=h.map(It)}e[7]=a,e[8]=n,e[9]=d,e[10]=m,e[11]=f,e[12]=u}else d=e[9],m=e[10],f=e[11],u=e[12];if(u!==Symbol.for("react.early_return_sentinel"))return u;let g;e[15]!==d?(g=t.jsx("tbody",{children:d}),e[15]=d,e[16]=g):g=e[16];let b;e[17]!==m||e[18]!==g?(b=t.jsx("table",{className:m,children:g}),e[17]=m,e[18]=g,e[19]=b):b=e[19];let p;return e[20]!==f||e[21]!==b?(p=t.jsx("div",{className:f,children:b}),e[20]=f,e[21]=b,e[22]=p):p=e[22],p}function It(l,e){return t.jsx("tr",{className:Y(e===0&&"bg-muted/50 font-medium"),children:l.map(Ht)},e)}function Ht(l,e){return t.jsx("td",{className:"max-w-[56px] overflow-hidden border border-border/30 px-1 py-px text-[7px] leading-[1.4] text-muted-foreground",style:{maxWidth:56},children:t.jsx("span",{className:"block truncate",children:l})},e)}function Kt(l){return l.trim().replace(/^"|"$/g,"")}function Vt(l){const e=S.c(14),{filename:s,size:i,downloadUrl:o}=l;let c;if(e[0]!==o||e[1]!==s||e[2]!==i){const r=Ot(s);let a;if($t.has(r)){let n;e[4]!==o?(n=t.jsx("img",{src:o,alt:"",loading:"lazy",className:"h-full w-full object-cover"}),e[4]=o,e[5]=n):n=e[5],a=n}else if(zt.has(r)){const n=`${o}#t=0.1`;let d;e[6]!==n?(d=t.jsx(oe,{children:t.jsx("video",{src:n,preload:"metadata",muted:!0,playsInline:!0,className:"pointer-events-none h-full w-full object-cover"})}),e[6]=n,e[7]=d):d=e[7],a=d}else if(r==="pdf"){let n;e[8]!==s?(n=t.jsx("div",{className:"flex h-full w-full items-center justify-center",children:t.jsx(A,{filename:s,className:"h-14 w-11 opacity-60"})}),e[8]=s,e[9]=n):n=e[9],a=n}else if(Dt.has(r))a=t.jsx(oe,{children:t.jsx(Bt,{url:o,ext:r})});else if(Ft.has(r)&&i<=_t){let n;e[10]!==o?(n=t.jsx(oe,{children:t.jsx(Rt,{url:o})}),e[10]=o,e[11]=n):n=e[11],a=n}else{let n;e[12]!==s?(n=t.jsx("div",{className:"flex h-full w-full items-center justify-center",children:t.jsx(A,{filename:s,className:"h-14 w-11 opacity-60"})}),e[12]=s,e[13]=n):n=e[13],a=n}c=t.jsx("div",{className:"aspect-[400/265] w-full overflow-hidden rounded-lg border border-border/60 bg-muted/30",children:a}),e[0]=o,e[1]=s,e[2]=i,e[3]=c}else c=e[3];return c}function qt(l){const e=S.c(24),s=l.onOpen;let i;e[0]!==l.filename?(i=t.jsx(A,{filename:l.filename,className:"h-8 w-6.5 shrink-0"}),e[0]=l.filename,e[1]=i):i=e[1];const o=l.filename;let c;e[2]!==l.updatedAt?(c=ee(l.updatedAt),e[2]=l.updatedAt,e[3]=c):c=e[3];let r;e[4]!==l.filename?(r=_e(l.filename),e[4]=l.filename,e[5]=r):r=e[5];let a;e[6]!==l.downloadUrl||e[7]!==l.filename||e[8]!==l.onDelete?(a=t.jsx(Ke,{downloadUrl:l.downloadUrl,filename:l.filename,onDelete:l.onDelete}),e[6]=l.downloadUrl,e[7]=l.filename,e[8]=l.onDelete,e[9]=a):a=e[9];let n;e[10]!==l.filename||e[11]!==i||e[12]!==c||e[13]!==r||e[14]!==a?(n=t.jsx(le,{icon:i,name:o,meta:c,subtitle:r,actions:a}),e[10]=l.filename,e[11]=i,e[12]=c,e[13]=r,e[14]=a,e[15]=n):n=e[15];let d;e[16]!==l.downloadUrl||e[17]!==l.filename||e[18]!==l.size?(d=t.jsx(Vt,{filename:l.filename,size:l.size,downloadUrl:l.downloadUrl}),e[16]=l.downloadUrl,e[17]=l.filename,e[18]=l.size,e[19]=d):d=e[19];let m;return e[20]!==l.onOpen||e[21]!==n||e[22]!==d?(m=t.jsxs(te,{onOpen:s,children:[n,d]}),e[20]=l.onOpen,e[21]=n,e[22]=d,e[23]=m):m=e[23],m}function ne(l){const e=l?l.split("/").filter(Boolean):[],s=e[0]==="public",i=s?e[1]??null:null,o=s?i?`public-${i}`:null:e[0]??null,c=(s?e.slice(2):e.slice(1)).join("/");return{segments:e,volume:o,dirPath:c,isPublic:s,publicSet:i,readOnly:s}}function W(l,e){return l.isPublic&&l.publicSet?`public/${l.publicSet}/${e}`:l.volume?`${l.volume}/${e}`:e}function O(l){const e=l.lastIndexOf("/");return e===-1?l:l.slice(e+1)}const Gt=l=>/\.html?$/i.test(l);function Xt(l){const e=S.c(26),{previewPath:s,onClose:i}=l;let o;e[0]!==s?(o=ne(s),e[0]=s,e[1]=o):o=e[1];const c=o,{volume:r,dirPath:a}=c,{data:n,isPending:d}=Oe(r,a),m=Pe(r??"");let f,u,g,b,p,x;if(e[2]!==m||e[3]!==n||e[4]!==a||e[5]!==d||e[6]!==i||e[7]!==s||e[8]!==r){const v=O(a),w=n&&n.kind==="file"?{key:s,filename:v,size:n.size,downloadUrl:m(n.path)}:null;u=ce,p=!0,e[15]!==i?(x=j=>{j||i()},e[15]=i,e[16]=x):x=e[16],f=de,g="flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-5xl!",b=w&&n&&Gt(v)?t.jsxs(t.Fragment,{children:[t.jsx(Z,{className:"sr-only",children:v}),t.jsx(Te,{readUrl:w.downloadUrl,marker:Ue(n),title:v,savePath:r==="home"?a:void 0,trailing:t.jsx("div",{className:"w-8 shrink-0"})},s)]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-11 shrink-0 items-center gap-1 border-b border-border/60 py-1 pr-12 pl-2",children:[t.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 px-2",children:[t.jsx(A,{filename:v,className:"h-4.5 w-3.5 shrink-0"}),t.jsx(Z,{className:"truncate text-xs font-medium text-foreground",children:v}),w&&t.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Ae(w.size)})]}),w&&t.jsxs(t.Fragment,{children:[t.jsxs(K,{children:[t.jsx(V,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",asChild:!0,children:t.jsx("a",{href:w.downloadUrl,download:w.filename,children:t.jsx(ae,{size:14})})})}),t.jsx(q,{side:"bottom",children:"Download"})]}),t.jsxs(K,{children:[t.jsx(V,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",onClick:()=>window.open(w.downloadUrl,"_blank","noopener"),children:t.jsx(Be,{size:14})})}),t.jsx(q,{side:"bottom",children:"Open in new tab"})]})]})]}),t.jsx("div",{className:"relative min-h-0 flex-1 bg-background",children:w?t.jsx(fe,{file:w}):d?t.jsx(Ee,{}):t.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[t.jsx(A,{filename:v,className:"h-7.5 w-6"}),t.jsx("span",{className:"text-sm text-muted-foreground",children:"This file is no longer available."})]})})]}),e[2]=m,e[3]=n,e[4]=a,e[5]=d,e[6]=i,e[7]=s,e[8]=r,e[9]=f,e[10]=u,e[11]=g,e[12]=b,e[13]=p,e[14]=x}else f=e[9],u=e[10],g=e[11],b=e[12],p=e[13],x=e[14];let h;e[17]!==f||e[18]!==g||e[19]!==b?(h=t.jsx(f,{className:g,children:b}),e[17]=f,e[18]=g,e[19]=b,e[20]=h):h=e[20];let N;return e[21]!==u||e[22]!==p||e[23]!==x||e[24]!==h?(N=t.jsx(u,{open:p,onOpenChange:x,children:h}),e[21]=u,e[22]=p,e[23]=x,e[24]=h,e[25]=N):N=e[25],N}const Qt=l=>/\.html?$/i.test(l);function Wt(l){const e=S.c(6),{onClose:s}=l;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ie,{size:14}),e[0]=i):i=e[0];let o;e[1]!==s?(o=t.jsx(V,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",onClick:s,children:i})}),e[1]=s,e[2]=o):o=e[2];let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(q,{side:"bottom",children:"Close"}),e[3]=c):c=e[3];let r;return e[4]!==o?(r=t.jsxs(K,{children:[o,c]}),e[4]=o,e[5]=r):r=e[5],r}function Yt(l){const e=S.c(49),{previewPath:s,onClose:i}=l;let o;e[0]!==s?(o=ne(s),e[0]=s,e[1]=o):o=e[1];const c=o,{volume:r,dirPath:a}=c,{data:n,isPending:d}=Oe(r,a),m=Pe(r??"");let f,u,g,b,p,x,h,N,v;if(e[2]!==m||e[3]!==n||e[4]!==a||e[5]!==i||e[6]!==s||e[7]!==r){v=Symbol.for("react.early_return_sentinel");e:{if(u=O(a),f=n&&n.kind==="file"?{key:s,filename:u,size:n.size,downloadUrl:m(n.path)}:null,f&&n&&Qt(u)){const F=f.downloadUrl;let U;e[17]!==n?(U=Ue(n),e[17]=n,e[18]=U):U=e[18];let B;e[19]!==i?(B=t.jsx(Wt,{onClose:i}),e[19]=i,e[20]=B):B=e[20],v=t.jsx(Te,{readUrl:F,marker:U,title:u,savePath:r==="home"?a:void 0,trailing:B},s);break e}N="flex h-full w-full flex-col bg-background",h="flex h-9 shrink-0 items-center gap-1 border-b border-border/60 px-2",g="flex min-w-0 flex-1 items-center gap-2 px-2",b=t.jsx(A,{filename:u,className:"h-4.5 w-3.5 shrink-0"}),e[21]!==u?(p=t.jsx("span",{className:"truncate text-xs font-medium text-foreground",children:u}),e[21]=u,e[22]=p):p=e[22],x=f&&t.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Ae(f.size)})}e[2]=m,e[3]=n,e[4]=a,e[5]=i,e[6]=s,e[7]=r,e[8]=f,e[9]=u,e[10]=g,e[11]=b,e[12]=p,e[13]=x,e[14]=h,e[15]=N,e[16]=v}else f=e[8],u=e[9],g=e[10],b=e[11],p=e[12],x=e[13],h=e[14],N=e[15],v=e[16];if(v!==Symbol.for("react.early_return_sentinel"))return v;let w;e[23]!==g||e[24]!==b||e[25]!==p||e[26]!==x?(w=t.jsxs("div",{className:g,children:[b,p,x]}),e[23]=g,e[24]=b,e[25]=p,e[26]=x,e[27]=w):w=e[27];let j;e[28]!==f?(j=f&&t.jsxs(t.Fragment,{children:[t.jsxs(K,{children:[t.jsx(V,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",asChild:!0,children:t.jsx("a",{href:f.downloadUrl,download:f.filename,children:t.jsx(ae,{size:14})})})}),t.jsx(q,{side:"bottom",children:"Download"})]}),t.jsxs(K,{children:[t.jsx(V,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",onClick:()=>window.open(f.downloadUrl,"_blank","noopener"),children:t.jsx(Be,{size:14})})}),t.jsx(q,{side:"bottom",children:"Open in new tab"})]})]}),e[28]=f,e[29]=j):j=e[29];let C;e[30]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Ie,{size:14}),e[30]=C):C=e[30];let k;e[31]!==i?(k=t.jsx(V,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",onClick:i,children:C})}),e[31]=i,e[32]=k):k=e[32];let $;e[33]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(q,{side:"bottom",children:"Close"}),e[33]=$):$=e[33];let z;e[34]!==k?(z=t.jsxs(K,{children:[k,$]}),e[34]=k,e[35]=z):z=e[35];let P;e[36]!==j||e[37]!==z||e[38]!==h||e[39]!==w?(P=t.jsxs("div",{className:h,children:[w,j,z]}),e[36]=j,e[37]=z,e[38]=h,e[39]=w,e[40]=P):P=e[40];let D;e[41]!==f||e[42]!==u||e[43]!==d?(D=t.jsx("div",{className:"relative min-h-0 flex-1",children:f?t.jsx(fe,{file:f}):d?t.jsx(Ee,{}):t.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[t.jsx(A,{filename:u,className:"h-7.5 w-6"}),t.jsx("span",{className:"text-sm text-muted-foreground",children:"This file is no longer available."})]})}),e[41]=f,e[42]=u,e[43]=d,e[44]=D):D=e[44];let y;return e[45]!==P||e[46]!==D||e[47]!==N?(y=t.jsxs("div",{className:N,children:[P,D]}),e[45]=P,e[46]=D,e[47]=N,e[48]=y):y=e[48],y}function Zt(l){const e=S.c(21),{skillPath:s,onClose:i}=l,o=ne(s),{volume:c,dirPath:r}=o,a=me(),n=a(c??"",`${r}/SKILL.md`),d=M.fileText(n);let m;e[0]!==n?(m=async()=>{const _=await fetch(n,{credentials:"include"});if(!_.ok)throw new Error(`fetch failed: ${_.status}`);return _.text()},e[0]=n,e[1]=m):m=e[1];let f;e[2]!==d||e[3]!==m?(f={queryKey:d,queryFn:m,staleTime:6e4,retry:!1},e[2]=d,e[3]=m,e[4]=f):f=e[4];const u=J(f),g=Me(c??"",r);let b;e[5]!==r?(b=O(r),e[5]=r,e[6]=b):b=e[6];const p=b;let x;e[7]!==u.data?(x=u.data?He(u.data):null,e[7]=u.data,e[8]=x):x=e[8];const h=x,N=el;let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=(_,G)=>N(_.path)?-1:N(G.path)?1:O(_.path).localeCompare(O(G.path)),e[9]=v):v=e[9];const w=(g.data??[]).filter(Jt).sort(v),[j,C]=E.useState(null),k=j===null?null:w.find(_=>_.path===j)??null;let $;e[10]!==i?($=_=>{_||i()},e[10]=i,e[11]=$):$=e[11];let z;e[12]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:t.jsx(Re,{size:18})}),e[12]=z):z=e[12];const P=h?.name??p;let D;e[13]!==P?(D=t.jsx(Z,{className:"flex-1 truncate text-base font-medium text-foreground",children:P}),e[13]=P,e[14]=D):D=e[14];let y;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(ct,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",className:"size-8 shrink-0",children:t.jsx(vt,{size:16})})}),e[15]=y):y=e[15];let F;e[16]!==D?(F=t.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[z,D,y]}),e[16]=D,e[17]=F):F=e[17];let U;e[18]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx("p",{className:"px-2 py-1.5 text-sm font-medium text-foreground",children:"Files"}),e[18]=U):U=e[18];const B="relative flex min-w-0 flex-1 flex-col overflow-y-auto",ie=k?t.jsx(fe,{file:{key:k.path,filename:O(k.path),size:k.size,downloadUrl:a(c??"",k.path)}}):u.isPending?t.jsxs("div",{className:"flex flex-col gap-2 p-6",children:[t.jsx(H,{className:"h-4 w-1/3"}),t.jsx(H,{className:"h-3 w-full"}),t.jsx(H,{className:"h-3 w-5/6"}),t.jsx(H,{className:"h-3 w-2/3"})]}):u.isError||!h?t.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"This skill is no longer available."}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex flex-col gap-4 border-b border-border p-6",children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Description"}),t.jsx("p",{className:"text-base text-muted-foreground",children:h.description??"Claude Code skill"})]}),t.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none p-6",children:t.jsx(ht,{id:`skill-preview-${s}`,text:h.body})})]});let Q;return e[19]!==ie?(Q=t.jsx("div",{className:B,children:ie}),e[19]=ie,e[20]=Q):Q=e[20],t.jsx(ce,{open:!0,onOpenChange:$,children:t.jsxs(de,{className:"flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-5xl!",closeButtonClassName:"hidden",children:[F,t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsxs("div",{className:"flex w-[220px] shrink-0 flex-col gap-1 overflow-y-auto border-r border-border bg-muted p-3",children:[U,g.isPending?t.jsx(H,{className:"mx-2 h-4 w-24"}):w.map(_=>{const G=N(_.path)?k===null:j===_.path;return t.jsxs("button",{type:"button",onClick:()=>C(N(_.path)?null:_.path),className:Y("flex items-center gap-2.5 rounded-lg px-2 py-1.5 text-left",G?"bg-background shadow-sm":"hover:bg-muted/60"),children:[t.jsx(A,{filename:O(_.path),className:"h-6 w-5 shrink-0"}),t.jsx("span",{className:Y("truncate text-sm",G?"text-foreground":"text-muted-foreground"),children:O(_.path)})]},_.path)})]}),Q]})]})})}function Jt(l){return l.kind==="file"}function el(l){return O(l)==="SKILL.md"}const qe=[{id:"home",description:"Your organization's home folder",glyph:Ze},{id:"uploads",description:"Files your team uploads",glyph:ze},{id:"outputs",description:"Agent run outputs",glyph:et}],Ne=3;function R(l){const e=S.c(2),{children:s}=l;let i;return e[0]!==s?(i=t.jsx("p",{className:"text-[13px] text-foreground",children:s}),e[0]=s,e[1]=i):i=e[1],i}function L(l){const e=S.c(2),{children:s}=l;let i;return e[0]!==s?(i=t.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:s}),e[0]=s,e[1]=i):i=e[1],i}function ge(l){const e=S.c(2),{rows:s}=l,i=s===void 0?1:s;let o;return e[0]!==i?(o=t.jsx(L,{children:Array.from({length:i*3},tl)}),e[0]=i,e[1]=o):o=e[1],o}function tl(l,e){return t.jsx(H,{className:"h-16 rounded-2xl"},e)}function be(l){const e=S.c(2),{children:s}=l;let i;return e[0]!==s?(i=t.jsx("p",{className:"text-sm text-muted-foreground",children:s}),e[0]=s,e[1]=i):i=e[1],i}function ll(l){const e=S.c(6),{volume:s,displayName:i,description:o,glyph:c,onOpen:r}=l,a=gt(s),n=i??s,d=a.data?`${a.data.files} files`:void 0;let m;return e[0]!==o||e[1]!==c||e[2]!==r||e[3]!==n||e[4]!==d?(m=t.jsx(se,{name:n,meta:d,subtitle:o,glyph:c,onOpen:r}),e[0]=o,e[1]=c,e[2]=r,e[3]=n,e[4]=d,e[5]=m):m=e[5],m}function sl(l){const e=S.c(8),{segments:s,onNavigate:i}=l;let o;e[0]!==i?(o=t.jsx("button",{type:"button",className:"text-muted-foreground hover:text-foreground hover:underline",onClick:()=>i(""),children:"Library"}),e[0]=i,e[1]=o):o=e[1];let c;e[2]!==i||e[3]!==s?(c=s.map((a,n)=>{const d=s.slice(0,n+1).join("/"),m=n===s.length-1;return t.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[t.jsx(Qe,{size:12,className:"shrink-0 text-muted-foreground"}),m?t.jsx("span",{className:"truncate font-medium text-foreground",children:a}):t.jsx("button",{type:"button",className:"truncate text-muted-foreground hover:text-foreground hover:underline",onClick:()=>i(d),children:a})]},d)}),e[2]=i,e[3]=s,e[4]=c):c=e[4];let r;return e[5]!==o||e[6]!==c?(r=t.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1 text-sm",children:[o,c]}),e[5]=o,e[6]=c,e[7]=r):r=e[7],r}function nl(l){const e=S.c(19),{onOpenDir:s,onOpenFile:i,onDelete:o}=l,{org:c}=$e(),r=jt(),a=Le(),n=me();let d;if(e[0]!==n||e[1]!==o||e[2]!==s||e[3]!==i||e[4]!==c||e[5]!==a.data?.length||e[6]!==r.data||e[7]!==r.isPending){const m=r.data??[],f=m.slice(0,Ne),u=m.slice(Ne);let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(R,{children:"Folders"}),e[9]=g):g=e[9];let b;e[10]!==s||e[11]!==c?(b=qe.map(h=>t.jsx(ll,{volume:h.id,displayName:h.id==="home"?kt(c.slug):void 0,description:h.description,glyph:h.glyph,onOpen:()=>s(h.id)},h.id)),e[10]=s,e[11]=c,e[12]=b):b=e[12];let p;e[13]!==s||e[14]!==a.data?.length?(p=(a.data?.length??0)>0&&t.jsx(se,{name:"public",meta:`${a.data?.length} sets`,subtitle:"Curated skill sets — read-only",glyph:We,readOnly:!0,onOpen:()=>s("public")}),e[13]=s,e[14]=a.data?.length,e[15]=p):p=e[15];let x;e[16]!==b||e[17]!==p?(x=t.jsxs("div",{className:"flex flex-col gap-3",children:[g,t.jsxs(L,{children:[b,p]})]}),e[16]=b,e[17]=p,e[18]=x):x=e[18],d=t.jsxs(t.Fragment,{children:[r.isPending?t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(R,{children:"Recently added"}),t.jsx(ge,{})]}):f.length>0?t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(R,{children:"Recently added"}),t.jsx(L,{children:f.map(h=>t.jsx(qt,{filename:O(h.path),updatedAt:h.updatedAt,size:h.size,downloadUrl:n(h.volume,h.path),onOpen:()=>i(`${h.volume}/${h.path}`),onDelete:()=>o({volume:h.volume,path:h.path,kind:"file"})},`${h.volume}/${h.path}`))})]}):t.jsx(be,{children:"No files yet — upload one, or ask an agent to produce something."}),x,u.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(R,{children:"All files"}),t.jsx(L,{children:u.map(h=>t.jsx(Ve,{filename:O(h.path),updatedAt:h.updatedAt,downloadUrl:n(h.volume,h.path),onOpen:()=>i(`${h.volume}/${h.path}`),onDelete:()=>o({volume:h.volume,path:h.path,kind:"file"})},`${h.volume}/${h.path}`))})]})]}),e[0]=n,e[1]=o,e[2]=s,e[3]=i,e[4]=c,e[5]=a.data?.length,e[6]=r.data,e[7]=r.isPending,e[8]=d}else d=e[8];return d}function il(l){const e=S.c(11),{onOpenDir:s}=l,i=Le();if(i.isPending){let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(ge,{}),e[0]=n):n=e[0],n}let o;e[1]!==i.data?(o=i.data??[],e[1]=i.data,e[2]=o):o=e[2];const c=o;if(c.length===0){let n;return e[3]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(be,{children:"No public skill sets are configured."}),e[3]=n):n=e[3],n}let r;if(e[4]!==s||e[5]!==c){let n;e[7]!==s?(n=d=>t.jsx(se,{name:d,subtitle:"Read-only",readOnly:!0,onOpen:()=>s(`public/${d}`)},d),e[7]=s,e[8]=n):n=e[8],r=c.map(n),e[4]=s,e[5]=c,e[6]=r}else r=e[6];let a;return e[9]!==r?(a=t.jsx(L,{children:r}),e[9]=r,e[10]=a):a=e[10],a}function rl(l){const e=S.c(25),{location:s,onOpenDir:i,onOpenFile:o,onOpenSkill:c,onDelete:r}=l,a=s.volume??"",n=Me(a,s.dirPath),d=me();if(n.isPending){let p;return e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(ge,{rows:2}),e[0]=p):p=e[0],p}if(n.isError){const p=n.error instanceof Error?n.error.message:"Failed to load";let x;return e[1]!==p?(x=t.jsx("p",{className:"text-sm text-destructive",children:p}),e[1]=p,e[2]=x):x=e[2],x}let m,f,u,g;if(e[3]!==d||e[4]!==n.data||e[5]!==s||e[6]!==r||e[7]!==i||e[8]!==o||e[9]!==c||e[10]!==a){g=Symbol.for("react.early_return_sentinel");e:{const p=n.data??[],x=p.filter(cl),h=p.filter(al),N=p.filter(ol);if(p.length===0){const j=s.readOnly?"Empty — this read-only set syncs from its GitHub source.":"Empty folder — upload a file or create a folder to get started.";let C;e[15]!==j?(C=t.jsx(be,{children:j}),e[15]=j,e[16]=C):C=e[16],g=C;break e}let v;e[17]!==s.readOnly||e[18]!==r||e[19]!==a?(v=j=>s.readOnly?void 0:()=>r({volume:a,path:j.path,kind:j.kind}),e[17]=s.readOnly,e[18]=r,e[19]=a,e[20]=v):v=e[20];const w=v;m=x.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(R,{children:"Skills"}),t.jsx(L,{children:x.map(j=>t.jsx(Et,{dirName:O(j.path),updatedAt:j.updatedAt,skillMdUrl:d(a,`${j.path}/SKILL.md`),onOpen:()=>c(W(s,j.path)),onBrowse:()=>i(W(s,j.path)),onDelete:w(j)},j.path))})]}),f=h.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(R,{children:"Folders"}),t.jsx(L,{children:h.map(j=>t.jsx(se,{name:O(j.path),meta:ee(j.updatedAt),readOnly:s.readOnly,onOpen:()=>i(W(s,j.path)),onDelete:w(j)},j.path))})]}),u=N.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(R,{children:"Files"}),t.jsx(L,{children:N.map(j=>t.jsx(Ve,{filename:O(j.path),updatedAt:j.updatedAt,downloadUrl:d(a,j.path),onOpen:()=>o(W(s,j.path)),onDelete:w(j)},j.path))})]})}e[3]=d,e[4]=n.data,e[5]=s,e[6]=r,e[7]=i,e[8]=o,e[9]=c,e[10]=a,e[11]=m,e[12]=f,e[13]=u,e[14]=g}else m=e[11],f=e[12],u=e[13],g=e[14];if(g!==Symbol.for("react.early_return_sentinel"))return g;let b;return e[21]!==m||e[22]!==f||e[23]!==u?(b=t.jsxs(t.Fragment,{children:[m,f,u]}),e[21]=m,e[22]=f,e[23]=u,e[24]=b):b=e[24],b}function ol(l){return l.kind==="file"}function al(l){return l.kind==="dir"&&!l.hasSkill}function cl(l){return l.kind==="dir"&&l.hasSkill}function ke(){const{org:l}=$e(),e=Ge(),s=Ce(),i=Fe(),o=Se({strict:!1}),c=o.path??"",r=ne(c),a=r.segments.length===0,n=(y,F)=>s({to:".",search:U=>({...U,[y]:F||void 0})}),d=y=>n("path",y),m=y=>n("preview",y),f=y=>n("skill",y),[u,g]=E.useState(null),[b,p]=E.useState(!1),[x,h]=E.useState(""),N=E.useRef(null),v=r.readOnly?null:r.volume??"uploads",w=r.volume?r.dirPath:"",{upload:j,mkdir:C}=ye(v??"uploads"),{remove:k}=ye(u?.volume??"uploads");async function $(y){if(!(!v||!y||y.length===0))try{await j.mutateAsync({dir:w,files:[...y]}),I.success(y.length===1?`Uploaded ${y[0]?.name}`:`Uploaded ${y.length} files`)}catch(F){I.error(F instanceof Error?F.message:"Upload failed")}finally{N.current&&(N.current.value="")}}async function z(){const y=x.trim();if(!(!v||!y))try{await C.mutateAsync(w?`${w}/${y}`:y),I.success(`Folder "${y}" created`),p(!1),h("")}catch(F){I.error(F instanceof Error?F.message:"Failed to create folder")}}async function P(){if(!u)return;const y=u;try{await k.mutateAsync(y.path),I.success(`Deleted ${O(y.path)}`)}catch(F){I.error(F instanceof Error?F.message:"Delete failed")}finally{g(null)}}function D(){for(const y of qe)e.invalidateQueries({queryKey:M.orgFsVolume(l.id,y.id)});r.volume&&e.invalidateQueries({queryKey:M.orgFsVolume(l.id,r.volume)}),e.invalidateQueries({queryKey:M.orgFsRecent(l.id)}),e.invalidateQueries({queryKey:M.orgFsPublicSets(l.id)})}return t.jsxs("div",{className:"h-full overflow-y-auto",children:[t.jsxs("div",{className:"mx-auto flex w-full max-w-[900px] flex-col gap-10 px-6 py-10 lg:px-10",children:[t.jsxs("div",{className:"flex flex-col gap-2",children:[!a&&t.jsx(sl,{segments:r.segments,onNavigate:d}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("h1",{className:"min-w-0 flex-1 truncate text-xl font-medium text-foreground",children:a?"Library":r.segments.at(-1)??"Library"}),t.jsx(T,{variant:"ghost",size:"icon",onClick:D,"aria-label":"Refresh",children:t.jsx(Xe,{size:14})}),!a&&v&&t.jsxs(T,{variant:"outline",size:"sm",onClick:()=>p(!0),children:[t.jsx(Je,{size:14}),"New folder"]}),r.readOnly?t.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[t.jsx(De,{size:12}),"Read-only"]}):t.jsxs(T,{size:"sm",disabled:j.isPending,onClick:()=>N.current?.click(),children:[t.jsx(ze,{size:14}),j.isPending?"Uploading…":"Upload file"]}),t.jsx("input",{ref:N,type:"file",multiple:!0,className:"hidden",onChange:y=>{$(y.target.files)}})]})]}),a?t.jsx(nl,{onOpenDir:d,onOpenFile:m,onDelete:g}):r.volume===null?t.jsx(il,{onOpenDir:d}):t.jsx(rl,{location:r,onOpenDir:d,onOpenFile:m,onOpenSkill:f,onDelete:g},r.volume)]}),o.preview?i&&t.jsx(Xt,{previewPath:o.preview,onClose:()=>n("preview",null)}):o.skill?t.jsx(Zt,{skillPath:o.skill,onClose:()=>n("skill",null)},o.skill):null,t.jsx(ce,{open:b,onOpenChange:p,children:t.jsxs(de,{children:[t.jsxs(dt,{children:[t.jsx(Z,{children:"New folder"}),t.jsxs(ft,{children:["Create a folder in ",c||"the library","."]})]}),t.jsx(ut,{autoFocus:!0,placeholder:"folder-name",value:x,onChange:y=>h(y.target.value),onKeyDown:y=>{y.key==="Enter"&&z()}}),t.jsxs(mt,{children:[t.jsx(T,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),t.jsx(T,{disabled:!x.trim()||C.isPending,onClick:()=>{z()},children:"Create"})]})]})}),t.jsx(tt,{open:u!==null,onOpenChange:y=>{y||g(null)},children:t.jsxs(lt,{children:[t.jsxs(st,{children:[t.jsxs(nt,{children:["Delete ",u?O(u.path):"","?"]}),t.jsx(it,{children:u?.kind==="dir"?"The folder and everything inside it will be deleted for the whole organization. Sandboxes see this change within seconds.":"The file will be deleted for the whole organization. Sandboxes see this change within seconds."})]}),t.jsxs(rt,{children:[t.jsx(ot,{children:"Cancel"}),t.jsx(at,{onClick:()=>{P()},children:"Delete"})]})]})})]})}function Ll(){const l=S.c(13),e=Fe(),s=Ce();let i;l[0]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},l[0]=i):i=l[0];const c=Se(i).preview;let r;l[1]!==c?(r=c?O(c):"",l[1]=c,l[2]=r):r=l[2];const a=r;let n;l[3]!==s?(n=()=>s({to:".",search:dl}),l[3]=s,l[4]=n):n=l[4];const d=n;if(e){let g;return l[5]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden bg-background",children:t.jsx(re,{children:t.jsx(ke,{})})}),l[5]=g):g=l[5],g}let m;l[6]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(ve,{order:1,minSize:30,defaultSize:55,children:t.jsx("div",{className:"h-full p-0.5 pt-0.25",children:t.jsx("div",{className:"card-shadow flex h-full flex-col overflow-hidden rounded-[0.75rem] bg-background",children:t.jsx(re,{children:t.jsx(ke,{})})})})}),l[6]=m):m=l[6];let f;l[7]!==d||l[8]!==a||l[9]!==c?(f=c&&t.jsxs(t.Fragment,{children:[t.jsx(xt.Tabs,{children:t.jsx(pt,{title:a,icon:{kind:"component",Component:g=>t.jsx(A,{filename:a,...g})},active:!0,onClick:d})}),t.jsx(bt,{className:"bg-sidebar"}),t.jsx(ve,{order:2,minSize:25,defaultSize:45,children:t.jsx("div",{className:"h-full p-0.5 pt-0.25",children:t.jsx("div",{className:"card-shadow flex h-full flex-col overflow-hidden rounded-[0.75rem] bg-background",children:t.jsx(re,{children:t.jsx(Yt,{previewPath:c,onClose:d})})})})})]}),l[7]=d,l[8]=a,l[9]=c,l[10]=f):f=l[10];let u;return l[11]!==f?(u=t.jsxs(yt,{direction:"horizontal",className:"min-h-0 flex-1 pt-0 pr-1 pb-1 pl-0",children:[m,f]}),l[11]=f,l[12]=u):u=l[12],u}function dl(l){return{...l,preview:void 0}}export{Ll as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as le,r as K,f as bt,p as Be,j as t,B as Z,n as Ce,c as ce,K as it,m as yt,s as ss,d as rs,t as xt,E as ls}from"./index-
|
|
1
|
+
import{e as le,r as K,f as bt,p as Be,j as t,B as Z,n as Ce,c as ce,K as it,m as yt,s as ss,d as rs,t as xt,E as ls}from"./index-DnIoj8fl.js";import{S as os}from"./search-input-B3XYdfeF.js";import{P as Me}from"./index-NebhiVVQ.js";import{E as wt}from"./empty-state-xh_20twO.js";import{R as as}from"./require-capability-CJqD_sNw.js";import{o as kt}from"./pair-CC2q5WhY.js";import{B as rt}from"./badge-CKyeE-oo.js";import{P as ct,a as dt,b as mt}from"./popover-DFBV-kft.js";import{b as Ze,T as et,a as tt}from"./tooltip-DG-C65pd.js";import{i as ft}from"./Check-C_31_MJb.js";import{a as Xe}from"./Eye-BWJG0owY.js";import{n as Tt}from"./Globe01-BOlA5Q_4.js";import{i as Pt}from"./FilterLines-B1BriWf_.js";import{i as ns}from"./Key01-5jFctNvh.js";import{i as is}from"./Play-BXDltgp7.js";import{a9 as cs,aa as ds,R as ms,G as us}from"./agent-icon-C4vLfyZT.js";import{M as Mt}from"./monaco-editor-MWSSoG2S.js";import{u as xs}from"./use-members-oxzMf6HC.js";import{u as _t}from"./use-connection-DUYQMDLQ.js";import{a as fs,u as ps,W as hs}from"./use-mcp-client-DAanazcB.js";import{a as gs}from"./use-virtual-mcp-B4MbUdTW.js";import{n as Qe}from"./Container-BNV-9MJ8.js";import{c as js}from"./SwitchHorizontal01-a-r60L2U.js";import{s as vs}from"./Plus-CW5uSNYz.js";import{s as Ns}from"./Trash01-D5mmvxxB.js";import{I as Ge}from"./input-kFc4cqln.js";import{g as bs,b as Dt,f as st,a as At,c as pt,d as ys,e as Lt,h as Vt,A as ws,T as Ss,i as Is,M as ht}from"./automation-runs-CW_yJDML.js";import{S as lt,a as ot,b as at,c as Re,d as nt}from"./select-B_xVBVbm.js";import{S as Cs}from"./scroll-area-DXdZCfi_.js";import{t as Ut}from"./ChevronDown-ciuU2nWp.js";import{C as ks}from"./calendar-0t1uXfLL.js";import{T as Ts}from"./textarea-BuPx5SDQ.js";import{C as Kt}from"./collection-tabs-DvXat67P.js";import{S as Ms}from"./switch-9AraHuPG.js";import{L as _s}from"./label-Bvw0Ied9.js";import{I as qe}from"./integration-icon-D3EQp4Fu.js";import{A as qt}from"./avatar-DdLkUzB6.js";import{A as Ds,a as Ls,b as Rs}from"./alert-Bw1ORE7l.js";import{C as Bt}from"./card-DP32GBOf.js";import{K as ke}from"./monitoring-stats-row-EcWn-b5L.js";import{u as Ht}from"./studio-tools-CYvl10tJ.js";import{g as Fs}from"./connection-slug-eyAPH6o3.js";import{u as $s}from"./useSuspenseInfiniteQuery-CqnU8D2I.js";import{d as zs,S as Os,a as Es,b as Ps}from"./sheet-B3GYGLhe.js";import{T as De,a as ut,b as Jt,c as Gt,d as Qt,e as oe}from"./table-D-eZ2Wly.js";import{n as As}from"./ChevronUp-C64rGI06.js";import{u as Vs}from"./use-infinite-scroll-HMRo8z7S.js";import{c as Us,b as Ks}from"./use-automations-QDhIwpIJ.js";import"./SearchMd-Bz4Ykghd.js";import"./sidebar-kyVuWucL.js";import"./LayoutLeft-DbIVXyve.js";import"./use-capability-DQgRY6_x.js";import"./access-gate-DXAe84jj.js";import"./capability-load-error-DY55FeJ6.js";import"./Stars01-EGK20_72.js";import"./XCircle-BI7HvisP.js";import"./ChevronRight-CFv-fKpX.js";import"./use-clock-tick-CwR4C3CJ.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-9rW5ZwZw.js";import"./file-type-icon-D93vAYh4.js";import"./dialog-DPVJEPrK.js";import"./X-Zx6WnCka.js";import"./ZoomOut-C-DjvL5K.js";import"./content-blocks-o63cs2vh.js";import"./types-7_L4W6Tu.js";import"./chat-context-DK-AWUQz.js";import"./tab-id-DiaWi79N.js";import"./watch-sse-pool-BVVVT94i.js";import"./decopilot-sse-pool-CwSrVgbm.js";import"./use-ai-providers-C3HTrKhd.js";import"./use-organization-settings-BDQcymx3.js";import"./AlertCircle-DkwUf9y1.js";import"./Star01-Dw_jqiQj.js";import"./XClose-knQz_HAN.js";import"./ZapSquare-BlkUA5sB.js";import"./Tool01-B8aRmzPo.js";import"./Monitor01-gHJrCrOh.js";import"./Upload01-CYVliRf6.js";import"./shell-layout-Cgwg5QF3.js";import"./Users03-59Bl-ju-.js";import"./Stars02-CyyQqj9H.js";import"./CheckCircle-Cpbk7Z8F.js";import"./Zap-CCChCiD-.js";import"./required-auth-layout-DVQqpR9U.js";import"./useRouterState-DuGUZA7B.js";import"./use-org-sso-C3JjHGLM.js";import"./LinkExternal01-CqMwbx5t.js";import"./Palette-DqVojGBm.js";import"./use-navigate-to-agent-Cvb4b2dj.js";import"./use-mcp-prompts-BJhG10VU.js";import"./form-EYtxKS6a.js";import"./spinner-B62HtwxP.js";import"./RefreshCcw01-CWaUwErM.js";import"./ArrowUpRight-BUkBkD3O.js";import"./ChevronLeft-ZCv3UA1e.js";import"./DotsVertical-Cv0q4Ifl.js";import"./HardDrive-DHZcIBpx.js";import"./Sun-DjmglJiH.js";import"./Settings02-DLDnTjHy.js";import"./Shield01-BIILGcyJ.js";import"./User01-igKL-FIP.js";import"./Users01-DGPeGDAl.js";import"./index-LekHmrTG.js";import"./use-org-auth-client-4XCuGX_0.js";import"./use-collections-DjJTRpo_.js";import"./auth-jf8Ueqtd.js";import"./useInfiniteQuery-Dal3RT3l.js";import"./task-status-CDkG-N6p.js";import"./checkbox-DUa9wb8T.js";import"./command-14UC_LgG.js";import"./index-COo7MQNq.js";import"./index-BFzXRFgv.js";const vt={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3};function Le(s){return s.filter(e=>e.key.trim()).map(e=>{const r=encodeURIComponent(e.key.trim()),l=encodeURIComponent(e.value||"");return`${r}:${e.operator}:${l}`}).join(",")}function qs(s){return s?s.split(",").map(e=>{const[r,l,...a]=e.split(":");return{key:decodeURIComponent(r||""),operator:l||"eq",value:decodeURIComponent(a.join(":")||"")}}):[]}function Ye(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
|
|
2
2
|
`)}function Rt(s){return s.trim()?s.split(`
|
|
3
3
|
`).map(e=>e.trim()).filter(e=>e.length>0).map(e=>{if(e.endsWith("?"))return{key:e.slice(0,-1),operator:"exists",value:""};if(e.includes("=")){const[r,...l]=e.split("=");return{key:r||"",operator:"eq",value:l.join("=")}}if(e.includes("~")){const[r,...l]=e.split("~");return{key:r||"",operator:"contains",value:l.join("~")}}if(e.includes("@")){const[r,...l]=e.split("@");return{key:r||"",operator:"in",value:l.join("@")}}return{key:e,operator:"exists",value:""}}):[]}function Bs(s){const e={},r={},l=[],a={};for(const o of s)if(o.key.trim())switch(o.operator){case"eq":o.value&&(e[o.key]=o.value);break;case"contains":o.value&&(r[o.key]=`%${o.value}%`);break;case"exists":l.push(o.key);break;case"in":o.value&&(a[o.key]=o.value);break}return{properties:Object.keys(e).length>0?e:void 0,propertyPatterns:Object.keys(r).length>0?r:void 0,propertyKeys:l.length>0?l:void 0,propertyInValues:Object.keys(a).length>0?a:void 0}}function Ft(s){if(!s)return{content:"null",isTruncated:!1,originalSize:4};if(typeof s._decocms_truncated=="string")return{content:s._decocms_truncated,isTruncated:!0,originalSize:s._decocms_truncated.length};const e=JSON.stringify(s,null,2),r=e.length;return r<=vt.maxJsonRenderSize?{content:e,isTruncated:!1,originalSize:r}:{content:e.slice(0,vt.maxJsonRenderSize)+`
|
|
4
4
|
|