@memberjunction/ng-composer 5.47.0 → 5.48.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.
@@ -69,6 +69,8 @@ export declare class MentionEditorComponent implements OnInit, AfterViewInit, Co
69
69
  attachmentsChanged: EventEmitter<PendingAttachment[]>;
70
70
  attachmentError: EventEmitter<string>;
71
71
  attachmentClicked: EventEmitter<PendingAttachment>;
72
+ /** Fires when the contenteditable loses focus (hosts persist drafts on this). */
73
+ editorBlurred: EventEmitter<void>;
72
74
  pendingAttachments: PendingAttachment[];
73
75
  isDragOver: boolean;
74
76
  showMentionDropdown: boolean;
@@ -151,6 +153,21 @@ export declare class MentionEditorComponent implements OnInit, AfterViewInit, Co
151
153
  /**
152
154
  * Insert a mention chip at the current cursor position
153
155
  */
156
+ /**
157
+ * Programmatically inserts a RESOLVED mention chip (+ a single trailing space) at
158
+ * the END of the editor content and places the caret after it — the exact state a
159
+ * user reaches by typing a trigger and picking from the dropdown. Unlike the
160
+ * dropdown path this needs no active trigger context, so hosts can pre-address a
161
+ * message (e.g. the omnibar's '@agent' flow staging a Sage pill) and leave the
162
+ * user ready to type.
163
+ *
164
+ * @returns false when the editor view isn't mounted yet — callers may retry.
165
+ */
166
+ /** Focuses the editor and places the caret at the very end of its content. */
167
+ FocusCaretAtEnd(): boolean;
168
+ /** True when keyboard focus currently sits inside this editor. */
169
+ get HasFocus(): boolean;
170
+ InsertMention(suggestion: MentionSuggestion, focus?: boolean): boolean;
154
171
  private insertMentionChip;
155
172
  /**
156
173
  * Create a mention chip DOM element
@@ -183,7 +200,27 @@ export declare class MentionEditorComponent implements OnInit, AfterViewInit, Co
183
200
  /**
184
201
  * Set editor content from plain text (for programmatic updates)
185
202
  */
203
+ /**
204
+ * Renders a value into the editor, REHYDRATING any serialized mention tokens
205
+ * (the `@{"type":…,"id":…,"name":…}` format produced by
206
+ * {@link getPlainTextWithJsonMentions}) back into real chips — so persisted
207
+ * drafts and any host-written serialized value round-trip losslessly. Plain
208
+ * strings (no tokens) take the fast path.
209
+ */
186
210
  private setEditorContent;
211
+ /**
212
+ * Splits text containing serialized mention tokens into plain-string segments and
213
+ * parsed mention segments. Token = '@' followed by a JSON object with at least
214
+ * {type,id,name}; brace matching is string-aware so names containing braces or
215
+ * escaped quotes parse correctly. Malformed candidates stay as literal text.
216
+ */
217
+ static ParseSerializedMentions(text: string): Array<string | {
218
+ suggestion: MentionSuggestion;
219
+ configId?: string;
220
+ config?: string;
221
+ }>;
222
+ /** Index of the matching closing brace for the object starting at `openIndex` ('{'), string-aware. -1 when unbalanced. */
223
+ private static findJsonEnd;
187
224
  writeValue(value: string): void;
188
225
  registerOnChange(fn: (value: string) => void): void;
189
226
  registerOnTouched(fn: () => void): void;
@@ -289,6 +326,6 @@ export declare class MentionEditorComponent implements OnInit, AfterViewInit, Co
289
326
  */
290
327
  openFilePicker(): void;
291
328
  static ɵfac: i0.ɵɵFactoryDeclaration<MentionEditorComponent, never>;
