import { aggregationType } from '@c8y/client';
import * as _angular_core from '@angular/core';
import { InjectionToken, AfterViewInit, OnInit, OnDestroy, EventEmitter, TemplateRef, WritableSignal } from '@angular/core';
import { ViewContext, ActionBarItem, ActionBarFactory, DashboardChildComponent, CountdownIntervalComponent, TabWithTemplate } from '@c8y/ngx-components';
import { Observable, BehaviorSubject } from 'rxjs';
import * as packages_client_lib from 'packages/client/lib';
import * as _angular_forms from '@angular/forms';
import { FormGroup, ControlValueAccessor, FormControl } from '@angular/forms';
import * as _c8y_ngx_components_global_context from '@c8y/ngx-components/global-context';
import { ActivatedRoute } from '@angular/router';
import { BsDropdownDirective } from 'ngx-bootstrap/dropdown';

declare const REFRESH_OPTION: {
    readonly LIVE: "live";
    readonly HISTORY: "history";
};
type RefreshOption = (typeof REFRESH_OPTION)[keyof typeof REFRESH_OPTION];

/**
 * Define the mapping between GlobalContextState keys and their equivalent in GlobalContextSettings
 */
declare const LINK_BTNS_CONFIG: {
    [K in Extract<keyof GlobalContextState, 'dateTimeContext' | 'aggregation' | 'isAutoRefreshEnabled'>]: {
        /** Form control name, same as global state key */
        formControlName: K;
        /** Setting key in GlobalContextSettings */
        settingKey: keyof GlobalContextSettings;
        /** User-friendly label for UI */
        label: string;
        /** Css Class for link button visualization */
        cssClass: string;
        icon: string;
    };
};
/**
 * Type for link toggle event
 */
interface LinkToggleEvent {
    key: Extract<keyof GlobalContextState, 'dateTimeContext' | 'aggregation' | 'isAutoRefreshEnabled'>;
    isLinked: boolean;
}
/**
 * Type for link states map
 */
type LinkStatesMap = Partial<Record<Extract<keyof GlobalContextState, 'dateTimeContext' | 'aggregation' | 'isAutoRefreshEnabled'>, boolean>>;
/**
 * Type for control configs map
 */
type ControlConfigsMap = Partial<Record<Extract<keyof GlobalContextState, 'dateTimeContext' | 'aggregation' | 'isAutoRefreshEnabled'>, {
    cssClass?: string;
    linkTooltip?: string;
    unlinkTooltip?: string;
    icon?: string;
    disabled?: boolean;
    disabledTooltip?: string;
    autoUnlinked?: boolean;
}>>;

declare const TIME_SPAN_MS: {
    readonly MINUTE: number;
    readonly HOUR: number;
    readonly DAY: number;
    readonly WEEK: number;
    readonly MONTH: number;
};
declare const TIME_INTERVAL: {
    readonly NONE: "none";
    readonly MINUTES: "minutes";
    readonly HOURS: "hours";
    readonly DAYS: "days";
    readonly WEEKS: "weeks";
    readonly MONTHS: "months";
    readonly CUSTOM: "custom";
};
type TimeInterval = (typeof TIME_INTERVAL)[keyof typeof TIME_INTERVAL];
type Interval = {
    id: 'minutes' | 'hours' | 'days' | 'weeks' | 'months' | 'custom' | string;
    title: string;
    timespanInMs?: number;
};
type AlarmFilterInterval = Interval | {
    id: 'none';
    title: string;
    timespanInMs?: number;
};
declare const INTERVALS: Interval[];
declare const INTERVAL_TITLES: Record<AlarmFilterInterval['id'], string>;

interface DateTimeContext {
    dateFrom: Date | string;
    dateTo: Date | string;
    interval: TimeInterval;
}
interface DateTimeContextPickerConfig {
    showDateFrom?: boolean;
    showDateTo?: boolean;
}

declare const GLOBAL_CONTEXT_EVENTS: {
    readonly STATE_CHANGE: "GLOBAL_CONTEXT_STATE_CHANGE";
    readonly REFRESH: "REFRESH";
    readonly REFRESH_OPTION_CHANGE: "GLOBAL_CONTEXT_REFRESH_OPTION_CHANGE";
    readonly UPDATE_GLOBAL_CONTEXT_LIVE: "UPDATE_GLOBAL_CONTEXT_LIVE";
    readonly UPDATE_GLOBAL_CONTEXT_HISTORY: "UPDATE_GLOBAL_CONTEXT_HISTORY";
    readonly INIT_GLOBAL_CONTEXT: "INIT_GLOBAL_CONTEXT";
};
declare enum GLOBAL_CONTEXT_DISPLAY_MODE {
    DASHBOARD = "dashboard",
    CONFIG = "config",
    VIEW_AND_CONFIG = "view_and_config"
}
type GlobalContextKeys = (keyof GlobalContextState)[];
/**
 * State object passed to widget state handlers
 */
interface WidgetState {
    config?: GlobalContextState;
    inlineControlSettings?: Partial<GlobalContextSettings>;
    dashboardControlSettings?: Partial<GlobalContextSettings>;
    currentLinks?: LinkStatesMap;
    displayMode?: string;
    [key: string]: unknown;
}
/**
 * Result returned from widget state handlers
 */
interface WidgetStateHandlerResult {
    inlineControlSettings: Partial<GlobalContextSettings>;
    dashboardControlSettings?: Partial<GlobalContextSettings>;
    links?: Partial<LinkStatesMap>;
    options?: {
        noAutoRefreshCounter?: boolean;
    };
}
interface WidgetControls {
    supports: GlobalContextKeys;
    supportedModes?: RefreshOption[];
    options?: {
        noAutoRefreshCounter?: boolean;
    };
    configSettings: {
        [mode in GLOBAL_CONTEXT_DISPLAY_MODE]?: {
            [option in RefreshOption]?: Partial<GlobalContextSettings>;
        };
    };
    settings: {
        [mode in GLOBAL_CONTEXT_DISPLAY_MODE]?: {
            [option in RefreshOption]?: Partial<GlobalContextSettings>;
        };
    };
    defaultLinks?: {
        [mode in GLOBAL_CONTEXT_DISPLAY_MODE]?: {
            [option in RefreshOption]?: LinkStatesMap;
        };
    };
    stateHandlers?: {
        [stateName: string]: (widgetState?: WidgetState) => WidgetStateHandlerResult;
    };
}
/** Settings to control which features are visible in the global context UI */
interface GlobalContextSettings {
    showTimeContext: boolean;
    showAggregation: boolean;
    showAutoRefresh: boolean;
    showRefresh: boolean;
    showRefreshInterval: boolean;
}
/** Base interface for all global context events */
interface GlobalContextEventBase<Type extends string, Payload> {
    type: Type;
    payload: Payload;
    timestamp?: number;
}
/**
 * Registry of all available global context events and their payloads
 *
 * Extend with new events by declaring module augmentation:
 *   interface GlobalContextEventRegistry {
 *     NEW_EVENT: boolean; // Add your event payload type
 *   }
 */
interface GlobalContextEventRegistry {
    [GLOBAL_CONTEXT_EVENTS.REFRESH]: {
        dateFrom?: string | Date;
        dateTo?: string | Date;
        interval?: TimeInterval;
    };
    [GLOBAL_CONTEXT_EVENTS.STATE_CHANGE]: Partial<GlobalContextState>;
    [GLOBAL_CONTEXT_EVENTS.REFRESH_OPTION_CHANGE]: RefreshOption;
    [GLOBAL_CONTEXT_EVENTS.UPDATE_GLOBAL_CONTEXT_LIVE]: Partial<GlobalContextState>;
    [GLOBAL_CONTEXT_EVENTS.UPDATE_GLOBAL_CONTEXT_HISTORY]: Partial<GlobalContextState>;
    [GLOBAL_CONTEXT_EVENTS.INIT_GLOBAL_CONTEXT]: void;
}
/** Union of all possible event type strings */
type GlobalContextEventType = keyof GlobalContextEventRegistry;
/** Union type of all possible global context events */
type GlobalContextEventUnion = {
    [K in GlobalContextEventType]: GlobalContextEventBase<K, GlobalContextEventRegistry[K]>;
}[GlobalContextEventType];
declare enum DateContextQueryParamNames {
    DATE_CONTEXT_FROM = "dateContextFrom",
    DATE_CONTEXT_TO = "dateContextTo",
    DATE_CONTEXT_INTERVAL = "dateContextInterval",
    DATE_CONTEXT_AGGREGATION = "dateContextAggregation",
    DATE_CONTEXT_AUTO_REFRESH = "globalContextAutoRefresh",
    DATE_CONTEXT_REFRESH_MODE = "globalContextRefreshMode"
}
type DateContextFromToQueryParams = {
    [DateContextQueryParamNames.DATE_CONTEXT_FROM]: string;
    [DateContextQueryParamNames.DATE_CONTEXT_TO]: string;
    [DateContextQueryParamNames.DATE_CONTEXT_INTERVAL]?: never;
};
type DateContextIntervalQueryParams = {
    [DateContextQueryParamNames.DATE_CONTEXT_FROM]?: never;
    [DateContextQueryParamNames.DATE_CONTEXT_TO]?: never;
    [DateContextQueryParamNames.DATE_CONTEXT_INTERVAL]: Interval['id'];
};
/**
 * Input query params is an object representing all possible query params related to widget time context.
 * It can be provided by user typing them in browser URL address bar, so all of them should be considered.
 */
type InputDateContextQueryParams = {
    [DateContextQueryParamNames.DATE_CONTEXT_FROM]?: string;
    [DateContextQueryParamNames.DATE_CONTEXT_TO]?: string;
    [DateContextQueryParamNames.DATE_CONTEXT_INTERVAL]?: Interval['id'];
    [DateContextQueryParamNames.DATE_CONTEXT_AGGREGATION]?: aggregationType;
    [DateContextQueryParamNames.DATE_CONTEXT_AUTO_REFRESH]?: boolean;
    [DateContextQueryParamNames.DATE_CONTEXT_REFRESH_MODE]?: string;
};
/**
 * Output query params is an object representing params that are applied to current URL in browser address bar.
 * These params are set programmatically.
 * Time context interval and time range described by date "from" and date "to" exclude each other.
 */
type OutputDateContextQueryParams = (DateContextFromToQueryParams | DateContextIntervalQueryParams) & {
    [DateContextQueryParamNames.DATE_CONTEXT_AGGREGATION]: aggregationType;
};
type GlobalContextDisplayMode = `${GLOBAL_CONTEXT_DISPLAY_MODE}`;
declare const GLOBAL_CONTEXT_SOURCE: {
    readonly WIDGET: "widget";
    readonly DASHBOARD: "dashboard";
};
type GlobalContextSource = (typeof GLOBAL_CONTEXT_SOURCE)[keyof typeof GLOBAL_CONTEXT_SOURCE];
interface GlobalContextState {
    dateTimeContext?: DateTimeContext;
    aggregation?: aggregationType | null;
    isAutoRefreshEnabled?: boolean;
    refreshInterval?: number;
    refreshOption?: RefreshOption;
    displayMode?: `${GLOBAL_CONTEXT_DISPLAY_MODE}`;
    source?: GlobalContextSource;
    eventSourceId?: string;
    /**
     * Flag indicating global context values have been applied.
     * For dashboard mode, widgets should wait for this flag before processing config.
     */
    isGlobalContextReady?: boolean;
}
/**
 * Interface for date context parameters passed to setDateContextQueryParams method.
 * Provides strong typing for all possible parameters.
 */
interface DateContextParams {
    /** Time interval ID ('DAYS', 'HOURS', etc.) or 'custom' for date ranges */
    interval?: Interval['id'];
    /** Array containing [dateFrom, dateTo] strings or Date objects for custom date ranges */
    date?: (string | Date)[] | null;
    /** Data aggregation type ('HOURLY', 'DAILY', etc.) */
    aggregation?: aggregationType;
    /** Whether auto-refresh should be enabled */
    isAutoRefreshEnabled?: boolean;
    /** Refresh mode ('live' or 'history') */
    refreshOption?: RefreshOption;
}
/**
 * Result type for query parameter validation status.
 * Provides detailed validation information for debugging and UI state management.
 */
interface ParameterValidationStatus {
    /** True if interval parameter is valid and selectable */
    interval: boolean;
    /** True if aggregation parameter is valid */
    aggregation: boolean;
    /** True if both dateFrom and dateTo form a valid date range */
    dateRange: boolean;
    /** Parsed boolean value, or undefined if invalid/missing */
    autoRefresh: boolean | undefined;
}
declare const WIDGET_DISPLAY_MODE: {
    readonly INLINE: "inline";
    readonly CONFIG: "config";
    readonly PREVIEW: "preview";
};
type WidgetDisplayMode = (typeof WIDGET_DISPLAY_MODE)[keyof typeof WIDGET_DISPLAY_MODE];
interface GlobalContextEvent {
    context: Partial<GlobalContextState>;
    diff: Partial<GlobalContextState>;
}

/**
 * Default values for global context configuration
 * Single source of truth for all default values across the global context feature
 */
declare const GLOBAL_CONTEXT_DEFAULTS: {
    /** Default refresh option - live mode */
    readonly REFRESH_OPTION: "live";
    /** Default auto-refresh state */
    readonly IS_AUTO_REFRESH_ENABLED: true;
    /** Default refresh interval in milliseconds (5 seconds) */
    readonly REFRESH_INTERVAL: 5000;
    /** Default aggregation type */
    readonly AGGREGATION: any;
    /** Default display mode */
    readonly DISPLAY_MODE: GLOBAL_CONTEXT_DISPLAY_MODE.DASHBOARD;
    /** Default date range duration in milliseconds (1 hour) */
    readonly DATE_RANGE_DURATION_MS: number;
    /** Default time interval for custom ranges */
    readonly TIME_INTERVAL: "hours";
};

type Aggregation = {
    id: aggregationType | null;
    title: string;
};
declare const AGGREGATIONS: Aggregation[];
declare const AGGREGATION_LIMITS: {
    MINUTELY_LIMIT: number;
    HOURLY_LIMIT: number;
    DAILY_LIMIT: number;
};
declare const AGGREGATION_ICON_TYPE: {
    readonly UNDEFINED: "line-chart";
    readonly MINUTELY: "hourglass";
    readonly HOURLY: "clock-o";
    readonly DAILY: "calendar-o";
};
type AggregationIconType = (typeof AGGREGATION_ICON_TYPE)[keyof typeof AGGREGATION_ICON_TYPE];
declare const AGGREGATION_ICONS: Record<aggregationType | 'undefined', AggregationIconType>;
declare const AGGREGATION_TEXTS: Record<aggregationType | 'undefined' | 'null' | 'disabled', string>;
declare const AGGREGATION_VALUES: {
    readonly none: "NONE";
    readonly minutely: aggregationType.MINUTELY;
    readonly hourly: aggregationType.HOURLY;
    readonly daily: aggregationType.DAILY;
};
declare const AGGREGATION_VALUES_ARR: readonly ["NONE", aggregationType.MINUTELY, aggregationType.HOURLY, aggregationType.DAILY];
declare const AGGREGATION_LABELS: {
    readonly NONE: string;
    readonly MINUTELY: string;
    readonly HOURLY: string;
    readonly DAILY: string;
};
/**
 * Represents the available aggregation options.
 * Aggregation 'none' is not handled by our backend.
 */
type AggregationOption = typeof AGGREGATION_VALUES.none | `${aggregationType}`;
/**
 * Represents the status of aggregation options.
 * Used to determine which aggregation options should be disabled.
 */
type AggregationOptionStatus = {
    [key in AggregationOption]?: boolean;
};
interface AggregationState {
    aggregationType: aggregationType;
    isDisabled: boolean;
}

/**
 * Configuration interface for context selector component
 */
interface ContextConfig {
    context: 'dashboard' | 'widget';
    showInWidget: boolean;
}

/**
 * Time duration constants (ms)
 */
declare const TIME_DURATION: {
    /** One hour in milliseconds */
    readonly ONE_HOUR_MS: number;
    /** One minute in milliseconds */
    readonly ONE_MINUTE_MS: number;
    /** One second in milliseconds */
    readonly ONE_SECOND_MS: 1000;
};
/**
 * Timing constants for debouncing and throttling
 */
declare const TIMING: {
    /** Debounce time for form value changes (ms) */
    readonly FORM_DEBOUNCE: 100;
    /** Throttle time for context changes (ms) */
    readonly CONTEXT_THROTTLE: 200;
    /** Tooltip delay time (ms) */
    readonly TOOLTIP_DELAY: 500;
    /** Default debounce time (ms) */
    readonly DEFAULT_DEBOUNCE: 100;
};
/**
 * UI priority constants
 */
declare const UI_PRIORITIES: {
    /** High priority for configuration controls */
    readonly CONFIGURATION_PRIORITY: 1000;
};

/**
 * Interface representing a registered widget's global context settings with its unique identifier.
 */
interface RegisteredGlobalContextSettings extends Partial<GlobalContextSettings> {
    /** Unique identifier for the widget that registered these settings */
    readonly id: string;
}
/**
 * GlobalContextService manages widget settings registration and loading states.
 *
 * This service is responsible for:
 * - Registering and managing widget-specific global context settings
 * - Consolidating settings from multiple widgets using OR logic
 * - Tracking loading states across multiple widgets
 * - Providing default configurations for the global context
 *
 * @example
 * ```typescript
 * // Register widget settings
 * globalContextService.register('widget-1', { showTimeContext: true });
 *
 * // Get consolidated settings from all widgets
 * globalContextService.getConsolidatedSettings().subscribe(settings => {
 *   console.log(settings); // { showTimeContext: true, ... }
 * });
 *
 * // Track loading state
 * globalContextService.registerLoading('widget-1');
 * console.log(globalContextService.isLoading()); // true
 * ```
 */
declare class GlobalContextService {
    /**
     * Computed signal that indicates if any widgets are currently in a loading state.
     * Returns true if at least one widget has registered a loading state.
     */
    readonly isLoading: _angular_core.Signal<boolean>;
    /** Target context for the global context service */
    protected readonly targetContext: ViewContext.Device | ViewContext.Group;
    /** Observable stream of all registered widget settings */
    private readonly settings$;
    /** Signal storing unique identifiers of widgets currently in loading state */
    private readonly loadingIds;
    /**
     * Registers global context settings for a specific widget.
     * If settings for the same widget ID already exist, they will be updated.
     *
     * @param id - Unique identifier for the widget
     * @param settings - Partial global context settings to register
     *
     * @throws {Error} When id is empty or null
     *
     * @example
     * ```typescript
     * globalContextService.register('my-widget', {
     *   showTimeContext: true,
     *   showAutoRefresh: false
     * });
     * ```
     */
    register(id: string, settings: Partial<GlobalContextSettings>): void;
    /**
     * Retrieves all currently registered widget settings.
     *
     * @returns Array of all registered settings with their widget IDs
     */
    getSettings(): readonly RegisteredGlobalContextSettings[];
    /**
     * Removes all registered widget settings.
     * This will cause the consolidated settings to return to default values.
     */
    resetSettings(): void;
    /**
     * Unregisters settings for a specific widget.
     *
     * @param id - Unique identifier of the widget to unregister
     *
     * @example
     * ```typescript
     * globalContextService.unregister('my-widget');
     * ```
     */
    unregister(id: string): void;
    /**
     * Returns an observable of consolidated global context settings.
     *
     * Settings are consolidated using OR logic - if any widget requires a setting to be shown,
     * it will be included in the consolidated result. The observable emits distinct values only
     * and is shared among all subscribers for optimal performance.
     *
     * @returns Observable that emits consolidated settings whenever they change
     *
     * @example
     * ```typescript
     * globalContextService.getConsolidatedSettings().subscribe(settings => {
     *   if (settings.showTimeContext) {
     *     // Show time context controls
     *   }
     * });
     * ```
     */
    getConsolidatedSettings(): Observable<GlobalContextSettings>;
    /**
     * Returns the default global context settings.
     * These settings are used when no widgets have registered any settings.
     *
     * @returns Default settings object with all options disabled
     */
    getDefaultSettings(): GlobalContextSettings;
    /**
     * Registers a loading state for a specific widget.
     * This will cause the `isLoading` computed signal to return true.
     *
     * @param id - Unique identifier of the widget in loading state
     *
     * @example
     * ```typescript
     * globalContextService.registerLoading('my-widget');
     * console.log(globalContextService.isLoading()); // true
     * ```
     */
    registerLoading(id: string): void;
    /**
     * Unregisters a loading state for a specific widget.
     * When no widgets are in loading state, `isLoading` will return false.
     *
     * @param id - Unique identifier of the widget to remove from loading state
     *
     * @example
     * ```typescript
     * globalContextService.unregisterLoading('my-widget');
     * ```
     */
    unregisterLoading(id: string): void;
    /**
     * Returns the default global context state.
     * This state is used as the initial configuration for new global context instances.
     *
     * @returns Default global context state with live refresh enabled and 1-minute time range
     *
     * @example
     * ```typescript
     * const defaultState = globalContextService.getDefaultState();
     * console.log(defaultState.refreshOption); // 'live'
     * ```
     */
    getDefaultState(): GlobalContextState;
    /**
     * Validates that a widget ID is not empty or null.
     *
     * @param id - Widget ID to validate
     * @throws {Error} When ID is invalid
     */
    private validateWidgetId;
    /**
     * Finds the index of settings for a given widget ID.
     *
     * @param id - Widget ID to search for
     * @param settings - Array of settings to search in
     * @returns Index of the settings or -1 if not found
     */
    private findSettingsIndex;
    /**
     * Updates existing settings for a widget.
     *
     * @param index - Index of the settings to update
     * @param newSettings - New settings to apply
     * @param currentSettings - Current settings array
     */
    private updateExistingSettings;
    /**
     * Adds new settings to the settings array.
     *
     * @param newSettings - Settings to add
     * @param currentSettings - Current settings array
     */
    private addNewSettings;
    /**
     * Consolidates multiple widget settings using OR logic.
     *
     * @param settingsArray - Array of widget settings to consolidate
     * @returns Consolidated settings object
     */
    private consolidateSettings;
    /**
     * Compares two settings objects for deep equality.
     *
     * @param prev - Previous settings
     * @param curr - Current settings
     * @returns True if settings are equal, false otherwise
     */
    private areSettingsEqual;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<GlobalContextService, never>;
    static ɵprov: _angular_core.ɵɵInjectableDeclaration<GlobalContextService>;
}

