/**
 * @license
 * Copyright Tyler Technologies, Inc. 
 * License: Apache-2.0
 */
import { __decorate } from "tslib";
import { coerceBoolean, FoundationProperty } from '@tylertech/forge-core';
import { BaseComponent } from '../../core/base/base-component';
import { OVERLAY_CONSTANTS } from '../overlay-constants';
import { coerceStringToArray } from '../../core/utils';
export class BaseOverlay extends BaseComponent {
    constructor() {
        super();
    }
    position() {
        this._foundation.position();
    }
    attributeChangedCallback(name, _oldValue, newValue) {
        switch (name) {
            case OVERLAY_CONSTANTS.observedAttributes.ANCHOR:
                this.anchor = newValue;
                break;
            case OVERLAY_CONSTANTS.observedAttributes.NO_ANCHOR:
                this.noAnchor = coerceBoolean(newValue);
                break;
            case OVERLAY_CONSTANTS.observedAttributes.OPEN:
                this.open = coerceBoolean(newValue);
                break;
            case OVERLAY_CONSTANTS.observedAttributes.INLINE:
                this.inline = coerceBoolean(newValue);
                break;
            case OVERLAY_CONSTANTS.observedAttributes.PLACEMENT:
                this.placement = newValue;
                break;
            case OVERLAY_CONSTANTS.observedAttributes.POSITION_STRATEGY:
                this.positionStrategy = newValue;
                break;
            case OVERLAY_CONSTANTS.observedAttributes.HIDE:
                this.hide = newValue;
                break;
            case OVERLAY_CONSTANTS.observedAttributes.PERSISTENT:
                this.persistent = coerceBoolean(newValue);
                break;
            case OVERLAY_CONSTANTS.observedAttributes.SHIFT:
                this.shift = coerceBoolean(newValue);
                break;
            case OVERLAY_CONSTANTS.observedAttributes.FLIP:
                this.flip = newValue;
                break;
            case OVERLAY_CONSTANTS.observedAttributes.BOUNDARY:
                this.boundary = newValue;
                break;
            case OVERLAY_CONSTANTS.observedAttributes.FALLBACK_PLACEMENTS:
                this.fallbackPlacements = (newValue === null || newValue === void 0 ? void 0 : newValue.trim()) ? coerceStringToArray(newValue) : null;
                break;
        }
    }
}
__decorate([
    FoundationProperty()
], BaseOverlay.prototype, "anchorElement", void 0);
__decorate([
    FoundationProperty()
], BaseOverlay.prototype, "anchor", void 0);
__decorate([
    FoundationProperty()
], BaseOverlay.prototype, "noAnchor", void 0);
__decorate([
    FoundationProperty()
], BaseOverlay.prototype, "open", void 0);
__decorate([
    FoundationProperty()
], BaseOverlay.prototype, "inline", void 0);
__decorate([
    FoundationProperty()
], BaseOverlay.prototype, "placement", void 0);
__decorate([
    FoundationProperty()
], BaseOverlay.prototype, "positionStrategy", void 0);
__decorate([
    FoundationProperty()
], BaseOverlay.prototype, "offset", void 0);
__decorate([
    FoundationProperty()
], BaseOverlay.prototype, "shift", void 0);
__decorate([
    FoundationProperty()
], BaseOverlay.prototype, "hide", void 0);
__decorate([
    FoundationProperty()
], BaseOverlay.prototype, "persistent", void 0);
__decorate([
    FoundationProperty()
], BaseOverlay.prototype, "flip", void 0);
__decorate([
    FoundationProperty()
], BaseOverlay.prototype, "boundary", void 0);
__decorate([
    FoundationProperty()
], BaseOverlay.prototype, "boundaryElement", void 0);
__decorate([
    FoundationProperty()
], BaseOverlay.prototype, "fallbackPlacements", void 0);
__decorate([
    FoundationProperty()
], BaseOverlay.prototype, "auto", void 0);
