import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
import { t } from "./vue-i18n-Db_oYfO8.js";
import { Fragment as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, mergeProps as l, normalizeClass as u, openBlock as d, renderList as f, renderSlot as p, resolveComponent as m, resolveDirective as h, toDisplayString as g, unref as _, withCtx as v, withDirectives as y } from "vue";
//#region src/components/on-demand/wt-selection-popup/wt-selection-popup.vue
var b = { class: "wt-selection-popup__options" }, x = ["onClick"], S = { class: "wt-selection-popup__item-header typo-subtitle-2" }, C = {
	key: 1,
	class: "popup-options__item-text"
}, w = /*#__PURE__*/ e({
	__name: "wt-selection-popup",
	props: {
		title: { type: String },
		selected: { type: Object },
		options: {
			type: Array,
			default: () => []
		}
	},
	emits: [
		"change",
		"add",
		"close"
	],
	setup(e, { emit: w }) {
		let T = e, E = w, { t: D } = t();
		function O() {
			E("add", T.selected);
		}
		function k() {
			E("close");
		}
		function A(e) {
			E("change", e);
		}
		return (t, w) => {
			let T = m("wt-icon"), E = m("wt-icon-btn"), j = m("wt-button"), M = m("wt-popup"), N = h("tooltip");
			return d(), r(M, l(t.$attrs, {
				class: "wt-selection-popup",
				overflow: "",
				size: "sm"
			}, { onClose: k }), {
				title: v(() => [s(g(e.title), 1)]),
				main: v(() => [o("ul", b, [(d(!0), a(n, null, f(e.options, (n, s) => (d(), a("li", {
					key: s,
					class: u([{ active: n.value === e.selected.value }, "wt-selection-popup__item-wrapper"]),
					onClick: (e) => A(n)
				}, [p(t.$slots, "option", { option: n }, () => [
					n.icon ? (d(), r(T, {
						key: 0,
						icon: n.icon,
						size: "sm"
					}, null, 8, ["icon"])) : i("", !0),
					o("h4", S, g(n.title), 1),
					n.description ? (d(), a("p", C, g(n.description), 1)) : i("", !0),
					n.description ? y((d(), r(E, {
						key: 2,
						color: "info",
						icon: "rounded-info"
					}, null, 512)), [[N, n.description]]) : i("", !0)
				], !0)], 10, x))), 128))]), p(t.$slots, "after-section", {}, void 0, !0)]),
				actions: v(() => [c(j, {
					disabled: !e.selected,
					onClick: O
				}, {
					default: v(() => [s(g(_(D)("reusable.create")), 1)], void 0, !0),
					_: 1
				}, 8, ["disabled"]), c(j, {
					color: "secondary",
					onClick: k
				}, {
					default: v(() => [s(g(_(D)("reusable.close")), 1)], void 0, !0),
					_: 1
				})]),
				_: 3
			}, 16);
		};
	}
}, [["__scopeId", "data-v-d7ed7032"]]);
//#endregion
export { w as default };
