import { Injectable, signal } from '@angular/core';
import { CurrentAccountService } from '../current-account.service';

/**
 * Framework-default implementation of the `CurrentAccountService` port for scaffolds that
 * have no IAM bounded context (e.g. none-mode install, clean scaffold before `catalyst install iam`).
 *
 * Provided in the published scaffold's `aurora.provider.ts` by the packager step in
 * `scripts/packager/frontend/application.mjs` so the authenticated initializer resolves
 * and the shell boots with a neutral anonymous identity. The catalyst SOURCE `aurora.provider.ts`
 * does NOT register this provider — the two placements never coexist.
 *
 * The port contract (`displayName`, `email`, `load()`) is satisfied with blank signals and a
 * no-op `load()`. The sidebar renders a neutral placeholder rather than a fabricated identity.
 * This mirrors the backend `AnonymousAccountLoaderAdapter` pattern.
 *
 * HR-PORTS-001 compliance: imports only `@angular/core` and the port; zero `@app`/`@api`/
 * bounded-context coupling.
 */
@Injectable()
export class AnonymousCurrentAccountAdapter extends CurrentAccountService {
  readonly displayName = signal('');
  readonly email = signal('');

  load(): void {
    // No-op: no IAM bounded context is available, so no account can be loaded.
    // The signals stay blank (anonymous identity) throughout the session.
  }
}
