class MobileBreakpointController {
    hostConnected() {
        this.host.addEventListener('atomic-layout-breakpoint-change', this.eventListener);
    }
    hostDisconnected() {
        this.host.removeEventListener('atomic-layout-breakpoint-change', this.eventListener);
    }
    handleBreakpointChange(e) {
        const customEvent = e;
        const newBreakpoint = customEvent.detail?.breakpoint;
        if (newBreakpoint && this.store.state.mobileBreakpoint !== newBreakpoint) this.store.state.mobileBreakpoint = newBreakpoint;
    }
    constructor(host, store){
        this.host = host;
        this.store = store;
        this.eventListener = this.handleBreakpointChange.bind(this);
        this.host.addController(this);
    }
}
export { MobileBreakpointController };