/**
 * Service responsible for building and managing form groups for global context configuration.
 */
declare class GlobalContextFormService {
    private readonly fb;
    /**
     * Creates a FormGroup for global context configuration.
     * @param config Optional existing configuration to initialize form values
     * @param defaults Optional override values for specific controls
     * @returns A fully configured FormGroup
     */
    buildForm(config?: Partial<GlobalContextState>, defaults?: Partial<GlobalContextState>, skipProp?: Array<keyof GlobalContextState>): FormGroup<{
        dateTimeContext?: _angular_forms.FormControl<_c8y_ngx_components_global_context.DateTimeContext>;
        aggregation?: _angular_forms.FormControl<packages_client_lib.aggregationType>;
        isAutoRefreshEnabled?: _angular_forms.FormControl<boolean>;
        refreshInterval?: _angular_forms.FormControl<number>;
        refreshOption?: _angular_forms.FormControl<_c8y_ngx_components_global_context.RefreshOption>;
        displayMode?: _angular_forms.FormControl<"dashboard" | "config" | "view_and_config">;
        source?: _angular_forms.FormControl<GlobalContextSource>;
        eventSourceId?: _angular_forms.FormControl<string>;
        isGlobalContextReady?: _angular_forms.FormControl<boolean>;
    }>;
    /**
     * Extracts form values into a configuration object
     * @param form The form to extract values from
     * @returns GlobalContextConfig object
     */
    getConfigFromForm(form: FormGroup): GlobalContextState;
    /**
     * Gets the default values for the global context form
     */
    getDefaultValues(): GlobalContextState;
    /**
     * Merges default values with config and explicit overrides
     */
    private mergeValues;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<GlobalContextFormService, never>;
    static ɵprov: _angular_core.ɵɵInjectableDeclaration<GlobalContextFormService>;
}

/**
 * GlobalContextEventService manages global context events using the browser's native event system.
 *
 * This service provides a type-safe wrapper around window custom events for global context communication.
 * It maintains event subjects for efficient observable-based event handling while ensuring proper
 * cleanup and memory management.
 *
 * Key features:
 * - Type-safe event emission and subscription
 * - Latest value caching for each event type
 * - Memory-efficient subject management
 * - Integration with browser's native event system
 *
 * @example
 * ```typescript
 * // Emit an event
 * eventService.emit('GLOBAL_CONTEXT_STATE_CHANGE', {
 *   refreshOption: 'live',
 *   isAutoRefreshEnabled: true
 * });
 *
 * // Subscribe to events
 * eventService.on('GLOBAL_CONTEXT_STATE_CHANGE').subscribe(state => {
 *   console.log('State changed:', state);
 * });
 *
 * // Get the latest value
 * const latestState = eventService.getLatestValue('GLOBAL_CONTEXT_STATE_CHANGE');
 * ```
 */
declare class GlobalContextEventService {
    /** Map storing BehaviorSubjects for each event type to cache latest values */
    private readonly eventSubjects;
    /** Observable stream of all global context events from the window */
    private readonly events$;
    /**
     * Emits a global context event with type-safe payload.
     *
     * The event is both stored locally for latest value retrieval and dispatched
     * as a browser custom event for cross-component communication.
     *
     * @param type - The specific event type to emit (must be a valid GlobalContextEventType)
     * @param payload - Type-safe payload matching the event type requirements
     *
     * @throws {Error} When event type is invalid or payload validation fails
     *
     * @example
     * ```typescript
     * // Emit a state change event
     * eventService.emit('GLOBAL_CONTEXT_STATE_CHANGE', {
     *   refreshOption: 'live',
     *   isAutoRefreshEnabled: true
     * });
     *
     * // Emit a refresh event
     * eventService.emit('GLOBAL_CONTEXT_REFRESH', {
     *   dateFrom: '2024-01-01',
     *   dateTo: '2024-01-02'
     * });
     * ```
     */
    emit<T extends GlobalContextEventType>(type: T, payload?: GlobalContextEventRegistry[T]): void;
    /**
     * Creates an observable that emits whenever a specific event type occurs.
     *
     * The observable filters the global event stream to only emit events of the specified type.
     * This provides efficient, reactive event handling without manual event listener management.
     *
     * @param eventType - The specific event type to observe
     * @returns Observable that emits payloads of the specified event type
     *
     * @throws {Error} When event type is invalid
     *
     * @example
     * ```typescript
     * // Subscribe to state changes
     * eventService.on('GLOBAL_CONTEXT_STATE_CHANGE')
     *   .pipe(takeUntilDestroyed())
     *   .subscribe(state => {
     *     console.log('New state:', state);
     *   });
     *
     * // Subscribe to refresh events with filtering
     * eventService.on('GLOBAL_CONTEXT_REFRESH')
     *   .pipe(
     *     filter(data => data?.interval === 'MINUTES'),
     *     takeUntilDestroyed()
     *   )
     *   .subscribe(refreshData => {
     *     console.log('Minute-based refresh:', refreshData);
     *   });
     * ```
     */
    on<T extends GlobalContextEventType>(eventType: T): Observable<GlobalContextEventRegistry[T]>;
    /**
     * Retrieves the most recently emitted value for a specific event type.
     *
     * This method provides synchronous access to the latest event data without
     * requiring a subscription. Returns null if no event of the specified type
     * has been emitted yet.
     *
     * @param eventType - The event type to retrieve the latest value for
     * @returns The latest emitted value or null if none exists
     *
     * @throws {Error} When event type is invalid
     *
     * @example
     * ```typescript
     * // Get the current state
     * const currentState = eventService.getLatestValue('GLOBAL_CONTEXT_STATE_CHANGE');
     * if (currentState) {
     *   console.log('Current refresh option:', currentState.refreshOption);
     * }
     *
     * // Check for latest refresh data
     * const refreshData = eventService.getLatestValue('GLOBAL_CONTEXT_REFRESH');
     * if (refreshData?.dateFrom) {
     *   console.log('Last refresh from:', refreshData.dateFrom);
     * }
     * ```
     */
    getLatestValue<T extends GlobalContextEventType>(eventType: T): GlobalContextEventRegistry[T] | null;
    /**
     * Synchronizes dateTimeContext from REFRESH event to STATE_CHANGE event.
     *
     * This method ensures that when a REFRESH event contains dateTimeContext data,
     * it updates the STATE_CHANGE event subject's value directly without emitting a new event.
     * This keeps the internal state synchronized without triggering listeners.
     *
     * @param refreshDateTimeContext - The dateTimeContext from the REFRESH event to sync
     *
     * @example
     * ```typescript
     * // When a refresh occurs with new dateTimeContext
     * const refreshData = { dateFrom: '2024-01-01', dateTo: '2024-01-02', interval: 'HOURLY' };
     * eventService.emit(GLOBAL_CONTEXT_EVENTS.REFRESH, refreshData);
     *
     * // Sync it to STATE_CHANGE internal state
     * eventService.syncRefreshToStateChange(refreshData);
     * ```
     */
    syncRefreshToStateChange(refreshDateTimeContext?: GlobalContextEventRegistry[typeof GLOBAL_CONTEXT_EVENTS.REFRESH]): void;
    /**
     * Validates that an event type is not empty or invalid.
     *
     * @param eventType - The event type to validate
     * @throws {Error} When event type is invalid
     */
    private validateEventType;
    /**
     * Dispatches a browser custom event for cross-component communication.
     *
     * @param type - Event type
     * @param payload - Event payload
     */
    private dispatchBrowserEvent;
    /**
     * Gets or creates a BehaviorSubject for a specific event type.
     * Implements memory management by limiting the number of cached subjects.
     *
     * @param type - The event type
     * @returns BehaviorSubject for the event type
     */
    private getOrCreateEventSubject;
    /**
     * Ensures the event subject cache doesn't exceed the maximum limit.
     * Removes the oldest subjects when limit is reached.
     */
    private ensureSubjectCacheLimit;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<GlobalContextEventService, never>;
    static ɵprov: _angular_core.ɵɵInjectableDeclaration<GlobalContextEventService>;
}

/**
 * Standard result interface for all widget settings operations.
 * Used consistently across resolution, toggle, and configuration methods.
 */
interface WidgetSettingsResult {
    /** Settings for inline (widget-level) controls (new naming) */
    settings: Partial<GlobalContextSettings>;
    /** Link states determining dashboard vs inline control visibility */
    links: LinkStatesMap;
    /** Settings for dashboard-level controls (new naming) */
    dashboardControls: Partial<GlobalContextSettings>;
}
/**
 * Service responsible for managing widget-level control settings and their interaction
 * with dashboard-level controls. Handles the resolution of settings based on display mode,
 * link states, and refresh options.
 *
 * Key responsibilities:
 * - Widget settings resolution for different display modes
 * - Link state management between inline and dashboard controls
 * - Dashboard control calculations based on link states
 * - Settings toggle operations for individual and bulk link changes
 */
declare class WidgetControlService {
    /**
     * Resolves widget settings for inline controls based on the specified mode and refresh option.
     * For dashboard mode, calculates the split between inline and dashboard controls.
     *
     * @param controls - Widget control configuration containing settings and links
     * @param mode - Display mode determining which settings to use
     * @param refreshOption - Refresh mode (live/history) for settings selection
     * @returns Resolved settings with inline controls, links, and dashboard controls
     */
    resolveInlineControlSettings(controls: WidgetControls, mode: GlobalContextDisplayMode, refreshOption: RefreshOption): WidgetSettingsResult;
    /**
     * Resolves widget settings for configuration controls based on the specified mode and refresh option.
     * Configuration controls are simpler and don't require dashboard control calculations.
     *
     * @param controls - Widget control configuration containing config settings
     * @param mode - Display mode determining which config settings to use
     * @param refreshOption - Refresh mode (live/history) for settings selection
     * @returns Resolved configuration settings with empty links and dashboard controls
     */
    resolveConfigControlSettings(controls: WidgetControls, mode: GlobalContextDisplayMode, refreshOption: RefreshOption): WidgetSettingsResult;
    /**
     * Extracts inline settings from widget controls for the specified display mode and refresh option.
     * Applies fallback logic for invalid refresh options, defaulting to LIVE mode.
     *
     * @param controls - Widget control configuration
     * @param displayMode - Display mode (dashboard, config, view_and_config)
     * @param refreshOption - Refresh mode, may be invalid and will fallback to LIVE
     * @returns Inline settings for the specified mode and refresh option
     */
    getInlineSettingsFromWidgetControls(controls: WidgetControls, displayMode: GlobalContextDisplayMode, refreshOption: RefreshOption | string): Partial<GlobalContextSettings>;
    /**
     * Extracts configuration settings from widget controls for the specified display mode and refresh option.
     * Applies fallback logic for invalid refresh options, defaulting to LIVE mode.
     *
     * @param controls - Widget control configuration
     * @param displayMode - Display mode (dashboard, config, view_and_config)
     * @param refreshOption - Refresh mode, may be invalid and will fallback to LIVE
     * @returns Configuration settings for the specified mode and refresh option
     */
    getConfigSettingsFromWidgetControls(controls: WidgetControls, displayMode: GlobalContextDisplayMode, refreshOption: RefreshOption | string): Partial<GlobalContextSettings>;
    /**
     * Extracts default link states from widget controls for the specified display mode and refresh option.
     * Applies fallback logic for invalid refresh options, defaulting to LIVE mode.
     *
     * @param controls - Widget control configuration
     * @param displayMode - Display mode (dashboard, config, view_and_config)
     * @param refreshOption - Refresh mode, may be invalid and will fallback to LIVE
     * @returns Default link states for the specified mode and refresh option
     */
    getDefaultLinksFromControls(controls: WidgetControls, displayMode: GlobalContextDisplayMode, refreshOption: RefreshOption | string): LinkStatesMap;
    /**
     * Toggles a single link state and recalculates the resulting settings and dashboard controls.
     * When a link is toggled, it affects how controls are distributed between inline and dashboard.
     *
     * @param linkKey - The key of the link to toggle
     * @param currentSettings - Current inline control settings
     * @param currentLinks - Current link states
     * @returns Updated settings with toggled link and recalculated dashboard controls
     */
    toggleControlLink(linkKey: string, currentSettings: Partial<GlobalContextSettings>, currentLinks: LinkStatesMap): WidgetSettingsResult;
    /**
     * Sets all link states to the specified value and recalculates the resulting settings.
     * This is used for bulk operations like "link all" or "unlink all" controls.
     *
     * @param state - The state to set for all links (true = linked, false = unlinked)
     * @param currentSettings - Current inline control settings
     * @param currentLinks - Current link states
     * @returns Updated settings with all links set to the specified state
     */
    toggleAllControlLinks(state: boolean, currentSettings: Partial<GlobalContextSettings>, currentLinks: LinkStatesMap): WidgetSettingsResult;
    /**
     * Validates and normalizes a refresh option, providing fallback to LIVE for invalid values.
     * Handles type coercion and validates against the REFRESH_OPTION enum.
     *
     * @param refreshOption - Refresh option to validate (may be string or RefreshOption)
     * @returns Valid RefreshOption, defaulting to LIVE for invalid inputs
     */
    private validateRefreshOption;
    /**
     * Calculates how settings should be split between dashboard and inline controls based on link states.
     * When a control is linked (true), it appears on the dashboard. When unlinked (false), it appears inline.
     * This method implements the core business logic for the dashboard/inline control relationship.
     *
     * @param settings - Base settings to split between dashboard and inline
     * @param links - Link states determining where each control should appear
     * @returns Object containing settings for both inline and dashboard controls
     */
    private calculateDashboardSettings;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<WidgetControlService, never>;
    static ɵprov: _angular_core.ɵɵInjectableDeclaration<WidgetControlService>;
}

declare class DateTimeContextPickerService {
    /**
     * Calculates date time context according to provided interval.
     *
     * @param intervalId - Interval id indicating time range
     * @returns Tuple of [dateFrom, dateTo] where dateTo is current time, or null if interval is invalid
     *
     * @example
     * ```typescript
     * // Returns [epoch, current date] for 'none' interval
     * service.getDateTimeContextByInterval('none');
     *
     * // Returns [1 hour ago, now] for 'hours' interval
     * service.getDateTimeContextByInterval('hours');
     *
     * // Returns null for invalid intervals
     * service.getDateTimeContextByInterval('invalid'); // null
     * ```
     */
    getDateTimeContextByInterval(intervalId: TimeInterval): [Date, Date] | null;
    /**
     * Validates provided param for being selectable Interval id.
     * @param intervalId Interval id to be validated.
     * @returns True if provided id is valid, selectable Interval id and false if it's not.
     */
    isSelectableInterval(intervalId: Interval['id']): boolean;
    /**
     * Validates provided date "from" and date "to":
     * - if both dates are proper date strings/values
     * - if provided date from is earlier than date to.
     * @param stringifiedDateFrom Date "from" that should be validated.
     * @param stringifiedDateTo Date "to" that should be validated.
     * @returns Result of validation of dates range.
     */
    isValidDateRange(stringifiedDateFrom: string, stringifiedDateTo: string): boolean;
    /**
     * Validates provided aggregation type.
     * @param aggregation Aggregation type to be validated.
     * @returns Result of validation of aggregation.
     */
    isValidAggregation(aggregation: aggregationType | null): boolean;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<DateTimeContextPickerService, never>;
    static ɵprov: _angular_core.ɵɵInjectableDeclaration<DateTimeContextPickerService>;
}

/**
 * Legacy widget configuration interface representing the various formats used in older widgets.
 *
 * This interface captures all possible legacy configuration properties that need to be migrated
 * to the new GlobalContextState format. Legacy widgets could store these properties at different
 * nesting levels (root, config, or mapConfig) with varying naming conventions.
 *
 * Note: The field 'canDecoupleGlobalTimeContext' was intentionally excluded from migration logic.
 * This field was used in legacy configurations but is no longer relevant for the new Global Context system.
 */
