decocms 4.365.0 → 4.365.1

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.
Files changed (488) hide show
  1. package/dist/client/assets/{AlertCircle-bl0yU7gy.js → AlertCircle-BPZWT1gc.js} +1 -1
  2. package/dist/client/assets/{AreaChart-CHPDNuDf.js → AreaChart-CxCPUfZu.js} +3 -3
  3. package/dist/client/assets/{ArrowLeft-CpbUCYpB.js → ArrowLeft-c3HIgil5.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-CkVUmxaa.js → ArrowRight-BHzAyFwu.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-BQQdFypM.js → ArrowUp-DywwLYcR.js} +1 -1
  6. package/dist/client/assets/{Check-BJaMheL7.js → Check-PyGET9iL.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-BNNyBNMK.js → CheckCircle-4Be5K85Z.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-2Ti1evDh.js → ChevronRight-vY_5m8VB.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-Cp-tcsrs.js → ChevronUp-B9QGJbr0.js} +1 -1
  10. package/dist/client/assets/{Copy01-BrL9ZrVF.js → Copy01-BbtQlTnV.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-_mwanoIZ.js → CreditCard01-2jrzrshR.js} +1 -1
  12. package/dist/client/assets/{Database01-Dm_V08L3.js → Database01-B8rfUUUF.js} +1 -1
  13. package/dist/client/assets/{DotsVertical-B8slOnrw.js → DotsVertical-zFAA_as9.js} +1 -1
  14. package/dist/client/assets/{Download01-Bl2-HJHJ.js → Download01-CSiLQIib.js} +1 -1
  15. package/dist/client/assets/{ErrorBarContext-nVgseQIz.js → ErrorBarContext-D7xML5iT.js} +1 -1
  16. package/dist/client/assets/{Eye-B_BMkWWc.js → Eye-BRXlESxS.js} +1 -1
  17. package/dist/client/assets/{File02-3fotvfyl.js → File02-D4JZqTxD.js} +1 -1
  18. package/dist/client/assets/{GitBranch01-Dr0NRbj6.js → GitBranch01-95kZh6WB.js} +1 -1
  19. package/dist/client/assets/{Globe01-DMnQmvOn.js → Globe01-Dej65_H6.js} +1 -1
  20. package/dist/client/assets/{HardDrive-CxNWrsuq.js → HardDrive-DCLQ4vdy.js} +1 -1
  21. package/dist/client/assets/{Image01-DMAKgzzX.js → Image01-Dd-Rx_B5.js} +1 -1
  22. package/dist/client/assets/{Key01-CVfJV98q.js → Key01-CQFO2R8H.js} +1 -1
  23. package/dist/client/assets/{Link01-CKw3sRrv.js → Link01-pGxgI9VT.js} +1 -1
  24. package/dist/client/assets/{LinkExternal01-OjBTsG9L.js → LinkExternal01-Jetqi62I.js} +1 -1
  25. package/dist/client/assets/MessageCircle01-D2dDPrBD.js +1 -0
  26. package/dist/client/assets/{Monitor01-Bc6Zvq9B.js → Monitor01-Bw-h-DKp.js} +1 -1
  27. package/dist/client/assets/{Package-DTeqx5ul.js → Package-CF-S4NRB.js} +1 -1
  28. package/dist/client/assets/{Palette-CiXH5EXK.js → Palette-DuCZiZH-.js} +1 -1
  29. package/dist/client/assets/{Play-BPdpqeiE.js → Play-BTJRmkRf.js} +1 -1
  30. package/dist/client/assets/{Plus-kQ9d0PiA.js → Plus-BUGmioCX.js} +1 -1
  31. package/dist/client/assets/Printer-B2Ij2s1c.js +1 -0
  32. package/dist/client/assets/{SearchLg-Cecpe6x9.js → SearchLg-De3yWxzK.js} +1 -1
  33. package/dist/client/assets/{SearchMd-hBr_biLL.js → SearchMd-DanltqT5.js} +1 -1
  34. package/dist/client/assets/{Sector-B0yBxg4a.js → Sector-DqvqR1iU.js} +2 -2
  35. package/dist/client/assets/{Settings02-BqKUeA5H.js → Settings02-C-HNbNsn.js} +1 -1
  36. package/dist/client/assets/{Share07-D8xQrAsX.js → Share07-C4Gw_nzw.js} +1 -1
  37. package/dist/client/assets/{Shield01-Dav77ssu.js → Shield01-7bhnSYVs.js} +1 -1
  38. package/dist/client/assets/{Stars01-DWjpdjKn.js → Stars01-BmtGexbk.js} +1 -1
  39. package/dist/client/assets/{Sun-wxsl7cI_.js → Sun-D5AClOdh.js} +1 -1
  40. package/dist/client/assets/{SwitchHorizontal01-CCraiYIJ.js → SwitchHorizontal01-CCmSX-Ww.js} +1 -1
  41. package/dist/client/assets/{Tool01-E6Rv0Nbs.js → Tool01-C1VYYGhf.js} +1 -1
  42. package/dist/client/assets/{Tool02-Darwb8nP.js → Tool02-A5gv-OOO.js} +1 -1
  43. package/dist/client/assets/{Trash01-BB2ymX9J.js → Trash01-DkwdEhkp.js} +1 -1
  44. package/dist/client/assets/{TrendUp01-PJuAXI74.js → TrendUp01-CQWL_vX5.js} +1 -1
  45. package/dist/client/assets/{Upload01-BtBtAyal.js → Upload01-BlEOH700.js} +1 -1
  46. package/dist/client/assets/{User01-CtDIPHIF.js → User01-C2ILPAHc.js} +1 -1
  47. package/dist/client/assets/{UserSquare-BflxhZ_l.js → UserSquare-DY1wI6ZR.js} +1 -1
  48. package/dist/client/assets/{Users01-9HTYv5bx.js → Users01-bydaoxbh.js} +1 -1
  49. package/dist/client/assets/{Users03-D8RoJqiC.js → Users03-3yW32m45.js} +1 -1
  50. package/dist/client/assets/X-DejWyAyX.js +1 -0
  51. package/dist/client/assets/{XCircle-Dvf0BUKb.js → XCircle-SVZraRfE.js} +1 -1
  52. package/dist/client/assets/{XClose-DPfGLo7I.js → XClose-wkdnmhrB.js} +1 -1
  53. package/dist/client/assets/{Zap-ChgjHdxL.js → Zap-0km1-ru7.js} +1 -1
  54. package/dist/client/assets/{ZoomOut-BAhVAzy1.js → ZoomOut-BA2ZiotX.js} +1 -1
  55. package/dist/client/assets/access-gate-DpZqBld0.js +1 -0
  56. package/dist/client/assets/add-connection-dialog-DB5JJjad.js +1 -0
  57. package/dist/client/assets/agent-analytics-CAHUVirD.js +2 -0
  58. package/dist/client/assets/agent-app-BeMC8z8k.js +1 -0
  59. package/dist/client/assets/agent-assets-DsMv2xEg.js +1 -0
  60. package/dist/client/assets/agent-automation-BY5j9rqa.js +20 -0
  61. package/dist/client/assets/agent-automations-1_XWI0cB.js +1 -0
  62. package/dist/client/assets/agent-connect-sources-CGYs_l_4.js +1 -0
  63. package/dist/client/assets/agent-deck-BqKNWwGC.js +1 -0
  64. package/dist/client/assets/agent-e2e-DSg6pAM6.js +1 -0
  65. package/dist/client/assets/agent-file-QzuIvb2U.js +1 -0
  66. package/dist/client/assets/agent-git-B5SGdxwk.js +3 -0
  67. package/dist/client/assets/agent-hosting-CWM0TAgK.js +1 -0
  68. package/dist/client/assets/agent-icon-BjknPEfN.js +1 -0
  69. package/dist/client/assets/agent-library-file-DOj4Pso1.js +1 -0
  70. package/dist/client/assets/agent-monitor-D0SLtbEO.js +1 -0
  71. package/dist/client/assets/agent-overview-4MzJb6Tv.js +1 -0
  72. package/dist/client/assets/agent-settings-D4SL-PIa.js +1 -0
  73. package/dist/client/assets/agent-site-editor-BDP-vSUl.js +24 -0
  74. package/dist/client/assets/agent-site-editor-code-C2z-Az-Y.js +2 -0
  75. package/dist/client/assets/agent-site-editor-content-JPYekiK_.js +2 -0
  76. package/dist/client/assets/agent-site-editor-preview-CFLjaarK.js +504 -0
  77. package/dist/client/assets/agent-view-Bp9ooHxf.js +1 -0
  78. package/dist/client/assets/agent-view-guard-B7qYW-b3.js +1 -0
  79. package/dist/client/assets/agents-list-h96XaSKk.js +1 -0
  80. package/dist/client/assets/ai-providers-COWdzwzu.js +1 -0
  81. package/dist/client/assets/{alert-DkgzGFz6.js → alert-CvK2RkF3.js} +1 -1
  82. package/dist/client/assets/{alert-dialog-BdwUra4d.js → alert-dialog-CDARhUOh.js} +2 -2
  83. package/dist/client/assets/{api-keys-Bl99t7Nm.js → api-keys-Ba-S9F5Y.js} +1 -1
  84. package/dist/client/assets/api-keys-DeCwNgs3.js +1 -0
  85. package/dist/client/assets/app-editor-CsOLGnt4.js +1 -0
  86. package/dist/client/assets/asset-utils-DQpbxjwd.js +1 -0
  87. package/dist/client/assets/{auth-vfqjjrgv.js → auth-Cyjh0UQp.js} +1 -1
  88. package/dist/client/assets/{auth-catchall-CZ_cFv3z.js → auth-catchall-BbOJ2FpE.js} +1 -1
  89. package/dist/client/assets/{auth-entry-Cp4v6AT2.js → auth-entry-CIc1-YG9.js} +1 -1
  90. package/dist/client/assets/{auth-split-layout-BB-yAg-2.js → auth-split-layout-WGnYlU-M.js} +1 -1
  91. package/dist/client/assets/{authenticate-and-persist-oauth-CpB-R1LO.js → authenticate-and-persist-oauth-Dgc5b4Jr.js} +1 -1
  92. package/dist/client/assets/{automation-list-row-DKusfCau.js → automation-list-row-Dyqat6cE.js} +1 -1
  93. package/dist/client/assets/automation-runs-DkHp_jZr.js +1 -0
  94. package/dist/client/assets/automations-BSGRkynt.js +1 -0
  95. package/dist/client/assets/{autosend-u-W4xgi7.js → autosend-BBoss6Ia.js} +1 -1
  96. package/dist/client/assets/{avatar-BpU54ct-.js → avatar-CO3n6wLC.js} +1 -1
  97. package/dist/client/assets/backoff-8mStPHYB.js +1 -0
  98. package/dist/client/assets/{badge-DJ5ezE5-.js → badge-DUpgRwQu.js} +1 -1
  99. package/dist/client/assets/{block-document-7Ngv587f.js → block-document-CVyeCLBq.js} +3 -3
  100. package/dist/client/assets/blocks-preview-workspace-context-CLQbGv9t.js +1 -0
  101. package/dist/client/assets/{breadcrumb-Dlcs3jWo.js → breadcrumb-FJ1G6kmP.js} +1 -1
  102. package/dist/client/assets/buckets-BTZUX3pR.js +1 -0
  103. package/dist/client/assets/build-improve-prompt-doc-CcAYvBOj.js +2 -0
  104. package/dist/client/assets/bulk-category-panel-9cEfFq4L.js +1 -0
  105. package/dist/client/assets/{calendar-B8BrEMls.js → calendar-Bb8OUNd8.js} +1 -1
  106. package/dist/client/assets/{capability-load-error-CdMFNpdR.js → capability-load-error-Ctg9pY-k.js} +1 -1
  107. package/dist/client/assets/{cards-BfP1wflC.js → cards-CbRL3hJc.js} +1 -1
  108. package/dist/client/assets/category-editor-DLB1OCyq.js +1 -0
  109. package/dist/client/assets/{chart-zbtN9_7R.js → chart-DqNrc8dZ.js} +1 -1
  110. package/dist/client/assets/{chat-context-CD1rWX64.js → chat-context-B40ngn3f.js} +9 -9
  111. package/dist/client/assets/{checkbox-DwVdLA7e.js → checkbox-STVvKX8k.js} +1 -1
  112. package/dist/client/assets/choose-editor-DVdbAy2O.js +1 -0
  113. package/dist/client/assets/claim-phase-copy-0btUuJoC.js +1 -0
  114. package/dist/client/assets/{cli-auth-success-BtBj1xJE.js → cli-auth-success-DmTxFaq5.js} +1 -1
  115. package/dist/client/assets/{client-icons-BcSFyY79.js → client-icons-CR99ZCoE.js} +1 -1
  116. package/dist/client/assets/collapsible-Cf4ZreOo.js +1 -0
  117. package/dist/client/assets/collection-detail-oWaNi-hD.js +1 -0
  118. package/dist/client/assets/collection-display-button-CkKXuKd-.js +1 -0
  119. package/dist/client/assets/{collection-search-Bi-DttH4.js → collection-search-CDaDEv2c.js} +1 -1
  120. package/dist/client/assets/{collection-table-wrapper-DfAhVjGn.js → collection-table-wrapper-B036tBOl.js} +1 -1
  121. package/dist/client/assets/{collection-tabs-BZkkvpP_.js → collection-tabs-CkeFxbT3.js} +1 -1
  122. package/dist/client/assets/{command-cJVGaRa3.js → command-D7YFT70c.js} +1 -1
  123. package/dist/client/assets/{command-palette-store-BNo0UXiS.js → command-palette-store-BcwFt5eE.js} +1 -1
  124. package/dist/client/assets/commerce-onboarding-BcoYZTQG.js +1 -0
  125. package/dist/client/assets/{companion-mcps-section-smAU7jYC.js → companion-mcps-section-CS9qQ8v0.js} +1 -1
  126. package/dist/client/assets/{connect-Bn7h46Ea.js → connect-BM6ZfhOz.js} +2 -2
  127. package/dist/client/assets/connect-layout-De5w9TxQ.js +1 -0
  128. package/dist/client/assets/{connection-card-DCMUv-0w.js → connection-card-kANJRcvf.js} +1 -1
  129. package/dist/client/assets/connection-detail-Ckkh02Py.js +1 -0
  130. package/dist/client/assets/{connection-D6f54N4w.js → connection-di4Fldx3.js} +1 -1
  131. package/dist/client/assets/{connection-form-helpers-BiJdmlDA.js → connection-form-helpers-fWne-kOd.js} +1 -1
  132. package/dist/client/assets/connections-BKm7IMTt.js +1 -0
  133. package/dist/client/assets/{create-organization-dialog-IR2z5bIs.js → create-organization-dialog-BmgLNeEx.js} +1 -1
  134. package/dist/client/assets/decofile-api-BhjpITFN.js +1 -0
  135. package/dist/client/assets/{decopilot-CK3rN_ad.js → decopilot-ClO0uusm.js} +2 -2
  136. package/dist/client/assets/dialog-Dxe0Jgna.js +1 -0
  137. package/dist/client/assets/discover-BdugM7FR.js +1 -0
  138. package/dist/client/assets/domain-settings-Dp-mWih8.js +1 -0
  139. package/dist/client/assets/{download-app-dialog-CNd8ka-x.js → download-app-dialog-lwMMuYsF.js} +1 -1
  140. package/dist/client/assets/{drawer-DsG6Si3V.js → drawer-1GzYkddr.js} +1 -1
  141. package/dist/client/assets/{dropdown-menu-4cRHTbic.js → dropdown-menu-Bws_0K_q.js} +1 -1
  142. package/dist/client/assets/{editor-NTP5Xcj9.js → editor-U5ucetu-.js} +1 -1
  143. package/dist/client/assets/{empty-state-DmTochCH.js → empty-state-BjMIbq91.js} +1 -1
  144. package/dist/client/assets/{empty-state-D86Jkx4H.js → empty-state-C3Z_6q55.js} +1 -1
  145. package/dist/client/assets/{extract-connection-data-B3hIAjiC.js → extract-connection-data-BAjOM4U5.js} +1 -1
  146. package/dist/client/assets/file-explorer-LFC3Ac60.js +2 -0
  147. package/dist/client/assets/{file-preview-BbFH5cdB.js → file-preview-n35lcg8c.js} +1 -1
  148. package/dist/client/assets/{file-share-button-ChoXQdlr.js → file-share-button-D04rfik7.js} +2 -2
  149. package/dist/client/assets/{file-type-icon-DJQFeBpV.js → file-type-icon-C4dI9q_n.js} +1 -1
  150. package/dist/client/assets/{folder-icon-BRLOuEpt.js → folder-icon-pWHmymOf.js} +1 -1
  151. package/dist/client/assets/{form-DhUF_Mtg.js → form-CRSWplOb.js} +1 -1
  152. package/dist/client/assets/{gateway-client-Cb37izH_.js → gateway-client-D45uHvIc.js} +1 -1
  153. package/dist/client/assets/general-C7RGB0Oj.js +1 -0
  154. package/dist/client/assets/{github-icon-cJDFDEm7.js → github-icon-CsH29e4W.js} +1 -1
  155. package/dist/client/assets/{github-repo-C0igpkr9.js → github-repo-BknN0SVI.js} +1 -1
  156. package/dist/client/assets/home-CpLcM3nB.js +1 -0
  157. package/dist/client/assets/hooks-CE7d6Dy1.js +15 -0
  158. package/dist/client/assets/{hooks-BrcP19Uo.js → hooks-CxBYuMc8.js} +2 -2
  159. package/dist/client/assets/{index-epfDD3H5.js → index-4fsCOuPz.js} +2 -2
  160. package/dist/client/assets/index-B53DWiGz.js +1 -0
  161. package/dist/client/assets/{index-BQzHGsvt.js → index-BJDZS0O4.js} +11 -11
  162. package/dist/client/assets/index-BQwroePl.js +1 -0
  163. package/dist/client/assets/{index-Df6f9kP3.js → index-BRigOSQu.js} +1 -1
  164. package/dist/client/assets/{index-CoYeuRng.js → index-CBcq1VSB.js} +1 -1
  165. package/dist/client/assets/index-CFUteTrc.js +1 -0
  166. package/dist/client/assets/{index-gctAQu2T.js → index-CVJEcf37.js} +74 -74
  167. package/dist/client/assets/{index-DQ6uuKpF.js → index-CblYf_yB.js} +8 -8
  168. package/dist/client/assets/{index-BywxOh2e.js → index-CcEd_wWL.js} +1 -1
  169. package/dist/client/assets/index-Clbrhj--.js +1 -0
  170. package/dist/client/assets/{index-CImKKZ20.js → index-CxOPSFx9.js} +1 -1
  171. package/dist/client/assets/index-CyYEAXEU.js +1 -0
  172. package/dist/client/assets/{index-eVyHwFa9.js → index-DAN6A7hZ.js} +1 -1
  173. package/dist/client/assets/{index-DJADaZ4J.css → index-DUflXgSu.css} +1 -1
  174. package/dist/client/assets/index-Dio39w6e.js +26 -0
  175. package/dist/client/assets/index-DsI9yqDT.js +1 -0
  176. package/dist/client/assets/{index-redirect-DxBD4sTo.js → index-redirect-Bw20Ba6Y.js} +1 -1
  177. package/dist/client/assets/{infiniteQueryObserver-Da0v0sXC.js → infiniteQueryObserver-BSmIgXE3.js} +1 -1
  178. package/dist/client/assets/infra-billing-DFEuQtvU.js +1 -0
  179. package/dist/client/assets/{input-eBmoU-9D.js → input-C8MQoDCb.js} +1 -1
  180. package/dist/client/assets/{input-DlvEXkej.js → input-CQyA0V5b.js} +1 -1
  181. package/dist/client/assets/{input-C9QH7mMV.js → input-DD_DI_Km.js} +2 -2
  182. package/dist/client/assets/{integration-icon-YYg8l_RW.js → integration-icon-BV7Q9XOu.js} +1 -1
  183. package/dist/client/assets/{label-DGkzLfNU.js → label-Cfl8uGDP.js} +1 -1
  184. package/dist/client/assets/last-preview-page-B_KVLuYW.js +1 -0
  185. package/dist/client/assets/layout-Dm4T-Vne.js +1 -0
  186. package/dist/client/assets/legacy-agents-deep-Dd57JUEI.js +1 -0
  187. package/dist/client/assets/legacy-main-redirect-CWvMqmhB.js +1 -0
  188. package/dist/client/assets/{library-CKrgioQu.js → library-3DHQWojm.js} +4 -4
  189. package/dist/client/assets/login-CupMnybl.js +1 -0
  190. package/dist/client/assets/{markdown-BV0XgGTq.js → markdown-BvSl7QX1.js} +3 -3
  191. package/dist/client/assets/{mcp-app-renderer-Bv46PiO3.js → mcp-app-renderer-DJ7Ve9Yy.js} +2 -2
  192. package/dist/client/assets/{mcp-oauth-i7PCjbNf.js → mcp-oauth-OvlzbMCP.js} +1 -1
  193. package/dist/client/assets/members-Cuiahh5G.js +1 -0
  194. package/dist/client/assets/message-templates-wocfrCJF.js +1 -0
  195. package/dist/client/assets/{mini-report-page-k88VT2C2.js → mini-report-page-4Bd0cMlr.js} +1 -1
  196. package/dist/client/assets/{monaco-editor-kRD7y0Pc.js → monaco-editor-B2KCfh7a.js} +1 -1
  197. package/dist/client/assets/{monitoring-stats-row-CuCuR7PQ.js → monitoring-stats-row-CufhVlNy.js} +1 -1
  198. package/dist/client/assets/{multi-select-CltjjMwX.js → multi-select-BHFunwbq.js} +1 -1
  199. package/dist/client/assets/{mustache-Db7x-4gI.js → mustache-DyjElMuJ.js} +1 -1
  200. package/dist/client/assets/{oauth-callback-CT29B8-5.js → oauth-callback-4BOm__rV.js} +1 -1
  201. package/dist/client/assets/{oauth-callback-ai-provider-3CPoYshC.js → oauth-callback-ai-provider-Czk5gVgf.js} +1 -1
  202. package/dist/client/assets/{onboarding-DEm51GnF.js → onboarding-D2PsWH4h.js} +1 -1
  203. package/dist/client/assets/{optimistic-project-sidebar-views-Drtbh9Ui.js → optimistic-project-sidebar-views-B3vU1qR8.js} +1 -1
  204. package/dist/client/assets/{organization-choice-BdqJqB_v.js → organization-choice-C-PRPVPc.js} +1 -1
  205. package/dist/client/assets/orgs-DpmY6dw4.js +1 -0
  206. package/dist/client/assets/{page-seo-form-BXvLQ5tk.js → page-seo-form-gUB5sB3u.js} +1 -1
  207. package/dist/client/assets/{pair-BIPkH5eA.js → pair-98UY-0wm.js} +8 -8
  208. package/dist/client/assets/{popover-BfKN_4aI.js → popover-DAJR0ej2.js} +1 -1
  209. package/dist/client/assets/post-calendar-4XiTJrif.js +1 -0
  210. package/dist/client/assets/post-editor-CXRn_RK8.js +1 -0
  211. package/dist/client/assets/preview-content-Tw_jYCgT.js +1 -0
  212. package/dist/client/assets/{preview-dialog-CYbL8r4H.js → preview-dialog-Bg_Wo7YI.js} +1 -1
  213. package/dist/client/assets/{primitives-BXcg67BS.js → primitives-BfIYsPoI.js} +1 -1
  214. package/dist/client/assets/profile-CDs1X-Le.js +1 -0
  215. package/dist/client/assets/project-app-view-BPLB01Cj.js +1 -0
  216. package/dist/client/assets/project-feed-CeGbFvMT.js +1 -0
  217. package/dist/client/assets/{project-icon-Dk1HaDIZ.js → project-icon-D1x6NEST.js} +1 -1
  218. package/dist/client/assets/project-reports-fH8-r6df.js +1 -0
  219. package/dist/client/assets/project-tasks-tas6EPem.js +1 -0
  220. package/dist/client/assets/prompts-B-VqD1p-.js +1 -0
  221. package/dist/client/assets/record-editor-LOQZDk0V.js +1 -0
  222. package/dist/client/assets/redirect-editor-CgXt_KHn.js +1 -0
  223. package/dist/client/assets/registry-YMo7WLlx.js +2 -0
  224. package/dist/client/assets/{registry-layout-CRM-FBei.js → registry-layout-SseogjtO.js} +3 -3
  225. package/dist/client/assets/reports-DC8tSFj3.js +1 -0
  226. package/dist/client/assets/{reports-B1FmmHPo.js → reports-Q6oueood.js} +2 -2
  227. package/dist/client/assets/reports-tab-DE-TYPly.js +2 -0
  228. package/dist/client/assets/repositories-BoiOgwFm.js +1 -0
  229. package/dist/client/assets/repository-import-picker-DyEfEliR.js +1 -0
  230. package/dist/client/assets/repository-picker-DWJtJkZW.js +1 -0
  231. package/dist/client/assets/require-capability-DljrHpsM.js +1 -0
  232. package/dist/client/assets/{required-auth-layout-CraNNSBi.js → required-auth-layout-TTElzhIM.js} +1 -1
  233. package/dist/client/assets/{reset-password-DcO8_P05.js → reset-password-B1ylDKoe.js} +1 -1
  234. package/dist/client/assets/resizable-DOW_fL7z.js +1 -0
  235. package/dist/client/assets/retry-i8LvYSZg.js +1 -0
  236. package/dist/client/assets/{review-settings-CANg_Nan.js → review-settings-DHvMG4G0.js} +1 -1
  237. package/dist/client/assets/{rich-text-link-control-CCig2s9-.js → rich-text-link-control-HLhFAha7.js} +1 -1
  238. package/dist/client/assets/roles-BWbTlJZc.js +1 -0
  239. package/dist/client/assets/route-D26IsMv1.js +1 -0
  240. package/dist/client/assets/route-D_kbg4iH.js +1 -0
  241. package/dist/client/assets/route-jdsFbZW7.js +1 -0
  242. package/dist/client/assets/runnable-block-editor-Bi0Cv7yD.js +16 -0
  243. package/dist/client/assets/sandbox-git-api-CMdpE2TE.js +1 -0
  244. package/dist/client/assets/{sandbox-lifecycle-context-Beua1bNX.js → sandbox-lifecycle-context-BbTDNpeS.js} +2 -2
  245. package/dist/client/assets/save-changes-debug-nBi-n9eV.js +1 -0
  246. package/dist/client/assets/{schema-BzgrQmAY.js → schema-BegvnGCM.js} +1 -1
  247. package/dist/client/assets/{scroll-area-tBZq-ZvJ.js → scroll-area-CxxMejtk.js} +1 -1
  248. package/dist/client/assets/{search-input-CYERWjWv.js → search-input-axkgbTZ7.js} +1 -1
  249. package/dist/client/assets/secrets-kzqIbFmd.js +1 -0
  250. package/dist/client/assets/section-preview-url-Csj0_ZDg.js +1 -0
  251. package/dist/client/assets/sections-editor-B_t9OrnC.js +2 -0
  252. package/dist/client/assets/select-B2GRzoG3.js +1 -0
  253. package/dist/client/assets/select-model-BRHN792B.js +1 -0
  254. package/dist/client/assets/seo-editor-DvngP1ti.js +1 -0
  255. package/dist/client/assets/settings-tab-DFjZ-Fkn.js +5 -0
  256. package/dist/client/assets/sheet-BePDARR0.js +1 -0
  257. package/dist/client/assets/shell-layout-D2wS-FNX.js +1 -0
  258. package/dist/client/assets/sidebar-IspuJbto.js +1 -0
  259. package/dist/client/assets/skill-preview-BdtuUFgV.js +1 -0
  260. package/dist/client/assets/skills-QJ3mhNvI.js +1 -0
  261. package/dist/client/assets/sso-DKhL-ARh.js +1 -0
  262. package/dist/client/assets/{store-CjL9y_7d.js → store-B9Az6md3.js} +1 -1
  263. package/dist/client/assets/store-registry-hcgHbNGW.js +2 -0
  264. package/dist/client/assets/switch-DJ4Dr2_V.js +1 -0
  265. package/dist/client/assets/synced-repos-flbNGs20.js +1 -0
  266. package/dist/client/assets/{table-aIDGrvqv.js → table-CrJ9LOSc.js} +1 -1
  267. package/dist/client/assets/{tabs-Sr-wlkg3.js → tabs-DVMaAAMA.js} +1 -1
  268. package/dist/client/assets/{task-board-CazuPR-U.js → task-board-SlBuwhrX.js} +1 -1
  269. package/dist/client/assets/task-route-B4hPzw6u.js +1 -0
  270. package/dist/client/assets/{task-status-Cj8IGjJC.js → task-status-DhZZzZ6G.js} +1 -1
  271. package/dist/client/assets/{tasks-DzatESzy.js → tasks-B_rqCvr1.js} +4 -4
  272. package/dist/client/assets/tasks-CViGtGHm.js +1 -0
  273. package/dist/client/assets/{textarea-6VvdKhvF.js → textarea-BDMLJ5G-.js} +1 -1
  274. package/dist/client/assets/{thread-intent-DPwCeeGE.js → thread-intent-C7DpKTRQ.js} +1 -1
  275. package/dist/client/assets/thread-route-Bc63tvFc.js +1 -0
  276. package/dist/client/assets/{thread-route-BsrvgyVU.js → thread-route-BzWllNYG.js} +1 -1
  277. package/dist/client/assets/thread-sheet-body-CiausLhX.js +1 -0
  278. package/dist/client/assets/toggle-group-BW8cP6lf.js +1 -0
  279. package/dist/client/assets/{toolbar-icon-button-CSTgB2Je.js → toolbar-icon-button-A2ebiBUr.js} +1 -1
  280. package/dist/client/assets/tooltip-B7VLfO9w.js +1 -0
  281. package/dist/client/assets/{track-CDfY4FZL.js → track-BGU8HJCB.js} +1 -1
  282. package/dist/client/assets/{types-8hWP_tsZ.js → types-CrAbOCy3.js} +6 -6
  283. package/dist/client/assets/usage-stats-Bf1Ukas_.js +1 -0
  284. package/dist/client/assets/use-ai-providers-R1Jac-4Q.js +1 -0
  285. package/dist/client/assets/use-automations-BzLd_Cf7.js +1 -0
  286. package/dist/client/assets/{use-autosave-DRlRuq5e.js → use-autosave-BezKrA6F.js} +1 -1
  287. package/dist/client/assets/use-commerce-diagnostic-DTGIqIpu.js +1 -0
  288. package/dist/client/assets/use-connect-companion-CgerJAPe.js +1 -0
  289. package/dist/client/assets/{use-connection-tOIuuLKJ.js → use-connection-B4t4VJEN.js} +1 -1
  290. package/dist/client/assets/{use-copy-B4PUMZjo.js → use-copy-DQwrjGi4.js} +1 -1
  291. package/dist/client/assets/{use-create-virtual-mcp-x2IPUAAO.js → use-create-virtual-mcp-CHEKOqdh.js} +1 -1
  292. package/dist/client/assets/{use-date-fns-locale-use6rm0l.js → use-date-fns-locale-m0Q-8AAg.js} +1 -1
  293. package/dist/client/assets/{use-debounced-autosave-CWLgAozd.js → use-debounced-autosave-C82NqRut.js} +1 -1
  294. package/dist/client/assets/{use-debounced-value-BHZw1Wtv.js → use-debounced-value-SjJ8k_tD.js} +1 -1
  295. package/dist/client/assets/use-deco-credits-CIfhJ3OU.js +1 -0
  296. package/dist/client/assets/use-decopilot-events-DDnHJjGY.js +1 -0
  297. package/dist/client/assets/use-delete-connection-BWW3Qwe4.js +1 -0
  298. package/dist/client/assets/{use-deployment-admin-PTBGIrMl.js → use-deployment-admin-D4Et99Id.js} +1 -1
  299. package/dist/client/assets/use-fast-preview-draft-url-B8C-G0p2.js +1 -0
  300. package/dist/client/assets/use-file-configs-CKcyFOK-.js +1 -0
  301. package/dist/client/assets/{use-infinite-scroll-DnRzNQQc.js → use-infinite-scroll-C88xvDJq.js} +1 -1
  302. package/dist/client/assets/use-join-requests-CtMSd2H7.js +1 -0
  303. package/dist/client/assets/use-main-panel-tabs-BLf-yD79.js +1 -0
  304. package/dist/client/assets/use-mcp-auth-status-CF5e5Swp.js +1 -0
  305. package/dist/client/assets/{use-mcp-client-CzGi1Gun.js → use-mcp-client-DmOwsV3f.js} +6 -6
  306. package/dist/client/assets/{use-mcp-prompts-BJsq63pG.js → use-mcp-prompts-BKFfTbQi.js} +1 -1
  307. package/dist/client/assets/{use-mcp-tools-I4ahUYGD.js → use-mcp-tools-eOThR6gd.js} +1 -1
  308. package/dist/client/assets/{use-members-xjztJVBn.js → use-members-mw1URW2v.js} +1 -1
  309. package/dist/client/assets/use-mobile-WPuOYoIV.js +1 -0
  310. package/dist/client/assets/{use-navigate-to-agent-CBQsYRLL.js → use-navigate-to-agent-zGc1-u-z.js} +1 -1
  311. package/dist/client/assets/use-open-billing-url-BYWSUicc.js +1 -0
  312. package/dist/client/assets/use-org-auth-client-mMTl8cKp.js +1 -0
  313. package/dist/client/assets/{use-org-fs-Cm8FYvYP.js → use-org-fs-Ck9VysIz.js} +1 -1
  314. package/dist/client/assets/use-org-notice-Cb7z4nA0.js +1 -0
  315. package/dist/client/assets/{use-org-sso-CP_t4LLU.js → use-org-sso-CvkPQsKr.js} +1 -1
  316. package/dist/client/assets/{use-organization-roles-Cnixvt9H.js → use-organization-roles-wnmrYWSM.js} +1 -1
  317. package/dist/client/assets/use-organization-settings-CRw6qdb3.js +1 -0
  318. package/dist/client/assets/use-panel-navigate-ez3OqVq8.js +1 -0
  319. package/dist/client/assets/{use-project-native-view-presence-CJ7vLSBz.js → use-project-native-view-presence-DFjsPIlC.js} +1 -1
  320. package/dist/client/assets/use-project-scope-D9t-w7F3.js +1 -0
  321. package/dist/client/assets/use-registry-connections-BC1Pt8V1.js +1 -0
  322. package/dist/client/assets/use-releases-B_ioEYcb.js +1 -0
  323. package/dist/client/assets/use-route-default-main-B8Ci266p.js +1 -0
  324. package/dist/client/assets/use-secrets-BZEH47Ed.js +1 -0
  325. package/dist/client/assets/use-section-preview-base-D8ddLJeY.js +1 -0
  326. package/dist/client/assets/{use-session-runtime-Cs4eGT9k.js → use-session-runtime-CKDTMwlz.js} +1 -1
  327. package/dist/client/assets/use-tags-BnnveSvi.js +1 -0
  328. package/dist/client/assets/use-task-metadata-DQ-jzCVZ.js +1 -0
  329. package/dist/client/assets/{use-thread-outputs-DtpQGqCf.js → use-thread-outputs-ChimPCUk.js} +1 -1
  330. package/dist/client/assets/use-view-mode-CpyVGfy9.js +1 -0
  331. package/dist/client/assets/use-virtual-mcp-DvSX4N6q.js +1 -0
  332. package/dist/client/assets/useInfiniteQuery-CuoCKqDV.js +1 -0
  333. package/dist/client/assets/{useQueries-CnHkVL7d.js → useQueries-CCVXh4wK.js} +1 -1
  334. package/dist/client/assets/useSuspenseInfiniteQuery-BGyZ2Zcs.js +1 -0
  335. package/dist/client/assets/{users-CWHZPvdU.js → users-DgkJfwRz.js} +1 -1
  336. package/dist/client/assets/{utils-CdxSjBly.js → utils-D06E4WDv.js} +2 -2
  337. package/dist/client/assets/variant-calendar-B2YQFxru.js +1 -0
  338. package/dist/client/assets/{variant-matcher-override-BLTbL0Nb.js → variant-matcher-override-POFwaaTG.js} +1 -1
  339. package/dist/client/assets/view-mode-toggle-B09x-ETl.js +1 -0
  340. package/dist/client/assets/{virtual-mcp-CIE6gIFV.js → virtual-mcp-D-br_N6s.js} +1 -1
  341. package/dist/client/index.html +2 -2
  342. package/dist/server/cli.js +1 -1
  343. package/dist/server/server.js +1 -1
  344. package/package.json +1 -1
  345. package/dist/client/assets/Printer-Nban-oJk.js +0 -1
  346. package/dist/client/assets/access-gate-aVhmxNUP.js +0 -1
  347. package/dist/client/assets/add-connection-dialog-C2-znERG.js +0 -1
  348. package/dist/client/assets/agent-analytics-CLObAM6S.js +0 -2
  349. package/dist/client/assets/agent-app-DtLxy7iB.js +0 -1
  350. package/dist/client/assets/agent-assets-5J9H4wgC.js +0 -1
  351. package/dist/client/assets/agent-automation-DTYBStDc.js +0 -20
  352. package/dist/client/assets/agent-automations-DYZPALXC.js +0 -1
  353. package/dist/client/assets/agent-connect-sources-DJFWziK9.js +0 -1
  354. package/dist/client/assets/agent-deck-De0Y6qk5.js +0 -1
  355. package/dist/client/assets/agent-e2e-MVQ6vmAy.js +0 -1
  356. package/dist/client/assets/agent-file-IBnKf7Fw.js +0 -1
  357. package/dist/client/assets/agent-git-DjVoKiR8.js +0 -3
  358. package/dist/client/assets/agent-hosting-DbC8wvCr.js +0 -1
  359. package/dist/client/assets/agent-icon-DsGBCBNv.js +0 -1
  360. package/dist/client/assets/agent-library-file-CySHm683.js +0 -1
  361. package/dist/client/assets/agent-monitor-Duc2QTVQ.js +0 -1
  362. package/dist/client/assets/agent-overview-DAVTPrgq.js +0 -1
  363. package/dist/client/assets/agent-settings-DBEnACPy.js +0 -1
  364. package/dist/client/assets/agent-site-editor-CJ_722sF.js +0 -1
  365. package/dist/client/assets/agent-site-editor-code-CBPV2yNN.js +0 -2
  366. package/dist/client/assets/agent-site-editor-content-C-fwwsI7.js +0 -2
  367. package/dist/client/assets/agent-site-editor-preview-Be-uG2hV.js +0 -504
  368. package/dist/client/assets/agent-view-B3DdbJTr.js +0 -1
  369. package/dist/client/assets/agent-view-guard-DTG6Ut5n.js +0 -1
  370. package/dist/client/assets/agents-list-DNaOFYAO.js +0 -1
  371. package/dist/client/assets/ai-providers-BPcl_qgT.js +0 -1
  372. package/dist/client/assets/api-keys-CYMMtT0P.js +0 -1
  373. package/dist/client/assets/app-editor-_27_2g82.js +0 -1
  374. package/dist/client/assets/asset-utils-DTfzHa9m.js +0 -1
  375. package/dist/client/assets/automation-runs-Dt50JHCo.js +0 -1
  376. package/dist/client/assets/automations-DDydXmIK.js +0 -1
  377. package/dist/client/assets/backoff-CrEUbyZT.js +0 -1
  378. package/dist/client/assets/buckets-Wx6DtJNT.js +0 -1
  379. package/dist/client/assets/build-improve-prompt-doc-4aKzyTWA.js +0 -2
  380. package/dist/client/assets/bulk-category-panel-CclTC40F.js +0 -1
  381. package/dist/client/assets/category-editor-CuGxUDVJ.js +0 -1
  382. package/dist/client/assets/choose-editor-CE7aKrQp.js +0 -1
  383. package/dist/client/assets/collapsible-BDifv-q9.js +0 -1
  384. package/dist/client/assets/collection-detail-ec9sW8Ey.js +0 -1
  385. package/dist/client/assets/collection-display-button-C3CfuUhX.js +0 -1
  386. package/dist/client/assets/commerce-onboarding-Dxc7EEsL.js +0 -1
  387. package/dist/client/assets/connect-layout-Bby2uYqZ.js +0 -1
  388. package/dist/client/assets/connection-detail-C-Fe9wui.js +0 -1
  389. package/dist/client/assets/connections-CxSK9S4W.js +0 -1
  390. package/dist/client/assets/decode-html-entities-B4Qel6ov.js +0 -1
  391. package/dist/client/assets/decopilot-sse-pool-czpSFI9L.js +0 -1
  392. package/dist/client/assets/delay-CnY5UFtP.js +0 -1
  393. package/dist/client/assets/dialog--Jkwvpx1.js +0 -1
  394. package/dist/client/assets/discover-C7-JIKhR.js +0 -1
  395. package/dist/client/assets/domain-settings-Dh029s1M.js +0 -1
  396. package/dist/client/assets/file-explorer-B4d-xz4q.js +0 -2
  397. package/dist/client/assets/general-BY1zbaWS.js +0 -1
  398. package/dist/client/assets/home-CeJo7q7K.js +0 -1
  399. package/dist/client/assets/hooks-CxPd9b6i.js +0 -15
  400. package/dist/client/assets/index-1yGxjvng.js +0 -24
  401. package/dist/client/assets/index-C7tZKQ5s.js +0 -1
  402. package/dist/client/assets/index-CklK0EA_.js +0 -1
  403. package/dist/client/assets/index-D5CXQ9x9.js +0 -1
  404. package/dist/client/assets/index-Og5m3t85.js +0 -26
  405. package/dist/client/assets/index-Y6pd1REu.js +0 -1
  406. package/dist/client/assets/infra-billing-ChvPe0pr.js +0 -1
  407. package/dist/client/assets/invite-member-dialog-CeSVAfZq.js +0 -1
  408. package/dist/client/assets/layout-BIIr_imR.js +0 -1
  409. package/dist/client/assets/legacy-agents-deep-CdZo4h4A.js +0 -1
  410. package/dist/client/assets/legacy-main-redirect-CWWHewM6.js +0 -1
  411. package/dist/client/assets/login-svGY2sKo.js +0 -1
  412. package/dist/client/assets/members-BOTXfNHf.js +0 -1
  413. package/dist/client/assets/org-layout-BiRvLqL-.js +0 -1
  414. package/dist/client/assets/orgs-CMf-H7HH.js +0 -1
  415. package/dist/client/assets/post-calendar-BAQtpQvh.js +0 -1
  416. package/dist/client/assets/post-editor-DBJMHXYe.js +0 -1
  417. package/dist/client/assets/preview-content-CICx8Frq.js +0 -1
  418. package/dist/client/assets/profile-CUkJFM3_.js +0 -1
  419. package/dist/client/assets/project-app-view-BSYHmGj3.js +0 -1
  420. package/dist/client/assets/project-feed-BEGVLizK.js +0 -1
  421. package/dist/client/assets/project-reports-BozhFElP.js +0 -1
  422. package/dist/client/assets/project-tasks-DVexwc9x.js +0 -1
  423. package/dist/client/assets/prompts-Df-P8Zuz.js +0 -1
  424. package/dist/client/assets/record-editor-9YdHcAWO.js +0 -1
  425. package/dist/client/assets/redirect-editor-BohyWJXT.js +0 -1
  426. package/dist/client/assets/registry-BbkHDIpk.js +0 -2
  427. package/dist/client/assets/reports-SeFGRJSZ.js +0 -1
  428. package/dist/client/assets/reports-tab-D5rlmWEp.js +0 -2
  429. package/dist/client/assets/repositories-BXEjUV3F.js +0 -1
  430. package/dist/client/assets/repository-import-picker-Bc_O4k0-.js +0 -1
  431. package/dist/client/assets/repository-picker-DC97O6OK.js +0 -1
  432. package/dist/client/assets/require-capability-CoB1D-Ih.js +0 -1
  433. package/dist/client/assets/retry-CErkP7V6.js +0 -1
  434. package/dist/client/assets/roles-DEMri9Kk.js +0 -1
  435. package/dist/client/assets/runnable-block-editor-BD-IThSC.js +0 -16
  436. package/dist/client/assets/secrets-7Z0pTBUq.js +0 -1
  437. package/dist/client/assets/sections-editor-DoMH-fks.js +0 -2
  438. package/dist/client/assets/select-C9ZnmbzX.js +0 -1
  439. package/dist/client/assets/select-model-FK_tmltz.js +0 -1
  440. package/dist/client/assets/seo-editor-DNovpojV.js +0 -1
  441. package/dist/client/assets/settings-layout-Cd8jASua.js +0 -1
  442. package/dist/client/assets/settings-sidebar-DP80M_GR.js +0 -1
  443. package/dist/client/assets/settings-tab-DE3XUo7h.js +0 -5
  444. package/dist/client/assets/shell-controls-CnE-Tn5l.js +0 -1
  445. package/dist/client/assets/shell-layout-DMp5UdGb.js +0 -1
  446. package/dist/client/assets/skill-preview-D2lK4hU9.js +0 -1
  447. package/dist/client/assets/skills-xXfBybxi.js +0 -1
  448. package/dist/client/assets/source-system-tabs-CnEGUb4r.js +0 -1
  449. package/dist/client/assets/sso-DdBxRFrm.js +0 -1
  450. package/dist/client/assets/store-registry-BFRxGHgD.js +0 -2
  451. package/dist/client/assets/switch-DADMizS1.js +0 -1
  452. package/dist/client/assets/synced-repos-Cp7R03Jp.js +0 -1
  453. package/dist/client/assets/task-route-_NgFGVoT.js +0 -1
  454. package/dist/client/assets/tasks-BvZdYZ5R.js +0 -1
  455. package/dist/client/assets/thread-sheet-body-S2AS0IdJ.js +0 -1
  456. package/dist/client/assets/toggle-group-CHZjV-1n.js +0 -1
  457. package/dist/client/assets/toolbar-DAhC4RMM.js +0 -1
  458. package/dist/client/assets/usage-stats-B38oXMbk.js +0 -1
  459. package/dist/client/assets/use-ai-providers-DYf552qv.js +0 -1
  460. package/dist/client/assets/use-automations-DSRSDlyo.js +0 -1
  461. package/dist/client/assets/use-commerce-diagnostic-pXwQBZmy.js +0 -1
  462. package/dist/client/assets/use-connect-companion-Bt171l5d.js +0 -1
  463. package/dist/client/assets/use-deco-credits-Coxc4dyp.js +0 -1
  464. package/dist/client/assets/use-decopilot-events-V4xtyk7c.js +0 -1
  465. package/dist/client/assets/use-delete-connection-geT4L5Ed.js +0 -1
  466. package/dist/client/assets/use-file-configs-BLWnBKpa.js +0 -1
  467. package/dist/client/assets/use-join-requests-DL4guRSR.js +0 -1
  468. package/dist/client/assets/use-main-panel-tabs-BtAksZ1f.js +0 -1
  469. package/dist/client/assets/use-mcp-auth-status-CpecQqEX.js +0 -1
  470. package/dist/client/assets/use-open-billing-url-DaC9_MxZ.js +0 -1
  471. package/dist/client/assets/use-org-auth-client-DuxSmx0x.js +0 -1
  472. package/dist/client/assets/use-org-notice-lWz1PPs-.js +0 -1
  473. package/dist/client/assets/use-organization-settings-C-LQvPpq.js +0 -1
  474. package/dist/client/assets/use-panel-navigate-D2RT2tc_.js +0 -1
  475. package/dist/client/assets/use-project-scope-Ch_4TfMQ.js +0 -1
  476. package/dist/client/assets/use-registry-connections-CuDWC28C.js +0 -1
  477. package/dist/client/assets/use-secrets-BJDccjnS.js +0 -1
  478. package/dist/client/assets/use-section-preview-base-SCqBiLMF.js +0 -1
  479. package/dist/client/assets/use-status-sounds-BG-lkYEo.js +0 -1
  480. package/dist/client/assets/use-tags-DhkHJc7C.js +0 -1
  481. package/dist/client/assets/use-task-metadata-COSUQhUk.js +0 -1
  482. package/dist/client/assets/use-view-mode-CUARubnx.js +0 -1
  483. package/dist/client/assets/use-virtual-mcp-BMRFgR9g.js +0 -1
  484. package/dist/client/assets/useInfiniteQuery-DOeboQGx.js +0 -1
  485. package/dist/client/assets/useSuspenseInfiniteQuery-B5UzTlHS.js +0 -1
  486. package/dist/client/assets/variant-calendar-f9XxiGiP.js +0 -1
  487. package/dist/client/assets/view-mode-toggle-D31fXZcw.js +0 -1
  488. /package/dist/client/assets/{index-DDGTF8rc.css → agent-site-editor-DDGTF8rc.css} +0 -0
