import { UMB_STATIC_FILE_PICKER_MODAL } from '../../modals/index.js';
import { UMB_STATIC_FILE_ITEM_REPOSITORY_ALIAS } from '../../constants.js';
import { UmbPickerInputContext } from '../../../core/picker-input/index.js';
import { UmbServerFilePathUniqueSerializer } from '../../../core/server-file-system/index.js';
export class UmbStaticFilePickerInputContext extends UmbPickerInputContext {
    #serializer = new UmbServerFilePathUniqueSerializer();
    constructor(host) {
        super(host, UMB_STATIC_FILE_ITEM_REPOSITORY_ALIAS, UMB_STATIC_FILE_PICKER_MODAL);
    }
    async _requestItemName(unique) {
        // If item doesn't exist, use the file path as the name
        const item = this.getSelectedItemByUnique(unique);
        return item?.name ?? this.#serializer.toServerPath(unique) ?? unique;
    }
}
