/**
 * @license
 * Copyright 2023 Tyler Technologies, Inc. 
 * License: Apache-2.0
 */
import { __decorate } from "tslib";
import { coerceBoolean, CustomElement, FoundationProperty } from '@tylertech/forge-core';
import { BaseComponent } from '../core/base/base-component';
import { RippleAdapter } from './ripple-adapter';
import { RIPPLE_CONSTANTS } from './ripple-constants';
import { RippleFoundation } from './ripple-foundation';
/**
 * The web component class behind the `<forge-ripple>` custom element.
 *
 * @tag forge-ripple
 */
let RippleComponent = class RippleComponent extends BaseComponent {
    constructor() {
        super();
        this._foundation = new RippleFoundation(new RippleAdapter(this));
    }
    static get observedAttributes() {
        return [
            RIPPLE_CONSTANTS.attributes.TARGET,
            RIPPLE_CONSTANTS.attributes.UNBOUNDED
        ];
    }
    connectedCallback() {
        this._foundation.initialize();
    }
    disconnectedCallback() {
        this._foundation.disconnect();
    }
    attributeChangedCallback(name, oldValue, newValue) {
        switch (name) {
            case RIPPLE_CONSTANTS.attributes.TARGET:
                this.target = newValue;
                break;
            case RIPPLE_CONSTANTS.attributes.UNBOUNDED:
                this.unbounded = coerceBoolean(newValue);
                break;
        }
    }
    layout() {
        this._foundation.layout();
    }
    activate() {
        return this._foundation.activate();
    }
    deactivate() {
        return this._foundation.deactivate();
    }
};
__decorate([
    FoundationProperty()
], RippleComponent.prototype, "target", void 0);
__decorate([
    FoundationProperty()
], RippleComponent.prototype, "unbounded", void 0);
RippleComponent = __decorate([
    CustomElement({
        name: RIPPLE_CONSTANTS.elementName
    })
], RippleComponent);
export { RippleComponent };