interface LegacyWidgetConfig {
    /**
     * Widget capability declarations from widget definitions.
     * These indicate which global context features the widget supports,
     * but don't represent the actual configuration values.
     */
    displaySettings?: {
        /** Whether widget supports global time context feature */
        globalTimeContext?: boolean;
        /** Whether widget supports auto-refresh feature */
        globalAutoRefreshContext?: boolean;
        /** Whether widget supports realtime updates */
        globalRealtimeContext?: boolean;
        /** Whether widget supports data aggregation */
        globalAggregationContext?: boolean;
    };
    /**
     * Actual widget instance configuration determining which features are active.
     * These take precedence over displaySettings when determining migration behavior.
     */
    /** Whether this widget instance uses global time context */
    widgetInstanceGlobalTimeContext?: boolean;
    /** Whether this widget instance uses global auto-refresh */
    widgetInstanceGlobalAutoRefreshContext?: boolean;
    /** @deprecated Deprecated field not used in migration */
    canDecoupleGlobalTimeContext?: boolean;
    /** Whether to display date selection controls in the widget */
    displayDateSelection?: boolean;
    /** Legacy time configuration properties (multiple formats supported) */
    /** Date range as array [from, to] - used by some widgets */
    dateFilter?: string[] | [string, string];
    /** Date range as array [from, to] - alternative legacy format */
    date?: string[] | [string, string];
    /** Start date as ISO string */
    dateFrom?: string;
    /** End date as ISO string */
    dateTo?: string;
    /** Time interval identifier (e.g., 'hours', 'days', 'none') */
    interval?: string;
    /** Legacy refresh configuration properties */
    /** Legacy refresh mode ('interval', 'global-interval', 'none') */
    refreshOption?: string;
    /** Whether auto-refresh is enabled */
    isAutoRefreshEnabled?: boolean;
    /** Refresh interval in milliseconds */
    refreshInterval?: number;
    /** Whether widget is in realtime mode */
    isRealtime?: boolean;
    /** Alternative realtime flag used by some widgets */
    realtime?: boolean;
    /**
     * Nested configuration objects where widgets might store their settings.
     * The migration service checks these nested levels to ensure all configuration is captured.
     */
    /** Map widget specific configuration */
    mapConfig?: Record<string, unknown>;
    /** Generic nested configuration */
    config?: Record<string, unknown>;
}
/** Options for `WidgetConfigMigrationService.migrateWidgetConfig`. */
interface MigrateWidgetConfigOptions {
    /**
     * Defaults applied when a config has no time-context fields. Without this, such
     * configs fall back to the generic "last hour" default — wrong for widgets whose
     * AngularJS predecessor displayed full history (e.g. datapoints list).
     */
    legacyTimeContextDefaults?: Partial<GlobalContextState>;
}
declare class WidgetConfigMigrationService {
    private dateTimeContextPickerService;
    constructor(dateTimeContextPickerService: DateTimeContextPickerService);
    /**
     * Transforms legacy widget configurations into the standardized GlobalContextState format.
     *
     * This migration handles the transition from various legacy configuration formats to the new
     * unified global context system. It detects which properties need updating and
     * preserves configurations that are already in the correct format.
     *
     * **What is migrated:**
     * - `displayMode`: Derived from widgetInstanceGlobalTimeContext/AutoRefreshContext flags
     * - `dateTimeContext`: Normalized from dateFilter, date, dateFrom/dateTo, or interval fields
     * - `refreshOption`: Converted from legacy 'interval'/'global-interval'/'none' values to LIVE/HISTORY
     * - `isAutoRefreshEnabled` + `refreshInterval`: Determined from realtime flags and legacy settings
     * - `aggregation`: Normalized from legacy 'NONE' string to null
     *
     *
     * **Use case:**
     * Call this on every widget configuration before rendering to ensure compatibility with
     * the global context system, regardless of when the widget was created or last saved.
     *
     * @param config - Widget configuration object that may contain legacy or new format properties.
     *   Can be any object type, but should contain widget configuration fields.
     * @returns Configuration with all required GlobalContextState properties, either migrated from
     *   legacy format or preserved if already valid. Returns input unchanged if null/undefined.
     *
     * @example
     * ```ts
     * // Legacy config with old format
     * const legacyConfig = {
     *   widgetInstanceGlobalTimeContext: true,
     *   dateFrom: '2024-01-01',
     *   dateTo: '2024-01-02',
     *   refreshOption: 'interval'
     * };
     *
     * // After migration
     * const migrated = migrationService.migrateWidgetConfig(legacyConfig);
     * // {
     * //   displayMode: 'dashboard',
     * //   dateTimeContext: { dateFrom: '2024-01-01T00:00:00.000Z', dateTo: '2024-01-02T00:00:00.000Z', interval: 'custom' },
     * //   refreshOption: 'live',
     * //   isAutoRefreshEnabled: true,
     * //   refreshInterval: 60000,
     * //   aggregation: null
     * // }
     * ```
     */
    migrateWidgetConfig<T extends object = object>(config: T, options?: MigrateWidgetConfigOptions): Partial<GlobalContextState>;
    /**
     * True when a config carries neither the new `dateTimeContext` nor any legacy time
     * field (`dateFrom`, `dateTo`, `dateFilter`, `date`, `interval`). Use to decide
     * whether widget-specific legacy defaults should be applied.
     */
    hasNoTimeContextFields(config: object): boolean;
    /**
     * Creates a flattened configuration by excluding nested configuration objects.
     *
     * Legacy widgets often stored settings in nested objects like `mapConfig` or `config`.
     * This method creates a copy of the configuration without these nested objects to prevent
     * duplication in the migrated output - the nested values are extracted and merged separately
     * by extractGlobalContextSettings().
     *
     * @param config - The raw widget configuration potentially containing nested objects
     * @returns Flattened configuration without mapConfig and config properties
     *
     */
    private createFlatConfig;
    /**
     * Applies or migrates all global context properties to ensure complete configuration.
     *
     * This method implements a selective migration strategy:
     * - Checks which properties are missing or invalid in the current config
     * - Migrates only the properties that need updating
     * - Forces full migration when config has NO global context properties at all
     *
     * The method ensures that all widgets end up with valid displayMode, dateTimeContext,
     * refreshOption/isAutoRefreshEnabled/refreshInterval, and aggregation settings.
     *
     * @param config - The configuration object to modify (mutated in place)
     * @param mergedSettings - Combined settings from all config levels used for migration decisions
     *
     */
    private applyGlobalContextProperties;
    /**
     * Determines if a configuration completely lacks global context properties.
     *
     * Used to detect widgets that have never been configured for global context integration.
     * When true, the migration applies full default configuration rather than selective updates.
     *
     * @param config - The configuration to check
     * @returns true if all global context properties are missing or undefined
     *
     */
    private hasNoGlobalContextProperties;
    /**
     * Applies refresh settings as a cohesive unit to ensure consistency.
     *
     * The three refresh properties (refreshOption, isAutoRefreshEnabled, refreshInterval) are
     * interdependent and must be migrated together to avoid inconsistent states:
     * - refreshOption determines the mode (LIVE vs HISTORY)
     * - isAutoRefreshEnabled controls whether auto-refresh is active
     * - refreshInterval sets the refresh frequency in milliseconds
     *
     * Special handling:
     * - Realtime widgets get LIVE mode with 5-second interval
     * - Legacy refreshOption values are normalized to LIVE or HISTORY
     * - Nested config refreshInterval values are prioritized
     *
     * @param config - The configuration object to update (mutated in place)
     * @param mergedSettings - Combined settings from all levels for migration decisions
     *
     */
    private applyRefreshSettings;
    /**
     * Determines the appropriate display mode based on legacy widget configuration.
     *
     * Display mode controls how the widget integrates with global context:
     * - DASHBOARD: Fully controlled by dashboard-level global context
     * - CONFIG: Widget manages its own settings independently
     * - VIEW_AND_CONFIG: Widget shows inline controls and can configure itself
     *
     * Decision logic priority:
     * 1. displayDateSelection=true → VIEW_AND_CONFIG (explicit request for date controls)
     * 2. Both time and refresh are global → DASHBOARD (full integration)
     * 3. One global, one local → VIEW_AND_CONFIG (partial integration)
     * 4. One setting defined → DASHBOARD (assume global by default)
     * 5. Both undefined → CONFIG (widget manages itself)
     *
     * @param settings - Merged settings from all config levels
     * @returns The appropriate display mode for the widget
     *
     */
    private resolveDisplayMode;
    /**
     * Builds date/time context from various legacy configuration formats.
     *
     * Legacy widgets stored time configuration in many different ways. This method
     * normalizes all formats into the new DateTimeContext structure with consistent
     * ISO date strings and proper interval classification.
     *
     * Resolution priority:
     * 1. interval='none' → Always epoch (1970) to now with CUSTOM interval
     * 2. Predefined intervals (hours, days, etc.) → Calculate fresh dates based on interval
     * 3. Legacy date fields → Use provided dates with calculated/custom interval
     * 4. Widget needs time context → Apply default (last hour)
     * 5. Fallback → Last hour with HOURS interval
     *
     * Special cases:
     * - interval='none' always means "all data" regardless of other date fields
     * - Predefined intervals recalculate dates to be relative to current time
     * - Custom date ranges preserve the exact dates provided
     *
     * @param settings - Merged settings from all config levels
     * @returns Complete DateTimeContext with ISO dates and interval
     *
     */
    private resolveDateTimeContext;
    /**
     * Resolves the refresh option (LIVE or HISTORY) from legacy configuration.
     *
     * Maps legacy refresh option values to the new binary system:
     * - 'interval' or 'global-interval' → LIVE (auto-refresh enabled)
     * - 'none' → HISTORY (no auto-refresh)
     * - Realtime widgets with any option → LIVE
     * - Default → LIVE
     *
     * @param isRealtime - Whether the widget is in realtime mode
     * @param legacyOption - Legacy refreshOption value if present
     * @returns LIVE or HISTORY refresh option
     *
     */
    private resolveRefreshOption;
    /**
     * Resolves whether auto-refresh should be enabled based on widget configuration.
     *
     * Determines the initial state of the auto-refresh toggle:
     * - Realtime widgets → always enabled
     * - refreshOption='none' → disabled
     * - All other cases → enabled (including interval='none')
     *
     * @param isRealtime - Whether the widget is in realtime mode
     * @param legacyOption - Legacy refreshOption value if present
     * @returns true if auto-refresh should be enabled
     *
     */
    private resolveAutoRefreshEnabled;
    /**
     * Detects if a widget is configured for realtime operation.
     *
     * Realtime widgets continuously update with live data and require special handling
     * with shorter refresh intervals (5 seconds) and LIVE mode.
     *
     * Detection criteria:
     * - Explicit realtime/isRealtime flags
     * - globalRealtimeContext capability + active refresh option
     *
     * @param settings - Widget settings to check
     * @returns true if widget should operate in realtime mode
     *
     */
    private isRealtimeWidget;
    /**
     * Extracts date range from various legacy property formats.
     *
     * Legacy widgets stored dates in multiple ways. This method checks all possible
     * locations and returns the first valid date range found.
     *
     * Priority order:
     * 1. dateFrom + dateTo (most explicit)
     * 2. dateFilter array
     * 3. date array
     *
     * @param settings - Widget settings containing potential date properties
     * @returns Date range object or null if no valid dates found
     *
     */
    private extractLegacyDates;
    /**
     * Calculates the appropriate time interval based on date range duration.
     *
     * Uses the provided interval if valid, otherwise calculates from the date range span:
     * - ≤1 minute → MINUTES
     * - ≤1 hour → HOURS
     * - ≤1 day → DAYS
     * - ≤1 week → WEEKS
     * - ≤1 month → MONTHS
     * - >1 month → CUSTOM
     *
     * Special case: interval='none' → CUSTOM
     *
     * @param dateFrom - Start date as ISO string
     * @param dateTo - End date as ISO string
     * @param providedInterval - Optional interval from legacy config
     * @returns Appropriate TimeInterval enum value
     *
     */
    private calculateInterval;
    /**
     * Resolves and validates a time interval string.
     *
     * @param interval - Interval string to validate
     * @returns Valid TimeInterval or HOURS as default
     *
     */
    private resolveInterval;
    /**
     * Normalizes legacy aggregation values to the new format.
     *
     * Converts legacy 'NONE' string to null (meaning no aggregation).
     *
     * @param value - Legacy aggregation value
     * @returns Normalized aggregationType or null
     *
     */
    private normalizeAggregation;
    /**
     * Checks if an interval is predefined (relative to current time) rather than custom.
     *
     * Predefined intervals (hours, days, etc.) are recalculated relative to current time
     * during migration, while custom intervals preserve their exact date ranges.
     *
     * @param interval - Interval string to check
     * @returns true if interval is predefined (not CUSTOM or 'none')
     *
     */
    private isPredefinedInterval;
    /**
     * Determines if a widget requires a default date/time context to be generated.
     *
     * Returns true when the widget has time-related settings but no explicit date values,
     * indicating it expects time context but didn't provide specific dates.
     *
     * @param settings - Widget settings to evaluate
     * @returns true if default date/time context should be applied
     *
     */
    private needsDefaultDateTimeContext;
    /**
     * Creates a default date/time context for widgets without explicit time configuration.
     *
     * Returns the last hour as a safe default that works for most widgets.
     *
     * @returns DateTimeContext configured for the last hour
     *
     */
    private getDefaultDateTimeContext;
    /**
     * Detects if a configuration contains legacy fields requiring migration.
     *
     * Recursively checks for legacy date fields, refresh options, aggregation values,
     * and nested configurations that need updating.
     *
     * @param config - Configuration object to check
     * @returns true if any legacy fields are found
     *
     */
    private hasLegacyFields;
    /**
     * Check if widget needs refresh settings migration.
     */
    private needsRefreshSettingsMigration;
    /**
     * Validates if a value is a recognized display mode.
     *
     * @param value - Value to validate
     * @returns true if value is a valid GLOBAL_CONTEXT_DISPLAY_MODE
     *
     */
    private isValidDisplayMode;
    /**
     * Validates if a value is a recognized refresh option.
     *
     * @param value - Value to validate
     * @returns true if value is LIVE or HISTORY
     *
     */
    private isValidRefreshOption;
    /**
     * Extracts and merges global context settings from all configuration levels.
     *
     * Legacy widgets stored settings at different nesting levels (root, config, mapConfig).
     * This method extracts relevant settings from all levels and merges them with proper
     * precedence to ensure nothing is missed during migration.
     *
     * Precedence order (highest to lowest):
     * 1. mapConfig (most specific)
     * 2. config (nested level)
     * 3. root level (main config)
     *
     * @param config - Full widget configuration with potential nesting
     * @returns Merged settings object containing all relevant properties
     *
     */
    private extractGlobalContextSettings;
    /**
     * Filters a configuration object to include only global context relevant properties.
     *
     * Reduces noise by extracting only the properties needed for migration decisions,
     * ignoring widget-specific configuration that doesn't affect global context.
     *
     * @param obj - Configuration object to filter
     * @returns Object containing only relevant properties
     *
     */
    private extractRelevantSettings;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<WidgetConfigMigrationService, never>;
    static ɵprov: _angular_core.ɵɵInjectableDeclaration<WidgetConfigMigrationService>;
}

/**
 * Service responsible for validating global context parameters.
 *
 * This service centralizes all validation logic for global context parameters,
 * including intervals, aggregations, date ranges, and boolean values.
 * It provides a single source of truth for validation rules across the application.
 *
 * @example
 * ```typescript
 * constructor(private validationService: GlobalContextValidationService) {}
 *
 * const isValid = this.validationService.isValidInterval('HOURS');
 * const dateRangeValid = this.validationService.isValidDateRange('2024-01-01', '2024-01-02');
 * ```
 */
declare class GlobalContextValidationService {
    private dateTimeContextPickerService;
    /**
     * Validates if the provided interval is selectable and supported.
     *
     * @param interval - The interval to validate
     * @returns True if the interval is valid and selectable, false otherwise
     *
     * @example
     * ```typescript
     * const isValid = validationService.isValidInterval('HOURS'); // true
     * const isInvalid = validationService.isValidInterval('INVALID'); // false
     * ```
     */
    isValidInterval(interval: string | unknown): boolean;
    /**
     * Validates if the provided aggregation type is supported.
     *
     * @param aggregation - The aggregation type to validate
     * @returns True if the aggregation is valid, false otherwise
     *
     * @example
     * ```typescript
     * const isValid = validationService.isValidAggregation(aggregationType.HOURLY); // true
     * const isInvalid = validationService.isValidAggregation('INVALID' as any); // false
     * ```
     */
    isValidAggregation(aggregation: string | unknown): boolean;
    /**
     * Validates if the provided date range is valid.
     *
     * @param dateFrom - The start date of the range
     * @param dateTo - The end date of the range
     * @returns True if the date range is valid, false otherwise
     *
     * @example
     * ```typescript
     * const isValid = validationService.isValidDateRange('2024-01-01', '2024-01-02'); // true
     * const isInvalid = validationService.isValidDateRange('invalid', '2024-01-02'); // false
     * ```
     */
    isValidDateRange(dateFrom: string, dateTo: string): boolean;
    /**
     * Parses a string value to boolean or undefined.
     *
     * Only accepts the exact strings 'true' and 'false'. All other values,
     * including different cases, whitespace, or non-string types return undefined.
     *
     * @param value - The value to parse
     * @returns true for 'true', false for 'false', undefined for all other values
     *
     * @example
     * ```typescript
     * const result1 = validationService.parseBoolean('true');    // true
     * const result2 = validationService.parseBoolean('false');   // false
     * const result3 = validationService.parseBoolean('True');    // undefined
     * const result4 = validationService.parseBoolean(null);      // undefined
     * ```
     */
    parseBoolean(value: string | unknown): boolean | undefined;
    /**
     * Validates multiple parameters at once and returns detailed results.
     *
     * @param params - Object containing parameters to validate
     * @returns Validation results for each parameter
     *
     * @example
     * ```typescript
     * const results = validationService.validateParameters({
     *   interval: 'HOURS',
     *   aggregation: aggregationType.HOURLY,
     *   autoRefresh: 'true'
     * });
     * ```
     */
    validateParameters(params: {
        interval?: string | unknown;
        aggregation?: string | unknown;
        dateFrom?: string | null;
        dateTo?: string | null;
        autoRefresh?: string | unknown;
    }): {
        interval: boolean;
        aggregation: boolean;
        dateRange: boolean;
        autoRefresh: boolean | undefined;
    };
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<GlobalContextValidationService, never>;
    static ɵprov: _angular_core.ɵɵInjectableDeclaration<GlobalContextValidationService>;
}

/**
 * Interface defining the result of aggregation calculation.
 * Contains both the selected aggregation and information about which aggregations are disabled.
 */
interface AggregationCalculationResult {
    /** The selected aggregation type or null if no aggregation is selected */
    readonly selectedAggregation: aggregationType | null;
    /** Map of aggregation types to their disabled state */
    readonly disabledAggregations: Partial<Record<aggregationType, boolean>>;
}
/**
 * AggregationPickerService handles the logic for selecting appropriate data aggregations
 * based on time ranges and user preferences in the global context system.
 *
 * This service focuses on aggregation selection and automatic fallback logic when requested
 * aggregations are not appropriate for the data range. It delegates validation concerns
 * to the AggregationValidationService for better separation of concerns.
 *
 * Key responsibilities:
 * - Calculate optimal aggregation selection for given time ranges and preferences
 * - Handle automatic aggregation selection based on time range thresholds
 * - Provide fallback logic when requested aggregations are invalid
 * - Combine validation results with selection logic for complete aggregation calculation
 *
 * Auto-selection Logic:
 * - Uses AGGREGATION_LIMITS thresholds (10min, 1day, 4days) for fallback selection
 * - Delegates validation to AggregationValidationService
 * - Returns comprehensive results including both selection and validation state
 *
 * @example
 * ```typescript
 * const service = inject(AggregationPickerService);
 *
 * // Calculate aggregation for a 2-day time range
 * const dateRange: [Date, Date] = [
 *   new Date('2024-01-01T00:00:00Z'),
 *   new Date('2024-01-03T00:00:00Z')
 * ];
 *
 * const result = service.calculateAggregation(dateRange, aggregationType.HOURLY);
 * console.log(result.selectedAggregation); // 'HOURLY' (valid for 2-day range)
 * console.log(result.disabledAggregations); // { DAILY: true, HOURLY: false, MINUTELY: false }
 *
 * // Auto-selection when requested aggregation is disabled
 * const shortRange: [Date, Date] = [
 *   new Date('2024-01-01T12:00:00Z'),
 *   new Date('2024-01-01T12:30:00Z') // 30 minutes
 * ];
 *
 * const autoResult = service.calculateAggregation(shortRange, aggregationType.DAILY);
 * // DAILY is disabled for 30min range, so falls back to MINUTELY
 * console.log(autoResult.selectedAggregation); // 'MINUTELY'
 * ```
 */
declare class AggregationPickerService {
    /** Service for validating time ranges against aggregation requirements */
    private readonly validationService;
    /**
     * Calculates the appropriate aggregation for a given time range and user preference.
     *
     * This method validates the time range against aggregation requirements and determines
     * which aggregations should be disabled. If the requested aggregation is not valid
     * for the time range, it automatically selects the most appropriate alternative.
     *
     * Validation Rules:
     * - MINUTELY: Requires time range > 1 minute
     * - HOURLY: Requires time range > 1 hour
     * - DAILY: Requires time range > 1 day
     *
     * Auto-selection Thresholds (when fallback is needed):
     * - >= 4 days: Selects DAILY aggregation
     * - >= 1 day: Selects HOURLY aggregation
     * - >= 10 minutes: Selects MINUTELY aggregation
     * - < 10 minutes: Returns null (no aggregation)
     *
     * @param dateRange - Tuple of [dateFrom, dateTo] defining the time range
     * @param requestedAggregation - User's preferred aggregation type or null for no preference
     * @returns Object containing the selected aggregation and disabled aggregation states
     *
     * @example
     * ```typescript
     * // Valid aggregation request
     * const result = service.calculateAggregation(
     *   [new Date('2024-01-01'), new Date('2024-01-03')], // 2 days
     *   aggregationType.HOURLY
     * );
     * // result.selectedAggregation === 'HOURLY' (valid for 2-day range)
     *
     * // Invalid aggregation request with fallback
     * const fallbackResult = service.calculateAggregation(
     *   [new Date('2024-01-01T12:00'), new Date('2024-01-01T12:30')], // 30 minutes
     *   aggregationType.DAILY // Not valid for 30min range
     * );
     * // fallbackResult.selectedAggregation === 'MINUTELY' (auto-selected)
     *
     * // Explicit null request
     * const nullResult = service.calculateAggregation(
     *   [new Date('2024-01-01'), new Date('2024-01-03')],
     *   null
     * );
     * // nullResult.selectedAggregation === null (as requested)
     * ```
     */
    calculateAggregation([dateFrom, dateTo]: [Date, Date], requestedAggregation: aggregationType | null): AggregationCalculationResult;
    /**
     * Determines the most appropriate aggregation type based on time range duration.
     *
     * Uses predefined thresholds to automatically select the best aggregation type
     * when the requested aggregation is not valid for the time range. This method
     * implements the fallback logic that ensures users always get meaningful aggregations.
     *
     * Selection Logic (based on AGGREGATION_LIMITS):
     * - >= 4 days (DAILY_LIMIT): Select DAILY aggregation
     * - >= 1 day (HOURLY_LIMIT): Select HOURLY aggregation
     * - >= 10 minutes (MINUTELY_LIMIT): Select MINUTELY aggregation
     * - < 10 minutes: Return null (no aggregation appropriate)
     *
     * @param timeRangeInMs - Duration of the time range in milliseconds
     * @returns The most appropriate aggregation type or null if no aggregation is suitable
     *
     * @example
     * ```typescript
     * // Large time range - selects DAILY
     * const dailyResult = service.determineAggregation(5 * 24 * 60 * 60 * 1000); // 5 days
     * // Returns aggregationType.DAILY
     *
     * // Medium time range - selects HOURLY
     * const hourlyResult = service.determineAggregation(2 * 24 * 60 * 60 * 1000); // 2 days
     * // Returns aggregationType.HOURLY
     *
     * // Small time range - selects MINUTELY
     * const minutelyResult = service.determineAggregation(30 * 60 * 1000); // 30 minutes
     * // Returns aggregationType.MINUTELY
     *
     * // Very small time range - no aggregation
     * const nullResult = service.determineAggregation(5 * 60 * 1000); // 5 minutes
     * // Returns null
     * ```
     */
    private determineAggregation;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<AggregationPickerService, never>;
    static ɵprov: _angular_core.ɵɵInjectableDeclaration<AggregationPickerService>;
}