292
- static ɵcmp: i0.ɵɵComponentDeclaration<MentionEditorComponent, "mj-mention-editor", never, { "placeholder": { "alias": "placeholder"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "currentUser": { "alias": "currentUser"; "required": false; }; "enableMentions": { "alias": "enableMentions"; "required": false; }; "TriggerProviders": { "alias": "TriggerProviders"; "required": false; }; "ExcludedTriggerKeys": { "alias": "ExcludedTriggerKeys"; "required": false; }; "Provider": { "alias": "Provider"; "required": false; }; "autoFocus": { "alias": "autoFocus"; "required": false; }; "enableAttachments": { "alias": "enableAttachments"; "required": false; }; "maxAttachments": { "alias": "maxAttachments"; "required": false; }; "maxAttachmentSizeBytes": { "alias": "maxAttachmentSizeBytes"; "required": false; }; "acceptedFileTypes": { "alias": "acceptedFileTypes"; "required": false; }; }, { "valueChange": "valueChange"; "mentionSelected": "mentionSelected"; "enterPressed": "enterPressed"; "attachmentsChanged": "attachmentsChanged"; "attachmentError": "attachmentError"; "attachmentClicked": "attachmentClicked"; }, never, never, false, never>;
329
+ static ɵcmp: i0.ɵɵComponentDeclaration<MentionEditorComponent, "mj-mention-editor", never, { "placeholder": { "alias": "placeholder"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "currentUser": { "alias": "currentUser"; "required": false; }; "enableMentions": { "alias": "enableMentions"; "required": false; }; "TriggerProviders": { "alias": "TriggerProviders"; "required": false; }; "ExcludedTriggerKeys": { "alias": "ExcludedTriggerKeys"; "required": false; }; "Provider": { "alias": "Provider"; "required": false; }; "autoFocus": { "alias": "autoFocus"; "required": false; }; "enableAttachments": { "alias": "enableAttachments"; "required": false; }; "maxAttachments": { "alias": "maxAttachments"; "required": false; }; "maxAttachmentSizeBytes": { "alias": "maxAttachmentSizeBytes"; "required": false; }; "acceptedFileTypes": { "alias": "acceptedFileTypes"; "required": false; }; }, { "valueChange": "valueChange"; "mentionSelected": "mentionSelected"; "enterPressed": "enterPressed"; "attachmentsChanged": "attachmentsChanged"; "attachmentError": "attachmentError"; "attachmentClicked": "attachmentClicked"; "editorBlurred": "editorBlurred"; }, never, never, false, never>;
293
330
  }
294
331
  //# sourceMappingURL=mention-editor.component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mention-editor.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/mention/mention-editor.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,YAAY,EAEZ,UAAU,EACV,aAAa,EAEb,MAAM,EAEN,iBAAiB,EAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,oBAAoB,EAAqB,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAEL,uBAAuB,EAEvB,iBAAiB,EAElB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;;AAGnE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,4BAA4B;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,0DAA0D;IAC1D,IAAI,EAAE,IAAI,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CAAC,KAAK,EAAE,SAAS,GAAG,IAAI;IAiB9B;;OAEG;IACH,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAYlC;;OAEG;YACW,WAAW;IA4CzB;;OAEG;IACH,OAAO,CAAC,YAAY;IA8BpB;;OAEG;IACH,OAAO,CAAC,cAAc;IAgCtB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IASzB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAa1B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAI5B;;OAEG;IACI,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IASzC;;OAEG;IACI,qBAAqB,IAAI,iBAAiB,EAAE;IAInD;;;OAGG;IACI,qBAAqB,CAAC,QAAQ,EAAE;QACrC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QACnD,SAAS,EAAE,MAAM,CAAC;QAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC/C,GAAG,iBAAiB;IAiBrB;;OAEG;IACI,uBAAuB,IAAI,IAAI;IAMtC;;OAEG;IACI,iBAAiB,CAAC,UAAU,EAAE,iBAAiB,GAAG,IAAI;IAI7D;;OAEG;IACI,cAAc,IAAI,OAAO;IAIhC;;OAEG;IACI,cAAc,IAAI,IAAI;yCAzyClB,sBAAsB;2CAAtB,sBAAsB;CAkzClC"}
1
+ {"version":3,"file":"mention-editor.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/mention/mention-editor.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,YAAY,EAEZ,UAAU,EACV,aAAa,EAEb,MAAM,EAEN,iBAAiB,EAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,oBAAoB,EAAqB,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAEL,uBAAuB,EAEvB,iBAAiB,EAElB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAA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;QACnD,SAAS,EAAE,MAAM,CAAC;QAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC/C,GAAG,iBAAiB;IAiBrB;;OAEG;IACI,uBAAuB,IAAI,IAAI;IAMtC;;OAEG;IACI,iBAAiB,CAAC,UAAU,EAAE,iBAAiB,GAAG,IAAI;IAI7D;;OAEG;IACI,cAAc,IAAI,OAAO;IAIhC;;OAEG;IACI,cAAc,IAAI,IAAI;yCAx9ClB,sBAAsB;2CAAtB,sBAAsB;CAi+ClC"}
@@ -102,6 +102,8 @@ export class MentionEditorComponent {
102
102
  attachmentsChanged = new EventEmitter();
103
103
  attachmentError = new EventEmitter();
104
104
  attachmentClicked = new EventEmitter();
105
+ /** Fires when the contenteditable loses focus (hosts persist drafts on this). */
106
+ editorBlurred = new EventEmitter();
105
107
  // Pending attachments state
106
108
  pendingAttachments = [];
107
109
  isDragOver = false;
@@ -214,6 +216,7 @@ export class MentionEditorComponent {
214
216
  onBlur() {
215
217
  // Call form control touched callback
216
218
  this.onTouched();
219
+ this.editorBlurred.emit();
217
220
  // Close dropdown when editor loses focus
218
221
  // Use setTimeout to allow mousedown events on dropdown to fire first
219
222
  setTimeout(() => {
@@ -416,6 +419,68 @@ export class MentionEditorComponent {
416
419
  /**
417
420
  * Insert a mention chip at the current cursor position
418
421
  */
422
+ /**
423
+ * Programmatically inserts a RESOLVED mention chip (+ a single trailing space) at
424
+ * the END of the editor content and places the caret after it — the exact state a
425
+ * user reaches by typing a trigger and picking from the dropdown. Unlike the
426
+ * dropdown path this needs no active trigger context, so hosts can pre-address a
427
+ * message (e.g. the omnibar's '@agent' flow staging a Sage pill) and leave the
428
+ * user ready to type.
429
+ *
430
+ * @returns false when the editor view isn't mounted yet — callers may retry.
431
+ */
432
+ /** Focuses the editor and places the caret at the very end of its content. */
433
+ FocusCaretAtEnd() {
434
+ const editor = this.editorRef?.nativeElement;
435
+ if (!editor) {
436
+ return false;
437
+ }
438
+ editor.focus();
439
+ const selection = window.getSelection();
440
+ if (selection) {
441
+ const range = document.createRange();
442
+ range.selectNodeContents(editor);
443
+ range.collapse(false);
444
+ selection.removeAllRanges();
445
+ selection.addRange(range);
446
+ }
447
+ return true;
448
+ }
449
+ /** True when keyboard focus currently sits inside this editor. */
450
+ get HasFocus() {
451
+ const editor = this.editorRef?.nativeElement;
452
+ return !!editor && (editor === document.activeElement || editor.contains(document.activeElement));
453
+ }
454
+ InsertMention(suggestion, focus = true) {
455
+ const editor = this.editorRef?.nativeElement;
456
+ if (!editor) {
457
+ return false;
458
+ }
459
+ editor.focus();
460
+ const selection = window.getSelection();
461
+ if (!selection) {
462
+ return false;
463
+ }
464
+ // Caret to the end of the current content, then chip + space + caret-after.
465
+ const range = document.createRange();
466
+ range.selectNodeContents(editor);
467
+ range.collapse(false);
468
+ const chip = this.createMentionChip(suggestion);
469
+ range.insertNode(chip);
470
+ const space = document.createTextNode(' ');
471
+ range.setStartAfter(chip);
472
+ range.collapse(true);
473
+ range.insertNode(space);
474
+ range.setStartAfter(space);
475
+ range.collapse(true);
476
+ selection.removeAllRanges();
477
+ selection.addRange(range);
478
+ if (!focus) {
479
+ editor.blur();
480
+ }
481
+ this.onInput();
482
+ return true;
483
+ }
419
484
  insertMentionChip(suggestion) {
420
485
  const selection = window.getSelection();
421
486
  if (!selection || selection.rangeCount === 0)
@@ -866,13 +931,121 @@ export class MentionEditorComponent {
866
931
  /**
867
932
  * Set editor content from plain text (for programmatic updates)
868
933
  */
934
+ /**
935
+ * Renders a value into the editor, REHYDRATING any serialized mention tokens
936
+ * (the `@{"type":…,"id":…,"name":…}` format produced by
937
+ * {@link getPlainTextWithJsonMentions}) back into real chips — so persisted
938
+ * drafts and any host-written serialized value round-trip losslessly. Plain
939
+ * strings (no tokens) take the fast path.
940
+ */
869
941
  setEditorContent(text) {
870
942
  const editor = this.editorRef?.nativeElement;
871
943
  if (!editor)
872
944
  return;
873
- // For now, just set as plain text
874
- // TODO: Parse @mentions and render as chips
875
- editor.textContent = text;
945
+ const segments = MentionEditorComponent.ParseSerializedMentions(text);
946
+ if (segments.every((seg) => typeof seg === 'string')) {
947
+ editor.textContent = text;
948
+ return;
949
+ }
950
+ editor.textContent = '';
951
+ for (const seg of segments) {
952
+ if (typeof seg === 'string') {
953
+ if (seg.length > 0) {
954
+ editor.appendChild(document.createTextNode(seg));
955
+ }
956
+ }
957
+ else {
958
+ const chip = this.createMentionChip(seg.suggestion);
959
+ if (seg.configId) {
960
+ chip.setAttribute('data-preset-id', seg.configId);
961
+ }
962
+ if (seg.config) {
963
+ chip.setAttribute('data-preset-name', seg.config);
964
+ }
965
+ editor.appendChild(chip);
966
+ }
967
+ }
968
+ }
969
+ /**
970
+ * Splits text containing serialized mention tokens into plain-string segments and
971
+ * parsed mention segments. Token = '@' followed by a JSON object with at least
972
+ * {type,id,name}; brace matching is string-aware so names containing braces or
973
+ * escaped quotes parse correctly. Malformed candidates stay as literal text.
974
+ */
975
+ static ParseSerializedMentions(text) {
976
+ const segments = [];
977
+ let cursor = 0;
978
+ let searchFrom = 0;
979
+ while (true) {
980
+ const start = text.indexOf('@{', searchFrom);
981
+ if (start === -1) {
982
+ break;
983
+ }
984
+ const end = MentionEditorComponent.findJsonEnd(text, start + 1);
985
+ if (end === -1) {
986
+ searchFrom = start + 2;
987
+ continue;
988
+ }
989
+ const candidate = text.substring(start + 1, end + 1);
990
+ let parsed = null;
991
+ try {
992
+ parsed = JSON.parse(candidate);
993
+ }
994
+ catch {
995
+ parsed = null;
996
+ }
997
+ if (!parsed || typeof parsed.type !== 'string' || typeof parsed.id !== 'string' || typeof parsed.name !== 'string') {
998
+ searchFrom = start + 2; // not a mention token — keep scanning past it
999
+ continue;
1000
+ }
1001
+ if (start > cursor) {
1002
+ segments.push(text.substring(cursor, start));
1003
+ }
1004
+ segments.push({
1005
+ suggestion: { type: parsed.type, id: parsed.id, name: parsed.name, displayName: parsed.name },
1006
+ configId: parsed.configId,
1007
+ config: parsed.config,
1008
+ });
1009
+ cursor = end + 1;
1010
+ searchFrom = cursor;
1011
+ }
1012
+ if (cursor < text.length) {
1013
+ segments.push(text.substring(cursor));
1014
+ }
1015
+ if (segments.length === 0) {
1016
+ segments.push(text);
1017
+ }
1018
+ return segments;
1019
+ }
1020
+ /** Index of the matching closing brace for the object starting at `openIndex` ('{'), string-aware. -1 when unbalanced. */
1021
+ static findJsonEnd(text, openIndex) {
1022
+ let depth = 0;
1023
+ let inString = false;
1024
+ for (let i = openIndex; i < text.length; i++) {
1025
+ const ch = text[i];
1026
+ if (inString) {
1027
+ if (ch === '\\') {
1028
+ i++; // skip escaped char
1029
+ }
1030
+ else if (ch === '"') {
1031
+ inString = false;
1032
+ }
1033
+ continue;
1034
+ }
1035
+ if (ch === '"') {
1036
+ inString = true;
1037
+ }
1038
+ else if (ch === '{') {
1039
+ depth++;
1040
+ }
1041
+ else if (ch === '}') {
1042
+ depth--;
1043
+ if (depth === 0) {
1044
+ return i;
1045
+ }
1046
+ }
1047
+ }
1048
+ return -1;
876
1049
  }
877
1050
  // ControlValueAccessor implementation
878
1051
  writeValue(value) {
@@ -1260,7 +1433,7 @@ export class MentionEditorComponent {
1260
1433
  } if (rf & 2) {
1261
1434
  let _t;
1262
1435
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.editorRef = _t.first);
1263
- } }, inputs: { placeholder: "placeholder", disabled: "disabled", currentUser: "currentUser", enableMentions: "enableMentions", TriggerProviders: "TriggerProviders", ExcludedTriggerKeys: "ExcludedTriggerKeys", Provider: "Provider", autoFocus: "autoFocus", enableAttachments: "enableAttachments", maxAttachments: "maxAttachments", maxAttachmentSizeBytes: "maxAttachmentSizeBytes", acceptedFileTypes: "acceptedFileTypes" }, outputs: { valueChange: "valueChange", mentionSelected: "mentionSelected", enterPressed: "enterPressed", attachmentsChanged: "attachmentsChanged", attachmentError: "attachmentError", attachmentClicked: "attachmentClicked" }, standalone: false, features: [i0.ɵɵProvidersFeature([
1436
+ } }, inputs: { placeholder: "placeholder", disabled: "disabled", currentUser: "currentUser", enableMentions: "enableMentions", TriggerProviders: "TriggerProviders", ExcludedTriggerKeys: "ExcludedTriggerKeys", Provider: "Provider", autoFocus: "autoFocus", enableAttachments: "enableAttachments", maxAttachments: "maxAttachments", maxAttachmentSizeBytes: "maxAttachmentSizeBytes", acceptedFileTypes: "acceptedFileTypes" }, outputs: { valueChange: "valueChange", mentionSelected: "mentionSelected", enterPressed: "enterPressed", attachmentsChanged: "attachmentsChanged", attachmentError: "attachmentError", attachmentClicked: "attachmentClicked", editorBlurred: "editorBlurred" }, standalone: false, features: [i0.ɵɵProvidersFeature([
1264
1437
  {
1265
1438
  provide: NG_VALUE_ACCESSOR,
1266
1439
  useExisting: forwardRef(() => MentionEditorComponent),
@@ -1337,6 +1510,8 @@ export class MentionEditorComponent {
1337
1510
  type: Output
1338
1511
  }], attachmentClicked: [{
1339
1512
  type: Output
1513
+ }], editorBlurred: [{
1514
+ type: Output
1340
1515
  }] }); })();
1341
1516
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MentionEditorComponent, { className: "MentionEditorComponent", filePath: "src/lib/components/mention/mention-editor.component.ts", lineNumber: 72 }); })();
1342
1517
  //# sourceMappingURL=mention-editor.component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mention-editor.component.js","sourceRoot":"","sources":["../../../../src/lib/components/mention/mention-editor.component.ts","../../../../src/lib/components/mention/mention-editor.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,MAAM,EACN,YAAY,EACZ,SAAS,EAGT,UAAU,EAIX,MAAM,eAAe,CAAC;AACvB,OAAO,EAAwB,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAGL,gCAAgC,EAGjC,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;;;;;ICRxC,yBAG0B;;;IADxB,AADA,kEAA+B,+BACJ;;;IAI7B,8BAAmC;IACjC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AADA,AADA,sIAAS,aAAS,KAAC,mIACR,qBAAiB,KAAC,uHACrB,YAAQ,KAAC,+HACR,mBAAe,KAAC;YAC1B,iBAAM;YAGP,wFAAkB;YAUlB,wGAA6C;YAW/C,iBAAM;;YApEJ,2CAA8B;YAO9B,cAyBC;YAzBD,4DAyBC;YAMC,cAAkC;;YASpC,eAOC;YAPD,yCAOC;YAGD,cAUC;YAVD,wEAUC;;;iFDGU,sBAAsB;cAblC,SAAS;6BACI,KAAK,YACP,mBAAmB,aAGlB;oBACT;wBACE,OAAO,EAAE,iBAAiB;wBAC1B,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,uBAAuB,CAAC;wBACrD,KAAK,EAAE,IAAI;qBACZ;iBACF;;kBAGA,SAAS;mBAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;;kBAErC,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAEL,KAAK;;kBAML,KAAK;;kBAKL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAGL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAEL,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kFAnCI,sBAAsB","sourcesContent":["import {\n Component,\n Input,\n Output,\n EventEmitter,\n ViewChild,\n ElementRef,\n AfterViewInit,\n forwardRef,\n OnInit,\n ViewEncapsulation,\n ChangeDetectorRef\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport {\n ComposerSuggestionRequest,\n ComposerTriggerProvider,\n DiscoverComposerTriggerProviders,\n MentionSuggestion,\n MentionSuggestionPreset\n} from '../../composer-trigger-provider';\nimport { IMetadataProvider, UserInfo } from '@memberjunction/core';\nimport { UUIDsEqual } from '@memberjunction/global';\n\n/**\n * Represents a pending attachment that hasn't been uploaded yet\n */\nexport interface PendingAttachment {\n /** Local ID for tracking */\n id: string;\n /** Original File object (null for artifact references) */\n file: File | null;\n /** Base64 data URL for display */\n dataUrl: string;\n /** MIME type */\n mimeType: string;\n /** Original filename */\n fileName: string;\n /** File size in bytes */\n sizeBytes: number;\n /** Width in pixels (for images) */\n width?: number;\n /** Height in pixels (for images) */\n height?: number;\n /** Small thumbnail URL for preview */\n thumbnailUrl?: string;\n /** MJStorage File ID (for artifact references, mutually exclusive with inline data) */\n fileID?: string;\n /** Source of the attachment */\n source?: 'upload' | 'artifact';\n /** Artifact Version ID (for artifact references, used to create ConversationDetailArtifact) */\n artifactVersionId?: string;\n}\n\n/**\n * ContentEditable-based mention editor with visual chips/pills\n * Provides Slack/Teams-style mention UX with immutable mention tokens\n */\n@Component({\n standalone: false,\n selector: 'mj-mention-editor',\n templateUrl: './mention-editor.component.html',\n styleUrls: ['./mention-editor.component.css'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MentionEditorComponent),\n multi: true\n }\n ]\n})\nexport class MentionEditorComponent implements OnInit, AfterViewInit, ControlValueAccessor {\n @ViewChild('editor', { static: false }) editorRef!: ElementRef<HTMLDivElement>;\n\n @Input() placeholder: string = 'Type @ to mention agents or users, # for entities...';\n @Input() disabled: boolean = false;\n @Input() currentUser?: UserInfo;\n /** Master switch for all mention/command triggers. When false no providers are consulted. */\n @Input() enableMentions: boolean = true;\n /**\n * Explicit trigger-provider list — when bound, EXACTLY these providers are active\n * (explicit list wins over discovery). Leave null to discover providers registered\n * with the ClassFactory via `@RegisterClass(ComposerTriggerProvider, '<Key>')`.\n */\n @Input() TriggerProviders: ComposerTriggerProvider[] | null = null;\n /**\n * Discovery-mode filter: providers whose stable `Key` appears here are skipped when\n * resolving registered providers. Ignored when `TriggerProviders` is bound.\n */\n @Input() ExcludedTriggerKeys: string[] = [];\n /** Optional metadata provider scoping this editor (multi-provider hosts); passed through to trigger providers. */\n @Input() Provider: IMetadataProvider | null = null;\n /** Auto-focus the editor after view init (the composer default). Disable when embedded in forms. */\n @Input() autoFocus: boolean = true;\n\n // Attachment settings\n @Input() enableAttachments: boolean = true;\n @Input() maxAttachments: number = 10;\n @Input() maxAttachmentSizeBytes: number = 20 * 1024 * 1024; // 20MB default\n @Input() acceptedFileTypes: string = 'image/*'; // MIME types to accept\n\n @Output() valueChange = new EventEmitter<string>();\n @Output() mentionSelected = new EventEmitter<MentionSuggestion>();\n @Output() enterPressed = new EventEmitter<string>();\n @Output() attachmentsChanged = new EventEmitter<PendingAttachment[]>();\n @Output() attachmentError = new EventEmitter<string>();\n @Output() attachmentClicked = new EventEmitter<PendingAttachment>();\n\n // Pending attachments state\n public pendingAttachments: PendingAttachment[] = [];\n public isDragOver: boolean = false;\n\n // Mention dropdown state\n public showMentionDropdown: boolean = false;\n public mentionSuggestions: MentionSuggestion[] = [];\n public mentionDropdownPosition: { top: number; left: number } = { top: 0, left: 0 };\n public mentionDropdownShowAbove: boolean = false;\n\n private mentionStartIndex: number = -1;\n private mentionQuery: string = '';\n /** The trigger char that opened the current mention dropdown */\n private activeTrigger: string = '@';\n /**\n * Monotonic sequence guarding the async suggestion fetch — a response only applies\n * when no newer keystroke (or dropdown close) has superseded it.\n */\n private suggestionRequestSeq: number = 0;\n /** Cap on the suggestions displayed; passed to providers as `MaxResults`. */\n private static readonly MaxSuggestions: number = 50;\n\n /**\n * The trigger providers this editor consults: the explicit `TriggerProviders` list\n * when bound, otherwise ClassFactory discovery filtered by `ExcludedTriggerKeys`.\n * Empty when `enableMentions` is off (or nothing is registered) — the editor then\n * behaves as a plain text editor.\n */\n private get activeProviders(): ComposerTriggerProvider[] {\n if (!this.enableMentions) {\n return [];\n }\n return this.TriggerProviders ?? DiscoverComposerTriggerProviders(this.ExcludedTriggerKeys);\n }\n\n /** Unique trigger characters across the active providers (priority order preserved). */\n private get mentionTriggers(): string[] {\n const triggers: string[] = [];\n for (const provider of this.activeProviders) {\n if (!triggers.includes(provider.TriggerChar)) {\n triggers.push(provider.TriggerChar);\n }\n }\n return triggers;\n }\n\n private onChange: (value: string) => void = () => {};\n public onTouched: () => void = () => {};\n /** Value written via writeValue() before the view (editorRef) exists — applied in ngAfterViewInit. */\n private pendingWriteValue: string | null = null;\n\n constructor(\n private cdr: ChangeDetectorRef\n ) {}\n\n async ngOnInit(): Promise<void> {\n // Warm up the active providers (best-effort — a provider that fails to warm\n // simply serves its first real request cold).\n if (this.enableMentions) {\n const user = this.currentUser ?? null;\n await Promise.all(\n this.activeProviders.map((p) => p.Initialize(user).catch(() => undefined))\n );\n }\n }\n\n ngAfterViewInit(): void {\n // Apply any value written through the ControlValueAccessor before the view existed\n // (NgModel calls writeValue during directive init, before this component's view is ready)\n if (this.pendingWriteValue !== null) {\n this.setEditorContent(this.pendingWriteValue);\n this.pendingWriteValue = null;\n }\n\n // Auto-focus the editor\n if (this.autoFocus) {\n setTimeout(() => {\n this.editorRef?.nativeElement?.focus();\n }, 100);\n }\n }\n\n /**\n * Handle clicks on the container - focus the editor if clicking outside the contentEditable\n */\n onContainerClick(event: MouseEvent): void {\n const target = event.target as HTMLElement;\n const editor = this.editorRef?.nativeElement;\n\n // Don't handle clicks on the dropdown or its children\n if (target.closest('mj-mention-dropdown')) {\n return;\n }\n\n // If clicking on container or any element that's not the editor itself, focus the editor\n if (target !== editor && !editor?.contains(target)) {\n editor?.focus();\n\n // Move cursor to end of content\n const selection = window.getSelection();\n const range = document.createRange();\n\n if (editor && selection) {\n range.selectNodeContents(editor);\n range.collapse(false); // Collapse to end\n selection.removeAllRanges();\n selection.addRange(range);\n }\n }\n }\n\n /**\n * Handle input changes in contentEditable\n */\n onInput(): void {\n const plainText = this.getPlainText();\n this.onChange(plainText);\n this.valueChange.emit(plainText);\n\n // Handle mention/command autocomplete via the active trigger providers\n if (this.enableMentions) {\n this.handleMentionInput();\n }\n }\n\n /**\n * Handle blur event - close dropdown when editor loses focus\n */\n onBlur(): void {\n // Call form control touched callback\n this.onTouched();\n\n // Close dropdown when editor loses focus\n // Use setTimeout to allow mousedown events on dropdown to fire first\n setTimeout(() => {\n if (this.showMentionDropdown) {\n this.closeMentionDropdown();\n }\n }, 200);\n }\n\n /**\n * Handle paste event - images or plain text\n */\n onPaste(event: ClipboardEvent): void {\n // Check for image data in clipboard\n if (this.enableAttachments && event.clipboardData?.items) {\n const items = Array.from(event.clipboardData.items);\n const imageItems = items.filter(item => item.type.startsWith('image/'));\n\n if (imageItems.length > 0) {\n event.preventDefault();\n\n // Process each image\n for (const item of imageItems) {\n const file = item.getAsFile();\n if (file) {\n this.processFile(file);\n }\n }\n return;\n }\n }\n\n // No images - handle as plain text\n event.preventDefault();\n\n // Get plain text from clipboard\n const text = event.clipboardData?.getData('text/plain') || '';\n\n if (!text) return;\n\n // Insert plain text at cursor position\n const selection = window.getSelection();\n if (!selection || selection.rangeCount === 0) return;\n\n const range = selection.getRangeAt(0);\n range.deleteContents();\n\n // Insert text as text node (not HTML)\n const textNode = document.createTextNode(text);\n range.insertNode(textNode);\n\n // Move cursor to end of inserted text\n range.setStartAfter(textNode);\n range.collapse(true);\n selection.removeAllRanges();\n selection.addRange(range);\n\n // Trigger input event to update model\n this.onInput();\n }\n\n /**\n * Handle keydown events\n */\n onKeyDown(event: KeyboardEvent): void {\n // Enter alone: Send message (if dropdown not showing)\n if (event.key === 'Enter' && !event.shiftKey && !this.showMentionDropdown) {\n event.preventDefault();\n const plainText = this.getPlainText();\n this.enterPressed.emit(plainText);\n return;\n }\n\n // Backspace: Check if deleting a mention chip\n if (event.key === 'Backspace') {\n this.handleBackspace(event);\n }\n\n // Handle mention dropdown navigation\n if (this.showMentionDropdown) {\n // Let the dropdown handle arrow keys, enter, escape\n // (We'll pass these through to mention-dropdown component)\n }\n }\n\n /**\n * Handle mention/command trigger detection — finds the nearest active trigger char\n * before the cursor and kicks off the (async) provider suggestion fetch.\n */\n private handleMentionInput(): void {\n const selection = window.getSelection();\n if (!selection || selection.rangeCount === 0) return;\n\n const activeTriggers = this.mentionTriggers;\n if (activeTriggers.length === 0) {\n this.closeMentionDropdown();\n return;\n }\n\n const range = selection.getRangeAt(0);\n const textBeforeCursor = this.getTextBeforeCursor(range);\n\n // Find the nearest active trigger char before the cursor — whichever is closest wins\n let triggerIndex = -1;\n let triggerChar = '@';\n for (const t of activeTriggers) {\n const idx = textBeforeCursor.lastIndexOf(t);\n if (idx > triggerIndex) {\n triggerIndex = idx;\n triggerChar = t;\n }\n }\n\n if (triggerIndex === -1) {\n this.closeMentionDropdown();\n return;\n }\n\n // Check if there's a space between the trigger and cursor (means mention was completed)\n const textAfterTrigger = textBeforeCursor.substring(triggerIndex + 1);\n if (textAfterTrigger.includes(' ')) {\n this.closeMentionDropdown();\n return;\n }\n\n // Extract query\n this.mentionQuery = textAfterTrigger;\n this.mentionStartIndex = triggerIndex;\n this.activeTrigger = triggerChar;\n\n // Fetch suggestions from the provider(s) owning this trigger (async, race-guarded)\n void this.fetchSuggestions(triggerChar, textAfterTrigger);\n }\n\n /**\n * Routes the suggestion request to every active provider whose TriggerChar matches,\n * concatenates their results in priority order, caps the merged list, and opens the\n * dropdown. A monotonic sequence drops stale responses when the user keeps typing.\n */\n private async fetchSuggestions(triggerChar: string, query: string): Promise<void> {\n const seq = ++this.suggestionRequestSeq;\n const providers = this.activeProviders.filter((p) => p.TriggerChar === triggerChar);\n\n const request: ComposerSuggestionRequest = {\n Query: query,\n MaxResults: MentionEditorComponent.MaxSuggestions,\n ContextUser: this.currentUser ?? null,\n Provider: this.Provider\n };\n\n const resultSets = await Promise.all(\n providers.map((p) => p.GetSuggestions(request).catch(() => [] as MentionSuggestion[]))\n );\n\n if (seq !== this.suggestionRequestSeq) {\n return; // superseded by a newer keystroke or an explicit close\n }\n\n const merged = resultSets.flat().slice(0, MentionEditorComponent.MaxSuggestions);\n this.mentionSuggestions = merged;\n\n if (merged.length > 0) {\n this.showMentionDropdown = true;\n this.positionMentionDropdown();\n } else {\n this.closeMentionDropdown();\n }\n this.cdr.detectChanges();\n }\n\n /**\n * Get text before cursor position\n */\n private getTextBeforeCursor(range: Range): string {\n const tempRange = range.cloneRange();\n tempRange.selectNodeContents(this.editorRef.nativeElement);\n tempRange.setEnd(range.startContainer, range.startOffset);\n return tempRange.toString();\n }\n\n /**\n * Position the mention dropdown\n */\n private positionMentionDropdown(): void {\n const editor = this.editorRef?.nativeElement;\n if (!editor) return;\n\n // Get the parent container (message-input-box-container) for alignment\n const container = editor.closest('.message-input-box-container');\n const containerRect = container?.getBoundingClientRect();\n\n const selection = window.getSelection();\n if (!selection || selection.rangeCount === 0) return;\n\n const range = selection.getRangeAt(0);\n const cursorRect = range.getBoundingClientRect();\n\n // Check space below vs above\n const spaceBelow = window.innerHeight - cursorRect.bottom;\n const spaceAbove = cursorRect.top;\n const dropdownHeight = Math.min(this.mentionSuggestions.length * 56, 300);\n\n this.mentionDropdownShowAbove = spaceBelow < dropdownHeight && spaceAbove > spaceBelow;\n\n if (this.mentionDropdownShowAbove) {\n // Position above, aligning with container top if possible\n this.mentionDropdownPosition = {\n top: containerRect ? containerRect.top + window.scrollY : cursorRect.top + window.scrollY - 4,\n left: cursorRect.left + window.scrollX\n };\n } else {\n // Position below cursor, but align bottom edge with container top\n this.mentionDropdownPosition = {\n top: containerRect ? containerRect.top + window.scrollY : cursorRect.bottom + window.scrollY + 4,\n left: cursorRect.left + window.scrollX\n };\n }\n }\n\n /**\n * Handle mention selection from dropdown\n */\n onMentionSelected(suggestion: MentionSuggestion): void {\n this.insertMentionChip(suggestion);\n this.closeMentionDropdown();\n this.mentionSelected.emit(suggestion);\n\n // Refocus the editor after selection\n setTimeout(() => {\n this.editorRef?.nativeElement?.focus();\n }, 50);\n }\n\n /**\n * Insert a mention chip at the current cursor position\n */\n private insertMentionChip(suggestion: MentionSuggestion): void {\n const selection = window.getSelection();\n if (!selection || selection.rangeCount === 0) return;\n\n const range = selection.getRangeAt(0);\n\n // Delete the trigger + query text (use the active trigger char)\n const textBeforeCursor = this.getTextBeforeCursor(range);\n const lastAtIndex = textBeforeCursor.lastIndexOf(this.activeTrigger);\n const deleteLength = textBeforeCursor.length - lastAtIndex;\n\n range.setStart(range.startContainer, range.startOffset - deleteLength);\n range.deleteContents();\n\n // Create mention chip element\n const chip = this.createMentionChip(suggestion);\n\n // Insert chip\n range.insertNode(chip);\n\n // Add space after chip\n const space = document.createTextNode(' ');\n range.collapse(false);\n range.insertNode(space);\n\n // Move cursor after the space\n range.setStartAfter(space);\n range.collapse(true);\n selection.removeAllRanges();\n selection.addRange(range);\n\n // Trigger change detection\n this.onInput();\n }\n\n /**\n * Create a mention chip DOM element\n */\n private createMentionChip(suggestion: MentionSuggestion): HTMLSpanElement {\n const chip = document.createElement('span');\n chip.className = 'mention-chip';\n chip.contentEditable = 'false'; // Make chip non-editable\n chip.setAttribute('data-mention-id', suggestion.id);\n chip.setAttribute('data-mention-type', suggestion.type);\n chip.setAttribute('data-mention-name', suggestion.name);\n\n // Configuration presets ride along on the suggestion itself (supplied by the trigger\n // provider — e.g. the agent-mentions provider maps AI Agent Configuration presets in).\n // The composer has no knowledge of what a preset IS; it just stores the default's\n // ID/Name on the chip and offers a picker when there are 2+.\n const presets: MentionSuggestionPreset[] = suggestion.presets ?? [];\n if (presets.length > 0) {\n const defaultPreset = presets.find(p => p.IsDefault) || presets[0];\n if (defaultPreset) {\n chip.setAttribute('data-preset-id', defaultPreset.ID || '');\n chip.setAttribute('data-preset-name', defaultPreset.Name || '');\n }\n }\n\n // Apply inline styles directly — color by mention type. Skills carry their own accent Color\n // (AISkill.Color UX metadata); when present it drives the chip, otherwise the standard skill\n // green (--mj-status-success). Same color logic as the saved-message badge — keep in sync with\n // message-item's renderMentionHTML.\n const skillPalette = suggestion.type === 'skill'\n ? { bg: suggestion.color || 'var(--mj-status-success)', border: 'rgba(255, 255, 255, 0.35)' }\n : null;\n const palette =\n skillPalette\n ? skillPalette\n : suggestion.type === 'user'\n ? { bg: 'linear-gradient(135deg, #f093fb 0%, #f5576c 100%)', border: 'rgba(240, 147, 251, 0.4)' }\n : suggestion.type === 'entity'\n ? { bg: 'linear-gradient(135deg, #11998e 0%, #38ef7d 100%)', border: 'rgba(17, 153, 142, 0.4)' }\n : suggestion.type === 'query'\n ? { bg: 'linear-gradient(135deg, #FF6A00 0%, #FF9E2C 100%)', border: 'rgba(255, 106, 0, 0.4)' }\n : { bg: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)', border: 'rgba(102, 126, 234, 0.4)' };\n // Skills render as a sharp-cornered rectangle (vs. the rounded pill for agents/users/entities)\n // — the shape is the at-a-glance differentiator. Same shape in the saved-message badge.\n const chipRadius = suggestion.type === 'skill' ? '4px' : '16px';\n chip.style.cssText = `\n display: inline-flex;\n align-items: center;\n gap: 5px;\n padding: 4px 12px;\n margin: 0 3px;\n border-radius: ${chipRadius};\n font-size: 13px;\n font-weight: 600;\n cursor: default;\n user-select: none;\n vertical-align: middle;\n white-space: nowrap;\n pointer-events: all;\n background: ${palette.bg};\n color: white;\n border: 2px solid ${palette.border};\n box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.1);\n `;\n\n // Add icon or image\n if (suggestion.type === 'agent' && suggestion.imageUrl) {\n // Use image if available (LogoURL from agent)\n const img = document.createElement('img');\n img.src = suggestion.imageUrl;\n img.alt = suggestion.displayName;\n img.style.cssText = 'width: 16px; height: 16px; border-radius: 50%; object-fit: cover;';\n chip.appendChild(img);\n } else if (suggestion.type === 'agent' && suggestion.icon === 'mj-icon-skip') {\n // Special handling for mj-icon-skip: use the SVG data URI as an image\n const img = document.createElement('img');\n img.src = \"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 101.89918457031249 96.83947368421053'%3E%3Cg transform='translate(-0.1288232421875,-0.0)'%3E%3Cpath d='M93.85,41.56c-.84,0-1.62.2-2.37.55-3-4.35-7.49-8.12-13.04-11.04l.04-7.18v-14.44h-10.24v17.6c-1.52-.43-3.07-.8-4.67-1.11V0h-10.24v24.72s-.09,0-.14,0h-4.38s-.1,0-.14,0V7.3h-10.24v18.62c-1.6.32-3.15.69-4.67,1.11v-11.67h-10.24v6.09l.04,9.6c-5.55,2.92-10.04,6.7-13.04,11.04-.75-.35-1.53-.55-2.37-.55-4.5,0-8.14,5.61-8.14,12.51s3.64,12.53,8.14,12.53c.58,0,1.14-.12,1.67-.29,4.1,6.62,11.54,12.06,20.98,15.28l.79.13v7.05c0,2.97,1.45,5.58,3.87,6.99,1.18.69,2.5,1.04,3.85,1.03,1.4,0,2.83-.37,4.15-1.12l7.54-4.29,7.56,4.3c1.31.74,2.73,1.12,4.13,1.12s2.67-.35,3.85-1.04c2.42-1.41,3.86-4.02,3.86-6.98v-7.05l.79-.13c9.44-3.22,16.89-8.66,20.98-15.28.54.17,1.09.29,1.68.29,4.5,0,8.14-5.61,8.14-12.53s-3.63-12.51-8.14-12.51' fill='%23AAAAAA'/%3E%3Cpath d='M86.69,50.87c0-12.22-13.6-19.1-28.94-20.66-4.48-.47-9.19-.54-13.52,0-15.34,1.53-28.93,8.41-28.93,20.66,0,8.55,5.7,15.55,12.68,15.55h7.94c3.05,2.5,6.93,4.1,11.08,4.71,2.65.4,5.44.46,8.01,0,4.15-.6,8.05-2.2,11.1-4.71h7.92c6.97,0,12.68-7,12.68-15.55' fill='white' opacity='0.9'/%3E%3Cpath d='M57.83,55.82c-1.19,2.58-3.8,4.35-6.84,4.35s-5.65-1.77-6.84-4.35h13.68Z' fill='%23AAAAAA'/%3E%3Cpath d='M32.52,41.14c1.74,0,3.18,2.13,3.18,4.76s-1.44,4.74-3.18,4.74-3.16-2.13-3.16-4.74,1.41-4.76,3.16-4.76' fill='%23AAAAAA'/%3E%3Cpath d='M69.46,41.14c1.74,0,3.16,2.13,3.16,4.76s-1.41,4.74-3.16,4.74-3.18-2.13-3.18-4.74,1.41-4.76,3.18-4.76' fill='%23AAAAAA'/%3E%3Cpath d='M63.91,76.15c-.82-.48-1.84-.43-2.8.12l-10.13,5.75-10.11-5.75c-.96-.55-1.98-.59-2.8-.12-.82.47-1.29,1.38-1.29,2.49v10.12c0,1.11.47,2.02,1.28,2.49.38.22.8.33,1.24.33.51,0,1.05-.15,1.57-.44l10.12-5.75,10.11,5.75c.52.29,1.05.44,1.56.44.44,0,.86-.11,1.24-.33.81-.48,1.28-1.38,1.28-2.49v-10.12c0-1.11-.47-2.02-1.28-2.49' fill='white' opacity='0.9'/%3E%3C/g%3E%3C/svg%3E\";\n img.alt = suggestion.displayName;\n img.style.cssText = 'width: 16px; height: 16px; border-radius: 50%; object-fit: cover;';\n chip.appendChild(img);\n } else {\n // Use icon for users or agents without images\n const icon = document.createElement('i');\n icon.style.cssText = 'font-size: 12px; opacity: 0.95;';\n if (suggestion.type === 'agent' && suggestion.icon) {\n icon.className = this.getIconClasses(suggestion.icon);\n } else if (suggestion.type === 'user') {\n icon.className = 'fa-solid fa-user';\n } else if (suggestion.type === 'entity') {\n icon.className = this.getIconClasses(suggestion.icon || 'fa-solid fa-table');\n } else if (suggestion.type === 'query') {\n icon.className = this.getIconClasses(suggestion.icon || 'fa-solid fa-database');\n } else if (suggestion.type === 'skill') {\n icon.className = this.getIconClasses(suggestion.icon || 'fa-solid fa-wand-magic-sparkles');\n } else {\n icon.className = 'fa-solid fa-robot';\n }\n chip.appendChild(icon);\n }\n\n // Add space between icon/image and text\n const space = document.createTextNode(' ');\n chip.appendChild(space);\n\n // Add text\n const text = document.createTextNode(suggestion.displayName);\n chip.appendChild(text);\n\n // Add dropdown when the suggestion carries 2+ presets\n if (presets.length >= 2) {\n this.addConfigurationDropdown(chip, presets);\n }\n\n return chip;\n }\n\n /**\n * Add configuration preset dropdown to a mention chip\n */\n private addConfigurationDropdown(chip: HTMLSpanElement, presets: MentionSuggestionPreset[]): void {\n // Store default preset for comparison\n const defaultPreset = presets.find(p => p.IsDefault) || presets[0];\n\n // Add preset indicator text (only shown when non-default selected)\n const presetIndicator = document.createElement('span');\n presetIndicator.className = 'preset-indicator';\n presetIndicator.style.cssText = `\n display: none;\n font-size: 10px;\n font-weight: 600;\n font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Courier New', monospace;\n background: rgba(255, 255, 255, 0.25);\n padding: 2px 6px;\n border-radius: 4px;\n margin-left: 4px;\n letter-spacing: 0.3px;\n text-transform: uppercase;\n border: 1px solid rgba(255, 255, 255, 0.15);\n `;\n chip.appendChild(presetIndicator);\n\n // Add dropdown chevron button\n const chevron = document.createElement('i');\n chevron.className = 'fa-solid fa-chevron-down';\n chevron.style.cssText = `\n font-size: 10px;\n opacity: 0.9;\n cursor: pointer;\n padding: 2px;\n `;\n chip.appendChild(chevron);\n\n // Create dropdown menu (initially hidden) - append to body for global positioning\n const dropdown = document.createElement('div');\n dropdown.className = 'preset-dropdown';\n dropdown.style.cssText = `\n display: none;\n position: fixed;\n background: white;\n border: 1px solid #ddd;\n border-radius: 8px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n min-width: 200px;\n max-width: 300px;\n z-index: 10000;\n overflow: hidden;\n `;\n\n // Add preset options to dropdown\n presets.forEach(preset => {\n const option = document.createElement('div');\n option.className = 'preset-option';\n option.style.cssText = `\n padding: 10px 12px;\n cursor: pointer;\n display: flex;\n align-items: center;\n gap: 8px;\n transition: background 0.2s;\n `;\n\n // Check if this is the selected preset\n const currentPresetId = chip.getAttribute('data-preset-id');\n const isSelected = UUIDsEqual(preset.ID, currentPresetId);\n\n // Add checkmark for selected option\n const checkmark = document.createElement('i');\n checkmark.className = 'fa-solid fa-check';\n checkmark.style.cssText = `\n font-size: 12px;\n color: #667eea;\n opacity: ${isSelected ? '1' : '0'};\n width: 14px;\n `;\n option.appendChild(checkmark);\n\n // Add preset text content\n const textContainer = document.createElement('div');\n textContainer.style.cssText = 'flex: 1;';\n\n const displayName = document.createElement('div');\n displayName.textContent = preset.DisplayName || preset.Name;\n displayName.style.cssText = `\n font-weight: 600;\n color: #333;\n font-size: 13px;\n `;\n textContainer.appendChild(displayName);\n\n if (preset.Description) {\n const description = document.createElement('div');\n description.textContent = preset.Description;\n description.style.cssText = `\n font-size: 11px;\n color: #666;\n margin-top: 2px;\n `;\n textContainer.appendChild(description);\n }\n\n option.appendChild(textContainer);\n\n // Hover effects\n option.addEventListener('mouseenter', () => {\n option.style.background = '#f5f5f5';\n });\n option.addEventListener('mouseleave', () => {\n option.style.background = 'white';\n });\n\n // Click handler to select preset\n option.addEventListener('click', (e) => {\n e.stopPropagation();\n\n // Update chip data attributes\n // IMPORTANT: Store preset.ID (AIAgentConfiguration.ID), not AIConfigurationID\n chip.setAttribute('data-preset-id', preset.ID || '');\n chip.setAttribute('data-preset-name', preset.Name || '');\n\n // Update preset indicator visibility and text\n const isDefault = UUIDsEqual(preset.ID, defaultPreset.ID);\n if (isDefault) {\n presetIndicator.style.display = 'none';\n } else {\n presetIndicator.style.display = 'inline';\n presetIndicator.textContent = preset.DisplayName || preset.Name;\n }\n\n // Update checkmarks\n dropdown.querySelectorAll('.preset-option').forEach((opt, idx) => {\n const check = opt.querySelector('i.fa-check') as HTMLElement;\n if (check) {\n check.style.opacity = idx === presets.indexOf(preset) ? '1' : '0';\n }\n });\n\n // Close dropdown\n dropdown.style.display = 'none';\n });\n\n dropdown.appendChild(option);\n });\n\n // Append dropdown to document body for global positioning\n document.body.appendChild(dropdown);\n\n // Helper function to position dropdown relative to chip\n const positionDropdown = () => {\n const chipRect = chip.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n const spaceBelow = viewportHeight - chipRect.bottom;\n\n // Set left position (same for both above/below)\n dropdown.style.left = `${chipRect.left}px`;\n\n // First, show dropdown to measure its actual height\n const wasHidden = dropdown.style.display === 'none';\n if (wasHidden) {\n dropdown.style.visibility = 'hidden';\n dropdown.style.display = 'block';\n }\n\n const dropdownHeight = dropdown.offsetHeight;\n const spaceAbove = chipRect.top;\n\n // Position dropdown above chip if not enough space below\n if (spaceBelow < dropdownHeight && spaceAbove > spaceBelow) {\n // Show above - position so bottom of dropdown is 4px above top of chip\n dropdown.style.top = `${chipRect.top - dropdownHeight - 4}px`;\n } else {\n // Show below (default) - position 4px below bottom of chip\n dropdown.style.top = `${chipRect.bottom + 4}px`;\n }\n\n // Restore visibility\n if (wasHidden) {\n dropdown.style.visibility = 'visible';\n }\n };\n\n // Toggle dropdown on chevron click\n chevron.addEventListener('click', (e) => {\n e.stopPropagation();\n const isVisible = dropdown.style.display === 'block';\n\n if (isVisible) {\n dropdown.style.display = 'none';\n } else {\n positionDropdown();\n dropdown.style.display = 'block';\n }\n });\n\n // Close dropdown when clicking outside\n const closeDropdown = (e: MouseEvent) => {\n if (!dropdown.contains(e.target as Node) && !chip.contains(e.target as Node)) {\n dropdown.style.display = 'none';\n }\n };\n document.addEventListener('click', closeDropdown);\n\n // Cleanup: remove dropdown from body and event listeners when chip is removed\n const observer = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n mutation.removedNodes.forEach((node) => {\n if (node === chip) {\n document.removeEventListener('click', closeDropdown);\n if (dropdown.parentNode) {\n dropdown.parentNode.removeChild(dropdown);\n }\n observer.disconnect();\n }\n });\n });\n });\n if (chip.parentNode) {\n observer.observe(chip.parentNode, { childList: true });\n }\n }\n\n /**\n * Get icon classes with proper FA prefix\n */\n private getIconClasses(iconClass: string): string {\n if (!iconClass) return 'fa-solid fa-robot';\n if (iconClass.includes('fa-')) {\n if (iconClass.match(/\\b(fa-solid|fa-regular|fa-light|fa-brands)\\b/)) {\n return iconClass;\n }\n return `fa-solid ${iconClass}`;\n }\n return iconClass;\n }\n\n /**\n * Handle backspace key - delete entire chip if cursor is right after one\n */\n private handleBackspace(event: KeyboardEvent): void {\n const selection = window.getSelection();\n if (!selection || selection.rangeCount === 0) return;\n\n const range = selection.getRangeAt(0);\n\n // Check if cursor is right after a mention chip\n if (range.collapsed && range.startOffset > 0) {\n const prevNode = range.startContainer.childNodes[range.startOffset - 1];\n\n if (prevNode && (prevNode as HTMLElement).classList?.contains('mention-chip')) {\n event.preventDefault();\n prevNode.remove();\n this.onInput();\n }\n }\n }\n\n /**\n * Close mention dropdown\n */\n closeMentionDropdown(): void {\n // Invalidate any in-flight suggestion fetch so a late response can't reopen the dropdown\n this.suggestionRequestSeq++;\n this.showMentionDropdown = false;\n this.mentionSuggestions = [];\n this.mentionStartIndex = -1;\n this.mentionQuery = '';\n this.activeTrigger = '@';\n }\n\n /**\n * Convert editor HTML to plain text with @mentions\n */\n private getPlainText(): string {\n const editor = this.editorRef?.nativeElement;\n if (!editor) return '';\n\n let text = '';\n const nodes = editor.childNodes;\n\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n\n if (node.nodeType === Node.TEXT_NODE) {\n text += node.textContent || '';\n } else if (node.nodeType === Node.ELEMENT_NODE) {\n const element = node as HTMLElement;\n\n if (element.classList.contains('mention-chip')) {\n const name = element.getAttribute('data-mention-name') || '';\n const mentionType = element.getAttribute('data-mention-type');\n const prefix = mentionType === 'entity' || mentionType === 'query' ? '#' : mentionType === 'skill' ? '/' : '@';\n // Use quoted format if name has spaces\n text += name.includes(' ') ? `${prefix}\"${name}\"` : `${prefix}${name}`;\n } else if (element.tagName === 'BR') {\n text += '\\n';\n } else if (element.tagName === 'DIV') {\n // Handle line breaks from contentEditable\n if (i > 0) text += '\\n';\n text += this.getNodeText(element);\n } else {\n text += element.textContent || '';\n }\n }\n }\n\n return text;\n }\n\n /**\n * Get text from a node recursively\n */\n private getNodeText(node: Node): string {\n let text = '';\n const children = node.childNodes;\n\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n\n if (child.nodeType === Node.TEXT_NODE) {\n text += child.textContent || '';\n } else if (child.nodeType === Node.ELEMENT_NODE) {\n const element = child as HTMLElement;\n\n if (element.classList.contains('mention-chip')) {\n const name = element.getAttribute('data-mention-name') || '';\n const mentionType = element.getAttribute('data-mention-type');\n const prefix = mentionType === 'entity' || mentionType === 'query' ? '#' : mentionType === 'skill' ? '/' : '@';\n text += name.includes(' ') ? `${prefix}\"${name}\"` : `${prefix}${name}`;\n } else {\n text += this.getNodeText(element);\n }\n }\n }\n\n return text;\n }\n\n /**\n * Set editor content from plain text (for programmatic updates)\n */\n private setEditorContent(text: string): void {\n const editor = this.editorRef?.nativeElement;\n if (!editor) return;\n\n // For now, just set as plain text\n // TODO: Parse @mentions and render as chips\n editor.textContent = text;\n }\n\n // ControlValueAccessor implementation\n writeValue(value: string): void {\n const editor = this.editorRef?.nativeElement;\n if (!editor) {\n // View not created yet — buffer the value; ngAfterViewInit applies it\n this.pendingWriteValue = value ?? '';\n return;\n }\n if (value) {\n this.setEditorContent(value);\n } else {\n editor.textContent = '';\n }\n }\n\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n if (this.editorRef?.nativeElement) {\n this.editorRef.nativeElement.contentEditable = (!isDisabled).toString();\n }\n }\n\n /**\n * Focus the editor\n */\n public focus(): void {\n this.editorRef?.nativeElement?.focus();\n }\n\n /**\n * Clear the editor content and pending attachments\n */\n public clear(): void {\n if (this.editorRef?.nativeElement) {\n this.editorRef.nativeElement.textContent = '';\n this.onInput();\n }\n this.clearPendingAttachments();\n }\n\n /**\n * Extract mention chips with their configuration data\n * Returns array of objects containing mention info and preset configuration\n */\n public getMentionChipsData(): Array<{ id: string; type: string; name: string; presetId?: string; presetName?: string }> {\n const editor = this.editorRef?.nativeElement;\n if (!editor) return [];\n\n const chips: Array<{ id: string; type: string; name: string; presetId?: string; presetName?: string }> = [];\n const mentionElements = editor.querySelectorAll('.mention-chip');\n\n mentionElements.forEach(chip => {\n const element = chip as HTMLElement;\n const id = element.getAttribute('data-mention-id') || '';\n const type = element.getAttribute('data-mention-type') || '';\n const name = element.getAttribute('data-mention-name') || '';\n const presetId = element.getAttribute('data-preset-id') || undefined;\n const presetName = element.getAttribute('data-preset-name') || undefined;\n\n chips.push({\n id,\n type,\n name,\n ...(presetId ? { presetId } : {}),\n ...(presetName ? { presetName } : {})\n });\n });\n\n return chips;\n }\n\n /**\n * Get the plain text value with mentions encoded as JSON\n * This format preserves configuration information when messages are saved\n * Format: @{type:\"agent\",id:\"uuid\",name:\"Agent Name\",configId:\"uuid\",config:\"High\"}\n */\n public getPlainTextWithJsonMentions(): string {\n const editor = this.editorRef?.nativeElement;\n if (!editor) return '';\n\n let plainText = '';\n const childNodes = Array.from(editor.childNodes);\n\n for (const node of childNodes) {\n if (node.nodeType === Node.TEXT_NODE) {\n // Regular text node\n plainText += node.textContent || '';\n } else if (node.nodeType === Node.ELEMENT_NODE) {\n const element = node as HTMLElement;\n\n if (element.classList.contains('mention-chip')) {\n // Extract mention data attributes\n const type = element.getAttribute('data-mention-type') || '';\n const id = element.getAttribute('data-mention-id') || '';\n const name = element.getAttribute('data-mention-name') || '';\n const presetId = element.getAttribute('data-preset-id');\n const presetName = element.getAttribute('data-preset-name');\n\n // Build JSON mention object (compact format - no spaces)\n const mentionObj: Record<string, string> = {\n type,\n id,\n name\n };\n\n // Add configuration fields if present (for agents with non-default presets)\n if (presetId) {\n mentionObj.configId = presetId;\n }\n if (presetName) {\n mentionObj.config = presetName;\n }\n\n // Encode as JSON mention\n // Don't remove spaces from the JSON string - spaces in values (like agent names) need to be preserved\n plainText += `@${JSON.stringify(mentionObj)}`;\n } else {\n // Other HTML element (e.g., <br>)\n if (element.tagName === 'BR') {\n plainText += '\\n';\n } else {\n plainText += element.textContent || '';\n }\n }\n }\n }\n\n return plainText;\n }\n\n // ==================== Attachment Handling Methods ====================\n\n /**\n * Handle drag over event\n */\n onDragOver(event: DragEvent): void {\n if (!this.enableAttachments) return;\n\n event.preventDefault();\n event.stopPropagation();\n this.isDragOver = true;\n }\n\n /**\n * Handle drag leave event\n */\n onDragLeave(event: DragEvent): void {\n event.preventDefault();\n event.stopPropagation();\n this.isDragOver = false;\n }\n\n /**\n * Handle drop event\n */\n onDrop(event: DragEvent): void {\n if (!this.enableAttachments) return;\n\n event.preventDefault();\n event.stopPropagation();\n this.isDragOver = false;\n\n if (event.dataTransfer?.files) {\n const files = Array.from(event.dataTransfer.files);\n for (const file of files) {\n if (this.isAcceptedFile(file)) {\n this.processFile(file);\n }\n }\n }\n }\n\n /**\n * Handle file input change (from file picker)\n */\n onFileSelected(event: Event): void {\n const input = event.target as HTMLInputElement;\n if (input.files) {\n const files = Array.from(input.files);\n for (const file of files) {\n this.processFile(file);\n }\n // Reset input so same file can be selected again\n input.value = '';\n }\n }\n\n /**\n * Process a file for attachment\n */\n private async processFile(file: File): Promise<void> {\n // Validate file\n const validation = this.validateFile(file);\n if (!validation.valid) {\n this.attachmentError.emit(validation.error!);\n return;\n }\n\n // Read file as data URL\n const dataUrl = await this.readFileAsDataUrl(file);\n if (!dataUrl) {\n this.attachmentError.emit('Failed to read file');\n return;\n }\n\n // Get image dimensions if applicable\n let width: number | undefined;\n let height: number | undefined;\n\n if (file.type.startsWith('image/')) {\n const dimensions = await this.getImageDimensions(dataUrl);\n width = dimensions.width;\n height = dimensions.height;\n }\n\n // Create pending attachment\n const attachment: PendingAttachment = {\n id: this.generateAttachmentId(),\n file,\n dataUrl,\n mimeType: file.type,\n fileName: file.name,\n sizeBytes: file.size,\n width,\n height,\n thumbnailUrl: file.type.startsWith('image/') ? dataUrl : undefined\n };\n\n // Add to pending attachments\n this.pendingAttachments.push(attachment);\n this.attachmentsChanged.emit([...this.pendingAttachments]);\n this.cdr.detectChanges();\n }\n\n /**\n * Validate a file against settings\n */\n private validateFile(file: File): { valid: boolean; error?: string } {\n // Check count limit\n if (this.pendingAttachments.length >= this.maxAttachments) {\n return {\n valid: false,\n error: `Maximum ${this.maxAttachments} attachments allowed`\n };\n }\n\n // Check size limit\n if (file.size > this.maxAttachmentSizeBytes) {\n const maxMB = (this.maxAttachmentSizeBytes / (1024 * 1024)).toFixed(1);\n const fileMB = (file.size / (1024 * 1024)).toFixed(1);\n return {\n valid: false,\n error: `File size (${fileMB}MB) exceeds maximum (${maxMB}MB)`\n };\n }\n\n // Check file type\n if (!this.isAcceptedFile(file)) {\n return {\n valid: false,\n error: `File type ${file.type || 'unknown'} not accepted`\n };\n }\n\n return { valid: true };\n }\n\n /**\n * Check if file type is accepted\n */\n private isAcceptedFile(file: File): boolean {\n if (this.acceptedFileTypes === '*' || this.acceptedFileTypes === '*/*') {\n return true;\n }\n\n const acceptedTypes = this.acceptedFileTypes.split(',').map(t => t.trim());\n\n for (const accepted of acceptedTypes) {\n // Handle universal wildcard */* anywhere in the list\n if (accepted === '*/*') {\n return true;\n }\n // Handle wildcard MIME types like \"image/*\"\n if (accepted.endsWith('/*')) {\n const category = accepted.slice(0, -2);\n if (file.type.startsWith(category + '/')) {\n return true;\n }\n } else if (accepted.startsWith('.')) {\n // Handle file extensions like \".png\"\n if (file.name.toLowerCase().endsWith(accepted.toLowerCase())) {\n return true;\n }\n } else if (file.type === accepted) {\n // Exact MIME type match\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * Read file as data URL\n */\n private readFileAsDataUrl(file: File): Promise<string | null> {\n return new Promise((resolve) => {\n const reader = new FileReader();\n reader.onload = () => resolve(reader.result as string);\n reader.onerror = () => resolve(null);\n reader.readAsDataURL(file);\n });\n }\n\n /**\n * Get image dimensions\n */\n private getImageDimensions(dataUrl: string): Promise<{ width: number; height: number }> {\n return new Promise((resolve) => {\n const img = new Image();\n img.onload = () => {\n resolve({ width: img.naturalWidth, height: img.naturalHeight });\n };\n img.onerror = () => {\n resolve({ width: 0, height: 0 });\n };\n img.src = dataUrl;\n });\n }\n\n /**\n * Generate unique attachment ID\n */\n private generateAttachmentId(): string {\n return `att_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;\n }\n\n /**\n * Remove a pending attachment by ID\n */\n public removeAttachment(id: string): void {\n const index = this.pendingAttachments.findIndex(a => a.id === id);\n if (index !== -1) {\n this.pendingAttachments.splice(index, 1);\n this.attachmentsChanged.emit([...this.pendingAttachments]);\n this.cdr.detectChanges();\n }\n }\n\n /**\n * Get all pending attachments\n */\n public getPendingAttachments(): PendingAttachment[] {\n return [...this.pendingAttachments];\n }\n\n /**\n * Add an artifact as a pending attachment programmatically.\n * Used by the artifact picker to attach artifacts as conversation inputs.\n */\n public AddArtifactAttachment(artifact: {\n fileID: string; fileName: string; mimeType: string;\n sizeBytes: number; artifactVersionId?: string;\n }): PendingAttachment {\n const attachment: PendingAttachment = {\n id: crypto.randomUUID(),\n file: null,\n dataUrl: '',\n mimeType: artifact.mimeType,\n fileName: artifact.fileName,\n sizeBytes: artifact.sizeBytes,\n fileID: artifact.fileID,\n source: 'artifact',\n artifactVersionId: artifact.artifactVersionId\n };\n this.pendingAttachments.push(attachment);\n this.attachmentsChanged.emit([...this.pendingAttachments]);\n return attachment;\n }\n\n /**\n * Clear all pending attachments\n */\n public clearPendingAttachments(): void {\n this.pendingAttachments = [];\n this.attachmentsChanged.emit([]);\n this.cdr.detectChanges();\n }\n\n /**\n * Handle click on an attachment thumbnail\n */\n public onAttachmentClick(attachment: PendingAttachment): void {\n this.attachmentClicked.emit(attachment);\n }\n\n /**\n * Check if there are any pending attachments\n */\n public hasAttachments(): boolean {\n return this.pendingAttachments.length > 0;\n }\n\n /**\n * Trigger file picker programmatically\n */\n public openFilePicker(): void {\n const input = document.createElement('input');\n input.type = 'file';\n // If */* is in the list, accept all files (some browsers don't handle */* correctly)\n input.accept = this.acceptedFileTypes.includes('*/*') ? '' : this.acceptedFileTypes;\n input.multiple = true;\n input.onchange = (e) => this.onFileSelected(e);\n input.click();\n }\n}\n","<div class=\"mention-editor-container\"\n [class.drag-over]=\"isDragOver\"\n (click)=\"onContainerClick($event)\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave($event)\"\n (drop)=\"onDrop($event)\">\n\n <!-- Pending Attachments Preview -->\n @if (pendingAttachments.length > 0) {\n <div class=\"pending-attachments\">\n @for (attachment of pendingAttachments; track attachment) {\n <div class=\"attachment-thumbnail\"\n (click)=\"onAttachmentClick(attachment)\">\n @if (attachment.thumbnailUrl) {\n <img\n [src]=\"attachment.thumbnailUrl\"\n [alt]=\"attachment.fileName\"\n class=\"thumbnail-image\">\n }\n @if (!attachment.thumbnailUrl) {\n <div class=\"thumbnail-placeholder\">\n <i class=\"fa-solid fa-file\"></i>\n <span class=\"file-name\">{{ attachment.fileName }}</span>\n </div>\n }\n <button class=\"remove-attachment\"\n (click)=\"removeAttachment(attachment.id); $event.stopPropagation()\"\n title=\"Remove attachment\">\n <i class=\"fa-solid fa-times\"></i>\n </button>\n </div>\n }\n </div>\n }\n\n <div\n #editor\n class=\"mention-editor\"\n contenteditable=\"true\"\n [attr.contenteditable]=\"!disabled\"\n [attr.data-placeholder]=\"placeholder\"\n (input)=\"onInput()\"\n (keydown)=\"onKeyDown($event)\"\n (blur)=\"onBlur()\"\n (paste)=\"onPaste($event)\"\n ></div>\n\n <!-- Drag & Drop Overlay -->\n @if (isDragOver) {\n <div class=\"drop-overlay\">\n <div class=\"drop-message\">\n <i class=\"fa-solid fa-cloud-arrow-up\"></i>\n <span>Drop files here</span>\n </div>\n </div>\n }\n\n <!-- Mention Dropdown -->\n @if (showMentionDropdown && enableMentions) {\n <mj-mention-dropdown\n [suggestions]=\"mentionSuggestions\"\n [position]=\"mentionDropdownPosition\"\n [showAbove]=\"mentionDropdownShowAbove\"\n [useFixedPositioning]=\"true\"\n [visible]=\"true\"\n (suggestionSelected)=\"onMentionSelected($event)\"\n (closed)=\"closeMentionDropdown()\">\n </mj-mention-dropdown>\n }\n</div>\n"]}
1
+ {"version":3,"file":"mention-editor.component.js","sourceRoot":"","sources":["../../../../src/lib/components/mention/mention-editor.component.ts","../../../../src/lib/components/mention/mention-editor.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,MAAM,EACN,YAAY,EACZ,SAAS,EAGT,UAAU,EAIX,MAAM,eAAe,CAAC;AACvB,OAAO,EAAwB,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAGL,gCAAgC,EAGjC,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;;;;;ICRxC,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YAVD,wEAUC;;;iFDGU,sBAAsB;cAblC,SAAS;6BACI,KAAK,YACP,mBAAmB,aAGlB;oBACT;wBACE,OAAO,EAAE,iBAAiB;wBAC1B,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,uBAAuB,CAAC;wBACrD,KAAK,EAAE,IAAI;qBACZ;iBACF;;kBAGA,SAAS;mBAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;;kBAErC,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAEL,KAAK;;kBAML,KAAK;;kBAKL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAGL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAEL,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBAEN,MAAM;;kFArCI,sBAAsB","sourcesContent":["import {\n Component,\n Input,\n Output,\n EventEmitter,\n ViewChild,\n ElementRef,\n AfterViewInit,\n forwardRef,\n OnInit,\n ViewEncapsulation,\n ChangeDetectorRef\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport {\n ComposerSuggestionRequest,\n ComposerTriggerProvider,\n DiscoverComposerTriggerProviders,\n MentionSuggestion,\n MentionSuggestionPreset\n} from '../../composer-trigger-provider';\nimport { IMetadataProvider, UserInfo } from '@memberjunction/core';\nimport { UUIDsEqual } from '@memberjunction/global';\n\n/**\n * Represents a pending attachment that hasn't been uploaded yet\n */\nexport interface PendingAttachment {\n /** Local ID for tracking */\n id: string;\n /** Original File object (null for artifact references) */\n file: File | null;\n /** Base64 data URL for display */\n dataUrl: string;\n /** MIME type */\n mimeType: string;\n /** Original filename */\n fileName: string;\n /** File size in bytes */\n sizeBytes: number;\n /** Width in pixels (for images) */\n width?: number;\n /** Height in pixels (for images) */\n height?: number;\n /** Small thumbnail URL for preview */\n thumbnailUrl?: string;\n /** MJStorage File ID (for artifact references, mutually exclusive with inline data) */\n fileID?: string;\n /** Source of the attachment */\n source?: 'upload' | 'artifact';\n /** Artifact Version ID (for artifact references, used to create ConversationDetailArtifact) */\n artifactVersionId?: string;\n}\n\n/**\n * ContentEditable-based mention editor with visual chips/pills\n * Provides Slack/Teams-style mention UX with immutable mention tokens\n */\n@Component({\n standalone: false,\n selector: 'mj-mention-editor',\n templateUrl: './mention-editor.component.html',\n styleUrls: ['./mention-editor.component.css'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MentionEditorComponent),\n multi: true\n }\n ]\n})\nexport class MentionEditorComponent implements OnInit, AfterViewInit, ControlValueAccessor {\n @ViewChild('editor', { static: false }) editorRef!: ElementRef<HTMLDivElement>;\n\n @Input() placeholder: string = 'Type @ to mention agents or users, # for entities...';\n @Input() disabled: boolean = false;\n @Input() currentUser?: UserInfo;\n /** Master switch for all mention/command triggers. When false no providers are consulted. */\n @Input() enableMentions: boolean = true;\n /**\n * Explicit trigger-provider list — when bound, EXACTLY these providers are active\n * (explicit list wins over discovery). Leave null to discover providers registered\n * with the ClassFactory via `@RegisterClass(ComposerTriggerProvider, '<Key>')`.\n */\n @Input() TriggerProviders: ComposerTriggerProvider[] | null = null;\n /**\n * Discovery-mode filter: providers whose stable `Key` appears here are skipped when\n * resolving registered providers. Ignored when `TriggerProviders` is bound.\n */\n @Input() ExcludedTriggerKeys: string[] = [];\n /** Optional metadata provider scoping this editor (multi-provider hosts); passed through to trigger providers. */\n @Input() Provider: IMetadataProvider | null = null;\n /** Auto-focus the editor after view init (the composer default). Disable when embedded in forms. */\n @Input() autoFocus: boolean = true;\n\n // Attachment settings\n @Input() enableAttachments: boolean = true;\n @Input() maxAttachments: number = 10;\n @Input() maxAttachmentSizeBytes: number = 20 * 1024 * 1024; // 20MB default\n @Input() acceptedFileTypes: string = 'image/*'; // MIME types to accept\n\n @Output() valueChange = new EventEmitter<string>();\n @Output() mentionSelected = new EventEmitter<MentionSuggestion>();\n @Output() enterPressed = new EventEmitter<string>();\n @Output() attachmentsChanged = new EventEmitter<PendingAttachment[]>();\n @Output() attachmentError = new EventEmitter<string>();\n @Output() attachmentClicked = new EventEmitter<PendingAttachment>();\n /** Fires when the contenteditable loses focus (hosts persist drafts on this). */\n @Output() editorBlurred = new EventEmitter<void>();\n\n // Pending attachments state\n public pendingAttachments: PendingAttachment[] = [];\n public isDragOver: boolean = false;\n\n // Mention dropdown state\n public showMentionDropdown: boolean = false;\n public mentionSuggestions: MentionSuggestion[] = [];\n public mentionDropdownPosition: { top: number; left: number } = { top: 0, left: 0 };\n public mentionDropdownShowAbove: boolean = false;\n\n private mentionStartIndex: number = -1;\n private mentionQuery: string = '';\n /** The trigger char that opened the current mention dropdown */\n private activeTrigger: string = '@';\n /**\n * Monotonic sequence guarding the async suggestion fetch — a response only applies\n * when no newer keystroke (or dropdown close) has superseded it.\n */\n private suggestionRequestSeq: number = 0;\n /** Cap on the suggestions displayed; passed to providers as `MaxResults`. */\n private static readonly MaxSuggestions: number = 50;\n\n /**\n * The trigger providers this editor consults: the explicit `TriggerProviders` list\n * when bound, otherwise ClassFactory discovery filtered by `ExcludedTriggerKeys`.\n * Empty when `enableMentions` is off (or nothing is registered) — the editor then\n * behaves as a plain text editor.\n */\n private get activeProviders(): ComposerTriggerProvider[] {\n if (!this.enableMentions) {\n return [];\n }\n return this.TriggerProviders ?? DiscoverComposerTriggerProviders(this.ExcludedTriggerKeys);\n }\n\n /** Unique trigger characters across the active providers (priority order preserved). */\n private get mentionTriggers(): string[] {\n const triggers: string[] = [];\n for (const provider of this.activeProviders) {\n if (!triggers.includes(provider.TriggerChar)) {\n triggers.push(provider.TriggerChar);\n }\n }\n return triggers;\n }\n\n private onChange: (value: string) => void = () => {};\n public onTouched: () => void = () => {};\n /** Value written via writeValue() before the view (editorRef) exists — applied in ngAfterViewInit. */\n private pendingWriteValue: string | null = null;\n\n constructor(\n private cdr: ChangeDetectorRef\n ) {}\n\n async ngOnInit(): Promise<void> {\n // Warm up the active providers (best-effort — a provider that fails to warm\n // simply serves its first real request cold).\n if (this.enableMentions) {\n const user = this.currentUser ?? null;\n await Promise.all(\n this.activeProviders.map((p) => p.Initialize(user).catch(() => undefined))\n );\n }\n }\n\n ngAfterViewInit(): void {\n // Apply any value written through the ControlValueAccessor before the view existed\n // (NgModel calls writeValue during directive init, before this component's view is ready)\n if (this.pendingWriteValue !== null) {\n this.setEditorContent(this.pendingWriteValue);\n this.pendingWriteValue = null;\n }\n\n // Auto-focus the editor\n if (this.autoFocus) {\n setTimeout(() => {\n this.editorRef?.nativeElement?.focus();\n }, 100);\n }\n }\n\n /**\n * Handle clicks on the container - focus the editor if clicking outside the contentEditable\n */\n onContainerClick(event: MouseEvent): void {\n const target = event.target as HTMLElement;\n const editor = this.editorRef?.nativeElement;\n\n // Don't handle clicks on the dropdown or its children\n if (target.closest('mj-mention-dropdown')) {\n return;\n }\n\n // If clicking on container or any element that's not the editor itself, focus the editor\n if (target !== editor && !editor?.contains(target)) {\n editor?.focus();\n\n // Move cursor to end of content\n const selection = window.getSelection();\n const range = document.createRange();\n\n if (editor && selection) {\n range.selectNodeContents(editor);\n range.collapse(false); // Collapse to end\n selection.removeAllRanges();\n selection.addRange(range);\n }\n }\n }\n\n /**\n * Handle input changes in contentEditable\n */\n onInput(): void {\n const plainText = this.getPlainText();\n this.onChange(plainText);\n this.valueChange.emit(plainText);\n\n // Handle mention/command autocomplete via the active trigger providers\n if (this.enableMentions) {\n this.handleMentionInput();\n }\n }\n\n /**\n * Handle blur event - close dropdown when editor loses focus\n */\n onBlur(): void {\n // Call form control touched callback\n this.onTouched();\n this.editorBlurred.emit();\n\n // Close dropdown when editor loses focus\n // Use setTimeout to allow mousedown events on dropdown to fire first\n setTimeout(() => {\n if (this.showMentionDropdown) {\n this.closeMentionDropdown();\n }\n }, 200);\n }\n\n /**\n * Handle paste event - images or plain text\n */\n onPaste(event: ClipboardEvent): void {\n // Check for image data in clipboard\n if (this.enableAttachments && event.clipboardData?.items) {\n const items = Array.from(event.clipboardData.items);\n const imageItems = items.filter(item => item.type.startsWith('image/'));\n\n if (imageItems.length > 0) {\n event.preventDefault();\n\n // Process each image\n for (const item of imageItems) {\n const file = item.getAsFile();\n if (file) {\n this.processFile(file);\n }\n }\n return;\n }\n }\n\n // No images - handle as plain text\n event.preventDefault();\n\n // Get plain text from clipboard\n const text = event.clipboardData?.getData('text/plain') || '';\n\n if (!text) return;\n\n // Insert plain text at cursor position\n const selection = window.getSelection();\n if (!selection || selection.rangeCount === 0) return;\n\n const range = selection.getRangeAt(0);\n range.deleteContents();\n\n // Insert text as text node (not HTML)\n const textNode = document.createTextNode(text);\n range.insertNode(textNode);\n\n // Move cursor to end of inserted text\n range.setStartAfter(textNode);\n range.collapse(true);\n selection.removeAllRanges();\n selection.addRange(range);\n\n // Trigger input event to update model\n this.onInput();\n }\n\n /**\n * Handle keydown events\n */\n onKeyDown(event: KeyboardEvent): void {\n // Enter alone: Send message (if dropdown not showing)\n if (event.key === 'Enter' && !event.shiftKey && !this.showMentionDropdown) {\n event.preventDefault();\n const plainText = this.getPlainText();\n this.enterPressed.emit(plainText);\n return;\n }\n\n // Backspace: Check if deleting a mention chip\n if (event.key === 'Backspace') {\n this.handleBackspace(event);\n }\n\n // Handle mention dropdown navigation\n if (this.showMentionDropdown) {\n // Let the dropdown handle arrow keys, enter, escape\n // (We'll pass these through to mention-dropdown component)\n }\n }\n\n /**\n * Handle mention/command trigger detection — finds the nearest active trigger char\n * before the cursor and kicks off the (async) provider suggestion fetch.\n */\n private handleMentionInput(): void {\n const selection = window.getSelection();\n if (!selection || selection.rangeCount === 0) return;\n\n const activeTriggers = this.mentionTriggers;\n if (activeTriggers.length === 0) {\n this.closeMentionDropdown();\n return;\n }\n\n const range = selection.getRangeAt(0);\n const textBeforeCursor = this.getTextBeforeCursor(range);\n\n // Find the nearest active trigger char before the cursor — whichever is closest wins\n let triggerIndex = -1;\n let triggerChar = '@';\n for (const t of activeTriggers) {\n const idx = textBeforeCursor.lastIndexOf(t);\n if (idx > triggerIndex) {\n triggerIndex = idx;\n triggerChar = t;\n }\n }\n\n if (triggerIndex === -1) {\n this.closeMentionDropdown();\n return;\n }\n\n // Check if there's a space between the trigger and cursor (means mention was completed)\n const textAfterTrigger = textBeforeCursor.substring(triggerIndex + 1);\n if (textAfterTrigger.includes(' ')) {\n this.closeMentionDropdown();\n return;\n }\n\n // Extract query\n this.mentionQuery = textAfterTrigger;\n this.mentionStartIndex = triggerIndex;\n this.activeTrigger = triggerChar;\n\n // Fetch suggestions from the provider(s) owning this trigger (async, race-guarded)\n void this.fetchSuggestions(triggerChar, textAfterTrigger);\n }\n\n /**\n * Routes the suggestion request to every active provider whose TriggerChar matches,\n * concatenates their results in priority order, caps the merged list, and opens the\n * dropdown. A monotonic sequence drops stale responses when the user keeps typing.\n */\n private async fetchSuggestions(triggerChar: string, query: string): Promise<void> {\n const seq = ++this.suggestionRequestSeq;\n const providers = this.activeProviders.filter((p) => p.TriggerChar === triggerChar);\n\n const request: ComposerSuggestionRequest = {\n Query: query,\n MaxResults: MentionEditorComponent.MaxSuggestions,\n ContextUser: this.currentUser ?? null,\n Provider: this.Provider\n };\n\n const resultSets = await Promise.all(\n providers.map((p) => p.GetSuggestions(request).catch(() => [] as MentionSuggestion[]))\n );\n\n if (seq !== this.suggestionRequestSeq) {\n return; // superseded by a newer keystroke or an explicit close\n }\n\n const merged = resultSets.flat().slice(0, MentionEditorComponent.MaxSuggestions);\n this.mentionSuggestions = merged;\n\n if (merged.length > 0) {\n this.showMentionDropdown = true;\n this.positionMentionDropdown();\n } else {\n this.closeMentionDropdown();\n }\n this.cdr.detectChanges();\n }\n\n /**\n * Get text before cursor position\n */\n private getTextBeforeCursor(range: Range): string {\n const tempRange = range.cloneRange();\n tempRange.selectNodeContents(this.editorRef.nativeElement);\n tempRange.setEnd(range.startContainer, range.startOffset);\n return tempRange.toString();\n }\n\n /**\n * Position the mention dropdown\n */\n private positionMentionDropdown(): void {\n const editor = this.editorRef?.nativeElement;\n if (!editor) return;\n\n // Get the parent container (message-input-box-container) for alignment\n const container = editor.closest('.message-input-box-container');\n const containerRect = container?.getBoundingClientRect();\n\n const selection = window.getSelection();\n if (!selection || selection.rangeCount === 0) return;\n\n const range = selection.getRangeAt(0);\n const cursorRect = range.getBoundingClientRect();\n\n // Check space below vs above\n const spaceBelow = window.innerHeight - cursorRect.bottom;\n const spaceAbove = cursorRect.top;\n const dropdownHeight = Math.min(this.mentionSuggestions.length * 56, 300);\n\n this.mentionDropdownShowAbove = spaceBelow < dropdownHeight && spaceAbove > spaceBelow;\n\n if (this.mentionDropdownShowAbove) {\n // Position above, aligning with container top if possible\n this.mentionDropdownPosition = {\n top: containerRect ? containerRect.top + window.scrollY : cursorRect.top + window.scrollY - 4,\n left: cursorRect.left + window.scrollX\n };\n } else {\n // Position below cursor, but align bottom edge with container top\n this.mentionDropdownPosition = {\n top: containerRect ? containerRect.top + window.scrollY : cursorRect.bottom + window.scrollY + 4,\n left: cursorRect.left + window.scrollX\n };\n }\n }\n\n /**\n * Handle mention selection from dropdown\n */\n onMentionSelected(suggestion: MentionSuggestion): void {\n this.insertMentionChip(suggestion);\n this.closeMentionDropdown();\n this.mentionSelected.emit(suggestion);\n\n // Refocus the editor after selection\n setTimeout(() => {\n this.editorRef?.nativeElement?.focus();\n }, 50);\n }\n\n /**\n * Insert a mention chip at the current cursor position\n */\n /**\n * Programmatically inserts a RESOLVED mention chip (+ a single trailing space) at\n * the END of the editor content and places the caret after it — the exact state a\n * user reaches by typing a trigger and picking from the dropdown. Unlike the\n * dropdown path this needs no active trigger context, so hosts can pre-address a\n * message (e.g. the omnibar's '@agent' flow staging a Sage pill) and leave the\n * user ready to type.\n *\n * @returns false when the editor view isn't mounted yet — callers may retry.\n */\n /** Focuses the editor and places the caret at the very end of its content. */\n public FocusCaretAtEnd(): boolean {\n const editor = this.editorRef?.nativeElement;\n if (!editor) {\n return false;\n }\n editor.focus();\n const selection = window.getSelection();\n if (selection) {\n const range = document.createRange();\n range.selectNodeContents(editor);\n range.collapse(false);\n selection.removeAllRanges();\n selection.addRange(range);\n }\n return true;\n }\n\n /** True when keyboard focus currently sits inside this editor. */\n public get HasFocus(): boolean {\n const editor = this.editorRef?.nativeElement;\n return !!editor && (editor === document.activeElement || editor.contains(document.activeElement));\n }\n\n public InsertMention(suggestion: MentionSuggestion, focus: boolean = true): boolean {\n const editor = this.editorRef?.nativeElement;\n if (!editor) {\n return false;\n }\n editor.focus();\n const selection = window.getSelection();\n if (!selection) {\n return false;\n }\n // Caret to the end of the current content, then chip + space + caret-after.\n const range = document.createRange();\n range.selectNodeContents(editor);\n range.collapse(false);\n const chip = this.createMentionChip(suggestion);\n range.insertNode(chip);\n const space = document.createTextNode(' ');\n range.setStartAfter(chip);\n range.collapse(true);\n range.insertNode(space);\n range.setStartAfter(space);\n range.collapse(true);\n selection.removeAllRanges();\n selection.addRange(range);\n if (!focus) {\n editor.blur();\n }\n this.onInput();\n return true;\n }\n\n private insertMentionChip(suggestion: MentionSuggestion): void {\n const selection = window.getSelection();\n if (!selection || selection.rangeCount === 0) return;\n\n const range = selection.getRangeAt(0);\n\n // Delete the trigger + query text (use the active trigger char)\n const textBeforeCursor = this.getTextBeforeCursor(range);\n const lastAtIndex = textBeforeCursor.lastIndexOf(this.activeTrigger);\n const deleteLength = textBeforeCursor.length - lastAtIndex;\n\n range.setStart(range.startContainer, range.startOffset - deleteLength);\n range.deleteContents();\n\n // Create mention chip element\n const chip = this.createMentionChip(suggestion);\n\n // Insert chip\n range.insertNode(chip);\n\n // Add space after chip\n const space = document.createTextNode(' ');\n range.collapse(false);\n range.insertNode(space);\n\n // Move cursor after the space\n range.setStartAfter(space);\n range.collapse(true);\n selection.removeAllRanges();\n selection.addRange(range);\n\n // Trigger change detection\n this.onInput();\n }\n\n /**\n * Create a mention chip DOM element\n */\n private createMentionChip(suggestion: MentionSuggestion): HTMLSpanElement {\n const chip = document.createElement('span');\n chip.className = 'mention-chip';\n chip.contentEditable = 'false'; // Make chip non-editable\n chip.setAttribute('data-mention-id', suggestion.id);\n chip.setAttribute('data-mention-type', suggestion.type);\n chip.setAttribute('data-mention-name', suggestion.name);\n\n // Configuration presets ride along on the suggestion itself (supplied by the trigger\n // provider — e.g. the agent-mentions provider maps AI Agent Configuration presets in).\n // The composer has no knowledge of what a preset IS; it just stores the default's\n // ID/Name on the chip and offers a picker when there are 2+.\n const presets: MentionSuggestionPreset[] = suggestion.presets ?? [];\n if (presets.length > 0) {\n const defaultPreset = presets.find(p => p.IsDefault) || presets[0];\n if (defaultPreset) {\n chip.setAttribute('data-preset-id', defaultPreset.ID || '');\n chip.setAttribute('data-preset-name', defaultPreset.Name || '');\n }\n }\n\n // Apply inline styles directly — color by mention type. Skills carry their own accent Color\n // (AISkill.Color UX metadata); when present it drives the chip, otherwise the standard skill\n // green (--mj-status-success). Same color logic as the saved-message badge — keep in sync with\n // message-item's renderMentionHTML.\n const skillPalette = suggestion.type === 'skill'\n ? { bg: suggestion.color || 'var(--mj-status-success)', border: 'rgba(255, 255, 255, 0.35)' }\n : null;\n const palette =\n skillPalette\n ? skillPalette\n : suggestion.type === 'user'\n ? { bg: 'linear-gradient(135deg, #f093fb 0%, #f5576c 100%)', border: 'rgba(240, 147, 251, 0.4)' }\n : suggestion.type === 'entity'\n ? { bg: 'linear-gradient(135deg, #11998e 0%, #38ef7d 100%)', border: 'rgba(17, 153, 142, 0.4)' }\n : suggestion.type === 'query'\n ? { bg: 'linear-gradient(135deg, #FF6A00 0%, #FF9E2C 100%)', border: 'rgba(255, 106, 0, 0.4)' }\n : { bg: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)', border: 'rgba(102, 126, 234, 0.4)' };\n // Skills render as a sharp-cornered rectangle (vs. the rounded pill for agents/users/entities)\n // — the shape is the at-a-glance differentiator. Same shape in the saved-message badge.\n const chipRadius = suggestion.type === 'skill' ? '4px' : '16px';\n chip.style.cssText = `\n display: inline-flex;\n align-items: center;\n gap: 5px;\n padding: 4px 12px;\n margin: 0 3px;\n border-radius: ${chipRadius};\n font-size: 13px;\n font-weight: 600;\n cursor: default;\n user-select: none;\n vertical-align: middle;\n white-space: nowrap;\n pointer-events: all;\n background: ${palette.bg};\n color: white;\n border: 2px solid ${palette.border};\n box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.1);\n `;\n\n // Add icon or image\n if (suggestion.type === 'agent' && suggestion.imageUrl) {\n // Use image if available (LogoURL from agent)\n const img = document.createElement('img');\n img.src = suggestion.imageUrl;\n img.alt = suggestion.displayName;\n img.style.cssText = 'width: 16px; height: 16px; border-radius: 50%; object-fit: cover;';\n chip.appendChild(img);\n } else if (suggestion.type === 'agent' && suggestion.icon === 'mj-icon-skip') {\n // Special handling for mj-icon-skip: use the SVG data URI as an image\n const img = document.createElement('img');\n img.src = \"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 101.89918457031249 96.83947368421053'%3E%3Cg transform='translate(-0.1288232421875,-0.0)'%3E%3Cpath d='M93.85,41.56c-.84,0-1.62.2-2.37.55-3-4.35-7.49-8.12-13.04-11.04l.04-7.18v-14.44h-10.24v17.6c-1.52-.43-3.07-.8-4.67-1.11V0h-10.24v24.72s-.09,0-.14,0h-4.38s-.1,0-.14,0V7.3h-10.24v18.62c-1.6.32-3.15.69-4.67,1.11v-11.67h-10.24v6.09l.04,9.6c-5.55,2.92-10.04,6.7-13.04,11.04-.75-.35-1.53-.55-2.37-.55-4.5,0-8.14,5.61-8.14,12.51s3.64,12.53,8.14,12.53c.58,0,1.14-.12,1.67-.29,4.1,6.62,11.54,12.06,20.98,15.28l.79.13v7.05c0,2.97,1.45,5.58,3.87,6.99,1.18.69,2.5,1.04,3.85,1.03,1.4,0,2.83-.37,4.15-1.12l7.54-4.29,7.56,4.3c1.31.74,2.73,1.12,4.13,1.12s2.67-.35,3.85-1.04c2.42-1.41,3.86-4.02,3.86-6.98v-7.05l.79-.13c9.44-3.22,16.89-8.66,20.98-15.28.54.17,1.09.29,1.68.29,4.5,0,8.14-5.61,8.14-12.53s-3.63-12.51-8.14-12.51' fill='%23AAAAAA'/%3E%3Cpath d='M86.69,50.87c0-12.22-13.6-19.1-28.94-20.66-4.48-.47-9.19-.54-13.52,0-15.34,1.53-28.93,8.41-28.93,20.66,0,8.55,5.7,15.55,12.68,15.55h7.94c3.05,2.5,6.93,4.1,11.08,4.71,2.65.4,5.44.46,8.01,0,4.15-.6,8.05-2.2,11.1-4.71h7.92c6.97,0,12.68-7,12.68-15.55' fill='white' opacity='0.9'/%3E%3Cpath d='M57.83,55.82c-1.19,2.58-3.8,4.35-6.84,4.35s-5.65-1.77-6.84-4.35h13.68Z' fill='%23AAAAAA'/%3E%3Cpath d='M32.52,41.14c1.74,0,3.18,2.13,3.18,4.76s-1.44,4.74-3.18,4.74-3.16-2.13-3.16-4.74,1.41-4.76,3.16-4.76' fill='%23AAAAAA'/%3E%3Cpath d='M69.46,41.14c1.74,0,3.16,2.13,3.16,4.76s-1.41,4.74-3.16,4.74-3.18-2.13-3.18-4.74,1.41-4.76,3.18-4.76' fill='%23AAAAAA'/%3E%3Cpath d='M63.91,76.15c-.82-.48-1.84-.43-2.8.12l-10.13,5.75-10.11-5.75c-.96-.55-1.98-.59-2.8-.12-.82.47-1.29,1.38-1.29,2.49v10.12c0,1.11.47,2.02,1.28,2.49.38.22.8.33,1.24.33.51,0,1.05-.15,1.57-.44l10.12-5.75,10.11,5.75c.52.29,1.05.44,1.56.44.44,0,.86-.11,1.24-.33.81-.48,1.28-1.38,1.28-2.49v-10.12c0-1.11-.47-2.02-1.28-2.49' fill='white' opacity='0.9'/%3E%3C/g%3E%3C/svg%3E\";\n img.alt = suggestion.displayName;\n img.style.cssText = 'width: 16px; height: 16px; border-radius: 50%; object-fit: cover;';\n chip.appendChild(img);\n } else {\n // Use icon for users or agents without images\n const icon = document.createElement('i');\n icon.style.cssText = 'font-size: 12px; opacity: 0.95;';\n if (suggestion.type === 'agent' && suggestion.icon) {\n icon.className = this.getIconClasses(suggestion.icon);\n } else if (suggestion.type === 'user') {\n icon.className = 'fa-solid fa-user';\n } else if (suggestion.type === 'entity') {\n icon.className = this.getIconClasses(suggestion.icon || 'fa-solid fa-table');\n } else if (suggestion.type === 'query') {\n icon.className = this.getIconClasses(suggestion.icon || 'fa-solid fa-database');\n } else if (suggestion.type === 'skill') {\n icon.className = this.getIconClasses(suggestion.icon || 'fa-solid fa-wand-magic-sparkles');\n } else {\n icon.className = 'fa-solid fa-robot';\n }\n chip.appendChild(icon);\n }\n\n // Add space between icon/image and text\n const space = document.createTextNode(' ');\n chip.appendChild(space);\n\n // Add text\n const text = document.createTextNode(suggestion.displayName);\n chip.appendChild(text);\n\n // Add dropdown when the suggestion carries 2+ presets\n if (presets.length >= 2) {\n this.addConfigurationDropdown(chip, presets);\n }\n\n return chip;\n }\n\n /**\n * Add configuration preset dropdown to a mention chip\n */\n private addConfigurationDropdown(chip: HTMLSpanElement, presets: MentionSuggestionPreset[]): void {\n // Store default preset for comparison\n const defaultPreset = presets.find(p => p.IsDefault) || presets[0];\n\n // Add preset indicator text (only shown when non-default selected)\n const presetIndicator = document.createElement('span');\n presetIndicator.className = 'preset-indicator';\n presetIndicator.style.cssText = `\n display: none;\n font-size: 10px;\n font-weight: 600;\n font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Courier New', monospace;\n background: rgba(255, 255, 255, 0.25);\n padding: 2px 6px;\n border-radius: 4px;\n margin-left: 4px;\n letter-spacing: 0.3px;\n text-transform: uppercase;\n border: 1px solid rgba(255, 255, 255, 0.15);\n `;\n chip.appendChild(presetIndicator);\n\n // Add dropdown chevron button\n const chevron = document.createElement('i');\n chevron.className = 'fa-solid fa-chevron-down';\n chevron.style.cssText = `\n font-size: 10px;\n opacity: 0.9;\n cursor: pointer;\n padding: 2px;\n `;\n chip.appendChild(chevron);\n\n // Create dropdown menu (initially hidden) - append to body for global positioning\n const dropdown = document.createElement('div');\n dropdown.className = 'preset-dropdown';\n dropdown.style.cssText = `\n display: none;\n position: fixed;\n background: white;\n border: 1px solid #ddd;\n border-radius: 8px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n min-width: 200px;\n max-width: 300px;\n z-index: 10000;\n overflow: hidden;\n `;\n\n // Add preset options to dropdown\n presets.forEach(preset => {\n const option = document.createElement('div');\n option.className = 'preset-option';\n option.style.cssText = `\n padding: 10px 12px;\n cursor: pointer;\n display: flex;\n align-items: center;\n gap: 8px;\n transition: background 0.2s;\n `;\n\n // Check if this is the selected preset\n const currentPresetId = chip.getAttribute('data-preset-id');\n const isSelected = UUIDsEqual(preset.ID, currentPresetId);\n\n // Add checkmark for selected option\n const checkmark = document.createElement('i');\n checkmark.className = 'fa-solid fa-check';\n checkmark.style.cssText = `\n font-size: 12px;\n color: #667eea;\n opacity: ${isSelected ? '1' : '0'};\n width: 14px;\n `;\n option.appendChild(checkmark);\n\n // Add preset text content\n const textContainer = document.createElement('div');\n textContainer.style.cssText = 'flex: 1;';\n\n const displayName = document.createElement('div');\n displayName.textContent = preset.DisplayName || preset.Name;\n displayName.style.cssText = `\n font-weight: 600;\n color: #333;\n font-size: 13px;\n `;\n textContainer.appendChild(displayName);\n\n if (preset.Description) {\n const description = document.createElement('div');\n description.textContent = preset.Description;\n description.style.cssText = `\n font-size: 11px;\n color: #666;\n margin-top: 2px;\n `;\n textContainer.appendChild(description);\n }\n\n option.appendChild(textContainer);\n\n // Hover effects\n option.addEventListener('mouseenter', () => {\n option.style.background = '#f5f5f5';\n });\n option.addEventListener('mouseleave', () => {\n option.style.background = 'white';\n });\n\n // Click handler to select preset\n option.addEventListener('click', (e) => {\n e.stopPropagation();\n\n // Update chip data attributes\n // IMPORTANT: Store preset.ID (AIAgentConfiguration.ID), not AIConfigurationID\n chip.setAttribute('data-preset-id', preset.ID || '');\n chip.setAttribute('data-preset-name', preset.Name || '');\n\n // Update preset indicator visibility and text\n const isDefault = UUIDsEqual(preset.ID, defaultPreset.ID);\n if (isDefault) {\n presetIndicator.style.display = 'none';\n } else {\n presetIndicator.style.display = 'inline';\n presetIndicator.textContent = preset.DisplayName || preset.Name;\n }\n\n // Update checkmarks\n dropdown.querySelectorAll('.preset-option').forEach((opt, idx) => {\n const check = opt.querySelector('i.fa-check') as HTMLElement;\n if (check) {\n check.style.opacity = idx === presets.indexOf(preset) ? '1' : '0';\n }\n });\n\n // Close dropdown\n dropdown.style.display = 'none';\n });\n\n dropdown.appendChild(option);\n });\n\n // Append dropdown to document body for global positioning\n document.body.appendChild(dropdown);\n\n // Helper function to position dropdown relative to chip\n const positionDropdown = () => {\n const chipRect = chip.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n const spaceBelow = viewportHeight - chipRect.bottom;\n\n // Set left position (same for both above/below)\n dropdown.style.left = `${chipRect.left}px`;\n\n // First, show dropdown to measure its actual height\n const wasHidden = dropdown.style.display === 'none';\n if (wasHidden) {\n dropdown.style.visibility = 'hidden';\n dropdown.style.display = 'block';\n }\n\n const dropdownHeight = dropdown.offsetHeight;\n const spaceAbove = chipRect.top;\n\n // Position dropdown above chip if not enough space below\n if (spaceBelow < dropdownHeight && spaceAbove > spaceBelow) {\n // Show above - position so bottom of dropdown is 4px above top of chip\n dropdown.style.top = `${chipRect.top - dropdownHeight - 4}px`;\n } else {\n // Show below (default) - position 4px below bottom of chip\n dropdown.style.top = `${chipRect.bottom + 4}px`;\n }\n\n // Restore visibility\n if (wasHidden) {\n dropdown.style.visibility = 'visible';\n }\n };\n\n // Toggle dropdown on chevron click\n chevron.addEventListener('click', (e) => {\n e.stopPropagation();\n const isVisible = dropdown.style.display === 'block';\n\n if (isVisible) {\n dropdown.style.display = 'none';\n } else {\n positionDropdown();\n dropdown.style.display = 'block';\n }\n });\n\n // Close dropdown when clicking outside\n const closeDropdown = (e: MouseEvent) => {\n if (!dropdown.contains(e.target as Node) && !chip.contains(e.target as Node)) {\n dropdown.style.display = 'none';\n }\n };\n document.addEventListener('click', closeDropdown);\n\n // Cleanup: remove dropdown from body and event listeners when chip is removed\n const observer = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n mutation.removedNodes.forEach((node) => {\n if (node === chip) {\n document.removeEventListener('click', closeDropdown);\n if (dropdown.parentNode) {\n dropdown.parentNode.removeChild(dropdown);\n }\n observer.disconnect();\n }\n });\n });\n });\n if (chip.parentNode) {\n observer.observe(chip.parentNode, { childList: true });\n }\n }\n\n /**\n * Get icon classes with proper FA prefix\n */\n private getIconClasses(iconClass: string): string {\n if (!iconClass) return 'fa-solid fa-robot';\n if (iconClass.includes('fa-')) {\n if (iconClass.match(/\\b(fa-solid|fa-regular|fa-light|fa-brands)\\b/)) {\n return iconClass;\n }\n return `fa-solid ${iconClass}`;\n }\n return iconClass;\n }\n\n /**\n * Handle backspace key - delete entire chip if cursor is right after one\n */\n private handleBackspace(event: KeyboardEvent): void {\n const selection = window.getSelection();\n if (!selection || selection.rangeCount === 0) return;\n\n const range = selection.getRangeAt(0);\n\n // Check if cursor is right after a mention chip\n if (range.collapsed && range.startOffset > 0) {\n const prevNode = range.startContainer.childNodes[range.startOffset - 1];\n\n if (prevNode && (prevNode as HTMLElement).classList?.contains('mention-chip')) {\n event.preventDefault();\n prevNode.remove();\n this.onInput();\n }\n }\n }\n\n /**\n * Close mention dropdown\n */\n closeMentionDropdown(): void {\n // Invalidate any in-flight suggestion fetch so a late response can't reopen the dropdown\n this.suggestionRequestSeq++;\n this.showMentionDropdown = false;\n this.mentionSuggestions = [];\n this.mentionStartIndex = -1;\n this.mentionQuery = '';\n this.activeTrigger = '@';\n }\n\n /**\n * Convert editor HTML to plain text with @mentions\n */\n private getPlainText(): string {\n const editor = this.editorRef?.nativeElement;\n if (!editor) return '';\n\n let text = '';\n const nodes = editor.childNodes;\n\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n\n if (node.nodeType === Node.TEXT_NODE) {\n text += node.textContent || '';\n } else if (node.nodeType === Node.ELEMENT_NODE) {\n const element = node as HTMLElement;\n\n if (element.classList.contains('mention-chip')) {\n const name = element.getAttribute('data-mention-name') || '';\n const mentionType = element.getAttribute('data-mention-type');\n const prefix = mentionType === 'entity' || mentionType === 'query' ? '#' : mentionType === 'skill' ? '/' : '@';\n // Use quoted format if name has spaces\n text += name.includes(' ') ? `${prefix}\"${name}\"` : `${prefix}${name}`;\n } else if (element.tagName === 'BR') {\n text += '\\n';\n } else if (element.tagName === 'DIV') {\n // Handle line breaks from contentEditable\n if (i > 0) text += '\\n';\n text += this.getNodeText(element);\n } else {\n text += element.textContent || '';\n }\n }\n }\n\n return text;\n }\n\n /**\n * Get text from a node recursively\n */\n private getNodeText(node: Node): string {\n let text = '';\n const children = node.childNodes;\n\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n\n if (child.nodeType === Node.TEXT_NODE) {\n text += child.textContent || '';\n } else if (child.nodeType === Node.ELEMENT_NODE) {\n const element = child as HTMLElement;\n\n if (element.classList.contains('mention-chip')) {\n const name = element.getAttribute('data-mention-name') || '';\n const mentionType = element.getAttribute('data-mention-type');\n const prefix = mentionType === 'entity' || mentionType === 'query' ? '#' : mentionType === 'skill' ? '/' : '@';\n text += name.includes(' ') ? `${prefix}\"${name}\"` : `${prefix}${name}`;\n } else {\n text += this.getNodeText(element);\n }\n }\n }\n\n return text;\n }\n\n /**\n * Set editor content from plain text (for programmatic updates)\n */\n /**\n * Renders a value into the editor, REHYDRATING any serialized mention tokens\n * (the `@{\"type\":…,\"id\":…,\"name\":…}` format produced by\n * {@link getPlainTextWithJsonMentions}) back into real chips — so persisted\n * drafts and any host-written serialized value round-trip losslessly. Plain\n * strings (no tokens) take the fast path.\n */\n private setEditorContent(text: string): void {\n const editor = this.editorRef?.nativeElement;\n if (!editor) return;\n\n const segments = MentionEditorComponent.ParseSerializedMentions(text);\n if (segments.every((seg) => typeof seg === 'string')) {\n editor.textContent = text;\n return;\n }\n editor.textContent = '';\n for (const seg of segments) {\n if (typeof seg === 'string') {\n if (seg.length > 0) {\n editor.appendChild(document.createTextNode(seg));\n }\n } else {\n const chip = this.createMentionChip(seg.suggestion);\n if (seg.configId) {\n chip.setAttribute('data-preset-id', seg.configId);\n }\n if (seg.config) {\n chip.setAttribute('data-preset-name', seg.config);\n }\n editor.appendChild(chip);\n }\n }\n }\n\n /**\n * Splits text containing serialized mention tokens into plain-string segments and\n * parsed mention segments. Token = '@' followed by a JSON object with at least\n * {type,id,name}; brace matching is string-aware so names containing braces or\n * escaped quotes parse correctly. Malformed candidates stay as literal text.\n */\n public static ParseSerializedMentions(\n text: string\n ): Array<string | { suggestion: MentionSuggestion; configId?: string; config?: string }> {\n const segments: Array<string | { suggestion: MentionSuggestion; configId?: string; config?: string }> = [];\n let cursor = 0;\n let searchFrom = 0;\n while (true) {\n const start = text.indexOf('@{', searchFrom);\n if (start === -1) {\n break;\n }\n const end = MentionEditorComponent.findJsonEnd(text, start + 1);\n if (end === -1) {\n searchFrom = start + 2;\n continue;\n }\n const candidate = text.substring(start + 1, end + 1);\n let parsed: { type?: string; id?: string; name?: string; configId?: string; config?: string } | null = null;\n try {\n parsed = JSON.parse(candidate);\n } catch {\n parsed = null;\n }\n if (!parsed || typeof parsed.type !== 'string' || typeof parsed.id !== 'string' || typeof parsed.name !== 'string') {\n searchFrom = start + 2; // not a mention token — keep scanning past it\n continue;\n }\n if (start > cursor) {\n segments.push(text.substring(cursor, start));\n }\n segments.push({\n suggestion: { type: parsed.type, id: parsed.id, name: parsed.name, displayName: parsed.name },\n configId: parsed.configId,\n config: parsed.config,\n });\n cursor = end + 1;\n searchFrom = cursor;\n }\n if (cursor < text.length) {\n segments.push(text.substring(cursor));\n }\n if (segments.length === 0) {\n segments.push(text);\n }\n return segments;\n }\n\n /** Index of the matching closing brace for the object starting at `openIndex` ('{'), string-aware. -1 when unbalanced. */\n private static findJsonEnd(text: string, openIndex: number): number {\n let depth = 0;\n let inString = false;\n for (let i = openIndex; i < text.length; i++) {\n const ch = text[i];\n if (inString) {\n if (ch === '\\\\') {\n i++; // skip escaped char\n } else if (ch === '\"') {\n inString = false;\n }\n continue;\n }\n if (ch === '\"') {\n inString = true;\n } else if (ch === '{') {\n depth++;\n } else if (ch === '}') {\n depth--;\n if (depth === 0) {\n return i;\n }\n }\n }\n return -1;\n }\n\n // ControlValueAccessor implementation\n writeValue(value: string): void {\n const editor = this.editorRef?.nativeElement;\n if (!editor) {\n // View not created yet — buffer the value; ngAfterViewInit applies it\n this.pendingWriteValue = value ?? '';\n return;\n }\n if (value) {\n this.setEditorContent(value);\n } else {\n editor.textContent = '';\n }\n }\n\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n if (this.editorRef?.nativeElement) {\n this.editorRef.nativeElement.contentEditable = (!isDisabled).toString();\n }\n }\n\n /**\n * Focus the editor\n */\n public focus(): void {\n this.editorRef?.nativeElement?.focus();\n }\n\n /**\n * Clear the editor content and pending attachments\n */\n public clear(): void {\n if (this.editorRef?.nativeElement) {\n this.editorRef.nativeElement.textContent = '';\n this.onInput();\n }\n this.clearPendingAttachments();\n }\n\n /**\n * Extract mention chips with their configuration data\n * Returns array of objects containing mention info and preset configuration\n */\n public getMentionChipsData(): Array<{ id: string; type: string; name: string; presetId?: string; presetName?: string }> {\n const editor = this.editorRef?.nativeElement;\n if (!editor) return [];\n\n const chips: Array<{ id: string; type: string; name: string; presetId?: string; presetName?: string }> = [];\n const mentionElements = editor.querySelectorAll('.mention-chip');\n\n mentionElements.forEach(chip => {\n const element = chip as HTMLElement;\n const id = element.getAttribute('data-mention-id') || '';\n const type = element.getAttribute('data-mention-type') || '';\n const name = element.getAttribute('data-mention-name') || '';\n const presetId = element.getAttribute('data-preset-id') || undefined;\n const presetName = element.getAttribute('data-preset-name') || undefined;\n\n chips.push({\n id,\n type,\n name,\n ...(presetId ? { presetId } : {}),\n ...(presetName ? { presetName } : {})\n });\n });\n\n return chips;\n }\n\n /**\n * Get the plain text value with mentions encoded as JSON\n * This format preserves configuration information when messages are saved\n * Format: @{type:\"agent\",id:\"uuid\",name:\"Agent Name\",configId:\"uuid\",config:\"High\"}\n */\n public getPlainTextWithJsonMentions(): string {\n const editor = this.editorRef?.nativeElement;\n if (!editor) return '';\n\n let plainText = '';\n const childNodes = Array.from(editor.childNodes);\n\n for (const node of childNodes) {\n if (node.nodeType === Node.TEXT_NODE) {\n // Regular text node\n plainText += node.textContent || '';\n } else if (node.nodeType === Node.ELEMENT_NODE) {\n const element = node as HTMLElement;\n\n if (element.classList.contains('mention-chip')) {\n // Extract mention data attributes\n const type = element.getAttribute('data-mention-type') || '';\n const id = element.getAttribute('data-mention-id') || '';\n const name = element.getAttribute('data-mention-name') || '';\n const presetId = element.getAttribute('data-preset-id');\n const presetName = element.getAttribute('data-preset-name');\n\n // Build JSON mention object (compact format - no spaces)\n const mentionObj: Record<string, string> = {\n type,\n id,\n name\n };\n\n // Add configuration fields if present (for agents with non-default presets)\n if (presetId) {\n mentionObj.configId = presetId;\n }\n if (presetName) {\n mentionObj.config = presetName;\n }\n\n // Encode as JSON mention\n // Don't remove spaces from the JSON string - spaces in values (like agent names) need to be preserved\n plainText += `@${JSON.stringify(mentionObj)}`;\n } else {\n // Other HTML element (e.g., <br>)\n if (element.tagName === 'BR') {\n plainText += '\\n';\n } else {\n plainText += element.textContent || '';\n }\n }\n }\n }\n\n return plainText;\n }\n\n // ==================== Attachment Handling Methods ====================\n\n /**\n * Handle drag over event\n */\n onDragOver(event: DragEvent): void {\n if (!this.enableAttachments) return;\n\n event.preventDefault();\n event.stopPropagation();\n this.isDragOver = true;\n }\n\n /**\n * Handle drag leave event\n */\n onDragLeave(event: DragEvent): void {\n event.preventDefault();\n event.stopPropagation();\n this.isDragOver = false;\n }\n\n /**\n * Handle drop event\n */\n onDrop(event: DragEvent): void {\n if (!this.enableAttachments) return;\n\n event.preventDefault();\n event.stopPropagation();\n this.isDragOver = false;\n\n if (event.dataTransfer?.files) {\n const files = Array.from(event.dataTransfer.files);\n for (const file of files) {\n if (this.isAcceptedFile(file)) {\n this.processFile(file);\n }\n }\n }\n }\n\n /**\n * Handle file input change (from file picker)\n */\n onFileSelected(event: Event): void {\n const input = event.target as HTMLInputElement;\n if (input.files) {\n const files = Array.from(input.files);\n for (const file of files) {\n this.processFile(file);\n }\n // Reset input so same file can be selected again\n input.value = '';\n }\n }\n\n /**\n * Process a file for attachment\n */\n private async processFile(file: File): Promise<void> {\n // Validate file\n const validation = this.validateFile(file);\n if (!validation.valid) {\n this.attachmentError.emit(validation.error!);\n return;\n }\n\n // Read file as data URL\n const dataUrl = await this.readFileAsDataUrl(file);\n if (!dataUrl) {\n this.attachmentError.emit('Failed to read file');\n return;\n }\n\n // Get image dimensions if applicable\n let width: number | undefined;\n let height: number | undefined;\n\n if (file.type.startsWith('image/')) {\n const dimensions = await this.getImageDimensions(dataUrl);\n width = dimensions.width;\n height = dimensions.height;\n }\n\n // Create pending attachment\n const attachment: PendingAttachment = {\n id: this.generateAttachmentId(),\n file,\n dataUrl,\n mimeType: file.type,\n fileName: file.name,\n sizeBytes: file.size,\n width,\n height,\n thumbnailUrl: file.type.startsWith('image/') ? dataUrl : undefined\n };\n\n // Add to pending attachments\n this.pendingAttachments.push(attachment);\n this.attachmentsChanged.emit([...this.pendingAttachments]);\n this.cdr.detectChanges();\n }\n\n /**\n * Validate a file against settings\n */\n private validateFile(file: File): { valid: boolean; error?: string } {\n // Check count limit\n if (this.pendingAttachments.length >= this.maxAttachments) {\n return {\n valid: false,\n error: `Maximum ${this.maxAttachments} attachments allowed`\n };\n }\n\n // Check size limit\n if (file.size > this.maxAttachmentSizeBytes) {\n const maxMB = (this.maxAttachmentSizeBytes / (1024 * 1024)).toFixed(1);\n const fileMB = (file.size / (1024 * 1024)).toFixed(1);\n return {\n valid: false,\n error: `File size (${fileMB}MB) exceeds maximum (${maxMB}MB)`\n };\n }\n\n // Check file type\n if (!this.isAcceptedFile(file)) {\n return {\n valid: false,\n error: `File type ${file.type || 'unknown'} not accepted`\n };\n }\n\n return { valid: true };\n }\n\n /**\n * Check if file type is accepted\n */\n private isAcceptedFile(file: File): boolean {\n if (this.acceptedFileTypes === '*' || this.acceptedFileTypes === '*/*') {\n return true;\n }\n\n const acceptedTypes = this.acceptedFileTypes.split(',').map(t => t.trim());\n\n for (const accepted of acceptedTypes) {\n // Handle universal wildcard */* anywhere in the list\n if (accepted === '*/*') {\n return true;\n }\n // Handle wildcard MIME types like \"image/*\"\n if (accepted.endsWith('/*')) {\n const category = accepted.slice(0, -2);\n if (file.type.startsWith(category + '/')) {\n return true;\n }\n } else if (accepted.startsWith('.')) {\n // Handle file extensions like \".png\"\n if (file.name.toLowerCase().endsWith(accepted.toLowerCase())) {\n return true;\n }\n } else if (file.type === accepted) {\n // Exact MIME type match\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * Read file as data URL\n */\n private readFileAsDataUrl(file: File): Promise<string | null> {\n return new Promise((resolve) => {\n const reader = new FileReader();\n reader.onload = () => resolve(reader.result as string);\n reader.onerror = () => resolve(null);\n reader.readAsDataURL(file);\n });\n }\n\n /**\n * Get image dimensions\n */\n private getImageDimensions(dataUrl: string): Promise<{ width: number; height: number }> {\n return new Promise((resolve) => {\n const img = new Image();\n img.onload = () => {\n resolve({ width: img.naturalWidth, height: img.naturalHeight });\n };\n img.onerror = () => {\n resolve({ width: 0, height: 0 });\n };\n img.src = dataUrl;\n });\n }\n\n /**\n * Generate unique attachment ID\n */\n private generateAttachmentId(): string {\n return `att_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;\n }\n\n /**\n * Remove a pending attachment by ID\n */\n public removeAttachment(id: string): void {\n const index = this.pendingAttachments.findIndex(a => a.id === id);\n if (index !== -1) {\n this.pendingAttachments.splice(index, 1);\n this.attachmentsChanged.emit([...this.pendingAttachments]);\n this.cdr.detectChanges();\n }\n }\n\n /**\n * Get all pending attachments\n */\n public getPendingAttachments(): PendingAttachment[] {\n return [...this.pendingAttachments];\n }\n\n /**\n * Add an artifact as a pending attachment programmatically.\n * Used by the artifact picker to attach artifacts as conversation inputs.\n */\n public AddArtifactAttachment(artifact: {\n fileID: string; fileName: string; mimeType: string;\n sizeBytes: number; artifactVersionId?: string;\n }): PendingAttachment {\n const attachment: PendingAttachment = {\n id: crypto.randomUUID(),\n file: null,\n dataUrl: '',\n mimeType: artifact.mimeType,\n fileName: artifact.fileName,\n sizeBytes: artifact.sizeBytes,\n fileID: artifact.fileID,\n source: 'artifact',\n artifactVersionId: artifact.artifactVersionId\n };\n this.pendingAttachments.push(attachment);\n this.attachmentsChanged.emit([...this.pendingAttachments]);\n return attachment;\n }\n\n /**\n * Clear all pending attachments\n */\n public clearPendingAttachments(): void {\n this.pendingAttachments = [];\n this.attachmentsChanged.emit([]);\n this.cdr.detectChanges();\n }\n\n /**\n * Handle click on an attachment thumbnail\n */\n public onAttachmentClick(attachment: PendingAttachment): void {\n this.attachmentClicked.emit(attachment);\n }\n\n /**\n * Check if there are any pending attachments\n */\n public hasAttachments(): boolean {\n return this.pendingAttachments.length > 0;\n }\n\n /**\n * Trigger file picker programmatically\n */\n public openFilePicker(): void {\n const input = document.createElement('input');\n input.type = 'file';\n // If */* is in the list, accept all files (some browsers don't handle */* correctly)\n input.accept = this.acceptedFileTypes.includes('*/*') ? '' : this.acceptedFileTypes;\n input.multiple = true;\n input.onchange = (e) => this.onFileSelected(e);\n input.click();\n }\n}\n","<div class=\"mention-editor-container\"\n [class.drag-over]=\"isDragOver\"\n (click)=\"onContainerClick($event)\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave($event)\"\n (drop)=\"onDrop($event)\">\n\n <!-- Pending Attachments Preview -->\n @if (pendingAttachments.length > 0) {\n <div class=\"pending-attachments\">\n @for (attachment of pendingAttachments; track attachment) {\n <div class=\"attachment-thumbnail\"\n (click)=\"onAttachmentClick(attachment)\">\n @if (attachment.thumbnailUrl) {\n <img\n [src]=\"attachment.thumbnailUrl\"\n [alt]=\"attachment.fileName\"\n class=\"thumbnail-image\">\n }\n @if (!attachment.thumbnailUrl) {\n <div class=\"thumbnail-placeholder\">\n <i class=\"fa-solid fa-file\"></i>\n <span class=\"file-name\">{{ attachment.fileName }}</span>\n </div>\n }\n <button class=\"remove-attachment\"\n (click)=\"removeAttachment(attachment.id); $event.stopPropagation()\"\n title=\"Remove attachment\">\n <i class=\"fa-solid fa-times\"></i>\n </button>\n </div>\n }\n </div>\n }\n\n <div\n #editor\n class=\"mention-editor\"\n contenteditable=\"true\"\n [attr.contenteditable]=\"!disabled\"\n [attr.data-placeholder]=\"placeholder\"\n (input)=\"onInput()\"\n (keydown)=\"onKeyDown($event)\"\n (blur)=\"onBlur()\"\n (paste)=\"onPaste($event)\"\n ></div>\n\n <!-- Drag & Drop Overlay -->\n @if (isDragOver) {\n <div class=\"drop-overlay\">\n <div class=\"drop-message\">\n <i class=\"fa-solid fa-cloud-arrow-up\"></i>\n <span>Drop files here</span>\n </div>\n </div>\n }\n\n <!-- Mention Dropdown -->\n @if (showMentionDropdown && enableMentions) {\n <mj-mention-dropdown\n [suggestions]=\"mentionSuggestions\"\n [position]=\"mentionDropdownPosition\"\n [showAbove]=\"mentionDropdownShowAbove\"\n [useFixedPositioning]=\"true\"\n [visible]=\"true\"\n (suggestionSelected)=\"onMentionSelected($event)\"\n (closed)=\"closeMentionDropdown()\">\n </mj-mention-dropdown>\n }\n</div>\n"]}
@@ -48,6 +48,8 @@ export declare class MessageInputBoxComponent {
48
48
  enablePlanMode: boolean;
49
49
  /** Current Plan Mode toggle state (renders the button in its active state). */
50
50
  planModeActive: boolean;
51
+ /** Composer lost focus — hosts persist drafts on this. */
52
+ blurred: EventEmitter<void>;
51
53
  textSubmitted: EventEmitter<string>;
52
54
  valueChange: EventEmitter<string>;
53
55
  attachmentsChanged: EventEmitter<PendingAttachment[]>;
@@ -104,6 +106,10 @@ export declare class MessageInputBoxComponent {
104
106
  /**
105
107
  * Public method to focus the input programmatically
106
108
  */
109
+ /** Inserts a resolved mention chip + space and focuses (see MentionEditorComponent.InsertMention). */
110
+ InsertMention(suggestion: MentionSuggestion, focus?: boolean): boolean;
111
+ /** Focus with the caret at the end of content (see MentionEditorComponent.FocusCaretAtEnd). */
112
+ FocusCaretAtEnd(): boolean;
107
113
  focus(): void;
108
114
  /**
109
115
  * Get mention chip data including configuration presets
@@ -134,6 +140,6 @@ export declare class MessageInputBoxComponent {
134
140
  artifactVersionId?: string;
135
141
  }): PendingAttachment | undefined;
136
142
  static ɵfac: i0.ɵɵFactoryDeclaration<MessageInputBoxComponent, never>;
137
- static ɵcmp: i0.ɵɵComponentDeclaration<MessageInputBoxComponent, "mj-message-input-box", never, { "placeholder": { "alias": "placeholder"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "value": { "alias": "value"; "required": false; }; "showCharacterCount": { "alias": "showCharacterCount"; "required": false; }; "enableMentions": { "alias": "enableMentions"; "required": false; }; "TriggerProviders": { "alias": "TriggerProviders"; "required": false; }; "ExcludedTriggerKeys": { "alias": "ExcludedTriggerKeys"; "required": false; }; "Provider": { "alias": "Provider"; "required": false; }; "currentUser": { "alias": "currentUser"; "required": false; }; "rows": { "alias": "rows"; "required": false; }; "enableAttachments": { "alias": "enableAttachments"; "required": false; }; "maxAttachments": { "alias": "maxAttachments"; "required": false; }; "maxAttachmentSizeBytes": { "alias": "maxAttachmentSizeBytes"; "required": false; }; "acceptedFileTypes": { "alias": "acceptedFileTypes"; "required": false; }; "enableRealtime": { "alias": "enableRealtime"; "required": false; }; "voiceActive": { "alias": "voiceActive"; "required": false; }; "canStartRealtime": { "alias": "canStartRealtime"; "required": false; }; "enablePlanMode": { "alias": "enablePlanMode"; "required": false; }; "planModeActive": { "alias": "planModeActive"; "required": false; }; }, { "textSubmitted": "textSubmitted"; "valueChange": "valueChange"; "attachmentsChanged": "attachmentsChanged"; "attachmentError": "attachmentError"; "attachmentClicked": "attachmentClicked"; "voiceRequested": "voiceRequested"; "voiceOptionsRequested": "voiceOptionsRequested"; "planModeToggle": "planModeToggle"; }, never, never, false, never>;
143
+ static ɵcmp: i0.ɵɵComponentDeclaration<MessageInputBoxComponent, "mj-message-input-box", never, { "placeholder": { "alias": "placeholder"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "value": { "alias": "value"; "required": false; }; "showCharacterCount": { "alias": "showCharacterCount"; "required": false; }; "enableMentions": { "alias": "enableMentions"; "required": false; }; "TriggerProviders": { "alias": "TriggerProviders"; "required": false; }; "ExcludedTriggerKeys": { "alias": "ExcludedTriggerKeys"; "required": false; }; "Provider": { "alias": "Provider"; "required": false; }; "currentUser": { "alias": "currentUser"; "required": false; }; "rows": { "alias": "rows"; "required": false; }; "enableAttachments": { "alias": "enableAttachments"; "required": false; }; "maxAttachments": { "alias": "maxAttachments"; "required": false; }; "maxAttachmentSizeBytes": { "alias": "maxAttachmentSizeBytes"; "required": false; }; "acceptedFileTypes": { "alias": "acceptedFileTypes"; "required": false; }; "enableRealtime": { "alias": "enableRealtime"; "required": false; }; "voiceActive": { "alias": "voiceActive"; "required": false; }; "canStartRealtime": { "alias": "canStartRealtime"; "required": false; }; "enablePlanMode": { "alias": "enablePlanMode"; "required": false; }; "planModeActive": { "alias": "planModeActive"; "required": false; }; }, { "blurred": "blurred"; "textSubmitted": "textSubmitted"; "valueChange": "valueChange"; "attachmentsChanged": "attachmentsChanged"; "attachmentError": "attachmentError"; "attachmentClicked": "attachmentClicked"; "voiceRequested": "voiceRequested"; "voiceOptionsRequested": "voiceOptionsRequested"; "planModeToggle": "planModeToggle"; }, never, never, false, never>;
138
144
  }
139
145
  //# sourceMappingURL=message-input-box.component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"message-input-box.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/message/message-input-box.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAa,MAAM,eAAe,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,E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AE;IAI5C;;OAEG;IACH,cAAc,IAAI,IAAI;IAItB;;OAEG;IACH,qBAAqB,CAAC,QAAQ,EAAE;QAC9B,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QACnD,SAAS,EAAE,MAAM,CAAC;QAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC/C,GAAG,iBAAiB,GAAG,SAAS;yCApNtB,wBAAwB;2CAAxB,wBAAwB;CAuNpC"}
@@ -103,6 +103,8 @@ export class MessageInputBoxComponent {
103
103
  enablePlanMode = false;
104
104
  /** Current Plan Mode toggle state (renders the button in its active state). */
105
105
  planModeActive = false;
106
+ /** Composer lost focus — hosts persist drafts on this. */
107
+ blurred = new EventEmitter();
106
108
  textSubmitted = new EventEmitter();
107
109
  valueChange = new EventEmitter();
108
110
  attachmentsChanged = new EventEmitter();
@@ -216,6 +218,14 @@ export class MessageInputBoxComponent {
216
218
  /**
217
219
  * Public method to focus the input programmatically
218
220
  */
221
+ /** Inserts a resolved mention chip + space and focuses (see MentionEditorComponent.InsertMention). */
222
+ InsertMention(suggestion, focus = true) {
223
+ return this.mentionEditor?.InsertMention(suggestion, focus) ?? false;
224
+ }
225
+ /** Focus with the caret at the end of content (see MentionEditorComponent.FocusCaretAtEnd). */
226
+ FocusCaretAtEnd() {
227
+ return this.mentionEditor?.FocusCaretAtEnd() ?? false;
228
+ }
219
229
  focus() {
220
230
  const editor = this.mentionEditor?.editorRef?.nativeElement;
221
231
  if (editor) {
@@ -252,13 +262,13 @@ export class MessageInputBoxComponent {
252
262
  } if (rf & 2) {
253
263
  let _t;
254
264
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.mentionEditor = _t.first);
255
- } }, inputs: { placeholder: "placeholder", disabled: "disabled", value: "value", showCharacterCount: "showCharacterCount", enableMentions: "enableMentions", TriggerProviders: "TriggerProviders", ExcludedTriggerKeys: "ExcludedTriggerKeys", Provider: "Provider", currentUser: "currentUser", rows: "rows", enableAttachments: "enableAttachments", maxAttachments: "maxAttachments", maxAttachmentSizeBytes: "maxAttachmentSizeBytes", acceptedFileTypes: "acceptedFileTypes", enableRealtime: "enableRealtime", voiceActive: "voiceActive", canStartRealtime: "canStartRealtime", enablePlanMode: "enablePlanMode", planModeActive: "planModeActive" }, outputs: { textSubmitted: "textSubmitted", valueChange: "valueChange", attachmentsChanged: "attachmentsChanged", attachmentError: "attachmentError", attachmentClicked: "attachmentClicked", voiceRequested: "voiceRequested", voiceOptionsRequested: "voiceOptionsRequested", planModeToggle: "planModeToggle" }, standalone: false, decls: 7, vars: 14, consts: [["mentionEditor", ""], [1, "message-input-box-container", 3, "click"], [1, "input-wrapper"], [3, "ngModelChange", "valueChange", "enterPressed", "mentionSelected", "attachmentsChanged", "attachmentError", "attachmentClicked", "placeholder", "disabled", "currentUser", "enableMentions", "TriggerProviders", "ExcludedTriggerKeys", "Provider", "enableAttachments", "maxAttachments", "maxAttachmentSizeBytes", "acceptedFileTypes", "ngModel"], [1, "attach-buttons"], ["title", "Send message (Enter)", 1, "send-button-icon", 3, "click", "disabled"], [1, "fa-solid", "fa-paper-plane"], ["aria-label", "Toggle Plan Mode", 1, "attach-button-icon", "plan-mode-button-icon", 3, "plan-mode-button-icon--active", "disabled", "title"], ["title", "Attach file", 1, "attach-button-icon", 3, "disabled"], ["aria-label", "Toggle Plan Mode", 1, "attach-button-icon", "plan-mode-button-icon", 3, "click", "disabled", "title"], ["aria-hidden", "true", 1, "fa-solid", "fa-route"], ["title", "Attach file", 1, "attach-button-icon", 3, "click", "disabled"], [1, "fa-solid", "fa-paperclip"], ["aria-label", "Start a voice call", 1, "attach-button-icon", "voice-button-icon", 3, "click", "disabled", "title"], ["aria-hidden", "true", 1, "fa-solid", "fa-phone"], ["title", "Voice call options (choose agent and voice model)", "aria-label", "Voice call options", 1, "attach-button-icon", "voice-options-button-icon", 3, "click", "disabled"], ["aria-hidden", "true", 1, "fa-solid", "fa-chevron-down"]], template: function MessageInputBoxComponent_Template(rf, ctx) { if (rf & 1) {
265
+ } }, inputs: { placeholder: "placeholder", disabled: "disabled", value: "value", showCharacterCount: "showCharacterCount", enableMentions: "enableMentions", TriggerProviders: "TriggerProviders", ExcludedTriggerKeys: "ExcludedTriggerKeys", Provider: "Provider", currentUser: "currentUser", rows: "rows", enableAttachments: "enableAttachments", maxAttachments: "maxAttachments", maxAttachmentSizeBytes: "maxAttachmentSizeBytes", acceptedFileTypes: "acceptedFileTypes", enableRealtime: "enableRealtime", voiceActive: "voiceActive", canStartRealtime: "canStartRealtime", enablePlanMode: "enablePlanMode", planModeActive: "planModeActive" }, outputs: { blurred: "blurred", textSubmitted: "textSubmitted", valueChange: "valueChange", attachmentsChanged: "attachmentsChanged", attachmentError: "attachmentError", attachmentClicked: "attachmentClicked", voiceRequested: "voiceRequested", voiceOptionsRequested: "voiceOptionsRequested", planModeToggle: "planModeToggle" }, standalone: false, decls: 7, vars: 14, consts: [["mentionEditor", ""], [1, "message-input-box-container", 3, "click"], [1, "input-wrapper"], [3, "ngModelChange", "valueChange", "enterPressed", "mentionSelected", "attachmentsChanged", "attachmentError", "attachmentClicked", "editorBlurred", "placeholder", "disabled", "currentUser", "enableMentions", "TriggerProviders", "ExcludedTriggerKeys", "Provider", "enableAttachments", "maxAttachments", "maxAttachmentSizeBytes", "acceptedFileTypes", "ngModel"], [1, "attach-buttons"], ["title", "Send message (Enter)", 1, "send-button-icon", 3, "click", "disabled"], [1, "fa-solid", "fa-paper-plane"], ["aria-label", "Toggle Plan Mode", 1, "attach-button-icon", "plan-mode-button-icon", 3, "plan-mode-button-icon--active", "disabled", "title"], ["title", "Attach file", 1, "attach-button-icon", 3, "disabled"], ["aria-label", "Toggle Plan Mode", 1, "attach-button-icon", "plan-mode-button-icon", 3, "click", "disabled", "title"], ["aria-hidden", "true", 1, "fa-solid", "fa-route"], ["title", "Attach file", 1, "attach-button-icon", 3, "click", "disabled"], [1, "fa-solid", "fa-paperclip"], ["aria-label", "Start a voice call", 1, "attach-button-icon", "voice-button-icon", 3, "click", "disabled", "title"], ["aria-hidden", "true", 1, "fa-solid", "fa-phone"], ["title", "Voice call options (choose agent and voice model)", "aria-label", "Voice call options", 1, "attach-button-icon", "voice-options-button-icon", 3, "click", "disabled"], ["aria-hidden", "true", 1, "fa-solid", "fa-chevron-down"]], template: function MessageInputBoxComponent_Template(rf, ctx) { if (rf & 1) {
256
266
  const _r1 = i0.ɵɵgetCurrentView();
257
267
  i0.ɵɵelementStart(0, "div", 1);
258
268
  i0.ɵɵlistener("click", function MessageInputBoxComponent_Template_div_click_0_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onContainerClick($event)); });
259
269
  i0.ɵɵelementStart(1, "div", 2)(2, "mj-mention-editor", 3, 0);
260
270
  i0.ɵɵtwoWayListener("ngModelChange", function MessageInputBoxComponent_Template_mj_mention_editor_ngModelChange_2_listener($event) { i0.ɵɵrestoreView(_r1); i0.ɵɵtwoWayBindingSet(ctx.value, $event) || (ctx.value = $event); return i0.ɵɵresetView($event); });
261
- i0.ɵɵlistener("valueChange", function MessageInputBoxComponent_Template_mj_mention_editor_valueChange_2_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onValueChange($event)); })("enterPressed", function MessageInputBoxComponent_Template_mj_mention_editor_enterPressed_2_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onEnterPressed($event)); })("mentionSelected", function MessageInputBoxComponent_Template_mj_mention_editor_mentionSelected_2_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onMentionSelected($event)); })("attachmentsChanged", function MessageInputBoxComponent_Template_mj_mention_editor_attachmentsChanged_2_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onAttachmentsChanged($event)); })("attachmentError", function MessageInputBoxComponent_Template_mj_mention_editor_attachmentError_2_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onAttachmentError($event)); })("attachmentClicked", function MessageInputBoxComponent_Template_mj_mention_editor_attachmentClicked_2_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onAttachmentClicked($event)); });
271
+ i0.ɵɵlistener("valueChange", function MessageInputBoxComponent_Template_mj_mention_editor_valueChange_2_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onValueChange($event)); })("enterPressed", function MessageInputBoxComponent_Template_mj_mention_editor_enterPressed_2_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onEnterPressed($event)); })("mentionSelected", function MessageInputBoxComponent_Template_mj_mention_editor_mentionSelected_2_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onMentionSelected($event)); })("attachmentsChanged", function MessageInputBoxComponent_Template_mj_mention_editor_attachmentsChanged_2_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onAttachmentsChanged($event)); })("attachmentError", function MessageInputBoxComponent_Template_mj_mention_editor_attachmentError_2_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onAttachmentError($event)); })("attachmentClicked", function MessageInputBoxComponent_Template_mj_mention_editor_attachmentClicked_2_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onAttachmentClicked($event)); })("editorBlurred", function MessageInputBoxComponent_Template_mj_mention_editor_editorBlurred_2_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.blurred.emit()); });
262
272
  i0.ɵɵelementEnd();
