themelia-react-ui 2.0.5 → 2.0.6

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 (489) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/MIGRATION.md +119 -0
  3. package/README.md +13 -6
  4. package/dist/{accordion-B9MHG0cT.js → accordion-0tQUZ20r.js} +7 -7
  5. package/dist/accordion-0tQUZ20r.js.map +1 -0
  6. package/dist/{action-menu-Dr8K-ghE.js → action-menu-C0gjzLyE.js} +7 -7
  7. package/dist/{action-menu-Dr8K-ghE.js.map → action-menu-C0gjzLyE.js.map} +1 -1
  8. package/dist/{ai-artifact-C58tQcBy.js → ai-artifact-CGGpQryR.js} +172 -157
  9. package/dist/ai-artifact-CGGpQryR.js.map +1 -0
  10. package/dist/{app-shell-B_IuNWOo.js → app-shell-EHuuRDGy.js} +5 -5
  11. package/dist/{app-shell-B_IuNWOo.js.map → app-shell-EHuuRDGy.js.map} +1 -1
  12. package/dist/{attachment-Dg_69lPS.js → attachment-BCpA4e7i.js} +8 -8
  13. package/dist/{attachment-Dg_69lPS.js.map → attachment-BCpA4e7i.js.map} +1 -1
  14. package/dist/{auth-DTkkshS8.js → auth-B0girIk_.js} +15 -15
  15. package/dist/auth-B0girIk_.js.map +1 -0
  16. package/dist/{avatar-CeZaFmNH.js → avatar-B9Jnp-T-.js} +3 -3
  17. package/dist/{avatar-CeZaFmNH.js.map → avatar-B9Jnp-T-.js.map} +1 -1
  18. package/dist/{badge-xIiV_E7f.js → badge-wWauMgAt.js} +3 -3
  19. package/dist/{badge-xIiV_E7f.js.map → badge-wWauMgAt.js.map} +1 -1
  20. package/dist/base/accordion.js +1 -1
  21. package/dist/base/action-menu.js +1 -1
  22. package/dist/base/attachment.js +1 -1
  23. package/dist/base/avatar.js +1 -1
  24. package/dist/base/badge.js +1 -1
  25. package/dist/base/batch-action-bar.js +1 -1
  26. package/dist/base/buttons.js +1 -1
  27. package/dist/base/cards.js +2 -2
  28. package/dist/base/carousel.js +3 -3
  29. package/dist/base/cascader.js +1 -1
  30. package/dist/base/chart.js +1 -1
  31. package/dist/base/choice-inputs.js +2 -2
  32. package/dist/base/code-block.js +1 -1
  33. package/dist/base/combobox.js +1 -1
  34. package/dist/base/command.js +1 -1
  35. package/dist/base/copyable.js +1 -1
  36. package/dist/base/date-pickers.js +2 -2
  37. package/dist/base/display.js +6 -6
  38. package/dist/base/feedback.js +4 -4
  39. package/dist/base/forms-numeric.js +1 -1
  40. package/dist/base/forms.js +2 -2
  41. package/dist/base/inline-edit.js +8 -8
  42. package/dist/base/item.js +1 -1
  43. package/dist/base/media-gallery.js +1 -1
  44. package/dist/base/metadata-list.js +1 -1
  45. package/dist/base/navigation.js +6 -6
  46. package/dist/base/popover-menu.js +1 -1
  47. package/dist/base/popover.js +1 -1
  48. package/dist/base/qr-code.js +1 -1
  49. package/dist/base/repeaters.js +195 -188
  50. package/dist/base/repeaters.js.map +1 -1
  51. package/dist/base/sheet.js +1 -1
  52. package/dist/base/sidebar.js +2 -2
  53. package/dist/base/signature-pad.js +7 -7
  54. package/dist/base/skeleton.js +1 -1
  55. package/dist/base/spinner.js +5 -5
  56. package/dist/base/spinner.js.map +1 -1
  57. package/dist/base/structure.js +1 -1
  58. package/dist/base/table.js +1 -1
  59. package/dist/base/text-inputs.js +2 -2
  60. package/dist/base/toaster.js +1 -1
  61. package/dist/base/tree.js +1 -1
  62. package/dist/base/upload-queue.js +1 -1
  63. package/dist/base/upload.js +3 -3
  64. package/dist/base/value-inputs.js +1 -1
  65. package/dist/{batch-action-bar-Cb8cuvyy.js → batch-action-bar-BoqWIIpV.js} +5 -5
  66. package/dist/{batch-action-bar-Cb8cuvyy.js.map → batch-action-bar-BoqWIIpV.js.map} +1 -1
  67. package/dist/blocks/admin.js +17 -17
  68. package/dist/blocks/ai.js +227 -221
  69. package/dist/blocks/ai.js.map +1 -1
  70. package/dist/blocks/analytics/usage-card.js +1 -1
  71. package/dist/blocks/analytics.js +424 -449
  72. package/dist/blocks/analytics.js.map +1 -1
  73. package/dist/blocks/collaboration.js +1 -1
  74. package/dist/blocks/commerce/receipt.js +1 -1
  75. package/dist/blocks/commerce.js +225 -220
  76. package/dist/blocks/commerce.js.map +1 -1
  77. package/dist/blocks/data-display.js +2 -2
  78. package/dist/blocks/onboarding.js +5 -5
  79. package/dist/blocks/planning.js +11 -11
  80. package/dist/blocks/timelines.js +1 -1
  81. package/dist/{breadcrumbs-J-K2kl4c.js → breadcrumbs-Bp9Ke7kd.js} +4 -4
  82. package/dist/breadcrumbs-Bp9Ke7kd.js.map +1 -0
  83. package/dist/{button-S2Cubiiz.js → button-ChBovTx0.js} +2 -2
  84. package/dist/{button-S2Cubiiz.js.map → button-ChBovTx0.js.map} +1 -1
  85. package/dist/{buttons-BedGfygC.js → buttons-DeW0bQeK.js} +6 -6
  86. package/dist/{buttons-BedGfygC.js.map → buttons-DeW0bQeK.js.map} +1 -1
  87. package/dist/{cards-rNX1M4Xn.js → cards-CNXnmvV5.js} +8 -8
  88. package/dist/{cards-rNX1M4Xn.js.map → cards-CNXnmvV5.js.map} +1 -1
  89. package/dist/{cascader-B1MiqkBq.js → cascader-CrAl9zD5.js} +15 -15
  90. package/dist/{cascader-B1MiqkBq.js.map → cascader-CrAl9zD5.js.map} +1 -1
  91. package/dist/{chart-Darg_0Kv.js → chart-I7ROnsl8.js} +5 -5
  92. package/dist/{chart-Darg_0Kv.js.map → chart-I7ROnsl8.js.map} +1 -1
  93. package/dist/{checkbox-fflqmODR.js → checkbox-MoyHIAPs.js} +3 -3
  94. package/dist/{checkbox-fflqmODR.js.map → checkbox-MoyHIAPs.js.map} +1 -1
  95. package/dist/{choice-inputs-zUgBZfE4.js → choice-inputs-DHGtx0QV.js} +122 -110
  96. package/dist/choice-inputs-DHGtx0QV.js.map +1 -0
  97. package/dist/{code-block-BzmM9Eig.js → code-block-BSJyq9e-.js} +7 -7
  98. package/dist/{code-block-BzmM9Eig.js.map → code-block-BSJyq9e-.js.map} +1 -1
  99. package/dist/{collapsible-BkAI_XD4.js → collapsible-BzJ91LUG.js} +3 -3
  100. package/dist/{collapsible-BkAI_XD4.js.map → collapsible-BzJ91LUG.js.map} +1 -1
  101. package/dist/{collection-content-gDh1v6O4.js → collection-content-CSnwtOTH.js} +3 -3
  102. package/dist/{collection-content-gDh1v6O4.js.map → collection-content-CSnwtOTH.js.map} +1 -1
  103. package/dist/{combobox-BEx0vJgF.js → combobox-Bcvu5J8O.js} +11 -10
  104. package/dist/{combobox-BEx0vJgF.js.map → combobox-Bcvu5J8O.js.map} +1 -1
  105. package/dist/combobox-C2JiSQPc.js +915 -0
  106. package/dist/combobox-C2JiSQPc.js.map +1 -0
  107. package/dist/{command-CrlPIL6m.js → command-9e52NPgK.js} +6 -6
  108. package/dist/{command-CrlPIL6m.js.map → command-9e52NPgK.js.map} +1 -1
  109. package/dist/{comments-Dmpp0YIc.js → comments-BsgErEqd.js} +33 -28
  110. package/dist/comments-BsgErEqd.js.map +1 -0
  111. package/dist/components/base/choice-inputs/choice-types.d.ts +4 -0
  112. package/dist/components/base/choice-inputs/pill-radio-group.d.ts +7 -6
  113. package/dist/components/base/combobox/combobox-field.d.ts +2 -2
  114. package/dist/components/base/date-pickers/date-picker-internals.d.ts +3 -1
  115. package/dist/components/base/date-pickers/datepicker.types.d.ts +10 -4
  116. package/dist/components/base/date-pickers/time-picker.d.ts +17 -3
  117. package/dist/components/base/feedback/state-display.d.ts +5 -1
  118. package/dist/components/base/feedback/state-display.strings.d.ts +9 -0
  119. package/dist/components/base/forms/form-field.d.ts +7 -2
  120. package/dist/components/base/forms-numeric/coordinates-input.d.ts +4 -1
  121. package/dist/components/base/forms-numeric/decimal-input.d.ts +2 -2
  122. package/dist/components/base/forms-numeric/dimensions-input.d.ts +4 -1
  123. package/dist/components/base/forms-numeric/numeric-composite-field.d.ts +12 -0
  124. package/dist/components/base/forms-numeric/weight-input.d.ts +6 -1
  125. package/dist/components/base/navigation/language-switcher.d.ts +12 -4
  126. package/dist/components/base/repeaters/key-value-editor.d.ts +2 -1
  127. package/dist/components/base/sidebar/sidebar.d.ts +2 -0
  128. package/dist/components/base/upload/avatar-upload.d.ts +2 -1
  129. package/dist/components/base/upload/image-upload.d.ts +2 -1
  130. package/dist/components/blocks/ai/ai-citation/types.d.ts +2 -0
  131. package/dist/components/blocks/ai/ai-reasoning/types.d.ts +2 -0
  132. package/dist/components/blocks/ai/ai-sources/types.d.ts +2 -0
  133. package/dist/components/blocks/ai/ai-tool-call/types.d.ts +2 -0
  134. package/dist/components/blocks/analytics/metric/metric.d.ts +4 -0
  135. package/dist/components/blocks/analytics/metric-comparison/metric-comparison.d.ts +2 -0
  136. package/dist/components/blocks/analytics/metric-grid/metric-grid.d.ts +4 -5
  137. package/dist/components/blocks/analytics/types.d.ts +2 -2
  138. package/dist/components/blocks/commerce/order-status/types.d.ts +4 -0
  139. package/dist/components/blocks/data-display/empty-state/empty-state.types.d.ts +4 -3
  140. package/dist/components/features/activities/activities.types.d.ts +18 -11
  141. package/dist/components/features/activities/hooks/use-activity-resources.d.ts +2 -1
  142. package/dist/components/features/ai-chat/hooks/use-ai-chat-scroll.d.ts +1 -1
  143. package/dist/components/features/appointment-calendar/appointment-calendar.d.ts +1 -1
  144. package/dist/components/features/appointment-calendar/appointment-calendar.types.d.ts +4 -2
  145. package/dist/components/features/combobox/async-resource-combobox.d.ts +2 -2
  146. package/dist/components/features/combobox/combobox.d.ts +2 -2
  147. package/dist/components/features/combobox/hooks/use-combobox-core.d.ts +2 -1
  148. package/dist/components/features/combobox/hooks/use-combobox-state.d.ts +1 -0
  149. package/dist/components/features/combobox/hooks/use-load-more.d.ts +1 -0
  150. package/dist/components/features/combobox/types.d.ts +37 -8
  151. package/dist/components/features/email-composer/types.d.ts +3 -1
  152. package/dist/components/features/filters/facets/date-facet.d.ts +4 -2
  153. package/dist/components/features/filters/facets/range-facet.d.ts +12 -0
  154. package/dist/components/features/filters/filters.types.d.ts +3 -3
  155. package/dist/components/features/filters/partials/date-filter-content.d.ts +3 -2
  156. package/dist/components/features/filters/partials/filter-popover-content.d.ts +4 -2
  157. package/dist/components/features/filters/partials/range-filter-content.d.ts +12 -0
  158. package/dist/components/features/filters/utils/filter-utils.d.ts +5 -1
  159. package/dist/components/features/media-library/hooks/use-media-library.d.ts +1 -1
  160. package/dist/components/features/media-library/media-library.d.ts +1 -1
  161. package/dist/components/features/media-library/media-library.strings.d.ts +6 -0
  162. package/dist/components/features/media-library/media-library.types.d.ts +36 -8
  163. package/dist/components/features/media-library/partials/media-library-partials.d.ts +3 -3
  164. package/dist/components/features/mentions/hooks/use-mentions.d.ts +16 -1
  165. package/dist/components/features/mentions/partials/mention-inline-suggestions.d.ts +5 -1
  166. package/dist/components/features/mentions/utils/split-html-by-mentions.d.ts +1 -7
  167. package/dist/components/features/overlays/hooks/use-overlay-visibility.d.ts +2 -2
  168. package/dist/components/features/products/products.types.d.ts +2 -2
  169. package/dist/components/features/questionnaire/questionnaire.types.d.ts +3 -0
  170. package/dist/components/features/resource/resource.d.ts +1 -1
  171. package/dist/components/features/resource/resource.types.d.ts +2 -0
  172. package/dist/components/features/rich-text-editor/form-rich-text-editor.d.ts +1 -1
  173. package/dist/components/features/rich-text-editor/partials/caret-helpers.d.ts +1 -1
  174. package/dist/components/features/rich-text-editor/partials/editor-field-aria.d.ts +14 -0
  175. package/dist/components/features/rich-text-editor/partials/rich-text-editor-toolbar.d.ts +3 -1
  176. package/dist/components/features/rich-text-editor/rich-text-editor.recipes.d.ts +1 -1
  177. package/dist/components/features/rich-text-editor/rich-text-editor.types.d.ts +17 -3
  178. package/dist/components/features/schema-form/hooks/use-schema-form.d.ts +5 -1
  179. package/dist/components/features/schema-form/partials/schema-form-field.d.ts +3 -1
  180. package/dist/components/features/schema-form/schema-form.utils.d.ts +1 -1
  181. package/dist/components/features/suggestions/suggestions.types.d.ts +1 -1
  182. package/dist/components/features/table/data-table.d.ts +1 -1
  183. package/dist/components/features/table/index.d.ts +1 -0
  184. package/dist/components/features/table/table-body.d.ts +1 -1
  185. package/dist/components/features/table/table-helpers.d.ts +6 -3
  186. package/dist/components/features/table/table.strings.d.ts +3 -0
  187. package/dist/components/features/table/table.types.d.ts +17 -1
  188. package/dist/components/layout/header/header.types.d.ts +3 -2
  189. package/dist/components/layout/layout.types.d.ts +5 -3
  190. package/dist/components/layout/navigation/side-nav.d.ts +3 -2
  191. package/dist/components/layout/normalize-layout-path.d.ts +1 -0
  192. package/dist/components/layout/settings/settings.d.ts +1 -1
  193. package/dist/components/layout/sidebar/app-sidebar.d.ts +1 -1
  194. package/dist/components/layout/sidebar/sidebar-navigation-rail.d.ts +3 -1
  195. package/dist/components/layout/sidebar/sidebar.context.d.ts +1 -0
  196. package/dist/components/layout/sidebar/sidebar.types.d.ts +2 -0
  197. package/dist/components/primitives/link.d.ts +3 -2
  198. package/dist/components/primitives/money.d.ts +1 -1
  199. package/dist/components/primitives/number.d.ts +1 -1
  200. package/dist/components/typography/rich-text/rich-text-tree.d.ts +7 -5
  201. package/dist/{containers-CIxwbZt5.js → containers-CSdc32h9.js} +2 -2
  202. package/dist/{containers-CIxwbZt5.js.map → containers-CSdc32h9.js.map} +1 -1
  203. package/dist/{copyable-DIznBqiT.js → copyable-3fdHfMR3.js} +4 -4
  204. package/dist/{copyable-DIznBqiT.js.map → copyable-3fdHfMR3.js.map} +1 -1
  205. package/dist/{data-display-BdgCAw8T.js → data-display-Cmj-xZYl.js} +16 -15
  206. package/dist/data-display-Cmj-xZYl.js.map +1 -0
  207. package/dist/{date-Cq8ioE4o.js → date-Br0FicVv.js} +4 -4
  208. package/dist/{date-Cq8ioE4o.js.map → date-Br0FicVv.js.map} +1 -1
  209. package/dist/date-picker-CyQlFYsP.js +1617 -0
  210. package/dist/date-picker-CyQlFYsP.js.map +1 -0
  211. package/dist/date-pickers-tj2MXmXd.js +185 -0
  212. package/dist/date-pickers-tj2MXmXd.js.map +1 -0
  213. package/dist/{display-KsZLw9Ov.js → display-CT_N2a3w.js} +7 -7
  214. package/dist/{display-KsZLw9Ov.js.map → display-CT_N2a3w.js.map} +1 -1
  215. package/dist/{dropdown-menu-CLs8Lihj.js → dropdown-menu-C08iIugv.js} +6 -6
  216. package/dist/{dropdown-menu-CLs8Lihj.js.map → dropdown-menu-C08iIugv.js.map} +1 -1
  217. package/dist/features/activities.js +283 -270
  218. package/dist/features/activities.js.map +1 -1
  219. package/dist/features/ai-chat.js +40 -27
  220. package/dist/features/ai-chat.js.map +1 -1
  221. package/dist/features/appointment-calendar.js +126 -126
  222. package/dist/features/appointment-calendar.js.map +1 -1
  223. package/dist/features/async-preview.js +9 -9
  224. package/dist/features/combobox.js +1 -1
  225. package/dist/features/comments.js +1 -1
  226. package/dist/features/data-view.js +10 -10
  227. package/dist/features/email-composer.js +24 -19
  228. package/dist/features/email-composer.js.map +1 -1
  229. package/dist/features/event-calendar.js +129 -125
  230. package/dist/features/event-calendar.js.map +1 -1
  231. package/dist/features/filters.js +2 -2
  232. package/dist/features/global-search.js +16 -20
  233. package/dist/features/global-search.js.map +1 -1
  234. package/dist/features/kanban.js +18 -28
  235. package/dist/features/kanban.js.map +1 -1
  236. package/dist/features/map/style.css +15 -0
  237. package/dist/features/map.js +331 -314
  238. package/dist/features/map.js.map +1 -1
  239. package/dist/features/media-library.js +1044 -866
  240. package/dist/features/media-library.js.map +1 -1
  241. package/dist/features/mentions.js +2 -2
  242. package/dist/features/overlays.js +1 -1
  243. package/dist/features/products.js +978 -964
  244. package/dist/features/products.js.map +1 -1
  245. package/dist/features/questionnaire.js +159 -152
  246. package/dist/features/questionnaire.js.map +1 -1
  247. package/dist/features/resource-assignment.js +8 -8
  248. package/dist/features/resource.js +74 -71
  249. package/dist/features/resource.js.map +1 -1
  250. package/dist/features/rich-text-editor.js +28 -19
  251. package/dist/features/rich-text-editor.js.map +1 -1
  252. package/dist/features/schema-form.js +297 -256
  253. package/dist/features/schema-form.js.map +1 -1
  254. package/dist/features/suggestions.js +57 -50
  255. package/dist/features/suggestions.js.map +1 -1
  256. package/dist/features/sync.js +3 -3
  257. package/dist/features/table.js +1 -1
  258. package/dist/features/theme-tweaker.js +400 -399
  259. package/dist/features/theme-tweaker.js.map +1 -1
  260. package/dist/feedback-Dzo1xtAU.js +246 -0
  261. package/dist/feedback-Dzo1xtAU.js.map +1 -0
  262. package/dist/{field-affordance-recipes-DWcNcOjh.js → field-affordance-recipes-D6H7tVJi.js} +2 -2
  263. package/dist/{field-affordance-recipes-DWcNcOjh.js.map → field-affordance-recipes-D6H7tVJi.js.map} +1 -1
  264. package/dist/field-control-attributes-B6i335wr.js +18 -0
  265. package/dist/field-control-attributes-B6i335wr.js.map +1 -0
  266. package/dist/{field-state-recipes-BVA2CWHo.js → field-state-recipes-7sza8QbC.js} +4 -2
  267. package/dist/{field-state-recipes-BVA2CWHo.js.map → field-state-recipes-7sza8QbC.js.map} +1 -1
  268. package/dist/{filters-DzgSJpMK.js → filters-Dl80yYtN.js} +763 -605
  269. package/dist/filters-Dl80yYtN.js.map +1 -0
  270. package/dist/form-field-CAPdwdnZ.js +74 -0
  271. package/dist/form-field-CAPdwdnZ.js.map +1 -0
  272. package/dist/{form-sizing-Bs2qFUeE.js → form-sizing-CgcrUbLU.js} +2 -2
  273. package/dist/{form-sizing-Bs2qFUeE.js.map → form-sizing-CgcrUbLU.js.map} +1 -1
  274. package/dist/{forms-C0RGnJTe.js → forms-B3W8CH7-.js} +8 -8
  275. package/dist/{forms-C0RGnJTe.js.map → forms-B3W8CH7-.js.map} +1 -1
  276. package/dist/forms-numeric-CwjQJe-O.js +991 -0
  277. package/dist/forms-numeric-CwjQJe-O.js.map +1 -0
  278. package/dist/{header-DMMxG__r.js → header-ZIIsRKxP.js} +113 -113
  279. package/dist/header-ZIIsRKxP.js.map +1 -0
  280. package/dist/hooks/use-files.d.ts +2 -0
  281. package/dist/{hooks-DB6CJ4MR.js → hooks-BitHSh-Y.js} +3 -3
  282. package/dist/{hooks-DB6CJ4MR.js.map → hooks-BitHSh-Y.js.map} +1 -1
  283. package/dist/{icon-badge-DZF-YjQp.js → icon-badge-npxF1SLX.js} +2 -2
  284. package/dist/{icon-badge-DZF-YjQp.js.map → icon-badge-npxF1SLX.js.map} +1 -1
  285. package/dist/index.js +1 -1
  286. package/dist/{input-CvyDQlY7.js → input-7KAc7XQL.js} +6 -6
  287. package/dist/{input-CvyDQlY7.js.map → input-7KAc7XQL.js.map} +1 -1
  288. package/dist/{input-DMBwAZmr.js → input-DIREVYHs.js} +3 -3
  289. package/dist/{input-DMBwAZmr.js.map → input-DIREVYHs.js.map} +1 -1
  290. package/dist/{interaction-recipes-XR9ZpVYL.js → interaction-recipes-4wZ2tvfb.js} +2 -2
  291. package/dist/{interaction-recipes-XR9ZpVYL.js.map → interaction-recipes-4wZ2tvfb.js.map} +1 -1
  292. package/dist/{item-DjCcM18E.js → item-FfWnaYST.js} +99 -98
  293. package/dist/item-FfWnaYST.js.map +1 -0
  294. package/dist/layout/app-shell.js +1 -1
  295. package/dist/layout/auth.js +1 -1
  296. package/dist/layout/containers.js +1 -1
  297. package/dist/layout/header.js +1 -1
  298. package/dist/layout/hooks.js +1 -1
  299. package/dist/layout/navigation.js +1 -1
  300. package/dist/layout/page.js +1 -1
  301. package/dist/layout/settings.js +1 -1
  302. package/dist/layout/sidebar.js +2 -2
  303. package/dist/layout/workspace.js +1 -1
  304. package/dist/layout.js +11 -11
  305. package/dist/layout.types-E_GAApzO.js +30 -0
  306. package/dist/layout.types-E_GAApzO.js.map +1 -0
  307. package/dist/lib/field-control-attributes.d.ts +11 -0
  308. package/dist/lib/field-state-recipes.d.ts +2 -0
  309. package/dist/lib/format.d.ts +1 -0
  310. package/dist/lib/surface-recipes.d.ts +1 -1
  311. package/dist/lib/token-merge.generated.d.ts +6 -6
  312. package/dist/lib/utils.js +1 -1
  313. package/dist/{media-gallery-C-vChPmE.js → media-gallery-C81DAnKI.js} +6 -6
  314. package/dist/{media-gallery-C-vChPmE.js.map → media-gallery-C81DAnKI.js.map} +1 -1
  315. package/dist/{mentions-0_4nWuI-.js → mentions-qOnedSt4.js} +236 -167
  316. package/dist/mentions-qOnedSt4.js.map +1 -0
  317. package/dist/message-BJHnn43M.js +135 -0
  318. package/dist/message-BJHnn43M.js.map +1 -0
  319. package/dist/{metadata-list-C3MkU-Om.js → metadata-list-XkqZ_UXH.js} +11 -11
  320. package/dist/{metadata-list-C3MkU-Om.js.map → metadata-list-XkqZ_UXH.js.map} +1 -1
  321. package/dist/{navigation-DaRjthVk.js → navigation-BgtPJAhi.js} +119 -119
  322. package/dist/navigation-BgtPJAhi.js.map +1 -0
  323. package/dist/{navigation-C90-oQFq.js → navigation-Bt-v7rWP.js} +52 -46
  324. package/dist/navigation-Bt-v7rWP.js.map +1 -0
  325. package/dist/normalize-layout-path-BmEgg6fu.js +14 -0
  326. package/dist/normalize-layout-path-BmEgg6fu.js.map +1 -0
  327. package/dist/{number-CRU3kGuk.js → number-CYqBcrSj.js} +78 -86
  328. package/dist/number-CYqBcrSj.js.map +1 -0
  329. package/dist/{overflow-tab-bar-IVFVQFV6.js → overflow-tab-bar-BQCA2Zn2.js} +7 -7
  330. package/dist/{overflow-tab-bar-IVFVQFV6.js.map → overflow-tab-bar-BQCA2Zn2.js.map} +1 -1
  331. package/dist/{overlays-BSgCtM2v.js → overlays-CC8zI3Du.js} +264 -260
  332. package/dist/overlays-CC8zI3Du.js.map +1 -0
  333. package/dist/{page-DUUKDAjo.js → page-BoQ1VaFJ.js} +13 -13
  334. package/dist/{page-DUUKDAjo.js.map → page-BoQ1VaFJ.js.map} +1 -1
  335. package/dist/{page-header-commands-7P3sfE9u.js → page-header-commands-DIKspJfx.js} +4 -4
  336. package/dist/{page-header-commands-7P3sfE9u.js.map → page-header-commands-DIKspJfx.js.map} +1 -1
  337. package/dist/{pagination-CgCjElfu.js → pagination-Br8TdV9A.js} +4 -4
  338. package/dist/{pagination-CgCjElfu.js.map → pagination-Br8TdV9A.js.map} +1 -1
  339. package/dist/{popover-B85RenIl.js → popover-k8TdUcAt.js} +10 -10
  340. package/dist/popover-k8TdUcAt.js.map +1 -0
  341. package/dist/{popover-menu-DlnQ2zlR.js → popover-menu-yn-o0kyA.js} +7 -7
  342. package/dist/{popover-menu-DlnQ2zlR.js.map → popover-menu-yn-o0kyA.js.map} +1 -1
  343. package/dist/{popover.recipes-DdiEp0rd.js → popover.recipes-DJ0AkUan.js} +2 -2
  344. package/dist/{popover.recipes-DdiEp0rd.js.map → popover.recipes-DJ0AkUan.js.map} +1 -1
  345. package/dist/{portal-recipes-BpsV_iRw.js → portal-recipes-DyUXqUtD.js} +2 -2
  346. package/dist/{portal-recipes-BpsV_iRw.js.map → portal-recipes-DyUXqUtD.js.map} +1 -1
  347. package/dist/{primitives-ByWgGUgt.js → primitives-BkkQjYl7.js} +22 -17
  348. package/dist/primitives-BkkQjYl7.js.map +1 -0
  349. package/dist/primitives.js +4 -4
  350. package/dist/{progress-BJhQP9WX.js → progress-DZFXXzPs.js} +4 -4
  351. package/dist/{progress-BJhQP9WX.js.map → progress-DZFXXzPs.js.map} +1 -1
  352. package/dist/{receipt-tOc7B3hw.js → receipt-C7LhOg7Q.js} +6 -6
  353. package/dist/{receipt-tOc7B3hw.js.map → receipt-C7LhOg7Q.js.map} +1 -1
  354. package/dist/rich-text-BnTzZjIo.js +45 -0
  355. package/dist/rich-text-BnTzZjIo.js.map +1 -0
  356. package/dist/rich-text-editor-CAurDwT5.js +1273 -0
  357. package/dist/rich-text-editor-CAurDwT5.js.map +1 -0
  358. package/dist/{rich-text-editor-toolbar-laT3tpBT.js → rich-text-editor-toolbar-DbXig7Jk.js} +36 -35
  359. package/dist/rich-text-editor-toolbar-DbXig7Jk.js.map +1 -0
  360. package/dist/rich-text-tree-BqyQ_7-R.js +66 -0
  361. package/dist/rich-text-tree-BqyQ_7-R.js.map +1 -0
  362. package/dist/{sanitize-html-DsQmI48u.js → sanitize-html-BWkH4dLM.js} +29 -16
  363. package/dist/sanitize-html-BWkH4dLM.js.map +1 -0
  364. package/dist/{scroll-area-B0dB2cBi.js → scroll-area-Bj6CRUif.js} +2 -2
  365. package/dist/{scroll-area-B0dB2cBi.js.map → scroll-area-Bj6CRUif.js.map} +1 -1
  366. package/dist/{separator-Bb17I4pu.js → separator-B9ewiCGO.js} +2 -2
  367. package/dist/{separator-Bb17I4pu.js.map → separator-B9ewiCGO.js.map} +1 -1
  368. package/dist/{separator-Ct_WSWTJ.js → separator-DM6gs2vu.js} +3 -3
  369. package/dist/{separator-Ct_WSWTJ.js.map → separator-DM6gs2vu.js.map} +1 -1
  370. package/dist/services/actions.js +1 -1
  371. package/dist/settings-DZPHgpx4.js +155 -0
  372. package/dist/settings-DZPHgpx4.js.map +1 -0
  373. package/dist/{sheet-BGPERY55.js → sheet-C4DHsgLk.js} +6 -6
  374. package/dist/{sheet-BGPERY55.js.map → sheet-C4DHsgLk.js.map} +1 -1
  375. package/dist/sidebar-C8BnDwTH.js +709 -0
  376. package/dist/sidebar-C8BnDwTH.js.map +1 -0
  377. package/dist/{sidebar-f9gRWXIR.js → sidebar-CmD6a-HK.js} +16 -13
  378. package/dist/sidebar-CmD6a-HK.js.map +1 -0
  379. package/dist/{skeleton-BapcJd9C.js → skeleton-DDgdhmu9.js} +5 -5
  380. package/dist/{skeleton-BapcJd9C.js.map → skeleton-DDgdhmu9.js.map} +1 -1
  381. package/dist/{smart-card-CW0hjetE.js → smart-card-B6vLxqa_.js} +8 -8
  382. package/dist/{smart-card-CW0hjetE.js.map → smart-card-B6vLxqa_.js.map} +1 -1
  383. package/dist/{structure-DuxKl954.js → structure-DZJ2wbAU.js} +2 -2
  384. package/dist/{structure-DuxKl954.js.map → structure-DZJ2wbAU.js.map} +1 -1
  385. package/dist/style.css +1 -1
  386. package/dist/{surface-recipes-BKRVW8Os.js → surface-recipes-C8mNycaY.js} +2 -2
  387. package/dist/{surface-recipes-BKRVW8Os.js.map → surface-recipes-C8mNycaY.js.map} +1 -1
  388. package/dist/{table-CFOWY9pQ.js → table-CBonSdTp.js} +534 -486
  389. package/dist/table-CBonSdTp.js.map +1 -0
  390. package/dist/{table-B4TE7iOV.js → table-CXSPHH25.js} +75 -71
  391. package/dist/table-CXSPHH25.js.map +1 -0
  392. package/dist/{tabs-e7ko9S2o.js → tabs-C4Kr_hCr.js} +50 -49
  393. package/dist/tabs-C4Kr_hCr.js.map +1 -0
  394. package/dist/{text-inputs-B1culiSK.js → text-inputs-jdkS3ReG.js} +9 -9
  395. package/dist/{text-inputs-B1culiSK.js.map → text-inputs-jdkS3ReG.js.map} +1 -1
  396. package/dist/{timelines-D3Sl9ueq.js → timelines-CoPwdJP0.js} +10 -10
  397. package/dist/{timelines-D3Sl9ueq.js.map → timelines-CoPwdJP0.js.map} +1 -1
  398. package/dist/{tooltip-8wz5S_Zr.js → tooltip-31NwIpTo.js} +4 -4
  399. package/dist/{tooltip-8wz5S_Zr.js.map → tooltip-31NwIpTo.js.map} +1 -1
  400. package/dist/{tree-CzUJHnFs.js → tree-CeYVzdFE.js} +6 -6
  401. package/dist/{tree-CzUJHnFs.js.map → tree-CeYVzdFE.js.map} +1 -1
  402. package/dist/typography/rich-text.js +1 -1
  403. package/dist/{typography-BQnine1k.js → typography-C7-YMW1S.js} +2 -2
  404. package/dist/{typography-BQnine1k.js.map → typography-C7-YMW1S.js.map} +1 -1
  405. package/dist/typography.js +1 -1
  406. package/dist/{upload-BOW6U2tI.js → upload-Hdm5gObf.js} +303 -291
  407. package/dist/upload-Hdm5gObf.js.map +1 -0
  408. package/dist/{upload-queue-qUXn1ykN.js → upload-queue-D0sYPuqo.js} +8 -8
  409. package/dist/{upload-queue-qUXn1ykN.js.map → upload-queue-D0sYPuqo.js.map} +1 -1
  410. package/dist/{usage-card-BeSLY0i0.js → usage-card-9s8hLDfn.js} +9 -9
  411. package/dist/{usage-card-BeSLY0i0.js.map → usage-card-9s8hLDfn.js.map} +1 -1
  412. package/dist/{utils-B6kKb8jB.js → utils-DhuoqFy4.js} +31 -37
  413. package/dist/utils-DhuoqFy4.js.map +1 -0
  414. package/dist/{value-inputs-skdVB2zh.js → value-inputs-D3aPgq9H.js} +15 -15
  415. package/dist/{value-inputs-skdVB2zh.js.map → value-inputs-D3aPgq9H.js.map} +1 -1
  416. package/dist/{value-typography-uAmWUAL1.js → value-typography-uSzzG9Gf.js} +32 -26
  417. package/dist/value-typography-uSzzG9Gf.js.map +1 -0
  418. package/dist/{workspace-DHeHv0qw.js → workspace-CC8Vchiu.js} +12 -12
  419. package/dist/{workspace-DHeHv0qw.js.map → workspace-CC8Vchiu.js.map} +1 -1
  420. package/docs/consumer-skill/examples/edit.tsx +3 -3
  421. package/docs/consumer-skill/references/agents-md.md +19 -19
  422. package/docs/consumer-skill/references/analytics.md +15 -0
  423. package/docs/consumer-skill/references/component-contracts.json +14724 -13057
  424. package/docs/consumer-skill/references/composition.md +21 -4
  425. package/docs/consumer-skill/references/design-contract.md +1 -0
  426. package/docs/consumer-skill/references/installation.md +51 -8
  427. package/docs/consumer-skill/references/integration.md +24 -1
  428. package/docs/consumer-skill/references/public-api.json +172 -34
  429. package/docs/consumer-skill/references/review.md +51 -11
  430. package/docs/consumer-skill/references/rhf-workflows.md +72 -0
  431. package/docs/consumer-skill/references/theming.md +7 -2
  432. package/docs/consumer-skill/references/tokens.json +1 -1
  433. package/docs/consumer-skill/scripts/composition-policy.mjs +144 -30
  434. package/docs/consumer-skill/scripts/setup-skills.mjs +46 -9
  435. package/package.json +4 -2
  436. package/templates/admin-shell-template.tsx +1 -2
  437. package/templates/customers-template.tsx +18 -16
  438. package/dist/accordion-B9MHG0cT.js.map +0 -1
  439. package/dist/ai-artifact-C58tQcBy.js.map +0 -1
  440. package/dist/auth-DTkkshS8.js.map +0 -1
  441. package/dist/breadcrumbs-J-K2kl4c.js.map +0 -1
  442. package/dist/choice-inputs-zUgBZfE4.js.map +0 -1
  443. package/dist/combobox-BwzoXFSG.js +0 -884
  444. package/dist/combobox-BwzoXFSG.js.map +0 -1
  445. package/dist/comments-Dmpp0YIc.js.map +0 -1
  446. package/dist/data-display-BdgCAw8T.js.map +0 -1
  447. package/dist/date-picker-RlIzKom_.js +0 -1551
  448. package/dist/date-picker-RlIzKom_.js.map +0 -1
  449. package/dist/date-pickers-DY-CpXS1.js +0 -179
  450. package/dist/date-pickers-DY-CpXS1.js.map +0 -1
  451. package/dist/feedback-Dm4izqFn.js +0 -240
  452. package/dist/feedback-Dm4izqFn.js.map +0 -1
  453. package/dist/filters-DzgSJpMK.js.map +0 -1
  454. package/dist/form-field-BriWAXyg.js +0 -63
  455. package/dist/form-field-BriWAXyg.js.map +0 -1
  456. package/dist/forms-numeric-DIhghX1Q.js +0 -910
  457. package/dist/forms-numeric-DIhghX1Q.js.map +0 -1
  458. package/dist/header-DMMxG__r.js.map +0 -1
  459. package/dist/item-DjCcM18E.js.map +0 -1
  460. package/dist/layout.types-Cn7aUzJp.js +0 -20
  461. package/dist/layout.types-Cn7aUzJp.js.map +0 -1
  462. package/dist/mentions-0_4nWuI-.js.map +0 -1
  463. package/dist/message-g8p7eVtN.js +0 -128
  464. package/dist/message-g8p7eVtN.js.map +0 -1
  465. package/dist/navigation-C90-oQFq.js.map +0 -1
  466. package/dist/navigation-DaRjthVk.js.map +0 -1
  467. package/dist/number-CRU3kGuk.js.map +0 -1
  468. package/dist/overlays-BSgCtM2v.js.map +0 -1
  469. package/dist/popover-B85RenIl.js.map +0 -1
  470. package/dist/primitives-ByWgGUgt.js.map +0 -1
  471. package/dist/rich-text-Dth5E882.js +0 -78
  472. package/dist/rich-text-Dth5E882.js.map +0 -1
  473. package/dist/rich-text-editor-C1fOjBTd.js +0 -1195
  474. package/dist/rich-text-editor-C1fOjBTd.js.map +0 -1
  475. package/dist/rich-text-editor-toolbar-laT3tpBT.js.map +0 -1
  476. package/dist/safe-image-src-C6kQSMBZ.js +0 -17
  477. package/dist/safe-image-src-C6kQSMBZ.js.map +0 -1
  478. package/dist/sanitize-html-DsQmI48u.js.map +0 -1
  479. package/dist/settings-Bar5wiSo.js +0 -167
  480. package/dist/settings-Bar5wiSo.js.map +0 -1
  481. package/dist/sidebar-D-JYMMbY.js +0 -686
  482. package/dist/sidebar-D-JYMMbY.js.map +0 -1
  483. package/dist/sidebar-f9gRWXIR.js.map +0 -1
  484. package/dist/table-B4TE7iOV.js.map +0 -1
  485. package/dist/table-CFOWY9pQ.js.map +0 -1
  486. package/dist/tabs-e7ko9S2o.js.map +0 -1
  487. package/dist/upload-BOW6U2tI.js.map +0 -1
  488. package/dist/utils-B6kKb8jB.js.map +0 -1
  489. package/dist/value-typography-uAmWUAL1.js.map +0 -1
