import "./rolldown-runtime-CdpVaAjv.js";
import { C as e, E as t, Ft as n, H as r, Ht as i, Jt as a, Kt as o, Qt as s, T as c, Zt as l, en as u, kt as d, tn as f, x as ee, xt as p } from "./BaseItem-C8gi9njV.js";
import { R as m, h, k as g, m as te } from "./CascaderLoadMore-DdrSXL2Z.js";
import { c as _ } from "./DatePicker-DHA3FreS.js";
import { a as ne, i as v, o as re, s as ie } from "./Dialog-Cfdukgob.js";
import { a as y, f as ae } from "./Button-CG0BbgfC.js";
import { Transition as b, computed as x, createBlock as S, createCommentVNode as C, createElementBlock as w, createElementVNode as T, createTextVNode as E, createVNode as D, defineComponent as O, isVNode as k, markRaw as A, nextTick as j, normalizeClass as M, normalizeStyle as N, onBeforeUnmount as oe, onMounted as se, openBlock as P, reactive as ce, ref as F, render as I, renderSlot as L, resolveComponent as R, resolveDynamicComponent as z, toDisplayString as B, toRefs as le, vShow as V, watch as ue, withCtx as H, withDirectives as U, withKeys as W, withModifiers as G } from "vue";
//#region ../../node_modules/.pnpm/element-plus@2.13.6_typescript@6.0.2_vue@3.5.32_typescript@6.0.2_/node_modules/element-plus/es/directives/trap-focus/index.mjs
var K = "_trap-focus-children", q = [], de = (e) => {
	if (q.length === 0) return;
	let t = g(e), n = q[q.length - 1][K];
	if (n.length > 0 && t === m.tab) {
		if (n.length === 1) {
			e.preventDefault(), document.activeElement !== n[0] && n[0].focus();
			return;
		}
		let t = e.shiftKey, r = e.target === n[0], i = e.target === n[n.length - 1];
		r && t && (e.preventDefault(), n[n.length - 1].focus()), i && !t && (e.preventDefault(), n[0].focus());
	}
}, fe = {
	beforeMount(e) {
		e[K] = p(e), q.push(e), q.length <= 1 && document.addEventListener("keydown", de);
	},
	updated(e) {
		j(() => {
			e[K] = p(e);
		});
	},
	unmounted() {
		q.shift(), q.length === 0 && document.removeEventListener("keydown", de);
	}
}, pe = (e) => ["", ...f].includes(e), me = O({
	name: "ElMessageBox",
	directives: { TrapFocus: fe },
	components: {
		ElButton: y,
		ElFocusTrap: te,
		ElInput: _,
		ElOverlay: v,
		ElIcon: e,
		...c
	},
	inheritAttrs: !1,
	props: {
		buttonSize: {
			type: String,
			validator: pe
		},
		modal: {
			type: Boolean,
			default: !0
		},
		lockScroll: {
			type: Boolean,
			default: !0
		},
		showClose: {
			type: Boolean,
			default: !0
		},
		closeOnClickModal: {
			type: Boolean,
			default: !0
		},
		closeOnPressEscape: {
			type: Boolean,
			default: !0
		},
		closeOnHashChange: {
			type: Boolean,
			default: !0
		},
		center: Boolean,
		draggable: Boolean,
		overflow: Boolean,
		roundButton: Boolean,
		container: {
			type: String,
			default: "body"
		},
		boxType: {
			type: String,
			default: ""
		}
	},
	emits: ["vanish", "action"],
	setup(e, { emit: n }) {
		let { locale: i, zIndex: a, ns: o, size: s } = ee("message-box", x(() => e.buttonSize)), { t: c } = i, { nextZIndex: d } = a, f = F(!1), p = ce({
			autofocus: !0,
			beforeClose: null,
			callback: null,
			cancelButtonText: "",
			cancelButtonClass: "",
			confirmButtonText: "",
			confirmButtonClass: "",
			cancelButtonType: "",
			confirmButtonType: "primary",
			customClass: "",
			customStyle: {},
			dangerouslyUseHTMLString: !1,
			distinguishCancelAndClose: !1,
			icon: "",
			closeIcon: "",
			inputPattern: null,
			inputPlaceholder: "",
			inputType: "text",
			inputValue: "",
			inputValidator: void 0,
			inputErrorMessage: "",
			message: "",
			modalFade: !0,
			modalClass: "",
			showCancelButton: !1,
			showConfirmButton: !0,
			type: "",
			title: void 0,
			showInput: !1,
			action: "",
			confirmButtonLoading: !1,
			cancelButtonLoading: !1,
			confirmButtonLoadingIcon: A(r),
			cancelButtonLoadingIcon: A(r),
			confirmButtonDisabled: !1,
			editorErrorMessage: "",
			validateError: !1,
			zIndex: d()
		}), m = x(() => {
			let e = p.type;
			return { [o.bm("icon", e)]: e && t[e] };
		}), h = ae(), g = ae(), te = x(() => {
			let e = p.type;
			return p.icon || e && t[e] || "";
		}), _ = x(() => !!p.message), v = F(), y = F(), b = F(), S = F(), C = F(), w = x(() => p.confirmButtonClass);
		ue(() => p.inputValue, async (t) => {
			await j(), e.boxType === "prompt" && t && N();
		}, { immediate: !0 }), ue(() => f.value, (t) => {
			t && (e.boxType !== "prompt" && (p.autofocus ? b.value = C.value?.$el ?? v.value : b.value = v.value), p.zIndex = d()), e.boxType === "prompt" && (t ? j().then(() => {
				S.value && S.value.$el && (p.autofocus ? b.value = P() ?? v.value : b.value = v.value);
			}) : (p.editorErrorMessage = "", p.validateError = !1));
		});
		let { isDragging: T } = ie(v, y, x(() => e.draggable), x(() => e.overflow));
		se(async () => {
			await j(), e.closeOnHashChange && window.addEventListener("hashchange", E);
		}), oe(() => {
			e.closeOnHashChange && window.removeEventListener("hashchange", E);
		});
		function E() {
			f.value && (f.value = !1, j(() => {
				p.action && n("action", p.action);
			}));
		}
		let D = () => {
			e.closeOnClickModal && M(p.distinguishCancelAndClose ? "close" : "cancel");
		}, O = ne(D), k = (e) => {
			if (p.inputType !== "textarea" && !S.value?.isComposing) return e.preventDefault(), M("confirm");
		}, M = (t) => {
			e.boxType === "prompt" && t === "confirm" && !N() || (p.action = t, p.beforeClose ? p.beforeClose?.(t, p, E) : E());
		}, N = () => {
			if (e.boxType === "prompt") {
				let e = p.inputPattern;
				if (e && !e.test(p.inputValue || "")) return p.editorErrorMessage = p.inputErrorMessage || c("el.messagebox.error"), p.validateError = !0, !1;
				let t = p.inputValidator;
				if (l(t)) {
					let e = t(p.inputValue);
					if (e === !1) return p.editorErrorMessage = p.inputErrorMessage || c("el.messagebox.error"), p.validateError = !0, !1;
					if (u(e)) return p.editorErrorMessage = e, p.validateError = !0, !1;
				}
			}
			return p.editorErrorMessage = "", p.validateError = !1, !0;
		}, P = () => {
			let e = S.value?.$refs;
			return e?.input ?? e?.textarea;
		}, I = () => {
			M("close");
		}, L = () => {
			e.closeOnPressEscape && I();
		};
		return e.lockScroll && re(f, { ns: o }), {
			...le(p),
			ns: o,
			overlayEvent: O,
			visible: f,
			hasMessage: _,
			typeClass: m,
			contentId: h,
			inputId: g,
			btnSize: s,
			iconComponent: te,
			confirmButtonClasses: w,
			rootRef: v,
			focusStartRef: b,
			headerRef: y,
			inputRef: S,
			isDragging: T,
			confirmRef: C,
			doClose: E,
			handleClose: I,
			onCloseRequested: L,
			handleWrapperClick: D,
			handleInputEnter: k,
			handleAction: M,
			t: c
		};
	}
}), he = ["aria-label", "aria-describedby"], ge = ["aria-label"], _e = ["id"];
function ve(e, t, n, r, i, a) {
	let o = R("el-icon"), s = R("el-input"), c = R("el-button"), l = R("el-focus-trap"), u = R("el-overlay");
	return P(), S(b, {
		name: "fade-in-linear",
		onAfterLeave: t[11] ||= (t) => e.$emit("vanish"),
		persisted: ""
	}, {
		default: H(() => [U(D(u, {
			"z-index": e.zIndex,
			"overlay-class": [e.ns.is("message-box"), e.modalClass],
			mask: e.modal
		}, {
			default: H(() => [T("div", {
				role: "dialog",
				"aria-label": e.title,
				"aria-modal": "true",
				"aria-describedby": e.showInput ? void 0 : e.contentId,
				class: M(`${e.ns.namespace.value}-overlay-message-box`),
				onClick: t[8] ||= (...t) => e.overlayEvent.onClick && e.overlayEvent.onClick(...t),
				onMousedown: t[9] ||= (...t) => e.overlayEvent.onMousedown && e.overlayEvent.onMousedown(...t),
				onMouseup: t[10] ||= (...t) => e.overlayEvent.onMouseup && e.overlayEvent.onMouseup(...t)
			}, [D(l, {
				loop: "",
				trapped: e.visible,
				"focus-trap-el": e.rootRef,
				"focus-start-el": e.focusStartRef,
				onReleaseRequested: e.onCloseRequested
			}, {
				default: H(() => [T("div", {
					ref: "rootRef",
					class: M([
						e.ns.b(),
						e.customClass,
						e.ns.is("draggable", e.draggable),
						e.ns.is("dragging", e.isDragging),
						{ [e.ns.m("center")]: e.center }
					]),
					style: N(e.customStyle),
					tabindex: "-1",
					onClick: t[7] ||= G(() => {}, ["stop"])
				}, [
					e.title !== null && e.title !== void 0 ? (P(), w("div", {
						key: 0,
						ref: "headerRef",
						class: M([e.ns.e("header"), { "show-close": e.showClose }])
					}, [T("div", { class: M(e.ns.e("title")) }, [e.iconComponent && e.center ? (P(), S(o, {
						key: 0,
						class: M([e.ns.e("status"), e.typeClass])
					}, {
						default: H(() => [(P(), S(z(e.iconComponent)))]),
						_: 1
					}, 8, ["class"])) : C("v-if", !0), T("span", null, B(e.title), 1)], 2), e.showClose ? (P(), w("button", {
						key: 0,
						type: "button",
						class: M(e.ns.e("headerbtn")),
						"aria-label": e.t("el.messagebox.close"),
						onClick: t[0] ||= (t) => e.handleAction(e.distinguishCancelAndClose ? "close" : "cancel"),
						onKeydown: t[1] ||= W(G((t) => e.handleAction(e.distinguishCancelAndClose ? "close" : "cancel"), ["prevent"]), ["enter"])
					}, [D(o, { class: M(e.ns.e("close")) }, {
						default: H(() => [(P(), S(z(e.closeIcon || "close")))]),
						_: 1
					}, 8, ["class"])], 42, ge)) : C("v-if", !0)], 2)) : C("v-if", !0),
					T("div", {
						id: e.contentId,
						class: M(e.ns.e("content"))
					}, [T("div", { class: M(e.ns.e("container")) }, [e.iconComponent && !e.center && e.hasMessage ? (P(), S(o, {
						key: 0,
						class: M([e.ns.e("status"), e.typeClass])
					}, {
						default: H(() => [(P(), S(z(e.iconComponent)))]),
						_: 1
					}, 8, ["class"])) : C("v-if", !0), e.hasMessage ? (P(), w("div", {
						key: 1,
						class: M(e.ns.e("message"))
					}, [L(e.$slots, "default", {}, () => [e.dangerouslyUseHTMLString ? (P(), S(z(e.showInput ? "label" : "p"), {
						key: 1,
						for: e.showInput ? e.inputId : void 0,
						innerHTML: e.message
					}, null, 8, ["for", "innerHTML"])) : (P(), S(z(e.showInput ? "label" : "p"), {
						key: 0,
						for: e.showInput ? e.inputId : void 0,
						textContent: B(e.message)
					}, null, 8, ["for", "textContent"]))])], 2)) : C("v-if", !0)], 2), U(T("div", { class: M(e.ns.e("input")) }, [D(s, {
						id: e.inputId,
						ref: "inputRef",
						modelValue: e.inputValue,
						"onUpdate:modelValue": t[2] ||= (t) => e.inputValue = t,
						type: e.inputType,
						placeholder: e.inputPlaceholder,
						"aria-invalid": e.validateError,
						class: M({ invalid: e.validateError }),
						onKeydown: W(e.handleInputEnter, ["enter"])
					}, null, 8, [
						"id",
						"modelValue",
						"type",
						"placeholder",
						"aria-invalid",
						"class",
						"onKeydown"
					]), T("div", {
						class: M(e.ns.e("errormsg")),
						style: N({ visibility: e.editorErrorMessage ? "visible" : "hidden" })
					}, B(e.editorErrorMessage), 7)], 2), [[V, e.showInput]])], 10, _e),
					T("div", { class: M(e.ns.e("btns")) }, [e.showCancelButton ? (P(), S(c, {
						key: 0,
						type: e.cancelButtonType === "text" ? "" : e.cancelButtonType,
						text: e.cancelButtonType === "text",
						loading: e.cancelButtonLoading,
						"loading-icon": e.cancelButtonLoadingIcon,
						class: M([e.cancelButtonClass]),
						round: e.roundButton,
						size: e.btnSize,
						onClick: t[3] ||= (t) => e.handleAction("cancel"),
						onKeydown: t[4] ||= W(G((t) => e.handleAction("cancel"), ["prevent"]), ["enter"])
					}, {
						default: H(() => [E(B(e.cancelButtonText || e.t("el.messagebox.cancel")), 1)]),
						_: 1
					}, 8, [
						"type",
						"text",
						"loading",
						"loading-icon",
						"class",
						"round",
						"size"
					])) : C("v-if", !0), U(D(c, {
						ref: "confirmRef",
						type: e.confirmButtonType === "text" ? "" : e.confirmButtonType,
						text: e.confirmButtonType === "text",
						loading: e.confirmButtonLoading,
						"loading-icon": e.confirmButtonLoadingIcon,
						class: M([e.confirmButtonClasses]),
						round: e.roundButton,
						disabled: e.confirmButtonDisabled,
						size: e.btnSize,
						onClick: t[5] ||= (t) => e.handleAction("confirm"),
						onKeydown: t[6] ||= W(G((t) => e.handleAction("confirm"), ["prevent"]), ["enter"])
					}, {
						default: H(() => [E(B(e.confirmButtonText || e.t("el.messagebox.confirm")), 1)]),
						_: 1
					}, 8, [
						"type",
						"text",
						"loading",
						"loading-icon",
						"class",
						"round",
						"disabled",
						"size"
					]), [[V, e.showConfirmButton]])], 2)
				], 6)]),
				_: 3
			}, 8, [
				"trapped",
				"focus-trap-el",
				"focus-start-el",
				"onReleaseRequested"
			])], 42, he)]),
			_: 3
		}, 8, [
			"z-index",
			"overlay-class",
			"mask"
		]), [[V, e.visible]])]),
		_: 3
	});
}
var ye = /* @__PURE__ */ h(me, [["render", ve]]), J = /* @__PURE__ */ new Map(), be = (e) => {
	let t = document.body;
	return e.appendTo && (u(e.appendTo) && (t = document.querySelector(e.appendTo)), i(e.appendTo) && (t = e.appendTo), i(t) || (n("ElMessageBox", "the appendTo option is not an HTMLElement. Falling back to document.body."), t = document.body)), t;
}, xe = (e, t, n = null) => {
	let r = D(ye, e, l(e.message) || k(e.message) ? { default: l(e.message) ? e.message : () => e.message } : null);
	return r.appContext = n, I(r, t), be(e).appendChild(t.firstElementChild), r.component;
}, Se = () => document.createElement("div"), Ce = (e, t) => {
	let n = Se();
	e.onVanish = () => {
		I(null, n), J.delete(i);
	}, e.onAction = (t) => {
		let n = J.get(i), a;
		a = e.showInput ? {
			value: i.inputValue,
			action: t
		} : t, e.callback ? e.callback(a, r.proxy) : t === "cancel" || t === "close" ? e.distinguishCancelAndClose && t !== "cancel" ? n.reject("close") : n.reject("cancel") : n.resolve(a);
	};
	let r = xe(e, n, t), i = r.proxy;
	for (let t in e) a(e, t) && !a(i.$props, t) && (t === "closeIcon" && s(e[t]) ? i[t] = A(e[t]) : i[t] = e[t]);
	return i.visible = !0, i;
};
function Y(e, t = null) {
	if (!d) return Promise.reject();
	let n;
	return u(e) || k(e) ? e = { message: e } : n = e.callback, new Promise((r, i) => {
		let a = Ce(e, t ?? Y._context);
		J.set(a, {
			options: e,
			callback: n,
			resolve: r,
			reject: i
		});
	});
}
var we = [
	"alert",
	"confirm",
	"prompt"
], Te = {
	alert: {
		closeOnPressEscape: !1,
		closeOnClickModal: !1
	},
	confirm: { showCancelButton: !0 },
	prompt: {
		showCancelButton: !0,
		showInput: !0
	}
};
we.forEach((e) => {
	Y[e] = Ee(e);
});
function Ee(e) {
	return (t, n, r, i) => {
		let a = "";
		return s(n) ? (r = n, a = "") : a = o(n) ? "" : n, Y(Object.assign({
			title: a,
			message: t,
			type: "",
			...Te[e]
		}, r, { boxType: e }), i);
	};
}
Y.close = () => {
	J.forEach((e, t) => {
		t.doClose();
	}), J.clear();
}, Y._context = null;
//#endregion
//#region ../../node_modules/.pnpm/element-plus@2.13.6_typescript@6.0.2_vue@3.5.32_typescript@6.0.2_/node_modules/element-plus/es/components/message-box/index.mjs
var X = Y;
X.install = (e) => {
	X._context = e._context, e.config.globalProperties.$msgbox = X, e.config.globalProperties.$messageBox = X, e.config.globalProperties.$alert = X.alert, e.config.globalProperties.$confirm = X.confirm, e.config.globalProperties.$prompt = X.prompt;
};
var Z = X, Q = {
	type: "",
	showCancelButton: !0,
	showConfirmButton: !0,
	cancelButtonText: "取消",
	confirmButtonText: "确定",
	closeOnClickModal: !1,
	closeOnPressEscape: !1,
	showClose: !0,
	draggable: !1,
	center: !1,
	roundButton: !1
}, $ = {
	confirm(e, t, n = {}) {
		return Z.confirm(e, t, {
			...Q,
			customClass: "zh-message-box zh-message-confirm",
			...n
		});
	},
	alert(e, t, n = {}) {
		return Z.alert(e, t, {
			...Q,
			...n,
			showCancelButton: !1,
			customClass: "zh-message-box  zh-message-alert"
		});
	},
	prompt(e, t, n = {}) {
		return Z.prompt(e, t, {
			...Q,
			...n,
			customClass: "zh-message-box zh-message-prompt"
		});
	}
}, De = $.confirm, Oe = $.alert, ke = $.prompt, Ae = $;
//#endregion
export { ke as i, Oe as n, De as r, Ae as t };
