@k2b/ui 0.28.0 → 0.29.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 (176) hide show
  1. package/dist/browser/actions/ContextMenu.js +5 -0
  2. package/dist/browser/actions/ContextMenu.js.map +1 -1
  3. package/dist/browser/actions/DragAndDrop.js +89 -0
  4. package/dist/browser/actions/DragAndDrop.js.map +1 -0
  5. package/dist/browser/actions/GestureMenu.js +26 -3
  6. package/dist/browser/actions/GestureMenu.js.map +1 -1
  7. package/dist/browser/actions/drag-and-drop-messages.js +75 -0
  8. package/dist/browser/actions/drag-and-drop-messages.js.map +1 -0
  9. package/dist/browser/actions/drag-and-drop.js +692 -0
  10. package/dist/browser/actions/drag-and-drop.js.map +1 -0
  11. package/dist/browser/actions/index.js +1 -0
  12. package/dist/browser/actions/index.js.map +1 -1
  13. package/dist/browser/chat/ChatComposer.js +385 -265
  14. package/dist/browser/chat/ChatComposer.js.map +1 -1
  15. package/dist/browser/chat/ChatDecision.js +778 -0
  16. package/dist/browser/chat/ChatDecision.js.map +1 -0
  17. package/dist/browser/chat/ChatPrimitives.js +34 -28
  18. package/dist/browser/chat/ChatPrimitives.js.map +1 -1
  19. package/dist/browser/chat/ChatTimeline.js.map +1 -1
  20. package/dist/browser/chat/chat-messages.js +6 -0
  21. package/dist/browser/chat/chat-messages.js.map +1 -1
  22. package/dist/browser/chat/command-search.js +10 -3
  23. package/dist/browser/chat/command-search.js.map +1 -1
  24. package/dist/browser/chat/index.js +6 -1
  25. package/dist/browser/chat/index.js.map +1 -1
  26. package/dist/browser/chat/types.js.map +1 -1
  27. package/dist/browser/content/Calendar.js +3 -3
  28. package/dist/browser/content/Calendar.js.map +1 -1
  29. package/dist/browser/content/Chart.js +54 -71
  30. package/dist/browser/content/Chart.js.map +1 -1
  31. package/dist/browser/content/FileBrowser.js +2 -2
  32. package/dist/browser/content/FileBrowser.js.map +1 -1
  33. package/dist/browser/content/FileTree.js +42 -36
  34. package/dist/browser/content/FileTree.js.map +1 -1
  35. package/dist/browser/content/FileTypeIcon.js +72 -0
  36. package/dist/browser/content/FileTypeIcon.js.map +1 -0
  37. package/dist/browser/content/FileView.js +2 -2
  38. package/dist/browser/content/FileView.js.map +1 -1
  39. package/dist/browser/content/ReferenceChip.js +162 -0
  40. package/dist/browser/content/ReferenceChip.js.map +1 -0
  41. package/dist/browser/content/calendar-pointer.js +9 -0
  42. package/dist/browser/content/calendar-pointer.js.map +1 -1
  43. package/dist/browser/content/calendar-time-view.js +6 -3
  44. package/dist/browser/content/calendar-time-view.js.map +1 -1
  45. package/dist/browser/content/index.js +2 -0
  46. package/dist/browser/content/index.js.map +1 -1
  47. package/dist/browser/layout/AppOverview.js +1 -1
  48. package/dist/browser/layout/AppOverview.js.map +1 -1
  49. package/dist/browser/layout/AppWorkspace.js +644 -445
  50. package/dist/browser/layout/AppWorkspace.js.map +1 -1
  51. package/dist/browser/layout/PanelDialog.js +88 -86
  52. package/dist/browser/layout/PanelDialog.js.map +1 -1
  53. package/dist/browser/layout/ResizeSeparator.js +81 -0
  54. package/dist/browser/layout/ResizeSeparator.js.map +1 -0
  55. package/dist/browser/layout/SidebarSwitcher.js +9 -2
  56. package/dist/browser/layout/SidebarSwitcher.js.map +1 -1
  57. package/dist/browser/layout/TabBar.js +15 -12
  58. package/dist/browser/layout/TabBar.js.map +1 -1
  59. package/dist/browser/layout/app-workspace-controller.js +130 -17
  60. package/dist/browser/layout/app-workspace-controller.js.map +1 -1
  61. package/dist/browser/layout/index.js +3 -1
  62. package/dist/browser/layout/index.js.map +1 -1
  63. package/dist/browser/layout/resize-separator.js +90 -0
  64. package/dist/browser/layout/resize-separator.js.map +1 -0
  65. package/dist/browser/layout/workspace-messages.js +12 -2
  66. package/dist/browser/layout/workspace-messages.js.map +1 -1
  67. package/dist/browser/surfaces/LinkCard.js +1 -1
  68. package/dist/browser/surfaces/LinkCard.js.map +1 -1
  69. package/dist/browser/surfaces/Placeholder.js +14 -3
  70. package/dist/browser/surfaces/Placeholder.js.map +1 -1
  71. package/dist/browser/surfaces/StatCell.js +23 -0
  72. package/dist/browser/surfaces/StatCell.js.map +1 -1
  73. package/dist/browser/widgets/Widget.js +1 -1
  74. package/dist/browser/widgets/Widget.js.map +1 -1
  75. package/dist/ssr/actions/ContextMenu.js +5 -0
  76. package/dist/ssr/actions/ContextMenu.js.map +1 -1
  77. package/dist/ssr/actions/DragAndDrop.js +63 -0
  78. package/dist/ssr/actions/DragAndDrop.js.map +1 -0
  79. package/dist/ssr/actions/GestureMenu.js +26 -3
  80. package/dist/ssr/actions/GestureMenu.js.map +1 -1
  81. package/dist/ssr/actions/drag-and-drop-messages.js +75 -0
  82. package/dist/ssr/actions/drag-and-drop-messages.js.map +1 -0
  83. package/dist/ssr/actions/drag-and-drop.js +692 -0
  84. package/dist/ssr/actions/drag-and-drop.js.map +1 -0
  85. package/dist/ssr/actions/index.js +1 -0
  86. package/dist/ssr/actions/index.js.map +1 -1
  87. package/dist/ssr/chat/ChatComposer.js +131 -14
  88. package/dist/ssr/chat/ChatComposer.js.map +1 -1
  89. package/dist/ssr/chat/ChatDecision.js +465 -0
  90. package/dist/ssr/chat/ChatDecision.js.map +1 -0
  91. package/dist/ssr/chat/ChatPrimitives.js +2 -2
  92. package/dist/ssr/chat/ChatPrimitives.js.map +1 -1
  93. package/dist/ssr/chat/ChatTimeline.js.map +1 -1
  94. package/dist/ssr/chat/chat-messages.js +6 -0
  95. package/dist/ssr/chat/chat-messages.js.map +1 -1
  96. package/dist/ssr/chat/command-search.js +10 -3
  97. package/dist/ssr/chat/command-search.js.map +1 -1
  98. package/dist/ssr/chat/index.js +6 -1
  99. package/dist/ssr/chat/index.js.map +1 -1
  100. package/dist/ssr/chat/types.js.map +1 -1
  101. package/dist/ssr/content/Calendar.js +3 -3
  102. package/dist/ssr/content/Calendar.js.map +1 -1
  103. package/dist/ssr/content/Chart.js +19 -23
  104. package/dist/ssr/content/Chart.js.map +1 -1
  105. package/dist/ssr/content/FileBrowser.js +2 -2
  106. package/dist/ssr/content/FileBrowser.js.map +1 -1
  107. package/dist/ssr/content/FileTree.js +21 -14
  108. package/dist/ssr/content/FileTree.js.map +1 -1
  109. package/dist/ssr/content/FileTypeIcon.js +50 -0
  110. package/dist/ssr/content/FileTypeIcon.js.map +1 -0
  111. package/dist/ssr/content/FileView.js +2 -2
  112. package/dist/ssr/content/FileView.js.map +1 -1
  113. package/dist/ssr/content/ReferenceChip.js +121 -0
  114. package/dist/ssr/content/ReferenceChip.js.map +1 -0
  115. package/dist/ssr/content/calendar-pointer.js +9 -0
  116. package/dist/ssr/content/calendar-pointer.js.map +1 -1
  117. package/dist/ssr/content/calendar-time-view.js +6 -3
  118. package/dist/ssr/content/calendar-time-view.js.map +1 -1
  119. package/dist/ssr/content/index.js +2 -0
  120. package/dist/ssr/content/index.js.map +1 -1
  121. package/dist/ssr/layout/AppOverview.js +1 -1
  122. package/dist/ssr/layout/AppOverview.js.map +1 -1
  123. package/dist/ssr/layout/AppWorkspace.js +272 -95
  124. package/dist/ssr/layout/AppWorkspace.js.map +1 -1
  125. package/dist/ssr/layout/PanelDialog.js +7 -6
  126. package/dist/ssr/layout/PanelDialog.js.map +1 -1
  127. package/dist/ssr/layout/ResizeSeparator.js +45 -0
  128. package/dist/ssr/layout/ResizeSeparator.js.map +1 -0
  129. package/dist/ssr/layout/SidebarSwitcher.js +9 -2
  130. package/dist/ssr/layout/SidebarSwitcher.js.map +1 -1
  131. package/dist/ssr/layout/TabBar.js +1 -1
  132. package/dist/ssr/layout/TabBar.js.map +1 -1
  133. package/dist/ssr/layout/app-workspace-controller.js +130 -17
  134. package/dist/ssr/layout/app-workspace-controller.js.map +1 -1
  135. package/dist/ssr/layout/index.js +3 -1
  136. package/dist/ssr/layout/index.js.map +1 -1
  137. package/dist/ssr/layout/resize-separator.js +90 -0
  138. package/dist/ssr/layout/resize-separator.js.map +1 -0
  139. package/dist/ssr/layout/workspace-messages.js +12 -2
  140. package/dist/ssr/layout/workspace-messages.js.map +1 -1
  141. package/dist/ssr/surfaces/LinkCard.js +1 -1
  142. package/dist/ssr/surfaces/LinkCard.js.map +1 -1
  143. package/dist/ssr/surfaces/Placeholder.js +4 -2
  144. package/dist/ssr/surfaces/Placeholder.js.map +1 -1
  145. package/dist/ssr/surfaces/StatCell.js +23 -0
  146. package/dist/ssr/surfaces/StatCell.js.map +1 -1
  147. package/dist/ssr/widgets/Widget.js +1 -1
  148. package/dist/ssr/widgets/Widget.js.map +1 -1
  149. package/dist/styles.css +1 -1
  150. package/dist/types/actions/ContextMenu.d.ts +1 -0
  151. package/dist/types/actions/DragAndDrop.d.ts +29 -0
  152. package/dist/types/actions/drag-and-drop-messages.d.ts +35 -0
  153. package/dist/types/actions/drag-and-drop.d.ts +36 -0
  154. package/dist/types/actions/index.d.ts +2 -0
  155. package/dist/types/chat/ChatComposer.d.ts +19 -1
  156. package/dist/types/chat/ChatDecision.d.ts +133 -0
  157. package/dist/types/chat/ChatPrimitives.d.ts +4 -1
  158. package/dist/types/chat/ChatTimeline.d.ts +2 -1
  159. package/dist/types/chat/chat-messages.d.ts +3 -0
  160. package/dist/types/chat/command-search.d.ts +3 -0
  161. package/dist/types/chat/index.d.ts +23 -1
  162. package/dist/types/chat/types.d.ts +54 -1
  163. package/dist/types/content/Chart.d.ts +9 -3
  164. package/dist/types/content/FileTypeIcon.d.ts +27 -0
  165. package/dist/types/content/ReferenceChip.d.ts +49 -0
  166. package/dist/types/content/calendar-pointer.d.ts +6 -0
  167. package/dist/types/content/index.d.ts +3 -0
  168. package/dist/types/layout/AppWorkspace.d.ts +5 -3
  169. package/dist/types/layout/ResizeSeparator.d.ts +9 -0
  170. package/dist/types/layout/TabBar.d.ts +7 -0
  171. package/dist/types/layout/app-workspace-controller.d.ts +2 -0
  172. package/dist/types/layout/index.d.ts +3 -1
  173. package/dist/types/layout/resize-separator.d.ts +18 -0
  174. package/dist/types/layout/workspace-messages.d.ts +5 -0
  175. package/dist/types/surfaces/StatCell.d.ts +6 -0
  176. package/package.json +2 -2
