import { GridBaseState, gridSizePresets, topGridSizePreset, } from '../../state';
import { computed, makeObservable } from 'mobx';
export class GridSectionsSectionState {
    constructor(params) {
        this.gridSections = params.gridSections;
        this.sectionDescriptor = params.sectionDescriptor;
        const { imagePlacement, draggable, layoutType } = params;
        const { toolbar } = this.gridSections;
        this.gridBase = new GridBaseState({
            container: toolbar.container,
            toolbar: toolbar,
            collection: toolbar.collection,
            sizePreset: imagePlacement
                ? gridSizePresets[imagePlacement]
                : topGridSizePreset,
            range: params.sectionDescriptor.range,
            parentState: this.gridSections.parentState,
            layoutType,
            draggable,
        });
        makeObservable(this, {
            isLast: computed,
        });
    }
    get isLast() {
        const { sectionDescriptor: { sectionId }, gridSections: { sections }, } = this;
        return sections[sections.length - 1]?.sectionId === sectionId;
    }
}
//# sourceMappingURL=GridSectionsSectionState.js.map