import { gettext } from '@c8y/ngx-components/gettext';
import { DynamicComponentErrorStrategy, DynamicManagedObjectResolver, hookWidget } from '@c8y/ngx-components';
import { hookWidgetConfig } from '@c8y/ngx-components/context-dashboard';
import { PRESET_NAME } from '@c8y/ngx-components/global-context';
import { defaultWidgetIds } from '@c8y/ngx-components/widgets/definitions';
import { importConfigWithDevice, exportConfigWithDevice } from '@c8y/ngx-components/widgets/import-export-config';

const eventListWidgetDefinition = {
    id: defaultWidgetIds.EVENT_LIST,
    label: gettext('Event list'),
    description: gettext('Displays a list of events filtered by object, type and date'),
    loadComponent: () => import('@c8y/ngx-components/widgets/implementations/events').then(m => m.EventListWidgetComponent),
    loadConfigComponent: () => import('@c8y/ngx-components/widgets/implementations/events').then(m => m.EventListWidgetConfigComponent),
    previewImage: 'c8y-style-assets/event-list-widget.png',
    resolve: {
        device: DynamicManagedObjectResolver
    },
    errorStrategy: DynamicComponentErrorStrategy.OVERLAY_ERROR,
    data: {
        schema: () => import('c8y-schema-loader?interfaceName=EventListWidgetConfig!@c8y/ngx-components/widgets/implementations/events'),
        export: exportConfigWithDevice,
        import: importConfigWithDevice,
        settings: {
            noNewWidgets: false,
            widgetDefaults: {
                _width: 8,
                _height: 6
            },
            ng1: {
                options: {
                    noDeviceTarget: false,
                    groupsSelectable: true,
                    deviceTargetNotRequired: true
                }
            }
        },
        displaySettings: {
            globalTimeContext: true,
            globalAutoRefreshContext: true
        }
    }
};
const eventListWidgetProviders = [
    hookWidget(eventListWidgetDefinition),
    hookWidgetConfig({
        widgetId: defaultWidgetIds.EVENT_LIST,
        priority: 90,
        label: gettext('Time context'),
        initialState: {
            controls: PRESET_NAME.LIFETIME_LIST_CONFIG
        },
        loadComponent: () => import('@c8y/ngx-components/context-dashboard').then(m => m.GlobalContextSectionComponent)
    })
];

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

export { eventListWidgetDefinition, eventListWidgetProviders };
//# sourceMappingURL=c8y-ngx-components-widgets-definitions-event-list.mjs.map
