import { isEmpty } from 'lodash';
import { SchemaFieldsState } from './SchemaFieldsState';
export class SchemaCardState {
    constructor(params) {
        if (isEmpty(params.fields)) {
            console.warn('SchemaCardState: `fields` is empty — field persistency will not be enabled.');
        }
        const { componentId, artifactId } = params.container.environment;
        const namespace = [componentId || artifactId, params.persistencyKey].join('.');
        const dataCapsule = params.container._createComponentSettings({
            namespace,
        });
        this.fieldsState = new SchemaFieldsState({
            dataCapsule,
            fields: params.fields,
        });
    }
    init() {
        this.fieldsState.init();
    }
}
//# sourceMappingURL=SchemaCardState.js.map