// #region Imports
var __decorate = (this && this.__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;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
import { Attachable } from '../../../Behaviors/Attachable';
import { Disableable } from '../../../Behaviors/Disableable';
import { Attribute } from '../../../Decorators/AttributeDecorator';
import { Component } from '../../../Decorators/ComponentDecorator';
import { Watch } from '../../../Decorators/WatchDecorator';
import { ElevationWeight } from '../../../Types/ElevationWeight';
import { CustomElement } from '../../Abstracts/CustomElement';
import { elevationElementTemplate } from './ElevationElementTemplate';
import { elevationElementJoyStyle } from './Themes/ElevationElement.Joy';
import { elevationElementRetroStyle } from './Themes/ElevationElement.Retro';
import { elevationElementCosmopolitanStyle } from './Themes/ElevationElement.Cosmopolitan';
import { Themeable } from '../../../Behaviors/Themeable';
// #endregion
/**
 * Elevation - A visual effect indicating the depth of an element relative to its surroundings.
 *
 * @element mosaik-elevation
 *
 * @description
 * Elevation is a design technique used to create a sense of depth and hierarchy in a user interface.
 * Elements with higher elevation appear to be physically closer to the viewer, while elements with lower
 * elevation appear further away. Elevation is often used to highlight and differentiate elements, such as
 * cards, dialogs, and buttons, within a layout.
 *
 * @category Visual Effects
 *
 * @public
 */
let ElevationElement = class ElevationElement extends Themeable(Disableable(Attachable(CustomElement))) {
    // #region Fields
    _weigh;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        this._weigh = ElevationWeight.None;
    }
    // #endregion
    // #region Properties
    /**
     * Returns the `{@link is}` property.
     * The `{@link is}` property represents natural name of this element.
     *
     * @public
     * @static
     * @readonly
     */
    static get is() {
        return 'mosaik-elevation';
    }
    /**
     * Gets or sets the `weigh` property.
     *
     * @public
     * @attr
     */
    get weigh() {
        return this._weigh;
    }
    set weigh(value) {
        if (this._weigh !== value) {
            this._weigh = value;
            this.requestUpdate('weigh');
        }
    }
    // #endregion
    // #region Methods
    /**
     * @protected
     * @override
     */
    onApplyTemplate() {
        void this.updateComplete.then(() => {
            requestAnimationFrame(() => {
                if (this.control) {
                    const boxShadowValue = getComputedStyle(this).boxShadow;
                    this.control.style.boxShadow = boxShadowValue;
                }
            });
        });
    }
    /**
     * @protected
     */
    onWeighPropertyChanged(prev, next) {
        void this.updateComplete.then(() => {
            requestAnimationFrame(() => {
                if (this.control) {
                    const boxShadowValue = getComputedStyle(this).boxShadow;
                    this.control.style.boxShadow = boxShadowValue;
                }
            });
        });
    }
};
__decorate([
    Attribute({ type: ElevationWeight }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], ElevationElement.prototype, "weigh", null);
__decorate([
    Watch('weigh', { waitUntilFirstUpdate: true }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String, String]),
    __metadata("design:returntype", void 0)
], ElevationElement.prototype, "onWeighPropertyChanged", null);
ElevationElement = __decorate([
    Component({
        selector: 'mosaik-elevation',
        template: elevationElementTemplate,
        themes: {
            joy: elevationElementJoyStyle,
            retro: elevationElementRetroStyle,
            cosmopolitan: elevationElementCosmopolitanStyle
        },
        imports: []
    }),
    __metadata("design:paramtypes", [])
], ElevationElement);
export { ElevationElement };
//# sourceMappingURL=ElevationElement.js.map