decocms 4.440.0 → 4.440.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 (352) hide show
  1. package/dist/client/assets/{AlertCircle-XXAWlcgx.js → AlertCircle-BRBGpzZA.js} +1 -1
  2. package/dist/client/assets/{AreaChart-KwdkpcdH.js → AreaChart-u6Mr5vHg.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-DI9NttEp.js → ArrowLeft-D_nqQ9tV.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-By9-vc-8.js → ArrowUp-DH2IataT.js} +1 -1
  5. package/dist/client/assets/{CartesianChart-a3R5Otrm.js → CartesianChart-BACZ_JVe.js} +1 -1
  6. package/dist/client/assets/{Check-BdObHRMl.js → Check-CO_ET4WO.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-DkWvJpfN.js → CheckCircle-RceYLcNO.js} +1 -1
  8. package/dist/client/assets/{ChevronUp--br7_cGI.js → ChevronUp-DnrzvZVs.js} +1 -1
  9. package/dist/client/assets/{Copy01-DFagqi8s.js → Copy01-BBbKMHlK.js} +1 -1
  10. package/dist/client/assets/{CreditCard01-cZe4LFh2.js → CreditCard01-D97_uv9-.js} +1 -1
  11. package/dist/client/assets/{DotsVertical-C3ILFYD8.js → DotsVertical-DA8jC7Sm.js} +1 -1
  12. package/dist/client/assets/{ErrorBarContext-DD5_v_f8.js → ErrorBarContext-B25cMhf0.js} +1 -1
  13. package/dist/client/assets/{Image01-C9BtItDq.js → Image01-AFCLWig4.js} +1 -1
  14. package/dist/client/assets/{Key01-ByeXvLue.js → Key01-DOFfyL8f.js} +1 -1
  15. package/dist/client/assets/{Line-BXlFmjqw.js → Line-ifQGqba-.js} +1 -1
  16. package/dist/client/assets/{Link01-Ca-PT5RE.js → Link01-7l6-kKGf.js} +1 -1
  17. package/dist/client/assets/{LinkBroken01-CbbXXlF9.js → LinkBroken01-t821Qpkz.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-DgOdwpZM.js → LinkExternal01-CGlBJ7ud.js} +1 -1
  19. package/dist/client/assets/{Monitor01-vZxChPKG.js → Monitor01-B8XQMd3B.js} +1 -1
  20. package/dist/client/assets/{Palette-DDgu7YQn.js → Palette-Dcur9L4v.js} +1 -1
  21. package/dist/client/assets/{Plus-Dc1-p3zJ.js → Plus-B0dyDF7l.js} +1 -1
  22. package/dist/client/assets/{SearchMd-Djuw3ygg.js → SearchMd-DWmqXOB3.js} +1 -1
  23. package/dist/client/assets/{Sector-TqT6X53T.js → Sector-CjACZniY.js} +1 -1
  24. package/dist/client/assets/{ShoppingBag01-CJPq-mn3.js → ShoppingBag01-CnpFPbsS.js} +1 -1
  25. package/dist/client/assets/{Sun-3gw5TBRM.js → Sun-CnfUJ0L6.js} +1 -1
  26. package/dist/client/assets/{Tool01-Dd7igGPM.js → Tool01-lC3aADL7.js} +1 -1
  27. package/dist/client/assets/{Trash01-5a67oVPj.js → Trash01-DV0azdbE.js} +1 -1
  28. package/dist/client/assets/{Upload01-B3VzWbAA.js → Upload01-DK8FpPmK.js} +1 -1
  29. package/dist/client/assets/{User01-DRLDcqZB.js → User01-BY20MgLM.js} +1 -1
  30. package/dist/client/assets/{UserSquare-EoQ6nRn7.js → UserSquare-bfdtEra2.js} +1 -1
  31. package/dist/client/assets/{Users01-MkVzddym.js → Users01-qvvwVlrt.js} +1 -1
  32. package/dist/client/assets/{X-OQ3vfwBp.js → X-CMwuaze4.js} +1 -1
  33. package/dist/client/assets/{XAxis-D1CIlAov.js → XAxis-WGIN87ND.js} +1 -1
  34. package/dist/client/assets/{XClose-CLkNA1fZ.js → XClose-CzlFjlez.js} +1 -1
  35. package/dist/client/assets/{ZoomOut-RxJ7nETy.js → ZoomOut-D_ifUcHu.js} +1 -1
  36. package/dist/client/assets/{access-gate-Dm0Y8BrA.js → access-gate-BOQqTHG4.js} +1 -1
  37. package/dist/client/assets/{add-connection-dialog-CohlF0gi.js → add-connection-dialog-BxahNv4G.js} +1 -1
  38. package/dist/client/assets/{agent-analytics-CwEFxGCv.js → agent-analytics-CGaZnDet.js} +1 -1
  39. package/dist/client/assets/agent-app-HRhkGt4e.js +1 -0
  40. package/dist/client/assets/{agent-assets-C0uPqf_o.js → agent-assets-DgwRmMX3.js} +1 -1
  41. package/dist/client/assets/{agent-automation-CI-90_Nr.js → agent-automation-Dmx4CuOb.js} +1 -1
  42. package/dist/client/assets/{agent-automations-DirERrY_.js → agent-automations-D49rFQFC.js} +1 -1
  43. package/dist/client/assets/{agent-connect-sources-8klTBWge.js → agent-connect-sources-C7wp22k7.js} +1 -1
  44. package/dist/client/assets/agent-deck-C3svsy7Z.js +1 -0
  45. package/dist/client/assets/{agent-e2e-65dyEHOi.js → agent-e2e-DNfKyrDH.js} +1 -1
  46. package/dist/client/assets/{agent-experiments-BkZ7OhO1.js → agent-experiments-CxFez-pk.js} +1 -1
  47. package/dist/client/assets/{agent-file-Cibn8hOj.js → agent-file-CeVg9xBG.js} +1 -1
  48. package/dist/client/assets/{agent-git-DE4S26JT.js → agent-git-CTSmRbRs.js} +1 -1
  49. package/dist/client/assets/{agent-hosting-DgICvzZz.js → agent-hosting-DKHsCemp.js} +1 -1
  50. package/dist/client/assets/{agent-icon-DMUppBcz.js → agent-icon-DV55KTHV.js} +1 -1
  51. package/dist/client/assets/agent-library-BseoXsKi.js +1 -0
  52. package/dist/client/assets/agent-library-file-D-k7ToJp.js +1 -0
  53. package/dist/client/assets/{agent-monitor-DIoua9I6.js → agent-monitor-CmWO_xKA.js} +1 -1
  54. package/dist/client/assets/{agent-overview-DYI1rW5v.js → agent-overview-QZEmtrKn.js} +1 -1
  55. package/dist/client/assets/agent-settings-DqFfgmc7.js +1 -0
  56. package/dist/client/assets/{agent-site-editor-DGkqvDIU.js → agent-site-editor-A-DuGZL1.js} +1 -1
  57. package/dist/client/assets/agent-site-editor-code-4yF8GVCZ.js +2 -0
  58. package/dist/client/assets/{agent-site-editor-content-BUVUdrTT.js → agent-site-editor-content-D1GHZfYW.js} +3 -3
  59. package/dist/client/assets/{agent-site-editor-preview-CNLEo6DL.js → agent-site-editor-preview-RNdb_aLF.js} +3 -3
  60. package/dist/client/assets/agent-view-CASURRu4.js +1 -0
  61. package/dist/client/assets/{agent-view-guard-DI25VnLM.js → agent-view-guard-C6pPHYLM.js} +1 -1
  62. package/dist/client/assets/{agents-list-ECR9La-G.js → agents-list-DrZwJdgg.js} +1 -1
  63. package/dist/client/assets/{ai-providers-CJ1m1BGV.js → ai-providers-C3SDK-es.js} +1 -1
  64. package/dist/client/assets/{alert-abom0PnI.js → alert-D3UeuoXv.js} +1 -1
  65. package/dist/client/assets/{alert-dialog-BlGQ5aR_.js → alert-dialog-D5ehbgbg.js} +1 -1
  66. package/dist/client/assets/{analytics-sections-DlIRabZK.js → analytics-sections-8tMy3NSb.js} +1 -1
  67. package/dist/client/assets/{api-keys-BCiRhzoE.js → api-keys-BGIqZi8b.js} +1 -1
  68. package/dist/client/assets/api-keys-DQMXRZDM.js +1 -0
  69. package/dist/client/assets/{app-editor-FvngsWxE.js → app-editor-BhQAjgpO.js} +1 -1
  70. package/dist/client/assets/{asset-utils-BN1s8bsE.js → asset-utils-CzXHTnwN.js} +1 -1
  71. package/dist/client/assets/{auth-zVBOuttQ.js → auth-D62PuyHX.js} +1 -1
  72. package/dist/client/assets/{auth-catchall-C5dIeWj7.js → auth-catchall-B3J-GACW.js} +1 -1
  73. package/dist/client/assets/{auth-entry-DDaeQ5qC.js → auth-entry-BWhEuRSI.js} +1 -1
  74. package/dist/client/assets/{auth-split-layout-BeDfpXyu.js → auth-split-layout-5urTf-8R.js} +1 -1
  75. package/dist/client/assets/{authenticate-and-persist-oauth-DTnPLNmp.js → authenticate-and-persist-oauth-DoNypqY8.js} +1 -1
  76. package/dist/client/assets/{automation-list-row-zeocUcRy.js → automation-list-row-6V6__o_w.js} +1 -1
  77. package/dist/client/assets/{automation-runs-HaKdOgSB.js → automation-runs-DJ3rlQae.js} +1 -1
  78. package/dist/client/assets/{automations-CRCGFkLf.js → automations-DNX-Z3mR.js} +1 -1
  79. package/dist/client/assets/{autosend-BMuGk3J_.js → autosend-_7Pn3AYs.js} +1 -1
  80. package/dist/client/assets/{avatar-Qof2vVxs.js → avatar-HeVuI3WS.js} +1 -1
  81. package/dist/client/assets/{badge-DlBGBPxK.js → badge-DLk0uZg2.js} +1 -1
  82. package/dist/client/assets/{block-document-B5zdti7F.js → block-document-HwHxH7Bn.js} +1 -1
  83. package/dist/client/assets/{blocks-preview-workspace-context-D3LL6lji.js → blocks-preview-workspace-context-0CY5kK_i.js} +1 -1
  84. package/dist/client/assets/{buckets-IXwR7i0v.js → buckets-DNXFJJmf.js} +1 -1
  85. package/dist/client/assets/{build-improve-prompt-doc-DaYmg433.js → build-improve-prompt-doc-DiiRh6vZ.js} +1 -1
  86. package/dist/client/assets/{calendar-D8H2edgl.js → calendar-Bs93rBUA.js} +1 -1
  87. package/dist/client/assets/{capability-load-error-MHa6jDJE.js → capability-load-error-C1opTYYa.js} +1 -1
  88. package/dist/client/assets/{category-editor-B3IqImuK.js → category-editor-BzSt35e8.js} +1 -1
  89. package/dist/client/assets/{chart-BUg0iLD-.js → chart-BswBR4td.js} +1 -1
  90. package/dist/client/assets/{chat-context-BT_fCIwJ.js → chat-context-CocIg825.js} +1 -1
  91. package/dist/client/assets/{chat-draft-BOf2ssWg.js → chat-draft-DVoUlwJ3.js} +1 -1
  92. package/dist/client/assets/{checkbox-9g6HUE3a.js → checkbox-C-jsWi4f.js} +1 -1
  93. package/dist/client/assets/{choose-editor-DR-Q9Tls.js → choose-editor-BmR7SGph.js} +1 -1
  94. package/dist/client/assets/{claim-phase-copy-Cxwhb3Ei.js → claim-phase-copy-DM-AWuNF.js} +1 -1
  95. package/dist/client/assets/{cli-auth-success-DIcIngZb.js → cli-auth-success-BB8BjOg-.js} +1 -1
  96. package/dist/client/assets/{client-icons-C-8n2EwW.js → client-icons-DLhmJ_Wc.js} +1 -1
  97. package/dist/client/assets/{collapsible-BOm0wEHE.js → collapsible-CuGEZkc7.js} +1 -1
  98. package/dist/client/assets/{collection-detail-Bk1USTX-.js → collection-detail-Df1t4CiZ.js} +1 -1
  99. package/dist/client/assets/{collection-display-button-jqsA8Fhq.js → collection-display-button-DcAXDLtF.js} +1 -1
  100. package/dist/client/assets/{collection-search-306OP2vT.js → collection-search-BVdAr8z7.js} +1 -1
  101. package/dist/client/assets/{collection-table-wrapper-BhV7xJ_P.js → collection-table-wrapper-qlvTDDfb.js} +1 -1
  102. package/dist/client/assets/{collection-tabs-B0KzfANL.js → collection-tabs-D--zl7tk.js} +1 -1
  103. package/dist/client/assets/{combobox-ZiooVuFh.js → combobox-CaxzDpIX.js} +1 -1
  104. package/dist/client/assets/{command-DdkhWyIl.js → command-C0uSVAHC.js} +1 -1
  105. package/dist/client/assets/{companion-mcps-section-UHFj7Oex.js → companion-mcps-section-tdKhwU79.js} +1 -1
  106. package/dist/client/assets/{config-BtdszJOe.js → config-BTAHIKaz.js} +1 -1
  107. package/dist/client/assets/{connect-CefYFLnb.js → connect-Bj2cQ3O8.js} +1 -1
  108. package/dist/client/assets/{connect-layout-6S5UXZM1.js → connect-layout-CbgMWnkc.js} +1 -1
  109. package/dist/client/assets/{connection-Bam5fQyG.js → connection-CWiycsnd.js} +1 -1
  110. package/dist/client/assets/{connection-card-zwY0dB-Z.js → connection-card-DINEZcyg.js} +1 -1
  111. package/dist/client/assets/{connection-detail-Cl8J0WoF.js → connection-detail-FkV9ORDZ.js} +1 -1
  112. package/dist/client/assets/{connection-form-helpers-BOQir9cM.js → connection-form-helpers-C825tgC1.js} +1 -1
  113. package/dist/client/assets/{connections-BUxB-KAl.js → connections-D8I3589k.js} +1 -1
  114. package/dist/client/assets/{context-9Q6zyGsg.js → context-DQeq5C_R.js} +1 -1
  115. package/dist/client/assets/{context-menu-DkHY6iSU.js → context-menu-BZtI-iYm.js} +1 -1
  116. package/dist/client/assets/{create-organization-dialog-rOUQf0Oy.js → create-organization-dialog-7qPWrl6e.js} +1 -1
  117. package/dist/client/assets/{daily-pulse-BrRUUREQ.js → daily-pulse-Bkk6WmeP.js} +1 -1
  118. package/dist/client/assets/{decopilot-BJE0q6o0.js → decopilot-2FFmwoNB.js} +1 -1
  119. package/dist/client/assets/{device-hint-C3jeUFCs.js → device-hint-DffcSqg_.js} +1 -1
  120. package/dist/client/assets/{dialog-CshkwPdi.js → dialog-Dw8xcjW3.js} +1 -1
  121. package/dist/client/assets/{discover-Dr7cCDLx.js → discover-DIOje2Ib.js} +1 -1
  122. package/dist/client/assets/{domain-settings-BqKmwW-G.js → domain-settings-8z8kLU4n.js} +1 -1
  123. package/dist/client/assets/{download-app-dialog-CNKP1j9Z.js → download-app-dialog-BSYwZSLo.js} +1 -1
  124. package/dist/client/assets/{drawer-CHF6n3YP.js → drawer-Dt1DFlEt.js} +1 -1
  125. package/dist/client/assets/{editor-Cbpxq8Y7.js → editor-CX3cazY1.js} +1 -1
  126. package/dist/client/assets/{empty-state-s5KfHMUL.js → empty-state-BE9_fazN.js} +1 -1
  127. package/dist/client/assets/{empty-state-DCZJyNOr.js → empty-state-Dt2YybO3.js} +1 -1
  128. package/dist/client/assets/{extract-connection-data-CcjZtPjH.js → extract-connection-data-Cb2jVjCO.js} +1 -1
  129. package/dist/client/assets/{feature-gate-DBAyKLUo.js → feature-gate-B0_tSsnV.js} +1 -1
  130. package/dist/client/assets/{feature-paywall-DjjdhYl3.js → feature-paywall-BgH7Ln-V.js} +1 -1
  131. package/dist/client/assets/{file-explorer-Cnv88ItB.js → file-explorer-Cbx1Ahiy.js} +1 -1
  132. package/dist/client/assets/{file-preview-AD02XtIo.js → file-preview-BiCTzlao.js} +1 -1
  133. package/dist/client/assets/{file-share-button-BvfvBfb3.js → file-share-button-nPArR5GT.js} +1 -1
  134. package/dist/client/assets/{file-type-icon-Ql8bNsbu.js → file-type-icon-DY-An3SA.js} +1 -1
  135. package/dist/client/assets/flat-project-D6pOpnSj.js +1 -0
  136. package/dist/client/assets/{folder-icon-yW_It0yE.js → folder-icon-BXdHDD5F.js} +1 -1
  137. package/dist/client/assets/{form-DC-OZkLI.js → form-CqyDHzdF.js} +1 -1
  138. package/dist/client/assets/{gateway-client-BGYFNhpz.js → gateway-client-Dv06lV8N.js} +1 -1
  139. package/dist/client/assets/{general-EkTQtKKI.js → general-m3RIl8ZM.js} +1 -1
  140. package/dist/client/assets/{home--qtejwp1.js → home-DP-XCZ30.js} +1 -1
  141. package/dist/client/assets/{icon-button-DznMa322.js → icon-button-CzDbjYoM.js} +1 -1
  142. package/dist/client/assets/{index-Ce5zRo1E.js → index-8hvPIbgz.js} +1 -1
  143. package/dist/client/assets/{index-Bj_mB4Z1.js → index-BBMPGKIn.js} +1 -1
  144. package/dist/client/assets/{index-DjWuJPor.js → index-BMb0J2ET.js} +1 -1
  145. package/dist/client/assets/{index-CYF4A_PA.js → index-B_4zzu3P.js} +1 -1
  146. package/dist/client/assets/{index-Du2WlkP0.js → index-Co-4sRnJ.js} +2 -2
  147. package/dist/client/assets/{index-qPYY6GgG.js → index-D0owq1f2.js} +1 -1
  148. package/dist/client/assets/{index-Be8XqOdc.js → index-D7VCPHbB.js} +3 -3
  149. package/dist/client/assets/{index-CmUTFx8q.js → index-DA-4uVv2.js} +1 -1
  150. package/dist/client/assets/{index-CpDmId9B.js → index-DcYvMhsA.js} +1 -1
  151. package/dist/client/assets/{index-DmFJLtCr.js → index-Dfk-aa2W.js} +1 -1
  152. package/dist/client/assets/{index-DEHZTLnD.js → index-DySHyK_e.js} +1 -1
  153. package/dist/client/assets/{index-D-UOMZZ_.js → index-DyphIbgX.js} +1 -1
  154. package/dist/client/assets/{index-DMbzNFov.js → index-MAF8_efg.js} +1 -1
  155. package/dist/client/assets/{index-igcUp6px.js → index-P52tuAKC.js} +1 -1
  156. package/dist/client/assets/{index-D57k3t6w.js → index-jL0svWh-.js} +1 -1
  157. package/dist/client/assets/{index-redirect-CHyGD5U8.js → index-redirect-CrmLnSSn.js} +1 -1
  158. package/dist/client/assets/{infiniteQueryObserver-CykMAwkD.js → infiniteQueryObserver-DJ3A-TdU.js} +1 -1
  159. package/dist/client/assets/{infra-billing-UsSMRdsv.js → infra-billing-D6q7wZ_0.js} +1 -1
  160. package/dist/client/assets/{input-DXtLlTqd.js → input-BxLUTBXU.js} +1 -1
  161. package/dist/client/assets/{input-BrdR9egr.js → input-CKfCW4iw.js} +1 -1
  162. package/dist/client/assets/{input-D-vTzgs2.js → input-COrt256w.js} +3 -3
  163. package/dist/client/assets/{integration-icon-CViStXoz.js → integration-icon-CNlbbwne.js} +1 -1
  164. package/dist/client/assets/{label-58Qw-JZE.js → label-DU_w-ckQ.js} +1 -1
  165. package/dist/client/assets/{layout-Dy2f9QXX.js → layout-DpzNGU1W.js} +1 -1
  166. package/dist/client/assets/{legacy-agents-deep-BmwavNSc.js → legacy-agents-deep-D0IhRF5B.js} +1 -1
  167. package/dist/client/assets/{legacy-main-redirect-DrJ-p-Kd.js → legacy-main-redirect-Bp-dMEE0.js} +1 -1
  168. package/dist/client/assets/{library-tab-BB_wHV8x.js → library-tab-B5SoCSuy.js} +1 -1
  169. package/dist/client/assets/library-zwZu2XHX.js +1 -0
  170. package/dist/client/assets/{login-CUQf3CCF.js → login-BabWcQ2i.js} +1 -1
  171. package/dist/client/assets/{markdown-DLKu3YBc.js → markdown-C9QLOL7g.js} +1 -1
  172. package/dist/client/assets/{mcp-app-renderer-4bIAEgtP.js → mcp-app-renderer-BUT4kPR2.js} +1 -1
  173. package/dist/client/assets/{mcp-oauth-Cnjp3DGr.js → mcp-oauth-BimxrF_f.js} +1 -1
  174. package/dist/client/assets/{members-DSkxtFMH.js → members-Bl784KGm.js} +1 -1
  175. package/dist/client/assets/{message-templates-B8x-h3FT.js → message-templates-QcL4DUmR.js} +1 -1
  176. package/dist/client/assets/{mini-report-page-hiIphID1.js → mini-report-page-c9TkUi0R.js} +1 -1
  177. package/dist/client/assets/{mock-board-BNVDzwoJ.js → mock-board-C0ZR6UK2.js} +1 -1
  178. package/dist/client/assets/{monaco-editor-B6rEE-o8.js → monaco-editor-CCbTu1Zq.js} +1 -1
  179. package/dist/client/assets/{monitoring-stats-row-BZIDgSPg.js → monitoring-stats-row-Cr6UHFNA.js} +1 -1
  180. package/dist/client/assets/{multi-select-CAetsNJk.js → multi-select-9oN2iBx_.js} +1 -1
  181. package/dist/client/assets/{mustache-C_Baug6A.js → mustache-CKo61BiR.js} +1 -1
  182. package/dist/client/assets/{new-project-dialog-Su3Gi1wb.js → new-project-dialog-CzRX3bqD.js} +1 -1
  183. package/dist/client/assets/{oauth-callback-DFgAmcry.js → oauth-callback-DXsrYo58.js} +1 -1
  184. package/dist/client/assets/{oauth-callback-ai-provider-B6MpHaz9.js → oauth-callback-ai-provider-COzXSgab.js} +1 -1
  185. package/dist/client/assets/{onboarding-YT3O5Ww5.js → onboarding-DOpWWbfX.js} +1 -1
  186. package/dist/client/assets/{openai-conversation-IgCPp4x2.js → openai-conversation-BQ0qlnvJ.js} +1 -1
  187. package/dist/client/assets/{optimistic-project-sidebar-views-Dtk6hOjd.js → optimistic-project-sidebar-views-D4Emai-D.js} +1 -1
  188. package/dist/client/assets/{org-file-open-context-BnLB4jSd.js → org-file-open-context-CgCmoW9s.js} +1 -1
  189. package/dist/client/assets/{organization-choice-B4gAqtuw.js → organization-choice-COxWAOgI.js} +1 -1
  190. package/dist/client/assets/{orgs-DRmr2z_c.js → orgs-DqUwa1rJ.js} +1 -1
  191. package/dist/client/assets/{page-seo-form-DcDcC29Z.js → page-seo-form-Bi__p_tv.js} +1 -1
  192. package/dist/client/assets/{pair-BOkfANVb.js → pair-BWDj_GIt.js} +1 -1
  193. package/dist/client/assets/{plan-ladder-DKUy9zvx.js → plan-ladder-PugCzyO6.js} +1 -1
  194. package/dist/client/assets/{popover-Co_XiyUD.js → popover-DmlD7L54.js} +1 -1
  195. package/dist/client/assets/{post-calendar-DiLnFXng.js → post-calendar-_G3C9FIJ.js} +1 -1
  196. package/dist/client/assets/{post-editor-lWAU23BO.js → post-editor-CQmc7dyT.js} +1 -1
  197. package/dist/client/assets/{preview-content-CicDgAha.js → preview-content-mZxKtDk3.js} +1 -1
  198. package/dist/client/assets/{preview-dialog-BV7MNp9u.js → preview-dialog-DBbT1IPw.js} +1 -1
  199. package/dist/client/assets/{profile-C_cvXn18.js → profile-BZHYLZQF.js} +1 -1
  200. package/dist/client/assets/{project-app-view-BgWpED_j.js → project-app-view-DHhfL06M.js} +1 -1
  201. package/dist/client/assets/{project-feed-wW0-SKIU.js → project-feed-BAQmClh0.js} +1 -1
  202. package/dist/client/assets/{project-icon-Dv5tiaQd.js → project-icon-CIt25m1v.js} +1 -1
  203. package/dist/client/assets/project-reports-BPgQePan.js +1 -0
  204. package/dist/client/assets/project-tasks-Bodr6bBn.js +1 -0
  205. package/dist/client/assets/{projects-Co9ht4r6.js → projects-DkzfKq0o.js} +1 -1
  206. package/dist/client/assets/{projects-empty-state-BHPOYJE0.js → projects-empty-state-CGWR-feW.js} +1 -1
  207. package/dist/client/assets/{prompts-CVWS3bwz.js → prompts-DnC6lyZl.js} +1 -1
  208. package/dist/client/assets/record-editor-CWa5kuX3.js +1 -0
  209. package/dist/client/assets/{redirect-editor-B6A9VxnV.js → redirect-editor-CchUa0et.js} +1 -1
  210. package/dist/client/assets/{reports-BKkJRR46.js → reports-CywIxjj0.js} +1 -1
  211. package/dist/client/assets/reports-DE_iinGQ.js +1 -0
  212. package/dist/client/assets/{reports-onboarding-BYe6k6j4.js → reports-onboarding-BwNbweYr.js} +1 -1
  213. package/dist/client/assets/{reports-tab-O2SVn8O7.js → reports-tab-E_94bQMh.js} +2 -2
  214. package/dist/client/assets/{repositories-CAb_k7u1.js → repositories-D18-e4Ht.js} +1 -1
  215. package/dist/client/assets/{repository-binding-1HKJG2dU.js → repository-binding-B0HdN6Lz.js} +1 -1
  216. package/dist/client/assets/{repository-import-picker-BMdxix12.js → repository-import-picker-DBLmxazs.js} +1 -1
  217. package/dist/client/assets/{repository-picker-Bnum34GQ.js → repository-picker-DIAetLTu.js} +1 -1
  218. package/dist/client/assets/{require-capability-CXxUD-ot.js → require-capability-ngDTKpk-.js} +1 -1
  219. package/dist/client/assets/{required-auth-layout-eWdAXpWY.js → required-auth-layout-miKcB0rt.js} +1 -1
  220. package/dist/client/assets/{reset-password-_vRZ9PJ3.js → reset-password-goI4AN3o.js} +1 -1
  221. package/dist/client/assets/{resizable-DjwgNCy-.js → resizable-CpyyJXRZ.js} +1 -1
  222. package/dist/client/assets/{resolve-tab-icon-Bak8BAHs.js → resolve-tab-icon-CRFTmUo8.js} +1 -1
  223. package/dist/client/assets/{review-settings-DrthTknh.js → review-settings-bh0EyH5K.js} +1 -1
  224. package/dist/client/assets/{rich-text-link-control-x-muwvTw.js → rich-text-link-control-Co6k6OlH.js} +1 -1
  225. package/dist/client/assets/{roles-BDQAmSdr.js → roles-Dfc6a85e.js} +1 -1
  226. package/dist/client/assets/{route-DpX8cahE.js → route-BUFpECc9.js} +1 -1
  227. package/dist/client/assets/{route-BiWPnB6n.js → route-CrrxgfJi.js} +1 -1
  228. package/dist/client/assets/route-DAkaBbdM.js +1 -0
  229. package/dist/client/assets/{runnable-block-editor-DSAD7aE-.js → runnable-block-editor-CDsWwzF6.js} +1 -1
  230. package/dist/client/assets/{sandbox-lifecycle-context--jotIhMM.js → sandbox-lifecycle-context-FrgKEa4u.js} +1 -1
  231. package/dist/client/assets/{schema-DOdBNr_5.js → schema-Bg7Z4WK1.js} +1 -1
  232. package/dist/client/assets/{scroll-area-lO44Io7n.js → scroll-area-B-lzB5tO.js} +1 -1
  233. package/dist/client/assets/{search-input-fvGBtM5d.js → search-input-DxispljN.js} +1 -1
  234. package/dist/client/assets/{search-toggle-BSZDhrIY.js → search-toggle-BUr7OpuE.js} +1 -1
  235. package/dist/client/assets/{secret-picker-DOB7eKqI.js → secret-picker-Cdibhh7U.js} +1 -1
  236. package/dist/client/assets/{secrets-DpyoMent.js → secrets-CConrVDh.js} +1 -1
  237. package/dist/client/assets/{sections-editor-CMuJbJDO.js → sections-editor-0i-naoBY.js} +1 -1
  238. package/dist/client/assets/{select-D1BEDRG_.js → select-CZTYe-RM.js} +1 -1
  239. package/dist/client/assets/{select-model-Bub7WoQJ.js → select-model-CTMl4DBk.js} +1 -1
  240. package/dist/client/assets/{seo-editor-B53rrMzz.js → seo-editor-Bu8hE-fM.js} +1 -1
  241. package/dist/client/assets/{separator-BkTX5fcO.js → separator-D1tnRKZk.js} +1 -1
  242. package/dist/client/assets/{settings-tab-DvpoIy1J.js → settings-tab-Bn1uHMT_.js} +1 -1
  243. package/dist/client/assets/{sheet-B4JDck22.js → sheet-DYXq70sZ.js} +1 -1
  244. package/dist/client/assets/{shell-layout-5_bP0b9R.js → shell-layout-HGSCI1cW.js} +1 -1
  245. package/dist/client/assets/{skills-nq0zSapq.js → skills-DiX3Wo9s.js} +1 -1
  246. package/dist/client/assets/{sso-DyEuvpFw.js → sso-B97iUHe5.js} +1 -1
  247. package/dist/client/assets/{suggestion-CEb70Zl1.js → suggestion-BkHBW1eO.js} +1 -1
  248. package/dist/client/assets/{switch-C4-fOrxd.js → switch-BGCsiekK.js} +1 -1
  249. package/dist/client/assets/{synced-repos-T4pMflc0.js → synced-repos-jTLgevgn.js} +1 -1
  250. package/dist/client/assets/{tab-icon-glyph-ClsFil2N.js → tab-icon-glyph--MlM4zGI.js} +1 -1
  251. package/dist/client/assets/{table-Dt9K5CoM.js → table-CPY_9uUo.js} +1 -1
  252. package/dist/client/assets/{tabs-CmlgRJbo.js → tabs-aXag5nk_.js} +1 -1
  253. package/dist/client/assets/{task-board-D6xVkaAN.js → task-board-DV8c5Zhu.js} +1 -1
  254. package/dist/client/assets/{task-route-DELc3WQr.js → task-route-DkUw5kJo.js} +1 -1
  255. package/dist/client/assets/{task-status-S7aOsKan.js → task-status-C1rdpmGX.js} +1 -1
  256. package/dist/client/assets/{taskboard-analytics-BzDyQ1Z-.js → taskboard-analytics-DXhKcjBe.js} +1 -1
  257. package/dist/client/assets/{tasks-BDF2zDVL.js → tasks-4av_39uG.js} +1 -1
  258. package/dist/client/assets/tasks-DMbENiIa.js +1 -0
  259. package/dist/client/assets/{textarea-0prb_Emi.js → textarea-BwFbzFhR.js} +1 -1
  260. package/dist/client/assets/{thread-analytics-Co_tbfAx.js → thread-analytics-ZZSgMAeG.js} +1 -1
  261. package/dist/client/assets/{thread-button-K3nnM2Jj.js → thread-button-D-dNsXV2.js} +1 -1
  262. package/dist/client/assets/{thread-intent-CzXA7HyL.js → thread-intent-B5r6uX01.js} +1 -1
  263. package/dist/client/assets/{thread-route-B_-rBMiW.js → thread-route-BAsLNDrI.js} +1 -1
  264. package/dist/client/assets/{thread-route-Cby7AcAM.js → thread-route-BtbKeVmC.js} +1 -1
  265. package/dist/client/assets/{thread-sheet-body-FH7CMgMX.js → thread-sheet-body-DITXlsnG.js} +1 -1
  266. package/dist/client/assets/{toggle-group-DcI3Rbbl.js → toggle-group-CSB3oZUC.js} +1 -1
  267. package/dist/client/assets/{toolbar-icon-button-BRDGqYqz.js → toolbar-icon-button-C8w8sPNx.js} +1 -1
  268. package/dist/client/assets/{tooltip-CBM_j-A9.js → tooltip-CYfkikaX.js} +1 -1
  269. package/dist/client/assets/{track-C8VihVBg.js → track-CsuwcppY.js} +1 -1
  270. package/dist/client/assets/{types-BXmxY_2k.js → types-FVrLJnQ_.js} +1 -1
  271. package/dist/client/assets/{usage-stats-CGc489dq.js → usage-stats-B5xe2MvZ.js} +1 -1
  272. package/dist/client/assets/{use-ai-providers-4MxbSPqM.js → use-ai-providers-zPZTeTn6.js} +1 -1
  273. package/dist/client/assets/{use-automations-DEGyd9it.js → use-automations-DBkOR8ED.js} +1 -1
  274. package/dist/client/assets/{use-autosave-BxBqL1Yt.js → use-autosave-xZ5zN50O.js} +1 -1
  275. package/dist/client/assets/{use-chat-layout-state-BiDmge4s.js → use-chat-layout-state-_hTo6qiX.js} +1 -1
  276. package/dist/client/assets/{use-connect-companion-OCXk3aJz.js → use-connect-companion-PwrgKsDQ.js} +1 -1
  277. package/dist/client/assets/{use-connection-BPxGVk9k.js → use-connection-DzHiClla.js} +1 -1
  278. package/dist/client/assets/{use-copy-C4UTClGi.js → use-copy-kTB71Cx6.js} +1 -1
  279. package/dist/client/assets/{use-create-virtual-mcp-Dlv5X9b4.js → use-create-virtual-mcp-BXXlVaJ1.js} +1 -1
  280. package/dist/client/assets/{use-date-fns-locale-Zd02y8z7.js → use-date-fns-locale-DmITod04.js} +1 -1
  281. package/dist/client/assets/{use-debounced-autosave-DSvIjd9B.js → use-debounced-autosave-8CpUK2dy.js} +1 -1
  282. package/dist/client/assets/{use-debounced-value-Hi5DwWll.js → use-debounced-value-DDoK_9IU.js} +1 -1
  283. package/dist/client/assets/{use-deco-credits-CGSwGByQ.js → use-deco-credits-DIzsZghd.js} +1 -1
  284. package/dist/client/assets/{use-decopilot-events-DtADALaV.js → use-decopilot-events-BZEZhg3r.js} +1 -1
  285. package/dist/client/assets/{use-delete-connection-DPp7GEJY.js → use-delete-connection-DDnKZtgg.js} +1 -1
  286. package/dist/client/assets/{use-deployment-admin-CfpfquDc.js → use-deployment-admin-ApUENcoe.js} +1 -1
  287. package/dist/client/assets/{use-fast-preview-draft-url-CLCZ4aVE.js → use-fast-preview-draft-url-BZzWJ74e.js} +1 -1
  288. package/dist/client/assets/{use-file-configs-D8tlssbt.js → use-file-configs-Dckq5B6h.js} +1 -1
  289. package/dist/client/assets/{use-infinite-scroll-C_Nczdx_.js → use-infinite-scroll-CaES8Ly6.js} +1 -1
  290. package/dist/client/assets/{use-join-requests-D8MKTYaJ.js → use-join-requests-CKlzLYmF.js} +1 -1
  291. package/dist/client/assets/{use-main-panel-tabs-BdN2kvAd.js → use-main-panel-tabs-BEaE1an6.js} +1 -1
  292. package/dist/client/assets/{use-mcp-auth-status-BhzPxq2U.js → use-mcp-auth-status-CEJ_jWCe.js} +1 -1
  293. package/dist/client/assets/{use-mcp-client-BGwc0_aG.js → use-mcp-client-huiboiuW.js} +1 -1
  294. package/dist/client/assets/{use-mcp-prompts-DAbiwecO.js → use-mcp-prompts-CK7nTCfz.js} +1 -1
  295. package/dist/client/assets/{use-mcp-tools-Bryi_4Hu.js → use-mcp-tools-DrNXuvH-.js} +1 -1
  296. package/dist/client/assets/{use-members-D1ReT2Rd.js → use-members-Czj8Or22.js} +1 -1
  297. package/dist/client/assets/{use-mobile-DW2X9sww.js → use-mobile-C_c7X_X9.js} +1 -1
  298. package/dist/client/assets/{use-navigate-to-agent-KxGV60Dd.js → use-navigate-to-agent-B8uYHMgO.js} +1 -1
  299. package/dist/client/assets/use-new-blocks-editor-DRI-powp.js +1 -0
  300. package/dist/client/assets/{use-open-billing-url-C-a_tMdF.js → use-open-billing-url-ClFzvK5L.js} +1 -1
  301. package/dist/client/assets/{use-org-auth-client-CP32u1RF.js → use-org-auth-client-DGMlZ1DJ.js} +1 -1
  302. package/dist/client/assets/{use-org-fs-DdUjMTXp.js → use-org-fs-Zkz7cnFM.js} +1 -1
  303. package/dist/client/assets/{use-org-repo-syncs-UqfziudL.js → use-org-repo-syncs-Bl-zLisR.js} +1 -1
  304. package/dist/client/assets/{use-org-sso-sCMMN9gF.js → use-org-sso-WomPaWOu.js} +1 -1
  305. package/dist/client/assets/{use-organization-roles-DSRTwXVY.js → use-organization-roles-D0rAtkDp.js} +1 -1
  306. package/dist/client/assets/{use-organization-settings-CFjSMs5I.js → use-organization-settings-BXIx1FLP.js} +1 -1
  307. package/dist/client/assets/{use-panel-navigate-CJDpCpnr.js → use-panel-navigate-9QHW-FCg.js} +1 -1
  308. package/dist/client/assets/{use-project-scope-DEPThRAR.js → use-project-scope-Bn-XeyFm.js} +1 -1
  309. package/dist/client/assets/{use-releases-BV_LgkCY.js → use-releases-DXjAp2xg.js} +1 -1
  310. package/dist/client/assets/{use-reports-diagnostic-CJOy6zdH.js → use-reports-diagnostic-MPgYdKXV.js} +1 -1
  311. package/dist/client/assets/{use-secrets-D5Eh5WEG.js → use-secrets-oQfbwqKQ.js} +1 -1
  312. package/dist/client/assets/{use-section-preview-base-BZUgxJo5.js → use-section-preview-base-CmEtoGbE.js} +1 -1
  313. package/dist/client/assets/{use-session-runtime-B4jHGSPb.js → use-session-runtime-Mt5i1NtG.js} +1 -1
  314. package/dist/client/assets/{use-tags-Ce2CBj-h.js → use-tags-Bbqw8zS9.js} +1 -1
  315. package/dist/client/assets/{use-task-board-analytics-gxAXUY4n.js → use-task-board-analytics-_GYuIvYU.js} +1 -1
  316. package/dist/client/assets/{use-task-board-events-ChPcPJPj.js → use-task-board-events-CHHrBRNs.js} +1 -1
  317. package/dist/client/assets/{use-task-metadata-Z9tkfxGE.js → use-task-metadata-Bwd62AhF.js} +1 -1
  318. package/dist/client/assets/{use-thread-analytics-CAtM9WJh.js → use-thread-analytics-BHXCrsPt.js} +1 -1
  319. package/dist/client/assets/{use-thread-outputs-ry0pTMEU.js → use-thread-outputs-DWqKD4Kd.js} +1 -1
  320. package/dist/client/assets/useInfiniteQuery-BbXVrX4k.js +1 -0
  321. package/dist/client/assets/{useQueries-C1ewKEuW.js → useQueries-P_HReZM-.js} +1 -1
  322. package/dist/client/assets/useSuspenseInfiniteQuery-Ddc-zVFy.js +1 -0
  323. package/dist/client/assets/{users-BAInrhZu.js → users-D7Dbr_DI.js} +1 -1
  324. package/dist/client/assets/{utils-Cr60QAw9.js → utils-v5cDdvER.js} +1 -1
  325. package/dist/client/assets/{variant-calendar-yPYIHLCQ.js → variant-calendar-ANwfNoin.js} +1 -1
  326. package/dist/client/assets/{variant-matcher-override-BOJuXXVB.js → variant-matcher-override-UcAv0Nhz.js} +1 -1
  327. package/dist/client/assets/{view-mode-toggle-Cl1lfkcd.js → view-mode-toggle-DDXXNR3I.js} +1 -1
  328. package/dist/client/assets/{virtual-mcp-1qZjCZ09.js → virtual-mcp-TWIqdaTw.js} +1 -1
  329. package/dist/client/index.html +1 -1
  330. package/dist/server/cli.js +597 -595
  331. package/dist/server/migrate.js +154 -152
  332. package/dist/server/server.js +1 -1
  333. package/package.json +1 -1
  334. package/dist/client/assets/agent-app-DmybRMFO.js +0 -1
  335. package/dist/client/assets/agent-deck-RbNL3hWr.js +0 -1
  336. package/dist/client/assets/agent-library-B8lG5UG4.js +0 -1
  337. package/dist/client/assets/agent-library-file-BuJKMH9G.js +0 -1
  338. package/dist/client/assets/agent-settings-w3GUGNeB.js +0 -1
  339. package/dist/client/assets/agent-site-editor-code-BQ6Om0-k.js +0 -2
  340. package/dist/client/assets/agent-view-CML0NpVU.js +0 -1
  341. package/dist/client/assets/api-keys-m0XumOHa.js +0 -1
  342. package/dist/client/assets/flat-project-BbIN24kZ.js +0 -1
  343. package/dist/client/assets/library-BeLpQASQ.js +0 -1
  344. package/dist/client/assets/project-reports-C4BJLBQR.js +0 -1
  345. package/dist/client/assets/project-tasks-CNbMF13P.js +0 -1
  346. package/dist/client/assets/record-editor-CpdffT8c.js +0 -1
  347. package/dist/client/assets/reports-BPHAKeLt.js +0 -1
  348. package/dist/client/assets/route-A5Z0zH-S.js +0 -1
  349. package/dist/client/assets/tasks-D8uwJLml.js +0 -1
  350. package/dist/client/assets/use-new-blocks-editor-B8T1CzFC.js +0 -1
  351. package/dist/client/assets/useInfiniteQuery-DBJEu0oi.js +0 -1
  352. package/dist/client/assets/useSuspenseInfiniteQuery-BSRD8Fs9.js +0 -1
