decocms 3.34.0 → 3.34.2

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 (237) hide show
  1. package/dist/client/assets/{AlertCircle-CZCJdLyi.js → AlertCircle-CQgcG-Ae.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-CHxGqtjn.js → ArrowUpRight-D0znd3JO.js} +1 -1
  3. package/dist/client/assets/{Check-DZFgb4Aq.js → Check-BUKt5vhH.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-CG-wMven.js → CheckCircle-x4whH3Qn.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-B7QgMo_j.js → ChevronDown-C6ULHnU-.js} +1 -1
  6. package/dist/client/assets/{ChevronLeft-TMVSDJlu.js → ChevronLeft-Btt_21CS.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-BZDLAZs0.js → ChevronRight-glzdqN1s.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-D4NcsGJa.js → ChevronUp-C5QGzLz6.js} +1 -1
  9. package/dist/client/assets/{Container-CIoK_JLI.js → Container-RGkdLpnR.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-BTWgDSCZ.js → DotsVertical-BrpflBsP.js} +1 -1
  11. package/dist/client/assets/{Eye-BaBZSaML.js → Eye-Bk7j3Cz0.js} +1 -1
  12. package/dist/client/assets/{FilterLines-CuEfbFlC.js → FilterLines-xOxNVJBa.js} +1 -1
  13. package/dist/client/assets/{Globe01-Bu-3l6NI.js → Globe01-C8CeCAhz.js} +1 -1
  14. package/dist/client/assets/{HardDrive-FmjuSfEd.js → HardDrive-Czbw3MRd.js} +1 -1
  15. package/dist/client/assets/{Key01-Bnc16AFY.js → Key01-ChQ6WmeN.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-D2epCZ9e.js → LayoutLeft-D3sIkDa-.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-il-vFJO5.js → LinkExternal01-DNf7UuUK.js} +1 -1
  18. package/dist/client/assets/{Monitor01-s9F0MGZm.js → Monitor01-BzTgEIFJ.js} +1 -1
  19. package/dist/client/assets/{Palette-BXG1B7a_.js → Palette-DwfZnoA5.js} +1 -1
  20. package/dist/client/assets/{Play-CArhP18b.js → Play-BXW8gJMz.js} +1 -1
  21. package/dist/client/assets/{Plus-BMFN7EYn.js → Plus-CugY_4xX.js} +1 -1
  22. package/dist/client/assets/{RefreshCcw01-CKC-7KpZ.js → RefreshCcw01-DiPX3Tzc.js} +1 -1
  23. package/dist/client/assets/{SearchMd-Cp07lkq4.js → SearchMd-DltTVRsJ.js} +1 -1
  24. package/dist/client/assets/{Settings02-D4_HBk9b.js → Settings02-sAiuI7qb.js} +1 -1
  25. package/dist/client/assets/{Shield01-C5CB9ixt.js → Shield01-C-4y3Jk3.js} +1 -1
  26. package/dist/client/assets/{Star01-B5uhWV3B.js → Star01-D8Xy046a.js} +1 -1
  27. package/dist/client/assets/{Stars01-Bbj7Y0Z1.js → Stars01-BPnYJgb7.js} +1 -1
  28. package/dist/client/assets/{Stars02-KpOwsvid.js → Stars02-CP1Go7Ud.js} +1 -1
  29. package/dist/client/assets/{Sun-BAloSVhR.js → Sun-BsWLyXgw.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-Cu45oyoo.js → SwitchHorizontal01-MAz-yRbe.js} +1 -1
  31. package/dist/client/assets/{Tool01-41oNA8tk.js → Tool01-Cjstio7H.js} +1 -1
  32. package/dist/client/assets/{Trash01-BxDpcA3C.js → Trash01-BJ6_IzkG.js} +1 -1
  33. package/dist/client/assets/{Upload01-D32r7qgX.js → Upload01-C2pjhIpk.js} +1 -1
  34. package/dist/client/assets/{User01-jR83WsDH.js → User01-D2zO49mC.js} +1 -1
  35. package/dist/client/assets/{Users01-BBxMW_TC.js → Users01-ubeIr2qn.js} +1 -1
  36. package/dist/client/assets/{Users03-BLIawTyD.js → Users03-BqYE15gt.js} +1 -1
  37. package/dist/client/assets/{X-D5a6VwmP.js → X-BQX3Zy-X.js} +1 -1
  38. package/dist/client/assets/{XCircle-uxFEtClP.js → XCircle-D9dvtOsK.js} +1 -1
  39. package/dist/client/assets/{XClose-DutYcJf9.js → XClose-DaB-YREn.js} +1 -1
  40. package/dist/client/assets/{Zap-Dn5qc0WK.js → Zap-j4DAJVgz.js} +1 -1
  41. package/dist/client/assets/{ZapSquare-rlEq1cG8.js → ZapSquare-cM9Cdjuc.js} +1 -1
  42. package/dist/client/assets/{ZoomOut-BVY1Bb5M.js → ZoomOut-DVfZ-43U.js} +1 -1
  43. package/dist/client/assets/{access-gate-BG1y9Hug.js → access-gate-DZ_2pDdY.js} +1 -1
  44. package/dist/client/assets/{accordion-Dzk41U9r.js → accordion-BISd33DR.js} +1 -1
  45. package/dist/client/assets/{add-section-modal-DsL7vxG4.js → add-section-modal-DIOLC-ZF.js} +1 -1
  46. package/dist/client/assets/agent-capabilities-CVYxQ4uK.js +3 -0
  47. package/dist/client/assets/{agent-icon-eJeBIKuQ.js → agent-icon-BgD5mt7Y.js} +1 -1
  48. package/dist/client/assets/{agent-icons-BQS7GC08.js → agent-icons-DmQcPkq-.js} +1 -1
  49. package/dist/client/assets/{agents-list-BuzrDWIw.js → agents-list-h30K61d9.js} +1 -1
  50. package/dist/client/assets/{ai-providers-CVvDeHAY.js → ai-providers-CEnY5BL7.js} +1 -1
  51. package/dist/client/assets/{alert-B7wpmBJc.js → alert-C7cWRVuG.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-D0THW25_.js → alert-dialog-qtdXP2aD.js} +1 -1
  53. package/dist/client/assets/app-editor-B4mTx3Hz.js +1 -0
  54. package/dist/client/assets/{auth-catchall-B9qDAn3E.js → auth-catchall-CuT4FTL1.js} +1 -1
  55. package/dist/client/assets/{auth-split-layout-B_xfyQiq.js → auth-split-layout-BDEnOc9x.js} +1 -1
  56. package/dist/client/assets/{automation-list-row-D582neu3.js → automation-list-row-BW5rM44g.js} +1 -1
  57. package/dist/client/assets/{automation-runs-Bbg-0UVN.js → automation-runs-BUOdfMri.js} +1 -1
  58. package/dist/client/assets/{automations-CocDDisF.js → automations-ClItqGDn.js} +1 -1
  59. package/dist/client/assets/{avatar-BWTRU-cH.js → avatar-DYsooxxy.js} +1 -1
  60. package/dist/client/assets/{badge-DAzOgiKc.js → badge-CTK5gX_I.js} +1 -1
  61. package/dist/client/assets/{brand-context-BxzBhuxy.js → brand-context-CtcRGgwt.js} +1 -1
  62. package/dist/client/assets/{buckets-OgmEkXt4.js → buckets-BPPYI6Ll.js} +1 -1
  63. package/dist/client/assets/{calendar-CTsGuWmk.js → calendar-DMziTV2J.js} +1 -1
  64. package/dist/client/assets/{capability-load-error-B6TBCUEJ.js → capability-load-error-BTLQ23rW.js} +1 -1
  65. package/dist/client/assets/{card-D4pgDcd2.js → card-DGQIgBVW.js} +1 -1
  66. package/dist/client/assets/{chat-context-DLsfZ4X8.js → chat-context-BwBc2M6a.js} +1 -1
  67. package/dist/client/assets/{checkbox-NCgkpQdG.js → checkbox-B-MHp2m4.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-Cg7MVUxb.js → cli-auth-success-CPZJCSmX.js} +1 -1
  69. package/dist/client/assets/{collection-detail-BTIBM7UV.js → collection-detail-AQZQR51q.js} +1 -1
  70. package/dist/client/assets/{collection-display-button-BD_cZwBu.js → collection-display-button-Df3MeS7W.js} +1 -1
  71. package/dist/client/assets/{collection-search-FDG1Rlpn.js → collection-search-BiQg9L4B.js} +1 -1
  72. package/dist/client/assets/{collection-table-wrapper-CLs6D3Gl.js → collection-table-wrapper-DEwd3fgl.js} +1 -1
  73. package/dist/client/assets/{collection-tabs-pv_RnATY.js → collection-tabs-CcnS0Il2.js} +1 -1
  74. package/dist/client/assets/{collections-2LTOAuNh.js → collections-BnzTAqxJ.js} +1 -1
  75. package/dist/client/assets/{command-Eg_TSNDN.js → command-DNZKPE8c.js} +1 -1
  76. package/dist/client/assets/{connect-desktop-dialog-BfZ9n3Q0.js → connect-desktop-dialog-Cu6gQanY.js} +1 -1
  77. package/dist/client/assets/{connection-card-CBcUqWOS.js → connection-card-CwL_Gtb4.js} +1 -1
  78. package/dist/client/assets/{connection-detail-CLOt0X5i.js → connection-detail-DTp8ff1l.js} +1 -1
  79. package/dist/client/assets/{connection-form-helpers-DQ1R8Rbb.js → connection-form-helpers-Bm0LSgZq.js} +1 -1
  80. package/dist/client/assets/{connections-anSV4FAS.js → connections-j-HJQpSe.js} +1 -1
  81. package/dist/client/assets/decopilot-sse-pool-COADWaXW.js +1 -0
  82. package/dist/client/assets/{dialog-GbkSCCDE.js → dialog-BVuxcsVk.js} +1 -1
  83. package/dist/client/assets/{domain-settings-CfTQTVXk.js → domain-settings-DKOBo5cc.js} +1 -1
  84. package/dist/client/assets/{drawer-CDEJbPQ_.js → drawer-DXb-AEyv.js} +1 -1
  85. package/dist/client/assets/{dropdown-menu-Bp4U1b45.js → dropdown-menu-B8jiZxwT.js} +1 -1
  86. package/dist/client/assets/{dynamic-plugin-layout-BwhGs18I.js → dynamic-plugin-layout-DYfQLQqA.js} +1 -1
  87. package/dist/client/assets/{empty-state-v8piTmBi.js → empty-state-D5f29Xcz.js} +1 -1
  88. package/dist/client/assets/{empty-state-B8atRyt1.js → empty-state-DIMjTOGF.js} +1 -1
  89. package/dist/client/assets/{extract-connection-data-CWzL0whb.js → extract-connection-data-BJtaRoQB.js} +1 -1
  90. package/dist/client/assets/{features-DqRtKUxF.js → features-Baf8n_se.js} +1 -1
  91. package/dist/client/assets/{file-explorer-COzE78zi.js → file-explorer-BB5qrAiH.js} +1 -1
  92. package/dist/client/assets/{file-type-icon-CrGaQHZH.js → file-type-icon-9GbQJJla.js} +1 -1
  93. package/dist/client/assets/{files-DcXaeN54.js → files-BDf63K2h.js} +1 -1
  94. package/dist/client/assets/{form-Ct1q5ZTT.js → form-D5zHXlMU.js} +1 -1
  95. package/dist/client/assets/{general-6k9CLiVk.js → general-t5ylGzhM.js} +1 -1
  96. package/dist/client/assets/{generate-id-Ck2Vi4il.js → generate-id-16rt0unc.js} +1 -1
  97. package/dist/client/assets/{github-repo-picker-Dh-z3MS6.js → github-repo-picker-D0jgVOhB.js} +1 -1
  98. package/dist/client/assets/{header-tab-button-TaP3yUvX.js → header-tab-button-B7JCdtgi.js} +1 -1
  99. package/dist/client/assets/{hover-card-DUG7qFNS.js → hover-card-BAzXpmKd.js} +1 -1
  100. package/dist/client/assets/{image-field-BvfbFQCq.js → image-field-Ysc9gjw_.js} +1 -1
  101. package/dist/client/assets/{index-C99xN5mu.js → index-BFPk_Xc8.js} +1 -1
  102. package/dist/client/assets/{index-CH5_jbBh.js → index-BPCEqCH8.js} +1 -1
  103. package/dist/client/assets/{index-Bg77DGkv.js → index-BZGVDk3g.js} +1 -1
  104. package/dist/client/assets/{index-DUFETPUS.js → index-Bb8K2DUU.js} +1 -1
  105. package/dist/client/assets/{index-BG09-Pj6.js → index-C5DGaDTE.js} +1 -1
  106. package/dist/client/assets/{index-C4S4NH7_.js → index-C_RnYmCN.js} +1 -1
  107. package/dist/client/assets/{index-Bo0y-IeN.js → index-CbN9kYHB.js} +1 -1
  108. package/dist/client/assets/{index-DvjfZyh_.js → index-Cbngzld3.js} +3 -3
  109. package/dist/client/assets/{index-BwfKFYWi.js → index-DES0wLPI.js} +12 -12
  110. package/dist/client/assets/{index-EWthEHT2.js → index-DEkPGwPd.js} +1 -1
  111. package/dist/client/assets/{index-Ca_51Bdz.js → index-DdEtGRBb.js} +1 -1
  112. package/dist/client/assets/{index-2GwD8zs9.js → index-Drq6TCfC.js} +1 -1
  113. package/dist/client/assets/{index-D7JjC_Ha.js → index-PadxIFkt.js} +1 -1
  114. package/dist/client/assets/{index-DrZPYOCw.js → index-kU5u3aEQ.js} +1 -1
  115. package/dist/client/assets/{index-redirect-BQdYxzJo.js → index-redirect-BVfzEM-2.js} +1 -1
  116. package/dist/client/assets/{index-BQjtT112.js → index-vM9scTJV.js} +1 -1
  117. package/dist/client/assets/{input-irp5a6Ig.js → input-CxWmKS03.js} +1 -1
  118. package/dist/client/assets/{integration-icon-FcIrg4H7.js → integration-icon-C8l8gk56.js} +1 -1
  119. package/dist/client/assets/{label-BjwEjfOc.js → label-BUOqnJ7l.js} +1 -1
  120. package/dist/client/assets/{layout-s4c1VBr3.js → layout-BXEq9Lt0.js} +1 -1
  121. package/dist/client/assets/{login-DvesO_NT.js → login-79jBd8dT.js} +1 -1
  122. package/dist/client/assets/{members-C60Aey5n.js → members-4ZcflmV4.js} +1 -1
  123. package/dist/client/assets/{monaco-editor-CIyIIOLP.js → monaco-editor-CwH2NVur.js} +1 -1
  124. package/dist/client/assets/{monitoring-stats-row-B8f5t9as.js → monitoring-stats-row-_N9Geab-.js} +1 -1
  125. package/dist/client/assets/{oauth-callback-BHpZxMn4.js → oauth-callback-UYq6rKIp.js} +1 -1
  126. package/dist/client/assets/{oauth-callback-ai-provider-BsfNZx3Q.js → oauth-callback-ai-provider-CcTTT6yu.js} +1 -1
  127. package/dist/client/assets/{onboarding-B2qJIBXT.js → onboarding-DM9L8yF1.js} +1 -1
  128. package/dist/client/assets/{org-install-D8vuUVF_.js → org-install-BKkCtJoj.js} +1 -1
  129. package/dist/client/assets/{org-layout-BlXjXW59.js → org-layout-CeAaKEeN.js} +1 -1
  130. package/dist/client/assets/{org-plugin-layout-CX3CIxiU.js → org-plugin-layout-B_8XF5xC.js} +1 -1
  131. package/dist/client/assets/{page-seo-form-Bj1ei9Gv.js → page-seo-form-c-iWMPRU.js} +1 -1
  132. package/dist/client/assets/page-seo-sheet-DEsc0wUy.js +1 -0
  133. package/dist/client/assets/{pair-QNI_4vE-.js → pair-DGfi0DYT.js} +1 -1
  134. package/dist/client/assets/{plugin-empty-state-BxAyfpRL.js → plugin-empty-state-DhzIqwYl.js} +1 -1
  135. package/dist/client/assets/{plugin-header-BmTvDEmx.js → plugin-header-Nu37D2e7.js} +1 -1
  136. package/dist/client/assets/{plugin-layout-AAC2IROJ.js → plugin-layout-DS-45rI5.js} +1 -1
  137. package/dist/client/assets/{popover-DKADBzsx.js → popover-DIhiGQZO.js} +1 -1
  138. package/dist/client/assets/{post-editor-Dkob_Nf9.js → post-editor-BhTIGX9u.js} +1 -1
  139. package/dist/client/assets/{primitives-BD_skIF2.js → primitives-D3OiaA1o.js} +1 -1
  140. package/dist/client/assets/{profile-B7jiHx0p.js → profile-BOnhq-U1.js} +1 -1
  141. package/dist/client/assets/project-app-view-B6XESkOH.js +1 -0
  142. package/dist/client/assets/record-editor-DDxQqS5k.js +1 -0
  143. package/dist/client/assets/registry-AsFW8yYm.js +2 -0
  144. package/dist/client/assets/{registry-layout-CyYeZQFC.js → registry-layout-CkNttCUh.js} +1 -1
  145. package/dist/client/assets/{require-capability-D2k7Kzha.js → require-capability-Cm5KwYyo.js} +1 -1
  146. package/dist/client/assets/{required-auth-layout-Dlm8pGwG.js → required-auth-layout-C2qJiXM7.js} +1 -1
  147. package/dist/client/assets/{reset-password-Bj1irBT9.js → reset-password-iw6TtkA7.js} +1 -1
  148. package/dist/client/assets/{resizable-CflvFHn-.js → resizable-DOED-lqJ.js} +1 -1
  149. package/dist/client/assets/{roles-C-0y_YIa.js → roles-DpYb1zXX.js} +1 -1
  150. package/dist/client/assets/save-referenced-block-aVkQu985.js +1 -0
  151. package/dist/client/assets/{save-status-BT2K7vMi.js → save-status-NiMLdA_E.js} +1 -1
  152. package/dist/client/assets/{schema-form-BmsIuFe9.js → schema-form-BMMNRxMa.js} +1 -1
  153. package/dist/client/assets/{scroll-area-Bcd6M0ah.js → scroll-area-BCusTvyt.js} +1 -1
  154. package/dist/client/assets/{search-input-DMce5FEj.js → search-input-BlmktcqH.js} +1 -1
  155. package/dist/client/assets/{secrets-DFqTlIhT.js → secrets-Kx-u37G9.js} +1 -1
  156. package/dist/client/assets/{sections-editor-DPjqmRcC.js → sections-editor-Btt2eICm.js} +1 -1
  157. package/dist/client/assets/{select-DBJdJQxs.js → select-DJ-jQ95-.js} +1 -1
  158. package/dist/client/assets/{select-model-C6zKg0NG.js → select-model-CuVna3TI.js} +1 -1
  159. package/dist/client/assets/{seo-editor-70uW1Cgu.js → seo-editor-CpGzaUnY.js} +1 -1
  160. package/dist/client/assets/{settings-layout-BL3d6TJ_.js → settings-layout-CUxOF-JB.js} +1 -1
  161. package/dist/client/assets/{settings-section-C7OUTn7i.js → settings-section-Bs7s9mU1.js} +1 -1
  162. package/dist/client/assets/{sheet-BwH8pS-i.js → sheet-4VDYc-Lf.js} +1 -1
  163. package/dist/client/assets/{shell-controls-CMgf8y54.js → shell-controls-D0MQ2JKg.js} +1 -1
  164. package/dist/client/assets/{shell-layout-C6cd7iM5.js → shell-layout-BtNaHUcu.js} +1 -1
  165. package/dist/client/assets/shell-route-loading-Dy64K_ax.js +1 -0
  166. package/dist/client/assets/{sidebar-TMNnGTum.js → sidebar-DeB8mcen.js} +1 -1
  167. package/dist/client/assets/{skeleton-l4y2bxXO.js → skeleton-Cuoq2c8E.js} +1 -1
  168. package/dist/client/assets/sortable.esm-4pxxx_ZW.js +5 -0
  169. package/dist/client/assets/{spinner-BtGInCsG.js → spinner-Dar3jTAz.js} +1 -1
  170. package/dist/client/assets/{sso-BGAtG4Za.js → sso-C0PJx8_v.js} +1 -1
  171. package/dist/client/assets/{store-C3y6O23u.js → store-XNFzt3Sr.js} +1 -1
  172. package/dist/client/assets/store-registry-D3KY8zoe.js +2 -0
  173. package/dist/client/assets/{studio-tools-B1Ixjcw5.js → studio-tools-B99HmIGq.js} +1 -1
  174. package/dist/client/assets/{switch-BFEJpvlr.js → switch-jfclxkGe.js} +1 -1
  175. package/dist/client/assets/{tab-id-t-YFcZzw.js → tab-id-C7uvN0td.js} +1 -1
  176. package/dist/client/assets/{table-M2WJKO5P.js → table-DEsh_yYm.js} +1 -1
  177. package/dist/client/assets/{tabs-w6d9uq3S.js → tabs-tr2cYDEl.js} +1 -1
  178. package/dist/client/assets/{task-status-CfFWQAcK.js → task-status-Ds87FkqY.js} +1 -1
  179. package/dist/client/assets/{textarea-BGXAM3FF.js → textarea-uwm8kgXD.js} +1 -1
  180. package/dist/client/assets/{toggle-group-C4U40EOv.js → toggle-group-BDjNDkJX.js} +1 -1
  181. package/dist/client/assets/{toolbar-C2En0zPi.js → toolbar-BIItBzPS.js} +1 -1
  182. package/dist/client/assets/{tools-list-CCVW8omn.js → tools-list-BQc1il3V.js} +1 -1
  183. package/dist/client/assets/{tooltip-6LKHApWj.js → tooltip--aN5hOmO.js} +1 -1
  184. package/dist/client/assets/{types-CoBpfu3U.js → types-BqoD-In5.js} +1 -1
  185. package/dist/client/assets/{use-ai-providers-Dph4wlM9.js → use-ai-providers-CdyP1ECQ.js} +1 -1
  186. package/dist/client/assets/{use-automations-DV8VwbjR.js → use-automations-CtzZDGfB.js} +1 -1
  187. package/dist/client/assets/{use-capability-CRrm1ogD.js → use-capability-KB17PgvY.js} +1 -1
  188. package/dist/client/assets/{use-clock-tick-CyQ108_a.js → use-clock-tick-CbDuKmI6.js} +1 -1
  189. package/dist/client/assets/{use-collections-MWh87Qf9.js → use-collections-shQIB33q.js} +1 -1
  190. package/dist/client/assets/{use-connection-BwjVlVqI.js → use-connection-Zog2j0WA.js} +1 -1
  191. package/dist/client/assets/{use-copy-BDBsQ8lw.js → use-copy-CZHdrpQ2.js} +1 -1
  192. package/dist/client/assets/{use-create-virtual-mcp--Yql-2p8.js → use-create-virtual-mcp-aKZM7QuJ.js} +1 -1
  193. package/dist/client/assets/{use-debounced-autosave-B6SxjuaG.js → use-debounced-autosave-CLmefNH1.js} +1 -1
  194. package/dist/client/assets/{use-delete-connection-CE3T6gZf.js → use-delete-connection-DXPW2vzV.js} +1 -1
  195. package/dist/client/assets/{use-file-configs-WBUPEX1z.js → use-file-configs-vUZ85Q5v.js} +1 -1
  196. package/dist/client/assets/{use-infinite-scroll-C_ORywxv.js → use-infinite-scroll-RcbuivWg.js} +1 -1
  197. package/dist/client/assets/{use-list-state-ZUm8O0U3.js → use-list-state-D4jM3-Gj.js} +1 -1
  198. package/dist/client/assets/{use-mcp-client-kBcr-yIi.js → use-mcp-client-BNpG-Sq-.js} +1 -1
  199. package/dist/client/assets/{use-mcp-prompts-Cu_s_Tgp.js → use-mcp-prompts-DXY1goeC.js} +1 -1
  200. package/dist/client/assets/{use-mcp-tools-BVCosz4Y.js → use-mcp-tools-BIWz7WmP.js} +1 -1
  201. package/dist/client/assets/{use-members-CQwZpJh1.js → use-members--qC59KQg.js} +1 -1
  202. package/dist/client/assets/{use-navigate-to-agent-Dqwftn0z.js → use-navigate-to-agent-nRLYSeRD.js} +1 -1
  203. package/dist/client/assets/{use-org-auth-client-CKzivxvb.js → use-org-auth-client-vlAtiOoY.js} +1 -1
  204. package/dist/client/assets/{use-org-sso-CizTzcrl.js → use-org-sso-D9s0K3D9.js} +1 -1
  205. package/dist/client/assets/{use-organization-roles-DFIysUWU.js → use-organization-roles-DfHQwz_9.js} +1 -1
  206. package/dist/client/assets/{use-organization-settings-C83zobOQ.js → use-organization-settings-BYRiagaB.js} +1 -1
  207. package/dist/client/assets/{use-registry-connections-D2z51tYu.js → use-registry-connections-2J71KvqA.js} +1 -1
  208. package/dist/client/assets/{use-secrets-DuBDIHg_.js → use-secrets-CqzR66gk.js} +1 -1
  209. package/dist/client/assets/{use-status-sounds-C1N5nKtC.js → use-status-sounds-Ce0VEQki.js} +1 -1
  210. package/dist/client/assets/{use-view-mode-CdGJFg5T.js → use-view-mode-rJzWSnvR.js} +1 -1
  211. package/dist/client/assets/{use-virtual-mcp-BH7eFRNT.js → use-virtual-mcp-CfnJ2csQ.js} +1 -1
  212. package/dist/client/assets/useInfiniteQuery-g2cikAaR.js +1 -0
  213. package/dist/client/assets/{useRouterState-mLoytFp1.js → useRouterState-somQ9b5z.js} +1 -1
  214. package/dist/client/assets/useSuspenseInfiniteQuery-ZAutmGB6.js +1 -0
  215. package/dist/client/assets/{user-Bu_LWzDf.js → user-Bku5ElcW.js} +1 -1
  216. package/dist/client/assets/{view-mode-toggle-BFVBLid1.js → view-mode-toggle-DV5nhx4X.js} +1 -1
  217. package/dist/client/assets/{watch-sse-pool-PpWWHENZ.js → watch-sse-pool-CzyBkAGb.js} +1 -1
  218. package/dist/client/assets/{workflow-mBb6h1mU.js → workflow-BPCoD875.js} +1 -1
  219. package/dist/client/assets/workflow-detail-DWZIWF6w.js +1 -0
  220. package/dist/client/index.html +1 -1
  221. package/dist/server/cli.js +2 -2
  222. package/dist/server/server.js +1 -1
  223. package/package.json +1 -1
  224. package/dist/client/assets/agent-capabilities-BTQpzJzY.js +0 -3
  225. package/dist/client/assets/app-editor-mnWJa4OB.js +0 -1
  226. package/dist/client/assets/decopilot-sse-pool-J9IBtPGQ.js +0 -1
  227. package/dist/client/assets/page-seo-sheet-CAj4OnGN.js +0 -1
  228. package/dist/client/assets/project-app-view-Bxi1-sx3.js +0 -1
  229. package/dist/client/assets/record-editor-DhS1gQiJ.js +0 -1
  230. package/dist/client/assets/registry-CLfDV8ZJ.js +0 -2
  231. package/dist/client/assets/save-referenced-block-Dm8Vu_wn.js +0 -1
  232. package/dist/client/assets/shell-route-loading-C_Trke1w.js +0 -1
  233. package/dist/client/assets/sortable.esm-DzvMqAvs.js +0 -5
  234. package/dist/client/assets/store-registry-CTUY1_0P.js +0 -2
  235. package/dist/client/assets/useInfiniteQuery-DCizzYPk.js +0 -1
  236. package/dist/client/assets/useSuspenseInfiniteQuery-BlGj7aqQ.js +0 -1
  237. package/dist/client/assets/workflow-detail-GZhsuAzj.js +0 -1
