import { Component, inject, input, output } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { FormFieldComponent } from '@shared/ui/form-field/form-field.component';
import { TextInputComponent } from '@shared/ui/text-input/text-input.component';
import { RadioGroupComponent } from '@shared/ui/radio-group/radio-group.component';
import { AlertComponent } from '@shared/ui/alert/alert.component';
import { SkeletonComponent } from '@shared/ui/skeleton/skeleton.component';
import { AddressFieldsComponent } from '@registratie/ui/address-fields/address-fields.component';
import { RegistratieLookupStore } from '@registratie/application/registratie-lookup.store';
import { Draft, DraftField, Errors } from '@registratie/domain/registratie-wizard.machine';
const KANALEN = [
{ value: 'email', label: $localize`:@@registratie.kanaalEmail:E-mail` },
{ value: 'post', label: $localize`:@@registratie.kanaalPost:Post` },
];
/** Step: the registratie wizard's first screen (adres + correspondentievoorkeur).
Injects RegistratieLookupStore directly for the BRP lookup banner — the
sanctioned exception (it is `providedIn: 'root'`, so every injection is the
same instance): the step owns its own async presentation rather than making
the parent a pass-through for it. Values otherwise in via `draft`/`errors`,
every change out via `fieldChange`/`kanaalChange`. No internal state; the
parent owns the Model and decides what a change means. */
@Component({
selector: 'app-reg-adres-step',
imports: [
FormsModule,
FormFieldComponent,
TextInputComponent,
RadioGroupComponent,
AlertComponent,
SkeletonComponent,
AddressFieldsComponent,
],
template: `
@if (adresStatus() === 'laden') {