<?php
declare(strict_types=1);

namespace App\Support;

final class PublicPageType
{
    public const ALL = [
        'home', 'question', 'ask', 'topics', 'topic', 'category', 'tag',
        'search', 'profile', 'contact', 'auth', 'account', 'notifications',
    ];

    /** @return list<string> */
    public static function all(): array
    {
        return self::ALL;
    }

    public static function normalize(string $value): string
    {
        $value = strtolower(trim($value));
        if (in_array($value, self::ALL, true)) return $value;
        if (in_array($value, ['login', 'register', 'forgot-password', 'reset-password', 'resend-verification', 'verify-email'], true)) return 'auth';
        if (in_array($value, ['settings', 'api-tokens', 'message'], true)) return 'account';
        return $value;
    }
}
