@aceshooting/lyra-ui 23.0.0 → 24.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (278) hide show
  1. package/CHANGELOG.md +9 -43
  2. package/README.md +72 -35
  3. package/custom-elements.json +1 -1
  4. package/design-tokens.json +1 -1
  5. package/dist/cli/lyra-rename-ledger.mjs +1 -1
  6. package/dist/cli/migration-contract.json +1 -1
  7. package/dist/cli/migration-contract.mjs +1 -1
  8. package/dist/cli/migration-renames.mjs +2 -2
  9. package/dist/cli/migration-transforms.mjs +2 -2
  10. package/dist/components/agent-tools/approval-queue/approval-queue.class.d.ts +1 -4
  11. package/dist/components/agent-tools/approval-queue/approval-queue.class.js +1 -3
  12. package/dist/components/agent-tools/compare-panel/compare-panel.class.d.ts +1 -4
  13. package/dist/components/agent-tools/compare-panel/compare-panel.class.js +1 -1
  14. package/dist/components/agent-tools/confirm-bar/confirm-bar.class.d.ts +1 -7
  15. package/dist/components/agent-tools/confirm-bar/confirm-bar.class.js +2 -2
  16. package/dist/components/agent-tools/context-inspector/context-inspector.class.d.ts +1 -1
  17. package/dist/components/agent-tools/evaluation-run/evaluation-run.class.d.ts +2 -5
  18. package/dist/components/agent-tools/evaluation-run/evaluation-run.class.js +1 -3
  19. package/dist/components/agent-tools/terminal/terminal.class.d.ts +1 -4
  20. package/dist/components/agent-tools/terminal/terminal.class.js +2 -2
  21. package/dist/components/agent-tools/tool-approval-dialog/tool-approval-dialog.class.d.ts +1 -7
  22. package/dist/components/agent-tools/tool-approval-dialog/tool-approval-dialog.class.js +1 -1
  23. package/dist/components/agent-tools/tool-timeline/tool-timeline.class.d.ts +1 -4
  24. package/dist/components/agent-tools/tool-timeline/tool-timeline.class.js +1 -3
  25. package/dist/components/charts/chart/lite-chart-axis-layout.d.ts +13 -0
  26. package/dist/components/charts/chart/lite-chart-axis-layout.js +1 -0
  27. package/dist/components/charts/chart/lite-chart.class.d.ts +1 -11
  28. package/dist/components/charts/chart/lite-chart.class.js +4 -4
  29. package/dist/components/conversation/agent-workspace/agent-workspace.class.d.ts +2 -2
  30. package/dist/components/conversation/agent-workspace/agent-workspace.class.js +0 -1
  31. package/dist/components/conversation/chat-message/chat-message.class.d.ts +3 -9
  32. package/dist/components/conversation/chat-message/chat-message.class.js +1 -1
  33. package/dist/components/conversation/code-block/code-block-base.class.js +1 -1
  34. package/dist/components/conversation/code-block/code-block-core.class.d.ts +6 -8
  35. package/dist/components/conversation/code-block/code-block-shared.d.ts +1 -4
  36. package/dist/components/conversation/code-block/code-block.class.d.ts +4 -6
  37. package/dist/components/conversation/markdown/markdown-base.class.d.ts +1 -3
  38. package/dist/components/conversation/markdown/markdown-base.class.js +1 -1
  39. package/dist/components/conversation/markdown/markdown-core.class.d.ts +1 -4
  40. package/dist/components/conversation/markdown/markdown.class.d.ts +1 -4
  41. package/dist/components/conversation/message-actions/message-actions.class.d.ts +1 -4
  42. package/dist/components/conversation/message-actions/message-actions.class.js +1 -1
  43. package/dist/components/conversation/message-feedback/message-feedback.class.d.ts +1 -4
  44. package/dist/components/conversation/message-feedback/message-feedback.class.js +2 -2
  45. package/dist/components/conversation/message-parts/message-parts.class.d.ts +2 -5
  46. package/dist/components/conversation/message-parts/message-parts.class.js +3 -3
  47. package/dist/components/conversation/streaming-text/streaming-text-base.class.d.ts +1 -1
  48. package/dist/components/conversation/streaming-text/streaming-text-core.class.d.ts +2 -0
  49. package/dist/components/conversation/streaming-text/streaming-text-core.class.js +0 -1
  50. package/dist/components/conversation/streaming-text/streaming-text.class.d.ts +2 -0
  51. package/dist/components/conversation/streaming-text/streaming-text.class.js +0 -1
  52. package/dist/components/conversation/thread-list/thread-list.class.d.ts +6 -17
  53. package/dist/components/conversation/thread-list/thread-list.class.js +6 -6
  54. package/dist/components/data/context-meter/context-meter.class.d.ts +1 -6
  55. package/dist/components/data/context-meter/context-meter.class.js +1 -1
  56. package/dist/components/data/data-grid/data-grid.class.d.ts +0 -1
  57. package/dist/components/data/data-grid/data-grid.class.js +2 -2
  58. package/dist/components/data/document-library/document-library.class.d.ts +6 -13
  59. package/dist/components/data/document-library/document-library.class.js +1 -2
  60. package/dist/components/data/heatmap/heatmap-grid-navigation.d.ts +7 -0
  61. package/dist/components/data/heatmap/heatmap-grid-navigation.js +1 -0
  62. package/dist/components/data/heatmap/heatmap.class.d.ts +3 -23
  63. package/dist/components/data/heatmap/heatmap.class.js +2 -2
  64. package/dist/components/data/sequence-strip/sequence-strip.class.d.ts +3 -9
  65. package/dist/components/data/sequence-strip/sequence-strip.class.js +3 -3
  66. package/dist/components/data/table/table.class.d.ts +5 -14
  67. package/dist/components/data/table/table.class.js +6 -6
  68. package/dist/components/forms/button/button.class.d.ts +2 -2
  69. package/dist/components/forms/button/button.class.js +9 -9
  70. package/dist/components/forms/combobox/combobox.class.d.ts +1 -4
  71. package/dist/components/forms/combobox/combobox.class.js +2 -2
  72. package/dist/components/forms/input/time-input.class.d.ts +1 -1
  73. package/dist/components/forms/input/time-input.class.js +1 -1
  74. package/dist/components/forms/select/select.class.d.ts +1 -2
  75. package/dist/components/layout/app-rail/app-rail-item.class.d.ts +3 -6
  76. package/dist/components/layout/app-rail/app-rail-item.class.js +1 -1
  77. package/dist/components/layout/app-rail/app-rail.class.d.ts +2 -4
  78. package/dist/components/layout/app-rail/app-rail.class.js +1 -1
  79. package/dist/components/layout/app-rail-group/app-rail-group.class.d.ts +2 -6
  80. package/dist/components/layout/app-rail-group/app-rail-group.class.js +1 -1
  81. package/dist/components/layout/carousel/carousel.class.d.ts +1 -4
  82. package/dist/components/layout/carousel/carousel.class.js +2 -2
  83. package/dist/components/layout/command-palette/command-palette.class.js +1 -1
  84. package/dist/components/layout/details/details.class.d.ts +2 -4
  85. package/dist/components/layout/details/details.class.js +1 -1
  86. package/dist/components/layout/dock-panel/dock-panel.class.d.ts +3 -7
  87. package/dist/components/layout/dock-panel/dock-panel.class.js +1 -1
  88. package/dist/components/layout/menu/menu.class.js +1 -1
  89. package/dist/components/layout/multi-split/multi-split.class.d.ts +2 -4
  90. package/dist/components/layout/multi-split/multi-split.class.js +1 -1
  91. package/dist/components/layout/navigation-menu-item/navigation-menu-item.class.d.ts +2 -4
  92. package/dist/components/layout/navigation-menu-item/navigation-menu-item.class.js +1 -1
  93. package/dist/components/layout/reorder-list/reorder-item.class.d.ts +1 -4
  94. package/dist/components/layout/reorder-list/reorder-item.class.js +2 -2
  95. package/dist/components/media/attachment-trigger/attachment-trigger.class.d.ts +5 -9
  96. package/dist/components/media/attachment-trigger/attachment-trigger.class.js +5 -5
  97. package/dist/components/media/av-player/av-player.class.js +3 -3
  98. package/dist/components/media/file-input/file-input.class.d.ts +3 -6
  99. package/dist/components/media/file-input/file-input.class.js +3 -3
  100. package/dist/components/media/lightbox/lightbox.class.d.ts +11 -20
  101. package/dist/components/media/lightbox/lightbox.class.js +1 -1
  102. package/dist/components/media/map/map-data-layers.d.ts +20 -0
  103. package/dist/components/media/map/map-data-layers.js +1 -0
  104. package/dist/components/media/map/map.class.js +3 -3
  105. package/dist/components/media/media-time.d.ts +2 -0
  106. package/dist/components/media/media-time.js +1 -0
  107. package/dist/components/media/video/video.class.js +5 -5
  108. package/dist/components/media/video-playlist/video-playlist.class.js +2 -2
  109. package/dist/components/overlays/callout/callout.class.d.ts +2 -5
  110. package/dist/components/overlays/callout/callout.class.js +2 -2
  111. package/dist/components/overlays/dialog/dialog.class.d.ts +4 -7
  112. package/dist/components/overlays/dialog/dialog.class.js +2 -2
  113. package/dist/components/overlays/overlay/dropdown.class.d.ts +5 -10
  114. package/dist/components/overlays/overlay/dropdown.class.js +2 -2
  115. package/dist/components/overlays/overlay/popover.class.d.ts +2 -3
  116. package/dist/components/overlays/popup/popup.class.js +1 -1
  117. package/dist/components/overlays/progress/progress-bar.class.d.ts +1 -4
  118. package/dist/components/overlays/progress/progress-bar.class.js +2 -2
  119. package/dist/components/overlays/progress/progress-ring.class.d.ts +1 -4
  120. package/dist/components/overlays/progress/progress-ring.class.js +2 -2
  121. package/dist/components/overlays/progress/progress-shared.d.ts +3 -3
  122. package/dist/components/overlays/progress/progress-shared.js +1 -1
  123. package/dist/components/overlays/toast/toast-item.class.js +1 -1
  124. package/dist/components/retrieval/graph/graph.class.d.ts +5 -10
  125. package/dist/components/retrieval/graph/graph.class.js +1 -1
  126. package/dist/components/retrieval/knowledge-base/knowledge-base.class.d.ts +7 -14
  127. package/dist/components/retrieval/knowledge-base/knowledge-base.class.js +2 -3
  128. package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.class.d.ts +2 -8
  129. package/dist/components/retrieval/memory-panel/memory-panel.class.js +0 -4
  130. package/dist/components/retrieval/rag-answer/rag-answer.class.js +1 -1
  131. package/dist/components/utility/export-button/export-button.class.d.ts +6 -10
  132. package/dist/components/utility/export-button/export-button.class.js +1 -1
  133. package/dist/components/utility/mention-popover/mention-popover.class.js +1 -1
  134. package/dist/components/viewers/geojson-view/geojson-view.class.d.ts +1 -1
  135. package/dist/components/viewers/highlight-layer/highlight-layer-timing.js +1 -1
  136. package/dist/components/viewers/pdf-viewer/pdf-viewer.class.js +4 -4
  137. package/dist/events.d.ts +17 -78
  138. package/dist/framework-types.d.ts +1 -1
  139. package/dist/internal/catalog-picker.js +1 -1
  140. package/dist/internal/css-motion-time.d.ts +7 -0
  141. package/dist/internal/css-motion-time.js +1 -0
  142. package/dist/internal/data-state-renderer.d.ts +1 -3
  143. package/dist/internal/data-state-renderer.js +1 -1
  144. package/dist/internal/localization-runtime.d.ts +2 -0
  145. package/dist/internal/localization-runtime.js +1 -1
  146. package/dist/internal/lyra-element.js +2 -2
  147. package/dist/internal/package-metadata.d.ts +1 -1
  148. package/dist/internal/package-metadata.js +1 -1
  149. package/dist/looks/data.css +1 -1
  150. package/dist/looks/terminal.css +1 -1
  151. package/dist/lyra.d.ts +1 -592
  152. package/dist/lyra.js +1 -1
  153. package/dist/testing/event-factory.d.ts +2 -2
  154. package/dist/testing/interaction-drivers.d.ts +5 -3
  155. package/dist/testing/lyra-tag-event-map.js +1 -1
  156. package/dist/theme/looks/data.d.ts +1 -1
  157. package/dist/theme/looks/data.js +1 -1
  158. package/dist/theme/looks/terminal.d.ts +1 -1
  159. package/dist/theme/looks/terminal.js +1 -1
  160. package/dist/theme/theme.d.ts +2 -80
  161. package/dist/theme/theme.js +1 -1
  162. package/llms/components/lr-agent-workspace.md +1 -1
  163. package/llms/components/lr-alert.md +1 -1
  164. package/llms/components/lr-animation.md +1 -1
  165. package/llms/components/lr-app-rail.md +8 -10
  166. package/llms/components/lr-approval-queue.md +2 -4
  167. package/llms/components/lr-attachment-trigger.md +3 -4
  168. package/llms/components/lr-badge.md +2 -2
  169. package/llms/components/lr-button.md +45 -99
  170. package/llms/components/lr-callout.md +3 -4
  171. package/llms/components/lr-carousel.md +3 -5
  172. package/llms/components/lr-chat-message.md +1 -2
  173. package/llms/components/lr-claim-evidence.md +1 -1
  174. package/llms/components/lr-code-block-core.md +2 -2
  175. package/llms/components/lr-code-block.md +5 -6
  176. package/llms/components/lr-color-picker.md +1 -1
  177. package/llms/components/lr-combobox.md +5 -6
  178. package/llms/components/lr-compare-panel.md +2 -4
  179. package/llms/components/lr-confirm-bar.md +3 -7
  180. package/llms/components/lr-context-inspector.md +3 -2
  181. package/llms/components/lr-context-menu.md +2 -2
  182. package/llms/components/lr-context-meter.md +2 -4
  183. package/llms/components/lr-copy-button.md +1 -1
  184. package/llms/components/lr-data-grid.md +4 -7
  185. package/llms/components/lr-details.md +3 -3
  186. package/llms/components/lr-dialog.md +4 -6
  187. package/llms/components/lr-dock-panel.md +5 -6
  188. package/llms/components/lr-document-library.md +5 -7
  189. package/llms/components/lr-drawer.md +3 -3
  190. package/llms/components/lr-dropdown.md +4 -5
  191. package/llms/components/lr-eval-run.md +3 -5
  192. package/llms/components/lr-export-button.md +4 -7
  193. package/llms/components/lr-file-input.md +0 -5
  194. package/llms/components/lr-funnel.md +1 -1
  195. package/llms/components/lr-graph.md +3 -7
  196. package/llms/components/lr-icon.md +1 -1
  197. package/llms/components/lr-include.md +1 -1
  198. package/llms/components/lr-input.md +31 -79
  199. package/llms/components/lr-json-viewer.md +1 -1
  200. package/llms/components/lr-knowledge-base.md +4 -6
  201. package/llms/components/lr-knowledge-graph-explorer.md +2 -5
  202. package/llms/components/lr-known-date.md +1 -1
  203. package/llms/components/lr-lightbox.md +9 -7
  204. package/llms/components/lr-lite-chart.md +1 -5
  205. package/llms/components/lr-markdown-core.md +3 -4
  206. package/llms/components/lr-markdown.md +3 -5
  207. package/llms/components/lr-mcp-app.md +1 -1
  208. package/llms/components/lr-message-actions.md +2 -3
  209. package/llms/components/lr-message-feedback.md +1 -3
  210. package/llms/components/lr-message-parts.md +4 -5
  211. package/llms/components/lr-multi-split.md +8 -7
  212. package/llms/components/lr-native-time-input.md +1 -1
  213. package/llms/components/lr-navigation-menu.md +5 -5
  214. package/llms/components/lr-number-input.md +3 -1
  215. package/llms/components/lr-otp-input.md +2 -0
  216. package/llms/components/lr-page.md +1 -1
  217. package/llms/components/lr-pan-zoom.md +1 -1
  218. package/llms/components/lr-phone-input.md +3 -1
  219. package/llms/components/lr-popover.md +2 -2
  220. package/llms/components/lr-progress-bar.md +3 -5
  221. package/llms/components/lr-progress-ring.md +5 -7
  222. package/llms/components/lr-prompt-input.md +1 -1
  223. package/llms/components/lr-prompt-queue.md +1 -1
  224. package/llms/components/lr-prompt-studio.md +1 -1
  225. package/llms/components/lr-rag-eval-dashboard.md +1 -1
  226. package/llms/components/lr-rating.md +2 -2
  227. package/llms/components/lr-realtime-session.md +1 -1
  228. package/llms/components/lr-reorder-item.md +1 -1
  229. package/llms/components/lr-reorder-list.md +2 -3
  230. package/llms/components/lr-retrieval-compare.md +1 -1
  231. package/llms/components/lr-select.md +3 -1
  232. package/llms/components/lr-selection-toolbar.md +1 -1
  233. package/llms/components/lr-sequence-strip.md +3 -8
  234. package/llms/components/lr-span-waterfall.md +1 -1
  235. package/llms/components/lr-split-panel.md +1 -1
  236. package/llms/components/lr-streaming-text-core.md +2 -1
  237. package/llms/components/lr-streaming-text.md +3 -2
  238. package/llms/components/lr-subagent-panel.md +1 -1
  239. package/llms/components/lr-swatch-picker.md +4 -4
  240. package/llms/components/lr-switch.md +3 -1
  241. package/llms/components/lr-table.md +33 -85
  242. package/llms/components/lr-terminal.md +2 -5
  243. package/llms/components/lr-textarea.md +1 -1
  244. package/llms/components/lr-thread-list.md +8 -14
  245. package/llms/components/lr-time-input.md +1 -1
  246. package/llms/components/lr-toggle-group.md +2 -2
  247. package/llms/components/lr-toggle.md +1 -1
  248. package/llms/components/lr-tool-approval-dialog.md +4 -7
  249. package/llms/components/lr-tool-call-block.md +1 -1
  250. package/llms/components/lr-tool-timeline.md +2 -5
  251. package/llms/components/lr-video-playlist.md +1 -1
  252. package/llms/components/lr-video.md +1 -1
  253. package/llms/components/lr-widget-renderer.md +7 -6
  254. package/llms/components/lr-zoomable-frame.md +1 -1
  255. package/llms/index.md +3 -618
  256. package/llms/migration.md +614 -614
  257. package/llms/shared/events-and-types.md +25 -24
  258. package/llms/shared/frameworks-and-ssr.md +7 -3
  259. package/llms/shared/imports-and-registration.md +22 -22
  260. package/llms/shared/localization-and-rtl.md +2 -2
  261. package/llms/shared/native-styles-and-utilities.md +263 -0
  262. package/llms/shared/styles-and-tokens.md +85 -676
  263. package/llms/shared/testing-and-utilities.md +12 -11
  264. package/llms/shared/v23-to-v24-migration.md +167 -0
  265. package/llms/shared.md +142 -487
  266. package/llms/tokens.md +3 -3
  267. package/llms.txt +9 -4
  268. package/package.json +7 -311
  269. package/registrations.json +1 -1
  270. package/vscode-html-data.json +1 -1
  271. package/web-types.json +1 -1
  272. package/dist/ssr-loader.d.ts +0 -2
  273. package/dist/ssr-loader.js +0 -1
  274. package/dist/theme/presets/shadcn.d.ts +0 -22
  275. package/dist/theme/presets/shadcn.js +0 -1
  276. package/dist/theme/presets.d.ts +0 -49
  277. package/dist/theme/presets.js +0 -1
  278. package/dist/themes/shadcn.css +0 -1
