import { gettext } from '@c8y/ngx-components/gettext';
import { DynamicComponentErrorStrategy, DynamicManagedObjectResolver, hookWidget } from '@c8y/ngx-components';
import { hookWidgetConfig } from '@c8y/ngx-components/context-dashboard';
import { defaultWidgetIds } from '@c8y/ngx-components/widgets/definitions';
import { importConfigWithDevice, exportConfigWithDevice } from '@c8y/ngx-components/widgets/import-export-config';
import { createLegacyAlarmControls } from '@c8y/ngx-components/widgets/definitions/alarms/alarm-widget-controls.presets';

const CRITICAL_ALARM_CONTROLS = createLegacyAlarmControls();
const criticalAlarmsWidgetDefinition = {
    id: defaultWidgetIds.ALL_CRITICAL_ALARMS,
    label: gettext('All critical alarms'),
    description: gettext(`Display all critical alarms from all devices`),
    loadComponent: () => import('@c8y/ngx-components/widgets/implementations/alarms').then(m => m.AlarmListWidgetComponent),
    loadConfigComponent: () => import('@c8y/ngx-components/widgets/implementations/alarms').then(m => m.AlarmListWidgetConfigComponent),
    resolve: {
        device: DynamicManagedObjectResolver
    },
    errorStrategy: DynamicComponentErrorStrategy.OVERLAY_ERROR,
    data: {
        schema: () => import('c8y-schema-loader?interfaceName=AlarmListWidgetConfig!@c8y/ngx-components/widgets/implementations/alarms'),
        export: exportConfigWithDevice,
        import: importConfigWithDevice,
        widgetControls: CRITICAL_ALARM_CONTROLS,
        settings: {
            criticalAlarmsWidget: true,
            noNewWidgets: true,
            widgetDefaults: {
                _width: 4,
                _height: 4
            },
            ng1: {
                options: {
                    noDeviceTarget: false,
                    groupsSelectable: true,
                    deviceTargetNotRequired: true
                }
            }
        },
        displaySettings: {
            globalAutoRefreshContext: true
        }
    }
};
const criticalAlarmsWidgetProviders = [
    hookWidget(criticalAlarmsWidgetDefinition),
    hookWidgetConfig({
        widgetId: defaultWidgetIds.ALL_CRITICAL_ALARMS,
        priority: 10,
        label: gettext('Time context'),
        initialState: {
            widgetControls: CRITICAL_ALARM_CONTROLS
        },
        loadComponent: () => import('@c8y/ngx-components/context-dashboard').then(m => m.GlobalContextSectionComponent)
    })
];

/**
 * Generated bundle index. Do not edit.
 */

export { criticalAlarmsWidgetDefinition, criticalAlarmsWidgetProviders };
//# sourceMappingURL=c8y-ngx-components-widgets-definitions-alarms-all-critical-alarms.mjs.map
