'use strict';

var index = require('./index-Bc25FxCt.js');

var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
        r = Reflect.decorate(decorators, target, key, desc);
    else
        for (var i = decorators.length - 1; i >= 0; i--)
            if (d = decorators[i])
                r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
/** The `BrandSwitchControllerSlimmer` class monitors brand changes and updates the color, logo and footer content accordingly. */
class BrandSwitchControllerSlimmer extends index.VegaSlimmer {
    constructor() {
        super();
    }
    /**
     * Component lifecycle - [connectedCallback]
     * Register an observer to watch for current branding updates, which will cause the component to update.
     */
    connectedCallback() {
        this.observer = new index.Observer(this.isAcceptObserver.bind(this), (currentBranding) => {
            this.currentBranding = currentBranding;
        });
        index.ChangeManager.register(index.GP_BRAND_CHANGE, this.observer);
    }
    /**
     * cancel dark mode observer when disconnectedCallback
     */
    disconnectResizeObserver() {
        index.ChangeManager.unregister(index.GP_BRAND_CHANGE, this.observer);
    }
    /**
     * Determines whether the observer should accept changes.
     *
     * @returns {boolean} Always returns true in the current implementation.
     */
    isAcceptObserver() {
        return true;
    }
}
__decorate([
    index.MapToComponentField({ writable: true })
], BrandSwitchControllerSlimmer.prototype, "currentBranding", void 0);
__decorate([
    index.MapToComponentMethod('connectedCallback')
], BrandSwitchControllerSlimmer.prototype, "connectedCallback", null);
__decorate([
    index.MapToComponentMethod('disconnectedCallback')
], BrandSwitchControllerSlimmer.prototype, "disconnectResizeObserver", null);

exports.BrandSwitchControllerSlimmer = BrandSwitchControllerSlimmer;
