import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { AdminRoutingModule } from './admin-routing.module';
import { SharedModule } from '@shared/shared.module';
import { AuditScreenComponent } from './screens/audit/audit-screen.component';
import { DefaultColorsScreenComponent } from './screens/default-colors/default-colors-screen.component';
import { EntitiesListingScreenComponent } from './screens/entities-listing/entities-listing-screen.component';
import { DigitalSignatureScreenComponent } from './screens/digital-signature/digital-signature-screen.component';
import { UserListingScreenComponent } from './screens/user-listing/user-listing-screen.component';
import { DossierTemplateBreadcrumbsComponent } from './shared/components/dossier-template-breadcrumbs/dossier-template-breadcrumbs.component';
import { AddEditCloneDossierTemplateDialogComponent } from './dialogs/add-edit-dossier-template-dialog/add-edit-clone-dossier-template-dialog.component';
import { AddEntityDialogComponent } from './dialogs/add-entity-dialog/add-entity-dialog.component';
import { EditColorDialogComponent } from './dialogs/edit-color-dialog/edit-color-dialog.component';
import { AdminDialogService } from './services/admin-dialog.service';
import { GeneralConfigScreenComponent } from './screens/general-config/general-config-screen.component';
import { SmtpAuthDialogComponent } from './dialogs/smtp-auth-dialog/smtp-auth-dialog.component';
import { AddEditUserDialogComponent } from './dialogs/add-edit-user-dialog/add-edit-user-dialog.component';
import { UsersStatsComponent } from './components/users-stats/users-stats.component';
import { ResetPasswordComponent } from './dialogs/add-edit-user-dialog/reset-password/reset-password.component';
import { UserDetailsComponent } from './dialogs/add-edit-user-dialog/user-details/user-details.component';
import { AuditService } from './services/audit.service';
import { DigitalSignatureService } from './services/digital-signature.service';
import { BaseAdminScreenComponent } from './base-admin-screen/base-admin-screen.component';
import { RulesService } from './services/rules.service';
import { SmtpConfigService } from './services/smtp-config.service';
import { UploadDictionaryDialogComponent } from './dialogs/upload-dictionary-dialog/upload-dictionary-dialog.component';
import { GeneralConfigFormComponent } from './screens/general-config/general-config-form/general-config-form.component';
import { SmtpFormComponent } from './screens/general-config/smtp-form/smtp-form.component';
import { BaseDossierTemplateScreenComponent } from './base-dossier-templates-screen/base-dossier-template-screen.component';
import { A11yModule } from '@angular/cdk/a11y';
import { BaseEntityScreenComponent } from './base-entity-screen/base-entity-screen.component';
import { AdminSideNavComponent } from './shared/components/admin-side-nav/admin-side-nav.component';
import { SystemPreferencesFormComponent } from './screens/general-config/system-preferences-form/system-preferences-form.component';
import { ConfigureCertificateDialogComponent } from './dialogs/configure-digital-signature-dialog/configure-certificate-dialog.component';
import { PkcsSignatureConfigurationComponent } from './dialogs/configure-digital-signature-dialog/form/pkcs-signature-configuration/pkcs-signature-configuration.component';
import { KmsSignatureConfigurationComponent } from './dialogs/configure-digital-signature-dialog/form/kms-signature-configuration/kms-signature-configuration.component';
import {
    ChevronButtonComponent,
    CircleButtonComponent,
    DetailsRadioComponent,
    EditableInputComponent,
    EmptyStateComponent,
    HasScrollbarDirective,
    HumanizePipe,
    IconButtonComponent,
    InputWithActionComponent,
    IqserAllowDirective,
    IqserDenyDirective,
    IqserHelpModeModule,
    IqserListingModule,
    IqserUploadFileModule,
    RoundCheckboxComponent,
} from '@iqser/common-ui';
import { TranslateModule } from '@ngx-translate/core';
import { AuditInfoDialogComponent } from './dialogs/audit-info-dialog/audit-info-dialog.component';
import { DossierTemplateActionsComponent } from './shared/components/dossier-template-actions/dossier-template-actions.component';
import { IqserUsersModule } from '@iqser/common-ui/lib/users';
import { TenantPipe } from '@iqser/common-ui/lib/tenants';
import { SelectComponent } from '@shared/components/select/select.component';

const dialogs = [
    AddEditCloneDossierTemplateDialogComponent,
    AddEntityDialogComponent,
    EditColorDialogComponent,
    SmtpAuthDialogComponent,
    AddEditUserDialogComponent,
    UploadDictionaryDialogComponent,
    ConfigureCertificateDialogComponent,
    AuditInfoDialogComponent,
];

const screens = [
    AuditScreenComponent,
    DefaultColorsScreenComponent,
    EntitiesListingScreenComponent,
    DigitalSignatureScreenComponent,
    UserListingScreenComponent,
    GeneralConfigScreenComponent,
];

const components = [
    UsersStatsComponent,
    ResetPasswordComponent,
    UserDetailsComponent,
    BaseAdminScreenComponent,
    BaseDossierTemplateScreenComponent,
    BaseEntityScreenComponent,
    GeneralConfigFormComponent,
    SmtpFormComponent,
    SystemPreferencesFormComponent,
    PkcsSignatureConfigurationComponent,
    KmsSignatureConfigurationComponent,

    ...dialogs,
    ...screens,
];

@NgModule({
    declarations: [...components],
    providers: [AdminDialogService, AuditService, DigitalSignatureService, RulesService, SmtpConfigService],
    imports: [
        CommonModule,
        SharedModule,
        AdminRoutingModule,
        A11yModule,
        IqserUsersModule,
        TranslateModule,
        HumanizePipe,
        IqserListingModule,
        IqserUploadFileModule,
        IqserHelpModeModule,
        AdminSideNavComponent,
        DossierTemplateActionsComponent,
        DossierTemplateBreadcrumbsComponent,
        IconButtonComponent,
        CircleButtonComponent,
        ChevronButtonComponent,
        EmptyStateComponent,
        HasScrollbarDirective,
        RoundCheckboxComponent,
        InputWithActionComponent,
        EditableInputComponent,
        DetailsRadioComponent,
        IqserAllowDirective,
        IqserDenyDirective,
        TenantPipe,
        SelectComponent,
    ],
})
export class AdminModule {}
