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;
};
import { customElement, html, property, state } from '../../../../../external/lit/index.js';
import { UmbLitElement } from '../../../lit-element/index.js';
import { UMB_SECTION_CONTEXT } from '../../../section/index.js';
let UmbMenuItemDefaultElement = class UmbMenuItemDefaultElement extends UmbLitElement {
    #pathname;
    get manifest() {
        return this._manifest;
    }
    set manifest(value) {
        this._manifest = value;
        this.#constructHref();
    }
    constructor() {
        super();
        this.consumeContext(UMB_SECTION_CONTEXT, (sectionContext) => {
            this.observe(sectionContext?.pathname, (pathname) => {
                this.#pathname = pathname;
                this.#constructHref();
            }, 'observePathname');
        });
    }
    #constructHref() {
        if (!this.#pathname || !this.manifest)
            return;
        this._href = `section/${this.#pathname}/workspace/${this.manifest.meta.entityType}`;
    }
    render() {
        return html `
			<umb-menu-item-layout
				.href=${this._href}
				.iconName=${this.manifest.meta.icon ?? ''}
				.label=${this.localize.string(this.manifest.meta.label ?? this.manifest.name)}
				.entityType=${this.manifest.meta.entityType}>
			</umb-menu-item-layout>
		`;
    }
};
__decorate([
    property({ type: Object, attribute: false })
], UmbMenuItemDefaultElement.prototype, "_manifest", void 0);
__decorate([
    state()
], UmbMenuItemDefaultElement.prototype, "_href", void 0);
UmbMenuItemDefaultElement = __decorate([
    customElement('umb-menu-item-default')
], UmbMenuItemDefaultElement);
export { UmbMenuItemDefaultElement };