@@ -1,6 +1,4 @@
1
- import type{LyraEventDetailSnapshot}from'../../../internal/lyra-element.js';import{type PropertyValues,type TemplateResult}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import'../../utility/copy-button/copy-button.class.js';import'../message-feedback/message-feedback.class.js';import type{LyraClipboardWriteFailure,LyraClipboardWriteSuccess}from'../../../internal/clipboard.js';import type{MessageFeedbackSubmitDetail,MessageFeedbackValue}from'../message-feedback/message-feedback.class.js';export type MessageActionControl='copy'|'regenerate'|'edit'|'feedback';export interface LyraMessageActionsEventMap{'lr-regenerate':CustomEvent<null>;'lr-edit':CustomEvent<null>;'lr-copy':CustomEvent<LyraClipboardWriteSuccess>;'lr-error':CustomEvent<null>;'lr-copy-error':CustomEvent<LyraClipboardWriteFailure>;'lr-feedback-change':CustomEvent<{rating:MessageFeedbackValue;}>;'lr-feedback-submit-request':CustomEvent<LyraEventDetailSnapshot<MessageFeedbackSubmitDetail>>;
2
- /** @deprecated Use `lr-feedback-submit-request`. */
3
- 'lr-feedback-submit':CustomEvent<LyraEventDetailSnapshot<MessageFeedbackSubmitDetail>>;}
1
+ import type{LyraEventDetailSnapshot}from'../../../internal/lyra-element.js';import{type PropertyValues,type TemplateResult}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import'../../utility/copy-button/copy-button.class.js';import'../message-feedback/message-feedback.class.js';import type{LyraClipboardWriteFailure,LyraClipboardWriteSuccess}from'../../../internal/clipboard.js';import type{MessageFeedbackSubmitDetail,MessageFeedbackValue}from'../message-feedback/message-feedback.class.js';export type MessageActionControl='copy'|'regenerate'|'edit'|'feedback';export interface LyraMessageActionsEventMap{'lr-regenerate':CustomEvent<null>;'lr-edit':CustomEvent<null>;'lr-copy':CustomEvent<LyraClipboardWriteSuccess>;'lr-error':CustomEvent<null>;'lr-copy-error':CustomEvent<LyraClipboardWriteFailure>;'lr-feedback-change':CustomEvent<{rating:MessageFeedbackValue;}>;'lr-feedback-submit-request':CustomEvent<LyraEventDetailSnapshot<MessageFeedbackSubmitDetail>>;}
4
2
  /**
5
3
  * `<lr-message-actions>` — the per-message action toolbar for `<lr-chat-message>`'s `actions`
6
4
  * slot: opt-in built-ins (copy / regenerate / edit / feedback) that emit intent events, plus a
@@ -60,7 +58,6 @@ import type{LyraEventDetailSnapshot}from'../../../internal/lyra-element.js';impo
60
58
  * @event lr-feedback-change - Bubbles unchanged from the embedded, thumbs-only
61
59
  * `lr-message-feedback`. `detail: { rating }`. A colliding event from a slotted custom child is
62
60
  * contained at the slot boundary and remains observable directly on that child.
63
- * @event lr-feedback-submit - Deprecated cancelable compatibility alias of `lr-feedback-submit-request`.
64
61
  * @event lr-feedback-submit-request - The built-in feedback control's terminal cancelable persistence
65
62
  * request, including thumbs-only choices. Its frozen detail includes a nonblank `submissionId`;
66
63
  * when prevented, pass that exact ID to `finalizePendingSubmit()` or
@@ -9,7 +9,7 @@ import{__decorate}from"tslib";import{collectionSupport}from"../../../internal/co
9
9
  <path d="M12 20h9"></path>
10
10
  <path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4Z"></path>
11
11
  </svg>
12
- `}class LyraMessageActions extends LyraElement{constructor(){super(...arguments),this.controls=[],this.copyText="",this.feedbackRating=null,this.revealOnInteraction=!1,this.accessibleLabel=null,this.activeStopIndex=0,this.revealed=!1,this.hoverTarget=null,this.slottedOverlay=new SlottedOverlayController(this,()=>this.renderRoot?.querySelector('[part="base"] > slot:not([name])')),this.slottedOverlayWasOpen=!1,this.stopSyncGeneration=0,this.managedStops=[],this.directActions=new WeakMap,this.nextDirectActionId=0,this.onHoverTargetEnter=()=>{this.setRevealed(!0)},this.onHoverTargetLeave=()=>{!this.matches(":focus-within")&&!this.slottedOverlay.open&&this.setRevealed(!1)},this.onFocusIn=event=>{this.setRevealed(!0);const stops=this.logicalActions(),path=event.composedPath(),index=stops.findIndex(({action})=>action.matchesEventPath(path));if(index>=0){this.setActiveStop(stops,index,stops[index]);const base=this.renderRoot.querySelector('[part="base"]'),repair=base?captureComposedFocusRepair(this,base):null,stop=stops[index];this.focusedStop=stop&&repair?{index,owner:stop.owner,id:stop.action.id,source:stop.source,repair}:void 0}else this.focusedStop=void 0},this.onFocusOut=event=>{!this.hoverTarget?.matches(":hover")&&!this.slottedOverlay.open&&this.setRevealed(!1);const destination=event.relatedTarget;destination&&destination.nodeType===1&&!composedContains(this,destination)&&(this.focusedStop=void 0)},this.onStopMutations=records=>{this.reconcileStopsAfterChildren()},this.onSlotChange=()=>{const stops=this.logicalActions();this.setActiveStop(stops,Math.min(this.activeStopIndex,Math.max(0,stops.length-1))),this.reconcileStopsAfterChildren()},this.onToolbarActionsChange=event=>{event.stopPropagation(),this.reconcileStopsAfterChildren()},this.containSlottedFeedbackEvent=event=>{event.stopPropagation()},this.onToolbarKeyDown=e=>{const stops=this.logicalActions();if(stops.length===0)return;const path=e.composedPath(),originIndex=stops.findIndex(({action})=>action.matchesEventPath(path));if(originIndex<0&&path[0]!==e.currentTarget)return;const currentIndex=originIndex>=0?originIndex:this.activeStopIndex,forwardKey=this.effectiveDirection==="rtl"?"ArrowLeft":"ArrowRight",backwardKey=this.effectiveDirection==="rtl"?"ArrowRight":"ArrowLeft";let target;if(e.key===forwardKey)target=(currentIndex+1)%stops.length;else if(e.key===backwardKey)target=(currentIndex-1+stops.length)%stops.length;else if(e.key==="Home")target=0;else if(e.key==="End")target=stops.length-1;else return;e.preventDefault(),this.setActiveStop(stops,target),stops[target]?.action.focus()},this.onRegenerateClick=()=>{this.emit("lr-regenerate",null)},this.onEditClick=()=>{this.emit("lr-edit",null)}}static{this.defaultStrings={...super.defaultStrings,editMessage:LYRA_DEFAULT_editMessage,fieldRequired:LYRA_DEFAULT_fieldRequired,messageActionsLabel:LYRA_DEFAULT_messageActionsLabel,regenerateResponse:LYRA_DEFAULT_regenerateResponse}}static{this.collectionSupport=collectionSupport}static{this.ownedCollectionProperties=Object.freeze(["controls"])}static{this.styles=[LyraElement.styles,styles]}static{this.immutableEventDetails=Object.freeze(["lr-feedback-submit","lr-feedback-submit-request"])}get effectiveControls(){const seen=new Set,controls=[];for(const value of this.controls){if(typeof value!="string"||!MESSAGE_ACTION_CONTROLS.includes(value)||seen.has(value))continue;const control=value;seen.add(control),controls.push(control)}return controls}get feedbackPending(){return this.currentBuiltInFeedback()?.pending===!0}finalizePendingSubmit(submissionId){const feedback=this.currentBuiltInFeedback();return typeof submissionId=="string"&&submissionId.trim().length>0&&feedback!==void 0?feedback.finalizePendingSubmit(submissionId):!1}revertPendingSubmit(submissionId){const feedback=this.currentBuiltInFeedback();return typeof submissionId=="string"&&submissionId.trim().length>0&&feedback!==void 0?feedback.revertPendingSubmit(submissionId):!1}currentBuiltInFeedback(){const base=this.renderRoot.querySelector('[part="base"]'),feedback=base?.querySelector('lr-message-feedback[part~="feedback"]');return feedback&&feedback.parentElement===base&&feedback.getRootNode()===this.renderRoot&&feedback.isConnected?feedback:void 0}connectedCallback(){super.connectedCallback(),this.addEventListener("focusin",this.onFocusIn),this.addEventListener("focusout",this.onFocusOut),this.revealOnInteraction&&this.bindHoverTarget(),this.hasUpdated&&this.reconcileStopsAfterChildren()}disconnectedCallback(){this.stopSyncGeneration++,this.stopObserver?.disconnect(),this.stopObserver=void 0,this.releaseManagedStops(),this.focusedStop=void 0,this.unbindHoverTarget(),this.removeEventListener("focusin",this.onFocusIn),this.removeEventListener("focusout",this.onFocusOut),super.disconnectedCallback()}adoptedCallback(){super.adoptedCallback(),this.stopSyncGeneration++,this.stopObserver?.disconnect(),this.stopObserver=void 0,this.releaseManagedStops()}willUpdate(changed){super.willUpdate(changed),changed.has("revealOnInteraction")&&(this.revealOnInteraction?this.bindHoverTarget():this.unbindHoverTarget());const overlayOpen=this.slottedOverlay.open;overlayOpen!==this.slottedOverlayWasOpen&&(this.slottedOverlayWasOpen=overlayOpen,overlayOpen?this.setRevealed(!0):!this.hoverTarget?.matches(":hover")&&!this.matches(":focus-within")&&this.setRevealed(!1))}firstUpdated(changed){super.firstUpdated(changed),this.setActiveStop(this.logicalActions(),0),this.reconcileStopsAfterChildren()}updated(changed){if(super.updated(changed),changed.has("controls")){const stops=this.logicalActions();this.setActiveStop(stops,Math.min(this.activeStopIndex,Math.max(0,stops.length-1))),this.reconcileStopsAfterChildren()}}setRevealed(revealed){this.revealed!==revealed&&(this.revealed=revealed,this.toggleAttribute("data-revealed",revealed))}bindHoverTarget(){this.unbindHoverTarget();const target=this.closest("lr-chat-message")??this.parentElement;target&&(this.hoverTarget=target,target.addEventListener("pointerenter",this.onHoverTargetEnter),target.addEventListener("pointerleave",this.onHoverTargetLeave))}unbindHoverTarget(){this.hoverTarget?.removeEventListener("pointerenter",this.onHoverTargetEnter),this.hoverTarget?.removeEventListener("pointerleave",this.onHoverTargetLeave),this.hoverTarget=null,this.setRevealed(!1)}actionRoots(){const base=this.renderRoot.querySelector('[part="base"]');if(!base)return[];const direct=[...base.children].filter(element=>element.localName!=="slot"),slot=base.querySelector("slot");return[...direct,...slot?.assignedElements({flatten:!0})??[]]}sameAction(left,right){return left.owner===right.owner&&left.source===right.source&&left.action.id===right.action.id}isAvailable(action){try{return action.disabled!==!0}catch{return!1}}directActionFor(element){let action=this.directActions.get(element);if(action)return action;const target=element,id=`direct-${++this.nextDirectActionId}`;let leasedTarget,leasedAuthoredTabIndex=null,lastManagedTabIndex=null,consumerOwnsTabIndex=!1;const releaseTabIndex=()=>{const leased=leasedTarget;leased&&leased.getAttribute("tabindex")===lastManagedTabIndex&&(leasedAuthoredTabIndex===null?leased.removeAttribute("tabindex"):leased.setAttribute("tabindex",leasedAuthoredTabIndex)),leasedTarget=void 0,leasedAuthoredTabIndex=null,lastManagedTabIndex=null,consumerOwnsTabIndex=!1};return action={id,get disabled(){return!isComposedFocusAvailable(element)},focus(options){target.focus(options)},setTabIndex(tabIndex){if(leasedTarget!==target&&(releaseTabIndex(),leasedTarget=target,leasedAuthoredTabIndex=target.getAttribute("tabindex")),consumerOwnsTabIndex||lastManagedTabIndex!==null&&target.getAttribute("tabindex")!==lastManagedTabIndex){consumerOwnsTabIndex=!0;return}target.tabIndex=tabIndex,lastManagedTabIndex=target.getAttribute("tabindex")},releaseTabIndex,hasAuthoredTabIndex(){return leasedTarget!==target?target.hasAttribute("tabindex"):lastManagedTabIndex!==null&&target.getAttribute("tabindex")===lastManagedTabIndex?leasedAuthoredTabIndex!==null:target.hasAttribute("tabindex")},matchesEventPath(path){return path.includes(element)}},this.directActions.set(element,action),action}logicalActions(){const actions=[],addProvider=(owner,provider)=>{const getToolbarActions=dataCallable(provider,"getToolbarActions");if(!getToolbarActions)return;let provided;try{provided=Reflect.apply(getToolbarActions,provider,[])}catch{return}let isArray=!1;try{isArray=Array.isArray(provided)}catch{return}if(!isArray)return;const length=getOwnDataDescriptor(provided,"length");if(length===MISSING_OWN_DATA_DESCRIPTOR||length===UNSAFE_OWN_DATA_DESCRIPTOR||typeof length.value!="number"||!Number.isSafeInteger(length.value)||length.value<0)return;const seen=new Set,inspected=Math.min(length.value,MAX_TOOLBAR_ACTIONS);for(let index=0;index<inspected;index+=1){const candidate=getOwnDataDescriptor(provided,String(index));if(candidate===MISSING_OWN_DATA_DESCRIPTOR||candidate===UNSAFE_OWN_DATA_DESCRIPTOR)continue;const projected=projectToolbarAction(candidate.value);!projected||seen.has(projected.action.id)||(seen.add(projected.action.id),this.isAvailable(projected.action)&&actions.push({owner,...projected}))}},visit=element=>{if(isLyraToolbarActionProvider(element)){addProvider(element,element);return}const knownAction=this.directActions.get(element);if(isSemanticActionElement(element)||(knownAction?.hasAuthoredTabIndex()??element.hasAttribute("tabindex"))){const action=this.directActionFor(element);this.isAvailable(action)&&actions.push({owner:element,action,source:action});return}for(const child of element.children)visit(child)};for(const root of this.actionRoots())visit(root);return actions}setActiveStop(stops,index,preferred){this.stopObserver?.disconnect();for(const previous of this.managedStops)stops.some(stop=>this.sameAction(stop,previous))||this.releaseManagedStop(previous);const preferredIndex=preferred?stops.findIndex(stop=>this.sameAction(stop,preferred)):-1;this.activeStopIndex=stops.length===0?0:preferredIndex>=0?preferredIndex:Math.min(Math.max(0,index),stops.length-1),stops.forEach(({action},stopIndex)=>{try{action.setTabIndex(stopIndex===this.activeStopIndex?0:-1)}catch{}}),this.managedStops=stops,this.observeStopChanges()}releaseManagedStop(stop){try{stop.action.releaseTabIndex?.()}catch{}this.directActions.get(stop.owner)===stop.action&&this.directActions.delete(stop.owner)}releaseManagedStops(){for(const stop of this.managedStops)this.releaseManagedStop(stop);this.managedStops=[]}observeStopChanges(){this.stopObserver?.disconnect();const Observer=this.ownerDocument.defaultView?.MutationObserver,base=this.renderRoot.querySelector('[part="base"]');if(!Observer||!base||!this.isConnected){this.stopObserver=void 0;return}const observer=new Observer(this.onStopMutations),roots=new Set([base,...this.actionRoots()]),options={attributes:!0,attributeOldValue:!0,attributeFilter:["aria-disabled","aria-hidden","contenteditable","controls","disabled","hidden","href","inert","open","role","tabindex","type"],childList:!0,subtree:!0};for(const root of roots)observer.observe(root,options);this.stopObserver=observer}async reconcileStopsAfterChildren(){const generation=++this.stopSyncGeneration,pending=this.actionRoots().map(root=>root.updateComplete).filter(value=>value!==void 0&&typeof value.then=="function");if(await Promise.all(pending),await Promise.resolve(),generation!==this.stopSyncGeneration||!this.isConnected)return;const stops=this.logicalActions(),focused=this.focusedStop,retainedIndex=focused?stops.findIndex(stop=>stop.owner===focused.owner&&stop.source===focused.source&&stop.action.id===focused.id):-1,targetIndex=retainedIndex>=0?retainedIndex:Math.min(focused?Math.max(0,focused.index):this.activeStopIndex,Math.max(0,stops.length-1));if(this.setActiveStop(stops,targetIndex),focused&&retainedIndex<0){const base=this.renderRoot.querySelector('[part="base"]');base&&applyComposedFocusRepair(focused.repair,base)&&stops[targetIndex]?.action.focus(),this.focusedStop===focused&&(this.focusedStop=void 0)}}renderControl(type){switch(type){case"copy":return this.copyText?html`<lr-copy-button
12
+ `}class LyraMessageActions extends LyraElement{constructor(){super(...arguments),this.controls=[],this.copyText="",this.feedbackRating=null,this.revealOnInteraction=!1,this.accessibleLabel=null,this.activeStopIndex=0,this.revealed=!1,this.hoverTarget=null,this.slottedOverlay=new SlottedOverlayController(this,()=>this.renderRoot?.querySelector('[part="base"] > slot:not([name])')),this.slottedOverlayWasOpen=!1,this.stopSyncGeneration=0,this.managedStops=[],this.directActions=new WeakMap,this.nextDirectActionId=0,this.onHoverTargetEnter=()=>{this.setRevealed(!0)},this.onHoverTargetLeave=()=>{!this.matches(":focus-within")&&!this.slottedOverlay.open&&this.setRevealed(!1)},this.onFocusIn=event=>{this.setRevealed(!0);const stops=this.logicalActions(),path=event.composedPath(),index=stops.findIndex(({action})=>action.matchesEventPath(path));if(index>=0){this.setActiveStop(stops,index,stops[index]);const base=this.renderRoot.querySelector('[part="base"]'),repair=base?captureComposedFocusRepair(this,base):null,stop=stops[index];this.focusedStop=stop&&repair?{index,owner:stop.owner,id:stop.action.id,source:stop.source,repair}:void 0}else this.focusedStop=void 0},this.onFocusOut=event=>{!this.hoverTarget?.matches(":hover")&&!this.slottedOverlay.open&&this.setRevealed(!1);const destination=event.relatedTarget;destination&&destination.nodeType===1&&!composedContains(this,destination)&&(this.focusedStop=void 0)},this.onStopMutations=records=>{this.reconcileStopsAfterChildren()},this.onSlotChange=()=>{const stops=this.logicalActions();this.setActiveStop(stops,Math.min(this.activeStopIndex,Math.max(0,stops.length-1))),this.reconcileStopsAfterChildren()},this.onToolbarActionsChange=event=>{event.stopPropagation(),this.reconcileStopsAfterChildren()},this.containSlottedFeedbackEvent=event=>{event.stopPropagation()},this.onToolbarKeyDown=e=>{const stops=this.logicalActions();if(stops.length===0)return;const path=e.composedPath(),originIndex=stops.findIndex(({action})=>action.matchesEventPath(path));if(originIndex<0&&path[0]!==e.currentTarget)return;const currentIndex=originIndex>=0?originIndex:this.activeStopIndex,forwardKey=this.effectiveDirection==="rtl"?"ArrowLeft":"ArrowRight",backwardKey=this.effectiveDirection==="rtl"?"ArrowRight":"ArrowLeft";let target;if(e.key===forwardKey)target=(currentIndex+1)%stops.length;else if(e.key===backwardKey)target=(currentIndex-1+stops.length)%stops.length;else if(e.key==="Home")target=0;else if(e.key==="End")target=stops.length-1;else return;e.preventDefault(),this.setActiveStop(stops,target),stops[target]?.action.focus()},this.onRegenerateClick=()=>{this.emit("lr-regenerate",null)},this.onEditClick=()=>{this.emit("lr-edit",null)}}static{this.defaultStrings={...super.defaultStrings,editMessage:LYRA_DEFAULT_editMessage,fieldRequired:LYRA_DEFAULT_fieldRequired,messageActionsLabel:LYRA_DEFAULT_messageActionsLabel,regenerateResponse:LYRA_DEFAULT_regenerateResponse}}static{this.collectionSupport=collectionSupport}static{this.ownedCollectionProperties=Object.freeze(["controls"])}static{this.styles=[LyraElement.styles,styles]}static{this.immutableEventDetails=Object.freeze(["lr-feedback-submit-request"])}get effectiveControls(){const seen=new Set,controls=[];for(const value of this.controls){if(typeof value!="string"||!MESSAGE_ACTION_CONTROLS.includes(value)||seen.has(value))continue;const control=value;seen.add(control),controls.push(control)}return controls}get feedbackPending(){return this.currentBuiltInFeedback()?.pending===!0}finalizePendingSubmit(submissionId){const feedback=this.currentBuiltInFeedback();return typeof submissionId=="string"&&submissionId.trim().length>0&&feedback!==void 0?feedback.finalizePendingSubmit(submissionId):!1}revertPendingSubmit(submissionId){const feedback=this.currentBuiltInFeedback();return typeof submissionId=="string"&&submissionId.trim().length>0&&feedback!==void 0?feedback.revertPendingSubmit(submissionId):!1}currentBuiltInFeedback(){const base=this.renderRoot.querySelector('[part="base"]'),feedback=base?.querySelector('lr-message-feedback[part~="feedback"]');return feedback&&feedback.parentElement===base&&feedback.getRootNode()===this.renderRoot&&feedback.isConnected?feedback:void 0}connectedCallback(){super.connectedCallback(),this.addEventListener("focusin",this.onFocusIn),this.addEventListener("focusout",this.onFocusOut),this.revealOnInteraction&&this.bindHoverTarget(),this.hasUpdated&&this.reconcileStopsAfterChildren()}disconnectedCallback(){this.stopSyncGeneration++,this.stopObserver?.disconnect(),this.stopObserver=void 0,this.releaseManagedStops(),this.focusedStop=void 0,this.unbindHoverTarget(),this.removeEventListener("focusin",this.onFocusIn),this.removeEventListener("focusout",this.onFocusOut),super.disconnectedCallback()}adoptedCallback(){super.adoptedCallback(),this.stopSyncGeneration++,this.stopObserver?.disconnect(),this.stopObserver=void 0,this.releaseManagedStops()}willUpdate(changed){super.willUpdate(changed),changed.has("revealOnInteraction")&&(this.revealOnInteraction?this.bindHoverTarget():this.unbindHoverTarget());const overlayOpen=this.slottedOverlay.open;overlayOpen!==this.slottedOverlayWasOpen&&(this.slottedOverlayWasOpen=overlayOpen,overlayOpen?this.setRevealed(!0):!this.hoverTarget?.matches(":hover")&&!this.matches(":focus-within")&&this.setRevealed(!1))}firstUpdated(changed){super.firstUpdated(changed),this.setActiveStop(this.logicalActions(),0),this.reconcileStopsAfterChildren()}updated(changed){if(super.updated(changed),changed.has("controls")){const stops=this.logicalActions();this.setActiveStop(stops,Math.min(this.activeStopIndex,Math.max(0,stops.length-1))),this.reconcileStopsAfterChildren()}}setRevealed(revealed){this.revealed!==revealed&&(this.revealed=revealed,this.toggleAttribute("data-revealed",revealed))}bindHoverTarget(){this.unbindHoverTarget();const target=this.closest("lr-chat-message")??this.parentElement;target&&(this.hoverTarget=target,target.addEventListener("pointerenter",this.onHoverTargetEnter),target.addEventListener("pointerleave",this.onHoverTargetLeave))}unbindHoverTarget(){this.hoverTarget?.removeEventListener("pointerenter",this.onHoverTargetEnter),this.hoverTarget?.removeEventListener("pointerleave",this.onHoverTargetLeave),this.hoverTarget=null,this.setRevealed(!1)}actionRoots(){const base=this.renderRoot.querySelector('[part="base"]');if(!base)return[];const direct=[...base.children].filter(element=>element.localName!=="slot"),slot=base.querySelector("slot");return[...direct,...slot?.assignedElements({flatten:!0})??[]]}sameAction(left,right){return left.owner===right.owner&&left.source===right.source&&left.action.id===right.action.id}isAvailable(action){try{return action.disabled!==!0}catch{return!1}}directActionFor(element){let action=this.directActions.get(element);if(action)return action;const target=element,id=`direct-${++this.nextDirectActionId}`;let leasedTarget,leasedAuthoredTabIndex=null,lastManagedTabIndex=null,consumerOwnsTabIndex=!1;const releaseTabIndex=()=>{const leased=leasedTarget;leased&&leased.getAttribute("tabindex")===lastManagedTabIndex&&(leasedAuthoredTabIndex===null?leased.removeAttribute("tabindex"):leased.setAttribute("tabindex",leasedAuthoredTabIndex)),leasedTarget=void 0,leasedAuthoredTabIndex=null,lastManagedTabIndex=null,consumerOwnsTabIndex=!1};return action={id,get disabled(){return!isComposedFocusAvailable(element)},focus(options){target.focus(options)},setTabIndex(tabIndex){if(leasedTarget!==target&&(releaseTabIndex(),leasedTarget=target,leasedAuthoredTabIndex=target.getAttribute("tabindex")),consumerOwnsTabIndex||lastManagedTabIndex!==null&&target.getAttribute("tabindex")!==lastManagedTabIndex){consumerOwnsTabIndex=!0;return}target.tabIndex=tabIndex,lastManagedTabIndex=target.getAttribute("tabindex")},releaseTabIndex,hasAuthoredTabIndex(){return leasedTarget!==target?target.hasAttribute("tabindex"):lastManagedTabIndex!==null&&target.getAttribute("tabindex")===lastManagedTabIndex?leasedAuthoredTabIndex!==null:target.hasAttribute("tabindex")},matchesEventPath(path){return path.includes(element)}},this.directActions.set(element,action),action}logicalActions(){const actions=[],addProvider=(owner,provider)=>{const getToolbarActions=dataCallable(provider,"getToolbarActions");if(!getToolbarActions)return;let provided;try{provided=Reflect.apply(getToolbarActions,provider,[])}catch{return}let isArray=!1;try{isArray=Array.isArray(provided)}catch{return}if(!isArray)return;const length=getOwnDataDescriptor(provided,"length");if(length===MISSING_OWN_DATA_DESCRIPTOR||length===UNSAFE_OWN_DATA_DESCRIPTOR||typeof length.value!="number"||!Number.isSafeInteger(length.value)||length.value<0)return;const seen=new Set,inspected=Math.min(length.value,MAX_TOOLBAR_ACTIONS);for(let index=0;index<inspected;index+=1){const candidate=getOwnDataDescriptor(provided,String(index));if(candidate===MISSING_OWN_DATA_DESCRIPTOR||candidate===UNSAFE_OWN_DATA_DESCRIPTOR)continue;const projected=projectToolbarAction(candidate.value);!projected||seen.has(projected.action.id)||(seen.add(projected.action.id),this.isAvailable(projected.action)&&actions.push({owner,...projected}))}},visit=element=>{if(isLyraToolbarActionProvider(element)){addProvider(element,element);return}const knownAction=this.directActions.get(element);if(isSemanticActionElement(element)||(knownAction?.hasAuthoredTabIndex()??element.hasAttribute("tabindex"))){const action=this.directActionFor(element);this.isAvailable(action)&&actions.push({owner:element,action,source:action});return}for(const child of element.children)visit(child)};for(const root of this.actionRoots())visit(root);return actions}setActiveStop(stops,index,preferred){this.stopObserver?.disconnect();for(const previous of this.managedStops)stops.some(stop=>this.sameAction(stop,previous))||this.releaseManagedStop(previous);const preferredIndex=preferred?stops.findIndex(stop=>this.sameAction(stop,preferred)):-1;this.activeStopIndex=stops.length===0?0:preferredIndex>=0?preferredIndex:Math.min(Math.max(0,index),stops.length-1),stops.forEach(({action},stopIndex)=>{try{action.setTabIndex(stopIndex===this.activeStopIndex?0:-1)}catch{}}),this.managedStops=stops,this.observeStopChanges()}releaseManagedStop(stop){try{stop.action.releaseTabIndex?.()}catch{}this.directActions.get(stop.owner)===stop.action&&this.directActions.delete(stop.owner)}releaseManagedStops(){for(const stop of this.managedStops)this.releaseManagedStop(stop);this.managedStops=[]}observeStopChanges(){this.stopObserver?.disconnect();const Observer=this.ownerDocument.defaultView?.MutationObserver,base=this.renderRoot.querySelector('[part="base"]');if(!Observer||!base||!this.isConnected){this.stopObserver=void 0;return}const observer=new Observer(this.onStopMutations),roots=new Set([base,...this.actionRoots()]),options={attributes:!0,attributeOldValue:!0,attributeFilter:["aria-disabled","aria-hidden","contenteditable","controls","disabled","hidden","href","inert","open","role","tabindex","type"],childList:!0,subtree:!0};for(const root of roots)observer.observe(root,options);this.stopObserver=observer}async reconcileStopsAfterChildren(){const generation=++this.stopSyncGeneration,pending=this.actionRoots().map(root=>root.updateComplete).filter(value=>value!==void 0&&typeof value.then=="function");if(await Promise.all(pending),await Promise.resolve(),generation!==this.stopSyncGeneration||!this.isConnected)return;const stops=this.logicalActions(),focused=this.focusedStop,retainedIndex=focused?stops.findIndex(stop=>stop.owner===focused.owner&&stop.source===focused.source&&stop.action.id===focused.id):-1,targetIndex=retainedIndex>=0?retainedIndex:Math.min(focused?Math.max(0,focused.index):this.activeStopIndex,Math.max(0,stops.length-1));if(this.setActiveStop(stops,targetIndex),focused&&retainedIndex<0){const base=this.renderRoot.querySelector('[part="base"]');base&&applyComposedFocusRepair(focused.repair,base)&&stops[targetIndex]?.action.focus(),this.focusedStop===focused&&(this.focusedStop=void 0)}}renderControl(type){switch(type){case"copy":return this.copyText?html`<lr-copy-button
13
13
  part="copy-button"
14
14
  .value=${this.copyText}
15
15
  ></lr-copy-button>`:nothing;case"regenerate":return html`<lr-icon-button
@@ -2,9 +2,7 @@ import type{LyraEventDetailSnapshot}from'../../../internal/lyra-element.js';impo
2
2
  /** Native `<textarea wrap>` values accepted by the optional comment field. */
