sf-aiembedded 0.3.9 → 0.4.1

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.
@@ -16,6 +16,7 @@ import * as i2$1 from 'primeng/message';
16
16
  import { MessageModule } from 'primeng/message';
17
17
  import { Skeleton } from 'primeng/skeleton';
18
18
  import { Textarea } from 'primeng/textarea';
19
+ import { MenuModule } from 'primeng/menu';
19
20
  import * as i1$2 from 'primeng/api';
20
21
 
21
22
  // projects/general-agent/src/lib/agents-backend.port.ts
@@ -136,11 +137,11 @@ class AgentService {
136
137
  configurationAgent = this.agentInfo.config?.setUp;
137
138
  }
138
139
  this.headerConfig = {
139
- title: configurationAgent.title,
140
- subtitle: configurationAgent.subtitle,
141
- initialMessages: this.agentInfo.config.initialMessages,
142
- placeholder: configurationAgent.inputPlaceholder,
143
- footer: configurationAgent.footer
140
+ title: configurationAgent?.title || '',
141
+ subtitle: configurationAgent?.subtitle || '',
142
+ initialMessages: this.agentInfo.config?.initialMessages || [],
143
+ placeholder: configurationAgent?.inputPlaceholder || 'Responder...',
144
+ footer: configurationAgent?.footer || ''
144
145
  };
145
146
  this.isLoading = false;
146
147
  }
@@ -193,7 +194,6 @@ class AgentService {
193
194
  });
194
195
  }
195
196
  async send(userInput) {
196
- console.log(this.selectedFiles);
197
197
  this.isBotWritting = true;
198
198
  let text = userInput.trim();
199
199
  try {
@@ -345,11 +345,30 @@ class AgentService {
345
345
  }
346
346
  }
347
347
  }
348
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: AgentService, deps: [{ token: AI_AGENTS }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
349
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: AgentService });
348
+ addInitialMessages() {
349
+ const initialMessages = [];
350
+ this.headerConfig?.initialMessages?.map(msg => {
351
+ initialMessages.push({
352
+ role: 'assistant',
353
+ type: 'markdown',
354
+ content: msg
355
+ });
356
+ });
357
+ this.addFullMessages(initialMessages);
358
+ }
359
+ clearConversation() {
360
+ this.clearMessages();
361
+ this.sessionId = '';
362
+ this.isBotWritting = false;
363
+ }
364
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: AgentService, deps: [{ token: AI_AGENTS }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
365
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: AgentService, providedIn: 'root' });
350
366
  }