@@ -1,12 +1,12 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/openai-conversation-IgCPp4x2.js","assets/index-Du2WlkP0.js","assets/index-DjN2oOmz.css","assets/index-DjWuJPor.js","assets/gateway-client-BGYFNhpz.js","assets/dialog-CshkwPdi.js","assets/X-OQ3vfwBp.js","assets/form-DC-OZkLI.js","assets/label-58Qw-JZE.js","assets/input-BrdR9egr.js","assets/utils-CVEq3hMx.js","assets/org-file-open-context-BnLB4jSd.js","assets/use-mobile-DW2X9sww.js","assets/use-panel-navigate-CJDpCpnr.js","assets/thread-route-B_-rBMiW.js","assets/use-project-scope-DEPThRAR.js","assets/repository-binding-1HKJG2dU.js","assets/use-mcp-client-BGwc0_aG.js","assets/auth-zVBOuttQ.js","assets/tooltip-CBM_j-A9.js","assets/index-DMbzNFov.js","assets/shell-layout-5_bP0b9R.js","assets/avatar-Qof2vVxs.js","assets/User01-DRLDcqZB.js","assets/Palette-DDgu7YQn.js","assets/UserSquare-EoQ6nRn7.js","assets/agent-icon-DMUppBcz.js","assets/AlertCircle-XXAWlcgx.js","assets/Tool01-Dd7igGPM.js","assets/ArrowUp-By9-vc-8.js","assets/ArrowLeft-DI9NttEp.js","assets/LinkBroken01-CbbXXlF9.js","assets/ShoppingBag01-CJPq-mn3.js","assets/ZoomOut-RxJ7nETy.js","assets/CheckCircle-DkWvJpfN.js","assets/Check-BdObHRMl.js","assets/ChevronUp--br7_cGI.js","assets/Copy01-DFagqi8s.js","assets/CreditCard01-cZe4LFh2.js","assets/DotsVertical-C3ILFYD8.js","assets/Image01-C9BtItDq.js","assets/XClose-CLkNA1fZ.js","assets/Key01-ByeXvLue.js","assets/Link01-Ca-PT5RE.js","assets/LinkExternal01-DgOdwpZM.js","assets/Monitor01-vZxChPKG.js","assets/Sun-3gw5TBRM.js","assets/Plus-Dc1-p3zJ.js","assets/SearchMd-Djuw3ygg.js","assets/Trash01-5a67oVPj.js","assets/Upload01-B3VzWbAA.js","assets/Users01-MkVzddym.js","assets/download-app-dialog-CNKP1j9Z.js","assets/command-DdkhWyIl.js","assets/index-qPYY6GgG.js","assets/integration-icon-CViStXoz.js","assets/project-icon-Dv5tiaQd.js","assets/new-project-dialog-Su3Gi1wb.js","assets/repository-import-picker-BMdxix12.js","assets/use-navigate-to-agent-KxGV60Dd.js","assets/thread-intent-CzXA7HyL.js","assets/backoff-8mStPHYB.js","assets/task-board-D6xVkaAN.js","assets/schema-DOdBNr_5.js","assets/slugify-CEUa2lfQ.js","assets/repository-picker-Bnum34GQ.js","assets/useInfiniteQuery-DBJEu0oi.js","assets/infiniteQueryObserver-CykMAwkD.js","assets/collection-search-306OP2vT.js","assets/use-debounced-value-Hi5DwWll.js","assets/use-organization-settings-CFjSMs5I.js","assets/use-is-desktop-app-BNujXJc_.js","assets/required-auth-layout-eWdAXpWY.js","assets/autosend-BMuGk3J_.js","assets/use-org-sso-sCMMN9gF.js","assets/shell-layout-CE2Eihra.css","assets/chat-draft-BOf2ssWg.js","assets/use-session-runtime-B4jHGSPb.js","assets/chat-context-BT_fCIwJ.js","assets/use-decopilot-events-DtADALaV.js","assets/use-ai-providers-4MxbSPqM.js","assets/location-DPIrGNp7.js","assets/select-D1BEDRG_.js","assets/usage-stats-CGc489dq.js","assets/use-copy-C4UTClGi.js","assets/markdown-DLKu3YBc.js","assets/format-time-CjIPQhCN.js","assets/differenceInSeconds-C3x8sHUj.js","assets/tabs-CmlgRJbo.js","assets/use-deco-credits-CGSwGByQ.js","assets/toggle-group-DcI3Rbbl.js","assets/tool-namespace-DmnQIdtF.js","assets/use-open-billing-url-C-a_tMdF.js","assets/decopilot-BJE0q6o0.js","assets/checkbox-9g6HUE3a.js","assets/ai-providers-logos-DD3qZ33J.js","assets/popover-Co_XiyUD.js","assets/drawer-CHF6n3YP.js","assets/index-CpDmId9B.js","assets/input-DXtLlTqd.js","assets/suggestion-CEb70Zl1.js","assets/use-mcp-prompts-DAbiwecO.js","assets/use-org-fs-DdUjMTXp.js","assets/question-004-sINsf4GQ.js","assets/use-members-D1ReT2Rd.js","assets/use-org-auth-client-CP32u1RF.js","assets/feature-paywall-DjjdhYl3.js","assets/plan-ladder-DKUy9zvx.js","assets/add-connection-dialog-CohlF0gi.js","assets/extract-connection-data-CcjZtPjH.js","assets/metadata-D72DunRR.js","assets/connection-Bam5fQyG.js","assets/connection-card-zwY0dB-Z.js","assets/connection-slug-CITJ0kGN.js","assets/textarea-0prb_Emi.js","assets/use-connection-BPxGVk9k.js","assets/connection-form-helpers-BOQir9cM.js","assets/authenticate-and-persist-oauth-DTnPLNmp.js","assets/mcp-oauth-Cnjp3DGr.js","assets/collection-tabs-B0KzfANL.js","assets/badge-DlBGBPxK.js","assets/use-infinite-scroll-C_Nczdx_.js","assets/useSuspenseInfiniteQuery-BSRD8Fs9.js","assets/use-task-board-events-ChPcPJPj.js","assets/use-chat-layout-state-BiDmge4s.js","assets/use-file-configs-D8tlssbt.js","assets/site-slug-DebpOoQq.js"])))=>i.map(i=>d[i]);
2
- import{aO as Ue,c as R,b as B,r as P,l as O,j as n,au as re,bM as Ut,av as ne,bL as Le,B as Y,at as js,as as ks,bN as ws,bK as Ss,x as Se,aU as Cs,e2 as we,e3 as mt,a2 as Ns,e as Is,t as Ee,q as te,X as Ce,d as rt,e0 as Ts,Z as _s,K as Ms,m as Ds,I as Rs,F as Es,H as Ps,G as Ae,aj as gt,ah as xt,ai as vt,h as Us,aG as Ls,aF as Fs,ak as zs,cQ as Os,cU as ye,aK as $s,cW as Bs,aL as bt,aP as Ks,a as qs,U as Qs,V as Ws,ay as tt,a6 as Lt,bT as Ys,aE as Gs}from"./index-Du2WlkP0.js";import{c as Hs,d as Ft,P as Js,i as Zs}from"./index-DjWuJPor.js";import{K as Xs,c as en}from"./shell-layout-5_bP0b9R.js";import{a as tn}from"./repository-binding-1HKJG2dU.js";import{w as sn,A as nn}from"./autosend-BMuGk3J_.js";import{s as on,r as At,i as rn,c as an,w as ln,H as Vn}from"./chat-draft-BOf2ssWg.js";import{u as cn}from"./use-session-runtime-B4jHGSPb.js";import{i as zt}from"./LinkBroken01-CbbXXlF9.js";import{i as Ot}from"./ArrowUp-By9-vc-8.js";import{n as $t}from"./ShoppingBag01-CJPq-mn3.js";import{i as it}from"./Check-BdObHRMl.js";import{t as We,aK as Bt,a0 as Kt,aL as st,f as at,ar as dn,Y as un,aM as pn,p as qt,aN as Qt,G as fn,aO as hn}from"./agent-icon-DMUppBcz.js";import{a as Wt}from"./Image01-C9BtItDq.js";import{g as mn}from"./UserSquare-EoQ6nRn7.js";import{i as gn}from"./Upload01-B3VzWbAA.js";import{i as lt}from"./X-OQ3vfwBp.js";import{a as Fe,b as Ye,c as Ge,i as xn,k as vn,l as bn,m as An,n as yn,o as jn,p as kn,q as wn,f as Sn,u as Cn,s as Nn,d as In}from"./chat-context-BT_fCIwJ.js";import{o as Tn,z as _n,q as Mn,c as Dn}from"./thread-intent-CzXA7HyL.js";import{i as Rn}from"./AlertCircle-XXAWlcgx.js";import{a as En}from"./Copy01-DFagqi8s.js";import{a as nt,b as Vt,d as ct,f as dt,F as Yt}from"./form-DC-OZkLI.js";import{c as Pn,S as Un,b as Ln,a as Fn,d as zn}from"./select-D1BEDRG_.js";import{t as Gt}from"./ChevronUp--br7_cGI.js";import{T as He,a as Je,b as Ze}from"./tooltip-CBM_j-A9.js";import{i as On}from"./ArrowLeft-DI9NttEp.js";import{M as $n,S as Bn}from"./usage-stats-CGc489dq.js";import{c as Kn,b as qn}from"./tabs-CmlgRJbo.js";import{d as Qn,h as Wn,c as Yn,b as Gn,D as Hn}from"./dialog-CshkwPdi.js";import{e as ze,f as Jn,c as Zn,g as Xn}from"./use-decopilot-events-DtADALaV.js";import{u as eo}from"./use-deco-credits-CGSwGByQ.js";import{I as to}from"./input-BrdR9egr.js";import{T as yt,a as so}from"./toggle-group-DcI3Rbbl.js";import{s as no}from"./tool-namespace-DmnQIdtF.js";import{t as oo}from"./utils-CVEq3hMx.js";import{u as ro}from"./use-open-billing-url-C-a_tMdF.js";import{s as io}from"./XClose-CLkNA1fZ.js";import{M as ao,m as ut,g as lo,a as Vo}from"./decopilot-BJE0q6o0.js";import{a as Ht,b as Jt,P as Zt}from"./popover-Co_XiyUD.js";import{c as co,b as uo,a as po,D as fo}from"./drawer-CHF6n3YP.js";import{u as Xt}from"./use-mobile-DW2X9sww.js";import{t as ho}from"./Tool01-Dd7igGPM.js";import{c as mo,a as go}from"./use-organization-settings-CFjSMs5I.js";import{u as es,c as xo}from"./use-ai-providers-4MxbSPqM.js";import{M as vo}from"./index-CpDmId9B.js";import{p as ts,u as bo,T as Ao,a as yo,U as jo}from"./input-DXtLlTqd.js";import{d as ko,g as jt,s as wo}from"./gateway-client-BGYFNhpz.js";import{u as So}from"./use-mcp-client-BGwc0_aG.js";import{l as Co,g as No}from"./use-mcp-prompts-DAbiwecO.js";import{i as Io}from"./Link01-Ca-PT5RE.js";import{s as kt}from"./Plus-Dc1-p3zJ.js";import"./suggestion-CEb70Zl1.js";import{p as To,q as _o}from"./question-004-sINsf4GQ.js";import{A as Mo}from"./avatar-Qof2vVxs.js";import{u as Do}from"./use-members-D1ReT2Rd.js";import{F as wt}from"./feature-paywall-DjjdhYl3.js";import{A as Ro}from"./add-connection-dialog-CohlF0gi.js";import{u as Eo}from"./use-task-board-events-ChPcPJPj.js";import{d as Po}from"./use-chat-layout-state-BiDmge4s.js";import{u as Uo}from"./use-is-desktop-app-BNujXJc_.js";const Lo=Ue("Headphones",[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",key:"1xhozi"}]]);const Fo=Ue("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);const zo=Ue("MicOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M18.89 13.23A7.12 7.12 0 0 0 19 12v-2",key:"80xlxr"}],["path",{d:"M5 10v2a7 7 0 0 0 12 5",key:"p2k8kg"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);const Oo=Ue("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);const $o=Ue("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),et="cubic-bezier(0.645, 0.045, 0.355, 1)",Ja=44,Bo={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"},Ko={default:"border-border",error:"border-destructive/30",warning:"border-warning/30"},qo={default:"text-muted-foreground",error:"text-destructive",warning:"text-warning"};function pe(t){const e=R.c(69),{icon:s,label:o,count:r,title:i,footerLeft:a,footerRight:l,children:V,defaultExpanded:d,variant:u,onClose:c}=t,p=u===void 0?"default":u,f=B(),[m,h]=P.useState(d),[g,v]=P.useState(!1);let x;e[0]!==c?(x=()=>{v(!0),c?.()},e[0]=c,e[1]=x):x=e[1];const b=x;if(g)return null;const A=Ko[p],j=Bo[p];let k;e[2]!==A||e[3]!==j?(k=O("relative flex flex-col rounded-xl bg-background border shadow-md","w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",A,j),e[2]=A,e[3]=j,e[4]=k):k=e[4];let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=()=>h(Qo),e[5]=y):y=e[5];const w=m&&"rounded-b-none",C=!m&&"rounded-b-xl";let S;e[6]!==w||e[7]!==C?(S=O("flex items-center gap-2 w-full px-3 py-2 text-sm text-left","hover:bg-accent/50 transition-colors rounded-t-xl",w,C),e[6]=w,e[7]=C,e[8]=S):S=e[8];const I=qo[p];let N;e[9]!==I?(N=O("shrink-0",I),e[9]=I,e[10]=N):N=e[10];let T;e[11]!==s||e[12]!==N?(T=n.jsx("span",{className:N,children:s}),e[11]=s,e[12]=N,e[13]=T):T=e[13];let _;e[14]!==o?(_=n.jsx("span",{className:"flex-1 min-w-0 truncate",children:o}),e[14]=o,e[15]=_):_=e[15];let E;e[16]!==r?(E=r?n.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:r}):null,e[16]=r,e[17]=E):E=e[17];const U=m?"rotate(180deg)":"rotate(0deg)";let M;e[18]!==U?(M=n.jsx("span",{"aria-hidden":"true",className:"text-muted-foreground shrink-0 flex items-center justify-center",children:n.jsx(Gt,{size:16,style:{transform:U,transition:`transform 180ms ${et}`}})}),e[18]=U,e[19]=M):M=e[19];let L;e[20]!==f?(L=f("chat.collapsibleHighlight.closeLabel"),e[20]=f,e[21]=L):L=e[21];let z;e[22]!==f?(z=f("chat.collapsibleHighlight.closeTitle"),e[22]=f,e[23]=z):z=e[23];let W,$;e[24]!==b?(W=le=>{le.stopPropagation(),b()},$=le=>{(le.key==="Enter"||le.key===" ")&&(le.preventDefault(),le.stopPropagation(),b())},e[24]=b,e[25]=W,e[26]=$):(W=e[25],$=e[26]);let F;e[27]===Symbol.for("react.memo_cache_sentinel")?(F=n.jsx(lt,{size:16}),e[27]=F):F=e[27];let Q;e[28]!==L||e[29]!==z||e[30]!==W||e[31]!==$?(Q=n.jsx("span",{role:"button",tabIndex:0,"data-testid":"collapsible-highlight-close","aria-label":L,title:z,onClick:W,onKeyDown:$,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]=L,e[29]=z,e[30]=W,e[31]=$,e[32]=Q):Q=e[32];let Z;e[33]!==m||e[34]!==T||e[35]!==_||e[36]!==E||e[37]!==M||e[38]!==Q||e[39]!==S?(Z=n.jsxs("button",{type:"button","data-testid":"collapsible-highlight-chip","aria-expanded":m,onClick:y,className:S,children:[T,_,E,M,Q]}),e[33]=m,e[34]=T,e[35]=_,e[36]=E,e[37]=M,e[38]=Q,e[39]=S,e[40]=Z):Z=e[40];const se=m?"1fr":"0fr";let X;e[41]!==se?(X={display:"grid",gridTemplateRows:se,transition:`grid-template-rows 180ms ${et}`},e[41]=se,e[42]=X):X=e[42];let D;e[43]===Symbol.for("react.memo_cache_sentinel")?(D={overflow:"hidden",minHeight:0},e[43]=D):D=e[43];const K=m?1:0;let H;e[44]!==K?(H={opacity:K,transition:`opacity 120ms ${et}`,maxHeight:"60vh"},e[44]=K,e[45]=H):H=e[45];let ee;e[46]!==i?(ee=i?n.jsx("div",{className:"flex items-start gap-2 px-4 pt-4 pb-5 border-t border-dashed border-border/60",children:n.jsx("p",{className:"flex-1 text-base font-medium text-foreground min-w-0",children:i})}):n.jsx("div",{className:"border-t border-dashed border-border/60"}),e[46]=i,e[47]=ee):ee=e[47];let J;e[48]!==V||e[49]!==i?(J=V?n.jsx("div",{className:O("pb-4",!i&&"pt-4"),children:V}):null,e[48]=V,e[49]=i,e[50]=J):J=e[50];let ae;e[51]!==ee||e[52]!==J?(ae=n.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[ee,J]}),e[51]=ee,e[52]=J,e[53]=ae):ae=e[53];let G;e[54]!==a||e[55]!==l?(G=a||l?n.jsx("div",{className:"shrink-0 border-t border-border px-3 py-3 pb-6",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{children:a}),n.jsx("div",{className:"flex items-center gap-2",children:l})]})}):null,e[54]=a,e[55]=l,e[56]=G):G=e[56];let ce;e[57]!==H||e[58]!==ae||e[59]!==G?(ce=n.jsx("div",{style:D,children:n.jsxs("div",{className:"flex flex-col",style:H,children:[ae,G]})}),e[57]=H,e[58]=ae,e[59]=G,e[60]=ce):ce=e[60];let ie;e[61]!==X||e[62]!==ce?(ie=n.jsx("div",{"data-testid":"collapsible-highlight-body",style:X,children:ce}),e[61]=X,e[62]=ce,e[63]=ie):ie=e[63];let fe;return e[64]!==Z||e[65]!==ie||e[66]!==k||e[67]!==p?(fe=n.jsxs("div",{"data-testid":"collapsible-highlight","data-variant":p,className:k,children:[Z,ie]}),e[64]=Z,e[65]=ie,e[66]=k,e[67]=p,e[68]=fe):fe=e[68],fe}function Qo(t){return!t}const Wo=re({content:ne().min(1).describe("Imperative form, e.g. 'Implement the login flow'"),status:Le(["pending","in_progress","completed"]),activeForm:ne().min(1).describe("Present-continuous form shown in the UI while the todo is in progress, e.g. 'Implementing the login flow'")}),ss=re({todos:Ut(Wo)}),Yo="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.";Tn({description:Yo,inputSchema:_n(ss),execute:async({todos:t})=>({ok:!0,count:t.length})});const Go="tool-todo_write",Ho=new Set(["input-available","output-available"]);function Jo(t){for(let e=t.length-1;e>=0;e--){const s=t[e];if(s.role!=="assistant")continue;const o=s.parts;if(Array.isArray(o))for(let r=o.length-1;r>=0;r--){const i=o[r];if(i.type!==Go||typeof i.state!="string"||!Ho.has(i.state))continue;const a=ss.safeParse(i.input);if(a.success)return a.data.todos}}return[]}function ns(t){const e=[];for(const s of t)if("state"in s&&s.state==="approval-requested"&&"approval"in s&&s.approval?.id&&"toolCallId"in s&&s.toolCallId){const o="toolName"in s&&typeof s.toolName=="string"?s.toolName:s.type.startsWith("tool-")?s.type.replace("tool-",""):"Tool";e.push({approvalId:s.approval.id,toolCallId:s.toolCallId,toolName:o,friendlyName:oo(no(o)),input:s.input})}return e}function os(t){return t.at(-1)}function rs(t){const e=[];for(const s of t)s.type==="tool-propose_plan"&&s.state==="input-available"&&e.push({toolCallId:s.toolCallId,plan:s.input.plan,state:s.state});return e}function Zo(t){return t?t.message.startsWith("[CREDITS]"):!1}const Xo={isCreditExhausted:!1,planRefusal:null,subscriptionErrorKind:null,hasTodos:!1,showError:!1,showWarning:!1,hasApprovals:!1,hasPlans:!1,isWaitingForUserInput:!1,hasTaskSuggestion:!1,todos:[]};function er(t){const{messages:e,error:s,finishReason:o,isStreaming:r,isWaitingForApprovals:i}=t;if(!r&&s&&Zo(s))return{...Xo,isCreditExhausted:!0};const a=e.at(-1),l=a?.role==="assistant"?a.parts:[],V=l,u=!!V.filter(k=>k.type==="tool-user_ask").filter(k=>k.state!=="output-available").length,c=V.some(k=>k.type==="tool-suggest_task"&&k.state==="input-available"),p=rs(l),f=ns(V),m=Jo(e),h=r?null:on(s),g=r?null:Mn(s),v=!r&&!!s&&!h&&!g,x=f.length>0||r&&i,b=p.length>0,j=!r&&!!o&&o!=="stop"&&!(o==="tool-calls"&&(u||x||b||c))&&!v;return{isCreditExhausted:!1,planRefusal:g,subscriptionErrorKind:h,hasTodos:m.length>0,showError:v,showWarning:j,hasApprovals:x,hasPlans:b,isWaitingForUserInput:u,hasTaskSuggestion:c,todos:m}}function is(){const t=R.c(6),{messages:e,error:s,finishReason:o,isStreaming:r,isWaitingForApprovals:i}=Fe(),a=s??null,l=o??null;let V;return t[0]!==r||t[1]!==i||t[2]!==e||t[3]!==a||t[4]!==l?(V=er({messages:e,error:a,finishReason:l,isStreaming:r,isWaitingForApprovals:i}),t[0]=r,t[1]=i,t[2]=e,t[3]=a,t[4]=l,t[5]=V):V=t[5],V}function Za(){const t=is(),e=ze("credits");return t.isCreditExhausted?e?0:1:Number(t.hasTodos)+Number(t.showError)+ +!!t.subscriptionErrorKind+ +!!t.planRefusal+Number(t.showWarning)+Number(t.hasApprovals)+Number(t.hasPlans)+Number(t.isWaitingForUserInput)+Number(t.hasTaskSuggestion)}const St="start-task",tr=`Turn the report below into a running task. The user pressed "Start task", which authorizes delegation.
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/openai-conversation-BQ0qlnvJ.js","assets/index-Co-4sRnJ.js","assets/index-DjN2oOmz.css","assets/index-BMb0J2ET.js","assets/gateway-client-Dv06lV8N.js","assets/dialog-Dw8xcjW3.js","assets/X-CMwuaze4.js","assets/form-CqyDHzdF.js","assets/label-DU_w-ckQ.js","assets/input-CKfCW4iw.js","assets/utils-CVEq3hMx.js","assets/org-file-open-context-CgCmoW9s.js","assets/use-mobile-C_c7X_X9.js","assets/use-panel-navigate-9QHW-FCg.js","assets/thread-route-BAsLNDrI.js","assets/use-project-scope-Bn-XeyFm.js","assets/repository-binding-B0HdN6Lz.js","assets/use-mcp-client-huiboiuW.js","assets/auth-D62PuyHX.js","assets/tooltip-CYfkikaX.js","assets/index-MAF8_efg.js","assets/shell-layout-HGSCI1cW.js","assets/avatar-HeVuI3WS.js","assets/User01-BY20MgLM.js","assets/Palette-Dcur9L4v.js","assets/UserSquare-bfdtEra2.js","assets/agent-icon-DV55KTHV.js","assets/AlertCircle-BRBGpzZA.js","assets/Tool01-lC3aADL7.js","assets/ArrowUp-DH2IataT.js","assets/ArrowLeft-D_nqQ9tV.js","assets/LinkBroken01-t821Qpkz.js","assets/ShoppingBag01-CnpFPbsS.js","assets/ZoomOut-D_ifUcHu.js","assets/CheckCircle-RceYLcNO.js","assets/Check-CO_ET4WO.js","assets/ChevronUp-DnrzvZVs.js","assets/Copy01-BBbKMHlK.js","assets/CreditCard01-D97_uv9-.js","assets/DotsVertical-DA8jC7Sm.js","assets/Image01-AFCLWig4.js","assets/XClose-CzlFjlez.js","assets/Key01-DOFfyL8f.js","assets/Link01-7l6-kKGf.js","assets/LinkExternal01-CGlBJ7ud.js","assets/Monitor01-B8XQMd3B.js","assets/Sun-CnfUJ0L6.js","assets/Plus-B0dyDF7l.js","assets/SearchMd-DWmqXOB3.js","assets/Trash01-DV0azdbE.js","assets/Upload01-DK8FpPmK.js","assets/Users01-qvvwVlrt.js","assets/download-app-dialog-BSYwZSLo.js","assets/command-C0uSVAHC.js","assets/index-D0owq1f2.js","assets/integration-icon-CNlbbwne.js","assets/project-icon-CIt25m1v.js","assets/new-project-dialog-CzRX3bqD.js","assets/repository-import-picker-DBLmxazs.js","assets/use-navigate-to-agent-B8uYHMgO.js","assets/thread-intent-B5r6uX01.js","assets/backoff-8mStPHYB.js","assets/task-board-DV8c5Zhu.js","assets/schema-Bg7Z4WK1.js","assets/slugify-CEUa2lfQ.js","assets/repository-picker-DIAetLTu.js","assets/useInfiniteQuery-BbXVrX4k.js","assets/infiniteQueryObserver-DJ3A-TdU.js","assets/collection-search-BVdAr8z7.js","assets/use-debounced-value-DDoK_9IU.js","assets/use-organization-settings-BXIx1FLP.js","assets/use-is-desktop-app-BNujXJc_.js","assets/required-auth-layout-miKcB0rt.js","assets/autosend-_7Pn3AYs.js","assets/use-org-sso-WomPaWOu.js","assets/shell-layout-CE2Eihra.css","assets/chat-draft-DVoUlwJ3.js","assets/use-session-runtime-Mt5i1NtG.js","assets/chat-context-CocIg825.js","assets/use-decopilot-events-BZEZhg3r.js","assets/use-ai-providers-zPZTeTn6.js","assets/location-DPIrGNp7.js","assets/select-CZTYe-RM.js","assets/usage-stats-B5xe2MvZ.js","assets/use-copy-kTB71Cx6.js","assets/markdown-C9QLOL7g.js","assets/format-time-CjIPQhCN.js","assets/differenceInSeconds-C3x8sHUj.js","assets/tabs-aXag5nk_.js","assets/use-deco-credits-DIzsZghd.js","assets/toggle-group-CSB3oZUC.js","assets/tool-namespace-DmnQIdtF.js","assets/use-open-billing-url-ClFzvK5L.js","assets/decopilot-2FFmwoNB.js","assets/checkbox-C-jsWi4f.js","assets/ai-providers-logos-DD3qZ33J.js","assets/popover-DmlD7L54.js","assets/drawer-Dt1DFlEt.js","assets/index-DcYvMhsA.js","assets/input-BxLUTBXU.js","assets/suggestion-BkHBW1eO.js","assets/use-mcp-prompts-CK7nTCfz.js","assets/use-org-fs-Zkz7cnFM.js","assets/question-004-sINsf4GQ.js","assets/use-members-Czj8Or22.js","assets/use-org-auth-client-DGMlZ1DJ.js","assets/feature-paywall-BgH7Ln-V.js","assets/plan-ladder-PugCzyO6.js","assets/add-connection-dialog-BxahNv4G.js","assets/extract-connection-data-Cb2jVjCO.js","assets/metadata-D72DunRR.js","assets/connection-CWiycsnd.js","assets/connection-card-DINEZcyg.js","assets/connection-slug-CITJ0kGN.js","assets/textarea-BwFbzFhR.js","assets/use-connection-DzHiClla.js","assets/connection-form-helpers-C825tgC1.js","assets/authenticate-and-persist-oauth-DoNypqY8.js","assets/mcp-oauth-BimxrF_f.js","assets/collection-tabs-D--zl7tk.js","assets/badge-DLk0uZg2.js","assets/use-infinite-scroll-CaES8Ly6.js","assets/useSuspenseInfiniteQuery-Ddc-zVFy.js","assets/use-task-board-events-CHHrBRNs.js","assets/use-chat-layout-state-_hTo6qiX.js","assets/use-file-configs-Dckq5B6h.js","assets/site-slug-DebpOoQq.js"])))=>i.map(i=>d[i]);
2
+ import{aO as Ue,c as R,b as B,r as P,l as O,j as n,au as re,bM as Ut,av as ne,bL as Le,B as Y,at as js,as as ks,bN as ws,bK as Ss,x as Se,aU as Cs,e2 as we,e3 as mt,a2 as Ns,e as Is,t as Ee,q as te,X as Ce,d as rt,e0 as Ts,Z as _s,K as Ms,m as Ds,I as Rs,F as Es,H as Ps,G as Ae,aj as gt,ah as xt,ai as vt,h as Us,aG as Ls,aF as Fs,ak as zs,cQ as Os,cU as ye,aK as $s,cW as Bs,aL as bt,aP as Ks,a as qs,U as Qs,V as Ws,ay as tt,a6 as Lt,bT as Ys,aE as Gs}from"./index-Co-4sRnJ.js";import{c as Hs,d as Ft,P as Js,i as Zs}from"./index-BMb0J2ET.js";import{K as Xs,c as en}from"./shell-layout-HGSCI1cW.js";import{a as tn}from"./repository-binding-B0HdN6Lz.js";import{w as sn,A as nn}from"./autosend-_7Pn3AYs.js";import{s as on,r as At,i as rn,c as an,w as ln,H as Vn}from"./chat-draft-DVoUlwJ3.js";import{u as cn}from"./use-session-runtime-Mt5i1NtG.js";import{i as zt}from"./LinkBroken01-t821Qpkz.js";import{i as Ot}from"./ArrowUp-DH2IataT.js";import{n as $t}from"./ShoppingBag01-CnpFPbsS.js";import{i as it}from"./Check-CO_ET4WO.js";import{t as We,aK as Bt,a0 as Kt,aL as st,f as at,ar as dn,Y as un,aM as pn,p as qt,aN as Qt,G as fn,aO as hn}from"./agent-icon-DV55KTHV.js";import{a as Wt}from"./Image01-AFCLWig4.js";import{g as mn}from"./UserSquare-bfdtEra2.js";import{i as gn}from"./Upload01-DK8FpPmK.js";import{i as lt}from"./X-CMwuaze4.js";import{a as Fe,b as Ye,c as Ge,i as xn,k as vn,l as bn,m as An,n as yn,o as jn,p as kn,q as wn,f as Sn,u as Cn,s as Nn,d as In}from"./chat-context-CocIg825.js";import{o as Tn,z as _n,q as Mn,c as Dn}from"./thread-intent-B5r6uX01.js";import{i as Rn}from"./AlertCircle-BRBGpzZA.js";import{a as En}from"./Copy01-BBbKMHlK.js";import{a as nt,b as Vt,d as ct,f as dt,F as Yt}from"./form-CqyDHzdF.js";import{c as Pn,S as Un,b as Ln,a as Fn,d as zn}from"./select-CZTYe-RM.js";import{t as Gt}from"./ChevronUp-DnrzvZVs.js";import{T as He,a as Je,b as Ze}from"./tooltip-CYfkikaX.js";import{i as On}from"./ArrowLeft-D_nqQ9tV.js";import{M as $n,S as Bn}from"./usage-stats-B5xe2MvZ.js";import{c as Kn,b as qn}from"./tabs-aXag5nk_.js";import{d as Qn,h as Wn,c as Yn,b as Gn,D as Hn}from"./dialog-Dw8xcjW3.js";import{e as ze,f as Jn,c as Zn,g as Xn}from"./use-decopilot-events-BZEZhg3r.js";import{u as eo}from"./use-deco-credits-DIzsZghd.js";import{I as to}from"./input-CKfCW4iw.js";import{T as yt,a as so}from"./toggle-group-CSB3oZUC.js";import{s as no}from"./tool-namespace-DmnQIdtF.js";import{t as oo}from"./utils-CVEq3hMx.js";import{u as ro}from"./use-open-billing-url-ClFzvK5L.js";import{s as io}from"./XClose-CzlFjlez.js";import{M as ao,m as ut,g as lo,a as Vo}from"./decopilot-2FFmwoNB.js";import{a as Ht,b as Jt,P as Zt}from"./popover-DmlD7L54.js";import{c as co,b as uo,a as po,D as fo}from"./drawer-Dt1DFlEt.js";import{u as Xt}from"./use-mobile-C_c7X_X9.js";import{t as ho}from"./Tool01-lC3aADL7.js";import{c as mo,a as go}from"./use-organization-settings-BXIx1FLP.js";import{u as es,c as xo}from"./use-ai-providers-zPZTeTn6.js";import{M as vo}from"./index-DcYvMhsA.js";import{p as ts,u as bo,T as Ao,a as yo,U as jo}from"./input-BxLUTBXU.js";import{d as ko,g as jt,s as wo}from"./gateway-client-Dv06lV8N.js";import{u as So}from"./use-mcp-client-huiboiuW.js";import{l as Co,g as No}from"./use-mcp-prompts-CK7nTCfz.js";import{i as Io}from"./Link01-7l6-kKGf.js";import{s as kt}from"./Plus-B0dyDF7l.js";import"./suggestion-BkHBW1eO.js";import{p as To,q as _o}from"./question-004-sINsf4GQ.js";import{A as Mo}from"./avatar-HeVuI3WS.js";import{u as Do}from"./use-members-Czj8Or22.js";import{F as wt}from"./feature-paywall-BgH7Ln-V.js";import{A as Ro}from"./add-connection-dialog-BxahNv4G.js";import{u as Eo}from"./use-task-board-events-CHHrBRNs.js";import{d as Po}from"./use-chat-layout-state-_hTo6qiX.js";import{u as Uo}from"./use-is-desktop-app-BNujXJc_.js";const Lo=Ue("Headphones",[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",key:"1xhozi"}]]);const Fo=Ue("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);const zo=Ue("MicOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M18.89 13.23A7.12 7.12 0 0 0 19 12v-2",key:"80xlxr"}],["path",{d:"M5 10v2a7 7 0 0 0 12 5",key:"p2k8kg"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);const Oo=Ue("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);const $o=Ue("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),et="cubic-bezier(0.645, 0.045, 0.355, 1)",Ja=44,Bo={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"},Ko={default:"border-border",error:"border-destructive/30",warning:"border-warning/30"},qo={default:"text-muted-foreground",error:"text-destructive",warning:"text-warning"};function pe(t){const e=R.c(69),{icon:s,label:o,count:r,title:i,footerLeft:a,footerRight:l,children:V,defaultExpanded:d,variant:u,onClose:c}=t,p=u===void 0?"default":u,f=B(),[m,h]=P.useState(d),[g,v]=P.useState(!1);let x;e[0]!==c?(x=()=>{v(!0),c?.()},e[0]=c,e[1]=x):x=e[1];const b=x;if(g)return null;const A=Ko[p],j=Bo[p];let k;e[2]!==A||e[3]!==j?(k=O("relative flex flex-col rounded-xl bg-background border shadow-md","w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",A,j),e[2]=A,e[3]=j,e[4]=k):k=e[4];let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=()=>h(Qo),e[5]=y):y=e[5];const w=m&&"rounded-b-none",C=!m&&"rounded-b-xl";let S;e[6]!==w||e[7]!==C?(S=O("flex items-center gap-2 w-full px-3 py-2 text-sm text-left","hover:bg-accent/50 transition-colors rounded-t-xl",w,C),e[6]=w,e[7]=C,e[8]=S):S=e[8];const I=qo[p];let N;e[9]!==I?(N=O("shrink-0",I),e[9]=I,e[10]=N):N=e[10];let T;e[11]!==s||e[12]!==N?(T=n.jsx("span",{className:N,children:s}),e[11]=s,e[12]=N,e[13]=T):T=e[13];let _;e[14]!==o?(_=n.jsx("span",{className:"flex-1 min-w-0 truncate",children:o}),e[14]=o,e[15]=_):_=e[15];let E;e[16]!==r?(E=r?n.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:r}):null,e[16]=r,e[17]=E):E=e[17];const U=m?"rotate(180deg)":"rotate(0deg)";let M;e[18]!==U?(M=n.jsx("span",{"aria-hidden":"true",className:"text-muted-foreground shrink-0 flex items-center justify-center",children:n.jsx(Gt,{size:16,style:{transform:U,transition:`transform 180ms ${et}`}})}),e[18]=U,e[19]=M):M=e[19];let L;e[20]!==f?(L=f("chat.collapsibleHighlight.closeLabel"),e[20]=f,e[21]=L):L=e[21];let z;e[22]!==f?(z=f("chat.collapsibleHighlight.closeTitle"),e[22]=f,e[23]=z):z=e[23];let W,$;e[24]!==b?(W=le=>{le.stopPropagation(),b()},$=le=>{(le.key==="Enter"||le.key===" ")&&(le.preventDefault(),le.stopPropagation(),b())},e[24]=b,e[25]=W,e[26]=$):(W=e[25],$=e[26]);let F;e[27]===Symbol.for("react.memo_cache_sentinel")?(F=n.jsx(lt,{size:16}),e[27]=F):F=e[27];let Q;e[28]!==L||e[29]!==z||e[30]!==W||e[31]!==$?(Q=n.jsx("span",{role:"button",tabIndex:0,"data-testid":"collapsible-highlight-close","aria-label":L,title:z,onClick:W,onKeyDown:$,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]=L,e[29]=z,e[30]=W,e[31]=$,e[32]=Q):Q=e[32];let Z;e[33]!==m||e[34]!==T||e[35]!==_||e[36]!==E||e[37]!==M||e[38]!==Q||e[39]!==S?(Z=n.jsxs("button",{type:"button","data-testid":"collapsible-highlight-chip","aria-expanded":m,onClick:y,className:S,children:[T,_,E,M,Q]}),e[33]=m,e[34]=T,e[35]=_,e[36]=E,e[37]=M,e[38]=Q,e[39]=S,e[40]=Z):Z=e[40];const se=m?"1fr":"0fr";let X;e[41]!==se?(X={display:"grid",gridTemplateRows:se,transition:`grid-template-rows 180ms ${et}`},e[41]=se,e[42]=X):X=e[42];let D;e[43]===Symbol.for("react.memo_cache_sentinel")?(D={overflow:"hidden",minHeight:0},e[43]=D):D=e[43];const K=m?1:0;let H;e[44]!==K?(H={opacity:K,transition:`opacity 120ms ${et}`,maxHeight:"60vh"},e[44]=K,e[45]=H):H=e[45];let ee;e[46]!==i?(ee=i?n.jsx("div",{className:"flex items-start gap-2 px-4 pt-4 pb-5 border-t border-dashed border-border/60",children:n.jsx("p",{className:"flex-1 text-base font-medium text-foreground min-w-0",children:i})}):n.jsx("div",{className:"border-t border-dashed border-border/60"}),e[46]=i,e[47]=ee):ee=e[47];let J;e[48]!==V||e[49]!==i?(J=V?n.jsx("div",{className:O("pb-4",!i&&"pt-4"),children:V}):null,e[48]=V,e[49]=i,e[50]=J):J=e[50];let ae;e[51]!==ee||e[52]!==J?(ae=n.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[ee,J]}),e[51]=ee,e[52]=J,e[53]=ae):ae=e[53];let G;e[54]!==a||e[55]!==l?(G=a||l?n.jsx("div",{className:"shrink-0 border-t border-border px-3 py-3 pb-6",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{children:a}),n.jsx("div",{className:"flex items-center gap-2",children:l})]})}):null,e[54]=a,e[55]=l,e[56]=G):G=e[56];let ce;e[57]!==H||e[58]!==ae||e[59]!==G?(ce=n.jsx("div",{style:D,children:n.jsxs("div",{className:"flex flex-col",style:H,children:[ae,G]})}),e[57]=H,e[58]=ae,e[59]=G,e[60]=ce):ce=e[60];let ie;e[61]!==X||e[62]!==ce?(ie=n.jsx("div",{"data-testid":"collapsible-highlight-body",style:X,children:ce}),e[61]=X,e[62]=ce,e[63]=ie):ie=e[63];let fe;return e[64]!==Z||e[65]!==ie||e[66]!==k||e[67]!==p?(fe=n.jsxs("div",{"data-testid":"collapsible-highlight","data-variant":p,className:k,children:[Z,ie]}),e[64]=Z,e[65]=ie,e[66]=k,e[67]=p,e[68]=fe):fe=e[68],fe}function Qo(t){return!t}const Wo=re({content:ne().min(1).describe("Imperative form, e.g. 'Implement the login flow'"),status:Le(["pending","in_progress","completed"]),activeForm:ne().min(1).describe("Present-continuous form shown in the UI while the todo is in progress, e.g. 'Implementing the login flow'")}),ss=re({todos:Ut(Wo)}),Yo="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.";Tn({description:Yo,inputSchema:_n(ss),execute:async({todos:t})=>({ok:!0,count:t.length})});const Go="tool-todo_write",Ho=new Set(["input-available","output-available"]);function Jo(t){for(let e=t.length-1;e>=0;e--){const s=t[e];if(s.role!=="assistant")continue;const o=s.parts;if(Array.isArray(o))for(let r=o.length-1;r>=0;r--){const i=o[r];if(i.type!==Go||typeof i.state!="string"||!Ho.has(i.state))continue;const a=ss.safeParse(i.input);if(a.success)return a.data.todos}}return[]}function ns(t){const e=[];for(const s of t)if("state"in s&&s.state==="approval-requested"&&"approval"in s&&s.approval?.id&&"toolCallId"in s&&s.toolCallId){const o="toolName"in s&&typeof s.toolName=="string"?s.toolName:s.type.startsWith("tool-")?s.type.replace("tool-",""):"Tool";e.push({approvalId:s.approval.id,toolCallId:s.toolCallId,toolName:o,friendlyName:oo(no(o)),input:s.input})}return e}function os(t){return t.at(-1)}function rs(t){const e=[];for(const s of t)s.type==="tool-propose_plan"&&s.state==="input-available"&&e.push({toolCallId:s.toolCallId,plan:s.input.plan,state:s.state});return e}function Zo(t){return t?t.message.startsWith("[CREDITS]"):!1}const Xo={isCreditExhausted:!1,planRefusal:null,subscriptionErrorKind:null,hasTodos:!1,showError:!1,showWarning:!1,hasApprovals:!1,hasPlans:!1,isWaitingForUserInput:!1,hasTaskSuggestion:!1,todos:[]};function er(t){const{messages:e,error:s,finishReason:o,isStreaming:r,isWaitingForApprovals:i}=t;if(!r&&s&&Zo(s))return{...Xo,isCreditExhausted:!0};const a=e.at(-1),l=a?.role==="assistant"?a.parts:[],V=l,u=!!V.filter(k=>k.type==="tool-user_ask").filter(k=>k.state!=="output-available").length,c=V.some(k=>k.type==="tool-suggest_task"&&k.state==="input-available"),p=rs(l),f=ns(V),m=Jo(e),h=r?null:on(s),g=r?null:Mn(s),v=!r&&!!s&&!h&&!g,x=f.length>0||r&&i,b=p.length>0,j=!r&&!!o&&o!=="stop"&&!(o==="tool-calls"&&(u||x||b||c))&&!v;return{isCreditExhausted:!1,planRefusal:g,subscriptionErrorKind:h,hasTodos:m.length>0,showError:v,showWarning:j,hasApprovals:x,hasPlans:b,isWaitingForUserInput:u,hasTaskSuggestion:c,todos:m}}function is(){const t=R.c(6),{messages:e,error:s,finishReason:o,isStreaming:r,isWaitingForApprovals:i}=Fe(),a=s??null,l=o??null;let V;return t[0]!==r||t[1]!==i||t[2]!==e||t[3]!==a||t[4]!==l?(V=er({messages:e,error:a,finishReason:l,isStreaming:r,isWaitingForApprovals:i}),t[0]=r,t[1]=i,t[2]=e,t[3]=a,t[4]=l,t[5]=V):V=t[5],V}function Za(){const t=is(),e=ze("credits");return t.isCreditExhausted?e?0:1:Number(t.hasTodos)+Number(t.showError)+ +!!t.subscriptionErrorKind+ +!!t.planRefusal+Number(t.showWarning)+Number(t.hasApprovals)+Number(t.hasPlans)+Number(t.isWaitingForUserInput)+Number(t.hasTaskSuggestion)}const St="start-task",tr=`Turn the report below into a running task. The user pressed "Start task", which authorizes delegation.
3
3
 
4
4
  1. Read the report and any attached screenshots. Carry the reporter's own words into the task description, plus the URL of any attachment.
5
5
  2. Call TASK_BOARD_ITEM_LIST. Its \`repos\` are this organization's repositories — the only valid values for a task's repo, so pick the one the report is about and never invent a name.
6
6
  3. Call TASK_BOARD_ITEM_CREATE with a concise title, the full description, the chosen repo as owner/name, assigneeId "super-agent", and onDuplicate "return_existing". That assignment is what queues the work; the duplicate option makes the tool hand back an existing task when one already covers this report instead of opening a second one.
7
7
  4. Reply with the task key the tool returned (e.g. DECO-144) and one line on what you filed. If the output says \`deduplicated: true\`, say the report was already tracked by that task and quote its \`duplicateReason\`. Never invent a URL. Do NOT implement the fix here; the task's own run does that, and the reporter gets an email when its PR is ready for review.
8
8
 
9
- The report follows.`;function sr(t){return{...t,content:[{type:"paragraph",content:[Hs({id:St,name:St,char:"/",kind:"prompt",metadata:[{role:"user",content:{type:"text",text:tr}}]})]},...t.content??[]]}}function nr(t){const e=R.c(30),{current:s,total:o,onPrev:r,onNext:i}=t,a=B();if(o<=1)return null;const l=s===0,V=s===0?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let d;e[0]!==V?(d=O("p-0.5 transition-colors rounded-lg",V),e[0]=V,e[1]=d):d=e[1];let u;e[2]!==a?(u=a("chat.pagination.previousLabel"),e[2]=a,e[3]=u):u=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(On,{size:14}),e[4]=c):c=e[4];let p;e[5]!==r||e[6]!==l||e[7]!==d||e[8]!==u?(p=n.jsx("button",{type:"button",onClick:r,disabled:l,className:d,"aria-label":u,children:c}),e[5]=r,e[6]=l,e[7]=d,e[8]=u,e[9]=p):p=e[9];const f=s+1;let m;e[10]!==a||e[11]!==f||e[12]!==o?(m=a("chat.pagination.counter",{current:f,total:o}),e[10]=a,e[11]=f,e[12]=o,e[13]=m):m=e[13];let h;e[14]!==m?(h=n.jsx("span",{className:"tabular-nums text-xs",children:m}),e[14]=m,e[15]=h):h=e[15];const g=s===o-1,v=s===o-1?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let x;e[16]!==v?(x=O("p-0.5 transition-colors rounded-lg",v),e[16]=v,e[17]=x):x=e[17];let b;e[18]!==a?(b=a("chat.pagination.nextLabel"),e[18]=a,e[19]=b):b=e[19];let A;e[20]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx(zt,{size:14}),e[20]=A):A=e[20];let j;e[21]!==i||e[22]!==g||e[23]!==x||e[24]!==b?(j=n.jsx("button",{type:"button",onClick:i,disabled:g,className:x,"aria-label":b,children:A}),e[21]=i,e[22]=g,e[23]=x,e[24]=b,e[25]=j):j=e[25];let k;return e[26]!==j||e[27]!==p||e[28]!==h?(k=n.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[p,h,j]}),e[26]=j,e[27]=p,e[28]=h,e[29]=k):k=e[29],k}function as(t){const e=R.c(8),{currentIndex:s,total:o,onPrev:r,onNext:i,extraLeft:a}=t;let l;e[0]!==s||e[1]!==i||e[2]!==r||e[3]!==o?(l=n.jsx(nr,{current:s,total:o,onPrev:r,onNext:i}),e[0]=s,e[1]=i,e[2]=r,e[3]=o,e[4]=l):l=e[4];let V;return e[5]!==a||e[6]!==l?(V=n.jsxs("div",{className:"flex items-center gap-2",children:[l,a]}),e[5]=a,e[6]=l,e[7]=V):V=e[7],V}function or(t){const e=R.c(17),{isStreaming:s,isAllAnswered:o,isCurrentAnswered:r,onAdvanceOrSubmit:i,submitLabel:a,nextLabel:l}=t,u=o?a===void 0?"Submit":a:l===void 0?"Next":l,c=o?s:!r,p=c?o?"Waiting for the assistant to finish…":"Answer this item to continue":null;let f;e[0]!==c||e[1]!==i?(f=()=>{c||i()},e[0]=c,e[1]=i,e[2]=f):f=e[2];const m=c&&"opacity-50 cursor-not-allowed";let h;e[3]!==m?(h=O("h-7 px-2.5 text-xs",m),e[3]=m,e[4]=h):h=e[4];let g;e[5]!==c||e[6]!==u||e[7]!==f||e[8]!==h?(g=n.jsx(Y,{type:"button",size:"sm","aria-disabled":c,onClick:f,className:h,children:u}),e[5]=c,e[6]=u,e[7]=f,e[8]=h,e[9]=g):g=e[9];const v=g;if(!p)return v;let x;e[10]!==v?(x=n.jsx(He,{asChild:!0,children:v}),e[10]=v,e[11]=x):x=e[11];let b;e[12]!==p?(b=n.jsx(Je,{children:p}),e[12]=p,e[13]=b):b=e[13];let A;return e[14]!==x||e[15]!==b?(A=n.jsxs(Ze,{children:[x,b]}),e[14]=x,e[15]=b,e[16]=A):A=e[16],A}function ls(t,e,s){return t.findIndex(o=>e(o)===s)}function Ct(t,e,s,o){return t.length===0?!1:t.every(r=>o(s[e(r)]))}function Nt(t,e,s,o,r){if(t.length===0)return null;const i=ls(t,e,r);for(let a=1;a<=t.length;a++){const l=t[(i+a)%t.length];if(!l)continue;const V=e(l);if(V!==r&&!o(s[V]))return V}return null}function rr(t){return!t.isStreaming&&t.allAnswered}function Vs(t){const{parts:e,partKey:s,schema:o,defaultValues:r,isStreaming:i,hasAnswer:a,onSubmit:l}=t,V=e[0]?s(e[0]):"",[d,u]=P.useState(V),[c,p]=P.useState(!1),f=js({resolver:ks(o),defaultValues:r}),m=f.watch(),h=ls(e,s,d),g=h>=0?e[h]:void 0,v=a(m[d]),x=Ct(e,s,m,a),b=rr({isStreaming:i,allAnswered:x}),A=()=>{if(h>0){const I=e[h-1];I&&u(s(I))}},j=()=>{if(h>=0&&h<e.length-1){const I=e[h+1];I&&u(s(I))}},k=()=>{const I=f.getValues(),N=Nt(e,s,I,a,d);N&&u(N)},y=()=>{f.handleSubmit(I=>{const N=I;for(const T of e)l(T,N[s(T)])})()},w=P.useRef(y);w.current=y;const C=()=>{b&&(p(!1),w.current())},S=()=>{const I=f.getValues();if(Ct(e,s,I,a)){if(i){p(!0);return}p(!1),w.current()}else{const N=Nt(e,s,I,a,d);N&&u(N)}};return P.useEffect(()=>{if(c&&!i){if(!x){p(!1);return}p(!1),w.current()}},[c,i,x]),{form:f,activeKey:d,setActiveKey:u,currentIndex:h,currentPart:g,isCurrentAnswered:v,isAllAnswered:x,canSubmit:b,goPrev:A,goNext:j,advanceToNextUnanswered:k,submit:C,submitOrAdvance:S}}const cs="chat.approval.defaultDenyReason";function ds(t){const e=R.c(36),{onYolo:s}=t,o=B(),[r,i]=Se();let a,l,V,d,u,c,p,f,m;if(e[0]!==s||e[1]!==r||e[2]!==i||e[3]!==o){const A=we.find(y=>y.value===r.toolApprovalLevel)??we[0];let j;e[13]!==s||e[14]!==r||e[15]!==i?(j=y=>{const w=y,C=r.toolApprovalLevel??"readonly";i({...r,toolApprovalLevel:w}),w==="auto"&&s(C)},e[13]=s,e[14]=r,e[15]=i,e[16]=j):j=e[16];const k=j;V=Un,f=r.toolApprovalLevel,m=k,l=Ln,u="xs",c="text-xs text-muted-foreground border-border/60 bg-transparent hover:bg-accent/60 h-7 gap-1",p=ir,a=Fn,d=o(A.shortKey),e[0]=s,e[1]=r,e[2]=i,e[3]=o,e[4]=a,e[5]=l,e[6]=V,e[7]=d,e[8]=u,e[9]=c,e[10]=p,e[11]=f,e[12]=m}else a=e[4],l=e[5],V=e[6],d=e[7],u=e[8],c=e[9],p=e[10],f=e[11],m=e[12];let h;e[17]!==a||e[18]!==d?(h=n.jsx(a,{children:d}),e[17]=a,e[18]=d,e[19]=h):h=e[19];let g;e[20]!==l||e[21]!==u||e[22]!==c||e[23]!==p||e[24]!==h?(g=n.jsx(l,{size:u,className:c,onClick:p,children:h}),e[20]=l,e[21]=u,e[22]=c,e[23]=p,e[24]=h,e[25]=g):g=e[25];let v;e[26]!==o?(v=we.map(A=>n.jsx(Pn,{value:A.value,children:o(A.labelKey)},A.value)),e[26]=o,e[27]=v):v=e[27];let x;e[28]!==v?(x=n.jsx(zn,{children:v}),e[28]=v,e[29]=x):x=e[29];let b;return e[30]!==V||e[31]!==x||e[32]!==f||e[33]!==m||e[34]!==g?(b=n.jsxs(V,{value:f,onValueChange:m,children:[g,x]}),e[30]=V,e[31]=x,e[32]=f,e[33]=m,e[34]=g,e[35]=b):b=e[35],b}function ir(t){return t.stopPropagation()}function us(t){const e=R.c(8),{input:s}=t,o=B();if(s==null){let a;e[0]!==o?(a=o("chat.approval.noInput"),e[0]=o,e[1]=a):a=e[1];let l;return e[2]!==a?(l=n.jsx("div",{className:"px-4 text-xs text-muted-foreground",children:a}),e[2]=a,e[3]=l):l=e[3],l}let r;try{let a;e[4]!==s?(a=JSON.stringify(s,null,2),e[4]=s,e[5]=a):a=e[5],r=a}catch{r=String(s)}let i;return e[6]!==r?(i=n.jsx("div",{className:"px-4",children:n.jsx("pre",{className:"text-xs font-mono text-muted-foreground/70 whitespace-pre-wrap wrap-break-word max-h-32 overflow-y-auto rounded-md bg-muted/30 px-3 py-2",children:r})}),e[6]=r,e[7]=i):i=e[7],i}function ar(t){const e=R.c(38),{approval:s,onRespond:o}=t,r=B(),[i]=Se(),a=i.toolApprovalLevel??"readonly";let l;e[0]!==s.approvalId||e[1]!==a||e[2]!==o||e[3]!==r?(l=()=>o(s.approvalId,!1,r(cs),a),e[0]=s.approvalId,e[1]=a,e[2]=o,e[3]=r,e[4]=l):l=e[4];const V=l;let d;e[5]!==s.approvalId||e[6]!==a||e[7]!==o?(d=()=>o(s.approvalId,!0,void 0,a),e[5]=s.approvalId,e[6]=a,e[7]=o,e[8]=d):d=e[8];const u=d;let c;e[9]!==s.approvalId||e[10]!==o?(c=C=>o(s.approvalId,!0,void 0,C),e[9]=s.approvalId,e[10]=o,e[11]=c):c=e[11];const p=c;let f;e[12]!==p?(f=n.jsx("div",{className:"flex items-center gap-2",children:n.jsx(ds,{onYolo:p})}),e[12]=p,e[13]=f):f=e[13];const m=f;let h;e[14]!==r?(h=r("chat.approval.denyButton"),e[14]=r,e[15]=h):h=e[15];let g;e[16]!==V||e[17]!==h?(g=n.jsx(Y,{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:h}),e[16]=V,e[17]=h,e[18]=g):g=e[18];let v;e[19]!==r?(v=r("chat.approval.acceptButton"),e[19]=r,e[20]=v):v=e[20];let x;e[21]!==u||e[22]!==v?(x=n.jsx(Y,{type:"button",size:"sm",className:"h-7 px-2.5 text-xs active:scale-[0.97] transition-transform",onClick:u,children:v}),e[21]=u,e[22]=v,e[23]=x):x=e[23];let b;e[24]!==g||e[25]!==x?(b=n.jsxs(n.Fragment,{children:[g,x]}),e[24]=g,e[25]=x,e[26]=b):b=e[26];const A=b;let j;e[27]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(We,{size:14}),e[27]=j):j=e[27];let k;e[28]!==r?(k=r("chat.approval.needsApproval"),e[28]=r,e[29]=k):k=e[29];let y;e[30]!==s.input?(y=n.jsx(us,{input:s.input}),e[30]=s.input,e[31]=y):y=e[31];let w;return e[32]!==s.friendlyName||e[33]!==m||e[34]!==A||e[35]!==k||e[36]!==y?(w=n.jsx(pe,{icon:j,label:k,title:s.friendlyName,defaultExpanded:!0,footerLeft:m,footerRight:A,children:y}),e[32]=s.friendlyName,e[33]=m,e[34]=A,e[35]=k,e[36]=y,e[37]=w):w=e[37],w}const lr=ws(ne(),re({approved:Ss().optional(),levelOverride:Le(["auto","readonly"]).optional()}));function Vr(t){const e=R.c(46),{approvals:s,isStreaming:o,onRespond:r}=t,i=B(),[a]=Se(),l=a.toolApprovalLevel??"readonly";let V;e[0]!==s?(V=Object.fromEntries(s.map(ur)),e[0]=s,e[1]=V):V=e[1];const d=V;let u;e[2]!==l||e[3]!==r||e[4]!==i?(u=(N,T)=>{const _=T;typeof _?.approved=="boolean"&&r(N.approvalId,_.approved,_.approved===!1?i(cs):void 0,_.levelOverride??l)},e[2]=l,e[3]=r,e[4]=i,e[5]=u):u=e[5];let c;e[6]!==s||e[7]!==d||e[8]!==o||e[9]!==u?(c={parts:s,partKey:dr,schema:lr,defaultValues:d,isStreaming:o,hasAnswer:cr,onSubmit:u},e[6]=s,e[7]=d,e[8]=o,e[9]=u,e[10]=c):c=e[10];const p=Vs(c);let f;e[11]!==s||e[12]!==p?(f=N=>{p.form.reset(Object.fromEntries(s.map(T=>[T.approvalId,{approved:!0,levelOverride:N}]))),p.submitOrAdvance()},e[11]=s,e[12]=p,e[13]=f):f=e[13];const m=f,h=p.currentPart,g=p.form;let v;e[14]!==p?(v=N=>{N.preventDefault(),p.submit()},e[14]=p,e[15]=v):v=e[15];let x;e[16]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(We,{size:14}),e[16]=x):x=e[16];let b;e[17]!==s.length||e[18]!==i?(b=i("chat.approval.batchedLabel",{count:s.length}),e[17]=s.length,e[18]=i,e[19]=b):b=e[19];const A=h?.friendlyName??"";let j;e[20]!==m?(j=n.jsx(ds,{onYolo:m}),e[20]=m,e[21]=j):j=e[21];let k;e[22]!==s.length||e[23]!==p.currentIndex||e[24]!==p.goNext||e[25]!==p.goPrev||e[26]!==j?(k=n.jsx(as,{currentIndex:p.currentIndex,total:s.length,onPrev:p.goPrev,onNext:p.goNext,extraLeft:j}),e[22]=s.length,e[23]=p.currentIndex,e[24]=p.goNext,e[25]=p.goPrev,e[26]=j,e[27]=k):k=e[27];let y;e[28]!==h||e[29]!==p.form.control||e[30]!==p.submitOrAdvance?(y=h?n.jsx(pr,{approvalId:h.approvalId,control:p.form.control,onChange:p.submitOrAdvance}):null,e[28]=h,e[29]=p.form.control,e[30]=p.submitOrAdvance,e[31]=y):y=e[31];let w;e[32]!==h?(w=h?n.jsx(us,{input:h.input}):null,e[32]=h,e[33]=w):w=e[33];let C;e[34]!==k||e[35]!==y||e[36]!==w||e[37]!==b||e[38]!==A?(C=n.jsx(pe,{icon:x,label:b,title:A,defaultExpanded:!0,footerLeft:k,footerRight:y,children:w}),e[34]=k,e[35]=y,e[36]=w,e[37]=b,e[38]=A,e[39]=C):C=e[39];let S;e[40]!==C||e[41]!==v?(S=n.jsx("form",{onSubmit:v,children:C}),e[40]=C,e[41]=v,e[42]=S):S=e[42];let I;return e[43]!==p.form||e[44]!==S?(I=n.jsx(nt,{...g,children:S}),e[43]=p.form,e[44]=S,e[45]=I):I=e[45],I}function cr(t){return typeof t?.approved=="boolean"}function dr(t){return t.approvalId}function ur(t){return[t.approvalId,{approved:void 0}]}function pr(t){const e=R.c(7),{approvalId:s,control:o,onChange:r}=t,i=B(),a=`${s}.approved`;let l;e[0]!==r||e[1]!==i?(l=d=>{const{field:u}=d,c=u.value===!0,p=u.value===!1;return n.jsxs(n.Fragment,{children:[n.jsx(Y,{type:"button",variant:p?"secondary":"ghost",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{u.onChange(!1),r()},"aria-pressed":p,children:i("chat.approval.denyButton")}),n.jsx(Y,{type:"button",variant:c?"default":"outline",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{u.onChange(!0),r()},"aria-pressed":c,children:i("chat.approval.acceptButton")})]})},e[0]=r,e[1]=i,e[2]=l):l=e[2];let V;return e[3]!==o||e[4]!==a||e[5]!==l?(V=n.jsx(Cs,{control:o,name:a,render:l}),e[3]=o,e[4]=a,e[5]=l,e[6]=V):V=e[6],V}function fr(){const t=R.c(5),e=B();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(We,{className:"size-5 text-muted-foreground shimmer"}),t[0]=s):s=t[0];let o;t[1]!==e?(o=e("chat.approval.preparingRequest"),t[1]=e,t[2]=o):o=t[2];let r;return t[3]!==o?(r=n.jsxs("div",{className:"flex items-center gap-2 p-4 border border-dashed rounded-lg bg-accent/50 w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",children:[s,n.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:o})]}),t[3]=o,t[4]=r):r=t[4],r}function hr(t){const e=R.c(8),{approvals:s,isStreaming:o,onRespond:r}=t;if(o&&s.length===0){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(fr,{}),e[0]=a):a=e[0],a}if(s.length===0)return null;if(s.length===1){const a=s[0];if(!a)return null;let l;return e[1]!==r||e[2]!==a?(l=n.jsx(ar,{approval:a,onRespond:r}),e[1]=r,e[2]=a,e[3]=l):l=e[3],l}let i;return e[4]!==s||e[5]!==o||e[6]!==r?(i=n.jsx(Vr,{approvals:s,isStreaming:o,onRespond:r}),e[4]=s,e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function mr(t){const e=R.c(28),{plan:s,onApprove:o,onDismiss:r}=t,i=B();let a;e[0]!==o||e[1]!==s.plan?(a=()=>{o(s.plan)},e[0]=o,e[1]=s.plan,e[2]=a):a=e[2];const l=a;let V;e[3]!==i?(V=i("chat.proposePlan.keepIterating"),e[3]=i,e[4]=V):V=e[4];let d;e[5]!==r||e[6]!==V?(d=n.jsx(Y,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2.5 text-xs text-muted-foreground [@media(hover:hover)]:hover:text-foreground active:scale-[0.97] transition-transform",onClick:r,children:V}),e[5]=r,e[6]=V,e[7]=d):d=e[7];let u;e[8]!==i?(u=i("chat.proposePlan.letsGo"),e[8]=i,e[9]=u):u=e[9];let c;e[10]!==l||e[11]!==u?(c=n.jsx(Y,{type:"button",size:"sm",className:"h-7 px-2.5 text-xs bg-special hover:bg-special/90 text-special-foreground active:scale-[0.97] transition-transform",onClick:l,children:u}),e[10]=l,e[11]=u,e[12]=c):c=e[12];let p;e[13]!==d||e[14]!==c?(p=n.jsxs(n.Fragment,{children:[d,c]}),e[13]=d,e[14]=c,e[15]=p):p=e[15];const f=p;let m;e[16]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Bt,{size:14}),e[16]=m):m=e[16];let h;e[17]!==i?(h=i("chat.proposePlan.planReady"),e[17]=i,e[18]=h):h=e[18];let g;e[19]!==i?(g=i("chat.proposePlan.implementationPlan"),e[19]=i,e[20]=g):g=e[20];let v;e[21]!==s.plan?(v=n.jsx("div",{className:"px-4 max-h-64 overflow-y-auto",children:n.jsx("div",{className:"prose prose-sm max-w-none text-sm",children:n.jsx($n,{id:"plan-preview",part:{type:"text",text:s.plan}})})}),e[21]=s.plan,e[22]=v):v=e[22];let x;return e[23]!==f||e[24]!==v||e[25]!==h||e[26]!==g?(x=n.jsx(pe,{icon:m,label:h,title:g,defaultExpanded:!0,footerRight:f,children:v}),e[23]=f,e[24]=v,e[25]=h,e[26]=g,e[27]=x):x=e[27],x}function gr(t){const e=R.c(6),{plans:s,onApprove:o,onDismiss:r}=t;let i;e[0]!==s?(i=os(s),e[0]=s,e[1]=i):i=e[1];const a=i;if(!a)return null;let l;return e[2]!==a||e[3]!==o||e[4]!==r?(l=n.jsx(mr,{plan:a,onApprove:o,onDismiss:r}),e[2]=a,e[3]=o,e[4]=r,e[5]=l):l=e[5],l}function ps(t){return t?"response"in t?t.response:t.option??t.draft:""}const It=re({response:ne().min(1,"Response is required")}),xr=re({option:ne().nullable(),draft:ne()}).refine(t=>(t.option??t.draft).length>0,{message:"Please select or enter an option"}),vr=re({response:Le(["yes","no"])});function br(t){switch(t.type){case"text":return It;case"choice":return xr;case"confirm":return vr;default:return It}}function Ar(t){const e={};for(const s of t)e[s.toolCallId]=br(s.input);return re(e)}function yr(t){const e=R.c(7),{control:s,name:o,placeholder:r}=t,i=B();let a;e[0]!==r||e[1]!==i?(a=V=>{const{field:d}=V,u=d.value??"";return n.jsxs(Vt,{children:[n.jsx(ct,{children:n.jsx("div",{className:"px-2",children:n.jsxs("div",{className:"flex items-center gap-3 px-2 py-3 rounded-lg bg-accent/50",children:[n.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:n.jsx(Kt,{size:16,className:"text-muted-foreground"})}),n.jsx("input",{...d,value:u,type:"text",placeholder:r||i("chat.userAskQuestion.typeResponse"),autoFocus:!0,"aria-label":i("chat.userAskQuestion.textResponseInputAriaLabel"),className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"})]})})}),n.jsx(dt,{})]})},e[0]=r,e[1]=i,e[2]=a):a=e[2];let l;return e[3]!==s||e[4]!==o||e[5]!==a?(l=n.jsx(Yt,{control:s,name:o,render:a}),e[3]=s,e[4]=o,e[5]=a,e[6]=l):l=e[6],l}function fs(t,e){const s=R.c(4);let o,r;s[0]!==t||s[1]!==e?(o=()=>{const i=a=>{const l=a.target.tagName;if(l==="INPUT"||l==="TEXTAREA"||a.metaKey||a.ctrlKey||a.altKey)return;const V=Number.parseInt(a.key,10);V>=1&&V<=t&&(a.preventDefault(),e(V-1))};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},r=[t,e],s[0]=t,s[1]=e,s[2]=o,s[3]=r):(o=s[2],r=s[3]),P.useEffect(o,r)}function jr(t){const e=R.c(51),{control:s,name:o,options:r}=t,i=B(),a=`${o}.option`;let l;e[0]!==s||e[1]!==a?(l={control:s,name:a,defaultValue:null},e[0]=s,e[1]=a,e[2]=l):l=e[2];const{field:V}=mt(l),d=`${o}.draft`;let u;e[3]!==s||e[4]!==d?(u={control:s,name:d,defaultValue:""},e[3]=s,e[4]=d,e[5]=u):u=e[5];const{field:c}=mt(u),p=V.value,f=c.value??"";let m;if(e[6]!==V||e[7]!==r?(m=U=>{const M=r[U];M!=null&&V.onChange(M)},e[6]=V,e[7]=r,e[8]=m):m=e[8],fs(r.length,m),r.length===0)return null;const h=p===null;let g;e[9]!==i?(g=i("chat.userAskQuestion.choiceOptionsAriaLabel"),e[9]=i,e[10]=g):g=e[10];let v;if(e[11]!==V||e[12]!==p||e[13]!==r||e[14]!==i){let U;e[16]!==V||e[17]!==p||e[18]!==i?(U=(M,L)=>{const z=p===M;return n.jsxs("button",{type:"button",onClick:()=>V.onChange(M),className:O("flex items-start gap-3 px-2 py-3 rounded-lg text-left transition-colors w-full",z&&"bg-accent/50",!z&&"hover:bg-accent/30"),"aria-label":i("chat.userAskQuestion.selectOption",{option:M}),children:[n.jsx("span",{className:O("flex items-center justify-center size-6 rounded-md text-sm shrink-0 mt-0.5",z?"bg-chart-1 text-white":"bg-muted text-foreground"),children:L+1}),n.jsx("span",{className:"text-sm text-foreground min-w-0 break-words",children:M})]},`${L}-${M}`)},e[16]=V,e[17]=p,e[18]=i,e[19]=U):U=e[19],v=r.map(U),e[11]=V,e[12]=p,e[13]=r,e[14]=i,e[15]=v}else v=e[15];const x=h&&"bg-accent/50",b=!h&&"hover:bg-accent/30";let A;e[20]!==x||e[21]!==b?(A=O("flex items-center gap-3 px-2 py-3 rounded-lg transition-colors w-full cursor-text",x,b),e[20]=x,e[21]=b,e[22]=A):A=e[22];let j;e[23]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:n.jsx(Kt,{size:16,className:"text-muted-foreground"})}),e[23]=j):j=e[23];const k=h?f:"";let y;e[24]!==c||e[25]!==V||e[26]!==p?(y=U=>{c.onChange(U.target.value),p!==null&&V.onChange(null)},e[24]=c,e[25]=V,e[26]=p,e[27]=y):y=e[27];let w;e[28]!==V||e[29]!==p?(w=()=>{p!==null&&V.onChange(null)},e[28]=V,e[29]=p,e[30]=w):w=e[30];let C;e[31]!==i?(C=i("chat.userAskQuestion.somethingElsePlaceholder"),e[31]=i,e[32]=C):C=e[32];let S;e[33]!==i?(S=i("chat.userAskQuestion.customChoiceInputAriaLabel"),e[33]=i,e[34]=S):S=e[34];let I;e[35]!==k||e[36]!==y||e[37]!==w||e[38]!==C||e[39]!==S?(I=n.jsx("input",{type:"text",value:k,onChange:y,onFocus:w,placeholder:C,"aria-label":S,className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"}),e[35]=k,e[36]=y,e[37]=w,e[38]=C,e[39]=S,e[40]=I):I=e[40];let N;e[41]!==A||e[42]!==I?(N=n.jsxs("label",{className:A,children:[j,I]}),e[41]=A,e[42]=I,e[43]=N):N=e[43];let T;e[44]!==N||e[45]!==g||e[46]!==v?(T=n.jsx(ct,{children:n.jsxs("div",{className:"flex flex-col px-2",role:"group","aria-label":g,children:[v,N]})}),e[44]=N,e[45]=g,e[46]=v,e[47]=T):T=e[47];let _;e[48]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(dt,{}),e[48]=_):_=e[48];let E;return e[49]!==T?(E=n.jsxs(Vt,{children:[T,_]}),e[49]=T,e[50]=E):E=e[50],E}function kr(t){const e=R.c(8),{control:s,name:o}=t,r=B();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=["yes","no"],e[0]=i):i=e[0];const a=i,l=P.useRef(null);let V;e[1]===Symbol.for("react.memo_cache_sentinel")?(V=c=>{l.current?.onChange(a[c]??"")},e[1]=V):V=e[1],fs(a.length,V);let d;e[2]!==r?(d=c=>{const{field:p}=c;return l.current=p,n.jsxs(Vt,{children:[n.jsx(ct,{children:n.jsx("div",{className:"flex gap-2 px-2",role:"group","aria-label":r("chat.userAskQuestion.confirmationOptionsAriaLabel"),children:a.map(f=>{const m=p.value===f;return n.jsxs("button",{type:"button",onClick:()=>p.onChange(f),className:O("flex items-center gap-3 px-4 py-3 rounded-lg text-left transition-colors flex-1",m&&"bg-accent/50",!m&&"hover:bg-accent/30"),"aria-label":r("chat.userAskQuestion.confirmValue",{value:r(`chat.userAskQuestion.confirm${f==="yes"?"Yes":"No"}`)}),children:[n.jsx("span",{className:O("flex items-center justify-center size-6 rounded-md text-sm shrink-0",m?"bg-chart-1 text-white":"bg-muted text-foreground"),children:f==="yes"?1:2}),n.jsx("span",{className:"text-sm text-foreground capitalize",children:r(`chat.userAskQuestion.confirm${f==="yes"?"Yes":"No"}`)})]},f)})})}),n.jsx(dt,{})]})},e[2]=r,e[3]=d):d=e[3];let u;return e[4]!==s||e[5]!==o||e[6]!==d?(u=n.jsx(Yt,{control:s,name:o,render:d}),e[4]=s,e[5]=o,e[6]=d,e[7]=u):u=e[7],u}function Tt(t){const e=R.c(13),{input:s,control:o,toolCallId:r}=t;switch(s.type){case"text":{const i=`${r}.response`;let a;return e[0]!==o||e[1]!==s.default||e[2]!==i?(a=n.jsx(yr,{control:o,name:i,placeholder:s.default}),e[0]=o,e[1]=s.default,e[2]=i,e[3]=a):a=e[3],a}case"choice":{let i;e[4]!==s.options?(i=s.options?.filter(Boolean)??[],e[4]=s.options,e[5]=i):i=e[5];const a=i;let l;return e[6]!==o||e[7]!==a||e[8]!==r?(l=n.jsx(jr,{control:o,name:r,options:a}),e[6]=o,e[7]=a,e[8]=r,e[9]=l):l=e[9],l}case"confirm":{const i=`${r}.response`;let a;return e[10]!==o||e[11]!==i?(a=n.jsx(kr,{control:o,name:i}),e[10]=o,e[11]=i,e[12]=a):a=e[12],a}default:return null}}function wr(t){const e=R.c(91),{parts:s,isStreaming:o,onSubmit:r}=t;let i;e[0]!==s?(i=Ar(s.map(Ir)),e[0]=s,e[1]=i):i=e[1];const a=i;let l;e[2]!==s?(l=Object.fromEntries(s.map(Nr)),e[2]=s,e[3]=l):l=e[3];const V=l;let d;e[4]!==r?(d=($,F)=>{const Q=ps(F);Q&&r($,Q)},e[4]=r,e[5]=d):d=e[5];let u;e[6]!==V||e[7]!==o||e[8]!==s||e[9]!==a||e[10]!==d?(u={parts:s,partKey:Cr,schema:a,defaultValues:V,isStreaming:o,hasAnswer:Sr,onSubmit:d},e[6]=V,e[7]=o,e[8]=s,e[9]=a,e[10]=d,e[11]=u):u=e[11];const c=Vs(u),p=c.currentPart,f=B();let m;e[12]!==p||e[13]!==c||e[14]!==f?(m=()=>{const $=p;if(!$)return;const F=f("chat.userAskQuestion.skipMessage"),Q=$.toolCallId;$.input?.type==="choice"?(c.form.setValue(`${Q}.option`,null),c.form.setValue(`${Q}.draft`,F)):c.form.setValue(`${Q}.response`,F),c.advanceToNextUnanswered()},e[12]=p,e[13]=c,e[14]=f,e[15]=m):m=e[15];const h=m;let g;e[16]!==c.currentIndex||e[17]!==c.goNext||e[18]!==c.goPrev||e[19]!==s.length?(g=n.jsx(as,{currentIndex:c.currentIndex,total:s.length,onPrev:c.goPrev,onNext:c.goNext}),e[16]=c.currentIndex,e[17]=c.goNext,e[18]=c.goPrev,e[19]=s.length,e[20]=g):g=e[20];const v=g;let x;e[21]!==f?(x=f("chat.userAskQuestion.skip"),e[21]=f,e[22]=x):x=e[22];let b;e[23]!==h||e[24]!==x?(b=n.jsx(Y,{type:"button",variant:"outline",size:"sm",onClick:h,className:"h-7",children:x}),e[23]=h,e[24]=x,e[25]=b):b=e[25];let A;e[26]!==c.isAllAnswered||e[27]!==c.isCurrentAnswered||e[28]!==c.submitOrAdvance||e[29]!==o?(A=n.jsx(or,{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]=A):A=e[30];let j;e[31]!==b||e[32]!==A?(j=n.jsxs(n.Fragment,{children:[b,A]}),e[31]=b,e[32]=A,e[33]=j):j=e[33];const k=j;if(s.length===1){const $=s[0];if(!$?.input)return null;const F=c.form;let Q;e[34]!==c?(Q=ae=>{ae.preventDefault(),c.submit()},e[34]=c,e[35]=Q):Q=e[35];let Z;e[36]===Symbol.for("react.memo_cache_sentinel")?(Z=n.jsx(st,{size:14}),e[36]=Z):Z=e[36];let se;e[37]!==f?(se=f("chat.userAskQuestion.questionPending"),e[37]=f,e[38]=se):se=e[38];let X;e[39]!==$.input?.prompt||e[40]!==f?(X=$.input?.prompt??f("chat.userAskQuestion.question"),e[39]=$.input?.prompt,e[40]=f,e[41]=X):X=e[41];const D=$.input;let K;e[42]!==c.form.control||e[43]!==$.toolCallId||e[44]!==D?(K=n.jsx(Tt,{input:D,control:c.form.control,toolCallId:$.toolCallId}),e[42]=c.form.control,e[43]=$.toolCallId,e[44]=D,e[45]=K):K=e[45];let H;e[46]!==k||e[47]!==se||e[48]!==X||e[49]!==K?(H=n.jsx(pe,{icon:Z,label:se,title:X,defaultExpanded:!0,footerRight:k,children:K}),e[46]=k,e[47]=se,e[48]=X,e[49]=K,e[50]=H):H=e[50];let ee;e[51]!==Q||e[52]!==H?(ee=n.jsx("form",{onSubmit:Q,autoComplete:"off",children:H}),e[51]=Q,e[52]=H,e[53]=ee):ee=e[53];let J;return e[54]!==c.form||e[55]!==ee?(J=n.jsx(nt,{...F,children:ee}),e[54]=c.form,e[55]=ee,e[56]=J):J=e[56],J}const y=c.form;let w;e[57]!==c?(w=$=>{$.preventDefault(),c.submit()},e[57]=c,e[58]=w):w=e[58];let C;e[59]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(st,{size:14}),e[59]=C):C=e[59];let S;e[60]!==f?(S=f("chat.userAskQuestion.questionPending"),e[60]=f,e[61]=S):S=e[61];const I=c.currentIndex+1;let N;e[62]!==s.length||e[63]!==f||e[64]!==I?(N=f("chat.userAskQuestion.questionCount",{current:I,total:s.length}),e[62]=s.length,e[63]=f,e[64]=I,e[65]=N):N=e[65];let T;e[66]!==p?.input?.prompt||e[67]!==f?(T=p?.input?.prompt??f("chat.userAskQuestion.question"),e[66]=p?.input?.prompt,e[67]=f,e[68]=T):T=e[68];const _=c.activeKey,E=c.setActiveKey;let U;if(e[69]!==c.form||e[70]!==s){let $;e[72]!==c.form?($=F=>n.jsx(Kn,{value:F.toolCallId,className:"mt-0",children:n.jsx(Tt,{input:F.input,control:c.form.control,toolCallId:F.toolCallId})},F.toolCallId),e[72]=c.form,e[73]=$):$=e[73],U=s.map($),e[69]=c.form,e[70]=s,e[71]=U}else U=e[71];let M;e[74]!==c.activeKey||e[75]!==c.setActiveKey||e[76]!==U?(M=n.jsx(qn,{value:_,onValueChange:E,children:U}),e[74]=c.activeKey,e[75]=c.setActiveKey,e[76]=U,e[77]=M):M=e[77];let L;e[78]!==v||e[79]!==k||e[80]!==S||e[81]!==N||e[82]!==T||e[83]!==M?(L=n.jsx(pe,{icon:C,label:S,count:N,title:T,defaultExpanded:!0,footerLeft:v,footerRight:k,children:M}),e[78]=v,e[79]=k,e[80]=S,e[81]=N,e[82]=T,e[83]=M,e[84]=L):L=e[84];let z;e[85]!==w||e[86]!==L?(z=n.jsx("form",{onSubmit:w,autoComplete:"off",children:L}),e[85]=w,e[86]=L,e[87]=z):z=e[87];let W;return e[88]!==c.form||e[89]!==z?(W=n.jsx(nt,{...y,children:z}),e[88]=c.form,e[89]=z,e[90]=W):W=e[90],W}function Sr(t){return!!ps(t)}function Cr(t){return t.toolCallId}function Nr(t){return t.input?.type==="choice"?[t.toolCallId,{option:null,draft:""}]:[t.toolCallId,{response:""}]}function Ir(t){return{toolCallId:t.toolCallId,input:t.input}}function Tr(){const t=R.c(5),e=B();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(st,{className:"size-5 text-muted-foreground shimmer"}),t[0]=s):s=t[0];let o;t[1]!==e?(o=e("chat.userAskQuestion.preparingQuestion"),t[1]=e,t[2]=o):o=t[2];let r;return t[3]!==o?(r=n.jsxs("div",{className:"flex items-center gap-2 p-4 border border-dashed rounded-lg bg-accent/50 w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",children:[s,n.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:o})]}),t[3]=o,t[4]=r):r=t[4],r}function hs(t){const e=R.c(7),{userAskParts:s,isStreaming:o,onSubmit:r}=t;let i;e[0]!==s?(i=s.filter(_r),e[0]=s,e[1]=i):i=e[1];const a=i;if(a.length===0){if(o){let V;return e[2]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsx(Tr,{}),e[2]=V):V=e[2],V}return null}let l;return e[3]!==o||e[4]!==r||e[5]!==a?(l=n.jsx(wr,{parts:a,isStreaming:o,onSubmit:r}),e[3]=o,e[4]=r,e[5]=a,e[6]=l):l=e[6],l}function _r(t){return t.state==="input-available"}function Mr(t){const e=R.c(33),{parts:s,isStreaming:o,onRespond:r}=t,i=B();let a;e[0]!==s?(a=s.at(-1),e[0]=s,e[1]=a):a=e[1];const l=a,V=l?.input;if(!l||!V?.title)return null;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(Bt,{size:14}),e[2]=d):d=e[2];let u;e[3]!==i?(u=i("chat.suggestTask.label"),e[3]=i,e[4]=u):u=e[4];const c=V.title;let p;e[5]!==r||e[6]!==l?(p=()=>r(l,!1),e[5]=r,e[6]=l,e[7]=p):p=e[7];let f;e[8]!==i?(f=i("chat.suggestTask.notNow"),e[8]=i,e[9]=f):f=e[9];let m;e[10]!==o||e[11]!==p||e[12]!==f?(m=n.jsx(Y,{type:"button",size:"sm",variant:"outline",className:"h-7",disabled:o,onClick:p,children:f}),e[10]=o,e[11]=p,e[12]=f,e[13]=m):m=e[13];let h;e[14]!==r||e[15]!==l?(h=()=>r(l,!0),e[14]=r,e[15]=l,e[16]=h):h=e[16];let g;e[17]!==i?(g=i("chat.suggestTask.create"),e[17]=i,e[18]=g):g=e[18];let v;e[19]!==o||e[20]!==h||e[21]!==g?(v=n.jsx(Y,{type:"button",size:"sm",className:"h-7",disabled:o,onClick:h,children:g}),e[19]=o,e[20]=h,e[21]=g,e[22]=v):v=e[22];let x;e[23]!==v||e[24]!==m?(x=n.jsxs(n.Fragment,{children:[m,v]}),e[23]=v,e[24]=m,e[25]=x):x=e[25];let b;e[26]!==V.summary?(b=V.summary?n.jsx("p",{className:"px-4 pb-1 text-sm leading-snug text-muted-foreground whitespace-pre-wrap",children:V.summary}):null,e[26]=V.summary,e[27]=b):b=e[27];let A;return e[28]!==V.title||e[29]!==x||e[30]!==b||e[31]!==u?(A=n.jsx(pe,{icon:d,label:u,title:c,defaultExpanded:!0,footerRight:x,children:b}),e[28]=V.title,e[29]=x,e[30]=b,e[31]=u,e[32]=A):A=e[32],A}function Dr(t){const e=t.filter(i=>i.status==="in_progress"),s=t.filter(i=>i.status==="completed").length,o=t.length;if(o>0&&s===o)return{icon:"completed",activity:"All done",progress:`${o}/${o}`};const[r]=e;return r&&e.length===1?{icon:"in_progress",activity:r.activeForm,progress:`${s}/${o} done`}:e.length>1?{icon:"in_progress",activity:`${e.length} in progress`,progress:`${s}/${o} done`}:s>0?{icon:"pending",activity:`${o-s} pending`,progress:`${s}/${o} done`}:{icon:"pending",activity:`${o} todos`,progress:"not started"}}function Rr(t){const e=R.c(13),{todos:s}=t;if(s.length===0)return null;let o;e[0]!==s?(o=Dr(s),e[0]=s,e[1]=o):o=e[1];const r=o;let i;e[2]!==r.icon?(i=n.jsx(Lr,{status:r.icon}),e[2]=r.icon,e[3]=i):i=e[3];const a=r.activity,l=r.progress;let V;e[4]!==s?(V=s.map(Er),e[4]=s,e[5]=V):V=e[5];let d;e[6]!==V?(d=n.jsx("ul",{"data-testid":"todos-list",className:"flex flex-col px-2 max-h-[40vh] overflow-y-auto",children:V}),e[6]=V,e[7]=d):d=e[7];let u;return e[8]!==r.activity||e[9]!==r.progress||e[10]!==i||e[11]!==d?(u=n.jsx(pe,{icon:i,label:a,count:l,defaultExpanded:!1,children:d}),e[8]=r.activity,e[9]=r.progress,e[10]=i,e[11]=d,e[12]=u):u=e[12],u}function Er(t,e){return n.jsx(Pr,{todo:t},e)}function Pr(t){const e=R.c(14),{todo:s}=t,o=s.status==="completed",i=s.status==="in_progress"?s.activeForm:s.content;let a;e[0]!==s.status?(a=n.jsx(Ur,{status:s.status}),e[0]=s.status,e[1]=a):a=e[1];const l=o&&"text-muted-foreground";let V;e[2]!==l?(V=O("relative text-sm leading-snug pt-px select-none",l),e[2]=l,e[3]=V):V=e[3];const d=o?"100%":"0%",u=o?"width 300ms ease 200ms":"width 150ms ease";let c;e[4]!==d||e[5]!==u?(c=n.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:"50%",height:"1px",background:"currentColor",width:d,transition:u}}),e[4]=d,e[5]=u,e[6]=c):c=e[6];let p;e[7]!==i||e[8]!==V||e[9]!==c?(p=n.jsxs("span",{className:V,children:[i,c]}),e[7]=i,e[8]=V,e[9]=c,e[10]=p):p=e[10];let f;return e[11]!==a||e[12]!==p?(f=n.jsxs("li",{className:"flex items-start gap-2.5 px-2 py-1.5 rounded-lg hover:bg-accent/50 transition-colors",children:[a,p]}),e[11]=a,e[12]=p,e[13]=f):f=e[13],f}function Ur(t){const e=R.c(4),{status:s}=t,o=s==="completed"?"true":void 0,r=s==="in_progress"?"true":void 0;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("svg",{viewBox:"0 0 21 21",children:n.jsx("path",{d:"M5,10.75 L8.5,14.25 L19.4,2.3 C18.8333333,1.43333333 18.0333333,1 17,1 L4,1 C2.35,1 1,2.35 1,4 L1,17 C1,18.65 2.35,20 4,20 L17,20 C18.65,20 20,18.65 20,17 L20,7.99769186"})}),e[0]=i):i=e[0];let a;return e[1]!==o||e[2]!==r?(a=n.jsx("div",{className:"todo-cb mt-0.5","data-checked":o,"data-progress":r,"aria-hidden":"true",children:i}),e[1]=o,e[2]=r,e[3]=a):a=e[3],a}function Lr(t){const e=R.c(13),{status:s}=t,o=B();if(s==="completed"){let a;e[0]!==o?(a=o("chat.todoStatus.completed"),e[0]=o,e[1]=a):a=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx("svg",{viewBox:"0 0 10 8",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",className:"w-2 h-2 text-primary-foreground",style:{strokeWidth:2},children:n.jsx("path",{d:"M1 4l2.5 2.5L9 1"})}),e[2]=l):l=e[2];let V;return e[3]!==a?(V=n.jsx("span",{"aria-label":a,className:"inline-flex items-center justify-center w-3.5 h-3.5 rounded-sm bg-primary",children:l}),e[3]=a,e[4]=V):V=e[4],V}if(s==="in_progress"){let a;e[5]!==o?(a=o("chat.todoStatus.inProgress"),e[5]=o,e[6]=a):a=e[6];let l;return e[7]!==a?(l=n.jsx("span",{"aria-label":a,className:"inline-block w-2 h-2 rounded-full bg-primary animate-pulse shrink-0"}),e[7]=a,e[8]=l):l=e[8],l}let r;e[9]!==o?(r=o("chat.todoStatus.pending"),e[9]=o,e[10]=r):r=e[10];let i;return e[11]!==r?(i=n.jsx("span",{"aria-label":r,className:"inline-block w-3.5 h-3.5 rounded-sm border-[1.5px] border-muted-foreground/50 shrink-0"}),e[11]=r,e[12]=i):i=e[12],i}const Fr={usd:[{dollars:10,labelKey:"credits.topUp.starter"},{dollars:20,labelKey:"credits.topUp.popular"},{dollars:100,labelKey:"credits.topUp.bestValue"}],brl:[{dollars:50,labelKey:"credits.topUp.starter"},{dollars:100,labelKey:"credits.topUp.popular"},{dollars:500,labelKey:"credits.topUp.bestValue"}]},zr={"credits.topUp.starter":"starter","credits.topUp.popular":"popular","credits.topUp.bestValue":"best_value"};function Or(t){const e=R.c(46),{source:s,onDone:o}=t,r=B(),i=Ns(),[a]=Se(),[l,V]=P.useState(a.language==="pt-BR"?"brl":"usd"),[d,u]=P.useState(""),[c,p]=P.useState(!1),f=l==="brl"?"R$":"$";let m;e[0]!==l||e[1]!==i?(m=async M=>{const{url:L}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:M,currency:l});return L},e[0]=l,e[1]=i,e[2]=m):m=e[2];let h;e[3]!==o?(h=M=>{M&&window.open(M,"_blank","noopener,noreferrer"),o?.()},e[3]=o,e[4]=h):h=e[4];let g;e[5]!==r?(g=M=>{Ee.error(r("credits.topUp.failed",{message:M.message}))},e[5]=r,e[6]=g):g=e[6];let v;e[7]!==m||e[8]!==h||e[9]!==g?(v={mutationFn:m,onSuccess:h,onError:g},e[7]=m,e[8]=h,e[9]=g,e[10]=v):v=e[10];const{mutate:x,isPending:b}=Is(v);let A;e[11]!==l||e[12]!==s||e[13]!==x?(A=(M,L)=>{te("credits_topup_clicked",{amount_cents:M,currency:l,tier_label:L,source:s}),x(M)},e[11]=l,e[12]=s,e[13]=x,e[14]=A):A=e[14];const j=A,k=parseFloat(d),y=!isNaN(k)&&k>=1;let w,C,S;e[15]===Symbol.for("react.memo_cache_sentinel")?(w=M=>{M&&V(M)},C=n.jsx(yt,{value:"usd",className:"h-8 px-3 text-xs",children:"USD"}),S=n.jsx(yt,{value:"brl",className:"h-8 px-3 text-xs",children:"BRL"}),e[15]=w,e[16]=C,e[17]=S):(w=e[15],C=e[16],S=e[17]);let I;e[18]!==l?(I=n.jsx("div",{className:"mb-4",children:n.jsxs(so,{type:"single",variant:"outline",size:"sm",value:l,onValueChange:w,children:[C,S]})}),e[18]=l,e[19]=I):I=e[19];const N=Fr[l];let T;if(e[20]!==j||e[21]!==f||e[22]!==b||e[23]!==r||e[24]!==N){let M;e[26]!==j||e[27]!==f||e[28]!==b||e[29]!==r?(M=L=>{const{dollars:z,labelKey:W}=L;return n.jsxs("button",{type:"button",disabled:b,onClick:()=>j(z*100,zr[W]??"preset"),className:O("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:[n.jsxs("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:[f,z]}),n.jsx("span",{className:"text-xs text-muted-foreground",children:r(W)})]},z)},e[26]=j,e[27]=f,e[28]=b,e[29]=r,e[30]=M):M=e[30],T=N.map(M),e[20]=j,e[21]=f,e[22]=b,e[23]=r,e[24]=N,e[25]=T}else T=e[25];let _;e[31]!==T?(_=n.jsx("div",{className:"grid grid-cols-3 gap-2.5",children:T}),e[31]=T,e[32]=_):_=e[32];let E;e[33]!==j||e[34]!==f||e[35]!==d||e[36]!==k||e[37]!==y||e[38]!==b||e[39]!==c||e[40]!==r?(E=c?n.jsxs("div",{className:"flex gap-2 mt-3",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:f}),n.jsx(to,{type:"number",min:"1",step:"1",placeholder:r("credits.topUp.customPlaceholder"),value:d,onChange:M=>u(M.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),n.jsx(Y,{className:"h-10",disabled:!y||b,onClick:()=>j(Math.round(k*100),"custom"),children:r(b?"credits.topUp.opening":"credits.topUp.add")})]}):n.jsx("button",{type:"button",className:"w-full mt-3 text-xs text-muted-foreground hover:text-foreground transition-colors py-1",onClick:()=>p(!0),children:r("credits.topUp.enterCustom")}),e[33]=j,e[34]=f,e[35]=d,e[36]=k,e[37]=y,e[38]=b,e[39]=c,e[40]=r,e[41]=E):E=e[41];let U;return e[42]!==_||e[43]!==E||e[44]!==I?(U=n.jsxs("div",{children:[I,_,E]}),e[42]=_,e[43]=E,e[44]=I,e[45]=U):U=e[45],U}const $r=["chat.creditsExhaustedBanner.benefit1","chat.creditsExhaustedBanner.benefit2","chat.creditsExhaustedBanner.benefit3"];function Br(t){const e=R.c(47),{onDismiss:s}=t,{org:o}=Ce(),r=rt(),{decoKeyId:i}=eo(),a=B(),l=ze("credits");let V,d;if(e[0]!==o.id?(V=()=>{te("credits_exhausted_shown",{organization_id:o.id})},d=[o.id],e[0]=o.id,e[1]=V,e[2]=d):(V=e[1],d=e[2]),P.useEffect(V,d),!l)return null;let u;e[3]!==s?(u=N=>!N&&s?.(),e[3]=s,e[4]=u):u=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=["radial-gradient(ellipse 40% 200% at -5% 100%, rgba(165,149,255,0.5) 0%, transparent 100%)","radial-gradient(ellipse 40% 200% at 105% -10%, rgba(208,236,26,0.45) 0%, transparent 100%)"],e[5]=c):c=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx("div",{className:"absolute inset-x-0 top-0 h-36 pointer-events-none",style:{backgroundImage:c.join(", "),maskImage:"linear-gradient(to bottom, black 0%, transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black 0%, transparent 100%)"}}),e[6]=p):p=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),e[7]=f):f=e[7];let m;e[8]!==a?(m=a("chat.creditsExhaustedBanner.title"),e[8]=a,e[9]=m):m=e[9];let h;e[10]!==m?(h=n.jsx(Qn,{className:"text-xl font-semibold tracking-tight",children:m}),e[10]=m,e[11]=h):h=e[11];let g;e[12]!==a?(g=a("chat.creditsExhaustedBanner.description"),e[12]=a,e[13]=g):g=e[13];let v;e[14]!==g?(v=n.jsx(Wn,{className:"mt-1.5 text-sm leading-relaxed",children:g}),e[14]=g,e[15]=v):v=e[15];let x;e[16]!==v||e[17]!==h?(x=n.jsxs("div",{className:"relative px-8 pt-8 pb-2 overflow-hidden",children:[p,n.jsxs(Yn,{className:"relative gap-4",children:[f,n.jsxs("div",{children:[h,v]})]})]}),e[16]=v,e[17]=h,e[18]=x):x=e[18];let b;e[19]!==i||e[20]!==s||e[21]!==a?(b=i&&n.jsxs("div",{className:"px-8 pt-5 pb-6",children:[n.jsx("div",{className:"rounded-xl border border-border p-5",children:n.jsx(Or,{source:"exhausted_banner",onDone:s})}),n.jsx("div",{className:"mt-5 rounded-xl bg-muted/25 border border-border/50 p-4 space-y-3",children:$r.map(N=>n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"flex items-center justify-center size-5 rounded-full bg-success/15 shrink-0",children:n.jsx(it,{size:12,className:"text-success"})}),n.jsx("span",{className:"text-sm text-foreground/80",children:a(N)})]},N))})]}),e[19]=i,e[20]=s,e[21]=a,e[22]=b):b=e[22];let A;e[23]!==a?(A=a("chat.creditsExhaustedBanner.dismiss"),e[23]=a,e[24]=A):A=e[24];let j;e[25]!==s||e[26]!==A?(j=n.jsx(Y,{variant:"ghost",size:"sm",onClick:s,children:A}),e[25]=s,e[26]=A,e[27]=j):j=e[27];let k;e[28]!==r||e[29]!==s||e[30]!==o.slug?(k=()=>{r({to:"/$org/settings/ai-providers",params:{org:o.slug}}),s?.()},e[28]=r,e[29]=s,e[30]=o.slug,e[31]=k):k=e[31];let y;e[32]!==a?(y=a("chat.creditsExhaustedBanner.manageProviders"),e[32]=a,e[33]=y):y=e[33];let w;e[34]!==k||e[35]!==y?(w=n.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:k,children:y}),e[34]=k,e[35]=y,e[36]=w):w=e[36];let C;e[37]!==j||e[38]!==w?(C=n.jsxs("div",{className:"px-8 py-4 border-t border-border bg-muted/30 flex items-center justify-between",children:[j,w]}),e[37]=j,e[38]=w,e[39]=C):C=e[39];let S;e[40]!==x||e[41]!==b||e[42]!==C?(S=n.jsxs(Gn,{className:"sm:max-w-[520px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:Kr,children:[x,b,C]}),e[40]=x,e[41]=b,e[42]=C,e[43]=S):S=e[43];let I;return e[44]!==S||e[45]!==u?(I=n.jsx(Hn,{open:!0,onOpenChange:u,children:S}),e[44]=S,e[45]=u,e[46]=I):I=e[46],I}function Kr(t){return t.preventDefault()}const qr={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 Qr(t){const e=R.c(16),{kind:s,onDismiss:o,onSubscribe:r}=t,i=B(),{label:a,title:l}=qr[s];let V;e[0]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsx(at,{size:14}),e[0]=V):V=e[0];let d;e[1]!==a||e[2]!==i?(d=i(a),e[1]=a,e[2]=i,e[3]=d):d=e[3];let u;e[4]!==i||e[5]!==l?(u=i(l),e[4]=i,e[5]=l,e[6]=u):u=e[6];let c;e[7]!==s||e[8]!==r||e[9]!==i?(c=s==="trial_exhausted"?n.jsx(Y,{size:"sm",onClick:r,className:"h-7 text-xs",children:i("chat.subscriptionLimit.subscribeButton")}):void 0,e[7]=s,e[8]=r,e[9]=i,e[10]=c):c=e[10];let p;return e[11]!==o||e[12]!==d||e[13]!==u||e[14]!==c?(p=n.jsx(pe,{icon:V,label:d,title:u,defaultExpanded:!0,variant:"warning",onClose:o,footerRight:c}),e[11]=o,e[12]=d,e[13]=u,e[14]=c,e[15]=p):p=e[15],p}const Wr={ai_budget_exhausted:{label:"chat.planRefused.budgetLabel",title:"chat.planRefused.budgetTitle"},feature_not_in_plan:{label:"chat.planRefused.featureLabel",title:"chat.planRefused.featureTitle"}};function _t(t){const e=R.c(21),{kind:s,onDismiss:o}=t,r=B(),i=rt(),{org:a}=Ce(),{label:l,title:V}=Wr[s];let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(at,{size:14}),e[0]=d):d=e[0];let u;e[1]!==l||e[2]!==r?(u=r(l),e[1]=l,e[2]=r,e[3]=u):u=e[3];let c;e[4]!==r||e[5]!==V?(c=r(V),e[4]=r,e[5]=V,e[6]=c):c=e[6];let p;e[7]!==i||e[8]!==o||e[9]!==a.slug?(p=()=>{i({to:"/$org/settings/ai-providers",params:{org:a.slug}}),o()},e[7]=i,e[8]=o,e[9]=a.slug,e[10]=p):p=e[10];let f;e[11]!==r?(f=r("chat.planRefused.seePlans"),e[11]=r,e[12]=f):f=e[12];let m;e[13]!==p||e[14]!==f?(m=n.jsx(Y,{size:"sm",className:"h-7 text-xs",onClick:p,children:f}),e[13]=p,e[14]=f,e[15]=m):m=e[15];let h;return e[16]!==o||e[17]!==u||e[18]!==c||e[19]!==m?(h=n.jsx(pe,{icon:d,label:u,title:c,defaultExpanded:!0,variant:"warning",onClose:o,footerRight:m}),e[16]=o,e[17]=u,e[18]=c,e[19]=m,e[20]=h):h=e[20],h}function ms(t){const e=Yr(t);if(e!==null){const d=ms(e);return{summary:d.summary,rawDetails:d.rawDetails??t}}const s=t.trim(),o=s.startsWith("<")&&/<[a-z][\s\S]*>/i.test(s),r=/cloudflare|cf-[a-z-]+|error[\s_-]?code[\s_-]?5\d\d/i.test(s),i=/failed to fetch|networkerror|load failed|offline/i.test(s),a=/timeout|timed out|aborted|deadline/i.test(s),l=s.length>240,V=/sandbox failed to start(?::\s*(.+))?/is.exec(s);if(V){const d=V[1]?.trim().replace(/\.$/,"");return{summary:d?`Your sandbox didn't finish starting up (${d}). Try again.`:"Your sandbox didn't finish starting up. Try again.",rawDetails:t}}return r||o&&l?{summary:"Our servers are having a moment. Try sending again in a few seconds.",rawDetails:t}:i?{summary:"Lost connection. Check your network and try again.",rawDetails:t}:a?{summary:"That took longer than expected. Try again.",rawDetails:t}:o||l?{summary:"Something unexpected came back from the server. Try again.",rawDetails:t}:{summary:t,rawDetails:null}}function Yr(t){const e=t.trim();if(!e.startsWith("{"))return null;let s;try{s=JSON.parse(e)}catch{return null}if(!s||typeof s!="object")return null;const{error:o,message:r}=s,i=typeof o=="string"?o:r;return typeof i=="string"&&i.trim()&&!i.trim().startsWith("{")?i:null}const Gr={length:"chat.highlight.warningDescriptionLength","content-filter":"chat.highlight.warningDescriptionContentFilter","tool-calls":"chat.highlight.warningDescriptionToolCalls"};function Qe(t){const e=R.c(29),s=B(),{variant:o,onDismiss:r}=t,i=o==="error";let a;e[0]!==i||e[1]!==s?(a=s(i?"chat.highlight.errorOccurred":"chat.highlight.responseIncomplete"),e[0]=i,e[1]=s,e[2]=a):a=e[2];const l=a,V=i?Rn:_s;let d;e[3]!==t.error||e[4]!==t.finishReason||e[5]!==t.variant||e[6]!==s?(d=t.variant==="error"?t.error.message:(()=>{const x=Gr[t.finishReason];return x?s(x):s("chat.highlight.responseStoppedUnexpectedly",{reason:t.finishReason})})(),e[3]=t.error,e[4]=t.finishReason,e[5]=t.variant,e[6]=s,e[7]=d):d=e[7];const u=d;let c;e[8]!==i||e[9]!==u?(c=i?ms(u):{summary:u,rawDetails:null},e[8]=i,e[9]=u,e[10]=c):c=e[10];const{summary:p,rawDetails:f}=c;let m;e[11]!==V?(m=n.jsx(V,{size:14}),e[11]=V,e[12]=m):m=e[12];let h;e[13]!==i||e[14]!==t.onContinue||e[15]!==t.onFixInChat||e[16]!==s?(h=i?n.jsx(Y,{size:"sm",variant:"outline",onClick:t.onFixInChat,className:"h-7 text-xs",children:s("chat.highlight.fixInChat")}):n.jsx(Y,{size:"sm",variant:"outline",onClick:t.onContinue,className:"h-7 text-xs",children:s("chat.highlight.continue")}),e[13]=i,e[14]=t.onContinue,e[15]=t.onFixInChat,e[16]=s,e[17]=h):h=e[17];let g;e[18]!==f||e[19]!==s?(g=f?n.jsxs("details",{className:"group mx-4",children:[n.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-1.5 text-xs text-muted-foreground transition-colors hover:text-foreground [&::-webkit-details-marker]:hidden",children:[n.jsx("svg",{"aria-hidden":"true",className:"size-3 transition-transform group-open:rotate-90",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"m4.5 3 3 3-3 3"})}),n.jsx("span",{className:"group-open:hidden",children:s("chat.highlight.showTechnicalDetails")}),n.jsx("span",{className:"hidden group-open:inline",children:s("chat.highlight.hideTechnicalDetails")})]}),n.jsxs("div",{className:"relative mt-2",children:[n.jsx("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(f).then(()=>Ee.success(s("chat.highlight.copiedToClipboard"))).catch(()=>Ee.error(s("chat.highlight.couldNotCopy")))},"aria-label":s("chat.highlight.copyErrorDetails"),title:s("chat.highlight.copy"),className:"absolute right-1.5 top-1.5 z-10 flex h-6 w-6 items-center justify-center rounded-lg bg-background/80 text-muted-foreground backdrop-blur-sm transition-colors hover:bg-background hover:text-foreground",children:n.jsx(En,{className:"size-3.5"})}),n.jsx("pre",{className:"max-h-40 overflow-auto rounded-md border border-border/60 bg-background px-3 py-2 pr-8 font-mono text-xs text-foreground/80 whitespace-pre-wrap break-all",children:f})]})]}):null,e[18]=f,e[19]=s,e[20]=g):g=e[20];let v;return e[21]!==l||e[22]!==r||e[23]!==p||e[24]!==m||e[25]!==h||e[26]!==g||e[27]!==o?(v=n.jsx(pe,{icon:m,label:l,title:p,defaultExpanded:!0,variant:o,onClose:r,footerRight:h,children:g}),e[21]=l,e[22]=r,e[23]=p,e[24]=m,e[25]=h,e[26]=g,e[27]=o,e[28]=v):v=e[28],v}function Oe(t){const e=R.c(77);let s;e[0]!==t?(s=t===void 0?{}:t,e[0]=t,e[1]=s):s=e[1];const{inline:o,voiceMode:r}=s,i=o===void 0?!1:o,a=r===void 0?!1:r,l=B(),{error:V,clearError:d,finishReason:u,clearFinishReason:c,messages:p,isStreaming:f,submit:m,sendMessage:h}=Fe(),[g,v]=Se(),{virtualMcpId:x,createTaskWithMessage:b}=Ye(),{chatMode:A,simpleModeTier:j}=Ge(),k=ze("credits"),{mutate:y}=ro("ORGANIZATION_BILLING_CHECKOUT_START","taskBoard.subscriptionPaywall.checkoutError");let w;e[2]!==y?(w=()=>y(),e[2]=y,e[3]=w):w=e[3];const C=w;let S;e[4]!==A||e[5]!==j||e[6]!==x||e[7]!==a?(S=oe=>({...a?{voiceMode:!0}:{},tier:j,mode:A,toolApprovalLevel:oe,agent:x?{id:x}:void 0}),e[4]=A,e[5]=j,e[6]=x,e[7]=a,e[8]=S):S=e[8];const I=S;let N;e[9]!==g.toolApprovalLevel?(N=g.toolApprovalLevel??Ts(),e[9]=g.toolApprovalLevel,e[10]=N):N=e[10];const T=N,_=p.at(-1),E=_?.role==="assistant"?_.parts:[],U=E.filter(ei),M=E.filter(Xr),L=rs(E),z=ns(E);let W;e[11]!==V||e[12]!==h||e[13]!==l?(W=()=>{if(V){const ue={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:l("chat.highlight.fixInChatMessage",{error:V.message})}]}]};h(ue)}},e[11]=V,e[12]=h,e[13]=l,e[14]=W):W=e[14];const $=W;let F;e[15]!==h||e[16]!==l?(F=()=>{const oe={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:l("chat.highlight.pleaseContinue")}]}]};h(oe)},e[15]=h,e[16]=l,e[17]=F):F=e[17];const Q=F;let Z;e[18]!==I||e[19]!==T||e[20]!==m?(Z=(oe,ue)=>{m({kind:"toolOutput",toolCallId:oe.toolCallId,output:{response:ue}},I(T))},e[18]=I,e[19]=T,e[20]=m,e[21]=Z):Z=e[21];const se=Z;let X;e[22]!==I||e[23]!==T||e[24]!==m?(X=(oe,ue)=>{m({kind:"toolOutput",toolCallId:oe.toolCallId,output:{accepted:ue}},I(T))},e[22]=I,e[23]=T,e[24]=m,e[25]=X):X=e[25];const D=X;let K;e[26]!==b||e[27]!==g||e[28]!==v||e[29]!==l||e[30]!==x?(K=oe=>{v({...g,toolApprovalLevel:"auto"}),b({virtualMcpId:x,message:{parts:[{type:"text",text:l("chat.highlight.implementPlanMessage",{plan:oe})}]}})},e[26]=b,e[27]=g,e[28]=v,e[29]=l,e[30]=x,e[31]=K):K=e[31];const H=K,ee=Zr;let J;e[32]!==I||e[33]!==m?(J=(oe,ue,Be,be)=>{m({kind:"approval",approvalId:oe,approved:ue,...Be?{reason:Be}:{}},I(be))},e[32]=I,e[33]=m,e[34]=J):J=e[34];const ae=J,G=is();if(G.isCreditExhausted){let oe;return e[35]!==k||e[36]!==d||e[37]!==i?(oe=k?n.jsx(Br,{onDismiss:d}):n.jsx("div",{className:O(!i&&"absolute bottom-full left-0 right-0"),children:n.jsx(_t,{kind:"ai_budget_exhausted",onDismiss:d})}),e[35]=k,e[36]=d,e[37]=i,e[38]=oe):oe=e[38],oe}const{showError:ce,showWarning:ie,hasApprovals:fe}=G,le=U.map(Jr).join("|"),$e=os(L)?.toolCallId??"",ft=z.map(Hr).join("|"),Ne=!i&&"absolute bottom-full left-0 right-0";let Ve;e[39]!==Ne?(Ve=O(Ne),e[39]=Ne,e[40]=Ve):Ve=e[40];let he;e[41]!==G.todos?(he=n.jsx(Rr,{todos:G.todos}),e[41]=G.todos,e[42]=he):he=e[42];let ge;e[43]!==d||e[44]!==G.subscriptionErrorKind||e[45]!==C?(ge=G.subscriptionErrorKind&&n.jsx(Qr,{kind:G.subscriptionErrorKind,onDismiss:d,onSubscribe:C}),e[43]=d,e[44]=G.subscriptionErrorKind,e[45]=C,e[46]=ge):ge=e[46];let de;e[47]!==d||e[48]!==G.planRefusal?(de=G.planRefusal&&n.jsx(_t,{kind:G.planRefusal,onDismiss:d}),e[47]=d,e[48]=G.planRefusal,e[49]=de):de=e[49];let xe;e[50]!==d||e[51]!==V||e[52]!==$||e[53]!==ce?(xe=ce&&n.jsx(Qe,{variant:"error",error:V,onDismiss:d,onFixInChat:$}),e[50]=d,e[51]=V,e[52]=$,e[53]=ce,e[54]=xe):xe=e[54];let je;e[55]!==c||e[56]!==u||e[57]!==Q||e[58]!==ie?(je=ie&&n.jsx(Qe,{variant:"warning",finishReason:u,onDismiss:c,onContinue:Q}),e[55]=c,e[56]=u,e[57]=Q,e[58]=ie,e[59]=je):je=e[59];const Ie=fe&&n.jsx(hr,{approvals:z,isStreaming:f,onRespond:ae},ft),_e=G.hasPlans&&n.jsx(gr,{plans:L,isStreaming:f,onApprove:H,onDismiss:ee},$e),Me=G.hasTaskSuggestion&&n.jsx(Mr,{parts:M,isStreaming:f,onRespond:D},M.at(-1)?.toolCallId??"");let ve;e[60]!==G.isWaitingForUserInput||e[61]!==se||e[62]!==f||e[63]!==le||e[64]!==U?(ve=G.isWaitingForUserInput&&n.jsx(hs,{userAskParts:U,isStreaming:f,onSubmit:se},le),e[60]=G.isWaitingForUserInput,e[61]=se,e[62]=f,e[63]=le,e[64]=U,e[65]=ve):ve=e[65];let ke;return e[66]!==Ve||e[67]!==he||e[68]!==ge||e[69]!==de||e[70]!==xe||e[71]!==je||e[72]!==Ie||e[73]!==_e||e[74]!==Me||e[75]!==ve?(ke=n.jsxs("div",{className:Ve,children:[he,ge,de,xe,je,Ie,_e,Me,ve]}),e[66]=Ve,e[67]=he,e[68]=ge,e[69]=de,e[70]=xe,e[71]=je,e[72]=Ie,e[73]=_e,e[74]=Me,e[75]=ve,e[76]=ke):ke=e[76],ke}function Hr(t){return t.approvalId}function Jr(t){return t.toolCallId}function Zr(){document.querySelector("[data-chat-input]")?.focus()}function Xr(t){return t.type==="tool-suggest_task"&&t.state==="input-available"}function ei(t){return t.type==="tool-user_ask"}Oe.Error=function(e){return n.jsx(Qe,{variant:"error",error:e.error,onDismiss:e.onDismiss,onFixInChat:e.onFixInChat})};Oe.Warning=function(e){return n.jsx(Qe,{variant:"warning",finishReason:e.finishReason,onDismiss:e.onDismiss,onContinue:e.onContinue})};Oe.UserAskQuestion=hs;function gs(t){const e=R.c(20),{taskId:s}=t,o=B(),r=xn(s),i=vn(r),a=bn(),{stop:l,removeLocalMessage:V}=Fe();if(i.length===0)return null;let d;e[0]!==o?(d=o("chat.queueTray.sendNow"),e[0]=o,e[1]=d):d=e[1];let u;e[2]!==l?(u=()=>{l()},e[2]=l,e[3]=u):u=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(Ot,{size:14}),e[4]=c):c=e[4];let p;e[5]!==d||e[6]!==u?(p=n.jsx(He,{asChild:!0,children:n.jsx(Y,{type:"button",variant:"ghost",size:"icon-sm","aria-label":d,onClick:u,children:c})}),e[5]=d,e[6]=u,e[7]=p):p=e[7];let f;e[8]!==o?(f=o("chat.queueTray.sendNow"),e[8]=o,e[9]=f):f=e[9];let m;e[10]!==f?(m=n.jsx(Je,{side:"top",children:n.jsx("p",{className:"text-xs",children:f})}),e[10]=f,e[11]=m):m=e[11];let h;e[12]!==p||e[13]!==m?(h=n.jsxs(Ze,{delayDuration:400,children:[p,m]}),e[12]=p,e[13]=m,e[14]=h):h=e[14];let g;return e[15]!==a||e[16]!==V||e[17]!==o||e[18]!==s?(g=(v,x)=>n.jsxs("div",{className:"group/queuerow flex items-center gap-2 px-3 py-1.5",children:[n.jsx("span",{className:"flex size-[18px] shrink-0 items-center justify-center rounded-full bg-muted text-[10px] font-semibold text-muted-foreground dark:bg-background",children:x+1}),n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:v.text}),n.jsx("div",{className:"flex shrink-0 items-center gap-1 opacity-0 transition-opacity focus-within:opacity-100 group-hover/queuerow:opacity-100",children:n.jsx(Y,{type:"button",variant:"ghost",size:"icon-sm",title:o("chat.queueTray.removeFromQueue"),"aria-label":o("chat.queueTray.removeFromQueue"),onClick:()=>{a.cancel(s,v.messageId).then(b=>{b&&(An(s,v.messageId),V(v.messageId))})},children:n.jsx(io,{className:"size-3.5"})})})]},v.messageId),e[15]=a,e[16]=V,e[17]=o,e[18]=s,e[19]=g):g=e[19],n.jsxs("div",{className:"mb-1 overflow-hidden rounded-2xl border border-border bg-card dark:bg-muted",children:[n.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-border py-1.5 pr-2 pl-3 text-xs text-muted-foreground",children:[n.jsx("span",{children:o(i.length===1?"chat.queueTray.queuedMessage":"chat.queueTray.queuedMessages",{count:i.length})}),h]}),i.map(g)]})}function ti(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 si={fast:"chat.tierTrigger.tierFast",smart:"chat.tierTrigger.tierSmart",thinking:"chat.tierTrigger.tierThinking"};function ni(t){const e=R.c(31),{tier:s,orgSlot:o,userSlot:r,autoSlot:i,onPick:a,onReset:l,onClose:V}=t,d=B(),u=es(),c=new Set(u.map(oi)),p=yn([r,o,i],c),f=p?.keyId??null,[m,h]=P.useState(f??u[0]?.id??null),g=u.some(L=>L.id===m)?m:f??u[0]?.id??null,v=g?u.find(L=>L.id===g):null,x="flex h-[70vh] max-h-[460px] w-full flex-col",b=si[s];let A;e[0]!==d||e[1]!==b?(A=d(b),e[0]=d,e[1]=b,e[2]=A):A=e[2];let j;e[3]!==A?(j=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:A}),e[3]=A,e[4]=j):j=e[4];let k;e[5]!==l||e[6]!==d||e[7]!==r?(k=r&&n.jsx("button",{type:"button",onClick:l,className:"text-xs text-muted-foreground hover:text-foreground px-2 py-1 rounded-lg hover:bg-accent cursor-pointer",children:d("chat.modelPreferences.reset")}),e[5]=l,e[6]=d,e[7]=r,e[8]=k):k=e[8];let y;e[9]!==j||e[10]!==k?(y=n.jsxs("div",{className:"flex items-center justify-between px-3 h-8 shrink-0",children:[j,k]}),e[9]=j,e[10]=k,e[11]=y):y=e[11];const w="flex-1 min-h-0",C=P.Suspense;let S;e[12]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(ao,{}),e[12]=S):S=e[12];const I=vo,N=!0,T=ti(f?p:null,v?.providerId??"deco");let _;e[13]!==g||e[14]!==a||e[15]!==h?(_=L=>{const z=L.keyId??g??"";h(z),a({keyId:z,modelId:L.modelId,title:L.title})},e[13]=g,e[14]=a,e[15]=h,e[16]=_):_=e[16];let E;e[17]!==I||e[18]!==g||e[19]!==V||e[20]!==h||e[21]!==T||e[22]!==_?(E=n.jsx(I,{compact:N,onClose:V,credentialId:g,onCredentialChange:h,selectedModel:T,onModelChange:_}),e[17]=I,e[18]=g,e[19]=V,e[20]=h,e[21]=T,e[22]=_,e[23]=E):E=e[23];let U;e[24]!==C||e[25]!==E||e[26]!==S?(U=n.jsx("div",{className:w,children:n.jsx(C,{fallback:S,children:E})}),e[24]=C,e[25]=E,e[26]=S,e[27]=U):U=e[27];let M;return e[28]!==U||e[29]!==y?(M=n.jsxs("div",{className:x,children:[y,U]}),e[28]=U,e[29]=y,e[30]=M):M=e[30],M}function oi(t){return t.id}const ri=["fast","smart","thinking"];function xs(t){return{fast:t("chat.tierTrigger.tierFast"),smart:t("chat.tierTrigger.tierSmart"),thinking:t("chat.tierTrigger.tierThinking")}}const Mt={fast:"chat.agentModels.quickerResponses",smart:"chat.agentModels.balancedQuality",thinking:"chat.agentModels.deeperReasoning"};function ii(t){const e=R.c(28),{tier:s,pillIcon:o,groups:r}=t,i=B();let a;e[0]!==i?(a=xs(i),e[0]=i,e[1]=a):a=e[1];const l=a,[V,d]=P.useState(!1);let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=w=>{w.onSelect(),d(!1)},e[2]=u):u=e[2];const c=u,p=l[s];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=O("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),e[3]=f):f=e[3];let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=O("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]=m):m=e[4];const h=l[s];let g;e[5]!==h?(g=n.jsx("span",{className:m,children:h}),e[5]=h,e[6]=g):g=e[6];let v;e[7]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(Gt,{size:12,className:"opacity-60 hidden @[320px]/chat-bottom:inline-block"}),e[7]=v):v=e[7];let x;e[8]!==o||e[9]!==p||e[10]!==g?(x=n.jsx(He,{asChild:!0,children:n.jsx("span",{className:"inline-flex min-w-0 shrink",children:n.jsx(Ht,{asChild:!0,children:n.jsxs(Y,{type:"button",variant:"ghost",size:"default","aria-label":p,className:f,children:[o,g,v]})})})}),e[8]=o,e[9]=p,e[10]=g,e[11]=x):x=e[11];let b;e[12]!==p?(b=n.jsx(Je,{children:p}),e[12]=p,e[13]=b):b=e[13];let A;e[14]!==x||e[15]!==b?(A=n.jsxs(Ze,{children:[x,b]}),e[14]=x,e[15]=b,e[16]=A):A=e[16];let j;if(e[17]!==r||e[18]!==i){let w;e[20]!==i?(w=C=>n.jsx("div",{className:"flex flex-col",children:C.rows.map(S=>n.jsxs("div",{className:"group/tier-row relative flex items-stretch rounded-lg hover:bg-muted",children:[n.jsxs("button",{type:"button",role:"menuitem","aria-label":S.title,onClick:()=>c(S),className:O("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&&n.jsx("span",{className:"shrink-0 text-muted-foreground mt-0.5",children:S.icon}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"text-sm",children:S.title}),S.subtitle&&n.jsx("div",{className:"text-xs text-muted-foreground",children:S.subtitle})]}),S.active&&n.jsx("span",{title:i("chat.tierTrigger.selected"),children:n.jsx(it,{size:14,className:"text-foreground mt-0.5"})})]}),S.modelOverride&&n.jsx(li,{label:S.title,render:S.modelOverride})]},S.key))},C.key),e[20]=i,e[21]=w):w=e[21],j=r.map(w),e[17]=r,e[18]=i,e[19]=j}else j=e[19];let k;e[22]!==j?(k=n.jsx(Jt,{align:"end",className:"p-1 w-64",onOpenAutoFocus:ai,children:n.jsx("div",{role:"menu",className:"flex flex-col",children:j})}),e[22]=j,e[23]=k):k=e[23];let y;return e[24]!==V||e[25]!==A||e[26]!==k?(y=n.jsxs(Zt,{open:V,onOpenChange:d,children:[A,k]}),e[24]=V,e[25]=A,e[26]=k,e[27]=y):y=e[27],y}function ai(t){return t.preventDefault()}function li(t){const e=R.c(38),{label:s,render:o}=t,r=B(),i=Xt(),[a,l]=P.useState(!1);let V;e[0]===Symbol.for("react.memo_cache_sentinel")?(V=()=>l(!1),e[0]=V):V=e[0];const d=V;let u;e[1]!==s||e[2]!==r?(u=r("chat.modelPreferences.customizeModel",{tier:s}),e[1]=s,e[2]=r,e[3]=u):u=e[3];const c=a&&"opacity-100";let p;e[4]!==c?(p=O("absolute right-1 top-1/2 -translate-y-1/2 flex items-center justify-center","size-6 rounded-lg 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]=p):p=e[5];let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(un,{size:14}),e[6]=f):f=e[6];let m;e[7]!==u||e[8]!==p?(m=n.jsx("button",{type:"button","aria-label":u,className:p,children:f}),e[7]=u,e[8]=p,e[9]=m):m=e[9];const h=m;if(i){let A;e[10]!==h?(A=n.jsx(co,{asChild:!0,children:h}),e[10]=h,e[11]=A):A=e[11];let j;e[12]!==s||e[13]!==r?(j=r("chat.modelPreferences.customizeModel",{tier:s}),e[12]=s,e[13]=r,e[14]=j):j=e[14];let k;e[15]!==j?(k=n.jsx(uo,{className:"sr-only",children:j}),e[15]=j,e[16]=k):k=e[16];let y;e[17]!==a||e[18]!==o?(y=a&&o(d),e[17]=a,e[18]=o,e[19]=y):y=e[19];let w;e[20]!==y||e[21]!==k?(w=n.jsxs(po,{className:"p-0 flex flex-col max-h-[95vh]",children:[k,y]}),e[20]=y,e[21]=k,e[22]=w):w=e[22];let C;return e[23]!==a||e[24]!==w||e[25]!==A?(C=n.jsxs(fo,{open:a,onOpenChange:l,children:[A,w]}),e[23]=a,e[24]=w,e[25]=A,e[26]=C):C=e[26],C}let g;e[27]!==h?(g=n.jsx(Ht,{asChild:!0,children:h}),e[27]=h,e[28]=g):g=e[28];let v;e[29]!==a||e[30]!==o?(v=a&&o(d),e[29]=a,e[30]=o,e[31]=v):v=e[31];let x;e[32]!==v?(x=n.jsx(Jt,{side:"right",align:"start",collisionPadding:12,className:"w-[min(22rem,calc(100vw-2rem))] p-0 overflow-hidden",children:v}),e[32]=v,e[33]=x):x=e[33];let b;return e[34]!==a||e[35]!==g||e[36]!==x?(b=n.jsxs(Zt,{open:a,onOpenChange:l,children:[g,x]}),e[34]=a,e[35]=g,e[36]=x,e[37]=b):b=e[37],b}function Dt(t){return t==="fast"?n.jsx(at,{size:16}):t==="thinking"?n.jsx(dn,{size:16}):n.jsx(ho,{size:16})}function Vi(t){const e=R.c(13),s=wn();let o;e[0]!==t||e[1]!==s.tiers?(o=d=>{const u=s.tiers[d];return u?u.title??u.modelId:t.chat[d]?.title},e[0]=t,e[1]=s.tiers,e[2]=o):o=e[2];const r=o;let i;e[3]!==r?(i=r("fast"),e[3]=r,e[4]=i):i=e[4];let a;e[5]!==r?(a=r("smart"),e[5]=r,e[6]=a):a=e[6];let l;e[7]!==r?(l=r("thinking"),e[7]=r,e[8]=l):l=e[8];let V;return e[9]!==i||e[10]!==a||e[11]!==l?(V={fast:i,smart:a,thinking:l},e[9]=i,e[10]=a,e[11]=l,e[12]=V):V=e[12],V}function ci(){const t=R.c(23),e=B(),{simpleModeTier:s,setSimpleModeTier:o}=Ge(),r=mo(),i=es(),a=xo(i),l=Vi(a),{data:V,error:d}=jn();let u;t[0]!==V?(u=V===void 0?{tiers:{}}:V,t[0]=V,t[1]=u):u=t[1];const c=u,p=kn(),f=ze("model_choice"),m=Jn(),h=Zn();if(!m||!f)return null;let g,v;if(t[2]!==a||t[3]!==h||t[4]!==r||t[5]!==o||t[6]!==e||t[7]!==s||t[8]!==l||t[9]!==p||t[10]!==c||t[11]!==d){const k=xs(e);g="decopilot",v=ri.map(y=>{const w=l[y],C=c.tiers[y];return{key:`decopilot-${y}`,icon:Dt(y),title:k[y],subtitle:h?w??e(Mt[y]):e(Mt[y]),active:s===y,onSelect:()=>o(y),modelOverride:h?S=>n.jsxs(n.Fragment,{children:[d&&n.jsx("div",{className:"text-xs text-destructive p-3 pb-0",children:e("chat.modelPreferences.loadFailed")}),n.jsx(ni,{tier:y,orgSlot:r.tiers[y],userSlot:C,autoSlot:a.chat[y],onClose:S,onPick:I=>p.mutate({tier:y,slot:I}),onReset:()=>p.mutate({tier:y,slot:null})},`${y}:${C?.keyId??"org"}:${C?.modelId??""}`)]}):void 0}}),t[2]=a,t[3]=h,t[4]=r,t[5]=o,t[6]=e,t[7]=s,t[8]=l,t[9]=p,t[10]=c,t[11]=d,t[12]=g,t[13]=v}else g=t[12],v=t[13];let x;t[14]!==g||t[15]!==v?(x=[{key:g,rows:v}],t[14]=g,t[15]=v,t[16]=x):x=t[16];const b=x;let A;t[17]!==s?(A=Dt(s),t[17]=s,t[18]=A):A=t[18];let j;return t[19]!==b||t[20]!==A||t[21]!==s?(j=n.jsx(ii,{tier:s,pillIcon:A,groups:b}),t[19]=b,t[20]=A,t[21]=s,t[22]=j):j=t[22],j}function vs(t){const e=R.c(3),[s]=Se();let o;return e[0]!==s.enableSounds||e[1]!==t?(o=()=>{s.enableSounds&&To(t.dataUri).catch(i=>{console.warn(`[sound] ${t.name} playback failed:`,i)})},e[0]=s.enableSounds,e[1]=t,e[2]=o):o=e[2],o}const di={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"},ui=Xs.togglePlanMode.keys.map(t=>t==="Shift"?"⇧":t).join(""),pi=[{src:"/connections/gmail.png",name:"Gmail"},{src:"/connections/perplexity.png",name:"Perplexity"},{src:"/connections/github.png",name:"GitHub"}];function fi(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex items-center -space-x-1.5",children:pi.map(hi)}),t[0]=e):e=t[0],e}function hi(t){return n.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-1 ring-border object-cover bg-white"},t.name)}function mi({disabled:t,onOpenConnections:e,virtualMcpId:s,selectedModel:o,isStreaming:r,onUnsupportedFile:i}){const a=B(),[l,V]=P.useState(!1),d=vs(di),{org:u}=Ce(),{editor:c}=Ft(),p=P.useRef(null),f=ut(o),m=()=>{!f||r||(V(!1),p.current?.click())},h=async D=>{const K=D.target.files;if(!K||K.length===0||!c)return;const H=Array.from(K);try{let ee=c.state.selection.from;for(const J of H)await ts(c,o??null,J,ee,i,a),ee=c.state.selection.to}finally{p.current&&(p.current.value="")}},g=So({connectionId:s,orgId:u.id,orgSlug:u.slug}),v=Ms.virtualMcpPrompts(s,u.id),{data:x,isLoading:b}=Ds({queryKey:v,queryFn:()=>Co(g),staleTime:6e4,enabled:l&&!!g}),A=x?.prompts??[],[j,k]=P.useState(null),{chatMode:y,setChatMode:w}=Ge(),[C,S]=Se(),I=we.find(D=>D.value===C.toolApprovalLevel)??we[0],N=a(I.shortKey),T=D=>{const K=we.find(H=>H.value===D);if(K){if(K.value===C.toolApprovalLevel){V(!1);return}d(),te("chat_approval_level_changed",{from_level:C.toolApprovalLevel,to_level:K.value,source:"tools_popover"}),S({...C,toolApprovalLevel:K.value}),V(!1)}},_=y==="plan",E=()=>{d();const D=_?"default":"plan";te("chat_mode_changed",{from_mode:y,to_mode:D,source:"tools_popover"}),w(D),V(!1)},U=()=>{e(),V(!1)},M=async(D,K)=>{if(!c||!g)return;const H=jt(D._meta),ee={from:c.state.selection.from,to:c.state.selection.to};try{const J=await No(g,D.name,K);Zs(c,ee,{id:D.name,name:wo(D.name,H),metadata:J.messages,char:"/",kind:"prompt",args:K})}catch{Ee.error(a("chat.toolsPopover.failedLoadPrompt"))}},L=async D=>{V(!1);const K=!!(D.arguments&&D.arguments.length>0);if(te("chat_prompt_inserted",{prompt_name:D.name,with_arguments:K}),K){k(D);return}await M(D)},z=async D=>{j&&(await M(j,D),k(null))},W=()=>{d();const D=y==="gen-image"?"default":"gen-image";te("chat_mode_changed",{from_mode:y,to_mode:D,source:"tools_popover"}),w(D),V(!1)},$=()=>{d();const D=y==="web-search"?"default":"web-search";te("chat_mode_changed",{from_mode:y,to_mode:D,source:"tools_popover"}),w(D),V(!1)},F=()=>{d();const D=y==="deep-research"?"default":"deep-research";te("chat_mode_changed",{from_mode:y,to_mode:D,source:"tools_popover"}),w(D),V(!1)},Q=y==="gen-image",Z=y==="web-search",se=y==="deep-research",X=n.jsx("input",{ref:p,type:"file",multiple:!0,accept:lo(o??null),className:"hidden",onChange:h,disabled:r});return n.jsxs(n.Fragment,{children:[X,n.jsxs(Rs,{open:l,onOpenChange:D=>{D&&!l&&te("chat_tools_popover_opened",{chat_mode:y}),V(D)},children:[n.jsx(Es,{asChild:!0,children:n.jsxs(Y,{type:"button",variant:"ghost",size:"default",disabled:t,title:a("chat.toolsPopover.tools"),"aria-label":a("chat.toolsPopover.tools"),className:O("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),children:[n.jsx(pn,{size:14}),n.jsx("span",{className:O("min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0","@[320px]/chat-bottom:max-w-24 @[320px]/chat-bottom:opacity-100"),children:a("chat.toolsPopover.tools")})]})}),n.jsxs(Ps,{align:"start",className:"w-56 p-1.5 space-y-1",children:[f?n.jsxs(Ae,{onClick:m,disabled:r,children:[n.jsx(kt,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.addFile")})]}):n.jsxs(Ze,{children:[n.jsx(He,{asChild:!0,children:n.jsxs(Ae,{"aria-disabled":"true",className:"opacity-50 cursor-not-allowed",onSelect:D=>D.preventDefault(),children:[n.jsx(kt,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.addFile")})]})}),n.jsx(Je,{side:"right",children:a("chat.toolsPopover.modelNoFileSupport")})]}),n.jsxs(Ae,{onClick:E,className:O(_&&"text-special"),children:[n.jsx($t,{size:16,className:O(_&&"text-special")}),n.jsx("span",{className:"flex-1 whitespace-nowrap",children:a("chat.toolsPopover.planMode")}),n.jsx("span",{className:O("text-xs text-muted-foreground",_&&"text-special font-medium"),children:ui})]}),n.jsxs(Ae,{onClick:W,className:O(Q&&"text-special"),children:[n.jsx(Wt,{size:16,className:O(Q&&"text-special")}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.createImage")}),Q&&n.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),n.jsxs(Ae,{onClick:$,className:O(Z&&"text-special"),children:[n.jsx(qt,{size:16,className:O(Z&&"text-special")}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.webSearch")}),Z&&n.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),n.jsxs(Ae,{onClick:F,className:O(se&&"text-special"),children:[n.jsx(Qt,{size:16,className:O(se&&"text-special")}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.deepResearch")}),se&&n.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),n.jsxs(gt,{children:[n.jsxs(xt,{className:"gap-2",children:[n.jsx("span",{className:"flex size-4 items-center justify-center text-base font-medium text-muted-foreground",children:"/"}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.prompts")})]}),n.jsx(vt,{className:"w-80 max-h-72 overflow-y-auto p-1.5",children:b?n.jsxs("div",{className:"flex items-center gap-2 px-2 py-3 text-sm text-muted-foreground",children:[n.jsx(Us,{className:"size-3.5"}),a("chat.toolsPopover.loadingPrompts")]}):A.length===0?n.jsx("div",{className:"px-2 py-3 text-sm text-muted-foreground",children:a("chat.toolsPopover.noPromptsAvailable")}):A.map(D=>n.jsxs(Ae,{onClick:()=>L(D),className:"flex flex-col items-start gap-0.5",children:[n.jsx("span",{className:"font-medium text-sm capitalize",children:D.title||ko(D.name,jt(D._meta))}),D.description&&n.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:D.description})]},D.name))})]}),n.jsxs(gt,{children:[n.jsxs(xt,{className:"gap-2",children:[n.jsx(We,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.approval")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:N})]}),n.jsx(vt,{className:"w-48 p-1.5",children:n.jsx(Ls,{value:C.toolApprovalLevel,onValueChange:T,children:we.map(D=>n.jsx(Fs,{value:D.value,children:a(D.labelKey)},D.value))})})]}),n.jsxs(Ae,{onClick:U,children:[n.jsx(Io,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.connections")}),n.jsx(P.Suspense,{children:n.jsx(fi,{})})]})]})]}),n.jsx(Js,{prompt:j,setPrompt:k,onSubmit:z})]})}const gi=[{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 xi(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex items-center -space-x-1",children:gi.map(vi)}),t[0]=e):e=t[0],e}function vi(t){return n.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-2 ring-muted object-cover bg-white"},t.name)}function bi(t){const e=R.c(10),{onClick:s}=t,o=B();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=O("group relative z-10 flex items-center gap-3 w-full px-4 py-3","rounded-b-2xl","cursor-pointer"),e[0]=r):r=e[0];let i;e[1]!==o?(i=o("chat.connectionsBanner.description"),e[1]=o,e[2]=i):i=e[2];let a;e[3]!==i?(a=n.jsx("p",{className:"flex-1 text-xs text-muted-foreground truncate text-left",children:i}),e[3]=i,e[4]=a):a=e[4];let l,V;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(xi,{}),V=n.jsx(zs,{size:14,className:"shrink-0 text-muted-foreground/60 group-hover:text-muted-foreground transition-colors"}),e[5]=l,e[6]=V):(l=e[5],V=e[6]);let d;return e[7]!==s||e[8]!==a?(d=n.jsxs("button",{type:"button",onClick:s,className:r,children:[a,l,V]}),e[7]=s,e[8]=a,e[9]=d):d=e[9],d}const Re=48;function Ai(){const t=R.c(9),[e,s]=P.useState("idle"),[o,r]=P.useState(""),[i,a]=P.useState(""),[l,V]=P.useState(ki),d=P.useRef(null),u=P.useRef(null),c=P.useRef(null),p=P.useRef(null),f=P.useRef(0),m=P.useRef(!1),h=P.useRef(""),g=P.useRef(""),v=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition);let x;t[0]===Symbol.for("react.memo_cache_sentinel")?(x=()=>{f.current&&(cancelAnimationFrame(f.current),f.current=0),u.current?.close().catch(ji),p.current?.getTracks().forEach(yi),c.current=null,u.current=null,p.current=null},t[0]=x):x=t[0];const b=x;let A;if(t[1]===Symbol.for("react.memo_cache_sentinel")){const I=N=>{p.current=N;const T=new AudioContext;u.current=T;const _=T.createMediaStreamSource(N),E=T.createAnalyser();E.fftSize=128,E.smoothingTimeConstant=.8,_.connect(E),c.current=E;const U=new Uint8Array(E.frequencyBinCount),M=()=>{if(!c.current)return;c.current.getByteFrequencyData(U);const L=[];for(let z=0;z<Re;z++){const W=Math.floor(z/Re*U.length);L.push(Math.max(.04,(U[W]??0)/255))}V(L),f.current=requestAnimationFrame(M)};M()};A=async()=>{const N=window.SpeechRecognition||window.webkitSpeechRecognition;if(!N)return s("unsupported"),"unsupported";let T;try{T=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{return s("permission-denied"),"permission-denied"}r(""),a(""),g.current="",h.current="",m.current=!0,s("recording"),I(T);const _=new N;d.current=_,_.interimResults=!0,_.continuous=!0,_.lang=navigator.language||"en-US",_.onresult=E=>{if(d.current!==_)return;let U="",M="";for(let L=E.resultIndex;L<E.results.length;L++){const z=E.results[L],W=z?.[0]?.transcript??"";z?.isFinal?M=M+W:U=U+W}M&&(h.current=h.current+M,r(h.current)),g.current=U,a(U)},_.onerror=E=>{d.current===_&&E.error!=="no-speech"&&(m.current=!1,d.current=null,b(),s(E.error==="not-allowed"?"permission-denied":"idle"))},_.onend=()=>{if(d.current===_&&m.current)try{_.start()}catch{}};try{_.start()}catch{return m.current=!1,d.current=null,b(),s("idle"),"idle"}return"recording"},t[1]=A}else A=t[1];const j=A;let k;t[2]===Symbol.for("react.memo_cache_sentinel")?(k=()=>{m.current=!1,d.current?.stop(),b(),s("idle"),V(Array(Re).fill(.05)),a("");const I=(h.current+(g.current?" "+g.current:"")).trim();return r(""),h.current="",g.current="",I},t[2]=k):k=t[2];const y=k;let w;t[3]===Symbol.for("react.memo_cache_sentinel")?(w=()=>{m.current=!1,d.current?.abort(),b(),s("idle"),r(""),a(""),V(Array(Re).fill(.05)),h.current="",g.current=""},t[3]=w):w=t[3];const C=w;let S;return t[4]!==i||t[5]!==e||t[6]!==o||t[7]!==l?(S={status:e,transcript:o,interimTranscript:i,waveformData:l,isSupported:v,startRecording:j,stopRecording:y,cancelRecording:C},t[4]=i,t[5]=e,t[6]=o,t[7]=l,t[8]=S):S=t[8],S}function yi(t){return t.stop()}function ji(){}function ki(){return Array(Re).fill(.05)}function wi(t){const e=R.c(4),{data:s}=t;let o;e[0]!==s?(o=s.map(Si),e[0]=s,e[1]=o):o=e[1];let r;return e[2]!==o?(r=n.jsx("div",{className:"flex items-center justify-center gap-[2px] h-10 overflow-hidden","aria-hidden":"true",children:o}),e[2]=o,e[3]=r):r=e[3],r}function Si(t,e){return n.jsx("div",{className:"w-[2px] shrink-0 rounded-full bg-chart-2 transition-[height] duration-75 ease-out",style:{height:`${Math.max(4,Math.round(t*40))}px`}},e)}const Pe=12e3,Rt=re({token:ne(),expiresAt:$s()});Bs("provider",[re({provider:ye("elevenlabs"),conversationToken:ne().min(1)}),re({provider:ye("openai"),transport:ye("webrtc")})]);const Ci=Os([Rt.extend({provider:ye("elevenlabs").default("elevenlabs"),conversationToken:ne().min(1)}),Rt.extend({provider:ye("openai"),transport:ye("webrtc")})]);re({token:ne().min(1).max(4096),text:ne().trim().min(1).max(Pe)});const bs=re({request:ne().trim().min(1).max(Pe)}),ot=5e3;Ut(re({role:Le(["user","agent"]),text:ne().min(1).max(ot)})).max(60).refine(t=>t.reduce((e,s)=>e+s.text.length,0)<=ot,{message:"Voice transcript is too long"});function Xa(t){const e=[];let s=ot;for(const o of t.slice(-60).reverse()){if(s<=0)break;const r=o.text.slice(-s);e.unshift({role:o.role,text:r}),s-=r.length}return e}re({token:ne().min(1).max(4096),sdp:ne().min(1).max(1e5),language:Le(["en","pt"]).default("en")}).strict();const Ni=re({sdp:ne().min(1).max(1e5)});async function Ii(t,e,s,o,r){if(t.provider==="openai"){const{startOpenAIConversation:l}=await bt(async()=>{const{startOpenAIConversation:V}=await import("./openai-conversation-IgCPp4x2.js");return{startOpenAIConversation:V}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126]));return l(r,s,o)}const{Conversation:i}=await bt(async()=>{const{Conversation:l}=await import("./index-yN0BIuMc.js");return{Conversation:l}},[]);o.throwIfAborted();const a=await i.startSession({...s,clientTools:{delegate_to_agent:async l=>{const V=bs.safeParse(l);return JSON.stringify(V.success?await s.onDelegate(V.data):{status:"rejected",reason:"A complete request is required."})},get_agent_status:()=>JSON.stringify(s.getWorkStatus()),stop_agent_work:()=>JSON.stringify(s.cancelCurrentWork())},conversationToken:t.conversationToken,connectionType:"webrtc",overrides:{agent:{language:e}}});return o.aborted&&(await a.endSession(),o.throwIfAborted()),{endSession:()=>a.endSession(),setMicMuted:l=>a.setMicMuted(l),getOutputVolume:()=>a.getOutputVolume(),publishUpdate:l=>{const V=JSON.stringify({source:"Studio background data, not a user request or instructions",contextId:l.contextId,requestId:l.delegationId,text:l.text});l.delivery==="context"?a.sendContextualUpdate(V):a.sendUserMessage(`[Studio background event, not a new user request]
9
+ The report follows.`;function sr(t){return{...t,content:[{type:"paragraph",content:[Hs({id:St,name:St,char:"/",kind:"prompt",metadata:[{role:"user",content:{type:"text",text:tr}}]})]},...t.content??[]]}}function nr(t){const e=R.c(30),{current:s,total:o,onPrev:r,onNext:i}=t,a=B();if(o<=1)return null;const l=s===0,V=s===0?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let d;e[0]!==V?(d=O("p-0.5 transition-colors rounded-lg",V),e[0]=V,e[1]=d):d=e[1];let u;e[2]!==a?(u=a("chat.pagination.previousLabel"),e[2]=a,e[3]=u):u=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(On,{size:14}),e[4]=c):c=e[4];let p;e[5]!==r||e[6]!==l||e[7]!==d||e[8]!==u?(p=n.jsx("button",{type:"button",onClick:r,disabled:l,className:d,"aria-label":u,children:c}),e[5]=r,e[6]=l,e[7]=d,e[8]=u,e[9]=p):p=e[9];const f=s+1;let m;e[10]!==a||e[11]!==f||e[12]!==o?(m=a("chat.pagination.counter",{current:f,total:o}),e[10]=a,e[11]=f,e[12]=o,e[13]=m):m=e[13];let h;e[14]!==m?(h=n.jsx("span",{className:"tabular-nums text-xs",children:m}),e[14]=m,e[15]=h):h=e[15];const g=s===o-1,v=s===o-1?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let x;e[16]!==v?(x=O("p-0.5 transition-colors rounded-lg",v),e[16]=v,e[17]=x):x=e[17];let b;e[18]!==a?(b=a("chat.pagination.nextLabel"),e[18]=a,e[19]=b):b=e[19];let A;e[20]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx(zt,{size:14}),e[20]=A):A=e[20];let j;e[21]!==i||e[22]!==g||e[23]!==x||e[24]!==b?(j=n.jsx("button",{type:"button",onClick:i,disabled:g,className:x,"aria-label":b,children:A}),e[21]=i,e[22]=g,e[23]=x,e[24]=b,e[25]=j):j=e[25];let k;return e[26]!==j||e[27]!==p||e[28]!==h?(k=n.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[p,h,j]}),e[26]=j,e[27]=p,e[28]=h,e[29]=k):k=e[29],k}function as(t){const e=R.c(8),{currentIndex:s,total:o,onPrev:r,onNext:i,extraLeft:a}=t;let l;e[0]!==s||e[1]!==i||e[2]!==r||e[3]!==o?(l=n.jsx(nr,{current:s,total:o,onPrev:r,onNext:i}),e[0]=s,e[1]=i,e[2]=r,e[3]=o,e[4]=l):l=e[4];let V;return e[5]!==a||e[6]!==l?(V=n.jsxs("div",{className:"flex items-center gap-2",children:[l,a]}),e[5]=a,e[6]=l,e[7]=V):V=e[7],V}function or(t){const e=R.c(17),{isStreaming:s,isAllAnswered:o,isCurrentAnswered:r,onAdvanceOrSubmit:i,submitLabel:a,nextLabel:l}=t,u=o?a===void 0?"Submit":a:l===void 0?"Next":l,c=o?s:!r,p=c?o?"Waiting for the assistant to finish…":"Answer this item to continue":null;let f;e[0]!==c||e[1]!==i?(f=()=>{c||i()},e[0]=c,e[1]=i,e[2]=f):f=e[2];const m=c&&"opacity-50 cursor-not-allowed";let h;e[3]!==m?(h=O("h-7 px-2.5 text-xs",m),e[3]=m,e[4]=h):h=e[4];let g;e[5]!==c||e[6]!==u||e[7]!==f||e[8]!==h?(g=n.jsx(Y,{type:"button",size:"sm","aria-disabled":c,onClick:f,className:h,children:u}),e[5]=c,e[6]=u,e[7]=f,e[8]=h,e[9]=g):g=e[9];const v=g;if(!p)return v;let x;e[10]!==v?(x=n.jsx(He,{asChild:!0,children:v}),e[10]=v,e[11]=x):x=e[11];let b;e[12]!==p?(b=n.jsx(Je,{children:p}),e[12]=p,e[13]=b):b=e[13];let A;return e[14]!==x||e[15]!==b?(A=n.jsxs(Ze,{children:[x,b]}),e[14]=x,e[15]=b,e[16]=A):A=e[16],A}function ls(t,e,s){return t.findIndex(o=>e(o)===s)}function Ct(t,e,s,o){return t.length===0?!1:t.every(r=>o(s[e(r)]))}function Nt(t,e,s,o,r){if(t.length===0)return null;const i=ls(t,e,r);for(let a=1;a<=t.length;a++){const l=t[(i+a)%t.length];if(!l)continue;const V=e(l);if(V!==r&&!o(s[V]))return V}return null}function rr(t){return!t.isStreaming&&t.allAnswered}function Vs(t){const{parts:e,partKey:s,schema:o,defaultValues:r,isStreaming:i,hasAnswer:a,onSubmit:l}=t,V=e[0]?s(e[0]):"",[d,u]=P.useState(V),[c,p]=P.useState(!1),f=js({resolver:ks(o),defaultValues:r}),m=f.watch(),h=ls(e,s,d),g=h>=0?e[h]:void 0,v=a(m[d]),x=Ct(e,s,m,a),b=rr({isStreaming:i,allAnswered:x}),A=()=>{if(h>0){const I=e[h-1];I&&u(s(I))}},j=()=>{if(h>=0&&h<e.length-1){const I=e[h+1];I&&u(s(I))}},k=()=>{const I=f.getValues(),N=Nt(e,s,I,a,d);N&&u(N)},y=()=>{f.handleSubmit(I=>{const N=I;for(const T of e)l(T,N[s(T)])})()},w=P.useRef(y);w.current=y;const C=()=>{b&&(p(!1),w.current())},S=()=>{const I=f.getValues();if(Ct(e,s,I,a)){if(i){p(!0);return}p(!1),w.current()}else{const N=Nt(e,s,I,a,d);N&&u(N)}};return P.useEffect(()=>{if(c&&!i){if(!x){p(!1);return}p(!1),w.current()}},[c,i,x]),{form:f,activeKey:d,setActiveKey:u,currentIndex:h,currentPart:g,isCurrentAnswered:v,isAllAnswered:x,canSubmit:b,goPrev:A,goNext:j,advanceToNextUnanswered:k,submit:C,submitOrAdvance:S}}const cs="chat.approval.defaultDenyReason";function ds(t){const e=R.c(36),{onYolo:s}=t,o=B(),[r,i]=Se();let a,l,V,d,u,c,p,f,m;if(e[0]!==s||e[1]!==r||e[2]!==i||e[3]!==o){const A=we.find(y=>y.value===r.toolApprovalLevel)??we[0];let j;e[13]!==s||e[14]!==r||e[15]!==i?(j=y=>{const w=y,C=r.toolApprovalLevel??"readonly";i({...r,toolApprovalLevel:w}),w==="auto"&&s(C)},e[13]=s,e[14]=r,e[15]=i,e[16]=j):j=e[16];const k=j;V=Un,f=r.toolApprovalLevel,m=k,l=Ln,u="xs",c="text-xs text-muted-foreground border-border/60 bg-transparent hover:bg-accent/60 h-7 gap-1",p=ir,a=Fn,d=o(A.shortKey),e[0]=s,e[1]=r,e[2]=i,e[3]=o,e[4]=a,e[5]=l,e[6]=V,e[7]=d,e[8]=u,e[9]=c,e[10]=p,e[11]=f,e[12]=m}else a=e[4],l=e[5],V=e[6],d=e[7],u=e[8],c=e[9],p=e[10],f=e[11],m=e[12];let h;e[17]!==a||e[18]!==d?(h=n.jsx(a,{children:d}),e[17]=a,e[18]=d,e[19]=h):h=e[19];let g;e[20]!==l||e[21]!==u||e[22]!==c||e[23]!==p||e[24]!==h?(g=n.jsx(l,{size:u,className:c,onClick:p,children:h}),e[20]=l,e[21]=u,e[22]=c,e[23]=p,e[24]=h,e[25]=g):g=e[25];let v;e[26]!==o?(v=we.map(A=>n.jsx(Pn,{value:A.value,children:o(A.labelKey)},A.value)),e[26]=o,e[27]=v):v=e[27];let x;e[28]!==v?(x=n.jsx(zn,{children:v}),e[28]=v,e[29]=x):x=e[29];let b;return e[30]!==V||e[31]!==x||e[32]!==f||e[33]!==m||e[34]!==g?(b=n.jsxs(V,{value:f,onValueChange:m,children:[g,x]}),e[30]=V,e[31]=x,e[32]=f,e[33]=m,e[34]=g,e[35]=b):b=e[35],b}function ir(t){return t.stopPropagation()}function us(t){const e=R.c(8),{input:s}=t,o=B();if(s==null){let a;e[0]!==o?(a=o("chat.approval.noInput"),e[0]=o,e[1]=a):a=e[1];let l;return e[2]!==a?(l=n.jsx("div",{className:"px-4 text-xs text-muted-foreground",children:a}),e[2]=a,e[3]=l):l=e[3],l}let r;try{let a;e[4]!==s?(a=JSON.stringify(s,null,2),e[4]=s,e[5]=a):a=e[5],r=a}catch{r=String(s)}let i;return e[6]!==r?(i=n.jsx("div",{className:"px-4",children:n.jsx("pre",{className:"text-xs font-mono text-muted-foreground/70 whitespace-pre-wrap wrap-break-word max-h-32 overflow-y-auto rounded-md bg-muted/30 px-3 py-2",children:r})}),e[6]=r,e[7]=i):i=e[7],i}function ar(t){const e=R.c(38),{approval:s,onRespond:o}=t,r=B(),[i]=Se(),a=i.toolApprovalLevel??"readonly";let l;e[0]!==s.approvalId||e[1]!==a||e[2]!==o||e[3]!==r?(l=()=>o(s.approvalId,!1,r(cs),a),e[0]=s.approvalId,e[1]=a,e[2]=o,e[3]=r,e[4]=l):l=e[4];const V=l;let d;e[5]!==s.approvalId||e[6]!==a||e[7]!==o?(d=()=>o(s.approvalId,!0,void 0,a),e[5]=s.approvalId,e[6]=a,e[7]=o,e[8]=d):d=e[8];const u=d;let c;e[9]!==s.approvalId||e[10]!==o?(c=C=>o(s.approvalId,!0,void 0,C),e[9]=s.approvalId,e[10]=o,e[11]=c):c=e[11];const p=c;let f;e[12]!==p?(f=n.jsx("div",{className:"flex items-center gap-2",children:n.jsx(ds,{onYolo:p})}),e[12]=p,e[13]=f):f=e[13];const m=f;let h;e[14]!==r?(h=r("chat.approval.denyButton"),e[14]=r,e[15]=h):h=e[15];let g;e[16]!==V||e[17]!==h?(g=n.jsx(Y,{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:h}),e[16]=V,e[17]=h,e[18]=g):g=e[18];let v;e[19]!==r?(v=r("chat.approval.acceptButton"),e[19]=r,e[20]=v):v=e[20];let x;e[21]!==u||e[22]!==v?(x=n.jsx(Y,{type:"button",size:"sm",className:"h-7 px-2.5 text-xs active:scale-[0.97] transition-transform",onClick:u,children:v}),e[21]=u,e[22]=v,e[23]=x):x=e[23];let b;e[24]!==g||e[25]!==x?(b=n.jsxs(n.Fragment,{children:[g,x]}),e[24]=g,e[25]=x,e[26]=b):b=e[26];const A=b;let j;e[27]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(We,{size:14}),e[27]=j):j=e[27];let k;e[28]!==r?(k=r("chat.approval.needsApproval"),e[28]=r,e[29]=k):k=e[29];let y;e[30]!==s.input?(y=n.jsx(us,{input:s.input}),e[30]=s.input,e[31]=y):y=e[31];let w;return e[32]!==s.friendlyName||e[33]!==m||e[34]!==A||e[35]!==k||e[36]!==y?(w=n.jsx(pe,{icon:j,label:k,title:s.friendlyName,defaultExpanded:!0,footerLeft:m,footerRight:A,children:y}),e[32]=s.friendlyName,e[33]=m,e[34]=A,e[35]=k,e[36]=y,e[37]=w):w=e[37],w}const lr=ws(ne(),re({approved:Ss().optional(),levelOverride:Le(["auto","readonly"]).optional()}));function Vr(t){const e=R.c(46),{approvals:s,isStreaming:o,onRespond:r}=t,i=B(),[a]=Se(),l=a.toolApprovalLevel??"readonly";let V;e[0]!==s?(V=Object.fromEntries(s.map(ur)),e[0]=s,e[1]=V):V=e[1];const d=V;let u;e[2]!==l||e[3]!==r||e[4]!==i?(u=(N,T)=>{const _=T;typeof _?.approved=="boolean"&&r(N.approvalId,_.approved,_.approved===!1?i(cs):void 0,_.levelOverride??l)},e[2]=l,e[3]=r,e[4]=i,e[5]=u):u=e[5];let c;e[6]!==s||e[7]!==d||e[8]!==o||e[9]!==u?(c={parts:s,partKey:dr,schema:lr,defaultValues:d,isStreaming:o,hasAnswer:cr,onSubmit:u},e[6]=s,e[7]=d,e[8]=o,e[9]=u,e[10]=c):c=e[10];const p=Vs(c);let f;e[11]!==s||e[12]!==p?(f=N=>{p.form.reset(Object.fromEntries(s.map(T=>[T.approvalId,{approved:!0,levelOverride:N}]))),p.submitOrAdvance()},e[11]=s,e[12]=p,e[13]=f):f=e[13];const m=f,h=p.currentPart,g=p.form;let v;e[14]!==p?(v=N=>{N.preventDefault(),p.submit()},e[14]=p,e[15]=v):v=e[15];let x;e[16]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(We,{size:14}),e[16]=x):x=e[16];let b;e[17]!==s.length||e[18]!==i?(b=i("chat.approval.batchedLabel",{count:s.length}),e[17]=s.length,e[18]=i,e[19]=b):b=e[19];const A=h?.friendlyName??"";let j;e[20]!==m?(j=n.jsx(ds,{onYolo:m}),e[20]=m,e[21]=j):j=e[21];let k;e[22]!==s.length||e[23]!==p.currentIndex||e[24]!==p.goNext||e[25]!==p.goPrev||e[26]!==j?(k=n.jsx(as,{currentIndex:p.currentIndex,total:s.length,onPrev:p.goPrev,onNext:p.goNext,extraLeft:j}),e[22]=s.length,e[23]=p.currentIndex,e[24]=p.goNext,e[25]=p.goPrev,e[26]=j,e[27]=k):k=e[27];let y;e[28]!==h||e[29]!==p.form.control||e[30]!==p.submitOrAdvance?(y=h?n.jsx(pr,{approvalId:h.approvalId,control:p.form.control,onChange:p.submitOrAdvance}):null,e[28]=h,e[29]=p.form.control,e[30]=p.submitOrAdvance,e[31]=y):y=e[31];let w;e[32]!==h?(w=h?n.jsx(us,{input:h.input}):null,e[32]=h,e[33]=w):w=e[33];let C;e[34]!==k||e[35]!==y||e[36]!==w||e[37]!==b||e[38]!==A?(C=n.jsx(pe,{icon:x,label:b,title:A,defaultExpanded:!0,footerLeft:k,footerRight:y,children:w}),e[34]=k,e[35]=y,e[36]=w,e[37]=b,e[38]=A,e[39]=C):C=e[39];let S;e[40]!==C||e[41]!==v?(S=n.jsx("form",{onSubmit:v,children:C}),e[40]=C,e[41]=v,e[42]=S):S=e[42];let I;return e[43]!==p.form||e[44]!==S?(I=n.jsx(nt,{...g,children:S}),e[43]=p.form,e[44]=S,e[45]=I):I=e[45],I}function cr(t){return typeof t?.approved=="boolean"}function dr(t){return t.approvalId}function ur(t){return[t.approvalId,{approved:void 0}]}function pr(t){const e=R.c(7),{approvalId:s,control:o,onChange:r}=t,i=B(),a=`${s}.approved`;let l;e[0]!==r||e[1]!==i?(l=d=>{const{field:u}=d,c=u.value===!0,p=u.value===!1;return n.jsxs(n.Fragment,{children:[n.jsx(Y,{type:"button",variant:p?"secondary":"ghost",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{u.onChange(!1),r()},"aria-pressed":p,children:i("chat.approval.denyButton")}),n.jsx(Y,{type:"button",variant:c?"default":"outline",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{u.onChange(!0),r()},"aria-pressed":c,children:i("chat.approval.acceptButton")})]})},e[0]=r,e[1]=i,e[2]=l):l=e[2];let V;return e[3]!==o||e[4]!==a||e[5]!==l?(V=n.jsx(Cs,{control:o,name:a,render:l}),e[3]=o,e[4]=a,e[5]=l,e[6]=V):V=e[6],V}function fr(){const t=R.c(5),e=B();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(We,{className:"size-5 text-muted-foreground shimmer"}),t[0]=s):s=t[0];let o;t[1]!==e?(o=e("chat.approval.preparingRequest"),t[1]=e,t[2]=o):o=t[2];let r;return t[3]!==o?(r=n.jsxs("div",{className:"flex items-center gap-2 p-4 border border-dashed rounded-lg bg-accent/50 w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",children:[s,n.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:o})]}),t[3]=o,t[4]=r):r=t[4],r}function hr(t){const e=R.c(8),{approvals:s,isStreaming:o,onRespond:r}=t;if(o&&s.length===0){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(fr,{}),e[0]=a):a=e[0],a}if(s.length===0)return null;if(s.length===1){const a=s[0];if(!a)return null;let l;return e[1]!==r||e[2]!==a?(l=n.jsx(ar,{approval:a,onRespond:r}),e[1]=r,e[2]=a,e[3]=l):l=e[3],l}let i;return e[4]!==s||e[5]!==o||e[6]!==r?(i=n.jsx(Vr,{approvals:s,isStreaming:o,onRespond:r}),e[4]=s,e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function mr(t){const e=R.c(28),{plan:s,onApprove:o,onDismiss:r}=t,i=B();let a;e[0]!==o||e[1]!==s.plan?(a=()=>{o(s.plan)},e[0]=o,e[1]=s.plan,e[2]=a):a=e[2];const l=a;let V;e[3]!==i?(V=i("chat.proposePlan.keepIterating"),e[3]=i,e[4]=V):V=e[4];let d;e[5]!==r||e[6]!==V?(d=n.jsx(Y,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2.5 text-xs text-muted-foreground [@media(hover:hover)]:hover:text-foreground active:scale-[0.97] transition-transform",onClick:r,children:V}),e[5]=r,e[6]=V,e[7]=d):d=e[7];let u;e[8]!==i?(u=i("chat.proposePlan.letsGo"),e[8]=i,e[9]=u):u=e[9];let c;e[10]!==l||e[11]!==u?(c=n.jsx(Y,{type:"button",size:"sm",className:"h-7 px-2.5 text-xs bg-special hover:bg-special/90 text-special-foreground active:scale-[0.97] transition-transform",onClick:l,children:u}),e[10]=l,e[11]=u,e[12]=c):c=e[12];let p;e[13]!==d||e[14]!==c?(p=n.jsxs(n.Fragment,{children:[d,c]}),e[13]=d,e[14]=c,e[15]=p):p=e[15];const f=p;let m;e[16]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Bt,{size:14}),e[16]=m):m=e[16];let h;e[17]!==i?(h=i("chat.proposePlan.planReady"),e[17]=i,e[18]=h):h=e[18];let g;e[19]!==i?(g=i("chat.proposePlan.implementationPlan"),e[19]=i,e[20]=g):g=e[20];let v;e[21]!==s.plan?(v=n.jsx("div",{className:"px-4 max-h-64 overflow-y-auto",children:n.jsx("div",{className:"prose prose-sm max-w-none text-sm",children:n.jsx($n,{id:"plan-preview",part:{type:"text",text:s.plan}})})}),e[21]=s.plan,e[22]=v):v=e[22];let x;return e[23]!==f||e[24]!==v||e[25]!==h||e[26]!==g?(x=n.jsx(pe,{icon:m,label:h,title:g,defaultExpanded:!0,footerRight:f,children:v}),e[23]=f,e[24]=v,e[25]=h,e[26]=g,e[27]=x):x=e[27],x}function gr(t){const e=R.c(6),{plans:s,onApprove:o,onDismiss:r}=t;let i;e[0]!==s?(i=os(s),e[0]=s,e[1]=i):i=e[1];const a=i;if(!a)return null;let l;return e[2]!==a||e[3]!==o||e[4]!==r?(l=n.jsx(mr,{plan:a,onApprove:o,onDismiss:r}),e[2]=a,e[3]=o,e[4]=r,e[5]=l):l=e[5],l}function ps(t){return t?"response"in t?t.response:t.option??t.draft:""}const It=re({response:ne().min(1,"Response is required")}),xr=re({option:ne().nullable(),draft:ne()}).refine(t=>(t.option??t.draft).length>0,{message:"Please select or enter an option"}),vr=re({response:Le(["yes","no"])});function br(t){switch(t.type){case"text":return It;case"choice":return xr;case"confirm":return vr;default:return It}}function Ar(t){const e={};for(const s of t)e[s.toolCallId]=br(s.input);return re(e)}function yr(t){const e=R.c(7),{control:s,name:o,placeholder:r}=t,i=B();let a;e[0]!==r||e[1]!==i?(a=V=>{const{field:d}=V,u=d.value??"";return n.jsxs(Vt,{children:[n.jsx(ct,{children:n.jsx("div",{className:"px-2",children:n.jsxs("div",{className:"flex items-center gap-3 px-2 py-3 rounded-lg bg-accent/50",children:[n.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:n.jsx(Kt,{size:16,className:"text-muted-foreground"})}),n.jsx("input",{...d,value:u,type:"text",placeholder:r||i("chat.userAskQuestion.typeResponse"),autoFocus:!0,"aria-label":i("chat.userAskQuestion.textResponseInputAriaLabel"),className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"})]})})}),n.jsx(dt,{})]})},e[0]=r,e[1]=i,e[2]=a):a=e[2];let l;return e[3]!==s||e[4]!==o||e[5]!==a?(l=n.jsx(Yt,{control:s,name:o,render:a}),e[3]=s,e[4]=o,e[5]=a,e[6]=l):l=e[6],l}function fs(t,e){const s=R.c(4);let o,r;s[0]!==t||s[1]!==e?(o=()=>{const i=a=>{const l=a.target.tagName;if(l==="INPUT"||l==="TEXTAREA"||a.metaKey||a.ctrlKey||a.altKey)return;const V=Number.parseInt(a.key,10);V>=1&&V<=t&&(a.preventDefault(),e(V-1))};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},r=[t,e],s[0]=t,s[1]=e,s[2]=o,s[3]=r):(o=s[2],r=s[3]),P.useEffect(o,r)}function jr(t){const e=R.c(51),{control:s,name:o,options:r}=t,i=B(),a=`${o}.option`;let l;e[0]!==s||e[1]!==a?(l={control:s,name:a,defaultValue:null},e[0]=s,e[1]=a,e[2]=l):l=e[2];const{field:V}=mt(l),d=`${o}.draft`;let u;e[3]!==s||e[4]!==d?(u={control:s,name:d,defaultValue:""},e[3]=s,e[4]=d,e[5]=u):u=e[5];const{field:c}=mt(u),p=V.value,f=c.value??"";let m;if(e[6]!==V||e[7]!==r?(m=U=>{const M=r[U];M!=null&&V.onChange(M)},e[6]=V,e[7]=r,e[8]=m):m=e[8],fs(r.length,m),r.length===0)return null;const h=p===null;let g;e[9]!==i?(g=i("chat.userAskQuestion.choiceOptionsAriaLabel"),e[9]=i,e[10]=g):g=e[10];let v;if(e[11]!==V||e[12]!==p||e[13]!==r||e[14]!==i){let U;e[16]!==V||e[17]!==p||e[18]!==i?(U=(M,L)=>{const z=p===M;return n.jsxs("button",{type:"button",onClick:()=>V.onChange(M),className:O("flex items-start gap-3 px-2 py-3 rounded-lg text-left transition-colors w-full",z&&"bg-accent/50",!z&&"hover:bg-accent/30"),"aria-label":i("chat.userAskQuestion.selectOption",{option:M}),children:[n.jsx("span",{className:O("flex items-center justify-center size-6 rounded-md text-sm shrink-0 mt-0.5",z?"bg-chart-1 text-white":"bg-muted text-foreground"),children:L+1}),n.jsx("span",{className:"text-sm text-foreground min-w-0 break-words",children:M})]},`${L}-${M}`)},e[16]=V,e[17]=p,e[18]=i,e[19]=U):U=e[19],v=r.map(U),e[11]=V,e[12]=p,e[13]=r,e[14]=i,e[15]=v}else v=e[15];const x=h&&"bg-accent/50",b=!h&&"hover:bg-accent/30";let A;e[20]!==x||e[21]!==b?(A=O("flex items-center gap-3 px-2 py-3 rounded-lg transition-colors w-full cursor-text",x,b),e[20]=x,e[21]=b,e[22]=A):A=e[22];let j;e[23]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:n.jsx(Kt,{size:16,className:"text-muted-foreground"})}),e[23]=j):j=e[23];const k=h?f:"";let y;e[24]!==c||e[25]!==V||e[26]!==p?(y=U=>{c.onChange(U.target.value),p!==null&&V.onChange(null)},e[24]=c,e[25]=V,e[26]=p,e[27]=y):y=e[27];let w;e[28]!==V||e[29]!==p?(w=()=>{p!==null&&V.onChange(null)},e[28]=V,e[29]=p,e[30]=w):w=e[30];let C;e[31]!==i?(C=i("chat.userAskQuestion.somethingElsePlaceholder"),e[31]=i,e[32]=C):C=e[32];let S;e[33]!==i?(S=i("chat.userAskQuestion.customChoiceInputAriaLabel"),e[33]=i,e[34]=S):S=e[34];let I;e[35]!==k||e[36]!==y||e[37]!==w||e[38]!==C||e[39]!==S?(I=n.jsx("input",{type:"text",value:k,onChange:y,onFocus:w,placeholder:C,"aria-label":S,className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"}),e[35]=k,e[36]=y,e[37]=w,e[38]=C,e[39]=S,e[40]=I):I=e[40];let N;e[41]!==A||e[42]!==I?(N=n.jsxs("label",{className:A,children:[j,I]}),e[41]=A,e[42]=I,e[43]=N):N=e[43];let T;e[44]!==N||e[45]!==g||e[46]!==v?(T=n.jsx(ct,{children:n.jsxs("div",{className:"flex flex-col px-2",role:"group","aria-label":g,children:[v,N]})}),e[44]=N,e[45]=g,e[46]=v,e[47]=T):T=e[47];let _;e[48]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(dt,{}),e[48]=_):_=e[48];let E;return e[49]!==T?(E=n.jsxs(Vt,{children:[T,_]}),e[49]=T,e[50]=E):E=e[50],E}function kr(t){const e=R.c(8),{control:s,name:o}=t,r=B();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=["yes","no"],e[0]=i):i=e[0];const a=i,l=P.useRef(null);let V;e[1]===Symbol.for("react.memo_cache_sentinel")?(V=c=>{l.current?.onChange(a[c]??"")},e[1]=V):V=e[1],fs(a.length,V);let d;e[2]!==r?(d=c=>{const{field:p}=c;return l.current=p,n.jsxs(Vt,{children:[n.jsx(ct,{children:n.jsx("div",{className:"flex gap-2 px-2",role:"group","aria-label":r("chat.userAskQuestion.confirmationOptionsAriaLabel"),children:a.map(f=>{const m=p.value===f;return n.jsxs("button",{type:"button",onClick:()=>p.onChange(f),className:O("flex items-center gap-3 px-4 py-3 rounded-lg text-left transition-colors flex-1",m&&"bg-accent/50",!m&&"hover:bg-accent/30"),"aria-label":r("chat.userAskQuestion.confirmValue",{value:r(`chat.userAskQuestion.confirm${f==="yes"?"Yes":"No"}`)}),children:[n.jsx("span",{className:O("flex items-center justify-center size-6 rounded-md text-sm shrink-0",m?"bg-chart-1 text-white":"bg-muted text-foreground"),children:f==="yes"?1:2}),n.jsx("span",{className:"text-sm text-foreground capitalize",children:r(`chat.userAskQuestion.confirm${f==="yes"?"Yes":"No"}`)})]},f)})})}),n.jsx(dt,{})]})},e[2]=r,e[3]=d):d=e[3];let u;return e[4]!==s||e[5]!==o||e[6]!==d?(u=n.jsx(Yt,{control:s,name:o,render:d}),e[4]=s,e[5]=o,e[6]=d,e[7]=u):u=e[7],u}function Tt(t){const e=R.c(13),{input:s,control:o,toolCallId:r}=t;switch(s.type){case"text":{const i=`${r}.response`;let a;return e[0]!==o||e[1]!==s.default||e[2]!==i?(a=n.jsx(yr,{control:o,name:i,placeholder:s.default}),e[0]=o,e[1]=s.default,e[2]=i,e[3]=a):a=e[3],a}case"choice":{let i;e[4]!==s.options?(i=s.options?.filter(Boolean)??[],e[4]=s.options,e[5]=i):i=e[5];const a=i;let l;return e[6]!==o||e[7]!==a||e[8]!==r?(l=n.jsx(jr,{control:o,name:r,options:a}),e[6]=o,e[7]=a,e[8]=r,e[9]=l):l=e[9],l}case"confirm":{const i=`${r}.response`;let a;return e[10]!==o||e[11]!==i?(a=n.jsx(kr,{control:o,name:i}),e[10]=o,e[11]=i,e[12]=a):a=e[12],a}default:return null}}function wr(t){const e=R.c(91),{parts:s,isStreaming:o,onSubmit:r}=t;let i;e[0]!==s?(i=Ar(s.map(Ir)),e[0]=s,e[1]=i):i=e[1];const a=i;let l;e[2]!==s?(l=Object.fromEntries(s.map(Nr)),e[2]=s,e[3]=l):l=e[3];const V=l;let d;e[4]!==r?(d=($,F)=>{const Q=ps(F);Q&&r($,Q)},e[4]=r,e[5]=d):d=e[5];let u;e[6]!==V||e[7]!==o||e[8]!==s||e[9]!==a||e[10]!==d?(u={parts:s,partKey:Cr,schema:a,defaultValues:V,isStreaming:o,hasAnswer:Sr,onSubmit:d},e[6]=V,e[7]=o,e[8]=s,e[9]=a,e[10]=d,e[11]=u):u=e[11];const c=Vs(u),p=c.currentPart,f=B();let m;e[12]!==p||e[13]!==c||e[14]!==f?(m=()=>{const $=p;if(!$)return;const F=f("chat.userAskQuestion.skipMessage"),Q=$.toolCallId;$.input?.type==="choice"?(c.form.setValue(`${Q}.option`,null),c.form.setValue(`${Q}.draft`,F)):c.form.setValue(`${Q}.response`,F),c.advanceToNextUnanswered()},e[12]=p,e[13]=c,e[14]=f,e[15]=m):m=e[15];const h=m;let g;e[16]!==c.currentIndex||e[17]!==c.goNext||e[18]!==c.goPrev||e[19]!==s.length?(g=n.jsx(as,{currentIndex:c.currentIndex,total:s.length,onPrev:c.goPrev,onNext:c.goNext}),e[16]=c.currentIndex,e[17]=c.goNext,e[18]=c.goPrev,e[19]=s.length,e[20]=g):g=e[20];const v=g;let x;e[21]!==f?(x=f("chat.userAskQuestion.skip"),e[21]=f,e[22]=x):x=e[22];let b;e[23]!==h||e[24]!==x?(b=n.jsx(Y,{type:"button",variant:"outline",size:"sm",onClick:h,className:"h-7",children:x}),e[23]=h,e[24]=x,e[25]=b):b=e[25];let A;e[26]!==c.isAllAnswered||e[27]!==c.isCurrentAnswered||e[28]!==c.submitOrAdvance||e[29]!==o?(A=n.jsx(or,{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]=A):A=e[30];let j;e[31]!==b||e[32]!==A?(j=n.jsxs(n.Fragment,{children:[b,A]}),e[31]=b,e[32]=A,e[33]=j):j=e[33];const k=j;if(s.length===1){const $=s[0];if(!$?.input)return null;const F=c.form;let Q;e[34]!==c?(Q=ae=>{ae.preventDefault(),c.submit()},e[34]=c,e[35]=Q):Q=e[35];let Z;e[36]===Symbol.for("react.memo_cache_sentinel")?(Z=n.jsx(st,{size:14}),e[36]=Z):Z=e[36];let se;e[37]!==f?(se=f("chat.userAskQuestion.questionPending"),e[37]=f,e[38]=se):se=e[38];let X;e[39]!==$.input?.prompt||e[40]!==f?(X=$.input?.prompt??f("chat.userAskQuestion.question"),e[39]=$.input?.prompt,e[40]=f,e[41]=X):X=e[41];const D=$.input;let K;e[42]!==c.form.control||e[43]!==$.toolCallId||e[44]!==D?(K=n.jsx(Tt,{input:D,control:c.form.control,toolCallId:$.toolCallId}),e[42]=c.form.control,e[43]=$.toolCallId,e[44]=D,e[45]=K):K=e[45];let H;e[46]!==k||e[47]!==se||e[48]!==X||e[49]!==K?(H=n.jsx(pe,{icon:Z,label:se,title:X,defaultExpanded:!0,footerRight:k,children:K}),e[46]=k,e[47]=se,e[48]=X,e[49]=K,e[50]=H):H=e[50];let ee;e[51]!==Q||e[52]!==H?(ee=n.jsx("form",{onSubmit:Q,autoComplete:"off",children:H}),e[51]=Q,e[52]=H,e[53]=ee):ee=e[53];let J;return e[54]!==c.form||e[55]!==ee?(J=n.jsx(nt,{...F,children:ee}),e[54]=c.form,e[55]=ee,e[56]=J):J=e[56],J}const y=c.form;let w;e[57]!==c?(w=$=>{$.preventDefault(),c.submit()},e[57]=c,e[58]=w):w=e[58];let C;e[59]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(st,{size:14}),e[59]=C):C=e[59];let S;e[60]!==f?(S=f("chat.userAskQuestion.questionPending"),e[60]=f,e[61]=S):S=e[61];const I=c.currentIndex+1;let N;e[62]!==s.length||e[63]!==f||e[64]!==I?(N=f("chat.userAskQuestion.questionCount",{current:I,total:s.length}),e[62]=s.length,e[63]=f,e[64]=I,e[65]=N):N=e[65];let T;e[66]!==p?.input?.prompt||e[67]!==f?(T=p?.input?.prompt??f("chat.userAskQuestion.question"),e[66]=p?.input?.prompt,e[67]=f,e[68]=T):T=e[68];const _=c.activeKey,E=c.setActiveKey;let U;if(e[69]!==c.form||e[70]!==s){let $;e[72]!==c.form?($=F=>n.jsx(Kn,{value:F.toolCallId,className:"mt-0",children:n.jsx(Tt,{input:F.input,control:c.form.control,toolCallId:F.toolCallId})},F.toolCallId),e[72]=c.form,e[73]=$):$=e[73],U=s.map($),e[69]=c.form,e[70]=s,e[71]=U}else U=e[71];let M;e[74]!==c.activeKey||e[75]!==c.setActiveKey||e[76]!==U?(M=n.jsx(qn,{value:_,onValueChange:E,children:U}),e[74]=c.activeKey,e[75]=c.setActiveKey,e[76]=U,e[77]=M):M=e[77];let L;e[78]!==v||e[79]!==k||e[80]!==S||e[81]!==N||e[82]!==T||e[83]!==M?(L=n.jsx(pe,{icon:C,label:S,count:N,title:T,defaultExpanded:!0,footerLeft:v,footerRight:k,children:M}),e[78]=v,e[79]=k,e[80]=S,e[81]=N,e[82]=T,e[83]=M,e[84]=L):L=e[84];let z;e[85]!==w||e[86]!==L?(z=n.jsx("form",{onSubmit:w,autoComplete:"off",children:L}),e[85]=w,e[86]=L,e[87]=z):z=e[87];let W;return e[88]!==c.form||e[89]!==z?(W=n.jsx(nt,{...y,children:z}),e[88]=c.form,e[89]=z,e[90]=W):W=e[90],W}function Sr(t){return!!ps(t)}function Cr(t){return t.toolCallId}function Nr(t){return t.input?.type==="choice"?[t.toolCallId,{option:null,draft:""}]:[t.toolCallId,{response:""}]}function Ir(t){return{toolCallId:t.toolCallId,input:t.input}}function Tr(){const t=R.c(5),e=B();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(st,{className:"size-5 text-muted-foreground shimmer"}),t[0]=s):s=t[0];let o;t[1]!==e?(o=e("chat.userAskQuestion.preparingQuestion"),t[1]=e,t[2]=o):o=t[2];let r;return t[3]!==o?(r=n.jsxs("div",{className:"flex items-center gap-2 p-4 border border-dashed rounded-lg bg-accent/50 w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",children:[s,n.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:o})]}),t[3]=o,t[4]=r):r=t[4],r}function hs(t){const e=R.c(7),{userAskParts:s,isStreaming:o,onSubmit:r}=t;let i;e[0]!==s?(i=s.filter(_r),e[0]=s,e[1]=i):i=e[1];const a=i;if(a.length===0){if(o){let V;return e[2]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsx(Tr,{}),e[2]=V):V=e[2],V}return null}let l;return e[3]!==o||e[4]!==r||e[5]!==a?(l=n.jsx(wr,{parts:a,isStreaming:o,onSubmit:r}),e[3]=o,e[4]=r,e[5]=a,e[6]=l):l=e[6],l}function _r(t){return t.state==="input-available"}function Mr(t){const e=R.c(33),{parts:s,isStreaming:o,onRespond:r}=t,i=B();let a;e[0]!==s?(a=s.at(-1),e[0]=s,e[1]=a):a=e[1];const l=a,V=l?.input;if(!l||!V?.title)return null;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(Bt,{size:14}),e[2]=d):d=e[2];let u;e[3]!==i?(u=i("chat.suggestTask.label"),e[3]=i,e[4]=u):u=e[4];const c=V.title;let p;e[5]!==r||e[6]!==l?(p=()=>r(l,!1),e[5]=r,e[6]=l,e[7]=p):p=e[7];let f;e[8]!==i?(f=i("chat.suggestTask.notNow"),e[8]=i,e[9]=f):f=e[9];let m;e[10]!==o||e[11]!==p||e[12]!==f?(m=n.jsx(Y,{type:"button",size:"sm",variant:"outline",className:"h-7",disabled:o,onClick:p,children:f}),e[10]=o,e[11]=p,e[12]=f,e[13]=m):m=e[13];let h;e[14]!==r||e[15]!==l?(h=()=>r(l,!0),e[14]=r,e[15]=l,e[16]=h):h=e[16];let g;e[17]!==i?(g=i("chat.suggestTask.create"),e[17]=i,e[18]=g):g=e[18];let v;e[19]!==o||e[20]!==h||e[21]!==g?(v=n.jsx(Y,{type:"button",size:"sm",className:"h-7",disabled:o,onClick:h,children:g}),e[19]=o,e[20]=h,e[21]=g,e[22]=v):v=e[22];let x;e[23]!==v||e[24]!==m?(x=n.jsxs(n.Fragment,{children:[m,v]}),e[23]=v,e[24]=m,e[25]=x):x=e[25];let b;e[26]!==V.summary?(b=V.summary?n.jsx("p",{className:"px-4 pb-1 text-sm leading-snug text-muted-foreground whitespace-pre-wrap",children:V.summary}):null,e[26]=V.summary,e[27]=b):b=e[27];let A;return e[28]!==V.title||e[29]!==x||e[30]!==b||e[31]!==u?(A=n.jsx(pe,{icon:d,label:u,title:c,defaultExpanded:!0,footerRight:x,children:b}),e[28]=V.title,e[29]=x,e[30]=b,e[31]=u,e[32]=A):A=e[32],A}function Dr(t){const e=t.filter(i=>i.status==="in_progress"),s=t.filter(i=>i.status==="completed").length,o=t.length;if(o>0&&s===o)return{icon:"completed",activity:"All done",progress:`${o}/${o}`};const[r]=e;return r&&e.length===1?{icon:"in_progress",activity:r.activeForm,progress:`${s}/${o} done`}:e.length>1?{icon:"in_progress",activity:`${e.length} in progress`,progress:`${s}/${o} done`}:s>0?{icon:"pending",activity:`${o-s} pending`,progress:`${s}/${o} done`}:{icon:"pending",activity:`${o} todos`,progress:"not started"}}function Rr(t){const e=R.c(13),{todos:s}=t;if(s.length===0)return null;let o;e[0]!==s?(o=Dr(s),e[0]=s,e[1]=o):o=e[1];const r=o;let i;e[2]!==r.icon?(i=n.jsx(Lr,{status:r.icon}),e[2]=r.icon,e[3]=i):i=e[3];const a=r.activity,l=r.progress;let V;e[4]!==s?(V=s.map(Er),e[4]=s,e[5]=V):V=e[5];let d;e[6]!==V?(d=n.jsx("ul",{"data-testid":"todos-list",className:"flex flex-col px-2 max-h-[40vh] overflow-y-auto",children:V}),e[6]=V,e[7]=d):d=e[7];let u;return e[8]!==r.activity||e[9]!==r.progress||e[10]!==i||e[11]!==d?(u=n.jsx(pe,{icon:i,label:a,count:l,defaultExpanded:!1,children:d}),e[8]=r.activity,e[9]=r.progress,e[10]=i,e[11]=d,e[12]=u):u=e[12],u}function Er(t,e){return n.jsx(Pr,{todo:t},e)}function Pr(t){const e=R.c(14),{todo:s}=t,o=s.status==="completed",i=s.status==="in_progress"?s.activeForm:s.content;let a;e[0]!==s.status?(a=n.jsx(Ur,{status:s.status}),e[0]=s.status,e[1]=a):a=e[1];const l=o&&"text-muted-foreground";let V;e[2]!==l?(V=O("relative text-sm leading-snug pt-px select-none",l),e[2]=l,e[3]=V):V=e[3];const d=o?"100%":"0%",u=o?"width 300ms ease 200ms":"width 150ms ease";let c;e[4]!==d||e[5]!==u?(c=n.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:"50%",height:"1px",background:"currentColor",width:d,transition:u}}),e[4]=d,e[5]=u,e[6]=c):c=e[6];let p;e[7]!==i||e[8]!==V||e[9]!==c?(p=n.jsxs("span",{className:V,children:[i,c]}),e[7]=i,e[8]=V,e[9]=c,e[10]=p):p=e[10];let f;return e[11]!==a||e[12]!==p?(f=n.jsxs("li",{className:"flex items-start gap-2.5 px-2 py-1.5 rounded-lg hover:bg-accent/50 transition-colors",children:[a,p]}),e[11]=a,e[12]=p,e[13]=f):f=e[13],f}function Ur(t){const e=R.c(4),{status:s}=t,o=s==="completed"?"true":void 0,r=s==="in_progress"?"true":void 0;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("svg",{viewBox:"0 0 21 21",children:n.jsx("path",{d:"M5,10.75 L8.5,14.25 L19.4,2.3 C18.8333333,1.43333333 18.0333333,1 17,1 L4,1 C2.35,1 1,2.35 1,4 L1,17 C1,18.65 2.35,20 4,20 L17,20 C18.65,20 20,18.65 20,17 L20,7.99769186"})}),e[0]=i):i=e[0];let a;return e[1]!==o||e[2]!==r?(a=n.jsx("div",{className:"todo-cb mt-0.5","data-checked":o,"data-progress":r,"aria-hidden":"true",children:i}),e[1]=o,e[2]=r,e[3]=a):a=e[3],a}function Lr(t){const e=R.c(13),{status:s}=t,o=B();if(s==="completed"){let a;e[0]!==o?(a=o("chat.todoStatus.completed"),e[0]=o,e[1]=a):a=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx("svg",{viewBox:"0 0 10 8",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",className:"w-2 h-2 text-primary-foreground",style:{strokeWidth:2},children:n.jsx("path",{d:"M1 4l2.5 2.5L9 1"})}),e[2]=l):l=e[2];let V;return e[3]!==a?(V=n.jsx("span",{"aria-label":a,className:"inline-flex items-center justify-center w-3.5 h-3.5 rounded-sm bg-primary",children:l}),e[3]=a,e[4]=V):V=e[4],V}if(s==="in_progress"){let a;e[5]!==o?(a=o("chat.todoStatus.inProgress"),e[5]=o,e[6]=a):a=e[6];let l;return e[7]!==a?(l=n.jsx("span",{"aria-label":a,className:"inline-block w-2 h-2 rounded-full bg-primary animate-pulse shrink-0"}),e[7]=a,e[8]=l):l=e[8],l}let r;e[9]!==o?(r=o("chat.todoStatus.pending"),e[9]=o,e[10]=r):r=e[10];let i;return e[11]!==r?(i=n.jsx("span",{"aria-label":r,className:"inline-block w-3.5 h-3.5 rounded-sm border-[1.5px] border-muted-foreground/50 shrink-0"}),e[11]=r,e[12]=i):i=e[12],i}const Fr={usd:[{dollars:10,labelKey:"credits.topUp.starter"},{dollars:20,labelKey:"credits.topUp.popular"},{dollars:100,labelKey:"credits.topUp.bestValue"}],brl:[{dollars:50,labelKey:"credits.topUp.starter"},{dollars:100,labelKey:"credits.topUp.popular"},{dollars:500,labelKey:"credits.topUp.bestValue"}]},zr={"credits.topUp.starter":"starter","credits.topUp.popular":"popular","credits.topUp.bestValue":"best_value"};function Or(t){const e=R.c(46),{source:s,onDone:o}=t,r=B(),i=Ns(),[a]=Se(),[l,V]=P.useState(a.language==="pt-BR"?"brl":"usd"),[d,u]=P.useState(""),[c,p]=P.useState(!1),f=l==="brl"?"R$":"$";let m;e[0]!==l||e[1]!==i?(m=async M=>{const{url:L}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:M,currency:l});return L},e[0]=l,e[1]=i,e[2]=m):m=e[2];let h;e[3]!==o?(h=M=>{M&&window.open(M,"_blank","noopener,noreferrer"),o?.()},e[3]=o,e[4]=h):h=e[4];let g;e[5]!==r?(g=M=>{Ee.error(r("credits.topUp.failed",{message:M.message}))},e[5]=r,e[6]=g):g=e[6];let v;e[7]!==m||e[8]!==h||e[9]!==g?(v={mutationFn:m,onSuccess:h,onError:g},e[7]=m,e[8]=h,e[9]=g,e[10]=v):v=e[10];const{mutate:x,isPending:b}=Is(v);let A;e[11]!==l||e[12]!==s||e[13]!==x?(A=(M,L)=>{te("credits_topup_clicked",{amount_cents:M,currency:l,tier_label:L,source:s}),x(M)},e[11]=l,e[12]=s,e[13]=x,e[14]=A):A=e[14];const j=A,k=parseFloat(d),y=!isNaN(k)&&k>=1;let w,C,S;e[15]===Symbol.for("react.memo_cache_sentinel")?(w=M=>{M&&V(M)},C=n.jsx(yt,{value:"usd",className:"h-8 px-3 text-xs",children:"USD"}),S=n.jsx(yt,{value:"brl",className:"h-8 px-3 text-xs",children:"BRL"}),e[15]=w,e[16]=C,e[17]=S):(w=e[15],C=e[16],S=e[17]);let I;e[18]!==l?(I=n.jsx("div",{className:"mb-4",children:n.jsxs(so,{type:"single",variant:"outline",size:"sm",value:l,onValueChange:w,children:[C,S]})}),e[18]=l,e[19]=I):I=e[19];const N=Fr[l];let T;if(e[20]!==j||e[21]!==f||e[22]!==b||e[23]!==r||e[24]!==N){let M;e[26]!==j||e[27]!==f||e[28]!==b||e[29]!==r?(M=L=>{const{dollars:z,labelKey:W}=L;return n.jsxs("button",{type:"button",disabled:b,onClick:()=>j(z*100,zr[W]??"preset"),className:O("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:[n.jsxs("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:[f,z]}),n.jsx("span",{className:"text-xs text-muted-foreground",children:r(W)})]},z)},e[26]=j,e[27]=f,e[28]=b,e[29]=r,e[30]=M):M=e[30],T=N.map(M),e[20]=j,e[21]=f,e[22]=b,e[23]=r,e[24]=N,e[25]=T}else T=e[25];let _;e[31]!==T?(_=n.jsx("div",{className:"grid grid-cols-3 gap-2.5",children:T}),e[31]=T,e[32]=_):_=e[32];let E;e[33]!==j||e[34]!==f||e[35]!==d||e[36]!==k||e[37]!==y||e[38]!==b||e[39]!==c||e[40]!==r?(E=c?n.jsxs("div",{className:"flex gap-2 mt-3",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:f}),n.jsx(to,{type:"number",min:"1",step:"1",placeholder:r("credits.topUp.customPlaceholder"),value:d,onChange:M=>u(M.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),n.jsx(Y,{className:"h-10",disabled:!y||b,onClick:()=>j(Math.round(k*100),"custom"),children:r(b?"credits.topUp.opening":"credits.topUp.add")})]}):n.jsx("button",{type:"button",className:"w-full mt-3 text-xs text-muted-foreground hover:text-foreground transition-colors py-1",onClick:()=>p(!0),children:r("credits.topUp.enterCustom")}),e[33]=j,e[34]=f,e[35]=d,e[36]=k,e[37]=y,e[38]=b,e[39]=c,e[40]=r,e[41]=E):E=e[41];let U;return e[42]!==_||e[43]!==E||e[44]!==I?(U=n.jsxs("div",{children:[I,_,E]}),e[42]=_,e[43]=E,e[44]=I,e[45]=U):U=e[45],U}const $r=["chat.creditsExhaustedBanner.benefit1","chat.creditsExhaustedBanner.benefit2","chat.creditsExhaustedBanner.benefit3"];function Br(t){const e=R.c(47),{onDismiss:s}=t,{org:o}=Ce(),r=rt(),{decoKeyId:i}=eo(),a=B(),l=ze("credits");let V,d;if(e[0]!==o.id?(V=()=>{te("credits_exhausted_shown",{organization_id:o.id})},d=[o.id],e[0]=o.id,e[1]=V,e[2]=d):(V=e[1],d=e[2]),P.useEffect(V,d),!l)return null;let u;e[3]!==s?(u=N=>!N&&s?.(),e[3]=s,e[4]=u):u=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=["radial-gradient(ellipse 40% 200% at -5% 100%, rgba(165,149,255,0.5) 0%, transparent 100%)","radial-gradient(ellipse 40% 200% at 105% -10%, rgba(208,236,26,0.45) 0%, transparent 100%)"],e[5]=c):c=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx("div",{className:"absolute inset-x-0 top-0 h-36 pointer-events-none",style:{backgroundImage:c.join(", "),maskImage:"linear-gradient(to bottom, black 0%, transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black 0%, transparent 100%)"}}),e[6]=p):p=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),e[7]=f):f=e[7];let m;e[8]!==a?(m=a("chat.creditsExhaustedBanner.title"),e[8]=a,e[9]=m):m=e[9];let h;e[10]!==m?(h=n.jsx(Qn,{className:"text-xl font-semibold tracking-tight",children:m}),e[10]=m,e[11]=h):h=e[11];let g;e[12]!==a?(g=a("chat.creditsExhaustedBanner.description"),e[12]=a,e[13]=g):g=e[13];let v;e[14]!==g?(v=n.jsx(Wn,{className:"mt-1.5 text-sm leading-relaxed",children:g}),e[14]=g,e[15]=v):v=e[15];let x;e[16]!==v||e[17]!==h?(x=n.jsxs("div",{className:"relative px-8 pt-8 pb-2 overflow-hidden",children:[p,n.jsxs(Yn,{className:"relative gap-4",children:[f,n.jsxs("div",{children:[h,v]})]})]}),e[16]=v,e[17]=h,e[18]=x):x=e[18];let b;e[19]!==i||e[20]!==s||e[21]!==a?(b=i&&n.jsxs("div",{className:"px-8 pt-5 pb-6",children:[n.jsx("div",{className:"rounded-xl border border-border p-5",children:n.jsx(Or,{source:"exhausted_banner",onDone:s})}),n.jsx("div",{className:"mt-5 rounded-xl bg-muted/25 border border-border/50 p-4 space-y-3",children:$r.map(N=>n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"flex items-center justify-center size-5 rounded-full bg-success/15 shrink-0",children:n.jsx(it,{size:12,className:"text-success"})}),n.jsx("span",{className:"text-sm text-foreground/80",children:a(N)})]},N))})]}),e[19]=i,e[20]=s,e[21]=a,e[22]=b):b=e[22];let A;e[23]!==a?(A=a("chat.creditsExhaustedBanner.dismiss"),e[23]=a,e[24]=A):A=e[24];let j;e[25]!==s||e[26]!==A?(j=n.jsx(Y,{variant:"ghost",size:"sm",onClick:s,children:A}),e[25]=s,e[26]=A,e[27]=j):j=e[27];let k;e[28]!==r||e[29]!==s||e[30]!==o.slug?(k=()=>{r({to:"/$org/settings/ai-providers",params:{org:o.slug}}),s?.()},e[28]=r,e[29]=s,e[30]=o.slug,e[31]=k):k=e[31];let y;e[32]!==a?(y=a("chat.creditsExhaustedBanner.manageProviders"),e[32]=a,e[33]=y):y=e[33];let w;e[34]!==k||e[35]!==y?(w=n.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:k,children:y}),e[34]=k,e[35]=y,e[36]=w):w=e[36];let C;e[37]!==j||e[38]!==w?(C=n.jsxs("div",{className:"px-8 py-4 border-t border-border bg-muted/30 flex items-center justify-between",children:[j,w]}),e[37]=j,e[38]=w,e[39]=C):C=e[39];let S;e[40]!==x||e[41]!==b||e[42]!==C?(S=n.jsxs(Gn,{className:"sm:max-w-[520px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:Kr,children:[x,b,C]}),e[40]=x,e[41]=b,e[42]=C,e[43]=S):S=e[43];let I;return e[44]!==S||e[45]!==u?(I=n.jsx(Hn,{open:!0,onOpenChange:u,children:S}),e[44]=S,e[45]=u,e[46]=I):I=e[46],I}function Kr(t){return t.preventDefault()}const qr={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 Qr(t){const e=R.c(16),{kind:s,onDismiss:o,onSubscribe:r}=t,i=B(),{label:a,title:l}=qr[s];let V;e[0]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsx(at,{size:14}),e[0]=V):V=e[0];let d;e[1]!==a||e[2]!==i?(d=i(a),e[1]=a,e[2]=i,e[3]=d):d=e[3];let u;e[4]!==i||e[5]!==l?(u=i(l),e[4]=i,e[5]=l,e[6]=u):u=e[6];let c;e[7]!==s||e[8]!==r||e[9]!==i?(c=s==="trial_exhausted"?n.jsx(Y,{size:"sm",onClick:r,className:"h-7 text-xs",children:i("chat.subscriptionLimit.subscribeButton")}):void 0,e[7]=s,e[8]=r,e[9]=i,e[10]=c):c=e[10];let p;return e[11]!==o||e[12]!==d||e[13]!==u||e[14]!==c?(p=n.jsx(pe,{icon:V,label:d,title:u,defaultExpanded:!0,variant:"warning",onClose:o,footerRight:c}),e[11]=o,e[12]=d,e[13]=u,e[14]=c,e[15]=p):p=e[15],p}const Wr={ai_budget_exhausted:{label:"chat.planRefused.budgetLabel",title:"chat.planRefused.budgetTitle"},feature_not_in_plan:{label:"chat.planRefused.featureLabel",title:"chat.planRefused.featureTitle"}};function _t(t){const e=R.c(21),{kind:s,onDismiss:o}=t,r=B(),i=rt(),{org:a}=Ce(),{label:l,title:V}=Wr[s];let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(at,{size:14}),e[0]=d):d=e[0];let u;e[1]!==l||e[2]!==r?(u=r(l),e[1]=l,e[2]=r,e[3]=u):u=e[3];let c;e[4]!==r||e[5]!==V?(c=r(V),e[4]=r,e[5]=V,e[6]=c):c=e[6];let p;e[7]!==i||e[8]!==o||e[9]!==a.slug?(p=()=>{i({to:"/$org/settings/ai-providers",params:{org:a.slug}}),o()},e[7]=i,e[8]=o,e[9]=a.slug,e[10]=p):p=e[10];let f;e[11]!==r?(f=r("chat.planRefused.seePlans"),e[11]=r,e[12]=f):f=e[12];let m;e[13]!==p||e[14]!==f?(m=n.jsx(Y,{size:"sm",className:"h-7 text-xs",onClick:p,children:f}),e[13]=p,e[14]=f,e[15]=m):m=e[15];let h;return e[16]!==o||e[17]!==u||e[18]!==c||e[19]!==m?(h=n.jsx(pe,{icon:d,label:u,title:c,defaultExpanded:!0,variant:"warning",onClose:o,footerRight:m}),e[16]=o,e[17]=u,e[18]=c,e[19]=m,e[20]=h):h=e[20],h}function ms(t){const e=Yr(t);if(e!==null){const d=ms(e);return{summary:d.summary,rawDetails:d.rawDetails??t}}const s=t.trim(),o=s.startsWith("<")&&/<[a-z][\s\S]*>/i.test(s),r=/cloudflare|cf-[a-z-]+|error[\s_-]?code[\s_-]?5\d\d/i.test(s),i=/failed to fetch|networkerror|load failed|offline/i.test(s),a=/timeout|timed out|aborted|deadline/i.test(s),l=s.length>240,V=/sandbox failed to start(?::\s*(.+))?/is.exec(s);if(V){const d=V[1]?.trim().replace(/\.$/,"");return{summary:d?`Your sandbox didn't finish starting up (${d}). Try again.`:"Your sandbox didn't finish starting up. Try again.",rawDetails:t}}return r||o&&l?{summary:"Our servers are having a moment. Try sending again in a few seconds.",rawDetails:t}:i?{summary:"Lost connection. Check your network and try again.",rawDetails:t}:a?{summary:"That took longer than expected. Try again.",rawDetails:t}:o||l?{summary:"Something unexpected came back from the server. Try again.",rawDetails:t}:{summary:t,rawDetails:null}}function Yr(t){const e=t.trim();if(!e.startsWith("{"))return null;let s;try{s=JSON.parse(e)}catch{return null}if(!s||typeof s!="object")return null;const{error:o,message:r}=s,i=typeof o=="string"?o:r;return typeof i=="string"&&i.trim()&&!i.trim().startsWith("{")?i:null}const Gr={length:"chat.highlight.warningDescriptionLength","content-filter":"chat.highlight.warningDescriptionContentFilter","tool-calls":"chat.highlight.warningDescriptionToolCalls"};function Qe(t){const e=R.c(29),s=B(),{variant:o,onDismiss:r}=t,i=o==="error";let a;e[0]!==i||e[1]!==s?(a=s(i?"chat.highlight.errorOccurred":"chat.highlight.responseIncomplete"),e[0]=i,e[1]=s,e[2]=a):a=e[2];const l=a,V=i?Rn:_s;let d;e[3]!==t.error||e[4]!==t.finishReason||e[5]!==t.variant||e[6]!==s?(d=t.variant==="error"?t.error.message:(()=>{const x=Gr[t.finishReason];return x?s(x):s("chat.highlight.responseStoppedUnexpectedly",{reason:t.finishReason})})(),e[3]=t.error,e[4]=t.finishReason,e[5]=t.variant,e[6]=s,e[7]=d):d=e[7];const u=d;let c;e[8]!==i||e[9]!==u?(c=i?ms(u):{summary:u,rawDetails:null},e[8]=i,e[9]=u,e[10]=c):c=e[10];const{summary:p,rawDetails:f}=c;let m;e[11]!==V?(m=n.jsx(V,{size:14}),e[11]=V,e[12]=m):m=e[12];let h;e[13]!==i||e[14]!==t.onContinue||e[15]!==t.onFixInChat||e[16]!==s?(h=i?n.jsx(Y,{size:"sm",variant:"outline",onClick:t.onFixInChat,className:"h-7 text-xs",children:s("chat.highlight.fixInChat")}):n.jsx(Y,{size:"sm",variant:"outline",onClick:t.onContinue,className:"h-7 text-xs",children:s("chat.highlight.continue")}),e[13]=i,e[14]=t.onContinue,e[15]=t.onFixInChat,e[16]=s,e[17]=h):h=e[17];let g;e[18]!==f||e[19]!==s?(g=f?n.jsxs("details",{className:"group mx-4",children:[n.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-1.5 text-xs text-muted-foreground transition-colors hover:text-foreground [&::-webkit-details-marker]:hidden",children:[n.jsx("svg",{"aria-hidden":"true",className:"size-3 transition-transform group-open:rotate-90",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"m4.5 3 3 3-3 3"})}),n.jsx("span",{className:"group-open:hidden",children:s("chat.highlight.showTechnicalDetails")}),n.jsx("span",{className:"hidden group-open:inline",children:s("chat.highlight.hideTechnicalDetails")})]}),n.jsxs("div",{className:"relative mt-2",children:[n.jsx("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(f).then(()=>Ee.success(s("chat.highlight.copiedToClipboard"))).catch(()=>Ee.error(s("chat.highlight.couldNotCopy")))},"aria-label":s("chat.highlight.copyErrorDetails"),title:s("chat.highlight.copy"),className:"absolute right-1.5 top-1.5 z-10 flex h-6 w-6 items-center justify-center rounded-lg bg-background/80 text-muted-foreground backdrop-blur-sm transition-colors hover:bg-background hover:text-foreground",children:n.jsx(En,{className:"size-3.5"})}),n.jsx("pre",{className:"max-h-40 overflow-auto rounded-md border border-border/60 bg-background px-3 py-2 pr-8 font-mono text-xs text-foreground/80 whitespace-pre-wrap break-all",children:f})]})]}):null,e[18]=f,e[19]=s,e[20]=g):g=e[20];let v;return e[21]!==l||e[22]!==r||e[23]!==p||e[24]!==m||e[25]!==h||e[26]!==g||e[27]!==o?(v=n.jsx(pe,{icon:m,label:l,title:p,defaultExpanded:!0,variant:o,onClose:r,footerRight:h,children:g}),e[21]=l,e[22]=r,e[23]=p,e[24]=m,e[25]=h,e[26]=g,e[27]=o,e[28]=v):v=e[28],v}function Oe(t){const e=R.c(77);let s;e[0]!==t?(s=t===void 0?{}:t,e[0]=t,e[1]=s):s=e[1];const{inline:o,voiceMode:r}=s,i=o===void 0?!1:o,a=r===void 0?!1:r,l=B(),{error:V,clearError:d,finishReason:u,clearFinishReason:c,messages:p,isStreaming:f,submit:m,sendMessage:h}=Fe(),[g,v]=Se(),{virtualMcpId:x,createTaskWithMessage:b}=Ye(),{chatMode:A,simpleModeTier:j}=Ge(),k=ze("credits"),{mutate:y}=ro("ORGANIZATION_BILLING_CHECKOUT_START","taskBoard.subscriptionPaywall.checkoutError");let w;e[2]!==y?(w=()=>y(),e[2]=y,e[3]=w):w=e[3];const C=w;let S;e[4]!==A||e[5]!==j||e[6]!==x||e[7]!==a?(S=oe=>({...a?{voiceMode:!0}:{},tier:j,mode:A,toolApprovalLevel:oe,agent:x?{id:x}:void 0}),e[4]=A,e[5]=j,e[6]=x,e[7]=a,e[8]=S):S=e[8];const I=S;let N;e[9]!==g.toolApprovalLevel?(N=g.toolApprovalLevel??Ts(),e[9]=g.toolApprovalLevel,e[10]=N):N=e[10];const T=N,_=p.at(-1),E=_?.role==="assistant"?_.parts:[],U=E.filter(ei),M=E.filter(Xr),L=rs(E),z=ns(E);let W;e[11]!==V||e[12]!==h||e[13]!==l?(W=()=>{if(V){const ue={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:l("chat.highlight.fixInChatMessage",{error:V.message})}]}]};h(ue)}},e[11]=V,e[12]=h,e[13]=l,e[14]=W):W=e[14];const $=W;let F;e[15]!==h||e[16]!==l?(F=()=>{const oe={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:l("chat.highlight.pleaseContinue")}]}]};h(oe)},e[15]=h,e[16]=l,e[17]=F):F=e[17];const Q=F;let Z;e[18]!==I||e[19]!==T||e[20]!==m?(Z=(oe,ue)=>{m({kind:"toolOutput",toolCallId:oe.toolCallId,output:{response:ue}},I(T))},e[18]=I,e[19]=T,e[20]=m,e[21]=Z):Z=e[21];const se=Z;let X;e[22]!==I||e[23]!==T||e[24]!==m?(X=(oe,ue)=>{m({kind:"toolOutput",toolCallId:oe.toolCallId,output:{accepted:ue}},I(T))},e[22]=I,e[23]=T,e[24]=m,e[25]=X):X=e[25];const D=X;let K;e[26]!==b||e[27]!==g||e[28]!==v||e[29]!==l||e[30]!==x?(K=oe=>{v({...g,toolApprovalLevel:"auto"}),b({virtualMcpId:x,message:{parts:[{type:"text",text:l("chat.highlight.implementPlanMessage",{plan:oe})}]}})},e[26]=b,e[27]=g,e[28]=v,e[29]=l,e[30]=x,e[31]=K):K=e[31];const H=K,ee=Zr;let J;e[32]!==I||e[33]!==m?(J=(oe,ue,Be,be)=>{m({kind:"approval",approvalId:oe,approved:ue,...Be?{reason:Be}:{}},I(be))},e[32]=I,e[33]=m,e[34]=J):J=e[34];const ae=J,G=is();if(G.isCreditExhausted){let oe;return e[35]!==k||e[36]!==d||e[37]!==i?(oe=k?n.jsx(Br,{onDismiss:d}):n.jsx("div",{className:O(!i&&"absolute bottom-full left-0 right-0"),children:n.jsx(_t,{kind:"ai_budget_exhausted",onDismiss:d})}),e[35]=k,e[36]=d,e[37]=i,e[38]=oe):oe=e[38],oe}const{showError:ce,showWarning:ie,hasApprovals:fe}=G,le=U.map(Jr).join("|"),$e=os(L)?.toolCallId??"",ft=z.map(Hr).join("|"),Ne=!i&&"absolute bottom-full left-0 right-0";let Ve;e[39]!==Ne?(Ve=O(Ne),e[39]=Ne,e[40]=Ve):Ve=e[40];let he;e[41]!==G.todos?(he=n.jsx(Rr,{todos:G.todos}),e[41]=G.todos,e[42]=he):he=e[42];let ge;e[43]!==d||e[44]!==G.subscriptionErrorKind||e[45]!==C?(ge=G.subscriptionErrorKind&&n.jsx(Qr,{kind:G.subscriptionErrorKind,onDismiss:d,onSubscribe:C}),e[43]=d,e[44]=G.subscriptionErrorKind,e[45]=C,e[46]=ge):ge=e[46];let de;e[47]!==d||e[48]!==G.planRefusal?(de=G.planRefusal&&n.jsx(_t,{kind:G.planRefusal,onDismiss:d}),e[47]=d,e[48]=G.planRefusal,e[49]=de):de=e[49];let xe;e[50]!==d||e[51]!==V||e[52]!==$||e[53]!==ce?(xe=ce&&n.jsx(Qe,{variant:"error",error:V,onDismiss:d,onFixInChat:$}),e[50]=d,e[51]=V,e[52]=$,e[53]=ce,e[54]=xe):xe=e[54];let je;e[55]!==c||e[56]!==u||e[57]!==Q||e[58]!==ie?(je=ie&&n.jsx(Qe,{variant:"warning",finishReason:u,onDismiss:c,onContinue:Q}),e[55]=c,e[56]=u,e[57]=Q,e[58]=ie,e[59]=je):je=e[59];const Ie=fe&&n.jsx(hr,{approvals:z,isStreaming:f,onRespond:ae},ft),_e=G.hasPlans&&n.jsx(gr,{plans:L,isStreaming:f,onApprove:H,onDismiss:ee},$e),Me=G.hasTaskSuggestion&&n.jsx(Mr,{parts:M,isStreaming:f,onRespond:D},M.at(-1)?.toolCallId??"");let ve;e[60]!==G.isWaitingForUserInput||e[61]!==se||e[62]!==f||e[63]!==le||e[64]!==U?(ve=G.isWaitingForUserInput&&n.jsx(hs,{userAskParts:U,isStreaming:f,onSubmit:se},le),e[60]=G.isWaitingForUserInput,e[61]=se,e[62]=f,e[63]=le,e[64]=U,e[65]=ve):ve=e[65];let ke;return e[66]!==Ve||e[67]!==he||e[68]!==ge||e[69]!==de||e[70]!==xe||e[71]!==je||e[72]!==Ie||e[73]!==_e||e[74]!==Me||e[75]!==ve?(ke=n.jsxs("div",{className:Ve,children:[he,ge,de,xe,je,Ie,_e,Me,ve]}),e[66]=Ve,e[67]=he,e[68]=ge,e[69]=de,e[70]=xe,e[71]=je,e[72]=Ie,e[73]=_e,e[74]=Me,e[75]=ve,e[76]=ke):ke=e[76],ke}function Hr(t){return t.approvalId}function Jr(t){return t.toolCallId}function Zr(){document.querySelector("[data-chat-input]")?.focus()}function Xr(t){return t.type==="tool-suggest_task"&&t.state==="input-available"}function ei(t){return t.type==="tool-user_ask"}Oe.Error=function(e){return n.jsx(Qe,{variant:"error",error:e.error,onDismiss:e.onDismiss,onFixInChat:e.onFixInChat})};Oe.Warning=function(e){return n.jsx(Qe,{variant:"warning",finishReason:e.finishReason,onDismiss:e.onDismiss,onContinue:e.onContinue})};Oe.UserAskQuestion=hs;function gs(t){const e=R.c(20),{taskId:s}=t,o=B(),r=xn(s),i=vn(r),a=bn(),{stop:l,removeLocalMessage:V}=Fe();if(i.length===0)return null;let d;e[0]!==o?(d=o("chat.queueTray.sendNow"),e[0]=o,e[1]=d):d=e[1];let u;e[2]!==l?(u=()=>{l()},e[2]=l,e[3]=u):u=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(Ot,{size:14}),e[4]=c):c=e[4];let p;e[5]!==d||e[6]!==u?(p=n.jsx(He,{asChild:!0,children:n.jsx(Y,{type:"button",variant:"ghost",size:"icon-sm","aria-label":d,onClick:u,children:c})}),e[5]=d,e[6]=u,e[7]=p):p=e[7];let f;e[8]!==o?(f=o("chat.queueTray.sendNow"),e[8]=o,e[9]=f):f=e[9];let m;e[10]!==f?(m=n.jsx(Je,{side:"top",children:n.jsx("p",{className:"text-xs",children:f})}),e[10]=f,e[11]=m):m=e[11];let h;e[12]!==p||e[13]!==m?(h=n.jsxs(Ze,{delayDuration:400,children:[p,m]}),e[12]=p,e[13]=m,e[14]=h):h=e[14];let g;return e[15]!==a||e[16]!==V||e[17]!==o||e[18]!==s?(g=(v,x)=>n.jsxs("div",{className:"group/queuerow flex items-center gap-2 px-3 py-1.5",children:[n.jsx("span",{className:"flex size-[18px] shrink-0 items-center justify-center rounded-full bg-muted text-[10px] font-semibold text-muted-foreground dark:bg-background",children:x+1}),n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:v.text}),n.jsx("div",{className:"flex shrink-0 items-center gap-1 opacity-0 transition-opacity focus-within:opacity-100 group-hover/queuerow:opacity-100",children:n.jsx(Y,{type:"button",variant:"ghost",size:"icon-sm",title:o("chat.queueTray.removeFromQueue"),"aria-label":o("chat.queueTray.removeFromQueue"),onClick:()=>{a.cancel(s,v.messageId).then(b=>{b&&(An(s,v.messageId),V(v.messageId))})},children:n.jsx(io,{className:"size-3.5"})})})]},v.messageId),e[15]=a,e[16]=V,e[17]=o,e[18]=s,e[19]=g):g=e[19],n.jsxs("div",{className:"mb-1 overflow-hidden rounded-2xl border border-border bg-card dark:bg-muted",children:[n.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-border py-1.5 pr-2 pl-3 text-xs text-muted-foreground",children:[n.jsx("span",{children:o(i.length===1?"chat.queueTray.queuedMessage":"chat.queueTray.queuedMessages",{count:i.length})}),h]}),i.map(g)]})}function ti(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 si={fast:"chat.tierTrigger.tierFast",smart:"chat.tierTrigger.tierSmart",thinking:"chat.tierTrigger.tierThinking"};function ni(t){const e=R.c(31),{tier:s,orgSlot:o,userSlot:r,autoSlot:i,onPick:a,onReset:l,onClose:V}=t,d=B(),u=es(),c=new Set(u.map(oi)),p=yn([r,o,i],c),f=p?.keyId??null,[m,h]=P.useState(f??u[0]?.id??null),g=u.some(L=>L.id===m)?m:f??u[0]?.id??null,v=g?u.find(L=>L.id===g):null,x="flex h-[70vh] max-h-[460px] w-full flex-col",b=si[s];let A;e[0]!==d||e[1]!==b?(A=d(b),e[0]=d,e[1]=b,e[2]=A):A=e[2];let j;e[3]!==A?(j=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:A}),e[3]=A,e[4]=j):j=e[4];let k;e[5]!==l||e[6]!==d||e[7]!==r?(k=r&&n.jsx("button",{type:"button",onClick:l,className:"text-xs text-muted-foreground hover:text-foreground px-2 py-1 rounded-lg hover:bg-accent cursor-pointer",children:d("chat.modelPreferences.reset")}),e[5]=l,e[6]=d,e[7]=r,e[8]=k):k=e[8];let y;e[9]!==j||e[10]!==k?(y=n.jsxs("div",{className:"flex items-center justify-between px-3 h-8 shrink-0",children:[j,k]}),e[9]=j,e[10]=k,e[11]=y):y=e[11];const w="flex-1 min-h-0",C=P.Suspense;let S;e[12]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(ao,{}),e[12]=S):S=e[12];const I=vo,N=!0,T=ti(f?p:null,v?.providerId??"deco");let _;e[13]!==g||e[14]!==a||e[15]!==h?(_=L=>{const z=L.keyId??g??"";h(z),a({keyId:z,modelId:L.modelId,title:L.title})},e[13]=g,e[14]=a,e[15]=h,e[16]=_):_=e[16];let E;e[17]!==I||e[18]!==g||e[19]!==V||e[20]!==h||e[21]!==T||e[22]!==_?(E=n.jsx(I,{compact:N,onClose:V,credentialId:g,onCredentialChange:h,selectedModel:T,onModelChange:_}),e[17]=I,e[18]=g,e[19]=V,e[20]=h,e[21]=T,e[22]=_,e[23]=E):E=e[23];let U;e[24]!==C||e[25]!==E||e[26]!==S?(U=n.jsx("div",{className:w,children:n.jsx(C,{fallback:S,children:E})}),e[24]=C,e[25]=E,e[26]=S,e[27]=U):U=e[27];let M;return e[28]!==U||e[29]!==y?(M=n.jsxs("div",{className:x,children:[y,U]}),e[28]=U,e[29]=y,e[30]=M):M=e[30],M}function oi(t){return t.id}const ri=["fast","smart","thinking"];function xs(t){return{fast:t("chat.tierTrigger.tierFast"),smart:t("chat.tierTrigger.tierSmart"),thinking:t("chat.tierTrigger.tierThinking")}}const Mt={fast:"chat.agentModels.quickerResponses",smart:"chat.agentModels.balancedQuality",thinking:"chat.agentModels.deeperReasoning"};function ii(t){const e=R.c(28),{tier:s,pillIcon:o,groups:r}=t,i=B();let a;e[0]!==i?(a=xs(i),e[0]=i,e[1]=a):a=e[1];const l=a,[V,d]=P.useState(!1);let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=w=>{w.onSelect(),d(!1)},e[2]=u):u=e[2];const c=u,p=l[s];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=O("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),e[3]=f):f=e[3];let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=O("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]=m):m=e[4];const h=l[s];let g;e[5]!==h?(g=n.jsx("span",{className:m,children:h}),e[5]=h,e[6]=g):g=e[6];let v;e[7]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(Gt,{size:12,className:"opacity-60 hidden @[320px]/chat-bottom:inline-block"}),e[7]=v):v=e[7];let x;e[8]!==o||e[9]!==p||e[10]!==g?(x=n.jsx(He,{asChild:!0,children:n.jsx("span",{className:"inline-flex min-w-0 shrink",children:n.jsx(Ht,{asChild:!0,children:n.jsxs(Y,{type:"button",variant:"ghost",size:"default","aria-label":p,className:f,children:[o,g,v]})})})}),e[8]=o,e[9]=p,e[10]=g,e[11]=x):x=e[11];let b;e[12]!==p?(b=n.jsx(Je,{children:p}),e[12]=p,e[13]=b):b=e[13];let A;e[14]!==x||e[15]!==b?(A=n.jsxs(Ze,{children:[x,b]}),e[14]=x,e[15]=b,e[16]=A):A=e[16];let j;if(e[17]!==r||e[18]!==i){let w;e[20]!==i?(w=C=>n.jsx("div",{className:"flex flex-col",children:C.rows.map(S=>n.jsxs("div",{className:"group/tier-row relative flex items-stretch rounded-lg hover:bg-muted",children:[n.jsxs("button",{type:"button",role:"menuitem","aria-label":S.title,onClick:()=>c(S),className:O("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&&n.jsx("span",{className:"shrink-0 text-muted-foreground mt-0.5",children:S.icon}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"text-sm",children:S.title}),S.subtitle&&n.jsx("div",{className:"text-xs text-muted-foreground",children:S.subtitle})]}),S.active&&n.jsx("span",{title:i("chat.tierTrigger.selected"),children:n.jsx(it,{size:14,className:"text-foreground mt-0.5"})})]}),S.modelOverride&&n.jsx(li,{label:S.title,render:S.modelOverride})]},S.key))},C.key),e[20]=i,e[21]=w):w=e[21],j=r.map(w),e[17]=r,e[18]=i,e[19]=j}else j=e[19];let k;e[22]!==j?(k=n.jsx(Jt,{align:"end",className:"p-1 w-64",onOpenAutoFocus:ai,children:n.jsx("div",{role:"menu",className:"flex flex-col",children:j})}),e[22]=j,e[23]=k):k=e[23];let y;return e[24]!==V||e[25]!==A||e[26]!==k?(y=n.jsxs(Zt,{open:V,onOpenChange:d,children:[A,k]}),e[24]=V,e[25]=A,e[26]=k,e[27]=y):y=e[27],y}function ai(t){return t.preventDefault()}function li(t){const e=R.c(38),{label:s,render:o}=t,r=B(),i=Xt(),[a,l]=P.useState(!1);let V;e[0]===Symbol.for("react.memo_cache_sentinel")?(V=()=>l(!1),e[0]=V):V=e[0];const d=V;let u;e[1]!==s||e[2]!==r?(u=r("chat.modelPreferences.customizeModel",{tier:s}),e[1]=s,e[2]=r,e[3]=u):u=e[3];const c=a&&"opacity-100";let p;e[4]!==c?(p=O("absolute right-1 top-1/2 -translate-y-1/2 flex items-center justify-center","size-6 rounded-lg 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]=p):p=e[5];let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(un,{size:14}),e[6]=f):f=e[6];let m;e[7]!==u||e[8]!==p?(m=n.jsx("button",{type:"button","aria-label":u,className:p,children:f}),e[7]=u,e[8]=p,e[9]=m):m=e[9];const h=m;if(i){let A;e[10]!==h?(A=n.jsx(co,{asChild:!0,children:h}),e[10]=h,e[11]=A):A=e[11];let j;e[12]!==s||e[13]!==r?(j=r("chat.modelPreferences.customizeModel",{tier:s}),e[12]=s,e[13]=r,e[14]=j):j=e[14];let k;e[15]!==j?(k=n.jsx(uo,{className:"sr-only",children:j}),e[15]=j,e[16]=k):k=e[16];let y;e[17]!==a||e[18]!==o?(y=a&&o(d),e[17]=a,e[18]=o,e[19]=y):y=e[19];let w;e[20]!==y||e[21]!==k?(w=n.jsxs(po,{className:"p-0 flex flex-col max-h-[95vh]",children:[k,y]}),e[20]=y,e[21]=k,e[22]=w):w=e[22];let C;return e[23]!==a||e[24]!==w||e[25]!==A?(C=n.jsxs(fo,{open:a,onOpenChange:l,children:[A,w]}),e[23]=a,e[24]=w,e[25]=A,e[26]=C):C=e[26],C}let g;e[27]!==h?(g=n.jsx(Ht,{asChild:!0,children:h}),e[27]=h,e[28]=g):g=e[28];let v;e[29]!==a||e[30]!==o?(v=a&&o(d),e[29]=a,e[30]=o,e[31]=v):v=e[31];let x;e[32]!==v?(x=n.jsx(Jt,{side:"right",align:"start",collisionPadding:12,className:"w-[min(22rem,calc(100vw-2rem))] p-0 overflow-hidden",children:v}),e[32]=v,e[33]=x):x=e[33];let b;return e[34]!==a||e[35]!==g||e[36]!==x?(b=n.jsxs(Zt,{open:a,onOpenChange:l,children:[g,x]}),e[34]=a,e[35]=g,e[36]=x,e[37]=b):b=e[37],b}function Dt(t){return t==="fast"?n.jsx(at,{size:16}):t==="thinking"?n.jsx(dn,{size:16}):n.jsx(ho,{size:16})}function Vi(t){const e=R.c(13),s=wn();let o;e[0]!==t||e[1]!==s.tiers?(o=d=>{const u=s.tiers[d];return u?u.title??u.modelId:t.chat[d]?.title},e[0]=t,e[1]=s.tiers,e[2]=o):o=e[2];const r=o;let i;e[3]!==r?(i=r("fast"),e[3]=r,e[4]=i):i=e[4];let a;e[5]!==r?(a=r("smart"),e[5]=r,e[6]=a):a=e[6];let l;e[7]!==r?(l=r("thinking"),e[7]=r,e[8]=l):l=e[8];let V;return e[9]!==i||e[10]!==a||e[11]!==l?(V={fast:i,smart:a,thinking:l},e[9]=i,e[10]=a,e[11]=l,e[12]=V):V=e[12],V}function ci(){const t=R.c(23),e=B(),{simpleModeTier:s,setSimpleModeTier:o}=Ge(),r=mo(),i=es(),a=xo(i),l=Vi(a),{data:V,error:d}=jn();let u;t[0]!==V?(u=V===void 0?{tiers:{}}:V,t[0]=V,t[1]=u):u=t[1];const c=u,p=kn(),f=ze("model_choice"),m=Jn(),h=Zn();if(!m||!f)return null;let g,v;if(t[2]!==a||t[3]!==h||t[4]!==r||t[5]!==o||t[6]!==e||t[7]!==s||t[8]!==l||t[9]!==p||t[10]!==c||t[11]!==d){const k=xs(e);g="decopilot",v=ri.map(y=>{const w=l[y],C=c.tiers[y];return{key:`decopilot-${y}`,icon:Dt(y),title:k[y],subtitle:h?w??e(Mt[y]):e(Mt[y]),active:s===y,onSelect:()=>o(y),modelOverride:h?S=>n.jsxs(n.Fragment,{children:[d&&n.jsx("div",{className:"text-xs text-destructive p-3 pb-0",children:e("chat.modelPreferences.loadFailed")}),n.jsx(ni,{tier:y,orgSlot:r.tiers[y],userSlot:C,autoSlot:a.chat[y],onClose:S,onPick:I=>p.mutate({tier:y,slot:I}),onReset:()=>p.mutate({tier:y,slot:null})},`${y}:${C?.keyId??"org"}:${C?.modelId??""}`)]}):void 0}}),t[2]=a,t[3]=h,t[4]=r,t[5]=o,t[6]=e,t[7]=s,t[8]=l,t[9]=p,t[10]=c,t[11]=d,t[12]=g,t[13]=v}else g=t[12],v=t[13];let x;t[14]!==g||t[15]!==v?(x=[{key:g,rows:v}],t[14]=g,t[15]=v,t[16]=x):x=t[16];const b=x;let A;t[17]!==s?(A=Dt(s),t[17]=s,t[18]=A):A=t[18];let j;return t[19]!==b||t[20]!==A||t[21]!==s?(j=n.jsx(ii,{tier:s,pillIcon:A,groups:b}),t[19]=b,t[20]=A,t[21]=s,t[22]=j):j=t[22],j}function vs(t){const e=R.c(3),[s]=Se();let o;return e[0]!==s.enableSounds||e[1]!==t?(o=()=>{s.enableSounds&&To(t.dataUri).catch(i=>{console.warn(`[sound] ${t.name} playback failed:`,i)})},e[0]=s.enableSounds,e[1]=t,e[2]=o):o=e[2],o}const di={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"},ui=Xs.togglePlanMode.keys.map(t=>t==="Shift"?"⇧":t).join(""),pi=[{src:"/connections/gmail.png",name:"Gmail"},{src:"/connections/perplexity.png",name:"Perplexity"},{src:"/connections/github.png",name:"GitHub"}];function fi(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex items-center -space-x-1.5",children:pi.map(hi)}),t[0]=e):e=t[0],e}function hi(t){return n.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-1 ring-border object-cover bg-white"},t.name)}function mi({disabled:t,onOpenConnections:e,virtualMcpId:s,selectedModel:o,isStreaming:r,onUnsupportedFile:i}){const a=B(),[l,V]=P.useState(!1),d=vs(di),{org:u}=Ce(),{editor:c}=Ft(),p=P.useRef(null),f=ut(o),m=()=>{!f||r||(V(!1),p.current?.click())},h=async D=>{const K=D.target.files;if(!K||K.length===0||!c)return;const H=Array.from(K);try{let ee=c.state.selection.from;for(const J of H)await ts(c,o??null,J,ee,i,a),ee=c.state.selection.to}finally{p.current&&(p.current.value="")}},g=So({connectionId:s,orgId:u.id,orgSlug:u.slug}),v=Ms.virtualMcpPrompts(s,u.id),{data:x,isLoading:b}=Ds({queryKey:v,queryFn:()=>Co(g),staleTime:6e4,enabled:l&&!!g}),A=x?.prompts??[],[j,k]=P.useState(null),{chatMode:y,setChatMode:w}=Ge(),[C,S]=Se(),I=we.find(D=>D.value===C.toolApprovalLevel)??we[0],N=a(I.shortKey),T=D=>{const K=we.find(H=>H.value===D);if(K){if(K.value===C.toolApprovalLevel){V(!1);return}d(),te("chat_approval_level_changed",{from_level:C.toolApprovalLevel,to_level:K.value,source:"tools_popover"}),S({...C,toolApprovalLevel:K.value}),V(!1)}},_=y==="plan",E=()=>{d();const D=_?"default":"plan";te("chat_mode_changed",{from_mode:y,to_mode:D,source:"tools_popover"}),w(D),V(!1)},U=()=>{e(),V(!1)},M=async(D,K)=>{if(!c||!g)return;const H=jt(D._meta),ee={from:c.state.selection.from,to:c.state.selection.to};try{const J=await No(g,D.name,K);Zs(c,ee,{id:D.name,name:wo(D.name,H),metadata:J.messages,char:"/",kind:"prompt",args:K})}catch{Ee.error(a("chat.toolsPopover.failedLoadPrompt"))}},L=async D=>{V(!1);const K=!!(D.arguments&&D.arguments.length>0);if(te("chat_prompt_inserted",{prompt_name:D.name,with_arguments:K}),K){k(D);return}await M(D)},z=async D=>{j&&(await M(j,D),k(null))},W=()=>{d();const D=y==="gen-image"?"default":"gen-image";te("chat_mode_changed",{from_mode:y,to_mode:D,source:"tools_popover"}),w(D),V(!1)},$=()=>{d();const D=y==="web-search"?"default":"web-search";te("chat_mode_changed",{from_mode:y,to_mode:D,source:"tools_popover"}),w(D),V(!1)},F=()=>{d();const D=y==="deep-research"?"default":"deep-research";te("chat_mode_changed",{from_mode:y,to_mode:D,source:"tools_popover"}),w(D),V(!1)},Q=y==="gen-image",Z=y==="web-search",se=y==="deep-research",X=n.jsx("input",{ref:p,type:"file",multiple:!0,accept:lo(o??null),className:"hidden",onChange:h,disabled:r});return n.jsxs(n.Fragment,{children:[X,n.jsxs(Rs,{open:l,onOpenChange:D=>{D&&!l&&te("chat_tools_popover_opened",{chat_mode:y}),V(D)},children:[n.jsx(Es,{asChild:!0,children:n.jsxs(Y,{type:"button",variant:"ghost",size:"default",disabled:t,title:a("chat.toolsPopover.tools"),"aria-label":a("chat.toolsPopover.tools"),className:O("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),children:[n.jsx(pn,{size:14}),n.jsx("span",{className:O("min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0","@[320px]/chat-bottom:max-w-24 @[320px]/chat-bottom:opacity-100"),children:a("chat.toolsPopover.tools")})]})}),n.jsxs(Ps,{align:"start",className:"w-56 p-1.5 space-y-1",children:[f?n.jsxs(Ae,{onClick:m,disabled:r,children:[n.jsx(kt,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.addFile")})]}):n.jsxs(Ze,{children:[n.jsx(He,{asChild:!0,children:n.jsxs(Ae,{"aria-disabled":"true",className:"opacity-50 cursor-not-allowed",onSelect:D=>D.preventDefault(),children:[n.jsx(kt,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.addFile")})]})}),n.jsx(Je,{side:"right",children:a("chat.toolsPopover.modelNoFileSupport")})]}),n.jsxs(Ae,{onClick:E,className:O(_&&"text-special"),children:[n.jsx($t,{size:16,className:O(_&&"text-special")}),n.jsx("span",{className:"flex-1 whitespace-nowrap",children:a("chat.toolsPopover.planMode")}),n.jsx("span",{className:O("text-xs text-muted-foreground",_&&"text-special font-medium"),children:ui})]}),n.jsxs(Ae,{onClick:W,className:O(Q&&"text-special"),children:[n.jsx(Wt,{size:16,className:O(Q&&"text-special")}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.createImage")}),Q&&n.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),n.jsxs(Ae,{onClick:$,className:O(Z&&"text-special"),children:[n.jsx(qt,{size:16,className:O(Z&&"text-special")}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.webSearch")}),Z&&n.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),n.jsxs(Ae,{onClick:F,className:O(se&&"text-special"),children:[n.jsx(Qt,{size:16,className:O(se&&"text-special")}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.deepResearch")}),se&&n.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),n.jsxs(gt,{children:[n.jsxs(xt,{className:"gap-2",children:[n.jsx("span",{className:"flex size-4 items-center justify-center text-base font-medium text-muted-foreground",children:"/"}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.prompts")})]}),n.jsx(vt,{className:"w-80 max-h-72 overflow-y-auto p-1.5",children:b?n.jsxs("div",{className:"flex items-center gap-2 px-2 py-3 text-sm text-muted-foreground",children:[n.jsx(Us,{className:"size-3.5"}),a("chat.toolsPopover.loadingPrompts")]}):A.length===0?n.jsx("div",{className:"px-2 py-3 text-sm text-muted-foreground",children:a("chat.toolsPopover.noPromptsAvailable")}):A.map(D=>n.jsxs(Ae,{onClick:()=>L(D),className:"flex flex-col items-start gap-0.5",children:[n.jsx("span",{className:"font-medium text-sm capitalize",children:D.title||ko(D.name,jt(D._meta))}),D.description&&n.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:D.description})]},D.name))})]}),n.jsxs(gt,{children:[n.jsxs(xt,{className:"gap-2",children:[n.jsx(We,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.approval")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:N})]}),n.jsx(vt,{className:"w-48 p-1.5",children:n.jsx(Ls,{value:C.toolApprovalLevel,onValueChange:T,children:we.map(D=>n.jsx(Fs,{value:D.value,children:a(D.labelKey)},D.value))})})]}),n.jsxs(Ae,{onClick:U,children:[n.jsx(Io,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.connections")}),n.jsx(P.Suspense,{children:n.jsx(fi,{})})]})]})]}),n.jsx(Js,{prompt:j,setPrompt:k,onSubmit:z})]})}const gi=[{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 xi(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex items-center -space-x-1",children:gi.map(vi)}),t[0]=e):e=t[0],e}function vi(t){return n.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-2 ring-muted object-cover bg-white"},t.name)}function bi(t){const e=R.c(10),{onClick:s}=t,o=B();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=O("group relative z-10 flex items-center gap-3 w-full px-4 py-3","rounded-b-2xl","cursor-pointer"),e[0]=r):r=e[0];let i;e[1]!==o?(i=o("chat.connectionsBanner.description"),e[1]=o,e[2]=i):i=e[2];let a;e[3]!==i?(a=n.jsx("p",{className:"flex-1 text-xs text-muted-foreground truncate text-left",children:i}),e[3]=i,e[4]=a):a=e[4];let l,V;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(xi,{}),V=n.jsx(zs,{size:14,className:"shrink-0 text-muted-foreground/60 group-hover:text-muted-foreground transition-colors"}),e[5]=l,e[6]=V):(l=e[5],V=e[6]);let d;return e[7]!==s||e[8]!==a?(d=n.jsxs("button",{type:"button",onClick:s,className:r,children:[a,l,V]}),e[7]=s,e[8]=a,e[9]=d):d=e[9],d}const Re=48;function Ai(){const t=R.c(9),[e,s]=P.useState("idle"),[o,r]=P.useState(""),[i,a]=P.useState(""),[l,V]=P.useState(ki),d=P.useRef(null),u=P.useRef(null),c=P.useRef(null),p=P.useRef(null),f=P.useRef(0),m=P.useRef(!1),h=P.useRef(""),g=P.useRef(""),v=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition);let x;t[0]===Symbol.for("react.memo_cache_sentinel")?(x=()=>{f.current&&(cancelAnimationFrame(f.current),f.current=0),u.current?.close().catch(ji),p.current?.getTracks().forEach(yi),c.current=null,u.current=null,p.current=null},t[0]=x):x=t[0];const b=x;let A;if(t[1]===Symbol.for("react.memo_cache_sentinel")){const I=N=>{p.current=N;const T=new AudioContext;u.current=T;const _=T.createMediaStreamSource(N),E=T.createAnalyser();E.fftSize=128,E.smoothingTimeConstant=.8,_.connect(E),c.current=E;const U=new Uint8Array(E.frequencyBinCount),M=()=>{if(!c.current)return;c.current.getByteFrequencyData(U);const L=[];for(let z=0;z<Re;z++){const W=Math.floor(z/Re*U.length);L.push(Math.max(.04,(U[W]??0)/255))}V(L),f.current=requestAnimationFrame(M)};M()};A=async()=>{const N=window.SpeechRecognition||window.webkitSpeechRecognition;if(!N)return s("unsupported"),"unsupported";let T;try{T=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{return s("permission-denied"),"permission-denied"}r(""),a(""),g.current="",h.current="",m.current=!0,s("recording"),I(T);const _=new N;d.current=_,_.interimResults=!0,_.continuous=!0,_.lang=navigator.language||"en-US",_.onresult=E=>{if(d.current!==_)return;let U="",M="";for(let L=E.resultIndex;L<E.results.length;L++){const z=E.results[L],W=z?.[0]?.transcript??"";z?.isFinal?M=M+W:U=U+W}M&&(h.current=h.current+M,r(h.current)),g.current=U,a(U)},_.onerror=E=>{d.current===_&&E.error!=="no-speech"&&(m.current=!1,d.current=null,b(),s(E.error==="not-allowed"?"permission-denied":"idle"))},_.onend=()=>{if(d.current===_&&m.current)try{_.start()}catch{}};try{_.start()}catch{return m.current=!1,d.current=null,b(),s("idle"),"idle"}return"recording"},t[1]=A}else A=t[1];const j=A;let k;t[2]===Symbol.for("react.memo_cache_sentinel")?(k=()=>{m.current=!1,d.current?.stop(),b(),s("idle"),V(Array(Re).fill(.05)),a("");const I=(h.current+(g.current?" "+g.current:"")).trim();return r(""),h.current="",g.current="",I},t[2]=k):k=t[2];const y=k;let w;t[3]===Symbol.for("react.memo_cache_sentinel")?(w=()=>{m.current=!1,d.current?.abort(),b(),s("idle"),r(""),a(""),V(Array(Re).fill(.05)),h.current="",g.current=""},t[3]=w):w=t[3];const C=w;let S;return t[4]!==i||t[5]!==e||t[6]!==o||t[7]!==l?(S={status:e,transcript:o,interimTranscript:i,waveformData:l,isSupported:v,startRecording:j,stopRecording:y,cancelRecording:C},t[4]=i,t[5]=e,t[6]=o,t[7]=l,t[8]=S):S=t[8],S}function yi(t){return t.stop()}function ji(){}function ki(){return Array(Re).fill(.05)}function wi(t){const e=R.c(4),{data:s}=t;let o;e[0]!==s?(o=s.map(Si),e[0]=s,e[1]=o):o=e[1];let r;return e[2]!==o?(r=n.jsx("div",{className:"flex items-center justify-center gap-[2px] h-10 overflow-hidden","aria-hidden":"true",children:o}),e[2]=o,e[3]=r):r=e[3],r}function Si(t,e){return n.jsx("div",{className:"w-[2px] shrink-0 rounded-full bg-chart-2 transition-[height] duration-75 ease-out",style:{height:`${Math.max(4,Math.round(t*40))}px`}},e)}const Pe=12e3,Rt=re({token:ne(),expiresAt:$s()});Bs("provider",[re({provider:ye("elevenlabs"),conversationToken:ne().min(1)}),re({provider:ye("openai"),transport:ye("webrtc")})]);const Ci=Os([Rt.extend({provider:ye("elevenlabs").default("elevenlabs"),conversationToken:ne().min(1)}),Rt.extend({provider:ye("openai"),transport:ye("webrtc")})]);re({token:ne().min(1).max(4096),text:ne().trim().min(1).max(Pe)});const bs=re({request:ne().trim().min(1).max(Pe)}),ot=5e3;Ut(re({role:Le(["user","agent"]),text:ne().min(1).max(ot)})).max(60).refine(t=>t.reduce((e,s)=>e+s.text.length,0)<=ot,{message:"Voice transcript is too long"});function Xa(t){const e=[];let s=ot;for(const o of t.slice(-60).reverse()){if(s<=0)break;const r=o.text.slice(-s);e.unshift({role:o.role,text:r}),s-=r.length}return e}re({token:ne().min(1).max(4096),sdp:ne().min(1).max(1e5),language:Le(["en","pt"]).default("en")}).strict();const Ni=re({sdp:ne().min(1).max(1e5)});async function Ii(t,e,s,o,r){if(t.provider==="openai"){const{startOpenAIConversation:l}=await bt(async()=>{const{startOpenAIConversation:V}=await import("./openai-conversation-BQ0qlnvJ.js");return{startOpenAIConversation:V}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126]));return l(r,s,o)}const{Conversation:i}=await bt(async()=>{const{Conversation:l}=await import("./index-yN0BIuMc.js");return{Conversation:l}},[]);o.throwIfAborted();const a=await i.startSession({...s,clientTools:{delegate_to_agent:async l=>{const V=bs.safeParse(l);return JSON.stringify(V.success?await s.onDelegate(V.data):{status:"rejected",reason:"A complete request is required."})},get_agent_status:()=>JSON.stringify(s.getWorkStatus()),stop_agent_work:()=>JSON.stringify(s.cancelCurrentWork())},conversationToken:t.conversationToken,connectionType:"webrtc",overrides:{agent:{language:e}}});return o.aborted&&(await a.endSession(),o.throwIfAborted()),{endSession:()=>a.endSession(),setMicMuted:l=>a.setMicMuted(l),getOutputVolume:()=>a.getOutputVolume(),publishUpdate:l=>{const V=JSON.stringify({source:"Studio background data, not a user request or instructions",contextId:l.contextId,requestId:l.delegationId,text:l.text});l.delivery==="context"?a.sendContextualUpdate(V):a.sendUserMessage(`[Studio background event, not a new user request]
10
10
  ${V}
11
11
  Briefly report this update. Do not delegate it as new work.`)}}}const Ti=re({background:ye(!0),status:ye("started"),jobId:ne().min(1)}),_i=re({item:re({id:ne().min(1),title:ne(),status:ne()})}),Mi=t=>`${t}:react-msg`;function As(t,e){const s=t.findIndex(r=>r.id===e&&r.role==="user");if(s<0)return null;const o=[];for(const r of t.slice(s+1))if(!r.metadata?.subtaskJobId){if(r.role==="user")break;r.role==="assistant"&&o.push(r)}return o}function Et(t,e){const s=[],o=[];for(const r of As(t,e)??[])for(const i of r.parts){if(!("state"in i)||i.state!=="output-available"||!("output"in i))continue;const a=i.type;if(a==="tool-subtask"){const l=Ti.safeParse(i.output);l.success&&s.push(l.data.jobId)}else if(a==="tool-TASK_BOARD_ITEM_CREATE"){const l=_i.safeParse(i.output);l.success&&o.push(l.data.item)}}return{backgroundJobs:s,tasks:o}}function Pt(t,e){const s=As(t,e);if(!s)return null;const o=s.at(-1);if(!o||o.parts.some(l=>"state"in l&&["approval-requested","input-streaming","input-available"].includes(String(l.state))))return null;const r=o.parts.findLast(l=>l.type==="text"||l.type==="dynamic-tool"||l.type.startsWith("tool-"));if(r?.type!=="text")return"";if(r.state==="streaming")return null;const i=r.text.replace(/```[\s\S]*?```/g,"").replace(/!\[[^\]]*\]\([^)]*\)/g,"").replace(/\[([^\]]+)\]\([^)]*\)/g,"$1").replace(/^\s{0,3}(?:#{1,6}\s+|[-*+]\s+|\d+\.\s+)/gm,"").replace(/[*_`]/g,"").trim();if(!i)return"";if(i.length<=Pe)return i;const a=i.slice(0,Pe-1);return`${a.slice(0,a.lastIndexOf(" "))}…`}class Di{constructor(e,s){this.url=e,this.language=s}url;language;state={phase:"idle",muted:!1,working:!1,error:null};listeners=new Set;generation=0;conversation;startupAbort;userSpeaking=!1;token;timer;expires;bindings;jobs=new Map;announcements=[];lastActivity=0;approvalReported=!1;cleanup=Promise.resolve();dispatchQueue=Promise.resolve();lastContext="";lastWorkStatus="";utterance=0;seenUserEvents=new Set;tasks=new Map;boardUpdates=new Map;subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;outputVolume=()=>this.conversation?.getOutputVolume()??0;patch(e){if(!Object.entries(e).every(([s,o])=>this.state[s]===o)){this.state={...this.state,...e};for(const s of this.listeners)s()}}updateBindings(e,s){if(this.bindings=e,!s&&this.state.phase!=="idle"){this.stop();return}this.conversation&&(this.updateContext(),this.collectResults())}requestStatus(e){return e.result!==void 0?"finished":e.accepted?e.background?"running_in_background":this.bindings?.messages.some(s=>s.id===e.messageId)?"running":"queued":"submitting"}status(){const e=this.bindings;return{status:e?.isWaitingForApprovals?"approval_required":e?.error||e?.status==="error"?"failed":e?.isStreaming||e?.isRunInProgress?"working":"idle",requests:[...this.jobs.values()].slice(-6).map(s=>({id:s.messageId,request:s.request.slice(0,200),status:this.requestStatus(s),result:s.result?.slice(0,500)})),tasks:[...this.tasks.values()].slice(-10).map(s=>({title:s.title.slice(0,120),status:s.status}))}}updateContext(){const e=this.bindings?.voiceContext??"";e!==this.lastContext&&(this.lastContext=e,this.conversation?.publishUpdate({text:`Current Studio view, supplied as context only:
12
12
  ${e.slice(0,12e3)}`,delivery:"context",contextId:"studio-view"}))}collectResults(){const e=this.bindings;if(!e||!this.conversation)return;const s=e.isStreaming||e.isRunInProgress;if(this.patch({working:s||[...this.jobs.values()].some(o=>o.accepted&&o.result===void 0)}),this.publishWorkStatus(),e.isWaitingForApprovals){this.approvalReported||(this.approvalReported=!0,this.report("The Studio agent needs the user's approval. The approval controls are visible in this chat. Ask the user to review them; do not approve on their behalf."));return}this.approvalReported=!1;for(const o of this.jobs.values()){if(!o.accepted||o.result!==void 0)continue;if(o.background){this.collectBackground(o,s);continue}const r=e.messages.findIndex(l=>l.id===o.messageId);if(r<0)continue;const i=r>=0&&e.messages.slice(r+1).some(l=>l.role==="user");if(s&&!i)continue;let a;if(!s&&!i&&(e.error||e.status==="error"))a="The agent's run failed. Ask the user to return to the chat for the error details; do not claim completion.";else if(!s&&!i&&e.finishReason&&["error","length","content-filter","aborted"].includes(e.finishReason))a=`The run ended with status ${e.finishReason}; successful completion is not established.`;else{const l=Pt(e.messages,o.messageId);if(l===null)continue;a=l;const V=Et(e.messages,o.messageId);if(this.track(V.tasks),V.backgroundJobs.length){o.background=V.backgroundJobs,this.collectBackground(o,s);continue}}this.finish(o,a||"The agent finished without a final text response. Do not infer that the requested change succeeded.")}this.patch({working:s||[...this.jobs.values()].some(o=>o.accepted&&o.result===void 0)}),this.publishWorkStatus()}collectBackground(e,s){const o=this.bindings?.messages??[],r=[];for(const i of e.background??[]){const a=Mi(i),l=o.findIndex(u=>u.id===a);if(l<0)return;const V=o.slice(l+1).some(u=>u.role==="user");if(s&&!V)return;const d=Pt(o,a);if(d===null)return;this.track(Et(o,a).tasks),r.push(d)}this.finish(e,r.filter(Boolean).join(`
@@ -1 +1 @@
1
- import{c as k,j as h,r as C,l as L}from"./index-Du2WlkP0.js";import{n as Z}from"./LinkBroken01-CbbXXlF9.js";import{A as y}from"./agent-icon-DMUppBcz.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-Co-4sRnJ.js";import{n as Z}from"./LinkBroken01-t821Qpkz.js";import{A as y}from"./agent-icon-DV55KTHV.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};