// #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 { Themeable } from '../../../Behaviors/Themeable';
import { Attribute } from '../../../Decorators/AttributeDecorator';
import { Component } from '../../../Decorators/ComponentDecorator';
import { CustomElement } from '../../Abstracts/CustomElement';
import { viewElementTemplate } from './RegionViewElementTemplate';
import { regionViewElementCosmopolitanStyle } from './Themes/RegionViewElement.Cosmopolitan';
import { regionViewElementJoyStyle } from './Themes/RegionViewElement.Joy';
import { regionViewElementMemphisStyle } from './Themes/RegionViewElement.Memphis';
// #endregion
/**
 * RegionView - A view definition component for lazy content instantiation within a Region container.
 *
 * @description
 * The RegionView component acts as a template container that stores its content for lazy instantiation.
 * The view's children are not instantiated until the view becomes active within its parent Region element,
 * enabling efficient memory usage and clean lifecycle management for complex view hierarchies. When a view
 * is deactivated, its content is removed from the DOM, and all component lifecycle hooks are properly called.
 * This pattern is essential for managing large applications with multiple exclusive views.
 *
 * @name RegionView
 * @element mosaik-region-view
 * @category Grouping
 *
 * @slot - The content to be rendered when this view becomes active in its parent region
 *
 * @cssprop {String} --region-view-font-family - The view font family CSS custom property.
 * @cssprop {String} --region-view-font-letter-spacing - The view font letter spacing CSS custom property.
 * @cssprop {String} --region-view-font-line-height - The view font line height CSS custom property.
 * @cssprop {String} --region-view-font-size - The view font size CSS custom property.
 * @cssprop {String} --region-view-font-text-decoration - The view font text decoration CSS custom property.
 * @cssprop {String} --region-view-font-text-transform - The view font text transform CSS custom property.
 * @cssprop {String} --region-view-font-weight - The view font weight CSS custom property.
 * @cssprop {String} --region-view-gap - The view gap CSS custom property.
 * @cssprop {String} --region-view-padding-bottom - The view padding bottom CSS custom property.
 * @cssprop {String} --region-view-padding-left - The view padding left CSS custom property.
 * @cssprop {String} --region-view-padding-right - The view padding right CSS custom property.
 * @cssprop {String} --region-view-padding-top - The view padding top CSS custom property.
 * @cssprop {String} --region-view-shadow - The view shadow CSS custom property.
 * @cssprop {String} --region-view-shadow-blur - The view shadow blur CSS custom property.
 * @cssprop {String} --region-view-shadow-color - The view shadow color CSS custom property.
 * @cssprop {String} --region-view-shadow-offset-x - The view shadow offset x CSS custom property.
 * @cssprop {String} --region-view-shadow-offset-y - The view shadow offset y CSS custom property.
 * @cssprop {String} --region-view-shadow-spread - The view shadow spread CSS custom property.
 * @cssprop {String} --region-view-transition-duration - The view transition duration CSS custom property.
 * @cssprop {String} --region-view-transition-mode - The view transition mode CSS custom property.
 * @cssprop {String} --region-view-transition-property - The view transition property CSS custom property.
 * @cssprop {String} --region-view-translate - The view translate CSS custom property.
 *
 * @example
 * Basic view definition:
 * ```html
 * <mosaik-region active="home">
 *   <mosaik-region-view name="home" default>
 *     <h1>Welcome Home</h1>
 *     <p>This content is only instantiated when the view is active.</p>
 *   </mosaik-region-view>
 * </mosaik-region>
 * ```
 *
 * @example
 * Multiple views with components:
 * ```html
 * <mosaik-region active="dashboard">
 *   <mosaik-region-view name="dashboard" default>
 *     <my-dashboard-component></my-dashboard-component>
 *   </mosaik-region-view>
 *   <mosaik-region-view name="profile">
 *     <my-profile-component></my-profile-component>
 *   </mosaik-region-view>
 *   <mosaik-region-view name="settings">
 *     <my-settings-component></my-settings-component>
 *   </mosaik-region-view>
 * </mosaik-region>
 * ```
 *
 * @example
 * Wizard step definition:
 * ```html
 * <mosaik-region id="wizard">
 *   <mosaik-region-view name="step1" default>
 *     <h2>Step 1: Account Details</h2>
 *     <mosaik-form><!-- account form fields --></mosaik-form>
 *   </mosaik-region-view>
 *   <mosaik-region-view name="step2">
 *     <h2>Step 2: Preferences</h2>
 *     <mosaik-form><!-- preferences form --></mosaik-form>
 *   </mosaik-region-view>
 *   <mosaik-region-view name="step3">
 *     <h2>Step 3: Confirmation</h2>
 *     <div><!-- summary content --></div>
 *   </mosaik-region-view>
 * </mosaik-region>
 * ```
 *
 * @public
 */
let RegionViewElement = class RegionViewElement extends Themeable(CustomElement) {
    // #region Fields
    _name;
    _default;
    _active;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        this._name = '';
        this._default = false;
        this._active = false;
    }
    // #endregion
    // #region Properties
    /**
     * Returns the `is` property.
     * The `is` property represents natural name of this element.
     *
     * @public
     * @static
     * @readonly
     */
    static get is() {
        return 'mosaik-region-view';
    }
    /**
     * The unique name identifier for this view within a region.
     *
     * @public
     */
    get name() {
        return this._name;
    }
    set name(value) {
        this._name = value;
    }
    /**
     * Whether this view is the default active view in the region.
     *
     * @public
     */
    get default() {
        return this._default;
    }
    set default(value) {
        this._default = value;
    }
    /**
     * Whether this view is currently active (visible).
     *
     * @public
     * @attr
     */
    get active() {
        return this._active;
    }
    set active(value) {
        if (this._active !== value) {
            this._active = value;
            this.requestUpdate('active');
        }
    }
};
__decorate([
    Attribute({
        type: String,
        useDefault: true
    }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], RegionViewElement.prototype, "name", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], RegionViewElement.prototype, "default", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], RegionViewElement.prototype, "active", null);
RegionViewElement = __decorate([
    Component({
        selector: 'mosaik-region-view',
        template: viewElementTemplate,
        themes: {
            joy: regionViewElementJoyStyle,
            memphis: regionViewElementMemphisStyle,
            cosmopolitan: regionViewElementCosmopolitanStyle
        }
    }),
    __metadata("design:paramtypes", [])
], RegionViewElement);
export { RegionViewElement };
//# sourceMappingURL=RegionViewElement.js.map