decocms 4.528.0 → 4.530.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/{ActiveShapeUtils-Br894ljM.js → ActiveShapeUtils-DvZ4kp7j.js} +1 -1
- package/dist/client/assets/{AlertCircle-DwVsFaci.js → AlertCircle-BOP0_W_U.js} +1 -1
- package/dist/client/assets/{AreaChart-BpoQ8IcB.js → AreaChart-yTlVcJtZ.js} +1 -1
- package/dist/client/assets/{ArrowLeft-D0U_UeWA.js → ArrowLeft-TqR4Fgfq.js} +1 -1
- package/dist/client/assets/{ArrowUp-BHvj9x12.js → ArrowUp-C33jPuMc.js} +1 -1
- package/dist/client/assets/{BarChart-DSUrCO19.js → BarChart-DrtskOqN.js} +1 -1
- package/dist/client/assets/{Building02-4g278Kck.js → Building02-mn349zQD.js} +1 -1
- package/dist/client/assets/{CartesianChart-B8sjFfWU.js → CartesianChart-Dl6ED4Qn.js} +1 -1
- package/dist/client/assets/{CategoricalChart-C9NLmvFO.js → CategoricalChart-DZtGpsC8.js} +1 -1
- package/dist/client/assets/{CheckCircle-0mdIkBLG.js → CheckCircle-BCSSdEIk.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-BRbuqJl7.js → ChevronSelectorVertical-Bf_2MNcW.js} +1 -1
- package/dist/client/assets/{ChevronUp-Cn8PaBxH.js → ChevronUp-bG7QziWc.js} +1 -1
- package/dist/client/assets/{Copy01-D6STLVd9.js → Copy01-CCULGI20.js} +1 -1
- package/dist/client/assets/{CreditCard01-CAW-vU_p.js → CreditCard01-CSCSy42G.js} +1 -1
- package/dist/client/assets/{DotsVertical-C5Wc2qWf.js → DotsVertical-DKcUxvbN.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-ClrUuJb8.js → ErrorBarContext-CMcrOvhv.js} +1 -1
- package/dist/client/assets/{Globe04-COPfJ3z-.js → Globe04-DJ5nStZd.js} +1 -1
- package/dist/client/assets/{Image01-D00jtGx4.js → Image01-DBJ7dlcG.js} +1 -1
- package/dist/client/assets/{Key01-CiK2_UxI.js → Key01-EhXWdZXA.js} +1 -1
- package/dist/client/assets/{Link01-CEOBycf2.js → Link01-D3zxQ7B9.js} +1 -1
- package/dist/client/assets/{LinkBroken01-Bg7pBcuJ.js → LinkBroken01-DJ9tk8Nb.js} +1 -1
- package/dist/client/assets/{Minus-_SQ5lvlh.js → Minus-C_yGMjay.js} +1 -1
- package/dist/client/assets/{Monitor01-DyqIpSTl.js → Monitor01-HXiLn6G2.js} +1 -1
- package/dist/client/assets/{Play-BnWEmJaV.js → Play-CtPfgXDv.js} +1 -1
- package/dist/client/assets/{Plus-BPVKrQFz.js → Plus-DT_Y3SXq.js} +1 -1
- package/dist/client/assets/{ReferenceLine-_tT0r7bG.js → ReferenceLine-BoIeIT-2.js} +1 -1
- package/dist/client/assets/{SearchMd-OaBCBVrZ.js → SearchMd-g-czGrfP.js} +1 -1
- package/dist/client/assets/{Sector-mFZOIMSW.js → Sector-CXiTgTJg.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-GpZCrbBR.js → ShoppingBag01-TKNh_f0W.js} +1 -1
- package/dist/client/assets/{Sun-BG4-BfE7.js → Sun-D2qZhPc5.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-CMpEiSPu.js → SwitchHorizontal01-Cd-vTdga.js} +1 -1
- package/dist/client/assets/{Tool01-CIeMmnyv.js → Tool01-DZn57NDu.js} +1 -1
- package/dist/client/assets/{Trash01-BLXgUBsw.js → Trash01-Bw8Leo0g.js} +1 -1
- package/dist/client/assets/{Upload01-CgYtU1Ux.js → Upload01-DBuU3kZE.js} +1 -1
- package/dist/client/assets/{UserSquare-pnEdx237.js → UserSquare-lDfe1WCi.js} +1 -1
- package/dist/client/assets/{Users01-D-rlhQmk.js → Users01-B094G3md.js} +1 -1
- package/dist/client/assets/{XClose-yFNn0LgD.js → XClose-BZ7_Ux4e.js} +1 -1
- package/dist/client/assets/{ZoomOut-D8_eDbPl.js → ZoomOut-Bmxt_E04.js} +1 -1
- package/dist/client/assets/{access-gate-CCmKpIU6.js → access-gate-D_BS-DcG.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-MrHyqJnn.js → add-connection-dialog-CD5rNCCt.js} +1 -1
- package/dist/client/assets/agent-analytics-vthOPnN6.js +1 -0
- package/dist/client/assets/agent-app-n-Aif9MC.js +1 -0
- package/dist/client/assets/{agent-assets-DX3JCZz_.js → agent-assets-CzNeFhAl.js} +1 -1
- package/dist/client/assets/{agent-automation-BoPrO5n1.js → agent-automation-CJ9v34r4.js} +1 -1
- package/dist/client/assets/{agent-automations-Dj9SJC8y.js → agent-automations-gTSN0JNV.js} +1 -1
- package/dist/client/assets/{agent-calendar-CFKavSr7.js → agent-calendar-IRAVVe-8.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-guJSE0A3.js → agent-connect-sources-B53nGR4C.js} +1 -1
- package/dist/client/assets/agent-deck-D3R8f8cF.js +1 -0
- package/dist/client/assets/{agent-e2e--KzDh_gU.js → agent-e2e-CH6W1QQ7.js} +1 -1
- package/dist/client/assets/agent-experiments-CRDhAJbR.js +1 -0
- package/dist/client/assets/{agent-file-Cdm4fL8A.js → agent-file-D5Vi9cHA.js} +1 -1
- package/dist/client/assets/{agent-hosting-DewUrxzP.js → agent-hosting-B4ezToSE.js} +1 -1
- package/dist/client/assets/{agent-icon-I45DkNr8.js → agent-icon-Bss_DO5K.js} +1 -1
- package/dist/client/assets/agent-library-DU6N23OR.js +1 -0
- package/dist/client/assets/agent-library-file-DD6y_E54.js +1 -0
- package/dist/client/assets/agent-monitor-CXnnFky_.js +1 -0
- package/dist/client/assets/{agent-overview-D6KewKsA.js → agent-overview-CcHA5SNR.js} +1 -1
- package/dist/client/assets/{agent-releases-K-5ZFdWb.js → agent-releases-f23knj6h.js} +1 -1
- package/dist/client/assets/agent-settings-e1pgmpw5.js +1 -0
- package/dist/client/assets/{agent-site-editor-5gjIAuRv.js → agent-site-editor-CTB1ccaH.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-ccGdn-Hd.js +2 -0
- package/dist/client/assets/agent-site-editor-content-Cs2mbasv.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-CjLUuUK-.js +1 -0
- package/dist/client/assets/agent-view-DyJhvPdi.js +1 -0
- package/dist/client/assets/{agent-view-guard-CiKD3WZM.js → agent-view-guard-Glj0vRyr.js} +1 -1
- package/dist/client/assets/{agents-list-Bm03MUBc.js → agents-list-Bi5TXBHx.js} +1 -1
- package/dist/client/assets/{ai-providers--gYjttQ2.js → ai-providers-B-8sjV9j.js} +1 -1
- package/dist/client/assets/{alert-CRToIlco.js → alert-Dv_m1jIZ.js} +1 -1
- package/dist/client/assets/{analytics-sections-CNk_D8Ba.js → analytics-sections-BCtwnwxr.js} +1 -1
- package/dist/client/assets/{analytics-tab-BmUlDGzX.js → analytics-tab-PU6dzTDv.js} +1 -1
- package/dist/client/assets/api-keys-BJJzdb0A.js +1 -0
- package/dist/client/assets/{api-keys-MdTn4EBK.js → api-keys-_u2bDol0.js} +1 -1
- package/dist/client/assets/{app-editor-DLDQxSbu.js → app-editor-BX_pUpeA.js} +1 -1
- package/dist/client/assets/{asset-utils-B46ygA_L.js → asset-utils-BUlvPqYt.js} +1 -1
- package/dist/client/assets/{auth-catchall-WOw2KABS.js → auth-catchall-BdUzb1Pt.js} +1 -1
- package/dist/client/assets/{auth-entry-D8h4o_s7.js → auth-entry-DtnFIFL2.js} +1 -1
- package/dist/client/assets/{auth-AQB7DTaB.js → auth-kFzpcapr.js} +1 -1
- package/dist/client/assets/{auth-split-layout-D1niEerJ.js → auth-split-layout-2nmiIKmw.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-08aLFUVr.js → authenticate-and-persist-oauth-D5qGprX9.js} +1 -1
- package/dist/client/assets/{automation-list-row-D9muuYwH.js → automation-list-row-BPnRwXLB.js} +1 -1
- package/dist/client/assets/{automation-runs-Cu7hhQJb.js → automation-runs-DKb200eV.js} +1 -1
- package/dist/client/assets/{automations-Ct6FcxrV.js → automations-BW2Pm3L7.js} +1 -1
- package/dist/client/assets/{autosend-CxxtAFJ_.js → autosend-Byl7Kst-.js} +1 -1
- package/dist/client/assets/{badge-zxuYXquF.js → badge-C-BSS2Yn.js} +1 -1
- package/dist/client/assets/{block-document-D4CMkt4c.js → block-document-BY26DfN7.js} +3 -3
- package/dist/client/assets/{blocks-preview-workspace-context-LeIpajCL.js → blocks-preview-workspace-context-BoznkXgh.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-BrRgLQ_Y.js → blocks-tab-states-BsLUNSHT.js} +1 -1
- package/dist/client/assets/{blog-schema-B4i8W-yj.js → blog-schema-2lf7HGSD.js} +1 -1
- package/dist/client/assets/{buckets-CQWPtT87.js → buckets-D_afurG7.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-CpbAFEGo.js → build-improve-prompt-doc-DgvtLON3.js} +1 -1
- package/dist/client/assets/{calendar-C7teLmhJ.js → calendar-CdQftUWj.js} +1 -1
- package/dist/client/assets/{capability-load-error-lTXihmQk.js → capability-load-error-xQmp44p-.js} +1 -1
- package/dist/client/assets/category-editor-vOblLSz6.js +1 -0
- package/dist/client/assets/{cdn-tab-BstEuIpQ.js → cdn-tab-BxFGf6S7.js} +1 -1
- package/dist/client/assets/{chart-DVgatavr.js → chart-Q4A9_vVd.js} +1 -1
- package/dist/client/assets/{chat-context-DIvwe-Wr.js → chat-context-CS6VicT4.js} +1 -1
- package/dist/client/assets/{chat-draft-DByw699W.js → chat-draft-VQFS_4wA.js} +1 -1
- package/dist/client/assets/{checkbox-CW4Dzojp.js → checkbox-CKXQp3Az.js} +1 -1
- package/dist/client/assets/{choose-editor-zIlz3nud.js → choose-editor-DJDGvcjS.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CYE6hkOe.js → cli-auth-success-BMF85xbe.js} +1 -1
- package/dist/client/assets/{client-icons-DL1p9F4w.js → client-icons-D7bNXOKu.js} +1 -1
- package/dist/client/assets/cms-settings-editor-DRzsX4We.js +1 -0
- package/dist/client/assets/{collapsible-zPk-2gi_.js → collapsible-BRjo2C7P.js} +1 -1
- package/dist/client/assets/{collection-detail-Drfng1H4.js → collection-detail-JZh-OwkO.js} +1 -1
- package/dist/client/assets/{collection-display-button-DPvQVdd-.js → collection-display-button-Dysq40FS.js} +1 -1
- package/dist/client/assets/{collection-search-kUVZkueq.js → collection-search-D1wDrhDt.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-vDq2vkVG.js → collection-table-wrapper-CcBN0zuI.js} +1 -1
- package/dist/client/assets/{collection-tabs-C3pu5E-Q.js → collection-tabs-oJVN40cq.js} +1 -1
- package/dist/client/assets/{column-rules-Dz5XFx3r.js → column-rules-BsFrVRCt.js} +1 -1
- package/dist/client/assets/{combobox-BZSt-sf0.js → combobox-DnggoquQ.js} +1 -1
- package/dist/client/assets/{command-CSPNVB8c.js → command-RRas5VNC.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-HHphF1lt.js → companion-mcps-section-82FwEnBT.js} +1 -1
- package/dist/client/assets/{config-B7tLWM1b.js → config-yv1vcB07.js} +1 -1
- package/dist/client/assets/{connect-BK8j-UfV.js → connect-DQYxewxl.js} +1 -1
- package/dist/client/assets/{connect-layout-BC5qZusj.js → connect-layout-CSqNYyzb.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-Ch0tynWX.js → connect-source-dialog-BEXUazdA.js} +1 -1
- package/dist/client/assets/{connection-amzL9L9Z.js → connection-CH3Z1KCr.js} +1 -1
- package/dist/client/assets/{connection-card-D8aS8J6Q.js → connection-card-BF5BfmLL.js} +1 -1
- package/dist/client/assets/{connection-detail-Cu7F0ogE.js → connection-detail-DuqznM8O.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-TT6AKW6f.js → connection-form-helpers-Cpd6u6JQ.js} +1 -1
- package/dist/client/assets/{connections-B29MQqZW.js → connections-BYHjY91l.js} +1 -1
- package/dist/client/assets/content-tab-mCOWekqN.js +22 -0
- package/dist/client/assets/context-DdW3O60M.js +1 -0
- package/dist/client/assets/{context-menu-CFt3f_Gb.js → context-menu-D_BKuwIH.js} +1 -1
- package/dist/client/assets/{context-shell-KhGmYnbX.js → context-shell-CIoIJ4XQ.js} +3 -3
- package/dist/client/assets/{core.esm-Brf7c66K.js → core.esm-Bd-SITM_.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-Dshiy6sU.js → create-organization-dialog-B-QOCOL_.js} +1 -1
- package/dist/client/assets/{daily-pulse-DglWu2t-.js → daily-pulse-CTP_9_pD.js} +1 -1
- package/dist/client/assets/{discover-BLv8PWTL.js → discover-B6JRkvo1.js} +1 -1
- package/dist/client/assets/{domain-settings-7tpPEEzB.js → domain-settings-YDH2na3C.js} +1 -1
- package/dist/client/assets/{drawer-w05H8pBO.js → drawer-H8aSAwJp.js} +1 -1
- package/dist/client/assets/{editor-CiOoO-Ym.js → editor-DvPX7u6U.js} +1 -1
- package/dist/client/assets/{editor-classes-DNAm8ZAW.js → editor-classes-CnGnA58J.js} +1 -1
- package/dist/client/assets/{empty-state-BiIeVz7z.js → empty-state-BzyULwUr.js} +1 -1
- package/dist/client/assets/{empty-state-ErDRcN-P.js → empty-state-DXzhbFKQ.js} +1 -1
- package/dist/client/assets/{experiments-tab-choice-CY-Qbhut.js → experiments-tab-choice-DEkj0Qn-.js} +1 -1
- package/dist/client/assets/{experiments-tab-BghFguNv.js → experiments-tab-wFwzIEjh.js} +1 -1
- package/dist/client/assets/{extract-connection-data-C02FZ5zb.js → extract-connection-data-B6GxSzL3.js} +1 -1
- package/dist/client/assets/{feature-gate-CE1MLoN2.js → feature-gate-BOfmLcrg.js} +1 -1
- package/dist/client/assets/{feature-paywall-C560RaP5.js → feature-paywall-BuJHEFXn.js} +1 -1
- package/dist/client/assets/{file-explorer-CVmiakjw.js → file-explorer-By08wQDy.js} +1 -1
- package/dist/client/assets/{file-preview-Cc6_BSbv.js → file-preview-ZIUn5Oc5.js} +1 -1
- package/dist/client/assets/{file-share-button-Do4wEYep.js → file-share-button-0HRLJOC3.js} +1 -1
- package/dist/client/assets/{file-type-icon-CeBZX69W.js → file-type-icon-B1YNwd4s.js} +1 -1
- package/dist/client/assets/{folder-icon-DgtIAyY7.js → folder-icon-BugfSbt-.js} +1 -1
- package/dist/client/assets/{form-nJy5zMPE.js → form-CgSRndK2.js} +1 -1
- package/dist/client/assets/{general-BOPFN5z3.js → general-BfYy1nfq.js} +1 -1
- package/dist/client/assets/{held-block-view-tvHMvR4T.js → held-block-view-DJ-L3NcY.js} +3 -3
- package/dist/client/assets/{home-CcsI1NKl.js → home-BMSRZeBG.js} +1 -1
- package/dist/client/assets/{hosted-publish-feedback-DxOmBJxT.js → hosted-publish-feedback-D0Bdh4ip.js} +1 -1
- package/dist/client/assets/{icon-button-Xe7zTqiw.js → icon-button-DLFu-3bH.js} +1 -1
- package/dist/client/assets/{index-Cjzst5W1.js → index-8rk0r3sf.js} +1 -1
- package/dist/client/assets/{index-Ce7G0he3.js → index-B0tOn0op.js} +49 -49
- package/dist/client/assets/{index-tffbmy1v.js → index-B3SUdR5w.js} +1 -1
- package/dist/client/assets/{index-BzwMZ-96.js → index-BDe6L_Fs.js} +1 -1
- package/dist/client/assets/{index-CcnAFkjW.js → index-BGhAnNs4.js} +1 -1
- package/dist/client/assets/{index-uE3tVNL6.js → index-Bf7bXfI5.js} +1 -1
- package/dist/client/assets/{index-BD0IquFc.js → index-C33RBt6x.js} +1 -1
- package/dist/client/assets/{index-B8jtRR0H.js → index-CEFh9jFo.js} +1 -1
- package/dist/client/assets/{index-BJTbyKBB.js → index-CtJrnLrV.js} +1 -1
- package/dist/client/assets/{index-DZ7OjEm4.js → index-CvbPbFXs.js} +1 -1
- package/dist/client/assets/{index-Dm-21QtS.js → index-DJcLj00C.js} +1 -1
- package/dist/client/assets/{index-ComxOMRa.js → index-DV5SNfGk.js} +1 -1
- package/dist/client/assets/{index-BK_RqkJq.js → index-MNuVL2v0.js} +1 -1
- package/dist/client/assets/{index-DjOPmK0D.js → index-fCRLOlgL.js} +1 -1
- package/dist/client/assets/{index-xw_Jw9LH.js → index-qRJs3nwP.js} +1 -1
- package/dist/client/assets/{index-redirect-BRlBNfxv.js → index-redirect-CWZlZdIG.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-BJujpYxh.js → infiniteQueryObserver-Qk75Yfno.js} +1 -1
- package/dist/client/assets/{infra-billing-C0m6hfZU.js → infra-billing-Cfn8EhrD.js} +1 -1
- package/dist/client/assets/{input-B45cW293.js → input-CMV7rkdx.js} +3 -3
- package/dist/client/assets/{input-CzPtcD68.js → input-DgTSqztG.js} +1 -1
- package/dist/client/assets/{integration-icon-Cs3IASPS.js → integration-icon-DH6bJTbT.js} +1 -1
- package/dist/client/assets/{jira-icon-BuriBSdU.js → jira-icon-BaiExl6h.js} +1 -1
- package/dist/client/assets/{label-ivnVLsJB.js → label-DjW9Efu-.js} +1 -1
- package/dist/client/assets/{layout-CZlIpVTU.js → layout-DBDQq16Z.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-DMpNnXol.js → legacy-agents-deep-DqjLAu69.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-CBL3GGt7.js → legacy-main-redirect-BqH36-dH.js} +1 -1
- package/dist/client/assets/library-DeXuJevF.js +1 -0
- package/dist/client/assets/{login-ByMZv8aL.js → login-LlR_PFwv.js} +1 -1
- package/dist/client/assets/{markdown-UmudOdor.js → markdown-CXmgfCfV.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-PAwZvEJj.js → mcp-app-renderer-CymHe0GL.js} +1 -1
- package/dist/client/assets/{mcp-oauth-Cz4RwYAs.js → mcp-oauth-BqcW0NNd.js} +1 -1
- package/dist/client/assets/{mcp-oauth-qpkBxX91.js → mcp-oauth-DPBTJBcB.js} +1 -1
- package/dist/client/assets/{members-DcVu4FNR.js → members-D4WInpkb.js} +1 -1
- package/dist/client/assets/{memory-C_hVYwsN.js → memory-5CntRYao.js} +1 -1
- package/dist/client/assets/{mini-report-page-DqysKZ5e.js → mini-report-page-CR4VtCxS.js} +1 -1
- package/dist/client/assets/mock-board-DJMG3prV.js +81 -0
- package/dist/client/assets/{monaco-editor-Cc-5fhHI.js → monaco-editor-SOR0aZJh.js} +1 -1
- package/dist/client/assets/{monitoring-DVujO52F.js → monitoring-aIV3430W.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DosbF5BV.js → monitoring-stats-row-Jq_9Q3cq.js} +1 -1
- package/dist/client/assets/{multi-select-DHn_nlnM.js → multi-select-5T86gKsk.js} +1 -1
- package/dist/client/assets/{mustache-CKGDjf9j.js → mustache-BrfO16w7.js} +1 -1
- package/dist/client/assets/{named-rule-uses-Drzf8cgA.js → named-rule-uses-CWvSr5mm.js} +1 -1
- package/dist/client/assets/{new-project-dialog-D3vjD1Ks.js → new-project-dialog-CwbZzsMX.js} +1 -1
- package/dist/client/assets/{oauth-callback-D5wWKok2.js → oauth-callback-BQ6KU-zk.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BKG0BbMN.js → oauth-callback-ai-provider-BWTljUMd.js} +1 -1
- package/dist/client/assets/{onboarding-Ci8OMwC9.js → onboarding-UUqqxcRk.js} +1 -1
- package/dist/client/assets/{openai-conversation-D9RDSbbV.js → openai-conversation-DXu_ai6d.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-L0iLKNqt.js → optimistic-project-sidebar-views-C4KEBYns.js} +1 -1
- package/dist/client/assets/{order-monitor-day-CYrv-YPX.js → order-monitor-day-BTKxNXuV.js} +1 -1
- package/dist/client/assets/{organization-choice-DS1Td5mt.js → organization-choice-CJj1aLLE.js} +1 -1
- package/dist/client/assets/{orgs-BdW5vuy7.js → orgs-g3G6AdOe.js} +1 -1
- package/dist/client/assets/{page-seo-form-4Td1Bwhl.js → page-seo-form-Cd3pqfx8.js} +1 -1
- package/dist/client/assets/{pair-D40XxJSs.js → pair-BS_IW-xJ.js} +1 -1
- package/dist/client/assets/{parse-sections-6LYwkRXc.js → parse-sections-Dr39BWrW.js} +1 -1
- package/dist/client/assets/{plan-ladder-DyKNTGpe.js → plan-ladder-DPUUy26C.js} +1 -1
- package/dist/client/assets/{plan-B5MpX63p.js → plan-w_bsMJ9F.js} +1 -1
- package/dist/client/assets/{popover-BF3N_cWR.js → popover-BNB2WAex.js} +1 -1
- package/dist/client/assets/post-calendar-CHV8XEbR.js +1 -0
- package/dist/client/assets/{post-editor-DlfqwxIk.js → post-editor-CLmTc6Vu.js} +1 -1
- package/dist/client/assets/{preview-content-BV8Fh5Qw.js → preview-content-BkRMOITc.js} +1 -1
- package/dist/client/assets/{preview-dialog-BmUPiPPl.js → preview-dialog-BYTdTSd2.js} +1 -1
- package/dist/client/assets/{preview-panel-llvMLYPZ.js → preview-panel-DXXylmoB.js} +1 -1
- package/dist/client/assets/{preview-tab-DieLxroc.js → preview-tab-D9YpAMyB.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-DVInlx3E.js → product-picker-dialog-WMQXlZUo.js} +1 -1
- package/dist/client/assets/{profile-BeQa-VCG.js → profile-DLCwlVCc.js} +1 -1
- package/dist/client/assets/{project-app-view-Cey1t0qJ.js → project-app-view-B-s_ilf4.js} +1 -1
- package/dist/client/assets/{project-apps-B_x_Bovr.js → project-apps-DgFIeSYf.js} +1 -1
- package/dist/client/assets/{project-feed-CFTw8-Bu.js → project-feed-u80jGsBM.js} +1 -1
- package/dist/client/assets/{project-icon-Cgbmeoa9.js → project-icon-DpS1PVmR.js} +1 -1
- package/dist/client/assets/project-reports-BUpmOe9y.js +1 -0
- package/dist/client/assets/project-tasks-B5gIJMoD.js +1 -0
- package/dist/client/assets/{projects-Cadx_2S-.js → projects-BQFTIIlv.js} +1 -1
- package/dist/client/assets/{projects-empty-state-B0sxQqwF.js → projects-empty-state-B1rOjHBT.js} +1 -1
- package/dist/client/assets/{prompts-B6yRUPTQ.js → prompts-BwDjnPim.js} +1 -1
- package/dist/client/assets/record-editor-B87aHfte.js +1 -0
- package/dist/client/assets/{redirect-editor-UO7ym99V.js → redirect-editor-DIUdga9p.js} +1 -1
- package/dist/client/assets/{releases-api-Dz4kituq.js → releases-api-CbLHrT57.js} +1 -1
- package/dist/client/assets/{reports-BN03l_kE.js → reports-BY7Ys0O3.js} +1 -1
- package/dist/client/assets/reports-Bv95v9-B.js +1 -0
- package/dist/client/assets/{reports-onboarding-CXYw21hI.js → reports-onboarding-sD19crIX.js} +1 -1
- package/dist/client/assets/{reports-tab-DNDxSx2i.js → reports-tab-CXYw7uK_.js} +2 -2
- package/dist/client/assets/repositories-5RE7P1Fj.js +1 -0
- package/dist/client/assets/{repositories-DkDpuhbE.js → repositories-B0n3HOv9.js} +1 -1
- package/dist/client/assets/{repository-binding-Dg4XMxXs.js → repository-binding-DBKiXzE_.js} +1 -1
- package/dist/client/assets/{repository-import-picker-BZ7PPi9W.js → repository-import-picker-BW6Sgxp6.js} +1 -1
- package/dist/client/assets/{repository-picker-aA12wSzy.js → repository-picker-CC5H8ljW.js} +1 -1
- package/dist/client/assets/{require-capability-CXN6JJ5S.js → require-capability-COWPBR01.js} +1 -1
- package/dist/client/assets/{required-auth-layout-pDiTStrv.js → required-auth-layout-CiEz7oyV.js} +1 -1
- package/dist/client/assets/{reset-password-CRhNEOOs.js → reset-password-CRw2eYcE.js} +1 -1
- package/dist/client/assets/{resizable-HiC69AzM.js → resizable-BnHppfEe.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-DdbyVt-l.js → resolve-tab-icon-Bo7Cblp-.js} +1 -1
- package/dist/client/assets/{review-settings-BdnOsmg6.js → review-settings-c5PLuzL1.js} +1 -1
- package/dist/client/assets/{roles-C54CSjKN.js → roles-Ch2duQPh.js} +1 -1
- package/dist/client/assets/route-6_F9Lvsg.js +1 -0
- package/dist/client/assets/{route-19TfZ9Nu.js → route-D6dIow4H.js} +1 -1
- package/dist/client/assets/{route-ChUurj1a.js → route-DBe1uYBt.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-C-6LRZKK.js → sandbox-lifecycle-context-BcTeO4Q3.js} +1 -1
- package/dist/client/assets/{schema-4d6JAPZJ.js → schema-C7U_cF_C.js} +1 -1
- package/dist/client/assets/{schema-DjHUnA9X.js → schema-DuXRpy1C.js} +1 -1
- package/dist/client/assets/{scroll-area-DmCvljJ6.js → scroll-area-BYf7WryG.js} +1 -1
- package/dist/client/assets/{search-input-DuxKe01B.js → search-input-Bl81W1Nh.js} +1 -1
- package/dist/client/assets/{search-toggle-5fjHehxP.js → search-toggle-BR2ntzDz.js} +1 -1
- package/dist/client/assets/{secret-picker-gnCLcdHl.js → secret-picker-CYFTZf4e.js} +1 -1
- package/dist/client/assets/{secrets-1Q0KkbT2.js → secrets-vKVDoP1f.js} +1 -1
- package/dist/client/assets/{section-array-field-DJWSUlEO.js → section-array-field-DUVFffgC.js} +1 -1
- package/dist/client/assets/{sections-editor-Cd0e4qhb.js → sections-editor-CcMaFbqS.js} +1 -1
- package/dist/client/assets/{sections-BFagCGU_.js → sections-y7v9FSuQ.js} +1 -1
- package/dist/client/assets/{select-BU91L4uy.js → select-BqKA-vqL.js} +1 -1
- package/dist/client/assets/{select-model-CtxoaFb9.js → select-model-BGFnOFCQ.js} +1 -1
- package/dist/client/assets/{seo-editor-dOpYS1fH.js → seo-editor-Zi_CHSPY.js} +1 -1
- package/dist/client/assets/{separator-C2eDbIfB.js → separator-B8n6kHAZ.js} +1 -1
- package/dist/client/assets/settings-tab-KnQUkP6Y.js +1 -0
- package/dist/client/assets/{sheet-CyFkbR9Y.js → sheet-BAxFoa2_.js} +1 -1
- package/dist/client/assets/{shell-layout-DjxWvBNL.js → shell-layout-CV6pDkTS.js} +1 -1
- package/dist/client/assets/site-draft-actions-Bgz-FOQK.js +3 -0
- package/dist/client/assets/{site-draft-view-DmpsxvZd.js → site-draft-view-DHafi4O7.js} +2 -2
- package/dist/client/assets/site-editor-BNlcB92o.js +1 -0
- package/dist/client/assets/{site-editor-toast-DwH2UhLV.js → site-editor-toast-DlVUb8vV.js} +1 -1
- package/dist/client/assets/{skills-CEjNG6HD.js → skills-BtMvbWCD.js} +1 -1
- package/dist/client/assets/{slider-wRMQIU5C.js → slider-KvVzGkcV.js} +1 -1
- package/dist/client/assets/{sortable.esm-GfRDqHVM.js → sortable.esm-CHgVwe8S.js} +1 -1
- package/dist/client/assets/{sso-ou3AfF03.js → sso-DuuvDFz4.js} +1 -1
- package/dist/client/assets/{suggestion-GTJqe6wD.js → suggestion-Cmvr6ozT.js} +1 -1
- package/dist/client/assets/{switch-Be6f0Lf5.js → switch-DqbfJ6XC.js} +1 -1
- package/dist/client/assets/{symbol-D9upvJXv.js → symbol-BkEjWtZb.js} +1 -1
- package/dist/client/assets/{synced-repos-BMxqOtvT.js → synced-repos-BxtXsnIq.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-ixZicBgd.js → tab-icon-glyph-RtjNPv4h.js} +1 -1
- package/dist/client/assets/{table-Sgqiv7ow.js → table-Ch8y7OxX.js} +1 -1
- package/dist/client/assets/{tabs-CTBn6AHY.js → tabs-CvTwctdA.js} +1 -1
- package/dist/client/assets/{task-assignee-avatar-CgqfXsXT.js → task-assignee-avatar-DWyVzTkD.js} +1 -1
- package/dist/client/assets/{task-board-B-WXUk04.js → task-board-BN1n0sAA.js} +1 -1
- package/dist/client/assets/{task-route-D7L_AjBa.js → task-route-WFFRmRkj.js} +1 -1
- package/dist/client/assets/{task-status-D47mg_UC.js → task-status-DSSpycnv.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-BXOv_DdG.js → taskboard-analytics-xsNPy8N8.js} +1 -1
- package/dist/client/assets/{tasks-DRiqBj-N.js → tasks-D5PsurKg.js} +1 -1
- package/dist/client/assets/tasks-DqBBZHH6.js +1 -0
- package/dist/client/assets/{textarea-CiBj0MLq.js → textarea-Ce3-2mS-.js} +1 -1
- package/dist/client/assets/{thread-analytics-apzZ--go.js → thread-analytics-D6o0TQdW.js} +1 -1
- package/dist/client/assets/{thread-intent-ClCyX82j.js → thread-intent-Ckrry8zY.js} +1 -1
- package/dist/client/assets/{thread-route-D14ghtgQ.js → thread-route-B2QRkxdS.js} +1 -1
- package/dist/client/assets/{thread-route-CFct_VQa.js → thread-route-dALO1ggR.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-BCarr4x7.js → thread-sheet-body-O6J2hk4T.js} +1 -1
- package/dist/client/assets/{time-range-picker-C3_uZ5O2.js → time-range-picker-BdhPN_P3.js} +1 -1
- package/dist/client/assets/{toggle-group-BVSslRda.js → toggle-group-DplSVqNV.js} +1 -1
- package/dist/client/assets/{tool-namespace-C-2tGGMF.js → tool-namespace-Ca_f3ged.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-3L1Mfrbu.js → toolbar-icon-button-BU_Lc1T3.js} +1 -1
- package/dist/client/assets/{tooltip-BHLCIkH9.js → tooltip-CgglVi9W.js} +1 -1
- package/dist/client/assets/{tooltipContext-BMB7e6XT.js → tooltipContext-C2kbIrVy.js} +1 -1
- package/dist/client/assets/{track-DUL7obAK.js → track-y4KgSLRA.js} +1 -1
- package/dist/client/assets/{types-9H7KFAzM.js → types-Df2OBpZL.js} +1 -1
- package/dist/client/assets/{url-slug-CrYfl8wu.js → url-slug-CiVvW5vP.js} +1 -1
- package/dist/client/assets/{usage-stats-CtXF_bWd.js → usage-stats-DK8XMQvR.js} +1 -1
- package/dist/client/assets/{use-ai-providers-DmHiyABc.js → use-ai-providers-hxbNecrE.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-DnrC-2Y6.js → use-apply-named-rule-CGvl7OA7.js} +1 -1
- package/dist/client/assets/{use-automations-BeX04Bm6.js → use-automations-eL46w5sy.js} +1 -1
- package/dist/client/assets/{use-autosave-Civ5dqYG.js → use-autosave-0ySBC_GL.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-DEHPkPVs.js → use-chat-layout-state-BSTkVYBd.js} +1 -1
- package/dist/client/assets/{use-clock-tick-C1thlLib.js → use-clock-tick-Ck7vSkhv.js} +1 -1
- package/dist/client/assets/use-cms-publish-actions-CNrHUo7H.js +10 -0
- package/dist/client/assets/{use-connect-companion-XN72CB3K.js → use-connect-companion-KqiIqJ2t.js} +1 -1
- package/dist/client/assets/{use-connection-DdV5v_sO.js → use-connection-EUcmc_O-.js} +1 -1
- package/dist/client/assets/{use-copy-DGCMROZD.js → use-copy-CE87YLnn.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CYamK9uo.js → use-create-virtual-mcp-9RehQdtY.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-RvTpk_ov.js → use-date-fns-locale-4LRMo-Iu.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CCKD06RC.js → use-debounced-autosave-DjMsuM5_.js} +1 -1
- package/dist/client/assets/{use-debounced-value-D4hMc82O.js → use-debounced-value-CthHwE3s.js} +1 -1
- package/dist/client/assets/{use-deco-credits-8Cm_6S2l.js → use-deco-credits-BbBcoaKj.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CMhdGvid.js → use-decopilot-events-PGYGrQrr.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DczFLZ2h.js → use-delete-connection-D4r9W5uz.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-D33YqaOd.js → use-deployment-admin-C_gdAaQL.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-5-OqnV1z.js → use-fast-preview-draft-url-B55YeUkV.js} +1 -1
- package/dist/client/assets/{use-file-configs-B-dtUlcn.js → use-file-configs-CYRdd8Dm.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-DgAPUhXS.js → use-inbox-feed-D9h8ltqT.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-Boo11DpH.js → use-infinite-scroll-B-uSWzNc.js} +1 -1
- package/dist/client/assets/{use-join-requests-WGDHodyD.js → use-join-requests-BUZPOPVU.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-D8UhTy5h.js → use-main-panel-tabs-Bk1EtVnG.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-Ue891t8t.js → use-mcp-auth-status-3nUlBDBy.js} +1 -1
- package/dist/client/assets/{use-mcp-client-B9-9jnHW.js → use-mcp-client-DJpi4PM5.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-Duq-F4uG.js → use-mcp-prompts-wOk1Vinz.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DvCVc1NG.js → use-mcp-tools-Bfcp5LpM.js} +1 -1
- package/dist/client/assets/{use-mobile-BZz7cwuI.js → use-mobile-D1VdMSzS.js} +1 -1
- package/dist/client/assets/{use-move-blocks-DUpXqrhw.js → use-move-blocks-Dg9U_Nb8.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CEpb-TPy.js → use-navigate-to-agent-CCS7aqQS.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-AHjpaAXa.js → use-open-billing-url-BixRtMzE.js} +1 -1
- package/dist/client/assets/{use-org-fs-8kFrjmMH.js → use-org-fs-CeGf0w9Y.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-DHiYUCj6.js → use-org-repo-syncs-BfOEx3n_.js} +1 -1
- package/dist/client/assets/{use-org-sso-l3h7LAOC.js → use-org-sso-DMyNEVzj.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DWGBtp2u.js → use-organization-roles-DAWtiUfW.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DAQWwUyU.js → use-organization-settings-DPGSLMns.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-C-mQZt-r.js → use-panel-navigate-Bgyt5CHg.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-D2zRgAqZ.js → use-project-native-view-presence-C-gVs4yc.js} +1 -1
- package/dist/client/assets/{use-project-scope-DYBc2cnp.js → use-project-scope-CzfpwfYe.js} +1 -1
- package/dist/client/assets/{use-recent-apps-CahLdkOq.js → use-recent-apps-Ynx2etJA.js} +1 -1
- package/dist/client/assets/{use-releases-Drxi11Hn.js → use-releases-C6WrYJK9.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-C0y8CLzl.js → use-reports-diagnostic-BTM7hE_9.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-DKnAt9WL.js → use-sandbox-events-h5DHAMj7.js} +1 -1
- package/dist/client/assets/{use-secrets-CCJcL_mR.js → use-secrets-C3TBzGsD.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-yGU9kv3R.js → use-section-preview-base-DUpmdDxV.js} +1 -1
- package/dist/client/assets/{use-session-runtime-CL3Ry0XG.js → use-session-runtime-Cr5FejOR.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-CbzeRAk-.js → use-sidebar-collapsed-83oP_cPD.js} +1 -1
- package/dist/client/assets/{use-tags-Af_mmSB1.js → use-tags-Cb5ZtoLA.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-BkPBycom.js → use-task-board-analytics-DdbcnB93.js} +1 -1
- package/dist/client/assets/{use-task-board-events-Bs2sMvhO.js → use-task-board-events-iZ165E68.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-DtKTjCYS.js → use-task-board-item-prs-k6qHY43S.js} +1 -1
- package/dist/client/assets/{use-task-metadata-CaEOmtPV.js → use-task-metadata-DkMgTFSM.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-DFAhXiiU.js → use-thread-analytics-BqMf8Bru.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-wHP5lV5E.js → use-thread-outputs-CQhptiZl.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-B3u_qeyw.js +1 -0
- package/dist/client/assets/{useQueries-bayVPMWC.js → useQueries-BonGRGF_.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-0NVyrPzv.js +1 -0
- package/dist/client/assets/{users-BXC7BZTC.js → users-DlCEgHwN.js} +1 -1
- package/dist/client/assets/{utils-C_XIOzcP.js → utils-BBkAOZCB.js} +1 -1
- package/dist/client/assets/{variant-calendar-DqsG-wJ9.js → variant-calendar-CkyDXDJQ.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-BfAJFrjh.js → variant-matcher-override-Ce2rdmeW.js} +1 -1
- package/dist/client/assets/{view-header-BlWEzmVd.js → view-header-DQbofxq8.js} +1 -1
- package/dist/client/assets/{virtual-mcp-BfSfmNNT.js → virtual-mcp-BI04Wiyg.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-D5nA1051.js → watch-sse-pool-BAzbGHBs.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-analytics-wllTP-xB.js +0 -1
- package/dist/client/assets/agent-app-MGvu076D.js +0 -1
- package/dist/client/assets/agent-deck-CdHFig9V.js +0 -1
- package/dist/client/assets/agent-experiments-pgMnsFIB.js +0 -1
- package/dist/client/assets/agent-library-DjU97YsS.js +0 -1
- package/dist/client/assets/agent-library-file-DXHCBJAM.js +0 -1
- package/dist/client/assets/agent-monitor-Bucu2iO3.js +0 -1
- package/dist/client/assets/agent-settings-w-cNQlVy.js +0 -1
- package/dist/client/assets/agent-site-editor-code-B432kGPM.js +0 -2
- package/dist/client/assets/agent-site-editor-content-CQYunysB.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-CLsSdnEd.js +0 -1
- package/dist/client/assets/agent-view-DP6mfHYN.js +0 -1
- package/dist/client/assets/api-keys-8RAAQTX6.js +0 -1
- package/dist/client/assets/category-editor-BrbTG2-B.js +0 -1
- package/dist/client/assets/cms-settings-editor-D8-PKCcN.js +0 -1
- package/dist/client/assets/content-tab-BhOwV-AC.js +0 -22
- package/dist/client/assets/context-CgB14LeY.js +0 -1
- package/dist/client/assets/library-CdY45oa5.js +0 -1
- package/dist/client/assets/mock-board-BSsrmRDS.js +0 -81
- package/dist/client/assets/post-calendar-BtEPuDia.js +0 -1
- package/dist/client/assets/project-reports-BuglSKY2.js +0 -1
- package/dist/client/assets/project-tasks-CwzdWFfG.js +0 -1
- package/dist/client/assets/record-editor-1SlOHcz4.js +0 -1
- package/dist/client/assets/reports-DuuFM9rE.js +0 -1
- package/dist/client/assets/repositories-Dvbq5CpF.js +0 -1
- package/dist/client/assets/route-CkPY6J06.js +0 -1
- package/dist/client/assets/settings-tab-D7WyDwD7.js +0 -1
- package/dist/client/assets/site-draft-actions-Ck3uf8oy.js +0 -3
- package/dist/client/assets/site-editor-BXDxn3xb.js +0 -1
- package/dist/client/assets/tasks-CDonOW9g.js +0 -1
- package/dist/client/assets/use-cms-publish-actions-Ca_6MHNE.js +0 -10
- package/dist/client/assets/useInfiniteQuery-DAGt4Ai1.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BCXHmK3t.js +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/openai-conversation-
|
|
2
|
-
import{bo as Ue,c as R,b as K,r as P,l as $,j as n,b7 as it,aK as re,cU as zt,aL as ne,cT as ze,B as W,aJ as Ns,aI as Is,dZ as Ts,cS as _s,H as Ce,c6 as Ms,fP as Se,fQ as xt,d8 as Ds,aq as Rs,e as Ps,I as Es,t as _e,C as te,a4 as Me,d as at,ai as lt,x as Fs,aY as Ls,w as Us,v as zs,D as Os,eP as $s,a5 as Bs,K as Ks,m as qs,Z as Qs,V as Ys,Y as Ws,X as ye,aw as vt,au as bt,av as At,h as Gs,b6 as Hs,b5 as Js,fR as Zs,ay as Xs,dY as en,e1 as je,b9 as tn,e3 as sn,be as yt,fS as nn,a as on,ax as rn,az as an,aX as st,b4 as ln,o as Vn,cZ as cn,b1 as dn,b3 as un,ag as Ot}from"./index-Ce7G0he3.js";import{i as $t,c as pn,e as fn,j as Bt,P as hn,k as mn,S as gn}from"./usage-stats-CtXF_bWd.js";import{s as Kt}from"./XClose-yFNn0LgD.js";import{I as xn}from"./icon-button-Xe7zTqiw.js";import{F as vn}from"./file-type-icon-CeBZX69W.js";import{b as Oe,E as bn,c as Vt,d as We,m as An,F as yn,G as jn,H as kn,I as wn,J as Sn,K as Cn,u as ct,M as Nn,f as In,s as Tn,e as _n}from"./chat-context-DIvwe-Wr.js";import{b as Mn}from"./location-V0VwTJTt.js";import{a as Dn}from"./repository-binding-Dg4XMxXs.js";import{A as Rn,w as Pn}from"./autosend-CxxtAFJ_.js";import{t as En,z as Fn,o as Ln,c as Un,w as zn,h as On}from"./thread-intent-ClCyX82j.js";import{s as $n,r as jt,i as Bn,c as Kn,w as qn,H as Qn}from"./chat-draft-DByw699W.js";import{u as Yn}from"./use-session-runtime-CL3Ry0XG.js";import{i as qt}from"./LinkBroken01-Bg7pBcuJ.js";import{i as Qt}from"./ArrowUp-BHvj9x12.js";import{n as Yt}from"./ShoppingBag01-GpZCrbBR.js";import{t as Ge,aO as Wt,a4 as Gt,aN as nt,f as dt,aw as Wn,F as Gn,aR as Hn,v as Ht,aS as Jt,_ as Jn,aT as Zn}from"./agent-icon-I45DkNr8.js";import{a as Zt}from"./Image01-D00jtGx4.js";import{h as Xn}from"./UserSquare-pnEdx237.js";import{i as eo}from"./Upload01-CgYtU1Ux.js";import{i as to}from"./AlertCircle-DwVsFaci.js";import{a as so}from"./Copy01-D6STLVd9.js";import{a as ot,b as ut,d as pt,f as ft,F as Xt}from"./form-nJy5zMPE.js";import{c as no,S as oo,b as ro,a as io,d as ao}from"./select-BU91L4uy.js";import{t as es}from"./ChevronUp-Cn8PaBxH.js";import{T as He,a as Je,c as Ze}from"./tooltip-BHLCIkH9.js";import{i as lo}from"./ArrowLeft-D0U_UeWA.js";import{b as Vo,c as co}from"./tabs-CTBn6AHY.js";import{e as $e,f as uo,c as po,g as fo}from"./use-decopilot-events-CMhdGvid.js";import{u as ho}from"./use-deco-credits-8Cm_6S2l.js";import{T as kt,a as mo}from"./toggle-group-BVSslRda.js";import{a as go,d as xo,g as wt,s as vo}from"./tool-namespace-C-2tGGMF.js";import{t as bo}from"./utils-CVEq3hMx.js";import{u as Ao}from"./use-open-billing-url-AHjpaAXa.js";import{M as yo,a as jo,m as ht,g as ko,b as wo}from"./index-B8jtRR0H.js";import{a as ts,b as ss,P as ns}from"./popover-BF3N_cWR.js";import{c as So,b as Co,a as No,D as Io}from"./drawer-w05H8pBO.js";import{u as os}from"./use-mobile-BZz7cwuI.js";import{t as To}from"./Tool01-CIeMmnyv.js";import{d as _o,a as Mo}from"./use-organization-settings-DAQWwUyU.js";import{u as rs,c as Do,d as Ro}from"./use-ai-providers-DmHiyABc.js";import{p as is,u as Po,T as Eo,a as Fo,U as Lo}from"./input-CzPtcD68.js";import{a as Uo}from"./use-mcp-client-B9-9jnHW.js";import{l as zo,g as Oo}from"./use-mcp-prompts-Duq-F4uG.js";import{i as $o}from"./Link01-CEOBycf2.js";import{s as St}from"./Plus-BPVKrQFz.js";import"./suggestion-GTJqe6wD.js";import{p as Bo,q as Ko}from"./question-004-sINsf4GQ.js";import{F as Ct}from"./feature-paywall-C560RaP5.js";import{A as qo}from"./add-connection-dialog-MrHyqJnn.js";import{u as Qo}from"./use-task-board-events-Bs2sMvhO.js";import{r as Yo}from"./use-chat-layout-state-DEHPkPVs.js";const Wo=Ue("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 Go=Ue("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 Ho=Ue("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 Jo=Ue("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 Zo=Ue("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),et="cubic-bezier(0.645, 0.045, 0.355, 1)",ll=44,Xo={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"},er={default:"border-border",error:"border-destructive/30",warning:"border-warning/30"},tr={default:"text-muted-foreground",error:"text-destructive",warning:"text-warning"};function he(t){const e=R.c(69),{icon:s,label:o,count:r,title:i,footerLeft:a,footerRight:l,children:V,defaultExpanded:c,variant:u,onClose:d}=t,p=u===void 0?"default":u,h=K(),[f,m]=P.useState(c),[g,x]=P.useState(!1);let v;e[0]!==d?(v=()=>{x(!0),d?.()},e[0]=d,e[1]=v):v=e[1];const b=v;if(g)return null;const j=er[p],A=Xo[p];let y;e[2]!==j||e[3]!==A?(y=$("relative flex flex-col rounded-xl bg-background border shadow-soft","w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",j,A),e[2]=j,e[3]=A,e[4]=y):y=e[4];let k;e[5]===Symbol.for("react.memo_cache_sentinel")?(k=()=>m(sr),e[5]=k):k=e[5];const w=f&&"rounded-b-none",S=!f&&"rounded-b-xl";let C;e[6]!==w||e[7]!==S?(C=$("flex items-center gap-2 w-full px-3 py-2 text-sm text-left","hover:bg-accent transition-colors rounded-t-xl",w,S),e[6]=w,e[7]=S,e[8]=C):C=e[8];const N=tr[p];let I;e[9]!==N?(I=$("shrink-0",N),e[9]=N,e[10]=I):I=e[10];let _;e[11]!==s||e[12]!==I?(_=n.jsx("span",{className:I,children:s}),e[11]=s,e[12]=I,e[13]=_):_=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]!==r?(F=r?n.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:r}):null,e[16]=r,e[17]=F):F=e[17];const D=f?"rotate(180deg)":"rotate(0deg)";let T;e[18]!==D?(T=n.jsx("span",{"aria-hidden":"true",className:"text-muted-foreground shrink-0 flex items-center justify-center",children:n.jsx(es,{size:16,style:{transform:D,transition:`transform 180ms ${et}`}})}),e[18]=D,e[19]=T):T=e[19];let O;e[20]!==h?(O=h("chat.collapsibleHighlight.closeLabel"),e[20]=h,e[21]=O):O=e[21];let U;e[22]!==h?(U=h("chat.collapsibleHighlight.closeTitle"),e[22]=h,e[23]=U):U=e[23];let Q,z;e[24]!==b?(Q=ce=>{ce.stopPropagation(),b()},z=ce=>{(ce.key==="Enter"||ce.key===" ")&&(ce.preventDefault(),ce.stopPropagation(),b())},e[24]=b,e[25]=Q,e[26]=z):(Q=e[25],z=e[26]);let Y;e[27]===Symbol.for("react.memo_cache_sentinel")?(Y=n.jsx(it,{size:16}),e[27]=Y):Y=e[27];let L;e[28]!==O||e[29]!==U||e[30]!==Q||e[31]!==z?(L=n.jsx("span",{role:"button",tabIndex:0,"data-testid":"collapsible-highlight-close","aria-label":O,title:U,onClick:Q,onKeyDown:z,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]=O,e[29]=U,e[30]=Q,e[31]=z,e[32]=L):L=e[32];let H;e[33]!==f||e[34]!==_||e[35]!==E||e[36]!==F||e[37]!==T||e[38]!==L||e[39]!==C?(H=n.jsxs("button",{type:"button","data-testid":"collapsible-highlight-chip","aria-expanded":f,onClick:k,className:C,children:[_,E,F,T,L]}),e[33]=f,e[34]=_,e[35]=E,e[36]=F,e[37]=T,e[38]=L,e[39]=C,e[40]=H):H=e[40];const X=f?"1fr":"0fr";let Z;e[41]!==X?(Z={display:"grid",gridTemplateRows:X,transition:`grid-template-rows 180ms ${et}`},e[41]=X,e[42]=Z):Z=e[42];let ie;e[43]===Symbol.for("react.memo_cache_sentinel")?(ie={overflow:"hidden",minHeight:0},e[43]=ie):ie=e[43];const M=f?1:0;let B;e[44]!==M?(B={opacity:M,transition:`opacity 120ms ${et}`,maxHeight:"60vh"},e[44]=M,e[45]=B):B=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 se;e[48]!==V||e[49]!==i?(se=V?n.jsx("div",{className:$("pb-4",!i&&"pt-4"),children:V}):null,e[48]=V,e[49]=i,e[50]=se):se=e[50];let ee;e[51]!==J||e[52]!==se?(ee=n.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[J,se]}),e[51]=J,e[52]=se,e[53]=ee):ee=e[53];let le;e[54]!==a||e[55]!==l?(le=a||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:a}),n.jsx("div",{className:"flex items-center gap-2",children:l})]})}):null,e[54]=a,e[55]=l,e[56]=le):le=e[56];let G;e[57]!==B||e[58]!==ee||e[59]!==le?(G=n.jsx("div",{style:ie,children:n.jsxs("div",{className:"flex flex-col",style:B,children:[ee,le]})}),e[57]=B,e[58]=ee,e[59]=le,e[60]=G):G=e[60];let ae;e[61]!==Z||e[62]!==G?(ae=n.jsx("div",{"data-testid":"collapsible-highlight-body",style:Z,children:G}),e[61]=Z,e[62]=G,e[63]=ae):ae=e[63];let Ve;return e[64]!==H||e[65]!==ae||e[66]!==y||e[67]!==p?(Ve=n.jsxs("div",{"data-testid":"collapsible-highlight","data-variant":p,className:y,children:[H,ae]}),e[64]=H,e[65]=ae,e[66]=y,e[67]=p,e[68]=Ve):Ve=e[68],Ve}function sr(t){return!t}const nr=re({content:ne().min(1).describe("Imperative form, e.g. 'Implement the login flow'"),status:ze(["pending","in_progress","completed"]),activeForm:ne().min(1).describe("Present-continuous form shown in the UI while the todo is in progress, e.g. 'Implementing the login flow'")}),as=re({todos:zt(nr)}),or="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.";En({description:or,inputSchema:Fn(as),execute:async({todos:t})=>({ok:!0,count:t.length})});const rr="tool-todo_write",ir=new Set(["input-available","output-available"]);function ar(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 r=o.length-1;r>=0;r--){const i=o[r];if(i.type!==rr||typeof i.state!="string"||!ir.has(i.state))continue;const a=as.safeParse(i.input);if(a.success)return a.data.todos}}return[]}function ls(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:bo(go(o)),input:s.input})}return e}function Vs(t){return t.at(-1)}function cs(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 lr(t){return t?t.message.startsWith("[CREDITS]"):!1}const Vr={isCreditExhausted:!1,planRefusal:null,subscriptionErrorKind:null,hasTodos:!1,showError:!1,showWarning:!1,hasApprovals:!1,hasPlans:!1,isWaitingForUserInput:!1,hasTaskSuggestion:!1,todos:[]};function cr(t){const{messages:e,error:s,finishReason:o,isStreaming:r,isWaitingForApprovals:i}=t;if(!r&&s&&lr(s))return{...Vr,isCreditExhausted:!0};const a=e.at(-1),l=a?.role==="assistant"?a.parts:[],V=l,u=!!V.filter(y=>y.type==="tool-user_ask").filter(y=>y.state!=="output-available").length,d=V.some($t),p=cs(l),h=ls(V),f=ar(e),m=r?null:$n(s),g=r?null:Ln(s),x=!r&&!!s&&!m&&!g,v=h.length>0||r&&i,b=p.length>0,A=!r&&!!o&&o!=="stop"&&!(o==="tool-calls"&&(u||v||b||d))&&!x;return{isCreditExhausted:!1,planRefusal:g,subscriptionErrorKind:m,hasTodos:f.length>0,showError:x,showWarning:A,hasApprovals:v,hasPlans:b,isWaitingForUserInput:u,hasTaskSuggestion:d,todos:f}}function ds(){const t=R.c(6),{messages:e,error:s,finishReason:o,isStreaming:r,isWaitingForApprovals:i}=Oe(),a=s??null,l=o??null;let V;return t[0]!==r||t[1]!==i||t[2]!==e||t[3]!==a||t[4]!==l?(V=cr({messages:e,error:a,finishReason:l,isStreaming:r,isWaitingForApprovals:i}),t[0]=r,t[1]=i,t[2]=e,t[3]=a,t[4]=l,t[5]=V):V=t[5],V}function Vl(){const t=ds(),e=$e("credits");return t.isCreditExhausted?e?0:1:Number(t.hasTodos)+Number(t.showError)+ +!!t.subscriptionErrorKind+ +!!t.planRefusal+Number(t.showWarning)+Number(t.hasApprovals)+Number(t.hasPlans)+Number(t.isWaitingForUserInput)+Number(t.hasTaskSuggestion)}const Nt="start-task",dr=`Turn the report below into a running task. The user pressed "Start task", which authorizes delegation.
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/openai-conversation-DXu_ai6d.js","assets/index-B0tOn0op.js","assets/index-u-z_8GjU.css","assets/usage-stats-DK8XMQvR.js","assets/tool-namespace-Ca_f3ged.js","assets/form-CgSRndK2.js","assets/label-DjW9Efu-.js","assets/utils-CVEq3hMx.js","assets/markdown-CXmgfCfV.js","assets/use-copy-CE87YLnn.js","assets/Copy01-CCULGI20.js","assets/ZoomOut-Bmxt_E04.js","assets/location-V0VwTJTt.js","assets/use-mobile-D1VdMSzS.js","assets/use-panel-navigate-Bgyt5CHg.js","assets/thread-route-B2QRkxdS.js","assets/use-project-scope-CzfpwfYe.js","assets/repository-binding-DBKiXzE_.js","assets/use-mcp-client-DJpi4PM5.js","assets/auth-kFzpcapr.js","assets/tooltip-CgglVi9W.js","assets/index-CvbPbFXs.js","assets/agent-icon-Bss_DO5K.js","assets/AlertCircle-BOP0_W_U.js","assets/Tool01-DZn57NDu.js","assets/ArrowUp-C33jPuMc.js","assets/ArrowLeft-TqR4Fgfq.js","assets/LinkBroken01-DJ9tk8Nb.js","assets/ShoppingBag01-TKNh_f0W.js","assets/Building02-mn349zQD.js","assets/CheckCircle-BCSSdEIk.js","assets/ChevronUp-bG7QziWc.js","assets/ChevronSelectorVertical-Bf_2MNcW.js","assets/UserSquare-lDfe1WCi.js","assets/CreditCard01-CSCSy42G.js","assets/DotsVertical-DKcUxvbN.js","assets/Image01-DBJ7dlcG.js","assets/Globe04-DJ5nStZd.js","assets/SwitchHorizontal01-Cd-vTdga.js","assets/Key01-EhXWdZXA.js","assets/Link01-D3zxQ7B9.js","assets/Minus-C_yGMjay.js","assets/Monitor01-HXiLn6G2.js","assets/Sun-D2qZhPc5.js","assets/Play-CtPfgXDv.js","assets/Plus-DT_Y3SXq.js","assets/SearchMd-g-czGrfP.js","assets/Trash01-Bw8Leo0g.js","assets/Upload01-DBuU3kZE.js","assets/Users01-B094G3md.js","assets/XClose-BZ7_Ux4e.js","assets/use-decopilot-events-PGYGrQrr.js","assets/thread-intent-Ckrry8zY.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-BAzbGHBs.js","assets/task-board-BN1n0sAA.js","assets/schema-C7U_cF_C.js","assets/slugify-CEUa2lfQ.js","assets/chat-context-CS6VicT4.js","assets/autosend-Byl7Kst-.js","assets/use-ai-providers-hxbNecrE.js","assets/use-organization-settings-DPGSLMns.js","assets/icon-button-DLFu-3bH.js","assets/file-type-icon-B1YNwd4s.js","assets/chat-draft-VQFS_4wA.js","assets/use-session-runtime-Cr5FejOR.js","assets/select-BqKA-vqL.js","assets/index-BdQq_4o_.js","assets/tabs-CvTwctdA.js","assets/active-indicator-CCMhAsc_.js","assets/use-deco-credits-BbBcoaKj.js","assets/toggle-group-DplSVqNV.js","assets/use-open-billing-url-BixRtMzE.js","assets/index-CEFh9jFo.js","assets/checkbox-CKXQp3Az.js","assets/ai-providers-logos-DD3qZ33J.js","assets/popover-BNB2WAex.js","assets/drawer-H8aSAwJp.js","assets/input-DgTSqztG.js","assets/suggestion-Cmvr6ozT.js","assets/use-mcp-prompts-wOk1Vinz.js","assets/use-org-fs-CeGf0w9Y.js","assets/useInfiniteQuery-B3u_qeyw.js","assets/infiniteQueryObserver-Qk75Yfno.js","assets/question-004-sINsf4GQ.js","assets/feature-paywall-BuJHEFXn.js","assets/plan-ladder-DPUUy26C.js","assets/add-connection-dialog-CD5rNCCt.js","assets/collection-search-D1wDrhDt.js","assets/extract-connection-data-B6GxSzL3.js","assets/metadata-D72DunRR.js","assets/connection-CH3Z1KCr.js","assets/url-slug-CiVvW5vP.js","assets/connection-card-BF5BfmLL.js","assets/connection-slug-CITJ0kGN.js","assets/integration-icon-DH6bJTbT.js","assets/textarea-Ce3-2mS-.js","assets/use-connection-EUcmc_O-.js","assets/schema-DuXRpy1C.js","assets/connection-form-helpers-Cpd6u6JQ.js","assets/authenticate-and-persist-oauth-D5qGprX9.js","assets/mcp-oauth-BqcW0NNd.js","assets/mcp-oauth-DPBTJBcB.js","assets/collection-tabs-oJVN40cq.js","assets/badge-C-BSS2Yn.js","assets/use-infinite-scroll-B-uSWzNc.js","assets/useSuspenseInfiniteQuery-0NVyrPzv.js","assets/use-task-board-events-iZ165E68.js","assets/use-chat-layout-state-BSTkVYBd.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{bo as Ue,c as R,b as K,r as P,l as $,j as n,b7 as it,aK as re,cU as zt,aL as ne,cT as ze,B as W,aJ as Ns,aI as Is,dZ as Ts,cS as _s,H as Ce,c6 as Ms,fP as Se,fQ as xt,d8 as Ds,aq as Rs,e as Ps,I as Es,t as _e,C as te,a4 as Me,d as at,ai as lt,x as Fs,aY as Ls,w as Us,v as zs,D as Os,eP as $s,a5 as Bs,K as Ks,m as qs,Z as Qs,V as Ys,Y as Ws,X as ye,aw as vt,au as bt,av as At,h as Gs,b6 as Hs,b5 as Js,fR as Zs,ay as Xs,dY as en,e1 as je,b9 as tn,e3 as sn,be as yt,fS as nn,a as on,ax as rn,az as an,aX as st,b4 as ln,o as Vn,cZ as cn,b1 as dn,b3 as un,ag as Ot}from"./index-B0tOn0op.js";import{i as $t,c as pn,e as fn,j as Bt,P as hn,k as mn,S as gn}from"./usage-stats-DK8XMQvR.js";import{s as Kt}from"./XClose-BZ7_Ux4e.js";import{I as xn}from"./icon-button-DLFu-3bH.js";import{F as vn}from"./file-type-icon-B1YNwd4s.js";import{b as Oe,E as bn,c as Vt,d as We,m as An,F as yn,G as jn,H as kn,I as wn,J as Sn,K as Cn,u as ct,M as Nn,f as In,s as Tn,e as _n}from"./chat-context-CS6VicT4.js";import{b as Mn}from"./location-V0VwTJTt.js";import{a as Dn}from"./repository-binding-DBKiXzE_.js";import{A as Rn,w as Pn}from"./autosend-Byl7Kst-.js";import{t as En,z as Fn,o as Ln,c as Un,w as zn,h as On}from"./thread-intent-Ckrry8zY.js";import{s as $n,r as jt,i as Bn,c as Kn,w as qn,H as Qn}from"./chat-draft-VQFS_4wA.js";import{u as Yn}from"./use-session-runtime-Cr5FejOR.js";import{i as qt}from"./LinkBroken01-DJ9tk8Nb.js";import{i as Qt}from"./ArrowUp-C33jPuMc.js";import{n as Yt}from"./ShoppingBag01-TKNh_f0W.js";import{t as Ge,aO as Wt,a4 as Gt,aN as nt,f as dt,aw as Wn,F as Gn,aR as Hn,v as Ht,aS as Jt,_ as Jn,aT as Zn}from"./agent-icon-Bss_DO5K.js";import{a as Zt}from"./Image01-DBJ7dlcG.js";import{h as Xn}from"./UserSquare-lDfe1WCi.js";import{i as eo}from"./Upload01-DBuU3kZE.js";import{i as to}from"./AlertCircle-BOP0_W_U.js";import{a as so}from"./Copy01-CCULGI20.js";import{a as ot,b as ut,d as pt,f as ft,F as Xt}from"./form-CgSRndK2.js";import{c as no,S as oo,b as ro,a as io,d as ao}from"./select-BqKA-vqL.js";import{t as es}from"./ChevronUp-bG7QziWc.js";import{T as He,a as Je,c as Ze}from"./tooltip-CgglVi9W.js";import{i as lo}from"./ArrowLeft-TqR4Fgfq.js";import{b as Vo,c as co}from"./tabs-CvTwctdA.js";import{e as $e,f as uo,c as po,g as fo}from"./use-decopilot-events-PGYGrQrr.js";import{u as ho}from"./use-deco-credits-BbBcoaKj.js";import{T as kt,a as mo}from"./toggle-group-DplSVqNV.js";import{a as go,d as xo,g as wt,s as vo}from"./tool-namespace-Ca_f3ged.js";import{t as bo}from"./utils-CVEq3hMx.js";import{u as Ao}from"./use-open-billing-url-BixRtMzE.js";import{M as yo,a as jo,m as ht,g as ko,b as wo}from"./index-CEFh9jFo.js";import{a as ts,b as ss,P as ns}from"./popover-BNB2WAex.js";import{c as So,b as Co,a as No,D as Io}from"./drawer-H8aSAwJp.js";import{u as os}from"./use-mobile-D1VdMSzS.js";import{t as To}from"./Tool01-DZn57NDu.js";import{d as _o,a as Mo}from"./use-organization-settings-DPGSLMns.js";import{u as rs,c as Do,d as Ro}from"./use-ai-providers-hxbNecrE.js";import{p as is,u as Po,T as Eo,a as Fo,U as Lo}from"./input-DgTSqztG.js";import{a as Uo}from"./use-mcp-client-DJpi4PM5.js";import{l as zo,g as Oo}from"./use-mcp-prompts-wOk1Vinz.js";import{i as $o}from"./Link01-D3zxQ7B9.js";import{s as St}from"./Plus-DT_Y3SXq.js";import"./suggestion-Cmvr6ozT.js";import{p as Bo,q as Ko}from"./question-004-sINsf4GQ.js";import{F as Ct}from"./feature-paywall-BuJHEFXn.js";import{A as qo}from"./add-connection-dialog-CD5rNCCt.js";import{u as Qo}from"./use-task-board-events-iZ165E68.js";import{r as Yo}from"./use-chat-layout-state-BSTkVYBd.js";const Wo=Ue("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 Go=Ue("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 Ho=Ue("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 Jo=Ue("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 Zo=Ue("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),et="cubic-bezier(0.645, 0.045, 0.355, 1)",ll=44,Xo={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"},er={default:"border-border",error:"border-destructive/30",warning:"border-warning/30"},tr={default:"text-muted-foreground",error:"text-destructive",warning:"text-warning"};function he(t){const e=R.c(69),{icon:s,label:o,count:r,title:i,footerLeft:a,footerRight:l,children:V,defaultExpanded:c,variant:u,onClose:d}=t,p=u===void 0?"default":u,h=K(),[f,m]=P.useState(c),[g,x]=P.useState(!1);let v;e[0]!==d?(v=()=>{x(!0),d?.()},e[0]=d,e[1]=v):v=e[1];const b=v;if(g)return null;const j=er[p],A=Xo[p];let y;e[2]!==j||e[3]!==A?(y=$("relative flex flex-col rounded-xl bg-background border shadow-soft","w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",j,A),e[2]=j,e[3]=A,e[4]=y):y=e[4];let k;e[5]===Symbol.for("react.memo_cache_sentinel")?(k=()=>m(sr),e[5]=k):k=e[5];const w=f&&"rounded-b-none",S=!f&&"rounded-b-xl";let C;e[6]!==w||e[7]!==S?(C=$("flex items-center gap-2 w-full px-3 py-2 text-sm text-left","hover:bg-accent transition-colors rounded-t-xl",w,S),e[6]=w,e[7]=S,e[8]=C):C=e[8];const N=tr[p];let I;e[9]!==N?(I=$("shrink-0",N),e[9]=N,e[10]=I):I=e[10];let _;e[11]!==s||e[12]!==I?(_=n.jsx("span",{className:I,children:s}),e[11]=s,e[12]=I,e[13]=_):_=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]!==r?(F=r?n.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:r}):null,e[16]=r,e[17]=F):F=e[17];const D=f?"rotate(180deg)":"rotate(0deg)";let T;e[18]!==D?(T=n.jsx("span",{"aria-hidden":"true",className:"text-muted-foreground shrink-0 flex items-center justify-center",children:n.jsx(es,{size:16,style:{transform:D,transition:`transform 180ms ${et}`}})}),e[18]=D,e[19]=T):T=e[19];let O;e[20]!==h?(O=h("chat.collapsibleHighlight.closeLabel"),e[20]=h,e[21]=O):O=e[21];let U;e[22]!==h?(U=h("chat.collapsibleHighlight.closeTitle"),e[22]=h,e[23]=U):U=e[23];let Q,z;e[24]!==b?(Q=ce=>{ce.stopPropagation(),b()},z=ce=>{(ce.key==="Enter"||ce.key===" ")&&(ce.preventDefault(),ce.stopPropagation(),b())},e[24]=b,e[25]=Q,e[26]=z):(Q=e[25],z=e[26]);let Y;e[27]===Symbol.for("react.memo_cache_sentinel")?(Y=n.jsx(it,{size:16}),e[27]=Y):Y=e[27];let L;e[28]!==O||e[29]!==U||e[30]!==Q||e[31]!==z?(L=n.jsx("span",{role:"button",tabIndex:0,"data-testid":"collapsible-highlight-close","aria-label":O,title:U,onClick:Q,onKeyDown:z,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]=O,e[29]=U,e[30]=Q,e[31]=z,e[32]=L):L=e[32];let H;e[33]!==f||e[34]!==_||e[35]!==E||e[36]!==F||e[37]!==T||e[38]!==L||e[39]!==C?(H=n.jsxs("button",{type:"button","data-testid":"collapsible-highlight-chip","aria-expanded":f,onClick:k,className:C,children:[_,E,F,T,L]}),e[33]=f,e[34]=_,e[35]=E,e[36]=F,e[37]=T,e[38]=L,e[39]=C,e[40]=H):H=e[40];const X=f?"1fr":"0fr";let Z;e[41]!==X?(Z={display:"grid",gridTemplateRows:X,transition:`grid-template-rows 180ms ${et}`},e[41]=X,e[42]=Z):Z=e[42];let ie;e[43]===Symbol.for("react.memo_cache_sentinel")?(ie={overflow:"hidden",minHeight:0},e[43]=ie):ie=e[43];const M=f?1:0;let B;e[44]!==M?(B={opacity:M,transition:`opacity 120ms ${et}`,maxHeight:"60vh"},e[44]=M,e[45]=B):B=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 se;e[48]!==V||e[49]!==i?(se=V?n.jsx("div",{className:$("pb-4",!i&&"pt-4"),children:V}):null,e[48]=V,e[49]=i,e[50]=se):se=e[50];let ee;e[51]!==J||e[52]!==se?(ee=n.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[J,se]}),e[51]=J,e[52]=se,e[53]=ee):ee=e[53];let le;e[54]!==a||e[55]!==l?(le=a||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:a}),n.jsx("div",{className:"flex items-center gap-2",children:l})]})}):null,e[54]=a,e[55]=l,e[56]=le):le=e[56];let G;e[57]!==B||e[58]!==ee||e[59]!==le?(G=n.jsx("div",{style:ie,children:n.jsxs("div",{className:"flex flex-col",style:B,children:[ee,le]})}),e[57]=B,e[58]=ee,e[59]=le,e[60]=G):G=e[60];let ae;e[61]!==Z||e[62]!==G?(ae=n.jsx("div",{"data-testid":"collapsible-highlight-body",style:Z,children:G}),e[61]=Z,e[62]=G,e[63]=ae):ae=e[63];let Ve;return e[64]!==H||e[65]!==ae||e[66]!==y||e[67]!==p?(Ve=n.jsxs("div",{"data-testid":"collapsible-highlight","data-variant":p,className:y,children:[H,ae]}),e[64]=H,e[65]=ae,e[66]=y,e[67]=p,e[68]=Ve):Ve=e[68],Ve}function sr(t){return!t}const nr=re({content:ne().min(1).describe("Imperative form, e.g. 'Implement the login flow'"),status:ze(["pending","in_progress","completed"]),activeForm:ne().min(1).describe("Present-continuous form shown in the UI while the todo is in progress, e.g. 'Implementing the login flow'")}),as=re({todos:zt(nr)}),or="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.";En({description:or,inputSchema:Fn(as),execute:async({todos:t})=>({ok:!0,count:t.length})});const rr="tool-todo_write",ir=new Set(["input-available","output-available"]);function ar(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 r=o.length-1;r>=0;r--){const i=o[r];if(i.type!==rr||typeof i.state!="string"||!ir.has(i.state))continue;const a=as.safeParse(i.input);if(a.success)return a.data.todos}}return[]}function ls(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:bo(go(o)),input:s.input})}return e}function Vs(t){return t.at(-1)}function cs(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 lr(t){return t?t.message.startsWith("[CREDITS]"):!1}const Vr={isCreditExhausted:!1,planRefusal:null,subscriptionErrorKind:null,hasTodos:!1,showError:!1,showWarning:!1,hasApprovals:!1,hasPlans:!1,isWaitingForUserInput:!1,hasTaskSuggestion:!1,todos:[]};function cr(t){const{messages:e,error:s,finishReason:o,isStreaming:r,isWaitingForApprovals:i}=t;if(!r&&s&&lr(s))return{...Vr,isCreditExhausted:!0};const a=e.at(-1),l=a?.role==="assistant"?a.parts:[],V=l,u=!!V.filter(y=>y.type==="tool-user_ask").filter(y=>y.state!=="output-available").length,d=V.some($t),p=cs(l),h=ls(V),f=ar(e),m=r?null:$n(s),g=r?null:Ln(s),x=!r&&!!s&&!m&&!g,v=h.length>0||r&&i,b=p.length>0,A=!r&&!!o&&o!=="stop"&&!(o==="tool-calls"&&(u||v||b||d))&&!x;return{isCreditExhausted:!1,planRefusal:g,subscriptionErrorKind:m,hasTodos:f.length>0,showError:x,showWarning:A,hasApprovals:v,hasPlans:b,isWaitingForUserInput:u,hasTaskSuggestion:d,todos:f}}function ds(){const t=R.c(6),{messages:e,error:s,finishReason:o,isStreaming:r,isWaitingForApprovals:i}=Oe(),a=s??null,l=o??null;let V;return t[0]!==r||t[1]!==i||t[2]!==e||t[3]!==a||t[4]!==l?(V=cr({messages:e,error:a,finishReason:l,isStreaming:r,isWaitingForApprovals:i}),t[0]=r,t[1]=i,t[2]=e,t[3]=a,t[4]=l,t[5]=V):V=t[5],V}function Vl(){const t=ds(),e=$e("credits");return t.isCreditExhausted?e?0:1:Number(t.hasTodos)+Number(t.showError)+ +!!t.subscriptionErrorKind+ +!!t.planRefusal+Number(t.showWarning)+Number(t.hasApprovals)+Number(t.hasPlans)+Number(t.isWaitingForUserInput)+Number(t.hasTaskSuggestion)}const Nt="start-task",dr=`Turn the report below into a running task. The user pressed "Start task", which authorizes delegation.
|
|
3
3
|
|
|
4
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
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
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
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
8
|
|
|
9
|
-
The report follows.`;function ur(t){return{...t,content:[{type:"paragraph",content:[pn({id:Nt,name:Nt,char:"/",kind:"prompt",metadata:[{role:"user",content:{type:"text",text:dr}}]})]},...t.content??[]]}}function pr(){const t=R.c(24),e=K(),s=bn();if(!s)return null;let o,r,i,a;t[0]!==s.path||t[1]!==e?(o=Mn(s.path),a="flex px-3 pt-3",r="surface-inset flex h-7 min-w-0 items-center gap-1.5 rounded-full pr-0.5 pl-2.5 text-xs text-foreground",i=e("chat.input.openFileContext",{name:o}),t[0]=s.path,t[1]=e,t[2]=o,t[3]=r,t[4]=i,t[5]=a):(o=t[2],r=t[3],i=t[4],a=t[5]);let l,V;t[6]!==o?(l=n.jsx(vn,{filename:o,className:"h-4 w-3 shrink-0"}),V=n.jsx("span",{className:"truncate",children:o}),t[6]=o,t[7]=l,t[8]=V):(l=t[7],V=t[8]);let c;t[9]!==e?(c=e("chat.input.openFileDismiss"),t[9]=e,t[10]=c):c=t[10];let u;t[11]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Kt,{size:12}),t[11]=u):u=t[11];let d;t[12]!==s.dismiss||t[13]!==c?(d=n.jsx(xn,{label:c,size:"icon-sm",onClick:s.dismiss,children:u}),t[12]=s.dismiss,t[13]=c,t[14]=d):d=t[14];let p;t[15]!==r||t[16]!==i||t[17]!==l||t[18]!==V||t[19]!==d?(p=n.jsxs("span",{className:r,title:i,children:[l,V,d]}),t[15]=r,t[16]=i,t[17]=l,t[18]=V,t[19]=d,t[20]=p):p=t[20];let h;return t[21]!==a||t[22]!==p?(h=n.jsx("div",{className:a,children:p}),t[21]=a,t[22]=p,t[23]=h):h=t[23],h}function fr(t){return{autosend:Rn,sidepanel:!0,...t?{mainpanel:!1}:{}}}function hr(t){const e=R.c(30),{current:s,total:o,onPrev:r,onNext:i}=t,a=K();if(o<=1)return null;const l=s===0,V=s===0?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let c;e[0]!==V?(c=$("p-0.5 transition-colors rounded-lg",V),e[0]=V,e[1]=c):c=e[1];let u;e[2]!==a?(u=a("chat.pagination.previousLabel"),e[2]=a,e[3]=u):u=e[3];let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(lo,{size:14}),e[4]=d):d=e[4];let p;e[5]!==r||e[6]!==l||e[7]!==c||e[8]!==u?(p=n.jsx("button",{type:"button",onClick:r,disabled:l,className:c,"aria-label":u,children:d}),e[5]=r,e[6]=l,e[7]=c,e[8]=u,e[9]=p):p=e[9];const h=s+1;let f;e[10]!==a||e[11]!==h||e[12]!==o?(f=a("chat.pagination.counter",{current:h,total:o}),e[10]=a,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 g=s===o-1,x=s===o-1?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let v;e[16]!==x?(v=$("p-0.5 transition-colors rounded-lg",x),e[16]=x,e[17]=v):v=e[17];let b;e[18]!==a?(b=a("chat.pagination.nextLabel"),e[18]=a,e[19]=b):b=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(qt,{size:14}),e[20]=j):j=e[20];let A;e[21]!==i||e[22]!==g||e[23]!==v||e[24]!==b?(A=n.jsx("button",{type:"button",onClick:i,disabled:g,className:v,"aria-label":b,children:j}),e[21]=i,e[22]=g,e[23]=v,e[24]=b,e[25]=A):A=e[25];let y;return e[26]!==A||e[27]!==p||e[28]!==m?(y=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]=y):y=e[29],y}function us(t){const e=R.c(8),{currentIndex:s,total:o,onPrev:r,onNext:i,extraLeft:a}=t;let l;e[0]!==s||e[1]!==i||e[2]!==r||e[3]!==o?(l=n.jsx(hr,{current:s,total:o,onPrev:r,onNext:i}),e[0]=s,e[1]=i,e[2]=r,e[3]=o,e[4]=l):l=e[4];let V;return e[5]!==a||e[6]!==l?(V=n.jsxs("div",{className:"flex items-center gap-2",children:[l,a]}),e[5]=a,e[6]=l,e[7]=V):V=e[7],V}function mr(t){const e=R.c(17),{isStreaming:s,isAllAnswered:o,isCurrentAnswered:r,onAdvanceOrSubmit:i,submitLabel:a,nextLabel:l}=t,u=o?a===void 0?"Submit":a:l===void 0?"Next":l,d=o?s:!r,p=d?o?"Waiting for the assistant to finish…":"Answer this item to continue":null;let h;e[0]!==d||e[1]!==i?(h=()=>{d||i()},e[0]=d,e[1]=i,e[2]=h):h=e[2];const f=d&&"opacity-50 cursor-not-allowed";let m;e[3]!==f?(m=$("h-7 px-2.5 text-xs",f),e[3]=f,e[4]=m):m=e[4];let g;e[5]!==d||e[6]!==u||e[7]!==h||e[8]!==m?(g=n.jsx(W,{type:"button",size:"sm","aria-disabled":d,onClick:h,className:m,children:u}),e[5]=d,e[6]=u,e[7]=h,e[8]=m,e[9]=g):g=e[9];const x=g;if(!p)return x;let v;e[10]!==x?(v=n.jsx(He,{asChild:!0,children:x}),e[10]=x,e[11]=v):v=e[11];let b;e[12]!==p?(b=n.jsx(Je,{children:p}),e[12]=p,e[13]=b):b=e[13];let j;return e[14]!==v||e[15]!==b?(j=n.jsxs(Ze,{children:[v,b]}),e[14]=v,e[15]=b,e[16]=j):j=e[16],j}function ps(t,e,s){return t.findIndex(o=>e(o)===s)}function It(t,e,s,o){return t.length===0?!1:t.every(r=>o(s[e(r)]))}function Tt(t,e,s,o,r){if(t.length===0)return null;const i=ps(t,e,r);for(let a=1;a<=t.length;a++){const l=t[(i+a)%t.length];if(!l)continue;const V=e(l);if(V!==r&&!o(s[V]))return V}return null}function gr(t){return!t.isStreaming&&t.allAnswered}function fs(t){const{parts:e,partKey:s,schema:o,defaultValues:r,isStreaming:i,hasAnswer:a,onSubmit:l}=t,V=e[0]?s(e[0]):"",[c,u]=P.useState(V),[d,p]=P.useState(!1),h=Ns({resolver:Is(o),defaultValues:r}),f=h.watch(),m=ps(e,s,c),g=m>=0?e[m]:void 0,x=a(f[c]),v=It(e,s,f,a),b=gr({isStreaming:i,allAnswered:v}),j=()=>{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))}},y=()=>{const N=h.getValues(),I=Tt(e,s,N,a,c);I&&u(I)},k=()=>{h.handleSubmit(N=>{const I=N;for(const _ of e)l(_,I[s(_)])})()},w=P.useRef(k);w.current=k;const S=()=>{b&&(p(!1),w.current())},C=()=>{const N=h.getValues();if(It(e,s,N,a)){if(i){p(!0);return}p(!1),w.current()}else{const I=Tt(e,s,N,a,c);I&&u(I)}};return P.useEffect(()=>{if(d&&!i){if(!v){p(!1);return}p(!1),w.current()}},[d,i,v]),{form:h,activeKey:c,setActiveKey:u,currentIndex:m,currentPart:g,isCurrentAnswered:x,isAllAnswered:v,canSubmit:b,goPrev:j,goNext:A,advanceToNextUnanswered:y,submit:S,submitOrAdvance:C}}const hs="chat.approval.defaultDenyReason";function ms(t){const e=R.c(36),{onYolo:s}=t,o=K(),[r,i]=Ce();let a,l,V,c,u,d,p,h,f;if(e[0]!==s||e[1]!==r||e[2]!==i||e[3]!==o){const j=Se.find(k=>k.value===r.toolApprovalLevel)??Se[0];let A;e[13]!==s||e[14]!==r||e[15]!==i?(A=k=>{const w=k,S=r.toolApprovalLevel??"readonly";i({...r,toolApprovalLevel:w}),w==="auto"&&s(S)},e[13]=s,e[14]=r,e[15]=i,e[16]=A):A=e[16];const y=A;V=oo,h=r.toolApprovalLevel,f=y,l=ro,u="xs",d="text-xs text-muted-foreground border-border/60 bg-transparent hover:bg-accent h-7 gap-1",p=xr,a=io,c=o(j.shortKey),e[0]=s,e[1]=r,e[2]=i,e[3]=o,e[4]=a,e[5]=l,e[6]=V,e[7]=c,e[8]=u,e[9]=d,e[10]=p,e[11]=h,e[12]=f}else a=e[4],l=e[5],V=e[6],c=e[7],u=e[8],d=e[9],p=e[10],h=e[11],f=e[12];let m;e[17]!==a||e[18]!==c?(m=n.jsx(a,{children:c}),e[17]=a,e[18]=c,e[19]=m):m=e[19];let g;e[20]!==l||e[21]!==u||e[22]!==d||e[23]!==p||e[24]!==m?(g=n.jsx(l,{size:u,className:d,onClick:p,children:m}),e[20]=l,e[21]=u,e[22]=d,e[23]=p,e[24]=m,e[25]=g):g=e[25];let x;e[26]!==o?(x=Se.map(j=>n.jsx(no,{value:j.value,children:o(j.labelKey)},j.value)),e[26]=o,e[27]=x):x=e[27];let v;e[28]!==x?(v=n.jsx(ao,{children:x}),e[28]=x,e[29]=v):v=e[29];let b;return e[30]!==V||e[31]!==v||e[32]!==h||e[33]!==f||e[34]!==g?(b=n.jsxs(V,{value:h,onValueChange:f,children:[g,v]}),e[30]=V,e[31]=v,e[32]=h,e[33]=f,e[34]=g,e[35]=b):b=e[35],b}function xr(t){return t.stopPropagation()}function gs(t){const e=R.c(8),{input:s}=t,o=K();if(s==null){let a;e[0]!==o?(a=o("chat.approval.noInput"),e[0]=o,e[1]=a):a=e[1];let l;return e[2]!==a?(l=n.jsx("div",{className:"px-4 text-xs text-muted-foreground",children:a}),e[2]=a,e[3]=l):l=e[3],l}let r;try{let a;e[4]!==s?(a=JSON.stringify(s,null,2),e[4]=s,e[5]=a):a=e[5],r=a}catch{r=String(s)}let i;return e[6]!==r?(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:r})}),e[6]=r,e[7]=i):i=e[7],i}function vr(t){const e=R.c(38),{approval:s,onRespond:o}=t,r=K(),[i]=Ce(),a=i.toolApprovalLevel??"readonly";let l;e[0]!==s.approvalId||e[1]!==a||e[2]!==o||e[3]!==r?(l=()=>o(s.approvalId,!1,r(hs),a),e[0]=s.approvalId,e[1]=a,e[2]=o,e[3]=r,e[4]=l):l=e[4];const V=l;let c;e[5]!==s.approvalId||e[6]!==a||e[7]!==o?(c=()=>o(s.approvalId,!0,void 0,a),e[5]=s.approvalId,e[6]=a,e[7]=o,e[8]=c):c=e[8];const u=c;let d;e[9]!==s.approvalId||e[10]!==o?(d=S=>o(s.approvalId,!0,void 0,S),e[9]=s.approvalId,e[10]=o,e[11]=d):d=e[11];const p=d;let h;e[12]!==p?(h=n.jsx("div",{className:"flex items-center gap-2",children:n.jsx(ms,{onYolo:p})}),e[12]=p,e[13]=h):h=e[13];const f=h;let m;e[14]!==r?(m=r("chat.approval.denyButton"),e[14]=r,e[15]=m):m=e[15];let g;e[16]!==V||e[17]!==m?(g=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]=g):g=e[18];let x;e[19]!==r?(x=r("chat.approval.acceptButton"),e[19]=r,e[20]=x):x=e[20];let v;e[21]!==u||e[22]!==x?(v=n.jsx(W,{type:"button",size:"sm",className:"h-7 px-2.5 text-xs active:scale-[0.97] transition-transform",onClick:u,children:x}),e[21]=u,e[22]=x,e[23]=v):v=e[23];let b;e[24]!==g||e[25]!==v?(b=n.jsxs(n.Fragment,{children:[g,v]}),e[24]=g,e[25]=v,e[26]=b):b=e[26];const j=b;let A;e[27]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx(Ge,{size:14}),e[27]=A):A=e[27];let y;e[28]!==r?(y=r("chat.approval.needsApproval"),e[28]=r,e[29]=y):y=e[29];let k;e[30]!==s.input?(k=n.jsx(gs,{input:s.input}),e[30]=s.input,e[31]=k):k=e[31];let w;return e[32]!==s.friendlyName||e[33]!==f||e[34]!==j||e[35]!==y||e[36]!==k?(w=n.jsx(he,{icon:A,label:y,title:s.friendlyName,defaultExpanded:!0,footerLeft:f,footerRight:j,children:k}),e[32]=s.friendlyName,e[33]=f,e[34]=j,e[35]=y,e[36]=k,e[37]=w):w=e[37],w}const br=Ts(ne(),re({approved:_s().optional(),levelOverride:ze(["auto","readonly"]).optional()}));function Ar(t){const e=R.c(46),{approvals:s,isStreaming:o,onRespond:r}=t,i=K(),[a]=Ce(),l=a.toolApprovalLevel??"readonly";let V;e[0]!==s?(V=Object.fromEntries(s.map(kr)),e[0]=s,e[1]=V):V=e[1];const c=V;let u;e[2]!==l||e[3]!==r||e[4]!==i?(u=(I,_)=>{const E=_;typeof E?.approved=="boolean"&&r(I.approvalId,E.approved,E.approved===!1?i(hs):void 0,E.levelOverride??l)},e[2]=l,e[3]=r,e[4]=i,e[5]=u):u=e[5];let d;e[6]!==s||e[7]!==c||e[8]!==o||e[9]!==u?(d={parts:s,partKey:jr,schema:br,defaultValues:c,isStreaming:o,hasAnswer:yr,onSubmit:u},e[6]=s,e[7]=c,e[8]=o,e[9]=u,e[10]=d):d=e[10];const p=fs(d);let h;e[11]!==s||e[12]!==p?(h=I=>{p.form.reset(Object.fromEntries(s.map(_=>[_.approvalId,{approved:!0,levelOverride:I}]))),p.submitOrAdvance()},e[11]=s,e[12]=p,e[13]=h):h=e[13];const f=h,m=p.currentPart,g=p.form;let x;e[14]!==p?(x=I=>{I.preventDefault(),p.submit()},e[14]=p,e[15]=x):x=e[15];let v;e[16]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(Ge,{size:14}),e[16]=v):v=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 j=m?.friendlyName??"";let A;e[20]!==f?(A=n.jsx(ms,{onYolo:f}),e[20]=f,e[21]=A):A=e[21];let y;e[22]!==s.length||e[23]!==p.currentIndex||e[24]!==p.goNext||e[25]!==p.goPrev||e[26]!==A?(y=n.jsx(us,{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]=y):y=e[27];let k;e[28]!==m||e[29]!==p.form.control||e[30]!==p.submitOrAdvance?(k=m?n.jsx(wr,{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]=k):k=e[31];let w;e[32]!==m?(w=m?n.jsx(gs,{input:m.input}):null,e[32]=m,e[33]=w):w=e[33];let S;e[34]!==y||e[35]!==k||e[36]!==w||e[37]!==b||e[38]!==j?(S=n.jsx(he,{icon:v,label:b,title:j,defaultExpanded:!0,footerLeft:y,footerRight:k,children:w}),e[34]=y,e[35]=k,e[36]=w,e[37]=b,e[38]=j,e[39]=S):S=e[39];let C;e[40]!==S||e[41]!==x?(C=n.jsx("form",{onSubmit:x,children:S}),e[40]=S,e[41]=x,e[42]=C):C=e[42];let N;return e[43]!==p.form||e[44]!==C?(N=n.jsx(ot,{...g,children:C}),e[43]=p.form,e[44]=C,e[45]=N):N=e[45],N}function yr(t){return typeof t?.approved=="boolean"}function jr(t){return t.approvalId}function kr(t){return[t.approvalId,{approved:void 0}]}function wr(t){const e=R.c(7),{approvalId:s,control:o,onChange:r}=t,i=K(),a=`${s}.approved`;let l;e[0]!==r||e[1]!==i?(l=c=>{const{field:u}=c,d=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),r()},"aria-pressed":p,children:i("chat.approval.denyButton")}),n.jsx(W,{type:"button",variant:d?"default":"outline",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{u.onChange(!0),r()},"aria-pressed":d,children:i("chat.approval.acceptButton")})]})},e[0]=r,e[1]=i,e[2]=l):l=e[2];let V;return e[3]!==o||e[4]!==a||e[5]!==l?(V=n.jsx(Ms,{control:o,name:a,render:l}),e[3]=o,e[4]=a,e[5]=l,e[6]=V):V=e[6],V}function Sr(){const t=R.c(5),e=K();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.approval.preparingRequest"),t[1]=e,t[2]=o):o=t[2];let r;return t[3]!==o?(r=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]=r):r=t[4],r}function Cr(t){const e=R.c(8),{approvals:s,isStreaming:o,onRespond:r}=t;if(o&&s.length===0){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Sr,{}),e[0]=a):a=e[0],a}if(s.length===0)return null;if(s.length===1){const a=s[0];if(!a)return null;let l;return e[1]!==r||e[2]!==a?(l=n.jsx(vr,{approval:a,onRespond:r}),e[1]=r,e[2]=a,e[3]=l):l=e[3],l}let i;return e[4]!==s||e[5]!==o||e[6]!==r?(i=n.jsx(Ar,{approvals:s,isStreaming:o,onRespond:r}),e[4]=s,e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function Nr(t){const e=R.c(28),{plan:s,onApprove:o,onDismiss:r}=t,i=K();let a;e[0]!==o||e[1]!==s.plan?(a=()=>{o(s.plan)},e[0]=o,e[1]=s.plan,e[2]=a):a=e[2];const l=a;let V;e[3]!==i?(V=i("chat.proposePlan.keepIterating"),e[3]=i,e[4]=V):V=e[4];let c;e[5]!==r||e[6]!==V?(c=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:r,children:V}),e[5]=r,e[6]=V,e[7]=c):c=e[7];let u;e[8]!==i?(u=i("chat.proposePlan.letsGo"),e[8]=i,e[9]=u):u=e[9];let d;e[10]!==l||e[11]!==u?(d=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]=d):d=e[12];let p;e[13]!==c||e[14]!==d?(p=n.jsxs(n.Fragment,{children:[c,d]}),e[13]=c,e[14]=d,e[15]=p):p=e[15];const h=p;let f;e[16]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Wt,{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 g;e[19]!==i?(g=i("chat.proposePlan.implementationPlan"),e[19]=i,e[20]=g):g=e[20];let x;e[21]!==s.plan?(x=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(fn,{id:"plan-preview",part:{type:"text",text:s.plan}})})}),e[21]=s.plan,e[22]=x):x=e[22];let v;return e[23]!==h||e[24]!==x||e[25]!==m||e[26]!==g?(v=n.jsx(he,{icon:f,label:m,title:g,defaultExpanded:!0,footerRight:h,children:x}),e[23]=h,e[24]=x,e[25]=m,e[26]=g,e[27]=v):v=e[27],v}function Ir(t){const e=R.c(6),{plans:s,onApprove:o,onDismiss:r}=t;let i;e[0]!==s?(i=Vs(s),e[0]=s,e[1]=i):i=e[1];const a=i;if(!a)return null;let l;return e[2]!==a||e[3]!==o||e[4]!==r?(l=n.jsx(Nr,{plan:a,onApprove:o,onDismiss:r}),e[2]=a,e[3]=o,e[4]=r,e[5]=l):l=e[5],l}function xs(t){return t?"response"in t?t.response:t.option??t.draft:""}const _t=re({response:ne().min(1,"Response is required")}),Tr=re({option:ne().nullable(),draft:ne()}).refine(t=>(t.option??t.draft).length>0,{message:"Please select or enter an option"}),_r=re({response:ze(["yes","no"])});function Mr(t){switch(t.type){case"text":return _t;case"choice":return Tr;case"confirm":return _r;default:return _t}}function Dr(t){const e={};for(const s of t)e[s.toolCallId]=Mr(s.input);return re(e)}function Rr(t){const e=R.c(7),{control:s,name:o,placeholder:r}=t,i=K();let a;e[0]!==r||e[1]!==i?(a=V=>{const{field:c}=V,u=c.value??"";return n.jsxs(ut,{children:[n.jsx(pt,{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(Gt,{size:16,className:"text-muted-foreground"})}),n.jsx("input",{...c,value:u,type:"text",placeholder:r||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(ft,{})]})},e[0]=r,e[1]=i,e[2]=a):a=e[2];let l;return e[3]!==s||e[4]!==o||e[5]!==a?(l=n.jsx(Xt,{control:s,name:o,render:a}),e[3]=s,e[4]=o,e[5]=a,e[6]=l):l=e[6],l}function vs(t,e){const s=R.c(4);let o,r;s[0]!==t||s[1]!==e?(o=()=>{const i=a=>{if(Ds(a.target)||a.metaKey||a.ctrlKey||a.altKey)return;const l=Number.parseInt(a.key,10);l>=1&&l<=t&&(a.preventDefault(),e(l-1))};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},r=[t,e],s[0]=t,s[1]=e,s[2]=o,s[3]=r):(o=s[2],r=s[3]),P.useEffect(o,r)}function Pr(t){const e=R.c(51),{control:s,name:o,options:r}=t,i=K(),a=`${o}.option`;let l;e[0]!==s||e[1]!==a?(l={control:s,name:a,defaultValue:null},e[0]=s,e[1]=a,e[2]=l):l=e[2];const{field:V}=xt(l),c=`${o}.draft`;let u;e[3]!==s||e[4]!==c?(u={control:s,name:c,defaultValue:""},e[3]=s,e[4]=c,e[5]=u):u=e[5];const{field:d}=xt(u),p=V.value,h=d.value??"";let f;if(e[6]!==V||e[7]!==r?(f=D=>{const T=r[D];T!=null&&V.onChange(T)},e[6]=V,e[7]=r,e[8]=f):f=e[8],vs(r.length,f),r.length===0)return null;const m=p===null;let g;e[9]!==i?(g=i("chat.userAskQuestion.choiceOptionsAriaLabel"),e[9]=i,e[10]=g):g=e[10];let x;if(e[11]!==V||e[12]!==p||e[13]!==r||e[14]!==i){let D;e[16]!==V||e[17]!==p||e[18]!==i?(D=(T,O)=>{const U=p===T;return n.jsxs("button",{type:"button",onClick:()=>V.onChange(T),className:$("flex items-start gap-3 px-2 py-3 rounded-lg text-left transition-colors w-full",U&&"bg-accent/50",!U&&"hover:bg-accent"),"aria-label":i("chat.userAskQuestion.selectOption",{option:T}),children:[n.jsx("span",{className:$("flex items-center justify-center size-6 rounded-md text-sm shrink-0 mt-0.5",U?"bg-chart-1 text-white":"bg-muted text-foreground"),children:O+1}),n.jsx("span",{className:"text-sm text-foreground min-w-0 break-words",children:T})]},`${O}-${T}`)},e[16]=V,e[17]=p,e[18]=i,e[19]=D):D=e[19],x=r.map(D),e[11]=V,e[12]=p,e[13]=r,e[14]=i,e[15]=x}else x=e[15];const v=m&&"bg-accent/50",b=!m&&"hover:bg-accent";let j;e[20]!==v||e[21]!==b?(j=$("flex items-center gap-3 px-2 py-3 rounded-lg transition-colors w-full cursor-text",v,b),e[20]=v,e[21]=b,e[22]=j):j=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(Gt,{size:16,className:"text-muted-foreground"})}),e[23]=A):A=e[23];const y=m?h:"";let k;e[24]!==d||e[25]!==V||e[26]!==p?(k=D=>{d.onChange(D.target.value),p!==null&&V.onChange(null)},e[24]=d,e[25]=V,e[26]=p,e[27]=k):k=e[27];let w;e[28]!==V||e[29]!==p?(w=()=>{p!==null&&V.onChange(null)},e[28]=V,e[29]=p,e[30]=w):w=e[30];let S;e[31]!==i?(S=i("chat.userAskQuestion.somethingElsePlaceholder"),e[31]=i,e[32]=S):S=e[32];let C;e[33]!==i?(C=i("chat.userAskQuestion.customChoiceInputAriaLabel"),e[33]=i,e[34]=C):C=e[34];let N;e[35]!==y||e[36]!==k||e[37]!==w||e[38]!==S||e[39]!==C?(N=n.jsx("input",{type:"text",value:y,onChange:k,onFocus:w,placeholder:S,"aria-label":C,className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"}),e[35]=y,e[36]=k,e[37]=w,e[38]=S,e[39]=C,e[40]=N):N=e[40];let I;e[41]!==j||e[42]!==N?(I=n.jsxs("label",{className:j,children:[A,N]}),e[41]=j,e[42]=N,e[43]=I):I=e[43];let _;e[44]!==I||e[45]!==g||e[46]!==x?(_=n.jsx(pt,{children:n.jsxs("div",{className:"flex flex-col px-2",role:"group","aria-label":g,children:[x,I]})}),e[44]=I,e[45]=g,e[46]=x,e[47]=_):_=e[47];let E;e[48]===Symbol.for("react.memo_cache_sentinel")?(E=n.jsx(ft,{}),e[48]=E):E=e[48];let F;return e[49]!==_?(F=n.jsxs(ut,{children:[_,E]}),e[49]=_,e[50]=F):F=e[50],F}function Er(t){const e=R.c(8),{control:s,name:o}=t,r=K();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=["yes","no"],e[0]=i):i=e[0];const a=i,l=P.useRef(null);let V;e[1]===Symbol.for("react.memo_cache_sentinel")?(V=d=>{l.current?.onChange(a[d]??"")},e[1]=V):V=e[1],vs(a.length,V);let c;e[2]!==r?(c=d=>{const{field:p}=d;return l.current=p,n.jsxs(ut,{children:[n.jsx(pt,{children:n.jsx("div",{className:"flex gap-2 px-2",role:"group","aria-label":r("chat.userAskQuestion.confirmationOptionsAriaLabel"),children:a.map(h=>{const f=p.value===h;return n.jsxs("button",{type:"button",onClick:()=>p.onChange(h),className:$("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":r("chat.userAskQuestion.confirmValue",{value:r(`chat.userAskQuestion.confirm${h==="yes"?"Yes":"No"}`)}),children:[n.jsx("span",{className:$("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:r(`chat.userAskQuestion.confirm${h==="yes"?"Yes":"No"}`)})]},h)})})}),n.jsx(ft,{})]})},e[2]=r,e[3]=c):c=e[3];let u;return e[4]!==s||e[5]!==o||e[6]!==c?(u=n.jsx(Xt,{control:s,name:o,render:c}),e[4]=s,e[5]=o,e[6]=c,e[7]=u):u=e[7],u}function Mt(t){const e=R.c(13),{input:s,control:o,toolCallId:r}=t;switch(s.type){case"text":{const i=`${r}.response`;let a;return e[0]!==o||e[1]!==s.default||e[2]!==i?(a=n.jsx(Rr,{control:o,name:i,placeholder:s.default}),e[0]=o,e[1]=s.default,e[2]=i,e[3]=a):a=e[3],a}case"choice":{let i;e[4]!==s.options?(i=s.options?.filter(Boolean)??[],e[4]=s.options,e[5]=i):i=e[5];const a=i;let l;return e[6]!==o||e[7]!==a||e[8]!==r?(l=n.jsx(Pr,{control:o,name:r,options:a}),e[6]=o,e[7]=a,e[8]=r,e[9]=l):l=e[9],l}case"confirm":{const i=`${r}.response`;let a;return e[10]!==o||e[11]!==i?(a=n.jsx(Er,{control:o,name:i}),e[10]=o,e[11]=i,e[12]=a):a=e[12],a}default:return null}}function Fr(t){const e=R.c(91),{parts:s,isStreaming:o,onSubmit:r}=t;let i;e[0]!==s?(i=Dr(s.map(Or)),e[0]=s,e[1]=i):i=e[1];const a=i;let l;e[2]!==s?(l=Object.fromEntries(s.map(zr)),e[2]=s,e[3]=l):l=e[3];const V=l;let c;e[4]!==r?(c=(z,Y)=>{const L=xs(Y);L&&r(z,L)},e[4]=r,e[5]=c):c=e[5];let u;e[6]!==V||e[7]!==o||e[8]!==s||e[9]!==a||e[10]!==c?(u={parts:s,partKey:Ur,schema:a,defaultValues:V,isStreaming:o,hasAnswer:Lr,onSubmit:c},e[6]=V,e[7]=o,e[8]=s,e[9]=a,e[10]=c,e[11]=u):u=e[11];const d=fs(u),p=d.currentPart,h=K();let f;e[12]!==p||e[13]!==d||e[14]!==h?(f=()=>{const z=p;if(!z)return;const Y=h("chat.userAskQuestion.skipMessage"),L=z.toolCallId;z.input?.type==="choice"?(d.form.setValue(`${L}.option`,null),d.form.setValue(`${L}.draft`,Y)):d.form.setValue(`${L}.response`,Y),d.advanceToNextUnanswered()},e[12]=p,e[13]=d,e[14]=h,e[15]=f):f=e[15];const m=f;let g;e[16]!==d.currentIndex||e[17]!==d.goNext||e[18]!==d.goPrev||e[19]!==s.length?(g=n.jsx(us,{currentIndex:d.currentIndex,total:s.length,onPrev:d.goPrev,onNext:d.goNext}),e[16]=d.currentIndex,e[17]=d.goNext,e[18]=d.goPrev,e[19]=s.length,e[20]=g):g=e[20];const x=g;let v;e[21]!==h?(v=h("chat.userAskQuestion.skip"),e[21]=h,e[22]=v):v=e[22];let b;e[23]!==m||e[24]!==v?(b=n.jsx(W,{type:"button",variant:"outline",size:"sm",onClick:m,className:"h-7",children:v}),e[23]=m,e[24]=v,e[25]=b):b=e[25];let j;e[26]!==d.isAllAnswered||e[27]!==d.isCurrentAnswered||e[28]!==d.submitOrAdvance||e[29]!==o?(j=n.jsx(mr,{isStreaming:o,isAllAnswered:d.isAllAnswered,isCurrentAnswered:d.isCurrentAnswered,onAdvanceOrSubmit:d.submitOrAdvance}),e[26]=d.isAllAnswered,e[27]=d.isCurrentAnswered,e[28]=d.submitOrAdvance,e[29]=o,e[30]=j):j=e[30];let A;e[31]!==b||e[32]!==j?(A=n.jsxs(n.Fragment,{children:[b,j]}),e[31]=b,e[32]=j,e[33]=A):A=e[33];const y=A;if(s.length===1){const z=s[0];if(!z?.input)return null;const Y=d.form;let L;e[34]!==d?(L=ee=>{ee.preventDefault(),d.submit()},e[34]=d,e[35]=L):L=e[35];let H;e[36]===Symbol.for("react.memo_cache_sentinel")?(H=n.jsx(nt,{size:14}),e[36]=H):H=e[36];let X;e[37]!==h?(X=h("chat.userAskQuestion.questionPending"),e[37]=h,e[38]=X):X=e[38];let Z;e[39]!==z.input?.prompt||e[40]!==h?(Z=z.input?.prompt??h("chat.userAskQuestion.question"),e[39]=z.input?.prompt,e[40]=h,e[41]=Z):Z=e[41];const ie=z.input;let M;e[42]!==d.form.control||e[43]!==z.toolCallId||e[44]!==ie?(M=n.jsx(Mt,{input:ie,control:d.form.control,toolCallId:z.toolCallId}),e[42]=d.form.control,e[43]=z.toolCallId,e[44]=ie,e[45]=M):M=e[45];let B;e[46]!==y||e[47]!==X||e[48]!==Z||e[49]!==M?(B=n.jsx(he,{icon:H,label:X,title:Z,defaultExpanded:!0,footerRight:y,children:M}),e[46]=y,e[47]=X,e[48]=Z,e[49]=M,e[50]=B):B=e[50];let J;e[51]!==L||e[52]!==B?(J=n.jsx("form",{onSubmit:L,autoComplete:"off",children:B}),e[51]=L,e[52]=B,e[53]=J):J=e[53];let se;return e[54]!==d.form||e[55]!==J?(se=n.jsx(ot,{...Y,children:J}),e[54]=d.form,e[55]=J,e[56]=se):se=e[56],se}const k=d.form;let w;e[57]!==d?(w=z=>{z.preventDefault(),d.submit()},e[57]=d,e[58]=w):w=e[58];let S;e[59]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(nt,{size:14}),e[59]=S):S=e[59];let C;e[60]!==h?(C=h("chat.userAskQuestion.questionPending"),e[60]=h,e[61]=C):C=e[61];const N=d.currentIndex+1;let I;e[62]!==s.length||e[63]!==h||e[64]!==N?(I=h("chat.userAskQuestion.questionCount",{current:N,total:s.length}),e[62]=s.length,e[63]=h,e[64]=N,e[65]=I):I=e[65];let _;e[66]!==p?.input?.prompt||e[67]!==h?(_=p?.input?.prompt??h("chat.userAskQuestion.question"),e[66]=p?.input?.prompt,e[67]=h,e[68]=_):_=e[68];const E=d.activeKey,F=d.setActiveKey;let D;if(e[69]!==d.form||e[70]!==s){let z;e[72]!==d.form?(z=Y=>n.jsx(Vo,{value:Y.toolCallId,className:"mt-0",children:n.jsx(Mt,{input:Y.input,control:d.form.control,toolCallId:Y.toolCallId})},Y.toolCallId),e[72]=d.form,e[73]=z):z=e[73],D=s.map(z),e[69]=d.form,e[70]=s,e[71]=D}else D=e[71];let T;e[74]!==d.activeKey||e[75]!==d.setActiveKey||e[76]!==D?(T=n.jsx(co,{value:E,onValueChange:F,children:D}),e[74]=d.activeKey,e[75]=d.setActiveKey,e[76]=D,e[77]=T):T=e[77];let O;e[78]!==x||e[79]!==y||e[80]!==C||e[81]!==I||e[82]!==_||e[83]!==T?(O=n.jsx(he,{icon:S,label:C,count:I,title:_,defaultExpanded:!0,footerLeft:x,footerRight:y,children:T}),e[78]=x,e[79]=y,e[80]=C,e[81]=I,e[82]=_,e[83]=T,e[84]=O):O=e[84];let U;e[85]!==w||e[86]!==O?(U=n.jsx("form",{onSubmit:w,autoComplete:"off",children:O}),e[85]=w,e[86]=O,e[87]=U):U=e[87];let Q;return e[88]!==d.form||e[89]!==U?(Q=n.jsx(ot,{...k,children:U}),e[88]=d.form,e[89]=U,e[90]=Q):Q=e[90],Q}function Lr(t){return!!xs(t)}function Ur(t){return t.toolCallId}function zr(t){return t.input?.type==="choice"?[t.toolCallId,{option:null,draft:""}]:[t.toolCallId,{response:""}]}function Or(t){return{toolCallId:t.toolCallId,input:t.input}}function $r(){const t=R.c(5),e=K();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(nt,{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 r;return t[3]!==o?(r=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]=r):r=t[4],r}function bs(t){const e=R.c(7),{userAskParts:s,isStreaming:o,onSubmit:r}=t;let i;e[0]!==s?(i=s.filter(Br),e[0]=s,e[1]=i):i=e[1];const a=i;if(a.length===0){if(o){let V;return e[2]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsx($r,{}),e[2]=V):V=e[2],V}return null}let l;return e[3]!==o||e[4]!==r||e[5]!==a?(l=n.jsx(Fr,{parts:a,isStreaming:o,onSubmit:r}),e[3]=o,e[4]=r,e[5]=a,e[6]=l):l=e[6],l}function Br(t){return t.state==="input-available"}function Kr(t){const e=R.c(33),{parts:s,isStreaming:o,onRespond:r}=t,i=K();let a;e[0]!==s?(a=s.at(-1),e[0]=s,e[1]=a):a=e[1];const l=a,V=l?.input;if(!l||!V?.title)return null;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(Wt,{size:14}),e[2]=c):c=e[2];let u;e[3]!==i?(u=i("chat.suggestTask.label"),e[3]=i,e[4]=u):u=e[4];const d=V.title;let p;e[5]!==r||e[6]!==l?(p=()=>r(l,!1),e[5]=r,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]!==r||e[15]!==l?(m=()=>r(l,!0),e[14]=r,e[15]=l,e[16]=m):m=e[16];let g;e[17]!==i?(g=i("chat.suggestTask.create"),e[17]=i,e[18]=g):g=e[18];let x;e[19]!==o||e[20]!==m||e[21]!==g?(x=n.jsx(W,{type:"button",size:"sm",className:"h-7",disabled:o,onClick:m,children:g}),e[19]=o,e[20]=m,e[21]=g,e[22]=x):x=e[22];let v;e[23]!==x||e[24]!==f?(v=n.jsxs(n.Fragment,{children:[f,x]}),e[23]=x,e[24]=f,e[25]=v):v=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 j;return e[28]!==V.title||e[29]!==v||e[30]!==b||e[31]!==u?(j=n.jsx(he,{icon:c,label:u,title:d,defaultExpanded:!0,footerRight:v,children:b}),e[28]=V.title,e[29]=v,e[30]=b,e[31]=u,e[32]=j):j=e[32],j}function qr(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[r]=e;return r&&e.length===1?{icon:"in_progress",activity:r.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 Qr(t){const e=R.c(13),{todos:s}=t;if(s.length===0)return null;let o;e[0]!==s?(o=qr(s),e[0]=s,e[1]=o):o=e[1];const r=o;let i;e[2]!==r.icon?(i=n.jsx(Hr,{status:r.icon}),e[2]=r.icon,e[3]=i):i=e[3];const a=r.activity,l=r.progress;let V;e[4]!==s?(V=s.map(Yr),e[4]=s,e[5]=V):V=e[5];let c;e[6]!==V?(c=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]=c):c=e[7];let u;return e[8]!==r.activity||e[9]!==r.progress||e[10]!==i||e[11]!==c?(u=n.jsx(he,{icon:i,label:a,count:l,defaultExpanded:!1,children:c}),e[8]=r.activity,e[9]=r.progress,e[10]=i,e[11]=c,e[12]=u):u=e[12],u}function Yr(t,e){return n.jsx(Wr,{todo:t},e)}function Wr(t){const e=R.c(14),{todo:s}=t,o=s.status==="completed",i=s.status==="in_progress"?s.activeForm:s.content;let a;e[0]!==s.status?(a=n.jsx(Gr,{status:s.status}),e[0]=s.status,e[1]=a):a=e[1];const l=o&&"text-muted-foreground";let V;e[2]!==l?(V=$("relative text-sm leading-snug pt-px select-none",l),e[2]=l,e[3]=V):V=e[3];const c=o?"100%":"0%",u=o?"width 300ms ease 200ms":"width 150ms ease";let d;e[4]!==c||e[5]!==u?(d=n.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:"50%",height:"1px",background:"currentColor",width:c,transition:u}}),e[4]=c,e[5]=u,e[6]=d):d=e[6];let p;e[7]!==i||e[8]!==V||e[9]!==d?(p=n.jsxs("span",{className:V,children:[i,d]}),e[7]=i,e[8]=V,e[9]=d,e[10]=p):p=e[10];let h;return e[11]!==a||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:[a,p]}),e[11]=a,e[12]=p,e[13]=h):h=e[13],h}function Gr(t){const e=R.c(4),{status:s}=t,o=s==="completed"?"true":void 0,r=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 a;return e[1]!==o||e[2]!==r?(a=n.jsx("div",{className:"todo-cb mt-0.5","data-checked":o,"data-progress":r,"aria-hidden":"true",children:i}),e[1]=o,e[2]=r,e[3]=a):a=e[3],a}function Hr(t){const e=R.c(13),{status:s}=t,o=K();if(s==="completed"){let a;e[0]!==o?(a=o("chat.todoStatus.completed"),e[0]=o,e[1]=a):a=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]!==a?(V=n.jsx("span",{"aria-label":a,className:"inline-flex items-center justify-center w-3.5 h-3.5 rounded-sm bg-primary",children:l}),e[3]=a,e[4]=V):V=e[4],V}if(s==="in_progress"){let a;e[5]!==o?(a=o("chat.todoStatus.inProgress"),e[5]=o,e[6]=a):a=e[6];let l;return e[7]!==a?(l=n.jsx("span",{"aria-label":a,className:"inline-block w-2 h-2 rounded-full bg-primary animate-pulse shrink-0"}),e[7]=a,e[8]=l):l=e[8],l}let r;e[9]!==o?(r=o("chat.todoStatus.pending"),e[9]=o,e[10]=r):r=e[10];let i;return e[11]!==r?(i=n.jsx("span",{"aria-label":r,className:"inline-block w-3.5 h-3.5 rounded-sm border-[1.5px] border-muted-foreground/50 shrink-0"}),e[11]=r,e[12]=i):i=e[12],i}const Jr={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"}]},Zr={"credits.topUp.starter":"starter","credits.topUp.popular":"popular","credits.topUp.bestValue":"best_value"};function Xr(t){const e=R.c(46),{source:s,onDone:o}=t,r=K(),i=Rs(),[a]=Ce(),[l,V]=P.useState(a.language==="pt-BR"?"brl":"usd"),[c,u]=P.useState(""),[d,p]=P.useState(!1),h=l==="brl"?"R$":"$";let f;e[0]!==l||e[1]!==i?(f=async T=>{const{url:O}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:T,currency:l});return O},e[0]=l,e[1]=i,e[2]=f):f=e[2];let m;e[3]!==o?(m=T=>{T&&window.open(T,"_blank","noopener,noreferrer"),o?.()},e[3]=o,e[4]=m):m=e[4];let g;e[5]!==r?(g=T=>{_e.error(r("credits.topUp.failed",{message:T.message}))},e[5]=r,e[6]=g):g=e[6];let x;e[7]!==f||e[8]!==m||e[9]!==g?(x={mutationFn:f,onSuccess:m,onError:g},e[7]=f,e[8]=m,e[9]=g,e[10]=x):x=e[10];const{mutate:v,isPending:b}=Ps(x);let j;e[11]!==l||e[12]!==s||e[13]!==v?(j=(T,O)=>{te("credits_topup_clicked",{amount_cents:T,currency:l,tier_label:O,source:s}),v(T)},e[11]=l,e[12]=s,e[13]=v,e[14]=j):j=e[14];const A=j,y=parseFloat(c),k=!isNaN(y)&&y>=1;let w,S,C;e[15]===Symbol.for("react.memo_cache_sentinel")?(w=T=>{T&&V(T)},S=n.jsx(kt,{value:"usd",className:"h-8 px-3 text-xs",children:"USD"}),C=n.jsx(kt,{value:"brl",className:"h-8 px-3 text-xs",children:"BRL"}),e[15]=w,e[16]=S,e[17]=C):(w=e[15],S=e[16],C=e[17]);let N;e[18]!==l?(N=n.jsx("div",{className:"mb-4",children:n.jsxs(mo,{type:"single",variant:"outline",size:"sm",value:l,onValueChange:w,children:[S,C]})}),e[18]=l,e[19]=N):N=e[19];const I=Jr[l];let _;if(e[20]!==A||e[21]!==h||e[22]!==b||e[23]!==r||e[24]!==I){let T;e[26]!==A||e[27]!==h||e[28]!==b||e[29]!==r?(T=O=>{const{dollars:U,labelKey:Q}=O;return n.jsxs("button",{type:"button",disabled:b,onClick:()=>A(U*100,Zr[Q]??"preset"),className:$("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,U]}),n.jsx("span",{className:"text-xs text-muted-foreground",children:r(Q)})]},U)},e[26]=A,e[27]=h,e[28]=b,e[29]=r,e[30]=T):T=e[30],_=I.map(T),e[20]=A,e[21]=h,e[22]=b,e[23]=r,e[24]=I,e[25]=_}else _=e[25];let E;e[31]!==_?(E=n.jsx("div",{className:"grid grid-cols-3 gap-2.5",children:_}),e[31]=_,e[32]=E):E=e[32];let F;e[33]!==A||e[34]!==h||e[35]!==c||e[36]!==y||e[37]!==k||e[38]!==b||e[39]!==d||e[40]!==r?(F=d?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(Es,{type:"number",min:"1",step:"1",placeholder:r("credits.topUp.customPlaceholder"),value:c,onChange:T=>u(T.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),n.jsx(W,{size:"lg",disabled:!k||b,onClick:()=>A(Math.round(y*100),"custom"),children:r(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:r("credits.topUp.enterCustom")}),e[33]=A,e[34]=h,e[35]=c,e[36]=y,e[37]=k,e[38]=b,e[39]=d,e[40]=r,e[41]=F):F=e[41];let D;return e[42]!==E||e[43]!==F||e[44]!==N?(D=n.jsxs("div",{children:[N,E,F]}),e[42]=E,e[43]=F,e[44]=N,e[45]=D):D=e[45],D}const ei=["chat.creditsExhaustedBanner.benefit1","chat.creditsExhaustedBanner.benefit2","chat.creditsExhaustedBanner.benefit3"];function ti(t){const e=R.c(47),{onDismiss:s}=t,{org:o}=Me(),r=at(),{decoKeyId:i}=ho(),a=K(),l=$e("credits");let V,c;if(e[0]!==o.id?(V=()=>{te("credits_exhausted_shown",{organization_id:o.id})},c=[o.id],e[0]=o.id,e[1]=V,e[2]=c):(V=e[1],c=e[2]),P.useEffect(V,c),!l)return null;let u;e[3]!==s?(u=I=>!I&&s?.(),e[3]=s,e[4]=u):u=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=["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]=d):d=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:d.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]!==a?(f=a("chat.creditsExhaustedBanner.title"),e[8]=a,e[9]=f):f=e[9];let m;e[10]!==f?(m=n.jsx(Fs,{className:"text-xl font-semibold tracking-tight",children:f}),e[10]=f,e[11]=m):m=e[11];let g;e[12]!==a?(g=a("chat.creditsExhaustedBanner.description"),e[12]=a,e[13]=g):g=e[13];let x;e[14]!==g?(x=n.jsx(Ls,{className:"mt-1.5 text-sm leading-relaxed",children:g}),e[14]=g,e[15]=x):x=e[15];let v;e[16]!==x||e[17]!==m?(v=n.jsxs("div",{className:"relative px-8 pt-8 pb-2 overflow-hidden",children:[p,n.jsxs(Us,{className:"relative gap-4",children:[h,n.jsxs("div",{children:[m,x]})]})]}),e[16]=x,e[17]=m,e[18]=v):v=e[18];let b;e[19]!==i||e[20]!==s||e[21]!==a?(b=i&&n.jsxs("div",{className:"px-8 pt-5 pb-6",children:[n.jsx("div",{className:"surface p-5",children:n.jsx(Xr,{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:ei.map(I=>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(lt,{size:12,className:"text-success"})}),n.jsx("span",{className:"text-sm text-foreground/80",children:a(I)})]},I))})]}),e[19]=i,e[20]=s,e[21]=a,e[22]=b):b=e[22];let j;e[23]!==a?(j=a("chat.creditsExhaustedBanner.dismiss"),e[23]=a,e[24]=j):j=e[24];let A;e[25]!==s||e[26]!==j?(A=n.jsx(W,{variant:"ghost",size:"sm",onClick:s,children:j}),e[25]=s,e[26]=j,e[27]=A):A=e[27];let y;e[28]!==r||e[29]!==s||e[30]!==o.slug?(y=()=>{r({to:"/$org/settings/ai-providers",params:{org:o.slug}}),s?.()},e[28]=r,e[29]=s,e[30]=o.slug,e[31]=y):y=e[31];let k;e[32]!==a?(k=a("chat.creditsExhaustedBanner.manageProviders"),e[32]=a,e[33]=k):k=e[33];let w;e[34]!==y||e[35]!==k?(w=n.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:y,children:k}),e[34]=y,e[35]=k,e[36]=w):w=e[36];let S;e[37]!==A||e[38]!==w?(S=n.jsxs("div",{className:"px-8 py-4 border-t border-border bg-muted/30 flex items-center justify-between",children:[A,w]}),e[37]=A,e[38]=w,e[39]=S):S=e[39];let C;e[40]!==v||e[41]!==b||e[42]!==S?(C=n.jsxs(zs,{className:"sm:max-w-[520px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:si,children:[v,b,S]}),e[40]=v,e[41]=b,e[42]=S,e[43]=C):C=e[43];let N;return e[44]!==C||e[45]!==u?(N=n.jsx(Os,{open:!0,onOpenChange:u,children:C}),e[44]=C,e[45]=u,e[46]=N):N=e[46],N}function si(t){return t.preventDefault()}const ni={trial_exhausted:{label:"chat.subscriptionLimit.trialLabel",title:"chat.subscriptionLimit.trialTitle"},monthly_exhausted:{label:"chat.subscriptionLimit.monthlyLabel",title:"chat.subscriptionLimit.monthlyTitle"},runs_exhausted:{label:"chat.subscriptionLimit.runsLabel",title:"chat.subscriptionLimit.runsTitle"}};function oi(t){const e=R.c(16),{kind:s,onDismiss:o,onSubscribe:r}=t,i=K(),{label:a,title:l}=ni[s];let V;e[0]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsx(dt,{size:14}),e[0]=V):V=e[0];let c;e[1]!==a||e[2]!==i?(c=i(a),e[1]=a,e[2]=i,e[3]=c):c=e[3];let u;e[4]!==i||e[5]!==l?(u=i(l),e[4]=i,e[5]=l,e[6]=u):u=e[6];let d;e[7]!==s||e[8]!==r||e[9]!==i?(d=s==="trial_exhausted"?n.jsx(W,{size:"sm",onClick:r,className:"h-7 text-xs",children:i("chat.subscriptionLimit.subscribeButton")}):void 0,e[7]=s,e[8]=r,e[9]=i,e[10]=d):d=e[10];let p;return e[11]!==o||e[12]!==c||e[13]!==u||e[14]!==d?(p=n.jsx(he,{icon:V,label:c,title:u,defaultExpanded:!0,variant:"warning",onClose:o,footerRight:d}),e[11]=o,e[12]=c,e[13]=u,e[14]=d,e[15]=p):p=e[15],p}const ri={ai_budget_exhausted:{label:"chat.planRefused.budgetLabel",title:"chat.planRefused.budgetTitle"},feature_not_in_plan:{label:"chat.planRefused.featureLabel",title:"chat.planRefused.featureTitle"}};function Dt(t){const e=R.c(21),{kind:s,onDismiss:o}=t,r=K(),i=at(),{org:a}=Me(),{label:l,title:V}=ri[s];let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(dt,{size:14}),e[0]=c):c=e[0];let u;e[1]!==l||e[2]!==r?(u=r(l),e[1]=l,e[2]=r,e[3]=u):u=e[3];let d;e[4]!==r||e[5]!==V?(d=r(V),e[4]=r,e[5]=V,e[6]=d):d=e[6];let p;e[7]!==i||e[8]!==o||e[9]!==a.slug?(p=()=>{i({to:"/$org/settings/ai-providers",params:{org:a.slug}}),o()},e[7]=i,e[8]=o,e[9]=a.slug,e[10]=p):p=e[10];let h;e[11]!==r?(h=r("chat.planRefused.seePlans"),e[11]=r,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]!==d||e[19]!==f?(m=n.jsx(he,{icon:c,label:u,title:d,defaultExpanded:!0,variant:"warning",onClose:o,footerRight:f}),e[16]=o,e[17]=u,e[18]=d,e[19]=f,e[20]=m):m=e[20],m}function As(t){const e=ii(t);if(e!==null){const c=As(e);return{summary:c.summary,rawDetails:c.rawDetails??t}}const s=t.trim(),o=s.startsWith("<")&&/<[a-z][\s\S]*>/i.test(s),r=/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),a=/timeout|timed out|aborted|deadline/i.test(s),l=s.length>240,V=/sandbox failed to start(?::\s*(.+))?/is.exec(s);if(V){const c=V[1]?.trim().replace(/\.$/,"");return{summary:c?`Your sandbox didn't finish starting up (${c}). Try again.`:"Your sandbox didn't finish starting up. Try again.",rawDetails:t}}return r||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}:a?{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 ii(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:r}=s,i=typeof o=="string"?o:r;return typeof i=="string"&&i.trim()&&!i.trim().startsWith("{")?i:null}const ai={length:"chat.highlight.warningDescriptionLength","content-filter":"chat.highlight.warningDescriptionContentFilter","tool-calls":"chat.highlight.warningDescriptionToolCalls"};function Ye(t){const e=R.c(29),s=K(),{variant:o,onDismiss:r}=t,i=o==="error";let a;e[0]!==i||e[1]!==s?(a=s(i?"chat.highlight.errorOccurred":"chat.highlight.responseIncomplete"),e[0]=i,e[1]=s,e[2]=a):a=e[2];const l=a,V=i?to:Bs;let c;e[3]!==t.error||e[4]!==t.finishReason||e[5]!==t.variant||e[6]!==s?(c=t.variant==="error"?t.error.message:(()=>{const v=ai[t.finishReason];return v?s(v):s("chat.highlight.responseStoppedUnexpectedly",{reason:t.finishReason})})(),e[3]=t.error,e[4]=t.finishReason,e[5]=t.variant,e[6]=s,e[7]=c):c=e[7];const u=c;let d;e[8]!==i||e[9]!==u?(d=i?As(u):{summary:u,rawDetails:null},e[8]=i,e[9]=u,e[10]=d):d=e[10];const{summary:p,rawDetails:h}=d;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 g;e[18]!==h||e[19]!==s?(g=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(()=>_e.success(s("chat.highlight.copiedToClipboard"))).catch(()=>_e.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(so,{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]=g):g=e[20];let x;return e[21]!==l||e[22]!==r||e[23]!==p||e[24]!==f||e[25]!==m||e[26]!==g||e[27]!==o?(x=n.jsx(he,{icon:f,label:l,title:p,defaultExpanded:!0,variant:o,onClose:r,footerRight:m,children:g}),e[21]=l,e[22]=r,e[23]=p,e[24]=f,e[25]=m,e[26]=g,e[27]=o,e[28]=x):x=e[28],x}function Be(t){const e=R.c(78);let s;e[0]!==t?(s=t===void 0?{}:t,e[0]=t,e[1]=s):s=e[1];const{inline:o,voiceMode:r}=s,i=o===void 0?!1:o,a=r===void 0?!1:r,l=K(),{error:V,clearError:c,finishReason:u,clearFinishReason:d,messages:p,isStreaming:h,submit:f,sendMessage:m}=Oe(),[g,x]=Ce(),{virtualMcpId:v,createTaskWithMessage:b}=Vt(),{chatMode:j,setChatMode:A,simpleModeTier:y}=We(),k=$e("credits"),{mutate:w}=Ao("ORGANIZATION_BILLING_CHECKOUT_START","taskBoard.subscriptionPaywall.checkoutError");let S;e[2]!==w?(S=()=>w(),e[2]=w,e[3]=S):S=e[3];const C=S;let N;e[4]!==j||e[5]!==y||e[6]!==v||e[7]!==a?(N=oe=>({...a?{voiceMode:!0}:{},tier:y,mode:j,toolApprovalLevel:oe,agent:v?{id:v}:void 0}),e[4]=j,e[5]=y,e[6]=v,e[7]=a,e[8]=N):N=e[8];const I=N;let _;e[9]!==g.toolApprovalLevel?(_=g.toolApprovalLevel??$s(),e[9]=g.toolApprovalLevel,e[10]=_):_=e[10];const E=_,F=p.at(-1),D=F?.role==="assistant"?F.parts:[],T=D.filter(di),O=D.filter($t),U=cs(D),Q=ls(D);let z;e[11]!==V||e[12]!==m||e[13]!==l?(z=()=>{if(V){const fe={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:l("chat.highlight.fixInChatMessage",{error:V.message})}]}]};m(fe)}},e[11]=V,e[12]=m,e[13]=l,e[14]=z):z=e[14];const Y=z;let L;e[15]!==m||e[16]!==l?(L=()=>{const oe={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:l("chat.highlight.pleaseContinue")}]}]};m(oe)},e[15]=m,e[16]=l,e[17]=L):L=e[17];const H=L;let X;e[18]!==I||e[19]!==E||e[20]!==f?(X=(oe,fe)=>{f({kind:"toolOutput",toolCallId:oe.toolCallId,output:{response:fe}},I(E))},e[18]=I,e[19]=E,e[20]=f,e[21]=X):X=e[21];const Z=X;let ie;e[22]!==I||e[23]!==E||e[24]!==f?(ie=(oe,fe)=>{f({kind:"toolOutput",toolCallId:oe.toolCallId,output:{accepted:fe}},I(E))},e[22]=I,e[23]=E,e[24]=f,e[25]=ie):ie=e[25];const M=ie;let B;e[26]!==b||e[27]!==g||e[28]!==A||e[29]!==x||e[30]!==l||e[31]!==v?(B=oe=>{A("default"),x({...g,toolApprovalLevel:"auto"}),b({virtualMcpId:v,message:{parts:[{type:"text",text:l("chat.highlight.implementPlanMessage",{plan:oe})}]}})},e[26]=b,e[27]=g,e[28]=A,e[29]=x,e[30]=l,e[31]=v,e[32]=B):B=e[32];const J=B,se=ci;let ee;e[33]!==I||e[34]!==f?(ee=(oe,fe,qe,Ae)=>{f({kind:"approval",approvalId:oe,approved:fe,...qe?{reason:qe}:{}},I(Ae))},e[33]=I,e[34]=f,e[35]=ee):ee=e[35];const le=ee,G=ds();if(G.isCreditExhausted){let oe;return e[36]!==k||e[37]!==c||e[38]!==i?(oe=k?n.jsx(ti,{onDismiss:c}):n.jsx("div",{className:$(!i&&"absolute bottom-full left-0 right-0"),children:n.jsx(Dt,{kind:"ai_budget_exhausted",onDismiss:c})}),e[36]=k,e[37]=c,e[38]=i,e[39]=oe):oe=e[39],oe}const{showError:ae,showWarning:Ve,hasApprovals:ce}=G,Ne=T.map(Vi).join("|"),De=Vs(U)?.toolCallId??"",Ke=Q.map(li).join("|"),ue=!i&&"absolute bottom-full left-0 right-0";let pe;e[40]!==ue?(pe=$(ue),e[40]=ue,e[41]=pe):pe=e[41];let me;e[42]!==G.todos?(me=n.jsx(Qr,{todos:G.todos}),e[42]=G.todos,e[43]=me):me=e[43];let xe;e[44]!==c||e[45]!==G.subscriptionErrorKind||e[46]!==C?(xe=G.subscriptionErrorKind&&n.jsx(oi,{kind:G.subscriptionErrorKind,onDismiss:c,onSubscribe:C}),e[44]=c,e[45]=G.subscriptionErrorKind,e[46]=C,e[47]=xe):xe=e[47];let de;e[48]!==c||e[49]!==G.planRefusal?(de=G.planRefusal&&n.jsx(Dt,{kind:G.planRefusal,onDismiss:c}),e[48]=c,e[49]=G.planRefusal,e[50]=de):de=e[50];let ve;e[51]!==c||e[52]!==V||e[53]!==Y||e[54]!==ae?(ve=ae&&n.jsx(Ye,{variant:"error",error:V,onDismiss:c,onFixInChat:Y}),e[51]=c,e[52]=V,e[53]=Y,e[54]=ae,e[55]=ve):ve=e[55];let ke;e[56]!==d||e[57]!==u||e[58]!==H||e[59]!==Ve?(ke=Ve&&n.jsx(Ye,{variant:"warning",finishReason:u,onDismiss:d,onContinue:H}),e[56]=d,e[57]=u,e[58]=H,e[59]=Ve,e[60]=ke):ke=e[60];const Ie=ce&&n.jsx(Cr,{approvals:Q,isStreaming:h,onRespond:le},Ke),Re=G.hasPlans&&n.jsx(Ir,{plans:U,isStreaming:h,onApprove:J,onDismiss:se},De),Pe=G.hasTaskSuggestion&&n.jsx(Kr,{parts:O,isStreaming:h,onRespond:M},O.at(-1)?.toolCallId??"");let be;e[61]!==G.isWaitingForUserInput||e[62]!==Z||e[63]!==h||e[64]!==Ne||e[65]!==T?(be=G.isWaitingForUserInput&&n.jsx(bs,{userAskParts:T,isStreaming:h,onSubmit:Z},Ne),e[61]=G.isWaitingForUserInput,e[62]=Z,e[63]=h,e[64]=Ne,e[65]=T,e[66]=be):be=e[66];let we;return e[67]!==pe||e[68]!==me||e[69]!==xe||e[70]!==de||e[71]!==ve||e[72]!==ke||e[73]!==Ie||e[74]!==Re||e[75]!==Pe||e[76]!==be?(we=n.jsxs("div",{className:pe,children:[me,xe,de,ve,ke,Ie,Re,Pe,be]}),e[67]=pe,e[68]=me,e[69]=xe,e[70]=de,e[71]=ve,e[72]=ke,e[73]=Ie,e[74]=Re,e[75]=Pe,e[76]=be,e[77]=we):we=e[77],we}function li(t){return t.approvalId}function Vi(t){return t.toolCallId}function ci(){document.querySelector("[data-chat-input]")?.focus()}function di(t){return t.type==="tool-user_ask"}Be.Error=function(e){return n.jsx(Ye,{variant:"error",error:e.error,onDismiss:e.onDismiss,onFixInChat:e.onFixInChat})};Be.Warning=function(e){return n.jsx(Ye,{variant:"warning",finishReason:e.finishReason,onDismiss:e.onDismiss,onContinue:e.onContinue})};Be.UserAskQuestion=bs;function ys(t){const e=R.c(20),{taskId:s}=t,o=K(),r=An(s),i=yn(r),a=jn(),{stop:l,removeLocalMessage:V}=Oe();if(i.length===0)return null;let c;e[0]!==o?(c=o("chat.queueTray.sendNow"),e[0]=o,e[1]=c):c=e[1];let u;e[2]!==l?(u=()=>{l()},e[2]=l,e[3]=u):u=e[3];let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(Qt,{size:14}),e[4]=d):d=e[4];let p;e[5]!==c||e[6]!==u?(p=n.jsx(He,{asChild:!0,children:n.jsx(W,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c,onClick:u,children:d})}),e[5]=c,e[6]=u,e[7]=p):p=e[7];let h;e[8]!==o?(h=o("chat.queueTray.sendNow"),e[8]=o,e[9]=h):h=e[9];let f;e[10]!==h?(f=n.jsx(Je,{side:"top",children:n.jsx("p",{className:"text-xs",children:h})}),e[10]=h,e[11]=f):f=e[11];let m;e[12]!==p||e[13]!==f?(m=n.jsxs(Ze,{delayDuration:400,children:[p,f]}),e[12]=p,e[13]=f,e[14]=m):m=e[14];let g;return e[15]!==a||e[16]!==V||e[17]!==o||e[18]!==s?(g=(x,v)=>n.jsxs("div",{className:"group/queuerow flex items-center gap-2 px-3 py-1.5",children:[n.jsx("span",{className:"flex size-[18px] shrink-0 items-center justify-center rounded-full bg-muted text-2xs font-semibold text-muted-foreground dark:bg-background",children:v+1}),n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:x.text}),n.jsx("div",{className:"flex shrink-0 items-center gap-1 opacity-0 transition-opacity focus-within:opacity-100 group-hover/queuerow:opacity-100",children:n.jsx(W,{type:"button",variant:"ghost",size:"icon-sm",title:o("chat.queueTray.removeFromQueue"),"aria-label":o("chat.queueTray.removeFromQueue"),onClick:()=>{a.cancel(s,x.messageId).then(b=>{b&&(kn(s,x.messageId),V(x.messageId))})},children:n.jsx(Kt,{className:"size-3.5"})})})]},x.messageId),e[15]=a,e[16]=V,e[17]=o,e[18]=s,e[19]=g):g=e[19],n.jsxs("div",{className:"mb-1 overflow-hidden surface dark:bg-muted",children:[n.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-border py-1.5 pr-2 pl-3 text-xs text-muted-foreground",children:[n.jsx("span",{children:o(i.length===1?"chat.queueTray.queuedMessage":"chat.queueTray.queuedMessages",{count:i.length})}),m]}),i.map(g)]})}function ui(t){return["openai-compatible","openrouter","deco"].includes(t)}function pi(t,e){return ui(t)&&fi(e)!==null}function fi(t){const e=t.replace(/^openai\//,"");return/^(gpt-\d|o[134](?:-|$))/.test(e)?e:null}const hi={anthropic:/^claude-/,openrouter:/^anthropic\/claude-/,deco:/^anthropic\/claude-/};function mi(t,e){return hi[t]?.test(e)??!1}function gi(t){return Do(t)&&mi(t.providerId,t.modelId)}function xi(t,e){return t?{modelId:t.modelId,title:t.title??t.modelId,keyId:t.keyId,providerId:e,description:null,logo:null,capabilities:[],limits:null,costs:null}:null}const vi={fast:"chat.tierTrigger.tierFast",smart:"chat.tierTrigger.tierSmart",thinking:"chat.tierTrigger.tierThinking"};function bi(t){const e=R.c(32),{tier:s,orgSlot:o,userSlot:r,autoSlot:i,filterModels:a,onPick:l,onReset:V,onClose:c}=t,u=K(),d=rs(),p=new Set(d.map(Ai)),h=wn([r,o,i],p),f=h?.keyId??null,[m,g]=P.useState(f??d[0]?.id??null),x=d.some(U=>U.id===m)?m:f??d[0]?.id??null,v=x?d.find(U=>U.id===x):null,b="flex h-[70vh] max-h-[460px] w-full flex-col",j=vi[s];let A;e[0]!==u||e[1]!==j?(A=u(j),e[0]=u,e[1]=j,e[2]=A):A=e[2];let y;e[3]!==A?(y=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:A}),e[3]=A,e[4]=y):y=e[4];let k;e[5]!==V||e[6]!==u||e[7]!==r?(k=r&&n.jsx("button",{type:"button",onClick:V,className:"text-xs text-muted-foreground hover:text-foreground px-2 py-1 rounded-lg hover:bg-accent cursor-pointer",children:u("chat.modelPreferences.reset")}),e[5]=V,e[6]=u,e[7]=r,e[8]=k):k=e[8];let w;e[9]!==y||e[10]!==k?(w=n.jsxs("div",{className:"flex items-center justify-between px-3 h-8 shrink-0",children:[y,k]}),e[9]=y,e[10]=k,e[11]=w):w=e[11];const S="flex-1 min-h-0",C=P.Suspense;let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(jo,{}),e[12]=N):N=e[12];const I=yo,_=!0,E=xi(f?h:null,v?.providerId??"deco");let F;e[13]!==x||e[14]!==l||e[15]!==g?(F=U=>{const Q=U.keyId??x??"";g(Q),l({keyId:Q,modelId:U.modelId,title:U.title})},e[13]=x,e[14]=l,e[15]=g,e[16]=F):F=e[16];let D;e[17]!==I||e[18]!==x||e[19]!==a||e[20]!==c||e[21]!==g||e[22]!==E||e[23]!==F?(D=n.jsx(I,{compact:_,filterModels:a,onClose:c,credentialId:x,onCredentialChange:g,selectedModel:E,onModelChange:F}),e[17]=I,e[18]=x,e[19]=a,e[20]=c,e[21]=g,e[22]=E,e[23]=F,e[24]=D):D=e[24];let T;e[25]!==C||e[26]!==D||e[27]!==N?(T=n.jsx("div",{className:S,children:n.jsx(C,{fallback:N,children:D})}),e[25]=C,e[26]=D,e[27]=N,e[28]=T):T=e[28];let O;return e[29]!==T||e[30]!==w?(O=n.jsxs("div",{className:b,children:[w,T]}),e[29]=T,e[30]=w,e[31]=O):O=e[31],O}function Ai(t){return t.id}const yi=["fast","smart","thinking"];function js(t){return{fast:t("chat.tierTrigger.tierFast"),smart:t("chat.tierTrigger.tierSmart"),thinking:t("chat.tierTrigger.tierThinking")}}const Rt={fast:"chat.agentModels.quickerResponses",smart:"chat.agentModels.balancedQuality",thinking:"chat.agentModels.deeperReasoning"};function ji(t){const e=R.c(28),{tier:s,pillIcon:o,groups:r}=t,i=K();let a;e[0]!==i?(a=js(i),e[0]=i,e[1]=a):a=e[1];const l=a,[V,c]=P.useState(!1);let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=w=>{w.onSelect(),c(!1)},e[2]=u):u=e[2];const d=u,p=l[s];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=$("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),e[3]=h):h=e[3];let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=$("min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0","@[320px]/chat-bottom:max-w-24 @[320px]/chat-bottom:opacity-100"),e[4]=f):f=e[4];const m=l[s];let g;e[5]!==m?(g=n.jsx("span",{className:f,children:m}),e[5]=m,e[6]=g):g=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(es,{size:12,className:"opacity-60 hidden @[320px]/chat-bottom:inline-block"}),e[7]=x):x=e[7];let v;e[8]!==o||e[9]!==p||e[10]!==g?(v=n.jsx(He,{asChild:!0,children:n.jsx("span",{className:"inline-flex min-w-0 shrink",children:n.jsx(ts,{asChild:!0,children:n.jsxs(W,{type:"button",variant:"ghost",size:"default","aria-label":p,className:h,children:[o,g,x]})})})}),e[8]=o,e[9]=p,e[10]=g,e[11]=v):v=e[11];let b;e[12]!==p?(b=n.jsx(Je,{children:p}),e[12]=p,e[13]=b):b=e[13];let j;e[14]!==v||e[15]!==b?(j=n.jsxs(Ze,{children:[v,b]}),e[14]=v,e[15]=b,e[16]=j):j=e[16];let A;if(e[17]!==r||e[18]!==i){let w;e[20]!==i?(w=S=>n.jsx("div",{className:"flex flex-col",children:S.rows.map(C=>n.jsxs("div",{className:"group/tier-row relative flex items-stretch rounded-lg hover:bg-accent",children:[n.jsxs("button",{type:"button",role:"menuitem","aria-label":C.title,onClick:()=>d(C),className:$("flex flex-1 min-w-0 items-start gap-2 px-2 py-1.5 text-left",C.modelOverride&&"pr-7 [@media(hover:hover)]:pr-2"),children:[C.icon&&n.jsx("span",{className:"shrink-0 text-muted-foreground mt-0.5",children:C.icon}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"text-sm",children:C.title}),C.subtitle&&n.jsx("div",{className:"text-xs text-muted-foreground",children:C.subtitle})]}),C.active&&n.jsx("span",{title:i("chat.tierTrigger.selected"),children:n.jsx(lt,{size:14,className:"text-foreground mt-0.5"})})]}),C.modelOverride&&n.jsx(wi,{label:C.title,render:C.modelOverride})]},C.key))},S.key),e[20]=i,e[21]=w):w=e[21],A=r.map(w),e[17]=r,e[18]=i,e[19]=A}else A=e[19];let y;e[22]!==A?(y=n.jsx(ss,{align:"end",className:"p-1 w-64",onOpenAutoFocus:ki,children:n.jsx("div",{role:"menu",className:"flex flex-col",children:A})}),e[22]=A,e[23]=y):y=e[23];let k;return e[24]!==V||e[25]!==j||e[26]!==y?(k=n.jsxs(ns,{open:V,onOpenChange:c,children:[j,y]}),e[24]=V,e[25]=j,e[26]=y,e[27]=k):k=e[27],k}function ki(t){return t.preventDefault()}function wi(t){const e=R.c(38),{label:s,render:o}=t,r=K(),i=os(),[a,l]=P.useState(!1);let V;e[0]===Symbol.for("react.memo_cache_sentinel")?(V=()=>l(!1),e[0]=V):V=e[0];const c=V;let u;e[1]!==s||e[2]!==r?(u=r("chat.modelPreferences.customizeModel",{tier:s}),e[1]=s,e[2]=r,e[3]=u):u=e[3];const d=a&&"opacity-100";let p;e[4]!==d?(p=$("absolute right-1 top-1/2 -translate-y-1/2 flex items-center justify-center","size-6 rounded-lg bg-background shadow-edge","text-muted-foreground hover:text-foreground","opacity-100 [@media(hover:hover)]:opacity-0","[@media(hover:hover)]:group-hover/tier-row:opacity-100","[@media(hover:hover)]:group-focus-within/tier-row:opacity-100",d),e[4]=d,e[5]=p):p=e[5];let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(Gn,{size:14}),e[6]=h):h=e[6];let f;e[7]!==u||e[8]!==p?(f=n.jsx("button",{type:"button","aria-label":u,className:p,children:h}),e[7]=u,e[8]=p,e[9]=f):f=e[9];const m=f;if(i){let j;e[10]!==m?(j=n.jsx(So,{asChild:!0,children:m}),e[10]=m,e[11]=j):j=e[11];let A;e[12]!==s||e[13]!==r?(A=r("chat.modelPreferences.customizeModel",{tier:s}),e[12]=s,e[13]=r,e[14]=A):A=e[14];let y;e[15]!==A?(y=n.jsx(Co,{className:"sr-only",children:A}),e[15]=A,e[16]=y):y=e[16];let k;e[17]!==a||e[18]!==o?(k=a&&o(c),e[17]=a,e[18]=o,e[19]=k):k=e[19];let w;e[20]!==k||e[21]!==y?(w=n.jsxs(No,{className:"p-0 flex flex-col max-h-[95vh]",children:[y,k]}),e[20]=k,e[21]=y,e[22]=w):w=e[22];let S;return e[23]!==a||e[24]!==w||e[25]!==j?(S=n.jsxs(Io,{open:a,onOpenChange:l,children:[j,w]}),e[23]=a,e[24]=w,e[25]=j,e[26]=S):S=e[26],S}let g;e[27]!==m?(g=n.jsx(ts,{asChild:!0,children:m}),e[27]=m,e[28]=g):g=e[28];let x;e[29]!==a||e[30]!==o?(x=a&&o(c),e[29]=a,e[30]=o,e[31]=x):x=e[31];let v;e[32]!==x?(v=n.jsx(ss,{side:"right",align:"start",collisionPadding:12,className:"w-[min(22rem,calc(100vw-2rem))] p-0 overflow-hidden",children:x}),e[32]=x,e[33]=v):v=e[33];let b;return e[34]!==a||e[35]!==g||e[36]!==v?(b=n.jsxs(ns,{open:a,onOpenChange:l,children:[g,v]}),e[34]=a,e[35]=g,e[36]=v,e[37]=b):b=e[37],b}function Pt(t){return t==="fast"?n.jsx(dt,{size:16}):t==="thinking"?n.jsx(Wn,{size:16}):n.jsx(To,{size:16})}function Si(t){const e=R.c(13),s=Nn();let o;e[0]!==t||e[1]!==s.tiers?(o=c=>{const u=s.tiers[c];return u?u.title??u.modelId:t.chat[c]?.title},e[0]=t,e[1]=s.tiers,e[2]=o):o=e[2];const r=o;let i;e[3]!==r?(i=r("fast"),e[3]=r,e[4]=i):i=e[4];let a;e[5]!==r?(a=r("smart"),e[5]=r,e[6]=a):a=e[6];let l;e[7]!==r?(l=r("thinking"),e[7]=r,e[8]=l):l=e[8];let V;return e[9]!==i||e[10]!==a||e[11]!==l?(V={fast:i,smart:a,thinking:l},e[9]=i,e[10]=a,e[11]=l,e[12]=V):V=e[12],V}function Ci(){const t=R.c(25),e=K(),{simpleModeTier:s,setSimpleModeTier:o}=We(),r=_o(),i=rs(),a=Ro(i),l=Si(a),{data:V,error:c}=Sn();let u;t[0]!==V?(u=V===void 0?{tiers:{}}:V,t[0]=V,t[1]=u):u=t[1];const d=u,p=Cn(),h=ct()?.lockedHarness,f=h==="claude-code",m=$e("model_choice"),g=uo(),x=po();if(!g||!m)return null;let v,b;if(t[2]!==a||t[3]!==x||t[4]!==f||t[5]!==h||t[6]!==r||t[7]!==o||t[8]!==e||t[9]!==s||t[10]!==l||t[11]!==p||t[12]!==d||t[13]!==c){const w=js(e);v="decopilot",b=yi.map(S=>{const C=l[S],N=d.tiers[S];return{key:`decopilot-${S}`,icon:Pt(S),title:w[S],subtitle:x?C??e(Rt[S]):e(Rt[S]),active:s===S,onSelect:()=>o(S),modelOverride:x?I=>n.jsxs(n.Fragment,{children:[c&&n.jsx("div",{className:"text-xs text-destructive p-3 pb-0",children:e("chat.modelPreferences.loadFailed")}),n.jsx(bi,{tier:S,orgSlot:r.tiers[S],userSlot:N,autoSlot:a.chat[S],filterModels:h==="codex"?Ni:f?gi:void 0,onClose:I,onPick:_=>p.mutate({tier:S,slot:_}),onReset:()=>p.mutate({tier:S,slot:null})},`${S}:${N?.keyId??"org"}:${N?.modelId??""}`)]}):void 0}}),t[2]=a,t[3]=x,t[4]=f,t[5]=h,t[6]=r,t[7]=o,t[8]=e,t[9]=s,t[10]=l,t[11]=p,t[12]=d,t[13]=c,t[14]=v,t[15]=b}else v=t[14],b=t[15];let j;t[16]!==v||t[17]!==b?(j=[{key:v,rows:b}],t[16]=v,t[17]=b,t[18]=j):j=t[18];const A=j;let y;t[19]!==s?(y=Pt(s),t[19]=s,t[20]=y):y=t[20];let k;return t[21]!==A||t[22]!==y||t[23]!==s?(k=n.jsx(ji,{tier:s,pillIcon:y,groups:A}),t[21]=A,t[22]=y,t[23]=s,t[24]=k):k=t[24],k}function Ni(t){return pi(t.providerId,t.modelId)}function ks(t){const e=R.c(3),[s]=Ce();let o;return e[0]!==s.enableSounds||e[1]!==t?(o=()=>{s.enableSounds&&Bo(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 Ii={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"},Ti=Zs.togglePlanMode.keys.map(t=>t==="Shift"?"⇧":t).join(""),_i=[{src:"/connections/gmail.png",name:"Gmail"},{src:"/connections/perplexity.png",name:"Perplexity"},{src:"/connections/github.png",name:"GitHub"}];function Mi(){const t=R.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:_i.map(Di)}),t[0]=e):e=t[0],e}function Di(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 Ri({disabled:t,onOpenConnections:e,virtualMcpId:s,selectedModel:o,isStreaming:r,onUnsupportedFile:i}){const a=K(),[l,V]=P.useState(!1),c=ks(Ii),{org:u}=Me(),{editor:d}=Bt(),p=P.useRef(null),h=ht(o),f=()=>{!h||r||(V(!1),p.current?.click())},m=async M=>{const B=M.target.files;if(!B||B.length===0||!d)return;const J=Array.from(B);try{let se=d.state.selection.from;for(const ee of J)await is(d,o??null,ee,se,i,a),se=d.state.selection.to}finally{p.current&&(p.current.value="")}},g=Uo({connectionId:s,orgId:u.id,orgSlug:u.slug}),x=Ks.virtualMcpPrompts(s,u.id),{data:v,isLoading:b}=qs({queryKey:x,queryFn:()=>zo(g),staleTime:6e4,enabled:l&&!!g}),j=v?.prompts??[],[A,y]=P.useState(null),{chatMode:k,setChatMode:w}=We(),[S,C]=Ce(),N=ct()?.lockedHarness!=="claude-code",I=Se.find(M=>M.value===S.toolApprovalLevel)??Se[0],_=a(I.shortKey),E=M=>{const B=Se.find(J=>J.value===M);if(B){if(B.value===S.toolApprovalLevel){V(!1);return}c(),te("chat_approval_level_changed",{from_level:S.toolApprovalLevel,to_level:B.value,source:"tools_popover"}),C({...S,toolApprovalLevel:B.value}),V(!1)}},F=k==="plan",D=()=>{c();const M=F?"default":"plan";te("chat_mode_changed",{from_mode:k,to_mode:M,source:"tools_popover"}),w(M),V(!1)},T=()=>{e(),V(!1)},O=async(M,B)=>{if(!d||!g)return;const J=wt(M._meta),se={from:d.state.selection.from,to:d.state.selection.to};try{const ee=await Oo(g,M.name,B);mn(d,se,{id:M.name,name:vo(M.name,J),metadata:ee.messages,char:"/",kind:"prompt",args:B})}catch{_e.error(a("chat.toolsPopover.failedLoadPrompt"))}},U=async M=>{V(!1);const B=!!(M.arguments&&M.arguments.length>0);if(te("chat_prompt_inserted",{prompt_name:M.name,with_arguments:B}),B){y(M);return}await O(M)},Q=async M=>{A&&(await O(A,M),y(null))},z=()=>{c();const M=k==="gen-image"?"default":"gen-image";te("chat_mode_changed",{from_mode:k,to_mode:M,source:"tools_popover"}),w(M),V(!1)},Y=()=>{c();const M=k==="web-search"?"default":"web-search";te("chat_mode_changed",{from_mode:k,to_mode:M,source:"tools_popover"}),w(M),V(!1)},L=()=>{c();const M=k==="deep-research"?"default":"deep-research";te("chat_mode_changed",{from_mode:k,to_mode:M,source:"tools_popover"}),w(M),V(!1)},H=k==="gen-image",X=k==="web-search",Z=k==="deep-research",ie=n.jsx("input",{ref:p,type:"file",multiple:!0,accept:ko(o??null),className:"hidden",onChange:m,disabled:r});return n.jsxs(n.Fragment,{children:[ie,n.jsxs(Qs,{open:l,onOpenChange:M=>{M&&!l&&te("chat_tools_popover_opened",{chat_mode:k}),V(M)},children:[n.jsx(Ys,{asChild:!0,children:n.jsxs(W,{type:"button",variant:"ghost",size:"default",disabled:t,title:a("chat.toolsPopover.tools"),"aria-label":a("chat.toolsPopover.tools"),className:$("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),children:[n.jsx(Hn,{size:14}),n.jsx("span",{className:$("min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0","@[320px]/chat-bottom:max-w-24 @[320px]/chat-bottom:opacity-100"),children:a("chat.toolsPopover.tools")})]})}),n.jsxs(Ws,{align:"start",className:"w-56 p-1.5 space-y-1",children:[h?n.jsxs(ye,{onClick:f,disabled:r,children:[n.jsx(St,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.addFile")})]}):n.jsxs(Ze,{children:[n.jsx(He,{asChild:!0,children:n.jsxs(ye,{"aria-disabled":"true",className:"opacity-50 cursor-not-allowed",onSelect:M=>M.preventDefault(),children:[n.jsx(St,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.addFile")})]})}),n.jsx(Je,{side:"right",children:a("chat.toolsPopover.modelNoFileSupport")})]}),n.jsxs(ye,{onClick:D,className:$(F&&"text-special"),children:[n.jsx(Yt,{size:16,className:$(F&&"text-special")}),n.jsx("span",{className:"flex-1 whitespace-nowrap",children:a("chat.toolsPopover.planMode")}),n.jsx("span",{className:$("text-xs text-muted-foreground",F&&"text-special font-medium"),children:Ti})]}),n.jsxs(ye,{onClick:z,className:$(H&&"text-special"),children:[n.jsx(Zt,{size:16,className:$(H&&"text-special")}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.createImage")}),H&&n.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),n.jsxs(ye,{onClick:Y,className:$(X&&"text-special"),children:[n.jsx(Ht,{size:16,className:$(X&&"text-special")}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.webSearch")}),X&&n.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),n.jsxs(ye,{onClick:L,className:$(Z&&"text-special"),children:[n.jsx(Jt,{size:16,className:$(Z&&"text-special")}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.deepResearch")}),Z&&n.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),n.jsxs(vt,{children:[n.jsxs(bt,{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:a("chat.toolsPopover.prompts")})]}),n.jsx(At,{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(Gs,{className:"size-3.5"}),a("chat.toolsPopover.loadingPrompts")]}):j.length===0?n.jsx("div",{className:"px-2 py-3 text-sm text-muted-foreground",children:a("chat.toolsPopover.noPromptsAvailable")}):j.map(M=>n.jsxs(ye,{onClick:()=>U(M),className:"flex flex-col items-start gap-0.5",children:[n.jsx("span",{className:"font-medium text-sm capitalize",children:M.title||xo(M.name,wt(M._meta))}),M.description&&n.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:M.description})]},M.name))})]}),N&&n.jsxs(vt,{children:[n.jsxs(bt,{className:"gap-2",children:[n.jsx(Ge,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.approval")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:_})]}),n.jsx(At,{className:"w-48 p-1.5",children:n.jsx(Hs,{value:S.toolApprovalLevel,onValueChange:E,children:Se.map(M=>n.jsx(Js,{value:M.value,children:a(M.labelKey)},M.value))})})]}),n.jsxs(ye,{onClick:T,children:[n.jsx($o,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.connections")}),n.jsx(P.Suspense,{children:n.jsx(Mi,{})})]})]})]}),n.jsx(hn,{prompt:A,setPrompt:y,onSubmit:Q})]})}const Pi=[{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 Ei(){const t=R.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:Pi.map(Fi)}),t[0]=e):e=t[0],e}function Fi(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 Li(t){const e=R.c(10),{onClick:s}=t,o=K();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=$("group relative z-10 flex items-center gap-3 w-full px-4 py-3","rounded-b-2xl","cursor-pointer"),e[0]=r):r=e[0];let i;e[1]!==o?(i=o("chat.connectionsBanner.description"),e[1]=o,e[2]=i):i=e[2];let a;e[3]!==i?(a=n.jsx("p",{className:"flex-1 text-xs text-muted-foreground truncate text-left",children:i}),e[3]=i,e[4]=a):a=e[4];let l,V;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(Ei,{}),V=n.jsx(Xs,{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 c;return e[7]!==s||e[8]!==a?(c=n.jsxs("button",{type:"button",onClick:s,className:r,children:[a,l,V]}),e[7]=s,e[8]=a,e[9]=c):c=e[9],c}const Ee=48;function Ui(){const t=R.c(12),[e,s]=P.useState("idle"),[o,r]=P.useState(""),[i,a]=P.useState(""),[l,V]=P.useState($i),c=P.useRef(null),u=P.useRef(null),d=P.useRef(null),p=P.useRef(null),h=P.useRef(0),f=P.useRef(!1),m=P.useRef(""),g=P.useRef(""),x=P.useRef(!1),v=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition);let b;t[0]===Symbol.for("react.memo_cache_sentinel")?(b=()=>{h.current&&(cancelAnimationFrame(h.current),h.current=0),u.current?.close().catch(Oi),p.current?.getTracks().forEach(zi),d.current=null,u.current=null,p.current=null},t[0]=b):b=t[0];const j=b;let A;t[1]===Symbol.for("react.memo_cache_sentinel")?(A=E=>{p.current=E;const F=new AudioContext;u.current=F;const D=F.createMediaStreamSource(E),T=F.createAnalyser();T.fftSize=128,T.smoothingTimeConstant=.8,D.connect(T),d.current=T;const O=new Uint8Array(T.frequencyBinCount),U=()=>{if(!d.current)return;d.current.getByteFrequencyData(O);const Q=[];for(let z=0;z<Ee;z++){const Y=Math.floor(z/Ee*O.length);Q.push(Math.max(.04,(O[Y]??0)/255))}V(Q),h.current=requestAnimationFrame(U)};U()},t[1]=A):A=t[1];const y=A;let k;t[2]!==e?(k=async()=>{if(x.current||f.current)return e;x.current=!0;const E=window.SpeechRecognition||window.webkitSpeechRecognition;if(!E)return x.current=!1,s("unsupported"),"unsupported";let F;try{F=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{return x.current=!1,s("permission-denied"),"permission-denied"}x.current=!1,r(""),a(""),g.current="",m.current="",f.current=!0,s("recording"),y(F);const D=new E;c.current=D,D.interimResults=!0,D.continuous=!0,D.lang=navigator.language||"en-US",D.onresult=T=>{if(c.current!==D)return;let O="",U="";for(let Q=T.resultIndex;Q<T.results.length;Q++){const z=T.results[Q],Y=z?.[0]?.transcript??"";z?.isFinal?U=U+Y:O=O+Y}U&&(m.current=m.current+U,r(m.current)),g.current=O,a(O)},D.onerror=T=>{c.current===D&&T.error!=="no-speech"&&(f.current=!1,c.current=null,j(),s(T.error==="not-allowed"?"permission-denied":"idle"))},D.onend=()=>{if(c.current===D&&f.current)try{D.start()}catch{}};try{D.start()}catch{return f.current=!1,c.current=null,j(),s("idle"),"idle"}return"recording"},t[2]=e,t[3]=k):k=t[3];const w=k;let S;t[4]===Symbol.for("react.memo_cache_sentinel")?(S=()=>{f.current=!1,c.current?.stop(),j(),s("idle"),V(Array(Ee).fill(.05)),a("");const E=(m.current+(g.current?" "+g.current:"")).trim();return r(""),m.current="",g.current="",E},t[4]=S):S=t[4];const C=S;let N;t[5]===Symbol.for("react.memo_cache_sentinel")?(N=()=>{f.current=!1,c.current?.abort(),j(),s("idle"),r(""),a(""),V(Array(Ee).fill(.05)),m.current="",g.current=""},t[5]=N):N=t[5];const I=N;let _;return t[6]!==i||t[7]!==w||t[8]!==e||t[9]!==o||t[10]!==l?(_={status:e,transcript:o,interimTranscript:i,waveformData:l,isSupported:v,startRecording:w,stopRecording:C,cancelRecording:I},t[6]=i,t[7]=w,t[8]=e,t[9]=o,t[10]=l,t[11]=_):_=t[11],_}function zi(t){return t.stop()}function Oi(){}function $i(){return Array(Ee).fill(.05)}function Bi(t){const e=R.c(4),{data:s}=t;let o;e[0]!==s?(o=s.map(Ki),e[0]=s,e[1]=o):o=e[1];let r;return e[2]!==o?(r=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]=r):r=e[3],r}function Ki(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 Le=12e3,Et=re({token:ne(),expiresAt:tn()});sn("provider",[re({provider:je("elevenlabs"),conversationToken:ne().min(1)}),re({provider:je("openai"),transport:je("webrtc")})]);const qi=en([Et.extend({provider:je("elevenlabs").default("elevenlabs"),conversationToken:ne().min(1)}),Et.extend({provider:je("openai"),transport:je("webrtc")})]);re({token:ne().min(1).max(4096),text:ne().trim().min(1).max(Le)});const ws=re({request:ne().trim().min(1).max(Le)}),rt=5e3;zt(re({role:ze(["user","agent"]),text:ne().min(1).max(rt)})).max(60).refine(t=>t.reduce((e,s)=>e+s.text.length,0)<=rt,{message:"Voice transcript is too long"});function cl(t){const e=[];let s=rt;for(const o of t.slice(-60).reverse()){if(s<=0)break;const r=o.text.slice(-s);e.unshift({role:o.role,text:r}),s-=r.length}return e}re({token:ne().min(1).max(4096),sdp:ne().min(1).max(1e5),language:ze(["en","pt"]).default("en")}).strict();const Qi=re({sdp:ne().min(1).max(1e5)});async function Yi(t,e,s,o,r){if(t.provider==="openai"){const{startOpenAIConversation:l}=await yt(async()=>{const{startOpenAIConversation:V}=await import("./openai-conversation-D9RDSbbV.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]));return l(r,s,o)}const{Conversation:i}=await yt(async()=>{const{Conversation:l}=await import("./index-yN0BIuMc.js");return{Conversation:l}},[]);o.throwIfAborted();const a=await i.startSession({...s,clientTools:{delegate_to_agent:async l=>{const V=ws.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 a.endSession(),o.throwIfAborted()),{endSession:()=>a.endSession(),setMicMuted:l=>a.setMicMuted(l),getOutputVolume:()=>a.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"?a.sendContextualUpdate(V):a.sendUserMessage(`[Studio background event, not a new user request]
|
|
9
|
+
The report follows.`;function ur(t){return{...t,content:[{type:"paragraph",content:[pn({id:Nt,name:Nt,char:"/",kind:"prompt",metadata:[{role:"user",content:{type:"text",text:dr}}]})]},...t.content??[]]}}function pr(){const t=R.c(24),e=K(),s=bn();if(!s)return null;let o,r,i,a;t[0]!==s.path||t[1]!==e?(o=Mn(s.path),a="flex px-3 pt-3",r="surface-inset flex h-7 min-w-0 items-center gap-1.5 rounded-full pr-0.5 pl-2.5 text-xs text-foreground",i=e("chat.input.openFileContext",{name:o}),t[0]=s.path,t[1]=e,t[2]=o,t[3]=r,t[4]=i,t[5]=a):(o=t[2],r=t[3],i=t[4],a=t[5]);let l,V;t[6]!==o?(l=n.jsx(vn,{filename:o,className:"h-4 w-3 shrink-0"}),V=n.jsx("span",{className:"truncate",children:o}),t[6]=o,t[7]=l,t[8]=V):(l=t[7],V=t[8]);let c;t[9]!==e?(c=e("chat.input.openFileDismiss"),t[9]=e,t[10]=c):c=t[10];let u;t[11]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Kt,{size:12}),t[11]=u):u=t[11];let d;t[12]!==s.dismiss||t[13]!==c?(d=n.jsx(xn,{label:c,size:"icon-sm",onClick:s.dismiss,children:u}),t[12]=s.dismiss,t[13]=c,t[14]=d):d=t[14];let p;t[15]!==r||t[16]!==i||t[17]!==l||t[18]!==V||t[19]!==d?(p=n.jsxs("span",{className:r,title:i,children:[l,V,d]}),t[15]=r,t[16]=i,t[17]=l,t[18]=V,t[19]=d,t[20]=p):p=t[20];let h;return t[21]!==a||t[22]!==p?(h=n.jsx("div",{className:a,children:p}),t[21]=a,t[22]=p,t[23]=h):h=t[23],h}function fr(t){return{autosend:Rn,sidepanel:!0,...t?{mainpanel:!1}:{}}}function hr(t){const e=R.c(30),{current:s,total:o,onPrev:r,onNext:i}=t,a=K();if(o<=1)return null;const l=s===0,V=s===0?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let c;e[0]!==V?(c=$("p-0.5 transition-colors rounded-lg",V),e[0]=V,e[1]=c):c=e[1];let u;e[2]!==a?(u=a("chat.pagination.previousLabel"),e[2]=a,e[3]=u):u=e[3];let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(lo,{size:14}),e[4]=d):d=e[4];let p;e[5]!==r||e[6]!==l||e[7]!==c||e[8]!==u?(p=n.jsx("button",{type:"button",onClick:r,disabled:l,className:c,"aria-label":u,children:d}),e[5]=r,e[6]=l,e[7]=c,e[8]=u,e[9]=p):p=e[9];const h=s+1;let f;e[10]!==a||e[11]!==h||e[12]!==o?(f=a("chat.pagination.counter",{current:h,total:o}),e[10]=a,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 g=s===o-1,x=s===o-1?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let v;e[16]!==x?(v=$("p-0.5 transition-colors rounded-lg",x),e[16]=x,e[17]=v):v=e[17];let b;e[18]!==a?(b=a("chat.pagination.nextLabel"),e[18]=a,e[19]=b):b=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(qt,{size:14}),e[20]=j):j=e[20];let A;e[21]!==i||e[22]!==g||e[23]!==v||e[24]!==b?(A=n.jsx("button",{type:"button",onClick:i,disabled:g,className:v,"aria-label":b,children:j}),e[21]=i,e[22]=g,e[23]=v,e[24]=b,e[25]=A):A=e[25];let y;return e[26]!==A||e[27]!==p||e[28]!==m?(y=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]=y):y=e[29],y}function us(t){const e=R.c(8),{currentIndex:s,total:o,onPrev:r,onNext:i,extraLeft:a}=t;let l;e[0]!==s||e[1]!==i||e[2]!==r||e[3]!==o?(l=n.jsx(hr,{current:s,total:o,onPrev:r,onNext:i}),e[0]=s,e[1]=i,e[2]=r,e[3]=o,e[4]=l):l=e[4];let V;return e[5]!==a||e[6]!==l?(V=n.jsxs("div",{className:"flex items-center gap-2",children:[l,a]}),e[5]=a,e[6]=l,e[7]=V):V=e[7],V}function mr(t){const e=R.c(17),{isStreaming:s,isAllAnswered:o,isCurrentAnswered:r,onAdvanceOrSubmit:i,submitLabel:a,nextLabel:l}=t,u=o?a===void 0?"Submit":a:l===void 0?"Next":l,d=o?s:!r,p=d?o?"Waiting for the assistant to finish…":"Answer this item to continue":null;let h;e[0]!==d||e[1]!==i?(h=()=>{d||i()},e[0]=d,e[1]=i,e[2]=h):h=e[2];const f=d&&"opacity-50 cursor-not-allowed";let m;e[3]!==f?(m=$("h-7 px-2.5 text-xs",f),e[3]=f,e[4]=m):m=e[4];let g;e[5]!==d||e[6]!==u||e[7]!==h||e[8]!==m?(g=n.jsx(W,{type:"button",size:"sm","aria-disabled":d,onClick:h,className:m,children:u}),e[5]=d,e[6]=u,e[7]=h,e[8]=m,e[9]=g):g=e[9];const x=g;if(!p)return x;let v;e[10]!==x?(v=n.jsx(He,{asChild:!0,children:x}),e[10]=x,e[11]=v):v=e[11];let b;e[12]!==p?(b=n.jsx(Je,{children:p}),e[12]=p,e[13]=b):b=e[13];let j;return e[14]!==v||e[15]!==b?(j=n.jsxs(Ze,{children:[v,b]}),e[14]=v,e[15]=b,e[16]=j):j=e[16],j}function ps(t,e,s){return t.findIndex(o=>e(o)===s)}function It(t,e,s,o){return t.length===0?!1:t.every(r=>o(s[e(r)]))}function Tt(t,e,s,o,r){if(t.length===0)return null;const i=ps(t,e,r);for(let a=1;a<=t.length;a++){const l=t[(i+a)%t.length];if(!l)continue;const V=e(l);if(V!==r&&!o(s[V]))return V}return null}function gr(t){return!t.isStreaming&&t.allAnswered}function fs(t){const{parts:e,partKey:s,schema:o,defaultValues:r,isStreaming:i,hasAnswer:a,onSubmit:l}=t,V=e[0]?s(e[0]):"",[c,u]=P.useState(V),[d,p]=P.useState(!1),h=Ns({resolver:Is(o),defaultValues:r}),f=h.watch(),m=ps(e,s,c),g=m>=0?e[m]:void 0,x=a(f[c]),v=It(e,s,f,a),b=gr({isStreaming:i,allAnswered:v}),j=()=>{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))}},y=()=>{const N=h.getValues(),I=Tt(e,s,N,a,c);I&&u(I)},k=()=>{h.handleSubmit(N=>{const I=N;for(const _ of e)l(_,I[s(_)])})()},w=P.useRef(k);w.current=k;const S=()=>{b&&(p(!1),w.current())},C=()=>{const N=h.getValues();if(It(e,s,N,a)){if(i){p(!0);return}p(!1),w.current()}else{const I=Tt(e,s,N,a,c);I&&u(I)}};return P.useEffect(()=>{if(d&&!i){if(!v){p(!1);return}p(!1),w.current()}},[d,i,v]),{form:h,activeKey:c,setActiveKey:u,currentIndex:m,currentPart:g,isCurrentAnswered:x,isAllAnswered:v,canSubmit:b,goPrev:j,goNext:A,advanceToNextUnanswered:y,submit:S,submitOrAdvance:C}}const hs="chat.approval.defaultDenyReason";function ms(t){const e=R.c(36),{onYolo:s}=t,o=K(),[r,i]=Ce();let a,l,V,c,u,d,p,h,f;if(e[0]!==s||e[1]!==r||e[2]!==i||e[3]!==o){const j=Se.find(k=>k.value===r.toolApprovalLevel)??Se[0];let A;e[13]!==s||e[14]!==r||e[15]!==i?(A=k=>{const w=k,S=r.toolApprovalLevel??"readonly";i({...r,toolApprovalLevel:w}),w==="auto"&&s(S)},e[13]=s,e[14]=r,e[15]=i,e[16]=A):A=e[16];const y=A;V=oo,h=r.toolApprovalLevel,f=y,l=ro,u="xs",d="text-xs text-muted-foreground border-border/60 bg-transparent hover:bg-accent h-7 gap-1",p=xr,a=io,c=o(j.shortKey),e[0]=s,e[1]=r,e[2]=i,e[3]=o,e[4]=a,e[5]=l,e[6]=V,e[7]=c,e[8]=u,e[9]=d,e[10]=p,e[11]=h,e[12]=f}else a=e[4],l=e[5],V=e[6],c=e[7],u=e[8],d=e[9],p=e[10],h=e[11],f=e[12];let m;e[17]!==a||e[18]!==c?(m=n.jsx(a,{children:c}),e[17]=a,e[18]=c,e[19]=m):m=e[19];let g;e[20]!==l||e[21]!==u||e[22]!==d||e[23]!==p||e[24]!==m?(g=n.jsx(l,{size:u,className:d,onClick:p,children:m}),e[20]=l,e[21]=u,e[22]=d,e[23]=p,e[24]=m,e[25]=g):g=e[25];let x;e[26]!==o?(x=Se.map(j=>n.jsx(no,{value:j.value,children:o(j.labelKey)},j.value)),e[26]=o,e[27]=x):x=e[27];let v;e[28]!==x?(v=n.jsx(ao,{children:x}),e[28]=x,e[29]=v):v=e[29];let b;return e[30]!==V||e[31]!==v||e[32]!==h||e[33]!==f||e[34]!==g?(b=n.jsxs(V,{value:h,onValueChange:f,children:[g,v]}),e[30]=V,e[31]=v,e[32]=h,e[33]=f,e[34]=g,e[35]=b):b=e[35],b}function xr(t){return t.stopPropagation()}function gs(t){const e=R.c(8),{input:s}=t,o=K();if(s==null){let a;e[0]!==o?(a=o("chat.approval.noInput"),e[0]=o,e[1]=a):a=e[1];let l;return e[2]!==a?(l=n.jsx("div",{className:"px-4 text-xs text-muted-foreground",children:a}),e[2]=a,e[3]=l):l=e[3],l}let r;try{let a;e[4]!==s?(a=JSON.stringify(s,null,2),e[4]=s,e[5]=a):a=e[5],r=a}catch{r=String(s)}let i;return e[6]!==r?(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:r})}),e[6]=r,e[7]=i):i=e[7],i}function vr(t){const e=R.c(38),{approval:s,onRespond:o}=t,r=K(),[i]=Ce(),a=i.toolApprovalLevel??"readonly";let l;e[0]!==s.approvalId||e[1]!==a||e[2]!==o||e[3]!==r?(l=()=>o(s.approvalId,!1,r(hs),a),e[0]=s.approvalId,e[1]=a,e[2]=o,e[3]=r,e[4]=l):l=e[4];const V=l;let c;e[5]!==s.approvalId||e[6]!==a||e[7]!==o?(c=()=>o(s.approvalId,!0,void 0,a),e[5]=s.approvalId,e[6]=a,e[7]=o,e[8]=c):c=e[8];const u=c;let d;e[9]!==s.approvalId||e[10]!==o?(d=S=>o(s.approvalId,!0,void 0,S),e[9]=s.approvalId,e[10]=o,e[11]=d):d=e[11];const p=d;let h;e[12]!==p?(h=n.jsx("div",{className:"flex items-center gap-2",children:n.jsx(ms,{onYolo:p})}),e[12]=p,e[13]=h):h=e[13];const f=h;let m;e[14]!==r?(m=r("chat.approval.denyButton"),e[14]=r,e[15]=m):m=e[15];let g;e[16]!==V||e[17]!==m?(g=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]=g):g=e[18];let x;e[19]!==r?(x=r("chat.approval.acceptButton"),e[19]=r,e[20]=x):x=e[20];let v;e[21]!==u||e[22]!==x?(v=n.jsx(W,{type:"button",size:"sm",className:"h-7 px-2.5 text-xs active:scale-[0.97] transition-transform",onClick:u,children:x}),e[21]=u,e[22]=x,e[23]=v):v=e[23];let b;e[24]!==g||e[25]!==v?(b=n.jsxs(n.Fragment,{children:[g,v]}),e[24]=g,e[25]=v,e[26]=b):b=e[26];const j=b;let A;e[27]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx(Ge,{size:14}),e[27]=A):A=e[27];let y;e[28]!==r?(y=r("chat.approval.needsApproval"),e[28]=r,e[29]=y):y=e[29];let k;e[30]!==s.input?(k=n.jsx(gs,{input:s.input}),e[30]=s.input,e[31]=k):k=e[31];let w;return e[32]!==s.friendlyName||e[33]!==f||e[34]!==j||e[35]!==y||e[36]!==k?(w=n.jsx(he,{icon:A,label:y,title:s.friendlyName,defaultExpanded:!0,footerLeft:f,footerRight:j,children:k}),e[32]=s.friendlyName,e[33]=f,e[34]=j,e[35]=y,e[36]=k,e[37]=w):w=e[37],w}const br=Ts(ne(),re({approved:_s().optional(),levelOverride:ze(["auto","readonly"]).optional()}));function Ar(t){const e=R.c(46),{approvals:s,isStreaming:o,onRespond:r}=t,i=K(),[a]=Ce(),l=a.toolApprovalLevel??"readonly";let V;e[0]!==s?(V=Object.fromEntries(s.map(kr)),e[0]=s,e[1]=V):V=e[1];const c=V;let u;e[2]!==l||e[3]!==r||e[4]!==i?(u=(I,_)=>{const E=_;typeof E?.approved=="boolean"&&r(I.approvalId,E.approved,E.approved===!1?i(hs):void 0,E.levelOverride??l)},e[2]=l,e[3]=r,e[4]=i,e[5]=u):u=e[5];let d;e[6]!==s||e[7]!==c||e[8]!==o||e[9]!==u?(d={parts:s,partKey:jr,schema:br,defaultValues:c,isStreaming:o,hasAnswer:yr,onSubmit:u},e[6]=s,e[7]=c,e[8]=o,e[9]=u,e[10]=d):d=e[10];const p=fs(d);let h;e[11]!==s||e[12]!==p?(h=I=>{p.form.reset(Object.fromEntries(s.map(_=>[_.approvalId,{approved:!0,levelOverride:I}]))),p.submitOrAdvance()},e[11]=s,e[12]=p,e[13]=h):h=e[13];const f=h,m=p.currentPart,g=p.form;let x;e[14]!==p?(x=I=>{I.preventDefault(),p.submit()},e[14]=p,e[15]=x):x=e[15];let v;e[16]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(Ge,{size:14}),e[16]=v):v=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 j=m?.friendlyName??"";let A;e[20]!==f?(A=n.jsx(ms,{onYolo:f}),e[20]=f,e[21]=A):A=e[21];let y;e[22]!==s.length||e[23]!==p.currentIndex||e[24]!==p.goNext||e[25]!==p.goPrev||e[26]!==A?(y=n.jsx(us,{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]=y):y=e[27];let k;e[28]!==m||e[29]!==p.form.control||e[30]!==p.submitOrAdvance?(k=m?n.jsx(wr,{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]=k):k=e[31];let w;e[32]!==m?(w=m?n.jsx(gs,{input:m.input}):null,e[32]=m,e[33]=w):w=e[33];let S;e[34]!==y||e[35]!==k||e[36]!==w||e[37]!==b||e[38]!==j?(S=n.jsx(he,{icon:v,label:b,title:j,defaultExpanded:!0,footerLeft:y,footerRight:k,children:w}),e[34]=y,e[35]=k,e[36]=w,e[37]=b,e[38]=j,e[39]=S):S=e[39];let C;e[40]!==S||e[41]!==x?(C=n.jsx("form",{onSubmit:x,children:S}),e[40]=S,e[41]=x,e[42]=C):C=e[42];let N;return e[43]!==p.form||e[44]!==C?(N=n.jsx(ot,{...g,children:C}),e[43]=p.form,e[44]=C,e[45]=N):N=e[45],N}function yr(t){return typeof t?.approved=="boolean"}function jr(t){return t.approvalId}function kr(t){return[t.approvalId,{approved:void 0}]}function wr(t){const e=R.c(7),{approvalId:s,control:o,onChange:r}=t,i=K(),a=`${s}.approved`;let l;e[0]!==r||e[1]!==i?(l=c=>{const{field:u}=c,d=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),r()},"aria-pressed":p,children:i("chat.approval.denyButton")}),n.jsx(W,{type:"button",variant:d?"default":"outline",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{u.onChange(!0),r()},"aria-pressed":d,children:i("chat.approval.acceptButton")})]})},e[0]=r,e[1]=i,e[2]=l):l=e[2];let V;return e[3]!==o||e[4]!==a||e[5]!==l?(V=n.jsx(Ms,{control:o,name:a,render:l}),e[3]=o,e[4]=a,e[5]=l,e[6]=V):V=e[6],V}function Sr(){const t=R.c(5),e=K();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.approval.preparingRequest"),t[1]=e,t[2]=o):o=t[2];let r;return t[3]!==o?(r=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]=r):r=t[4],r}function Cr(t){const e=R.c(8),{approvals:s,isStreaming:o,onRespond:r}=t;if(o&&s.length===0){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Sr,{}),e[0]=a):a=e[0],a}if(s.length===0)return null;if(s.length===1){const a=s[0];if(!a)return null;let l;return e[1]!==r||e[2]!==a?(l=n.jsx(vr,{approval:a,onRespond:r}),e[1]=r,e[2]=a,e[3]=l):l=e[3],l}let i;return e[4]!==s||e[5]!==o||e[6]!==r?(i=n.jsx(Ar,{approvals:s,isStreaming:o,onRespond:r}),e[4]=s,e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function Nr(t){const e=R.c(28),{plan:s,onApprove:o,onDismiss:r}=t,i=K();let a;e[0]!==o||e[1]!==s.plan?(a=()=>{o(s.plan)},e[0]=o,e[1]=s.plan,e[2]=a):a=e[2];const l=a;let V;e[3]!==i?(V=i("chat.proposePlan.keepIterating"),e[3]=i,e[4]=V):V=e[4];let c;e[5]!==r||e[6]!==V?(c=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:r,children:V}),e[5]=r,e[6]=V,e[7]=c):c=e[7];let u;e[8]!==i?(u=i("chat.proposePlan.letsGo"),e[8]=i,e[9]=u):u=e[9];let d;e[10]!==l||e[11]!==u?(d=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]=d):d=e[12];let p;e[13]!==c||e[14]!==d?(p=n.jsxs(n.Fragment,{children:[c,d]}),e[13]=c,e[14]=d,e[15]=p):p=e[15];const h=p;let f;e[16]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Wt,{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 g;e[19]!==i?(g=i("chat.proposePlan.implementationPlan"),e[19]=i,e[20]=g):g=e[20];let x;e[21]!==s.plan?(x=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(fn,{id:"plan-preview",part:{type:"text",text:s.plan}})})}),e[21]=s.plan,e[22]=x):x=e[22];let v;return e[23]!==h||e[24]!==x||e[25]!==m||e[26]!==g?(v=n.jsx(he,{icon:f,label:m,title:g,defaultExpanded:!0,footerRight:h,children:x}),e[23]=h,e[24]=x,e[25]=m,e[26]=g,e[27]=v):v=e[27],v}function Ir(t){const e=R.c(6),{plans:s,onApprove:o,onDismiss:r}=t;let i;e[0]!==s?(i=Vs(s),e[0]=s,e[1]=i):i=e[1];const a=i;if(!a)return null;let l;return e[2]!==a||e[3]!==o||e[4]!==r?(l=n.jsx(Nr,{plan:a,onApprove:o,onDismiss:r}),e[2]=a,e[3]=o,e[4]=r,e[5]=l):l=e[5],l}function xs(t){return t?"response"in t?t.response:t.option??t.draft:""}const _t=re({response:ne().min(1,"Response is required")}),Tr=re({option:ne().nullable(),draft:ne()}).refine(t=>(t.option??t.draft).length>0,{message:"Please select or enter an option"}),_r=re({response:ze(["yes","no"])});function Mr(t){switch(t.type){case"text":return _t;case"choice":return Tr;case"confirm":return _r;default:return _t}}function Dr(t){const e={};for(const s of t)e[s.toolCallId]=Mr(s.input);return re(e)}function Rr(t){const e=R.c(7),{control:s,name:o,placeholder:r}=t,i=K();let a;e[0]!==r||e[1]!==i?(a=V=>{const{field:c}=V,u=c.value??"";return n.jsxs(ut,{children:[n.jsx(pt,{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(Gt,{size:16,className:"text-muted-foreground"})}),n.jsx("input",{...c,value:u,type:"text",placeholder:r||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(ft,{})]})},e[0]=r,e[1]=i,e[2]=a):a=e[2];let l;return e[3]!==s||e[4]!==o||e[5]!==a?(l=n.jsx(Xt,{control:s,name:o,render:a}),e[3]=s,e[4]=o,e[5]=a,e[6]=l):l=e[6],l}function vs(t,e){const s=R.c(4);let o,r;s[0]!==t||s[1]!==e?(o=()=>{const i=a=>{if(Ds(a.target)||a.metaKey||a.ctrlKey||a.altKey)return;const l=Number.parseInt(a.key,10);l>=1&&l<=t&&(a.preventDefault(),e(l-1))};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},r=[t,e],s[0]=t,s[1]=e,s[2]=o,s[3]=r):(o=s[2],r=s[3]),P.useEffect(o,r)}function Pr(t){const e=R.c(51),{control:s,name:o,options:r}=t,i=K(),a=`${o}.option`;let l;e[0]!==s||e[1]!==a?(l={control:s,name:a,defaultValue:null},e[0]=s,e[1]=a,e[2]=l):l=e[2];const{field:V}=xt(l),c=`${o}.draft`;let u;e[3]!==s||e[4]!==c?(u={control:s,name:c,defaultValue:""},e[3]=s,e[4]=c,e[5]=u):u=e[5];const{field:d}=xt(u),p=V.value,h=d.value??"";let f;if(e[6]!==V||e[7]!==r?(f=D=>{const T=r[D];T!=null&&V.onChange(T)},e[6]=V,e[7]=r,e[8]=f):f=e[8],vs(r.length,f),r.length===0)return null;const m=p===null;let g;e[9]!==i?(g=i("chat.userAskQuestion.choiceOptionsAriaLabel"),e[9]=i,e[10]=g):g=e[10];let x;if(e[11]!==V||e[12]!==p||e[13]!==r||e[14]!==i){let D;e[16]!==V||e[17]!==p||e[18]!==i?(D=(T,O)=>{const U=p===T;return n.jsxs("button",{type:"button",onClick:()=>V.onChange(T),className:$("flex items-start gap-3 px-2 py-3 rounded-lg text-left transition-colors w-full",U&&"bg-accent/50",!U&&"hover:bg-accent"),"aria-label":i("chat.userAskQuestion.selectOption",{option:T}),children:[n.jsx("span",{className:$("flex items-center justify-center size-6 rounded-md text-sm shrink-0 mt-0.5",U?"bg-chart-1 text-white":"bg-muted text-foreground"),children:O+1}),n.jsx("span",{className:"text-sm text-foreground min-w-0 break-words",children:T})]},`${O}-${T}`)},e[16]=V,e[17]=p,e[18]=i,e[19]=D):D=e[19],x=r.map(D),e[11]=V,e[12]=p,e[13]=r,e[14]=i,e[15]=x}else x=e[15];const v=m&&"bg-accent/50",b=!m&&"hover:bg-accent";let j;e[20]!==v||e[21]!==b?(j=$("flex items-center gap-3 px-2 py-3 rounded-lg transition-colors w-full cursor-text",v,b),e[20]=v,e[21]=b,e[22]=j):j=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(Gt,{size:16,className:"text-muted-foreground"})}),e[23]=A):A=e[23];const y=m?h:"";let k;e[24]!==d||e[25]!==V||e[26]!==p?(k=D=>{d.onChange(D.target.value),p!==null&&V.onChange(null)},e[24]=d,e[25]=V,e[26]=p,e[27]=k):k=e[27];let w;e[28]!==V||e[29]!==p?(w=()=>{p!==null&&V.onChange(null)},e[28]=V,e[29]=p,e[30]=w):w=e[30];let S;e[31]!==i?(S=i("chat.userAskQuestion.somethingElsePlaceholder"),e[31]=i,e[32]=S):S=e[32];let C;e[33]!==i?(C=i("chat.userAskQuestion.customChoiceInputAriaLabel"),e[33]=i,e[34]=C):C=e[34];let N;e[35]!==y||e[36]!==k||e[37]!==w||e[38]!==S||e[39]!==C?(N=n.jsx("input",{type:"text",value:y,onChange:k,onFocus:w,placeholder:S,"aria-label":C,className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"}),e[35]=y,e[36]=k,e[37]=w,e[38]=S,e[39]=C,e[40]=N):N=e[40];let I;e[41]!==j||e[42]!==N?(I=n.jsxs("label",{className:j,children:[A,N]}),e[41]=j,e[42]=N,e[43]=I):I=e[43];let _;e[44]!==I||e[45]!==g||e[46]!==x?(_=n.jsx(pt,{children:n.jsxs("div",{className:"flex flex-col px-2",role:"group","aria-label":g,children:[x,I]})}),e[44]=I,e[45]=g,e[46]=x,e[47]=_):_=e[47];let E;e[48]===Symbol.for("react.memo_cache_sentinel")?(E=n.jsx(ft,{}),e[48]=E):E=e[48];let F;return e[49]!==_?(F=n.jsxs(ut,{children:[_,E]}),e[49]=_,e[50]=F):F=e[50],F}function Er(t){const e=R.c(8),{control:s,name:o}=t,r=K();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=["yes","no"],e[0]=i):i=e[0];const a=i,l=P.useRef(null);let V;e[1]===Symbol.for("react.memo_cache_sentinel")?(V=d=>{l.current?.onChange(a[d]??"")},e[1]=V):V=e[1],vs(a.length,V);let c;e[2]!==r?(c=d=>{const{field:p}=d;return l.current=p,n.jsxs(ut,{children:[n.jsx(pt,{children:n.jsx("div",{className:"flex gap-2 px-2",role:"group","aria-label":r("chat.userAskQuestion.confirmationOptionsAriaLabel"),children:a.map(h=>{const f=p.value===h;return n.jsxs("button",{type:"button",onClick:()=>p.onChange(h),className:$("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":r("chat.userAskQuestion.confirmValue",{value:r(`chat.userAskQuestion.confirm${h==="yes"?"Yes":"No"}`)}),children:[n.jsx("span",{className:$("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:r(`chat.userAskQuestion.confirm${h==="yes"?"Yes":"No"}`)})]},h)})})}),n.jsx(ft,{})]})},e[2]=r,e[3]=c):c=e[3];let u;return e[4]!==s||e[5]!==o||e[6]!==c?(u=n.jsx(Xt,{control:s,name:o,render:c}),e[4]=s,e[5]=o,e[6]=c,e[7]=u):u=e[7],u}function Mt(t){const e=R.c(13),{input:s,control:o,toolCallId:r}=t;switch(s.type){case"text":{const i=`${r}.response`;let a;return e[0]!==o||e[1]!==s.default||e[2]!==i?(a=n.jsx(Rr,{control:o,name:i,placeholder:s.default}),e[0]=o,e[1]=s.default,e[2]=i,e[3]=a):a=e[3],a}case"choice":{let i;e[4]!==s.options?(i=s.options?.filter(Boolean)??[],e[4]=s.options,e[5]=i):i=e[5];const a=i;let l;return e[6]!==o||e[7]!==a||e[8]!==r?(l=n.jsx(Pr,{control:o,name:r,options:a}),e[6]=o,e[7]=a,e[8]=r,e[9]=l):l=e[9],l}case"confirm":{const i=`${r}.response`;let a;return e[10]!==o||e[11]!==i?(a=n.jsx(Er,{control:o,name:i}),e[10]=o,e[11]=i,e[12]=a):a=e[12],a}default:return null}}function Fr(t){const e=R.c(91),{parts:s,isStreaming:o,onSubmit:r}=t;let i;e[0]!==s?(i=Dr(s.map(Or)),e[0]=s,e[1]=i):i=e[1];const a=i;let l;e[2]!==s?(l=Object.fromEntries(s.map(zr)),e[2]=s,e[3]=l):l=e[3];const V=l;let c;e[4]!==r?(c=(z,Y)=>{const L=xs(Y);L&&r(z,L)},e[4]=r,e[5]=c):c=e[5];let u;e[6]!==V||e[7]!==o||e[8]!==s||e[9]!==a||e[10]!==c?(u={parts:s,partKey:Ur,schema:a,defaultValues:V,isStreaming:o,hasAnswer:Lr,onSubmit:c},e[6]=V,e[7]=o,e[8]=s,e[9]=a,e[10]=c,e[11]=u):u=e[11];const d=fs(u),p=d.currentPart,h=K();let f;e[12]!==p||e[13]!==d||e[14]!==h?(f=()=>{const z=p;if(!z)return;const Y=h("chat.userAskQuestion.skipMessage"),L=z.toolCallId;z.input?.type==="choice"?(d.form.setValue(`${L}.option`,null),d.form.setValue(`${L}.draft`,Y)):d.form.setValue(`${L}.response`,Y),d.advanceToNextUnanswered()},e[12]=p,e[13]=d,e[14]=h,e[15]=f):f=e[15];const m=f;let g;e[16]!==d.currentIndex||e[17]!==d.goNext||e[18]!==d.goPrev||e[19]!==s.length?(g=n.jsx(us,{currentIndex:d.currentIndex,total:s.length,onPrev:d.goPrev,onNext:d.goNext}),e[16]=d.currentIndex,e[17]=d.goNext,e[18]=d.goPrev,e[19]=s.length,e[20]=g):g=e[20];const x=g;let v;e[21]!==h?(v=h("chat.userAskQuestion.skip"),e[21]=h,e[22]=v):v=e[22];let b;e[23]!==m||e[24]!==v?(b=n.jsx(W,{type:"button",variant:"outline",size:"sm",onClick:m,className:"h-7",children:v}),e[23]=m,e[24]=v,e[25]=b):b=e[25];let j;e[26]!==d.isAllAnswered||e[27]!==d.isCurrentAnswered||e[28]!==d.submitOrAdvance||e[29]!==o?(j=n.jsx(mr,{isStreaming:o,isAllAnswered:d.isAllAnswered,isCurrentAnswered:d.isCurrentAnswered,onAdvanceOrSubmit:d.submitOrAdvance}),e[26]=d.isAllAnswered,e[27]=d.isCurrentAnswered,e[28]=d.submitOrAdvance,e[29]=o,e[30]=j):j=e[30];let A;e[31]!==b||e[32]!==j?(A=n.jsxs(n.Fragment,{children:[b,j]}),e[31]=b,e[32]=j,e[33]=A):A=e[33];const y=A;if(s.length===1){const z=s[0];if(!z?.input)return null;const Y=d.form;let L;e[34]!==d?(L=ee=>{ee.preventDefault(),d.submit()},e[34]=d,e[35]=L):L=e[35];let H;e[36]===Symbol.for("react.memo_cache_sentinel")?(H=n.jsx(nt,{size:14}),e[36]=H):H=e[36];let X;e[37]!==h?(X=h("chat.userAskQuestion.questionPending"),e[37]=h,e[38]=X):X=e[38];let Z;e[39]!==z.input?.prompt||e[40]!==h?(Z=z.input?.prompt??h("chat.userAskQuestion.question"),e[39]=z.input?.prompt,e[40]=h,e[41]=Z):Z=e[41];const ie=z.input;let M;e[42]!==d.form.control||e[43]!==z.toolCallId||e[44]!==ie?(M=n.jsx(Mt,{input:ie,control:d.form.control,toolCallId:z.toolCallId}),e[42]=d.form.control,e[43]=z.toolCallId,e[44]=ie,e[45]=M):M=e[45];let B;e[46]!==y||e[47]!==X||e[48]!==Z||e[49]!==M?(B=n.jsx(he,{icon:H,label:X,title:Z,defaultExpanded:!0,footerRight:y,children:M}),e[46]=y,e[47]=X,e[48]=Z,e[49]=M,e[50]=B):B=e[50];let J;e[51]!==L||e[52]!==B?(J=n.jsx("form",{onSubmit:L,autoComplete:"off",children:B}),e[51]=L,e[52]=B,e[53]=J):J=e[53];let se;return e[54]!==d.form||e[55]!==J?(se=n.jsx(ot,{...Y,children:J}),e[54]=d.form,e[55]=J,e[56]=se):se=e[56],se}const k=d.form;let w;e[57]!==d?(w=z=>{z.preventDefault(),d.submit()},e[57]=d,e[58]=w):w=e[58];let S;e[59]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(nt,{size:14}),e[59]=S):S=e[59];let C;e[60]!==h?(C=h("chat.userAskQuestion.questionPending"),e[60]=h,e[61]=C):C=e[61];const N=d.currentIndex+1;let I;e[62]!==s.length||e[63]!==h||e[64]!==N?(I=h("chat.userAskQuestion.questionCount",{current:N,total:s.length}),e[62]=s.length,e[63]=h,e[64]=N,e[65]=I):I=e[65];let _;e[66]!==p?.input?.prompt||e[67]!==h?(_=p?.input?.prompt??h("chat.userAskQuestion.question"),e[66]=p?.input?.prompt,e[67]=h,e[68]=_):_=e[68];const E=d.activeKey,F=d.setActiveKey;let D;if(e[69]!==d.form||e[70]!==s){let z;e[72]!==d.form?(z=Y=>n.jsx(Vo,{value:Y.toolCallId,className:"mt-0",children:n.jsx(Mt,{input:Y.input,control:d.form.control,toolCallId:Y.toolCallId})},Y.toolCallId),e[72]=d.form,e[73]=z):z=e[73],D=s.map(z),e[69]=d.form,e[70]=s,e[71]=D}else D=e[71];let T;e[74]!==d.activeKey||e[75]!==d.setActiveKey||e[76]!==D?(T=n.jsx(co,{value:E,onValueChange:F,children:D}),e[74]=d.activeKey,e[75]=d.setActiveKey,e[76]=D,e[77]=T):T=e[77];let O;e[78]!==x||e[79]!==y||e[80]!==C||e[81]!==I||e[82]!==_||e[83]!==T?(O=n.jsx(he,{icon:S,label:C,count:I,title:_,defaultExpanded:!0,footerLeft:x,footerRight:y,children:T}),e[78]=x,e[79]=y,e[80]=C,e[81]=I,e[82]=_,e[83]=T,e[84]=O):O=e[84];let U;e[85]!==w||e[86]!==O?(U=n.jsx("form",{onSubmit:w,autoComplete:"off",children:O}),e[85]=w,e[86]=O,e[87]=U):U=e[87];let Q;return e[88]!==d.form||e[89]!==U?(Q=n.jsx(ot,{...k,children:U}),e[88]=d.form,e[89]=U,e[90]=Q):Q=e[90],Q}function Lr(t){return!!xs(t)}function Ur(t){return t.toolCallId}function zr(t){return t.input?.type==="choice"?[t.toolCallId,{option:null,draft:""}]:[t.toolCallId,{response:""}]}function Or(t){return{toolCallId:t.toolCallId,input:t.input}}function $r(){const t=R.c(5),e=K();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(nt,{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 r;return t[3]!==o?(r=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]=r):r=t[4],r}function bs(t){const e=R.c(7),{userAskParts:s,isStreaming:o,onSubmit:r}=t;let i;e[0]!==s?(i=s.filter(Br),e[0]=s,e[1]=i):i=e[1];const a=i;if(a.length===0){if(o){let V;return e[2]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsx($r,{}),e[2]=V):V=e[2],V}return null}let l;return e[3]!==o||e[4]!==r||e[5]!==a?(l=n.jsx(Fr,{parts:a,isStreaming:o,onSubmit:r}),e[3]=o,e[4]=r,e[5]=a,e[6]=l):l=e[6],l}function Br(t){return t.state==="input-available"}function Kr(t){const e=R.c(33),{parts:s,isStreaming:o,onRespond:r}=t,i=K();let a;e[0]!==s?(a=s.at(-1),e[0]=s,e[1]=a):a=e[1];const l=a,V=l?.input;if(!l||!V?.title)return null;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(Wt,{size:14}),e[2]=c):c=e[2];let u;e[3]!==i?(u=i("chat.suggestTask.label"),e[3]=i,e[4]=u):u=e[4];const d=V.title;let p;e[5]!==r||e[6]!==l?(p=()=>r(l,!1),e[5]=r,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]!==r||e[15]!==l?(m=()=>r(l,!0),e[14]=r,e[15]=l,e[16]=m):m=e[16];let g;e[17]!==i?(g=i("chat.suggestTask.create"),e[17]=i,e[18]=g):g=e[18];let x;e[19]!==o||e[20]!==m||e[21]!==g?(x=n.jsx(W,{type:"button",size:"sm",className:"h-7",disabled:o,onClick:m,children:g}),e[19]=o,e[20]=m,e[21]=g,e[22]=x):x=e[22];let v;e[23]!==x||e[24]!==f?(v=n.jsxs(n.Fragment,{children:[f,x]}),e[23]=x,e[24]=f,e[25]=v):v=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 j;return e[28]!==V.title||e[29]!==v||e[30]!==b||e[31]!==u?(j=n.jsx(he,{icon:c,label:u,title:d,defaultExpanded:!0,footerRight:v,children:b}),e[28]=V.title,e[29]=v,e[30]=b,e[31]=u,e[32]=j):j=e[32],j}function qr(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[r]=e;return r&&e.length===1?{icon:"in_progress",activity:r.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 Qr(t){const e=R.c(13),{todos:s}=t;if(s.length===0)return null;let o;e[0]!==s?(o=qr(s),e[0]=s,e[1]=o):o=e[1];const r=o;let i;e[2]!==r.icon?(i=n.jsx(Hr,{status:r.icon}),e[2]=r.icon,e[3]=i):i=e[3];const a=r.activity,l=r.progress;let V;e[4]!==s?(V=s.map(Yr),e[4]=s,e[5]=V):V=e[5];let c;e[6]!==V?(c=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]=c):c=e[7];let u;return e[8]!==r.activity||e[9]!==r.progress||e[10]!==i||e[11]!==c?(u=n.jsx(he,{icon:i,label:a,count:l,defaultExpanded:!1,children:c}),e[8]=r.activity,e[9]=r.progress,e[10]=i,e[11]=c,e[12]=u):u=e[12],u}function Yr(t,e){return n.jsx(Wr,{todo:t},e)}function Wr(t){const e=R.c(14),{todo:s}=t,o=s.status==="completed",i=s.status==="in_progress"?s.activeForm:s.content;let a;e[0]!==s.status?(a=n.jsx(Gr,{status:s.status}),e[0]=s.status,e[1]=a):a=e[1];const l=o&&"text-muted-foreground";let V;e[2]!==l?(V=$("relative text-sm leading-snug pt-px select-none",l),e[2]=l,e[3]=V):V=e[3];const c=o?"100%":"0%",u=o?"width 300ms ease 200ms":"width 150ms ease";let d;e[4]!==c||e[5]!==u?(d=n.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:"50%",height:"1px",background:"currentColor",width:c,transition:u}}),e[4]=c,e[5]=u,e[6]=d):d=e[6];let p;e[7]!==i||e[8]!==V||e[9]!==d?(p=n.jsxs("span",{className:V,children:[i,d]}),e[7]=i,e[8]=V,e[9]=d,e[10]=p):p=e[10];let h;return e[11]!==a||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:[a,p]}),e[11]=a,e[12]=p,e[13]=h):h=e[13],h}function Gr(t){const e=R.c(4),{status:s}=t,o=s==="completed"?"true":void 0,r=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 a;return e[1]!==o||e[2]!==r?(a=n.jsx("div",{className:"todo-cb mt-0.5","data-checked":o,"data-progress":r,"aria-hidden":"true",children:i}),e[1]=o,e[2]=r,e[3]=a):a=e[3],a}function Hr(t){const e=R.c(13),{status:s}=t,o=K();if(s==="completed"){let a;e[0]!==o?(a=o("chat.todoStatus.completed"),e[0]=o,e[1]=a):a=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]!==a?(V=n.jsx("span",{"aria-label":a,className:"inline-flex items-center justify-center w-3.5 h-3.5 rounded-sm bg-primary",children:l}),e[3]=a,e[4]=V):V=e[4],V}if(s==="in_progress"){let a;e[5]!==o?(a=o("chat.todoStatus.inProgress"),e[5]=o,e[6]=a):a=e[6];let l;return e[7]!==a?(l=n.jsx("span",{"aria-label":a,className:"inline-block w-2 h-2 rounded-full bg-primary animate-pulse shrink-0"}),e[7]=a,e[8]=l):l=e[8],l}let r;e[9]!==o?(r=o("chat.todoStatus.pending"),e[9]=o,e[10]=r):r=e[10];let i;return e[11]!==r?(i=n.jsx("span",{"aria-label":r,className:"inline-block w-3.5 h-3.5 rounded-sm border-[1.5px] border-muted-foreground/50 shrink-0"}),e[11]=r,e[12]=i):i=e[12],i}const Jr={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"}]},Zr={"credits.topUp.starter":"starter","credits.topUp.popular":"popular","credits.topUp.bestValue":"best_value"};function Xr(t){const e=R.c(46),{source:s,onDone:o}=t,r=K(),i=Rs(),[a]=Ce(),[l,V]=P.useState(a.language==="pt-BR"?"brl":"usd"),[c,u]=P.useState(""),[d,p]=P.useState(!1),h=l==="brl"?"R$":"$";let f;e[0]!==l||e[1]!==i?(f=async T=>{const{url:O}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:T,currency:l});return O},e[0]=l,e[1]=i,e[2]=f):f=e[2];let m;e[3]!==o?(m=T=>{T&&window.open(T,"_blank","noopener,noreferrer"),o?.()},e[3]=o,e[4]=m):m=e[4];let g;e[5]!==r?(g=T=>{_e.error(r("credits.topUp.failed",{message:T.message}))},e[5]=r,e[6]=g):g=e[6];let x;e[7]!==f||e[8]!==m||e[9]!==g?(x={mutationFn:f,onSuccess:m,onError:g},e[7]=f,e[8]=m,e[9]=g,e[10]=x):x=e[10];const{mutate:v,isPending:b}=Ps(x);let j;e[11]!==l||e[12]!==s||e[13]!==v?(j=(T,O)=>{te("credits_topup_clicked",{amount_cents:T,currency:l,tier_label:O,source:s}),v(T)},e[11]=l,e[12]=s,e[13]=v,e[14]=j):j=e[14];const A=j,y=parseFloat(c),k=!isNaN(y)&&y>=1;let w,S,C;e[15]===Symbol.for("react.memo_cache_sentinel")?(w=T=>{T&&V(T)},S=n.jsx(kt,{value:"usd",className:"h-8 px-3 text-xs",children:"USD"}),C=n.jsx(kt,{value:"brl",className:"h-8 px-3 text-xs",children:"BRL"}),e[15]=w,e[16]=S,e[17]=C):(w=e[15],S=e[16],C=e[17]);let N;e[18]!==l?(N=n.jsx("div",{className:"mb-4",children:n.jsxs(mo,{type:"single",variant:"outline",size:"sm",value:l,onValueChange:w,children:[S,C]})}),e[18]=l,e[19]=N):N=e[19];const I=Jr[l];let _;if(e[20]!==A||e[21]!==h||e[22]!==b||e[23]!==r||e[24]!==I){let T;e[26]!==A||e[27]!==h||e[28]!==b||e[29]!==r?(T=O=>{const{dollars:U,labelKey:Q}=O;return n.jsxs("button",{type:"button",disabled:b,onClick:()=>A(U*100,Zr[Q]??"preset"),className:$("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,U]}),n.jsx("span",{className:"text-xs text-muted-foreground",children:r(Q)})]},U)},e[26]=A,e[27]=h,e[28]=b,e[29]=r,e[30]=T):T=e[30],_=I.map(T),e[20]=A,e[21]=h,e[22]=b,e[23]=r,e[24]=I,e[25]=_}else _=e[25];let E;e[31]!==_?(E=n.jsx("div",{className:"grid grid-cols-3 gap-2.5",children:_}),e[31]=_,e[32]=E):E=e[32];let F;e[33]!==A||e[34]!==h||e[35]!==c||e[36]!==y||e[37]!==k||e[38]!==b||e[39]!==d||e[40]!==r?(F=d?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(Es,{type:"number",min:"1",step:"1",placeholder:r("credits.topUp.customPlaceholder"),value:c,onChange:T=>u(T.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),n.jsx(W,{size:"lg",disabled:!k||b,onClick:()=>A(Math.round(y*100),"custom"),children:r(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:r("credits.topUp.enterCustom")}),e[33]=A,e[34]=h,e[35]=c,e[36]=y,e[37]=k,e[38]=b,e[39]=d,e[40]=r,e[41]=F):F=e[41];let D;return e[42]!==E||e[43]!==F||e[44]!==N?(D=n.jsxs("div",{children:[N,E,F]}),e[42]=E,e[43]=F,e[44]=N,e[45]=D):D=e[45],D}const ei=["chat.creditsExhaustedBanner.benefit1","chat.creditsExhaustedBanner.benefit2","chat.creditsExhaustedBanner.benefit3"];function ti(t){const e=R.c(47),{onDismiss:s}=t,{org:o}=Me(),r=at(),{decoKeyId:i}=ho(),a=K(),l=$e("credits");let V,c;if(e[0]!==o.id?(V=()=>{te("credits_exhausted_shown",{organization_id:o.id})},c=[o.id],e[0]=o.id,e[1]=V,e[2]=c):(V=e[1],c=e[2]),P.useEffect(V,c),!l)return null;let u;e[3]!==s?(u=I=>!I&&s?.(),e[3]=s,e[4]=u):u=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=["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]=d):d=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:d.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]!==a?(f=a("chat.creditsExhaustedBanner.title"),e[8]=a,e[9]=f):f=e[9];let m;e[10]!==f?(m=n.jsx(Fs,{className:"text-xl font-semibold tracking-tight",children:f}),e[10]=f,e[11]=m):m=e[11];let g;e[12]!==a?(g=a("chat.creditsExhaustedBanner.description"),e[12]=a,e[13]=g):g=e[13];let x;e[14]!==g?(x=n.jsx(Ls,{className:"mt-1.5 text-sm leading-relaxed",children:g}),e[14]=g,e[15]=x):x=e[15];let v;e[16]!==x||e[17]!==m?(v=n.jsxs("div",{className:"relative px-8 pt-8 pb-2 overflow-hidden",children:[p,n.jsxs(Us,{className:"relative gap-4",children:[h,n.jsxs("div",{children:[m,x]})]})]}),e[16]=x,e[17]=m,e[18]=v):v=e[18];let b;e[19]!==i||e[20]!==s||e[21]!==a?(b=i&&n.jsxs("div",{className:"px-8 pt-5 pb-6",children:[n.jsx("div",{className:"surface p-5",children:n.jsx(Xr,{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:ei.map(I=>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(lt,{size:12,className:"text-success"})}),n.jsx("span",{className:"text-sm text-foreground/80",children:a(I)})]},I))})]}),e[19]=i,e[20]=s,e[21]=a,e[22]=b):b=e[22];let j;e[23]!==a?(j=a("chat.creditsExhaustedBanner.dismiss"),e[23]=a,e[24]=j):j=e[24];let A;e[25]!==s||e[26]!==j?(A=n.jsx(W,{variant:"ghost",size:"sm",onClick:s,children:j}),e[25]=s,e[26]=j,e[27]=A):A=e[27];let y;e[28]!==r||e[29]!==s||e[30]!==o.slug?(y=()=>{r({to:"/$org/settings/ai-providers",params:{org:o.slug}}),s?.()},e[28]=r,e[29]=s,e[30]=o.slug,e[31]=y):y=e[31];let k;e[32]!==a?(k=a("chat.creditsExhaustedBanner.manageProviders"),e[32]=a,e[33]=k):k=e[33];let w;e[34]!==y||e[35]!==k?(w=n.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:y,children:k}),e[34]=y,e[35]=k,e[36]=w):w=e[36];let S;e[37]!==A||e[38]!==w?(S=n.jsxs("div",{className:"px-8 py-4 border-t border-border bg-muted/30 flex items-center justify-between",children:[A,w]}),e[37]=A,e[38]=w,e[39]=S):S=e[39];let C;e[40]!==v||e[41]!==b||e[42]!==S?(C=n.jsxs(zs,{className:"sm:max-w-[520px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:si,children:[v,b,S]}),e[40]=v,e[41]=b,e[42]=S,e[43]=C):C=e[43];let N;return e[44]!==C||e[45]!==u?(N=n.jsx(Os,{open:!0,onOpenChange:u,children:C}),e[44]=C,e[45]=u,e[46]=N):N=e[46],N}function si(t){return t.preventDefault()}const ni={trial_exhausted:{label:"chat.subscriptionLimit.trialLabel",title:"chat.subscriptionLimit.trialTitle"},monthly_exhausted:{label:"chat.subscriptionLimit.monthlyLabel",title:"chat.subscriptionLimit.monthlyTitle"},runs_exhausted:{label:"chat.subscriptionLimit.runsLabel",title:"chat.subscriptionLimit.runsTitle"}};function oi(t){const e=R.c(16),{kind:s,onDismiss:o,onSubscribe:r}=t,i=K(),{label:a,title:l}=ni[s];let V;e[0]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsx(dt,{size:14}),e[0]=V):V=e[0];let c;e[1]!==a||e[2]!==i?(c=i(a),e[1]=a,e[2]=i,e[3]=c):c=e[3];let u;e[4]!==i||e[5]!==l?(u=i(l),e[4]=i,e[5]=l,e[6]=u):u=e[6];let d;e[7]!==s||e[8]!==r||e[9]!==i?(d=s==="trial_exhausted"?n.jsx(W,{size:"sm",onClick:r,className:"h-7 text-xs",children:i("chat.subscriptionLimit.subscribeButton")}):void 0,e[7]=s,e[8]=r,e[9]=i,e[10]=d):d=e[10];let p;return e[11]!==o||e[12]!==c||e[13]!==u||e[14]!==d?(p=n.jsx(he,{icon:V,label:c,title:u,defaultExpanded:!0,variant:"warning",onClose:o,footerRight:d}),e[11]=o,e[12]=c,e[13]=u,e[14]=d,e[15]=p):p=e[15],p}const ri={ai_budget_exhausted:{label:"chat.planRefused.budgetLabel",title:"chat.planRefused.budgetTitle"},feature_not_in_plan:{label:"chat.planRefused.featureLabel",title:"chat.planRefused.featureTitle"}};function Dt(t){const e=R.c(21),{kind:s,onDismiss:o}=t,r=K(),i=at(),{org:a}=Me(),{label:l,title:V}=ri[s];let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(dt,{size:14}),e[0]=c):c=e[0];let u;e[1]!==l||e[2]!==r?(u=r(l),e[1]=l,e[2]=r,e[3]=u):u=e[3];let d;e[4]!==r||e[5]!==V?(d=r(V),e[4]=r,e[5]=V,e[6]=d):d=e[6];let p;e[7]!==i||e[8]!==o||e[9]!==a.slug?(p=()=>{i({to:"/$org/settings/ai-providers",params:{org:a.slug}}),o()},e[7]=i,e[8]=o,e[9]=a.slug,e[10]=p):p=e[10];let h;e[11]!==r?(h=r("chat.planRefused.seePlans"),e[11]=r,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]!==d||e[19]!==f?(m=n.jsx(he,{icon:c,label:u,title:d,defaultExpanded:!0,variant:"warning",onClose:o,footerRight:f}),e[16]=o,e[17]=u,e[18]=d,e[19]=f,e[20]=m):m=e[20],m}function As(t){const e=ii(t);if(e!==null){const c=As(e);return{summary:c.summary,rawDetails:c.rawDetails??t}}const s=t.trim(),o=s.startsWith("<")&&/<[a-z][\s\S]*>/i.test(s),r=/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),a=/timeout|timed out|aborted|deadline/i.test(s),l=s.length>240,V=/sandbox failed to start(?::\s*(.+))?/is.exec(s);if(V){const c=V[1]?.trim().replace(/\.$/,"");return{summary:c?`Your sandbox didn't finish starting up (${c}). Try again.`:"Your sandbox didn't finish starting up. Try again.",rawDetails:t}}return r||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}:a?{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 ii(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:r}=s,i=typeof o=="string"?o:r;return typeof i=="string"&&i.trim()&&!i.trim().startsWith("{")?i:null}const ai={length:"chat.highlight.warningDescriptionLength","content-filter":"chat.highlight.warningDescriptionContentFilter","tool-calls":"chat.highlight.warningDescriptionToolCalls"};function Ye(t){const e=R.c(29),s=K(),{variant:o,onDismiss:r}=t,i=o==="error";let a;e[0]!==i||e[1]!==s?(a=s(i?"chat.highlight.errorOccurred":"chat.highlight.responseIncomplete"),e[0]=i,e[1]=s,e[2]=a):a=e[2];const l=a,V=i?to:Bs;let c;e[3]!==t.error||e[4]!==t.finishReason||e[5]!==t.variant||e[6]!==s?(c=t.variant==="error"?t.error.message:(()=>{const v=ai[t.finishReason];return v?s(v):s("chat.highlight.responseStoppedUnexpectedly",{reason:t.finishReason})})(),e[3]=t.error,e[4]=t.finishReason,e[5]=t.variant,e[6]=s,e[7]=c):c=e[7];const u=c;let d;e[8]!==i||e[9]!==u?(d=i?As(u):{summary:u,rawDetails:null},e[8]=i,e[9]=u,e[10]=d):d=e[10];const{summary:p,rawDetails:h}=d;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 g;e[18]!==h||e[19]!==s?(g=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(()=>_e.success(s("chat.highlight.copiedToClipboard"))).catch(()=>_e.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(so,{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]=g):g=e[20];let x;return e[21]!==l||e[22]!==r||e[23]!==p||e[24]!==f||e[25]!==m||e[26]!==g||e[27]!==o?(x=n.jsx(he,{icon:f,label:l,title:p,defaultExpanded:!0,variant:o,onClose:r,footerRight:m,children:g}),e[21]=l,e[22]=r,e[23]=p,e[24]=f,e[25]=m,e[26]=g,e[27]=o,e[28]=x):x=e[28],x}function Be(t){const e=R.c(78);let s;e[0]!==t?(s=t===void 0?{}:t,e[0]=t,e[1]=s):s=e[1];const{inline:o,voiceMode:r}=s,i=o===void 0?!1:o,a=r===void 0?!1:r,l=K(),{error:V,clearError:c,finishReason:u,clearFinishReason:d,messages:p,isStreaming:h,submit:f,sendMessage:m}=Oe(),[g,x]=Ce(),{virtualMcpId:v,createTaskWithMessage:b}=Vt(),{chatMode:j,setChatMode:A,simpleModeTier:y}=We(),k=$e("credits"),{mutate:w}=Ao("ORGANIZATION_BILLING_CHECKOUT_START","taskBoard.subscriptionPaywall.checkoutError");let S;e[2]!==w?(S=()=>w(),e[2]=w,e[3]=S):S=e[3];const C=S;let N;e[4]!==j||e[5]!==y||e[6]!==v||e[7]!==a?(N=oe=>({...a?{voiceMode:!0}:{},tier:y,mode:j,toolApprovalLevel:oe,agent:v?{id:v}:void 0}),e[4]=j,e[5]=y,e[6]=v,e[7]=a,e[8]=N):N=e[8];const I=N;let _;e[9]!==g.toolApprovalLevel?(_=g.toolApprovalLevel??$s(),e[9]=g.toolApprovalLevel,e[10]=_):_=e[10];const E=_,F=p.at(-1),D=F?.role==="assistant"?F.parts:[],T=D.filter(di),O=D.filter($t),U=cs(D),Q=ls(D);let z;e[11]!==V||e[12]!==m||e[13]!==l?(z=()=>{if(V){const fe={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:l("chat.highlight.fixInChatMessage",{error:V.message})}]}]};m(fe)}},e[11]=V,e[12]=m,e[13]=l,e[14]=z):z=e[14];const Y=z;let L;e[15]!==m||e[16]!==l?(L=()=>{const oe={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:l("chat.highlight.pleaseContinue")}]}]};m(oe)},e[15]=m,e[16]=l,e[17]=L):L=e[17];const H=L;let X;e[18]!==I||e[19]!==E||e[20]!==f?(X=(oe,fe)=>{f({kind:"toolOutput",toolCallId:oe.toolCallId,output:{response:fe}},I(E))},e[18]=I,e[19]=E,e[20]=f,e[21]=X):X=e[21];const Z=X;let ie;e[22]!==I||e[23]!==E||e[24]!==f?(ie=(oe,fe)=>{f({kind:"toolOutput",toolCallId:oe.toolCallId,output:{accepted:fe}},I(E))},e[22]=I,e[23]=E,e[24]=f,e[25]=ie):ie=e[25];const M=ie;let B;e[26]!==b||e[27]!==g||e[28]!==A||e[29]!==x||e[30]!==l||e[31]!==v?(B=oe=>{A("default"),x({...g,toolApprovalLevel:"auto"}),b({virtualMcpId:v,message:{parts:[{type:"text",text:l("chat.highlight.implementPlanMessage",{plan:oe})}]}})},e[26]=b,e[27]=g,e[28]=A,e[29]=x,e[30]=l,e[31]=v,e[32]=B):B=e[32];const J=B,se=ci;let ee;e[33]!==I||e[34]!==f?(ee=(oe,fe,qe,Ae)=>{f({kind:"approval",approvalId:oe,approved:fe,...qe?{reason:qe}:{}},I(Ae))},e[33]=I,e[34]=f,e[35]=ee):ee=e[35];const le=ee,G=ds();if(G.isCreditExhausted){let oe;return e[36]!==k||e[37]!==c||e[38]!==i?(oe=k?n.jsx(ti,{onDismiss:c}):n.jsx("div",{className:$(!i&&"absolute bottom-full left-0 right-0"),children:n.jsx(Dt,{kind:"ai_budget_exhausted",onDismiss:c})}),e[36]=k,e[37]=c,e[38]=i,e[39]=oe):oe=e[39],oe}const{showError:ae,showWarning:Ve,hasApprovals:ce}=G,Ne=T.map(Vi).join("|"),De=Vs(U)?.toolCallId??"",Ke=Q.map(li).join("|"),ue=!i&&"absolute bottom-full left-0 right-0";let pe;e[40]!==ue?(pe=$(ue),e[40]=ue,e[41]=pe):pe=e[41];let me;e[42]!==G.todos?(me=n.jsx(Qr,{todos:G.todos}),e[42]=G.todos,e[43]=me):me=e[43];let xe;e[44]!==c||e[45]!==G.subscriptionErrorKind||e[46]!==C?(xe=G.subscriptionErrorKind&&n.jsx(oi,{kind:G.subscriptionErrorKind,onDismiss:c,onSubscribe:C}),e[44]=c,e[45]=G.subscriptionErrorKind,e[46]=C,e[47]=xe):xe=e[47];let de;e[48]!==c||e[49]!==G.planRefusal?(de=G.planRefusal&&n.jsx(Dt,{kind:G.planRefusal,onDismiss:c}),e[48]=c,e[49]=G.planRefusal,e[50]=de):de=e[50];let ve;e[51]!==c||e[52]!==V||e[53]!==Y||e[54]!==ae?(ve=ae&&n.jsx(Ye,{variant:"error",error:V,onDismiss:c,onFixInChat:Y}),e[51]=c,e[52]=V,e[53]=Y,e[54]=ae,e[55]=ve):ve=e[55];let ke;e[56]!==d||e[57]!==u||e[58]!==H||e[59]!==Ve?(ke=Ve&&n.jsx(Ye,{variant:"warning",finishReason:u,onDismiss:d,onContinue:H}),e[56]=d,e[57]=u,e[58]=H,e[59]=Ve,e[60]=ke):ke=e[60];const Ie=ce&&n.jsx(Cr,{approvals:Q,isStreaming:h,onRespond:le},Ke),Re=G.hasPlans&&n.jsx(Ir,{plans:U,isStreaming:h,onApprove:J,onDismiss:se},De),Pe=G.hasTaskSuggestion&&n.jsx(Kr,{parts:O,isStreaming:h,onRespond:M},O.at(-1)?.toolCallId??"");let be;e[61]!==G.isWaitingForUserInput||e[62]!==Z||e[63]!==h||e[64]!==Ne||e[65]!==T?(be=G.isWaitingForUserInput&&n.jsx(bs,{userAskParts:T,isStreaming:h,onSubmit:Z},Ne),e[61]=G.isWaitingForUserInput,e[62]=Z,e[63]=h,e[64]=Ne,e[65]=T,e[66]=be):be=e[66];let we;return e[67]!==pe||e[68]!==me||e[69]!==xe||e[70]!==de||e[71]!==ve||e[72]!==ke||e[73]!==Ie||e[74]!==Re||e[75]!==Pe||e[76]!==be?(we=n.jsxs("div",{className:pe,children:[me,xe,de,ve,ke,Ie,Re,Pe,be]}),e[67]=pe,e[68]=me,e[69]=xe,e[70]=de,e[71]=ve,e[72]=ke,e[73]=Ie,e[74]=Re,e[75]=Pe,e[76]=be,e[77]=we):we=e[77],we}function li(t){return t.approvalId}function Vi(t){return t.toolCallId}function ci(){document.querySelector("[data-chat-input]")?.focus()}function di(t){return t.type==="tool-user_ask"}Be.Error=function(e){return n.jsx(Ye,{variant:"error",error:e.error,onDismiss:e.onDismiss,onFixInChat:e.onFixInChat})};Be.Warning=function(e){return n.jsx(Ye,{variant:"warning",finishReason:e.finishReason,onDismiss:e.onDismiss,onContinue:e.onContinue})};Be.UserAskQuestion=bs;function ys(t){const e=R.c(20),{taskId:s}=t,o=K(),r=An(s),i=yn(r),a=jn(),{stop:l,removeLocalMessage:V}=Oe();if(i.length===0)return null;let c;e[0]!==o?(c=o("chat.queueTray.sendNow"),e[0]=o,e[1]=c):c=e[1];let u;e[2]!==l?(u=()=>{l()},e[2]=l,e[3]=u):u=e[3];let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(Qt,{size:14}),e[4]=d):d=e[4];let p;e[5]!==c||e[6]!==u?(p=n.jsx(He,{asChild:!0,children:n.jsx(W,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c,onClick:u,children:d})}),e[5]=c,e[6]=u,e[7]=p):p=e[7];let h;e[8]!==o?(h=o("chat.queueTray.sendNow"),e[8]=o,e[9]=h):h=e[9];let f;e[10]!==h?(f=n.jsx(Je,{side:"top",children:n.jsx("p",{className:"text-xs",children:h})}),e[10]=h,e[11]=f):f=e[11];let m;e[12]!==p||e[13]!==f?(m=n.jsxs(Ze,{delayDuration:400,children:[p,f]}),e[12]=p,e[13]=f,e[14]=m):m=e[14];let g;return e[15]!==a||e[16]!==V||e[17]!==o||e[18]!==s?(g=(x,v)=>n.jsxs("div",{className:"group/queuerow flex items-center gap-2 px-3 py-1.5",children:[n.jsx("span",{className:"flex size-[18px] shrink-0 items-center justify-center rounded-full bg-muted text-2xs font-semibold text-muted-foreground dark:bg-background",children:v+1}),n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:x.text}),n.jsx("div",{className:"flex shrink-0 items-center gap-1 opacity-0 transition-opacity focus-within:opacity-100 group-hover/queuerow:opacity-100",children:n.jsx(W,{type:"button",variant:"ghost",size:"icon-sm",title:o("chat.queueTray.removeFromQueue"),"aria-label":o("chat.queueTray.removeFromQueue"),onClick:()=>{a.cancel(s,x.messageId).then(b=>{b&&(kn(s,x.messageId),V(x.messageId))})},children:n.jsx(Kt,{className:"size-3.5"})})})]},x.messageId),e[15]=a,e[16]=V,e[17]=o,e[18]=s,e[19]=g):g=e[19],n.jsxs("div",{className:"mb-1 overflow-hidden surface dark:bg-muted",children:[n.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-border py-1.5 pr-2 pl-3 text-xs text-muted-foreground",children:[n.jsx("span",{children:o(i.length===1?"chat.queueTray.queuedMessage":"chat.queueTray.queuedMessages",{count:i.length})}),m]}),i.map(g)]})}function ui(t){return["openai-compatible","openrouter","deco"].includes(t)}function pi(t,e){return ui(t)&&fi(e)!==null}function fi(t){const e=t.replace(/^openai\//,"");return/^(gpt-\d|o[134](?:-|$))/.test(e)?e:null}const hi={anthropic:/^claude-/,openrouter:/^anthropic\/claude-/,deco:/^anthropic\/claude-/};function mi(t,e){return hi[t]?.test(e)??!1}function gi(t){return Do(t)&&mi(t.providerId,t.modelId)}function xi(t,e){return t?{modelId:t.modelId,title:t.title??t.modelId,keyId:t.keyId,providerId:e,description:null,logo:null,capabilities:[],limits:null,costs:null}:null}const vi={fast:"chat.tierTrigger.tierFast",smart:"chat.tierTrigger.tierSmart",thinking:"chat.tierTrigger.tierThinking"};function bi(t){const e=R.c(32),{tier:s,orgSlot:o,userSlot:r,autoSlot:i,filterModels:a,onPick:l,onReset:V,onClose:c}=t,u=K(),d=rs(),p=new Set(d.map(Ai)),h=wn([r,o,i],p),f=h?.keyId??null,[m,g]=P.useState(f??d[0]?.id??null),x=d.some(U=>U.id===m)?m:f??d[0]?.id??null,v=x?d.find(U=>U.id===x):null,b="flex h-[70vh] max-h-[460px] w-full flex-col",j=vi[s];let A;e[0]!==u||e[1]!==j?(A=u(j),e[0]=u,e[1]=j,e[2]=A):A=e[2];let y;e[3]!==A?(y=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:A}),e[3]=A,e[4]=y):y=e[4];let k;e[5]!==V||e[6]!==u||e[7]!==r?(k=r&&n.jsx("button",{type:"button",onClick:V,className:"text-xs text-muted-foreground hover:text-foreground px-2 py-1 rounded-lg hover:bg-accent cursor-pointer",children:u("chat.modelPreferences.reset")}),e[5]=V,e[6]=u,e[7]=r,e[8]=k):k=e[8];let w;e[9]!==y||e[10]!==k?(w=n.jsxs("div",{className:"flex items-center justify-between px-3 h-8 shrink-0",children:[y,k]}),e[9]=y,e[10]=k,e[11]=w):w=e[11];const S="flex-1 min-h-0",C=P.Suspense;let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(jo,{}),e[12]=N):N=e[12];const I=yo,_=!0,E=xi(f?h:null,v?.providerId??"deco");let F;e[13]!==x||e[14]!==l||e[15]!==g?(F=U=>{const Q=U.keyId??x??"";g(Q),l({keyId:Q,modelId:U.modelId,title:U.title})},e[13]=x,e[14]=l,e[15]=g,e[16]=F):F=e[16];let D;e[17]!==I||e[18]!==x||e[19]!==a||e[20]!==c||e[21]!==g||e[22]!==E||e[23]!==F?(D=n.jsx(I,{compact:_,filterModels:a,onClose:c,credentialId:x,onCredentialChange:g,selectedModel:E,onModelChange:F}),e[17]=I,e[18]=x,e[19]=a,e[20]=c,e[21]=g,e[22]=E,e[23]=F,e[24]=D):D=e[24];let T;e[25]!==C||e[26]!==D||e[27]!==N?(T=n.jsx("div",{className:S,children:n.jsx(C,{fallback:N,children:D})}),e[25]=C,e[26]=D,e[27]=N,e[28]=T):T=e[28];let O;return e[29]!==T||e[30]!==w?(O=n.jsxs("div",{className:b,children:[w,T]}),e[29]=T,e[30]=w,e[31]=O):O=e[31],O}function Ai(t){return t.id}const yi=["fast","smart","thinking"];function js(t){return{fast:t("chat.tierTrigger.tierFast"),smart:t("chat.tierTrigger.tierSmart"),thinking:t("chat.tierTrigger.tierThinking")}}const Rt={fast:"chat.agentModels.quickerResponses",smart:"chat.agentModels.balancedQuality",thinking:"chat.agentModels.deeperReasoning"};function ji(t){const e=R.c(28),{tier:s,pillIcon:o,groups:r}=t,i=K();let a;e[0]!==i?(a=js(i),e[0]=i,e[1]=a):a=e[1];const l=a,[V,c]=P.useState(!1);let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=w=>{w.onSelect(),c(!1)},e[2]=u):u=e[2];const d=u,p=l[s];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=$("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),e[3]=h):h=e[3];let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=$("min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0","@[320px]/chat-bottom:max-w-24 @[320px]/chat-bottom:opacity-100"),e[4]=f):f=e[4];const m=l[s];let g;e[5]!==m?(g=n.jsx("span",{className:f,children:m}),e[5]=m,e[6]=g):g=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(es,{size:12,className:"opacity-60 hidden @[320px]/chat-bottom:inline-block"}),e[7]=x):x=e[7];let v;e[8]!==o||e[9]!==p||e[10]!==g?(v=n.jsx(He,{asChild:!0,children:n.jsx("span",{className:"inline-flex min-w-0 shrink",children:n.jsx(ts,{asChild:!0,children:n.jsxs(W,{type:"button",variant:"ghost",size:"default","aria-label":p,className:h,children:[o,g,x]})})})}),e[8]=o,e[9]=p,e[10]=g,e[11]=v):v=e[11];let b;e[12]!==p?(b=n.jsx(Je,{children:p}),e[12]=p,e[13]=b):b=e[13];let j;e[14]!==v||e[15]!==b?(j=n.jsxs(Ze,{children:[v,b]}),e[14]=v,e[15]=b,e[16]=j):j=e[16];let A;if(e[17]!==r||e[18]!==i){let w;e[20]!==i?(w=S=>n.jsx("div",{className:"flex flex-col",children:S.rows.map(C=>n.jsxs("div",{className:"group/tier-row relative flex items-stretch rounded-lg hover:bg-accent",children:[n.jsxs("button",{type:"button",role:"menuitem","aria-label":C.title,onClick:()=>d(C),className:$("flex flex-1 min-w-0 items-start gap-2 px-2 py-1.5 text-left",C.modelOverride&&"pr-7 [@media(hover:hover)]:pr-2"),children:[C.icon&&n.jsx("span",{className:"shrink-0 text-muted-foreground mt-0.5",children:C.icon}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"text-sm",children:C.title}),C.subtitle&&n.jsx("div",{className:"text-xs text-muted-foreground",children:C.subtitle})]}),C.active&&n.jsx("span",{title:i("chat.tierTrigger.selected"),children:n.jsx(lt,{size:14,className:"text-foreground mt-0.5"})})]}),C.modelOverride&&n.jsx(wi,{label:C.title,render:C.modelOverride})]},C.key))},S.key),e[20]=i,e[21]=w):w=e[21],A=r.map(w),e[17]=r,e[18]=i,e[19]=A}else A=e[19];let y;e[22]!==A?(y=n.jsx(ss,{align:"end",className:"p-1 w-64",onOpenAutoFocus:ki,children:n.jsx("div",{role:"menu",className:"flex flex-col",children:A})}),e[22]=A,e[23]=y):y=e[23];let k;return e[24]!==V||e[25]!==j||e[26]!==y?(k=n.jsxs(ns,{open:V,onOpenChange:c,children:[j,y]}),e[24]=V,e[25]=j,e[26]=y,e[27]=k):k=e[27],k}function ki(t){return t.preventDefault()}function wi(t){const e=R.c(38),{label:s,render:o}=t,r=K(),i=os(),[a,l]=P.useState(!1);let V;e[0]===Symbol.for("react.memo_cache_sentinel")?(V=()=>l(!1),e[0]=V):V=e[0];const c=V;let u;e[1]!==s||e[2]!==r?(u=r("chat.modelPreferences.customizeModel",{tier:s}),e[1]=s,e[2]=r,e[3]=u):u=e[3];const d=a&&"opacity-100";let p;e[4]!==d?(p=$("absolute right-1 top-1/2 -translate-y-1/2 flex items-center justify-center","size-6 rounded-lg bg-background shadow-edge","text-muted-foreground hover:text-foreground","opacity-100 [@media(hover:hover)]:opacity-0","[@media(hover:hover)]:group-hover/tier-row:opacity-100","[@media(hover:hover)]:group-focus-within/tier-row:opacity-100",d),e[4]=d,e[5]=p):p=e[5];let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(Gn,{size:14}),e[6]=h):h=e[6];let f;e[7]!==u||e[8]!==p?(f=n.jsx("button",{type:"button","aria-label":u,className:p,children:h}),e[7]=u,e[8]=p,e[9]=f):f=e[9];const m=f;if(i){let j;e[10]!==m?(j=n.jsx(So,{asChild:!0,children:m}),e[10]=m,e[11]=j):j=e[11];let A;e[12]!==s||e[13]!==r?(A=r("chat.modelPreferences.customizeModel",{tier:s}),e[12]=s,e[13]=r,e[14]=A):A=e[14];let y;e[15]!==A?(y=n.jsx(Co,{className:"sr-only",children:A}),e[15]=A,e[16]=y):y=e[16];let k;e[17]!==a||e[18]!==o?(k=a&&o(c),e[17]=a,e[18]=o,e[19]=k):k=e[19];let w;e[20]!==k||e[21]!==y?(w=n.jsxs(No,{className:"p-0 flex flex-col max-h-[95vh]",children:[y,k]}),e[20]=k,e[21]=y,e[22]=w):w=e[22];let S;return e[23]!==a||e[24]!==w||e[25]!==j?(S=n.jsxs(Io,{open:a,onOpenChange:l,children:[j,w]}),e[23]=a,e[24]=w,e[25]=j,e[26]=S):S=e[26],S}let g;e[27]!==m?(g=n.jsx(ts,{asChild:!0,children:m}),e[27]=m,e[28]=g):g=e[28];let x;e[29]!==a||e[30]!==o?(x=a&&o(c),e[29]=a,e[30]=o,e[31]=x):x=e[31];let v;e[32]!==x?(v=n.jsx(ss,{side:"right",align:"start",collisionPadding:12,className:"w-[min(22rem,calc(100vw-2rem))] p-0 overflow-hidden",children:x}),e[32]=x,e[33]=v):v=e[33];let b;return e[34]!==a||e[35]!==g||e[36]!==v?(b=n.jsxs(ns,{open:a,onOpenChange:l,children:[g,v]}),e[34]=a,e[35]=g,e[36]=v,e[37]=b):b=e[37],b}function Pt(t){return t==="fast"?n.jsx(dt,{size:16}):t==="thinking"?n.jsx(Wn,{size:16}):n.jsx(To,{size:16})}function Si(t){const e=R.c(13),s=Nn();let o;e[0]!==t||e[1]!==s.tiers?(o=c=>{const u=s.tiers[c];return u?u.title??u.modelId:t.chat[c]?.title},e[0]=t,e[1]=s.tiers,e[2]=o):o=e[2];const r=o;let i;e[3]!==r?(i=r("fast"),e[3]=r,e[4]=i):i=e[4];let a;e[5]!==r?(a=r("smart"),e[5]=r,e[6]=a):a=e[6];let l;e[7]!==r?(l=r("thinking"),e[7]=r,e[8]=l):l=e[8];let V;return e[9]!==i||e[10]!==a||e[11]!==l?(V={fast:i,smart:a,thinking:l},e[9]=i,e[10]=a,e[11]=l,e[12]=V):V=e[12],V}function Ci(){const t=R.c(25),e=K(),{simpleModeTier:s,setSimpleModeTier:o}=We(),r=_o(),i=rs(),a=Ro(i),l=Si(a),{data:V,error:c}=Sn();let u;t[0]!==V?(u=V===void 0?{tiers:{}}:V,t[0]=V,t[1]=u):u=t[1];const d=u,p=Cn(),h=ct()?.lockedHarness,f=h==="claude-code",m=$e("model_choice"),g=uo(),x=po();if(!g||!m)return null;let v,b;if(t[2]!==a||t[3]!==x||t[4]!==f||t[5]!==h||t[6]!==r||t[7]!==o||t[8]!==e||t[9]!==s||t[10]!==l||t[11]!==p||t[12]!==d||t[13]!==c){const w=js(e);v="decopilot",b=yi.map(S=>{const C=l[S],N=d.tiers[S];return{key:`decopilot-${S}`,icon:Pt(S),title:w[S],subtitle:x?C??e(Rt[S]):e(Rt[S]),active:s===S,onSelect:()=>o(S),modelOverride:x?I=>n.jsxs(n.Fragment,{children:[c&&n.jsx("div",{className:"text-xs text-destructive p-3 pb-0",children:e("chat.modelPreferences.loadFailed")}),n.jsx(bi,{tier:S,orgSlot:r.tiers[S],userSlot:N,autoSlot:a.chat[S],filterModels:h==="codex"?Ni:f?gi:void 0,onClose:I,onPick:_=>p.mutate({tier:S,slot:_}),onReset:()=>p.mutate({tier:S,slot:null})},`${S}:${N?.keyId??"org"}:${N?.modelId??""}`)]}):void 0}}),t[2]=a,t[3]=x,t[4]=f,t[5]=h,t[6]=r,t[7]=o,t[8]=e,t[9]=s,t[10]=l,t[11]=p,t[12]=d,t[13]=c,t[14]=v,t[15]=b}else v=t[14],b=t[15];let j;t[16]!==v||t[17]!==b?(j=[{key:v,rows:b}],t[16]=v,t[17]=b,t[18]=j):j=t[18];const A=j;let y;t[19]!==s?(y=Pt(s),t[19]=s,t[20]=y):y=t[20];let k;return t[21]!==A||t[22]!==y||t[23]!==s?(k=n.jsx(ji,{tier:s,pillIcon:y,groups:A}),t[21]=A,t[22]=y,t[23]=s,t[24]=k):k=t[24],k}function Ni(t){return pi(t.providerId,t.modelId)}function ks(t){const e=R.c(3),[s]=Ce();let o;return e[0]!==s.enableSounds||e[1]!==t?(o=()=>{s.enableSounds&&Bo(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 Ii={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"},Ti=Zs.togglePlanMode.keys.map(t=>t==="Shift"?"⇧":t).join(""),_i=[{src:"/connections/gmail.png",name:"Gmail"},{src:"/connections/perplexity.png",name:"Perplexity"},{src:"/connections/github.png",name:"GitHub"}];function Mi(){const t=R.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:_i.map(Di)}),t[0]=e):e=t[0],e}function Di(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 Ri({disabled:t,onOpenConnections:e,virtualMcpId:s,selectedModel:o,isStreaming:r,onUnsupportedFile:i}){const a=K(),[l,V]=P.useState(!1),c=ks(Ii),{org:u}=Me(),{editor:d}=Bt(),p=P.useRef(null),h=ht(o),f=()=>{!h||r||(V(!1),p.current?.click())},m=async M=>{const B=M.target.files;if(!B||B.length===0||!d)return;const J=Array.from(B);try{let se=d.state.selection.from;for(const ee of J)await is(d,o??null,ee,se,i,a),se=d.state.selection.to}finally{p.current&&(p.current.value="")}},g=Uo({connectionId:s,orgId:u.id,orgSlug:u.slug}),x=Ks.virtualMcpPrompts(s,u.id),{data:v,isLoading:b}=qs({queryKey:x,queryFn:()=>zo(g),staleTime:6e4,enabled:l&&!!g}),j=v?.prompts??[],[A,y]=P.useState(null),{chatMode:k,setChatMode:w}=We(),[S,C]=Ce(),N=ct()?.lockedHarness!=="claude-code",I=Se.find(M=>M.value===S.toolApprovalLevel)??Se[0],_=a(I.shortKey),E=M=>{const B=Se.find(J=>J.value===M);if(B){if(B.value===S.toolApprovalLevel){V(!1);return}c(),te("chat_approval_level_changed",{from_level:S.toolApprovalLevel,to_level:B.value,source:"tools_popover"}),C({...S,toolApprovalLevel:B.value}),V(!1)}},F=k==="plan",D=()=>{c();const M=F?"default":"plan";te("chat_mode_changed",{from_mode:k,to_mode:M,source:"tools_popover"}),w(M),V(!1)},T=()=>{e(),V(!1)},O=async(M,B)=>{if(!d||!g)return;const J=wt(M._meta),se={from:d.state.selection.from,to:d.state.selection.to};try{const ee=await Oo(g,M.name,B);mn(d,se,{id:M.name,name:vo(M.name,J),metadata:ee.messages,char:"/",kind:"prompt",args:B})}catch{_e.error(a("chat.toolsPopover.failedLoadPrompt"))}},U=async M=>{V(!1);const B=!!(M.arguments&&M.arguments.length>0);if(te("chat_prompt_inserted",{prompt_name:M.name,with_arguments:B}),B){y(M);return}await O(M)},Q=async M=>{A&&(await O(A,M),y(null))},z=()=>{c();const M=k==="gen-image"?"default":"gen-image";te("chat_mode_changed",{from_mode:k,to_mode:M,source:"tools_popover"}),w(M),V(!1)},Y=()=>{c();const M=k==="web-search"?"default":"web-search";te("chat_mode_changed",{from_mode:k,to_mode:M,source:"tools_popover"}),w(M),V(!1)},L=()=>{c();const M=k==="deep-research"?"default":"deep-research";te("chat_mode_changed",{from_mode:k,to_mode:M,source:"tools_popover"}),w(M),V(!1)},H=k==="gen-image",X=k==="web-search",Z=k==="deep-research",ie=n.jsx("input",{ref:p,type:"file",multiple:!0,accept:ko(o??null),className:"hidden",onChange:m,disabled:r});return n.jsxs(n.Fragment,{children:[ie,n.jsxs(Qs,{open:l,onOpenChange:M=>{M&&!l&&te("chat_tools_popover_opened",{chat_mode:k}),V(M)},children:[n.jsx(Ys,{asChild:!0,children:n.jsxs(W,{type:"button",variant:"ghost",size:"default",disabled:t,title:a("chat.toolsPopover.tools"),"aria-label":a("chat.toolsPopover.tools"),className:$("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),children:[n.jsx(Hn,{size:14}),n.jsx("span",{className:$("min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0","@[320px]/chat-bottom:max-w-24 @[320px]/chat-bottom:opacity-100"),children:a("chat.toolsPopover.tools")})]})}),n.jsxs(Ws,{align:"start",className:"w-56 p-1.5 space-y-1",children:[h?n.jsxs(ye,{onClick:f,disabled:r,children:[n.jsx(St,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.addFile")})]}):n.jsxs(Ze,{children:[n.jsx(He,{asChild:!0,children:n.jsxs(ye,{"aria-disabled":"true",className:"opacity-50 cursor-not-allowed",onSelect:M=>M.preventDefault(),children:[n.jsx(St,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.addFile")})]})}),n.jsx(Je,{side:"right",children:a("chat.toolsPopover.modelNoFileSupport")})]}),n.jsxs(ye,{onClick:D,className:$(F&&"text-special"),children:[n.jsx(Yt,{size:16,className:$(F&&"text-special")}),n.jsx("span",{className:"flex-1 whitespace-nowrap",children:a("chat.toolsPopover.planMode")}),n.jsx("span",{className:$("text-xs text-muted-foreground",F&&"text-special font-medium"),children:Ti})]}),n.jsxs(ye,{onClick:z,className:$(H&&"text-special"),children:[n.jsx(Zt,{size:16,className:$(H&&"text-special")}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.createImage")}),H&&n.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),n.jsxs(ye,{onClick:Y,className:$(X&&"text-special"),children:[n.jsx(Ht,{size:16,className:$(X&&"text-special")}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.webSearch")}),X&&n.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),n.jsxs(ye,{onClick:L,className:$(Z&&"text-special"),children:[n.jsx(Jt,{size:16,className:$(Z&&"text-special")}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.deepResearch")}),Z&&n.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),n.jsxs(vt,{children:[n.jsxs(bt,{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:a("chat.toolsPopover.prompts")})]}),n.jsx(At,{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(Gs,{className:"size-3.5"}),a("chat.toolsPopover.loadingPrompts")]}):j.length===0?n.jsx("div",{className:"px-2 py-3 text-sm text-muted-foreground",children:a("chat.toolsPopover.noPromptsAvailable")}):j.map(M=>n.jsxs(ye,{onClick:()=>U(M),className:"flex flex-col items-start gap-0.5",children:[n.jsx("span",{className:"font-medium text-sm capitalize",children:M.title||xo(M.name,wt(M._meta))}),M.description&&n.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:M.description})]},M.name))})]}),N&&n.jsxs(vt,{children:[n.jsxs(bt,{className:"gap-2",children:[n.jsx(Ge,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.approval")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:_})]}),n.jsx(At,{className:"w-48 p-1.5",children:n.jsx(Hs,{value:S.toolApprovalLevel,onValueChange:E,children:Se.map(M=>n.jsx(Js,{value:M.value,children:a(M.labelKey)},M.value))})})]}),n.jsxs(ye,{onClick:T,children:[n.jsx($o,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.connections")}),n.jsx(P.Suspense,{children:n.jsx(Mi,{})})]})]})]}),n.jsx(hn,{prompt:A,setPrompt:y,onSubmit:Q})]})}const Pi=[{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 Ei(){const t=R.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:Pi.map(Fi)}),t[0]=e):e=t[0],e}function Fi(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 Li(t){const e=R.c(10),{onClick:s}=t,o=K();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=$("group relative z-10 flex items-center gap-3 w-full px-4 py-3","rounded-b-2xl","cursor-pointer"),e[0]=r):r=e[0];let i;e[1]!==o?(i=o("chat.connectionsBanner.description"),e[1]=o,e[2]=i):i=e[2];let a;e[3]!==i?(a=n.jsx("p",{className:"flex-1 text-xs text-muted-foreground truncate text-left",children:i}),e[3]=i,e[4]=a):a=e[4];let l,V;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(Ei,{}),V=n.jsx(Xs,{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 c;return e[7]!==s||e[8]!==a?(c=n.jsxs("button",{type:"button",onClick:s,className:r,children:[a,l,V]}),e[7]=s,e[8]=a,e[9]=c):c=e[9],c}const Ee=48;function Ui(){const t=R.c(12),[e,s]=P.useState("idle"),[o,r]=P.useState(""),[i,a]=P.useState(""),[l,V]=P.useState($i),c=P.useRef(null),u=P.useRef(null),d=P.useRef(null),p=P.useRef(null),h=P.useRef(0),f=P.useRef(!1),m=P.useRef(""),g=P.useRef(""),x=P.useRef(!1),v=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition);let b;t[0]===Symbol.for("react.memo_cache_sentinel")?(b=()=>{h.current&&(cancelAnimationFrame(h.current),h.current=0),u.current?.close().catch(Oi),p.current?.getTracks().forEach(zi),d.current=null,u.current=null,p.current=null},t[0]=b):b=t[0];const j=b;let A;t[1]===Symbol.for("react.memo_cache_sentinel")?(A=E=>{p.current=E;const F=new AudioContext;u.current=F;const D=F.createMediaStreamSource(E),T=F.createAnalyser();T.fftSize=128,T.smoothingTimeConstant=.8,D.connect(T),d.current=T;const O=new Uint8Array(T.frequencyBinCount),U=()=>{if(!d.current)return;d.current.getByteFrequencyData(O);const Q=[];for(let z=0;z<Ee;z++){const Y=Math.floor(z/Ee*O.length);Q.push(Math.max(.04,(O[Y]??0)/255))}V(Q),h.current=requestAnimationFrame(U)};U()},t[1]=A):A=t[1];const y=A;let k;t[2]!==e?(k=async()=>{if(x.current||f.current)return e;x.current=!0;const E=window.SpeechRecognition||window.webkitSpeechRecognition;if(!E)return x.current=!1,s("unsupported"),"unsupported";let F;try{F=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{return x.current=!1,s("permission-denied"),"permission-denied"}x.current=!1,r(""),a(""),g.current="",m.current="",f.current=!0,s("recording"),y(F);const D=new E;c.current=D,D.interimResults=!0,D.continuous=!0,D.lang=navigator.language||"en-US",D.onresult=T=>{if(c.current!==D)return;let O="",U="";for(let Q=T.resultIndex;Q<T.results.length;Q++){const z=T.results[Q],Y=z?.[0]?.transcript??"";z?.isFinal?U=U+Y:O=O+Y}U&&(m.current=m.current+U,r(m.current)),g.current=O,a(O)},D.onerror=T=>{c.current===D&&T.error!=="no-speech"&&(f.current=!1,c.current=null,j(),s(T.error==="not-allowed"?"permission-denied":"idle"))},D.onend=()=>{if(c.current===D&&f.current)try{D.start()}catch{}};try{D.start()}catch{return f.current=!1,c.current=null,j(),s("idle"),"idle"}return"recording"},t[2]=e,t[3]=k):k=t[3];const w=k;let S;t[4]===Symbol.for("react.memo_cache_sentinel")?(S=()=>{f.current=!1,c.current?.stop(),j(),s("idle"),V(Array(Ee).fill(.05)),a("");const E=(m.current+(g.current?" "+g.current:"")).trim();return r(""),m.current="",g.current="",E},t[4]=S):S=t[4];const C=S;let N;t[5]===Symbol.for("react.memo_cache_sentinel")?(N=()=>{f.current=!1,c.current?.abort(),j(),s("idle"),r(""),a(""),V(Array(Ee).fill(.05)),m.current="",g.current=""},t[5]=N):N=t[5];const I=N;let _;return t[6]!==i||t[7]!==w||t[8]!==e||t[9]!==o||t[10]!==l?(_={status:e,transcript:o,interimTranscript:i,waveformData:l,isSupported:v,startRecording:w,stopRecording:C,cancelRecording:I},t[6]=i,t[7]=w,t[8]=e,t[9]=o,t[10]=l,t[11]=_):_=t[11],_}function zi(t){return t.stop()}function Oi(){}function $i(){return Array(Ee).fill(.05)}function Bi(t){const e=R.c(4),{data:s}=t;let o;e[0]!==s?(o=s.map(Ki),e[0]=s,e[1]=o):o=e[1];let r;return e[2]!==o?(r=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]=r):r=e[3],r}function Ki(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 Le=12e3,Et=re({token:ne(),expiresAt:tn()});sn("provider",[re({provider:je("elevenlabs"),conversationToken:ne().min(1)}),re({provider:je("openai"),transport:je("webrtc")})]);const qi=en([Et.extend({provider:je("elevenlabs").default("elevenlabs"),conversationToken:ne().min(1)}),Et.extend({provider:je("openai"),transport:je("webrtc")})]);re({token:ne().min(1).max(4096),text:ne().trim().min(1).max(Le)});const ws=re({request:ne().trim().min(1).max(Le)}),rt=5e3;zt(re({role:ze(["user","agent"]),text:ne().min(1).max(rt)})).max(60).refine(t=>t.reduce((e,s)=>e+s.text.length,0)<=rt,{message:"Voice transcript is too long"});function cl(t){const e=[];let s=rt;for(const o of t.slice(-60).reverse()){if(s<=0)break;const r=o.text.slice(-s);e.unshift({role:o.role,text:r}),s-=r.length}return e}re({token:ne().min(1).max(4096),sdp:ne().min(1).max(1e5),language:ze(["en","pt"]).default("en")}).strict();const Qi=re({sdp:ne().min(1).max(1e5)});async function Yi(t,e,s,o,r){if(t.provider==="openai"){const{startOpenAIConversation:l}=await yt(async()=>{const{startOpenAIConversation:V}=await import("./openai-conversation-DXu_ai6d.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]));return l(r,s,o)}const{Conversation:i}=await yt(async()=>{const{Conversation:l}=await import("./index-yN0BIuMc.js");return{Conversation:l}},[]);o.throwIfAborted();const a=await i.startSession({...s,clientTools:{delegate_to_agent:async l=>{const V=ws.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 a.endSession(),o.throwIfAborted()),{endSession:()=>a.endSession(),setMicMuted:l=>a.setMicMuted(l),getOutputVolume:()=>a.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"?a.sendContextualUpdate(V):a.sendUserMessage(`[Studio background event, not a new user request]
|
|
10
10
|
${V}
|
|
11
11
|
Briefly report this update. Do not delegate it as new work.`)}}}const Wi=re({background:je(!0),status:je("started"),jobId:ne().min(1)}),Gi=re({item:re({id:ne().min(1),title:ne(),status:ne()})}),Hi=t=>`${t}:react-msg`;function Ss(t,e){const s=t.findIndex(r=>r.id===e&&r.role==="user");if(s<0)return null;const o=[];for(const r of t.slice(s+1))if(!r.metadata?.subtaskJobId){if(r.role==="user")break;r.role==="assistant"&&o.push(r)}return o}function Ft(t,e){const s=[],o=[];for(const r of Ss(t,e)??[])for(const i of r.parts){if(!("state"in i)||i.state!=="output-available"||!("output"in i))continue;const a=i.type;if(a==="tool-subtask"){const l=Wi.safeParse(i.output);l.success&&s.push(l.data.jobId)}else if(a==="tool-TASK_BOARD_ITEM_CREATE"){const l=Gi.safeParse(i.output);l.success&&o.push(l.data.item)}}return{backgroundJobs:s,tasks:o}}function Lt(t,e){const s=Ss(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 r=o.parts.findLast(l=>l.type==="text"||l.type==="dynamic-tool"||l.type.startsWith("tool-"));if(r?.type!=="text")return"";if(r.state==="streaming")return null;const i=r.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<=Le)return i;const a=i.slice(0,Le-1);return`${a.slice(0,a.lastIndexOf(" "))}…`}class Ji{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
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 r=e.messages.findIndex(l=>l.id===o.messageId);if(r<0)continue;const i=r>=0&&e.messages.slice(r+1).some(l=>l.role==="user");if(s&&!i)continue;let a;if(!s&&!i&&(e.error||e.status==="error"))a="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))a=`The run ended with status ${e.finishReason}; successful completion is not established.`;else{const l=Lt(e.messages,o.messageId);if(l===null)continue;a=l;const V=Ft(e.messages,o.messageId);if(this.track(V.tasks),V.backgroundJobs.length){o.background=V.backgroundJobs,this.collectBackground(o,s);continue}}this.finish(o,a||"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??[],r=[];for(const i of e.background??[]){const a=Hi(i),l=o.findIndex(u=>u.id===a);if(l<0)return;const V=o.slice(l+1).some(u=>u.role==="user");if(s&&!V)return;const c=Lt(o,a);if(c===null)return;this.track(Ft(o,a).tasks),r.push(c)}this.finish(e,r.filter(Boolean).join(`
|