@seniorsistemas/angular-components 17.26.9-bugfix-sds-309-85a29221 → 17.26.9-bugfix-sds-305-32cf1ca4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/bundles/seniorsistemas-angular-components.umd.js +86 -123
  2. package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
  3. package/bundles/seniorsistemas-angular-components.umd.min.js +1 -1
  4. package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
  5. package/components/speech-recognition/speech-recognition/speech-recognition.component.d.ts +2 -5
  6. package/components/speech-recognition/speech-recognition.service.d.ts +2 -3
  7. package/components/text-area/text-area/text-area.component.d.ts +3 -1
  8. package/esm2015/components/bignumber-input/bignumber-input.directive.js +6 -5
  9. package/esm2015/components/locale/locale.service.js +8 -2
  10. package/esm2015/components/speech-recognition/speech-recognition/speech-recognition.component.js +20 -38
  11. package/esm2015/components/speech-recognition/speech-recognition.service.js +22 -41
  12. package/esm2015/components/speech-recognition/text-to-speech.service.js +1 -1
  13. package/esm2015/components/text-area/text-area/text-area.component.js +14 -3
  14. package/esm5/components/bignumber-input/bignumber-input.directive.js +6 -5
  15. package/esm5/components/locale/locale.service.js +8 -2
  16. package/esm5/components/speech-recognition/speech-recognition/speech-recognition.component.js +19 -43
  17. package/esm5/components/speech-recognition/speech-recognition.service.js +46 -78
  18. package/esm5/components/speech-recognition/text-to-speech.service.js +1 -1
  19. package/esm5/components/text-area/text-area/text-area.component.js +18 -3
  20. package/fesm2015/seniorsistemas-angular-components.js +61 -83
  21. package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
  22. package/fesm5/seniorsistemas-angular-components.js +88 -125
  23. package/fesm5/seniorsistemas-angular-components.js.map +1 -1
  24. package/package.json +1 -1
  25. package/seniorsistemas-angular-components.metadata.json +1 -1
@@ -1,5 +1,5 @@
1
- import { __decorate, __awaiter, __param, __rest } from 'tslib';
2
- import { EventEmitter, Input, Output, Component, ContentChildren, ViewChild, HostListener, forwardRef, NgModule, ɵɵdefineInjectable, Injectable, ElementRef, ApplicationRef, ComponentFactoryResolver, Injector, Renderer2, Directive, TemplateRef, ViewContainerRef, Pipe, ɵɵinject, HostBinding, ChangeDetectorRef, ViewChildren, InjectionToken, Inject, PLATFORM_ID, KeyValueDiffers, ViewEncapsulation, INJECTOR, NgZone, ContentChild, Optional } from '@angular/core';
1
+ import { __decorate, __param, __awaiter, __rest } from 'tslib';
2
+ import { EventEmitter, Input, Output, Component, ContentChildren, ViewChild, HostListener, forwardRef, NgModule, ɵɵdefineInjectable, Injectable, ElementRef, ApplicationRef, ComponentFactoryResolver, Injector, Renderer2, Directive, TemplateRef, ViewContainerRef, ɵɵinject, Pipe, Inject, HostBinding, ChangeDetectorRef, ViewChildren, InjectionToken, PLATFORM_ID, KeyValueDiffers, ViewEncapsulation, INJECTOR, NgZone, ContentChild, Optional } from '@angular/core';
3
3
  import { trigger, transition, style as style$7, animate, state, group, query, animateChild } from '@angular/animations';
4
4
  import { Subject, of, from, ReplaySubject, throwError, fromEvent, forkJoin, pipe } from 'rxjs';
5
5
  import { takeUntil, tap, map, switchMap, catchError, first, filter, take, delay, debounceTime, repeat, finalize } from 'rxjs/operators';
@@ -1202,8 +1202,11 @@ LocaleService.ctorParameters = () => [
1202
1202
  { type: HttpClient },
1203
1203
  { type: CookieService }
1204
1204
  ];
