import { clone, mapObject } from '../../utils/utils.js';
import { ControllerBuilder } from './builders/controller-builder.js';
import { createStaticControllerBuilder } from './builders/static-controller-builder.js';
export function buildControllerDefinitions({ definitionsMap, engine, propsMap, }) {
    return mapObject(definitionsMap, (definition, key) => {
        const props = propsMap?.[key];
        return new ControllerBuilder(definition, engine, props).build();
    });
}
export function createStaticState({ searchAction, controllers, }) {
    return {
        controllers: mapObject(controllers, (controller) => createStaticControllerBuilder(controller).build()),
        searchAction: clone(searchAction),
    };
}
