decocms 4.582.1 → 4.583.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-DT2ZDuIl.js → AlertCircle-BfuEGc37.js} +1 -1
- package/dist/client/assets/{AreaChart-DcNurrpT.js → AreaChart-DR454FhG.js} +1 -1
- package/dist/client/assets/{ArrowLeft-DR_MRxUB.js → ArrowLeft-Ccyza8AK.js} +1 -1
- package/dist/client/assets/ArrowRight-BfJPk4p9.js +1 -0
- package/dist/client/assets/{ArrowUp-BdtMKnAz.js → ArrowUp-Cfwuhrfj.js} +1 -1
- package/dist/client/assets/{BookOpen01-DejCO54_.js → BookOpen01-vaPiqXWZ.js} +1 -1
- package/dist/client/assets/{CartesianChart-43C3tGyF.js → CartesianChart-Vg3-F_Bi.js} +1 -1
- package/dist/client/assets/{CategoricalChart-GawOpO41.js → CategoricalChart-gtbFaKuM.js} +1 -1
- package/dist/client/assets/{CheckCircle-CM--cqi0.js → CheckCircle-WpYwhp7A.js} +1 -1
- package/dist/client/assets/ChevronDown-Kpzb5_P-.js +1 -0
- package/dist/client/assets/{ChevronSelectorVertical-BJDM_s_Z.js → ChevronSelectorVertical-DNPn4Jhl.js} +1 -1
- package/dist/client/assets/ChevronUp-CwLphDxo.js +1 -0
- package/dist/client/assets/{CreditCard01-BKZ9QJb-.js → CreditCard01-CDUEuZ6_.js} +1 -1
- package/dist/client/assets/Eye-BeTcpGN-.js +1 -0
- package/dist/client/assets/File02-D8jC2XAm.js +1 -0
- package/dist/client/assets/{Globe04-BZJYx7x5.js → Globe04-CM5K7y4B.js} +1 -1
- package/dist/client/assets/Image01-0Jwady1a.js +1 -0
- package/dist/client/assets/{Key01-CC_tghZO.js → Key01-Dqvoolzt.js} +1 -1
- package/dist/client/assets/LayoutLeft-Nn_BPz0l.js +1 -0
- package/dist/client/assets/LinkBroken01-6J7zZ1XX.js +1 -0
- package/dist/client/assets/Minimize01-Dylk6LHz.js +1 -0
- package/dist/client/assets/{Minus-Bj5yI5D8.js → Minus-BFZz-RWg.js} +1 -1
- package/dist/client/assets/{Monitor01-DeK03po-.js → Monitor01-ZIydqkip.js} +1 -1
- package/dist/client/assets/{Play-kYcUI1An.js → Play-CkrBckKV.js} +1 -1
- package/dist/client/assets/{Plus-DEeR8qC2.js → Plus-C8Idvwpa.js} +1 -1
- package/dist/client/assets/{ReferenceLine-DbQts9AQ.js → ReferenceLine-2ZGA3m5C.js} +1 -1
- package/dist/client/assets/{SearchMd-DVpGBR2l.js → SearchMd-G9SUUXxg.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-BV5nZGeU.js → ShoppingBag01-sbzM0fY9.js} +1 -1
- package/dist/client/assets/{Sun-Ba2OXmDv.js → Sun-Bvg5JrAI.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-Cp1oX99F.js → SwitchHorizontal01-BbD-SqO6.js} +1 -1
- package/dist/client/assets/Tool01-DOjdBvJ6.js +1 -0
- package/dist/client/assets/{Tooltip-DNR0eew9.js → Tooltip-buu7_uLC.js} +1 -1
- package/dist/client/assets/{Trash01-CgZrkZ3U.js → Trash01-BRIjyxCC.js} +1 -1
- package/dist/client/assets/TrendUp01-DLgSqdSd.js +1 -0
- package/dist/client/assets/{Upload01-DDoiK0tv.js → Upload01-Dd-OapHB.js} +1 -1
- package/dist/client/assets/UserCheck01-DVOI9Qq6.js +1 -0
- package/dist/client/assets/{UserSquare-DEjJtCDR.js → UserSquare-CRBGeews.js} +1 -1
- package/dist/client/assets/{Users01-DVMhWmct.js → Users01-bZ_S-kH7.js} +1 -1
- package/dist/client/assets/{XClose-xYIhBL8b.js → XClose-CWGS9q3D.js} +1 -1
- package/dist/client/assets/{Zap-BsuEhLd3.js → Zap-BxaAY56U.js} +1 -1
- package/dist/client/assets/{access-gate-BYQd4796.js → access-gate-BpukTmFQ.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-C86xZwTt.js → add-connection-dialog-BfsrivZp.js} +1 -1
- package/dist/client/assets/agent-app-ZmiqpLI8.js +1 -0
- package/dist/client/assets/agent-assets-CxDlSc-F.js +1 -0
- package/dist/client/assets/agent-automation-Cvq2MsBo.js +20 -0
- package/dist/client/assets/agent-automations-DqPMEPTu.js +1 -0
- package/dist/client/assets/agent-blog-CBUzxo-R.js +2 -0
- package/dist/client/assets/agent-blog-post-Bi0pzlIG.js +2 -0
- package/dist/client/assets/agent-calendar-D817wzif.js +1 -0
- package/dist/client/assets/{agent-capabilities-B40k722B.js → agent-capabilities-COfZW6Pr.js} +1 -1
- package/dist/client/assets/agent-connect-sources-DEAtqQDn.js +1 -0
- package/dist/client/assets/agent-deck-DLJ_JEHY.js +1 -0
- package/dist/client/assets/agent-e2e-B_mxpyua.js +1 -0
- package/dist/client/assets/agent-experiments-CC4vS2Ak.js +1 -0
- package/dist/client/assets/agent-file-DaY3pEIy.js +1 -0
- package/dist/client/assets/agent-hosting-CNynwqai.js +1 -0
- package/dist/client/assets/agent-icon-DE4TWlDl.js +1 -0
- package/dist/client/assets/agent-library-53yJ_N0C.js +1 -0
- package/dist/client/assets/agent-library-file-CmdRdcgJ.js +1 -0
- package/dist/client/assets/agent-overview-Bjahi54k.js +1 -0
- package/dist/client/assets/agent-releases-De-C-EMX.js +2 -0
- package/dist/client/assets/agent-settings-Bmfo6yEF.js +1 -0
- package/dist/client/assets/{agent-site-editor-CS9MMMbk.js → agent-site-editor-B5E5lU9u.js} +2 -2
- package/dist/client/assets/agent-site-editor-code-BzQzaZAE.js +2 -0
- package/dist/client/assets/agent-site-editor-content-D03NaTwn.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-wStmeJD1.js +1 -0
- package/dist/client/assets/agent-view-Dh2W4gDj.js +1 -0
- package/dist/client/assets/agent-view-guard-25E2XJRr.js +1 -0
- package/dist/client/assets/ai-providers-E4UhWu6J.js +1 -0
- package/dist/client/assets/{alert-DFQMLwuf.js → alert-GV95Dsn9.js} +1 -1
- package/dist/client/assets/analytics-sections-C9-8NbQC.js +1 -0
- package/dist/client/assets/api-keys-BU9wHAPs.js +1 -0
- package/dist/client/assets/api-keys-C8ArQ5p_.js +1 -0
- package/dist/client/assets/app-editor-kEra9PRa.js +1 -0
- package/dist/client/assets/{asset-utils-DxQXeDgB.js → asset-utils-DWvcPbEZ.js} +1 -1
- package/dist/client/assets/{auth-catchall-ChHXwieU.js → auth-catchall-Dy37bIqg.js} +1 -1
- package/dist/client/assets/{auth-entry-BUy5eNSm.js → auth-entry-BHlmJEBv.js} +1 -1
- package/dist/client/assets/{auth-Br21RAsk.js → auth-gL3R1YGn.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DXcvh-93.js → auth-split-layout-ckQyQHcL.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CTJV9ez5.js → authenticate-and-persist-oauth-C7oT67KU.js} +1 -1
- package/dist/client/assets/automation-list-row-DriFJJzl.js +1 -0
- package/dist/client/assets/{automation-runs-BluUkmKT.js → automation-runs-C37do2Pw.js} +1 -1
- package/dist/client/assets/automations-tDs_UhVP.js +1 -0
- package/dist/client/assets/{badge-C2zO_tAX.js → badge-BG-k6t3T.js} +1 -1
- package/dist/client/assets/{block-document-DTM21O-Q.js → block-document-pPtike34.js} +3 -3
- package/dist/client/assets/{blocks-preview-workspace-context-0qX3i0Hw.js → blocks-preview-workspace-context-BBjk2tme.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-BZoxOO-H.js → blocks-tab-states-GP0NCNYs.js} +1 -1
- package/dist/client/assets/{blog-preview-url-Bcn3MddY.js → blog-preview-url-CwSXxQWr.js} +1 -1
- package/dist/client/assets/blog-schema-DOB707mb.js +1 -0
- package/dist/client/assets/{blog-source-gate-DcD3mNPu.js → blog-source-gate-3rG_0gJI.js} +1 -1
- package/dist/client/assets/blog-view-gate-Be4DtolQ.js +1 -0
- package/dist/client/assets/buckets-BZrhNTRn.js +1 -0
- package/dist/client/assets/{build-improve-prompt-doc-BYTmOiJ8.js → build-improve-prompt-doc-DVbQXrhG.js} +1 -1
- package/dist/client/assets/calendar-CcuaFZRF.js +1 -0
- package/dist/client/assets/{capability-load-error-CHW06qRY.js → capability-load-error-Bcs21XUc.js} +1 -1
- package/dist/client/assets/category-editor-CnJqxifY.js +1 -0
- package/dist/client/assets/{category-tree-EQNjX_vh.js → category-tree-D2ejZxYL.js} +1 -1
- package/dist/client/assets/{chart-DP-afdSL.js → chart-B2B-jcI-.js} +1 -1
- package/dist/client/assets/chat-context-CiT7AzBS.js +43 -0
- package/dist/client/assets/{chat-draft-BnT_bTVf.js → chat-draft-BNZV2YjB.js} +1 -1
- package/dist/client/assets/{checkbox-Dn6r2X61.js → checkbox-DSC8VbDf.js} +1 -1
- package/dist/client/assets/choose-editor-uAW7DjQg.js +1 -0
- package/dist/client/assets/{cli-auth-success-BWjEoABt.js → cli-auth-success-B897Xynp.js} +1 -1
- package/dist/client/assets/cms-settings-editor-B4pAxgqZ.js +1 -0
- package/dist/client/assets/{cms-store-drafts-DC7_MPeX.js → cms-store-drafts-CtClpzKs.js} +1 -1
- package/dist/client/assets/{collapsible-waKUBV3F.js → collapsible-DrV9qsGN.js} +1 -1
- package/dist/client/assets/collection-detail-DucMHrT0.js +1 -0
- package/dist/client/assets/{collection-display-button-CpOX39FE.js → collection-display-button-BHyM7wC2.js} +1 -1
- package/dist/client/assets/{collection-search-CKJ8zcS9.js → collection-search-BbCHAL7t.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DX64SyX5.js → collection-table-wrapper-BlLHObjj.js} +1 -1
- package/dist/client/assets/{collection-tabs-DL3FYMaD.js → collection-tabs-BXeEDC1Y.js} +1 -1
- package/dist/client/assets/{combobox-CZTRaybI.js → combobox-DugO3-8Q.js} +1 -1
- package/dist/client/assets/{command-B0-oLV0k.js → command-Bo6EGcaE.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-CAkQdc3e.js → companion-mcps-section-CsXLIG2Z.js} +1 -1
- package/dist/client/assets/config-CdVwRL_a.js +1 -0
- package/dist/client/assets/{client-icons-B7ckFhTB.js → connect-key--cfk-fLm.js} +1 -1
- package/dist/client/assets/{connect-layout-By1LwNsY.js → connect-layout-BPppRISp.js} +1 -1
- package/dist/client/assets/connect-lufub1FU.js +9 -0
- package/dist/client/assets/{connect-source-dialog-Clx35W2U.js → connect-source-dialog-CfsFTEbG.js} +1 -1
- package/dist/client/assets/{connection-CwOP2DkA.js → connection-BLQs5hMz.js} +1 -1
- package/dist/client/assets/{connection-card-DxEnheWw.js → connection-card-vLs08dR6.js} +1 -1
- package/dist/client/assets/connection-detail-CLkPYY1x.js +1 -0
- package/dist/client/assets/{connection-form-helpers-DsiTws_r.js → connection-form-helpers-BSIh8Ep0.js} +1 -1
- package/dist/client/assets/connection-slug-CmPPcsjf.js +1 -0
- package/dist/client/assets/connections-C4ZbA0RY.js +1 -0
- package/dist/client/assets/{content-tab-D3gTzU_j.js → content-tab-C-pzFX10.js} +4 -4
- package/dist/client/assets/context-3bSluoDN.js +1 -0
- package/dist/client/assets/{context-menu-BAywIeQG.js → context-menu-CzIORBDb.js} +1 -1
- package/dist/client/assets/{context-shell-C8ZPCYjw.js → context-shell-3lL8N_R5.js} +4 -4
- package/dist/client/assets/{create-organization-dialog-BpL43B76.js → create-organization-dialog-k086v-9Q.js} +1 -1
- package/dist/client/assets/daily-pulse-P6H0d8QI.js +1 -0
- package/dist/client/assets/{delete-copy-UjfjjP4_.js → delete-copy-BQaedVkX.js} +1 -1
- package/dist/client/assets/{device-hint-AWxEadtg.js → device-hint-CvnqGHIy.js} +1 -1
- package/dist/client/assets/discover-qzwfuJLu.js +1 -0
- package/dist/client/assets/{domain-settings-BCvvef40.js → domain-settings-y3u2iu2W.js} +1 -1
- package/dist/client/assets/{drawer-CfOCKnhq.js → drawer-CarQd6Jb.js} +1 -1
- package/dist/client/assets/{editor-COFIs9XE.js → editor-DYk_2MJQ.js} +1 -1
- package/dist/client/assets/{editor-classes-aqVUSPbm.js → editor-classes-DVIoQu74.js} +1 -1
- package/dist/client/assets/{empty-message-CirmMDhM.js → empty-message-C90DlePv.js} +1 -1
- package/dist/client/assets/{empty-state-C7Sg1bax.js → empty-state-B67nwURy.js} +1 -1
- package/dist/client/assets/{empty-state-CFvQY7HR.js → empty-state-XAK3RjVy.js} +1 -1
- package/dist/client/assets/experiments-tab-choice-D8ZqCESL.js +1 -0
- package/dist/client/assets/{extract-connection-data-CFxfI9gN.js → extract-connection-data-D6CjTXbp.js} +1 -1
- package/dist/client/assets/feature-gate-CCvZeJRu.js +1 -0
- package/dist/client/assets/{feature-paywall-AtUr_EOu.js → feature-paywall-DzmzZ5s3.js} +1 -1
- package/dist/client/assets/file-explorer-BqxAkXtr.js +2 -0
- package/dist/client/assets/{file-preview-PSKf9fIz.js → file-preview-C0yEEExh.js} +1 -1
- package/dist/client/assets/file-share-button-CowSSkLB.js +3 -0
- package/dist/client/assets/{file-type-icon-3Zm8W435.js → file-type-icon-CEP8k4gh.js} +1 -1
- package/dist/client/assets/folder-icon-CmtFeppJ.js +1 -0
- package/dist/client/assets/{form-BZ7xdssd.js → form-8GAe5FIZ.js} +1 -1
- package/dist/client/assets/{frame-navigation-8oPGH7NY.js → frame-navigation-BpI5RQJq.js} +1 -1
- package/dist/client/assets/gateway-client-BqPME1T5.js +1 -0
- package/dist/client/assets/general-DbhKzHt5.js +1 -0
- package/dist/client/assets/{github-icon-DH5Sm3NR.js → github-icon-BH4kK9If.js} +1 -1
- package/dist/client/assets/{held-block-view-BR-UYX4S.js → held-block-view-MI6LUwjK.js} +3 -3
- package/dist/client/assets/home-_NmLJi-9.js +1 -0
- package/dist/client/assets/home-overview-CTEEkh3w.js +1 -0
- package/dist/client/assets/{hosted-reconcile-C5UVxzTP.js → hosted-reconcile-BbIfIwl1.js} +1 -1
- package/dist/client/assets/{icon-button-BfibpDoO.js → icon-button-Dd8gTd4-.js} +1 -1
- package/dist/client/assets/index-B-OtHlgY.js +4 -0
- package/dist/client/assets/{index-BXpXjiyK.js → index-BRHz7VD8.js} +1 -1
- package/dist/client/assets/{index-dsAQGF7D.js → index-BY10zRfl.js} +1 -1
- package/dist/client/assets/index-B_-z8Lrt.js +1 -0
- package/dist/client/assets/{index-DF1Gszum.js → index-C17JTAPe.js} +2 -2
- package/dist/client/assets/{index-n1AjR0vt.js → index-CADsC-mK.js} +2 -2
- package/dist/client/assets/{index-BpLEscAk.js → index-CYjM_f4V.js} +1 -1
- package/dist/client/assets/{index-Db96seLi.js → index-CZQ-Wgjf.js} +1 -1
- package/dist/client/assets/{index-BP527m3V.js → index-CwntHk8S.js} +13 -13
- package/dist/client/assets/index-DClpdtOI.js +1 -0
- package/dist/client/assets/{index-Ds3fsbcX.js → index-DEOQXzn-.js} +1 -1
- package/dist/client/assets/{index-DZi8I8ot.js → index-DIHnNoyA.js} +1 -1
- package/dist/client/assets/{index-DoH06YKc.js → index-DPCC7KEx.js} +1 -1
- package/dist/client/assets/{index-CQ7e2YEj.js → index-Dez-6rcd.js} +1 -1
- package/dist/client/assets/index-Dkr4Q9bE.js +1 -0
- package/dist/client/assets/{index-CmzG_GaM.js → index-Do3hK3is.js} +1 -1
- package/dist/client/assets/{index-jQ2gY_fm.js → index-km18CQ4q.js} +1 -1
- package/dist/client/assets/index-pbgcO64n.css +1 -0
- package/dist/client/assets/{index-redirect-QRKsjVCi.js → index-redirect-CTR6WNPG.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-BFZQsptZ.js → infiniteQueryObserver-DdeQTeaz.js} +1 -1
- package/dist/client/assets/infra-billing-tXzfTwHJ.js +1 -0
- package/dist/client/assets/input-CxFJosPu.js +17 -0
- package/dist/client/assets/{input-C1HwcZTs.js → input-DXyNd1dE.js} +1 -1
- package/dist/client/assets/{integration-icon-XUOEUOb8.js → integration-icon-BCAGJ22m.js} +1 -1
- package/dist/client/assets/item-actions-B4f3ZYnI.js +1 -0
- package/dist/client/assets/{jira-icon-B48lqxRs.js → jira-icon-B0PrtQPW.js} +1 -1
- package/dist/client/assets/{label-DSlWCd9e.js → label-BFX3DXnu.js} +1 -1
- package/dist/client/assets/{layout-QjOyVmz4.js → layout-GEd6141D.js} +1 -1
- package/dist/client/assets/{legacy-admin-welcome-dialog-DWeHIzCA.js → legacy-admin-welcome-dialog-CjbAHNU0.js} +1 -1
- package/dist/client/assets/legacy-agents-deep-BRMRDtxS.js +1 -0
- package/dist/client/assets/{legacy-main-redirect-h5ds91_H.js → legacy-main-redirect-Cpcnm12P.js} +1 -1
- package/dist/client/assets/library-GlSV21no.js +1 -0
- package/dist/client/assets/{library-tab-DI2mHZkf.js → library-tab-DiZQg1qQ.js} +2 -2
- package/dist/client/assets/{login-DgKeSKz2.js → login-DUNIcOhP.js} +1 -1
- package/dist/client/assets/{markdown-BTKw4nl8.js → markdown-sWsq0zMA.js} +5 -5
- package/dist/client/assets/{mcp-app-renderer-BT9_tzyT.js → mcp-app-renderer-DSMzeo3v.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BQRDLkqA.js → mcp-oauth-Cal4irlG.js} +1 -1
- package/dist/client/assets/{mcp-oauth-1Tp9szFm.js → mcp-oauth-DFWIYz5V.js} +1 -1
- package/dist/client/assets/members-D9DcuyAK.js +1 -0
- package/dist/client/assets/memory-DYN3365K.js +7 -0
- package/dist/client/assets/mock-board-llSJ1DSL.js +10 -0
- package/dist/client/assets/{monaco-editor-DTLNzmeB.js → monaco-editor-4_N5zBDQ.js} +1 -1
- package/dist/client/assets/{monitoring-CRmBvi8F.js → monitoring-5YgUKCBd.js} +2 -2
- package/dist/client/assets/{monitoring-stats-row-G2RBze7B.js → monitoring-stats-row-BCaHkQz9.js} +1 -1
- package/dist/client/assets/multi-select-B4K-daTY.js +1 -0
- package/dist/client/assets/{mustache-p2j_fCOZ.js → mustache-B8t03rZ4.js} +1 -1
- package/dist/client/assets/{named-rule-step-BJ5LyK07.js → named-rule-step-P0BFUtVs.js} +1 -1
- package/dist/client/assets/named-rule-view-CvRYAekO.js +1 -0
- package/dist/client/assets/new-project-dialog-DI67z-Vr.js +1 -0
- package/dist/client/assets/new-project-store-DoliA5Iq.js +1 -0
- package/dist/client/assets/{oauth-callback-Cg1KjIf_.js → oauth-callback-DtdbhW3N.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-hOquTBPU.js → oauth-callback-ai-provider-iNwVQAC1.js} +1 -1
- package/dist/client/assets/{oauth-consent-CzhJum4d.js → oauth-consent-Co0jE424.js} +1 -1
- package/dist/client/assets/{onboarding-FLu6ztJj.js → onboarding-Dn4ndntc.js} +1 -1
- package/dist/client/assets/openai-conversation-D43N7JcR.js +3 -0
- package/dist/client/assets/{optimistic-project-sidebar-views-D6axz004.js → optimistic-project-sidebar-views-PUKP14F8.js} +1 -1
- package/dist/client/assets/order-monitor-day-fHekYy64.js +1 -0
- package/dist/client/assets/{organization-choice-dV-mJr-d.js → organization-choice-Ctd80SL2.js} +1 -1
- package/dist/client/assets/orgs-BQeWnD4l.js +1 -0
- package/dist/client/assets/own-accounts-section-CwzdBIu0.js +1 -0
- package/dist/client/assets/pair-Du2wOAPA.js +48 -0
- package/dist/client/assets/{parse-sections-Cy8SKsEh.js → parse-sections-DUEfhNb0.js} +4 -4
- package/dist/client/assets/plan-BDh0er6r.js +1 -0
- package/dist/client/assets/{plan-ladder-xVKcSuhD.js → plan-ladder-cJHOFEt_.js} +1 -1
- package/dist/client/assets/{plan-usage-card-Cxjcl-tF.js → plan-usage-card-DnCWaNBs.js} +1 -1
- package/dist/client/assets/{popover-CelLmvH8.js → popover-XZWwzjJe.js} +1 -1
- package/dist/client/assets/post-calendar-Cq2VElZ4.js +1 -0
- package/dist/client/assets/{post-editor-DkdXE0U4.js → post-editor-ChZHYnmE.js} +2 -2
- package/dist/client/assets/preview-content-Ct9U0F_F.js +1 -0
- package/dist/client/assets/{preview-dialog-BTVSDgVC.js → preview-dialog-BlN_MeAY.js} +1 -1
- package/dist/client/assets/{preview-panel-COaKD6oK.js → preview-panel-CMaIBxrS.js} +1 -1
- package/dist/client/assets/preview-tab-rp6yyGU1.js +557 -0
- package/dist/client/assets/product-picker-dialog-Cp5iroCv.js +1 -0
- package/dist/client/assets/profile-BvhSJiAV.js +1 -0
- package/dist/client/assets/project-app-view-BPtWGCfo.js +1 -0
- package/dist/client/assets/project-apps-CDSLxQ6C.js +1 -0
- package/dist/client/assets/{project-icon-TEwy-duh.js → project-icon-C_Qws_Ah.js} +1 -1
- package/dist/client/assets/{project-index-DqRiC0zN.js → project-index-dmu51Z_5.js} +1 -1
- package/dist/client/assets/project-reports-BVUPVqwF.js +1 -0
- package/dist/client/assets/project-tasks-i5QwXcB1.js +1 -0
- package/dist/client/assets/projects-9cB_xTYP.js +1 -0
- package/dist/client/assets/{projects-empty-state-OMTDG8SV.js → projects-empty-state-ZoaV8gjs.js} +1 -1
- package/dist/client/assets/{prompts-TP7YCuz6.js → prompts-DfPwtsSz.js} +1 -1
- package/dist/client/assets/record-editor-BQX3fl3B.js +1 -0
- package/dist/client/assets/redirect-editor-DmgDoBZW.js +1 -0
- package/dist/client/assets/{reports-CvxegUiQ.js → reports-B7Mq5ojT.js} +1 -1
- package/dist/client/assets/reports-Dmcxcdt8.js +1 -0
- package/dist/client/assets/reports-onboarding-DnVjGniS.js +1 -0
- package/dist/client/assets/reports-tab-D7WrLBuD.js +2 -0
- package/dist/client/assets/repositories-B6qJORdw.js +1 -0
- package/dist/client/assets/repositories-CKo-J8oc.js +1 -0
- package/dist/client/assets/{repository-binding-DGc5VhVW.js → repository-binding-Cqb4hBI0.js} +1 -1
- package/dist/client/assets/{repository-picker-DO5Hy-o-.js → repository-picker-B967M4cj.js} +1 -1
- package/dist/client/assets/{require-capability-CCGZ96D-.js → require-capability-CnRgBqvn.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DoMwdVaZ.js → required-auth-layout-DwZV69de.js} +1 -1
- package/dist/client/assets/{reset-password-B672rI1V.js → reset-password-DBlLRH7P.js} +1 -1
- package/dist/client/assets/resizable-Ddu9Pik_.js +1 -0
- package/dist/client/assets/resolve-tab-icon-C5v6XuFJ.js +1 -0
- package/dist/client/assets/{review-settings-B8FCs2a_.js → review-settings-_NtVHX9D.js} +1 -1
- package/dist/client/assets/{role-color-CPDxseg4.js → role-color-CYCY1ZHM.js} +1 -1
- package/dist/client/assets/roles-BOIysbZW.js +1 -0
- package/dist/client/assets/route-B2eUAr3E.js +1 -0
- package/dist/client/assets/route-DjNFlT9m.js +1 -0
- package/dist/client/assets/route-l3dfZAcw.js +1 -0
- package/dist/client/assets/route-page-header-x4fiBRQK.js +1 -0
- package/dist/client/assets/{sandbox-git-api-3zULVhcU.js → sandbox-git-api-CX3IYPAX.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-BEzUu66E.js → sandbox-lifecycle-context-CsmYXarj.js} +1 -1
- package/dist/client/assets/save-status-DM-afM9Q.js +1 -0
- package/dist/client/assets/{schema-DIJe3qA1.js → schema-Bh0CFZUA.js} +1 -1
- package/dist/client/assets/{schema-BtzAS_P2.js → schema-CsGAsuNy.js} +1 -1
- package/dist/client/assets/{scroll-area-mVo2jhxQ.js → scroll-area-DkuLv9J_.js} +1 -1
- package/dist/client/assets/{search-input-ChnwrZA6.js → search-input-Yj0UUhbr.js} +1 -1
- package/dist/client/assets/{search-toggle-CC4Rs40x.js → search-toggle-CTqn74j5.js} +1 -1
- package/dist/client/assets/{secret-picker-CWGbJrCR.js → secret-picker-FNSDTzDT.js} +1 -1
- package/dist/client/assets/secrets-DnkJAwly.js +1 -0
- package/dist/client/assets/{section-array-field-4mOiVd7b.js → section-array-field-DbmoEjb3.js} +1 -1
- package/dist/client/assets/sections-Bk5O8laV.js +1 -0
- package/dist/client/assets/sections-editor-BYa3JqlT.js +1 -0
- package/dist/client/assets/select-DqZVtjvu.js +1 -0
- package/dist/client/assets/{select-model-BqTl5eD-.js → select-model-D_3F7ch9.js} +1 -1
- package/dist/client/assets/{seo-editor-iaqzR9NS.js → seo-editor-alLFkZ3V.js} +1 -1
- package/dist/client/assets/{separator-CwN-gidC.js → separator-DOH2DVT3.js} +1 -1
- package/dist/client/assets/session-runtime-DaEm9VzJ.js +1 -0
- package/dist/client/assets/settings-tab-Dnn9Ngte.js +1 -0
- package/dist/client/assets/{sheet-1BLiVjE3.js → sheet-B3BCtfXu.js} +1 -1
- package/dist/client/assets/shell-layout-BMy93BCc.js +1 -0
- package/dist/client/assets/{site-draft-actions-GLib44bU.js → site-draft-actions-C2zLtAMz.js} +5 -5
- package/dist/client/assets/site-draft-view-ikG8CMuB.js +1 -0
- package/dist/client/assets/site-editor-B8VlT5Kv.js +1 -0
- package/dist/client/assets/site-editor-toast-GAJZE2A0.js +1 -0
- package/dist/client/assets/skills-dIhMA0Ze.js +1 -0
- package/dist/client/assets/{slider-BKrw7nqs.js → slider-DirLi5JL.js} +1 -1
- package/dist/client/assets/{sortable.esm-CA_k0RaZ.js → sortable.esm-B3zbNG6q.js} +1 -1
- package/dist/client/assets/sso-tZNmyRgp.js +1 -0
- package/dist/client/assets/{suggestion-BdOz28RC.js → suggestion-bCd1m59t.js} +1 -1
- package/dist/client/assets/{super-agent-icon-DExAOD4i.js → super-agent-icon-AJ6ZRe5V.js} +1 -1
- package/dist/client/assets/{switch-B60LgmjA.js → switch-BviC1co2.js} +1 -1
- package/dist/client/assets/{synced-repos-DfFbkdSN.js → synced-repos-DsEdkMaA.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-MzzsG5oc.js → tab-icon-glyph-DkjrfS6l.js} +1 -1
- package/dist/client/assets/{table-KEskYvtS.js → table-DX15DDx1.js} +1 -1
- package/dist/client/assets/{tabs-DXm_rA9S.js → tabs-BiFBpWbA.js} +1 -1
- package/dist/client/assets/task-board-DD2iUGL4.js +1 -0
- package/dist/client/assets/{core.esm-YEEWezEY.js → task-key-DP7js_2-.js} +2 -2
- package/dist/client/assets/task-route-Bfb6XWlb.js +1 -0
- package/dist/client/assets/{task-status-Bn4DeOrT.js → task-status-CBWakThc.js} +1 -1
- package/dist/client/assets/taskboard-analytics-B5XiM0gZ.js +1 -0
- package/dist/client/assets/{tasks-fWq-fqoJ.js → tasks-BPwrQv5-.js} +3 -3
- package/dist/client/assets/tasks-ip1BqsyR.js +1 -0
- package/dist/client/assets/{textarea-CRgCAK3p.js → textarea-BoSVR1xB.js} +1 -1
- package/dist/client/assets/thread-analytics-B3wSdPFK.js +1 -0
- package/dist/client/assets/thread-button-CIHD7120.js +1 -0
- package/dist/client/assets/{thread-intent-DrRX6nG0.js → thread-intent-DpzwhK2y.js} +6 -6
- package/dist/client/assets/thread-route-Bdw4g7Hg.js +1 -0
- package/dist/client/assets/thread-route-D4mea9ep.js +1 -0
- package/dist/client/assets/thread-sheet-body-C1_HCALD.js +1 -0
- package/dist/client/assets/time-range-picker-B9_5lQqT.js +1 -0
- package/dist/client/assets/{toggle-group-JYZ1PCaE.js → toggle-group-l7lV2Oqp.js} +1 -1
- package/dist/client/assets/{tool-set-selector-DTAr1xzz.js → tool-set-selector-BQISxiF9.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-B0M5XFng.js → toolbar-icon-button-CflJ2Qid.js} +1 -1
- package/dist/client/assets/{tooltip-D9qNlq6S.js → tooltip-BTd3W-2Z.js} +1 -1
- package/dist/client/assets/{tooltipContext-B94TDN-Q.js → tooltipContext-De8eALzu.js} +1 -1
- package/dist/client/assets/{track-DJVHN5Lv.js → track-BBHYiJkY.js} +1 -1
- package/dist/client/assets/{types-BfPC7vnd.js → types-C8b3acwX.js} +1 -1
- package/dist/client/assets/{url-slug-Bts08KOo.js → url-slug-gNlq1cKV.js} +1 -1
- package/dist/client/assets/{usage-stats-CK4hgSt6.js → usage-stats-Bk_1jh1-.js} +2 -2
- package/dist/client/assets/{use-ai-providers-CxZCPqVC.js → use-ai-providers-Cya2RotC.js} +1 -1
- package/dist/client/assets/use-api-keys-BdlPKuv4.js +1 -0
- package/dist/client/assets/use-apply-named-rule-CcoLpt-_.js +1 -0
- package/dist/client/assets/use-ask-in-chat-B_ARVX9A.js +1 -0
- package/dist/client/assets/{use-automations-B7d02VWl.js → use-automations-CerQ9Qaj.js} +1 -1
- package/dist/client/assets/{use-autosave-DOc72aWE.js → use-autosave-CQa7WbXM.js} +1 -1
- package/dist/client/assets/use-blocks-v8-project-BedqZgtc.js +1 -0
- package/dist/client/assets/use-blog-view-9s3Vkx1q.js +1 -0
- package/dist/client/assets/use-chat-layout-state-CWt5k1nY.js +1 -0
- package/dist/client/assets/{use-cms-publish-actions-DimSJzWP.js → use-cms-publish-actions-7QluCfa8.js} +4 -4
- package/dist/client/assets/use-connect-companion-B8Oqj7MQ.js +1 -0
- package/dist/client/assets/{use-connection-CFmR-X06.js → use-connection-2s3z_IKD.js} +1 -1
- package/dist/client/assets/{use-content-sync-BEqIA-0g.js → use-content-sync-DxzP8nN9.js} +1 -1
- package/dist/client/assets/{use-copy-PziytufC.js → use-copy-sOY8Yuot.js} +1 -1
- package/dist/client/assets/use-current-view-EjRzX02x.js +1 -0
- package/dist/client/assets/{use-date-fns-locale-BVsHKqDt.js → use-date-fns-locale-DjDbgiCF.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CU3dUlJX.js → use-debounced-autosave--lHIRoNY.js} +1 -1
- package/dist/client/assets/{use-debounced-value-DJ5YZsat.js → use-debounced-value-RJW46-1q.js} +1 -1
- package/dist/client/assets/{use-deco-credits-_9aC49vI.js → use-deco-credits-d4Nbb0l0.js} +1 -1
- package/dist/client/assets/use-decopilot-events-BGpwG8Pb.js +1 -0
- package/dist/client/assets/use-delete-block-BR5smTsV.js +1 -0
- package/dist/client/assets/{use-delete-connection-Bp9D22pQ.js → use-delete-connection-DHkW3H9t.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-D8TSoW7b.js → use-deployment-admin-j92yIioi.js} +1 -1
- package/dist/client/assets/{use-entitlements-Chh3D10H.js → use-entitlements-DtyegfyM.js} +1 -1
- package/dist/client/assets/use-fast-preview-draft-url-B4HFa9pK.js +1 -0
- package/dist/client/assets/{use-file-configs-8VTVKs7P.js → use-file-configs-CzyibAGV.js} +1 -1
- package/dist/client/assets/{use-id-selection-LGL3_97F.js → use-id-selection-DSQKok9P.js} +1 -1
- package/dist/client/assets/use-in-settings-DLJEfljS.js +1 -0
- package/dist/client/assets/{use-inbox-feed-DjVLN02v.js → use-inbox-feed-BNnBKFlA.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BBVWbqWO.js → use-infinite-scroll-D1tYrKq7.js} +1 -1
- package/dist/client/assets/{use-join-requests-4dddz-2V.js → use-join-requests-CSjMfH5p.js} +1 -1
- package/dist/client/assets/use-main-panel-tabs-CllMGKzI.js +1 -0
- package/dist/client/assets/use-mcp-auth-status-DS0pbV57.js +1 -0
- package/dist/client/assets/{use-mcp-client-CaYmuD4l.js → use-mcp-client-Cvc3WWPF.js} +2 -2
- package/dist/client/assets/{use-mcp-prompts-lHtFGIni.js → use-mcp-prompts-Ck1uv43A.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-COoBOTb8.js → use-mcp-tools-BIzewITl.js} +1 -1
- package/dist/client/assets/{use-mobile-B0YlxBUo.js → use-mobile-CG2XwDbe.js} +1 -1
- package/dist/client/assets/{use-move-blocks-CRsMTnFT.js → use-move-blocks-Dv6zyDyx.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-D9u86crS.js → use-navigate-to-agent-BFBISUMc.js} +1 -1
- package/dist/client/assets/use-never-published-D3zJmakm.js +1 -0
- package/dist/client/assets/{use-org-fs-Cv09aZqm.js → use-org-fs-BfE7L8cf.js} +1 -1
- package/dist/client/assets/use-org-notice-DghJzmC_.js +1 -0
- package/dist/client/assets/{use-org-repo-syncs-CKUvsIrW.js → use-org-repo-syncs-CU3MGWk9.js} +1 -1
- package/dist/client/assets/{use-org-sso-CBrdU305.js → use-org-sso-C8BMUr72.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BWLJTTpw.js → use-organization-settings-Ddjh427l.js} +1 -1
- package/dist/client/assets/use-panel-navigate-V2MXWXLu.js +1 -0
- package/dist/client/assets/use-project-native-view-presence-EdJBeOw9.js +1 -0
- package/dist/client/assets/use-project-scope-COzEo5Zz.js +1 -0
- package/dist/client/assets/use-recent-apps-BpR_nbgz.js +1 -0
- package/dist/client/assets/{use-reports-diagnostic-CgjecoRR.js → use-reports-diagnostic-DYf7sFCj.js} +1 -1
- package/dist/client/assets/use-sandbox-events-cbWqZuIm.js +2 -0
- package/dist/client/assets/{use-secrets-D46GKExN.js → use-secrets-BamKWPUs.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-BO578O9L.js → use-section-preview-base-Cy_X_Jjl.js} +1 -1
- package/dist/client/assets/use-sidebar-collapsed-CGkkkrTj.js +1 -0
- package/dist/client/assets/{use-tags-LwHF4ikl.js → use-tags-staoqXQp.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-TZTLLgky.js → use-task-board-analytics-C5Dsg-uV.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-BW_n16vt.js → use-task-board-item-prs-DsFjq28v.js} +1 -1
- package/dist/client/assets/use-task-board-items-OgSDu-ag.js +1 -0
- package/dist/client/assets/{use-task-board-prompts-CHIblyN4.js → use-task-board-prompts-Bn4-yS6Z.js} +1 -1
- package/dist/client/assets/{use-task-metadata-DdKhuIQ3.js → use-task-metadata-Bc8o5Sts.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-DsjZa1n5.js → use-thread-outputs-Co5bznxQ.js} +1 -1
- package/dist/client/assets/use-view-draft-kind-BdwsMdex.js +1 -0
- package/dist/client/assets/use-voice-input-CwLNuWlo.js +1 -0
- package/dist/client/assets/useInfiniteQuery-BagPKS5m.js +1 -0
- package/dist/client/assets/{useQueries-B8jtB-RW.js → useQueries-BjVZ4kPO.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BUmkwIx5.js +1 -0
- package/dist/client/assets/{users-zlgoDQuW.js → users-CPRHIyd2.js} +1 -1
- package/dist/client/assets/utils-DPEBLDgi.js +4 -0
- package/dist/client/assets/variant-calendar-Dlw46bNO.js +1 -0
- package/dist/client/assets/{variant-matcher-override-BKIrGg8S.js → variant-matcher-override-ChW3ijK5.js} +1 -1
- package/dist/client/assets/{view-header-OfKMmhb0.js → view-header-D4oknAV1.js} +1 -1
- package/dist/client/assets/virtual-mcp-nhrh3mtw.js +1 -0
- package/dist/client/assets/{watch-sse-pool-B39Ow5tK.js → watch-sse-pool-CTgVk3NA.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/ChevronUp-DM7pn8nV.js +0 -1
- package/dist/client/assets/LinkBroken01-4l2zZef9.js +0 -1
- package/dist/client/assets/Tool01-BlUlKjGy.js +0 -1
- package/dist/client/assets/agent-app-qCE6mpox.js +0 -1
- package/dist/client/assets/agent-assets-BERkZgBg.js +0 -1
- package/dist/client/assets/agent-automation-B3znFoJv.js +0 -20
- package/dist/client/assets/agent-automations-BI5n1DEk.js +0 -1
- package/dist/client/assets/agent-blog-DFA4iTY2.js +0 -2
- package/dist/client/assets/agent-blog-post-CJzR6SRp.js +0 -2
- package/dist/client/assets/agent-calendar-DCBRCsam.js +0 -1
- package/dist/client/assets/agent-connect-sources-BvH_YwiD.js +0 -1
- package/dist/client/assets/agent-deck-C_9xRnWL.js +0 -1
- package/dist/client/assets/agent-e2e-B2FpHDAG.js +0 -1
- package/dist/client/assets/agent-experiments-BDFLMLOM.js +0 -1
- package/dist/client/assets/agent-file-CAkn0Q5x.js +0 -1
- package/dist/client/assets/agent-hosting-D0d8gHPR.js +0 -1
- package/dist/client/assets/agent-icon-CpMz1pSC.js +0 -1
- package/dist/client/assets/agent-library-Cs6jlCDK.js +0 -1
- package/dist/client/assets/agent-library-file-DV2qsJC9.js +0 -1
- package/dist/client/assets/agent-overview-IBMGymrh.js +0 -1
- package/dist/client/assets/agent-releases-k0DaB9LQ.js +0 -2
- package/dist/client/assets/agent-settings-DF71XJZP.js +0 -1
- package/dist/client/assets/agent-site-editor-code-gfgfb7xF.js +0 -2
- package/dist/client/assets/agent-site-editor-content-C07hh63_.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-CFg2FnqN.js +0 -1
- package/dist/client/assets/agent-view-CzQtfKwQ.js +0 -1
- package/dist/client/assets/agent-view-guard-XdI97YrW.js +0 -1
- package/dist/client/assets/ai-providers-DoacYpUR.js +0 -1
- package/dist/client/assets/analytics-sections-DNjeT1Pf.js +0 -1
- package/dist/client/assets/api-keys-Bbyyi1IV.js +0 -1
- package/dist/client/assets/api-keys-CLzhmgUv.js +0 -1
- package/dist/client/assets/app-editor-Cd7oWsvo.js +0 -1
- package/dist/client/assets/automation-list-row-COaiktOt.js +0 -1
- package/dist/client/assets/automations-BvZ8wxJr.js +0 -1
- package/dist/client/assets/blog-schema-PWQlG4FM.js +0 -1
- package/dist/client/assets/blog-view-gate-BpiHsFQi.js +0 -1
- package/dist/client/assets/buckets-r-Vn310N.js +0 -1
- package/dist/client/assets/calendar-DkvAGmxG.js +0 -1
- package/dist/client/assets/category-editor-D53-0-dG.js +0 -1
- package/dist/client/assets/chat-context-Na_9rQo_.js +0 -39
- package/dist/client/assets/choose-editor-DFYfaLQ4.js +0 -1
- package/dist/client/assets/cms-settings-editor-BLtwrg_Q.js +0 -1
- package/dist/client/assets/collection-detail-BdQUzwBw.js +0 -1
- package/dist/client/assets/config-DhSdzr_l.js +0 -1
- package/dist/client/assets/connect-DwtFEmWa.js +0 -9
- package/dist/client/assets/connection-detail-Bm5pNgz3.js +0 -1
- package/dist/client/assets/connection-slug-CqKJM07D.js +0 -1
- package/dist/client/assets/connections-8N6-U8BU.js +0 -1
- package/dist/client/assets/context-CdMMXT5s.js +0 -1
- package/dist/client/assets/discover-DhvRjqxh.js +0 -1
- package/dist/client/assets/experiments-tab-choice-Ch-KXcUZ.js +0 -1
- package/dist/client/assets/feature-gate-BsIQ70jm.js +0 -1
- package/dist/client/assets/file-explorer-DpEdUCiL.js +0 -2
- package/dist/client/assets/file-share-button-D9sAYI1R.js +0 -3
- package/dist/client/assets/folder-icon-D4-RUOt8.js +0 -1
- package/dist/client/assets/general-Bt-teqGz.js +0 -1
- package/dist/client/assets/home-CIpHO2ej.js +0 -1
- package/dist/client/assets/home-overview-9H7C1hoB.js +0 -1
- package/dist/client/assets/index-BqWale_V.css +0 -1
- package/dist/client/assets/index-DCl7HPjQ.js +0 -1
- package/dist/client/assets/index-DN9fxTzN.js +0 -1
- package/dist/client/assets/index-DuYneP0E.js +0 -1
- package/dist/client/assets/index-tLhNg31B.js +0 -4
- package/dist/client/assets/infra-billing-C3ShZZOT.js +0 -1
- package/dist/client/assets/input-GqBshPf5.js +0 -17
- package/dist/client/assets/item-actions-BfBBT1Qz.js +0 -1
- package/dist/client/assets/legacy-agents-deep-COHFWDWb.js +0 -1
- package/dist/client/assets/library-BMXElwFo.js +0 -1
- package/dist/client/assets/members-DQZtkBei.js +0 -1
- package/dist/client/assets/memory-B82F2Q7k.js +0 -7
- package/dist/client/assets/mock-board-B7BOXAS7.js +0 -10
- package/dist/client/assets/multi-select-ykLyfeEh.js +0 -1
- package/dist/client/assets/named-rule-view-BBEm0z_K.js +0 -1
- package/dist/client/assets/new-project-dialog-C3JFSI1q.js +0 -1
- package/dist/client/assets/openai-conversation-DhsFXaEr.js +0 -3
- package/dist/client/assets/order-monitor-day-CQJg9ymu.js +0 -1
- package/dist/client/assets/orgs-DafOcWKJ.js +0 -1
- package/dist/client/assets/own-accounts-section-BitxRWkd.js +0 -1
- package/dist/client/assets/pair-Dsc6GXhQ.js +0 -48
- package/dist/client/assets/plan-5t2sCqh-.js +0 -1
- package/dist/client/assets/post-calendar-DkUmj6jK.js +0 -1
- package/dist/client/assets/preview-content-Di9jV9fD.js +0 -1
- package/dist/client/assets/preview-tab-BFi8NHe-.js +0 -557
- package/dist/client/assets/product-picker-dialog-tqTphLK7.js +0 -1
- package/dist/client/assets/profile-ItK6hTrx.js +0 -1
- package/dist/client/assets/project-app-view-CMAf9Mlz.js +0 -1
- package/dist/client/assets/project-apps-ByyLejju.js +0 -1
- package/dist/client/assets/project-reports-CPvLPQcs.js +0 -1
- package/dist/client/assets/project-tasks-B88cPPXW.js +0 -1
- package/dist/client/assets/projects-FY3sblQl.js +0 -1
- package/dist/client/assets/record-editor-IJLTcCdR.js +0 -1
- package/dist/client/assets/redirect-editor-B2-M7doi.js +0 -1
- package/dist/client/assets/reports-ODcJFAP-.js +0 -1
- package/dist/client/assets/reports-onboarding-BicRsxJF.js +0 -1
- package/dist/client/assets/reports-tab-CCY5hBR2.js +0 -2
- package/dist/client/assets/repositories-C0edGPcS.js +0 -1
- package/dist/client/assets/repositories-V6vmPwSM.js +0 -1
- package/dist/client/assets/resizable-DrLaW_Jl.js +0 -1
- package/dist/client/assets/resolve-tab-icon-CfRdrLF-.js +0 -1
- package/dist/client/assets/roles-BYqU9-We.js +0 -1
- package/dist/client/assets/route-BXYvPulM.js +0 -1
- package/dist/client/assets/route-Bh9fCZXT.js +0 -1
- package/dist/client/assets/route-a1KQq-lz.js +0 -1
- package/dist/client/assets/save-status-Cx3aKwGu.js +0 -1
- package/dist/client/assets/secrets-DE59ARp-.js +0 -1
- package/dist/client/assets/sections-B1sv3rvB.js +0 -1
- package/dist/client/assets/sections-editor-sTEVWcAy.js +0 -1
- package/dist/client/assets/select-BNoZ1cwH.js +0 -1
- package/dist/client/assets/settings-tab-H1Nf96Yz.js +0 -1
- package/dist/client/assets/shell-layout-BHtZVBED.js +0 -1
- package/dist/client/assets/site-draft-view-CKK7PKoH.js +0 -1
- package/dist/client/assets/site-editor-Bl3uFRW-.js +0 -1
- package/dist/client/assets/site-editor-toast-BXRGIPuY.js +0 -1
- package/dist/client/assets/skills-Q6l6j9x7.js +0 -1
- package/dist/client/assets/sso-C4bCFgaT.js +0 -1
- package/dist/client/assets/task-board-CdhOR9bl.js +0 -1
- package/dist/client/assets/task-key-BCHdFiOO.js +0 -1
- package/dist/client/assets/task-route-DeSbQRkP.js +0 -1
- package/dist/client/assets/taskboard-analytics-CRI_d1NW.js +0 -1
- package/dist/client/assets/tasks-DGRURa32.js +0 -1
- package/dist/client/assets/thread-analytics-aoAc3KR6.js +0 -1
- package/dist/client/assets/thread-route-D404Xl1w.js +0 -1
- package/dist/client/assets/thread-route-L_F2dRjs.js +0 -1
- package/dist/client/assets/thread-sheet-body-D3DOFB6A.js +0 -1
- package/dist/client/assets/time-range-picker-DouTd8PJ.js +0 -1
- package/dist/client/assets/tool-namespace-BBpCD9sF.js +0 -1
- package/dist/client/assets/use-apply-named-rule-h1W6SPpC.js +0 -1
- package/dist/client/assets/use-ask-in-chat-D4gRql_N.js +0 -1
- package/dist/client/assets/use-blocks-v8-project-BLLvbZl2.js +0 -1
- package/dist/client/assets/use-chat-layout-state-DQhX2zdi.js +0 -1
- package/dist/client/assets/use-connect-companion-CqTyzSlz.js +0 -1
- package/dist/client/assets/use-decopilot-events-B84nN_Z6.js +0 -1
- package/dist/client/assets/use-delete-block-BbJuByhU.js +0 -1
- package/dist/client/assets/use-fast-preview-draft-url-DRtzWCS3.js +0 -1
- package/dist/client/assets/use-main-panel-tabs-Bq834oWY.js +0 -1
- package/dist/client/assets/use-mcp-auth-status-ewp8JzH8.js +0 -1
- package/dist/client/assets/use-never-published-BRSQAhRd.js +0 -1
- package/dist/client/assets/use-project-native-view-presence-D5R7YysD.js +0 -1
- package/dist/client/assets/use-project-scope-Dzg0nsjs.js +0 -1
- package/dist/client/assets/use-recent-apps-BKAftwoT.js +0 -1
- package/dist/client/assets/use-sandbox-events-BtXLDGZr.js +0 -2
- package/dist/client/assets/use-sidebar-collapsed-x7SsKYNl.js +0 -1
- package/dist/client/assets/use-task-board-events-U_kvLTo1.js +0 -1
- package/dist/client/assets/use-task-board-items-B66t-aAy.js +0 -1
- package/dist/client/assets/use-view-draft-kind-BtHf66Jj.js +0 -1
- package/dist/client/assets/use-voice-input-Li611DFd.js +0 -1
- package/dist/client/assets/useInfiniteQuery-CN2uIy97.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-ECHIzp7d.js +0 -1
- package/dist/client/assets/utils-DONok1LX.js +0 -4
- package/dist/client/assets/variant-calendar-CjAgTw5u.js +0 -1
- package/dist/client/assets/virtual-mcp-BKUZFB3-.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,f as p,av as u,j as s,
|
|
1
|
+
import{c as f,f as p,av as u,j as s,b5 as x,N as a}from"./index-CwntHk8S.js";import{C as j}from"./capability-load-error-Bcs21XUc.js";function d(){const t=f.c(19);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org"},t[0]=o):o=t[0];const{org:r}=p(o),{capabilities:l,isPrivileged:m,loading:g,error:c}=u();if(g){let e;return t[1]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(x,{}),t[1]=e):e=t[1],e}if(c){let e;return t[2]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(j,{}),t[2]=e):e=t[2],e}const i=e=>m||l[e]===!0;if(i("org:manage")){let e;return t[3]!==r?(e=s.jsx(a,{to:"/$org/settings/general",params:{org:r},replace:!0}),t[3]=r,t[4]=e):e=t[4],e}if(i("ai-providers:manage")){let e;return t[5]!==r?(e=s.jsx(a,{to:"/$org/settings/ai-providers",params:{org:r},replace:!0}),t[5]=r,t[6]=e):e=t[6],e}if(i("secrets:manage")){let e;return t[7]!==r?(e=s.jsx(a,{to:"/$org/settings/secrets",params:{org:r},replace:!0}),t[7]=r,t[8]=e):e=t[8],e}if(i("file-configs:manage")){let e;return t[9]!==r?(e=s.jsx(a,{to:"/$org/settings/buckets",params:{org:r},replace:!0}),t[9]=r,t[10]=e):e=t[10],e}if(i("automations:manage")){let e;return t[11]!==r?(e=s.jsx(a,{to:"/$org/settings/automations",params:{org:r},replace:!0}),t[11]=r,t[12]=e):e=t[12],e}if(i("monitoring:view")){let e;return t[13]!==r?(e=s.jsx(a,{to:"/$org/settings/monitor",params:{org:r},replace:!0}),t[13]=r,t[14]=e):e=t[14],e}if(i("members:manage")){let e;return t[15]!==r?(e=s.jsx(a,{to:"/$org/settings/members",params:{org:r},replace:!0}),t[15]=r,t[16]=e):e=t[16],e}let n;return t[17]!==r?(n=s.jsx(a,{to:"/$org/settings/profile",params:{org:r},replace:!0}),t[17]=r,t[18]=n):n=t[18],n}export{d as default};
|
package/dist/client/assets/{infiniteQueryObserver-BFZQsptZ.js → infiniteQueryObserver-DdeQTeaz.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{e2 as g,e3 as d,e4 as v}from"./index-CwntHk8S.js";var b=class extends g{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:s}=e,i=super.createResult(e,t),{isFetching:c,isRefetching:u,isError:a,isRefetchError:P}=i,r=s.fetchMeta?.fetchMore?.direction,h=a&&r==="forward",o=c&&r==="forward",n=a&&r==="backward",f=c&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:v(t,s.data),hasPreviousPage:d(t,s.data),isFetchNextPageError:h,isFetchingNextPage:o,isFetchPreviousPageError:n,isFetchingPreviousPage:f,isRefetchError:P&&!h&&!n,isRefetching:u&&!o&&!f}}};export{b as I};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as k,j as s,i2 as de,b as G,i3 as ue,r as le,i4 as xe,i5 as re,gE as T,gT as W,B as J,d_ as V,a7 as pe}from"./index-CwntHk8S.js";import{i as he}from"./CreditCard01-CDUEuZ6_.js";import{B as L}from"./badge-BG-k6t3T.js";import{M as je}from"./multi-select-B4K-daTY.js";import{S as be,d as ve,c as Be,a as Ne,b as Se}from"./select-DqZVtjvu.js";import{T as $,a as ye,b as ie,c as F,d as Te,e as we}from"./table-DX15DDx1.js";import{C as ke,X as Ue,Y as Ce}from"./CartesianChart-Vg3-F_Bi.js";import{T as De}from"./Tooltip-buu7_uLC.js";import{a as _e,A as Me}from"./AreaChart-DR454FhG.js";import{c2 as Re}from"./CategoricalChart-gtbFaKuM.js";import{R as Le}from"./require-capability-CnRgBqvn.js";import"./checkbox-DSC8VbDf.js";import"./Minus-BFZz-RWg.js";import"./ChevronDown-Kpzb5_P-.js";import"./command-Bo6EGcaE.js";import"./index-Do3hK3is.js";import"./SearchMd-G9SUUXxg.js";import"./popover-XZWwzjJe.js";import"./index-BdQq_4o_.js";import"./index-DEOQXzn-.js";import"./ChevronUp-CwLphDxo.js";import"./index-DIHnNoyA.js";import"./access-gate-BpukTmFQ.js";import"./capability-load-error-Bcs21XUc.js";const Q=new Intl.NumberFormat(void 0,{notation:"compact",maximumFractionDigits:1}),ne=["B","KB","MB","GB","TB","PB"];function oe(t){if(t<=0)return"0 B";const e=Math.min(ne.length-1,Math.floor(Math.log(t)/Math.log(1024))),n=t/1024**e;return`${n.toFixed(n>=100||e===0?0:1)} ${ne[e]}`}const X=50,$e="https://assets.decocache.com/decocms/45f9e905-046b-4aeb-8420-0377a7d0d041/deco_Transferencia.pdf",Fe=new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"});function ce(t){return new Date(`${t.slice(0,10)}T00:00:00Z`)}function ee(t){return ce(t).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric",timeZone:"UTC"})}function Ie(){const t=new Date;return Array.from({length:12},(e,n)=>{const l=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth()-n,1));return{value:l.toISOString().slice(0,10),label:l.toLocaleDateString(void 0,{month:"long",year:"numeric",timeZone:"UTC"})}})}function Pe(t){return new Date(`${t}T00:00:00Z`).toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}function ae(t){const e=k.c(30),{usage:n,metric:l,colorNum:o,formatValue:f,height:i}=t,a=`var(--chart-${o})`,d=`infra-billing-${l}`;let g;e[0]!==n?(g=n.map(Ae),e[0]=n,e[1]=g):g=e[1];const x=g;let b;e[2]===Symbol.for("react.memo_cache_sentinel")?(b={left:0,right:4,top:8,bottom:0},e[2]=b):b=e[2];let r,p;e[3]!==a?(r=s.jsx("stop",{offset:"0%",stopColor:a,stopOpacity:.25}),p=s.jsx("stop",{offset:"100%",stopColor:a,stopOpacity:0}),e[3]=a,e[4]=r,e[5]=p):(r=e[4],p=e[5]);let h;e[6]!==d||e[7]!==r||e[8]!==p?(h=s.jsx("defs",{children:s.jsxs("linearGradient",{id:d,x1:"0",y1:"0",x2:"0",y2:"1",children:[r,p]})}),e[6]=d,e[7]=r,e[8]=p,e[9]=h):h=e[9];let u;e[10]!==f||e[11]!==i?(u=i>100&&s.jsxs(s.Fragment,{children:[s.jsx(ke,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),s.jsx(Ue,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)"},interval:"preserveStartEnd",tickMargin:8}),s.jsx(Ce,{orientation:"right",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)"},tickFormatter:f,width:68})]}),e[10]=f,e[11]=i,e[12]=u):u=e[12];let B,v;e[13]===Symbol.for("react.memo_cache_sentinel")?(B={stroke:"var(--border)",strokeDasharray:"4 4"},v={background:"var(--background)",border:"1px solid var(--border)",borderRadius:8,fontSize:12},e[13]=B,e[14]=v):(B=e[13],v=e[14]);let j;e[15]!==f?(j=s.jsx(De,{cursor:B,contentStyle:v,formatter:C=>f(Number(C)||0)}),e[15]=f,e[16]=j):j=e[16];const y=`url(#${d})`;let N;e[17]!==a||e[18]!==l||e[19]!==y?(N=s.jsx(_e,{type:"linear",dataKey:l,stroke:a,strokeWidth:2,fill:y,dot:!1}),e[17]=a,e[18]=l,e[19]=y,e[20]=N):N=e[20];let m;e[21]!==x||e[22]!==N||e[23]!==h||e[24]!==u||e[25]!==j?(m=s.jsxs(Me,{data:x,margin:b,children:[h,u,j,N]}),e[21]=x,e[22]=N,e[23]=h,e[24]=u,e[25]=j,e[26]=m):m=e[26];let S;return e[27]!==i||e[28]!==m?(S=s.jsx(Re,{width:"100%",height:i,children:m}),e[27]=i,e[28]=m,e[29]=S):S=e[29],S}function Ae(t){return{...t,label:Pe(t.date)}}function Z(t,e){return t.reduce((n,l)=>n+l[e],0)}function Ee(){const t=k.c(39),e=G(),{sites:n,isLoading:l}=ue(),[o,f]=le.useState(null),i=Ie(),[a,d]=le.useState(i[0].value);let g;t[0]!==o||t[1]!==n?(g=o??n.slice(0,X),t[0]=o,t[1]=n,t[2]=g):g=t[2];const x=g,b=!o&&n.length>X,{data:r,isLoading:p}=xe(x,a),h=re();if(l){let c;return t[3]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(V,{className:"h-64 w-full"}),t[3]=c):c=t[3],c}if(n.length===0){let c;t[4]!==e?(c=e("settings.infraBilling.noSites"),t[4]=e,t[5]=c):c=t[5];let w;return t[6]!==c?(w=s.jsx(T,{className:"p-6 text-sm text-muted-foreground",children:c}),t[6]=c,t[7]=w):w=t[7],w}const u=r?.usage??[],B=r?.pageviewsAvailable??!1,v=!!r&&!r.usageUnavailable,j=(c,w)=>v?w(Z(u,c)):"—",y=[{key:"pageviews",title:e("settings.infraBilling.pageviews"),description:e("settings.infraBilling.pageviewsDescription"),colorNum:1,total:B&&v?Q.format(Z(u,"pageviews")):"—"},{key:"requests",title:e("settings.infraBilling.requests"),description:e("settings.infraBilling.requestsDescription"),colorNum:2,total:j("requests",Ze)},{key:"dataTransferBytes",title:e("settings.infraBilling.dataTransfer"),description:e("settings.infraBilling.dataTransferDescription"),colorNum:3,total:j("dataTransferBytes",oe)}],N=Oe;let m;t[8]!==r?.teams?(m=r?.teams??[],t[8]=r?.teams,t[9]=m):m=t[9];const S=m;let C;t[10]!==r?.siteSlugsWithoutTeam?(C=r?.siteSlugsWithoutTeam??[],t[10]=r?.siteSlugsWithoutTeam,t[11]=C):C=t[11];const Y=C,U=S.length===1?S[0]:void 0,D=U?.billing??null,te=S.length+(Y.length>0?1:0)>1,K=Z(u,"pageviews"),se=K>0?Z(u,"requests")/K:0,me=B&&v&&K>0?se.toFixed(se<10?1:0):"—";let I;t[12]!==r?.billingUnavailable||t[13]!==U||t[14]!==e||t[15]!==S.length?(I=r?.billingUnavailable?e("settings.infraBilling.billingUnavailable"):S.length>1?e("settings.infraBilling.multipleTeams",{count:String(S.length)}):U?fe(U,e):e("settings.infraBilling.noTeam"),t[12]=r?.billingUnavailable,t[13]=U,t[14]=e,t[15]=S.length,t[16]=I):I=t[16];const ge=I;let _;t[17]!==n?(_=n.map(qe),t[17]=n,t[18]=_):_=t[18];let M;t[19]!==e?(M=e("settings.infraBilling.siteLabel"),t[19]=e,t[20]=M):M=t[20];let P;t[21]!==x||t[22]!==_||t[23]!==M?(P=s.jsx(je,{className:"w-auto min-w-56 max-w-full",options:_,defaultValue:x,maxCount:2,placeholder:M,onValueChange:f}),t[21]=x,t[22]=_,t[23]=M,t[24]=P):P=t[24];let R;t[25]!==e?(R=e("settings.infraBilling.monthLabel"),t[25]=e,t[26]=R):R=t[26];let A;t[27]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Ne,{}),t[27]=A):A=t[27];let E;t[28]!==R?(E=s.jsx(Se,{className:"w-48","aria-label":R,children:A}),t[28]=R,t[29]=E):E=t[29];let z;t[30]!==x.length||t[31]!==e?(z=x.length===0&&s.jsx(T,{className:"mx-4 p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.pickASite")}),t[30]=x.length,t[31]=e,t[32]=z):z=t[32];let q;t[33]!==e||t[34]!==b?(q=b&&s.jsx(T,{className:"mx-4 p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.tooManySites",{count:String(X)})}),t[33]=e,t[34]=b,t[35]=q):q=t[35];let O;return t[36]!==r?.usageUnavailable||t[37]!==e?(O=r?.usageUnavailable&&s.jsx(T,{className:"mx-4 p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.warehouseUnavailable")}),t[36]=r?.usageUnavailable,t[37]=e,t[38]=O):O=t[38],s.jsxs("div",{className:"flex flex-col gap-8",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-3 px-4",children:[P,s.jsxs(be,{value:a,onValueChange:d,children:[E,s.jsx(ve,{children:i.map(ze)})]})]}),z,q,O,x.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(W,{title:e("settings.infraBilling.summaryTitle"),children:s.jsxs("div",{className:"flex flex-col lg:flex-row gap-4 px-4",children:[s.jsxs(T,{className:"flex-1 flex flex-col gap-4 p-4",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(he,{size:16,className:"text-muted-foreground"}),s.jsx("span",{className:"text-sm font-medium",children:e("settings.infraBilling.detailsTitle")})]}),U&&D?.canManageSubscription&&s.jsx(J,{variant:"outline",size:"sm",disabled:h.isPending,onClick:()=>h.mutate(U.siteSlugs),children:e("settings.infraBilling.manageButton")})]}),s.jsxs("div",{className:"flex flex-col gap-2 text-sm",children:[D?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex justify-between gap-3",children:[s.jsx("span",{className:"text-muted-foreground",children:e("settings.infraBilling.currentPlan")}),p?s.jsx(V,{className:"h-5 w-16"}):s.jsx(L,{variant:D.planType==="free"?"secondary":"success",children:e(`settings.infraBilling.plan.${D.planType}`)})]}),s.jsxs("div",{className:"flex justify-between gap-3",children:[s.jsx("span",{className:"text-muted-foreground",children:e("settings.infraBilling.nextBilling")}),s.jsx("span",{className:"font-medium tabular-nums",children:D.nextBillingDate?ee(D.nextBillingDate):"—"})]})]}):!p&&s.jsx("p",{className:"text-xs text-muted-foreground",children:ge}),s.jsxs("div",{className:"flex justify-between gap-3",children:[s.jsx("span",{className:"text-muted-foreground",children:e("settings.infraBilling.requestsPerPageview")}),s.jsx("span",{className:"font-medium tabular-nums",children:me})]})]})]}),y.map(c=>s.jsxs(T,{className:"flex-1 flex flex-col gap-2 p-4",children:[s.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[s.jsx("span",{className:"text-sm font-medium",children:c.title}),s.jsx("span",{className:"text-xs text-muted-foreground",children:i.find(w=>w.value===a)?.label})]}),p?s.jsx(V,{className:"h-8 w-24"}):s.jsx("span",{className:"text-2xl font-semibold tabular-nums",children:c.total}),s.jsx("div",{className:"-mx-2",children:s.jsx(ae,{usage:u,metric:c.key,colorNum:c.colorNum,formatValue:N(c.key),height:64})})]},c.key))]})}),s.jsx(W,{title:e("settings.infraBilling.metricsTitle"),children:s.jsx("div",{className:"flex flex-col xl:flex-row gap-4 px-4",children:y.map(c=>s.jsxs(T,{className:"flex-1 flex flex-col gap-3 p-4",children:[s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-sm font-medium",children:c.title}),s.jsx("span",{className:"text-xs text-muted-foreground",children:c.description})]}),s.jsx(ae,{usage:u,metric:c.key,colorNum:c.colorNum,formatValue:N(c.key),height:220})]},c.key))})}),s.jsx(W,{title:e("settings.infraBilling.invoicesTitle"),children:s.jsx("div",{className:"flex flex-col gap-4 px-4",children:r?r.billingUnavailable?s.jsx(T,{className:"p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.billingUnavailable")}):s.jsxs(s.Fragment,{children:[S.map(c=>s.jsx(Ge,{team:c,showSites:te},c.siteSlugs.join(","))),Y.length>0&&s.jsxs(T,{className:"flex flex-col gap-1 p-4",children:[te&&s.jsx("span",{className:"text-sm font-medium",children:Y.join(", ")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:e("settings.infraBilling.noTeam")})]})]}):s.jsx(T,{size:"flush",children:s.jsx(V,{className:"m-4 h-24"})})})})]})]})}function ze(t){return s.jsx(Be,{value:t.value,children:t.label},t.value)}function qe(t){return{label:t,value:t}}function Oe(t){return t==="dataTransferBytes"?oe:Ve}function Ve(t){return Q.format(t)}function Ze(t){return Q.format(t)}function fe(t,e){return t.unavailableReason==="partial_team"?e("settings.infraBilling.partialTeam"):e("settings.infraBilling.billingUnavailable")}function Ge(t){const e=k.c(13),{team:n,showSites:l}=t,o=G(),f=re(),i=n.billing;let a;e[0]!==i||e[1]!==f||e[2]!==l||e[3]!==o||e[4]!==n.siteSlugs?(a=l&&s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-b border-border p-4",children:[s.jsx("span",{className:"text-sm font-medium",children:n.siteSlugs.join(", ")}),i&&s.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-sm",children:[s.jsx(L,{variant:i.planType==="free"?"secondary":"success",children:o(`settings.infraBilling.plan.${i.planType}`)}),i.nextBillingDate&&s.jsxs("span",{className:"flex gap-1.5",children:[s.jsx("span",{className:"text-muted-foreground",children:o("settings.infraBilling.nextBilling")}),s.jsx("span",{className:"font-medium tabular-nums",children:ee(i.nextBillingDate)})]}),i.canManageSubscription&&s.jsx(J,{variant:"outline",size:"sm",disabled:f.isPending,onClick:()=>f.mutate(n.siteSlugs),children:o("settings.infraBilling.manageButton")})]})]}),e[0]=i,e[1]=f,e[2]=l,e[3]=o,e[4]=n.siteSlugs,e[5]=a):a=e[5];let d;e[6]!==i||e[7]!==o||e[8]!==n?(d=i?i.invoices.length===0?s.jsx("p",{className:"p-4 text-sm text-muted-foreground",children:o("settings.infraBilling.noInvoices")}):s.jsx(Ye,{invoices:i.invoices}):s.jsx("p",{className:"p-4 text-sm text-muted-foreground",children:fe(n,o)}),e[6]=i,e[7]=o,e[8]=n,e[9]=d):d=e[9];let g;return e[10]!==a||e[11]!==d?(g=s.jsxs(T,{size:"flush",className:"gap-0 overflow-x-auto",children:[a,d]}),e[10]=a,e[11]=d,e[12]=g):g=e[12],g}function Ye(t){const e=k.c(40),{invoices:n}=t,l=G();let o;e[0]!==n?(o=n.some(Ke),e[0]=n,e[1]=o):o=e[1];const f=o;let i;e[2]!==l?(i=l("settings.infraBilling.invoiceReference"),e[2]=l,e[3]=i):i=e[3];let a;e[4]!==i?(a=s.jsx($,{children:i}),e[4]=i,e[5]=a):a=e[5];let d;e[6]!==l?(d=l("settings.infraBilling.invoiceDue"),e[6]=l,e[7]=d):d=e[7];let g;e[8]!==d?(g=s.jsx($,{children:d}),e[8]=d,e[9]=g):g=e[9];let x;e[10]!==l?(x=l("settings.infraBilling.invoiceAmount"),e[10]=l,e[11]=x):x=e[11];let b;e[12]!==x?(b=s.jsx($,{children:x}),e[12]=x,e[13]=b):b=e[13];let r;e[14]!==l?(r=l("settings.infraBilling.invoiceStatus"),e[14]=l,e[15]=r):r=e[15];let p;e[16]!==r?(p=s.jsx($,{children:r}),e[16]=r,e[17]=p):p=e[17];let h;e[18]!==l?(h=l("settings.infraBilling.invoiceDocuments"),e[18]=l,e[19]=h):h=e[19];let u;e[20]!==h?(u=s.jsx($,{children:h}),e[20]=h,e[21]=u):u=e[21];let B;e[22]!==u||e[23]!==a||e[24]!==g||e[25]!==b||e[26]!==p?(B=s.jsx(ye,{children:s.jsxs(ie,{children:[a,g,b,p,u]})}),e[22]=u,e[23]=a,e[24]=g,e[25]=b,e[26]=p,e[27]=B):B=e[27];let v;if(e[28]!==n||e[29]!==l||e[30]!==f){let N;e[32]!==l||e[33]!==f?(N=m=>s.jsxs(ie,{children:[s.jsx(F,{children:m.referenceMonth?ce(m.referenceMonth).toLocaleDateString(void 0,{month:"long",year:"numeric",timeZone:"UTC"}):"—"}),s.jsx(F,{children:m.dueDate?ee(m.dueDate):"—"}),s.jsx(F,{className:"tabular-nums",children:Fe.format(m.value)}),s.jsx(F,{children:s.jsx(We,{status:m.status})}),s.jsxs(F,{className:"flex gap-2",children:[m.nfUrl&&s.jsx(H,{href:m.nfUrl,label:l("settings.infraBilling.invoiceNf")}),m.bankSlipUrl&&s.jsx(H,{href:m.bankSlipUrl,label:l("settings.infraBilling.invoiceBankSlip")}),!m.bankSlipUrl&&!f&&m.nfUrl&&s.jsx(H,{href:$e,label:l("settings.infraBilling.invoiceBankTransfer")}),!m.nfUrl&&!m.bankSlipUrl&&"—"]})]},m.id),e[32]=l,e[33]=f,e[34]=N):N=e[34],v=n.map(N),e[28]=n,e[29]=l,e[30]=f,e[31]=v}else v=e[31];let j;e[35]!==v?(j=s.jsx(Te,{children:v}),e[35]=v,e[36]=j):j=e[36];let y;return e[37]!==B||e[38]!==j?(y=s.jsxs(we,{children:[B,j]}),e[37]=B,e[38]=j,e[39]=y):y=e[39],y}function Ke(t){return!!t.bankSlipUrl}function H(t){const e=k.c(4),{href:n,label:l}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(pe,{size:14}),e[0]=o):o=e[0];let f;return e[1]!==n||e[2]!==l?(f=s.jsx(J,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs("a",{href:n,target:"_blank",rel:"noreferrer",children:[o,l]})}),e[1]=n,e[2]=l,e[3]=f):f=e[3],f}function We(t){const e=k.c(14),{status:n}=t,l=G(),o=n.toLowerCase();if(o==="paid"){let i;e[0]!==l?(i=l("settings.infraBilling.statusPaid"),e[0]=l,e[1]=i):i=e[1];let a;return e[2]!==i?(a=s.jsx(L,{variant:"success",children:i}),e[2]=i,e[3]=a):a=e[3],a}if(o==="overdue"){let i;e[4]!==l?(i=l("settings.infraBilling.statusOverdue"),e[4]=l,e[5]=i):i=e[5];let a;return e[6]!==i?(a=s.jsx(L,{variant:"destructive",children:i}),e[6]=i,e[7]=a):a=e[7],a}if(o==="registered"){let i;e[8]!==l?(i=l("settings.infraBilling.statusPending"),e[8]=l,e[9]=i):i=e[9];let a;return e[10]!==i?(a=s.jsx(L,{variant:"warning",children:i}),e[10]=i,e[11]=a):a=e[11],a}let f;return e[12]!==n?(f=s.jsx(L,{variant:"secondary",children:n}),e[12]=n,e[13]=f):f=e[13],f}function Xe(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(de,{group:"billing",children:s.jsx(Ee,{})}),t[0]=e):e=t[0],e}function Bt(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Le,{capability:"members:manage",area:"billing",children:s.jsx(Xe,{})}),t[0]=e):e=t[0],e}export{Bt as default};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/openai-conversation-D43N7JcR.js","assets/index-CwntHk8S.js","assets/index-pbgcO64n.css","assets/usage-stats-Bk_1jh1-.js","assets/utils-CVEq3hMx.js","assets/markdown-sWsq0zMA.js","assets/use-copy-sOY8Yuot.js","assets/agent-icon-DE4TWlDl.js","assets/AlertCircle-BfuEGc37.js","assets/UserCheck01-DVOI9Qq6.js","assets/Tool01-DOjdBvJ6.js","assets/ArrowUp-Cfwuhrfj.js","assets/ArrowLeft-Ccyza8AK.js","assets/ArrowRight-BfJPk4p9.js","assets/BookOpen01-vaPiqXWZ.js","assets/Globe04-CM5K7y4B.js","assets/CheckCircle-WpYwhp7A.js","assets/TrendUp01-DLgSqdSd.js","assets/ChevronDown-Kpzb5_P-.js","assets/ChevronSelectorVertical-DNPn4Jhl.js","assets/ChevronUp-CwLphDxo.js","assets/UserSquare-CRBGeews.js","assets/LinkBroken01-6J7zZ1XX.js","assets/CreditCard01-CDUEuZ6_.js","assets/File02-D8jC2XAm.js","assets/Minimize01-Dylk6LHz.js","assets/SwitchHorizontal01-BbD-SqO6.js","assets/Eye-BeTcpGN-.js","assets/Image01-0Jwady1a.js","assets/Key01-Dqvoolzt.js","assets/LayoutLeft-Nn_BPz0l.js","assets/Minus-BFZz-RWg.js","assets/Monitor01-ZIydqkip.js","assets/Sun-Bvg5JrAI.js","assets/Play-CkrBckKV.js","assets/Plus-C8Idvwpa.js","assets/SearchMd-G9SUUXxg.js","assets/ShoppingBag01-sbzM0fY9.js","assets/Trash01-BRIjyxCC.js","assets/Upload01-Dd-OapHB.js","assets/Users01-bZ_S-kH7.js","assets/XClose-CWGS9q3D.js","assets/Zap-BxaAY56U.js","assets/chat-context-CiT7AzBS.js","assets/use-panel-navigate-V2MXWXLu.js","assets/thread-route-Bdw4g7Hg.js","assets/use-project-scope-COzEo5Zz.js","assets/repository-binding-Cqb4hBI0.js","assets/use-mcp-client-Cvc3WWPF.js","assets/auth-gL3R1YGn.js","assets/use-view-draft-kind-BdwsMdex.js","assets/use-blog-view-9s3Vkx1q.js","assets/use-organization-settings-Ddjh427l.js","assets/schema-CsGAsuNy.js","assets/task-board-DD2iUGL4.js","assets/thread-intent-DpzwhK2y.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-CTgVk3NA.js","assets/session-runtime-DaEm9VzJ.js","assets/use-entitlements-DtyegfyM.js","assets/use-ai-providers-Cya2RotC.js","assets/use-current-view-EjRzX02x.js","assets/use-in-settings-DLJEfljS.js","assets/use-decopilot-events-BGpwG8Pb.js","assets/use-mobile-CG2XwDbe.js","assets/tooltip-BTd3W-2Z.js","assets/index-DEOQXzn-.js","assets/gateway-client-BqPME1T5.js","assets/form-8GAe5FIZ.js","assets/label-BFX3DXnu.js","assets/icon-button-Dd8gTd4-.js","assets/file-type-icon-CEP8k4gh.js","assets/chat-draft-BNZV2YjB.js","assets/use-voice-input-CwLNuWlo.js","assets/popover-XZWwzjJe.js","assets/drawer-CarQd6Jb.js","assets/index-C17JTAPe.js","assets/checkbox-DSC8VbDf.js","assets/select-DqZVtjvu.js","assets/index-BdQq_4o_.js","assets/ai-providers-logos-DD3qZ33J.js","assets/openai-compatible-presets-BKGfVqEx.js","assets/tabs-BiFBpWbA.js","assets/active-indicator-CCMhAsc_.js","assets/use-deco-credits-d4Nbb0l0.js","assets/toggle-group-l7lV2Oqp.js","assets/input-DXyNd1dE.js","assets/suggestion-bCd1m59t.js","assets/use-mcp-prompts-Ck1uv43A.js","assets/use-org-fs-BfE7L8cf.js","assets/useInfiniteQuery-BagPKS5m.js","assets/infiniteQueryObserver-DdeQTeaz.js","assets/question-004-sINsf4GQ.js","assets/feature-paywall-DzmzZ5s3.js","assets/plan-ladder-cJHOFEt_.js","assets/add-connection-dialog-BfsrivZp.js","assets/collection-search-BbCHAL7t.js","assets/extract-connection-data-D6CjTXbp.js","assets/metadata-D72DunRR.js","assets/connection-BLQs5hMz.js","assets/url-slug-gNlq1cKV.js","assets/connection-card-vLs08dR6.js","assets/connection-slug-CmPPcsjf.js","assets/integration-icon-BCAGJ22m.js","assets/textarea-BoSVR1xB.js","assets/use-connection-2s3z_IKD.js","assets/schema-Bh0CFZUA.js","assets/connection-form-helpers-BSIh8Ep0.js","assets/authenticate-and-persist-oauth-C7oT67KU.js","assets/mcp-oauth-Cal4irlG.js","assets/mcp-oauth-DFWIYz5V.js","assets/collection-tabs-BXeEDC1Y.js","assets/badge-BG-k6t3T.js","assets/use-infinite-scroll-D1tYrKq7.js","assets/useSuspenseInfiniteQuery-BUmkwIx5.js","assets/use-task-board-items-OgSDu-ag.js","assets/use-chat-layout-state-CWt5k1nY.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{fj as Ee,c as D,b as q,r as R,m as z,j as n,b3 as Ze,aF as oe,bv as Tt,aG as te,co as Re,B as W,aE as xs,aD as vs,dy as bs,cn as As,J as ke,e6 as ys,gc as we,gd as Vt,cF as js,ak as ws,e as ks,I as Cs,t as Ie,E as X,a4 as Te,d as Xe,aW as _t,x as Ss,aS as Ns,w as Is,v as Ts,D as _s,es as Ds,a5 as Ms,K as Ps,i as Es,_ as Rs,X as Us,Z as Fs,Y as be,ap as ct,an as dt,ao as ut,h as Ls,bu as Os,bt as zs,aC as Bs,as as $s,dx as Ks,dC as Ae,bi as Qs,dE as qs,b6 as pt,ge as Ws,a as Ys,ar as Gs,at as Hs,aU as Ye,eL as Js,o as Zs,ct as Xs,cu as en,a$ as tn,af as Dt}from"./index-CwntHk8S.js";import{i as Mt,k as sn,j as nn,o as Pt,P as on,p as an,S as rn}from"./usage-stats-Bk_1jh1-.js";import{A as ln,H as Vn,Y as Et,aB as Ge,g as cn,e as dn,aG as un,a5 as Rt,aH as Ut,aE as pn,K as hn,aI as fn}from"./agent-icon-DE4TWlDl.js";import{s as Ft}from"./XClose-CWGS9q3D.js";import{I as mn}from"./icon-button-Dd8gTd4-.js";import{F as gn}from"./file-type-icon-CEP8k4gh.js";import{u as xn}from"./use-current-view-EjRzX02x.js";import{b as Ue,I as vn,J as bn,c as et,d as tt,p as An,K as yn,M as jn,N as wn,u as Lt,f as kn,s as Cn,e as Sn}from"./chat-context-CiT7AzBS.js";import{b as Nn}from"./repository-binding-Cqb4hBI0.js";import{A as In,w as Tn}from"./use-view-draft-kind-BdwsMdex.js";import{n as _n,z as Dn,p as Mn,b as Pn,w as En,j as Rn}from"./thread-intent-DpzwhK2y.js";import{r as ht,i as Un,c as Fn,w as Ln,H as On}from"./chat-draft-BNZV2YjB.js";import{u as zn,a as Bn,T as $n}from"./use-voice-input-CwLNuWlo.js";import{i as Ot}from"./ArrowRight-BfJPk4p9.js";import{i as zt}from"./ArrowUp-Cfwuhrfj.js";import{n as Bt}from"./BookOpen01-vaPiqXWZ.js";import{a as $t}from"./Image01-0Jwady1a.js";import{j as Kn}from"./UserSquare-CRBGeews.js";import{i as Qn}from"./Upload01-Dd-OapHB.js";import{i as qn}from"./AlertCircle-BfuEGc37.js";import{a as He,b as st,d as nt,f as ot,F as Kt}from"./form-8GAe5FIZ.js";import{c as Wn,S as Yn,b as Gn,a as Hn,d as Jn}from"./select-DqZVtjvu.js";import{t as $e,h as Qt}from"./UserCheck01-DVOI9Qq6.js";import{t as Zn}from"./ChevronDown-Kpzb5_P-.js";import{T as qt,a as Wt,c as Yt}from"./tooltip-BTd3W-2Z.js";import{i as Xn}from"./ArrowLeft-Ccyza8AK.js";import{c as eo,b as to}from"./tabs-BiFBpWbA.js";import{d as Ke,f as so}from"./use-entitlements-DtyegfyM.js";import{u as no}from"./use-deco-credits-d4Nbb0l0.js";import{a as ft,T as oo}from"./toggle-group-l7lV2Oqp.js";import{s as ao,d as io,g as mt,a as ro}from"./gateway-client-BqPME1T5.js";import{t as lo}from"./utils-CVEq3hMx.js";import{m as at,g as Vo,b as co}from"./index-C17JTAPe.js";import{p as Gt,u as uo,T as po,a as ho,U as fo}from"./input-DXyNd1dE.js";import{a as mo}from"./use-mcp-client-Cvc3WWPF.js";import{l as go,g as xo}from"./use-mcp-prompts-Ck1uv43A.js";import{s as gt}from"./Plus-C8Idvwpa.js";import"./suggestion-bCd1m59t.js";import{p as vo,q as bo}from"./question-004-sINsf4GQ.js";import{F as xt}from"./feature-paywall-DzmzZ5s3.js";import{A as Ao}from"./add-connection-dialog-BfsrivZp.js";import{a as yo}from"./use-organization-settings-Ddjh427l.js";import{b as jo}from"./use-task-board-items-OgSDu-ag.js";import{u as wo}from"./use-mobile-CG2XwDbe.js";import{r as ko}from"./use-chat-layout-state-CWt5k1nY.js";const Co=Ee("Headphones",[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",key:"1xhozi"}]]);const So=Ee("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);const No=Ee("MicOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M18.89 13.23A7.12 7.12 0 0 0 19 12v-2",key:"80xlxr"}],["path",{d:"M5 10v2a7 7 0 0 0 12 5",key:"p2k8kg"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);const Io=Ee("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);const To=Ee("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),qe="cubic-bezier(0.645, 0.045, 0.355, 1)",dr=44,_o={default:"",error:"isolate after:content-[''] after:absolute after:inset-0 after:rounded-xl after:bg-destructive/5 after:pointer-events-none after:-z-10",warning:"isolate after:content-[''] after:absolute after:inset-0 after:rounded-xl after:bg-warning/5 after:pointer-events-none after:-z-10"},Do={default:"border-border",error:"border-destructive/30",warning:"border-warning/30"},Mo={default:"text-muted-foreground",error:"text-destructive",warning:"text-warning"};function xe(t){const e=D.c(69),{icon:s,label:o,count:a,title:i,footerLeft:r,footerRight:l,children:V,defaultExpanded:d,variant:u,onClose:c}=t,p=u===void 0?"default":u,h=q(),[f,m]=R.useState(d),[x,v]=R.useState(!1);let g;e[0]!==c?(g=()=>{v(!0),c?.()},e[0]=c,e[1]=g):g=e[1];const b=g;if(x)return null;const y=Do[p],A=_o[p];let w;e[2]!==y||e[3]!==A?(w=z("relative flex flex-col rounded-xl bg-background border shadow-soft","w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",y,A),e[2]=y,e[3]=A,e[4]=w):w=e[4];let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=()=>m(Po),e[5]=j):j=e[5];const k=f&&"rounded-b-none",C=!f&&"rounded-b-xl";let _;e[6]!==k||e[7]!==C?(_=z("flex items-center gap-2 w-full px-3 py-2 text-sm text-left","hover:bg-accent transition-colors rounded-t-xl",k,C),e[6]=k,e[7]=C,e[8]=_):_=e[8];const N=Mo[p];let T;e[9]!==N?(T=z("shrink-0",N),e[9]=N,e[10]=T):T=e[10];let I;e[11]!==s||e[12]!==T?(I=n.jsx("span",{className:T,children:s}),e[11]=s,e[12]=T,e[13]=I):I=e[13];let E;e[14]!==o?(E=n.jsx("span",{className:"flex-1 min-w-0 truncate",children:o}),e[14]=o,e[15]=E):E=e[15];let F;e[16]!==a?(F=a?n.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:a}):null,e[16]=a,e[17]=F):F=e[17];const O=f?"rotate(180deg)":"rotate(0deg)";let M;e[18]!==O?(M=n.jsx("span",{"aria-hidden":"true",className:"text-muted-foreground shrink-0 flex items-center justify-center",children:n.jsx(Zn,{size:16,style:{transform:O,transition:`transform 180ms ${qe}`}})}),e[18]=O,e[19]=M):M=e[19];let K;e[20]!==h?(K=h("chat.collapsibleHighlight.closeLabel"),e[20]=h,e[21]=K):K=e[21];let Q;e[22]!==h?(Q=h("chat.collapsibleHighlight.closeTitle"),e[22]=h,e[23]=Q):Q=e[23];let Z,U;e[24]!==b?(Z=Ve=>{Ve.stopPropagation(),b()},U=Ve=>{(Ve.key==="Enter"||Ve.key===" ")&&(Ve.preventDefault(),Ve.stopPropagation(),b())},e[24]=b,e[25]=Z,e[26]=U):(Z=e[25],U=e[26]);let Y;e[27]===Symbol.for("react.memo_cache_sentinel")?(Y=n.jsx(Ze,{size:16}),e[27]=Y):Y=e[27];let P;e[28]!==K||e[29]!==Q||e[30]!==Z||e[31]!==U?(P=n.jsx("span",{role:"button",tabIndex:0,"data-testid":"collapsible-highlight-close","aria-label":K,title:Q,onClick:Z,onKeyDown:U,className:"text-muted-foreground hover:text-foreground transition-colors shrink-0 flex items-center justify-center -mr-1 ml-1 p-1 rounded-md hover:bg-accent",children:Y}),e[28]=K,e[29]=Q,e[30]=Z,e[31]=U,e[32]=P):P=e[32];let G;e[33]!==f||e[34]!==I||e[35]!==E||e[36]!==F||e[37]!==M||e[38]!==P||e[39]!==_?(G=n.jsxs("button",{type:"button","data-testid":"collapsible-highlight-chip","aria-expanded":f,onClick:j,className:_,children:[I,E,F,M,P]}),e[33]=f,e[34]=I,e[35]=E,e[36]=F,e[37]=M,e[38]=P,e[39]=_,e[40]=G):G=e[40];const ne=f?"1fr":"0fr";let H;e[41]!==ne?(H={display:"grid",gridTemplateRows:ne,transition:`grid-template-rows 180ms ${qe}`},e[41]=ne,e[42]=H):H=e[42];let re;e[43]===Symbol.for("react.memo_cache_sentinel")?(re={overflow:"hidden",minHeight:0},e[43]=re):re=e[43];const S=f?1:0;let L;e[44]!==S?(L={opacity:S,transition:`opacity 120ms ${qe}`,maxHeight:"60vh"},e[44]=S,e[45]=L):L=e[45];let J;e[46]!==i?(J=i?n.jsx("div",{className:"flex items-start gap-2 px-4 pt-4 pb-5 border-t border-dashed border-border/60",children:n.jsx("p",{className:"flex-1 text-base font-medium text-foreground min-w-0",children:i})}):n.jsx("div",{className:"border-t border-dashed border-border/60"}),e[46]=i,e[47]=J):J=e[47];let $;e[48]!==V||e[49]!==i?($=V?n.jsx("div",{className:z("pb-4",!i&&"pt-4"),children:V}):null,e[48]=V,e[49]=i,e[50]=$):$=e[50];let ee;e[51]!==J||e[52]!==$?(ee=n.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[J,$]}),e[51]=J,e[52]=$,e[53]=ee):ee=e[53];let ie;e[54]!==r||e[55]!==l?(ie=r||l?n.jsx("div",{className:"shrink-0 border-t border-border px-3 py-3 pb-6",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{children:r}),n.jsx("div",{className:"flex items-center gap-2",children:l})]})}):null,e[54]=r,e[55]=l,e[56]=ie):ie=e[56];let ce;e[57]!==L||e[58]!==ee||e[59]!==ie?(ce=n.jsx("div",{style:re,children:n.jsxs("div",{className:"flex flex-col",style:L,children:[ee,ie]})}),e[57]=L,e[58]=ee,e[59]=ie,e[60]=ce):ce=e[60];let ae;e[61]!==H||e[62]!==ce?(ae=n.jsx("div",{"data-testid":"collapsible-highlight-body",style:H,children:ce}),e[61]=H,e[62]=ce,e[63]=ae):ae=e[63];let pe;return e[64]!==G||e[65]!==ae||e[66]!==w||e[67]!==p?(pe=n.jsxs("div",{"data-testid":"collapsible-highlight","data-variant":p,className:w,children:[G,ae]}),e[64]=G,e[65]=ae,e[66]=w,e[67]=p,e[68]=pe):pe=e[68],pe}function Po(t){return!t}const Eo=oe({content:te().min(1).describe("Imperative form, e.g. 'Implement the login flow'"),status:Re(["pending","in_progress","completed"]),activeForm:te().min(1).describe("Present-continuous form shown in the UI while the todo is in progress, e.g. 'Implementing the login flow'")}),Ht=oe({todos:Tt(Eo)}),Ro="Plan and track multi-step work. Call with the FULL todo list every time — this replaces the prior list. Call at the start of every multi-step request. Skip only for true one-shots (a single tool call or a direct answer). Mark exactly one todo `in_progress` at a time. Flip a todo to `in_progress` before starting it and to `completed` the moment it finishes — do not batch completions. Your prior tool-call inputs are your current state — read your last call to see where you are.";_n({description:Ro,inputSchema:Dn(Ht),execute:async({todos:t})=>({ok:!0,count:t.length})});const Uo="tool-todo_write",Fo=new Set(["input-available","output-available"]);function Lo(t){for(let e=t.length-1;e>=0;e--){const s=t[e];if(s.role!=="assistant")continue;const o=s.parts;if(Array.isArray(o))for(let a=o.length-1;a>=0;a--){const i=o[a];if(i.type!==Uo||typeof i.state!="string"||!Fo.has(i.state))continue;const r=Ht.safeParse(i.input);if(r.success)return r.data.todos}}return[]}function Jt(t){const e=[];for(const s of t)if("state"in s&&s.state==="approval-requested"&&"approval"in s&&s.approval?.id&&"toolCallId"in s&&s.toolCallId){const o="toolName"in s&&typeof s.toolName=="string"?s.toolName:s.type.startsWith("tool-")?s.type.replace("tool-",""):"Tool";e.push({approvalId:s.approval.id,toolCallId:s.toolCallId,toolName:o,friendlyName:lo(ao(o)),input:s.input})}return e}function Zt(t){return t.at(-1)}function Xt(t){const e=[];for(const s of t)s.type==="tool-propose_plan"&&s.state==="input-available"&&e.push({toolCallId:s.toolCallId,plan:s.input.plan,state:s.state});return e}function Oo(t){return t?t.message.startsWith("[CREDITS]"):!1}const zo={isCreditExhausted:!1,planRefusal:null,hasTodos:!1,showError:!1,showWarning:!1,hasApprovals:!1,hasPlans:!1,isWaitingForUserInput:!1,hasTaskSuggestion:!1,todos:[]};function Bo(t){const{messages:e,error:s,finishReason:o,isStreaming:a,isWaitingForApprovals:i}=t;if(!a&&s&&Oo(s))return{...zo,isCreditExhausted:!0};const r=e.at(-1),l=r?.role==="assistant"?r.parts:[],V=l,u=!!V.filter(A=>A.type==="tool-user_ask").filter(A=>A.state!=="output-available").length,c=V.some(Mt),p=Xt(l),h=Jt(V),f=Lo(e),m=a?null:Mn(s),x=!a&&!!s&&!m,v=h.length>0||a&&i,g=p.length>0,y=!a&&!!o&&o!=="stop"&&!(o==="tool-calls"&&(u||v||g||c))&&!x;return{isCreditExhausted:!1,planRefusal:m,hasTodos:f.length>0,showError:x,showWarning:y,hasApprovals:v,hasPlans:g,isWaitingForUserInput:u,hasTaskSuggestion:c,todos:f}}function es(){const t=D.c(6),{messages:e,error:s,finishReason:o,isStreaming:a,isWaitingForApprovals:i}=Ue(),r=s??null,l=o??null;let V;return t[0]!==a||t[1]!==i||t[2]!==e||t[3]!==r||t[4]!==l?(V=Bo({messages:e,error:r,finishReason:l,isStreaming:a,isWaitingForApprovals:i}),t[0]=a,t[1]=i,t[2]=e,t[3]=r,t[4]=l,t[5]=V):V=t[5],V}function ur(){const t=es(),e=Ke("credits");return t.isCreditExhausted?e?0:1:Number(t.hasTodos)+Number(t.showError)+ +!!t.planRefusal+Number(t.showWarning)+Number(t.hasApprovals)+Number(t.hasPlans)+Number(t.isWaitingForUserInput)+Number(t.hasTaskSuggestion)}const vt="start-task",$o=`Turn the report below into a running task. The user pressed "Start task", which authorizes delegation.
|
|
3
|
+
|
|
4
|
+
1. Read the report and any attached screenshots. Carry the reporter's own words into the task description, plus the URL of any attachment.
|
|
5
|
+
2. Call TASK_BOARD_ITEM_LIST. Its \`repos\` are this organization's repositories — the only valid values for a task's repo, so pick the one the report is about and never invent a name.
|
|
6
|
+
3. Call TASK_BOARD_ITEM_CREATE with a concise title, the full description, the chosen repo as owner/name, assigneeId "super-agent", and onDuplicate "return_existing". That assignment is what queues the work; the duplicate option makes the tool hand back an existing task when one already covers this report instead of opening a second one.
|
|
7
|
+
4. Reply with the task key the tool returned (e.g. DECO-144) and one line on what you filed. If the output says \`deduplicated: true\`, say the report was already tracked by that task and quote its \`duplicateReason\`. Never invent a URL. Do NOT implement the fix here; the task's own run does that, and the reporter gets an email when its PR is ready for review.
|
|
8
|
+
|
|
9
|
+
The report follows.`;function Ko(t){return{...t,content:[{type:"paragraph",content:[sn({id:vt,name:vt,char:"/",kind:"prompt",metadata:[{role:"user",content:{type:"text",text:$o}}]})]},...t.content??[]]}}function bt(t){const e=D.c(14),{icon:s,inset:o,label:a,title:i,dismissLabel:r,onDismiss:l}=t,V=o?"pl-1":"pl-2.5";let d;e[0]!==V?(d=z("surface-inset flex h-7 min-w-0 items-center gap-1.5 rounded-full pr-0.5 text-xs text-foreground",V),e[0]=V,e[1]=d):d=e[1];let u;e[2]!==a?(u=n.jsx("span",{className:"truncate",children:a}),e[2]=a,e[3]=u):u=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(Ft,{size:12}),e[4]=c):c=e[4];let p;e[5]!==r||e[6]!==l?(p=n.jsx(mn,{label:r,size:"icon-sm",onClick:l,children:c}),e[5]=r,e[6]=l,e[7]=p):p=e[7];let h;return e[8]!==s||e[9]!==d||e[10]!==u||e[11]!==p||e[12]!==i?(h=n.jsxs("span",{className:d,title:i,children:[s,u,p]}),e[8]=s,e[9]=d,e[10]=u,e[11]=p,e[12]=i,e[13]=h):h=e[13],h}function Qo(){const t=D.c(13),e=q(),s=xn(),o=vn();if(!s&&!o)return null;const a=s?s.project&&!s.isHome?`${s.project.title} · ${s.title}`:s.title:"";let i;t[0]!==o?(i=o?bn(o.path):"",t[0]=o,t[1]=i):i=t[1];const r=i;let l;t[2]!==e||t[3]!==s||t[4]!==a?(l=s&&n.jsx(bt,{icon:s.project?n.jsx(ln,{icon:s.project.icon??null,name:s.project.title,size:"xs"}):n.jsx(Vn,{size:14,className:"shrink-0 text-muted-foreground"}),inset:!!s.project,label:a,title:e("chat.input.viewContext",{name:a}),dismissLabel:e("chat.input.viewDismiss"),onDismiss:s.dismiss}),t[2]=e,t[3]=s,t[4]=a,t[5]=l):l=t[5];let V;t[6]!==r||t[7]!==o||t[8]!==e?(V=o&&n.jsx(bt,{icon:n.jsx(gn,{filename:r,className:"h-4 w-3 shrink-0"}),label:r,title:e("chat.input.openFileContext",{name:r}),dismissLabel:e("chat.input.openFileDismiss"),onDismiss:o.dismiss}),t[6]=r,t[7]=o,t[8]=e,t[9]=V):V=t[9];let d;return t[10]!==l||t[11]!==V?(d=n.jsxs("div",{className:"flex min-w-0 flex-wrap gap-1.5 px-3 pt-3",children:[l,V]}),t[10]=l,t[11]=V,t[12]=d):d=t[12],d}function qo(t){return{autosend:In,sidepanel:!0,...t?{mainpanel:!1}:{}}}function Wo(t){const e=D.c(30),{current:s,total:o,onPrev:a,onNext:i}=t,r=q();if(o<=1)return null;const l=s===0,V=s===0?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let d;e[0]!==V?(d=z("p-0.5 transition-colors rounded-lg",V),e[0]=V,e[1]=d):d=e[1];let u;e[2]!==r?(u=r("chat.pagination.previousLabel"),e[2]=r,e[3]=u):u=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(Xn,{size:14}),e[4]=c):c=e[4];let p;e[5]!==a||e[6]!==l||e[7]!==d||e[8]!==u?(p=n.jsx("button",{type:"button",onClick:a,disabled:l,className:d,"aria-label":u,children:c}),e[5]=a,e[6]=l,e[7]=d,e[8]=u,e[9]=p):p=e[9];const h=s+1;let f;e[10]!==r||e[11]!==h||e[12]!==o?(f=r("chat.pagination.counter",{current:h,total:o}),e[10]=r,e[11]=h,e[12]=o,e[13]=f):f=e[13];let m;e[14]!==f?(m=n.jsx("span",{className:"tabular-nums text-xs",children:f}),e[14]=f,e[15]=m):m=e[15];const x=s===o-1,v=s===o-1?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let g;e[16]!==v?(g=z("p-0.5 transition-colors rounded-lg",v),e[16]=v,e[17]=g):g=e[17];let b;e[18]!==r?(b=r("chat.pagination.nextLabel"),e[18]=r,e[19]=b):b=e[19];let y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(Ot,{size:14}),e[20]=y):y=e[20];let A;e[21]!==i||e[22]!==x||e[23]!==g||e[24]!==b?(A=n.jsx("button",{type:"button",onClick:i,disabled:x,className:g,"aria-label":b,children:y}),e[21]=i,e[22]=x,e[23]=g,e[24]=b,e[25]=A):A=e[25];let w;return e[26]!==A||e[27]!==p||e[28]!==m?(w=n.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[p,m,A]}),e[26]=A,e[27]=p,e[28]=m,e[29]=w):w=e[29],w}function ts(t){const e=D.c(8),{currentIndex:s,total:o,onPrev:a,onNext:i,extraLeft:r}=t;let l;e[0]!==s||e[1]!==i||e[2]!==a||e[3]!==o?(l=n.jsx(Wo,{current:s,total:o,onPrev:a,onNext:i}),e[0]=s,e[1]=i,e[2]=a,e[3]=o,e[4]=l):l=e[4];let V;return e[5]!==r||e[6]!==l?(V=n.jsxs("div",{className:"flex items-center gap-2",children:[l,r]}),e[5]=r,e[6]=l,e[7]=V):V=e[7],V}function Yo(t){const e=D.c(17),{isStreaming:s,isAllAnswered:o,isCurrentAnswered:a,onAdvanceOrSubmit:i,submitLabel:r,nextLabel:l}=t,u=o?r===void 0?"Submit":r:l===void 0?"Next":l,c=o?s:!a,p=c?o?"Waiting for the assistant to finish…":"Answer this item to continue":null;let h;e[0]!==c||e[1]!==i?(h=()=>{c||i()},e[0]=c,e[1]=i,e[2]=h):h=e[2];const f=c&&"opacity-50 cursor-not-allowed";let m;e[3]!==f?(m=z("h-7 px-2.5 text-xs",f),e[3]=f,e[4]=m):m=e[4];let x;e[5]!==c||e[6]!==u||e[7]!==h||e[8]!==m?(x=n.jsx(W,{type:"button",size:"sm","aria-disabled":c,onClick:h,className:m,children:u}),e[5]=c,e[6]=u,e[7]=h,e[8]=m,e[9]=x):x=e[9];const v=x;if(!p)return v;let g;e[10]!==v?(g=n.jsx(qt,{asChild:!0,children:v}),e[10]=v,e[11]=g):g=e[11];let b;e[12]!==p?(b=n.jsx(Wt,{children:p}),e[12]=p,e[13]=b):b=e[13];let y;return e[14]!==g||e[15]!==b?(y=n.jsxs(Yt,{children:[g,b]}),e[14]=g,e[15]=b,e[16]=y):y=e[16],y}function ss(t,e,s){return t.findIndex(o=>e(o)===s)}function At(t,e,s,o){return t.length===0?!1:t.every(a=>o(s[e(a)]))}function yt(t,e,s,o,a){if(t.length===0)return null;const i=ss(t,e,a);for(let r=1;r<=t.length;r++){const l=t[(i+r)%t.length];if(!l)continue;const V=e(l);if(V!==a&&!o(s[V]))return V}return null}function Go(t){return!t.isStreaming&&t.allAnswered}function ns(t){const{parts:e,partKey:s,schema:o,defaultValues:a,isStreaming:i,hasAnswer:r,onSubmit:l}=t,V=e[0]?s(e[0]):"",[d,u]=R.useState(V),[c,p]=R.useState(!1),h=xs({resolver:vs(o),defaultValues:a}),f=h.watch(),m=ss(e,s,d),x=m>=0?e[m]:void 0,v=r(f[d]),g=At(e,s,f,r),b=Go({isStreaming:i,allAnswered:g}),y=()=>{if(m>0){const N=e[m-1];N&&u(s(N))}},A=()=>{if(m>=0&&m<e.length-1){const N=e[m+1];N&&u(s(N))}},w=()=>{const N=h.getValues(),T=yt(e,s,N,r,d);T&&u(T)},j=()=>{h.handleSubmit(N=>{const T=N;for(const I of e)l(I,T[s(I)])})()},k=R.useRef(j);k.current=j;const C=()=>{b&&(p(!1),k.current())},_=()=>{const N=h.getValues();if(At(e,s,N,r)){if(i){p(!0);return}p(!1),k.current()}else{const T=yt(e,s,N,r,d);T&&u(T)}};return R.useEffect(()=>{if(c&&!i){if(!g){p(!1);return}p(!1),k.current()}},[c,i,g]),{form:h,activeKey:d,setActiveKey:u,currentIndex:m,currentPart:x,isCurrentAnswered:v,isAllAnswered:g,canSubmit:b,goPrev:y,goNext:A,advanceToNextUnanswered:w,submit:C,submitOrAdvance:_}}const os="chat.approval.defaultDenyReason";function as(t){const e=D.c(36),{onYolo:s}=t,o=q(),[a,i]=ke();let r,l,V,d,u,c,p,h,f;if(e[0]!==s||e[1]!==a||e[2]!==i||e[3]!==o){const y=we.find(j=>j.value===a.toolApprovalLevel)??we[0];let A;e[13]!==s||e[14]!==a||e[15]!==i?(A=j=>{const k=j,C=a.toolApprovalLevel??"readonly";i({...a,toolApprovalLevel:k}),k==="auto"&&s(C)},e[13]=s,e[14]=a,e[15]=i,e[16]=A):A=e[16];const w=A;V=Yn,h=a.toolApprovalLevel,f=w,l=Gn,u="xs",c="text-xs text-muted-foreground border-border/60 bg-transparent hover:bg-accent h-7 gap-1",p=Ho,r=Hn,d=o(y.shortKey),e[0]=s,e[1]=a,e[2]=i,e[3]=o,e[4]=r,e[5]=l,e[6]=V,e[7]=d,e[8]=u,e[9]=c,e[10]=p,e[11]=h,e[12]=f}else r=e[4],l=e[5],V=e[6],d=e[7],u=e[8],c=e[9],p=e[10],h=e[11],f=e[12];let m;e[17]!==r||e[18]!==d?(m=n.jsx(r,{children:d}),e[17]=r,e[18]=d,e[19]=m):m=e[19];let x;e[20]!==l||e[21]!==u||e[22]!==c||e[23]!==p||e[24]!==m?(x=n.jsx(l,{size:u,className:c,onClick:p,children:m}),e[20]=l,e[21]=u,e[22]=c,e[23]=p,e[24]=m,e[25]=x):x=e[25];let v;e[26]!==o?(v=we.map(y=>n.jsx(Wn,{value:y.value,children:o(y.labelKey)},y.value)),e[26]=o,e[27]=v):v=e[27];let g;e[28]!==v?(g=n.jsx(Jn,{children:v}),e[28]=v,e[29]=g):g=e[29];let b;return e[30]!==V||e[31]!==g||e[32]!==h||e[33]!==f||e[34]!==x?(b=n.jsxs(V,{value:h,onValueChange:f,children:[x,g]}),e[30]=V,e[31]=g,e[32]=h,e[33]=f,e[34]=x,e[35]=b):b=e[35],b}function Ho(t){return t.stopPropagation()}function is(t){const e=D.c(8),{input:s}=t,o=q();if(s==null){let r;e[0]!==o?(r=o("chat.approval.noInput"),e[0]=o,e[1]=r):r=e[1];let l;return e[2]!==r?(l=n.jsx("div",{className:"px-4 text-xs text-muted-foreground",children:r}),e[2]=r,e[3]=l):l=e[3],l}let a;try{let r;e[4]!==s?(r=JSON.stringify(s,null,2),e[4]=s,e[5]=r):r=e[5],a=r}catch{a=String(s)}let i;return e[6]!==a?(i=n.jsx("div",{className:"px-4",children:n.jsx("pre",{className:"text-xs font-mono text-muted-foreground/70 whitespace-pre-wrap wrap-break-word max-h-32 overflow-y-auto rounded-md bg-muted/30 px-3 py-2",children:a})}),e[6]=a,e[7]=i):i=e[7],i}function Jo(t){const e=D.c(38),{approval:s,onRespond:o}=t,a=q(),[i]=ke(),r=i.toolApprovalLevel??"readonly";let l;e[0]!==s.approvalId||e[1]!==r||e[2]!==o||e[3]!==a?(l=()=>o(s.approvalId,!1,a(os),r),e[0]=s.approvalId,e[1]=r,e[2]=o,e[3]=a,e[4]=l):l=e[4];const V=l;let d;e[5]!==s.approvalId||e[6]!==r||e[7]!==o?(d=()=>o(s.approvalId,!0,void 0,r),e[5]=s.approvalId,e[6]=r,e[7]=o,e[8]=d):d=e[8];const u=d;let c;e[9]!==s.approvalId||e[10]!==o?(c=C=>o(s.approvalId,!0,void 0,C),e[9]=s.approvalId,e[10]=o,e[11]=c):c=e[11];const p=c;let h;e[12]!==p?(h=n.jsx("div",{className:"flex items-center gap-2",children:n.jsx(as,{onYolo:p})}),e[12]=p,e[13]=h):h=e[13];const f=h;let m;e[14]!==a?(m=a("chat.approval.denyButton"),e[14]=a,e[15]=m):m=e[15];let x;e[16]!==V||e[17]!==m?(x=n.jsx(W,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2.5 text-xs text-muted-foreground [@media(hover:hover)]:hover:text-foreground active:scale-[0.97] transition-transform",onClick:V,children:m}),e[16]=V,e[17]=m,e[18]=x):x=e[18];let v;e[19]!==a?(v=a("chat.approval.acceptButton"),e[19]=a,e[20]=v):v=e[20];let g;e[21]!==u||e[22]!==v?(g=n.jsx(W,{type:"button",size:"sm",className:"h-7 px-2.5 text-xs active:scale-[0.97] transition-transform",onClick:u,children:v}),e[21]=u,e[22]=v,e[23]=g):g=e[23];let b;e[24]!==x||e[25]!==g?(b=n.jsxs(n.Fragment,{children:[x,g]}),e[24]=x,e[25]=g,e[26]=b):b=e[26];const y=b;let A;e[27]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx($e,{size:14}),e[27]=A):A=e[27];let w;e[28]!==a?(w=a("chat.approval.needsApproval"),e[28]=a,e[29]=w):w=e[29];let j;e[30]!==s.input?(j=n.jsx(is,{input:s.input}),e[30]=s.input,e[31]=j):j=e[31];let k;return e[32]!==s.friendlyName||e[33]!==f||e[34]!==y||e[35]!==w||e[36]!==j?(k=n.jsx(xe,{icon:A,label:w,title:s.friendlyName,defaultExpanded:!0,footerLeft:f,footerRight:y,children:j}),e[32]=s.friendlyName,e[33]=f,e[34]=y,e[35]=w,e[36]=j,e[37]=k):k=e[37],k}const Zo=bs(te(),oe({approved:As().optional(),levelOverride:Re(["auto","readonly"]).optional()}));function Xo(t){const e=D.c(46),{approvals:s,isStreaming:o,onRespond:a}=t,i=q(),[r]=ke(),l=r.toolApprovalLevel??"readonly";let V;e[0]!==s?(V=Object.fromEntries(s.map(sa)),e[0]=s,e[1]=V):V=e[1];const d=V;let u;e[2]!==l||e[3]!==a||e[4]!==i?(u=(T,I)=>{const E=I;typeof E?.approved=="boolean"&&a(T.approvalId,E.approved,E.approved===!1?i(os):void 0,E.levelOverride??l)},e[2]=l,e[3]=a,e[4]=i,e[5]=u):u=e[5];let c;e[6]!==s||e[7]!==d||e[8]!==o||e[9]!==u?(c={parts:s,partKey:ta,schema:Zo,defaultValues:d,isStreaming:o,hasAnswer:ea,onSubmit:u},e[6]=s,e[7]=d,e[8]=o,e[9]=u,e[10]=c):c=e[10];const p=ns(c);let h;e[11]!==s||e[12]!==p?(h=T=>{p.form.reset(Object.fromEntries(s.map(I=>[I.approvalId,{approved:!0,levelOverride:T}]))),p.submitOrAdvance()},e[11]=s,e[12]=p,e[13]=h):h=e[13];const f=h,m=p.currentPart,x=p.form;let v;e[14]!==p?(v=T=>{T.preventDefault(),p.submit()},e[14]=p,e[15]=v):v=e[15];let g;e[16]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx($e,{size:14}),e[16]=g):g=e[16];let b;e[17]!==s.length||e[18]!==i?(b=i("chat.approval.batchedLabel",{count:s.length}),e[17]=s.length,e[18]=i,e[19]=b):b=e[19];const y=m?.friendlyName??"";let A;e[20]!==f?(A=n.jsx(as,{onYolo:f}),e[20]=f,e[21]=A):A=e[21];let w;e[22]!==s.length||e[23]!==p.currentIndex||e[24]!==p.goNext||e[25]!==p.goPrev||e[26]!==A?(w=n.jsx(ts,{currentIndex:p.currentIndex,total:s.length,onPrev:p.goPrev,onNext:p.goNext,extraLeft:A}),e[22]=s.length,e[23]=p.currentIndex,e[24]=p.goNext,e[25]=p.goPrev,e[26]=A,e[27]=w):w=e[27];let j;e[28]!==m||e[29]!==p.form.control||e[30]!==p.submitOrAdvance?(j=m?n.jsx(na,{approvalId:m.approvalId,control:p.form.control,onChange:p.submitOrAdvance}):null,e[28]=m,e[29]=p.form.control,e[30]=p.submitOrAdvance,e[31]=j):j=e[31];let k;e[32]!==m?(k=m?n.jsx(is,{input:m.input}):null,e[32]=m,e[33]=k):k=e[33];let C;e[34]!==w||e[35]!==j||e[36]!==k||e[37]!==b||e[38]!==y?(C=n.jsx(xe,{icon:g,label:b,title:y,defaultExpanded:!0,footerLeft:w,footerRight:j,children:k}),e[34]=w,e[35]=j,e[36]=k,e[37]=b,e[38]=y,e[39]=C):C=e[39];let _;e[40]!==C||e[41]!==v?(_=n.jsx("form",{onSubmit:v,children:C}),e[40]=C,e[41]=v,e[42]=_):_=e[42];let N;return e[43]!==p.form||e[44]!==_?(N=n.jsx(He,{...x,children:_}),e[43]=p.form,e[44]=_,e[45]=N):N=e[45],N}function ea(t){return typeof t?.approved=="boolean"}function ta(t){return t.approvalId}function sa(t){return[t.approvalId,{approved:void 0}]}function na(t){const e=D.c(7),{approvalId:s,control:o,onChange:a}=t,i=q(),r=`${s}.approved`;let l;e[0]!==a||e[1]!==i?(l=d=>{const{field:u}=d,c=u.value===!0,p=u.value===!1;return n.jsxs(n.Fragment,{children:[n.jsx(W,{type:"button",variant:p?"secondary":"ghost",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{u.onChange(!1),a()},"aria-pressed":p,children:i("chat.approval.denyButton")}),n.jsx(W,{type:"button",variant:c?"default":"outline",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{u.onChange(!0),a()},"aria-pressed":c,children:i("chat.approval.acceptButton")})]})},e[0]=a,e[1]=i,e[2]=l):l=e[2];let V;return e[3]!==o||e[4]!==r||e[5]!==l?(V=n.jsx(ys,{control:o,name:r,render:l}),e[3]=o,e[4]=r,e[5]=l,e[6]=V):V=e[6],V}function oa(){const t=D.c(5),e=q();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx($e,{className:"size-5 text-muted-foreground animate-pulse motion-reduce:animate-none"}),t[0]=s):s=t[0];let o;t[1]!==e?(o=e("chat.approval.preparingRequest"),t[1]=e,t[2]=o):o=t[2];let a;return t[3]!==o?(a=n.jsxs("div",{className:"flex items-center gap-2 p-4 border border-dashed rounded-lg bg-accent/50 w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",children:[s,n.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:o})]}),t[3]=o,t[4]=a):a=t[4],a}function aa(t){const e=D.c(8),{approvals:s,isStreaming:o,onRespond:a}=t;if(o&&s.length===0){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(oa,{}),e[0]=r):r=e[0],r}if(s.length===0)return null;if(s.length===1){const r=s[0];if(!r)return null;let l;return e[1]!==a||e[2]!==r?(l=n.jsx(Jo,{approval:r,onRespond:a}),e[1]=a,e[2]=r,e[3]=l):l=e[3],l}let i;return e[4]!==s||e[5]!==o||e[6]!==a?(i=n.jsx(Xo,{approvals:s,isStreaming:o,onRespond:a}),e[4]=s,e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function ia(t){const e=D.c(28),{plan:s,onApprove:o,onDismiss:a}=t,i=q();let r;e[0]!==o||e[1]!==s.plan?(r=()=>{o(s.plan)},e[0]=o,e[1]=s.plan,e[2]=r):r=e[2];const l=r;let V;e[3]!==i?(V=i("chat.proposePlan.keepIterating"),e[3]=i,e[4]=V):V=e[4];let d;e[5]!==a||e[6]!==V?(d=n.jsx(W,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2.5 text-xs text-muted-foreground [@media(hover:hover)]:hover:text-foreground active:scale-[0.97] transition-transform",onClick:a,children:V}),e[5]=a,e[6]=V,e[7]=d):d=e[7];let u;e[8]!==i?(u=i("chat.proposePlan.letsGo"),e[8]=i,e[9]=u):u=e[9];let c;e[10]!==l||e[11]!==u?(c=n.jsx(W,{type:"button",size:"sm",className:"h-7 px-2.5 text-xs bg-special hover:bg-special/90 text-special-foreground active:scale-[0.97] transition-transform",onClick:l,children:u}),e[10]=l,e[11]=u,e[12]=c):c=e[12];let p;e[13]!==d||e[14]!==c?(p=n.jsxs(n.Fragment,{children:[d,c]}),e[13]=d,e[14]=c,e[15]=p):p=e[15];const h=p;let f;e[16]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Qt,{size:14}),e[16]=f):f=e[16];let m;e[17]!==i?(m=i("chat.proposePlan.planReady"),e[17]=i,e[18]=m):m=e[18];let x;e[19]!==i?(x=i("chat.proposePlan.implementationPlan"),e[19]=i,e[20]=x):x=e[20];let v;e[21]!==s.plan?(v=n.jsx("div",{className:"px-4 max-h-64 overflow-y-auto",children:n.jsx("div",{className:"prose prose-sm max-w-none text-sm",children:n.jsx(nn,{id:"plan-preview",part:{type:"text",text:s.plan}})})}),e[21]=s.plan,e[22]=v):v=e[22];let g;return e[23]!==h||e[24]!==v||e[25]!==m||e[26]!==x?(g=n.jsx(xe,{icon:f,label:m,title:x,defaultExpanded:!0,footerRight:h,children:v}),e[23]=h,e[24]=v,e[25]=m,e[26]=x,e[27]=g):g=e[27],g}function ra(t){const e=D.c(6),{plans:s,onApprove:o,onDismiss:a}=t;let i;e[0]!==s?(i=Zt(s),e[0]=s,e[1]=i):i=e[1];const r=i;if(!r)return null;let l;return e[2]!==r||e[3]!==o||e[4]!==a?(l=n.jsx(ia,{plan:r,onApprove:o,onDismiss:a}),e[2]=r,e[3]=o,e[4]=a,e[5]=l):l=e[5],l}function rs(t){return t?"response"in t?t.response:t.option??t.draft:""}const jt=oe({response:te().min(1,"Response is required")}),la=oe({option:te().nullable(),draft:te()}).refine(t=>(t.option??t.draft).length>0,{message:"Please select or enter an option"}),Va=oe({response:Re(["yes","no"])});function ca(t){switch(t.type){case"text":return jt;case"choice":return la;case"confirm":return Va;default:return jt}}function da(t){const e={};for(const s of t)e[s.toolCallId]=ca(s.input);return oe(e)}function ua(t){const e=D.c(7),{control:s,name:o,placeholder:a}=t,i=q();let r;e[0]!==a||e[1]!==i?(r=V=>{const{field:d}=V,u=d.value??"";return n.jsxs(st,{children:[n.jsx(nt,{children:n.jsx("div",{className:"px-2",children:n.jsxs("div",{className:"flex items-center gap-3 px-2 py-3 rounded-lg bg-accent/50",children:[n.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:n.jsx(Et,{size:16,className:"text-muted-foreground"})}),n.jsx("input",{...d,value:u,type:"text",placeholder:a||i("chat.userAskQuestion.typeResponse"),autoFocus:!0,"aria-label":i("chat.userAskQuestion.textResponseInputAriaLabel"),className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"})]})})}),n.jsx(ot,{})]})},e[0]=a,e[1]=i,e[2]=r):r=e[2];let l;return e[3]!==s||e[4]!==o||e[5]!==r?(l=n.jsx(Kt,{control:s,name:o,render:r}),e[3]=s,e[4]=o,e[5]=r,e[6]=l):l=e[6],l}function ls(t,e){const s=D.c(4);let o,a;s[0]!==t||s[1]!==e?(o=()=>{const i=r=>{if(js(r.target)||r.metaKey||r.ctrlKey||r.altKey)return;const l=Number.parseInt(r.key,10);l>=1&&l<=t&&(r.preventDefault(),e(l-1))};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},a=[t,e],s[0]=t,s[1]=e,s[2]=o,s[3]=a):(o=s[2],a=s[3]),R.useEffect(o,a)}function pa(t){const e=D.c(51),{control:s,name:o,options:a}=t,i=q(),r=`${o}.option`;let l;e[0]!==s||e[1]!==r?(l={control:s,name:r,defaultValue:null},e[0]=s,e[1]=r,e[2]=l):l=e[2];const{field:V}=Vt(l),d=`${o}.draft`;let u;e[3]!==s||e[4]!==d?(u={control:s,name:d,defaultValue:""},e[3]=s,e[4]=d,e[5]=u):u=e[5];const{field:c}=Vt(u),p=V.value,h=c.value??"";let f;if(e[6]!==V||e[7]!==a?(f=O=>{const M=a[O];M!=null&&V.onChange(M)},e[6]=V,e[7]=a,e[8]=f):f=e[8],ls(a.length,f),a.length===0)return null;const m=p===null;let x;e[9]!==i?(x=i("chat.userAskQuestion.choiceOptionsAriaLabel"),e[9]=i,e[10]=x):x=e[10];let v;if(e[11]!==V||e[12]!==p||e[13]!==a||e[14]!==i){let O;e[16]!==V||e[17]!==p||e[18]!==i?(O=(M,K)=>{const Q=p===M;return n.jsxs("button",{type:"button",onClick:()=>V.onChange(M),className:z("flex items-start gap-3 px-2 py-3 rounded-lg text-left transition-colors w-full",Q&&"bg-accent/50",!Q&&"hover:bg-accent"),"aria-label":i("chat.userAskQuestion.selectOption",{option:M}),children:[n.jsx("span",{className:z("flex items-center justify-center size-6 rounded-md text-sm shrink-0 mt-0.5",Q?"bg-chart-1 text-white":"bg-muted text-foreground"),children:K+1}),n.jsx("span",{className:"text-sm text-foreground min-w-0 break-words",children:M})]},`${K}-${M}`)},e[16]=V,e[17]=p,e[18]=i,e[19]=O):O=e[19],v=a.map(O),e[11]=V,e[12]=p,e[13]=a,e[14]=i,e[15]=v}else v=e[15];const g=m&&"bg-accent/50",b=!m&&"hover:bg-accent";let y;e[20]!==g||e[21]!==b?(y=z("flex items-center gap-3 px-2 py-3 rounded-lg transition-colors w-full cursor-text",g,b),e[20]=g,e[21]=b,e[22]=y):y=e[22];let A;e[23]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:n.jsx(Et,{size:16,className:"text-muted-foreground"})}),e[23]=A):A=e[23];const w=m?h:"";let j;e[24]!==c||e[25]!==V||e[26]!==p?(j=O=>{c.onChange(O.target.value),p!==null&&V.onChange(null)},e[24]=c,e[25]=V,e[26]=p,e[27]=j):j=e[27];let k;e[28]!==V||e[29]!==p?(k=()=>{p!==null&&V.onChange(null)},e[28]=V,e[29]=p,e[30]=k):k=e[30];let C;e[31]!==i?(C=i("chat.userAskQuestion.somethingElsePlaceholder"),e[31]=i,e[32]=C):C=e[32];let _;e[33]!==i?(_=i("chat.userAskQuestion.customChoiceInputAriaLabel"),e[33]=i,e[34]=_):_=e[34];let N;e[35]!==w||e[36]!==j||e[37]!==k||e[38]!==C||e[39]!==_?(N=n.jsx("input",{type:"text",value:w,onChange:j,onFocus:k,placeholder:C,"aria-label":_,className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"}),e[35]=w,e[36]=j,e[37]=k,e[38]=C,e[39]=_,e[40]=N):N=e[40];let T;e[41]!==y||e[42]!==N?(T=n.jsxs("label",{className:y,children:[A,N]}),e[41]=y,e[42]=N,e[43]=T):T=e[43];let I;e[44]!==T||e[45]!==x||e[46]!==v?(I=n.jsx(nt,{children:n.jsxs("div",{className:"flex flex-col px-2",role:"group","aria-label":x,children:[v,T]})}),e[44]=T,e[45]=x,e[46]=v,e[47]=I):I=e[47];let E;e[48]===Symbol.for("react.memo_cache_sentinel")?(E=n.jsx(ot,{}),e[48]=E):E=e[48];let F;return e[49]!==I?(F=n.jsxs(st,{children:[I,E]}),e[49]=I,e[50]=F):F=e[50],F}function ha(t){const e=D.c(8),{control:s,name:o}=t,a=q();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=["yes","no"],e[0]=i):i=e[0];const r=i,l=R.useRef(null);let V;e[1]===Symbol.for("react.memo_cache_sentinel")?(V=c=>{l.current?.onChange(r[c]??"")},e[1]=V):V=e[1],ls(r.length,V);let d;e[2]!==a?(d=c=>{const{field:p}=c;return l.current=p,n.jsxs(st,{children:[n.jsx(nt,{children:n.jsx("div",{className:"flex gap-2 px-2",role:"group","aria-label":a("chat.userAskQuestion.confirmationOptionsAriaLabel"),children:r.map(h=>{const f=p.value===h;return n.jsxs("button",{type:"button",onClick:()=>p.onChange(h),className:z("flex items-center gap-3 px-4 py-3 rounded-lg text-left transition-colors flex-1",f&&"bg-accent/50",!f&&"hover:bg-accent"),"aria-label":a("chat.userAskQuestion.confirmValue",{value:a(`chat.userAskQuestion.confirm${h==="yes"?"Yes":"No"}`)}),children:[n.jsx("span",{className:z("flex items-center justify-center size-6 rounded-md text-sm shrink-0",f?"bg-chart-1 text-white":"bg-muted text-foreground"),children:h==="yes"?1:2}),n.jsx("span",{className:"text-sm text-foreground capitalize",children:a(`chat.userAskQuestion.confirm${h==="yes"?"Yes":"No"}`)})]},h)})})}),n.jsx(ot,{})]})},e[2]=a,e[3]=d):d=e[3];let u;return e[4]!==s||e[5]!==o||e[6]!==d?(u=n.jsx(Kt,{control:s,name:o,render:d}),e[4]=s,e[5]=o,e[6]=d,e[7]=u):u=e[7],u}function wt(t){const e=D.c(13),{input:s,control:o,toolCallId:a}=t;switch(s.type){case"text":{const i=`${a}.response`;let r;return e[0]!==o||e[1]!==s.default||e[2]!==i?(r=n.jsx(ua,{control:o,name:i,placeholder:s.default}),e[0]=o,e[1]=s.default,e[2]=i,e[3]=r):r=e[3],r}case"choice":{let i;e[4]!==s.options?(i=s.options?.filter(Boolean)??[],e[4]=s.options,e[5]=i):i=e[5];const r=i;let l;return e[6]!==o||e[7]!==r||e[8]!==a?(l=n.jsx(pa,{control:o,name:a,options:r}),e[6]=o,e[7]=r,e[8]=a,e[9]=l):l=e[9],l}case"confirm":{const i=`${a}.response`;let r;return e[10]!==o||e[11]!==i?(r=n.jsx(ha,{control:o,name:i}),e[10]=o,e[11]=i,e[12]=r):r=e[12],r}default:return null}}function fa(t){const e=D.c(91),{parts:s,isStreaming:o,onSubmit:a}=t;let i;e[0]!==s?(i=da(s.map(va)),e[0]=s,e[1]=i):i=e[1];const r=i;let l;e[2]!==s?(l=Object.fromEntries(s.map(xa)),e[2]=s,e[3]=l):l=e[3];const V=l;let d;e[4]!==a?(d=(U,Y)=>{const P=rs(Y);P&&a(U,P)},e[4]=a,e[5]=d):d=e[5];let u;e[6]!==V||e[7]!==o||e[8]!==s||e[9]!==r||e[10]!==d?(u={parts:s,partKey:ga,schema:r,defaultValues:V,isStreaming:o,hasAnswer:ma,onSubmit:d},e[6]=V,e[7]=o,e[8]=s,e[9]=r,e[10]=d,e[11]=u):u=e[11];const c=ns(u),p=c.currentPart,h=q();let f;e[12]!==p||e[13]!==c||e[14]!==h?(f=()=>{const U=p;if(!U)return;const Y=h("chat.userAskQuestion.skipMessage"),P=U.toolCallId;U.input?.type==="choice"?(c.form.setValue(`${P}.option`,null),c.form.setValue(`${P}.draft`,Y)):c.form.setValue(`${P}.response`,Y),c.advanceToNextUnanswered()},e[12]=p,e[13]=c,e[14]=h,e[15]=f):f=e[15];const m=f;let x;e[16]!==c.currentIndex||e[17]!==c.goNext||e[18]!==c.goPrev||e[19]!==s.length?(x=n.jsx(ts,{currentIndex:c.currentIndex,total:s.length,onPrev:c.goPrev,onNext:c.goNext}),e[16]=c.currentIndex,e[17]=c.goNext,e[18]=c.goPrev,e[19]=s.length,e[20]=x):x=e[20];const v=x;let g;e[21]!==h?(g=h("chat.userAskQuestion.skip"),e[21]=h,e[22]=g):g=e[22];let b;e[23]!==m||e[24]!==g?(b=n.jsx(W,{type:"button",variant:"outline",size:"sm",onClick:m,className:"h-7",children:g}),e[23]=m,e[24]=g,e[25]=b):b=e[25];let y;e[26]!==c.isAllAnswered||e[27]!==c.isCurrentAnswered||e[28]!==c.submitOrAdvance||e[29]!==o?(y=n.jsx(Yo,{isStreaming:o,isAllAnswered:c.isAllAnswered,isCurrentAnswered:c.isCurrentAnswered,onAdvanceOrSubmit:c.submitOrAdvance}),e[26]=c.isAllAnswered,e[27]=c.isCurrentAnswered,e[28]=c.submitOrAdvance,e[29]=o,e[30]=y):y=e[30];let A;e[31]!==b||e[32]!==y?(A=n.jsxs(n.Fragment,{children:[b,y]}),e[31]=b,e[32]=y,e[33]=A):A=e[33];const w=A;if(s.length===1){const U=s[0];if(!U?.input)return null;const Y=c.form;let P;e[34]!==c?(P=ee=>{ee.preventDefault(),c.submit()},e[34]=c,e[35]=P):P=e[35];let G;e[36]===Symbol.for("react.memo_cache_sentinel")?(G=n.jsx(Ge,{size:14}),e[36]=G):G=e[36];let ne;e[37]!==h?(ne=h("chat.userAskQuestion.questionPending"),e[37]=h,e[38]=ne):ne=e[38];let H;e[39]!==U.input?.prompt||e[40]!==h?(H=U.input?.prompt??h("chat.userAskQuestion.question"),e[39]=U.input?.prompt,e[40]=h,e[41]=H):H=e[41];const re=U.input;let S;e[42]!==c.form.control||e[43]!==U.toolCallId||e[44]!==re?(S=n.jsx(wt,{input:re,control:c.form.control,toolCallId:U.toolCallId}),e[42]=c.form.control,e[43]=U.toolCallId,e[44]=re,e[45]=S):S=e[45];let L;e[46]!==w||e[47]!==ne||e[48]!==H||e[49]!==S?(L=n.jsx(xe,{icon:G,label:ne,title:H,defaultExpanded:!0,footerRight:w,children:S}),e[46]=w,e[47]=ne,e[48]=H,e[49]=S,e[50]=L):L=e[50];let J;e[51]!==P||e[52]!==L?(J=n.jsx("form",{onSubmit:P,autoComplete:"off",children:L}),e[51]=P,e[52]=L,e[53]=J):J=e[53];let $;return e[54]!==c.form||e[55]!==J?($=n.jsx(He,{...Y,children:J}),e[54]=c.form,e[55]=J,e[56]=$):$=e[56],$}const j=c.form;let k;e[57]!==c?(k=U=>{U.preventDefault(),c.submit()},e[57]=c,e[58]=k):k=e[58];let C;e[59]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(Ge,{size:14}),e[59]=C):C=e[59];let _;e[60]!==h?(_=h("chat.userAskQuestion.questionPending"),e[60]=h,e[61]=_):_=e[61];const N=c.currentIndex+1;let T;e[62]!==s.length||e[63]!==h||e[64]!==N?(T=h("chat.userAskQuestion.questionCount",{current:N,total:s.length}),e[62]=s.length,e[63]=h,e[64]=N,e[65]=T):T=e[65];let I;e[66]!==p?.input?.prompt||e[67]!==h?(I=p?.input?.prompt??h("chat.userAskQuestion.question"),e[66]=p?.input?.prompt,e[67]=h,e[68]=I):I=e[68];const E=c.activeKey,F=c.setActiveKey;let O;if(e[69]!==c.form||e[70]!==s){let U;e[72]!==c.form?(U=Y=>n.jsx(eo,{value:Y.toolCallId,className:"mt-0",children:n.jsx(wt,{input:Y.input,control:c.form.control,toolCallId:Y.toolCallId})},Y.toolCallId),e[72]=c.form,e[73]=U):U=e[73],O=s.map(U),e[69]=c.form,e[70]=s,e[71]=O}else O=e[71];let M;e[74]!==c.activeKey||e[75]!==c.setActiveKey||e[76]!==O?(M=n.jsx(to,{value:E,onValueChange:F,children:O}),e[74]=c.activeKey,e[75]=c.setActiveKey,e[76]=O,e[77]=M):M=e[77];let K;e[78]!==v||e[79]!==w||e[80]!==_||e[81]!==T||e[82]!==I||e[83]!==M?(K=n.jsx(xe,{icon:C,label:_,count:T,title:I,defaultExpanded:!0,footerLeft:v,footerRight:w,children:M}),e[78]=v,e[79]=w,e[80]=_,e[81]=T,e[82]=I,e[83]=M,e[84]=K):K=e[84];let Q;e[85]!==k||e[86]!==K?(Q=n.jsx("form",{onSubmit:k,autoComplete:"off",children:K}),e[85]=k,e[86]=K,e[87]=Q):Q=e[87];let Z;return e[88]!==c.form||e[89]!==Q?(Z=n.jsx(He,{...j,children:Q}),e[88]=c.form,e[89]=Q,e[90]=Z):Z=e[90],Z}function ma(t){return!!rs(t)}function ga(t){return t.toolCallId}function xa(t){return t.input?.type==="choice"?[t.toolCallId,{option:null,draft:""}]:[t.toolCallId,{response:""}]}function va(t){return{toolCallId:t.toolCallId,input:t.input}}function ba(){const t=D.c(5),e=q();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(Ge,{className:"size-5 text-muted-foreground animate-pulse motion-reduce:animate-none"}),t[0]=s):s=t[0];let o;t[1]!==e?(o=e("chat.userAskQuestion.preparingQuestion"),t[1]=e,t[2]=o):o=t[2];let a;return t[3]!==o?(a=n.jsxs("div",{className:"flex items-center gap-2 p-4 border border-dashed rounded-lg bg-accent/50 w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",children:[s,n.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:o})]}),t[3]=o,t[4]=a):a=t[4],a}function Vs(t){const e=D.c(7),{userAskParts:s,isStreaming:o,onSubmit:a}=t;let i;e[0]!==s?(i=s.filter(Aa),e[0]=s,e[1]=i):i=e[1];const r=i;if(r.length===0){if(o){let V;return e[2]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsx(ba,{}),e[2]=V):V=e[2],V}return null}let l;return e[3]!==o||e[4]!==a||e[5]!==r?(l=n.jsx(fa,{parts:r,isStreaming:o,onSubmit:a}),e[3]=o,e[4]=a,e[5]=r,e[6]=l):l=e[6],l}function Aa(t){return t.state==="input-available"}function ya(t){const e=D.c(33),{parts:s,isStreaming:o,onRespond:a}=t,i=q();let r;e[0]!==s?(r=s.at(-1),e[0]=s,e[1]=r):r=e[1];const l=r,V=l?.input;if(!l||!V?.title)return null;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(Qt,{size:14}),e[2]=d):d=e[2];let u;e[3]!==i?(u=i("chat.suggestTask.label"),e[3]=i,e[4]=u):u=e[4];const c=V.title;let p;e[5]!==a||e[6]!==l?(p=()=>a(l,!1),e[5]=a,e[6]=l,e[7]=p):p=e[7];let h;e[8]!==i?(h=i("chat.suggestTask.notNow"),e[8]=i,e[9]=h):h=e[9];let f;e[10]!==o||e[11]!==p||e[12]!==h?(f=n.jsx(W,{type:"button",size:"sm",variant:"outline",className:"h-7",disabled:o,onClick:p,children:h}),e[10]=o,e[11]=p,e[12]=h,e[13]=f):f=e[13];let m;e[14]!==a||e[15]!==l?(m=()=>a(l,!0),e[14]=a,e[15]=l,e[16]=m):m=e[16];let x;e[17]!==i?(x=i("chat.suggestTask.create"),e[17]=i,e[18]=x):x=e[18];let v;e[19]!==o||e[20]!==m||e[21]!==x?(v=n.jsx(W,{type:"button",size:"sm",className:"h-7",disabled:o,onClick:m,children:x}),e[19]=o,e[20]=m,e[21]=x,e[22]=v):v=e[22];let g;e[23]!==v||e[24]!==f?(g=n.jsxs(n.Fragment,{children:[f,v]}),e[23]=v,e[24]=f,e[25]=g):g=e[25];let b;e[26]!==V.summary?(b=V.summary?n.jsx("p",{className:"px-4 pb-1 text-sm leading-snug text-muted-foreground whitespace-pre-wrap",children:V.summary}):null,e[26]=V.summary,e[27]=b):b=e[27];let y;return e[28]!==V.title||e[29]!==g||e[30]!==b||e[31]!==u?(y=n.jsx(xe,{icon:d,label:u,title:c,defaultExpanded:!0,footerRight:g,children:b}),e[28]=V.title,e[29]=g,e[30]=b,e[31]=u,e[32]=y):y=e[32],y}function ja(t){const e=t.filter(i=>i.status==="in_progress"),s=t.filter(i=>i.status==="completed").length,o=t.length;if(o>0&&s===o)return{icon:"completed",activity:"All done",progress:`${o}/${o}`};const[a]=e;return a&&e.length===1?{icon:"in_progress",activity:a.activeForm,progress:`${s}/${o} done`}:e.length>1?{icon:"in_progress",activity:`${e.length} in progress`,progress:`${s}/${o} done`}:s>0?{icon:"pending",activity:`${o-s} pending`,progress:`${s}/${o} done`}:{icon:"pending",activity:`${o} todos`,progress:"not started"}}function wa(t){const e=D.c(13),{todos:s}=t;if(s.length===0)return null;let o;e[0]!==s?(o=ja(s),e[0]=s,e[1]=o):o=e[1];const a=o;let i;e[2]!==a.icon?(i=n.jsx(Na,{status:a.icon}),e[2]=a.icon,e[3]=i):i=e[3];const r=a.activity,l=a.progress;let V;e[4]!==s?(V=s.map(ka),e[4]=s,e[5]=V):V=e[5];let d;e[6]!==V?(d=n.jsx("ul",{"data-testid":"todos-list",className:"flex flex-col px-2 max-h-[40vh] overflow-y-auto",children:V}),e[6]=V,e[7]=d):d=e[7];let u;return e[8]!==a.activity||e[9]!==a.progress||e[10]!==i||e[11]!==d?(u=n.jsx(xe,{icon:i,label:r,count:l,defaultExpanded:!1,children:d}),e[8]=a.activity,e[9]=a.progress,e[10]=i,e[11]=d,e[12]=u):u=e[12],u}function ka(t,e){return n.jsx(Ca,{todo:t},e)}function Ca(t){const e=D.c(14),{todo:s}=t,o=s.status==="completed",i=s.status==="in_progress"?s.activeForm:s.content;let r;e[0]!==s.status?(r=n.jsx(Sa,{status:s.status}),e[0]=s.status,e[1]=r):r=e[1];const l=o&&"text-muted-foreground";let V;e[2]!==l?(V=z("relative text-sm leading-snug pt-px select-none",l),e[2]=l,e[3]=V):V=e[3];const d=o?"100%":"0%",u=o?"width 300ms ease 200ms":"width 150ms ease";let c;e[4]!==d||e[5]!==u?(c=n.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:"50%",height:"1px",background:"currentColor",width:d,transition:u}}),e[4]=d,e[5]=u,e[6]=c):c=e[6];let p;e[7]!==i||e[8]!==V||e[9]!==c?(p=n.jsxs("span",{className:V,children:[i,c]}),e[7]=i,e[8]=V,e[9]=c,e[10]=p):p=e[10];let h;return e[11]!==r||e[12]!==p?(h=n.jsxs("li",{className:"flex items-start gap-2.5 px-2 py-1.5 rounded-lg hover:bg-accent transition-colors",children:[r,p]}),e[11]=r,e[12]=p,e[13]=h):h=e[13],h}function Sa(t){const e=D.c(4),{status:s}=t,o=s==="completed"?"true":void 0,a=s==="in_progress"?"true":void 0;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("svg",{viewBox:"0 0 21 21",children:n.jsx("path",{d:"M5,10.75 L8.5,14.25 L19.4,2.3 C18.8333333,1.43333333 18.0333333,1 17,1 L4,1 C2.35,1 1,2.35 1,4 L1,17 C1,18.65 2.35,20 4,20 L17,20 C18.65,20 20,18.65 20,17 L20,7.99769186"})}),e[0]=i):i=e[0];let r;return e[1]!==o||e[2]!==a?(r=n.jsx("div",{className:"todo-cb mt-0.5","data-checked":o,"data-progress":a,"aria-hidden":"true",children:i}),e[1]=o,e[2]=a,e[3]=r):r=e[3],r}function Na(t){const e=D.c(13),{status:s}=t,o=q();if(s==="completed"){let r;e[0]!==o?(r=o("chat.todoStatus.completed"),e[0]=o,e[1]=r):r=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx("svg",{viewBox:"0 0 10 8",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",className:"w-2 h-2 text-primary-foreground",style:{strokeWidth:2},children:n.jsx("path",{d:"M1 4l2.5 2.5L9 1"})}),e[2]=l):l=e[2];let V;return e[3]!==r?(V=n.jsx("span",{"aria-label":r,className:"inline-flex items-center justify-center w-3.5 h-3.5 rounded-sm bg-primary",children:l}),e[3]=r,e[4]=V):V=e[4],V}if(s==="in_progress"){let r;e[5]!==o?(r=o("chat.todoStatus.inProgress"),e[5]=o,e[6]=r):r=e[6];let l;return e[7]!==r?(l=n.jsx("span",{"aria-label":r,className:"inline-block w-2 h-2 rounded-full bg-primary animate-pulse shrink-0"}),e[7]=r,e[8]=l):l=e[8],l}let a;e[9]!==o?(a=o("chat.todoStatus.pending"),e[9]=o,e[10]=a):a=e[10];let i;return e[11]!==a?(i=n.jsx("span",{"aria-label":a,className:"inline-block w-3.5 h-3.5 rounded-sm border-[1.5px] border-muted-foreground/50 shrink-0"}),e[11]=a,e[12]=i):i=e[12],i}const Ia={usd:[{dollars:10,labelKey:"credits.topUp.starter"},{dollars:20,labelKey:"credits.topUp.popular"},{dollars:100,labelKey:"credits.topUp.bestValue"}],brl:[{dollars:50,labelKey:"credits.topUp.starter"},{dollars:100,labelKey:"credits.topUp.popular"},{dollars:500,labelKey:"credits.topUp.bestValue"}]},Ta={"credits.topUp.starter":"starter","credits.topUp.popular":"popular","credits.topUp.bestValue":"best_value"};function _a(t){const e=D.c(46),{source:s,onDone:o}=t,a=q(),i=ws(),[r]=ke(),[l,V]=R.useState(r.language==="pt-BR"?"brl":"usd"),[d,u]=R.useState(""),[c,p]=R.useState(!1),h=l==="brl"?"R$":"$";let f;e[0]!==l||e[1]!==i?(f=async M=>{const{url:K}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:M,currency:l});return K},e[0]=l,e[1]=i,e[2]=f):f=e[2];let m;e[3]!==o?(m=M=>{M&&window.open(M,"_blank","noopener,noreferrer"),o?.()},e[3]=o,e[4]=m):m=e[4];let x;e[5]!==a?(x=M=>{Ie.error(a("credits.topUp.failed",{message:M.message}))},e[5]=a,e[6]=x):x=e[6];let v;e[7]!==f||e[8]!==m||e[9]!==x?(v={mutationFn:f,onSuccess:m,onError:x},e[7]=f,e[8]=m,e[9]=x,e[10]=v):v=e[10];const{mutate:g,isPending:b}=ks(v);let y;e[11]!==l||e[12]!==s||e[13]!==g?(y=(M,K)=>{X("credits_topup_clicked",{amount_cents:M,currency:l,tier_label:K,source:s}),g(M)},e[11]=l,e[12]=s,e[13]=g,e[14]=y):y=e[14];const A=y,w=parseFloat(d),j=!isNaN(w)&&w>=1;let k,C,_;e[15]===Symbol.for("react.memo_cache_sentinel")?(k=M=>{M&&V(M)},C=n.jsx(ft,{value:"usd",className:"h-8 px-3 text-xs",children:"USD"}),_=n.jsx(ft,{value:"brl",className:"h-8 px-3 text-xs",children:"BRL"}),e[15]=k,e[16]=C,e[17]=_):(k=e[15],C=e[16],_=e[17]);let N;e[18]!==l?(N=n.jsx("div",{className:"mb-4",children:n.jsxs(oo,{type:"single",variant:"outline",size:"sm",value:l,onValueChange:k,children:[C,_]})}),e[18]=l,e[19]=N):N=e[19];const T=Ia[l];let I;if(e[20]!==A||e[21]!==h||e[22]!==b||e[23]!==a||e[24]!==T){let M;e[26]!==A||e[27]!==h||e[28]!==b||e[29]!==a?(M=K=>{const{dollars:Q,labelKey:Z}=K;return n.jsxs("button",{type:"button",disabled:b,onClick:()=>A(Q*100,Ta[Z]??"preset"),className:z("relative flex flex-col items-center gap-1 py-5 surface surface-interactive cursor-pointer","disabled:opacity-50 disabled:cursor-wait"),children:[n.jsxs("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:[h,Q]}),n.jsx("span",{className:"text-xs text-muted-foreground",children:a(Z)})]},Q)},e[26]=A,e[27]=h,e[28]=b,e[29]=a,e[30]=M):M=e[30],I=T.map(M),e[20]=A,e[21]=h,e[22]=b,e[23]=a,e[24]=T,e[25]=I}else I=e[25];let E;e[31]!==I?(E=n.jsx("div",{className:"grid grid-cols-3 gap-2.5",children:I}),e[31]=I,e[32]=E):E=e[32];let F;e[33]!==A||e[34]!==h||e[35]!==d||e[36]!==w||e[37]!==j||e[38]!==b||e[39]!==c||e[40]!==a?(F=c?n.jsxs("div",{className:"flex gap-2 mt-3",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:h}),n.jsx(Cs,{type:"number",min:"1",step:"1",placeholder:a("credits.topUp.customPlaceholder"),value:d,onChange:M=>u(M.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),n.jsx(W,{size:"lg",disabled:!j||b,onClick:()=>A(Math.round(w*100),"custom"),children:a(b?"credits.topUp.opening":"credits.topUp.add")})]}):n.jsx("button",{type:"button",className:"w-full mt-3 text-xs text-muted-foreground hover:text-foreground transition-colors py-1",onClick:()=>p(!0),children:a("credits.topUp.enterCustom")}),e[33]=A,e[34]=h,e[35]=d,e[36]=w,e[37]=j,e[38]=b,e[39]=c,e[40]=a,e[41]=F):F=e[41];let O;return e[42]!==E||e[43]!==F||e[44]!==N?(O=n.jsxs("div",{children:[N,E,F]}),e[42]=E,e[43]=F,e[44]=N,e[45]=O):O=e[45],O}const Da=["chat.creditsExhaustedBanner.benefit1","chat.creditsExhaustedBanner.benefit2","chat.creditsExhaustedBanner.benefit3"];function Ma(t){const e=D.c(47),{onDismiss:s}=t,{org:o}=Te(),a=Xe(),{decoKeyId:i}=no(),r=q(),l=Ke("credits");let V,d;if(e[0]!==o.id?(V=()=>{X("credits_exhausted_shown",{organization_id:o.id})},d=[o.id],e[0]=o.id,e[1]=V,e[2]=d):(V=e[1],d=e[2]),R.useEffect(V,d),!l)return null;let u;e[3]!==s?(u=T=>!T&&s?.(),e[3]=s,e[4]=u):u=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=["radial-gradient(ellipse 40% 200% at -5% 100%, rgba(165,149,255,0.5) 0%, transparent 100%)","radial-gradient(ellipse 40% 200% at 105% -10%, rgba(208,236,26,0.45) 0%, transparent 100%)"],e[5]=c):c=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx("div",{className:"absolute inset-x-0 top-0 h-36 pointer-events-none",style:{backgroundImage:c.join(", "),maskImage:"linear-gradient(to bottom, black 0%, transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black 0%, transparent 100%)"}}),e[6]=p):p=e[6];let h;e[7]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),e[7]=h):h=e[7];let f;e[8]!==r?(f=r("chat.creditsExhaustedBanner.title"),e[8]=r,e[9]=f):f=e[9];let m;e[10]!==f?(m=n.jsx(Ss,{className:"text-xl font-semibold tracking-tight",children:f}),e[10]=f,e[11]=m):m=e[11];let x;e[12]!==r?(x=r("chat.creditsExhaustedBanner.description"),e[12]=r,e[13]=x):x=e[13];let v;e[14]!==x?(v=n.jsx(Ns,{className:"mt-1.5 text-sm leading-relaxed",children:x}),e[14]=x,e[15]=v):v=e[15];let g;e[16]!==v||e[17]!==m?(g=n.jsxs("div",{className:"relative px-8 pt-8 pb-2 overflow-hidden",children:[p,n.jsxs(Is,{className:"relative gap-4",children:[h,n.jsxs("div",{children:[m,v]})]})]}),e[16]=v,e[17]=m,e[18]=g):g=e[18];let b;e[19]!==i||e[20]!==s||e[21]!==r?(b=i&&n.jsxs("div",{className:"px-8 pt-5 pb-6",children:[n.jsx("div",{className:"surface p-5",children:n.jsx(_a,{source:"exhausted_banner",onDone:s})}),n.jsx("div",{className:"mt-5 rounded-xl bg-muted/25 border border-border/50 p-4 space-y-3",children:Da.map(T=>n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"flex items-center justify-center size-5 rounded-full bg-success/15 shrink-0",children:n.jsx(_t,{size:12,className:"text-success"})}),n.jsx("span",{className:"text-sm text-foreground/80",children:r(T)})]},T))})]}),e[19]=i,e[20]=s,e[21]=r,e[22]=b):b=e[22];let y;e[23]!==r?(y=r("chat.creditsExhaustedBanner.dismiss"),e[23]=r,e[24]=y):y=e[24];let A;e[25]!==s||e[26]!==y?(A=n.jsx(W,{variant:"ghost",size:"sm",onClick:s,children:y}),e[25]=s,e[26]=y,e[27]=A):A=e[27];let w;e[28]!==a||e[29]!==s||e[30]!==o.slug?(w=()=>{a({to:"/$org/settings/ai-providers",params:{org:o.slug}}),s?.()},e[28]=a,e[29]=s,e[30]=o.slug,e[31]=w):w=e[31];let j;e[32]!==r?(j=r("chat.creditsExhaustedBanner.manageProviders"),e[32]=r,e[33]=j):j=e[33];let k;e[34]!==w||e[35]!==j?(k=n.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:w,children:j}),e[34]=w,e[35]=j,e[36]=k):k=e[36];let C;e[37]!==A||e[38]!==k?(C=n.jsxs("div",{className:"px-8 py-4 border-t border-border bg-muted/30 flex items-center justify-between",children:[A,k]}),e[37]=A,e[38]=k,e[39]=C):C=e[39];let _;e[40]!==g||e[41]!==b||e[42]!==C?(_=n.jsxs(Ts,{className:"sm:max-w-[520px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:Pa,children:[g,b,C]}),e[40]=g,e[41]=b,e[42]=C,e[43]=_):_=e[43];let N;return e[44]!==_||e[45]!==u?(N=n.jsx(_s,{open:!0,onOpenChange:u,children:_}),e[44]=_,e[45]=u,e[46]=N):N=e[46],N}function Pa(t){return t.preventDefault()}const Ea={ai_budget_exhausted:{label:"chat.planRefused.budgetLabel",title:"chat.planRefused.budgetTitle"},feature_not_in_plan:{label:"chat.planRefused.featureLabel",title:"chat.planRefused.featureTitle"}};function kt(t){const e=D.c(21),{kind:s,onDismiss:o}=t,a=q(),i=Xe(),{org:r}=Te(),{label:l,title:V}=Ea[s];let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(cn,{size:14}),e[0]=d):d=e[0];let u;e[1]!==l||e[2]!==a?(u=a(l),e[1]=l,e[2]=a,e[3]=u):u=e[3];let c;e[4]!==a||e[5]!==V?(c=a(V),e[4]=a,e[5]=V,e[6]=c):c=e[6];let p;e[7]!==i||e[8]!==o||e[9]!==r.slug?(p=()=>{i({to:"/$org/settings/ai-providers",params:{org:r.slug}}),o()},e[7]=i,e[8]=o,e[9]=r.slug,e[10]=p):p=e[10];let h;e[11]!==a?(h=a("chat.planRefused.seePlans"),e[11]=a,e[12]=h):h=e[12];let f;e[13]!==p||e[14]!==h?(f=n.jsx(W,{size:"sm",className:"h-7 text-xs",onClick:p,children:h}),e[13]=p,e[14]=h,e[15]=f):f=e[15];let m;return e[16]!==o||e[17]!==u||e[18]!==c||e[19]!==f?(m=n.jsx(xe,{icon:d,label:u,title:c,defaultExpanded:!0,variant:"warning",onClose:o,footerRight:f}),e[16]=o,e[17]=u,e[18]=c,e[19]=f,e[20]=m):m=e[20],m}function cs(t){const e=Ra(t);if(e!==null){const d=cs(e);return{summary:d.summary,rawDetails:d.rawDetails??t}}const s=t.trim(),o=s.startsWith("<")&&/<[a-z][\s\S]*>/i.test(s),a=/cloudflare|cf-[a-z-]+|error[\s_-]?code[\s_-]?5\d\d/i.test(s),i=/failed to fetch|networkerror|load failed|offline/i.test(s),r=/timeout|timed out|aborted|deadline/i.test(s),l=s.length>240,V=/sandbox failed to start(?::\s*(.+))?/is.exec(s);if(V){const d=V[1]?.trim().replace(/\.$/,"");return{summary:d?`Your sandbox didn't finish starting up (${d}). Try again.`:"Your sandbox didn't finish starting up. Try again.",rawDetails:t}}return a||o&&l?{summary:"Our servers are having a moment. Try sending again in a few seconds.",rawDetails:t}:i?{summary:"Lost connection. Check your network and try again.",rawDetails:t}:r?{summary:"That took longer than expected. Try again.",rawDetails:t}:o||l?{summary:"Something unexpected came back from the server. Try again.",rawDetails:t}:{summary:t,rawDetails:null}}function Ra(t){const e=t.trim();if(!e.startsWith("{"))return null;let s;try{s=JSON.parse(e)}catch{return null}if(!s||typeof s!="object")return null;const{error:o,message:a}=s,i=typeof o=="string"?o:a;return typeof i=="string"&&i.trim()&&!i.trim().startsWith("{")?i:null}const Ua={length:"chat.highlight.warningDescriptionLength","content-filter":"chat.highlight.warningDescriptionContentFilter","tool-calls":"chat.highlight.warningDescriptionToolCalls"};function Be(t){const e=D.c(29),s=q(),{variant:o,onDismiss:a}=t,i=o==="error";let r;e[0]!==i||e[1]!==s?(r=s(i?"chat.highlight.errorOccurred":"chat.highlight.responseIncomplete"),e[0]=i,e[1]=s,e[2]=r):r=e[2];const l=r,V=i?qn:Ms;let d;e[3]!==t.error||e[4]!==t.finishReason||e[5]!==t.variant||e[6]!==s?(d=t.variant==="error"?t.error.message:(()=>{const g=Ua[t.finishReason];return g?s(g):s("chat.highlight.responseStoppedUnexpectedly",{reason:t.finishReason})})(),e[3]=t.error,e[4]=t.finishReason,e[5]=t.variant,e[6]=s,e[7]=d):d=e[7];const u=d;let c;e[8]!==i||e[9]!==u?(c=i?cs(u):{summary:u,rawDetails:null},e[8]=i,e[9]=u,e[10]=c):c=e[10];const{summary:p,rawDetails:h}=c;let f;e[11]!==V?(f=n.jsx(V,{size:14}),e[11]=V,e[12]=f):f=e[12];let m;e[13]!==i||e[14]!==t.onContinue||e[15]!==t.onFixInChat||e[16]!==s?(m=i?n.jsx(W,{size:"sm",variant:"outline",onClick:t.onFixInChat,className:"h-7 text-xs",children:s("chat.highlight.fixInChat")}):n.jsx(W,{size:"sm",variant:"outline",onClick:t.onContinue,className:"h-7 text-xs",children:s("chat.highlight.continue")}),e[13]=i,e[14]=t.onContinue,e[15]=t.onFixInChat,e[16]=s,e[17]=m):m=e[17];let x;e[18]!==h||e[19]!==s?(x=h?n.jsxs("details",{className:"group mx-4",children:[n.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-1.5 text-xs text-muted-foreground transition-colors hover:text-foreground [&::-webkit-details-marker]:hidden",children:[n.jsx("svg",{"aria-hidden":"true",className:"size-3 transition-transform group-open:rotate-90",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"m4.5 3 3 3-3 3"})}),n.jsx("span",{className:"group-open:hidden",children:s("chat.highlight.showTechnicalDetails")}),n.jsx("span",{className:"hidden group-open:inline",children:s("chat.highlight.hideTechnicalDetails")})]}),n.jsxs("div",{className:"relative mt-2",children:[n.jsx("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(h).then(()=>Ie.success(s("chat.highlight.copiedToClipboard"))).catch(()=>Ie.error(s("chat.highlight.couldNotCopy")))},"aria-label":s("chat.highlight.copyErrorDetails"),title:s("chat.highlight.copy"),className:"absolute right-1.5 top-1.5 z-10 flex h-6 w-6 items-center justify-center rounded-lg bg-background/80 text-muted-foreground backdrop-blur-sm transition-colors hover:bg-background hover:text-foreground",children:n.jsx(dn,{className:"size-3.5"})}),n.jsx("pre",{className:"max-h-40 overflow-auto rounded-md border border-border/60 bg-background px-3 py-2 pr-8 font-mono text-xs text-foreground/80 whitespace-pre-wrap break-all",children:h})]})]}):null,e[18]=h,e[19]=s,e[20]=x):x=e[20];let v;return e[21]!==l||e[22]!==a||e[23]!==p||e[24]!==f||e[25]!==m||e[26]!==x||e[27]!==o?(v=n.jsx(xe,{icon:f,label:l,title:p,defaultExpanded:!0,variant:o,onClose:a,footerRight:m,children:x}),e[21]=l,e[22]=a,e[23]=p,e[24]=f,e[25]=m,e[26]=x,e[27]=o,e[28]=v):v=e[28],v}function Fe(t){const e=D.c(71);let s;e[0]!==t?(s=t===void 0?{}:t,e[0]=t,e[1]=s):s=e[1];const{inline:o,voiceMode:a}=s,i=o===void 0?!1:o,r=a===void 0?!1:a,l=q(),{error:V,clearError:d,finishReason:u,clearFinishReason:c,messages:p,isStreaming:h,submit:f,sendMessage:m}=Ue(),[x,v]=ke(),{virtualMcpId:g,createTaskWithMessage:b}=et(),{chatMode:y,setChatMode:A,simpleModeTier:w}=tt(),j=Ke("credits");let k;e[2]!==y||e[3]!==w||e[4]!==g||e[5]!==r?(k=se=>({...r?{voiceMode:!0}:{},tier:w,mode:y,toolApprovalLevel:se,agent:g?{id:g}:void 0}),e[2]=y,e[3]=w,e[4]=g,e[5]=r,e[6]=k):k=e[6];const C=k;let _;e[7]!==x.toolApprovalLevel?(_=x.toolApprovalLevel??Ds(),e[7]=x.toolApprovalLevel,e[8]=_):_=e[8];const N=_,T=p.at(-1),I=T?.role==="assistant"?T.parts:[],E=I.filter(za),F=I.filter(Mt),O=Xt(I),M=Jt(I);let K;e[9]!==V||e[10]!==m||e[11]!==l?(K=()=>{if(V){const me={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:l("chat.highlight.fixInChatMessage",{error:V.message})}]}]};m(me)}},e[9]=V,e[10]=m,e[11]=l,e[12]=K):K=e[12];const Q=K;let Z;e[13]!==m||e[14]!==l?(Z=()=>{const se={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:l("chat.highlight.pleaseContinue")}]}]};m(se)},e[13]=m,e[14]=l,e[15]=Z):Z=e[15];const U=Z;let Y;e[16]!==C||e[17]!==N||e[18]!==f?(Y=(se,me)=>{f({kind:"toolOutput",toolCallId:se.toolCallId,output:{response:me}},C(N))},e[16]=C,e[17]=N,e[18]=f,e[19]=Y):Y=e[19];const P=Y;let G;e[20]!==C||e[21]!==N||e[22]!==f?(G=(se,me)=>{f({kind:"toolOutput",toolCallId:se.toolCallId,output:{accepted:me}},C(N))},e[20]=C,e[21]=N,e[22]=f,e[23]=G):G=e[23];const ne=G;let H;e[24]!==b||e[25]!==x||e[26]!==A||e[27]!==v||e[28]!==l||e[29]!==g?(H=se=>{A("default"),v({...x,toolApprovalLevel:"auto"}),b({virtualMcpId:g,message:{parts:[{type:"text",text:l("chat.highlight.implementPlanMessage",{plan:se})}]}})},e[24]=b,e[25]=x,e[26]=A,e[27]=v,e[28]=l,e[29]=g,e[30]=H):H=e[30];const re=H,S=Oa;let L;e[31]!==C||e[32]!==f?(L=(se,me,Le,Oe)=>{f({kind:"approval",approvalId:se,approved:me,...Le?{reason:Le}:{}},C(Oe))},e[31]=C,e[32]=f,e[33]=L):L=e[33];const J=L,$=es();if($.isCreditExhausted){let se;return e[34]!==j||e[35]!==d||e[36]!==i?(se=j?n.jsx(Ma,{onDismiss:d}):n.jsx("div",{className:z(!i&&"absolute bottom-full left-0 right-0"),children:n.jsx(kt,{kind:"ai_budget_exhausted",onDismiss:d})}),e[34]=j,e[35]=d,e[36]=i,e[37]=se):se=e[37],se}const{showError:ee,showWarning:ie,hasApprovals:ce}=$,ae=E.map(La).join("|"),pe=Zt(O)?.toolCallId??"",Ve=M.map(Fa).join("|"),Ce=!i&&"absolute bottom-full left-0 right-0";let de;e[38]!==Ce?(de=z(Ce),e[38]=Ce,e[39]=de):de=e[39];let he;e[40]!==$.todos?(he=n.jsx(wa,{todos:$.todos}),e[40]=$.todos,e[41]=he):he=e[41];let le;e[42]!==d||e[43]!==$.planRefusal?(le=$.planRefusal&&n.jsx(kt,{kind:$.planRefusal,onDismiss:d}),e[42]=d,e[43]=$.planRefusal,e[44]=le):le=e[44];let ue;e[45]!==d||e[46]!==V||e[47]!==Q||e[48]!==ee?(ue=ee&&n.jsx(Be,{variant:"error",error:V,onDismiss:d,onFixInChat:Q}),e[45]=d,e[46]=V,e[47]=Q,e[48]=ee,e[49]=ue):ue=e[49];let fe;e[50]!==c||e[51]!==u||e[52]!==U||e[53]!==ie?(fe=ie&&n.jsx(Be,{variant:"warning",finishReason:u,onDismiss:c,onContinue:U}),e[50]=c,e[51]=u,e[52]=U,e[53]=ie,e[54]=fe):fe=e[54];const _e=ce&&n.jsx(aa,{approvals:M,isStreaming:h,onRespond:J},Ve),ve=$.hasPlans&&n.jsx(ra,{plans:O,isStreaming:h,onApprove:re,onDismiss:S},pe),De=$.hasTaskSuggestion&&n.jsx(ya,{parts:F,isStreaming:h,onRespond:ne},F.at(-1)?.toolCallId??"");let ye;e[55]!==$.isWaitingForUserInput||e[56]!==P||e[57]!==h||e[58]!==ae||e[59]!==E?(ye=$.isWaitingForUserInput&&n.jsx(Vs,{userAskParts:E,isStreaming:h,onSubmit:P},ae),e[55]=$.isWaitingForUserInput,e[56]=P,e[57]=h,e[58]=ae,e[59]=E,e[60]=ye):ye=e[60];let je;return e[61]!==de||e[62]!==he||e[63]!==le||e[64]!==ue||e[65]!==fe||e[66]!==_e||e[67]!==ve||e[68]!==De||e[69]!==ye?(je=n.jsxs("div",{className:de,children:[he,le,ue,fe,_e,ve,De,ye]}),e[61]=de,e[62]=he,e[63]=le,e[64]=ue,e[65]=fe,e[66]=_e,e[67]=ve,e[68]=De,e[69]=ye,e[70]=je):je=e[70],je}function Fa(t){return t.approvalId}function La(t){return t.toolCallId}function Oa(){document.querySelector("[data-chat-input]")?.focus()}function za(t){return t.type==="tool-user_ask"}Fe.Error=function(e){return n.jsx(Be,{variant:"error",error:e.error,onDismiss:e.onDismiss,onFixInChat:e.onFixInChat})};Fe.Warning=function(e){return n.jsx(Be,{variant:"warning",finishReason:e.finishReason,onDismiss:e.onDismiss,onContinue:e.onContinue})};Fe.UserAskQuestion=Vs;function ds(t){const e=D.c(8),{taskId:s}=t,o=q(),a=An(s),i=yn(a),r=jn(),{stop:l,removeLocalMessage:V}=Ue();if(i.length===0)return null;const d="mb-2 flex flex-col items-end gap-3 px-2.5";let u;e[0]!==r||e[1]!==V||e[2]!==l||e[3]!==o||e[4]!==s?(u=(h,f)=>n.jsxs("div",{className:"flex max-w-[85%] flex-col items-end",children:[n.jsx("div",{className:"min-w-0 rounded-2xl border border-dashed border-border px-4 py-2.5 text-sm wrap-break-word text-muted-foreground",children:h.text}),n.jsxs("div",{className:"mt-1 flex items-center gap-1 text-sm text-muted-foreground",children:[n.jsx("span",{className:"mr-1 select-none",children:new Date(h.enqueuedAt).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}),f===0&&n.jsxs(W,{type:"button",variant:"ghost",size:"sm",className:"h-6 gap-1 px-1.5 text-xs text-muted-foreground",onClick:()=>{l()},children:[n.jsx(zt,{size:12}),o("chat.queueTray.sendNow")]}),n.jsx(W,{type:"button",variant:"ghost",size:"icon-sm",className:"size-6 text-muted-foreground",title:o("chat.queueTray.removeFromQueue"),"aria-label":o("chat.queueTray.removeFromQueue"),onClick:()=>{r.cancel(s,h.messageId).then(m=>{m&&(wn(s,h.messageId),V(h.messageId))})},children:n.jsx(Ft,{className:"size-3.5"})})]})]},h.messageId),e[0]=r,e[1]=V,e[2]=l,e[3]=o,e[4]=s,e[5]=u):u=e[5];const c=i.map(u);let p;return e[6]!==c?(p=n.jsx("div",{className:d,children:c}),e[6]=c,e[7]=p):p=e[7],p}function us(t){const e=D.c(3),[s]=ke();let o;return e[0]!==s.enableSounds||e[1]!==t?(o=()=>{s.enableSounds&&vo(t.dataUri).catch(i=>{console.warn(`[sound] ${t.name} playback failed:`,i)})},e[0]=s.enableSounds,e[1]=t,e[2]=o):o=e[2],o}const Ba={name:"switch-005",dataUri:"data:audio/mpeg;base64,SUQzBAAAAAAAIlRTU0VAAAAOAAADTGF2ZjYyLjMuMTAwAAAAAAAAAAAAAAD/+1DAAAAAAAAAAAAAAAAAAAAAAABJbmZvAAAADwAAABkAABU4ABMTEx0dHR0nJycnMTExMTs7OztERERETk5OTlhYWFhiYmJibGxsbHZ2dnZ/f39/iYmJiZOTk5OdnZ2dp6enp7GxsbG7u7u7xMTExM7Ozs7Y2NjY4uLi4uzs7Oz29vb2/////wAAAABMYXZjNjIuMTEAAAAAAAAAAAAAAAAkBVYAAAAAAAAVOPCP8KUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//tQxAAACEwDXvQRAAG8Ii93HtACUCAABAKCJwfaCEHwfeoEAQdEAYygIHBOCAIAgCAJh9QIOg+D5/ygPh/wfB8DuKAgCHyn9QPh/5SCDv+CEHAQdxOD4B27c39tbckkqYbBAYAN9bNJLB+aXAf5wQAKdzxfbmrVIRQ4xNx3HwnoDmLhfMhgJiiw/HREXNCHqjvHEPEG8QjBYlxQNepJAT0kC8ip6JzSWj1TasoG+iyycbf2Uil1ovf1f/oUtR1qP+s1WSBFKoAAU02BDjMhuP/7UsQEgws8bRpd8YABJYPeBf9wCGXTGxBYcw5AJFMFMAmQQAhGAxgLBgHIAMYAAALhgAchipbe/91aU1VV4zcZj1Vf1XgYCIMBNrsBAIGs9/Ue4i/xFPeqCqwViI9/UeLf///rOngdA3OPHFjmOBv+EQnGahgaZxVplmkAH5JadDTQlNCEuGNiWYbCCONWdUJg6HXNazFdu1T+VgaEpOP70exv7f2/4b/yH//2/4cqCX/zWRUrIw+IPNMNlDnjAXQas/I4AzmYifA0tMSCgQDF//tSxBCDSzzi3k/sQwEyCtjJ/rBZAk+Uqj1YhA5YMCAAMwgOUchTkK7OR7LbMl0W1H6SvzG0Q2ZzfKUhnmTobv9DNhS1v7P8h//8Gv8gTRt1jReZ7YEjmMQg9hhwwMycHooasFmZyjcZGBKJD+IwbMCQQLoi+IQXCcIoydKoilI2MWFS5uJdDEu2taRrYI2ZSqKY50pJLv2NfjUAAuQAMfqVQ/T3PDQgMJMeEZ45hJzY6MNoFMxqTj1zNGQKJjAxEsSCBgQJBSIL0mcKYQJfVAn/+1LEGwLKlEKrD3MiYcuMkVa/wABB8Vh6M1q1epbvXwWBURhkyEhWZ/////////////9gjZ/Wt4w+4MNMCpE4TBYQl4w1IHvMDdA2zBngBMwc8COMDhCpDAfgOAAgrBgNYU+YC0FBGAkAMpgWoSCYAGESGBGAKBgXgJOdiOJmMCmNwCYNDJhYRPykRCJhTBnEUzlsjv4UNLj/z97n3Mv/7z1nZqyitYAZIqErIwMwJAqEw0GAAMFptJMaqFwB8CQIWlhuhuDAwNjfuwrQFAYXCf/7UsQVAA+9PTP42gYRdiIu9zBwAPbFUCi0DAhgNcS+7cDwVgM05A9bUDeuQMyE/u3CygVISgZhpIau/9PhdQG2C9DpxZZJmn/dn/Psmt0EFm////l84ThUTopE4VD/9JkubOGasTvN30C20G21qgUCkVCoUCgPMywrPCGly27V5q5t24vl/8jSlSAPCxzNseNCw3oh3NGBu4BZJ5hv7DRSfR/+eWG7nA8IKh2Olv5iz3q5m3//Joxo3JqNyYkSuGt/k6D4DeoBOHmHdl0dkZYA//tSxAUAC4B1Z/2DADEcA17Z/uhI4Yoik/TrZo+ww7UtmpW4LDWu2IacoJKJJeTSM+ZmAYBEiU+ZnnAwCn1VVVV6JUJQVnioKhrgqdKgqGpUFeCp0sDR3ztQNREDRUFioKuxKCpYGQBlRIBk+aLwb8KblGQVDdphPYTUdBOGbVpAaTF6ZdjEV0iRUZRCYkA4oUQDx5zqDugtXvza/7fuNNvfZ+j9v+T/2f//J/4cAAOTpE5K4zksR9MfIB+TDcQTI4gNs1XKAzEFUrGkxABYEBb/+1LEEYNKrEjgT/TCwYYVmUX+mHoKgWhKU5Eiw9SFIRmppw+3fYo4siPhUFeexM8KgIO6wVuPDDy01qeRaVbw357//y3+o8M0pBNlNLCGBzGKwyYw2IIFOE1WNTjRM6x8MlA1AxDhUHTAkEiyKpnbWrLcaOBotBUKbk1pypcWDAIK00AhKLGkUco6q9VWvM53mcaq3tVa8zjTM/tX//EDP//////////XAAmrwAAPoKwcw0ShDCZD/BQlhzinxQdorsOuXTEIC01ZkJyu4k/qPP/7UsQUAEjkrrkvZaPBIRXUoe5QObfMhYKX9RVgTPqCSCaSCaSC0XVdV1f/////6IAlguuAJSiDRNloNBsZg+0+Ts8MMCn81WUTRAlIi+GHECD0y8AWDIqswYsxGOSKVV7MqOni8tkVOip0fZX/////9HrMCbAz2EHGS4GKAAiRAAAYAcDdKd4G6Z/nwYgJ0ZAIgZyC8aPAs/iPBhwMpWDQNARltNS5Y61v//9i8Yl4SkFkIGTkAc0UBrIYLPA4MYBEy+YLMRuY4nhTC3hZA68H//tSxCoAyQC6mY6CkWDJBIsBz/QUrgNmahSzcrYw0/HhfnMAZBojDsgTFkDR5MDkG/DZEbk2FCmowqdqv2TYABiJwqqYjaQRGZ1URZ1DhSsdiHX/GBu0QpzIBNSaLqZ0ARkwFARxMrpt/Eh47mbQAhhU6sisFUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+1LESoHHJCRaj/dmYAIAQAAQAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7UsSLg8AAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+1LEoYPAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7UsShg8AAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+1LEoYPAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",duration:.609,format:"mp3",license:"CC0",author:"Kenney"},$a=Bs.togglePlanMode.keys.map(t=>t==="Shift"?"⇧":t).join(""),Ka=[{src:"/connections/gmail.png",name:"Gmail"},{src:"/connections/perplexity.png",name:"Perplexity"},{src:"/connections/github.png",name:"GitHub"}];function Qa(){const t=D.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex items-center -space-x-1.5",children:Ka.map(qa)}),t[0]=e):e=t[0],e}function qa(t){return n.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-1 ring-border object-cover bg-white"},t.name)}function Wa({disabled:t,onOpenConnections:e,virtualMcpId:s,selectedModel:o,isStreaming:a,onUnsupportedFile:i}){const r=q(),[l,V]=R.useState(!1),d=us(Ba),{org:u}=Te(),{editor:c}=Pt(),p=R.useRef(null),h=at(o),f=()=>{!h||a||(V(!1),p.current?.click())},m=async S=>{const L=S.target.files;if(!L||L.length===0||!c)return;const J=Array.from(L);try{let $=c.state.selection.from;for(const ee of J)await Gt(c,o??null,ee,$,i,r),$=c.state.selection.to}finally{p.current&&(p.current.value="")}},x=mo({connectionId:s,orgId:u.id,orgSlug:u.slug}),v=Ps.virtualMcpPrompts(s,u.id),{data:g,isLoading:b}=Es({queryKey:v,queryFn:()=>go(x),staleTime:6e4,enabled:l&&!!x}),y=g?.prompts??[],[A,w]=R.useState(null),{chatMode:j,setChatMode:k}=tt(),[C,_]=ke(),N=Lt()?.lockedHarness!=="claude-code",T=we.find(S=>S.value===C.toolApprovalLevel)??we[0],I=r(T.shortKey),E=S=>{const L=we.find(J=>J.value===S);if(L){if(L.value===C.toolApprovalLevel){V(!1);return}d(),X("chat_approval_level_changed",{from_level:C.toolApprovalLevel,to_level:L.value,source:"tools_popover"}),_({...C,toolApprovalLevel:L.value}),V(!1)}},F=j==="plan",O=()=>{d();const S=F?"default":"plan";X("chat_mode_changed",{from_mode:j,to_mode:S,source:"tools_popover"}),k(S),V(!1)},M=()=>{e(),V(!1)},K=async(S,L)=>{if(!c||!x)return;const J=mt(S._meta),$={from:c.state.selection.from,to:c.state.selection.to};try{const ee=await xo(x,S.name,L);an(c,$,{id:S.name,name:ro(S.name,J),metadata:ee.messages,char:"/",kind:"prompt",args:L})}catch{Ie.error(r("chat.toolsPopover.failedLoadPrompt"))}},Q=async S=>{V(!1);const L=!!(S.arguments&&S.arguments.length>0);if(X("chat_prompt_inserted",{prompt_name:S.name,with_arguments:L}),L){w(S);return}await K(S)},Z=async S=>{A&&(await K(A,S),w(null))},U=()=>{d();const S=j==="gen-image"?"default":"gen-image";X("chat_mode_changed",{from_mode:j,to_mode:S,source:"tools_popover"}),k(S),V(!1)},Y=()=>{d();const S=j==="web-search"?"default":"web-search";X("chat_mode_changed",{from_mode:j,to_mode:S,source:"tools_popover"}),k(S),V(!1)},P=()=>{d();const S=j==="deep-research"?"default":"deep-research";X("chat_mode_changed",{from_mode:j,to_mode:S,source:"tools_popover"}),k(S),V(!1)},G=j==="gen-image",ne=j==="web-search",H=j==="deep-research",re=n.jsx("input",{ref:p,type:"file",multiple:!0,accept:Vo(o??null),className:"hidden",onChange:m,disabled:a});return n.jsxs(n.Fragment,{children:[re,n.jsxs(Rs,{open:l,onOpenChange:S=>{S&&!l&&X("chat_tools_popover_opened",{chat_mode:j}),V(S)},children:[n.jsx(Us,{asChild:!0,children:n.jsxs(W,{type:"button",variant:"ghost",size:"default",disabled:t,title:r("chat.toolsPopover.tools"),"aria-label":r("chat.toolsPopover.tools"),className:z("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[480px]/chat-bottom:gap-1.5"),children:[n.jsx(un,{size:14}),n.jsx("span",{className:z("min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0","@[480px]/chat-bottom:max-w-24 @[480px]/chat-bottom:opacity-100"),children:r("chat.toolsPopover.tools")})]})}),n.jsxs(Fs,{align:"start",className:"w-56 p-1.5 space-y-1",children:[h?n.jsxs(be,{onClick:f,disabled:a,children:[n.jsx(gt,{size:16}),n.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.addFile")})]}):n.jsxs(Yt,{children:[n.jsx(qt,{asChild:!0,children:n.jsxs(be,{"aria-disabled":"true",className:"opacity-50 cursor-not-allowed",onSelect:S=>S.preventDefault(),children:[n.jsx(gt,{size:16}),n.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.addFile")})]})}),n.jsx(Wt,{side:"right",children:r("chat.toolsPopover.modelNoFileSupport")})]}),n.jsxs(be,{onClick:O,className:z(F&&"text-special"),children:[n.jsx(Bt,{size:16,className:z(F&&"text-special")}),n.jsx("span",{className:"flex-1 whitespace-nowrap",children:r("chat.toolsPopover.planMode")}),n.jsx("span",{className:z("text-xs text-muted-foreground",F&&"text-special font-medium"),children:$a})]}),n.jsxs(be,{onClick:U,className:z(G&&"text-special"),children:[n.jsx($t,{size:16,className:z(G&&"text-special")}),n.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.createImage")}),G&&n.jsx("span",{className:"text-xs text-special font-medium",children:r("chat.toolsPopover.on")})]}),n.jsxs(be,{onClick:Y,className:z(ne&&"text-special"),children:[n.jsx(Rt,{size:16,className:z(ne&&"text-special")}),n.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.webSearch")}),ne&&n.jsx("span",{className:"text-xs text-special font-medium",children:r("chat.toolsPopover.on")})]}),n.jsxs(be,{onClick:P,className:z(H&&"text-special"),children:[n.jsx(Ut,{size:16,className:z(H&&"text-special")}),n.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.deepResearch")}),H&&n.jsx("span",{className:"text-xs text-special font-medium",children:r("chat.toolsPopover.on")})]}),n.jsxs(ct,{children:[n.jsxs(dt,{className:"gap-2",children:[n.jsx("span",{className:"flex size-4 items-center justify-center text-base font-medium text-muted-foreground",children:"/"}),n.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.prompts")})]}),n.jsx(ut,{className:"w-80 max-h-72 overflow-y-auto p-1.5",children:b?n.jsxs("div",{className:"flex items-center gap-2 px-2 py-3 text-sm text-muted-foreground",children:[n.jsx(Ls,{className:"size-3.5"}),r("chat.toolsPopover.loadingPrompts")]}):y.length===0?n.jsx("div",{className:"px-2 py-3 text-sm text-muted-foreground",children:r("chat.toolsPopover.noPromptsAvailable")}):y.map(S=>n.jsxs(be,{onClick:()=>Q(S),className:"flex flex-col items-start gap-0.5",children:[n.jsx("span",{className:"font-medium text-sm capitalize",children:S.title||io(S.name,mt(S._meta))}),S.description&&n.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:S.description})]},S.name))})]}),N&&n.jsxs(ct,{children:[n.jsxs(dt,{className:"gap-2",children:[n.jsx($e,{size:16}),n.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.approval")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:I})]}),n.jsx(ut,{className:"w-48 p-1.5",children:n.jsx(Os,{value:C.toolApprovalLevel,onValueChange:E,children:we.map(S=>n.jsx(zs,{value:S.value,children:r(S.labelKey)},S.value))})})]}),n.jsxs(be,{onClick:M,children:[n.jsx(pn,{size:16}),n.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.connections")}),n.jsx(R.Suspense,{children:n.jsx(Qa,{})})]})]})]}),n.jsx(on,{prompt:A,setPrompt:w,onSubmit:Z})]})}const Ya=[{src:"/connections/github.png",name:"GitHub"},{src:"/connections/gmail.png",name:"Gmail"},{src:"/connections/linear.png",name:"Linear"},{src:"/connections/shopify.png",name:"Shopify"},{src:"/connections/firecrawl.png",name:"Firecrawl"},{src:"/connections/perplexity.png",name:"Perplexity"}];function Ga(){const t=D.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex items-center -space-x-1",children:Ya.map(Ha)}),t[0]=e):e=t[0],e}function Ha(t){return n.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-2 ring-muted object-cover bg-white"},t.name)}function Ja(t){const e=D.c(10),{onClick:s}=t,o=q();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=z("group relative z-10 flex items-center gap-3 w-full px-4 py-3","rounded-b-2xl","cursor-pointer"),e[0]=a):a=e[0];let i;e[1]!==o?(i=o("chat.connectionsBanner.description"),e[1]=o,e[2]=i):i=e[2];let r;e[3]!==i?(r=n.jsx("p",{className:"flex-1 text-xs text-muted-foreground truncate text-left",children:i}),e[3]=i,e[4]=r):r=e[4];let l,V;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(Ga,{}),V=n.jsx($s,{size:14,className:"shrink-0 text-muted-foreground/60 group-hover:text-muted-foreground transition-colors"}),e[5]=l,e[6]=V):(l=e[5],V=e[6]);let d;return e[7]!==s||e[8]!==r?(d=n.jsxs("button",{type:"button",onClick:s,className:a,children:[r,l,V]}),e[7]=s,e[8]=r,e[9]=d):d=e[9],d}function Za(t){const e=D.c(4),{data:s}=t;let o;e[0]!==s?(o=s.map(Xa),e[0]=s,e[1]=o):o=e[1];let a;return e[2]!==o?(a=n.jsx("div",{className:"flex items-center justify-center gap-[2px] h-10 overflow-hidden","aria-hidden":"true",children:o}),e[2]=o,e[3]=a):a=e[3],a}function Xa(t,e){return n.jsx("div",{className:"w-[2px] shrink-0 rounded-full bg-chart-2 transition-[height] duration-75 ease-out",style:{height:`${Math.max(4,Math.round(t*40))}px`}},e)}const Pe=12e3,Ct=oe({token:te(),expiresAt:Qs()});qs("provider",[oe({provider:Ae("elevenlabs"),conversationToken:te().min(1)}),oe({provider:Ae("openai"),transport:Ae("webrtc")})]);const ei=Ks([Ct.extend({provider:Ae("elevenlabs").default("elevenlabs"),conversationToken:te().min(1)}),Ct.extend({provider:Ae("openai"),transport:Ae("webrtc")})]);oe({token:te().min(1).max(4096),text:te().trim().min(1).max(Pe)});const ps=oe({request:te().trim().min(1).max(Pe)}),Je=5e3;Tt(oe({role:Re(["user","agent"]),text:te().min(1).max(Je)})).max(60).refine(t=>t.reduce((e,s)=>e+s.text.length,0)<=Je,{message:"Voice transcript is too long"});function pr(t){const e=[];let s=Je;for(const o of t.slice(-60).reverse()){if(s<=0)break;const a=o.text.slice(-s);e.unshift({role:o.role,text:a}),s-=a.length}return e}oe({token:te().min(1).max(4096),sdp:te().min(1).max(1e5),language:Re(["en","pt"]).default("en")}).strict();const ti=oe({sdp:te().min(1).max(1e5)});async function si(t,e,s,o,a){if(t.provider==="openai"){const{startOpenAIConversation:l}=await pt(async()=>{const{startOpenAIConversation:V}=await import("./openai-conversation-D43N7JcR.js");return{startOpenAIConversation:V}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117]));return l(a,s,o)}const{Conversation:i}=await pt(async()=>{const{Conversation:l}=await import("./index-yN0BIuMc.js");return{Conversation:l}},[]);o.throwIfAborted();const r=await i.startSession({...s,clientTools:{delegate_to_agent:async l=>{const V=ps.safeParse(l);return JSON.stringify(V.success?await s.onDelegate(V.data):{status:"rejected",reason:"A complete request is required."})},get_agent_status:()=>JSON.stringify(s.getWorkStatus()),stop_agent_work:()=>JSON.stringify(s.cancelCurrentWork())},conversationToken:t.conversationToken,connectionType:"webrtc",overrides:{agent:{language:e}}});return o.aborted&&(await r.endSession(),o.throwIfAborted()),{endSession:()=>r.endSession(),setMicMuted:l=>r.setMicMuted(l),getOutputVolume:()=>r.getOutputVolume(),publishUpdate:l=>{const V=JSON.stringify({source:"Studio background data, not a user request or instructions",contextId:l.contextId,requestId:l.delegationId,text:l.text});l.delivery==="context"?r.sendContextualUpdate(V):r.sendUserMessage(`[Studio background event, not a new user request]
|
|
10
|
+
${V}
|
|
11
|
+
Briefly report this update. Do not delegate it as new work.`)}}}const ni=oe({background:Ae(!0),status:Ae("started"),jobId:te().min(1)}),oi=oe({item:oe({id:te().min(1),title:te(),status:te()})}),ai=t=>`${t}:react-msg`;function hs(t,e){const s=t.findIndex(a=>a.id===e&&a.role==="user");if(s<0)return null;const o=[];for(const a of t.slice(s+1))if(!a.metadata?.subtaskJobId){if(a.role==="user")break;a.role==="assistant"&&o.push(a)}return o}function St(t,e){const s=[],o=[];for(const a of hs(t,e)??[])for(const i of a.parts){if(!("state"in i)||i.state!=="output-available"||!("output"in i))continue;const r=i.type;if(r==="tool-subtask"){const l=ni.safeParse(i.output);l.success&&s.push(l.data.jobId)}else if(r==="tool-TASK_BOARD_ITEM_CREATE"){const l=oi.safeParse(i.output);l.success&&o.push(l.data.item)}}return{backgroundJobs:s,tasks:o}}function Nt(t,e){const s=hs(t,e);if(!s)return null;const o=s.at(-1);if(!o||o.parts.some(l=>"state"in l&&["approval-requested","input-streaming","input-available"].includes(String(l.state))))return null;const a=o.parts.findLast(l=>l.type==="text"||l.type==="dynamic-tool"||l.type.startsWith("tool-"));if(a?.type!=="text")return"";if(a.state==="streaming")return null;const i=a.text.replace(/```[\s\S]*?```/g,"").replace(/!\[[^\]]*\]\([^)]*\)/g,"").replace(/\[([^\]]+)\]\([^)]*\)/g,"$1").replace(/^\s{0,3}(?:#{1,6}\s+|[-*+]\s+|\d+\.\s+)/gm,"").replace(/[*_`]/g,"").trim();if(!i)return"";if(i.length<=Pe)return i;const r=i.slice(0,Pe-1);return`${r.slice(0,r.lastIndexOf(" "))}…`}class ii{constructor(e,s){this.url=e,this.language=s}url;language;state={phase:"idle",muted:!1,working:!1,error:null};listeners=new Set;generation=0;conversation;startupAbort;userSpeaking=!1;token;timer;expires;bindings;jobs=new Map;announcements=[];lastActivity=0;approvalReported=!1;cleanup=Promise.resolve();dispatchQueue=Promise.resolve();lastContext="";lastWorkStatus="";utterance=0;seenUserEvents=new Set;tasks=new Map;boardUpdates=new Map;subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;outputVolume=()=>this.conversation?.getOutputVolume()??0;patch(e){if(!Object.entries(e).every(([s,o])=>this.state[s]===o)){this.state={...this.state,...e};for(const s of this.listeners)s()}}updateBindings(e,s){if(this.bindings=e,!s&&this.state.phase!=="idle"){this.stop();return}this.conversation&&(this.updateContext(),this.collectResults())}requestStatus(e){return e.result!==void 0?"finished":e.accepted?e.background?"running_in_background":this.bindings?.messages.some(s=>s.id===e.messageId)?"running":"queued":"submitting"}status(){const e=this.bindings;return{status:e?.isWaitingForApprovals?"approval_required":e?.error||e?.status==="error"?"failed":e?.isStreaming||e?.isRunInProgress?"working":"idle",requests:[...this.jobs.values()].slice(-6).map(s=>({id:s.messageId,request:s.request.slice(0,200),status:this.requestStatus(s),result:s.result?.slice(0,500)})),tasks:[...this.tasks.values()].slice(-10).map(s=>({title:s.title.slice(0,120),status:s.status}))}}updateContext(){const e=this.bindings?.voiceContext??"";e!==this.lastContext&&(this.lastContext=e,this.conversation?.publishUpdate({text:`Current Studio view, supplied as context only:
|
|
12
|
+
${e.slice(0,12e3)}`,delivery:"context",contextId:"studio-view"}))}collectResults(){const e=this.bindings;if(!e||!this.conversation)return;const s=e.isStreaming||e.isRunInProgress;if(this.patch({working:s||[...this.jobs.values()].some(o=>o.accepted&&o.result===void 0)}),this.publishWorkStatus(),e.isWaitingForApprovals){this.approvalReported||(this.approvalReported=!0,this.report("The Studio agent needs the user's approval. The approval controls are visible in this chat. Ask the user to review them; do not approve on their behalf."));return}this.approvalReported=!1;for(const o of this.jobs.values()){if(!o.accepted||o.result!==void 0)continue;if(o.background){this.collectBackground(o,s);continue}const a=e.messages.findIndex(l=>l.id===o.messageId);if(a<0)continue;const i=a>=0&&e.messages.slice(a+1).some(l=>l.role==="user");if(s&&!i)continue;let r;if(!s&&!i&&(e.error||e.status==="error"))r="The agent's run failed. Ask the user to return to the chat for the error details; do not claim completion.";else if(!s&&!i&&e.finishReason&&["error","length","content-filter","aborted"].includes(e.finishReason))r=`The run ended with status ${e.finishReason}; successful completion is not established.`;else{const l=Nt(e.messages,o.messageId);if(l===null)continue;r=l;const V=St(e.messages,o.messageId);if(this.track(V.tasks),V.backgroundJobs.length){o.background=V.backgroundJobs,this.collectBackground(o,s);continue}}this.finish(o,r||"The agent finished without a final text response. Do not infer that the requested change succeeded.")}this.patch({working:s||[...this.jobs.values()].some(o=>o.accepted&&o.result===void 0)}),this.publishWorkStatus()}collectBackground(e,s){const o=this.bindings?.messages??[],a=[];for(const i of e.background??[]){const r=ai(i),l=o.findIndex(u=>u.id===r);if(l<0)return;const V=o.slice(l+1).some(u=>u.role==="user");if(s&&!V)return;const d=Nt(o,r);if(d===null)return;this.track(St(o,r).tasks),a.push(d)}this.finish(e,a.filter(Boolean).join(`
|
|
13
|
+
`)||"The background work finished without a final text response. Do not infer that the requested change succeeded.")}finish(e,s){e.result=s,this.report(JSON.stringify({requestId:e.messageId,request:e.delegationId?void 0:e.request,result:s}),e.delegationId)}track(e){for(const s of e)this.tasks.has(s.id)||this.tasks.set(s.id,this.boardUpdates.get(s.id)??s)}publishWorkStatus(){const e=JSON.stringify(this.status());e!==this.lastWorkStatus&&(this.lastWorkStatus=e,this.conversation?.publishUpdate({delivery:"context",contextId:"studio-work",text:e}))}taskUpdated=e=>{const s={id:e.id,title:e.title,status:e.status};this.boardUpdates.delete(e.id),this.boardUpdates.set(e.id,s);for(const a of this.boardUpdates.keys()){if(this.boardUpdates.size<=200)break;this.boardUpdates.delete(a)}const o=this.tasks.get(e.id);!o||!this.conversation||o.status===e.status||(this.tasks.set(e.id,s),this.report(JSON.stringify({task:e.title,status:e.status})),this.publishWorkStatus())};taskDeleted=e=>{const s=this.tasks.get(e);!s||!this.conversation||(this.tasks.delete(e),this.report(JSON.stringify({task:s.title,status:"deleted"})),this.publishWorkStatus())};report(e,s){const o={text:e,delegationId:s,delivery:"context"};this.conversation?.publishUpdate(o),this.announcements.push({...o,delivery:"announce"})}flushAnnouncements(){if(!(!this.conversation||!this.announcements.length||this.userSpeaking||this.state.phase!=="listening"||Date.now()-this.lastActivity<1800)){this.lastActivity=Date.now();for(const e of this.announcements.splice(0))this.conversation.publishUpdate(e)}}delegate=async e=>{if(this.utterance===0&&!e.delegationId)return{status:"rejected",reason:"Wait for a spoken user request before delegating work."};const s=ps.safeParse(e);if(!s.success)return{status:"rejected",reason:"A complete, non-empty request is required."};if(this.jobs.size>=40)return{status:"rejected",reason:"This voice session has reached its request limit. Continue in the text chat."};const o=s.data.request,a=[...this.jobs.values()].find(V=>e.delegationId?V.delegationId===e.delegationId:V.utterance===this.utterance||V.request===o&&V.result===void 0);if(a)return{status:a.result!==void 0?"finished":a.accepted?"accepted":"submitting",requestId:a.messageId,result:a.result?.slice(0,2e3),note:"This utterance already has a work request; do not submit it again."};const i=this.generation,r={messageId:crypto.randomUUID(),utterance:this.utterance,request:o,accepted:!1,delegationId:e.delegationId};this.jobs.set(r.messageId,r);const l=this.dispatchQueue.then(async()=>i!==this.generation||!this.conversation?!1:this.bindings?.sendVoiceMessage?.(r.messageId,o,e.transcript)??!1);this.dispatchQueue=l.catch(()=>{});try{const V=await l;return i!==this.generation?{status:"disconnected"}:V?(r.accepted=!0,this.collectResults(),{status:"accepted",requestId:r.messageId,note:"Work is running or queued in Studio. Keep conversing. A background event will supply its actual result."}):(this.jobs.delete(r.messageId),{status:"rejected",reason:"Studio did not accept the request. No work has been confirmed."})}catch{return this.jobs.delete(r.messageId),{status:"rejected",reason:"Studio could not accept the request. Do not claim it started."}}};async start(){if(this.state.phase!=="idle"&&this.state.phase!=="error")return;this.stop();const e=++this.generation,s=new AbortController;this.startupAbort=s;const o=()=>e===this.generation;this.patch({phase:"connecting",error:null,muted:!1});try{if(await this.cleanup,!o())return;const a=fetch(this.url,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:"conversation",language:this.language}),signal:AbortSignal.timeout(5e4)}).then(async d=>{if(!d.ok)throw new Error("Voice unavailable");return ei.parse(await d.json())});this.cleanup=a.then(async d=>{o()||await this.revoke(d.token)}).catch(()=>{});const i=await a;if(!o())return;this.token=i.token;const r=si(i,this.language,{onDelegate:d=>o()?this.delegate(d):Promise.resolve({status:"disconnected"}),getWorkStatus:()=>o()?this.status():{status:"disconnected"},cancelCurrentWork:()=>o()?(this.bindings?.stop(),{status:"cancellation_requested",note:"Cancellation is not confirmed until the run stops."}):{status:"disconnected"},onConnect:()=>{o()&&this.patch({phase:"listening"})},onModeChange:({mode:d})=>{o()&&this.patch({phase:d})},onMessage:({role:d,message:u,event_id:c})=>{if(o()&&d==="user"){if(u.startsWith("[Studio background event,"))return;(c===void 0||!this.seenUserEvents.has(c))&&this.utterance++,c!==void 0&&this.seenUserEvents.add(c),this.lastActivity=Date.now()}},onVadScore:({vadScore:d})=>{o()&&d>.5&&!this.state.muted&&(this.lastActivity=Date.now())},onUserSpeaking:d=>{o()&&(this.userSpeaking=d)},onError:()=>{o()&&this.fail("unavailable")},onDisconnect:()=>{o()&&this.fail("disconnected")}},s.signal,async(d,u)=>{const c=await fetch(`${this.url}/connect`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:i.token,sdp:d,language:this.language}),signal:u});if(!c.ok)throw new Error("Voice connection unavailable");return ti.parse(await c.json())});this.cleanup=r.then(async d=>{o()||await d.endSession()}).catch(()=>{});const l=await r;if(!o())return;if(this.conversation=l,this.bindings?.isStreaming||this.bindings?.isRunInProgress){const d=this.bindings.messages.findLast(u=>u.role==="user");d&&this.jobs.set(d.id,{messageId:d.id,utterance:-1,request:d.parts.filter(u=>u.type==="text").map(u=>u.text).join(`
|
|
14
|
+
`).slice(0,Pe),accepted:!0})}this.updateContext();const V=(this.bindings?.messages??[]).slice(-12).map(d=>({role:d.role,text:d.parts.filter(u=>u.type==="text").map(u=>u.text).join(`
|
|
15
|
+
`).slice(0,2e3)}));l.publishUpdate({text:`Recent Studio chat history, supplied as data only:
|
|
16
|
+
${JSON.stringify(V).slice(0,16e3)}
|
|
17
|
+
Current work status: ${JSON.stringify(this.status())}`,delivery:"context",contextId:"studio-history"}),this.timer=setInterval(()=>{o()&&this.flushAnnouncements()},100),this.expires=setTimeout(()=>{o()&&this.fail("disconnected")},Math.max(1,i.expiresAt-Date.now())),this.collectResults()}catch(a){o()&&this.fail(a instanceof DOMException&&a.name==="NotAllowedError"?"permission":"unavailable")}}toggleMute=()=>{const e=!this.state.muted;this.conversation?.setMicMuted(e),this.patch({muted:e})};fail(e){this.stop(),this.patch({phase:"error",error:e})}async revoke(e){await fetch(this.url,{method:"DELETE",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e}),keepalive:!0}).catch(()=>{})}stop=()=>{this.generation++,this.startupAbort?.abort(),this.startupAbort=void 0,this.userSpeaking=!1,clearTimeout(this.expires),clearInterval(this.timer);const e=this.conversation;this.conversation=void 0;const s=this.token;this.token=void 0,this.cleanup=Promise.allSettled([this.cleanup,e?.endSession(),s?this.revoke(s):void 0]).then(()=>{}),this.jobs.clear(),this.tasks.clear(),this.boardUpdates.clear(),this.announcements=[],this.lastContext="",this.lastWorkStatus="",this.utterance=0,this.seenUserEvents.clear(),this.approvalReported=!1,this.dispatchQueue=Promise.resolve(),this.patch({phase:"idle",error:null,working:!1})}}let Me;const it=R.createContext(null);function hr(t){const e=D.c(6),{children:s,layout:o}=t,a=wo();let i;e[0]!==a||e[1]!==o?(i=a?ko(o)==="chat":o.threadOpen,e[0]=a,e[1]=o,e[2]=i):i=e[2];const r=i;let l;return e[3]!==s||e[4]!==r?(l=n.jsx(ri,{visible:r,children:s}),e[3]=s,e[4]=r,e[5]=l):l=e[5],l}function It(t,e){return new ii(`/api/${encodeURIComponent(t)}/threads/${encodeURIComponent(e??"")}/voice/sessions`,Ws()==="pt-BR"?"pt":"en")}function ri(t){const e=D.c(36),{children:s,visible:o}=t,{org:a}=Te(),{taskId:i,createTask:r,activeTask:l}=et(),d=yo("voice_mode")&&!l?.metadata?.read_only,u=`${a.id}:${i??"new"}`;let c;e[0]!==a.slug||e[1]!==u||e[2]!==i?(c=()=>({key:u,session:It(a.slug,i)}),e[0]=a.slug,e[1]=u,e[2]=i,e[3]=c):c=e[3];const[p,h]=R.useState(c);p.key!==u&&h({key:u,session:It(a.slug,i)});const{session:f}=p;let m,x;e[4]!==d||e[5]!==f||e[6]!==o?(m=()=>{(!d||!o)&&f.stop()},x=[f,d,o],e[4]=d,e[5]=f,e[6]=o,e[7]=m,e[8]=x):(m=e[7],x=e[8]),R.useLayoutEffect(m,x);let v;e[9]!==f?(v=()=>f.getSnapshot().phase!=="idle",e[9]=f,e[10]=v):v=e[10];const g=R.useSyncExternalStore(f.subscribe,v);let b;e[11]!==g||e[12]!==a.slug||e[13]!==f.taskDeleted||e[14]!==f.taskUpdated?(b={orgSlug:a.slug,enabled:g,onUpdate:f.taskUpdated,onDelete:f.taskDeleted},e[11]=g,e[12]=a.slug,e[13]=f.taskDeleted,e[14]=f.taskUpdated,e[15]=b):b=e[15],jo(b);let y;e[16]!==r||e[17]!==d||e[18]!==a.id||e[19]!==f||e[20]!==i?(y=()=>{if(d){if(!i){const C=r();Me={orgId:a.id,threadId:C,expires:Date.now()+3e4};return}f.start()}},e[16]=r,e[17]=d,e[18]=a.id,e[19]=f,e[20]=i,e[21]=y):y=e[21];const A=y;let w;e[22]!==d||e[23]!==f||e[24]!==A?(w={session:f,enabled:d,start:A},e[22]=d,e[23]=f,e[24]=A,e[25]=w):w=e[25];let j;e[26]!==p.key||e[27]!==d||e[28]!==a.id||e[29]!==f||e[30]!==i?(j=n.jsx(li,{session:f,enabled:d,orgId:a.id,taskId:i},p.key),e[26]=p.key,e[27]=d,e[28]=a.id,e[29]=f,e[30]=i,e[31]=j):j=e[31];let k;return e[32]!==s||e[33]!==w||e[34]!==j?(k=n.jsxs(it,{value:w,children:[j,s]}),e[32]=s,e[33]=w,e[34]=j,e[35]=k):k=e[35],k}function li(t){const e=D.c(6),{session:s,enabled:o,orgId:a,taskId:i}=t;let r;e[0]!==o||e[1]!==a||e[2]!==s||e[3]!==i?(r=()=>d=>{if(o&&i&&Me?.orgId===a&&Me.threadId===i){const c=Me.expires>Date.now();Me=void 0,c&&s.start()}const u=()=>s.stop();return window.addEventListener("pagehide",u),()=>{window.removeEventListener("pagehide",u),s.stop()}},e[0]=o,e[1]=a,e[2]=s,e[3]=i,e[4]=r):r=e[4];const[l]=R.useState(r);let V;return e[5]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsx("div",{className:"contents",ref:l}),e[5]=V):V=e[5],V}function fr(t){const e=D.c(4),{children:s}=t,o=R.useContext(it),a=Ue();let i,r;return e[0]!==o||e[1]!==a?(i=()=>{o?.session.updateBindings(a,o.enabled)},r=[o,a],e[0]=o,e[1]=a,e[2]=i,e[3]=r):(i=e[2],r=e[3]),R.useLayoutEffect(i,r),s}function fs(){const t=D.c(4),e=R.useContext(it),s=R.useSyncExternalStore(e?.session.subscribe??Vi,e?.session.getSnapshot??ci),o=s?.phase!==void 0&&s.phase!=="idle";let a;return t[0]!==e||t[1]!==s||t[2]!==o?(a={active:o,context:e,snapshot:s},t[0]=e,t[1]=s,t[2]=o,t[3]=a):a=t[3],a}const Vi=()=>()=>{},ci=()=>null;function di(){const t=D.c(9),e=q(),{context:s}=fs();if(!s?.enabled||!navigator.mediaDevices?.getUserMedia)return null;const o=s.start;let a;t[0]!==e?(a=e("chat.voice.start"),t[0]=e,t[1]=a):a=t[1];let i;t[2]!==e?(i=e("chat.voice.start"),t[2]=e,t[3]=i):i=t[3];let r;t[4]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(Co,{size:18}),t[4]=r):r=t[4];let l;return t[5]!==s.start||t[6]!==a||t[7]!==i?(l=n.jsx(W,{type:"button",variant:"ghost",size:"icon",className:"size-8 shrink-0",onClick:o,"aria-label":a,title:i,children:r}),t[5]=s.start,t[6]=a,t[7]=i,t[8]=l):l=t[8],l}function ui({session:t,phase:e,muted:s}){const[o]=R.useState(()=>a=>{if(!a||matchMedia("(prefers-reduced-motion: reduce)").matches)return;let i=0,r=requestAnimationFrame(function l(){const V=Math.min(1,t.outputVolume());i+=(V-i)*(V>i?.55:.12),a.style.setProperty("--voice-level",i.toFixed(3)),r=requestAnimationFrame(l)});return()=>cancelAnimationFrame(r)});return n.jsx("div",{ref:o,className:"studio-voice-orb","data-phase":e,"data-muted":s,"aria-hidden":"true"})}function mr(){const t=D.c(65),e=q(),{taskId:s}=et(),o=Ue(),{context:a,snapshot:i,active:r}=fs();if(!r||!a||!i)return null;const{session:l}=a;let V;t[0]!==i.error||t[1]!==i.muted||t[2]!==i.phase||t[3]!==e?(V=i.error?e(`chat.voice.${i.error}`):i.muted?e("chat.voice.muted"):e(`chat.voice.${i.phase}`),t[0]=i.error,t[1]=i.muted,t[2]=i.phase,t[3]=e,t[4]=V):V=t[4];const d=V;let u;t[5]!==e?(u=e("chat.voice.title"),t[5]=e,t[6]=u):u=t[6];let c;t[7]!==l||t[8]!==i.muted||t[9]!==i.phase?(c=n.jsx(ui,{session:l,phase:i.phase,muted:i.muted}),t[7]=l,t[8]=i.muted,t[9]=i.phase,t[10]=c):c=t[10];let p;t[11]!==d?(p=n.jsx("p",{role:"status",className:"max-w-sm text-center text-sm text-muted-foreground",children:d}),t[11]=d,t[12]=p):p=t[12];let h;t[13]!==i.working||t[14]!==e?(h=i.working&&n.jsx("p",{className:"text-center text-xs text-muted-foreground",children:e("chat.voice.backgroundWork")}),t[13]=i.working,t[14]=e,t[15]=h):h=t[15];let f;t[16]!==a.start||t[17]!==i.phase||t[18]!==e?(f=i.phase==="error"&&n.jsx(W,{variant:"outline",onClick:a.start,children:e("chat.voice.retry")}),t[16]=a.start,t[17]=i.phase,t[18]=e,t[19]=f):f=t[19];let m;t[20]!==c||t[21]!==p||t[22]!==h||t[23]!==f?(m=n.jsxs("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-7 overflow-y-auto px-6 py-8",children:[c,p,h,f]}),t[20]=c,t[21]=p,t[22]=h,t[23]=f,t[24]=m):m=t[24];let x;t[25]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(Fe,{inline:!0,voiceMode:!0}),t[25]=x):x=t[25];let v;t[26]!==s?(v=s&&n.jsx(ds,{taskId:s}),t[26]=s,t[27]=v):v=t[27];let g;t[28]!==v?(g=n.jsxs("div",{className:"max-h-[55%] shrink-0 overflow-y-auto px-3",children:[x,v]}),t[28]=v,t[29]=g):g=t[29];const b=i.phase==="connecting"||i.phase==="error",y=i.muted?"chat.voice.unmute":"chat.voice.mute";let A;t[30]!==e||t[31]!==y?(A=e(y),t[30]=e,t[31]=y,t[32]=A):A=t[32];const w=i.muted?"chat.voice.unmute":"chat.voice.mute";let j;t[33]!==e||t[34]!==w?(j=e(w),t[33]=e,t[34]=w,t[35]=j):j=t[35];let k;t[36]!==i.muted?(k=i.muted?n.jsx(No,{size:18}):n.jsx(Io,{size:18}),t[36]=i.muted,t[37]=k):k=t[37];let C;t[38]!==l.toggleMute||t[39]!==i.muted||t[40]!==b||t[41]!==A||t[42]!==j||t[43]!==k?(C=n.jsx(W,{variant:"outline",size:"icon",disabled:b,"aria-label":A,title:j,"aria-pressed":i.muted,onClick:l.toggleMute,children:k}),t[38]=l.toggleMute,t[39]=i.muted,t[40]=b,t[41]=A,t[42]=j,t[43]=k,t[44]=C):C=t[44];const _=l.stop;let N;t[45]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(So,{size:16}),t[45]=N):N=t[45];let T;t[46]!==e?(T=e("chat.voice.backToChat"),t[46]=e,t[47]=T):T=t[47];let I;t[48]!==l.stop||t[49]!==T?(I=n.jsxs(W,{variant:"outline",onClick:_,children:[N,T]}),t[48]=l.stop,t[49]=T,t[50]=I):I=t[50];let E;t[51]!==o.isRunInProgress||t[52]!==o.isStreaming||t[53]!==o.stop||t[54]!==e?(E=(o.isStreaming||o.isRunInProgress)&&n.jsx(W,{variant:"outline",size:"icon","aria-label":e("chat.voice.stopWork"),title:e("chat.voice.stopWork"),onClick:o.stop,children:n.jsx(To,{size:16})}),t[51]=o.isRunInProgress,t[52]=o.isStreaming,t[53]=o.stop,t[54]=e,t[55]=E):E=t[55];let F;t[56]!==C||t[57]!==I||t[58]!==E?(F=n.jsxs("div",{className:"flex shrink-0 items-center justify-center gap-3 px-4 py-6",children:[C,I,E]}),t[56]=C,t[57]=I,t[58]=E,t[59]=F):F=t[59];let O;return t[60]!==u||t[61]!==F||t[62]!==m||t[63]!==g?(O=n.jsxs("section",{"aria-label":u,className:"absolute inset-0 flex min-h-0 flex-col bg-background",children:[m,g,F]}),t[60]=u,t[61]=F,t[62]=m,t[63]=g,t[64]=O):O=t[64],O}function pi(t){return t.hasDraft?"send":t.isStreaming||t.isRunInProgress?"stop":"disabled"}function We(t){const e=D.c(7),{message:s,icon:o}=t;let a;e[0]!==o?(a=o??n.jsx(Dt,{size:14,className:"shrink-0"}),e[0]=o,e[1]=a):a=e[1];const i=s??"";let r;e[2]!==i?(r=n.jsx("span",{className:"text-sm",children:i}),e[2]=i,e[3]=r):r=e[3];let l;return e[4]!==a||e[5]!==r?(l=n.jsxs("div",{className:"flex w-full items-center gap-2 px-3 py-2.5 rounded-xl border border-border bg-muted/40 text-muted-foreground",children:[a,r]}),e[4]=a,e[5]=r,e[6]=l):l=e[6],l}function hi(t,e,s){const o=D.c(7),{editor:a}=Pt(),i=q(),[r,l]=R.useState(!1),V=R.useRef(0);let d,u;return o[0]!==s||o[1]!==a||o[2]!==e||o[3]!==t||o[4]!==i?(d=()=>{const c=m=>{m.dataTransfer?.types.includes("Files")&&(m.preventDefault(),V.current=V.current+1,l(!0))},p=m=>{m.preventDefault(),V.current=Math.max(0,V.current-1),V.current===0&&l(!1)},h=fi,f=m=>{if(V.current=0,l(!1),m.defaultPrevented||(m.preventDefault(),s||!a||!t||!at(t)))return;const x=m.dataTransfer?.files;if(!x||x.length===0)return;const v=Array.from(x);(async()=>{let g=a.state.selection.from;for(const b of v)await Gt(a,t,b,g,e,i),g=a.state.selection.to})()};return window.addEventListener("dragenter",c),window.addEventListener("dragleave",p),window.addEventListener("dragover",h),window.addEventListener("drop",f),()=>{window.removeEventListener("dragenter",c),window.removeEventListener("dragleave",p),window.removeEventListener("dragover",h),window.removeEventListener("drop",f)}},u=[a,t,e,i,s],o[0]=s,o[1]=a,o[2]=e,o[3]=t,o[4]=i,o[5]=d,o[6]=u):(d=o[5],u=o[6]),R.useEffect(d,u),r}function fi(t){t.dataTransfer?.types.includes("Files")&&t.preventDefault()}function mi(t){const e=D.c(14),{selectedModel:s}=t,o=q();let a,i,r;if(e[0]!==s||e[1]!==o){const{parts:d}=co(s);e[5]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(Qn,{size:24}),e[5]=r):r=e[5],a="text-sm font-medium";let u;e[6]!==o?(u=c=>o(c),e[6]=o,e[7]=u):u=e[7],i=o("chat.input.dropFilesHere",{fileTypes:d.map(u).join(", ")}),e[0]=s,e[1]=o,e[2]=a,e[3]=i,e[4]=r}else a=e[2],i=e[3],r=e[4];let l;e[8]!==a||e[9]!==i?(l=n.jsx("span",{className:a,children:i}),e[8]=a,e[9]=i,e[10]=l):l=e[10];let V;return e[11]!==r||e[12]!==l?(V=n.jsxs(n.Fragment,{children:[r,l]}),e[11]=r,e[12]=l,e[13]=V):V=e[13],V}function gi(){const t=D.c(5),e=q();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(Dt,{size:24}),t[0]=s):s=t[0];let o;t[1]!==e?(o=e("chat.input.modelCannotReadAttachments"),t[1]=e,t[2]=o):o=t[2];let a;return t[3]!==o?(a=n.jsxs(n.Fragment,{children:[s,n.jsx("span",{className:"text-sm font-medium",children:o})]}),t[3]=o,t[4]=a):a=t[4],a}function xi(t){const e=D.c(11),{selectedModel:s,onUnsupportedFile:o,disabled:a}=t,i=hi(s,o,a);let r;e[0]!==s?(r=at(s),e[0]=s,e[1]=r):r=e[1];const l=r,V=i?"opacity-100":"opacity-0 pointer-events-none",d=l?"border-primary/40 text-primary/70":"border-destructive/30 text-destructive/70";let u;e[2]!==V||e[3]!==d?(u=z("absolute inset-0 z-20 rounded-xl flex flex-col items-center justify-center gap-2 bg-muted border-2 border-dashed transition-opacity",V,d),e[2]=V,e[3]=d,e[4]=u):u=e[4];let c;e[5]!==s||e[6]!==l?(c=l?n.jsx(mi,{selectedModel:s}):n.jsx(gi,{}),e[5]=s,e[6]=l,e[7]=c):c=e[7];let p;return e[8]!==u||e[9]!==c?(p=n.jsx("div",{className:u,children:c}),e[8]=u,e[9]=c,e[10]=p):p=e[10],p}function ze(t){const e=D.c(14),{onClick:s,label:o,icon:a,colorClass:i,maxWidthClass:r}=t;let l;e[0]!==i?(l=z("flex items-center gap-1.5 h-8 rounded-lg px-2.5 text-sm font-medium group min-w-0 shrink animate-in fade-in duration-200",i),e[0]=i,e[1]=l):l=e[1];let V;e[2]!==r?(V=z("min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0 @[480px]/chat-bottom:opacity-100",r),e[2]=r,e[3]=V):V=e[3];let d;e[4]!==o||e[5]!==V?(d=n.jsx("span",{className:V,children:o}),e[4]=o,e[5]=V,e[6]=d):d=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Ze,{size:14,className:"shrink-0 hidden group-hover:block group-disabled:hidden"}),e[7]=u):u=e[7];let c;return e[8]!==a||e[9]!==o||e[10]!==s||e[11]!==l||e[12]!==d?(c=n.jsxs("button",{type:"button",onClick:s,title:o,"aria-label":o,className:l,children:[a,d,u]}),e[8]=a,e[9]=o,e[10]=s,e[11]=l,e[12]=d,e[13]=c):c=e[13],c}function vi(){const t=Xe(),{org:e,locator:s}=Te(),{create:o}=Pn();return async({tiptapDoc:a,virtualMcp:i,taskIntake:r=!1})=>{const l=crypto.randomUUID(),V=i?.id??Ye(e.id).id,d=r?void 0:"sandbox";Tn(sessionStorage,s,l,{tiptapDoc:r&&a?Ko(a):a}),En(sessionStorage,s,l,{runtime:d});try{await o({id:l,virtual_mcp_id:V,...d?{runtime:d}:{}}),Rn(sessionStorage,s,l)}catch{}const u=qo(r);Xs(t,en({org:e.slug,agentId:V,superAgentId:Ye(e.id).id}),{search:()=>({...u,thread:l}),replace:!1})}}function gr({onOpenContextPanel:t,showConnectionsBanner:e=!1,homeTaskComposer:s=!1,taskHint:o=!0}){const a=q(),i=kn(),r=Lt(),l=i?.messages??[],V=i?.isStreaming??!1,d=i?.isRunInProgress??!1,u=i?.stop??(()=>{}),c=r?.taskId??"",p=c||On,h=vi(),{selectedModel:f,selectedVirtualMcp:m,isModelsLoading:x,tiptapDocRef:v,imageModel:g,webSearchModel:b,deepResearchModel:y,chatMode:A,setChatMode:w}=tt(),{data:j}=Ys.useSession(),k=j?.user?.id,{org:C,locator:_}=Te(),[N,T]=Gs(Hs.homeTaskMode(_),!0),I=s&&N,E=Ye(C.id).id,F=Nn(m?.id),O=zn(F?.id).runtime==="cms",M=us(bo),[K,Q]=R.useState(!1),{unsupportedFile:Z,onUnsupportedFile:U,clearUnsupportedFile:Y}=uo(),P=Bn(),G=R.useRef(void 0),ne=async()=>{G.current=ae;const B=await P.startRecording();X("chat_voice_started",{thread_id:c,outcome:B==="recording"?"started":B==="unsupported"?"unsupported":B==="permission-denied"?"permission_denied":"unknown"})},H=()=>{X("chat_voice_confirmed",{thread_id:c});const B=P.stopRecording();le.current?.syncVoiceText(G.current,B),le.current?.focus()},re=()=>{X("chat_voice_cancelled",{thread_id:c}),P.cancelRecording(),le.current?.restoreContent(G.current)};R.useEffect(()=>{if(P.status!=="recording")return;const B=(P.transcript+(P.interimTranscript?" "+P.interimTranscript:"")).trim();le.current?.syncVoiceText(G.current,B)},[P.transcript,P.interimTranscript,P.status]);const S=r?.activeTask??null,L=S?.created_by,J=!!(k&&L&&L!==k),{data:$}=Js({enabled:J}),ee=($?.data?.members??[]).find(B=>B.userId===L),ie=ee?.user?.name??ee?.user?.email?.split("@")[0]??null,ce=Cn(S?.harness_id),[ae,pe]=R.useState(()=>ht(sessionStorage,_,p)??void 0),Ve=B=>{pe(B),v.current=B,Ln(sessionStorage,_,p,B,{onQuotaExceeded:({docSizeBytes:ge})=>{X("chat_draft_quota_exceeded",{thread_id:c||null,doc_size_bytes:ge}),console.warn("[chat-draft] sessionStorage quota exceeded; draft not saved")}})},Ce=R.useRef(c);if(Ce.current!==c){Ce.current=c;const B=ht(sessionStorage,_,p)??void 0;pe(B),v.current=B}const de=[...l].reverse().find(B=>B.role==="assistant")?.metadata,he=de?.modelLimits?.contextWindow??(!de?.models?.thinking||de.models.thinking.id===f?.modelId?f?.limits?.contextWindow:void 0),le=R.useRef(null),ue=R.useRef(!1),fe=R.useRef(!1),_e=A==="plan",ve=B=>{M(),X("chat_mode_changed",{from_mode:B,to_mode:"default",source:"pill_dismiss"}),w("default")};R.useEffect(()=>{const B=ge=>{tn(ge)&&ge.code==="KeyL"&&(ge.preventDefault(),ge.shiftKey&&w(A==="plan"?"default":"plan"),le.current?.focus())};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[A,w]);const De=Sn(l),je=[...l].reverse().find(B=>B.role==="assistant"&&B.metadata?.usage)?.metadata?.usage?.contextTokens??0,se=Ke("chat"),me=so(),[Le,Oe]=R.useState(!1),[ms,rt]=R.useState(!1),gs=!x&&!Un(ae),Se=pi({hasDraft:gs,isStreaming:V,isRunInProgress:d}),Qe=Se==="send",Ne=Se==="stop",lt=B=>{if(B?.preventDefault(),!se){Oe(!0);return}if(me){rt(!0);return}if(Se==="send"&&ae){if(X("chat_message_sent",{thread_id:c||null,mode:A,model_id:f?.modelId??null,model_provider:f?.providerId??null,virtual_mcp_id:m?.id??null,submission:B?"button_or_enter":"programmatic"}),i){if(i.isSendInFlight()){Ie.info(a("chat.input.stillSendingPreviousMessage"));return}i.sendMessage(ae)}else{if(ue.current){Ie.info(a("chat.input.stillSendingPreviousMessage"));return}ue.current=!0,I&&X("task_report_submitted",{source:"home"}),h({tiptapDoc:ae,virtualMcp:I?null:m,taskIntake:I}).finally(()=>{ue.current=!1})}Fn(sessionStorage,_,p),Ve(void 0)}else Se==="stop"&&(X("chat_message_stopped",{thread_id:c}),u())};if(J)return n.jsx(We,{message:ie?a("chat.input.readOnlyOthersChatNamed",{name:ie}):a("chat.input.readOnlyOthersChat"),icon:ie?n.jsx(Zs,{shape:"circle",size:"2xs",url:ee?.user?.image??void 0,fallback:ie}):void 0});if(S?.metadata?.read_only)return n.jsx(We,{message:a("chat.input.readOnlyThread")});if(ce)return n.jsx(We,{message:a("chat.input.codingAgentUnavailable")});if(O&&r){const B=()=>{const ge=r.createTask({runtime:"sandbox"});X("coding_session_started",{thread_id:ge})};return n.jsxs("button",{type:"button",onClick:B,className:"group flex w-full items-center gap-3 rounded-2xl bg-background/60 px-4 py-3.5 text-left shadow-edge backdrop-blur-sm transition-colors hover:bg-background/90 focus-ring",children:[n.jsx(hn,{size:18,className:"shrink-0 text-muted-foreground"}),n.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[n.jsx("span",{className:"text-sm font-medium text-foreground",children:a("chat.fastPreview.startCodingSession")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:a("chat.fastPreview.chatNeedsSession")})]}),n.jsx(Ot,{size:16,className:"shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5"})]})}return n.jsxs(n.Fragment,{children:[Le&&n.jsx(xt,{feature:"chat",onDismiss:()=>Oe(!1)}),ms&&n.jsx(xt,{feature:"chat",copy:{title:a("chat.input.allowanceExhaustedTitle")},onDismiss:()=>rt(!1)}),n.jsx("div",{className:"flex flex-col w-full justify-end text-left",children:n.jsxs("div",{className:"relative rounded-2xl w-full flex flex-col",children:[e&&n.jsx("div",{className:"absolute inset-0 rounded-2xl pointer-events-none bg-muted/50"}),i&&r&&n.jsx(Fe,{}),i&&r&&c?n.jsx(ds,{taskId:c}):null,n.jsx(po,{tiptapDoc:ae,setTiptapDoc:Ve,disabled:P.status==="recording",enterToSubmit:!0,placeholder:a(I?"chat.input.taskPlaceholder":"chat.input.placeholder"),onSubmit:lt,suggestionOpenRef:fe,children:n.jsxs("form",{onSubmit:lt,className:z("w-full relative rounded-2xl min-h-[110px] md:min-h-[130px] flex flex-col bg-card dark:bg-muted shadow-edge overflow-hidden"),children:[n.jsx(xi,{selectedModel:f,onUnsupportedFile:U,disabled:P.status==="recording"}),n.jsx(Qo,{}),n.jsx("div",{className:"group/input relative flex flex-col gap-2 flex-1",children:n.jsx(ho,{ref:le,disabled:P.status==="recording",virtualMcpId:m?.id??E,showFileUploader:!0,selectedModel:f,onUnsupportedFile:U,suggestionOpenRef:fe})}),n.jsx("div",{className:"@container/chat-bottom flex items-center justify-between p-2.5 gap-1",children:P.status==="recording"?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex-1"}),n.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[n.jsx(Za,{data:P.waveformData.slice(0,28)}),n.jsx("button",{type:"button",onClick:re,className:"flex items-center justify-center size-8 rounded-lg hover:bg-accent text-muted-foreground hover:text-foreground transition-colors","aria-label":a("chat.input.cancelRecording"),children:n.jsx(Ze,{size:16})}),n.jsx("button",{type:"button",onClick:H,className:"flex items-center justify-center size-8 rounded-lg bg-foreground text-background hover:opacity-80 transition-opacity","aria-label":a("chat.input.useTranscription"),children:n.jsx(_t,{size:16})})]})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[s&&n.jsx(W,{type:"button",size:"sm",variant:N?"secondary":"ghost","aria-pressed":N,onClick:()=>T(!N),className:"h-8",children:a("chat.input.taskMode")}),n.jsx(Wa,{disabled:!1,onOpenConnections:()=>{X("connections_dialog_opened",{source:"tools_popover",mode:"add"}),Q(!0)},virtualMcpId:m?.id??E,selectedModel:f,isStreaming:V,onUnsupportedFile:U}),_e&&n.jsx(ze,{onClick:()=>ve("plan"),label:a("chat.input.planMode"),icon:n.jsx(Bt,{size:14,className:"shrink-0"}),colorClass:"text-brand-purple-dark dark:text-brand-purple hover:bg-brand-purple/10",maxWidthClass:"@[480px]/chat-bottom:max-w-32"}),A==="gen-image"&&g&&n.jsx(ze,{onClick:()=>ve("gen-image"),label:a("chat.input.createImage"),icon:n.jsx($t,{size:14,className:"shrink-0"}),colorClass:"text-pink-600 dark:text-pink-400 hover:bg-pink-500/10 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",maxWidthClass:"@[480px]/chat-bottom:max-w-[120px]"}),A==="web-search"&&b&&n.jsx(ze,{onClick:()=>ve("web-search"),label:a("chat.input.webSearch"),icon:n.jsx(Rt,{size:14,className:"shrink-0"}),colorClass:"text-brand-blue-dark dark:text-brand-blue hover:bg-brand-blue/10 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",maxWidthClass:"@[480px]/chat-bottom:max-w-[120px]"}),A==="deep-research"&&y&&n.jsx(ze,{onClick:()=>ve("deep-research"),label:a("chat.input.deepResearch"),icon:n.jsx(Ut,{size:14,className:"shrink-0"}),colorClass:"text-brand-blue-dark dark:text-brand-blue hover:bg-brand-blue/10 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",maxWidthClass:"@[480px]/chat-bottom:max-w-[120px]"}),he&&je>0&&n.jsx(rn,{usage:De,totalTokens:je,contextWindow:he,onOpenContextPanel:t})]}),n.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[n.jsx($n,{}),n.jsx(di,{}),P.isSupported&&n.jsx(W,{type:"button",onClick:ne,disabled:!1,variant:"ghost",size:"icon",className:z("transition-colors",P.status==="permission-denied"?"text-destructive hover:text-destructive hover:bg-destructive/10":"text-muted-foreground hover:text-foreground"),title:P.status==="permission-denied"?a("chat.input.microphoneAccessDenied"):a("chat.input.voiceInput"),"aria-label":P.status==="permission-denied"?a("chat.input.microphoneAccessDenied"):a("chat.input.voiceInput"),children:n.jsx(Kn,{size:18})}),n.jsx(W,{type:Ne?"button":"submit",onClick:B=>{Ne&&(B.preventDefault(),B.stopPropagation(),u())},variant:Qe||Ne?"default":"ghost",size:I?"sm":"icon",disabled:!Qe&&!Ne,className:z(I?"h-8 px-3 transition-all @max-[479px]/chat-bottom:w-8 @max-[479px]/chat-bottom:px-0":"size-8 transition-all",!Qe&&!Ne&&"bg-muted text-muted-foreground hover:bg-muted hover:text-muted-foreground cursor-not-allowed"),title:a(Se==="stop"?V?"chat.input.stopGenerating":"chat.input.cancelRun":I?"chat.input.startTask":"chat.input.sendMessageEnter"),"aria-label":a(Se==="stop"?V?"chat.input.stopGenerating":"chat.input.cancelRun":I?"chat.input.startTask":"chat.input.sendMessage"),children:Ne?n.jsx(fn,{size:20}):n.jsxs(n.Fragment,{children:[I&&n.jsx("span",{className:"hidden @[480px]/chat-bottom:inline",children:a("chat.input.startTask")}),n.jsx(zt,{size:20})]})})]})]})})]})},c),I&&o&&n.jsx("p",{className:"px-3 pt-3 text-left text-xs text-muted-foreground",children:a("chat.input.taskHint")}),e&&n.jsx(Ja,{onClick:()=>{X("connections_banner_clicked",{source:"home_chat_input"}),X("connections_dialog_opened",{source:"home_banner",mode:"add"}),Q(!0)}})]})}),n.jsx(Ao,{mode:"browse",open:K,onOpenChange:Q,defaultTab:"all"}),n.jsx(fo,{info:Z,onClose:Y})]})}export{fr as C,dr as H,_a as T,mr as V,hr as a,gr as b,Ma as c,ur as d,Pe as e,pr as f,fs as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as H,r as C,b as G,j as h,t as A,a5 as ye,x as xe,aT as ke,w as we,B as be,v as Pe,D as Ce,q as le,a4 as ce,K as Y,E as Q,gj as ue,gk as re,gl as z,m as _e}from"./index-BP527m3V.js";import{S as de,s as Se}from"./suggestion-BdOz28RC.js";import{K as Fe,t as De,A as Ie,p as B,L as je,P as ne,O as ve,h as Me,a as Le,Q as Re,o as Ee,l as Ae,F as Ne,s as Te,E as Qe}from"./usage-stats-CK4hgSt6.js";import{b0 as Oe}from"./agent-icon-CpMz1pSC.js";import"./chat-context-Na_9rQo_.js";import{m as Ue,i as $e,b as qe}from"./index-DF1Gszum.js";import{u as me}from"./use-mcp-client-CaYmuD4l.js";import{a as Ke}from"./repository-binding-DGc5VhVW.js";import{g as se,s as fe}from"./tool-namespace-BBpCD9sF.js";import{l as oe,g as pe}from"./use-mcp-prompts-lHtFGIni.js";import{f as ze,b as Be}from"./use-org-fs-Cv09aZqm.js";async function He(t,e,r,s,i,o){if(!Ue(e)){A.error("Selected model does not support file uploads");return}const l=r.type||"application/octet-stream";if(!$e(l,e)){const g=qe(e).parts.map(m=>o(m)).join(", "),k=e?.title??"This model";i?i({fileName:r.name,modelName:k,accepted:g}):A.error(`"${r.name}" can't be attached`,{description:`${k} accepts ${g}.`});return}const c=10*1024*1024;if(r.size>c){A.error(`File "${r.name}" exceeds 10MB limit`);return}try{const g=new FileReader,k=new Promise((n,u)=>{g.onload=()=>{const d=g.result;if(typeof d!="string"){u(new Error("Failed to read file as data URL"));return}const b=d.includes(",")?d.split(",")[1]??d:d;n(b)},g.onerror=u});g.readAsDataURL(r);const m=await k,p={id:crypto.randomUUID(),name:r.name,mimeType:r.type||"application/octet-stream",size:r.size,data:m};Fe(t,{from:s,to:s},p)}catch(g){console.error("Failed to process file:",g),A.error(`Failed to load file "${r.name}"`)}}function Je(t,e,r,s){if(r)return!1;const i=e.dataTransfer?.files;if(!i||i.length===0)return!1;const o=t.posAtCoords({left:e.clientX,top:e.clientY});if(!o)return!1;e.preventDefault();const l=Array.from(i);return(async()=>{let c=o.pos;for(const g of l)await s(g,c),c=t.state.selection.to})(),!0}function Ve(t){const e=H.c(9),{editor:r,selectedModel:s,onUnsupportedFile:i}=t,o=G(),l=C.useRef(Xe);let c,g;e[0]!==r||e[1]!==i||e[2]!==s||e[3]!==o?(c=()=>{l.current=async(p,n)=>{await He(r,s,p,n,i,o)}},g=[r,s,i,o],e[0]=r,e[1]=i,e[2]=s,e[3]=o,e[4]=c,e[5]=g):(c=e[4],g=e[5]),C.useEffect(c,g);let k,m;return e[6]!==r?(k=()=>{if(r?.isDestroyed)return;const p=new De("fileDropHandler");r.state.plugins.find(d=>d.spec.key===p)&&r.unregisterPlugin(p);const u=new Ie({key:p,props:{handleDrop:(d,b,F,S)=>Je(d,b,S,(_,j)=>l.current(_,j)),handlePaste:(d,b)=>{const F=b.clipboardData?.items;if(!F)return!1;const S=Array.from(F).filter(We);return S.length===0?!1:(b.preventDefault(),(async()=>{let _=d.state.selection.from;for(const j of S){const I=j.getAsFile();I&&(await l.current?.(I,_),_=d.state.selection.to)}})(),!0)}}});return r.registerPlugin(u),()=>{r?.isDestroyed||r.unregisterPlugin(p)}},m=[r],e[6]=r,e[7]=k,e[8]=m):(k=e[7],m=e[8]),C.useEffect(k,m),null}function We(t){return t.kind==="file"}function Xe(){return Promise.resolve()}function bt(t){const e=H.c(43),{info:r,onClose:s}=t,i=G(),o=r!==null;let l;e[0]!==s?(l=v=>!v&&s(),e[0]=s,e[1]=l):l=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=["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]=c):c=e[2];let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=h.jsx("div",{className:"absolute inset-x-0 top-0 h-36 pointer-events-none",style:{backgroundImage:c.join(", "),maskImage:"linear-gradient(to bottom, black 0%, transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black 0%, transparent 100%)"}}),e[3]=g):g=e[3];let k;e[4]===Symbol.for("react.memo_cache_sentinel")?(k=h.jsx("div",{className:"flex items-center justify-center size-9 rounded-lg bg-warning/15 text-warning",children:h.jsx(ye,{size:18})}),e[4]=k):k=e[4];let m;e[5]!==i?(m=i("chat.uploader.fileTypeNotSupported"),e[5]=i,e[6]=m):m=e[6];let p;e[7]!==m?(p=h.jsx(xe,{className:"text-xl font-semibold tracking-tight",children:m}),e[7]=m,e[8]=p):p=e[8];const n=r?.fileName;let u;e[9]!==n?(u=h.jsxs("span",{className:"font-medium text-foreground",children:["“",n,"”"]}),e[9]=n,e[10]=u):u=e[10];let d;e[11]!==i?(d=i("chat.uploader.cantAttachToChat"),e[11]=i,e[12]=d):d=e[12];let b;e[13]!==d||e[14]!==u?(b=h.jsxs(ke,{className:"mt-1.5 text-sm leading-relaxed",children:[u," ",d]}),e[13]=d,e[14]=u,e[15]=b):b=e[15];let F;e[16]!==b||e[17]!==p?(F=h.jsxs("div",{className:"relative px-8 pt-8 pb-2 overflow-hidden",children:[g,h.jsxs(we,{className:"relative gap-4",children:[k,h.jsxs("div",{children:[p,b]})]})]}),e[16]=b,e[17]=p,e[18]=F):F=e[18];const S=r?.modelName??"";let _;e[19]!==i||e[20]!==S?(_=i("chat.uploader.accepts",{modelName:S}),e[19]=i,e[20]=S,e[21]=_):_=e[21];let j;e[22]!==_?(j=h.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-2",children:_}),e[22]=_,e[23]=j):j=e[23];let I;e[24]===Symbol.for("react.memo_cache_sentinel")?(I=h.jsx(Oe,{size:14,className:"text-muted-foreground"}),e[24]=I):I=e[24];const L=r?.accepted;let D;e[25]!==L?(D=h.jsxs("div",{className:"flex items-center gap-2 text-sm text-foreground",children:[I,h.jsx("span",{className:"capitalize",children:L})]}),e[25]=L,e[26]=D):D=e[26];let a;e[27]!==j||e[28]!==D?(a=h.jsx("div",{className:"px-8 pt-3 pb-6 space-y-3",children:h.jsxs("div",{className:"surface p-4",children:[j,D]})}),e[27]=j,e[28]=D,e[29]=a):a=e[29];let f;e[30]!==i?(f=i("chat.uploader.gotIt"),e[30]=i,e[31]=f):f=e[31];let x;e[32]!==s||e[33]!==f?(x=h.jsx("div",{className:"px-8 py-4 border-t border-border bg-muted/30 flex items-center justify-end",children:h.jsx(be,{onClick:s,children:f})}),e[32]=s,e[33]=f,e[34]=x):x=e[34];let P;e[35]!==F||e[36]!==a||e[37]!==x?(P=h.jsxs(Pe,{className:"sm:max-w-[480px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:Ye,children:[F,a,x]}),e[35]=F,e[36]=a,e[37]=x,e[38]=P):P=e[38];let M;return e[39]!==o||e[40]!==l||e[41]!==P?(M=h.jsx(Ce,{open:o,onOpenChange:l,children:P}),e[39]=o,e[40]=l,e[41]=P,e[42]=M):M=e[42],M}function Ye(t){return t.preventDefault()}function Pt(){const t=H.c(3),[e,r]=C.useState(null);let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=()=>r(null),t[0]=s):s=t[0];let i;return t[1]!==e?(i={unsupportedFile:e,onUnsupportedFile:r,clearUnsupportedFile:s},t[1]=e,t[2]=i):i=t[2],i}function he(t,e){return e||t}const Ge=t=>{const e=H.c(50),{editor:r,virtualMcpId:s,suggestionOpenRef:i}=t,o=G(),l=le(),{org:c}=ce(),g=Ke();let k;e[0]!==c.id||e[1]!==c.slug||e[2]!==s?(k={connectionId:s,orgId:c.id,orgSlug:c.slug},e[0]=c.id,e[1]=c.slug,e[2]=s,e[3]=k):k=e[3];const m=me(k);let p;e[4]!==c.id||e[5]!==s?(p=Y.virtualMcpResources(s,c.id),e[4]=c.id,e[5]=s,e[6]=p):p=e[6];const n=p,[u,d]=C.useState("categories");let b;e[7]!==u?(b=()=>u,e[7]=u,e[8]=b):b=e[8];const F=C.useEffectEvent(b),S=C.useRef(null),_=C.useRef(!1),j=s??"default";let I;e[9]!==u||e[10]!==c.id||e[11]!==j?(I=["at-mention",c.id,j,u],e[9]=u,e[10]=c.id,e[11]=j,e[12]=I):I=e[12];const L=I;let D;e[13]!==o?(D=o("chat.mentionAt.agentsTitle"),e[13]=o,e[14]=D):D=e[14];let a;e[15]!==o?(a=o("chat.mentionAt.agentsDescription"),e[15]=o,e[16]=a):a=e[16];let f;e[17]!==D||e[18]!==a?(f={name:"agents",title:D,description:a,kind:"category",drillable:!0},e[17]=D,e[18]=a,e[19]=f):f=e[19];let x;e[20]!==o?(x=o("chat.mentionAt.resourcesTitle"),e[20]=o,e[21]=x):x=e[21];let P;e[22]!==o?(P=o("chat.mentionAt.resourcesDescription"),e[22]=o,e[23]=P):P=e[23];let M;e[24]!==P||e[25]!==x?(M={name:"resources",title:x,description:P,kind:"category",drillable:!0},e[24]=P,e[25]=x,e[26]=M):M=e[26];let v;e[27]!==M||e[28]!==f?(v=[f,M],e[27]=M,e[28]=f,e[29]=v):v=e[29];const $=v;let O;e[30]!==m||e[31]!==r||e[32]!==o?(O=async U=>{const{item:w,range:K}=U;if(Q("chat_picker_item_selected",{picker:"@",item_kind:w.kind,item_name:w.name}),w.kind!=="category"&&(_.current=!0),w.kind==="category")return d(w.name==="agents"?"agents":"resources"),!1;if(w.kind==="agent"&&w.agentId){B(r,K,{id:w.agentId,name:w.name,metadata:{agentId:w.agentId,title:w.name},char:"@"}),d("categories");return}if(w.kind==="resource"&&w.uri&&m){try{const T=await ue(m,w.uri);B(r,K,{id:w.uri,name:w.uri,metadata:T.contents,char:"@"})}catch(T){console.error("[at-mention] Failed to fetch resource:",T),A.error(o("chat.mentionAt.failedToLoadResource"))}d("categories");return}},e[30]=m,e[31]=r,e[32]=o,e[33]=O):O=e[33];const q=O;let y;e[34]!==g||e[35]!==$||e[36]!==m||e[37]!==F||e[38]!==l||e[39]!==n||e[40]!==s?(y=async U=>{const{query:w}=U,K=F();if(K==="categories"){if(!w.trim())return $;const R=w.toLowerCase(),E=g.filter(N=>N.status==="active"&&(!N.id||!re(N.id))&&N.id!==s&&(N.title.toLowerCase().includes(R)||N.description?.toLowerCase().includes(R))).map(Ze),X=await(async()=>{if(!m)return[];let N=l.getQueryData(n);return N||(N=await l.fetchQuery({queryKey:n,queryFn:()=>z(m),staleTime:6e4})),(N?.resources??[]).filter(te=>te.uri.toLowerCase().includes(R)||te.name?.toLowerCase().includes(R)||te.description?.toLowerCase().includes(R)).map(et)})();return[...E,...X]}if(K==="agents"){let R=g.filter(E=>E.status==="active"&&(!E.id||!re(E.id))&&E.id!==s);if(w.trim()){const E=w.toLowerCase();R=R.filter(X=>X.title.toLowerCase().includes(E)||X.description?.toLowerCase().includes(E))}return R.map(tt)}if(!m)return[];let T=l.getQueryData(n);T?l.fetchQuery({queryKey:n,queryFn:()=>z(m),staleTime:6e4}).catch(st):T=await l.fetchQuery({queryKey:n,queryFn:()=>z(m),staleTime:6e4});let W=T?.resources??[];if(w.trim()){const R=w.toLowerCase();W=W.filter(E=>E.uri.toLowerCase().includes(R)||E.name?.toLowerCase().includes(R)||E.description?.toLowerCase().includes(R))}return W.map(rt)},e[34]=g,e[35]=$,e[36]=m,e[37]=F,e[38]=l,e[39]=n,e[40]=s,e[41]=y):y=e[41];const Z=y;let J;e[42]!==i?(J=U=>{if(i&&(i.current=U),U)S.current=Date.now(),_.current=!1,Q("chat_picker_opened",{picker:"@"});else{const w=S.current;Q("chat_picker_closed",{picker:"@",outcome:_.current?"selected":"dismissed",duration_ms:w?Date.now()-w:null}),S.current=null,d("categories")}},e[42]=i,e[43]=J):J=e[43];const ee=J;let V;return e[44]!==r||e[45]!==Z||e[46]!==q||e[47]!==ee||e[48]!==L?(V=h.jsx(de,{editor:r,char:"@",pluginKey:"atDropdownMenu",queryKey:L,queryFn:Z,onSelect:q,onOpenChange:ee}),e[44]=r,e[45]=Z,e[46]=q,e[47]=ee,e[48]=L,e[49]=V):V=e[49],V};function Ze(t){return{name:t.title,title:t.title,description:t.description??void 0,icon:t.icon??null,kind:"agent",agentId:t.id}}function et(t){return{name:he(t.uri,t.name),title:t.name,description:t.description,kind:"resource",uri:t.uri}}function tt(t){return{name:t.title,title:t.title,description:t.description??void 0,icon:t.icon??null,kind:"agent",agentId:t.id}}function st(){}function rt(t){return{name:he(t.uri,t.name),title:t.name,description:t.description,kind:"resource",uri:t.uri}}async function ie(t,e,r,s,i,o,l){try{const c=await pe(r,s,o);B(t,e,{id:s,name:fe(s,i),metadata:c.messages,char:"/",kind:"prompt",args:o})}catch(c){console.error("[slash] Failed to fetch prompt:",c),A.error(l.t("chat.mentionSlash.failedLoadPrompt"))}}async function nt(t,e,r,s,i){try{const o=await ue(r,s);B(t,e,{id:s,name:s,metadata:o.contents,char:"/",kind:"resource"})}catch(o){console.error("[slash] Failed to fetch resource:",o),A.error(i.t("chat.mentionSlash.failedLoadResource"))}}async function ot(t,e,r,s,i){try{const{files:o,omittedPaths:l}=await ze(r,s.volume,s.path),c={sandboxPath:s.sandboxPath,volume:s.volume,path:s.path,files:o,omittedPaths:l};B(t,e,{id:s.id,name:s.name,metadata:c,char:"/",kind:"skill"})}catch(o){console.error("[slash] Failed to fetch skill:",o),A.error(i.t("chat.mentionSlash.failedLoadSkill"))}}const it=({editor:t,virtualMcpId:e,suggestionOpenRef:r})=>{const s=G(),i=le(),{org:o}=ce(),l=me({connectionId:e,orgId:o.id,orgSlug:o.slug}),c=Y.virtualMcpPrompts(e,o.id),g=Y.virtualMcpResources(e,o.id),k=Y.slashSkills(o.id),m=["slash-mention",o.id,e??"default"],[p,n]=C.useState(null),[u,d]=C.useState(null),b=je(t);b&&(b.onEditChip=async a=>{if(l)try{const x=(await ae(i,c,l)).find(P=>P.name===a.promptId);if(!x?.arguments||x.arguments.length===0)return;d({...a,prompt:x})}catch(f){console.error("[slash] Failed to load prompt for editing:",f),A.error(s("chat.mentionSlash.failedLoadPrompt"))}});const F=C.useRef(null),S=C.useRef(!1),_=async({item:a,range:f})=>{if(Q("chat_picker_item_selected",{picker:"/",item_kind:a.kind,item_name:a.name}),S.current=!0,!!l)if(a.kind==="prompt"){if(a.arguments&&a.arguments.length>0){n({range:f,item:a});return}const x=se(a._meta);await ie(t,f,l,a.name,x,void 0,{t:s})}else a.kind==="skill"?a.skill&&await ot(t,f,o.slug,a.skill,{t:s}):a.uri&&await nt(t,f,l,a.uri,{t:s})},j=async a=>{if(!p||!l)return;const{range:f,item:x}=p,P=se(x._meta);await ie(t,f,l,x.name,P,a,{t:s}),n(null)},I=async a=>{if(!(!u||!l)){if(!ve(t,u.pos,u.promptId)){A.error(s("chat.mentionSlash.failedUpdatePrompt")),d(null);return}try{const f=await pe(l,u.promptId,a),x=se(u.prompt._meta);t.chain().focus().setNodeSelection(u.pos).deleteSelection().insertContentAt(u.pos,Me({id:u.promptId,name:fe(u.promptId,x),metadata:f.messages,char:"/",kind:"prompt",args:a})).run(),Q("chat_picker_item_selected",{picker:"/edit",item_kind:"prompt",item_name:u.promptId})}catch(f){console.error("[slash] Failed to update prompt:",f),A.error(s("chat.mentionSlash.failedUpdatePrompt"))}d(null)}},L=async a=>{const{query:f}=a;if(!l)return[];const[x,P,M]=await Promise.all([ae(i,c,l),lt(i,g,l),at(i,k,o.slug)]),v=f.trim().toLowerCase(),$=(x??[]).filter(y=>!v||y.name.toLowerCase().includes(v)||y.title?.toLowerCase().includes(v)||y.description?.toLowerCase().includes(v)).map(y=>({name:y.name,title:y.title,description:y.description,kind:"prompt",arguments:y.arguments,_meta:y._meta})),O=(P??[]).filter(y=>!v||y.uri.toLowerCase().includes(v)||y.name?.toLowerCase().includes(v)||y.description?.toLowerCase().includes(v)).map(y=>({name:y.name??y.uri,title:y.name,description:y.description,kind:"resource",uri:y.uri})),q=(M??[]).filter(y=>!v||y.name.toLowerCase().includes(v)||y.id.toLowerCase().includes(v)||y.description?.toLowerCase().includes(v)).map(y=>({name:y.name,title:y.name,description:y.description??void 0,kind:"skill",skill:y}));return[...$,...O,...q]},D=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 h.jsxs(h.Fragment,{children:[h.jsx(de,{editor:t,char:"/",pluginKey:"slashDropdownMenu",queryKey:m,queryFn:L,onSelect:_,onOpenChange:a=>{if(r&&(r.current=a),a)F.current=Date.now(),S.current=!1,Q("chat_picker_opened",{picker:"/"});else{const f=F.current;Q("chat_picker_closed",{picker:"/",outcome:S.current?"selected":"dismissed",duration_ms:f?Date.now()-f:null}),F.current=null}}}),h.jsx(ne,{prompt:D,setPrompt:()=>n(null),onSubmit:j}),h.jsx(ne,{prompt:u?.prompt??null,setPrompt:()=>d(null),onSubmit:I,defaultValues:u?.args},u?`edit-${u.promptId}-${u.pos}`:"edit-idle")]})};async function ae(t,e,r){let s=t.getQueryData(e);return s?t.fetchQuery({queryKey:e,queryFn:()=>oe(r),staleTime:6e4}).catch(()=>{}):s=await t.fetchQuery({queryKey:e,queryFn:()=>oe(r),staleTime:6e4}).catch(()=>{}),s?.prompts??[]}async function at(t,e,r){const s=t.getQueryData(e),i=()=>t.fetchQuery({queryKey:e,queryFn:()=>Be(r),staleTime:6e4});return s?(i().catch(()=>{}),s):i().catch(()=>[])}async function lt(t,e,r){let s=t.getQueryData(e);return s?t.fetchQuery({queryKey:e,queryFn:()=>z(r),staleTime:6e4}).catch(()=>{}):s=await t.fetchQuery({queryKey:e,queryFn:()=>z(r),staleTime:6e4}).catch(()=>{}),s?.resources??[]}const ge="Ask anything, / for prompts & skills, @ for agents & resources...";function ct(t){return[Te.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,dropcursor:!1}),Se.configure({placeholder:()=>t.current??ge,showOnlyWhenEditable:!1}),Ae,Ne]}function Ct({tiptapDoc:t,setTiptapDoc:e,disabled:r=!1,enterToSubmit:s=!1,placeholder:i,onSubmit:o,suggestionOpenRef:l,children:c}){const g=C.useRef(o),k=C.useRef(e),m=C.useRef(s),p=C.useRef(i),n=Le({extensions:ct(p),content:t||"",editorProps:{attributes:{"data-chat-input":"true",role:"textbox","aria-multiline":"true","aria-label":i??ge,class:"prose prose-sm max-w-none focus:outline-none w-full h-full text-base p-[18px]"},handleKeyDown:(u,d)=>d.key==="Enter"&&!d.shiftKey&&m.current&&!l?.current?(d.preventDefault(),g.current?.(),!0):!1},onUpdate:({editor:u})=>{k.current(u?.getJSON())}});return C.useEffect(()=>{n?.setEditable(!r)},[n,r]),C.useEffect(()=>{g.current=o},[o]),C.useEffect(()=>{k.current=e},[e]),C.useEffect(()=>{m.current=s},[s]),C.useEffect(()=>{p.current=i},[i]),C.useEffect(()=>{if(!n||n.isDestroyed)return;const u=JSON.stringify(n.getJSON()),d=JSON.stringify(t||{type:"doc",content:[]});u!==d&&n.commands.setContent(t||{type:"doc",content:[]})},[n,t]),h.jsx(Re.Provider,{value:{editor:n},children:c})}function _t(t){const e=H.c(29),{disabled:r,virtualMcpId:s,showFileUploader:i,selectedModel:o,onUnsupportedFile:l,suggestionOpenRef:c,ref:g,className:k}=t,m=r===void 0?!1:r,p=i===void 0?!1:i,{editor:n}=Ee();let u,d;if(e[0]!==n?(u=()=>({focus:()=>{n?.commands.focus()},clear:()=>{n?.commands.clearContent(!0)},appendText:x=>{if(!n)return;const P=n.state.doc.textContent.trim()==="";n.commands.focus("end"),P||n.commands.insertContent(" "),n.commands.insertContent(x)},syncVoiceText:(x,P)=>{if(n&&(n.commands.setContent(x||{type:"doc",content:[]}),P)){n.commands.focus("end");const M=n.state.doc.textContent.trim().length>0;n.commands.insertContent({type:"text",text:M?" "+P:P})}},restoreContent:x=>{n&&n.commands.setContent(x||{type:"doc",content:[]})}}),d=[n],e[0]=n,e[1]=u,e[2]=d):(u=e[1],d=e[2]),C.useImperativeHandle(g??null,u,d),!n)return null;const b=m&&"cursor-not-allowed opacity-70",F=m&&"[&_.ProseMirror]:cursor-not-allowed";let S;e[3]!==k||e[4]!==b||e[5]!==F?(S=_e("overflow-y-auto relative flex-1 max-h-[164px] min-h-[20px] w-full flex flex-col",k,"[&_.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",b,F),e[3]=k,e[4]=b,e[5]=F,e[6]=S):S=e[6];let _;e[7]!==n||e[8]!==S?(_=h.jsx(Qe,{editor:n,className:S}),e[7]=n,e[8]=S,e[9]=_):_=e[9];const j=s??null;let I;e[10]!==n||e[11]!==c||e[12]!==j?(I=h.jsx(C.Suspense,{fallback:null,children:h.jsx(it,{editor:n,virtualMcpId:j,suggestionOpenRef:c})}),e[10]=n,e[11]=c,e[12]=j,e[13]=I):I=e[13];const L=s??null;let D;e[14]!==n||e[15]!==c||e[16]!==L?(D=h.jsx(C.Suspense,{fallback:null,children:h.jsx(Ge,{editor:n,virtualMcpId:L,suggestionOpenRef:c})}),e[14]=n,e[15]=c,e[16]=L,e[17]=D):D=e[17];let a;e[18]!==m||e[19]!==n||e[20]!==l||e[21]!==o||e[22]!==p?(a=p&&o&&!m?h.jsx(Ve,{editor:n,selectedModel:o,onUnsupportedFile:l}):null,e[18]=m,e[19]=n,e[20]=l,e[21]=o,e[22]=p,e[23]=a):a=e[23];let f;return e[24]!==I||e[25]!==D||e[26]!==a||e[27]!==_?(f=h.jsxs(h.Fragment,{children:[_,I,D,a]}),e[24]=I,e[25]=D,e[26]=a,e[27]=_,e[28]=f):f=e[28],f}export{Ct as T,bt as U,_t as a,He as p,Pt as u};
|
|
1
|
+
import{c as B,r as C,b as G,j as h,t as A,a5 as ye,x as xe,aS as ke,w as we,B as be,v as Pe,D as Ce,q as le,a4 as ce,K as Y,E as Q,gj as ue,gk as re,gl as z,m as Se}from"./index-CwntHk8S.js";import{S as de,s as _e}from"./suggestion-bCd1m59t.js";import{K as Fe,t as De,A as Ie,p as J,L as je,P as ne,O as ve,k as Me,a as Le,Q as Re,o as Ee,l as Ae,F as Ne,s as Te,E as Qe}from"./usage-stats-Bk_1jh1-.js";import{aJ as Oe}from"./agent-icon-DE4TWlDl.js";import"./chat-context-CiT7AzBS.js";import{m as Ue,i as $e,b as qe}from"./index-C17JTAPe.js";import{u as me}from"./use-mcp-client-Cvc3WWPF.js";import{u as Ke}from"./repository-binding-Cqb4hBI0.js";import{g as se,a as fe}from"./gateway-client-BqPME1T5.js";import{l as oe,g as pe}from"./use-mcp-prompts-Ck1uv43A.js";import{f as ze,b as Je}from"./use-org-fs-BfE7L8cf.js";async function Be(t,e,r,s,i,o){if(!Ue(e)){A.error("Selected model does not support file uploads");return}const l=r.type||"application/octet-stream";if(!$e(l,e)){const g=qe(e).parts.map(m=>o(m)).join(", "),k=e?.title??"This model";i?i({fileName:r.name,modelName:k,accepted:g}):A.error(`"${r.name}" can't be attached`,{description:`${k} accepts ${g}.`});return}const c=10*1024*1024;if(r.size>c){A.error(`File "${r.name}" exceeds 10MB limit`);return}try{const g=new FileReader,k=new Promise((n,u)=>{g.onload=()=>{const d=g.result;if(typeof d!="string"){u(new Error("Failed to read file as data URL"));return}const b=d.includes(",")?d.split(",")[1]??d:d;n(b)},g.onerror=u});g.readAsDataURL(r);const m=await k,p={id:crypto.randomUUID(),name:r.name,mimeType:r.type||"application/octet-stream",size:r.size,data:m};Fe(t,{from:s,to:s},p)}catch(g){console.error("Failed to process file:",g),A.error(`Failed to load file "${r.name}"`)}}function He(t,e,r,s){if(r)return!1;const i=e.dataTransfer?.files;if(!i||i.length===0)return!1;const o=t.posAtCoords({left:e.clientX,top:e.clientY});if(!o)return!1;e.preventDefault();const l=Array.from(i);return(async()=>{let c=o.pos;for(const g of l)await s(g,c),c=t.state.selection.to})(),!0}function Ve(t){const e=B.c(9),{editor:r,selectedModel:s,onUnsupportedFile:i}=t,o=G(),l=C.useRef(Xe);let c,g;e[0]!==r||e[1]!==i||e[2]!==s||e[3]!==o?(c=()=>{l.current=async(p,n)=>{await Be(r,s,p,n,i,o)}},g=[r,s,i,o],e[0]=r,e[1]=i,e[2]=s,e[3]=o,e[4]=c,e[5]=g):(c=e[4],g=e[5]),C.useEffect(c,g);let k,m;return e[6]!==r?(k=()=>{if(r?.isDestroyed)return;const p=new De("fileDropHandler");r.state.plugins.find(d=>d.spec.key===p)&&r.unregisterPlugin(p);const u=new Ie({key:p,props:{handleDrop:(d,b,F,_)=>He(d,b,_,(S,j)=>l.current(S,j)),handlePaste:(d,b)=>{const F=b.clipboardData?.items;if(!F)return!1;const _=Array.from(F).filter(We);return _.length===0?!1:(b.preventDefault(),(async()=>{let S=d.state.selection.from;for(const j of _){const I=j.getAsFile();I&&(await l.current?.(I,S),S=d.state.selection.to)}})(),!0)}}});return r.registerPlugin(u),()=>{r?.isDestroyed||r.unregisterPlugin(p)}},m=[r],e[6]=r,e[7]=k,e[8]=m):(k=e[7],m=e[8]),C.useEffect(k,m),null}function We(t){return t.kind==="file"}function Xe(){return Promise.resolve()}function bt(t){const e=B.c(43),{info:r,onClose:s}=t,i=G(),o=r!==null;let l;e[0]!==s?(l=v=>!v&&s(),e[0]=s,e[1]=l):l=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=["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]=c):c=e[2];let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=h.jsx("div",{className:"absolute inset-x-0 top-0 h-36 pointer-events-none",style:{backgroundImage:c.join(", "),maskImage:"linear-gradient(to bottom, black 0%, transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black 0%, transparent 100%)"}}),e[3]=g):g=e[3];let k;e[4]===Symbol.for("react.memo_cache_sentinel")?(k=h.jsx("div",{className:"flex items-center justify-center size-9 rounded-lg bg-warning/15 text-warning",children:h.jsx(ye,{size:18})}),e[4]=k):k=e[4];let m;e[5]!==i?(m=i("chat.uploader.fileTypeNotSupported"),e[5]=i,e[6]=m):m=e[6];let p;e[7]!==m?(p=h.jsx(xe,{className:"text-xl font-semibold tracking-tight",children:m}),e[7]=m,e[8]=p):p=e[8];const n=r?.fileName;let u;e[9]!==n?(u=h.jsxs("span",{className:"font-medium text-foreground",children:["“",n,"”"]}),e[9]=n,e[10]=u):u=e[10];let d;e[11]!==i?(d=i("chat.uploader.cantAttachToChat"),e[11]=i,e[12]=d):d=e[12];let b;e[13]!==d||e[14]!==u?(b=h.jsxs(ke,{className:"mt-1.5 text-sm leading-relaxed",children:[u," ",d]}),e[13]=d,e[14]=u,e[15]=b):b=e[15];let F;e[16]!==b||e[17]!==p?(F=h.jsxs("div",{className:"relative px-8 pt-8 pb-2 overflow-hidden",children:[g,h.jsxs(we,{className:"relative gap-4",children:[k,h.jsxs("div",{children:[p,b]})]})]}),e[16]=b,e[17]=p,e[18]=F):F=e[18];const _=r?.modelName??"";let S;e[19]!==i||e[20]!==_?(S=i("chat.uploader.accepts",{modelName:_}),e[19]=i,e[20]=_,e[21]=S):S=e[21];let j;e[22]!==S?(j=h.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-2",children:S}),e[22]=S,e[23]=j):j=e[23];let I;e[24]===Symbol.for("react.memo_cache_sentinel")?(I=h.jsx(Oe,{size:14,className:"text-muted-foreground"}),e[24]=I):I=e[24];const L=r?.accepted;let D;e[25]!==L?(D=h.jsxs("div",{className:"flex items-center gap-2 text-sm text-foreground",children:[I,h.jsx("span",{className:"capitalize",children:L})]}),e[25]=L,e[26]=D):D=e[26];let a;e[27]!==j||e[28]!==D?(a=h.jsx("div",{className:"px-8 pt-3 pb-6 space-y-3",children:h.jsxs("div",{className:"surface p-4",children:[j,D]})}),e[27]=j,e[28]=D,e[29]=a):a=e[29];let f;e[30]!==i?(f=i("chat.uploader.gotIt"),e[30]=i,e[31]=f):f=e[31];let x;e[32]!==s||e[33]!==f?(x=h.jsx("div",{className:"px-8 py-4 border-t border-border bg-muted/30 flex items-center justify-end",children:h.jsx(be,{onClick:s,children:f})}),e[32]=s,e[33]=f,e[34]=x):x=e[34];let P;e[35]!==F||e[36]!==a||e[37]!==x?(P=h.jsxs(Pe,{className:"sm:max-w-[480px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:Ye,children:[F,a,x]}),e[35]=F,e[36]=a,e[37]=x,e[38]=P):P=e[38];let M;return e[39]!==o||e[40]!==l||e[41]!==P?(M=h.jsx(Ce,{open:o,onOpenChange:l,children:P}),e[39]=o,e[40]=l,e[41]=P,e[42]=M):M=e[42],M}function Ye(t){return t.preventDefault()}function Pt(){const t=B.c(3),[e,r]=C.useState(null);let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=()=>r(null),t[0]=s):s=t[0];let i;return t[1]!==e?(i={unsupportedFile:e,onUnsupportedFile:r,clearUnsupportedFile:s},t[1]=e,t[2]=i):i=t[2],i}function he(t,e){return e||t}const Ge=t=>{const e=B.c(50),{editor:r,virtualMcpId:s,suggestionOpenRef:i}=t,o=G(),l=le(),{org:c}=ce(),g=Ke();let k;e[0]!==c.id||e[1]!==c.slug||e[2]!==s?(k={connectionId:s,orgId:c.id,orgSlug:c.slug},e[0]=c.id,e[1]=c.slug,e[2]=s,e[3]=k):k=e[3];const m=me(k);let p;e[4]!==c.id||e[5]!==s?(p=Y.virtualMcpResources(s,c.id),e[4]=c.id,e[5]=s,e[6]=p):p=e[6];const n=p,[u,d]=C.useState("categories");let b;e[7]!==u?(b=()=>u,e[7]=u,e[8]=b):b=e[8];const F=C.useEffectEvent(b),_=C.useRef(null),S=C.useRef(!1),j=s??"default";let I;e[9]!==u||e[10]!==c.id||e[11]!==j?(I=["at-mention",c.id,j,u],e[9]=u,e[10]=c.id,e[11]=j,e[12]=I):I=e[12];const L=I;let D;e[13]!==o?(D=o("chat.mentionAt.agentsTitle"),e[13]=o,e[14]=D):D=e[14];let a;e[15]!==o?(a=o("chat.mentionAt.agentsDescription"),e[15]=o,e[16]=a):a=e[16];let f;e[17]!==D||e[18]!==a?(f={name:"agents",title:D,description:a,kind:"category",drillable:!0},e[17]=D,e[18]=a,e[19]=f):f=e[19];let x;e[20]!==o?(x=o("chat.mentionAt.resourcesTitle"),e[20]=o,e[21]=x):x=e[21];let P;e[22]!==o?(P=o("chat.mentionAt.resourcesDescription"),e[22]=o,e[23]=P):P=e[23];let M;e[24]!==P||e[25]!==x?(M={name:"resources",title:x,description:P,kind:"category",drillable:!0},e[24]=P,e[25]=x,e[26]=M):M=e[26];let v;e[27]!==M||e[28]!==f?(v=[f,M],e[27]=M,e[28]=f,e[29]=v):v=e[29];const $=v;let O;e[30]!==m||e[31]!==r||e[32]!==o?(O=async U=>{const{item:w,range:K}=U;if(Q("chat_picker_item_selected",{picker:"@",item_kind:w.kind,item_name:w.name}),w.kind!=="category"&&(S.current=!0),w.kind==="category")return d(w.name==="agents"?"agents":"resources"),!1;if(w.kind==="agent"&&w.agentId){J(r,K,{id:w.agentId,name:w.name,metadata:{agentId:w.agentId,title:w.name},char:"@"}),d("categories");return}if(w.kind==="resource"&&w.uri&&m){try{const T=await ue(m,w.uri);J(r,K,{id:w.uri,name:w.uri,metadata:T.contents,char:"@"})}catch(T){console.error("[at-mention] Failed to fetch resource:",T),A.error(o("chat.mentionAt.failedToLoadResource"))}d("categories");return}},e[30]=m,e[31]=r,e[32]=o,e[33]=O):O=e[33];const q=O;let y;e[34]!==g||e[35]!==$||e[36]!==m||e[37]!==F||e[38]!==l||e[39]!==n||e[40]!==s?(y=async U=>{const{query:w}=U,K=F();if(K==="categories"){if(!w.trim())return $;const R=w.toLowerCase(),E=g.filter(N=>N.status==="active"&&(!N.id||!re(N.id))&&N.id!==s&&(N.title.toLowerCase().includes(R)||N.description?.toLowerCase().includes(R))).map(Ze),X=await(async()=>{if(!m)return[];let N=l.getQueryData(n);return N||(N=await l.fetchQuery({queryKey:n,queryFn:()=>z(m),staleTime:6e4})),(N?.resources??[]).filter(te=>te.uri.toLowerCase().includes(R)||te.name?.toLowerCase().includes(R)||te.description?.toLowerCase().includes(R)).map(et)})();return[...E,...X]}if(K==="agents"){let R=g.filter(E=>E.status==="active"&&(!E.id||!re(E.id))&&E.id!==s);if(w.trim()){const E=w.toLowerCase();R=R.filter(X=>X.title.toLowerCase().includes(E)||X.description?.toLowerCase().includes(E))}return R.map(tt)}if(!m)return[];let T=l.getQueryData(n);T?l.fetchQuery({queryKey:n,queryFn:()=>z(m),staleTime:6e4}).catch(st):T=await l.fetchQuery({queryKey:n,queryFn:()=>z(m),staleTime:6e4});let W=T?.resources??[];if(w.trim()){const R=w.toLowerCase();W=W.filter(E=>E.uri.toLowerCase().includes(R)||E.name?.toLowerCase().includes(R)||E.description?.toLowerCase().includes(R))}return W.map(rt)},e[34]=g,e[35]=$,e[36]=m,e[37]=F,e[38]=l,e[39]=n,e[40]=s,e[41]=y):y=e[41];const Z=y;let H;e[42]!==i?(H=U=>{if(i&&(i.current=U),U)_.current=Date.now(),S.current=!1,Q("chat_picker_opened",{picker:"@"});else{const w=_.current;Q("chat_picker_closed",{picker:"@",outcome:S.current?"selected":"dismissed",duration_ms:w?Date.now()-w:null}),_.current=null,d("categories")}},e[42]=i,e[43]=H):H=e[43];const ee=H;let V;return e[44]!==r||e[45]!==Z||e[46]!==q||e[47]!==ee||e[48]!==L?(V=h.jsx(de,{editor:r,char:"@",pluginKey:"atDropdownMenu",queryKey:L,queryFn:Z,onSelect:q,onOpenChange:ee}),e[44]=r,e[45]=Z,e[46]=q,e[47]=ee,e[48]=L,e[49]=V):V=e[49],V};function Ze(t){return{name:t.title,title:t.title,description:t.description??void 0,icon:t.icon??null,kind:"agent",agentId:t.id}}function et(t){return{name:he(t.uri,t.name),title:t.name,description:t.description,kind:"resource",uri:t.uri}}function tt(t){return{name:t.title,title:t.title,description:t.description??void 0,icon:t.icon??null,kind:"agent",agentId:t.id}}function st(){}function rt(t){return{name:he(t.uri,t.name),title:t.name,description:t.description,kind:"resource",uri:t.uri}}async function ie(t,e,r,s,i,o,l){try{const c=await pe(r,s,o);J(t,e,{id:s,name:fe(s,i),metadata:c.messages,char:"/",kind:"prompt",args:o})}catch(c){console.error("[slash] Failed to fetch prompt:",c),A.error(l.t("chat.mentionSlash.failedLoadPrompt"))}}async function nt(t,e,r,s,i){try{const o=await ue(r,s);J(t,e,{id:s,name:s,metadata:o.contents,char:"/",kind:"resource"})}catch(o){console.error("[slash] Failed to fetch resource:",o),A.error(i.t("chat.mentionSlash.failedLoadResource"))}}async function ot(t,e,r,s,i){try{const{files:o,omittedPaths:l}=await ze(r,s.volume,s.path),c={sandboxPath:s.sandboxPath,volume:s.volume,path:s.path,files:o,omittedPaths:l};J(t,e,{id:s.id,name:s.name,metadata:c,char:"/",kind:"skill"})}catch(o){console.error("[slash] Failed to fetch skill:",o),A.error(i.t("chat.mentionSlash.failedLoadSkill"))}}const it=({editor:t,virtualMcpId:e,suggestionOpenRef:r})=>{const s=G(),i=le(),{org:o}=ce(),l=me({connectionId:e,orgId:o.id,orgSlug:o.slug}),c=Y.virtualMcpPrompts(e,o.id),g=Y.virtualMcpResources(e,o.id),k=Y.slashSkills(o.id),m=["slash-mention",o.id,e??"default"],[p,n]=C.useState(null),[u,d]=C.useState(null),b=je(t);b&&(b.onEditChip=async a=>{if(l)try{const x=(await ae(i,c,l)).find(P=>P.name===a.promptId);if(!x?.arguments||x.arguments.length===0)return;d({...a,prompt:x})}catch(f){console.error("[slash] Failed to load prompt for editing:",f),A.error(s("chat.mentionSlash.failedLoadPrompt"))}});const F=C.useRef(null),_=C.useRef(!1),S=async({item:a,range:f})=>{if(Q("chat_picker_item_selected",{picker:"/",item_kind:a.kind,item_name:a.name}),_.current=!0,!!l)if(a.kind==="prompt"){if(a.arguments&&a.arguments.length>0){n({range:f,item:a});return}const x=se(a._meta);await ie(t,f,l,a.name,x,void 0,{t:s})}else a.kind==="skill"?a.skill&&await ot(t,f,o.slug,a.skill,{t:s}):a.uri&&await nt(t,f,l,a.uri,{t:s})},j=async a=>{if(!p||!l)return;const{range:f,item:x}=p,P=se(x._meta);await ie(t,f,l,x.name,P,a,{t:s}),n(null)},I=async a=>{if(!(!u||!l)){if(!ve(t,u.pos,u.promptId)){A.error(s("chat.mentionSlash.failedUpdatePrompt")),d(null);return}try{const f=await pe(l,u.promptId,a),x=se(u.prompt._meta);t.chain().focus().setNodeSelection(u.pos).deleteSelection().insertContentAt(u.pos,Me({id:u.promptId,name:fe(u.promptId,x),metadata:f.messages,char:"/",kind:"prompt",args:a})).run(),Q("chat_picker_item_selected",{picker:"/edit",item_kind:"prompt",item_name:u.promptId})}catch(f){console.error("[slash] Failed to update prompt:",f),A.error(s("chat.mentionSlash.failedUpdatePrompt"))}d(null)}},L=async a=>{const{query:f}=a;if(!l)return[];const[x,P,M]=await Promise.all([ae(i,c,l),lt(i,g,l),at(i,k,o.slug)]),v=f.trim().toLowerCase(),$=(x??[]).filter(y=>!v||y.name.toLowerCase().includes(v)||y.title?.toLowerCase().includes(v)||y.description?.toLowerCase().includes(v)).map(y=>({name:y.name,title:y.title,description:y.description,kind:"prompt",arguments:y.arguments,_meta:y._meta})),O=(P??[]).filter(y=>!v||y.uri.toLowerCase().includes(v)||y.name?.toLowerCase().includes(v)||y.description?.toLowerCase().includes(v)).map(y=>({name:y.name??y.uri,title:y.name,description:y.description,kind:"resource",uri:y.uri})),q=(M??[]).filter(y=>!v||y.name.toLowerCase().includes(v)||y.id.toLowerCase().includes(v)||y.description?.toLowerCase().includes(v)).map(y=>({name:y.name,title:y.name,description:y.description??void 0,kind:"skill",skill:y}));return[...$,...O,...q]},D=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 h.jsxs(h.Fragment,{children:[h.jsx(de,{editor:t,char:"/",pluginKey:"slashDropdownMenu",queryKey:m,queryFn:L,onSelect:S,onOpenChange:a=>{if(r&&(r.current=a),a)F.current=Date.now(),_.current=!1,Q("chat_picker_opened",{picker:"/"});else{const f=F.current;Q("chat_picker_closed",{picker:"/",outcome:_.current?"selected":"dismissed",duration_ms:f?Date.now()-f:null}),F.current=null}}}),h.jsx(ne,{prompt:D,setPrompt:()=>n(null),onSubmit:j}),h.jsx(ne,{prompt:u?.prompt??null,setPrompt:()=>d(null),onSubmit:I,defaultValues:u?.args},u?`edit-${u.promptId}-${u.pos}`:"edit-idle")]})};async function ae(t,e,r){let s=t.getQueryData(e);return s?t.fetchQuery({queryKey:e,queryFn:()=>oe(r),staleTime:6e4}).catch(()=>{}):s=await t.fetchQuery({queryKey:e,queryFn:()=>oe(r),staleTime:6e4}).catch(()=>{}),s?.prompts??[]}async function at(t,e,r){const s=t.getQueryData(e),i=()=>t.fetchQuery({queryKey:e,queryFn:()=>Je(r),staleTime:6e4});return s?(i().catch(()=>{}),s):i().catch(()=>[])}async function lt(t,e,r){let s=t.getQueryData(e);return s?t.fetchQuery({queryKey:e,queryFn:()=>z(r),staleTime:6e4}).catch(()=>{}):s=await t.fetchQuery({queryKey:e,queryFn:()=>z(r),staleTime:6e4}).catch(()=>{}),s?.resources??[]}const ge="Ask anything, / for prompts & skills, @ for agents & resources...";function ct(t){return[Te.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,dropcursor:!1}),_e.configure({placeholder:()=>t.current??ge,showOnlyWhenEditable:!1}),Ae,Ne]}function Ct({tiptapDoc:t,setTiptapDoc:e,disabled:r=!1,enterToSubmit:s=!1,placeholder:i,onSubmit:o,suggestionOpenRef:l,children:c}){const g=C.useRef(o),k=C.useRef(e),m=C.useRef(s),p=C.useRef(i),n=Le({extensions:ct(p),content:t||"",editorProps:{attributes:{"data-chat-input":"true",role:"textbox","aria-multiline":"true","aria-label":i??ge,class:"prose prose-sm max-w-none focus:outline-none w-full h-full text-[14px] max-md:text-base p-[18px]"},handleKeyDown:(u,d)=>d.key==="Enter"&&!d.shiftKey&&m.current&&!l?.current?(d.preventDefault(),g.current?.(),!0):!1},onUpdate:({editor:u})=>{k.current(u?.getJSON())}});return C.useEffect(()=>{n?.setEditable(!r)},[n,r]),C.useEffect(()=>{g.current=o},[o]),C.useEffect(()=>{k.current=e},[e]),C.useEffect(()=>{m.current=s},[s]),C.useEffect(()=>{p.current=i},[i]),C.useEffect(()=>{if(!n||n.isDestroyed)return;const u=JSON.stringify(n.getJSON()),d=JSON.stringify(t||{type:"doc",content:[]});u!==d&&n.commands.setContent(t||{type:"doc",content:[]})},[n,t]),h.jsx(Re.Provider,{value:{editor:n},children:c})}function St(t){const e=B.c(29),{disabled:r,virtualMcpId:s,showFileUploader:i,selectedModel:o,onUnsupportedFile:l,suggestionOpenRef:c,ref:g,className:k}=t,m=r===void 0?!1:r,p=i===void 0?!1:i,{editor:n}=Ee();let u,d;if(e[0]!==n?(u=()=>({focus:()=>{n?.commands.focus()},clear:()=>{n?.commands.clearContent(!0)},appendText:x=>{if(!n)return;const P=n.state.doc.textContent.trim()==="";n.commands.focus("end"),P||n.commands.insertContent(" "),n.commands.insertContent(x)},syncVoiceText:(x,P)=>{if(n&&(n.commands.setContent(x||{type:"doc",content:[]}),P)){n.commands.focus("end");const M=n.state.doc.textContent.trim().length>0;n.commands.insertContent({type:"text",text:M?" "+P:P})}},restoreContent:x=>{n&&n.commands.setContent(x||{type:"doc",content:[]})}}),d=[n],e[0]=n,e[1]=u,e[2]=d):(u=e[1],d=e[2]),C.useImperativeHandle(g??null,u,d),!n)return null;const b=m&&"cursor-not-allowed opacity-70",F=m&&"[&_.ProseMirror]:cursor-not-allowed";let _;e[3]!==k||e[4]!==b||e[5]!==F?(_=Se("overflow-y-auto relative flex-1 max-h-[164px] min-h-[20px] w-full flex flex-col",k,"[&_.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",b,F),e[3]=k,e[4]=b,e[5]=F,e[6]=_):_=e[6];let S;e[7]!==n||e[8]!==_?(S=h.jsx(Qe,{editor:n,className:_}),e[7]=n,e[8]=_,e[9]=S):S=e[9];const j=s??null;let I;e[10]!==n||e[11]!==c||e[12]!==j?(I=h.jsx(C.Suspense,{fallback:null,children:h.jsx(it,{editor:n,virtualMcpId:j,suggestionOpenRef:c})}),e[10]=n,e[11]=c,e[12]=j,e[13]=I):I=e[13];const L=s??null;let D;e[14]!==n||e[15]!==c||e[16]!==L?(D=h.jsx(C.Suspense,{fallback:null,children:h.jsx(Ge,{editor:n,virtualMcpId:L,suggestionOpenRef:c})}),e[14]=n,e[15]=c,e[16]=L,e[17]=D):D=e[17];let a;e[18]!==m||e[19]!==n||e[20]!==l||e[21]!==o||e[22]!==p?(a=p&&o&&!m?h.jsx(Ve,{editor:n,selectedModel:o,onUnsupportedFile:l}):null,e[18]=m,e[19]=n,e[20]=l,e[21]=o,e[22]=p,e[23]=a):a=e[23];let f;return e[24]!==I||e[25]!==D||e[26]!==a||e[27]!==S?(f=h.jsxs(h.Fragment,{children:[S,I,D,a]}),e[24]=I,e[25]=D,e[26]=a,e[27]=S,e[28]=f):f=e[28],f}export{Ct as T,bt as U,St as a,Be as p,Pt as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as k,j as h,r as C,m as L}from"./index-
|
|
1
|
+
import{c as k,j as h,r as C,m as L}from"./index-CwntHk8S.js";import{n as Z}from"./LinkBroken01-6J7zZ1XX.js";import{A as y}from"./agent-icon-DE4TWlDl.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};
|