import { I18nController as e } from "../internal/controllers/i18n.controller.js";
import { createGhostElement as t } from "../internal/utils/dom.js";
import { TypeNativePopoverController as n } from "../internal/controllers/type-native-popover.controller.js";
import { typeSSR as r } from "../internal/controllers/type-ssr.controller.js";
import { scopedRegistry as i } from "../internal/decorators/scoped-registry.js";
import { useStyles as a } from "../internal/styles/index.js";
import { popoverStyles as o } from "../internal/styles/popover2.js";
import { __decorate as s } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/decorate.js";
import { IconButton as c } from "../icon-button/icon-button2.js";
import l from "./drawer.js";
import { LitElement as u, html as d } from "lit";
import { property as f } from "lit/decorators/property.js";
//#region src/drawer/drawer.ts
var p = class extends u {
	constructor(...r) {
		super(...r), this.position = "left", this.anchor = globalThis.document?.body, this.#e = new e(this), this.i18n = this.#e.i18n, this.typeNativePopoverController = new n(this), this.#n = (e) => {
			this.inline && (this.#t && e.newState === "closed" ? this.#t.remove() : (this.#t = t(this), this.after(this.#t)));
		};
	}
	#e;
	get popoverType() {
		return this.modal ? "auto" : "manual";
	}
	get popoverDismissible() {
		return !!this.closable;
	}
	static {
		this.styles = a([o, l]);
	}
	static {
		this.metadata = {
			tag: "nve-drawer",
			version: "2.0.2"
		};
	}
	static {
		this.elementDefinitions = { [c.metadata.tag]: c };
	}
	render() {
		return d`<div internal-host><div class="header"><nve-icon-button part="icon-button" exportparts="icon:icon-button-icon" .hidden="${!this.closable}" @click="${this.hidePopover}" icon-name="cancel" .ariaLabel="${this.i18n.close}" container="flat"></nve-icon-button><slot name="header"></slot></div><div class="content"><slot></slot></div><div><slot name="footer"></slot></div></div>`;
	}
	#t;
	connectedCallback() {
		super.connectedCallback(), this.addEventListener("toggle", this.#n);
	}
	disconnectedCallback() {
		super.disconnectedCallback(), this.removeEventListener("toggle", this.#n), this.#t?.remove(), this.#t = void 0;
	}
	#n;
};
s([f({
	type: String,
	reflect: !0
})], p.prototype, "position", void 0), s([f({
	type: String,
	reflect: !0
})], p.prototype, "size", void 0), s([f({ type: Boolean })], p.prototype, "closable", void 0), s([f({
	type: Boolean,
	reflect: !0
})], p.prototype, "modal", void 0), s([f({ type: String })], p.prototype, "anchor", void 0), s([f({ type: String })], p.prototype, "trigger", void 0), s([f({
	type: Boolean,
	reflect: !0
})], p.prototype, "inline", void 0), s([f({
	type: Boolean,
	reflect: !0,
	attribute: "behavior-trigger"
})], p.prototype, "behaviorTrigger", void 0), s([f({ type: Object })], p.prototype, "i18n", void 0), p = s([r(), i()], p);
//#endregion
export { p as Drawer };

//# sourceMappingURL=drawer2.js.map