/**
 * AggregationValidationService handles the validation of time ranges against
 * aggregation type requirements in the global context system.
 *
 * This service determines which aggregation types (MINUTELY, HOURLY, DAILY) are valid
 * for a given time range based on predefined business rules. It provides the core
 * validation logic that determines UI state and aggregation availability.
 *
 * Key responsibilities:
 * - Validate time ranges against minimum aggregation requirements
 * - Calculate time range durations in milliseconds
 * - Transform validation results into UI-friendly disabled state maps
 * - Provide consistent validation logic across the application
 *
 * Validation Rules:
 * - MINUTELY: Disabled for time ranges <= 1 minute
 * - HOURLY: Disabled for time ranges <= 1 hour
 * - DAILY: Disabled for time ranges <= 1 day
 *
 * @example
 * ```typescript
 * const validationService = inject(AggregationValidationService);
 *
 * // Validate a 2-hour time range
 * const dateRange: [Date, Date] = [
 *   new Date('2024-01-01T10:00:00Z'),
 *   new Date('2024-01-01T12:00:00Z')
 * ];
 *
 * const disabledAggregations = validationService.getDisabledAggregations(dateRange);
 * console.log(disabledAggregations);
 * // { DAILY: true, HOURLY: false, MINUTELY: false }
 *
 * // Check if specific aggregation is valid
 * const isHourlyValid = validationService.isAggregationValid(dateRange, aggregationType.HOURLY);
 * console.log(isHourlyValid); // true (2 hours > 1 hour requirement)
 * ```
 */
declare class AggregationValidationService {
    /**
     * Determines which aggregation types should be disabled for a given time range.
     *
     * This method validates the time range against all aggregation type requirements
     * and returns a map indicating which aggregations should be disabled in the UI.
     *
     * @param dateRange - Tuple of [dateFrom, dateTo] defining the time range
     * @returns Map of aggregation types to their disabled boolean state
     *
     * @example
     * ```typescript
     * const shortRange: [Date, Date] = [
     *   new Date('2024-01-01T12:00:00Z'),
     *   new Date('2024-01-01T12:30:00Z') // 30 minutes
     * ];
     *
     * const disabled = validationService.getDisabledAggregations(shortRange);
     * // { DAILY: true, HOURLY: true, MINUTELY: false }
     * ```
     */
    getDisabledAggregations([dateFrom, dateTo]: [Date, Date]): Partial<Record<aggregationType, boolean>>;
    /**
     * Checks if a specific aggregation type is valid for the given time range.
     *
     * This method provides a convenient way to check if a single aggregation type
     * meets the minimum time range requirements without needing to validate all types.
     *
     * @param dateRange - Tuple of [dateFrom, dateTo] defining the time range
     * @param aggregation - The aggregation type to validate
     * @returns True if the aggregation is valid for the time range, false if disabled
     *
     * @example
     * ```typescript
     * const oneHourRange: [Date, Date] = [
     *   new Date('2024-01-01T12:00:00Z'),
     *   new Date('2024-01-01T13:00:00Z')
     * ];
     *
     * const isMinutelyValid = validationService.isAggregationValid(oneHourRange, aggregationType.MINUTELY);
     * // true (1 hour > 1 minute requirement)
     *
     * const isDailyValid = validationService.isAggregationValid(oneHourRange, aggregationType.DAILY);
     * // false (1 hour <= 1 day requirement)
     * ```
     */
    isAggregationValid([dateFrom, dateTo]: [Date, Date], aggregation: aggregationType): boolean;
    /**
     * Calculates the time range duration in milliseconds.
     *
     * This method provides a standardized way to calculate time range durations
     * that can be used for validation and threshold comparisons.
     *
     * @param dateFrom - Start date of the range
     * @param dateTo - End date of the range
     * @returns Duration in milliseconds between the two dates
     *
     * @example
     * ```typescript
     * const duration = validationService.getTimeRangeInMs(
     *   new Date('2024-01-01T10:00:00Z'),
     *   new Date('2024-01-01T12:00:00Z')
     * );
     * console.log(duration); // 7200000 (2 hours in milliseconds)
     * ```
     */
    getTimeRangeInMs(dateFrom: Date, dateTo: Date): number;
    /**
     * Validates time ranges against all aggregation type requirements.
     *
     * Determines which aggregation types should be disabled based on the time range duration.
     * Each aggregation type has a minimum time range requirement to be meaningful.
     *
     * Validation Logic:
     * - DAILY: Disabled if time range <= 1 day
     * - HOURLY: Disabled if time range <= 1 hour
     * - MINUTELY: Disabled if time range <= 1 minute
     *
     * @param dateRange - Tuple of [dateFrom, dateTo] to validate
     * @returns Array of aggregation states with their disabled status
     */
    private validateTimeRanges;
    /**
     * Converts aggregation state array to a disabled aggregations map.
     *
     * Transforms the validation results into a map structure that indicates
     * which aggregation types should be disabled in the UI.
     *
     * @param timeRangeValidations - Array of aggregation states from validation
     * @returns Map of aggregation types to their disabled boolean state
     */
    private transformValidationsToDisabledMap;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<AggregationValidationService, never>;
    static ɵprov: _angular_core.ɵɵInjectableDeclaration<AggregationValidationService>;
}

declare class GlobalContextUtilsService {
    /**
     * Compares two objects and returns an object containing only the fields that changed.
     * For nested objects, recursively identifies changes at each level.
     * Converts Date objects to ISO strings for comparison and in the result.
     *
     * @param oldObj - The original object to compare
     * @param newObj - The new object to compare against
     * @returns An object containing only the changed fields and their new values
     * @throws Error if inputs are not valid objects
     */
    getChangedFields<T extends object>(oldObj: T, newObj: T): Partial<T>;
    /**
     * Checks if a value is a Date object
     * @param val - The value to check
     * @returns True if the value is a Date object
     */
    private isDate;
    /**
     * Recursive helper function to find changes between two values
     * @param oldVal - Original value
     * @param newVal - New value to compare against
     * @param visited - Set to track visited objects to avoid circular references
     * @returns The changed value or undefined if no changes
     */
    private findChanges;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<GlobalContextUtilsService, never>;
    static ɵprov: _angular_core.ɵɵInjectableDeclaration<GlobalContextUtilsService>;
}

/**
 * Injection token for registering custom dashboard paths where Global Context should be displayed.
 *
 * Use this token to enable Global Context on named dashboard routes that don't have a
 * `dashboardId` route parameter. Supports `multi: true` to allow multiple providers.
 *
 * @example
 * ```typescript
 * // In app.config.ts or module providers
 * providers: [
 *   {
 *     provide: GLOBAL_CONTEXT_DASHBOARD_PATHS,
 *     useValue: ['dashboard/my-custom-dashboard', 'dashboard/another-dashboard'],
 *     multi: true
 *   }
 * ]
 * ```
 */
declare const GLOBAL_CONTEXT_DASHBOARD_PATHS: InjectionToken<string[]>;
/**
 * Constants defining the supported route paths for global context integration.
 */
declare const ROUTE_PATHS: {
    /** Home route path identifier */
    readonly HOME: "home";
    /** Dashboard route path identifier */
    readonly DASHBOARD: "dashboard";
    /** General route path identifier */
    readonly GENERAL: "general";
    /** Device info route path identifier */
    readonly DEVICE: "device-info";
};
/**
 * Type definition for supported route path values.
 */
type RoutePath = (typeof ROUTE_PATHS)[keyof typeof ROUTE_PATHS];
/**
 * Interface defining the structure of a global context instance.
 * Contains both the ActionBar configuration and metadata about the current route context.
 */
interface GlobalContextInstance {
    /** ActionBar item configuration for rendering the global context component */
    readonly actionBarItem: ActionBarItem;
    /** Source route path that created this instance */
    readonly source: RoutePath | null;
    /** Unique identifier for the source (e.g., dashboard ID) */
    readonly sourceId: string | null;
}
/**
 * GlobalContextNavigationService manages the integration of global context functionality
 * with Angular's routing system and the Cumulocity ActionBar.
 *
 * This service implements the ActionBarFactory interface to provide context-aware
 * global context components in different route contexts (home, dashboard, general).
 * It handles route transitions, manages query parameter cleanup, and maintains
 * instance state across navigation.
 *
 * Key responsibilities:
 * - Determine when and where to show global context components
 * - Manage global context instances across different routes
 * - Handle query parameter cleanup during navigation
 * - Provide ActionBar integration for the global context component
 *
 * @example
 * ```typescript
 * // Service is automatically used by ActionBar system
 * // Get current instance
 * const instance = navigationService.getInstance();
 * console.log(instance.source); // 'home' | 'dashboard' | null
 *
 * // Manual instance management (rarely needed)
 * navigationService.setInstance({
 *   actionBarItem: { component: GlobalContextComponent, placement: 'left' },
 *   source: 'dashboard',
 *   sourceId: 'my-dashboard-id'
 * });
 * ```
 */
declare class GlobalContextNavigationService implements ActionBarFactory {
    /** Service for managing global context query parameters */
    private readonly globalContextQueryService;
    /** Service for accessing route context data */
    private readonly contextRoute;
    /** Angular router for navigation state access */
    private readonly router;
    /**
     * Custom dashboard paths registered via GLOBAL_CONTEXT_DASHBOARD_PATHS injection token.
     * Flattened from multi-provider array.
     */
    private readonly registeredDashboardPaths;
    /** Signal storing the current global context instance configuration */
    private readonly instance;
    /**
     * Determines the appropriate ActionBarItem based on the current route context.
     *
     * This is the main entry point called by the ActionBar system to determine
     * if and how the global context component should be displayed for a given route.
     *
     * Route handling logic:
     * - Home routes: Always show global context
     * - Dashboard routes: Show if valid dashboard ID exists
     * - Device routes: Show if valid device ID exists
     * - General routes: Hide global context
     * - Other routes: Show only if context data is available
     *
     * @param activeRoute - The currently active Angular route
     * @returns ActionBarItem configuration or null if global context should not be shown
     *
     * @example
     * ```typescript
     * // Called automatically by ActionBar system
     * const actionBarItem = navigationService.get(activatedRoute);
     * if (actionBarItem) {
     *   // Global context will be shown in ActionBar
     * }
     * ```
     */
    get(activeRoute: ActivatedRoute): ActionBarItem | null;
    /**
     * Retrieves the current global context instance configuration.
     *
     * The instance contains both the ActionBar configuration and metadata
     * about the current route context that created this instance.
     *
     * @returns Current GlobalContextInstance with ActionBar config and route metadata
     *
     * @example
     * ```typescript
     * const instance = navigationService.getInstance();
     * console.log(instance.source); // 'home', 'dashboard', or null
     * console.log(instance.sourceId); // dashboard ID if applicable
     *
     * // Use ActionBar configuration
     * const actionBarItem = instance.actionBarItem;
     * ```
     */
    getInstance(): GlobalContextInstance;
    /**
     * Sets a new global context instance configuration.
     *
     * This method allows manual control over the global context instance,
     * though it's typically managed automatically by the route handlers.
     * Passing null will reset the instance to default configuration.
     *
     * @param instance - New instance configuration or null to reset to defaults
     *
     * @example
     * ```typescript
     * // Set custom instance
     * navigationService.setInstance({
     *   actionBarItem: {
     *     component: GlobalContextComponent,
     *     placement: 'right'
     *   },
     *   source: 'dashboard',
     *   sourceId: 'custom-dashboard'
     * });
     *
     * // Reset to defaults
     * navigationService.setInstance(null);
     * ```
     */
    setInstance(instance: GlobalContextInstance | null): void;
    /**
     * Handles navigation to home routes.
     *
     * Home routes always display the global context component.
     * Updates the instance if the source has changed.
     *
     * @returns ActionBarItem configuration for home context
     */
    private handleHome;
    /**
     * Handles navigation to dashboard routes.
     *
     * Dashboard routes display global context if:
     * - A valid dashboard ID exists in route params, OR
     * - The route path is registered via GLOBAL_CONTEXT_DASHBOARD_PATHS token
     *
     * Manages query parameter cleanup during dashboard transitions.
     *
     * @param activeRoute - The active route containing dashboard parameters
     * @returns ActionBarItem configuration for dashboard context or null if invalid
     */
    private handleDashboard;
    private handleDevice;
    /**
     * Extracts the current path from an activated route.
     *
     * @param activeRoute - The route to extract path from
     * @returns The first URL segment path or undefined
     */
    private extractCurrentPath;
    /**
     * Extracts dashboard ID from route parameters.
     *
     * @param activeRoute - The route containing dashboard parameters
     * @returns Dashboard ID or undefined if not present
     */
    private extractDashboardId;
    /**
     * Extracts the full route path from URL segments.
     *
     * @param activeRoute - The route to extract path from
     * @returns Full route path (e.g., 'dashboard/my-dashboard') or undefined
     */
    private extractRoutePath;
    /**
     * Checks if a route path is registered as a custom dashboard path.
     *
     * @param routePath - The route path to check
     * @returns True if the path is registered via GLOBAL_CONTEXT_DASHBOARD_PATHS
     */
    private isRegisteredDashboardPath;
    /**
     * Extracts device ID from route parameters.
     *
     * @param activeRoute - The route containing device parameters
     * @returns Device ID or undefined if not present
     */
    private extractDeviceId;
    /**
     * Checks if the current path is a home route.
     *
     * @param path - Path to check
     * @returns True if path is home route
     */
    private isHomePath;
    /**
     * Checks if the current path is a dashboard route.
     * Handles both direct dashboard routes and nested dashboard routes (e.g., group dashboards)
     *
     * @param activeRoute - The active route to check
     * @returns True if this is a dashboard route
     */
    private isDashboardRoute;
    /**
     * Checks if the current path is a dashboard route.
     *
     * @param path - Path to check
     * @returns True if path is dashboard route
     */
    private isDashboardPath;
    private isDevicePath;
    /**
     * Checks if the current path is a general route.
     *
     * @param path - Path to check
     * @returns True if path is general route
     */
    private isGeneralPath;
    /**
     * Handles query parameter cleanup during navigation.
     *
     * Cleans up global context query parameters when:
     * 1. Explicitly requested via navigation state
     * 2. Actually changing contexts (different dashboard/device)
     */
    private handleQueryParamCleanup;
    /**
     * Resets the instance to default configuration.
     */
    private resetInstance;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<GlobalContextNavigationService, never>;
    static ɵprov: _angular_core.ɵɵInjectableDeclaration<GlobalContextNavigationService>;
}

/**
 * Service responsible for managing date context query parameters in the URL.
 *
 * This service provides a centralized way to handle reading, writing, and validation
 * of date context query parameters. It supports both interval-based and date-range-based
 * time contexts, with interval taking precedence when both are present.
 *
 * Key features:
 * - Reactive query parameter changes via observables
 * - Validation of query parameter values
 * - Conversion between query parameters and typed objects
 * - URL navigation with proper parameter handling
 * - Support for both interval and custom date ranges
 *
 * @example
 * ```typescript
 * // Subscribe to query parameter changes
 * queryService.queryParamsChange$().subscribe(params => {
 *   console.log('Date context params:', params);
 * });
 *
 * // Set new query parameters
 * queryService.setDateContextQueryParams({
 *   interval: TIME_INTERVAL.DAYS,
 *   aggregation: aggregationType.HOURLY,
 *   isAutoRefreshEnabled: true,
 *   refreshOption: 'live'
 * });
 *
 * // Get context from current URL
 * const context = queryService.dateTimeContextFromQueryParams();
 * ```
 */
