import { applySlotContentStates as e, hasHorizontalScrollBar as t } from "../internal/utils/dom.js";
import { attachInternals as n } from "../internal/utils/a11y.js";
import { statusStateStyles as r, supportStateStyles as i, useStyles as a } from "../internal/styles/index.js";
import { __decorate as o } from "../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
import s from "./toolbar.js";
import { LitElement as c, html as l } from "lit";
import { property as u } from "lit/decorators/property.js";
import { queryAssignedElements as d } from "lit/decorators/query-assigned-elements.js";
//#region src/toolbar/toolbar.ts
var f = class extends c {
	constructor(...e) {
		super(...e), this.content = "scroll", this.orientation = "horizontal", this.#e = [];
	}
	static {
		this.styles = a([
			s,
			r,
			i
		]);
	}
	static {
		this.metadata = {
			tag: "nve-toolbar",
			version: "0.2.3"
		};
	}
	static {
		this.elementDefinitions = {};
	}
	#e;
	get #t() {
		return this.shadowRoot.querySelector("slot:not([name])");
	}
	get #n() {
		return [
			...this.prefixElements,
			...this.defaultElements,
			...this.suffixElements
		];
	}
	render() {
		return l`<div internal-host @slotchange="${this.#r}"><slot name="prefix"></slot><slot></slot><slot name="suffix"></slot></div>`;
	}
	connectedCallback() {
		super.connectedCallback(), n(this), this._internals.role = "toolbar";
	}
	firstUpdated(e) {
		super.firstUpdated(e), this.#i();
	}
	updated(e) {
		super.updated(e), this.#o(), this.#s();
	}
	disconnectedCallback() {
		super.disconnectedCallback(), this.#e.forEach((e) => e.disconnect());
	}
	#r(t) {
		e(t.target, this), this.#o(), this.#s(), this.#a();
	}
	#i() {
		this.#a();
		let e = new ResizeObserver(() => this.#a());
		this.#e.push(e), e.observe(this);
	}
	#a() {
		t(this.#t) ? this._internals.states.add("scrollbar") : this._internals.states.delete("scrollbar");
	}
	#o() {
		this.#n.filter((e) => e.matches("nve-button-group, nve-input, nve-search, nve-combobox, nve-button, nve-select, nve-icon-button, nve-copy-button")).forEach((e) => e.container = "flat");
	}
	#s() {
		let e = this.#n;
		e.filter((e) => e.matches("nve-divider")).forEach((e) => e.orientation = this.orientation === "horizontal" ? "vertical" : "horizontal"), e.filter((e) => e.matches("nve-button-group")).forEach((e) => e.orientation = this.orientation);
	}
};
o([u({
	type: String,
	reflect: !0
})], f.prototype, "container", void 0), o([u({
	type: String,
	reflect: !0
})], f.prototype, "content", void 0), o([u({
	type: String,
	reflect: !0
})], f.prototype, "orientation", void 0), o([u({
	type: String,
	reflect: !0
})], f.prototype, "status", void 0), o([d({ slot: "prefix" })], f.prototype, "prefixElements", void 0), o([d({ slot: "suffix" })], f.prototype, "suffixElements", void 0), o([d()], f.prototype, "defaultElements", void 0);
//#endregion
export { f as Toolbar };

//# sourceMappingURL=toolbar2.js.map