decocms 4.365.0 → 4.366.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-bl0yU7gy.js → AlertCircle-XJuKHE4v.js} +1 -1
- package/dist/client/assets/{AreaChart-CHPDNuDf.js → AreaChart-BCoaFhTr.js} +3 -3
- package/dist/client/assets/{ArrowLeft-CpbUCYpB.js → ArrowLeft-DQxSh6p-.js} +1 -1
- package/dist/client/assets/{ArrowRight-CkVUmxaa.js → ArrowRight-B8kkUle9.js} +1 -1
- package/dist/client/assets/{ArrowUp-BQQdFypM.js → ArrowUp-DxhEfgUF.js} +1 -1
- package/dist/client/assets/{Check-BJaMheL7.js → Check-C1q-PHCd.js} +1 -1
- package/dist/client/assets/{CheckCircle-BNNyBNMK.js → CheckCircle-DJ2_kCSw.js} +1 -1
- package/dist/client/assets/{ChevronRight-2Ti1evDh.js → ChevronRight-KrD_lvs_.js} +1 -1
- package/dist/client/assets/{ChevronUp-Cp-tcsrs.js → ChevronUp-BoMcO3mB.js} +1 -1
- package/dist/client/assets/{Copy01-BrL9ZrVF.js → Copy01-Dpbu0g_H.js} +1 -1
- package/dist/client/assets/{CreditCard01-_mwanoIZ.js → CreditCard01-BWqJGPbs.js} +1 -1
- package/dist/client/assets/{Database01-Dm_V08L3.js → Database01-DnV6gOgy.js} +1 -1
- package/dist/client/assets/{DotsVertical-B8slOnrw.js → DotsVertical-qmKIPEY-.js} +1 -1
- package/dist/client/assets/{Download01-Bl2-HJHJ.js → Download01-Dgak1Fxu.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-nVgseQIz.js → ErrorBarContext-CvwOCT-2.js} +1 -1
- package/dist/client/assets/{Eye-B_BMkWWc.js → Eye-0IX71tH3.js} +1 -1
- package/dist/client/assets/{File02-3fotvfyl.js → File02-D24jfSXr.js} +1 -1
- package/dist/client/assets/{GitBranch01-Dr0NRbj6.js → GitBranch01-CUORzB3l.js} +1 -1
- package/dist/client/assets/{Globe01-DMnQmvOn.js → Globe01-CUYpQQw5.js} +1 -1
- package/dist/client/assets/{HardDrive-CxNWrsuq.js → HardDrive-DVjlYw4P.js} +1 -1
- package/dist/client/assets/{Image01-DMAKgzzX.js → Image01-eFB14jbm.js} +1 -1
- package/dist/client/assets/{Key01-CVfJV98q.js → Key01-BxQMUsAT.js} +1 -1
- package/dist/client/assets/{Link01-CKw3sRrv.js → Link01-B5g-C-EB.js} +1 -1
- package/dist/client/assets/{LinkExternal01-OjBTsG9L.js → LinkExternal01-nAvM9RDc.js} +1 -1
- package/dist/client/assets/MessageCircle01-A1ZRNwnF.js +1 -0
- package/dist/client/assets/{Monitor01-Bc6Zvq9B.js → Monitor01-BhVb_zrL.js} +1 -1
- package/dist/client/assets/{Package-DTeqx5ul.js → Package-DYTkMUtn.js} +1 -1
- package/dist/client/assets/{Palette-CiXH5EXK.js → Palette-BQYb1MUW.js} +1 -1
- package/dist/client/assets/{Play-BPdpqeiE.js → Play-BsnTlatx.js} +1 -1
- package/dist/client/assets/{Plus-kQ9d0PiA.js → Plus-yEjTZ3xq.js} +1 -1
- package/dist/client/assets/Printer-tPJPBad0.js +1 -0
- package/dist/client/assets/{SearchLg-Cecpe6x9.js → SearchLg-CVlNOv3Z.js} +1 -1
- package/dist/client/assets/{SearchMd-hBr_biLL.js → SearchMd-BMTY9cLH.js} +1 -1
- package/dist/client/assets/{Sector-B0yBxg4a.js → Sector-C5c1W9AQ.js} +2 -2
- package/dist/client/assets/{Settings02-BqKUeA5H.js → Settings02-vefA7RGu.js} +1 -1
- package/dist/client/assets/{Share07-D8xQrAsX.js → Share07-DF3BVvZU.js} +1 -1
- package/dist/client/assets/{Shield01-Dav77ssu.js → Shield01-B7o7Mevu.js} +1 -1
- package/dist/client/assets/{Stars01-DWjpdjKn.js → Stars01-t5rRlm9e.js} +1 -1
- package/dist/client/assets/{Sun-wxsl7cI_.js → Sun-CGPKa4sR.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-CCraiYIJ.js → SwitchHorizontal01-jAePQEzl.js} +1 -1
- package/dist/client/assets/{Tool01-E6Rv0Nbs.js → Tool01-BHp1TvjV.js} +1 -1
- package/dist/client/assets/{Tool02-Darwb8nP.js → Tool02-BsXDs0ea.js} +1 -1
- package/dist/client/assets/{Trash01-BB2ymX9J.js → Trash01-Bti0BEOH.js} +1 -1
- package/dist/client/assets/{TrendUp01-PJuAXI74.js → TrendUp01-C7dvyZSf.js} +1 -1
- package/dist/client/assets/{Upload01-BtBtAyal.js → Upload01-BaBM0fiO.js} +1 -1
- package/dist/client/assets/{User01-CtDIPHIF.js → User01-BFA_iIf6.js} +1 -1
- package/dist/client/assets/{UserSquare-BflxhZ_l.js → UserSquare-zmRwIuPT.js} +1 -1
- package/dist/client/assets/{Users01-9HTYv5bx.js → Users01-CFU3MtAQ.js} +1 -1
- package/dist/client/assets/{Users03-D8RoJqiC.js → Users03-DzNeC3KW.js} +1 -1
- package/dist/client/assets/X-BQCsevd6.js +1 -0
- package/dist/client/assets/{XCircle-Dvf0BUKb.js → XCircle-DsvQU1nM.js} +1 -1
- package/dist/client/assets/{XClose-DPfGLo7I.js → XClose-jA5JdXrD.js} +1 -1
- package/dist/client/assets/{Zap-ChgjHdxL.js → Zap-BuDb189W.js} +1 -1
- package/dist/client/assets/{ZoomOut-BAhVAzy1.js → ZoomOut-C8Giq-qB.js} +1 -1
- package/dist/client/assets/access-gate-aS3ZSQNG.js +1 -0
- package/dist/client/assets/add-connection-dialog--vUKhnf0.js +1 -0
- package/dist/client/assets/agent-analytics-BsvbNtRu.js +2 -0
- package/dist/client/assets/agent-app-BgX5tmDs.js +1 -0
- package/dist/client/assets/agent-assets-r05qyq7M.js +1 -0
- package/dist/client/assets/agent-automation-Bw_0atKJ.js +20 -0
- package/dist/client/assets/agent-automations-mDyxJXZ-.js +1 -0
- package/dist/client/assets/agent-connect-sources-CYq4rZl5.js +1 -0
- package/dist/client/assets/agent-deck-2IaPBRAG.js +1 -0
- package/dist/client/assets/agent-e2e-D4To2z2i.js +1 -0
- package/dist/client/assets/agent-file-DCf5dUWO.js +1 -0
- package/dist/client/assets/agent-git-ZGfK5mrD.js +3 -0
- package/dist/client/assets/agent-hosting-BkqnI4yD.js +1 -0
- package/dist/client/assets/agent-icon-BayCJ1XK.js +1 -0
- package/dist/client/assets/agent-library-file-DpZgptcF.js +1 -0
- package/dist/client/assets/agent-monitor-Dr27iFK6.js +1 -0
- package/dist/client/assets/agent-overview-MpkHwxGY.js +1 -0
- package/dist/client/assets/agent-settings-Ch0rJx38.js +1 -0
- package/dist/client/assets/agent-site-editor-8xYWVw5o.js +24 -0
- package/dist/client/assets/agent-site-editor-code-ChIvOb2u.js +2 -0
- package/dist/client/assets/agent-site-editor-content-CaS96oto.js +2 -0
- package/dist/client/assets/agent-site-editor-preview-BT81wMtG.js +504 -0
- package/dist/client/assets/agent-view-BZM6EzoY.js +1 -0
- package/dist/client/assets/agent-view-guard-C3muZtcp.js +1 -0
- package/dist/client/assets/agents-list-LyPFGSzB.js +1 -0
- package/dist/client/assets/ai-providers-BnZyZvgS.js +1 -0
- package/dist/client/assets/{alert-DkgzGFz6.js → alert-D2_bDwwt.js} +1 -1
- package/dist/client/assets/{alert-dialog-BdwUra4d.js → alert-dialog-C7QvHg2N.js} +2 -2
- package/dist/client/assets/api-keys-DqWbRfTI.js +1 -0
- package/dist/client/assets/{api-keys-Bl99t7Nm.js → api-keys-GYe2WKoE.js} +1 -1
- package/dist/client/assets/app-editor-B1geIunv.js +1 -0
- package/dist/client/assets/asset-utils-Bjna15we.js +1 -0
- package/dist/client/assets/{auth-catchall-CZ_cFv3z.js → auth-catchall-Bvf8LzyF.js} +1 -1
- package/dist/client/assets/{auth-entry-Cp4v6AT2.js → auth-entry-DT34wonq.js} +1 -1
- package/dist/client/assets/{auth-vfqjjrgv.js → auth-iWs2Fll8.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BB-yAg-2.js → auth-split-layout-CZmbnVcH.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CpB-R1LO.js → authenticate-and-persist-oauth-DySlq_Uz.js} +1 -1
- package/dist/client/assets/{automation-list-row-DKusfCau.js → automation-list-row-Dn5spis4.js} +1 -1
- package/dist/client/assets/automation-runs-CqG4y7Ce.js +1 -0
- package/dist/client/assets/automations-B2DIuWhi.js +1 -0
- package/dist/client/assets/{autosend-u-W4xgi7.js → autosend-Cui6QYML.js} +1 -1
- package/dist/client/assets/{avatar-BpU54ct-.js → avatar-Chvwe6CH.js} +1 -1
- package/dist/client/assets/backoff-8mStPHYB.js +1 -0
- package/dist/client/assets/{badge-DJ5ezE5-.js → badge-Bpi-bEgv.js} +1 -1
- package/dist/client/assets/{block-document-7Ngv587f.js → block-document-BuxP8Crs.js} +3 -3
- package/dist/client/assets/blocks-preview-workspace-context-Buv2D3Jl.js +1 -0
- package/dist/client/assets/{breadcrumb-Dlcs3jWo.js → breadcrumb-BpphN_b3.js} +1 -1
- package/dist/client/assets/buckets-CdBQgn0_.js +1 -0
- package/dist/client/assets/build-improve-prompt-doc-B_ubqk7c.js +2 -0
- package/dist/client/assets/bulk-category-panel-CJHqLMZD.js +1 -0
- package/dist/client/assets/{calendar-B8BrEMls.js → calendar-Bv35C1ab.js} +1 -1
- package/dist/client/assets/{capability-load-error-CdMFNpdR.js → capability-load-error-DQhiwip8.js} +1 -1
- package/dist/client/assets/{cards-BfP1wflC.js → cards-C9ouoOLf.js} +1 -1
- package/dist/client/assets/category-editor-CT7pGo6h.js +1 -0
- package/dist/client/assets/{chart-zbtN9_7R.js → chart-Dt0bzQmG.js} +1 -1
- package/dist/client/assets/{chat-context-CD1rWX64.js → chat-context-CQfynmbs.js} +9 -9
- package/dist/client/assets/{checkbox-DwVdLA7e.js → checkbox-CFnSur5S.js} +1 -1
- package/dist/client/assets/choose-editor-BDdFG0AK.js +1 -0
- package/dist/client/assets/claim-phase-copy-0btUuJoC.js +1 -0
- package/dist/client/assets/{cli-auth-success-BtBj1xJE.js → cli-auth-success-B6dF4CkI.js} +1 -1
- package/dist/client/assets/{client-icons-BcSFyY79.js → client-icons-DWHe8UUx.js} +1 -1
- package/dist/client/assets/collapsible-DM7kUiaH.js +1 -0
- package/dist/client/assets/collection-detail-D0E2zvyY.js +1 -0
- package/dist/client/assets/collection-display-button-rOJe9HxS.js +1 -0
- package/dist/client/assets/{collection-search-Bi-DttH4.js → collection-search-hghYGxIR.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DfAhVjGn.js → collection-table-wrapper-BOgV2UJf.js} +1 -1
- package/dist/client/assets/{collection-tabs-BZkkvpP_.js → collection-tabs-B5FMyHR6.js} +1 -1
- package/dist/client/assets/{command-cJVGaRa3.js → command-DkQDbWvX.js} +1 -1
- package/dist/client/assets/{command-palette-store-BNo0UXiS.js → command-palette-store-BZa_pZih.js} +1 -1
- package/dist/client/assets/commerce-onboarding-C6atsXy1.js +1 -0
- package/dist/client/assets/{companion-mcps-section-smAU7jYC.js → companion-mcps-section-DOV9ASHT.js} +1 -1
- package/dist/client/assets/{connect-Bn7h46Ea.js → connect-CppHC-0m.js} +2 -2
- package/dist/client/assets/connect-layout-TfX5Xr-V.js +1 -0
- package/dist/client/assets/{connection-D6f54N4w.js → connection-C5by_7-w.js} +1 -1
- package/dist/client/assets/{connection-card-DCMUv-0w.js → connection-card-CIm7CAF2.js} +1 -1
- package/dist/client/assets/connection-detail-BZRvhztL.js +1 -0
- package/dist/client/assets/{connection-form-helpers-BiJdmlDA.js → connection-form-helpers-MBoiNuM1.js} +1 -1
- package/dist/client/assets/connections-Bexdo6ot.js +1 -0
- package/dist/client/assets/{create-organization-dialog-IR2z5bIs.js → create-organization-dialog-CoEOmU3m.js} +1 -1
- package/dist/client/assets/decofile-api-C_KdReLg.js +1 -0
- package/dist/client/assets/{decopilot-CK3rN_ad.js → decopilot-055IFff8.js} +2 -2
- package/dist/client/assets/dialog-CeIxtPXR.js +1 -0
- package/dist/client/assets/discover-CUTidJwM.js +1 -0
- package/dist/client/assets/domain-settings-BzmIDyZ_.js +1 -0
- package/dist/client/assets/{download-app-dialog-CNd8ka-x.js → download-app-dialog-DR0vSmtX.js} +1 -1
- package/dist/client/assets/{drawer-DsG6Si3V.js → drawer-B1EgD4Vp.js} +1 -1
- package/dist/client/assets/{dropdown-menu-4cRHTbic.js → dropdown-menu-BGNWIYx7.js} +1 -1
- package/dist/client/assets/{editor-NTP5Xcj9.js → editor-mbH0e5JY.js} +1 -1
- package/dist/client/assets/{empty-state-D86Jkx4H.js → empty-state-BCbvEzAs.js} +1 -1
- package/dist/client/assets/{empty-state-DmTochCH.js → empty-state-kLQdVwor.js} +1 -1
- package/dist/client/assets/{extract-connection-data-B3hIAjiC.js → extract-connection-data-CkjHAGlh.js} +1 -1
- package/dist/client/assets/file-explorer-BsgzsRXw.js +2 -0
- package/dist/client/assets/{file-preview-BbFH5cdB.js → file-preview-Dt-0WoSN.js} +1 -1
- package/dist/client/assets/{file-share-button-ChoXQdlr.js → file-share-button-BEGbkFdF.js} +2 -2
- package/dist/client/assets/{file-type-icon-DJQFeBpV.js → file-type-icon-HWuHxj-a.js} +1 -1
- package/dist/client/assets/{folder-icon-BRLOuEpt.js → folder-icon-Dq-1z23e.js} +1 -1
- package/dist/client/assets/{form-DhUF_Mtg.js → form-CLpS84nN.js} +1 -1
- package/dist/client/assets/{gateway-client-Cb37izH_.js → gateway-client-BjVHcW6F.js} +1 -1
- package/dist/client/assets/general-D8KTsCfw.js +1 -0
- package/dist/client/assets/{github-icon-cJDFDEm7.js → github-icon-CX5G8yKI.js} +1 -1
- package/dist/client/assets/{github-repo-C0igpkr9.js → github-repo-BknN0SVI.js} +1 -1
- package/dist/client/assets/home-gbcG8VY1.js +1 -0
- package/dist/client/assets/hooks-A22NZVjF.js +15 -0
- package/dist/client/assets/{hooks-BrcP19Uo.js → hooks-BqIq5c7A.js} +2 -2
- package/dist/client/assets/{index-gctAQu2T.js → index-BMJCLbj5.js} +74 -74
- package/dist/client/assets/index-BYpQoJPO.js +1 -0
- package/dist/client/assets/{index-Df6f9kP3.js → index-COEhLDjd.js} +1 -1
- package/dist/client/assets/{index-BQzHGsvt.js → index-CTarYheD.js} +11 -11
- package/dist/client/assets/{index-epfDD3H5.js → index-CukAZjhb.js} +2 -2
- package/dist/client/assets/index-DEHfBZJE.js +1 -0
- package/dist/client/assets/{index-DJADaZ4J.css → index-DUflXgSu.css} +1 -1
- package/dist/client/assets/index-DXKIkJj_.js +1 -0
- package/dist/client/assets/{index-CoYeuRng.js → index-DomshhPl.js} +1 -1
- package/dist/client/assets/index-Dq_pIFW4.js +1 -0
- package/dist/client/assets/index-DtZ4Xdhl.js +26 -0
- package/dist/client/assets/{index-CImKKZ20.js → index-DwyoyS-u.js} +1 -1
- package/dist/client/assets/{index-BywxOh2e.js → index-S02-0oEV.js} +1 -1
- package/dist/client/assets/{index-eVyHwFa9.js → index-XMcYehIU.js} +1 -1
- package/dist/client/assets/index-hS97rVcF.js +1 -0
- package/dist/client/assets/index-jRUJ2Odt.js +1 -0
- package/dist/client/assets/{index-redirect-DxBD4sTo.js → index-redirect-C2-YpKqU.js} +1 -1
- package/dist/client/assets/{index-DQ6uuKpF.js → index-xNOJUK_V.js} +8 -8
- package/dist/client/assets/{infiniteQueryObserver-Da0v0sXC.js → infiniteQueryObserver-BpxpVSEY.js} +1 -1
- package/dist/client/assets/infra-billing-4VvMq4f7.js +1 -0
- package/dist/client/assets/{input-eBmoU-9D.js → input-BHyVG0eO.js} +1 -1
- package/dist/client/assets/{input-C9QH7mMV.js → input-czh8s2Kx.js} +2 -2
- package/dist/client/assets/{input-DlvEXkej.js → input-hZ73BeN6.js} +1 -1
- package/dist/client/assets/{integration-icon-YYg8l_RW.js → integration-icon-BEcN9aOn.js} +1 -1
- package/dist/client/assets/{label-DGkzLfNU.js → label-Cn5P-MxH.js} +1 -1
- package/dist/client/assets/last-preview-page-CGY2ekfv.js +1 -0
- package/dist/client/assets/layout-DWBUXuba.js +1 -0
- package/dist/client/assets/legacy-agents-deep-Dp_UGZ0N.js +1 -0
- package/dist/client/assets/legacy-main-redirect-tszfeXT6.js +1 -0
- package/dist/client/assets/{library-CKrgioQu.js → library-ClsXt0Rx.js} +4 -4
- package/dist/client/assets/login-CuNrlb8L.js +1 -0
- package/dist/client/assets/{markdown-BV0XgGTq.js → markdown-D53j_yF1.js} +3 -3
- package/dist/client/assets/{mcp-app-renderer-Bv46PiO3.js → mcp-app-renderer-MmA5afeR.js} +2 -2
- package/dist/client/assets/{mcp-oauth-i7PCjbNf.js → mcp-oauth-wZEV-nrV.js} +1 -1
- package/dist/client/assets/members-BDern1X1.js +1 -0
- package/dist/client/assets/message-templates-BVWUC7db.js +1 -0
- package/dist/client/assets/{mini-report-page-k88VT2C2.js → mini-report-page-CBhNyhHF.js} +1 -1
- package/dist/client/assets/{monaco-editor-kRD7y0Pc.js → monaco-editor-Bs2NlVt9.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CuCuR7PQ.js → monitoring-stats-row-BCnT0CYV.js} +1 -1
- package/dist/client/assets/{multi-select-CltjjMwX.js → multi-select-np6GoSDC.js} +1 -1
- package/dist/client/assets/{mustache-Db7x-4gI.js → mustache-BFUzNb8Y.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-3CPoYshC.js → oauth-callback-ai-provider-CkxJpC38.js} +1 -1
- package/dist/client/assets/{oauth-callback-CT29B8-5.js → oauth-callback-dtMqJWcs.js} +1 -1
- package/dist/client/assets/{onboarding-DEm51GnF.js → onboarding-Ccv0iKAy.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-Drtbh9Ui.js → optimistic-project-sidebar-views-CXv7s88e.js} +1 -1
- package/dist/client/assets/{organization-choice-BdqJqB_v.js → organization-choice-DDIIA4r_.js} +1 -1
- package/dist/client/assets/orgs-Dh7PvVlK.js +1 -0
- package/dist/client/assets/{page-seo-form-BXvLQ5tk.js → page-seo-form-B4hHysuS.js} +1 -1
- package/dist/client/assets/{pair-BIPkH5eA.js → pair-CC2n4e8O.js} +8 -8
- package/dist/client/assets/{popover-BfKN_4aI.js → popover-C4BN0JR_.js} +1 -1
- package/dist/client/assets/post-calendar-CqjbypuY.js +1 -0
- package/dist/client/assets/post-editor-BWSgYmr7.js +1 -0
- package/dist/client/assets/preview-content-B1sbXWxj.js +1 -0
- package/dist/client/assets/{preview-dialog-CYbL8r4H.js → preview-dialog-BpdP9L1J.js} +1 -1
- package/dist/client/assets/{primitives-BXcg67BS.js → primitives-ClrTve8u.js} +1 -1
- package/dist/client/assets/profile-C62Csgxs.js +1 -0
- package/dist/client/assets/project-app-view-DuZ0al0I.js +1 -0
- package/dist/client/assets/project-feed-e56BAulp.js +1 -0
- package/dist/client/assets/{project-icon-Dk1HaDIZ.js → project-icon-DNZ9K5Pu.js} +1 -1
- package/dist/client/assets/project-reports-qkJYJvf_.js +1 -0
- package/dist/client/assets/project-tasks-CuBIIqQe.js +1 -0
- package/dist/client/assets/prompts-CvfXhtmL.js +1 -0
- package/dist/client/assets/record-editor-BgdpiMZZ.js +1 -0
- package/dist/client/assets/redirect-editor-DZqPekvg.js +1 -0
- package/dist/client/assets/registry-CpSQCNCo.js +2 -0
- package/dist/client/assets/{registry-layout-CRM-FBei.js → registry-layout-EwRdwTrZ.js} +3 -3
- package/dist/client/assets/{reports-B1FmmHPo.js → reports-B7gb9J4r.js} +2 -2
- package/dist/client/assets/reports-tab-A4b9K1C9.js +2 -0
- package/dist/client/assets/reports-u1fvgaiq.js +1 -0
- package/dist/client/assets/repositories-CetKo6mn.js +1 -0
- package/dist/client/assets/repository-import-picker-B2eEODjs.js +1 -0
- package/dist/client/assets/repository-picker-RITOXfgy.js +1 -0
- package/dist/client/assets/require-capability-v3_FPkyC.js +1 -0
- package/dist/client/assets/{required-auth-layout-CraNNSBi.js → required-auth-layout-Udaxv9eU.js} +1 -1
- package/dist/client/assets/{reset-password-DcO8_P05.js → reset-password-BekScov3.js} +1 -1
- package/dist/client/assets/resizable-BH4I1yXS.js +1 -0
- package/dist/client/assets/retry-i8LvYSZg.js +1 -0
- package/dist/client/assets/{review-settings-CANg_Nan.js → review-settings-BSCl1l21.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-CCig2s9-.js → rich-text-link-control-2exMlBO3.js} +1 -1
- package/dist/client/assets/roles-CVOjxj6F.js +1 -0
- package/dist/client/assets/route-BIkrj02L.js +1 -0
- package/dist/client/assets/route-D_umqTlk.js +1 -0
- package/dist/client/assets/route-Nea_-0wb.js +1 -0
- package/dist/client/assets/runnable-block-editor-tdcflVCm.js +16 -0
- package/dist/client/assets/sandbox-git-api-CMdpE2TE.js +1 -0
- package/dist/client/assets/{sandbox-lifecycle-context-Beua1bNX.js → sandbox-lifecycle-context-qEhBBhZu.js} +2 -2
- package/dist/client/assets/save-changes-debug-nBi-n9eV.js +1 -0
- package/dist/client/assets/{schema-BzgrQmAY.js → schema-B763_7WQ.js} +1 -1
- package/dist/client/assets/{scroll-area-tBZq-ZvJ.js → scroll-area-rekkGy6B.js} +1 -1
- package/dist/client/assets/{search-input-CYERWjWv.js → search-input-BNWWtT__.js} +1 -1
- package/dist/client/assets/secrets-DWkk0n1_.js +1 -0
- package/dist/client/assets/section-preview-url-Csj0_ZDg.js +1 -0
- package/dist/client/assets/sections-editor-DC9tNRXs.js +2 -0
- package/dist/client/assets/select-NGX2S-jl.js +1 -0
- package/dist/client/assets/select-model-otNOnmWQ.js +1 -0
- package/dist/client/assets/seo-editor-DlBT_48J.js +1 -0
- package/dist/client/assets/settings-tab-BdBT7bp-.js +5 -0
- package/dist/client/assets/sheet-zj8JvjRG.js +1 -0
- package/dist/client/assets/shell-layout-DJaYVrhN.js +1 -0
- package/dist/client/assets/sidebar-8Wi6Oive.js +1 -0
- package/dist/client/assets/skill-preview-_tRqFXnw.js +1 -0
- package/dist/client/assets/skills-fa444avf.js +1 -0
- package/dist/client/assets/sso-BYGtZudI.js +1 -0
- package/dist/client/assets/{store-CjL9y_7d.js → store-RInt4c6N.js} +1 -1
- package/dist/client/assets/store-registry-DZRSLoUe.js +2 -0
- package/dist/client/assets/switch-BYmXNEWm.js +1 -0
- package/dist/client/assets/synced-repos-wQG6FrsT.js +1 -0
- package/dist/client/assets/{table-aIDGrvqv.js → table-ly1wsT3x.js} +1 -1
- package/dist/client/assets/{tabs-Sr-wlkg3.js → tabs-VVgXU6J_.js} +1 -1
- package/dist/client/assets/{task-board-CazuPR-U.js → task-board-BOE8KmlV.js} +1 -1
- package/dist/client/assets/task-route-Do0hSewl.js +1 -0
- package/dist/client/assets/{task-status-Cj8IGjJC.js → task-status-N3H46jqP.js} +1 -1
- package/dist/client/assets/tasks-katsCy3p.js +1 -0
- package/dist/client/assets/{tasks-DzatESzy.js → tasks-momKk7wX.js} +4 -4
- package/dist/client/assets/{textarea-6VvdKhvF.js → textarea-BxuD2hUP.js} +1 -1
- package/dist/client/assets/{thread-intent-DPwCeeGE.js → thread-intent-Dm0IBq_B.js} +1 -1
- package/dist/client/assets/{thread-route-BsrvgyVU.js → thread-route-BBIxLMFt.js} +1 -1
- package/dist/client/assets/thread-route-C8bWbEqf.js +1 -0
- package/dist/client/assets/thread-sheet-body-B2nleyoO.js +1 -0
- package/dist/client/assets/toggle-group-Ce7pnXJo.js +1 -0
- package/dist/client/assets/{toolbar-icon-button-CSTgB2Je.js → toolbar-icon-button-CW5-GSO0.js} +1 -1
- package/dist/client/assets/tooltip-Duh82s_3.js +1 -0
- package/dist/client/assets/{track-CDfY4FZL.js → track-UC7tcaDa.js} +1 -1
- package/dist/client/assets/{types-8hWP_tsZ.js → types-9rIOtXyt.js} +6 -6
- package/dist/client/assets/usage-stats-BVTzfYab.js +1 -0
- package/dist/client/assets/use-ai-providers-C1gC5KZd.js +1 -0
- package/dist/client/assets/use-automations-l3TtnJzn.js +1 -0
- package/dist/client/assets/{use-autosave-DRlRuq5e.js → use-autosave-CrWD9EGm.js} +1 -1
- package/dist/client/assets/use-commerce-diagnostic-D_4QVDXA.js +1 -0
- package/dist/client/assets/use-connect-companion-BmZOXkYb.js +1 -0
- package/dist/client/assets/{use-connection-tOIuuLKJ.js → use-connection-BqdoJ4Oy.js} +1 -1
- package/dist/client/assets/{use-copy-B4PUMZjo.js → use-copy-CNVX7-Qb.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-x2IPUAAO.js → use-create-virtual-mcp-Ban-XwYm.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-use6rm0l.js → use-date-fns-locale-DT8uuZ88.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CWLgAozd.js → use-debounced-autosave-CpgUZnAZ.js} +1 -1
- package/dist/client/assets/{use-debounced-value-BHZw1Wtv.js → use-debounced-value-D0zC9Ypj.js} +1 -1
- package/dist/client/assets/use-deco-credits-D3zsqMir.js +1 -0
- package/dist/client/assets/use-decopilot-events-BhWToYSR.js +1 -0
- package/dist/client/assets/use-delete-connection-BiX9HqWG.js +1 -0
- package/dist/client/assets/{use-deployment-admin-PTBGIrMl.js → use-deployment-admin-BeJGIguj.js} +1 -1
- package/dist/client/assets/use-fast-preview-draft-url-CsLWv0Mh.js +1 -0
- package/dist/client/assets/use-file-configs-CELrFXoI.js +1 -0
- package/dist/client/assets/{use-infinite-scroll-DnRzNQQc.js → use-infinite-scroll-PJEXgCMU.js} +1 -1
- package/dist/client/assets/use-join-requests-BgWAmaKE.js +1 -0
- package/dist/client/assets/use-main-panel-tabs-VRnQG3gd.js +1 -0
- package/dist/client/assets/use-mcp-auth-status-9X4Uzes7.js +1 -0
- package/dist/client/assets/{use-mcp-client-CzGi1Gun.js → use-mcp-client-D_FU7Mvk.js} +6 -6
- package/dist/client/assets/{use-mcp-prompts-BJsq63pG.js → use-mcp-prompts-CYS_vs6v.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-I4ahUYGD.js → use-mcp-tools-CFx3Lmte.js} +1 -1
- package/dist/client/assets/{use-members-xjztJVBn.js → use-members-Du0dxWYm.js} +1 -1
- package/dist/client/assets/use-mobile-DSAvRL1q.js +1 -0
- package/dist/client/assets/{use-navigate-to-agent-CBQsYRLL.js → use-navigate-to-agent-Bc_emVs6.js} +1 -1
- package/dist/client/assets/use-open-billing-url-WHswF0xn.js +1 -0
- package/dist/client/assets/use-org-auth-client-BzNNDK0c.js +1 -0
- package/dist/client/assets/{use-org-fs-Cm8FYvYP.js → use-org-fs-BNYqWw9K.js} +1 -1
- package/dist/client/assets/use-org-notice-BY38CaDI.js +1 -0
- package/dist/client/assets/{use-org-sso-CP_t4LLU.js → use-org-sso-DVgcOl01.js} +1 -1
- package/dist/client/assets/{use-organization-roles-Cnixvt9H.js → use-organization-roles-PSOGQNFW.js} +1 -1
- package/dist/client/assets/use-organization-settings-DOCBD9db.js +1 -0
- package/dist/client/assets/use-panel-navigate-DYL1ayEh.js +1 -0
- package/dist/client/assets/{use-project-native-view-presence-CJ7vLSBz.js → use-project-native-view-presence-C96QJnXu.js} +1 -1
- package/dist/client/assets/use-project-scope-DRMW-kAl.js +1 -0
- package/dist/client/assets/use-registry-connections-DbpMOIpO.js +1 -0
- package/dist/client/assets/use-releases-CYB3Z3el.js +1 -0
- package/dist/client/assets/use-route-default-main-BnL4Z4OM.js +1 -0
- package/dist/client/assets/use-secrets-BGF1KQAu.js +1 -0
- package/dist/client/assets/use-section-preview-base-DlnI4MwN.js +1 -0
- package/dist/client/assets/{use-session-runtime-Cs4eGT9k.js → use-session-runtime-BDvQix3x.js} +1 -1
- package/dist/client/assets/use-tags-BUUTr7aM.js +1 -0
- package/dist/client/assets/use-task-metadata-BTxoWON1.js +1 -0
- package/dist/client/assets/{use-thread-outputs-DtpQGqCf.js → use-thread-outputs-CiqJCIW4.js} +1 -1
- package/dist/client/assets/use-view-mode-DF5iokPZ.js +1 -0
- package/dist/client/assets/use-virtual-mcp-B-R_fMeI.js +1 -0
- package/dist/client/assets/useInfiniteQuery-C23wLcYP.js +1 -0
- package/dist/client/assets/{useQueries-CnHkVL7d.js → useQueries-iH2sfRa-.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CbVbJFMx.js +1 -0
- package/dist/client/assets/{users-CWHZPvdU.js → users-D_LhbXm3.js} +1 -1
- package/dist/client/assets/{utils-CdxSjBly.js → utils-B_h95VEK.js} +2 -2
- package/dist/client/assets/variant-calendar-Bfr5lPy8.js +1 -0
- package/dist/client/assets/{variant-matcher-override-BLTbL0Nb.js → variant-matcher-override-DyhilZEH.js} +1 -1
- package/dist/client/assets/view-mode-toggle--BOjpHZ1.js +1 -0
- package/dist/client/assets/{virtual-mcp-CIE6gIFV.js → virtual-mcp-CFyEtCKb.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/Printer-Nban-oJk.js +0 -1
- package/dist/client/assets/access-gate-aVhmxNUP.js +0 -1
- package/dist/client/assets/add-connection-dialog-C2-znERG.js +0 -1
- package/dist/client/assets/agent-analytics-CLObAM6S.js +0 -2
- package/dist/client/assets/agent-app-DtLxy7iB.js +0 -1
- package/dist/client/assets/agent-assets-5J9H4wgC.js +0 -1
- package/dist/client/assets/agent-automation-DTYBStDc.js +0 -20
- package/dist/client/assets/agent-automations-DYZPALXC.js +0 -1
- package/dist/client/assets/agent-connect-sources-DJFWziK9.js +0 -1
- package/dist/client/assets/agent-deck-De0Y6qk5.js +0 -1
- package/dist/client/assets/agent-e2e-MVQ6vmAy.js +0 -1
- package/dist/client/assets/agent-file-IBnKf7Fw.js +0 -1
- package/dist/client/assets/agent-git-DjVoKiR8.js +0 -3
- package/dist/client/assets/agent-hosting-DbC8wvCr.js +0 -1
- package/dist/client/assets/agent-icon-DsGBCBNv.js +0 -1
- package/dist/client/assets/agent-library-file-CySHm683.js +0 -1
- package/dist/client/assets/agent-monitor-Duc2QTVQ.js +0 -1
- package/dist/client/assets/agent-overview-DAVTPrgq.js +0 -1
- package/dist/client/assets/agent-settings-DBEnACPy.js +0 -1
- package/dist/client/assets/agent-site-editor-CJ_722sF.js +0 -1
- package/dist/client/assets/agent-site-editor-code-CBPV2yNN.js +0 -2
- package/dist/client/assets/agent-site-editor-content-C-fwwsI7.js +0 -2
- package/dist/client/assets/agent-site-editor-preview-Be-uG2hV.js +0 -504
- package/dist/client/assets/agent-view-B3DdbJTr.js +0 -1
- package/dist/client/assets/agent-view-guard-DTG6Ut5n.js +0 -1
- package/dist/client/assets/agents-list-DNaOFYAO.js +0 -1
- package/dist/client/assets/ai-providers-BPcl_qgT.js +0 -1
- package/dist/client/assets/api-keys-CYMMtT0P.js +0 -1
- package/dist/client/assets/app-editor-_27_2g82.js +0 -1
- package/dist/client/assets/asset-utils-DTfzHa9m.js +0 -1
- package/dist/client/assets/automation-runs-Dt50JHCo.js +0 -1
- package/dist/client/assets/automations-DDydXmIK.js +0 -1
- package/dist/client/assets/backoff-CrEUbyZT.js +0 -1
- package/dist/client/assets/buckets-Wx6DtJNT.js +0 -1
- package/dist/client/assets/build-improve-prompt-doc-4aKzyTWA.js +0 -2
- package/dist/client/assets/bulk-category-panel-CclTC40F.js +0 -1
- package/dist/client/assets/category-editor-CuGxUDVJ.js +0 -1
- package/dist/client/assets/choose-editor-CE7aKrQp.js +0 -1
- package/dist/client/assets/collapsible-BDifv-q9.js +0 -1
- package/dist/client/assets/collection-detail-ec9sW8Ey.js +0 -1
- package/dist/client/assets/collection-display-button-C3CfuUhX.js +0 -1
- package/dist/client/assets/commerce-onboarding-Dxc7EEsL.js +0 -1
- package/dist/client/assets/connect-layout-Bby2uYqZ.js +0 -1
- package/dist/client/assets/connection-detail-C-Fe9wui.js +0 -1
- package/dist/client/assets/connections-CxSK9S4W.js +0 -1
- package/dist/client/assets/decode-html-entities-B4Qel6ov.js +0 -1
- package/dist/client/assets/decopilot-sse-pool-czpSFI9L.js +0 -1
- package/dist/client/assets/delay-CnY5UFtP.js +0 -1
- package/dist/client/assets/dialog--Jkwvpx1.js +0 -1
- package/dist/client/assets/discover-C7-JIKhR.js +0 -1
- package/dist/client/assets/domain-settings-Dh029s1M.js +0 -1
- package/dist/client/assets/file-explorer-B4d-xz4q.js +0 -2
- package/dist/client/assets/general-BY1zbaWS.js +0 -1
- package/dist/client/assets/home-CeJo7q7K.js +0 -1
- package/dist/client/assets/hooks-CxPd9b6i.js +0 -15
- package/dist/client/assets/index-1yGxjvng.js +0 -24
- package/dist/client/assets/index-C7tZKQ5s.js +0 -1
- package/dist/client/assets/index-CklK0EA_.js +0 -1
- package/dist/client/assets/index-D5CXQ9x9.js +0 -1
- package/dist/client/assets/index-Og5m3t85.js +0 -26
- package/dist/client/assets/index-Y6pd1REu.js +0 -1
- package/dist/client/assets/infra-billing-ChvPe0pr.js +0 -1
- package/dist/client/assets/invite-member-dialog-CeSVAfZq.js +0 -1
- package/dist/client/assets/layout-BIIr_imR.js +0 -1
- package/dist/client/assets/legacy-agents-deep-CdZo4h4A.js +0 -1
- package/dist/client/assets/legacy-main-redirect-CWWHewM6.js +0 -1
- package/dist/client/assets/login-svGY2sKo.js +0 -1
- package/dist/client/assets/members-BOTXfNHf.js +0 -1
- package/dist/client/assets/org-layout-BiRvLqL-.js +0 -1
- package/dist/client/assets/orgs-CMf-H7HH.js +0 -1
- package/dist/client/assets/post-calendar-BAQtpQvh.js +0 -1
- package/dist/client/assets/post-editor-DBJMHXYe.js +0 -1
- package/dist/client/assets/preview-content-CICx8Frq.js +0 -1
- package/dist/client/assets/profile-CUkJFM3_.js +0 -1
- package/dist/client/assets/project-app-view-BSYHmGj3.js +0 -1
- package/dist/client/assets/project-feed-BEGVLizK.js +0 -1
- package/dist/client/assets/project-reports-BozhFElP.js +0 -1
- package/dist/client/assets/project-tasks-DVexwc9x.js +0 -1
- package/dist/client/assets/prompts-Df-P8Zuz.js +0 -1
- package/dist/client/assets/record-editor-9YdHcAWO.js +0 -1
- package/dist/client/assets/redirect-editor-BohyWJXT.js +0 -1
- package/dist/client/assets/registry-BbkHDIpk.js +0 -2
- package/dist/client/assets/reports-SeFGRJSZ.js +0 -1
- package/dist/client/assets/reports-tab-D5rlmWEp.js +0 -2
- package/dist/client/assets/repositories-BXEjUV3F.js +0 -1
- package/dist/client/assets/repository-import-picker-Bc_O4k0-.js +0 -1
- package/dist/client/assets/repository-picker-DC97O6OK.js +0 -1
- package/dist/client/assets/require-capability-CoB1D-Ih.js +0 -1
- package/dist/client/assets/retry-CErkP7V6.js +0 -1
- package/dist/client/assets/roles-DEMri9Kk.js +0 -1
- package/dist/client/assets/runnable-block-editor-BD-IThSC.js +0 -16
- package/dist/client/assets/secrets-7Z0pTBUq.js +0 -1
- package/dist/client/assets/sections-editor-DoMH-fks.js +0 -2
- package/dist/client/assets/select-C9ZnmbzX.js +0 -1
- package/dist/client/assets/select-model-FK_tmltz.js +0 -1
- package/dist/client/assets/seo-editor-DNovpojV.js +0 -1
- package/dist/client/assets/settings-layout-Cd8jASua.js +0 -1
- package/dist/client/assets/settings-sidebar-DP80M_GR.js +0 -1
- package/dist/client/assets/settings-tab-DE3XUo7h.js +0 -5
- package/dist/client/assets/shell-controls-CnE-Tn5l.js +0 -1
- package/dist/client/assets/shell-layout-DMp5UdGb.js +0 -1
- package/dist/client/assets/skill-preview-D2lK4hU9.js +0 -1
- package/dist/client/assets/skills-xXfBybxi.js +0 -1
- package/dist/client/assets/source-system-tabs-CnEGUb4r.js +0 -1
- package/dist/client/assets/sso-DdBxRFrm.js +0 -1
- package/dist/client/assets/store-registry-BFRxGHgD.js +0 -2
- package/dist/client/assets/switch-DADMizS1.js +0 -1
- package/dist/client/assets/synced-repos-Cp7R03Jp.js +0 -1
- package/dist/client/assets/task-route-_NgFGVoT.js +0 -1
- package/dist/client/assets/tasks-BvZdYZ5R.js +0 -1
- package/dist/client/assets/thread-sheet-body-S2AS0IdJ.js +0 -1
- package/dist/client/assets/toggle-group-CHZjV-1n.js +0 -1
- package/dist/client/assets/toolbar-DAhC4RMM.js +0 -1
- package/dist/client/assets/usage-stats-B38oXMbk.js +0 -1
- package/dist/client/assets/use-ai-providers-DYf552qv.js +0 -1
- package/dist/client/assets/use-automations-DSRSDlyo.js +0 -1
- package/dist/client/assets/use-commerce-diagnostic-pXwQBZmy.js +0 -1
- package/dist/client/assets/use-connect-companion-Bt171l5d.js +0 -1
- package/dist/client/assets/use-deco-credits-Coxc4dyp.js +0 -1
- package/dist/client/assets/use-decopilot-events-V4xtyk7c.js +0 -1
- package/dist/client/assets/use-delete-connection-geT4L5Ed.js +0 -1
- package/dist/client/assets/use-file-configs-BLWnBKpa.js +0 -1
- package/dist/client/assets/use-join-requests-DL4guRSR.js +0 -1
- package/dist/client/assets/use-main-panel-tabs-BtAksZ1f.js +0 -1
- package/dist/client/assets/use-mcp-auth-status-CpecQqEX.js +0 -1
- package/dist/client/assets/use-open-billing-url-DaC9_MxZ.js +0 -1
- package/dist/client/assets/use-org-auth-client-DuxSmx0x.js +0 -1
- package/dist/client/assets/use-org-notice-lWz1PPs-.js +0 -1
- package/dist/client/assets/use-organization-settings-C-LQvPpq.js +0 -1
- package/dist/client/assets/use-panel-navigate-D2RT2tc_.js +0 -1
- package/dist/client/assets/use-project-scope-Ch_4TfMQ.js +0 -1
- package/dist/client/assets/use-registry-connections-CuDWC28C.js +0 -1
- package/dist/client/assets/use-secrets-BJDccjnS.js +0 -1
- package/dist/client/assets/use-section-preview-base-SCqBiLMF.js +0 -1
- package/dist/client/assets/use-status-sounds-BG-lkYEo.js +0 -1
- package/dist/client/assets/use-tags-DhkHJc7C.js +0 -1
- package/dist/client/assets/use-task-metadata-COSUQhUk.js +0 -1
- package/dist/client/assets/use-view-mode-CUARubnx.js +0 -1
- package/dist/client/assets/use-virtual-mcp-BMRFgR9g.js +0 -1
- package/dist/client/assets/useInfiniteQuery-DOeboQGx.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-B5UzTlHS.js +0 -1
- package/dist/client/assets/variant-calendar-f9XxiGiP.js +0 -1
- package/dist/client/assets/view-mode-toggle-D31fXZcw.js +0 -1
- /package/dist/client/assets/{index-DDGTF8rc.css → agent-site-editor-DDGTF8rc.css} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as Y,r as h,b as le,j as b,t as V,F as ct,B as ut,em as dt,en as Ke,eo as ft,ep as z,eq as pe,ar as mt,er as pt,es as ge,et as gt,eu as ht,ev as vt,ew as bt,ex as xt,ey as yt,ez as wt,eA as St,l as Ue,h as Rt,n as qe,I as Be,K as ce,o as J,eB as Qe,c_ as Ce,eC as oe}from"./index-gctAQu2T.js";import{u as Ct,S as Et,a as It,b as kt,s as Pt}from"./hooks-BrcP19Uo.js";import{f as Tt,h as Ft,j as Nt,i as se,k as _t,P as Ee,l as At,c as Mt,u as Dt,n as jt,d as Lt,e as Ot,F as $t,s as Kt,b as Ut}from"./index-DQ6uuKpF.js";import{d as qt,h as Bt,c as Qt,b as Ht,D as Vt}from"./dialog--Jkwvpx1.js";import{aH as Wt,A as zt}from"./agent-icon-DsGBCBNv.js";import"./chat-context-CD1rWX64.js";import{m as Yt,i as Xt,a as Gt}from"./decopilot-CK3rN_ad.js";import{u as He}from"./use-mcp-client-CzGi1Gun.js";import{u as Jt}from"./use-virtual-mcp-BMRFgR9g.js";import{g as ue,d as Zt,s as Ve}from"./gateway-client-Cb37izH_.js";import{g as en}from"./use-project-scope-Ch_4TfMQ.js";import{l as Ie,g as We}from"./use-mcp-prompts-BJsq63pG.js";import{f as tn,a as nn}from"./use-org-fs-Cm8FYvYP.js";async function rn(t,e,n,r,o,s){if(!Yt(e)){V.error("Selected model does not support file uploads");return}const i=n.type||"application/octet-stream";if(!Xt(i,e)){const c=Gt(e).parts.map(f=>s(f)).join(", "),u=e?.title??"This model";o?o({fileName:n.name,modelName:u,accepted:c}):V.error(`"${n.name}" can't be attached`,{description:`${u} accepts ${c}.`});return}const a=10*1024*1024;if(n.size>a){V.error(`File "${n.name}" exceeds 10MB limit`);return}try{const c=new FileReader,u=new Promise((l,d)=>{c.onload=()=>{const g=c.result;if(typeof g!="string"){d(new Error("Failed to read file as data URL"));return}const m=g.includes(",")?g.split(",")[1]??g:g;l(m)},c.onerror=d});c.readAsDataURL(n);const f=await u,p={id:crypto.randomUUID(),name:n.name,mimeType:n.type||"application/octet-stream",size:n.size,data:f};Tt(t,{from:r,to:r},p)}catch(c){console.error("Failed to process file:",c),V.error(`Failed to load file "${n.name}"`)}}function on(t){const e=Y.c(9),{editor:n,selectedModel:r,onUnsupportedFile:o}=t,s=le(),i=h.useRef(an);let a,c;e[0]!==n||e[1]!==o||e[2]!==r||e[3]!==s?(a=()=>{i.current=async(p,l)=>{await rn(n,r,p,l,o,s)}},c=[n,r,o,s],e[0]=n,e[1]=o,e[2]=r,e[3]=s,e[4]=a,e[5]=c):(a=e[4],c=e[5]),h.useEffect(a,c);let u,f;return e[6]!==n?(u=()=>{if(n?.isDestroyed)return;const p=new Ft("fileDropHandler");n.state.plugins.find(g=>g.spec.key===p)&&n.unregisterPlugin(p);const d=new Nt({key:p,props:{handleDrop:(g,m,v,y)=>{if(y)return!1;const x=m.dataTransfer?.files;if(!x||x.length===0)return!1;m.preventDefault();const w=g.posAtCoords({left:m.clientX,top:m.clientY});if(!w)return!1;const I=Array.from(x);return(async()=>{let N=w.pos;for(const T of I)await i.current?.(T,N),N=g.state.selection.to})(),!0},handlePaste:(g,m)=>{const v=m.clipboardData?.items;if(!v)return!1;const y=Array.from(v).filter(sn);return y.length===0?!1:(m.preventDefault(),(async()=>{let x=g.state.selection.from;for(const w of y){const I=w.getAsFile();I&&(await i.current?.(I,x),x=g.state.selection.to)}})(),!0)}}});return n.registerPlugin(d),()=>{n?.isDestroyed||n.unregisterPlugin(p)}},f=[n],e[6]=n,e[7]=u,e[8]=f):(u=e[7],f=e[8]),h.useEffect(u,f),null}function sn(t){return t.kind==="file"}function an(){return Promise.resolve()}function jr(t){const e=Y.c(43),{info:n,onClose:r}=t,o=le(),s=n!==null;let i;e[0]!==r?(i=A=>!A&&r(),e[0]=r,e[1]=i):i=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=["radial-gradient(ellipse 40% 200% at -5% 100%, rgba(251,191,36,0.35) 0%, transparent 100%)","radial-gradient(ellipse 40% 200% at 105% -10%, rgba(244,114,182,0.25) 0%, transparent 100%)"],e[2]=a):a=e[2];let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=b.jsx("div",{className:"absolute inset-x-0 top-0 h-36 pointer-events-none",style:{backgroundImage:a.join(", "),maskImage:"linear-gradient(to bottom, black 0%, transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black 0%, transparent 100%)"}}),e[3]=c):c=e[3];let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=b.jsx("div",{className:"flex items-center justify-center size-9 rounded-lg bg-warning/15 text-warning",children:b.jsx(ct,{size:18})}),e[4]=u):u=e[4];let f;e[5]!==o?(f=o("chat.uploader.fileTypeNotSupported"),e[5]=o,e[6]=f):f=e[6];let p;e[7]!==f?(p=b.jsx(qt,{className:"text-xl font-semibold tracking-tight",children:f}),e[7]=f,e[8]=p):p=e[8];const l=n?.fileName;let d;e[9]!==l?(d=b.jsxs("span",{className:"font-medium text-foreground",children:["“",l,"”"]}),e[9]=l,e[10]=d):d=e[10];let g;e[11]!==o?(g=o("chat.uploader.cantAttachToChat"),e[11]=o,e[12]=g):g=e[12];let m;e[13]!==g||e[14]!==d?(m=b.jsxs(Bt,{className:"mt-1.5 text-sm leading-relaxed",children:[d," ",g]}),e[13]=g,e[14]=d,e[15]=m):m=e[15];let v;e[16]!==m||e[17]!==p?(v=b.jsxs("div",{className:"relative px-8 pt-8 pb-2 overflow-hidden",children:[c,b.jsxs(Qt,{className:"relative gap-4",children:[u,b.jsxs("div",{children:[p,m]})]})]}),e[16]=m,e[17]=p,e[18]=v):v=e[18];const y=n?.modelName??"";let x;e[19]!==o||e[20]!==y?(x=o("chat.uploader.accepts",{modelName:y}),e[19]=o,e[20]=y,e[21]=x):x=e[21];let w;e[22]!==x?(w=b.jsx("div",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground mb-2",children:x}),e[22]=x,e[23]=w):w=e[23];let I;e[24]===Symbol.for("react.memo_cache_sentinel")?(I=b.jsx(Wt,{size:14,className:"text-muted-foreground"}),e[24]=I):I=e[24];const N=n?.accepted;let T;e[25]!==N?(T=b.jsxs("div",{className:"flex items-center gap-2 text-sm text-foreground",children:[I,b.jsx("span",{className:"capitalize",children:N})]}),e[25]=N,e[26]=T):T=e[26];let S;e[27]!==w||e[28]!==T?(S=b.jsx("div",{className:"px-8 pt-3 pb-6 space-y-3",children:b.jsxs("div",{className:"rounded-xl border border-border p-4",children:[w,T]})}),e[27]=w,e[28]=T,e[29]=S):S=e[29];let R;e[30]!==o?(R=o("chat.uploader.gotIt"),e[30]=o,e[31]=R):R=e[31];let k;e[32]!==r||e[33]!==R?(k=b.jsx("div",{className:"px-8 py-4 border-t border-border bg-muted/30 flex items-center justify-end",children:b.jsx(ut,{onClick:r,children:R})}),e[32]=r,e[33]=R,e[34]=k):k=e[34];let F;e[35]!==v||e[36]!==S||e[37]!==k?(F=b.jsxs(Ht,{className:"sm:max-w-[480px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:ln,children:[v,S,k]}),e[35]=v,e[36]=S,e[37]=k,e[38]=F):F=e[38];let D;return e[39]!==s||e[40]!==i||e[41]!==F?(D=b.jsx(Vt,{open:s,onOpenChange:i,children:F}),e[39]=s,e[40]=i,e[41]=F,e[42]=D):D=e[42],D}function ln(t){return t.preventDefault()}function Lr(){const t=Y.c(3),[e,n]=h.useState(null);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>n(null),t[0]=r):r=t[0];let o;return t[1]!==e?(o={unsupportedFile:e,onUnsupportedFile:n,clearUnsupportedFile:r},t[1]=e,t[2]=o):o=t[2],o}var cn=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],xe=cn.join(","),ze=typeof Element>"u",ie=ze?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,fe=!ze&&Element.prototype.getRootNode?function(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}:function(t){return t?.ownerDocument},me=function(e,n){var r;n===void 0&&(n=!0);var o=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),s=o===""||o==="true",i=s||n&&e&&(typeof e.closest=="function"?e.closest("[inert]"):me(e.parentNode));return i},un=function(e){var n,r=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"contenteditable");return r===""||r==="true"},dn=function(e,n,r){if(me(e))return[];var o=Array.prototype.slice.apply(e.querySelectorAll(xe));return n&&ie.call(e,xe)&&o.unshift(e),o=o.filter(r),o},ye=function(e,n,r){for(var o=[],s=Array.from(e);s.length;){var i=s.shift();if(!me(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),c=a.length?a:i.children,u=ye(c,!0,r);r.flatten?o.push.apply(o,u):o.push({scopeParent:i,candidates:u})}else{var f=ie.call(i,xe);f&&r.filter(i)&&(n||!e.includes(i))&&o.push(i);var p=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),l=!me(p,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(p&&l){var d=ye(p===!0?i.children:p.children,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:i,candidates:d})}else s.unshift.apply(s,i.children)}}return o},Ye=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Xe=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||un(e))&&!Ye(e)?0:e.tabIndex},fn=function(e,n){var r=Xe(e);return r<0&&n&&!Ye(e)?0:r},mn=function(e,n){return e.tabIndex===n.tabIndex?e.documentOrder-n.documentOrder:e.tabIndex-n.tabIndex},Ge=function(e){return e.tagName==="INPUT"},pn=function(e){return Ge(e)&&e.type==="hidden"},gn=function(e){var n=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return n},hn=function(e,n){for(var r=0;r<e.length;r++)if(e[r].checked&&e[r].form===n)return e[r]},vn=function(e){if(!e.name)return!0;var n=e.form||fe(e),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(e.name));else try{o=r(e.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=hn(o,e.form);return!s||s===e},bn=function(e){return Ge(e)&&e.type==="radio"},xn=function(e){return bn(e)&&!vn(e)},yn=function(e){var n,r=e&&fe(e),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==e){var i,a,c;for(s=!!((i=o)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(o)||e!=null&&(c=e.ownerDocument)!==null&&c!==void 0&&c.contains(e));!s&&o;){var u,f,p;r=fe(o),o=(u=r)===null||u===void 0?void 0:u.host,s=!!((f=o)!==null&&f!==void 0&&(p=f.ownerDocument)!==null&&p!==void 0&&p.contains(o))}}return s},ke=function(e){var n=e.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},wn=function(e,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in e){var s=e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(e).visibility==="hidden")return!0;var i=ie.call(e,"details>summary:first-of-type"),a=i?e.parentElement:e;if(ie.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var c=e;e;){var u=e.parentElement,f=fe(e);if(u&&!u.shadowRoot&&o(u)===!0)return ke(e);e.assignedSlot?e=e.assignedSlot:!u&&f!==e.ownerDocument?e=f.host:e=u}e=c}if(yn(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return ke(e);return!1},Sn=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var n=e.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return ie.call(n,"fieldset[disabled] *")?!0:!o.contains(e)}return!0}n=n.parentElement}return!1},Rn=function(e,n){return!(n.disabled||pn(n)||wn(n,e)||gn(n)||Sn(n))},Pe=function(e,n){return!(xn(n)||Xe(n)<0||!Rn(e,n))},Cn=function(e){var n=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Je=function(e){var n=[],r=[];return e.forEach(function(o,s){var i=!!o.scopeParent,a=i?o.scopeParent:o,c=fn(a,i),u=i?Je(o.candidates):a;c===0?i?n.push.apply(n,u):n.push(a):r.push({documentOrder:s,tabIndex:c,item:o,isScope:i,content:u})}),r.sort(mn).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},Ze=function(e,n){n=n||{};var r;return n.getShadowRoot?r=ye([e],n.includeContainer,{filter:Pe.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Cn}):r=dn(e,n.includeContainer,Pe.bind(null,n)),Je(r)};function En(){return/apple/i.test(navigator.vendor)}const Te="data-floating-ui-focusable";function In(t){let e=t.activeElement;for(;((n=e)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;e=e.shadowRoot.activeElement}return e}function we(t,e){if(!t||!e)return!1;const n=e.getRootNode==null?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&dt(n)){let r=e;for(;r;){if(t===r)return!0;r=r.parentNode||r.host}}return!1}function re(t){return"composedPath"in t?t.composedPath()[0]:t.target}function he(t,e){if(e==null)return!1;if("composedPath"in t)return t.composedPath().includes(e);const n=t;return n.target!=null&&e.contains(n.target)}function kn(t){return t.matches("html,body")}function ae(t){return t?.ownerDocument||document}function Pn(t){return t?t.hasAttribute(Te)?t:t.querySelector("["+Te+"]")||t:null}function de(t,e,n){return n===void 0&&(n=!0),t.filter(o=>{var s;return o.parentId===e&&(!n||((s=o.context)==null?void 0:s.open))}).flatMap(o=>[o,...de(t,o.id,n)])}function Tn(t){return"nativeEvent"in t}var Fn=typeof document<"u",Nn=function(){},Z=Fn?h.useLayoutEffect:Nn;const _n={...Ke},An=_n.useInsertionEffect,Mn=An||(t=>t());function te(t){const e=h.useRef(()=>{});return Mn(()=>{e.current=t}),h.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return e.current==null?void 0:e.current(...r)},[])}const et=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function tt(t,e){const n=Ze(t,et()),r=n.length;if(r===0)return;const o=In(ae(t)),s=n.indexOf(o),i=s===-1?e===1?0:r-1:s+e;return n[i]}function Dn(t){return tt(ae(t).body,1)||t}function jn(t){return tt(ae(t).body,-1)||t}function ve(t,e){const n=e||t.currentTarget,r=t.relatedTarget;return!r||!we(n,r)}function Ln(t){Ze(t,et()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Fe(t){t.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const On="data-floating-ui-focusable",Ne="active",_e="selected",$n={...Ke};let Ae=!1,Kn=0;const Me=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Kn++;function Un(){const[t,e]=h.useState(()=>Ae?Me():void 0);return Z(()=>{t==null&&e(Me())},[]),h.useEffect(()=>{Ae=!0},[]),t}const qn=$n.useId,Se=qn||Un;function Bn(){const t=new Map;return{emit(e,n){var r;(r=t.get(e))==null||r.forEach(o=>o(n))},on(e,n){t.has(e)||t.set(e,new Set),t.get(e).add(n)},off(e,n){var r;(r=t.get(e))==null||r.delete(n)}}}const Qn=h.createContext(null),Hn=h.createContext(null),nt=()=>{var t;return((t=h.useContext(Qn))==null?void 0:t.id)||null},rt=()=>h.useContext(Hn);function Re(t){return"data-floating-ui-"+t}const Vn={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},De=h.forwardRef(function(e,n){const[r,o]=h.useState();Z(()=>{En()&&o("button")},[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Re("focus-guard")]:"",style:Vn};return b.jsx("span",{...e,...s})}),Wn={clipPath:"inset(50%)",position:"fixed",top:0,left:0},ot=h.createContext(null),je=Re("portal");function zn(t){t===void 0&&(t={});const{id:e,root:n}=t,r=Se(),o=Xn(),[s,i]=h.useState(null),a=h.useRef(null);return Z(()=>()=>{s?.remove(),queueMicrotask(()=>{a.current=null})},[s]),Z(()=>{if(!r||a.current)return;const c=e?document.getElementById(e):null;if(!c)return;const u=document.createElement("div");u.id=r,u.setAttribute(je,""),c.appendChild(u),a.current=u,i(u)},[e,r]),Z(()=>{if(n===null||!r||a.current)return;let c=n||o?.portalNode;c&&!bt(c)&&(c=c.current),c=c||document.body;let u=null;e&&(u=document.createElement("div"),u.id=e,c.appendChild(u));const f=document.createElement("div");f.id=r,f.setAttribute(je,""),c=u||c,c.appendChild(f),a.current=f,i(f)},[e,n,r,o]),s}function Yn(t){const{children:e,id:n,root:r,preserveTabOrder:o=!0}=t,s=zn({id:n,root:r}),[i,a]=h.useState(null),c=h.useRef(null),u=h.useRef(null),f=h.useRef(null),p=h.useRef(null),l=i?.modal,d=i?.open,g=!!i&&!i.modal&&i.open&&o&&!!(r||s);return h.useEffect(()=>{if(!s||!o||l)return;function m(v){s&&ve(v)&&(v.type==="focusin"?Fe:Ln)(s)}return s.addEventListener("focusin",m,!0),s.addEventListener("focusout",m,!0),()=>{s.removeEventListener("focusin",m,!0),s.removeEventListener("focusout",m,!0)}},[s,o,l]),h.useEffect(()=>{s&&(d||Fe(s))},[d,s]),b.jsxs(ot.Provider,{value:h.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:c,afterOutsideRef:u,beforeInsideRef:f,afterInsideRef:p,portalNode:s,setFocusManagerState:a}),[o,s]),children:[g&&s&&b.jsx(De,{"data-type":"outside",ref:c,onFocus:m=>{if(ve(m,s)){var v;(v=f.current)==null||v.focus()}else{const y=i?i.domReference:null,x=jn(y);x?.focus()}}}),g&&s&&b.jsx("span",{"aria-owns":s.id,style:Wn}),s&&mt.createPortal(e,s),g&&s&&b.jsx(De,{"data-type":"outside",ref:u,onFocus:m=>{if(ve(m,s)){var v;(v=p.current)==null||v.focus()}else{const y=i?i.domReference:null,x=Dn(y);x?.focus(),i?.closeOnFocusOut&&i?.onOpenChange(!1,m.nativeEvent,"focus-out")}}})]})}const Xn=()=>h.useContext(ot),Gn={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Jn={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Le=t=>{var e,n;return{escapeKey:typeof t=="boolean"?t:(e=t?.escapeKey)!=null?e:!1,outsidePress:typeof t=="boolean"?t:(n=t?.outsidePress)!=null?n:!0}};function Zn(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,elements:o,dataRef:s}=t,{enabled:i=!0,escapeKey:a=!0,outsidePress:c=!0,outsidePressEvent:u="pointerdown",referencePress:f=!1,referencePressEvent:p="pointerdown",ancestorScroll:l=!1,bubbles:d,capture:g}=e,m=rt(),v=te(typeof c=="function"?c:()=>!1),y=typeof c=="function"?v:c,x=h.useRef(!1),{escapeKey:w,outsidePress:I}=Le(d),{escapeKey:N,outsidePress:T}=Le(g),S=h.useRef(!1),R=te(E=>{var M;if(!n||!i||!a||E.key!=="Escape"||S.current)return;const C=(M=s.current.floatingContext)==null?void 0:M.nodeId,$=m?de(m.nodesRef.current,C):[];if(!w&&(E.stopPropagation(),$.length>0)){let P=!0;if($.forEach(L=>{var O;if((O=L.context)!=null&&O.open&&!L.context.dataRef.current.__escapeKeyBubbles){P=!1;return}}),!P)return}r(!1,Tn(E)?E.nativeEvent:E,"escape-key")}),k=te(E=>{var M;const C=()=>{var $;R(E),($=re(E))==null||$.removeEventListener("keydown",C)};(M=re(E))==null||M.addEventListener("keydown",C)}),F=te(E=>{var M;const C=s.current.insideReactTree;s.current.insideReactTree=!1;const $=x.current;if(x.current=!1,u==="click"&&$||C||typeof y=="function"&&!y(E))return;const P=re(E),L="["+Re("inert")+"]",O=ae(o.floating).querySelectorAll(L);let H=z(P)?P:null;for(;H&&!ge(H);){const j=gt(H);if(ge(j)||!z(j))break;H=j}if(O.length&&z(P)&&!kn(P)&&!we(P,o.floating)&&Array.from(O).every(j=>!we(H,j)))return;if(ht(P)&&Q){const j=ge(P),K=vt(P),W=/auto|scroll/,q=j||W.test(K.overflowX),U=j||W.test(K.overflowY),ee=q&&P.clientWidth>0&&P.scrollWidth>P.clientWidth,B=U&&P.clientHeight>0&&P.scrollHeight>P.clientHeight,ne=K.direction==="rtl",at=B&&(ne?E.offsetX<=P.offsetWidth-P.clientWidth:E.offsetX>P.clientWidth),lt=ee&&E.offsetY>P.clientHeight;if(at||lt)return}const G=(M=s.current.floatingContext)==null?void 0:M.nodeId,X=m&&de(m.nodesRef.current,G).some(j=>{var K;return he(E,(K=j.context)==null?void 0:K.elements.floating)});if(he(E,o.floating)||he(E,o.domReference)||X)return;const _=m?de(m.nodesRef.current,G):[];if(_.length>0){let j=!0;if(_.forEach(K=>{var W;if((W=K.context)!=null&&W.open&&!K.context.dataRef.current.__outsidePressBubbles){j=!1;return}}),!j)return}r(!1,E,"outside-press")}),D=te(E=>{var M;const C=()=>{var $;F(E),($=re(E))==null||$.removeEventListener(u,C)};(M=re(E))==null||M.addEventListener(u,C)});h.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=w,s.current.__outsidePressBubbles=I;let E=-1;function M(O){r(!1,O,"ancestor-scroll")}function C(){window.clearTimeout(E),S.current=!0}function $(){E=window.setTimeout(()=>{S.current=!1},pt()?5:0)}const P=ae(o.floating);a&&(P.addEventListener("keydown",N?k:R,N),P.addEventListener("compositionstart",C),P.addEventListener("compositionend",$)),y&&P.addEventListener(u,T?D:F,T);let L=[];return l&&(z(o.domReference)&&(L=pe(o.domReference)),z(o.floating)&&(L=L.concat(pe(o.floating))),!z(o.reference)&&o.reference&&o.reference.contextElement&&(L=L.concat(pe(o.reference.contextElement)))),L=L.filter(O=>{var H;return O!==((H=P.defaultView)==null?void 0:H.visualViewport)}),L.forEach(O=>{O.addEventListener("scroll",M,{passive:!0})}),()=>{a&&(P.removeEventListener("keydown",N?k:R,N),P.removeEventListener("compositionstart",C),P.removeEventListener("compositionend",$)),y&&P.removeEventListener(u,T?D:F,T),L.forEach(O=>{O.removeEventListener("scroll",M)}),window.clearTimeout(E)}},[s,o,a,y,u,n,r,l,i,w,I,R,N,k,F,T,D]),h.useEffect(()=>{s.current.insideReactTree=!1},[s,y,u]);const A=h.useMemo(()=>({onKeyDown:R,...f&&{[Gn[p]]:E=>{r(!1,E.nativeEvent,"reference-press")},...p!=="click"&&{onClick(E){r(!1,E.nativeEvent,"reference-press")}}}}),[R,r,f,p]),Q=h.useMemo(()=>{function E(M){M.button===0&&(x.current=!0)}return{onKeyDown:R,onMouseDown:E,onMouseUp:E,[Jn[u]]:()=>{s.current.insideReactTree=!0}}},[R,u,s]);return h.useMemo(()=>i?{reference:A,floating:Q}:{},[i,A,Q])}function er(t){const{open:e=!1,onOpenChange:n,elements:r}=t,o=Se(),s=h.useRef({}),[i]=h.useState(()=>Bn()),a=nt()!=null,[c,u]=h.useState(r.reference),f=te((d,g,m)=>{s.current.openEvent=d?g:void 0,i.emit("openchange",{open:d,event:g,reason:m,nested:a}),n?.(d,g,m)}),p=h.useMemo(()=>({setPositionReference:u}),[]),l=h.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return h.useMemo(()=>({dataRef:s,open:e,onOpenChange:f,elements:l,events:i,floatingId:o,refs:p}),[e,f,l,i,o,p])}function tr(t){t===void 0&&(t={});const{nodeId:e}=t,n=er({...t,elements:{reference:null,floating:null,...t.elements}}),r=t.rootContext||n,o=r.elements,[s,i]=h.useState(null),[a,c]=h.useState(null),f=o?.domReference||s,p=h.useRef(null),l=rt();Z(()=>{f&&(p.current=f)},[f]);const d=ft({...t,elements:{...o,...a&&{reference:a}}}),g=h.useCallback(w=>{const I=z(w)?{getBoundingClientRect:()=>w.getBoundingClientRect(),getClientRects:()=>w.getClientRects(),contextElement:w}:w;c(I),d.refs.setReference(I)},[d.refs]),m=h.useCallback(w=>{(z(w)||w===null)&&(p.current=w,i(w)),(z(d.refs.reference.current)||d.refs.reference.current===null||w!==null&&!z(w))&&d.refs.setReference(w)},[d.refs]),v=h.useMemo(()=>({...d.refs,setReference:m,setPositionReference:g,domReference:p}),[d.refs,m,g]),y=h.useMemo(()=>({...d.elements,domReference:f}),[d.elements,f]),x=h.useMemo(()=>({...d,...r,refs:v,elements:y,nodeId:e}),[d,v,y,e,r]);return Z(()=>{r.dataRef.current.floatingContext=x;const w=l?.nodesRef.current.find(I=>I.id===e);w&&(w.context=x)}),h.useMemo(()=>({...d,context:x,refs:v,elements:y}),[d,v,y,x])}function be(t,e,n){const r=new Map,o=n==="item";let s=t;if(o&&t){const{[Ne]:i,[_e]:a,...c}=t;s=c}return{...n==="floating"&&{tabIndex:-1,[On]:""},...s,...e.map(i=>{const a=i?i[n]:null;return typeof a=="function"?t?a(t):null:a}).concat(t).reduce((i,a)=>(a&&Object.entries(a).forEach(c=>{let[u,f]=c;if(!(o&&[Ne,_e].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof f=="function"){var p;(p=r.get(u))==null||p.push(f),i[u]=function(){for(var l,d=arguments.length,g=new Array(d),m=0;m<d;m++)g[m]=arguments[m];return(l=r.get(u))==null?void 0:l.map(v=>v(...g)).find(v=>v!==void 0)}}}else i[u]=f}),i),{})}}function nr(t){t===void 0&&(t=[]);const e=t.map(a=>a?.reference),n=t.map(a=>a?.floating),r=t.map(a=>a?.item),o=h.useCallback(a=>be(a,t,"reference"),e),s=h.useCallback(a=>be(a,t,"floating"),n),i=h.useCallback(a=>be(a,t,"item"),r);return h.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}const rr=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function or(t,e){var n,r;e===void 0&&(e={});const{open:o,elements:s,floatingId:i}=t,{enabled:a=!0,role:c="dialog"}=e,u=Se(),f=((n=s.domReference)==null?void 0:n.id)||u,p=h.useMemo(()=>{var x;return((x=Pn(s.floating))==null?void 0:x.id)||i},[s.floating,i]),l=(r=rr.get(c))!=null?r:c,g=nt()!=null,m=h.useMemo(()=>l==="tooltip"||c==="label"?{["aria-"+(c==="label"?"labelledby":"describedby")]:o?p:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":l==="alertdialog"?"dialog":l,"aria-controls":o?p:void 0,...l==="listbox"&&{role:"combobox"},...l==="menu"&&{id:f},...l==="menu"&&g&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[l,p,g,o,f,c]),v=h.useMemo(()=>{const x={id:p,...l&&{role:l}};return l==="tooltip"||c==="label"?x:{...x,...l==="menu"&&{"aria-labelledby":f}}},[l,p,f,c]),y=h.useCallback(x=>{let{active:w,selected:I}=x;const N={role:"option",...w&&{id:p+"-fui-option"}};switch(c){case"select":case"combobox":return{...N,"aria-selected":I}}return{}},[p,c]);return h.useMemo(()=>a?{reference:m,floating:v,item:y}:{},[a,m,v,y])}function sr({children:t}){const{state:e,dispatch:n}=It(),{open:r,element:o}=e,s=()=>{n({type:"ON_EXIT"})},{refs:i,floatingStyles:a,context:c}=tr({placement:"bottom-start",open:r,onOpenChange:l=>{l||s()},elements:{reference:o},middleware:[xt(10),yt(),wt()],whileElementsMounted:St}),u=Zn(c,{outsidePress:l=>!(l.target instanceof Element&&l.target.closest(".ProseMirror"))}),f=or(c,{role:"listbox"}),{getFloatingProps:p}=nr([u,f]);return r?b.jsx(Yn,{children:b.jsx("div",{ref:i.setFloating,style:a,...p(),className:"z-50 w-auto min-w-[360px] max-w-[520px] rounded-lg border bg-popover p-0 text-popover-foreground shadow-md outline-hidden overflow-hidden",children:t})}):null}const ir=t=>{const e=Y.c(29),{item:n,isSelected:r,onSelect:o,isLoading:s,ref:i}=t;let a;if(e[0]!==n){const T=ue(n._meta);a=n.title||Zt(n.name,T),e[0]=n,e[1]=a}else a=e[1];const c=a,u=n.description||null,f=n.icon,p=r&&"bg-accent text-accent-foreground",l=s&&"pointer-events-none opacity-50";let d;e[2]!==p||e[3]!==l?(d=Ue("relative flex w-full cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors","hover:bg-accent hover:text-accent-foreground","focus:bg-accent focus:text-accent-foreground",p,l),e[2]=p,e[3]=l,e[4]=d):d=e[4];let g;e[5]!==f||e[6]!==c?(g=f!==void 0&&b.jsx(zt,{icon:f,name:c,size:"xs",className:"mr-2"}),e[5]=f,e[6]=c,e[7]=g):g=e[7];let m;e[8]!==c?(m=b.jsx("span",{className:"font-medium flex items-center truncate capitalize",children:c}),e[8]=c,e[9]=m):m=e[9];let v;e[10]!==s?(v=s&&b.jsx(Rt,{size:"xs"}),e[10]=s,e[11]=v):v=e[11];let y;e[12]!==m||e[13]!==v?(y=b.jsxs("div",{className:"flex items-center justify-between gap-2",children:[m,v]}),e[12]=m,e[13]=v,e[14]=y):y=e[14];let x;e[15]!==u?(x=u&&b.jsx("div",{className:"text-xs text-muted-foreground line-clamp-1",children:u}),e[15]=u,e[16]=x):x=e[16];let w;e[17]!==y||e[18]!==x?(w=b.jsxs("div",{className:"flex flex-col gap-0.5 flex-1 min-w-0",children:[y,x]}),e[17]=y,e[18]=x,e[19]=w):w=e[19];let I;e[20]!==n.drillable?(I=n.drillable&&b.jsx("kbd",{className:"shrink-0 ml-2 px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground bg-muted border border-border rounded",children:"↵"}),e[20]=n.drillable,e[21]=I):I=e[21];let N;return e[22]!==o||e[23]!==i||e[24]!==w||e[25]!==I||e[26]!==d||e[27]!==g?(N=b.jsxs("div",{ref:i,onClick:o,className:d,children:[g,w,I]}),e[22]=o,e[23]=i,e[24]=w,e[25]=I,e[26]=d,e[27]=g,e[28]=N):N=e[28],N},ar=t=>{const e=Y.c(21),{editor:n,queryKey:r,queryFn:o,onSelect:s}=t,i=le();let a;e[0]!==n||e[1]!==s||e[2]!==o||e[3]!==r?(a={editor:n,queryKey:r,queryFn:o,onSelect:s},e[0]=n,e[1]=s,e[2]=o,e[3]=r,e[4]=a):a=e[4];const{items:c,selectedIndex:u,onSelect:f,selectedItem:p}=kt(a);if(!c.length){let m;e[5]!==i?(m=i("chat.mention.noItemsFound"),e[5]=i,e[6]=m):m=e[6];let v;return e[7]!==m?(v=b.jsx("div",{className:"min-w-[360px] max-w-[520px] bg-popover text-popover-foreground rounded-md border shadow-md p-3 text-sm",children:m}),e[7]=m,e[8]=v):v=e[8],v}let l;e[9]===Symbol.for("react.memo_cache_sentinel")?(l={maxHeight:"min(320px, var(--radix-popover-content-available-height, 320px))"},e[9]=l):l=e[9];let d;if(e[10]!==f||e[11]!==c||e[12]!==u||e[13]!==p?.name){let m;e[15]!==f||e[16]!==u||e[17]!==p?.name?(m=(v,y)=>b.jsx(ir,{item:v,isSelected:y===u,ref:y===u?ur:void 0,onSelect:()=>f(v,y),isLoading:p?.name===v.name},`${v.kind??"item"}:${v.name}`),e[15]=f,e[16]=u,e[17]=p?.name,e[18]=m):m=e[18],d=c.map(m),e[10]=f,e[11]=c,e[12]=u,e[13]=p?.name,e[14]=d}else d=e[14];let g;return e[19]!==d?(g=b.jsx("div",{className:"min-w-[360px] max-w-[520px] bg-popover text-popover-foreground rounded-md overflow-y-auto",style:l,children:b.jsx("div",{className:"p-1",children:d})}),e[19]=d,e[20]=g):g=e[20],g};function lr(){const t=Y.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=b.jsx("div",{className:"p-1",children:[...Array(3)].map(cr)}),t[0]=e):e=t[0],e}function cr(t,e){return b.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1.5 animate-pulse",children:[b.jsx("div",{className:"h-4 w-24 bg-muted rounded"}),b.jsx("div",{className:"h-3 w-32 bg-muted rounded"})]},e)}function st(t){const e=Y.c(18),{editor:n,char:r,pluginKey:o,queryKey:s,queryFn:i,onSelect:a,allow:c,onOpenChange:u}=t;let f;e[0]!==c||e[1]!==r||e[2]!==n||e[3]!==u||e[4]!==o?(f={editor:n,char:r,pluginKey:o,allow:c,onOpenChange:u},e[0]=c,e[1]=r,e[2]=n,e[3]=u,e[4]=o,e[5]=f):f=e[5];const{state:p,dispatch:l}=Ct(f);let d;e[6]!==l||e[7]!==p?(d={state:p,dispatch:l},e[6]=l,e[7]=p,e[8]=d):d=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=b.jsx(lr,{}),e[9]=g):g=e[9];let m;e[10]!==n||e[11]!==a||e[12]!==i||e[13]!==s?(m=b.jsx(sr,{children:b.jsx(h.Suspense,{fallback:g,children:b.jsx(ar,{editor:n,queryKey:s,queryFn:i,onSelect:a})})}),e[10]=n,e[11]=a,e[12]=i,e[13]=s,e[14]=m):m=e[14];let v;return e[15]!==d||e[16]!==m?(v=b.jsx(Et.Provider,{value:d,children:m}),e[15]=d,e[16]=m,e[17]=v):v=e[17],v}function ur(t){t&&t.scrollIntoView({block:"center",behavior:"smooth"})}const dr=t=>{const e=Y.c(53),{editor:n,virtualMcpId:r,suggestionOpenRef:o}=t,s=le(),i=qe(),{org:a}=Be(),c=Jt();let u;e[0]!==c?(u=en(c),e[0]=c,e[1]=u):u=e[1];const f=u;let p;e[2]!==a.id||e[3]!==a.slug||e[4]!==r?(p={connectionId:r,orgId:a.id,orgSlug:a.slug},e[2]=a.id,e[3]=a.slug,e[4]=r,e[5]=p):p=e[5];const l=He(p);let d;e[6]!==a.id||e[7]!==r?(d=ce.virtualMcpResources(r,a.id),e[6]=a.id,e[7]=r,e[8]=d):d=e[8];const g=d,[m,v]=h.useState("categories");let y;e[9]!==m?(y=()=>m,e[9]=m,e[10]=y):y=e[10];const x=h.useEffectEvent(y),w=h.useRef(null),I=h.useRef(!1),N=r??"default";let T;e[11]!==m||e[12]!==a.id||e[13]!==N?(T=["at-mention",a.id,N,m],e[11]=m,e[12]=a.id,e[13]=N,e[14]=T):T=e[14];const S=T;let R;e[15]!==s?(R=s("chat.mentionAt.agentsTitle"),e[15]=s,e[16]=R):R=e[16];let k;e[17]!==s?(k=s("chat.mentionAt.agentsDescription"),e[17]=s,e[18]=k):k=e[18];let F;e[19]!==R||e[20]!==k?(F={name:"agents",title:R,description:k,kind:"category",drillable:!0},e[19]=R,e[20]=k,e[21]=F):F=e[21];let D;e[22]!==s?(D=s("chat.mentionAt.resourcesTitle"),e[22]=s,e[23]=D):D=e[23];let A;e[24]!==s?(A=s("chat.mentionAt.resourcesDescription"),e[24]=s,e[25]=A):A=e[25];let Q;e[26]!==D||e[27]!==A?(Q={name:"resources",title:D,description:A,kind:"category",drillable:!0},e[26]=D,e[27]=A,e[28]=Q):Q=e[28];let E;e[29]!==Q||e[30]!==F?(E=[F,Q],e[29]=Q,e[30]=F,e[31]=E):E=e[31];const M=E;let C;e[32]!==l||e[33]!==n||e[34]!==s?(C=async X=>{const{item:_,range:j}=X;if(J("chat_picker_item_selected",{picker:"@",item_kind:_.kind,item_name:_.name}),_.kind!=="category"&&(I.current=!0),_.kind==="category")return v(_.name==="agents"?"agents":"resources"),!1;if(_.kind==="agent"&&_.agentId){se(n,j,{id:_.agentId,name:_.name,metadata:{agentId:_.agentId,title:_.name},char:"@"}),v("categories");return}if(_.kind==="resource"&&_.uri&&l){try{const K=await Qe(l,_.uri);se(n,j,{id:_.uri,name:_.uri,metadata:K.contents,char:"@"})}catch(K){console.error("[at-mention] Failed to fetch resource:",K),V.error(s("chat.mentionAt.failedToLoadResource"))}v("categories");return}},e[32]=l,e[33]=n,e[34]=s,e[35]=C):C=e[35];const $=C;let P;e[36]!==c||e[37]!==M||e[38]!==l||e[39]!==f||e[40]!==x||e[41]!==i||e[42]!==g||e[43]!==r?(P=async X=>{const{query:_}=X,j=x();if(j==="categories"){if(!_.trim())return M;const q=_.toLowerCase(),U=c.filter(B=>B.status==="active"&&(!B.id||!Ce(B.id))&&!f.has(B.id)&&B.id!==r&&(B.title.toLowerCase().includes(q)||B.description?.toLowerCase().includes(q))).map(fr),ee=await(async()=>{if(!l)return[];let B=i.getQueryData(g);return B||(B=await i.fetchQuery({queryKey:g,queryFn:()=>oe(l),staleTime:6e4})),(B?.resources??[]).filter(ne=>ne.uri.toLowerCase().includes(q)||ne.name?.toLowerCase().includes(q)||ne.description?.toLowerCase().includes(q)).map(mr)})();return[...U,...ee]}if(j==="agents"){let q=c.filter(U=>U.status==="active"&&(!U.id||!Ce(U.id))&&!f.has(U.id)&&U.id!==r);if(_.trim()){const U=_.toLowerCase();q=q.filter(ee=>ee.title.toLowerCase().includes(U)||ee.description?.toLowerCase().includes(U))}return q.map(pr)}if(!l)return[];let K=i.getQueryData(g);K?i.fetchQuery({queryKey:g,queryFn:()=>oe(l),staleTime:6e4}).catch(gr):K=await i.fetchQuery({queryKey:g,queryFn:()=>oe(l),staleTime:6e4});let W=K?.resources??[];if(_.trim()){const q=_.toLowerCase();W=W.filter(U=>U.uri.toLowerCase().includes(q)||U.name?.toLowerCase().includes(q)||U.description?.toLowerCase().includes(q))}return W.map(hr)},e[36]=c,e[37]=M,e[38]=l,e[39]=f,e[40]=x,e[41]=i,e[42]=g,e[43]=r,e[44]=P):P=e[44];const L=P;let O;e[45]!==o?(O=X=>{if(o&&(o.current=X),X)w.current=Date.now(),I.current=!1,J("chat_picker_opened",{picker:"@"});else{const _=w.current;J("chat_picker_closed",{picker:"@",outcome:I.current?"selected":"dismissed",duration_ms:_?Date.now()-_:null}),w.current=null,v("categories")}},e[45]=o,e[46]=O):O=e[46];const H=O;let G;return e[47]!==n||e[48]!==L||e[49]!==$||e[50]!==H||e[51]!==S?(G=b.jsx(st,{editor:n,char:"@",pluginKey:"atDropdownMenu",queryKey:S,queryFn:L,onSelect:$,onOpenChange:H}),e[47]=n,e[48]=L,e[49]=$,e[50]=H,e[51]=S,e[52]=G):G=e[52],G};function fr(t){return{name:t.title,title:t.title,description:t.description??void 0,icon:t.icon??null,kind:"agent",agentId:t.id}}function mr(t){return{name:t.name??t.uri,title:t.name,description:t.description,kind:"resource",uri:t.uri}}function pr(t){return{name:t.title,title:t.title,description:t.description??void 0,icon:t.icon??null,kind:"agent",agentId:t.id}}function gr(){}function hr(t){return{name:t.name??t.uri,title:t.name,description:t.description,kind:"resource",uri:t.uri}}async function Oe(t,e,n,r,o,s,i){try{const a=await We(n,r,s);se(t,e,{id:r,name:Ve(r,o),metadata:a.messages,char:"/",kind:"prompt",args:s})}catch(a){console.error("[slash] Failed to fetch prompt:",a),V.error(i.t("chat.mentionSlash.failedLoadPrompt"))}}async function vr(t,e,n,r,o){try{const s=await Qe(n,r);se(t,e,{id:r,name:r,metadata:s.contents,char:"/",kind:"resource"})}catch(s){console.error("[slash] Failed to fetch resource:",s),V.error(o.t("chat.mentionSlash.failedLoadResource"))}}async function br(t,e,n,r,o){try{const{files:s,omittedPaths:i}=await tn(n,r.volume,r.path),a={sandboxPath:r.sandboxPath,files:s,omittedPaths:i};se(t,e,{id:r.id,name:r.name,metadata:a,char:"/",kind:"skill"})}catch(s){console.error("[slash] Failed to fetch skill:",s),V.error(o.t("chat.mentionSlash.failedLoadSkill"))}}const xr=({editor:t,virtualMcpId:e,suggestionOpenRef:n})=>{const r=le(),o=qe(),{org:s}=Be(),i=He({connectionId:e,orgId:s.id,orgSlug:s.slug}),a=ce.virtualMcpPrompts(e,s.id),c=ce.virtualMcpResources(e,s.id),u=ce.slashSkills(s.id),f=["slash-mention",s.id,e??"default"],[p,l]=h.useState(null),[d,g]=h.useState(null),m=_t(t);m&&(m.onEditChip=async S=>{if(i)try{const k=(await $e(o,a,i)).find(F=>F.name===S.promptId);if(!k?.arguments||k.arguments.length===0)return;g({...S,prompt:k})}catch(R){console.error("[slash] Failed to load prompt for editing:",R),V.error(r("chat.mentionSlash.failedLoadPrompt"))}});const v=h.useRef(null),y=h.useRef(!1),x=async({item:S,range:R})=>{if(J("chat_picker_item_selected",{picker:"/",item_kind:S.kind,item_name:S.name}),y.current=!0,!!i)if(S.kind==="prompt"){if(S.arguments&&S.arguments.length>0){l({range:R,item:S});return}const k=ue(S._meta);await Oe(t,R,i,S.name,k,void 0,{t:r})}else S.kind==="skill"?S.skill&&await br(t,R,s.slug,S.skill,{t:r}):S.uri&&await vr(t,R,i,S.uri,{t:r})},w=async S=>{if(!p||!i)return;const{range:R,item:k}=p,F=ue(k._meta);await Oe(t,R,i,k.name,F,S,{t:r}),l(null)},I=async S=>{if(!(!d||!i)){if(!At(t,d.pos,d.promptId)){V.error(r("chat.mentionSlash.failedUpdatePrompt")),g(null);return}try{const R=await We(i,d.promptId,S),k=ue(d.prompt._meta);t.chain().focus().setNodeSelection(d.pos).deleteSelection().insertContentAt(d.pos,Mt({id:d.promptId,name:Ve(d.promptId,k),metadata:R.messages,char:"/",kind:"prompt",args:S})).run(),J("chat_picker_item_selected",{picker:"/edit",item_kind:"prompt",item_name:d.promptId})}catch(R){console.error("[slash] Failed to update prompt:",R),V.error(r("chat.mentionSlash.failedUpdatePrompt"))}g(null)}},N=async S=>{const{query:R}=S;if(!i)return[];const[k,F,D]=await Promise.all([$e(o,a,i),wr(o,c,i),yr(o,u,s.slug)]),A=R.trim().toLowerCase(),Q=(k??[]).filter(C=>!A||C.name.toLowerCase().includes(A)||C.title?.toLowerCase().includes(A)||C.description?.toLowerCase().includes(A)).map(C=>({name:C.name,title:C.title,description:C.description,kind:"prompt",arguments:C.arguments,_meta:C._meta})),E=(F??[]).filter(C=>!A||C.uri.toLowerCase().includes(A)||C.name?.toLowerCase().includes(A)||C.description?.toLowerCase().includes(A)).map(C=>({name:C.name??C.uri,title:C.name,description:C.description,kind:"resource",uri:C.uri})),M=(D??[]).filter(C=>!A||C.name.toLowerCase().includes(A)||C.id.toLowerCase().includes(A)||C.description?.toLowerCase().includes(A)).map(C=>({name:C.name,title:C.name,description:C.description??void 0,kind:"skill",skill:C}));return[...Q,...E,...M]},T=p?.item.kind==="prompt"?{name:p.item.name,title:p.item.title,arguments:p.item.arguments,description:p.item.description,_meta:p.item._meta}:null;return b.jsxs(b.Fragment,{children:[b.jsx(st,{editor:t,char:"/",pluginKey:"slashDropdownMenu",queryKey:f,queryFn:N,onSelect:x,onOpenChange:S=>{if(n&&(n.current=S),S)v.current=Date.now(),y.current=!1,J("chat_picker_opened",{picker:"/"});else{const R=v.current;J("chat_picker_closed",{picker:"/",outcome:y.current?"selected":"dismissed",duration_ms:R?Date.now()-R:null}),v.current=null}}}),b.jsx(Ee,{prompt:T,setPrompt:()=>l(null),onSubmit:w}),b.jsx(Ee,{prompt:d?.prompt??null,setPrompt:()=>g(null),onSubmit:I,defaultValues:d?.args},d?`edit-${d.promptId}-${d.pos}`:"edit-idle")]})};async function $e(t,e,n){let r=t.getQueryData(e);return r?t.fetchQuery({queryKey:e,queryFn:()=>Ie(n),staleTime:6e4}).catch(()=>{}):r=await t.fetchQuery({queryKey:e,queryFn:()=>Ie(n),staleTime:6e4}).catch(()=>{}),r?.prompts??[]}async function yr(t,e,n){const r=t.getQueryData(e),o=()=>t.fetchQuery({queryKey:e,queryFn:()=>nn(n),staleTime:6e4});return r?(o().catch(()=>{}),r):o().catch(()=>[])}async function wr(t,e,n){let r=t.getQueryData(e);return r?t.fetchQuery({queryKey:e,queryFn:()=>oe(n),staleTime:6e4}).catch(()=>{}):r=await t.fetchQuery({queryKey:e,queryFn:()=>oe(n),staleTime:6e4}).catch(()=>{}),r?.resources??[]}const it="Ask anything, / for prompts & skills, @ for agents & resources...";function Sr(t){return[Kt.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,dropcursor:!1}),Pt.configure({placeholder:()=>t.current??it,showOnlyWhenEditable:!1}),Ot,$t]}function Or({tiptapDoc:t,setTiptapDoc:e,disabled:n=!1,enterToSubmit:r=!1,placeholder:o,onSubmit:s,suggestionOpenRef:i,children:a}){const c=h.useRef(s),u=h.useRef(e),f=h.useRef(r),p=h.useRef(o),l=Dt({extensions:Sr(p),content:t||"",editorProps:{attributes:{"data-chat-input":"true",role:"textbox","aria-multiline":"true","aria-label":o??it,class:"prose prose-sm max-w-none focus:outline-none w-full h-full text-[15px] p-[18px]"},handleKeyDown:(d,g)=>g.key==="Enter"&&!g.shiftKey&&f.current&&!i?.current?(g.preventDefault(),c.current?.(),!0):!1},onUpdate:({editor:d})=>{u.current(d?.getJSON())}});return h.useEffect(()=>{l?.setEditable(!n)},[l,n]),h.useEffect(()=>{c.current=s},[s]),h.useEffect(()=>{u.current=e},[e]),h.useEffect(()=>{f.current=r},[r]),h.useEffect(()=>{p.current=o},[o]),h.useEffect(()=>{if(!l||l.isDestroyed)return;const d=JSON.stringify(l.getJSON()),g=JSON.stringify(t||{type:"doc",content:[]});d!==g&&l.commands.setContent(t||{type:"doc",content:[]})},[l,t]),b.jsx(jt.Provider,{value:{editor:l},children:a})}function $r(t){const e=Y.c(29),{disabled:n,virtualMcpId:r,showFileUploader:o,selectedModel:s,onUnsupportedFile:i,suggestionOpenRef:a,ref:c,className:u}=t,f=n===void 0?!1:n,p=o===void 0?!1:o,{editor:l}=Lt();let d,g;if(e[0]!==l?(d=()=>({focus:()=>{l?.commands.focus()},clear:()=>{l?.commands.clearContent(!0)},appendText:k=>{if(!l)return;const F=l.state.doc.textContent.trim()==="";l.commands.focus("end"),F||l.commands.insertContent(" "),l.commands.insertContent(k)},syncVoiceText:(k,F)=>{if(l&&(l.commands.setContent(k||{type:"doc",content:[]}),F)){l.commands.focus("end");const D=l.state.doc.textContent.trim().length>0;l.commands.insertContent({type:"text",text:D?" "+F:F})}},restoreContent:k=>{l&&l.commands.setContent(k||{type:"doc",content:[]})}}),g=[l],e[0]=l,e[1]=d,e[2]=g):(d=e[1],g=e[2]),h.useImperativeHandle(c??null,d,g),!l)return null;const m=f&&"cursor-not-allowed opacity-70",v=f&&"[&_.ProseMirror]:cursor-not-allowed";let y;e[3]!==u||e[4]!==m||e[5]!==v?(y=Ue("overflow-y-auto relative flex-1 max-h-[164px] min-h-[20px] w-full flex flex-col",u,"[&_.ProseMirror]:outline-none [&_.ProseMirror]:min-h-[20px] [&_.ProseMirror]:flex-1","[&_.ProseMirror_p.is-editor-empty:first-child::before]:content-[attr(data-placeholder)]","[&_.ProseMirror_p.is-editor-empty:first-child::before]:text-muted-foreground","[&_.ProseMirror_p.is-editor-empty:first-child::before]:opacity-50","[&_.ProseMirror_p.is-editor-empty:first-child::before]:float-left","[&_.ProseMirror_p.is-editor-empty:first-child::before]:pointer-events-none","[&_.ProseMirror_p.is-editor-empty:first-child::before]:h-0","[&_.ProseMirror_p.is-editor-empty:first-child::before]:w-full","[&_.ProseMirror_p.is-editor-empty:first-child::before]:break-words",m,v),e[3]=u,e[4]=m,e[5]=v,e[6]=y):y=e[6];let x;e[7]!==l||e[8]!==y?(x=b.jsx(Ut,{editor:l,className:y}),e[7]=l,e[8]=y,e[9]=x):x=e[9];const w=r??null;let I;e[10]!==l||e[11]!==a||e[12]!==w?(I=b.jsx(h.Suspense,{fallback:null,children:b.jsx(xr,{editor:l,virtualMcpId:w,suggestionOpenRef:a})}),e[10]=l,e[11]=a,e[12]=w,e[13]=I):I=e[13];const N=r??null;let T;e[14]!==l||e[15]!==a||e[16]!==N?(T=b.jsx(h.Suspense,{fallback:null,children:b.jsx(dr,{editor:l,virtualMcpId:N,suggestionOpenRef:a})}),e[14]=l,e[15]=a,e[16]=N,e[17]=T):T=e[17];let S;e[18]!==f||e[19]!==l||e[20]!==i||e[21]!==s||e[22]!==p?(S=p&&s&&!f?b.jsx(on,{editor:l,selectedModel:s,onUnsupportedFile:i}):null,e[18]=f,e[19]=l,e[20]=i,e[21]=s,e[22]=p,e[23]=S):S=e[23];let R;return e[24]!==I||e[25]!==T||e[26]!==S||e[27]!==x?(R=b.jsxs(b.Fragment,{children:[x,I,T,S]}),e[24]=I,e[25]=T,e[26]=S,e[27]=x,e[28]=R):R=e[28],R}export{Or as T,jr as U,$r as a,rn as p,Lr as u};
|
|
1
|
+
import{c as Y,r as h,b as le,j as b,t as V,F as ct,B as ut,e0 as dt,e1 as Ke,e2 as ft,e3 as z,e4 as pe,aw as mt,e5 as pt,e6 as ge,e7 as gt,e8 as ht,e9 as vt,ea as bt,eb as xt,ec as yt,ed as wt,ee as St,l as Ue,h as Rt,n as qe,M as Be,K as ce,o as J,ef as Qe,cE as Ee,eg as oe}from"./index-BMJCLbj5.js";import{u as Et,S as Ct,a as It,b as kt,s as Pt}from"./hooks-BqIq5c7A.js";import{f as Tt,h as Ft,j as Nt,i as se,k as _t,P as Ce,l as At,c as Mt,u as Dt,n as jt,d as Lt,e as Ot,F as $t,s as Kt,b as Ut}from"./index-xNOJUK_V.js";import{d as qt,h as Bt,c as Qt,b as Ht,D as Vt}from"./dialog-CeIxtPXR.js";import{aE as Wt,A as zt}from"./agent-icon-BayCJ1XK.js";import"./chat-context-CQfynmbs.js";import{m as Yt,i as Xt,a as Gt}from"./decopilot-055IFff8.js";import{u as He}from"./use-mcp-client-D_FU7Mvk.js";import{b as Jt}from"./use-virtual-mcp-B-R_fMeI.js";import{g as ue,d as Zt,s as Ve}from"./gateway-client-BjVHcW6F.js";import{g as en}from"./use-project-scope-DRMW-kAl.js";import{l as Ie,g as We}from"./use-mcp-prompts-CYS_vs6v.js";import{f as tn,a as nn}from"./use-org-fs-BNYqWw9K.js";async function rn(t,e,n,r,o,s){if(!Yt(e)){V.error("Selected model does not support file uploads");return}const i=n.type||"application/octet-stream";if(!Xt(i,e)){const c=Gt(e).parts.map(f=>s(f)).join(", "),u=e?.title??"This model";o?o({fileName:n.name,modelName:u,accepted:c}):V.error(`"${n.name}" can't be attached`,{description:`${u} accepts ${c}.`});return}const a=10*1024*1024;if(n.size>a){V.error(`File "${n.name}" exceeds 10MB limit`);return}try{const c=new FileReader,u=new Promise((l,d)=>{c.onload=()=>{const g=c.result;if(typeof g!="string"){d(new Error("Failed to read file as data URL"));return}const m=g.includes(",")?g.split(",")[1]??g:g;l(m)},c.onerror=d});c.readAsDataURL(n);const f=await u,p={id:crypto.randomUUID(),name:n.name,mimeType:n.type||"application/octet-stream",size:n.size,data:f};Tt(t,{from:r,to:r},p)}catch(c){console.error("Failed to process file:",c),V.error(`Failed to load file "${n.name}"`)}}function on(t){const e=Y.c(9),{editor:n,selectedModel:r,onUnsupportedFile:o}=t,s=le(),i=h.useRef(an);let a,c;e[0]!==n||e[1]!==o||e[2]!==r||e[3]!==s?(a=()=>{i.current=async(p,l)=>{await rn(n,r,p,l,o,s)}},c=[n,r,o,s],e[0]=n,e[1]=o,e[2]=r,e[3]=s,e[4]=a,e[5]=c):(a=e[4],c=e[5]),h.useEffect(a,c);let u,f;return e[6]!==n?(u=()=>{if(n?.isDestroyed)return;const p=new Ft("fileDropHandler");n.state.plugins.find(g=>g.spec.key===p)&&n.unregisterPlugin(p);const d=new Nt({key:p,props:{handleDrop:(g,m,v,y)=>{if(y)return!1;const x=m.dataTransfer?.files;if(!x||x.length===0)return!1;m.preventDefault();const w=g.posAtCoords({left:m.clientX,top:m.clientY});if(!w)return!1;const I=Array.from(x);return(async()=>{let N=w.pos;for(const T of I)await i.current?.(T,N),N=g.state.selection.to})(),!0},handlePaste:(g,m)=>{const v=m.clipboardData?.items;if(!v)return!1;const y=Array.from(v).filter(sn);return y.length===0?!1:(m.preventDefault(),(async()=>{let x=g.state.selection.from;for(const w of y){const I=w.getAsFile();I&&(await i.current?.(I,x),x=g.state.selection.to)}})(),!0)}}});return n.registerPlugin(d),()=>{n?.isDestroyed||n.unregisterPlugin(p)}},f=[n],e[6]=n,e[7]=u,e[8]=f):(u=e[7],f=e[8]),h.useEffect(u,f),null}function sn(t){return t.kind==="file"}function an(){return Promise.resolve()}function jr(t){const e=Y.c(43),{info:n,onClose:r}=t,o=le(),s=n!==null;let i;e[0]!==r?(i=A=>!A&&r(),e[0]=r,e[1]=i):i=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=["radial-gradient(ellipse 40% 200% at -5% 100%, rgba(251,191,36,0.35) 0%, transparent 100%)","radial-gradient(ellipse 40% 200% at 105% -10%, rgba(244,114,182,0.25) 0%, transparent 100%)"],e[2]=a):a=e[2];let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=b.jsx("div",{className:"absolute inset-x-0 top-0 h-36 pointer-events-none",style:{backgroundImage:a.join(", "),maskImage:"linear-gradient(to bottom, black 0%, transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black 0%, transparent 100%)"}}),e[3]=c):c=e[3];let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=b.jsx("div",{className:"flex items-center justify-center size-9 rounded-lg bg-warning/15 text-warning",children:b.jsx(ct,{size:18})}),e[4]=u):u=e[4];let f;e[5]!==o?(f=o("chat.uploader.fileTypeNotSupported"),e[5]=o,e[6]=f):f=e[6];let p;e[7]!==f?(p=b.jsx(qt,{className:"text-xl font-semibold tracking-tight",children:f}),e[7]=f,e[8]=p):p=e[8];const l=n?.fileName;let d;e[9]!==l?(d=b.jsxs("span",{className:"font-medium text-foreground",children:["“",l,"”"]}),e[9]=l,e[10]=d):d=e[10];let g;e[11]!==o?(g=o("chat.uploader.cantAttachToChat"),e[11]=o,e[12]=g):g=e[12];let m;e[13]!==g||e[14]!==d?(m=b.jsxs(Bt,{className:"mt-1.5 text-sm leading-relaxed",children:[d," ",g]}),e[13]=g,e[14]=d,e[15]=m):m=e[15];let v;e[16]!==m||e[17]!==p?(v=b.jsxs("div",{className:"relative px-8 pt-8 pb-2 overflow-hidden",children:[c,b.jsxs(Qt,{className:"relative gap-4",children:[u,b.jsxs("div",{children:[p,m]})]})]}),e[16]=m,e[17]=p,e[18]=v):v=e[18];const y=n?.modelName??"";let x;e[19]!==o||e[20]!==y?(x=o("chat.uploader.accepts",{modelName:y}),e[19]=o,e[20]=y,e[21]=x):x=e[21];let w;e[22]!==x?(w=b.jsx("div",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground mb-2",children:x}),e[22]=x,e[23]=w):w=e[23];let I;e[24]===Symbol.for("react.memo_cache_sentinel")?(I=b.jsx(Wt,{size:14,className:"text-muted-foreground"}),e[24]=I):I=e[24];const N=n?.accepted;let T;e[25]!==N?(T=b.jsxs("div",{className:"flex items-center gap-2 text-sm text-foreground",children:[I,b.jsx("span",{className:"capitalize",children:N})]}),e[25]=N,e[26]=T):T=e[26];let S;e[27]!==w||e[28]!==T?(S=b.jsx("div",{className:"px-8 pt-3 pb-6 space-y-3",children:b.jsxs("div",{className:"rounded-xl border border-border p-4",children:[w,T]})}),e[27]=w,e[28]=T,e[29]=S):S=e[29];let R;e[30]!==o?(R=o("chat.uploader.gotIt"),e[30]=o,e[31]=R):R=e[31];let k;e[32]!==r||e[33]!==R?(k=b.jsx("div",{className:"px-8 py-4 border-t border-border bg-muted/30 flex items-center justify-end",children:b.jsx(ut,{onClick:r,children:R})}),e[32]=r,e[33]=R,e[34]=k):k=e[34];let F;e[35]!==v||e[36]!==S||e[37]!==k?(F=b.jsxs(Ht,{className:"sm:max-w-[480px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:ln,children:[v,S,k]}),e[35]=v,e[36]=S,e[37]=k,e[38]=F):F=e[38];let D;return e[39]!==s||e[40]!==i||e[41]!==F?(D=b.jsx(Vt,{open:s,onOpenChange:i,children:F}),e[39]=s,e[40]=i,e[41]=F,e[42]=D):D=e[42],D}function ln(t){return t.preventDefault()}function Lr(){const t=Y.c(3),[e,n]=h.useState(null);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>n(null),t[0]=r):r=t[0];let o;return t[1]!==e?(o={unsupportedFile:e,onUnsupportedFile:n,clearUnsupportedFile:r},t[1]=e,t[2]=o):o=t[2],o}var cn=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],xe=cn.join(","),ze=typeof Element>"u",ie=ze?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,fe=!ze&&Element.prototype.getRootNode?function(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}:function(t){return t?.ownerDocument},me=function(e,n){var r;n===void 0&&(n=!0);var o=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),s=o===""||o==="true",i=s||n&&e&&(typeof e.closest=="function"?e.closest("[inert]"):me(e.parentNode));return i},un=function(e){var n,r=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"contenteditable");return r===""||r==="true"},dn=function(e,n,r){if(me(e))return[];var o=Array.prototype.slice.apply(e.querySelectorAll(xe));return n&&ie.call(e,xe)&&o.unshift(e),o=o.filter(r),o},ye=function(e,n,r){for(var o=[],s=Array.from(e);s.length;){var i=s.shift();if(!me(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),c=a.length?a:i.children,u=ye(c,!0,r);r.flatten?o.push.apply(o,u):o.push({scopeParent:i,candidates:u})}else{var f=ie.call(i,xe);f&&r.filter(i)&&(n||!e.includes(i))&&o.push(i);var p=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),l=!me(p,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(p&&l){var d=ye(p===!0?i.children:p.children,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:i,candidates:d})}else s.unshift.apply(s,i.children)}}return o},Ye=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Xe=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||un(e))&&!Ye(e)?0:e.tabIndex},fn=function(e,n){var r=Xe(e);return r<0&&n&&!Ye(e)?0:r},mn=function(e,n){return e.tabIndex===n.tabIndex?e.documentOrder-n.documentOrder:e.tabIndex-n.tabIndex},Ge=function(e){return e.tagName==="INPUT"},pn=function(e){return Ge(e)&&e.type==="hidden"},gn=function(e){var n=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return n},hn=function(e,n){for(var r=0;r<e.length;r++)if(e[r].checked&&e[r].form===n)return e[r]},vn=function(e){if(!e.name)return!0;var n=e.form||fe(e),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(e.name));else try{o=r(e.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=hn(o,e.form);return!s||s===e},bn=function(e){return Ge(e)&&e.type==="radio"},xn=function(e){return bn(e)&&!vn(e)},yn=function(e){var n,r=e&&fe(e),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==e){var i,a,c;for(s=!!((i=o)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(o)||e!=null&&(c=e.ownerDocument)!==null&&c!==void 0&&c.contains(e));!s&&o;){var u,f,p;r=fe(o),o=(u=r)===null||u===void 0?void 0:u.host,s=!!((f=o)!==null&&f!==void 0&&(p=f.ownerDocument)!==null&&p!==void 0&&p.contains(o))}}return s},ke=function(e){var n=e.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},wn=function(e,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in e){var s=e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(e).visibility==="hidden")return!0;var i=ie.call(e,"details>summary:first-of-type"),a=i?e.parentElement:e;if(ie.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var c=e;e;){var u=e.parentElement,f=fe(e);if(u&&!u.shadowRoot&&o(u)===!0)return ke(e);e.assignedSlot?e=e.assignedSlot:!u&&f!==e.ownerDocument?e=f.host:e=u}e=c}if(yn(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return ke(e);return!1},Sn=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var n=e.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return ie.call(n,"fieldset[disabled] *")?!0:!o.contains(e)}return!0}n=n.parentElement}return!1},Rn=function(e,n){return!(n.disabled||pn(n)||wn(n,e)||gn(n)||Sn(n))},Pe=function(e,n){return!(xn(n)||Xe(n)<0||!Rn(e,n))},En=function(e){var n=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Je=function(e){var n=[],r=[];return e.forEach(function(o,s){var i=!!o.scopeParent,a=i?o.scopeParent:o,c=fn(a,i),u=i?Je(o.candidates):a;c===0?i?n.push.apply(n,u):n.push(a):r.push({documentOrder:s,tabIndex:c,item:o,isScope:i,content:u})}),r.sort(mn).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},Ze=function(e,n){n=n||{};var r;return n.getShadowRoot?r=ye([e],n.includeContainer,{filter:Pe.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:En}):r=dn(e,n.includeContainer,Pe.bind(null,n)),Je(r)};function Cn(){return/apple/i.test(navigator.vendor)}const Te="data-floating-ui-focusable";function In(t){let e=t.activeElement;for(;((n=e)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;e=e.shadowRoot.activeElement}return e}function we(t,e){if(!t||!e)return!1;const n=e.getRootNode==null?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&dt(n)){let r=e;for(;r;){if(t===r)return!0;r=r.parentNode||r.host}}return!1}function re(t){return"composedPath"in t?t.composedPath()[0]:t.target}function he(t,e){if(e==null)return!1;if("composedPath"in t)return t.composedPath().includes(e);const n=t;return n.target!=null&&e.contains(n.target)}function kn(t){return t.matches("html,body")}function ae(t){return t?.ownerDocument||document}function Pn(t){return t?t.hasAttribute(Te)?t:t.querySelector("["+Te+"]")||t:null}function de(t,e,n){return n===void 0&&(n=!0),t.filter(o=>{var s;return o.parentId===e&&(!n||((s=o.context)==null?void 0:s.open))}).flatMap(o=>[o,...de(t,o.id,n)])}function Tn(t){return"nativeEvent"in t}var Fn=typeof document<"u",Nn=function(){},Z=Fn?h.useLayoutEffect:Nn;const _n={...Ke},An=_n.useInsertionEffect,Mn=An||(t=>t());function te(t){const e=h.useRef(()=>{});return Mn(()=>{e.current=t}),h.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return e.current==null?void 0:e.current(...r)},[])}const et=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function tt(t,e){const n=Ze(t,et()),r=n.length;if(r===0)return;const o=In(ae(t)),s=n.indexOf(o),i=s===-1?e===1?0:r-1:s+e;return n[i]}function Dn(t){return tt(ae(t).body,1)||t}function jn(t){return tt(ae(t).body,-1)||t}function ve(t,e){const n=e||t.currentTarget,r=t.relatedTarget;return!r||!we(n,r)}function Ln(t){Ze(t,et()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Fe(t){t.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const On="data-floating-ui-focusable",Ne="active",_e="selected",$n={...Ke};let Ae=!1,Kn=0;const Me=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Kn++;function Un(){const[t,e]=h.useState(()=>Ae?Me():void 0);return Z(()=>{t==null&&e(Me())},[]),h.useEffect(()=>{Ae=!0},[]),t}const qn=$n.useId,Se=qn||Un;function Bn(){const t=new Map;return{emit(e,n){var r;(r=t.get(e))==null||r.forEach(o=>o(n))},on(e,n){t.has(e)||t.set(e,new Set),t.get(e).add(n)},off(e,n){var r;(r=t.get(e))==null||r.delete(n)}}}const Qn=h.createContext(null),Hn=h.createContext(null),nt=()=>{var t;return((t=h.useContext(Qn))==null?void 0:t.id)||null},rt=()=>h.useContext(Hn);function Re(t){return"data-floating-ui-"+t}const Vn={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},De=h.forwardRef(function(e,n){const[r,o]=h.useState();Z(()=>{Cn()&&o("button")},[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Re("focus-guard")]:"",style:Vn};return b.jsx("span",{...e,...s})}),Wn={clipPath:"inset(50%)",position:"fixed",top:0,left:0},ot=h.createContext(null),je=Re("portal");function zn(t){t===void 0&&(t={});const{id:e,root:n}=t,r=Se(),o=Xn(),[s,i]=h.useState(null),a=h.useRef(null);return Z(()=>()=>{s?.remove(),queueMicrotask(()=>{a.current=null})},[s]),Z(()=>{if(!r||a.current)return;const c=e?document.getElementById(e):null;if(!c)return;const u=document.createElement("div");u.id=r,u.setAttribute(je,""),c.appendChild(u),a.current=u,i(u)},[e,r]),Z(()=>{if(n===null||!r||a.current)return;let c=n||o?.portalNode;c&&!bt(c)&&(c=c.current),c=c||document.body;let u=null;e&&(u=document.createElement("div"),u.id=e,c.appendChild(u));const f=document.createElement("div");f.id=r,f.setAttribute(je,""),c=u||c,c.appendChild(f),a.current=f,i(f)},[e,n,r,o]),s}function Yn(t){const{children:e,id:n,root:r,preserveTabOrder:o=!0}=t,s=zn({id:n,root:r}),[i,a]=h.useState(null),c=h.useRef(null),u=h.useRef(null),f=h.useRef(null),p=h.useRef(null),l=i?.modal,d=i?.open,g=!!i&&!i.modal&&i.open&&o&&!!(r||s);return h.useEffect(()=>{if(!s||!o||l)return;function m(v){s&&ve(v)&&(v.type==="focusin"?Fe:Ln)(s)}return s.addEventListener("focusin",m,!0),s.addEventListener("focusout",m,!0),()=>{s.removeEventListener("focusin",m,!0),s.removeEventListener("focusout",m,!0)}},[s,o,l]),h.useEffect(()=>{s&&(d||Fe(s))},[d,s]),b.jsxs(ot.Provider,{value:h.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:c,afterOutsideRef:u,beforeInsideRef:f,afterInsideRef:p,portalNode:s,setFocusManagerState:a}),[o,s]),children:[g&&s&&b.jsx(De,{"data-type":"outside",ref:c,onFocus:m=>{if(ve(m,s)){var v;(v=f.current)==null||v.focus()}else{const y=i?i.domReference:null,x=jn(y);x?.focus()}}}),g&&s&&b.jsx("span",{"aria-owns":s.id,style:Wn}),s&&mt.createPortal(e,s),g&&s&&b.jsx(De,{"data-type":"outside",ref:u,onFocus:m=>{if(ve(m,s)){var v;(v=p.current)==null||v.focus()}else{const y=i?i.domReference:null,x=Dn(y);x?.focus(),i?.closeOnFocusOut&&i?.onOpenChange(!1,m.nativeEvent,"focus-out")}}})]})}const Xn=()=>h.useContext(ot),Gn={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Jn={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Le=t=>{var e,n;return{escapeKey:typeof t=="boolean"?t:(e=t?.escapeKey)!=null?e:!1,outsidePress:typeof t=="boolean"?t:(n=t?.outsidePress)!=null?n:!0}};function Zn(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,elements:o,dataRef:s}=t,{enabled:i=!0,escapeKey:a=!0,outsidePress:c=!0,outsidePressEvent:u="pointerdown",referencePress:f=!1,referencePressEvent:p="pointerdown",ancestorScroll:l=!1,bubbles:d,capture:g}=e,m=rt(),v=te(typeof c=="function"?c:()=>!1),y=typeof c=="function"?v:c,x=h.useRef(!1),{escapeKey:w,outsidePress:I}=Le(d),{escapeKey:N,outsidePress:T}=Le(g),S=h.useRef(!1),R=te(C=>{var M;if(!n||!i||!a||C.key!=="Escape"||S.current)return;const E=(M=s.current.floatingContext)==null?void 0:M.nodeId,$=m?de(m.nodesRef.current,E):[];if(!w&&(C.stopPropagation(),$.length>0)){let P=!0;if($.forEach(L=>{var O;if((O=L.context)!=null&&O.open&&!L.context.dataRef.current.__escapeKeyBubbles){P=!1;return}}),!P)return}r(!1,Tn(C)?C.nativeEvent:C,"escape-key")}),k=te(C=>{var M;const E=()=>{var $;R(C),($=re(C))==null||$.removeEventListener("keydown",E)};(M=re(C))==null||M.addEventListener("keydown",E)}),F=te(C=>{var M;const E=s.current.insideReactTree;s.current.insideReactTree=!1;const $=x.current;if(x.current=!1,u==="click"&&$||E||typeof y=="function"&&!y(C))return;const P=re(C),L="["+Re("inert")+"]",O=ae(o.floating).querySelectorAll(L);let H=z(P)?P:null;for(;H&&!ge(H);){const j=gt(H);if(ge(j)||!z(j))break;H=j}if(O.length&&z(P)&&!kn(P)&&!we(P,o.floating)&&Array.from(O).every(j=>!we(H,j)))return;if(ht(P)&&Q){const j=ge(P),K=vt(P),W=/auto|scroll/,q=j||W.test(K.overflowX),U=j||W.test(K.overflowY),ee=q&&P.clientWidth>0&&P.scrollWidth>P.clientWidth,B=U&&P.clientHeight>0&&P.scrollHeight>P.clientHeight,ne=K.direction==="rtl",at=B&&(ne?C.offsetX<=P.offsetWidth-P.clientWidth:C.offsetX>P.clientWidth),lt=ee&&C.offsetY>P.clientHeight;if(at||lt)return}const G=(M=s.current.floatingContext)==null?void 0:M.nodeId,X=m&&de(m.nodesRef.current,G).some(j=>{var K;return he(C,(K=j.context)==null?void 0:K.elements.floating)});if(he(C,o.floating)||he(C,o.domReference)||X)return;const _=m?de(m.nodesRef.current,G):[];if(_.length>0){let j=!0;if(_.forEach(K=>{var W;if((W=K.context)!=null&&W.open&&!K.context.dataRef.current.__outsidePressBubbles){j=!1;return}}),!j)return}r(!1,C,"outside-press")}),D=te(C=>{var M;const E=()=>{var $;F(C),($=re(C))==null||$.removeEventListener(u,E)};(M=re(C))==null||M.addEventListener(u,E)});h.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=w,s.current.__outsidePressBubbles=I;let C=-1;function M(O){r(!1,O,"ancestor-scroll")}function E(){window.clearTimeout(C),S.current=!0}function $(){C=window.setTimeout(()=>{S.current=!1},pt()?5:0)}const P=ae(o.floating);a&&(P.addEventListener("keydown",N?k:R,N),P.addEventListener("compositionstart",E),P.addEventListener("compositionend",$)),y&&P.addEventListener(u,T?D:F,T);let L=[];return l&&(z(o.domReference)&&(L=pe(o.domReference)),z(o.floating)&&(L=L.concat(pe(o.floating))),!z(o.reference)&&o.reference&&o.reference.contextElement&&(L=L.concat(pe(o.reference.contextElement)))),L=L.filter(O=>{var H;return O!==((H=P.defaultView)==null?void 0:H.visualViewport)}),L.forEach(O=>{O.addEventListener("scroll",M,{passive:!0})}),()=>{a&&(P.removeEventListener("keydown",N?k:R,N),P.removeEventListener("compositionstart",E),P.removeEventListener("compositionend",$)),y&&P.removeEventListener(u,T?D:F,T),L.forEach(O=>{O.removeEventListener("scroll",M)}),window.clearTimeout(C)}},[s,o,a,y,u,n,r,l,i,w,I,R,N,k,F,T,D]),h.useEffect(()=>{s.current.insideReactTree=!1},[s,y,u]);const A=h.useMemo(()=>({onKeyDown:R,...f&&{[Gn[p]]:C=>{r(!1,C.nativeEvent,"reference-press")},...p!=="click"&&{onClick(C){r(!1,C.nativeEvent,"reference-press")}}}}),[R,r,f,p]),Q=h.useMemo(()=>{function C(M){M.button===0&&(x.current=!0)}return{onKeyDown:R,onMouseDown:C,onMouseUp:C,[Jn[u]]:()=>{s.current.insideReactTree=!0}}},[R,u,s]);return h.useMemo(()=>i?{reference:A,floating:Q}:{},[i,A,Q])}function er(t){const{open:e=!1,onOpenChange:n,elements:r}=t,o=Se(),s=h.useRef({}),[i]=h.useState(()=>Bn()),a=nt()!=null,[c,u]=h.useState(r.reference),f=te((d,g,m)=>{s.current.openEvent=d?g:void 0,i.emit("openchange",{open:d,event:g,reason:m,nested:a}),n?.(d,g,m)}),p=h.useMemo(()=>({setPositionReference:u}),[]),l=h.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return h.useMemo(()=>({dataRef:s,open:e,onOpenChange:f,elements:l,events:i,floatingId:o,refs:p}),[e,f,l,i,o,p])}function tr(t){t===void 0&&(t={});const{nodeId:e}=t,n=er({...t,elements:{reference:null,floating:null,...t.elements}}),r=t.rootContext||n,o=r.elements,[s,i]=h.useState(null),[a,c]=h.useState(null),f=o?.domReference||s,p=h.useRef(null),l=rt();Z(()=>{f&&(p.current=f)},[f]);const d=ft({...t,elements:{...o,...a&&{reference:a}}}),g=h.useCallback(w=>{const I=z(w)?{getBoundingClientRect:()=>w.getBoundingClientRect(),getClientRects:()=>w.getClientRects(),contextElement:w}:w;c(I),d.refs.setReference(I)},[d.refs]),m=h.useCallback(w=>{(z(w)||w===null)&&(p.current=w,i(w)),(z(d.refs.reference.current)||d.refs.reference.current===null||w!==null&&!z(w))&&d.refs.setReference(w)},[d.refs]),v=h.useMemo(()=>({...d.refs,setReference:m,setPositionReference:g,domReference:p}),[d.refs,m,g]),y=h.useMemo(()=>({...d.elements,domReference:f}),[d.elements,f]),x=h.useMemo(()=>({...d,...r,refs:v,elements:y,nodeId:e}),[d,v,y,e,r]);return Z(()=>{r.dataRef.current.floatingContext=x;const w=l?.nodesRef.current.find(I=>I.id===e);w&&(w.context=x)}),h.useMemo(()=>({...d,context:x,refs:v,elements:y}),[d,v,y,x])}function be(t,e,n){const r=new Map,o=n==="item";let s=t;if(o&&t){const{[Ne]:i,[_e]:a,...c}=t;s=c}return{...n==="floating"&&{tabIndex:-1,[On]:""},...s,...e.map(i=>{const a=i?i[n]:null;return typeof a=="function"?t?a(t):null:a}).concat(t).reduce((i,a)=>(a&&Object.entries(a).forEach(c=>{let[u,f]=c;if(!(o&&[Ne,_e].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof f=="function"){var p;(p=r.get(u))==null||p.push(f),i[u]=function(){for(var l,d=arguments.length,g=new Array(d),m=0;m<d;m++)g[m]=arguments[m];return(l=r.get(u))==null?void 0:l.map(v=>v(...g)).find(v=>v!==void 0)}}}else i[u]=f}),i),{})}}function nr(t){t===void 0&&(t=[]);const e=t.map(a=>a?.reference),n=t.map(a=>a?.floating),r=t.map(a=>a?.item),o=h.useCallback(a=>be(a,t,"reference"),e),s=h.useCallback(a=>be(a,t,"floating"),n),i=h.useCallback(a=>be(a,t,"item"),r);return h.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}const rr=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function or(t,e){var n,r;e===void 0&&(e={});const{open:o,elements:s,floatingId:i}=t,{enabled:a=!0,role:c="dialog"}=e,u=Se(),f=((n=s.domReference)==null?void 0:n.id)||u,p=h.useMemo(()=>{var x;return((x=Pn(s.floating))==null?void 0:x.id)||i},[s.floating,i]),l=(r=rr.get(c))!=null?r:c,g=nt()!=null,m=h.useMemo(()=>l==="tooltip"||c==="label"?{["aria-"+(c==="label"?"labelledby":"describedby")]:o?p:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":l==="alertdialog"?"dialog":l,"aria-controls":o?p:void 0,...l==="listbox"&&{role:"combobox"},...l==="menu"&&{id:f},...l==="menu"&&g&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[l,p,g,o,f,c]),v=h.useMemo(()=>{const x={id:p,...l&&{role:l}};return l==="tooltip"||c==="label"?x:{...x,...l==="menu"&&{"aria-labelledby":f}}},[l,p,f,c]),y=h.useCallback(x=>{let{active:w,selected:I}=x;const N={role:"option",...w&&{id:p+"-fui-option"}};switch(c){case"select":case"combobox":return{...N,"aria-selected":I}}return{}},[p,c]);return h.useMemo(()=>a?{reference:m,floating:v,item:y}:{},[a,m,v,y])}function sr({children:t}){const{state:e,dispatch:n}=It(),{open:r,element:o}=e,s=()=>{n({type:"ON_EXIT"})},{refs:i,floatingStyles:a,context:c}=tr({placement:"bottom-start",open:r,onOpenChange:l=>{l||s()},elements:{reference:o},middleware:[xt(10),yt(),wt()],whileElementsMounted:St}),u=Zn(c,{outsidePress:l=>!(l.target instanceof Element&&l.target.closest(".ProseMirror"))}),f=or(c,{role:"listbox"}),{getFloatingProps:p}=nr([u,f]);return r?b.jsx(Yn,{children:b.jsx("div",{ref:i.setFloating,style:a,...p(),className:"z-50 w-auto min-w-[360px] max-w-[520px] rounded-lg border bg-popover p-0 text-popover-foreground shadow-md outline-hidden overflow-hidden",children:t})}):null}const ir=t=>{const e=Y.c(29),{item:n,isSelected:r,onSelect:o,isLoading:s,ref:i}=t;let a;if(e[0]!==n){const T=ue(n._meta);a=n.title||Zt(n.name,T),e[0]=n,e[1]=a}else a=e[1];const c=a,u=n.description||null,f=n.icon,p=r&&"bg-accent text-accent-foreground",l=s&&"pointer-events-none opacity-50";let d;e[2]!==p||e[3]!==l?(d=Ue("relative flex w-full cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors","hover:bg-accent hover:text-accent-foreground","focus:bg-accent focus:text-accent-foreground",p,l),e[2]=p,e[3]=l,e[4]=d):d=e[4];let g;e[5]!==f||e[6]!==c?(g=f!==void 0&&b.jsx(zt,{icon:f,name:c,size:"xs",className:"mr-2"}),e[5]=f,e[6]=c,e[7]=g):g=e[7];let m;e[8]!==c?(m=b.jsx("span",{className:"font-medium flex items-center truncate capitalize",children:c}),e[8]=c,e[9]=m):m=e[9];let v;e[10]!==s?(v=s&&b.jsx(Rt,{size:"xs"}),e[10]=s,e[11]=v):v=e[11];let y;e[12]!==m||e[13]!==v?(y=b.jsxs("div",{className:"flex items-center justify-between gap-2",children:[m,v]}),e[12]=m,e[13]=v,e[14]=y):y=e[14];let x;e[15]!==u?(x=u&&b.jsx("div",{className:"text-xs text-muted-foreground line-clamp-1",children:u}),e[15]=u,e[16]=x):x=e[16];let w;e[17]!==y||e[18]!==x?(w=b.jsxs("div",{className:"flex flex-col gap-0.5 flex-1 min-w-0",children:[y,x]}),e[17]=y,e[18]=x,e[19]=w):w=e[19];let I;e[20]!==n.drillable?(I=n.drillable&&b.jsx("kbd",{className:"shrink-0 ml-2 px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground bg-muted border border-border rounded",children:"↵"}),e[20]=n.drillable,e[21]=I):I=e[21];let N;return e[22]!==o||e[23]!==i||e[24]!==w||e[25]!==I||e[26]!==d||e[27]!==g?(N=b.jsxs("div",{ref:i,onClick:o,className:d,children:[g,w,I]}),e[22]=o,e[23]=i,e[24]=w,e[25]=I,e[26]=d,e[27]=g,e[28]=N):N=e[28],N},ar=t=>{const e=Y.c(21),{editor:n,queryKey:r,queryFn:o,onSelect:s}=t,i=le();let a;e[0]!==n||e[1]!==s||e[2]!==o||e[3]!==r?(a={editor:n,queryKey:r,queryFn:o,onSelect:s},e[0]=n,e[1]=s,e[2]=o,e[3]=r,e[4]=a):a=e[4];const{items:c,selectedIndex:u,onSelect:f,selectedItem:p}=kt(a);if(!c.length){let m;e[5]!==i?(m=i("chat.mention.noItemsFound"),e[5]=i,e[6]=m):m=e[6];let v;return e[7]!==m?(v=b.jsx("div",{className:"min-w-[360px] max-w-[520px] bg-popover text-popover-foreground rounded-md border shadow-md p-3 text-sm",children:m}),e[7]=m,e[8]=v):v=e[8],v}let l;e[9]===Symbol.for("react.memo_cache_sentinel")?(l={maxHeight:"min(320px, var(--radix-popover-content-available-height, 320px))"},e[9]=l):l=e[9];let d;if(e[10]!==f||e[11]!==c||e[12]!==u||e[13]!==p?.name){let m;e[15]!==f||e[16]!==u||e[17]!==p?.name?(m=(v,y)=>b.jsx(ir,{item:v,isSelected:y===u,ref:y===u?ur:void 0,onSelect:()=>f(v,y),isLoading:p?.name===v.name},`${v.kind??"item"}:${v.name}`),e[15]=f,e[16]=u,e[17]=p?.name,e[18]=m):m=e[18],d=c.map(m),e[10]=f,e[11]=c,e[12]=u,e[13]=p?.name,e[14]=d}else d=e[14];let g;return e[19]!==d?(g=b.jsx("div",{className:"min-w-[360px] max-w-[520px] bg-popover text-popover-foreground rounded-md overflow-y-auto",style:l,children:b.jsx("div",{className:"p-1",children:d})}),e[19]=d,e[20]=g):g=e[20],g};function lr(){const t=Y.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=b.jsx("div",{className:"p-1",children:[...Array(3)].map(cr)}),t[0]=e):e=t[0],e}function cr(t,e){return b.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1.5 animate-pulse",children:[b.jsx("div",{className:"h-4 w-24 bg-muted rounded"}),b.jsx("div",{className:"h-3 w-32 bg-muted rounded"})]},e)}function st(t){const e=Y.c(18),{editor:n,char:r,pluginKey:o,queryKey:s,queryFn:i,onSelect:a,allow:c,onOpenChange:u}=t;let f;e[0]!==c||e[1]!==r||e[2]!==n||e[3]!==u||e[4]!==o?(f={editor:n,char:r,pluginKey:o,allow:c,onOpenChange:u},e[0]=c,e[1]=r,e[2]=n,e[3]=u,e[4]=o,e[5]=f):f=e[5];const{state:p,dispatch:l}=Et(f);let d;e[6]!==l||e[7]!==p?(d={state:p,dispatch:l},e[6]=l,e[7]=p,e[8]=d):d=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=b.jsx(lr,{}),e[9]=g):g=e[9];let m;e[10]!==n||e[11]!==a||e[12]!==i||e[13]!==s?(m=b.jsx(sr,{children:b.jsx(h.Suspense,{fallback:g,children:b.jsx(ar,{editor:n,queryKey:s,queryFn:i,onSelect:a})})}),e[10]=n,e[11]=a,e[12]=i,e[13]=s,e[14]=m):m=e[14];let v;return e[15]!==d||e[16]!==m?(v=b.jsx(Ct.Provider,{value:d,children:m}),e[15]=d,e[16]=m,e[17]=v):v=e[17],v}function ur(t){t&&t.scrollIntoView({block:"center",behavior:"smooth"})}const dr=t=>{const e=Y.c(53),{editor:n,virtualMcpId:r,suggestionOpenRef:o}=t,s=le(),i=qe(),{org:a}=Be(),c=Jt();let u;e[0]!==c?(u=en(c),e[0]=c,e[1]=u):u=e[1];const f=u;let p;e[2]!==a.id||e[3]!==a.slug||e[4]!==r?(p={connectionId:r,orgId:a.id,orgSlug:a.slug},e[2]=a.id,e[3]=a.slug,e[4]=r,e[5]=p):p=e[5];const l=He(p);let d;e[6]!==a.id||e[7]!==r?(d=ce.virtualMcpResources(r,a.id),e[6]=a.id,e[7]=r,e[8]=d):d=e[8];const g=d,[m,v]=h.useState("categories");let y;e[9]!==m?(y=()=>m,e[9]=m,e[10]=y):y=e[10];const x=h.useEffectEvent(y),w=h.useRef(null),I=h.useRef(!1),N=r??"default";let T;e[11]!==m||e[12]!==a.id||e[13]!==N?(T=["at-mention",a.id,N,m],e[11]=m,e[12]=a.id,e[13]=N,e[14]=T):T=e[14];const S=T;let R;e[15]!==s?(R=s("chat.mentionAt.agentsTitle"),e[15]=s,e[16]=R):R=e[16];let k;e[17]!==s?(k=s("chat.mentionAt.agentsDescription"),e[17]=s,e[18]=k):k=e[18];let F;e[19]!==R||e[20]!==k?(F={name:"agents",title:R,description:k,kind:"category",drillable:!0},e[19]=R,e[20]=k,e[21]=F):F=e[21];let D;e[22]!==s?(D=s("chat.mentionAt.resourcesTitle"),e[22]=s,e[23]=D):D=e[23];let A;e[24]!==s?(A=s("chat.mentionAt.resourcesDescription"),e[24]=s,e[25]=A):A=e[25];let Q;e[26]!==D||e[27]!==A?(Q={name:"resources",title:D,description:A,kind:"category",drillable:!0},e[26]=D,e[27]=A,e[28]=Q):Q=e[28];let C;e[29]!==Q||e[30]!==F?(C=[F,Q],e[29]=Q,e[30]=F,e[31]=C):C=e[31];const M=C;let E;e[32]!==l||e[33]!==n||e[34]!==s?(E=async X=>{const{item:_,range:j}=X;if(J("chat_picker_item_selected",{picker:"@",item_kind:_.kind,item_name:_.name}),_.kind!=="category"&&(I.current=!0),_.kind==="category")return v(_.name==="agents"?"agents":"resources"),!1;if(_.kind==="agent"&&_.agentId){se(n,j,{id:_.agentId,name:_.name,metadata:{agentId:_.agentId,title:_.name},char:"@"}),v("categories");return}if(_.kind==="resource"&&_.uri&&l){try{const K=await Qe(l,_.uri);se(n,j,{id:_.uri,name:_.uri,metadata:K.contents,char:"@"})}catch(K){console.error("[at-mention] Failed to fetch resource:",K),V.error(s("chat.mentionAt.failedToLoadResource"))}v("categories");return}},e[32]=l,e[33]=n,e[34]=s,e[35]=E):E=e[35];const $=E;let P;e[36]!==c||e[37]!==M||e[38]!==l||e[39]!==f||e[40]!==x||e[41]!==i||e[42]!==g||e[43]!==r?(P=async X=>{const{query:_}=X,j=x();if(j==="categories"){if(!_.trim())return M;const q=_.toLowerCase(),U=c.filter(B=>B.status==="active"&&(!B.id||!Ee(B.id))&&!f.has(B.id)&&B.id!==r&&(B.title.toLowerCase().includes(q)||B.description?.toLowerCase().includes(q))).map(fr),ee=await(async()=>{if(!l)return[];let B=i.getQueryData(g);return B||(B=await i.fetchQuery({queryKey:g,queryFn:()=>oe(l),staleTime:6e4})),(B?.resources??[]).filter(ne=>ne.uri.toLowerCase().includes(q)||ne.name?.toLowerCase().includes(q)||ne.description?.toLowerCase().includes(q)).map(mr)})();return[...U,...ee]}if(j==="agents"){let q=c.filter(U=>U.status==="active"&&(!U.id||!Ee(U.id))&&!f.has(U.id)&&U.id!==r);if(_.trim()){const U=_.toLowerCase();q=q.filter(ee=>ee.title.toLowerCase().includes(U)||ee.description?.toLowerCase().includes(U))}return q.map(pr)}if(!l)return[];let K=i.getQueryData(g);K?i.fetchQuery({queryKey:g,queryFn:()=>oe(l),staleTime:6e4}).catch(gr):K=await i.fetchQuery({queryKey:g,queryFn:()=>oe(l),staleTime:6e4});let W=K?.resources??[];if(_.trim()){const q=_.toLowerCase();W=W.filter(U=>U.uri.toLowerCase().includes(q)||U.name?.toLowerCase().includes(q)||U.description?.toLowerCase().includes(q))}return W.map(hr)},e[36]=c,e[37]=M,e[38]=l,e[39]=f,e[40]=x,e[41]=i,e[42]=g,e[43]=r,e[44]=P):P=e[44];const L=P;let O;e[45]!==o?(O=X=>{if(o&&(o.current=X),X)w.current=Date.now(),I.current=!1,J("chat_picker_opened",{picker:"@"});else{const _=w.current;J("chat_picker_closed",{picker:"@",outcome:I.current?"selected":"dismissed",duration_ms:_?Date.now()-_:null}),w.current=null,v("categories")}},e[45]=o,e[46]=O):O=e[46];const H=O;let G;return e[47]!==n||e[48]!==L||e[49]!==$||e[50]!==H||e[51]!==S?(G=b.jsx(st,{editor:n,char:"@",pluginKey:"atDropdownMenu",queryKey:S,queryFn:L,onSelect:$,onOpenChange:H}),e[47]=n,e[48]=L,e[49]=$,e[50]=H,e[51]=S,e[52]=G):G=e[52],G};function fr(t){return{name:t.title,title:t.title,description:t.description??void 0,icon:t.icon??null,kind:"agent",agentId:t.id}}function mr(t){return{name:t.name??t.uri,title:t.name,description:t.description,kind:"resource",uri:t.uri}}function pr(t){return{name:t.title,title:t.title,description:t.description??void 0,icon:t.icon??null,kind:"agent",agentId:t.id}}function gr(){}function hr(t){return{name:t.name??t.uri,title:t.name,description:t.description,kind:"resource",uri:t.uri}}async function Oe(t,e,n,r,o,s,i){try{const a=await We(n,r,s);se(t,e,{id:r,name:Ve(r,o),metadata:a.messages,char:"/",kind:"prompt",args:s})}catch(a){console.error("[slash] Failed to fetch prompt:",a),V.error(i.t("chat.mentionSlash.failedLoadPrompt"))}}async function vr(t,e,n,r,o){try{const s=await Qe(n,r);se(t,e,{id:r,name:r,metadata:s.contents,char:"/",kind:"resource"})}catch(s){console.error("[slash] Failed to fetch resource:",s),V.error(o.t("chat.mentionSlash.failedLoadResource"))}}async function br(t,e,n,r,o){try{const{files:s,omittedPaths:i}=await tn(n,r.volume,r.path),a={sandboxPath:r.sandboxPath,files:s,omittedPaths:i};se(t,e,{id:r.id,name:r.name,metadata:a,char:"/",kind:"skill"})}catch(s){console.error("[slash] Failed to fetch skill:",s),V.error(o.t("chat.mentionSlash.failedLoadSkill"))}}const xr=({editor:t,virtualMcpId:e,suggestionOpenRef:n})=>{const r=le(),o=qe(),{org:s}=Be(),i=He({connectionId:e,orgId:s.id,orgSlug:s.slug}),a=ce.virtualMcpPrompts(e,s.id),c=ce.virtualMcpResources(e,s.id),u=ce.slashSkills(s.id),f=["slash-mention",s.id,e??"default"],[p,l]=h.useState(null),[d,g]=h.useState(null),m=_t(t);m&&(m.onEditChip=async S=>{if(i)try{const k=(await $e(o,a,i)).find(F=>F.name===S.promptId);if(!k?.arguments||k.arguments.length===0)return;g({...S,prompt:k})}catch(R){console.error("[slash] Failed to load prompt for editing:",R),V.error(r("chat.mentionSlash.failedLoadPrompt"))}});const v=h.useRef(null),y=h.useRef(!1),x=async({item:S,range:R})=>{if(J("chat_picker_item_selected",{picker:"/",item_kind:S.kind,item_name:S.name}),y.current=!0,!!i)if(S.kind==="prompt"){if(S.arguments&&S.arguments.length>0){l({range:R,item:S});return}const k=ue(S._meta);await Oe(t,R,i,S.name,k,void 0,{t:r})}else S.kind==="skill"?S.skill&&await br(t,R,s.slug,S.skill,{t:r}):S.uri&&await vr(t,R,i,S.uri,{t:r})},w=async S=>{if(!p||!i)return;const{range:R,item:k}=p,F=ue(k._meta);await Oe(t,R,i,k.name,F,S,{t:r}),l(null)},I=async S=>{if(!(!d||!i)){if(!At(t,d.pos,d.promptId)){V.error(r("chat.mentionSlash.failedUpdatePrompt")),g(null);return}try{const R=await We(i,d.promptId,S),k=ue(d.prompt._meta);t.chain().focus().setNodeSelection(d.pos).deleteSelection().insertContentAt(d.pos,Mt({id:d.promptId,name:Ve(d.promptId,k),metadata:R.messages,char:"/",kind:"prompt",args:S})).run(),J("chat_picker_item_selected",{picker:"/edit",item_kind:"prompt",item_name:d.promptId})}catch(R){console.error("[slash] Failed to update prompt:",R),V.error(r("chat.mentionSlash.failedUpdatePrompt"))}g(null)}},N=async S=>{const{query:R}=S;if(!i)return[];const[k,F,D]=await Promise.all([$e(o,a,i),wr(o,c,i),yr(o,u,s.slug)]),A=R.trim().toLowerCase(),Q=(k??[]).filter(E=>!A||E.name.toLowerCase().includes(A)||E.title?.toLowerCase().includes(A)||E.description?.toLowerCase().includes(A)).map(E=>({name:E.name,title:E.title,description:E.description,kind:"prompt",arguments:E.arguments,_meta:E._meta})),C=(F??[]).filter(E=>!A||E.uri.toLowerCase().includes(A)||E.name?.toLowerCase().includes(A)||E.description?.toLowerCase().includes(A)).map(E=>({name:E.name??E.uri,title:E.name,description:E.description,kind:"resource",uri:E.uri})),M=(D??[]).filter(E=>!A||E.name.toLowerCase().includes(A)||E.id.toLowerCase().includes(A)||E.description?.toLowerCase().includes(A)).map(E=>({name:E.name,title:E.name,description:E.description??void 0,kind:"skill",skill:E}));return[...Q,...C,...M]},T=p?.item.kind==="prompt"?{name:p.item.name,title:p.item.title,arguments:p.item.arguments,description:p.item.description,_meta:p.item._meta}:null;return b.jsxs(b.Fragment,{children:[b.jsx(st,{editor:t,char:"/",pluginKey:"slashDropdownMenu",queryKey:f,queryFn:N,onSelect:x,onOpenChange:S=>{if(n&&(n.current=S),S)v.current=Date.now(),y.current=!1,J("chat_picker_opened",{picker:"/"});else{const R=v.current;J("chat_picker_closed",{picker:"/",outcome:y.current?"selected":"dismissed",duration_ms:R?Date.now()-R:null}),v.current=null}}}),b.jsx(Ce,{prompt:T,setPrompt:()=>l(null),onSubmit:w}),b.jsx(Ce,{prompt:d?.prompt??null,setPrompt:()=>g(null),onSubmit:I,defaultValues:d?.args},d?`edit-${d.promptId}-${d.pos}`:"edit-idle")]})};async function $e(t,e,n){let r=t.getQueryData(e);return r?t.fetchQuery({queryKey:e,queryFn:()=>Ie(n),staleTime:6e4}).catch(()=>{}):r=await t.fetchQuery({queryKey:e,queryFn:()=>Ie(n),staleTime:6e4}).catch(()=>{}),r?.prompts??[]}async function yr(t,e,n){const r=t.getQueryData(e),o=()=>t.fetchQuery({queryKey:e,queryFn:()=>nn(n),staleTime:6e4});return r?(o().catch(()=>{}),r):o().catch(()=>[])}async function wr(t,e,n){let r=t.getQueryData(e);return r?t.fetchQuery({queryKey:e,queryFn:()=>oe(n),staleTime:6e4}).catch(()=>{}):r=await t.fetchQuery({queryKey:e,queryFn:()=>oe(n),staleTime:6e4}).catch(()=>{}),r?.resources??[]}const it="Ask anything, / for prompts & skills, @ for agents & resources...";function Sr(t){return[Kt.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,dropcursor:!1}),Pt.configure({placeholder:()=>t.current??it,showOnlyWhenEditable:!1}),Ot,$t]}function Or({tiptapDoc:t,setTiptapDoc:e,disabled:n=!1,enterToSubmit:r=!1,placeholder:o,onSubmit:s,suggestionOpenRef:i,children:a}){const c=h.useRef(s),u=h.useRef(e),f=h.useRef(r),p=h.useRef(o),l=Dt({extensions:Sr(p),content:t||"",editorProps:{attributes:{"data-chat-input":"true",role:"textbox","aria-multiline":"true","aria-label":o??it,class:"prose prose-sm max-w-none focus:outline-none w-full h-full text-[15px] p-[18px]"},handleKeyDown:(d,g)=>g.key==="Enter"&&!g.shiftKey&&f.current&&!i?.current?(g.preventDefault(),c.current?.(),!0):!1},onUpdate:({editor:d})=>{u.current(d?.getJSON())}});return h.useEffect(()=>{l?.setEditable(!n)},[l,n]),h.useEffect(()=>{c.current=s},[s]),h.useEffect(()=>{u.current=e},[e]),h.useEffect(()=>{f.current=r},[r]),h.useEffect(()=>{p.current=o},[o]),h.useEffect(()=>{if(!l||l.isDestroyed)return;const d=JSON.stringify(l.getJSON()),g=JSON.stringify(t||{type:"doc",content:[]});d!==g&&l.commands.setContent(t||{type:"doc",content:[]})},[l,t]),b.jsx(jt.Provider,{value:{editor:l},children:a})}function $r(t){const e=Y.c(29),{disabled:n,virtualMcpId:r,showFileUploader:o,selectedModel:s,onUnsupportedFile:i,suggestionOpenRef:a,ref:c,className:u}=t,f=n===void 0?!1:n,p=o===void 0?!1:o,{editor:l}=Lt();let d,g;if(e[0]!==l?(d=()=>({focus:()=>{l?.commands.focus()},clear:()=>{l?.commands.clearContent(!0)},appendText:k=>{if(!l)return;const F=l.state.doc.textContent.trim()==="";l.commands.focus("end"),F||l.commands.insertContent(" "),l.commands.insertContent(k)},syncVoiceText:(k,F)=>{if(l&&(l.commands.setContent(k||{type:"doc",content:[]}),F)){l.commands.focus("end");const D=l.state.doc.textContent.trim().length>0;l.commands.insertContent({type:"text",text:D?" "+F:F})}},restoreContent:k=>{l&&l.commands.setContent(k||{type:"doc",content:[]})}}),g=[l],e[0]=l,e[1]=d,e[2]=g):(d=e[1],g=e[2]),h.useImperativeHandle(c??null,d,g),!l)return null;const m=f&&"cursor-not-allowed opacity-70",v=f&&"[&_.ProseMirror]:cursor-not-allowed";let y;e[3]!==u||e[4]!==m||e[5]!==v?(y=Ue("overflow-y-auto relative flex-1 max-h-[164px] min-h-[20px] w-full flex flex-col",u,"[&_.ProseMirror]:outline-none [&_.ProseMirror]:min-h-[20px] [&_.ProseMirror]:flex-1","[&_.ProseMirror_p.is-editor-empty:first-child::before]:content-[attr(data-placeholder)]","[&_.ProseMirror_p.is-editor-empty:first-child::before]:text-muted-foreground","[&_.ProseMirror_p.is-editor-empty:first-child::before]:opacity-50","[&_.ProseMirror_p.is-editor-empty:first-child::before]:float-left","[&_.ProseMirror_p.is-editor-empty:first-child::before]:pointer-events-none","[&_.ProseMirror_p.is-editor-empty:first-child::before]:h-0","[&_.ProseMirror_p.is-editor-empty:first-child::before]:w-full","[&_.ProseMirror_p.is-editor-empty:first-child::before]:break-words",m,v),e[3]=u,e[4]=m,e[5]=v,e[6]=y):y=e[6];let x;e[7]!==l||e[8]!==y?(x=b.jsx(Ut,{editor:l,className:y}),e[7]=l,e[8]=y,e[9]=x):x=e[9];const w=r??null;let I;e[10]!==l||e[11]!==a||e[12]!==w?(I=b.jsx(h.Suspense,{fallback:null,children:b.jsx(xr,{editor:l,virtualMcpId:w,suggestionOpenRef:a})}),e[10]=l,e[11]=a,e[12]=w,e[13]=I):I=e[13];const N=r??null;let T;e[14]!==l||e[15]!==a||e[16]!==N?(T=b.jsx(h.Suspense,{fallback:null,children:b.jsx(dr,{editor:l,virtualMcpId:N,suggestionOpenRef:a})}),e[14]=l,e[15]=a,e[16]=N,e[17]=T):T=e[17];let S;e[18]!==f||e[19]!==l||e[20]!==i||e[21]!==s||e[22]!==p?(S=p&&s&&!f?b.jsx(on,{editor:l,selectedModel:s,onUnsupportedFile:i}):null,e[18]=f,e[19]=l,e[20]=i,e[21]=s,e[22]=p,e[23]=S):S=e[23];let R;return e[24]!==I||e[25]!==T||e[26]!==S||e[27]!==x?(R=b.jsxs(b.Fragment,{children:[x,I,T,S]}),e[24]=I,e[25]=T,e[26]=S,e[27]=x,e[28]=R):R=e[28],R}export{Or as T,jr as U,$r as a,rn as p,Lr as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as k,j as h,r as C,l as L}from"./index-
|
|
1
|
+
import{c as k,j as h,r as C,l as L}from"./index-BMJCLbj5.js";import{n as Z}from"./Tool02-BsXDs0ea.js";import{A as y}from"./agent-icon-BayCJ1XK.js";const M={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-9 w-9",md:"h-12 w-12",lg:"h-16 w-16",xl:"h-14 w-14"},R={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-9",md:"min-w-12",lg:"min-w-16",xl:"min-w-14"},T={"2xs":8,xs:12,sm:16,md:24,lg:32,xl:28},W={"2xs":"xs",xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"lg"};function G(E){const t=k.c(13),{icon:e,name:s,size:w,className:o,fallbackIcon:c,fit:g}=E,n=w===void 0?"md":w,I=g===void 0?"cover":g;if(e?.startsWith("icon://")||e?.includes("#agentcolor=")){const r=W[n];let l;return t[0]!==o||t[1]!==e||t[2]!==s||t[3]!==r?(l=h.jsx(y,{icon:e,name:s,size:r,className:o}),t[0]=o,t[1]=e,t[2]=s,t[3]=r,t[4]=l):l=t[4],l}const S=e??"no-icon";let i;return t[5]!==o||t[6]!==c||t[7]!==I||t[8]!==e||t[9]!==s||t[10]!==n||t[11]!==S?(i=h.jsx($,{icon:e,name:s,size:n,className:o,fallbackIcon:c,fit:I},S),t[5]=o,t[6]=c,t[7]=I,t[8]=e,t[9]=s,t[10]=n,t[11]=S,t[12]=i):i=t[12],i}function $(E){const t=k.c(25),{icon:e,name:s,size:w,className:o,fallbackIcon:c,fit:g}=E,n=w===void 0?"md":w,I=g===void 0?"cover":g,[S,i]=C.useState(!1),r=!!e&&S,l=M[n],p=R[n];let a;t[0]!==o||t[1]!==l||t[2]!==p?(a=L("rounded-lg border border-border shrink-0 overflow-hidden aspect-square bg-white",l,p,o),t[0]=o,t[1]=l,t[2]=p,t[3]=a):a=t[3];const N=e||void 0,_=I==="contain"?"object-contain":"object-cover",A=!r&&"hidden";let m;t[4]!==_||t[5]!==A?(m=L("h-full w-full",_,A),t[4]=_,t[5]=A,t[6]=m):m=t[6];let v,j;t[7]===Symbol.for("react.memo_cache_sentinel")?(v=()=>i(!1),j=()=>i(!0),t[7]=v,t[8]=j):(v=t[7],j=t[8]);let d;t[9]!==s||t[10]!==N||t[11]!==m?(d=h.jsx("img",{src:N,alt:s,className:m,onError:v,onLoad:j}),t[9]=s,t[10]=N,t[11]=m,t[12]=d):d=t[12];const z=r&&"hidden";let f;t[13]!==z?(f=L("h-full w-full flex items-center justify-center bg-muted/20",z),t[13]=z,t[14]=f):f=t[14];let x;t[15]!==c||t[16]!==n?(x=c??h.jsx(Z,{size:T[n],className:"text-muted-foreground"}),t[15]=c,t[16]=n,t[17]=x):x=t[17];let u;t[18]!==f||t[19]!==x?(u=h.jsx("div",{className:f,children:x}),t[18]=f,t[19]=x,t[20]=u):u=t[20];let b;return t[21]!==d||t[22]!==u||t[23]!==a?(b=h.jsxs("div",{className:a,children:[d,u]}),t[21]=d,t[22]=u,t[23]=a,t[24]=b):b=t[24],b}export{G as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as
|
|
1
|
+
import{c as n,l as r,j as i,aV as p}from"./index-BMJCLbj5.js";function c(o){const e=n.c(8);let t,s;e[0]!==o?({className:t,...s}=o,e[0]=o,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=r("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=i.jsx(p,{"data-slot":"label",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}export{c as L};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,c as f}from"./index-BMJCLbj5.js";import{g as c}from"./sandbox-lifecycle-context-qEhBBhZu.js";import{a as l}from"./decofile-api-C_KdReLg.js";function p(e,t,n){return e===null?0:Math.max(0,n-Math.max(0,t-e))}function m(e,t){const[n,r]=i.useState(e),a=i.useRef(e?Date.now():null);return i.useEffect(()=>{if(e){a.current??=Date.now(),r(!0);return}if(!n)return;const s=()=>{a.current=null,r(!1)},o=p(a.current,Date.now(),t);if(o===0){s();return}const u=setTimeout(s,o);return()=>clearTimeout(u)},[e,n,t]),n}const y=500;function D(e,t,n){const r=f.c(6);let a;r[0]!==n||r[1]!==e||r[2]!==t?(a=l(e,t,n),r[0]=n,r[1]=e,r[2]=t,r[3]=a):a=r[3];let s;r[4]!==a?(s={mutationKey:a},r[4]=a,r[5]=s):s=r[5];const o=c(s)>0;return m(o,y)}function K(e,t,n){return`deco:preview:last-page:${e}:${t}:${n}`}function g(e){if(!e)return null;try{const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t)||typeof t.path!="string"||!t.path.startsWith("/"))return null;const n=typeof t.pageKey=="string"?t.pageKey:null,r={};if(t.params&&typeof t.params=="object")for(const[a,s]of Object.entries(t.params))typeof s=="string"&&(r[a]=s);return{path:t.path,pageKey:n,params:r}}catch{return null}}function d(e){try{return g(localStorage.getItem(e))}catch{return null}}function x(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}export{K as l,d as r,D as u,x as w};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as p,j as s,b as y,O as _,h as g,B as S,L as j,i as v,k as A,l as N}from"./index-BMJCLbj5.js";import{P as b}from"./index-BYpQoJPO.js";import{R}from"./required-auth-layout-Udaxv9eU.js";import{u as T}from"./use-deployment-admin-BeJGIguj.js";const D=[{to:"/_admin/users",labelKey:"admin.layout.usersTab"},{to:"/_admin/orgs",labelKey:"admin.layout.organizationsTab"},{to:"/_admin/prompts",labelKey:"admin.layout.promptsTab"}];function K(){const e=p.c(6);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={select:L},e[0]=a):a=e[0];const d=A(a),r=y();let t;e[1]!==d||e[2]!==r?(t=D.map(i=>s.jsx(j,{to:i.to,className:N("-mb-px border-b-2 px-3 py-2.5 text-sm font-medium transition-colors",d.startsWith(i.to)?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:r(i.labelKey)},i.to)),e[1]=d,e[2]=r,e[3]=t):t=e[3];let o;return e[4]!==t?(o=s.jsx("nav",{className:"flex items-center gap-1 border-b border-border px-4 md:px-10",children:t}),e[4]=t,e[5]=o):o=e[5],o}function L(e){return e.location.pathname}function k(){const e=p.c(22),{isAdmin:a,loading:d,needsEmailVerification:r}=T(),t=y();if(d){let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"flex h-dvh flex-1 items-center justify-center",children:s.jsx(g,{className:"size-5 text-muted-foreground"})}),e[0]=n):n=e[0],n}if(!a){let n;e[1]!==t?(n=t("admin.layout.adminDashboardArea"),e[1]=t,e[2]=n):n=e[2];let l;e[3]!==r||e[4]!==t?(l=t(r?"admin.layout.emailVerificationRequired":"admin.layout.restrictedToDashboard"),e[3]=r,e[4]=t,e[5]=l):l=e[5];let m;e[6]!==t?(m=t("admin.layout.goHome"),e[6]=t,e[7]=m):m=e[7];let c;e[8]!==m?(c=s.jsx(S,{variant:"outline",size:"sm",asChild:!0,children:s.jsx(j,{to:"/",children:m})}),e[8]=m,e[9]=c):c=e[9];let h;return e[10]!==n||e[11]!==l||e[12]!==c?(h=s.jsx(v,{area:n,description:l,action:c}),e[10]=n,e[11]=l,e[12]=c,e[13]=h):h=e[13],h}let o;e[14]!==t?(o=t("admin.layout.adminDashboard"),e[14]=t,e[15]=o):o=e[15];let i;e[16]!==o?(i=s.jsx("div",{className:"shrink-0 px-4 pt-6 md:px-10",children:s.jsx("h1",{className:"pb-4 text-xl font-medium",children:o})}),e[16]=o,e[17]=i):i=e[17];let u;e[18]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(K,{}),e[18]=u):u=e[18];let f;e[19]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(b.Content,{children:s.jsx(_,{})}),e[19]=f):f=e[19];let x;return e[20]!==i?(x=s.jsxs(b,{variant:"plain",className:"h-dvh",children:[i,u,f]}),e[20]=i,e[21]=x):x=e[21],x}function $(){const e=p.c(1);let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(R,{children:s.jsx(k,{})}),e[0]=a):a=e[0],a}export{$ as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as _,f as h,u as x,M as j,dC as S,ag as b,eZ as v,j as p,N as d}from"./index-BMJCLbj5.js";import{L}from"./legacy-main-redirect-tszfeXT6.js";import"./thread-route-BBIxLMFt.js";function R(){const e=_.c(16);let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[0]=o):o=e[0];const g=h(o);let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},e[1]=n):n=e[1];const s=x(n),{org:t}=j(),f="_splat"in g&&typeof g._splat=="string"?g._splat:"";let c,a;if(e[2]!==t.id||e[3]!==t.slug||e[4]!==s||e[5]!==f){a=Symbol.for("react.early_return_sentinel");e:{const m=f.split("/").find(Boolean);if(!m){let r;e[8]!==t.slug?(r={org:t.slug},e[8]=t.slug,e[9]=r):r=e[9];let u;e[10]!==s||e[11]!==r?(u=p.jsx(d,{to:"/$org/projects",params:r,search:s,hash:!0,replace:!0}),e[10]=s,e[11]=r,e[12]=u):u=e[12],a=u;break e}const y=S({virtualMcpIdSearch:s.virtualmcpid,fallbackAgentId:b(t.id).id});c=v({org:t.slug,agentId:y,panel:m,source:"view-first",search:s})}e[2]=t.id,e[3]=t.slug,e[4]=s,e[5]=f,e[6]=c,e[7]=a}else c=e[6],a=e[7];if(a!==Symbol.for("react.early_return_sentinel"))return a;const l=c;let i;return e[13]!==t.slug||e[14]!==l?(i=l?.kind==="canonical"?p.jsx(L,{target:{route:l.route,search:l.search}}):p.jsx(d,{to:"/$org/home",params:{org:t.slug},replace:!0}),e[13]=t.slug,e[14]=l,e[15]=i):i=e[15],i}export{R as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as v,C as t,j as p,N as m,a1 as c,f as y,u as I,R as E,dC as k,dD as R,dE as S,dF as b}from"./index-BMJCLbj5.js";import{b as C}from"./thread-route-BBIxLMFt.js";function L(x){const a=v.c(78),{target:h}=x,{route:s,search:r}=h;switch(s.to){case c.home:{let e;return a[0]!==s.params||a[1]!==r?(e=p.jsx(m,{to:c.home,params:s.params,search:r,hash:!0,replace:!0}),a[0]=s.params,a[1]=r,a[2]=e):e=a[2],e}case c.tasks:{let e;return a[3]!==s.params||a[4]!==r?(e=p.jsx(m,{to:c.tasks,params:s.params,search:r,hash:!0,replace:!0}),a[3]=s.params,a[4]=r,a[5]=e):e=a[5],e}case c.reports:{let e;return a[6]!==s.params||a[7]!==r?(e=p.jsx(m,{to:c.reports,params:s.params,search:r,hash:!0,replace:!0}),a[6]=s.params,a[7]=r,a[8]=e):e=a[8],e}case c.discover:{let e;return a[9]!==s.params||a[10]!==r?(e=p.jsx(m,{to:c.discover,params:s.params,search:r,hash:!0,replace:!0}),a[9]=s.params,a[10]=r,a[11]=e):e=a[11],e}case c.library:{let e;return a[12]!==s.params||a[13]!==r?(e=p.jsx(m,{to:c.library,params:s.params,search:r,hash:!0,replace:!0}),a[12]=s.params,a[13]=r,a[14]=e):e=a[14],e}case t.root:{let e;return a[15]!==s.params||a[16]!==r?(e=p.jsx(m,{to:t.root,params:s.params,search:r,hash:!0,replace:!0}),a[15]=s.params,a[16]=r,a[17]=e):e=a[17],e}case t.tasks:{let e;return a[18]!==s.params||a[19]!==r?(e=p.jsx(m,{to:t.tasks,params:s.params,search:r,hash:!0,replace:!0}),a[18]=s.params,a[19]=r,a[20]=e):e=a[20],e}case t.reports:{let e;return a[21]!==s.params||a[22]!==r?(e=p.jsx(m,{to:t.reports,params:s.params,search:r,hash:!0,replace:!0}),a[21]=s.params,a[22]=r,a[23]=e):e=a[23],e}case t.siteEditor:{let e;return a[24]!==s.params||a[25]!==r?(e=p.jsx(m,{to:t.siteEditor,params:s.params,search:r,hash:!0,replace:!0}),a[24]=s.params,a[25]=r,a[26]=e):e=a[26],e}case t.siteEditorContent:{let e;return a[27]!==s.params||a[28]!==r?(e=p.jsx(m,{to:t.siteEditorContent,params:s.params,search:r,hash:!0,replace:!0}),a[27]=s.params,a[28]=r,a[29]=e):e=a[29],e}case t.siteEditorCode:{let e;return a[30]!==s.params||a[31]!==r?(e=p.jsx(m,{to:t.siteEditorCode,params:s.params,search:r,hash:!0,replace:!0}),a[30]=s.params,a[31]=r,a[32]=e):e=a[32],e}case t.settings:{let e;return a[33]!==s.params||a[34]!==r?(e=p.jsx(m,{to:t.settings,params:s.params,search:r,hash:!0,replace:!0}),a[33]=s.params,a[34]=r,a[35]=e):e=a[35],e}case t.assets:{let e;return a[36]!==s.params||a[37]!==r?(e=p.jsx(m,{to:t.assets,params:s.params,search:r,hash:!0,replace:!0}),a[36]=s.params,a[37]=r,a[38]=e):e=a[38],e}case t.git:{let e;return a[39]!==s.params||a[40]!==r?(e=p.jsx(m,{to:t.git,params:s.params,search:r,hash:!0,replace:!0}),a[39]=s.params,a[40]=r,a[41]=e):e=a[41],e}case t.hosting:{let e;return a[42]!==s.params||a[43]!==r?(e=p.jsx(m,{to:t.hosting,params:s.params,search:r,hash:!0,replace:!0}),a[42]=s.params,a[43]=r,a[44]=e):e=a[44],e}case t.e2e:{let e;return a[45]!==s.params||a[46]!==r?(e=p.jsx(m,{to:t.e2e,params:s.params,search:r,hash:!0,replace:!0}),a[45]=s.params,a[46]=r,a[47]=e):e=a[47],e}case t.analytics:{let e;return a[48]!==s.params||a[49]!==r?(e=p.jsx(m,{to:t.analytics,params:s.params,search:r,hash:!0,replace:!0}),a[48]=s.params,a[49]=r,a[50]=e):e=a[50],e}case t.monitor:{let e;return a[51]!==s.params||a[52]!==r?(e=p.jsx(m,{to:t.monitor,params:s.params,search:r,hash:!0,replace:!0}),a[51]=s.params,a[52]=r,a[53]=e):e=a[53],e}case t.automations:{let e;return a[54]!==s.params||a[55]!==r?(e=p.jsx(m,{to:t.automations,params:s.params,search:r,hash:!0,replace:!0}),a[54]=s.params,a[55]=r,a[56]=e):e=a[56],e}case t.automation:{let e;return a[57]!==s.params||a[58]!==r?(e=p.jsx(m,{to:t.automation,params:s.params,search:r,hash:!0,replace:!0}),a[57]=s.params,a[58]=r,a[59]=e):e=a[59],e}case t.app:{let e;return a[60]!==s.params||a[61]!==r?(e=p.jsx(m,{to:t.app,params:s.params,search:r,hash:!0,replace:!0}),a[60]=s.params,a[61]=r,a[62]=e):e=a[62],e}case t.view:{let e;return a[63]!==s.params||a[64]!==r?(e=p.jsx(m,{to:t.view,params:s.params,search:r,hash:!0,replace:!0}),a[63]=s.params,a[64]=r,a[65]=e):e=a[65],e}case t.outputFile:{let e;return a[66]!==s.params||a[67]!==r?(e=p.jsx(m,{to:t.outputFile,params:s.params,search:r,hash:!0,replace:!0}),a[66]=s.params,a[67]=r,a[68]=e):e=a[68],e}case t.outputDeck:{let e;return a[69]!==s.params||a[70]!==r?(e=p.jsx(m,{to:t.outputDeck,params:s.params,search:r,hash:!0,replace:!0}),a[69]=s.params,a[70]=r,a[71]=e):e=a[71],e}case t.libraryFile:{let e;return a[72]!==s.params||a[73]!==r?(e=p.jsx(m,{to:t.libraryFile,params:s.params,search:r,hash:!0,replace:!0}),a[72]=s.params,a[73]=r,a[74]=e):e=a[74],e}case t.connectSources:{let e;return a[75]!==s.params||a[76]!==r?(e=p.jsx(m,{to:t.connectSources,params:s.params,search:r,hash:!0,replace:!0}),a[75]=s.params,a[76]=r,a[77]=e):e=a[77],e}}}function A(x){const a=v.c(17),{children:h}=x;let s;a[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},a[0]=s):s=a[0];const r=y(s);let e;a[1]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},a[1]=e):e=a[1];const u=I(e),j=C(),g=E(),i=r.org;if(!i||r.taskId!==void 0||r._splat!==void 0)return h??null;let n,f;a[2]!==j||a[3]!==g||a[4]!==i||a[5]!==r.agentId||a[6]!==u?(n=k({agentIdParam:r.agentId,virtualMcpIdSearch:u.virtualmcpid,fallbackAgentId:j}),f=(u.main!==void 0?R({org:i,agentId:n,main:u.main,search:u}):null)??S({org:i,routePath:g,search:u}),a[2]=j,a[3]=g,a[4]=i,a[5]=r.agentId,a[6]=u,a[7]=n,a[8]=f):(n=a[7],f=a[8]);const o=f;if(o?.kind==="same-route"){let l;return a[9]!==o.search?(l=p.jsx(m,{to:".",search:o.search,hash:!0,replace:!0}),a[9]=o.search,a[10]=l):l=a[10],l}if(o?.kind==="canonical"){let l;return a[11]!==o?(l=p.jsx(L,{target:o}),a[11]=o,a[12]=l):l=a[12],l}if(r.agentId!==void 0&&r.agentId===n&&u.virtualmcpid!==void 0){let l;a[13]!==u?(l=b(u),a[13]=u,a[14]=l):l=a[14];let d;return a[15]!==l?(d=p.jsx(m,{to:".",search:l,hash:!0,replace:!0}),a[15]=l,a[16]=d):d=a[16],d}return h??null}export{L,A as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as F,b as X,j as t,
|
|
1
|
+
import{c as F,b as X,j as t,ax as te,M as de,n as Xe,r as T,B as H,l as De,K as _,t as L,d as dt,u as ut,as as pt,dI as mt}from"./index-BMJCLbj5.js";import{C as ft}from"./index-Dq_pIFW4.js";import{s as ht}from"./Eye-0IX71tH3.js";import{s as bt}from"./Plus-yEjTZ3xq.js";import{i as xt}from"./SearchLg-CVlNOv3Z.js";import{i as $e}from"./Upload01-BaBM0fiO.js";import{s as gt}from"./XClose-jA5JdXrD.js";import{u as yt}from"./use-mobile-DSAvRL1q.js";import{f as vt,e as jt,b as wt,A as kt,a as St,d as Nt,c as Pt,g as Ct}from"./alert-dialog-C7QvHg2N.js";import{b as Le,D as Me,d as Ve,i as Ot,c as Qe,h as Ye,e as Ge}from"./dialog-CeIxtPXR.js";import{I as ye}from"./input-BHyVG0eO.js";import{p as Ze,b as M,s as ce,H as je,h as we,a as oe,c as _e,d as et}from"./location-oTTXFrSF.js";import{u as Dt}from"./use-debounced-value-D0zC9Ypj.js";import{c as ke,i as Fe,d as $t,h as Ue,l as tt,m as Ft,n as rt,j as Tt,o as Et}from"./use-org-fs-BNYqWw9K.js";import{f as At,p as Rt,g as zt,u as Bt,e as Lt,a as Mt,F as Se,t as st,S as Vt,B as Ut,b as at,R as Ht,c as Kt}from"./cards-C9ouoOLf.js";import{T as qt}from"./textarea-BxuD2hUP.js";import{t as It,n as Qt}from"./ChevronUp-BoMcO3mB.js";import{a as We}from"./Palette-BQYb1MUW.js";import{c as Yt}from"./Printer-tPJPBad0.js";import{i as Je}from"./X-BQCsevd6.js";import{M as Gt}from"./markdown-D53j_yF1.js";import{S as Wt}from"./file-share-button-BEGbkFdF.js";import{L as Jt}from"./preview-dialog-BpdP9L1J.js";import{S as lt}from"./skill-preview-_tRqFXnw.js";import{i as Xt}from"./ChevronRight-KrD_lvs_.js";import{t as Zt}from"./Stars01-t5rRlm9e.js";import{i as _t}from"./Zap-BuDb189W.js";import{i as er}from"./GitBranch01-CUORzB3l.js";import{a as tr}from"./use-panel-navigate-DYL1ayEh.js";import"./index-BYpQoJPO.js";import"./resizable-BH4I1yXS.js";import"./MessageCircle01-A1ZRNwnF.js";import"./thread-route-BBIxLMFt.js";import"./use-route-default-main-BnL4Z4OM.js";import"./hooks-A22NZVjF.js";import"./use-mcp-client-D_FU7Mvk.js";import"./auth-iWs2Fll8.js";import"./backoff-8mStPHYB.js";import"./task-board-BOE8KmlV.js";import"./schema-B763_7WQ.js";import"./tooltip-Duh82s_3.js";import"./index-jRUJ2Odt.js";import"./toolbar-icon-button-CW5-GSO0.js";import"./DotsVertical-qmKIPEY-.js";import"./Download01-Dgak1Fxu.js";import"./Share07-DF3BVvZU.js";import"./Globe01-CUYpQQw5.js";import"./Key01-BxQMUsAT.js";import"./Trash01-Bti0BEOH.js";import"./dropdown-menu-BGNWIYx7.js";import"./Check-C1q-PHCd.js";import"./file-type-icon-HWuHxj-a.js";import"./folder-icon-Dq-1z23e.js";import"./skill-md-ChfVs4uF.js";import"./Copy01-Dpbu0g_H.js";import"./ZoomOut-C8Giq-qB.js";import"./LinkExternal01-nAvM9RDc.js";import"./popover-C4BN0JR_.js";import"./preview-content-B1sbXWxj.js";import"./file-preview-Dt-0WoSN.js";import"./utils-B_h95VEK.js";import"./File02-D24jfSXr.js";import"./Image01-eFB14jbm.js";import"./editor-mbH0e5JY.js";import"./use-project-scope-DRMW-kAl.js";import"./use-virtual-mcp-B-R_fMeI.js";import"./github-repo-BknN0SVI.js";function rr(l){const e=l("library.brandComponentsPreview.title"),s=l("library.brandComponentsPreview.subtitle"),r=l("library.brandComponentsPreview.monthlySavingsLabel"),u=l("library.brandComponentsPreview.primaryButton"),n=l("library.brandComponentsPreview.secondaryButton"),o=l("library.brandComponentsPreview.ghostButton"),d=l("library.brandComponentsPreview.successBadge"),i=l("library.brandComponentsPreview.warningBadge"),c=l("library.brandComponentsPreview.errorBadge"),p=l("library.brandComponentsPreview.infoBadge"),h=l("library.brandComponentsPreview.allChip"),m=l("library.brandComponentsPreview.incomeChip"),w=l("library.brandComponentsPreview.spendingChip"),x=l("library.brandComponentsPreview.emailPlaceholder");return`
|
|
2
2
|
<div class="stack">
|
|
3
3
|
<div>
|
|
4
4
|
<h1>${e}</h1>
|
|
@@ -26,7 +26,7 @@ import{c as F,b as X,j as t,as as te,I as de,n as Xe,r as T,B as H,ap as Qe,l as
|
|
|
26
26
|
<span class="chip">${w}</span>
|
|
27
27
|
</div>
|
|
28
28
|
</div>
|
|
29
|
-
`}const
|
|
29
|
+
`}const sr=`
|
|
30
30
|
*{box-sizing:border-box}
|
|
31
31
|
body{margin:0;padding:24px;background:var(--brand-bg,#0b0f1a);color:var(--brand-fg,#f5f7ff);font-family:var(--brand-font-body,system-ui,sans-serif);font-size:14px;line-height:1.5}
|
|
32
32
|
.stack{display:flex;flex-direction:column;gap:18px;max-width:760px}
|
|
@@ -47,7 +47,7 @@ import{c as F,b as X,j as t,as as te,I as de,n as Xe,r as T,B as H,ap as Qe,l as
|
|
|
47
47
|
.badge-info{background:var(--brand-info-bg,#e8f1ff);color:var(--brand-info-fg,#0b54a8)}
|
|
48
48
|
.chip{border:1.5px solid var(--brand-border-strong,rgba(255,255,255,.22));border-radius:999px;padding:6px 14px;font-size:13px}
|
|
49
49
|
.chip-active{background:var(--brand-primary,#0a84ff);border-color:transparent;color:#fff}
|
|
50
|
-
`;function
|
|
50
|
+
`;function ar(l,e){return`<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><style>${l??""}</style><style>${sr}</style></head><body>${e}</body></html>`}function lr(l){const e=F.c(11),{tokensUrl:s}=l,r=X(),u=ke(s??"");if(s&&u.isPending){let p;return e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full w-full items-center justify-center p-6",children:t.jsx(te,{className:"h-full w-full rounded-xl"})}),e[0]=p):p=e[0],p}let n;e[1]!==r?(n=r("library.brandComponentsPreview.iframeTitle"),e[1]=r,e[2]=n):n=e[2];const o=n;let d,i;if(e[3]!==o||e[4]!==r||e[5]!==u.data){const p=rr(r);d=o,i=ar(u.data??null,p),e[3]=o,e[4]=r,e[5]=u.data,e[6]=d,e[7]=i}else d=e[6],i=e[7];let c;return e[8]!==d||e[9]!==i?(c=t.jsx("iframe",{title:d,srcDoc:i,sandbox:"",className:"block h-full w-full border-0 bg-white"}),e[8]=d,e[9]=i,e[10]=c):c=e[10],c}const nr="Theme preview",ir=[`<section class="slide-center">
|
|
51
51
|
<p class="eyebrow">Brand deck</p>
|
|
52
52
|
<h1 class="deck-h1">Your brand, on every slide</h1>
|
|
53
53
|
<p class="deck-sub">A live preview of each slide layout in your brand style.</p>
|
|
@@ -158,4 +158,4 @@ import{c as F,b as X,j as t,as as te,I as de,n as Xe,r as T,B as H,ap as Qe,l as
|
|
|
158
158
|
<p class="cta">slides-create --theme …</p>
|
|
159
159
|
</section>`].join(`
|
|
160
160
|
|
|
161
|
-
`);function ir(l,e){const s=e?`<style>${e}</style>`:"";return l.replaceAll("{{{slides}}}",nr).replaceAll("{{title}}",lr).replace(/(src=")(\/deck-runtime\/)/g,`$1${window.location.origin}$2`).replace("</head>",`${s}</head>`)}function or(l){const e=F.c(8),{readUrl:s,title:r,tokensUrl:u}=l,n=ke(s),o=ke(u??"");if(n.isPending||u&&o.isPending){let p;return e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full w-full items-center justify-center p-6",children:t.jsx(te,{className:"aspect-[16/9] w-full max-w-3xl rounded-xl"})}),e[0]=p):p=e[0],p}if(n.isError||!n.data){let p;return e[1]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"This theme is no longer available."}),e[1]=p):p=e[1],p}const d=o.data??null;let i;e[2]!==d||e[3]!==n.data?(i=ir(n.data,d),e[2]=d,e[3]=n.data,e[4]=i):i=e[4];let c;return e[5]!==i||e[6]!==r?(c=t.jsx("iframe",{title:r,srcDoc:i,sandbox:"allow-scripts",className:"block h-full w-full border-0 bg-white"}),e[5]=i,e[6]=r,e[7]=c):c=e[7],c}function ge(l){const e=F.c(2),{children:s}=l;let r;return e[0]!==s?(r=t.jsx("p",{className:"text-sm font-medium text-foreground",children:s}),e[0]=s,e[1]=r):r=e[1],r}function cr(l){const e=F.c(16),{family:s,tokens:r,editing:u,valueOf:n,onEdit:o}=l;let d;e[0]!==s?(d=t.jsx("span",{className:"text-xs text-muted-foreground",children:s}),e[0]=s,e[1]=d):d=e[1];let i;if(e[2]!==u||e[3]!==o||e[4]!==r||e[5]!==n){let h;e[7]!==u||e[8]!==o||e[9]!==n?(h=m=>{const w=n(m),x=`${m.name.replace(/^--brand-/,"")}: ${w}`;return u&&/^#/.test(w)?t.jsx("input",{type:"color","aria-label":m.name,title:x,value:Bt(w),onChange:y=>o(m.name,y.target.value),className:"size-7 cursor-pointer rounded-md border border-border/60 bg-transparent p-0.5"},m.name):t.jsx("span",{title:x,className:"size-7 rounded-md border border-border/60",style:{backgroundColor:w}},m.name)},e[7]=u,e[8]=o,e[9]=n,e[10]=h):h=e[10],i=r.map(h),e[2]=u,e[3]=o,e[4]=r,e[5]=n,e[6]=i}else i=e[6];let c;e[11]!==i?(c=t.jsx("div",{className:"flex flex-wrap gap-1",children:i}),e[11]=i,e[12]=c):c=e[12];let p;return e[13]!==d||e[14]!==c?(p=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[d,c]}),e[13]=d,e[14]=c,e[15]=p):p=e[15],p}function dr(l){const e=F.c(9),{token:s,value:r}=l;if(s.kind==="space"){let n;return e[0]!==r?(n=t.jsx("span",{className:"flex h-7 w-16 shrink-0 items-center",children:t.jsx("span",{className:"h-1.5 rounded-full bg-primary",style:{width:r,maxWidth:"100%"}})}),e[0]=r,e[1]=n):n=e[1],n}if(s.kind==="radius"){let n;return e[2]!==r?(n=t.jsx("span",{className:"size-7 shrink-0 border border-border bg-muted/50",style:{borderRadius:r}}),e[2]=r,e[3]=n):n=e[3],n}if(s.kind==="shadow"){let n;return e[4]!==r?(n=t.jsx("span",{className:"size-7 shrink-0 rounded-md bg-background",style:{boxShadow:r}}),e[4]=r,e[5]=n):n=e[5],n}if(s.kind==="type"&&/^--brand-text-/.test(s.name)){const n=`min(${r}, 22px)`;let o;return e[6]!==n?(o=t.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center overflow-hidden leading-none text-foreground",style:{fontSize:n},children:"Ag"}),e[6]=n,e[7]=o):o=e[7],o}let u;return e[8]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("span",{className:"size-7 shrink-0"}),e[8]=u):u=e[8],u}function nt(l){const e=F.c(17),{token:s,value:r,editing:u,onEdit:n}=l;let o;e[0]!==s||e[1]!==r?(o=t.jsx(dr,{token:s,value:r}),e[0]=s,e[1]=r,e[2]=o):o=e[2];let d;if(e[3]!==s.name){let h;e[5]===Symbol.for("react.memo_cache_sentinel")?(h=/^--brand-/,e[5]=h):h=e[5],d=s.name.replace(h,""),e[3]=s.name,e[4]=d}else d=e[4];let i;e[6]!==d?(i=t.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:d}),e[6]=d,e[7]=i):i=e[7];let c;e[8]!==u||e[9]!==n||e[10]!==s.name||e[11]!==r?(c=u?t.jsx(ye,{value:r,onChange:h=>n(s.name,h.target.value),className:"h-8 w-40 font-mono text-xs"}):t.jsx("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:r}),e[8]=u,e[9]=n,e[10]=s.name,e[11]=r,e[12]=c):c=e[12];let p;return e[13]!==o||e[14]!==i||e[15]!==c?(p=t.jsxs("div",{className:"flex items-center gap-3",children:[o,i,c]}),e[13]=o,e[14]=i,e[15]=c,e[16]=p):p=e[16],p}function xe(l){const e=F.c(16),{label:s,tokens:r,editing:u,valueOf:n,onEdit:o}=l;if(r.length===0)return null;let d;e[0]!==s?(d=t.jsx(ge,{children:s}),e[0]=s,e[1]=d):d=e[1];let i;if(e[2]!==u||e[3]!==o||e[4]!==r||e[5]!==n){let h;e[7]!==u||e[8]!==o||e[9]!==n?(h=m=>t.jsx(nt,{token:m,value:n(m),editing:u,onEdit:o},m.name),e[7]=u,e[8]=o,e[9]=n,e[10]=h):h=e[10],i=r.map(h),e[2]=u,e[3]=o,e[4]=r,e[5]=n,e[6]=i}else i=e[6];let c;e[11]!==i?(c=t.jsx("div",{className:"flex flex-col gap-2.5",children:i}),e[11]=i,e[12]=c):c=e[12];let p;return e[13]!==d||e[14]!==c?(p=t.jsxs("div",{className:"flex flex-col gap-3",children:[d,c]}),e[13]=d,e[14]=c,e[15]=p):p=e[15],p}function ur({brandPath:l,onClose:e,variant:s}){const r=X(),{org:u}=de(),n=Ze(l),o=n.volume??"",d=n.dirPath,i=M(d),c=n.readOnly,p=Xe(),h=Fe(),m=Dt(o),{upload:w,remove:x}=Ue(o),y=T.useRef(null),C=tt(o,d),D=C.data??[],N=a=>D.some(b=>b.kind==="file"&&M(b.path)===a),k=N("tokens.css"),P=N("brand.md"),g=N("slides-theme.html"),$=Et(D),S=h(o,`${d}/tokens.css`),j=h(o,`${d}/brand.md`),O=h(o,`${d}/slides-theme.html`),V=ke(S,{enabled:k}),Y=ke(j,{enabled:P}),[v,E]=T.useState(!1),[z,G]=T.useState({}),[I,W]=T.useState(null),[U,A]=T.useState(!1),[K,f]=T.useState(!1),[q,se]=T.useState("deck"),Q=V.data?At(V.data):[],ue=a=>Q.find(b=>b.name===a)?.value,B=a=>z[a.name]??a.value,Z=Rt(Q),ae=Q.filter(a=>a.kind==="font"),pe=Q.filter(a=>a.kind==="type"),me=Q.filter(a=>a.kind==="space"),Ee=Q.filter(a=>a.kind==="radius"),Ne=Q.filter(a=>a.kind==="shadow"),le=Q.filter(a=>a.kind==="motion"),Pe=Q.filter(a=>a.kind==="other"),J=(a,b)=>G(R=>({...R,[a]:b})),ne=g&&q==="deck",fe=I??Y.data??"",he=Object.entries(z).filter(([a,b])=>ue(a)!==b),be=I!==null&&I!==(Y.data??""),Ae=he.length>0||be;function Ce(){G({}),W(null),E(!1)}async function Re(){A(!0);try{if(he.length>0){let a=V.data??"";for(const[b,R]of he)a=zt(a,b,R);await m.mutateAsync({path:`${d}/tokens.css`,body:a,contentType:"text/css; charset=utf-8"}),p.invalidateQueries({queryKey:_.fileText(S)})}be&&I!==null&&(await m.mutateAsync({path:`${d}/brand.md`,body:I,contentType:"text/markdown; charset=utf-8"}),p.invalidateQueries({queryKey:_.fileText(j)})),p.invalidateQueries({queryKey:_.orgFsVolume(u.id,o)}),p.invalidateQueries({queryKey:_.orgFsRecent(u.id)}),G({}),W(null),E(!1),L.success(r("library.brandPreview.brandSaved"))}catch(a){L.error(a instanceof Error?a.message:r("library.brandPreview.failedSaveBrand"))}finally{A(!1)}}async function ze(a){const b=a?.[0];if(!b)return;const ie=`logo.${(b.name.split(".").pop()??"png").toLowerCase()}`;try{await w.mutateAsync({dir:d,files:[new File([b],ie,{type:b.type})]}),$&&M($)!==ie&&await x.mutateAsync($),L.success(r("library.brandPreview.logoUpdated"))}catch(Ie){L.error(Ie instanceof Error?Ie.message:r("library.brandPreview.logoUploadFailed"))}finally{y.current&&(y.current.value="")}}const Be=!C.isPending&&!k&&!P&&!$;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[t.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:t.jsx(Je,{size:18})}),s==="dialog"?t.jsx(Ve,{className:"flex-1 truncate text-base font-medium text-foreground",children:i}):t.jsx("span",{className:"flex-1 truncate text-base font-medium text-foreground",children:i}),!c&&(v?t.jsxs(t.Fragment,{children:[t.jsx(H,{variant:"ghost",size:"sm",onClick:Ce,disabled:U,children:r("library.brandPreview.cancel")}),t.jsx(H,{size:"sm",disabled:!Ae||U,onClick:()=>{Re()},children:r(U?"library.brandPreview.saving":"library.brandPreview.save")})]}):t.jsxs(H,{variant:"outline",size:"sm",onClick:()=>E(!0),children:[t.jsx(Qt,{size:14}),r("library.brandPreview.edit")]})),s==="dialog"?t.jsx(Ct,{asChild:!0,children:t.jsx(H,{variant:"ghost",size:"icon",className:"size-8 shrink-0",children:t.jsx(Qe,{size:16})})}):t.jsx(H,{variant:"ghost",size:"icon",className:"size-8 shrink-0",onClick:e,children:t.jsx(Qe,{size:16})})]}),t.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:C.isPending?t.jsxs("div",{className:"flex flex-col gap-3 p-6",children:[t.jsx(te,{className:"h-40 w-full rounded-xl"}),t.jsx(te,{className:"h-4 w-1/3"}),t.jsx(te,{className:"h-4 w-2/3"})]}):Be?t.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:r("library.brandPreview.brandNotAvailable")}):t.jsxs(t.Fragment,{children:[(g||k)&&t.jsxs("div",{className:"shrink-0 border-b border-border",children:[t.jsxs("div",{role:"button",tabIndex:0,"aria-label":r(K?"library.brandPreview.showPreview":"library.brandPreview.hidePreview"),onClick:()=>f(a=>!a),onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),f(b=>!b))},className:"flex cursor-pointer items-center justify-between gap-2 px-4 py-2.5 hover:bg-muted/40",children:[t.jsxs("div",{className:"flex gap-0.5 rounded-lg bg-muted p-0.5 text-xs font-medium",onClick:a=>a.stopPropagation(),children:[g&&t.jsx("button",{type:"button",onClick:()=>{se("deck"),f(!1)},className:De("rounded-md px-2.5 py-1",ne?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:r("library.brandPreview.deck")}),t.jsx("button",{type:"button",onClick:()=>{se("components"),f(!1)},className:De("rounded-md px-2.5 py-1",ne?"text-muted-foreground hover:text-foreground":"bg-background text-foreground shadow-sm"),children:r("library.brandPreview.components")})]}),K?t.jsx(qt,{size:16,className:"shrink-0 text-muted-foreground"}):t.jsx(It,{size:16,className:"shrink-0 text-muted-foreground"})]}),!K&&t.jsx("div",{className:"px-4 pb-4",children:t.jsx("div",{className:De("w-full overflow-hidden rounded-xl border border-border bg-muted/30",ne?"aspect-[16/9]":"h-96"),children:ne?t.jsx(or,{readUrl:O,title:`${i} deck theme`,tokensUrl:S}):t.jsx(ar,{tokensUrl:S})})})]}),t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-8 overflow-y-auto p-6",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(ge,{children:r("library.brandPreview.logo")}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("div",{className:"flex size-24 items-center justify-center overflow-hidden rounded-xl border border-border bg-muted/30",children:$?t.jsx("img",{src:h(o,$),alt:`${i} logo`,className:"max-h-full max-w-full object-contain"}):t.jsx(Je,{size:28,className:"text-muted-foreground/50"})}),v&&t.jsxs("div",{children:[t.jsxs(H,{variant:"outline",size:"sm",disabled:w.isPending,onClick:()=>y.current?.click(),children:[t.jsx($e,{size:14}),r($?"library.brandPreview.replaceLogo":"library.brandPreview.addLogo")]}),t.jsx("input",{ref:y,type:"file",accept:"image/*",className:"hidden",onChange:a=>{ze(a.target.files)}})]})]})]}),Z.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(ge,{children:r("library.brandPreview.colors")}),Z.map(a=>t.jsx(cr,{family:a.family,tokens:a.tokens,editing:v,valueOf:B,onEdit:J},a.family))]}),(ae.length>0||pe.length>0)&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(ge,{children:r("library.brandPreview.typography")}),ae.map(a=>t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:a.name.replace(/^--brand-font-?/,"")||r("library.brandPreview.defaultFont")}),v?t.jsx(ye,{value:B(a),onChange:b=>J(a.name,b.target.value),className:"h-9"}):t.jsx("span",{className:"truncate text-lg text-foreground",style:{fontFamily:B(a)},children:B(a)})]},a.name)),pe.map(a=>t.jsx(nt,{token:a,value:B(a),editing:v,onEdit:J},a.name))]}),t.jsx(xe,{label:r("library.brandPreview.spacing"),tokens:me,editing:v,valueOf:B,onEdit:J}),t.jsx(xe,{label:r("library.brandPreview.radius"),tokens:Ee,editing:v,valueOf:B,onEdit:J}),t.jsx(xe,{label:r("library.brandPreview.shadows"),tokens:Ne,editing:v,valueOf:B,onEdit:J}),t.jsx(xe,{label:r("library.brandPreview.motion"),tokens:le,editing:v,valueOf:B,onEdit:J}),t.jsx(xe,{label:r("library.brandPreview.tokens"),tokens:Pe,editing:v,valueOf:B,onEdit:J}),t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(ge,{children:r("library.brandPreview.voiceGuidelines")}),v?t.jsx(Kt,{value:fe,onChange:a=>W(a.target.value),placeholder:r("library.brandPreview.voicePlaceholder"),className:"min-h-48 font-mono text-sm"}):Y.isPending&&P?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(te,{className:"h-3 w-full"}),t.jsx(te,{className:"h-3 w-5/6"})]}):fe.trim()?t.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:t.jsx(Yt,{id:`brand-preview-${l}`,text:fe})}):t.jsx("p",{className:"text-sm text-muted-foreground",children:r("library.brandPreview.noVoiceYet")})]})]})]})})]})}function it(l){const e=F.c(8),{brandPath:s,onClose:r}=l;let u;e[0]!==r?(u=d=>{d||r()},e[0]=r,e[1]=u):u=e[1];let n;e[2]!==s||e[3]!==r?(n=t.jsx(Le,{className:"flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-2xl!",closeButtonClassName:"hidden",children:t.jsx(ur,{brandPath:s,onClose:r,variant:"dialog"})}),e[2]=s,e[3]=r,e[4]=n):n=e[4];let o;return e[5]!==u||e[6]!==n?(o=t.jsx(Me,{open:!0,onOpenChange:u,children:n}),e[5]=u,e[6]=n,e[7]=o):o=e[7],o}function pr(l){const e=F.c(11),{onOpenDir:s}=l,r=X(),u=Lt();let n;e[0]!==u.data?(n=u.data??[],e[0]=u.data,e[1]=n):n=e[1];let o;if(e[2]!==s||e[3]!==r||e[4]!==n){let i;e[6]!==s||e[7]!==r?(i=c=>t.jsx(Se,{name:c.volume,glyph:_t,tone:"system",readOnly:!0,meta:`${c.repoOwner}/${c.repoName}`,subtitle:c.lastSyncError?r("library.syncedRepos.syncFailed"):c.lastSyncedAt?r("library.syncedRepos.syncedAgo",{ago:st(c.lastSyncedAt)}):r("library.syncedRepos.waitingFirstSync"),onOpen:()=>s(c.volume)},c.id),e[6]=s,e[7]=r,e[8]=i):i=e[8],o=n.map(i),e[2]=s,e[3]=r,e[4]=n,e[5]=o}else o=e[5];let d;return e[9]!==o?(d=t.jsx(t.Fragment,{children:o}),e[9]=o,e[10]=d):d=e[10],d}function Ke(l){return`${window.location.origin}${l}`}function ve(l){if(l.shareMode==="password")return"password";if(l.shareMode==="public"||l.readPublic)return"public";if(l.effectivePublic)return"inherited"}const mr=[je,"uploads","outputs"],ot=[{volume:"uploads",descriptionKey:"library.libraryViews.volumeUploadsDescription",glyph:$e},{volume:"outputs",descriptionKey:"library.libraryViews.volumeOutputsDescription",glyph:Xt}],He=new Set([...ot.map(l=>l.volume),ce("public")]),fr=6;function ct(l,e,s){const r=e.includes("/")?e.slice(0,e.lastIndexOf("/")):"",u=_e(l),n=u?`public/${u}`:l==="home"?we(s):l;return r?`${n}/${r}`:n}function Oe(l,e,s){return{onDragStart:r=>{s.onDragStart?.(l),r.dataTransfer.effectAllowed="move",r.dataTransfer.setData("application/x-studio-library-path",l)},onContextMenu:r=>{r.preventDefault(),s.onContextMenu?.(l,e)},onDrop:s.onDrop?r=>{r.preventDefault();const u=r.dataTransfer.getData("application/x-studio-library-path");u&&u!==l&&!l.startsWith(u+"/")&&s.onDrop(u,l)}:void 0}}function re(l){const e=F.c(2),{children:s}=l;let r;return e[0]!==s?(r=t.jsx("p",{className:"text-[13px] text-foreground",children:s}),e[0]=s,e[1]=r):r=e[1],r}function ee(l){const e=F.c(2),{children:s}=l;let r;return e[0]!==s?(r=t.jsx("div",{className:"@container",children:t.jsx("div",{className:"grid grid-cols-1 gap-3 @[440px]:grid-cols-2 @[660px]:grid-cols-3",children:s})}),e[0]=s,e[1]=r):r=e[1],r}function Te(l){const e=F.c(2),{rows:s}=l,r=s===void 0?1:s;let u;return e[0]!==r?(u=t.jsx(ee,{children:Array.from({length:r*3},hr)}),e[0]=r,e[1]=u):u=e[1],u}function hr(l,e){return t.jsx(te,{className:"h-16 rounded-2xl"},e)}function qe(l){const e=F.c(2),{children:s}=l;let r;return e[0]!==s?(r=t.jsx("p",{className:"text-sm text-muted-foreground",children:s}),e[0]=s,e[1]=r):r=e[1],r}function br(l){const e=F.c(12),{volume:s,descriptionKey:r,glyph:u,onOpen:n}=l,o=X(),d=Tt(s);let i;e[0]!==o||e[1]!==d.data?(i=d.data?o("library.libraryViews.filesCount",{count:d.data.files}):void 0,e[0]=o,e[1]=d.data,e[2]=i):i=e[2];let c;e[3]!==r||e[4]!==o?(c=o(r),e[3]=r,e[4]=o,e[5]=c):c=e[5];let p;return e[6]!==u||e[7]!==n||e[8]!==i||e[9]!==c||e[10]!==s?(p=t.jsx(Se,{name:s,meta:i,subtitle:c,glyph:u,tone:"system",onOpen:n}),e[6]=u,e[7]=n,e[8]=i,e[9]=c,e[10]=s,e[11]=p):p=e[11],p}function xr(l){const e=F.c(12),{onOpenDir:s}=l,r=X(),n=rt().data?.length??0;let o;e[0]!==s?(o=ot.map(p=>t.jsx(br,{volume:p.volume,descriptionKey:p.descriptionKey,glyph:p.glyph,onOpen:()=>s(p.volume)},p.volume)),e[0]=s,e[1]=o):o=e[1];let d;e[2]!==s||e[3]!==n||e[4]!==r?(d=n>0&&t.jsx(Se,{name:ce("public"),meta:r("library.libraryViews.skillSetsCount",{count:n}),subtitle:r("library.libraryViews.curatedSkillSetsReadOnly"),glyph:Zt,tone:"system",readOnly:!0,onOpen:()=>s("public")}),e[2]=s,e[3]=n,e[4]=r,e[5]=d):d=e[5];let i;e[6]!==s?(i=t.jsx(pr,{onOpenDir:s}),e[6]=s,e[7]=i):i=e[7];let c;return e[8]!==o||e[9]!==d||e[10]!==i?(c=t.jsxs(t.Fragment,{children:[o,d,i]}),e[8]=o,e[9]=d,e[10]=i,e[11]=c):c=e[11],c}function gr(l){const e=F.c(19),{segments:s,onNavigate:r}=l,{org:u}=de();let n;e[0]!==s?(n=s[0]===je?s.slice(1):s,e[0]=s,e[1]=n):n=e[1];const o=n,d=s.length-o.length,i=o.length===0;let c;e[2]!==i||e[3]!==r||e[4]!==u.slug?(c=i?t.jsx("span",{className:"truncate font-medium text-foreground",children:we(u.slug)}):t.jsx("button",{type:"button",className:"truncate text-muted-foreground hover:text-foreground hover:underline",onClick:()=>r(je),children:we(u.slug)}),e[2]=i,e[3]=r,e[4]=u.slug,e[5]=c):c=e[5];let p;if(e[6]!==d||e[7]!==r||e[8]!==o||e[9]!==s){let m;e[11]!==d||e[12]!==r||e[13]!==o.length||e[14]!==s?(m=(w,x)=>{const y=s.slice(0,d+x+1).join("/"),C=x===o.length-1;return t.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[t.jsx(Jt,{size:12,className:"shrink-0 text-muted-foreground"}),C?t.jsx("span",{className:"truncate font-medium text-foreground",children:ce(w)}):t.jsx("button",{type:"button",className:"truncate text-muted-foreground hover:text-foreground hover:underline",onClick:()=>r(y),children:ce(w)})]},y)},e[11]=d,e[12]=r,e[13]=o.length,e[14]=s,e[15]=m):m=e[15],p=o.map(m),e[6]=d,e[7]=r,e[8]=o,e[9]=s,e[10]=p}else p=e[10];let h;return e[16]!==c||e[17]!==p?(h=t.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1 text-sm",children:[c,p]}),e[16]=c,e[17]=p,e[18]=h):h=e[18],h}function yr(l){const e=F.c(43),{query:s,scope:r,stale:u,onOpenFile:n,onShare:o,onDelete:d}=l,i=X(),{org:c}=de(),p=Fe(),h=$t(s,r);let m;e[0]!==p||e[1]!==o?(m=S=>o({volume:S.volume,path:S.path,kind:"file",shareMode:S.shareMode??"private",effectivePublic:S.effectivePublic??!1,url:Ke(p(S.volume,S.path))}),e[0]=p,e[1]=o,e[2]=m):m=e[2];const w=m;if(h.isPending){let S;return e[3]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Te,{rows:2}),e[3]=S):S=e[3],S}let x,y,C,D,N;if(e[4]!==s||e[5]!==h.data||e[6]!==h.isPlaceholderData||e[7]!==u||e[8]!==i){N=Symbol.for("react.early_return_sentinel");e:{if(y=h.data??[],y.length===0){let j;e[14]!==s||e[15]!==i?(j=i("library.libraryViews.noFilesMatch",{query:s}),e[14]=s,e[15]=i,e[16]=j):j=e[16];let O;e[17]!==j?(O=t.jsx(qe,{children:j}),e[17]=j,e[18]=O):O=e[18],N=O;break e}const S=(u||h.isPlaceholderData)&&"opacity-50";e[19]!==S?(D=De("flex flex-col gap-3",S),e[19]=S,e[20]=D):D=e[20],x=re,C=i("library.libraryViews.searchResults",{count:y.length})}e[4]=s,e[5]=h.data,e[6]=h.isPlaceholderData,e[7]=u,e[8]=i,e[9]=x,e[10]=y,e[11]=C,e[12]=D,e[13]=N}else x=e[9],y=e[10],C=e[11],D=e[12],N=e[13];if(N!==Symbol.for("react.early_return_sentinel"))return N;let k;e[21]!==x||e[22]!==C?(k=t.jsx(x,{children:C}),e[21]=x,e[22]=C,e[23]=k):k=e[23];let P;if(e[24]!==p||e[25]!==d||e[26]!==n||e[27]!==c||e[28]!==y||e[29]!==w){let S;e[31]!==p||e[32]!==d||e[33]!==n||e[34]!==c||e[35]!==w?(S=j=>{const O=_e(j.volume)!==null;return t.jsx(at,{filename:M(j.path),updatedAt:j.updatedAt,downloadUrl:p(j.volume,j.path),subtitle:ct(j.volume,j.path,c.slug),publicState:ve(j),onOpen:()=>n(et(j.volume,j.path)),onShare:O?void 0:()=>w(j),onDelete:O?void 0:()=>d({volume:j.volume,path:j.path,kind:"file"})},`${j.volume}/${j.path}`)},e[31]=p,e[32]=d,e[33]=n,e[34]=c,e[35]=w,e[36]=S):S=e[36],P=y.map(S),e[24]=p,e[25]=d,e[26]=n,e[27]=c,e[28]=y,e[29]=w,e[30]=P}else P=e[30];let g;e[37]!==P?(g=t.jsx(ee,{children:P}),e[37]=P,e[38]=g):g=e[38];let $;return e[39]!==D||e[40]!==k||e[41]!==g?($=t.jsxs("div",{className:D,children:[k,g]}),e[39]=D,e[40]=k,e[41]=g,e[42]=$):$=e[42],$}function vr(l){const e=F.c(39),{onOpenFile:s,onShare:r,onDelete:u}=l,n=X(),{org:o}=de(),d=Ft(),i=Fe();let c;e[0]!==i||e[1]!==r?(c=N=>r({volume:N.volume,path:N.path,kind:"file",shareMode:N.shareMode??"private",effectivePublic:N.effectivePublic??!1,url:Ke(i(N.volume,N.path))}),e[0]=i,e[1]=r,e[2]=c):c=e[2];const p=c;if(d.isPending){let N;e[3]!==n?(N=n("library.libraryViews.recentlyAdded"),e[3]=n,e[4]=N):N=e[4];let k;e[5]!==N?(k=t.jsx(re,{children:N}),e[5]=N,e[6]=k):k=e[6];let P;e[7]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Te,{}),e[7]=P):P=e[7];let g;return e[8]!==k?(g=t.jsxs("div",{className:"flex flex-col gap-3",children:[k,P]}),e[8]=k,e[9]=g):g=e[9],g}let h,m,w,x,y;if(e[10]!==i||e[11]!==u||e[12]!==s||e[13]!==o||e[14]!==d.data||e[15]!==p||e[16]!==n){y=Symbol.for("react.early_return_sentinel");e:{const N=(d.data??[]).slice(0,fr);if(N.length===0){y=null;break e}w="flex flex-col gap-3";let k;e[22]!==n?(k=n("library.libraryViews.recentlyAdded"),e[22]=n,e[23]=k):k=e[23],e[24]!==k?(x=t.jsx(re,{children:k}),e[24]=k,e[25]=x):x=e[25],h=ee;let P;e[26]!==i||e[27]!==u||e[28]!==s||e[29]!==o||e[30]!==p?(P=g=>t.jsx(Ut,{filename:M(g.path),updatedAt:g.updatedAt,size:g.size,downloadUrl:i(g.volume,g.path),subtitle:ct(g.volume,g.path,o.slug),publicState:ve(g),onOpen:()=>s(et(g.volume,g.path)),onShare:()=>p(g),onDelete:()=>u({volume:g.volume,path:g.path,kind:"file"})},`${g.volume}/${g.path}`),e[26]=i,e[27]=u,e[28]=s,e[29]=o,e[30]=p,e[31]=P):P=e[31],m=N.map(P)}e[10]=i,e[11]=u,e[12]=s,e[13]=o,e[14]=d.data,e[15]=p,e[16]=n,e[17]=h,e[18]=m,e[19]=w,e[20]=x,e[21]=y}else h=e[17],m=e[18],w=e[19],x=e[20],y=e[21];if(y!==Symbol.for("react.early_return_sentinel"))return y;let C;e[32]!==h||e[33]!==m?(C=t.jsx(h,{children:m}),e[32]=h,e[33]=m,e[34]=C):C=e[34];let D;return e[35]!==w||e[36]!==x||e[37]!==C?(D=t.jsxs("div",{className:w,children:[x,C]}),e[35]=w,e[36]=x,e[37]=C,e[38]=D):D=e[38],D}function jr(l){const e=F.c(16),{onOpenDir:s}=l,r=X(),u=rt();if(u.isPending){let c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Te,{}),e[0]=c):c=e[0],c}let n;e[1]!==u.data?(n=u.data??[],e[1]=u.data,e[2]=n):n=e[2];const o=n;if(o.length===0){let c;e[3]!==r?(c=r("library.libraryViews.noPublicSkillSetsConfigured"),e[3]=r,e[4]=c):c=e[4];let p;return e[5]!==c?(p=t.jsx(qe,{children:c}),e[5]=c,e[6]=p):p=e[6],p}let d;if(e[7]!==s||e[8]!==o||e[9]!==r){let c;e[11]!==s||e[12]!==r?(c=p=>t.jsx(Se,{name:p,subtitle:r("library.libraryViews.readOnly"),readOnly:!0,onOpen:()=>s(`public/${p}`)},p),e[11]=s,e[12]=r,e[13]=c):c=e[13],d=o.map(c),e[7]=s,e[8]=o,e[9]=r,e[10]=d}else d=e[10];let i;return e[14]!==d?(i=t.jsx(ee,{children:d}),e[14]=d,e[15]=i):i=e[15],i}function wr(l){const e=F.c(63),{location:s,onOpenDir:r,onOpenFile:u,onOpenSkill:n,onOpenBrand:o,onShare:d,onDelete:i,onDragStart:c,onContextMenu:p,onMove:h}=l,m=X(),{org:w}=de(),x=s.volume??"",y=tt(x,s.dirPath),C=Fe();let D;e[0]!==s.isHomeRoot||e[1]!==w?(D=v=>s.isHomeRoot&&He.has(v.toLowerCase())?`${we(w.slug)}/${v}`:void 0,e[0]=s.isHomeRoot,e[1]=w,e[2]=D):D=e[2];const N=D;let k;e[3]!==s.isHomeRoot||e[4]!==r?(k=s.isHomeRoot?t.jsx(xr,{onOpenDir:r}):null,e[3]=s.isHomeRoot,e[4]=r,e[5]=k):k=e[5];const P=k;if(y.isPending){let v;e[6]!==P||e[7]!==m?(v=P&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(re,{children:m("library.libraryViews.folders")}),t.jsx(ee,{children:P})]}),e[6]=P,e[7]=m,e[8]=v):v=e[8];let E;e[9]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(Te,{rows:2}),e[9]=E):E=e[9];let z;return e[10]!==v?(z=t.jsxs(t.Fragment,{children:[v,E]}),e[10]=v,e[11]=z):z=e[11],z}if(y.isError){let v;e[12]!==y.error||e[13]!==m?(v=y.error instanceof Error?y.error.message:m("library.libraryViews.failedToLoad"),e[12]=y.error,e[13]=m,e[14]=v):v=e[14];let E;return e[15]!==v?(E=t.jsx("p",{className:"text-sm text-destructive",children:v}),e[15]=v,e[16]=E):E=e[16],E}let g,$,S,j,O;if(e[17]!==N||e[18]!==C||e[19]!==y.data||e[20]!==s||e[21]!==p||e[22]!==i||e[23]!==c||e[24]!==h||e[25]!==o||e[26]!==r||e[27]!==u||e[28]!==n||e[29]!==d||e[30]!==P||e[31]!==m||e[32]!==x){O=Symbol.for("react.early_return_sentinel");e:{const v=y.data??[],E=v.filter(Pr),z=v.filter(Nr),G=v.filter(Sr),I=v.filter(kr);if(v.length===0&&!s.isHomeRoot){let f;e[38]!==s.readOnly||e[39]!==m?(f=s.readOnly?m("library.libraryViews.emptyReadOnlySet"):m("library.libraryViews.emptyFolder"),e[38]=s.readOnly,e[39]=m,e[40]=f):f=e[40];let q;e[41]!==f?(q=t.jsx(qe,{children:f}),e[41]=f,e[42]=q):q=e[42],O=q;break e}let W;e[43]!==s.readOnly||e[44]!==i||e[45]!==x?(W=f=>s.readOnly?void 0:()=>i({volume:x,path:f.path,kind:f.kind}),e[43]=s.readOnly,e[44]=i,e[45]=x,e[46]=W):W=e[46];const U=W;let A;e[47]!==C||e[48]!==s.readOnly||e[49]!==d||e[50]!==x?(A=f=>s.readOnly?void 0:()=>d({volume:x,path:f.path,kind:f.kind,shareMode:f.shareMode??"private",effectivePublic:f.effectivePublic??!1,url:f.kind==="file"?Ke(C(x,f.path)):void 0}),e[47]=C,e[48]=s.readOnly,e[49]=d,e[50]=x,e[51]=A):A=e[51];const K=A;g=E.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(re,{children:m("library.libraryViews.skills")}),t.jsx(ee,{children:E.map(f=>t.jsx(Mt,{dirName:M(f.path),updatedAt:f.updatedAt,skillMdUrl:C(x,`${f.path}/SKILL.md`),publicState:ve(f),onOpen:()=>n(oe(s,f.path)),onBrowse:()=>r(oe(s,f.path)),onShare:K(f),onDelete:U(f),draggable:!s.readOnly,...Oe(f.path,"dir",{onDragStart:c,onContextMenu:p})},f.path))})]}),$=z.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(re,{children:m("library.libraryViews.brands")}),t.jsx(ee,{children:z.map(f=>t.jsx(Vt,{dirName:M(f.path),updatedAt:f.updatedAt,tokensUrl:C(x,`${f.path}/tokens.css`),onOpen:()=>o(oe(s,f.path)),onBrowse:()=>r(oe(s,f.path)),onDelete:U(f),draggable:!s.readOnly,...Oe(f.path,"dir",{onDragStart:c,onContextMenu:p})},f.path))})]}),S=(G.length>0||P)&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(re,{children:m("library.libraryViews.folders")}),t.jsxs(ee,{children:[P,G.map(f=>t.jsx(Se,{name:M(f.path),meta:st(f.updatedAt),subtitle:N(M(f.path)),readOnly:s.readOnly,publicState:ve(f),onOpen:()=>r(oe(s,f.path)),onShare:K(f),onDelete:U(f),draggable:!s.readOnly,...Oe(f.path,"dir",{onDragStart:c,onContextMenu:p,onDrop:h})},f.path))]})]}),j=I.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(re,{children:m("library.libraryViews.files")}),t.jsx(ee,{children:I.map(f=>t.jsx(at,{filename:M(f.path),updatedAt:f.updatedAt,downloadUrl:C(x,f.path),publicState:ve(f),onOpen:()=>u(oe(s,f.path)),onShare:K(f),onDelete:U(f),draggable:!s.readOnly,...Oe(f.path,"file",{onDragStart:c,onContextMenu:p})},f.path))})]})}e[17]=N,e[18]=C,e[19]=y.data,e[20]=s,e[21]=p,e[22]=i,e[23]=c,e[24]=h,e[25]=o,e[26]=r,e[27]=u,e[28]=n,e[29]=d,e[30]=P,e[31]=m,e[32]=x,e[33]=g,e[34]=$,e[35]=S,e[36]=j,e[37]=O}else g=e[33],$=e[34],S=e[35],j=e[36],O=e[37];if(O!==Symbol.for("react.early_return_sentinel"))return O;let V;e[52]!==s.isHomeRoot||e[53]!==i||e[54]!==u||e[55]!==d?(V=s.isHomeRoot&&t.jsx(vr,{onOpenFile:u,onShare:d,onDelete:i}),e[52]=s.isHomeRoot,e[53]=i,e[54]=u,e[55]=d,e[56]=V):V=e[56];let Y;return e[57]!==g||e[58]!==$||e[59]!==S||e[60]!==j||e[61]!==V?(Y=t.jsxs(t.Fragment,{children:[g,$,S,j,V]}),e[57]=g,e[58]=$,e[59]=S,e[60]=j,e[61]=V,e[62]=Y):Y=e[62],Y}function kr(l){return l.kind==="file"}function Sr(l){return l.kind==="dir"&&!l.hasSkill&&!l.hasBrand}function Nr(l){return l.kind==="dir"&&l.hasBrand&&!l.hasSkill}function Pr(l){return l.kind==="dir"&&l.hasSkill}function Cr({onOpenFile:l,onOpenSkill:e,onOpenBrand:s}={}){const r=X(),{org:u}=de(),n=Xe(),o=dt(),d=ut(),i=pt({strict:!1}),c=i.path||je,p=Ze(c),h=Ht(),m=p.volume!==null&&h.has(p.volume)?{...p,readOnly:!0}:p,w=(a,b)=>o({to:".",search:R=>({...R,[a]:b||void 0})}),x=a=>w("path",a),y=(a,b)=>o({to:".",search:R=>({...R,preview:void 0,skill:void 0,brand:void 0,[a]:b})}),C=l??(a=>y("preview",a)),D=e??(a=>y("skill",a)),N=s??(a=>y("brand",a)),[k,P]=T.useState(""),g=Ot(k.trim(),300),$=!m.isHomeRoot&&m.volume!==null?{volume:m.volume,prefix:m.dirPath}:void 0,S=$?r("library.library.searchInPlaceholder",{folder:ce(m.segments.at(-1)??"")}):r("library.library.searchPlaceholder"),j=m.isHomeRoot?we(u.slug):ce(m.segments.at(-1)??""),[O,V]=T.useState(null),[Y,v]=T.useState(null),[E,z]=T.useState(!1),[G,I]=T.useState(""),[W,U]=T.useState(!1),[A,K]=T.useState(null),[f,q]=T.useState(""),se=T.useRef(null),[Q,ue]=T.useState(!1),B=T.useRef(0),Z=m.readOnly?null:m.volume,{upload:ae,mkdir:pe,move:me}=Ue(Z??je),{remove:Ee}=Ue(O?.volume??"uploads");async function Ne(a){if(!(!Z||!a||a.length===0))try{await ae.mutateAsync({dir:m.dirPath,files:[...a]}),L.success(a.length===1?r("library.library.uploadedSingle",{filename:a[0]?.name??""}):r("library.library.uploadedMultiple",{count:a.length}))}catch(b){L.error(b instanceof Error?b.message:r("library.library.uploadFailed"))}finally{se.current&&(se.current.value="")}}const le=Z!==null;function Pe(a){return a.dataTransfer.types.includes("Files")}function J(a){!le||!Pe(a)||(a.preventDefault(),B.current+=1,ue(!0))}function ne(a){!le||!Pe(a)||a.preventDefault()}function fe(){le&&(B.current=Math.max(0,B.current-1),B.current===0&&ue(!1))}function he(a){le&&(a.preventDefault(),a.stopPropagation(),B.current=0,ue(!1),a.dataTransfer.files.length>0&&Ne(a.dataTransfer.files))}async function be(){const a=G.trim();if(!(!Z||!a)){if(m.isHomeRoot&&He.has(a.toLowerCase())){L.error(r("library.library.folderNameReserved",{name:a}));return}try{const b=m.dirPath;await pe.mutateAsync(b?`${b}/${a}`:a),L.success(r("library.library.folderCreated",{name:a})),z(!1),I("")}catch(b){L.error(b instanceof Error?b.message:r("library.library.folderCreateFailed"))}}}async function Ae(){if(!O)return;const a=O;try{await Ee.mutateAsync(a.path),L.success(r("library.library.deleted",{name:M(a.path)}))}catch(b){L.error(b instanceof Error?b.message:r("library.library.deleteFailed"))}finally{V(null)}}async function Ce(){if(!A)return;const a=f.trim();if(!a||a.includes("/")||a.includes("..")||a===M(A.path)){U(!1),K(null),q("");return}if(A.kind==="dir"&&m.isHomeRoot&&He.has(a.toLowerCase())){L.error(r("library.library.folderNameReserved",{name:a}));return}try{const b=A.path.includes("/")?A.path.slice(0,A.path.lastIndexOf("/")):"",R=b?`${b}/${a}`:a;await me.mutateAsync({from:A.path,to:R});const ie=a.replace(/[<>]/g,"");L.success(r("library.library.renamed",{name:ie}))}catch(b){L.error(b instanceof Error?b.message:r("library.library.renameFailed"))}finally{U(!1),K(null),q("")}}async function Re(a,b){try{const R=M(a),ie=b?`${b}/${R}`:R;await me.mutateAsync({from:a,to:ie}),L.success(r("library.library.moved",{name:R,destination:b||r("library.library.theLibrary")}))}catch(R){L.error(R instanceof Error?R.message:r("library.library.moveFailed"))}}function ze(){for(const a of mr)n.invalidateQueries({queryKey:_.orgFsVolume(u.id,a)});m.volume&&n.invalidateQueries({queryKey:_.orgFsVolume(u.id,m.volume)}),n.invalidateQueries({queryKey:_.orgFsRecent(u.id)}),n.invalidateQueries({queryKey:_.orgFsSearchRoot(u.id)}),n.invalidateQueries({queryKey:_.orgFsPublicSets(u.id)})}function Be(a){a.defaultPrevented||!Z||a.target.closest("input, textarea, button, a, [role='button']")||(a.preventDefault(),z(!0))}return t.jsxs("div",{className:"relative h-full",onDragEnter:J,onDragOver:ne,onDragLeave:fe,onDrop:he,onContextMenu:Be,children:[Q&&t.jsx("div",{className:"pointer-events-none absolute inset-0 z-20 flex items-center justify-center bg-background/80 p-6 backdrop-blur-sm",children:t.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-2xl border-2 border-dashed border-primary px-10 py-8 text-center",children:[t.jsx($e,{size:28,className:"text-primary"}),t.jsx("p",{className:"text-sm font-medium text-foreground",children:r("library.library.dropToUpload",{location:j})})]})}),t.jsx("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-wrap items-center gap-2",children:[t.jsx("div",{className:"min-w-0 flex-1 basis-full sm:basis-auto",children:t.jsx(gr,{segments:m.segments,onNavigate:x})}),t.jsxs("div",{className:"relative w-full shrink-0 sm:w-56",children:[t.jsx(xt,{size:16,className:"pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 text-muted-foreground"}),t.jsx(ye,{value:k,onChange:a=>P(a.target.value),onKeyDown:a=>{a.key==="Escape"&&P("")},placeholder:S,className:"h-9 rounded-xl pr-9 pl-9"}),k&&t.jsx(H,{variant:"ghost",size:"icon",className:"absolute top-1/2 right-1.5 size-7 -translate-y-1/2",onClick:()=>P(""),"aria-label":r("library.library.clearSearch"),children:t.jsx(gt,{size:14})})]}),t.jsx(H,{variant:"ghost",size:"icon",onClick:ze,"aria-label":r("library.library.refresh"),children:t.jsx(mt,{size:14})}),Z&&t.jsxs(H,{variant:"outline",size:"sm",onClick:()=>z(!0),children:[t.jsx(bt,{size:14}),r("library.library.newFolder")]}),m.readOnly?t.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[t.jsx(ht,{size:12}),r("library.library.readOnly")]}):t.jsxs(H,{size:"sm",disabled:ae.isPending,onClick:()=>se.current?.click(),children:[t.jsx($e,{size:14}),ae.isPending?r("library.library.uploading"):r("library.library.uploadFile")]}),t.jsx("input",{ref:se,type:"file",multiple:!0,className:"hidden",onChange:a=>{Ne(a.target.files)}})]}),g?t.jsx(yr,{query:g,scope:$,stale:k.trim()!==g,onOpenFile:C,onShare:v,onDelete:V}):m.volume===null?t.jsx(jr,{onOpenDir:x}):t.jsx(wr,{location:m,onOpenDir:x,onOpenFile:C,onOpenSkill:D,onOpenBrand:N,onShare:v,onDelete:V,onContextMenu:(a,b)=>{K({path:a,kind:b}),q(M(a)),U(!0)},onMove:Re},m.volume)]})}),d&&(i.preview?t.jsx(Wt,{previewPath:i.preview,onClose:()=>w("preview",null)}):i.skill?t.jsx(lt,{skillPath:i.skill,onClose:()=>w("skill",null)},i.skill):i.brand?t.jsx(it,{brandPath:i.brand,onClose:()=>w("brand",null)},i.brand):null),t.jsx(Me,{open:E,onOpenChange:z,children:t.jsxs(Le,{children:[t.jsxs(Ye,{children:[t.jsx(Ve,{children:r("library.library.newFolderTitle")}),t.jsx(Ge,{children:r("library.library.newFolderDescription",{path:j||r("library.library.theLibrary")})})]}),t.jsx(ye,{autoFocus:!0,placeholder:r("library.library.folderNamePlaceholder"),value:G,onChange:a=>I(a.target.value),onKeyDown:a=>{a.key==="Enter"&&be()}}),t.jsxs(We,{children:[t.jsx(H,{variant:"outline",onClick:()=>z(!1),children:r("library.library.cancel")}),t.jsx(H,{disabled:!G.trim()||pe.isPending,onClick:()=>{be()},children:r("library.library.create")})]})]})}),t.jsx(Me,{open:W,onOpenChange:a=>{U(a),a||(K(null),q(""))},children:t.jsxs(Le,{children:[t.jsxs(Ye,{children:[t.jsx(Ve,{children:A&&r("library.library.renameTitle",{name:M(A.path)})}),t.jsx(Ge,{children:r("library.library.renameDescription")})]}),t.jsx(ye,{autoFocus:!0,value:f,onChange:a=>q(a.target.value),onKeyDown:a=>{a.key==="Enter"&&Ce()}}),t.jsxs(We,{children:[t.jsx(H,{variant:"outline",onClick:()=>U(!1),children:r("library.library.cancel")}),t.jsx(H,{disabled:!f.trim()||me.isPending,onClick:()=>{Ce()},children:r("library.library.rename")})]})]})}),t.jsx(Gt,{target:Y,onOpenChange:a=>{a||v(null)}}),t.jsx(yt,{open:O!==null,onOpenChange:a=>{a||V(null)},children:t.jsxs(vt,{children:[t.jsxs(jt,{children:[t.jsx(wt,{children:r("library.library.deleteTitle",{name:O?M(O.path):""})}),t.jsx(kt,{children:O?.kind==="dir"?r("library.library.deleteDirectoryDescription"):r("library.library.deleteFileDescription")})]}),t.jsxs(St,{children:[t.jsx(Nt,{children:r("library.library.cancel")}),t.jsx(Pt,{onClick:()=>{Ae()},children:r("library.library.delete")})]})]})})]})}function Or(){const l=F.c(10),{openPanel:e}=er(),[s,r]=T.useState(null),[u,n]=T.useState(null);let o;l[0]!==e?(o=t.jsx(Cr,{onOpenFile:p=>e(ft(p)),onOpenSkill:r,onOpenBrand:n}),l[0]=e,l[1]=o):o=l[1];let d;l[2]!==s?(d=s&&t.jsx(lt,{skillPath:s,onClose:()=>r(null)},s),l[2]=s,l[3]=d):d=l[3];let i;l[4]!==u?(i=u&&t.jsx(it,{brandPath:u,onClose:()=>n(null)},u),l[4]=u,l[5]=i):i=l[5];let c;return l[6]!==o||l[7]!==d||l[8]!==i?(c=t.jsxs("div",{className:"flex flex-col h-full min-h-0 overflow-hidden",children:[o,d,i]}),l[6]=o,l[7]=d,l[8]=i,l[9]=c):c=l[9],c}function Os(){const l=F.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Or,{}),l[0]=e):e=l[0],e}export{Os as default};
|
|
161
|
+
`);function or(l,e){const s=e?`<style>${e}</style>`:"";return l.replaceAll("{{{slides}}}",ir).replaceAll("{{title}}",nr).replace(/(src=")(\/deck-runtime\/)/g,`$1${window.location.origin}$2`).replace("</head>",`${s}</head>`)}function cr(l){const e=F.c(8),{readUrl:s,title:r,tokensUrl:u}=l,n=ke(s),o=ke(u??"");if(n.isPending||u&&o.isPending){let p;return e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full w-full items-center justify-center p-6",children:t.jsx(te,{className:"aspect-[16/9] w-full max-w-3xl rounded-xl"})}),e[0]=p):p=e[0],p}if(n.isError||!n.data){let p;return e[1]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"This theme is no longer available."}),e[1]=p):p=e[1],p}const d=o.data??null;let i;e[2]!==d||e[3]!==n.data?(i=or(n.data,d),e[2]=d,e[3]=n.data,e[4]=i):i=e[4];let c;return e[5]!==i||e[6]!==r?(c=t.jsx("iframe",{title:r,srcDoc:i,sandbox:"allow-scripts",className:"block h-full w-full border-0 bg-white"}),e[5]=i,e[6]=r,e[7]=c):c=e[7],c}function ge(l){const e=F.c(2),{children:s}=l;let r;return e[0]!==s?(r=t.jsx("p",{className:"text-sm font-medium text-foreground",children:s}),e[0]=s,e[1]=r):r=e[1],r}function dr(l){const e=F.c(16),{family:s,tokens:r,editing:u,valueOf:n,onEdit:o}=l;let d;e[0]!==s?(d=t.jsx("span",{className:"text-xs text-muted-foreground",children:s}),e[0]=s,e[1]=d):d=e[1];let i;if(e[2]!==u||e[3]!==o||e[4]!==r||e[5]!==n){let h;e[7]!==u||e[8]!==o||e[9]!==n?(h=m=>{const w=n(m),x=`${m.name.replace(/^--brand-/,"")}: ${w}`;return u&&/^#/.test(w)?t.jsx("input",{type:"color","aria-label":m.name,title:x,value:Lt(w),onChange:y=>o(m.name,y.target.value),className:"size-7 cursor-pointer rounded-md border border-border/60 bg-transparent p-0.5"},m.name):t.jsx("span",{title:x,className:"size-7 rounded-md border border-border/60",style:{backgroundColor:w}},m.name)},e[7]=u,e[8]=o,e[9]=n,e[10]=h):h=e[10],i=r.map(h),e[2]=u,e[3]=o,e[4]=r,e[5]=n,e[6]=i}else i=e[6];let c;e[11]!==i?(c=t.jsx("div",{className:"flex flex-wrap gap-1",children:i}),e[11]=i,e[12]=c):c=e[12];let p;return e[13]!==d||e[14]!==c?(p=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[d,c]}),e[13]=d,e[14]=c,e[15]=p):p=e[15],p}function ur(l){const e=F.c(9),{token:s,value:r}=l;if(s.kind==="space"){let n;return e[0]!==r?(n=t.jsx("span",{className:"flex h-7 w-16 shrink-0 items-center",children:t.jsx("span",{className:"h-1.5 rounded-full bg-primary",style:{width:r,maxWidth:"100%"}})}),e[0]=r,e[1]=n):n=e[1],n}if(s.kind==="radius"){let n;return e[2]!==r?(n=t.jsx("span",{className:"size-7 shrink-0 border border-border bg-muted/50",style:{borderRadius:r}}),e[2]=r,e[3]=n):n=e[3],n}if(s.kind==="shadow"){let n;return e[4]!==r?(n=t.jsx("span",{className:"size-7 shrink-0 rounded-md bg-background",style:{boxShadow:r}}),e[4]=r,e[5]=n):n=e[5],n}if(s.kind==="type"&&/^--brand-text-/.test(s.name)){const n=`min(${r}, 22px)`;let o;return e[6]!==n?(o=t.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center overflow-hidden leading-none text-foreground",style:{fontSize:n},children:"Ag"}),e[6]=n,e[7]=o):o=e[7],o}let u;return e[8]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("span",{className:"size-7 shrink-0"}),e[8]=u):u=e[8],u}function nt(l){const e=F.c(17),{token:s,value:r,editing:u,onEdit:n}=l;let o;e[0]!==s||e[1]!==r?(o=t.jsx(ur,{token:s,value:r}),e[0]=s,e[1]=r,e[2]=o):o=e[2];let d;if(e[3]!==s.name){let h;e[5]===Symbol.for("react.memo_cache_sentinel")?(h=/^--brand-/,e[5]=h):h=e[5],d=s.name.replace(h,""),e[3]=s.name,e[4]=d}else d=e[4];let i;e[6]!==d?(i=t.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:d}),e[6]=d,e[7]=i):i=e[7];let c;e[8]!==u||e[9]!==n||e[10]!==s.name||e[11]!==r?(c=u?t.jsx(ye,{value:r,onChange:h=>n(s.name,h.target.value),className:"h-8 w-40 font-mono text-xs"}):t.jsx("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:r}),e[8]=u,e[9]=n,e[10]=s.name,e[11]=r,e[12]=c):c=e[12];let p;return e[13]!==o||e[14]!==i||e[15]!==c?(p=t.jsxs("div",{className:"flex items-center gap-3",children:[o,i,c]}),e[13]=o,e[14]=i,e[15]=c,e[16]=p):p=e[16],p}function xe(l){const e=F.c(16),{label:s,tokens:r,editing:u,valueOf:n,onEdit:o}=l;if(r.length===0)return null;let d;e[0]!==s?(d=t.jsx(ge,{children:s}),e[0]=s,e[1]=d):d=e[1];let i;if(e[2]!==u||e[3]!==o||e[4]!==r||e[5]!==n){let h;e[7]!==u||e[8]!==o||e[9]!==n?(h=m=>t.jsx(nt,{token:m,value:n(m),editing:u,onEdit:o},m.name),e[7]=u,e[8]=o,e[9]=n,e[10]=h):h=e[10],i=r.map(h),e[2]=u,e[3]=o,e[4]=r,e[5]=n,e[6]=i}else i=e[6];let c;e[11]!==i?(c=t.jsx("div",{className:"flex flex-col gap-2.5",children:i}),e[11]=i,e[12]=c):c=e[12];let p;return e[13]!==d||e[14]!==c?(p=t.jsxs("div",{className:"flex flex-col gap-3",children:[d,c]}),e[13]=d,e[14]=c,e[15]=p):p=e[15],p}function pr({brandPath:l,onClose:e,variant:s}){const r=X(),{org:u}=de(),n=Ze(l),o=n.volume??"",d=n.dirPath,i=M(d),c=n.readOnly,p=Xe(),h=Fe(),m=$t(o),{upload:w,remove:x}=Ue(o),y=T.useRef(null),C=tt(o,d),D=C.data??[],N=a=>D.some(b=>b.kind==="file"&&M(b.path)===a),k=N("tokens.css"),P=N("brand.md"),g=N("slides-theme.html"),$=At(D),S=h(o,`${d}/tokens.css`),j=h(o,`${d}/brand.md`),O=h(o,`${d}/slides-theme.html`),V=ke(S,{enabled:k}),Y=ke(j,{enabled:P}),[v,E]=T.useState(!1),[z,G]=T.useState({}),[I,W]=T.useState(null),[U,A]=T.useState(!1),[K,f]=T.useState(!1),[q,se]=T.useState("deck"),Q=V.data?Rt(V.data):[],ue=a=>Q.find(b=>b.name===a)?.value,B=a=>z[a.name]??a.value,Z=zt(Q),ae=Q.filter(a=>a.kind==="font"),pe=Q.filter(a=>a.kind==="type"),me=Q.filter(a=>a.kind==="space"),Ee=Q.filter(a=>a.kind==="radius"),Ne=Q.filter(a=>a.kind==="shadow"),le=Q.filter(a=>a.kind==="motion"),Pe=Q.filter(a=>a.kind==="other"),J=(a,b)=>G(R=>({...R,[a]:b})),ne=g&&q==="deck",fe=I??Y.data??"",he=Object.entries(z).filter(([a,b])=>ue(a)!==b),be=I!==null&&I!==(Y.data??""),Ae=he.length>0||be;function Ce(){G({}),W(null),E(!1)}async function Re(){A(!0);try{if(he.length>0){let a=V.data??"";for(const[b,R]of he)a=Bt(a,b,R);await m.mutateAsync({path:`${d}/tokens.css`,body:a,contentType:"text/css; charset=utf-8"}),p.invalidateQueries({queryKey:_.fileText(S)})}be&&I!==null&&(await m.mutateAsync({path:`${d}/brand.md`,body:I,contentType:"text/markdown; charset=utf-8"}),p.invalidateQueries({queryKey:_.fileText(j)})),p.invalidateQueries({queryKey:_.orgFsVolume(u.id,o)}),p.invalidateQueries({queryKey:_.orgFsRecent(u.id)}),G({}),W(null),E(!1),L.success(r("library.brandPreview.brandSaved"))}catch(a){L.error(a instanceof Error?a.message:r("library.brandPreview.failedSaveBrand"))}finally{A(!1)}}async function ze(a){const b=a?.[0];if(!b)return;const ie=`logo.${(b.name.split(".").pop()??"png").toLowerCase()}`;try{await w.mutateAsync({dir:d,files:[new File([b],ie,{type:b.type})]}),$&&M($)!==ie&&await x.mutateAsync($),L.success(r("library.brandPreview.logoUpdated"))}catch(Ie){L.error(Ie instanceof Error?Ie.message:r("library.brandPreview.logoUploadFailed"))}finally{y.current&&(y.current.value="")}}const Be=!C.isPending&&!k&&!P&&!$;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[t.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:t.jsx(We,{size:18})}),s==="dialog"?t.jsx(Ve,{className:"flex-1 truncate text-base font-medium text-foreground",children:i}):t.jsx("span",{className:"flex-1 truncate text-base font-medium text-foreground",children:i}),!c&&(v?t.jsxs(t.Fragment,{children:[t.jsx(H,{variant:"ghost",size:"sm",onClick:Ce,disabled:U,children:r("library.brandPreview.cancel")}),t.jsx(H,{size:"sm",disabled:!Ae||U,onClick:()=>{Re()},children:r(U?"library.brandPreview.saving":"library.brandPreview.save")})]}):t.jsxs(H,{variant:"outline",size:"sm",onClick:()=>E(!0),children:[t.jsx(Yt,{size:14}),r("library.brandPreview.edit")]})),s==="dialog"?t.jsx(Ot,{asChild:!0,children:t.jsx(H,{variant:"ghost",size:"icon",className:"size-8 shrink-0",children:t.jsx(Je,{size:16})})}):t.jsx(H,{variant:"ghost",size:"icon",className:"size-8 shrink-0",onClick:e,children:t.jsx(Je,{size:16})})]}),t.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:C.isPending?t.jsxs("div",{className:"flex flex-col gap-3 p-6",children:[t.jsx(te,{className:"h-40 w-full rounded-xl"}),t.jsx(te,{className:"h-4 w-1/3"}),t.jsx(te,{className:"h-4 w-2/3"})]}):Be?t.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:r("library.brandPreview.brandNotAvailable")}):t.jsxs(t.Fragment,{children:[(g||k)&&t.jsxs("div",{className:"shrink-0 border-b border-border",children:[t.jsxs("div",{role:"button",tabIndex:0,"aria-label":r(K?"library.brandPreview.showPreview":"library.brandPreview.hidePreview"),onClick:()=>f(a=>!a),onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),f(b=>!b))},className:"flex cursor-pointer items-center justify-between gap-2 px-4 py-2.5 hover:bg-muted/40",children:[t.jsxs("div",{className:"flex gap-0.5 rounded-lg bg-muted p-0.5 text-xs font-medium",onClick:a=>a.stopPropagation(),children:[g&&t.jsx("button",{type:"button",onClick:()=>{se("deck"),f(!1)},className:De("rounded-md px-2.5 py-1",ne?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:r("library.brandPreview.deck")}),t.jsx("button",{type:"button",onClick:()=>{se("components"),f(!1)},className:De("rounded-md px-2.5 py-1",ne?"text-muted-foreground hover:text-foreground":"bg-background text-foreground shadow-sm"),children:r("library.brandPreview.components")})]}),K?t.jsx(It,{size:16,className:"shrink-0 text-muted-foreground"}):t.jsx(Qt,{size:16,className:"shrink-0 text-muted-foreground"})]}),!K&&t.jsx("div",{className:"px-4 pb-4",children:t.jsx("div",{className:De("w-full overflow-hidden rounded-xl border border-border bg-muted/30",ne?"aspect-[16/9]":"h-96"),children:ne?t.jsx(cr,{readUrl:O,title:`${i} deck theme`,tokensUrl:S}):t.jsx(lr,{tokensUrl:S})})})]}),t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-8 overflow-y-auto p-6",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(ge,{children:r("library.brandPreview.logo")}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("div",{className:"flex size-24 items-center justify-center overflow-hidden rounded-xl border border-border bg-muted/30",children:$?t.jsx("img",{src:h(o,$),alt:`${i} logo`,className:"max-h-full max-w-full object-contain"}):t.jsx(We,{size:28,className:"text-muted-foreground/50"})}),v&&t.jsxs("div",{children:[t.jsxs(H,{variant:"outline",size:"sm",disabled:w.isPending,onClick:()=>y.current?.click(),children:[t.jsx($e,{size:14}),r($?"library.brandPreview.replaceLogo":"library.brandPreview.addLogo")]}),t.jsx("input",{ref:y,type:"file",accept:"image/*",className:"hidden",onChange:a=>{ze(a.target.files)}})]})]})]}),Z.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(ge,{children:r("library.brandPreview.colors")}),Z.map(a=>t.jsx(dr,{family:a.family,tokens:a.tokens,editing:v,valueOf:B,onEdit:J},a.family))]}),(ae.length>0||pe.length>0)&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(ge,{children:r("library.brandPreview.typography")}),ae.map(a=>t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:a.name.replace(/^--brand-font-?/,"")||r("library.brandPreview.defaultFont")}),v?t.jsx(ye,{value:B(a),onChange:b=>J(a.name,b.target.value),className:"h-9"}):t.jsx("span",{className:"truncate text-lg text-foreground",style:{fontFamily:B(a)},children:B(a)})]},a.name)),pe.map(a=>t.jsx(nt,{token:a,value:B(a),editing:v,onEdit:J},a.name))]}),t.jsx(xe,{label:r("library.brandPreview.spacing"),tokens:me,editing:v,valueOf:B,onEdit:J}),t.jsx(xe,{label:r("library.brandPreview.radius"),tokens:Ee,editing:v,valueOf:B,onEdit:J}),t.jsx(xe,{label:r("library.brandPreview.shadows"),tokens:Ne,editing:v,valueOf:B,onEdit:J}),t.jsx(xe,{label:r("library.brandPreview.motion"),tokens:le,editing:v,valueOf:B,onEdit:J}),t.jsx(xe,{label:r("library.brandPreview.tokens"),tokens:Pe,editing:v,valueOf:B,onEdit:J}),t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(ge,{children:r("library.brandPreview.voiceGuidelines")}),v?t.jsx(qt,{value:fe,onChange:a=>W(a.target.value),placeholder:r("library.brandPreview.voicePlaceholder"),className:"min-h-48 font-mono text-sm"}):Y.isPending&&P?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(te,{className:"h-3 w-full"}),t.jsx(te,{className:"h-3 w-5/6"})]}):fe.trim()?t.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:t.jsx(Gt,{id:`brand-preview-${l}`,text:fe})}):t.jsx("p",{className:"text-sm text-muted-foreground",children:r("library.brandPreview.noVoiceYet")})]})]})]})})]})}function it(l){const e=F.c(8),{brandPath:s,onClose:r}=l;let u;e[0]!==r?(u=d=>{d||r()},e[0]=r,e[1]=u):u=e[1];let n;e[2]!==s||e[3]!==r?(n=t.jsx(Le,{className:"flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-2xl!",closeButtonClassName:"hidden",children:t.jsx(pr,{brandPath:s,onClose:r,variant:"dialog"})}),e[2]=s,e[3]=r,e[4]=n):n=e[4];let o;return e[5]!==u||e[6]!==n?(o=t.jsx(Me,{open:!0,onOpenChange:u,children:n}),e[5]=u,e[6]=n,e[7]=o):o=e[7],o}function mr(l){const e=F.c(11),{onOpenDir:s}=l,r=X(),u=Mt();let n;e[0]!==u.data?(n=u.data??[],e[0]=u.data,e[1]=n):n=e[1];let o;if(e[2]!==s||e[3]!==r||e[4]!==n){let i;e[6]!==s||e[7]!==r?(i=c=>t.jsx(Se,{name:c.volume,glyph:er,tone:"system",readOnly:!0,meta:`${c.repoOwner}/${c.repoName}`,subtitle:c.lastSyncError?r("library.syncedRepos.syncFailed"):c.lastSyncedAt?r("library.syncedRepos.syncedAgo",{ago:st(c.lastSyncedAt)}):r("library.syncedRepos.waitingFirstSync"),onOpen:()=>s(c.volume)},c.id),e[6]=s,e[7]=r,e[8]=i):i=e[8],o=n.map(i),e[2]=s,e[3]=r,e[4]=n,e[5]=o}else o=e[5];let d;return e[9]!==o?(d=t.jsx(t.Fragment,{children:o}),e[9]=o,e[10]=d):d=e[10],d}function Ke(l){return`${window.location.origin}${l}`}function ve(l){if(l.shareMode==="password")return"password";if(l.shareMode==="public"||l.readPublic)return"public";if(l.effectivePublic)return"inherited"}const fr=[je,"uploads","outputs"],ot=[{volume:"uploads",descriptionKey:"library.libraryViews.volumeUploadsDescription",glyph:$e},{volume:"outputs",descriptionKey:"library.libraryViews.volumeOutputsDescription",glyph:Zt}],He=new Set([...ot.map(l=>l.volume),ce("public")]),hr=6;function ct(l,e,s){const r=e.includes("/")?e.slice(0,e.lastIndexOf("/")):"",u=_e(l),n=u?`public/${u}`:l==="home"?we(s):l;return r?`${n}/${r}`:n}function Oe(l,e,s){return{onDragStart:r=>{s.onDragStart?.(l),r.dataTransfer.effectAllowed="move",r.dataTransfer.setData("application/x-studio-library-path",l)},onContextMenu:r=>{r.preventDefault(),s.onContextMenu?.(l,e)},onDrop:s.onDrop?r=>{r.preventDefault();const u=r.dataTransfer.getData("application/x-studio-library-path");u&&u!==l&&!l.startsWith(u+"/")&&s.onDrop(u,l)}:void 0}}function re(l){const e=F.c(2),{children:s}=l;let r;return e[0]!==s?(r=t.jsx("p",{className:"text-[13px] text-foreground",children:s}),e[0]=s,e[1]=r):r=e[1],r}function ee(l){const e=F.c(2),{children:s}=l;let r;return e[0]!==s?(r=t.jsx("div",{className:"@container",children:t.jsx("div",{className:"grid grid-cols-1 gap-3 @[440px]:grid-cols-2 @[660px]:grid-cols-3",children:s})}),e[0]=s,e[1]=r):r=e[1],r}function Te(l){const e=F.c(2),{rows:s}=l,r=s===void 0?1:s;let u;return e[0]!==r?(u=t.jsx(ee,{children:Array.from({length:r*3},br)}),e[0]=r,e[1]=u):u=e[1],u}function br(l,e){return t.jsx(te,{className:"h-16 rounded-2xl"},e)}function qe(l){const e=F.c(2),{children:s}=l;let r;return e[0]!==s?(r=t.jsx("p",{className:"text-sm text-muted-foreground",children:s}),e[0]=s,e[1]=r):r=e[1],r}function xr(l){const e=F.c(12),{volume:s,descriptionKey:r,glyph:u,onOpen:n}=l,o=X(),d=Et(s);let i;e[0]!==o||e[1]!==d.data?(i=d.data?o("library.libraryViews.filesCount",{count:d.data.files}):void 0,e[0]=o,e[1]=d.data,e[2]=i):i=e[2];let c;e[3]!==r||e[4]!==o?(c=o(r),e[3]=r,e[4]=o,e[5]=c):c=e[5];let p;return e[6]!==u||e[7]!==n||e[8]!==i||e[9]!==c||e[10]!==s?(p=t.jsx(Se,{name:s,meta:i,subtitle:c,glyph:u,tone:"system",onOpen:n}),e[6]=u,e[7]=n,e[8]=i,e[9]=c,e[10]=s,e[11]=p):p=e[11],p}function gr(l){const e=F.c(12),{onOpenDir:s}=l,r=X(),n=rt().data?.length??0;let o;e[0]!==s?(o=ot.map(p=>t.jsx(xr,{volume:p.volume,descriptionKey:p.descriptionKey,glyph:p.glyph,onOpen:()=>s(p.volume)},p.volume)),e[0]=s,e[1]=o):o=e[1];let d;e[2]!==s||e[3]!==n||e[4]!==r?(d=n>0&&t.jsx(Se,{name:ce("public"),meta:r("library.libraryViews.skillSetsCount",{count:n}),subtitle:r("library.libraryViews.curatedSkillSetsReadOnly"),glyph:_t,tone:"system",readOnly:!0,onOpen:()=>s("public")}),e[2]=s,e[3]=n,e[4]=r,e[5]=d):d=e[5];let i;e[6]!==s?(i=t.jsx(mr,{onOpenDir:s}),e[6]=s,e[7]=i):i=e[7];let c;return e[8]!==o||e[9]!==d||e[10]!==i?(c=t.jsxs(t.Fragment,{children:[o,d,i]}),e[8]=o,e[9]=d,e[10]=i,e[11]=c):c=e[11],c}function yr(l){const e=F.c(19),{segments:s,onNavigate:r}=l,{org:u}=de();let n;e[0]!==s?(n=s[0]===je?s.slice(1):s,e[0]=s,e[1]=n):n=e[1];const o=n,d=s.length-o.length,i=o.length===0;let c;e[2]!==i||e[3]!==r||e[4]!==u.slug?(c=i?t.jsx("span",{className:"truncate font-medium text-foreground",children:we(u.slug)}):t.jsx("button",{type:"button",className:"truncate text-muted-foreground hover:text-foreground hover:underline",onClick:()=>r(je),children:we(u.slug)}),e[2]=i,e[3]=r,e[4]=u.slug,e[5]=c):c=e[5];let p;if(e[6]!==d||e[7]!==r||e[8]!==o||e[9]!==s){let m;e[11]!==d||e[12]!==r||e[13]!==o.length||e[14]!==s?(m=(w,x)=>{const y=s.slice(0,d+x+1).join("/"),C=x===o.length-1;return t.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[t.jsx(Xt,{size:12,className:"shrink-0 text-muted-foreground"}),C?t.jsx("span",{className:"truncate font-medium text-foreground",children:ce(w)}):t.jsx("button",{type:"button",className:"truncate text-muted-foreground hover:text-foreground hover:underline",onClick:()=>r(y),children:ce(w)})]},y)},e[11]=d,e[12]=r,e[13]=o.length,e[14]=s,e[15]=m):m=e[15],p=o.map(m),e[6]=d,e[7]=r,e[8]=o,e[9]=s,e[10]=p}else p=e[10];let h;return e[16]!==c||e[17]!==p?(h=t.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1 text-sm",children:[c,p]}),e[16]=c,e[17]=p,e[18]=h):h=e[18],h}function vr(l){const e=F.c(43),{query:s,scope:r,stale:u,onOpenFile:n,onShare:o,onDelete:d}=l,i=X(),{org:c}=de(),p=Fe(),h=Ft(s,r);let m;e[0]!==p||e[1]!==o?(m=S=>o({volume:S.volume,path:S.path,kind:"file",shareMode:S.shareMode??"private",effectivePublic:S.effectivePublic??!1,url:Ke(p(S.volume,S.path))}),e[0]=p,e[1]=o,e[2]=m):m=e[2];const w=m;if(h.isPending){let S;return e[3]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Te,{rows:2}),e[3]=S):S=e[3],S}let x,y,C,D,N;if(e[4]!==s||e[5]!==h.data||e[6]!==h.isPlaceholderData||e[7]!==u||e[8]!==i){N=Symbol.for("react.early_return_sentinel");e:{if(y=h.data??[],y.length===0){let j;e[14]!==s||e[15]!==i?(j=i("library.libraryViews.noFilesMatch",{query:s}),e[14]=s,e[15]=i,e[16]=j):j=e[16];let O;e[17]!==j?(O=t.jsx(qe,{children:j}),e[17]=j,e[18]=O):O=e[18],N=O;break e}const S=(u||h.isPlaceholderData)&&"opacity-50";e[19]!==S?(D=De("flex flex-col gap-3",S),e[19]=S,e[20]=D):D=e[20],x=re,C=i("library.libraryViews.searchResults",{count:y.length})}e[4]=s,e[5]=h.data,e[6]=h.isPlaceholderData,e[7]=u,e[8]=i,e[9]=x,e[10]=y,e[11]=C,e[12]=D,e[13]=N}else x=e[9],y=e[10],C=e[11],D=e[12],N=e[13];if(N!==Symbol.for("react.early_return_sentinel"))return N;let k;e[21]!==x||e[22]!==C?(k=t.jsx(x,{children:C}),e[21]=x,e[22]=C,e[23]=k):k=e[23];let P;if(e[24]!==p||e[25]!==d||e[26]!==n||e[27]!==c||e[28]!==y||e[29]!==w){let S;e[31]!==p||e[32]!==d||e[33]!==n||e[34]!==c||e[35]!==w?(S=j=>{const O=_e(j.volume)!==null;return t.jsx(at,{filename:M(j.path),updatedAt:j.updatedAt,downloadUrl:p(j.volume,j.path),subtitle:ct(j.volume,j.path,c.slug),publicState:ve(j),onOpen:()=>n(et(j.volume,j.path)),onShare:O?void 0:()=>w(j),onDelete:O?void 0:()=>d({volume:j.volume,path:j.path,kind:"file"})},`${j.volume}/${j.path}`)},e[31]=p,e[32]=d,e[33]=n,e[34]=c,e[35]=w,e[36]=S):S=e[36],P=y.map(S),e[24]=p,e[25]=d,e[26]=n,e[27]=c,e[28]=y,e[29]=w,e[30]=P}else P=e[30];let g;e[37]!==P?(g=t.jsx(ee,{children:P}),e[37]=P,e[38]=g):g=e[38];let $;return e[39]!==D||e[40]!==k||e[41]!==g?($=t.jsxs("div",{className:D,children:[k,g]}),e[39]=D,e[40]=k,e[41]=g,e[42]=$):$=e[42],$}function jr(l){const e=F.c(39),{onOpenFile:s,onShare:r,onDelete:u}=l,n=X(),{org:o}=de(),d=Tt(),i=Fe();let c;e[0]!==i||e[1]!==r?(c=N=>r({volume:N.volume,path:N.path,kind:"file",shareMode:N.shareMode??"private",effectivePublic:N.effectivePublic??!1,url:Ke(i(N.volume,N.path))}),e[0]=i,e[1]=r,e[2]=c):c=e[2];const p=c;if(d.isPending){let N;e[3]!==n?(N=n("library.libraryViews.recentlyAdded"),e[3]=n,e[4]=N):N=e[4];let k;e[5]!==N?(k=t.jsx(re,{children:N}),e[5]=N,e[6]=k):k=e[6];let P;e[7]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Te,{}),e[7]=P):P=e[7];let g;return e[8]!==k?(g=t.jsxs("div",{className:"flex flex-col gap-3",children:[k,P]}),e[8]=k,e[9]=g):g=e[9],g}let h,m,w,x,y;if(e[10]!==i||e[11]!==u||e[12]!==s||e[13]!==o||e[14]!==d.data||e[15]!==p||e[16]!==n){y=Symbol.for("react.early_return_sentinel");e:{const N=(d.data??[]).slice(0,hr);if(N.length===0){y=null;break e}w="flex flex-col gap-3";let k;e[22]!==n?(k=n("library.libraryViews.recentlyAdded"),e[22]=n,e[23]=k):k=e[23],e[24]!==k?(x=t.jsx(re,{children:k}),e[24]=k,e[25]=x):x=e[25],h=ee;let P;e[26]!==i||e[27]!==u||e[28]!==s||e[29]!==o||e[30]!==p?(P=g=>t.jsx(Ht,{filename:M(g.path),updatedAt:g.updatedAt,size:g.size,downloadUrl:i(g.volume,g.path),subtitle:ct(g.volume,g.path,o.slug),publicState:ve(g),onOpen:()=>s(et(g.volume,g.path)),onShare:()=>p(g),onDelete:()=>u({volume:g.volume,path:g.path,kind:"file"})},`${g.volume}/${g.path}`),e[26]=i,e[27]=u,e[28]=s,e[29]=o,e[30]=p,e[31]=P):P=e[31],m=N.map(P)}e[10]=i,e[11]=u,e[12]=s,e[13]=o,e[14]=d.data,e[15]=p,e[16]=n,e[17]=h,e[18]=m,e[19]=w,e[20]=x,e[21]=y}else h=e[17],m=e[18],w=e[19],x=e[20],y=e[21];if(y!==Symbol.for("react.early_return_sentinel"))return y;let C;e[32]!==h||e[33]!==m?(C=t.jsx(h,{children:m}),e[32]=h,e[33]=m,e[34]=C):C=e[34];let D;return e[35]!==w||e[36]!==x||e[37]!==C?(D=t.jsxs("div",{className:w,children:[x,C]}),e[35]=w,e[36]=x,e[37]=C,e[38]=D):D=e[38],D}function wr(l){const e=F.c(16),{onOpenDir:s}=l,r=X(),u=rt();if(u.isPending){let c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Te,{}),e[0]=c):c=e[0],c}let n;e[1]!==u.data?(n=u.data??[],e[1]=u.data,e[2]=n):n=e[2];const o=n;if(o.length===0){let c;e[3]!==r?(c=r("library.libraryViews.noPublicSkillSetsConfigured"),e[3]=r,e[4]=c):c=e[4];let p;return e[5]!==c?(p=t.jsx(qe,{children:c}),e[5]=c,e[6]=p):p=e[6],p}let d;if(e[7]!==s||e[8]!==o||e[9]!==r){let c;e[11]!==s||e[12]!==r?(c=p=>t.jsx(Se,{name:p,subtitle:r("library.libraryViews.readOnly"),readOnly:!0,onOpen:()=>s(`public/${p}`)},p),e[11]=s,e[12]=r,e[13]=c):c=e[13],d=o.map(c),e[7]=s,e[8]=o,e[9]=r,e[10]=d}else d=e[10];let i;return e[14]!==d?(i=t.jsx(ee,{children:d}),e[14]=d,e[15]=i):i=e[15],i}function kr(l){const e=F.c(63),{location:s,onOpenDir:r,onOpenFile:u,onOpenSkill:n,onOpenBrand:o,onShare:d,onDelete:i,onDragStart:c,onContextMenu:p,onMove:h}=l,m=X(),{org:w}=de(),x=s.volume??"",y=tt(x,s.dirPath),C=Fe();let D;e[0]!==s.isHomeRoot||e[1]!==w?(D=v=>s.isHomeRoot&&He.has(v.toLowerCase())?`${we(w.slug)}/${v}`:void 0,e[0]=s.isHomeRoot,e[1]=w,e[2]=D):D=e[2];const N=D;let k;e[3]!==s.isHomeRoot||e[4]!==r?(k=s.isHomeRoot?t.jsx(gr,{onOpenDir:r}):null,e[3]=s.isHomeRoot,e[4]=r,e[5]=k):k=e[5];const P=k;if(y.isPending){let v;e[6]!==P||e[7]!==m?(v=P&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(re,{children:m("library.libraryViews.folders")}),t.jsx(ee,{children:P})]}),e[6]=P,e[7]=m,e[8]=v):v=e[8];let E;e[9]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(Te,{rows:2}),e[9]=E):E=e[9];let z;return e[10]!==v?(z=t.jsxs(t.Fragment,{children:[v,E]}),e[10]=v,e[11]=z):z=e[11],z}if(y.isError){let v;e[12]!==y.error||e[13]!==m?(v=y.error instanceof Error?y.error.message:m("library.libraryViews.failedToLoad"),e[12]=y.error,e[13]=m,e[14]=v):v=e[14];let E;return e[15]!==v?(E=t.jsx("p",{className:"text-sm text-destructive",children:v}),e[15]=v,e[16]=E):E=e[16],E}let g,$,S,j,O;if(e[17]!==N||e[18]!==C||e[19]!==y.data||e[20]!==s||e[21]!==p||e[22]!==i||e[23]!==c||e[24]!==h||e[25]!==o||e[26]!==r||e[27]!==u||e[28]!==n||e[29]!==d||e[30]!==P||e[31]!==m||e[32]!==x){O=Symbol.for("react.early_return_sentinel");e:{const v=y.data??[],E=v.filter(Cr),z=v.filter(Pr),G=v.filter(Nr),I=v.filter(Sr);if(v.length===0&&!s.isHomeRoot){let f;e[38]!==s.readOnly||e[39]!==m?(f=s.readOnly?m("library.libraryViews.emptyReadOnlySet"):m("library.libraryViews.emptyFolder"),e[38]=s.readOnly,e[39]=m,e[40]=f):f=e[40];let q;e[41]!==f?(q=t.jsx(qe,{children:f}),e[41]=f,e[42]=q):q=e[42],O=q;break e}let W;e[43]!==s.readOnly||e[44]!==i||e[45]!==x?(W=f=>s.readOnly?void 0:()=>i({volume:x,path:f.path,kind:f.kind}),e[43]=s.readOnly,e[44]=i,e[45]=x,e[46]=W):W=e[46];const U=W;let A;e[47]!==C||e[48]!==s.readOnly||e[49]!==d||e[50]!==x?(A=f=>s.readOnly?void 0:()=>d({volume:x,path:f.path,kind:f.kind,shareMode:f.shareMode??"private",effectivePublic:f.effectivePublic??!1,url:f.kind==="file"?Ke(C(x,f.path)):void 0}),e[47]=C,e[48]=s.readOnly,e[49]=d,e[50]=x,e[51]=A):A=e[51];const K=A;g=E.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(re,{children:m("library.libraryViews.skills")}),t.jsx(ee,{children:E.map(f=>t.jsx(Vt,{dirName:M(f.path),updatedAt:f.updatedAt,skillMdUrl:C(x,`${f.path}/SKILL.md`),publicState:ve(f),onOpen:()=>n(oe(s,f.path)),onBrowse:()=>r(oe(s,f.path)),onShare:K(f),onDelete:U(f),draggable:!s.readOnly,...Oe(f.path,"dir",{onDragStart:c,onContextMenu:p})},f.path))})]}),$=z.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(re,{children:m("library.libraryViews.brands")}),t.jsx(ee,{children:z.map(f=>t.jsx(Ut,{dirName:M(f.path),updatedAt:f.updatedAt,tokensUrl:C(x,`${f.path}/tokens.css`),onOpen:()=>o(oe(s,f.path)),onBrowse:()=>r(oe(s,f.path)),onDelete:U(f),draggable:!s.readOnly,...Oe(f.path,"dir",{onDragStart:c,onContextMenu:p})},f.path))})]}),S=(G.length>0||P)&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(re,{children:m("library.libraryViews.folders")}),t.jsxs(ee,{children:[P,G.map(f=>t.jsx(Se,{name:M(f.path),meta:st(f.updatedAt),subtitle:N(M(f.path)),readOnly:s.readOnly,publicState:ve(f),onOpen:()=>r(oe(s,f.path)),onShare:K(f),onDelete:U(f),draggable:!s.readOnly,...Oe(f.path,"dir",{onDragStart:c,onContextMenu:p,onDrop:h})},f.path))]})]}),j=I.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(re,{children:m("library.libraryViews.files")}),t.jsx(ee,{children:I.map(f=>t.jsx(at,{filename:M(f.path),updatedAt:f.updatedAt,downloadUrl:C(x,f.path),publicState:ve(f),onOpen:()=>u(oe(s,f.path)),onShare:K(f),onDelete:U(f),draggable:!s.readOnly,...Oe(f.path,"file",{onDragStart:c,onContextMenu:p})},f.path))})]})}e[17]=N,e[18]=C,e[19]=y.data,e[20]=s,e[21]=p,e[22]=i,e[23]=c,e[24]=h,e[25]=o,e[26]=r,e[27]=u,e[28]=n,e[29]=d,e[30]=P,e[31]=m,e[32]=x,e[33]=g,e[34]=$,e[35]=S,e[36]=j,e[37]=O}else g=e[33],$=e[34],S=e[35],j=e[36],O=e[37];if(O!==Symbol.for("react.early_return_sentinel"))return O;let V;e[52]!==s.isHomeRoot||e[53]!==i||e[54]!==u||e[55]!==d?(V=s.isHomeRoot&&t.jsx(jr,{onOpenFile:u,onShare:d,onDelete:i}),e[52]=s.isHomeRoot,e[53]=i,e[54]=u,e[55]=d,e[56]=V):V=e[56];let Y;return e[57]!==g||e[58]!==$||e[59]!==S||e[60]!==j||e[61]!==V?(Y=t.jsxs(t.Fragment,{children:[g,$,S,j,V]}),e[57]=g,e[58]=$,e[59]=S,e[60]=j,e[61]=V,e[62]=Y):Y=e[62],Y}function Sr(l){return l.kind==="file"}function Nr(l){return l.kind==="dir"&&!l.hasSkill&&!l.hasBrand}function Pr(l){return l.kind==="dir"&&l.hasBrand&&!l.hasSkill}function Cr(l){return l.kind==="dir"&&l.hasSkill}function Or({onOpenFile:l,onOpenSkill:e,onOpenBrand:s}={}){const r=X(),{org:u}=de(),n=Xe(),o=dt(),d=yt(),i=ut({strict:!1}),c=i.path||je,p=Ze(c),h=Kt(),m=p.volume!==null&&h.has(p.volume)?{...p,readOnly:!0}:p,w=(a,b)=>o({to:".",search:R=>({...R,[a]:b||void 0})}),x=a=>w("path",a),y=(a,b)=>o({to:".",search:R=>({...R,preview:void 0,skill:void 0,brand:void 0,[a]:b})}),C=l??(a=>y("preview",a)),D=e??(a=>y("skill",a)),N=s??(a=>y("brand",a)),[k,P]=T.useState(""),g=Dt(k.trim(),300),$=!m.isHomeRoot&&m.volume!==null?{volume:m.volume,prefix:m.dirPath}:void 0,S=$?r("library.library.searchInPlaceholder",{folder:ce(m.segments.at(-1)??"")}):r("library.library.searchPlaceholder"),j=m.isHomeRoot?we(u.slug):ce(m.segments.at(-1)??""),[O,V]=T.useState(null),[Y,v]=T.useState(null),[E,z]=T.useState(!1),[G,I]=T.useState(""),[W,U]=T.useState(!1),[A,K]=T.useState(null),[f,q]=T.useState(""),se=T.useRef(null),[Q,ue]=T.useState(!1),B=T.useRef(0),Z=m.readOnly?null:m.volume,{upload:ae,mkdir:pe,move:me}=Ue(Z??je),{remove:Ee}=Ue(O?.volume??"uploads");async function Ne(a){if(!(!Z||!a||a.length===0))try{await ae.mutateAsync({dir:m.dirPath,files:[...a]}),L.success(a.length===1?r("library.library.uploadedSingle",{filename:a[0]?.name??""}):r("library.library.uploadedMultiple",{count:a.length}))}catch(b){L.error(b instanceof Error?b.message:r("library.library.uploadFailed"))}finally{se.current&&(se.current.value="")}}const le=Z!==null;function Pe(a){return a.dataTransfer.types.includes("Files")}function J(a){!le||!Pe(a)||(a.preventDefault(),B.current+=1,ue(!0))}function ne(a){!le||!Pe(a)||a.preventDefault()}function fe(){le&&(B.current=Math.max(0,B.current-1),B.current===0&&ue(!1))}function he(a){le&&(a.preventDefault(),a.stopPropagation(),B.current=0,ue(!1),a.dataTransfer.files.length>0&&Ne(a.dataTransfer.files))}async function be(){const a=G.trim();if(!(!Z||!a)){if(m.isHomeRoot&&He.has(a.toLowerCase())){L.error(r("library.library.folderNameReserved",{name:a}));return}try{const b=m.dirPath;await pe.mutateAsync(b?`${b}/${a}`:a),L.success(r("library.library.folderCreated",{name:a})),z(!1),I("")}catch(b){L.error(b instanceof Error?b.message:r("library.library.folderCreateFailed"))}}}async function Ae(){if(!O)return;const a=O;try{await Ee.mutateAsync(a.path),L.success(r("library.library.deleted",{name:M(a.path)}))}catch(b){L.error(b instanceof Error?b.message:r("library.library.deleteFailed"))}finally{V(null)}}async function Ce(){if(!A)return;const a=f.trim();if(!a||a.includes("/")||a.includes("..")||a===M(A.path)){U(!1),K(null),q("");return}if(A.kind==="dir"&&m.isHomeRoot&&He.has(a.toLowerCase())){L.error(r("library.library.folderNameReserved",{name:a}));return}try{const b=A.path.includes("/")?A.path.slice(0,A.path.lastIndexOf("/")):"",R=b?`${b}/${a}`:a;await me.mutateAsync({from:A.path,to:R});const ie=a.replace(/[<>]/g,"");L.success(r("library.library.renamed",{name:ie}))}catch(b){L.error(b instanceof Error?b.message:r("library.library.renameFailed"))}finally{U(!1),K(null),q("")}}async function Re(a,b){try{const R=M(a),ie=b?`${b}/${R}`:R;await me.mutateAsync({from:a,to:ie}),L.success(r("library.library.moved",{name:R,destination:b||r("library.library.theLibrary")}))}catch(R){L.error(R instanceof Error?R.message:r("library.library.moveFailed"))}}function ze(){for(const a of fr)n.invalidateQueries({queryKey:_.orgFsVolume(u.id,a)});m.volume&&n.invalidateQueries({queryKey:_.orgFsVolume(u.id,m.volume)}),n.invalidateQueries({queryKey:_.orgFsRecent(u.id)}),n.invalidateQueries({queryKey:_.orgFsSearchRoot(u.id)}),n.invalidateQueries({queryKey:_.orgFsPublicSets(u.id)})}function Be(a){a.defaultPrevented||!Z||a.target.closest("input, textarea, button, a, [role='button']")||(a.preventDefault(),z(!0))}return t.jsxs("div",{className:"relative h-full",onDragEnter:J,onDragOver:ne,onDragLeave:fe,onDrop:he,onContextMenu:Be,children:[Q&&t.jsx("div",{className:"pointer-events-none absolute inset-0 z-20 flex items-center justify-center bg-background/80 p-6 backdrop-blur-sm",children:t.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-2xl border-2 border-dashed border-primary px-10 py-8 text-center",children:[t.jsx($e,{size:28,className:"text-primary"}),t.jsx("p",{className:"text-sm font-medium text-foreground",children:r("library.library.dropToUpload",{location:j})})]})}),t.jsx("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-wrap items-center gap-2",children:[t.jsx("div",{className:"min-w-0 flex-1 basis-full sm:basis-auto",children:t.jsx(yr,{segments:m.segments,onNavigate:x})}),t.jsxs("div",{className:"relative w-full shrink-0 sm:w-56",children:[t.jsx(xt,{size:16,className:"pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 text-muted-foreground"}),t.jsx(ye,{value:k,onChange:a=>P(a.target.value),onKeyDown:a=>{a.key==="Escape"&&P("")},placeholder:S,className:"h-9 rounded-xl pr-9 pl-9"}),k&&t.jsx(H,{variant:"ghost",size:"icon",className:"absolute top-1/2 right-1.5 size-7 -translate-y-1/2",onClick:()=>P(""),"aria-label":r("library.library.clearSearch"),children:t.jsx(gt,{size:14})})]}),t.jsx(H,{variant:"ghost",size:"icon",onClick:ze,"aria-label":r("library.library.refresh"),children:t.jsx(pt,{size:14})}),Z&&t.jsxs(H,{variant:"outline",size:"sm",onClick:()=>z(!0),children:[t.jsx(bt,{size:14}),r("library.library.newFolder")]}),m.readOnly?t.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[t.jsx(ht,{size:12}),r("library.library.readOnly")]}):t.jsxs(H,{size:"sm",disabled:ae.isPending,onClick:()=>se.current?.click(),children:[t.jsx($e,{size:14}),ae.isPending?r("library.library.uploading"):r("library.library.uploadFile")]}),t.jsx("input",{ref:se,type:"file",multiple:!0,className:"hidden",onChange:a=>{Ne(a.target.files)}})]}),g?t.jsx(vr,{query:g,scope:$,stale:k.trim()!==g,onOpenFile:C,onShare:v,onDelete:V}):m.volume===null?t.jsx(wr,{onOpenDir:x}):t.jsx(kr,{location:m,onOpenDir:x,onOpenFile:C,onOpenSkill:D,onOpenBrand:N,onShare:v,onDelete:V,onContextMenu:(a,b)=>{K({path:a,kind:b}),q(M(a)),U(!0)},onMove:Re},m.volume)]})}),d&&(i.preview?t.jsx(Jt,{previewPath:i.preview,onClose:()=>w("preview",null)}):i.skill?t.jsx(lt,{skillPath:i.skill,onClose:()=>w("skill",null)},i.skill):i.brand?t.jsx(it,{brandPath:i.brand,onClose:()=>w("brand",null)},i.brand):null),t.jsx(Me,{open:E,onOpenChange:z,children:t.jsxs(Le,{children:[t.jsxs(Qe,{children:[t.jsx(Ve,{children:r("library.library.newFolderTitle")}),t.jsx(Ye,{children:r("library.library.newFolderDescription",{path:j||r("library.library.theLibrary")})})]}),t.jsx(ye,{autoFocus:!0,placeholder:r("library.library.folderNamePlaceholder"),value:G,onChange:a=>I(a.target.value),onKeyDown:a=>{a.key==="Enter"&&be()}}),t.jsxs(Ge,{children:[t.jsx(H,{variant:"outline",onClick:()=>z(!1),children:r("library.library.cancel")}),t.jsx(H,{disabled:!G.trim()||pe.isPending,onClick:()=>{be()},children:r("library.library.create")})]})]})}),t.jsx(Me,{open:W,onOpenChange:a=>{U(a),a||(K(null),q(""))},children:t.jsxs(Le,{children:[t.jsxs(Qe,{children:[t.jsx(Ve,{children:A&&r("library.library.renameTitle",{name:M(A.path)})}),t.jsx(Ye,{children:r("library.library.renameDescription")})]}),t.jsx(ye,{autoFocus:!0,value:f,onChange:a=>q(a.target.value),onKeyDown:a=>{a.key==="Enter"&&Ce()}}),t.jsxs(Ge,{children:[t.jsx(H,{variant:"outline",onClick:()=>U(!1),children:r("library.library.cancel")}),t.jsx(H,{disabled:!f.trim()||me.isPending,onClick:()=>{Ce()},children:r("library.library.rename")})]})]})}),t.jsx(Wt,{target:Y,onOpenChange:a=>{a||v(null)}}),t.jsx(vt,{open:O!==null,onOpenChange:a=>{a||V(null)},children:t.jsxs(jt,{children:[t.jsxs(wt,{children:[t.jsx(kt,{children:r("library.library.deleteTitle",{name:O?M(O.path):""})}),t.jsx(St,{children:O?.kind==="dir"?r("library.library.deleteDirectoryDescription"):r("library.library.deleteFileDescription")})]}),t.jsxs(Nt,{children:[t.jsx(Pt,{children:r("library.library.cancel")}),t.jsx(Ct,{onClick:()=>{Ae()},children:r("library.library.delete")})]})]})})]})}function Dr(){const l=F.c(10),{openPanel:e}=tr(),[s,r]=T.useState(null),[u,n]=T.useState(null);let o;l[0]!==e?(o=t.jsx(Or,{onOpenFile:p=>e(mt(p)),onOpenSkill:r,onOpenBrand:n}),l[0]=e,l[1]=o):o=l[1];let d;l[2]!==s?(d=s&&t.jsx(lt,{skillPath:s,onClose:()=>r(null)},s),l[2]=s,l[3]=d):d=l[3];let i;l[4]!==u?(i=u&&t.jsx(it,{brandPath:u,onClose:()=>n(null)},u),l[4]=u,l[5]=i):i=l[5];let c;return l[6]!==o||l[7]!==d||l[8]!==i?(c=t.jsxs("div",{className:"flex flex-col h-full min-h-0 overflow-hidden",children:[o,d,i]}),l[6]=o,l[7]=d,l[8]=i,l[9]=c):c=l[9],c}function Ks(){const l=F.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ft.Content,{children:t.jsx(Dr,{})}),l[0]=e):e=l[0],e}export{Ks as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as R,a as m,r as _,u as C,j as u,N as y}from"./index-BMJCLbj5.js";import{u as U,A as j,a as k}from"./auth-entry-DT34wonq.js";import{A as N}from"./auth-split-layout-CZmbnVcH.js";import"./input-BHyVG0eO.js";import"./use-is-desktop-app-BNujXJc_.js";import"./retry-i8LvYSZg.js";import"./backoff-8mStPHYB.js";function O(){const e=R.c(5),t=U(),o=m.useSession();_.useRef(null);const i=t.status,c=o.data!=null,r=o.isPending;let n,s;e[0]!==c||e[1]!==r||e[2]!==i?(n=()=>{},s=[i,c,r],e[0]=c,e[1]=r,e[2]=i,e[3]=n,e[4]=s):(n=e[3],s=e[4]),_.useEffect(n,s)}const h="studio_signup_ref",a="studio_signup_src",$=720*60*60,f=128;function p(e){const t=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return t?.[1]?decodeURIComponent(t[1]):null}function g(e,t){document.cookie=`${e}=${encodeURIComponent(t)}; path=/; max-age=${$}; samesite=lax`}function b(e){e.ref&&e.ref.length<=f&&!p(h)&&g(h,e.ref),e.src&&e.src.length<=f&&!p(a)&&g(a,e.src)}function w(e){if(!e.client_id||e.response_type!=="code")return null;const t=new URLSearchParams;return e.client_id&&t.set("client_id",e.client_id),e.redirect_uri&&t.set("redirect_uri",e.redirect_uri),e.response_type&&t.set("response_type",e.response_type),e.state&&t.set("state",e.state),e.scope&&t.set("scope",e.scope),e.code_challenge&&t.set("code_challenge",e.code_challenge),e.code_challenge_method&&t.set("code_challenge_method",e.code_challenge_method),`/api/auth/mcp/authorize?${t.toString()}`}function D(){const e=m.useSession();O();const t=C({from:"/login"}),{next:o="/",client_id:i,redirect_uri:c,response_type:r,state:n,scope:s,code_challenge:x,code_challenge_method:A,src:S,ref:E}=t;b({src:S,ref:E});const d=o.startsWith("/")&&!o.startsWith("//")?o:"/",l=w({client_id:i,redirect_uri:c,response_type:r,state:n,scope:s,code_challenge:x,code_challenge_method:A});return e.data?l?(window.location.href=l,u.jsx(j,{})):u.jsx(y,{to:d}):u.jsx(N,{children:u.jsx(k,{callbackUrl:d,redirectUrl:l})})}export{D as default};
|