declare class GlobalContextQueryService {
    private activatedRoute;
    private dateTimeContextPickerService;
    private router;
    private validationService;
    /**
     * Stores the state when browser navigation occurs via back/forward buttons.
     * Used to preserve the global context state during browser history navigation
     * to ensure consistency between URL and component state.
     */
    navigationPopState: any;
    /**
     * Returns an observable that emits processed date context query parameters.
     *
     * This observable emits every time the route's query parameters change, providing
     * validated and typed parameter values. Invalid parameter values are automatically
     * filtered out and replaced with null or undefined as appropriate.
     *
     * The emitted object includes:
     * - `dateContextInterval`: Validated interval ID or null
     * - `dateContextAggregation`: Validated aggregation type or null
     * - `globalContextAutoRefresh`: Parsed boolean value or undefined
     * - All other original query parameters (preserved as-is)
     *
     * @returns Observable that emits InputDateContextQueryParams whenever route query params change
     *
     * @example
     * ```typescript
     * // Subscribe to parameter changes
     * queryService.queryParamsChange$().pipe(
     *   takeUntilDestroyed()
     * ).subscribe(params => {
     *   if (params.dateContextInterval) {
     *     console.log('Valid interval:', params.dateContextInterval);
     *   }
     *   if (params.globalContextAutoRefresh === true) {
     *     console.log('Auto-refresh is enabled');
     *   }
     * });
     * ```
     */
    queryParamsChange$(): Observable<InputDateContextQueryParams>;
    /**
     * Creates a global context state object from the current route's query parameters.
     *
     * This method reads the current query parameters and attempts to build a valid
     * GlobalContextState object. It handles validation of parameters and applies
     * business logic for parameter precedence and conflicts.
     *
     * **Parameter Precedence Rules:**
     * 1. **Interval takes precedence**: If a valid interval is provided, any date range
     *    parameters (dateFrom/dateTo) are ignored and recalculated based on the interval
     * 2. **Date range fallback**: If no valid interval is found, the method attempts
     *    to use explicit date range parameters
     * 3. **Partial context**: If only non-temporal parameters are valid (aggregation,
     *    refresh settings), a partial context without dateTimeContext is returned
     *
     * **Validation Logic:**
     * - Intervals are validated through DateTimeContextPickerService.isSelectableInterval()
     * - Date ranges are validated through DateTimeContextPickerService.isValidDateRange()
     * - Boolean parameters are strictly parsed (only 'true'/'false' strings accepted)
     * - Invalid refresh modes default to 'live'
     *
     * @returns Partial GlobalContextState object with valid parameters, or null if no valid context can be built
     *
     * @example
     * ```typescript
     * // With interval parameter: ?dateContextInterval=DAYS&dateContextAggregation=HOURLY
     * const context = queryService.dateTimeContextFromQueryParams();
     * // Returns: {
     * //   aggregation: 'HOURLY',
     * //   dateTimeContext: {
     * //     dateFrom: '2024-01-01T00:00:00.000Z',
     * //     dateTo: '2024-01-02T00:00:00.000Z',
     * //     interval: 'DAYS'
     * //   }
     * // }
     *
     * // With date range: ?dateContextFrom=2024-01-01&dateContextTo=2024-01-02
     * const context2 = queryService.dateTimeContextFromQueryParams();
     * // Returns: {
     * //   dateTimeContext: {
     * //     dateFrom: '2024-01-01',
     * //     dateTo: '2024-01-02',
     * //     interval: 'custom'
     * //   }
     * // }
     *
     * // Invalid parameters
     * const context3 = queryService.dateTimeContextFromQueryParams();
     * // Returns: null
     * ```
     */
    dateTimeContextFromQueryParams(): Partial<GlobalContextState> | null;
    /**
     * Updates the URL query parameters with new date context values.
     *
     * This method translates a context state object into URL query parameters and
     * navigates to update the current route. It handles the mutual exclusivity
     * between interval-based and date-range-based parameters.
     *
     * **Parameter Logic:**
     * - **Interval mode**: When a valid interval is provided (not 'custom'),
     *   date-specific parameters (dateFrom/dateTo) are cleared
     * - **Date range mode**: When interval is 'custom' or undefined,
     *   interval parameter is cleared and date range parameters are set
     * - **Navigation behavior**: Uses 'merge' strategy to preserve other query parameters
     * - **Browser history**: Handles popstate navigation differently than programmatic navigation
     *
     * **Performance Optimization:**
     * The method includes normalization logic to prevent unnecessary navigation
     * when the new parameters would result in the same normalized URL state.
     *
     * @param contextState Object containing the new context state values
     * @param contextState.interval - Time interval ('DAYS', 'HOURS', etc.) or 'custom'
     * @param contextState.date - Array of [dateFrom, dateTo] strings for custom ranges
     * @param contextState.aggregation - Data aggregation type ('HOURLY', 'DAILY', etc.)
     * @param contextState.isAutoRefreshEnabled - Whether auto-refresh should be enabled
     * @param contextState.refreshOption - Refresh mode ('live' or 'history')
     *
     * @example
     * ```typescript
     * // Set interval-based context
     * queryService.setDateContextQueryParams({
     *   interval: TIME_INTERVAL.DAYS,
     *   aggregation: aggregationType.HOURLY,
     *   isAutoRefreshEnabled: true,
     *   refreshOption: 'live'
     * });
     * // Results in: https://example.com/apps/cockpit/#/?dateContextInterval=DAYS&dateContextAggregation=HOURLY&globalContextAutoRefresh=true&globalContextRefreshMode=live
     *
     * // Set custom date range context
     * queryService.setDateContextQueryParams({
     *   interval: TIME_INTERVAL.CUSTOM,
     *   date: ['2024-01-01T00:00:00.000Z', '2024-01-02T00:00:00.000Z'],
     *   aggregation: aggregationType.DAILY,
     *   isAutoRefreshEnabled: false,
     *   refreshOption: 'history'
     * });
     * // Results in: https://example.com/apps/cockpit/#/?dateContextFrom=2024-01-01T00:00:00.000Z&dateContextTo=2024-01-02T00:00:00.000Z&dateContextAggregation=DAILY&globalContextAutoRefresh=false&globalContextRefreshMode=history
     * ```
     */
    setDateContextQueryParams(contextState: DateContextParams): void;
    /**
     * Removes all date context query parameters from the current URL.
     *
     * This method performs a selective cleanup by detecting which date context
     * parameters are currently present in the URL and removing only those.
     * It preserves all non-date-context parameters unchanged.
     *
     * **Behavior:**
     * - **Selective removal**: Only removes parameters that are actually present
     * - **Preserve other params**: Non-date-context parameters remain unchanged
     * - **No-op optimization**: If no date context parameters exist, no navigation occurs
     * - **Merge strategy**: Uses 'merge' queryParamsHandling to maintain other URL state
     *
     * **Parameters removed (if present):**
     * - `dateContextFrom`
     * - `dateContextTo`
     * - `dateContextInterval`
     * - `dateContextAggregation`
     * - `globalContextAutoRefresh`
     * - `globalContextRefreshMode`
     *
     * @example
     * ```typescript
     * // Current URL: https://example.com/apps/cockpit/#/dashboard?dateContextInterval=DAYS&dateContextAggregation=HOURLY&otherParam=value
     * queryService.checkAndRemoveDateContextParams();
     * // Result URL: https://example.com/apps/cockpit/#/dashboard?otherParam=value
     *
     * // Current URL: https://example.com/apps/cockpit/#/dashboard?someOtherParam=value (no date context params)
     * queryService.checkAndRemoveDateContextParams();
     * // Result: No navigation occurs (no-op)
     * ```
     */
    checkAndRemoveDateContextParams(): void;
    /**
     * Gets the current parameter validation status for debugging and UI state management.
     *
     * This method analyzes the current query parameters and returns detailed validation
     * information for each parameter type. Useful for debugging parameter issues and
     * providing user feedback about parameter validity.
     *
     * @returns ParameterValidationStatus object containing validation results for each parameter type
     *
     * @example
     * ```typescript
     * const status = queryService.getParameterValidationStatus();
     *
     * if (!status.interval && !status.dateRange) {
     *   console.warn('No valid time context found in URL parameters');
     * }
     *
     * if (status.autoRefresh === undefined) {
     *   console.info('Auto-refresh parameter not specified or invalid');
     * }
     *
     * // Use for conditional UI rendering
     * const hasValidTimeContext = status.interval || status.dateRange;
     * ```
     */
    getParameterValidationStatus(): ParameterValidationStatus;
    /**
     * Validates if the current query parameters represent a valid global context.
     *
     * This is a convenience method that combines parameter validation with context building
     * to determine if the URL contains sufficient valid parameters to create a global context.
     *
     * @returns True if current parameters can build a valid global context, false otherwise
     *
     * @example
     * ```typescript
     * if (queryService.hasValidContext()) {
     *   const context = queryService.dateTimeContextFromQueryParams();
     *   // Context is guaranteed to be non-null
     * } else {
     *   // Show default state or parameter input form
     * }
     * ```
     */
    hasValidContext(): boolean;
    /**
     * Builds query parameters based on the provided context state.
     * Chooses between interval-based or date-range-based parameters.
     *
     * @param contextState The global context state containing interval, date, aggregation, etc.
     * @returns Record of query parameters to be set in the URL
     */
    private buildQueryParams;
    /**
     * Builds query parameters for interval-based time context.
     * Clears date-specific parameters and sets interval-related ones.
     *
     * @param interval The time interval
     * @param aggregation The aggregation type
     * @param isAutoRefreshEnabled Auto-refresh enabled flag
     * @param refreshOption The refresh option ('live' or 'history')
     * @returns Query parameters object for interval-based context
     */
    private buildIntervalBasedQueryParams;
    /**
     * Builds query parameters for date-range-based time context.
     * Clears interval parameter and sets date-specific ones.
     *
     * @param date Array containing [dateFrom, dateTo] strings or Date objects, or null
     * @param aggregation The aggregation type
     * @param isAutoRefreshEnabled Auto-refresh enabled flag
     * @param refreshOption The refresh option ('live' or 'history')
     * @returns Query parameters object for date-range-based context
     */
    private buildDateRangeBasedQueryParams;
    /**
     * Helper method to navigate with query parameters
     * Centralizes navigation logic for consistent handling across methods
     *
     * @param queryParams The query parameters to set
     * @param options Additional navigation options
     */
    private navigateWithQueryParams;
    /**
     * Parses and validates date context from query params described by date "from" and date "to".
     *
     * @returns Date context as tuple of date "from" and date "to", or null if date context is invalid.
     */
    private getDateContextFromQueryParams;
    /**
     * Maps query params object to proper type with validation.
     *
     * Transforms raw string query parameters into properly typed values,
     * filtering out invalid values and converting boolean strings.
     *
     * @param params Query parameters object with string values only.
     * @returns Query params object of proper type with validated values.
     */
    private processQueryParams;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<GlobalContextQueryService, never>;
    static ɵprov: _angular_core.ɵɵInjectableDeclaration<GlobalContextQueryService>;
}

declare class ConfigurationCollapseComponent {
    readonly REFRESH_OPTION: {
        readonly LIVE: "live";
        readonly HISTORY: "history";
    };
    readonly isCollapsed: _angular_core.WritableSignal<boolean>;
    readonly shouldSave: _angular_core.WritableSignal<boolean>;
    readonly hasPendingChanges: _angular_core.WritableSignal<boolean>;
    readonly activeMode: _angular_core.WritableSignal<RefreshOption>;
    readonly supportedModes: _angular_core.InputSignal<RefreshOption[]>;
    readonly isFormValid: _angular_core.WritableSignal<boolean>;
    readonly helpText: "When checked, saves these settings as the default configuration for this dashboard. If unchecked, changes will only apply for the current session and will reset when you reload the page.";
    private readonly latestContext;
    private readonly snapshots;
    readonly liveViewContext: _angular_core.Signal<GlobalContextState>;
    readonly historyViewContext: _angular_core.Signal<GlobalContextState>;
    set context(value: GlobalContextState);
    readonly contextChange: _angular_core.OutputEmitterRef<Partial<GlobalContextState>>;
    readonly refreshOptionChange: _angular_core.OutputEmitterRef<RefreshOption>;
    readonly savePreferenceChange: _angular_core.OutputEmitterRef<boolean>;
    toggle(): void;
    close(): void;
    onCollapsed(): void;
    onExpanded(): void;
    onModeChange(changes: Partial<GlobalContextState>): void;
    onModeSelected(mode: RefreshOption): void;
    apply(): void;
    shouldSaveInDashboard(change: boolean): void;
    onValidationStatusChange(isValid: boolean): void;
    private resetToLatest;
    private createDefaultContext;
    private recalculatePendingChanges;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<ConfigurationCollapseComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<ConfigurationCollapseComponent, "c8y-configuration-collapse", never, { "supportedModes": { "alias": "supportedModes"; "required": false; "isSignal": true; }; "context": { "alias": "context"; "required": false; }; }, { "contextChange": "contextChange"; "refreshOptionChange": "refreshOptionChange"; "savePreferenceChange": "savePreferenceChange"; }, never, never, true, never>;
}

/**
 * GlobalContextComponent
 *
 * This component manages the global context across the application.
 * It synchronizes state between:
 * - Form UI state (user interactions)
 * - URL parameters (for permalink support)
 * - Dashboard state (for dashboard-specific settings)
 *
 * Key lifecycle phases:
 * 1. Initial load: URL params > Dashboard defaults > Form defaults
 * 2. User interactions: Form > URL params + Dashboard state
 * 3. Dashboard switching: Consider dashboard defaults if no settings
 */
declare class GlobalContextComponent implements AfterViewInit {
    private readonly destroyRef;
    private readonly router;
    private readonly location;
    private readonly activatedRoute;
    private readonly alertService;
    private readonly cd;
    readonly globalContextService: GlobalContextService;
    readonly globalContextEventService: GlobalContextEventService;
    private readonly globalContextFormService;
    private readonly globalContextQueryService;
    private readonly aggregationPickerService;
    private readonly contextDashboardStateService;
    private blockUrlSync;
    private readonly navigationState$;
    private initialUrlParams;
    readonly intervals: Interval[];
    form: ReturnType<typeof this$1.globalContextFormService.buildForm>;
    settings: GlobalContextSettings;
    shouldSaveDashboardState: boolean;
    globalContextState: _angular_core.WritableSignal<GlobalContextState>;
    isVisible: _angular_core.WritableSignal<boolean>;
    configurationCollapseComponent: ConfigurationCollapseComponent;
    constructor();
    ngAfterViewInit(): void;
    onRefresh(): void;
    updateQueryParamsWithoutNavigation(queryParams: Record<string, string | number | boolean | null>): void;
    onChanges(changes: GlobalContextState): void;
    onRefreshOptionChanges(refreshOption: RefreshOption): void;
    getGlobalContextState(): GlobalContextState | null;
    updateGlobalContextState(globalContextState: GlobalContextState): void;
    patchGlobalContextState(partialState: Partial<GlobalContextState>): boolean;
    adjustGlobalState(globalContextState: GlobalContextState): Partial<GlobalContextState>;
    private setupWidgetConfigListener;
    private createNavigationStateStream;
    private setupNavigationHandling;
    private isNavigationInProgress;
    private setupGlobalContextEvents;
    private setupContextHistoryEvents;
    private setupContextLiveEvents;
    private handleNavigationEnd;
    private applyUrlStateIfPresent;
    private handleCustomIntervalRefresh;
    private refreshCustomLiveInterval;
    private refreshCustomHistoryInterval;
    private handleStandardIntervalRefresh;
    private processStateChanges;
    private shouldSetCustomDateTo;
    private extractSaveableState;
    private broadcastStateChanges;
    private scheduleQueryParamSync;
    private saveDashboardStateIfNeeded;
    private isStateUnchanged;
    private emitStateChange;
    private initializeComponent;
    private setupStateSubscriptions;
    private initGlobalContextState;
    private buildInitialState;
    private setupDashboardSubscription;
    private handleDashboardNavigation;
    private isPopstateNavigation;
    private handlePopstateNavigation;
    private setupSettingsSubscription;
    private updateSettings;
    private handleSettingsChange;
    private syncFormStateToQueryParams;
    private buildQueryParamsFromState;
    private getIntervalForQuery;
    private getDateRangeForQuery;
    private getAggregationForQuery;
    private getAutoRefreshForQuery;
    private isCustomInterval;
    private updateDateTimeContext;
    /**
     * Checks if global context should be shown based on dashboard children configuration
     * NOTE: Using DashboardManagedObject instead of ContextDashboardManagedObject
     * to avoid circular dependency issues with the type imports.
     * @param dashboard - The dashboard object containing children
     * @returns true if any child has displayMode set to 'dashboard', false otherwise
     */
    private shouldShowGlobalContextForDashboard;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<GlobalContextComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<GlobalContextComponent, "c8y-global-context", never, {}, {}, never, never, true, never>;
}

declare class GlobalContextInlineComponent implements OnInit, AfterViewInit, OnDestroy {
    private readonly componentId;
    readonly GLOBAL_CONTEXT_DISPLAY_MODE: typeof GLOBAL_CONTEXT_DISPLAY_MODE;
    readonly REFRESH_OPTION: {
        readonly LIVE: "live";
        readonly HISTORY: "history";
    };
    private readonly destroyReference;
    private readonly globalContextService;
    private readonly globalContextEventService;
    private readonly globalContextFormService;
    private readonly aggregationValidationService;
    private readonly orchestrator;
    private readonly injectedDashboardChild;
    widgetControls: _angular_core.InputSignal<WidgetControls>;
    config: _angular_core.InputSignal<GlobalContextState>;
    isLoading: _angular_core.InputSignal<boolean>;
    dashboardChildForLegacy: _angular_core.InputSignal<DashboardChildComponent>;
    /**
     * When true, disables refresh event emissions.
     * Use when widget handles its own data refresh (e.g., via realtime subscriptions).
     */
    disableRefreshEmits: _angular_core.InputSignal<boolean>;
    readonly refresh: _angular_core.OutputEmitterRef<Partial<DateTimeContext>>;
    readonly globalContextChange: _angular_core.OutputEmitterRef<Partial<GlobalContextState>>;
    private inlineOverrides;
    private dashboardOverrides;
    private viewInitCompleted;
    readonly effectiveConfig: _angular_core.Signal<GlobalContextState>;
    private readonly visibilityContext;
    readonly inlineSettings: _angular_core.Signal<{
        showTimeContext?: boolean;
        showAggregation?: boolean;
        showAutoRefresh?: boolean;
        showRefresh?: boolean;
        showRefreshInterval?: boolean;
    }>;
    readonly dashboardControlSettings: _angular_core.Signal<{
        showTimeContext?: boolean;
        showAggregation?: boolean;
        showAutoRefresh?: boolean;
        showRefresh?: boolean;
        showRefreshInterval?: boolean;
    }>;
    readonly controlLinkStatus: _angular_core.Signal<Partial<Record<"dateTimeContext" | "aggregation" | "isAutoRefreshEnabled", boolean>>>;
    readonly disabledAggregations: _angular_core.Signal<Partial<Record<aggregationType, boolean>>>;
    readonly linkDisplayModel: _angular_core.Signal<{
        controlConfig: Partial<Record<"dateTimeContext" | "aggregation" | "isAutoRefreshEnabled", {
            cssClass?: string;
            linkTooltip?: string;
            unlinkTooltip?: string;
            icon?: string;
            disabled?: boolean;
            disabledTooltip?: string;
            autoUnlinked?: boolean;
        }>>;
        linkStates: Partial<Record<"dateTimeContext" | "aggregation" | "isAutoRefreshEnabled", boolean>>;
        showHeaderLinks: boolean;
    }>;
    form: FormGroup;
    shouldDisableCounter: boolean;
    readonly controlLinksConfig: ControlConfigsMap;
    private headerTemplateRef?;
    private registeredHeaderTemplate;
    private registeredDashboardChild;
    private headerEffectRef;
    private linkContextCache;
    constructor();
    getDisabledAggregations(): Partial<Record<aggregationType, boolean>>;
    shouldShowHeaderLinks(): boolean;
    shouldRenderHeaderInline(): boolean;
    getAutoRefreshSeconds(): number | null;
    getIntervalDisableConfig(): Record<string, boolean>;
    ngOnInit(): void;
    ngAfterViewInit(): void;
    ngOnDestroy(): void;
    handleLinkToggle(event: LinkToggleEvent, options?: {
        suppressEmit?: boolean;
        fromHandler?: boolean;
    }): boolean;
    toggleAllLinks(isLinked: boolean, suppressRefresh?: boolean, suppressEmit?: boolean): void;
    updateDateTimeContext(dateTimeContext: any): void;
    /**
     * Pause auto-refresh: sets isAutoRefreshEnabled to false and unlinks all controls.
     * This stops the auto-refresh timer and prevents the widget from receiving
     * updates from the global context.
     *
     * NOTE: Does NOT trigger any refresh or emit - data is already loaded, no updates needed.
     */
    pauseAutoRefresh(): void;
    /**
     * Resume auto-refresh: sets isAutoRefreshEnabled to true and links all controls.
     * This starts the auto-refresh timer and allows the widget to receive
     * updates from the global context.
     *
     * NOTE: Triggers emissions and refresh to sync with the current global context state.
     */
    resumeAutoRefresh(): void;
    triggerHandler(handlerName: string, configOverride?: GlobalContextState | null): void;
    onLocalRefreshTrigger(): void;
    /**
     * Sets the auto-refresh form control value without affecting link states.
     * Used when AngularJS widgets update their config directly (e.g., drag X axis in DPE 1.0).
     * Note: This only updates the form value, NOT calling pauseAutoRefresh() which would
     * also unlink controls and break the global context flow for date changes.
     */
    setAutoRefreshEnabled(enabled: boolean): void;
    private mapToWidgetDisplayMode;
    private applyConfigOverride;
    private buildWidgetState;
    private applyHandlerResult;
    private getFormDateTimeContext;
    private hasValidDateRange;
    private applyRefreshOptionChange;
    private getFieldSources;
    private getLocalState;
    private updateLocalState;
    private getGlobalState;
    private initialize;
    private getInitialDisplayMode;
    private initializeForm;
    private syncFormWithEffectiveConfig;
    private setupWidgetOptions;
    private setupEffects;
    private setupSubscriptions;
    private subscribeToFormChanges;
    private handleFormChange;
    private shouldValidateAggregation;
    private applyFormChangesToLocalState;
    private subscribeToGlobalStateChanges;
    private handleGlobalStateChange;
    private subscribeToGlobalRefreshEvents;
    private isDashboardMode;
    private initializeStateAndSources;
    private handleGlobalRefresh;
    private processRefreshEvent;
    private getShouldDisableIntervalConfig;
    private resolveDashboardChild;
    private updateDashboardHeaderRegistration;
    private cleanupRegisteredHeaderTemplate;
    private removeHeaderFromDashboard;
    private emitBasedOnFieldSources;
    private emitConfiguration;
    private patchFormValues;
    private applyLocalAggregationChange;
    private getRefreshContext;
    private getLinkContext;
    private createLinkContext;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<GlobalContextInlineComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<GlobalContextInlineComponent, "c8y-global-context-inline", ["globalContextInline"], { "widgetControls": { "alias": "widgetControls"; "required": true; "isSignal": true; }; "config": { "alias": "config"; "required": false; "isSignal": true; }; "isLoading": { "alias": "isLoading"; "required": false; "isSignal": true; }; "dashboardChildForLegacy": { "alias": "dashboardChildForLegacy"; "required": false; "isSignal": true; }; "disableRefreshEmits": { "alias": "disableRefreshEmits"; "required": false; "isSignal": true; }; }, { "refresh": "refresh"; "globalContextChange": "globalContextChange"; }, never, ["#header", "#body"], true, never>;
}

/**
 * GlobalContextConfigComponent
 *
 * Presentation + state coordination for the widget's Global Context controls.
 * - Hydrates a component-scoped store from the incoming `config` input.
 * - Renders Live/History configuration controls via `ConfigurationControlsComponent`.
 * - Emits a normalized `GlobalContextState` when user changes either the tab
 *   (refreshOption) or any control value within the current tab.
 * - Does not emit during initial hydrate; emissions only happen on user actions.
 */
declare class GlobalContextConfigComponent {
    private readonly store;
    configInput: _angular_core.InputSignal<GlobalContextState>;
    isLoading: _angular_core.InputSignal<boolean>;
    widgetControls: _angular_core.InputSignal<WidgetControls>;
    liveSnapshotInput: _angular_core.InputSignal<GlobalContextState>;
    historySnapshotInput: _angular_core.InputSignal<GlobalContextState>;
    readonly activeConfig: _angular_core.Signal<GlobalContextState>;
    readonly liveConfig: _angular_core.Signal<GlobalContextState>;
    readonly historyConfig: _angular_core.Signal<GlobalContextState>;
    readonly refreshOption: _angular_core.Signal<RefreshOption>;
    readonly settings: _angular_core.Signal<Partial<GlobalContextSettings>>;
    readonly supportedModes: _angular_core.Signal<RefreshOption[]>;
    isExpanded: boolean;
    readonly refresh: _angular_core.OutputEmitterRef<void>;
    readonly globalContextChange: _angular_core.OutputEmitterRef<GlobalContextState>;
    constructor();
    onConfigurationChanges(changes: Partial<GlobalContextState>): void;
    /** Emits the current normalized active state if available */
    private emitActive;
    private isRefreshOptionChange;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<GlobalContextConfigComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<GlobalContextConfigComponent, "c8y-global-context-config", never, { "configInput": { "alias": "config"; "required": true; "isSignal": true; }; "isLoading": { "alias": "isLoading"; "required": false; "isSignal": true; }; "widgetControls": { "alias": "widgetControls"; "required": true; "isSignal": true; }; "liveSnapshotInput": { "alias": "liveSnapshot"; "required": false; "isSignal": true; }; "historySnapshotInput": { "alias": "historySnapshot"; "required": false; "isSignal": true; }; }, { "refresh": "refresh"; "globalContextChange": "globalContextChange"; }, never, never, true, never>;
}