@@ -1,17 +1,17 @@
1
1
  "use client";
2
2
  import { interpolateString as e, useStrings as t } from "../lib/strings.js";
3
- import { t as n } from "../utils-B6kKb8jB.js";
4
- import { n as r } from "../buttons-BedGfygC.js";
5
- import { c as i, o as a } from "../typography-BQnine1k.js";
3
+ import { t as n } from "../utils-DhuoqFy4.js";
4
+ import { n as r } from "../buttons-DeW0bQeK.js";
5
+ import { c as i, o as a } from "../typography-C7-YMW1S.js";
6
6
  import { t as o } from "../focus-recipes-B653VaLq.js";
7
- import { t as s } from "../structure-DuxKl954.js";
7
+ import { t as s } from "../structure-DZJ2wbAU.js";
8
8
  import { t as c } from "../tone-recipes-BPsRAvhu.js";
9
- import { t as l } from "../badge-xIiV_E7f.js";
10
- import { t as u } from "../field-state-recipes-BVA2CWHo.js";
11
- import { d } from "../text-inputs-B1culiSK.js";
12
- import { s as f } from "../data-display-BdgCAw8T.js";
13
- import { c as p, l as m, s as h } from "../message-g8p7eVtN.js";
14
- import { S as g, _, a as v, b as y, d as b, h as x, l as S, p as C, r as w, s as T, t as E, y as D } from "../ai-artifact-C58tQcBy.js";
9
+ import { t as l } from "../badge-wWauMgAt.js";
10
+ import { t as u } from "../field-state-recipes-7sza8QbC.js";
11
+ import { d } from "../text-inputs-jdkS3ReG.js";
12
+ import { s as f } from "../data-display-Cmj-xZYl.js";
13
+ import { c as p, l as m, s as h } from "../message-BJHnn43M.js";
14
+ import { S as g, _, a as v, b as y, d as b, h as x, l as S, p as C, r as w, s as T, t as E, y as D } from "../ai-artifact-CGGpQryR.js";
15
15
  import { useCallback as O, useEffect as k, useRef as A, useState as j } from "react";