3
3
  export type MessageFeedbackWrap=LyraTextWrap;export interface MessageFeedbackSubmitDetail{rating:MessageFeedbackValue;reasonIds:string[];comment:string;
4
4
  /** Opaque, nonblank correlation identity for this one feedback persistence transaction. */
5
- readonly submissionId:string;}export interface LyraMessageFeedbackEventMap{
6
- /** @deprecated Use `lr-feedback-submit-request`. */
7
- 'lr-feedback-submit':LyraMessageFeedbackEventMap['lr-feedback-submit-request'];'lr-feedback-change':CustomEvent<{rating:MessageFeedbackValue;}>;'lr-feedback-submit-request':CustomEvent<LyraEventDetailSnapshot<MessageFeedbackSubmitDetail>>;'lr-toolbar-actions-change':Event;blur:CustomEvent<null>;focus:CustomEvent<null>;}
5
+ readonly submissionId:string;}export interface LyraMessageFeedbackEventMap{'lr-feedback-change':CustomEvent<{rating:MessageFeedbackValue;}>;'lr-feedback-submit-request':CustomEvent<LyraEventDetailSnapshot<MessageFeedbackSubmitDetail>>;'lr-toolbar-actions-change':Event;blur:CustomEvent<null>;focus:CustomEvent<null>;}
8
6
  /**
9
7
  * `<lr-message-feedback>` — thumbs up/down for one assistant message, with an optional inline
10
8
  * detail step (categorical reason chips + a free-text comment) that opens as a disclosure directly
@@ -27,7 +25,6 @@ readonly submissionId:string;}export interface LyraMessageFeedbackEventMap{
27
25
  * @customElement lr-message-feedback
28
26
  * @event lr-feedback-change - `detail: { rating }`. Fires whenever thumb interaction changes the
29
27
  * provisional rating, including clearing it to `null`.
30
- * @event lr-feedback-submit - Deprecated cancelable compatibility alias of `lr-feedback-submit-request`.
31
28
  * @event lr-feedback-submit-request - Frozen `detail: { rating, reasonIds, comment, submissionId }`, fired
32
29
  * immediately for a thumbs-only terminal choice or by the detail panel's submit button.
33
30
  * `submissionId` is a nonblank, never-reused transaction identity. Cancelable:
@@ -1,4 +1,4 @@
1
- import{__decorate}from"tslib";import{warnDeprecatedUsage}from"../../../internal/dev-mode-attribute-warning.js";import{collectionSupport}from"../../../internal/collection-snapshot.js";import{html,nothing,svg}from"lit";import{property,query,state}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{nextId}from"../../../internal/a11y.js";import{deepActiveElementIn}from"../../../internal/active-element.js";import{composedContains}from"../../../internal/overlay-stack.js";import{getOwnDataDescriptor,MISSING_OWN_DATA_DESCRIPTOR,UNSAFE_OWN_DATA_DESCRIPTOR}from"../../../internal/data-descriptors.js";import{autocorrectConverter,declaredDefaultConverter,normalizeAutocorrect,omittedEmptyStringConverter,trueDefaultSpellcheckConverter}from"../../../internal/converters.js";import{styles}from"./message-feedback.styles.js";import{LYRA_DEFAULT_feedbackCommentLabel,LYRA_DEFAULT_feedbackCommentPlaceholder,LYRA_DEFAULT_feedbackNegative,LYRA_DEFAULT_feedbackPositive,LYRA_DEFAULT_feedbackReasonsLabel,LYRA_DEFAULT_feedbackSubmit,LYRA_DEFAULT_feedbackSubmitted}from"../../../internal/default-strings.generated.js";function thumbIcon(direction,filled){return svg`
1
+ import{__decorate}from"tslib";import{collectionSupport}from"../../../internal/collection-snapshot.js";import{html,nothing,svg}from"lit";import{property,query,state}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{nextId}from"../../../internal/a11y.js";import{deepActiveElementIn}from"../../../internal/active-element.js";import{composedContains}from"../../../internal/overlay-stack.js";import{getOwnDataDescriptor,MISSING_OWN_DATA_DESCRIPTOR,UNSAFE_OWN_DATA_DESCRIPTOR}from"../../../internal/data-descriptors.js";import{autocorrectConverter,declaredDefaultConverter,normalizeAutocorrect,omittedEmptyStringConverter,trueDefaultSpellcheckConverter}from"../../../internal/converters.js";import{styles}from"./message-feedback.styles.js";import{LYRA_DEFAULT_feedbackCommentLabel,LYRA_DEFAULT_feedbackCommentPlaceholder,LYRA_DEFAULT_feedbackNegative,LYRA_DEFAULT_feedbackPositive,LYRA_DEFAULT_feedbackReasonsLabel,LYRA_DEFAULT_feedbackSubmit,LYRA_DEFAULT_feedbackSubmitted}from"../../../internal/default-strings.generated.js";function thumbIcon(direction,filled){return svg`
2
2
  <svg
3
3
  width="1em"
4
4
  height="1em"
@@ -11,7 +11,7 @@ import{__decorate}from"tslib";import{warnDeprecatedUsage}from"../../../internal/
11
11
  aria-hidden="true"
12
12
  focusable="false"
13
13
  ><path d=${direction==="up"?"M7 11v9a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1h3Z":"M17 13V4a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v8h4Z"}></path><path d=${direction==="up"?"M7 11l3.5-7A2 2 0 0 1 12 3a1 1 0 0 1 1 1v6h4.5a2 2 0 0 1 2 2.3l-1.2 7A2 2 0 0 1 16.3 21H9a2 2 0 0 1-2-2v-8Z":"M17 13l-3.5 7A2 2 0 0 1 12 21a1 1 0 0 1-1-1v-6H6.5a2 2 0 0 1-2-2.3l1.2-7A2 2 0 0 1 7.7 3H15a2 2 0 0 1 2 2v8Z"}></path></svg>
14
- `}const MAX_PROJECTED_FEEDBACK_REASONS=1e4,EMPTY_FEEDBACK_DETAIL_PROJECTION=Object.freeze({reasons:Object.freeze([]),commentable:!1});function isObjectValue(value){return value!==null&&(typeof value=="object"||typeof value=="function")}function isArrayValue(value){try{return Array.isArray(value)}catch{return!1}}function projectFeedbackDetail(detail){if(!isObjectValue(detail))return EMPTY_FEEDBACK_DETAIL_PROJECTION;const reasonsDescriptor=getOwnDataDescriptor(detail,"reasons"),commentableDescriptor=getOwnDataDescriptor(detail,"commentable"),commentable=commentableDescriptor!==MISSING_OWN_DATA_DESCRIPTOR&&commentableDescriptor!==UNSAFE_OWN_DATA_DESCRIPTOR&&commentableDescriptor.value===!0,reasonsValue=reasonsDescriptor!==MISSING_OWN_DATA_DESCRIPTOR&&reasonsDescriptor!==UNSAFE_OWN_DATA_DESCRIPTOR?reasonsDescriptor.value:void 0;if(!isArrayValue(reasonsValue))return commentable?Object.freeze({reasons:Object.freeze([]),commentable}):EMPTY_FEEDBACK_DETAIL_PROJECTION;const lengthDescriptor=getOwnDataDescriptor(reasonsValue,"length");if(lengthDescriptor===MISSING_OWN_DATA_DESCRIPTOR||lengthDescriptor===UNSAFE_OWN_DATA_DESCRIPTOR||typeof lengthDescriptor.value!="number"||!Number.isSafeInteger(lengthDescriptor.value)||lengthDescriptor.value<0)return commentable?Object.freeze({reasons:Object.freeze([]),commentable}):EMPTY_FEEDBACK_DETAIL_PROJECTION;const reasons=[],seen=new Set,length=Math.min(lengthDescriptor.value,MAX_PROJECTED_FEEDBACK_REASONS);for(let index=0;index<length;index+=1){const rowDescriptor=getOwnDataDescriptor(reasonsValue,String(index));if(rowDescriptor===MISSING_OWN_DATA_DESCRIPTOR||rowDescriptor===UNSAFE_OWN_DATA_DESCRIPTOR||!isObjectValue(rowDescriptor.value))continue;const row=rowDescriptor.value,idDescriptor=getOwnDataDescriptor(row,"id"),labelDescriptor=getOwnDataDescriptor(row,"label");if(idDescriptor===MISSING_OWN_DATA_DESCRIPTOR||idDescriptor===UNSAFE_OWN_DATA_DESCRIPTOR||labelDescriptor===MISSING_OWN_DATA_DESCRIPTOR||labelDescriptor===UNSAFE_OWN_DATA_DESCRIPTOR||typeof idDescriptor.value!="string"||typeof labelDescriptor.value!="string")continue;const id=idDescriptor.value,label=labelDescriptor.value;id.trim().length===0||seen.has(id)||(seen.add(id),reasons.push(Object.freeze({id,label})))}return Object.freeze({reasons:Object.freeze(reasons),commentable})}class LyraMessageFeedback extends LyraElement{constructor(){super(...arguments),this.rating=null,this.detailFor="down",this.disabled=!1,this.pending=!1,this.spellcheck=!0,this.autocapitalize="",this.autocorrectValue=!0,this.wrap="soft",this.panelOpen=!1,this.selectedReasonIds=[],this.commentDraft="",this.detailProjectionSource=Symbol("unprojected-feedback-detail"),this.detailProjection=EMPTY_FEEDBACK_DETAIL_PROJECTION,this.submissionSequence=0,this.submissionCount=0,this.legacyNoArgumentSettlementInvalidated=!1,this.lifecycleGeneration=0,this.focusGeneration=0,this.settingPending=!1,this.panelId=nextId("message-feedback-panel"),this.upToolbarAction=this.createToolbarAction("up"),this.downToolbarAction=this.createToolbarAction("down"),this.onPanelKeyDown=e=>{e.key==="Escape"&&(e.stopPropagation(),this.closePanel())},this.stopChipAliasEvent=event=>{event.stopPropagation()},this.onCommentInput=e=>{this.commentDraft=e.target.value},this.onCommentFocus=()=>{this.emit("focus",null)},this.onCommentBlur=()=>{this.emit("blur",null)},this.submissionRequestDispatching=!1,this.onSubmit=()=>{if(this.disabled||this.pending||!this.rating||!this.panelOpen)return;const validReasonIds=new Set(this.detailReasons.map(reason=>reason.id));this.requestSubmission({rating:this.rating,reasonIds:this.selectedReasonIds.filter(id=>validReasonIds.has(id)),comment:this.detailCommentable?this.commentDraft.trim():""},this.rating,!0)}}static{this.defaultStrings={...super.defaultStrings,feedbackCommentLabel:LYRA_DEFAULT_feedbackCommentLabel,feedbackCommentPlaceholder:LYRA_DEFAULT_feedbackCommentPlaceholder,feedbackNegative:LYRA_DEFAULT_feedbackNegative,feedbackPositive:LYRA_DEFAULT_feedbackPositive,feedbackReasonsLabel:LYRA_DEFAULT_feedbackReasonsLabel,feedbackSubmit:LYRA_DEFAULT_feedbackSubmit,feedbackSubmitted:LYRA_DEFAULT_feedbackSubmitted}}emitFeedbackSubmitRequest(detail){const request=this.emit("lr-feedback-submit-request",Object.freeze(detail),{cancelable:!0});return this.emit("lr-feedback-submit",Object.freeze(detail),{cancelable:!0}).defaultPrevented&&(warnDeprecatedUsage(this,"event","lr-feedback-submit","lr-feedback-submit-request"),request.preventDefault()),request}static{this.collectionSupport=collectionSupport}static{this.ownedCollectionProperties=Object.freeze(["detail"])}static{this.styles=[LyraElement.styles,styles]}static{this.immutableEventDetails=Object.freeze(["lr-feedback-submit","lr-feedback-submit-request"])}get autocorrect(){return this.autocorrectValue}set autocorrect(next){const previous=this.autocorrectValue;this.autocorrectValue=normalizeAutocorrect(next),this.requestUpdate("autocorrect",previous)}createToolbarAction(direction){const host=this,button=()=>direction==="up"?host.upButtonEl:host.downButtonEl;let leasedButton,authoredTabIndex=null,lastManagedTabIndex=null,consumerOwnsTabIndex=!1;const releaseTabIndex=()=>{const target=leasedButton;target&&target.getAttribute("tabindex")===lastManagedTabIndex&&(authoredTabIndex===null?target.removeAttribute("tabindex"):target.setAttribute("tabindex",authoredTabIndex)),leasedButton=void 0,authoredTabIndex=null,lastManagedTabIndex=null,consumerOwnsTabIndex=!1};return{id:direction,get disabled(){return!button()||button().disabled},focus(options){button()?.focus(options)},setTabIndex(tabIndex){const target=button();if(!target){releaseTabIndex();return}if(leasedButton!==target&&(releaseTabIndex(),leasedButton=target,authoredTabIndex=target.getAttribute("tabindex")),consumerOwnsTabIndex||lastManagedTabIndex!==null&&target.getAttribute("tabindex")!==lastManagedTabIndex){consumerOwnsTabIndex=!0;return}target.tabIndex=tabIndex,lastManagedTabIndex=target.getAttribute("tabindex")},releaseTabIndex,matchesEventPath(path){const target=button();return target!==void 0&&path.includes(target)}}}getToolbarActions(){return[this.upToolbarAction,this.downToolbarAction]}focus(options){(this.rating==="down"?this.downButtonEl:this.upButtonEl)?.focus(options)}blur(){this.upButtonEl?.blur(),this.downButtonEl?.blur()}click(){this.disabled||this.pending||(this.rating==="down"?this.downButtonEl:this.upButtonEl)?.click()}get detailReasons(){return this.currentDetailProjection.reasons}get detailCommentable(){return this.currentDetailProjection.commentable}get currentDetailProjection(){const detail=this.detail;return detail!==this.detailProjectionSource&&(this.detailProjectionSource=detail,this.detailProjection=projectFeedbackDetail(detail)),this.detailProjection}get hasDetailContent(){return this.detailReasons.length>0||this.detailCommentable}detailApplies(direction){return this.detailFor==="both"||this.detailFor===direction}requestUpdate(name,oldValue,options){const currentValue=name==="rating"?this.rating:name==="detail"?this.detail:name==="detailFor"?this.detailFor:name==="pending"?this.pending:void 0,changed=oldValue!==currentValue,internalRatingWrite=name==="rating"&&this.pendingInternalRating?.rating===this.rating;changed&&(name==="rating"||name==="detail"||name==="detailFor"||name==="pending")&&!(name==="rating"&&internalRatingWrite)&&(this.focusGeneration=(this.focusGeneration??0)+1,this.pendingSubmission&&(name!=="pending"||!this.settingPending&&this.pending===!1)&&this.invalidatePendingSubmission()),super.requestUpdate(name,oldValue,options)}disconnectedCallback(){this.lifecycleGeneration+=1,this.invalidatePendingSubmission(),this.upToolbarAction.releaseTabIndex?.(),this.downToolbarAction.releaseTabIndex?.(),super.disconnectedCallback()}adoptedCallback(){super.adoptedCallback(),this.lifecycleGeneration+=1,this.invalidatePendingSubmission(),this.upToolbarAction.releaseTabIndex?.(),this.downToolbarAction.releaseTabIndex?.()}willUpdate(changed){if(super.willUpdate(changed),changed.has("rating")){const internal=this.pendingInternalRating?.rating===this.rating;this.pendingInternalRating=void 0,internal||(this.invalidatePendingSubmission(),this.setPending(!1),this.panelOpen=!1,this.selectedReasonIds=[],this.commentDraft="")}if(changed.has("detail")){const validIds=new Set(this.detailReasons.map(reason=>reason.id));this.selectedReasonIds=this.selectedReasonIds.filter(id=>validIds.has(id)),this.detailCommentable||(this.commentDraft="")}this.panelOpen&&(!this.rating||!this.detailApplies(this.rating)||!this.hasDetailContent)&&(this.invalidatePendingSubmission(),this.setPending(!1),this.panelOpen=!1,changed.has("detailFor")&&(this.selectedReasonIds=[],this.commentDraft=""))}updated(changed){super.updated(changed),(changed.has("disabled")||changed.has("pending"))&&this.emit("lr-toolbar-actions-change")}setRatingFromInteraction(rating){this.pendingInternalRating={rating},this.rating=rating}activateThumb(next){if(this.disabled||this.pending)return;const previousRating=this.rating;if(this.rating===next){if(this.panelOpen){this.setRatingFromInteraction(null),this.panelOpen=!1,this.selectedReasonIds=[],this.commentDraft="",this.emit("lr-feedback-change",{rating:null}),this.requestSubmission({rating:null,reasonIds:[],comment:""},previousRating,!0);return}if(this.detailApplies(next)&&this.hasDetailContent){this.panelOpen=!0;return}this.setRatingFromInteraction(null),this.emit("lr-feedback-change",{rating:null}),this.requestSubmission({rating:null,reasonIds:[],comment:""},previousRating,!1);return}this.selectedReasonIds=[],this.commentDraft="",this.setRatingFromInteraction(next),this.panelOpen=this.detailApplies(next)&&this.hasDetailContent,this.emit("lr-feedback-change",{rating:next}),this.panelOpen||this.requestSubmission({rating:next,reasonIds:[],comment:""},previousRating,!1)}focusActiveThumb(){(this.rating==="down"?this.downButtonEl:this.upButtonEl)?.focus()}closePanel(){this.panelOpen&&(this.panelOpen=!1,this.focusActiveThumb())}toggleReason(id){this.disabled||this.pending||(this.selectedReasonIds=this.selectedReasonIds.includes(id)?this.selectedReasonIds.filter(r=>r!==id):[...this.selectedReasonIds,id])}setPending(pending){this.settingPending=!0,this.pending=pending,this.settingPending=!1}invalidatePendingSubmission(){const transaction=this.pendingSubmission;transaction&&(this.pendingSubmission=void 0,this.dispatchingSubmission===transaction&&(this.dispatchingSubmission=void 0),this.legacyNoArgumentSettlementInvalidated=!0,this.focusGeneration+=1,this.setPending(!1))}isCurrentPendingSubmission(transaction){return this.pendingSubmission===transaction&&this.pending&&this.isConnected&&transaction.lifecycleGeneration===this.lifecycleGeneration&&transaction.rating===this.rating&&transaction.detail===this.detail&&transaction.detailFor===this.detailFor?!0:(this.pendingSubmission===transaction&&this.invalidatePendingSubmission(),!1)}canSettleWithoutSubmissionId(transaction){return!this.legacyNoArgumentSettlementInvalidated&&this.submissionCount===1&&transaction.sequence===1}scheduleSettlementFocus(transaction,destination){const focusGeneration=++this.focusGeneration,lifecycleGeneration=transaction.lifecycleGeneration;this.ownsSettlementFocus()&&this.updateComplete.then(()=>{focusGeneration!==this.focusGeneration||lifecycleGeneration!==this.lifecycleGeneration||!this.isConnected||this.pending||this.pendingSubmission||!this.ownsSettlementFocus()||(destination==="submit"&&this.panelOpen?this.submitButtonEl?.focus():this.focusActiveThumb())})}ownsSettlementFocus(){const doc=this.ownerDocument,active=deepActiveElementIn(doc);return active===null||active===doc.body||active===doc.documentElement||composedContains(this,active)}settlePendingSubmission(settlement,submissionId){const transaction=this.pendingSubmission;if(!transaction||!this.isCurrentPendingSubmission(transaction))return!1;if(submissionId===void 0){if(!this.canSettleWithoutSubmissionId(transaction))return!1}else if(submissionId!==transaction.submissionId)return!1;return transaction.settlement?!1:this.dispatchingSubmission===transaction?(transaction.settlement=settlement,!0):(this.commitSettlement(transaction,settlement),!0)}commitSettlement(transaction,settlement){if(this.isCurrentPendingSubmission(transaction)){if(this.pendingSubmission=void 0,this.dispatchingSubmission===transaction&&(this.dispatchingSubmission=void 0),this.setPending(!1),settlement==="finalize"){this.panelOpen=!1,this.liveRegion?.announce(this.localize("feedbackSubmitted"),{force:!0}),this.scheduleSettlementFocus(transaction,"thumb");return}this.setRatingFromInteraction(transaction.previousRating),this.panelOpen=transaction.panelWasOpen,this.scheduleSettlementFocus(transaction,transaction.panelWasOpen?"submit":"thumb")}}finalizePendingSubmit(submissionId){return this.settlePendingSubmission("finalize",submissionId)}revertPendingSubmit(submissionId){return this.settlePendingSubmission("revert",submissionId)}requestSubmission(detail,previousRating,panelWasOpen){if(!this.submissionRequestDispatching){this.submissionRequestDispatching=!0;try{this.focusGeneration+=1;const sequence=++this.submissionSequence;this.submissionCount+=1;const transaction={submissionId:nextId("message-feedback-submission"),sequence,lifecycleGeneration:this.lifecycleGeneration,rating:this.rating,detail:this.detail,detailFor:this.detailFor,previousRating,panelWasOpen};this.pendingSubmission=transaction,this.setPending(!0),this.dispatchingSubmission=transaction;const event=this.emitFeedbackSubmitRequest({...detail,submissionId:transaction.submissionId});if(this.dispatchingSubmission===transaction&&(this.dispatchingSubmission=void 0),!this.isCurrentPendingSubmission(transaction))return;if(transaction.settlement){this.commitSettlement(transaction,transaction.settlement);return}event.defaultPrevented||this.commitSettlement(transaction,"finalize")}finally{this.submissionRequestDispatching=!1}}}renderThumb(direction){const pressed=this.rating===direction,canExpand=this.detailApplies(direction)&&this.hasDetailContent;return html`
14
+ `}const MAX_PROJECTED_FEEDBACK_REASONS=1e4,EMPTY_FEEDBACK_DETAIL_PROJECTION=Object.freeze({reasons:Object.freeze([]),commentable:!1});function isObjectValue(value){return value!==null&&(typeof value=="object"||typeof value=="function")}function isArrayValue(value){try{return Array.isArray(value)}catch{return!1}}function projectFeedbackDetail(detail){if(!isObjectValue(detail))return EMPTY_FEEDBACK_DETAIL_PROJECTION;const reasonsDescriptor=getOwnDataDescriptor(detail,"reasons"),commentableDescriptor=getOwnDataDescriptor(detail,"commentable"),commentable=commentableDescriptor!==MISSING_OWN_DATA_DESCRIPTOR&&commentableDescriptor!==UNSAFE_OWN_DATA_DESCRIPTOR&&commentableDescriptor.value===!0,reasonsValue=reasonsDescriptor!==MISSING_OWN_DATA_DESCRIPTOR&&reasonsDescriptor!==UNSAFE_OWN_DATA_DESCRIPTOR?reasonsDescriptor.value:void 0;if(!isArrayValue(reasonsValue))return commentable?Object.freeze({reasons:Object.freeze([]),commentable}):EMPTY_FEEDBACK_DETAIL_PROJECTION;const lengthDescriptor=getOwnDataDescriptor(reasonsValue,"length");if(lengthDescriptor===MISSING_OWN_DATA_DESCRIPTOR||lengthDescriptor===UNSAFE_OWN_DATA_DESCRIPTOR||typeof lengthDescriptor.value!="number"||!Number.isSafeInteger(lengthDescriptor.value)||lengthDescriptor.value<0)return commentable?Object.freeze({reasons:Object.freeze([]),commentable}):EMPTY_FEEDBACK_DETAIL_PROJECTION;const reasons=[],seen=new Set,length=Math.min(lengthDescriptor.value,MAX_PROJECTED_FEEDBACK_REASONS);for(let index=0;index<length;index+=1){const rowDescriptor=getOwnDataDescriptor(reasonsValue,String(index));if(rowDescriptor===MISSING_OWN_DATA_DESCRIPTOR||rowDescriptor===UNSAFE_OWN_DATA_DESCRIPTOR||!isObjectValue(rowDescriptor.value))continue;const row=rowDescriptor.value,idDescriptor=getOwnDataDescriptor(row,"id"),labelDescriptor=getOwnDataDescriptor(row,"label");if(idDescriptor===MISSING_OWN_DATA_DESCRIPTOR||idDescriptor===UNSAFE_OWN_DATA_DESCRIPTOR||labelDescriptor===MISSING_OWN_DATA_DESCRIPTOR||labelDescriptor===UNSAFE_OWN_DATA_DESCRIPTOR||typeof idDescriptor.value!="string"||typeof labelDescriptor.value!="string")continue;const id=idDescriptor.value,label=labelDescriptor.value;id.trim().length===0||seen.has(id)||(seen.add(id),reasons.push(Object.freeze({id,label})))}return Object.freeze({reasons:Object.freeze(reasons),commentable})}class LyraMessageFeedback extends LyraElement{constructor(){super(...arguments),this.rating=null,this.detailFor="down",this.disabled=!1,this.pending=!1,this.spellcheck=!0,this.autocapitalize="",this.autocorrectValue=!0,this.wrap="soft",this.panelOpen=!1,this.selectedReasonIds=[],this.commentDraft="",this.detailProjectionSource=Symbol("unprojected-feedback-detail"),this.detailProjection=EMPTY_FEEDBACK_DETAIL_PROJECTION,this.submissionSequence=0,this.submissionCount=0,this.legacyNoArgumentSettlementInvalidated=!1,this.lifecycleGeneration=0,this.focusGeneration=0,this.settingPending=!1,this.panelId=nextId("message-feedback-panel"),this.upToolbarAction=this.createToolbarAction("up"),this.downToolbarAction=this.createToolbarAction("down"),this.onPanelKeyDown=e=>{e.key==="Escape"&&(e.stopPropagation(),this.closePanel())},this.stopChipAliasEvent=event=>{event.stopPropagation()},this.onCommentInput=e=>{this.commentDraft=e.target.value},this.onCommentFocus=()=>{this.emit("focus",null)},this.onCommentBlur=()=>{this.emit("blur",null)},this.submissionRequestDispatching=!1,this.onSubmit=()=>{if(this.disabled||this.pending||!this.rating||!this.panelOpen)return;const validReasonIds=new Set(this.detailReasons.map(reason=>reason.id));this.requestSubmission({rating:this.rating,reasonIds:this.selectedReasonIds.filter(id=>validReasonIds.has(id)),comment:this.detailCommentable?this.commentDraft.trim():""},this.rating,!0)}}static{this.defaultStrings={...super.defaultStrings,feedbackCommentLabel:LYRA_DEFAULT_feedbackCommentLabel,feedbackCommentPlaceholder:LYRA_DEFAULT_feedbackCommentPlaceholder,feedbackNegative:LYRA_DEFAULT_feedbackNegative,feedbackPositive:LYRA_DEFAULT_feedbackPositive,feedbackReasonsLabel:LYRA_DEFAULT_feedbackReasonsLabel,feedbackSubmit:LYRA_DEFAULT_feedbackSubmit,feedbackSubmitted:LYRA_DEFAULT_feedbackSubmitted}}emitFeedbackSubmitRequest(detail){return this.emit("lr-feedback-submit-request",Object.freeze(detail),{cancelable:!0})}static{this.collectionSupport=collectionSupport}static{this.ownedCollectionProperties=Object.freeze(["detail"])}static{this.styles=[LyraElement.styles,styles]}static{this.immutableEventDetails=Object.freeze(["lr-feedback-submit-request"])}get autocorrect(){return this.autocorrectValue}set autocorrect(next){const previous=this.autocorrectValue;this.autocorrectValue=normalizeAutocorrect(next),this.requestUpdate("autocorrect",previous)}createToolbarAction(direction){const host=this,button=()=>direction==="up"?host.upButtonEl:host.downButtonEl;let leasedButton,authoredTabIndex=null,lastManagedTabIndex=null,consumerOwnsTabIndex=!1;const releaseTabIndex=()=>{const target=leasedButton;target&&target.getAttribute("tabindex")===lastManagedTabIndex&&(authoredTabIndex===null?target.removeAttribute("tabindex"):target.setAttribute("tabindex",authoredTabIndex)),leasedButton=void 0,authoredTabIndex=null,lastManagedTabIndex=null,consumerOwnsTabIndex=!1};return{id:direction,get disabled(){return!button()||button().disabled},focus(options){button()?.focus(options)},setTabIndex(tabIndex){const target=button();if(!target){releaseTabIndex();return}if(leasedButton!==target&&(releaseTabIndex(),leasedButton=target,authoredTabIndex=target.getAttribute("tabindex")),consumerOwnsTabIndex||lastManagedTabIndex!==null&&target.getAttribute("tabindex")!==lastManagedTabIndex){consumerOwnsTabIndex=!0;return}target.tabIndex=tabIndex,lastManagedTabIndex=target.getAttribute("tabindex")},releaseTabIndex,matchesEventPath(path){const target=button();return target!==void 0&&path.includes(target)}}}getToolbarActions(){return[this.upToolbarAction,this.downToolbarAction]}focus(options){(this.rating==="down"?this.downButtonEl:this.upButtonEl)?.focus(options)}blur(){this.upButtonEl?.blur(),this.downButtonEl?.blur()}click(){this.disabled||this.pending||(this.rating==="down"?this.downButtonEl:this.upButtonEl)?.click()}get detailReasons(){return this.currentDetailProjection.reasons}get detailCommentable(){return this.currentDetailProjection.commentable}get currentDetailProjection(){const detail=this.detail;return detail!==this.detailProjectionSource&&(this.detailProjectionSource=detail,this.detailProjection=projectFeedbackDetail(detail)),this.detailProjection}get hasDetailContent(){return this.detailReasons.length>0||this.detailCommentable}detailApplies(direction){return this.detailFor==="both"||this.detailFor===direction}requestUpdate(name,oldValue,options){const currentValue=name==="rating"?this.rating:name==="detail"?this.detail:name==="detailFor"?this.detailFor:name==="pending"?this.pending:void 0,changed=oldValue!==currentValue,internalRatingWrite=name==="rating"&&this.pendingInternalRating?.rating===this.rating;changed&&(name==="rating"||name==="detail"||name==="detailFor"||name==="pending")&&!(name==="rating"&&internalRatingWrite)&&(this.focusGeneration=(this.focusGeneration??0)+1,this.pendingSubmission&&(name!=="pending"||!this.settingPending&&this.pending===!1)&&this.invalidatePendingSubmission()),super.requestUpdate(name,oldValue,options)}disconnectedCallback(){this.lifecycleGeneration+=1,this.invalidatePendingSubmission(),this.upToolbarAction.releaseTabIndex?.(),this.downToolbarAction.releaseTabIndex?.(),super.disconnectedCallback()}adoptedCallback(){super.adoptedCallback(),this.lifecycleGeneration+=1,this.invalidatePendingSubmission(),this.upToolbarAction.releaseTabIndex?.(),this.downToolbarAction.releaseTabIndex?.()}willUpdate(changed){if(super.willUpdate(changed),changed.has("rating")){const internal=this.pendingInternalRating?.rating===this.rating;this.pendingInternalRating=void 0,internal||(this.invalidatePendingSubmission(),this.setPending(!1),this.panelOpen=!1,this.selectedReasonIds=[],this.commentDraft="")}if(changed.has("detail")){const validIds=new Set(this.detailReasons.map(reason=>reason.id));this.selectedReasonIds=this.selectedReasonIds.filter(id=>validIds.has(id)),this.detailCommentable||(this.commentDraft="")}this.panelOpen&&(!this.rating||!this.detailApplies(this.rating)||!this.hasDetailContent)&&(this.invalidatePendingSubmission(),this.setPending(!1),this.panelOpen=!1,changed.has("detailFor")&&(this.selectedReasonIds=[],this.commentDraft=""))}updated(changed){super.updated(changed),(changed.has("disabled")||changed.has("pending"))&&this.emit("lr-toolbar-actions-change")}setRatingFromInteraction(rating){this.pendingInternalRating={rating},this.rating=rating}activateThumb(next){if(this.disabled||this.pending)return;const previousRating=this.rating;if(this.rating===next){if(this.panelOpen){this.setRatingFromInteraction(null),this.panelOpen=!1,this.selectedReasonIds=[],this.commentDraft="",this.emit("lr-feedback-change",{rating:null}),this.requestSubmission({rating:null,reasonIds:[],comment:""},previousRating,!0);return}if(this.detailApplies(next)&&this.hasDetailContent){this.panelOpen=!0;return}this.setRatingFromInteraction(null),this.emit("lr-feedback-change",{rating:null}),this.requestSubmission({rating:null,reasonIds:[],comment:""},previousRating,!1);return}this.selectedReasonIds=[],this.commentDraft="",this.setRatingFromInteraction(next),this.panelOpen=this.detailApplies(next)&&this.hasDetailContent,this.emit("lr-feedback-change",{rating:next}),this.panelOpen||this.requestSubmission({rating:next,reasonIds:[],comment:""},previousRating,!1)}focusActiveThumb(){(this.rating==="down"?this.downButtonEl:this.upButtonEl)?.focus()}closePanel(){this.panelOpen&&(this.panelOpen=!1,this.focusActiveThumb())}toggleReason(id){this.disabled||this.pending||(this.selectedReasonIds=this.selectedReasonIds.includes(id)?this.selectedReasonIds.filter(r=>r!==id):[...this.selectedReasonIds,id])}setPending(pending){this.settingPending=!0,this.pending=pending,this.settingPending=!1}invalidatePendingSubmission(){const transaction=this.pendingSubmission;transaction&&(this.pendingSubmission=void 0,this.dispatchingSubmission===transaction&&(this.dispatchingSubmission=void 0),this.legacyNoArgumentSettlementInvalidated=!0,this.focusGeneration+=1,this.setPending(!1))}isCurrentPendingSubmission(transaction){return this.pendingSubmission===transaction&&this.pending&&this.isConnected&&transaction.lifecycleGeneration===this.lifecycleGeneration&&transaction.rating===this.rating&&transaction.detail===this.detail&&transaction.detailFor===this.detailFor?!0:(this.pendingSubmission===transaction&&this.invalidatePendingSubmission(),!1)}canSettleWithoutSubmissionId(transaction){return!this.legacyNoArgumentSettlementInvalidated&&this.submissionCount===1&&transaction.sequence===1}scheduleSettlementFocus(transaction,destination){const focusGeneration=++this.focusGeneration,lifecycleGeneration=transaction.lifecycleGeneration;this.ownsSettlementFocus()&&this.updateComplete.then(()=>{focusGeneration!==this.focusGeneration||lifecycleGeneration!==this.lifecycleGeneration||!this.isConnected||this.pending||this.pendingSubmission||!this.ownsSettlementFocus()||(destination==="submit"&&this.panelOpen?this.submitButtonEl?.focus():this.focusActiveThumb())})}ownsSettlementFocus(){const doc=this.ownerDocument,active=deepActiveElementIn(doc);return active===null||active===doc.body||active===doc.documentElement||composedContains(this,active)}settlePendingSubmission(settlement,submissionId){const transaction=this.pendingSubmission;if(!transaction||!this.isCurrentPendingSubmission(transaction))return!1;if(submissionId===void 0){if(!this.canSettleWithoutSubmissionId(transaction))return!1}else if(submissionId!==transaction.submissionId)return!1;return transaction.settlement?!1:this.dispatchingSubmission===transaction?(transaction.settlement=settlement,!0):(this.commitSettlement(transaction,settlement),!0)}commitSettlement(transaction,settlement){if(this.isCurrentPendingSubmission(transaction)){if(this.pendingSubmission=void 0,this.dispatchingSubmission===transaction&&(this.dispatchingSubmission=void 0),this.setPending(!1),settlement==="finalize"){this.panelOpen=!1,this.liveRegion?.announce(this.localize("feedbackSubmitted"),{force:!0}),this.scheduleSettlementFocus(transaction,"thumb");return}this.setRatingFromInteraction(transaction.previousRating),this.panelOpen=transaction.panelWasOpen,this.scheduleSettlementFocus(transaction,transaction.panelWasOpen?"submit":"thumb")}}finalizePendingSubmit(submissionId){return this.settlePendingSubmission("finalize",submissionId)}revertPendingSubmit(submissionId){return this.settlePendingSubmission("revert",submissionId)}requestSubmission(detail,previousRating,panelWasOpen){if(!this.submissionRequestDispatching){this.submissionRequestDispatching=!0;try{this.focusGeneration+=1;const sequence=++this.submissionSequence;this.submissionCount+=1;const transaction={submissionId:nextId("message-feedback-submission"),sequence,lifecycleGeneration:this.lifecycleGeneration,rating:this.rating,detail:this.detail,detailFor:this.detailFor,previousRating,panelWasOpen};this.pendingSubmission=transaction,this.setPending(!0),this.dispatchingSubmission=transaction;const event=this.emitFeedbackSubmitRequest({...detail,submissionId:transaction.submissionId});if(this.dispatchingSubmission===transaction&&(this.dispatchingSubmission=void 0),!this.isCurrentPendingSubmission(transaction))return;if(transaction.settlement){this.commitSettlement(transaction,transaction.settlement);return}event.defaultPrevented||this.commitSettlement(transaction,"finalize")}finally{this.submissionRequestDispatching=!1}}}renderThumb(direction){const pressed=this.rating===direction,canExpand=this.detailApplies(direction)&&this.hasDetailContent;return html`
15
15
  <button
16
16
  part=${direction==="up"?"up-button":"down-button"}
17
17
  type="button"
@@ -64,6 +64,7 @@ export type MessagePartsToolDisplay='chip'|'block';export interface LyraMessageP
64
64
  * so that nested code direction cannot be overridden with `::part()` from outside.
65
65
  *
66
66
  * @customElement lr-message-parts
67
+ * @attr {string | null} aria-label - Accessible name for the internal message-part group.
67
68
  * @event lr-citation-select - A citation part was activated. `detail: { citation }`.
68
69
  * @event lr-part-resume - Requests host-managed resume of an interrupted, resumable part. `detail: { part }`.
69
70
  * @event lr-part-retry - Retry was requested for a retryable error part. `detail: { part }`.
@@ -73,7 +74,6 @@ export type MessagePartsToolDisplay='chip'|'block';export interface LyraMessageP
73
74
  * @event lr-render-error - Passthrough from rendered Markdown, tool-result, or widget content, or
74
75
  * tool-call block (`callId` included).
75
76
  * @event lr-link-activate - Passthrough from rendered Markdown.
76
- * @event lr-link-click - Deprecated compatibility alias of `lr-link-activate`.
77
77
  * @event lr-highlight-activate - Passthrough from rendered Markdown.
78
78
  * @event lr-text-select - Passthrough from rendered Markdown.
79
79
  * @event lr-anchor-result - Passthrough from rendered Markdown.
@@ -146,10 +146,7 @@ codeBlockHeader:boolean;
146
146
  * even once an earlier citation rolls out of the rendered window. Opt in for a message that can
147
147
  * grow an unusually large number of parts (e.g. a long agentic run with many interleaved
148
148
  * tool-call/tool-result parts), where unbounded live DOM can visibly stall the main thread. */
