import { UMB_USER_DETAIL_STORE_CONTEXT } from './detail/user-detail.store.token.js';
import { UMB_USER_ITEM_STORE_CONTEXT } from './item/user-item.store.token.js';
import { UMB_NOTIFICATION_CONTEXT } from '../../../core/notification/index.js';
import { UmbRepositoryBase } from '../../../core/repository/index.js';
export class UmbUserRepositoryBase extends UmbRepositoryBase {
    constructor(host) {
        super(host);
        this.init = Promise.all([
            this.consumeContext(UMB_USER_DETAIL_STORE_CONTEXT, (instance) => {
                this.detailStore = instance;
            })
                .asPromise({ preventTimeout: true })
                // Ignore the error, we can assume that the flow was stopped (asPromise failed), but it does not mean that the consumption was not successful.
                .catch(() => undefined),
            this.consumeContext(UMB_USER_ITEM_STORE_CONTEXT, (instance) => {
                this.itemStore = instance;
            })
                .asPromise({ preventTimeout: true })
                .catch(() => undefined),
            this.consumeContext(UMB_NOTIFICATION_CONTEXT, (instance) => {
                this.notificationContext = instance;
            })
                .asPromise({ preventTimeout: true })
                .catch(() => undefined),
        ]);
    }
}