@@ -1,8 +1,8 @@
1
- import{c as L,b as G,r as $,l as K,j as s,ap as ze,ak as pe,a_ as Gt,am as ge,a$ as Be,B as ne,a6 as Se,a7 as ke,a9 as Ie,aF as qt,b0 as Ht,b1 as Wt,b2 as Zt,v as be,aG as Jt,b3 as me,b4 as We,I as Te,d as ct,ac as Xt,e as es,o as ee,t as je,b5 as ts,F as ss,R as ns,K as os,m as rs,h as Vs,a as as,M as is,U as ls,au as Re,D as dt,b6 as cs,aE as ds}from"./index-gctAQu2T.js";import{c as us,d as ut,P as ms,i as ps}from"./index-DQ6uuKpF.js";import{K as fs,i as hs}from"./command-palette-store-BNo0UXiS.js";import{a as xs}from"./use-virtual-mcp-BMRFgR9g.js";import{w as gs,A as bs}from"./autosend-u-W4xgi7.js";import{s as As,u as vs,r as Ze,i as js,c as ys,w as ws,H as Cs}from"./use-open-billing-url-DaC9_MxZ.js";import{u as Ns}from"./use-session-runtime-Cs4eGT9k.js";import{i as mt}from"./ArrowRight-CkVUmxaa.js";import{i as pt}from"./ArrowUp-BQQdFypM.js";import{t as _e,ae as Ss,a7 as ft,g as ht,a9 as ks,z as Is,af as Ts,w as xt,h as gt,ag as bt,G as _s,ah as Ds,ai as Ms}from"./agent-icon-DsGBCBNv.js";import{i as $e}from"./Check-BJaMheL7.js";import{a as At}from"./Image01-DMAKgzzX.js";import{i as Es}from"./Upload01-BtBtAyal.js";import{u as Ue,a as Ps,c as De,h as Rs,j as Fs,k as Ls,l as zs,m as Bs,n as $s,o as Us,p as Os,e as Ks,b as Qs,s as Ys}from"./chat-context-CD1rWX64.js";import{t as Gs,z as qs,u as Hs}from"./hooks-CxPd9b6i.js";import{i as Ws}from"./AlertCircle-bl0yU7gy.js";import{a as Zs}from"./Copy01-BrL9ZrVF.js";import{F as Fe,a as Oe,b as Ke,c as Qe,d as vt}from"./form-DhUF_Mtg.js";import{c as Js,S as Xs,b as en,a as tn,d as sn}from"./select-C9ZnmbzX.js";import{t as jt}from"./ChevronUp-Cp-tcsrs.js";import{i as nn}from"./ArrowLeft-CpbUCYpB.js";import{M as on,c as rn,S as Vn}from"./usage-stats-B38oXMbk.js";import{b as an,c as ln}from"./tabs-Sr-wlkg3.js";import{t as Le}from"./Tool02-Darwb8nP.js";import{T as cn,a as Je}from"./toggle-group-CHZjV-1n.js";import{d as dn,h as un,c as mn,b as pn,D as fn}from"./dialog--Jkwvpx1.js";import{I as hn}from"./input-eBmoU-9D.js";import{u as xn}from"./use-deco-credits-Coxc4dyp.js";import{s as gn}from"./tool-namespace-DmnQIdtF.js";import{t as bn}from"./utils-CVEq3hMx.js";import{s as An}from"./XClose-DPfGLo7I.js";import{M as vn,m as Ye,g as jn,a as yn}from"./decopilot-CK3rN_ad.js";import{a as yt,b as wt,P as Ct}from"./popover-BfKN_4aI.js";import{d as wn,b as Cn,a as Nn,D as Sn}from"./drawer-DsG6Si3V.js";import{t as kn}from"./Stars01-DWjpdjKn.js";import{b as In}from"./use-organization-settings-C-LQvPpq.js";import{u as Nt,a as Tn}from"./use-ai-providers-DYf552qv.js";import{M as _n}from"./index-BywxOh2e.js";import{p as St,u as Dn,T as Mn,a as En,U as Pn}from"./input-DlvEXkej.js";import{d as Rn,g as Xe,s as Fn}from"./gateway-client-Cb37izH_.js";import{u as Ln}from"./use-mcp-client-CzGi1Gun.js";import{l as zn,g as Bn}from"./use-mcp-prompts-BJsq63pG.js";import{c as $n,D as Un,b as On,a as de,h as et,i as tt,j as st,e as Kn,d as Qn}from"./dropdown-menu-4cRHTbic.js";import{i as Yn}from"./Link01-CKw3sRrv.js";import{s as nt}from"./Plus-kQ9d0PiA.js";import"./hooks-BrcP19Uo.js";import{p as Gn,q as qn}from"./question-004-sINsf4GQ.js";import{A as Hn}from"./avatar-BpU54ct-.js";import{u as Wn}from"./use-members-xjztJVBn.js";import{A as Zn}from"./add-connection-dialog-C2-znERG.js";import{i as Jn}from"./ChevronRight-2Ti1evDh.js";import{u as Xn}from"./use-is-desktop-app-BNujXJc_.js";const Pe="cubic-bezier(0.645, 0.045, 0.355, 1)",UV=44,eo={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"},to={default:"border-border",error:"border-destructive/30",warning:"border-warning/30"},so={default:"text-muted-foreground",error:"text-destructive",warning:"text-warning"};function ue(t){const e=L.c(69),{icon:n,label:o,count:V,title:a,footerLeft:r,footerRight:i,children:l,defaultExpanded:m,variant:d,onClose:c}=t,u=d===void 0?"default":d,p=G(),[h,f]=$.useState(m),[x,A]=$.useState(!1);let b;e[0]!==c?(b=()=>{A(!0),c?.()},e[0]=c,e[1]=b):b=e[1];const v=b;if(x)return null;const g=to[u],C=eo[u];let j;e[2]!==g||e[3]!==C?(j=K("relative flex flex-col rounded-xl bg-background border shadow-md","w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",g,C),e[2]=g,e[3]=C,e[4]=j):j=e[4];let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=()=>f(no),e[5]=y):y=e[5];const N=h&&"rounded-b-none",k=!h&&"rounded-b-xl";let S;e[6]!==N||e[7]!==k?(S=K("flex items-center gap-2 w-full px-3 py-2 text-sm text-left","hover:bg-accent/50 transition-colors rounded-t-xl",N,k),e[6]=N,e[7]=k,e[8]=S):S=e[8];const _=so[u];let I;e[9]!==_?(I=K("shrink-0",_),e[9]=_,e[10]=I):I=e[10];let D;e[11]!==n||e[12]!==I?(D=s.jsx("span",{className:I,children:n}),e[11]=n,e[12]=I,e[13]=D):D=e[13];let T;e[14]!==o?(T=s.jsx("span",{className:"flex-1 min-w-0 truncate",children:o}),e[14]=o,e[15]=T):T=e[15];let z;e[16]!==V?(z=V?s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:V}):null,e[16]=V,e[17]=z):z=e[17];const E=h?"rotate(180deg)":"rotate(0deg)";let P;e[18]!==E?(P=s.jsx("span",{"aria-hidden":"true",className:"text-muted-foreground shrink-0 flex items-center justify-center",children:s.jsx(jt,{size:16,style:{transform:E,transition:`transform 180ms ${Pe}`}})}),e[18]=E,e[19]=P):P=e[19];let R;e[20]!==p?(R=p("chat.collapsibleHighlight.closeLabel"),e[20]=p,e[21]=R):R=e[21];let U;e[22]!==p?(U=p("chat.collapsibleHighlight.closeTitle"),e[22]=p,e[23]=U):U=e[23];let Y,B;e[24]!==v?(Y=ie=>{ie.stopPropagation(),v()},B=ie=>{(ie.key==="Enter"||ie.key===" ")&&(ie.preventDefault(),ie.stopPropagation(),v())},e[24]=v,e[25]=Y,e[26]=B):(Y=e[25],B=e[26]);let F;e[27]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(ze,{size:16}),e[27]=F):F=e[27];let M;e[28]!==R||e[29]!==U||e[30]!==Y||e[31]!==B?(M=s.jsx("span",{role:"button",tabIndex:0,"data-testid":"collapsible-highlight-close","aria-label":R,title:U,onClick:Y,onKeyDown:B,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:F}),e[28]=R,e[29]=U,e[30]=Y,e[31]=B,e[32]=M):M=e[32];let H;e[33]!==h||e[34]!==D||e[35]!==T||e[36]!==z||e[37]!==P||e[38]!==M||e[39]!==S?(H=s.jsxs("button",{type:"button","data-testid":"collapsible-highlight-chip","aria-expanded":h,onClick:y,className:S,children:[D,T,z,P,M]}),e[33]=h,e[34]=D,e[35]=T,e[36]=z,e[37]=P,e[38]=M,e[39]=S,e[40]=H):H=e[40];const W=h?"1fr":"0fr";let J;e[41]!==W?(J={display:"grid",gridTemplateRows:W,transition:`grid-template-rows 180ms ${Pe}`},e[41]=W,e[42]=J):J=e[42];let w;e[43]===Symbol.for("react.memo_cache_sentinel")?(w={overflow:"hidden",minHeight:0},e[43]=w):w=e[43];const O=h?1:0;let q;e[44]!==O?(q={opacity:O,transition:`opacity 120ms ${Pe}`,maxHeight:"60vh"},e[44]=O,e[45]=q):q=e[45];let Z;e[46]!==a?(Z=a?s.jsx("div",{className:"flex items-start gap-2 px-4 pt-4 pb-5 border-t border-dashed border-border/60",children:s.jsx("p",{className:"flex-1 text-base font-medium text-foreground min-w-0",children:a})}):s.jsx("div",{className:"border-t border-dashed border-border/60"}),e[46]=a,e[47]=Z):Z=e[47];let X;e[48]!==l||e[49]!==a?(X=l?s.jsx("div",{className:K("pb-4",!a&&"pt-4"),children:l}):null,e[48]=l,e[49]=a,e[50]=X):X=e[50];let te;e[51]!==Z||e[52]!==X?(te=s.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[Z,X]}),e[51]=Z,e[52]=X,e[53]=te):te=e[53];let re;e[54]!==r||e[55]!==i?(re=r||i?s.jsx("div",{className:"shrink-0 border-t border-border px-3 py-3 pb-6",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{children:r}),s.jsx("div",{className:"flex items-center gap-2",children:i})]})}):null,e[54]=r,e[55]=i,e[56]=re):re=e[56];let Ve;e[57]!==q||e[58]!==te||e[59]!==re?(Ve=s.jsx("div",{style:w,children:s.jsxs("div",{className:"flex flex-col",style:q,children:[te,re]})}),e[57]=q,e[58]=te,e[59]=re,e[60]=Ve):Ve=e[60];let se;e[61]!==J||e[62]!==Ve?(se=s.jsx("div",{"data-testid":"collapsible-highlight-body",style:J,children:Ve}),e[61]=J,e[62]=Ve,e[63]=se):se=e[63];let ae;return e[64]!==H||e[65]!==se||e[66]!==j||e[67]!==u?(ae=s.jsxs("div",{"data-testid":"collapsible-highlight","data-variant":u,className:j,children:[H,se]}),e[64]=H,e[65]=se,e[66]=j,e[67]=u,e[68]=ae):ae=e[68],ae}function no(t){return!t}const oo=pe({content:ge().min(1).describe("Imperative form, e.g. 'Implement the login flow'"),status:Be(["pending","in_progress","completed"]),activeForm:ge().min(1).describe("Present-continuous form shown in the UI while the todo is in progress, e.g. 'Implementing the login flow'")}),kt=pe({todos:Gt(oo)}),ro="Plan and track multi-step work. Call with the FULL todo list every time — this replaces the prior list. Call at the start of every multi-step request. Skip only for true one-shots (a single tool call or a direct answer). Mark exactly one todo `in_progress` at a time. Flip a todo to `in_progress` before starting it and to `completed` the moment it finishes — do not batch completions. Your prior tool-call inputs are your current state — read your last call to see where you are.";Gs({description:ro,inputSchema:qs(kt),execute:async({todos:t})=>({ok:!0,count:t.length})});const Vo="tool-todo_write",ao=new Set(["input-available","output-available"]);function io(t){for(let e=t.length-1;e>=0;e--){const n=t[e];if(n.role!=="assistant")continue;const o=n.parts;if(Array.isArray(o))for(let V=o.length-1;V>=0;V--){const a=o[V];if(a.type!==Vo||typeof a.state!="string"||!ao.has(a.state))continue;const r=kt.safeParse(a.input);if(r.success)return r.data.todos}}return[]}function It(t){const e=[];for(const n of t)if("state"in n&&n.state==="approval-requested"&&"approval"in n&&n.approval?.id&&"toolCallId"in n&&n.toolCallId){const o="toolName"in n&&typeof n.toolName=="string"?n.toolName:n.type.startsWith("tool-")?n.type.replace("tool-",""):"Tool";e.push({approvalId:n.approval.id,toolCallId:n.toolCallId,toolName:o,friendlyName:bn(gn(o)),input:n.input})}return e}function Tt(t){return t.at(-1)}function _t(t){const e=[];for(const n of t)n.type==="tool-propose_plan"&&n.state==="input-available"&&e.push({toolCallId:n.toolCallId,plan:n.input.plan,state:n.state});return e}function lo(t){return t?t.message.startsWith("[CREDITS]"):!1}const co={isCreditExhausted:!1,subscriptionErrorKind:null,hasTodos:!1,showError:!1,showWarning:!1,hasApprovals:!1,hasPlans:!1,isWaitingForUserInput:!1,todos:[]};function uo(t){const{messages:e,error:n,finishReason:o,isStreaming:V,isWaitingForApprovals:a}=t;if(!V&&n&&lo(n))return{...co,isCreditExhausted:!0};const r=e.at(-1),i=r?.role==="assistant"?r.parts:[],l=i,d=!!l.filter(g=>g.type==="tool-user_ask").filter(g=>g.state!=="output-available").length,c=_t(i),u=It(l),p=io(e),h=V?null:As(n),f=!V&&!!n&&!h,x=u.length>0||V&&a,A=c.length>0,v=!V&&!!o&&o!=="stop"&&!(o==="tool-calls"&&(d||x||A))&&!f;return{isCreditExhausted:!1,subscriptionErrorKind:h,hasTodos:p.length>0,showError:f,showWarning:v,hasApprovals:x,hasPlans:A,isWaitingForUserInput:d,todos:p}}function Dt(){const t=L.c(6),{messages:e,error:n,finishReason:o,isStreaming:V,isWaitingForApprovals:a}=Ue(),r=n??null,i=o??null;let l;return t[0]!==V||t[1]!==a||t[2]!==e||t[3]!==r||t[4]!==i?(l=uo({messages:e,error:r,finishReason:i,isStreaming:V,isWaitingForApprovals:a}),t[0]=V,t[1]=a,t[2]=e,t[3]=r,t[4]=i,t[5]=l):l=t[5],l}function OV(){const t=Dt();return t.isCreditExhausted?0:Number(t.hasTodos)+Number(t.showError)+ +!!t.subscriptionErrorKind+Number(t.showWarning)+Number(t.hasApprovals)+Number(t.hasPlans)+Number(t.isWaitingForUserInput)}const ot="start-task",mo=`Turn the report below into a running task. The user pressed "Start task", which authorizes delegation.
1
+ import{c as F,b as G,r as $,l as K,j as s,aa as pe,bq as Gt,ab as ge,bs as ze,B as ne,ad as qt,ac as Ht,br as Wt,bp as Zt,v as be,az as Jt,dK as me,dL as We,M as Se,d as ct,_ as Xt,e as es,o as ee,t as je,dA as ts,F as ss,K as ns,m as os,h as rs,a as Vs,I as as,J as is,ag as Re,D as dt,bx as ls,an as cs}from"./index-CVJEcf37.js";import{c as ds,d as ut,P as us,i as ms}from"./index-CblYf_yB.js";import{K as ps,i as fs}from"./command-palette-store-BcwFt5eE.js";import{a as hs}from"./use-virtual-mcp-DvSX4N6q.js";import{w as xs,A as gs}from"./autosend-BBoss6Ia.js";import{s as bs,u as As,r as Ze,i as vs,c as js,w as ys,H as ws}from"./use-open-billing-url-BYWSUicc.js";import{u as Cs}from"./use-session-runtime-CKDTMwlz.js";import{i as mt}from"./ArrowRight-BHzAyFwu.js";import{i as pt}from"./ArrowUp-DywwLYcR.js";import{t as ke,ap as Ns,a6 as ft,g as ht,a8 as Ss,L as ks,aq as Is,I as xt,h as gt,ar as bt,w as Ts,as as _s,at as Ds}from"./agent-icon-BjknPEfN.js";import{i as Be}from"./Check-PyGET9iL.js";import{a as At}from"./Image01-Dd-Rx_B5.js";import{i as Ms}from"./Upload01-BlEOH700.js";import{i as $e}from"./X-DejWyAyX.js";import{a as Ue,b as Es,c as Ie,h as Ps,j as Rs,k as Ls,l as Fs,m as zs,n as Bs,o as $s,p as Us,e as Os,u as Ks,s as Qs}from"./chat-context-B40ngn3f.js";import{e as Ys,z as Gs,c as qs}from"./hooks-CE7d6Dy1.js";import{i as Hs}from"./AlertCircle-BPZWT1gc.js";import{a as Ws}from"./Copy01-BbtQlTnV.js";import{a as Le,b as Oe,d as Ke,f as Qe,F as vt}from"./form-CRSWplOb.js";import{c as Zs,S as Js,b as Xs,a as en,d as tn}from"./select-B2GRzoG3.js";import{t as jt}from"./ChevronUp-B9QGJbr0.js";import{T as Te,a as _e,c as De}from"./tooltip-B7VLfO9w.js";import{i as sn}from"./ArrowLeft-c3HIgil5.js";import{M as nn,c as on,S as rn}from"./usage-stats-Bf1Ukas_.js";import{c as Vn,b as an}from"./tabs-DVMaAAMA.js";import{t as Fe}from"./Tool02-A5gv-OOO.js";import{a as ln,T as Je}from"./toggle-group-BW8cP6lf.js";import{d as cn,h as dn,c as un,b as mn,D as pn}from"./dialog-Dxe0Jgna.js";import{I as fn}from"./input-C8MQoDCb.js";import{u as hn}from"./use-deco-credits-CIfhJ3OU.js";import{s as xn}from"./tool-namespace-DmnQIdtF.js";import{t as gn}from"./utils-CVEq3hMx.js";import{s as bn}from"./XClose-wkdnmhrB.js";import{M as An,m as Ye,g as vn,a as jn}from"./decopilot-ClO0uusm.js";import{a as yt,b as wt,P as Ct}from"./popover-DAJR0ej2.js";import{c as yn,b as wn,a as Cn,D as Nn}from"./drawer-1GzYkddr.js";import{u as Sn}from"./use-mobile-WPuOYoIV.js";import{t as kn}from"./Stars01-BmtGexbk.js";import{f as In}from"./use-organization-settings-CRw6qdb3.js";import{u as Nt,c as Tn}from"./use-ai-providers-R1Jac-4Q.js";import{M as _n}from"./index-CcEd_wWL.js";import{p as St,u as Dn,T as Mn,a as En,U as Pn}from"./input-CQyA0V5b.js";import{d as Rn,g as Xe,s as Ln}from"./gateway-client-D45uHvIc.js";import{u as Fn}from"./use-mcp-client-DmOwsV3f.js";import{l as zn,g as Bn}from"./use-mcp-prompts-BKFfTbQi.js";import{c as $n,D as Un,b as On,a as de,h as et,i as tt,j as st,e as Kn,d as Qn}from"./dropdown-menu-Bws_0K_q.js";import{i as Yn}from"./Link01-pGxgI9VT.js";import{s as nt}from"./Plus-BUGmioCX.js";import"./hooks-CxBYuMc8.js";import{p as Gn,q as qn}from"./question-004-sINsf4GQ.js";import{A as Hn}from"./avatar-CO3n6wLC.js";import{u as Wn}from"./use-members-mw1URW2v.js";import{A as Zn}from"./add-connection-dialog-DB5JJjad.js";import{i as Jn}from"./ChevronRight-vY_5m8VB.js";import{u as Xn}from"./use-is-desktop-app-BNujXJc_.js";const Pe="cubic-bezier(0.645, 0.045, 0.355, 1)",QV=44,eo={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"},to={default:"border-border",error:"border-destructive/30",warning:"border-warning/30"},so={default:"text-muted-foreground",error:"text-destructive",warning:"text-warning"};function ue(t){const e=F.c(69),{icon:n,label:o,count:V,title:a,footerLeft:r,footerRight:i,children:l,defaultExpanded:m,variant:d,onClose:c}=t,u=d===void 0?"default":d,p=G(),[h,f]=$.useState(m),[x,A]=$.useState(!1);let b;e[0]!==c?(b=()=>{A(!0),c?.()},e[0]=c,e[1]=b):b=e[1];const v=b;if(x)return null;const g=to[u],C=eo[u];let j;e[2]!==g||e[3]!==C?(j=K("relative flex flex-col rounded-xl bg-background border shadow-md","w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",g,C),e[2]=g,e[3]=C,e[4]=j):j=e[4];let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=()=>f(no),e[5]=y):y=e[5];const N=h&&"rounded-b-none",k=!h&&"rounded-b-xl";let S;e[6]!==N||e[7]!==k?(S=K("flex items-center gap-2 w-full px-3 py-2 text-sm text-left","hover:bg-accent/50 transition-colors rounded-t-xl",N,k),e[6]=N,e[7]=k,e[8]=S):S=e[8];const _=so[u];let I;e[9]!==_?(I=K("shrink-0",_),e[9]=_,e[10]=I):I=e[10];let D;e[11]!==n||e[12]!==I?(D=s.jsx("span",{className:I,children:n}),e[11]=n,e[12]=I,e[13]=D):D=e[13];let T;e[14]!==o?(T=s.jsx("span",{className:"flex-1 min-w-0 truncate",children:o}),e[14]=o,e[15]=T):T=e[15];let z;e[16]!==V?(z=V?s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:V}):null,e[16]=V,e[17]=z):z=e[17];const E=h?"rotate(180deg)":"rotate(0deg)";let P;e[18]!==E?(P=s.jsx("span",{"aria-hidden":"true",className:"text-muted-foreground shrink-0 flex items-center justify-center",children:s.jsx(jt,{size:16,style:{transform:E,transition:`transform 180ms ${Pe}`}})}),e[18]=E,e[19]=P):P=e[19];let R;e[20]!==p?(R=p("chat.collapsibleHighlight.closeLabel"),e[20]=p,e[21]=R):R=e[21];let U;e[22]!==p?(U=p("chat.collapsibleHighlight.closeTitle"),e[22]=p,e[23]=U):U=e[23];let Y,B;e[24]!==v?(Y=ie=>{ie.stopPropagation(),v()},B=ie=>{(ie.key==="Enter"||ie.key===" ")&&(ie.preventDefault(),ie.stopPropagation(),v())},e[24]=v,e[25]=Y,e[26]=B):(Y=e[25],B=e[26]);let L;e[27]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx($e,{size:16}),e[27]=L):L=e[27];let M;e[28]!==R||e[29]!==U||e[30]!==Y||e[31]!==B?(M=s.jsx("span",{role:"button",tabIndex:0,"data-testid":"collapsible-highlight-close","aria-label":R,title:U,onClick:Y,onKeyDown:B,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:L}),e[28]=R,e[29]=U,e[30]=Y,e[31]=B,e[32]=M):M=e[32];let H;e[33]!==h||e[34]!==D||e[35]!==T||e[36]!==z||e[37]!==P||e[38]!==M||e[39]!==S?(H=s.jsxs("button",{type:"button","data-testid":"collapsible-highlight-chip","aria-expanded":h,onClick:y,className:S,children:[D,T,z,P,M]}),e[33]=h,e[34]=D,e[35]=T,e[36]=z,e[37]=P,e[38]=M,e[39]=S,e[40]=H):H=e[40];const W=h?"1fr":"0fr";let J;e[41]!==W?(J={display:"grid",gridTemplateRows:W,transition:`grid-template-rows 180ms ${Pe}`},e[41]=W,e[42]=J):J=e[42];let w;e[43]===Symbol.for("react.memo_cache_sentinel")?(w={overflow:"hidden",minHeight:0},e[43]=w):w=e[43];const O=h?1:0;let q;e[44]!==O?(q={opacity:O,transition:`opacity 120ms ${Pe}`,maxHeight:"60vh"},e[44]=O,e[45]=q):q=e[45];let Z;e[46]!==a?(Z=a?s.jsx("div",{className:"flex items-start gap-2 px-4 pt-4 pb-5 border-t border-dashed border-border/60",children:s.jsx("p",{className:"flex-1 text-base font-medium text-foreground min-w-0",children:a})}):s.jsx("div",{className:"border-t border-dashed border-border/60"}),e[46]=a,e[47]=Z):Z=e[47];let X;e[48]!==l||e[49]!==a?(X=l?s.jsx("div",{className:K("pb-4",!a&&"pt-4"),children:l}):null,e[48]=l,e[49]=a,e[50]=X):X=e[50];let te;e[51]!==Z||e[52]!==X?(te=s.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[Z,X]}),e[51]=Z,e[52]=X,e[53]=te):te=e[53];let re;e[54]!==r||e[55]!==i?(re=r||i?s.jsx("div",{className:"shrink-0 border-t border-border px-3 py-3 pb-6",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{children:r}),s.jsx("div",{className:"flex items-center gap-2",children:i})]})}):null,e[54]=r,e[55]=i,e[56]=re):re=e[56];let Ve;e[57]!==q||e[58]!==te||e[59]!==re?(Ve=s.jsx("div",{style:w,children:s.jsxs("div",{className:"flex flex-col",style:q,children:[te,re]})}),e[57]=q,e[58]=te,e[59]=re,e[60]=Ve):Ve=e[60];let se;e[61]!==J||e[62]!==Ve?(se=s.jsx("div",{"data-testid":"collapsible-highlight-body",style:J,children:Ve}),e[61]=J,e[62]=Ve,e[63]=se):se=e[63];let ae;return e[64]!==H||e[65]!==se||e[66]!==j||e[67]!==u?(ae=s.jsxs("div",{"data-testid":"collapsible-highlight","data-variant":u,className:j,children:[H,se]}),e[64]=H,e[65]=se,e[66]=j,e[67]=u,e[68]=ae):ae=e[68],ae}function no(t){return!t}const oo=pe({content:ge().min(1).describe("Imperative form, e.g. 'Implement the login flow'"),status:ze(["pending","in_progress","completed"]),activeForm:ge().min(1).describe("Present-continuous form shown in the UI while the todo is in progress, e.g. 'Implementing the login flow'")}),kt=pe({todos:Gt(oo)}),ro="Plan and track multi-step work. Call with the FULL todo list every time — this replaces the prior list. Call at the start of every multi-step request. Skip only for true one-shots (a single tool call or a direct answer). Mark exactly one todo `in_progress` at a time. Flip a todo to `in_progress` before starting it and to `completed` the moment it finishes — do not batch completions. Your prior tool-call inputs are your current state — read your last call to see where you are.";Ys({description:ro,inputSchema:Gs(kt),execute:async({todos:t})=>({ok:!0,count:t.length})});const Vo="tool-todo_write",ao=new Set(["input-available","output-available"]);function io(t){for(let e=t.length-1;e>=0;e--){const n=t[e];if(n.role!=="assistant")continue;const o=n.parts;if(Array.isArray(o))for(let V=o.length-1;V>=0;V--){const a=o[V];if(a.type!==Vo||typeof a.state!="string"||!ao.has(a.state))continue;const r=kt.safeParse(a.input);if(r.success)return r.data.todos}}return[]}function It(t){const e=[];for(const n of t)if("state"in n&&n.state==="approval-requested"&&"approval"in n&&n.approval?.id&&"toolCallId"in n&&n.toolCallId){const o="toolName"in n&&typeof n.toolName=="string"?n.toolName:n.type.startsWith("tool-")?n.type.replace("tool-",""):"Tool";e.push({approvalId:n.approval.id,toolCallId:n.toolCallId,toolName:o,friendlyName:gn(xn(o)),input:n.input})}return e}function Tt(t){return t.at(-1)}function _t(t){const e=[];for(const n of t)n.type==="tool-propose_plan"&&n.state==="input-available"&&e.push({toolCallId:n.toolCallId,plan:n.input.plan,state:n.state});return e}function lo(t){return t?t.message.startsWith("[CREDITS]"):!1}const co={isCreditExhausted:!1,subscriptionErrorKind:null,hasTodos:!1,showError:!1,showWarning:!1,hasApprovals:!1,hasPlans:!1,isWaitingForUserInput:!1,todos:[]};function uo(t){const{messages:e,error:n,finishReason:o,isStreaming:V,isWaitingForApprovals:a}=t;if(!V&&n&&lo(n))return{...co,isCreditExhausted:!0};const r=e.at(-1),i=r?.role==="assistant"?r.parts:[],l=i,d=!!l.filter(g=>g.type==="tool-user_ask").filter(g=>g.state!=="output-available").length,c=_t(i),u=It(l),p=io(e),h=V?null:bs(n),f=!V&&!!n&&!h,x=u.length>0||V&&a,A=c.length>0,v=!V&&!!o&&o!=="stop"&&!(o==="tool-calls"&&(d||x||A))&&!f;return{isCreditExhausted:!1,subscriptionErrorKind:h,hasTodos:p.length>0,showError:f,showWarning:v,hasApprovals:x,hasPlans:A,isWaitingForUserInput:d,todos:p}}function Dt(){const t=F.c(6),{messages:e,error:n,finishReason:o,isStreaming:V,isWaitingForApprovals:a}=Ue(),r=n??null,i=o??null;let l;return t[0]!==V||t[1]!==a||t[2]!==e||t[3]!==r||t[4]!==i?(l=uo({messages:e,error:r,finishReason:i,isStreaming:V,isWaitingForApprovals:a}),t[0]=V,t[1]=a,t[2]=e,t[3]=r,t[4]=i,t[5]=l):l=t[5],l}function YV(){const t=Dt();return t.isCreditExhausted?0:Number(t.hasTodos)+Number(t.showError)+ +!!t.subscriptionErrorKind+Number(t.showWarning)+Number(t.hasApprovals)+Number(t.hasPlans)+Number(t.isWaitingForUserInput)}const ot="start-task",mo=`Turn the report below into a running task. The user pressed "Start task", which authorizes delegation.
2
2
 
3
3
  1. Read the report and any attached screenshots. Carry the reporter's own words into the task description, plus the URL of any attachment.
4
4
  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. Its \`items\` tell you whether an open task already covers this report: if one does, link it and stop.
5
5
  3. Otherwise call TASK_BOARD_ITEM_CREATE with a concise title, the full description, the chosen repo as owner/name, and assigneeId "super-agent". That assignment is what queues the work.
6
6
  4. Reply with the task key the tool returned (e.g. DECO-144) and one line on what you filed. 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.
7
7
 
8
- The report follows.`;function po(t){return{...t,content:[{type:"paragraph",content:[us({id:ot,name:ot,char:"/",kind:"prompt",metadata:[{role:"user",content:{type:"text",text:mo}}]})]},...t.content??[]]}}function fo(t){const e=L.c(30),{current:n,total:o,onPrev:V,onNext:a}=t,r=G();if(o<=1)return null;const i=n===0,l=n===0?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let m;e[0]!==l?(m=K("p-0.5 rounded transition-colors",l),e[0]=l,e[1]=m):m=e[1];let d;e[2]!==r?(d=r("chat.pagination.previousLabel"),e[2]=r,e[3]=d):d=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(nn,{size:14}),e[4]=c):c=e[4];let u;e[5]!==V||e[6]!==i||e[7]!==m||e[8]!==d?(u=s.jsx("button",{type:"button",onClick:V,disabled:i,className:m,"aria-label":d,children:c}),e[5]=V,e[6]=i,e[7]=m,e[8]=d,e[9]=u):u=e[9];const p=n+1;let h;e[10]!==r||e[11]!==p||e[12]!==o?(h=r("chat.pagination.counter",{current:p,total:o}),e[10]=r,e[11]=p,e[12]=o,e[13]=h):h=e[13];let f;e[14]!==h?(f=s.jsx("span",{className:"tabular-nums text-xs",children:h}),e[14]=h,e[15]=f):f=e[15];const x=n===o-1,A=n===o-1?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let b;e[16]!==A?(b=K("p-0.5 rounded transition-colors",A),e[16]=A,e[17]=b):b=e[17];let v;e[18]!==r?(v=r("chat.pagination.nextLabel"),e[18]=r,e[19]=v):v=e[19];let g;e[20]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(mt,{size:14}),e[20]=g):g=e[20];let C;e[21]!==a||e[22]!==x||e[23]!==b||e[24]!==v?(C=s.jsx("button",{type:"button",onClick:a,disabled:x,className:b,"aria-label":v,children:g}),e[21]=a,e[22]=x,e[23]=b,e[24]=v,e[25]=C):C=e[25];let j;return e[26]!==C||e[27]!==u||e[28]!==f?(j=s.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[u,f,C]}),e[26]=C,e[27]=u,e[28]=f,e[29]=j):j=e[29],j}function Mt(t){const e=L.c(8),{currentIndex:n,total:o,onPrev:V,onNext:a,extraLeft:r}=t;let i;e[0]!==n||e[1]!==a||e[2]!==V||e[3]!==o?(i=s.jsx(fo,{current:n,total:o,onPrev:V,onNext:a}),e[0]=n,e[1]=a,e[2]=V,e[3]=o,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=s.jsxs("div",{className:"flex items-center gap-2",children:[i,r]}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function ho(t){const e=L.c(17),{isStreaming:n,isAllAnswered:o,isCurrentAnswered:V,onAdvanceOrSubmit:a,submitLabel:r,nextLabel:i}=t,d=o?r===void 0?"Submit":r:i===void 0?"Next":i,c=o?n:!V,u=c?o?"Waiting for the assistant to finish…":"Answer this item to continue":null;let p;e[0]!==c||e[1]!==a?(p=()=>{c||a()},e[0]=c,e[1]=a,e[2]=p):p=e[2];const h=c&&"opacity-50 cursor-not-allowed";let f;e[3]!==h?(f=K("h-7 px-2.5 text-xs",h),e[3]=h,e[4]=f):f=e[4];let x;e[5]!==c||e[6]!==d||e[7]!==p||e[8]!==f?(x=s.jsx(ne,{type:"button",size:"sm","aria-disabled":c,onClick:p,className:f,children:d}),e[5]=c,e[6]=d,e[7]=p,e[8]=f,e[9]=x):x=e[9];const A=x;if(!u)return A;let b;e[10]!==A?(b=s.jsx(Se,{asChild:!0,children:A}),e[10]=A,e[11]=b):b=e[11];let v;e[12]!==u?(v=s.jsx(ke,{children:u}),e[12]=u,e[13]=v):v=e[13];let g;return e[14]!==b||e[15]!==v?(g=s.jsxs(Ie,{children:[b,v]}),e[14]=b,e[15]=v,e[16]=g):g=e[16],g}function Et(t,e,n){return t.findIndex(o=>e(o)===n)}function rt(t,e,n,o){return t.length===0?!1:t.every(V=>o(n[e(V)]))}function Vt(t,e,n,o,V){if(t.length===0)return null;const a=Et(t,e,V);for(let r=1;r<=t.length;r++){const i=t[(a+r)%t.length];if(!i)continue;const l=e(i);if(l!==V&&!o(n[l]))return l}return null}function xo(t){return!t.isStreaming&&t.allAnswered}function Pt(t){const{parts:e,partKey:n,schema:o,defaultValues:V,isStreaming:a,hasAnswer:r,onSubmit:i}=t,l=e[0]?n(e[0]):"",[m,d]=$.useState(l),[c,u]=$.useState(!1),p=qt({resolver:Ht(o),defaultValues:V}),h=p.watch(),f=Et(e,n,m),x=f>=0?e[f]:void 0,A=r(h[m]),b=rt(e,n,h,r),v=xo({isStreaming:a,allAnswered:b}),g=()=>{if(f>0){const _=e[f-1];_&&d(n(_))}},C=()=>{if(f>=0&&f<e.length-1){const _=e[f+1];_&&d(n(_))}},j=()=>{const _=p.getValues(),I=Vt(e,n,_,r,m);I&&d(I)},y=()=>{p.handleSubmit(_=>{const I=_;for(const D of e)i(D,I[n(D)])})()},N=$.useRef(y);N.current=y;const k=()=>{v&&(u(!1),N.current())},S=()=>{const _=p.getValues();if(rt(e,n,_,r)){if(a){u(!0);return}u(!1),N.current()}else{const I=Vt(e,n,_,r,m);I&&d(I)}};return $.useEffect(()=>{if(c&&!a){if(!b){u(!1);return}u(!1),N.current()}},[c,a,b]),{form:p,activeKey:m,setActiveKey:d,currentIndex:f,currentPart:x,isCurrentAnswered:A,isAllAnswered:b,canSubmit:v,goPrev:g,goNext:C,advanceToNextUnanswered:j,submit:k,submitOrAdvance:S}}const Rt="chat.approval.defaultDenyReason";function Ft(t){const e=L.c(36),{onYolo:n}=t,o=G(),[V,a]=be();let r,i,l,m,d,c,u,p,h;if(e[0]!==n||e[1]!==V||e[2]!==a||e[3]!==o){const g=me.find(y=>y.value===V.toolApprovalLevel)??me[0];let C;e[13]!==n||e[14]!==V||e[15]!==a?(C=y=>{const N=y,k=V.toolApprovalLevel??"readonly";a({...V,toolApprovalLevel:N}),N==="auto"&&n(k)},e[13]=n,e[14]=V,e[15]=a,e[16]=C):C=e[16];const j=C;l=Xs,p=V.toolApprovalLevel,h=j,i=en,d="xs",c="text-xs text-muted-foreground border-border/60 bg-transparent hover:bg-accent/60 h-7 gap-1",u=go,r=tn,m=o(g.shortKey),e[0]=n,e[1]=V,e[2]=a,e[3]=o,e[4]=r,e[5]=i,e[6]=l,e[7]=m,e[8]=d,e[9]=c,e[10]=u,e[11]=p,e[12]=h}else r=e[4],i=e[5],l=e[6],m=e[7],d=e[8],c=e[9],u=e[10],p=e[11],h=e[12];let f;e[17]!==r||e[18]!==m?(f=s.jsx(r,{children:m}),e[17]=r,e[18]=m,e[19]=f):f=e[19];let x;e[20]!==i||e[21]!==d||e[22]!==c||e[23]!==u||e[24]!==f?(x=s.jsx(i,{size:d,className:c,onClick:u,children:f}),e[20]=i,e[21]=d,e[22]=c,e[23]=u,e[24]=f,e[25]=x):x=e[25];let A;e[26]!==o?(A=me.map(g=>s.jsx(Js,{value:g.value,children:o(g.labelKey)},g.value)),e[26]=o,e[27]=A):A=e[27];let b;e[28]!==A?(b=s.jsx(sn,{children:A}),e[28]=A,e[29]=b):b=e[29];let v;return e[30]!==l||e[31]!==b||e[32]!==p||e[33]!==h||e[34]!==x?(v=s.jsxs(l,{value:p,onValueChange:h,children:[x,b]}),e[30]=l,e[31]=b,e[32]=p,e[33]=h,e[34]=x,e[35]=v):v=e[35],v}function go(t){return t.stopPropagation()}function Lt(t){const e=L.c(8),{input:n}=t,o=G();if(n==null){let r;e[0]!==o?(r=o("chat.approval.noInput"),e[0]=o,e[1]=r):r=e[1];let i;return e[2]!==r?(i=s.jsx("div",{className:"px-4 text-xs text-muted-foreground",children:r}),e[2]=r,e[3]=i):i=e[3],i}let V;try{let r;e[4]!==n?(r=JSON.stringify(n,null,2),e[4]=n,e[5]=r):r=e[5],V=r}catch{V=String(n)}let a;return e[6]!==V?(a=s.jsx("div",{className:"px-4",children:s.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:V})}),e[6]=V,e[7]=a):a=e[7],a}function bo(t){const e=L.c(38),{approval:n,onRespond:o}=t,V=G(),[a]=be(),r=a.toolApprovalLevel??"readonly";let i;e[0]!==n.approvalId||e[1]!==r||e[2]!==o||e[3]!==V?(i=()=>o(n.approvalId,!1,V(Rt),r),e[0]=n.approvalId,e[1]=r,e[2]=o,e[3]=V,e[4]=i):i=e[4];const l=i;let m;e[5]!==n.approvalId||e[6]!==r||e[7]!==o?(m=()=>o(n.approvalId,!0,void 0,r),e[5]=n.approvalId,e[6]=r,e[7]=o,e[8]=m):m=e[8];const d=m;let c;e[9]!==n.approvalId||e[10]!==o?(c=k=>o(n.approvalId,!0,void 0,k),e[9]=n.approvalId,e[10]=o,e[11]=c):c=e[11];const u=c;let p;e[12]!==u?(p=s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(Ft,{onYolo:u})}),e[12]=u,e[13]=p):p=e[13];const h=p;let f;e[14]!==V?(f=V("chat.approval.denyButton"),e[14]=V,e[15]=f):f=e[15];let x;e[16]!==l||e[17]!==f?(x=s.jsx(ne,{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:l,children:f}),e[16]=l,e[17]=f,e[18]=x):x=e[18];let A;e[19]!==V?(A=V("chat.approval.acceptButton"),e[19]=V,e[20]=A):A=e[20];let b;e[21]!==d||e[22]!==A?(b=s.jsx(ne,{type:"button",size:"sm",className:"h-7 px-2.5 text-xs active:scale-[0.97] transition-transform",onClick:d,children:A}),e[21]=d,e[22]=A,e[23]=b):b=e[23];let v;e[24]!==x||e[25]!==b?(v=s.jsxs(s.Fragment,{children:[x,b]}),e[24]=x,e[25]=b,e[26]=v):v=e[26];const g=v;let C;e[27]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(_e,{size:14}),e[27]=C):C=e[27];let j;e[28]!==V?(j=V("chat.approval.needsApproval"),e[28]=V,e[29]=j):j=e[29];let y;e[30]!==n.input?(y=s.jsx(Lt,{input:n.input}),e[30]=n.input,e[31]=y):y=e[31];let N;return e[32]!==n.friendlyName||e[33]!==h||e[34]!==g||e[35]!==j||e[36]!==y?(N=s.jsx(ue,{icon:C,label:j,title:n.friendlyName,defaultExpanded:!0,footerLeft:h,footerRight:g,children:y}),e[32]=n.friendlyName,e[33]=h,e[34]=g,e[35]=j,e[36]=y,e[37]=N):N=e[37],N}const Ao=Wt(ge(),pe({approved:Zt().optional(),levelOverride:Be(["auto","readonly"]).optional()}));function vo(t){const e=L.c(46),{approvals:n,isStreaming:o,onRespond:V}=t,a=G(),[r]=be(),i=r.toolApprovalLevel??"readonly";let l;e[0]!==n?(l=Object.fromEntries(n.map(wo)),e[0]=n,e[1]=l):l=e[1];const m=l;let d;e[2]!==i||e[3]!==V||e[4]!==a?(d=(I,D)=>{const T=D;typeof T?.approved=="boolean"&&V(I.approvalId,T.approved,T.approved===!1?a(Rt):void 0,T.levelOverride??i)},e[2]=i,e[3]=V,e[4]=a,e[5]=d):d=e[5];let c;e[6]!==n||e[7]!==m||e[8]!==o||e[9]!==d?(c={parts:n,partKey:yo,schema:Ao,defaultValues:m,isStreaming:o,hasAnswer:jo,onSubmit:d},e[6]=n,e[7]=m,e[8]=o,e[9]=d,e[10]=c):c=e[10];const u=Pt(c);let p;e[11]!==n||e[12]!==u?(p=I=>{u.form.reset(Object.fromEntries(n.map(D=>[D.approvalId,{approved:!0,levelOverride:I}]))),u.submitOrAdvance()},e[11]=n,e[12]=u,e[13]=p):p=e[13];const h=p,f=u.currentPart,x=u.form;let A;e[14]!==u?(A=I=>{I.preventDefault(),u.submit()},e[14]=u,e[15]=A):A=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(_e,{size:14}),e[16]=b):b=e[16];let v;e[17]!==n.length||e[18]!==a?(v=a("chat.approval.batchedLabel",{count:n.length}),e[17]=n.length,e[18]=a,e[19]=v):v=e[19];const g=f?.friendlyName??"";let C;e[20]!==h?(C=s.jsx(Ft,{onYolo:h}),e[20]=h,e[21]=C):C=e[21];let j;e[22]!==n.length||e[23]!==u.currentIndex||e[24]!==u.goNext||e[25]!==u.goPrev||e[26]!==C?(j=s.jsx(Mt,{currentIndex:u.currentIndex,total:n.length,onPrev:u.goPrev,onNext:u.goNext,extraLeft:C}),e[22]=n.length,e[23]=u.currentIndex,e[24]=u.goNext,e[25]=u.goPrev,e[26]=C,e[27]=j):j=e[27];let y;e[28]!==f||e[29]!==u.form.control||e[30]!==u.submitOrAdvance?(y=f?s.jsx(Co,{approvalId:f.approvalId,control:u.form.control,onChange:u.submitOrAdvance}):null,e[28]=f,e[29]=u.form.control,e[30]=u.submitOrAdvance,e[31]=y):y=e[31];let N;e[32]!==f?(N=f?s.jsx(Lt,{input:f.input}):null,e[32]=f,e[33]=N):N=e[33];let k;e[34]!==j||e[35]!==y||e[36]!==N||e[37]!==v||e[38]!==g?(k=s.jsx(ue,{icon:b,label:v,title:g,defaultExpanded:!0,footerLeft:j,footerRight:y,children:N}),e[34]=j,e[35]=y,e[36]=N,e[37]=v,e[38]=g,e[39]=k):k=e[39];let S;e[40]!==k||e[41]!==A?(S=s.jsx("form",{onSubmit:A,children:k}),e[40]=k,e[41]=A,e[42]=S):S=e[42];let _;return e[43]!==u.form||e[44]!==S?(_=s.jsx(Fe,{...x,children:S}),e[43]=u.form,e[44]=S,e[45]=_):_=e[45],_}function jo(t){return typeof t?.approved=="boolean"}function yo(t){return t.approvalId}function wo(t){return[t.approvalId,{approved:void 0}]}function Co(t){const e=L.c(7),{approvalId:n,control:o,onChange:V}=t,a=G(),r=`${n}.approved`;let i;e[0]!==V||e[1]!==a?(i=m=>{const{field:d}=m,c=d.value===!0,u=d.value===!1;return s.jsxs(s.Fragment,{children:[s.jsx(ne,{type:"button",variant:u?"secondary":"ghost",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{d.onChange(!1),V()},"aria-pressed":u,children:a("chat.approval.denyButton")}),s.jsx(ne,{type:"button",variant:c?"default":"outline",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{d.onChange(!0),V()},"aria-pressed":c,children:a("chat.approval.acceptButton")})]})},e[0]=V,e[1]=a,e[2]=i):i=e[2];let l;return e[3]!==o||e[4]!==r||e[5]!==i?(l=s.jsx(Jt,{control:o,name:r,render:i}),e[3]=o,e[4]=r,e[5]=i,e[6]=l):l=e[6],l}function No(){const t=L.c(5),e=G();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(_e,{className:"size-5 text-muted-foreground shimmer"}),t[0]=n):n=t[0];let o;t[1]!==e?(o=e("chat.approval.preparingRequest"),t[1]=e,t[2]=o):o=t[2];let V;return t[3]!==o?(V=s.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:[n,s.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:o})]}),t[3]=o,t[4]=V):V=t[4],V}function So(t){const e=L.c(8),{approvals:n,isStreaming:o,onRespond:V}=t;if(o&&n.length===0){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(No,{}),e[0]=r):r=e[0],r}if(n.length===0)return null;if(n.length===1){const r=n[0];if(!r)return null;let i;return e[1]!==V||e[2]!==r?(i=s.jsx(bo,{approval:r,onRespond:V}),e[1]=V,e[2]=r,e[3]=i):i=e[3],i}let a;return e[4]!==n||e[5]!==o||e[6]!==V?(a=s.jsx(vo,{approvals:n,isStreaming:o,onRespond:V}),e[4]=n,e[5]=o,e[6]=V,e[7]=a):a=e[7],a}function ko(t){const e=L.c(28),{plan:n,onApprove:o,onDismiss:V}=t,a=G();let r;e[0]!==o||e[1]!==n.plan?(r=()=>{o(n.plan)},e[0]=o,e[1]=n.plan,e[2]=r):r=e[2];const i=r;let l;e[3]!==a?(l=a("chat.proposePlan.keepIterating"),e[3]=a,e[4]=l):l=e[4];let m;e[5]!==V||e[6]!==l?(m=s.jsx(ne,{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:l}),e[5]=V,e[6]=l,e[7]=m):m=e[7];let d;e[8]!==a?(d=a("chat.proposePlan.letsGo"),e[8]=a,e[9]=d):d=e[9];let c;e[10]!==i||e[11]!==d?(c=s.jsx(ne,{type:"button",size:"sm",className:"h-7 px-2.5 text-xs bg-purple-600 hover:bg-purple-700 text-white active:scale-[0.97] transition-transform",onClick:i,children:d}),e[10]=i,e[11]=d,e[12]=c):c=e[12];let u;e[13]!==m||e[14]!==c?(u=s.jsxs(s.Fragment,{children:[m,c]}),e[13]=m,e[14]=c,e[15]=u):u=e[15];const p=u;let h;e[16]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Ss,{size:14}),e[16]=h):h=e[16];let f;e[17]!==a?(f=a("chat.proposePlan.planReady"),e[17]=a,e[18]=f):f=e[18];let x;e[19]!==a?(x=a("chat.proposePlan.implementationPlan"),e[19]=a,e[20]=x):x=e[20];let A;e[21]!==n.plan?(A=s.jsx("div",{className:"px-4 max-h-64 overflow-y-auto",children:s.jsx("div",{className:"prose prose-sm max-w-none text-sm",children:s.jsx(on,{id:"plan-preview",part:{type:"text",text:n.plan}})})}),e[21]=n.plan,e[22]=A):A=e[22];let b;return e[23]!==p||e[24]!==A||e[25]!==f||e[26]!==x?(b=s.jsx(ue,{icon:h,label:f,title:x,defaultExpanded:!0,footerRight:p,children:A}),e[23]=p,e[24]=A,e[25]=f,e[26]=x,e[27]=b):b=e[27],b}function Io(t){const e=L.c(6),{plans:n,onApprove:o,onDismiss:V}=t;let a;e[0]!==n?(a=Tt(n),e[0]=n,e[1]=a):a=e[1];const r=a;if(!r)return null;let i;return e[2]!==r||e[3]!==o||e[4]!==V?(i=s.jsx(ko,{plan:r,onApprove:o,onDismiss:V}),e[2]=r,e[3]=o,e[4]=V,e[5]=i):i=e[5],i}function zt(t){return t?"response"in t?t.response:t.option??t.draft:""}const at=pe({response:ge().min(1,"Response is required")}),To=pe({option:ge().nullable(),draft:ge()}).refine(t=>(t.option??t.draft).length>0,{message:"Please select or enter an option"}),_o=pe({response:Be(["yes","no"])});function Do(t){switch(t.type){case"text":return at;case"choice":return To;case"confirm":return _o;default:return at}}function Mo(t){const e={};for(const n of t)e[n.toolCallId]=Do(n.input);return pe(e)}function Eo(t){const e=L.c(7),{control:n,name:o,placeholder:V}=t,a=G();let r;e[0]!==V||e[1]!==a?(r=l=>{const{field:m}=l,d=m.value??"";return s.jsxs(Oe,{children:[s.jsx(Ke,{children:s.jsx("div",{className:"px-2",children:s.jsxs("div",{className:"flex items-center gap-3 px-2 py-3 rounded-lg bg-accent/50",children:[s.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:s.jsx(ft,{size:16,className:"text-muted-foreground"})}),s.jsx("input",{...m,value:d,type:"text",placeholder:V||a("chat.userAskQuestion.typeResponse"),autoFocus:!0,"aria-label":a("chat.userAskQuestion.textResponseInputAriaLabel"),className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"})]})})}),s.jsx(Qe,{})]})},e[0]=V,e[1]=a,e[2]=r):r=e[2];let i;return e[3]!==n||e[4]!==o||e[5]!==r?(i=s.jsx(vt,{control:n,name:o,render:r}),e[3]=n,e[4]=o,e[5]=r,e[6]=i):i=e[6],i}function Bt(t,e){const n=L.c(4);let o,V;n[0]!==t||n[1]!==e?(o=()=>{const a=r=>{const i=r.target.tagName;if(i==="INPUT"||i==="TEXTAREA"||r.metaKey||r.ctrlKey||r.altKey)return;const l=Number.parseInt(r.key,10);l>=1&&l<=t&&(r.preventDefault(),e(l-1))};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},V=[t,e],n[0]=t,n[1]=e,n[2]=o,n[3]=V):(o=n[2],V=n[3]),$.useEffect(o,V)}function Po(t){const e=L.c(51),{control:n,name:o,options:V}=t,a=G(),r=`${o}.option`;let i;e[0]!==n||e[1]!==r?(i={control:n,name:r,defaultValue:null},e[0]=n,e[1]=r,e[2]=i):i=e[2];const{field:l}=We(i),m=`${o}.draft`;let d;e[3]!==n||e[4]!==m?(d={control:n,name:m,defaultValue:""},e[3]=n,e[4]=m,e[5]=d):d=e[5];const{field:c}=We(d),u=l.value,p=c.value??"";let h;if(e[6]!==l||e[7]!==V?(h=E=>{const P=V[E];P!=null&&l.onChange(P)},e[6]=l,e[7]=V,e[8]=h):h=e[8],Bt(V.length,h),V.length===0)return null;const f=u===null;let x;e[9]!==a?(x=a("chat.userAskQuestion.choiceOptionsAriaLabel"),e[9]=a,e[10]=x):x=e[10];let A;if(e[11]!==l||e[12]!==u||e[13]!==V||e[14]!==a){let E;e[16]!==l||e[17]!==u||e[18]!==a?(E=(P,R)=>{const U=u===P;return s.jsxs("button",{type:"button",onClick:()=>l.onChange(P),className:K("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/30"),"aria-label":a("chat.userAskQuestion.selectOption",{option:P}),children:[s.jsx("span",{className:K("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:R+1}),s.jsx("span",{className:"text-sm text-foreground min-w-0 break-words",children:P})]},`${R}-${P}`)},e[16]=l,e[17]=u,e[18]=a,e[19]=E):E=e[19],A=V.map(E),e[11]=l,e[12]=u,e[13]=V,e[14]=a,e[15]=A}else A=e[15];const b=f&&"bg-accent/50",v=!f&&"hover:bg-accent/30";let g;e[20]!==b||e[21]!==v?(g=K("flex items-center gap-3 px-2 py-3 rounded-lg transition-colors w-full cursor-text",b,v),e[20]=b,e[21]=v,e[22]=g):g=e[22];let C;e[23]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:s.jsx(ft,{size:16,className:"text-muted-foreground"})}),e[23]=C):C=e[23];const j=f?p:"";let y;e[24]!==c||e[25]!==l||e[26]!==u?(y=E=>{c.onChange(E.target.value),u!==null&&l.onChange(null)},e[24]=c,e[25]=l,e[26]=u,e[27]=y):y=e[27];let N;e[28]!==l||e[29]!==u?(N=()=>{u!==null&&l.onChange(null)},e[28]=l,e[29]=u,e[30]=N):N=e[30];let k;e[31]!==a?(k=a("chat.userAskQuestion.somethingElsePlaceholder"),e[31]=a,e[32]=k):k=e[32];let S;e[33]!==a?(S=a("chat.userAskQuestion.customChoiceInputAriaLabel"),e[33]=a,e[34]=S):S=e[34];let _;e[35]!==j||e[36]!==y||e[37]!==N||e[38]!==k||e[39]!==S?(_=s.jsx("input",{type:"text",value:j,onChange:y,onFocus:N,placeholder:k,"aria-label":S,className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"}),e[35]=j,e[36]=y,e[37]=N,e[38]=k,e[39]=S,e[40]=_):_=e[40];let I;e[41]!==g||e[42]!==_?(I=s.jsxs("label",{className:g,children:[C,_]}),e[41]=g,e[42]=_,e[43]=I):I=e[43];let D;e[44]!==I||e[45]!==x||e[46]!==A?(D=s.jsx(Ke,{children:s.jsxs("div",{className:"flex flex-col px-2",role:"group","aria-label":x,children:[A,I]})}),e[44]=I,e[45]=x,e[46]=A,e[47]=D):D=e[47];let T;e[48]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(Qe,{}),e[48]=T):T=e[48];let z;return e[49]!==D?(z=s.jsxs(Oe,{children:[D,T]}),e[49]=D,e[50]=z):z=e[50],z}function Ro(t){const e=L.c(8),{control:n,name:o}=t,V=G();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=["yes","no"],e[0]=a):a=e[0];const r=a,i=$.useRef(null);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=c=>{i.current?.onChange(r[c]??"")},e[1]=l):l=e[1],Bt(r.length,l);let m;e[2]!==V?(m=c=>{const{field:u}=c;return i.current=u,s.jsxs(Oe,{children:[s.jsx(Ke,{children:s.jsx("div",{className:"flex gap-2 px-2",role:"group","aria-label":V("chat.userAskQuestion.confirmationOptionsAriaLabel"),children:r.map(p=>{const h=u.value===p;return s.jsxs("button",{type:"button",onClick:()=>u.onChange(p),className:K("flex items-center gap-3 px-4 py-3 rounded-lg text-left transition-colors flex-1",h&&"bg-accent/50",!h&&"hover:bg-accent/30"),"aria-label":V("chat.userAskQuestion.confirmValue",{value:V(`chat.userAskQuestion.confirm${p==="yes"?"Yes":"No"}`)}),children:[s.jsx("span",{className:K("flex items-center justify-center size-6 rounded-md text-sm shrink-0",h?"bg-chart-1 text-white":"bg-muted text-foreground"),children:p==="yes"?1:2}),s.jsx("span",{className:"text-sm text-foreground capitalize",children:V(`chat.userAskQuestion.confirm${p==="yes"?"Yes":"No"}`)})]},p)})})}),s.jsx(Qe,{})]})},e[2]=V,e[3]=m):m=e[3];let d;return e[4]!==n||e[5]!==o||e[6]!==m?(d=s.jsx(vt,{control:n,name:o,render:m}),e[4]=n,e[5]=o,e[6]=m,e[7]=d):d=e[7],d}function it(t){const e=L.c(13),{input:n,control:o,toolCallId:V}=t;switch(n.type){case"text":{const a=`${V}.response`;let r;return e[0]!==o||e[1]!==n.default||e[2]!==a?(r=s.jsx(Eo,{control:o,name:a,placeholder:n.default}),e[0]=o,e[1]=n.default,e[2]=a,e[3]=r):r=e[3],r}case"choice":{let a;e[4]!==n.options?(a=n.options?.filter(Boolean)??[],e[4]=n.options,e[5]=a):a=e[5];const r=a;let i;return e[6]!==o||e[7]!==r||e[8]!==V?(i=s.jsx(Po,{control:o,name:V,options:r}),e[6]=o,e[7]=r,e[8]=V,e[9]=i):i=e[9],i}case"confirm":{const a=`${V}.response`;let r;return e[10]!==o||e[11]!==a?(r=s.jsx(Ro,{control:o,name:a}),e[10]=o,e[11]=a,e[12]=r):r=e[12],r}default:return null}}function Fo(t){const e=L.c(91),{parts:n,isStreaming:o,onSubmit:V}=t;let a;e[0]!==n?(a=Mo(n.map($o)),e[0]=n,e[1]=a):a=e[1];const r=a;let i;e[2]!==n?(i=Object.fromEntries(n.map(Bo)),e[2]=n,e[3]=i):i=e[3];const l=i;let m;e[4]!==V?(m=(B,F)=>{const M=zt(F);M&&V(B,M)},e[4]=V,e[5]=m):m=e[5];let d;e[6]!==l||e[7]!==o||e[8]!==n||e[9]!==r||e[10]!==m?(d={parts:n,partKey:zo,schema:r,defaultValues:l,isStreaming:o,hasAnswer:Lo,onSubmit:m},e[6]=l,e[7]=o,e[8]=n,e[9]=r,e[10]=m,e[11]=d):d=e[11];const c=Pt(d),u=c.currentPart,p=G();let h;e[12]!==u||e[13]!==c||e[14]!==p?(h=()=>{const B=u;if(!B)return;const F=p("chat.userAskQuestion.skipMessage"),M=B.toolCallId;B.input?.type==="choice"?(c.form.setValue(`${M}.option`,null),c.form.setValue(`${M}.draft`,F)):c.form.setValue(`${M}.response`,F),c.advanceToNextUnanswered()},e[12]=u,e[13]=c,e[14]=p,e[15]=h):h=e[15];const f=h;let x;e[16]!==c.currentIndex||e[17]!==c.goNext||e[18]!==c.goPrev||e[19]!==n.length?(x=s.jsx(Mt,{currentIndex:c.currentIndex,total:n.length,onPrev:c.goPrev,onNext:c.goNext}),e[16]=c.currentIndex,e[17]=c.goNext,e[18]=c.goPrev,e[19]=n.length,e[20]=x):x=e[20];const A=x;let b;e[21]!==p?(b=p("chat.userAskQuestion.skip"),e[21]=p,e[22]=b):b=e[22];let v;e[23]!==f||e[24]!==b?(v=s.jsx(ne,{type:"button",variant:"outline",size:"sm",onClick:f,className:"h-7",children:b}),e[23]=f,e[24]=b,e[25]=v):v=e[25];let g;e[26]!==c.isAllAnswered||e[27]!==c.isCurrentAnswered||e[28]!==c.submitOrAdvance||e[29]!==o?(g=s.jsx(ho,{isStreaming:o,isAllAnswered:c.isAllAnswered,isCurrentAnswered:c.isCurrentAnswered,onAdvanceOrSubmit:c.submitOrAdvance}),e[26]=c.isAllAnswered,e[27]=c.isCurrentAnswered,e[28]=c.submitOrAdvance,e[29]=o,e[30]=g):g=e[30];let C;e[31]!==v||e[32]!==g?(C=s.jsxs(s.Fragment,{children:[v,g]}),e[31]=v,e[32]=g,e[33]=C):C=e[33];const j=C;if(n.length===1){const B=n[0];if(!B?.input)return null;const F=c.form;let M;e[34]!==c?(M=te=>{te.preventDefault(),c.submit()},e[34]=c,e[35]=M):M=e[35];let H;e[36]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Le,{size:14}),e[36]=H):H=e[36];let W;e[37]!==p?(W=p("chat.userAskQuestion.questionPending"),e[37]=p,e[38]=W):W=e[38];let J;e[39]!==B.input?.prompt||e[40]!==p?(J=B.input?.prompt??p("chat.userAskQuestion.question"),e[39]=B.input?.prompt,e[40]=p,e[41]=J):J=e[41];const w=B.input;let O;e[42]!==c.form.control||e[43]!==B.toolCallId||e[44]!==w?(O=s.jsx(it,{input:w,control:c.form.control,toolCallId:B.toolCallId}),e[42]=c.form.control,e[43]=B.toolCallId,e[44]=w,e[45]=O):O=e[45];let q;e[46]!==j||e[47]!==W||e[48]!==J||e[49]!==O?(q=s.jsx(ue,{icon:H,label:W,title:J,defaultExpanded:!0,footerRight:j,children:O}),e[46]=j,e[47]=W,e[48]=J,e[49]=O,e[50]=q):q=e[50];let Z;e[51]!==M||e[52]!==q?(Z=s.jsx("form",{onSubmit:M,autoComplete:"off",children:q}),e[51]=M,e[52]=q,e[53]=Z):Z=e[53];let X;return e[54]!==c.form||e[55]!==Z?(X=s.jsx(Fe,{...F,children:Z}),e[54]=c.form,e[55]=Z,e[56]=X):X=e[56],X}const y=c.form;let N;e[57]!==c?(N=B=>{B.preventDefault(),c.submit()},e[57]=c,e[58]=N):N=e[58];let k;e[59]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Le,{size:14}),e[59]=k):k=e[59];let S;e[60]!==p?(S=p("chat.userAskQuestion.questionPending"),e[60]=p,e[61]=S):S=e[61];const _=c.currentIndex+1;let I;e[62]!==n.length||e[63]!==p||e[64]!==_?(I=p("chat.userAskQuestion.questionCount",{current:_,total:n.length}),e[62]=n.length,e[63]=p,e[64]=_,e[65]=I):I=e[65];let D;e[66]!==u?.input?.prompt||e[67]!==p?(D=u?.input?.prompt??p("chat.userAskQuestion.question"),e[66]=u?.input?.prompt,e[67]=p,e[68]=D):D=e[68];const T=c.activeKey,z=c.setActiveKey;let E;if(e[69]!==c.form||e[70]!==n){let B;e[72]!==c.form?(B=F=>s.jsx(an,{value:F.toolCallId,className:"mt-0",children:s.jsx(it,{input:F.input,control:c.form.control,toolCallId:F.toolCallId})},F.toolCallId),e[72]=c.form,e[73]=B):B=e[73],E=n.map(B),e[69]=c.form,e[70]=n,e[71]=E}else E=e[71];let P;e[74]!==c.activeKey||e[75]!==c.setActiveKey||e[76]!==E?(P=s.jsx(ln,{value:T,onValueChange:z,children:E}),e[74]=c.activeKey,e[75]=c.setActiveKey,e[76]=E,e[77]=P):P=e[77];let R;e[78]!==A||e[79]!==j||e[80]!==S||e[81]!==I||e[82]!==D||e[83]!==P?(R=s.jsx(ue,{icon:k,label:S,count:I,title:D,defaultExpanded:!0,footerLeft:A,footerRight:j,children:P}),e[78]=A,e[79]=j,e[80]=S,e[81]=I,e[82]=D,e[83]=P,e[84]=R):R=e[84];let U;e[85]!==N||e[86]!==R?(U=s.jsx("form",{onSubmit:N,autoComplete:"off",children:R}),e[85]=N,e[86]=R,e[87]=U):U=e[87];let Y;return e[88]!==c.form||e[89]!==U?(Y=s.jsx(Fe,{...y,children:U}),e[88]=c.form,e[89]=U,e[90]=Y):Y=e[90],Y}function Lo(t){return!!zt(t)}function zo(t){return t.toolCallId}function Bo(t){return t.input?.type==="choice"?[t.toolCallId,{option:null,draft:""}]:[t.toolCallId,{response:""}]}function $o(t){return{toolCallId:t.toolCallId,input:t.input}}function Uo(){const t=L.c(5),e=G();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Le,{className:"size-5 text-muted-foreground shimmer"}),t[0]=n):n=t[0];let o;t[1]!==e?(o=e("chat.userAskQuestion.preparingQuestion"),t[1]=e,t[2]=o):o=t[2];let V;return t[3]!==o?(V=s.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:[n,s.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:o})]}),t[3]=o,t[4]=V):V=t[4],V}function $t(t){const e=L.c(7),{userAskParts:n,isStreaming:o,onSubmit:V}=t;let a;e[0]!==n?(a=n.filter(Oo),e[0]=n,e[1]=a):a=e[1];const r=a;if(r.length===0){if(o){let l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Uo,{}),e[2]=l):l=e[2],l}return null}let i;return e[3]!==o||e[4]!==V||e[5]!==r?(i=s.jsx(Fo,{parts:r,isStreaming:o,onSubmit:V}),e[3]=o,e[4]=V,e[5]=r,e[6]=i):i=e[6],i}function Oo(t){return t.state==="input-available"}function Ko(t){const e=t.filter(a=>a.status==="in_progress"),n=t.filter(a=>a.status==="completed").length,o=t.length;if(o>0&&n===o)return{icon:"completed",activity:"All done",progress:`${o}/${o}`};const[V]=e;return V&&e.length===1?{icon:"in_progress",activity:V.activeForm,progress:`${n}/${o} done`}:e.length>1?{icon:"in_progress",activity:`${e.length} in progress`,progress:`${n}/${o} done`}:n>0?{icon:"pending",activity:`${o-n} pending`,progress:`${n}/${o} done`}:{icon:"pending",activity:`${o} todos`,progress:"not started"}}function Qo(t){const e=L.c(13),{todos:n}=t;if(n.length===0)return null;let o;e[0]!==n?(o=Ko(n),e[0]=n,e[1]=o):o=e[1];const V=o;let a;e[2]!==V.icon?(a=s.jsx(Ho,{status:V.icon}),e[2]=V.icon,e[3]=a):a=e[3];const r=V.activity,i=V.progress;let l;e[4]!==n?(l=n.map(Yo),e[4]=n,e[5]=l):l=e[5];let m;e[6]!==l?(m=s.jsx("ul",{"data-testid":"todos-list",className:"flex flex-col px-2 max-h-[40vh] overflow-y-auto",children:l}),e[6]=l,e[7]=m):m=e[7];let d;return e[8]!==V.activity||e[9]!==V.progress||e[10]!==a||e[11]!==m?(d=s.jsx(ue,{icon:a,label:r,count:i,defaultExpanded:!1,children:m}),e[8]=V.activity,e[9]=V.progress,e[10]=a,e[11]=m,e[12]=d):d=e[12],d}function Yo(t,e){return s.jsx(Go,{todo:t},e)}function Go(t){const e=L.c(14),{todo:n}=t,o=n.status==="completed",a=n.status==="in_progress"?n.activeForm:n.content;let r;e[0]!==n.status?(r=s.jsx(qo,{status:n.status}),e[0]=n.status,e[1]=r):r=e[1];const i=o&&"text-muted-foreground";let l;e[2]!==i?(l=K("relative text-sm leading-snug pt-px select-none",i),e[2]=i,e[3]=l):l=e[3];const m=o?"100%":"0%",d=o?"width 300ms ease 200ms":"width 150ms ease";let c;e[4]!==m||e[5]!==d?(c=s.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:"50%",height:"1px",background:"currentColor",width:m,transition:d}}),e[4]=m,e[5]=d,e[6]=c):c=e[6];let u;e[7]!==a||e[8]!==l||e[9]!==c?(u=s.jsxs("span",{className:l,children:[a,c]}),e[7]=a,e[8]=l,e[9]=c,e[10]=u):u=e[10];let p;return e[11]!==r||e[12]!==u?(p=s.jsxs("li",{className:"flex items-start gap-2.5 px-2 py-1.5 rounded-lg hover:bg-accent/50 transition-colors",children:[r,u]}),e[11]=r,e[12]=u,e[13]=p):p=e[13],p}function qo(t){const e=L.c(4),{status:n}=t,o=n==="completed"?"true":void 0,V=n==="in_progress"?"true":void 0;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("svg",{viewBox:"0 0 21 21",children:s.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]=a):a=e[0];let r;return e[1]!==o||e[2]!==V?(r=s.jsx("div",{className:"todo-cb mt-0.5","data-checked":o,"data-progress":V,"aria-hidden":"true",children:a}),e[1]=o,e[2]=V,e[3]=r):r=e[3],r}function Ho(t){const e=L.c(13),{status:n}=t,o=G();if(n==="completed"){let r;e[0]!==o?(r=o("chat.todoStatus.completed"),e[0]=o,e[1]=r):r=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.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:s.jsx("path",{d:"M1 4l2.5 2.5L9 1"})}),e[2]=i):i=e[2];let l;return e[3]!==r?(l=s.jsx("span",{"aria-label":r,className:"inline-flex items-center justify-center w-3.5 h-3.5 rounded-sm bg-primary",children:i}),e[3]=r,e[4]=l):l=e[4],l}if(n==="in_progress"){let r;e[5]!==o?(r=o("chat.todoStatus.inProgress"),e[5]=o,e[6]=r):r=e[6];let i;return e[7]!==r?(i=s.jsx("span",{"aria-label":r,className:"inline-block w-2 h-2 rounded-full bg-primary animate-pulse shrink-0"}),e[7]=r,e[8]=i):i=e[8],i}let V;e[9]!==o?(V=o("chat.todoStatus.pending"),e[9]=o,e[10]=V):V=e[10];let a;return e[11]!==V?(a=s.jsx("span",{"aria-label":V,className:"inline-block w-3.5 h-3.5 rounded-sm border-[1.5px] border-muted-foreground/50 shrink-0"}),e[11]=V,e[12]=a):a=e[12],a}const Wo={usd:[{dollars:10,labelKey:"chat.creditsExhaustedBanner.tierStarter"},{dollars:20,labelKey:"chat.creditsExhaustedBanner.tierPopular"},{dollars:100,labelKey:"chat.creditsExhaustedBanner.tierBestValue"}],brl:[{dollars:50,labelKey:"chat.creditsExhaustedBanner.tierStarter"},{dollars:100,labelKey:"chat.creditsExhaustedBanner.tierPopular"},{dollars:500,labelKey:"chat.creditsExhaustedBanner.tierBestValue"}]},Zo=["chat.creditsExhaustedBanner.benefit1","chat.creditsExhaustedBanner.benefit2","chat.creditsExhaustedBanner.benefit3"];function Jo(t){const e=L.c(65),{onDismiss:n}=t,{org:o}=Te(),V=ct(),{decoKeyId:a}=xn(),r=Xt(),i=G(),[l,m]=$.useState(""),[d,c]=$.useState(!1),[u,p]=$.useState("usd"),h=u==="brl"?"R$":"$";let f,x;e[0]!==o.id?(f=()=>{ee("credits_exhausted_shown",{organization_id:o.id})},x=[o.id],e[0]=o.id,e[1]=f,e[2]=x):(f=e[1],x=e[2]),$.useEffect(f,x);let A;e[3]!==u||e[4]!==r?(A=async w=>{const{url:O}=await r.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:w,currency:u});return O},e[3]=u,e[4]=r,e[5]=A):A=e[5];let b;e[6]!==n?(b=w=>{w&&window.open(w,"_blank","noopener,noreferrer"),n?.()},e[6]=n,e[7]=b):b=e[7];let v;e[8]!==i?(v=w=>{je.error(i("chat.creditsExhaustedBanner.topupError",{error:w.message}))},e[8]=i,e[9]=v):v=e[9];let g;e[10]!==A||e[11]!==b||e[12]!==v?(g={mutationFn:A,onSuccess:b,onError:v},e[10]=A,e[11]=b,e[12]=v,e[13]=g):g=e[13];const{mutate:C,isPending:j}=es(g),y=parseFloat(l),N=!isNaN(y)&&y>=1;let k;e[14]!==n?(k=w=>!w&&n?.(),e[14]=n,e[15]=k):k=e[15];let S;e[16]===Symbol.for("react.memo_cache_sentinel")?(S=["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[16]=S):S=e[16];let _;e[17]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("div",{className:"absolute inset-x-0 top-0 h-36 pointer-events-none",style:{backgroundImage:S.join(", "),maskImage:"linear-gradient(to bottom, black 0%, transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black 0%, transparent 100%)"}}),e[17]=_):_=e[17];let I;e[18]===Symbol.for("react.memo_cache_sentinel")?(I=s.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[18]=I):I=e[18];let D;e[19]!==i?(D=i("chat.creditsExhaustedBanner.title"),e[19]=i,e[20]=D):D=e[20];let T;e[21]!==D?(T=s.jsx(dn,{className:"text-xl font-semibold tracking-tight",children:D}),e[21]=D,e[22]=T):T=e[22];let z;e[23]!==i?(z=i("chat.creditsExhaustedBanner.description"),e[23]=i,e[24]=z):z=e[24];let E;e[25]!==z?(E=s.jsx(un,{className:"mt-1.5 text-sm leading-relaxed",children:z}),e[25]=z,e[26]=E):E=e[26];let P;e[27]!==T||e[28]!==E?(P=s.jsxs("div",{className:"relative px-8 pt-8 pb-2 overflow-hidden",children:[_,s.jsxs(mn,{className:"relative gap-4",children:[I,s.jsxs("div",{children:[T,E]})]})]}),e[27]=T,e[28]=E,e[29]=P):P=e[29];let R;e[30]!==u||e[31]!==h||e[32]!==l||e[33]!==y||e[34]!==a||e[35]!==N||e[36]!==j||e[37]!==d||e[38]!==i||e[39]!==C?(R=a&&s.jsxs("div",{className:"px-8 pt-5 pb-6",children:[s.jsx("div",{className:"mb-4",children:s.jsxs(cn,{type:"single",variant:"outline",size:"sm",value:u,onValueChange:w=>{w&&p(w)},children:[s.jsx(Je,{value:"usd",className:"h-8 px-3 text-xs",children:"USD"}),s.jsx(Je,{value:"brl",className:"h-8 px-3 text-xs",children:"BRL"})]})}),s.jsxs("div",{className:"rounded-xl border border-border p-5",children:[s.jsx("div",{className:"grid grid-cols-3 gap-2.5",children:Wo[u].map(w=>{const{dollars:O,labelKey:q}=w;return s.jsxs("button",{type:"button",disabled:j,onClick:()=>{ee("credits_topup_clicked",{amount_cents:O*100,currency:u,tier_label:q,source:"exhausted_banner"}),C(O*100)},className:K("relative flex flex-col items-center gap-1 py-5 rounded-xl border transition-all duration-150 cursor-pointer","disabled:opacity-50 disabled:cursor-wait","border-border hover:border-foreground/20 hover:bg-muted/30"),children:[s.jsxs("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:[h,O]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:i(q)})]},O)})}),d?s.jsxs("div",{className:"flex gap-2 mt-3",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:h}),s.jsx(hn,{type:"number",min:"1",step:"1",placeholder:i("chat.creditsExhaustedBanner.customPlaceholder"),value:l,onChange:w=>m(w.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(ne,{className:"h-10",disabled:!N||j,onClick:()=>{ee("credits_topup_clicked",{amount_cents:Math.round(y*100),currency:u,tier_label:"custom",source:"exhausted_banner"}),C(Math.round(y*100))},children:i(j?"chat.creditsExhaustedBanner.opening":"chat.creditsExhaustedBanner.add")})]}):s.jsx("button",{type:"button",className:"w-full mt-3 text-xs text-muted-foreground hover:text-foreground transition-colors py-1",onClick:()=>c(!0),children:i("chat.creditsExhaustedBanner.enterCustom")})]}),s.jsx("div",{className:"mt-5 rounded-xl bg-muted/25 border border-border/50 p-4 space-y-3",children:Zo.map(w=>s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"flex items-center justify-center size-5 rounded-full bg-[hsl(var(--chart-1))]/15 shrink-0",children:s.jsx($e,{size:12,className:"text-[hsl(var(--chart-1))]"})}),s.jsx("span",{className:"text-sm text-foreground/80",children:i(w)})]},w))})]}),e[30]=u,e[31]=h,e[32]=l,e[33]=y,e[34]=a,e[35]=N,e[36]=j,e[37]=d,e[38]=i,e[39]=C,e[40]=R):R=e[40];let U;e[41]!==i?(U=i("chat.creditsExhaustedBanner.dismiss"),e[41]=i,e[42]=U):U=e[42];let Y;e[43]!==n||e[44]!==U?(Y=s.jsx(ne,{variant:"ghost",size:"sm",onClick:n,children:U}),e[43]=n,e[44]=U,e[45]=Y):Y=e[45];let B;e[46]!==V||e[47]!==n||e[48]!==o.slug?(B=()=>{V({to:"/$org/settings/ai-providers",params:{org:o.slug}}),n?.()},e[46]=V,e[47]=n,e[48]=o.slug,e[49]=B):B=e[49];let F;e[50]!==i?(F=i("chat.creditsExhaustedBanner.manageProviders"),e[50]=i,e[51]=F):F=e[51];let M;e[52]!==B||e[53]!==F?(M=s.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:B,children:F}),e[52]=B,e[53]=F,e[54]=M):M=e[54];let H;e[55]!==Y||e[56]!==M?(H=s.jsxs("div",{className:"px-8 py-4 border-t border-border bg-muted/30 flex items-center justify-between",children:[Y,M]}),e[55]=Y,e[56]=M,e[57]=H):H=e[57];let W;e[58]!==P||e[59]!==R||e[60]!==H?(W=s.jsxs(pn,{className:"sm:max-w-[520px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:Xo,children:[P,R,H]}),e[58]=P,e[59]=R,e[60]=H,e[61]=W):W=e[61];let J;return e[62]!==W||e[63]!==k?(J=s.jsx(fn,{open:!0,onOpenChange:k,children:W}),e[62]=W,e[63]=k,e[64]=J):J=e[64],J}function Xo(t){return t.preventDefault()}const er={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 tr(t){const e=L.c(16),{kind:n,onDismiss:o,onSubscribe:V}=t,a=G(),{label:r,title:i}=er[n];let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(ht,{size:14}),e[0]=l):l=e[0];let m;e[1]!==r||e[2]!==a?(m=a(r),e[1]=r,e[2]=a,e[3]=m):m=e[3];let d;e[4]!==a||e[5]!==i?(d=a(i),e[4]=a,e[5]=i,e[6]=d):d=e[6];let c;e[7]!==n||e[8]!==V||e[9]!==a?(c=n==="trial_exhausted"?s.jsx(ne,{size:"sm",onClick:V,className:"h-7 text-xs",children:a("chat.subscriptionLimit.subscribeButton")}):void 0,e[7]=n,e[8]=V,e[9]=a,e[10]=c):c=e[10];let u;return e[11]!==o||e[12]!==m||e[13]!==d||e[14]!==c?(u=s.jsx(ue,{icon:l,label:m,title:d,defaultExpanded:!0,variant:"warning",onClose:o,footerRight:c}),e[11]=o,e[12]=m,e[13]=d,e[14]=c,e[15]=u):u=e[15],u}function sr(t){const e=t.trim(),n=e.startsWith("<")&&/<[a-z][\s\S]*>/i.test(e),o=/cloudflare|cf-[a-z-]+|error[\s_-]?code[\s_-]?5\d\d/i.test(e),V=/failed to fetch|networkerror|load failed|offline/i.test(e),a=/timeout|timed out|aborted|deadline/i.test(e),r=e.length>240,i=/sandbox failed to start(?::\s*(.+))?/is.exec(e);if(i){const l=i[1]?.trim().replace(/\.$/,"");return{summary:l?`Your sandbox didn't finish starting up (${l}). Try again.`:"Your sandbox didn't finish starting up. Try again.",rawDetails:t}}return o||n&&r?{summary:"Our servers are having a moment. Try sending again in a few seconds.",rawDetails:t}:V?{summary:"Lost connection. Check your network and try again.",rawDetails:t}:a?{summary:"That took longer than expected. Try again.",rawDetails:t}:n||r?{summary:"Something unexpected came back from the server. Try again.",rawDetails:t}:{summary:t,rawDetails:null}}const nr={length:"chat.highlight.warningDescriptionLength","content-filter":"chat.highlight.warningDescriptionContentFilter","tool-calls":"chat.highlight.warningDescriptionToolCalls"};function Ne(t){const e=L.c(29),n=G(),{variant:o,onDismiss:V}=t,a=o==="error";let r;e[0]!==a||e[1]!==n?(r=n(a?"chat.highlight.errorOccurred":"chat.highlight.responseIncomplete"),e[0]=a,e[1]=n,e[2]=r):r=e[2];const i=r,l=a?Ws:ss;let m;e[3]!==t.error||e[4]!==t.finishReason||e[5]!==t.variant||e[6]!==n?(m=t.variant==="error"?t.error.message:(()=>{const b=nr[t.finishReason];return b?n(b):n("chat.highlight.responseStoppedUnexpectedly",{reason:t.finishReason})})(),e[3]=t.error,e[4]=t.finishReason,e[5]=t.variant,e[6]=n,e[7]=m):m=e[7];const d=m;let c;e[8]!==a||e[9]!==d?(c=a?sr(d):{summary:d,rawDetails:null},e[8]=a,e[9]=d,e[10]=c):c=e[10];const{summary:u,rawDetails:p}=c;let h;e[11]!==l?(h=s.jsx(l,{size:14}),e[11]=l,e[12]=h):h=e[12];let f;e[13]!==a||e[14]!==t.onContinue||e[15]!==t.onFixInChat||e[16]!==n?(f=a?s.jsx(ne,{size:"sm",variant:"outline",onClick:t.onFixInChat,className:"h-7 text-xs",children:n("chat.highlight.fixInChat")}):s.jsx(ne,{size:"sm",variant:"outline",onClick:t.onContinue,className:"h-7 text-xs",children:n("chat.highlight.continue")}),e[13]=a,e[14]=t.onContinue,e[15]=t.onFixInChat,e[16]=n,e[17]=f):f=e[17];let x;e[18]!==p||e[19]!==n?(x=p?s.jsxs("details",{className:"group mx-4",children:[s.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:[s.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:s.jsx("path",{d:"m4.5 3 3 3-3 3"})}),s.jsx("span",{className:"group-open:hidden",children:n("chat.highlight.showTechnicalDetails")}),s.jsx("span",{className:"hidden group-open:inline",children:n("chat.highlight.hideTechnicalDetails")})]}),s.jsxs("div",{className:"relative mt-2",children:[s.jsx("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(p).then(()=>je.success(n("chat.highlight.copiedToClipboard"))).catch(()=>je.error(n("chat.highlight.couldNotCopy")))},"aria-label":n("chat.highlight.copyErrorDetails"),title:n("chat.highlight.copy"),className:"absolute right-1.5 top-1.5 z-10 flex h-6 w-6 items-center justify-center rounded-md bg-background/80 text-muted-foreground backdrop-blur-sm transition-colors hover:bg-background hover:text-foreground",children:s.jsx(Zs,{className:"size-3.5"})}),s.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:p})]})]}):null,e[18]=p,e[19]=n,e[20]=x):x=e[20];let A;return e[21]!==i||e[22]!==V||e[23]!==u||e[24]!==h||e[25]!==f||e[26]!==x||e[27]!==o?(A=s.jsx(ue,{icon:h,label:i,title:u,defaultExpanded:!0,variant:o,onClose:V,footerRight:f,children:x}),e[21]=i,e[22]=V,e[23]=u,e[24]=h,e[25]=f,e[26]=x,e[27]=o,e[28]=A):A=e[28],A}function Me(){const t=L.c(73),e=G(),{error:n,clearError:o,finishReason:V,clearFinishReason:a,messages:r,isStreaming:i,submit:l,sendMessage:m}=Ue(),[d,c]=be(),{virtualMcpId:u,createTaskWithMessage:p}=Ps(),{chatMode:h,simpleModeTier:f}=De(),{mutate:x}=vs("ORGANIZATION_BILLING_CHECKOUT_START","taskBoard.subscriptionPaywall.checkoutError");let A;t[0]!==x?(A=()=>x(),t[0]=x,t[1]=A):A=t[1];const b=A;let v;t[2]!==h||t[3]!==f||t[4]!==u?(v=oe=>({tier:f,mode:h,toolApprovalLevel:oe,agent:u?{id:u}:void 0}),t[2]=h,t[3]=f,t[4]=u,t[5]=v):v=t[5];const g=v;let C;t[6]!==d.toolApprovalLevel?(C=d.toolApprovalLevel??ts(),t[6]=d.toolApprovalLevel,t[7]=C):C=t[7];const j=C,y=r.at(-1),N=y?.role==="assistant"?y.parts:[],k=N.filter(ar),S=_t(N),_=It(N);let I;t[8]!==n||t[9]!==m||t[10]!==e?(I=()=>{if(n){const fe={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:e("chat.highlight.fixInChatMessage",{error:n.message})}]}]};m(fe)}},t[8]=n,t[9]=m,t[10]=e,t[11]=I):I=t[11];const D=I;let T;t[12]!==m||t[13]!==e?(T=()=>{const oe={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:e("chat.highlight.pleaseContinue")}]}]};m(oe)},t[12]=m,t[13]=e,t[14]=T):T=t[14];const z=T;let E;t[15]!==g||t[16]!==j||t[17]!==l?(E=(oe,fe)=>{l({kind:"toolOutput",toolCallId:oe.toolCallId,output:{response:fe}},g(j))},t[15]=g,t[16]=j,t[17]=l,t[18]=E):E=t[18];const P=E;let R;t[19]!==p||t[20]!==d||t[21]!==c||t[22]!==e||t[23]!==u?(R=oe=>{c({...d,toolApprovalLevel:"auto"}),p({virtualMcpId:u,message:{parts:[{type:"text",text:e("chat.highlight.implementPlanMessage",{plan:oe})}]}})},t[19]=p,t[20]=d,t[21]=c,t[22]=e,t[23]=u,t[24]=R):R=t[24];const U=R,Y=Vr;let B;t[25]!==g||t[26]!==l?(B=(oe,fe,Ae,ce)=>{l({kind:"approval",approvalId:oe,approved:fe,...Ae?{reason:Ae}:{}},g(ce))},t[25]=g,t[26]=l,t[27]=B):B=t[27];const F=B,M=Dt();if(M.isCreditExhausted){let oe;return t[28]!==o?(oe=s.jsx(Jo,{onDismiss:o}),t[28]=o,t[29]=oe):oe=t[29],oe}const{showError:H,showWarning:W,hasApprovals:J}=M,w=k.map(rr).join("|"),O=Tt(S)?.toolCallId??"",q=_.map(or).join("|");let Z;t[30]!==M.todos?(Z=s.jsx(Qo,{todos:M.todos}),t[30]=M.todos,t[31]=Z):Z=t[31];let X;t[32]!==o||t[33]!==M.subscriptionErrorKind||t[34]!==b?(X=M.subscriptionErrorKind&&s.jsx(tr,{kind:M.subscriptionErrorKind,onDismiss:o,onSubscribe:b}),t[32]=o,t[33]=M.subscriptionErrorKind,t[34]=b,t[35]=X):X=t[35];let te;t[36]!==o||t[37]!==n||t[38]!==D||t[39]!==H?(te=H&&s.jsx(Ne,{variant:"error",error:n,onDismiss:o,onFixInChat:D}),t[36]=o,t[37]=n,t[38]=D,t[39]=H,t[40]=te):te=t[40];let re;t[41]!==a||t[42]!==V||t[43]!==z||t[44]!==W?(re=W&&s.jsx(Ne,{variant:"warning",finishReason:V,onDismiss:a,onContinue:z}),t[41]=a,t[42]=V,t[43]=z,t[44]=W,t[45]=re):re=t[45];let Ve;t[46]!==q||t[47]!==F||t[48]!==J||t[49]!==i||t[50]!==_?(Ve=J&&s.jsx(So,{approvals:_,isStreaming:i,onRespond:F},q),t[46]=q,t[47]=F,t[48]=J,t[49]=i,t[50]=_,t[51]=Ve):Ve=t[51];let se;t[52]!==M.hasPlans||t[53]!==U||t[54]!==Y||t[55]!==i||t[56]!==S||t[57]!==O?(se=M.hasPlans&&s.jsx(Io,{plans:S,isStreaming:i,onApprove:U,onDismiss:Y},O),t[52]=M.hasPlans,t[53]=U,t[54]=Y,t[55]=i,t[56]=S,t[57]=O,t[58]=se):se=t[58];let ae;t[59]!==M.isWaitingForUserInput||t[60]!==P||t[61]!==i||t[62]!==w||t[63]!==k?(ae=M.isWaitingForUserInput&&s.jsx($t,{userAskParts:k,isStreaming:i,onSubmit:P},w),t[59]=M.isWaitingForUserInput,t[60]=P,t[61]=i,t[62]=w,t[63]=k,t[64]=ae):ae=t[64];let ie;return t[65]!==te||t[66]!==re||t[67]!==Ve||t[68]!==se||t[69]!==ae||t[70]!==Z||t[71]!==X?(ie=s.jsxs("div",{className:"absolute bottom-full left-0 right-0",children:[Z,X,te,re,Ve,se,ae]}),t[65]=te,t[66]=re,t[67]=Ve,t[68]=se,t[69]=ae,t[70]=Z,t[71]=X,t[72]=ie):ie=t[72],ie}function or(t){return t.approvalId}function rr(t){return t.toolCallId}function Vr(){document.querySelector("[data-chat-input]")?.focus()}function ar(t){return t.type==="tool-user_ask"}Me.Error=function(e){return s.jsx(Ne,{variant:"error",error:e.error,onDismiss:e.onDismiss,onFixInChat:e.onFixInChat})};Me.Warning=function(e){return s.jsx(Ne,{variant:"warning",finishReason:e.finishReason,onDismiss:e.onDismiss,onContinue:e.onContinue})};Me.UserAskQuestion=$t;function ir(t){const e=L.c(20),{taskId:n}=t,o=G(),V=Rs(n),a=Fs(V),r=Ls(),{stop:i,removeLocalMessage:l}=Ue();if(a.length===0)return null;let m;e[0]!==o?(m=o("chat.queueTray.sendNow"),e[0]=o,e[1]=m):m=e[1];let d;e[2]!==i?(d=()=>{i()},e[2]=i,e[3]=d):d=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(pt,{size:14}),e[4]=c):c=e[4];let u;e[5]!==m||e[6]!==d?(u=s.jsx(Se,{asChild:!0,children:s.jsx(ne,{type:"button",variant:"ghost",size:"icon-sm","aria-label":m,onClick:d,children:c})}),e[5]=m,e[6]=d,e[7]=u):u=e[7];let p;e[8]!==o?(p=o("chat.queueTray.sendNow"),e[8]=o,e[9]=p):p=e[9];let h;e[10]!==p?(h=s.jsx(ke,{side:"top",children:s.jsx("p",{className:"text-xs",children:p})}),e[10]=p,e[11]=h):h=e[11];let f;e[12]!==u||e[13]!==h?(f=s.jsxs(Ie,{delayDuration:400,children:[u,h]}),e[12]=u,e[13]=h,e[14]=f):f=e[14];let x;return e[15]!==r||e[16]!==l||e[17]!==o||e[18]!==n?(x=(A,b)=>s.jsxs("div",{className:"group/queuerow flex items-center gap-2 px-3 py-1.5",children:[s.jsx("span",{className:"flex size-[18px] shrink-0 items-center justify-center rounded-full bg-muted text-[10px] font-semibold text-muted-foreground dark:bg-background",children:b+1}),s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:A.text}),s.jsx("div",{className:"flex shrink-0 items-center gap-1 opacity-0 transition-opacity focus-within:opacity-100 group-hover/queuerow:opacity-100",children:s.jsx(ne,{type:"button",variant:"ghost",size:"icon-sm",title:o("chat.queueTray.removeFromQueue"),"aria-label":o("chat.queueTray.removeFromQueue"),onClick:()=>{r.cancel(n,A.messageId).then(v=>{v&&(zs(n,A.messageId),l(A.messageId))})},children:s.jsx(An,{className:"size-3.5"})})})]},A.messageId),e[15]=r,e[16]=l,e[17]=o,e[18]=n,e[19]=x):x=e[19],s.jsxs("div",{className:"mb-1 overflow-hidden rounded-2xl border border-border bg-card dark:bg-muted",children:[s.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:[s.jsx("span",{children:o(a.length===1?"chat.queueTray.queuedMessage":"chat.queueTray.queuedMessages",{count:a.length})}),f]}),a.map(x)]})}function lr(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 cr={fast:"chat.tierTrigger.tierFast",smart:"chat.tierTrigger.tierSmart",thinking:"chat.tierTrigger.tierThinking"};function dr(t){const e=L.c(31),{tier:n,orgSlot:o,userSlot:V,autoSlot:a,onPick:r,onReset:i,onClose:l}=t,m=G(),d=Nt(),c=new Set(d.map(ur)),u=Bs([V,o,a],c),p=u?.keyId??null,[h,f]=$.useState(p??d[0]?.id??null),x=d.some(R=>R.id===h)?h:p??d[0]?.id??null,A=x?d.find(R=>R.id===x):null,b="flex h-[70vh] max-h-[460px] w-full flex-col",v=cr[n];let g;e[0]!==m||e[1]!==v?(g=m(v),e[0]=m,e[1]=v,e[2]=g):g=e[2];let C;e[3]!==g?(C=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:g}),e[3]=g,e[4]=C):C=e[4];let j;e[5]!==i||e[6]!==m||e[7]!==V?(j=V&&s.jsx("button",{type:"button",onClick:i,className:"text-xs text-muted-foreground hover:text-foreground px-2 py-1 rounded-md hover:bg-accent cursor-pointer",children:m("chat.modelPreferences.reset")}),e[5]=i,e[6]=m,e[7]=V,e[8]=j):j=e[8];let y;e[9]!==C||e[10]!==j?(y=s.jsxs("div",{className:"flex items-center justify-between px-3 h-8 shrink-0",children:[C,j]}),e[9]=C,e[10]=j,e[11]=y):y=e[11];const N="flex-1 min-h-0",k=$.Suspense;let S;e[12]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(vn,{}),e[12]=S):S=e[12];const _=_n,I=!0,D=lr(p?u:null,A?.providerId??"deco");let T;e[13]!==x||e[14]!==r||e[15]!==f?(T=R=>{const U=R.keyId??x??"";f(U),r({keyId:U,modelId:R.modelId,title:R.title})},e[13]=x,e[14]=r,e[15]=f,e[16]=T):T=e[16];let z;e[17]!==_||e[18]!==x||e[19]!==l||e[20]!==f||e[21]!==D||e[22]!==T?(z=s.jsx(_,{compact:I,onClose:l,credentialId:x,onCredentialChange:f,selectedModel:D,onModelChange:T}),e[17]=_,e[18]=x,e[19]=l,e[20]=f,e[21]=D,e[22]=T,e[23]=z):z=e[23];let E;e[24]!==k||e[25]!==z||e[26]!==S?(E=s.jsx("div",{className:N,children:s.jsx(k,{fallback:S,children:z})}),e[24]=k,e[25]=z,e[26]=S,e[27]=E):E=e[27];let P;return e[28]!==E||e[29]!==y?(P=s.jsxs("div",{className:b,children:[y,E]}),e[28]=E,e[29]=y,e[30]=P):P=e[30],P}function ur(t){return t.id}const mr=["fast","smart","thinking"];function Ut(t){return{fast:t("chat.tierTrigger.tierFast"),smart:t("chat.tierTrigger.tierSmart"),thinking:t("chat.tierTrigger.tierThinking")}}const pr={fast:"chat.agentModels.quickerResponses",smart:"chat.agentModels.balancedQuality",thinking:"chat.agentModels.deeperReasoning"};function fr(t){const e=L.c(28),{tier:n,pillIcon:o,groups:V}=t,a=G();let r;e[0]!==a?(r=Ut(a),e[0]=a,e[1]=r):r=e[1];const i=r,[l,m]=$.useState(!1);let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=N=>{N.onSelect(),m(!1)},e[2]=d):d=e[2];const c=d,u=i[n];let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p=K("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),e[3]=p):p=e[3];let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=K("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]=h):h=e[4];const f=i[n];let x;e[5]!==f?(x=s.jsx("span",{className:h,children:f}),e[5]=f,e[6]=x):x=e[6];let A;e[7]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(jt,{size:12,className:"opacity-60 hidden @[320px]/chat-bottom:inline-block"}),e[7]=A):A=e[7];let b;e[8]!==o||e[9]!==u||e[10]!==x?(b=s.jsx(Se,{asChild:!0,children:s.jsx("span",{className:"inline-flex min-w-0 shrink",children:s.jsx(yt,{asChild:!0,children:s.jsxs(ne,{type:"button",variant:"ghost",size:"default","aria-label":u,className:p,children:[o,x,A]})})})}),e[8]=o,e[9]=u,e[10]=x,e[11]=b):b=e[11];let v;e[12]!==u?(v=s.jsx(ke,{children:u}),e[12]=u,e[13]=v):v=e[13];let g;e[14]!==b||e[15]!==v?(g=s.jsxs(Ie,{children:[b,v]}),e[14]=b,e[15]=v,e[16]=g):g=e[16];let C;if(e[17]!==V||e[18]!==a){let N;e[20]!==a?(N=k=>s.jsx("div",{className:"flex flex-col",children:k.rows.map(S=>s.jsxs("div",{className:"group/tier-row relative flex items-stretch rounded-md hover:bg-muted",children:[s.jsxs("button",{type:"button",role:"menuitem","aria-label":S.title,onClick:()=>c(S),className:K("flex flex-1 min-w-0 items-start gap-2 px-2 py-1.5 text-left",S.modelOverride&&"pr-7 [@media(hover:hover)]:pr-2"),children:[S.icon&&s.jsx("span",{className:"shrink-0 text-muted-foreground mt-0.5",children:S.icon}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"text-sm",children:S.title}),S.subtitle&&s.jsx("div",{className:"text-xs text-muted-foreground",children:S.subtitle})]}),S.active&&s.jsx("span",{title:a("chat.tierTrigger.selected"),children:s.jsx($e,{size:14,className:"text-foreground mt-0.5"})})]}),S.modelOverride&&s.jsx(xr,{label:S.title,render:S.modelOverride})]},S.key))},k.key),e[20]=a,e[21]=N):N=e[21],C=V.map(N),e[17]=V,e[18]=a,e[19]=C}else C=e[19];let j;e[22]!==C?(j=s.jsx(wt,{align:"end",className:"p-1 w-64",onOpenAutoFocus:hr,children:s.jsx("div",{role:"menu",className:"flex flex-col",children:C})}),e[22]=C,e[23]=j):j=e[23];let y;return e[24]!==l||e[25]!==g||e[26]!==j?(y=s.jsxs(Ct,{open:l,onOpenChange:m,children:[g,j]}),e[24]=l,e[25]=g,e[26]=j,e[27]=y):y=e[27],y}function hr(t){return t.preventDefault()}function xr(t){const e=L.c(38),{label:n,render:o}=t,V=G(),a=ns(),[r,i]=$.useState(!1);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>i(!1),e[0]=l):l=e[0];const m=l;let d;e[1]!==n||e[2]!==V?(d=V("chat.modelPreferences.customizeModel",{tier:n}),e[1]=n,e[2]=V,e[3]=d):d=e[3];const c=r&&"opacity-100";let u;e[4]!==c?(u=K("absolute right-1 top-1/2 -translate-y-1/2 flex items-center justify-center","size-6 rounded-md bg-background border border-border/60 shadow-sm","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",c),e[4]=c,e[5]=u):u=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Is,{size:14}),e[6]=p):p=e[6];let h;e[7]!==d||e[8]!==u?(h=s.jsx("button",{type:"button","aria-label":d,className:u,children:p}),e[7]=d,e[8]=u,e[9]=h):h=e[9];const f=h;if(a){let g;e[10]!==f?(g=s.jsx(wn,{asChild:!0,children:f}),e[10]=f,e[11]=g):g=e[11];let C;e[12]!==n||e[13]!==V?(C=V("chat.modelPreferences.customizeModel",{tier:n}),e[12]=n,e[13]=V,e[14]=C):C=e[14];let j;e[15]!==C?(j=s.jsx(Cn,{className:"sr-only",children:C}),e[15]=C,e[16]=j):j=e[16];let y;e[17]!==r||e[18]!==o?(y=r&&o(m),e[17]=r,e[18]=o,e[19]=y):y=e[19];let N;e[20]!==y||e[21]!==j?(N=s.jsxs(Nn,{className:"p-0 flex flex-col max-h-[95vh]",children:[j,y]}),e[20]=y,e[21]=j,e[22]=N):N=e[22];let k;return e[23]!==r||e[24]!==N||e[25]!==g?(k=s.jsxs(Sn,{open:r,onOpenChange:i,children:[g,N]}),e[23]=r,e[24]=N,e[25]=g,e[26]=k):k=e[26],k}let x;e[27]!==f?(x=s.jsx(yt,{asChild:!0,children:f}),e[27]=f,e[28]=x):x=e[28];let A;e[29]!==r||e[30]!==o?(A=r&&o(m),e[29]=r,e[30]=o,e[31]=A):A=e[31];let b;e[32]!==A?(b=s.jsx(wt,{side:"right",align:"start",collisionPadding:12,className:"w-[min(22rem,calc(100vw-2rem))] p-0 overflow-hidden",children:A}),e[32]=A,e[33]=b):b=e[33];let v;return e[34]!==r||e[35]!==x||e[36]!==b?(v=s.jsxs(Ct,{open:r,onOpenChange:i,children:[x,b]}),e[34]=r,e[35]=x,e[36]=b,e[37]=v):v=e[37],v}function lt(t){return t==="fast"?s.jsx(ht,{size:16}):t==="thinking"?s.jsx(ks,{size:16}):s.jsx(kn,{size:16})}function gr(t){const e=L.c(13),n=Os();let o;e[0]!==t||e[1]!==n.tiers?(o=m=>{const d=n.tiers[m];return d?d.title??d.modelId:t.chat[m]?.title},e[0]=t,e[1]=n.tiers,e[2]=o):o=e[2];const V=o;let a;e[3]!==V?(a=V("fast"),e[3]=V,e[4]=a):a=e[4];let r;e[5]!==V?(r=V("smart"),e[5]=V,e[6]=r):r=e[6];let i;e[7]!==V?(i=V("thinking"),e[7]=V,e[8]=i):i=e[8];let l;return e[9]!==a||e[10]!==r||e[11]!==i?(l={fast:a,smart:r,thinking:i},e[9]=a,e[10]=r,e[11]=i,e[12]=l):l=e[12],l}function br(){const t=L.c(22),e=G(),{simpleModeTier:n,setSimpleModeTier:o}=De(),V=In(),a=Nt(),r=Tn(a),i=gr(r),{data:l,error:m}=$s();let d;t[0]!==l?(d=l===void 0?{tiers:{}}:l,t[0]=l,t[1]=d):d=t[1];const c=d,u=Us();let p,h;if(t[2]!==r||t[3]!==V||t[4]!==o||t[5]!==e||t[6]!==n||t[7]!==i||t[8]!==u||t[9]!==c||t[10]!==m){const v=Ut(e);p="decopilot",h=mr.map(g=>{const C=i[g],j=c.tiers[g];return{key:`decopilot-${g}`,icon:lt(g),title:v[g],subtitle:C??e(pr[g]),active:n===g,onSelect:()=>o(g),modelOverride:y=>s.jsxs(s.Fragment,{children:[m&&s.jsx("div",{className:"text-xs text-destructive p-3 pb-0",children:e("chat.modelPreferences.loadFailed")}),s.jsx(dr,{tier:g,orgSlot:V.tiers[g],userSlot:j,autoSlot:r.chat[g],onClose:y,onPick:N=>u.mutate({tier:g,slot:N}),onReset:()=>u.mutate({tier:g,slot:null})},`${g}:${j?.keyId??"org"}:${j?.modelId??""}`)]})}}),t[2]=r,t[3]=V,t[4]=o,t[5]=e,t[6]=n,t[7]=i,t[8]=u,t[9]=c,t[10]=m,t[11]=p,t[12]=h}else p=t[11],h=t[12];let f;t[13]!==p||t[14]!==h?(f=[{key:p,rows:h}],t[13]=p,t[14]=h,t[15]=f):f=t[15];const x=f;let A;t[16]!==n?(A=lt(n),t[16]=n,t[17]=A):A=t[17];let b;return t[18]!==x||t[19]!==A||t[20]!==n?(b=s.jsx(fr,{tier:n,pillIcon:A,groups:x}),t[18]=x,t[19]=A,t[20]=n,t[21]=b):b=t[21],b}function Ot(t){const e=L.c(3),[n]=be();let o;return e[0]!==n.enableSounds||e[1]!==t?(o=()=>{n.enableSounds&&Gn(t.dataUri).catch(a=>{console.warn(`[sound] ${t.name} playback failed:`,a)})},e[0]=n.enableSounds,e[1]=t,e[2]=o):o=e[2],o}const Ar={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"},vr=fs.togglePlanMode.keys.map(t=>t==="Shift"?"⇧":t).join(""),jr=[{src:"/connections/gmail.png",name:"Gmail"},{src:"/connections/perplexity.png",name:"Perplexity"},{src:"/connections/github.png",name:"GitHub"}];function yr(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex items-center -space-x-1.5",children:jr.map(wr)}),t[0]=e):e=t[0],e}function wr(t){return s.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-1 ring-border object-cover bg-white"},t.name)}function Cr({disabled:t,onOpenConnections:e,virtualMcpId:n,selectedModel:o,isStreaming:V,onUnsupportedFile:a}){const r=G(),[i,l]=$.useState(!1),m=Ot(Ar),{org:d}=Te(),{editor:c}=ut(),u=$.useRef(null),p=Ye(o),h=()=>{!p||V||(l(!1),u.current?.click())},f=async w=>{const O=w.target.files;if(!O||O.length===0||!c)return;const q=Array.from(O);try{let Z=c.state.selection.from;for(const X of q)await St(c,o??null,X,Z,a,r),Z=c.state.selection.to}finally{u.current&&(u.current.value="")}},x=Ln({connectionId:n,orgId:d.id,orgSlug:d.slug}),A=os.virtualMcpPrompts(n,d.id),{data:b,isLoading:v}=rs({queryKey:A,queryFn:()=>zn(x),staleTime:6e4,enabled:i&&!!x}),g=b?.prompts??[],[C,j]=$.useState(null),{chatMode:y,setChatMode:N}=De(),[k,S]=be(),_=me.find(w=>w.value===k.toolApprovalLevel)??me[0],I=r(_.shortKey),D=w=>{const O=me.find(q=>q.value===w);if(O){if(O.value===k.toolApprovalLevel){l(!1);return}m(),ee("chat_approval_level_changed",{from_level:k.toolApprovalLevel,to_level:O.value,source:"tools_popover"}),S({...k,toolApprovalLevel:O.value}),l(!1)}},T=y==="plan",z=()=>{m();const w=T?"default":"plan";ee("chat_mode_changed",{from_mode:y,to_mode:w,source:"tools_popover"}),N(w),l(!1)},E=()=>{e(),l(!1)},P=async(w,O)=>{if(!c||!x)return;const q=Xe(w._meta),Z={from:c.state.selection.from,to:c.state.selection.to};try{const X=await Bn(x,w.name,O);ps(c,Z,{id:w.name,name:Fn(w.name,q),metadata:X.messages,char:"/",kind:"prompt",args:O})}catch{je.error(r("chat.toolsPopover.failedLoadPrompt"))}},R=async w=>{l(!1);const O=!!(w.arguments&&w.arguments.length>0);if(ee("chat_prompt_inserted",{prompt_name:w.name,with_arguments:O}),O){j(w);return}await P(w)},U=async w=>{C&&(await P(C,w),j(null))},Y=()=>{m();const w=y==="gen-image"?"default":"gen-image";ee("chat_mode_changed",{from_mode:y,to_mode:w,source:"tools_popover"}),N(w),l(!1)},B=()=>{m();const w=y==="web-search"?"default":"web-search";ee("chat_mode_changed",{from_mode:y,to_mode:w,source:"tools_popover"}),N(w),l(!1)},F=()=>{m();const w=y==="deep-research"?"default":"deep-research";ee("chat_mode_changed",{from_mode:y,to_mode:w,source:"tools_popover"}),N(w),l(!1)},M=y==="gen-image",H=y==="web-search",W=y==="deep-research",J=s.jsx("input",{ref:u,type:"file",multiple:!0,accept:jn(o??null),className:"hidden",onChange:f,disabled:V});return s.jsxs(s.Fragment,{children:[J,s.jsxs($n,{open:i,onOpenChange:w=>{w&&!i&&ee("chat_tools_popover_opened",{chat_mode:y}),l(w)},children:[s.jsx(Un,{asChild:!0,children:s.jsxs(ne,{type:"button",variant:"ghost",size:"default",disabled:t,title:r("chat.toolsPopover.tools"),"aria-label":r("chat.toolsPopover.tools"),className:K("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),children:[s.jsx(Ts,{size:14}),s.jsx("span",{className:K("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:r("chat.toolsPopover.tools")})]})}),s.jsxs(On,{align:"start",className:"w-56 p-1.5 space-y-1",children:[p?s.jsxs(de,{onClick:h,disabled:V,children:[s.jsx(nt,{size:16}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.addFile")})]}):s.jsxs(Ie,{children:[s.jsx(Se,{asChild:!0,children:s.jsxs(de,{"aria-disabled":"true",className:"opacity-50 cursor-not-allowed",onSelect:w=>w.preventDefault(),children:[s.jsx(nt,{size:16}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.addFile")})]})}),s.jsx(ke,{side:"right",children:r("chat.toolsPopover.modelNoFileSupport")})]}),s.jsxs(de,{onClick:z,className:K(T&&"text-special"),children:[s.jsx(xt,{size:16,className:K(T&&"text-special")}),s.jsx("span",{className:"flex-1 whitespace-nowrap",children:r("chat.toolsPopover.planMode")}),s.jsx("span",{className:K("text-xs text-muted-foreground",T&&"text-special font-medium"),children:vr})]}),s.jsxs(de,{onClick:Y,className:K(M&&"text-special"),children:[s.jsx(At,{size:16,className:K(M&&"text-special")}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.createImage")}),M&&s.jsx("span",{className:"text-xs text-special font-medium",children:r("chat.toolsPopover.on")})]}),s.jsxs(de,{onClick:B,className:K(H&&"text-special"),children:[s.jsx(gt,{size:16,className:K(H&&"text-special")}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.webSearch")}),H&&s.jsx("span",{className:"text-xs text-special font-medium",children:r("chat.toolsPopover.on")})]}),s.jsxs(de,{onClick:F,className:K(W&&"text-special"),children:[s.jsx(bt,{size:16,className:K(W&&"text-special")}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.deepResearch")}),W&&s.jsx("span",{className:"text-xs text-special font-medium",children:r("chat.toolsPopover.on")})]}),s.jsxs(et,{children:[s.jsxs(tt,{className:"gap-2",children:[s.jsx("span",{className:"flex size-4 items-center justify-center text-base font-medium text-muted-foreground",children:"/"}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.prompts")})]}),s.jsx(st,{className:"w-80 max-h-72 overflow-y-auto p-1.5",children:v?s.jsxs("div",{className:"flex items-center gap-2 px-2 py-3 text-sm text-muted-foreground",children:[s.jsx(Vs,{className:"size-3.5"}),r("chat.toolsPopover.loadingPrompts")]}):g.length===0?s.jsx("div",{className:"px-2 py-3 text-sm text-muted-foreground",children:r("chat.toolsPopover.noPromptsAvailable")}):g.map(w=>s.jsxs(de,{onClick:()=>R(w),className:"flex flex-col items-start gap-0.5",children:[s.jsx("span",{className:"font-medium text-sm capitalize",children:w.title||Rn(w.name,Xe(w._meta))}),w.description&&s.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:w.description})]},w.name))})]}),s.jsxs(et,{children:[s.jsxs(tt,{className:"gap-2",children:[s.jsx(_e,{size:16}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.approval")}),s.jsx("span",{className:"text-xs text-muted-foreground",children:I})]}),s.jsx(st,{className:"w-48 p-1.5",children:s.jsx(Kn,{value:k.toolApprovalLevel,onValueChange:D,children:me.map(w=>s.jsx(Qn,{value:w.value,children:r(w.labelKey)},w.value))})})]}),s.jsxs(de,{onClick:E,children:[s.jsx(Yn,{size:16}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.connections")}),s.jsx($.Suspense,{children:s.jsx(yr,{})})]})]})]}),s.jsx(ms,{prompt:C,setPrompt:j,onSubmit:U})]})}const Nr=[{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 Sr(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex items-center -space-x-1",children:Nr.map(kr)}),t[0]=e):e=t[0],e}function kr(t){return s.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-2 ring-muted object-cover bg-white"},t.name)}function Ir(t){const e=L.c(10),{onClick:n}=t,o=G();let V;e[0]===Symbol.for("react.memo_cache_sentinel")?(V=K("group relative z-10 flex items-center gap-3 w-full px-4 py-3","rounded-b-2xl","cursor-pointer"),e[0]=V):V=e[0];let a;e[1]!==o?(a=o("chat.connectionsBanner.description"),e[1]=o,e[2]=a):a=e[2];let r;e[3]!==a?(r=s.jsx("p",{className:"flex-1 text-xs text-muted-foreground truncate text-left",children:a}),e[3]=a,e[4]=r):r=e[4];let i,l;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Sr,{}),l=s.jsx(Jn,{size:14,className:"shrink-0 text-muted-foreground/60 group-hover:text-muted-foreground transition-colors"}),e[5]=i,e[6]=l):(i=e[5],l=e[6]);let m;return e[7]!==n||e[8]!==r?(m=s.jsxs("button",{type:"button",onClick:n,className:V,children:[r,i,l]}),e[7]=n,e[8]=r,e[9]=m):m=e[9],m}const ve=48;function Tr(){const t=L.c(9),[e,n]=$.useState("idle"),[o,V]=$.useState(""),[a,r]=$.useState(""),[i,l]=$.useState(Mr),m=$.useRef(null),d=$.useRef(null),c=$.useRef(null),u=$.useRef(null),p=$.useRef(0),h=$.useRef(!1),f=$.useRef(""),x=$.useRef(""),A=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition);let b;t[0]===Symbol.for("react.memo_cache_sentinel")?(b=()=>{p.current&&(cancelAnimationFrame(p.current),p.current=0),d.current?.close().catch(Dr),u.current?.getTracks().forEach(_r),c.current=null,d.current=null,u.current=null},t[0]=b):b=t[0];const v=b;let g;if(t[1]===Symbol.for("react.memo_cache_sentinel")){const _=I=>{u.current=I;const D=new AudioContext;d.current=D;const T=D.createMediaStreamSource(I),z=D.createAnalyser();z.fftSize=128,z.smoothingTimeConstant=.8,T.connect(z),c.current=z;const E=new Uint8Array(z.frequencyBinCount),P=()=>{if(!c.current)return;c.current.getByteFrequencyData(E);const R=[];for(let U=0;U<ve;U++){const Y=Math.floor(U/ve*E.length);R.push(Math.max(.04,(E[Y]??0)/255))}l(R),p.current=requestAnimationFrame(P)};P()};g=async()=>{const I=window.SpeechRecognition||window.webkitSpeechRecognition;if(!I)return n("unsupported"),"unsupported";let D;try{D=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{return n("permission-denied"),"permission-denied"}V(""),r(""),x.current="",f.current="",h.current=!0,n("recording"),_(D);const T=new I;m.current=T,T.interimResults=!0,T.continuous=!0,T.lang=navigator.language||"en-US",T.onresult=z=>{if(m.current!==T)return;let E="",P="";for(let R=z.resultIndex;R<z.results.length;R++){const U=z.results[R],Y=U?.[0]?.transcript??"";U?.isFinal?P=P+Y:E=E+Y}P&&(f.current=f.current+P,V(f.current)),x.current=E,r(E)},T.onerror=z=>{m.current===T&&z.error!=="no-speech"&&(h.current=!1,m.current=null,v(),n(z.error==="not-allowed"?"permission-denied":"idle"))},T.onend=()=>{if(m.current===T&&h.current)try{T.start()}catch{}};try{T.start()}catch{return h.current=!1,m.current=null,v(),n("idle"),"idle"}return"recording"},t[1]=g}else g=t[1];const C=g;let j;t[2]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{h.current=!1,m.current?.stop(),v(),n("idle"),l(Array(ve).fill(.05)),r("");const _=(f.current+(x.current?" "+x.current:"")).trim();return V(""),f.current="",x.current="",_},t[2]=j):j=t[2];const y=j;let N;t[3]===Symbol.for("react.memo_cache_sentinel")?(N=()=>{h.current=!1,m.current?.abort(),v(),n("idle"),V(""),r(""),l(Array(ve).fill(.05)),f.current="",x.current=""},t[3]=N):N=t[3];const k=N;let S;return t[4]!==a||t[5]!==e||t[6]!==o||t[7]!==i?(S={status:e,transcript:o,interimTranscript:a,waveformData:i,isSupported:A,startRecording:C,stopRecording:y,cancelRecording:k},t[4]=a,t[5]=e,t[6]=o,t[7]=i,t[8]=S):S=t[8],S}function _r(t){return t.stop()}function Dr(){}function Mr(){return Array(ve).fill(.05)}function Er(t){const e=L.c(4),{data:n}=t;let o;e[0]!==n?(o=n.map(Pr),e[0]=n,e[1]=o):o=e[1];let V;return e[2]!==o?(V=s.jsx("div",{className:"flex items-center justify-center gap-[2px] h-10 overflow-hidden","aria-hidden":"true",children:o}),e[2]=o,e[3]=V):V=e[3],V}function Pr(t,e){return s.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)}function Rr(t){return t.hasDraft?"send":t.isStreaming||t.isRunInProgress?"stop":"disabled"}function we(t){const e=L.c(7),{message:n,icon:o}=t;let V;e[0]!==o?(V=o??s.jsx(dt,{size:14,className:"shrink-0"}),e[0]=o,e[1]=V):V=e[1];const a=n??"";let r;e[2]!==a?(r=s.jsx("span",{className:"text-sm",children:a}),e[2]=a,e[3]=r):r=e[3];let i;return e[4]!==V||e[5]!==r?(i=s.jsxs("div",{className:"flex w-full items-center gap-2 px-3 py-2.5 rounded-xl border border-border bg-muted/40 text-muted-foreground",children:[V,r]}),e[4]=V,e[5]=r,e[6]=i):i=e[6],i}function Fr(t,e,n){const o=L.c(7),{editor:V}=ut(),a=G(),[r,i]=$.useState(!1),l=$.useRef(0);let m,d;return o[0]!==n||o[1]!==V||o[2]!==e||o[3]!==t||o[4]!==a?(m=()=>{const c=f=>{f.dataTransfer?.types.includes("Files")&&(f.preventDefault(),l.current=l.current+1,i(!0))},u=f=>{f.preventDefault(),l.current=Math.max(0,l.current-1),l.current===0&&i(!1)},p=Lr,h=f=>{if(f.preventDefault(),l.current=0,i(!1),n||!V||!t||!Ye(t))return;const x=f.dataTransfer?.files;if(!x||x.length===0)return;const A=Array.from(x);(async()=>{let b=V.state.selection.from;for(const v of A)await St(V,t,v,b,e,a),b=V.state.selection.to})()};return window.addEventListener("dragenter",c),window.addEventListener("dragleave",u),window.addEventListener("dragover",p),window.addEventListener("drop",h),()=>{window.removeEventListener("dragenter",c),window.removeEventListener("dragleave",u),window.removeEventListener("dragover",p),window.removeEventListener("drop",h)}},d=[V,t,e,a,n],o[0]=n,o[1]=V,o[2]=e,o[3]=t,o[4]=a,o[5]=m,o[6]=d):(m=o[5],d=o[6]),$.useEffect(m,d),r}function Lr(t){t.dataTransfer?.types.includes("Files")&&t.preventDefault()}function zr(t){const e=L.c(14),{selectedModel:n}=t,o=G();let V,a,r;if(e[0]!==n||e[1]!==o){const{parts:m}=yn(n);e[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Es,{size:24}),e[5]=r):r=e[5],V="text-sm font-medium";let d;e[6]!==o?(d=c=>o(c),e[6]=o,e[7]=d):d=e[7],a=o("chat.input.dropFilesHere",{fileTypes:m.map(d).join(", ")}),e[0]=n,e[1]=o,e[2]=V,e[3]=a,e[4]=r}else V=e[2],a=e[3],r=e[4];let i;e[8]!==V||e[9]!==a?(i=s.jsx("span",{className:V,children:a}),e[8]=V,e[9]=a,e[10]=i):i=e[10];let l;return e[11]!==r||e[12]!==i?(l=s.jsxs(s.Fragment,{children:[r,i]}),e[11]=r,e[12]=i,e[13]=l):l=e[13],l}function Br(){const t=L.c(5),e=G();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(dt,{size:24}),t[0]=n):n=t[0];let o;t[1]!==e?(o=e("chat.input.modelCannotReadAttachments"),t[1]=e,t[2]=o):o=t[2];let V;return t[3]!==o?(V=s.jsxs(s.Fragment,{children:[n,s.jsx("span",{className:"text-sm font-medium",children:o})]}),t[3]=o,t[4]=V):V=t[4],V}function $r(t){const e=L.c(11),{selectedModel:n,onUnsupportedFile:o,disabled:V}=t,a=Fr(n,o,V);let r;e[0]!==n?(r=Ye(n),e[0]=n,e[1]=r):r=e[1];const i=r,l=a?"opacity-100":"opacity-0 pointer-events-none",m=i?"border-primary/40 text-primary/70":"border-destructive/30 text-destructive/70";let d;e[2]!==l||e[3]!==m?(d=K("absolute inset-0 z-20 rounded-xl flex flex-col items-center justify-center gap-2 bg-muted border-2 border-dashed transition-opacity",l,m),e[2]=l,e[3]=m,e[4]=d):d=e[4];let c;e[5]!==n||e[6]!==i?(c=i?s.jsx(zr,{selectedModel:n}):s.jsx(Br,{}),e[5]=n,e[6]=i,e[7]=c):c=e[7];let u;return e[8]!==d||e[9]!==c?(u=s.jsx("div",{className:d,children:c}),e[8]=d,e[9]=c,e[10]=u):u=e[10],u}function Ce(t){const e=L.c(14),{onClick:n,label:o,icon:V,colorClass:a,maxWidthClass:r}=t;let i;e[0]!==a?(i=K("flex items-center gap-1.5 h-8 rounded-lg px-2.5 text-sm font-medium group min-w-0 shrink animate-in fade-in duration-200",a),e[0]=a,e[1]=i):i=e[1];let l;e[2]!==r?(l=K("min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0 @[320px]/chat-bottom:opacity-100",r),e[2]=r,e[3]=l):l=e[3];let m;e[4]!==o||e[5]!==l?(m=s.jsx("span",{className:l,children:o}),e[4]=o,e[5]=l,e[6]=m):m=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(ze,{size:14,className:"shrink-0 hidden group-hover:block group-disabled:hidden"}),e[7]=d):d=e[7];let c;return e[8]!==V||e[9]!==o||e[10]!==n||e[11]!==i||e[12]!==m?(c=s.jsxs("button",{type:"button",onClick:n,title:o,"aria-label":o,className:i,children:[V,m,d]}),e[8]=V,e[9]=o,e[10]=n,e[11]=i,e[12]=m,e[13]=c):c=e[13],c}function Ur(){const t=L.c(6),e=ct(),{org:n,locator:o}=Te(),{create:V}=Hs();let a;return t[0]!==V||t[1]!==o||t[2]!==e||t[3]!==n.id||t[4]!==n.slug?(a=async r=>{const{tiptapDoc:i,virtualMcp:l,taskIntake:m}=r,d=m===void 0?!1:m,c=crypto.randomUUID(),u=l?.id??Re(n.id).id;gs(sessionStorage,o,c,{tiptapDoc:d&&i?po(i):i});try{await V({id:c,virtual_mcp_id:u})}catch{}const p={autosend:bs};d&&(p.sidepanel=!0,p.mainpanel=!1),cs(e,ds({org:n.slug,agentId:u,superAgentId:Re(n.id).id}),{search:()=>({...p,thread:c}),replace:!1})},t[0]=V,t[1]=o,t[2]=e,t[3]=n.id,t[4]=n.slug,t[5]=a):a=t[5],a}function KV({onOpenContextPanel:t,showConnectionsBanner:e=!1,homeTaskComposer:n=!1}){const o=G(),V=Ks(),a=Qs(),r=V?.messages??[],i=V?.isStreaming??!1,l=V?.isRunInProgress??!1,m=V?.stop??(()=>{}),d=a?.taskId??"",c=d||Cs,u=Ur(),{selectedModel:p,selectedVirtualMcp:h,isModelsLoading:f,tiptapDocRef:x,imageModel:A,webSearchModel:b,deepResearchModel:v,chatMode:g,setChatMode:C}=De(),{data:j}=as.useSession(),y=j?.user?.id,{org:N,locator:k}=Te(),[S,_]=is(ls.homeTaskMode(k),!0),I=n&&S,D=Re(N.id).id,T=xs(h?.id),z=Ns(T?.id).runtime==="cms",E=Ot(qn),[P,R]=$.useState(!1),{unsupportedFile:U,onUnsupportedFile:Y,clearUnsupportedFile:B}=Dn(),F=Tr(),M=$.useRef(void 0),H=async()=>{M.current=se;const Q=await F.startRecording();ee("chat_voice_started",{thread_id:d,outcome:Q==="recording"?"started":Q==="unsupported"?"unsupported":Q==="permission-denied"?"permission_denied":"unknown"})},W=()=>{ee("chat_voice_confirmed",{thread_id:d});const Q=F.stopRecording();ce.current?.syncVoiceText(M.current,Q),ce.current?.focus()},J=()=>{ee("chat_voice_cancelled",{thread_id:d}),F.cancelRecording(),ce.current?.restoreContent(M.current)};$.useEffect(()=>{if(F.status!=="recording")return;const Q=(F.transcript+(F.interimTranscript?" "+F.interimTranscript:"")).trim();ce.current?.syncVoiceText(M.current,Q)},[F.transcript,F.interimTranscript,F.status]);const w=a?.activeTask??null,O=w?.created_by,q=!!(y&&O&&O!==y),{data:Z}=Wn({enabled:q}),X=(Z?.data?.members??[]).find(Q=>Q.userId===O),te=X?.user?.name??X?.user?.email?.split("@")[0]??null,re=Xn(),Ve=Ys({isDesktopApp:re,harnessId:w?.harness_id}),[se,ae]=$.useState(()=>Ze(sessionStorage,k,c)??void 0),ie=Q=>{ae(Q),x.current=Q,ws(sessionStorage,k,c,Q,{onQuotaExceeded:({docSizeBytes:le})=>{ee("chat_draft_quota_exceeded",{thread_id:d||null,doc_size_bytes:le}),console.warn("[chat-draft] sessionStorage quota exceeded; draft not saved")}})},oe=$.useRef(d);if(oe.current!==d){oe.current=d;const Q=Ze(sessionStorage,k,c)??void 0;ae(Q),x.current=Q}const Ae=[...r].reverse().find(Q=>Q.role==="assistant")?.metadata?.modelLimits?.contextWindow??p?.limits?.contextWindow,ce=$.useRef(null),Ge=$.useRef(!1),Kt=g==="plan",ye=Q=>{E(),ee("chat_mode_changed",{from_mode:Q,to_mode:"default",source:"pill_dismiss"}),C("default")};$.useEffect(()=>{const Q=le=>{hs(le)&&le.code==="KeyL"&&(le.preventDefault(),le.shiftKey&&C(g==="plan"?"default":"plan"),ce.current?.focus())};return document.addEventListener("keydown",Q),()=>document.removeEventListener("keydown",Q)},[g,C]);const Qt=rn(r),qe=[...r].reverse().find(Q=>Q.role==="assistant"&&Q.metadata?.usage)?.metadata?.usage?.contextTokens??0,Yt=!f&&!js(se),he=Rr({hasDraft:Yt,isStreaming:i,isRunInProgress:l}),Ee=he==="send",xe=he==="stop",He=Q=>{if(Q?.preventDefault(),he==="send"&&se){if(ee("chat_message_sent",{thread_id:d||null,mode:g,model_id:p?.modelId??null,model_provider:p?.providerId??null,virtual_mcp_id:h?.id??null,submission:Q?"button_or_enter":"programmatic"}),V){if(V.isSendInFlight()){je.info(o("chat.input.stillSendingPreviousMessage"));return}V.sendMessage(se)}else I&&ee("task_report_submitted",{source:"home"}),u({tiptapDoc:se,virtualMcp:I?null:h,taskIntake:I});ys(sessionStorage,k,c),ie(void 0)}else he==="stop"&&(ee("chat_message_stopped",{thread_id:d}),m())};if(q)return s.jsx(we,{message:te?o("chat.input.readOnlyOthersChatNamed",{name:te}):o("chat.input.readOnlyOthersChat"),icon:te?s.jsx(Hn,{shape:"circle",size:"2xs",url:X?.user?.image??void 0,fallback:te.slice(0,2).toUpperCase()}):void 0});if(w?.metadata?.read_only)return s.jsx(we,{message:o("chat.input.readOnlyThread")});if(Ve)return s.jsx(we,{message:o("chat.input.codingAgentRequiresDesktop")});if(z){if(!a)return s.jsx(we,{message:o("chat.input.fastPreviewUnavailable")});const Q=()=>{const le=a.createTask({runtime:"sandbox"});ee("coding_session_started",{thread_id:le})};return s.jsxs("button",{type:"button",onClick:Q,className:"group flex w-full items-center gap-3 rounded-2xl border border-border bg-background/60 px-4 py-3.5 text-left shadow-sm backdrop-blur-sm transition-colors hover:bg-background/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[s.jsx(_s,{size:18,className:"shrink-0 text-muted-foreground"}),s.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[s.jsx("span",{className:"text-sm font-medium text-foreground",children:o("chat.fastPreview.startCodingSession")}),s.jsx("span",{className:"text-xs text-muted-foreground",children:o("chat.fastPreview.chatNeedsSession")})]}),s.jsx(mt,{size:16,className:"shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5"})]})}return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex flex-col w-full justify-end text-left",children:s.jsxs("div",{className:"relative rounded-2xl w-full flex flex-col",children:[e&&s.jsx("div",{className:"absolute inset-0 rounded-2xl pointer-events-none bg-muted/50"}),V&&a&&s.jsx(Me,{}),V&&a&&d?s.jsx(ir,{taskId:d}):null,s.jsx(Mn,{tiptapDoc:se,setTiptapDoc:ie,disabled:F.status==="recording",enterToSubmit:!0,placeholder:o(I?"chat.input.taskPlaceholder":"chat.input.placeholder"),onSubmit:He,suggestionOpenRef:Ge,children:s.jsxs("form",{onSubmit:He,className:K("w-full relative rounded-2xl min-h-[110px] md:min-h-[130px] flex flex-col bg-card dark:bg-muted card-shadow overflow-hidden"),children:[s.jsx($r,{selectedModel:p,onUnsupportedFile:Y,disabled:F.status==="recording"}),s.jsx("div",{className:"group/input relative flex flex-col gap-2 flex-1",children:s.jsx(En,{ref:ce,disabled:F.status==="recording",virtualMcpId:h?.id??D,showFileUploader:!0,selectedModel:p,onUnsupportedFile:Y,suggestionOpenRef:Ge})}),s.jsx("div",{className:"@container/chat-bottom flex items-center justify-between p-2.5 gap-1",children:F.status==="recording"?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex-1"}),s.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[s.jsx(Er,{data:F.waveformData.slice(0,28)}),s.jsx("button",{type:"button",onClick:J,className:"flex items-center justify-center size-8 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors","aria-label":o("chat.input.cancelRecording"),children:s.jsx(ze,{size:16})}),s.jsx("button",{type:"button",onClick:W,className:"flex items-center justify-center size-8 rounded-lg bg-foreground text-background hover:opacity-80 transition-opacity","aria-label":o("chat.input.useTranscription"),children:s.jsx($e,{size:16})})]})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[n&&s.jsx(ne,{type:"button",size:"sm",variant:S?"secondary":"ghost","aria-pressed":S,onClick:()=>_(!S),className:"h-8 rounded-lg",children:o("chat.input.taskMode")}),s.jsx(Cr,{disabled:!1,onOpenConnections:()=>{ee("connections_dialog_opened",{source:"tools_popover",mode:"add"}),R(!0)},virtualMcpId:h?.id??D,selectedModel:p,isStreaming:i,onUnsupportedFile:Y}),Kt&&s.jsx(Ce,{onClick:()=>ye("plan"),label:o("chat.input.planMode"),icon:s.jsx(xt,{size:14,className:"shrink-0"}),colorClass:"text-violet-600 dark:text-violet-400 hover:bg-violet-500/10",maxWidthClass:"@[320px]/chat-bottom:max-w-32"}),g==="gen-image"&&A&&s.jsx(Ce,{onClick:()=>ye("gen-image"),label:o("chat.input.createImage"),icon:s.jsx(At,{size:14,className:"shrink-0"}),colorClass:"text-pink-600 dark:text-pink-400 hover:bg-pink-500/10 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",maxWidthClass:"@[320px]/chat-bottom:max-w-[120px]"}),g==="web-search"&&b&&s.jsx(Ce,{onClick:()=>ye("web-search"),label:o("chat.input.webSearch"),icon:s.jsx(gt,{size:14,className:"shrink-0"}),colorClass:"text-blue-600 dark:text-blue-400 hover:bg-blue-500/10 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",maxWidthClass:"@[320px]/chat-bottom:max-w-[120px]"}),g==="deep-research"&&v&&s.jsx(Ce,{onClick:()=>ye("deep-research"),label:o("chat.input.deepResearch"),icon:s.jsx(bt,{size:14,className:"shrink-0"}),colorClass:"text-blue-600 dark:text-blue-400 hover:bg-blue-500/10 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",maxWidthClass:"@[320px]/chat-bottom:max-w-[120px]"}),Ae&&qe>0&&s.jsx(Vn,{usage:Qt,totalTokens:qe,contextWindow:Ae,onOpenContextPanel:t})]}),s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[s.jsx(br,{}),F.isSupported&&s.jsx(ne,{type:"button",onClick:H,disabled:!1,variant:"ghost",size:"icon",className:K("size-8 rounded-lg transition-colors",F.status==="permission-denied"?"text-destructive hover:text-destructive hover:bg-destructive/10":"text-muted-foreground hover:text-foreground"),title:F.status==="permission-denied"?o("chat.input.microphoneAccessDenied"):o("chat.input.voiceInput"),"aria-label":F.status==="permission-denied"?o("chat.input.microphoneAccessDenied"):o("chat.input.voiceInput"),children:s.jsx(Ds,{size:18})}),s.jsx(ne,{type:xe?"button":"submit",onClick:Q=>{xe&&(Q.preventDefault(),Q.stopPropagation(),m())},variant:Ee||xe?"default":"ghost",size:I?"sm":"icon",disabled:!Ee&&!xe,className:K(I?"h-8 px-3 rounded-lg transition-all":"size-8 rounded-lg transition-all",!Ee&&!xe&&"bg-muted text-muted-foreground hover:bg-muted hover:text-muted-foreground cursor-not-allowed"),title:o(he==="stop"?i?"chat.input.stopGenerating":"chat.input.cancelRun":I?"chat.input.startTask":"chat.input.sendMessageEnter"),"aria-label":o(he==="stop"?i?"chat.input.stopGenerating":"chat.input.cancelRun":I?"chat.input.startTask":"chat.input.sendMessage"),children:xe?s.jsx(Ms,{size:20}):s.jsxs(s.Fragment,{children:[I&&o("chat.input.startTask"),s.jsx(pt,{size:20})]})})]})]})})]})},d),n&&I&&s.jsx("p",{className:"px-3 pt-3 text-left text-xs text-muted-foreground",children:o("chat.input.taskHint")}),e&&s.jsx(Ir,{onClick:()=>{ee("connections_banner_clicked",{source:"home_chat_input"}),ee("connections_dialog_opened",{source:"home_banner",mode:"add"}),R(!0)}})]})}),s.jsx(Zn,{mode:"browse",open:P,onOpenChange:R,defaultTab:"all"}),s.jsx(Pn,{info:U,onClose:B})]})}export{KV as C,UV as H,Jo as a,OV as u};
8
+ The report follows.`;function po(t){return{...t,content:[{type:"paragraph",content:[ds({id:ot,name:ot,char:"/",kind:"prompt",metadata:[{role:"user",content:{type:"text",text:mo}}]})]},...t.content??[]]}}function fo(t){const e=F.c(30),{current:n,total:o,onPrev:V,onNext:a}=t,r=G();if(o<=1)return null;const i=n===0,l=n===0?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let m;e[0]!==l?(m=K("p-0.5 rounded transition-colors",l),e[0]=l,e[1]=m):m=e[1];let d;e[2]!==r?(d=r("chat.pagination.previousLabel"),e[2]=r,e[3]=d):d=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(sn,{size:14}),e[4]=c):c=e[4];let u;e[5]!==V||e[6]!==i||e[7]!==m||e[8]!==d?(u=s.jsx("button",{type:"button",onClick:V,disabled:i,className:m,"aria-label":d,children:c}),e[5]=V,e[6]=i,e[7]=m,e[8]=d,e[9]=u):u=e[9];const p=n+1;let h;e[10]!==r||e[11]!==p||e[12]!==o?(h=r("chat.pagination.counter",{current:p,total:o}),e[10]=r,e[11]=p,e[12]=o,e[13]=h):h=e[13];let f;e[14]!==h?(f=s.jsx("span",{className:"tabular-nums text-xs",children:h}),e[14]=h,e[15]=f):f=e[15];const x=n===o-1,A=n===o-1?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let b;e[16]!==A?(b=K("p-0.5 rounded transition-colors",A),e[16]=A,e[17]=b):b=e[17];let v;e[18]!==r?(v=r("chat.pagination.nextLabel"),e[18]=r,e[19]=v):v=e[19];let g;e[20]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(mt,{size:14}),e[20]=g):g=e[20];let C;e[21]!==a||e[22]!==x||e[23]!==b||e[24]!==v?(C=s.jsx("button",{type:"button",onClick:a,disabled:x,className:b,"aria-label":v,children:g}),e[21]=a,e[22]=x,e[23]=b,e[24]=v,e[25]=C):C=e[25];let j;return e[26]!==C||e[27]!==u||e[28]!==f?(j=s.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[u,f,C]}),e[26]=C,e[27]=u,e[28]=f,e[29]=j):j=e[29],j}function Mt(t){const e=F.c(8),{currentIndex:n,total:o,onPrev:V,onNext:a,extraLeft:r}=t;let i;e[0]!==n||e[1]!==a||e[2]!==V||e[3]!==o?(i=s.jsx(fo,{current:n,total:o,onPrev:V,onNext:a}),e[0]=n,e[1]=a,e[2]=V,e[3]=o,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=s.jsxs("div",{className:"flex items-center gap-2",children:[i,r]}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function ho(t){const e=F.c(17),{isStreaming:n,isAllAnswered:o,isCurrentAnswered:V,onAdvanceOrSubmit:a,submitLabel:r,nextLabel:i}=t,d=o?r===void 0?"Submit":r:i===void 0?"Next":i,c=o?n:!V,u=c?o?"Waiting for the assistant to finish…":"Answer this item to continue":null;let p;e[0]!==c||e[1]!==a?(p=()=>{c||a()},e[0]=c,e[1]=a,e[2]=p):p=e[2];const h=c&&"opacity-50 cursor-not-allowed";let f;e[3]!==h?(f=K("h-7 px-2.5 text-xs",h),e[3]=h,e[4]=f):f=e[4];let x;e[5]!==c||e[6]!==d||e[7]!==p||e[8]!==f?(x=s.jsx(ne,{type:"button",size:"sm","aria-disabled":c,onClick:p,className:f,children:d}),e[5]=c,e[6]=d,e[7]=p,e[8]=f,e[9]=x):x=e[9];const A=x;if(!u)return A;let b;e[10]!==A?(b=s.jsx(Te,{asChild:!0,children:A}),e[10]=A,e[11]=b):b=e[11];let v;e[12]!==u?(v=s.jsx(_e,{children:u}),e[12]=u,e[13]=v):v=e[13];let g;return e[14]!==b||e[15]!==v?(g=s.jsxs(De,{children:[b,v]}),e[14]=b,e[15]=v,e[16]=g):g=e[16],g}function Et(t,e,n){return t.findIndex(o=>e(o)===n)}function rt(t,e,n,o){return t.length===0?!1:t.every(V=>o(n[e(V)]))}function Vt(t,e,n,o,V){if(t.length===0)return null;const a=Et(t,e,V);for(let r=1;r<=t.length;r++){const i=t[(a+r)%t.length];if(!i)continue;const l=e(i);if(l!==V&&!o(n[l]))return l}return null}function xo(t){return!t.isStreaming&&t.allAnswered}function Pt(t){const{parts:e,partKey:n,schema:o,defaultValues:V,isStreaming:a,hasAnswer:r,onSubmit:i}=t,l=e[0]?n(e[0]):"",[m,d]=$.useState(l),[c,u]=$.useState(!1),p=qt({resolver:Ht(o),defaultValues:V}),h=p.watch(),f=Et(e,n,m),x=f>=0?e[f]:void 0,A=r(h[m]),b=rt(e,n,h,r),v=xo({isStreaming:a,allAnswered:b}),g=()=>{if(f>0){const _=e[f-1];_&&d(n(_))}},C=()=>{if(f>=0&&f<e.length-1){const _=e[f+1];_&&d(n(_))}},j=()=>{const _=p.getValues(),I=Vt(e,n,_,r,m);I&&d(I)},y=()=>{p.handleSubmit(_=>{const I=_;for(const D of e)i(D,I[n(D)])})()},N=$.useRef(y);N.current=y;const k=()=>{v&&(u(!1),N.current())},S=()=>{const _=p.getValues();if(rt(e,n,_,r)){if(a){u(!0);return}u(!1),N.current()}else{const I=Vt(e,n,_,r,m);I&&d(I)}};return $.useEffect(()=>{if(c&&!a){if(!b){u(!1);return}u(!1),N.current()}},[c,a,b]),{form:p,activeKey:m,setActiveKey:d,currentIndex:f,currentPart:x,isCurrentAnswered:A,isAllAnswered:b,canSubmit:v,goPrev:g,goNext:C,advanceToNextUnanswered:j,submit:k,submitOrAdvance:S}}const Rt="chat.approval.defaultDenyReason";function Lt(t){const e=F.c(36),{onYolo:n}=t,o=G(),[V,a]=be();let r,i,l,m,d,c,u,p,h;if(e[0]!==n||e[1]!==V||e[2]!==a||e[3]!==o){const g=me.find(y=>y.value===V.toolApprovalLevel)??me[0];let C;e[13]!==n||e[14]!==V||e[15]!==a?(C=y=>{const N=y,k=V.toolApprovalLevel??"readonly";a({...V,toolApprovalLevel:N}),N==="auto"&&n(k)},e[13]=n,e[14]=V,e[15]=a,e[16]=C):C=e[16];const j=C;l=Js,p=V.toolApprovalLevel,h=j,i=Xs,d="xs",c="text-xs text-muted-foreground border-border/60 bg-transparent hover:bg-accent/60 h-7 gap-1",u=go,r=en,m=o(g.shortKey),e[0]=n,e[1]=V,e[2]=a,e[3]=o,e[4]=r,e[5]=i,e[6]=l,e[7]=m,e[8]=d,e[9]=c,e[10]=u,e[11]=p,e[12]=h}else r=e[4],i=e[5],l=e[6],m=e[7],d=e[8],c=e[9],u=e[10],p=e[11],h=e[12];let f;e[17]!==r||e[18]!==m?(f=s.jsx(r,{children:m}),e[17]=r,e[18]=m,e[19]=f):f=e[19];let x;e[20]!==i||e[21]!==d||e[22]!==c||e[23]!==u||e[24]!==f?(x=s.jsx(i,{size:d,className:c,onClick:u,children:f}),e[20]=i,e[21]=d,e[22]=c,e[23]=u,e[24]=f,e[25]=x):x=e[25];let A;e[26]!==o?(A=me.map(g=>s.jsx(Zs,{value:g.value,children:o(g.labelKey)},g.value)),e[26]=o,e[27]=A):A=e[27];let b;e[28]!==A?(b=s.jsx(tn,{children:A}),e[28]=A,e[29]=b):b=e[29];let v;return e[30]!==l||e[31]!==b||e[32]!==p||e[33]!==h||e[34]!==x?(v=s.jsxs(l,{value:p,onValueChange:h,children:[x,b]}),e[30]=l,e[31]=b,e[32]=p,e[33]=h,e[34]=x,e[35]=v):v=e[35],v}function go(t){return t.stopPropagation()}function Ft(t){const e=F.c(8),{input:n}=t,o=G();if(n==null){let r;e[0]!==o?(r=o("chat.approval.noInput"),e[0]=o,e[1]=r):r=e[1];let i;return e[2]!==r?(i=s.jsx("div",{className:"px-4 text-xs text-muted-foreground",children:r}),e[2]=r,e[3]=i):i=e[3],i}let V;try{let r;e[4]!==n?(r=JSON.stringify(n,null,2),e[4]=n,e[5]=r):r=e[5],V=r}catch{V=String(n)}let a;return e[6]!==V?(a=s.jsx("div",{className:"px-4",children:s.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:V})}),e[6]=V,e[7]=a):a=e[7],a}function bo(t){const e=F.c(38),{approval:n,onRespond:o}=t,V=G(),[a]=be(),r=a.toolApprovalLevel??"readonly";let i;e[0]!==n.approvalId||e[1]!==r||e[2]!==o||e[3]!==V?(i=()=>o(n.approvalId,!1,V(Rt),r),e[0]=n.approvalId,e[1]=r,e[2]=o,e[3]=V,e[4]=i):i=e[4];const l=i;let m;e[5]!==n.approvalId||e[6]!==r||e[7]!==o?(m=()=>o(n.approvalId,!0,void 0,r),e[5]=n.approvalId,e[6]=r,e[7]=o,e[8]=m):m=e[8];const d=m;let c;e[9]!==n.approvalId||e[10]!==o?(c=k=>o(n.approvalId,!0,void 0,k),e[9]=n.approvalId,e[10]=o,e[11]=c):c=e[11];const u=c;let p;e[12]!==u?(p=s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(Lt,{onYolo:u})}),e[12]=u,e[13]=p):p=e[13];const h=p;let f;e[14]!==V?(f=V("chat.approval.denyButton"),e[14]=V,e[15]=f):f=e[15];let x;e[16]!==l||e[17]!==f?(x=s.jsx(ne,{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:l,children:f}),e[16]=l,e[17]=f,e[18]=x):x=e[18];let A;e[19]!==V?(A=V("chat.approval.acceptButton"),e[19]=V,e[20]=A):A=e[20];let b;e[21]!==d||e[22]!==A?(b=s.jsx(ne,{type:"button",size:"sm",className:"h-7 px-2.5 text-xs active:scale-[0.97] transition-transform",onClick:d,children:A}),e[21]=d,e[22]=A,e[23]=b):b=e[23];let v;e[24]!==x||e[25]!==b?(v=s.jsxs(s.Fragment,{children:[x,b]}),e[24]=x,e[25]=b,e[26]=v):v=e[26];const g=v;let C;e[27]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(ke,{size:14}),e[27]=C):C=e[27];let j;e[28]!==V?(j=V("chat.approval.needsApproval"),e[28]=V,e[29]=j):j=e[29];let y;e[30]!==n.input?(y=s.jsx(Ft,{input:n.input}),e[30]=n.input,e[31]=y):y=e[31];let N;return e[32]!==n.friendlyName||e[33]!==h||e[34]!==g||e[35]!==j||e[36]!==y?(N=s.jsx(ue,{icon:C,label:j,title:n.friendlyName,defaultExpanded:!0,footerLeft:h,footerRight:g,children:y}),e[32]=n.friendlyName,e[33]=h,e[34]=g,e[35]=j,e[36]=y,e[37]=N):N=e[37],N}const Ao=Wt(ge(),pe({approved:Zt().optional(),levelOverride:ze(["auto","readonly"]).optional()}));function vo(t){const e=F.c(46),{approvals:n,isStreaming:o,onRespond:V}=t,a=G(),[r]=be(),i=r.toolApprovalLevel??"readonly";let l;e[0]!==n?(l=Object.fromEntries(n.map(wo)),e[0]=n,e[1]=l):l=e[1];const m=l;let d;e[2]!==i||e[3]!==V||e[4]!==a?(d=(I,D)=>{const T=D;typeof T?.approved=="boolean"&&V(I.approvalId,T.approved,T.approved===!1?a(Rt):void 0,T.levelOverride??i)},e[2]=i,e[3]=V,e[4]=a,e[5]=d):d=e[5];let c;e[6]!==n||e[7]!==m||e[8]!==o||e[9]!==d?(c={parts:n,partKey:yo,schema:Ao,defaultValues:m,isStreaming:o,hasAnswer:jo,onSubmit:d},e[6]=n,e[7]=m,e[8]=o,e[9]=d,e[10]=c):c=e[10];const u=Pt(c);let p;e[11]!==n||e[12]!==u?(p=I=>{u.form.reset(Object.fromEntries(n.map(D=>[D.approvalId,{approved:!0,levelOverride:I}]))),u.submitOrAdvance()},e[11]=n,e[12]=u,e[13]=p):p=e[13];const h=p,f=u.currentPart,x=u.form;let A;e[14]!==u?(A=I=>{I.preventDefault(),u.submit()},e[14]=u,e[15]=A):A=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(ke,{size:14}),e[16]=b):b=e[16];let v;e[17]!==n.length||e[18]!==a?(v=a("chat.approval.batchedLabel",{count:n.length}),e[17]=n.length,e[18]=a,e[19]=v):v=e[19];const g=f?.friendlyName??"";let C;e[20]!==h?(C=s.jsx(Lt,{onYolo:h}),e[20]=h,e[21]=C):C=e[21];let j;e[22]!==n.length||e[23]!==u.currentIndex||e[24]!==u.goNext||e[25]!==u.goPrev||e[26]!==C?(j=s.jsx(Mt,{currentIndex:u.currentIndex,total:n.length,onPrev:u.goPrev,onNext:u.goNext,extraLeft:C}),e[22]=n.length,e[23]=u.currentIndex,e[24]=u.goNext,e[25]=u.goPrev,e[26]=C,e[27]=j):j=e[27];let y;e[28]!==f||e[29]!==u.form.control||e[30]!==u.submitOrAdvance?(y=f?s.jsx(Co,{approvalId:f.approvalId,control:u.form.control,onChange:u.submitOrAdvance}):null,e[28]=f,e[29]=u.form.control,e[30]=u.submitOrAdvance,e[31]=y):y=e[31];let N;e[32]!==f?(N=f?s.jsx(Ft,{input:f.input}):null,e[32]=f,e[33]=N):N=e[33];let k;e[34]!==j||e[35]!==y||e[36]!==N||e[37]!==v||e[38]!==g?(k=s.jsx(ue,{icon:b,label:v,title:g,defaultExpanded:!0,footerLeft:j,footerRight:y,children:N}),e[34]=j,e[35]=y,e[36]=N,e[37]=v,e[38]=g,e[39]=k):k=e[39];let S;e[40]!==k||e[41]!==A?(S=s.jsx("form",{onSubmit:A,children:k}),e[40]=k,e[41]=A,e[42]=S):S=e[42];let _;return e[43]!==u.form||e[44]!==S?(_=s.jsx(Le,{...x,children:S}),e[43]=u.form,e[44]=S,e[45]=_):_=e[45],_}function jo(t){return typeof t?.approved=="boolean"}function yo(t){return t.approvalId}function wo(t){return[t.approvalId,{approved:void 0}]}function Co(t){const e=F.c(7),{approvalId:n,control:o,onChange:V}=t,a=G(),r=`${n}.approved`;let i;e[0]!==V||e[1]!==a?(i=m=>{const{field:d}=m,c=d.value===!0,u=d.value===!1;return s.jsxs(s.Fragment,{children:[s.jsx(ne,{type:"button",variant:u?"secondary":"ghost",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{d.onChange(!1),V()},"aria-pressed":u,children:a("chat.approval.denyButton")}),s.jsx(ne,{type:"button",variant:c?"default":"outline",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{d.onChange(!0),V()},"aria-pressed":c,children:a("chat.approval.acceptButton")})]})},e[0]=V,e[1]=a,e[2]=i):i=e[2];let l;return e[3]!==o||e[4]!==r||e[5]!==i?(l=s.jsx(Jt,{control:o,name:r,render:i}),e[3]=o,e[4]=r,e[5]=i,e[6]=l):l=e[6],l}function No(){const t=F.c(5),e=G();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ke,{className:"size-5 text-muted-foreground shimmer"}),t[0]=n):n=t[0];let o;t[1]!==e?(o=e("chat.approval.preparingRequest"),t[1]=e,t[2]=o):o=t[2];let V;return t[3]!==o?(V=s.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:[n,s.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:o})]}),t[3]=o,t[4]=V):V=t[4],V}function So(t){const e=F.c(8),{approvals:n,isStreaming:o,onRespond:V}=t;if(o&&n.length===0){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(No,{}),e[0]=r):r=e[0],r}if(n.length===0)return null;if(n.length===1){const r=n[0];if(!r)return null;let i;return e[1]!==V||e[2]!==r?(i=s.jsx(bo,{approval:r,onRespond:V}),e[1]=V,e[2]=r,e[3]=i):i=e[3],i}let a;return e[4]!==n||e[5]!==o||e[6]!==V?(a=s.jsx(vo,{approvals:n,isStreaming:o,onRespond:V}),e[4]=n,e[5]=o,e[6]=V,e[7]=a):a=e[7],a}function ko(t){const e=F.c(28),{plan:n,onApprove:o,onDismiss:V}=t,a=G();let r;e[0]!==o||e[1]!==n.plan?(r=()=>{o(n.plan)},e[0]=o,e[1]=n.plan,e[2]=r):r=e[2];const i=r;let l;e[3]!==a?(l=a("chat.proposePlan.keepIterating"),e[3]=a,e[4]=l):l=e[4];let m;e[5]!==V||e[6]!==l?(m=s.jsx(ne,{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:l}),e[5]=V,e[6]=l,e[7]=m):m=e[7];let d;e[8]!==a?(d=a("chat.proposePlan.letsGo"),e[8]=a,e[9]=d):d=e[9];let c;e[10]!==i||e[11]!==d?(c=s.jsx(ne,{type:"button",size:"sm",className:"h-7 px-2.5 text-xs bg-purple-600 hover:bg-purple-700 text-white active:scale-[0.97] transition-transform",onClick:i,children:d}),e[10]=i,e[11]=d,e[12]=c):c=e[12];let u;e[13]!==m||e[14]!==c?(u=s.jsxs(s.Fragment,{children:[m,c]}),e[13]=m,e[14]=c,e[15]=u):u=e[15];const p=u;let h;e[16]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Ns,{size:14}),e[16]=h):h=e[16];let f;e[17]!==a?(f=a("chat.proposePlan.planReady"),e[17]=a,e[18]=f):f=e[18];let x;e[19]!==a?(x=a("chat.proposePlan.implementationPlan"),e[19]=a,e[20]=x):x=e[20];let A;e[21]!==n.plan?(A=s.jsx("div",{className:"px-4 max-h-64 overflow-y-auto",children:s.jsx("div",{className:"prose prose-sm max-w-none text-sm",children:s.jsx(nn,{id:"plan-preview",part:{type:"text",text:n.plan}})})}),e[21]=n.plan,e[22]=A):A=e[22];let b;return e[23]!==p||e[24]!==A||e[25]!==f||e[26]!==x?(b=s.jsx(ue,{icon:h,label:f,title:x,defaultExpanded:!0,footerRight:p,children:A}),e[23]=p,e[24]=A,e[25]=f,e[26]=x,e[27]=b):b=e[27],b}function Io(t){const e=F.c(6),{plans:n,onApprove:o,onDismiss:V}=t;let a;e[0]!==n?(a=Tt(n),e[0]=n,e[1]=a):a=e[1];const r=a;if(!r)return null;let i;return e[2]!==r||e[3]!==o||e[4]!==V?(i=s.jsx(ko,{plan:r,onApprove:o,onDismiss:V}),e[2]=r,e[3]=o,e[4]=V,e[5]=i):i=e[5],i}function zt(t){return t?"response"in t?t.response:t.option??t.draft:""}const at=pe({response:ge().min(1,"Response is required")}),To=pe({option:ge().nullable(),draft:ge()}).refine(t=>(t.option??t.draft).length>0,{message:"Please select or enter an option"}),_o=pe({response:ze(["yes","no"])});function Do(t){switch(t.type){case"text":return at;case"choice":return To;case"confirm":return _o;default:return at}}function Mo(t){const e={};for(const n of t)e[n.toolCallId]=Do(n.input);return pe(e)}function Eo(t){const e=F.c(7),{control:n,name:o,placeholder:V}=t,a=G();let r;e[0]!==V||e[1]!==a?(r=l=>{const{field:m}=l,d=m.value??"";return s.jsxs(Oe,{children:[s.jsx(Ke,{children:s.jsx("div",{className:"px-2",children:s.jsxs("div",{className:"flex items-center gap-3 px-2 py-3 rounded-lg bg-accent/50",children:[s.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:s.jsx(ft,{size:16,className:"text-muted-foreground"})}),s.jsx("input",{...m,value:d,type:"text",placeholder:V||a("chat.userAskQuestion.typeResponse"),autoFocus:!0,"aria-label":a("chat.userAskQuestion.textResponseInputAriaLabel"),className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"})]})})}),s.jsx(Qe,{})]})},e[0]=V,e[1]=a,e[2]=r):r=e[2];let i;return e[3]!==n||e[4]!==o||e[5]!==r?(i=s.jsx(vt,{control:n,name:o,render:r}),e[3]=n,e[4]=o,e[5]=r,e[6]=i):i=e[6],i}function Bt(t,e){const n=F.c(4);let o,V;n[0]!==t||n[1]!==e?(o=()=>{const a=r=>{const i=r.target.tagName;if(i==="INPUT"||i==="TEXTAREA"||r.metaKey||r.ctrlKey||r.altKey)return;const l=Number.parseInt(r.key,10);l>=1&&l<=t&&(r.preventDefault(),e(l-1))};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},V=[t,e],n[0]=t,n[1]=e,n[2]=o,n[3]=V):(o=n[2],V=n[3]),$.useEffect(o,V)}function Po(t){const e=F.c(51),{control:n,name:o,options:V}=t,a=G(),r=`${o}.option`;let i;e[0]!==n||e[1]!==r?(i={control:n,name:r,defaultValue:null},e[0]=n,e[1]=r,e[2]=i):i=e[2];const{field:l}=We(i),m=`${o}.draft`;let d;e[3]!==n||e[4]!==m?(d={control:n,name:m,defaultValue:""},e[3]=n,e[4]=m,e[5]=d):d=e[5];const{field:c}=We(d),u=l.value,p=c.value??"";let h;if(e[6]!==l||e[7]!==V?(h=E=>{const P=V[E];P!=null&&l.onChange(P)},e[6]=l,e[7]=V,e[8]=h):h=e[8],Bt(V.length,h),V.length===0)return null;const f=u===null;let x;e[9]!==a?(x=a("chat.userAskQuestion.choiceOptionsAriaLabel"),e[9]=a,e[10]=x):x=e[10];let A;if(e[11]!==l||e[12]!==u||e[13]!==V||e[14]!==a){let E;e[16]!==l||e[17]!==u||e[18]!==a?(E=(P,R)=>{const U=u===P;return s.jsxs("button",{type:"button",onClick:()=>l.onChange(P),className:K("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/30"),"aria-label":a("chat.userAskQuestion.selectOption",{option:P}),children:[s.jsx("span",{className:K("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:R+1}),s.jsx("span",{className:"text-sm text-foreground min-w-0 break-words",children:P})]},`${R}-${P}`)},e[16]=l,e[17]=u,e[18]=a,e[19]=E):E=e[19],A=V.map(E),e[11]=l,e[12]=u,e[13]=V,e[14]=a,e[15]=A}else A=e[15];const b=f&&"bg-accent/50",v=!f&&"hover:bg-accent/30";let g;e[20]!==b||e[21]!==v?(g=K("flex items-center gap-3 px-2 py-3 rounded-lg transition-colors w-full cursor-text",b,v),e[20]=b,e[21]=v,e[22]=g):g=e[22];let C;e[23]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:s.jsx(ft,{size:16,className:"text-muted-foreground"})}),e[23]=C):C=e[23];const j=f?p:"";let y;e[24]!==c||e[25]!==l||e[26]!==u?(y=E=>{c.onChange(E.target.value),u!==null&&l.onChange(null)},e[24]=c,e[25]=l,e[26]=u,e[27]=y):y=e[27];let N;e[28]!==l||e[29]!==u?(N=()=>{u!==null&&l.onChange(null)},e[28]=l,e[29]=u,e[30]=N):N=e[30];let k;e[31]!==a?(k=a("chat.userAskQuestion.somethingElsePlaceholder"),e[31]=a,e[32]=k):k=e[32];let S;e[33]!==a?(S=a("chat.userAskQuestion.customChoiceInputAriaLabel"),e[33]=a,e[34]=S):S=e[34];let _;e[35]!==j||e[36]!==y||e[37]!==N||e[38]!==k||e[39]!==S?(_=s.jsx("input",{type:"text",value:j,onChange:y,onFocus:N,placeholder:k,"aria-label":S,className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"}),e[35]=j,e[36]=y,e[37]=N,e[38]=k,e[39]=S,e[40]=_):_=e[40];let I;e[41]!==g||e[42]!==_?(I=s.jsxs("label",{className:g,children:[C,_]}),e[41]=g,e[42]=_,e[43]=I):I=e[43];let D;e[44]!==I||e[45]!==x||e[46]!==A?(D=s.jsx(Ke,{children:s.jsxs("div",{className:"flex flex-col px-2",role:"group","aria-label":x,children:[A,I]})}),e[44]=I,e[45]=x,e[46]=A,e[47]=D):D=e[47];let T;e[48]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(Qe,{}),e[48]=T):T=e[48];let z;return e[49]!==D?(z=s.jsxs(Oe,{children:[D,T]}),e[49]=D,e[50]=z):z=e[50],z}function Ro(t){const e=F.c(8),{control:n,name:o}=t,V=G();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=["yes","no"],e[0]=a):a=e[0];const r=a,i=$.useRef(null);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=c=>{i.current?.onChange(r[c]??"")},e[1]=l):l=e[1],Bt(r.length,l);let m;e[2]!==V?(m=c=>{const{field:u}=c;return i.current=u,s.jsxs(Oe,{children:[s.jsx(Ke,{children:s.jsx("div",{className:"flex gap-2 px-2",role:"group","aria-label":V("chat.userAskQuestion.confirmationOptionsAriaLabel"),children:r.map(p=>{const h=u.value===p;return s.jsxs("button",{type:"button",onClick:()=>u.onChange(p),className:K("flex items-center gap-3 px-4 py-3 rounded-lg text-left transition-colors flex-1",h&&"bg-accent/50",!h&&"hover:bg-accent/30"),"aria-label":V("chat.userAskQuestion.confirmValue",{value:V(`chat.userAskQuestion.confirm${p==="yes"?"Yes":"No"}`)}),children:[s.jsx("span",{className:K("flex items-center justify-center size-6 rounded-md text-sm shrink-0",h?"bg-chart-1 text-white":"bg-muted text-foreground"),children:p==="yes"?1:2}),s.jsx("span",{className:"text-sm text-foreground capitalize",children:V(`chat.userAskQuestion.confirm${p==="yes"?"Yes":"No"}`)})]},p)})})}),s.jsx(Qe,{})]})},e[2]=V,e[3]=m):m=e[3];let d;return e[4]!==n||e[5]!==o||e[6]!==m?(d=s.jsx(vt,{control:n,name:o,render:m}),e[4]=n,e[5]=o,e[6]=m,e[7]=d):d=e[7],d}function it(t){const e=F.c(13),{input:n,control:o,toolCallId:V}=t;switch(n.type){case"text":{const a=`${V}.response`;let r;return e[0]!==o||e[1]!==n.default||e[2]!==a?(r=s.jsx(Eo,{control:o,name:a,placeholder:n.default}),e[0]=o,e[1]=n.default,e[2]=a,e[3]=r):r=e[3],r}case"choice":{let a;e[4]!==n.options?(a=n.options?.filter(Boolean)??[],e[4]=n.options,e[5]=a):a=e[5];const r=a;let i;return e[6]!==o||e[7]!==r||e[8]!==V?(i=s.jsx(Po,{control:o,name:V,options:r}),e[6]=o,e[7]=r,e[8]=V,e[9]=i):i=e[9],i}case"confirm":{const a=`${V}.response`;let r;return e[10]!==o||e[11]!==a?(r=s.jsx(Ro,{control:o,name:a}),e[10]=o,e[11]=a,e[12]=r):r=e[12],r}default:return null}}function Lo(t){const e=F.c(91),{parts:n,isStreaming:o,onSubmit:V}=t;let a;e[0]!==n?(a=Mo(n.map($o)),e[0]=n,e[1]=a):a=e[1];const r=a;let i;e[2]!==n?(i=Object.fromEntries(n.map(Bo)),e[2]=n,e[3]=i):i=e[3];const l=i;let m;e[4]!==V?(m=(B,L)=>{const M=zt(L);M&&V(B,M)},e[4]=V,e[5]=m):m=e[5];let d;e[6]!==l||e[7]!==o||e[8]!==n||e[9]!==r||e[10]!==m?(d={parts:n,partKey:zo,schema:r,defaultValues:l,isStreaming:o,hasAnswer:Fo,onSubmit:m},e[6]=l,e[7]=o,e[8]=n,e[9]=r,e[10]=m,e[11]=d):d=e[11];const c=Pt(d),u=c.currentPart,p=G();let h;e[12]!==u||e[13]!==c||e[14]!==p?(h=()=>{const B=u;if(!B)return;const L=p("chat.userAskQuestion.skipMessage"),M=B.toolCallId;B.input?.type==="choice"?(c.form.setValue(`${M}.option`,null),c.form.setValue(`${M}.draft`,L)):c.form.setValue(`${M}.response`,L),c.advanceToNextUnanswered()},e[12]=u,e[13]=c,e[14]=p,e[15]=h):h=e[15];const f=h;let x;e[16]!==c.currentIndex||e[17]!==c.goNext||e[18]!==c.goPrev||e[19]!==n.length?(x=s.jsx(Mt,{currentIndex:c.currentIndex,total:n.length,onPrev:c.goPrev,onNext:c.goNext}),e[16]=c.currentIndex,e[17]=c.goNext,e[18]=c.goPrev,e[19]=n.length,e[20]=x):x=e[20];const A=x;let b;e[21]!==p?(b=p("chat.userAskQuestion.skip"),e[21]=p,e[22]=b):b=e[22];let v;e[23]!==f||e[24]!==b?(v=s.jsx(ne,{type:"button",variant:"outline",size:"sm",onClick:f,className:"h-7",children:b}),e[23]=f,e[24]=b,e[25]=v):v=e[25];let g;e[26]!==c.isAllAnswered||e[27]!==c.isCurrentAnswered||e[28]!==c.submitOrAdvance||e[29]!==o?(g=s.jsx(ho,{isStreaming:o,isAllAnswered:c.isAllAnswered,isCurrentAnswered:c.isCurrentAnswered,onAdvanceOrSubmit:c.submitOrAdvance}),e[26]=c.isAllAnswered,e[27]=c.isCurrentAnswered,e[28]=c.submitOrAdvance,e[29]=o,e[30]=g):g=e[30];let C;e[31]!==v||e[32]!==g?(C=s.jsxs(s.Fragment,{children:[v,g]}),e[31]=v,e[32]=g,e[33]=C):C=e[33];const j=C;if(n.length===1){const B=n[0];if(!B?.input)return null;const L=c.form;let M;e[34]!==c?(M=te=>{te.preventDefault(),c.submit()},e[34]=c,e[35]=M):M=e[35];let H;e[36]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Fe,{size:14}),e[36]=H):H=e[36];let W;e[37]!==p?(W=p("chat.userAskQuestion.questionPending"),e[37]=p,e[38]=W):W=e[38];let J;e[39]!==B.input?.prompt||e[40]!==p?(J=B.input?.prompt??p("chat.userAskQuestion.question"),e[39]=B.input?.prompt,e[40]=p,e[41]=J):J=e[41];const w=B.input;let O;e[42]!==c.form.control||e[43]!==B.toolCallId||e[44]!==w?(O=s.jsx(it,{input:w,control:c.form.control,toolCallId:B.toolCallId}),e[42]=c.form.control,e[43]=B.toolCallId,e[44]=w,e[45]=O):O=e[45];let q;e[46]!==j||e[47]!==W||e[48]!==J||e[49]!==O?(q=s.jsx(ue,{icon:H,label:W,title:J,defaultExpanded:!0,footerRight:j,children:O}),e[46]=j,e[47]=W,e[48]=J,e[49]=O,e[50]=q):q=e[50];let Z;e[51]!==M||e[52]!==q?(Z=s.jsx("form",{onSubmit:M,autoComplete:"off",children:q}),e[51]=M,e[52]=q,e[53]=Z):Z=e[53];let X;return e[54]!==c.form||e[55]!==Z?(X=s.jsx(Le,{...L,children:Z}),e[54]=c.form,e[55]=Z,e[56]=X):X=e[56],X}const y=c.form;let N;e[57]!==c?(N=B=>{B.preventDefault(),c.submit()},e[57]=c,e[58]=N):N=e[58];let k;e[59]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Fe,{size:14}),e[59]=k):k=e[59];let S;e[60]!==p?(S=p("chat.userAskQuestion.questionPending"),e[60]=p,e[61]=S):S=e[61];const _=c.currentIndex+1;let I;e[62]!==n.length||e[63]!==p||e[64]!==_?(I=p("chat.userAskQuestion.questionCount",{current:_,total:n.length}),e[62]=n.length,e[63]=p,e[64]=_,e[65]=I):I=e[65];let D;e[66]!==u?.input?.prompt||e[67]!==p?(D=u?.input?.prompt??p("chat.userAskQuestion.question"),e[66]=u?.input?.prompt,e[67]=p,e[68]=D):D=e[68];const T=c.activeKey,z=c.setActiveKey;let E;if(e[69]!==c.form||e[70]!==n){let B;e[72]!==c.form?(B=L=>s.jsx(Vn,{value:L.toolCallId,className:"mt-0",children:s.jsx(it,{input:L.input,control:c.form.control,toolCallId:L.toolCallId})},L.toolCallId),e[72]=c.form,e[73]=B):B=e[73],E=n.map(B),e[69]=c.form,e[70]=n,e[71]=E}else E=e[71];let P;e[74]!==c.activeKey||e[75]!==c.setActiveKey||e[76]!==E?(P=s.jsx(an,{value:T,onValueChange:z,children:E}),e[74]=c.activeKey,e[75]=c.setActiveKey,e[76]=E,e[77]=P):P=e[77];let R;e[78]!==A||e[79]!==j||e[80]!==S||e[81]!==I||e[82]!==D||e[83]!==P?(R=s.jsx(ue,{icon:k,label:S,count:I,title:D,defaultExpanded:!0,footerLeft:A,footerRight:j,children:P}),e[78]=A,e[79]=j,e[80]=S,e[81]=I,e[82]=D,e[83]=P,e[84]=R):R=e[84];let U;e[85]!==N||e[86]!==R?(U=s.jsx("form",{onSubmit:N,autoComplete:"off",children:R}),e[85]=N,e[86]=R,e[87]=U):U=e[87];let Y;return e[88]!==c.form||e[89]!==U?(Y=s.jsx(Le,{...y,children:U}),e[88]=c.form,e[89]=U,e[90]=Y):Y=e[90],Y}function Fo(t){return!!zt(t)}function zo(t){return t.toolCallId}function Bo(t){return t.input?.type==="choice"?[t.toolCallId,{option:null,draft:""}]:[t.toolCallId,{response:""}]}function $o(t){return{toolCallId:t.toolCallId,input:t.input}}function Uo(){const t=F.c(5),e=G();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Fe,{className:"size-5 text-muted-foreground shimmer"}),t[0]=n):n=t[0];let o;t[1]!==e?(o=e("chat.userAskQuestion.preparingQuestion"),t[1]=e,t[2]=o):o=t[2];let V;return t[3]!==o?(V=s.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:[n,s.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:o})]}),t[3]=o,t[4]=V):V=t[4],V}function $t(t){const e=F.c(7),{userAskParts:n,isStreaming:o,onSubmit:V}=t;let a;e[0]!==n?(a=n.filter(Oo),e[0]=n,e[1]=a):a=e[1];const r=a;if(r.length===0){if(o){let l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Uo,{}),e[2]=l):l=e[2],l}return null}let i;return e[3]!==o||e[4]!==V||e[5]!==r?(i=s.jsx(Lo,{parts:r,isStreaming:o,onSubmit:V}),e[3]=o,e[4]=V,e[5]=r,e[6]=i):i=e[6],i}function Oo(t){return t.state==="input-available"}function Ko(t){const e=t.filter(a=>a.status==="in_progress"),n=t.filter(a=>a.status==="completed").length,o=t.length;if(o>0&&n===o)return{icon:"completed",activity:"All done",progress:`${o}/${o}`};const[V]=e;return V&&e.length===1?{icon:"in_progress",activity:V.activeForm,progress:`${n}/${o} done`}:e.length>1?{icon:"in_progress",activity:`${e.length} in progress`,progress:`${n}/${o} done`}:n>0?{icon:"pending",activity:`${o-n} pending`,progress:`${n}/${o} done`}:{icon:"pending",activity:`${o} todos`,progress:"not started"}}function Qo(t){const e=F.c(13),{todos:n}=t;if(n.length===0)return null;let o;e[0]!==n?(o=Ko(n),e[0]=n,e[1]=o):o=e[1];const V=o;let a;e[2]!==V.icon?(a=s.jsx(Ho,{status:V.icon}),e[2]=V.icon,e[3]=a):a=e[3];const r=V.activity,i=V.progress;let l;e[4]!==n?(l=n.map(Yo),e[4]=n,e[5]=l):l=e[5];let m;e[6]!==l?(m=s.jsx("ul",{"data-testid":"todos-list",className:"flex flex-col px-2 max-h-[40vh] overflow-y-auto",children:l}),e[6]=l,e[7]=m):m=e[7];let d;return e[8]!==V.activity||e[9]!==V.progress||e[10]!==a||e[11]!==m?(d=s.jsx(ue,{icon:a,label:r,count:i,defaultExpanded:!1,children:m}),e[8]=V.activity,e[9]=V.progress,e[10]=a,e[11]=m,e[12]=d):d=e[12],d}function Yo(t,e){return s.jsx(Go,{todo:t},e)}function Go(t){const e=F.c(14),{todo:n}=t,o=n.status==="completed",a=n.status==="in_progress"?n.activeForm:n.content;let r;e[0]!==n.status?(r=s.jsx(qo,{status:n.status}),e[0]=n.status,e[1]=r):r=e[1];const i=o&&"text-muted-foreground";let l;e[2]!==i?(l=K("relative text-sm leading-snug pt-px select-none",i),e[2]=i,e[3]=l):l=e[3];const m=o?"100%":"0%",d=o?"width 300ms ease 200ms":"width 150ms ease";let c;e[4]!==m||e[5]!==d?(c=s.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:"50%",height:"1px",background:"currentColor",width:m,transition:d}}),e[4]=m,e[5]=d,e[6]=c):c=e[6];let u;e[7]!==a||e[8]!==l||e[9]!==c?(u=s.jsxs("span",{className:l,children:[a,c]}),e[7]=a,e[8]=l,e[9]=c,e[10]=u):u=e[10];let p;return e[11]!==r||e[12]!==u?(p=s.jsxs("li",{className:"flex items-start gap-2.5 px-2 py-1.5 rounded-lg hover:bg-accent/50 transition-colors",children:[r,u]}),e[11]=r,e[12]=u,e[13]=p):p=e[13],p}function qo(t){const e=F.c(4),{status:n}=t,o=n==="completed"?"true":void 0,V=n==="in_progress"?"true":void 0;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("svg",{viewBox:"0 0 21 21",children:s.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]=a):a=e[0];let r;return e[1]!==o||e[2]!==V?(r=s.jsx("div",{className:"todo-cb mt-0.5","data-checked":o,"data-progress":V,"aria-hidden":"true",children:a}),e[1]=o,e[2]=V,e[3]=r):r=e[3],r}function Ho(t){const e=F.c(13),{status:n}=t,o=G();if(n==="completed"){let r;e[0]!==o?(r=o("chat.todoStatus.completed"),e[0]=o,e[1]=r):r=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.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:s.jsx("path",{d:"M1 4l2.5 2.5L9 1"})}),e[2]=i):i=e[2];let l;return e[3]!==r?(l=s.jsx("span",{"aria-label":r,className:"inline-flex items-center justify-center w-3.5 h-3.5 rounded-sm bg-primary",children:i}),e[3]=r,e[4]=l):l=e[4],l}if(n==="in_progress"){let r;e[5]!==o?(r=o("chat.todoStatus.inProgress"),e[5]=o,e[6]=r):r=e[6];let i;return e[7]!==r?(i=s.jsx("span",{"aria-label":r,className:"inline-block w-2 h-2 rounded-full bg-primary animate-pulse shrink-0"}),e[7]=r,e[8]=i):i=e[8],i}let V;e[9]!==o?(V=o("chat.todoStatus.pending"),e[9]=o,e[10]=V):V=e[10];let a;return e[11]!==V?(a=s.jsx("span",{"aria-label":V,className:"inline-block w-3.5 h-3.5 rounded-sm border-[1.5px] border-muted-foreground/50 shrink-0"}),e[11]=V,e[12]=a):a=e[12],a}const Wo={usd:[{dollars:10,labelKey:"chat.creditsExhaustedBanner.tierStarter"},{dollars:20,labelKey:"chat.creditsExhaustedBanner.tierPopular"},{dollars:100,labelKey:"chat.creditsExhaustedBanner.tierBestValue"}],brl:[{dollars:50,labelKey:"chat.creditsExhaustedBanner.tierStarter"},{dollars:100,labelKey:"chat.creditsExhaustedBanner.tierPopular"},{dollars:500,labelKey:"chat.creditsExhaustedBanner.tierBestValue"}]},Zo=["chat.creditsExhaustedBanner.benefit1","chat.creditsExhaustedBanner.benefit2","chat.creditsExhaustedBanner.benefit3"];function Jo(t){const e=F.c(65),{onDismiss:n}=t,{org:o}=Se(),V=ct(),{decoKeyId:a}=hn(),r=Xt(),i=G(),[l,m]=$.useState(""),[d,c]=$.useState(!1),[u,p]=$.useState("usd"),h=u==="brl"?"R$":"$";let f,x;e[0]!==o.id?(f=()=>{ee("credits_exhausted_shown",{organization_id:o.id})},x=[o.id],e[0]=o.id,e[1]=f,e[2]=x):(f=e[1],x=e[2]),$.useEffect(f,x);let A;e[3]!==u||e[4]!==r?(A=async w=>{const{url:O}=await r.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:w,currency:u});return O},e[3]=u,e[4]=r,e[5]=A):A=e[5];let b;e[6]!==n?(b=w=>{w&&window.open(w,"_blank","noopener,noreferrer"),n?.()},e[6]=n,e[7]=b):b=e[7];let v;e[8]!==i?(v=w=>{je.error(i("chat.creditsExhaustedBanner.topupError",{error:w.message}))},e[8]=i,e[9]=v):v=e[9];let g;e[10]!==A||e[11]!==b||e[12]!==v?(g={mutationFn:A,onSuccess:b,onError:v},e[10]=A,e[11]=b,e[12]=v,e[13]=g):g=e[13];const{mutate:C,isPending:j}=es(g),y=parseFloat(l),N=!isNaN(y)&&y>=1;let k;e[14]!==n?(k=w=>!w&&n?.(),e[14]=n,e[15]=k):k=e[15];let S;e[16]===Symbol.for("react.memo_cache_sentinel")?(S=["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[16]=S):S=e[16];let _;e[17]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("div",{className:"absolute inset-x-0 top-0 h-36 pointer-events-none",style:{backgroundImage:S.join(", "),maskImage:"linear-gradient(to bottom, black 0%, transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black 0%, transparent 100%)"}}),e[17]=_):_=e[17];let I;e[18]===Symbol.for("react.memo_cache_sentinel")?(I=s.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[18]=I):I=e[18];let D;e[19]!==i?(D=i("chat.creditsExhaustedBanner.title"),e[19]=i,e[20]=D):D=e[20];let T;e[21]!==D?(T=s.jsx(cn,{className:"text-xl font-semibold tracking-tight",children:D}),e[21]=D,e[22]=T):T=e[22];let z;e[23]!==i?(z=i("chat.creditsExhaustedBanner.description"),e[23]=i,e[24]=z):z=e[24];let E;e[25]!==z?(E=s.jsx(dn,{className:"mt-1.5 text-sm leading-relaxed",children:z}),e[25]=z,e[26]=E):E=e[26];let P;e[27]!==T||e[28]!==E?(P=s.jsxs("div",{className:"relative px-8 pt-8 pb-2 overflow-hidden",children:[_,s.jsxs(un,{className:"relative gap-4",children:[I,s.jsxs("div",{children:[T,E]})]})]}),e[27]=T,e[28]=E,e[29]=P):P=e[29];let R;e[30]!==u||e[31]!==h||e[32]!==l||e[33]!==y||e[34]!==a||e[35]!==N||e[36]!==j||e[37]!==d||e[38]!==i||e[39]!==C?(R=a&&s.jsxs("div",{className:"px-8 pt-5 pb-6",children:[s.jsx("div",{className:"mb-4",children:s.jsxs(ln,{type:"single",variant:"outline",size:"sm",value:u,onValueChange:w=>{w&&p(w)},children:[s.jsx(Je,{value:"usd",className:"h-8 px-3 text-xs",children:"USD"}),s.jsx(Je,{value:"brl",className:"h-8 px-3 text-xs",children:"BRL"})]})}),s.jsxs("div",{className:"rounded-xl border border-border p-5",children:[s.jsx("div",{className:"grid grid-cols-3 gap-2.5",children:Wo[u].map(w=>{const{dollars:O,labelKey:q}=w;return s.jsxs("button",{type:"button",disabled:j,onClick:()=>{ee("credits_topup_clicked",{amount_cents:O*100,currency:u,tier_label:q,source:"exhausted_banner"}),C(O*100)},className:K("relative flex flex-col items-center gap-1 py-5 rounded-xl border transition-all duration-150 cursor-pointer","disabled:opacity-50 disabled:cursor-wait","border-border hover:border-foreground/20 hover:bg-muted/30"),children:[s.jsxs("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:[h,O]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:i(q)})]},O)})}),d?s.jsxs("div",{className:"flex gap-2 mt-3",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:h}),s.jsx(fn,{type:"number",min:"1",step:"1",placeholder:i("chat.creditsExhaustedBanner.customPlaceholder"),value:l,onChange:w=>m(w.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(ne,{className:"h-10",disabled:!N||j,onClick:()=>{ee("credits_topup_clicked",{amount_cents:Math.round(y*100),currency:u,tier_label:"custom",source:"exhausted_banner"}),C(Math.round(y*100))},children:i(j?"chat.creditsExhaustedBanner.opening":"chat.creditsExhaustedBanner.add")})]}):s.jsx("button",{type:"button",className:"w-full mt-3 text-xs text-muted-foreground hover:text-foreground transition-colors py-1",onClick:()=>c(!0),children:i("chat.creditsExhaustedBanner.enterCustom")})]}),s.jsx("div",{className:"mt-5 rounded-xl bg-muted/25 border border-border/50 p-4 space-y-3",children:Zo.map(w=>s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"flex items-center justify-center size-5 rounded-full bg-[hsl(var(--chart-1))]/15 shrink-0",children:s.jsx(Be,{size:12,className:"text-[hsl(var(--chart-1))]"})}),s.jsx("span",{className:"text-sm text-foreground/80",children:i(w)})]},w))})]}),e[30]=u,e[31]=h,e[32]=l,e[33]=y,e[34]=a,e[35]=N,e[36]=j,e[37]=d,e[38]=i,e[39]=C,e[40]=R):R=e[40];let U;e[41]!==i?(U=i("chat.creditsExhaustedBanner.dismiss"),e[41]=i,e[42]=U):U=e[42];let Y;e[43]!==n||e[44]!==U?(Y=s.jsx(ne,{variant:"ghost",size:"sm",onClick:n,children:U}),e[43]=n,e[44]=U,e[45]=Y):Y=e[45];let B;e[46]!==V||e[47]!==n||e[48]!==o.slug?(B=()=>{V({to:"/$org/settings/ai-providers",params:{org:o.slug}}),n?.()},e[46]=V,e[47]=n,e[48]=o.slug,e[49]=B):B=e[49];let L;e[50]!==i?(L=i("chat.creditsExhaustedBanner.manageProviders"),e[50]=i,e[51]=L):L=e[51];let M;e[52]!==B||e[53]!==L?(M=s.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:B,children:L}),e[52]=B,e[53]=L,e[54]=M):M=e[54];let H;e[55]!==Y||e[56]!==M?(H=s.jsxs("div",{className:"px-8 py-4 border-t border-border bg-muted/30 flex items-center justify-between",children:[Y,M]}),e[55]=Y,e[56]=M,e[57]=H):H=e[57];let W;e[58]!==P||e[59]!==R||e[60]!==H?(W=s.jsxs(mn,{className:"sm:max-w-[520px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:Xo,children:[P,R,H]}),e[58]=P,e[59]=R,e[60]=H,e[61]=W):W=e[61];let J;return e[62]!==W||e[63]!==k?(J=s.jsx(pn,{open:!0,onOpenChange:k,children:W}),e[62]=W,e[63]=k,e[64]=J):J=e[64],J}function Xo(t){return t.preventDefault()}const er={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 tr(t){const e=F.c(16),{kind:n,onDismiss:o,onSubscribe:V}=t,a=G(),{label:r,title:i}=er[n];let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(ht,{size:14}),e[0]=l):l=e[0];let m;e[1]!==r||e[2]!==a?(m=a(r),e[1]=r,e[2]=a,e[3]=m):m=e[3];let d;e[4]!==a||e[5]!==i?(d=a(i),e[4]=a,e[5]=i,e[6]=d):d=e[6];let c;e[7]!==n||e[8]!==V||e[9]!==a?(c=n==="trial_exhausted"?s.jsx(ne,{size:"sm",onClick:V,className:"h-7 text-xs",children:a("chat.subscriptionLimit.subscribeButton")}):void 0,e[7]=n,e[8]=V,e[9]=a,e[10]=c):c=e[10];let u;return e[11]!==o||e[12]!==m||e[13]!==d||e[14]!==c?(u=s.jsx(ue,{icon:l,label:m,title:d,defaultExpanded:!0,variant:"warning",onClose:o,footerRight:c}),e[11]=o,e[12]=m,e[13]=d,e[14]=c,e[15]=u):u=e[15],u}function sr(t){const e=t.trim(),n=e.startsWith("<")&&/<[a-z][\s\S]*>/i.test(e),o=/cloudflare|cf-[a-z-]+|error[\s_-]?code[\s_-]?5\d\d/i.test(e),V=/failed to fetch|networkerror|load failed|offline/i.test(e),a=/timeout|timed out|aborted|deadline/i.test(e),r=e.length>240,i=/sandbox failed to start(?::\s*(.+))?/is.exec(e);if(i){const l=i[1]?.trim().replace(/\.$/,"");return{summary:l?`Your sandbox didn't finish starting up (${l}). Try again.`:"Your sandbox didn't finish starting up. Try again.",rawDetails:t}}return o||n&&r?{summary:"Our servers are having a moment. Try sending again in a few seconds.",rawDetails:t}:V?{summary:"Lost connection. Check your network and try again.",rawDetails:t}:a?{summary:"That took longer than expected. Try again.",rawDetails:t}:n||r?{summary:"Something unexpected came back from the server. Try again.",rawDetails:t}:{summary:t,rawDetails:null}}const nr={length:"chat.highlight.warningDescriptionLength","content-filter":"chat.highlight.warningDescriptionContentFilter","tool-calls":"chat.highlight.warningDescriptionToolCalls"};function Ne(t){const e=F.c(29),n=G(),{variant:o,onDismiss:V}=t,a=o==="error";let r;e[0]!==a||e[1]!==n?(r=n(a?"chat.highlight.errorOccurred":"chat.highlight.responseIncomplete"),e[0]=a,e[1]=n,e[2]=r):r=e[2];const i=r,l=a?Hs:ss;let m;e[3]!==t.error||e[4]!==t.finishReason||e[5]!==t.variant||e[6]!==n?(m=t.variant==="error"?t.error.message:(()=>{const b=nr[t.finishReason];return b?n(b):n("chat.highlight.responseStoppedUnexpectedly",{reason:t.finishReason})})(),e[3]=t.error,e[4]=t.finishReason,e[5]=t.variant,e[6]=n,e[7]=m):m=e[7];const d=m;let c;e[8]!==a||e[9]!==d?(c=a?sr(d):{summary:d,rawDetails:null},e[8]=a,e[9]=d,e[10]=c):c=e[10];const{summary:u,rawDetails:p}=c;let h;e[11]!==l?(h=s.jsx(l,{size:14}),e[11]=l,e[12]=h):h=e[12];let f;e[13]!==a||e[14]!==t.onContinue||e[15]!==t.onFixInChat||e[16]!==n?(f=a?s.jsx(ne,{size:"sm",variant:"outline",onClick:t.onFixInChat,className:"h-7 text-xs",children:n("chat.highlight.fixInChat")}):s.jsx(ne,{size:"sm",variant:"outline",onClick:t.onContinue,className:"h-7 text-xs",children:n("chat.highlight.continue")}),e[13]=a,e[14]=t.onContinue,e[15]=t.onFixInChat,e[16]=n,e[17]=f):f=e[17];let x;e[18]!==p||e[19]!==n?(x=p?s.jsxs("details",{className:"group mx-4",children:[s.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:[s.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:s.jsx("path",{d:"m4.5 3 3 3-3 3"})}),s.jsx("span",{className:"group-open:hidden",children:n("chat.highlight.showTechnicalDetails")}),s.jsx("span",{className:"hidden group-open:inline",children:n("chat.highlight.hideTechnicalDetails")})]}),s.jsxs("div",{className:"relative mt-2",children:[s.jsx("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(p).then(()=>je.success(n("chat.highlight.copiedToClipboard"))).catch(()=>je.error(n("chat.highlight.couldNotCopy")))},"aria-label":n("chat.highlight.copyErrorDetails"),title:n("chat.highlight.copy"),className:"absolute right-1.5 top-1.5 z-10 flex h-6 w-6 items-center justify-center rounded-md bg-background/80 text-muted-foreground backdrop-blur-sm transition-colors hover:bg-background hover:text-foreground",children:s.jsx(Ws,{className:"size-3.5"})}),s.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:p})]})]}):null,e[18]=p,e[19]=n,e[20]=x):x=e[20];let A;return e[21]!==i||e[22]!==V||e[23]!==u||e[24]!==h||e[25]!==f||e[26]!==x||e[27]!==o?(A=s.jsx(ue,{icon:h,label:i,title:u,defaultExpanded:!0,variant:o,onClose:V,footerRight:f,children:x}),e[21]=i,e[22]=V,e[23]=u,e[24]=h,e[25]=f,e[26]=x,e[27]=o,e[28]=A):A=e[28],A}function Me(){const t=F.c(73),e=G(),{error:n,clearError:o,finishReason:V,clearFinishReason:a,messages:r,isStreaming:i,submit:l,sendMessage:m}=Ue(),[d,c]=be(),{virtualMcpId:u,createTaskWithMessage:p}=Es(),{chatMode:h,simpleModeTier:f}=Ie(),{mutate:x}=As("ORGANIZATION_BILLING_CHECKOUT_START","taskBoard.subscriptionPaywall.checkoutError");let A;t[0]!==x?(A=()=>x(),t[0]=x,t[1]=A):A=t[1];const b=A;let v;t[2]!==h||t[3]!==f||t[4]!==u?(v=oe=>({tier:f,mode:h,toolApprovalLevel:oe,agent:u?{id:u}:void 0}),t[2]=h,t[3]=f,t[4]=u,t[5]=v):v=t[5];const g=v;let C;t[6]!==d.toolApprovalLevel?(C=d.toolApprovalLevel??ts(),t[6]=d.toolApprovalLevel,t[7]=C):C=t[7];const j=C,y=r.at(-1),N=y?.role==="assistant"?y.parts:[],k=N.filter(ar),S=_t(N),_=It(N);let I;t[8]!==n||t[9]!==m||t[10]!==e?(I=()=>{if(n){const fe={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:e("chat.highlight.fixInChatMessage",{error:n.message})}]}]};m(fe)}},t[8]=n,t[9]=m,t[10]=e,t[11]=I):I=t[11];const D=I;let T;t[12]!==m||t[13]!==e?(T=()=>{const oe={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:e("chat.highlight.pleaseContinue")}]}]};m(oe)},t[12]=m,t[13]=e,t[14]=T):T=t[14];const z=T;let E;t[15]!==g||t[16]!==j||t[17]!==l?(E=(oe,fe)=>{l({kind:"toolOutput",toolCallId:oe.toolCallId,output:{response:fe}},g(j))},t[15]=g,t[16]=j,t[17]=l,t[18]=E):E=t[18];const P=E;let R;t[19]!==p||t[20]!==d||t[21]!==c||t[22]!==e||t[23]!==u?(R=oe=>{c({...d,toolApprovalLevel:"auto"}),p({virtualMcpId:u,message:{parts:[{type:"text",text:e("chat.highlight.implementPlanMessage",{plan:oe})}]}})},t[19]=p,t[20]=d,t[21]=c,t[22]=e,t[23]=u,t[24]=R):R=t[24];const U=R,Y=Vr;let B;t[25]!==g||t[26]!==l?(B=(oe,fe,Ae,ce)=>{l({kind:"approval",approvalId:oe,approved:fe,...Ae?{reason:Ae}:{}},g(ce))},t[25]=g,t[26]=l,t[27]=B):B=t[27];const L=B,M=Dt();if(M.isCreditExhausted){let oe;return t[28]!==o?(oe=s.jsx(Jo,{onDismiss:o}),t[28]=o,t[29]=oe):oe=t[29],oe}const{showError:H,showWarning:W,hasApprovals:J}=M,w=k.map(rr).join("|"),O=Tt(S)?.toolCallId??"",q=_.map(or).join("|");let Z;t[30]!==M.todos?(Z=s.jsx(Qo,{todos:M.todos}),t[30]=M.todos,t[31]=Z):Z=t[31];let X;t[32]!==o||t[33]!==M.subscriptionErrorKind||t[34]!==b?(X=M.subscriptionErrorKind&&s.jsx(tr,{kind:M.subscriptionErrorKind,onDismiss:o,onSubscribe:b}),t[32]=o,t[33]=M.subscriptionErrorKind,t[34]=b,t[35]=X):X=t[35];let te;t[36]!==o||t[37]!==n||t[38]!==D||t[39]!==H?(te=H&&s.jsx(Ne,{variant:"error",error:n,onDismiss:o,onFixInChat:D}),t[36]=o,t[37]=n,t[38]=D,t[39]=H,t[40]=te):te=t[40];let re;t[41]!==a||t[42]!==V||t[43]!==z||t[44]!==W?(re=W&&s.jsx(Ne,{variant:"warning",finishReason:V,onDismiss:a,onContinue:z}),t[41]=a,t[42]=V,t[43]=z,t[44]=W,t[45]=re):re=t[45];let Ve;t[46]!==q||t[47]!==L||t[48]!==J||t[49]!==i||t[50]!==_?(Ve=J&&s.jsx(So,{approvals:_,isStreaming:i,onRespond:L},q),t[46]=q,t[47]=L,t[48]=J,t[49]=i,t[50]=_,t[51]=Ve):Ve=t[51];let se;t[52]!==M.hasPlans||t[53]!==U||t[54]!==Y||t[55]!==i||t[56]!==S||t[57]!==O?(se=M.hasPlans&&s.jsx(Io,{plans:S,isStreaming:i,onApprove:U,onDismiss:Y},O),t[52]=M.hasPlans,t[53]=U,t[54]=Y,t[55]=i,t[56]=S,t[57]=O,t[58]=se):se=t[58];let ae;t[59]!==M.isWaitingForUserInput||t[60]!==P||t[61]!==i||t[62]!==w||t[63]!==k?(ae=M.isWaitingForUserInput&&s.jsx($t,{userAskParts:k,isStreaming:i,onSubmit:P},w),t[59]=M.isWaitingForUserInput,t[60]=P,t[61]=i,t[62]=w,t[63]=k,t[64]=ae):ae=t[64];let ie;return t[65]!==te||t[66]!==re||t[67]!==Ve||t[68]!==se||t[69]!==ae||t[70]!==Z||t[71]!==X?(ie=s.jsxs("div",{className:"absolute bottom-full left-0 right-0",children:[Z,X,te,re,Ve,se,ae]}),t[65]=te,t[66]=re,t[67]=Ve,t[68]=se,t[69]=ae,t[70]=Z,t[71]=X,t[72]=ie):ie=t[72],ie}function or(t){return t.approvalId}function rr(t){return t.toolCallId}function Vr(){document.querySelector("[data-chat-input]")?.focus()}function ar(t){return t.type==="tool-user_ask"}Me.Error=function(e){return s.jsx(Ne,{variant:"error",error:e.error,onDismiss:e.onDismiss,onFixInChat:e.onFixInChat})};Me.Warning=function(e){return s.jsx(Ne,{variant:"warning",finishReason:e.finishReason,onDismiss:e.onDismiss,onContinue:e.onContinue})};Me.UserAskQuestion=$t;function ir(t){const e=F.c(20),{taskId:n}=t,o=G(),V=Ps(n),a=Rs(V),r=Ls(),{stop:i,removeLocalMessage:l}=Ue();if(a.length===0)return null;let m;e[0]!==o?(m=o("chat.queueTray.sendNow"),e[0]=o,e[1]=m):m=e[1];let d;e[2]!==i?(d=()=>{i()},e[2]=i,e[3]=d):d=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(pt,{size:14}),e[4]=c):c=e[4];let u;e[5]!==m||e[6]!==d?(u=s.jsx(Te,{asChild:!0,children:s.jsx(ne,{type:"button",variant:"ghost",size:"icon-sm","aria-label":m,onClick:d,children:c})}),e[5]=m,e[6]=d,e[7]=u):u=e[7];let p;e[8]!==o?(p=o("chat.queueTray.sendNow"),e[8]=o,e[9]=p):p=e[9];let h;e[10]!==p?(h=s.jsx(_e,{side:"top",children:s.jsx("p",{className:"text-xs",children:p})}),e[10]=p,e[11]=h):h=e[11];let f;e[12]!==u||e[13]!==h?(f=s.jsxs(De,{delayDuration:400,children:[u,h]}),e[12]=u,e[13]=h,e[14]=f):f=e[14];let x;return e[15]!==r||e[16]!==l||e[17]!==o||e[18]!==n?(x=(A,b)=>s.jsxs("div",{className:"group/queuerow flex items-center gap-2 px-3 py-1.5",children:[s.jsx("span",{className:"flex size-[18px] shrink-0 items-center justify-center rounded-full bg-muted text-[10px] font-semibold text-muted-foreground dark:bg-background",children:b+1}),s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:A.text}),s.jsx("div",{className:"flex shrink-0 items-center gap-1 opacity-0 transition-opacity focus-within:opacity-100 group-hover/queuerow:opacity-100",children:s.jsx(ne,{type:"button",variant:"ghost",size:"icon-sm",title:o("chat.queueTray.removeFromQueue"),"aria-label":o("chat.queueTray.removeFromQueue"),onClick:()=>{r.cancel(n,A.messageId).then(v=>{v&&(Fs(n,A.messageId),l(A.messageId))})},children:s.jsx(bn,{className:"size-3.5"})})})]},A.messageId),e[15]=r,e[16]=l,e[17]=o,e[18]=n,e[19]=x):x=e[19],s.jsxs("div",{className:"mb-1 overflow-hidden rounded-2xl border border-border bg-card dark:bg-muted",children:[s.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:[s.jsx("span",{children:o(a.length===1?"chat.queueTray.queuedMessage":"chat.queueTray.queuedMessages",{count:a.length})}),f]}),a.map(x)]})}function lr(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 cr={fast:"chat.tierTrigger.tierFast",smart:"chat.tierTrigger.tierSmart",thinking:"chat.tierTrigger.tierThinking"};function dr(t){const e=F.c(31),{tier:n,orgSlot:o,userSlot:V,autoSlot:a,onPick:r,onReset:i,onClose:l}=t,m=G(),d=Nt(),c=new Set(d.map(ur)),u=zs([V,o,a],c),p=u?.keyId??null,[h,f]=$.useState(p??d[0]?.id??null),x=d.some(R=>R.id===h)?h:p??d[0]?.id??null,A=x?d.find(R=>R.id===x):null,b="flex h-[70vh] max-h-[460px] w-full flex-col",v=cr[n];let g;e[0]!==m||e[1]!==v?(g=m(v),e[0]=m,e[1]=v,e[2]=g):g=e[2];let C;e[3]!==g?(C=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:g}),e[3]=g,e[4]=C):C=e[4];let j;e[5]!==i||e[6]!==m||e[7]!==V?(j=V&&s.jsx("button",{type:"button",onClick:i,className:"text-xs text-muted-foreground hover:text-foreground px-2 py-1 rounded-md hover:bg-accent cursor-pointer",children:m("chat.modelPreferences.reset")}),e[5]=i,e[6]=m,e[7]=V,e[8]=j):j=e[8];let y;e[9]!==C||e[10]!==j?(y=s.jsxs("div",{className:"flex items-center justify-between px-3 h-8 shrink-0",children:[C,j]}),e[9]=C,e[10]=j,e[11]=y):y=e[11];const N="flex-1 min-h-0",k=$.Suspense;let S;e[12]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(An,{}),e[12]=S):S=e[12];const _=_n,I=!0,D=lr(p?u:null,A?.providerId??"deco");let T;e[13]!==x||e[14]!==r||e[15]!==f?(T=R=>{const U=R.keyId??x??"";f(U),r({keyId:U,modelId:R.modelId,title:R.title})},e[13]=x,e[14]=r,e[15]=f,e[16]=T):T=e[16];let z;e[17]!==_||e[18]!==x||e[19]!==l||e[20]!==f||e[21]!==D||e[22]!==T?(z=s.jsx(_,{compact:I,onClose:l,credentialId:x,onCredentialChange:f,selectedModel:D,onModelChange:T}),e[17]=_,e[18]=x,e[19]=l,e[20]=f,e[21]=D,e[22]=T,e[23]=z):z=e[23];let E;e[24]!==k||e[25]!==z||e[26]!==S?(E=s.jsx("div",{className:N,children:s.jsx(k,{fallback:S,children:z})}),e[24]=k,e[25]=z,e[26]=S,e[27]=E):E=e[27];let P;return e[28]!==E||e[29]!==y?(P=s.jsxs("div",{className:b,children:[y,E]}),e[28]=E,e[29]=y,e[30]=P):P=e[30],P}function ur(t){return t.id}const mr=["fast","smart","thinking"];function Ut(t){return{fast:t("chat.tierTrigger.tierFast"),smart:t("chat.tierTrigger.tierSmart"),thinking:t("chat.tierTrigger.tierThinking")}}const pr={fast:"chat.agentModels.quickerResponses",smart:"chat.agentModels.balancedQuality",thinking:"chat.agentModels.deeperReasoning"};function fr(t){const e=F.c(28),{tier:n,pillIcon:o,groups:V}=t,a=G();let r;e[0]!==a?(r=Ut(a),e[0]=a,e[1]=r):r=e[1];const i=r,[l,m]=$.useState(!1);let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=N=>{N.onSelect(),m(!1)},e[2]=d):d=e[2];const c=d,u=i[n];let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p=K("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),e[3]=p):p=e[3];let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=K("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]=h):h=e[4];const f=i[n];let x;e[5]!==f?(x=s.jsx("span",{className:h,children:f}),e[5]=f,e[6]=x):x=e[6];let A;e[7]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(jt,{size:12,className:"opacity-60 hidden @[320px]/chat-bottom:inline-block"}),e[7]=A):A=e[7];let b;e[8]!==o||e[9]!==u||e[10]!==x?(b=s.jsx(Te,{asChild:!0,children:s.jsx("span",{className:"inline-flex min-w-0 shrink",children:s.jsx(yt,{asChild:!0,children:s.jsxs(ne,{type:"button",variant:"ghost",size:"default","aria-label":u,className:p,children:[o,x,A]})})})}),e[8]=o,e[9]=u,e[10]=x,e[11]=b):b=e[11];let v;e[12]!==u?(v=s.jsx(_e,{children:u}),e[12]=u,e[13]=v):v=e[13];let g;e[14]!==b||e[15]!==v?(g=s.jsxs(De,{children:[b,v]}),e[14]=b,e[15]=v,e[16]=g):g=e[16];let C;if(e[17]!==V||e[18]!==a){let N;e[20]!==a?(N=k=>s.jsx("div",{className:"flex flex-col",children:k.rows.map(S=>s.jsxs("div",{className:"group/tier-row relative flex items-stretch rounded-md hover:bg-muted",children:[s.jsxs("button",{type:"button",role:"menuitem","aria-label":S.title,onClick:()=>c(S),className:K("flex flex-1 min-w-0 items-start gap-2 px-2 py-1.5 text-left",S.modelOverride&&"pr-7 [@media(hover:hover)]:pr-2"),children:[S.icon&&s.jsx("span",{className:"shrink-0 text-muted-foreground mt-0.5",children:S.icon}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"text-sm",children:S.title}),S.subtitle&&s.jsx("div",{className:"text-xs text-muted-foreground",children:S.subtitle})]}),S.active&&s.jsx("span",{title:a("chat.tierTrigger.selected"),children:s.jsx(Be,{size:14,className:"text-foreground mt-0.5"})})]}),S.modelOverride&&s.jsx(xr,{label:S.title,render:S.modelOverride})]},S.key))},k.key),e[20]=a,e[21]=N):N=e[21],C=V.map(N),e[17]=V,e[18]=a,e[19]=C}else C=e[19];let j;e[22]!==C?(j=s.jsx(wt,{align:"end",className:"p-1 w-64",onOpenAutoFocus:hr,children:s.jsx("div",{role:"menu",className:"flex flex-col",children:C})}),e[22]=C,e[23]=j):j=e[23];let y;return e[24]!==l||e[25]!==g||e[26]!==j?(y=s.jsxs(Ct,{open:l,onOpenChange:m,children:[g,j]}),e[24]=l,e[25]=g,e[26]=j,e[27]=y):y=e[27],y}function hr(t){return t.preventDefault()}function xr(t){const e=F.c(38),{label:n,render:o}=t,V=G(),a=Sn(),[r,i]=$.useState(!1);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>i(!1),e[0]=l):l=e[0];const m=l;let d;e[1]!==n||e[2]!==V?(d=V("chat.modelPreferences.customizeModel",{tier:n}),e[1]=n,e[2]=V,e[3]=d):d=e[3];const c=r&&"opacity-100";let u;e[4]!==c?(u=K("absolute right-1 top-1/2 -translate-y-1/2 flex items-center justify-center","size-6 rounded-md bg-background border border-border/60 shadow-sm","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",c),e[4]=c,e[5]=u):u=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(ks,{size:14}),e[6]=p):p=e[6];let h;e[7]!==d||e[8]!==u?(h=s.jsx("button",{type:"button","aria-label":d,className:u,children:p}),e[7]=d,e[8]=u,e[9]=h):h=e[9];const f=h;if(a){let g;e[10]!==f?(g=s.jsx(yn,{asChild:!0,children:f}),e[10]=f,e[11]=g):g=e[11];let C;e[12]!==n||e[13]!==V?(C=V("chat.modelPreferences.customizeModel",{tier:n}),e[12]=n,e[13]=V,e[14]=C):C=e[14];let j;e[15]!==C?(j=s.jsx(wn,{className:"sr-only",children:C}),e[15]=C,e[16]=j):j=e[16];let y;e[17]!==r||e[18]!==o?(y=r&&o(m),e[17]=r,e[18]=o,e[19]=y):y=e[19];let N;e[20]!==y||e[21]!==j?(N=s.jsxs(Cn,{className:"p-0 flex flex-col max-h-[95vh]",children:[j,y]}),e[20]=y,e[21]=j,e[22]=N):N=e[22];let k;return e[23]!==r||e[24]!==N||e[25]!==g?(k=s.jsxs(Nn,{open:r,onOpenChange:i,children:[g,N]}),e[23]=r,e[24]=N,e[25]=g,e[26]=k):k=e[26],k}let x;e[27]!==f?(x=s.jsx(yt,{asChild:!0,children:f}),e[27]=f,e[28]=x):x=e[28];let A;e[29]!==r||e[30]!==o?(A=r&&o(m),e[29]=r,e[30]=o,e[31]=A):A=e[31];let b;e[32]!==A?(b=s.jsx(wt,{side:"right",align:"start",collisionPadding:12,className:"w-[min(22rem,calc(100vw-2rem))] p-0 overflow-hidden",children:A}),e[32]=A,e[33]=b):b=e[33];let v;return e[34]!==r||e[35]!==x||e[36]!==b?(v=s.jsxs(Ct,{open:r,onOpenChange:i,children:[x,b]}),e[34]=r,e[35]=x,e[36]=b,e[37]=v):v=e[37],v}function lt(t){return t==="fast"?s.jsx(ht,{size:16}):t==="thinking"?s.jsx(Ss,{size:16}):s.jsx(kn,{size:16})}function gr(t){const e=F.c(13),n=Us();let o;e[0]!==t||e[1]!==n.tiers?(o=m=>{const d=n.tiers[m];return d?d.title??d.modelId:t.chat[m]?.title},e[0]=t,e[1]=n.tiers,e[2]=o):o=e[2];const V=o;let a;e[3]!==V?(a=V("fast"),e[3]=V,e[4]=a):a=e[4];let r;e[5]!==V?(r=V("smart"),e[5]=V,e[6]=r):r=e[6];let i;e[7]!==V?(i=V("thinking"),e[7]=V,e[8]=i):i=e[8];let l;return e[9]!==a||e[10]!==r||e[11]!==i?(l={fast:a,smart:r,thinking:i},e[9]=a,e[10]=r,e[11]=i,e[12]=l):l=e[12],l}function br(){const t=F.c(22),e=G(),{simpleModeTier:n,setSimpleModeTier:o}=Ie(),V=In(),a=Nt(),r=Tn(a),i=gr(r),{data:l,error:m}=Bs();let d;t[0]!==l?(d=l===void 0?{tiers:{}}:l,t[0]=l,t[1]=d):d=t[1];const c=d,u=$s();let p,h;if(t[2]!==r||t[3]!==V||t[4]!==o||t[5]!==e||t[6]!==n||t[7]!==i||t[8]!==u||t[9]!==c||t[10]!==m){const v=Ut(e);p="decopilot",h=mr.map(g=>{const C=i[g],j=c.tiers[g];return{key:`decopilot-${g}`,icon:lt(g),title:v[g],subtitle:C??e(pr[g]),active:n===g,onSelect:()=>o(g),modelOverride:y=>s.jsxs(s.Fragment,{children:[m&&s.jsx("div",{className:"text-xs text-destructive p-3 pb-0",children:e("chat.modelPreferences.loadFailed")}),s.jsx(dr,{tier:g,orgSlot:V.tiers[g],userSlot:j,autoSlot:r.chat[g],onClose:y,onPick:N=>u.mutate({tier:g,slot:N}),onReset:()=>u.mutate({tier:g,slot:null})},`${g}:${j?.keyId??"org"}:${j?.modelId??""}`)]})}}),t[2]=r,t[3]=V,t[4]=o,t[5]=e,t[6]=n,t[7]=i,t[8]=u,t[9]=c,t[10]=m,t[11]=p,t[12]=h}else p=t[11],h=t[12];let f;t[13]!==p||t[14]!==h?(f=[{key:p,rows:h}],t[13]=p,t[14]=h,t[15]=f):f=t[15];const x=f;let A;t[16]!==n?(A=lt(n),t[16]=n,t[17]=A):A=t[17];let b;return t[18]!==x||t[19]!==A||t[20]!==n?(b=s.jsx(fr,{tier:n,pillIcon:A,groups:x}),t[18]=x,t[19]=A,t[20]=n,t[21]=b):b=t[21],b}function Ot(t){const e=F.c(3),[n]=be();let o;return e[0]!==n.enableSounds||e[1]!==t?(o=()=>{n.enableSounds&&Gn(t.dataUri).catch(a=>{console.warn(`[sound] ${t.name} playback failed:`,a)})},e[0]=n.enableSounds,e[1]=t,e[2]=o):o=e[2],o}const Ar={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"},vr=ps.togglePlanMode.keys.map(t=>t==="Shift"?"⇧":t).join(""),jr=[{src:"/connections/gmail.png",name:"Gmail"},{src:"/connections/perplexity.png",name:"Perplexity"},{src:"/connections/github.png",name:"GitHub"}];function yr(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex items-center -space-x-1.5",children:jr.map(wr)}),t[0]=e):e=t[0],e}function wr(t){return s.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-1 ring-border object-cover bg-white"},t.name)}function Cr({disabled:t,onOpenConnections:e,virtualMcpId:n,selectedModel:o,isStreaming:V,onUnsupportedFile:a}){const r=G(),[i,l]=$.useState(!1),m=Ot(Ar),{org:d}=Se(),{editor:c}=ut(),u=$.useRef(null),p=Ye(o),h=()=>{!p||V||(l(!1),u.current?.click())},f=async w=>{const O=w.target.files;if(!O||O.length===0||!c)return;const q=Array.from(O);try{let Z=c.state.selection.from;for(const X of q)await St(c,o??null,X,Z,a,r),Z=c.state.selection.to}finally{u.current&&(u.current.value="")}},x=Fn({connectionId:n,orgId:d.id,orgSlug:d.slug}),A=ns.virtualMcpPrompts(n,d.id),{data:b,isLoading:v}=os({queryKey:A,queryFn:()=>zn(x),staleTime:6e4,enabled:i&&!!x}),g=b?.prompts??[],[C,j]=$.useState(null),{chatMode:y,setChatMode:N}=Ie(),[k,S]=be(),_=me.find(w=>w.value===k.toolApprovalLevel)??me[0],I=r(_.shortKey),D=w=>{const O=me.find(q=>q.value===w);if(O){if(O.value===k.toolApprovalLevel){l(!1);return}m(),ee("chat_approval_level_changed",{from_level:k.toolApprovalLevel,to_level:O.value,source:"tools_popover"}),S({...k,toolApprovalLevel:O.value}),l(!1)}},T=y==="plan",z=()=>{m();const w=T?"default":"plan";ee("chat_mode_changed",{from_mode:y,to_mode:w,source:"tools_popover"}),N(w),l(!1)},E=()=>{e(),l(!1)},P=async(w,O)=>{if(!c||!x)return;const q=Xe(w._meta),Z={from:c.state.selection.from,to:c.state.selection.to};try{const X=await Bn(x,w.name,O);ms(c,Z,{id:w.name,name:Ln(w.name,q),metadata:X.messages,char:"/",kind:"prompt",args:O})}catch{je.error(r("chat.toolsPopover.failedLoadPrompt"))}},R=async w=>{l(!1);const O=!!(w.arguments&&w.arguments.length>0);if(ee("chat_prompt_inserted",{prompt_name:w.name,with_arguments:O}),O){j(w);return}await P(w)},U=async w=>{C&&(await P(C,w),j(null))},Y=()=>{m();const w=y==="gen-image"?"default":"gen-image";ee("chat_mode_changed",{from_mode:y,to_mode:w,source:"tools_popover"}),N(w),l(!1)},B=()=>{m();const w=y==="web-search"?"default":"web-search";ee("chat_mode_changed",{from_mode:y,to_mode:w,source:"tools_popover"}),N(w),l(!1)},L=()=>{m();const w=y==="deep-research"?"default":"deep-research";ee("chat_mode_changed",{from_mode:y,to_mode:w,source:"tools_popover"}),N(w),l(!1)},M=y==="gen-image",H=y==="web-search",W=y==="deep-research",J=s.jsx("input",{ref:u,type:"file",multiple:!0,accept:vn(o??null),className:"hidden",onChange:f,disabled:V});return s.jsxs(s.Fragment,{children:[J,s.jsxs($n,{open:i,onOpenChange:w=>{w&&!i&&ee("chat_tools_popover_opened",{chat_mode:y}),l(w)},children:[s.jsx(Un,{asChild:!0,children:s.jsxs(ne,{type:"button",variant:"ghost",size:"default",disabled:t,title:r("chat.toolsPopover.tools"),"aria-label":r("chat.toolsPopover.tools"),className:K("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),children:[s.jsx(Is,{size:14}),s.jsx("span",{className:K("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:r("chat.toolsPopover.tools")})]})}),s.jsxs(On,{align:"start",className:"w-56 p-1.5 space-y-1",children:[p?s.jsxs(de,{onClick:h,disabled:V,children:[s.jsx(nt,{size:16}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.addFile")})]}):s.jsxs(De,{children:[s.jsx(Te,{asChild:!0,children:s.jsxs(de,{"aria-disabled":"true",className:"opacity-50 cursor-not-allowed",onSelect:w=>w.preventDefault(),children:[s.jsx(nt,{size:16}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.addFile")})]})}),s.jsx(_e,{side:"right",children:r("chat.toolsPopover.modelNoFileSupport")})]}),s.jsxs(de,{onClick:z,className:K(T&&"text-special"),children:[s.jsx(xt,{size:16,className:K(T&&"text-special")}),s.jsx("span",{className:"flex-1 whitespace-nowrap",children:r("chat.toolsPopover.planMode")}),s.jsx("span",{className:K("text-xs text-muted-foreground",T&&"text-special font-medium"),children:vr})]}),s.jsxs(de,{onClick:Y,className:K(M&&"text-special"),children:[s.jsx(At,{size:16,className:K(M&&"text-special")}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.createImage")}),M&&s.jsx("span",{className:"text-xs text-special font-medium",children:r("chat.toolsPopover.on")})]}),s.jsxs(de,{onClick:B,className:K(H&&"text-special"),children:[s.jsx(gt,{size:16,className:K(H&&"text-special")}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.webSearch")}),H&&s.jsx("span",{className:"text-xs text-special font-medium",children:r("chat.toolsPopover.on")})]}),s.jsxs(de,{onClick:L,className:K(W&&"text-special"),children:[s.jsx(bt,{size:16,className:K(W&&"text-special")}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.deepResearch")}),W&&s.jsx("span",{className:"text-xs text-special font-medium",children:r("chat.toolsPopover.on")})]}),s.jsxs(et,{children:[s.jsxs(tt,{className:"gap-2",children:[s.jsx("span",{className:"flex size-4 items-center justify-center text-base font-medium text-muted-foreground",children:"/"}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.prompts")})]}),s.jsx(st,{className:"w-80 max-h-72 overflow-y-auto p-1.5",children:v?s.jsxs("div",{className:"flex items-center gap-2 px-2 py-3 text-sm text-muted-foreground",children:[s.jsx(rs,{className:"size-3.5"}),r("chat.toolsPopover.loadingPrompts")]}):g.length===0?s.jsx("div",{className:"px-2 py-3 text-sm text-muted-foreground",children:r("chat.toolsPopover.noPromptsAvailable")}):g.map(w=>s.jsxs(de,{onClick:()=>R(w),className:"flex flex-col items-start gap-0.5",children:[s.jsx("span",{className:"font-medium text-sm capitalize",children:w.title||Rn(w.name,Xe(w._meta))}),w.description&&s.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:w.description})]},w.name))})]}),s.jsxs(et,{children:[s.jsxs(tt,{className:"gap-2",children:[s.jsx(ke,{size:16}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.approval")}),s.jsx("span",{className:"text-xs text-muted-foreground",children:I})]}),s.jsx(st,{className:"w-48 p-1.5",children:s.jsx(Kn,{value:k.toolApprovalLevel,onValueChange:D,children:me.map(w=>s.jsx(Qn,{value:w.value,children:r(w.labelKey)},w.value))})})]}),s.jsxs(de,{onClick:E,children:[s.jsx(Yn,{size:16}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.connections")}),s.jsx($.Suspense,{children:s.jsx(yr,{})})]})]})]}),s.jsx(us,{prompt:C,setPrompt:j,onSubmit:U})]})}const Nr=[{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 Sr(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex items-center -space-x-1",children:Nr.map(kr)}),t[0]=e):e=t[0],e}function kr(t){return s.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-2 ring-muted object-cover bg-white"},t.name)}function Ir(t){const e=F.c(10),{onClick:n}=t,o=G();let V;e[0]===Symbol.for("react.memo_cache_sentinel")?(V=K("group relative z-10 flex items-center gap-3 w-full px-4 py-3","rounded-b-2xl","cursor-pointer"),e[0]=V):V=e[0];let a;e[1]!==o?(a=o("chat.connectionsBanner.description"),e[1]=o,e[2]=a):a=e[2];let r;e[3]!==a?(r=s.jsx("p",{className:"flex-1 text-xs text-muted-foreground truncate text-left",children:a}),e[3]=a,e[4]=r):r=e[4];let i,l;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Sr,{}),l=s.jsx(Jn,{size:14,className:"shrink-0 text-muted-foreground/60 group-hover:text-muted-foreground transition-colors"}),e[5]=i,e[6]=l):(i=e[5],l=e[6]);let m;return e[7]!==n||e[8]!==r?(m=s.jsxs("button",{type:"button",onClick:n,className:V,children:[r,i,l]}),e[7]=n,e[8]=r,e[9]=m):m=e[9],m}const ve=48;function Tr(){const t=F.c(9),[e,n]=$.useState("idle"),[o,V]=$.useState(""),[a,r]=$.useState(""),[i,l]=$.useState(Mr),m=$.useRef(null),d=$.useRef(null),c=$.useRef(null),u=$.useRef(null),p=$.useRef(0),h=$.useRef(!1),f=$.useRef(""),x=$.useRef(""),A=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition);let b;t[0]===Symbol.for("react.memo_cache_sentinel")?(b=()=>{p.current&&(cancelAnimationFrame(p.current),p.current=0),d.current?.close().catch(Dr),u.current?.getTracks().forEach(_r),c.current=null,d.current=null,u.current=null},t[0]=b):b=t[0];const v=b;let g;if(t[1]===Symbol.for("react.memo_cache_sentinel")){const _=I=>{u.current=I;const D=new AudioContext;d.current=D;const T=D.createMediaStreamSource(I),z=D.createAnalyser();z.fftSize=128,z.smoothingTimeConstant=.8,T.connect(z),c.current=z;const E=new Uint8Array(z.frequencyBinCount),P=()=>{if(!c.current)return;c.current.getByteFrequencyData(E);const R=[];for(let U=0;U<ve;U++){const Y=Math.floor(U/ve*E.length);R.push(Math.max(.04,(E[Y]??0)/255))}l(R),p.current=requestAnimationFrame(P)};P()};g=async()=>{const I=window.SpeechRecognition||window.webkitSpeechRecognition;if(!I)return n("unsupported"),"unsupported";let D;try{D=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{return n("permission-denied"),"permission-denied"}V(""),r(""),x.current="",f.current="",h.current=!0,n("recording"),_(D);const T=new I;m.current=T,T.interimResults=!0,T.continuous=!0,T.lang=navigator.language||"en-US",T.onresult=z=>{if(m.current!==T)return;let E="",P="";for(let R=z.resultIndex;R<z.results.length;R++){const U=z.results[R],Y=U?.[0]?.transcript??"";U?.isFinal?P=P+Y:E=E+Y}P&&(f.current=f.current+P,V(f.current)),x.current=E,r(E)},T.onerror=z=>{m.current===T&&z.error!=="no-speech"&&(h.current=!1,m.current=null,v(),n(z.error==="not-allowed"?"permission-denied":"idle"))},T.onend=()=>{if(m.current===T&&h.current)try{T.start()}catch{}};try{T.start()}catch{return h.current=!1,m.current=null,v(),n("idle"),"idle"}return"recording"},t[1]=g}else g=t[1];const C=g;let j;t[2]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{h.current=!1,m.current?.stop(),v(),n("idle"),l(Array(ve).fill(.05)),r("");const _=(f.current+(x.current?" "+x.current:"")).trim();return V(""),f.current="",x.current="",_},t[2]=j):j=t[2];const y=j;let N;t[3]===Symbol.for("react.memo_cache_sentinel")?(N=()=>{h.current=!1,m.current?.abort(),v(),n("idle"),V(""),r(""),l(Array(ve).fill(.05)),f.current="",x.current=""},t[3]=N):N=t[3];const k=N;let S;return t[4]!==a||t[5]!==e||t[6]!==o||t[7]!==i?(S={status:e,transcript:o,interimTranscript:a,waveformData:i,isSupported:A,startRecording:C,stopRecording:y,cancelRecording:k},t[4]=a,t[5]=e,t[6]=o,t[7]=i,t[8]=S):S=t[8],S}function _r(t){return t.stop()}function Dr(){}function Mr(){return Array(ve).fill(.05)}function Er(t){const e=F.c(4),{data:n}=t;let o;e[0]!==n?(o=n.map(Pr),e[0]=n,e[1]=o):o=e[1];let V;return e[2]!==o?(V=s.jsx("div",{className:"flex items-center justify-center gap-[2px] h-10 overflow-hidden","aria-hidden":"true",children:o}),e[2]=o,e[3]=V):V=e[3],V}function Pr(t,e){return s.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)}function Rr(t){return t.hasDraft?"send":t.isStreaming||t.isRunInProgress?"stop":"disabled"}function we(t){const e=F.c(7),{message:n,icon:o}=t;let V;e[0]!==o?(V=o??s.jsx(dt,{size:14,className:"shrink-0"}),e[0]=o,e[1]=V):V=e[1];const a=n??"";let r;e[2]!==a?(r=s.jsx("span",{className:"text-sm",children:a}),e[2]=a,e[3]=r):r=e[3];let i;return e[4]!==V||e[5]!==r?(i=s.jsxs("div",{className:"flex w-full items-center gap-2 px-3 py-2.5 rounded-xl border border-border bg-muted/40 text-muted-foreground",children:[V,r]}),e[4]=V,e[5]=r,e[6]=i):i=e[6],i}function Lr(t,e,n){const o=F.c(7),{editor:V}=ut(),a=G(),[r,i]=$.useState(!1),l=$.useRef(0);let m,d;return o[0]!==n||o[1]!==V||o[2]!==e||o[3]!==t||o[4]!==a?(m=()=>{const c=f=>{f.dataTransfer?.types.includes("Files")&&(f.preventDefault(),l.current=l.current+1,i(!0))},u=f=>{f.preventDefault(),l.current=Math.max(0,l.current-1),l.current===0&&i(!1)},p=Fr,h=f=>{if(f.preventDefault(),l.current=0,i(!1),n||!V||!t||!Ye(t))return;const x=f.dataTransfer?.files;if(!x||x.length===0)return;const A=Array.from(x);(async()=>{let b=V.state.selection.from;for(const v of A)await St(V,t,v,b,e,a),b=V.state.selection.to})()};return window.addEventListener("dragenter",c),window.addEventListener("dragleave",u),window.addEventListener("dragover",p),window.addEventListener("drop",h),()=>{window.removeEventListener("dragenter",c),window.removeEventListener("dragleave",u),window.removeEventListener("dragover",p),window.removeEventListener("drop",h)}},d=[V,t,e,a,n],o[0]=n,o[1]=V,o[2]=e,o[3]=t,o[4]=a,o[5]=m,o[6]=d):(m=o[5],d=o[6]),$.useEffect(m,d),r}function Fr(t){t.dataTransfer?.types.includes("Files")&&t.preventDefault()}function zr(t){const e=F.c(14),{selectedModel:n}=t,o=G();let V,a,r;if(e[0]!==n||e[1]!==o){const{parts:m}=jn(n);e[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Ms,{size:24}),e[5]=r):r=e[5],V="text-sm font-medium";let d;e[6]!==o?(d=c=>o(c),e[6]=o,e[7]=d):d=e[7],a=o("chat.input.dropFilesHere",{fileTypes:m.map(d).join(", ")}),e[0]=n,e[1]=o,e[2]=V,e[3]=a,e[4]=r}else V=e[2],a=e[3],r=e[4];let i;e[8]!==V||e[9]!==a?(i=s.jsx("span",{className:V,children:a}),e[8]=V,e[9]=a,e[10]=i):i=e[10];let l;return e[11]!==r||e[12]!==i?(l=s.jsxs(s.Fragment,{children:[r,i]}),e[11]=r,e[12]=i,e[13]=l):l=e[13],l}function Br(){const t=F.c(5),e=G();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(dt,{size:24}),t[0]=n):n=t[0];let o;t[1]!==e?(o=e("chat.input.modelCannotReadAttachments"),t[1]=e,t[2]=o):o=t[2];let V;return t[3]!==o?(V=s.jsxs(s.Fragment,{children:[n,s.jsx("span",{className:"text-sm font-medium",children:o})]}),t[3]=o,t[4]=V):V=t[4],V}function $r(t){const e=F.c(11),{selectedModel:n,onUnsupportedFile:o,disabled:V}=t,a=Lr(n,o,V);let r;e[0]!==n?(r=Ye(n),e[0]=n,e[1]=r):r=e[1];const i=r,l=a?"opacity-100":"opacity-0 pointer-events-none",m=i?"border-primary/40 text-primary/70":"border-destructive/30 text-destructive/70";let d;e[2]!==l||e[3]!==m?(d=K("absolute inset-0 z-20 rounded-xl flex flex-col items-center justify-center gap-2 bg-muted border-2 border-dashed transition-opacity",l,m),e[2]=l,e[3]=m,e[4]=d):d=e[4];let c;e[5]!==n||e[6]!==i?(c=i?s.jsx(zr,{selectedModel:n}):s.jsx(Br,{}),e[5]=n,e[6]=i,e[7]=c):c=e[7];let u;return e[8]!==d||e[9]!==c?(u=s.jsx("div",{className:d,children:c}),e[8]=d,e[9]=c,e[10]=u):u=e[10],u}function Ce(t){const e=F.c(14),{onClick:n,label:o,icon:V,colorClass:a,maxWidthClass:r}=t;let i;e[0]!==a?(i=K("flex items-center gap-1.5 h-8 rounded-lg px-2.5 text-sm font-medium group min-w-0 shrink animate-in fade-in duration-200",a),e[0]=a,e[1]=i):i=e[1];let l;e[2]!==r?(l=K("min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0 @[320px]/chat-bottom:opacity-100",r),e[2]=r,e[3]=l):l=e[3];let m;e[4]!==o||e[5]!==l?(m=s.jsx("span",{className:l,children:o}),e[4]=o,e[5]=l,e[6]=m):m=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx($e,{size:14,className:"shrink-0 hidden group-hover:block group-disabled:hidden"}),e[7]=d):d=e[7];let c;return e[8]!==V||e[9]!==o||e[10]!==n||e[11]!==i||e[12]!==m?(c=s.jsxs("button",{type:"button",onClick:n,title:o,"aria-label":o,className:i,children:[V,m,d]}),e[8]=V,e[9]=o,e[10]=n,e[11]=i,e[12]=m,e[13]=c):c=e[13],c}function Ur(){const t=F.c(6),e=ct(),{org:n,locator:o}=Se(),{create:V}=qs();let a;return t[0]!==V||t[1]!==o||t[2]!==e||t[3]!==n.id||t[4]!==n.slug?(a=async r=>{const{tiptapDoc:i,virtualMcp:l,taskIntake:m}=r,d=m===void 0?!1:m,c=crypto.randomUUID(),u=l?.id??Re(n.id).id;xs(sessionStorage,o,c,{tiptapDoc:d&&i?po(i):i});try{await V({id:c,virtual_mcp_id:u})}catch{}const p={autosend:gs};d&&(p.sidepanel=!0,p.mainpanel=!1),ls(e,cs({org:n.slug,agentId:u,superAgentId:Re(n.id).id}),{search:()=>({...p,thread:c}),replace:!1})},t[0]=V,t[1]=o,t[2]=e,t[3]=n.id,t[4]=n.slug,t[5]=a):a=t[5],a}function GV({onOpenContextPanel:t,showConnectionsBanner:e=!1,homeTaskComposer:n=!1}){const o=G(),V=Os(),a=Ks(),r=V?.messages??[],i=V?.isStreaming??!1,l=V?.isRunInProgress??!1,m=V?.stop??(()=>{}),d=a?.taskId??"",c=d||ws,u=Ur(),{selectedModel:p,selectedVirtualMcp:h,isModelsLoading:f,tiptapDocRef:x,imageModel:A,webSearchModel:b,deepResearchModel:v,chatMode:g,setChatMode:C}=Ie(),{data:j}=Vs.useSession(),y=j?.user?.id,{org:N,locator:k}=Se(),[S,_]=as(is.homeTaskMode(k),!0),I=n&&S,D=Re(N.id).id,T=hs(h?.id),z=Cs(T?.id).runtime==="cms",E=Ot(qn),[P,R]=$.useState(!1),{unsupportedFile:U,onUnsupportedFile:Y,clearUnsupportedFile:B}=Dn(),L=Tr(),M=$.useRef(void 0),H=async()=>{M.current=se;const Q=await L.startRecording();ee("chat_voice_started",{thread_id:d,outcome:Q==="recording"?"started":Q==="unsupported"?"unsupported":Q==="permission-denied"?"permission_denied":"unknown"})},W=()=>{ee("chat_voice_confirmed",{thread_id:d});const Q=L.stopRecording();ce.current?.syncVoiceText(M.current,Q),ce.current?.focus()},J=()=>{ee("chat_voice_cancelled",{thread_id:d}),L.cancelRecording(),ce.current?.restoreContent(M.current)};$.useEffect(()=>{if(L.status!=="recording")return;const Q=(L.transcript+(L.interimTranscript?" "+L.interimTranscript:"")).trim();ce.current?.syncVoiceText(M.current,Q)},[L.transcript,L.interimTranscript,L.status]);const w=a?.activeTask??null,O=w?.created_by,q=!!(y&&O&&O!==y),{data:Z}=Wn({enabled:q}),X=(Z?.data?.members??[]).find(Q=>Q.userId===O),te=X?.user?.name??X?.user?.email?.split("@")[0]??null,re=Xn(),Ve=Qs({isDesktopApp:re,harnessId:w?.harness_id}),[se,ae]=$.useState(()=>Ze(sessionStorage,k,c)??void 0),ie=Q=>{ae(Q),x.current=Q,ys(sessionStorage,k,c,Q,{onQuotaExceeded:({docSizeBytes:le})=>{ee("chat_draft_quota_exceeded",{thread_id:d||null,doc_size_bytes:le}),console.warn("[chat-draft] sessionStorage quota exceeded; draft not saved")}})},oe=$.useRef(d);if(oe.current!==d){oe.current=d;const Q=Ze(sessionStorage,k,c)??void 0;ae(Q),x.current=Q}const Ae=[...r].reverse().find(Q=>Q.role==="assistant")?.metadata?.modelLimits?.contextWindow??p?.limits?.contextWindow,ce=$.useRef(null),Ge=$.useRef(!1),Kt=g==="plan",ye=Q=>{E(),ee("chat_mode_changed",{from_mode:Q,to_mode:"default",source:"pill_dismiss"}),C("default")};$.useEffect(()=>{const Q=le=>{fs(le)&&le.code==="KeyL"&&(le.preventDefault(),le.shiftKey&&C(g==="plan"?"default":"plan"),ce.current?.focus())};return document.addEventListener("keydown",Q),()=>document.removeEventListener("keydown",Q)},[g,C]);const Qt=on(r),qe=[...r].reverse().find(Q=>Q.role==="assistant"&&Q.metadata?.usage)?.metadata?.usage?.contextTokens??0,Yt=!f&&!vs(se),he=Rr({hasDraft:Yt,isStreaming:i,isRunInProgress:l}),Ee=he==="send",xe=he==="stop",He=Q=>{if(Q?.preventDefault(),he==="send"&&se){if(ee("chat_message_sent",{thread_id:d||null,mode:g,model_id:p?.modelId??null,model_provider:p?.providerId??null,virtual_mcp_id:h?.id??null,submission:Q?"button_or_enter":"programmatic"}),V){if(V.isSendInFlight()){je.info(o("chat.input.stillSendingPreviousMessage"));return}V.sendMessage(se)}else I&&ee("task_report_submitted",{source:"home"}),u({tiptapDoc:se,virtualMcp:I?null:h,taskIntake:I});js(sessionStorage,k,c),ie(void 0)}else he==="stop"&&(ee("chat_message_stopped",{thread_id:d}),m())};if(q)return s.jsx(we,{message:te?o("chat.input.readOnlyOthersChatNamed",{name:te}):o("chat.input.readOnlyOthersChat"),icon:te?s.jsx(Hn,{shape:"circle",size:"2xs",url:X?.user?.image??void 0,fallback:te.slice(0,2).toUpperCase()}):void 0});if(w?.metadata?.read_only)return s.jsx(we,{message:o("chat.input.readOnlyThread")});if(Ve)return s.jsx(we,{message:o("chat.input.codingAgentRequiresDesktop")});if(z){if(!a)return s.jsx(we,{message:o("chat.input.fastPreviewUnavailable")});const Q=()=>{const le=a.createTask({runtime:"sandbox"});ee("coding_session_started",{thread_id:le})};return s.jsxs("button",{type:"button",onClick:Q,className:"group flex w-full items-center gap-3 rounded-2xl border border-border bg-background/60 px-4 py-3.5 text-left shadow-sm backdrop-blur-sm transition-colors hover:bg-background/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[s.jsx(Ts,{size:18,className:"shrink-0 text-muted-foreground"}),s.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[s.jsx("span",{className:"text-sm font-medium text-foreground",children:o("chat.fastPreview.startCodingSession")}),s.jsx("span",{className:"text-xs text-muted-foreground",children:o("chat.fastPreview.chatNeedsSession")})]}),s.jsx(mt,{size:16,className:"shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5"})]})}return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex flex-col w-full justify-end text-left",children:s.jsxs("div",{className:"relative rounded-2xl w-full flex flex-col",children:[e&&s.jsx("div",{className:"absolute inset-0 rounded-2xl pointer-events-none bg-muted/50"}),V&&a&&s.jsx(Me,{}),V&&a&&d?s.jsx(ir,{taskId:d}):null,s.jsx(Mn,{tiptapDoc:se,setTiptapDoc:ie,disabled:L.status==="recording",enterToSubmit:!0,placeholder:o(I?"chat.input.taskPlaceholder":"chat.input.placeholder"),onSubmit:He,suggestionOpenRef:Ge,children:s.jsxs("form",{onSubmit:He,className:K("w-full relative rounded-2xl min-h-[110px] md:min-h-[130px] flex flex-col bg-card dark:bg-muted card-shadow overflow-hidden"),children:[s.jsx($r,{selectedModel:p,onUnsupportedFile:Y,disabled:L.status==="recording"}),s.jsx("div",{className:"group/input relative flex flex-col gap-2 flex-1",children:s.jsx(En,{ref:ce,disabled:L.status==="recording",virtualMcpId:h?.id??D,showFileUploader:!0,selectedModel:p,onUnsupportedFile:Y,suggestionOpenRef:Ge})}),s.jsx("div",{className:"@container/chat-bottom flex items-center justify-between p-2.5 gap-1",children:L.status==="recording"?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex-1"}),s.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[s.jsx(Er,{data:L.waveformData.slice(0,28)}),s.jsx("button",{type:"button",onClick:J,className:"flex items-center justify-center size-8 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors","aria-label":o("chat.input.cancelRecording"),children:s.jsx($e,{size:16})}),s.jsx("button",{type:"button",onClick:W,className:"flex items-center justify-center size-8 rounded-lg bg-foreground text-background hover:opacity-80 transition-opacity","aria-label":o("chat.input.useTranscription"),children:s.jsx(Be,{size:16})})]})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[n&&s.jsx(ne,{type:"button",size:"sm",variant:S?"secondary":"ghost","aria-pressed":S,onClick:()=>_(!S),className:"h-8 rounded-lg",children:o("chat.input.taskMode")}),s.jsx(Cr,{disabled:!1,onOpenConnections:()=>{ee("connections_dialog_opened",{source:"tools_popover",mode:"add"}),R(!0)},virtualMcpId:h?.id??D,selectedModel:p,isStreaming:i,onUnsupportedFile:Y}),Kt&&s.jsx(Ce,{onClick:()=>ye("plan"),label:o("chat.input.planMode"),icon:s.jsx(xt,{size:14,className:"shrink-0"}),colorClass:"text-violet-600 dark:text-violet-400 hover:bg-violet-500/10",maxWidthClass:"@[320px]/chat-bottom:max-w-32"}),g==="gen-image"&&A&&s.jsx(Ce,{onClick:()=>ye("gen-image"),label:o("chat.input.createImage"),icon:s.jsx(At,{size:14,className:"shrink-0"}),colorClass:"text-pink-600 dark:text-pink-400 hover:bg-pink-500/10 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",maxWidthClass:"@[320px]/chat-bottom:max-w-[120px]"}),g==="web-search"&&b&&s.jsx(Ce,{onClick:()=>ye("web-search"),label:o("chat.input.webSearch"),icon:s.jsx(gt,{size:14,className:"shrink-0"}),colorClass:"text-blue-600 dark:text-blue-400 hover:bg-blue-500/10 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",maxWidthClass:"@[320px]/chat-bottom:max-w-[120px]"}),g==="deep-research"&&v&&s.jsx(Ce,{onClick:()=>ye("deep-research"),label:o("chat.input.deepResearch"),icon:s.jsx(bt,{size:14,className:"shrink-0"}),colorClass:"text-blue-600 dark:text-blue-400 hover:bg-blue-500/10 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",maxWidthClass:"@[320px]/chat-bottom:max-w-[120px]"}),Ae&&qe>0&&s.jsx(rn,{usage:Qt,totalTokens:qe,contextWindow:Ae,onOpenContextPanel:t})]}),s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[s.jsx(br,{}),L.isSupported&&s.jsx(ne,{type:"button",onClick:H,disabled:!1,variant:"ghost",size:"icon",className:K("size-8 rounded-lg transition-colors",L.status==="permission-denied"?"text-destructive hover:text-destructive hover:bg-destructive/10":"text-muted-foreground hover:text-foreground"),title:L.status==="permission-denied"?o("chat.input.microphoneAccessDenied"):o("chat.input.voiceInput"),"aria-label":L.status==="permission-denied"?o("chat.input.microphoneAccessDenied"):o("chat.input.voiceInput"),children:s.jsx(_s,{size:18})}),s.jsx(ne,{type:xe?"button":"submit",onClick:Q=>{xe&&(Q.preventDefault(),Q.stopPropagation(),m())},variant:Ee||xe?"default":"ghost",size:I?"sm":"icon",disabled:!Ee&&!xe,className:K(I?"h-8 px-3 rounded-lg transition-all":"size-8 rounded-lg transition-all",!Ee&&!xe&&"bg-muted text-muted-foreground hover:bg-muted hover:text-muted-foreground cursor-not-allowed"),title:o(he==="stop"?i?"chat.input.stopGenerating":"chat.input.cancelRun":I?"chat.input.startTask":"chat.input.sendMessageEnter"),"aria-label":o(he==="stop"?i?"chat.input.stopGenerating":"chat.input.cancelRun":I?"chat.input.startTask":"chat.input.sendMessage"),children:xe?s.jsx(Ds,{size:20}):s.jsxs(s.Fragment,{children:[I&&o("chat.input.startTask"),s.jsx(pt,{size:20})]})})]})]})})]})},d),n&&I&&s.jsx("p",{className:"px-3 pt-3 text-left text-xs text-muted-foreground",children:o("chat.input.taskHint")}),e&&s.jsx(Ir,{onClick:()=>{ee("connections_banner_clicked",{source:"home_chat_input"}),ee("connections_dialog_opened",{source:"home_banner",mode:"add"}),R(!0)}})]})}),s.jsx(Zn,{mode:"browse",open:P,onOpenChange:R,defaultTab:"all"}),s.jsx(Pn,{info:U,onClose:B})]})}export{GV as C,QV as H,Jo as a,YV as u};
@@ -1 +1 @@
1
- import{c as k,j as h,r as C,l as L}from"./index-gctAQu2T.js";import{n as Z}from"./Tool02-Darwb8nP.js";import{A as y}from"./agent-icon-DsGBCBNv.js";const M={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-9 w-9",md:"h-12 w-12",lg:"h-16 w-16",xl:"h-14 w-14"},R={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-9",md:"min-w-12",lg:"min-w-16",xl:"min-w-14"},T={"2xs":8,xs:12,sm:16,md:24,lg:32,xl:28},W={"2xs":"xs",xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"lg"};function G(E){const t=k.c(13),{icon:e,name:s,size:w,className:o,fallbackIcon:c,fit:g}=E,n=w===void 0?"md":w,I=g===void 0?"cover":g;if(e?.startsWith("icon://")||e?.includes("#agentcolor=")){const r=W[n];let l;return t[0]!==o||t[1]!==e||t[2]!==s||t[3]!==r?(l=h.jsx(y,{icon:e,name:s,size:r,className:o}),t[0]=o,t[1]=e,t[2]=s,t[3]=r,t[4]=l):l=t[4],l}const S=e??"no-icon";let i;return t[5]!==o||t[6]!==c||t[7]!==I||t[8]!==e||t[9]!==s||t[10]!==n||t[11]!==S?(i=h.jsx($,{icon:e,name:s,size:n,className:o,fallbackIcon:c,fit:I},S),t[5]=o,t[6]=c,t[7]=I,t[8]=e,t[9]=s,t[10]=n,t[11]=S,t[12]=i):i=t[12],i}function $(E){const t=k.c(25),{icon:e,name:s,size:w,className:o,fallbackIcon:c,fit:g}=E,n=w===void 0?"md":w,I=g===void 0?"cover":g,[S,i]=C.useState(!1),r=!!e&&S,l=M[n],p=R[n];let a;t[0]!==o||t[1]!==l||t[2]!==p?(a=L("rounded-lg border border-border shrink-0 overflow-hidden aspect-square bg-white",l,p,o),t[0]=o,t[1]=l,t[2]=p,t[3]=a):a=t[3];const N=e||void 0,_=I==="contain"?"object-contain":"object-cover",A=!r&&"hidden";let m;t[4]!==_||t[5]!==A?(m=L("h-full w-full",_,A),t[4]=_,t[5]=A,t[6]=m):m=t[6];let v,j;t[7]===Symbol.for("react.memo_cache_sentinel")?(v=()=>i(!1),j=()=>i(!0),t[7]=v,t[8]=j):(v=t[7],j=t[8]);let d;t[9]!==s||t[10]!==N||t[11]!==m?(d=h.jsx("img",{src:N,alt:s,className:m,onError:v,onLoad:j}),t[9]=s,t[10]=N,t[11]=m,t[12]=d):d=t[12];const z=r&&"hidden";let f;t[13]!==z?(f=L("h-full w-full flex items-center justify-center bg-muted/20",z),t[13]=z,t[14]=f):f=t[14];let x;t[15]!==c||t[16]!==n?(x=c??h.jsx(Z,{size:T[n],className:"text-muted-foreground"}),t[15]=c,t[16]=n,t[17]=x):x=t[17];let u;t[18]!==f||t[19]!==x?(u=h.jsx("div",{className:f,children:x}),t[18]=f,t[19]=x,t[20]=u):u=t[20];let b;return t[21]!==d||t[22]!==u||t[23]!==a?(b=h.jsxs("div",{className:a,children:[d,u]}),t[21]=d,t[22]=u,t[23]=a,t[24]=b):b=t[24],b}export{G as I};
1
+ import{c as k,j as h,r as C,l as L}from"./index-CVJEcf37.js";import{n as Z}from"./Tool02-A5gv-OOO.js";import{A as y}from"./agent-icon-BjknPEfN.js";const M={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-9 w-9",md:"h-12 w-12",lg:"h-16 w-16",xl:"h-14 w-14"},R={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-9",md:"min-w-12",lg:"min-w-16",xl:"min-w-14"},T={"2xs":8,xs:12,sm:16,md:24,lg:32,xl:28},W={"2xs":"xs",xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"lg"};function G(E){const t=k.c(13),{icon:e,name:s,size:w,className:o,fallbackIcon:c,fit:g}=E,n=w===void 0?"md":w,I=g===void 0?"cover":g;if(e?.startsWith("icon://")||e?.includes("#agentcolor=")){const r=W[n];let l;return t[0]!==o||t[1]!==e||t[2]!==s||t[3]!==r?(l=h.jsx(y,{icon:e,name:s,size:r,className:o}),t[0]=o,t[1]=e,t[2]=s,t[3]=r,t[4]=l):l=t[4],l}const S=e??"no-icon";let i;return t[5]!==o||t[6]!==c||t[7]!==I||t[8]!==e||t[9]!==s||t[10]!==n||t[11]!==S?(i=h.jsx($,{icon:e,name:s,size:n,className:o,fallbackIcon:c,fit:I},S),t[5]=o,t[6]=c,t[7]=I,t[8]=e,t[9]=s,t[10]=n,t[11]=S,t[12]=i):i=t[12],i}function $(E){const t=k.c(25),{icon:e,name:s,size:w,className:o,fallbackIcon:c,fit:g}=E,n=w===void 0?"md":w,I=g===void 0?"cover":g,[S,i]=C.useState(!1),r=!!e&&S,l=M[n],p=R[n];let a;t[0]!==o||t[1]!==l||t[2]!==p?(a=L("rounded-lg border border-border shrink-0 overflow-hidden aspect-square bg-white",l,p,o),t[0]=o,t[1]=l,t[2]=p,t[3]=a):a=t[3];const N=e||void 0,_=I==="contain"?"object-contain":"object-cover",A=!r&&"hidden";let m;t[4]!==_||t[5]!==A?(m=L("h-full w-full",_,A),t[4]=_,t[5]=A,t[6]=m):m=t[6];let v,j;t[7]===Symbol.for("react.memo_cache_sentinel")?(v=()=>i(!1),j=()=>i(!0),t[7]=v,t[8]=j):(v=t[7],j=t[8]);let d;t[9]!==s||t[10]!==N||t[11]!==m?(d=h.jsx("img",{src:N,alt:s,className:m,onError:v,onLoad:j}),t[9]=s,t[10]=N,t[11]=m,t[12]=d):d=t[12];const z=r&&"hidden";let f;t[13]!==z?(f=L("h-full w-full flex items-center justify-center bg-muted/20",z),t[13]=z,t[14]=f):f=t[14];let x;t[15]!==c||t[16]!==n?(x=c??h.jsx(Z,{size:T[n],className:"text-muted-foreground"}),t[15]=c,t[16]=n,t[17]=x):x=t[17];let u;t[18]!==f||t[19]!==x?(u=h.jsx("div",{className:f,children:x}),t[18]=f,t[19]=x,t[20]=u):u=t[20];let b;return t[21]!==d||t[22]!==u||t[23]!==a?(b=h.jsxs("div",{className:a,children:[d,u]}),t[21]=d,t[22]=u,t[23]=a,t[24]=b):b=t[24],b}export{G as I};
@@ -1 +1 @@
1
- import{c as r,l as n,j as i,br as p}from"./index-gctAQu2T.js";function c(o){const e=r.c(8);let t,s;e[0]!==o?({className:t,...s}=o,e[0]=o,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=n("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=i.jsx(p,{"data-slot":"label",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}export{c as L};
1
+ import{c as n,l as r,j as i,aV as p}from"./index-CVJEcf37.js";function c(o){const e=n.c(8);let t,s;e[0]!==o?({className:t,...s}=o,e[0]=o,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=r("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=i.jsx(p,{"data-slot":"label",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}export{c as L};
@@ -0,0 +1 @@
1
+ import{r as i,c as f}from"./index-CVJEcf37.js";import{g as c}from"./sandbox-lifecycle-context-BbTDNpeS.js";import{a as l}from"./decofile-api-BhjpITFN.js";function p(e,t,n){return e===null?0:Math.max(0,n-Math.max(0,t-e))}function m(e,t){const[n,r]=i.useState(e),a=i.useRef(e?Date.now():null);return i.useEffect(()=>{if(e){a.current??=Date.now(),r(!0);return}if(!n)return;const s=()=>{a.current=null,r(!1)},o=p(a.current,Date.now(),t);if(o===0){s();return}const u=setTimeout(s,o);return()=>clearTimeout(u)},[e,n,t]),n}const y=500;function D(e,t,n){const r=f.c(6);let a;r[0]!==n||r[1]!==e||r[2]!==t?(a=l(e,t,n),r[0]=n,r[1]=e,r[2]=t,r[3]=a):a=r[3];let s;r[4]!==a?(s={mutationKey:a},r[4]=a,r[5]=s):s=r[5];const o=c(s)>0;return m(o,y)}function K(e,t,n){return`deco:preview:last-page:${e}:${t}:${n}`}function g(e){if(!e)return null;try{const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t)||typeof t.path!="string"||!t.path.startsWith("/"))return null;const n=typeof t.pageKey=="string"?t.pageKey:null,r={};if(t.params&&typeof t.params=="object")for(const[a,s]of Object.entries(t.params))typeof s=="string"&&(r[a]=s);return{path:t.path,pageKey:n,params:r}}catch{return null}}function d(e){try{return g(localStorage.getItem(e))}catch{return null}}function x(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}export{K as l,d as r,D as u,x as w};
@@ -0,0 +1 @@
1
+ import{c as p,j as s,b as y,O as _,h as g,B as S,L as j,i as v,k as A,l as N}from"./index-CVJEcf37.js";import{P as b}from"./index-Clbrhj--.js";import{R}from"./required-auth-layout-TTElzhIM.js";import{u as T}from"./use-deployment-admin-D4Et99Id.js";const D=[{to:"/_admin/users",labelKey:"admin.layout.usersTab"},{to:"/_admin/orgs",labelKey:"admin.layout.organizationsTab"},{to:"/_admin/prompts",labelKey:"admin.layout.promptsTab"}];function K(){const e=p.c(6);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={select:L},e[0]=a):a=e[0];const d=A(a),r=y();let t;e[1]!==d||e[2]!==r?(t=D.map(i=>s.jsx(j,{to:i.to,className:N("-mb-px border-b-2 px-3 py-2.5 text-sm font-medium transition-colors",d.startsWith(i.to)?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:r(i.labelKey)},i.to)),e[1]=d,e[2]=r,e[3]=t):t=e[3];let o;return e[4]!==t?(o=s.jsx("nav",{className:"flex items-center gap-1 border-b border-border px-4 md:px-10",children:t}),e[4]=t,e[5]=o):o=e[5],o}function L(e){return e.location.pathname}function k(){const e=p.c(22),{isAdmin:a,loading:d,needsEmailVerification:r}=T(),t=y();if(d){let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"flex h-dvh flex-1 items-center justify-center",children:s.jsx(g,{className:"size-5 text-muted-foreground"})}),e[0]=n):n=e[0],n}if(!a){let n;e[1]!==t?(n=t("admin.layout.adminDashboardArea"),e[1]=t,e[2]=n):n=e[2];let l;e[3]!==r||e[4]!==t?(l=t(r?"admin.layout.emailVerificationRequired":"admin.layout.restrictedToDashboard"),e[3]=r,e[4]=t,e[5]=l):l=e[5];let m;e[6]!==t?(m=t("admin.layout.goHome"),e[6]=t,e[7]=m):m=e[7];let c;e[8]!==m?(c=s.jsx(S,{variant:"outline",size:"sm",asChild:!0,children:s.jsx(j,{to:"/",children:m})}),e[8]=m,e[9]=c):c=e[9];let h;return e[10]!==n||e[11]!==l||e[12]!==c?(h=s.jsx(v,{area:n,description:l,action:c}),e[10]=n,e[11]=l,e[12]=c,e[13]=h):h=e[13],h}let o;e[14]!==t?(o=t("admin.layout.adminDashboard"),e[14]=t,e[15]=o):o=e[15];let i;e[16]!==o?(i=s.jsx("div",{className:"shrink-0 px-4 pt-6 md:px-10",children:s.jsx("h1",{className:"pb-4 text-xl font-medium",children:o})}),e[16]=o,e[17]=i):i=e[17];let u;e[18]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(K,{}),e[18]=u):u=e[18];let f;e[19]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(b.Content,{children:s.jsx(_,{})}),e[19]=f):f=e[19];let x;return e[20]!==i?(x=s.jsxs(b,{variant:"plain",className:"h-dvh",children:[i,u,f]}),e[20]=i,e[21]=x):x=e[21],x}function $(){const e=p.c(1);let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(R,{children:s.jsx(k,{})}),e[0]=a):a=e[0],a}export{$ as default};