149
- maxRenderedParts:number;
150
- /** Accessible name override for the internal message-part group.
151
- * @deprecated Use the host's native `aria-label` attribute. */
152
- get accessibleLabel():string|null;set accessibleLabel(value:string|null);private _accessibleLabel;private knownErrorIds;
149
+ maxRenderedParts:number;private knownErrorIds;
153
150
  /** First tool-call's projected `redactedFields` per invocation id; only non-empty entries. */
154
151
  private redactionByInvocation;private redactionMemo;private errorAnnouncementSink?;private suppressNextErrorAnnouncement;connectedCallback():void;disconnectedCallback():void;private get effectiveParts();
155
152
  /** `maxRenderedParts`, normalized to a finite non-negative integer (falling back to the
@@ -1,4 +1,4 @@
1
- import{__decorate}from"tslib";import{warnDeprecatedUsage}from"../../../internal/dev-mode-attribute-warning.js";import{collectionSupport}from"../../../internal/collection-snapshot.js";import{html,nothing}from"lit";import{property}from"lit/decorators.js";import{repeat}from"lit/directives/repeat.js";import{isToolCallStatus}from"../../agent-tools/tool-status.js";import{projectedRedactionFields,redactToolDetail,TOO_MANY_REDACTION_PATHS}from"../../agent-tools/tool-redaction.js";import{literalSetConverter}from"../../../internal/converters.js";import{finiteCount}from"../../../internal/numbers.js";import{LyraElement}from"../../../internal/lyra-element.js";import{safeMediaSrc}from"../../../internal/safe-url.js";import{acquireAnnouncementSink}from"../../../internal/announcer.js";import{isNonBlankIdentity,isRecord}from"../../retrieval/retrieval-identity.js";import{styles}from"./message-parts.styles.js";import{LYRA_DEFAULT_envListValueHidden,LYRA_DEFAULT_messagePartError,LYRA_DEFAULT_messagePartRetry,LYRA_DEFAULT_messagePartsLabel,LYRA_DEFAULT_retry,LYRA_DEFAULT_streamInterrupted,LYRA_DEFAULT_streamResume,LYRA_DEFAULT_thinkingPanelLabel}from"../../../internal/default-strings.generated.js";const MESSAGE_PARTS_CONTENT_MODES=Object.freeze(["plain","markdown"]),MESSAGE_PARTS_TOOL_DISPLAY=literalSetConverter(["chip","block"],"chip"),EMPTY_REDACTED_FIELDS=Object.freeze([]),TOOL_BLOCK_EXPORTPARTS="header:tool-block-header, body:tool-block-body, args:tool-block-args, result:tool-block-result, error:tool-block-error";function resolveBlockStatus(invocation,result){const status=isToolCallStatus(invocation.status)?invocation.status:"pending";return status==="denied"||status==="incomplete"?status:status==="error"||result&&"error"in result?"error":result&&result.state==="streaming"?"running":result?"success":status}function invocationDuration(invocation){if(invocation.startedAt==null||invocation.endedAt==null)return;const diff=invocation.endedAt-invocation.startedAt;return Number.isFinite(diff)?diff:void 0}function invocationDisplayName(invocation){return typeof invocation.displayName=="string"?invocation.displayName:void 0}function normalizeMessagePartsContentMode(value){return typeof value=="string"&&MESSAGE_PARTS_CONTENT_MODES.includes(value)?value:"markdown"}class LyraMessageParts extends LyraElement{constructor(){super(...arguments),this.parts=[],this.disabled=!1,this.contentModeValue="markdown",this.toolDisplayValue="chip",this.withoutReasoning=!1,this.streamingRender="plain",this.codeBlockHeader=!1,this.maxRenderedParts=0,this._accessibleLabel=null,this.knownErrorIds=new Set,this.redactionByInvocation=new Map,this.redactionMemo=new WeakMap,this.suppressNextErrorAnnouncement=!0,this.resumeDispatching=!1}static{this.defaultStrings={...super.defaultStrings,envListValueHidden:LYRA_DEFAULT_envListValueHidden,messagePartError:LYRA_DEFAULT_messagePartError,messagePartRetry:LYRA_DEFAULT_messagePartRetry,messagePartsLabel:LYRA_DEFAULT_messagePartsLabel,retry:LYRA_DEFAULT_retry,streamInterrupted:LYRA_DEFAULT_streamInterrupted,streamResume:LYRA_DEFAULT_streamResume,thinkingPanelLabel:LYRA_DEFAULT_thinkingPanelLabel}}static{this.collectionSupport=collectionSupport}static{this.ownedCollectionProperties=Object.freeze(["parts"])}static{this.styles=[LyraElement.styles,styles]}static{this.immutableEventDetails=Object.freeze(["lr-citation-select","lr-part-retry","lr-part-resume"])}get contentMode(){return this.contentModeValue}set contentMode(value){const previous=this.contentModeValue,normalized=normalizeMessagePartsContentMode(value);this.contentModeValue=normalized,typeof value=="string"&&value!==normalized&&this.getAttribute("content-mode")!==normalized&&this.setAttribute("content-mode",normalized),this.requestUpdate("contentMode",previous,{reflect:!0,hasChanged:()=>!0})}get toolDisplay(){return this.toolDisplayValue}set toolDisplay(value){const normalized=MESSAGE_PARTS_TOOL_DISPLAY.normalizeReflected(this,"tool-display",value),previous=this.toolDisplayValue;previous!==normalized&&(this.toolDisplayValue=normalized,this.requestUpdate("toolDisplay",previous))}get accessibleLabel(){return this._accessibleLabel}set accessibleLabel(value){value!==null&&!this.hasAttribute("aria-label")&&warnDeprecatedUsage(this,"property","accessibleLabel","ariaLabel");const previous=this._accessibleLabel;this._accessibleLabel=value,this.requestUpdate("accessibleLabel",previous)}connectedCallback(){super.connectedCallback(),this.errorAnnouncementSink?.element.ownerDocument!==this.ownerDocument&&(this.errorAnnouncementSink?.release(),this.errorAnnouncementSink=acquireAnnouncementSink("assertive",{document:this.ownerDocument,source:this}),this.hasUpdated&&(this.suppressNextErrorAnnouncement=!0,this.requestUpdate()))}disconnectedCallback(){super.disconnectedCallback(),this.errorAnnouncementSink?.release(),this.errorAnnouncementSink=void 0,this.suppressNextErrorAnnouncement=!0}get effectiveParts(){const seen=new Set;return this.parts.filter(part=>{const id=part?.id;return!isNonBlankIdentity(id)||seen.has(id)||part.type==="tool-call"&&!isRecord(part.invocation)||part.type==="citation"&&!isRecord(part.citation)||part.type==="attachment"&&!isRecord(part.document)?!1:(seen.add(id),!0)})}get effectiveMaxRenderedParts(){return finiteCount(this.maxRenderedParts,0)}get renderedParts(){const parts=this.effectiveParts,max=this.effectiveMaxRenderedParts;return max>0&&parts.length>max?parts.slice(-max):parts}willUpdate(changed){if(super.willUpdate(changed),!changed.has("parts")&&this.hasUpdated||(this.redactionByInvocation=this.projectRedactions(),!changed.has("parts")))return;const current=this.effectiveParts.filter(part=>part.type==="error");if(this.hasUpdated&&!this.suppressNextErrorAnnouncement)for(const part of current)this.knownErrorIds.has(part.id)||this.errorAnnouncementSink?.announce(part.message||this.localize("messagePartError"));this.knownErrorIds=new Set(current.map(part=>part.id))}projectRedactions(){const map=new Map,seen=new Set;for(const part of this.effectiveParts){if(part.type!=="tool-call")continue;const id=part.invocation.id;if(typeof id!="string"||seen.has(id))continue;seen.add(id);const paths=projectedRedactionFields(part.invocation.redactedFields)??TOO_MANY_REDACTION_PATHS;paths.length>0&&map.set(id,paths)}return map}redacted(part,invocationId,source){if(typeof invocationId!="string")return;const paths=this.redactionByInvocation.get(invocationId);if(!paths)return;const detail=redactToolDetail(source,paths,this.localize("envListValueHidden"),this.redactionMemo.get(part));return this.redactionMemo.set(part,detail),detail}updated(_changed){super.updated(_changed),this.suppressNextErrorAnnouncement=!1}selectCitation(event,part){event.stopPropagation(),this.emit("lr-citation-select",{citation:part.citation})}partNames(part){const parts=["part"];switch(part.type){case"text":parts.push("text");break;case"reasoning":parts.push("reasoning");break;case"tool-call":parts.push("tool-call");break;case"tool-result":parts.push("tool-result");break;case"citation":parts.push("citation");break;case"attachment":parts.push("attachment");break;case"data":parts.push("data");break;case"audio":parts.push("audio");break;case"error":parts.push("error");break}return part.state==="streaming"&&parts.push("part-streaming"),part.state==="interrupted"&&parts.push("part-interrupted"),parts.join(" ")}renderToolBlock(part,paired){const invocation=part.invocation,result=paired?paired.result:invocation.result,error=paired&&"error"in paired?paired.error:invocation.error,redactedFields=this.redactionByInvocation.get(invocation.id)??EMPTY_REDACTED_FIELDS;return html`<lr-tool-call-block
1
+ import{__decorate}from"tslib";import{collectionSupport}from"../../../internal/collection-snapshot.js";import{html,nothing}from"lit";import{property}from"lit/decorators.js";import{repeat}from"lit/directives/repeat.js";import{isToolCallStatus}from"../../agent-tools/tool-status.js";import{projectedRedactionFields,redactToolDetail,TOO_MANY_REDACTION_PATHS}from"../../agent-tools/tool-redaction.js";import{literalSetConverter}from"../../../internal/converters.js";import{finiteCount}from"../../../internal/numbers.js";import{LyraElement}from"../../../internal/lyra-element.js";import{safeMediaSrc}from"../../../internal/safe-url.js";import{acquireAnnouncementSink}from"../../../internal/announcer.js";import{isNonBlankIdentity,isRecord}from"../../retrieval/retrieval-identity.js";import{styles}from"./message-parts.styles.js";import{LYRA_DEFAULT_envListValueHidden,LYRA_DEFAULT_messagePartError,LYRA_DEFAULT_messagePartRetry,LYRA_DEFAULT_messagePartsLabel,LYRA_DEFAULT_retry,LYRA_DEFAULT_streamInterrupted,LYRA_DEFAULT_streamResume,LYRA_DEFAULT_thinkingPanelLabel}from"../../../internal/default-strings.generated.js";const MESSAGE_PARTS_CONTENT_MODES=Object.freeze(["plain","markdown"]),MESSAGE_PARTS_TOOL_DISPLAY=literalSetConverter(["chip","block"],"chip"),EMPTY_REDACTED_FIELDS=Object.freeze([]),TOOL_BLOCK_EXPORTPARTS="header:tool-block-header, body:tool-block-body, args:tool-block-args, result:tool-block-result, error:tool-block-error";function resolveBlockStatus(invocation,result){const status=isToolCallStatus(invocation.status)?invocation.status:"pending";return status==="denied"||status==="incomplete"?status:status==="error"||result&&"error"in result?"error":result&&result.state==="streaming"?"running":result?"success":status}function invocationDuration(invocation){if(invocation.startedAt==null||invocation.endedAt==null)return;const diff=invocation.endedAt-invocation.startedAt;return Number.isFinite(diff)?diff:void 0}function invocationDisplayName(invocation){return typeof invocation.displayName=="string"?invocation.displayName:void 0}function normalizeMessagePartsContentMode(value){return typeof value=="string"&&MESSAGE_PARTS_CONTENT_MODES.includes(value)?value:"markdown"}class LyraMessageParts extends LyraElement{constructor(){super(...arguments),this.parts=[],this.disabled=!1,this.contentModeValue="markdown",this.toolDisplayValue="chip",this.withoutReasoning=!1,this.streamingRender="plain",this.codeBlockHeader=!1,this.maxRenderedParts=0,this.knownErrorIds=new Set,this.redactionByInvocation=new Map,this.redactionMemo=new WeakMap,this.suppressNextErrorAnnouncement=!0,this.resumeDispatching=!1}static{this.defaultStrings={...super.defaultStrings,envListValueHidden:LYRA_DEFAULT_envListValueHidden,messagePartError:LYRA_DEFAULT_messagePartError,messagePartRetry:LYRA_DEFAULT_messagePartRetry,messagePartsLabel:LYRA_DEFAULT_messagePartsLabel,retry:LYRA_DEFAULT_retry,streamInterrupted:LYRA_DEFAULT_streamInterrupted,streamResume:LYRA_DEFAULT_streamResume,thinkingPanelLabel:LYRA_DEFAULT_thinkingPanelLabel}}static{this.collectionSupport=collectionSupport}static{this.ownedCollectionProperties=Object.freeze(["parts"])}static{this.styles=[LyraElement.styles,styles]}static{this.immutableEventDetails=Object.freeze(["lr-citation-select","lr-part-retry","lr-part-resume"])}get contentMode(){return this.contentModeValue}set contentMode(value){const previous=this.contentModeValue,normalized=normalizeMessagePartsContentMode(value);this.contentModeValue=normalized,typeof value=="string"&&value!==normalized&&this.getAttribute("content-mode")!==normalized&&this.setAttribute("content-mode",normalized),this.requestUpdate("contentMode",previous,{reflect:!0,hasChanged:()=>!0})}get toolDisplay(){return this.toolDisplayValue}set toolDisplay(value){const normalized=MESSAGE_PARTS_TOOL_DISPLAY.normalizeReflected(this,"tool-display",value),previous=this.toolDisplayValue;previous!==normalized&&(this.toolDisplayValue=normalized,this.requestUpdate("toolDisplay",previous))}connectedCallback(){super.connectedCallback(),this.errorAnnouncementSink?.element.ownerDocument!==this.ownerDocument&&(this.errorAnnouncementSink?.release(),this.errorAnnouncementSink=acquireAnnouncementSink("assertive",{document:this.ownerDocument,source:this}),this.hasUpdated&&(this.suppressNextErrorAnnouncement=!0,this.requestUpdate()))}disconnectedCallback(){super.disconnectedCallback(),this.errorAnnouncementSink?.release(),this.errorAnnouncementSink=void 0,this.suppressNextErrorAnnouncement=!0}get effectiveParts(){const seen=new Set;return this.parts.filter(part=>{const id=part?.id;return!isNonBlankIdentity(id)||seen.has(id)||part.type==="tool-call"&&!isRecord(part.invocation)||part.type==="citation"&&!isRecord(part.citation)||part.type==="attachment"&&!isRecord(part.document)?!1:(seen.add(id),!0)})}get effectiveMaxRenderedParts(){return finiteCount(this.maxRenderedParts,0)}get renderedParts(){const parts=this.effectiveParts,max=this.effectiveMaxRenderedParts;return max>0&&parts.length>max?parts.slice(-max):parts}willUpdate(changed){if(super.willUpdate(changed),!changed.has("parts")&&this.hasUpdated||(this.redactionByInvocation=this.projectRedactions(),!changed.has("parts")))return;const current=this.effectiveParts.filter(part=>part.type==="error");if(this.hasUpdated&&!this.suppressNextErrorAnnouncement)for(const part of current)this.knownErrorIds.has(part.id)||this.errorAnnouncementSink?.announce(part.message||this.localize("messagePartError"));this.knownErrorIds=new Set(current.map(part=>part.id))}projectRedactions(){const map=new Map,seen=new Set;for(const part of this.effectiveParts){if(part.type!=="tool-call")continue;const id=part.invocation.id;if(typeof id!="string"||seen.has(id))continue;seen.add(id);const paths=projectedRedactionFields(part.invocation.redactedFields)??TOO_MANY_REDACTION_PATHS;paths.length>0&&map.set(id,paths)}return map}redacted(part,invocationId,source){if(typeof invocationId!="string")return;const paths=this.redactionByInvocation.get(invocationId);if(!paths)return;const detail=redactToolDetail(source,paths,this.localize("envListValueHidden"),this.redactionMemo.get(part));return this.redactionMemo.set(part,detail),detail}updated(_changed){super.updated(_changed),this.suppressNextErrorAnnouncement=!1}selectCitation(event,part){event.stopPropagation(),this.emit("lr-citation-select",{citation:part.citation})}partNames(part){const parts=["part"];switch(part.type){case"text":parts.push("text");break;case"reasoning":parts.push("reasoning");break;case"tool-call":parts.push("tool-call");break;case"tool-result":parts.push("tool-result");break;case"citation":parts.push("citation");break;case"attachment":parts.push("attachment");break;case"data":parts.push("data");break;case"audio":parts.push("audio");break;case"error":parts.push("error");break}return part.state==="streaming"&&parts.push("part-streaming"),part.state==="interrupted"&&parts.push("part-interrupted"),parts.join(" ")}renderToolBlock(part,paired){const invocation=part.invocation,result=paired?paired.result:invocation.result,error=paired&&"error"in paired?paired.error:invocation.error,redactedFields=this.redactionByInvocation.get(invocation.id)??EMPTY_REDACTED_FIELDS;return html`<lr-tool-call-block
2
2
  .name=${invocation.name}
3
3
  .displayName=${invocationDisplayName(invocation)}
4
4
  .callId=${invocation.id}
@@ -59,6 +59,6 @@ import{__decorate}from"tslib";import{warnDeprecatedUsage}from"../../../internal/
59
59
  >${this.localize("retry")}</lr-button
60
60
  >`:nothing}`}}requestResume(part){const current=this.renderedParts.find(candidate=>candidate.id===part.id);if(!(this.resumeDispatching||this.disabled||current!==part||part.state!=="interrupted"||part.interruption?.resumable!==!0)){this.resumeDispatching=!0;try{this.emit("lr-part-resume",{part})}finally{this.resumeDispatching=!1}}}renderInterruption(part){return part.state!=="interrupted"?nothing:html`<div part="interruption"><span>${this.localize("streamInterrupted")}</span>${part.interruption?.reason?html`<span>${part.interruption.reason}</span>`:nothing}${part.interruption?.resumable===!0?html`<button part="resume" type="button" ?disabled=${this.disabled}
61
61
  @click=${()=>this.requestResume(part)}>${this.localize("streamResume")}</button>`:nothing}</div>`}renderOne(part,citationRank,custom,pairing){return part.type==="reasoning"&&this.withoutReasoning?nothing:pairing?.folded.has(part.id)?nothing:html`<div part=${this.partNames(part)} data-type=${part.type} data-state=${part.state??"complete"}
62
- >${custom.has(part.id)?custom.get(part.id):html`${this.renderBuiltin(part,citationRank,pairing)}${this.renderInterruption(part)}`}</div>`}render(){const label=this.getAttribute("aria-label")??this.accessibleLabel??this.localize("messagePartsLabel"),allParts=this.effectiveParts,citationRanks=new Map;let citationRank=0;for(const part of allParts)part.type==="citation"&&citationRanks.set(part.id,++citationRank);const parts=this.renderedParts,custom=new Map;this.renderPart&&parts.forEach((part,index)=>{if(part.type==="reasoning"&&this.withoutReasoning)return;const rendered=this.renderPart?.(part,index);rendered!==void 0&&custom.set(part.id,rendered)});const pairing=this.toolDisplay==="block"?this.pairTools(parts,custom):void 0;return html`<div part="base" role="group" aria-label=${label}>
62
+ >${custom.has(part.id)?custom.get(part.id):html`${this.renderBuiltin(part,citationRank,pairing)}${this.renderInterruption(part)}`}</div>`}render(){const label=this.getAttribute("aria-label")??this.localize("messagePartsLabel"),allParts=this.effectiveParts,citationRanks=new Map;let citationRank=0;for(const part of allParts)part.type==="citation"&&citationRanks.set(part.id,++citationRank);const parts=this.renderedParts,custom=new Map;this.renderPart&&parts.forEach((part,index)=>{if(part.type==="reasoning"&&this.withoutReasoning)return;const rendered=this.renderPart?.(part,index);rendered!==void 0&&custom.set(part.id,rendered)});const pairing=this.toolDisplay==="block"?this.pairTools(parts,custom):void 0;return html`<div part="base" role="group" aria-label=${label}>
63
63
  ${repeat(parts,part=>part.id,part=>this.renderOne(part,citationRanks.get(part.id)??0,custom,pairing))}
64
- </div>`}}__decorate([property({attribute:!1})],LyraMessageParts.prototype,"parts",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraMessageParts.prototype,"disabled",void 0),__decorate([property({reflect:!0,attribute:"content-mode"})],LyraMessageParts.prototype,"contentMode",null),__decorate([property({reflect:!0,attribute:"tool-display",converter:MESSAGE_PARTS_TOOL_DISPLAY})],LyraMessageParts.prototype,"toolDisplay",null),__decorate([property({type:Boolean,attribute:"without-reasoning",reflect:!0})],LyraMessageParts.prototype,"withoutReasoning",void 0),__decorate([property({attribute:!1})],LyraMessageParts.prototype,"renderPart",void 0),__decorate([property({attribute:"streaming-render"})],LyraMessageParts.prototype,"streamingRender",void 0),__decorate([property({type:Boolean,attribute:"code-block-header"})],LyraMessageParts.prototype,"codeBlockHeader",void 0),__decorate([property({type:Number,attribute:"max-rendered-parts"})],LyraMessageParts.prototype,"maxRenderedParts",void 0),__decorate([property({attribute:"aria-label"})],LyraMessageParts.prototype,"accessibleLabel",null);export{LyraMessageParts};
64
+ </div>`}}__decorate([property({attribute:!1})],LyraMessageParts.prototype,"parts",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraMessageParts.prototype,"disabled",void 0),__decorate([property({reflect:!0,attribute:"content-mode"})],LyraMessageParts.prototype,"contentMode",null),__decorate([property({reflect:!0,attribute:"tool-display",converter:MESSAGE_PARTS_TOOL_DISPLAY})],LyraMessageParts.prototype,"toolDisplay",null),__decorate([property({type:Boolean,attribute:"without-reasoning",reflect:!0})],LyraMessageParts.prototype,"withoutReasoning",void 0),__decorate([property({attribute:!1})],LyraMessageParts.prototype,"renderPart",void 0),__decorate([property({attribute:"streaming-render"})],LyraMessageParts.prototype,"streamingRender",void 0),__decorate([property({type:Boolean,attribute:"code-block-header"})],LyraMessageParts.prototype,"codeBlockHeader",void 0),__decorate([property({type:Number,attribute:"max-rendered-parts"})],LyraMessageParts.prototype,"maxRenderedParts",void 0);export{LyraMessageParts};
@@ -2,7 +2,7 @@ import type{LyraClipboardWriteSuccess,LyraClipboardWriteFailure}from'../../../in
2
2
  /** Runs {@link APPEND_MONOTONIC_MARKDOWN_PATTERNS}/{@link BOUNDARY_SENSITIVE_MARKDOWN_PATTERNS}
3
3
  * against `text`, used whenever `contentMode` is left unset (auto-detect). Exported so the
4
4
  * heuristic is directly testable without going through either variant's render cycle. */
