/**
 * Copyright IBM Corp. 2026
 *
 * This source code is licensed under the Apache-2.0 license found in the
 * LICENSE file in the root directory of this source tree.
 */

import "../../globals/settings.js";
import { carbonElement } from "../../globals/decorators/carbon-element.js";
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.126.0/helpers/decorate.js";
import FocusMixin from "../../globals/mixins/focus.js";
import header_default from "./header.scss.js";
import { LitElement, html } from "lit";
import { property } from "lit/decorators.js";
import { classMap } from "lit/directives/class-map.js";
//#region src/components/ui-shell/switcher-item.ts
/**
* Copyright IBM Corp. 2019, 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* Switcher menu item.
*
* @element cds-custom-switcher-item
*/
let CDSSwitcherItem = class CDSSwitcherItem extends FocusMixin(LitElement) {
	constructor(..._args) {
		super(..._args);
		this.href = "";
		this.selected = false;
		this.tabIndex = 0;
	}
	connectedCallback() {
		if (!this.hasAttribute("role")) this.setAttribute("role", "listitem");
		super.connectedCallback();
	}
	render() {
		const { href, selected, ariaLabel, ariaLabelledBy, tabIndex } = this;
		return html`
      <a
        part="link"
        aria-label="${ariaLabel}"
        aria-labelledby="${ariaLabelledBy}"
        tabindex="${tabIndex}"
        class="${classMap({
			[`cds-custom--switcher__item-link`]: true,
			[`cds-custom--switcher__item-link--selected`]: selected
		})}"
        href="${href}">
        <slot></slot>
      </a>
    `;
	}
	static {
		this.shadowRootOptions = {
			...LitElement.shadowRootOptions,
			delegatesFocus: true
		};
	}
	static {
		this.styles = header_default;
	}
};
__decorate([property({
	type: String,
	attribute: "aria-label"
})], CDSSwitcherItem.prototype, "ariaLabel", void 0);
__decorate([property({
	type: String,
	attribute: "aria-labelledby"
})], CDSSwitcherItem.prototype, "ariaLabelledBy", void 0);
__decorate([property()], CDSSwitcherItem.prototype, "href", void 0);
__decorate([property({
	type: Boolean,
	reflect: true
})], CDSSwitcherItem.prototype, "selected", void 0);
__decorate([property({
	type: Number,
	reflect: true,
	attribute: "tab-index"
})], CDSSwitcherItem.prototype, "tabIndex", void 0);
CDSSwitcherItem = __decorate([carbonElement(`cds-custom-switcher-item`)], CDSSwitcherItem);
var switcher_item_default = CDSSwitcherItem;
//#endregion
export { switcher_item_default as default };

//# sourceMappingURL=switcher-item.js.map