// #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 { Component } from '../../../Decorators/ComponentDecorator';
import { portalHostElementTemplate } from './PortalHostElementTemplate';
import { portalHostElementJoyStyle } from './Themes/PortalHostElement.Joy';
import { portalHostElementMemphisStyle } from './Themes/PortalHostElement.Memphis';
import { portalHostElementCosmopolitanStyle } from './Themes/PortalHostElement.Cosmopolitan';
import { Themeable } from '../../../Behaviors/Themeable';
import { CustomElement } from '../../Abstracts/CustomElement';
import { Attribute } from '../../../Decorators/AttributeDecorator';
import { PORTAL_HOST_REGISTRY } from './Portal';
import { Slottable } from '../../../Behaviors/Slottable';
// #endregion
/**
 * PortalHostElement - A host for portals, allowing them to be rendered in a specific location in the DOM.
 *                     This element is used to define a destination for portal.
 *
 * @public
 */
let PortalHostElement = class PortalHostElement extends Themeable(Slottable(CustomElement)) {
    // #region Fields
    _name;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        this._name = '';
    }
    // #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-portal-host';
    }
    // #endregion
    // #region Properties
    /**
     * Gets or sets the `name` property.
     * The `name` property represents the unique identifier for this portal host.
     *
     * @public
     * @attr
     */
    get name() {
        return this._name;
    }
    set name(value) {
        if (this._name !== value) {
            this._name = value;
            this.requestUpdate('name');
        }
    }
    // #endregion
    // #region Methods
    /**
     * @public
     * @override
     */
    connectedCallback() {
        super.connectedCallback();
        PORTAL_HOST_REGISTRY.set(this._name, this);
    }
    /**
     * @public
     * @override
     */
    disconnectedCallback() {
        super.disconnectedCallback();
        PORTAL_HOST_REGISTRY.delete(this._name);
    }
};
__decorate([
    Attribute({ type: String }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], PortalHostElement.prototype, "name", null);
PortalHostElement = __decorate([
    Component({
        selector: 'mosaik-portal-host',
        template: portalHostElementTemplate,
        themes: {
            joy: portalHostElementJoyStyle,
            memphis: portalHostElementMemphisStyle,
            cosmopolitan: portalHostElementCosmopolitanStyle
        },
        imports: []
    }),
    __metadata("design:paramtypes", [])
], PortalHostElement);
export { PortalHostElement };
//# sourceMappingURL=PortalHostElement.js.map