import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
import { createBlock as t, createElementVNode as n, createTextVNode as r, createVNode as i, mergeProps as a, openBlock as o, ref as s, renderSlot as c, resolveComponent as l, toDisplayString as u, unref as d, useAttrs as f, withCtx as p } from "vue";
//#region src/components/wt-confirm-dialog/wt-confirm-dialog.vue
var m = { class: "wt-confirm-dialog__content" }, h = { class: "wt-confirm-dialog__message" }, g = /*#__PURE__*/ e({
	__name: "wt-confirm-dialog",
	props: {
		title: {
			type: String,
			required: !0
		},
		deleteMessage: {
			type: String,
			default: ""
		},
		subject: {
			type: String,
			default: ""
		},
		callback: {
			type: Function,
			required: !0
		}
	},
	emits: ["close", "confirm"],
	setup(e, { emit: g }) {
		let _ = e, v = g, y = f(), b = s(!1);
		function x() {
			v("close");
		}
		async function S() {
			try {
				b.value = !0, await _.callback(), x();
			} finally {
				b.value = !1;
			}
		}
		return (s, f) => {
			let g = l("wt-button"), _ = l("wt-popup");
			return o(), t(_, a(d(y), {
				class: "wt-confirm-dialog",
				size: "sm"
			}, { onClose: x }), {
				title: p(() => [r(u(e.title), 1)]),
				main: p(() => [c(s.$slots, "main", {}, () => [n("div", m, [n("p", h, u(e.deleteMessage ? e.deleteMessage : s.$t("webitelUI.deleteConfirmationPopup.askingAlert", { subject: e.subject })), 1)])], !0)]),
				actions: p(() => [c(s.$slots, "actions", {
					isDeleting: b.value,
					confirm: S,
					close: x
				}, () => [i(g, {
					disabled: b.value,
					color: "secondary",
					onClick: x
				}, {
					default: p(() => [r(u(s.$t("reusable.cancel")), 1)], void 0, !0),
					_: 1
				}, 8, ["disabled"]), i(g, {
					loading: b.value,
					color: "error",
					onClick: S
				}, {
					default: p(() => [r(u(s.$t("reusable.delete")), 1)], void 0, !0),
					_: 1
				}, 8, ["loading"])], !0)]),
				_: 3
			}, 16);
		};
	}
}, [["__scopeId", "data-v-517c5b4a"]]);
//#endregion
export { g as default };