263
273
  i0.ɵɵconditionalCreate(4, MessageInputBoxComponent_Conditional_4_Template, 4, 3, "div", 4);
264
274
  i0.ɵɵelementStart(5, "button", 5);
@@ -277,7 +287,7 @@ export class MessageInputBoxComponent {
277
287
  }
278
288
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MessageInputBoxComponent, [{
279
289
  type: Component,
280
- args: [{ standalone: false, selector: 'mj-message-input-box', template: "<div class=\"message-input-box-container\" (click)=\"onContainerClick($event)\">\n <div class=\"input-wrapper\">\n <mj-mention-editor\n #mentionEditor\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [currentUser]=\"currentUser\"\n [enableMentions]=\"enableMentions\"\n [TriggerProviders]=\"TriggerProviders\"\n [ExcludedTriggerKeys]=\"ExcludedTriggerKeys\"\n [Provider]=\"Provider\"\n [enableAttachments]=\"enableAttachments\"\n [maxAttachments]=\"maxAttachments\"\n [maxAttachmentSizeBytes]=\"maxAttachmentSizeBytes\"\n [acceptedFileTypes]=\"acceptedFileTypes\"\n [(ngModel)]=\"value\"\n (valueChange)=\"onValueChange($event)\"\n (enterPressed)=\"onEnterPressed($event)\"\n (mentionSelected)=\"onMentionSelected($event)\"\n (attachmentsChanged)=\"onAttachmentsChanged($event)\"\n (attachmentError)=\"onAttachmentError($event)\"\n (attachmentClicked)=\"onAttachmentClicked($event)\">\n </mj-mention-editor>\n\n <!-- Attach + voice + plan-mode buttons - Positioned over editor -->\n @if (enableAttachments || enableRealtime || enablePlanMode) {\n <div class=\"attach-buttons\">\n @if (enablePlanMode) {\n <button\n class=\"attach-button-icon plan-mode-button-icon\"\n [class.plan-mode-button-icon--active]=\"planModeActive\"\n [disabled]=\"disabled\"\n [attr.aria-pressed]=\"planModeActive\"\n (click)=\"planModeToggle.emit(); $event.stopPropagation()\"\n [title]=\"planModeActive ? 'Plan Mode ON \u2014 the agent presents a plan for your approval before it acts' : 'Plan Mode: have the agent present a plan for your approval before it acts'\"\n aria-label=\"Toggle Plan Mode\"\n >\n <i class=\"fa-solid fa-route\" aria-hidden=\"true\"></i>\n </button>\n }\n @if (enableAttachments) {\n <button\n class=\"attach-button-icon\"\n [disabled]=\"disabled\"\n (click)=\"openFilePicker(); $event.stopPropagation()\"\n title=\"Attach file\"\n >\n <i class=\"fa-solid fa-paperclip\"></i>\n </button>\n }\n @if (enableRealtime) {\n <button\n class=\"attach-button-icon voice-button-icon\"\n [class.voice-button-icon--active]=\"voiceActive\"\n [disabled]=\"!canStartRealtime\"\n (click)=\"onRealtimeClick(); $event.stopPropagation()\"\n [title]=\"voiceActive ? 'Voice call active' : 'Start a voice call'\"\n aria-label=\"Start a voice call\"\n >\n <i class=\"fa-solid fa-phone\" aria-hidden=\"true\"></i>\n </button>\n <!-- Caret beside the phone: opens the agent/model picker so call OPTIONS stay one\n click away while the plain phone click keeps its instant-start behavior. -->\n <button\n class=\"attach-button-icon voice-options-button-icon\"\n [disabled]=\"!canStartRealtime\"\n (click)=\"onRealtimeOptionsClick(); $event.stopPropagation()\"\n title=\"Voice call options (choose agent and voice model)\"\n aria-label=\"Voice call options\"\n >\n <i class=\"fa-solid fa-chevron-down\" aria-hidden=\"true\"></i>\n </button>\n }\n </div>\n }\n\n <!-- Send Button (Icon Only) - Positioned over editor -->\n <button\n class=\"send-button-icon\"\n [disabled]=\"!canSend\"\n (click)=\"onSendClick()\"\n title=\"Send message (Enter)\"\n >\n <i class=\"fa-solid fa-paper-plane\"></i>\n </button>\n </div>\n</div>\n", styles: [".message-input-box-container {\n display: flex;\n flex-direction: column;\n background: var(--mj-bg-surface-card);\n border: 2px solid var(--mj-border-default);\n border-radius: 12px;\n box-shadow: var(--mj-shadow-sm);\n transition: all 0.2s ease;\n overflow: visible;\n position: relative;\n cursor: text;\n}\n.message-input-box-container:focus-within {\n border-color: var(--mj-brand-primary);\n box-shadow: 0 4px 16px color-mix(in srgb, var(--mj-brand-primary) 15%, transparent);\n}\n\n.input-wrapper {\n position: relative;\n display: flex;\n align-items: flex-end;\n padding: 5px;\n}\n.input-wrapper mj-mention-editor {\n flex: 1;\n display: block;\n}\n\n.message-input-box-textarea {\n flex: 1;\n min-height: 100px;\n padding: 1rem;\n padding-right: 3.5rem;\n border: 0 !important;\n outline: 0 !important;\n box-shadow: none !important;\n -webkit-appearance: none !important;\n -moz-appearance: none !important;\n appearance: none !important;\n font-family: inherit;\n font-size: 1rem;\n line-height: 1.5;\n resize: vertical;\n background: transparent;\n color: var(--mj-text-primary);\n border: 0 !important;\n}\n.message-input-box-textarea::placeholder {\n color: var(--mj-text-muted);\n}\n.message-input-box-textarea:disabled {\n cursor: not-allowed;\n opacity: 0.6;\n background: var(--mj-bg-surface-sunken);\n}\n.message-input-box-textarea:focus, .message-input-box-textarea:active, .message-input-box-textarea:focus-visible {\n outline: 0 !important;\n box-shadow: none !important;\n}\n\n.send-button-icon {\n position: absolute;\n bottom: 0.75rem;\n right: 0.75rem;\n width: 36px;\n height: 36px;\n display: flex;\n align-items: center;\n justify-content: center;\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n border: none;\n border-radius: 8px;\n cursor: pointer;\n transition: all 0.2s ease;\n flex-shrink: 0;\n}\n.send-button-icon i {\n font-size: 1rem;\n}\n.send-button-icon:hover:not(:disabled) {\n background: var(--mj-brand-primary-hover);\n transform: scale(1.05);\n}\n.send-button-icon:active:not(:disabled) {\n transform: scale(0.95);\n}\n.send-button-icon:disabled {\n background: var(--mj-border-default);\n color: var(--mj-text-muted);\n cursor: not-allowed;\n opacity: 0.5;\n}\n\n/* Attach buttons container */\n.attach-buttons {\n position: absolute;\n bottom: 0.75rem;\n right: 3rem;\n display: flex;\n gap: 2px;\n}\n.attach-button-icon {\n width: 36px;\n height: 36px;\n display: flex;\n align-items: center;\n justify-content: center;\n background: transparent;\n color: var(--mj-text-secondary);\n border: none;\n border-radius: 8px;\n cursor: pointer;\n transition: all 0.2s ease;\n flex-shrink: 0;\n}\n.attach-button-icon i {\n font-size: 1rem;\n}\n.attach-button-icon:hover:not(:disabled) {\n background: color-mix(in srgb, var(--mj-text-primary) 5%, transparent);\n color: var(--mj-brand-primary);\n transform: scale(1.05);\n}\n.attach-button-icon:active:not(:disabled) {\n transform: scale(0.95);\n}\n.attach-button-icon:disabled {\n color: var(--mj-text-muted);\n cursor: not-allowed;\n opacity: 0.5;\n}\n\n/* Plan Mode toggle \u2014 inherits .attach-button-icon; when active it fills with the brand color\n so the on/off state reads clearly at a glance (parallels the voice button's active state). */\n.plan-mode-button-icon--active:not(:disabled) {\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n}\n.plan-mode-button-icon--active:not(:disabled):hover {\n background: var(--mj-brand-primary-hover, var(--mj-brand-primary));\n color: var(--mj-text-inverse);\n}\n\n/* Mobile adjustments: 481px - 768px */\n@media (max-width: 768px) {\n .message-input-box-container {\n border-radius: 10px;\n box-shadow: 0 2px 8px color-mix(in srgb, var(--mj-text-primary) 6%, transparent);\n }\n .message-input-box-textarea {\n min-height: 80px;\n padding: 0.75rem;\n padding-right: 3rem;\n font-size: 16px;\n line-height: 1.4;\n }\n .send-button-icon {\n width: 32px;\n height: 32px;\n bottom: 0.625rem;\n right: 0.625rem;\n border-radius: 6px;\n }\n .send-button-icon i {\n font-size: 0.875rem;\n }\n .attach-buttons {\n bottom: 0.625rem;\n right: 2.75rem;\n }\n .attach-button-icon {\n width: 32px;\n height: 32px;\n }\n .attach-button-icon i {\n font-size: 0.875rem;\n }\n}\n/* Small Phone adjustments: <= 480px */\n@media (max-width: 480px) {\n .message-input-box-container {\n border-radius: 8px;\n border-width: 1.5px;\n }\n .message-input-box-textarea {\n min-height: 60px;\n padding: 0.625rem;\n padding-right: 2.75rem;\n font-size: 16px;\n line-height: 1.3;\n }\n .send-button-icon {\n width: 36px;\n height: 36px;\n bottom: 0.5rem;\n right: 0.5rem;\n border-radius: 6px;\n }\n .send-button-icon i {\n font-size: 0.875rem;\n }\n .attach-buttons {\n bottom: 0.5rem;\n right: 2.75rem;\n }\n .attach-button-icon {\n width: 32px;\n height: 32px;\n }\n .attach-button-icon i {\n font-size: 0.875rem;\n }\n}\n\n/* Voice call button \u2014 a phone icon in the attach-buttons cluster, left of send.\n Inherits .attach-button-icon base. Subtle brand glow on hover; active state (call\n live) renders a brand-color tint. The orb visual now lives ONLY inside the call\n overlay's banner. */\n.voice-button-icon i {\n color: var(--mj-brand-primary);\n}\n.voice-button-icon:hover:not(:disabled) i {\n filter: drop-shadow(0 0 4px color-mix(in srgb, var(--mj-brand-primary) 55%, transparent));\n}\n.voice-button-icon:disabled i {\n color: var(--mj-text-disabled);\n}\n.voice-button-icon--active {\n background: color-mix(in srgb, var(--mj-brand-primary) 12%, transparent);\n}\n.voice-button-icon--active:hover:not(:disabled) {\n background: color-mix(in srgb, var(--mj-brand-primary) 18%, transparent);\n}\n\n/* Voice OPTIONS caret \u2014 a slim chevron hugging the phone button. Opens the agent/model\n picker; intentionally quieter (smaller icon, narrower hit area) than the phone so the\n common instant-start click stays the visual primary. */\n.voice-options-button-icon {\n width: 20px;\n margin-left: -4px;\n}\n.voice-options-button-icon i {\n font-size: 0.7rem;\n color: var(--mj-text-muted);\n}\n.voice-options-button-icon:hover:not(:disabled) i {\n color: var(--mj-brand-primary);\n}\n.voice-options-button-icon:disabled i {\n color: var(--mj-text-disabled);\n}\n"] }]
290
+ args: [{ standalone: false, selector: 'mj-message-input-box', template: "<div class=\"message-input-box-container\" (click)=\"onContainerClick($event)\">\n <div class=\"input-wrapper\">\n <mj-mention-editor\n #mentionEditor\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [currentUser]=\"currentUser\"\n [enableMentions]=\"enableMentions\"\n [TriggerProviders]=\"TriggerProviders\"\n [ExcludedTriggerKeys]=\"ExcludedTriggerKeys\"\n [Provider]=\"Provider\"\n [enableAttachments]=\"enableAttachments\"\n [maxAttachments]=\"maxAttachments\"\n [maxAttachmentSizeBytes]=\"maxAttachmentSizeBytes\"\n [acceptedFileTypes]=\"acceptedFileTypes\"\n [(ngModel)]=\"value\"\n (valueChange)=\"onValueChange($event)\"\n (enterPressed)=\"onEnterPressed($event)\"\n (mentionSelected)=\"onMentionSelected($event)\"\n (attachmentsChanged)=\"onAttachmentsChanged($event)\"\n (attachmentError)=\"onAttachmentError($event)\"\n (attachmentClicked)=\"onAttachmentClicked($event)\"\n (editorBlurred)=\"blurred.emit()\">\n </mj-mention-editor>\n\n <!-- Attach + voice + plan-mode buttons - Positioned over editor -->\n @if (enableAttachments || enableRealtime || enablePlanMode) {\n <div class=\"attach-buttons\">\n @if (enablePlanMode) {\n <button\n class=\"attach-button-icon plan-mode-button-icon\"\n [class.plan-mode-button-icon--active]=\"planModeActive\"\n [disabled]=\"disabled\"\n [attr.aria-pressed]=\"planModeActive\"\n (click)=\"planModeToggle.emit(); $event.stopPropagation()\"\n [title]=\"planModeActive ? 'Plan Mode ON \u2014 the agent presents a plan for your approval before it acts' : 'Plan Mode: have the agent present a plan for your approval before it acts'\"\n aria-label=\"Toggle Plan Mode\"\n >\n <i class=\"fa-solid fa-route\" aria-hidden=\"true\"></i>\n </button>\n }\n @if (enableAttachments) {\n <button\n class=\"attach-button-icon\"\n [disabled]=\"disabled\"\n (click)=\"openFilePicker(); $event.stopPropagation()\"\n title=\"Attach file\"\n >\n <i class=\"fa-solid fa-paperclip\"></i>\n </button>\n }\n @if (enableRealtime) {\n <button\n class=\"attach-button-icon voice-button-icon\"\n [class.voice-button-icon--active]=\"voiceActive\"\n [disabled]=\"!canStartRealtime\"\n (click)=\"onRealtimeClick(); $event.stopPropagation()\"\n [title]=\"voiceActive ? 'Voice call active' : 'Start a voice call'\"\n aria-label=\"Start a voice call\"\n >\n <i class=\"fa-solid fa-phone\" aria-hidden=\"true\"></i>\n </button>\n <!-- Caret beside the phone: opens the agent/model picker so call OPTIONS stay one\n click away while the plain phone click keeps its instant-start behavior. -->\n <button\n class=\"attach-button-icon voice-options-button-icon\"\n [disabled]=\"!canStartRealtime\"\n (click)=\"onRealtimeOptionsClick(); $event.stopPropagation()\"\n title=\"Voice call options (choose agent and voice model)\"\n aria-label=\"Voice call options\"\n >\n <i class=\"fa-solid fa-chevron-down\" aria-hidden=\"true\"></i>\n </button>\n }\n </div>\n }\n\n <!-- Send Button (Icon Only) - Positioned over editor -->\n <button\n class=\"send-button-icon\"\n [disabled]=\"!canSend\"\n (click)=\"onSendClick()\"\n title=\"Send message (Enter)\"\n >\n <i class=\"fa-solid fa-paper-plane\"></i>\n </button>\n </div>\n</div>\n", styles: [".message-input-box-container {\n display: flex;\n flex-direction: column;\n background: var(--mj-bg-surface-card);\n border: 2px solid var(--mj-border-default);\n border-radius: 12px;\n box-shadow: var(--mj-shadow-sm);\n transition: all 0.2s ease;\n overflow: visible;\n position: relative;\n cursor: text;\n}\n.message-input-box-container:focus-within {\n border-color: var(--mj-brand-primary);\n box-shadow: 0 4px 16px color-mix(in srgb, var(--mj-brand-primary) 15%, transparent);\n}\n\n.input-wrapper {\n position: relative;\n display: flex;\n align-items: flex-end;\n padding: 5px;\n}\n.input-wrapper mj-mention-editor {\n flex: 1;\n display: block;\n}\n\n.message-input-box-textarea {\n flex: 1;\n min-height: 100px;\n padding: 1rem;\n padding-right: 3.5rem;\n border: 0 !important;\n outline: 0 !important;\n box-shadow: none !important;\n -webkit-appearance: none !important;\n -moz-appearance: none !important;\n appearance: none !important;\n font-family: inherit;\n font-size: 1rem;\n line-height: 1.5;\n resize: vertical;\n background: transparent;\n color: var(--mj-text-primary);\n border: 0 !important;\n}\n.message-input-box-textarea::placeholder {\n color: var(--mj-text-muted);\n}\n.message-input-box-textarea:disabled {\n cursor: not-allowed;\n opacity: 0.6;\n background: var(--mj-bg-surface-sunken);\n}\n.message-input-box-textarea:focus, .message-input-box-textarea:active, .message-input-box-textarea:focus-visible {\n outline: 0 !important;\n box-shadow: none !important;\n}\n\n.send-button-icon {\n position: absolute;\n bottom: 0.75rem;\n right: 0.75rem;\n width: 36px;\n height: 36px;\n display: flex;\n align-items: center;\n justify-content: center;\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n border: none;\n border-radius: 8px;\n cursor: pointer;\n transition: all 0.2s ease;\n flex-shrink: 0;\n}\n.send-button-icon i {\n font-size: 1rem;\n}\n.send-button-icon:hover:not(:disabled) {\n background: var(--mj-brand-primary-hover);\n transform: scale(1.05);\n}\n.send-button-icon:active:not(:disabled) {\n transform: scale(0.95);\n}\n.send-button-icon:disabled {\n background: var(--mj-border-default);\n color: var(--mj-text-muted);\n cursor: not-allowed;\n opacity: 0.5;\n}\n\n/* Attach buttons container */\n.attach-buttons {\n position: absolute;\n bottom: 0.75rem;\n right: 3rem;\n display: flex;\n gap: 2px;\n}\n.attach-button-icon {\n width: 36px;\n height: 36px;\n display: flex;\n align-items: center;\n justify-content: center;\n background: transparent;\n color: var(--mj-text-secondary);\n border: none;\n border-radius: 8px;\n cursor: pointer;\n transition: all 0.2s ease;\n flex-shrink: 0;\n}\n.attach-button-icon i {\n font-size: 1rem;\n}\n.attach-button-icon:hover:not(:disabled) {\n background: color-mix(in srgb, var(--mj-text-primary) 5%, transparent);\n color: var(--mj-brand-primary);\n transform: scale(1.05);\n}\n.attach-button-icon:active:not(:disabled) {\n transform: scale(0.95);\n}\n.attach-button-icon:disabled {\n color: var(--mj-text-muted);\n cursor: not-allowed;\n opacity: 0.5;\n}\n\n/* Plan Mode toggle \u2014 inherits .attach-button-icon; when active it fills with the brand color\n so the on/off state reads clearly at a glance (parallels the voice button's active state). */\n.plan-mode-button-icon--active:not(:disabled) {\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n}\n.plan-mode-button-icon--active:not(:disabled):hover {\n background: var(--mj-brand-primary-hover, var(--mj-brand-primary));\n color: var(--mj-text-inverse);\n}\n\n/* Mobile adjustments: 481px - 768px */\n@media (max-width: 768px) {\n .message-input-box-container {\n border-radius: 10px;\n box-shadow: 0 2px 8px color-mix(in srgb, var(--mj-text-primary) 6%, transparent);\n }\n .message-input-box-textarea {\n min-height: 80px;\n padding: 0.75rem;\n padding-right: 3rem;\n font-size: 16px;\n line-height: 1.4;\n }\n .send-button-icon {\n width: 32px;\n height: 32px;\n bottom: 0.625rem;\n right: 0.625rem;\n border-radius: 6px;\n }\n .send-button-icon i {\n font-size: 0.875rem;\n }\n .attach-buttons {\n bottom: 0.625rem;\n right: 2.75rem;\n }\n .attach-button-icon {\n width: 32px;\n height: 32px;\n }\n .attach-button-icon i {\n font-size: 0.875rem;\n }\n}\n/* Small Phone adjustments: <= 480px */\n@media (max-width: 480px) {\n .message-input-box-container {\n border-radius: 8px;\n border-width: 1.5px;\n }\n .message-input-box-textarea {\n min-height: 60px;\n padding: 0.625rem;\n padding-right: 2.75rem;\n font-size: 16px;\n line-height: 1.3;\n }\n .send-button-icon {\n width: 36px;\n height: 36px;\n bottom: 0.5rem;\n right: 0.5rem;\n border-radius: 6px;\n }\n .send-button-icon i {\n font-size: 0.875rem;\n }\n .attach-buttons {\n bottom: 0.5rem;\n right: 2.75rem;\n }\n .attach-button-icon {\n width: 32px;\n height: 32px;\n }\n .attach-button-icon i {\n font-size: 0.875rem;\n }\n}\n\n/* Voice call button \u2014 a phone icon in the attach-buttons cluster, left of send.\n Inherits .attach-button-icon base. Subtle brand glow on hover; active state (call\n live) renders a brand-color tint. The orb visual now lives ONLY inside the call\n overlay's banner. */\n.voice-button-icon i {\n color: var(--mj-brand-primary);\n}\n.voice-button-icon:hover:not(:disabled) i {\n filter: drop-shadow(0 0 4px color-mix(in srgb, var(--mj-brand-primary) 55%, transparent));\n}\n.voice-button-icon:disabled i {\n color: var(--mj-text-disabled);\n}\n.voice-button-icon--active {\n background: color-mix(in srgb, var(--mj-brand-primary) 12%, transparent);\n}\n.voice-button-icon--active:hover:not(:disabled) {\n background: color-mix(in srgb, var(--mj-brand-primary) 18%, transparent);\n}\n\n/* Voice OPTIONS caret \u2014 a slim chevron hugging the phone button. Opens the agent/model\n picker; intentionally quieter (smaller icon, narrower hit area) than the phone so the\n common instant-start click stays the visual primary. */\n.voice-options-button-icon {\n width: 20px;\n margin-left: -4px;\n}\n.voice-options-button-icon i {\n font-size: 0.7rem;\n color: var(--mj-text-muted);\n}\n.voice-options-button-icon:hover:not(:disabled) i {\n color: var(--mj-brand-primary);\n}\n.voice-options-button-icon:disabled i {\n color: var(--mj-text-disabled);\n}\n"] }]
281
291
  }], null, { mentionEditor: [{
282
292
  type: ViewChild,
283
293
  args: ['mentionEditor']
@@ -319,6 +329,8 @@ export class MessageInputBoxComponent {
319
329
  type: Input
320
330
  }], planModeActive: [{
321
331
  type: Input
332
+ }], blurred: [{
333
+ type: Output
322
334
  }], textSubmitted: [{
323
335
  type: Output
324
336
  }], valueChange: [{
@@ -1 +1 @@
1
- {"version":3,"file":"message-input-box.component.js","sourceRoot":"","sources":["../../../../src/lib/components/message/message-input-box.component.ts","../../../../src/lib/components/message/message-input-box.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;;;;;;;IC4B1E,iCAQG;IAHD,2LAAS,4BAAqB,wBAAE,wBAAwB,KAAC;IAIzD,wBAAoD;IACtD,iBAAS;;;IARP,sEAAsD;IAItD,AAHA,0CAAqB,iMAG+J;;;;;IAOtL,kCAKG;IAFD,2LAAS,uBAAgB,wBAAE,wBAAwB,KAAC;IAGpD,wBAAqC;IACvC,iBAAS;;;IALP,0CAAqB;;;;IAQvB,kCAOG;IAHD,2LAAS,wBAAiB,wBAAE,wBAAwB,KAAC;IAIrD,wBAAoD;IACtD,iBAAS;IAGT,kCAMG;IAHD,2LAAS,+BAAwB,wBAAE,wBAAwB,KAAC;IAI5D,wBAA2D;IAC7D,iBAAS;;;IAlBP,+DAA+C;IAG/C,AAFA,mDAA8B,0EAEoC;IASlE,eAA8B;IAA9B,mDAA8B;;;IAvClC,8BAA4B;IAC1B,2GAAsB;IAatB,2GAAyB;IAUzB,8FAAsB;IAuBxB,iBAAM;;;IA9CJ,cAYC;IAZD,gDAYC;IACD,cASC;IATD,mDASC;IACD,cAsBC;IAtBD,gDAsBC;;ADnET;;;;;;;;;;;;;;GAcG;AAOH,MAAM,OAAO,wBAAwB;IACP,aAAa,CAA0B;IAE1D,WAAW,GAAW,kDAAkD,CAAC;IACzE,QAAQ,GAAY,KAAK,CAAC;IAC1B,KAAK,GAAW,EAAE,CAAC;IACnB,kBAAkB,GAAY,KAAK,CAAC;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AK;;kBACL,KAAK;;kBACL,KAAK;;kBAGL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAGL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAEL,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBAEN,MAAM;;kBAMN,MAAM;;kBAEN,MAAM;;kFAjDI,wBAAwB","sourcesContent":["import { Component, Input, Output, EventEmitter, ViewChild } from '@angular/core';\nimport { IMetadataProvider, UserInfo } from '@memberjunction/core';\nimport { ComposerTriggerProvider, MentionSuggestion } from '../../composer-trigger-provider';\nimport { MentionEditorComponent, PendingAttachment } from '../mention/mention-editor.component';\n\n/**\n * Reusable message input box component (presentational)\n * Now uses MentionEditorComponent for rich @mention functionality with chips\n *\n * Handles:\n * - Text input with keyboard shortcuts via MentionEditorComponent\n * - @mention autocomplete with visual chips (contentEditable)\n * - Send button\n *\n * Does NOT handle:\n * - Saving messages to database\n * - Agent invocation\n * - Artifact creation\n * - Conversation management\n */\n@Component({\n standalone: false,\n selector: 'mj-message-input-box',\n templateUrl: './message-input-box.component.html',\n styleUrls: ['./message-input-box.component.css']\n})\nexport class MessageInputBoxComponent {\n @ViewChild('mentionEditor') mentionEditor?: MentionEditorComponent;\n\n @Input() placeholder: string = 'Type your message to start a new conversation...';\n @Input() disabled: boolean = false;\n @Input() value: string = '';\n @Input() showCharacterCount: boolean = false;\n /** Master switch for all mention/command triggers (pass-through to the mention editor). */\n @Input() enableMentions: boolean = true;\n /** Explicit trigger-provider list (pass-through to the mention editor; explicit list wins over discovery). */\n @Input() TriggerProviders: ComposerTriggerProvider[] | null = null;\n /** Discovery-mode filter: provider Keys to skip (pass-through to the mention editor). */\n @Input() ExcludedTriggerKeys: string[] = [];\n /** Optional metadata provider scoping this composer (pass-through to the mention editor). */\n @Input() Provider: IMetadataProvider | null = null;\n @Input() currentUser?: UserInfo;\n @Input() rows: number = 3;\n\n // Attachment settings\n @Input() enableAttachments: boolean = true;\n @Input() maxAttachments: number = 10;\n @Input() maxAttachmentSizeBytes: number = 20 * 1024 * 1024; // 20MB\n @Input() acceptedFileTypes: string = 'image/*';\n\n /** Shows the in-composer mic button when true. */\n @Input() enableRealtime: boolean = false;\n /** Whether a realtime voice session is currently active (mic renders in its active state). */\n @Input() voiceActive: boolean = false;\n /** Whether a voice session can be started right now (mic disabled when false). */\n @Input() canStartRealtime: boolean = true;\n /** Shows the in-composer Plan Mode toggle button when true. */\n @Input() enablePlanMode: boolean = false;\n /** Current Plan Mode toggle state (renders the button in its active state). */\n @Input() planModeActive: boolean = false;\n\n @Output() textSubmitted = new EventEmitter<string>();\n @Output() valueChange = new EventEmitter<string>();\n @Output() attachmentsChanged = new EventEmitter<PendingAttachment[]>();\n @Output() attachmentError = new EventEmitter<string>();\n @Output() attachmentClicked = new EventEmitter<PendingAttachment>();\n /** Emitted when the user clicks the mic button to start/stop a voice session. */\n @Output() voiceRequested = new EventEmitter<void>();\n /**\n * Emitted when the user clicks the small caret next to the phone button — the host opens the\n * voice agent/model picker so call options (which agent, which voice model) stay reachable\n * without adding friction to the plain phone click's instant-start path.\n */\n @Output() voiceOptionsRequested = new EventEmitter<void>();\n /** Emitted when the user clicks the in-composer Plan Mode toggle button. */\n @Output() planModeToggle = new EventEmitter<void>();\n\n onRealtimeClick(): void {\n this.voiceRequested.emit();\n }\n\n onRealtimeOptionsClick(): void {\n this.voiceOptionsRequested.emit();\n }\n\n get canSend(): boolean {\n const hasText = this.value.trim().length > 0;\n const hasAttachments = this.mentionEditor?.hasAttachments() || false;\n return !this.disabled && (hasText || hasAttachments);\n }\n\n /**\n * Handle value changes from MentionEditorComponent\n */\n onValueChange(newValue: string): void {\n this.value = newValue;\n this.valueChange.emit(this.value);\n }\n\n /**\n * Handle attachment changes from MentionEditorComponent\n */\n onAttachmentsChanged(attachments: PendingAttachment[]): void {\n this.attachmentsChanged.emit(attachments);\n }\n\n /**\n * Handle attachment errors from MentionEditorComponent\n */\n onAttachmentError(error: string): void {\n this.attachmentError.emit(error);\n }\n\n /**\n * Handle attachment click from MentionEditorComponent\n */\n onAttachmentClicked(attachment: PendingAttachment): void {\n this.attachmentClicked.emit(attachment);\n }\n\n /**\n * Handle Enter key from MentionEditorComponent\n * Extracts plain text with JSON-encoded mentions for message submission\n */\n onEnterPressed(_text: string): void {\n this.onSendClick();\n }\n\n /**\n * Handle mention selection from MentionEditorComponent\n */\n onMentionSelected(suggestion: MentionSuggestion): void {\n // MentionEditorComponent already inserts the mention chip\n // This is just for additional tracking/analytics if needed\n }\n\n /**\n * Send the message\n * Extracts plain text with JSON-encoded mentions for proper persistence\n */\n onSendClick(): void {\n if (this.canSend) {\n // Get plain text with JSON-encoded mentions (preserves configuration info)\n const textToSend = this.mentionEditor?.getPlainTextWithJsonMentions() || this.value.trim();\n this.textSubmitted.emit(textToSend);\n this.value = ''; // Clear input after sending\n\n // Clear the editor content\n if (this.mentionEditor) {\n this.mentionEditor.clear();\n }\n\n this.valueChange.emit(this.value);\n }\n }\n\n /**\n * Handle clicks on the container - focus the mention editor\n * Only moves cursor to end if clicking outside the contentEditable area\n */\n onContainerClick(event: MouseEvent): void {\n const target = event.target as HTMLElement;\n\n // Don't handle clicks on the send button\n if (target.closest('.send-button-icon')) {\n return;\n }\n\n const editor = this.mentionEditor?.editorRef?.nativeElement;\n if (!editor) return;\n\n // If clicking directly on the editor or its children, let the browser handle cursor placement\n if (target === editor || editor.contains(target)) {\n return;\n }\n\n // Only if clicking on the container (empty space), focus and move cursor to end\n editor.focus();\n const selection = window.getSelection();\n const range = document.createRange();\n\n if (selection) {\n range.selectNodeContents(editor);\n range.collapse(false); // Collapse to end\n selection.removeAllRanges();\n selection.addRange(range);\n }\n }\n\n /**\n * Public method to focus the input programmatically\n */\n focus(): void {\n const editor = this.mentionEditor?.editorRef?.nativeElement;\n if (editor) {\n editor.focus();\n }\n }\n\n /**\n * Get mention chip data including configuration presets\n */\n getMentionChipsData(): Array<{ id: string; type: string; name: string; presetId?: string; presetName?: string }> {\n return this.mentionEditor?.getMentionChipsData() || [];\n }\n\n /**\n * Get pending attachments from the editor\n */\n getPendingAttachments(): PendingAttachment[] {\n return this.mentionEditor?.getPendingAttachments() || [];\n }\n\n /**\n * Open file picker programmatically\n */\n openFilePicker(): void {\n this.mentionEditor?.openFilePicker();\n }\n\n /**\n * Add an artifact as a pending attachment (called by parent after artifact selection)\n */\n AddArtifactAttachment(artifact: {\n fileID: string; fileName: string; mimeType: string;\n sizeBytes: number; artifactVersionId?: string;\n }): PendingAttachment | undefined {\n return this.mentionEditor?.AddArtifactAttachment(artifact);\n }\n}\n","<div class=\"message-input-box-container\" (click)=\"onContainerClick($event)\">\n <div class=\"input-wrapper\">\n <mj-mention-editor\n #mentionEditor\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [currentUser]=\"currentUser\"\n [enableMentions]=\"enableMentions\"\n [TriggerProviders]=\"TriggerProviders\"\n [ExcludedTriggerKeys]=\"ExcludedTriggerKeys\"\n [Provider]=\"Provider\"\n [enableAttachments]=\"enableAttachments\"\n [maxAttachments]=\"maxAttachments\"\n [maxAttachmentSizeBytes]=\"maxAttachmentSizeBytes\"\n [acceptedFileTypes]=\"acceptedFileTypes\"\n [(ngModel)]=\"value\"\n (valueChange)=\"onValueChange($event)\"\n (enterPressed)=\"onEnterPressed($event)\"\n (mentionSelected)=\"onMentionSelected($event)\"\n (attachmentsChanged)=\"onAttachmentsChanged($event)\"\n (attachmentError)=\"onAttachmentError($event)\"\n (attachmentClicked)=\"onAttachmentClicked($event)\">\n </mj-mention-editor>\n\n <!-- Attach + voice + plan-mode buttons - Positioned over editor -->\n @if (enableAttachments || enableRealtime || enablePlanMode) {\n <div class=\"attach-buttons\">\n @if (enablePlanMode) {\n <button\n class=\"attach-button-icon plan-mode-button-icon\"\n [class.plan-mode-button-icon--active]=\"planModeActive\"\n [disabled]=\"disabled\"\n [attr.aria-pressed]=\"planModeActive\"\n (click)=\"planModeToggle.emit(); $event.stopPropagation()\"\n [title]=\"planModeActive ? 'Plan Mode ON — the agent presents a plan for your approval before it acts' : 'Plan Mode: have the agent present a plan for your approval before it acts'\"\n aria-label=\"Toggle Plan Mode\"\n >\n <i class=\"fa-solid fa-route\" aria-hidden=\"true\"></i>\n </button>\n }\n @if (enableAttachments) {\n <button\n class=\"attach-button-icon\"\n [disabled]=\"disabled\"\n (click)=\"openFilePicker(); $event.stopPropagation()\"\n title=\"Attach file\"\n >\n <i class=\"fa-solid fa-paperclip\"></i>\n </button>\n }\n @if (enableRealtime) {\n <button\n class=\"attach-button-icon voice-button-icon\"\n [class.voice-button-icon--active]=\"voiceActive\"\n [disabled]=\"!canStartRealtime\"\n (click)=\"onRealtimeClick(); $event.stopPropagation()\"\n [title]=\"voiceActive ? 'Voice call active' : 'Start a voice call'\"\n aria-label=\"Start a voice call\"\n >\n <i class=\"fa-solid fa-phone\" aria-hidden=\"true\"></i>\n </button>\n <!-- Caret beside the phone: opens the agent/model picker so call OPTIONS stay one\n click away while the plain phone click keeps its instant-start behavior. -->\n <button\n class=\"attach-button-icon voice-options-button-icon\"\n [disabled]=\"!canStartRealtime\"\n (click)=\"onRealtimeOptionsClick(); $event.stopPropagation()\"\n title=\"Voice call options (choose agent and voice model)\"\n aria-label=\"Voice call options\"\n >\n <i class=\"fa-solid fa-chevron-down\" aria-hidden=\"true\"></i>\n </button>\n }\n </div>\n }\n\n <!-- Send Button (Icon Only) - Positioned over editor -->\n <button\n class=\"send-button-icon\"\n [disabled]=\"!canSend\"\n (click)=\"onSendClick()\"\n title=\"Send message (Enter)\"\n >\n <i class=\"fa-solid fa-paper-plane\"></i>\n </button>\n </div>\n</div>\n"]}
1
+ {"version":3,"file":"message-input-box.component.js","sourceRoot":"","sources":["../../../../src/lib/components/message/message-input-box.component.ts","../../../../src/lib/components/message/message-input-box.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE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,KAAK;;kBAEL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAGL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAGL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAGL,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBAEN,MAAM;;kBAMN,MAAM;;kBAEN,MAAM;;kFAnDI,wBAAwB","sourcesContent":["import { Component, Input, Output, EventEmitter, ViewChild } from '@angular/core';\nimport { IMetadataProvider, UserInfo } from '@memberjunction/core';\nimport { ComposerTriggerProvider, MentionSuggestion } from '../../composer-trigger-provider';\nimport { MentionEditorComponent, PendingAttachment } from '../mention/mention-editor.component';\n\n/**\n * Reusable message input box component (presentational)\n * Now uses MentionEditorComponent for rich @mention functionality with chips\n *\n * Handles:\n * - Text input with keyboard shortcuts via MentionEditorComponent\n * - @mention autocomplete with visual chips (contentEditable)\n * - Send button\n *\n * Does NOT handle:\n * - Saving messages to database\n * - Agent invocation\n * - Artifact creation\n * - Conversation management\n */\n@Component({\n standalone: false,\n selector: 'mj-message-input-box',\n templateUrl: './message-input-box.component.html',\n styleUrls: ['./message-input-box.component.css']\n})\nexport class MessageInputBoxComponent {\n @ViewChild('mentionEditor') mentionEditor?: MentionEditorComponent;\n\n @Input() placeholder: string = 'Type your message to start a new conversation...';\n @Input() disabled: boolean = false;\n @Input() value: string = '';\n @Input() showCharacterCount: boolean = false;\n /** Master switch for all mention/command triggers (pass-through to the mention editor). */\n @Input() enableMentions: boolean = true;\n /** Explicit trigger-provider list (pass-through to the mention editor; explicit list wins over discovery). */\n @Input() TriggerProviders: ComposerTriggerProvider[] | null = null;\n /** Discovery-mode filter: provider Keys to skip (pass-through to the mention editor). */\n @Input() ExcludedTriggerKeys: string[] = [];\n /** Optional metadata provider scoping this composer (pass-through to the mention editor). */\n @Input() Provider: IMetadataProvider | null = null;\n @Input() currentUser?: UserInfo;\n @Input() rows: number = 3;\n\n // Attachment settings\n @Input() enableAttachments: boolean = true;\n @Input() maxAttachments: number = 10;\n @Input() maxAttachmentSizeBytes: number = 20 * 1024 * 1024; // 20MB\n @Input() acceptedFileTypes: string = 'image/*';\n\n /** Shows the in-composer mic button when true. */\n @Input() enableRealtime: boolean = false;\n /** Whether a realtime voice session is currently active (mic renders in its active state). */\n @Input() voiceActive: boolean = false;\n /** Whether a voice session can be started right now (mic disabled when false). */\n @Input() canStartRealtime: boolean = true;\n /** Shows the in-composer Plan Mode toggle button when true. */\n @Input() enablePlanMode: boolean = false;\n /** Current Plan Mode toggle state (renders the button in its active state). */\n @Input() planModeActive: boolean = false;\n\n /** Composer lost focus — hosts persist drafts on this. */\n @Output() blurred = new EventEmitter<void>();\n @Output() textSubmitted = new EventEmitter<string>();\n @Output() valueChange = new EventEmitter<string>();\n @Output() attachmentsChanged = new EventEmitter<PendingAttachment[]>();\n @Output() attachmentError = new EventEmitter<string>();\n @Output() attachmentClicked = new EventEmitter<PendingAttachment>();\n /** Emitted when the user clicks the mic button to start/stop a voice session. */\n @Output() voiceRequested = new EventEmitter<void>();\n /**\n * Emitted when the user clicks the small caret next to the phone button — the host opens the\n * voice agent/model picker so call options (which agent, which voice model) stay reachable\n * without adding friction to the plain phone click's instant-start path.\n */\n @Output() voiceOptionsRequested = new EventEmitter<void>();\n /** Emitted when the user clicks the in-composer Plan Mode toggle button. */\n @Output() planModeToggle = new EventEmitter<void>();\n\n onRealtimeClick(): void {\n this.voiceRequested.emit();\n }\n\n onRealtimeOptionsClick(): void {\n this.voiceOptionsRequested.emit();\n }\n\n get canSend(): boolean {\n const hasText = this.value.trim().length > 0;\n const hasAttachments = this.mentionEditor?.hasAttachments() || false;\n return !this.disabled && (hasText || hasAttachments);\n }\n\n /**\n * Handle value changes from MentionEditorComponent\n */\n onValueChange(newValue: string): void {\n this.value = newValue;\n this.valueChange.emit(this.value);\n }\n\n /**\n * Handle attachment changes from MentionEditorComponent\n */\n onAttachmentsChanged(attachments: PendingAttachment[]): void {\n this.attachmentsChanged.emit(attachments);\n }\n\n /**\n * Handle attachment errors from MentionEditorComponent\n */\n onAttachmentError(error: string): void {\n this.attachmentError.emit(error);\n }\n\n /**\n * Handle attachment click from MentionEditorComponent\n */\n onAttachmentClicked(attachment: PendingAttachment): void {\n this.attachmentClicked.emit(attachment);\n }\n\n /**\n * Handle Enter key from MentionEditorComponent\n * Extracts plain text with JSON-encoded mentions for message submission\n */\n onEnterPressed(_text: string): void {\n this.onSendClick();\n }\n\n /**\n * Handle mention selection from MentionEditorComponent\n */\n onMentionSelected(suggestion: MentionSuggestion): void {\n // MentionEditorComponent already inserts the mention chip\n // This is just for additional tracking/analytics if needed\n }\n\n /**\n * Send the message\n * Extracts plain text with JSON-encoded mentions for proper persistence\n */\n onSendClick(): void {\n if (this.canSend) {\n // Get plain text with JSON-encoded mentions (preserves configuration info)\n const textToSend = this.mentionEditor?.getPlainTextWithJsonMentions() || this.value.trim();\n this.textSubmitted.emit(textToSend);\n this.value = ''; // Clear input after sending\n\n // Clear the editor content\n if (this.mentionEditor) {\n this.mentionEditor.clear();\n }\n\n this.valueChange.emit(this.value);\n }\n }\n\n /**\n * Handle clicks on the container - focus the mention editor\n * Only moves cursor to end if clicking outside the contentEditable area\n */\n onContainerClick(event: MouseEvent): void {\n const target = event.target as HTMLElement;\n\n // Don't handle clicks on the send button\n if (target.closest('.send-button-icon')) {\n return;\n }\n\n const editor = this.mentionEditor?.editorRef?.nativeElement;\n if (!editor) return;\n\n // If clicking directly on the editor or its children, let the browser handle cursor placement\n if (target === editor || editor.contains(target)) {\n return;\n }\n\n // Only if clicking on the container (empty space), focus and move cursor to end\n editor.focus();\n const selection = window.getSelection();\n const range = document.createRange();\n\n if (selection) {\n range.selectNodeContents(editor);\n range.collapse(false); // Collapse to end\n selection.removeAllRanges();\n selection.addRange(range);\n }\n }\n\n /**\n * Public method to focus the input programmatically\n */\n /** Inserts a resolved mention chip + space and focuses (see MentionEditorComponent.InsertMention). */\n InsertMention(suggestion: MentionSuggestion, focus: boolean = true): boolean {\n return this.mentionEditor?.InsertMention(suggestion, focus) ?? false;\n }\n\n /** Focus with the caret at the end of content (see MentionEditorComponent.FocusCaretAtEnd). */\n FocusCaretAtEnd(): boolean {\n return this.mentionEditor?.FocusCaretAtEnd() ?? false;\n }\n\n focus(): void {\n const editor = this.mentionEditor?.editorRef?.nativeElement;\n if (editor) {\n editor.focus();\n }\n }\n\n /**\n * Get mention chip data including configuration presets\n */\n getMentionChipsData(): Array<{ id: string; type: string; name: string; presetId?: string; presetName?: string }> {\n return this.mentionEditor?.getMentionChipsData() || [];\n }\n\n /**\n * Get pending attachments from the editor\n */\n getPendingAttachments(): PendingAttachment[] {\n return this.mentionEditor?.getPendingAttachments() || [];\n }\n\n /**\n * Open file picker programmatically\n */\n openFilePicker(): void {\n this.mentionEditor?.openFilePicker();\n }\n\n /**\n * Add an artifact as a pending attachment (called by parent after artifact selection)\n */\n AddArtifactAttachment(artifact: {\n fileID: string; fileName: string; mimeType: string;\n sizeBytes: number; artifactVersionId?: string;\n }): PendingAttachment | undefined {\n return this.mentionEditor?.AddArtifactAttachment(artifact);\n }\n}\n","<div class=\"message-input-box-container\" (click)=\"onContainerClick($event)\">\n <div class=\"input-wrapper\">\n <mj-mention-editor\n #mentionEditor\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [currentUser]=\"currentUser\"\n [enableMentions]=\"enableMentions\"\n [TriggerProviders]=\"TriggerProviders\"\n [ExcludedTriggerKeys]=\"ExcludedTriggerKeys\"\n [Provider]=\"Provider\"\n [enableAttachments]=\"enableAttachments\"\n [maxAttachments]=\"maxAttachments\"\n [maxAttachmentSizeBytes]=\"maxAttachmentSizeBytes\"\n [acceptedFileTypes]=\"acceptedFileTypes\"\n [(ngModel)]=\"value\"\n (valueChange)=\"onValueChange($event)\"\n (enterPressed)=\"onEnterPressed($event)\"\n (mentionSelected)=\"onMentionSelected($event)\"\n (attachmentsChanged)=\"onAttachmentsChanged($event)\"\n (attachmentError)=\"onAttachmentError($event)\"\n (attachmentClicked)=\"onAttachmentClicked($event)\"\n (editorBlurred)=\"blurred.emit()\">\n </mj-mention-editor>\n\n <!-- Attach + voice + plan-mode buttons - Positioned over editor -->\n @if (enableAttachments || enableRealtime || enablePlanMode) {\n <div class=\"attach-buttons\">\n @if (enablePlanMode) {\n <button\n class=\"attach-button-icon plan-mode-button-icon\"\n [class.plan-mode-button-icon--active]=\"planModeActive\"\n [disabled]=\"disabled\"\n [attr.aria-pressed]=\"planModeActive\"\n (click)=\"planModeToggle.emit(); $event.stopPropagation()\"\n [title]=\"planModeActive ? 'Plan Mode ON — the agent presents a plan for your approval before it acts' : 'Plan Mode: have the agent present a plan for your approval before it acts'\"\n aria-label=\"Toggle Plan Mode\"\n >\n <i class=\"fa-solid fa-route\" aria-hidden=\"true\"></i>\n </button>\n }\n @if (enableAttachments) {\n <button\n class=\"attach-button-icon\"\n [disabled]=\"disabled\"\n (click)=\"openFilePicker(); $event.stopPropagation()\"\n title=\"Attach file\"\n >\n <i class=\"fa-solid fa-paperclip\"></i>\n </button>\n }\n @if (enableRealtime) {\n <button\n class=\"attach-button-icon voice-button-icon\"\n [class.voice-button-icon--active]=\"voiceActive\"\n [disabled]=\"!canStartRealtime\"\n (click)=\"onRealtimeClick(); $event.stopPropagation()\"\n [title]=\"voiceActive ? 'Voice call active' : 'Start a voice call'\"\n aria-label=\"Start a voice call\"\n >\n <i class=\"fa-solid fa-phone\" aria-hidden=\"true\"></i>\n </button>\n <!-- Caret beside the phone: opens the agent/model picker so call OPTIONS stay one\n click away while the plain phone click keeps its instant-start behavior. -->\n <button\n class=\"attach-button-icon voice-options-button-icon\"\n [disabled]=\"!canStartRealtime\"\n (click)=\"onRealtimeOptionsClick(); $event.stopPropagation()\"\n title=\"Voice call options (choose agent and voice model)\"\n aria-label=\"Voice call options\"\n >\n <i class=\"fa-solid fa-chevron-down\" aria-hidden=\"true\"></i>\n </button>\n }\n </div>\n }\n\n <!-- Send Button (Icon Only) - Positioned over editor -->\n <button\n class=\"send-button-icon\"\n [disabled]=\"!canSend\"\n (click)=\"onSendClick()\"\n title=\"Send message (Enter)\"\n >\n <i class=\"fa-solid fa-paper-plane\"></i>\n </button>\n </div>\n</div>\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/ng-composer",
3
- "version": "5.47.0",
3
+ "version": "5.48.0",
4
4
  "description": "MemberJunction: Generic message composer components — mention editor with pluggable trigger providers (ComposerTriggerProvider), mention dropdown, and send-button input box wrapper. Ships zero AI knowledge; trigger plugins are supplied by hosts (see @memberjunction/ng-conversations).",
5
5
  "main": "./dist/public-api.js",
6
6
  "typings": "./dist/public-api.d.ts",
@@ -18,7 +18,7 @@
18
18
  "devDependencies": {
19
19
  "@angular/compiler": "21.1.3",
20
20
  "@angular/compiler-cli": "21.1.3",
21
- "@memberjunction/ng-test-utils": "5.47.0",
21
+ "@memberjunction/ng-test-utils": "5.48.0",
22
22
  "vitest": "^4.0.18"
23
23
  },
24
24
  "peerDependencies": {
@@ -27,9 +27,9 @@
27
27
  "@angular/forms": "21.1.3"
28
28
  },
29
29
  "dependencies": {
30
- "@memberjunction/core": "5.47.0",
31
- "@memberjunction/global": "5.47.0",
32
- "@memberjunction/ng-ui-components": "5.47.0",
30
+ "@memberjunction/core": "5.48.0",
31
+ "@memberjunction/global": "5.48.0",
32
+ "@memberjunction/ng-ui-components": "5.48.0",
33
33
  "tslib": "^2.8.1"
34
34
  },
35
35
  "sideEffects": false,