1205
+ LocaleService.ɵprov = ɵɵdefineInjectable({ factory: function LocaleService_Factory() { return new LocaleService(ɵɵinject(HttpClient), ɵɵinject(CookieService)); }, token: LocaleService, providedIn: "root" });
1205
1206
  LocaleService = __decorate([
1206
- Injectable()
1207
+ Injectable({
1208
+ providedIn: "root"
1209
+ })
1207
1210
  ], LocaleService);
1208
1211
 
1209
1212
  let LocalizedBignumberPipe = class LocalizedBignumberPipe {
@@ -1819,7 +1822,7 @@ let BignumberInputDirective = BignumberInputDirective_1 = class BignumberInputDi
1819
1822
  };
1820
1823
  BignumberInputDirective.ctorParameters = () => [
1821
1824
  { type: Injector },
1822
- { type: LocaleService }
1825
+ { type: LocaleService, decorators: [{ type: Inject, args: [LocaleService,] }] }
1823
1826
  ];
1824
1827
  __decorate([
1825
1828
  Input()
@@ -1865,7 +1868,8 @@ BignumberInputDirective = BignumberInputDirective_1 = __decorate([
1865
1868
  multi: true,
1866
1869
  },
1867
1870
  ],
1868
- })
1871
+ }),
1872
+ __param(1, Inject(LocaleService))
1869
1873
  ], BignumberInputDirective);
1870
1874
 
1871
1875
  let BignumberInputModule = class BignumberInputModule {
@@ -10624,8 +10628,9 @@ let SpeechRecognitionService = class SpeechRecognitionService {
10624
10628
  this.translateService = translateService;
10625
10629
  this.hasSupportSpeechRecognition = false;
10626
10630
  this.isListening = false;
10627
- this.microphoneStatus$ = new Subject();
10631
+ this.hasMicrophoneAccess = false;
10628
10632
  this.TIMEOUT_NO_MESSAGE = 3000;
10633
+ this.verifyMicrophoneState();
10629
10634
  this.setRecognition();
10630
10635
  }
10631
10636
  listen() {
@@ -10633,13 +10638,12 @@ let SpeechRecognitionService = class SpeechRecognitionService {
10633
10638
  if (this.isListening) {
10634
10639
  speechSubject.error('Already listening');
10635
10640
  }
10636
- this.hasMicrophoneAccess.then((hasAccess) => {
10637
- if (!hasAccess) {
10638
- this.toastService.show({ severity: 'error', text: this.translateService.instant('platform.angular_components.no_microphone_permission') });
10639
- speechSubject.error('Microphone access is disabled');
10640
- return;
10641
- }
10642
- this.microphoneStatus$.next('active');
10641
+ else if (!this.hasMicrophoneAccess) {
10642
+ this.isListening = false;
10643
+ this.toastService.show({ severity: 'error', text: this.translateService.instant('platform.angular_components.no_microphone_permission') });
10644
+ speechSubject.error('Microphone access is disabled');
10645
+ }
10646
+ else {
10643
10647
  this.isListening = true;
10644
10648
  this.recognition.continuous = true;
10645
10649
  this.recognition.interimResults = true;
@@ -10679,7 +10683,6 @@ let SpeechRecognitionService = class SpeechRecognitionService {
10679
10683
  }
10680
10684
  this.isListening = false;
10681
10685
  speechSubject.error('Speech recognition error');
10682
- this.microphoneStatus$.next('inactive');
10683
10686
  });
10684
10687
  };
10685
10688
  this.recognition.onend = () => {
@@ -10690,16 +10693,26 @@ let SpeechRecognitionService = class SpeechRecognitionService {
10690
10693
  speechSubject.next({ text: fullTranscript + interimTranscript, isFinal: true });
10691
10694
  this.isListening = false;
10692
10695
  speechSubject.complete();
10693
- this.microphoneStatus$.next('inactive');
10694
10696
  });
10695
10697
  };
10696
10698
  this.recognition.start();
10697
- });
10699
+ }
10698
10700
  return speechSubject;
10699
10701
  }
10700
10702
  stop() {
10701
10703
  this.recognition.stop();
10702
10704
  }
