export class ReactiveControllerHost {
    controllers = new Set();
    addController(controller) {
        this.controllers.add(controller);
    }
    removeController(controller) {
        this.controllers.delete(controller);
    }
    get activeControllers() {
        return Array.from(this.controllers).filter(controller => !controller.disabled);
    }
    connectedCallback() {
        if (!this.controllers.size) {
            console.warn('ReactiveControllerHost connected with no controllers registered.', this);
        }
        this.activeControllers.forEach(controller => controller.hostConnected?.());
    }
    disconnectedCallback() {
        this.activeControllers.forEach(controller => controller.hostDisconnected?.());
    }
    componentWillLoad() {
        this.activeControllers.forEach(controller => controller.hostWillLoad?.());
    }
    componentDidLoad() {
        this.activeControllers.forEach(controller => controller.hostDidLoad?.());
    }
    componentWillRender() {
        this.activeControllers.forEach(controller => controller.hostWillRender?.());
    }
    componentDidRender() {
        this.activeControllers.forEach(controller => controller.hostDidRender?.());
    }
    componentWillUpdate() {
        this.activeControllers.forEach(controller => controller.hostWillUpdate?.());
    }
    componentDidUpdate() {
        this.activeControllers.forEach(controller => controller.hostDidUpdate?.());
    }
}
