import { associateAriaDescribedBy as e, associateAriaLabel as t, associateControlGroup as n, attachInternals as r } from "../../internal/utils/a11y.js";
import { useStyles as i } from "../../internal/styles/index.js";
import { __decorate as a } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
import { inputQuery as o, setupControlGroupStates as s, setupControlStatusStates as c } from "../utils/states.js";
import { setupControlLayoutStates as l } from "../utils/layout.js";
import u from "./control-group.js";
import { LitElement as d, html as f } from "lit";
import { property as p } from "lit/decorators/property.js";
//#region src/forms/control-group/control-group.ts
var m = class extends d {
	get label() {
		return this.querySelector?.("label");
	}
	get inputs() {
		return this.querySelectorAll ? Array.from(this.querySelectorAll(o)) : [];
	}
	get #e() {
		return this.querySelectorAll ? Array.from(this.querySelectorAll("nve-control-message")) : [];
	}
	#t = [];
	static {
		this.styles = i([u]);
	}
	static {
		this.metadata = {
			tag: "nve-control-group",
			version: "0.2.3"
		};
	}
	render() {
		return f`<div internal-host class="${this.#e.length ? "" : "no-messages"} ${this.label ? "" : "no-label"}"><slot name="label"></slot><slot class="input-slot"></slot><slot name="messages"></slot></div>`;
	}
	connectedCallback() {
		super.connectedCallback(), r(this), this._internals.role = "group";
	}
	firstUpdated(e) {
		super.firstUpdated(e), this.#t = [
			s(this),
			l(this),
			...c(this, this.#e)
		], this.#n(), this.shadowRoot.addEventListener("slotchange", () => this.#n());
	}
	disconnectedCallback() {
		super.disconnectedCallback(), this.#t.forEach((e) => e.disconnect());
	}
	#n() {
		this.#r(), t(this.label, this), e(Array.from(this.querySelectorAll("nve-control-message")), this), n(Array.from(this.inputs));
	}
	#r() {
		this.label && (this.label.slot = "label");
	}
};
a([p({
	type: String,
	reflect: !0
})], m.prototype, "layout", void 0), a([p({
	type: String,
	reflect: !0
})], m.prototype, "prominence", void 0);
//#endregion
export { m as ControlGroup };

//# sourceMappingURL=control-group2.js.map