@@ -1,3 +0,0 @@
1
- import{G as Be,r as w,au as $s,as as zs,e as O,q as ie,c as B,j as s,E as Bs,o as le,T as he,aH as Us,W as _e,aI as Pt,L as Ks,B as re,H as qs,I as Qs,aJ as Ys,aK as Hs,a0 as Ee,D as Gs,aL as De,aM as Wt,n as Rn,K as Ie,t as G,f as rt,a as Dt,aN as Ws,v as Tn,R as Js,aO as Zs,b as Pn,aP as Xs,aQ as Dn,aR as er,aS as ce,aT as gt,aU as tr,aV as nr,aW as bt,aX as sr,aY as rr,aZ as or,a_ as ar,s as lr,a$ as ir,b0 as cr,b1 as ur,b2 as dr,b3 as Mn,b4 as Oe,l as Vr,F as Fn}from"./index-DvjfZyh_.js";import{c as fe,a as Ue,d as ot,u as fr,b as mr,f as pr,g as On,A as hr,h as xr}from"./chat-context-DLsfZ4X8.js";import{e as Ln,s as at,g as de,P as Je,f as Mt,t as gr,h as br,M as vr,i as yr,j as Le,k as Ar,l as jr,F as wr,c as Cr,S as Sr,m as Nr,n as Jt}from"./pair-QNI_4vE-.js";import{S as Ct}from"./spinner-BtGInCsG.js";import{c as St,u as kr,T as xe,a as ge,b as be}from"./tooltip-6LKHApWj.js";import{b as lt,c as it,a as ct,D as ut,e as Ft}from"./dialog-GbkSCCDE.js";import{c as _r,D as Ir,a as Er,b as Rr}from"./drawer-CDEJbPQ_.js";import{C as Tr}from"./collection-search-FDG1Rlpn.js";import{g as dt,u as Re,a as Pr,i as Zt}from"./use-mcp-client-kBcr-yIi.js";import{u as Dr,g as Vt,l as Nt}from"./use-mcp-prompts-Cu_s_Tgp.js";import{t as ft}from"./ChevronDown-B7QgMo_j.js";import{i as Me}from"./X-D5a6VwmP.js";import{t as Mr,z as Fr,u as Or,w as Lr,A as $r}from"./tab-id-t-YFcZzw.js";import{K as zr,i as Br}from"./shell-layout-C6cd7iM5.js";import{a as Ur,u as Kr}from"./use-virtual-mcp-BH7eFRNT.js";import{i as qr}from"./SwitchHorizontal01-Cu45oyoo.js";import{n as $n}from"./ZapSquare-rlEq1cG8.js";import{i as Ke}from"./Check-DZFgb4Aq.js";import{s as zn}from"./Star01-B5uhWV3B.js";import{a as Bn}from"./Tool01-41oNA8tk.js";import{a1 as mt,o as Qr,M as Un,A as Kn,i as He,b as Yr,P as Hr,a2 as Gr,s as Wr,a3 as Jr,a4 as Zr,Y as qn}from"./agent-icon-eJeBIKuQ.js";import{i as Xr}from"./Upload01-D32r7qgX.js";import{i as Qn}from"./AlertCircle-CZCJdLyi.js";import{a as eo}from"./Eye-BaBZSaML.js";import{a as kt,b as Ot,d as Lt,f as $t,F as Yn}from"./form-Ct1q5ZTT.js";import{b as to,d as no,c as so,S as ro,a as oo}from"./select-DBJdJQxs.js";import{i as ao}from"./RefreshCcw01-CKC-7KpZ.js";import{a as Hn,t as _t,b as lo}from"./XCircle-uxFEtClP.js";import{b as io,c as co}from"./tabs-w6d9uq3S.js";import{T as Gn,a as Ze}from"./toggle-group-C4U40EOv.js";import{I as Wn}from"./input-irp5a6Ig.js";import{u as zt}from"./studio-tools-B1Ixjcw5.js";import{u as uo}from"./use-ai-providers-Dph4wlM9.js";import{i as Jn}from"./Monitor01-s9F0MGZm.js";import{C as Zn}from"./connect-desktop-dialog-BfZ9n3Q0.js";import{C as Xn,a as es,m as pt,i as Vo,g as ts,b as fo,N as mo}from"./agent-icons-BQS7GC08.js";import{P as Bt,a as Ut,b as Kt}from"./popover-DKADBzsx.js";import{a as Xt,e as en,f as po,c as ho,C as xo,d as go,b as bo}from"./command-Eg_TSNDN.js";import{u as vo}from"./useInfiniteQuery-DCizzYPk.js";import{g as ns,A as yo}from"./sortable.esm-DzvMqAvs.js";import{t as Ao}from"./Stars01-Bbj7Y0Z1.js";import{P as It,a as jo,b as wo,u as Co,E as So,c as qt,i as No,d as ko}from"./scroll-area-Bcd6M0ah.js";import{S as _o}from"./index-D7JjC_Ha.js";import{D as Io,a as Eo,b as Ro,c as me,d as tn,e as nn,f as sn,h as To,i as Po}from"./dropdown-menu-Bp4U1b45.js";import{s as rn}from"./Plus-BMFN7EYn.js";import{p as Do,q as Mo}from"./question-004-sINsf4GQ.js";import{i as Fo}from"./ChevronRight-BZDLAZs0.js";function Oo(t,e){const n=Be(e);return Lo({filters:{...t,status:"pending"}},n).length}function on(t,e){return t.findAll(e.filters).map(n=>e.select?e.select(n):n.state)}function Lo(t={},e){const n=Be(e).getMutationCache(),r=w.useRef(t),o=w.useRef(null);return o.current===null&&(o.current=on(n,t)),w.useEffect(()=>{r.current=t}),w.useSyncExternalStore(w.useCallback(a=>n.subscribe(()=>{const l=$s(o.current,on(n,r.current));o.current!==l&&(o.current=l,zs.schedule(a))}),[n]),()=>o.current,()=>o.current)}const an=3,ss="inline-flex items-center gap-2 px-5 py-2.5 rounded-full bg-muted text-muted-foreground text-sm font-medium transition-colors cursor-pointer",$o="flex flex-col gap-1.5 p-4 rounded-xl bg-accent/40 text-sm leading-snug transition-colors cursor-pointer text-left";function rs(t){const e=O.c(46),{item:n,onSelect:r,isLoading:o,isDisabled:a,variant:l}=t,c=l===void 0?"pill":l,{prompt:u}=n;let d;if(e[0]!==u._meta||e[1]!==u.name||e[2]!==u.title){const N=de(u._meta);d=u.title??Mt(u.name,N),e[0]=u._meta,e[1]=u.name,e[2]=u.title,e[3]=d}else d=e[3];const V=d,i=u.description||null;if(c==="card"){let N;e[4]!==r||e[5]!==u?(N=()=>r(u),e[4]=r,e[5]=u,e[6]=N):N=e[6];const C=a||o,S=o&&"bg-accent/40",D=(a||o)&&"cursor-not-allowed opacity-50";let k;e[7]!==S||e[8]!==D?(k=B($o,"hover:bg-accent/60 text-foreground",S,D),e[7]=S,e[8]=D,e[9]=k):k=e[9];let P;e[10]!==V?(P=s.jsx("span",{className:"font-medium truncate capitalize",children:V}),e[10]=V,e[11]=P):P=e[11];let R;e[12]!==o?(R=o&&s.jsx(Ct,{size:"xs"}),e[12]=o,e[13]=R):R=e[13];let _;e[14]!==P||e[15]!==R?(_=s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[P,R]}),e[14]=P,e[15]=R,e[16]=_):_=e[16];let T;e[17]!==i?(T=i&&s.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:i}),e[17]=i,e[18]=T):T=e[18];let F;return e[19]!==_||e[20]!==T||e[21]!==N||e[22]!==C||e[23]!==k?(F=s.jsxs("button",{type:"button",onClick:N,disabled:C,className:k,children:[_,T]}),e[19]=_,e[20]=T,e[21]=N,e[22]=C,e[23]=k,e[24]=F):F=e[24],F}let m;e[25]!==r||e[26]!==u?(m=()=>r(u),e[25]=r,e[26]=u,e[27]=m):m=e[27];const f=a||o,x=o&&"bg-muted/50",p=(a||o)&&"cursor-not-allowed opacity-50";let h;e[28]!==x||e[29]!==p?(h=B(ss,"hover:bg-muted/70 hover:text-foreground",x,p),e[28]=x,e[29]=p,e[30]=h):h=e[30];let b;e[31]!==V?(b=s.jsx("span",{className:"capitalize",children:V}),e[31]=V,e[32]=b):b=e[32];let g;e[33]!==o?(g=o&&s.jsx(Ct,{size:"xs"}),e[33]=o,e[34]=g):g=e[34];let v;e[35]!==m||e[36]!==f||e[37]!==h||e[38]!==b||e[39]!==g?(v=s.jsx(xe,{asChild:!0,children:s.jsxs("button",{type:"button",onClick:m,disabled:f,className:h,children:[b,g]})}),e[35]=m,e[36]=f,e[37]=h,e[38]=b,e[39]=g,e[40]=v):v=e[40];const y=i??V;let j;e[41]!==y?(j=s.jsx(ge,{side:"top",className:"max-w-xs",children:s.jsx("p",{className:"text-xs",children:y})}),e[41]=y,e[42]=j):j=e[42];let A;return e[43]!==v||e[44]!==j?(A=s.jsxs(be,{delayDuration:400,children:[v,j]}),e[43]=v,e[44]=j,e[45]=A):A=e[45],A}function zo(t){const e=O.c(41),{items:n,open:r,onOpenChange:o,onSelect:a,loadingPrompt:l}=t,[c,u]=w.useState(""),d=!!l;let V;e[0]!==n||e[1]!==c?(V=c.trim()?n.filter(C=>{const S=c.toLowerCase();return C.prompt.name.toLowerCase().includes(S)||(C.prompt.title??"").toLowerCase().includes(S)||(C.prompt.description??"").toLowerCase().includes(S)}):n,e[0]=n,e[1]=c,e[2]=V):V=e[2];const i=V,m=kr();let f;e[3]!==i.length||e[4]!==c?(f=i.length===0&&s.jsxs("p",{className:"col-span-4 text-sm text-muted-foreground text-center py-8",children:["No prompts match “",c,"”"]}),e[3]=i.length,e[4]=c,e[5]=f):f=e[5];let x;if(e[6]!==i||e[7]!==d||e[8]!==l?.name||e[9]!==o||e[10]!==a){let C;e[12]!==d||e[13]!==l?.name||e[14]!==o||e[15]!==a?(C=S=>s.jsx(rs,{item:S,variant:"card",onSelect:D=>{o(!1),a(D)},isLoading:l?.name===S.prompt.name,isDisabled:d&&l?.name!==S.prompt.name},S.prompt.name),e[12]=d,e[13]=l?.name,e[14]=o,e[15]=a,e[16]=C):C=e[16],x=i.map(C),e[6]=i,e[7]=d,e[8]=l?.name,e[9]=o,e[10]=a,e[11]=x}else x=e[11];let p;e[17]!==f||e[18]!==x?(p=s.jsx("div",{className:"flex-1 overflow-y-auto [scrollbar-gutter:stable]",children:s.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3 p-5",children:[f,x]})}),e[17]=f,e[18]=x,e[19]=p):p=e[19];const h=p;let b;e[20]===Symbol.for("react.memo_cache_sentinel")?(b=C=>{C.key==="Escape"&&u("")},e[20]=b):b=e[20];let g;e[21]!==c?(g=s.jsx(Tr,{value:c,onChange:u,placeholder:"Search prompts...",onKeyDown:b}),e[21]=c,e[22]=g):g=e[22];const v=g;if(m){let C;e[23]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(_r,{className:"sr-only",children:s.jsx(Ir,{children:"All prompts"})}),e[23]=C):C=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:s.jsx("span",{className:"text-sm font-medium text-foreground",children:"Prompts"})}),e[24]=S):S=e[24];let D;e[25]!==h||e[26]!==v?(D=s.jsxs(Er,{className:"h-[85vh] flex flex-col p-0 gap-0",children:[C,S,v,h]}),e[25]=h,e[26]=v,e[27]=D):D=e[27];let k;return e[28]!==o||e[29]!==r||e[30]!==D?(k=s.jsx(St,{delayDuration:400,children:s.jsx(Rr,{open:r,onOpenChange:o,children:D})}),e[28]=o,e[29]=r,e[30]=D,e[31]=k):k=e[31],k}let y;e[32]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(lt,{className:"sr-only",children:s.jsx(it,{children:"All prompts"})}),e[32]=y):y=e[32];let j;e[33]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:s.jsx("span",{className:"text-sm font-medium text-foreground",children:"Prompts"})}),e[33]=j):j=e[33];let A;e[34]!==h||e[35]!==v?(A=s.jsxs(ct,{className:"sm:max-w-[1100px] h-[680px] p-0 gap-0 overflow-hidden flex flex-col",children:[y,j,v,h]}),e[34]=h,e[35]=v,e[36]=A):A=e[36];let N;return e[37]!==o||e[38]!==r||e[39]!==A?(N=s.jsx(St,{delayDuration:400,children:s.jsx(ut,{open:r,onOpenChange:o,children:A})}),e[37]=o,e[38]=r,e[39]=A,e[40]=N):N=e[40],N}function Bo(t){const e=O.c(29),{items:n,onSelect:r,loadingPrompt:o,className:a}=t,[l,c]=w.useState(!1);if(n.length===0)return null;let u,d,V;if(e[0]!==n||e[1]!==o||e[2]!==r){const b=n.slice(0,an);let g;e[6]!==n?(g=n.slice(an),e[6]=n,e[7]=g):g=e[7],u=g,d=!!o;let v;e[8]!==d||e[9]!==o?.name||e[10]!==r?(v=y=>s.jsx(rs,{item:y,onSelect:r,isLoading:o?.name===y.prompt.name,isDisabled:d&&o?.name!==y.prompt.name},y.prompt.name),e[8]=d,e[9]=o?.name,e[10]=r,e[11]=v):v=e[11],V=b.map(v),e[0]=n,e[1]=o,e[2]=r,e[3]=u,e[4]=d,e[5]=V}else u=e[3],d=e[4],V=e[5];const i=V;let m;e[12]!==a?(m=B("w-full flex flex-wrap gap-2 justify-center",a),e[12]=a,e[13]=m):m=e[13];let f;e[14]!==u.length||e[15]!==d?(f=u.length>0&&s.jsxs("button",{type:"button",disabled:d,onClick:()=>c(!0),className:B(ss,"hover:bg-muted/70 hover:text-foreground",d&&"opacity-50 cursor-not-allowed"),children:["+",u.length," more"]}),e[14]=u.length,e[15]=d,e[16]=f):f=e[16];let x;e[17]!==i||e[18]!==m||e[19]!==f?(x=s.jsxs("div",{className:m,children:[i,f]}),e[17]=i,e[18]=m,e[19]=f,e[20]=x):x=e[20];let p;e[21]!==n||e[22]!==o||e[23]!==l||e[24]!==r?(p=s.jsx(zo,{items:n,open:l,onOpenChange:c,onSelect:r,loadingPrompt:o}),e[21]=n,e[22]=o,e[23]=l,e[24]=r,e[25]=p):p=e[25];let h;return e[26]!==x||e[27]!==p?(h=s.jsxs(St,{delayDuration:400,children:[x,p]}),e[26]=x,e[27]=p,e[28]=h):h=e[28],h}function Uo(){return null}function Ko(t,e){switch(e.type){case"SELECT_PROMPT":return!e.prompt.arguments||e.prompt.arguments.length===0?{stage:"loading",prompt:e.prompt}:{stage:"idle"};case"START_LOADING":return{stage:"loading",prompt:e.prompt,arguments:e.arguments};case"RESET":return{stage:"idle"};default:return t}}function qo(t){const e=O.c(30),{connectionId:n}=t,{sendMessage:r}=Ue(),{org:o}=ie();let a;e[0]!==n||e[1]!==o.id||e[2]!==o.slug?(a={connectionId:n,orgId:o.id,orgSlug:o.slug},e[0]=n,e[1]=o.id,e[2]=o.slug,e[3]=a):a=e[3];const l=Re(a);let c;e[4]!==l?(c={client:l,staleTime:6e4},e[4]=l,e[5]=c):c=e[5];const{data:u}=Dr(c);let d;e[6]!==u?.prompts?(d=u?.prompts??[],e[6]=u?.prompts,e[7]=d):d=e[7];const V=d;let i;e[8]!==V?(i=V.map(Qo),e[8]=V,e[9]=i):i=e[9];const m=i;let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f={stage:"idle"},e[10]=f):f=e[10];const[x,p]=w.useReducer(Ko,f),[h,b]=w.useState(null);let g;e[11]!==l||e[12]!==r?(g=async(R,_)=>{if(!l){le.error("MCP client not available"),p({type:"RESET"});return}try{const T=await Vt(l,R.name,_);p({type:"RESET"});const F={type:"doc",content:[{type:"paragraph",content:[Ln({id:R.name,name:at(R.name,de(R._meta)),metadata:T.messages,char:"/",kind:"prompt",args:_}),{type:"text",text:" "}]}]};await r(F)}catch(T){console.error("[ice-breakers] Failed to fetch prompt:",T),le.error("Failed to load prompt. Please try again."),p({type:"RESET"})}},e[11]=l,e[12]=r,e[13]=g):g=e[13];const v=g;let y;e[14]!==v?(y=async R=>{if(R.arguments&&R.arguments.length>0){p({type:"SELECT_PROMPT",prompt:R}),b(R);return}p({type:"START_LOADING",prompt:R}),await v(R)},e[14]=v,e[15]=y):y=e[15];const j=y;let A;e[16]!==h||e[17]!==v?(A=async R=>{h&&(p({type:"START_LOADING",prompt:h,arguments:R}),b(null),await v(h,R))},e[16]=h,e[17]=v,e[18]=A):A=e[18];const N=A;if(m.length===0)return null;const C=x.stage==="loading"?x.prompt:null;let S;e[19]!==j||e[20]!==m||e[21]!==C?(S=s.jsx(Bo,{items:m,onSelect:j,loadingPrompt:C}),e[19]=j,e[20]=m,e[21]=C,e[22]=S):S=e[22];let D;e[23]===Symbol.for("react.memo_cache_sentinel")?(D=()=>{b(null),p({type:"RESET"})},e[23]=D):D=e[23];let k;e[24]!==h||e[25]!==N?(k=s.jsx(Je,{prompt:h,setPrompt:D,onSubmit:N}),e[24]=h,e[25]=N,e[26]=k):k=e[26];let P;return e[27]!==S||e[28]!==k?(P=s.jsxs(s.Fragment,{children:[S,k]}),e[27]=S,e[28]=k,e[29]=P):P=e[29],P}function Qo(t){return{prompt:t}}function Yo(t){const e=O.c(13),{className:n}=t,{selectedVirtualMcp:r}=fe(),{org:o}=ie();let a;e[0]!==o.id?(a=dt(o.id),e[0]=o.id,e[1]=a):a=e[1];const l=a.id,c=r?.id??l;let u;e[2]!==n?(u=B("w-full @container",n),e[2]=n,e[3]=u):u=e[3];const d=c??"default";let V;e[4]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx(Uo,{}),e[4]=V):V=e[4];let i;e[5]!==c?(i=s.jsx(qo,{connectionId:c}),e[5]=c,e[6]=i):i=e[6];let m;e[7]!==d||e[8]!==i?(m=s.jsx(Bs,{fallback:null,children:s.jsx(w.Suspense,{fallback:V,children:i},d)}),e[7]=d,e[8]=i,e[9]=m):m=e[9];let f;return e[10]!==u||e[11]!==m?(f=s.jsx("div",{className:u,children:m}),e[10]=u,e[11]=m,e[12]=f):f=e[12],f}const vt="cubic-bezier(0.645, 0.045, 0.355, 1)",Ho=44,Go={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-amber-500/5 after:pointer-events-none after:-z-10"},Wo={default:"border-border",error:"border-destructive/30",warning:"border-amber-500/30"},Jo={default:"text-muted-foreground",error:"text-destructive",warning:"text-amber-600 dark:text-amber-500"};function Ve(t){const e=O.c(61),{icon:n,label:r,count:o,title:a,footerLeft:l,footerRight:c,children:u,defaultExpanded:d,variant:V,onClose:i}=t,m=V===void 0?"default":V,[f,x]=w.useState(d),[p,h]=w.useState(!1);let b;e[0]!==i?(b=()=>{h(!0),i?.()},e[0]=i,e[1]=b):b=e[1];const g=b;if(p)return null;const v=Wo[m],y=Go[m];let j;e[2]!==v||e[3]!==y?(j=B("relative flex flex-col rounded-xl bg-background border shadow-md","w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",v,y),e[2]=v,e[3]=y,e[4]=j):j=e[4];let A;e[5]===Symbol.for("react.memo_cache_sentinel")?(A=()=>x(Zo),e[5]=A):A=e[5];const N=f&&"rounded-b-none",C=!f&&"rounded-b-xl";let S;e[6]!==N||e[7]!==C?(S=B("flex items-center gap-2 w-full px-3 py-2 text-sm text-left","hover:bg-accent/50 transition-colors rounded-t-xl",N,C),e[6]=N,e[7]=C,e[8]=S):S=e[8];const D=Jo[m];let k;e[9]!==D?(k=B("shrink-0",D),e[9]=D,e[10]=k):k=e[10];let P;e[11]!==n||e[12]!==k?(P=s.jsx("span",{className:k,children:n}),e[11]=n,e[12]=k,e[13]=P):P=e[13];let R;e[14]!==r?(R=s.jsx("span",{className:"flex-1 min-w-0 truncate",children:r}),e[14]=r,e[15]=R):R=e[15];let _;e[16]!==o?(_=o?s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:o}):null,e[16]=o,e[17]=_):_=e[17];const T=f?"rotate(180deg)":"rotate(0deg)";let F;e[18]!==T?(F=s.jsx("span",{"aria-hidden":"true",className:"text-muted-foreground shrink-0 flex items-center justify-center",children:s.jsx(ft,{size:16,style:{transform:T,transition:`transform 180ms ${vt}`}})}),e[18]=T,e[19]=F):F=e[19];let E,I;e[20]!==g?(E=ee=>{ee.stopPropagation(),g()},I=ee=>{(ee.key==="Enter"||ee.key===" ")&&(ee.preventDefault(),ee.stopPropagation(),g())},e[20]=g,e[21]=E,e[22]=I):(E=e[21],I=e[22]);let L;e[23]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(Me,{size:16}),e[23]=L):L=e[23];let z;e[24]!==E||e[25]!==I?(z=s.jsx("span",{role:"button",tabIndex:0,"data-testid":"collapsible-highlight-close","aria-label":"Close",title:"Close",onClick:E,onKeyDown:I,className:"text-muted-foreground hover:text-foreground transition-colors shrink-0 flex items-center justify-center -mr-1 ml-1 p-1 rounded-md hover:bg-accent",children:L}),e[24]=E,e[25]=I,e[26]=z):z=e[26];let $;e[27]!==f||e[28]!==P||e[29]!==R||e[30]!==_||e[31]!==F||e[32]!==z||e[33]!==S?($=s.jsxs("button",{type:"button","data-testid":"collapsible-highlight-chip","aria-expanded":f,onClick:A,className:S,children:[P,R,_,F,z]}),e[27]=f,e[28]=P,e[29]=R,e[30]=_,e[31]=F,e[32]=z,e[33]=S,e[34]=$):$=e[34];const q=f?"1fr":"0fr";let M;e[35]!==q?(M={display:"grid",gridTemplateRows:q,transition:`grid-template-rows 180ms ${vt}`},e[35]=q,e[36]=M):M=e[36];let U;e[37]===Symbol.for("react.memo_cache_sentinel")?(U={overflow:"hidden",minHeight:0},e[37]=U):U=e[37];const Q=f?1:0;let K;e[38]!==Q?(K={opacity:Q,transition:`opacity 120ms ${vt}`},e[38]=Q,e[39]=K):K=e[39];let Y;e[40]!==a?(Y=a?s.jsx("div",{className:"flex items-start gap-2 px-4 pt-4 pb-5 border-t border-dashed border-border/60",children:s.jsx("p",{className:"flex-1 text-base font-medium text-foreground min-w-0",children:a})}):s.jsx("div",{className:"border-t border-dashed border-border/60"}),e[40]=a,e[41]=Y):Y=e[41];let se;e[42]!==u||e[43]!==a?(se=u?s.jsx("div",{className:B("overflow-clip pb-4",!a&&"pt-4"),children:u}):null,e[42]=u,e[43]=a,e[44]=se):se=e[44];let X;e[45]!==l||e[46]!==c?(X=l||c?s.jsx("div",{className:"border-t border-border px-3 py-3 pb-6",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{children:l}),s.jsx("div",{className:"flex items-center gap-2",children:c})]})}):null,e[45]=l,e[46]=c,e[47]=X):X=e[47];let te;e[48]!==K||e[49]!==Y||e[50]!==se||e[51]!==X?(te=s.jsx("div",{style:U,children:s.jsxs("div",{style:K,children:[Y,se,X]})}),e[48]=K,e[49]=Y,e[50]=se,e[51]=X,e[52]=te):te=e[52];let W;e[53]!==M||e[54]!==te?(W=s.jsx("div",{"data-testid":"collapsible-highlight-body",style:M,children:te}),e[53]=M,e[54]=te,e[55]=W):W=e[55];let J;return e[56]!==$||e[57]!==W||e[58]!==j||e[59]!==m?(J=s.jsxs("div",{"data-testid":"collapsible-highlight","data-variant":m,className:j,children:[$,W]}),e[56]=$,e[57]=W,e[58]=j,e[59]=m,e[60]=J):J=e[60],J}function Zo(t){return!t}const Xo=he({content:_e().min(1).describe("Imperative form, e.g. 'Implement the login flow'"),status:Pt(["pending","in_progress","completed"]),activeForm:_e().min(1).describe("Present-continuous form shown in the UI while the todo is in progress, e.g. 'Implementing the login flow'")}),os=he({todos:Us(Xo)}),ea="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.";Mr({description:ea,inputSchema:Fr(os),execute:async({todos:t})=>({ok:!0,count:t.length})});const ta="tool-todo_write",na=new Set(["input-available","output-available"]);function as(t){for(let e=t.length-1;e>=0;e--){const n=t[e];if(n.role!=="assistant")continue;const r=n.parts;if(Array.isArray(r))for(let o=r.length-1;o>=0;o--){const a=r[o];if(a.type!==ta||typeof a.state!="string"||!na.has(a.state))continue;const l=os.safeParse(a.input);if(l.success)return l.data.todos}}return[]}function ls(t){const e=[];for(const n of t)if("state"in n&&n.state==="approval-requested"&&"approval"in n&&n.approval?.id&&"toolCallId"in n&&n.toolCallId){const r="toolName"in n&&typeof n.toolName=="string"?n.toolName:n.type.startsWith("tool-")?n.type.replace("tool-",""):"Tool";e.push({approvalId:n.approval.id,toolCallId:n.toolCallId,toolName:r,friendlyName:gr(br(r)),input:n.input})}return e}function is(t){const e=[];for(const n of t)if("type"in n&&n.type==="tool-propose_plan"&&"state"in n&&n.state==="input-available"&&"toolCallId"in n&&"input"in n){const r=n.input;e.push({toolCallId:n.toolCallId,plan:r.plan,state:n.state})}return e}function sa(t){return t?t.message.startsWith("[CREDITS]"):!1}const ra={isCreditExhausted:!1,hasTodos:!1,showError:!1,showWarning:!1,hasApprovals:!1,hasPlans:!1,isWaitingForUserInput:!1};function oa(t){const{messages:e,error:n,finishReason:r,isStreaming:o,isWaitingForApprovals:a}=t;if(!o&&n&&sa(n))return{...ra,isCreditExhausted:!0};const l=e.at(-1),c=l?.role==="assistant"?l.parts:[],u=c,V=!!u.filter(v=>v.type==="tool-user_ask").filter(v=>v.state!=="output-available").length,i=is(c),m=ls(u),f=as(e),x=!o&&!!n,p=m.length>0||o&&a,h=i.length>0,g=!o&&!!r&&r!=="stop"&&!(r==="tool-calls"&&(V||p||h))&&!x;return{isCreditExhausted:!1,hasTodos:f.length>0,showError:x,showWarning:g,hasApprovals:p,hasPlans:h,isWaitingForUserInput:V}}function cs(){const t=O.c(6),{messages:e,error:n,finishReason:r,isStreaming:o,isWaitingForApprovals:a}=Ue(),l=n??null,c=r??null;let u;return t[0]!==o||t[1]!==a||t[2]!==e||t[3]!==l||t[4]!==c?(u=oa({messages:e,error:l,finishReason:c,isStreaming:o,isWaitingForApprovals:a}),t[0]=o,t[1]=a,t[2]=e,t[3]=l,t[4]=c,t[5]=u):u=t[5],u}function aa(){const t=cs();return t.isCreditExhausted?0:Number(t.hasTodos)+Number(t.showError)+Number(t.showWarning)+Number(t.hasApprovals)+Number(t.hasPlans)+Number(t.isWaitingForUserInput)}function us(t){return!t||!t.content||t.content.length===0?!0:t.content.every(e=>e.type==="paragraph"?!e.content||e.content.length===0?!0:e.content.every(n=>n.type==="hardBreak"||n.type==="text"&&(!n.text||n.text.trim()==="")):!1)}const la="__home__";function Qt(t,e){return Ks.chatDraft(t,e)}function ia(t){if(!t)return null;let e;try{e=JSON.parse(t)}catch{return null}if(!e||typeof e!="object"||typeof e.updatedAt!="number")return null;const n=e.tiptapDoc;return!n||typeof n!="object"||n.type!=="doc"||!Array.isArray(n.content)?null:n}function ca(t,e,n,r,o){const a=Qt(e,n);if(us(r)){t.removeItem(a);return}const l={tiptapDoc:r,updatedAt:Date.now()},c=JSON.stringify(l);try{t.setItem(a,c)}catch(u){if(da(u)){const d=new TextEncoder().encode(c).byteLength;o?.onQuotaExceeded?.({docSizeBytes:d});return}throw u}}function ln(t,e,n){const r=Qt(e,n),o=t.getItem(r),a=ia(o);return o!==null&&a===null&&t.removeItem(r),a}function ua(t,e,n){t.removeItem(Qt(e,n))}function da(t){if(!t||typeof t!="object")return!1;const e=t.name;return e==="QuotaExceededError"||e==="NS_ERROR_DOM_QUOTA_REACHED"}function Va(t){const e=O.c(21),{current:n,total:r,onPrev:o,onNext:a}=t;if(r<=1)return null;const l=n===0,c=n===0?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let u;e[0]!==c?(u=B("p-0.5 rounded transition-colors",c),e[0]=c,e[1]=u):u=e[1];let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(ao,{size:14}),e[2]=d):d=e[2];let V;e[3]!==o||e[4]!==l||e[5]!==u?(V=s.jsx("button",{type:"button",onClick:o,disabled:l,className:u,"aria-label":"Previous question",children:d}),e[3]=o,e[4]=l,e[5]=u,e[6]=V):V=e[6];const i=n+1;let m;e[7]!==i||e[8]!==r?(m=s.jsxs("span",{className:"tabular-nums text-xs",children:[i," of ",r]}),e[7]=i,e[8]=r,e[9]=m):m=e[9];const f=n===r-1,x=n===r-1?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let p;e[10]!==x?(p=B("p-0.5 rounded transition-colors",x),e[10]=x,e[11]=p):p=e[11];let h;e[12]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Hn,{size:14}),e[12]=h):h=e[12];let b;e[13]!==a||e[14]!==p||e[15]!==f?(b=s.jsx("button",{type:"button",onClick:a,disabled:f,className:p,"aria-label":"Next question",children:h}),e[13]=a,e[14]=p,e[15]=f,e[16]=b):b=e[16];let g;return e[17]!==b||e[18]!==V||e[19]!==m?(g=s.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[V,m,b]}),e[17]=b,e[18]=V,e[19]=m,e[20]=g):g=e[20],g}function ds(t){const e=O.c(8),{currentIndex:n,total:r,onPrev:o,onNext:a,extraLeft:l}=t;let c;e[0]!==n||e[1]!==a||e[2]!==o||e[3]!==r?(c=s.jsx(Va,{current:n,total:r,onPrev:o,onNext:a}),e[0]=n,e[1]=a,e[2]=o,e[3]=r,e[4]=c):c=e[4];let u;return e[5]!==l||e[6]!==c?(u=s.jsxs("div",{className:"flex items-center gap-2",children:[c,l]}),e[5]=l,e[6]=c,e[7]=u):u=e[7],u}function fa(t){const e=O.c(17),{isStreaming:n,isAllAnswered:r,isCurrentAnswered:o,onAdvanceOrSubmit:a,submitLabel:l,nextLabel:c}=t,V=r?l===void 0?"Submit":l:c===void 0?"Next":c,i=r?n:!o,m=i?r?"Waiting for the assistant to finish…":"Answer this item to continue":null;let f;e[0]!==i||e[1]!==a?(f=()=>{i||a()},e[0]=i,e[1]=a,e[2]=f):f=e[2];const x=i&&"opacity-50 cursor-not-allowed";let p;e[3]!==x?(p=B("h-7 px-2.5 text-xs",x),e[3]=x,e[4]=p):p=e[4];let h;e[5]!==i||e[6]!==V||e[7]!==f||e[8]!==p?(h=s.jsx(re,{type:"button",size:"sm","aria-disabled":i,onClick:f,className:p,children:V}),e[5]=i,e[6]=V,e[7]=f,e[8]=p,e[9]=h):h=e[9];const b=h;if(!m)return b;let g;e[10]!==b?(g=s.jsx(xe,{asChild:!0,children:b}),e[10]=b,e[11]=g):g=e[11];let v;e[12]!==m?(v=s.jsx(ge,{children:m}),e[12]=m,e[13]=v):v=e[13];let y;return e[14]!==g||e[15]!==v?(y=s.jsxs(be,{children:[g,v]}),e[14]=g,e[15]=v,e[16]=y):y=e[16],y}function Vs(t,e,n){return t.findIndex(r=>e(r)===n)}function cn(t,e,n,r){return t.length===0?!1:t.every(o=>r(n[e(o)]))}function un(t,e,n,r,o){if(t.length===0)return null;const a=Vs(t,e,o);for(let l=1;l<=t.length;l++){const c=t[(a+l)%t.length];if(!c)continue;const u=e(c);if(u!==o&&!r(n[u]))return u}return null}function ma(t){return!t.isStreaming&&t.allAnswered}function fs(t){const{parts:e,partKey:n,schema:r,defaultValues:o,isStreaming:a,hasAnswer:l,onSubmit:c}=t,u=e[0]?n(e[0]):"",[d,V]=w.useState(u),[i,m]=w.useState(!1),f=qs({resolver:Qs(r),defaultValues:o}),x=f.watch(),p=Vs(e,n,d),h=p>=0?e[p]:void 0,b=l(x[d]),g=cn(e,n,x,l),v=ma({isStreaming:a,allAnswered:g}),y=()=>{if(p>0){const k=e[p-1];k&&V(n(k))}},j=()=>{if(p>=0&&p<e.length-1){const k=e[p+1];k&&V(n(k))}},A=()=>{const k=f.getValues(),P=un(e,n,k,l,d);P&&V(P)},N=()=>{f.handleSubmit(k=>{const P=k;for(const R of e)c(R,P[n(R)])})()},C=w.useRef(N);C.current=N;const S=()=>{v&&(m(!1),C.current())},D=()=>{const k=f.getValues();if(cn(e,n,k,l)){if(a){m(!0);return}m(!1),C.current()}else{const P=un(e,n,k,l,d);P&&V(P)}};return w.useEffect(()=>{if(i&&!a){if(!g){m(!1);return}m(!1),C.current()}},[i,a,g]),{form:f,activeKey:d,setActiveKey:V,currentIndex:p,currentPart:h,isCurrentAnswered:b,isAllAnswered:g,canSubmit:v,goPrev:y,goNext:j,advanceToNextUnanswered:A,submit:S,submitOrAdvance:D}}const ms="User denied this tool call, give other alternatives.";function ps(t){const e=O.c(9),{onYolo:n}=t,[r,o]=Ee();let a;e[0]!==n||e[1]!==r||e[2]!==o?(a=V=>{const i=V;o({...r,toolApprovalLevel:i}),i==="auto"&&n(i)},e[0]=n,e[1]=r,e[2]=o,e[3]=a):a=e[3];const l=a;let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ro,{size:"xs",className:"text-xs text-muted-foreground border-border/60 bg-transparent hover:bg-accent/60 h-7 gap-1",onClick:ha,children:s.jsx(oo,{})}),e[4]=c):c=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(to,{children:De.map(pa)}),e[5]=u):u=e[5];let d;return e[6]!==l||e[7]!==r.toolApprovalLevel?(d=s.jsxs(no,{value:r.toolApprovalLevel,onValueChange:l,children:[c,u]}),e[6]=l,e[7]=r.toolApprovalLevel,e[8]=d):d=e[8],d}function pa(t){return s.jsx(so,{value:t.value,children:t.label},t.value)}function ha(t){return t.stopPropagation()}function hs(t){const e=O.c(5),{input:n}=t;if(n==null){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"px-4 text-xs text-muted-foreground",children:"No input"}),e[0]=a):a=e[0],a}let r;try{let a;e[1]!==n?(a=JSON.stringify(n,null,2),e[1]=n,e[2]=a):a=e[2],r=a}catch{r=String(n)}let o;return e[3]!==r?(o=s.jsx("div",{className:"px-4",children:s.jsx("pre",{className:"text-xs font-mono text-muted-foreground/70 whitespace-pre-wrap wrap-break-word max-h-32 overflow-y-auto rounded-md bg-muted/30 px-3 py-2",children:r})}),e[3]=r,e[4]=o):o=e[4],o}function xa(t){const e=O.c(28),{approval:n,onRespond:r}=t,[o]=Ee(),a=o.toolApprovalLevel??"readonly";let l;e[0]!==n.approvalId||e[1]!==a||e[2]!==r?(l=()=>r(n.approvalId,!1,ms,a),e[0]=n.approvalId,e[1]=a,e[2]=r,e[3]=l):l=e[3];const c=l;let u;e[4]!==n.approvalId||e[5]!==a||e[6]!==r?(u=()=>r(n.approvalId,!0,void 0,a),e[4]=n.approvalId,e[5]=a,e[6]=r,e[7]=u):u=e[7];const d=u;let V;e[8]!==n.approvalId||e[9]!==r?(V=j=>r(n.approvalId,!0,void 0,j),e[8]=n.approvalId,e[9]=r,e[10]=V):V=e[10];const i=V;let m;e[11]!==i?(m=s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(ps,{onYolo:i})}),e[11]=i,e[12]=m):m=e[12];const f=m;let x;e[13]!==c?(x=s.jsx(re,{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:c,children:"Deny"}),e[13]=c,e[14]=x):x=e[14];let p;e[15]!==d?(p=s.jsx(re,{type:"button",size:"sm",className:"h-7 px-2.5 text-xs active:scale-[0.97] transition-transform",onClick:d,children:"Accept"}),e[15]=d,e[16]=p):p=e[16];let h;e[17]!==x||e[18]!==p?(h=s.jsxs(s.Fragment,{children:[x,p]}),e[17]=x,e[18]=p,e[19]=h):h=e[19];const b=h;let g;e[20]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(mt,{size:14}),e[20]=g):g=e[20];let v;e[21]!==n.input?(v=s.jsx(hs,{input:n.input}),e[21]=n.input,e[22]=v):v=e[22];let y;return e[23]!==n.friendlyName||e[24]!==f||e[25]!==b||e[26]!==v?(y=s.jsx(Ve,{icon:g,label:"Approval needed",title:n.friendlyName,defaultExpanded:!0,footerLeft:f,footerRight:b,children:v}),e[23]=n.friendlyName,e[24]=f,e[25]=b,e[26]=v,e[27]=y):y=e[27],y}const ga=Ys(_e(),he({approved:Hs().optional(),levelOverride:Pt(["auto","readonly"]).optional()}));function ba(t){const e=O.c(42),{approvals:n,isStreaming:r,onRespond:o}=t,[a]=Ee(),l=a.toolApprovalLevel??"readonly";let c;e[0]!==n?(c=Object.fromEntries(n.map(Aa)),e[0]=n,e[1]=c):c=e[1];const u=c;let d;e[2]!==l||e[3]!==o?(d=(D,k)=>{const P=k;typeof P?.approved=="boolean"&&o(D.approvalId,P.approved,P.approved===!1?ms:void 0,P.levelOverride??l)},e[2]=l,e[3]=o,e[4]=d):d=e[4];let V;e[5]!==n||e[6]!==u||e[7]!==r||e[8]!==d?(V={parts:n,partKey:ya,schema:ga,defaultValues:u,isStreaming:r,hasAnswer:va,onSubmit:d},e[5]=n,e[6]=u,e[7]=r,e[8]=d,e[9]=V):V=e[9];const i=fs(V);let m;e[10]!==n||e[11]!==i?(m=D=>{i.form.reset(Object.fromEntries(n.map(k=>[k.approvalId,{approved:!0,levelOverride:D}]))),i.submitOrAdvance()},e[10]=n,e[11]=i,e[12]=m):m=e[12];const f=m,x=i.currentPart;let p;e[13]!==i?(p=D=>{D.preventDefault(),i.submit()},e[13]=i,e[14]=p):p=e[14];let h;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(mt,{size:14}),e[15]=h):h=e[15];const b=`${n.length} approvals pending`,g=x?.friendlyName??"";let v;e[16]!==f?(v=s.jsx(ps,{onYolo:f}),e[16]=f,e[17]=v):v=e[17];let y;e[18]!==n.length||e[19]!==i.currentIndex||e[20]!==i.goNext||e[21]!==i.goPrev||e[22]!==v?(y=s.jsx(ds,{currentIndex:i.currentIndex,total:n.length,onPrev:i.goPrev,onNext:i.goNext,extraLeft:v}),e[18]=n.length,e[19]=i.currentIndex,e[20]=i.goNext,e[21]=i.goPrev,e[22]=v,e[23]=y):y=e[23];let j;e[24]!==x||e[25]!==i.form.control||e[26]!==i.submitOrAdvance?(j=x?s.jsx(ja,{approvalId:x.approvalId,control:i.form.control,onChange:i.submitOrAdvance}):null,e[24]=x,e[25]=i.form.control,e[26]=i.submitOrAdvance,e[27]=j):j=e[27];let A;e[28]!==x?(A=x?s.jsx(hs,{input:x.input}):null,e[28]=x,e[29]=A):A=e[29];let N;e[30]!==y||e[31]!==j||e[32]!==A||e[33]!==b||e[34]!==g?(N=s.jsx(Ve,{icon:h,label:b,title:g,defaultExpanded:!0,footerLeft:y,footerRight:j,children:A}),e[30]=y,e[31]=j,e[32]=A,e[33]=b,e[34]=g,e[35]=N):N=e[35];let C;e[36]!==N||e[37]!==p?(C=s.jsx("form",{onSubmit:p,children:N}),e[36]=N,e[37]=p,e[38]=C):C=e[38];let S;return e[39]!==i.form||e[40]!==C?(S=s.jsx(kt,{...i.form,children:C}),e[39]=i.form,e[40]=C,e[41]=S):S=e[41],S}function va(t){return typeof t?.approved=="boolean"}function ya(t){return t.approvalId}function Aa(t){return[t.approvalId,{approved:void 0}]}function ja(t){const e=O.c(6),{approvalId:n,control:r,onChange:o}=t,a=`${n}.approved`;let l;e[0]!==o?(l=u=>{const{field:d}=u,V=d.value===!0,i=d.value===!1;return s.jsxs(s.Fragment,{children:[s.jsx(re,{type:"button",variant:i?"secondary":"ghost",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{d.onChange(!1),o()},"aria-pressed":i,children:"Deny"}),s.jsx(re,{type:"button",variant:V?"default":"outline",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{d.onChange(!0),o()},"aria-pressed":V,children:"Accept"})]})},e[0]=o,e[1]=l):l=e[1];let c;return e[2]!==r||e[3]!==a||e[4]!==l?(c=s.jsx(Gs,{control:r,name:a,render:l}),e[2]=r,e[3]=a,e[4]=l,e[5]=c):c=e[5],c}function wa(){const t=O.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex items-center gap-2 p-4 border border-dashed rounded-lg bg-accent/50 w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",children:[s.jsx(mt,{className:"size-5 text-muted-foreground shimmer"}),s.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:"Preparing approval request..."})]}),t[0]=e):e=t[0],e}function Ca(t){const e=O.c(8),{approvals:n,isStreaming:r,onRespond:o}=t;if(r&&n.length===0){let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(wa,{}),e[0]=l):l=e[0],l}if(n.length===0)return null;if(n.length===1){const l=n[0];if(!l)return null;let c;return e[1]!==o||e[2]!==l?(c=s.jsx(xa,{approval:l,onRespond:o}),e[1]=o,e[2]=l,e[3]=c):c=e[3],c}let a;return e[4]!==n||e[5]!==r||e[6]!==o?(a=s.jsx(ba,{approvals:n,isStreaming:r,onRespond:o}),e[4]=n,e[5]=r,e[6]=o,e[7]=a):a=e[7],a}function Sa(t){const e=O.c(16),{plan:n,onApprove:r,onDismiss:o}=t;let a;e[0]!==r||e[1]!==n.plan?(a=()=>{r(n.plan)},e[0]=r,e[1]=n.plan,e[2]=a):a=e[2];const l=a;let c;e[3]!==o?(c=s.jsx(re,{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:o,children:"Keep iterating"}),e[3]=o,e[4]=c):c=e[4];let u;e[5]!==l?(u=s.jsx(re,{type:"button",size:"sm",className:"h-7 px-2.5 text-xs bg-purple-600 hover:bg-purple-700 text-white active:scale-[0.97] transition-transform",onClick:l,children:"Let's go"}),e[5]=l,e[6]=u):u=e[6];let d;e[7]!==c||e[8]!==u?(d=s.jsxs(s.Fragment,{children:[c,u]}),e[7]=c,e[8]=u,e[9]=d):d=e[9];const V=d;let i;e[10]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Qr,{size:14}),e[10]=i):i=e[10];let m;e[11]!==n.plan?(m=s.jsx("div",{className:"px-4 max-h-64 overflow-y-auto",children:s.jsx("div",{className:"prose prose-sm max-w-none text-sm",children:s.jsx(vr,{id:"plan-preview",part:{type:"text",text:n.plan}})})}),e[11]=n.plan,e[12]=m):m=e[12];let f;return e[13]!==V||e[14]!==m?(f=s.jsx(Ve,{icon:i,label:"Plan ready",title:"Implementation Plan",defaultExpanded:!0,footerRight:V,children:m}),e[13]=V,e[14]=m,e[15]=f):f=e[15],f}function Na(){const t=O.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex items-center gap-2 p-4 border border-dashed border-purple-500/30 rounded-lg bg-purple-500/5 w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",children:[s.jsx(Ke,{className:"size-5 text-purple-500 shimmer"}),s.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:"Preparing plan..."})]}),t[0]=e):e=t[0],e}function ka(t){const e=O.c(7),{plans:n,isStreaming:r,onApprove:o,onDismiss:a}=t;if(r&&n.length===0){let d;return e[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Na,{}),e[0]=d):d=e[0],d}let l;e[1]!==n?(l=n.at(-1),e[1]=n,e[2]=l):l=e[2];const c=l;if(!c)return null;let u;return e[3]!==c||e[4]!==o||e[5]!==a?(u=s.jsx(Sa,{plan:c,onApprove:o,onDismiss:a}),e[3]=c,e[4]=o,e[5]=a,e[6]=u):u=e[6],u}function xs(t){return t?"response"in t?t.response:t.option??t.draft:""}const dn=he({response:_e().min(1,"Response is required")}),_a=he({option:_e().nullable(),draft:_e()}).refine(t=>(t.option??t.draft).length>0,{message:"Please select or enter an option"}),Ia=he({response:Pt(["yes","no"])});function Ea(t){switch(t.type){case"text":return dn;case"choice":return _a;case"confirm":return Ia;default:return dn}}function Ra(t){const e={};for(const n of t)e[n.toolCallId]=Ea(n.input);return he(e)}function Ta(t){const e=O.c(6),{control:n,name:r,placeholder:o}=t;let a;e[0]!==o?(a=c=>{const{field:u}=c,d=u.value??"";return s.jsxs(Ot,{children:[s.jsx(Lt,{children:s.jsx("div",{className:"px-2",children:s.jsxs("div",{className:"flex items-center gap-3 px-2 py-3 rounded-lg bg-accent/50",children:[s.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:s.jsx(Un,{size:16,className:"text-muted-foreground"})}),s.jsx("input",{...u,value:d,type:"text",placeholder:o||"Type your response...",autoFocus:!0,"aria-label":"Text response input",className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"})]})})}),s.jsx($t,{})]})},e[0]=o,e[1]=a):a=e[1];let l;return e[2]!==n||e[3]!==r||e[4]!==a?(l=s.jsx(Yn,{control:n,name:r,render:a}),e[2]=n,e[3]=r,e[4]=a,e[5]=l):l=e[5],l}function gs(t,e){const n=O.c(4);let r,o;n[0]!==t||n[1]!==e?(r=()=>{const a=l=>{const c=l.target.tagName;if(c==="INPUT"||c==="TEXTAREA"||l.metaKey||l.ctrlKey||l.altKey)return;const u=Number.parseInt(l.key,10);u>=1&&u<=t&&(l.preventDefault(),e(u-1))};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},o=[t,e],n[0]=t,n[1]=e,n[2]=r,n[3]=o):(r=n[2],o=n[3]),w.useEffect(r,o)}function Pa(t){const e=O.c(40),{control:n,name:r,options:o}=t,a=`${r}.option`;let l;e[0]!==n||e[1]!==a?(l={control:n,name:a,defaultValue:null},e[0]=n,e[1]=a,e[2]=l):l=e[2];const{field:c}=Wt(l),u=`${r}.draft`;let d;e[3]!==n||e[4]!==u?(d={control:n,name:u,defaultValue:""},e[3]=n,e[4]=u,e[5]=d):d=e[5];const{field:V}=Wt(d),i=c.value,m=V.value??"";let f;if(e[6]!==c||e[7]!==o?(f=P=>{const R=o[P];R!=null&&c.onChange(R)},e[6]=c,e[7]=o,e[8]=f):f=e[8],gs(o.length,f),o.length===0)return null;const x=i===null;let p;if(e[9]!==c||e[10]!==i||e[11]!==o){let P;e[13]!==c||e[14]!==i?(P=(R,_)=>{const T=i===R;return s.jsxs("button",{type:"button",onClick:()=>c.onChange(R),className:B("flex items-center gap-3 px-2 py-3 rounded-lg text-left transition-colors w-full",T&&"bg-accent/50",!T&&"hover:bg-accent/30"),"aria-label":`Select ${R}`,children:[s.jsx("span",{className:B("flex items-center justify-center size-6 rounded-md text-sm shrink-0",T?"bg-chart-1 text-white":"bg-muted text-foreground"),children:_+1}),s.jsx("span",{className:"text-sm text-foreground truncate",children:R})]},`${_}-${R}`)},e[13]=c,e[14]=i,e[15]=P):P=e[15],p=o.map(P),e[9]=c,e[10]=i,e[11]=o,e[12]=p}else p=e[12];const h=x&&"bg-accent/50",b=!x&&"hover:bg-accent/30";let g;e[16]!==h||e[17]!==b?(g=B("flex items-center gap-3 px-2 py-3 rounded-lg transition-colors w-full cursor-text",h,b),e[16]=h,e[17]=b,e[18]=g):g=e[18];let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:s.jsx(Un,{size:16,className:"text-muted-foreground"})}),e[19]=v):v=e[19];const y=x?m:"";let j;e[20]!==V||e[21]!==c||e[22]!==i?(j=P=>{V.onChange(P.target.value),i!==null&&c.onChange(null)},e[20]=V,e[21]=c,e[22]=i,e[23]=j):j=e[23];let A;e[24]!==c||e[25]!==i?(A=()=>{i!==null&&c.onChange(null)},e[24]=c,e[25]=i,e[26]=A):A=e[26];let N;e[27]!==y||e[28]!==j||e[29]!==A?(N=s.jsx("input",{type:"text",value:y,onChange:j,onFocus:A,placeholder:"Something else...","aria-label":"Custom choice input",className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"}),e[27]=y,e[28]=j,e[29]=A,e[30]=N):N=e[30];let C;e[31]!==N||e[32]!==g?(C=s.jsxs("label",{className:g,children:[v,N]}),e[31]=N,e[32]=g,e[33]=C):C=e[33];let S;e[34]!==C||e[35]!==p?(S=s.jsx(Lt,{children:s.jsxs("div",{className:"flex flex-col px-2",role:"group","aria-label":"Choice options",children:[p,C]})}),e[34]=C,e[35]=p,e[36]=S):S=e[36];let D;e[37]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx($t,{}),e[37]=D):D=e[37];let k;return e[38]!==S?(k=s.jsxs(Ot,{children:[S,D]}),e[38]=S,e[39]=k):k=e[39],k}function Da(t){const e=O.c(6),{control:n,name:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=["yes","no"],e[0]=o):o=e[0];const a=o,l=w.useRef(null);let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=V=>{l.current?.onChange(a[V]??"")},e[1]=c):c=e[1],gs(a.length,c);let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=V=>{const{field:i}=V;return l.current=i,s.jsxs(Ot,{children:[s.jsx(Lt,{children:s.jsx("div",{className:"flex gap-2 px-2",role:"group","aria-label":"Confirmation options",children:a.map(m=>{const f=i.value===m;return s.jsxs("button",{type:"button",onClick:()=>i.onChange(m),className:B("flex items-center gap-3 px-4 py-3 rounded-lg text-left transition-colors flex-1",f&&"bg-accent/50",!f&&"hover:bg-accent/30"),"aria-label":`Confirm ${m}`,children:[s.jsx("span",{className:B("flex items-center justify-center size-6 rounded-md text-sm shrink-0",f?"bg-chart-1 text-white":"bg-muted text-foreground"),children:m==="yes"?1:2}),s.jsx("span",{className:"text-sm text-foreground capitalize",children:m})]},m)})})}),s.jsx($t,{})]})},e[2]=u):u=e[2];let d;return e[3]!==n||e[4]!==r?(d=s.jsx(Yn,{control:n,name:r,render:u}),e[3]=n,e[4]=r,e[5]=d):d=e[5],d}function Vn(t){const e=O.c(13),{input:n,control:r,toolCallId:o}=t;switch(n.type){case"text":{const a=`${o}.response`;let l;return e[0]!==r||e[1]!==n.default||e[2]!==a?(l=s.jsx(Ta,{control:r,name:a,placeholder:n.default}),e[0]=r,e[1]=n.default,e[2]=a,e[3]=l):l=e[3],l}case"choice":{let a;e[4]!==n.options?(a=n.options?.filter(Boolean)??[],e[4]=n.options,e[5]=a):a=e[5];const l=a;let c;return e[6]!==r||e[7]!==l||e[8]!==o?(c=s.jsx(Pa,{control:r,name:o,options:l}),e[6]=r,e[7]=l,e[8]=o,e[9]=c):c=e[9],c}case"confirm":{const a=`${o}.response`;let l;return e[10]!==r||e[11]!==a?(l=s.jsx(Da,{control:r,name:a}),e[10]=r,e[11]=a,e[12]=l):l=e[12],l}default:return null}}function Ma(t){const e=O.c(71),{parts:n,isStreaming:r,onSubmit:o}=t;let a;e[0]!==n?(a=Ra(n.map($a)),e[0]=n,e[1]=a):a=e[1];const l=a;let c;e[2]!==n?(c=Object.fromEntries(n.map(La)),e[2]=n,e[3]=c):c=e[3];const u=c;let d;e[4]!==o?(d=(E,I)=>{const L=xs(I);L&&o(E,L)},e[4]=o,e[5]=d):d=e[5];let V;e[6]!==u||e[7]!==r||e[8]!==n||e[9]!==l||e[10]!==d?(V={parts:n,partKey:Oa,schema:l,defaultValues:u,isStreaming:r,hasAnswer:Fa,onSubmit:d},e[6]=u,e[7]=r,e[8]=n,e[9]=l,e[10]=d,e[11]=V):V=e[11];const i=fs(V),m=i.currentPart;let f;e[12]!==m||e[13]!==i?(f=()=>{const E=m;if(!E)return;const I=E.toolCallId;E.input?.type==="choice"?(i.form.setValue(`${I}.option`,null),i.form.setValue(`${I}.draft`,"user has skip this question")):i.form.setValue(`${I}.response`,"user has skip this question"),i.advanceToNextUnanswered()},e[12]=m,e[13]=i,e[14]=f):f=e[14];const x=f;let p;e[15]!==i.currentIndex||e[16]!==i.goNext||e[17]!==i.goPrev||e[18]!==n.length?(p=s.jsx(ds,{currentIndex:i.currentIndex,total:n.length,onPrev:i.goPrev,onNext:i.goNext}),e[15]=i.currentIndex,e[16]=i.goNext,e[17]=i.goPrev,e[18]=n.length,e[19]=p):p=e[19];const h=p;let b;e[20]!==x?(b=s.jsx(re,{type:"button",variant:"outline",size:"sm",onClick:x,className:"h-7",children:"Skip"}),e[20]=x,e[21]=b):b=e[21];let g;e[22]!==i.isAllAnswered||e[23]!==i.isCurrentAnswered||e[24]!==i.submitOrAdvance||e[25]!==r?(g=s.jsx(fa,{isStreaming:r,isAllAnswered:i.isAllAnswered,isCurrentAnswered:i.isCurrentAnswered,onAdvanceOrSubmit:i.submitOrAdvance}),e[22]=i.isAllAnswered,e[23]=i.isCurrentAnswered,e[24]=i.submitOrAdvance,e[25]=r,e[26]=g):g=e[26];let v;e[27]!==b||e[28]!==g?(v=s.jsxs(s.Fragment,{children:[b,g]}),e[27]=b,e[28]=g,e[29]=v):v=e[29];const y=v;if(n.length===1){const E=n[0];if(!E?.input)return null;let I;e[30]!==i?(I=K=>{K.preventDefault(),i.submit()},e[30]=i,e[31]=I):I=e[31];let L;e[32]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(_t,{size:14}),e[32]=L):L=e[32];const z=E.input?.prompt??"Question",$=E.input;let q;e[33]!==i.form.control||e[34]!==E.toolCallId||e[35]!==$?(q=s.jsx(Vn,{input:$,control:i.form.control,toolCallId:E.toolCallId}),e[33]=i.form.control,e[34]=E.toolCallId,e[35]=$,e[36]=q):q=e[36];let M;e[37]!==y||e[38]!==z||e[39]!==q?(M=s.jsx(Ve,{icon:L,label:"Question pending",title:z,defaultExpanded:!0,footerRight:y,children:q}),e[37]=y,e[38]=z,e[39]=q,e[40]=M):M=e[40];let U;e[41]!==I||e[42]!==M?(U=s.jsx("form",{onSubmit:I,autoComplete:"off",children:M}),e[41]=I,e[42]=M,e[43]=U):U=e[43];let Q;return e[44]!==i.form||e[45]!==U?(Q=s.jsx(kt,{...i.form,children:U}),e[44]=i.form,e[45]=U,e[46]=Q):Q=e[46],Q}const j=i.form;let A;e[47]!==i?(A=E=>{E.preventDefault(),i.submit()},e[47]=i,e[48]=A):A=e[48];let N;e[49]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(_t,{size:14}),e[49]=N):N=e[49];const C=`${i.currentIndex+1} of ${n.length}`,S=m?.input?.prompt??"Question",D=i.activeKey,k=i.setActiveKey;let P;if(e[50]!==i.form||e[51]!==n){let E;e[53]!==i.form?(E=I=>s.jsx(io,{value:I.toolCallId,className:"mt-0",children:s.jsx(Vn,{input:I.input,control:i.form.control,toolCallId:I.toolCallId})},I.toolCallId),e[53]=i.form,e[54]=E):E=e[54],P=n.map(E),e[50]=i.form,e[51]=n,e[52]=P}else P=e[52];let R;e[55]!==i.activeKey||e[56]!==i.setActiveKey||e[57]!==P?(R=s.jsx(co,{value:D,onValueChange:k,children:P}),e[55]=i.activeKey,e[56]=i.setActiveKey,e[57]=P,e[58]=R):R=e[58];let _;e[59]!==h||e[60]!==y||e[61]!==C||e[62]!==S||e[63]!==R?(_=s.jsx(Ve,{icon:N,label:"Question pending",count:C,title:S,defaultExpanded:!0,footerLeft:h,footerRight:y,children:R}),e[59]=h,e[60]=y,e[61]=C,e[62]=S,e[63]=R,e[64]=_):_=e[64];let T;e[65]!==A||e[66]!==_?(T=s.jsx("form",{onSubmit:A,autoComplete:"off",children:_}),e[65]=A,e[66]=_,e[67]=T):T=e[67];let F;return e[68]!==i.form||e[69]!==T?(F=s.jsx(kt,{...j,children:T}),e[68]=i.form,e[69]=T,e[70]=F):F=e[70],F}function Fa(t){return!!xs(t)}function Oa(t){return t.toolCallId}function La(t){return t.input?.type==="choice"?[t.toolCallId,{option:null,draft:""}]:[t.toolCallId,{response:""}]}function $a(t){return{toolCallId:t.toolCallId,input:t.input}}function za(){const t=O.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex items-center gap-2 p-4 border border-dashed rounded-lg bg-accent/50 w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",children:[s.jsx(_t,{className:"size-5 text-muted-foreground shimmer"}),s.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:"Preparing question..."})]}),t[0]=e):e=t[0],e}function bs(t){const e=O.c(7),{userAskParts:n,isStreaming:r,onSubmit:o}=t;let a;e[0]!==n?(a=n.filter(Ba),e[0]=n,e[1]=a):a=e[1];const l=a;if(l.length===0){if(r){let u;return e[2]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(za,{}),e[2]=u):u=e[2],u}return null}let c;return e[3]!==r||e[4]!==o||e[5]!==l?(c=s.jsx(Ma,{parts:l,isStreaming:r,onSubmit:o}),e[3]=r,e[4]=o,e[5]=l,e[6]=c):c=e[6],c}function Ba(t){return t.state==="input-available"}function Ua(t){const e=t.filter(a=>a.status==="in_progress"),n=t.filter(a=>a.status==="completed").length,r=t.length;if(r>0&&n===r)return{icon:"completed",activity:"All done",progress:`${r}/${r}`};const[o]=e;return o&&e.length===1?{icon:"in_progress",activity:o.activeForm,progress:`${n}/${r} done`}:e.length>1?{icon:"in_progress",activity:`${e.length} in progress`,progress:`${n}/${r} done`}:n>0?{icon:"pending",activity:`${r-n} pending`,progress:`${n}/${r} done`}:{icon:"pending",activity:`${r} todos`,progress:"not started"}}function Ka(){const t=O.c(21),{messages:e}=Ue();let n,r,o,a,l,c,u,d,V;if(t[0]!==e){V=Symbol.for("react.early_return_sentinel");e:{const f=as(e);if(f.length===0){V=null;break e}const x=Ua(f);n=Ve,l=s.jsx(Ha,{status:x.icon}),c=x.activity,u=x.progress,d=!1,r="todos-list",o="flex flex-col px-2 max-h-[40vh] overflow-y-auto",a=f.map(qa)}t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=a,t[5]=l,t[6]=c,t[7]=u,t[8]=d,t[9]=V}else n=t[1],r=t[2],o=t[3],a=t[4],l=t[5],c=t[6],u=t[7],d=t[8],V=t[9];if(V!==Symbol.for("react.early_return_sentinel"))return V;let i;t[10]!==r||t[11]!==o||t[12]!==a?(i=s.jsx("ul",{"data-testid":r,className:o,children:a}),t[10]=r,t[11]=o,t[12]=a,t[13]=i):i=t[13];let m;return t[14]!==n||t[15]!==l||t[16]!==c||t[17]!==u||t[18]!==d||t[19]!==i?(m=s.jsx(n,{icon:l,label:c,count:u,defaultExpanded:d,children:i}),t[14]=n,t[15]=l,t[16]=c,t[17]=u,t[18]=d,t[19]=i,t[20]=m):m=t[20],m}function qa(t,e){return s.jsx(Qa,{todo:t},e)}function Qa(t){const e=O.c(14),{todo:n}=t,r=n.status==="completed",a=n.status==="in_progress"?n.activeForm:n.content;let l;e[0]!==n.status?(l=s.jsx(Ya,{status:n.status}),e[0]=n.status,e[1]=l):l=e[1];const c=r&&"text-muted-foreground";let u;e[2]!==c?(u=B("relative text-sm leading-snug pt-px select-none",c),e[2]=c,e[3]=u):u=e[3];const d=r?"100%":"0%",V=r?"width 300ms ease 200ms":"width 150ms ease";let i;e[4]!==d||e[5]!==V?(i=s.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:"50%",height:"1px",background:"currentColor",width:d,transition:V}}),e[4]=d,e[5]=V,e[6]=i):i=e[6];let m;e[7]!==a||e[8]!==u||e[9]!==i?(m=s.jsxs("span",{className:u,children:[a,i]}),e[7]=a,e[8]=u,e[9]=i,e[10]=m):m=e[10];let f;return e[11]!==l||e[12]!==m?(f=s.jsxs("li",{className:"flex items-start gap-2.5 px-2 py-1.5 rounded-lg hover:bg-accent/50 transition-colors",children:[l,m]}),e[11]=l,e[12]=m,e[13]=f):f=e[13],f}function Ya(t){const e=O.c(4),{status:n}=t,r=n==="completed"?"true":void 0,o=n==="in_progress"?"true":void 0;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("svg",{viewBox:"0 0 21 21",children:s.jsx("path",{d:"M5,10.75 L8.5,14.25 L19.4,2.3 C18.8333333,1.43333333 18.0333333,1 17,1 L4,1 C2.35,1 1,2.35 1,4 L1,17 C1,18.65 2.35,20 4,20 L17,20 C18.65,20 20,18.65 20,17 L20,7.99769186"})}),e[0]=a):a=e[0];let l;return e[1]!==r||e[2]!==o?(l=s.jsx("div",{className:"todo-cb mt-0.5","data-checked":r,"data-progress":o,"aria-hidden":"true",children:a}),e[1]=r,e[2]=o,e[3]=l):l=e[3],l}function Ha(t){const e=O.c(3),{status:n}=t;if(n==="completed"){let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("span",{"aria-label":"completed",className:"inline-flex items-center justify-center w-3.5 h-3.5 rounded-sm bg-primary",children:s.jsx("svg",{viewBox:"0 0 10 8",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",className:"w-2 h-2 text-primary-foreground",style:{strokeWidth:2},children:s.jsx("path",{d:"M1 4l2.5 2.5L9 1"})})}),e[0]=o):o=e[0],o}if(n==="in_progress"){let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("span",{"aria-label":"in progress",className:"inline-block w-2 h-2 rounded-full bg-primary animate-pulse shrink-0"}),e[1]=o):o=e[1],o}let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("span",{"aria-label":"pending",className:"inline-block w-3.5 h-3.5 rounded-sm border-[1.5px] border-muted-foreground/50 shrink-0"}),e[2]=r):r=e[2],r}const fn=new Map;function vs(){const{org:t}=ie(),e=zt(),n=uo(),r=n.find(h=>h.providerId==="deco"),{data:o,isLoading:a,refetch:l,isFetching:c}=Rn({queryKey:Ie.aiProviderCredits(t.id,"deco"),enabled:!!r,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),u=o?.balanceCents??null,d=u!=null?u/100:null,V=w.useRef(new Map);if(u!=null){const h=fn.get(t.id);V.current.get(t.id)&&h!=null&&u>h&&G("credits_topped_up_detected",{organization_id:t.id,delta_cents:u-h,previous_balance_cents:h,new_balance_cents:u}),fn.set(t.id,u),V.current.set(t.id,!0)}const i=!!r,m=u!=null&&u>0,f=u!=null&&u===0,x=u!=null&&u===200,p=n.length>0&&n.every(h=>h.providerId==="deco");return{hasDecoKey:i,decoKeyId:r?.id??null,balanceCents:u,balanceDollars:d,hasCredits:m,isZeroBalance:f,isInitialFreeCredit:x,hasOnlyDecoProvider:p,isLoading:a,isFetching:c,refetch:l}}const Ga={usd:[{dollars:10,label:"Starter"},{dollars:20,label:"Popular"},{dollars:100,label:"Best value"}],brl:[{dollars:50,label:"Starter"},{dollars:100,label:"Popular"},{dollars:500,label:"Best value"}]},Wa=["Access to 100+ AI models","Unified API, no separate keys needed","Pay only for what you use"];function ys(t){const e=O.c(41),{onDismiss:n}=t,{org:r}=ie(),o=rt(),{decoKeyId:a}=vs(),l=zt(),[c,u]=w.useState(""),[d,V]=w.useState(!1),[i,m]=w.useState("usd"),f=i==="brl"?"R$":"$";let x,p;e[0]!==r.id?(x=()=>{G("credits_exhausted_shown",{organization_id:r.id})},p=[r.id],e[0]=r.id,e[1]=x,e[2]=p):(x=e[1],p=e[2]),w.useEffect(x,p);let h;e[3]!==i||e[4]!==l?(h=async E=>{const{url:I}=await l.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:E,currency:i});return I},e[3]=i,e[4]=l,e[5]=h):h=e[5];let b;e[6]!==n?(b=E=>{E&&window.open(E,"_blank","noopener,noreferrer"),n?.()},e[6]=n,e[7]=b):b=e[7];let g;e[8]!==h||e[9]!==b?(g={mutationFn:h,onSuccess:b,onError:Xa},e[8]=h,e[9]=b,e[10]=g):g=e[10];const{mutate:v,isPending:y}=Dt(g),j=parseFloat(c),A=!isNaN(j)&&j>=1;let N;e[11]!==n?(N=E=>!E&&n?.(),e[11]=n,e[12]=N):N=e[12];let C;e[13]===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[13]=C):C=e[13];let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=s.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[14]=S):S=e[14];let D;e[15]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsxs("div",{className:"relative px-8 pt-8 pb-2 overflow-hidden",children:[S,s.jsxs(lt,{className:"relative gap-4",children:[s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),s.jsxs("div",{children:[s.jsx(it,{className:"text-xl font-semibold tracking-tight",children:"Top up to keep building"}),s.jsx(Ft,{className:"mt-1.5 text-sm leading-relaxed",children:"Your credits are used up. Add more to continue using AI across all your agents."})]})]})]}),e[15]=D):D=e[15];let k;e[16]!==i||e[17]!==f||e[18]!==c||e[19]!==j||e[20]!==a||e[21]!==A||e[22]!==y||e[23]!==d||e[24]!==v?(k=a&&s.jsxs("div",{className:"px-8 pt-5 pb-6",children:[s.jsx("div",{className:"mb-4",children:s.jsxs(Gn,{type:"single",variant:"outline",size:"sm",value:i,onValueChange:E=>{E&&m(E)},children:[s.jsx(Ze,{value:"usd",className:"h-8 px-3 text-xs",children:"USD"}),s.jsx(Ze,{value:"brl",className:"h-8 px-3 text-xs",children:"BRL"})]})}),s.jsxs("div",{className:"rounded-xl border border-border p-5",children:[s.jsx("div",{className:"grid grid-cols-3 gap-2.5",children:Ga[i].map(E=>{const{dollars:I,label:L}=E;return s.jsxs("button",{type:"button",disabled:y,onClick:()=>{G("credits_topup_clicked",{amount_cents:I*100,currency:i,tier_label:L,source:"exhausted_banner"}),v(I*100)},className:B("relative flex flex-col items-center gap-1 py-5 rounded-xl border transition-all duration-150 cursor-pointer","disabled:opacity-50 disabled:cursor-wait","border-border hover:border-foreground/20 hover:bg-muted/30"),children:[s.jsxs("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:[f,I]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:L})]},I)})}),d?s.jsxs("div",{className:"flex gap-2 mt-3",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:f}),s.jsx(Wn,{type:"number",min:"1",step:"1",placeholder:"50",value:c,onChange:E=>u(E.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(re,{className:"h-10",disabled:!A||y,onClick:()=>{G("credits_topup_clicked",{amount_cents:Math.round(j*100),currency:i,tier_label:"custom",source:"exhausted_banner"}),v(Math.round(j*100))},children:y?"Opening...":"Add"})]}):s.jsx("button",{type:"button",className:"w-full mt-3 text-xs text-muted-foreground hover:text-foreground transition-colors py-1",onClick:()=>V(!0),children:"Enter custom amount"})]}),s.jsx("div",{className:"mt-5 rounded-xl bg-muted/25 border border-border/50 p-4 space-y-3",children:Wa.map(Ja)})]}),e[16]=i,e[17]=f,e[18]=c,e[19]=j,e[20]=a,e[21]=A,e[22]=y,e[23]=d,e[24]=v,e[25]=k):k=e[25];let P;e[26]!==n?(P=s.jsx(re,{variant:"ghost",size:"sm",onClick:n,children:"Dismiss"}),e[26]=n,e[27]=P):P=e[27];let R;e[28]!==o||e[29]!==n||e[30]!==r.slug?(R=s.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:()=>{o({to:"/$org/settings/ai-providers",params:{org:r.slug}}),n?.()},children:"Manage providers"}),e[28]=o,e[29]=n,e[30]=r.slug,e[31]=R):R=e[31];let _;e[32]!==P||e[33]!==R?(_=s.jsxs("div",{className:"px-8 py-4 border-t border-border bg-muted/30 flex items-center justify-between",children:[P,R]}),e[32]=P,e[33]=R,e[34]=_):_=e[34];let T;e[35]!==k||e[36]!==_?(T=s.jsxs(ct,{className:"sm:max-w-[520px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:Za,children:[D,k,_]}),e[35]=k,e[36]=_,e[37]=T):T=e[37];let F;return e[38]!==T||e[39]!==N?(F=s.jsx(ut,{open:!0,onOpenChange:N,children:T}),e[38]=T,e[39]=N,e[40]=F):F=e[40],F}function Ja(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"flex items-center justify-center size-5 rounded-full bg-[hsl(var(--chart-1))]/15 shrink-0",children:s.jsx(Ke,{size:12,className:"text-[hsl(var(--chart-1))]"})}),s.jsx("span",{className:"text-sm text-foreground/80",children:t})]},t)}function Za(t){return t.preventDefault()}function Xa(t){le.error(`Top-up failed: ${t.message}`)}function el(){const t=O.c(5),e=ot(),n=fr(),[r,o]=w.useState(!1);if(!(e?.lockedSandbox==="user-desktop")||!n.ready||n.online)return null;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Jn,{size:14}),t[0]=l):l=t[0];let c;t[1]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(re,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:()=>o(!0),children:"Reconnect desktop"}),t[1]=c):c=t[1];let u;t[2]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Ve,{icon:l,label:"Your desktop is offline",title:"This chat runs on your desktop, which isn't connected right now.",defaultExpanded:!0,variant:"warning",footerRight:c,children:s.jsxs("p",{className:"mx-4 text-xs text-muted-foreground",children:["Run ",s.jsx("code",{className:"font-mono",children:"bunx decocms link"})," in a terminal on that machine to bring it back. Messages you send while it's offline will fail."]})}),t[2]=u):u=t[2];let d;return t[3]!==r?(d=s.jsxs(s.Fragment,{children:[u,s.jsx(Zn,{open:r,onOpenChange:o})]}),t[3]=r,t[4]=d):d=t[4],d}function tl(t){const e=t.trim(),n=e.startsWith("<")&&/<[a-z][\s\S]*>/i.test(e),r=/cloudflare|cf-[a-z-]+|error[\s_-]?code[\s_-]?5\d\d/i.test(e),o=/failed to fetch|networkerror|load failed|offline/i.test(e),a=/timeout|timed out|aborted|deadline/i.test(e),l=e.length>240,c=/sandbox failed to start(?::\s*(.+))?/is.exec(e);if(c){const u=c[1]?.trim().replace(/\.$/,"");return{summary:u?`Your sandbox didn't finish starting up (${u}). Try again.`:"Your sandbox didn't finish starting up. Try again.",rawDetails:t}}return/link_unavailable|user_desktop_link_/i.test(e)?/user_desktop_link_capability_missing/i.test(e)?{summary:"Your desktop is connected, but the CLI this chat uses wasn't detected there. Install it and sign in on your desktop, then try again.",rawDetails:t}:{summary:"Your desktop is offline. Run `bunx decocms link` in a terminal on it, then try again.",rawDetails:t}:r||n&&l?{summary:"Our servers are having a moment. Try sending again in a few seconds.",rawDetails:t}:o?{summary:"Lost connection. Check your network and try again.",rawDetails:t}:a?{summary:"That took longer than expected. Try again.",rawDetails:t}:n||l?{summary:"Something unexpected came back from the server. Try again.",rawDetails:t}:{summary:t,rawDetails:null}}const nl={length:"Response reached the model's output limit. Different models have different limits. Try switching models or asking it to continue.","content-filter":"Response was filtered due to content policy.","tool-calls":"Response paused after tool execution to prevent infinite loops and save costs. Click continue to keep working."};function Xe(t){const e=O.c(19),{variant:n,onDismiss:r}=t,o=n==="error",a=o?"Error occurred":"Response incomplete",l=o?Qn:Tn,c=o?t.error.message:nl[t.finishReason]??`Response stopped unexpectedly: ${t.finishReason}`;let u;e[0]!==o||e[1]!==c?(u=o?tl(c):{summary:c,rawDetails:null},e[0]=o,e[1]=c,e[2]=u):u=e[2];const{summary:d,rawDetails:V}=u;let i;e[3]!==l?(i=s.jsx(l,{size:14}),e[3]=l,e[4]=i):i=e[4];let m;e[5]!==o||e[6]!==t.onContinue||e[7]!==t.onFixInChat?(m=o?s.jsx(re,{size:"sm",variant:"outline",onClick:t.onFixInChat,className:"h-7 text-xs",children:"Fix in chat"}):s.jsx(re,{size:"sm",variant:"outline",onClick:t.onContinue,className:"h-7 text-xs",children:"Continue"}),e[5]=o,e[6]=t.onContinue,e[7]=t.onFixInChat,e[8]=m):m=e[8];let f;e[9]!==V?(f=V?s.jsxs("details",{className:"group mx-4",children:[s.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-1.5 text-xs text-muted-foreground transition-colors hover:text-foreground [&::-webkit-details-marker]:hidden",children:[s.jsx("svg",{"aria-hidden":"true",className:"size-3 transition-transform group-open:rotate-90",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"m4.5 3 3 3-3 3"})}),s.jsx("span",{className:"group-open:hidden",children:"Show technical details"}),s.jsx("span",{className:"hidden group-open:inline",children:"Hide technical details"})]}),s.jsxs("div",{className:"relative mt-2",children:[s.jsx("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(V).then(rl).catch(sl)},"aria-label":"Copy error details",title:"Copy",className:"absolute right-1.5 top-1.5 z-10 flex h-6 w-6 items-center justify-center rounded-md bg-background/80 text-muted-foreground backdrop-blur-sm transition-colors hover:bg-background hover:text-foreground",children:s.jsx(eo,{className:"size-3.5"})}),s.jsx("pre",{className:"max-h-40 overflow-auto rounded-md border border-border/60 bg-background px-3 py-2 pr-8 font-mono text-xs text-foreground/80 whitespace-pre-wrap break-all",children:V})]})]}):null,e[9]=V,e[10]=f):f=e[10];let x;return e[11]!==a||e[12]!==r||e[13]!==d||e[14]!==i||e[15]!==m||e[16]!==f||e[17]!==n?(x=s.jsx(Ve,{icon:i,label:a,title:d,defaultExpanded:!0,variant:n,onClose:r,footerRight:m,children:f}),e[11]=a,e[12]=r,e[13]=d,e[14]=i,e[15]=m,e[16]=f,e[17]=n,e[18]=x):x=e[18],x}function sl(){return le.error("Could not copy")}function rl(){return le.success("Copied to clipboard")}function ht(){const t=O.c(62),{error:e,clearError:n,finishReason:r,clearFinishReason:o,messages:a,isStreaming:l,submit:c,sendMessage:u}=Ue(),[d,V]=Ee(),{virtualMcpId:i,createTaskWithMessage:m}=mr(),{chatMode:f,simpleModeTier:x}=fe();let p;t[0]!==f||t[1]!==x||t[2]!==i?(p=Z=>({tier:x,mode:f,toolApprovalLevel:Z,agent:i?{id:i}:void 0}),t[0]=f,t[1]=x,t[2]=i,t[3]=p):p=t[3];const h=p;let b;t[4]!==d.toolApprovalLevel?(b=d.toolApprovalLevel??Ws(),t[4]=d.toolApprovalLevel,t[5]=b):b=t[5];const g=b,v=a.at(-1),y=v?.role==="assistant"?v.parts:[],j=y.filter(il),A=is(y),N=ls(y);let C;t[6]!==e||t[7]!==u?(C=()=>{if(e){const oe={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:`I encountered this error: ${e.message}. Can you help me fix it?`}]}]};u(oe)}},t[6]=e,t[7]=u,t[8]=C):C=t[8];const S=C;let D;t[9]!==u?(D=()=>{u({type:"doc",content:[{type:"paragraph",content:[{type:"text",text:"Please continue."}]}]})},t[9]=u,t[10]=D):D=t[10];const k=D;let P;t[11]!==h||t[12]!==g||t[13]!==c?(P=(Z,oe)=>{c({kind:"toolOutput",toolCallId:Z.toolCallId,output:{response:oe}},h(g))},t[11]=h,t[12]=g,t[13]=c,t[14]=P):P=t[14];const R=P;let _;t[15]!==m||t[16]!==d||t[17]!==V||t[18]!==i?(_=Z=>{V({...d,toolApprovalLevel:"auto"}),m({virtualMcpId:i,message:{parts:[{type:"text",text:`Implement this plan:
2
-
3
- ${Z}`}]}})},t[15]=m,t[16]=d,t[17]=V,t[18]=i,t[19]=_):_=t[19];const T=_,F=ll;let E;t[20]!==h||t[21]!==c?(E=(Z,oe,H,ne)=>{c({kind:"approval",approvalId:Z,approved:oe,...H?{reason:H}:{}},h(ne))},t[20]=h,t[21]=c,t[22]=E):E=t[22];const I=E,L=cs();if(L.isCreditExhausted){let Z;return t[23]!==n?(Z=s.jsx(ys,{onDismiss:n}),t[23]=n,t[24]=Z):Z=t[24],Z}const{showError:z,showWarning:$,hasApprovals:q}=L,M=j.map(al).join("|"),U=A[0]?.toolCallId??"",Q=N.map(ol).join("|");let K,Y;t[25]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(Ka,{}),Y=s.jsx(el,{}),t[25]=K,t[26]=Y):(K=t[25],Y=t[26]);let se;t[27]!==n||t[28]!==e||t[29]!==S||t[30]!==z?(se=z&&s.jsx(Xe,{variant:"error",error:e,onDismiss:n,onFixInChat:S}),t[27]=n,t[28]=e,t[29]=S,t[30]=z,t[31]=se):se=t[31];let X;t[32]!==o||t[33]!==r||t[34]!==k||t[35]!==$?(X=$&&s.jsx(Xe,{variant:"warning",finishReason:r,onDismiss:o,onContinue:k}),t[32]=o,t[33]=r,t[34]=k,t[35]=$,t[36]=X):X=t[36];let te;t[37]!==Q||t[38]!==I||t[39]!==q||t[40]!==l||t[41]!==N?(te=q&&s.jsx(Ca,{approvals:N,isStreaming:l,onRespond:I},Q),t[37]=Q,t[38]=I,t[39]=q,t[40]=l,t[41]=N,t[42]=te):te=t[42];let W;t[43]!==L.hasPlans||t[44]!==T||t[45]!==F||t[46]!==l||t[47]!==A||t[48]!==U?(W=L.hasPlans&&s.jsx(ka,{plans:A,isStreaming:l,onApprove:T,onDismiss:F},U),t[43]=L.hasPlans,t[44]=T,t[45]=F,t[46]=l,t[47]=A,t[48]=U,t[49]=W):W=t[49];let J;t[50]!==L.isWaitingForUserInput||t[51]!==R||t[52]!==l||t[53]!==M||t[54]!==j?(J=L.isWaitingForUserInput&&s.jsx(bs,{userAskParts:j,isStreaming:l,onSubmit:R},M),t[50]=L.isWaitingForUserInput,t[51]=R,t[52]=l,t[53]=M,t[54]=j,t[55]=J):J=t[55];let ee;return t[56]!==X||t[57]!==te||t[58]!==W||t[59]!==J||t[60]!==se?(ee=s.jsxs("div",{className:"absolute bottom-full left-0 right-0",children:[K,Y,se,X,te,W,J]}),t[56]=X,t[57]=te,t[58]=W,t[59]=J,t[60]=se,t[61]=ee):ee=t[61],ee}function ol(t){return t.approvalId}function al(t){return t.toolCallId}function ll(){document.querySelector("[data-chat-input]")?.focus()}function il(t){return t.type==="tool-user_ask"}ht.Error=function(e){return s.jsx(Xe,{variant:"error",error:e.error,onDismiss:e.onDismiss,onFixInChat:e.onFixInChat})};ht.Warning=function(e){return s.jsx(Xe,{variant:"warning",finishReason:e.finishReason,onDismiss:e.onDismiss,onContinue:e.onContinue})};ht.UserAskQuestion=bs;async function cl(t,e,n){const r=await t.callTool({name:e,arguments:n});if(r.isError){const o=r.content?.[0]?.text??`Tool ${e} failed without a message`;throw new Error(o)}return r}const As=["SANDBOX_START"],Qe=new Map,ul=t=>`${t.virtualMcpId}::${t.branch??""}`,yt=new Set,dl={mark:(t,e)=>yt.add(`${t}::${e}`),clear:(t,e)=>yt.delete(`${t}::${e}`),isStopped:(t,e)=>yt.has(`${t}::${e}`)};function Vl(t){const e=Be();return Dt({mutationKey:As,mutationFn:async n=>{n.branch&&dl.clear(n.virtualMcpId,n.branch);const r=ul(n),o=Qe.get(r);if(o)return o;const a=(async()=>(await cl(t,"SANDBOX_START",n)).structuredContent)();Qe.set(r,a);try{return await a}finally{Qe.get(r)===a&&Qe.delete(r)}},onSuccess:()=>{Js(e)}})}function Xu(t,e){const n=O.c(3);let r;return n[0]!==e||n[1]!==t?(r={mutationKey:As,predicate:a=>{if(!t)return!1;const l=a.state.variables;return!l||l.virtualMcpId!==t?!1:(l.branch??"")===(e??"")}},n[0]=e,n[1]=t,n[2]=r):r=n[2],Oo(r)>0}const fl={fast:{modelId:"claude-code:haiku",label:"Haiku 4.5"},smart:{modelId:"claude-code:sonnet",label:"Sonnet 4.6"},thinking:{modelId:"claude-code:opus-1m",label:"Opus 4.8 1M"}},ml={fast:{modelId:"codex:gpt-5.4-mini",label:"GPT-5.4 Mini"},smart:{modelId:"codex:gpt-5.4",label:"GPT-5.4"},thinking:{modelId:"codex:gpt-5.5",label:"GPT-5.5"}};function pl(t){return t==="claude-code"?fl:t==="codex"?ml:null}function mn(t,e){return pl(t)?.[e]??null}const hl={"cloud-decopilot":"decopilot","local-decopilot":"decopilot-desktop","local-claude-code":"claude-code-desktop","local-codex":"codex-desktop"},xl={decopilot:"cloud-decopilot","decopilot-desktop":"local-decopilot","claude-code-desktop":"local-claude-code","codex-desktop":"local-codex"};function gl(t){return hl[t]}function bl(t){return t===null?"cloud-decopilot":xl[t]}function js(){const t=O.c(2),{pendingAgentOption:e}=fe();let n;return t[0]!==e?(n=bl(e),t[0]=e,t[1]=n):n=t[1],n}function vl(){const t=O.c(2),{setPendingAgentOption:e}=fe();let n;return t[0]!==e?(n=r=>e(gl(r)),t[0]=e,t[1]=n):n=t[1],n}function yl(){return fe().simpleModeTier}function Al(){return fe().setSimpleModeTier}const jl={fast:"Quicker responses",smart:"Balanced quality",thinking:"Deeper reasoning"};function wl(t,e){return t==="local-claude-code"?mn("claude-code",e)?.label??null:t==="local-codex"?mn("codex",e)?.label??null:jl[e]}const Cl={decopilot:"Decopilot","claude-code":"Claude Code",codex:"Codex"},Sl=dt("").icon;function et(t){const e=O.c(4),{compact:n}=t,o=(n===void 0?!1:n)?"size-3.5 rounded-sm":"size-4 rounded-sm";let a;e[0]!==o?(a=B(o),e[0]=o,e[1]=a):a=e[1];let l;return e[2]!==a?(l=s.jsx(Kn,{icon:Sl,name:"Decopilot",size:"2xs",className:a}),e[2]=a,e[3]=l):l=e[3],l}const Nl={mode:"cloud-decopilot",label:"Decopilot",description:"Runs in an agent sandbox",group:"cloud",icon:s.jsx(et,{}),isAvailable:t=>t.agentSandbox},kl={mode:"local-decopilot",label:"Decopilot",description:"Runs on your desktop",group:"local",icon:s.jsx(et,{}),isAvailable:t=>t.userDesktop},_l={mode:"local-claude-code",label:"Claude Code",description:"Runs via Claude Code CLI",group:"local",icon:s.jsx(Xn,{size:16}),isAvailable:t=>t.userDesktop&&t.claudeCode},Il={mode:"local-codex",label:"Codex",description:"Runs via Codex CLI",group:"local",icon:s.jsx(es,{size:16}),isAvailable:t=>t.userDesktop&&t.codex},tt=[Nl,kl,_l,Il];function El(t,e){return tt.some(n=>n.mode===t&&n.isAvailable(e))}function Rl(t,e){return El(t,e)?t:tt.find(n=>n.isAvailable(e))?.mode??t}function Tl(t){return t==="local-decopilot"?{icon:s.jsx(et,{compact:!0}),text:"Decopilot"}:t==="local-claude-code"?{icon:s.jsx(Xn,{size:14}),text:"Claude Code"}:t==="local-codex"?{icon:s.jsx(es,{size:14}),text:"Codex"}:{icon:s.jsx(et,{compact:!0}),text:"Cloud"}}const Pl="text-muted-foreground hover:text-foreground text-xs transition-[gap] duration-200",Dl="text-success hover:text-success";function Ml(t){const e=O.c(81),{mode:n,availability:r,locked:o,lockedHarness:a,onSelect:l,onConnectDesktop:c}=t,[u,d]=w.useState(!1);let V;e[0]!==n?(V=Tl(n),e[0]=n,e[1]=V):V=e[1];const{icon:i,text:m}=V,f=n!=="cloud-decopilot",x=a!=null,p=a?Cl[a]:null;let h,b,g,v,y,j,A,N,C,S,D,k,P;if(e[2]!==r||e[3]!==p||e[4]!==i||e[5]!==f||e[6]!==o||e[7]!==n||e[8]!==c||e[9]!==l||e[10]!==u||e[11]!==x||e[12]!==m){let F;e[26]!==r?(F=ne=>ne.group==="cloud"&&ne.isAvailable(r),e[26]=r,e[27]=F):F=e[27];const E=tt.filter(F),I=tt.filter(Fl);let L;e[28]!==l?(L=ne=>{l(ne),d(!1)},e[28]=l,e[29]=L):L=e[29];const z=L;let $;e[30]!==c?($=()=>{d(!1),c?.()},e[30]=c,e[31]=$):$=e[31];const q=$;b=Bt,g=u,v=o?void 0:d;const M=x&&p?`This chat is using ${p}. Start a new chat to use a different runtime.`:m,U=o?"mode-picker-locked":"mode-picker",Q=f&&Dl,K=o?"gap-0":"gap-0 @[320px]/chat-bottom:gap-1.5";let Y;e[32]!==Q||e[33]!==K?(Y=B(Pl,Q,"shrink min-w-0",K),e[32]=Q,e[33]=K,e[34]=Y):Y=e[34];const se=!o&&"@[320px]/chat-bottom:max-w-32 @[320px]/chat-bottom:opacity-100";let X;e[35]!==se?(X=B("min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0",se),e[35]=se,e[36]=X):X=e[36];let te;e[37]!==X||e[38]!==m?(te=s.jsx("span",{className:X,children:m}),e[37]=X,e[38]=m,e[39]=te):te=e[39];let W;e[40]!==o?(W=!o&&s.jsx(ft,{size:12,className:"opacity-60 hidden @[320px]/chat-bottom:inline-block"}),e[40]=o,e[41]=W):W=e[41];let J;e[42]!==i||e[43]!==o||e[44]!==M||e[45]!==U||e[46]!==Y||e[47]!==te||e[48]!==W?(J=s.jsx(xe,{asChild:!0,children:s.jsx("span",{className:"inline-flex min-w-0 shrink",children:s.jsx(Ut,{asChild:!0,children:s.jsxs(re,{type:"button",variant:"ghost",size:"default","aria-label":M,disabled:o,"data-testid":U,className:Y,children:[i,te,W]})})})}),e[42]=i,e[43]=o,e[44]=M,e[45]=U,e[46]=Y,e[47]=te,e[48]=W,e[49]=J):J=e[49];const ee=x&&p?`This chat is using ${p}. Start a new chat to use a different runtime.`:m;let Z;e[50]!==ee?(Z=s.jsx(ge,{children:ee}),e[50]=ee,e[51]=Z):Z=e[51],e[52]!==J||e[53]!==Z?(y=s.jsxs(be,{children:[J,Z]}),e[52]=J,e[53]=Z,e[54]=y):y=e[54],h=Kt,k="start",P="p-1 w-64",j="menu",A="flex flex-col",N=E.length>0&&s.jsx(pn,{title:"Cloud"});let oe;e[55]!==z||e[56]!==n?(oe=ne=>s.jsx(hn,{row:ne,active:n===ne.mode,onSelect:z},ne.mode),e[55]=z,e[56]=n,e[57]=oe):oe=e[57],C=E.map(oe),S=I.length>0&&s.jsx(pn,{title:"Local",variant:"success",icon:s.jsx(Jn,{size:12,"data-testid":"local-section-desktop-icon"}),testId:"local-section-header"});let H;e[58]!==r||e[59]!==q||e[60]!==z||e[61]!==n?(H=ne=>{const ue=ne.isAvailable(r);return s.jsx(hn,{row:ne,active:ue&&n===ne.mode,onSelect:z,unavailableHint:ue?void 0:r.userDesktop?"Not detected on your desktop":"Connect your desktop to enable",onUnavailableClick:q},ne.mode)},e[58]=r,e[59]=q,e[60]=z,e[61]=n,e[62]=H):H=e[62],D=I.map(H),e[2]=r,e[3]=p,e[4]=i,e[5]=f,e[6]=o,e[7]=n,e[8]=c,e[9]=l,e[10]=u,e[11]=x,e[12]=m,e[13]=h,e[14]=b,e[15]=g,e[16]=v,e[17]=y,e[18]=j,e[19]=A,e[20]=N,e[21]=C,e[22]=S,e[23]=D,e[24]=k,e[25]=P}else h=e[13],b=e[14],g=e[15],v=e[16],y=e[17],j=e[18],A=e[19],N=e[20],C=e[21],S=e[22],D=e[23],k=e[24],P=e[25];let R;e[63]!==j||e[64]!==A||e[65]!==N||e[66]!==C||e[67]!==S||e[68]!==D?(R=s.jsxs("div",{role:j,className:A,children:[N,C,S,D]}),e[63]=j,e[64]=A,e[65]=N,e[66]=C,e[67]=S,e[68]=D,e[69]=R):R=e[69];let _;e[70]!==h||e[71]!==R||e[72]!==k||e[73]!==P?(_=s.jsx(h,{align:k,className:P,children:R}),e[70]=h,e[71]=R,e[72]=k,e[73]=P,e[74]=_):_=e[74];let T;return e[75]!==b||e[76]!==g||e[77]!==v||e[78]!==y||e[79]!==_?(T=s.jsxs(b,{open:g,onOpenChange:v,children:[y,_]}),e[75]=b,e[76]=g,e[77]=v,e[78]=y,e[79]=_,e[80]=T):T=e[80],T}function Fl(t){return t.group==="local"}function pn(t){const e=O.c(9),{title:n,variant:r,icon:o,testId:a}=t,c=(r===void 0?"muted":r)==="success"?"bg-success/10 text-success":"text-muted-foreground";let u;e[0]!==c?(u=B("inline-flex w-fit items-center gap-2 mx-1 mt-2 mb-1 px-1.5 py-0.5 rounded text-[10px] font-medium uppercase tracking-wide",c),e[0]=c,e[1]=u):u=e[1];let d;e[2]!==n?(d=s.jsx("span",{children:n}),e[2]=n,e[3]=d):d=e[3];let V;return e[4]!==o||e[5]!==u||e[6]!==d||e[7]!==a?(V=s.jsxs("div",{"data-testid":a,className:u,children:[o,d]}),e[4]=o,e[5]=u,e[6]=d,e[7]=a,e[8]=V):V=e[8],V}function hn(t){const e=O.c(25),{row:n,active:r,onSelect:o,unavailableHint:a,onUnavailableClick:l}=t,c=a!=null,u=c||void 0;let d;e[0]!==o||e[1]!==l||e[2]!==n.mode||e[3]!==c?(d=()=>c?l?.():o(n.mode),e[0]=o,e[1]=l,e[2]=n.mode,e[3]=c,e[4]=d):d=e[4];const V=c&&"opacity-60";let i;e[5]!==V?(i=B("flex items-start gap-2 px-2 py-1.5 rounded-md text-left","hover:bg-muted",V),e[5]=V,e[6]=i):i=e[6];let m;e[7]!==n.icon?(m=s.jsx("span",{className:"shrink-0 text-muted-foreground mt-0.5",children:n.icon}),e[7]=n.icon,e[8]=m):m=e[8];let f;e[9]!==n.label?(f=s.jsx("div",{className:"text-sm",children:n.label}),e[9]=n.label,e[10]=f):f=e[10];const x=a??n.description;let p;e[11]!==x?(p=s.jsx("div",{className:"text-xs text-muted-foreground",children:x}),e[11]=x,e[12]=p):p=e[12];let h;e[13]!==f||e[14]!==p?(h=s.jsxs("div",{className:"flex-1",children:[f,p]}),e[13]=f,e[14]=p,e[15]=h):h=e[15];let b;e[16]!==r?(b=r&&s.jsx(Ke,{size:14,className:"text-foreground mt-0.5"}),e[16]=r,e[17]=b):b=e[17];let g;return e[18]!==u||e[19]!==b||e[20]!==d||e[21]!==i||e[22]!==m||e[23]!==h?(g=s.jsxs("button",{type:"button",role:"menuitem","aria-disabled":u,onClick:d,className:i,children:[m,h,b]}),e[18]=u,e[19]=b,e[20]=d,e[21]=i,e[22]=m,e[23]=h,e[24]=g):g=e[24],g}function Ol(t){const e=O.c(23),{locked:n,currentBranch:r,virtualMcpId:o}=t,a=js(),l=vl(),{org:c}=ie();let u;e[0]!==c.id||e[1]!==c.slug?(u={connectionId:Pr,orgId:c.id,orgSlug:c.slug},e[0]=c.id,e[1]=c.slug,e[2]=u):u=e[2];const d=Re(u),V=Vl(d),m=ot()?.lockedHarness??null,f=pr();let x;e[3]!==f||e[4]!==a?(x=Rl(a,f),e[3]=f,e[4]=a,e[5]=x):x=e[5];const p=x,[h,b]=w.useState(!1);let g;e[6]!==r||e[7]!==l||e[8]!==V||e[9]!==o?(g=C=>{l(C),G("agent_mode_selected",{mode:C}),r&&V.mutate({virtualMcpId:o,branch:r,sandboxProviderKind:C==="cloud-decopilot"?"agent-sandbox":"user-desktop"})},e[6]=r,e[7]=l,e[8]=V,e[9]=o,e[10]=g):g=e[10];const v=g;let y;e[11]===Symbol.for("react.memo_cache_sentinel")?(y=()=>{G("agent_mode_connect_desktop_opened"),b(!0)},e[11]=y):y=e[11];let j;e[12]!==f||e[13]!==v||e[14]!==n||e[15]!==m||e[16]!==p?(j=s.jsx(Ml,{mode:p,availability:f,locked:n,lockedHarness:m,onSelect:v,onConnectDesktop:y}),e[12]=f,e[13]=v,e[14]=n,e[15]=m,e[16]=p,e[17]=j):j=e[17];let A;e[18]!==h?(A=s.jsx(Zn,{open:h,onOpenChange:b}),e[18]=h,e[19]=A):A=e[19];let N;return e[20]!==j||e[21]!==A?(N=s.jsxs(s.Fragment,{children:[j,A]}),e[20]=j,e[21]=A,e[22]=N):N=e[22],N}const xn=["alpha","beta","gamma","delta","epsilon","zeta","eta","theta","iota","kappa","lambda","mu","nu","xi","omicron","pi","rho","sigma","tau","upsilon","phi","chi","psi","omega"],gn=["andromedae","antliae","apodis","aquarii","aquilae","arae","arietis","aurigae","bootis","caeli","camelopardalis","cancri","capricorni","carinae","cassiopeiae","centauri","cephei","ceti","chamaeleontis","circini","columbae","corvi","crateris","crucis","cygni","delphini","doradus","draconis","equulei","eridani","fornacis","geminorum","gruis","herculis","horologii","hydrae","hydri","indi","lacertae","leonis","leporis","librae","lupi","lyncis","lyrae","mensae","microscopii","monocerotis","muscae","normae","octantis","ophiuchi","orionis","pavonis","pegasi","persei","phoenicis","pictoris","piscium","puppis","pyxidis","reticuli","sagittae","sagittarii","scorpii","sculptoris","scuti","serpentis","sextantis","tauri","telescopii","trianguli","tucanae","velorum","virginis","volantis","vulpeculae"];function Ll(){const t=xn[Math.floor(Math.random()*xn.length)],e=gn[Math.floor(Math.random()*gn.length)];return`${t}-${e}`}const Ge=100;function $l(t,e,n){const r=e.trim().toLowerCase();return r?(t??[]).some(o=>o.branches.some(a=>typeof a.name=="string"&&!n.has(a.name)&&a.name.toLowerCase().includes(r))):!0}function zl(t,e){const n=e.trim().toLowerCase();return n?[...t].some(r=>r.toLowerCase().includes(n)):!0}function Bl(t){const e=t;if(e.structuredContent)return e.structuredContent;const n=e.content?.find(r=>r.type==="text")?.text;if(n)try{return JSON.parse(n)}catch{return[]}return[]}function Ul(t){const e=O.c(48),{orgId:n,orgSlug:r,userId:o,connectionId:a,sandboxMap:l,owner:c,repo:u,enabled:d}=t,V=d===void 0?!0:d,i=a??null;let m;e[0]!==n||e[1]!==r||e[2]!==i?(m={connectionId:i,orgId:n,orgSlug:r},e[0]=n,e[1]=r,e[2]=i,e[3]=m):m=e[3];const f=Re(m);let x;e[4]!==a||e[5]!==n||e[6]!==r||e[7]!==c||e[8]!==u?(x=Zs.githubBranches(n,r,a,c,u),e[4]=a,e[5]=n,e[6]=r,e[7]=c,e[8]=u,e[9]=x):x=e[9];const p=V&&!!a&&!!c&&!!u;let h;e[10]!==f||e[11]!==c||e[12]!==u?(h=async $=>{const{pageParam:q,signal:M}=$,U=Number(q),Q=await f.callTool({name:"list_branches",arguments:{owner:c,repo:u,page:U,perPage:Ge}},void 0,{signal:M}),K=Bl(Q);return{branches:Array.isArray(K)?K:K.branches??[],default_branch:Array.isArray(K)?null:K.default_branch??null,page:U}},e[10]=f,e[11]=c,e[12]=u,e[13]=h):h=e[13];let b;e[14]!==x||e[15]!==p||e[16]!==h?(b={queryKey:x,enabled:p,staleTime:3e4,retry:!1,initialPageParam:1,queryFn:h,getNextPageParam:Gl},e[14]=x,e[15]=p,e[16]=h,e[17]=b):b=e[17];const{data:g,isLoading:v,isError:y,hasNextPage:j,isFetchingNextPage:A,fetchNextPage:N}=vo(b);let C,S;e[18]!==l||e[19]!==o?(S=new Set(Object.keys(l?.[o]??{})),C=[...S].sort().map(Hl),e[18]=l,e[19]=o,e[20]=C,e[21]=S):(C=e[20],S=e[21]);const D=C;let k;if(e[22]!==g?.pages){const $=new Map;for(const M of g?.pages??[])for(const U of M.branches)typeof U.name=="string"&&$.set(U.name,U);k=[...$.values()].filter(Yl),e[22]=g?.pages,e[23]=k}else k=e[23];let P;e[24]!==k||e[25]!==S?(P=k.filter($=>!S.has($.name)).map(Ql),e[24]=k,e[25]=S,e[26]=P):P=e[26];const R=P;let _;e[27]!==g?.pages?(_=g?.pages.find(ql)?.default_branch??null,e[27]=g?.pages,e[28]=_):_=e[28];const T=_;let F;e[29]!==g?.pages||e[30]!==N||e[31]!==A||e[32]!==S?(F=async($,q)=>{const M=q===void 0?Kl:q;if(!M()||zl(S,$)||A)return;let U=g?.pages??[];for(;M()&&!$l(U,$,S)&&(U.at(-1)?.branches.length??Ge)>=Ge;){const Q=await N();if(!M())break;const K=Q.data?.pages??U;if(K.length===U.length)break;U=K}},e[29]=g?.pages,e[30]=N,e[31]=A,e[32]=S,e[33]=F):F=e[33];const E=F,I=j??!1;let L;e[34]!==N||e[35]!==j||e[36]!==A?(L=()=>{j&&!A&&N()},e[34]=N,e[35]=j,e[36]=A,e[37]=L):L=e[37];let z;return e[38]!==T||e[39]!==E||e[40]!==y||e[41]!==A||e[42]!==v||e[43]!==R||e[44]!==I||e[45]!==L||e[46]!==D?(z={yours:D,others:R,defaultBase:T,isLoading:v,isError:y,hasMore:I,isFetchingMore:A,fetchMore:L,fetchUntilMatch:E},e[38]=T,e[39]=E,e[40]=y,e[41]=A,e[42]=v,e[43]=R,e[44]=I,e[45]=L,e[46]=D,e[47]=z):z=e[47],z}function Kl(){return!0}function ql(t){return t.default_branch}function Ql(t){return{name:t.name,source:"other",author:typeof t.commit?.author=="string"?t.commit.author:t.commit?.author?.login??null}}function Yl(t){return typeof t.name=="string"}function Hl(t){return{name:t,source:"yours"}}function Gl(t){if(!(t.branches.length<Ge))return t.page+1}function Wl(t){const e=O.c(84),{orgId:n,orgSlug:r,userId:o,connectionId:a,owner:l,repo:c,sandboxMap:u,value:d,onChange:V,disabled:i,placement:m}=t,f=i===void 0?!1:i,p=(m===void 0?"chat":m)==="header",[h,b]=w.useState(!1),[g,v]=w.useState(""),[y,j]=w.useState(!1),A=w.useRef(0);let N;e[0]!==a||e[1]!==h||e[2]!==n||e[3]!==r||e[4]!==l||e[5]!==c||e[6]!==u||e[7]!==o?(N={orgId:n,orgSlug:r,userId:o,connectionId:a,sandboxMap:u,owner:l,repo:c,enabled:h},e[0]=a,e[1]=h,e[2]=n,e[3]=r,e[4]=l,e[5]=c,e[6]=u,e[7]=o,e[8]=N):N=e[8];const{yours:C,others:S,isLoading:D,isError:k,hasMore:P,isFetchingMore:R,fetchMore:_,fetchUntilMatch:T}=Ul(N);let F;e[9]!==V?(F=ae=>{V(ae),b(!1)},e[9]=V,e[10]=F):F=e[10];const E=F,I=d??"Select branch…";let L;e[11]!==T?(L=ae=>{v(ae),A.current=A.current+1;const Ne=A.current,xt=ae.trim();if(!xt){j(!1);return}j(!0),T(xt,()=>Ne===A.current).finally(()=>{Ne===A.current&&j(!1)})},e[11]=T,e[12]=L):L=e[12];const z=L;let $;e[13]!==_?($=ae=>{const Ne=ae.currentTarget;Ne.scrollHeight-Ne.scrollTop-Ne.clientHeight<48&&_()},e[13]=_,e[14]=$):$=e[14];const q=$,M=f?void 0:b,U=p?"outline":"ghost",Q=p?"sm":"default";let K;e[15]!==f||e[16]!==p?(K=B("font-mono shrink min-w-0 max-w-[200px]",p?"gap-1.5 text-xs":B("text-xs text-muted-foreground hover:text-foreground transition-[gap] duration-200",f?"gap-0":"gap-0 @[320px]/chat-bottom:gap-1.5")),e[15]=f,e[16]=p,e[17]=K):K=e[17];let Y;e[18]===Symbol.for("react.memo_cache_sentinel")?(Y=s.jsx(He,{className:"h-3.5 w-3.5 shrink-0"}),e[18]=Y):Y=e[18];const se=p?"":"transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0 @[320px]/chat-bottom:max-w-[200px] @[320px]/chat-bottom:opacity-100";let X;e[19]!==se?(X=B("min-w-0 truncate",se),e[19]=se,e[20]=X):X=e[20];let te;e[21]!==I||e[22]!==X?(te=s.jsx("span",{className:X,children:I}),e[21]=I,e[22]=X,e[23]=te):te=e[23];let W;e[24]!==f||e[25]!==p?(W=!f&&s.jsx(ft,{size:12,className:B("opacity-60 shrink-0",p?"":"hidden @[320px]/chat-bottom:inline-block")}),e[24]=f,e[25]=p,e[26]=W):W=e[26];let J;e[27]!==f||e[28]!==I||e[29]!==K||e[30]!==te||e[31]!==W||e[32]!==U||e[33]!==Q?(J=s.jsx(xe,{asChild:!0,children:s.jsx("span",{className:"inline-flex min-w-0 shrink",children:s.jsx(Ut,{asChild:!0,children:s.jsxs(re,{variant:U,size:Q,"aria-label":I,disabled:f,className:K,children:[Y,te,W]})})})}),e[27]=f,e[28]=I,e[29]=K,e[30]=te,e[31]=W,e[32]=U,e[33]=Q,e[34]=J):J=e[34];let ee;e[35]!==I?(ee=s.jsx(ge,{children:I}),e[35]=I,e[36]=ee):ee=e[36];let Z;e[37]!==J||e[38]!==ee?(Z=s.jsxs(be,{children:[J,ee]}),e[37]=J,e[38]=ee,e[39]=Z):Z=e[39];let oe;e[40]!==z||e[41]!==g?(oe=s.jsx(ho,{placeholder:"Search loaded branches…",value:g,onValueChange:z}),e[40]=z,e[41]=g,e[42]=oe):oe=e[42];let H;e[43]!==E?(H=s.jsx(re,{variant:"outline",size:"sm",className:"h-7 shrink-0",onClick:()=>E(Ll()),children:"New"}),e[43]=E,e[44]=H):H=e[44];let ne;e[45]!==oe||e[46]!==H?(ne=s.jsxs("div",{className:"*:data-[slot=command-input-wrapper]:flex-1 *:data-[slot=command-input-wrapper]:border-b-0 flex items-center border-b pr-2",children:[oe,H]}),e[45]=oe,e[46]=H,e[47]=ne):ne=e[47];let ue;e[48]!==k?(ue=k&&s.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:"Couldn't load branches from GitHub. You can still pick from your branches."}),e[48]=k,e[49]=ue):ue=e[49];let ve;e[50]!==P||e[51]!==k||e[52]!==D?(ve=!k&&!D&&s.jsx(xo,{children:P?"Looking through more branches...":"No branches found."}),e[50]=P,e[51]=k,e[52]=D,e[53]=ve):ve=e[53];let ye;e[54]!==E||e[55]!==C?(ye=C.length>0&&s.jsx(Xt,{heading:"Your branches",children:C.map(ae=>s.jsxs(en,{value:ae.name,onSelect:()=>E(ae.name),children:[s.jsx(He,{className:"mr-2 h-4 w-4"}),s.jsx("span",{className:"flex-1 truncate",children:ae.name})]},ae.name))}),e[54]=E,e[55]=C,e[56]=ye):ye=e[56];let Ae;e[57]!==S||e[58]!==E?(Ae=S.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(po,{}),s.jsx(Xt,{heading:"Other branches in repo",children:S.map(ae=>s.jsxs(en,{value:ae.name,onSelect:()=>E(ae.name),children:[s.jsx(He,{className:"mr-2 h-4 w-4"}),s.jsx("span",{className:"flex-1 truncate",children:ae.name}),ae.author&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:["@",ae.author]})]},ae.name))})]}),e[57]=S,e[58]=E,e[59]=Ae):Ae=e[59];let je;e[60]!==_||e[61]!==P||e[62]!==R||e[63]!==y?(je=P&&s.jsx("div",{className:"border-t p-2",children:s.jsx(re,{variant:"ghost",size:"sm",className:"h-7 w-full text-xs",disabled:R,onClick:_,children:R||y?"Loading more…":"Load more branches"})}),e[60]=_,e[61]=P,e[62]=R,e[63]=y,e[64]=je):je=e[64];let we;e[65]!==P||e[66]!==S.length?(we=!P&&S.length>0&&s.jsx("div",{className:"border-t p-2 text-center text-xs text-muted-foreground",children:"All loaded"}),e[65]=P,e[66]=S.length,e[67]=we):we=e[67];let Ce;e[68]!==q||e[69]!==ue||e[70]!==ve||e[71]!==ye||e[72]!==Ae||e[73]!==je||e[74]!==we?(Ce=s.jsxs(go,{onScroll:q,children:[ue,ve,ye,Ae,je,we]}),e[68]=q,e[69]=ue,e[70]=ve,e[71]=ye,e[72]=Ae,e[73]=je,e[74]=we,e[75]=Ce):Ce=e[75];let Se;e[76]!==ne||e[77]!==Ce?(Se=s.jsx(Kt,{className:"w-[min(420px,calc(100vw-2rem))] p-0",align:"start",children:s.jsxs(bo,{children:[ne,Ce]})}),e[76]=ne,e[77]=Ce,e[78]=Se):Se=e[78];let qe;return e[79]!==h||e[80]!==Z||e[81]!==Se||e[82]!==M?(qe=s.jsxs(Bt,{open:h,onOpenChange:M,children:[Z,Se]}),e[79]=h,e[80]=Z,e[81]=Se,e[82]=M,e[83]=qe):qe=e[83],qe}function Jl(t){const e=O.c(25);let n,r,o,a;e[0]!==t?({locked:n,placement:r,value:a,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=a):(n=e[1],r=e[2],o=e[3],a=e[4]);const l=r==="header";if(n){const u=a??"(no branch)",d=l?"h-8 gap-1.5 border border-input bg-background px-2.5":"h-9 gap-0 px-2";let V;e[5]!==d?(V=B("inline-flex items-center rounded-md font-mono text-xs","text-muted-foreground cursor-default min-w-0 max-w-[200px]",d),e[5]=d,e[6]=V):V=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(He,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":"true"}),e[7]=i):i=e[7];const m=l?"":"max-w-0 opacity-0";let f;e[8]!==m?(f=B("min-w-0 truncate",m),e[8]=m,e[9]=f):f=e[9];let x;e[10]!==u||e[11]!==f?(x=s.jsx("span",{className:f,children:u}),e[10]=u,e[11]=f,e[12]=x):x=e[12];let p;e[13]!==V||e[14]!==x?(p=s.jsx(xe,{asChild:!0,children:s.jsxs("span",{"data-testid":"branch-picker-locked","aria-disabled":"true",className:V,children:[i,x]})}),e[13]=V,e[14]=x,e[15]=p):p=e[15];let h;e[16]!==u?(h=s.jsxs(ge,{children:["This chat is using branch ",u,". Start a new chat to use a different branch."]}),e[16]=u,e[17]=h):h=e[17];let b;return e[18]!==p||e[19]!==h?(b=s.jsxs(be,{children:[p,h]}),e[18]=p,e[19]=h,e[20]=b):b=e[20],b}let c;return e[21]!==r||e[22]!==o||e[23]!==a?(c=s.jsx(Wl,{...o,value:a,placement:r}),e[21]=r,e[22]=o,e[23]=a,e[24]=c):c=e[24],c}function Zl(t){const e=O.c(3),{branchPill:n,modePicker:r}=t;if(!n&&!r)return null;let o;return e[0]!==n||e[1]!==r?(o=s.jsxs(s.Fragment,{children:[r,n]}),e[0]=n,e[1]=r,e[2]=o):o=e[2],o}function Xl(t){const e=O.c(22),{virtualMcp:n,currentBranch:r}=t,o=On(),a=ot();let l;e[0]!==o?.messages||e[1]!==a?.isThreadLocked?(l=(o?.messages??[]).length>0||(a?.isThreadLocked??!1),e[0]=o?.messages,e[1]=a?.isThreadLocked,e[2]=l):l=e[2];const c=l,u=a?.setCurrentTaskBranch;let d;e[3]!==n?(d=ns(n),e[3]=n,e[4]=d):d=e[4];const V=d,i=V?.connectionId,{data:m}=Pn.useSession(),f=m?.user?.id??"",{org:x}=ie();let p;e[5]!==i||e[6]!==r||e[7]!==V||e[8]!==c||e[9]!==x||e[10]!==u||e[11]!==f||e[12]!==n?.id||e[13]!==n?.metadata?.sandboxMap?(p=V&&i?s.jsx(Jl,{orgId:x.id,orgSlug:x.slug,userId:f,virtualMcpId:n?.id??"",connectionId:i,owner:V.owner,repo:V.name,sandboxMap:n?.metadata?.sandboxMap,value:r,onChange:j=>{u&&u(j)},locked:c,placement:"chat"}):null,e[5]=i,e[6]=r,e[7]=V,e[8]=c,e[9]=x,e[10]=u,e[11]=f,e[12]=n?.id,e[13]=n?.metadata?.sandboxMap,e[14]=p):p=e[14];const h=p,b=n?.id??"";let g;e[15]!==r||e[16]!==c||e[17]!==b?(g=s.jsx(Ol,{locked:c,currentBranch:r,virtualMcpId:b}),e[15]=r,e[16]=c,e[17]=b,e[18]=g):g=e[18];const v=g;let y;return e[19]!==h||e[20]!==v?(y=s.jsx(Zl,{branchPill:h,modePicker:v}),e[19]=h,e[20]=v,e[21]=y):y=e[21],y}const ei=["fast","smart","thinking"],Te={fast:"Fast",smart:"Smart",thinking:"Thinking"};function ti(t){const e=O.c(30),{tier:n,subtitleFor:r,iconFor:o,onSelect:a}=t,[l,c]=w.useState(!1);let u;e[0]!==a?(u=C=>{a(C),c(!1)},e[0]=a,e[1]=u):u=e[1];const d=u,V=Te[n];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=B("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),e[2]=i):i=e[2];let m;e[3]!==o||e[4]!==n?(m=o?.(n),e[3]=o,e[4]=n,e[5]=m):m=e[5];let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=B("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[6]=f):f=e[6];const x=Te[n];let p;e[7]!==x?(p=s.jsx("span",{className:f,children:x}),e[7]=x,e[8]=p):p=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(ft,{size:12,className:"opacity-60 hidden @[320px]/chat-bottom:inline-block"}),e[9]=h):h=e[9];let b;e[10]!==V||e[11]!==m||e[12]!==p?(b=s.jsx(xe,{asChild:!0,children:s.jsx("span",{className:"inline-flex min-w-0 shrink",children:s.jsx(Ut,{asChild:!0,children:s.jsxs(re,{type:"button",variant:"ghost",size:"default","aria-label":V,className:i,children:[m,p,h]})})})}),e[10]=V,e[11]=m,e[12]=p,e[13]=b):b=e[13];const g=Te[n];let v;e[14]!==g?(v=s.jsx(ge,{children:g}),e[14]=g,e[15]=v):v=e[15];let y;e[16]!==v||e[17]!==b?(y=s.jsxs(be,{children:[b,v]}),e[16]=v,e[17]=b,e[18]=y):y=e[18];let j;e[19]!==d||e[20]!==o||e[21]!==r||e[22]!==n?(j=ei.map(C=>{const S=r(C),D=o?.(C),k=C===n;return s.jsxs("button",{type:"button",role:"menuitem","aria-label":Te[C],onClick:()=>d(C),className:B("flex items-start gap-2 px-2 py-1.5 rounded-md text-left","hover:bg-muted"),children:[D&&s.jsx("span",{className:"shrink-0 text-muted-foreground mt-0.5",children:D}),s.jsxs("div",{className:"flex-1",children:[s.jsx("div",{className:"text-sm",children:Te[C]}),S&&s.jsx("div",{className:"text-xs text-muted-foreground",children:S})]}),k&&s.jsx(Ke,{size:14,className:"text-foreground mt-0.5"})]},C)}),e[19]=d,e[20]=o,e[21]=r,e[22]=n,e[23]=j):j=e[23];let A;e[24]!==j?(A=s.jsx(Kt,{align:"end",className:"p-1 w-56",children:s.jsx("div",{role:"menu",className:"flex flex-col",children:j})}),e[24]=j,e[25]=A):A=e[25];let N;return e[26]!==l||e[27]!==y||e[28]!==A?(N=s.jsxs(Bt,{open:l,onOpenChange:c,children:[y,A]}),e[26]=l,e[27]=y,e[28]=A,e[29]=N):N=e[29],N}function ni(t){return t==="fast"?s.jsx(Yr,{size:16}):t==="thinking"?s.jsx(Hr,{size:16}):s.jsx(Ao,{size:16})}function si(){const t=O.c(6),e=yl(),n=Al(),r=js();let o;t[0]!==r?(o=c=>wl(r,c),t[0]=r,t[1]=o):o=t[1];const a=o;let l;return t[2]!==n||t[3]!==a||t[4]!==e?(l=s.jsx(ti,{tier:e,subtitleFor:a,iconFor:ni,onSelect:n}),t[2]=n,t[3]=a,t[4]=e,t[5]=l):l=t[5],l}async function Yt(t,e,n,r,o){if(!pt(e)){le.error("Selected model does not support file uploads");return}const a=n.type||"application/octet-stream";if(!Vo(a,e)){const c=ts(e),u=e?.title??"This model";o?o({fileName:n.name,modelName:u,accepted:c}):le.error(`"${n.name}" can't be attached`,{description:`${u} accepts ${c}.`});return}const l=10*1024*1024;if(n.size>l){le.error(`File "${n.name}" exceeds 10MB limit`);return}try{const c=new FileReader,u=new Promise((i,m)=>{c.onload=()=>{const f=c.result;if(typeof f!="string"){m(new Error("Failed to read file as data URL"));return}const x=f.includes(",")?f.split(",")[1]??f:f;i(x)},c.onerror=m});c.readAsDataURL(n);const d=await u,V={id:crypto.randomUUID(),name:n.name,mimeType:n.type||"application/octet-stream",size:n.size,data:d};yr(t,{from:r,to:r},V)}catch(c){console.error("Failed to process file:",c),le.error(`Failed to load file "${n.name}"`)}}function ri(t){const e=O.c(8),{editor:n,selectedModel:r,onUnsupportedFile:o}=t,a=w.useRef(ai);let l,c;e[0]!==n||e[1]!==o||e[2]!==r?(l=()=>{a.current=async(V,i)=>{await Yt(n,r,V,i,o)}},c=[n,r,o],e[0]=n,e[1]=o,e[2]=r,e[3]=l,e[4]=c):(l=e[3],c=e[4]),w.useEffect(l,c);let u,d;return e[5]!==n?(u=()=>{if(n?.isDestroyed)return;const V=new It("fileDropHandler");n.state.plugins.find(f=>f.spec.key===V)&&n.unregisterPlugin(V);const m=new jo({key:V,props:{handleDrop:(f,x,p,h)=>{if(h)return!1;const b=x.dataTransfer?.files;if(!b||b.length===0)return!1;x.preventDefault();const g=f.posAtCoords({left:x.clientX,top:x.clientY});if(!g)return!1;const v=Array.from(b),y=g.pos;for(const j of v)a.current?.(j,y);return!0},handlePaste:(f,x)=>{const p=x.clipboardData?.items;if(!p)return!1;const h=Array.from(p).filter(oi);if(h.length===0)return!1;x.preventDefault();const{from:b}=f.state.selection;for(const g of h){const v=g.getAsFile();v&&a.current?.(v,b)}return!0}}});return n.registerPlugin(m),()=>{n?.isDestroyed||n.unregisterPlugin(V)}},d=[n],e[5]=n,e[6]=u,e[7]=d):(u=e[6],d=e[7]),w.useEffect(u,d),null}function oi(t){return t.kind==="file"}function ai(){return Promise.resolve()}function li(t){const e=O.c(26),{info:n,onClose:r}=t,o=n!==null;let a;e[0]!==r?(a=j=>!j&&r(),e[0]=r,e[1]=a):a=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=["radial-gradient(ellipse 40% 200% at -5% 100%, rgba(251,191,36,0.35) 0%, transparent 100%)","radial-gradient(ellipse 40% 200% at 105% -10%, rgba(244,114,182,0.25) 0%, transparent 100%)"],e[2]=l):l=e[2];let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"absolute inset-x-0 top-0 h-36 pointer-events-none",style:{backgroundImage:l.join(", "),maskImage:"linear-gradient(to bottom, black 0%, transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black 0%, transparent 100%)"}}),e[3]=c):c=e[3];let u,d;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("div",{className:"flex items-center justify-center size-9 rounded-lg bg-amber-500/15 text-amber-600 dark:text-amber-400",children:s.jsx(Tn,{size:18})}),d=s.jsx(it,{className:"text-xl font-semibold tracking-tight",children:"File type not supported"}),e[4]=u,e[5]=d):(u=e[4],d=e[5]);const V=n?.fileName;let i;e[6]!==V?(i=s.jsxs("div",{className:"relative px-8 pt-8 pb-2 overflow-hidden",children:[c,s.jsxs(lt,{className:"relative gap-4",children:[u,s.jsxs("div",{children:[d,s.jsxs(Ft,{className:"mt-1.5 text-sm leading-relaxed",children:[s.jsxs("span",{className:"font-medium text-foreground",children:["“",V,"”"]})," ","can't be attached to this chat."]})]})]})]}),e[6]=V,e[7]=i):i=e[7];const m=n?.modelName;let f;e[8]!==m?(f=s.jsxs("div",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground mb-2",children:[m," accepts"]}),e[8]=m,e[9]=f):f=e[9];let x;e[10]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Gr,{size:14,className:"text-muted-foreground"}),e[10]=x):x=e[10];const p=n?.accepted;let h;e[11]!==p?(h=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-foreground",children:[x,s.jsx("span",{className:"capitalize",children:p})]}),e[11]=p,e[12]=h):h=e[12];let b;e[13]!==f||e[14]!==h?(b=s.jsx("div",{className:"px-8 pt-3 pb-6 space-y-3",children:s.jsxs("div",{className:"rounded-xl border border-border p-4",children:[f,h]})}),e[13]=f,e[14]=h,e[15]=b):b=e[15];let g;e[16]!==r?(g=s.jsx("div",{className:"px-8 py-4 border-t border-border bg-muted/30 flex items-center justify-end",children:s.jsx(re,{onClick:r,children:"Got it"})}),e[16]=r,e[17]=g):g=e[17];let v;e[18]!==b||e[19]!==g||e[20]!==i?(v=s.jsxs(ct,{className:"sm:max-w-[480px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:ii,children:[i,b,g]}),e[18]=b,e[19]=g,e[20]=i,e[21]=v):v=e[21];let y;return e[22]!==o||e[23]!==v||e[24]!==a?(y=s.jsx(ut,{open:o,onOpenChange:a,children:v}),e[22]=o,e[23]=v,e[24]=a,e[25]=y):y=e[25],y}function ii(t){return t.preventDefault()}function ci(){const t=O.c(3),[e,n]=w.useState(null);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>n(null),t[0]=r):r=t[0];let o;return t[1]!==e?(o={unsupportedFile:e,onUnsupportedFile:n,clearUnsupportedFile:r},t[1]=e,t[2]=o):o=t[2],o}var ui=wo;var di=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Et=di.join(","),ws=typeof Element>"u",$e=ws?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,nt=!ws&&Element.prototype.getRootNode?function(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}:function(t){return t?.ownerDocument},st=function(e,n){var r;n===void 0&&(n=!0);var o=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),a=o===""||o==="true",l=a||n&&e&&(typeof e.closest=="function"?e.closest("[inert]"):st(e.parentNode));return l},Vi=function(e){var n,r=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"contenteditable");return r===""||r==="true"},fi=function(e,n,r){if(st(e))return[];var o=Array.prototype.slice.apply(e.querySelectorAll(Et));return n&&$e.call(e,Et)&&o.unshift(e),o=o.filter(r),o},Rt=function(e,n,r){for(var o=[],a=Array.from(e);a.length;){var l=a.shift();if(!st(l,!1))if(l.tagName==="SLOT"){var c=l.assignedElements(),u=c.length?c:l.children,d=Rt(u,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:l,candidates:d})}else{var V=$e.call(l,Et);V&&r.filter(l)&&(n||!e.includes(l))&&o.push(l);var i=l.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(l),m=!st(i,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(i&&m){var f=Rt(i===!0?l.children:i.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:l,candidates:f})}else a.unshift.apply(a,l.children)}}return o},Cs=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Ss=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||Vi(e))&&!Cs(e)?0:e.tabIndex},mi=function(e,n){var r=Ss(e);return r<0&&n&&!Cs(e)?0:r},pi=function(e,n){return e.tabIndex===n.tabIndex?e.documentOrder-n.documentOrder:e.tabIndex-n.tabIndex},Ns=function(e){return e.tagName==="INPUT"},hi=function(e){return Ns(e)&&e.type==="hidden"},xi=function(e){var n=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return n},gi=function(e,n){for(var r=0;r<e.length;r++)if(e[r].checked&&e[r].form===n)return e[r]},bi=function(e){if(!e.name)return!0;var n=e.form||nt(e),r=function(c){return n.querySelectorAll('input[type="radio"][name="'+c+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(e.name));else try{o=r(e.name)}catch(l){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",l.message),!1}var a=gi(o,e.form);return!a||a===e},vi=function(e){return Ns(e)&&e.type==="radio"},yi=function(e){return vi(e)&&!bi(e)},Ai=function(e){var n,r=e&&nt(e),o=(n=r)===null||n===void 0?void 0:n.host,a=!1;if(r&&r!==e){var l,c,u;for(a=!!((l=o)!==null&&l!==void 0&&(c=l.ownerDocument)!==null&&c!==void 0&&c.contains(o)||e!=null&&(u=e.ownerDocument)!==null&&u!==void 0&&u.contains(e));!a&&o;){var d,V,i;r=nt(o),o=(d=r)===null||d===void 0?void 0:d.host,a=!!((V=o)!==null&&V!==void 0&&(i=V.ownerDocument)!==null&&i!==void 0&&i.contains(o))}}return a},bn=function(e){var n=e.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},ji=function(e,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in e){var a=e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!a}if(getComputedStyle(e).visibility==="hidden")return!0;var l=$e.call(e,"details>summary:first-of-type"),c=l?e.parentElement:e;if($e.call(c,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var u=e;e;){var d=e.parentElement,V=nt(e);if(d&&!d.shadowRoot&&o(d)===!0)return bn(e);e.assignedSlot?e=e.assignedSlot:!d&&V!==e.ownerDocument?e=V.host:e=d}e=u}if(Ai(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return bn(e);return!1},wi=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var n=e.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return $e.call(n,"fieldset[disabled] *")?!0:!o.contains(e)}return!0}n=n.parentElement}return!1},Ci=function(e,n){return!(n.disabled||hi(n)||ji(n,e)||xi(n)||wi(n))},vn=function(e,n){return!(yi(n)||Ss(n)<0||!Ci(e,n))},Si=function(e){var n=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},ks=function(e){var n=[],r=[];return e.forEach(function(o,a){var l=!!o.scopeParent,c=l?o.scopeParent:o,u=mi(c,l),d=l?ks(o.candidates):c;u===0?l?n.push.apply(n,d):n.push(c):r.push({documentOrder:a,tabIndex:u,item:o,isScope:l,content:d})}),r.sort(pi).reduce(function(o,a){return a.isScope?o.push.apply(o,a.content):o.push(a.content),o},[]).concat(n)},_s=function(e,n){n=n||{};var r;return n.getShadowRoot?r=Rt([e],n.includeContainer,{filter:vn.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Si}):r=fi(e,n.includeContainer,vn.bind(null,n)),ks(r)};function Ni(){return/apple/i.test(navigator.vendor)}const yn="data-floating-ui-focusable";function ki(t){let e=t.activeElement;for(;((n=e)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;e=e.shadowRoot.activeElement}return e}function Tt(t,e){if(!t||!e)return!1;const n=e.getRootNode==null?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&Xs(n)){let r=e;for(;r;){if(t===r)return!0;r=r.parentNode||r.host}}return!1}function Pe(t){return"composedPath"in t?t.composedPath()[0]:t.target}function At(t,e){if(e==null)return!1;if("composedPath"in t)return t.composedPath().includes(e);const n=t;return n.target!=null&&e.contains(n.target)}function _i(t){return t.matches("html,body")}function ze(t){return t?.ownerDocument||document}function Ii(t){return t?t.hasAttribute(yn)?t:t.querySelector("["+yn+"]")||t:null}function We(t,e,n){return n===void 0&&(n=!0),t.filter(o=>{var a;return o.parentId===e&&(!n||((a=o.context)==null?void 0:a.open))}).flatMap(o=>[o,...We(t,o.id,n)])}function Ei(t){return"nativeEvent"in t}var Ri=typeof document<"u",Ti=function(){},pe=Ri?w.useLayoutEffect:Ti;const Pi={...Dn},Di=Pi.useInsertionEffect,Mi=Di||(t=>t());function ke(t){const e=w.useRef(()=>{});return Mi(()=>{e.current=t}),w.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return e.current==null?void 0:e.current(...r)},[])}const Is=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Es(t,e){const n=_s(t,Is()),r=n.length;if(r===0)return;const o=ki(ze(t)),a=n.indexOf(o),l=a===-1?e===1?0:r-1:a+e;return n[l]}function Fi(t){return Es(ze(t).body,1)||t}function Oi(t){return Es(ze(t).body,-1)||t}function jt(t,e){const n=e||t.currentTarget,r=t.relatedTarget;return!r||!Tt(n,r)}function Li(t){_s(t,Is()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function An(t){t.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const $i="data-floating-ui-focusable",jn="active",wn="selected",zi={...Dn};let Cn=!1,Bi=0;const Sn=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Bi++;function Ui(){const[t,e]=w.useState(()=>Cn?Sn():void 0);return pe(()=>{t==null&&e(Sn())},[]),w.useEffect(()=>{Cn=!0},[]),t}const Ki=zi.useId,Ht=Ki||Ui;function qi(){const t=new Map;return{emit(e,n){var r;(r=t.get(e))==null||r.forEach(o=>o(n))},on(e,n){t.has(e)||t.set(e,new Set),t.get(e).add(n)},off(e,n){var r;(r=t.get(e))==null||r.delete(n)}}}const Qi=w.createContext(null),Yi=w.createContext(null),Rs=()=>{var t;return((t=w.useContext(Qi))==null?void 0:t.id)||null},Ts=()=>w.useContext(Yi);function Gt(t){return"data-floating-ui-"+t}const Hi={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Nn=w.forwardRef(function(e,n){const[r,o]=w.useState();pe(()=>{Ni()&&o("button")},[]);const a={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Gt("focus-guard")]:"",style:Hi};return s.jsx("span",{...e,...a})}),Gi={clipPath:"inset(50%)",position:"fixed",top:0,left:0},Ps=w.createContext(null),kn=Gt("portal");function Wi(t){t===void 0&&(t={});const{id:e,root:n}=t,r=Ht(),o=Zi(),[a,l]=w.useState(null),c=w.useRef(null);return pe(()=>()=>{a?.remove(),queueMicrotask(()=>{c.current=null})},[a]),pe(()=>{if(!r||c.current)return;const u=e?document.getElementById(e):null;if(!u)return;const d=document.createElement("div");d.id=r,d.setAttribute(kn,""),u.appendChild(d),c.current=d,l(d)},[e,r]),pe(()=>{if(n===null||!r||c.current)return;let u=n||o?.portalNode;u&&!ar(u)&&(u=u.current),u=u||document.body;let d=null;e&&(d=document.createElement("div"),d.id=e,u.appendChild(d));const V=document.createElement("div");V.id=r,V.setAttribute(kn,""),u=d||u,u.appendChild(V),c.current=V,l(V)},[e,n,r,o]),a}function Ji(t){const{children:e,id:n,root:r,preserveTabOrder:o=!0}=t,a=Wi({id:n,root:r}),[l,c]=w.useState(null),u=w.useRef(null),d=w.useRef(null),V=w.useRef(null),i=w.useRef(null),m=l?.modal,f=l?.open,x=!!l&&!l.modal&&l.open&&o&&!!(r||a);return w.useEffect(()=>{if(!a||!o||m)return;function p(h){a&&jt(h)&&(h.type==="focusin"?An:Li)(a)}return a.addEventListener("focusin",p,!0),a.addEventListener("focusout",p,!0),()=>{a.removeEventListener("focusin",p,!0),a.removeEventListener("focusout",p,!0)}},[a,o,m]),w.useEffect(()=>{a&&(f||An(a))},[f,a]),s.jsxs(Ps.Provider,{value:w.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:u,afterOutsideRef:d,beforeInsideRef:V,afterInsideRef:i,portalNode:a,setFocusManagerState:c}),[o,a]),children:[x&&a&&s.jsx(Nn,{"data-type":"outside",ref:u,onFocus:p=>{if(jt(p,a)){var h;(h=V.current)==null||h.focus()}else{const b=l?l.domReference:null,g=Oi(b);g?.focus()}}}),x&&a&&s.jsx("span",{"aria-owns":a.id,style:Gi}),a&&tr.createPortal(e,a),x&&a&&s.jsx(Nn,{"data-type":"outside",ref:d,onFocus:p=>{if(jt(p,a)){var h;(h=i.current)==null||h.focus()}else{const b=l?l.domReference:null,g=Fi(b);g?.focus(),l?.closeOnFocusOut&&l?.onOpenChange(!1,p.nativeEvent,"focus-out")}}})]})}const Zi=()=>w.useContext(Ps),Xi={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},ec={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},_n=t=>{var e,n;return{escapeKey:typeof t=="boolean"?t:(e=t?.escapeKey)!=null?e:!1,outsidePress:typeof t=="boolean"?t:(n=t?.outsidePress)!=null?n:!0}};function tc(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,elements:o,dataRef:a}=t,{enabled:l=!0,escapeKey:c=!0,outsidePress:u=!0,outsidePressEvent:d="pointerdown",referencePress:V=!1,referencePressEvent:i="pointerdown",ancestorScroll:m=!1,bubbles:f,capture:x}=e,p=Ts(),h=ke(typeof u=="function"?u:()=>!1),b=typeof u=="function"?h:u,g=w.useRef(!1),{escapeKey:v,outsidePress:y}=_n(f),{escapeKey:j,outsidePress:A}=_n(x),N=w.useRef(!1),C=ke(_=>{var T;if(!n||!l||!c||_.key!=="Escape"||N.current)return;const F=(T=a.current.floatingContext)==null?void 0:T.nodeId,E=p?We(p.nodesRef.current,F):[];if(!v&&(_.stopPropagation(),E.length>0)){let I=!0;if(E.forEach(L=>{var z;if((z=L.context)!=null&&z.open&&!L.context.dataRef.current.__escapeKeyBubbles){I=!1;return}}),!I)return}r(!1,Ei(_)?_.nativeEvent:_,"escape-key")}),S=ke(_=>{var T;const F=()=>{var E;C(_),(E=Pe(_))==null||E.removeEventListener("keydown",F)};(T=Pe(_))==null||T.addEventListener("keydown",F)}),D=ke(_=>{var T;const F=a.current.insideReactTree;a.current.insideReactTree=!1;const E=g.current;if(g.current=!1,d==="click"&&E||F||typeof b=="function"&&!b(_))return;const I=Pe(_),L="["+Gt("inert")+"]",z=ze(o.floating).querySelectorAll(L);let $=ce(I)?I:null;for(;$&&!bt($);){const Q=sr($);if(bt(Q)||!ce(Q))break;$=Q}if(z.length&&ce(I)&&!_i(I)&&!Tt(I,o.floating)&&Array.from(z).every(Q=>!Tt($,Q)))return;if(rr(I)&&R){const Q=bt(I),K=or(I),Y=/auto|scroll/,se=Q||Y.test(K.overflowX),X=Q||Y.test(K.overflowY),te=se&&I.clientWidth>0&&I.scrollWidth>I.clientWidth,W=X&&I.clientHeight>0&&I.scrollHeight>I.clientHeight,J=K.direction==="rtl",ee=W&&(J?_.offsetX<=I.offsetWidth-I.clientWidth:_.offsetX>I.clientWidth),Z=te&&_.offsetY>I.clientHeight;if(ee||Z)return}const q=(T=a.current.floatingContext)==null?void 0:T.nodeId,M=p&&We(p.nodesRef.current,q).some(Q=>{var K;return At(_,(K=Q.context)==null?void 0:K.elements.floating)});if(At(_,o.floating)||At(_,o.domReference)||M)return;const U=p?We(p.nodesRef.current,q):[];if(U.length>0){let Q=!0;if(U.forEach(K=>{var Y;if((Y=K.context)!=null&&Y.open&&!K.context.dataRef.current.__outsidePressBubbles){Q=!1;return}}),!Q)return}r(!1,_,"outside-press")}),k=ke(_=>{var T;const F=()=>{var E;D(_),(E=Pe(_))==null||E.removeEventListener(d,F)};(T=Pe(_))==null||T.addEventListener(d,F)});w.useEffect(()=>{if(!n||!l)return;a.current.__escapeKeyBubbles=v,a.current.__outsidePressBubbles=y;let _=-1;function T(z){r(!1,z,"ancestor-scroll")}function F(){window.clearTimeout(_),N.current=!0}function E(){_=window.setTimeout(()=>{N.current=!1},nr()?5:0)}const I=ze(o.floating);c&&(I.addEventListener("keydown",j?S:C,j),I.addEventListener("compositionstart",F),I.addEventListener("compositionend",E)),b&&I.addEventListener(d,A?k:D,A);let L=[];return m&&(ce(o.domReference)&&(L=gt(o.domReference)),ce(o.floating)&&(L=L.concat(gt(o.floating))),!ce(o.reference)&&o.reference&&o.reference.contextElement&&(L=L.concat(gt(o.reference.contextElement)))),L=L.filter(z=>{var $;return z!==(($=I.defaultView)==null?void 0:$.visualViewport)}),L.forEach(z=>{z.addEventListener("scroll",T,{passive:!0})}),()=>{c&&(I.removeEventListener("keydown",j?S:C,j),I.removeEventListener("compositionstart",F),I.removeEventListener("compositionend",E)),b&&I.removeEventListener(d,A?k:D,A),L.forEach(z=>{z.removeEventListener("scroll",T)}),window.clearTimeout(_)}},[a,o,c,b,d,n,r,m,l,v,y,C,j,S,D,A,k]),w.useEffect(()=>{a.current.insideReactTree=!1},[a,b,d]);const P=w.useMemo(()=>({onKeyDown:C,...V&&{[Xi[i]]:_=>{r(!1,_.nativeEvent,"reference-press")},...i!=="click"&&{onClick(_){r(!1,_.nativeEvent,"reference-press")}}}}),[C,r,V,i]),R=w.useMemo(()=>{function _(T){T.button===0&&(g.current=!0)}return{onKeyDown:C,onMouseDown:_,onMouseUp:_,[ec[d]]:()=>{a.current.insideReactTree=!0}}},[C,d,a]);return w.useMemo(()=>l?{reference:P,floating:R}:{},[l,P,R])}function nc(t){const{open:e=!1,onOpenChange:n,elements:r}=t,o=Ht(),a=w.useRef({}),[l]=w.useState(()=>qi()),c=Rs()!=null,[u,d]=w.useState(r.reference),V=ke((f,x,p)=>{a.current.openEvent=f?x:void 0,l.emit("openchange",{open:f,event:x,reason:p,nested:c}),n?.(f,x,p)}),i=w.useMemo(()=>({setPositionReference:d}),[]),m=w.useMemo(()=>({reference:u||r.reference||null,floating:r.floating||null,domReference:r.reference}),[u,r.reference,r.floating]);return w.useMemo(()=>({dataRef:a,open:e,onOpenChange:V,elements:m,events:l,floatingId:o,refs:i}),[e,V,m,l,o,i])}function sc(t){t===void 0&&(t={});const{nodeId:e}=t,n=nc({...t,elements:{reference:null,floating:null,...t.elements}}),r=t.rootContext||n,o=r.elements,[a,l]=w.useState(null),[c,u]=w.useState(null),V=o?.domReference||a,i=w.useRef(null),m=Ts();pe(()=>{V&&(i.current=V)},[V]);const f=er({...t,elements:{...o,...c&&{reference:c}}}),x=w.useCallback(v=>{const y=ce(v)?{getBoundingClientRect:()=>v.getBoundingClientRect(),getClientRects:()=>v.getClientRects(),contextElement:v}:v;u(y),f.refs.setReference(y)},[f.refs]),p=w.useCallback(v=>{(ce(v)||v===null)&&(i.current=v,l(v)),(ce(f.refs.reference.current)||f.refs.reference.current===null||v!==null&&!ce(v))&&f.refs.setReference(v)},[f.refs]),h=w.useMemo(()=>({...f.refs,setReference:p,setPositionReference:x,domReference:i}),[f.refs,p,x]),b=w.useMemo(()=>({...f.elements,domReference:V}),[f.elements,V]),g=w.useMemo(()=>({...f,...r,refs:h,elements:b,nodeId:e}),[f,h,b,e,r]);return pe(()=>{r.dataRef.current.floatingContext=g;const v=m?.nodesRef.current.find(y=>y.id===e);v&&(v.context=g)}),w.useMemo(()=>({...f,context:g,refs:h,elements:b}),[f,h,b,g])}function wt(t,e,n){const r=new Map,o=n==="item";let a=t;if(o&&t){const{[jn]:l,[wn]:c,...u}=t;a=u}return{...n==="floating"&&{tabIndex:-1,[$i]:""},...a,...e.map(l=>{const c=l?l[n]:null;return typeof c=="function"?t?c(t):null:c}).concat(t).reduce((l,c)=>(c&&Object.entries(c).forEach(u=>{let[d,V]=u;if(!(o&&[jn,wn].includes(d)))if(d.indexOf("on")===0){if(r.has(d)||r.set(d,[]),typeof V=="function"){var i;(i=r.get(d))==null||i.push(V),l[d]=function(){for(var m,f=arguments.length,x=new Array(f),p=0;p<f;p++)x[p]=arguments[p];return(m=r.get(d))==null?void 0:m.map(h=>h(...x)).find(h=>h!==void 0)}}}else l[d]=V}),l),{})}}function rc(t){t===void 0&&(t=[]);const e=t.map(c=>c?.reference),n=t.map(c=>c?.floating),r=t.map(c=>c?.item),o=w.useCallback(c=>wt(c,t,"reference"),e),a=w.useCallback(c=>wt(c,t,"floating"),n),l=w.useCallback(c=>wt(c,t,"item"),r);return w.useMemo(()=>({getReferenceProps:o,getFloatingProps:a,getItemProps:l}),[o,a,l])}const oc=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function ac(t,e){var n,r;e===void 0&&(e={});const{open:o,elements:a,floatingId:l}=t,{enabled:c=!0,role:u="dialog"}=e,d=Ht(),V=((n=a.domReference)==null?void 0:n.id)||d,i=w.useMemo(()=>{var g;return((g=Ii(a.floating))==null?void 0:g.id)||l},[a.floating,l]),m=(r=oc.get(u))!=null?r:u,x=Rs()!=null,p=w.useMemo(()=>m==="tooltip"||u==="label"?{["aria-"+(u==="label"?"labelledby":"describedby")]:o?i:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":m==="alertdialog"?"dialog":m,"aria-controls":o?i:void 0,...m==="listbox"&&{role:"combobox"},...m==="menu"&&{id:V},...m==="menu"&&x&&{role:"menuitem"},...u==="select"&&{"aria-autocomplete":"none"},...u==="combobox"&&{"aria-autocomplete":"list"}},[m,i,x,o,V,u]),h=w.useMemo(()=>{const g={id:i,...m&&{role:m}};return m==="tooltip"||u==="label"?g:{...g,...m==="menu"&&{"aria-labelledby":V}}},[m,i,V,u]),b=w.useCallback(g=>{let{active:v,selected:y}=g;const j={role:"option",...v&&{id:i+"-fui-option"}};switch(u){case"select":case"combobox":return{...j,"aria-selected":y}}return{}},[i,u]);return w.useMemo(()=>c?{reference:p,floating:h,item:b}:{},[c,p,h,b])}function lc(t){const e=O.c(24),{editor:n,query:r,items:o,onSelect:a,onClose:l}=t,[c,u]=w.useState(0),d=w.useRef(o),V=w.useRef(c),i=w.useRef(a),m=w.useRef(l),f=w.useDeferredValue(r);let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=()=>{u(0)},e[0]=x):x=e[0];let p;e[1]!==f?(p=[f],e[1]=f,e[2]=p):p=e[2],w.useEffect(x,p);let h,b;e[3]!==o.length||e[4]!==c?(h=()=>{c>=o.length&&o.length>0&&u(0)},b=[o.length,c],e[3]=o.length,e[4]=c,e[5]=h,e[6]=b):(h=e[5],b=e[6]),w.useEffect(h,b);let g,v;e[7]!==o?(g=()=>{d.current=o},v=[o],e[7]=o,e[8]=g,e[9]=v):(g=e[8],v=e[9]),w.useEffect(g,v);let y,j;e[10]!==c?(y=()=>{V.current=c},j=[c],e[10]=c,e[11]=y,e[12]=j):(y=e[11],j=e[12]),w.useEffect(y,j);let A,N;e[13]!==a?(N=()=>{i.current=a},A=[a],e[13]=a,e[14]=A,e[15]=N):(A=e[14],N=e[15]),w.useEffect(N,A);let C,S;e[16]!==l?(C=()=>{m.current=l},S=[l],e[16]=l,e[17]=C,e[18]=S):(C=e[17],S=e[18]),w.useEffect(C,S);let D,k;e[19]!==n?(D=()=>{if(n?.isDestroyed)return;let _;try{_=n.view.dom}catch{return}if(!_)return;const T=E=>{const I=d.current;if(!I.length)return!1;const L=()=>u($=>($+1)%I.length),z=()=>u($=>($-1+I.length)%I.length);switch(E.key){case"ArrowUp":return E.preventDefault(),z(),!0;case"ArrowDown":return E.preventDefault(),L(),!0;case"Tab":return E.preventDefault(),E.shiftKey?z():L(),!0;case"Home":return E.preventDefault(),u(0),!0;case"End":return E.preventDefault(),u(I.length-1),!0;case"Enter":{if(E.isComposing)return!1;E.preventDefault();const $=V.current;return $!==-1&&I[$]&&i.current?.(I[$],$),!0}case"Escape":return E.preventDefault(),m.current?.(),!0;default:return!1}},F=E=>{T(E)};return _.addEventListener("keydown",F,!0),()=>{_?.removeEventListener("keydown",F,!0)}},k=[n],e[19]=n,e[20]=D,e[21]=k):(D=e[20],k=e[21]),w.useEffect(D,k);const P=o.length?c:void 0;let R;return e[22]!==P?(R={selectedIndex:P,setSelectedIndex:u},e[22]=P,e[23]=R):R=e[23],R}function ic(t,e){switch(e.type){case"SET_SELECTED_ITEM":return{...t,selectedItem:e.payload};case"ON_START":return{...t,open:!0,selectedItem:null,element:e.payload.element,query:e.payload.query,range:e.payload.range};case"ON_UPDATE":return{...t,element:e.payload.element,query:e.payload.query,range:e.payload.range};case"ON_EXIT":return{open:!1,element:null,query:"",range:null,selectedItem:null};default:return t}}const Ds=w.createContext(void 0);function Ms(){const t=w.useContext(Ds);if(!t)throw new Error("useSuggestionContext must be used within a SuggestionContext.Provider");return t}function cc({editor:t,char:e,pluginKey:n,allow:r,onOpenChange:o}){const[a,l]=w.useReducer(ic,{open:!1,element:null,query:"",range:null,selectedItem:null}),c=w.useRef(o);return c.current=o,w.useEffect(()=>{if(t?.isDestroyed)return;const u=n instanceof It?n:new It(n);t.state.plugins.find(i=>i.spec.key===u)&&t.unregisterPlugin(u);const V=_o({pluginKey:u,editor:t,char:e,allow(i){const m=t.state.doc.resolve(i.range.from);for(let f=m.depth;f>0;f--)if(m.node(f).type.name==="image")return!1;return!(r&&!r(i))},command(){},render:()=>({onStart:i=>{l({type:"ON_START",payload:{element:i.decorationNode??null,query:i.query,range:i.range}}),c.current?.(!0)},onUpdate:i=>{l({type:"ON_UPDATE",payload:{element:i.decorationNode??null,query:i.query,range:i.range}})},onKeyDown:i=>i.event.key==="Escape"?(l({type:"ON_EXIT"}),!0):!1,onExit:()=>{l({type:"ON_EXIT"}),c.current?.(!1)}}),items:()=>[]});return t.registerPlugin(V),()=>{t?.isDestroyed||t.unregisterPlugin(u)}},[t,n,e,l,r]),{state:a,dispatch:l}}function uc({editor:t,queryKey:e,queryFn:n,onSelect:r}){const{state:o,dispatch:a}=Ms(),l=w.useDeferredValue(o.query),{data:c}=lr({queryKey:Ie.suggestionItems(e,o.open,l),queryFn:()=>o.open?n({query:l}):[]}),u=()=>{a({type:"ON_EXIT"})},d=async(i,m)=>{if(!(o.selectedItem!==null||!o.range)){a({type:"SET_SELECTED_ITEM",payload:i});try{const{view:f}=t,p=f.state.selection.$to.nodeAfter?.text?.startsWith(" "),h=o.range?{...o.range}:{from:0,to:0};p&&o.range&&(h.to+=1),await r({range:h,item:i})===!1?a({type:"SET_SELECTED_ITEM",payload:null}):u()}catch{u()}}},{selectedIndex:V}=lc({editor:t,query:l,items:c,onSelect:d,onClose:u});return{selectedItem:o.selectedItem,items:c,selectedIndex:V,close:u,onSelect:d}}function dc({children:t}){const{state:e,dispatch:n}=Ms(),{open:r,element:o}=e,a=()=>{n({type:"ON_EXIT"})},{refs:l,floatingStyles:c,context:u}=sc({placement:"bottom-start",open:r,onOpenChange:m=>{m||a()},elements:{reference:o},middleware:[ir(10),cr(),ur()],whileElementsMounted:dr}),d=tc(u,{outsidePress:m=>!(m.target instanceof Element&&m.target.closest(".ProseMirror"))}),V=ac(u,{role:"listbox"}),{getFloatingProps:i}=rc([d,V]);return r?s.jsx(Ji,{children:s.jsx("div",{ref:l.setFloating,style:c,...i(),className:"z-50 w-auto min-w-[360px] max-w-[520px] rounded-lg border bg-popover p-0 text-popover-foreground shadow-md outline-hidden overflow-hidden",children:t})}):null}const Vc=t=>{const e=O.c(29),{item:n,isSelected:r,onSelect:o,isLoading:a,ref:l}=t;let c;if(e[0]!==n){const A=de(n._meta);c=n.title||Mt(n.name,A),e[0]=n,e[1]=c}else c=e[1];const u=c,d=n.description||null,V=n.icon,i=r&&"bg-accent text-accent-foreground",m=a&&"pointer-events-none opacity-50";let f;e[2]!==i||e[3]!==m?(f=B("relative flex w-full cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors","hover:bg-accent hover:text-accent-foreground","focus:bg-accent focus:text-accent-foreground",i,m),e[2]=i,e[3]=m,e[4]=f):f=e[4];let x;e[5]!==V||e[6]!==u?(x=V!==void 0&&s.jsx(Kn,{icon:V,name:u,size:"xs",className:"mr-2"}),e[5]=V,e[6]=u,e[7]=x):x=e[7];let p;e[8]!==u?(p=s.jsx("span",{className:"font-medium flex items-center truncate capitalize",children:u}),e[8]=u,e[9]=p):p=e[9];let h;e[10]!==a?(h=a&&s.jsx(Ct,{size:"xs"}),e[10]=a,e[11]=h):h=e[11];let b;e[12]!==p||e[13]!==h?(b=s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p,h]}),e[12]=p,e[13]=h,e[14]=b):b=e[14];let g;e[15]!==d?(g=d&&s.jsx("div",{className:"text-xs text-muted-foreground line-clamp-1",children:d}),e[15]=d,e[16]=g):g=e[16];let v;e[17]!==b||e[18]!==g?(v=s.jsxs("div",{className:"flex flex-col gap-0.5 flex-1 min-w-0",children:[b,g]}),e[17]=b,e[18]=g,e[19]=v):v=e[19];let y;e[20]!==n.drillable?(y=n.drillable&&s.jsx("kbd",{className:"shrink-0 ml-2 px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground bg-muted border border-border rounded",children:"↵"}),e[20]=n.drillable,e[21]=y):y=e[21];let j;return e[22]!==o||e[23]!==l||e[24]!==v||e[25]!==y||e[26]!==f||e[27]!==x?(j=s.jsxs("div",{ref:l,onClick:o,className:f,children:[x,v,y]}),e[22]=o,e[23]=l,e[24]=v,e[25]=y,e[26]=f,e[27]=x,e[28]=j):j=e[28],j},fc=t=>{const e=O.c(18),{editor:n,queryKey:r,queryFn:o,onSelect:a}=t;let l;e[0]!==n||e[1]!==a||e[2]!==o||e[3]!==r?(l={editor:n,queryKey:r,queryFn:o,onSelect:a},e[0]=n,e[1]=a,e[2]=o,e[3]=r,e[4]=l):l=e[4];const{items:c,selectedIndex:u,onSelect:d,selectedItem:V}=uc(l);if(!c.length){let x;return e[5]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("div",{className:"min-w-[360px] max-w-[520px] bg-popover text-popover-foreground rounded-md border shadow-md p-3 text-sm",children:"No items found"}),e[5]=x):x=e[5],x}let i;e[6]===Symbol.for("react.memo_cache_sentinel")?(i={maxHeight:"min(320px, var(--radix-popover-content-available-height, 320px))"},e[6]=i):i=e[6];let m;if(e[7]!==d||e[8]!==c||e[9]!==u||e[10]!==V?.name){let x;e[12]!==d||e[13]!==u||e[14]!==V?.name?(x=(p,h)=>s.jsx(Vc,{item:p,isSelected:h===u,ref:h===u?hc:void 0,onSelect:()=>d(p,h),isLoading:V?.name===p.name},p.name),e[12]=d,e[13]=u,e[14]=V?.name,e[15]=x):x=e[15],m=c.map(x),e[7]=d,e[8]=c,e[9]=u,e[10]=V?.name,e[11]=m}else m=e[11];let f;return e[16]!==m?(f=s.jsx("div",{className:"min-w-[360px] max-w-[520px] bg-popover text-popover-foreground rounded-md overflow-y-auto",style:i,children:s.jsx("div",{className:"p-1",children:m})}),e[16]=m,e[17]=f):f=e[17],f};function mc(){const t=O.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"p-1",children:[...Array(3)].map(pc)}),t[0]=e):e=t[0],e}function pc(t,e){return s.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1.5 animate-pulse",children:[s.jsx("div",{className:"h-4 w-24 bg-muted rounded"}),s.jsx("div",{className:"h-3 w-32 bg-muted rounded"})]},e)}function Fs(t){const e=O.c(18),{editor:n,char:r,pluginKey:o,queryKey:a,queryFn:l,onSelect:c,allow:u,onOpenChange:d}=t;let V;e[0]!==u||e[1]!==r||e[2]!==n||e[3]!==d||e[4]!==o?(V={editor:n,char:r,pluginKey:o,allow:u,onOpenChange:d},e[0]=u,e[1]=r,e[2]=n,e[3]=d,e[4]=o,e[5]=V):V=e[5];const{state:i,dispatch:m}=cc(V);let f;e[6]!==m||e[7]!==i?(f={state:i,dispatch:m},e[6]=m,e[7]=i,e[8]=f):f=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(mc,{}),e[9]=x):x=e[9];let p;e[10]!==n||e[11]!==c||e[12]!==l||e[13]!==a?(p=s.jsx(dc,{children:s.jsx(w.Suspense,{fallback:x,children:s.jsx(fc,{editor:n,queryKey:a,queryFn:l,onSelect:c})})}),e[10]=n,e[11]=c,e[12]=l,e[13]=a,e[14]=p):p=e[14];let h;return e[15]!==f||e[16]!==p?(h=s.jsx(Ds.Provider,{value:f,children:p}),e[15]=f,e[16]=p,e[17]=h):h=e[17],h}function hc(t){t&&t.scrollIntoView({block:"center",behavior:"smooth"})}const xc=[{name:"agents",title:"Agents",description:"Mention an agent to hand off work",kind:"category",drillable:!0},{name:"resources",title:"Resources",description:"Attach a resource as context",kind:"category",drillable:!0}],gc=({editor:t,virtualMcpId:e})=>{const n=Be(),{org:r}=ie(),o=Ur(),a=Re({connectionId:e,orgId:r.id,orgSlug:r.slug}),l=Ie.virtualMcpResources(e,r.id),[c,u]=w.useState("categories"),d=w.useRef(c);d.current=c;const V=w.useRef(null),i=w.useRef(!1),m=["at-mention",r.id,e??"default",c],f=async({item:h,range:b})=>{if(G("chat_picker_item_selected",{picker:"@",item_kind:h.kind,item_name:h.name}),h.kind!=="category"&&(i.current=!0),h.kind==="category")return u(h.name==="agents"?"agents":"resources"),!1;if(h.kind==="agent"&&h.agentId){Le(t,b,{id:h.agentId,name:h.name,metadata:{agentId:h.agentId,title:h.name},char:"@"}),u("categories");return}if(h.kind==="resource"&&h.uri&&a){try{const g=await Mn(a,h.uri);Le(t,b,{id:h.uri,name:h.uri,metadata:g.contents,char:"@"})}catch(g){console.error("[at-mention] Failed to fetch resource:",g),le.error("Failed to load resource. Please try again.")}u("categories");return}},x=async h=>{const{query:b}=h,g=d.current;if(g==="categories"){if(!b.trim())return xc;const j=b.toLowerCase(),A=o.filter(C=>C.status==="active"&&(!C.id||!Zt(C.id))&&C.id!==e&&(C.title.toLowerCase().includes(j)||C.description?.toLowerCase().includes(j))).map(C=>({name:C.title,title:C.title,description:C.description??void 0,icon:C.icon??null,kind:"agent",agentId:C.id})),N=await(async()=>{if(!a)return[];let C=n.getQueryData(l);return C||(C=await n.fetchQuery({queryKey:l,queryFn:()=>Oe(a),staleTime:6e4})),(C?.resources??[]).filter(S=>S.uri.toLowerCase().includes(j)||S.name?.toLowerCase().includes(j)||S.description?.toLowerCase().includes(j)).map(S=>({name:S.name??S.uri,title:S.name,description:S.description,kind:"resource",uri:S.uri}))})();return[...A,...N]}if(g==="agents"){let j=o.filter(A=>A.status==="active"&&(!A.id||!Zt(A.id))&&A.id!==e);if(b.trim()){const A=b.toLowerCase();j=j.filter(N=>N.title.toLowerCase().includes(A)||N.description?.toLowerCase().includes(A))}return j.map(A=>({name:A.title,title:A.title,description:A.description??void 0,icon:A.icon??null,kind:"agent",agentId:A.id}))}if(!a)return[];let v=n.getQueryData(l);v?n.fetchQuery({queryKey:l,queryFn:()=>Oe(a),staleTime:6e4}).catch(()=>{}):v=await n.fetchQuery({queryKey:l,queryFn:()=>Oe(a),staleTime:6e4});let y=v?.resources??[];if(b.trim()){const j=b.toLowerCase();y=y.filter(A=>A.uri.toLowerCase().includes(j)||A.name?.toLowerCase().includes(j)||A.description?.toLowerCase().includes(j))}return y.map(j=>({name:j.name??j.uri,title:j.name,description:j.description,kind:"resource",uri:j.uri}))},p=h=>{if(h)V.current=Date.now(),i.current=!1,G("chat_picker_opened",{picker:"@"});else{const b=V.current;G("chat_picker_closed",{picker:"@",outcome:i.current?"selected":"dismissed",duration_ms:b?Date.now()-b:null}),V.current=null,u("categories")}};return s.jsx(Fs,{editor:t,char:"@",pluginKey:"atDropdownMenu",queryKey:m,queryFn:x,onSelect:f,onOpenChange:p})};async function In(t,e,n,r,o,a){try{const l=await Vt(n,r,a);Le(t,e,{id:r,name:at(r,o),metadata:l.messages,char:"/",kind:"prompt",args:a})}catch(l){console.error("[slash] Failed to fetch prompt:",l),le.error("Failed to load prompt. Please try again.")}}async function bc(t,e,n,r){try{const o=await Mn(n,r);Le(t,e,{id:r,name:r,metadata:o.contents,char:"/",kind:"resource"})}catch(o){console.error("[slash] Failed to fetch resource:",o),le.error("Failed to load resource. Please try again.")}}const vc=({editor:t,virtualMcpId:e})=>{const n=Be(),{org:r}=ie(),o=Re({connectionId:e,orgId:r.id,orgSlug:r.slug}),a=Ie.virtualMcpPrompts(e,r.id),l=Ie.virtualMcpResources(e,r.id),c=["slash-mention",r.id,e??"default"],[u,d]=w.useState(null),[V,i]=w.useState(null),m=Ar(t);m&&(m.onEditChip=async y=>{if(o)try{const A=(await En(n,a,o)).find(N=>N.name===y.promptId);if(!A?.arguments||A.arguments.length===0)return;i({...y,prompt:A})}catch(j){console.error("[slash] Failed to load prompt for editing:",j),le.error("Failed to load prompt. Please try again.")}});const f=w.useRef(null),x=w.useRef(!1),p=async({item:y,range:j})=>{if(G("chat_picker_item_selected",{picker:"/",item_kind:y.kind,item_name:y.name}),x.current=!0,!!o)if(y.kind==="prompt"){if(y.arguments&&y.arguments.length>0){d({range:j,item:y});return}const A=de(y._meta);await In(t,j,o,y.name,A)}else y.uri&&await bc(t,j,o,y.uri)},h=async y=>{if(!u||!o)return;const{range:j,item:A}=u,N=de(A._meta);await In(t,j,o,A.name,N,y),d(null)},b=async y=>{if(!(!V||!o)){try{const j=await Vt(o,V.promptId,y),A=de(V.prompt._meta);t.chain().focus().setNodeSelection(V.pos).deleteSelection().insertContentAt(V.pos,Ln({id:V.promptId,name:at(V.promptId,A),metadata:j.messages,char:"/",kind:"prompt",args:y})).run(),G("chat_picker_item_selected",{picker:"/edit",item_kind:"prompt",item_name:V.promptId})}catch(j){console.error("[slash] Failed to update prompt:",j),le.error("Failed to update prompt. Please try again.")}i(null)}},g=async y=>{const{query:j}=y;if(!o)return[];const[A,N]=await Promise.all([En(n,a,o),yc(n,l,o)]),C=j.trim().toLowerCase(),S=(A??[]).filter(k=>!C||k.name.toLowerCase().includes(C)||k.title?.toLowerCase().includes(C)||k.description?.toLowerCase().includes(C)).map(k=>({name:k.name,title:k.title,description:k.description,kind:"prompt",arguments:k.arguments,_meta:k._meta})),D=(N??[]).filter(k=>!C||k.uri.toLowerCase().includes(C)||k.name?.toLowerCase().includes(C)||k.description?.toLowerCase().includes(C)).map(k=>({name:k.name??k.uri,title:k.name,description:k.description,kind:"resource",uri:k.uri}));return[...S,...D]},v=u?.item.kind==="prompt"?{name:u.item.name,title:u.item.title,arguments:u.item.arguments,description:u.item.description,_meta:u.item._meta}:null;return s.jsxs(s.Fragment,{children:[s.jsx(Fs,{editor:t,char:"/",pluginKey:"slashDropdownMenu",queryKey:c,queryFn:g,onSelect:p,onOpenChange:y=>{if(y)f.current=Date.now(),x.current=!1,G("chat_picker_opened",{picker:"/"});else{const j=f.current;G("chat_picker_closed",{picker:"/",outcome:x.current?"selected":"dismissed",duration_ms:j?Date.now()-j:null}),f.current=null}}}),s.jsx(Je,{prompt:v,setPrompt:()=>d(null),onSubmit:h}),s.jsx(Je,{prompt:V?.prompt??null,setPrompt:()=>i(null),onSubmit:b,defaultValues:V?.args},V?`edit-${V.promptId}-${V.pos}`:"edit-idle")]})};async function En(t,e,n){let r=t.getQueryData(e);return r?t.fetchQuery({queryKey:e,queryFn:()=>Nt(n),staleTime:6e4}).catch(()=>{}):r=await t.fetchQuery({queryKey:e,queryFn:()=>Nt(n),staleTime:6e4}),r?.prompts??[]}async function yc(t,e,n){let r=t.getQueryData(e);return r?t.fetchQuery({queryKey:e,queryFn:()=>Oe(n),staleTime:6e4}).catch(()=>{}):r=await t.fetchQuery({queryKey:e,queryFn:()=>Oe(n),staleTime:6e4}),r?.resources??[]}function Ac(t){return[No.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,dropcursor:!1}),ui.configure({placeholder:()=>t.current??"Ask anything, / for prompts, @ for agents & resources...",showOnlyWhenEditable:!1}),jr,wr]}function jc({tiptapDoc:t,setTiptapDoc:e,disabled:n=!1,enterToSubmit:r=!1,placeholder:o,onSubmit:a,children:l}){const c=w.useRef(a),u=w.useRef(e),d=w.useRef(r),V=w.useRef(o),i=Co({extensions:Ac(V),content:t||"",editorProps:{attributes:{"data-chat-input":"true",class:"prose prose-sm max-w-none focus:outline-none w-full h-full text-[15px] p-[18px]"},handleKeyDown:(m,f)=>f.key==="Enter"&&!f.shiftKey&&d.current?(f.preventDefault(),c.current?.(),!0):!1},onUpdate:({editor:m})=>{u.current(m?.getJSON())}});return w.useEffect(()=>{i?.setEditable(!n)},[i,n]),w.useEffect(()=>{c.current=a},[a]),w.useEffect(()=>{u.current=e},[e]),w.useEffect(()=>{d.current=r},[r]),w.useEffect(()=>{V.current=o},[o]),w.useEffect(()=>{if(!i||i.isDestroyed)return;const m=JSON.stringify(i.getJSON()),f=JSON.stringify(t||{type:"doc",content:[]});m!==f&&i.commands.setContent(t||{type:"doc",content:[]})},[i,t]),s.jsx(So.Provider,{value:{editor:i},children:l})}function wc(t){const e=O.c(26),{disabled:n,virtualMcpId:r,showFileUploader:o,selectedModel:a,onUnsupportedFile:l,ref:c,className:u}=t,d=n===void 0?!1:n,V=o===void 0?!1:o,{editor:i}=qt();let m,f;if(e[0]!==i?(m=()=>({focus:()=>{i?.commands.focus()},clear:()=>{i?.commands.clearContent(!0)},appendText:C=>{if(!i)return;const S=i.state.doc.textContent.trim()==="";i.commands.focus("end"),S||i.commands.insertContent(" "),i.commands.insertContent(C)},syncVoiceText:(C,S)=>{if(i&&(i.commands.setContent(C||{type:"doc",content:[]}),S)){i.commands.focus("end");const D=i.state.doc.textContent.trim().length>0;i.commands.insertContent(D?" "+S:S)}},restoreContent:C=>{i&&i.commands.setContent(C||{type:"doc",content:[]})}}),f=[i],e[0]=i,e[1]=m,e[2]=f):(m=e[1],f=e[2]),w.useImperativeHandle(c??null,m,f),!i)return null;const x=d&&"cursor-not-allowed opacity-70",p=d&&"[&_.ProseMirror]:cursor-not-allowed";let h;e[3]!==u||e[4]!==x||e[5]!==p?(h=B("overflow-y-auto relative flex-1 max-h-[164px] min-h-[20px] w-full flex flex-col",u,"[&_.ProseMirror]:outline-none [&_.ProseMirror]:min-h-[20px] [&_.ProseMirror]:flex-1","[&_.ProseMirror_p.is-editor-empty:first-child::before]:content-[attr(data-placeholder)]","[&_.ProseMirror_p.is-editor-empty:first-child::before]:text-muted-foreground","[&_.ProseMirror_p.is-editor-empty:first-child::before]:opacity-50","[&_.ProseMirror_p.is-editor-empty:first-child::before]:float-left","[&_.ProseMirror_p.is-editor-empty:first-child::before]:pointer-events-none","[&_.ProseMirror_p.is-editor-empty:first-child::before]:h-0",x,p),e[3]=u,e[4]=x,e[5]=p,e[6]=h):h=e[6];let b;e[7]!==i||e[8]!==h?(b=s.jsx(ko,{editor:i,className:h}),e[7]=i,e[8]=h,e[9]=b):b=e[9];const g=r??null;let v;e[10]!==i||e[11]!==g?(v=s.jsx(w.Suspense,{fallback:null,children:s.jsx(vc,{editor:i,virtualMcpId:g})}),e[10]=i,e[11]=g,e[12]=v):v=e[12];const y=r??null;let j;e[13]!==i||e[14]!==y?(j=s.jsx(w.Suspense,{fallback:null,children:s.jsx(gc,{editor:i,virtualMcpId:y})}),e[13]=i,e[14]=y,e[15]=j):j=e[15];let A;e[16]!==i||e[17]!==l||e[18]!==a||e[19]!==V?(A=V&&a?s.jsx(ri,{editor:i,selectedModel:a,onUnsupportedFile:l}):null,e[16]=i,e[17]=l,e[18]=a,e[19]=V,e[20]=A):A=e[20];let N;return e[21]!==v||e[22]!==j||e[23]!==A||e[24]!==b?(N=s.jsxs(s.Fragment,{children:[b,v,j,A]}),e[21]=v,e[22]=j,e[23]=A,e[24]=b,e[25]=N):N=e[25],N}function Os(t){const e=O.c(3),[n]=Ee();let r;return e[0]!==n.enableSounds||e[1]!==t?(r=()=>{n.enableSounds&&Do(t.dataUri).catch(a=>{console.warn(`[sound] ${t.name} playback failed:`,a)})},e[0]=n.enableSounds,e[1]=t,e[2]=r):r=e[2],r}const Cc={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"},Sc=zr.togglePlanMode.keys.map(t=>t==="Shift"?"⇧":t).join(""),Nc=[{src:"/connections/gmail.png",name:"Gmail"},{src:"/connections/perplexity.png",name:"Perplexity"},{src:"/connections/github.png",name:"GitHub"}];function kc(){const t=O.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex items-center -space-x-1.5",children:Nc.map(_c)}),t[0]=e):e=t[0],e}function _c(t){return s.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-1 ring-border object-cover bg-white"},t.name)}function Ic({disabled:t,onOpenConnections:e,virtualMcpId:n,selectedModel:r,isStreaming:o,onUnsupportedFile:a}){const[l,c]=w.useState(!1),u=Os(Cc),{org:d}=ie(),{editor:V}=qt(),i=w.useRef(null),m=pt(r),f=()=>{!m||o||(c(!1),i.current?.click())},x=async M=>{const U=M.target.files;if(!U||U.length===0||!V)return;const Q=Array.from(U),{from:K}=V.state.selection;try{for(const Y of Q)await Yt(V,r??null,Y,K,a)}finally{i.current&&(i.current.value="")}},p=Re({connectionId:n,orgId:d.id,orgSlug:d.slug}),h=Ie.virtualMcpPrompts(n,d.id),{data:b,isLoading:g}=Rn({queryKey:h,queryFn:()=>Nt(p),staleTime:6e4,enabled:l&&!!p}),v=b?.prompts??[],[y,j]=w.useState(null),{chatMode:A,setChatMode:N}=fe(),[C,S]=Ee(),k=(De.find(M=>M.value===C.toolApprovalLevel)??De[0]).short,P=M=>{const U=De.find(Q=>Q.value===M);if(U){if(U.value===C.toolApprovalLevel){c(!1);return}u(),G("chat_approval_level_changed",{from_level:C.toolApprovalLevel,to_level:U.value,source:"tools_popover"}),S({...C,toolApprovalLevel:U.value}),c(!1)}},R=A==="plan",_=()=>{u();const M=R?"default":"plan";G("chat_mode_changed",{from_mode:A,to_mode:M,source:"tools_popover"}),N(M),c(!1)},T=()=>{e(),c(!1)},F=async(M,U)=>{if(!V||!p)return;const Q=de(M._meta),K={from:V.state.selection.from,to:V.state.selection.to};try{const Y=await Vt(p,M.name,U);Le(V,K,{id:M.name,name:at(M.name,Q),metadata:Y.messages,char:"/",kind:"prompt",args:U})}catch{le.error("Failed to load prompt. Please try again.")}},E=async M=>{c(!1);const U=!!(M.arguments&&M.arguments.length>0);if(G("chat_prompt_inserted",{prompt_name:M.name,with_arguments:U}),U){j(M);return}await F(M)},I=async M=>{y&&(await F(y,M),j(null))},L=()=>{u();const M=A==="gen-image"?"default":"gen-image";G("chat_mode_changed",{from_mode:A,to_mode:M,source:"tools_popover"}),N(M),c(!1)},z=()=>{u();const M=A==="web-search"?"default":"web-search";G("chat_mode_changed",{from_mode:A,to_mode:M,source:"tools_popover"}),N(M),c(!1)},$=A==="gen-image",q=A==="web-search";return s.jsxs(s.Fragment,{children:[s.jsx("input",{ref:i,type:"file",multiple:!0,accept:fo(r??null),className:"hidden",onChange:x,disabled:o}),s.jsxs(Io,{open:l,onOpenChange:M=>{M&&!l&&G("chat_tools_popover_opened",{chat_mode:A}),c(M)},children:[s.jsx(Eo,{asChild:!0,children:s.jsxs(re,{type:"button",variant:"ghost",size:"default",disabled:t,title:"Tools","aria-label":"Tools",className:B("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),children:[s.jsx(Wr,{size:14}),s.jsx("span",{className:B("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:"Tools"})]})}),s.jsxs(Ro,{align:"start",className:"w-52 p-1.5 space-y-1",children:[m?s.jsxs(me,{onClick:f,disabled:o,children:[s.jsx(rn,{size:16}),s.jsx("span",{className:"flex-1",children:"Add file"})]}):s.jsxs(be,{children:[s.jsx(xe,{asChild:!0,children:s.jsxs(me,{"aria-disabled":"true",className:"opacity-50 cursor-not-allowed",onSelect:M=>M.preventDefault(),children:[s.jsx(rn,{size:16}),s.jsx("span",{className:"flex-1",children:"Add file"})]})}),s.jsx(ge,{side:"right",children:"The selected model does not support reading files or images."})]}),s.jsxs(me,{onClick:_,className:B(R&&"text-violet-600 dark:text-violet-400"),children:[s.jsx($n,{size:16,className:B(R&&"text-violet-500")}),s.jsx("span",{className:"flex-1",children:"Plan mode"}),s.jsx("span",{className:B("text-xs text-muted-foreground",R&&"text-violet-500 font-medium"),children:Sc})]}),s.jsxs(me,{onClick:L,className:B($&&"text-pink-600 dark:text-pink-400"),children:[s.jsx(Bn,{size:16,className:B($&&"text-pink-500")}),s.jsx("span",{className:"flex-1",children:"Create image"}),$&&s.jsx("span",{className:"text-xs text-pink-500 font-medium",children:"On"})]}),s.jsxs(me,{onClick:z,className:B(q&&"text-blue-600 dark:text-blue-400"),children:[s.jsx(zn,{size:16,className:B(q&&"text-blue-500")}),s.jsx("span",{className:"flex-1",children:"Web search"}),q&&s.jsx("span",{className:"text-xs text-blue-500 font-medium",children:"On"})]}),s.jsxs(tn,{children:[s.jsxs(nn,{className:"gap-2",children:[s.jsx("span",{className:"flex size-4 items-center justify-center text-base font-medium text-muted-foreground",children:"/"}),s.jsx("span",{className:"flex-1",children:"Prompts"})]}),s.jsx(sn,{className:"w-80 max-h-72 overflow-y-auto p-1.5",children:g?s.jsxs("div",{className:"flex items-center gap-2 px-2 py-3 text-sm text-muted-foreground",children:[s.jsx(Vr,{size:14,className:"animate-spin"}),"Loading prompts…"]}):v.length===0?s.jsx("div",{className:"px-2 py-3 text-sm text-muted-foreground",children:"No prompts available"}):v.map(M=>s.jsxs(me,{onClick:()=>E(M),className:"flex flex-col items-start gap-0.5",children:[s.jsx("span",{className:"font-medium text-sm capitalize",children:M.title||Mt(M.name,de(M._meta))}),M.description&&s.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:M.description})]},M.name))})]}),s.jsxs(tn,{children:[s.jsxs(nn,{className:"gap-2",children:[s.jsx(mt,{size:16}),s.jsx("span",{className:"flex-1",children:"Approval"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:k})]}),s.jsx(sn,{className:"w-48 p-1.5",children:s.jsx(To,{value:C.toolApprovalLevel,onValueChange:P,children:De.map(M=>s.jsx(Po,{value:M.value,children:M.label},M.value))})})]}),s.jsxs(me,{onClick:T,children:[s.jsx(lo,{size:16}),s.jsx("span",{className:"flex-1",children:"Connections"}),s.jsx(w.Suspense,{children:s.jsx(kc,{})})]})]})]}),s.jsx(Je,{prompt:y,setPrompt:j,onSubmit:I})]})}const Ec=[{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 Rc(){const t=O.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex items-center -space-x-1",children:Ec.map(Tc)}),t[0]=e):e=t[0],e}function Tc(t){return s.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-2 ring-muted object-cover bg-white"},t.name)}function Pc(t){const e=O.c(6),{onClick:n}=t;let r,o,a,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=B("group relative z-10 flex items-center gap-3 w-full px-4 py-3","rounded-b-2xl","cursor-pointer"),o=s.jsx("p",{className:"flex-1 text-xs text-muted-foreground truncate text-left",children:"Connect tools and get more done"}),a=s.jsx(Rc,{}),l=s.jsx(Fo,{size:14,className:"shrink-0 text-muted-foreground/60 group-hover:text-muted-foreground transition-colors"}),e[0]=r,e[1]=o,e[2]=a,e[3]=l):(r=e[0],o=e[1],a=e[2],l=e[3]);let c;return e[4]!==n?(c=s.jsxs("button",{type:"button",onClick:n,className:r,children:[o,a,l]}),e[4]=n,e[5]=c):c=e[5],c}const Fe=48;function Dc(){const t=O.c(9),[e,n]=w.useState("idle"),[r,o]=w.useState(""),[a,l]=w.useState(""),[c,u]=w.useState(Oc),d=w.useRef(null),V=w.useRef(null),i=w.useRef(null),m=w.useRef(null),f=w.useRef(0),x=w.useRef(!1),p=w.useRef(""),h=w.useRef(""),b=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition);let g;t[0]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{f.current&&(cancelAnimationFrame(f.current),f.current=0),V.current?.close().catch(Fc),m.current?.getTracks().forEach(Mc),i.current=null,V.current=null,m.current=null},t[0]=g):g=t[0];const v=g;let y;if(t[1]===Symbol.for("react.memo_cache_sentinel")){const k=P=>{m.current=P;const R=new AudioContext;V.current=R;const _=R.createMediaStreamSource(P),T=R.createAnalyser();T.fftSize=128,T.smoothingTimeConstant=.8,_.connect(T),i.current=T;const F=new Uint8Array(T.frequencyBinCount),E=()=>{if(!i.current)return;i.current.getByteFrequencyData(F);const I=[];for(let L=0;L<Fe;L++){const z=Math.floor(L/Fe*F.length);I.push(Math.max(.04,(F[z]??0)/255))}u(I),f.current=requestAnimationFrame(E)};E()};y=async()=>{const P=window.SpeechRecognition||window.webkitSpeechRecognition;if(!P){n("unsupported");return}let R;try{R=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{n("permission-denied");return}o(""),l(""),h.current="",p.current="",x.current=!0,n("recording"),k(R);const _=new P;d.current=_,_.interimResults=!0,_.continuous=!0,_.lang=navigator.language||"en-US",_.onresult=T=>{let F="",E="";for(let I=T.resultIndex;I<T.results.length;I++){const L=T.results[I],z=L?.[0]?.transcript??"";L?.isFinal?E=E+z:F=F+z}E&&(p.current=p.current+E,o(p.current)),h.current=F,l(F)},_.onend=()=>{if(x.current)try{_.start()}catch{}};try{_.start()}catch{n("idle")}},t[1]=y}else y=t[1];const j=y;let A;t[2]===Symbol.for("react.memo_cache_sentinel")?(A=()=>{x.current=!1,d.current?.stop(),v(),n("idle"),u(Array(Fe).fill(.05)),l("");const k=(p.current+(h.current?" "+h.current:"")).trim();return o(""),p.current="",h.current="",k},t[2]=A):A=t[2];const N=A;let C;t[3]===Symbol.for("react.memo_cache_sentinel")?(C=()=>{x.current=!1,d.current?.abort(),v(),n("idle"),o(""),l(""),u(Array(Fe).fill(.05)),p.current="",h.current=""},t[3]=C):C=t[3];const S=C;let D;return t[4]!==a||t[5]!==e||t[6]!==r||t[7]!==c?(D={status:e,transcript:r,interimTranscript:a,waveformData:c,isSupported:b,startRecording:j,stopRecording:N,cancelRecording:S},t[4]=a,t[5]=e,t[6]=r,t[7]=c,t[8]=D):D=t[8],D}function Mc(t){return t.stop()}function Fc(){}function Oc(){return Array(Fe).fill(.05)}function Lc(t){const e=O.c(4),{data:n}=t;let r;e[0]!==n?(r=n.map($c),e[0]=n,e[1]=r):r=e[1];let o;return e[2]!==r?(o=s.jsx("div",{className:"flex items-center justify-center gap-[2px] h-10 overflow-hidden","aria-hidden":"true",children:r}),e[2]=r,e[3]=o):o=e[3],o}function $c(t,e){return s.jsx("div",{className:"w-[2px] shrink-0 rounded-full bg-chart-2 transition-[height] duration-75 ease-out",style:{height:`${Math.max(4,Math.round(t*40))}px`}},e)}function zc({messageCount:t,showConnectionsBanner:e}){return t>0||e}function Bc(t,e){const n=O.c(5),{editor:r}=qt(),[o,a]=w.useState(!1),l=w.useRef(0);let c,u;return n[0]!==r||n[1]!==e||n[2]!==t?(c=()=>{const d=f=>{f.dataTransfer?.types.includes("Files")&&(f.preventDefault(),l.current=l.current+1,a(!0))},V=f=>{f.preventDefault(),l.current=Math.max(0,l.current-1),l.current===0&&a(!1)},i=Uc,m=f=>{if(f.preventDefault(),l.current=0,a(!1),!r||!t||!pt(t))return;const x=f.dataTransfer?.files;if(!x||x.length===0)return;const{from:p}=r.state.selection;for(const h of Array.from(x))Yt(r,t,h,p,e)};return window.addEventListener("dragenter",d),window.addEventListener("dragleave",V),window.addEventListener("dragover",i),window.addEventListener("drop",m),()=>{window.removeEventListener("dragenter",d),window.removeEventListener("dragleave",V),window.removeEventListener("dragover",i),window.removeEventListener("drop",m)}},u=[r,t,e],n[0]=r,n[1]=e,n[2]=t,n[3]=c,n[4]=u):(c=n[3],u=n[4]),w.useEffect(c,u),o}function Uc(t){t.dataTransfer?.types.includes("Files")&&t.preventDefault()}function Kc(t){const e=O.c(11),{selectedModel:n,onUnsupportedFile:r}=t,o=Bc(n,r);let a;e[0]!==n?(a=pt(n),e[0]=n,e[1]=a):a=e[1];const l=a,c=o?"opacity-100":"opacity-0 pointer-events-none",u=l?"border-primary/40 text-primary/70":"border-destructive/30 text-destructive/70";let d;e[2]!==c||e[3]!==u?(d=B("absolute inset-0 z-20 rounded-xl flex flex-col items-center justify-center gap-2 bg-muted border-2 border-dashed transition-opacity",c,u),e[2]=c,e[3]=u,e[4]=d):d=e[4];let V;e[5]!==n||e[6]!==l?(V=l?s.jsxs(s.Fragment,{children:[s.jsx(Xr,{size:24}),s.jsxs("span",{className:"text-sm font-medium",children:["Drop ",ts(n)," here"]})]}):s.jsxs(s.Fragment,{children:[s.jsx(Fn,{size:24}),s.jsx("span",{className:"text-sm font-medium",children:"This model can't read attachments — switch to one with vision or file support"})]}),e[5]=n,e[6]=l,e[7]=V):V=e[7];let i;return e[8]!==d||e[9]!==V?(i=s.jsx("div",{className:d,children:V}),e[8]=d,e[9]=V,e[10]=i):i=e[10],i}function qc(){const t=O.c(6),e=rt(),{org:n,locator:r}=ie(),{create:o}=Or();let a;return t[0]!==o||t[1]!==r||t[2]!==e||t[3]!==n.id||t[4]!==n.slug?(a=async l=>{const{tiptapDoc:c,virtualMcp:u}=l,d=crypto.randomUUID(),V=u?.id??dt(n.id).id;Lr(sessionStorage,r,d,{tiptapDoc:c});try{await o({id:d,virtual_mcp_id:V})}catch{}const i={virtualmcpid:V,autosend:$r};e({to:"/$org/$taskId",params:{org:n.slug,taskId:d},search:i})},t[0]=o,t[1]=r,t[2]=e,t[3]=n.id,t[4]=n.slug,t[5]=a):a=t[5],a}function Qc({onOpenContextPanel:t,showConnectionsBanner:e=!1}){const n=On(),r=ot(),o=n?.messages??[],a=n?.isStreaming??!1,l=n?.isRunInProgress??!1,c=n?.stop??(()=>{}),u=r?.taskId??"",d=u||la,V=qc(),{selectedModel:i,selectedVirtualMcp:m,isModelsLoading:f,tiptapDocRef:x,imageModel:p,deepResearchModel:h,chatMode:b,setChatMode:g}=fe(),{data:v}=Pn.useSession(),y=v?.user?.id,{org:j,locator:A}=ie(),N=dt(j.id).id,C=Kr(m?.id??N),S=Os(Mo),[D,k]=w.useState(!1),{unsupportedFile:P,onUnsupportedFile:R,clearUnsupportedFile:_}=ci(),T=Dc(),F=w.useRef(void 0),E=async()=>{F.current=$,await T.startRecording();const H=T.status==="recording"?"started":T.status==="unsupported"?"unsupported":T.status==="permission-denied"?"permission_denied":"unknown";G("chat_voice_started",{thread_id:u,outcome:H})},I=()=>{G("chat_voice_confirmed",{thread_id:u});const H=T.stopRecording();Y.current?.syncVoiceText(F.current,H),Y.current?.focus()},L=()=>{G("chat_voice_cancelled",{thread_id:u}),T.cancelRecording(),Y.current?.restoreContent(F.current)};w.useEffect(()=>{if(T.status!=="recording")return;const H=(T.transcript+(T.interimTranscript?" "+T.interimTranscript:"")).trim();Y.current?.syncVoiceText(F.current,H)},[T.transcript,T.interimTranscript,T.status]);const z=r?.activeTask??null,[$,q]=w.useState(()=>ln(sessionStorage,A,d)??void 0),M=H=>{q(H),x.current=H,ca(sessionStorage,A,d,H,{onQuotaExceeded:({docSizeBytes:ne})=>{G("chat_draft_quota_exceeded",{thread_id:u||null,doc_size_bytes:ne}),console.warn("[chat-draft] sessionStorage quota exceeded; draft not saved")}})},U=w.useRef(u);if(U.current!==u){U.current=u;const H=ln(sessionStorage,A,d)??void 0;q(H),x.current=H}const K=[...o].reverse().find(H=>H.role==="assistant")?.metadata?.modelLimits?.contextWindow??i?.limits?.contextWindow,Y=w.useRef(null),se=b==="plan";w.useEffect(()=>{const H=ne=>{Br(ne)&&ne.code==="KeyL"&&(ne.preventDefault(),ne.shiftKey&&g(b==="plan"?"default":"plan"),Y.current?.focus())};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[b,g]);const X=Cr(o),W=[...o].reverse().find(H=>H.role==="assistant"&&H.metadata?.usage)?.metadata?.usage?.contextTokens??0,J=!a&&!f&&!us($),ee=a||l,Z=zc({messageCount:o.length,showConnectionsBanner:e}),oe=H=>{H?.preventDefault(),a?(G("chat_message_stopped",{thread_id:u}),c()):l?(G("chat_message_stopped",{thread_id:u}),c()):J&&$&&(G("chat_message_sent",{thread_id:u||null,mode:b,model_id:i?.modelId??null,model_provider:i?.providerId??null,virtual_mcp_id:m?.id??null,submission:H?"button_or_enter":"programmatic"}),n?n.sendMessage($):V({tiptapDoc:$,virtualMcp:m}),ua(sessionStorage,A,d),M(void 0))};return y&&z?.created_by&&z.created_by!==y?s.jsxs("div",{className:"flex w-full items-center gap-2 px-3 py-2.5 rounded-xl border border-border bg-muted/40 text-muted-foreground",children:[s.jsx(Fn,{size:14,className:"shrink-0"}),s.jsx("span",{className:"text-sm",children:"Read only — you're viewing someone else's thread"})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex flex-col w-full justify-end",children:s.jsxs("div",{className:"relative rounded-2xl w-full flex flex-col",children:[e&&s.jsx("div",{className:"absolute inset-0 rounded-2xl pointer-events-none bg-muted/50"}),n&&r&&s.jsx(ht,{}),s.jsx(jc,{tiptapDoc:$,setTiptapDoc:M,disabled:a,enterToSubmit:!0,onSubmit:oe,children:s.jsxs("form",{onSubmit:oe,className:B("w-full relative rounded-2xl min-h-[110px] md:min-h-[130px] flex flex-col bg-card dark:bg-muted card-shadow overflow-hidden"),children:[s.jsx(Kc,{selectedModel:i,onUnsupportedFile:R}),s.jsx("div",{className:"group/input relative flex flex-col gap-2 flex-1",children:s.jsx(wc,{ref:Y,disabled:a||T.status==="recording",virtualMcpId:m?.id??N,showFileUploader:!0,selectedModel:i,onUnsupportedFile:R})}),s.jsx("div",{className:"@container/chat-bottom flex items-center justify-between p-2.5 gap-1",children:T.status==="recording"?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex-1"}),s.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[s.jsx(Lc,{data:T.waveformData.slice(0,28)}),s.jsx("button",{type:"button",onClick:L,className:"flex items-center justify-center size-8 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors","aria-label":"Cancel recording",children:s.jsx(Me,{size:16})}),s.jsx("button",{type:"button",onClick:I,className:"flex items-center justify-center size-8 rounded-lg bg-foreground text-background hover:opacity-80 transition-opacity","aria-label":"Use transcription",children:s.jsx(Ke,{size:16})})]})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[s.jsx(Ic,{disabled:a,onOpenConnections:()=>{G("connections_dialog_opened",{source:"tools_popover",mode:"add"}),k(!0)},virtualMcpId:m?.id??N,selectedModel:i,isStreaming:a,onUnsupportedFile:R}),se&&s.jsxs("button",{type:"button",onClick:()=>{S(),G("chat_mode_changed",{from_mode:"plan",to_mode:"default",source:"pill_dismiss"}),g("default")},title:"Plan mode","aria-label":"Plan mode",className:"flex items-center gap-1.5 h-8 rounded-lg px-2.5 text-sm font-medium text-violet-600 dark:text-violet-400 hover:bg-violet-500/10 group min-w-0 shrink animate-in fade-in duration-200",children:[s.jsx($n,{size:14,className:"shrink-0"}),s.jsx("span",{className:"min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0 @[320px]/chat-bottom:max-w-32 @[320px]/chat-bottom:opacity-100",children:"Plan mode"}),s.jsx(Me,{size:14,className:"shrink-0 hidden group-hover:block group-disabled:hidden"})]}),b==="gen-image"&&p&&s.jsxs("button",{type:"button",disabled:a,onClick:()=>{S(),G("chat_mode_changed",{from_mode:"gen-image",to_mode:"default",source:"pill_dismiss"}),g("default")},title:"Create image","aria-label":"Create image",className:"flex items-center gap-1.5 h-8 rounded-lg px-2.5 text-sm font-medium text-pink-600 dark:text-pink-400 hover:bg-pink-500/10 group min-w-0 shrink animate-in fade-in duration-200 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",children:[s.jsx(Bn,{size:14,className:"shrink-0"}),s.jsx("span",{className:"min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0 @[320px]/chat-bottom:max-w-[120px] @[320px]/chat-bottom:opacity-100",children:"Create image"}),s.jsx(Me,{size:14,className:"shrink-0 hidden group-hover:block group-disabled:hidden"})]}),b==="web-search"&&h&&s.jsxs("button",{type:"button",disabled:a,onClick:()=>{S(),G("chat_mode_changed",{from_mode:"web-search",to_mode:"default",source:"pill_dismiss"}),g("default")},title:"Web search","aria-label":"Web search",className:"flex items-center gap-1.5 h-8 rounded-lg px-2.5 text-sm font-medium text-blue-600 dark:text-blue-400 hover:bg-blue-500/10 group min-w-0 shrink animate-in fade-in duration-200 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",children:[s.jsx(zn,{size:14,className:"shrink-0"}),s.jsx("span",{className:"min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0 @[320px]/chat-bottom:max-w-[120px] @[320px]/chat-bottom:opacity-100",children:"Web search"}),s.jsx(Me,{size:14,className:"shrink-0 hidden group-hover:block group-disabled:hidden"})]}),K&&W>0&&s.jsx(Sr,{usage:X,totalTokens:W,contextWindow:K,onOpenContextPanel:t})]}),s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[Z&&s.jsx(Xl,{virtualMcp:C,currentBranch:r?.currentBranch??null}),s.jsx(si,{}),T.isSupported&&s.jsx(re,{type:"button",onClick:E,disabled:a||l,variant:"ghost",size:"icon",className:B("size-8 rounded-lg transition-colors",T.status==="permission-denied"?"text-destructive hover:text-destructive hover:bg-destructive/10":"text-muted-foreground hover:text-foreground"),title:T.status==="permission-denied"?"Microphone access denied — click to try again":"Voice input",children:s.jsx(Jr,{size:18})}),s.jsx(re,{type:ee?"button":"submit",onClick:H=>{ee&&(H.preventDefault(),H.stopPropagation(),c())},variant:J||ee?"default":"ghost",size:"icon",disabled:!J&&!ee,className:B("size-8 rounded-lg transition-all",!J&&!ee&&"bg-muted text-muted-foreground hover:bg-muted hover:text-muted-foreground cursor-not-allowed"),title:a?"Stop generating":l?"Cancel run":"Send message (Enter)",children:ee?s.jsx(Zr,{size:20}):s.jsx(qr,{size:20})})]})]})})]})},u),e&&s.jsx(Pc,{onClick:()=>{G("connections_banner_clicked",{source:"home_chat_input"}),G("connections_dialog_opened",{source:"home_banner",mode:"add"}),k(!0)}})]})}),s.jsx(yo,{mode:"browse",open:D,onOpenChange:k,defaultTab:"all"}),s.jsx(li,{info:P,onClose:_})]})}const Yc={usd:[{dollars:10,label:"Starter"},{dollars:20,label:"Popular"},{dollars:100,label:"Best value"}],brl:[{dollars:50,label:"Starter"},{dollars:100,label:"Popular"},{dollars:500,label:"Best value"}]};function Ls(t){return`deco-credits-empty-dismissed:${t}`}function ed(t){try{return localStorage.getItem(Ls(t))==="1"}catch{return!1}}function Hc(){const t=O.c(47),{org:e}=ie(),n=rt(),{decoKeyId:r}=vs(),o=zt(),[a,l]=w.useState(!0),[c,u]=w.useState(""),[d,V]=w.useState(!1),[i,m]=w.useState("usd"),f=i==="brl"?"R$":"$";let x;t[0]!==e.id?(x=()=>{G("credits_empty_state_dismissed",{organization_id:e.id}),l(!1);try{localStorage.setItem(Ls(e.id),"1")}catch{}},t[0]=e.id,t[1]=x):x=t[1];const p=x;let h,b;t[2]!==a||t[3]!==e.id?(h=()=>{a&&G("credits_empty_state_shown",{organization_id:e.id})},b=[a,e.id],t[2]=a,t[3]=e.id,t[4]=h,t[5]=b):(h=t[4],b=t[5]),w.useEffect(h,b);let g;t[6]!==i||t[7]!==o?(g=async $=>{const{url:q}=await o.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:$,currency:i});return q},t[6]=i,t[7]=o,t[8]=g):g=t[8];let v;t[9]!==p?(v=$=>{$&&window.open($,"_blank","noopener,noreferrer"),p()},t[9]=p,t[10]=v):v=t[10];let y;t[11]!==g||t[12]!==v?(y={mutationFn:g,onSuccess:v,onError:Wc},t[11]=g,t[12]=v,t[13]=y):y=t[13];const{mutate:j,isPending:A}=Dt(y),N=parseFloat(c),C=!isNaN(N)&&N>=1;if(!a)return null;let S;t[14]!==p?(S=$=>!$&&p(),t[14]=p,t[15]=S):S=t[15];let D;t[16]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx("div",{className:"absolute inset-x-0 top-0 h-24 bg-gradient-to-b from-amber-500/8 to-transparent pointer-events-none rounded-t-lg"}),t[16]=D):D=t[16];let k;t[17]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"flex items-center justify-center size-11 rounded-full bg-amber-100 dark:bg-amber-900/40 border border-amber-200/60 dark:border-amber-800/40 mx-auto",children:s.jsx(qn,{size:20,className:"text-amber-600 dark:text-amber-400"})}),t[17]=k):k=t[17];let P;t[18]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsxs("div",{className:"relative px-6 pt-7 pb-5",children:[D,s.jsxs(lt,{className:"relative gap-3",children:[k,s.jsxs("div",{className:"text-center",children:[s.jsx(it,{className:"text-lg font-semibold",children:"This workspace has no credits"}),s.jsx(Ft,{className:"mt-2 text-[13px] leading-relaxed max-w-[320px] mx-auto",children:"Your free credits were used in another workspace. Add credits to use AI here."})]})]})]}),t[18]=P):P=t[18];let R;t[19]!==i||t[20]!==f||t[21]!==c||t[22]!==N||t[23]!==r||t[24]!==C||t[25]!==A||t[26]!==d||t[27]!==j?(R=r&&s.jsxs("div",{className:"px-6 pb-5",children:[s.jsx("div",{className:"mb-4",children:s.jsxs(Gn,{type:"single",variant:"outline",size:"sm",value:i,onValueChange:$=>{$&&m($)},children:[s.jsx(Ze,{value:"usd",className:"h-8 px-3 text-xs",children:"USD"}),s.jsx(Ze,{value:"brl",className:"h-8 px-3 text-xs",children:"BRL"})]})}),s.jsx("div",{className:"grid grid-cols-3 gap-2.5",children:Yc[i].map($=>{const{dollars:q,label:M}=$;return s.jsxs("button",{type:"button",disabled:A,onClick:()=>{G("credits_topup_clicked",{amount_cents:q*100,currency:i,tier_label:M,source:"empty_state"}),j(q*100)},className:B("relative flex flex-col items-center gap-1 py-6 rounded-xl border transition-all duration-150 cursor-pointer","disabled:opacity-50 disabled:cursor-wait","border-border hover:border-foreground/20 hover:bg-muted/30"),children:[s.jsxs("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:[f,q]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:M})]},q)})}),d?s.jsxs("div",{className:"flex gap-2 mt-3",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:f}),s.jsx(Wn,{type:"number",min:"1",step:"1",placeholder:"50",value:c,onChange:$=>u($.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(re,{className:"h-10",disabled:!C||A,onClick:()=>{G("credits_topup_clicked",{amount_cents:Math.round(N*100),currency:i,tier_label:"custom",source:"empty_state"}),j(Math.round(N*100))},children:A?"Opening...":"Add"})]}):s.jsx("button",{type:"button",className:"w-full mt-2.5 text-xs text-muted-foreground hover:text-foreground transition-colors py-1",onClick:()=>V(!0),children:"Enter custom amount"})]}),t[19]=i,t[20]=f,t[21]=c,t[22]=N,t[23]=r,t[24]=C,t[25]=A,t[26]=d,t[27]=j,t[28]=R):R=t[28];let _;t[29]!==p||t[30]!==n||t[31]!==e.slug?(_=()=>{n({to:"/$org/settings/ai-providers",params:{org:e.slug}}),p()},t[29]=p,t[30]=n,t[31]=e.slug,t[32]=_):_=t[32];let T;t[33]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(Hn,{size:12,className:"transition-transform duration-150 group-hover:translate-x-0.5"}),t[33]=T):T=t[33];let F;t[34]!==_?(F=s.jsxs("button",{type:"button",className:"group flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:_,children:["Use your own provider",T]}),t[34]=_,t[35]=F):F=t[35];let E;t[36]!==p?(E=s.jsx(re,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:p,children:"Skip for now"}),t[36]=p,t[37]=E):E=t[37];let I;t[38]!==F||t[39]!==E?(I=s.jsxs("div",{className:"px-6 py-3.5 border-t border-border bg-muted/30 flex items-center justify-between",children:[F,E]}),t[38]=F,t[39]=E,t[40]=I):I=t[40];let L;t[41]!==R||t[42]!==I?(L=s.jsxs(ct,{className:"sm:max-w-[500px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:Gc,children:[P,R,I]}),t[41]=R,t[42]=I,t[43]=L):L=t[43];let z;return t[44]!==L||t[45]!==S?(z=s.jsx(ut,{open:!0,onOpenChange:S,children:L}),t[44]=L,t[45]=S,t[46]=z):z=t[46],z}function Gc(t){return t.preventDefault()}function Wc(t){le.error(`Top-up failed: ${t.message}`)}function Jc(t){const e=O.c(6),{balanceDollars:n}=t;let r;e[0]!==n?(r=n.toFixed(2),e[0]=n,e[1]=r):r=e[1];const o=r;let a,l;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=B("inline-flex items-center gap-1.5 px-3 py-1 rounded-full","bg-emerald-50 dark:bg-emerald-950/30","border border-emerald-200/60 dark:border-emerald-800/40","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),l=s.jsx(qn,{size:13,className:"text-emerald-600 dark:text-emerald-400"}),e[2]=a,e[3]=l):(a=e[2],l=e[3]);let c;return e[4]!==o?(c=s.jsxs("div",{className:a,children:[l,s.jsxs("span",{className:"text-xs font-medium text-emerald-700 dark:text-emerald-300 tabular-nums",children:["$",o," in credits to get started"]})]}),e[4]=o,e[5]=c):c=e[5],c}function Zc(){const t=O.c(8),{org:e}=ie(),n=rt();let r;t[0]!==n||t[1]!==e.slug?(r=()=>n({to:"/$org/settings/ai-providers",params:{org:e.slug}}),t[0]=n,t[1]=e.slug,t[2]=r):r=t[2];let o,a,l;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=B("inline-flex items-center gap-1.5 px-3 py-1 rounded-full cursor-pointer","bg-amber-50 dark:bg-amber-950/30","border border-amber-200/60 dark:border-amber-800/40","hover:bg-amber-100/60 dark:hover:bg-amber-900/30","transition-colors duration-150","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),a=s.jsx(Qn,{size:13,className:"text-amber-600 dark:text-amber-400"}),l=s.jsx("span",{className:"text-xs font-medium text-amber-700 dark:text-amber-300",children:"No credits remaining · Add more"}),t[3]=o,t[4]=a,t[5]=l):(o=t[3],a=t[4],l=t[5]);let c;return t[6]!==r?(c=s.jsxs("button",{type:"button",onClick:r,className:o,children:[a,l]}),t[6]=r,t[7]=c):c=t[7],c}function Xc(t){const e=O.c(11),{className:n}=t;let r;e[0]!==n?(r=B("flex h-full w-full flex-col bg-background",n),e[0]=n,e[1]=r):r=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"size-6 rounded-lg bg-muted animate-pulse"}),e[2]=o):o=e[2];let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("div",{className:"flex items-center gap-3",children:[o,s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("div",{className:"h-3.5 w-28 rounded bg-muted animate-pulse"}),s.jsx("div",{className:"h-3 w-40 rounded bg-muted/60 animate-pulse"})]})]}),e[3]=a):a=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex items-center h-12 flex-none border-b border-border/80 px-4",children:s.jsxs("div",{className:"flex items-center justify-between gap-3 w-full",children:[a,s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsx("div",{className:"h-6 w-6 rounded-full bg-muted animate-pulse"}),s.jsx("div",{className:"h-6 w-6 rounded-lg bg-muted animate-pulse"})]})]})}),e[4]=l):l=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"flex-1 overflow-hidden px-4 py-4",children:s.jsxs("div",{className:"mx-auto flex w-full max-w-2xl flex-col gap-4",children:[s.jsx(Ye,{align:"right",width:"w-3/4"}),s.jsx(Ye,{align:"left",width:"w-full",lines:3}),s.jsx(Ye,{align:"right",width:"w-2/3"}),s.jsx(Ye,{align:"left",width:"w-5/6",lines:2})]})}),e[5]=c):c=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("div",{className:"relative flex flex-1 flex-col gap-2 p-2.5",children:s.jsx("div",{className:"relative flex-1",children:s.jsxs("div",{className:"space-y-2 p-2",children:[s.jsx("div",{className:"h-3 w-full rounded bg-muted/40 animate-pulse"}),s.jsx("div",{className:"h-3 w-4/5 rounded bg-muted/40 animate-pulse"})]})})}),e[6]=u):u=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("div",{className:"flex items-center gap-1",children:s.jsx("div",{className:"size-8 rounded-full bg-muted/60 animate-pulse"})}),e[7]=d):d=e[7];let V;e[8]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx("div",{className:"px-4 py-4",children:s.jsx("div",{className:"mx-auto w-full max-w-2xl",children:s.jsxs("div",{className:"relative flex min-h-[130px] flex-col rounded-xl bg-background card-shadow",children:[u,s.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-2.5",children:[d,s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"h-8 w-32 rounded-lg bg-muted/60 animate-pulse"}),s.jsx("div",{className:"size-8 rounded-full bg-muted animate-pulse"})]})]})]})})}),e[8]=V):V=e[8];let i;return e[9]!==r?(i=s.jsxs("div",{className:r,children:[l,c,V]}),e[9]=r,e[10]=i):i=e[10],i}function Ye(t){const e=O.c(22),{align:n,width:r,lines:o}=t,a=r===void 0?"w-full":r,l=o===void 0?1:o,c=n==="right"?"flex-row-reverse":"flex-row";let u;e[0]!==c?(u=B("flex w-full gap-4 px-4 py-2",c),e[0]=c,e[1]=u):u=e[1];const d=n==="right"?"ml-auto max-w-3/4 items-end":"w-full items-start";let V;e[2]!==d?(V=B("flex min-w-0 flex-col gap-2",d),e[2]=d,e[3]=V):V=e[3];let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"h-3 w-16 rounded bg-muted/40 animate-pulse"}),e[4]=i):i=e[4];const m=n==="right"?"bg-muted":"bg-transparent border border-border/40";let f;e[5]!==m||e[6]!==a?(f=B("min-w-0 rounded-2xl p-4",m,a),e[5]=m,e[6]=a,e[7]=f):f=e[7];let x;e[8]!==l?(x=Array.from({length:l}),e[8]=l,e[9]=x):x=e[9];let p;e[10]!==l||e[11]!==x?(p=s.jsx("div",{className:"space-y-2",children:x.map((v,y)=>s.jsx("div",{className:B("h-3 rounded bg-muted-foreground/20 animate-pulse",y===l-1?"w-3/4":"w-full"),style:{animationDelay:`${y*.1}s`}},y))}),e[10]=l,e[11]=x,e[12]=p):p=e[12];let h;e[13]!==p||e[14]!==f?(h=s.jsx("div",{className:f,children:p}),e[13]=p,e[14]=f,e[15]=h):h=e[15];let b;e[16]!==h||e[17]!==V?(b=s.jsxs("div",{className:V,children:[i,h]}),e[16]=h,e[17]=V,e[18]=b):b=e[18];let g;return e[19]!==b||e[20]!==u?(g=s.jsx("div",{className:u,children:b}),e[19]=b,e[20]=u,e[21]=g):g=e[21],g}function eu(t){const e=O.c(7),{scrollRef:n,sentinelRef:r,hasMoreOlder:o,isFetchingOlder:a,fetchOlderMessages:l}=t;let c,u;e[0]!==l||e[1]!==o||e[2]!==a||e[3]!==n||e[4]!==r?(c=()=>{const d=r.current,V=n.current;if(!d||!V||!o)return;const i=new IntersectionObserver(async m=>{if(!m[0]?.isIntersecting||a||!o)return;const x=V.scrollHeight,p=V.scrollTop;await l(),requestAnimationFrame(()=>{const h=V.scrollHeight;V.scrollTop=p+(h-x)})},{root:V,rootMargin:"200px 0px 0px 0px"});return i.observe(d),()=>i.disconnect()},u=[n,r,o,a,l],e[0]=l,e[1]=o,e[2]=a,e[3]=n,e[4]=r,e[5]=c,e[6]=u):(c=e[5],u=e[6]),w.useEffect(c,u)}function tu(t){const e=O.c(5),{className:n,children:r}=t;let o;e[0]!==n?(o=B("flex flex-col h-full w-full bg-background transform-[translateZ(0)]",n),e[0]=n,e[1]=o):o=e[1];let a;return e[2]!==r||e[3]!==o?(a=s.jsx("div",{className:o,children:r}),e[2]=r,e[3]=o,e[4]=a):a=e[4],a}function nu(t){const e=O.c(5),{children:n,className:r}=t;let o;e[0]!==r?(o=B("flex-1 min-h-0 overflow-y-auto isolate",r),e[0]=r,e[1]=o):o=e[1];let a;return e[2]!==n||e[3]!==o?(a=s.jsx("div",{className:o,children:n}),e[2]=n,e[3]=o,e[4]=a):a=e[4],a}function su(t){const e=O.c(2),{children:n}=t;let r;return e[0]!==n?(r=s.jsx("div",{className:"min-h-full shrink-0 w-full flex items-center justify-center max-w-2xl mx-auto py-10",children:n}),e[0]=n,e[1]=r):r=e[1],r}function ru(){const t=O.c(27),{messages:e,status:n,hasMoreOlder:r,isFetchingOlder:o,fetchOlderMessages:a}=Ue(),l=Nr(e);let c;t[0]!==l?(c=l.at(-1),t[0]=l,t[1]=c):c=t[1];const u=c,V=aa()*Ho+16,i=w.useRef(null),m=w.useRef(null);let f;t[2]!==a||t[3]!==r||t[4]!==o?(f={scrollRef:i,sentinelRef:m,hasMoreOlder:r,isFetchingOlder:o,fetchOlderMessages:a},t[2]=a,t[3]=r,t[4]=o,t[5]=f):f=t[5],eu(f);let x;t[6]!==V?(x={paddingBottom:V},t[6]=V,t[7]=x):x=t[7];let p;t[8]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("div",{ref:m,"aria-hidden":!0,className:"h-px"}),t[8]=p):p=t[8];let h;t[9]!==o?(h=o&&s.jsx("div",{className:"flex items-center justify-center py-3 text-xs text-muted-foreground",children:"Loading older messages…"}),t[9]=o,t[10]=h):h=t[10];let b;if(t[11]!==l||t[12]!==n){let j;t[14]!==l.length||t[15]!==n?(j=(A,N)=>s.jsx(Jt,{pair:A,isLastPair:!1,status:N===l.length-1?n:void 0},`pair-${A.user?.id??A.assistant?.id}`),t[14]=l.length,t[15]=n,t[16]=j):j=t[16],b=l.slice(0,-1).map(j),t[11]=l,t[12]=n,t[13]=b}else b=t[13];let g;t[17]!==h||t[18]!==b?(g=s.jsxs("div",{className:"flex flex-col min-w-0 max-w-2xl mx-auto w-full",children:[p,h,b]}),t[17]=h,t[18]=b,t[19]=g):g=t[19];let v;t[20]!==u||t[21]!==n?(v=u&&s.jsx("div",{className:"min-h-full min-w-0 max-w-2xl mx-auto w-full",children:s.jsx(Jt,{pair:u,isLastPair:!0,status:n},`pair-${u.user?.id??u.assistant?.id}`)}),t[20]=u,t[21]=n,t[22]=v):v=t[22];let y;return t[23]!==x||t[24]!==g||t[25]!==v?(y=s.jsxs("div",{ref:i,"data-chat-scroller":!0,className:"w-full min-w-0 max-w-full overflow-y-auto h-full overflow-x-hidden",style:x,children:[g,v]}),t[23]=x,t[24]=g,t[25]=v,t[26]=y):y=t[26],y}function ou(t){const e=O.c(5),{children:n,className:r}=t;let o;e[0]!==r?(o=B("flex-none w-full mx-auto p-2 pt-0","max-w-2xl min-w-0",r),e[0]=r,e[1]=o):o=e[1];let a;return e[2]!==n||e[3]!==o?(a=s.jsx("div",{className:o,children:n}),e[2]=n,e[3]=o,e[4]=a):a=e[4],a}const td=Object.assign(tu,{Main:nu,Messages:ru,EmptyState:su,Footer:ou,Input:Qc,Provider:xr,ActiveTaskProvider:hr,Skeleton:Xc,IceBreakers:Yo,NoAiProviderEmptyState:mo,CreditsEmptyState:Hc,CreditsEyebrow:Jc,NoCreditsEyebrow:Zc,CreditsExhaustedBanner:ys});function nd(t){if(typeof t!="object"||t===null)return!1;const n=t.githubRepo?.url;return typeof n=="string"&&n.length>0}function sd(t){return!!ns(t??null)?.connectionId}function rd(t){return t.online?t.capabilities.includes("claude-code")||t.capabilities.includes("codex"):!1}export{td as C,jc as T,Xl as a,nd as b,sd as c,Vl as d,wc as e,Xu as f,Ll as g,rd as h,ui as i,dl as s,vs as u,ed as w};
@@ -1 +0,0 @@
1
- import{e as W,r as B,j as e,c as X,l as Y}from"./index-DvjfZyh_.js";import{i as Z}from"./ChevronRight-BZDLAZs0.js";import{S as tt}from"./scroll-area-Bcd6M0ah.js";import{aa as et,ab as rt,f as ot}from"./index-BwfKFYWi.js";import{c as it}from"./save-referenced-block-Dm8Vu_wn.js";import{S as mt}from"./schema-form-BmsIuFe9.js";import{S as pt}from"./save-status-BT2K7vMi.js";import"./select-DBJdJQxs.js";import"./tooltip-6LKHApWj.js";import"./Check-DZFgb4Aq.js";import"./ChevronDown-B7QgMo_j.js";import"./ChevronUp-D4NcsGJa.js";import"./agent-capabilities-BTQpzJzY.js";import"./chat-context-DLsfZ4X8.js";import"./tab-id-t-YFcZzw.js";import"./use-mcp-client-kBcr-yIi.js";import"./watch-sse-pool-PpWWHENZ.js";import"./decopilot-sse-pool-J9IBtPGQ.js";import"./studio-tools-B1Ixjcw5.js";import"./use-virtual-mcp-BH7eFRNT.js";import"./use-collections-MWh87Qf9.js";import"./use-ai-providers-Dph4wlM9.js";import"./use-organization-settings-C83zobOQ.js";import"./pair-QNI_4vE-.js";import"./agent-icon-eJeBIKuQ.js";import"./AlertCircle-CZCJdLyi.js";import"./Tool01-41oNA8tk.js";import"./SwitchHorizontal01-Cu45oyoo.js";import"./RefreshCcw01-CKC-7KpZ.js";import"./XCircle-uxFEtClP.js";import"./ArrowUpRight-CHxGqtjn.js";import"./ZapSquare-rlEq1cG8.js";import"./Users03-BLIawTyD.js";import"./CheckCircle-CG-wMven.js";import"./ChevronLeft-TMVSDJlu.js";import"./DotsVertical-BTWgDSCZ.js";import"./Container-CIoK_JLI.js";import"./Eye-BaBZSaML.js";import"./ZoomOut-BVY1Bb5M.js";import"./Globe01-Bu-3l6NI.js";import"./FilterLines-CuEfbFlC.js";import"./Star01-B5uhWV3B.js";import"./Palette-BXG1B7a_.js";import"./HardDrive-FmjuSfEd.js";import"./Stars02-KpOwsvid.js";import"./Key01-Bnc16AFY.js";import"./LayoutLeft-D2epCZ9e.js";import"./LinkExternal01-il-vFJO5.js";import"./Monitor01-s9F0MGZm.js";import"./Sun-BAloSVhR.js";import"./Play-CArhP18b.js";import"./Plus-BMFN7EYn.js";import"./SearchMd-Cp07lkq4.js";import"./Settings02-D4_HBk9b.js";import"./Shield01-C5CB9ixt.js";import"./Stars01-Bbj7Y0Z1.js";import"./Trash01-BxDpcA3C.js";import"./Upload01-D32r7qgX.js";import"./User01-jR83WsDH.js";import"./Users01-BBxMW_TC.js";import"./XClose-DutYcJf9.js";import"./X-D5a6VwmP.js";import"./Zap-Dn5qc0WK.js";import"./use-clock-tick-CyQ108_a.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BDBsQ8lw.js";import"./file-type-icon-CrGaQHZH.js";import"./dialog-GbkSCCDE.js";import"./content-blocks-o63cs2vh.js";import"./types-CoBpfu3U.js";import"./shell-layout-C6cd7iM5.js";import"./avatar-BWTRU-cH.js";import"./required-auth-layout-Dlm8pGwG.js";import"./useRouterState-mLoytFp1.js";import"./use-org-sso-CizTzcrl.js";import"./integration-icon-FcIrg4H7.js";import"./use-navigate-to-agent-Dqwftn0z.js";import"./use-connection-BwjVlVqI.js";import"./use-mcp-prompts-Cu_s_Tgp.js";import"./form-Ct1q5ZTT.js";import"./label-BjwEjfOc.js";import"./input-irp5a6Ig.js";import"./spinner-BtGInCsG.js";import"./drawer-CDEJbPQ_.js";import"./collection-search-FDG1Rlpn.js";import"./tabs-w6d9uq3S.js";import"./toggle-group-C4U40EOv.js";import"./connect-desktop-dialog-BfZ9n3Q0.js";import"./agent-icons-BQS7GC08.js";import"./checkbox-NCgkpQdG.js";import"./skeleton-l4y2bxXO.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-C7OUTn7i.js";import"./card-D4pgDcd2.js";import"./popover-DKADBzsx.js";import"./command-Eg_TSNDN.js";import"./index-C4S4NH7_.js";import"./useInfiniteQuery-DCizzYPk.js";import"./use-infinite-scroll-C_ORywxv.js";import"./sortable.esm-DzvMqAvs.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CBcUqWOS.js";import"./use-registry-connections-D2z51tYu.js";import"./extract-connection-data-CWzL0whb.js";import"./generate-id-Ck2Vi4il.js";import"./collections-2LTOAuNh.js";import"./collection-tabs-pv_RnATY.js";import"./badge-DAzOgiKc.js";import"./textarea-BGXAM3FF.js";import"./connection-form-helpers-DQ1R8Rbb.js";import"./useSuspenseInfiniteQuery-BlGj7aqQ.js";import"./index-D7JjC_Ha.js";import"./dropdown-menu-Bp4U1b45.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-C_Trke1w.js";import"./sidebar-TMNnGTum.js";import"./sheet-BwH8pS-i.js";import"./toolbar-C2En0zPi.js";import"./use-create-virtual-mcp--Yql-2p8.js";import"./github-repo-picker-Dh-z3MS6.js";import"./use-mcp-tools-BVCosz4Y.js";import"./alert-dialog-D0THW25_.js";import"./index-DrZPYOCw.js";import"./use-org-auth-client-CKzivxvb.js";import"./hover-card-DUG7qFNS.js";import"./task-status-CfFWQAcK.js";import"./use-status-sounds-C1N5nKtC.js";import"./empty-state-v8piTmBi.js";import"./resizable-CflvFHn-.js";import"./use-capability-CRrm1ogD.js";import"./header-tab-button-TaP3yUvX.js";import"./index-EWthEHT2.js";import"./user-Bu_LWzDf.js";import"./tools-list-CCVW8omn.js";import"./switch-BFEJpvlr.js";import"./use-debounced-autosave-B6SxjuaG.js";import"./index-C99xN5mu.js";import"./search-input-DMce5FEj.js";import"./use-secrets-DuBDIHg_.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-Dzk41U9r.js";import"./view-mode-toggle-BFVBLid1.js";import"./select-model-C6zKg0NG.js";import"./use-automations-DV8VwbjR.js";import"./monaco-editor-CIyIIOLP.js";import"./automation-runs-Bbg-0UVN.js";import"./table-M2WJKO5P.js";import"./use-members-CQwZpJh1.js";import"./automation-list-row-D582neu3.js";import"./calendar-CTsGuWmk.js";import"./image-field-BvfbFQCq.js";import"./use-file-configs-WBUPEX1z.js";function Zr(E){const t=W.c(51),{orgSlug:R,virtualMcpId:P,branch:$,blockKey:r,block:m,meta:p,decofile:C,title:F,excludeFields:K,schemaPending:M}=E,V=M===void 0?!1:M,a=typeof m?.__resolveType=="string"?m.__resolveType:"";let v;t[0]!==K||t[1]!==p||t[2]!==a?(v=et(a,p,K),t[0]=K,t[1]=p,t[2]=a,t[3]=v):v=t[3];const s=v;let b;t[4]!==s?(b=!!s&&Object.keys(s.properties??{}).length>0,t[4]=s,t[5]=b):b=t[5];const T=b;let g;t[6]!==m||t[7]!==r||t[8]!==p||t[9]!==F?(g=F??(m?rt(r,m,p):r),t[6]=m,t[7]=r,t[8]=p,t[9]=F,t[10]=g):g=t[10];const n=g;let j;t[11]!==$||t[12]!==R||t[13]!==P?(j={orgSlug:R,virtualMcpId:P,branch:$},t[11]=$,t[12]=R,t[13]=P,t[14]=j):j=t[14];const{save:c,isPending:A}=ot(j);let y;t[15]!==c?(y=it((l,i)=>c(l,i)),t[15]=c,t[16]=y):y=t[16];const L=y,[G,H]=B.useState(r),[J,q]=B.useState(null),[z,Q]=B.useState(0);let S;t[17]===Symbol.for("react.memo_cache_sentinel")?(S=[],t[17]=S):S=t[17];const[o,O]=B.useState(S);G!==r&&(H(r),q(null),Q(st),O([]));let N;t[18]!==m?(N=m??{},t[18]=m,t[19]=N):N=t[19];const D=J??N;let k;t[20]!==r||t[21]!==a||t[22]!==c?(k=l=>{const i=l;q(i),c(r,{...i,__resolveType:a})},t[20]=r,t[21]=a,t[22]=c,t[23]=k):k=t[23];const I=k;let _;t[24]!==o||t[25]!==n?(_=o.length>0?[n,...o]:[],t[24]=o,t[25]=n,t[26]=_):_=t[26];const h=_;let d;t[27]!==o||t[28]!==h||t[29]!==n?(d=h.length>0?e.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:h.map((l,i)=>{const U=i===h.length-1;return e.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[i>0&&e.jsx(Z,{className:"size-3 shrink-0 text-muted-foreground/60"}),e.jsx("button",{type:"button",onClick:()=>O(i===0?[]:o.slice(0,i)),title:l,className:X("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",U?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:l})]},`${l}-${i}`)})}):e.jsx("span",{className:"text-sm font-medium",children:n}),t[27]=o,t[28]=h,t[29]=n,t[30]=d):d=t[30];let f;t[31]!==A?(f=e.jsx(pt,{isPending:A,isError:!1}),t[31]=A,t[32]=f):f=t[32];let u;t[33]!==d||t[34]!==f?(u=e.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[d,f]}),t[33]=d,t[34]=f,t[35]=u):u=t[35];let x;t[36]!==r||t[37]!==o||t[38]!==C||t[39]!==D||t[40]!==z||t[41]!==I||t[42]!==T||t[43]!==p||t[44]!==L||t[45]!==s||t[46]!==V?(x=e.jsx(tt,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:e.jsx("div",{className:"px-6 py-6",children:e.jsx("div",{className:"mx-auto max-w-xl",children:T?e.jsx(mt,{schema:s,value:D,onChange:I,basePath:"",breadcrumbPath:o,onBreadcrumbChange:O,decofile:C,meta:p,onSaveReferencedBlock:L},`${r}:${z}`):V?e.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[e.jsx(Y,{size:16,className:"animate-spin"}),"Loading app schema…"]}):e.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"No editable schema found for this app."})})})}),t[36]=r,t[37]=o,t[38]=C,t[39]=D,t[40]=z,t[41]=I,t[42]=T,t[43]=p,t[44]=L,t[45]=s,t[46]=V,t[47]=x):x=t[47];let w;return t[48]!==u||t[49]!==x?(w=e.jsxs("div",{className:"flex h-full flex-col",children:[u,x]}),t[48]=u,t[49]=x,t[50]=w):w=t[50],w}function st(E){return E+1}export{Zr as AppEditor};
@@ -1 +0,0 @@
1
- import{d as o}from"./watch-sse-pool-PpWWHENZ.js";const c=o;export{c as d};
@@ -1 +0,0 @@
1
- import{e as it,r as E,j as e,l as rt}from"./index-DvjfZyh_.js";import{S as mt,d as pt,a as st,b as at}from"./sheet-BwH8pS-i.js";import{S as nt}from"./scroll-area-Bcd6M0ah.js";import{r as lt,c as ct,u as dt,a as St,i as ft,f as ut,d as vt,P as ht,S as gt}from"./page-seo-form-Bj1ei9Gv.js";import{n as xt}from"./index-BwfKFYWi.js";import"./X-D5a6VwmP.js";import"./select-DBJdJQxs.js";import"./tooltip-6LKHApWj.js";import"./Check-DZFgb4Aq.js";import"./ChevronDown-B7QgMo_j.js";import"./ChevronUp-D4NcsGJa.js";import"./label-BjwEjfOc.js";import"./switch-BFEJpvlr.js";import"./schema-form-BmsIuFe9.js";import"./agent-icon-eJeBIKuQ.js";import"./AlertCircle-CZCJdLyi.js";import"./Tool01-41oNA8tk.js";import"./SwitchHorizontal01-Cu45oyoo.js";import"./RefreshCcw01-CKC-7KpZ.js";import"./XCircle-uxFEtClP.js";import"./ArrowUpRight-CHxGqtjn.js";import"./ZapSquare-rlEq1cG8.js";import"./Users03-BLIawTyD.js";import"./CheckCircle-CG-wMven.js";import"./ChevronLeft-TMVSDJlu.js";import"./ChevronRight-BZDLAZs0.js";import"./DotsVertical-BTWgDSCZ.js";import"./Container-CIoK_JLI.js";import"./Eye-BaBZSaML.js";import"./ZoomOut-BVY1Bb5M.js";import"./Globe01-Bu-3l6NI.js";import"./FilterLines-CuEfbFlC.js";import"./Star01-B5uhWV3B.js";import"./Palette-BXG1B7a_.js";import"./HardDrive-FmjuSfEd.js";import"./Stars02-KpOwsvid.js";import"./Key01-Bnc16AFY.js";import"./LayoutLeft-D2epCZ9e.js";import"./LinkExternal01-il-vFJO5.js";import"./Monitor01-s9F0MGZm.js";import"./Sun-BAloSVhR.js";import"./Play-CArhP18b.js";import"./Plus-BMFN7EYn.js";import"./SearchMd-Cp07lkq4.js";import"./Settings02-D4_HBk9b.js";import"./Shield01-C5CB9ixt.js";import"./Stars01-Bbj7Y0Z1.js";import"./Trash01-BxDpcA3C.js";import"./Upload01-D32r7qgX.js";import"./User01-jR83WsDH.js";import"./Users01-BBxMW_TC.js";import"./XClose-DutYcJf9.js";import"./Zap-Dn5qc0WK.js";import"./calendar-CTsGuWmk.js";import"./input-irp5a6Ig.js";import"./popover-DKADBzsx.js";import"./textarea-BGXAM3FF.js";import"./dropdown-menu-Bp4U1b45.js";import"./image-field-BvfbFQCq.js";import"./dialog-GbkSCCDE.js";import"./skeleton-l4y2bxXO.js";import"./tabs-w6d9uq3S.js";import"./use-file-configs-WBUPEX1z.js";import"./studio-tools-B1Ixjcw5.js";import"./useInfiniteQuery-DCizzYPk.js";import"./use-infinite-scroll-C_ORywxv.js";import"./agent-capabilities-BTQpzJzY.js";import"./chat-context-DLsfZ4X8.js";import"./tab-id-t-YFcZzw.js";import"./use-mcp-client-kBcr-yIi.js";import"./watch-sse-pool-PpWWHENZ.js";import"./decopilot-sse-pool-J9IBtPGQ.js";import"./use-virtual-mcp-BH7eFRNT.js";import"./use-collections-MWh87Qf9.js";import"./use-ai-providers-Dph4wlM9.js";import"./use-organization-settings-C83zobOQ.js";import"./pair-QNI_4vE-.js";import"./use-clock-tick-CyQ108_a.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BDBsQ8lw.js";import"./file-type-icon-CrGaQHZH.js";import"./content-blocks-o63cs2vh.js";import"./types-CoBpfu3U.js";import"./shell-layout-C6cd7iM5.js";import"./avatar-BWTRU-cH.js";import"./required-auth-layout-Dlm8pGwG.js";import"./useRouterState-mLoytFp1.js";import"./use-org-sso-CizTzcrl.js";import"./integration-icon-FcIrg4H7.js";import"./use-navigate-to-agent-Dqwftn0z.js";import"./use-connection-BwjVlVqI.js";import"./use-mcp-prompts-Cu_s_Tgp.js";import"./form-Ct1q5ZTT.js";import"./spinner-BtGInCsG.js";import"./drawer-CDEJbPQ_.js";import"./collection-search-FDG1Rlpn.js";import"./toggle-group-C4U40EOv.js";import"./connect-desktop-dialog-BfZ9n3Q0.js";import"./agent-icons-BQS7GC08.js";import"./checkbox-NCgkpQdG.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-C7OUTn7i.js";import"./card-D4pgDcd2.js";import"./command-Eg_TSNDN.js";import"./index-C4S4NH7_.js";import"./sortable.esm-DzvMqAvs.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CBcUqWOS.js";import"./use-registry-connections-D2z51tYu.js";import"./extract-connection-data-CWzL0whb.js";import"./generate-id-Ck2Vi4il.js";import"./collections-2LTOAuNh.js";import"./collection-tabs-pv_RnATY.js";import"./badge-DAzOgiKc.js";import"./connection-form-helpers-DQ1R8Rbb.js";import"./useSuspenseInfiniteQuery-BlGj7aqQ.js";import"./index-D7JjC_Ha.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-C_Trke1w.js";import"./sidebar-TMNnGTum.js";import"./toolbar-C2En0zPi.js";import"./use-create-virtual-mcp--Yql-2p8.js";import"./github-repo-picker-Dh-z3MS6.js";import"./use-mcp-tools-BVCosz4Y.js";import"./alert-dialog-D0THW25_.js";import"./index-DrZPYOCw.js";import"./use-org-auth-client-CKzivxvb.js";import"./hover-card-DUG7qFNS.js";import"./task-status-CfFWQAcK.js";import"./use-status-sounds-C1N5nKtC.js";import"./empty-state-v8piTmBi.js";import"./resizable-CflvFHn-.js";import"./use-capability-CRrm1ogD.js";import"./header-tab-button-TaP3yUvX.js";import"./index-EWthEHT2.js";import"./user-Bu_LWzDf.js";import"./tools-list-CCVW8omn.js";import"./use-debounced-autosave-B6SxjuaG.js";import"./index-C99xN5mu.js";import"./search-input-DMce5FEj.js";import"./use-secrets-DuBDIHg_.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-Dzk41U9r.js";import"./view-mode-toggle-BFVBLid1.js";import"./select-model-C6zKg0NG.js";import"./use-automations-DV8VwbjR.js";import"./monaco-editor-CIyIIOLP.js";import"./automation-runs-Bbg-0UVN.js";import"./table-M2WJKO5P.js";import"./use-members-CQwZpJh1.js";import"./automation-list-row-D582neu3.js";function di(u){const t=it.c(46),{open:N,onOpenChange:P,orgSlug:Q,virtualMcpId:U,branch:W,decofile:G,meta:s,target:m,onSaved:X}=u,o=lt(G,m,s),k=m.kind==="site"?"site":m.pageKey,[Y,Z]=E.useState(k),[tt,i]=E.useState(null),[J,g]=E.useState(void 0),[x,y]=E.useState(0);Y!==k&&(Z(k),i(null),g(void 0),y(wt));const{persistSeo:a,persistRawSeo:I,flush:K,isPending:D}=ct({orgSlug:Q,virtualMcpId:U,branch:W,target:m,resolved:o,onSaved:X}),w=m.kind==="page",ot=w?o?.rawSeoData:void 0,v=J!==void 0?J:ot,et=w?dt(v)??void 0:void 0,h=tt??et??o?.seoData??{},p=o?St(h,o):null,n=p&&(!w||ft(v))?xt(p,s):null,_=m.kind==="page"?ut(G,s)?.seoData??void 0:void 0;let j;t[0]!==s?(j=vt(s),t[0]=s,t[1]=j):j=t[1];const M=j;let R;t[2]!==a||t[3]!==o||t[4]!==i?(R=r=>{if(!o)return;const L=r;i(L),a(L)},t[2]=a,t[3]=o,t[4]=i,t[5]=R):R=t[5];const V=R;let F;t[6]!==K||t[7]!==P?(F=r=>{r||K(),P(r)},t[6]=K,t[7]=P,t[8]=F):F=t[8];const z=F,A=m.kind==="site"?"Site SEO":"Page SEO",T=w&&o,B=m.kind==="site"&&o&&n,H=m.kind==="site"?"No site-level SEO block found.":o?"SEO schema not found for this page.":"Could not load page SEO.";let C;t[9]!==i?(C=()=>i(null),t[9]=i,t[10]=C):C=t[10];const $=C;let O;t[11]!==y?(O=()=>y(yt),t[11]=y,t[12]=O):O=t[12];const q=O;let l;t[13]!==A?(l=e.jsx(mt,{className:"text-sm font-semibold",children:A}),t[13]=A,t[14]=l):l=t[14];let c;t[15]!==D?(c=D&&e.jsx(rt,{size:14,className:"animate-spin text-muted-foreground"}),t[15]=D,t[16]=c):c=t[16];let d;t[17]!==l||t[18]!==c?(d=e.jsxs(pt,{className:"px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[l,c]}),t[17]=l,t[18]=c,t[19]=d):d=t[19];let S;t[20]!==p||t[21]!==q||t[22]!==$||t[23]!==M||t[24]!==v||t[25]!==h||t[26]!==H||t[27]!==x||t[28]!==V||t[29]!==I||t[30]!==a||t[31]!==o||t[32]!==n||t[33]!==i||t[34]!==g||t[35]!==T||t[36]!==B||t[37]!==_?(S=!o||!T&&!B?e.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:H}):e.jsx(nt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:e.jsx("div",{className:"px-6 py-4",children:e.jsx("div",{className:"mx-auto max-w-sm",children:T?e.jsx(ht,{rawSeo:v,innerSeo:h,defaultResolveType:M,seoSchema:n,activeResolveType:p,seoTypeOptions:o.seoTypeOptions,formResetKey:x,siteDefaultSeo:_,onPersistRaw:r=>{g(r),I(r)},onInnerChange:r=>{i(r),a(r)},onClearForm:$,onBumpFormKey:q}):n&&p&&e.jsx(gt,{schema:n,resolveType:p,value:h,formResetKey:x,onChange:V})})})}),t[20]=p,t[21]=q,t[22]=$,t[23]=M,t[24]=v,t[25]=h,t[26]=H,t[27]=x,t[28]=V,t[29]=I,t[30]=a,t[31]=o,t[32]=n,t[33]=i,t[34]=g,t[35]=T,t[36]=B,t[37]=_,t[38]=S):S=t[38];let f;t[39]!==d||t[40]!==S?(f=e.jsxs(st,{side:"right",className:"w-[400px] sm:max-w-[440px] p-0 gap-0",children:[d,S]}),t[39]=d,t[40]=S,t[41]=f):f=t[41];let b;return t[42]!==z||t[43]!==N||t[44]!==f?(b=e.jsx(at,{open:N,onOpenChange:z,children:f}),t[42]=z,t[43]=N,t[44]=f,t[45]=b):b=t[45],b}function yt(u){return u+1}function wt(u){return u+1}export{di as SeoSheet};
@@ -1 +0,0 @@
1
- import{e as H,q as $,j}from"./index-DvjfZyh_.js";import{h as q,g as O,s as b}from"./pair-QNI_4vE-.js";import{u as v}from"./use-mcp-client-kBcr-yIi.js";import{a as L,c as B}from"./use-mcp-tools-BVCosz4Y.js";import{c as Y}from"./content-blocks-o63cs2vh.js";import{g as k,M as G,a as E}from"./types-CoBpfu3U.js";import{a as V,c as z}from"./chat-context-DLsfZ4X8.js";import{u as F}from"./shell-layout-C6cd7iM5.js";import"./agent-icon-eJeBIKuQ.js";import"./AlertCircle-CZCJdLyi.js";import"./Tool01-41oNA8tk.js";import"./SwitchHorizontal01-Cu45oyoo.js";import"./RefreshCcw01-CKC-7KpZ.js";import"./XCircle-uxFEtClP.js";import"./ArrowUpRight-CHxGqtjn.js";import"./ZapSquare-rlEq1cG8.js";import"./Users03-BLIawTyD.js";import"./CheckCircle-CG-wMven.js";import"./Check-DZFgb4Aq.js";import"./ChevronDown-B7QgMo_j.js";import"./ChevronLeft-TMVSDJlu.js";import"./ChevronRight-BZDLAZs0.js";import"./ChevronUp-D4NcsGJa.js";import"./DotsVertical-BTWgDSCZ.js";import"./Container-CIoK_JLI.js";import"./Eye-BaBZSaML.js";import"./ZoomOut-BVY1Bb5M.js";import"./Globe01-Bu-3l6NI.js";import"./FilterLines-CuEfbFlC.js";import"./Star01-B5uhWV3B.js";import"./Palette-BXG1B7a_.js";import"./HardDrive-FmjuSfEd.js";import"./Stars02-KpOwsvid.js";import"./Key01-Bnc16AFY.js";import"./LayoutLeft-D2epCZ9e.js";import"./LinkExternal01-il-vFJO5.js";import"./Monitor01-s9F0MGZm.js";import"./Sun-BAloSVhR.js";import"./Play-CArhP18b.js";import"./Plus-BMFN7EYn.js";import"./SearchMd-Cp07lkq4.js";import"./Settings02-D4_HBk9b.js";import"./Shield01-C5CB9ixt.js";import"./Stars01-Bbj7Y0Z1.js";import"./Trash01-BxDpcA3C.js";import"./Upload01-D32r7qgX.js";import"./User01-jR83WsDH.js";import"./Users01-BBxMW_TC.js";import"./XClose-DutYcJf9.js";import"./X-D5a6VwmP.js";import"./Zap-Dn5qc0WK.js";import"./use-clock-tick-CyQ108_a.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./scroll-area-Bcd6M0ah.js";import"./select-DBJdJQxs.js";import"./tooltip-6LKHApWj.js";import"./use-copy-BDBsQ8lw.js";import"./file-type-icon-CrGaQHZH.js";import"./dialog-GbkSCCDE.js";import"./tab-id-t-YFcZzw.js";import"./watch-sse-pool-PpWWHENZ.js";import"./decopilot-sse-pool-J9IBtPGQ.js";import"./studio-tools-B1Ixjcw5.js";import"./integration-icon-FcIrg4H7.js";import"./use-virtual-mcp-BH7eFRNT.js";import"./use-collections-MWh87Qf9.js";import"./use-navigate-to-agent-Dqwftn0z.js";import"./use-connection-BwjVlVqI.js";import"./use-mcp-prompts-Cu_s_Tgp.js";import"./form-Ct1q5ZTT.js";import"./label-BjwEjfOc.js";import"./input-irp5a6Ig.js";import"./spinner-BtGInCsG.js";import"./use-ai-providers-Dph4wlM9.js";import"./use-organization-settings-C83zobOQ.js";import"./avatar-BWTRU-cH.js";import"./required-auth-layout-Dlm8pGwG.js";import"./useRouterState-mLoytFp1.js";import"./use-org-sso-CizTzcrl.js";const J={};function K(S){const t=H.c(37),{client:r,resourceURI:g,tool:e,connectionId:s,orgId:a,args:c}=S,{sendMessage:u}=V(),{setAppContext:d,clearAppContext:o}=z(),{setChatOpen:f,openTab:m}=F(),p=`${s}:${e.name}`;let l;t[0]!==m?(l=h=>h==="inline"?(m("0"),"inline"):"fullscreen",t[0]=m,t[1]=l):l=t[1];const i=l,n=c??J;let T;t[2]!==r||t[3]!==e.name||t[4]!==n?(T={client:r,toolName:e.name,toolArguments:n},t[2]=r,t[3]=e.name,t[4]=n,t[5]=T):T=t[5];const{data:x}=B(T);let R;if(t[6]!==e._meta||t[7]!==e.name){const h=O(e._meta);R=b(e.name,h),t[6]=e._meta,t[7]=e.name,t[8]=R}else R=t[8];const U=R;let I;t[9]!==e.inputSchema?(I=e.inputSchema??{type:"object"},t[9]=e.inputSchema,t[10]=I):I=t[10];let N;t[11]!==U||t[12]!==I||t[13]!==e?(N={...e,name:U,inputSchema:I},t[11]=U,t[12]=I,t[13]=e,t[14]=N):N=t[14];const y=N;let _;t[15]!==u||t[16]!==f?(_=h=>{const w=Y(h.content);w.content.length>0&&(f(!0),u({tiptapDoc:w}))},t[15]=u,t[16]=f,t[17]=_):_=t[17];const D=_;let C;t[18]!==y?(C={tool:y},t[18]=y,t[19]=C):C=t[19];let M;t[20]!==d||t[21]!==p?(M=h=>d(p,h),t[20]=d,t[21]=p,t[22]=M):M=t[22];let P;t[23]!==o||t[24]!==p?(P=()=>o(p),t[23]=o,t[24]=p,t[25]=P):P=t[25];let A;return t[26]!==r||t[27]!==D||t[28]!==i||t[29]!==a||t[30]!==g||t[31]!==C||t[32]!==M||t[33]!==P||t[34]!==n||t[35]!==x?(A=j.jsx(G,{resourceURI:g,orgId:a,toolInfo:C,toolInput:n,toolResult:x,displayMode:"fullscreen",minHeight:E.fullscreen.minHeight,maxHeight:E.fullscreen.maxHeight,client:r,onMessage:D,onUpdateModelContext:M,onTeardown:P,onRequestDisplayMode:i,className:"h-full"}),t[26]=r,t[27]=D,t[28]=i,t[29]=a,t[30]=g,t[31]=C,t[32]=M,t[33]=P,t[34]=n,t[35]=x,t[36]=A):A=t[36],A}function Pe(S){const t=H.c(20),{connectionId:r,toolName:g,args:e}=S,{org:s}=$();let a;t[0]!==r||t[1]!==s.id||t[2]!==s.slug?(a={connectionId:r,orgId:s.id,orgSlug:s.slug},t[0]=r,t[1]=s.id,t[2]=s.slug,t[3]=a):a=t[3];const c=v(a);let u;t[4]!==c?(u={client:c},t[4]=c,t[5]=u):u=t[5];const{data:d}=L(u);let o,f,m;t[6]!==g||t[7]!==d.tools?(o=q(decodeURIComponent(g)),m=d.tools.find(i=>i.name===o)??d.tools.find(i=>{const n=O(i._meta);if(!n)return!1;if(b(i.name,n)===o)return!0;const x=b(o,n);return x!==o&&i.name===x}),f=m?._meta?k(m._meta):void 0,t[6]=g,t[7]=d.tools,t[8]=o,t[9]=f,t[10]=m):(o=t[8],f=t[9],m=t[10]);const p=f;if(!m||!p){let i;return t[11]!==o?(i=j.jsx("div",{className:"flex items-center justify-center h-full w-full",children:j.jsxs("p",{className:"text-sm text-muted-foreground",children:['Tool "',o,'" not found or has no UI']})}),t[11]=o,t[12]=i):i=t[12],i}let l;return t[13]!==e||t[14]!==c||t[15]!==r||t[16]!==s.id||t[17]!==p||t[18]!==m?(l=j.jsx(K,{client:c,resourceURI:p,tool:m,connectionId:r,orgId:s.id,args:e}),t[13]=e,t[14]=c,t[15]=r,t[16]=s.id,t[17]=p,t[18]=m,t[19]=l):l=t[19],l}export{Pe as AppViewContent};
@@ -1 +0,0 @@
1
- import{e as C,j as r}from"./index-DvjfZyh_.js";import{I as F}from"./input-irp5a6Ig.js";import{L as T}from"./label-BjwEjfOc.js";import{T as L}from"./textarea-BGXAM3FF.js";import{I as A}from"./image-field-BvfbFQCq.js";import{ae as R,af as D,ah as J}from"./index-BwfKFYWi.js";import{u as K,s as S}from"./primitives-BD_skIF2.js";import{S as M}from"./save-status-BT2K7vMi.js";import"./Tool01-41oNA8tk.js";import"./Trash01-BxDpcA3C.js";import"./Upload01-D32r7qgX.js";import"./AlertCircle-CZCJdLyi.js";import"./Check-DZFgb4Aq.js";import"./Eye-BaBZSaML.js";import"./DotsVertical-BTWgDSCZ.js";import"./agent-icon-eJeBIKuQ.js";import"./SwitchHorizontal01-Cu45oyoo.js";import"./RefreshCcw01-CKC-7KpZ.js";import"./XCircle-uxFEtClP.js";import"./ArrowUpRight-CHxGqtjn.js";import"./ZapSquare-rlEq1cG8.js";import"./Users03-BLIawTyD.js";import"./CheckCircle-CG-wMven.js";import"./ChevronDown-B7QgMo_j.js";import"./ChevronLeft-TMVSDJlu.js";import"./ChevronRight-BZDLAZs0.js";import"./ChevronUp-D4NcsGJa.js";import"./Container-CIoK_JLI.js";import"./ZoomOut-BVY1Bb5M.js";import"./Globe01-Bu-3l6NI.js";import"./FilterLines-CuEfbFlC.js";import"./Star01-B5uhWV3B.js";import"./Palette-BXG1B7a_.js";import"./HardDrive-FmjuSfEd.js";import"./Stars02-KpOwsvid.js";import"./Key01-Bnc16AFY.js";import"./LayoutLeft-D2epCZ9e.js";import"./LinkExternal01-il-vFJO5.js";import"./Monitor01-s9F0MGZm.js";import"./Sun-BAloSVhR.js";import"./Play-CArhP18b.js";import"./Plus-BMFN7EYn.js";import"./SearchMd-Cp07lkq4.js";import"./Settings02-D4_HBk9b.js";import"./Shield01-C5CB9ixt.js";import"./Stars01-Bbj7Y0Z1.js";import"./User01-jR83WsDH.js";import"./Users01-BBxMW_TC.js";import"./XClose-DutYcJf9.js";import"./X-D5a6VwmP.js";import"./Zap-Dn5qc0WK.js";import"./dialog-GbkSCCDE.js";import"./dropdown-menu-Bp4U1b45.js";import"./skeleton-l4y2bxXO.js";import"./tabs-w6d9uq3S.js";import"./use-file-configs-WBUPEX1z.js";import"./studio-tools-B1Ixjcw5.js";import"./useInfiniteQuery-DCizzYPk.js";import"./use-infinite-scroll-C_ORywxv.js";import"./agent-capabilities-BTQpzJzY.js";import"./chat-context-DLsfZ4X8.js";import"./tab-id-t-YFcZzw.js";import"./use-mcp-client-kBcr-yIi.js";import"./watch-sse-pool-PpWWHENZ.js";import"./decopilot-sse-pool-J9IBtPGQ.js";import"./use-virtual-mcp-BH7eFRNT.js";import"./use-collections-MWh87Qf9.js";import"./use-ai-providers-Dph4wlM9.js";import"./use-organization-settings-C83zobOQ.js";import"./pair-QNI_4vE-.js";import"./use-clock-tick-CyQ108_a.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./scroll-area-Bcd6M0ah.js";import"./select-DBJdJQxs.js";import"./tooltip-6LKHApWj.js";import"./use-copy-BDBsQ8lw.js";import"./file-type-icon-CrGaQHZH.js";import"./content-blocks-o63cs2vh.js";import"./types-CoBpfu3U.js";import"./shell-layout-C6cd7iM5.js";import"./avatar-BWTRU-cH.js";import"./required-auth-layout-Dlm8pGwG.js";import"./useRouterState-mLoytFp1.js";import"./use-org-sso-CizTzcrl.js";import"./integration-icon-FcIrg4H7.js";import"./use-navigate-to-agent-Dqwftn0z.js";import"./use-connection-BwjVlVqI.js";import"./use-mcp-prompts-Cu_s_Tgp.js";import"./form-Ct1q5ZTT.js";import"./spinner-BtGInCsG.js";import"./drawer-CDEJbPQ_.js";import"./collection-search-FDG1Rlpn.js";import"./toggle-group-C4U40EOv.js";import"./connect-desktop-dialog-BfZ9n3Q0.js";import"./agent-icons-BQS7GC08.js";import"./checkbox-NCgkpQdG.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-C7OUTn7i.js";import"./card-D4pgDcd2.js";import"./popover-DKADBzsx.js";import"./command-Eg_TSNDN.js";import"./index-C4S4NH7_.js";import"./sortable.esm-DzvMqAvs.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CBcUqWOS.js";import"./use-registry-connections-D2z51tYu.js";import"./extract-connection-data-CWzL0whb.js";import"./generate-id-Ck2Vi4il.js";import"./collections-2LTOAuNh.js";import"./collection-tabs-pv_RnATY.js";import"./badge-DAzOgiKc.js";import"./connection-form-helpers-DQ1R8Rbb.js";import"./useSuspenseInfiniteQuery-BlGj7aqQ.js";import"./index-D7JjC_Ha.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-C_Trke1w.js";import"./sidebar-TMNnGTum.js";import"./sheet-BwH8pS-i.js";import"./toolbar-C2En0zPi.js";import"./use-create-virtual-mcp--Yql-2p8.js";import"./github-repo-picker-Dh-z3MS6.js";import"./use-mcp-tools-BVCosz4Y.js";import"./alert-dialog-D0THW25_.js";import"./index-DrZPYOCw.js";import"./use-org-auth-client-CKzivxvb.js";import"./hover-card-DUG7qFNS.js";import"./task-status-CfFWQAcK.js";import"./use-status-sounds-C1N5nKtC.js";import"./empty-state-v8piTmBi.js";import"./resizable-CflvFHn-.js";import"./use-capability-CRrm1ogD.js";import"./header-tab-button-TaP3yUvX.js";import"./index-EWthEHT2.js";import"./user-Bu_LWzDf.js";import"./tools-list-CCVW8omn.js";import"./switch-BFEJpvlr.js";import"./use-debounced-autosave-B6SxjuaG.js";import"./index-C99xN5mu.js";import"./search-input-DMce5FEj.js";import"./use-secrets-DuBDIHg_.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-Dzk41U9r.js";import"./view-mode-toggle-BFVBLid1.js";import"./select-model-C6zKg0NG.js";import"./use-automations-DV8VwbjR.js";import"./monaco-editor-CIyIIOLP.js";import"./automation-runs-Bbg-0UVN.js";import"./table-M2WJKO5P.js";import"./use-members-CQwZpJh1.js";import"./automation-list-row-D582neu3.js";const $={authors:[{key:"name",label:"Name",widget:"text"},{key:"email",label:"Email",widget:"text",placeholder:"author@example.com"},{key:"jobTitle",label:"Job title",widget:"text"},{key:"company",label:"Company",widget:"text"},{key:"avatar",label:"Avatar",widget:"image"}],categories:[{key:"name",label:"Name",widget:"text"},{key:"slug",label:"Slug",widget:"text",placeholder:"my-category"}]},q={authors:"Author",categories:"Category"};function Fr(P){const t=C.c(34),{orgSlug:v,virtualMcpId:j,branch:f,kind:p,blockKey:y,block:w}=P;let u;t[0]!==f||t[1]!==v||t[2]!==j?(u={orgSlug:v,virtualMcpId:j,branch:f},t[0]=f,t[1]=v,t[2]=j,t[3]=u):u=t[3];const m=R(u);let d;t[4]!==w||t[5]!==p?(d=D(w,p),t[4]=w,t[5]=p,t[6]=d):d=t[6];const B=d;let h;t[7]!==y||t[8]!==p||t[9]!==m?(h=e=>{m.mutate({blockKey:y,data:J(y,p,e)})},t[7]=y,t[8]=p,t[9]=m,t[10]=h):h=t[10];const[i,E]=K(B,h);let k;t[11]!==i||t[12]!==E?(k=(e,o)=>E({...i,[e]:o}),t[11]=i,t[12]=E,t[13]=k):k=t[13];const a=k,N=q[p];let s;t[14]!==N?(s=r.jsx("span",{className:"text-sm font-medium",children:N}),t[14]=N,t[15]=s):s=t[15];let l;t[16]!==m.isError||t[17]!==m.isPending?(l=r.jsx(M,{isPending:m.isPending,isError:m.isError}),t[16]=m.isError,t[17]=m.isPending,t[18]=l):l=t[18];let n;t[19]!==s||t[20]!==l?(n=r.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[s,l]}),t[19]=s,t[20]=l,t[21]=n):n=t[21];const I=$[p];let c;if(t[22]!==i||t[23]!==a||t[24]!==I){let e;t[26]!==i||t[27]!==a?(e=o=>r.jsx("div",{className:"space-y-2",children:o.widget==="image"?r.jsx(A,{schema:{type:"string",format:"image-uri",title:o.label},value:i[o.key],onChange:x=>a(o.key,x),path:o.key,label:o.label}):r.jsxs(r.Fragment,{children:[r.jsx(T,{htmlFor:o.key,children:o.label}),o.widget==="textarea"?r.jsx(L,{id:o.key,value:S(i[o.key]),onChange:x=>a(o.key,x.target.value),rows:3}):r.jsx(F,{id:o.key,value:S(i[o.key]),placeholder:o.placeholder,onChange:x=>a(o.key,x.target.value),className:"h-10"})]})},o.key),t[26]=i,t[27]=a,t[28]=e):e=t[28],c=I.map(e),t[22]=i,t[23]=a,t[24]=I,t[25]=c}else c=t[25];let g;t[29]!==c?(g=r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto px-6 py-6",children:r.jsx("div",{className:"mx-auto max-w-xl space-y-6",children:c})}),t[29]=c,t[30]=g):g=t[30];let b;return t[31]!==g||t[32]!==n?(b=r.jsxs("div",{className:"flex h-full flex-col",children:[n,g]}),t[31]=g,t[32]=n,t[33]=b):b=t[33],b}export{Fr as RecordEditor};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-CyYeZQFC.js","assets/index-DvjfZyh_.js","assets/index-DfYyH4IW.css","assets/XCircle-uxFEtClP.js","assets/CheckCircle-CG-wMven.js","assets/Container-CIoK_JLI.js","assets/Settings02-D4_HBk9b.js","assets/use-mcp-client-kBcr-yIi.js","assets/useInfiniteQuery-DCizzYPk.js","assets/use-infinite-scroll-C_ORywxv.js","assets/studio-tools-B1Ixjcw5.js","assets/badge-DAzOgiKc.js","assets/input-irp5a6Ig.js","assets/dropdown-menu-Bp4U1b45.js","assets/Check-DZFgb4Aq.js","assets/ChevronRight-BZDLAZs0.js","assets/DotsVertical-BTWgDSCZ.js","assets/table-M2WJKO5P.js","assets/toggle-group-C4U40EOv.js","assets/use-view-mode-CdGJFg5T.js","assets/tooltip-6LKHApWj.js","assets/FilterLines-CuEfbFlC.js","assets/Globe01-Bu-3l6NI.js","assets/SearchMd-Cp07lkq4.js","assets/dialog-GbkSCCDE.js","assets/X-D5a6VwmP.js","assets/AlertCircle-CZCJdLyi.js","assets/Upload01-D32r7qgX.js","assets/alert-dialog-D0THW25_.js","assets/card-D4pgDcd2.js","assets/Trash01-BxDpcA3C.js","assets/label-BjwEjfOc.js","assets/select-DBJdJQxs.js","assets/ChevronDown-B7QgMo_j.js","assets/ChevronUp-D4NcsGJa.js","assets/switch-BFEJpvlr.js","assets/textarea-BGXAM3FF.js","assets/RefreshCcw01-CKC-7KpZ.js","assets/checkbox-NCgkpQdG.js","assets/Eye-BaBZSaML.js","assets/LinkExternal01-il-vFJO5.js","assets/use-copy-BDBsQ8lw.js","assets/Key01-Bnc16AFY.js","assets/Plus-BMFN7EYn.js","assets/Play-CArhP18b.js"])))=>i.map(i=>d[i]);
2
- import{e as i,j as e,r as s,l as a,_ as o}from"./index-DvjfZyh_.js";import{R as l}from"./require-capability-D2k7Kzha.js";import"./use-capability-CRrm1ogD.js";import"./access-gate-BG1y9Hug.js";import"./capability-load-error-B6TBCUEJ.js";const m=s.lazy(()=>o(()=>import("./registry-layout-CyYeZQFC.js"),__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])));function f(){const r=i.c(1);let t;return r[0]===Symbol.for("react.memo_cache_sentinel")?(t=e.jsx(l,{capability:"registry:manage",area:"the registry",children:e.jsx(s.Suspense,{fallback:e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx(a,{size:20,className:"animate-spin text-muted-foreground"})}),children:e.jsx(m,{})})}),r[0]=t):t=r[0],t}export{f as default};