import { UMB_BLOCK_LIST_MANAGER_CONTEXT } from './block-list-manager.context-token.js';
import { UMB_BLOCK_LIST_ENTRIES_CONTEXT } from './block-list-entries.context-token.js';
import { UmbBlockEntryContext } from '../../block/index.js';
import { UmbBooleanState, mergeObservables } from '../../../../libs/observable-api/index.js';
export class UmbBlockListEntryContext extends UmbBlockEntryContext {
    #inlineEditingMode;
    #isSortMode;
    constructor(host) {
        super(host, UMB_BLOCK_LIST_MANAGER_CONTEXT, UMB_BLOCK_LIST_ENTRIES_CONTEXT);
        this.#inlineEditingMode = new UmbBooleanState(undefined);
        this.inlineEditingMode = this.#inlineEditingMode.asObservable();
        this.forceHideContentEditorInOverlay = this._blockType.asObservablePart((x) => x ? (x.forceHideContentEditorInOverlay ?? false) : undefined);
        this.showContentEdit = mergeObservables([this._contentStructureHasProperties, this.forceHideContentEditorInOverlay, this.inlineEditingMode], ([a, b, c]) => {
            return a === true && b === false && c === false;
        });
        this.#isSortMode = new UmbBooleanState(undefined);
        this.isSortMode = this.#isSortMode.asObservable();
    }
    _gotManager() {
        if (!this._manager)
            return;
        this.observe(this._manager.inlineEditingMode, (inlineEditingMode) => this.#inlineEditingMode.setValue(inlineEditingMode), 'observeInlineEditingMode');
        this.observe(this._manager.isSortMode, (isSortMode) => this.#isSortMode.setValue(isSortMode ?? false), 'observeIsSortMode');
    }
    _gotEntries() { }
    _gotContentType() { }
}