16
16
  import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
17
17
  import { ArrowDown as F, ArrowUp as I, Loader2 as L, Paperclip as R, Sparkles as z, Square as B, X as ee } from "lucide-react";
@@ -67,36 +67,47 @@ q.displayName = "AiChatAttachmentsStrip";
67
67
  //#endregion
68
68
  //#region src/components/features/ai-chat/hooks/use-ai-chat-scroll.ts
69
69
  function te({ threshold: e = 80, dependency: t, disableAutoScroll: n = !1 } = {}) {
70
- let r = A(null), i = A(null), [a, o] = j(!0), s = O((e = "smooth") => {
71
- i.current?.scrollIntoView({
70
+ let r = A(null), i = A(null), a = A(!0), [o, s] = j(!0), c = O((e = "smooth") => {
71
+ let t = r.current;
72
+ t ? t.scrollTo({
73
+ top: t.scrollHeight,
74
+ behavior: e
75
+ }) : i.current?.scrollIntoView({
72
76
  behavior: e,
73
77
  block: "end"
74
78
  });
75
- }, []);
76
- return k(() => {
79
+ }, []), l = O(() => {
77
80
  let t = r.current;
78
81
  if (!t) return;
79
- let n = () => {
80
- let n = t.scrollHeight - t.clientHeight - t.scrollTop;
81
- o(n <= e);
82
- };
83
- return n(), t.addEventListener("scroll", n, { passive: !0 }), () => t.removeEventListener("scroll", n);
84
- }, [e]), k(() => {
85
- if (n || !a) return;
86
- let e = window.requestAnimationFrame(() => s("auto"));
82
+ let n = t.scrollHeight - t.clientHeight - t.scrollTop;
83
+ a.current = n <= e, s(a.current);
84
+ }, [e]);
85
+ return k(() => {
86
+ let e = r.current;
87
+ if (e) return e.addEventListener("scroll", l, { passive: !0 }), () => e.removeEventListener("scroll", l);
88
+ }, [l]), k(() => {
89
+ let e = window.requestAnimationFrame(() => {
90
+ let e = r.current;
91
+ (!e || e.scrollHeight - e.clientHeight > e.scrollTop) && !n && a.current && c("auto"), l();
92
+ });
87
93
  return () => window.cancelAnimationFrame(e);
88
- }, [t, n]), {
94
+ }, [
95
+ t,
96
+ n,
97
+ l,
98
+ c
99
+ ]), {
89
100
  containerRef: r,
90
101
  endRef: i,
91
- isAtBottom: a,
92
- scrollToBottom: s
102
+ isAtBottom: o,
103
+ scrollToBottom: c
93
104
  };
94
105
  }
95
106
  //#endregion
96
107
  //#region src/components/features/ai-chat/partials/ai-chat-conversation.tsx
97
108
  function J({ messages: e, renderMessage: a, intro: c, footer: l, empty: u, disableAutoScroll: d, className: f, strings: p }) {
98
109
  let m = t(H, p), { containerRef: h, endRef: g, isAtBottom: _, scrollToBottom: v } = te({
99
- dependency: e.length,
110
+ dependency: e,
100
111
  disableAutoScroll: d
101
112
  }), y = e.length === 0 && !c;
102
113
  return /* @__PURE__ */ P("div", {
@@ -146,7 +157,9 @@ function J({ messages: e, renderMessage: a, intro: c, footer: l, empty: u, disab
146
157
  tone: "secondary",
147
158
  buttonStyle: "solid",
148
159
  "aria-label": m.scrollToBottomAria,
149
- onClick: () => v("smooth"),
160
+ onClick: () => {
161
+ h.current?.focus({ preventScroll: !0 }), v();
162
+ },
150
163
  className: n("shadow-sm max-sm:size-action-sm max-sm:min-h-0 max-sm:p-0", "border border-border/60"),
151
164
  children: [/* @__PURE__ */ N(F, { className: "size-icon-md" }), /* @__PURE__ */ N(i, {
152
165
  tag: "span",
@@ -1 +1 @@
1
- {"version":3,"file":"ai-chat.js","names":["_Fragment","cn","Button","Text","DisplayLabel","focusRecipes","Stack","dotRecipes","Badge","fieldStateRecipes","EmptyState","messageColumns","messageContentColumn","hasMessageMedia","AiMessageBubble","AiChainOfThought","AiToolCall","AiConfirmation","AiAttachment","AiSources","AiAgent","AiTask","AiReasoning","AiArtifact","AiShimmer","Fragment$1","defaultAiChatPromptInputStrings","defaultAiChatConversationStrings","defaultAiChatQueueStrings","defaultAiChatSuggestionsStrings","defaultAiChatMessageStrings","defaultAiChatStrings","AiChatAttachmentsStrip","attachments","className","att","onOpen","onRemove","useAiChatScroll","containerRef","useRef","endRef","isAtBottom","setIsAtBottom","useState","scrollToBottom","useCallback","useEffect","el","onScroll","distance","threshold","disableAutoScroll","id","dependency","AiChatConversation","stringsProp","strings","useStrings","messages","isEmpty","intro","empty","ctx","idx","renderMessage","message","footer","ArrowDown","AiChatEmptyState","IconComponent","Sparkles","media","description","below","AiChatMessage","align","inBubble","part","plainText","p","extractPlain","bubbleContent","hasBubble","hasAvatar","continuationColumn","onCopy","PartRenderer","AiCodeBlock","onAttachmentOpen","node","AiChatPromptInput","textareaRef","canSubmit","streaming","disabled","value","handleSubmit","onSubmit","handleKeyDown","showAttachBtn","showAttach","onAttach","onRemoveAttachment","Textarea","onValueChange","leadingActions","Paperclip","trailingActions","onStop","Square","ArrowUp","hideHint","interpolateString","submitKeyLabel","AiChatQueue","items","hideHeader","status","item","Loader2","onCancel","X","AiChatSuggestionsRow","suggestions","Icon","s","onPick","AiChat","force","slots","onMessageCopy","onMessageRegenerate","attachmentId","Header","agent","headerActions","Empty","Queue","queue","onCancelQueueItem","Suggestions","onPickSuggestion","Input","inputValue","onInputChange","values","v"],"sources":["../../src/components/features/ai-chat/ai-chat.strings.ts","../../src/components/features/ai-chat/partials/ai-chat-attachments-strip.tsx","../../src/components/features/ai-chat/hooks/use-ai-chat-scroll.ts","../../src/components/features/ai-chat/partials/ai-chat-conversation.tsx","../../src/components/features/ai-chat/partials/ai-chat-empty-state.tsx","../../src/components/features/ai-chat/partials/ai-chat-message.tsx","../../src/components/features/ai-chat/partials/ai-chat-prompt-input.tsx","../../src/components/features/ai-chat/partials/ai-chat-queue.tsx","../../src/components/features/ai-chat/partials/ai-chat-suggestions-row.tsx","../../src/components/features/ai-chat/ai-chat.tsx"],"sourcesContent":["/**\n * Strings for `<AiChat>` and its partials. Each interface is co-located so\n * partials and the feature root all read from one source of truth (rule 19).\n * Consumers override via the `strings` prop on the relevant component; values\n * are deep-merged over the defaults so partial overrides are safe.\n */\n\nexport interface AiChatPromptInputStrings {\n\t/** Placeholder copy for the textarea. */\n\tplaceholder: string;\n\t/** Aria label for the attach button. */\n\tattachAria: string;\n\t/** Aria label for the submit button. */\n\tsubmitAria: string;\n\t/** Aria label for the stop button (replaces submit while streaming). */\n\tstopAria: string;\n\t/** Aria label for the model picker button (when `modelPicker` is provided). */\n\tmodelPickerAria: string;\n\t/** Hint shown under the input. Supports `{{key}}` for the submit shortcut. */\n\thint: string;\n}\n\nexport const defaultAiChatPromptInputStrings: AiChatPromptInputStrings = {\n\tplaceholder: 'Ask anything…',\n\tattachAria: 'Attach files',\n\tsubmitAria: 'Send message',\n\tstopAria: 'Stop generating',\n\tmodelPickerAria: 'Choose model',\n\thint: 'Press {{submitKey}} to send · {{newlineKey}} for newline',\n};\n\nexport interface AiChatConversationStrings {\n\ttranscriptAria: string;\n\t/** Shown in place of the collection when it has no entries. */\n\tempty: string;\n\tscrollToBottom: string;\n\tscrollToBottomAria: string;\n}\n\nexport const defaultAiChatConversationStrings: AiChatConversationStrings = {\n\ttranscriptAria: 'Conversation messages',\n\tempty: 'No messages yet.',\n\tscrollToBottom: 'Jump to latest',\n\tscrollToBottomAria: 'Scroll to bottom',\n};\n\nexport interface AiChatQueueStrings {\n\theader: string;\n\tcancelAria: string;\n\tqueuedLabel: string;\n\trunningLabel: string;\n}\n\nexport const defaultAiChatQueueStrings: AiChatQueueStrings = {\n\theader: 'In queue',\n\tcancelAria: 'Remove from queue',\n\tqueuedLabel: 'Queued',\n\trunningLabel: 'Running',\n};\n\nexport interface AiChatSuggestionsStrings {\n\theader: string;\n}\n\nexport const defaultAiChatSuggestionsStrings: AiChatSuggestionsStrings = {\n\theader: 'Try',\n};\n\nexport interface AiChatMessageStrings {\n\tpending: string;\n}\n\nexport const defaultAiChatMessageStrings: AiChatMessageStrings = {\n\tpending: 'Thinking…',\n};\n\nexport interface AiChatStrings {\n\tprompt: AiChatPromptInputStrings;\n\tconversation: AiChatConversationStrings;\n\tqueue: AiChatQueueStrings;\n\tsuggestions: AiChatSuggestionsStrings;\n\tmessage: AiChatMessageStrings;\n\temptyTitle: string;\n\temptyDescription: string;\n\t/** Screen-reader announcement emitted while the composer is disabled. */\n\tdisabledAnnouncement: string;\n}\n\nexport const defaultAiChatStrings: AiChatStrings = {\n\tprompt: defaultAiChatPromptInputStrings,\n\tconversation: defaultAiChatConversationStrings,\n\tqueue: defaultAiChatQueueStrings,\n\tsuggestions: defaultAiChatSuggestionsStrings,\n\tmessage: defaultAiChatMessageStrings,\n\temptyTitle: 'Start a conversation',\n\temptyDescription: 'Ask a question, share context, or attach a file to get going.',\n\tdisabledAnnouncement: 'Chat is disabled',\n};\n","/**\n * AiChatAttachmentsStrip — flex-wrap row of `<AiAttachment>` chips. Used both\n * in the prompt input (staged uploads — pass `onRemove` to enable a remove\n * button) and inside messages (read-only attachment list).\n */\nimport { AiAttachment } from '../../../blocks/ai/ai-attachment';\nimport { Stack } from '../../../base/structure';\nimport { cn } from '../../../../lib/utils';\n\nimport type { AiChatAttachment } from '../ai-chat.types';\n\nexport interface AiChatAttachmentsStripProps {\n\t/** Files staged on the draft. */\n\tattachments: ReadonlyArray<AiChatAttachment>;\n\t/** When set, each chip gets a remove button wired to this handler. */\n\tonRemove?: (id: string) => void;\n\t/** When set, click on a chip calls this. */\n\tonOpen?: (att: AiChatAttachment) => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n}\n\nexport function AiChatAttachmentsStrip({\n\tattachments,\n\tonRemove,\n\tonOpen,\n\tclassName,\n}: AiChatAttachmentsStripProps) {\n\tif (attachments.length === 0) return null;\n\treturn (\n\t\t<Stack\n\t\t\tdirection=\"horizontal\"\n\t\t\tgap=\"sm\"\n\t\t\tclassName={cn('ai-chat-attachments-strip--component', className)}\n\t\t>\n\t\t\t{attachments.map((att) => (\n\t\t\t\t<AiAttachment\n\t\t\t\t\tkey={att.id}\n\t\t\t\t\tname={att.name}\n\t\t\t\t\tmeta={att.meta}\n\t\t\t\t\tkind={att.kind}\n\t\t\t\t\ticon={att.icon}\n\t\t\t\t\tthumbnailUrl={att.thumbnailUrl}\n\t\t\t\t\tprogress={att.progress}\n\t\t\t\t\terrored={att.errored}\n\t\t\t\t\tonOpen={onOpen ? () => onOpen(att) : undefined}\n\t\t\t\t\tonRemove={onRemove ? () => onRemove(att.id) : undefined}\n\t\t\t\t/>\n\t\t\t))}\n\t\t</Stack>\n\t);\n}\n\nAiChatAttachmentsStrip.displayName = 'AiChatAttachmentsStrip';\n","/**\n * useAiChatScroll — auto-stick-to-bottom scroll behaviour for chat\n * conversations. Detects when the user has scrolled away from the latest\n * message and pauses auto-scroll until they return.\n *\n * Returns:\n * - `containerRef` — attach to the scroll viewport.\n * - `endRef` — attach to a sentinel at the very bottom.\n * - `isAtBottom` — true when the viewport is pinned to the latest content.\n * - `scrollToBottom` — imperatively scroll to the sentinel.\n */\nimport { useCallback, useEffect, useRef, useState } from 'react';\n\nexport interface UseAiChatScrollOptions {\n\t/** Distance (px) from bottom counted as \"at bottom\". */\n\tthreshold?: number;\n\t/** Re-evaluate on these dependencies (typically the message count). */\n\tdependency?: unknown;\n\t/** Disable auto-scroll-on-update behaviour. */\n\tdisableAutoScroll?: boolean;\n}\n\nexport interface UseAiChatScrollReturn {\n\tcontainerRef: React.RefObject<HTMLDivElement | null>;\n\tendRef: React.RefObject<HTMLDivElement | null>;\n\tisAtBottom: boolean;\n\tscrollToBottom: (behavior?: ScrollBehavior) => void;\n}\n\nexport function useAiChatScroll({\n\tthreshold = 80,\n\tdependency,\n\tdisableAutoScroll = false,\n}: UseAiChatScrollOptions = {}): UseAiChatScrollReturn {\n\tconst containerRef = useRef<HTMLDivElement | null>(null);\n\tconst endRef = useRef<HTMLDivElement | null>(null);\n\tconst [isAtBottom, setIsAtBottom] = useState(true);\n\n\tconst scrollToBottom = useCallback(\n\t\t(behavior: ScrollBehavior = 'smooth') => {\n\t\t\tendRef.current?.scrollIntoView({ behavior, block: 'end' });\n\t\t},\n\t\t[],\n\t);\n\n\t// Track scroll position so we can pause auto-scroll when the user reads up.\n\tuseEffect(() => {\n\t\tconst el = containerRef.current;\n\t\tif (!el) return;\n\t\tconst onScroll = () => {\n\t\t\tconst distance = el.scrollHeight - el.clientHeight - el.scrollTop;\n\t\t\tsetIsAtBottom(distance <= threshold);\n\t\t};\n\t\tonScroll();\n\t\tel.addEventListener('scroll', onScroll, { passive: true });\n\t\treturn () => el.removeEventListener('scroll', onScroll);\n\t}, [threshold]);\n\n\t// Auto-scroll when content updates and the user is pinned at the bottom.\n\tuseEffect(() => {\n\t\tif (disableAutoScroll) return;\n\t\tif (!isAtBottom) return;\n\t\t// Use rAF so we wait for layout to settle after the new content paints.\n\t\tconst id = window.requestAnimationFrame(() => scrollToBottom('auto'));\n\t\treturn () => window.cancelAnimationFrame(id);\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [dependency, disableAutoScroll]);\n\n\treturn { containerRef, endRef, isAtBottom, scrollToBottom };\n}\n","/**\n * AiChatConversation — scrollable list container for chat messages with\n * auto-stick-to-bottom behaviour. Renders each message via the consumer's\n * `renderMessage` slot (or the default `<AiChatMessage>` via the parent\n * `<AiChat>`). Surfaces a \"Jump to latest\" pill when the user scrolls away\n * from the bottom while content streams in.\n */\nimport { ArrowDown } from 'lucide-react';\nimport type { ReactNode } from 'react';\nimport { Button } from '../../../base/buttons';\nimport { Stack } from '../../../base/structure';\nimport { Text } from '../../../typography';\nimport { useStrings, type StringsProp } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultAiChatConversationStrings,\n\ttype AiChatConversationStrings,\n} from '../ai-chat.strings';\nimport type {\n\tAiChatMessage as AiChatMessageType,\n\tAiChatRenderMessageContext,\n} from '../ai-chat.types';\nimport { useAiChatScroll } from '../hooks/use-ai-chat-scroll';\nimport { focusRecipes } from '../../../../lib/focus-recipes';\n\nexport interface AiChatConversationProps {\n\t/** Messages to render, oldest first. */\n\tmessages: ReadonlyArray<AiChatMessageType>;\n\t/** Replaces the default message rendering. */\n\trenderMessage: (\n\t\t/** The message this row represents. */\n\t\tmessage: AiChatMessageType,\n\t\tctx: AiChatRenderMessageContext,\n\t) => ReactNode;\n\t/** Render before the messages list (intro card, agent greeting). */\n\tintro?: ReactNode;\n\t/** Render after the messages list (e.g. tip ribbon). */\n\tfooter?: ReactNode;\n\t/** Replaces the empty state when `messages.length === 0`. */\n\tempty?: ReactNode;\n\t/** Pause auto-scroll-on-update. */\n\tdisableAutoScroll?: boolean;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<AiChatConversationStrings>;\n}\n\nexport function AiChatConversation({\n\tmessages,\n\trenderMessage,\n\tintro,\n\tfooter,\n\tempty,\n\tdisableAutoScroll,\n\tclassName,\n\tstrings: stringsProp,\n}: AiChatConversationProps) {\n\tconst strings = useStrings(defaultAiChatConversationStrings, stringsProp);\n\tconst { containerRef, endRef, isAtBottom, scrollToBottom } = useAiChatScroll({\n\t\tdependency: messages.length,\n\t\tdisableAutoScroll,\n\t});\n\n\tconst isEmpty = messages.length === 0 && !intro;\n\n\treturn (\n\t\t<div className={cn('ai-chat-conversation--component relative flex h-full min-h-0 flex-col', className)}>\n\t\t\t<div\n\t\t\t\tref={containerRef}\n\t\t\t\ttabIndex={0}\n\t\t\t\taria-label={strings.transcriptAria}\n\t\t\t\tclassName={`flex-1 overflow-y-auto p-surface focus-visible:outline-none ${focusRecipes.inset}`}\n\t\t\t>\n\t\t\t\t{!!intro && <div className=\"mb-space-xl\">{intro}</div>}\n\n\t\t\t\t{isEmpty ? (\n\t\t\t\t\tempty ?? (\n\t\t\t\t\t\t<div className=\"flex h-full items-center justify-center p-surface-lg\">\n\t\t\t\t\t\t\t<Text type=\"secondary\">{strings.empty}</Text>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)\n\t\t\t\t) : (\n\t\t\t\t\t<Stack render={<ol />} gap=\"xl\" className=\"ai-chat-conversation--messages m-0 list-none p-0 font-sans\">\n\t\t\t\t\t\t{messages.map((message, idx) => {\n\t\t\t\t\t\t\tconst ctx: AiChatRenderMessageContext = {\n\t\t\t\t\t\t\t\tisLast: idx === messages.length - 1,\n\t\t\t\t\t\t\t\tindex: idx,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<li key={message.id}>{renderMessage(message, ctx)}</li>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})}\n\t\t\t\t\t</Stack>\n\t\t\t\t)}\n\n\t\t\t\t{!!footer && <div className=\"mt-space-xl\">{footer}</div>}\n\n\t\t\t\t<div ref={endRef} aria-hidden className=\"h-px\" />\n\t\t\t</div>\n\n\t\t\t{!isAtBottom && (\n\t\t\t\t<div className=\"ai-chat-conversation--jump flex shrink-0 justify-center border-t border-border/60 bg-background px-space-md py-space-sm\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\tbuttonStyle=\"solid\"\n\t\t\t\t\t\taria-label={strings.scrollToBottomAria}\n\t\t\t\t\t\tonClick={() => scrollToBottom('smooth')}\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t'shadow-sm max-sm:size-action-sm max-sm:min-h-0 max-sm:p-0',\n\t\t\t\t\t\t\t'border border-border/60',\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<ArrowDown className=\"size-icon-md\" />\n\t\t\t\t\t\t<Text tag=\"span\" size=\"pxs\" className=\"max-sm:sr-only\">\n\t\t\t\t\t\t\t{strings.scrollToBottom}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nAiChatConversation.displayName = 'AiChatConversation';\n","/**\n * AiChatEmptyState — default empty surface for `<AiChat>` when no messages\n * are present and no intro is provided. Centers a title + description with\n * an optional below-content slot for prompt-suggestion grids.\n */\nimport type { ReactNode } from 'react';\nimport { Sparkles } from 'lucide-react';\nimport { Stack } from '../../../base/structure';\nimport { EmptyState } from '../../../blocks/data-display';\nimport { cn } from '../../../../lib/utils';\n\nexport interface AiChatEmptyStateProps {\n\t/** Surface title. */\n\ttitle?: ReactNode;\n\t/** Supporting copy shown under the label. */\n\tdescription?: ReactNode;\n\t/** Leading glyph. */\n\ticon?: React.ElementType;\n\t/** Content rendered under the main body. */\n\tbelow?: ReactNode;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n}\n\nexport function AiChatEmptyState({\n\ttitle = 'Start a conversation',\n\tdescription,\n\ticon: IconComponent = Sparkles,\n\tbelow,\n\tclassName,\n}: AiChatEmptyStateProps) {\n\tconst media = <IconComponent className=\"size-icon\" aria-hidden=\"true\" />;\n\n\treturn (\n\t\t<Stack\n\t\t\tgap=\"md\"\n\t\t\talign=\"center\"\n\t\t\tjustify=\"center\"\n\t\t\tclassName={cn('ai-chat-empty-state--component min-h-full text-center', className)}\n\t\t>\n\t\t\t<EmptyState\n\t\t\t\ttitle={title}\n\t\t\t\tdescription={description ?? false}\n\t\t\t\tmedia={media}\n\t\t\t\tmediaVariant=\"icon\"\n\t\t\t\tpadding=\"md\"\n\t\t\t\tclassName=\"w-full\"\n\t\t\t/>\n\t\t\t{!!below && <div className=\"w-full max-w-2xl\">{below}</div>}\n\t\t</Stack>\n\t);\n}\n\nAiChatEmptyState.displayName = 'AiChatEmptyState';\n","/**\n * AiChatMessage — message renderer that wraps `<AiMessageBubble>` and routes\n * each `parts[]` entry to its dedicated `blocks/ai/*` surface (text, code,\n * tool calls, reasoning, sources, attachments, …).\n *\n * Most surfaces sit BELOW the bubble (artifact, sources, task) since they\n * carry their own chrome; plain text and inline citations render INSIDE the\n * bubble. Custom-typed parts call `render()` directly.\n */\nimport type { ReactNode } from 'react';\nimport { AiArtifact } from '../../../blocks/ai/ai-artifact';\nimport { AiChainOfThought } from '../../../blocks/ai/ai-chain-of-thought';\nimport { AiCodeBlock } from '../../../blocks/ai/ai-code-block';\nimport { AiConfirmation } from '../../../blocks/ai/ai-confirmation';\nimport { AiMessageBubble } from '../../../blocks/ai/ai-message-bubble';\nimport { AiReasoning } from '../../../blocks/ai/ai-reasoning';\nimport { AiShimmer } from '../../../blocks/ai/ai-shimmer';\nimport { AiSources } from '../../../blocks/ai/ai-sources';\nimport { AiTask } from '../../../blocks/ai/ai-task';\nimport { AiToolCall } from '../../../blocks/ai/ai-tool-call';\nimport { Stack } from '../../../base/structure';\nimport { Text } from '../../../typography';\nimport { useStrings, type StringsProp } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultAiChatMessageStrings,\n\ttype AiChatMessageStrings,\n} from '../ai-chat.strings';\nimport type {\n\tAiChatMessage as AiChatMessageType,\n\tAiChatMessagePart,\n} from '../ai-chat.types';\nimport { AiChatAttachmentsStrip } from './ai-chat-attachments-strip';\nimport { hasMessageMedia, messageColumns, messageContentColumn } from '../../../blocks/collaboration/message/message.recipes';\n\nexport interface AiChatMessageProps {\n\t/** The message this row represents. */\n\tmessage: AiChatMessageType;\n\t/** Copy callback forwarded to the underlying bubble. */\n\tonCopy?: () => void;\n\t/** Regenerate callback forwarded to the underlying bubble (assistant only). */\n\tonRegenerate?: () => void;\n\t/** Open handler for attachment chips inside the message. */\n\tonAttachmentOpen?: (attachmentId: string) => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<AiChatMessageStrings>;\n}\n\nexport function AiChatMessage({\n\tmessage,\n\tonCopy,\n\tonRegenerate,\n\tonAttachmentOpen,\n\tclassName,\n\tstrings: stringsProp,\n}: AiChatMessageProps) {\n\tconst strings = useStrings(defaultAiChatMessageStrings, stringsProp);\n\tconst align = message.role === 'user' ? 'end' : 'start';\n\n\t// Split parts: in-bubble (text) vs below-bubble (everything else).\n\tconst inBubble: AiChatMessagePart[] = [];\n\tconst below: AiChatMessagePart[] = [];\n\tfor (const part of message.parts) {\n\t\tif (part.type === 'text') inBubble.push(part);\n\t\telse below.push(part);\n\t}\n\n\tconst plainText =\n\t\tinBubble\n\t\t\t.map((p) => (p.type === 'text' ? p.plain ?? extractPlain(p.content) : ''))\n\t\t\t.filter(Boolean)\n\t\t\t.join('\\n') || undefined;\n\n\tconst bubbleContent: ReactNode = message.pending ? (\n\t\t<AiShimmer>{strings.pending}</AiShimmer>\n\t) : inBubble.length === 0 && below.length > 0 ? null : (\n\t\t<Stack gap=\"md\">\n\t\t\t{inBubble.map((part, idx) =>\n\t\t\t\tpart.type === 'text' ? (\n\t\t\t\t\t<div key={idx} className=\"whitespace-pre-wrap\">\n\t\t\t\t\t\t{part.content}\n\t\t\t\t\t</div>\n\t\t\t\t) : null,\n\t\t\t)}\n\t\t</Stack>\n\t);\n\tconst hasBubble = bubbleContent !== null || message.pending;\n\t// Nullish values select AiMessageBubble's default avatar; other empty nodes do not.\n\tconst hasAvatar = hasBubble && (message.avatar == null || hasMessageMedia(message.avatar));\n\tconst continuationColumn = hasAvatar ? messageContentColumn[align] : 'col-start-1';\n\n\treturn (\n\t\t<Stack gap=\"md\" className={cn('ai-chat-message--component grid min-w-0', hasAvatar ? messageColumns[align] : 'grid-cols-1', className)}>\n\t\t\t{hasBubble && (\n\t\t\t\t<AiMessageBubble\n\t\t\t\t\trole={message.role}\n\t\t\t\t\tavatar={message.avatar}\n\t\t\t\t\tauthorName={message.authorName}\n\t\t\t\t\ttimestamp={message.timestamp}\n\t\t\t\t\tplainText={plainText}\n\t\t\t\t\tloading={message.loading}\n\t\t\t\t\tclassName=\"col-span-full grid-cols-subgrid\"\n\t\t\t\t\tonCopy={plainText ? onCopy ?? (() => undefined) : undefined}\n\t\t\t\t\tonRegenerate={onRegenerate}\n\t\t\t\t>\n\t\t\t\t\t{bubbleContent}\n\t\t\t\t</AiMessageBubble>\n\t\t\t)}\n\n\t\t\t{below.length > 0 && (\n\t\t\t\t<Stack\n\t\t\t\t\tgap=\"md\"\n\t\t\t\t\tclassName={cn('ai-chat-message--parts min-w-0', continuationColumn)}\n\t\t\t\t>\n\t\t\t\t\t{below.map((part, idx) => (\n\t\t\t\t\t\t<PartRenderer\n\t\t\t\t\t\t\tkey={idx}\n\t\t\t\t\t\t\tpart={part}\n\t\t\t\t\t\t\tonAttachmentOpen={onAttachmentOpen}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\t\t\t\t</Stack>\n\t\t\t)}\n\n\t\t\t{!!message.trailing && (\n\t\t\t\t<div\n\t\t\t\t\tclassName={cn('ai-chat-message--trailing min-w-0', continuationColumn)}\n\t\t\t\t>\n\t\t\t\t\t{message.trailing}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</Stack>\n\t);\n}\n\nAiChatMessage.displayName = 'AiChatMessage';\n\nfunction PartRenderer({\n\tpart,\n\tonAttachmentOpen,\n}: {\n\tpart: AiChatMessagePart;\n\tonAttachmentOpen?: (id: string) => void;\n}) {\n\tswitch (part.type) {\n\t\tcase 'text':\n\t\t\t// In-bubble. Should not reach here.\n\t\t\treturn <Text>{part.content}</Text>;\n\t\tcase 'reasoning':\n\t\t\treturn (\n\t\t\t\t<AiReasoning\n\t\t\t\t\tstreaming={part.streaming}\n\t\t\t\t\tdurationSeconds={part.durationSeconds}\n\t\t\t\t>\n\t\t\t\t\t{part.content}\n\t\t\t\t</AiReasoning>\n\t\t\t);\n\t\tcase 'chain-of-thought':\n\t\t\treturn <AiChainOfThought steps={part.steps} streaming={part.streaming} />;\n\t\tcase 'tool':\n\t\t\treturn (\n\t\t\t\t<AiToolCall\n\t\t\t\t\tname={part.name}\n\t\t\t\t\tstatus={part.status}\n\t\t\t\t\ticon={part.icon}\n\t\t\t\t\targs={part.args}\n\t\t\t\t\tresult={part.result}\n\t\t\t\t\terror={part.error}\n\t\t\t\t\tdurationMs={part.durationMs}\n\t\t\t\t\tdefaultExpanded={part.defaultExpanded}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase 'code':\n\t\t\treturn (\n\t\t\t\t<AiCodeBlock\n\t\t\t\t\tcode={part.code}\n\t\t\t\t\tlanguage={part.language}\n\t\t\t\t\tfilename={part.filename}\n\t\t\t\t\tshowLineNumbers={part.showLineNumbers}\n\t\t\t\t\thighlightLines={part.highlightLines}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase 'attachments':\n\t\t\treturn (\n\t\t\t\t<AiChatAttachmentsStrip\n\t\t\t\t\tattachments={part.items}\n\t\t\t\t\tonOpen={onAttachmentOpen ? (att) => onAttachmentOpen(att.id) : undefined}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase 'sources':\n\t\t\treturn (\n\t\t\t\t<AiSources\n\t\t\t\t\tsources={part.items}\n\t\t\t\t\tvariant={part.variant}\n\t\t\t\t\tdefaultExpanded={part.defaultExpanded}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase 'task':\n\t\t\treturn <AiTask task={part.task} />;\n\t\tcase 'artifact':\n\t\t\treturn (\n\t\t\t\t<AiArtifact\n\t\t\t\t\ttitle={part.title}\n\t\t\t\t\tsubtitle={part.subtitle}\n\t\t\t\t\ticon={part.icon}\n\t\t\t\t\tcopyText={part.copyText}\n\t\t\t\t\tactions={part.actions}\n\t\t\t\t\tonOpen={part.onOpen}\n\t\t\t\t\tonDownload={part.onDownload}\n\t\t\t\t>\n\t\t\t\t\t{part.body}\n\t\t\t\t</AiArtifact>\n\t\t\t);\n\t\tcase 'confirmation':\n\t\t\treturn (\n\t\t\t\t<AiConfirmation\n\t\t\t\t\ttitle={part.title}\n\t\t\t\t\tdescription={part.description}\n\t\t\t\t\ttone={part.tone}\n\t\t\t\t\tstatus={part.status}\n\t\t\t\t\tdetails={part.details}\n\t\t\t\t\tonApprove={part.onApprove}\n\t\t\t\t\tonReject={part.onReject}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase 'custom':\n\t\t\treturn <>{part.render()}</>;\n\t\tdefault:\n\t\t\treturn null;\n\t}\n}\n\nfunction extractPlain(node: ReactNode): string {\n\tif (typeof node === 'string' || typeof node === 'number') return String(node);\n\tif (Array.isArray(node)) return node.map(extractPlain).join('');\n\treturn '';\n}\n","/**\n * AiChatPromptInput — multi-line composer for the chat. Carries:\n * - auto-resizing textarea\n * - staged attachment chips above the field\n * - leading actions slot (model picker, attach)\n * - submit / stop buttons (stop replaces submit while `streaming` is true)\n * - keyboard discipline: Enter to submit, Shift+Enter for newline\n *\n * Stateless: the consumer owns `value`, `attachments`, and `streaming`. The\n * component fires `onSubmit` with `{ text, attachments }` on submit.\n */\nimport { useCallback, useRef, type ReactNode } from 'react';\nimport { ArrowUp, Paperclip, Square } from 'lucide-react';\nimport { Button } from '../../../base/buttons';\nimport { Textarea } from '../../../base/text-inputs';\nimport { Text } from '../../../typography';\nimport { interpolateString, useStrings, type StringsProp } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\nimport { fieldStateRecipes } from '../../../../lib/field-state-recipes';\n\nimport {\n\tdefaultAiChatPromptInputStrings,\n\ttype AiChatPromptInputStrings,\n} from '../ai-chat.strings';\nimport type {\n\tAiChatAttachment,\n\tAiChatSubmitValues,\n} from '../ai-chat.types';\nimport { AiChatAttachmentsStrip } from './ai-chat-attachments-strip';\n\nexport interface AiChatPromptInputProps {\n\t/** Current text value (controlled). */\n\tvalue: string;\n\t/** Text change callback. */\n\tonValueChange: (value: string) => void;\n\t/** Submit callback — fires on Enter or send-button click. */\n\tonSubmit?: (values: AiChatSubmitValues) => void;\n\t/** Stop callback — wired to the stop button while `streaming`. */\n\tonStop?: () => void;\n\t/** Streaming flag — flips submit ↔ stop and disables the submit button. */\n\tstreaming?: boolean;\n\t/** Disable the entire composer (e.g. while waiting for an upload). */\n\tdisabled?: boolean;\n\t/** Staged attachments (controlled). */\n\tattachments?: ReadonlyArray<AiChatAttachment>;\n\t/** Remove a staged attachment. */\n\tonRemoveAttachment?: (id: string) => void;\n\t/** Triggered when the attach button is pressed. */\n\tonAttach?: () => void;\n\t/** Show the attach button (default: when `onAttach` is provided). */\n\tshowAttach?: boolean;\n\t/** Leading slot rendered before the attach button (typically a model picker). */\n\tleadingActions?: ReactNode;\n\t/** Trailing slot rendered before submit (custom action buttons). */\n\ttrailingActions?: ReactNode;\n\t/** Hide the keyboard hint under the field. */\n\thideHint?: boolean;\n\t/** Override the textarea minimum row count. */\n\tminRows?: number;\n\t/** Override the textarea maximum row count before scroll. */\n\tmaxRows?: number;\n\t/** Auto-focus the textarea on mount. */\n\tautoFocus?: boolean;\n\t/** Display label interpolated into the submit hint. Defaults to the neutral Enter glyph. */\n\tsubmitKeyLabel?: string;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<AiChatPromptInputStrings>;\n}\n\nexport function AiChatPromptInput({\n\tvalue,\n\tonValueChange,\n\tonSubmit,\n\tonStop,\n\tstreaming = false,\n\tdisabled = false,\n\tattachments = [],\n\tonRemoveAttachment,\n\tonAttach,\n\tshowAttach,\n\tleadingActions,\n\ttrailingActions,\n\thideHint = false,\n\tminRows = 1,\n\tmaxRows = 8,\n\tautoFocus = false,\n\tsubmitKeyLabel = '↩',\n\tclassName,\n\tstrings: stringsProp,\n}: AiChatPromptInputProps) {\n\tconst strings = useStrings(defaultAiChatPromptInputStrings, stringsProp);\n\tconst textareaRef = useRef<HTMLTextAreaElement | null>(null);\n\n\tconst canSubmit =\n\t\t!streaming && !disabled && (value.trim().length > 0 || attachments.length > 0);\n\n\tconst handleSubmit = useCallback(() => {\n\t\tif (!canSubmit) return;\n\t\tonSubmit?.({ text: value, attachments });\n\t}, [canSubmit, onSubmit, value, attachments]);\n\n\tconst handleKeyDown = useCallback(\n\t\t(e: React.KeyboardEvent<HTMLTextAreaElement>) => {\n\t\t\tif (e.key === 'Enter' && !e.shiftKey && !e.nativeEvent.isComposing) {\n\t\t\t\te.preventDefault();\n\t\t\t\thandleSubmit();\n\t\t\t}\n\t\t},\n\t\t[handleSubmit],\n\t);\n\n\tconst showAttachBtn = showAttach ?? Boolean(onAttach);\n\treturn (\n\t\t<div\n\t\t\tinert={disabled || undefined}\n\t\t\tclassName={cn(\n\t\t\t\t'ai-chat-prompt-input--component',\n\t\t\t\t'rounded-radius border border-input bg-card text-card-foreground transition-[color,box-shadow] duration-150',\n\t\t\t\t// The frame is the field: it takes the shared compound-field focus and\n\t\t\t\t// invalid states from its control, which draws no frame of its own.\n\t\t\t\tfieldStateRecipes.groupFocus,\n\t\t\t\tfieldStateRecipes.groupInvalid,\n\t\t\t\tdisabled && 'opacity-50 pointer-events-none',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t{attachments.length > 0 && (\n\t\t\t\t<div className=\"border-b border-border/60 p-surface-xs\">\n\t\t\t\t\t<AiChatAttachmentsStrip\n\t\t\t\t\t\tattachments={attachments}\n\t\t\t\t\t\tonRemove={onRemoveAttachment}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t<Textarea\n\t\t\t\tref={textareaRef}\n\t\t\t\tvalue={value}\n\t\t\t\tonChange={(e) => onValueChange(e.target.value)}\n\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\tplaceholder={strings.placeholder}\n\t\t\t\tautoResize\n\t\t\t\tminRows={minRows}\n\t\t\t\tmaxRows={maxRows}\n\t\t\t\tautoFocus={autoFocus}\n\t\t\t\tdisabled={disabled}\n\t\t\t\t// The composer frame's control, as InputGroupTextarea marks it. The\n\t\t\t\t// textarea keeps auto-resize, which InputGroupTextarea does not offer.\n\t\t\t\tdata-slot=\"input-group-control\"\n\t\t\t\tclassName=\"rounded-none border-0 bg-transparent text-inherit shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 resize-none disabled:opacity-100\"\n\t\t\t/>\n\n\t\t\t<div className=\"flex items-center gap-space-xs border-t border-border/60 px-surface-xs py-space-sm\">\n\t\t\t\t{leadingActions}\n\t\t\t\t{showAttachBtn && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\taria-label={strings.attachAria}\n\t\t\t\t\t\tclassName=\"disabled:opacity-100\"\n\t\t\t\t\t\tonClick={onAttach}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Paperclip className=\"size-icon\" />\n\t\t\t\t\t</Button>\n\t\t\t\t)}\n\t\t\t\t<div className=\"ml-auto flex items-center gap-space-xs\">\n\t\t\t\t\t{trailingActions}\n\t\t\t\t\t{streaming ? (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\tbuttonStyle=\"solid\"\n\t\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\t\taria-label={strings.stopAria}\n\t\t\t\t\t\t\tclassName=\"disabled:opacity-100\"\n\t\t\t\t\t\t\tonClick={onStop}\n\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Square className=\"size-icon-md fill-current\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\ttone=\"primary\"\n\t\t\t\t\t\t\tbuttonStyle=\"solid\"\n\t\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\t\taria-label={strings.submitAria}\n\t\t\t\t\t\t\tclassName={disabled ? 'disabled:opacity-100' : undefined}\n\t\t\t\t\t\t\tonClick={handleSubmit}\n\t\t\t\t\t\t\tdisabled={!canSubmit}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ArrowUp className=\"size-icon\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t{!hideHint && (\n\t\t\t\t<div className=\"px-surface-xs pb-surface-xs\">\n\t\t\t\t\t<Text size=\"xs\" type=\"discrete\">\n\t\t\t\t\t\t{interpolateString(strings.hint, {\n\t\t\t\t\t\t\tsubmitKey: submitKeyLabel,\n\t\t\t\t\t\t\tnewlineKey: '⇧↩',\n\t\t\t\t\t\t})}\n\t\t\t\t\t</Text>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nAiChatPromptInput.displayName = 'AiChatPromptInput';\n","/**\n * AiChatQueue — pending message queue rendered above the prompt input. Used\n * to surface messages the user submitted faster than the assistant could\n * process — each item shows a status pill and an optional cancel control.\n */\nimport { Loader2, X } from 'lucide-react';\nimport { Badge } from '../../../base/badge';\nimport { Button } from '../../../base/buttons';\nimport { Stack } from '../../../base/structure';\nimport { DisplayLabel, Text } from '../../../typography';\nimport { useStrings, type StringsProp } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultAiChatQueueStrings,\n\ttype AiChatQueueStrings,\n} from '../ai-chat.strings';\nimport type { AiChatQueueItem } from '../ai-chat.types';\nimport { dotRecipes } from '../../../../lib/tone-recipes';\n\nexport interface AiChatQueueProps {\n\t/** Entries to render. */\n\titems: ReadonlyArray<AiChatQueueItem>;\n\t/** Hides the header region. */\n\thideHeader?: boolean;\n\t/** Fired when entry editing is cancelled. */\n\tonCancel?: (id: string) => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<AiChatQueueStrings>;\n}\n\nexport function AiChatQueue({\n\titems,\n\thideHeader = false,\n\tonCancel,\n\tclassName,\n\tstrings: stringsProp,\n}: AiChatQueueProps) {\n\tconst strings = useStrings(defaultAiChatQueueStrings, stringsProp);\n\tif (items.length === 0) return null;\n\treturn (\n\t\t<Stack gap=\"sm\"\n\t\t\tclassName={cn(\n\t\t\t\t'ai-chat-queue--component',\n\t\t\t\t'rounded-radius border border-border/60 bg-muted/30 p-surface-xs',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t{!hideHeader && (\n\t\t\t\t<DisplayLabel className=\"px-1\">\n\t\t\t\t\t{strings.header} · {items.length}\n\t\t\t\t</DisplayLabel>\n\t\t\t)}\n\t\t\t<Stack render={<ul />} gap=\"xs\" className=\"ai-chat-queue--list m-0 list-none p-0 font-sans\">\n\t\t\t\t{items.map((item) => {\n\t\t\t\t\tconst status = item.status ?? 'queued';\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<li\n\t\t\t\t\t\t\tkey={item.id}\n\t\t\t\t\t\t\tclassName=\"flex items-center gap-space-md rounded-radius bg-card text-card-foreground px-space-md py-space-sm\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{status === 'running' ? (\n\t\t\t\t\t\t\t\t<Loader2 className=\"size-icon-md shrink-0 animate-spin text-primary-accent\" />\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t// The dot sits in the spinner's footprint so labels align across rows.\n\t\t\t\t\t\t\t\t<span aria-hidden className=\"flex size-icon-md shrink-0 items-center justify-center\">\n\t\t\t\t\t\t\t\t\t<span className={cn(dotRecipes.marker, 'bg-muted-foreground')} />\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<Text type=\"inherit\" className=\"flex-1 truncate\">\n\t\t\t\t\t\t\t\t{item.label}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t<Badge tone={status === 'running' ? 'info' : 'secondary'}>\n\t\t\t\t\t\t\t\t{status === 'running' ? strings.runningLabel : strings.queuedLabel}\n\t\t\t\t\t\t\t</Badge>\n\t\t\t\t\t\t\t{(!!item.onCancel || !!onCancel) && (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\t\t\t\taria-label={strings.cancelAria}\n\t\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\t\titem.onCancel?.();\n\t\t\t\t\t\t\t\t\t\tonCancel?.(item.id);\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<X className=\"size-icon-md\" />\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</li>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</Stack>\n\t\t</Stack>\n\t);\n}\n\nAiChatQueue.displayName = 'AiChatQueue';\n","/**\n * AiChatSuggestionsRow — wrapping row of small suggestion chips rendered\n * above the prompt input. Chips wrap onto further lines rather than clipping\n * at the composer edge, so every suggestion stays visible and reachable. Distinct from\n * `<AiPromptSuggestions>` (which is a card-grid of richer suggestions used\n * as a welcome surface): this is the inline, dense variant.\n */\nimport { Button } from '../../../base/buttons';\nimport { DisplayLabel, Text } from '../../../typography';\nimport { useStrings, type StringsProp } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultAiChatSuggestionsStrings,\n\ttype AiChatSuggestionsStrings,\n} from '../ai-chat.strings';\nimport type { AiChatSuggestion } from '../ai-chat.types';\n\nexport interface AiChatSuggestionsRowProps<TData = unknown> {\n\t/** Matches for the current query. */\n\tsuggestions: ReadonlyArray<AiChatSuggestion<TData>>;\n\tonPick?: (s: AiChatSuggestion<TData>) => void;\n\t/** Hides the header region. */\n\thideHeader?: boolean;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<AiChatSuggestionsStrings>;\n}\n\nexport function AiChatSuggestionsRow<TData = unknown>({\n\tsuggestions,\n\tonPick,\n\thideHeader = false,\n\tclassName,\n\tstrings: stringsProp,\n}: AiChatSuggestionsRowProps<TData>) {\n\tconst strings = useStrings(defaultAiChatSuggestionsStrings, stringsProp);\n\tif (suggestions.length === 0) return null;\n\treturn (\n\t\t<div className={cn('ai-chat-suggestions-row--component flex items-start gap-space-md', className)}>\n\t\t\t{!hideHeader && (\n\t\t\t\t// The label keeps the chips' action height so it centres on their first line.\n\t\t\t\t<DisplayLabel className=\"flex min-h-action-sm shrink-0 items-center\">\n\t\t\t\t\t{strings.header}\n\t\t\t\t</DisplayLabel>\n\t\t\t)}\n\t\t\t<div className=\"ai-chat-suggestions-row--chips flex min-w-0 flex-1 flex-wrap items-center gap-space-sm\">\n\t\t\t\t{suggestions.map((s) => {\n\t\t\t\t\tconst Icon = s.icon;\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tkey={s.id}\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\tbuttonStyle=\"outline\"\n\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\tonClick={() => onPick?.(s)}\n\t\t\t\t\t\t\tclassName=\"shrink-0 gap-space-sm\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{!!Icon && <Icon className=\"size-icon-sm text-muted-foreground\" />}\n\t\t\t\t\t\t\t{/* The label keeps the button's tight leading so the chip stays the sm action height. */}\n\t\t\t\t\t\t\t<Text tag=\"span\" weight=\"medium\" lineHeight=\"tight\">\n\t\t\t\t\t\t\t\t{s.label}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nAiChatSuggestionsRow.displayName = 'AiChatSuggestionsRow';\n","/**\n * AiChat — framework-agnostic AI chat surface. Tie-together component for\n * the `features/ai-chat/*` partials. Renders an optional agent header, the\n * scrollable conversation, an optional queue + suggestions row, and the\n * prompt input.\n *\n * Composition seams:\n * - `slots` — replace any region (header, intro, empty, queue,\n * suggestions, input, belowMessages) or per-message\n * (`renderMessage`).\n * - `strings` — deep-partial override of every default copy line\n * (prompt, conversation, queue, suggestions, message).\n * - Partials — every partial is exported individually so a consumer\n * can build a custom layout against the same data shape.\n *\n * Headless usage:\n * - The `useAiChatScroll` hook is exported for consumers building a\n * custom conversation layout while keeping auto-stick-to-bottom.\n *\n * Framework-agnostic:\n * - No router, no i18n SDK, no fetcher. Submission is a callback\n * (`onSubmit`); messages, queue, attachments are all controlled props.\n */\nimport { useCallback, useState, type ReactNode } from 'react';\nimport { AiAgent } from '../../blocks/ai/ai-agent';\nimport { Stack } from '../../base/structure';\nimport { Text } from '../../typography';\nimport { useStrings, type StringsProp } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\n\nimport {\n\tdefaultAiChatStrings,\n\ttype AiChatStrings,\n} from './ai-chat.strings';\nimport type {\n\tAiChatAgent,\n\tAiChatAttachment,\n\tAiChatMessage as AiChatMessageType,\n\tAiChatQueueItem,\n\tAiChatSlots,\n\tAiChatSubmitValues,\n\tAiChatSuggestion,\n} from './ai-chat.types';\nimport {\n\tAiChatConversation,\n\tAiChatEmptyState,\n\tAiChatMessage,\n\tAiChatPromptInput,\n\tAiChatQueue,\n\tAiChatSuggestionsRow,\n} from './partials';\n\nexport interface AiChatProps<TSuggestionData = unknown> {\n\t/** Conversation messages — order is significant. */\n\tmessages: ReadonlyArray<AiChatMessageType>;\n\n\t/** Controlled prompt input value. */\n\tinputValue: string;\n\t/** Prompt input change callback. */\n\tonInputChange: (value: string) => void;\n\t/** Fired on submit (Enter or send button). */\n\tonSubmit?: (values: AiChatSubmitValues) => void;\n\t/** Fired when the user clicks the stop button while `streaming`. */\n\tonStop?: () => void;\n\t/** Streaming flag — controls submit/stop UI in the prompt input. */\n\tstreaming?: boolean;\n\t/** Disable composer entirely. */\n\tdisabled?: boolean;\n\n\t/** Currently staged attachments. */\n\tattachments?: ReadonlyArray<AiChatAttachment>;\n\t/** Remove a staged attachment. */\n\tonRemoveAttachment?: (id: string) => void;\n\t/** Fires when the user clicks the attach button. */\n\tonAttach?: () => void;\n\t/** Toggles the attach button visibility. Defaults to `true` when `onAttach` is provided. */\n\tshowAttach?: boolean;\n\n\t/** Agent identity — drives the optional header strip. Pass `null` to hide. */\n\tagent?: AiChatAgent | null;\n\t/** Trailing slot inside the header (e.g. settings button). */\n\theaderActions?: ReactNode;\n\n\t/** Pending message queue (rendered above the input). */\n\tqueue?: ReadonlyArray<AiChatQueueItem>;\n\t/** Cancel callback — fires per-item when the queue chip's × is clicked. */\n\tonCancelQueueItem?: (id: string) => void;\n\n\t/** Inline quick suggestions (rendered above the input). */\n\tsuggestions?: ReadonlyArray<AiChatSuggestion<TSuggestionData>>;\n\t/** Suggestion select callback. */\n\tonPickSuggestion?: (s: AiChatSuggestion<TSuggestionData>) => void;\n\n\t/** Per-message copy callback. */\n\tonMessageCopy?: (message: AiChatMessageType) => void;\n\t/** Per-message regenerate callback (assistant only). */\n\tonMessageRegenerate?: (message: AiChatMessageType) => void;\n\t/** Per-message attachment open callback. */\n\tonAttachmentOpen?: (messageId: string, attachmentId: string) => void;\n\n\t/** Disable auto-stick-to-bottom in the conversation. */\n\tdisableAutoScroll?: boolean;\n\n\t/** Slot map for replacing default surfaces. */\n\tslots?: AiChatSlots;\n\t/** String overrides. */\n\tstrings?: StringsProp<AiChatStrings>;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n}\n\nexport function AiChat<TSuggestionData = unknown>({\n\tmessages,\n\tinputValue,\n\tonInputChange,\n\tonSubmit,\n\tonStop,\n\tstreaming = false,\n\tdisabled = false,\n\tattachments = [],\n\tonRemoveAttachment,\n\tonAttach,\n\tshowAttach,\n\tagent,\n\theaderActions,\n\tqueue = [],\n\tonCancelQueueItem,\n\tsuggestions = [],\n\tonPickSuggestion,\n\tonMessageCopy,\n\tonMessageRegenerate,\n\tonAttachmentOpen,\n\tdisableAutoScroll,\n\tslots,\n\tstrings: stringsProp,\n\tclassName,\n}: AiChatProps<TSuggestionData>) {\n\tconst strings = useStrings(defaultAiChatStrings, stringsProp);\n\tconst [, force] = useState(0);\n\n\tconst renderMessage = useCallback(\n\t\t(\n\t\t\tmessage: AiChatMessageType,\n\t\t\tctx: { isLast: boolean; index: number },\n\t\t): ReactNode => {\n\t\t\tif (slots?.renderMessage) {\n\t\t\t\treturn slots.renderMessage(message, ctx);\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<AiChatMessage className=\"ai-chat-message--component\"\n\t\t\t\t\tmessage={message}\n\t\t\t\t\tstrings={strings.message}\n\t\t\t\t\tonCopy={\n\t\t\t\t\t\tonMessageCopy ? () => onMessageCopy(message) : undefined\n\t\t\t\t\t}\n\t\t\t\t\tonRegenerate={\n\t\t\t\t\t\tonMessageRegenerate\n\t\t\t\t\t\t\t? () => onMessageRegenerate(message)\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t\tonAttachmentOpen={\n\t\t\t\t\t\tonAttachmentOpen\n\t\t\t\t\t\t\t? (attachmentId) => onAttachmentOpen(message.id, attachmentId)\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t);\n\t\t},\n\t\t[\n\t\t\tonAttachmentOpen,\n\t\t\tonMessageCopy,\n\t\t\tonMessageRegenerate,\n\t\t\tslots,\n\t\t\tstrings.message,\n\t\t],\n\t);\n\n\tconst Header: ReactNode =\n\t\tslots?.header ??\n\t\t(agent ? (\n\t\t\t<div className=\"border-b border-border bg-card text-card-foreground p-surface\">\n\t\t\t<Stack direction=\"horizontal\" align=\"center\" gap=\"lg\">\n\t\t\t\t<AiAgent\n\t\t\t\t\tname={agent.name}\n\t\t\t\t\ticon={agent.icon}\n\t\t\t\t\tavatar={agent.avatar}\n\t\t\t\t\tsubtitle={agent.subtitle}\n\t\t\t\t\ttone={agent.tone}\n\t\t\t\t\tstatus={agent.status}\n\t\t\t\t\tvariant=\"inline\"\n\t\t\t\t/>\n\t\t\t\t{!!headerActions && (\n\t\t\t\t\t<div className=\"ml-auto flex items-center gap-space-xs\">{headerActions}</div>\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t\t</div>\n\t\t) : null);\n\n\tconst Empty: ReactNode =\n\t\tslots?.empty ??\n\t\t(messages.length === 0 ? (\n\t\t\t<AiChatEmptyState\n\t\t\t\ttitle={strings.emptyTitle}\n\t\t\t\tdescription={strings.emptyDescription}\n\t\t\t/>\n\t\t) : null);\n\n\tconst Queue: ReactNode =\n\t\tslots?.queue ??\n\t\t(queue.length > 0 ? (\n\t\t\t<AiChatQueue\n\t\t\t\titems={queue}\n\t\t\t\tonCancel={onCancelQueueItem}\n\t\t\t\tstrings={strings.queue}\n\t\t\t/>\n\t\t) : null);\n\n\tconst Suggestions: ReactNode =\n\t\tslots?.suggestions ??\n\t\t(suggestions.length > 0 ? (\n\t\t\t<AiChatSuggestionsRow<TSuggestionData>\n\t\t\t\tsuggestions={suggestions}\n\t\t\t\tonPick={onPickSuggestion}\n\t\t\t\tstrings={strings.suggestions}\n\t\t\t/>\n\t\t) : null);\n\n\tconst Input: ReactNode =\n\t\tslots?.input ?? (\n\t\t\t<AiChatPromptInput\n\t\t\t\tvalue={inputValue}\n\t\t\t\tonValueChange={onInputChange}\n\t\t\t\tonSubmit={(values) => {\n\t\t\t\t\tonSubmit?.(values);\n\t\t\t\t\t// Force re-render so consumers that read inputValue/attachments\n\t\t\t\t\t// from controlled state see the freshly cleared values they\n\t\t\t\t\t// pushed in their onSubmit handler.\n\t\t\t\t\tforce((v) => v + 1);\n\t\t\t\t}}\n\t\t\t\tonStop={onStop}\n\t\t\t\tstreaming={streaming}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tattachments={attachments}\n\t\t\t\tonRemoveAttachment={onRemoveAttachment}\n\t\t\t\tonAttach={onAttach}\n\t\t\t\tshowAttach={showAttach}\n\t\t\t\tstrings={strings.prompt}\n\t\t\t/>\n\t\t);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\n\t\t\t\t'ai-chat--component box-border flex h-full flex-col overflow-hidden rounded-surface border border-border bg-background text-foreground',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t{Header}\n\n\t\t\t<AiChatConversation\n\t\t\t\tmessages={messages}\n\t\t\t\trenderMessage={renderMessage}\n\t\t\t\tintro={slots?.intro}\n\t\t\t\tfooter={slots?.belowMessages}\n\t\t\t\tempty={Empty}\n\t\t\t\tdisableAutoScroll={disableAutoScroll}\n\t\t\t\tstrings={strings.conversation}\n\t\t\t/>\n\n\t\t\t{(Queue || Suggestions || Input) && (\n\t\t\t\t\t<div className=\"border-t border-border bg-card text-card-foreground p-surface\">\n\t\t\t\t\t<Stack gap=\"md\">\n\t\t\t\t\t{Queue}\n\t\t\t\t\t{Suggestions}\n\t\t\t\t\t{Input}\n\t\t\t\t\t</Stack>\n\t\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t{disabled && (\n\t\t\t\t<Text className=\"sr-only\" aria-live=\"polite\">\n\t\t\t\t\t{strings.disabledAnnouncement}\n\t\t\t\t</Text>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nAiChat.displayName = 'AiChat';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAsBA,IAAa0B,IAA4D;CACxE,aAAa;CACb,YAAY;CACZ,YAAY;CACZ,UAAU;CACV,iBAAiB;CACjB,MAAM;AACP,GAUaC,IAA8D;CAC1E,gBAAgB;CAChB,OAAO;CACP,gBAAgB;CAChB,oBAAoB;AACrB,GASaC,IAAgD;CAC5D,QAAQ;CACR,YAAY;CACZ,aAAa;CACb,cAAc;AACf,GAMaC,IAA4D,EACxE,QAAQ,MACT,GAMaC,IAAoD,EAChE,SAAS,YACV,GAcaC,IAAsC;CAClD,QAAQL;CACR,cAAcC;CACd,OAAOC;CACP,aAAaC;CACb,SAASC;CACT,YAAY;CACZ,kBAAkB;CAClB,sBAAsB;AACvB;;;AC3EA,SAAgBE,EAAuB,EACtC,gBACA,aACA,WACA,gBAC+B;CAE/B,OADIC,EAAY,WAAW,IAAU,OAEpC,kBAAC3B,GAAD;EACC,WAAU;EACV,KAAI;EACJ,WAAWL,EAAG,wCAAwCiC,CAAS;EA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AAK,WAAU;IACf,UAAA,kBAACzI,GAAD;KAAO,KAAI;KAAX,UAAA;MACCoI;MACAG;MACAE;KACM;;GACF,CAAA;GAGNhD,KACA,kBAAC5F,GAAD;IAAM,WAAU;IAAU,aAAU;IAClC,UAAAsD,EAAQ;GACJ,CAAA;EAEH;;AAEP;AAEA,GAAO,cAAc"}
1
+ {"version":3,"file":"ai-chat.js","names":["_Fragment","cn","Button","Text","DisplayLabel","focusRecipes","Stack","dotRecipes","Badge","fieldStateRecipes","EmptyState","messageColumns","messageContentColumn","hasMessageMedia","AiMessageBubble","AiChainOfThought","AiToolCall","AiConfirmation","AiAttachment","AiSources","AiAgent","AiTask","AiReasoning","AiArtifact","AiShimmer","Fragment$1","defaultAiChatPromptInputStrings","defaultAiChatConversationStrings","defaultAiChatQueueStrings","defaultAiChatSuggestionsStrings","defaultAiChatMessageStrings","defaultAiChatStrings","AiChatAttachmentsStrip","attachments","className","att","onOpen","onRemove","useAiChatScroll","containerRef","useRef","endRef","pinned","isAtBottom","setIsAtBottom","useState","scrollToBottom","useCallback","viewport","readPosition","distance","threshold","useEffect","id","disableAutoScroll","dependency","AiChatConversation","stringsProp","strings","useStrings","messages","isEmpty","intro","empty","ctx","idx","renderMessage","message","footer","ArrowDown","AiChatEmptyState","IconComponent","Sparkles","media","description","below","AiChatMessage","align","inBubble","part","plainText","p","extractPlain","bubbleContent","hasBubble","hasAvatar","continuationColumn","onCopy","PartRenderer","AiCodeBlock","onAttachmentOpen","node","AiChatPromptInput","textareaRef","canSubmit","streaming","disabled","value","handleSubmit","onSubmit","handleKeyDown","showAttachBtn","showAttach","onAttach","onRemoveAttachment","Textarea","onValueChange","leadingActions","Paperclip","trailingActions","onStop","Square","ArrowUp","hideHint","interpolateString","submitKeyLabel","AiChatQueue","items","hideHeader","status","item","Loader2","onCancel","X","AiChatSuggestionsRow","suggestions","Icon","s","onPick","AiChat","force","slots","onMessageCopy","onMessageRegenerate","attachmentId","Header","agent","headerActions","Empty","Queue","queue","onCancelQueueItem","Suggestions","onPickSuggestion","Input","inputValue","onInputChange","values","v"],"sources":["../../src/components/features/ai-chat/ai-chat.strings.ts","../../src/components/features/ai-chat/partials/ai-chat-attachments-strip.tsx","../../src/components/features/ai-chat/hooks/use-ai-chat-scroll.ts","../../src/components/features/ai-chat/partials/ai-chat-conversation.tsx","../../src/components/features/ai-chat/partials/ai-chat-empty-state.tsx","../../src/components/features/ai-chat/partials/ai-chat-message.tsx","../../src/components/features/ai-chat/partials/ai-chat-prompt-input.tsx","../../src/components/features/ai-chat/partials/ai-chat-queue.tsx","../../src/components/features/ai-chat/partials/ai-chat-suggestions-row.tsx","../../src/components/features/ai-chat/ai-chat.tsx"],"sourcesContent":["/**\n * Strings for `<AiChat>` and its partials. Each interface is co-located so\n * partials and the feature root all read from one source of truth (rule 19).\n * Consumers override via the `strings` prop on the relevant component; values\n * are deep-merged over the defaults so partial overrides are safe.\n */\n\nexport interface AiChatPromptInputStrings {\n\t/** Placeholder copy for the textarea. */\n\tplaceholder: string;\n\t/** Aria label for the attach button. */\n\tattachAria: string;\n\t/** Aria label for the submit button. */\n\tsubmitAria: string;\n\t/** Aria label for the stop button (replaces submit while streaming). */\n\tstopAria: string;\n\t/** Aria label for the model picker button (when `modelPicker` is provided). */\n\tmodelPickerAria: string;\n\t/** Hint shown under the input. Supports `{{key}}` for the submit shortcut. */\n\thint: string;\n}\n\nexport const defaultAiChatPromptInputStrings: AiChatPromptInputStrings = {\n\tplaceholder: 'Ask anything…',\n\tattachAria: 'Attach files',\n\tsubmitAria: 'Send message',\n\tstopAria: 'Stop generating',\n\tmodelPickerAria: 'Choose model',\n\thint: 'Press {{submitKey}} to send · {{newlineKey}} for newline',\n};\n\nexport interface AiChatConversationStrings {\n\ttranscriptAria: string;\n\t/** Shown in place of the collection when it has no entries. */\n\tempty: string;\n\tscrollToBottom: string;\n\tscrollToBottomAria: string;\n}\n\nexport const defaultAiChatConversationStrings: AiChatConversationStrings = {\n\ttranscriptAria: 'Conversation messages',\n\tempty: 'No messages yet.',\n\tscrollToBottom: 'Jump to latest',\n\tscrollToBottomAria: 'Scroll to bottom',\n};\n\nexport interface AiChatQueueStrings {\n\theader: string;\n\tcancelAria: string;\n\tqueuedLabel: string;\n\trunningLabel: string;\n}\n\nexport const defaultAiChatQueueStrings: AiChatQueueStrings = {\n\theader: 'In queue',\n\tcancelAria: 'Remove from queue',\n\tqueuedLabel: 'Queued',\n\trunningLabel: 'Running',\n};\n\nexport interface AiChatSuggestionsStrings {\n\theader: string;\n}\n\nexport const defaultAiChatSuggestionsStrings: AiChatSuggestionsStrings = {\n\theader: 'Try',\n};\n\nexport interface AiChatMessageStrings {\n\tpending: string;\n}\n\nexport const defaultAiChatMessageStrings: AiChatMessageStrings = {\n\tpending: 'Thinking…',\n};\n\nexport interface AiChatStrings {\n\tprompt: AiChatPromptInputStrings;\n\tconversation: AiChatConversationStrings;\n\tqueue: AiChatQueueStrings;\n\tsuggestions: AiChatSuggestionsStrings;\n\tmessage: AiChatMessageStrings;\n\temptyTitle: string;\n\temptyDescription: string;\n\t/** Screen-reader announcement emitted while the composer is disabled. */\n\tdisabledAnnouncement: string;\n}\n\nexport const defaultAiChatStrings: AiChatStrings = {\n\tprompt: defaultAiChatPromptInputStrings,\n\tconversation: defaultAiChatConversationStrings,\n\tqueue: defaultAiChatQueueStrings,\n\tsuggestions: defaultAiChatSuggestionsStrings,\n\tmessage: defaultAiChatMessageStrings,\n\temptyTitle: 'Start a conversation',\n\temptyDescription: 'Ask a question, share context, or attach a file to get going.',\n\tdisabledAnnouncement: 'Chat is disabled',\n};\n","/**\n * AiChatAttachmentsStrip — flex-wrap row of `<AiAttachment>` chips. Used both\n * in the prompt input (staged uploads — pass `onRemove` to enable a remove\n * button) and inside messages (read-only attachment list).\n */\nimport { AiAttachment } from '../../../blocks/ai/ai-attachment';\nimport { Stack } from '../../../base/structure';\nimport { cn } from '../../../../lib/utils';\n\nimport type { AiChatAttachment } from '../ai-chat.types';\n\nexport interface AiChatAttachmentsStripProps {\n\t/** Files staged on the draft. */\n\tattachments: ReadonlyArray<AiChatAttachment>;\n\t/** When set, each chip gets a remove button wired to this handler. */\n\tonRemove?: (id: string) => void;\n\t/** When set, click on a chip calls this. */\n\tonOpen?: (att: AiChatAttachment) => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n}\n\nexport function AiChatAttachmentsStrip({\n\tattachments,\n\tonRemove,\n\tonOpen,\n\tclassName,\n}: AiChatAttachmentsStripProps) {\n\tif (attachments.length === 0) return null;\n\treturn (\n\t\t<Stack\n\t\t\tdirection=\"horizontal\"\n\t\t\tgap=\"sm\"\n\t\t\tclassName={cn('ai-chat-attachments-strip--component', className)}\n\t\t>\n\t\t\t{attachments.map((att) => (\n\t\t\t\t<AiAttachment\n\t\t\t\t\tkey={att.id}\n\t\t\t\t\tname={att.name}\n\t\t\t\t\tmeta={att.meta}\n\t\t\t\t\tkind={att.kind}\n\t\t\t\t\ticon={att.icon}\n\t\t\t\t\tthumbnailUrl={att.thumbnailUrl}\n\t\t\t\t\tprogress={att.progress}\n\t\t\t\t\terrored={att.errored}\n\t\t\t\t\tonOpen={onOpen ? () => onOpen(att) : undefined}\n\t\t\t\t\tonRemove={onRemove ? () => onRemove(att.id) : undefined}\n\t\t\t\t/>\n\t\t\t))}\n\t\t</Stack>\n\t);\n}\n\nAiChatAttachmentsStrip.displayName = 'AiChatAttachmentsStrip';\n","/**\n * useAiChatScroll — auto-stick-to-bottom scroll behaviour for chat\n * conversations. Detects when the user has scrolled away from the latest\n * message and pauses auto-scroll until they return.\n *\n * Returns:\n * - `containerRef` — attach to the scroll viewport.\n * - `endRef` — attach to a sentinel at the very bottom.\n * - `isAtBottom` — true when the viewport is pinned to the latest content.\n * - `scrollToBottom` — imperatively scroll the viewport to its end.\n */\nimport { useCallback, useEffect, useRef, useState } from 'react';\n\nexport interface UseAiChatScrollOptions {\n\t/** Distance (px) from bottom counted as \"at bottom\". */\n\tthreshold?: number;\n\t/** Re-evaluate when content changes, including updates to existing messages. */\n\tdependency?: unknown;\n\t/** Disable auto-scroll-on-update behaviour. */\n\tdisableAutoScroll?: boolean;\n}\n\nexport interface UseAiChatScrollReturn {\n\tcontainerRef: React.RefObject<HTMLDivElement | null>;\n\tendRef: React.RefObject<HTMLDivElement | null>;\n\tisAtBottom: boolean;\n\tscrollToBottom: (behavior?: ScrollBehavior) => void;\n}\n\nexport function useAiChatScroll({\n\tthreshold = 80,\n\tdependency,\n\tdisableAutoScroll = false,\n}: UseAiChatScrollOptions = {}): UseAiChatScrollReturn {\n\tconst containerRef = useRef<HTMLDivElement | null>(null);\n\tconst endRef = useRef<HTMLDivElement | null>(null);\n\tconst pinned = useRef(true);\n\tconst [isAtBottom, setIsAtBottom] = useState(true);\n\n\tconst scrollToBottom = useCallback(\n\t\t(behavior: ScrollBehavior = 'smooth') => {\n\t\t\tconst viewport = containerRef.current;\n\t\t\tif (viewport) {\n\t\t\t\tviewport.scrollTo({ top: viewport.scrollHeight, behavior });\n\t\t\t} else {\n\t\t\t\tendRef.current?.scrollIntoView({ behavior, block: 'end' });\n\t\t\t}\n\t\t},\n\t\t[],\n\t);\n\n\tconst readPosition = useCallback(() => {\n\t\tconst viewport = containerRef.current;\n\t\tif (!viewport) return;\n\t\tconst distance = viewport.scrollHeight - viewport.clientHeight - viewport.scrollTop;\n\t\tpinned.current = distance <= threshold;\n\t\tsetIsAtBottom(pinned.current);\n\t}, [threshold]);\n\n\t// Track scroll position so we can pause auto-scroll when the user reads up.\n\tuseEffect(() => {\n\t\tconst viewport = containerRef.current;\n\t\tif (!viewport) return;\n\t\tviewport.addEventListener('scroll', readPosition, { passive: true });\n\t\treturn () => viewport.removeEventListener('scroll', readPosition);\n\t}, [readPosition]);\n\n\tuseEffect(() => {\n\t\tconst id = window.requestAnimationFrame(() => {\n\t\t\tconst viewport = containerRef.current;\n\t\t\tconst canScroll = !viewport || viewport.scrollHeight - viewport.clientHeight > viewport.scrollTop;\n\t\t\tif (canScroll && !disableAutoScroll && pinned.current) scrollToBottom('auto');\n\t\t\treadPosition();\n\t\t});\n\t\treturn () => window.cancelAnimationFrame(id);\n\t}, [dependency, disableAutoScroll, readPosition, scrollToBottom]);\n\n\treturn { containerRef, endRef, isAtBottom, scrollToBottom };\n}\n","/**\n * AiChatConversation — scrollable list container for chat messages with\n * auto-stick-to-bottom behaviour. Renders each message via the consumer's\n * `renderMessage` slot (or the default `<AiChatMessage>` via the parent\n * `<AiChat>`). Surfaces a \"Jump to latest\" pill when the user scrolls away\n * from the bottom while content streams in.\n */\nimport { ArrowDown } from 'lucide-react';\nimport type { ReactNode } from 'react';\nimport { Button } from '../../../base/buttons';\nimport { Stack } from '../../../base/structure';\nimport { Text } from '../../../typography';\nimport { useStrings, type StringsProp } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultAiChatConversationStrings,\n\ttype AiChatConversationStrings,\n} from '../ai-chat.strings';\nimport type {\n\tAiChatMessage as AiChatMessageType,\n\tAiChatRenderMessageContext,\n} from '../ai-chat.types';\nimport { useAiChatScroll } from '../hooks/use-ai-chat-scroll';\nimport { focusRecipes } from '../../../../lib/focus-recipes';\n\nexport interface AiChatConversationProps {\n\t/** Messages to render, oldest first. */\n\tmessages: ReadonlyArray<AiChatMessageType>;\n\t/** Replaces the default message rendering. */\n\trenderMessage: (\n\t\t/** The message this row represents. */\n\t\tmessage: AiChatMessageType,\n\t\tctx: AiChatRenderMessageContext,\n\t) => ReactNode;\n\t/** Render before the messages list (intro card, agent greeting). */\n\tintro?: ReactNode;\n\t/** Render after the messages list (e.g. tip ribbon). */\n\tfooter?: ReactNode;\n\t/** Replaces the empty state when `messages.length === 0`. */\n\tempty?: ReactNode;\n\t/** Pause auto-scroll-on-update. */\n\tdisableAutoScroll?: boolean;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<AiChatConversationStrings>;\n}\n\nexport function AiChatConversation({\n\tmessages,\n\trenderMessage,\n\tintro,\n\tfooter,\n\tempty,\n\tdisableAutoScroll,\n\tclassName,\n\tstrings: stringsProp,\n}: AiChatConversationProps) {\n\tconst strings = useStrings(defaultAiChatConversationStrings, stringsProp);\n\tconst { containerRef, endRef, isAtBottom, scrollToBottom } = useAiChatScroll({\n\t\tdependency: messages,\n\t\tdisableAutoScroll,\n\t});\n\n\tconst isEmpty = messages.length === 0 && !intro;\n\n\treturn (\n\t\t<div className={cn('ai-chat-conversation--component relative flex h-full min-h-0 flex-col', className)}>\n\t\t\t<div\n\t\t\t\tref={containerRef}\n\t\t\t\ttabIndex={0}\n\t\t\t\taria-label={strings.transcriptAria}\n\t\t\t\tclassName={`flex-1 overflow-y-auto p-surface focus-visible:outline-none ${focusRecipes.inset}`}\n\t\t\t>\n\t\t\t\t{!!intro && <div className=\"mb-space-xl\">{intro}</div>}\n\n\t\t\t\t{isEmpty ? (\n\t\t\t\t\tempty ?? (\n\t\t\t\t\t\t<div className=\"flex h-full items-center justify-center p-surface-lg\">\n\t\t\t\t\t\t\t<Text type=\"secondary\">{strings.empty}</Text>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)\n\t\t\t\t) : (\n\t\t\t\t\t<Stack render={<ol />} gap=\"xl\" className=\"ai-chat-conversation--messages m-0 list-none p-0 font-sans\">\n\t\t\t\t\t\t{messages.map((message, idx) => {\n\t\t\t\t\t\t\tconst ctx: AiChatRenderMessageContext = {\n\t\t\t\t\t\t\t\tisLast: idx === messages.length - 1,\n\t\t\t\t\t\t\t\tindex: idx,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<li key={message.id}>{renderMessage(message, ctx)}</li>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})}\n\t\t\t\t\t</Stack>\n\t\t\t\t)}\n\n\t\t\t\t{!!footer && <div className=\"mt-space-xl\">{footer}</div>}\n\n\t\t\t\t<div ref={endRef} aria-hidden className=\"h-px\" />\n\t\t\t</div>\n\n\t\t\t{!isAtBottom && (\n\t\t\t\t<div className=\"ai-chat-conversation--jump flex shrink-0 justify-center border-t border-border/60 bg-background px-space-md py-space-sm\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\tbuttonStyle=\"solid\"\n\t\t\t\t\t\taria-label={strings.scrollToBottomAria}\n\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\tcontainerRef.current?.focus({ preventScroll: true });\n\t\t\t\t\t\t\tscrollToBottom();\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t'shadow-sm max-sm:size-action-sm max-sm:min-h-0 max-sm:p-0',\n\t\t\t\t\t\t\t'border border-border/60',\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<ArrowDown className=\"size-icon-md\" />\n\t\t\t\t\t\t<Text tag=\"span\" size=\"pxs\" className=\"max-sm:sr-only\">\n\t\t\t\t\t\t\t{strings.scrollToBottom}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nAiChatConversation.displayName = 'AiChatConversation';\n","/**\n * AiChatEmptyState — default empty surface for `<AiChat>` when no messages\n * are present and no intro is provided. Centers a title + description with\n * an optional below-content slot for prompt-suggestion grids.\n */\nimport type { ReactNode } from 'react';\nimport { Sparkles } from 'lucide-react';\nimport { Stack } from '../../../base/structure';\nimport { EmptyState } from '../../../blocks/data-display';\nimport { cn } from '../../../../lib/utils';\n\nexport interface AiChatEmptyStateProps {\n\t/** Surface title. */\n\ttitle?: ReactNode;\n\t/** Supporting copy shown under the label. */\n\tdescription?: ReactNode;\n\t/** Leading glyph. */\n\ticon?: React.ElementType;\n\t/** Content rendered under the main body. */\n\tbelow?: ReactNode;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n}\n\nexport function AiChatEmptyState({\n\ttitle = 'Start a conversation',\n\tdescription,\n\ticon: IconComponent = Sparkles,\n\tbelow,\n\tclassName,\n}: AiChatEmptyStateProps) {\n\tconst media = <IconComponent className=\"size-icon\" aria-hidden=\"true\" />;\n\n\treturn (\n\t\t<Stack\n\t\t\tgap=\"md\"\n\t\t\talign=\"center\"\n\t\t\tjustify=\"center\"\n\t\t\tclassName={cn('ai-chat-empty-state--component min-h-full text-center', className)}\n\t\t>\n\t\t\t<EmptyState\n\t\t\t\ttitle={title}\n\t\t\t\tdescription={description ?? false}\n\t\t\t\tmedia={media}\n\t\t\t\tmediaVariant=\"icon\"\n\t\t\t\tpadding=\"md\"\n\t\t\t\tclassName=\"w-full\"\n\t\t\t/>\n\t\t\t{!!below && <div className=\"w-full max-w-2xl\">{below}</div>}\n\t\t</Stack>\n\t);\n}\n\nAiChatEmptyState.displayName = 'AiChatEmptyState';\n","/**\n * AiChatMessage — message renderer that wraps `<AiMessageBubble>` and routes\n * each `parts[]` entry to its dedicated `blocks/ai/*` surface (text, code,\n * tool calls, reasoning, sources, attachments, …).\n *\n * Most surfaces sit BELOW the bubble (artifact, sources, task) since they\n * carry their own chrome; plain text and inline citations render INSIDE the\n * bubble. Custom-typed parts call `render()` directly.\n */\nimport type { ReactNode } from 'react';\nimport { AiArtifact } from '../../../blocks/ai/ai-artifact';\nimport { AiChainOfThought } from '../../../blocks/ai/ai-chain-of-thought';\nimport { AiCodeBlock } from '../../../blocks/ai/ai-code-block';\nimport { AiConfirmation } from '../../../blocks/ai/ai-confirmation';\nimport { AiMessageBubble } from '../../../blocks/ai/ai-message-bubble';\nimport { AiReasoning } from '../../../blocks/ai/ai-reasoning';\nimport { AiShimmer } from '../../../blocks/ai/ai-shimmer';\nimport { AiSources } from '../../../blocks/ai/ai-sources';\nimport { AiTask } from '../../../blocks/ai/ai-task';\nimport { AiToolCall } from '../../../blocks/ai/ai-tool-call';\nimport { Stack } from '../../../base/structure';\nimport { Text } from '../../../typography';\nimport { useStrings, type StringsProp } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultAiChatMessageStrings,\n\ttype AiChatMessageStrings,\n} from '../ai-chat.strings';\nimport type {\n\tAiChatMessage as AiChatMessageType,\n\tAiChatMessagePart,\n} from '../ai-chat.types';\nimport { AiChatAttachmentsStrip } from './ai-chat-attachments-strip';\nimport { hasMessageMedia, messageColumns, messageContentColumn } from '../../../blocks/collaboration/message/message.recipes';\n\nexport interface AiChatMessageProps {\n\t/** The message this row represents. */\n\tmessage: AiChatMessageType;\n\t/** Copy callback forwarded to the underlying bubble. */\n\tonCopy?: () => void;\n\t/** Regenerate callback forwarded to the underlying bubble (assistant only). */\n\tonRegenerate?: () => void;\n\t/** Open handler for attachment chips inside the message. */\n\tonAttachmentOpen?: (attachmentId: string) => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<AiChatMessageStrings>;\n}\n\nexport function AiChatMessage({\n\tmessage,\n\tonCopy,\n\tonRegenerate,\n\tonAttachmentOpen,\n\tclassName,\n\tstrings: stringsProp,\n}: AiChatMessageProps) {\n\tconst strings = useStrings(defaultAiChatMessageStrings, stringsProp);\n\tconst align = message.role === 'user' ? 'end' : 'start';\n\n\t// Split parts: in-bubble (text) vs below-bubble (everything else).\n\tconst inBubble: AiChatMessagePart[] = [];\n\tconst below: AiChatMessagePart[] = [];\n\tfor (const part of message.parts) {\n\t\tif (part.type === 'text') inBubble.push(part);\n\t\telse below.push(part);\n\t}\n\n\tconst plainText =\n\t\tinBubble\n\t\t\t.map((p) => (p.type === 'text' ? p.plain ?? extractPlain(p.content) : ''))\n\t\t\t.filter(Boolean)\n\t\t\t.join('\\n') || undefined;\n\n\tconst bubbleContent: ReactNode = message.pending ? (\n\t\t<AiShimmer>{strings.pending}</AiShimmer>\n\t) : inBubble.length === 0 && below.length > 0 ? null : (\n\t\t<Stack gap=\"md\">\n\t\t\t{inBubble.map((part, idx) =>\n\t\t\t\tpart.type === 'text' ? (\n\t\t\t\t\t<div key={idx} className=\"whitespace-pre-wrap\">\n\t\t\t\t\t\t{part.content}\n\t\t\t\t\t</div>\n\t\t\t\t) : null,\n\t\t\t)}\n\t\t</Stack>\n\t);\n\tconst hasBubble = bubbleContent !== null || message.pending;\n\t// Nullish values select AiMessageBubble's default avatar; other empty nodes do not.\n\tconst hasAvatar = hasBubble && (message.avatar == null || hasMessageMedia(message.avatar));\n\tconst continuationColumn = hasAvatar ? messageContentColumn[align] : 'col-start-1';\n\n\treturn (\n\t\t<Stack gap=\"md\" className={cn('ai-chat-message--component grid min-w-0', hasAvatar ? messageColumns[align] : 'grid-cols-1', className)}>\n\t\t\t{hasBubble && (\n\t\t\t\t<AiMessageBubble\n\t\t\t\t\trole={message.role}\n\t\t\t\t\tavatar={message.avatar}\n\t\t\t\t\tauthorName={message.authorName}\n\t\t\t\t\ttimestamp={message.timestamp}\n\t\t\t\t\tplainText={plainText}\n\t\t\t\t\tloading={message.loading}\n\t\t\t\t\tclassName=\"col-span-full grid-cols-subgrid\"\n\t\t\t\t\tonCopy={plainText ? onCopy ?? (() => undefined) : undefined}\n\t\t\t\t\tonRegenerate={onRegenerate}\n\t\t\t\t>\n\t\t\t\t\t{bubbleContent}\n\t\t\t\t</AiMessageBubble>\n\t\t\t)}\n\n\t\t\t{below.length > 0 && (\n\t\t\t\t<Stack\n\t\t\t\t\tgap=\"md\"\n\t\t\t\t\tclassName={cn('ai-chat-message--parts min-w-0', continuationColumn)}\n\t\t\t\t>\n\t\t\t\t\t{below.map((part, idx) => (\n\t\t\t\t\t\t<PartRenderer\n\t\t\t\t\t\t\tkey={idx}\n\t\t\t\t\t\t\tpart={part}\n\t\t\t\t\t\t\tonAttachmentOpen={onAttachmentOpen}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\t\t\t\t</Stack>\n\t\t\t)}\n\n\t\t\t{!!message.trailing && (\n\t\t\t\t<div\n\t\t\t\t\tclassName={cn('ai-chat-message--trailing min-w-0', continuationColumn)}\n\t\t\t\t>\n\t\t\t\t\t{message.trailing}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</Stack>\n\t);\n}\n\nAiChatMessage.displayName = 'AiChatMessage';\n\nfunction PartRenderer({\n\tpart,\n\tonAttachmentOpen,\n}: {\n\tpart: AiChatMessagePart;\n\tonAttachmentOpen?: (id: string) => void;\n}) {\n\tswitch (part.type) {\n\t\tcase 'text':\n\t\t\t// In-bubble. Should not reach here.\n\t\t\treturn <Text>{part.content}</Text>;\n\t\tcase 'reasoning':\n\t\t\treturn (\n\t\t\t\t<AiReasoning\n\t\t\t\t\tstreaming={part.streaming}\n\t\t\t\t\tdurationSeconds={part.durationSeconds}\n\t\t\t\t>\n\t\t\t\t\t{part.content}\n\t\t\t\t</AiReasoning>\n\t\t\t);\n\t\tcase 'chain-of-thought':\n\t\t\treturn <AiChainOfThought steps={part.steps} streaming={part.streaming} />;\n\t\tcase 'tool':\n\t\t\treturn (\n\t\t\t\t<AiToolCall\n\t\t\t\t\tname={part.name}\n\t\t\t\t\tstatus={part.status}\n\t\t\t\t\ticon={part.icon}\n\t\t\t\t\targs={part.args}\n\t\t\t\t\tresult={part.result}\n\t\t\t\t\terror={part.error}\n\t\t\t\t\tdurationMs={part.durationMs}\n\t\t\t\t\tdefaultExpanded={part.defaultExpanded}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase 'code':\n\t\t\treturn (\n\t\t\t\t<AiCodeBlock\n\t\t\t\t\tcode={part.code}\n\t\t\t\t\tlanguage={part.language}\n\t\t\t\t\tfilename={part.filename}\n\t\t\t\t\tshowLineNumbers={part.showLineNumbers}\n\t\t\t\t\thighlightLines={part.highlightLines}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase 'attachments':\n\t\t\treturn (\n\t\t\t\t<AiChatAttachmentsStrip\n\t\t\t\t\tattachments={part.items}\n\t\t\t\t\tonOpen={onAttachmentOpen ? (att) => onAttachmentOpen(att.id) : undefined}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase 'sources':\n\t\t\treturn (\n\t\t\t\t<AiSources\n\t\t\t\t\tsources={part.items}\n\t\t\t\t\tvariant={part.variant}\n\t\t\t\t\tdefaultExpanded={part.defaultExpanded}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase 'task':\n\t\t\treturn <AiTask task={part.task} />;\n\t\tcase 'artifact':\n\t\t\treturn (\n\t\t\t\t<AiArtifact\n\t\t\t\t\ttitle={part.title}\n\t\t\t\t\tsubtitle={part.subtitle}\n\t\t\t\t\ticon={part.icon}\n\t\t\t\t\tcopyText={part.copyText}\n\t\t\t\t\tactions={part.actions}\n\t\t\t\t\tonOpen={part.onOpen}\n\t\t\t\t\tonDownload={part.onDownload}\n\t\t\t\t>\n\t\t\t\t\t{part.body}\n\t\t\t\t</AiArtifact>\n\t\t\t);\n\t\tcase 'confirmation':\n\t\t\treturn (\n\t\t\t\t<AiConfirmation\n\t\t\t\t\ttitle={part.title}\n\t\t\t\t\tdescription={part.description}\n\t\t\t\t\ttone={part.tone}\n\t\t\t\t\tstatus={part.status}\n\t\t\t\t\tdetails={part.details}\n\t\t\t\t\tonApprove={part.onApprove}\n\t\t\t\t\tonReject={part.onReject}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase 'custom':\n\t\t\treturn <>{part.render()}</>;\n\t\tdefault:\n\t\t\treturn null;\n\t}\n}\n\nfunction extractPlain(node: ReactNode): string {\n\tif (typeof node === 'string' || typeof node === 'number') return String(node);\n\tif (Array.isArray(node)) return node.map(extractPlain).join('');\n\treturn '';\n}\n","/**\n * AiChatPromptInput — multi-line composer for the chat. Carries:\n * - auto-resizing textarea\n * - staged attachment chips above the field\n * - leading actions slot (model picker, attach)\n * - submit / stop buttons (stop replaces submit while `streaming` is true)\n * - keyboard discipline: Enter to submit, Shift+Enter for newline\n *\n * Stateless: the consumer owns `value`, `attachments`, and `streaming`. The\n * component fires `onSubmit` with `{ text, attachments }` on submit.\n */\nimport { useCallback, useRef, type ReactNode } from 'react';\nimport { ArrowUp, Paperclip, Square } from 'lucide-react';\nimport { Button } from '../../../base/buttons';\nimport { Textarea } from '../../../base/text-inputs';\nimport { Text } from '../../../typography';\nimport { interpolateString, useStrings, type StringsProp } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\nimport { fieldStateRecipes } from '../../../../lib/field-state-recipes';\n\nimport {\n\tdefaultAiChatPromptInputStrings,\n\ttype AiChatPromptInputStrings,\n} from '../ai-chat.strings';\nimport type {\n\tAiChatAttachment,\n\tAiChatSubmitValues,\n} from '../ai-chat.types';\nimport { AiChatAttachmentsStrip } from './ai-chat-attachments-strip';\n\nexport interface AiChatPromptInputProps {\n\t/** Current text value (controlled). */\n\tvalue: string;\n\t/** Text change callback. */\n\tonValueChange: (value: string) => void;\n\t/** Submit callback — fires on Enter or send-button click. */\n\tonSubmit?: (values: AiChatSubmitValues) => void;\n\t/** Stop callback — wired to the stop button while `streaming`. */\n\tonStop?: () => void;\n\t/** Streaming flag — flips submit ↔ stop and disables the submit button. */\n\tstreaming?: boolean;\n\t/** Disable the entire composer (e.g. while waiting for an upload). */\n\tdisabled?: boolean;\n\t/** Staged attachments (controlled). */\n\tattachments?: ReadonlyArray<AiChatAttachment>;\n\t/** Remove a staged attachment. */\n\tonRemoveAttachment?: (id: string) => void;\n\t/** Triggered when the attach button is pressed. */\n\tonAttach?: () => void;\n\t/** Show the attach button (default: when `onAttach` is provided). */\n\tshowAttach?: boolean;\n\t/** Leading slot rendered before the attach button (typically a model picker). */\n\tleadingActions?: ReactNode;\n\t/** Trailing slot rendered before submit (custom action buttons). */\n\ttrailingActions?: ReactNode;\n\t/** Hide the keyboard hint under the field. */\n\thideHint?: boolean;\n\t/** Override the textarea minimum row count. */\n\tminRows?: number;\n\t/** Override the textarea maximum row count before scroll. */\n\tmaxRows?: number;\n\t/** Auto-focus the textarea on mount. */\n\tautoFocus?: boolean;\n\t/** Display label interpolated into the submit hint. Defaults to the neutral Enter glyph. */\n\tsubmitKeyLabel?: string;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<AiChatPromptInputStrings>;\n}\n\nexport function AiChatPromptInput({\n\tvalue,\n\tonValueChange,\n\tonSubmit,\n\tonStop,\n\tstreaming = false,\n\tdisabled = false,\n\tattachments = [],\n\tonRemoveAttachment,\n\tonAttach,\n\tshowAttach,\n\tleadingActions,\n\ttrailingActions,\n\thideHint = false,\n\tminRows = 1,\n\tmaxRows = 8,\n\tautoFocus = false,\n\tsubmitKeyLabel = '↩',\n\tclassName,\n\tstrings: stringsProp,\n}: AiChatPromptInputProps) {\n\tconst strings = useStrings(defaultAiChatPromptInputStrings, stringsProp);\n\tconst textareaRef = useRef<HTMLTextAreaElement | null>(null);\n\n\tconst canSubmit =\n\t\t!streaming && !disabled && (value.trim().length > 0 || attachments.length > 0);\n\n\tconst handleSubmit = useCallback(() => {\n\t\tif (!canSubmit) return;\n\t\tonSubmit?.({ text: value, attachments });\n\t}, [canSubmit, onSubmit, value, attachments]);\n\n\tconst handleKeyDown = useCallback(\n\t\t(e: React.KeyboardEvent<HTMLTextAreaElement>) => {\n\t\t\tif (e.key === 'Enter' && !e.shiftKey && !e.nativeEvent.isComposing) {\n\t\t\t\te.preventDefault();\n\t\t\t\thandleSubmit();\n\t\t\t}\n\t\t},\n\t\t[handleSubmit],\n\t);\n\n\tconst showAttachBtn = showAttach ?? Boolean(onAttach);\n\treturn (\n\t\t<div\n\t\t\tinert={disabled || undefined}\n\t\t\tclassName={cn(\n\t\t\t\t'ai-chat-prompt-input--component',\n\t\t\t\t'rounded-radius border border-input bg-card text-card-foreground transition-[color,box-shadow] duration-150',\n\t\t\t\t// The frame is the field: it takes the shared compound-field focus and\n\t\t\t\t// invalid states from its control, which draws no frame of its own.\n\t\t\t\tfieldStateRecipes.groupFocus,\n\t\t\t\tfieldStateRecipes.groupInvalid,\n\t\t\t\tdisabled && 'opacity-50 pointer-events-none',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t{attachments.length > 0 && (\n\t\t\t\t<div className=\"border-b border-border/60 p-surface-xs\">\n\t\t\t\t\t<AiChatAttachmentsStrip\n\t\t\t\t\t\tattachments={attachments}\n\t\t\t\t\t\tonRemove={onRemoveAttachment}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t<Textarea\n\t\t\t\tref={textareaRef}\n\t\t\t\tvalue={value}\n\t\t\t\tonChange={(e) => onValueChange(e.target.value)}\n\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\tplaceholder={strings.placeholder}\n\t\t\t\tautoResize\n\t\t\t\tminRows={minRows}\n\t\t\t\tmaxRows={maxRows}\n\t\t\t\tautoFocus={autoFocus}\n\t\t\t\tdisabled={disabled}\n\t\t\t\t// The composer frame's control, as InputGroupTextarea marks it. The\n\t\t\t\t// textarea keeps auto-resize, which InputGroupTextarea does not offer.\n\t\t\t\tdata-slot=\"input-group-control\"\n\t\t\t\tclassName=\"rounded-none border-0 bg-transparent text-inherit shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 resize-none disabled:opacity-100\"\n\t\t\t/>\n\n\t\t\t<div className=\"flex items-center gap-space-xs border-t border-border/60 px-surface-xs py-space-sm\">\n\t\t\t\t{leadingActions}\n\t\t\t\t{showAttachBtn && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\taria-label={strings.attachAria}\n\t\t\t\t\t\tclassName=\"disabled:opacity-100\"\n\t\t\t\t\t\tonClick={onAttach}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Paperclip className=\"size-icon\" />\n\t\t\t\t\t</Button>\n\t\t\t\t)}\n\t\t\t\t<div className=\"ml-auto flex items-center gap-space-xs\">\n\t\t\t\t\t{trailingActions}\n\t\t\t\t\t{streaming ? (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\tbuttonStyle=\"solid\"\n\t\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\t\taria-label={strings.stopAria}\n\t\t\t\t\t\t\tclassName=\"disabled:opacity-100\"\n\t\t\t\t\t\t\tonClick={onStop}\n\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Square className=\"size-icon-md fill-current\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\ttone=\"primary\"\n\t\t\t\t\t\t\tbuttonStyle=\"solid\"\n\t\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\t\taria-label={strings.submitAria}\n\t\t\t\t\t\t\tclassName={disabled ? 'disabled:opacity-100' : undefined}\n\t\t\t\t\t\t\tonClick={handleSubmit}\n\t\t\t\t\t\t\tdisabled={!canSubmit}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ArrowUp className=\"size-icon\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t{!hideHint && (\n\t\t\t\t<div className=\"px-surface-xs pb-surface-xs\">\n\t\t\t\t\t<Text size=\"xs\" type=\"discrete\">\n\t\t\t\t\t\t{interpolateString(strings.hint, {\n\t\t\t\t\t\t\tsubmitKey: submitKeyLabel,\n\t\t\t\t\t\t\tnewlineKey: '⇧↩',\n\t\t\t\t\t\t})}\n\t\t\t\t\t</Text>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nAiChatPromptInput.displayName = 'AiChatPromptInput';\n","/**\n * AiChatQueue — pending message queue rendered above the prompt input. Used\n * to surface messages the user submitted faster than the assistant could\n * process — each item shows a status pill and an optional cancel control.\n */\nimport { Loader2, X } from 'lucide-react';\nimport { Badge } from '../../../base/badge';\nimport { Button } from '../../../base/buttons';\nimport { Stack } from '../../../base/structure';\nimport { DisplayLabel, Text } from '../../../typography';\nimport { useStrings, type StringsProp } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultAiChatQueueStrings,\n\ttype AiChatQueueStrings,\n} from '../ai-chat.strings';\nimport type { AiChatQueueItem } from '../ai-chat.types';\nimport { dotRecipes } from '../../../../lib/tone-recipes';\n\nexport interface AiChatQueueProps {\n\t/** Entries to render. */\n\titems: ReadonlyArray<AiChatQueueItem>;\n\t/** Hides the header region. */\n\thideHeader?: boolean;\n\t/** Fired when entry editing is cancelled. */\n\tonCancel?: (id: string) => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<AiChatQueueStrings>;\n}\n\nexport function AiChatQueue({\n\titems,\n\thideHeader = false,\n\tonCancel,\n\tclassName,\n\tstrings: stringsProp,\n}: AiChatQueueProps) {\n\tconst strings = useStrings(defaultAiChatQueueStrings, stringsProp);\n\tif (items.length === 0) return null;\n\treturn (\n\t\t<Stack gap=\"sm\"\n\t\t\tclassName={cn(\n\t\t\t\t'ai-chat-queue--component',\n\t\t\t\t'rounded-radius border border-border/60 bg-muted/30 p-surface-xs',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t{!hideHeader && (\n\t\t\t\t<DisplayLabel className=\"px-1\">\n\t\t\t\t\t{strings.header} · {items.length}\n\t\t\t\t</DisplayLabel>\n\t\t\t)}\n\t\t\t<Stack render={<ul />} gap=\"xs\" className=\"ai-chat-queue--list m-0 list-none p-0 font-sans\">\n\t\t\t\t{items.map((item) => {\n\t\t\t\t\tconst status = item.status ?? 'queued';\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<li\n\t\t\t\t\t\t\tkey={item.id}\n\t\t\t\t\t\t\tclassName=\"flex items-center gap-space-md rounded-radius bg-card text-card-foreground px-space-md py-space-sm\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{status === 'running' ? (\n\t\t\t\t\t\t\t\t<Loader2 className=\"size-icon-md shrink-0 animate-spin text-primary-accent\" />\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t// The dot sits in the spinner's footprint so labels align across rows.\n\t\t\t\t\t\t\t\t<span aria-hidden className=\"flex size-icon-md shrink-0 items-center justify-center\">\n\t\t\t\t\t\t\t\t\t<span className={cn(dotRecipes.marker, 'bg-muted-foreground')} />\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<Text type=\"inherit\" className=\"flex-1 truncate\">\n\t\t\t\t\t\t\t\t{item.label}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t<Badge tone={status === 'running' ? 'info' : 'secondary'}>\n\t\t\t\t\t\t\t\t{status === 'running' ? strings.runningLabel : strings.queuedLabel}\n\t\t\t\t\t\t\t</Badge>\n\t\t\t\t\t\t\t{(!!item.onCancel || !!onCancel) && (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\t\t\t\taria-label={strings.cancelAria}\n\t\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\t\titem.onCancel?.();\n\t\t\t\t\t\t\t\t\t\tonCancel?.(item.id);\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<X className=\"size-icon-md\" />\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</li>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</Stack>\n\t\t</Stack>\n\t);\n}\n\nAiChatQueue.displayName = 'AiChatQueue';\n","/**\n * AiChatSuggestionsRow — wrapping row of small suggestion chips rendered\n * above the prompt input. Chips wrap onto further lines rather than clipping\n * at the composer edge, so every suggestion stays visible and reachable. Distinct from\n * `<AiPromptSuggestions>` (which is a card-grid of richer suggestions used\n * as a welcome surface): this is the inline, dense variant.\n */\nimport { Button } from '../../../base/buttons';\nimport { DisplayLabel, Text } from '../../../typography';\nimport { useStrings, type StringsProp } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultAiChatSuggestionsStrings,\n\ttype AiChatSuggestionsStrings,\n} from '../ai-chat.strings';\nimport type { AiChatSuggestion } from '../ai-chat.types';\n\nexport interface AiChatSuggestionsRowProps<TData = unknown> {\n\t/** Matches for the current query. */\n\tsuggestions: ReadonlyArray<AiChatSuggestion<TData>>;\n\tonPick?: (s: AiChatSuggestion<TData>) => void;\n\t/** Hides the header region. */\n\thideHeader?: boolean;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<AiChatSuggestionsStrings>;\n}\n\nexport function AiChatSuggestionsRow<TData = unknown>({\n\tsuggestions,\n\tonPick,\n\thideHeader = false,\n\tclassName,\n\tstrings: stringsProp,\n}: AiChatSuggestionsRowProps<TData>) {\n\tconst strings = useStrings(defaultAiChatSuggestionsStrings, stringsProp);\n\tif (suggestions.length === 0) return null;\n\treturn (\n\t\t<div className={cn('ai-chat-suggestions-row--component flex items-start gap-space-md', className)}>\n\t\t\t{!hideHeader && (\n\t\t\t\t// The label keeps the chips' action height so it centres on their first line.\n\t\t\t\t<DisplayLabel className=\"flex min-h-action-sm shrink-0 items-center\">\n\t\t\t\t\t{strings.header}\n\t\t\t\t</DisplayLabel>\n\t\t\t)}\n\t\t\t<div className=\"ai-chat-suggestions-row--chips flex min-w-0 flex-1 flex-wrap items-center gap-space-sm\">\n\t\t\t\t{suggestions.map((s) => {\n\t\t\t\t\tconst Icon = s.icon;\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tkey={s.id}\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\tbuttonStyle=\"outline\"\n\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\tonClick={() => onPick?.(s)}\n\t\t\t\t\t\t\tclassName=\"shrink-0 gap-space-sm\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{!!Icon && <Icon className=\"size-icon-sm text-muted-foreground\" />}\n\t\t\t\t\t\t\t{/* The label keeps the button's tight leading so the chip stays the sm action height. */}\n\t\t\t\t\t\t\t<Text tag=\"span\" weight=\"medium\" lineHeight=\"tight\">\n\t\t\t\t\t\t\t\t{s.label}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nAiChatSuggestionsRow.displayName = 'AiChatSuggestionsRow';\n","/**\n * AiChat — framework-agnostic AI chat surface. Tie-together component for\n * the `features/ai-chat/*` partials. Renders an optional agent header, the\n * scrollable conversation, an optional queue + suggestions row, and the\n * prompt input.\n *\n * Composition seams:\n * - `slots` — replace any region (header, intro, empty, queue,\n * suggestions, input, belowMessages) or per-message\n * (`renderMessage`).\n * - `strings` — deep-partial override of every default copy line\n * (prompt, conversation, queue, suggestions, message).\n * - Partials — every partial is exported individually so a consumer\n * can build a custom layout against the same data shape.\n *\n * Headless usage:\n * - The `useAiChatScroll` hook is exported for consumers building a\n * custom conversation layout while keeping auto-stick-to-bottom.\n *\n * Framework-agnostic:\n * - No router, no i18n SDK, no fetcher. Submission is a callback\n * (`onSubmit`); messages, queue, attachments are all controlled props.\n */\nimport { useCallback, useState, type ReactNode } from 'react';\nimport { AiAgent } from '../../blocks/ai/ai-agent';\nimport { Stack } from '../../base/structure';\nimport { Text } from '../../typography';\nimport { useStrings, type StringsProp } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\n\nimport {\n\tdefaultAiChatStrings,\n\ttype AiChatStrings,\n} from './ai-chat.strings';\nimport type {\n\tAiChatAgent,\n\tAiChatAttachment,\n\tAiChatMessage as AiChatMessageType,\n\tAiChatQueueItem,\n\tAiChatSlots,\n\tAiChatSubmitValues,\n\tAiChatSuggestion,\n} from './ai-chat.types';\nimport {\n\tAiChatConversation,\n\tAiChatEmptyState,\n\tAiChatMessage,\n\tAiChatPromptInput,\n\tAiChatQueue,\n\tAiChatSuggestionsRow,\n} from './partials';\n\nexport interface AiChatProps<TSuggestionData = unknown> {\n\t/** Conversation messages — order is significant. */\n\tmessages: ReadonlyArray<AiChatMessageType>;\n\n\t/** Controlled prompt input value. */\n\tinputValue: string;\n\t/** Prompt input change callback. */\n\tonInputChange: (value: string) => void;\n\t/** Fired on submit (Enter or send button). */\n\tonSubmit?: (values: AiChatSubmitValues) => void;\n\t/** Fired when the user clicks the stop button while `streaming`. */\n\tonStop?: () => void;\n\t/** Streaming flag — controls submit/stop UI in the prompt input. */\n\tstreaming?: boolean;\n\t/** Disable composer entirely. */\n\tdisabled?: boolean;\n\n\t/** Currently staged attachments. */\n\tattachments?: ReadonlyArray<AiChatAttachment>;\n\t/** Remove a staged attachment. */\n\tonRemoveAttachment?: (id: string) => void;\n\t/** Fires when the user clicks the attach button. */\n\tonAttach?: () => void;\n\t/** Toggles the attach button visibility. Defaults to `true` when `onAttach` is provided. */\n\tshowAttach?: boolean;\n\n\t/** Agent identity — drives the optional header strip. Pass `null` to hide. */\n\tagent?: AiChatAgent | null;\n\t/** Trailing slot inside the header (e.g. settings button). */\n\theaderActions?: ReactNode;\n\n\t/** Pending message queue (rendered above the input). */\n\tqueue?: ReadonlyArray<AiChatQueueItem>;\n\t/** Cancel callback — fires per-item when the queue chip's × is clicked. */\n\tonCancelQueueItem?: (id: string) => void;\n\n\t/** Inline quick suggestions (rendered above the input). */\n\tsuggestions?: ReadonlyArray<AiChatSuggestion<TSuggestionData>>;\n\t/** Suggestion select callback. */\n\tonPickSuggestion?: (s: AiChatSuggestion<TSuggestionData>) => void;\n\n\t/** Per-message copy callback. */\n\tonMessageCopy?: (message: AiChatMessageType) => void;\n\t/** Per-message regenerate callback (assistant only). */\n\tonMessageRegenerate?: (message: AiChatMessageType) => void;\n\t/** Per-message attachment open callback. */\n\tonAttachmentOpen?: (messageId: string, attachmentId: string) => void;\n\n\t/** Disable auto-stick-to-bottom in the conversation. */\n\tdisableAutoScroll?: boolean;\n\n\t/** Slot map for replacing default surfaces. */\n\tslots?: AiChatSlots;\n\t/** String overrides. */\n\tstrings?: StringsProp<AiChatStrings>;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n}\n\nexport function AiChat<TSuggestionData = unknown>({\n\tmessages,\n\tinputValue,\n\tonInputChange,\n\tonSubmit,\n\tonStop,\n\tstreaming = false,\n\tdisabled = false,\n\tattachments = [],\n\tonRemoveAttachment,\n\tonAttach,\n\tshowAttach,\n\tagent,\n\theaderActions,\n\tqueue = [],\n\tonCancelQueueItem,\n\tsuggestions = [],\n\tonPickSuggestion,\n\tonMessageCopy,\n\tonMessageRegenerate,\n\tonAttachmentOpen,\n\tdisableAutoScroll,\n\tslots,\n\tstrings: stringsProp,\n\tclassName,\n}: AiChatProps<TSuggestionData>) {\n\tconst strings = useStrings(defaultAiChatStrings, stringsProp);\n\tconst [, force] = useState(0);\n\n\tconst renderMessage = useCallback(\n\t\t(\n\t\t\tmessage: AiChatMessageType,\n\t\t\tctx: { isLast: boolean; index: number },\n\t\t): ReactNode => {\n\t\t\tif (slots?.renderMessage) {\n\t\t\t\treturn slots.renderMessage(message, ctx);\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<AiChatMessage className=\"ai-chat-message--component\"\n\t\t\t\t\tmessage={message}\n\t\t\t\t\tstrings={strings.message}\n\t\t\t\t\tonCopy={\n\t\t\t\t\t\tonMessageCopy ? () => onMessageCopy(message) : undefined\n\t\t\t\t\t}\n\t\t\t\t\tonRegenerate={\n\t\t\t\t\t\tonMessageRegenerate\n\t\t\t\t\t\t\t? () => onMessageRegenerate(message)\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t\tonAttachmentOpen={\n\t\t\t\t\t\tonAttachmentOpen\n\t\t\t\t\t\t\t? (attachmentId) => onAttachmentOpen(message.id, attachmentId)\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t);\n\t\t},\n\t\t[\n\t\t\tonAttachmentOpen,\n\t\t\tonMessageCopy,\n\t\t\tonMessageRegenerate,\n\t\t\tslots,\n\t\t\tstrings.message,\n\t\t],\n\t);\n\n\tconst Header: ReactNode =\n\t\tslots?.header ??\n\t\t(agent ? (\n\t\t\t<div className=\"border-b border-border bg-card text-card-foreground p-surface\">\n\t\t\t<Stack direction=\"horizontal\" align=\"center\" gap=\"lg\">\n\t\t\t\t<AiAgent\n\t\t\t\t\tname={agent.name}\n\t\t\t\t\ticon={agent.icon}\n\t\t\t\t\tavatar={agent.avatar}\n\t\t\t\t\tsubtitle={agent.subtitle}\n\t\t\t\t\ttone={agent.tone}\n\t\t\t\t\tstatus={agent.status}\n\t\t\t\t\tvariant=\"inline\"\n\t\t\t\t/>\n\t\t\t\t{!!headerActions && (\n\t\t\t\t\t<div className=\"ml-auto flex items-center gap-space-xs\">{headerActions}</div>\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t\t</div>\n\t\t) : null);\n\n\tconst Empty: ReactNode =\n\t\tslots?.empty ??\n\t\t(messages.length === 0 ? (\n\t\t\t<AiChatEmptyState\n\t\t\t\ttitle={strings.emptyTitle}\n\t\t\t\tdescription={strings.emptyDescription}\n\t\t\t/>\n\t\t) : null);\n\n\tconst Queue: ReactNode =\n\t\tslots?.queue ??\n\t\t(queue.length > 0 ? (\n\t\t\t<AiChatQueue\n\t\t\t\titems={queue}\n\t\t\t\tonCancel={onCancelQueueItem}\n\t\t\t\tstrings={strings.queue}\n\t\t\t/>\n\t\t) : null);\n\n\tconst Suggestions: ReactNode =\n\t\tslots?.suggestions ??\n\t\t(suggestions.length > 0 ? (\n\t\t\t<AiChatSuggestionsRow<TSuggestionData>\n\t\t\t\tsuggestions={suggestions}\n\t\t\t\tonPick={onPickSuggestion}\n\t\t\t\tstrings={strings.suggestions}\n\t\t\t/>\n\t\t) : null);\n\n\tconst Input: ReactNode =\n\t\tslots?.input ?? (\n\t\t\t<AiChatPromptInput\n\t\t\t\tvalue={inputValue}\n\t\t\t\tonValueChange={onInputChange}\n\t\t\t\tonSubmit={(values) => {\n\t\t\t\t\tonSubmit?.(values);\n\t\t\t\t\t// Force re-render so consumers that read inputValue/attachments\n\t\t\t\t\t// from controlled state see the freshly cleared values they\n\t\t\t\t\t// pushed in their onSubmit handler.\n\t\t\t\t\tforce((v) => v + 1);\n\t\t\t\t}}\n\t\t\t\tonStop={onStop}\n\t\t\t\tstreaming={streaming}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tattachments={attachments}\n\t\t\t\tonRemoveAttachment={onRemoveAttachment}\n\t\t\t\tonAttach={onAttach}\n\t\t\t\tshowAttach={showAttach}\n\t\t\t\tstrings={strings.prompt}\n\t\t\t/>\n\t\t);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\n\t\t\t\t'ai-chat--component box-border flex h-full flex-col overflow-hidden rounded-surface border border-border bg-background text-foreground',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t{Header}\n\n\t\t\t<AiChatConversation\n\t\t\t\tmessages={messages}\n\t\t\t\trenderMessage={renderMessage}\n\t\t\t\tintro={slots?.intro}\n\t\t\t\tfooter={slots?.belowMessages}\n\t\t\t\tempty={Empty}\n\t\t\t\tdisableAutoScroll={disableAutoScroll}\n\t\t\t\tstrings={strings.conversation}\n\t\t\t/>\n\n\t\t\t{(Queue || Suggestions || Input) && (\n\t\t\t\t\t<div className=\"border-t border-border bg-card text-card-foreground p-surface\">\n\t\t\t\t\t<Stack gap=\"md\">\n\t\t\t\t\t{Queue}\n\t\t\t\t\t{Suggestions}\n\t\t\t\t\t{Input}\n\t\t\t\t\t</Stack>\n\t\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t{disabled && (\n\t\t\t\t<Text className=\"sr-only\" aria-live=\"polite\">\n\t\t\t\t\t{strings.disabledAnnouncement}\n\t\t\t\t</Text>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nAiChat.displayName = 'AiChat';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAsBA,IAAa0B,IAA4D;CACxE,aAAa;CACb,YAAY;CACZ,YAAY;CACZ,UAAU;CACV,iBAAiB;CACjB,MAAM;AACP,GAUaC,IAA8D;CAC1E,gBAAgB;CAChB,OAAO;CACP,gBAAgB;CAChB,oBAAoB;AACrB,GASaC,IAAgD;CAC5D,QAAQ;CACR,YAAY;CACZ,aAAa;CACb,cAAc;AACf,GAMaC,IAA4D,EACxE,QAAQ,MACT,GAMaC,IAAoD,EAChE,SAAS,YACV,GAcaC,IAAsC;CAClD,QAAQL;CACR,cAAcC;CACd,OAAOC;CACP,aAAaC;CACb,SAASC;CACT,YAAY;CACZ,kBAAkB;CAClB,sBAAsB;AACvB;;;AC3EA,SAAgBE,EAAuB,EACtC,gBACA,aACA,WACA,gBAC+B;CAE/B,OADIC,EAAY,WAAW,IAAU,OAEpC,kBAAC3B,GAAD;EACC,WAAU;EACV,KAAI;EACJ,WAAWL,EAAG,wCAAwCiC,CAAS;EAE9D,UAAAD,EAAY,KAAK,MACjB,kBAACf,GAAD;GAEC,MAAMiB,EAAI;GACV,MAAMA,EAAI;GACV,MAAMA,EAAI;GACV,MAAMA,EAAI;GACV,cAAcA,EAAI;GAClB,UAAUA,EAAI;GACd,SAASA,EAAI;GACb,QAAQC,UAAeA,EAAOD,CAAG,IAAI,KAAA;GACrC,UAAUE,UAAiBA,EAASF,EAAI,EAAE,IAAI,KAAA;EAC9C,GAVKA,EAAI,EAUT,CACD;CACK,CAA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