10705
+ verifyMicrophoneState() {
10706
+ navigator.permissions.query({ name: 'microphone' }).then((result) => {
10707
+ const microphoneResultState = result.state;
10708
+ this.hasMicrophoneAccess = microphoneResultState === 'granted';
10709
+ result.onchange = () => {
10710
+ this.ngZone.run(() => {
10711
+ this.hasMicrophoneAccess = result.state === 'granted';
10712
+ });
10713
+ };
10714
+ });
10715
+ }
10703
10716
  setRecognition() {
10704
10717
  var _a;
10705
10718
  const SpeechRecognitionConstructor = window.SpeechRecognition || window.webkitSpeechRecognition;
@@ -10714,34 +10727,6 @@ let SpeechRecognitionService = class SpeechRecognitionService {
10714
10727
  this.recognition.maxAlternatives = 1;
10715
10728
  this.localeService.getLocale().subscribe(locale => this.recognition.lang = locale);
10716
10729
  }
10717
- get hasMicrophoneAccess() {
10718
- return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
10719
- const permission = yield navigator.permissions.query({ name: 'microphone' });
10720
- if (permission.state === 'denied') {
10721
- resolve(false);
10722
- }
10723
- else if (permission.state === 'granted') {
10724
- resolve(true);
10725
- }
10726
- else if (permission.state === 'prompt') {
10727
- try {
10728
- navigator.mediaDevices.getUserMedia({ audio: true }).then((stream) => {
10729
- stream.getTracks().forEach(t => t.stop());
10730
- }).catch(() => {
10731
- resolve(false);
10732
- });
10733
- permission.onchange = () => {
10734
- this.ngZone.run(() => {
10735
- resolve(permission.state === 'granted' ? true : false);
10736
- });
10737
- };
10738
- }
10739
- catch (error) {
10740
- resolve(false);
10741
- }
10742
- }
10743
- }));
10744
- }
10745
10730
  };
10746
10731
  SpeechRecognitionService.ctorParameters = () => [
10747
10732
  { type: LocaleService },
@@ -12664,6 +12649,17 @@ let TextAreaComponent = TextAreaComponent_1 = class TextAreaComponent {
12664
12649
  this.cdr.detectChanges();
12665
12650
  });
12666
12651
  }
12652
+ get placeholder() {
12653
+ return this._placeholder;
12654
+ }
12655
+ set placeholder(value) {
12656
+ if (value) {
12657
+ this._placeholder = value;
12658
+ }
12659
+ else {
12660
+ this._placeholder = '';
12661
+ }
12662
+ }
12667
12663
  get inputStyle() {
12668
12664
  return this._inputStyle;
12669
12665
  }
@@ -12724,7 +12720,7 @@ __decorate([
12724
12720
  ], TextAreaComponent.prototype, "maxLength", void 0);
12725
12721
  __decorate([
12726
12722
  Input()
12727
- ], TextAreaComponent.prototype, "placeholder", void 0);
12723
+ ], TextAreaComponent.prototype, "placeholder", null);
12728
12724
  __decorate([
12729
12725
  Input()
12730
12726
  ], TextAreaComponent.prototype, "inputStyle", null);
