// #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 { Disableable } from '../../../Behaviors/Disableable';
import { Themeable } from '../../../Behaviors/Themeable';
import { Component } from '../../../Decorators/ComponentDecorator';
import { Property } from '../../../Decorators/PropertyDecorator';
import { CustomElement } from '../../Abstracts/CustomElement';
import { IconElement } from '../../Media/Icon/IconElement';
import { ImageElement } from '../../Media/Image/ImageElement';
import { VideoElement } from '../../Media/Video/VideoElement';
import { AudioElement } from '../../Media/Audio/AudioElement';
import { thumbnailElementTemplate } from './ThumbnailElementTemplate';
import { MapElement } from '../../Media/Map/MapElement';
import { thumbnailElementCosmopolitanStyle } from './Themes/ThumbnailElement.Cosmopolitan';
import { thumbnailElementJoyStyle } from './Themes/ThumbnailElement.Joy';
import { thumbnailElementMemphisStyle } from './Themes/ThumbnailElement.Memphis';
// #endregion
/**
 * Thumbnail - Displays an image or video and falls back to a mosaik-icon if the media is not available.
 *
 * @public
 */
let ThumbnailElement = class ThumbnailElement extends Themeable(Disableable(CustomElement)) {
    // #region Fields
    _preview;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        this._preview = null;
    }
    // #endregion
    // #region Properties
    /**
     * Returns the natural tag name of this element.
     *
     * @public
     * @static
     * @readonly
     */
    static get is() {
        return 'mosaik-thumbnail';
    }
    /**
     * Gets or sets the `file` property.
     *
     * @public
     */
    get preview() {
        return this._preview;
    }
    set preview(value) {
        if (this._preview !== value) {
            this._preview = value;
            this.requestUpdate('preview');
        }
    }
    /**
     * Gets the `kind` property.
     * The `kind` property represents the kind of preview to display.
     *
     * @public
     * @readonly
     */
    get kind() {
        return this._preview?.type ?? 'other';
    }
};
__decorate([
    Property({ type: Object }),
    __metadata("design:type", Object),
    __metadata("design:paramtypes", [Object])
], ThumbnailElement.prototype, "preview", null);
ThumbnailElement = __decorate([
    Component({
        selector: 'mosaik-thumbnail',
        template: thumbnailElementTemplate,
        themes: {
            joy: thumbnailElementJoyStyle,
            memphis: thumbnailElementMemphisStyle,
            cosmopolitan: thumbnailElementCosmopolitanStyle
        },
        imports: [
            ImageElement,
            VideoElement,
            AudioElement,
            MapElement,
            IconElement
        ]
    }),
    __metadata("design:paramtypes", [])
], ThumbnailElement);
export { ThumbnailElement };
//# sourceMappingURL=ThumbnailElement.js.map