351
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: AgentService, decorators: [{
352
- type: Injectable
367
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: AgentService, decorators: [{
368
+ type: Injectable,
369
+ args: [{
370
+ providedIn: 'root'
371
+ }]
353
372
  }], ctorParameters: () => [{ type: undefined, decorators: [{
354
373
  type: Inject,
355
374
  args: [AI_AGENTS]
@@ -359,12 +378,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
359
378
  class TextComponent {
360
379
  text = '';
361
380
  role = '';
362
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
363
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: TextComponent, isStandalone: true, selector: "app-text", inputs: { text: "text", role: "role" }, ngImport: i0, template: "<div\n class=\"chat-bubble px-3 py-2 border-round-bottom-xl w-fit\"\n [ngClass]=\"role !== 'user' ? 'bubble-bot border-round-right-xl' : 'bubble-user border-round-left-xl border-round-right-sm'\"\n>\n <span class=\"text-base m-0 whitespace-normal\" style=\"word-break: break-word;\">{{text}}</span>\n</div>", styles: ["@charset \"UTF-8\";.bubble-user{background:linear-gradient(145deg,#1e293b,#334155);color:#fff;box-shadow:0 3px 10px -2px #1e293b40}.bubble-user span{color:#fff}.bubble-bot{background:#fff;border:1px solid #e2e8f0;color:#1e293b;box-shadow:0 1px 4px #0000000a}.bubble-bot span{color:#334155}.chat-bubble{transition:transform .2s ease,box-shadow .2s ease}.chat-bubble:hover{transform:translateY(-1px)}.bubble-user:hover{box-shadow:0 5px 14px -2px #1e293b4d}.bubble-bot:hover{box-shadow:0 2px 8px #0000000f;border-color:#cbd5e1}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: FormsModule }] });
381
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
382
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: TextComponent, isStandalone: true, selector: "app-text", inputs: { text: "text", role: "role" }, ngImport: i0, template: "<div\r\n class=\"chat-bubble px-3 py-2 border-round-bottom-xl w-fit\"\r\n [ngClass]=\"role !== 'user' ? 'bubble-bot border-round-right-xl' : 'bubble-user border-round-left-xl border-round-right-sm'\"\r\n>\r\n <span class=\"text-base m-0 whitespace-normal\" style=\"word-break: break-word;\">{{text}}</span>\r\n</div>", styles: ["@charset \"UTF-8\";.bubble-user{background:linear-gradient(145deg,#1e293b,#334155);color:#fff;box-shadow:0 3px 10px -2px #1e293b40}.bubble-user span{color:#fff}.bubble-bot{background:#fff;border:1px solid #e2e8f0;color:#1e293b;box-shadow:0 1px 4px #0000000a}.bubble-bot span{color:#334155}.chat-bubble{transition:transform .2s ease,box-shadow .2s ease}.chat-bubble:hover{transform:translateY(-1px)}.bubble-user:hover{box-shadow:0 5px 14px -2px #1e293b4d}.bubble-bot:hover{box-shadow:0 2px 8px #0000000f;border-color:#cbd5e1}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: FormsModule }] });
364
383
  }
365
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TextComponent, decorators: [{
384
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TextComponent, decorators: [{
366
385
  type: Component,
367
- args: [{ selector: 'app-text', standalone: true, imports: [CommonModule, FormsModule], template: "<div\n class=\"chat-bubble px-3 py-2 border-round-bottom-xl w-fit\"\n [ngClass]=\"role !== 'user' ? 'bubble-bot border-round-right-xl' : 'bubble-user border-round-left-xl border-round-right-sm'\"\n>\n <span class=\"text-base m-0 whitespace-normal\" style=\"word-break: break-word;\">{{text}}</span>\n</div>", styles: ["@charset \"UTF-8\";.bubble-user{background:linear-gradient(145deg,#1e293b,#334155);color:#fff;box-shadow:0 3px 10px -2px #1e293b40}.bubble-user span{color:#fff}.bubble-bot{background:#fff;border:1px solid #e2e8f0;color:#1e293b;box-shadow:0 1px 4px #0000000a}.bubble-bot span{color:#334155}.chat-bubble{transition:transform .2s ease,box-shadow .2s ease}.chat-bubble:hover{transform:translateY(-1px)}.bubble-user:hover{box-shadow:0 5px 14px -2px #1e293b4d}.bubble-bot:hover{box-shadow:0 2px 8px #0000000f;border-color:#cbd5e1}\n"] }]
386
+ args: [{ selector: 'app-text', standalone: true, imports: [CommonModule, FormsModule], template: "<div\r\n class=\"chat-bubble px-3 py-2 border-round-bottom-xl w-fit\"\r\n [ngClass]=\"role !== 'user' ? 'bubble-bot border-round-right-xl' : 'bubble-user border-round-left-xl border-round-right-sm'\"\r\n>\r\n <span class=\"text-base m-0 whitespace-normal\" style=\"word-break: break-word;\">{{text}}</span>\r\n</div>", styles: ["@charset \"UTF-8\";.bubble-user{background:linear-gradient(145deg,#1e293b,#334155);color:#fff;box-shadow:0 3px 10px -2px #1e293b40}.bubble-user span{color:#fff}.bubble-bot{background:#fff;border:1px solid #e2e8f0;color:#1e293b;box-shadow:0 1px 4px #0000000a}.bubble-bot span{color:#334155}.chat-bubble{transition:transform .2s ease,box-shadow .2s ease}.chat-bubble:hover{transform:translateY(-1px)}.bubble-user:hover{box-shadow:0 5px 14px -2px #1e293b4d}.bubble-bot:hover{box-shadow:0 2px 8px #0000000f;border-color:#cbd5e1}\n"] }]
368
387
  }], propDecorators: { text: [{
369
388
  type: Input
370
389
  }], role: [{
@@ -420,10 +439,10 @@ class FileComponent {
420
439
  return 'col-12 sm:col-6 md:col-4';
421
440
  }
422
441
  }
423
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: FileComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
424
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: FileComponent, isStandalone: true, selector: "app-file", inputs: { files: "files", role: "role", remove: "remove" }, ngImport: i0, template: "<div *ngIf=\"!remove\" class=\"grid w-full m-o\" [ngClass]=\"role !== 'user' ? 'items-start justify-content-start' : 'items-end justify-content-end'\">\r\n <div *ngFor=\"let file of files\" [ngClass]=\"getGridClass()\">\r\n <div class=\"flex align-items-center gap-3 border-1 border-gray-300 border-round-2xl p-2 bg-gray-100 h-full\">\r\n <p-avatar class=\"p-1 border-1 avatar-responsive\" [ngClass]=\"getFileClasses(file.name)\" [icon]=\"getFileIcon(file.name)\"></p-avatar>\r\n <div class=\"flex flex-column overflow-hidden\" style=\"min-width: 0;\">\r\n <span class=\"font-semibold text-gray-500 text-sm md:text-base\" style=\"white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\">\r\n {{ file.name }}\r\n </span>\r\n <p class=\"text-xs text-gray-400 md:text-base\" style=\"white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\">\r\n ({{ file.type || 'Archivo' }})\r\n </p>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<div *ngIf=\"remove\" class=\"grid w-full\">\r\n <div *ngFor=\"let file of files; let i = index\" class=\"col-12 sm:col-6 md:col-4\">\r\n <div class=\"relative border-1 border-gray-300 border-round-xl p-2 h-full\">\r\n <p-button icon=\"pi pi-times\" [rounded]=\"true\" variant=\"text\" severity=\"secondary\" class=\"no-hover absolute top-0 right-0 z-1\" (click)=\"removeSelectedFile(i)\" size=\"small\"/>\r\n <div class=\"flex align-items-center gap-3\">\r\n <p-avatar \r\n class=\"p-1 border-1 avatar-responsive\"\r\n [ngClass]=\"getFileClasses(file.name)\" \r\n [icon]=\"getFileIcon(file.name)\" \r\n >\r\n </p-avatar>\r\n \r\n <div class=\"flex flex-column overflow-hidden\" style=\"min-width: 0;\">\r\n <span class=\"font-semibold text-gray-500 md:text-base text-sm\" \r\n style=\"white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\">\r\n {{ file.name }}\r\n </span>\r\n <p class=\"text-xs text-gray-400 md:text-base\" \r\n style=\"white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\">\r\n ({{ file.type || 'archivo' }})\r\n </p>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n </div>\r\n</div>", styles: [".avatar-responsive{aspect-ratio:1/1;width:2.5rem;height:2.5rem;font-size:2rem;flex-shrink:0}@media (max-width: 768px){.avatar-responsive{width:2rem;height:2rem;font-size:1.5rem}}@media (max-width: 576px){.avatar-responsive{width:1.75rem;height:1.75rem;font-size:1.25rem}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Avatar, selector: "p-avatar", inputs: ["label", "icon", "image", "size", "shape", "style", "styleClass", "ariaLabel", "ariaLabelledBy"], outputs: ["onImageError"] }] });
442
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: FileComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
443
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: FileComponent, isStandalone: true, selector: "app-file", inputs: { files: "files", role: "role", remove: "remove" }, ngImport: i0, template: "<div *ngIf=\"!remove\" class=\"grid w-full m-o\" [ngClass]=\"role !== 'user' ? 'items-start justify-content-start' : 'items-end justify-content-end'\">\r\n <div *ngFor=\"let file of files\" [ngClass]=\"getGridClass()\">\r\n <div class=\"flex align-items-center gap-3 border-1 border-gray-300 border-round-2xl p-2 bg-gray-100 h-full\">\r\n <p-avatar class=\"p-1 border-1 avatar-responsive\" [ngClass]=\"getFileClasses(file.name)\" [icon]=\"getFileIcon(file.name)\"></p-avatar>\r\n <div class=\"flex flex-column overflow-hidden\" style=\"min-width: 0;\">\r\n <span class=\"font-semibold text-gray-500 text-sm md:text-base\" style=\"white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\">\r\n {{ file.name }}\r\n </span>\r\n <p class=\"text-xs text-gray-400 md:text-base\" style=\"white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\">\r\n ({{ file.type || 'Archivo' }})\r\n </p>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<div *ngIf=\"remove\" class=\"grid w-full\">\r\n <div *ngFor=\"let file of files; let i = index\" class=\"col-12 sm:col-6 md:col-4\">\r\n <div class=\"relative border-1 border-gray-300 border-round-xl p-2 h-full\">\r\n <p-button icon=\"pi pi-times\" [rounded]=\"true\" variant=\"text\" severity=\"secondary\" class=\"no-hover absolute top-0 right-0 z-1\" (click)=\"removeSelectedFile(i)\" size=\"small\"/>\r\n <div class=\"flex align-items-center gap-3\">\r\n <p-avatar \r\n class=\"p-1 border-1 avatar-responsive\"\r\n [ngClass]=\"getFileClasses(file.name)\" \r\n [icon]=\"getFileIcon(file.name)\" \r\n >\r\n </p-avatar>\r\n \r\n <div class=\"flex flex-column overflow-hidden\" style=\"min-width: 0;\">\r\n <span class=\"font-semibold text-gray-500 md:text-base text-sm\" \r\n style=\"white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\">\r\n {{ file.name }}\r\n </span>\r\n <p class=\"text-xs text-gray-400 md:text-base\" \r\n style=\"white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\">\r\n ({{ file.type || 'archivo' }})\r\n </p>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n </div>\r\n</div>", styles: [".avatar-responsive{aspect-ratio:1/1;width:2.5rem;height:2.5rem;font-size:2rem;flex-shrink:0}@media (max-width: 768px){.avatar-responsive{width:2rem;height:2rem;font-size:1.5rem}}@media (max-width: 576px){.avatar-responsive{width:1.75rem;height:1.75rem;font-size:1.25rem}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Avatar, selector: "p-avatar", inputs: ["label", "icon", "image", "size", "shape", "style", "styleClass", "ariaLabel", "ariaLabelledBy"], outputs: ["onImageError"] }] });
425
444
  }
426
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: FileComponent, decorators: [{
445
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: FileComponent, decorators: [{
427
446
  type: Component,
428
447
  args: [{ selector: 'app-file', standalone: true, imports: [CommonModule, FormsModule, ButtonModule, Avatar], template: "<div *ngIf=\"!remove\" class=\"grid w-full m-o\" [ngClass]=\"role !== 'user' ? 'items-start justify-content-start' : 'items-end justify-content-end'\">\r\n <div *ngFor=\"let file of files\" [ngClass]=\"getGridClass()\">\r\n <div class=\"flex align-items-center gap-3 border-1 border-gray-300 border-round-2xl p-2 bg-gray-100 h-full\">\r\n <p-avatar class=\"p-1 border-1 avatar-responsive\" [ngClass]=\"getFileClasses(file.name)\" [icon]=\"getFileIcon(file.name)\"></p-avatar>\r\n <div class=\"flex flex-column overflow-hidden\" style=\"min-width: 0;\">\r\n <span class=\"font-semibold text-gray-500 text-sm md:text-base\" style=\"white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\">\r\n {{ file.name }}\r\n </span>\r\n <p class=\"text-xs text-gray-400 md:text-base\" style=\"white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\">\r\n ({{ file.type || 'Archivo' }})\r\n </p>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<div *ngIf=\"remove\" class=\"grid w-full\">\r\n <div *ngFor=\"let file of files; let i = index\" class=\"col-12 sm:col-6 md:col-4\">\r\n <div class=\"relative border-1 border-gray-300 border-round-xl p-2 h-full\">\r\n <p-button icon=\"pi pi-times\" [rounded]=\"true\" variant=\"text\" severity=\"secondary\" class=\"no-hover absolute top-0 right-0 z-1\" (click)=\"removeSelectedFile(i)\" size=\"small\"/>\r\n <div class=\"flex align-items-center gap-3\">\r\n <p-avatar \r\n class=\"p-1 border-1 avatar-responsive\"\r\n [ngClass]=\"getFileClasses(file.name)\" \r\n [icon]=\"getFileIcon(file.name)\" \r\n >\r\n </p-avatar>\r\n \r\n <div class=\"flex flex-column overflow-hidden\" style=\"min-width: 0;\">\r\n <span class=\"font-semibold text-gray-500 md:text-base text-sm\" \r\n style=\"white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\">\r\n {{ file.name }}\r\n </span>\r\n <p class=\"text-xs text-gray-400 md:text-base\" \r\n style=\"white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\">\r\n ({{ file.type || 'archivo' }})\r\n </p>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n </div>\r\n</div>", styles: [".avatar-responsive{aspect-ratio:1/1;width:2.5rem;height:2.5rem;font-size:2rem;flex-shrink:0}@media (max-width: 768px){.avatar-responsive{width:2rem;height:2rem;font-size:1.5rem}}@media (max-width: 576px){.avatar-responsive{width:1.75rem;height:1.75rem;font-size:1.25rem}}\n"] }]
429
448
  }], propDecorators: { files: [{
@@ -436,10 +455,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
436
455
 
437
456
  class TableComponent {
438
457
  table = "";
439
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
440
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: TableComponent, isStandalone: true, selector: "app-table", inputs: { table: "table" }, ngImport: i0, template: "<div\r\n *ngIf=\"table\"\r\n class=\"mt-2 overflow-auto\"\r\n [innerHTML]=\"table\"\r\n style=\"max-width: 100%; overflow-x: auto;\"\r\n></div>", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
458
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
459
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: TableComponent, isStandalone: true, selector: "app-table", inputs: { table: "table" }, ngImport: i0, template: "<div\r\n *ngIf=\"table\"\r\n class=\"mt-2 overflow-auto\"\r\n [innerHTML]=\"table\"\r\n style=\"max-width: 100%; overflow-x: auto;\"\r\n></div>", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
441
460
  }
442
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TableComponent, decorators: [{
461
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TableComponent, decorators: [{
443
462
  type: Component,
444
463
  args: [{ selector: 'app-table', imports: [CommonModule], template: "<div\r\n *ngIf=\"table\"\r\n class=\"mt-2 overflow-auto\"\r\n [innerHTML]=\"table\"\r\n style=\"max-width: 100%; overflow-x: auto;\"\r\n></div>" }]
445
464
  }], propDecorators: { table: [{
@@ -481,10 +500,10 @@ class MarkdownComponent {
481
500
  this.safeHtml = this.sanitizer.bypassSecurityTrustHtml(rawHtml);
482
501
  }
483
502
  }
484
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: MarkdownComponent, deps: [{ token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
485
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: MarkdownComponent, isStandalone: true, selector: "app-markdown", inputs: { content: "content" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"markdown-wrapper\">\r\n <div class=\"markdown-container\" [innerHTML]=\"safeHtml\"></div>\r\n</div>", styles: ["@charset \"UTF-8\";app-markdown{display:block;min-width:0;max-width:100%;flex:1 1 auto}.markdown-wrapper{min-width:0;flex:1;max-width:100%;overflow:visible;width:100%}.markdown-container{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;line-height:1.6;min-width:0;word-wrap:break-word;white-space:normal;overflow-wrap:anywhere;max-width:100%;color:#334155}.markdown-container>*{max-width:100%;min-width:0}.markdown-container .table-wrapper{width:100%;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;display:block;margin:1em 0;scrollbar-width:thin;scrollbar-color:rgba(156,163,175,.5) transparent;max-width:100%}.markdown-container .table-wrapper::-webkit-scrollbar{height:6px}.markdown-container .table-wrapper::-webkit-scrollbar-track{background:transparent}.markdown-container .table-wrapper::-webkit-scrollbar-thumb{background-color:#9ca3af80;border-radius:3px}.markdown-container table{width:max-content;min-width:100%;border-collapse:collapse;border-right:none;border-left:none}.markdown-container th{font-weight:600;padding:10px;text-align:left;border-bottom:1px solid var(--p-surface-300);overflow-wrap:anywhere;word-break:break-word}.markdown-container td{padding:10px;border-top:1px solid var(--p-surface-200);vertical-align:top;text-align:left;overflow-wrap:anywhere;word-break:break-word}@media (max-width: 1024px){.markdown-container table{font-size:1rem}}@media (max-width: 768px){.markdown-container table{font-size:.875rem}}.markdown-container tr:hover{background-color:#1e293b08}.markdown-container a{color:#1e293b;text-decoration:none;font-weight:500;border-bottom:1px solid rgba(30,41,59,.25);transition:border-color .2s ease,color .2s ease;word-break:break-word;overflow-wrap:anywhere;max-width:100%}.markdown-container a:hover{color:#0f172a;border-bottom-color:#1e293b}.markdown-container img{max-width:100%;margin:10px 0;border-radius:6px}.markdown-container pre{background:#f1f5f9;padding:14px 16px;border-radius:10px;border:1px solid #e2e8f0;overflow-x:auto;-webkit-overflow-scrolling:touch;margin:1em 0;max-width:100%;scrollbar-width:thin;scrollbar-color:rgba(148,163,184,.4) transparent}.markdown-container pre::-webkit-scrollbar{height:6px}.markdown-container pre::-webkit-scrollbar-track{background:transparent}.markdown-container pre::-webkit-scrollbar-thumb{background-color:#9ca3af80;border-radius:3px}.markdown-container code{font-family:monospace;word-break:break-word;overflow-wrap:anywhere}.markdown-container :not(pre)>code{background:#1e293b0f;padding:2px 8px;border-radius:5px;font-size:.88em;color:#334155;word-break:break-word;overflow-wrap:anywhere}.markdown-container p,.markdown-container li{font-size:1rem;overflow-wrap:anywhere;word-break:break-word}.markdown-container ul,.markdown-container ol{padding-left:1.5rem;margin:.5rem 0}.markdown-container ul{list-style-type:disc}.markdown-container ol{list-style-type:decimal}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], encapsulation: i0.ViewEncapsulation.None });
503
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: MarkdownComponent, deps: [{ token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
504
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: MarkdownComponent, isStandalone: true, selector: "app-markdown", inputs: { content: "content" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"markdown-wrapper\">\r\n <div class=\"markdown-container\" [innerHTML]=\"safeHtml\"></div>\r\n</div>", styles: ["@charset \"UTF-8\";app-markdown{display:block;min-width:0;max-width:100%;flex:1 1 auto}.markdown-wrapper{min-width:0;flex:1;max-width:100%;overflow:visible;width:100%}.markdown-container{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;line-height:1.6;min-width:0;word-wrap:break-word;white-space:normal;overflow-wrap:anywhere;max-width:100%;color:#334155}.markdown-container>*{max-width:100%;min-width:0}.markdown-container .table-wrapper{width:100%;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;display:block;margin:1em 0;scrollbar-width:thin;scrollbar-color:rgba(156,163,175,.5) transparent;max-width:100%}.markdown-container .table-wrapper::-webkit-scrollbar{height:6px}.markdown-container .table-wrapper::-webkit-scrollbar-track{background:transparent}.markdown-container .table-wrapper::-webkit-scrollbar-thumb{background-color:#9ca3af80;border-radius:3px}.markdown-container table{width:max-content;min-width:100%;border-collapse:collapse;border-right:none;border-left:none}.markdown-container th{font-weight:600;padding:10px;text-align:left;border-bottom:1px solid var(--p-surface-300);overflow-wrap:anywhere;word-break:break-word}.markdown-container td{padding:10px;border-top:1px solid var(--p-surface-200);vertical-align:top;text-align:left;overflow-wrap:anywhere;word-break:break-word}@media (max-width: 1024px){.markdown-container table{font-size:1rem}}@media (max-width: 768px){.markdown-container table{font-size:.875rem}}.markdown-container tr:hover{background-color:#1e293b08}.markdown-container a{color:#1e293b;text-decoration:none;font-weight:500;border-bottom:1px solid rgba(30,41,59,.25);transition:border-color .2s ease,color .2s ease;word-break:break-word;overflow-wrap:anywhere;max-width:100%}.markdown-container a:hover{color:#0f172a;border-bottom-color:#1e293b}.markdown-container img{max-width:100%;margin:10px 0;border-radius:6px}.markdown-container pre{background:#f1f5f9;padding:14px 16px;border-radius:10px;border:1px solid #e2e8f0;overflow-x:auto;-webkit-overflow-scrolling:touch;margin:1em 0;max-width:100%;scrollbar-width:thin;scrollbar-color:rgba(148,163,184,.4) transparent}.markdown-container pre::-webkit-scrollbar{height:6px}.markdown-container pre::-webkit-scrollbar-track{background:transparent}.markdown-container pre::-webkit-scrollbar-thumb{background-color:#9ca3af80;border-radius:3px}.markdown-container code{font-family:monospace;word-break:break-word;overflow-wrap:anywhere}.markdown-container :not(pre)>code{background:#1e293b0f;padding:2px 8px;border-radius:5px;font-size:.88em;color:#334155;word-break:break-word;overflow-wrap:anywhere}.markdown-container p,.markdown-container li{font-size:1rem;overflow-wrap:anywhere;word-break:break-word}.markdown-container ul,.markdown-container ol{padding-left:1.5rem;margin:.5rem 0}.markdown-container ul{list-style-type:disc}.markdown-container ol{list-style-type:decimal}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], encapsulation: i0.ViewEncapsulation.None });
486
505
  }
487
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: MarkdownComponent, decorators: [{
506
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: MarkdownComponent, decorators: [{
488
507
  type: Component,
489
508
  args: [{ selector: 'app-markdown', standalone: true, imports: [CommonModule], encapsulation: ViewEncapsulation.None, template: "<div class=\"markdown-wrapper\">\r\n <div class=\"markdown-container\" [innerHTML]=\"safeHtml\"></div>\r\n</div>", styles: ["@charset \"UTF-8\";app-markdown{display:block;min-width:0;max-width:100%;flex:1 1 auto}.markdown-wrapper{min-width:0;flex:1;max-width:100%;overflow:visible;width:100%}.markdown-container{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;line-height:1.6;min-width:0;word-wrap:break-word;white-space:normal;overflow-wrap:anywhere;max-width:100%;color:#334155}.markdown-container>*{max-width:100%;min-width:0}.markdown-container .table-wrapper{width:100%;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;display:block;margin:1em 0;scrollbar-width:thin;scrollbar-color:rgba(156,163,175,.5) transparent;max-width:100%}.markdown-container .table-wrapper::-webkit-scrollbar{height:6px}.markdown-container .table-wrapper::-webkit-scrollbar-track{background:transparent}.markdown-container .table-wrapper::-webkit-scrollbar-thumb{background-color:#9ca3af80;border-radius:3px}.markdown-container table{width:max-content;min-width:100%;border-collapse:collapse;border-right:none;border-left:none}.markdown-container th{font-weight:600;padding:10px;text-align:left;border-bottom:1px solid var(--p-surface-300);overflow-wrap:anywhere;word-break:break-word}.markdown-container td{padding:10px;border-top:1px solid var(--p-surface-200);vertical-align:top;text-align:left;overflow-wrap:anywhere;word-break:break-word}@media (max-width: 1024px){.markdown-container table{font-size:1rem}}@media (max-width: 768px){.markdown-container table{font-size:.875rem}}.markdown-container tr:hover{background-color:#1e293b08}.markdown-container a{color:#1e293b;text-decoration:none;font-weight:500;border-bottom:1px solid rgba(30,41,59,.25);transition:border-color .2s ease,color .2s ease;word-break:break-word;overflow-wrap:anywhere;max-width:100%}.markdown-container a:hover{color:#0f172a;border-bottom-color:#1e293b}.markdown-container img{max-width:100%;margin:10px 0;border-radius:6px}.markdown-container pre{background:#f1f5f9;padding:14px 16px;border-radius:10px;border:1px solid #e2e8f0;overflow-x:auto;-webkit-overflow-scrolling:touch;margin:1em 0;max-width:100%;scrollbar-width:thin;scrollbar-color:rgba(148,163,184,.4) transparent}.markdown-container pre::-webkit-scrollbar{height:6px}.markdown-container pre::-webkit-scrollbar-track{background:transparent}.markdown-container pre::-webkit-scrollbar-thumb{background-color:#9ca3af80;border-radius:3px}.markdown-container code{font-family:monospace;word-break:break-word;overflow-wrap:anywhere}.markdown-container :not(pre)>code{background:#1e293b0f;padding:2px 8px;border-radius:5px;font-size:.88em;color:#334155;word-break:break-word;overflow-wrap:anywhere}.markdown-container p,.markdown-container li{font-size:1rem;overflow-wrap:anywhere;word-break:break-word}.markdown-container ul,.markdown-container ol{padding-left:1.5rem;margin:.5rem 0}.markdown-container ul{list-style-type:disc}.markdown-container ol{list-style-type:decimal}\n"] }]
490
509
  }], ctorParameters: () => [{ type: i1$1.DomSanitizer }], propDecorators: { content: [{
@@ -492,10 +511,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
492
511
  }] } });
493
512
 
494
513
  class RobotIconComponent {
495
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: RobotIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
496
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: RobotIconComponent, isStandalone: true, selector: "lib-robot-icon", host: { styleAttribute: "display: inline-flex; width: 1.5em; height: 1.5em;" }, ngImport: i0, template: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"100%\" height=\"100%\" fill=\"currentColor\">\r\n <path d=\"M440-120v-80h320v-284q0-117-81.5-198.5T480-764q-117 0-198.5 81.5T200-484v244h-40q-33 0-56.5-23.5T80-320v-80q0-21 10.5-39.5T120-469l3-53q8-68 39.5-126t79-101q47.5-43 109-67T480-840q68 0 129 24t109 66.5Q766-707 797-649t40 126l3 52q19 9 29.5 27t10.5 38v92q0 20-10.5 38T840-249v49q0 33-23.5 56.5T760-120H440Zm-80-280q-17 0-28.5-11.5T320-440q0-17 11.5-28.5T360-480q17 0 28.5 11.5T400-440q0 17-11.5 28.5T360-400Zm240 0q-17 0-28.5-11.5T560-440q0-17 11.5-28.5T600-480q17 0 28.5 11.5T640-440q0 17-11.5 28.5T600-400Zm-359-62q-7-106 64-182t177-76q89 0 156.5 56.5T720-519q-91-1-167.5-49T435-698q-16 80-67.5 142.5T241-462Z\"/>\r\n</svg>\r\n", styles: [""] });
514
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: RobotIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
515
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: RobotIconComponent, isStandalone: true, selector: "lib-robot-icon", host: { styleAttribute: "display: inline-flex; width: 1.5em; height: 1.5em;" }, ngImport: i0, template: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"100%\" height=\"100%\" fill=\"currentColor\">\r\n <path d=\"M440-120v-80h320v-284q0-117-81.5-198.5T480-764q-117 0-198.5 81.5T200-484v244h-40q-33 0-56.5-23.5T80-320v-80q0-21 10.5-39.5T120-469l3-53q8-68 39.5-126t79-101q47.5-43 109-67T480-840q68 0 129 24t109 66.5Q766-707 797-649t40 126l3 52q19 9 29.5 27t10.5 38v92q0 20-10.5 38T840-249v49q0 33-23.5 56.5T760-120H440Zm-80-280q-17 0-28.5-11.5T320-440q0-17 11.5-28.5T360-480q17 0 28.5 11.5T400-440q0 17-11.5 28.5T360-400Zm240 0q-17 0-28.5-11.5T560-440q0-17 11.5-28.5T600-480q17 0 28.5 11.5T640-440q0 17-11.5 28.5T600-400Zm-359-62q-7-106 64-182t177-76q89 0 156.5 56.5T720-519q-91-1-167.5-49T435-698q-16 80-67.5 142.5T241-462Z\"/>\r\n</svg>\r\n", styles: [""] });
497
516
  }
498
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: RobotIconComponent, decorators: [{
517
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: RobotIconComponent, decorators: [{
499
518
  type: Component,
500
519
  args: [{ selector: 'lib-robot-icon', imports: [], host: {
501
520
  style: 'display: inline-flex; width: 1.5em; height: 1.5em;'
@@ -504,10 +523,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
504
523
 
505
524
  class AgentAvatarComponent {
506
525
  size = 'large';
507
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: AgentAvatarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
508
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: AgentAvatarComponent, isStandalone: true, selector: "lib-agent-avatar", inputs: { size: "size" }, ngImport: i0, template: "<p-avatar [size]=\"size\" class=\"agent-avatar\" shape=\"circle\">\r\n <lib-robot-icon style=\"color: var(--primary-color)\"></lib-robot-icon>\r\n</p-avatar> \r\n\r\n", styles: ["@charset \"UTF-8\";.agent-avatar{flex-shrink:0;background:linear-gradient(135deg,#1e293b0f,#3341551a);position:relative;border-radius:50%}.agent-avatar:before{content:\"\";position:absolute;inset:-2px;border-radius:50%;padding:1.5px;background:linear-gradient(135deg,#94a3b8,#475569,#94a3b8);background-size:200% 200%;animation:ringShift 5s ease infinite;-webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude;opacity:.5}@keyframes ringShift{0%{background-position:0% 50%}50%{background-position:100% 50%}to{background-position:0% 50%}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: Avatar, selector: "p-avatar", inputs: ["label", "icon", "image", "size", "shape", "style", "styleClass", "ariaLabel", "ariaLabelledBy"], outputs: ["onImageError"] }, { kind: "component", type: RobotIconComponent, selector: "lib-robot-icon" }] });
526
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: AgentAvatarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
527
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: AgentAvatarComponent, isStandalone: true, selector: "lib-agent-avatar", inputs: { size: "size" }, ngImport: i0, template: "<p-avatar [size]=\"size\" class=\"agent-avatar\" shape=\"circle\">\r\n <lib-robot-icon style=\"color: var(--primary-color)\"></lib-robot-icon>\r\n</p-avatar> \r\n\r\n", styles: ["@charset \"UTF-8\";.agent-avatar{flex-shrink:0;background:linear-gradient(135deg,#1e293b0f,#3341551a);position:relative;border-radius:50%}.agent-avatar:before{content:\"\";position:absolute;inset:-2px;border-radius:50%;padding:1.5px;background:linear-gradient(135deg,#94a3b8,#475569,#94a3b8);background-size:200% 200%;animation:ringShift 5s ease infinite;-webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude;opacity:.5}@keyframes ringShift{0%{background-position:0% 50%}50%{background-position:100% 50%}to{background-position:0% 50%}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: Avatar, selector: "p-avatar", inputs: ["label", "icon", "image", "size", "shape", "style", "styleClass", "ariaLabel", "ariaLabelledBy"], outputs: ["onImageError"] }, { kind: "component", type: RobotIconComponent, selector: "lib-robot-icon" }] });
509
528
  }
510
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: AgentAvatarComponent, decorators: [{
529
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: AgentAvatarComponent, decorators: [{
511
530
  type: Component,
512
531
  args: [{ selector: 'lib-agent-avatar', imports: [CommonModule, Avatar, RobotIconComponent], template: "<p-avatar [size]=\"size\" class=\"agent-avatar\" shape=\"circle\">\r\n <lib-robot-icon style=\"color: var(--primary-color)\"></lib-robot-icon>\r\n</p-avatar> \r\n\r\n", styles: ["@charset \"UTF-8\";.agent-avatar{flex-shrink:0;background:linear-gradient(135deg,#1e293b0f,#3341551a);position:relative;border-radius:50%}.agent-avatar:before{content:\"\";position:absolute;inset:-2px;border-radius:50%;padding:1.5px;background:linear-gradient(135deg,#94a3b8,#475569,#94a3b8);background-size:200% 200%;animation:ringShift 5s ease infinite;-webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude;opacity:.5}@keyframes ringShift{0%{background-position:0% 50%}50%{background-position:100% 50%}to{background-position:0% 50%}}\n"] }]
513
532
  }], propDecorators: { size: [{
@@ -529,14 +548,14 @@ class MessagesComponent {
529
548
  const el = this.chatContainer.nativeElement;
530
549
  el.scrollTo({ top: el.scrollHeight, behavior });
531
550
  }
532
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: MessagesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
533
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: MessagesComponent, isStandalone: true, selector: "lib-messages", inputs: { messages: "messages", isBotWritting: "isBotWritting", scrollMode: "scrollMode", agentIcon: "agentIcon" }, host: { classAttribute: "block h-full w-full overflow-hidden" }, viewQueries: [{ propertyName: "chatContainer", first: true, predicate: ["chatContainer"], descendants: true }], ngImport: i0, template: "<div class=\"messages-container\" [class.scroll-inline]=\"scrollMode === 'inline'\" #chatContainer>\r\n <div class=\"messages-content\">\r\n <div *ngFor=\"let msg of messages\" class=\"message-item\">\r\n <div class=\"flex w-full\" [ngClass]=\"msg.role !== 'user' ? 'justify-content-start' : 'justify-content-end'\">\r\n <div [ngClass]=\"msg.role !== 'user' ? 'message-bot' : 'message-user'\">\r\n <app-table *ngIf=\"msg.type === 'table'\" [table]=\"msg.content\"></app-table>\r\n <app-file *ngIf=\"msg.type === 'file'\" [files]=\"msg.content\" [role]=\"msg.role\"></app-file>\r\n <app-text *ngIf=\"msg.type === 'text'\" [text]=\"msg.content\" [role]=\"msg.role\"></app-text>\r\n <div [ngClass]=\"msg.role !== 'user' ? 'flex items-start gap-2' : ''\" *ngIf=\"msg.type === 'markdown'\">\r\n <lib-agent-avatar *ngIf=\"msg.role !== 'user'\" size=\"normal\"></lib-agent-avatar>\r\n <app-markdown [content]=\"msg.content\"></app-markdown>\r\n </div>\r\n <div *ngIf=\"msg.type === 'error'\" class=\"message-item\">\r\n <div class=\"flex gap-2 message-bot\">\r\n <lib-agent-avatar size=\"normal\"></lib-agent-avatar>\r\n <p-message severity=\"error\">{{msg.content}}</p-message>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div *ngIf=\"isBotWritting\" class=\"message-item\">\r\n <div class=\"flex gap-2 message-bot\">\r\n <lib-agent-avatar size=\"normal\"></lib-agent-avatar>\r\n <div\r\n class=\"w-fit\">\r\n <span class=\"typing-dots\">\r\n <span class=\"dot\"></span>\r\n <span class=\"dot\"></span>\r\n <span class=\"dot\"></span>\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div #bottom></div>\r\n</div>", styles: ["@charset \"UTF-8\";.messages-container{height:100%;width:100%;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:rgba(148,163,184,.4) transparent}.messages-container::-webkit-scrollbar{width:5px}.messages-container::-webkit-scrollbar-track{background:transparent}.messages-container::-webkit-scrollbar-thumb{background-color:#94a3b866;border-radius:3px}.messages-container::-webkit-scrollbar-thumb:hover{background-color:#94a3b899}@media (max-width: 768px){.messages-container{scrollbar-width:none;-ms-overflow-style:none}.messages-container::-webkit-scrollbar{display:none}}.messages-container.scroll-inline{max-width:60rem;margin:0 auto}.messages-container.scroll-inline .messages-content{max-width:100%}.messages-content{max-width:60rem;margin:0 auto;padding:1.25rem 1rem;display:flex;flex-direction:column;gap:.85rem}.message-item{width:100%;min-width:0;overflow:visible;animation:messageIn .35s cubic-bezier(.16,1,.3,1) both}@keyframes messageIn{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.message-item .flex{min-width:0}.message-item .items-start{min-width:0;max-width:100%;overflow:visible}.message-bot{width:100%;max-width:100%;min-width:0;overflow:visible}.message-user{max-width:85%;overflow:visible}.typing-dots{display:inline-flex;align-items:center;gap:5px;padding:8px 14px;background:#1e293b0a;border-radius:16px;border:1px solid rgba(30,41,59,.06)}.typing-dots .dot{width:7px;height:7px;background:#475569;border-radius:50%;animation:typingBounce 1.4s infinite ease-in-out both}.typing-dots .dot:nth-child(1){animation-delay:0s}.typing-dots .dot:nth-child(2){animation-delay:.2s}.typing-dots .dot:nth-child(3){animation-delay:.4s}@keyframes typingBounce{0%,80%,to{transform:scale(.5);opacity:.35}40%{transform:scale(1);opacity:1}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: TextComponent, selector: "app-text", inputs: ["text", "role"] }, { kind: "component", type: FileComponent, selector: "app-file", inputs: ["files", "role", "remove"] }, { kind: "component", type: TableComponent, selector: "app-table", inputs: ["table"] }, { kind: "component", type: MarkdownComponent, selector: "app-markdown", inputs: ["content"] }, { kind: "component", type: AgentAvatarComponent, selector: "lib-agent-avatar", inputs: ["size"] }, { kind: "ngmodule", type: MessageModule }, { kind: "component", type: i2$1.Message, selector: "p-message", inputs: ["severity", "text", "escape", "style", "styleClass", "closable", "icon", "closeIcon", "life", "showTransitionOptions", "hideTransitionOptions", "size", "variant"], outputs: ["onClose"] }] });
551
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: MessagesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
552
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: MessagesComponent, isStandalone: true, selector: "lib-messages", inputs: { messages: "messages", isBotWritting: "isBotWritting", scrollMode: "scrollMode", agentIcon: "agentIcon" }, host: { classAttribute: "block h-full w-full overflow-hidden" }, viewQueries: [{ propertyName: "chatContainer", first: true, predicate: ["chatContainer"], descendants: true }], ngImport: i0, template: "<div class=\"messages-container\" [class.scroll-inline]=\"scrollMode === 'inline'\" #chatContainer>\r\n <div class=\"messages-content\">\r\n <div *ngFor=\"let msg of messages\" class=\"message-item\">\r\n <div class=\"flex w-full\" [ngClass]=\"msg.role !== 'user' ? 'justify-content-start' : 'justify-content-end'\">\r\n <div [ngClass]=\"msg.role !== 'user' ? 'message-bot' : 'message-user'\">\r\n <app-table *ngIf=\"msg.type === 'table'\" [table]=\"msg.content\"></app-table>\r\n <app-file *ngIf=\"msg.type === 'file'\" [files]=\"msg.content\" [role]=\"msg.role\"></app-file>\r\n <app-text *ngIf=\"msg.type === 'text'\" [text]=\"msg.content\" [role]=\"msg.role\"></app-text>\r\n <div [ngClass]=\"msg.role !== 'user' ? 'flex items-start gap-2' : ''\" *ngIf=\"msg.type === 'markdown'\">\r\n <lib-agent-avatar *ngIf=\"msg.role !== 'user'\" size=\"normal\"></lib-agent-avatar>\r\n <app-markdown [content]=\"msg.content\"></app-markdown>\r\n </div>\r\n <div *ngIf=\"msg.type === 'error'\" class=\"message-item\">\r\n <div class=\"flex gap-2 message-bot\">\r\n <lib-agent-avatar size=\"normal\"></lib-agent-avatar>\r\n <p-message severity=\"error\">{{msg.content}}</p-message>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div *ngIf=\"isBotWritting\" class=\"message-item\">\r\n <div class=\"flex gap-2 message-bot\">\r\n <lib-agent-avatar size=\"normal\"></lib-agent-avatar>\r\n <div\r\n class=\"w-fit\">\r\n <span class=\"typing-dots\">\r\n <span class=\"dot\"></span>\r\n <span class=\"dot\"></span>\r\n <span class=\"dot\"></span>\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div #bottom></div>\r\n</div>", styles: ["@charset \"UTF-8\";.messages-container{height:100%;width:100%;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:rgba(148,163,184,.4) transparent}.messages-container::-webkit-scrollbar{width:5px}.messages-container::-webkit-scrollbar-track{background:transparent}.messages-container::-webkit-scrollbar-thumb{background-color:#94a3b866;border-radius:3px}.messages-container::-webkit-scrollbar-thumb:hover{background-color:#94a3b899}@media (max-width: 768px){.messages-container{scrollbar-width:none;-ms-overflow-style:none}.messages-container::-webkit-scrollbar{display:none}}.messages-container.scroll-inline{margin:0 auto}.messages-container.scroll-inline .messages-content{max-width:100%}.messages-content{margin:0 auto;padding:1.25rem 1rem;display:flex;flex-direction:column;gap:.85rem}.message-item{width:100%;min-width:0;overflow:visible;animation:messageIn .35s cubic-bezier(.16,1,.3,1) both}@keyframes messageIn{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.message-item .flex{min-width:0}.message-item .items-start{min-width:0;max-width:100%;overflow:visible}.message-bot{width:100%;max-width:100%;min-width:0;overflow:visible}.message-user{max-width:85%;overflow:visible}.typing-dots{display:inline-flex;align-items:center;gap:5px;padding:8px 14px;background:#1e293b0a;border-radius:16px;border:1px solid rgba(30,41,59,.06)}.typing-dots .dot{width:7px;height:7px;background:#475569;border-radius:50%;animation:typingBounce 1.4s infinite ease-in-out both}.typing-dots .dot:nth-child(1){animation-delay:0s}.typing-dots .dot:nth-child(2){animation-delay:.2s}.typing-dots .dot:nth-child(3){animation-delay:.4s}@keyframes typingBounce{0%,80%,to{transform:scale(.5);opacity:.35}40%{transform:scale(1);opacity:1}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: TextComponent, selector: "app-text", inputs: ["text", "role"] }, { kind: "component", type: FileComponent, selector: "app-file", inputs: ["files", "role", "remove"] }, { kind: "component", type: TableComponent, selector: "app-table", inputs: ["table"] }, { kind: "component", type: MarkdownComponent, selector: "app-markdown", inputs: ["content"] }, { kind: "component", type: AgentAvatarComponent, selector: "lib-agent-avatar", inputs: ["size"] }, { kind: "ngmodule", type: MessageModule }, { kind: "component", type: i2$1.Message, selector: "p-message", inputs: ["severity", "text", "escape", "style", "styleClass", "closable", "icon", "closeIcon", "life", "showTransitionOptions", "hideTransitionOptions", "size", "variant"], outputs: ["onClose"] }] });
534
553
  }
535
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: MessagesComponent, decorators: [{
554
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: MessagesComponent, decorators: [{
536
555
  type: Component,
537
556
  args: [{ selector: 'lib-messages', imports: [CommonModule, FormsModule, ButtonModule, TextComponent, FileComponent, TableComponent, MarkdownComponent, AgentAvatarComponent, MessageModule], host: {
538
557
  'class': 'block h-full w-full overflow-hidden'
539
- }, template: "<div class=\"messages-container\" [class.scroll-inline]=\"scrollMode === 'inline'\" #chatContainer>\r\n <div class=\"messages-content\">\r\n <div *ngFor=\"let msg of messages\" class=\"message-item\">\r\n <div class=\"flex w-full\" [ngClass]=\"msg.role !== 'user' ? 'justify-content-start' : 'justify-content-end'\">\r\n <div [ngClass]=\"msg.role !== 'user' ? 'message-bot' : 'message-user'\">\r\n <app-table *ngIf=\"msg.type === 'table'\" [table]=\"msg.content\"></app-table>\r\n <app-file *ngIf=\"msg.type === 'file'\" [files]=\"msg.content\" [role]=\"msg.role\"></app-file>\r\n <app-text *ngIf=\"msg.type === 'text'\" [text]=\"msg.content\" [role]=\"msg.role\"></app-text>\r\n <div [ngClass]=\"msg.role !== 'user' ? 'flex items-start gap-2' : ''\" *ngIf=\"msg.type === 'markdown'\">\r\n <lib-agent-avatar *ngIf=\"msg.role !== 'user'\" size=\"normal\"></lib-agent-avatar>\r\n <app-markdown [content]=\"msg.content\"></app-markdown>\r\n </div>\r\n <div *ngIf=\"msg.type === 'error'\" class=\"message-item\">\r\n <div class=\"flex gap-2 message-bot\">\r\n <lib-agent-avatar size=\"normal\"></lib-agent-avatar>\r\n <p-message severity=\"error\">{{msg.content}}</p-message>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div *ngIf=\"isBotWritting\" class=\"message-item\">\r\n <div class=\"flex gap-2 message-bot\">\r\n <lib-agent-avatar size=\"normal\"></lib-agent-avatar>\r\n <div\r\n class=\"w-fit\">\r\n <span class=\"typing-dots\">\r\n <span class=\"dot\"></span>\r\n <span class=\"dot\"></span>\r\n <span class=\"dot\"></span>\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div #bottom></div>\r\n</div>", styles: ["@charset \"UTF-8\";.messages-container{height:100%;width:100%;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:rgba(148,163,184,.4) transparent}.messages-container::-webkit-scrollbar{width:5px}.messages-container::-webkit-scrollbar-track{background:transparent}.messages-container::-webkit-scrollbar-thumb{background-color:#94a3b866;border-radius:3px}.messages-container::-webkit-scrollbar-thumb:hover{background-color:#94a3b899}@media (max-width: 768px){.messages-container{scrollbar-width:none;-ms-overflow-style:none}.messages-container::-webkit-scrollbar{display:none}}.messages-container.scroll-inline{max-width:60rem;margin:0 auto}.messages-container.scroll-inline .messages-content{max-width:100%}.messages-content{max-width:60rem;margin:0 auto;padding:1.25rem 1rem;display:flex;flex-direction:column;gap:.85rem}.message-item{width:100%;min-width:0;overflow:visible;animation:messageIn .35s cubic-bezier(.16,1,.3,1) both}@keyframes messageIn{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.message-item .flex{min-width:0}.message-item .items-start{min-width:0;max-width:100%;overflow:visible}.message-bot{width:100%;max-width:100%;min-width:0;overflow:visible}.message-user{max-width:85%;overflow:visible}.typing-dots{display:inline-flex;align-items:center;gap:5px;padding:8px 14px;background:#1e293b0a;border-radius:16px;border:1px solid rgba(30,41,59,.06)}.typing-dots .dot{width:7px;height:7px;background:#475569;border-radius:50%;animation:typingBounce 1.4s infinite ease-in-out both}.typing-dots .dot:nth-child(1){animation-delay:0s}.typing-dots .dot:nth-child(2){animation-delay:.2s}.typing-dots .dot:nth-child(3){animation-delay:.4s}@keyframes typingBounce{0%,80%,to{transform:scale(.5);opacity:.35}40%{transform:scale(1);opacity:1}}\n"] }]
558
+ }, template: "<div class=\"messages-container\" [class.scroll-inline]=\"scrollMode === 'inline'\" #chatContainer>\r\n <div class=\"messages-content\">\r\n <div *ngFor=\"let msg of messages\" class=\"message-item\">\r\n <div class=\"flex w-full\" [ngClass]=\"msg.role !== 'user' ? 'justify-content-start' : 'justify-content-end'\">\r\n <div [ngClass]=\"msg.role !== 'user' ? 'message-bot' : 'message-user'\">\r\n <app-table *ngIf=\"msg.type === 'table'\" [table]=\"msg.content\"></app-table>\r\n <app-file *ngIf=\"msg.type === 'file'\" [files]=\"msg.content\" [role]=\"msg.role\"></app-file>\r\n <app-text *ngIf=\"msg.type === 'text'\" [text]=\"msg.content\" [role]=\"msg.role\"></app-text>\r\n <div [ngClass]=\"msg.role !== 'user' ? 'flex items-start gap-2' : ''\" *ngIf=\"msg.type === 'markdown'\">\r\n <lib-agent-avatar *ngIf=\"msg.role !== 'user'\" size=\"normal\"></lib-agent-avatar>\r\n <app-markdown [content]=\"msg.content\"></app-markdown>\r\n </div>\r\n <div *ngIf=\"msg.type === 'error'\" class=\"message-item\">\r\n <div class=\"flex gap-2 message-bot\">\r\n <lib-agent-avatar size=\"normal\"></lib-agent-avatar>\r\n <p-message severity=\"error\">{{msg.content}}</p-message>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div *ngIf=\"isBotWritting\" class=\"message-item\">\r\n <div class=\"flex gap-2 message-bot\">\r\n <lib-agent-avatar size=\"normal\"></lib-agent-avatar>\r\n <div\r\n class=\"w-fit\">\r\n <span class=\"typing-dots\">\r\n <span class=\"dot\"></span>\r\n <span class=\"dot\"></span>\r\n <span class=\"dot\"></span>\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div #bottom></div>\r\n</div>", styles: ["@charset \"UTF-8\";.messages-container{height:100%;width:100%;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:rgba(148,163,184,.4) transparent}.messages-container::-webkit-scrollbar{width:5px}.messages-container::-webkit-scrollbar-track{background:transparent}.messages-container::-webkit-scrollbar-thumb{background-color:#94a3b866;border-radius:3px}.messages-container::-webkit-scrollbar-thumb:hover{background-color:#94a3b899}@media (max-width: 768px){.messages-container{scrollbar-width:none;-ms-overflow-style:none}.messages-container::-webkit-scrollbar{display:none}}.messages-container.scroll-inline{margin:0 auto}.messages-container.scroll-inline .messages-content{max-width:100%}.messages-content{margin:0 auto;padding:1.25rem 1rem;display:flex;flex-direction:column;gap:.85rem}.message-item{width:100%;min-width:0;overflow:visible;animation:messageIn .35s cubic-bezier(.16,1,.3,1) both}@keyframes messageIn{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.message-item .flex{min-width:0}.message-item .items-start{min-width:0;max-width:100%;overflow:visible}.message-bot{width:100%;max-width:100%;min-width:0;overflow:visible}.message-user{max-width:85%;overflow:visible}.typing-dots{display:inline-flex;align-items:center;gap:5px;padding:8px 14px;background:#1e293b0a;border-radius:16px;border:1px solid rgba(30,41,59,.06)}.typing-dots .dot{width:7px;height:7px;background:#475569;border-radius:50%;animation:typingBounce 1.4s infinite ease-in-out both}.typing-dots .dot:nth-child(1){animation-delay:0s}.typing-dots .dot:nth-child(2){animation-delay:.2s}.typing-dots .dot:nth-child(3){animation-delay:.4s}@keyframes typingBounce{0%,80%,to{transform:scale(.5);opacity:.35}40%{transform:scale(1);opacity:1}}\n"] }]
540
559
  }], propDecorators: { chatContainer: [{
541
560
  type: ViewChild,
542
561
  args: ['chatContainer']
@@ -582,10 +601,10 @@ class InputComponent {
582
601
  this.sendInput.emit(trimmedInput);
583
602
  this.userInput = '';
584
603
  }
585
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: InputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
586
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: InputComponent, isStandalone: true, selector: "lib-input", inputs: { files: "files", isRecording: "isRecording", isLoading: "isLoading", isBotWritting: "isBotWritting", header: "header", mode: "mode" }, outputs: { sendInput: "sendInput", startRecording: "startRecording", stopRecording: "stopRecording", uploadFile: "uploadFile" }, host: { properties: { "class.inputModeDefault": "mode === \"default\"", "class.inputModeBubble": "mode === \"bubble\"" }, classAttribute: "block w-full" }, ngImport: i0, template: "<div class=\"input-wrapper input-default surface-overlay\">\r\n <app-file [files]=\"files || []\" role=\"assitant\" [remove]=\"true\" />\r\n <form (ngSubmit)=\"send()\" class=\"w-full flex flex-column gap-2\">\r\n <textarea pTextarea id=\"input\" name=\"userInput\" [(ngModel)]=\"userInput\"\r\n class=\"custom-input w-full text-base\" style=\"max-height: 200px\"\r\n [placeholder]=\"header?.placeholder || ''\" rows=\"1\" [autoResize]=\"true\"\r\n (keydown)=\"handleKeyDown($event)\"></textarea>\r\n <div class=\"flex align-items-center justify-content-between w-full\">\r\n\r\n <p-button icon=\"pi pi-paperclip\" [text]=\"true\" (click)=\"fileInputChat.click()\"\r\n [rounded]=\"true\" />\r\n <input type=\"file\" #fileInputChat multiple (change)=\"uploadFile.emit($event)\" style=\"display: none;\">\r\n\r\n <div class=\"flex align-items-center justify-content-end w-full gap-2\">\r\n <p-button *ngIf=\"!isRecording\" icon=\"pi pi-microphone\" [text]=\"true\" (click)=\"startRecording.emit()\"\r\n [rounded]=\"true\" />\r\n <p-button *ngIf=\"isRecording\" icon=\"pi pi-stop\" [text]=\"true\" (click)=\"stopRecording.emit()\"\r\n severity=\"danger\" [rounded]=\"true\" />\r\n <p-button icon=\"pi pi-send\" [rounded]=\"true\" type=\"submit\"\r\n [disabled]=\"isLoading || isBotWritting || (!userInput.trim() && (!files || files.length === 0))\" />\r\n </div>\r\n </div>\r\n </form>\r\n</div>", styles: ["@charset \"UTF-8\";.input-wrapper{display:flex;flex-direction:column;gap:.5rem;padding:.5rem;width:calc(100% - 1.5rem);margin:.5rem auto 1rem}:host.inputModeDefault .input-default{border:1px solid #e2e8f0;border-radius:20px;background:#fff;box-shadow:0 2px 8px -2px #0000000f;transition:all .25s ease}:host.inputModeDefault .input-default:focus-within{border-color:#94a3b8;box-shadow:0 2px 8px -2px #0000000f,0 0 0 3px #94a3b81f}:host.inputModeBubble .input-default{border:none;border-radius:0;padding:.75rem 1rem;background:transparent;transition:all .25s ease}.custom-input{border:none!important;box-shadow:none!important;background:transparent!important;font-size:.95rem;color:#1e293b}.custom-input::placeholder{color:#94a3b8}.custom-input:focus{outline:none!important;box-shadow:none!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2$2.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "directive", type: Textarea, selector: "[pTextarea], [pInputTextarea]", inputs: ["autoResize", "variant", "fluid", "pSize"], outputs: ["onResize"] }, { kind: "ngmodule", type: ChipModule }, { kind: "component", type: FileComponent, selector: "app-file", inputs: ["files", "role", "remove"] }] });
604
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: InputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
605
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: InputComponent, isStandalone: true, selector: "lib-input", inputs: { files: "files", isRecording: "isRecording", isLoading: "isLoading", isBotWritting: "isBotWritting", header: "header", mode: "mode" }, outputs: { sendInput: "sendInput", startRecording: "startRecording", stopRecording: "stopRecording", uploadFile: "uploadFile" }, host: { properties: { "class.inputModeDefault": "mode === \"default\"", "class.inputModeBubble": "mode === \"bubble\"" }, classAttribute: "block w-full" }, ngImport: i0, template: "<div class=\"input-wrapper input-default surface-overlay\">\r\n <app-file [files]=\"files || []\" role=\"assitant\" [remove]=\"true\" />\r\n <form (ngSubmit)=\"send()\" class=\"w-full flex flex-column gap-2\">\r\n <textarea pTextarea id=\"input\" name=\"userInput\" [(ngModel)]=\"userInput\"\r\n class=\"custom-input w-full text-base\" style=\"max-height: 200px\"\r\n [placeholder]=\"header?.placeholder || ''\" rows=\"1\" [autoResize]=\"true\"\r\n (keydown)=\"handleKeyDown($event)\"></textarea>\r\n <div class=\"flex align-items-center justify-content-between w-full\">\r\n\r\n <p-button icon=\"pi pi-paperclip\" [text]=\"true\" (click)=\"fileInputChat.click()\"\r\n [rounded]=\"true\" />\r\n <input type=\"file\" #fileInputChat multiple (change)=\"uploadFile.emit($event)\" style=\"display: none;\">\r\n\r\n <div class=\"flex align-items-center justify-content-end w-full gap-2\">\r\n <p-button *ngIf=\"!isRecording\" icon=\"pi pi-microphone\" [text]=\"true\" (click)=\"startRecording.emit()\"\r\n [rounded]=\"true\" />\r\n <p-button *ngIf=\"isRecording\" icon=\"pi pi-stop\" [text]=\"true\" (click)=\"stopRecording.emit()\"\r\n severity=\"danger\" [rounded]=\"true\" />\r\n <p-button icon=\"pi pi-send\" [rounded]=\"true\" type=\"submit\"\r\n [disabled]=\"isLoading || isBotWritting || (!userInput.trim() && (!files || files.length === 0))\" />\r\n </div>\r\n </div>\r\n </form>\r\n</div>", styles: ["@charset \"UTF-8\";.input-wrapper{display:flex;flex-direction:column;gap:.5rem;padding:.5rem;width:calc(100% - 1.5rem);margin:.5rem auto 1rem}:host.inputModeDefault .input-default{border:1px solid #e2e8f0;border-radius:20px;background:#fff;box-shadow:0 2px 8px -2px #0000000f;transition:all .25s ease}:host.inputModeDefault .input-default:focus-within{border-color:#94a3b8;box-shadow:0 2px 8px -2px #0000000f,0 0 0 3px #94a3b81f}:host.inputModeBubble .input-default{border:none;border-radius:0;padding:.75rem 1rem;background:transparent;transition:all .25s ease}.custom-input{border:none!important;box-shadow:none!important;background:transparent!important;font-size:.95rem;color:#1e293b}.custom-input::placeholder{color:#94a3b8}.custom-input:focus{outline:none!important;box-shadow:none!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2$2.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "directive", type: Textarea, selector: "[pTextarea], [pInputTextarea]", inputs: ["autoResize", "variant", "fluid", "pSize"], outputs: ["onResize"] }, { kind: "ngmodule", type: ChipModule }, { kind: "component", type: FileComponent, selector: "app-file", inputs: ["files", "role", "remove"] }] });
587
606
  }
588
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: InputComponent, decorators: [{
607
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: InputComponent, decorators: [{
589
608
  type: Component,
590
609
  args: [{ selector: 'lib-input', imports: [CommonModule, FormsModule, ButtonModule, Textarea, ChipModule, FileComponent], host: {
591
610
  'class': 'block w-full',
@@ -645,10 +664,10 @@ class GeneralAgentComponent {
645
664
  this.agentService.idKatios = this.idKatios;
646
665
  await this.agentService.loadAgent();
647
666
  }
648
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: GeneralAgentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
649
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: GeneralAgentComponent, isStandalone: true, selector: "app-general-agent", inputs: { agentId: "agentId", idKatios: "idKatios", scrollMode: "scrollMode" }, host: { classAttribute: "block w-full h-full" }, providers: [AgentService], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"vm$ | async as vm\">\r\n <!-- Vista inicial (bienvenida) -->\r\n <div *ngIf=\"agentService.isInitial\" class=\"custom-chat flex flex-column items-center justify-content-center w-full\">\r\n <div class=\"flex flex-column items-center justify-content-center gap-4 p-3 mb-3 text-center md:p-1\">\r\n <h2 *ngIf=\"!vm.loading\" class=\"text-3xl font-semibold text-gray-900 lg:text-4xl\">{{vm.header?.title ||\r\n 'Agente'}}</h2>\r\n <p-skeleton *ngIf=\"vm.loading\" width=\"25rem\" height=\"2rem\" borderRadius=\"16px\"></p-skeleton>\r\n <div\r\n class=\"flex items-start justify-content-center gap-2\">\r\n <lib-agent-avatar [size]=\"'large'\"></lib-agent-avatar>\r\n <div *ngIf=\"vm.header?.initialMessages && !vm.loading\" class=\"flex flex-column items-start\">\r\n <div *ngFor=\"let msg of vm.header?.initialMessages\" class=\"text-left\">\r\n <span class=\"m-0 text-gray-700 text-base lg:text-lg\">{{msg}}</span>\r\n </div>\r\n </div>\r\n <div class=\"flex flex-column gap-2\">\r\n <p-skeleton *ngIf=\"vm.loading\" width=\"5rem\" borderRadius=\"16px\"></p-skeleton>\r\n <p-skeleton *ngIf=\"vm.loading\" width=\"15rem\" borderRadius=\"16px\"></p-skeleton>\r\n </div>\r\n </div>\r\n <p *ngIf=\"!vm.loading\" class=\"text-base text-gray-500\">{{vm.header?.subtitle}}</p>\r\n <p-skeleton *ngIf=\"vm.loading\" width=\"17rem\" borderRadius=\"16px\"></p-skeleton>\r\n </div>\r\n <!-- Input centrado para vista inicial -->\r\n <div class=\"flex flex-column items-center justify-content-center custom-size w-full pt-1 pb-1\">\r\n <lib-input [files]=\"vm.files || []\" [isRecording]=\"vm.isRec || false\" [isLoading]=\"vm.loading || false\" [isBotWritting]=\"vm.bot || false\" [header]=\"vm.header\" (sendInput)=\"agentService.send($event)\" (startRecording)=\"agentService.startRecording()\" (stopRecording)=\"agentService.stopRecording()\" (uploadFile)=\"agentService.uploadFile($event)\"></lib-input>\r\n <p class=\"mx-auto text-sm text-gray-600 mt-1\">{{vm.header?.footer}}</p>\r\n </div>\r\n </div>\r\n\r\n <!-- Vista de chat (con mensajes) -->\r\n <div *ngIf=\"!agentService.isInitial\" class=\"custom-chat chat-layout flex flex-column w-full\">\r\n <!-- \u00C1rea de mensajes con scroll -->\r\n <div class=\"messages-area flex-1 overflow-hidden\">\r\n <lib-messages [messages]=\"vm.messages || []\" [isBotWritting]=\"vm.bot || false\" [scrollMode]=\"scrollMode\"></lib-messages>\r\n </div>\r\n <!-- Input fijo abajo -->\r\n <div class=\"input-area flex flex-column items-center w-full py-2 px-2 md:px-0\">\r\n <div class=\"custom-size w-full\">\r\n <lib-input [files]=\"vm.files || []\" [isRecording]=\"vm.isRec || false\" [isLoading]=\"vm.loading || false\" [isBotWritting]=\"vm.bot || false\" [header]=\"vm.header\" (sendInput)=\"agentService.send($event)\" (startRecording)=\"agentService.startRecording()\" (stopRecording)=\"agentService.stopRecording()\" (uploadFile)=\"agentService.uploadFile($event)\"></lib-input>\r\n <p class=\"mx-auto text-sm text-gray-600 mt-1 text-center\">{{vm.header?.footer}}</p>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-container>", styles: [".custom-chat{height:100%;width:100%}.chat-layout{display:flex;flex-direction:column;height:100%;width:100%;overflow:hidden}.messages-area{flex:1 1 auto;min-height:0;overflow:hidden}.input-area{flex:0 0 auto;z-index:10}.custom-size{width:100%;max-width:60rem;padding:0 1rem;margin:0 auto}.welcome-agent{--p1: color-mix(in srgb, var(--primary-color) 8%, transparent);background-color:var(--p1)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: AgentAvatarComponent, selector: "lib-agent-avatar", inputs: ["size"] }, { kind: "ngmodule", type: TagModule }, { kind: "ngmodule", type: ChipModule }, { kind: "component", type: MessagesComponent, selector: "lib-messages", inputs: ["messages", "isBotWritting", "scrollMode", "agentIcon"] }, { kind: "component", type: Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "component", type: InputComponent, selector: "lib-input", inputs: ["files", "isRecording", "isLoading", "isBotWritting", "header", "mode"], outputs: ["sendInput", "startRecording", "stopRecording", "uploadFile"] }] });
667
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: GeneralAgentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
668
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: GeneralAgentComponent, isStandalone: true, selector: "app-general-agent", inputs: { agentId: "agentId", idKatios: "idKatios", scrollMode: "scrollMode" }, host: { classAttribute: "block w-full h-full" }, providers: [AgentService], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"vm$ | async as vm\">\r\n <!-- Vista inicial (bienvenida) -->\r\n <div *ngIf=\"agentService.isInitial\" class=\"custom-chat flex flex-column items-center justify-content-center w-full\">\r\n <div class=\"flex flex-column items-center justify-content-center gap-4 p-3 mb-3 text-center md:p-1\">\r\n <h2 *ngIf=\"!vm.loading\" class=\"text-3xl font-semibold text-gray-900 lg:text-4xl\">{{vm.header?.title ||\r\n 'Agente'}}</h2>\r\n <p-skeleton *ngIf=\"vm.loading\" width=\"25rem\" height=\"2rem\" borderRadius=\"16px\"></p-skeleton>\r\n <div\r\n class=\"flex items-start justify-content-center gap-2\">\r\n <lib-agent-avatar [size]=\"'large'\"></lib-agent-avatar>\r\n <div *ngIf=\"vm.header?.initialMessages && !vm.loading\" class=\"flex flex-column items-start\">\r\n <div *ngFor=\"let msg of vm.header?.initialMessages\" class=\"text-left\">\r\n <span class=\"m-0 text-gray-700 text-base lg:text-lg\">{{msg}}</span>\r\n </div>\r\n </div>\r\n <div class=\"flex flex-column gap-2\">\r\n <p-skeleton *ngIf=\"vm.loading\" width=\"5rem\" borderRadius=\"16px\"></p-skeleton>\r\n <p-skeleton *ngIf=\"vm.loading\" width=\"15rem\" borderRadius=\"16px\"></p-skeleton>\r\n </div>\r\n </div>\r\n <p *ngIf=\"!vm.loading\" class=\"text-base text-gray-500\">{{vm.header?.subtitle}}</p>\r\n <p-skeleton *ngIf=\"vm.loading\" width=\"17rem\" borderRadius=\"16px\"></p-skeleton>\r\n </div>\r\n <!-- Input centrado para vista inicial -->\r\n <div class=\"flex flex-column items-center justify-content-center custom-size w-full pt-1 pb-1\">\r\n <lib-input [files]=\"vm.files || []\" [isRecording]=\"vm.isRec || false\" [isLoading]=\"vm.loading || false\" [isBotWritting]=\"vm.bot || false\" [header]=\"vm.header\" (sendInput)=\"agentService.send($event)\" (startRecording)=\"agentService.startRecording()\" (stopRecording)=\"agentService.stopRecording()\" (uploadFile)=\"agentService.uploadFile($event)\"></lib-input>\r\n <p class=\"mx-auto text-sm text-gray-600 mt-1\">{{vm.header?.footer}}</p>\r\n </div>\r\n </div>\r\n\r\n <!-- Vista de chat (con mensajes) -->\r\n <div *ngIf=\"!agentService.isInitial\" class=\"custom-chat chat-layout flex flex-column w-full\">\r\n <!-- \u00C1rea de mensajes con scroll -->\r\n <div class=\"messages-area flex-1 overflow-hidden\">\r\n <lib-messages [messages]=\"vm.messages || []\" [isBotWritting]=\"vm.bot || false\" [scrollMode]=\"scrollMode\"></lib-messages>\r\n </div>\r\n <!-- Input fijo abajo -->\r\n <div class=\"input-area flex flex-column items-center w-full py-2 px-2 md:px-0\">\r\n <div class=\"custom-size w-full\">\r\n <lib-input [files]=\"vm.files || []\" [isRecording]=\"vm.isRec || false\" [isLoading]=\"vm.loading || false\" [isBotWritting]=\"vm.bot || false\" [header]=\"vm.header\" (sendInput)=\"agentService.send($event)\" (startRecording)=\"agentService.startRecording()\" (stopRecording)=\"agentService.stopRecording()\" (uploadFile)=\"agentService.uploadFile($event)\"></lib-input>\r\n <p class=\"mx-auto text-sm text-gray-600 mt-1 text-center\">{{vm.header?.footer}}</p>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-container>", styles: [".custom-chat{height:100%;width:100%}.chat-layout{display:flex;flex-direction:column;height:100%;width:100%;overflow:hidden}.messages-area{flex:1 1 auto;min-height:0;overflow:hidden}.input-area{flex:0 0 auto;z-index:10}.custom-size{width:100%;max-width:60rem;padding:0 1rem;margin:0 auto}.welcome-agent{--p1: color-mix(in srgb, var(--primary-color) 8%, transparent);background-color:var(--p1)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: AgentAvatarComponent, selector: "lib-agent-avatar", inputs: ["size"] }, { kind: "ngmodule", type: TagModule }, { kind: "ngmodule", type: ChipModule }, { kind: "component", type: MessagesComponent, selector: "lib-messages", inputs: ["messages", "isBotWritting", "scrollMode", "agentIcon"] }, { kind: "component", type: Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "component", type: InputComponent, selector: "lib-input", inputs: ["files", "isRecording", "isLoading", "isBotWritting", "header", "mode"], outputs: ["sendInput", "startRecording", "stopRecording", "uploadFile"] }] });
650
669
  }
651
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: GeneralAgentComponent, decorators: [{
670
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: GeneralAgentComponent, decorators: [{
652
671
  type: Component,
653
672
  args: [{ selector: 'app-general-agent', standalone: true, imports: [CommonModule, FormsModule, ButtonModule, AgentAvatarComponent, TagModule, ChipModule, MessagesComponent, Skeleton, InputComponent], providers: [AgentService], host: {
654
673
  'class': 'block w-full h-full'
@@ -682,7 +701,7 @@ class BubbleChatComponent {
682
701
  async ngOnChanges(changes) {
683
702
  if (changes['agentId'] || changes['agentType'] || changes['idKatios']) {
684
703
  await this.initAgent();
685
- this.addInitialMessages();
704
+ this.agentService.addInitialMessages();
686
705
  }
687
706
  }
688
707
  async initAgent() {
@@ -690,23 +709,12 @@ class BubbleChatComponent {
690
709
  this.agentService.idKatios = this.idKatios;
691
710
  await this.agentService.loadAgent();
692
711
  }
693
- addInitialMessages() {
694
- const initialMessages = [];
695
- this.agentService.headerConfig?.initialMessages?.map(msg => {
696
- initialMessages.push({
697
- role: 'assistant',
698
- type: 'markdown',
699
- content: msg
700
- });
701
- });
702
- this.agentService.addFullMessages(initialMessages);
703
- }
704
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BubbleChatComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
705
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: BubbleChatComponent, isStandalone: true, selector: "lib-bubble-chat", inputs: { agentId: "agentId", idKatios: "idKatios" }, host: { classAttribute: "block w-full h-full" }, providers: [AgentService], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"vm$ | async as vm\">\r\n <div class=\"chat-view\">\r\n <div class=\"messages-wrapper\">\r\n <lib-messages [messages]=\"vm.messages\" [isBotWritting]=\"vm.bot || vm.loading\" scrollMode=\"inline\" [agentIcon]=\"vm.header?.avatar || 'pi pi-sparkles'\">\r\n </lib-messages>\r\n </div>\r\n <div class=\"input-wrapper\">\r\n <lib-input mode=\"bubble\" [files]=\"vm.files || []\" [isRecording]=\"vm.isRec || false\" [isLoading]=\"vm.loading || false\"\r\n [isBotWritting]=\"vm.bot || vm.loading\" [header]=\"vm.header\" (sendInput)=\"agentService.send($event)\"\r\n (startRecording)=\"agentService.startRecording()\" (stopRecording)=\"agentService.stopRecording()\"\r\n (uploadFile)=\"agentService.uploadFile($event)\">\r\n </lib-input>\r\n </div>\r\n </div>\r\n</ng-container>", styles: ["@charset \"UTF-8\";:host{display:flex;flex-direction:column;height:100%;width:100%;overflow:hidden}.chat-view{display:flex;flex-direction:column;height:100%;overflow:hidden;background-color:#f8fafc;background-image:radial-gradient(circle,rgba(30,41,59,.025) 1px,transparent 1px);background-size:24px 24px}.messages-wrapper{flex:1;overflow:hidden;min-height:0}.chat-view .input-wrapper{flex-shrink:0;padding-bottom:env(safe-area-inset-bottom,0);background:#fff;border-top:1px solid #e2e8f0;box-shadow:0 -2px 8px #0000000a}@media (max-width: 768px){.chat-view{height:100%;max-height:100%}.input-wrapper{padding:8px;padding-bottom:calc(8px + env(safe-area-inset-bottom,0))}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "component", type: MessagesComponent, selector: "lib-messages", inputs: ["messages", "isBotWritting", "scrollMode", "agentIcon"] }, { kind: "component", type: InputComponent, selector: "lib-input", inputs: ["files", "isRecording", "isLoading", "isBotWritting", "header", "mode"], outputs: ["sendInput", "startRecording", "stopRecording", "uploadFile"] }] });
712
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: BubbleChatComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
713
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: BubbleChatComponent, isStandalone: true, selector: "lib-bubble-chat", inputs: { agentId: "agentId", idKatios: "idKatios" }, host: { classAttribute: "block w-full h-full" }, usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"vm$ | async as vm\">\r\n <div class=\"chat-view\">\r\n <div class=\"messages-wrapper\">\r\n <lib-messages [messages]=\"vm.messages\" [isBotWritting]=\"vm.bot || vm.loading\" scrollMode=\"inline\" [agentIcon]=\"vm.header?.avatar || 'pi pi-sparkles'\">\r\n </lib-messages>\r\n </div>\r\n <div class=\"input-wrapper\">\r\n <lib-input mode=\"bubble\" [files]=\"vm.files || []\" [isRecording]=\"vm.isRec || false\" [isLoading]=\"vm.loading || false\"\r\n [isBotWritting]=\"vm.bot || vm.loading\" [header]=\"vm.header\" (sendInput)=\"agentService.send($event)\"\r\n (startRecording)=\"agentService.startRecording()\" (stopRecording)=\"agentService.stopRecording()\"\r\n (uploadFile)=\"agentService.uploadFile($event)\">\r\n </lib-input>\r\n </div>\r\n </div>\r\n</ng-container>", styles: ["@charset \"UTF-8\";:host{display:flex;flex-direction:column;height:100%;width:100%;overflow:hidden}.chat-view{display:flex;flex-direction:column;height:100%;overflow:hidden;background-color:#f8fafc;background-image:radial-gradient(circle,rgba(30,41,59,.025) 1px,transparent 1px);background-size:24px 24px}.messages-wrapper{flex:1;overflow:hidden;min-height:0}.chat-view .input-wrapper{flex-shrink:0;padding-bottom:env(safe-area-inset-bottom,0);background:#fff;border-top:1px solid #e2e8f0;box-shadow:0 -2px 8px #0000000a}@media (max-width: 768px){.chat-view{height:100%;max-height:100%}.input-wrapper{padding:8px;padding-bottom:calc(8px + env(safe-area-inset-bottom,0))}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "component", type: MessagesComponent, selector: "lib-messages", inputs: ["messages", "isBotWritting", "scrollMode", "agentIcon"] }, { kind: "component", type: InputComponent, selector: "lib-input", inputs: ["files", "isRecording", "isLoading", "isBotWritting", "header", "mode"], outputs: ["sendInput", "startRecording", "stopRecording", "uploadFile"] }] });
706
714
  }
707
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BubbleChatComponent, decorators: [{
715
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: BubbleChatComponent, decorators: [{
708
716
  type: Component,
709
- args: [{ selector: 'lib-bubble-chat', imports: [CommonModule, MessagesComponent, InputComponent], providers: [AgentService], host: {
717
+ args: [{ selector: 'lib-bubble-chat', imports: [CommonModule, MessagesComponent, InputComponent], host: {
710
718
  'class': 'block w-full h-full',
711
719
  }, template: "<ng-container *ngIf=\"vm$ | async as vm\">\r\n <div class=\"chat-view\">\r\n <div class=\"messages-wrapper\">\r\n <lib-messages [messages]=\"vm.messages\" [isBotWritting]=\"vm.bot || vm.loading\" scrollMode=\"inline\" [agentIcon]=\"vm.header?.avatar || 'pi pi-sparkles'\">\r\n </lib-messages>\r\n </div>\r\n <div class=\"input-wrapper\">\r\n <lib-input mode=\"bubble\" [files]=\"vm.files || []\" [isRecording]=\"vm.isRec || false\" [isLoading]=\"vm.loading || false\"\r\n [isBotWritting]=\"vm.bot || vm.loading\" [header]=\"vm.header\" (sendInput)=\"agentService.send($event)\"\r\n (startRecording)=\"agentService.startRecording()\" (stopRecording)=\"agentService.stopRecording()\"\r\n (uploadFile)=\"agentService.uploadFile($event)\">\r\n </lib-input>\r\n </div>\r\n </div>\r\n</ng-container>", styles: ["@charset \"UTF-8\";:host{display:flex;flex-direction:column;height:100%;width:100%;overflow:hidden}.chat-view{display:flex;flex-direction:column;height:100%;overflow:hidden;background-color:#f8fafc;background-image:radial-gradient(circle,rgba(30,41,59,.025) 1px,transparent 1px);background-size:24px 24px}.messages-wrapper{flex:1;overflow:hidden;min-height:0}.chat-view .input-wrapper{flex-shrink:0;padding-bottom:env(safe-area-inset-bottom,0);background:#fff;border-top:1px solid #e2e8f0;box-shadow:0 -2px 8px #0000000a}@media (max-width: 768px){.chat-view{height:100%;max-height:100%}.input-wrapper{padding:8px;padding-bottom:calc(8px + env(safe-area-inset-bottom,0))}}\n"] }]
712
720
  }], propDecorators: { agentId: [{
@@ -718,9 +726,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
718
726
  class BubbleAgentComponent {
719
727
  aiAgentsGatewayService;
720
728
  messageService;
729
+ agentService = inject(AgentService);
721
730
  idKatios = '';
722
731
  ndoc = '';
723
732
  tdoc = '';
733
+ // chatActions: MenuItem[] = [{
734
+ // label: 'Nueva conversación',
735
+ // icon: 'pi pi-refresh',
736
+ // command: () => this.clearChat()
737
+ // }];
724
738
  // Estado del componente
725
739
  isOpen = false;
726
740
  isExpanded = false;
@@ -779,12 +793,16 @@ class BubbleAgentComponent {
779
793
  goBack() {
780
794
  this.selectedAgent = null;
781
795
  }
782
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BubbleAgentComponent, deps: [{ token: AI_AGENTS }, { token: i1$2.MessageService }], target: i0.ɵɵFactoryTarget.Component });
783
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: BubbleAgentComponent, isStandalone: true, selector: "lib-bubble-agent", inputs: { idKatios: "idKatios", ndoc: "ndoc", tdoc: "tdoc" }, usesOnChanges: true, ngImport: i0, template: "<!-- Bot\u00F3n burbuja flotante -->\n<button class=\"bubble-button shadow-5\" (click)=\"toggleChat()\" [class.is-open]=\"isOpen\" [class.is-expanded]=\"isExpanded\">\n <span class=\"online-indicator\" *ngIf=\"!isOpen\"></span>\n <span class=\"bubble-sparkle\" *ngIf=\"!isOpen\"></span>\n <span class=\"bubble-sparkle\" *ngIf=\"!isOpen\"></span>\n <span class=\"bubble-sparkle\" *ngIf=\"!isOpen\"></span>\n <i class=\"pi\" [ngClass]=\"isOpen ? 'pi-times' : 'pi-comments'\"></i>\n</button>\n\n<!-- Panel del chat -->\n<div class=\"chat-panel\" [class.is-open]=\"isOpen\" [class.is-expanded]=\"isExpanded\">\n <!-- Header del panel -->\n <div class=\"chat-header\">\n <div class=\"flex align-items-center gap-2\">\n <button *ngIf=\"selectedAgent\" class=\"back-button\" (click)=\"goBack()\">\n <i class=\"pi pi-arrow-left\"></i>\n </button>\n <lib-robot-icon style=\"color: white\" *ngIf=\"selectedAgent\"></lib-robot-icon>\n <div class=\"header-text\">\n <p class=\"header-title text-white font-semibold text-lg\">{{ selectedAgent ? selectedAgent.key : 'Agentes IA' }}</p>\n <span class=\"header-status\" *ngIf=\"selectedAgent\">\n <span class=\"header-status-dot\"></span>\n En l\u00EDnea\n </span>\n </div>\n </div>\n <div class=\"flex gap-2\">\n <button class=\"expand-button\" (click)=\"toggleExpand()\" *ngIf=\"selectedAgent\" title=\"Maximizar/Restaurar\">\n <i class=\"pi\" [ngClass]=\"isExpanded ? 'pi-window-minimize' : 'pi-window-maximize'\"></i>\n </button>\n <button class=\"close-button\" (click)=\"toggleChat()\" title=\"Cerrar\">\n <i class=\"pi pi-times\"></i>\n </button>\n </div>\n </div>\n\n <!-- Contenido del panel -->\n <div class=\"chat-content\">\n <!-- Vista de lista de agentes -->\n <div *ngIf=\"!selectedAgent\" class=\"agents-list\">\n <!-- Mensaje cuando no hay agentes -->\n <div *ngIf=\"!agents || agents.length === 0 || loading\" class=\"no-agents\">\n <i class=\"pi text-4xl\" [ngClass]=\"loading ? 'pi-spin pi-cog' : 'pi-sparkles'\"></i>\n <p class=\"text-color-secondary mt-2\">{{ loading ? 'Cargando agentes...' : 'No se encontraron agentes' }}</p>\n </div>\n <!-- Lista de agentes -->\n <div class=\"agent-card\" *ngFor=\"let agent of agents\" (click)=\"selectAgent(agent)\">\n <lib-agent-avatar \n [size]=\"'large'\">\n </lib-agent-avatar>\n <div class=\"agent-info\">\n <p class=\"agent-name text-base font-medium\">{{ agent.key }}</p>\n <p class=\"agent-description text-sm text-color-secondary\">{{ agent.label }}</p>\n </div>\n <span class=\"ai-badge\">\n <i class=\"pi pi-sparkles\"></i>\n AI\n </span>\n <i class=\"pi pi-chevron-right agent-arrow\"></i>\n </div>\n </div>\n\n <!-- Vista de chat con el agente seleccionado -->\n <lib-bubble-chat *ngIf=\"selectedAgent\" \n [agentId]=\"selectedAgent.valor.agentId || ''\" \n [idKatios]=\"idKatios\">\n </lib-bubble-chat>\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";:host{display:block}.bubble-button{position:fixed;bottom:24px;right:24px;width:60px;height:60px;border-radius:50%;background:linear-gradient(145deg,#1e293b,#334155);border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .4s cubic-bezier(.175,.885,.32,1.275);z-index:1000;box-shadow:0 6px 24px #1e293b59,0 0 #1e293b33}@keyframes pulseRings{0%{box-shadow:0 6px 24px #1e293b59,0 0 #1e293b2e}70%{box-shadow:0 6px 24px #1e293b59,0 0 0 14px #1e293b00}to{box-shadow:0 6px 24px #1e293b59,0 0 #1e293b00}}.online-indicator{position:absolute;top:2px;right:2px;width:13px;height:13px;background:#10b981;border-radius:50%;border:2.5px solid white;z-index:1;animation:onlinePulse 2.5s ease-in-out infinite}@keyframes onlinePulse{0%,to{transform:scale(1);opacity:1}50%{transform:scale(1.1);opacity:.9}}.bubble-button:not(.is-open){animation:pulseRings 3s ease-out infinite}.bubble-button:not(.is-open):hover{transform:scale(1.08) translateY(-3px);box-shadow:0 12px 32px #1e293b73;animation:none}.bubble-button.is-open{transform:rotate(90deg);box-shadow:0 4px 16px #1e293b4d}.bubble-button i{font-size:1.5rem;color:#fff;transition:transform .3s ease}.bubble-button:not(.is-open):hover i{transform:scale(1.05)}.bubble-sparkle{position:absolute;width:4px;height:4px;background:#ffffffb3;border-radius:50%;opacity:0;pointer-events:none}.bubble-sparkle:nth-child(1){top:-3px;left:50%;animation:sparkleFloat 4s 0s ease-in-out infinite}.bubble-sparkle:nth-child(2){top:50%;right:-3px;animation:sparkleFloat 4s 1.3s ease-in-out infinite}.bubble-sparkle:nth-child(3){bottom:-3px;left:30%;animation:sparkleFloat 4s 2.6s ease-in-out infinite}@keyframes sparkleFloat{0%,to{opacity:0;transform:scale(0) translateY(0)}30%{opacity:.6;transform:scale(1) translateY(-6px)}60%{opacity:.2;transform:scale(.5) translateY(-12px)}}.chat-panel{position:fixed;bottom:100px;right:24px;width:400px;height:580px;border-radius:20px;background:#fff;backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);display:flex;flex-direction:column;overflow:hidden;opacity:0;visibility:hidden;transform:translateY(20px) scale(.95);transition:all .45s cubic-bezier(.16,1,.3,1);z-index:999;border:1px solid rgba(30,41,59,.08);box-shadow:0 20px 50px -12px #0000002e,0 8px 20px -8px #0000001a}.chat-panel.is-open{opacity:1;visibility:visible;transform:translateY(0) scale(1)}.chat-panel.is-expanded{inset:16px 16px 16px 60px;width:auto;height:auto;max-width:none;max-height:none;border-radius:16px}.bubble-button.is-expanded{opacity:0;visibility:hidden;transform:scale(0);pointer-events:none}.chat-header{background:linear-gradient(145deg,#1e293b,#334155);color:#fff;display:flex;align-items:center;justify-content:space-between;flex-shrink:0;padding:14px 16px;position:relative;z-index:2}.header-text{display:flex;flex-direction:column}.header-title{margin:0;font-weight:600;letter-spacing:-.01em}.header-subtitle{opacity:.85;font-size:.8rem}.header-status{display:flex;align-items:center;gap:5px;font-size:.72rem;opacity:.85;margin-top:2px}.header-status-dot{width:6px;height:6px;background:#10b981;border-radius:50%;animation:onlinePulse 2.5s ease-in-out infinite;box-shadow:0 0 4px #10b98180}.back-button,.close-button,.expand-button{background:#ffffff1a;border:1px solid rgba(255,255,255,.12);border-radius:8px;width:32px;height:32px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s ease;position:relative;z-index:1}.back-button:hover,.close-button:hover,.expand-button:hover{background:#ffffff2e;border-color:#ffffff38}.back-button:active,.close-button:active,.expand-button:active{transform:scale(.95)}.back-button i,.close-button i,.expand-button i{color:#fff;font-size:.85rem}.chat-content{flex:1;overflow:hidden;display:flex;flex-direction:column;background-color:#f8fafc;background-image:radial-gradient(circle,rgba(30,41,59,.03) 1px,transparent 1px);background-size:24px 24px}.agents-list{overflow-y:auto;flex:1;padding:8px}.no-agents{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:2rem;text-align:center}.no-agents i{color:#64748b}.agents-subtitle{color:var(--p-text-muted-color);font-size:.875rem;margin:0 0 16px;text-align:center}.agent-card{display:flex;align-items:center;gap:14px;padding:14px 16px;cursor:pointer;transition:all .25s ease;border-radius:14px;margin-bottom:4px;border:1px solid transparent;position:relative}.agent-card:before{content:\"\";position:absolute;left:0;top:20%;bottom:20%;width:3px;border-radius:0 3px 3px 0;background:#1e293b;opacity:0;transition:opacity .25s ease}.agent-card:hover{background:#1e293b0a;border-color:#1e293b0f;transform:translate(3px)}.agent-card:hover:before{opacity:1}.agent-card:active{transform:translate(2px) scale(.99)}.agent-card:last-child{margin-bottom:0}.agent-info{flex:1;min-width:0}.agent-name{margin:0 0 3px;font-weight:600;color:#1e293b}.agent-description{margin:0;line-height:1.4;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;line-clamp:2;-webkit-line-clamp:2;font-size:.82rem;color:#64748b}.ai-badge{display:inline-flex;align-items:center;gap:4px;font-size:.62rem;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:#475569;background:#1e293b0f;padding:3px 8px;border-radius:6px;border:1px solid rgba(30,41,59,.08);flex-shrink:0}.ai-badge i{font-size:.55rem;color:#475569}.agent-arrow{color:#94a3b8;font-size:.85rem;flex-shrink:0;transition:all .25s ease}.agent-card:hover .agent-arrow{color:#334155;transform:translate(3px)}@media (max-width: 768px){.chat-panel{width:100vw;height:100vh;height:-webkit-fill-available;height:100dvh;max-height:none;inset:0;border-radius:0;transform:translateY(100%)}.chat-panel.is-open{transform:translateY(0)}.bubble-button{bottom:16px;right:16px;width:56px;height:56px}.bubble-button.is-open{opacity:0;visibility:hidden;transform:scale(0)}.expand-button{display:none}.chat-panel.is-expanded{width:100vw;height:100vh;height:-webkit-fill-available;height:100dvh;inset:0;border-radius:0}.chat-content{flex:1;min-height:0;overflow:hidden}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: AgentAvatarComponent, selector: "lib-agent-avatar", inputs: ["size"] }, { kind: "component", type: BubbleChatComponent, selector: "lib-bubble-chat", inputs: ["agentId", "idKatios"] }, { kind: "component", type: RobotIconComponent, selector: "lib-robot-icon" }] });
796
+ clearChat() {
797
+ this.agentService.clearConversation();
798
+ this.agentService.addInitialMessages();
799
+ }
800
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: BubbleAgentComponent, deps: [{ token: AI_AGENTS }, { token: i1$2.MessageService }], target: i0.ɵɵFactoryTarget.Component });
801
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: BubbleAgentComponent, isStandalone: true, selector: "lib-bubble-agent", inputs: { idKatios: "idKatios", ndoc: "ndoc", tdoc: "tdoc" }, providers: [AgentService], usesOnChanges: true, ngImport: i0, template: "<!-- Bot\u00F3n burbuja flotante -->\r\n<button class=\"bubble-button shadow-5\" (click)=\"toggleChat()\" [class.is-open]=\"isOpen\" [class.is-expanded]=\"isExpanded\">\r\n <span class=\"online-indicator\" *ngIf=\"!isOpen\"></span>\r\n <span class=\"bubble-sparkle\" *ngIf=\"!isOpen\"></span>\r\n <span class=\"bubble-sparkle\" *ngIf=\"!isOpen\"></span>\r\n <span class=\"bubble-sparkle\" *ngIf=\"!isOpen\"></span>\r\n <i class=\"pi\" [ngClass]=\"isOpen ? 'pi-times' : 'pi-comments'\"></i>\r\n</button>\r\n\r\n<!-- Panel del chat -->\r\n<div class=\"chat-panel\" [class.is-open]=\"isOpen\" [class.is-expanded]=\"isExpanded\">\r\n <!-- Header del panel -->\r\n <div class=\"chat-header\">\r\n <div class=\"flex align-items-center gap-2\">\r\n <button *ngIf=\"selectedAgent\" class=\"back-button\" (click)=\"goBack()\">\r\n <i class=\"pi pi-arrow-left\"></i>\r\n </button>\r\n <lib-robot-icon style=\"color: white\" *ngIf=\"selectedAgent\"></lib-robot-icon>\r\n <div class=\"header-text\">\r\n <p class=\"header-title text-white font-semibold text-lg\">{{ selectedAgent ? selectedAgent.key : 'Agentes IA' }}\r\n </p>\r\n <span class=\"header-status\" *ngIf=\"selectedAgent\">\r\n <span class=\"header-status-dot\"></span>\r\n En l\u00EDnea\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"flex gap-2\">\r\n <!-- <p-menu #menu [model]=\"chatActions\" [popup]=\"true\" appendTo=\"body\"/>\r\n <button class=\"menu-button\" (click)=\"menu.toggle($event)\" icon=\"pi pi-ellipsis-v\" *ngIf=\"selectedAgent\" title=\"Acciones\">\r\n <i class=\"pi pi-ellipsis-v\"></i>\r\n </button> -->\r\n <button class=\"new-conversation-button\" (click)=\"clearChat()\" *ngIf=\"selectedAgent\"\r\n [disabled]=\"agentService.isBotWritting\" title=\"Nueva conversaci\u00F3n\">\r\n <i class=\"pi pi-refresh\"></i>\r\n </button>\r\n <button class=\"expand-button\" (click)=\"toggleExpand()\" *ngIf=\"selectedAgent\" title=\"Maximizar/Restaurar\">\r\n <i class=\"pi\" [ngClass]=\"isExpanded ? 'pi-window-minimize' : 'pi-window-maximize'\"></i>\r\n </button>\r\n <button class=\"close-button\" (click)=\"toggleChat()\" title=\"Cerrar\">\r\n <i class=\"pi pi-times\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n\r\n <!-- Contenido del panel -->\r\n <div class=\"chat-content\">\r\n <!-- Vista de lista de agentes -->\r\n <div *ngIf=\"!selectedAgent\" class=\"agents-list\">\r\n <!-- Mensaje cuando no hay agentes -->\r\n <div *ngIf=\"!agents || agents.length === 0 || loading\" class=\"no-agents\">\r\n <i class=\"pi text-4xl\" [ngClass]=\"loading ? 'pi-spin pi-cog' : 'pi-sparkles'\"></i>\r\n <p class=\"text-color-secondary mt-2\">{{ loading ? 'Cargando agentes...' : 'No se encontraron agentes' }}</p>\r\n </div>\r\n <!-- Lista de agentes -->\r\n <div class=\"agent-card\" *ngFor=\"let agent of agents\" (click)=\"selectAgent(agent)\">\r\n <lib-agent-avatar [size]=\"'large'\">\r\n </lib-agent-avatar>\r\n <div class=\"agent-info\">\r\n <p class=\"agent-name text-base font-medium\">{{ agent.key }}</p>\r\n <p class=\"agent-description text-sm text-color-secondary\">{{ agent.label }}</p>\r\n </div>\r\n <span class=\"ai-badge\">\r\n <i class=\"pi pi-sparkles\"></i>\r\n AI\r\n </span>\r\n <i class=\"pi pi-chevron-right agent-arrow\"></i>\r\n </div>\r\n </div>\r\n\r\n <!-- Vista de chat con el agente seleccionado -->\r\n <lib-bubble-chat *ngIf=\"selectedAgent\" [agentId]=\"selectedAgent.valor.agentId || ''\" [idKatios]=\"idKatios\">\r\n </lib-bubble-chat>\r\n </div>\r\n</div>", styles: ["@charset \"UTF-8\";:host{display:block}.bubble-button{position:fixed;bottom:24px;right:24px;width:60px;height:60px;border-radius:50%;background:linear-gradient(145deg,#1e293b,#334155);border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .4s cubic-bezier(.175,.885,.32,1.275);z-index:1000;box-shadow:0 6px 24px #1e293b59,0 0 #1e293b33}@keyframes pulseRings{0%{box-shadow:0 6px 24px #1e293b59,0 0 #1e293b2e}70%{box-shadow:0 6px 24px #1e293b59,0 0 0 14px #1e293b00}to{box-shadow:0 6px 24px #1e293b59,0 0 #1e293b00}}.online-indicator{position:absolute;top:2px;right:2px;width:13px;height:13px;background:#10b981;border-radius:50%;border:2.5px solid white;z-index:1;animation:onlinePulse 2.5s ease-in-out infinite}@keyframes onlinePulse{0%,to{transform:scale(1);opacity:1}50%{transform:scale(1.1);opacity:.9}}.bubble-button:not(.is-open){animation:pulseRings 3s ease-out infinite}.bubble-button:not(.is-open):hover{transform:scale(1.08) translateY(-3px);box-shadow:0 12px 32px #1e293b73;animation:none}.bubble-button.is-open{transform:rotate(90deg);box-shadow:0 4px 16px #1e293b4d}.bubble-button i{font-size:1.5rem;color:#fff;transition:transform .3s ease}.bubble-button:not(.is-open):hover i{transform:scale(1.05)}.bubble-sparkle{position:absolute;width:4px;height:4px;background:#ffffffb3;border-radius:50%;opacity:0;pointer-events:none}.bubble-sparkle:nth-child(1){top:-3px;left:50%;animation:sparkleFloat 4s 0s ease-in-out infinite}.bubble-sparkle:nth-child(2){top:50%;right:-3px;animation:sparkleFloat 4s 1.3s ease-in-out infinite}.bubble-sparkle:nth-child(3){bottom:-3px;left:30%;animation:sparkleFloat 4s 2.6s ease-in-out infinite}@keyframes sparkleFloat{0%,to{opacity:0;transform:scale(0) translateY(0)}30%{opacity:.6;transform:scale(1) translateY(-6px)}60%{opacity:.2;transform:scale(.5) translateY(-12px)}}.chat-panel{position:fixed;bottom:100px;right:24px;width:400px;height:580px;border-radius:20px;background:#fff;backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);display:flex;flex-direction:column;overflow:hidden;opacity:0;visibility:hidden;transform:translateY(20px) scale(.95);transition:all .45s cubic-bezier(.16,1,.3,1);z-index:999;border:1px solid rgba(30,41,59,.08);box-shadow:0 20px 50px -12px #0000002e,0 8px 20px -8px #0000001a}.chat-panel.is-open{opacity:1;visibility:visible;transform:translateY(0) scale(1)}.chat-panel.is-expanded{inset:16px 16px 16px 60px;width:auto;height:auto;max-width:none;max-height:none;border-radius:16px}.bubble-button.is-expanded{opacity:0;visibility:hidden;transform:scale(0);pointer-events:none}.chat-header{background:linear-gradient(145deg,#1e293b,#334155);color:#fff;display:flex;align-items:center;justify-content:space-between;flex-shrink:0;padding:14px 16px;position:relative;z-index:2}.header-text{display:flex;flex-direction:column}.header-title{margin:0;font-weight:600;letter-spacing:-.01em}.header-subtitle{opacity:.85;font-size:.8rem}.header-status{display:flex;align-items:center;gap:5px;font-size:.72rem;opacity:.85;margin-top:2px}.header-status-dot{width:6px;height:6px;background:#10b981;border-radius:50%;animation:onlinePulse 2.5s ease-in-out infinite;box-shadow:0 0 4px #10b98180}.back-button,.close-button,.expand-button,.menu-button,.new-conversation-button{background:#ffffff1a;border:1px solid rgba(255,255,255,.12);border-radius:8px;width:32px;height:32px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s ease;position:relative;z-index:1}.back-button:hover,.close-button:hover,.expand-button:hover,.menu-button:hover,.new-conversation-button:hover{background:#ffffff2e;border-color:#ffffff38}.back-button:active,.close-button:active,.expand-button:active{transform:scale(.95)}.new-conversation-button:disabled{opacity:.35;cursor:not-allowed;pointer-events:none}.back-button i,.close-button i,.expand-button i{color:#fff;font-size:.85rem}.chat-content{flex:1;overflow:hidden;display:flex;flex-direction:column;background-color:#f8fafc;background-image:radial-gradient(circle,rgba(30,41,59,.03) 1px,transparent 1px);background-size:24px 24px}.agents-list{overflow-y:auto;flex:1;padding:8px}.no-agents{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:2rem;text-align:center}.no-agents i{color:#64748b}.agents-subtitle{color:var(--p-text-muted-color);font-size:.875rem;margin:0 0 16px;text-align:center}.agent-card{display:flex;align-items:center;gap:14px;padding:14px 16px;cursor:pointer;transition:all .25s ease;border-radius:14px;margin-bottom:4px;border:1px solid transparent;position:relative}.agent-card:before{content:\"\";position:absolute;left:0;top:20%;bottom:20%;width:3px;border-radius:0 3px 3px 0;background:#1e293b;opacity:0;transition:opacity .25s ease}.agent-card:hover{background:#1e293b0a;border-color:#1e293b0f;transform:translate(3px)}.agent-card:hover:before{opacity:1}.agent-card:active{transform:translate(2px) scale(.99)}.agent-card:last-child{margin-bottom:0}.agent-info{flex:1;min-width:0}.agent-name{margin:0 0 3px;font-weight:600;color:#1e293b}.agent-description{margin:0;line-height:1.4;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;line-clamp:2;-webkit-line-clamp:2;font-size:.82rem;color:#64748b}.ai-badge{display:inline-flex;align-items:center;gap:4px;font-size:.62rem;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:#475569;background:#1e293b0f;padding:3px 8px;border-radius:6px;border:1px solid rgba(30,41,59,.08);flex-shrink:0}.ai-badge i{font-size:.55rem;color:#475569}.agent-arrow{color:#94a3b8;font-size:.85rem;flex-shrink:0;transition:all .25s ease}.agent-card:hover .agent-arrow{color:#334155;transform:translate(3px)}@media (max-width: 768px){.chat-panel{width:100vw;height:100vh;height:-webkit-fill-available;height:100dvh;max-height:none;inset:0;border-radius:0;transform:translateY(100%)}.chat-panel.is-open{transform:translateY(0)}.bubble-button{bottom:16px;right:16px;width:56px;height:56px}.bubble-button.is-open{opacity:0;visibility:hidden;transform:scale(0)}.expand-button{display:none}.chat-panel.is-expanded{width:100vw;height:100vh;height:-webkit-fill-available;height:100dvh;inset:0;border-radius:0}.chat-content{flex:1;min-height:0;overflow:hidden}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: AgentAvatarComponent, selector: "lib-agent-avatar", inputs: ["size"] }, { kind: "component", type: BubbleChatComponent, selector: "lib-bubble-chat", inputs: ["agentId", "idKatios"] }, { kind: "component", type: RobotIconComponent, selector: "lib-robot-icon" }, { kind: "ngmodule", type: MenuModule }] });
784
802
  }
785
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BubbleAgentComponent, decorators: [{
803
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: BubbleAgentComponent, decorators: [{
786
804
  type: Component,
787
- args: [{ selector: 'lib-bubble-agent', standalone: true, imports: [CommonModule, ButtonModule, AgentAvatarComponent, BubbleChatComponent, RobotIconComponent], template: "<!-- Bot\u00F3n burbuja flotante -->\n<button class=\"bubble-button shadow-5\" (click)=\"toggleChat()\" [class.is-open]=\"isOpen\" [class.is-expanded]=\"isExpanded\">\n <span class=\"online-indicator\" *ngIf=\"!isOpen\"></span>\n <span class=\"bubble-sparkle\" *ngIf=\"!isOpen\"></span>\n <span class=\"bubble-sparkle\" *ngIf=\"!isOpen\"></span>\n <span class=\"bubble-sparkle\" *ngIf=\"!isOpen\"></span>\n <i class=\"pi\" [ngClass]=\"isOpen ? 'pi-times' : 'pi-comments'\"></i>\n</button>\n\n<!-- Panel del chat -->\n<div class=\"chat-panel\" [class.is-open]=\"isOpen\" [class.is-expanded]=\"isExpanded\">\n <!-- Header del panel -->\n <div class=\"chat-header\">\n <div class=\"flex align-items-center gap-2\">\n <button *ngIf=\"selectedAgent\" class=\"back-button\" (click)=\"goBack()\">\n <i class=\"pi pi-arrow-left\"></i>\n </button>\n <lib-robot-icon style=\"color: white\" *ngIf=\"selectedAgent\"></lib-robot-icon>\n <div class=\"header-text\">\n <p class=\"header-title text-white font-semibold text-lg\">{{ selectedAgent ? selectedAgent.key : 'Agentes IA' }}</p>\n <span class=\"header-status\" *ngIf=\"selectedAgent\">\n <span class=\"header-status-dot\"></span>\n En l\u00EDnea\n </span>\n </div>\n </div>\n <div class=\"flex gap-2\">\n <button class=\"expand-button\" (click)=\"toggleExpand()\" *ngIf=\"selectedAgent\" title=\"Maximizar/Restaurar\">\n <i class=\"pi\" [ngClass]=\"isExpanded ? 'pi-window-minimize' : 'pi-window-maximize'\"></i>\n </button>\n <button class=\"close-button\" (click)=\"toggleChat()\" title=\"Cerrar\">\n <i class=\"pi pi-times\"></i>\n </button>\n </div>\n </div>\n\n <!-- Contenido del panel -->\n <div class=\"chat-content\">\n <!-- Vista de lista de agentes -->\n <div *ngIf=\"!selectedAgent\" class=\"agents-list\">\n <!-- Mensaje cuando no hay agentes -->\n <div *ngIf=\"!agents || agents.length === 0 || loading\" class=\"no-agents\">\n <i class=\"pi text-4xl\" [ngClass]=\"loading ? 'pi-spin pi-cog' : 'pi-sparkles'\"></i>\n <p class=\"text-color-secondary mt-2\">{{ loading ? 'Cargando agentes...' : 'No se encontraron agentes' }}</p>\n </div>\n <!-- Lista de agentes -->\n <div class=\"agent-card\" *ngFor=\"let agent of agents\" (click)=\"selectAgent(agent)\">\n <lib-agent-avatar \n [size]=\"'large'\">\n </lib-agent-avatar>\n <div class=\"agent-info\">\n <p class=\"agent-name text-base font-medium\">{{ agent.key }}</p>\n <p class=\"agent-description text-sm text-color-secondary\">{{ agent.label }}</p>\n </div>\n <span class=\"ai-badge\">\n <i class=\"pi pi-sparkles\"></i>\n AI\n </span>\n <i class=\"pi pi-chevron-right agent-arrow\"></i>\n </div>\n </div>\n\n <!-- Vista de chat con el agente seleccionado -->\n <lib-bubble-chat *ngIf=\"selectedAgent\" \n [agentId]=\"selectedAgent.valor.agentId || ''\" \n [idKatios]=\"idKatios\">\n </lib-bubble-chat>\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";:host{display:block}.bubble-button{position:fixed;bottom:24px;right:24px;width:60px;height:60px;border-radius:50%;background:linear-gradient(145deg,#1e293b,#334155);border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .4s cubic-bezier(.175,.885,.32,1.275);z-index:1000;box-shadow:0 6px 24px #1e293b59,0 0 #1e293b33}@keyframes pulseRings{0%{box-shadow:0 6px 24px #1e293b59,0 0 #1e293b2e}70%{box-shadow:0 6px 24px #1e293b59,0 0 0 14px #1e293b00}to{box-shadow:0 6px 24px #1e293b59,0 0 #1e293b00}}.online-indicator{position:absolute;top:2px;right:2px;width:13px;height:13px;background:#10b981;border-radius:50%;border:2.5px solid white;z-index:1;animation:onlinePulse 2.5s ease-in-out infinite}@keyframes onlinePulse{0%,to{transform:scale(1);opacity:1}50%{transform:scale(1.1);opacity:.9}}.bubble-button:not(.is-open){animation:pulseRings 3s ease-out infinite}.bubble-button:not(.is-open):hover{transform:scale(1.08) translateY(-3px);box-shadow:0 12px 32px #1e293b73;animation:none}.bubble-button.is-open{transform:rotate(90deg);box-shadow:0 4px 16px #1e293b4d}.bubble-button i{font-size:1.5rem;color:#fff;transition:transform .3s ease}.bubble-button:not(.is-open):hover i{transform:scale(1.05)}.bubble-sparkle{position:absolute;width:4px;height:4px;background:#ffffffb3;border-radius:50%;opacity:0;pointer-events:none}.bubble-sparkle:nth-child(1){top:-3px;left:50%;animation:sparkleFloat 4s 0s ease-in-out infinite}.bubble-sparkle:nth-child(2){top:50%;right:-3px;animation:sparkleFloat 4s 1.3s ease-in-out infinite}.bubble-sparkle:nth-child(3){bottom:-3px;left:30%;animation:sparkleFloat 4s 2.6s ease-in-out infinite}@keyframes sparkleFloat{0%,to{opacity:0;transform:scale(0) translateY(0)}30%{opacity:.6;transform:scale(1) translateY(-6px)}60%{opacity:.2;transform:scale(.5) translateY(-12px)}}.chat-panel{position:fixed;bottom:100px;right:24px;width:400px;height:580px;border-radius:20px;background:#fff;backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);display:flex;flex-direction:column;overflow:hidden;opacity:0;visibility:hidden;transform:translateY(20px) scale(.95);transition:all .45s cubic-bezier(.16,1,.3,1);z-index:999;border:1px solid rgba(30,41,59,.08);box-shadow:0 20px 50px -12px #0000002e,0 8px 20px -8px #0000001a}.chat-panel.is-open{opacity:1;visibility:visible;transform:translateY(0) scale(1)}.chat-panel.is-expanded{inset:16px 16px 16px 60px;width:auto;height:auto;max-width:none;max-height:none;border-radius:16px}.bubble-button.is-expanded{opacity:0;visibility:hidden;transform:scale(0);pointer-events:none}.chat-header{background:linear-gradient(145deg,#1e293b,#334155);color:#fff;display:flex;align-items:center;justify-content:space-between;flex-shrink:0;padding:14px 16px;position:relative;z-index:2}.header-text{display:flex;flex-direction:column}.header-title{margin:0;font-weight:600;letter-spacing:-.01em}.header-subtitle{opacity:.85;font-size:.8rem}.header-status{display:flex;align-items:center;gap:5px;font-size:.72rem;opacity:.85;margin-top:2px}.header-status-dot{width:6px;height:6px;background:#10b981;border-radius:50%;animation:onlinePulse 2.5s ease-in-out infinite;box-shadow:0 0 4px #10b98180}.back-button,.close-button,.expand-button{background:#ffffff1a;border:1px solid rgba(255,255,255,.12);border-radius:8px;width:32px;height:32px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s ease;position:relative;z-index:1}.back-button:hover,.close-button:hover,.expand-button:hover{background:#ffffff2e;border-color:#ffffff38}.back-button:active,.close-button:active,.expand-button:active{transform:scale(.95)}.back-button i,.close-button i,.expand-button i{color:#fff;font-size:.85rem}.chat-content{flex:1;overflow:hidden;display:flex;flex-direction:column;background-color:#f8fafc;background-image:radial-gradient(circle,rgba(30,41,59,.03) 1px,transparent 1px);background-size:24px 24px}.agents-list{overflow-y:auto;flex:1;padding:8px}.no-agents{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:2rem;text-align:center}.no-agents i{color:#64748b}.agents-subtitle{color:var(--p-text-muted-color);font-size:.875rem;margin:0 0 16px;text-align:center}.agent-card{display:flex;align-items:center;gap:14px;padding:14px 16px;cursor:pointer;transition:all .25s ease;border-radius:14px;margin-bottom:4px;border:1px solid transparent;position:relative}.agent-card:before{content:\"\";position:absolute;left:0;top:20%;bottom:20%;width:3px;border-radius:0 3px 3px 0;background:#1e293b;opacity:0;transition:opacity .25s ease}.agent-card:hover{background:#1e293b0a;border-color:#1e293b0f;transform:translate(3px)}.agent-card:hover:before{opacity:1}.agent-card:active{transform:translate(2px) scale(.99)}.agent-card:last-child{margin-bottom:0}.agent-info{flex:1;min-width:0}.agent-name{margin:0 0 3px;font-weight:600;color:#1e293b}.agent-description{margin:0;line-height:1.4;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;line-clamp:2;-webkit-line-clamp:2;font-size:.82rem;color:#64748b}.ai-badge{display:inline-flex;align-items:center;gap:4px;font-size:.62rem;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:#475569;background:#1e293b0f;padding:3px 8px;border-radius:6px;border:1px solid rgba(30,41,59,.08);flex-shrink:0}.ai-badge i{font-size:.55rem;color:#475569}.agent-arrow{color:#94a3b8;font-size:.85rem;flex-shrink:0;transition:all .25s ease}.agent-card:hover .agent-arrow{color:#334155;transform:translate(3px)}@media (max-width: 768px){.chat-panel{width:100vw;height:100vh;height:-webkit-fill-available;height:100dvh;max-height:none;inset:0;border-radius:0;transform:translateY(100%)}.chat-panel.is-open{transform:translateY(0)}.bubble-button{bottom:16px;right:16px;width:56px;height:56px}.bubble-button.is-open{opacity:0;visibility:hidden;transform:scale(0)}.expand-button{display:none}.chat-panel.is-expanded{width:100vw;height:100vh;height:-webkit-fill-available;height:100dvh;inset:0;border-radius:0}.chat-content{flex:1;min-height:0;overflow:hidden}}\n"] }]
805
+ args: [{ selector: 'lib-bubble-agent', standalone: true, imports: [CommonModule, ButtonModule, AgentAvatarComponent, BubbleChatComponent, RobotIconComponent, MenuModule], providers: [AgentService], template: "<!-- Bot\u00F3n burbuja flotante -->\r\n<button class=\"bubble-button shadow-5\" (click)=\"toggleChat()\" [class.is-open]=\"isOpen\" [class.is-expanded]=\"isExpanded\">\r\n <span class=\"online-indicator\" *ngIf=\"!isOpen\"></span>\r\n <span class=\"bubble-sparkle\" *ngIf=\"!isOpen\"></span>\r\n <span class=\"bubble-sparkle\" *ngIf=\"!isOpen\"></span>\r\n <span class=\"bubble-sparkle\" *ngIf=\"!isOpen\"></span>\r\n <i class=\"pi\" [ngClass]=\"isOpen ? 'pi-times' : 'pi-comments'\"></i>\r\n</button>\r\n\r\n<!-- Panel del chat -->\r\n<div class=\"chat-panel\" [class.is-open]=\"isOpen\" [class.is-expanded]=\"isExpanded\">\r\n <!-- Header del panel -->\r\n <div class=\"chat-header\">\r\n <div class=\"flex align-items-center gap-2\">\r\n <button *ngIf=\"selectedAgent\" class=\"back-button\" (click)=\"goBack()\">\r\n <i class=\"pi pi-arrow-left\"></i>\r\n </button>\r\n <lib-robot-icon style=\"color: white\" *ngIf=\"selectedAgent\"></lib-robot-icon>\r\n <div class=\"header-text\">\r\n <p class=\"header-title text-white font-semibold text-lg\">{{ selectedAgent ? selectedAgent.key : 'Agentes IA' }}\r\n </p>\r\n <span class=\"header-status\" *ngIf=\"selectedAgent\">\r\n <span class=\"header-status-dot\"></span>\r\n En l\u00EDnea\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"flex gap-2\">\r\n <!-- <p-menu #menu [model]=\"chatActions\" [popup]=\"true\" appendTo=\"body\"/>\r\n <button class=\"menu-button\" (click)=\"menu.toggle($event)\" icon=\"pi pi-ellipsis-v\" *ngIf=\"selectedAgent\" title=\"Acciones\">\r\n <i class=\"pi pi-ellipsis-v\"></i>\r\n </button> -->\r\n <button class=\"new-conversation-button\" (click)=\"clearChat()\" *ngIf=\"selectedAgent\"\r\n [disabled]=\"agentService.isBotWritting\" title=\"Nueva conversaci\u00F3n\">\r\n <i class=\"pi pi-refresh\"></i>\r\n </button>\r\n <button class=\"expand-button\" (click)=\"toggleExpand()\" *ngIf=\"selectedAgent\" title=\"Maximizar/Restaurar\">\r\n <i class=\"pi\" [ngClass]=\"isExpanded ? 'pi-window-minimize' : 'pi-window-maximize'\"></i>\r\n </button>\r\n <button class=\"close-button\" (click)=\"toggleChat()\" title=\"Cerrar\">\r\n <i class=\"pi pi-times\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n\r\n <!-- Contenido del panel -->\r\n <div class=\"chat-content\">\r\n <!-- Vista de lista de agentes -->\r\n <div *ngIf=\"!selectedAgent\" class=\"agents-list\">\r\n <!-- Mensaje cuando no hay agentes -->\r\n <div *ngIf=\"!agents || agents.length === 0 || loading\" class=\"no-agents\">\r\n <i class=\"pi text-4xl\" [ngClass]=\"loading ? 'pi-spin pi-cog' : 'pi-sparkles'\"></i>\r\n <p class=\"text-color-secondary mt-2\">{{ loading ? 'Cargando agentes...' : 'No se encontraron agentes' }}</p>\r\n </div>\r\n <!-- Lista de agentes -->\r\n <div class=\"agent-card\" *ngFor=\"let agent of agents\" (click)=\"selectAgent(agent)\">\r\n <lib-agent-avatar [size]=\"'large'\">\r\n </lib-agent-avatar>\r\n <div class=\"agent-info\">\r\n <p class=\"agent-name text-base font-medium\">{{ agent.key }}</p>\r\n <p class=\"agent-description text-sm text-color-secondary\">{{ agent.label }}</p>\r\n </div>\r\n <span class=\"ai-badge\">\r\n <i class=\"pi pi-sparkles\"></i>\r\n AI\r\n </span>\r\n <i class=\"pi pi-chevron-right agent-arrow\"></i>\r\n </div>\r\n </div>\r\n\r\n <!-- Vista de chat con el agente seleccionado -->\r\n <lib-bubble-chat *ngIf=\"selectedAgent\" [agentId]=\"selectedAgent.valor.agentId || ''\" [idKatios]=\"idKatios\">\r\n </lib-bubble-chat>\r\n </div>\r\n</div>", styles: ["@charset \"UTF-8\";:host{display:block}.bubble-button{position:fixed;bottom:24px;right:24px;width:60px;height:60px;border-radius:50%;background:linear-gradient(145deg,#1e293b,#334155);border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .4s cubic-bezier(.175,.885,.32,1.275);z-index:1000;box-shadow:0 6px 24px #1e293b59,0 0 #1e293b33}@keyframes pulseRings{0%{box-shadow:0 6px 24px #1e293b59,0 0 #1e293b2e}70%{box-shadow:0 6px 24px #1e293b59,0 0 0 14px #1e293b00}to{box-shadow:0 6px 24px #1e293b59,0 0 #1e293b00}}.online-indicator{position:absolute;top:2px;right:2px;width:13px;height:13px;background:#10b981;border-radius:50%;border:2.5px solid white;z-index:1;animation:onlinePulse 2.5s ease-in-out infinite}@keyframes onlinePulse{0%,to{transform:scale(1);opacity:1}50%{transform:scale(1.1);opacity:.9}}.bubble-button:not(.is-open){animation:pulseRings 3s ease-out infinite}.bubble-button:not(.is-open):hover{transform:scale(1.08) translateY(-3px);box-shadow:0 12px 32px #1e293b73;animation:none}.bubble-button.is-open{transform:rotate(90deg);box-shadow:0 4px 16px #1e293b4d}.bubble-button i{font-size:1.5rem;color:#fff;transition:transform .3s ease}.bubble-button:not(.is-open):hover i{transform:scale(1.05)}.bubble-sparkle{position:absolute;width:4px;height:4px;background:#ffffffb3;border-radius:50%;opacity:0;pointer-events:none}.bubble-sparkle:nth-child(1){top:-3px;left:50%;animation:sparkleFloat 4s 0s ease-in-out infinite}.bubble-sparkle:nth-child(2){top:50%;right:-3px;animation:sparkleFloat 4s 1.3s ease-in-out infinite}.bubble-sparkle:nth-child(3){bottom:-3px;left:30%;animation:sparkleFloat 4s 2.6s ease-in-out infinite}@keyframes sparkleFloat{0%,to{opacity:0;transform:scale(0) translateY(0)}30%{opacity:.6;transform:scale(1) translateY(-6px)}60%{opacity:.2;transform:scale(.5) translateY(-12px)}}.chat-panel{position:fixed;bottom:100px;right:24px;width:400px;height:580px;border-radius:20px;background:#fff;backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);display:flex;flex-direction:column;overflow:hidden;opacity:0;visibility:hidden;transform:translateY(20px) scale(.95);transition:all .45s cubic-bezier(.16,1,.3,1);z-index:999;border:1px solid rgba(30,41,59,.08);box-shadow:0 20px 50px -12px #0000002e,0 8px 20px -8px #0000001a}.chat-panel.is-open{opacity:1;visibility:visible;transform:translateY(0) scale(1)}.chat-panel.is-expanded{inset:16px 16px 16px 60px;width:auto;height:auto;max-width:none;max-height:none;border-radius:16px}.bubble-button.is-expanded{opacity:0;visibility:hidden;transform:scale(0);pointer-events:none}.chat-header{background:linear-gradient(145deg,#1e293b,#334155);color:#fff;display:flex;align-items:center;justify-content:space-between;flex-shrink:0;padding:14px 16px;position:relative;z-index:2}.header-text{display:flex;flex-direction:column}.header-title{margin:0;font-weight:600;letter-spacing:-.01em}.header-subtitle{opacity:.85;font-size:.8rem}.header-status{display:flex;align-items:center;gap:5px;font-size:.72rem;opacity:.85;margin-top:2px}.header-status-dot{width:6px;height:6px;background:#10b981;border-radius:50%;animation:onlinePulse 2.5s ease-in-out infinite;box-shadow:0 0 4px #10b98180}.back-button,.close-button,.expand-button,.menu-button,.new-conversation-button{background:#ffffff1a;border:1px solid rgba(255,255,255,.12);border-radius:8px;width:32px;height:32px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s ease;position:relative;z-index:1}.back-button:hover,.close-button:hover,.expand-button:hover,.menu-button:hover,.new-conversation-button:hover{background:#ffffff2e;border-color:#ffffff38}.back-button:active,.close-button:active,.expand-button:active{transform:scale(.95)}.new-conversation-button:disabled{opacity:.35;cursor:not-allowed;pointer-events:none}.back-button i,.close-button i,.expand-button i{color:#fff;font-size:.85rem}.chat-content{flex:1;overflow:hidden;display:flex;flex-direction:column;background-color:#f8fafc;background-image:radial-gradient(circle,rgba(30,41,59,.03) 1px,transparent 1px);background-size:24px 24px}.agents-list{overflow-y:auto;flex:1;padding:8px}.no-agents{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:2rem;text-align:center}.no-agents i{color:#64748b}.agents-subtitle{color:var(--p-text-muted-color);font-size:.875rem;margin:0 0 16px;text-align:center}.agent-card{display:flex;align-items:center;gap:14px;padding:14px 16px;cursor:pointer;transition:all .25s ease;border-radius:14px;margin-bottom:4px;border:1px solid transparent;position:relative}.agent-card:before{content:\"\";position:absolute;left:0;top:20%;bottom:20%;width:3px;border-radius:0 3px 3px 0;background:#1e293b;opacity:0;transition:opacity .25s ease}.agent-card:hover{background:#1e293b0a;border-color:#1e293b0f;transform:translate(3px)}.agent-card:hover:before{opacity:1}.agent-card:active{transform:translate(2px) scale(.99)}.agent-card:last-child{margin-bottom:0}.agent-info{flex:1;min-width:0}.agent-name{margin:0 0 3px;font-weight:600;color:#1e293b}.agent-description{margin:0;line-height:1.4;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;line-clamp:2;-webkit-line-clamp:2;font-size:.82rem;color:#64748b}.ai-badge{display:inline-flex;align-items:center;gap:4px;font-size:.62rem;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:#475569;background:#1e293b0f;padding:3px 8px;border-radius:6px;border:1px solid rgba(30,41,59,.08);flex-shrink:0}.ai-badge i{font-size:.55rem;color:#475569}.agent-arrow{color:#94a3b8;font-size:.85rem;flex-shrink:0;transition:all .25s ease}.agent-card:hover .agent-arrow{color:#334155;transform:translate(3px)}@media (max-width: 768px){.chat-panel{width:100vw;height:100vh;height:-webkit-fill-available;height:100dvh;max-height:none;inset:0;border-radius:0;transform:translateY(100%)}.chat-panel.is-open{transform:translateY(0)}.bubble-button{bottom:16px;right:16px;width:56px;height:56px}.bubble-button.is-open{opacity:0;visibility:hidden;transform:scale(0)}.expand-button{display:none}.chat-panel.is-expanded{width:100vw;height:100vh;height:-webkit-fill-available;height:100dvh;inset:0;border-radius:0}.chat-content{flex:1;min-height:0;overflow:hidden}}\n"] }]
788
806
  }], ctorParameters: () => [{ type: undefined, decorators: [{
789
807
  type: Inject,
790
808
  args: [AI_AGENTS]
@@ -1 +1 @@
1
- {"version":3,"file":"sf-aiembedded.mjs","sources":["../../../projects/general-agent/src/lib/agents-backend.port.ts","../../../projects/general-agent/src/lib/general-agent/services/agent.service.ts","../../../projects/general-agent/src/lib/general-agent/types/text/text.component.ts","../../../projects/general-agent/src/lib/general-agent/types/text/text.component.html","../../../projects/general-agent/src/lib/general-agent/types/file/file.component.ts","../../../projects/general-agent/src/lib/general-agent/types/file/file.component.html","../../../projects/general-agent/src/lib/general-agent/types/table/table.component.ts","../../../projects/general-agent/src/lib/general-agent/types/table/table.component.html","../../../projects/general-agent/src/lib/general-agent/types/markdown/markdown.component.ts","../../../projects/general-agent/src/lib/general-agent/types/markdown/markdown.component.html","../../../projects/general-agent/src/lib/general-agent/components/robot-icon/robot-icon.component.ts","../../../projects/general-agent/src/lib/general-agent/components/robot-icon/robot-icon.component.html","../../../projects/general-agent/src/lib/general-agent/components/agent-avatar/agent-avatar.component.ts","../../../projects/general-agent/src/lib/general-agent/components/agent-avatar/agent-avatar.component.html","../../../projects/general-agent/src/lib/general-agent/components/messages/messages.component.ts","../../../projects/general-agent/src/lib/general-agent/components/messages/messages.component.html","../../../projects/general-agent/src/lib/general-agent/components/input/input.component.ts","../../../projects/general-agent/src/lib/general-agent/components/input/input.component.html","../../../projects/general-agent/src/lib/general-agent/general-agent.component.ts","../../../projects/general-agent/src/lib/general-agent/general-agent.component.html","../../../projects/general-agent/src/lib/general-agent/components/bubble-chat/bubble-chat.component.ts","../../../projects/general-agent/src/lib/general-agent/components/bubble-chat/bubble-chat.component.html","../../../projects/general-agent/src/lib/general-agent/agents/bubble-chat/bubble-agent.component.ts","../../../projects/general-agent/src/lib/general-agent/agents/bubble-chat/bubble-agent.component.html","../../../projects/general-agent/src/public-api.ts","../../../projects/general-agent/src/sf-aiembedded.ts"],"sourcesContent":["// projects/general-agent/src/lib/agents-backend.port.ts\r\nimport { InjectionToken } from '@angular/core';\r\nimport { Observable } from 'rxjs';\r\n\r\nexport interface AiAgentsGatewayService {\r\n getAgent(idKatios: string, agentId: string): Promise<any>;\r\n sendMessage(idKatios: string, agentId: string, req: {\r\n conversationId?: string;\r\n text: string;\r\n files: Array<{fileName:string; contentType:string; base64Data:string;}>;\r\n metadata?: any;\r\n }): Promise<{\r\n conversationId: string;\r\n messages: Array<{ role?: string; type?: string; content: any }>;\r\n }>;\r\n transcribeAudio(idKatios: string, audio:File): Promise<string>;\r\n getAgents(idKatios: string, ndoc: string, tdoc: string): Observable<any>;\r\n get metadata(): Record<string, any>;\r\n}\r\n\r\nexport const AI_AGENTS = new InjectionToken<AiAgentsGatewayService>('AI_AGENTS');\r\n","import { ChangeDetectorRef, Inject, Injectable, NgZone } from '@angular/core';\r\nimport { AI_AGENTS, AiAgentsGatewayService } from '../../agents-backend.port';\r\nimport { BehaviorSubject, Subject } from 'rxjs';\r\nimport { ChatMessage, HeaderConfig } from '../models/agent.model';\r\n\r\n@Injectable()\r\nexport class AgentService {\r\n // Propiedades internas (ya no inputs/outputs)\r\n // Propiedades para notificar cambios a los componentes que usan el servicio\r\n private readonly messagesSubject = new BehaviorSubject<ChatMessage[]>([]);\r\n readonly messages$ = this.messagesSubject.asObservable();\r\n private readonly isBotWrittingSubject = new BehaviorSubject<boolean>(false);\r\n readonly isBotWritting$ = this.isBotWrittingSubject.asObservable();\r\n private readonly isRecordingSubject = new BehaviorSubject<boolean>(false);\r\n readonly isRecording$ = this.isRecordingSubject.asObservable();\r\n private readonly isLoadingSubject = new BehaviorSubject<boolean>(false);\r\n readonly isLoading$ = this.isLoadingSubject.asObservable();\r\n private readonly headerConfigSubject = new BehaviorSubject<HeaderConfig | undefined>(undefined);\r\n readonly headerConfig$ = this.headerConfigSubject.asObservable();\r\n private readonly selectedFilesSubject = new BehaviorSubject<File[]>([]);\r\n readonly selectedFiles$ = this.selectedFilesSubject.asObservable();\r\n private mediaRecorder?: MediaRecorder;\r\n private audioChunks: BlobPart[] = [];\r\n private recordingStream?: MediaStream;\r\n _agentInfo: any;\r\n _configuration: any;\r\n _sessionId: string = '';\r\n _agentId = '';\r\n _idKatios = '';\r\n\r\n\r\n constructor(\r\n @Inject(AI_AGENTS) private aiAgentsGatewayService: AiAgentsGatewayService,\r\n private zone: NgZone\r\n ) { }\r\n\r\n get agentId() {\r\n return this._agentId;\r\n }\r\n set agentId(value: string) {\r\n this._agentId = value;\r\n }\r\n\r\n get idKatios() {\r\n return this._idKatios;\r\n }\r\n\r\n set idKatios(value: string) {\r\n this._idKatios = value;\r\n }\r\n\r\n\r\n set agentInfo(value: any) {\r\n this._agentInfo = value;\r\n }\r\n\r\n get agentInfo(): any {\r\n return this._agentInfo;\r\n }\r\n\r\n set selectedFiles(files: File[]) {\r\n this.selectedFilesSubject.next(files);\r\n }\r\n\r\n get selectedFiles(): File[] {\r\n return this.selectedFilesSubject.value;\r\n }\r\n\r\n set sessionId(value: string) {\r\n this._sessionId = value;\r\n }\r\n\r\n get sessionId(): string {\r\n return this._sessionId;\r\n }\r\n\r\n set isRecording(value: boolean) {\r\n this.isRecordingSubject.next(value);\r\n }\r\n\r\n get isRecording(): boolean {\r\n return this.isRecordingSubject.value;\r\n }\r\n\r\n set headerConfig(value: HeaderConfig | undefined) {\r\n this.headerConfigSubject.next(value);\r\n }\r\n\r\n get headerConfig(): HeaderConfig | undefined {\r\n return this.headerConfigSubject.value;\r\n }\r\n\r\n set isLoading(value: boolean) {\r\n this.isLoadingSubject.next(value);\r\n }\r\n\r\n get isLoading(): boolean {\r\n return this.isLoadingSubject.value;\r\n }\r\n\r\n set isBotWritting(isWritting: boolean) {\r\n this.isBotWrittingSubject.next(isWritting);\r\n }\r\n\r\n get isBotWritting(): boolean {\r\n return this.isBotWrittingSubject.value;\r\n }\r\n\r\n addMessage(message: ChatMessage) {\r\n const next = [...this.messagesSubject.value, message];\r\n this.messagesSubject.next(next);\r\n }\r\n\r\n clearMessages() {\r\n this.messagesSubject.next([]);\r\n }\r\n\r\n addFile(file: File) {\r\n const next = [...this.selectedFilesSubject.value, file];\r\n this.selectedFilesSubject.next(next);\r\n }\r\n\r\n addFullMessages(messages: ChatMessage[]) {\r\n const next = [...this.messagesSubject.value, ...messages];\r\n this.messagesSubject.next(next);\r\n }\r\n\r\n\r\n async loadAgent() {\r\n this.isLoading = true;\r\n this.isBotWritting = false;\r\n this.clearMessages();\r\n this.sessionId = \"\";\r\n try {\r\n\r\n const agentInfo = await this.aiAgentsGatewayService.getAgent(this.idKatios, this.agentId) as any;\r\n if (agentInfo.statusCode === 200) {\r\n this.agentInfo = JSON.parse(agentInfo.data.rawConfig);\r\n let configurationAgent = null;\r\n if (this.agentInfo.config?.i18n?.en) {\r\n configurationAgent = this.agentInfo.config?.i18n.en;\r\n }\r\n else {\r\n configurationAgent = this.agentInfo.config?.setUp;\r\n }\r\n\r\n this.headerConfig = {\r\n title: configurationAgent.title,\r\n subtitle: configurationAgent.subtitle,\r\n initialMessages: this.agentInfo.config.initialMessages,\r\n placeholder: configurationAgent.inputPlaceholder,\r\n footer: configurationAgent.footer\r\n };\r\n\r\n this.isLoading = false;\r\n }\r\n } catch (error) {\r\n console.error('An error occurred:', error);\r\n this.isLoading = false;\r\n }\r\n }\r\n\r\n get isInitial(): boolean {\r\n return this.messagesSubject.value.length === 0 && !this.isBotWritting;\r\n }\r\n\r\n /**\r\n * Converts File objects to Attachment format expected by the backend\r\n */\r\n private async convertFilesToAttachments(files: File[]): Promise<any[]> {\r\n if (!files || files.length === 0) {\r\n return [];\r\n }\r\n\r\n const attachments = [];\r\n for (const file of files) {\r\n try {\r\n const base64Data = await this.fileToBase64(file);\r\n const attachment = {\r\n fileName: file.name,\r\n contentType: file.type,\r\n base64Data: base64Data\r\n };\r\n attachments.push(attachment);\r\n } catch (error) {\r\n console.error(`Error converting file ${file.name} to base64:`, error);\r\n }\r\n }\r\n\r\n return attachments;\r\n }\r\n\r\n /**\r\n * Converts a File object to base64 string\r\n */\r\n private fileToBase64(file: File): Promise<string> {\r\n return new Promise((resolve, reject) => {\r\n const reader = new FileReader();\r\n reader.readAsDataURL(file);\r\n reader.onload = () => {\r\n // Remove the data URL prefix (e.g., \"data:image/png;base64,\")\r\n const base64String = (reader.result as string).split(',')[1];\r\n resolve(base64String);\r\n };\r\n reader.onerror = error => reject(error);\r\n });\r\n }\r\n\r\n async send(userInput: string) {\r\n console.log(this.selectedFiles);\r\n this.isBotWritting = true;\r\n\r\n let text = userInput.trim();\r\n try {\r\n\r\n\r\n if (!text) {\r\n this.isBotWritting = false;\r\n return;\r\n }\r\n const messagesToAdd: ChatMessage[] = [];\r\n if(this.selectedFiles.length > 0) {\r\n messagesToAdd.push({\r\n role: 'user',\r\n type: 'file',\r\n content: this.selectedFiles\r\n });\r\n }\r\n messagesToAdd.push({ role: 'user', type: 'text', content: text });\r\n this.addFullMessages(messagesToAdd);\r\n\r\n //this.addMessage({ role: 'user', type: 'text', content: text });\r\n const filesToSend = this.selectedFiles && this.selectedFiles.length > 0 ? await this.convertFilesToAttachments(this.selectedFiles) : [];\r\n const requestData = {\r\n conversationId: this.sessionId,\r\n text,\r\n files: filesToSend,\r\n metadata: this.aiAgentsGatewayService.metadata || {}\r\n };\r\n this.selectedFiles = [];\r\n const response = await this.aiAgentsGatewayService.sendMessage(\r\n this.idKatios,\r\n this.agentId,\r\n requestData\r\n ) as any;\r\n\r\n //this.userInput = '';\r\n \r\n // Asegurar que Angular detecte los cambios después del await\r\n if (response.success) {\r\n this.sessionId = response.data.conversationId;\r\n const incoming = response.data.messages.map((m: any) => ({\r\n role: m.role,\r\n type: m.type || 'markdown',\r\n content: m.content\r\n }));\r\n this.addFullMessages(incoming);\r\n }\r\n } catch (error) {\r\n console.error('Error en send:', error);\r\n this.addMessage({ role: 'assistant', type: 'error', content: 'Ocurrió un error al enviar el mensaje' });\r\n }\r\n finally {\r\n this.isBotWritting = false;\r\n }\r\n }\r\n async startRecording() {\r\n try {\r\n // pide permiso al micrófono\r\n this.recordingStream = await navigator.mediaDevices.getUserMedia({ audio: true });\r\n\r\n // mimeType: mejor opción común en Chrome/Edge\r\n const mimeType = MediaRecorder.isTypeSupported('audio/webm;codecs=opus')\r\n ? 'audio/webm;codecs=opus'\r\n : 'audio/webm';\r\n\r\n this.audioChunks = [];\r\n this.mediaRecorder = new MediaRecorder(this.recordingStream, { mimeType });\r\n\r\n this.mediaRecorder.ondataavailable = (e: BlobEvent) => {\r\n if (e.data && e.data.size > 0) this.audioChunks.push(e.data);\r\n };\r\n\r\n this.mediaRecorder.onstop = () => {\r\n // Asegura que Angular se entere de todo lo que pase aquí\r\n this.zone.run(async () => {\r\n try {\r\n const blob = new Blob(this.audioChunks, { type: mimeType });\r\n const fileName = `audio_${new Date().toISOString().replace(/[:.]/g, '-')}.webm`;\r\n const audioFile = new File([blob], fileName, { type: mimeType });\r\n\r\n this.audioChunks = [];\r\n\r\n await this.sendVoiceMessage(audioFile);\r\n } catch (e) {\r\n console.error('Error procesando audio:', e);\r\n }\r\n });\r\n };\r\n\r\n this.mediaRecorder.start();\r\n this.isRecording = true;\r\n } catch (err) {\r\n console.error('No se pudo iniciar la grabación:', err);\r\n this.isRecording = false;\r\n }\r\n }\r\n private async sendVoiceMessage(audioFile: File) {\r\n\r\n\r\n try {\r\n const sttText = await this.aiAgentsGatewayService.transcribeAudio(this.idKatios, audioFile);\r\n const text = (sttText || '').trim();\r\n if (!text) return;\r\n\r\n // Render inmediato del mensaje del usuario\r\n this.zone.run(() => {\r\n this.addMessage({ role: 'user', type: 'text', content: text });\r\n this.isBotWritting = true;\r\n });\r\n\r\n const requestData = {\r\n conversationId: this.sessionId,\r\n text,\r\n files: [],\r\n metadata: this.aiAgentsGatewayService.metadata || {}\r\n };\r\n\r\n const response = await this.aiAgentsGatewayService.sendMessage(\r\n this.idKatios,\r\n this.agentId,\r\n requestData\r\n ) as any;\r\n\r\n // Asegurar que Angular detecte los cambios después del await\r\n this.zone.run(() => {\r\n if (response?.success && response?.data) {\r\n this.sessionId = response.data.conversationId;\r\n\r\n const incoming = response.data.messages.map((m: any) => ({\r\n role: m.role || 'assistant',\r\n type: m.type || 'markdown',\r\n content: m.content\r\n }));\r\n this.addFullMessages(incoming);\r\n }\r\n });\r\n\r\n } catch (err) {\r\n console.error('Error en sendVoiceMessage:', err);\r\n } finally {\r\n this.zone.run(() => {\r\n this.isBotWritting = false;\r\n });\r\n }\r\n }\r\n stopRecording() {\r\n try {\r\n if (this.mediaRecorder && this.mediaRecorder.state !== 'inactive') {\r\n this.mediaRecorder.stop();\r\n }\r\n\r\n // detener pistas del micrófono (importantísimo para liberar el icono de mic)\r\n if (this.recordingStream) {\r\n this.recordingStream.getTracks().forEach(t => t.stop());\r\n this.recordingStream = undefined;\r\n }\r\n\r\n } finally {\r\n this.isRecording = false;\r\n }\r\n }\r\n\r\n uploadFile(e: any) {\r\n const input = e.target as HTMLInputElement;\r\n if (input.files && input.files.length > 0) {\r\n const newFiles = Array.from(input.files);\r\n\r\n // Agrega los archivos nuevos sin duplicar por nombre\r\n for (const file of newFiles) {\r\n if (!this.selectedFiles.some(f => f.name === file.name && f.size === file.size)) {\r\n this.addFile(file);\r\n }\r\n }\r\n }\r\n }\r\n}\r\n","import { CommonModule } from '@angular/common';\r\nimport { Component, Input } from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { InputMode } from '../../models/agent.model';\r\n//import { Avatar } from 'primeng/avatar';\r\n\r\n@Component({\r\n selector: 'app-text',\r\n standalone: true,\r\n imports: [CommonModule,FormsModule],\r\n templateUrl: './text.component.html',\r\n styleUrl: './text.component.scss'\r\n})\r\nexport class TextComponent {\r\n @Input() text: string = '';\r\n @Input() role: string = '';\r\n}\r\n","<div\n class=\"chat-bubble px-3 py-2 border-round-bottom-xl w-fit\"\n [ngClass]=\"role !== 'user' ? 'bubble-bot border-round-right-xl' : 'bubble-user border-round-left-xl border-round-right-sm'\"\n>\n <span class=\"text-base m-0 whitespace-normal\" style=\"word-break: break-word;\">{{text}}</span>\n</div>","import { CommonModule } from '@angular/common';\r\nimport { Component, Input } from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { Avatar } from 'primeng/avatar';\r\nimport { ButtonModule } from 'primeng/button';\r\n\r\n@Component({\r\n selector: 'app-file',\r\n standalone: true,\r\n imports: [CommonModule,FormsModule,ButtonModule,Avatar],\r\n templateUrl: './file.component.html',\r\n styleUrl: './file.component.scss'\r\n})\r\nexport class FileComponent {\r\n @Input() files: File[] = [];\r\n @Input() role: string = 'assistant';\r\n @Input() remove: boolean = false;\r\n\r\n getFileIcon(mime: string): string {\r\n if (mime.includes('pdf')) return 'pi pi-file-pdf';\r\n if (mime.includes('image')) return 'pi pi-image';\r\n if (mime.includes('audio')) return 'pi pi-volume-up';\r\n if (mime.includes('video')) return 'pi pi-video';\r\n if (mime.includes('zip')) return 'pi pi-file-zip';\r\n if (mime.includes('xlsx')) return 'pi pi-file-excel';\r\n return 'pi pi-file';\r\n }\r\n getFileClasses(mime: string): string {\r\n if (mime.includes('pdf')) return 'bg-red-500 border-red-800 text-white';\r\n if (mime.includes('image')) return 'bg-gray-100 border-gray-200 text-white';\r\n if (mime.includes('audio')) return 'bg-blue-500 border-blue-800 text-white';\r\n if (mime.includes('video')) return 'bg-yellow-500 border-yellow-800 text-white';\r\n if (mime.includes('zip')) return 'bg-indigo-500 border-indigo-800 text-white';\r\n if (mime.includes('xlsx')) return 'bg-green-500 border-green-800 text-white';\r\n return 'bg-gray-100 border-3 border-gray-200 text-gray-500';\r\n }\r\n removeSelectedFile(i: number) {\r\n this.files.splice(i,1);\r\n }\r\n getGridClass(){\r\n const fileCount = this.files.length;\r\n if (fileCount === 1) {\r\n return 'col-12';\r\n } else if (fileCount === 2) {\r\n return 'col-12 sm:col-6';\r\n } else {\r\n return 'col-12 sm:col-6 md:col-4';\r\n }\r\n }\r\n\r\n}\r\n","<div *ngIf=\"!remove\" class=\"grid w-full m-o\" [ngClass]=\"role !== 'user' ? 'items-start justify-content-start' : 'items-end justify-content-end'\">\r\n <div *ngFor=\"let file of files\" [ngClass]=\"getGridClass()\">\r\n <div class=\"flex align-items-center gap-3 border-1 border-gray-300 border-round-2xl p-2 bg-gray-100 h-full\">\r\n <p-avatar class=\"p-1 border-1 avatar-responsive\" [ngClass]=\"getFileClasses(file.name)\" [icon]=\"getFileIcon(file.name)\"></p-avatar>\r\n <div class=\"flex flex-column overflow-hidden\" style=\"min-width: 0;\">\r\n <span class=\"font-semibold text-gray-500 text-sm md:text-base\" style=\"white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\">\r\n {{ file.name }}\r\n </span>\r\n <p class=\"text-xs text-gray-400 md:text-base\" style=\"white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\">\r\n ({{ file.type || 'Archivo' }})\r\n </p>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<div *ngIf=\"remove\" class=\"grid w-full\">\r\n <div *ngFor=\"let file of files; let i = index\" class=\"col-12 sm:col-6 md:col-4\">\r\n <div class=\"relative border-1 border-gray-300 border-round-xl p-2 h-full\">\r\n <p-button icon=\"pi pi-times\" [rounded]=\"true\" variant=\"text\" severity=\"secondary\" class=\"no-hover absolute top-0 right-0 z-1\" (click)=\"removeSelectedFile(i)\" size=\"small\"/>\r\n <div class=\"flex align-items-center gap-3\">\r\n <p-avatar \r\n class=\"p-1 border-1 avatar-responsive\"\r\n [ngClass]=\"getFileClasses(file.name)\" \r\n [icon]=\"getFileIcon(file.name)\" \r\n >\r\n </p-avatar>\r\n \r\n <div class=\"flex flex-column overflow-hidden\" style=\"min-width: 0;\">\r\n <span class=\"font-semibold text-gray-500 md:text-base text-sm\" \r\n style=\"white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\">\r\n {{ file.name }}\r\n </span>\r\n <p class=\"text-xs text-gray-400 md:text-base\" \r\n style=\"white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\">\r\n ({{ file.type || 'archivo' }})\r\n </p>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n </div>\r\n</div>","import { Component, Input } from '@angular/core';\r\n\r\nimport { CommonModule } from '@angular/common';\r\n\r\n@Component({\r\n selector: 'app-table',\r\n imports: [CommonModule],\r\n templateUrl: './table.component.html',\r\n styleUrl: './table.component.scss'\r\n})\r\nexport class TableComponent {\r\n @Input() table: string = \"\";\r\n}\r\n","<div\r\n *ngIf=\"table\"\r\n class=\"mt-2 overflow-auto\"\r\n [innerHTML]=\"table\"\r\n style=\"max-width: 100%; overflow-x: auto;\"\r\n></div>","import { Component, Input, OnChanges, SimpleChanges, ViewEncapsulation } from '@angular/core';\r\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\r\nimport { marked, RendererObject } from 'marked';\r\nimport hljs from 'highlight.js';\r\nimport { CommonModule } from '@angular/common';\r\nimport { Avatar } from 'primeng/avatar';\r\nimport { AgentAvatarComponent } from '../../components/agent-avatar/agent-avatar.component';\r\n\r\n// marked.setOptions({\r\n// highlight: (code, lang) => {\r\n// if (lang && hljs.getLanguage(lang)) {\r\n// return hljs.highlight(code, { language: lang }).value;\r\n// }\r\n// return hljs.highlightAuto(code).value;\r\n// }\r\n// });\r\n\r\nconst renderer: RendererObject = {\r\n link(token) {\r\n const href = token.href ?? '';\r\n const title = token.title ? ` title=\"${token.title}\"` : '';\r\n const text = token.text ?? token.raw ?? href;\r\n\r\n return `<a href=\"${href}\"${title} target=\"_blank\" rel=\"noopener noreferrer\">${text}</a>`;\r\n },\r\n table(token) {\r\n const header = token.header?.map((cell: { text: string }) => `<th>${cell.text}</th>`).join('') ?? '';\r\n const rows = token.rows?.map((row: { text: string }[]) => `<tr>${row.map((cell) => `<td>${cell.text}</td>`).join('')}</tr>`).join('') ?? '';\r\n\r\n return `<div class=\"table-wrapper\"><table><thead><tr>${header}</tr></thead><tbody>${rows}</tbody></table></div>`;\r\n }\r\n};\r\n\r\nmarked.use({ renderer });\r\n\r\n@Component({\r\n selector: 'app-markdown',\r\n standalone: true,\r\n imports: [CommonModule],\r\n templateUrl: './markdown.component.html',\r\n styleUrl: './markdown.component.scss',\r\n encapsulation: ViewEncapsulation.None\r\n})\r\nexport class MarkdownComponent implements OnChanges {\r\n @Input() content = '';\r\n safeHtml: SafeHtml = '';\r\n constructor(private sanitizer: DomSanitizer) {}\r\n\r\n async ngOnChanges(changes: SimpleChanges) {\r\n if ('content' in changes) {\r\n const rawHtml = await marked.parse(this.content || '');\r\n this.safeHtml = this.sanitizer.bypassSecurityTrustHtml(rawHtml);\r\n }\r\n }\r\n}\r\n","<div class=\"markdown-wrapper\">\r\n <div class=\"markdown-container\" [innerHTML]=\"safeHtml\"></div>\r\n</div>","import { Component } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'lib-robot-icon',\r\n imports: [],\r\n templateUrl: './robot-icon.component.html',\r\n styleUrl: './robot-icon.component.css',\r\n host: {\r\n style: 'display: inline-flex; width: 1.5em; height: 1.5em;'\r\n }\r\n})\r\nexport class RobotIconComponent {\r\n\r\n}\r\n","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"100%\" height=\"100%\" fill=\"currentColor\">\r\n <path d=\"M440-120v-80h320v-284q0-117-81.5-198.5T480-764q-117 0-198.5 81.5T200-484v244h-40q-33 0-56.5-23.5T80-320v-80q0-21 10.5-39.5T120-469l3-53q8-68 39.5-126t79-101q47.5-43 109-67T480-840q68 0 129 24t109 66.5Q766-707 797-649t40 126l3 52q19 9 29.5 27t10.5 38v92q0 20-10.5 38T840-249v49q0 33-23.5 56.5T760-120H440Zm-80-280q-17 0-28.5-11.5T320-440q0-17 11.5-28.5T360-480q17 0 28.5 11.5T400-440q0 17-11.5 28.5T360-400Zm240 0q-17 0-28.5-11.5T560-440q0-17 11.5-28.5T600-480q17 0 28.5 11.5T640-440q0 17-11.5 28.5T600-400Zm-359-62q-7-106 64-182t177-76q89 0 156.5 56.5T720-519q-91-1-167.5-49T435-698q-16 80-67.5 142.5T241-462Z\"/>\r\n</svg>\r\n","import { CommonModule } from '@angular/common';\r\nimport { Component, Input, input } from '@angular/core';\r\nimport { Avatar } from 'primeng/avatar';\r\nimport { RobotIconComponent } from '../robot-icon/robot-icon.component';\r\n\r\n@Component({\r\n selector: 'lib-agent-avatar',\r\n imports: [CommonModule, Avatar, RobotIconComponent],\r\n templateUrl: './agent-avatar.component.html',\r\n styleUrl: './agent-avatar.component.scss'\r\n})\r\nexport class AgentAvatarComponent {\r\n @Input() size: \"normal\" | \"large\" | \"xlarge\" | undefined = 'large';\r\n}\r\n","<p-avatar [size]=\"size\" class=\"agent-avatar\" shape=\"circle\">\r\n <lib-robot-icon style=\"color: var(--primary-color)\"></lib-robot-icon>\r\n</p-avatar> \r\n\r\n","import { AfterViewChecked, Component, ElementRef, Input, ViewChild } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { ButtonModule } from 'primeng/button';\r\nimport { TextComponent } from '../../types/text/text.component';\r\nimport { FileComponent } from '../../types/file/file.component';\r\nimport { TableComponent } from '../../types/table/table.component';\r\nimport { MarkdownComponent } from '../../types/markdown/markdown.component';\r\nimport { ChatMessage } from '../../models/agent.model';\r\nimport { AgentAvatarComponent } from \"../agent-avatar/agent-avatar.component\";\r\nimport { MessageModule } from 'primeng/message';\r\n@Component({\r\n selector: 'lib-messages',\r\n imports: [CommonModule, FormsModule, ButtonModule, TextComponent, FileComponent, TableComponent, MarkdownComponent, AgentAvatarComponent, MessageModule],\r\n templateUrl: './messages.component.html',\r\n styleUrl: './messages.component.scss',\r\n host: {\r\n 'class': 'block h-full w-full overflow-hidden'\r\n }\r\n})\r\nexport class MessagesComponent implements AfterViewChecked {\r\n @ViewChild('chatContainer') private chatContainer!: ElementRef<HTMLDivElement>;\r\n @Input() messages: ChatMessage[] = [];\r\n @Input() isBotWritting: boolean = false;\r\n @Input() scrollMode: 'edge' | 'inline' = 'edge';\r\n @Input() agentIcon: string = 'pi pi-sparkles';\r\n \r\n ngAfterViewChecked() {\r\n this.scrollToBottom();\r\n }\r\n\r\n private scrollToBottom(behavior: ScrollBehavior = 'smooth'): void {\r\n if (!this.chatContainer) return;\r\n const el = this.chatContainer.nativeElement;\r\n el.scrollTo({ top: el.scrollHeight, behavior });\r\n }\r\n\r\n}\r\n","<div class=\"messages-container\" [class.scroll-inline]=\"scrollMode === 'inline'\" #chatContainer>\r\n <div class=\"messages-content\">\r\n <div *ngFor=\"let msg of messages\" class=\"message-item\">\r\n <div class=\"flex w-full\" [ngClass]=\"msg.role !== 'user' ? 'justify-content-start' : 'justify-content-end'\">\r\n <div [ngClass]=\"msg.role !== 'user' ? 'message-bot' : 'message-user'\">\r\n <app-table *ngIf=\"msg.type === 'table'\" [table]=\"msg.content\"></app-table>\r\n <app-file *ngIf=\"msg.type === 'file'\" [files]=\"msg.content\" [role]=\"msg.role\"></app-file>\r\n <app-text *ngIf=\"msg.type === 'text'\" [text]=\"msg.content\" [role]=\"msg.role\"></app-text>\r\n <div [ngClass]=\"msg.role !== 'user' ? 'flex items-start gap-2' : ''\" *ngIf=\"msg.type === 'markdown'\">\r\n <lib-agent-avatar *ngIf=\"msg.role !== 'user'\" size=\"normal\"></lib-agent-avatar>\r\n <app-markdown [content]=\"msg.content\"></app-markdown>\r\n </div>\r\n <div *ngIf=\"msg.type === 'error'\" class=\"message-item\">\r\n <div class=\"flex gap-2 message-bot\">\r\n <lib-agent-avatar size=\"normal\"></lib-agent-avatar>\r\n <p-message severity=\"error\">{{msg.content}}</p-message>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div *ngIf=\"isBotWritting\" class=\"message-item\">\r\n <div class=\"flex gap-2 message-bot\">\r\n <lib-agent-avatar size=\"normal\"></lib-agent-avatar>\r\n <div\r\n class=\"w-fit\">\r\n <span class=\"typing-dots\">\r\n <span class=\"dot\"></span>\r\n <span class=\"dot\"></span>\r\n <span class=\"dot\"></span>\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div #bottom></div>\r\n</div>","import { CommonModule } from '@angular/common';\r\nimport { Component, EventEmitter, Input, input, Output } from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { ButtonModule } from 'primeng/button';\r\nimport { ChipModule } from 'primeng/chip';\r\nimport { Textarea } from 'primeng/textarea';\r\nimport { FileComponent } from '../../types/file/file.component';\r\nimport { HeaderConfig, InputMode } from '../../models/agent.model';\r\n\r\n@Component({\r\n selector: 'lib-input',\r\n imports: [CommonModule, FormsModule, ButtonModule, Textarea, ChipModule, FileComponent],\r\n templateUrl: './input.component.html',\r\n styleUrl: './input.component.scss',\r\n host: {\r\n 'class': 'block w-full',\r\n '[class.inputModeDefault]': 'mode === \"default\"',\r\n '[class.inputModeBubble]': 'mode === \"bubble\"',\r\n }\r\n})\r\nexport class InputComponent {\r\n @Input() files: File[] = [];\r\n @Input() isRecording: boolean = false;\r\n @Input() isLoading: boolean = false;\r\n @Input() isBotWritting: boolean = false;\r\n @Input() header: HeaderConfig | undefined;\r\n @Input() mode: InputMode = 'default';\r\n @Output() sendInput = new EventEmitter<string>();\r\n @Output() startRecording = new EventEmitter<void>();\r\n @Output() stopRecording = new EventEmitter<void>();\r\n @Output() uploadFile = new EventEmitter<any>();\r\n userInput: string = '';\r\n\r\n handleKeyDown(event: KeyboardEvent) {\r\n const trimmedInput = this.userInput?.trim();\r\n if (event.key === 'Enter' && !event.shiftKey) {\r\n if (!trimmedInput || this.isBotWritting || this.isLoading) {\r\n event.preventDefault();\r\n return;\r\n }\r\n event.preventDefault();\r\n this.sendInput.emit(trimmedInput);\r\n this.userInput = '';\r\n }\r\n }\r\n\r\n send() {\r\n const trimmedInput = this.userInput?.trim();\r\n if (!trimmedInput || this.isBotWritting) {\r\n return;\r\n }\r\n this.sendInput.emit(trimmedInput);\r\n this.userInput = '';\r\n }\r\n\r\n}\r\n","<div class=\"input-wrapper input-default surface-overlay\">\r\n <app-file [files]=\"files || []\" role=\"assitant\" [remove]=\"true\" />\r\n <form (ngSubmit)=\"send()\" class=\"w-full flex flex-column gap-2\">\r\n <textarea pTextarea id=\"input\" name=\"userInput\" [(ngModel)]=\"userInput\"\r\n class=\"custom-input w-full text-base\" style=\"max-height: 200px\"\r\n [placeholder]=\"header?.placeholder || ''\" rows=\"1\" [autoResize]=\"true\"\r\n (keydown)=\"handleKeyDown($event)\"></textarea>\r\n <div class=\"flex align-items-center justify-content-between w-full\">\r\n\r\n <p-button icon=\"pi pi-paperclip\" [text]=\"true\" (click)=\"fileInputChat.click()\"\r\n [rounded]=\"true\" />\r\n <input type=\"file\" #fileInputChat multiple (change)=\"uploadFile.emit($event)\" style=\"display: none;\">\r\n\r\n <div class=\"flex align-items-center justify-content-end w-full gap-2\">\r\n <p-button *ngIf=\"!isRecording\" icon=\"pi pi-microphone\" [text]=\"true\" (click)=\"startRecording.emit()\"\r\n [rounded]=\"true\" />\r\n <p-button *ngIf=\"isRecording\" icon=\"pi pi-stop\" [text]=\"true\" (click)=\"stopRecording.emit()\"\r\n severity=\"danger\" [rounded]=\"true\" />\r\n <p-button icon=\"pi pi-send\" [rounded]=\"true\" type=\"submit\"\r\n [disabled]=\"isLoading || isBotWritting || (!userInput.trim() && (!files || files.length === 0))\" />\r\n </div>\r\n </div>\r\n </form>\r\n</div>","import { Component, Input, inject, SimpleChanges, OnChanges } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { ButtonModule } from 'primeng/button';\r\nimport { TagModule } from 'primeng/tag';\r\nimport { ChipModule } from 'primeng/chip';\r\nimport { AgentService } from './services/agent.service';\r\nimport { MessagesComponent } from './components/messages/messages.component';\r\nimport { Skeleton } from 'primeng/skeleton';\r\nimport { combineLatest } from 'rxjs';\r\nimport { InputComponent } from './components/input/input.component';\r\nimport { AgentAvatarComponent } from './components/agent-avatar/agent-avatar.component';\r\n\r\n@Component({\r\n selector: 'app-general-agent',\r\n standalone: true,\r\n imports: [CommonModule, FormsModule, ButtonModule, AgentAvatarComponent, TagModule, ChipModule, MessagesComponent, Skeleton, InputComponent],\r\n templateUrl: './general-agent.component.html',\r\n styleUrl: './general-agent.component.scss',\r\n providers: [AgentService],\r\n host: {\r\n 'class': 'block w-full h-full'\r\n }\r\n})\r\nexport class GeneralAgentComponent implements OnChanges {\r\n\r\n // Propiedades internas (ya no inputs/outputs)\r\n agentService = inject(AgentService);\r\n\r\n messages$ = this.agentService.messages$;\r\n isBotWritting$ = this.agentService.isBotWritting$;\r\n headerConfig$ = this.agentService.headerConfig$;\r\n isRecording$ = this.agentService.isRecording$;\r\n selectedFiles$ = this.agentService.selectedFiles$;\r\n isLoading$ = this.agentService.isLoading$;\r\n vm$ = combineLatest({\r\n header: this.headerConfig$,\r\n files: this.selectedFiles$,\r\n isRec: this.isRecording$,\r\n bot: this.isBotWritting$,\r\n messages: this.messages$,\r\n loading: this.isLoading$\r\n});\r\n\r\n @Input() agentId = '';\r\n @Input() idKatios = '';\r\n /** 'edge' = scroll en el borde del contenedor, 'inline' = scroll pegado al chat */\r\n @Input() scrollMode: 'edge' | 'inline' = 'edge';\r\n\r\n\r\n async ngOnChanges(changes: SimpleChanges) {\r\n if (changes['agentId'] || changes['idKatios']) {\r\n await this.initAgent();\r\n }\r\n }\r\n\r\n async initAgent(){\r\n this.agentService.agentId = this.agentId;\r\n this.agentService.idKatios = this.idKatios;\r\n await this.agentService.loadAgent();\r\n }\r\n\r\n\r\n \r\n\r\n}\r\n","<ng-container *ngIf=\"vm$ | async as vm\">\r\n <!-- Vista inicial (bienvenida) -->\r\n <div *ngIf=\"agentService.isInitial\" class=\"custom-chat flex flex-column items-center justify-content-center w-full\">\r\n <div class=\"flex flex-column items-center justify-content-center gap-4 p-3 mb-3 text-center md:p-1\">\r\n <h2 *ngIf=\"!vm.loading\" class=\"text-3xl font-semibold text-gray-900 lg:text-4xl\">{{vm.header?.title ||\r\n 'Agente'}}</h2>\r\n <p-skeleton *ngIf=\"vm.loading\" width=\"25rem\" height=\"2rem\" borderRadius=\"16px\"></p-skeleton>\r\n <div\r\n class=\"flex items-start justify-content-center gap-2\">\r\n <lib-agent-avatar [size]=\"'large'\"></lib-agent-avatar>\r\n <div *ngIf=\"vm.header?.initialMessages && !vm.loading\" class=\"flex flex-column items-start\">\r\n <div *ngFor=\"let msg of vm.header?.initialMessages\" class=\"text-left\">\r\n <span class=\"m-0 text-gray-700 text-base lg:text-lg\">{{msg}}</span>\r\n </div>\r\n </div>\r\n <div class=\"flex flex-column gap-2\">\r\n <p-skeleton *ngIf=\"vm.loading\" width=\"5rem\" borderRadius=\"16px\"></p-skeleton>\r\n <p-skeleton *ngIf=\"vm.loading\" width=\"15rem\" borderRadius=\"16px\"></p-skeleton>\r\n </div>\r\n </div>\r\n <p *ngIf=\"!vm.loading\" class=\"text-base text-gray-500\">{{vm.header?.subtitle}}</p>\r\n <p-skeleton *ngIf=\"vm.loading\" width=\"17rem\" borderRadius=\"16px\"></p-skeleton>\r\n </div>\r\n <!-- Input centrado para vista inicial -->\r\n <div class=\"flex flex-column items-center justify-content-center custom-size w-full pt-1 pb-1\">\r\n <lib-input [files]=\"vm.files || []\" [isRecording]=\"vm.isRec || false\" [isLoading]=\"vm.loading || false\" [isBotWritting]=\"vm.bot || false\" [header]=\"vm.header\" (sendInput)=\"agentService.send($event)\" (startRecording)=\"agentService.startRecording()\" (stopRecording)=\"agentService.stopRecording()\" (uploadFile)=\"agentService.uploadFile($event)\"></lib-input>\r\n <p class=\"mx-auto text-sm text-gray-600 mt-1\">{{vm.header?.footer}}</p>\r\n </div>\r\n </div>\r\n\r\n <!-- Vista de chat (con mensajes) -->\r\n <div *ngIf=\"!agentService.isInitial\" class=\"custom-chat chat-layout flex flex-column w-full\">\r\n <!-- Área de mensajes con scroll -->\r\n <div class=\"messages-area flex-1 overflow-hidden\">\r\n <lib-messages [messages]=\"vm.messages || []\" [isBotWritting]=\"vm.bot || false\" [scrollMode]=\"scrollMode\"></lib-messages>\r\n </div>\r\n <!-- Input fijo abajo -->\r\n <div class=\"input-area flex flex-column items-center w-full py-2 px-2 md:px-0\">\r\n <div class=\"custom-size w-full\">\r\n <lib-input [files]=\"vm.files || []\" [isRecording]=\"vm.isRec || false\" [isLoading]=\"vm.loading || false\" [isBotWritting]=\"vm.bot || false\" [header]=\"vm.header\" (sendInput)=\"agentService.send($event)\" (startRecording)=\"agentService.startRecording()\" (stopRecording)=\"agentService.stopRecording()\" (uploadFile)=\"agentService.uploadFile($event)\"></lib-input>\r\n <p class=\"mx-auto text-sm text-gray-600 mt-1 text-center\">{{vm.header?.footer}}</p>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-container>","import { CommonModule } from '@angular/common';\r\nimport { Component, inject, Input, OnChanges, SimpleChanges } from '@angular/core';\r\nimport { MessagesComponent } from '../messages/messages.component';\r\nimport { InputComponent } from '../input/input.component';\r\nimport { AgentService } from '../../services/agent.service';\r\nimport { combineLatest } from 'rxjs';\r\nimport { ChatMessage } from '../../models/agent.model';\r\n\r\n@Component({\r\n selector: 'lib-bubble-chat',\r\n imports: [CommonModule, MessagesComponent, InputComponent],\r\n templateUrl: './bubble-chat.component.html',\r\n styleUrls: ['./bubble-chat.component.scss'],\r\n providers: [AgentService],\r\n host: {\r\n 'class': 'block w-full h-full',\r\n }\r\n})\r\nexport class BubbleChatComponent implements OnChanges {\r\n agentService = inject(AgentService);\r\n\r\n messages$ = this.agentService.messages$;\r\n isBotWritting$ = this.agentService.isBotWritting$;\r\n headerConfig$ = this.agentService.headerConfig$;\r\n isRecording$ = this.agentService.isRecording$;\r\n selectedFiles$ = this.agentService.selectedFiles$;\r\n isLoading$ = this.agentService.isLoading$;\r\n vm$ = combineLatest({\r\n header: this.headerConfig$,\r\n files: this.selectedFiles$,\r\n isRec: this.isRecording$,\r\n bot: this.isBotWritting$,\r\n messages: this.messages$,\r\n loading: this.isLoading$\r\n });\r\n @Input() agentId = '';\r\n @Input() idKatios = '';\r\n\r\n async ngOnChanges(changes: SimpleChanges) {\r\n if (changes['agentId'] || changes['agentType'] || changes['idKatios']) {\r\n await this.initAgent();\r\n this.addInitialMessages();\r\n }\r\n }\r\n\r\n async initAgent() {\r\n this.agentService.agentId = this.agentId;\r\n this.agentService.idKatios = this.idKatios;\r\n await this.agentService.loadAgent();\r\n }\r\n addInitialMessages() {\r\n const initialMessages: ChatMessage[] = [];\r\n this.agentService.headerConfig?.initialMessages?.map(msg => {\r\n initialMessages.push({\r\n role: 'assistant',\r\n type: 'markdown',\r\n content: msg\r\n });\r\n });\r\n this.agentService.addFullMessages(initialMessages);\r\n }\r\n\r\n}\r\n","<ng-container *ngIf=\"vm$ | async as vm\">\r\n <div class=\"chat-view\">\r\n <div class=\"messages-wrapper\">\r\n <lib-messages [messages]=\"vm.messages\" [isBotWritting]=\"vm.bot || vm.loading\" scrollMode=\"inline\" [agentIcon]=\"vm.header?.avatar || 'pi pi-sparkles'\">\r\n </lib-messages>\r\n </div>\r\n <div class=\"input-wrapper\">\r\n <lib-input mode=\"bubble\" [files]=\"vm.files || []\" [isRecording]=\"vm.isRec || false\" [isLoading]=\"vm.loading || false\"\r\n [isBotWritting]=\"vm.bot || vm.loading\" [header]=\"vm.header\" (sendInput)=\"agentService.send($event)\"\r\n (startRecording)=\"agentService.startRecording()\" (stopRecording)=\"agentService.stopRecording()\"\r\n (uploadFile)=\"agentService.uploadFile($event)\">\r\n </lib-input>\r\n </div>\r\n </div>\r\n</ng-container>","import { Component, Inject, Input, OnChanges, OnDestroy } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { ButtonModule } from 'primeng/button';\r\nimport { Agent } from '../../models/agent.model';\r\nimport { AI_AGENTS, AiAgentsGatewayService } from '../../../agents-backend.port';\r\nimport { BubbleChatComponent } from '../../components/bubble-chat/bubble-chat.component';\r\nimport { AgentAvatarComponent } from '../../components/agent-avatar/agent-avatar.component';\r\nimport { MessageService } from 'primeng/api';\r\nimport { RobotIconComponent } from '../../components/robot-icon/robot-icon.component';\r\n\r\n\r\n@Component({\r\n selector: 'lib-bubble-agent',\r\n standalone: true,\r\n imports: [CommonModule, ButtonModule, AgentAvatarComponent, BubbleChatComponent, RobotIconComponent],\r\n templateUrl: './bubble-agent.component.html',\r\n styleUrl: './bubble-agent.component.scss'\r\n})\r\nexport class BubbleAgentComponent implements OnChanges, OnDestroy {\r\n @Input() idKatios = '';\r\n @Input() ndoc = '';\r\n @Input() tdoc = '';\r\n\r\n // Estado del componente\r\n isOpen = false;\r\n isExpanded = false;\r\n isMobile = false;\r\n selectedAgent: Agent | null = null;\r\n agents: Agent[] = [];\r\n loading: boolean = false;\r\n\r\n private mobileQuery = matchMedia('(max-width: 768px)');\r\n private mobileListener = (e: MediaQueryListEvent) => {\r\n this.isMobile = e.matches;\r\n if (this.isMobile) this.isExpanded = false;\r\n };\r\n\r\n constructor(\r\n @Inject(AI_AGENTS) private aiAgentsGatewayService: AiAgentsGatewayService,\r\n private messageService: MessageService\r\n ) {\r\n this.isMobile = this.mobileQuery.matches;\r\n this.mobileQuery.addEventListener('change', this.mobileListener);\r\n }\r\n\r\n ngOnDestroy() {\r\n this.mobileQuery.removeEventListener('change', this.mobileListener);\r\n }\r\n\r\n ngOnChanges() {\r\n if (this.idKatios && this.ndoc && this.tdoc) {\r\n this.selectedAgent = null;\r\n this.agents = [];\r\n this.loading = true;\r\n this.aiAgentsGatewayService.getAgents(this.idKatios, this.ndoc, this.tdoc).subscribe({\r\n next: (response) => {\r\n if (response.data) this.agents = response.data;\r\n this.loading = false;\r\n },\r\n error: (err) => {\r\n console.error('Error al cargar agentes desde el servicio:', err);\r\n this.agents = [];\r\n this.messageService.add({ severity: 'error', summary: 'Error', detail: 'No se pudieron cargar los agentes. Por favor, inténtalo de nuevo más tarde.' });\r\n }\r\n });\r\n }\r\n }\r\n\r\n toggleChat() {\r\n this.isOpen = !this.isOpen;\r\n if (!this.isOpen) {\r\n this.isExpanded = false;\r\n }\r\n }\r\n\r\n toggleExpand() {\r\n if (this.isMobile) return;\r\n this.isExpanded = !this.isExpanded;\r\n }\r\n\r\n selectAgent(agent: Agent) {\r\n this.selectedAgent = agent;\r\n }\r\n\r\n goBack() {\r\n this.selectedAgent = null;\r\n }\r\n}\r\n","<!-- Botón burbuja flotante -->\n<button class=\"bubble-button shadow-5\" (click)=\"toggleChat()\" [class.is-open]=\"isOpen\" [class.is-expanded]=\"isExpanded\">\n <span class=\"online-indicator\" *ngIf=\"!isOpen\"></span>\n <span class=\"bubble-sparkle\" *ngIf=\"!isOpen\"></span>\n <span class=\"bubble-sparkle\" *ngIf=\"!isOpen\"></span>\n <span class=\"bubble-sparkle\" *ngIf=\"!isOpen\"></span>\n <i class=\"pi\" [ngClass]=\"isOpen ? 'pi-times' : 'pi-comments'\"></i>\n</button>\n\n<!-- Panel del chat -->\n<div class=\"chat-panel\" [class.is-open]=\"isOpen\" [class.is-expanded]=\"isExpanded\">\n <!-- Header del panel -->\n <div class=\"chat-header\">\n <div class=\"flex align-items-center gap-2\">\n <button *ngIf=\"selectedAgent\" class=\"back-button\" (click)=\"goBack()\">\n <i class=\"pi pi-arrow-left\"></i>\n </button>\n <lib-robot-icon style=\"color: white\" *ngIf=\"selectedAgent\"></lib-robot-icon>\n <div class=\"header-text\">\n <p class=\"header-title text-white font-semibold text-lg\">{{ selectedAgent ? selectedAgent.key : 'Agentes IA' }}</p>\n <span class=\"header-status\" *ngIf=\"selectedAgent\">\n <span class=\"header-status-dot\"></span>\n En línea\n </span>\n </div>\n </div>\n <div class=\"flex gap-2\">\n <button class=\"expand-button\" (click)=\"toggleExpand()\" *ngIf=\"selectedAgent\" title=\"Maximizar/Restaurar\">\n <i class=\"pi\" [ngClass]=\"isExpanded ? 'pi-window-minimize' : 'pi-window-maximize'\"></i>\n </button>\n <button class=\"close-button\" (click)=\"toggleChat()\" title=\"Cerrar\">\n <i class=\"pi pi-times\"></i>\n </button>\n </div>\n </div>\n\n <!-- Contenido del panel -->\n <div class=\"chat-content\">\n <!-- Vista de lista de agentes -->\n <div *ngIf=\"!selectedAgent\" class=\"agents-list\">\n <!-- Mensaje cuando no hay agentes -->\n <div *ngIf=\"!agents || agents.length === 0 || loading\" class=\"no-agents\">\n <i class=\"pi text-4xl\" [ngClass]=\"loading ? 'pi-spin pi-cog' : 'pi-sparkles'\"></i>\n <p class=\"text-color-secondary mt-2\">{{ loading ? 'Cargando agentes...' : 'No se encontraron agentes' }}</p>\n </div>\n <!-- Lista de agentes -->\n <div class=\"agent-card\" *ngFor=\"let agent of agents\" (click)=\"selectAgent(agent)\">\n <lib-agent-avatar \n [size]=\"'large'\">\n </lib-agent-avatar>\n <div class=\"agent-info\">\n <p class=\"agent-name text-base font-medium\">{{ agent.key }}</p>\n <p class=\"agent-description text-sm text-color-secondary\">{{ agent.label }}</p>\n </div>\n <span class=\"ai-badge\">\n <i class=\"pi pi-sparkles\"></i>\n AI\n </span>\n <i class=\"pi pi-chevron-right agent-arrow\"></i>\n </div>\n </div>\n\n <!-- Vista de chat con el agente seleccionado -->\n <lib-bubble-chat *ngIf=\"selectedAgent\" \n [agentId]=\"selectedAgent.valor.agentId || ''\" \n [idKatios]=\"idKatios\">\n </lib-bubble-chat>\n </div>\n</div>\n","/*\r\n * Public API Surface of general-agent\r\n */\r\n\r\nexport * from './lib/general-agent/general-agent.component';\r\nexport * from './lib/agents-backend.port';\r\nexport * from './lib/general-agent/agents/bubble-chat/bubble-agent.component';\r\nexport * from './lib/general-agent/components/bubble-chat/bubble-chat.component';\r\nexport * from './lib/general-agent/components/agent-avatar/agent-avatar.component';\r\nexport * from './lib/general-agent/components/robot-icon/robot-icon.component'\r\n\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1","i2","i3"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;MAoBa,SAAS,GAAG,IAAI,cAAc,CAAyB,WAAW;;MCdlE,YAAY,CAAA;AA0BM,IAAA,sBAAA;AACnB,IAAA,IAAA;;;AAxBO,IAAA,eAAe,GAAG,IAAI,eAAe,CAAgB,EAAE,CAAC;AAChE,IAAA,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC,YAAY,EAAE;AACvC,IAAA,oBAAoB,GAAG,IAAI,eAAe,CAAU,KAAK,CAAC;AAClE,IAAA,cAAc,GAAG,IAAI,CAAC,oBAAoB,CAAC,YAAY,EAAE;AACjD,IAAA,kBAAkB,GAAG,IAAI,eAAe,CAAU,KAAK,CAAC;AAChE,IAAA,YAAY,GAAG,IAAI,CAAC,kBAAkB,CAAC,YAAY,EAAE;AAC7C,IAAA,gBAAgB,GAAG,IAAI,eAAe,CAAU,KAAK,CAAC;AAC9D,IAAA,UAAU,GAAG,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE;AACzC,IAAA,mBAAmB,GAAG,IAAI,eAAe,CAA2B,SAAS,CAAC;AACtF,IAAA,aAAa,GAAG,IAAI,CAAC,mBAAmB,CAAC,YAAY,EAAE;AAC/C,IAAA,oBAAoB,GAAG,IAAI,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C,SAAS;wEAnBV,QAAQ,EAAA,CAAA;sBAAhB;gBACQ,IAAI,EAAA,CAAA;sBAAZ;gBACQ,IAAI,EAAA,CAAA;sBAAZ;;;AErBH;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"sf-aiembedded.mjs","sources":["../../../projects/general-agent/src/lib/agents-backend.port.ts","../../../projects/general-agent/src/lib/general-agent/services/agent.service.ts","../../../projects/general-agent/src/lib/general-agent/types/text/text.component.ts","../../../projects/general-agent/src/lib/general-agent/types/text/text.component.html","../../../projects/general-agent/src/lib/general-agent/types/file/file.component.ts","../../../projects/general-agent/src/lib/general-agent/types/file/file.component.html","../../../projects/general-agent/src/lib/general-agent/types/table/table.component.ts","../../../projects/general-agent/src/lib/general-agent/types/table/table.component.html","../../../projects/general-agent/src/lib/general-agent/types/markdown/markdown.component.ts","../../../projects/general-agent/src/lib/general-agent/types/markdown/markdown.component.html","../../../projects/general-agent/src/lib/general-agent/components/robot-icon/robot-icon.component.ts","../../../projects/general-agent/src/lib/general-agent/components/robot-icon/robot-icon.component.html","../../../projects/general-agent/src/lib/general-agent/components/agent-avatar/agent-avatar.component.ts","../../../projects/general-agent/src/lib/general-agent/components/agent-avatar/agent-avatar.component.html","../../../projects/general-agent/src/lib/general-agent/components/messages/messages.component.ts","../../../projects/general-agent/src/lib/general-agent/components/messages/messages.component.html","../../../projects/general-agent/src/lib/general-agent/components/input/input.component.ts","../../../projects/general-agent/src/lib/general-agent/components/input/input.component.html","../../../projects/general-agent/src/lib/general-agent/general-agent.component.ts","../../../projects/general-agent/src/lib/general-agent/general-agent.component.html","../../../projects/general-agent/src/lib/general-agent/components/bubble-chat/bubble-chat.component.ts","../../../projects/general-agent/src/lib/general-agent/components/bubble-chat/bubble-chat.component.html","../../../projects/general-agent/src/lib/general-agent/agents/bubble-chat/bubble-agent.component.ts","../../../projects/general-agent/src/lib/general-agent/agents/bubble-chat/bubble-agent.component.html","../../../projects/general-agent/src/public-api.ts","../../../projects/general-agent/src/sf-aiembedded.ts"],"sourcesContent":["// projects/general-agent/src/lib/agents-backend.port.ts\r\nimport { InjectionToken } from '@angular/core';\r\nimport { Observable } from 'rxjs';\r\n\r\nexport interface AiAgentsGatewayService {\r\n getAgent(idKatios: string, agentId: string): Promise<any>;\r\n sendMessage(idKatios: string, agentId: string, req: {\r\n conversationId?: string;\r\n text: string;\r\n files: Array<{fileName:string; contentType:string; base64Data:string;}>;\r\n metadata?: any;\r\n }): Promise<{\r\n conversationId: string;\r\n messages: Array<{ role?: string; type?: string; content: any }>;\r\n }>;\r\n transcribeAudio(idKatios: string, audio:File): Promise<string>;\r\n getAgents(idKatios: string, ndoc: string, tdoc: string): Observable<any>;\r\n get metadata(): Record<string, any>;\r\n}\r\n\r\nexport const AI_AGENTS = new InjectionToken<AiAgentsGatewayService>('AI_AGENTS');\r\n","import { ChangeDetectorRef, Inject, Injectable, NgZone } from '@angular/core';\r\nimport { AI_AGENTS, AiAgentsGatewayService } from '../../agents-backend.port';\r\nimport { BehaviorSubject, Subject } from 'rxjs';\r\nimport { ChatMessage, HeaderConfig } from '../models/agent.model';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class AgentService {\r\n // Propiedades internas (ya no inputs/outputs)\r\n // Propiedades para notificar cambios a los componentes que usan el servicio\r\n private readonly messagesSubject = new BehaviorSubject<ChatMessage[]>([]);\r\n readonly messages$ = this.messagesSubject.asObservable();\r\n private readonly isBotWrittingSubject = new BehaviorSubject<boolean>(false);\r\n readonly isBotWritting$ = this.isBotWrittingSubject.asObservable();\r\n private readonly isRecordingSubject = new BehaviorSubject<boolean>(false);\r\n readonly isRecording$ = this.isRecordingSubject.asObservable();\r\n private readonly isLoadingSubject = new BehaviorSubject<boolean>(false);\r\n readonly isLoading$ = this.isLoadingSubject.asObservable();\r\n private readonly headerConfigSubject = new BehaviorSubject<HeaderConfig | undefined>(undefined);\r\n readonly headerConfig$ = this.headerConfigSubject.asObservable();\r\n private readonly selectedFilesSubject = new BehaviorSubject<File[]>([]);\r\n readonly selectedFiles$ = this.selectedFilesSubject.asObservable();\r\n private mediaRecorder?: MediaRecorder;\r\n private audioChunks: BlobPart[] = [];\r\n private recordingStream?: MediaStream;\r\n _agentInfo: any;\r\n _configuration: any;\r\n _sessionId: string = '';\r\n _agentId = '';\r\n _idKatios = '';\r\n\r\n\r\n constructor(\r\n @Inject(AI_AGENTS) private aiAgentsGatewayService: AiAgentsGatewayService,\r\n private zone: NgZone\r\n ) { }\r\n\r\n get agentId() {\r\n return this._agentId;\r\n }\r\n set agentId(value: string) {\r\n this._agentId = value;\r\n }\r\n\r\n get idKatios() {\r\n return this._idKatios;\r\n }\r\n\r\n set idKatios(value: string) {\r\n this._idKatios = value;\r\n }\r\n\r\n\r\n set agentInfo(value: any) {\r\n this._agentInfo = value;\r\n }\r\n\r\n get agentInfo(): any {\r\n return this._agentInfo;\r\n }\r\n\r\n set selectedFiles(files: File[]) {\r\n this.selectedFilesSubject.next(files);\r\n }\r\n\r\n get selectedFiles(): File[] {\r\n return this.selectedFilesSubject.value;\r\n }\r\n\r\n set sessionId(value: string) {\r\n this._sessionId = value;\r\n }\r\n\r\n get sessionId(): string {\r\n return this._sessionId;\r\n }\r\n\r\n set isRecording(value: boolean) {\r\n this.isRecordingSubject.next(value);\r\n }\r\n\r\n get isRecording(): boolean {\r\n return this.isRecordingSubject.value;\r\n }\r\n\r\n set headerConfig(value: HeaderConfig | undefined) {\r\n this.headerConfigSubject.next(value);\r\n }\r\n\r\n get headerConfig(): HeaderConfig | undefined {\r\n return this.headerConfigSubject.value;\r\n }\r\n\r\n set isLoading(value: boolean) {\r\n this.isLoadingSubject.next(value);\r\n }\r\n\r\n get isLoading(): boolean {\r\n return this.isLoadingSubject.value;\r\n }\r\n\r\n set isBotWritting(isWritting: boolean) {\r\n this.isBotWrittingSubject.next(isWritting);\r\n }\r\n\r\n get isBotWritting(): boolean {\r\n return this.isBotWrittingSubject.value;\r\n }\r\n\r\n addMessage(message: ChatMessage) {\r\n const next = [...this.messagesSubject.value, message];\r\n this.messagesSubject.next(next);\r\n }\r\n\r\n clearMessages() {\r\n this.messagesSubject.next([]);\r\n }\r\n\r\n addFile(file: File) {\r\n const next = [...this.selectedFilesSubject.value, file];\r\n this.selectedFilesSubject.next(next);\r\n }\r\n\r\n addFullMessages(messages: ChatMessage[]) {\r\n const next = [...this.messagesSubject.value, ...messages];\r\n this.messagesSubject.next(next);\r\n }\r\n\r\n\r\n async loadAgent() {\r\n this.isLoading = true;\r\n this.isBotWritting = false;\r\n this.clearMessages();\r\n this.sessionId = \"\";\r\n try {\r\n\r\n const agentInfo = await this.aiAgentsGatewayService.getAgent(this.idKatios, this.agentId) as any;\r\n if (agentInfo.statusCode === 200) {\r\n this.agentInfo = JSON.parse(agentInfo.data.rawConfig);\r\n let configurationAgent = null;\r\n if (this.agentInfo.config?.i18n?.en) {\r\n configurationAgent = this.agentInfo.config?.i18n.en;\r\n }\r\n else {\r\n configurationAgent = this.agentInfo.config?.setUp;\r\n }\r\n\r\n this.headerConfig = {\r\n title: configurationAgent?.title || '',\r\n subtitle: configurationAgent?.subtitle || '',\r\n initialMessages: this.agentInfo.config?.initialMessages || [],\r\n placeholder: configurationAgent?.inputPlaceholder || 'Responder...',\r\n footer: configurationAgent?.footer || ''\r\n };\r\n\r\n this.isLoading = false;\r\n }\r\n } catch (error) {\r\n console.error('An error occurred:', error);\r\n this.isLoading = false;\r\n }\r\n }\r\n\r\n get isInitial(): boolean {\r\n return this.messagesSubject.value.length === 0 && !this.isBotWritting;\r\n }\r\n\r\n /**\r\n * Converts File objects to Attachment format expected by the backend\r\n */\r\n private async convertFilesToAttachments(files: File[]): Promise<any[]> {\r\n if (!files || files.length === 0) {\r\n return [];\r\n }\r\n\r\n const attachments = [];\r\n for (const file of files) {\r\n try {\r\n const base64Data = await this.fileToBase64(file);\r\n const attachment = {\r\n fileName: file.name,\r\n contentType: file.type,\r\n base64Data: base64Data\r\n };\r\n attachments.push(attachment);\r\n } catch (error) {\r\n console.error(`Error converting file ${file.name} to base64:`, error);\r\n }\r\n }\r\n\r\n return attachments;\r\n }\r\n\r\n /**\r\n * Converts a File object to base64 string\r\n */\r\n private fileToBase64(file: File): Promise<string> {\r\n return new Promise((resolve, reject) => {\r\n const reader = new FileReader();\r\n reader.readAsDataURL(file);\r\n reader.onload = () => {\r\n // Remove the data URL prefix (e.g., \"data:image/png;base64,\")\r\n const base64String = (reader.result as string).split(',')[1];\r\n resolve(base64String);\r\n };\r\n reader.onerror = error => reject(error);\r\n });\r\n }\r\n\r\n async send(userInput: string) {\r\n this.isBotWritting = true;\r\n\r\n let text = userInput.trim();\r\n try {\r\n\r\n\r\n if (!text) {\r\n this.isBotWritting = false;\r\n return;\r\n }\r\n const messagesToAdd: ChatMessage[] = [];\r\n if (this.selectedFiles.length > 0) {\r\n messagesToAdd.push({\r\n role: 'user',\r\n type: 'file',\r\n content: this.selectedFiles\r\n });\r\n }\r\n messagesToAdd.push({ role: 'user', type: 'text', content: text });\r\n this.addFullMessages(messagesToAdd);\r\n\r\n //this.addMessage({ role: 'user', type: 'text', content: text });\r\n const filesToSend = this.selectedFiles && this.selectedFiles.length > 0 ? await this.convertFilesToAttachments(this.selectedFiles) : [];\r\n const requestData = {\r\n conversationId: this.sessionId,\r\n text,\r\n files: filesToSend,\r\n metadata: this.aiAgentsGatewayService.metadata || {}\r\n };\r\n this.selectedFiles = [];\r\n const response = await this.aiAgentsGatewayService.sendMessage(\r\n this.idKatios,\r\n this.agentId,\r\n requestData\r\n ) as any;\r\n\r\n //this.userInput = '';\r\n\r\n // Asegurar que Angular detecte los cambios después del await\r\n if (response.success) {\r\n this.sessionId = response.data.conversationId;\r\n const incoming = response.data.messages.map((m: any) => ({\r\n role: m.role,\r\n type: m.type || 'markdown',\r\n content: m.content\r\n }));\r\n this.addFullMessages(incoming);\r\n }\r\n } catch (error) {\r\n console.error('Error en send:', error);\r\n this.addMessage({ role: 'assistant', type: 'error', content: 'Ocurrió un error al enviar el mensaje' });\r\n }\r\n finally {\r\n this.isBotWritting = false;\r\n }\r\n }\r\n async startRecording() {\r\n try {\r\n // pide permiso al micrófono\r\n this.recordingStream = await navigator.mediaDevices.getUserMedia({ audio: true });\r\n\r\n // mimeType: mejor opción común en Chrome/Edge\r\n const mimeType = MediaRecorder.isTypeSupported('audio/webm;codecs=opus')\r\n ? 'audio/webm;codecs=opus'\r\n : 'audio/webm';\r\n\r\n this.audioChunks = [];\r\n this.mediaRecorder = new MediaRecorder(this.recordingStream, { mimeType });\r\n\r\n this.mediaRecorder.ondataavailable = (e: BlobEvent) => {\r\n if (e.data && e.data.size > 0) this.audioChunks.push(e.data);\r\n };\r\n\r\n this.mediaRecorder.onstop = () => {\r\n // Asegura que Angular se entere de todo lo que pase aquí\r\n this.zone.run(async () => {\r\n try {\r\n const blob = new Blob(this.audioChunks, { type: mimeType });\r\n const fileName = `audio_${new Date().toISOString().replace(/[:.]/g, '-')}.webm`;\r\n const audioFile = new File([blob], fileName, { type: mimeType });\r\n\r\n this.audioChunks = [];\r\n\r\n await this.sendVoiceMessage(audioFile);\r\n } catch (e) {\r\n console.error('Error procesando audio:', e);\r\n }\r\n });\r\n };\r\n\r\n this.mediaRecorder.start();\r\n this.isRecording = true;\r\n } catch (err) {\r\n console.error('No se pudo iniciar la grabación:', err);\r\n this.isRecording = false;\r\n }\r\n }\r\n private async sendVoiceMessage(audioFile: File) {\r\n\r\n\r\n try {\r\n const sttText = await this.aiAgentsGatewayService.transcribeAudio(this.idKatios, audioFile);\r\n const text = (sttText || '').trim();\r\n if (!text) return;\r\n\r\n // Render inmediato del mensaje del usuario\r\n this.zone.run(() => {\r\n this.addMessage({ role: 'user', type: 'text', content: text });\r\n this.isBotWritting = true;\r\n });\r\n\r\n const requestData = {\r\n conversationId: this.sessionId,\r\n text,\r\n files: [],\r\n metadata: this.aiAgentsGatewayService.metadata || {}\r\n };\r\n\r\n const response = await this.aiAgentsGatewayService.sendMessage(\r\n this.idKatios,\r\n this.agentId,\r\n requestData\r\n ) as any;\r\n\r\n // Asegurar que Angular detecte los cambios después del await\r\n this.zone.run(() => {\r\n if (response?.success && response?.data) {\r\n this.sessionId = response.data.conversationId;\r\n\r\n const incoming = response.data.messages.map((m: any) => ({\r\n role: m.role || 'assistant',\r\n type: m.type || 'markdown',\r\n content: m.content\r\n }));\r\n this.addFullMessages(incoming);\r\n }\r\n });\r\n\r\n } catch (err) {\r\n console.error('Error en sendVoiceMessage:', err);\r\n } finally {\r\n this.zone.run(() => {\r\n this.isBotWritting = false;\r\n });\r\n }\r\n }\r\n stopRecording() {\r\n try {\r\n if (this.mediaRecorder && this.mediaRecorder.state !== 'inactive') {\r\n this.mediaRecorder.stop();\r\n }\r\n\r\n // detener pistas del micrófono (importantísimo para liberar el icono de mic)\r\n if (this.recordingStream) {\r\n this.recordingStream.getTracks().forEach(t => t.stop());\r\n this.recordingStream = undefined;\r\n }\r\n\r\n } finally {\r\n this.isRecording = false;\r\n }\r\n }\r\n\r\n uploadFile(e: any) {\r\n const input = e.target as HTMLInputElement;\r\n if (input.files && input.files.length > 0) {\r\n const newFiles = Array.from(input.files);\r\n\r\n // Agrega los archivos nuevos sin duplicar por nombre\r\n for (const file of newFiles) {\r\n if (!this.selectedFiles.some(f => f.name === file.name && f.size === file.size)) {\r\n this.addFile(file);\r\n }\r\n }\r\n }\r\n }\r\n\r\n addInitialMessages() {\r\n const initialMessages: ChatMessage[] = [];\r\n this.headerConfig?.initialMessages?.map(msg => {\r\n initialMessages.push({\r\n role: 'assistant',\r\n type: 'markdown',\r\n content: msg\r\n });\r\n });\r\n this.addFullMessages(initialMessages);\r\n }\r\n\r\n clearConversation() {\r\n this.clearMessages();\r\n this.sessionId = '';\r\n this.isBotWritting = false;\r\n }\r\n}\r\n","import { CommonModule } from '@angular/common';\r\nimport { Component, Input } from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { InputMode } from '../../models/agent.model';\r\n//import { Avatar } from 'primeng/avatar';\r\n\r\n@Component({\r\n selector: 'app-text',\r\n standalone: true,\r\n imports: [CommonModule,FormsModule],\r\n templateUrl: './text.component.html',\r\n styleUrl: './text.component.scss'\r\n})\r\nexport class TextComponent {\r\n @Input() text: string = '';\r\n @Input() role: string = '';\r\n}\r\n","<div\r\n class=\"chat-bubble px-3 py-2 border-round-bottom-xl w-fit\"\r\n [ngClass]=\"role !== 'user' ? 'bubble-bot border-round-right-xl' : 'bubble-user border-round-left-xl border-round-right-sm'\"\r\n>\r\n <span class=\"text-base m-0 whitespace-normal\" style=\"word-break: break-word;\">{{text}}</span>\r\n</div>","import { CommonModule } from '@angular/common';\r\nimport { Component, Input } from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { Avatar } from 'primeng/avatar';\r\nimport { ButtonModule } from 'primeng/button';\r\n\r\n@Component({\r\n selector: 'app-file',\r\n standalone: true,\r\n imports: [CommonModule,FormsModule,ButtonModule,Avatar],\r\n templateUrl: './file.component.html',\r\n styleUrl: './file.component.scss'\r\n})\r\nexport class FileComponent {\r\n @Input() files: File[] = [];\r\n @Input() role: string = 'assistant';\r\n @Input() remove: boolean = false;\r\n\r\n getFileIcon(mime: string): string {\r\n if (mime.includes('pdf')) return 'pi pi-file-pdf';\r\n if (mime.includes('image')) return 'pi pi-image';\r\n if (mime.includes('audio')) return 'pi pi-volume-up';\r\n if (mime.includes('video')) return 'pi pi-video';\r\n if (mime.includes('zip')) return 'pi pi-file-zip';\r\n if (mime.includes('xlsx')) return 'pi pi-file-excel';\r\n return 'pi pi-file';\r\n }\r\n getFileClasses(mime: string): string {\r\n if (mime.includes('pdf')) return 'bg-red-500 border-red-800 text-white';\r\n if (mime.includes('image')) return 'bg-gray-100 border-gray-200 text-white';\r\n if (mime.includes('audio')) return 'bg-blue-500 border-blue-800 text-white';\r\n if (mime.includes('video')) return 'bg-yellow-500 border-yellow-800 text-white';\r\n if (mime.includes('zip')) return 'bg-indigo-500 border-indigo-800 text-white';\r\n if (mime.includes('xlsx')) return 'bg-green-500 border-green-800 text-white';\r\n return 'bg-gray-100 border-3 border-gray-200 text-gray-500';\r\n }\r\n removeSelectedFile(i: number) {\r\n this.files.splice(i,1);\r\n }\r\n getGridClass(){\r\n const fileCount = this.files.length;\r\n if (fileCount === 1) {\r\n return 'col-12';\r\n } else if (fileCount === 2) {\r\n return 'col-12 sm:col-6';\r\n } else {\r\n return 'col-12 sm:col-6 md:col-4';\r\n }\r\n }\r\n\r\n}\r\n","<div *ngIf=\"!remove\" class=\"grid w-full m-o\" [ngClass]=\"role !== 'user' ? 'items-start justify-content-start' : 'items-end justify-content-end'\">\r\n <div *ngFor=\"let file of files\" [ngClass]=\"getGridClass()\">\r\n <div class=\"flex align-items-center gap-3 border-1 border-gray-300 border-round-2xl p-2 bg-gray-100 h-full\">\r\n <p-avatar class=\"p-1 border-1 avatar-responsive\" [ngClass]=\"getFileClasses(file.name)\" [icon]=\"getFileIcon(file.name)\"></p-avatar>\r\n <div class=\"flex flex-column overflow-hidden\" style=\"min-width: 0;\">\r\n <span class=\"font-semibold text-gray-500 text-sm md:text-base\" style=\"white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\">\r\n {{ file.name }}\r\n </span>\r\n <p class=\"text-xs text-gray-400 md:text-base\" style=\"white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\">\r\n ({{ file.type || 'Archivo' }})\r\n </p>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<div *ngIf=\"remove\" class=\"grid w-full\">\r\n <div *ngFor=\"let file of files; let i = index\" class=\"col-12 sm:col-6 md:col-4\">\r\n <div class=\"relative border-1 border-gray-300 border-round-xl p-2 h-full\">\r\n <p-button icon=\"pi pi-times\" [rounded]=\"true\" variant=\"text\" severity=\"secondary\" class=\"no-hover absolute top-0 right-0 z-1\" (click)=\"removeSelectedFile(i)\" size=\"small\"/>\r\n <div class=\"flex align-items-center gap-3\">\r\n <p-avatar \r\n class=\"p-1 border-1 avatar-responsive\"\r\n [ngClass]=\"getFileClasses(file.name)\" \r\n [icon]=\"getFileIcon(file.name)\" \r\n >\r\n </p-avatar>\r\n \r\n <div class=\"flex flex-column overflow-hidden\" style=\"min-width: 0;\">\r\n <span class=\"font-semibold text-gray-500 md:text-base text-sm\" \r\n style=\"white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\">\r\n {{ file.name }}\r\n </span>\r\n <p class=\"text-xs text-gray-400 md:text-base\" \r\n style=\"white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\">\r\n ({{ file.type || 'archivo' }})\r\n </p>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n </div>\r\n</div>","import { Component, Input } from '@angular/core';\r\n\r\nimport { CommonModule } from '@angular/common';\r\n\r\n@Component({\r\n selector: 'app-table',\r\n imports: [CommonModule],\r\n templateUrl: './table.component.html',\r\n styleUrl: './table.component.scss'\r\n})\r\nexport class TableComponent {\r\n @Input() table: string = \"\";\r\n}\r\n","<div\r\n *ngIf=\"table\"\r\n class=\"mt-2 overflow-auto\"\r\n [innerHTML]=\"table\"\r\n style=\"max-width: 100%; overflow-x: auto;\"\r\n></div>","import { Component, Input, OnChanges, SimpleChanges, ViewEncapsulation } from '@angular/core';\r\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\r\nimport { marked, RendererObject } from 'marked';\r\nimport hljs from 'highlight.js';\r\nimport { CommonModule } from '@angular/common';\r\nimport { Avatar } from 'primeng/avatar';\r\nimport { AgentAvatarComponent } from '../../components/agent-avatar/agent-avatar.component';\r\n\r\n// marked.setOptions({\r\n// highlight: (code, lang) => {\r\n// if (lang && hljs.getLanguage(lang)) {\r\n// return hljs.highlight(code, { language: lang }).value;\r\n// }\r\n// return hljs.highlightAuto(code).value;\r\n// }\r\n// });\r\n\r\nconst renderer: RendererObject = {\r\n link(token) {\r\n const href = token.href ?? '';\r\n const title = token.title ? ` title=\"${token.title}\"` : '';\r\n const text = token.text ?? token.raw ?? href;\r\n\r\n return `<a href=\"${href}\"${title} target=\"_blank\" rel=\"noopener noreferrer\">${text}</a>`;\r\n },\r\n table(token) {\r\n const header = token.header?.map((cell: { text: string }) => `<th>${cell.text}</th>`).join('') ?? '';\r\n const rows = token.rows?.map((row: { text: string }[]) => `<tr>${row.map((cell) => `<td>${cell.text}</td>`).join('')}</tr>`).join('') ?? '';\r\n\r\n return `<div class=\"table-wrapper\"><table><thead><tr>${header}</tr></thead><tbody>${rows}</tbody></table></div>`;\r\n }\r\n};\r\n\r\nmarked.use({ renderer });\r\n\r\n@Component({\r\n selector: 'app-markdown',\r\n standalone: true,\r\n imports: [CommonModule],\r\n templateUrl: './markdown.component.html',\r\n styleUrl: './markdown.component.scss',\r\n encapsulation: ViewEncapsulation.None\r\n})\r\nexport class MarkdownComponent implements OnChanges {\r\n @Input() content = '';\r\n safeHtml: SafeHtml = '';\r\n constructor(private sanitizer: DomSanitizer) {}\r\n\r\n async ngOnChanges(changes: SimpleChanges) {\r\n if ('content' in changes) {\r\n const rawHtml = await marked.parse(this.content || '');\r\n this.safeHtml = this.sanitizer.bypassSecurityTrustHtml(rawHtml);\r\n }\r\n }\r\n}\r\n","<div class=\"markdown-wrapper\">\r\n <div class=\"markdown-container\" [innerHTML]=\"safeHtml\"></div>\r\n</div>","import { Component } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'lib-robot-icon',\r\n imports: [],\r\n templateUrl: './robot-icon.component.html',\r\n styleUrl: './robot-icon.component.css',\r\n host: {\r\n style: 'display: inline-flex; width: 1.5em; height: 1.5em;'\r\n }\r\n})\r\nexport class RobotIconComponent {\r\n\r\n}\r\n","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"100%\" height=\"100%\" fill=\"currentColor\">\r\n <path d=\"M440-120v-80h320v-284q0-117-81.5-198.5T480-764q-117 0-198.5 81.5T200-484v244h-40q-33 0-56.5-23.5T80-320v-80q0-21 10.5-39.5T120-469l3-53q8-68 39.5-126t79-101q47.5-43 109-67T480-840q68 0 129 24t109 66.5Q766-707 797-649t40 126l3 52q19 9 29.5 27t10.5 38v92q0 20-10.5 38T840-249v49q0 33-23.5 56.5T760-120H440Zm-80-280q-17 0-28.5-11.5T320-440q0-17 11.5-28.5T360-480q17 0 28.5 11.5T400-440q0 17-11.5 28.5T360-400Zm240 0q-17 0-28.5-11.5T560-440q0-17 11.5-28.5T600-480q17 0 28.5 11.5T640-440q0 17-11.5 28.5T600-400Zm-359-62q-7-106 64-182t177-76q89 0 156.5 56.5T720-519q-91-1-167.5-49T435-698q-16 80-67.5 142.5T241-462Z\"/>\r\n</svg>\r\n","import { CommonModule } from '@angular/common';\r\nimport { Component, Input, input } from '@angular/core';\r\nimport { Avatar } from 'primeng/avatar';\r\nimport { RobotIconComponent } from '../robot-icon/robot-icon.component';\r\n\r\n@Component({\r\n selector: 'lib-agent-avatar',\r\n imports: [CommonModule, Avatar, RobotIconComponent],\r\n templateUrl: './agent-avatar.component.html',\r\n styleUrl: './agent-avatar.component.scss'\r\n})\r\nexport class AgentAvatarComponent {\r\n @Input() size: \"normal\" | \"large\" | \"xlarge\" | undefined = 'large';\r\n}\r\n","<p-avatar [size]=\"size\" class=\"agent-avatar\" shape=\"circle\">\r\n <lib-robot-icon style=\"color: var(--primary-color)\"></lib-robot-icon>\r\n</p-avatar> \r\n\r\n","import { AfterViewChecked, Component, ElementRef, Input, ViewChild } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { ButtonModule } from 'primeng/button';\r\nimport { TextComponent } from '../../types/text/text.component';\r\nimport { FileComponent } from '../../types/file/file.component';\r\nimport { TableComponent } from '../../types/table/table.component';\r\nimport { MarkdownComponent } from '../../types/markdown/markdown.component';\r\nimport { ChatMessage } from '../../models/agent.model';\r\nimport { AgentAvatarComponent } from \"../agent-avatar/agent-avatar.component\";\r\nimport { MessageModule } from 'primeng/message';\r\n@Component({\r\n selector: 'lib-messages',\r\n imports: [CommonModule, FormsModule, ButtonModule, TextComponent, FileComponent, TableComponent, MarkdownComponent, AgentAvatarComponent, MessageModule],\r\n templateUrl: './messages.component.html',\r\n styleUrl: './messages.component.scss',\r\n host: {\r\n 'class': 'block h-full w-full overflow-hidden'\r\n }\r\n})\r\nexport class MessagesComponent implements AfterViewChecked {\r\n @ViewChild('chatContainer') private chatContainer!: ElementRef<HTMLDivElement>;\r\n @Input() messages: ChatMessage[] = [];\r\n @Input() isBotWritting: boolean = false;\r\n @Input() scrollMode: 'edge' | 'inline' = 'edge';\r\n @Input() agentIcon: string = 'pi pi-sparkles';\r\n \r\n ngAfterViewChecked() {\r\n this.scrollToBottom();\r\n }\r\n\r\n private scrollToBottom(behavior: ScrollBehavior = 'smooth'): void {\r\n if (!this.chatContainer) return;\r\n const el = this.chatContainer.nativeElement;\r\n el.scrollTo({ top: el.scrollHeight, behavior });\r\n }\r\n\r\n}\r\n","<div class=\"messages-container\" [class.scroll-inline]=\"scrollMode === 'inline'\" #chatContainer>\r\n <div class=\"messages-content\">\r\n <div *ngFor=\"let msg of messages\" class=\"message-item\">\r\n <div class=\"flex w-full\" [ngClass]=\"msg.role !== 'user' ? 'justify-content-start' : 'justify-content-end'\">\r\n <div [ngClass]=\"msg.role !== 'user' ? 'message-bot' : 'message-user'\">\r\n <app-table *ngIf=\"msg.type === 'table'\" [table]=\"msg.content\"></app-table>\r\n <app-file *ngIf=\"msg.type === 'file'\" [files]=\"msg.content\" [role]=\"msg.role\"></app-file>\r\n <app-text *ngIf=\"msg.type === 'text'\" [text]=\"msg.content\" [role]=\"msg.role\"></app-text>\r\n <div [ngClass]=\"msg.role !== 'user' ? 'flex items-start gap-2' : ''\" *ngIf=\"msg.type === 'markdown'\">\r\n <lib-agent-avatar *ngIf=\"msg.role !== 'user'\" size=\"normal\"></lib-agent-avatar>\r\n <app-markdown [content]=\"msg.content\"></app-markdown>\r\n </div>\r\n <div *ngIf=\"msg.type === 'error'\" class=\"message-item\">\r\n <div class=\"flex gap-2 message-bot\">\r\n <lib-agent-avatar size=\"normal\"></lib-agent-avatar>\r\n <p-message severity=\"error\">{{msg.content}}</p-message>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div *ngIf=\"isBotWritting\" class=\"message-item\">\r\n <div class=\"flex gap-2 message-bot\">\r\n <lib-agent-avatar size=\"normal\"></lib-agent-avatar>\r\n <div\r\n class=\"w-fit\">\r\n <span class=\"typing-dots\">\r\n <span class=\"dot\"></span>\r\n <span class=\"dot\"></span>\r\n <span class=\"dot\"></span>\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div #bottom></div>\r\n</div>","import { CommonModule } from '@angular/common';\r\nimport { Component, EventEmitter, Input, input, Output } from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { ButtonModule } from 'primeng/button';\r\nimport { ChipModule } from 'primeng/chip';\r\nimport { Textarea } from 'primeng/textarea';\r\nimport { FileComponent } from '../../types/file/file.component';\r\nimport { HeaderConfig, InputMode } from '../../models/agent.model';\r\n\r\n@Component({\r\n selector: 'lib-input',\r\n imports: [CommonModule, FormsModule, ButtonModule, Textarea, ChipModule, FileComponent],\r\n templateUrl: './input.component.html',\r\n styleUrl: './input.component.scss',\r\n host: {\r\n 'class': 'block w-full',\r\n '[class.inputModeDefault]': 'mode === \"default\"',\r\n '[class.inputModeBubble]': 'mode === \"bubble\"',\r\n }\r\n})\r\nexport class InputComponent {\r\n @Input() files: File[] = [];\r\n @Input() isRecording: boolean = false;\r\n @Input() isLoading: boolean = false;\r\n @Input() isBotWritting: boolean = false;\r\n @Input() header: HeaderConfig | undefined;\r\n @Input() mode: InputMode = 'default';\r\n @Output() sendInput = new EventEmitter<string>();\r\n @Output() startRecording = new EventEmitter<void>();\r\n @Output() stopRecording = new EventEmitter<void>();\r\n @Output() uploadFile = new EventEmitter<any>();\r\n userInput: string = '';\r\n\r\n handleKeyDown(event: KeyboardEvent) {\r\n const trimmedInput = this.userInput?.trim();\r\n if (event.key === 'Enter' && !event.shiftKey) {\r\n if (!trimmedInput || this.isBotWritting || this.isLoading) {\r\n event.preventDefault();\r\n return;\r\n }\r\n event.preventDefault();\r\n this.sendInput.emit(trimmedInput);\r\n this.userInput = '';\r\n }\r\n }\r\n\r\n send() {\r\n const trimmedInput = this.userInput?.trim();\r\n if (!trimmedInput || this.isBotWritting) {\r\n return;\r\n }\r\n this.sendInput.emit(trimmedInput);\r\n this.userInput = '';\r\n }\r\n\r\n}\r\n","<div class=\"input-wrapper input-default surface-overlay\">\r\n <app-file [files]=\"files || []\" role=\"assitant\" [remove]=\"true\" />\r\n <form (ngSubmit)=\"send()\" class=\"w-full flex flex-column gap-2\">\r\n <textarea pTextarea id=\"input\" name=\"userInput\" [(ngModel)]=\"userInput\"\r\n class=\"custom-input w-full text-base\" style=\"max-height: 200px\"\r\n [placeholder]=\"header?.placeholder || ''\" rows=\"1\" [autoResize]=\"true\"\r\n (keydown)=\"handleKeyDown($event)\"></textarea>\r\n <div class=\"flex align-items-center justify-content-between w-full\">\r\n\r\n <p-button icon=\"pi pi-paperclip\" [text]=\"true\" (click)=\"fileInputChat.click()\"\r\n [rounded]=\"true\" />\r\n <input type=\"file\" #fileInputChat multiple (change)=\"uploadFile.emit($event)\" style=\"display: none;\">\r\n\r\n <div class=\"flex align-items-center justify-content-end w-full gap-2\">\r\n <p-button *ngIf=\"!isRecording\" icon=\"pi pi-microphone\" [text]=\"true\" (click)=\"startRecording.emit()\"\r\n [rounded]=\"true\" />\r\n <p-button *ngIf=\"isRecording\" icon=\"pi pi-stop\" [text]=\"true\" (click)=\"stopRecording.emit()\"\r\n severity=\"danger\" [rounded]=\"true\" />\r\n <p-button icon=\"pi pi-send\" [rounded]=\"true\" type=\"submit\"\r\n [disabled]=\"isLoading || isBotWritting || (!userInput.trim() && (!files || files.length === 0))\" />\r\n </div>\r\n </div>\r\n </form>\r\n</div>","import { Component, Input, inject, SimpleChanges, OnChanges } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { ButtonModule } from 'primeng/button';\r\nimport { TagModule } from 'primeng/tag';\r\nimport { ChipModule } from 'primeng/chip';\r\nimport { AgentService } from './services/agent.service';\r\nimport { MessagesComponent } from './components/messages/messages.component';\r\nimport { Skeleton } from 'primeng/skeleton';\r\nimport { combineLatest } from 'rxjs';\r\nimport { InputComponent } from './components/input/input.component';\r\nimport { AgentAvatarComponent } from './components/agent-avatar/agent-avatar.component';\r\n\r\n@Component({\r\n selector: 'app-general-agent',\r\n standalone: true,\r\n imports: [CommonModule, FormsModule, ButtonModule, AgentAvatarComponent, TagModule, ChipModule, MessagesComponent, Skeleton, InputComponent],\r\n templateUrl: './general-agent.component.html',\r\n styleUrl: './general-agent.component.scss',\r\n providers: [AgentService],\r\n host: {\r\n 'class': 'block w-full h-full'\r\n }\r\n})\r\nexport class GeneralAgentComponent implements OnChanges {\r\n\r\n // Propiedades internas (ya no inputs/outputs)\r\n agentService = inject(AgentService);\r\n\r\n messages$ = this.agentService.messages$;\r\n isBotWritting$ = this.agentService.isBotWritting$;\r\n headerConfig$ = this.agentService.headerConfig$;\r\n isRecording$ = this.agentService.isRecording$;\r\n selectedFiles$ = this.agentService.selectedFiles$;\r\n isLoading$ = this.agentService.isLoading$;\r\n vm$ = combineLatest({\r\n header: this.headerConfig$,\r\n files: this.selectedFiles$,\r\n isRec: this.isRecording$,\r\n bot: this.isBotWritting$,\r\n messages: this.messages$,\r\n loading: this.isLoading$\r\n});\r\n\r\n @Input() agentId = '';\r\n @Input() idKatios = '';\r\n /** 'edge' = scroll en el borde del contenedor, 'inline' = scroll pegado al chat */\r\n @Input() scrollMode: 'edge' | 'inline' = 'edge';\r\n\r\n\r\n async ngOnChanges(changes: SimpleChanges) {\r\n if (changes['agentId'] || changes['idKatios']) {\r\n await this.initAgent();\r\n }\r\n }\r\n\r\n async initAgent(){\r\n this.agentService.agentId = this.agentId;\r\n this.agentService.idKatios = this.idKatios;\r\n await this.agentService.loadAgent();\r\n }\r\n\r\n\r\n \r\n\r\n}\r\n","<ng-container *ngIf=\"vm$ | async as vm\">\r\n <!-- Vista inicial (bienvenida) -->\r\n <div *ngIf=\"agentService.isInitial\" class=\"custom-chat flex flex-column items-center justify-content-center w-full\">\r\n <div class=\"flex flex-column items-center justify-content-center gap-4 p-3 mb-3 text-center md:p-1\">\r\n <h2 *ngIf=\"!vm.loading\" class=\"text-3xl font-semibold text-gray-900 lg:text-4xl\">{{vm.header?.title ||\r\n 'Agente'}}</h2>\r\n <p-skeleton *ngIf=\"vm.loading\" width=\"25rem\" height=\"2rem\" borderRadius=\"16px\"></p-skeleton>\r\n <div\r\n class=\"flex items-start justify-content-center gap-2\">\r\n <lib-agent-avatar [size]=\"'large'\"></lib-agent-avatar>\r\n <div *ngIf=\"vm.header?.initialMessages && !vm.loading\" class=\"flex flex-column items-start\">\r\n <div *ngFor=\"let msg of vm.header?.initialMessages\" class=\"text-left\">\r\n <span class=\"m-0 text-gray-700 text-base lg:text-lg\">{{msg}}</span>\r\n </div>\r\n </div>\r\n <div class=\"flex flex-column gap-2\">\r\n <p-skeleton *ngIf=\"vm.loading\" width=\"5rem\" borderRadius=\"16px\"></p-skeleton>\r\n <p-skeleton *ngIf=\"vm.loading\" width=\"15rem\" borderRadius=\"16px\"></p-skeleton>\r\n </div>\r\n </div>\r\n <p *ngIf=\"!vm.loading\" class=\"text-base text-gray-500\">{{vm.header?.subtitle}}</p>\r\n <p-skeleton *ngIf=\"vm.loading\" width=\"17rem\" borderRadius=\"16px\"></p-skeleton>\r\n </div>\r\n <!-- Input centrado para vista inicial -->\r\n <div class=\"flex flex-column items-center justify-content-center custom-size w-full pt-1 pb-1\">\r\n <lib-input [files]=\"vm.files || []\" [isRecording]=\"vm.isRec || false\" [isLoading]=\"vm.loading || false\" [isBotWritting]=\"vm.bot || false\" [header]=\"vm.header\" (sendInput)=\"agentService.send($event)\" (startRecording)=\"agentService.startRecording()\" (stopRecording)=\"agentService.stopRecording()\" (uploadFile)=\"agentService.uploadFile($event)\"></lib-input>\r\n <p class=\"mx-auto text-sm text-gray-600 mt-1\">{{vm.header?.footer}}</p>\r\n </div>\r\n </div>\r\n\r\n <!-- Vista de chat (con mensajes) -->\r\n <div *ngIf=\"!agentService.isInitial\" class=\"custom-chat chat-layout flex flex-column w-full\">\r\n <!-- Área de mensajes con scroll -->\r\n <div class=\"messages-area flex-1 overflow-hidden\">\r\n <lib-messages [messages]=\"vm.messages || []\" [isBotWritting]=\"vm.bot || false\" [scrollMode]=\"scrollMode\"></lib-messages>\r\n </div>\r\n <!-- Input fijo abajo -->\r\n <div class=\"input-area flex flex-column items-center w-full py-2 px-2 md:px-0\">\r\n <div class=\"custom-size w-full\">\r\n <lib-input [files]=\"vm.files || []\" [isRecording]=\"vm.isRec || false\" [isLoading]=\"vm.loading || false\" [isBotWritting]=\"vm.bot || false\" [header]=\"vm.header\" (sendInput)=\"agentService.send($event)\" (startRecording)=\"agentService.startRecording()\" (stopRecording)=\"agentService.stopRecording()\" (uploadFile)=\"agentService.uploadFile($event)\"></lib-input>\r\n <p class=\"mx-auto text-sm text-gray-600 mt-1 text-center\">{{vm.header?.footer}}</p>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-container>","import { CommonModule } from '@angular/common';\r\nimport { Component, inject, Input, OnChanges, SimpleChanges } from '@angular/core';\r\nimport { MessagesComponent } from '../messages/messages.component';\r\nimport { InputComponent } from '../input/input.component';\r\nimport { AgentService } from '../../services/agent.service';\r\nimport { combineLatest } from 'rxjs';\r\nimport { ChatMessage } from '../../models/agent.model';\r\n\r\n@Component({\r\n selector: 'lib-bubble-chat',\r\n imports: [CommonModule, MessagesComponent, InputComponent],\r\n templateUrl: './bubble-chat.component.html',\r\n styleUrls: ['./bubble-chat.component.scss'],\r\n host: {\r\n 'class': 'block w-full h-full',\r\n }\r\n})\r\nexport class BubbleChatComponent implements OnChanges {\r\n agentService = inject(AgentService);\r\n\r\n messages$ = this.agentService.messages$;\r\n isBotWritting$ = this.agentService.isBotWritting$;\r\n headerConfig$ = this.agentService.headerConfig$;\r\n isRecording$ = this.agentService.isRecording$;\r\n selectedFiles$ = this.agentService.selectedFiles$;\r\n isLoading$ = this.agentService.isLoading$;\r\n vm$ = combineLatest({\r\n header: this.headerConfig$,\r\n files: this.selectedFiles$,\r\n isRec: this.isRecording$,\r\n bot: this.isBotWritting$,\r\n messages: this.messages$,\r\n loading: this.isLoading$\r\n });\r\n @Input() agentId = '';\r\n @Input() idKatios = '';\r\n\r\n async ngOnChanges(changes: SimpleChanges) {\r\n if (changes['agentId'] || changes['agentType'] || changes['idKatios']) {\r\n await this.initAgent();\r\n this.agentService.addInitialMessages();\r\n }\r\n }\r\n\r\n async initAgent() {\r\n this.agentService.agentId = this.agentId;\r\n this.agentService.idKatios = this.idKatios;\r\n await this.agentService.loadAgent();\r\n }\r\n\r\n}\r\n","<ng-container *ngIf=\"vm$ | async as vm\">\r\n <div class=\"chat-view\">\r\n <div class=\"messages-wrapper\">\r\n <lib-messages [messages]=\"vm.messages\" [isBotWritting]=\"vm.bot || vm.loading\" scrollMode=\"inline\" [agentIcon]=\"vm.header?.avatar || 'pi pi-sparkles'\">\r\n </lib-messages>\r\n </div>\r\n <div class=\"input-wrapper\">\r\n <lib-input mode=\"bubble\" [files]=\"vm.files || []\" [isRecording]=\"vm.isRec || false\" [isLoading]=\"vm.loading || false\"\r\n [isBotWritting]=\"vm.bot || vm.loading\" [header]=\"vm.header\" (sendInput)=\"agentService.send($event)\"\r\n (startRecording)=\"agentService.startRecording()\" (stopRecording)=\"agentService.stopRecording()\"\r\n (uploadFile)=\"agentService.uploadFile($event)\">\r\n </lib-input>\r\n </div>\r\n </div>\r\n</ng-container>","import { Component, inject, Inject, Input, OnChanges, OnDestroy, ViewChild } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { ButtonModule } from 'primeng/button';\r\nimport { Agent } from '../../models/agent.model';\r\nimport { AI_AGENTS, AiAgentsGatewayService } from '../../../agents-backend.port';\r\nimport { BubbleChatComponent } from '../../components/bubble-chat/bubble-chat.component';\r\nimport { AgentAvatarComponent } from '../../components/agent-avatar/agent-avatar.component';\r\nimport { MenuItem, MessageService } from 'primeng/api';\r\nimport { RobotIconComponent } from '../../components/robot-icon/robot-icon.component';\r\nimport { MenuModule } from 'primeng/menu';\r\nimport { AgentService } from '../../services/agent.service';\r\n\r\n\r\n@Component({\r\n selector: 'lib-bubble-agent',\r\n standalone: true,\r\n imports: [CommonModule, ButtonModule, AgentAvatarComponent, BubbleChatComponent, RobotIconComponent, MenuModule],\r\n templateUrl: './bubble-agent.component.html',\r\n styleUrl: './bubble-agent.component.scss',\r\n providers: [AgentService]\r\n})\r\nexport class BubbleAgentComponent implements OnChanges, OnDestroy {\r\n agentService = inject(AgentService);\r\n @Input() idKatios = '';\r\n @Input() ndoc = '';\r\n @Input() tdoc = '';\r\n // chatActions: MenuItem[] = [{\r\n // label: 'Nueva conversación',\r\n // icon: 'pi pi-refresh',\r\n // command: () => this.clearChat()\r\n // }];\r\n\r\n // Estado del componente\r\n isOpen = false;\r\n isExpanded = false;\r\n isMobile = false;\r\n selectedAgent: Agent | null = null;\r\n agents: Agent[] = [];\r\n loading: boolean = false;\r\n\r\n private mobileQuery = matchMedia('(max-width: 768px)');\r\n private mobileListener = (e: MediaQueryListEvent) => {\r\n this.isMobile = e.matches;\r\n if (this.isMobile) this.isExpanded = false;\r\n };\r\n\r\n constructor(\r\n @Inject(AI_AGENTS) private aiAgentsGatewayService: AiAgentsGatewayService,\r\n private messageService: MessageService) {\r\n this.isMobile = this.mobileQuery.matches;\r\n this.mobileQuery.addEventListener('change', this.mobileListener);\r\n }\r\n\r\n ngOnDestroy() {\r\n this.mobileQuery.removeEventListener('change', this.mobileListener);\r\n }\r\n\r\n ngOnChanges() {\r\n if (this.idKatios && this.ndoc && this.tdoc) {\r\n this.selectedAgent = null;\r\n this.agents = [];\r\n this.loading = true;\r\n this.aiAgentsGatewayService.getAgents(this.idKatios, this.ndoc, this.tdoc).subscribe({\r\n next: (response) => {\r\n if (response.data) this.agents = response.data;\r\n this.loading = false;\r\n },\r\n error: (err) => {\r\n console.error('Error al cargar agentes desde el servicio:', err);\r\n this.agents = [];\r\n this.messageService.add({ severity: 'error', summary: 'Error', detail: 'No se pudieron cargar los agentes. Por favor, inténtalo de nuevo más tarde.' });\r\n }\r\n });\r\n }\r\n }\r\n\r\n toggleChat() {\r\n this.isOpen = !this.isOpen;\r\n if (!this.isOpen) {\r\n this.isExpanded = false;\r\n }\r\n }\r\n\r\n toggleExpand() {\r\n if (this.isMobile) return;\r\n this.isExpanded = !this.isExpanded;\r\n }\r\n\r\n selectAgent(agent: Agent) {\r\n this.selectedAgent = agent;\r\n }\r\n\r\n goBack() {\r\n this.selectedAgent = null;\r\n }\r\n\r\n clearChat() {\r\n this.agentService.clearConversation();\r\n this.agentService.addInitialMessages();\r\n }\r\n}\r\n","<!-- Botón burbuja flotante -->\r\n<button class=\"bubble-button shadow-5\" (click)=\"toggleChat()\" [class.is-open]=\"isOpen\" [class.is-expanded]=\"isExpanded\">\r\n <span class=\"online-indicator\" *ngIf=\"!isOpen\"></span>\r\n <span class=\"bubble-sparkle\" *ngIf=\"!isOpen\"></span>\r\n <span class=\"bubble-sparkle\" *ngIf=\"!isOpen\"></span>\r\n <span class=\"bubble-sparkle\" *ngIf=\"!isOpen\"></span>\r\n <i class=\"pi\" [ngClass]=\"isOpen ? 'pi-times' : 'pi-comments'\"></i>\r\n</button>\r\n\r\n<!-- Panel del chat -->\r\n<div class=\"chat-panel\" [class.is-open]=\"isOpen\" [class.is-expanded]=\"isExpanded\">\r\n <!-- Header del panel -->\r\n <div class=\"chat-header\">\r\n <div class=\"flex align-items-center gap-2\">\r\n <button *ngIf=\"selectedAgent\" class=\"back-button\" (click)=\"goBack()\">\r\n <i class=\"pi pi-arrow-left\"></i>\r\n </button>\r\n <lib-robot-icon style=\"color: white\" *ngIf=\"selectedAgent\"></lib-robot-icon>\r\n <div class=\"header-text\">\r\n <p class=\"header-title text-white font-semibold text-lg\">{{ selectedAgent ? selectedAgent.key : 'Agentes IA' }}\r\n </p>\r\n <span class=\"header-status\" *ngIf=\"selectedAgent\">\r\n <span class=\"header-status-dot\"></span>\r\n En línea\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"flex gap-2\">\r\n <!-- <p-menu #menu [model]=\"chatActions\" [popup]=\"true\" appendTo=\"body\"/>\r\n <button class=\"menu-button\" (click)=\"menu.toggle($event)\" icon=\"pi pi-ellipsis-v\" *ngIf=\"selectedAgent\" title=\"Acciones\">\r\n <i class=\"pi pi-ellipsis-v\"></i>\r\n </button> -->\r\n <button class=\"new-conversation-button\" (click)=\"clearChat()\" *ngIf=\"selectedAgent\"\r\n [disabled]=\"agentService.isBotWritting\" title=\"Nueva conversación\">\r\n <i class=\"pi pi-refresh\"></i>\r\n </button>\r\n <button class=\"expand-button\" (click)=\"toggleExpand()\" *ngIf=\"selectedAgent\" title=\"Maximizar/Restaurar\">\r\n <i class=\"pi\" [ngClass]=\"isExpanded ? 'pi-window-minimize' : 'pi-window-maximize'\"></i>\r\n </button>\r\n <button class=\"close-button\" (click)=\"toggleChat()\" title=\"Cerrar\">\r\n <i class=\"pi pi-times\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n\r\n <!-- Contenido del panel -->\r\n <div class=\"chat-content\">\r\n <!-- Vista de lista de agentes -->\r\n <div *ngIf=\"!selectedAgent\" class=\"agents-list\">\r\n <!-- Mensaje cuando no hay agentes -->\r\n <div *ngIf=\"!agents || agents.length === 0 || loading\" class=\"no-agents\">\r\n <i class=\"pi text-4xl\" [ngClass]=\"loading ? 'pi-spin pi-cog' : 'pi-sparkles'\"></i>\r\n <p class=\"text-color-secondary mt-2\">{{ loading ? 'Cargando agentes...' : 'No se encontraron agentes' }}</p>\r\n </div>\r\n <!-- Lista de agentes -->\r\n <div class=\"agent-card\" *ngFor=\"let agent of agents\" (click)=\"selectAgent(agent)\">\r\n <lib-agent-avatar [size]=\"'large'\">\r\n </lib-agent-avatar>\r\n <div class=\"agent-info\">\r\n <p class=\"agent-name text-base font-medium\">{{ agent.key }}</p>\r\n <p class=\"agent-description text-sm text-color-secondary\">{{ agent.label }}</p>\r\n </div>\r\n <span class=\"ai-badge\">\r\n <i class=\"pi pi-sparkles\"></i>\r\n AI\r\n </span>\r\n <i class=\"pi pi-chevron-right agent-arrow\"></i>\r\n </div>\r\n </div>\r\n\r\n <!-- Vista de chat con el agente seleccionado -->\r\n <lib-bubble-chat *ngIf=\"selectedAgent\" [agentId]=\"selectedAgent.valor.agentId || ''\" [idKatios]=\"idKatios\">\r\n </lib-bubble-chat>\r\n </div>\r\n</div>","/*\r\n * Public API Surface of general-agent\r\n */\r\n\r\nexport * from './lib/general-agent/general-agent.component';\r\nexport * from './lib/agents-backend.port';\r\nexport * from './lib/general-agent/agents/bubble-chat/bubble-agent.component';\r\nexport * from './lib/general-agent/components/bubble-chat/bubble-chat.component';\r\nexport * from './lib/general-agent/components/agent-avatar/agent-avatar.component';\r\nexport * from './lib/general-agent/components/robot-icon/robot-icon.component'\r\n\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1","i2","i3"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;MAoBa,SAAS,GAAG,IAAI,cAAc,CAAyB,WAAW;;MCZlE,YAAY,CAAA;AA0BM,IAAA,sBAAA;AACnB,IAAA,IAAA;;;AAxBO,IAAA,eAAe,GAAG,IAAI,eAAe,CAAgB,EAAE,CAAC;AAChE,IAAA,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC,YAAY,EAAE;AACvC,IAAA,oBAAoB,GAAG,IAAI,eAAe,CAAU,KAAK,CAAC;AAClE,IAAA,cAAc,GAAG,IAAI,CAAC,oBAAoB,CAAC,YAAY,EAAE;AACjD,IAAA,kBAAkB,GAAG,IAAI,eAAe,CAAU,KAAK,CAAC;AAChE,IAAA,YAAY,GAAG,IAAI,CAAC,kBAAkB,CAAC,YAAY,EAAE;AAC7C,IAAA,gBAAgB,GAAG,IAAI,eAAe,CAAU,KAAK,CAAC;AAC9D,IA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AAA,CAAA;sBAAZ;;;AEzBH;;AAEG;;ACFH;;AAEG;;;;"}
@@ -2,10 +2,12 @@ import { OnChanges, OnDestroy } from '@angular/core';
2
2
  import { Agent } from '../../models/agent.model';
3
3
  import { AiAgentsGatewayService } from '../../../agents-backend.port';
4
4
  import { MessageService } from 'primeng/api';
5
+ import { AgentService } from '../../services/agent.service';
5
6
  import * as i0 from "@angular/core";
6
7
  export declare class BubbleAgentComponent implements OnChanges, OnDestroy {
7
8
  private aiAgentsGatewayService;
8
9
  private messageService;
10
+ agentService: AgentService;
9
11
  idKatios: string;
10
12
  ndoc: string;
11
13
  tdoc: string;
@@ -24,6 +26,7 @@ export declare class BubbleAgentComponent implements OnChanges, OnDestroy {
24
26
  toggleExpand(): void;
25
27
  selectAgent(agent: Agent): void;
26
28
  goBack(): void;
29
+ clearChat(): void;
27
30
  static ɵfac: i0.ɵɵFactoryDeclaration<BubbleAgentComponent, never>;
28
31
  static ɵcmp: i0.ɵɵComponentDeclaration<BubbleAgentComponent, "lib-bubble-agent", never, { "idKatios": { "alias": "idKatios"; "required": false; }; "ndoc": { "alias": "ndoc"; "required": false; }; "tdoc": { "alias": "tdoc"; "required": false; }; }, {}, never, never, true, never>;
29
32
  }
@@ -22,7 +22,6 @@ export declare class BubbleChatComponent implements OnChanges {
22
22
  idKatios: string;
23
23
  ngOnChanges(changes: SimpleChanges): Promise<void>;
24
24
  initAgent(): Promise<void>;
25
- addInitialMessages(): void;
26
25
  static ɵfac: i0.ɵɵFactoryDeclaration<BubbleChatComponent, never>;
27
26
  static ɵcmp: i0.ɵɵComponentDeclaration<BubbleChatComponent, "lib-bubble-chat", never, { "agentId": { "alias": "agentId"; "required": false; }; "idKatios": { "alias": "idKatios"; "required": false; }; }, {}, never, never, true, never>;
28
27
  }
@@ -63,6 +63,8 @@ export declare class AgentService {
63
63
  private sendVoiceMessage;
64
64
  stopRecording(): void;
65
65
  uploadFile(e: any): void;
66
+ addInitialMessages(): void;
67
+ clearConversation(): void;
66
68
  static ɵfac: i0.ɵɵFactoryDeclaration<AgentService, never>;
67
69
  static ɵprov: i0.ɵɵInjectableDeclaration<AgentService>;
68
70
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sf-aiembedded",
3
- "version": "0.3.9",
3
+ "version": "0.4.1",
4
4
  "description": "GeneralAgent UI (standalone) para Angular",
5
5
  "author": "camila.torres@nhubex.com",
6
6
  "license": "MIT",