@@ -12734,7 +12730,7 @@ __decorate([
12734
12730
  TextAreaComponent = TextAreaComponent_1 = __decorate([
12735
12731
  Component({
12736
12732
  selector: 's-textarea',
12737
- template: "<textarea\n *ngIf=\"keyFilter\"\n #textArea\n class=\"textarea\"\n [pKeyFilter]=\"keyFilter\"\n [id]=\"inputId\"\n [rows]=\"rows\"\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [ngStyle]=\"inputStyle\"\n [readOnly]=\"readOnly\"\n [placeholder]=\"placeholder ? placeholder : ''\"\n [maxlength]=\"maxLength\"\n (ngModelChange)=\"setValue($event)\">\n</textarea>\n\n<textarea\n *ngIf=\"!keyFilter\"\n #textArea\n class=\"textarea\"\n [id]=\"inputId\"\n [rows]=\"rows\"\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [ngStyle]=\"inputStyle\"\n [readOnly]=\"readOnly\"\n [placeholder]=\"placeholder ? placeholder : ''\"\n [maxlength]=\"maxLength\"\n (ngModelChange)=\"setValue($event)\">\n</textarea>\n\n<s-speech-recognition\n *ngIf=\"speechRecognition && renderTextArea\"\n [textAreaElement]=\"textAreaElement.nativeElement\"\n [keepContext]=\"keepContext\"\n [speechRecognitionPlaceholder]=\"speechRecognitionPlaceholder\"\n (recognizedText)=\"handleRecognizedText($event)\">\n</s-speech-recognition>\n",
12733
+ template: "<textarea\n *ngIf=\"keyFilter\"\n #textArea\n class=\"textarea\"\n [pKeyFilter]=\"keyFilter\"\n [id]=\"inputId\"\n [rows]=\"rows\"\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [ngStyle]=\"inputStyle\"\n [readOnly]=\"readOnly\"\n [placeholder]=\"placeholder\"\n [maxlength]=\"maxLength\"\n (ngModelChange)=\"setValue($event)\">\n</textarea>\n\n<textarea\n *ngIf=\"!keyFilter\"\n #textArea\n class=\"textarea\"\n [id]=\"inputId\"\n [rows]=\"rows\"\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [ngStyle]=\"inputStyle\"\n [readOnly]=\"readOnly\"\n [placeholder]=\"placeholder\"\n [maxlength]=\"maxLength\"\n (ngModelChange)=\"setValue($event)\">\n</textarea>\n\n<s-speech-recognition\n *ngIf=\"speechRecognition && renderTextArea\"\n [textAreaElement]=\"textAreaElement.nativeElement\"\n [keepContext]=\"keepContext\"\n [speechRecognitionPlaceholder]=\"speechRecognitionPlaceholder\"\n (recognizedText)=\"handleRecognizedText($event)\">\n</s-speech-recognition>\n",
12738
12734
  providers: [
12739
12735
  {
12740
12736
  provide: NG_VALUE_ACCESSOR,
@@ -12824,8 +12820,7 @@ TextToSpeechService = __decorate([
12824
12820
  })
12825
12821
  ], TextToSpeechService);
12826
12822
 
12827
- var SpeechRecognitionComponent_1;
12828
- let SpeechRecognitionComponent = SpeechRecognitionComponent_1 = class SpeechRecognitionComponent {
12823
+ let SpeechRecognitionComponent = class SpeechRecognitionComponent {
12829
12824
  constructor(speechRecognitionService, textToSpeechService, translateService) {
12830
12825
  this.speechRecognitionService = speechRecognitionService;
12831
12826
  this.textToSpeechService = textToSpeechService;
@@ -12834,7 +12829,7 @@ let SpeechRecognitionComponent = SpeechRecognitionComponent_1 = class SpeechReco
12834
12829
  this.speechRecognitionPlaceholder = '';
12835
12830
  this._recognizedText = '';
12836
12831
  this.originalTextAreaElementText = '';
12837
- this.isDoneTextToSpeech = false;
12832
+ this.isDoneSpeaking = false;
12838
12833
  this.onDestroy$ = new Subject();
12839
12834
  this.VOICE_SPEEDS = [0.5, 1, 1.5, 2];
12840
12835
  this.keydownEventListener = (event) => {
@@ -12843,7 +12838,7 @@ let SpeechRecognitionComponent = SpeechRecognitionComponent_1 = class SpeechReco
12843
12838
  }
12844
12839
  };
12845
12840
  this.disabled = false;
12846
- this.isListeningUserVoice = false;
12841
+ this.isSpeaking = false;
12847
12842
  this.voiceSpeed = 1;
12848
12843
  this.isDisabledMicrophone = false;
12849
12844
  this.canRenderMicrophone = true;
@@ -12864,25 +12859,17 @@ let SpeechRecognitionComponent = SpeechRecognitionComponent_1 = class SpeechReco
12864
12859
  }
12865
12860
  this.textAreaElement.placeholder = this.speechRecognitionPlaceholder ? this.speechRecognitionPlaceholder : this.translateService.instant("platform.angular_components.text_area_speech_recognition_placeholder");
12866
12861
  this.textAreaElement.addEventListener('keydown', this.keydownEventListener);
12867
- this.speechRecognitionService.microphoneStatus$.pipe(takeUntil(this.onDestroy$)).subscribe((status) => {
12868
- if (status === 'active') {
12869
- this.onCloseToolbar();
12870
- }
12871
- });
12872
12862
  }
12873
12863
  onListen() {
12874
12864
  if (this.isDisabledMicrophone || this.isListening) {
12875
12865
  return;
12876
12866
  }
12877
- // if (this.isPlayingTextToSpeech) {
12878
- // this.onCloseToolbar();
12879
- // }
12880
12867
  this.disabled = true;
12881
12868
  this.canRenderMicrophone = false;
12882
12869
  this.canRenderListeningText = true;
12883
12870
  this.originalTextAreaElementText = this.textAreaElement.value;
12884
12871
  this.textAreaElement.value = '';
12885
- this.isListeningUserVoice = true;
12872
+ this.isSpeaking = true;
12886
12873
  this.speechRecognitionService.listen()
12887
12874
  .pipe(takeUntil(this.onDestroy$))
12888
12875
  .subscribe(({ text, isFinal }) => {
@@ -12893,10 +12880,10 @@ let SpeechRecognitionComponent = SpeechRecognitionComponent_1 = class SpeechReco
12893
12880
  this.canRenderAprove = true;
12894
12881
  this.canRenderDiscard = true;
12895
12882
  this.canRenderListeningText = false;
12896
- this.isListeningUserVoice = false;
12883
+ this.isSpeaking = false;
12897
12884
  }
12898
12885
  }, () => {
12899
- this.isListeningUserVoice = false;
12886
+ this.isSpeaking = false;
12900
12887
  this.canRenderMicrophone = true;
12901
12888
  this.isDisabledMicrophone = false;
12902
12889
  this.canRenderListeningText = false;
@@ -12914,15 +12901,15 @@ let SpeechRecognitionComponent = SpeechRecognitionComponent_1 = class SpeechReco
12914
12901
  }
12915
12902
  this.canRenderTextToSpeechToolbar = true;
12916
12903
  this.canRenderTextToSpeech = false;
12917
- SpeechRecognitionComponent_1.TOOLBAR_ACTIVE = true;
12904
+ this.isPlayingTextToSpeech = true;
12918
12905
  this.speak();
12919
12906
  }
12920
12907
  onCloseToolbar() {
12921
12908
  this.canRenderTextToSpeechToolbar = false;
12922
12909
  this.canRenderTextToSpeech = true;
12923
- this.stopTextToSpeech();
12910
+ this.isPlayingTextToSpeech = false;
12911
+ this.textToSpeechService.cancel();
12924
12912
  this.voiceSpeed = 1;
12925
- SpeechRecognitionComponent_1.TOOLBAR_ACTIVE = false;
12926
12913
  }
12927
12914
  onDiscard() {
12928
12915
  this.canRenderAprove = false;
@@ -12933,8 +12920,7 @@ let SpeechRecognitionComponent = SpeechRecognitionComponent_1 = class SpeechReco
12933
12920
  this._recognizedText = '';
12934
12921
  this.setTextAreaValue(this.originalTextAreaElementText);
12935
12922
  this.disabled = false;
12936
- this.stopTextToSpeech();
12937
- SpeechRecognitionComponent_1.TOOLBAR_ACTIVE = false;
12923
+ this.textToSpeechService.cancel();
12938
12924
  }
12939
12925
  onAprove() {
12940
12926
  this.canRenderAprove = false;
@@ -12964,7 +12950,7 @@ let SpeechRecognitionComponent = SpeechRecognitionComponent_1 = class SpeechReco
12964
12950
  this.textToSpeechService.pause();
12965
12951
  }
12966
12952
  else {
12967
- if (this.isDoneTextToSpeech) {
12953
+ if (this.isDoneSpeaking) {
12968
12954
  this.speak();
12969
12955
  }
12970
12956
  else {
@@ -12974,6 +12960,7 @@ let SpeechRecognitionComponent = SpeechRecognitionComponent_1 = class SpeechReco
12974
12960
  this.isPlayingTextToSpeech = !this.isPlayingTextToSpeech;
12975
12961
  }
12976
12962
  restartTextToSpeech() {
12963
+ this.isPlayingTextToSpeech = true;
12977
12964
  this.textToSpeechService.cancel();
12978
12965
  this.speak();
12979
12966
  }
@@ -12995,28 +12982,19 @@ let SpeechRecognitionComponent = SpeechRecognitionComponent_1 = class SpeechReco
12995
12982
  }
12996
12983
  get isDisabledTextToSpeech() {
12997
12984
  const hasTextToSpeechVoice = this.textToSpeechService.hasVoice;
12998
- return !this.textToSpeech || !hasTextToSpeechVoice || this.isListening || SpeechRecognitionComponent_1.TOOLBAR_ACTIVE;
12985
+ return !this._recognizedText || !hasTextToSpeechVoice || this.isListening;
12999
12986
  }
13000
12987
  setTextAreaValue(value) {
13001
12988
  this.textAreaElement.value = value;
13002
12989
  }
13003
- stopTextToSpeech() {
13004
- this.isPlayingTextToSpeech = false;
13005
- this.textToSpeechService.cancel();
13006
- }
13007
12990
  speak() {
13008
- this.isDoneTextToSpeech = false;
13009
- this.isPlayingTextToSpeech = true;
13010
- this.textToSpeechService.speak(this.textToSpeech, this.voiceSpeed).then(() => {
12991
+ this.isDoneSpeaking = false;
12992
+ this.textToSpeechService.speak(this._recognizedText, this.voiceSpeed).then(() => {
13011
12993
  this.isPlayingTextToSpeech = false;
13012
- this.isDoneTextToSpeech = true;
12994
+ this.isDoneSpeaking = true;
13013
12995
  });
13014
12996
  }
13015
- get textToSpeech() {
13016
- return this.textAreaElement.value;
13017
- }
13018
12997
  };
13019
- SpeechRecognitionComponent.TOOLBAR_ACTIVE = false;
13020
12998
  SpeechRecognitionComponent.ctorParameters = () => [
13021
12999
  { type: SpeechRecognitionService },
13022
13000
  { type: TextToSpeechService },
@@ -13034,11 +13012,11 @@ __decorate([
13034
13012
  __decorate([
13035
13013
  Output()
13036
13014
  ], SpeechRecognitionComponent.prototype, "recognizedText", void 0);
13037
- SpeechRecognitionComponent = SpeechRecognitionComponent_1 = __decorate([
13015
+ SpeechRecognitionComponent = __decorate([
13038
13016
  Component({
13039
13017
  selector: 's-speech-recognition',
13040
- template: "<section class=\"speech-recognition\" *ngIf=\"hasSpeechRecognitionBrowserApi\">\n <div class=\"speech-recognition-text\">\n <ng-container *ngIf=\"canRenderMicrophone\">\n {{ 'platform.angular_components.text_area_before_speech' | translate }}\n </ng-container>\n\n <ng-container *ngIf=\"isListeningUserVoice\">\n {{ 'platform.angular_components.text_area_while_speech' | translate }}\n </ng-container>\n\n <ng-container *ngIf=\"canRenderAprove && canRenderDiscard\">\n {{ 'platform.angular_components.text_area_end_speech' | translate }}\n </ng-container>\n </div>\n <div class=\"speech-recognition-buttons\">\n <span\n *ngIf=\"canRenderListeningText\"\n (click)=\"stopListening()\"\n class=\"speech-recognition-item speech-recognition-item-regular\">\n <i class=\"far fa-ellipsis-h\"></i>\n </span>\n\n <span\n *ngIf=\"canRenderMicrophone\"\n (click)=\"onListen()\"\n class=\"speech-recognition-item speech-recognition-item-microphone\"\n [class.speech-recognition-item-disabled]=\"isDisabledMicrophone || isListening || disabled\">\n <i class=\"fas fa-microphone\"></i>\n </span>\n\n <span\n *ngIf=\"canRenderAprove\"\n (click)=\"onAprove()\"\n class=\"speech-recognition-item speech-recognition-item-aprove\">\n <i class=\"fas fa-check\"></i>\n </span>\n\n <span *ngIf=\"canRenderDiscard\"\n (click)=\"onDiscard()\"\n class=\"speech-recognition-item speech-recognition-item-discard\">\n <i class=\"fas fa-times\"></i>\n </span>\n\n <span\n *ngIf=\"canRenderTextToSpeech\"\n (click)=\"onOpenToolbar()\"\n class=\"speech-recognition-item speech-recognition-item-regular\"\n [class.speech-recognition-item-disabled]=\"isDisabledTextToSpeech\">\n <i class=\"fas fa-volume-down\"></i>\n </span>\n\n <span\n *ngIf=\"canRenderTextToSpeechToolbar\"\n class=\"speech-recognition-item-toolbar\">\n <i class=\"fas\" [class.fa-pause]=\"isPlayingTextToSpeech\" [class.fa-play]=\"!isPlayingTextToSpeech\"\n (click)=\"toggleTextToSpeech()\"></i>\n <i class=\"fas fa-backward\" (click)=\"restartTextToSpeech()\"></i>\n <span (click)=\"updateVoiceSpeed()\">\n {{ voiceSpeed }}x\n </span>\n <i class=\"fas fa-times\" (click)=\"onCloseToolbar()\"></i>\n </span>\n </div>\n</section>\n",
13041
- styles: [".speech-recognition{display:-ms-flexbox;display:flex;gap:10px;-ms-flex-pack:justify;justify-content:space-between;width:100%}.speech-recognition-buttons{display:-ms-flexbox;display:flex;gap:10px;position:relative;bottom:15px;margin-right:16px}.speech-recognition-item{display:-ms-inline-flexbox;display:inline-flex;height:25px;padding:4px 12px;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;gap:8px;border-radius:15px;cursor:pointer;transition:background .1s ease-in}.speech-recognition-item i,.speech-recognition-item span{color:#fff}.speech-recognition-item-disabled{cursor:default!important}.speech-recognition-item-disabled *{opacity:.5}.speech-recognition-item-microphone{background:#428bca}.speech-recognition-item-microphone:not(.speech-recognition-item-disabled):hover{background:#063951}.speech-recognition-item-regular{background:#7892a1}.speech-recognition-item-regular:not(.speech-recognition-item-disabled):hover{background:#697882}.speech-recognition-item-aprove{background:#0c9348}.speech-recognition-item-aprove:not(.speech-recognition-item-disabled):hover{background:#063951}.speech-recognition-item-discard{background:#c13018}.speech-recognition-item-discard:not(.speech-recognition-item-disabled):hover{background:#063951}.speech-recognition-item-toolbar{background:#7892a1;display:-ms-flexbox;display:flex;border-radius:15px;-ms-flex-align:center;align-items:center;color:#fff;height:25px}.speech-recognition-item-toolbar i,.speech-recognition-item-toolbar span{cursor:pointer}.speech-recognition-item-toolbar i:not(:first-child),.speech-recognition-item-toolbar i:not(:last-child){padding:6px}.speech-recognition-item-toolbar i:first-child{padding-left:10px}.speech-recognition-item-toolbar i:last-child{padding-right:10px}.speech-recognition-text{color:#212533;font-size:12px;font-style:normal;font-weight:400;word-break:break-word}"]
13018
+ template: "<section class=\"speech-recognition\" *ngIf=\"hasSpeechRecognitionBrowserApi\">\n <div class=\"speech-recognition-text\">\n <ng-container *ngIf=\"canRenderMicrophone\">\n {{ 'platform.angular_components.text_area_before_speech' | translate }}\n </ng-container>\n\n <ng-container *ngIf=\"isSpeaking\">\n {{ 'platform.angular_components.text_area_while_speech' | translate }}\n </ng-container>\n\n <ng-container *ngIf=\"canRenderAprove && canRenderDiscard\">\n {{ 'platform.angular_components.text_area_end_speech' | translate }}\n </ng-container>\n </div>\n <div class=\"speech-recognition-buttons\">\n <span\n *ngIf=\"canRenderListeningText\"\n (click)=\"stopListening()\"\n class=\"speech-recognition-item speech-recognition-item-regular\">\n <i class=\"far fa-ellipsis-h\"></i>\n </span>\n\n <span\n *ngIf=\"canRenderMicrophone\"\n (click)=\"onListen()\"\n class=\"speech-recognition-item speech-recognition-item-microphone\"\n [class.speech-recognition-item-disabled]=\"isDisabledMicrophone || isListening || disabled\">\n <i class=\"fas fa-microphone\"></i>\n </span>\n\n <span\n *ngIf=\"canRenderAprove\"\n (click)=\"onAprove()\"\n class=\"speech-recognition-item speech-recognition-item-aprove\">\n <i class=\"fas fa-check\"></i>\n </span>\n\n <span *ngIf=\"canRenderDiscard\"\n (click)=\"onDiscard()\"\n class=\"speech-recognition-item speech-recognition-item-discard\">\n <i class=\"fas fa-times\"></i>\n </span>\n\n <span\n *ngIf=\"canRenderTextToSpeech\"\n (click)=\"onOpenToolbar()\"\n class=\"speech-recognition-item speech-recognition-item-regular\"\n [class.speech-recognition-item-disabled]=\"isDisabledTextToSpeech\">\n <i class=\"fas fa-volume-down\"></i>\n </span>\n\n <span\n *ngIf=\"canRenderTextToSpeechToolbar\"\n class=\"speech-recognition-item-toolbar\">\n <i class=\"fas\" [class.fa-pause]=\"isPlayingTextToSpeech\" [class.fa-play]=\"!isPlayingTextToSpeech\"\n (click)=\"toggleTextToSpeech()\"></i>\n <i class=\"fas fa-backward\" (click)=\"restartTextToSpeech()\"></i>\n <span (click)=\"updateVoiceSpeed()\">\n {{ voiceSpeed }}x\n </span>\n <i class=\"fas fa-times\" (click)=\"onCloseToolbar()\"></i>\n </span>\n </div>\n</section>\n",
13019
+ styles: [".speech-recognition{display:-ms-flexbox;display:flex;gap:10px;-ms-flex-pack:justify;justify-content:space-between;width:100%}.speech-recognition-buttons{display:-ms-flexbox;display:flex;gap:10px;position:relative;bottom:15px;margin-right:16px}.speech-recognition-item{display:-ms-inline-flexbox;display:inline-flex;height:25px;padding:4px 12px;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;gap:8px;border-radius:15px;cursor:pointer;transition:background .1s ease-in}.speech-recognition-item i,.speech-recognition-item span{color:#fff}.speech-recognition-item-disabled{cursor:default!important}.speech-recognition-item-disabled *{opacity:.5}.speech-recognition-item-microphone{background:#428bca}.speech-recognition-item-microphone:not(.speech-recognition-item-disabled):hover{background:#063951}.speech-recognition-item-regular{background:#7892a1}.speech-recognition-item-regular:not(.speech-recognition-item-disabled):hover{background:#697882}.speech-recognition-item-aprove{background:#0c9348}.speech-recognition-item-aprove:not(.speech-recognition-item-disabled):hover{background:#063951}.speech-recognition-item-discard{background:#c13018}.speech-recognition-item-discard:not(.speech-recognition-item-disabled):hover{background:#063951}.speech-recognition-item-toolbar{background:#7892a1;display:-ms-flexbox;display:flex;border-radius:15px;-ms-flex-align:center;align-items:center;color:#fff}.speech-recognition-item-toolbar i,.speech-recognition-item-toolbar span{cursor:pointer}.speech-recognition-item-toolbar i:not(:first-child),.speech-recognition-item-toolbar i:not(:last-child){padding:6px}.speech-recognition-item-toolbar i:first-child{padding-left:10px}.speech-recognition-item-toolbar i:last-child{padding-right:10px}.speech-recognition-item-toolbar span{height:25px}.speech-recognition-text{color:#212533;font-size:12px;font-style:normal;font-weight:400;word-break:break-word}"]
13042
13020
  })
13043
13021
  ], SpeechRecognitionComponent);
13044
13022