import { n as __exportAll } from "./chunk-B-1-B7_t.js";
import { n as cn } from "./utils-DXzSsU1e.js";
import { n as Badge_default } from "./badge-BbQrSqE-.js";
import { n as Button_default } from "./button-B9CnnuTu.js";
import { n as DialogTitle_default, o as DialogContent_default, r as DialogHeader_default, t as DialogTrigger_default, u as Dialog_default } from "./dialog-BGzW4Eil.js";
import { t as ElementRenderer_default } from "./ElementRenderer-DV1pZRd4.js";
import { Fragment, computed, createBlock, createElementBlock, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, renderList, toDisplayString, unref, withCtx } from "vue";
import { Construction } from "@lucide/vue";
//#region src/components/compositions/elements/configuration-block/DialogBlock.vue?vue&type=script&setup=true&lang.ts
var _hoisted_1 = {
	key: 0,
	class: "flex flex-col gap-3"
};
var _hoisted_2 = {
	key: 1,
	class: "text-sm text-muted-foreground"
};
var styleKey = "dialog";
var DialogBlock_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
	__name: "DialogBlock",
	props: {
		label: { default: "Dialog" },
		name: {},
		triggerLabel: {},
		title: {},
		nestedElements: { default: () => [] },
		item: { default: () => ({}) },
		classList: {}
	},
	setup(__props) {
		/**
		* Props-driven renderer for `configuration-block/dialog`.
		*
		* Wraps the inner children (`nestedElements`) in a Dialog opened by a
		* trigger Button. Full FormBuilder integration arrives in task #7.
		*/
		const props = __props;
		const resolvedTrigger = computed(() => props.triggerLabel ?? props.label ?? "Open dialog");
		const resolvedTitle = computed(() => props.title ?? props.label ?? "Dialog");
		const children = computed(() => (props.nestedElements ?? []).filter((entry) => typeof entry === "object" && entry !== null && typeof entry.type === "string"));
		return (_ctx, _cache) => {
			return openBlock(), createBlock(unref(Dialog_default), null, {
				default: withCtx(() => [createVNode(unref(DialogTrigger_default), { "as-child": "" }, {
					default: withCtx(() => [createVNode(unref(Button_default), {
						type: "button",
						variant: "outline",
						class: normalizeClass(unref(cn)(props.classList)),
						"data-element-name": props.name ?? void 0,
						"data-stub": `configuration-block/${styleKey}`,
						"aria-label": props.label
					}, {
						default: withCtx(() => [
							createVNode(unref(Construction), { class: "size-4" }),
							createTextVNode(" " + toDisplayString(resolvedTrigger.value) + " ", 1),
							createVNode(unref(Badge_default), {
								variant: "outline",
								size: "sm"
							}, {
								default: withCtx(() => [createTextVNode(toDisplayString(styleKey))]),
								_: 1
							})
						]),
						_: 1
					}, 8, [
						"class",
						"data-element-name",
						"data-stub",
						"aria-label"
					])]),
					_: 1
				}), createVNode(unref(DialogContent_default), null, {
					default: withCtx(() => [createVNode(unref(DialogHeader_default), null, {
						default: withCtx(() => [createVNode(unref(DialogTitle_default), null, {
							default: withCtx(() => [createTextVNode(toDisplayString(resolvedTitle.value), 1)]),
							_: 1
						})]),
						_: 1
					}), children.value.length ? (openBlock(), createElementBlock("div", _hoisted_1, [(openBlock(true), createElementBlock(Fragment, null, renderList(children.value, (child) => {
						return openBlock(), createBlock(ElementRenderer_default, {
							key: child.id,
							element: child,
							item: props.item
						}, null, 8, ["element", "item"]);
					}), 128))])) : (openBlock(), createElementBlock("p", _hoisted_2, " Dialog block — FormBuilder integration coming in task #7. "))]),
					_: 1
				})]),
				_: 1
			});
		};
	}
});
//#endregion
//#region src/components/compositions/elements/configuration-block/DialogBlock.vue
var DialogBlock_exports = /* @__PURE__ */ __exportAll({ default: () => DialogBlock_default });
var DialogBlock_default = DialogBlock_vue_vue_type_script_setup_true_lang_default;
//#endregion
export { DialogBlock_exports as n, DialogBlock_default as t };

//# sourceMappingURL=DialogBlock-aUJHK-mP.js.map