@@ -33,7 +33,7 @@ var _tmpl$ = /*#__PURE__*/_$template(`<span><strong>`),
33
33
  _tmpl$16 = /*#__PURE__*/_$template(`<div role=status class=k2b-chat-composer__loading><i class="ti ti-loader-2 k2b-spin"aria-hidden=true></i><strong>`),
34
34
  _tmpl$17 = /*#__PURE__*/_$template(`<div role=status><i class="ti ti-alert-circle"></i> <!$><!/>`),
35
35
  _tmpl$18 = /*#__PURE__*/_$template(`<div role=status>`),
36
- _tmpl$19 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer-accessory data-commands><div class=k2b-chat-composer__commands role=listbox><!$><!/><!$><!/><!$><!/><!$><!/>`),
36
+ _tmpl$19 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer-accessory data-commands><div class=k2b-chat-composer__commands role=listbox><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/>`),
37
37
  _tmpl$20 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer-slot><div></div><!$><!/><!$><!/>`),
38
38
  _tmpl$21 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__hint aria-live=polite>`),
39
39
  _tmpl$22 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__attachments role=list tabindex=0>`),
@@ -85,7 +85,10 @@ const emojiSuggestionLimit = 8;
85
85
  // Keep editor undo text within approximately 2 MiB, plus the current edit.
86
86
  const composerUndoBudgetChars = 1_000_000;
87
87
 
88
- /** An action can cancel and restore its token, or report a short completion message. */
88
+ /**
89
+ * An action can cancel and restore its token, report a short completion message, or hand back a reference chosen in a
90
+ * dialog: `mention` takes the token's place exactly as a `mention` row does, and Ctrl/⌘+Z brings the token back.
91
+ */
89
92
 
90
93
  /** A fixed place in the slash list. Sections keep the given order, also while searching. */
91
94
 
@@ -303,6 +306,14 @@ export function ChatComposer(props) {
303
306
  if (start !== undefined) setCommandOpening(opening => opening + 1);
304
307
  });
305
308
  const parsedCommandQuery = createMemo(() => parseChatCommandQuery(commandQuery()?.query ?? "", props.commandScopes ?? []));
309
+ const commandFallbackRow = createMemo(() => {
310
+ const parsed = parsedCommandQuery();
311
+ const query = parsed.query.trim();
312
+ return commandQuery() && (query || parsed.scope) ? props.commandFallback?.({
313
+ query,
314
+ scope: parsed.scope?.id
315
+ }) : undefined;
316
+ });
306
317
  const currentCommandScope = createMemo(() => parsedCommandQuery().scope?.id);
307
318
  createEffect(() => {
308
319
  currentCommandScope();
@@ -318,9 +329,12 @@ export function ChatComposer(props) {
318
329
  searchResults: searchResultsScope() === parsedCommandQuery().scope?.id ? searchResults() : [],
319
330
  searchResultsFresh: searchResultsQuery() === commandQuery()?.query && searchResultsScope() === parsedCommandQuery().scope?.id,
320
331
  searchSettled: searchResultsQuery() !== undefined && searchResultsScope() === parsedCommandQuery().scope?.id,
321
- searching: searching()
332
+ searching: searching(),
333
+ fallback: commandFallbackRow()
322
334
  }));
323
335
  const commandMatches = createMemo(() => commandQuery() ? commandModel().rows.map(row => row.command) : []);
336
+ /** Rows that matched; an unscoped fallback row only follows them. */
337
+ const foundCommandCount = () => commandMatches().length - (commandModel().fallback ? 1 : 0);
324
338
  const currentCommandQuery = createMemo(() => caretCommandToken()?.query);
325
339
  // Arrow marking belongs to one token in one draft; another draft or `/` starts at the top row again.
326
340
  createEffect(() => {
@@ -329,7 +343,7 @@ export function ChatComposer(props) {
329
343
  currentCommandQuery();
330
344
  setCommandMoved(false);
331
345
  });
332
- const commandsOpen = () => Boolean(!emojiOpen() && commandQuery() && (localCommands().length || props.searchCommands));
346
+ const commandsOpen = () => Boolean(!emojiOpen() && commandQuery() && (localCommands().length || props.searchCommands || commandFallbackRow()));
333
347
  const commandSheetHeld = createMemo(() => commandsOpen() && isTouchOnly());
334
348
  createEffect(() => {
335
349
  if (!commandSheetHeld()) return;
@@ -679,12 +693,78 @@ export function ChatComposer(props) {
679
693
  _$effect(() => _$setAttribute(_el$2, "title", attachment.name));
680
694
  return _el$;
681
695
  })();
682
- const chooseFiles = () => {
696
+
697
+ /** `onNothing` runs when the person closes the selection without a file. */
698
+ const chooseFiles = onNothing => {
683
699
  const selection = props.fileSelection;
684
- if (!selection?.choose) return fileInputRef?.click();
685
- selection.choose().then(
700
+ if (!selection?.choose) {
701
+ const input = fileInputRef;
702
+ if (input && onNothing) {
703
+ const done = new AbortController();
704
+ input.addEventListener("cancel", () => {
705
+ done.abort();
706
+ onNothing();
707
+ }, {
708
+ signal: done.signal
709
+ });
710
+ input.addEventListener("change", () => done.abort(), {
711
+ signal: done.signal
712
+ });
713
+ }
714
+ return input?.click();
715
+ }
716
+ const failed = error => {
717
+ onNothing?.();
718
+ (props.fileSelection?.onError ?? props.onError)?.(error);
719
+ };
720
+ let chosen;
721
+ try {
722
+ chosen = selection.choose();
723
+ } catch (error) {
724
+ failed(error);
725
+ return;
726
+ }
727
+ chosen.then(
686
728
  // A single-file composer keeps the first chosen file, as its file dialog and drops do.
687
- files => void runFiles(selection.multiple === false ? files.slice(0, 1) : files), error => (props.fileSelection?.onError ?? props.onError)?.(error));
729
+ files => {
730
+ if (files.length === 0) onNothing?.();else void runFiles(selection.multiple === false ? files.slice(0, 1) : files);
731
+ }, failed);
732
+ };
733
+
734
+ /**
735
+ * "Attach files" from the slash list: the token leaves as one edit, and the selection opens synchronously, inside the
736
+ * key or click that chose the row, because the device's file dialog needs that activation. Closing the selection
737
+ * without a file brings the token back, unless the draft changed meanwhile.
738
+ */
739
+ const attachFilesFromCommand = token => {
740
+ if (!canSelectFiles()) return;
741
+ const key = props.draftKey;
742
+ const previous = snapshot();
743
+ const previousHistory = {
744
+ entries: [...history],
745
+ index: historyIndex
746
+ };
747
+ const nextValue = props.value.slice(0, token.start) + props.value.slice(token.end);
748
+ edit(nextValue, reconcileChatMentions(props.value, nextValue, mentions()));
749
+ setDismissed(true);
750
+ chooseFiles(() => {
751
+ if (props.draftKey !== key || props.value !== nextValue) return;
752
+ setDismissed(true);
753
+ props.onValueChange(previous.value);
754
+ props.onMentionsChange?.(previous.mentions);
755
+ history.splice(0, history.length, ...previousHistory.entries);
756
+ historyIndex = previousHistory.index;
757
+ queueMicrotask(() => {
758
+ textareaRef?.setSelectionRange(token.end, token.end);
759
+ syncCaret();
760
+ focus();
761
+ });
762
+ });
763
+ queueMicrotask(() => {
764
+ if (props.draftKey !== key || props.value !== nextValue) return;
765
+ textareaRef?.setSelectionRange(token.start, token.start);
766
+ syncCaret();
767
+ });
688
768
  };
689
769
  const runFiles = async files => {
690
770
  if (!canSelectFiles()) return;
@@ -779,7 +859,11 @@ export function ChatComposer(props) {
779
859
  setCommandOpening(opening => opening + 1);
780
860
  return;
781
861
  }
782
- if (command.scope && (tab || !command.action && !command.mention) && narrowCommand(command)) return;
862
+ if (command.scope && (tab || !command.action && !command.mention && !command.attachFiles) && narrowCommand(command)) return;
863
+ if (command.attachFiles) {
864
+ attachFilesFromCommand(token);
865
+ return;
866
+ }
783
867
  const previous = snapshot();
784
868
  const key = props.draftKey;
785
869
  const replacement = command.mention ? command.mention.name + " " : "";
@@ -800,6 +884,7 @@ export function ChatComposer(props) {
800
884
  setExecuting(true);
801
885
  let submitRequested = false;
802
886
  let restored = false;
887
+ let mentioned;
803
888
  const restore = () => {
804
889
  if (props.draftKey !== key || props.value !== nextValue) return;
805
890
  setDismissed(true);
@@ -832,6 +917,32 @@ export function ChatComposer(props) {
832
917
  submitRequested = false;
833
918
  restore();
834
919
  showCommandStatus();
920
+ } else if (result && "mention" in result) {
921
+ // One undo step from the token to the reference, as if the row had been a reference itself.
922
+ if (props.draftKey === key && props.value === nextValue) {
923
+ restore();
924
+ restored = false;
925
+ const name = result.mention.name;
926
+ const withMention = previous.value.slice(0, token.start) + name + " " + previous.value.slice(token.end);
927
+ edit(withMention, [...reconcileChatMentions(previous.value, withMention, previous.mentions), {
928
+ start: token.start,
929
+ end: token.start + name.length,
930
+ attachment: result.mention
931
+ }]);
932
+ setDismissed(true);
933
+ mentioned = {
934
+ value: withMention,
935
+ caret: token.start + name.length + 1
936
+ };
937
+ showCommandStatus();
938
+ } else {
939
+ // The pick is lost; say so, also when the draft moved to another key meanwhile (such as a new chat saved
940
+ // while the dialog was open), so it never ends in silence.
941
+ showCommandStatus({
942
+ tone: "error",
943
+ text: chatMessages().commandDraftChanged
944
+ });
945
+ }
835
946
  } else if (result) {
836
947
  showCommandStatus({
837
948
  tone: "done",
@@ -853,8 +964,8 @@ export function ChatComposer(props) {
853
964
  if (submitRequested && props.draftKey === key) await submit();
854
965
  queueMicrotask(() => {
855
966
  if (props.draftKey !== key) return;
856
- if (restored || props.value === nextValue) {
857
- const position = restored ? token.end : token.start + replacement.length;
967
+ if (restored || props.value === nextValue || mentioned && props.value === mentioned.value) {
968
+ const position = restored ? token.end : mentioned?.caret ?? token.start + replacement.length;
858
969
  textareaRef?.setSelectionRange(position, position);
859
970
  }
860
971
  syncCaret();
@@ -1124,7 +1235,7 @@ export function ChatComposer(props) {
1124
1235
  get disabled() {
1125
1236
  return !canSelectFiles();
1126
1237
  },
1127
- onClick: chooseFiles,
1238
+ onClick: () => chooseFiles(),
1128
1239
  get children() {
1129
1240
  var _el$5 = _$getNextElement(_tmpl$3);
1130
1241
  _$effect(() => _$className(_el$5, addingFiles() ? "ti ti-loader-2 k2b-spin" : "ti ti-plus"));
@@ -1614,23 +1725,23 @@ export function ChatComposer(props) {
1614
1725
  };
1615
1726
  return (() => {
1616
1727
  var _el$42 = _$getNextElement(_tmpl$25),
1617
- _el$108 = _el$42.firstChild,
1618
- [_el$109, _co$27] = _$getNextMarker(_el$108.nextSibling),
1619
- _el$70 = _el$109.nextSibling,
1620
- _el$94 = _el$70.firstChild,
1621
- [_el$95, _co$21] = _$getNextMarker(_el$94.nextSibling),
1622
- _el$96 = _el$95.nextSibling,
1728
+ _el$110 = _el$42.firstChild,
1729
+ [_el$111, _co$28] = _$getNextMarker(_el$110.nextSibling),
1730
+ _el$72 = _el$111.nextSibling,
1731
+ _el$96 = _el$72.firstChild,
1623
1732
  [_el$97, _co$22] = _$getNextMarker(_el$96.nextSibling),
1624
1733
  _el$98 = _el$97.nextSibling,
1625
1734
  [_el$99, _co$23] = _$getNextMarker(_el$98.nextSibling),
1626
1735
  _el$100 = _el$99.nextSibling,
1627
1736
  [_el$101, _co$24] = _$getNextMarker(_el$100.nextSibling),
1628
- _el$102 = _el$70.nextSibling,
1629
- _el$103 = _el$102.nextSibling,
1630
- _el$104 = _el$103.firstChild,
1631
- [_el$105, _co$25] = _$getNextMarker(_el$104.nextSibling),
1632
- _el$106 = _el$105.nextSibling,
1633
- [_el$107, _co$26] = _$getNextMarker(_el$106.nextSibling);
1737
+ _el$102 = _el$101.nextSibling,
1738
+ [_el$103, _co$25] = _$getNextMarker(_el$102.nextSibling),
1739
+ _el$104 = _el$72.nextSibling,
1740
+ _el$105 = _el$104.nextSibling,
1741
+ _el$106 = _el$105.firstChild,
1742
+ [_el$107, _co$26] = _$getNextMarker(_el$106.nextSibling),
1743
+ _el$108 = _el$107.nextSibling,
1744
+ [_el$109, _co$27] = _$getNextMarker(_el$108.nextSibling);
1634
1745
  var _ref$6 = shellRef;
1635
1746
  typeof _ref$6 === "function" ? _$use(_ref$6, _el$42) : shellRef = _el$42;
1636
1747
  _$insert(_el$42, _$createComponent(Show, {
@@ -1640,10 +1751,10 @@ export function ChatComposer(props) {
1640
1751
  get children() {
1641
1752
  var _el$43 = _$getNextElement(_tmpl$20),
1642
1753
  _el$44 = _el$43.firstChild,
1643
- _el$66 = _el$44.nextSibling,
1644
- [_el$67, _co$11] = _$getNextMarker(_el$66.nextSibling),
1645
- _el$68 = _el$67.nextSibling,
1646
- [_el$69, _co$12] = _$getNextMarker(_el$68.nextSibling);
1754
+ _el$68 = _el$44.nextSibling,
1755
+ [_el$69, _co$12] = _$getNextMarker(_el$68.nextSibling),
1756
+ _el$70 = _el$69.nextSibling,
1757
+ [_el$71, _co$13] = _$getNextMarker(_el$70.nextSibling);
1647
1758
  _$insert(_el$44, accessory);
1648
1759
  _$insert(_el$43, _$createComponent(Show, {
1649
1760
  get when() {
@@ -1660,38 +1771,38 @@ export function ChatComposer(props) {
1660
1771
  return emojiMatches();
1661
1772
  },
1662
1773
  children: (entry, index) => (() => {
1663
- var _el$110 = _$getNextElement(_tmpl$26),
1664
- _el$111 = _el$110.firstChild,
1665
- _el$112 = _el$111.nextSibling,
1666
- _el$113 = _el$112.nextSibling,
1667
- [_el$114, _co$28] = _$getNextMarker(_el$113.nextSibling);
1668
- _el$110.$$click = () => pickEmojiSuggestion(index());
1669
- _el$110.$$mousedown = keepFieldFocus;
1670
- _$insert(_el$111, () => emojiInTone(entry, props.emoji?.skinTone ?? 0));
1671
- _$insert(_el$112, () => emojiName(entry, locale()));
1672
- _$insert(_el$110, _$createComponent(Show, {
1774
+ var _el$112 = _$getNextElement(_tmpl$26),
1775
+ _el$113 = _el$112.firstChild,
1776
+ _el$114 = _el$113.nextSibling,
1777
+ _el$115 = _el$114.nextSibling,
1778
+ [_el$116, _co$29] = _$getNextMarker(_el$115.nextSibling);
1779
+ _el$112.$$click = () => pickEmojiSuggestion(index());
1780
+ _el$112.$$mousedown = keepFieldFocus;
1781
+ _$insert(_el$113, () => emojiInTone(entry, props.emoji?.skinTone ?? 0));
1782
+ _$insert(_el$114, () => emojiName(entry, locale()));
1783
+ _$insert(_el$112, _$createComponent(Show, {
1673
1784
  get when() {
1674
1785
  return entry.shortcodes[0];
1675
1786
  },
1676
1787
  children: code => (() => {
1677
- var _el$115 = _$getNextElement(_tmpl$27),
1678
- _el$116 = _el$115.firstChild,
1679
- _el$118 = _el$116.nextSibling,
1680
- [_el$119, _co$29] = _$getNextMarker(_el$118.nextSibling),
1681
- _el$117 = _el$119.nextSibling;
1682
- _$insert(_el$115, code, _el$119, _co$29);
1683
- return _el$115;
1788
+ var _el$117 = _$getNextElement(_tmpl$27),
1789
+ _el$118 = _el$117.firstChild,
1790
+ _el$120 = _el$118.nextSibling,
1791
+ [_el$121, _co$30] = _$getNextMarker(_el$120.nextSibling),
1792
+ _el$119 = _el$121.nextSibling;
1793
+ _$insert(_el$117, code, _el$121, _co$30);
1794
+ return _el$117;
1684
1795
  })()
1685
- }), _el$114, _co$28);
1796
+ }), _el$116, _co$29);
1686
1797
  _$effect(_p$ => {
1687
1798
  var _v$28 = `${commandListId}-${index()}`,
1688
1799
  _v$29 = index() === selectedCommandIndex(),
1689
1800
  _v$30 = emojiName(entry, locale()),
1690
1801
  _v$31 = index() === selectedCommandIndex() ? "true" : undefined;
1691
- _v$28 !== _p$.e && _$setAttribute(_el$110, "id", _p$.e = _v$28);
1692
- _v$29 !== _p$.t && _$setAttribute(_el$110, "aria-selected", _p$.t = _v$29);
1693
- _v$30 !== _p$.a && _$setAttribute(_el$110, "aria-label", _p$.a = _v$30);
1694
- _v$31 !== _p$.o && _$setAttribute(_el$110, "data-active", _p$.o = _v$31);
1802
+ _v$28 !== _p$.e && _$setAttribute(_el$112, "id", _p$.e = _v$28);
1803
+ _v$29 !== _p$.t && _$setAttribute(_el$112, "aria-selected", _p$.t = _v$29);
1804
+ _v$30 !== _p$.a && _$setAttribute(_el$112, "aria-label", _p$.a = _v$30);
1805
+ _v$31 !== _p$.o && _$setAttribute(_el$112, "data-active", _p$.o = _v$31);
1695
1806
  return _p$;
1696
1807
  }, {
1697
1808
  e: undefined,
@@ -1700,13 +1811,13 @@ export function ChatComposer(props) {
1700
1811
  o: undefined
1701
1812
  });
1702
1813
  _$runHydrationEvents();
1703
- return _el$110;
1814
+ return _el$112;
1704
1815
  })()
1705
1816
  }));
1706
1817
  _$effect(() => _$setAttribute(_el$46, "aria-label", chatMessages().emojiSuggestions));
1707
1818
  return _el$45;
1708
1819
  }
1709
- }), _el$67, _co$11);
1820
+ }), _el$69, _co$12);
1710
1821
  _$insert(_el$43, _$createComponent(Show, {
1711
1822
  get when() {
1712
1823
  return commandsOpen();
@@ -1721,7 +1832,9 @@ export function ChatComposer(props) {
1721
1832
  _el$62 = _el$61.nextSibling,
1722
1833
  [_el$63, _co$1] = _$getNextMarker(_el$62.nextSibling),
1723
1834
  _el$64 = _el$63.nextSibling,
1724
- [_el$65, _co$10] = _$getNextMarker(_el$64.nextSibling);
1835
+ [_el$65, _co$10] = _$getNextMarker(_el$64.nextSibling),
1836
+ _el$66 = _el$65.nextSibling,
1837
+ [_el$67, _co$11] = _$getNextMarker(_el$66.nextSibling);
1725
1838
  var _ref$8 = commandListRef;
1726
1839
  typeof _ref$8 === "function" ? _$use(_ref$8, _el$48) : commandListRef = _el$48;
1727
1840
  _$setAttribute(_el$48, "id", commandListId);
@@ -1744,56 +1857,56 @@ export function ChatComposer(props) {
1744
1857
  });
1745
1858
  },
1746
1859
  get children() {
1747
- var _el$120 = _$getNextElement(_tmpl$30),
1748
- _el$121 = _el$120.firstChild,
1749
- _el$122 = _el$121.firstChild,
1750
- _el$124 = _el$122.nextSibling,
1751
- [_el$125, _co$30] = _$getNextMarker(_el$124.nextSibling),
1752
- _el$127 = _el$121.nextSibling,
1753
- [_el$128, _co$31] = _$getNextMarker(_el$127.nextSibling),
1754
- _el$129 = _el$128.nextSibling,
1755
- [_el$130, _co$32] = _$getNextMarker(_el$129.nextSibling);
1756
- _$insert(_el$122, () => group()?.scopeTitle ?? group()?.section?.label);
1757
- _$insert(_el$121, _$createComponent(Show, {
1860
+ var _el$122 = _$getNextElement(_tmpl$30),
1861
+ _el$123 = _el$122.firstChild,
1862
+ _el$124 = _el$123.firstChild,
1863
+ _el$126 = _el$124.nextSibling,
1864
+ [_el$127, _co$31] = _$getNextMarker(_el$126.nextSibling),
1865
+ _el$129 = _el$123.nextSibling,
1866
+ [_el$130, _co$32] = _$getNextMarker(_el$129.nextSibling),
1867
+ _el$131 = _el$130.nextSibling,
1868
+ [_el$132, _co$33] = _$getNextMarker(_el$131.nextSibling);
1869
+ _$insert(_el$124, () => group()?.scopeTitle ?? group()?.section?.label);
1870
+ _$insert(_el$123, _$createComponent(Show, {
1758
1871
  get when() {
1759
1872
  return group()?.loading;
1760
1873
  },
1761
1874
  get children() {
1762
1875
  return _$getNextElement(_tmpl$28);
1763
1876
  }
1764
- }), _el$125, _co$30);
1765
- _$insert(_el$120, _$createComponent(For, {
1877
+ }), _el$127, _co$31);
1878
+ _$insert(_el$122, _$createComponent(For, {
1766
1879
  get each() {
1767
1880
  return rows();
1768
1881
  },
1769
1882
  children: renderCommandRow
1770
- }), _el$128, _co$31);
1771
- _$insert(_el$120, _$createComponent(Show, {
1883
+ }), _el$130, _co$32);
1884
+ _$insert(_el$122, _$createComponent(Show, {
1772
1885
  get when() {
1773
1886
  return group()?.placeholder;
1774
1887
  },
1775
1888
  get children() {
1776
1889
  return _$getNextElement(_tmpl$29);
1777
1890
  }
1778
- }), _el$130, _co$32);
1891
+ }), _el$132, _co$33);
1779
1892
  _$effect(_p$ => {
1780
1893
  var _v$32 = headingId(),
1781
1894
  _v$33 = headingId();
1782
- _v$32 !== _p$.e && _$setAttribute(_el$120, "aria-labelledby", _p$.e = _v$32);
1783
- _v$33 !== _p$.t && _$setAttribute(_el$121, "id", _p$.t = _v$33);
1895
+ _v$32 !== _p$.e && _$setAttribute(_el$122, "aria-labelledby", _p$.e = _v$32);
1896
+ _v$33 !== _p$.t && _$setAttribute(_el$123, "id", _p$.t = _v$33);
1784
1897
  return _p$;
1785
1898
  }, {
1786
1899
  e: undefined,
1787
1900
  t: undefined
1788
1901
  });
1789
- return _el$120;
1902
+ return _el$122;
1790
1903
  }
1791
1904
  });
1792
1905
  }
1793
1906
  }), _el$59, _co$9);
1794
1907
  _$insert(_el$48, _$createComponent(Show, {
1795
1908
  get when() {
1796
- return _$memo(() => !!(searching() && commandMatches().length === 0))() && !commandModel().groups.some(group => group.section || group.scopeTitle);
1909
+ return _$memo(() => !!(searching() && foundCommandCount() === 0))() && !commandModel().groups.some(group => group.section || group.scopeTitle);
1797
1910
  },
1798
1911
  get children() {
1799
1912
  var _el$49 = _$getNextElement(_tmpl$16),
@@ -1819,7 +1932,7 @@ export function ChatComposer(props) {
1819
1932
  }), _el$63, _co$1);
1820
1933
  _$insert(_el$48, _$createComponent(Show, {
1821
1934
  get when() {
1822
- return _$memo(() => !!(!searching() && !searchError()))() && commandMatches().length === 0;
1935
+ return _$memo(() => !!(!searching() && !searchError()))() && foundCommandCount() === 0;
1823
1936
  },
1824
1937
  get children() {
1825
1938
  var _el$57 = _$getNextElement(_tmpl$18);
@@ -1832,6 +1945,13 @@ export function ChatComposer(props) {
1832
1945
  return _el$57;
1833
1946
  }
1834
1947
  }), _el$65, _co$10);
1948
+ _$insert(_el$48, _$createComponent(Show, {
1949
+ get when() {
1950
+ return commandModel().fallback?.command;
1951
+ },
1952
+ keyed: true,
1953
+ children: command => renderCommandRow(command)
1954
+ }), _el$67, _co$11);
1835
1955
  _$effect(_p$ => {
1836
1956
  var _v$19 = chatMessages().commands,
1837
1957
  _v$20 = searching() ? "true" : undefined;
@@ -1844,7 +1964,7 @@ export function ChatComposer(props) {
1844
1964
  });
1845
1965
  return _el$47;
1846
1966
  }
1847
- }), _el$69, _co$12);
1967
+ }), _el$71, _co$13);
1848
1968
  _$effect(_p$ => {
1849
1969
  var _v$21 = hasAccessory() ? undefined : "true",
1850
1970
  _v$22 = suggestionsOpen() ? "hidden" : undefined,
@@ -1860,227 +1980,227 @@ export function ChatComposer(props) {
1860
1980
  });
1861
1981
  return _el$43;
1862
1982
  }
1863
- }), _el$109, _co$27);
1983
+ }), _el$111, _co$28);
1864
1984
  var _ref$9 = composerRef;
1865
- typeof _ref$9 === "function" ? _$use(_ref$9, _el$70) : composerRef = _el$70;
1866
- _$insert(_el$70, _$createComponent(Show, {
1985
+ typeof _ref$9 === "function" ? _$use(_ref$9, _el$72) : composerRef = _el$72;
1986
+ _$insert(_el$72, _$createComponent(Show, {
1867
1987
  get when() {
1868
1988
  return showHint();
1869
1989
  },
1870
1990
  get children() {
1871
- var _el$71 = _$getNextElement(_tmpl$21);
1872
- _$insert(_el$71, _$createComponent(Show, {
1991
+ var _el$73 = _$getNextElement(_tmpl$21);
1992
+ _$insert(_el$73, _$createComponent(Show, {
1873
1993
  get when() {
1874
1994
  return dictationStatus();
1875
1995
  },
1876
1996
  get fallback() {
1877
1997
  return (() => {
1878
- var _el$131 = _$getNextElement(_tmpl$31);
1879
- _$insert(_el$131, hint);
1880
- return _el$131;
1998
+ var _el$133 = _$getNextElement(_tmpl$31);
1999
+ _$insert(_el$133, hint);
2000
+ return _el$133;
1881
2001
  })();
1882
2002
  },
1883
2003
  children: status => [(() => {
1884
- var _el$132 = _$getNextElement(_tmpl$32),
1885
- _el$133 = _el$132.firstChild,
1886
- _el$134 = _el$133.nextSibling;
1887
- _$insert(_el$134, () => status().text);
2004
+ var _el$134 = _$getNextElement(_tmpl$32),
2005
+ _el$135 = _el$134.firstChild,
2006
+ _el$136 = _el$135.nextSibling;
2007
+ _$insert(_el$136, () => status().text);
1888
2008
  _$effect(_p$ => {
1889
2009
  var _v$34 = dictation() ?? undefined,
1890
2010
  _v$35 = status().icon;
1891
- _v$34 !== _p$.e && _$setAttribute(_el$132, "data-state", _p$.e = _v$34);
1892
- _v$35 !== _p$.t && _$className(_el$133, _p$.t = _v$35);
2011
+ _v$34 !== _p$.e && _$setAttribute(_el$134, "data-state", _p$.e = _v$34);
2012
+ _v$35 !== _p$.t && _$className(_el$135, _p$.t = _v$35);
1893
2013
  return _p$;
1894
2014
  }, {
1895
2015
  e: undefined,
1896
2016
  t: undefined
1897
2017
  });
1898
- return _el$132;
2018
+ return _el$134;
1899
2019
  })(), _$createComponent(Show, {
1900
2020
  get when() {
1901
2021
  return _$memo(() => dictation() === "refined")() ? props.microphone?.onRestoreOriginal : undefined;
1902
2022
  },
1903
2023
  children: restore => (() => {
1904
- var _el$135 = _$getNextElement(_tmpl$33);
1905
- _el$135.$$click = () => reportChatFailure(restore(), props.onError);
1906
- _el$135.$$mousedown = keepFieldFocus;
1907
- _$insert(_el$135, () => chatMessages().restoreOriginal);
1908
- _$effect(() => _$setProperty(_el$135, "disabled", microphoneDisabled()));
2024
+ var _el$137 = _$getNextElement(_tmpl$33);
2025
+ _el$137.$$click = () => reportChatFailure(restore(), props.onError);
2026
+ _el$137.$$mousedown = keepFieldFocus;
2027
+ _$insert(_el$137, () => chatMessages().restoreOriginal);
2028
+ _$effect(() => _$setProperty(_el$137, "disabled", microphoneDisabled()));
1909
2029
  _$runHydrationEvents();
1910
- return _el$135;
2030
+ return _el$137;
1911
2031
  })()
1912
2032
  })]
1913
2033
  }));
1914
- return _el$71;
2034
+ return _el$73;
1915
2035
  }
1916
- }), _el$95, _co$21);
1917
- _$insert(_el$70, _$createComponent(Show, {
2036
+ }), _el$97, _co$22);
2037
+ _$insert(_el$72, _$createComponent(Show, {
1918
2038
  get when() {
1919
2039
  return attachments().length > 0;
1920
2040
  },
1921
2041
  get children() {
1922
- var _el$72 = _$getNextElement(_tmpl$22);
1923
- _$insert(_el$72, _$createComponent(For, {
2042
+ var _el$74 = _$getNextElement(_tmpl$22);
2043
+ _$insert(_el$74, _$createComponent(For, {
1924
2044
  get each() {
1925
2045
  return attachments();
1926
2046
  },
1927
2047
  children: attachment => (() => {
1928
- var _el$136 = _$getNextElement(_tmpl$35),
1929
- _el$137 = _el$136.firstChild,
1930
- _el$138 = _el$137.firstChild,
1931
- [_el$139, _co$33] = _$getNextMarker(_el$138.nextSibling),
1932
- _el$140 = _el$139.nextSibling,
2048
+ var _el$138 = _$getNextElement(_tmpl$35),
2049
+ _el$139 = _el$138.firstChild,
2050
+ _el$140 = _el$139.firstChild,
1933
2051
  [_el$141, _co$34] = _$getNextMarker(_el$140.nextSibling),
1934
- _el$143 = _el$137.nextSibling,
1935
- [_el$144, _co$35] = _$getNextMarker(_el$143.nextSibling);
1936
- _$insert(_el$137, _$createComponent(Show, {
2052
+ _el$142 = _el$141.nextSibling,
2053
+ [_el$143, _co$35] = _$getNextMarker(_el$142.nextSibling),
2054
+ _el$145 = _el$139.nextSibling,
2055
+ [_el$146, _co$36] = _$getNextMarker(_el$145.nextSibling);
2056
+ _$insert(_el$139, _$createComponent(Show, {
1937
2057
  get when() {
1938
2058
  return attachment.href;
1939
2059
  },
1940
2060
  get fallback() {
1941
2061
  return (() => {
1942
- var _el$145 = _$getNextElement(_tmpl$37),
1943
- _el$147 = _el$145.firstChild,
1944
- [_el$148, _co$36] = _$getNextMarker(_el$147.nextSibling),
1945
- _el$149 = _el$148.nextSibling,
1946
- [_el$150, _co$37] = _$getNextMarker(_el$149.nextSibling);
1947
- _$insert(_el$145, _$createComponent(Show, {
2062
+ var _el$147 = _$getNextElement(_tmpl$37),
2063
+ _el$149 = _el$147.firstChild,
2064
+ [_el$150, _co$37] = _$getNextMarker(_el$149.nextSibling),
2065
+ _el$151 = _el$150.nextSibling,
2066
+ [_el$152, _co$38] = _$getNextMarker(_el$151.nextSibling);
2067
+ _$insert(_el$147, _$createComponent(Show, {
1948
2068
  get when() {
1949
2069
  return _$memo(() => attachment.kind === "image")() && attachment.previewUrl;
1950
2070
  },
1951
2071
  get fallback() {
1952
2072
  return (() => {
1953
- var _el$151 = _$getNextElement(_tmpl$3);
1954
- _$effect(() => _$className(_el$151, attachmentIcon(attachment)));
1955
- return _el$151;
2073
+ var _el$153 = _$getNextElement(_tmpl$3);
2074
+ _$effect(() => _$className(_el$153, attachmentIcon(attachment)));
2075
+ return _el$153;
1956
2076
  })();
1957
2077
  },
1958
2078
  get children() {
1959
- var _el$146 = _$getNextElement(_tmpl$36);
2079
+ var _el$148 = _$getNextElement(_tmpl$36);
1960
2080
  _$effect(_p$ => {
1961
2081
  var _v$38 = attachment.previewUrl,
1962
2082
  _v$39 = attachment.alt ?? "";
1963
- _v$38 !== _p$.e && _$setAttribute(_el$146, "src", _p$.e = _v$38);
1964
- _v$39 !== _p$.t && _$setAttribute(_el$146, "alt", _p$.t = _v$39);
2083
+ _v$38 !== _p$.e && _$setAttribute(_el$148, "src", _p$.e = _v$38);
2084
+ _v$39 !== _p$.t && _$setAttribute(_el$148, "alt", _p$.t = _v$39);
1965
2085
  return _p$;
1966
2086
  }, {
1967
2087
  e: undefined,
1968
2088
  t: undefined
1969
2089
  });
1970
- return _el$146;
2090
+ return _el$148;
1971
2091
  }
1972
- }), _el$148, _co$36);
1973
- _$insert(_el$145, () => renderAttachmentCopy(attachment), _el$150, _co$37);
1974
- return _el$145;
2092
+ }), _el$150, _co$37);
2093
+ _$insert(_el$147, () => renderAttachmentCopy(attachment), _el$152, _co$38);
2094
+ return _el$147;
1975
2095
  })();
1976
2096
  },
1977
2097
  children: href => (() => {
1978
- var _el$152 = _$getNextElement(_tmpl$38),
1979
- _el$154 = _el$152.firstChild,
1980
- [_el$155, _co$38] = _$getNextMarker(_el$154.nextSibling),
1981
- _el$156 = _el$155.nextSibling,
1982
- [_el$157, _co$39] = _$getNextMarker(_el$156.nextSibling);
1983
- _$insert(_el$152, _$createComponent(Show, {
2098
+ var _el$154 = _$getNextElement(_tmpl$38),
2099
+ _el$156 = _el$154.firstChild,
2100
+ [_el$157, _co$39] = _$getNextMarker(_el$156.nextSibling),
2101
+ _el$158 = _el$157.nextSibling,
2102
+ [_el$159, _co$40] = _$getNextMarker(_el$158.nextSibling);
2103
+ _$insert(_el$154, _$createComponent(Show, {
1984
2104
  get when() {
1985
2105
  return _$memo(() => attachment.kind === "image")() && attachment.previewUrl;
1986
2106
  },
1987
2107
  get fallback() {
1988
2108
  return (() => {
1989
- var _el$158 = _$getNextElement(_tmpl$3);
1990
- _$effect(() => _$className(_el$158, attachmentIcon(attachment)));
1991
- return _el$158;
2109
+ var _el$160 = _$getNextElement(_tmpl$3);
2110
+ _$effect(() => _$className(_el$160, attachmentIcon(attachment)));
2111
+ return _el$160;
1992
2112
  })();
1993
2113
  },
1994
2114
  get children() {
1995
- var _el$153 = _$getNextElement(_tmpl$36);
2115
+ var _el$155 = _$getNextElement(_tmpl$36);
1996
2116
  _$effect(_p$ => {
1997
2117
  var _v$40 = attachment.previewUrl,
1998
2118
  _v$41 = attachment.alt ?? "";
1999
- _v$40 !== _p$.e && _$setAttribute(_el$153, "src", _p$.e = _v$40);
2000
- _v$41 !== _p$.t && _$setAttribute(_el$153, "alt", _p$.t = _v$41);
2119
+ _v$40 !== _p$.e && _$setAttribute(_el$155, "src", _p$.e = _v$40);
2120
+ _v$41 !== _p$.t && _$setAttribute(_el$155, "alt", _p$.t = _v$41);
2001
2121
  return _p$;
2002
2122
  }, {
2003
2123
  e: undefined,
2004
2124
  t: undefined
2005
2125
  });
2006
- return _el$153;
2126
+ return _el$155;
2007
2127
  }
2008
- }), _el$155, _co$38);
2009
- _$insert(_el$152, () => renderAttachmentCopy(attachment), _el$157, _co$39);
2128
+ }), _el$157, _co$39);
2129
+ _$insert(_el$154, () => renderAttachmentCopy(attachment), _el$159, _co$40);
2010
2130
  _$effect(_p$ => {
2011
2131
  var _v$42 = href(),
2012
2132
  _v$43 = chatMessages().openInNewTab({
2013
2133
  name: attachment.name
2014
2134
  });
2015
- _v$42 !== _p$.e && _$setAttribute(_el$152, "href", _p$.e = _v$42);
2016
- _v$43 !== _p$.t && _$setAttribute(_el$152, "aria-label", _p$.t = _v$43);
2135
+ _v$42 !== _p$.e && _$setAttribute(_el$154, "href", _p$.e = _v$42);
2136
+ _v$43 !== _p$.t && _$setAttribute(_el$154, "aria-label", _p$.t = _v$43);
2017
2137
  return _p$;
2018
2138
  }, {
2019
2139
  e: undefined,
2020
2140
  t: undefined
2021
2141
  });
2022
- return _el$152;
2142
+ return _el$154;
2023
2143
  })()
2024
- }), _el$139, _co$33);
2025
- _$insert(_el$137, _$createComponent(Show, {
2144
+ }), _el$141, _co$34);
2145
+ _$insert(_el$139, _$createComponent(Show, {
2026
2146
  get when() {
2027
2147
  return attachment.action;
2028
2148
  },
2029
2149
  children: action => (() => {
2030
- var _el$159 = _$getNextElement(_tmpl$39),
2031
- _el$160 = _el$159.firstChild,
2032
- [_el$161, _co$40] = _$getNextMarker(_el$160.nextSibling),
2033
- _el$162 = _el$161.nextSibling,
2034
- [_el$163, _co$41] = _$getNextMarker(_el$162.nextSibling);
2035
- _el$159.$$click = () => reportChatFailure(() => executeChatAction(action()), props.onError);
2036
- _$insert(_el$159, _$createComponent(Show, {
2150
+ var _el$161 = _$getNextElement(_tmpl$39),
2151
+ _el$162 = _el$161.firstChild,
2152
+ [_el$163, _co$41] = _$getNextMarker(_el$162.nextSibling),
2153
+ _el$164 = _el$163.nextSibling,
2154
+ [_el$165, _co$42] = _$getNextMarker(_el$164.nextSibling);
2155
+ _el$161.$$click = () => reportChatFailure(() => executeChatAction(action()), props.onError);
2156
+ _$insert(_el$161, _$createComponent(Show, {
2037
2157
  get when() {
2038
2158
  return action().icon;
2039
2159
  },
2040
2160
  children: icon => (() => {
2041
- var _el$164 = _$getNextElement(_tmpl$3);
2042
- _$effect(() => _$className(_el$164, icon()));
2043
- return _el$164;
2161
+ var _el$166 = _$getNextElement(_tmpl$3);
2162
+ _$effect(() => _$className(_el$166, icon()));
2163
+ return _el$166;
2044
2164
  })()
2045
- }), _el$161, _co$40);
2046
- _$insert(_el$159, () => action().label, _el$163, _co$41);
2047
- _$effect(() => _$setProperty(_el$159, "disabled", blocked() || action().disabled));
2165
+ }), _el$163, _co$41);
2166
+ _$insert(_el$161, () => action().label, _el$165, _co$42);
2167
+ _$effect(() => _$setProperty(_el$161, "disabled", blocked() || action().disabled));
2048
2168
  _$runHydrationEvents();
2049
- return _el$159;
2169
+ return _el$161;
2050
2170
  })()
2051
- }), _el$141, _co$34);
2052
- _$insert(_el$136, _$createComponent(Show, {
2171
+ }), _el$143, _co$35);
2172
+ _$insert(_el$138, _$createComponent(Show, {
2053
2173
  get when() {
2054
2174
  return props.onAttachmentsChange;
2055
2175
  },
2056
2176
  get children() {
2057
- var _el$142 = _$getNextElement(_tmpl$34);
2058
- _el$142.$$click = () => setAttachments(attachments().filter(candidate => candidate.id !== attachment.id));
2177
+ var _el$144 = _$getNextElement(_tmpl$34);
2178
+ _el$144.$$click = () => setAttachments(attachments().filter(candidate => candidate.id !== attachment.id));
2059
2179
  _$effect(_p$ => {
2060
2180
  var _v$36 = selectMessages().removeNamed({
2061
2181
  name: attachment.name
2062
2182
  }),
2063
2183
  _v$37 = blocked();
2064
- _v$36 !== _p$.e && _$setAttribute(_el$142, "aria-label", _p$.e = _v$36);
2065
- _v$37 !== _p$.t && _$setProperty(_el$142, "disabled", _p$.t = _v$37);
2184
+ _v$36 !== _p$.e && _$setAttribute(_el$144, "aria-label", _p$.e = _v$36);
2185
+ _v$37 !== _p$.t && _$setProperty(_el$144, "disabled", _p$.t = _v$37);
2066
2186
  return _p$;
2067
2187
  }, {
2068
2188
  e: undefined,
2069
2189
  t: undefined
2070
2190
  });
2071
2191
  _$runHydrationEvents();
2072
- return _el$142;
2192
+ return _el$144;
2073
2193
  }
2074
- }), _el$144, _co$35);
2075
- _$effect(() => _el$137.classList.toggle("k2b-chat-composer__attachment-content--action", !!Boolean(attachment.action)));
2076
- return _el$136;
2194
+ }), _el$146, _co$36);
2195
+ _$effect(() => _el$139.classList.toggle("k2b-chat-composer__attachment-content--action", !!Boolean(attachment.action)));
2196
+ return _el$138;
2077
2197
  })()
2078
2198
  }));
2079
- _$effect(() => _$setAttribute(_el$72, "aria-label", chatMessages().attachments));
2080
- return _el$72;
2199
+ _$effect(() => _$setAttribute(_el$74, "aria-label", chatMessages().attachments));
2200
+ return _el$74;
2081
2201
  }
2082
- }), _el$97, _co$22);
2083
- _$insert(_el$70, _$createComponent(Show, {
2202
+ }), _el$99, _co$23);
2203
+ _$insert(_el$72, _$createComponent(Show, {
2084
2204
  get when() {
2085
2205
  return conversation();
2086
2206
  },
@@ -2090,25 +2210,23 @@ export function ChatComposer(props) {
2090
2210
  return props.error;
2091
2211
  },
2092
2212
  get children() {
2093
- var _el$165 = _$getNextElement(_tmpl$23),
2094
- _el$166 = _el$165.firstChild,
2095
- _el$167 = _el$166.nextSibling,
2096
- [_el$168, _co$42] = _$getNextMarker(_el$167.nextSibling);
2097
- _$insert(_el$165, () => props.error, _el$168, _co$42);
2098
- return _el$165;
2213
+ var _el$167 = _$getNextElement(_tmpl$23),
2214
+ _el$168 = _el$167.firstChild,
2215
+ _el$169 = _el$168.nextSibling,
2216
+ [_el$170, _co$43] = _$getNextMarker(_el$169.nextSibling);
2217
+ _$insert(_el$167, () => props.error, _el$170, _co$43);
2218
+ return _el$167;
2099
2219
  }
2100
2220
  }), _$memo(formatRow), (() => {
2101
- var _el$169 = _$getNextElement(_tmpl$40);
2102
- _$insert(_el$169, _$createComponent(Show, {
2221
+ var _el$171 = _$getNextElement(_tmpl$40);
2222
+ _$insert(_el$171, _$createComponent(Show, {
2103
2223
  get when() {
2104
2224
  return footer();
2105
2225
  },
2106
2226
  get fallback() {
2107
2227
  return [(() => {
2108
- var _el$170 = _$getNextElement(_tmpl$41),
2109
- _el$171 = _el$170.firstChild,
2110
- [_el$172, _co$43] = _$getNextMarker(_el$171.nextSibling),
2111
- _el$173 = _el$172.nextSibling,
2228
+ var _el$172 = _$getNextElement(_tmpl$41),
2229
+ _el$173 = _el$172.firstChild,
2112
2230
  [_el$174, _co$44] = _$getNextMarker(_el$173.nextSibling),
2113
2231
  _el$175 = _el$174.nextSibling,
2114
2232
  [_el$176, _co$45] = _$getNextMarker(_el$175.nextSibling),
@@ -2119,20 +2237,22 @@ export function ChatComposer(props) {
2119
2237
  _el$181 = _el$180.nextSibling,
2120
2238
  [_el$182, _co$48] = _$getNextMarker(_el$181.nextSibling),
2121
2239
  _el$183 = _el$182.nextSibling,
2122
- [_el$184, _co$49] = _$getNextMarker(_el$183.nextSibling);
2123
- _$insert(_el$170, () => props.footerTools, _el$172, _co$43);
2124
- _$insert(_el$170, _$createComponent(Show, {
2240
+ [_el$184, _co$49] = _$getNextMarker(_el$183.nextSibling),
2241
+ _el$185 = _el$184.nextSibling,
2242
+ [_el$186, _co$50] = _$getNextMarker(_el$185.nextSibling);
2243
+ _$insert(_el$172, () => props.footerTools, _el$174, _co$44);
2244
+ _$insert(_el$172, _$createComponent(Show, {
2125
2245
  get when() {
2126
2246
  return hasAddMenu();
2127
2247
  },
2128
2248
  get children() {
2129
2249
  return addMenu("ti ti-plus");
2130
2250
  }
2131
- }), _el$174, _co$44);
2132
- _$insert(_el$170, fileInput, _el$176, _co$45);
2133
- _$insert(_el$170, formatToggle, _el$178, _co$46);
2134
- _$insert(_el$170, emojiButton, _el$180, _co$47);
2135
- _$insert(_el$170, _$createComponent(Show, {
2251
+ }), _el$176, _co$45);
2252
+ _$insert(_el$172, fileInput, _el$178, _co$46);
2253
+ _$insert(_el$172, formatToggle, _el$180, _co$47);
2254
+ _$insert(_el$172, emojiButton, _el$182, _co$48);
2255
+ _$insert(_el$172, _$createComponent(Show, {
2136
2256
  get when() {
2137
2257
  return (props.models?.length ?? 0) > 0;
2138
2258
  },
@@ -2178,22 +2298,22 @@ export function ChatComposer(props) {
2178
2298
  }
2179
2299
  });
2180
2300
  }
2181
- }), _el$182, _co$48);
2182
- _$insert(_el$170, () => props.modelDetails, _el$184, _co$49);
2183
- return _el$170;
2301
+ }), _el$184, _co$49);
2302
+ _$insert(_el$172, () => props.modelDetails, _el$186, _co$50);
2303
+ return _el$172;
2184
2304
  })(), (() => {
2185
- var _el$185 = _$getNextElement(_tmpl$42),
2186
- _el$186 = _el$185.firstChild,
2187
- [_el$187, _co$50] = _$getNextMarker(_el$186.nextSibling),
2188
- _el$188 = _el$187.nextSibling,
2305
+ var _el$187 = _$getNextElement(_tmpl$42),
2306
+ _el$188 = _el$187.firstChild,
2189
2307
  [_el$189, _co$51] = _$getNextMarker(_el$188.nextSibling),
2190
2308
  _el$190 = _el$189.nextSibling,
2191
2309
  [_el$191, _co$52] = _$getNextMarker(_el$190.nextSibling),
2192
2310
  _el$192 = _el$191.nextSibling,
2193
2311
  [_el$193, _co$53] = _$getNextMarker(_el$192.nextSibling),
2194
2312
  _el$194 = _el$193.nextSibling,
2195
- [_el$195, _co$54] = _$getNextMarker(_el$194.nextSibling);
2196
- _$insert(_el$185, _$createComponent(For, {
2313
+ [_el$195, _co$54] = _$getNextMarker(_el$194.nextSibling),
2314
+ _el$196 = _el$195.nextSibling,
2315
+ [_el$197, _co$55] = _$getNextMarker(_el$196.nextSibling);
2316
+ _$insert(_el$187, _$createComponent(For, {
2197
2317
  get each() {
2198
2318
  return props.contextActions;
2199
2319
  },
@@ -2217,13 +2337,13 @@ export function ChatComposer(props) {
2217
2337
  },
2218
2338
  onClick: () => reportChatFailure(() => executeChatAction(action), props.onError),
2219
2339
  get children() {
2220
- var _el$196 = _$getNextElement(_tmpl$3);
2221
- _$effect(() => _$className(_el$196, action.icon ?? "ti ti-dots"));
2222
- return _el$196;
2340
+ var _el$198 = _$getNextElement(_tmpl$3);
2341
+ _$effect(() => _$className(_el$198, action.icon ?? "ti ti-dots"));
2342
+ return _el$198;
2223
2343
  }
2224
2344
  })
2225
- }), _el$187, _co$50);
2226
- _$insert(_el$185, _$createComponent(Show, {
2345
+ }), _el$189, _co$51);
2346
+ _$insert(_el$187, _$createComponent(Show, {
2227
2347
  get when() {
2228
2348
  return _$memo(() => !!hasContextUsage())() ? props.contextUsage ?? {} : undefined;
2229
2349
  },
@@ -2235,18 +2355,18 @@ export function ChatComposer(props) {
2235
2355
  return props.onError;
2236
2356
  }
2237
2357
  }))
2238
- }), _el$189, _co$51);
2239
- _$insert(_el$185, () => props.submitTools, _el$191, _co$52);
2240
- _$insert(_el$185, microphoneControl, _el$193, _co$53);
2241
- _$insert(_el$185, sendControl, _el$195, _co$54);
2242
- return _el$185;
2358
+ }), _el$191, _co$52);
2359
+ _$insert(_el$187, () => props.submitTools, _el$193, _co$53);
2360
+ _$insert(_el$187, microphoneControl, _el$195, _co$54);
2361
+ _$insert(_el$187, sendControl, _el$197, _co$55);
2362
+ return _el$187;
2243
2363
  })()];
2244
2364
  },
2245
2365
  get children() {
2246
2366
  return footer();
2247
2367
  }
2248
2368
  }));
2249
- return _el$169;
2369
+ return _el$171;
2250
2370
  })()];
2251
2371
  },
2252
2372
  get children() {
@@ -2255,43 +2375,43 @@ export function ChatComposer(props) {
2255
2375
  return props.error;
2256
2376
  },
2257
2377
  get children() {
2258
- var _el$73 = _$getNextElement(_tmpl$23),
2259
- _el$74 = _el$73.firstChild,
2260
- _el$75 = _el$74.nextSibling,
2261
- [_el$76, _co$13] = _$getNextMarker(_el$75.nextSibling);
2262
- _$insert(_el$73, () => props.error, _el$76, _co$13);
2263
- return _el$73;
2378
+ var _el$75 = _$getNextElement(_tmpl$23),
2379
+ _el$76 = _el$75.firstChild,
2380
+ _el$77 = _el$76.nextSibling,
2381
+ [_el$78, _co$14] = _$getNextMarker(_el$77.nextSibling);
2382
+ _$insert(_el$75, () => props.error, _el$78, _co$14);
2383
+ return _el$75;
2264
2384
  }
2265
2385
  }), _$memo(() => formatRow()), (() => {
2266
- var _el$77 = _$getNextElement(_tmpl$24),
2267
- _el$88 = _el$77.firstChild,
2268
- [_el$89, _co$18] = _$getNextMarker(_el$88.nextSibling),
2269
- _el$90 = _el$89.nextSibling,
2386
+ var _el$79 = _$getNextElement(_tmpl$24),
2387
+ _el$90 = _el$79.firstChild,
2270
2388
  [_el$91, _co$19] = _$getNextMarker(_el$90.nextSibling),
2271
- _el$78 = _el$91.nextSibling,
2272
- _el$86 = _el$78.firstChild,
2273
- [_el$87, _co$17] = _$getNextMarker(_el$86.nextSibling),
2274
- _el$79 = _el$87.nextSibling,
2275
- _el$80 = _el$79.firstChild,
2276
- [_el$81, _co$14] = _$getNextMarker(_el$80.nextSibling),
2277
- _el$82 = _el$81.nextSibling,
2389
+ _el$92 = _el$91.nextSibling,
2390
+ [_el$93, _co$20] = _$getNextMarker(_el$92.nextSibling),
2391
+ _el$80 = _el$93.nextSibling,
2392
+ _el$88 = _el$80.firstChild,
2393
+ [_el$89, _co$18] = _$getNextMarker(_el$88.nextSibling),
2394
+ _el$81 = _el$89.nextSibling,
2395
+ _el$82 = _el$81.firstChild,
2278
2396
  [_el$83, _co$15] = _$getNextMarker(_el$82.nextSibling),
2279
2397
  _el$84 = _el$83.nextSibling,
2280
2398
  [_el$85, _co$16] = _$getNextMarker(_el$84.nextSibling),
2281
- _el$92 = _el$78.nextSibling,
2282
- [_el$93, _co$20] = _$getNextMarker(_el$92.nextSibling);
2283
- _$insert(_el$77, attachControl, _el$89, _co$18);
2284
- _$insert(_el$77, fileInput, _el$91, _co$19);
2285
- _$insert(_el$78, field, _el$87, _co$17);
2286
- _$insert(_el$79, formatToggle, _el$81, _co$14);
2287
- _$insert(_el$79, emojiButton, _el$83, _co$15);
2288
- _$insert(_el$79, microphoneControl, _el$85, _co$16);
2289
- _$insert(_el$77, sendControl, _el$93, _co$20);
2290
- return _el$77;
2399
+ _el$86 = _el$85.nextSibling,
2400
+ [_el$87, _co$17] = _$getNextMarker(_el$86.nextSibling),
2401
+ _el$94 = _el$80.nextSibling,
2402
+ [_el$95, _co$21] = _$getNextMarker(_el$94.nextSibling);
2403
+ _$insert(_el$79, attachControl, _el$91, _co$19);
2404
+ _$insert(_el$79, fileInput, _el$93, _co$20);
2405
+ _$insert(_el$80, field, _el$89, _co$18);
2406
+ _$insert(_el$81, formatToggle, _el$83, _co$15);
2407
+ _$insert(_el$81, emojiButton, _el$85, _co$16);
2408
+ _$insert(_el$81, microphoneControl, _el$87, _co$17);
2409
+ _$insert(_el$79, sendControl, _el$95, _co$21);
2410
+ return _el$79;
2291
2411
  })()];
2292
2412
  }
2293
- }), _el$99, _co$23);
2294
- _$insert(_el$70, _$createComponent(Show, {
2413
+ }), _el$101, _co$24);
2414
+ _$insert(_el$72, _$createComponent(Show, {
2295
2415
  get when() {
2296
2416
  return props.fileSelection;
2297
2417
  },
@@ -2310,60 +2430,60 @@ export function ChatComposer(props) {
2310
2430
  },
2311
2431
  onDrop: files => void runFiles(files)
2312
2432
  })
2313
- }), _el$101, _co$24);
2314
- _$insert(_el$102, _$createComponent(Show, {
2433
+ }), _el$103, _co$25);
2434
+ _$insert(_el$104, _$createComponent(Show, {
2315
2435
  get when() {
2316
2436
  return suggestionAnnouncement();
2317
2437
  },
2318
2438
  keyed: true,
2319
2439
  children: announced => (() => {
2320
- var _el$197 = _$getNextElement(_tmpl$10);
2321
- _$insert(_el$197, () => announced.text);
2322
- return _el$197;
2440
+ var _el$199 = _$getNextElement(_tmpl$10);
2441
+ _$insert(_el$199, () => announced.text);
2442
+ return _el$199;
2323
2443
  })()
2324
2444
  }));
2325
- _$insert(_el$103, _$createComponent(Show, {
2445
+ _$insert(_el$105, _$createComponent(Show, {
2326
2446
  get when() {
2327
2447
  return _$memo(() => !!!suggestionsOpen())() && commandStatus();
2328
2448
  },
2329
2449
  children: status => (() => {
2330
- var _el$198 = _$getNextElement(_tmpl$43),
2331
- _el$199 = _el$198.firstChild,
2332
- _el$200 = _el$199.nextSibling;
2333
- _$insert(_el$200, () => status().text);
2450
+ var _el$200 = _$getNextElement(_tmpl$43),
2451
+ _el$201 = _el$200.firstChild,
2452
+ _el$202 = _el$201.nextSibling;
2453
+ _$insert(_el$202, () => status().text);
2334
2454
  _$effect(_p$ => {
2335
2455
  var _v$44 = status().tone,
2336
2456
  _v$45 = status().tone === "busy" ? "ti ti-loader-2 k2b-spin" : status().tone === "done" ? "ti ti-check" : "ti ti-alert-circle";
2337
- _v$44 !== _p$.e && _$setAttribute(_el$198, "data-tone", _p$.e = _v$44);
2338
- _v$45 !== _p$.t && _$className(_el$199, _p$.t = _v$45);
2457
+ _v$44 !== _p$.e && _$setAttribute(_el$200, "data-tone", _p$.e = _v$44);
2458
+ _v$45 !== _p$.t && _$className(_el$201, _p$.t = _v$45);
2339
2459
  return _p$;
2340
2460
  }, {
2341
2461
  e: undefined,
2342
2462
  t: undefined
2343
2463
  });
2344
- return _el$198;
2464
+ return _el$200;
2345
2465
  })()
2346
- }), _el$105, _co$25);
2347
- _$insert(_el$103, _$createComponent(Show, {
2466
+ }), _el$107, _co$26);
2467
+ _$insert(_el$105, _$createComponent(Show, {
2348
2468
  get when() {
2349
2469
  return _$memo(() => !!suggestionsOpen())() && announcement();
2350
2470
  },
2351
2471
  keyed: true,
2352
2472
  children: announced => (() => {
2353
- var _el$201 = _$getNextElement(_tmpl$44);
2354
- _$insert(_el$201, () => announced.text);
2355
- return _el$201;
2473
+ var _el$203 = _$getNextElement(_tmpl$44);
2474
+ _$insert(_el$203, () => announced.text);
2475
+ return _el$203;
2356
2476
  })()
2357
- }), _el$107, _co$26);
2477
+ }), _el$109, _co$27);
2358
2478
  _$effect(_p$ => {
2359
2479
  var _v$24 = `k2b-chat-composer ${props.class ?? ""}`,
2360
2480
  _v$25 = running() ? "true" : undefined,
2361
2481
  _v$26 = conversation() ? "conversation" : undefined,
2362
2482
  _v$27 = props.label ?? chatMessages().messageComposer;
2363
- _v$24 !== _p$.e && _$className(_el$70, _p$.e = _v$24);
2364
- _v$25 !== _p$.t && _$setAttribute(_el$70, "data-running", _p$.t = _v$25);
2365
- _v$26 !== _p$.a && _$setAttribute(_el$70, "data-variant", _p$.a = _v$26);
2366
- _v$27 !== _p$.o && _$setAttribute(_el$70, "aria-label", _p$.o = _v$27);
2483
+ _v$24 !== _p$.e && _$className(_el$72, _p$.e = _v$24);
2484
+ _v$25 !== _p$.t && _$setAttribute(_el$72, "data-running", _p$.t = _v$25);
2485
+ _v$26 !== _p$.a && _$setAttribute(_el$72, "data-variant", _p$.a = _v$26);
2486
+ _v$27 !== _p$.o && _$setAttribute(_el$72, "aria-label", _p$.o = _v$27);
2367
2487
  return _p$;
2368
2488
  }, {
2369
2489
  e: undefined,