5
- export declare function looksLikeMarkdown(text:string):boolean;export type StreamingTextContentMode='auto'|'plain'|'markdown';export interface LyraStreamingTextEventMap{'lr-content-settled':CustomEvent<null>;'lr-copy':CustomEvent<LyraClipboardWriteSuccess>;'lr-copy-error':CustomEvent<LyraClipboardWriteFailure>;}
5
+ export declare function looksLikeMarkdown(text:string):boolean;export type StreamingTextContentMode='auto'|'plain'|'markdown';export interface LyraStreamingTextEventMap{'lr-content-settled':CustomEvent<null>;'lr-link-activate':CustomEvent<{href:string;}>;'lr-copy':CustomEvent<LyraClipboardWriteSuccess>;'lr-copy-error':CustomEvent<LyraClipboardWriteFailure>;}
6
6
  /**
7
7
  * Shared runtime for `<lr-streaming-text>`/`<lr-streaming-text-core>` -- token coalescing,
8
8
  * `contentMode` auto-detection, and the blinking cursor -- factored out so neither variant
@@ -25,6 +25,8 @@ export interface LyraStreamingTextCoreEventMap extends StreamingTextRuntimeEvent
25
25
  * @customElement lr-streaming-text-core
26
26
  * @event lr-content-settled - Fired after newly-coalesced content actually reaches the rendered
27
27
  * DOM (plain-text mode only -- see `<lr-streaming-text>`'s class doc). `detail: null`.
28
+ * @event lr-link-activate - Passthrough from composed Markdown when a rendered link matches
29
+ * `internal-link-prefix`; navigation is prevented and `detail: { href }` carries the raw URL.
28
30
  * @csspart base - The root container.
29
31
  * @csspart cursor - The blinking (or, under reduced motion, static) cursor bar. Only rendered while `streaming` is `true`.
30
32
  * @csspart content - Forwarded from the composed `<lr-markdown-core>` in Markdown mode -- the
@@ -16,7 +16,6 @@ import{__decorate}from"tslib";import{html}from"lit";import{property}from"lit/dec
16
16
  .math=${this.math}
17
17
  .maxHeight=${this.maxHeight}
18
18
  @lr-render-error=${this.stopOwnedEvent}
19
- @lr-link-click=${this.stopOwnedEvent}
20
19
  @lr-highlight-activate=${this.stopOwnedEvent}
21
20
  @lr-text-select=${this.stopOwnedEvent}
22
21
  @lr-anchor-result=${this.stopOwnedEvent}
@@ -92,6 +92,8 @@ import{type TemplateResult}from'lit';import{StreamingTextRuntimeBase}from'./stre
92
92
  * @customElement lr-streaming-text
93
93
  * @event lr-content-settled - Fired after newly-coalesced content actually reaches the rendered
94
94
  * DOM (plain-text mode only -- see the class doc). `detail: null`.
95
+ * @event lr-link-activate - Passthrough from composed Markdown when a rendered link matches
96
+ * `internal-link-prefix`; navigation is prevented and `detail: { href }` carries the raw URL.
95
97
  * @csspart base - The root container.
96
98
  * @csspart cursor - The blinking (or, under reduced motion, static) cursor bar. Only rendered while `streaming` is `true`.
97
99
  * @csspart content - Forwarded from the composed `<lr-markdown>` in Markdown mode -- the wrapper
@@ -16,7 +16,6 @@ import{__decorate}from"tslib";import{html}from"lit";import{property}from"lit/dec
16
16
  .math=${this.math}
17
17
  .maxHeight=${this.maxHeight}
18
18
  @lr-render-error=${this.stopOwnedEvent}
19
- @lr-link-click=${this.stopOwnedEvent}
20
19
  @lr-highlight-activate=${this.stopOwnedEvent}
21
20
  @lr-text-select=${this.stopOwnedEvent}
22
21
  @lr-anchor-result=${this.stopOwnedEvent}
@@ -1,19 +1,14 @@
1
- import{type PropertyValues,type TemplateResult}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import type{LyraDeprecatedAliases}from'../../../internal/deprecated-aliases.js';import type{LyraConversationItem}from'../conversation-item/conversation-item.class.js';import{type LyraSize}from'../../../internal/variants.js';import{type LyraTimestamp}from'../timestamp.js';export interface LyraChatThread{id:string;
1
+ import{type PropertyValues,type TemplateResult}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import type{LyraConversationItem}from'../conversation-item/conversation-item.class.js';import{type LyraSize}from'../../../internal/variants.js';import{type LyraTimestamp}from'../timestamp.js';export interface LyraChatThread{id:string;
2
2
  /** Required display/search text. Runtime records without a string title are omitted. */