/**
 * Widget configuration component for time context settings.
 *
 * Allows widgets to either sync with dashboard-level time settings (dashboard mode)
 * or use independent time controls (widget mode). When in widget mode, displays
 * additional configuration controls for time range, aggregation, and refresh settings.
 */
declare class GlobalContextWidgetConfigComponent implements OnInit {
    configInput: _angular_core.InputSignal<GlobalContextState>;
    widgetControlsInput: _angular_core.InputSignal<WidgetControls>;
    isLoadingInput: _angular_core.InputSignal<boolean>;
    readonly displayModeChange: _angular_core.OutputEmitterRef<"dashboard" | "config" | "view_and_config">;
    readonly refresh: _angular_core.OutputEmitterRef<void>;
    readonly globalContextChange: _angular_core.OutputEmitterRef<GlobalContextState>;
    protected form: FormGroup;
    readonly GLOBAL_CONTEXT_DISPLAY_MODE: typeof GLOBAL_CONTEXT_DISPLAY_MODE;
    private readonly fb;
    private readonly destroyRef;
    private readonly globalContextEventService;
    private readonly _latestGlobalSnapshot;
    private readonly _latestConfig;
    private lastConfigInput;
    private readonly liveSnapshotState;
    private readonly historySnapshotState;
    private readonly lastActiveMode;
    readonly displayModeSig: _angular_core.WritableSignal<"dashboard" | "config" | "view_and_config">;
    constructor();
    ngOnInit(): void;
    onGlobalContextChange(newConfig: GlobalContextState): void;
    private initializeForm;
    private storeInitialStateChangeEvent;
    private subscribeToGlobalContextStateChangeEvents;
    private initializeContext;
    private buildContextUpdateForDisplayMode;
    private cloneSnapshot;
    private isMeaningfulState;
    private syncWidgetSnapshotAfterHydration;
    private updateSnapshotForMode;
    get liveSnapshot(): GlobalContextState | null;
    get historySnapshot(): GlobalContextState | null;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<GlobalContextWidgetConfigComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<GlobalContextWidgetConfigComponent, "c8y-global-context-widget-config", never, { "configInput": { "alias": "config"; "required": true; "isSignal": true; }; "widgetControlsInput": { "alias": "widgetControls"; "required": true; "isSignal": true; }; "isLoadingInput": { "alias": "isLoading"; "required": false; "isSignal": true; }; }, { "displayModeChange": "displayModeChange"; "refresh": "refresh"; "globalContextChange": "globalContextChange"; }, never, never, true, never>;
}

interface LinkControlConfig {
    cssClass: string;
    icon?: string;
    label?: string;
    disabled?: boolean;
    disabledTooltip?: string;
    autoUnlinked?: boolean;
}
interface LinkControlInfo extends LinkControlConfig {
    key: string;
    isLinked: boolean;
}

/**
 * Component to display and manage link controls for global context items
 */
declare class GlobalContextLinkControlsComponent implements OnInit {
    allLinksToggled: EventEmitter<boolean>;
    private translateService;
    private _linkStates;
    private linkStatesSignal;
    private controlConfigsSignal;
    showLinks: _angular_core.Signal<boolean>;
    visibleControls: _angular_core.Signal<LinkControlInfo[]>;
    allControlsLinked: _angular_core.Signal<boolean>;
    someControlsLinked: _angular_core.Signal<boolean>;
    masterTooltipText: _angular_core.Signal<string>;
    set linkStates(value: {
        [key: string]: boolean;
    });
    get linkStates(): {
        [key: string]: boolean;
    };
    set controlConfigs(value: Record<string, LinkControlConfig>);
    ngOnInit(): void;
    toggleAll(): void;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<GlobalContextLinkControlsComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<GlobalContextLinkControlsComponent, "c8y-global-context-link-controls", never, { "linkStates": { "alias": "linkStates"; "required": false; }; "controlConfigs": { "alias": "controlConfigs"; "required": false; }; }, { "allLinksToggled": "allLinksToggled"; }, never, never, true, never>;
}

declare class DateTimeContextPickerComponent implements OnInit, ControlValueAccessor {
    disabled: boolean;
    shouldDisableInterval: Record<string, boolean>;
    config: DateTimeContextPickerConfig;
    dropdown?: BsDropdownDirective;
    private readonly service;
    private readonly formBuilder;
    private readonly destroyRef;
    private readonly datePipe;
    private readonly cdr;
    readonly INTERVALS: Record<string, string>;
    readonly DATE_FORMAT = "medium";
    readonly TIME_INTERVAL: {
        readonly NONE: "none";
        readonly MINUTES: "minutes";
        readonly HOURS: "hours";
        readonly DAYS: "days";
        readonly WEEKS: "weeks";
        readonly MONTHS: "months";
        readonly CUSTOM: "custom";
    };
    readonly errorMessages: {
        readonly dateAfterRangeMax: "This date is after the latest allowed date.";
        readonly dateBeforeRangeMin: "This date is before the earliest allowed date.";
        readonly invalidDateTime: "This date is invalid.";
        readonly invalidDateRange: "Start date must be before end date.";
    };
    form: FormGroup;
    tempDateFromControl: FormControl;
    tempDateToControl: FormControl;
    private readonly customSnapshot;
    private readonly isRestoring;
    private readonly canEmit;
    private readonly currentInterval;
    private onChangeCallback?;
    private onTouchedCallback?;
    readonly isCustomMode: _angular_core.Signal<boolean>;
    readonly isEditing: _angular_core.Signal<boolean>;
    ngOnInit(): void;
    writeValue(value: DateTimeContext): void;
    registerOnChange(fn: (value: DateTimeContext) => void): void;
    registerOnTouched(fn: () => void): void;
    setDisabledState(isDisabled: boolean): void;
    onShownDropdown(): void;
    onHiddenDropdown(): void;
    getDateRangeLabel(): string;
    isApplyDisabled(): boolean;
    getDateFromErrors(): _angular_forms.ValidationErrors;
    getDateToErrors(): _angular_forms.ValidationErrors;
    protected applyDateTimeContext(intervalVal?: TimeInterval): void;
    protected reset(): void;
    private setupIntervalChangeHandler;
    private applyCustomDates;
    private updateDates;
    private syncTempControls;
    private normalizeContext;
    private normalizeTimestamp;
    private closeDropdown;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<DateTimeContextPickerComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<DateTimeContextPickerComponent, "c8y-date-time-context-picker", never, { "disabled": { "alias": "disabled"; "required": false; }; "shouldDisableInterval": { "alias": "shouldDisableInterval"; "required": false; }; "config": { "alias": "config"; "required": false; }; }, {}, never, never, true, never>;
}

