import { UmbUserConfigRepository } from '../../repository/config/index.js';
import { UmbConditionBase, umbExtensionsRegistry } from '../../../../core/extension-registry/index.js';
import { observeMultiple } from '../../../../../libs/observable-api/index.js';
export class UmbUserAllowMfaActionCondition extends UmbConditionBase {
    #configRepository = new UmbUserConfigRepository(this._host);
    // eslint-disable-next-line @typescript-eslint/no-explicit-any
    constructor(host, args) {
        super(host, args);
        this.#init();
    }
    async #init() {
        await this.#configRepository.initialized;
        this.observe(observeMultiple([
            this.#configRepository.part('allowTwoFactor'),
            umbExtensionsRegistry.byType('mfaLoginProvider'),
        ]), ([allowTwoFactor, exts]) => {
            this.permitted = allowTwoFactor && exts.length > 0;
        }, '_userAllowMfaActionCondition');
    }
}
export { UmbUserAllowMfaActionCondition as api };
