import { audit as e } from "../internal/controllers/audit.controller.js";
import { appendAnchorName as t, appendRootNodeStyle as n, removeAnchorName as r } from "../internal/utils/dom.js";
import { keyNavigationList as i } from "../internal/controllers/keynav-list.controller.js";
import { attachInternals as a } from "../internal/utils/a11y.js";
import { stateSelected as o } from "../internal/controllers/state-selected.controller.js";
import { useStyles as s } from "../internal/styles/index.js";
import { __decorate as c } from "../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
import l from "./tabs.global.js";
import u from "./tabs-item.js";
import d from "./tabs.js";
import { LitElement as f, html as p } from "lit";
import { property as m } from "lit/decorators/property.js";
import { ButtonFormControlMixin as h } from "@nvidia-elements/forms/mixins";
import { queryAssignedElements as g } from "lit/decorators/query-assigned-elements.js";
//#region src/tabs/tabs.ts
var _ = class extends h(f) {
	static {
		this.styles = s([u]);
	}
	static {
		this.metadata = {
			tag: "nve-tabs-item",
			version: "0.2.3",
			parents: ["nve-tabs"]
		};
	}
	render() {
		return p`<div internal-host focus-within><slot></slot></div>`;
	}
	constructor() {
		super(), this.selected = !1, this.type = "button";
	}
	connectedCallback() {
		super.connectedCallback(), this._internals.role = "tab";
	}
	updated(e) {
		super.updated(e), e.has("selected") && (this.selected ? t(this, "--selected") : r(this, "--selected"));
	}
};
c([m({
	type: Boolean,
	reflect: !0
})], _.prototype, "selected", void 0), _ = c([e(), o()], _);
var v = class extends f {
	constructor(...e) {
		super(...e), this.vertical = !1, this.borderless = !1, this.behaviorSelect = !1, this.#t = (e) => {
			this.#e(e.target);
		};
	}
	static {
		this.styles = s([d]);
	}
	static {
		this.metadata = {
			tag: "nve-tabs",
			version: "0.2.3",
			children: ["nve-tabs-item"]
		};
	}
	get keynavListConfig() {
		return {
			items: this.items,
			layout: this.vertical ? "vertical" : "horizontal"
		};
	}
	#e(e) {
		!this.behaviorSelect || !e.matches("nve-tabs-item") || e.disabled || (this.keynavListConfig.items.forEach((e) => e.selected = !1), e.selected = !0);
	}
	render() {
		return p`<div internal-host><slot></slot></div>`;
	}
	connectedCallback() {
		super.connectedCallback(), n(this, l), a(this), this._internals.role = "tablist", this.addEventListener("click", this.#t);
	}
	disconnectedCallback() {
		super.disconnectedCallback(), this.removeEventListener("click", this.#t);
	}
	#t;
	updated(e) {
		super.updated(e), this._internals.ariaOrientation = this.vertical ? "vertical" : "horizontal";
	}
};
c([m({
	type: Boolean,
	reflect: !0
})], v.prototype, "vertical", void 0), c([m({
	type: Boolean,
	reflect: !0
})], v.prototype, "borderless", void 0), c([m({
	type: Boolean,
	attribute: "behavior-select"
})], v.prototype, "behaviorSelect", void 0), c([g()], v.prototype, "items", void 0), v = c([e(), i()], v);
//#endregion
export { v as Tabs, _ as TabsItem };

//# sourceMappingURL=tabs2.js.map