using System;
using System.Collections.Generic;

namespace Tornado3_2026Election.Services;

internal static class CutAppearancePolicyCatalog
{
    private static readonly IReadOnlyDictionary<string, IReadOnlySet<string>> DefaultAppearanceSectionsByTemplate =
        new Dictionary<string, IReadOnlySet<string>>(StringComparer.Ordinal);

    public static bool UsesTemplateDefaultAppearance(string templateName, string sectionName)
    {
        return !string.IsNullOrWhiteSpace(templateName) &&
               !string.IsNullOrWhiteSpace(sectionName) &&
               DefaultAppearanceSectionsByTemplate.TryGetValue(templateName, out var sections) &&
               sections.Contains(sectionName);
    }

    private static IReadOnlySet<string> CreateSectionSet(params string[] sections)
    {
        return new HashSet<string>(sections, StringComparer.Ordinal);
    }
}
