<form [formGroup]="formGroup" [bitSubmit]="submit">
  <bit-dialog [title]="'recoverAccount' | i18n" [subtitle]="data.name">
    <ng-container bitDialogContent>
      <bit-callout type="warning"
        >{{ "resetPasswordLoggedOutWarning" | i18n: loggedOutWarningName }}
      </bit-callout>
      <auth-password-callout
        [policy]="enforcedPolicyOptions"
        message="resetPasswordMasterPasswordPolicyInEffect"
        *ngIf="enforcedPolicyOptions"
      >
      </auth-password-callout>
      <bit-form-field>
        <bit-label>
          {{ "newPassword" | i18n }}
        </bit-label>
        <input
          id="newPassword"
          bitInput
          [type]="showPassword ? 'text' : 'password'"
          name="NewPassword"
          formControlName="newPassword"
          required
          appInputVerbatim
          autocomplete="new-password"
        />
        <button
          type="button"
          bitIconButton="bwi-generate"
          bitSuffix
          [appA11yTitle]="'generatePassword' | i18n"
          (click)="generatePassword()"
        ></button>
        <button
          type="button"
          bitSuffix
          [bitIconButton]="showPassword ? 'bwi-eye-slash' : 'bwi-eye'"
          buttonType="secondary"
          appA11yTitle="{{ 'toggleVisibility' | i18n }}"
          (click)="togglePassword()"
        ></button>
        <button
          type="button"
          bitSuffix
          bitIconButton="bwi-clone"
          appA11yTitle="{{ 'copyPassword' | i18n }}"
          (click)="copy()"
        ></button>
      </bit-form-field>
      <tools-password-strength
        [password]="formGroup.value.newPassword"
        [email]="data.email"
        [showText]="true"
        (passwordStrengthScore)="getStrengthScore($event)"
      >
      </tools-password-strength>
    </ng-container>
    <ng-container bitDialogFooter>
      <button bitButton buttonType="primary" bitFormButton type="submit">
        {{ "save" | i18n }}
      </button>
      <button bitButton buttonType="secondary" bitDialogClose type="button">
        {{ "cancel" | i18n }}
      </button>
    </ng-container>
  </bit-dialog>
</form>