3
3
  title:string;excerpt?:string;timestamp?:LyraTimestamp;pinned?:boolean;archived?:boolean;}export type ThreadRowAction='pin'|'archive'|'delete';export type ThreadListGrouping='date'|'custom'|'none';
4
4
  /** Payload shared by the `lr-group-toggle-request`/`lr-group-toggle` pair. */
5
5
  export interface ThreadGroupToggleDetail{groupId:string;
6
6
  /** Whether the group is shown in the resulting (on `lr-group-toggle-request`, the proposed)
7
7
  * state. Always present on events this component dispatches. */
8
- expanded?:boolean;
9
- /** The inverse of `expanded`.
10
- * @deprecated Read `expanded` instead; removal not before 23.0.0. */
11
- collapsed:boolean;}export interface LyraThreadListEventMap{'lr-select':CustomEvent<{conversationId:string;}>;'lr-thread-pin':CustomEvent<{conversationId:string;pinned:boolean;}>;'lr-thread-archive':CustomEvent<{conversationId:string;archived:boolean;}>;'lr-thread-delete':CustomEvent<{conversationId:string;}>;'lr-thread-rename':CustomEvent<{conversationId:string;label:string;}>;'lr-filter-change':CustomEvent<{text:string;matchCount:number;}>;'lr-query-change':CustomEvent<{text:string;}>;'lr-group-toggle-request':CustomEvent<ThreadGroupToggleDetail>;'lr-group-toggle':CustomEvent<ThreadGroupToggleDetail>;
8
+ expanded?:boolean;}export interface LyraThreadListEventMap{'lr-select':CustomEvent<{conversationId:string;}>;'lr-thread-pin':CustomEvent<{conversationId:string;pinned:boolean;}>;'lr-thread-archive':CustomEvent<{conversationId:string;archived:boolean;}>;'lr-thread-delete':CustomEvent<{conversationId:string;}>;'lr-thread-rename':CustomEvent<{conversationId:string;label:string;}>;'lr-filter-change':CustomEvent<{text:string;matchCount:number;}>;'lr-query-change':CustomEvent<{text:string;}>;'lr-group-toggle-request':CustomEvent<ThreadGroupToggleDetail>;'lr-group-toggle':CustomEvent<ThreadGroupToggleDetail>;
12
9
  /** The built-in `[part='retry-button']` was activated, only rendered while `error` is set.
13
10
  * Cancelable: the default action clears `error`; `preventDefault()` leaves it set instead. */
14
- 'lr-retry-request':CustomEvent<null>;
15
- /** @deprecated Use `lr-retry-request`; removal not before 24.0.0. */
16
- 'lr-retry':CustomEvent<null>;blur:CustomEvent<null>;focus:CustomEvent<null>;}export type ThreadBucketKey='pinned'|'today'|'yesterday'|'previous7'|'previous30'|`month:${string}`|'archived';export interface ThreadGroupContext{id:string;threads:readonly LyraChatThread[];bucket?:ThreadBucketKey;date?:Date;}
11
+ 'lr-retry-request':CustomEvent<null>;blur:CustomEvent<null>;focus:CustomEvent<null>;}export type ThreadBucketKey='pinned'|'today'|'yesterday'|'previous7'|'previous30'|`month:${string}`|'archived';export interface ThreadGroupContext{id:string;threads:readonly LyraChatThread[];bucket?:ThreadBucketKey;date?:Date;}
17
12
  /**
18
13
  * `<lr-thread-list>` — the conversation sidebar: a grouped, searchable list of chat sessions with
19
14
  * pin/archive/delete/rename affordances. *Data mode* (non-empty `threads`, or empty `threads` with
@@ -70,14 +65,13 @@ collapsed:boolean;}export interface LyraThreadListEventMap{'lr-select':CustomEve
70
65
  * correlated `lr-rename` request (data mode only).
71
66
  * @event lr-filter-change - `detail: { text, matchCount }` -- data-mode query plus owned results.
72
67
  * @event lr-query-change - `detail: { text }` -- slotted-mode query request; the host owns results.
73
- * @event lr-group-toggle-request - `detail: { groupId, expanded, collapsed }` (`expanded` is the
74
- * canonical key, the deprecated `collapsed` its inverse) -- cancelable proposal before a
68
+ * @event lr-group-toggle-request - `detail: { groupId, expanded }` is a cancelable proposal before a
75
69
  * custom/date group's collapse state changes. Calling `preventDefault()` skips the built-in
76
70
  * `collapsedGroupIds` write below and suppresses the following `lr-group-toggle`, leaving the
77
71
  * group's collapse state fully controlled -- the host must then reassign `collapsedGroupIds`
78
72
  * itself, mirroring `<lr-chat-message>`'s and `<lr-code-block>`'s own
79
73
  * `lr-toggle-request`/`lr-toggle` pairs.
80
- * @event lr-group-toggle - `detail: { groupId, expanded, collapsed }` -- a custom/date group's collapse-state
74
+ * @event lr-group-toggle - `detail: { groupId, expanded }` -- a custom/date group's collapse-state
81
75
  * change was accepted and, unless `lr-group-toggle-request` was prevented, already applied to
82
76
  * `collapsedGroupIds`. A host that already listens here and reassigns `collapsedGroupIds` itself
83
77
  * keeps working unchanged: this component's own write, when it happens, always precedes that
@@ -88,7 +82,6 @@ collapsed:boolean;}export interface LyraThreadListEventMap{'lr-select':CustomEve
88
82
  * @event focus - `searchable`: re-dispatched from the internal search `<input>`'s own `focus`,
89
83
  * for the same reason as `blur`.
90
84
  * @event lr-retry-request - Cancelable retry proposal before the default retry action. `detail: null`.
91
- * @event lr-retry - Deprecated veto alias of `lr-retry-request`; removal not before 24.0.0.
92
85
  * The built-in `[part='retry-button']` was activated, only rendered while
93
86
  * `error` is set. Cancelable: the default action clears `error`; `preventDefault()` leaves it
94
87
  * set instead.
@@ -191,7 +184,7 @@ collapsed:boolean;}export interface LyraThreadListEventMap{'lr-select':CustomEve
191
184
  * @status stable
192
185
  * @since 4.0.0
193
186
  */
