{"version":3,"file":"gpeel-my-validators.mjs","sources":["../../../../projects/gpeel/my-validators/src/lib/debug-form/debug-form.component.ts","../../../../projects/gpeel/my-validators/src/lib/debug-form/debug-input-field.component.ts","../../../../projects/gpeel/my-validators/src/lib/pluggable-api/messages/messages-service-api.ts","../../../../projects/gpeel/my-validators/src/lib/error-messages/my-error-message.component.ts","../../../../projects/gpeel/my-validators/src/lib/error-messages/my-error.directive.ts","../../../../projects/gpeel/my-validators/src/lib/error-messages/my-control-options.directive.ts","../../../../projects/gpeel/my-validators/src/lib/submit-button/submit-if-abstract.directive.ts","../../../../projects/gpeel/my-validators/src/lib/pluggable-api/alert/alert-api.ts","../../../../projects/gpeel/my-validators/src/lib/submit-button/my-submit-if-valid-and-dirty.directive.ts","../../../../projects/gpeel/my-validators/src/lib/submit-button/my-submit-if-valid.directive.ts","../../../../projects/gpeel/my-validators/src/lib/validators/solution-1-simplest/my-validators.ts","../../../../projects/gpeel/my-validators/src/lib/validators/solution-1-simplest/my-validators-directive.ts","../../../../projects/gpeel/my-validators/src/lib/pluggable-api/validators/validators-service-api.ts","../../../../projects/gpeel/my-validators/src/lib/pluggable-api/validators/default-validators.service.ts","../../../../projects/gpeel/my-validators/src/lib/pluggable-api/messages/default-messages.service.ts","../../../../projects/gpeel/my-validators/src/lib/pluggable-api/alert/default-alert.service.ts","../../../../projects/gpeel/my-validators/src/lib/my-validators.module.ts","../../../../projects/gpeel/my-validators/src/gpeel-my-validators.ts"],"sourcesContent":["import {Component, Input} from '@angular/core';\r\nimport {AbstractControl, NgForm} from '@angular/forms';\r\n\r\n/**\r\n * Use:\r\n *   <debug-form [form]=\"form\"></debug-form>\r\n *\r\n *  Output:\r\n *\r\n *  FORM.value {\r\n *    \"nom\": null,\r\n *    \"prenom\": null,\r\n *    \"nationaliteId\": null\r\n *   }\r\n *   FORM.dirty=false   FORM.valid=false\r\n */\r\n@Component({\r\n  selector: 'debug-form',\r\n  template: `\r\n    <div>\r\n      <div>\r\n<pre style=\"font-size: 12px\">\r\nFORM.dirty={{form.dirty}}\r\nFORM.valid={{form.valid}}\r\nFORM.value {{form.value | json}}\r\n</pre>\r\n      </div>\r\n    </div>\r\n  `,\r\n})\r\nexport class DebugFormComponent {\r\n\r\n  @Input() form!: AbstractControl | NgForm;\r\n}\r\n","import {Component, Input, OnInit} from '@angular/core';\r\nimport {AbstractControl, NgForm} from '@angular/forms';\r\nimport {Plog} from '@gpeel/plog';\r\n\r\n/**\r\n * Use:\r\n * <debug-input-field [group]=\"form\" prop=\"nom\"></debug-input-field>\r\n *\r\n * Output:\r\n *\r\n * Field.NOM.value = 'pipo'\r\n *    nom.blur||dirty = false || false\r\n *    nom.errors = {\r\n *      \"required\": {\r\n *        \"msg\": \"'Nom' is required\"\r\n *      }\r\n *\r\n */\r\n// @formatter:off\r\n@Component({\r\n  selector: 'debug-input-field',\r\n  template: `\r\n    <pre style=\"font-size: 12px\">\r\n\r\n      Field.{{prop}}.value = {{control.value | json}}\r\n      {{prop}}.blur={{control.touched}}\r\n      {{prop}}.dirty={{control.dirty}}\r\n      {{prop}}.errors = {{control.errors | json}}\r\n    </pre>\r\n  `,\r\n  styles : [`\r\n      pre {\r\n          white-space: pre-line; /* CSS3 - Text module (Candidate Recommendation) http://www.w3.org/TR/css3-text/#white-space */\r\n      }\r\n  `]\r\n})\r\n// @formatter:on\r\nexport class DebugInputFieldComponent implements OnInit {\r\n  @Input() group!: AbstractControl | NgForm;\r\n  @Input() prop!: string;\r\n\r\n  _control!: AbstractControl;\r\n\r\n  /**\r\n   * To solve most pb with NgModel very curious build sequence\r\n   * ALSO that's why you have ? in the HTML\r\n   */\r\n  get control() {\r\n    if (!this._control) {\r\n      const v = (this.group as NgForm).controls[this.prop];\r\n      // console.log('vvvvvvvvvvvvvvvvvv', v, this.prop, this.group, this.group.controls);\r\n      return v;\r\n    }\r\n    return this._control;\r\n  }\r\n\r\n  ngOnInit() {\r\n    if (this.group instanceof AbstractControl) {\r\n      const local = this.group.get(this.prop);\r\n      if (!local) {\r\n        Plog.error(`Error accessing property ${this.prop} on formgroup: CONTROL is NULL`);\r\n      } else {\r\n        this._control = local;\r\n      }\r\n      // else {\r\n      // this._control = this.group.controls[this.prop];\r\n      // if (!this._control)\r\n      // NOT an error, this is NORMAL with Template API\r\n      // Plog.error(`Error accessing property ${this.prop} on formgroup: CONTROL is NULL`);\r\n      // }\r\n    }\r\n  }\r\n}\r\n","import {InjectionToken} from '@angular/core';\nimport {AbstractControl} from '@angular/forms';\nimport {ErrorMsgMap} from '../../error-messages/error-msg-api';\n\nexport interface MyMessagesServiceInterface {\n  getValidationMessageFor(key: string, errors?: ErrorMsgMap): string;\n}\n\nexport const MY_MESSAGES_SERVICE_API = new InjectionToken<MyMessagesServiceInterface>('MyMessagesService');\nexport const MY_SHOW_ERROR_MSG_FUNCTION_API = new InjectionToken<MyMessagesServiceInterface>('MY_SHOW_ERROR_MSG_FUNCTION');\n\n\nexport type ShowFunction = (control: AbstractControl) => any;\n\nexport function DEFAULT_SHOW_ERROR_MSG_FUNCTION(control: AbstractControl) {\n  return (control.dirty || control.touched);\n}\n","/* eslint-disable no-underscore-dangle */\r\nimport {\r\n  AfterViewInit,\r\n  ChangeDetectionStrategy,\r\n  ChangeDetectorRef,\r\n  Component,\r\n  Inject,\r\n  Input,\r\n  OnDestroy\r\n} from '@angular/core';\r\nimport {AbstractControl} from '@angular/forms';\r\nimport {Plog} from '@gpeel/plog';\r\nimport {debounceTime, merge, Subscription} from 'rxjs';\r\nimport {MY_SHOW_ERROR_MSG_FUNCTION_API, ShowFunction} from '../pluggable-api/messages/messages-service-api';\r\nimport {ErrorMsgFn, ErrorMsgMap} from './error-msg-api';\r\n\r\n/**\r\n * Use:\r\n * It is REQUIRED to use the directve myErrorMsg directly on the <input> like\r\n *\r\n * <input myErrorMsg='theNameOfTheField'>\r\n *\r\n * And OPTIONNALY define in HTML another component where the validation error messages would go\r\n * <my-error-msg #theNameOfTheField=\"myErrorMsg\" ></my-error-msg>\r\n * #refVar=\"myErrorMsg\" creates a template-var-reference to the <my-error-msg> component.\r\n * And then this ref is given to the directive myErrorMsg with [myErrorMsg]=\"refVar\"\r\n *\r\n * If the component  <my-error-msg> is not created, the directive myErrorMsg will create it automatically\r\n * under the <input>\r\n *\r\n * => The directive myErrorMsg will listen to the blur event and transform it\r\n * into a valueChanges event so show the validation errors even when using OnPush.\r\n *\r\n * Note:\r\n *  the formControl SHOULD NOT change overtime, since it is RESOLVED at OnInit()\r\n *  Hereafter the control will NOT evolve if you change your form dynamically.\r\n *  for example it won't work if you rebuild new formControls with the FormBuilder.\r\n */\r\n@Component({\r\n  selector: 'my-error-msg',\r\n  template: `\r\n    {{onRefreshCounter()}}\r\n    <!--    <ng-container *ngIf=\"errors && (this.control.dirty || this.control.touched)\">-->\r\n    <ng-container *ngIf=\"errors && showErrorUsed(control)\">\r\n      <div [ngClass]=\"customClassObject\" class=\"my-error-GLOBAL\">\r\n        <div *ngFor=\"let message of mymsgs\" role=\"message\">{{message}}</div>\r\n      </div>\r\n    </ng-container>\r\n  `,\r\n  exportAs: 'myErrorMsg',\r\n  styles: [\r\n    `\r\n        div[role=message] {\r\n            color: red;\r\n            display: block;\r\n            margin-bottom: 0;\r\n        }\r\n\r\n        /* Define CSS with .my-error-GLOBAL in the GLOBAL file ./src/styles.css */\r\n        /* For example*/\r\n        /* .my-error-GLOBAL[class] label { color: blue;    }*/\r\n    `\r\n  ],\r\n  // encapsulation: ViewEncapsulation.Emulated,\r\n  changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class MyErrorMessageComponent implements OnDestroy, AfterViewInit {\r\n\r\n  @Input() myErrorExtraMsg: ErrorMsgMap = {};\r\n  @Input() showErrorFunction!: (control: AbstractControl) => boolean | undefined;\r\n\r\n  showErrorUsed!: (control: AbstractControl) => boolean | undefined;\r\n  control!: AbstractControl;\r\n  errors = false;\r\n  subscription!: Subscription;\r\n  customClassObject: any;\r\n  mymsgs: string[] = [];\r\n  id = ''; // id of corresponding <input id=xx> if defined\r\n  counter = 1;\r\n  // memoControlErrors: any | undefined;\r\n  // adebounce: number = 3000; // debouncing is NOT very interesting, because there is still a full changeDetection\r\n  // cycle for each user keystroke ... it is just that the error are not shown until the debounceTime, but there is no\r\n  // gain of perf because there IS a CD reaching the Component containing the <input> emitting the for each keystroke.\r\n  // You could also devise a CVA like ControlOptionDirective int this folder to choose which events input and/or blur +\r\n  // debounce will make the Validators re-compute. In that case there is still as many CD. So it's just a matter of UI\r\n  // ergonomics\r\n\r\n  constructor(private cd: ChangeDetectorRef,\r\n              @Inject(MY_SHOW_ERROR_MSG_FUNCTION_API) public showFunctionGlobal: ShowFunction) {\r\n    Plog.validationErrorMsgCreation('<pee-error-msg>');\r\n    this.showErrorUsed = showFunctionGlobal;\r\n  }\r\n\r\n  // @Input() set debounce(value: any) {\r\n  //   if (typeof value === 'string') {\r\n  //     this.adebounce = +value;\r\n  //   } else if (typeof value === 'number') {\r\n  //     this.adebounce = value;\r\n  //   }\r\n  // }\r\n\r\n  @Input() set myErrorClass(className: string) {\r\n    // this.host.nativeElement.classList.add(className);\r\n    this.customClassObject = {[`${className}`]: true};\r\n  }\r\n\r\n  ngOnDestroy(): void {\r\n    if (this.subscription) {\r\n      this.subscription.unsubscribe();\r\n    }\r\n  }\r\n\r\n  /**\r\n   * With ngMaterial INPUT, the blur does NOT generate a valueChanges ...\r\n   * So for example an error computed at startup is not shown because dirty==false, touched==false at that time.\r\n   * ok so far.\r\n   * This error Will NOT be shown when touched turns true, because I need an explicit  this.cd.markForCheck();\r\n   * for this OnPush MyErrorMessageComponent.\r\n   * 4 Options:\r\n   *    -1 inspect control.touched on each CD with DoCheck,\r\n   *      and kick off a compute and markForCheck when turning true\r\n   *    -2 OR NOT be OnPush, and let the HTML refresh with a *ngIf on the touched/dirty flag\r\n   *    We can pre-compute the errors-msgs before so we don't have to do it again.\r\n   *    This works only if the <my-error-msg> is not in OnPush wrapping component around ...\r\n   *    -3 OR use a specific CVA (ControlValueAccessor), which generates always a valueChanges when a blur is made.\r\n   *    So if a CVA like that is added on each input it will work. The problem with transforming myErrorMsg\r\n   *    into a CVA is that you can't add other CVA afterward. NG only takes one custom CVA per <element>.\r\n   *    But with such a CVA ErrorMessageComponent could be OnPush and refresh only on valueChanges() +\r\n   * cd.markForCheck()\r\n   *    -4 OR NEW SOLUTION : *** probably the BEST *** and this is the Strategy used in this toolkit.\r\n   *    Don't use a CVA but just add an event handler on the <input> to catch (blur) or (focusout) and generate a\r\n   * valueChanges. Make the use of myErrorMsg DIRECTIVE the required strategy to have validation errors. So myErrorMsg\r\n   * will add a blur listener to emit a valueChanges event when there is a blur. The myErrorMsg directive will CONNECT\r\n   * to this component MyErrorMessageComponent or create it dynamically. This solution is described in the comment\r\n   * above this class\r\n   */\r\n\r\n\r\n  // ngOnInit(): void {\r\n  // NOt the right place to do the following => better in ngAfterViewInit()\r\n  // this.compute(); // for startup, so that this.msgs is filled\r\n  // this.subscription = this.control.valueChanges.subscribe(() => {\r\n  //   this.compute();\r\n  //   this.cd.markForCheck();\r\n  // });\r\n  // }\r\n\r\n  ngAfterViewInit(): void {\r\n    // prefer local customization than global\r\n    if (this.showErrorFunction) {\r\n      this.showErrorUsed = this.showErrorFunction;\r\n    }\r\n    this.compute(); // for startup, so that this.msgs is filled\r\n    // subscribing to this.control.statusChanges seems redundant\r\n    // it is ! for sync validators\r\n    // But for async validators the value was changed much before, so we need to be triggered when validity comes back.\r\n    // Since async only execute when sync are ok, if there is a change means errors coming back.\r\n    this.subscription = merge(this.control.valueChanges, this.control.statusChanges)\r\n      .pipe(debounceTime(10)) // very short denounce to avoid  this.control.valueChanges, this.control.statusChanges to trigger 2 computes\r\n      // .pipe(debounceTime(this.adebounce))\r\n      // Also following seems interresting BUT when \"makeDirty\" a form which resends the new valueChanges\r\n      // will no longer reach the cd.markForCheck, it was meant for !\r\n      // .pipe(\r\n      //   map(() => this.control.errors),\r\n      //   distinctUntilChanged((x, y) => {\r\n      //     Plog.red(x, y);\r\n      //     return deepEqual(x, y);\r\n      //   }),\r\n      // )\r\n      .subscribe(() => {\r\n        this.compute();\r\n        this.cd.markForCheck();\r\n      });\r\n  }\r\n\r\n  compute() {\r\n    this.mymsgs = [];\r\n    if (this.control && this.control.errors) {\r\n      Object.keys(this.control.errors)\r\n        .forEach(key => {\r\n          // for each key, check if there is a custom messages override\r\n          const c: string | ErrorMsgFn = this.myErrorExtraMsg[key];\r\n          if (c) {\r\n            if (typeof c === 'string') {\r\n              this.mymsgs.push(c);\r\n            } else {\r\n              this.mymsgs.push(c(this.control.errors![key]));\r\n            }\r\n          } else {\r\n            this.mymsgs.push(this.control.errors![key].msg);\r\n          }\r\n        });\r\n    }\r\n\r\n    if (this.mymsgs.length > 0) {\r\n      this.errors = true;\r\n    } else {\r\n      this.errors = false;\r\n    }\r\n    const msg = this.id ? `${this.id}.valueChanges() extracting` : 'c.valueChanges() extracting';\r\n    Plog.validationCompute(msg, this.errors ? this.mymsgs : 'no-errors');\r\n  }\r\n\r\n  onRefreshCounter() {\r\n    Plog.validationErrorMsgRefresh(`MY-ERROR-MSG ${this.id} ${this.counter++}`);\r\n  }\r\n\r\n}\r\n\r\nexport function deepEqual(object1: any, object2: any): boolean {\r\n\r\n  if (!object1 && !object2) {\r\n    return true;\r\n  }\r\n  if (!object1 && object2) {\r\n    return false;\r\n  }\r\n  if (object1 && !object2) {\r\n    return false;\r\n  }\r\n\r\n  const keys1 = Object.keys(object1);\r\n  const keys2 = Object.keys(object2);\r\n  if (keys1.length !== keys2.length) {\r\n    return false;\r\n  }\r\n\r\n  for (const key of keys1) {\r\n    const val1 = object1[key];\r\n    const val2 = object2[key];\r\n    const areObjects = isObject(val1) && isObject(val2);\r\n    if (\r\n      areObjects && !deepEqual(val1, val2) ||\r\n      !areObjects && val1 !== val2\r\n    ) {\r\n      return false;\r\n    }\r\n  }\r\n\r\n  return true;\r\n}\r\n\r\nexport function isObject(object: any) {\r\n  return object != null && typeof object === 'object';\r\n}\r\n","import {\r\n  AfterViewInit,\r\n  ComponentFactoryResolver,\r\n  Directive,\r\n  ElementRef,\r\n  Input,\r\n  OnChanges,\r\n  OnInit,\r\n  Optional,\r\n  Self,\r\n  SimpleChanges,\r\n  ViewContainerRef\r\n} from '@angular/core';\r\nimport {AbstractControl, ControlContainer, NgControl} from '@angular/forms';\r\nimport {fromEvent} from 'rxjs';\r\nimport {ErrorMsgMap} from '../error-messages/error-msg-api';\r\nimport {MyErrorMessageComponent} from './my-error-message.component';\r\n\r\n/**\r\n * Use :\r\n *   <input myErrorMsg='theNameOfTheTemplateVarRef'>\r\n *\r\n * And where you want the error comp to appear\r\n *  <my-error-msg #theNameOfTheTemplateVarRef=\"myErrorMsg\" ></my-error-msg>\r\n *\r\n * Option : the silent option :\r\n * If you don't code the above the component <my-error-msg ...></my-error-msg>\r\n * is created implicitly just under the <input> (it is for basic cases)\r\n *\r\n *  the FormControl (NgControl) SHOULD NOT change overtime,\r\n *  since it is RESOLVED at OnInit().\r\n *  Hereafter the control will NOT evolve if you change your form.\r\n *  for example it won't work if you rebuild it with the FormBuilder.\r\n */\r\n@Directive({\r\n  selector: '[myErrorMsg]'\r\n})\r\nexport class MyErrorDirective implements OnInit, AfterViewInit, OnChanges {\r\n  // undefined for [myErrorMsg]\r\n  @Input('myErrorMsg') component: MyErrorMessageComponent | undefined | '';\r\n\r\n  // when using this directive without params the value set by Angular will be\r\n  // '' for myErrorMsg\r\n  @Input() myErrorClass: string | undefined;\r\n  @Input() myErrorExtraMsg: ErrorMsgMap | undefined;\r\n  @Input() showErrorFunction!: (control: AbstractControl) => boolean | undefined;\r\n  @Input() id = '';\r\n\r\n  constructor(private vcr: ViewContainerRef,\r\n              private resolver: ComponentFactoryResolver,\r\n              @Optional() @Self() private ngControlSelf: NgControl,\r\n              @Optional() @Self() private controlContainerSelf: ControlContainer,\r\n              private host: ElementRef) {\r\n  }\r\n\r\n  // component: MyErrorMessageComponent;\r\n\r\n  ngOnChanges(changes: SimpleChanges): void {\r\n    if (changes['myErrorExtraMsg']) {\r\n      if (this.component && this.myErrorExtraMsg) {\r\n        this.component.myErrorExtraMsg = this.myErrorExtraMsg;\r\n      }\r\n    }\r\n    if (changes['myErrorClass']) {\r\n      if (this.component && this.myErrorClass) {\r\n        this.component.myErrorClass = this.myErrorClass;\r\n      }\r\n    }\r\n  }\r\n\r\n  ngOnInit(): void {\r\n    const self = this.controlContainerSelf || this.ngControlSelf;\r\n\r\n    if (!this.component) {\r\n      // if the <my-error-msg ...></my-error-msg> is referenced, just use it\r\n      // otherwise create it !\r\n      const factory = this.resolver.resolveComponentFactory(MyErrorMessageComponent);\r\n      this.component = this.vcr.createComponent(factory).instance;\r\n    }\r\n\r\n    if (self.control) {\r\n      this.component.control = self.control;\r\n    }\r\n\r\n    if (this.myErrorClass) {\r\n      this.component.myErrorClass = this.myErrorClass;\r\n    }\r\n    if (this.myErrorExtraMsg) {\r\n      this.component.myErrorExtraMsg = this.myErrorExtraMsg;\r\n    }\r\n    if (this.id) {\r\n      this.component.id = this.id;\r\n    }\r\n    if (this.showErrorFunction) {\r\n      this.component.showErrorFunction = this.showErrorFunction;\r\n    }\r\n\r\n    // correcting the blur event defective-NG-strategy\r\n    fromEvent(this.host.nativeElement, 'focusout') // focusout same as blur\r\n      .subscribe(() => {\r\n        if (this.component) {\r\n          this.component.control.updateValueAndValidity(); // this turns dirty when blurred on <input>\r\n          // but NOT for <select> nor <textarea>\r\n          this.component.control.markAsDirty(); // <= specifically for <select> nor <textarea>\r\n        }\r\n        // this.component.control.markAsTouched(); // not necessary ...\r\n      });\r\n  }\r\n\r\n  ngAfterViewInit(): void {\r\n    if (!this.id) {\r\n      if (this.host.nativeElement.id) {\r\n        this.id = this.host.nativeElement.id;\r\n        if (this.component) {\r\n          this.component.id = this.id;\r\n        }\r\n      }\r\n    }\r\n  }\r\n\r\n}\r\n\r\n\r\n","/* eslint-disable no-underscore-dangle*/\r\nimport {ChangeDetectorRef, Directive, ElementRef, forwardRef, Input, OnDestroy, OnInit, Renderer2} from '@angular/core';\r\nimport {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';\r\nimport {Plog} from '@gpeel/plog';\r\nimport {fromEvent, merge, Observable, Subscription, timer} from 'rxjs';\r\nimport {debounce, map} from 'rxjs/operators';\r\n\r\n//  {  'blur': 0, 'input': 300 } }\r\nexport interface ControlOptions {\r\n  blur?: number;\r\n  input?: number;\r\n}\r\n\r\n/**\r\n * This is the default values\r\n * You can customize ie :\r\n * [myControlOptions]=\"{  'blur': 0, 'input': 300}\" means you want a valueChanges emit on blur with a debounce of 0,\r\n * and a valueChanges emit on input with a debounce of 300.\r\n */\r\nconst DEFAULT_CONTROL_OPTIONS: ControlOptions = {\r\n  blur: 0,\r\n  input: 300,\r\n};\r\n\r\n/**\r\n *  myControlOptions directive SHOULD NO BE USED on input type=radio\r\n *  myControlOptions directive SHOULD NO BE USED on input type=checkbox\r\n *  myControlOptions cold be used on text, email and number types\r\n *\r\n *  Use:\r\n *\r\n *  peeCOntrolOptions\r\n *  With no param : you get the default  blur =0 , input 300ms of debounce\r\n *\r\n * <input  myControlOptions formControlName=\"titre\"  placeholder=\"Titre\">\r\n *\r\n * or with more fine grain control\r\n *\r\n *  Now blur has 0 debounce, input has 3000 ms =>\r\n * <input  [myControlOptions]=\"{blur: 0, input: 3000}\" formControlName=\"titre\"  placeholder=\"Titre\">\r\n */\r\n@Directive({\r\n  selector:\r\n  // types selector number + email + text + default(=text)\r\n    '[myControlOptions][formControlName],' +\r\n    '[myControlOptions][formControl],' +\r\n    '[myControlOptions][formControl]input[type=text],' +\r\n    '[myControlOptions][formControlName]input[type=text],' +\r\n    '[myControlOptions][formControl]input[type=number],' +\r\n    '[myControlOptions][formControlName]input[type=number],' +\r\n    '[myControlOptions][formControl]input[type=email],' +\r\n    '[myControlOptions][formControlName]input[type=email]'\r\n  ,\r\n  providers: [{\r\n    provide: NG_VALUE_ACCESSOR,\r\n    useExisting: forwardRef(() => MyControlOptionsDirective),\r\n    multi: true,\r\n  }],\r\n})\r\nexport class MyControlOptionsDirective implements ControlValueAccessor, OnInit, OnDestroy {\r\n  events!: Subscription;\r\n  onChange: any;\r\n  onTouched: any;\r\n  _controlOptions: ControlOptions = DEFAULT_CONTROL_OPTIONS;\r\n\r\n  constructor(private renderer: Renderer2,\r\n              private element: ElementRef,\r\n              private cd: ChangeDetectorRef) {\r\n    Plog.createDirective('MyControlOptionsDirective');\r\n  }\r\n\r\n  @Input()\r\n  get myControlOptions(): ControlOptions {\r\n    return this._controlOptions;\r\n  }\r\n\r\n  set myControlOptions(val: ControlOptions | '') {\r\n    if (val) {\r\n      this._controlOptions = val;\r\n    }\r\n  }\r\n\r\n  ngOnInit() {\r\n    Plog.violet('CONTROL_OPTIONS', this._controlOptions);\r\n    const event$Array: Observable<Event>[] = Object.keys(this._controlOptions)\r\n      .map(k => fromEvent(this.element.nativeElement, k));\r\n\r\n    console.log('EVENTS', event$Array);\r\n\r\n    this.events = merge(...event$Array)\r\n      .pipe(\r\n        map((e: Event) => ({type: e.type, value: (e.target as HTMLInputElement).value})),\r\n        debounce(event => {\r\n          // {'blur': 0, 'input': 300}\r\n          let time = 0;\r\n          const type = event.type;\r\n          if (type === 'blur' || type === 'input') {\r\n            const t = this._controlOptions[type];\r\n            time = t ? t : 0;\r\n          }\r\n          return timer(time);\r\n        }),\r\n        map(event => {\r\n          if (event.type === 'blur') {\r\n            this.onTouched(event.value);\r\n            this.onChange(event.value); // the changed is required to recompute validators\r\n            // because otherwise, a strange bug:  for example if validator minlength=3 and required\r\n            // type 2 caracters abd click outside to blur before the debounce time\r\n            // => then the field stays pristine, (touched is ok)\r\n            // ANd the validators are NOT recomputed by Angular.\r\n          } else if (event.type === 'input') {\r\n            this.onChange(event.value);\r\n          }\r\n          return event;\r\n        }),\r\n      )\r\n      // distinctUntilChanged is dangerous, the previous events\r\n      // may have been unsuccessful for other reasons\r\n      // .distinctUntilChanged()\r\n      .subscribe(event => {\r\n        Plog.validator('SPARKing a change', event, event.value);\r\n        // this.cd.markForCheck();\r\n      });\r\n  }\r\n\r\n  ngOnDestroy() {\r\n    if (this.events) {\r\n      this.events.unsubscribe();\r\n    }\r\n  }\r\n\r\n  /**\r\n   * implements ControlValueAccessor API\r\n   */\r\n  registerOnChange(fn: any): void {\r\n    this.onChange = fn;\r\n  }\r\n\r\n  /**\r\n   * implements ControlValueAccessor API\r\n   */\r\n  registerOnTouched(fn: any): void {\r\n    this.onTouched = fn;\r\n  }\r\n\r\n  /**\r\n   * implements ControlValueAccessor API\r\n   */\r\n  writeValue(value: any): void {\r\n    const normalizedValue = value == null ? '' : value;\r\n    this.renderer.setProperty(this.element.nativeElement, 'value', normalizedValue);\r\n  }\r\n\r\n  /**\r\n   * implements ControlValueAccessor API\r\n   */\r\n  setDisabledState(isDisabled: boolean): void {\r\n    this.renderer.setProperty(this.element.nativeElement, 'disabled', isDisabled);\r\n  }\r\n\r\n}\r\n","import {Directive, HostListener, InjectFlags, Injector} from '@angular/core';\r\nimport {AbstractControl, FormArray, FormGroup, FormGroupDirective, NgForm} from '@angular/forms';\r\nimport {Plog} from '@gpeel/plog';\r\n\r\n/**\r\n * This function could be useful, outside of this @Directive\r\n */\r\nexport function makeDirty(fg: FormGroup | FormArray | NgForm): void {\r\n  Plog.errorMsg('Turning every pristine field to dirty in the Form to reveal validation errors');\r\n  Object.keys(fg.controls)\r\n    .forEach((fieldName: string) => {\r\n      // @ts-ignore\r\n      const ac: AbstractControl = fg.controls[fieldName];\r\n      ac.markAsDirty();\r\n      ac.markAsTouched(); // necessary for LABEL when using material\r\n      ac.updateValueAndValidity(); // necessary to provoke a valueChanges()\r\n      // => so the validators are recomputed => so the widget <pee-error-msg> is refreshed\r\n      if ((ac instanceof FormGroup) || (ac instanceof FormArray)) {\r\n        makeDirty(ac);\r\n      }\r\n    });\r\n}\r\n\r\n@Directive()\r\nexport abstract class SubmitIfAbstractDirective {\r\n\r\n  /**\r\n   * Only tested for REACTIVE FORMS API yet\r\n   * Still to be tested : FormArray\r\n   * Also should be tested on TEMPLATE API\r\n   * BUT should work in both cases\r\n   */\r\n  protected constructor(private injector: Injector) {\r\n  }\r\n\r\n  @HostListener('click', ['$event'])\r\n  handleClick(event: Event) {\r\n    event.stopPropagation();\r\n    event.preventDefault();\r\n    // resolve the current form\r\n    const form = this.resolveForm(this.injector);\r\n    this.executeBehavior(form);\r\n  }\r\n\r\n  /**\r\n   * THIS is THE BEHAVIOR\r\n   * should be implemented by subclass\r\n   */\r\n  protected abstract executeBehavior(form: FormGroup): void;\r\n\r\n  /**\r\n   * Looking form the Root FormGroup SHOULD NOT be done at init\r\n   * because in some circustance the form could be rebuilt !\r\n   */\r\n  // ngOnInit(): void {\r\n  //   this.form = this.resolveForm(this.injector);\r\n  // }\r\n\r\n  // eslint-disable-next-line @typescript-eslint/member-ordering\r\n  protected makeDirty(fg: FormGroup | FormArray) {\r\n    makeDirty(fg);\r\n  }\r\n\r\n  /**\r\n   *  we should be sure to go up to the top formGroup which represents the <form> tag\r\n   *  The first FormGroup found is potentially NOT the top\r\n   */\r\n  // eslint-disable-next-line @typescript-eslint/member-ordering\r\n  private resolveForm(injector: Injector): FormGroup {\r\n    const formGroupDirective = injector.get(FormGroupDirective, null, InjectFlags.Optional);\r\n    const ngForm = injector.get(NgForm, null, InjectFlags.Optional);\r\n    let form: FormGroup | undefined;\r\n\r\n    if (formGroupDirective) {\r\n      let fg: FormGroup | FormArray = formGroupDirective.control;\r\n      while (fg.parent) {\r\n        fg = fg.parent;\r\n      }\r\n      form = fg as FormGroup;\r\n    }\r\n    // TEMPLATE API\r\n    if (ngForm) {\r\n      form = ngForm.control;\r\n    }\r\n    if (!form) {\r\n      throw new Error('FormGroup not found, because no Provider, check your code !');\r\n    }\r\n    return form;\r\n  }\r\n}\r\n\r\n\r\n","import {InjectionToken} from '@angular/core';\r\n\r\nexport interface MyAlertServiceInterface {\r\n  warn(msg: any): void;\r\n}\r\n\r\nexport const MY_ALERT_SERVICE_API = new InjectionToken<MyAlertServiceInterface>('MyAlert');\r\n\r\n","import {Directive, EventEmitter, Inject, Injector, Optional, Output} from '@angular/core';\r\nimport {FormGroup} from '@angular/forms';\r\nimport {Plog} from '@gpeel/plog';\r\nimport {MY_ALERT_SERVICE_API, MyAlertServiceInterface} from '../pluggable-api/alert/alert-api';\r\nimport {MY_MESSAGES_SERVICE_API, MyMessagesServiceInterface} from '../pluggable-api/messages/messages-service-api';\r\nimport {SubmitIfAbstractDirective} from './submit-if-abstract.directive';\r\n\r\n/**\r\n * Usage : replace\r\n * <button (click)=\"onSaveByContainer()\">save</button>\r\n * by :\r\n * <button (mySubmitIfValidAndDirty)=\"onYourLocalMethod()\">save</button>\r\n *\r\n * Effect: the button should not be not disabled, then when clicking on the button,\r\n * this directive will turn dirty all FormControl on the encapsulating \\<form>.\r\n * Doing that will make any validation error messgae appear.\r\n * If the form.valid is true => the event (mySubmitIfValidAndDirty) is emitted,\r\n * so the save() method is only then executed.\r\n * An alertService is invoked  (if provided on MY_ALERT_SERVICE_API Token)\r\n *     {\r\n *       provide: MY_ALERT_SERVICE_API,\r\n *       useClass: DefaultAlertService\r\n *     },\r\n *  with import {MY_ALERT_SERVICE_API} from './pluggable-api/alert/alert-api';\r\n *\r\n * - if the form is not valid, it will show the message : 'You must correct your form before saving it'.\r\n * - if the form is pristine, it will show the message : 'Your FORM is pristine! No action executed';\r\n *\r\n * You can also provide a MessageService implemeting MyMessagesServiceInterface,\r\n * if you do, return a message or the keys 'pristineForm' and 'invalidForm' to the method\r\n * getValidationMessageFor(key: string, errors?: ErrorMsgMap): string;\r\n *\r\n * For example :\r\n *   pristineForm: 'Your form is pristine! No action executed',\r\n *   invalidForm: 'You must correct your form before saving it',\r\n *\r\n *   => it is activated in MyValidatorsModule\r\n *   {\r\n *     provide: MY_MESSAGES_SERVICE_API,\r\n *     useClass: DefaultMessagesService\r\n *   }\r\n *   with import { MY_MESSAGES_SERVICE_API } from './pluggable-api/messages/messages-service-api';\r\n */\r\n@Directive({\r\n  selector: '[mySubmitIfValidAndDirty]'\r\n})\r\nexport class MySubmitIfValidAndDirtyDirective extends SubmitIfAbstractDirective {\r\n\r\n  @Output('mySubmitIfValidAndDirty') valid = new EventEmitter<void>();\r\n\r\n  constructor(injector: Injector,\r\n              @Optional() @Inject(MY_ALERT_SERVICE_API) private alertService: MyAlertServiceInterface,\r\n              @Optional() @Inject(MY_MESSAGES_SERVICE_API) private messageService: MyMessagesServiceInterface,\r\n  ) {\r\n    super(injector);\r\n  }\r\n\r\n  executeBehavior(form: FormGroup) {\r\n    const pristine = form.pristine;\r\n    let msgToWarnIfAny: string;\r\n    if (pristine) {\r\n      if (this.messageService) {\r\n        msgToWarnIfAny = this.messageService.getValidationMessageFor('pristineForm');\r\n      } else {\r\n        msgToWarnIfAny = 'Your form is pristine! No action executed';\r\n      }\r\n      Plog.warn(msgToWarnIfAny);\r\n\r\n      if (form.invalid) {\r\n        super.makeDirty(form); // make all dirty\r\n      }\r\n      if (this.alertService) {\r\n        this.alertService.warn(msgToWarnIfAny);\r\n      }\r\n      return;\r\n    }\r\n\r\n    // so !pristine here\r\n    if (form.valid && !pristine) {\r\n      this.valid.emit();\r\n    } else {\r\n      if (this.messageService) {\r\n        msgToWarnIfAny = this.messageService.getValidationMessageFor('invalidForm');\r\n      } else {\r\n        msgToWarnIfAny = 'You must correct your form before saving it';\r\n      }\r\n      Plog.warn(msgToWarnIfAny);\r\n      super.makeDirty(form); // make all dirty\r\n      if (this.alertService) {\r\n        this.alertService.warn(msgToWarnIfAny);\r\n      }\r\n    }\r\n\r\n  }\r\n\r\n}\r\n","import {Directive, EventEmitter, Inject, Injector, Optional, Output} from '@angular/core';\r\nimport {FormGroup} from '@angular/forms';\r\nimport {Plog} from '@gpeel/plog';\r\nimport {MY_ALERT_SERVICE_API, MyAlertServiceInterface} from '../pluggable-api/alert/alert-api';\r\nimport {SubmitIfAbstractDirective} from './submit-if-abstract.directive';\r\n\r\n// // usually AlertModule is in ./libs\r\n\r\n/**\r\n * Usage : replace\r\n * <button (click)=\"onSaveByContainer()\">save</button>\r\n * by :\r\n * <button (peeSubmitIfValid)=\"onSaveByContainer(form)\">save</button>\r\n *\r\n * Effect: the button is not disabled, so when clicking on the button, this directive will\r\n * make any validation error to appear on Validation Messages,\r\n * so the user could correct its inputs to make it valid.\r\n * If the form.valid is true => the event (tsSubmitIfValid) is emitted,\r\n * so the save() method is then executed.\r\n * An alertService is invoked  (if provided on MY_ALERT_SERVICE_API token)\r\n * - if the form is not valid, it will show the message : 'You must correct your form before saving it'.\r\n * - if the form is pristine, it will show the message : 'Your FORM is pristine! No action executed';\r\n */\r\n@Directive({\r\n  selector: '[mySubmitIfValid]'\r\n})\r\nexport class MySubmitIfValidDirective extends SubmitIfAbstractDirective {\r\n\r\n  @Output('mySubmitIfValid') valid = new EventEmitter<void>();\r\n\r\n  constructor(injector: Injector,\r\n              @Optional() @Inject(MY_ALERT_SERVICE_API) private alertService: MyAlertServiceInterface) {\r\n    super(injector);\r\n  }\r\n\r\n  executeBehavior(form: FormGroup) {\r\n    super.makeDirty(form);\r\n    if (form.valid) {\r\n      this.valid.emit();\r\n    } else {\r\n      const m = 'You must correct your form before saving it';\r\n      Plog.warn(m);\r\n      if (this.alertService) {\r\n        this.alertService.warn(m);\r\n      }\r\n    }\r\n  }\r\n\r\n}\r\n","/**\n * GAUTHIER PEEL : copied form version 16.1.0 of @angular/forms\n * MyValidators now compute an error messages in the same time they are executed\n *\n * https://github.com/angular/angular/blob/main/packages/forms/src/validators.ts\n *\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ɵisPromise as isPromise, ɵisSubscribable as isSubscribable, ɵRuntimeError as RuntimeError} from '@angular/core';\nimport {\n  AbstractControl,\n  AsyncValidator,\n  AsyncValidatorFn,\n  ValidationErrors,\n  Validator,\n  ValidatorFn\n} from '@angular/forms';\nimport {forkJoin, from, Observable} from 'rxjs';\nimport {map} from 'rxjs/operators';\n\n// import {AsyncValidator, AsyncValidatorFn, ValidationErrors, Validator, ValidatorFn} from './directives/validators';\n// import {RuntimeErrorCode} from './errors';\n// import {AbstractControl} from './model/abstract_model';\n\nfunction isEmptyInputValue(value: any): boolean {\n  /**\n   * Check if the object is a string or array before evaluating the length attribute.\n   * This avoids falsely rejecting objects that contain a custom length attribute.\n   * For example, the object {id: 1, length: 0, width: 0} should not be returned as empty.\n   */\n  return value == null ||\n    ((typeof value === 'string' || Array.isArray(value)) && value.length === 0);\n}\n\nfunction hasValidLength(value: any): boolean {\n  // non-strict comparison is intentional, to check for both `null` and `undefined` values\n  return value != null && typeof value.length === 'number';\n}\n\n// export const NG_VALIDATORS = new InjectionToken<Array<Validator | Function>>('NgValidators');\n// export const NG_ASYNC_VALIDATORS = new InjectionToken<Array<Validator | Function>>('NgAsyncValidators');\n\n/**\n * A regular expression that matches valid e-mail addresses.\n *\n * At a high level, this regexp matches e-mail addresses of the format `local-part@tld`, where:\n * - `local-part` consists of one or more of the allowed characters (alphanumeric and some\n *   punctuation symbols).\n * - `local-part` cannot begin or end with a period (`.`).\n * - `local-part` cannot be longer than 64 characters.\n * - `tld` consists of one or more `labels` separated by periods (`.`). For example `localhost` or\n *   `foo.com`.\n * - A `label` consists of one or more of the allowed characters (alphanumeric, dashes (`-`) and\n *   periods (`.`)).\n * - A `label` cannot begin or end with a dash (`-`) or a period (`.`).\n * - A `label` cannot be longer than 63 characters.\n * - The whole address cannot be longer than 254 characters.\n *\n * ## Implementation background\n *\n * This regexp was ported over from AngularJS (see there for git history):\n * https://github.com/angular/angular.js/blob/c133ef836/src/ng/directive/input.js#L27\n * It is based on the\n * [WHATWG version](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address) with\n * some enhancements to incorporate more RFC rules (such as rules related to domain names and the\n * lengths of different parts of the address). The main differences from the WHATWG version are:\n *   - Disallow `local-part` to begin or end with a period (`.`).\n *   - Disallow `local-part` length to exceed 64 characters.\n *   - Disallow total address length to exceed 254 characters.\n *\n * See [this commit](https://github.com/angular/angular.js/commit/f3f5cf72e) for more details.\n */\nconst EMAIL_REGEXP =\n  /^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n\n/**\n * @description\n * Provides a set of built-in validators that can be used by form controls.\n *\n * A validator is a function that processes a `FormControl` or collection of\n * controls and returns an error map or null. A null map means that validation has passed.\n *\n * @see [Form Validation](/guide/form-validation)\n *\n * @publicApi\n */\nexport class MyValidators {\n  /**\n   * @description\n   * Validator that requires the control's value to be greater than or equal to the provided number.\n   *\n   * @usageNotes\n   *\n   * ### Validate against a minimum of 3\n   *\n   * ```typescript\n   * const control = new FormControl(2, Validators.min(3));\n   *\n   * console.log(control.errors); // {min: {min: 3, actual: 2}}\n   * ```\n   *\n   * @returns A validator function that returns an error map with the\n   * `min` property if the validation check fails, otherwise `null`.\n   *\n   * @see {@link updateValueAndValidity()}\n   *\n   */\n  static min(min: number): ValidatorFn {\n    return minValidator(min);\n  }\n\n  /**\n   * @description\n   * Validator that requires the control's value to be less than or equal to the provided number.\n   *\n   * @usageNotes\n   *\n   * ### Validate against a maximum of 15\n   *\n   * ```typescript\n   * const control = new FormControl(16, Validators.max(15));\n   *\n   * console.log(control.errors); // {max: {max: 15, actual: 16}}\n   * ```\n   *\n   * @returns A validator function that returns an error map with the\n   * `max` property if the validation check fails, otherwise `null`.\n   *\n   * @see {@link updateValueAndValidity()}\n   *\n   */\n  static max(max: number): ValidatorFn {\n    return maxValidator(max);\n  }\n\n  /**\n   * @description\n   * Validator that requires the control have a non-empty value.\n   *\n   * @usageNotes\n   *\n   * ### Validate that the field is non-empty\n   *\n   * ```typescript\n   * const control = new FormControl('', Validators.required);\n   *\n   * console.log(control.errors); // {required: true}\n   * ```\n   *\n   * @returns An error map with the `required` property\n   * if the validation check fails, otherwise `null`.\n   *\n   * @see {@link updateValueAndValidity()}\n   *\n   */\n  static required(control: AbstractControl): ValidationErrors | null {\n    return requiredValidator(control);\n  }\n\n  /**\n   * @description\n   * Validator that requires the control's value be true. This validator is commonly\n   * used for required checkboxes.\n   *\n   * @usageNotes\n   *\n   * ### Validate that the field value is true\n   *\n   * ```typescript\n   * const control = new FormControl('some value', Validators.requiredTrue);\n   *\n   * console.log(control.errors); // {required: true}\n   * ```\n   *\n   * @returns An error map that contains the `required` property\n   * set to `true` if the validation check fails, otherwise `null`.\n   *\n   * @see {@link updateValueAndValidity()}\n   *\n   */\n  static requiredTrue(control: AbstractControl): ValidationErrors | null {\n    return requiredTrueValidator(control);\n  }\n\n  /**\n   * @description\n   * Validator that requires the control's value pass an email validation test.\n   *\n   * Tests the value using a [regular\n   * expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions)\n   * pattern suitable for common use cases. The pattern is based on the definition of a valid email\n   * address in the [WHATWG HTML\n   * specification](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address) with\n   * some enhancements to incorporate more RFC rules (such as rules related to domain names and the\n   * lengths of different parts of the address).\n   *\n   * The differences from the WHATWG version include:\n   * - Disallow `local-part` (the part before the `@` symbol) to begin or end with a period (`.`).\n   * - Disallow `local-part` to be longer than 64 characters.\n   * - Disallow the whole address to be longer than 254 characters.\n   *\n   * If this pattern does not satisfy your business needs, you can use `Validators.pattern()` to\n   * validate the value against a different pattern.\n   *\n   * @usageNotes\n   *\n   * ### Validate that the field matches a valid email pattern\n   *\n   * ```typescript\n   * const control = new FormControl('bad@', Validators.email);\n   *\n   * console.log(control.errors); // {email: true}\n   * ```\n   *\n   * @returns An error map with the `email` property\n   * if the validation check fails, otherwise `null`.\n   *\n   * @see {@link updateValueAndValidity()}\n   *\n   */\n  static email(control: AbstractControl): ValidationErrors | null {\n    return emailValidator(control);\n  }\n\n  /**\n   * @description\n   * Validator that requires the length of the control's value to be greater than or equal\n   * to the provided minimum length. This validator is also provided by default if you use the\n   * the HTML5 `minlength` attribute. Note that the `minLength` validator is intended to be used\n   * only for types that have a numeric `length` property, such as strings or arrays. The\n   * `minLength` validator logic is also not invoked for values when their `length` property is 0\n   * (for example in case of an empty string or an empty array), to support optional controls. You\n   * can use the standard `required` validator if empty values should not be considered valid.\n   *\n   * @usageNotes\n   *\n   * ### Validate that the field has a minimum of 3 characters\n   *\n   * ```typescript\n   * const control = new FormControl('ng', Validators.minLength(3));\n   *\n   * console.log(control.errors); // {minlength: {requiredLength: 3, actualLength: 2}}\n   * ```\n   *\n   * ```html\n   * <input minlength=\"5\">\n   * ```\n   *\n   * @returns A validator function that returns an error map with the\n   * `minlength` property if the validation check fails, otherwise `null`.\n   *\n   * @see {@link updateValueAndValidity()}\n   *\n   */\n  static minLength(minLength: number): ValidatorFn {\n    return minLengthValidator(minLength);\n  }\n\n  /**\n   * @description\n   * Validator that requires the length of the control's value to be less than or equal\n   * to the provided maximum length. This validator is also provided by default if you use the\n   * the HTML5 `maxlength` attribute. Note that the `maxLength` validator is intended to be used\n   * only for types that have a numeric `length` property, such as strings or arrays.\n   *\n   * @usageNotes\n   *\n   * ### Validate that the field has maximum of 5 characters\n   *\n   * ```typescript\n   * const control = new FormControl('Angular', Validators.maxLength(5));\n   *\n   * console.log(control.errors); // {maxlength: {requiredLength: 5, actualLength: 7}}\n   * ```\n   *\n   * ```html\n   * <input maxlength=\"5\">\n   * ```\n   *\n   * @returns A validator function that returns an error map with the\n   * `maxlength` property if the validation check fails, otherwise `null`.\n   *\n   * @see {@link updateValueAndValidity()}\n   *\n   */\n  static maxLength(maxLength: number): ValidatorFn {\n    return maxLengthValidator(maxLength);\n  }\n\n  /**\n   * @description\n   * Validator that requires the control's value to match a regex pattern. This validator is also\n   * provided by default if you use the HTML5 `pattern` attribute.\n   *\n   * @usageNotes\n   *\n   * ### Validate that the field only contains letters or spaces\n   *\n   * ```typescript\n   * const control = new FormControl('1', Validators.pattern('[a-zA-Z ]*'));\n   *\n   * console.log(control.errors); // {pattern: {requiredPattern: '^[a-zA-Z ]*$', actualValue: '1'}}\n   * ```\n   *\n   * ```html\n   * <input pattern=\"[a-zA-Z ]*\">\n   * ```\n   *\n   * ### Pattern matching with the global or sticky flag\n   *\n   * `RegExp` objects created with the `g` or `y` flags that are passed into `Validators.pattern`\n   * can produce different results on the same input when validations are run consecutively. This is\n   * due to how the behavior of `RegExp.prototype.test` is\n   * specified in [ECMA-262](https://tc39.es/ecma262/#sec-regexpbuiltinexec)\n   * (`RegExp` preserves the index of the last match when the global or sticky flag is used).\n   * Due to this behavior, it is recommended that when using\n   * `Validators.pattern` you **do not** pass in a `RegExp` object with either the global or sticky\n   * flag enabled.\n   *\n   * ```typescript\n   * // Not recommended (since the `g` flag is used)\n   * const controlOne = new FormControl('1', Validators.pattern(/foo/g));\n   *\n   * // Good\n   * const controlTwo = new FormControl('1', Validators.pattern(/foo/));\n   * ```\n   *\n   * @param pattern A regular expression to be used as is to test the values, or a string.\n   * If a string is passed, the `^` character is prepended and the `$` character is\n   * appended to the provided string (if not already present), and the resulting regular\n   * expression is used to test the values.\n   *\n   * @param errorKey\n   * @returns A validator function that returns an error map with the\n   * `pattern` property if the validation check fails, otherwise `null`.\n   *\n   * @see {@link updateValueAndValidity()}\n   *\n   */\n  static pattern(pattern: string | RegExp, errorKey = 'pattern'): ValidatorFn {\n    return patternValidator(pattern, errorKey);\n  }\n\n  /**\n   * @description\n   * Validator that performs no operation.\n   *\n   * @see {@link updateValueAndValidity()}\n   *\n   */\n  static nullValidator(control: AbstractControl): ValidationErrors | null {\n    return nullValidator(control);\n  }\n\n  /**\n   * @description\n   * Compose multiple validators into a single function that returns the union\n   * of the individual error maps for the provided control.\n   *\n   * @returns A validator function that returns an error map with the\n   * merged error maps of the validators if the validation check fails, otherwise `null`.\n   *\n   * @see {@link updateValueAndValidity()}\n   *\n   */\n  static compose(validators: null): null;\n  static compose(validators: (ValidatorFn | null | undefined)[]): ValidatorFn | null;\n  static compose(validators: (ValidatorFn | null | undefined)[] | null): ValidatorFn | null {\n    return compose(validators);\n  }\n\n  /**\n   * @description\n   * Compose multiple async validators into a single function that returns the union\n   * of the individual error objects for the provided control.\n   *\n   * @returns A validator function that returns an error map with the\n   * merged error objects of the async validators if the validation check fails, otherwise `null`.\n   *\n   * @see {@link updateValueAndValidity()}\n   *\n   */\n  static composeAsync(validators: (AsyncValidatorFn | null)[]): AsyncValidatorFn | null {\n    return composeAsync(validators);\n  }\n}\n\n/**\n * Validator that requires the control's value to be greater than or equal to the provided number.\n * See `Validators.min` for additional information.\n */\nexport function minValidator(min: number): ValidatorFn {\n  return (control: AbstractControl): ValidationErrors | null => {\n    if (isEmptyInputValue(control.value) || isEmptyInputValue(min)) {\n      return null;  // don't validate empty values to allow optional controls\n    }\n    const value = parseFloat(control.value);\n    // Controls with NaN values after parsing should be treated as not having a\n    // minimum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-min\n    return !isNaN(value) && value < min ? {\n      'min': {\n        'min': min,\n        'actual': control.value,\n        msg: `the number must be more or equal than ${min}`\n      }\n    } : null;\n  };\n}\n\n/**\n * Validator that requires the control's value to be less than or equal to the provided number.\n * See `Validators.max` for additional information.\n */\nexport function maxValidator(max: number): ValidatorFn {\n  return (control: AbstractControl): ValidationErrors | null => {\n    if (isEmptyInputValue(control.value) || isEmptyInputValue(max)) {\n      return null;  // don't validate empty values to allow optional controls\n    }\n    const value = parseFloat(control.value);\n    // Controls with NaN values after parsing should be treated as not having a\n    // maximum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-max\n    return !isNaN(value) && value > max ? {\n      'max': {\n        'max': max,\n        'actual': control.value,\n        msg: `the number must be less or equal than ${max}`\n      }\n    } : null;\n  };\n}\n\n/**\n * Validator that requires the control have a non-empty value.\n * See `Validators.required` for additional information.\n */\nexport function requiredValidator(control: AbstractControl): ValidationErrors | null {\n  return isEmptyInputValue(control.value) ? {'required': {msg: 'the field could not be empty'}} : null;\n}\n\n/**\n * Validator that requires the control's value be true. This validator is commonly\n * used for required checkboxes.\n * See `Validators.requiredTrue` for additional information.\n */\nexport function requiredTrueValidator(control: AbstractControl): ValidationErrors | null {\n  return control.value === true ? null : {'required': {msg: 'the field should be true'}};\n}\n\n/**\n * Validator that requires the control's value pass an email validation test.\n * See `Validators.email` for additional information.\n */\nexport function emailValidator(control: AbstractControl): ValidationErrors | null {\n  if (isEmptyInputValue(control.value)) {\n    return null;  // don't validate empty values to allow optional controls\n  }\n  return EMAIL_REGEXP.test(control.value) ? null : {'email': {msg: 'the field should be a valid email'}};\n}\n\n/**\n * Validator that requires the length of the control's value to be greater than or equal\n * to the provided minimum length. See `Validators.minLength` for additional information.\n */\nexport function minLengthValidator(minLength: number): ValidatorFn {\n  return (control: AbstractControl): ValidationErrors | null => {\n    if (isEmptyInputValue(control.value) || !hasValidLength(control.value)) {\n      // don't validate empty values to allow optional controls\n      // don't validate values without `length` property\n      return null;\n    }\n\n    return control.value.length < minLength ?\n      {\n        'minlength': {\n          'requiredLength': minLength,\n          'actualLength': control.value.length,\n          msg: `the length should be more than ${minLength} characters`\n        }\n      } :\n      null;\n  };\n}\n\n/**\n * Validator that requires the length of the control's value to be less than or equal\n * to the provided maximum length. See `Validators.maxLength` for additional information.\n */\nexport function maxLengthValidator(maxLength: number): ValidatorFn {\n  return (control: AbstractControl): ValidationErrors | null => {\n    return hasValidLength(control.value) && control.value.length > maxLength ?\n      {\n        'maxlength': {\n          'requiredLength': maxLength,\n          'actualLength': control.value.length,\n          msg: `the length should be less than ${length} characters`\n        }\n      } :\n      null;\n  };\n}\n\n/**\n * Validator that requires the control's value to match a regex pattern.\n * See `Validators.pattern` for additional information.\n */\nexport function patternValidator(pattern: string | RegExp, errorKey: string): ValidatorFn {\n  if (!pattern) return nullValidator;\n  let regex: RegExp;\n  let regexStr: string;\n  if (typeof pattern === 'string') {\n    regexStr = '';\n\n    if (pattern.charAt(0) !== '^') regexStr += '^';\n\n    regexStr += pattern;\n\n    if (pattern.charAt(pattern.length - 1) !== '$') regexStr += '$';\n\n    regex = new RegExp(regexStr);\n  } else {\n    regexStr = pattern.toString();\n    regex = pattern;\n  }\n  return (control: AbstractControl): ValidationErrors | null => {\n    if (isEmptyInputValue(control.value)) {\n      return null;  // don't validate empty values to allow optional controls\n    }\n    const value: string = control.value;\n    return regex.test(value) ? null :\n      {\n        [errorKey]: {\n          'requiredPattern': regexStr,\n          'actualValue': value,\n          msg: `the field should respect the pattern ${regexStr} `\n        }\n      };\n  };\n}\n\n/**\n * Function that has `ValidatorFn` shape, but performs no operation.\n */\nexport function nullValidator(control: AbstractControl): ValidationErrors | null {\n  return null;\n}\n\nfunction isPresent(o: any): boolean {\n  return o != null;\n}\n\nexport function toObservable(value: any): Observable<any> {\n  const obs = isPromise(value) ? from(value) : value;\n  // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n  // @ts-ignore\n  if ((typeof ngDevMode === 'undefined' || ngDevMode) && !(isSubscribable(obs))) {\n    let errorMessage = `Expected async validator to return Promise or Observable.`;\n    // A synchronous validator will return object or null.\n    if (typeof value === 'object') {\n      errorMessage +=\n        ' Are you using a synchronous validator where an async validator is expected?';\n    }\n    // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n    // @ts-ignore\n    throw new RuntimeError(RuntimeErrorCode.WRONG_VALIDATOR_RETURN_TYPE, errorMessage);\n  }\n  return obs;\n}\n\nfunction mergeErrors(arrayOfErrors: (ValidationErrors | null)[]): ValidationErrors | null {\n  let res: { [key: string]: any } = {};\n  arrayOfErrors.forEach((errors: ValidationErrors | null) => {\n    res = errors != null ? {...res!, ...errors} : res!;\n  });\n\n  return Object.keys(res).length === 0 ? null : res;\n}\n\ntype GenericValidatorFn = (control: AbstractControl) => any;\n\nfunction executeValidators<V extends GenericValidatorFn>(\n  control: AbstractControl, validators: V[]): ReturnType<V>[] {\n  return validators.map(validator => validator(control));\n}\n\nfunction isValidatorFn<V>(validator: V | Validator | AsyncValidator): validator is V {\n  return !(validator as Validator).validate;\n}\n\n/**\n * Given the list of validators that may contain both functions as well as classes, return the list\n * of validator functions (convert validator classes into validator functions). This is needed to\n * have consistent structure in validators list before composing them.\n *\n * @param validators The set of validators that may contain validators both in plain function form\n *     as well as represented as a validator class.\n */\nexport function normalizeValidators<V>(validators: (V | Validator | AsyncValidator)[]): V[] {\n  return validators.map(validator => {\n    return isValidatorFn<V>(validator) ?\n      validator :\n      ((c: AbstractControl) => validator.validate(c)) as unknown as V;\n  });\n}\n\n/**\n * Merges synchronous validators into a single validator function.\n * See `Validators.compose` for additional information.\n */\nfunction compose(validators: (ValidatorFn | null | undefined)[] | null): ValidatorFn | null {\n  if (!validators) return null;\n  const presentValidators: ValidatorFn[] = validators.filter(isPresent) as any;\n  if (presentValidators.length == 0) return null;\n\n  return function (control: AbstractControl) {\n    return mergeErrors(executeValidators<ValidatorFn>(control, presentValidators));\n  };\n}\n\n/**\n * Accepts a list of validators of different possible shapes (`Validator` and `ValidatorFn`),\n * normalizes the list (converts everything to `ValidatorFn`) and merges them into a single\n * validator function.\n */\nexport function composeValidators(validators: Array<Validator | ValidatorFn>): ValidatorFn | null {\n  return validators != null ? compose(normalizeValidators<ValidatorFn>(validators)) : null;\n}\n\n/**\n * Merges asynchronous validators into a single validator function.\n * See `Validators.composeAsync` for additional information.\n */\nfunction composeAsync(validators: (AsyncValidatorFn | null)[]): AsyncValidatorFn | null {\n  if (!validators) return null;\n  const presentValidators: AsyncValidatorFn[] = validators.filter(isPresent) as any;\n  if (presentValidators.length == 0) return null;\n\n  return function (control: AbstractControl) {\n    const observables =\n      executeValidators<AsyncValidatorFn>(control, presentValidators).map(toObservable);\n    return forkJoin(observables).pipe(map(mergeErrors));\n  };\n}\n\n/**\n * Accepts a list of async validators of different possible shapes (`AsyncValidator` and\n * `AsyncValidatorFn`), normalizes the list (converts everything to `AsyncValidatorFn`) and merges\n * them into a single validator function.\n */\nexport function composeAsyncValidators(validators: Array<AsyncValidator | AsyncValidatorFn>):\n  AsyncValidatorFn | null {\n  return validators != null ? composeAsync(normalizeValidators<AsyncValidatorFn>(validators)) :\n    null;\n}\n\n/**\n * Merges raw control validators with a given directive validator and returns the combined list of\n * validators as an array.\n */\nexport function mergeValidators<V>(controlValidators: V | V[] | null, dirValidator: V): V[] {\n  if (controlValidators === null) return [dirValidator];\n  return Array.isArray(controlValidators) ? [...controlValidators, dirValidator] :\n    [controlValidators, dirValidator];\n}\n\n/**\n * Retrieves the list of raw synchronous validators attached to a given control.\n */\nexport function getControlValidators(control: AbstractControl): ValidatorFn | ValidatorFn[] | null {\n  return (control as any)._rawValidators as ValidatorFn | ValidatorFn[] | null;\n}\n\n/**\n * Retrieves the list of raw asynchronous validators attached to a given control.\n */\nexport function getControlAsyncValidators(control: AbstractControl): AsyncValidatorFn |\n  AsyncValidatorFn[] | null {\n  return (control as any)._rawAsyncValidators as AsyncValidatorFn | AsyncValidatorFn[] | null;\n}\n\n/**\n * Accepts a singleton validator, an array, or null, and returns an array type with the provided\n * validators.\n *\n * @param validators A validator, validators, or null.\n * @returns A validators array.\n */\nexport function makeValidatorsArray<T extends ValidatorFn | AsyncValidatorFn>(validators: T | T[] |\n  null): T[] {\n  if (!validators) return [];\n  return Array.isArray(validators) ? validators : [validators];\n}\n\n/**\n * Determines whether a validator or validators array has a given validator.\n *\n * @param validators The validator or validators to compare against.\n * @param validator The validator to check.\n * @returns Whether the validator is present.\n */\nexport function hasValidator<T extends ValidatorFn | AsyncValidatorFn>(\n  validators: T | T[] | null, validator: T): boolean {\n  return Array.isArray(validators) ? validators.includes(validator) : validators === validator;\n}\n\n/**\n * Combines two arrays of validators into one. If duplicates are provided, only one will be added.\n *\n * @param validators The new validators.\n * @param currentValidators The base array of current validators.\n * @returns An array of validators.\n */\nexport function addValidators<T extends ValidatorFn | AsyncValidatorFn>(\n  validators: T | T[], currentValidators: T | T[] | null): T[] {\n  const current = makeValidatorsArray(currentValidators);\n  const validatorsToAdd = makeValidatorsArray(validators);\n  validatorsToAdd.forEach((v: T) => {\n    // Note: if there are duplicate entries in the new validators array,\n    // only the first one would be added to the current list of validators.\n    // Duplicate ones would be ignored since `hasValidator` would detect\n    // the presence of a validator function and we update the current list in place.\n    if (!hasValidator(current, v)) {\n      current.push(v);\n    }\n  });\n  return current;\n}\n\nexport function removeValidators<T extends ValidatorFn | AsyncValidatorFn>(\n  validators: T | T[], currentValidators: T | T[] | null): T[] {\n  return makeValidatorsArray(currentValidators).filter(v => !hasValidator(validators, v));\n}\n","/* eslint-disable @angular-eslint/no-host-metadata-property */\n/* eslint-disable  no-underscore-dangle */\n/**\n * GAUTHIER PEEL : copied form version 9.1.1\n * needed for ngModel fans (if you still find some!)\n *\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, forwardRef, Input, OnChanges, SimpleChanges, StaticProvider} from '@angular/core';\nimport {AbstractControl, NG_VALIDATORS, ValidationErrors, Validator, ValidatorFn} from '@angular/forms';\nimport {MyValidators} from './my-validators';\n\nexport const REQUIRED_VALIDATOR: StaticProvider = {\n  provide: NG_VALIDATORS,\n  useExisting: forwardRef(() => MyRequiredValidator),\n  multi: true\n};\nexport const CHECKBOX_REQUIRED_VALIDATOR: StaticProvider = {\n  provide: NG_VALIDATORS,\n  useExisting: forwardRef(() => MyCheckboxRequiredValidator),\n  multi: true\n};\n\n@Directive({\n  selector:\n    ':not([type=checkbox])[myRequired][formControlName],' +\n    ':not([type=checkbox])[myRequired][formControl],' +\n    ':not([type=checkbox])[myRequired][ngModel]',\n  providers: [REQUIRED_VALIDATOR],\n  host: {'[attr.required]': 'myRequired ? \"\" : null'}\n})\nexport class MyRequiredValidator implements Validator {\n  // TODO(issue/24571): remove '!'.\n  private _onChange!: () => void;\n\n  // TODO(issue/24571): remove '!'.\n  private _myRequired!: boolean;\n\n  /**\n   * @description\n   * Tracks changes to the required attribute bound to this directive.\n   */\n  @Input()\n  get myRequired(): boolean | string {\n\n    return this._myRequired;\n  }\n\n  set myRequired(value: boolean | string) {\n    this._myRequired = value != null && value !== false && `${value}` !== 'false';\n    if (this._onChange) {\n      this._onChange();\n    }\n  }\n\n  /**\n   * @description\n   * Method that validates whether the control is empty.\n   * Returns the validation result if enabled, otherwise null.\n   */\n  validate(control: AbstractControl): ValidationErrors | null {\n    return this.myRequired ? MyValidators.required(control) : null;\n  }\n\n  /**\n   * @description\n   * Registers a callback function to call when the validator inputs change.\n   *\n   * @param fn The callback function\n   */\n  registerOnValidatorChange(fn: () => void): void {\n    this._onChange = fn;\n  }\n}\n\n@Directive({\n  selector:\n    'input[type=checkbox][myRequired][formControlName],' +\n    'input[type=checkbox][myRequired][formControl],' +\n    'input[type=checkbox][myRequired][ngModel]',\n  providers: [CHECKBOX_REQUIRED_VALIDATOR],\n  host: {'[attr.required]': 'myRequired ? \"\" : null'}\n})\n// eslint-disable-next-line @angular-eslint/directive-class-suffix\nexport class MyCheckboxRequiredValidator extends MyRequiredValidator {\n  /**\n   * @description\n   * Method that validates whether or not the checkbox has been checked.\n   * Returns the validation result if enabled, otherwise null.\n   */\n  // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n  // @ts-ignore\n  validate(control: AbstractControl): ValidationErrors | null {\n    return this.myRequired ? MyValidators.requiredTrue(control) : null;\n  }\n}\n\nexport const EMAIL_VALIDATOR: any = {\n  provide: NG_VALIDATORS,\n  useExisting: forwardRef(() => MyEmailValidator),\n  multi: true\n};\n\n@Directive({\n  selector: '[myEmail][formControlName],[myEmail][formControl],[myEmail][ngModel]',\n  providers: [EMAIL_VALIDATOR]\n})\nexport class MyEmailValidator implements Validator {\n  // TODO(issue/24571): remove '!'.\n  private _enabled!: boolean;\n  // TODO(issue/24571): remove '!'.\n  private _onChange!: () => void;\n\n  /**\n   * @description\n   * Tracks changes to the email attribute bound to this directive.\n   */\n  @Input()\n  set myEmail(value: boolean | string) {\n    this._enabled = value === '' || value === true || value === 'true';\n    if (this._onChange) {\n      this._onChange();\n    }\n  }\n\n  /**\n   * @description\n   * Method that validates whether an email address is valid.\n   * Returns the validation result if enabled, otherwise null.\n   */\n  validate(control: AbstractControl): ValidationErrors | null {\n    return this._enabled ? MyValidators.email(control) : null;\n  }\n\n  /**\n   * @description\n   * Registers a callback function to call when the validator inputs change.\n   *\n   * @param fn The callback function\n   */\n  registerOnValidatorChange(fn: () => void): void {\n    this._onChange = fn;\n  }\n}\n\nexport const MIN_LENGTH_VALIDATOR: any = {\n  provide: NG_VALIDATORS,\n  useExisting: forwardRef(() => MyMinLengthValidator),\n  multi: true\n};\n\n@Directive({\n  selector: '[myMinlength][formControlName],[myMinlength][formControl],[myMinlength][ngModel]',\n  providers: [MIN_LENGTH_VALIDATOR],\n  host: {'[attr.minlength]': 'myMinlength ? myMinlength : null'}\n})\nexport class MyMinLengthValidator implements Validator, OnChanges {\n  /**\n   * @description\n   * Tracks changes to the the minimum length bound to this directive.\n   */\n    // TODO(issue/24571): remove '!'.\n  @Input() myMinlength!: string | number;\n  // TODO(issue/24571): remove '!'.\n  private _validator!: ValidatorFn;\n  // TODO(issue/24571): remove '!'.\n  private _onChange!: () => void;\n\n  /**\n   * @description\n   * A lifecycle method called when the directive's inputs change. For internal use\n   * only.\n   *\n   * @param changes A object of key/value pairs for the set of changed inputs.\n   */\n  ngOnChanges(changes: SimpleChanges): void {\n    if ('myMinlength' in changes) {\n      this._createValidator();\n      if (this._onChange) {\n        this._onChange();\n      }\n    }\n  }\n\n  /**\n   * @description\n   * Method that validates whether the value meets a minimum length\n   * requirement. Returns the validation result if enabled, otherwise null.\n   */\n  validate(control: AbstractControl): ValidationErrors | null {\n    return this.myMinlength == null ? null : this._validator(control);\n  }\n\n  /**\n   * @description\n   * Registers a callback function to call when the validator inputs change.\n   *\n   * @param fn The callback function\n   */\n  registerOnValidatorChange(fn: () => void): void {\n    this._onChange = fn;\n  }\n\n  private _createValidator(): void {\n    this._validator = MyValidators.minLength(\n      typeof this.myMinlength === 'number' ? this.myMinlength : parseInt(this.myMinlength, 10));\n  }\n}\n\nexport const MAX_LENGTH_VALIDATOR: any = {\n  provide: NG_VALIDATORS,\n  useExisting: forwardRef(() => MyMaxLengthValidator),\n  multi: true\n};\n\n@Directive({\n  selector: '[myMaxlength][formControlName],[myMaxlength][formControl],[myMaxlength][ngModel]',\n  providers: [MAX_LENGTH_VALIDATOR],\n  host: {'[attr.maxlength]': 'myMaxlength ? myMaxlength : null'}\n})\nexport class MyMaxLengthValidator implements Validator, OnChanges {\n  /**\n   * @description\n   * Tracks changes to the the maximum length bound to this directive.\n   */\n    // TODO(issue/24571): remove '!'.\n  @Input() myMaxlength!: string | number;\n  // TODO(issue/24571): remove '!'.\n  private _validator!: ValidatorFn;\n  // TODO(issue/24571): remove '!'.\n  private _onChange!: () => void;\n\n  /**\n   * @description\n   * A lifecycle method called when the directive's inputs change. For internal use\n   * only.\n   *\n   * @param changes A object of key/value pairs for the set of changed inputs.\n   */\n  ngOnChanges(changes: SimpleChanges): void {\n    if ('maxlength' in changes) {\n      this._createValidator();\n      if (this._onChange) {\n        this._onChange();\n      }\n    }\n  }\n\n  /**\n   * @description\n   * Method that validates whether the value exceeds\n   * the maximum length requirement.\n   */\n  validate(control: AbstractControl): ValidationErrors | null {\n    return this.myMaxlength != null ? this._validator(control) : null;\n  }\n\n  /**\n   * @description\n   * Registers a callback function to call when the validator inputs change.\n   *\n   * @param fn The callback function\n   */\n  registerOnValidatorChange(fn: () => void): void {\n    this._onChange = fn;\n  }\n\n  private _createValidator(): void {\n    this._validator = MyValidators.maxLength(\n      typeof this.myMaxlength === 'number' ? this.myMaxlength : parseInt(this.myMaxlength, 10));\n  }\n}\n\nexport const PATTERN_VALIDATOR: any = {\n  provide: NG_VALIDATORS,\n  useExisting: forwardRef(() => MyPatternValidator),\n  multi: true\n};\n\n@Directive({\n  selector: '[myPattern][formControlName],[myPattern][formControl],[myPattern][ngModel]',\n  providers: [PATTERN_VALIDATOR],\n  host: {'[attr.pattern]': 'myPattern ? myPattern : null'}\n})\nexport class MyPatternValidator implements Validator, OnChanges {\n  /**\n   * @description\n   * Tracks changes to the pattern bound to this directive.\n   */\n    // TODO(issue/24571): remove '!'.\n  @Input() myPattern!: string | RegExp;\n  // TODO(issue/24571): remove '!'.\n  private _validator!: ValidatorFn;\n  // TODO(issue/24571): remove '!'.\n  private _onChange!: () => void;\n\n  /**\n   * @description\n   * A lifecycle method called when the directive's inputs change. For internal use\n   * only.\n   *\n   * @param changes A object of key/value pairs for the set of changed inputs.\n   */\n  ngOnChanges(changes: SimpleChanges): void {\n    if ('myPattern' in changes) {\n      this._createValidator();\n      if (this._onChange) {\n        this._onChange();\n      }\n    }\n  }\n\n  /**\n   * @description\n   * Method that validates whether the value matches the\n   * the pattern requirement.\n   */\n  validate(control: AbstractControl): ValidationErrors | null {\n    return this._validator(control);\n  }\n\n  /**\n   * @description\n   * Registers a callback function to call when the validator inputs change.\n   *\n   * @param fn The callback function\n   */\n  registerOnValidatorChange(fn: () => void): void {\n    this._onChange = fn;\n  }\n\n  private _createValidator(): void {\n    this._validator = MyValidators.pattern(this.myPattern);\n  }\n}\n","import {InjectionToken} from '@angular/core';\nimport {AbstractControl, ValidationErrors, ValidatorFn} from '@angular/forms';\nimport {MyMessagesServiceInterface} from '../messages/messages-service-api';\n\nexport interface MyValidatorsServiceInterface {\n\n  min(min: number): ValidatorFn;\n  max(min: number): ValidatorFn;\n  required(control: AbstractControl): ValidationErrors | null;\n  requiredTrue(control: AbstractControl): ValidationErrors | null;\n  email(control: AbstractControl): ValidationErrors | null;\n  minLength(minLength: number): ValidatorFn;\n  maxLength(minLength: number): ValidatorFn;\n  pattern(pattern: string | RegExp): ValidatorFn;\n  nullValidator(control: AbstractControl): ValidationErrors | null;\n}\n\nexport const MY_VALIDATORS_SERVICE_API = new InjectionToken<MyMessagesServiceInterface>('MyValidatorsService');\n","import {Inject, Injectable, Optional} from '@angular/core';\nimport {AbstractControl, ValidationErrors, ValidatorFn, Validators} from '@angular/forms';\nimport {MY_MESSAGES_SERVICE_API, MyMessagesServiceInterface} from '../messages/messages-service-api';\nimport {MyValidatorsServiceInterface} from './validators-service-api';\n\n/**\n * This DefaultValidatorsService could be used to code a full custom  MyValidatorsServiceInterface.\n * BUT you could  code a custom Service for MyI18nMessagesServiceInterface,\n * and  override all your string Messages for all validators.\n * In that case you have to provide it like:\n * <pre>\n *     {\n *     provide: MY_I18N_MESSAGES_SERVICE_API,\n *     useFactory: myI18nMessageServiceFactory,\n *     deps: [CUSTOMI18nMessagesService]\n *   }\n *\n *   export function myI18nMessageServiceFactory(messageService: MyI18nMessagesServiceInterface) {\n *      return messageService;\n *   }\n * <pre>\n *\n *   This king of provide enables the DefaultValidatorsService to use YOUR CUSTOM MyI18nMessagesServiceInterface\n *   instead of the DefaultI18nMessagesService.\n *\n * NOTE : all the methods should be either \"binded\" to this (method.bind(this), or arrow function (solution I chosed)\n * to keep the 'this' being the instance of DefaultValidatorsService.\n */\n@Injectable()\nexport class DefaultValidatorsService implements MyValidatorsServiceInterface {\n\n  constructor(@Optional() @Inject(MY_MESSAGES_SERVICE_API) private myMessagesService: MyMessagesServiceInterface) {\n  }\n\n  email = (control: AbstractControl): ValidationErrors | null => {\n    const va = Validators.email(control);\n    if (va) {\n      // if the Token MY_MESSAGES_SERVICE_API is not provided, I fallback to hard-coded messages in English\n      let i18nMsg = 'the field should be a valid email';\n      if (this.myMessagesService) {\n        i18nMsg = this.myMessagesService.getValidationMessageFor('email', va['email']);\n      }\n      return {email: {msg: i18nMsg}};\n    } else {\n      return null;\n    }\n  };\n\n  max = (max: number): ValidatorFn => {\n    const maxClosure = Validators.max(max);\n    const f = (control: AbstractControl): ValidationErrors | null => {\n      const va = maxClosure(control);\n      if (va) {\n        let i18nMsg = `the number must be more or equal than ${va['max']}`;\n        if (this.myMessagesService) {\n          i18nMsg = this.myMessagesService.getValidationMessageFor('max', va['max']);\n        }\n        return {max: {...va['max'], msg: i18nMsg}};\n      } else {\n        return null;\n      }\n    };\n    return f;\n  };\n\n  min = (min: number): ValidatorFn => {\n    const minClosure = Validators.min(min);\n    const f = (control: AbstractControl): ValidationErrors | null => {\n      const va = minClosure(control);\n      if (va) {\n        let i18nMsg = `the number must be less or equal than ${va['min']}`;\n        if (this.myMessagesService) {\n          i18nMsg = this.myMessagesService.getValidationMessageFor('min', va['main']);\n        }\n        return {min: {...va['min'], msg: i18nMsg}};\n      } else {\n        return null;\n      }\n    };\n    return f;\n  };\n\n  maxLength = (maxLength: number): ValidatorFn => {\n    const maxClosure = Validators.maxLength(maxLength);\n    const f = (control: AbstractControl): ValidationErrors | null => {\n      const va = maxClosure(control);\n      if (va) {\n        let i18nMsg = `the length should be less than ${va['requiredLength']} characters`;\n        if (this.myMessagesService) {\n          i18nMsg = this.myMessagesService.getValidationMessageFor('maxlength', va['maxlength']);\n        }\n        return {maxlength: {...va['maxlength'], msg: i18nMsg}};\n      } else {\n        return null;\n      }\n    };\n    return f;\n  };\n\n  minLength = (minLength: number): ValidatorFn => {\n    const minClosure = Validators.minLength(minLength);\n    const f = (control: AbstractControl): ValidationErrors | null => {\n      const va = minClosure(control);\n      if (va) {\n        let i18nMsg = `the length should be more than ${va['requiredLength']} characters`;\n        if (this.myMessagesService) {\n          i18nMsg = this.myMessagesService.getValidationMessageFor('minlength', va['minlength']);\n        }\n        return {minlength: {...va['minlength'], msg: i18nMsg}};\n      } else {\n        return null;\n      }\n    };\n    return f;\n  };\n\n  nullValidator(control: AbstractControl): ValidationErrors | null {\n    return null;\n  }\n\n  pattern = (pattern: string | RegExp): ValidatorFn => {\n    const pattClosure = Validators.pattern(pattern);\n\n    let regexStr: string;\n    if (typeof pattern === 'string') {\n      regexStr = '';\n\n      if (pattern.charAt(0) !== '^') {\n        regexStr += '^';\n      }\n      regexStr += pattern;\n\n      if (pattern.charAt(pattern.length - 1) !== '$') {\n        regexStr += '$';\n      }\n\n    } else {\n      regexStr = pattern.toString();\n    }\n\n    const f = (control: AbstractControl): ValidationErrors | null => {\n      const va = pattClosure(control);\n      if (va) {\n        let i18nMsg = `the field should respect the pattern ${va['requiredPattern']}`;\n        if (this.myMessagesService) {\n          i18nMsg = this.myMessagesService.getValidationMessageFor('pattern', va['pattern']);\n        }\n        return {pattern: {...va['pattern'], msg: i18nMsg}};\n      } else {\n        return null;\n      }\n    };\n    return f;\n  };\n\n  required = (control: AbstractControl): ValidationErrors | null => {\n    const va = Validators.required(control);\n    if (va) {\n      let i18nMsg = 'the field is required';\n      if (this.myMessagesService) {\n        i18nMsg = this.myMessagesService.getValidationMessageFor('required', va['required']);\n      }\n      return {required: {msg: i18nMsg}};\n    } else {\n      return null;\n    }\n  };\n\n  requiredTrue = (control: AbstractControl): ValidationErrors | null => {\n    const va = Validators.requiredTrue(control);\n    if (va) {\n      let i18nMsg = 'the field should be true';\n      if (this.myMessagesService) {\n        i18nMsg = this.myMessagesService.getValidationMessageFor('requiredTrue', va['required']);\n      }\n      return {required: {msg: i18nMsg}};\n    } else {\n      return null;\n    }\n  };\n\n}\n","import {Injectable} from '@angular/core';\n// noinspection ES6PreferShortImport\nimport {ErrorMsgMap} from '../../error-messages/error-msg-api';\nimport {MyMessagesServiceInterface} from './messages-service-api';\n\n\nexport const I18N_MESSAGES: ErrorMsgMap = {\n\n  // messages for the submit button\n  pristineForm: 'Your form is pristine! No action executed',\n  invalidForm: 'You must correct your form before saving it',\n\n  // validators\n  email: 'the field should be a valid email',\n  required: 'the field is required',\n  requiredTrue: 'the field should be true', // real key is also 'required'\n  max: (errorsValue: any) => `the number must be more or equal than ${errorsValue.max}`,\n  min: (errorsValue: any) => `the number must be less or equal than ${errorsValue.min}`,\n  maxlength: (errorsValue: any) => `the length should be less than ${errorsValue.requiredLength} characters`,\n  minlength: (errorsValue: any) => `the length should be more than ${errorsValue.requiredLength} characters`,\n  pattern: (errorsValue: any) => `the field should respect the pattern ${errorsValue.requiredPattern}`,\n\n};\n\n@Injectable()\nexport class DefaultMessagesService implements MyMessagesServiceInterface {\n\n  getValidationMessageFor(key: string, errors: ErrorMsgMap | null = null): string {\n    const m = I18N_MESSAGES[key];\n    if (typeof m === 'string') {\n      return m; // typeof undefined is string 'undefined' that will appear in the case the key is not found.\n    } else if (typeof m === 'function') {\n      return m(errors);\n    } else {\n      return `key \\'${key}\\' undefined in your MyMessageService implementation`;\n    }\n  }\n\n}\n","import {Injectable} from '@angular/core';\nimport {MyAlertServiceInterface} from './alert-api';\n\n@Injectable()\nexport class DefaultAlertService implements MyAlertServiceInterface {\n  public warn(msg: any): void {\n    // console.log('WARNNNNNNNNNNNNNNNNNNNNNNNNNNNNN', msg);\n  }\n}\n","import {CommonModule} from '@angular/common';\r\nimport {ModuleWithProviders, NgModule} from '@angular/core';\r\nimport {DebugFormComponent} from './debug-form/debug-form.component';\r\nimport {DebugInputFieldComponent} from './debug-form/debug-input-field.component';\r\nimport {MyControlOptionsDirective} from './error-messages/my-control-options.directive';\r\nimport {MyErrorMessageComponent} from './error-messages/my-error-message.component';\r\nimport {MyErrorDirective} from './error-messages/my-error.directive';\r\nimport {MY_ALERT_SERVICE_API} from './pluggable-api/alert/alert-api';\r\nimport {DefaultAlertService} from './pluggable-api/alert/default-alert.service';\r\nimport {DefaultMessagesService} from './pluggable-api/messages/default-messages.service';\r\nimport {\r\n  DEFAULT_SHOW_ERROR_MSG_FUNCTION,\r\n  MY_MESSAGES_SERVICE_API,\r\n  MY_SHOW_ERROR_MSG_FUNCTION_API,\r\n  ShowFunction\r\n} from './pluggable-api/messages/messages-service-api';\r\nimport {DefaultValidatorsService} from './pluggable-api/validators/default-validators.service';\r\nimport {MY_VALIDATORS_SERVICE_API} from './pluggable-api/validators/validators-service-api';\r\nimport {MySubmitIfValidAndDirtyDirective} from './submit-button/my-submit-if-valid-and-dirty.directive';\r\nimport {MySubmitIfValidDirective} from './submit-button/my-submit-if-valid.directive';\r\nimport {\r\n  MyCheckboxRequiredValidator,\r\n  MyEmailValidator,\r\n  MyMaxLengthValidator,\r\n  MyMinLengthValidator,\r\n  MyPatternValidator,\r\n  MyRequiredValidator\r\n} from './validators/solution-1-simplest/my-validators-directive';\r\n\r\n@NgModule({\r\n  imports: [\r\n    CommonModule,\r\n  ],\r\n  declarations: [\r\n    DebugFormComponent,\r\n    DebugInputFieldComponent,\r\n    MyErrorMessageComponent,\r\n    MyErrorDirective,\r\n    MyControlOptionsDirective,\r\n    MySubmitIfValidAndDirtyDirective,\r\n    MySubmitIfValidDirective,\r\n    // extended Validators originaly from Angular, now with an embedded 'msg' property\r\n    MyRequiredValidator,\r\n    MyEmailValidator,\r\n    MyMinLengthValidator,\r\n    MyMaxLengthValidator,\r\n    MyPatternValidator,\r\n    MyCheckboxRequiredValidator,\r\n  ],\r\n  exports: [\r\n    DebugFormComponent,\r\n    DebugInputFieldComponent,\r\n    MyErrorMessageComponent,\r\n    MyErrorDirective,\r\n    MyControlOptionsDirective,\r\n    MySubmitIfValidAndDirtyDirective,\r\n    MySubmitIfValidDirective,\r\n    MyRequiredValidator,\r\n    MyEmailValidator,\r\n    MyMinLengthValidator,\r\n    MyMaxLengthValidator,\r\n    MyPatternValidator,\r\n    MyCheckboxRequiredValidator,\r\n  ],\r\n  // entryComponents: [MyErrorMessageComponent],\r\n  providers: [\r\n    DefaultAlertService,\r\n    DefaultValidatorsService,\r\n    DefaultMessagesService,\r\n    {\r\n      provide: MY_ALERT_SERVICE_API,\r\n      useClass: DefaultAlertService\r\n    },\r\n    {\r\n      provide: MY_MESSAGES_SERVICE_API,\r\n      useClass: DefaultMessagesService\r\n    },\r\n    {\r\n      provide: MY_VALIDATORS_SERVICE_API,\r\n      useClass: DefaultValidatorsService\r\n    },\r\n    {\r\n      provide: MY_SHOW_ERROR_MSG_FUNCTION_API,\r\n      useValue: DEFAULT_SHOW_ERROR_MSG_FUNCTION\r\n    }\r\n  ]\r\n})\r\nexport class MyValidatorsModule {\r\n  static forRoot(showFunction: ShowFunction): ModuleWithProviders<MyValidatorsModule> {\r\n    return {\r\n      ngModule: MyValidatorsModule,\r\n      providers: [\r\n        {\r\n          provide: MY_SHOW_ERROR_MSG_FUNCTION_API,\r\n          useValue: showFunction\r\n        }\r\n      ]\r\n    };\r\n\r\n  }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1","isPromise","isSubscribable","RuntimeError"],"mappings":";;;;;;;;;;AAGA;;;;;;;;;;;;AAYG;MAeU,kBAAkB,CAAA;8GAAlB,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;AAAlB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,kBAAkB,EAZnB,QAAA,EAAA,YAAA,EAAA,MAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA;;;;;;;;;;AAUT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,EAAA,CAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAEU,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAd9B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,YAAY;AACtB,oBAAA,QAAQ,EAAE,CAAA;;;;;;;;;;AAUT,EAAA,CAAA;AACF,iBAAA,CAAA;8BAGU,IAAI,EAAA,CAAA;sBAAZ,KAAK;;;AC5BR;;;;;;;;;;;;;AAaG;AACH;AAkBA;MACa,wBAAwB,CAAA;AAMnC;;;AAGG;AACH,IAAA,IAAI,OAAO,GAAA;AACT,QAAA,IAAI,CAAC,IAAI,CAAC,Q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