declare class TimeRangeDisplayComponent {
    REFRESH_OPTION: {
        readonly LIVE: "live";
        readonly HISTORY: "history";
    };
    dateTimeContext: DateTimeContext;
    mode: 'from' | 'to' | 'default';
    dateTo: Date;
    readonly INTERVALS: Record<string, string>;
    readonly DATE_FORMAT = "medium";
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<TimeRangeDisplayComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<TimeRangeDisplayComponent, "c8y-time-range-display", never, { "dateTimeContext": { "alias": "dateTimeContext"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; }, {}, never, never, true, never>;
}

declare class IntervalPickerComponent implements ControlValueAccessor {
    INTERVALS: Interval[];
    shouldDisableInterval: {
        isDisabled: boolean;
        msg: any;
    };
    value: Interval['id'];
    touched: boolean;
    disabled: boolean;
    onChange: (_: any) => void;
    onTouched: () => void;
    writeValue(value: Interval['id']): void;
    registerOnChange(fn: (value: Interval['id']) => void): void;
    registerOnTouched(onTouched: () => void): void;
    markAsTouched(): void;
    onIntervalSelect(intervalId: Interval['id']): void;
    setDisabledState(disabled: boolean): void;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<IntervalPickerComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<IntervalPickerComponent, "c8y-interval-picker", never, { "INTERVALS": { "alias": "INTERVALS"; "required": false; }; "shouldDisableInterval": { "alias": "shouldDisableInterval"; "required": false; }; }, {}, never, never, true, never>;
}

declare class AggregationPickerComponent implements ControlValueAccessor {
    /**
     * Configuration for disabling specific types of aggregation.
     * By default no aggregation type is disabled.
     *
     * Uses input transform to normalize null/undefined to empty object,
     * preventing template errors when accessing properties.
     */
    readonly disabledAggregations: _angular_core.InputSignalWithTransform<Partial<Record<aggregationType, boolean>>, Partial<Record<aggregationType, boolean>>>;
    /**
     *  Whether to reset the aggregation value to default when disabled.
     *  Default is false.
     */
    readonly resetToDefault: _angular_core.InputSignal<boolean>;
    /**
     * Whether to show the aggregation picker options as a radio-group or as a dropdown.
     * Default is dropdown.
     */
    readonly layout: _angular_core.InputSignal<"radio" | "dropdown">;
    private readonly _disabled;
    readonly disabled: _angular_core.Signal<boolean>;
    readonly AGGREGATIONS: Aggregation[];
    readonly AGGREGATION_ICONS: Record<"undefined" | aggregationType, AggregationIconType>;
    readonly AGGREGATION_TEXTS: Record<"undefined" | aggregationType | "null" | "disabled", string>;
    private readonly _value;
    readonly value: _angular_core.Signal<aggregationType>;
    private readonly _touched;
    readonly touched: _angular_core.Signal<boolean>;
    readonly currentText: _angular_core.Signal<string>;
    readonly currentIcon: _angular_core.Signal<AggregationIconType>;
    onChange: (_: any) => void;
    onTouched: () => void;
    writeValue(value: aggregationType | null): void;
    registerOnChange(fn: (value: aggregationType | null) => void): void;
    registerOnTouched(onTouched: () => void): void;
    markAsTouched(): void;
    setDisabledState(disabled: boolean): void;
    selectAggregation(aggregation: aggregationType | null): void;
    private resetValue;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<AggregationPickerComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<AggregationPickerComponent, "c8y-aggregation-picker", never, { "disabledAggregations": { "alias": "disabledAggregations"; "required": false; "isSignal": true; }; "resetToDefault": { "alias": "resetToDefault"; "required": false; "isSignal": true; }; "layout": { "alias": "layout"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}

declare class AggregationDisplayComponent {
    readonly aggregation: _angular_core.InputSignal<aggregationType>;
    readonly AGGREGATION_ICONS: Record<"undefined" | aggregationType, AggregationIconType>;
    readonly AGGREGATION_TEXTS: Record<"undefined" | aggregationType | "null" | "disabled", string>;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<AggregationDisplayComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<AggregationDisplayComponent, "c8y-aggregation-display", never, { "aggregation": { "alias": "aggregation"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}

/**
 * Auto-refresh toggle control with countdown timer.
 *
 * Displays a toggle button that enables/disables automatic refresh with a visual countdown
 * showing time until next refresh. Integrates with Angular forms via ControlValueAccessor.
 */
declare class AutoRefreshControlComponent implements AfterViewInit, OnDestroy, ControlValueAccessor {
    countdownIntervalConfig: {
        enforcePulseIcon: boolean;
    };
    isAutoRefreshConnected: boolean;
    set autoRefreshSeconds(_value: number);
    disableCounter: boolean;
    readonly DISABLE_AUTO_REFRESH: "Auto refresh enabled";
    readonly ENABLE_AUTO_REFRESH: "Auto refresh paused";
    readonly DEFAULT_INTERVAL_VALUE: 5000;
    private countdownComponentReady$;
    private readonly loading$;
    private readonly destroyRef;
    private readonly cdr;
    private gracePeriodTimeout;
    private disabledByTabVisibility;
    isEnabled: boolean;
    private _isLoading;
    set isLoading(value: boolean);
    get isLoading(): boolean;
    countdownIntervalComponent: CountdownIntervalComponent;
    loadingChange: EventEmitter<boolean>;
    refresh: EventEmitter<void>;
    autoRefreshSeconds$: BehaviorSubject<number>;
    onChange: (value: boolean) => void;
    onTouched: () => void;
    ngAfterViewInit(): void;
    ngOnDestroy(): void;
    onVisibilityChange(): void;
    toggleIntervalRefresh(): void;
    registerOnChange(fn: any): void;
    writeValue(showIntervalRefresh: boolean): void;
    registerOnTouched(fn: any): void;
    resetCountdown(): void;
    /**
     * Internal method to change auto-refresh state with proper flag management.
     * @param enabled - New enabled state
     * @param source - Source of the change (External or Visibility)
     */
    private setAutoRefreshEnabled;
    private setupLoadingHandler;
    private setUpOnCountdownEndedListener;
    private handleCountdownEnded;
    private syncCountdownState;
    private clearGracePeriod;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<AutoRefreshControlComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<AutoRefreshControlComponent, "c8y-auto-refresh-control", never, { "isAutoRefreshConnected": { "alias": "isAutoRefreshConnected"; "required": false; }; "autoRefreshSeconds": { "alias": "autoRefreshSeconds"; "required": false; }; "disableCounter": { "alias": "disableCounter"; "required": false; }; "isEnabled": { "alias": "isEnabled"; "required": false; }; "isLoading": { "alias": "isLoading"; "required": false; }; }, { "loadingChange": "loadingChange"; "refresh": "refresh"; }, never, never, true, never>;
}

declare class RealtimeControlComponent implements ControlValueAccessor {
    readonly disableRealtimeLabel: "Disable realtime";
    readonly enableRealtimeLabel: "Enable realtime";
    isActive: boolean;
    touched: boolean;
    disabled: boolean;
    private cdr;
    onChange: (_: any) => void;
    onTouched: () => void;
    writeValue(value: boolean): void;
    registerOnChange(fn: any): void;
    registerOnTouched(onTouched: any): void;
    markAsTouched(): void;
    setDisabledState(disabled: boolean): void;
    onButtonClick(): void;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<RealtimeControlComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<RealtimeControlComponent, "c8y-realtime-control", never, {}, {}, never, never, true, never>;
}

declare class ConfigContextSelectorComponent implements ControlValueAccessor, OnInit {
    private readonly fb;
    private readonly destroyRef;
    protected form: ReturnType<typeof this.initForm>;
    protected get isWidgetContext(): boolean;
    ngOnInit(): void;
    writeValue(value: GlobalContextDisplayMode): void;
    registerOnChange(fn: (value: GlobalContextDisplayMode) => void): void;
    registerOnTouched(fn: () => void): void;
    setDisabledState(isDisabled: boolean): void;
    private onChange;
    private onTouched;
    private initForm;
    private setupValueChanges;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<ConfigContextSelectorComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<ConfigContextSelectorComponent, "c8y-config-context-selector", never, {}, {}, never, never, true, never>;
}

type InlineTab = TabWithTemplate & {
    isActive?: boolean;
};
declare class ConfigurationControlsComponent {
    readonly MODE_LABELS: {
        readonly LIVE: "Live";
        readonly HISTORY: "History";
    };
    readonly MODE_DESCRIPTIONS: {
        readonly LIVE: "Dynamic time window that moves with current time to show recent data.";
        readonly HISTORY: "Fixed time period for analyzing historical data.";
    };
    readonly REFRESH_OPTION: {
        readonly LIVE: "live";
        readonly HISTORY: "history";
    };
    readonly controlsDisplayMode: _angular_core.InputSignal<"horizontal" | "vertical">;
    readonly settings: _angular_core.InputSignal<Partial<GlobalContextSettings>>;
    readonly activeMode: _angular_core.InputSignal<RefreshOption>;
    readonly liveContext: _angular_core.InputSignal<GlobalContextState>;
    readonly historyContext: _angular_core.InputSignal<GlobalContextState>;
    readonly supportedModes: _angular_core.InputSignal<RefreshOption[]>;
    readonly tabsOutletName: _angular_core.InputSignal<string>;
    private readonly liveTabSelect;
    private readonly historyTabSelect;
    readonly refreshOptionChange: _angular_core.OutputEmitterRef<RefreshOption>;
    readonly contextChange: _angular_core.OutputEmitterRef<Partial<GlobalContextState>>;
    readonly validationStatus: _angular_core.OutputEmitterRef<boolean>;
    readonly selectedMode: _angular_core.Signal<RefreshOption>;
    readonly containerClass: _angular_core.Signal<"horizontal d-col" | "d-flex">;
    readonly resolvedOutletName: _angular_core.Signal<string>;
    readonly liveTabTemplate: _angular_core.Signal<TemplateRef<any>>;
    readonly historyTabTemplate: _angular_core.Signal<TemplateRef<any>>;
    readonly inlineTabs: _angular_core.Signal<InlineTab[]>;
    constructor();
    handleTabSelect(mode: RefreshOption): void;
    handleLiveChanges(changes: Partial<GlobalContextState>): void;
    handleHistoryChanges(changes: Partial<GlobalContextState>): void;
    handleValidationStatus(isValid: boolean): void;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<ConfigurationControlsComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<ConfigurationControlsComponent, "c8y-configuration-controls", never, { "controlsDisplayMode": { "alias": "controlsDisplayMode"; "required": false; "isSignal": true; }; "settings": { "alias": "settings"; "required": false; "isSignal": true; }; "activeMode": { "alias": "activeMode"; "required": false; "isSignal": true; }; "liveContext": { "alias": "liveContext"; "required": false; "isSignal": true; }; "historyContext": { "alias": "historyContext"; "required": false; "isSignal": true; }; "supportedModes": { "alias": "supportedModes"; "required": false; "isSignal": true; }; "tabsOutletName": { "alias": "tabsOutletName"; "required": false; "isSignal": true; }; }, { "refreshOptionChange": "refreshOptionChange"; "contextChange": "contextChange"; "validationStatus": "validationStatus"; }, never, never, true, never>;
}

/**
 * Component for configuring live mode settings
 * Stateless component that emits changes immediately
 */
declare class LiveModeConfigurationControlsComponent {
    readonly REFRESH_POPOVER_MESSAGE: "The update method is determined by the widget type. Some widgets support real-time updates via WebSocket connection, while others use periodic refreshes.";
    readonly TIME_RANGE_PICKER_POPOVER: "Sets a rolling time window relative to the current time. As time progresses, the window automatically shifts to maintain the selected duration, always showing the most recent data.";
    private readonly destroyRef;
    private readonly formBuilder;
    private readonly settingsSignal;
    private readonly defaultLiveContext;
    private readonly currentContext;
    set settings(value: Partial<GlobalContextSettings> | null);
    get settings(): Partial<GlobalContextSettings>;
    set context(value: GlobalContextState | null);
    readonly contextChange: _angular_core.OutputEmitterRef<Partial<GlobalContextState>>;
    form: ReturnType<typeof this.createForm>;
    constructor();
    private createForm;
    private patchFormFromContext;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<LiveModeConfigurationControlsComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<LiveModeConfigurationControlsComponent, "c8y-live-mode-configuration-controls", never, { "settings": { "alias": "settings"; "required": false; }; "context": { "alias": "context"; "required": false; }; }, { "contextChange": "contextChange"; }, never, never, true, never>;
}

/**
 * Component for configuring history mode settings
 * Stateless component that emits changes immediately
 */
declare class HistoryModeConfigurationControlsComponent {
    readonly AGGREGATION_TEXTS: Record<"undefined" | aggregationType | "null" | "disabled", string>;
    readonly DATE_FORMAT = "medium";
    readonly errorMessages: {
        readonly dateAfterRangeMax: "This date is after the latest allowed date.";
        readonly dateBeforeRangeMin: "This date is before the earliest allowed date.";
        readonly invalidDateTime: "This date is invalid.";
        readonly invalidDateRange: "Start date must be before end date.";
    };
    readonly TIME_RANGE_PICKER_POPOVER: "Specify the exact start and end date/time of the time period to analyse. This provides a static view of historical data within the selected timeframe.";
    readonly AGGREGATION_POPOVER: "Groups data points into larger time intervals to simplify visualization and improve performance. 'None' shows raw data, while other options combine data points into minute, hour, or day groupings.";
    private readonly destroyRef;
    private readonly formBuilder;
    private readonly aggregationPickerService;
    private readonly settingsSignal;
    private readonly contextState;
    set settings(value: Partial<GlobalContextSettings> | null);
    get settings(): Partial<GlobalContextSettings>;
    set context(value: GlobalContextState | null);
    readonly contextChange: _angular_core.OutputEmitterRef<Partial<GlobalContextState>>;
    readonly validationStatus: _angular_core.OutputEmitterRef<boolean>;
    currentForm: ReturnType<typeof this.createForm>;
    readonly disabledAggregations: _angular_core.WritableSignal<Partial<Record<aggregationType, boolean>>>;
    readonly dateFromErrors: _angular_core.WritableSignal<Record<string, any>>;
    readonly dateToErrors: _angular_core.WritableSignal<Record<string, any>>;
    constructor();
    setDateToNow(): void;
    private updateErrorSignals;
    private handleFormValueChange;
    private isValidDateTimeContext;
    private patchFormFromContext;
    private createForm;
    private getDefaultDateRange;
    private createDateRangeValidator;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<HistoryModeConfigurationControlsComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<HistoryModeConfigurationControlsComponent, "c8y-history-mode-configuration-controls", never, { "settings": { "alias": "settings"; "required": false; }; "context": { "alias": "context"; "required": false; }; }, { "contextChange": "contextChange"; "validationStatus": "validationStatus"; }, never, never, true, never>;
}

/**
 * Context controls component for managing global context state and refresh options.
 *
 * Provides controls for time range, aggregation, and auto-refresh functionality
 * with reactive form handling and optimized change detection.
 *
 * @usageNotes
 *
 * ### Basic Usage
 * ```html
 * <c8y-context-controls
 *   [settings]="globalSettings"
 *   [context]="currentContext"
 *   [isLoading]="loading"
 *   (contextChange)="handleContextChange($event)"
 *   (refresh)="handleRefresh()"
 *   (contextClick)="handleClick($event)">
 * </c8y-context-controls>
 * ```
 *
 */
declare class ContextControlsComponent implements OnInit {
    readonly REFRESH_OPTION: {
        readonly LIVE: "live";
        readonly HISTORY: "history";
    };
    showDisplayModeLabel: boolean;
    isLoading: boolean;
    set settings(value: GlobalContextSettings);
    get settings(): GlobalContextSettings;
    set context(value: GlobalContextState);
    get context(): GlobalContextState;
    contextChange: EventEmitter<Partial<GlobalContextState>>;
    refresh: EventEmitter<void>;
    contextClick: EventEmitter<Event>;
    form: ReturnType<(typeof this.globalContextFormService)['buildForm']>;
    isAnySettingEnabled: boolean;
    refreshOption: RefreshOption;
    isAutoRefreshConnected: boolean;
    private readonly globalContextFormService;
    private readonly destroyRef;
    private readonly cd;
    private readonly _settings;
    private readonly _context;
    private readonly _isAnySettingsEnabled$;
    readonly isAnySettingsEnabled$: Observable<boolean>;
    ngOnInit(): void;
    private initializeForm;
    private setupContextSubscription;
    private setupSettingsSubscription;
    private setupFormValueChanges;
    private extractRelevantSettings;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<ContextControlsComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<ContextControlsComponent, "c8y-context-controls", never, { "showDisplayModeLabel": { "alias": "showDisplayModeLabel"; "required": false; }; "isLoading": { "alias": "isLoading"; "required": false; }; "settings": { "alias": "settings"; "required": false; }; "context": { "alias": "context"; "required": false; }; }, { "contextChange": "contextChange"; "refresh": "refresh"; "contextClick": "contextClick"; }, never, never, true, never>;
}

declare class PreviewControlsComponent implements OnInit {
    readonly GLOBAL_CONTEXT_DISPLAY_MODE: typeof GLOBAL_CONTEXT_DISPLAY_MODE;
    readonly REFRESH_OPTION: {
        readonly LIVE: "live";
        readonly HISTORY: "history";
    };
    form: FormGroup;
    private config$;
    readonly inlineControlsSettings$: BehaviorSubject<Partial<GlobalContextSettings>>;
    shouldDisableCustomInterval: {
        isDisabled: boolean;
        msg: any;
    };
    private readonly destroyRef;
    private readonly globalContextFormService;
    private readonly widgetControlService;
    widgetControls: WidgetControls;
    private _currentConfig;
    set config(value: GlobalContextState);
    get config(): Partial<GlobalContextState> | null;
    ngOnInit(): void;
    /**
     * Returns the current inline controls settings
     */
    getInlineControlsSettings(): Partial<GlobalContextSettings>;
    /**
     * Updates the inline controls settings
     */
    setInlineControlsSettings(settings: Partial<GlobalContextSettings>): void;
    /**
     * Updates visibility of controls based on display mode and widget type
     */
    setControlsVisibility(context?: GlobalContextState): void;
    /**
     * Main initialization logic for the component
     */
    private initializeComponent;
    /**
     * Sets up the initial component state
     */
    private setupComponentState;
    /**
     * Sets up handling for config changes
     */
    private setupConfigChangeHandling;
    /**
     * Builds the reactive form
     */
    private initializeForm;
    /**
     * Sets default display mode if not provided
     */
    private setDefaultDisplayMode;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<PreviewControlsComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<PreviewControlsComponent, "c8y-preview-controls", never, { "widgetControls": { "alias": "widgetControls"; "required": false; }; "config": { "alias": "config"; "required": false; }; }, {}, never, never, true, never>;
}

type WidgetFeature = 'liveRefresh' | 'refreshInterval' | 'timeRange' | 'dataAggregation' | 'displayMode' | 'refreshOption' | (string & {});
/**
 * Maps user-friendly feature names to their corresponding GlobalContextState property names.
 *
 * This allows developers to use intuitive names like 'liveRefresh' in widget control definitions
 * instead of the actual internal property names like 'isAutoRefreshEnabled'.
 *
 * @example
 * ```ts
 * defineWidgetControls({ supports: ['liveRefresh'] });
 * // Internally maps to 'isAutoRefreshEnabled'
 * ```
 */
declare const WIDGET_FEATURE_MAP: Record<string, string>;
/**
 * Hierarchical configuration for widget control visibility and behavior across different contexts.
 *
 * This interface defines control settings organized by:
 * - Display mode (dashboard/config/viewAndConfig)
 * - Refresh option (live/history)
 * - View context (inline/configuration)
 *
 * Each level can specify which controls to show/hide and their default link states to the
 * global context. The structure mirrors how widgets are rendered in different scenarios.
 *
 * @example
 * ```ts
 * const settings: WidgetControlSettings = {
 *   dashboard: {
 *     live: {
 *       inline: { showRefresh: true, showRefreshInterval: false }
 *     }
 *   },
 *   defaultLinks: {
 *     dashboard: {
 *       live: { dateTimeContext: true, aggregation: true }
 *     }
 *   }
 * };
 * ```
 */
interface WidgetControlSettings {
    dashboard?: {
        live?: {
            inline?: Partial<GlobalContextSettings>;
            configuration?: Partial<GlobalContextSettings>;
        };
        history?: {
            inline?: Partial<GlobalContextSettings>;
            configuration?: Partial<GlobalContextSettings>;
        };
    };
    config?: {
        live?: {
            inline?: Partial<GlobalContextSettings>;
            configuration?: Partial<GlobalContextSettings>;
        };
        history?: {
            inline?: Partial<GlobalContextSettings>;
            configuration?: Partial<GlobalContextSettings>;
        };
    };
    viewAndConfig?: {
        live?: {
            inline?: Partial<GlobalContextSettings>;
            configuration?: Partial<GlobalContextSettings>;
        };
        history?: {
            inline?: Partial<GlobalContextSettings>;
            configuration?: Partial<GlobalContextSettings>;
        };
    };
    /**
     * Defines which widget config properties should be linked to global context by default.
     * When a property is linked (true), changes to the global context will automatically
     * update the widget's corresponding configuration value.
     */
    defaultLinks?: {
        dashboard?: {
            live?: LinkStatesMap;
            history?: LinkStatesMap;
        };
        config?: {
            live?: LinkStatesMap;
            history?: LinkStatesMap;
        };
        viewAndConfig?: {
            live?: LinkStatesMap;
            history?: LinkStatesMap;
        };
    };
}
/**
 * Handler function for dynamic widget control behavior based on widget state.
 *
 * Allows custom logic to transform control settings and link states based on the current
 * widget configuration. Handlers receive the widget state and return modified control
 * settings that determine which controls are visible and how they behave.
 *
 * Use cases:
 * - Conditionally show/hide controls based on widget config
 * - Modify default link states based on widget data
 * - Implement widget-specific control behavior
 *
 * @example
 * ```ts
 * const handler: WidgetControlHandler = {
 *   handler: ({ config }) => {
 *     // Hide aggregation control if widget has no series configured
 *     const showAggregation = config?.datapoints?.length > 0;
 *     return {
 *       inlineControlSettings: { !showAggregation },
 *       dashboardControlSettings: { showAggregation },
 *       links: { aggregation: showAggregation }
 *     };
 *   }
 * };
 * ```
 */
interface WidgetControlHandler {
    handler: (state: {
        config?: GlobalContextState;
        inlineControlSettings?: Partial<GlobalContextSettings>;
        dashboardControlSettings?: Partial<GlobalContextSettings>;
        currentLinks?: LinkStatesMap;
    }) => {
        inlineControlSettings: Partial<GlobalContextSettings>;
        dashboardControlSettings: Partial<GlobalContextSettings>;
        links: Partial<LinkStatesMap>;
        options?: {
            noAutoRefreshCounter?: boolean;
        };
    };
}
/**
 * Creates a comprehensive widget controls configuration for global context integration.
 *
 * This factory function generates the complete control structure that determines how a widget
 * interacts with the global context (time range, aggregation, auto-refresh). It handles:
 * - Feature support declaration
 * - Control visibility across different display modes and refresh options
 * - Default linking behavior between widget and global context
 * - Dynamic control behavior through custom handlers
 *
 * @param config - Configuration object for widget controls
 * @param config.name - Optional identifier for debugging and documentation
 * @param config.extends - Base WidgetControls to extend from (inherits all features and settings)
 * @param config.supports - Array of features this widget supports (e.g., ['timeRange', 'dataAggregation'])
 *   When extending, supports are merged with base supports
 * @param config.supportedModes - Optional array of supported refresh modes (live, history).
 *   Restricts which modes are available in the configuration UI. Defaults to both modes if not specified.
 * @param config.settings - Hierarchical control settings organized by display mode, refresh option, and view context
 * @param config.handlers - Named functions for dynamic control behavior based on widget state
 * @param config.options - Additional options like noAutoRefreshCounter
 *
 * @returns Complete WidgetControls object ready for use in widget definitions
 *
 * @example
 * ```ts
 * // Simple widget with time range support
 * const controls = defineWidgetControls({
 *   name: 'simple-widget',
 *   supports: ['timeRange'],
 *   settings: {
 *     dashboard: {
 *       live: {
 *         inline: { showRefresh: true }
 *       }
 *     }
 *   }
 * });
 *
 * // Widget that only supports live mode
 * const liveOnlyControls = defineWidgetControls({
 *   name: 'realtime-widget',
 *   supports: ['timeRange', 'liveRefresh'],
 *   supportedModes: [REFRESH_OPTION.LIVE],
 *   settings: {
 *     dashboard: {
 *       live: {
 *         inline: { showRefresh: true, showRefreshInterval: true }
 *       }
 *     }
 *   }
 * });
 *
 * // Advanced widget extending default with custom handler
 * const advancedControls = defineWidgetControls({
 *   name: 'chart-widget',
 *   extends: DEFAULT_WIDGET_TEMPLATE,
 *   supports: ['timeRange', 'dataAggregation'],
 *   handlers: {
 *     onConfigChange: {
 *       handler: ({ config }) => ({
 *         inlineControlSettings: { showAggregation: config?.series?.length > 0 },
 *         dashboardControlSettings: {},
 *         links: {}
 *       })
 *     }
 *   }
 * });
 * ```
 */
declare function defineWidgetControls(config: {
    name?: string;
    extends?: WidgetControls;
    supports?: WidgetFeature[];
    supportedModes?: RefreshOption[];
    settings?: WidgetControlSettings;
    handlers?: Record<string, WidgetControlHandler>;
    options?: {
        noAutoRefreshCounter?: boolean;
    };
}): WidgetControls;

/**
 * Type alias for handler state parameter used in guards
 * Using WidgetState since GuardState is a subset of it
 */
type GuardState = WidgetState;
/**
 * Guard functions for widget control handlers.
 * These functions help determine conditions for when handlers should execute or return early.
 */
/**
 * Check if the current display mode is dashboard
 */
declare function isDashboard(state: GuardState): boolean;
/**
 * Check if the current display mode is config
 */
declare function isConfig(state: GuardState): boolean;
/**
 * Check if the current display mode is view and config
 */
declare function isViewAndConfig(state: GuardState): boolean;
/**
 * Check if the current refresh option is history
 */
declare function isHistory(state: GuardState): boolean;
/**
 * Check if the current refresh option is live
 */
declare function isLive(state: GuardState): boolean;
/**
 * Check if dateTimeContext is linked
 */
declare function isDateTimeContextLinked(state: GuardState): boolean;
/**
 * Check if dateTimeContext is unlinked
 */
declare function isDateTimeContextUnlinked(state: GuardState): boolean;
/**
 * Check if aggregation is linked
 */
declare function isAggregationLinked(state: GuardState): boolean;
/**
 * Check if aggregation is unlinked
 */
declare function isAggregationUnlinked(state: GuardState): boolean;
/**
 * Check if auto-refresh is enabled (linked)
 */
declare function isAutoRefreshEnabled(state: GuardState): boolean;
/**
 * Check if auto-refresh is disabled (unlinked)
 */
declare function isAutoRefreshDisabled(state: GuardState): boolean;
/**
 * Namespace for all guard functions
 */
declare const guards: {
    readonly isDashboard: typeof isDashboard;
    readonly isConfig: typeof isConfig;
    readonly isViewAndConfig: typeof isViewAndConfig;
    readonly isHistory: typeof isHistory;
    readonly isLive: typeof isLive;
    readonly isDateTimeContextLinked: typeof isDateTimeContextLinked;
    readonly isDateTimeContextUnlinked: typeof isDateTimeContextUnlinked;
    readonly isAggregationLinked: typeof isAggregationLinked;
    readonly isAggregationUnlinked: typeof isAggregationUnlinked;
    readonly isAutoRefreshEnabled: typeof isAutoRefreshEnabled;
    readonly isAutoRefreshDisabled: typeof isAutoRefreshDisabled;
};

/**
 * Updates both inline and dashboard control settings simultaneously.
 *
 * @param state - Current widget state containing existing settings
 * @param inlineUpdates - Settings to apply to inline display mode
 * @param dashboardUpdates - Settings to apply to dashboard display mode
 * @returns Updated inline and dashboard control settings
 */
declare function updateBothSettings(state: WidgetState, inlineUpdates: Partial<GlobalContextSettings>, dashboardUpdates: Partial<GlobalContextSettings>): Pick<WidgetStateHandlerResult, 'inlineControlSettings' | 'dashboardControlSettings'>;
/**
 * Creates a standardized result object for widget state handler responses.
 *
 * @param inlineSettings - Settings for inline display mode
 * @param dashboardSettings - Settings for dashboard display mode
 * @param links - Optional link state mappings for control synchronization
 * @param options - Optional configuration like noAutoRefreshCounter
 * @returns Standardized widget state handler result
 */
declare function createResult(inlineSettings: Partial<GlobalContextSettings>, dashboardSettings: Partial<GlobalContextSettings>, links?: Partial<LinkStatesMap>, options?: Record<string, unknown>): WidgetStateHandlerResult;
/**
 * Sets auto-refresh link state for dashboard display mode.
 *
 * @param state - Current widget state
 * @param enabled - Whether auto-refresh should be linked to global context
 * @returns Updated link states (empty object for non-dashboard modes)
 */
declare function setAutoRefreshLinks(state: WidgetState, enabled: boolean): Partial<LinkStatesMap>;
/**
 * Sets auto-refresh control visibility and link state based on display mode.
 *
 * Implements inverse visibility pattern: auto-refresh is shown in dashboard mode
 * (where it can be linked) and hidden in inline mode (where widgets handle it directly).
 *
 * @param state - Current widget state
 * @param showInDashboard - Whether to show auto-refresh control in dashboard mode (inverted for inline)
 * @returns Complete widget state handler result with settings and links
 */
declare function setAutoRefreshControlsVisibility(state: WidgetState, showInDashboard: boolean): WidgetStateHandlerResult;

declare const DEFAULT_WIDGET_TEMPLATE: WidgetControls;

/**
 * Identifier for a built-in widget controls preset. Each preset encapsulates a
 * reusable configuration that can be composed with others.
 */
type WidgetPresetName = 'default' | 'defaultWithAggregation' | 'scrollHandlers';
/**
 * Union describing how presets can be selected. Consumers can provide an
 * ordered array (preserving order of application) or a flag map where truthy
 * entries are included in insertion order.
 */
type WidgetPresetSelection = WidgetPresetName[] | Partial<Record<WidgetPresetName, boolean>>;
/** Structure supplied when presets should be expanded into `WidgetControls`. */
interface WidgetControlsPresetConfig {
    presets: WidgetPresetSelection;
    customize?: (controls: WidgetControls) => WidgetControls;
}
declare function resolveWidgetControlsInput(input: WidgetControls | WidgetControlsPresetConfig): WidgetControls;
/**
 * Creates a fully hydrated {@link WidgetControls} by expanding the selected
 * presets (and optional customiser) against the default template.
 *
 * @param config Preset selection descriptor optionally providing a customize hook.
 * @returns Fully merged widget controls ready for consumption.
 */
declare function buildWidgetControlsFromPresets(config: WidgetControlsPresetConfig): WidgetControls;

declare class GlobalContextWidgetWrapperComponent implements OnInit {
    widgetBodyRef: TemplateRef<unknown>;
    widgetHeaderRef: TemplateRef<unknown>;
    globalContextInlineComponent: GlobalContextInlineComponent;
    private readonly destroyRef;
    private readonly globalContextUtilsService;
    isLoading: _angular_core.InputSignal<boolean>;
    displayMode: _angular_core.InputSignal<WidgetDisplayMode>;
    readonly widgetControlsConfig: _angular_core.InputSignal<WidgetControls | WidgetControlsPresetConfig>;
    widgetControls: _angular_core.Signal<WidgetControls>;
    controlLinks: _angular_core.InputSignal<Partial<Record<"dateTimeContext" | "aggregation" | "isAutoRefreshEnabled", boolean>>>;
    dashboardChildForLegacy: _angular_core.InputSignal<DashboardChildComponent>;
    config: _angular_core.InputSignal<GlobalContextState>;
    /**
     * When true, disables refresh event emissions.
     * Use when widget handles its own data refresh (e.g., via realtime subscriptions).
     */
    disableRefreshEmits: _angular_core.InputSignal<boolean>;
    internalConfig: WritableSignal<GlobalContextState>;
    private widgetInitialConfig;
    private lastEmittedState;
    globalContextChange: EventEmitter<GlobalContextEvent>;
    private readonly contextChangeSubject;
    readonly GLOBAL_CONTEXT_DISPLAY_MODE: typeof GLOBAL_CONTEXT_DISPLAY_MODE;
    readonly WIDGET_DISPLAY_MODE: {
        readonly INLINE: "inline";
        readonly CONFIG: "config";
        readonly PREVIEW: "preview";
    };
    constructor();
    ngOnInit(): void;
    /**
     * Update dateTimeContext for internal widget interactions (e.g., slider drag).
     * This bypasses the config propagation logic and directly updates the inline component state.
     */
    updateDateTimeContext(dateTimeContext: any): void;
    /**
     * Directly toggle all link controls to linked or unlinked state.
     * All controls are always toggled together as a unified group.
     *
     * @param isLinked - True to link all controls, false to unlink all controls
     * @param suppressRefresh - True to prevent refresh emission (data already loaded)
     * @param suppressEmit - True to prevent configuration change emission
     */
    toggleAllLinks(isLinked: boolean, suppressRefresh?: boolean, suppressEmit?: boolean): void;
    /**
     * Pause auto-refresh and unlink all controls from global context.
     * Useful when user is interacting with the widget (e.g., scrolling through a list)
     * and you want to prevent automatic updates.
     *
     * This does two things:
     * 1. Sets isAutoRefreshEnabled to false (stops the auto-refresh timer)
     * 2. Unlinks all controls (dateTimeContext, aggregation, isAutoRefreshEnabled)
     *    from global context as they work as a unified group
     */
    pauseAutoRefresh(): void;
    /**
     * Resume auto-refresh and re-link all controls to global context.
     * Useful when user has finished interacting with the widget (e.g., scrolled back to top)
     * and you want to re-enable automatic updates.
     *
     * This does two things:
     * 1. Sets isAutoRefreshEnabled to true (starts the auto-refresh timer)
     * 2. Links all controls (dateTimeContext, aggregation, isAutoRefreshEnabled)
     *    to global context as they work as a unified group
     */
    resumeAutoRefresh(): void;
    onGlobalContextChange(context: GlobalContextState): void;
    onRefresh(): void;
    /**
     * Handles incoming config changes from the input, calculates the diff,
     * and updates the internal state.
     */
    private handleConfigChange;
    /**
     * Pure helper function to process the configuration diff, applying special business
     * logic, like handling incomplete dateTimeContext.
     */
    private _processConfigDiff;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<GlobalContextWidgetWrapperComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<GlobalContextWidgetWrapperComponent, "c8y-global-context-widget-wrapper", never, { "isLoading": { "alias": "isLoading"; "required": false; "isSignal": true; }; "displayMode": { "alias": "displayMode"; "required": false; "isSignal": true; }; "widgetControlsConfig": { "alias": "widgetControls"; "required": true; "isSignal": true; }; "controlLinks": { "alias": "controlLinks"; "required": false; "isSignal": true; }; "dashboardChildForLegacy": { "alias": "dashboardChildForLegacy"; "required": false; "isSignal": true; }; "config": { "alias": "config"; "required": false; "isSignal": true; }; "disableRefreshEmits": { "alias": "disableRefreshEmits"; "required": false; "isSignal": true; }; }, { "globalContextChange": "globalContextChange"; }, ["widgetBodyRef", "widgetHeaderRef"], ["*"], true, never>;
}

type DisplayMode = GlobalContextDisplayMode;
/** Context control feature constants for type-safe access */
declare const CONTEXT_FEATURE: {
    /** Time range selector for live mode (relative time window that moves with current time) */
    readonly LIVE_TIME: "liveTime";
    /** Time range selector for history mode (fixed date range for historical analysis) */
    readonly HISTORY_TIME: "historyTime";
    /** Data aggregation options (hourly, daily, etc.) - history mode only */
    readonly AGGREGATION: "aggregation";
    /** Auto-refresh toggle (fixed 5s interval) - live mode only */
    readonly AUTO_REFRESH: "autoRefresh";
    /** Manual refresh button (shown in all modes) */
    readonly REFRESH: "refresh";
    /** Manual refresh button - live mode only */
    readonly REFRESH_LIVE: "refreshLive";
    /** Manual refresh button - history mode only */
    readonly REFRESH_HISTORY: "refreshHistory";
};
type ContextFeature = (typeof CONTEXT_FEATURE)[keyof typeof CONTEXT_FEATURE];
/** Preset name constants for type-safe access */
declare const PRESET_NAME: {
    readonly DEFAULT: "default";
    readonly ALARM_LIST: "alarmList";
    readonly CHART: "chart";
    readonly DATA_TABLE: "dataTable";
    readonly DATA_TABLE_CONFIG: "dataTableConfig";
    readonly LIVE_ONLY: "liveOnly";
    readonly AUTO_REFRESH_ONLY: "autoRefreshOnly";
    readonly AUTO_REFRESH_ONLY_CONFIG: "autoRefreshOnlyConfig";
    readonly HISTORY_ONLY: "historyOnly";
    readonly ALARM_LIST_CONFIG: "alarmListConfig";
    readonly ALARM_LIST_LEGACY: "alarmListLegacy";
    readonly KPI: "kpi";
    readonly KPI_CONFIG: "kpiConfig";
    readonly DATA_POINTS_LIST: "dataPointsList";
    readonly DATA_POINTS_LIST_CONFIG: "dataPointsListConfig";
    readonly DATAPOINTS_GRAPH: "datapointsGraph";
    readonly DATAPOINTS_GRAPH_CONFIG: "datapointsGraphConfig";
};
type PresetName = (typeof PRESET_NAME)[keyof typeof PRESET_NAME];
type PresetDefinition = {
    [GLOBAL_CONTEXT_DISPLAY_MODE.DASHBOARD]: ContextFeature[];
    [GLOBAL_CONTEXT_DISPLAY_MODE.CONFIG]: ContextFeature[];
    [GLOBAL_CONTEXT_DISPLAY_MODE.VIEW_AND_CONFIG]: ContextFeature[];
};
/** Control presets for different widget types (mode constraints applied by applyModeConstraints) */
declare const CONTROL_PRESETS: Record<PresetName, PresetDefinition>;
/**
 * Apply mode constraints (hard rules) to filter controls based on refresh option.
 *
 * @param controls - Array of control features
 * @param refreshOption - Current refresh option (REFRESH_OPTION.LIVE or REFRESH_OPTION.HISTORY)
 * @returns Filtered array with mode constraints applied
 */
declare function applyModeConstraints(controls: ContextFeature[], refreshOption: RefreshOption): ContextFeature[];
/**
 * Get supported modes from a preset definition.
 * Modes are derived from features:
 * - LIVE mode: supported if preset has AUTO_REFRESH (LIVE_TIME is optional)
 * - HISTORY mode: supported if preset has HISTORY_TIME
 *
 * @param controls - Preset name or definition
 * @param displayMode - Current display mode
 * @returns Array of supported refresh options
 */
declare function getSupportedModes(controls: PresetName | PresetDefinition, displayMode: DisplayMode): RefreshOption[];
/**
 * Convert controls preset to GlobalContextSettings for registration.
 */
declare function controlsToSettings(controls: PresetName | PresetDefinition, displayMode: DisplayMode, refreshOption: RefreshOption): Partial<GlobalContextSettings>;

declare class ConfigModeControls implements OnInit {
    private readonly destroyRef;
    private readonly globalContextUtils;
    private readonly globalContextEventService;
    controls: _angular_core.InputSignal<PresetName | PresetDefinition>;
    config: _angular_core.InputSignal<GlobalContextState>;
    configChange: _angular_core.OutputEmitterRef<{
        context: GlobalContextState;
        diff: GlobalContextState;
    }>;
    displayModeControl: FormControl<"dashboard" | "config" | "view_and_config">;
    readonly GLOBAL_CONTEXT_DISPLAY_MODE: typeof GLOBAL_CONTEXT_DISPLAY_MODE;
    displayMode: _angular_core.WritableSignal<"dashboard" | "config" | "view_and_config">;
    refreshOption: _angular_core.WritableSignal<RefreshOption>;
    liveState: _angular_core.WritableSignal<GlobalContextState>;
    historyState: _angular_core.WritableSignal<GlobalContextState>;
    private lastEmittedContext;
    settings: _angular_core.Signal<Partial<GlobalContextSettings>>;
    supportedModes: _angular_core.Signal<RefreshOption[]>;
    constructor();
    ngOnInit(): void;
    onRefreshOptionChange(option: RefreshOption): void;
    onConfigurationChange(changes: Partial<GlobalContextState>): void;
    private emitInitialState;
    private buildNonDashboardContext;
    private emitForDisplayMode;
    /** Emits configChange if the diff contains changes beyond transient flags. */
    private emit;
    private getGlobalContextState;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<ConfigModeControls, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<ConfigModeControls, "c8y-config-mode-controls", never, { "controls": { "alias": "controls"; "required": false; "isSignal": true; }; "config": { "alias": "config"; "required": true; "isSignal": true; }; }, { "configChange": "configChange"; }, never, never, true, never>;
}

declare class GlobalContextConnectorComponent {
    private eventService;
    private globalContextService;
    private globalContextUtils;
    private destroyRef;
    private lastEmittedState;
    controls: _angular_core.InputSignal<PresetName | PresetDefinition>;
    config: _angular_core.InputSignal<GlobalContextState>;
    isLoading: _angular_core.InputSignal<boolean>;
    dashboardChild: _angular_core.InputSignal<DashboardChildComponent>;
    linked: _angular_core.InputSignal<boolean>;
    /** When false, refresh events are not emitted as configChange - only user-initiated state changes */
    emitRefresh: _angular_core.InputSignal<boolean>;
    configChange: _angular_core.OutputEmitterRef<{
        context: GlobalContextState;
        diff: GlobalContextState;
    }>;
    refresh: _angular_core.OutputEmitterRef<void>;
    linkedChange: _angular_core.OutputEmitterRef<boolean>;
    isLinked: _angular_core.WritableSignal<boolean>;
    hasActiveControls: _angular_core.Signal<boolean>;
    constructor();
    onLinkToggle(linked: boolean): void;
    onLocalChange(event: {
        context: GlobalContextState;
        diff: GlobalContextState;
    }): void;
    onLocalRefresh(): void;
    /** Emits configChange if context differs from last emitted state. Returns true if emitted. */
    private emitIfChanged;
    private get componentId();
    private syncExternalLinkState;
    private subscribeToGlobalContext;
    private registerWithGlobalContext;
    private trackLoadingState;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<GlobalContextConnectorComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<GlobalContextConnectorComponent, "c8y-global-context-connector", never, { "controls": { "alias": "controls"; "required": false; "isSignal": true; }; "config": { "alias": "config"; "required": true; "isSignal": true; }; "isLoading": { "alias": "isLoading"; "required": false; "isSignal": true; }; "dashboardChild": { "alias": "dashboardChild"; "required": true; "isSignal": true; }; "linked": { "alias": "linked"; "required": false; "isSignal": true; }; "emitRefresh": { "alias": "emitRefresh"; "required": false; "isSignal": true; }; }, { "configChange": "configChange"; "refresh": "refresh"; "linkedChange": "linkedChange"; }, never, never, true, never>;
}

interface ControlDisplay {
    key: string;
    stateKey: string;
    cssClass: string;
    icon: string;
    label: string;
}
declare class LinkButtonsComponent implements AfterViewInit, OnDestroy {
    private injectedDashboardChild;
    private translateService;
    private headerTemplateRef?;
    dashboardChild: _angular_core.InputSignal<DashboardChildComponent>;
    isLinked: _angular_core.InputSignal<boolean>;
    controls: _angular_core.InputSignal<PresetName | PresetDefinition>;
    config: _angular_core.InputSignal<GlobalContextState>;
    toggle: _angular_core.OutputEmitterRef<boolean>;
    visibleControls: _angular_core.Signal<ControlDisplay[]>;
    masterTooltipText: _angular_core.Signal<string>;
    ngAfterViewInit(): void;
    ngOnDestroy(): void;
    private getDashboardChild;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<LinkButtonsComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<LinkButtonsComponent, "c8y-link-buttons", never, { "dashboardChild": { "alias": "dashboardChild"; "required": false; "isSignal": true; }; "isLinked": { "alias": "isLinked"; "required": true; "isSignal": true; }; "controls": { "alias": "controls"; "required": false; "isSignal": true; }; "config": { "alias": "config"; "required": false; "isSignal": true; }; }, { "toggle": "toggle"; }, never, never, true, never>;
}

declare class LocalControlsComponent {
    controls: _angular_core.InputSignal<PresetName | PresetDefinition>;
    displayMode: _angular_core.InputSignal<"dashboard" | "config" | "view_and_config">;
    config: _angular_core.InputSignal<GlobalContextState>;
    isLoading: _angular_core.InputSignal<boolean>;
    disabled: _angular_core.InputSignal<boolean>;
    emitRefresh: _angular_core.InputSignal<boolean>;
    configChange: _angular_core.OutputEmitterRef<{
        context: GlobalContextState;
        diff: GlobalContextState;
    }>;
    refresh: _angular_core.OutputEmitterRef<void>;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<LocalControlsComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<LocalControlsComponent, "c8y-local-controls", never, { "controls": { "alias": "controls"; "required": false; "isSignal": true; }; "displayMode": { "alias": "displayMode"; "required": false; "isSignal": true; }; "config": { "alias": "config"; "required": true; "isSignal": true; }; "isLoading": { "alias": "isLoading"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "emitRefresh": { "alias": "emitRefresh"; "required": false; "isSignal": true; }; }, { "configChange": "configChange"; "refresh": "refresh"; }, never, never, true, never>;
}

declare class GlobalContextModule {
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<GlobalContextModule, never>;
    static ɵmod: _angular_core.ɵɵNgModuleDeclaration<GlobalContextModule, never, never, never>;
    static ɵinj: _angular_core.ɵɵInjectorDeclaration<GlobalContextModule>;
}

type PartialWidgetControls = Partial<WidgetControls> & {
    supports?: GlobalContextKeys;
};
/**
 * Baseline control template used by most widgets. Mirrors the alarm list
 * widget behaviour and serves as the foundation for additional presets.
 *
 * @returns Partial widget controls describing the baseline template.
 */
declare function buildBaselineControls(): PartialWidgetControls;
/**
 * Adds aggregation visibility and default link behaviour on top of the
 * baseline template.
 *
 * @returns Partial widget controls that enable aggregation.
 */
declare function buildAggregationExtensions(): PartialWidgetControls;
/**
 * Returns a deep-merged copy of the baseline and supplied partial overrides,
 * unionising supported keys and concatenating handlers.
 *
 * @param base Source template to extend.
 * @param addition Additional partial overrides to apply.
 * @returns Combined partial controls.
 */
declare function mergePartialControls(base: PartialWidgetControls, addition: PartialWidgetControls): PartialWidgetControls;
/**
 * Factory returning scroll-friendly auto-refresh handlers used by multiple
 * presets.
 *
 * @returns Handler map compatible with {@link WidgetControls.stateHandlers}.
 */
declare function createAutoRefreshHandlers(): {
    enableAutoRefresh: (state: WidgetState) => WidgetStateHandlerResult;
    disableAutoRefresh: (state: WidgetState) => WidgetStateHandlerResult;
};

/**
 * Central utility for all DateTimeContext operations.
 * Single source of truth for date validation, conversion, and context normalization.
 */
declare class DateTimeContextUtil {
    /**
     * Converts a value to a Date object, handling various input types.
     * Allows JavaScript's natural type coercion for compatibility with existing tests.
     */
    static toDate(value: unknown): Date | null;
    /**
     * Converts a date value to ISO string format.
     */
    static toIso(value: Date | string | null | undefined): string | null;
    /**
     * Normalizes an ISO string to remove milliseconds (sets to .000Z).
     * This ensures date comparisons ignore millisecond precision.
     *
     * @param isoString - ISO date string (e.g., "2025-10-27T15:10:04.405Z")
     * @returns ISO string with milliseconds zeroed (e.g., "2025-10-27T15:10:04.000Z")
     */
    static normalizeIsoToSeconds(isoString: string | null | undefined): string | null;
    /**
     * Validates if a single date value is valid.
     * Only accepts Date objects and valid date strings (not numbers, null, etc.)
     * This is the strict validation used for form inputs and user-facing APIs.
     */
    static isValidDate(value: unknown): boolean;
    /**
     * Validates if a value can be converted to a valid date.
     * Uses JavaScript's natural type coercion, accepting null, numbers, booleans, etc.
     * This is used internally for range validation.
     */
    static isCoercibleToDate(value: unknown): boolean;
    /**
     * Validates if a date range is valid (from < to).
     */
    static isValidRange(from: unknown, to: unknown): boolean;
    /**
     * Validates if a date range is valid, allowing equal dates (from <= to).
     */
    static isValidRangeOrEqual(from: unknown, to: unknown): boolean;
    /**
     * Calculates date range from an interval.
     * Pure implementation based on INTERVALS configuration.
     */
    static dateRangeFromInterval(interval: TimeInterval, now?: Date): [Date, Date] | null;
    /**
     * Ensures all dates in a DateTimeContext are ISO strings with milliseconds normalized to .000Z.
     */
    static ensureIsoContext(ctx: Partial<DateTimeContext>): DateTimeContext;
    /**
     * Normalizes a DateTimeContext for live mode.
     * - For non-custom intervals: recomputes range based on current time
     * - For custom interval: updates dateTo to current time
     */
    static normalizeForLive(ctx: Partial<DateTimeContext>, now?: Date): DateTimeContext;
    /**
     * Normalizes a DateTimeContext for history mode.
     * Forces interval to CUSTOM and preserves explicit date range.
     */
    static normalizeForHistory(ctx: Partial<DateTimeContext>): DateTimeContext;
    /**
     * Type guard to check if a value is a valid DateTimeContext object.
     */
    static isValidDateTimeContext(context: unknown): context is DateTimeContext;
    /**
     * Checks if a partial DateTimeContext has all required fields.
     * Business logic: Allow single field updates or complete updates (all 3 fields),
     * but reject incomplete updates with 2 fields.
     */
    static isCompleteDateTimeContext(diff: Partial<{
        dateTimeContext: Partial<DateTimeContext>;
    }>): boolean;
    /**
     * Formats a context for emission, ensuring ISO dates and filtering by supported fields.
     */
    static formatForEmission(context: Partial<{
        dateTimeContext: Partial<DateTimeContext>;
    }>, supports: string[]): Partial<{
        dateTimeContext: DateTimeContext;
    }>;
}

export { AGGREGATIONS, AGGREGATION_ICONS, AGGREGATION_ICON_TYPE, AGGREGATION_LABELS, AGGREGATION_LIMITS, AGGREGATION_TEXTS, AGGREGATION_VALUES, AGGREGATION_VALUES_ARR, AggregationDisplayComponent, AggregationPickerComponent, AggregationPickerService, AggregationValidationService, AutoRefreshControlComponent, CONTEXT_FEATURE, CONTROL_PRESETS, ConfigContextSelectorComponent, ConfigModeControls, ConfigModeControls as ConfigModeControlsComponent, ConfigurationCollapseComponent, ConfigurationControlsComponent, ContextControlsComponent, DEFAULT_WIDGET_TEMPLATE, DateContextQueryParamNames, DateTimeContextPickerComponent, DateTimeContextPickerService, DateTimeContextUtil, GLOBAL_CONTEXT_DASHBOARD_PATHS, GLOBAL_CONTEXT_DEFAULTS, GLOBAL_CONTEXT_DISPLAY_MODE, GLOBAL_CONTEXT_EVENTS, GLOBAL_CONTEXT_SOURCE, GlobalContextComponent, GlobalContextConfigComponent, GlobalContextConnectorComponent, GlobalContextEventService, GlobalContextFormService, GlobalContextInlineComponent, GlobalContextLinkControlsComponent, GlobalContextModule, GlobalContextNavigationService, GlobalContextQueryService, GlobalContextService, GlobalContextUtilsService, GlobalContextValidationService, GlobalContextWidgetConfigComponent, GlobalContextWidgetWrapperComponent, HistoryModeConfigurationControlsComponent, INTERVALS, INTERVAL_TITLES, IntervalPickerComponent, LINK_BTNS_CONFIG, LinkButtonsComponent, LiveModeConfigurationControlsComponent, LocalControlsComponent, PRESET_NAME, PreviewControlsComponent, REFRESH_OPTION, ROUTE_PATHS, RealtimeControlComponent, TIME_DURATION, TIME_INTERVAL, TIME_SPAN_MS, TIMING, TimeRangeDisplayComponent, UI_PRIORITIES, WIDGET_DISPLAY_MODE, WIDGET_FEATURE_MAP, WidgetConfigMigrationService, WidgetControlService, applyModeConstraints, buildAggregationExtensions, buildBaselineControls, buildWidgetControlsFromPresets, controlsToSettings, createAutoRefreshHandlers, createResult, defineWidgetControls, getSupportedModes, guards, isAggregationLinked, isAggregationUnlinked, isAutoRefreshDisabled, isAutoRefreshEnabled, isConfig, isDashboard, isDateTimeContextLinked, isDateTimeContextUnlinked, isHistory, isLive, isViewAndConfig, mergePartialControls, resolveWidgetControlsInput, setAutoRefreshControlsVisibility, setAutoRefreshLinks, updateBothSettings };
export type { Aggregation, AggregationCalculationResult, AggregationIconType, AggregationOption, AggregationOptionStatus, AggregationState, AlarmFilterInterval, ContextConfig, ContextFeature, ControlConfigsMap, DateContextParams, DateTimeContext, DateTimeContextPickerConfig, DisplayMode, GlobalContextDisplayMode, GlobalContextEvent, GlobalContextEventBase, GlobalContextEventRegistry, GlobalContextEventType, GlobalContextEventUnion, GlobalContextInstance, GlobalContextKeys, GlobalContextSettings, GlobalContextSource, GlobalContextState, GuardState, InputDateContextQueryParams, Interval, LegacyWidgetConfig, LinkStatesMap, LinkToggleEvent, MigrateWidgetConfigOptions, OutputDateContextQueryParams, ParameterValidationStatus, PartialWidgetControls, PresetDefinition, PresetName, RefreshOption, RoutePath, TimeInterval, WidgetControlHandler, WidgetControlSettings, WidgetControls, WidgetControlsPresetConfig, WidgetDisplayMode, WidgetFeature, WidgetPresetName, WidgetPresetSelection, WidgetSettingsResult, WidgetState, WidgetStateHandlerResult };
//# sourceMappingURL=index.d.ts.map