194
- export declare class LyraThreadList extends LyraElement<LyraThreadListEventMap>{protected static collectionSupport:import("../../../internal/lyra-element.js").LyraCollectionSupport;protected static readonly ownedCollectionProperties:readonly string[];protected static readonly identityCollectionProperties:readonly string[];static styles:import("lit").CSSResultGroup[];protected static deprecatedAliases:LyraDeprecatedAliases;
187
+ export declare class LyraThreadList extends LyraElement<LyraThreadListEventMap>{protected static collectionSupport:import("../../../internal/lyra-element.js").LyraCollectionSupport;protected static readonly ownedCollectionProperties:readonly string[];protected static readonly identityCollectionProperties:readonly string[];static styles:import("lit").CSSResultGroup[];
195
188
  /** At least one valid thread ⇒ data mode (the default slot is ignored). No valid threads and no
196
189
  * slotted content ⇒ data mode with zero rows (the built-in empty state). No valid threads with
197
190
  * slotted content ⇒ slotted mode. Thread ids must be nonempty and unique; invalid/later
@@ -281,10 +274,6 @@ formatDate?:(date:Date)=>string;
281
274
  withArchived:boolean;
282
275
  /** Forwarded to each data-mode row: turns off its inline rename. */
283
276
  withoutRename:boolean;
284
- /** Compatibility density alias: true selects `size="s"`, false selects `size="m"`. The shared
285
- * size applies to the built-in search field and data-mode rows; slotted rows retain their own size.
286
- * @deprecated Use `size="s"`; removal not before 24.0.0. */
287
- compact:boolean;
288
277
  /** Data mode only: pins the current date/custom group's header to the top of the scroll viewport
289
278
  * while its rows are in view, pushing it off as the next group's header arrives. Group headers
290
279
  * are ordinary virtualized rows, so this renders a `aria-hidden` copy of the header into
@@ -1,4 +1,4 @@
1
- import{__decorate}from"tslib";import{warnDeprecatedUsage}from"../../../internal/dev-mode-attribute-warning.js";import{collectionSupport}from"../../../internal/collection-snapshot.js";import{html,nothing,svg}from"lit";import{property,query,state}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{closeIcon}from"../../../internal/icons.js";import{styles}from"./thread-list.styles.js";import{contextualSizes}from"../../../internal/contextual-vocabulary.styles.js";import{requestThenCommit}from"../../../internal/request-commit.js";import{renderDataState}from"../../../internal/data-state-renderer.js";import{normalizeSize,optionalSizeConverter}from"../../../internal/variants.js";import{getDateTimeFormat,getNumberFormat,resolveIntlLocale}from"../../../internal/intl-cache.js";import{activeElementIn}from"../../../internal/active-element.js";import{MISSING_OWN_DATA_DESCRIPTOR,UNSAFE_OWN_DATA_DESCRIPTOR,getOwnDataDescriptor}from"../../../internal/data-descriptors.js";import{devWarnOnce}from"../../../internal/dev-mode-attribute-warning.js";import{normalizeLyraTimestamp}from"../timestamp.js";import{LYRA_DEFAULT_archiveConversation,LYRA_DEFAULT_clear,LYRA_DEFAULT_deleteConversation,LYRA_DEFAULT_loading,LYRA_DEFAULT_noData,LYRA_DEFAULT_noMatches,LYRA_DEFAULT_pinConversation,LYRA_DEFAULT_retry,LYRA_DEFAULT_searchThreads,LYRA_DEFAULT_tableLoadFailed,LYRA_DEFAULT_threadGroupArchived,LYRA_DEFAULT_threadGroupCollapse,LYRA_DEFAULT_threadGroupExpand,LYRA_DEFAULT_threadGroupPinned,LYRA_DEFAULT_threadGroupPrevious30Days,LYRA_DEFAULT_threadGroupPrevious7Days,LYRA_DEFAULT_threadGroupToday,LYRA_DEFAULT_threadGroupYesterday,LYRA_DEFAULT_threadListEmpty,LYRA_DEFAULT_threadListLabel,LYRA_DEFAULT_threadListMatchAnnounce,LYRA_DEFAULT_unarchiveConversation,LYRA_DEFAULT_unpinConversation}from"../../../internal/default-strings.generated.js";const ICON_VIEW_BOX="0 0 24 24",ICON_STROKE_WIDTH="1.75";function pinIcon(){return svg`
1
+ import{__decorate}from"tslib";import{collectionSupport}from"../../../internal/collection-snapshot.js";import{html,nothing,svg}from"lit";import{property,query,state}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{closeIcon}from"../../../internal/icons.js";import{styles}from"./thread-list.styles.js";import{contextualSizes}from"../../../internal/contextual-vocabulary.styles.js";import{requestThenCommit}from"../../../internal/request-commit.js";import{renderDataState}from"../../../internal/data-state-renderer.js";import{optionalSizeConverter}from"../../../internal/variants.js";import{getDateTimeFormat,getNumberFormat,resolveIntlLocale}from"../../../internal/intl-cache.js";import{activeElementIn}from"../../../internal/active-element.js";import{MISSING_OWN_DATA_DESCRIPTOR,UNSAFE_OWN_DATA_DESCRIPTOR,getOwnDataDescriptor}from"../../../internal/data-descriptors.js";import{devWarnOnce}from"../../../internal/dev-mode-attribute-warning.js";import{normalizeLyraTimestamp}from"../timestamp.js";import{LYRA_DEFAULT_archiveConversation,LYRA_DEFAULT_clear,LYRA_DEFAULT_deleteConversation,LYRA_DEFAULT_loading,LYRA_DEFAULT_noData,LYRA_DEFAULT_noMatches,LYRA_DEFAULT_pinConversation,LYRA_DEFAULT_retry,LYRA_DEFAULT_searchThreads,LYRA_DEFAULT_tableLoadFailed,LYRA_DEFAULT_threadGroupArchived,LYRA_DEFAULT_threadGroupCollapse,LYRA_DEFAULT_threadGroupExpand,LYRA_DEFAULT_threadGroupPinned,LYRA_DEFAULT_threadGroupPrevious30Days,LYRA_DEFAULT_threadGroupPrevious7Days,LYRA_DEFAULT_threadGroupToday,LYRA_DEFAULT_threadGroupYesterday,LYRA_DEFAULT_threadListEmpty,LYRA_DEFAULT_threadListLabel,LYRA_DEFAULT_threadListMatchAnnounce,LYRA_DEFAULT_unarchiveConversation,LYRA_DEFAULT_unpinConversation}from"../../../internal/default-strings.generated.js";const ICON_VIEW_BOX="0 0 24 24",ICON_STROKE_WIDTH="1.75";function pinIcon(){return svg`
2
2
  <svg width="1em" height="1em" viewBox=${ICON_VIEW_BOX} fill="none" stroke="currentColor" stroke-width=${ICON_STROKE_WIDTH} stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">
3
3
  <path d="M12 17v5"></path>
4
4
  <path d="M9 3h6l1 6 3 3v2H5v-2l3-3Z"></path>
@@ -17,7 +17,7 @@ import{__decorate}from"tslib";import{warnDeprecatedUsage}from"../../../internal/
17
17
  <path d="M6 7l1 14h10l1-14"></path>
18
18
  <path d="M9 7V4h6v3"></path>
19
19
  </svg>
20
- `}function defaultFilter(thread,query2,locale){const intlLocale=resolveIntlLocale(locale);return thread.title.toLocaleLowerCase(intlLocale).includes(query2)||(thread.excerpt??"").toLocaleLowerCase(intlLocale).includes(query2)}const THREADS_AND_SLOTTED_CONTENT_WARNING_KEY="lyra-thread-list:threads-and-slotted-content",THREADS_AND_SLOTTED_CONTENT_WARNING="<lr-thread-list>: both `threads` and slotted content were supplied; `threads` data mode wins and the default slot is ignored.",canonicalThreadSnapshots=new WeakMap,sourceThreadByProjection=new WeakMap;function normalizeProjectedTimestamp(value){if(!(typeof value!="string"&&typeof value!="number"&&(value===null||typeof value!="object")))return normalizeLyraTimestamp(value)}function isSafeNonArrayObject(value){if(value===null||typeof value!="object")return!1;try{return!Array.isArray(value)}catch{return!1}}function projectThread(value){if(!isSafeNonArrayObject(value))return;const id=getOwnDataDescriptor(value,"id"),title=getOwnDataDescriptor(value,"title"),excerpt=getOwnDataDescriptor(value,"excerpt"),timestamp=getOwnDataDescriptor(value,"timestamp"),pinned=getOwnDataDescriptor(value,"pinned"),archived=getOwnDataDescriptor(value,"archived");if(id===MISSING_OWN_DATA_DESCRIPTOR||id===UNSAFE_OWN_DATA_DESCRIPTOR||title===MISSING_OWN_DATA_DESCRIPTOR||title===UNSAFE_OWN_DATA_DESCRIPTOR||typeof id.value!="string"||id.value.trim().length===0||typeof title.value!="string")return;const thread=Object.freeze({id:id.value,title:title.value,excerpt:excerpt===MISSING_OWN_DATA_DESCRIPTOR||excerpt===UNSAFE_OWN_DATA_DESCRIPTOR||typeof excerpt.value!="string"?void 0:excerpt.value,timestamp:timestamp===MISSING_OWN_DATA_DESCRIPTOR||timestamp===UNSAFE_OWN_DATA_DESCRIPTOR?void 0:normalizeProjectedTimestamp(timestamp.value),pinned:pinned===MISSING_OWN_DATA_DESCRIPTOR||pinned===UNSAFE_OWN_DATA_DESCRIPTOR||typeof pinned.value!="boolean"?!1:pinned.value,archived:archived===MISSING_OWN_DATA_DESCRIPTOR||archived===UNSAFE_OWN_DATA_DESCRIPTOR||typeof archived.value!="boolean"?!1:archived.value});return sourceThreadByProjection.set(thread,value),thread}function canonicalThreads(values){const cached=canonicalThreadSnapshots.get(values);if(cached)return cached;const projected=[];for(const value of values){const thread=projectThread(value);thread&&projected.push(thread)}const snapshot=Object.freeze(projected);return canonicalThreadSnapshots.set(values,snapshot),snapshot}class LyraThreadList extends LyraElement{constructor(){super(...arguments),this.threads=[],this.activeConversationId="",this.searchable=!1,this.size="m",this.grouping="date",this.collapsedGroupIds=[],this.rowActions=[],this.withArchived=!1,this.withoutRename=!1,this.compact=!1,this.stickyGroups=!1,this.error=!1,this.errorDescription="",this.stickyGroupItems=new Map,this.searchText="",this.hasEmptySlot=!1,this.hasDefaultSlotContent=!1,this.focusTaskGeneration=0,this.injectedListItemRoles=new Set,this.onSearchInput=e=>{e.stopPropagation(),this.setSearchText(e.target.value)},this.onClearSearch=()=>{this.searchText!==""&&(this.setSearchText(""),this.searchInputEl?.focus())},this.onSearchKeyDown=e=>{if(e.key!=="ArrowDown")return;this.focusTaskGeneration++;const rows=this.navigableRows();rows.length!==0&&(e.preventDefault(),this.selectButtonEl(rows[0])?.focus())},this.onSearchFocus=()=>{this.emit("focus",null)},this.onSearchBlur=()=>{this.emit("blur",null)},this.onListKeyDown=e=>{if(e.key!=="ArrowDown"&&e.key!=="ArrowUp"&&e.key!=="Home"&&e.key!=="End"||e.defaultPrevented)return;const origin=e.composedPath()[0];if(origin?.nodeType===1&&origin.closest('[part="group-toggle"]'))return;const focusGeneration=++this.focusTaskGeneration,list=this.virtualListEl;if(this.dataMode&&(e.key==="Home"||e.key==="End")&&list?.scrollContainer){const items2=list.items;e.preventDefault(),this.focusVirtualThreadFromItemIndex(list,items2,e.key==="Home"?0:items2.length-1,e.key==="Home"?1:-1,focusGeneration);return}const rows=this.navigableRows();if(rows.length===0)return;const currentIndex=this.focusedRowIndex(rows);let targetIndex;if(e.key==="Home"?targetIndex=0:e.key==="End"?targetIndex=rows.length-1:e.key==="ArrowDown"?targetIndex=currentIndex<0?0:currentIndex+1:targetIndex=currentIndex<0?rows.length-1:currentIndex-1,e.preventDefault(),targetIndex>=0&&targetIndex<rows.length){this.selectButtonEl(rows[targetIndex])?.focus();return}if(!list?.scrollContainer)return;const currentRow=rows[currentIndex];if(!currentRow)return;const items=list.items,currentItemIndex=items.findIndex(item=>item.kind==="thread"&&item.thread.id===currentRow.conversationId);if(currentItemIndex<0)return;const direction=e.key==="ArrowDown"?1:-1;this.focusVirtualThreadFromItemIndex(list,items,currentItemIndex+direction,direction,focusGeneration)},this.renderRow=item=>{const thread=item,source=this.sourceThread(thread),row=html`
20
+ `}function defaultFilter(thread,query2,locale){const intlLocale=resolveIntlLocale(locale);return thread.title.toLocaleLowerCase(intlLocale).includes(query2)||(thread.excerpt??"").toLocaleLowerCase(intlLocale).includes(query2)}const THREADS_AND_SLOTTED_CONTENT_WARNING_KEY="lyra-thread-list:threads-and-slotted-content",THREADS_AND_SLOTTED_CONTENT_WARNING="<lr-thread-list>: both `threads` and slotted content were supplied; `threads` data mode wins and the default slot is ignored.",canonicalThreadSnapshots=new WeakMap,sourceThreadByProjection=new WeakMap;function normalizeProjectedTimestamp(value){if(!(typeof value!="string"&&typeof value!="number"&&(value===null||typeof value!="object")))return normalizeLyraTimestamp(value)}function isSafeNonArrayObject(value){if(value===null||typeof value!="object")return!1;try{return!Array.isArray(value)}catch{return!1}}function projectThread(value){if(!isSafeNonArrayObject(value))return;const id=getOwnDataDescriptor(value,"id"),title=getOwnDataDescriptor(value,"title"),excerpt=getOwnDataDescriptor(value,"excerpt"),timestamp=getOwnDataDescriptor(value,"timestamp"),pinned=getOwnDataDescriptor(value,"pinned"),archived=getOwnDataDescriptor(value,"archived");if(id===MISSING_OWN_DATA_DESCRIPTOR||id===UNSAFE_OWN_DATA_DESCRIPTOR||title===MISSING_OWN_DATA_DESCRIPTOR||title===UNSAFE_OWN_DATA_DESCRIPTOR||typeof id.value!="string"||id.value.trim().length===0||typeof title.value!="string")return;const thread=Object.freeze({id:id.value,title:title.value,excerpt:excerpt===MISSING_OWN_DATA_DESCRIPTOR||excerpt===UNSAFE_OWN_DATA_DESCRIPTOR||typeof excerpt.value!="string"?void 0:excerpt.value,timestamp:timestamp===MISSING_OWN_DATA_DESCRIPTOR||timestamp===UNSAFE_OWN_DATA_DESCRIPTOR?void 0:normalizeProjectedTimestamp(timestamp.value),pinned:pinned===MISSING_OWN_DATA_DESCRIPTOR||pinned===UNSAFE_OWN_DATA_DESCRIPTOR||typeof pinned.value!="boolean"?!1:pinned.value,archived:archived===MISSING_OWN_DATA_DESCRIPTOR||archived===UNSAFE_OWN_DATA_DESCRIPTOR||typeof archived.value!="boolean"?!1:archived.value});return sourceThreadByProjection.set(thread,value),thread}function canonicalThreads(values){const cached=canonicalThreadSnapshots.get(values);if(cached)return cached;const projected=[];for(const value of values){const thread=projectThread(value);thread&&projected.push(thread)}const snapshot=Object.freeze(projected);return canonicalThreadSnapshots.set(values,snapshot),snapshot}class LyraThreadList extends LyraElement{constructor(){super(...arguments),this.threads=[],this.activeConversationId="",this.searchable=!1,this.size="m",this.grouping="date",this.collapsedGroupIds=[],this.rowActions=[],this.withArchived=!1,this.withoutRename=!1,this.stickyGroups=!1,this.error=!1,this.errorDescription="",this.stickyGroupItems=new Map,this.searchText="",this.hasEmptySlot=!1,this.hasDefaultSlotContent=!1,this.focusTaskGeneration=0,this.injectedListItemRoles=new Set,this.onSearchInput=e=>{e.stopPropagation(),this.setSearchText(e.target.value)},this.onClearSearch=()=>{this.searchText!==""&&(this.setSearchText(""),this.searchInputEl?.focus())},this.onSearchKeyDown=e=>{if(e.key!=="ArrowDown")return;this.focusTaskGeneration++;const rows=this.navigableRows();rows.length!==0&&(e.preventDefault(),this.selectButtonEl(rows[0])?.focus())},this.onSearchFocus=()=>{this.emit("focus",null)},this.onSearchBlur=()=>{this.emit("blur",null)},this.onListKeyDown=e=>{if(e.key!=="ArrowDown"&&e.key!=="ArrowUp"&&e.key!=="Home"&&e.key!=="End"||e.defaultPrevented)return;const origin=e.composedPath()[0];if(origin?.nodeType===1&&origin.closest('[part="group-toggle"]'))return;const focusGeneration=++this.focusTaskGeneration,list=this.virtualListEl;if(this.dataMode&&(e.key==="Home"||e.key==="End")&&list?.scrollContainer){const items2=list.items;e.preventDefault(),this.focusVirtualThreadFromItemIndex(list,items2,e.key==="Home"?0:items2.length-1,e.key==="Home"?1:-1,focusGeneration);return}const rows=this.navigableRows();if(rows.length===0)return;const currentIndex=this.focusedRowIndex(rows);let targetIndex;if(e.key==="Home"?targetIndex=0:e.key==="End"?targetIndex=rows.length-1:e.key==="ArrowDown"?targetIndex=currentIndex<0?0:currentIndex+1:targetIndex=currentIndex<0?rows.length-1:currentIndex-1,e.preventDefault(),targetIndex>=0&&targetIndex<rows.length){this.selectButtonEl(rows[targetIndex])?.focus();return}if(!list?.scrollContainer)return;const currentRow=rows[currentIndex];if(!currentRow)return;const items=list.items,currentItemIndex=items.findIndex(item=>item.kind==="thread"&&item.thread.id===currentRow.conversationId);if(currentItemIndex<0)return;const direction=e.key==="ArrowDown"?1:-1;this.focusVirtualThreadFromItemIndex(list,items,currentItemIndex+direction,direction,focusGeneration)},this.renderRow=item=>{const thread=item,source=this.sourceThread(thread),row=html`
21
21
  <lr-conversation-item
22
22
  exportparts="base:row-item-base, base-menu-open:row-item-base-menu-open, active-indicator:row-item-active-indicator, select-button:row-item-select-button, start:row-item-start, content:row-item-content, label:row-item-label, label-input:row-item-label-input, rename-button:row-item-rename-button, excerpt:row-item-excerpt, meta:row-item-meta, timestamp:row-item-timestamp, actions:row-item-actions"
23
23
  conversation-id=${thread.id}
@@ -47,7 +47,7 @@ import{__decorate}from"tslib";import{warnDeprecatedUsage}from"../../../internal/
47
47
  >`:nothing}
48
48
  ${this.rowActions.length>0||this.renderActions?this.renderRowActions(thread):nothing}
49
49
  </lr-conversation-item>
50
- `;return this.wrapRow?html`<div part="row-wrapper">${this.wrapRow(source,row)}</div>`:row},this.renderItem=item=>{const listItem=item;return listItem.kind==="group"?this.renderGroupHeader(listItem):this.renderRow(listItem.thread)},this.renderStickyGroup=group=>{const item=this.stickyGroupItems.get(String(group.key));return item?this.renderGroupHeader(item,{sticky:!0}):nothing},this.itemKey=item=>{const listItem=item;return listItem.kind==="group"?this.groupItemKey(listItem.id):this.threadItemKey(listItem.thread.id)},this.onDefaultSlotChange=e=>{const assigned=e.target.assignedElements({flatten:!0}),keep=new Set(assigned);this.restoreInjectedListItemRoles(keep),this.markAsListItems(assigned),this.hasDefaultSlotContent=assigned.length>0},this.onSlottedSelect=e=>{e.stopPropagation()},this.onEmptySlotChange=e=>{this.hasEmptySlot=e.target.assignedElements({flatten:!0}).length>0},this.onErrorRetry=()=>{this.error=!1}}static{this.defaultStrings={...super.defaultStrings,archiveConversation:LYRA_DEFAULT_archiveConversation,clear:LYRA_DEFAULT_clear,deleteConversation:LYRA_DEFAULT_deleteConversation,loading:LYRA_DEFAULT_loading,noData:LYRA_DEFAULT_noData,noMatches:LYRA_DEFAULT_noMatches,pinConversation:LYRA_DEFAULT_pinConversation,retry:LYRA_DEFAULT_retry,searchThreads:LYRA_DEFAULT_searchThreads,tableLoadFailed:LYRA_DEFAULT_tableLoadFailed,threadGroupArchived:LYRA_DEFAULT_threadGroupArchived,threadGroupCollapse:LYRA_DEFAULT_threadGroupCollapse,threadGroupExpand:LYRA_DEFAULT_threadGroupExpand,threadGroupPinned:LYRA_DEFAULT_threadGroupPinned,threadGroupPrevious30Days:LYRA_DEFAULT_threadGroupPrevious30Days,threadGroupPrevious7Days:LYRA_DEFAULT_threadGroupPrevious7Days,threadGroupToday:LYRA_DEFAULT_threadGroupToday,threadGroupYesterday:LYRA_DEFAULT_threadGroupYesterday,threadListEmpty:LYRA_DEFAULT_threadListEmpty,threadListLabel:LYRA_DEFAULT_threadListLabel,threadListMatchAnnounce:LYRA_DEFAULT_threadListMatchAnnounce,unarchiveConversation:LYRA_DEFAULT_unarchiveConversation,unpinConversation:LYRA_DEFAULT_unpinConversation}}static{this.collectionSupport=collectionSupport}static{this.ownedCollectionProperties=Object.freeze(["threads","groupOrder","collapsedGroupIds","rowActions"])}static{this.identityCollectionProperties=Object.freeze(["threads"])}static{this.styles=[LyraElement.styles,contextualSizes,styles]}static{this.deprecatedAliases={compact:["size",value=>value?"s":"m",value=>["2xs","xs","s"].includes(normalizeSize(value))]}}get dataMode(){return this.normalizedThreads.length>0||!this.hasDefaultSlotContent}connectedCallback(){if(super.connectedCallback(),this.hasUpdated){const defaultSlotted=this.defaultSlottedElements();this.hasDefaultSlotContent=defaultSlotted.length>0,this.normalizedThreads.length===0&&this.markAsListItems(defaultSlotted)}}willUpdate(changed){super.willUpdate(changed),changed.has("size")&&optionalSizeConverter.normalize(this.size)===void 0&&(this.size="m"),(changed.has("threads")||changed.has("searchText")||changed.has("filter")||changed.has("grouping")||changed.has("groupBy")||changed.has("groupOrder")||changed.has("collapsedGroupIds")||changed.has("withArchived"))&&this.focusTaskGeneration++;const syncSlottedContent=()=>{const defaultSlotted=this.defaultSlottedElements();this.hasDefaultSlotContent=defaultSlotted.length>0;const hasDataThreads=this.normalizedThreads.length>0;hasDataThreads&&defaultSlotted.length>0?(this.restoreInjectedListItemRoles(),devWarnOnce(THREADS_AND_SLOTTED_CONTENT_WARNING_KEY,THREADS_AND_SLOTTED_CONTENT_WARNING)):hasDataThreads||this.markAsListItems(defaultSlotted)};this.hasUpdated?changed.has("threads")&&syncSlottedContent():this.seedFirstRenderState(()=>{this.hasEmptySlot=Array.from(this.children).some(el=>el.getAttribute("slot")==="empty"),syncSlottedContent()})}defaultSlottedElements(){return Array.from(this.children).filter(el=>!el.getAttribute("slot"))}markAsListItems(elements){for(const el of elements)el.hasAttribute("role")||(el.setAttribute("role","listitem"),this.injectedListItemRoles.add(el))}restoreInjectedListItemRoles(keep=new Set){for(const element of this.injectedListItemRoles)keep.has(element)||(element.getAttribute("role")==="listitem"&&element.removeAttribute("role"),this.injectedListItemRoles.delete(element))}disconnectedCallback(){this.focusTaskGeneration++,this.restoreInjectedListItemRoles(),super.disconnectedCallback()}get normalizedThreads(){const seen=new Set;return canonicalThreads(this.threads).filter(thread=>seen.has(thread.id)?!1:(seen.add(thread.id),!0))}sourceThread(thread){return sourceThreadByProjection.get(thread)??thread}sourceThreads(threads){return Object.freeze(threads.map(thread=>this.sourceThread(thread)))}get visibleThreads(){const q=this.searchText.trim().toLocaleLowerCase(this.effectiveLocale),withArchiveFilter=this.normalizedThreads.filter(thread=>this.withArchived||!thread.archived);return q===""?withArchiveFilter:withArchiveFilter.filter(t=>this.filter?this.filter(this.sourceThread(t),q):defaultFilter(t,q,this.effectiveLocale))}bucketFor(thread,now){if(thread.archived)return"archived";if(thread.pinned)return"pinned";const ts=thread.timestamp===void 0?void 0:normalizeLyraTimestamp(thread.timestamp);if(!ts)return"previous30";const dayMs=864e5,startOfDay=d=>new Date(d.getFullYear(),d.getMonth(),d.getDate()).getTime(),diffDays=Math.round((startOfDay(now)-startOfDay(ts))/dayMs);return diffDays===0?"today":diffDays===1?"yesterday":diffDays<=7?"previous7":diffDays<=30?"previous30":`month:${ts.getFullYear()}-${String(ts.getMonth()+1).padStart(2,"0")}`}bucketLabel(key){const groupDate=key.startsWith("month:")?this.dateForBucket(key):void 0;switch(key){case"pinned":return this.localize("threadGroupPinned");case"today":return this.localize("threadGroupToday");case"yesterday":return this.localize("threadGroupYesterday");case"previous7":return this.localize("threadGroupPrevious7Days");case"previous30":return this.localize("threadGroupPrevious30Days");case"archived":return this.localize("threadGroupArchived");default:return this.formatDate?.(groupDate)??getDateTimeFormat(this.effectiveLocale,{month:"long",year:"numeric"}).format(groupDate)}}dateForBucket(key){if(!key.startsWith("month:"))return;const[,ym]=key.split(":"),[year,month]=ym.split("-").map(Number);return new Date(year,month-1,1)}orderedCustomGroupIds(grouped){const firstSeen=[...grouped.keys()];if(typeof this.groupOrder=="function")try{return[...firstSeen].sort(this.groupOrder)}catch{return firstSeen}if(!this.groupOrder)return firstSeen;const ordered=[...new Set(this.groupOrder)].filter(id=>grouped.has(id)),listed=new Set(ordered);return[...ordered,...firstSeen.filter(id=>!listed.has(id))]}groupedItems(grouped,order,contextFor,defaultLabel){const collapsedIds=new Set(this.collapsedGroupIds),items=[];for(const id of order){const groupedThreads=grouped.get(id);if(!groupedThreads||groupedThreads.length===0)continue;const context=contextFor(id,groupedThreads),label=this.getGroupLabel?.(context)??defaultLabel(context);items.push({kind:"group",id,label,adornment:this.renderGroupAdornment?.(context),collapsed:collapsedIds.has(id)}),collapsedIds.has(id)||items.push(...groupedThreads.map(thread=>({kind:"thread",thread})))}return items}buildItems(visible){if(this.grouping==="none")return visible.map(thread=>({kind:"thread",thread}));if(this.grouping==="custom"){if(!this.groupBy)return visible.map(thread=>({kind:"thread",thread}));const grouped2=new Map;for(const thread of visible){let id;try{id=this.groupBy(this.sourceThread(thread))}catch{continue}if(typeof id!="string"||id.trim().length===0)continue;const existing=grouped2.get(id);existing?existing.push(thread):grouped2.set(id,[thread])}return this.groupedItems(grouped2,this.orderedCustomGroupIds(grouped2),(id,groupedThreads)=>({id,threads:this.sourceThreads(groupedThreads)}),context=>context.id)}const now=new Date,grouped=new Map,monthKeys=new Set;for(const thread of visible){const id=this.bucketFor(thread,now),existing=grouped.get(id);existing?existing.push(thread):grouped.set(id,[thread]),id.startsWith("month:")&&monthKeys.add(id)}const order=["pinned","today","yesterday","previous7","previous30",...[...monthKeys].sort().reverse(),"archived"];return this.groupedItems(grouped,order,(id,groupedThreads)=>{const bucket=id;return{id,threads:this.sourceThreads(groupedThreads),bucket,date:bucket.startsWith("month:")?this.dateForBucket(bucket):void 0}},context=>this.bucketLabel(context.bucket))}setSearchText(text){if(this.focusTaskGeneration++,this.searchText=text,!this.dataMode){this.emit("lr-query-change",{text});return}const count=this.visibleThreads.length;this.emit("lr-filter-change",{text,matchCount:count}),this.announceMatchCount(count)}announceMatchCount(count){this.searchText.trim()!==""&&this.liveRegion?.announce(this.localize("threadListMatchAnnounce",void 0,{count:getNumberFormat(this.effectiveLocale).format(count),pluralCount:count}))}itemElement(conversationId){return this.rowElements().find(row=>row.conversationId===conversationId)??null}rowElements(){return this.dataMode?(this.virtualListEl?.renderedRows??[]).flatMap(row=>[...row.querySelectorAll("lr-conversation-item")]):[...this.querySelectorAll("lr-conversation-item")]}selectButtonEl(row){return row.shadowRoot?.querySelector('[part="select-button"]')??null}isNavigableRow(row){const option=this.selectButtonEl(row);return!!(option&&option.getAttribute("role")==="button"&&row.hidden===!1&&row.getAttribute("aria-hidden")!=="true"&&row.getAttribute("aria-disabled")!=="true"&&!row.inert&&row.closest("[inert]")===null&&option.hidden===!1&&option.getAttribute("aria-hidden")!=="true"&&option.getAttribute("aria-disabled")!=="true"&&!option.inert&&option.closest("[inert]")===null)}navigableRows(){return this.rowElements().filter(row=>this.isNavigableRow(row))}focusedRowIndex(rows){return rows.findIndex(row=>activeElementIn(row.shadowRoot)!=null)}focusVirtualThreadFromItemIndex(list,items,initialItemIndex,direction,focusGeneration){(async()=>{let targetItemIndex=initialItemIndex;for(;targetItemIndex>=0&&targetItemIndex<items.length;){for(;items[targetItemIndex]?.kind==="group";)targetItemIndex+=direction;const targetItem=items[targetItemIndex];if(!targetItem||targetItem.kind!=="thread")return;const targetId=targetItem.thread.id;list.scrollToIndex(targetItemIndex,{align:"auto",behavior:"auto"});let targetRow;for(let attempt=0;attempt<2;attempt+=1){if(await new Promise(resolve=>{const view=this.ownerDocument.defaultView;view?view.requestAnimationFrame(()=>resolve()):requestAnimationFrame(()=>resolve())}),focusGeneration!==this.focusTaskGeneration||!this.isConnected||this.virtualListEl!==list||(await list.updateComplete,focusGeneration!==this.focusTaskGeneration||!this.isConnected||this.virtualListEl!==list))return;if(targetRow=this.rowElements().find(row=>row.conversationId===targetId),targetRow)break}if(targetRow&&this.isNavigableRow(targetRow)){this.selectButtonEl(targetRow)?.focus();return}targetItemIndex+=direction}})()}renderRowActions(thread){const source=this.sourceThread(thread);return html`
50
+ `;return this.wrapRow?html`<div part="row-wrapper">${this.wrapRow(source,row)}</div>`:row},this.renderItem=item=>{const listItem=item;return listItem.kind==="group"?this.renderGroupHeader(listItem):this.renderRow(listItem.thread)},this.renderStickyGroup=group=>{const item=this.stickyGroupItems.get(String(group.key));return item?this.renderGroupHeader(item,{sticky:!0}):nothing},this.itemKey=item=>{const listItem=item;return listItem.kind==="group"?this.groupItemKey(listItem.id):this.threadItemKey(listItem.thread.id)},this.onDefaultSlotChange=e=>{const assigned=e.target.assignedElements({flatten:!0}),keep=new Set(assigned);this.restoreInjectedListItemRoles(keep),this.markAsListItems(assigned),this.hasDefaultSlotContent=assigned.length>0},this.onSlottedSelect=e=>{e.stopPropagation()},this.onEmptySlotChange=e=>{this.hasEmptySlot=e.target.assignedElements({flatten:!0}).length>0},this.onErrorRetry=()=>{this.error=!1}}static{this.defaultStrings={...super.defaultStrings,archiveConversation:LYRA_DEFAULT_archiveConversation,clear:LYRA_DEFAULT_clear,deleteConversation:LYRA_DEFAULT_deleteConversation,loading:LYRA_DEFAULT_loading,noData:LYRA_DEFAULT_noData,noMatches:LYRA_DEFAULT_noMatches,pinConversation:LYRA_DEFAULT_pinConversation,retry:LYRA_DEFAULT_retry,searchThreads:LYRA_DEFAULT_searchThreads,tableLoadFailed:LYRA_DEFAULT_tableLoadFailed,threadGroupArchived:LYRA_DEFAULT_threadGroupArchived,threadGroupCollapse:LYRA_DEFAULT_threadGroupCollapse,threadGroupExpand:LYRA_DEFAULT_threadGroupExpand,threadGroupPinned:LYRA_DEFAULT_threadGroupPinned,threadGroupPrevious30Days:LYRA_DEFAULT_threadGroupPrevious30Days,threadGroupPrevious7Days:LYRA_DEFAULT_threadGroupPrevious7Days,threadGroupToday:LYRA_DEFAULT_threadGroupToday,threadGroupYesterday:LYRA_DEFAULT_threadGroupYesterday,threadListEmpty:LYRA_DEFAULT_threadListEmpty,threadListLabel:LYRA_DEFAULT_threadListLabel,threadListMatchAnnounce:LYRA_DEFAULT_threadListMatchAnnounce,unarchiveConversation:LYRA_DEFAULT_unarchiveConversation,unpinConversation:LYRA_DEFAULT_unpinConversation}}static{this.collectionSupport=collectionSupport}static{this.ownedCollectionProperties=Object.freeze(["threads","groupOrder","collapsedGroupIds","rowActions"])}static{this.identityCollectionProperties=Object.freeze(["threads"])}static{this.styles=[LyraElement.styles,contextualSizes,styles]}get dataMode(){return this.normalizedThreads.length>0||!this.hasDefaultSlotContent}connectedCallback(){if(super.connectedCallback(),this.hasUpdated){const defaultSlotted=this.defaultSlottedElements();this.hasDefaultSlotContent=defaultSlotted.length>0,this.normalizedThreads.length===0&&this.markAsListItems(defaultSlotted)}}willUpdate(changed){super.willUpdate(changed),changed.has("size")&&optionalSizeConverter.normalize(this.size)===void 0&&(this.size="m"),(changed.has("threads")||changed.has("searchText")||changed.has("filter")||changed.has("grouping")||changed.has("groupBy")||changed.has("groupOrder")||changed.has("collapsedGroupIds")||changed.has("withArchived"))&&this.focusTaskGeneration++;const syncSlottedContent=()=>{const defaultSlotted=this.defaultSlottedElements();this.hasDefaultSlotContent=defaultSlotted.length>0;const hasDataThreads=this.normalizedThreads.length>0;hasDataThreads&&defaultSlotted.length>0?(this.restoreInjectedListItemRoles(),devWarnOnce(THREADS_AND_SLOTTED_CONTENT_WARNING_KEY,THREADS_AND_SLOTTED_CONTENT_WARNING)):hasDataThreads||this.markAsListItems(defaultSlotted)};this.hasUpdated?changed.has("threads")&&syncSlottedContent():this.seedFirstRenderState(()=>{this.hasEmptySlot=Array.from(this.children).some(el=>el.getAttribute("slot")==="empty"),syncSlottedContent()})}defaultSlottedElements(){return Array.from(this.children).filter(el=>!el.getAttribute("slot"))}markAsListItems(elements){for(const el of elements)el.hasAttribute("role")||(el.setAttribute("role","listitem"),this.injectedListItemRoles.add(el))}restoreInjectedListItemRoles(keep=new Set){for(const element of this.injectedListItemRoles)keep.has(element)||(element.getAttribute("role")==="listitem"&&element.removeAttribute("role"),this.injectedListItemRoles.delete(element))}disconnectedCallback(){this.focusTaskGeneration++,this.restoreInjectedListItemRoles(),super.disconnectedCallback()}get normalizedThreads(){const seen=new Set;return canonicalThreads(this.threads).filter(thread=>seen.has(thread.id)?!1:(seen.add(thread.id),!0))}sourceThread(thread){return sourceThreadByProjection.get(thread)??thread}sourceThreads(threads){return Object.freeze(threads.map(thread=>this.sourceThread(thread)))}get visibleThreads(){const q=this.searchText.trim().toLocaleLowerCase(this.effectiveLocale),withArchiveFilter=this.normalizedThreads.filter(thread=>this.withArchived||!thread.archived);return q===""?withArchiveFilter:withArchiveFilter.filter(t=>this.filter?this.filter(this.sourceThread(t),q):defaultFilter(t,q,this.effectiveLocale))}bucketFor(thread,now){if(thread.archived)return"archived";if(thread.pinned)return"pinned";const ts=thread.timestamp===void 0?void 0:normalizeLyraTimestamp(thread.timestamp);if(!ts)return"previous30";const dayMs=864e5,startOfDay=d=>new Date(d.getFullYear(),d.getMonth(),d.getDate()).getTime(),diffDays=Math.round((startOfDay(now)-startOfDay(ts))/dayMs);return diffDays===0?"today":diffDays===1?"yesterday":diffDays<=7?"previous7":diffDays<=30?"previous30":`month:${ts.getFullYear()}-${String(ts.getMonth()+1).padStart(2,"0")}`}bucketLabel(key){const groupDate=key.startsWith("month:")?this.dateForBucket(key):void 0;switch(key){case"pinned":return this.localize("threadGroupPinned");case"today":return this.localize("threadGroupToday");case"yesterday":return this.localize("threadGroupYesterday");case"previous7":return this.localize("threadGroupPrevious7Days");case"previous30":return this.localize("threadGroupPrevious30Days");case"archived":return this.localize("threadGroupArchived");default:return this.formatDate?.(groupDate)??getDateTimeFormat(this.effectiveLocale,{month:"long",year:"numeric"}).format(groupDate)}}dateForBucket(key){if(!key.startsWith("month:"))return;const[,ym]=key.split(":"),[year,month]=ym.split("-").map(Number);return new Date(year,month-1,1)}orderedCustomGroupIds(grouped){const firstSeen=[...grouped.keys()];if(typeof this.groupOrder=="function")try{return[...firstSeen].sort(this.groupOrder)}catch{return firstSeen}if(!this.groupOrder)return firstSeen;const ordered=[...new Set(this.groupOrder)].filter(id=>grouped.has(id)),listed=new Set(ordered);return[...ordered,...firstSeen.filter(id=>!listed.has(id))]}groupedItems(grouped,order,contextFor,defaultLabel){const collapsedIds=new Set(this.collapsedGroupIds),items=[];for(const id of order){const groupedThreads=grouped.get(id);if(!groupedThreads||groupedThreads.length===0)continue;const context=contextFor(id,groupedThreads),label=this.getGroupLabel?.(context)??defaultLabel(context);items.push({kind:"group",id,label,adornment:this.renderGroupAdornment?.(context),collapsed:collapsedIds.has(id)}),collapsedIds.has(id)||items.push(...groupedThreads.map(thread=>({kind:"thread",thread})))}return items}buildItems(visible){if(this.grouping==="none")return visible.map(thread=>({kind:"thread",thread}));if(this.grouping==="custom"){if(!this.groupBy)return visible.map(thread=>({kind:"thread",thread}));const grouped2=new Map;for(const thread of visible){let id;try{id=this.groupBy(this.sourceThread(thread))}catch{continue}if(typeof id!="string"||id.trim().length===0)continue;const existing=grouped2.get(id);existing?existing.push(thread):grouped2.set(id,[thread])}return this.groupedItems(grouped2,this.orderedCustomGroupIds(grouped2),(id,groupedThreads)=>({id,threads:this.sourceThreads(groupedThreads)}),context=>context.id)}const now=new Date,grouped=new Map,monthKeys=new Set;for(const thread of visible){const id=this.bucketFor(thread,now),existing=grouped.get(id);existing?existing.push(thread):grouped.set(id,[thread]),id.startsWith("month:")&&monthKeys.add(id)}const order=["pinned","today","yesterday","previous7","previous30",...[...monthKeys].sort().reverse(),"archived"];return this.groupedItems(grouped,order,(id,groupedThreads)=>{const bucket=id;return{id,threads:this.sourceThreads(groupedThreads),bucket,date:bucket.startsWith("month:")?this.dateForBucket(bucket):void 0}},context=>this.bucketLabel(context.bucket))}setSearchText(text){if(this.focusTaskGeneration++,this.searchText=text,!this.dataMode){this.emit("lr-query-change",{text});return}const count=this.visibleThreads.length;this.emit("lr-filter-change",{text,matchCount:count}),this.announceMatchCount(count)}announceMatchCount(count){this.searchText.trim()!==""&&this.liveRegion?.announce(this.localize("threadListMatchAnnounce",void 0,{count:getNumberFormat(this.effectiveLocale).format(count),pluralCount:count}))}itemElement(conversationId){return this.rowElements().find(row=>row.conversationId===conversationId)??null}rowElements(){return this.dataMode?(this.virtualListEl?.renderedRows??[]).flatMap(row=>[...row.querySelectorAll("lr-conversation-item")]):[...this.querySelectorAll("lr-conversation-item")]}selectButtonEl(row){return row.shadowRoot?.querySelector('[part="select-button"]')??null}isNavigableRow(row){const option=this.selectButtonEl(row);return!!(option&&option.getAttribute("role")==="button"&&row.hidden===!1&&row.getAttribute("aria-hidden")!=="true"&&row.getAttribute("aria-disabled")!=="true"&&!row.inert&&row.closest("[inert]")===null&&option.hidden===!1&&option.getAttribute("aria-hidden")!=="true"&&option.getAttribute("aria-disabled")!=="true"&&!option.inert&&option.closest("[inert]")===null)}navigableRows(){return this.rowElements().filter(row=>this.isNavigableRow(row))}focusedRowIndex(rows){return rows.findIndex(row=>activeElementIn(row.shadowRoot)!=null)}focusVirtualThreadFromItemIndex(list,items,initialItemIndex,direction,focusGeneration){(async()=>{let targetItemIndex=initialItemIndex;for(;targetItemIndex>=0&&targetItemIndex<items.length;){for(;items[targetItemIndex]?.kind==="group";)targetItemIndex+=direction;const targetItem=items[targetItemIndex];if(!targetItem||targetItem.kind!=="thread")return;const targetId=targetItem.thread.id;list.scrollToIndex(targetItemIndex,{align:"auto",behavior:"auto"});let targetRow;for(let attempt=0;attempt<2;attempt+=1){if(await new Promise(resolve=>{const view=this.ownerDocument.defaultView;view?view.requestAnimationFrame(()=>resolve()):requestAnimationFrame(()=>resolve())}),focusGeneration!==this.focusTaskGeneration||!this.isConnected||this.virtualListEl!==list||(await list.updateComplete,focusGeneration!==this.focusTaskGeneration||!this.isConnected||this.virtualListEl!==list))return;if(targetRow=this.rowElements().find(row=>row.conversationId===targetId),targetRow)break}if(targetRow&&this.isNavigableRow(targetRow)){this.selectButtonEl(targetRow)?.focus();return}targetItemIndex+=direction}})()}renderRowActions(thread){const source=this.sourceThread(thread);return html`
51
51
  <span slot="actions" part="row-actions">
52
52
  ${this.rowActions.includes("pin")?html`<button
53
53
  type="button"
@@ -75,7 +75,7 @@ import{__decorate}from"tslib";import{warnDeprecatedUsage}from"../../../internal/
75
75
  </button>`:nothing}
76
76
  ${this.renderActions?this.renderActions(source):nothing}
77
77
  </span>
78
- `}toggleGroupCollapsed(groupId,collapsed){const detail={groupId,expanded:!collapsed,collapsed};requestThenCommit({requestDetail:detail,emitRequest:(requestDetail,init)=>this.emit("lr-group-toggle-request",requestDetail,init),commit:()=>{const next=new Set(this.collapsedGroupIds);collapsed?next.add(groupId):next.delete(groupId),this.collapsedGroupIds=[...next],this.emit("lr-group-toggle",detail)}})}renderGroupHeader(item,options={}){const nextCollapsed=!item.collapsed;return html`
78
+ `}toggleGroupCollapsed(groupId,collapsed){const detail={groupId,expanded:!collapsed};requestThenCommit({requestDetail:detail,emitRequest:(requestDetail,init)=>this.emit("lr-group-toggle-request",requestDetail,init),commit:()=>{const next=new Set(this.collapsedGroupIds);collapsed?next.add(groupId):next.delete(groupId),this.collapsedGroupIds=[...next],this.emit("lr-group-toggle",detail)}})}renderGroupHeader(item,options={}){const nextCollapsed=!item.collapsed;return html`
79
79
  <div
80
80
  part="group-header"
81
81
  data-group-id=${item.id}
@@ -141,7 +141,7 @@ import{__decorate}from"tslib";import{warnDeprecatedUsage}from"../../../internal/
141
141
  ></slot>
142
142
  </div>`}renderDataList(){const visible=this.visibleThreads,items=this.buildItems(visible),showEmpty=visible.length===0&&!this.hasEmptySlot;return html`
143
143
  <div part="list" @keydown=${this.onListKeyDown}>
144
- ${this.error?renderDataState(this,{loading:!1,error:!0,empty:!1,errorHeading:this.errorHeading,errorDescription:this.errorDescription,onRetry:this.onErrorRetry,emitRetryRequest:(detail,init)=>this.emit("lr-retry-request",detail,init),emitRetry:(detail,init)=>{const legacy=this.emit("lr-retry",detail,init);return legacy.defaultPrevented&&warnDeprecatedUsage(this,"event","lr-retry","lr-retry-request"),legacy}},"error","lr-retry"):showEmpty?html`<div part="empty">
144
+ ${this.error?renderDataState(this,{loading:!1,error:!0,empty:!1,errorHeading:this.errorHeading,errorDescription:this.errorDescription,onRetry:this.onErrorRetry,emitRetryRequest:(detail,init)=>this.emit("lr-retry-request",detail,init)},"error","lr-retry-request"):showEmpty?html`<div part="empty">
145
145
  ${this.searchText.trim()?this.localize("noMatches"):this.localize("threadListEmpty")}
146
146
  </div>`:html`<lr-virtual-list
147
147
  exportparts="base:viewport, sticky-group:group-sticky, row:row, row-wrapper:row-wrapper, group-header:group-header, group-toggle:group-toggle, group-label:group-label, group-adornment:group-adornment, group-icon:group-icon, row-start:row-start, row-excerpt:row-excerpt, row-content:row-content, row-meta:row-meta, row-actions:row-actions, row-action:row-action, pin-glyph:pin-glyph, row-item-base:row-item-base, row-item-base-menu-open:row-item-base-menu-open, row-item-active-indicator:row-item-active-indicator, row-item-select-button:row-item-select-button, row-item-start:row-item-start, row-item-content:row-item-content, row-item-label:row-item-label, row-item-label-input:row-item-label-input, row-item-rename-button:row-item-rename-button, row-item-excerpt:row-item-excerpt, row-item-meta:row-item-meta, row-item-timestamp:row-item-timestamp, row-item-actions:row-item-actions"
@@ -160,4 +160,4 @@ import{__decorate}from"tslib";import{warnDeprecatedUsage}from"../../../internal/
160
160
  ></slot>
161
161
  </div>
162
162
  <lr-live-region></lr-live-region>
163
- `}}__decorate([property({attribute:!1})],LyraThreadList.prototype,"threads",void 0),__decorate([property({attribute:"active-conversation-id"})],LyraThreadList.prototype,"activeConversationId",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraThreadList.prototype,"searchable",void 0),__decorate([property({reflect:!0})],LyraThreadList.prototype,"size",void 0),__decorate([property({attribute:!1})],LyraThreadList.prototype,"filter",void 0),__decorate([property()],LyraThreadList.prototype,"grouping",void 0),__decorate([property({attribute:!1})],LyraThreadList.prototype,"groupBy",void 0),__decorate([property({attribute:!1})],LyraThreadList.prototype,"getGroupLabel",void 0),__decorate([property({attribute:!1})],LyraThreadList.prototype,"renderGroupAdornment",void 0),__decorate([property({attribute:!1})],LyraThreadList.prototype,"groupOrder",void 0),__decorate([property({attribute:!1})],LyraThreadList.prototype,"collapsedGroupIds",void 0),__decorate([property({attribute:!1})],LyraThreadList.prototype,"rowActions",void 0),__decorate([property({attribute:!1})],LyraThreadList.prototype,"renderActions",void 0),__decorate([property({attribute:!1})],LyraThreadList.prototype,"renderStart",void 0),__decorate([property({attribute:!1})],LyraThreadList.prototype,"renderMeta",void 0),__decorate([property({attribute:!1})],LyraThreadList.prototype,"renderExcerpt",void 0),__decorate([property({attribute:!1})],LyraThreadList.prototype,"renderRowContent",void 0),__decorate([property({attribute:!1})],LyraThreadList.prototype,"formatDate",void 0),__decorate([property({type:Boolean,attribute:"with-archived",reflect:!0})],LyraThreadList.prototype,"withArchived",void 0),__decorate([property({type:Boolean,attribute:"without-rename",reflect:!0})],LyraThreadList.prototype,"withoutRename",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraThreadList.prototype,"compact",void 0),__decorate([property({type:Boolean,attribute:"sticky-groups",reflect:!0})],LyraThreadList.prototype,"stickyGroups",void 0),__decorate([property()],LyraThreadList.prototype,"label",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraThreadList.prototype,"error",void 0),__decorate([property({attribute:"error-heading"})],LyraThreadList.prototype,"errorHeading",void 0),__decorate([property({attribute:"error-description"})],LyraThreadList.prototype,"errorDescription",void 0),__decorate([property({attribute:!1})],LyraThreadList.prototype,"wrapRow",void 0),__decorate([state()],LyraThreadList.prototype,"searchText",void 0),__decorate([state()],LyraThreadList.prototype,"hasEmptySlot",void 0),__decorate([state()],LyraThreadList.prototype,"hasDefaultSlotContent",void 0),__decorate([query("lr-virtual-list")],LyraThreadList.prototype,"virtualListEl",void 0),__decorate([query("lr-live-region")],LyraThreadList.prototype,"liveRegion",void 0),__decorate([query('[part="search-input"]')],LyraThreadList.prototype,"searchInputEl",void 0);export{LyraThreadList};
163
+ `}}__decorate([property({attribute:!1})],LyraThreadList.prototype,"threads",void 0),__decorate([property({attribute:"active-conversation-id"})],LyraThreadList.prototype,"activeConversationId",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraThreadList.prototype,"searchable",void 0),__decorate([property({reflect:!0})],LyraThreadList.prototype,"size",void 0),__decorate([property({attribute:!1})],LyraThreadList.prototype,"filter",void 0),__decorate([property()],LyraThreadList.prototype,"grouping",void 0),__decorate([property({attribute:!1})],LyraThreadList.prototype,"groupBy",void 0),__decorate([property({attribute:!1})],LyraThreadList.prototype,"getGroupLabel",void 0),__decorate([property({attribute:!1})],LyraThreadList.prototype,"renderGroupAdornment",void 0),__decorate([property({attribute:!1})],LyraThreadList.prototype,"groupOrder",void 0),__decorate([property({attribute:!1})],LyraThreadList.prototype,"collapsedGroupIds",void 0),__decorate([property({attribute:!1})],LyraThreadList.prototype,"rowActions",void 0),__decorate([property({attribute:!1})],LyraThreadList.prototype,"renderActions",void 0),__decorate([property({attribute:!1})],LyraThreadList.prototype,"renderStart",void 0),__decorate([property({attribute:!1})],LyraThreadList.prototype,"renderMeta",void 0),__decorate([property({attribute:!1})],LyraThreadList.prototype,"renderExcerpt",void 0),__decorate([property({attribute:!1})],LyraThreadList.prototype,"renderRowContent",void 0),__decorate([property({attribute:!1})],LyraThreadList.prototype,"formatDate",void 0),__decorate([property({type:Boolean,attribute:"with-archived",reflect:!0})],LyraThreadList.prototype,"withArchived",void 0),__decorate([property({type:Boolean,attribute:"without-rename",reflect:!0})],LyraThreadList.prototype,"withoutRename",void 0),__decorate([property({type:Boolean,attribute:"sticky-groups",reflect:!0})],LyraThreadList.prototype,"stickyGroups",void 0),__decorate([property()],LyraThreadList.prototype,"label",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraThreadList.prototype,"error",void 0),__decorate([property({attribute:"error-heading"})],LyraThreadList.prototype,"errorHeading",void 0),__decorate([property({attribute:"error-description"})],LyraThreadList.prototype,"errorDescription",void 0),__decorate([property({attribute:!1})],LyraThreadList.prototype,"wrapRow",void 0),__decorate([state()],LyraThreadList.prototype,"searchText",void 0),__decorate([state()],LyraThreadList.prototype,"hasEmptySlot",void 0),__decorate([state()],LyraThreadList.prototype,"hasDefaultSlotContent",void 0),__decorate([query("lr-virtual-list")],LyraThreadList.prototype,"virtualListEl",void 0),__decorate([query("lr-live-region")],LyraThreadList.prototype,"liveRegion",void 0),__decorate([query('[part="search-input"]')],LyraThreadList.prototype,"searchInputEl",void 0);export{LyraThreadList};