import { EnvironmentName, MarketName } from '../../../../services/pn-refined-marketweb-context/pn-refined-marketweb-context.types';
import { LanguageSelector, LanguageSelectorItem, LoginDialog, MenuItem, MenuSiteDefinition, SiteHeaderI18N, SiteHeaderSearch, SiteSelector } from '../../pn-marketweb-siteheader/pn-marketweb-siteheader-types';
export type HeaderMenuMode = number;
export interface HeaderMenuModeOption {
    index: number;
    label: string;
    href?: string;
    root: MenuItem;
}
export interface HeaderMenuStructure {
    hasMenuSwitching: boolean;
    modeRoots: MenuItem[];
    menuModeOptions: HeaderMenuModeOption[];
    sharedRoot: MenuItem | null;
    sharedItems: MenuItem[];
}
export interface HeaderMenuGroups {
    primaryItems: MenuItem[];
    sharedItems: MenuItem[];
}
/**
 * Resolved runtime context used when loading header data.
 * These values may come from explicit props, URL parsing, or environment resolution.
 */
export interface HeaderContext {
    market: MarketName;
    language: string;
    environment: EnvironmentName;
    endpoint: string;
    pageId?: string;
}
export interface HeaderApiPayload {
    sitedefinition: MenuSiteDefinition;
    search: SiteHeaderSearch;
    languageSelectorViewModel: LanguageSelector | null;
    siteSelectorViewModel: SiteSelector | null;
    loginViewModel: LoginDialog | null;
    mainMenu: {
        menuItems: MenuItem[];
    };
}
/**
 * The raw API response shape returned by /api/navigation/header.
 * This stays close to the backend structure.
 */
export interface HeaderApiEnvelope {
    value: HeaderApiPayload;
    formatters?: unknown[];
    contentTypes?: unknown[];
    declaredType?: unknown;
    statusCode?: number;
}
export interface HeaderViewModel {
    siteDefinition: MenuSiteDefinition | null;
    menuItems: MenuItem[];
    search: SiteHeaderSearch | null;
    siteSelector: SiteSelector | null;
    languageSelector: LanguageSelector | null;
    languageOptions: LanguageSelectorItem[];
    loginDialog: LoginDialog | null;
    homePageLink: string;
    /**
     * Whether the fetched structure supports switching between multiple top-level menu roots.
     *
     * When true:
     * - all top-level menu items except the last are treated as switchable roots
     * - the last top-level item is treated as the shared/common root
     */
    hasMenuSwitching: boolean;
    /**
     * Visible labels for the toggle component.
     */
    menuModeOptions: HeaderMenuModeOption[];
    /**
     * Default active menu mode index.
     *
     * This index refers to `menuModeOptions` and the corresponding switchable
     * top-level root menu.
     */
    defaultMenuMode: number;
    /**
     * Original normalized top-level menu structure from the backend.
     *
     * Semantics:
     * - all items except the last are switchable root menus
     * - the last item is the shared/common root
     *
     * This is preserved so the wrapper can rebuild visible menu items when the
     * active menu mode changes.
     */
    rawMenuItems: MenuItem[];
}
/**
 * Options used when mapping raw API data into a renderable view model.
 * These mostly come from component props or derived i18n values.
 */
export interface HeaderMapperOptions {
    language: string;
    hideHomeMenuItem: boolean;
    siteDomainInUrls: boolean;
    autocompleteEndpoint?: string;
    i18n: SiteHeaderI18N;
}
