// #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 { Fitable } from '../../../Behaviors/Fitable';
import { Gapable } from '../../../Behaviors/Gapable';
import { Themeable } from '../../../Behaviors/Themeable';
import { InlineStyleController } from '../../../Controllers/InlineStyleController';
import { Component } from '../../../Decorators/ComponentDecorator';
import { Property } from '../../../Decorators/PropertyDecorator';
import { CustomElement } from '../../Abstracts/CustomElement';
import { masonryElementTemplate } from './MasonryElementTemplate';
import { masonryElementCosmopolitanStyle } from './Themes/MasonryElement.Cosmopolitan';
import { masonryElementJoyStyle } from './Themes/MasonryElement.Joy';
import { masonryElementMemphisStyle } from './Themes/MasonryElement.Memphis';
// #endregion
/**
 * Masonry - A dynamic grid layout system that arranges elements of varying heights in optimal vertical columns.
 *
 * @description
 * The Masonry layout component creates a Pinterest-style grid where elements are arranged in columns with
 * optimal space utilization, minimizing gaps and creating visually pleasing layouts. Unlike traditional
 * grid systems, Masonry dynamically positions elements to fill available space efficiently, making it
 * perfect for content with varying heights. The component supports configurable column counts, gap spacing,
 * responsive behavior, and automatic height distribution. It handles dynamic content addition and removal,
 * maintains layout integrity during window resizing, and provides smooth transitions. Essential for image
 * galleries, card layouts, dashboard widgets, blog post grids, and any interface displaying heterogeneous
 * content that needs optimal space utilization.
 *
 * @name Masonry
 * @element mosaik-masonry
 * @category Layouts
 *
 * @slot - The default slot for elements to be arranged in masonry layout.
 *
 * @cssprop {String} --masonry-columns - The number of columns in the masonry grid.
 * @cssprop {String} --masonry-font-family - The font family CSS custom property.
 * @cssprop {String} --masonry-font-letter-spacing - The font letter spacing CSS custom property.
 * @cssprop {String} --masonry-font-line-height - The font line height CSS custom property.
 * @cssprop {String} --masonry-font-size - The font size CSS custom property.
 * @cssprop {String} --masonry-font-text-decoration - The font text decoration CSS custom property.
 * @cssprop {String} --masonry-font-text-transform - The font text transform CSS custom property.
 * @cssprop {String} --masonry-font-weight - The font weight CSS custom property.
 * @cssprop {String} --masonry-gap - The gap between masonry items.
 * @cssprop {String} --masonry-padding-bottom - The padding bottom CSS custom property.
 * @cssprop {String} --masonry-padding-left - The padding left CSS custom property.
 * @cssprop {String} --masonry-padding-right - The padding right CSS custom property.
 * @cssprop {String} --masonry-padding-top - The padding top CSS custom property.
 * @cssprop {String} --masonry-shadow - The shadow CSS custom property.
 * @cssprop {String} --masonry-shadow-blur - The shadow blur CSS custom property.
 * @cssprop {String} --masonry-shadow-color - The shadow color CSS custom property.
 * @cssprop {String} --masonry-shadow-offset-x - The shadow offset x CSS custom property.
 * @cssprop {String} --masonry-shadow-offset-y - The shadow offset y CSS custom property.
 * @cssprop {String} --masonry-shadow-spread - The shadow spread CSS custom property.
 * @cssprop {String} --masonry-transition-duration - The transition duration CSS custom property.
 * @cssprop {String} --masonry-transition-mode - The transition mode CSS custom property.
 * @cssprop {String} --masonry-transition-property - The transition property CSS custom property.
 * @cssprop {String} --masonry-translate - The translate CSS custom property.
 *
 * @example
 * ```html
 * <mosaik-masonry gap="16px">
 *   <div>Short content</div>
 *   <div>Much longer content that spans multiple lines and creates different heights</div>
 *   <div>Medium content</div>
 *   <div>Another short item</div>
 * </mosaik-masonry>
 * ```
 *
 * @example
 * ```html
 * <mosaik-masonry gap="20px">
 *   <mosaik-card>Card 1</mosaik-card>
 *   <mosaik-card>Card 2 with more content</mosaik-card>
 *   <mosaik-card>Card 3</mosaik-card>
 * </mosaik-masonry>
 * ```
 *
 * @public
 */
let MasonryElement = class MasonryElement extends Themeable(Fitable(Gapable(CustomElement))) {
    // #region Fields
    _inlineStyleController;
    _columns;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        this._columns = 1;
        this._inlineStyleController = new InlineStyleController(this);
        this._inlineStyleController.set('masonry-gap', '0');
        this._inlineStyleController.set('masonry-columns', '1');
    }
    // #endregion
    // #region Properties
    /**
     * Returns the `is` property.
     * The `is` property represents natural name of this element.
     *
     * @public
     * @static
     * @readonly
     */
    static get is() {
        return 'mosaik-masonry';
    }
    /**
     * @public
     * @override
     */
    get gap() {
        return super.gap;
    }
    set gap(value) {
        super.gap = value;
        this._inlineStyleController.set('masonry-gap', `${this.gap}`);
    }
    /**
     * Gets or sets the `columns` property.
     *
     * @public
     */
    get columns() {
        return this._columns;
    }
    set columns(value) {
        if (this._columns !== value) {
            this._columns = value;
            this._inlineStyleController.set('masonry-columns', `${value}`);
            this.requestUpdate('columns');
        }
    }
};
__decorate([
    Property({ type: Number }),
    __metadata("design:type", Number),
    __metadata("design:paramtypes", [Number])
], MasonryElement.prototype, "columns", null);
MasonryElement = __decorate([
    Component({
        selector: 'mosaik-masonry',
        template: masonryElementTemplate,
        themes: {
            joy: masonryElementJoyStyle,
            memphis: masonryElementMemphisStyle,
            cosmopolitan: masonryElementCosmopolitanStyle
        },
        imports: []
    }),
    __metadata("design:paramtypes", [])
], MasonryElement);
export { MasonryElement };
//# sourceMappingURL=MasonryElement.js.map