var eo = Object.defineProperty, oo = Object.defineProperties; var to = Object.getOwnPropertyDescriptors; var Ce = Object.getOwnPropertySymbols; var no = Object.prototype.hasOwnProperty, lo = Object.prototype.propertyIsEnumerable; var be = (e, o, t) => o in e ? eo(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t, te = (e, o) => { for (var t in o || (o = {})) no.call(o, t) && be(e, t, o[t]); if (Ce) for (var t of Ce(o)) lo.call(o, t) && be(e, t, o[t]); return e; }, ue = (e, o) => oo(e, to(o)); import { defineComponent as K, ref as F, computed as Z, createVNode as u, Transition as Ie, withDirectives as Ae, vShow as ze, nextTick as Re, shallowRef as L, watch as _, onBeforeUnmount as Ne, watchEffect as Ee, Fragment as ao, render as he, unref as ve, isRef as De, toRefs as io, customRef as ro, getCurrentScope as so, onScopeDispose as co, useAttrs as uo, openBlock as fe, createBlock as xe, mergeProps as fo, createSlots as mo, withCtx as ie, createElementVNode as re, renderSlot as Se, normalizeStyle as po, resolveDynamicComponent as vo, toDisplayString as go, createElementBlock as yo, createCommentVNode as Co } from "vue"; import bo from "./ModalHeader.js"; import { cP as ho, aI as Le, P as z, _ as B, az as We, d as m, au as xo, c as le, o as ke, i as ce, cQ as So, K as $e, cR as $o, c3 as wo, g as Bo, m as To, bS as Po, r as Fo, cO as Oo, aH as Mo, aL as ge, u as Ho, bG as Ve, a3 as se, aQ as Io, B as we, cS as Ao, e as ne, cT as zo, a as Ro, bz as No, aP as Eo, aR as Do, cU as Lo, cV as Wo, cW as ko, cX as Vo, cY as _o, cZ as jo, aM as Go, n as Xo } from "./index2.js"; import { A as Be } from "./ActionButton.js"; const Yo = new Le("antFadeIn", { "0%": { opacity: 0 }, "100%": { opacity: 1 } }), Ko = new Le("antFadeOut", { "0%": { opacity: 1 }, "100%": { opacity: 0 } }), Uo = function(e) { let o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1; const { antCls: t } = e, n = `${t}-fade`, l = o ? "&" : ""; return [ho(n, Yo, Ko, e.motionDurationMid, o), { [` ${l}${n}-enter, ${l}${n}-appear `]: { opacity: 0, animationTimingFunction: "linear" }, [`${l}${n}-leave`]: { animationTimingFunction: "linear" } }]; }; function ye() { return { keyboard: { type: Boolean, default: void 0 }, mask: { type: Boolean, default: void 0 }, afterClose: Function, closable: { type: Boolean, default: void 0 }, maskClosable: { type: Boolean, default: void 0 }, visible: { type: Boolean, default: void 0 }, destroyOnClose: { type: Boolean, default: void 0 }, mousePosition: z.shape({ x: Number, y: Number }).loose, title: z.any, footer: z.any, transitionName: String, maskTransitionName: String, animation: z.any, maskAnimation: z.any, wrapStyle: { type: Object, default: void 0 }, bodyStyle: { type: Object, default: void 0 }, maskStyle: { type: Object, default: void 0 }, prefixCls: String, wrapClassName: String, rootClassName: String, width: [String, Number], height: [String, Number], zIndex: Number, bodyProps: z.any, maskProps: z.any, wrapProps: z.any, getContainer: z.any, dialogStyle: { type: Object, default: void 0 }, dialogClass: String, closeIcon: z.any, forceRender: { type: Boolean, default: void 0 }, getOpenCount: Function, // https://github.com/ant-design/ant-design/issues/19771 // https://github.com/react-component/dialog/issues/95 focusTriggerAfterClose: { type: Boolean, default: void 0 }, onClose: Function, modalRender: Function }; } function Te(e, o, t) { let n = o; return !n && t && (n = `${e}-${t}`), n; } let Pe = -1; function Qo() { return Pe += 1, Pe; } function Fe(e, o) { let t = e[`page${o ? "Y" : "X"}Offset`]; const n = `scroll${o ? "Top" : "Left"}`; if (typeof t != "number") { const l = e.document; t = l.documentElement[n], typeof t != "number" && (t = l.body[n]); } return t; } function Zo(e) { const o = e.getBoundingClientRect(), t = { left: o.left, top: o.top }, n = e.ownerDocument, l = n.defaultView || n.parentWindow; return t.left += Fe(l), t.top += Fe(l, !0), t; } const qo = { width: 0, height: 0, overflow: "hidden", outline: "none" }, Jo = { outline: "none" }, et = K({ compatConfig: { MODE: 3 }, name: "DialogContent", inheritAttrs: !1, props: m(m({}, ye()), { motionName: String, ariaId: String, onVisibleChanged: Function, onMousedown: Function, onMouseup: Function }), setup(e, o) { let { expose: t, slots: n, attrs: l } = o; const a = F(), p = F(), v = F(); t({ focus: () => { var r; (r = a.value) === null || r === void 0 || r.focus({ preventScroll: !0 }); }, changeActive: (r) => { const { activeElement: i } = document; r && i === p.value ? a.value.focus({ preventScroll: !0 }) : !r && i === a.value && p.value.focus({ preventScroll: !0 }); } }); const x = F(), f = Z(() => { const { width: r, height: i } = e, y = {}; return r !== void 0 && (y.width = typeof r == "number" ? `${r}px` : r), i !== void 0 && (y.height = typeof i == "number" ? `${i}px` : i), x.value && (y.transformOrigin = x.value), y; }), s = () => { Re(() => { if (v.value) { const r = Zo(v.value); x.value = e.mousePosition ? `${e.mousePosition.x - r.left}px ${e.mousePosition.y - r.top}px` : ""; } }); }, c = (r) => { e.onVisibleChanged(r); }; return () => { var r, i, y, h; const { prefixCls: S, footer: d = (r = n.footer) === null || r === void 0 ? void 0 : r.call(n), title: g = (i = n.title) === null || i === void 0 ? void 0 : i.call(n), ariaId: b, closable: T, closeIcon: M = (y = n.closeIcon) === null || y === void 0 ? void 0 : y.call(n), onClose: H, bodyStyle: R, bodyProps: C, onMousedown: P, onMouseup: $, visible: I, modalRender: O = n.modalRender, destroyOnClose: N, motionName: E } = e; let X; d && (X = u("div", { class: `${S}-footer` }, [d])); let Y; g && (Y = u("div", { class: `${S}-header` }, [u("div", { class: `${S}-title`, id: b }, [g])])); let G; T && (G = u("button", { type: "button", onClick: H, "aria-label": "Close", class: `${S}-close` }, [M || u("span", { class: `${S}-close-x` }, null)])); const k = u("div", { class: `${S}-content` }, [G, Y, u("div", B({ class: `${S}-body`, style: R }, C), [(h = n.default) === null || h === void 0 ? void 0 : h.call(n)]), X]), w = We(E); return u(Ie, B(B({}, w), {}, { onBeforeEnter: s, onAfterEnter: () => c(!0), onAfterLeave: () => c(!1) }), { default: () => [I || !N ? Ae(u("div", B(B({}, l), {}, { ref: v, key: "dialog-element", role: "document", style: [f.value, l.style], class: [S, l.class], onMousedown: P, onMouseup: $ }), [u("div", { tabindex: 0, ref: a, style: Jo }, [O ? O({ originVNode: k }) : k]), u("div", { tabindex: 0, ref: p, style: qo }, null)]), [[ze, I]]) : null] }); }; } }), ot = K({ compatConfig: { MODE: 3 }, name: "DialogMask", props: { prefixCls: String, visible: Boolean, motionName: String, maskProps: Object }, setup(e, o) { return () => { const { prefixCls: t, visible: n, maskProps: l, motionName: a } = e, p = We(a); return u(Ie, p, { default: () => [Ae(u("div", B({ class: `${t}-mask` }, l), null), [[ze, n]])] }); }; } }), Oe = K({ compatConfig: { MODE: 3 }, name: "VcDialog", inheritAttrs: !1, props: ce(m(m({}, ye()), { getOpenCount: Function, scrollLocker: Object }), { mask: !0, visible: !1, keyboard: !0, closable: !0, maskClosable: !0, destroyOnClose: !1, prefixCls: "rc-dialog", getOpenCount: () => null, focusTriggerAfterClose: !0 }), setup(e, o) { let { attrs: t, slots: n } = o; const l = L(), a = L(), p = L(), v = L(e.visible), x = L(`vcDialogTitle${Qo()}`), f = (d) => { var g, b; if (d) So(a.value, document.activeElement) || (l.value = document.activeElement, (g = p.value) === null || g === void 0 || g.focus()); else { const T = v.value; if (v.value = !1, e.mask && l.value && e.focusTriggerAfterClose) { try { l.value.focus({ preventScroll: !0 }); } catch (M) { } l.value = null; } T && ((b = e.afterClose) === null || b === void 0 || b.call(e)); } }, s = (d) => { var g; (g = e.onClose) === null || g === void 0 || g.call(e, d); }, c = L(!1), r = L(), i = () => { clearTimeout(r.value), c.value = !0; }, y = () => { r.value = setTimeout(() => { c.value = !1; }); }, h = (d) => { if (!e.maskClosable) return null; c.value ? c.value = !1 : a.value === d.target && s(d); }, S = (d) => { if (e.keyboard && d.keyCode === $e.ESC) { d.stopPropagation(), s(d); return; } e.visible && d.keyCode === $e.TAB && p.value.changeActive(!d.shiftKey); }; return _(() => e.visible, () => { e.visible && (v.value = !0); }, { flush: "post" }), Ne(() => { var d; clearTimeout(r.value), (d = e.scrollLocker) === null || d === void 0 || d.unLock(); }), Ee(() => { var d, g; (d = e.scrollLocker) === null || d === void 0 || d.unLock(), v.value && ((g = e.scrollLocker) === null || g === void 0 || g.lock()); }), () => { const { prefixCls: d, mask: g, visible: b, maskTransitionName: T, maskAnimation: M, zIndex: H, wrapClassName: R, rootClassName: C, wrapStyle: P, closable: $, maskProps: I, maskStyle: O, transitionName: N, animation: E, wrapProps: X, title: Y = n.title } = e, { style: G, class: k } = t; return u("div", B({ class: [`${d}-root`, C] }, xo(e, { data: !0 })), [u(ot, { prefixCls: d, visible: g && b, motionName: Te(d, T, M), style: m({ zIndex: H }, O), maskProps: I }, null), u("div", B({ tabIndex: -1, onKeydown: S, class: le(`${d}-wrap`, R), ref: a, onClick: h, role: "dialog", "aria-labelledby": Y ? x.value : null, style: m(m({ zIndex: H }, P), { display: v.value ? null : "none" }) }, X), [u(et, B(B({}, ke(e, ["scrollLocker"])), {}, { style: G, class: k, onMousedown: i, onMouseup: y, ref: p, closable: $, ariaId: x.value, prefixCls: d, visible: b, onClose: s, onVisibleChanged: f, motionName: Te(d, N, E) }), n)])]); }; } }), tt = ye(), nt = K({ compatConfig: { MODE: 3 }, name: "DialogWrap", inheritAttrs: !1, props: ce(tt, { visible: !1 }), setup(e, o) { let { attrs: t, slots: n } = o; const l = F(e.visible); return $o({}, { inTriggerContext: !1 }), _(() => e.visible, () => { e.visible && (l.value = !0); }, { flush: "post" }), () => { const { visible: a, getContainer: p, forceRender: v, destroyOnClose: x = !1, afterClose: f } = e; let s = m(m(m({}, e), t), { ref: "_component", key: "dialog" }); return p === !1 ? u(Oe, B(B({}, s), {}, { getOpenCount: () => 2 }), n) : !v && x && !l.value ? null : u(wo, { autoLock: !0, visible: a, forceRender: v, getContainer: p }, { default: (c) => (s = m(m(m({}, s), c), { afterClose: () => { f == null || f(), l.value = !1; } }), u(Oe, s, n)) }); }; } }); function Me(e) { return { position: e, top: 0, insetInlineEnd: 0, bottom: 0, insetInlineStart: 0 }; } const lt = (e) => { const { componentCls: o } = e; return [{ [`${o}-root`]: { [`${o}${e.antCls}-zoom-enter, ${o}${e.antCls}-zoom-appear`]: { // reset scale avoid mousePosition bug transform: "none", opacity: 0, animationDuration: e.motionDurationSlow, // https://github.com/ant-design/ant-design/issues/11777 userSelect: "none" }, [`${o}${e.antCls}-zoom-leave ${o}-content`]: { pointerEvents: "none" }, [`${o}-mask`]: m(m({}, Me("fixed")), { zIndex: e.zIndexPopupBase, height: "100%", backgroundColor: e.colorBgMask, [`${o}-hidden`]: { display: "none" } }), [`${o}-wrap`]: m(m({}, Me("fixed")), { overflow: "auto", outline: 0, WebkitOverflowScrolling: "touch" }) } }, { [`${o}-root`]: Uo(e) }]; }, at = (e) => { const { componentCls: o } = e; return [ // ======================== Root ========================= { [`${o}-root`]: { [`${o}-wrap`]: { zIndex: e.zIndexPopupBase, position: "fixed", inset: 0, overflow: "auto", outline: 0, WebkitOverflowScrolling: "touch" }, [`${o}-wrap-rtl`]: { direction: "rtl" }, [`${o}-centered`]: { textAlign: "center", "&::before": { display: "inline-block", width: 0, height: "100%", verticalAlign: "middle", content: '""' }, [o]: { top: 0, display: "inline-block", paddingBottom: 0, textAlign: "start", verticalAlign: "middle" } }, [`@media (max-width: ${e.screenSMMax})`]: { [o]: { maxWidth: "calc(100vw - 16px)", margin: `${e.marginXS} auto` }, [`${o}-centered`]: { [o]: { flex: 1 } } } } }, // ======================== Modal ======================== { [o]: m(m({}, Fo(e)), { pointerEvents: "none", position: "relative", top: 100, width: "auto", maxWidth: `calc(100vw - ${e.margin * 2}px)`, margin: "0 auto", paddingBottom: e.paddingLG, [`${o}-title`]: { margin: 0, color: e.modalHeadingColor, fontWeight: e.fontWeightStrong, fontSize: e.modalHeaderTitleFontSize, lineHeight: e.modalHeaderTitleLineHeight, wordWrap: "break-word" }, [`${o}-content`]: { position: "relative", backgroundColor: e.modalContentBg, backgroundClip: "padding-box", border: 0, borderRadius: e.borderRadiusLG, boxShadow: e.boxShadowSecondary, pointerEvents: "auto", padding: `${e.paddingMD}px ${e.paddingContentHorizontalLG}px` }, [`${o}-close`]: m({ position: "absolute", top: (e.modalHeaderCloseSize - e.modalCloseBtnSize) / 2, insetInlineEnd: (e.modalHeaderCloseSize - e.modalCloseBtnSize) / 2, zIndex: e.zIndexPopupBase + 10, padding: 0, color: e.modalCloseColor, fontWeight: e.fontWeightStrong, lineHeight: 1, textDecoration: "none", background: "transparent", borderRadius: e.borderRadiusSM, width: e.modalConfirmIconSize, height: e.modalConfirmIconSize, border: 0, outline: 0, cursor: "pointer", transition: `color ${e.motionDurationMid}, background-color ${e.motionDurationMid}`, "&-x": { display: "block", fontSize: e.fontSizeLG, fontStyle: "normal", lineHeight: `${e.modalCloseBtnSize}px`, textAlign: "center", textTransform: "none", textRendering: "auto" }, "&:hover": { color: e.modalIconHoverColor, backgroundColor: e.wireframe ? "transparent" : e.colorFillContent, textDecoration: "none" }, "&:active": { backgroundColor: e.wireframe ? "transparent" : e.colorFillContentHover } }, Oo(e)), [`${o}-header`]: { color: e.colorText, background: e.modalHeaderBg, borderRadius: `${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`, marginBottom: e.marginXS }, [`${o}-body`]: { fontSize: e.fontSize, lineHeight: e.lineHeight, wordWrap: "break-word" }, [`${o}-footer`]: { textAlign: "end", background: e.modalFooterBg, marginTop: e.marginSM, [`${e.antCls}-btn + ${e.antCls}-btn:not(${e.antCls}-dropdown-trigger)`]: { marginBottom: 0, marginInlineStart: e.marginXS } }, [`${o}-open`]: { overflow: "hidden" } }) }, // ======================== Pure ========================= { [`${o}-pure-panel`]: { top: "auto", padding: 0, display: "flex", flexDirection: "column", [`${o}-content, ${o}-body, ${o}-confirm-body-wrapper`]: { display: "flex", flexDirection: "column", flex: "auto" }, [`${o}-confirm-body`]: { marginBottom: "auto" } } } ]; }, it = (e) => { const { componentCls: o } = e, t = `${o}-confirm`; return { [t]: { "&-rtl": { direction: "rtl" }, [`${e.antCls}-modal-header`]: { display: "none" }, [`${t}-body-wrapper`]: m({}, Mo()), [`${t}-body`]: { display: "flex", flexWrap: "wrap", alignItems: "center", [`${t}-title`]: { flex: "0 0 100%", display: "block", // create BFC to avoid // https://user-images.githubusercontent.com/507615/37702510-ba844e06-2d2d-11e8-9b67-8e19be57f445.png overflow: "hidden", color: e.colorTextHeading, fontWeight: e.fontWeightStrong, fontSize: e.modalHeaderTitleFontSize, lineHeight: e.modalHeaderTitleLineHeight, [`+ ${t}-content`]: { marginBlockStart: e.marginXS, flexBasis: "100%", maxWidth: `calc(100% - ${e.modalConfirmIconSize + e.marginSM}px)` } }, [`${t}-content`]: { color: e.colorText, fontSize: e.fontSize }, [`> ${e.iconCls}`]: { flex: "none", marginInlineEnd: e.marginSM, fontSize: e.modalConfirmIconSize, [`+ ${t}-title`]: { flex: 1 }, // `content` after `icon` should set marginLeft [`+ ${t}-title + ${t}-content`]: { marginInlineStart: e.modalConfirmIconSize + e.marginSM } } }, [`${t}-btns`]: { textAlign: "end", marginTop: e.marginSM, [`${e.antCls}-btn + ${e.antCls}-btn`]: { marginBottom: 0, marginInlineStart: e.marginXS } } }, [`${t}-error ${t}-body > ${e.iconCls}`]: { color: e.colorError }, [`${t}-warning ${t}-body > ${e.iconCls}, ${t}-confirm ${t}-body > ${e.iconCls}`]: { color: e.colorWarning }, [`${t}-info ${t}-body > ${e.iconCls}`]: { color: e.colorInfo }, [`${t}-success ${t}-body > ${e.iconCls}`]: { color: e.colorSuccess }, // https://github.com/ant-design/ant-design/issues/37329 [`${o}-zoom-leave ${o}-btns`]: { pointerEvents: "none" } }; }, rt = (e) => { const { componentCls: o } = e; return { [`${o}-root`]: { [`${o}-wrap-rtl`]: { direction: "rtl", [`${o}-confirm-body`]: { direction: "rtl" } } } }; }, st = (e) => { const { componentCls: o, antCls: t } = e, n = `${o}-confirm`; return { [o]: { [`${o}-content`]: { padding: 0 }, [`${o}-header`]: { padding: e.modalHeaderPadding, borderBottom: `${e.modalHeaderBorderWidth}px ${e.modalHeaderBorderStyle} ${e.modalHeaderBorderColorSplit}`, marginBottom: 0 }, [`${o}-body`]: { padding: e.modalBodyPadding }, [`${o}-footer`]: { padding: `${e.modalFooterPaddingVertical}px ${e.modalFooterPaddingHorizontal}px`, borderTop: `${e.modalFooterBorderWidth}px ${e.modalFooterBorderStyle} ${e.modalFooterBorderColorSplit}`, borderRadius: `0 0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px`, marginTop: 0 } }, [n]: { [`${t}-modal-body`]: { padding: `${e.padding * 2}px ${e.padding * 2}px ${e.paddingLG}px` }, [`${n}-body`]: { [`> ${e.iconCls}`]: { marginInlineEnd: e.margin, // `content` after `icon` should set marginLeft [`+ ${n}-title + ${n}-content`]: { marginInlineStart: e.modalConfirmIconSize + e.margin } } }, [`${n}-btns`]: { marginTop: e.marginLG } } }; }, ct = Bo("Modal", (e) => { const o = e.padding, t = e.fontSizeHeading5, n = e.lineHeightHeading5, l = To(e, { modalBodyPadding: e.paddingLG, modalHeaderBg: e.colorBgElevated, modalHeaderPadding: `${o}px ${e.paddingLG}px`, modalHeaderBorderWidth: e.lineWidth, modalHeaderBorderStyle: e.lineType, modalHeaderTitleLineHeight: n, modalHeaderTitleFontSize: t, modalHeaderBorderColorSplit: e.colorSplit, modalHeaderCloseSize: n * t + o * 2, modalContentBg: e.colorBgElevated, modalHeadingColor: e.colorTextHeading, modalCloseColor: e.colorTextDescription, modalFooterBg: "transparent", modalFooterBorderColorSplit: e.colorSplit, modalFooterBorderStyle: e.lineType, modalFooterPaddingVertical: e.paddingXS, modalFooterPaddingHorizontal: e.padding, modalFooterBorderWidth: e.lineWidth, modalConfirmTitleFontSize: e.fontSizeLG, modalIconHoverColor: e.colorIconHover, modalConfirmIconSize: e.fontSize * e.lineHeight, modalCloseBtnSize: e.controlHeightLG * 0.55 }); return [at(l), it(l), rt(l), lt(l), e.wireframe && st(l), Po(l, "zoom")]; }); var dt = function(e, o) { var t = {}; for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && o.indexOf(n) < 0 && (t[n] = e[n]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var l = 0, n = Object.getOwnPropertySymbols(e); l < n.length; l++) o.indexOf(n[l]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[l]) && (t[n[l]] = e[n[l]]); return t; }; let pe; const ut = (e) => { pe = { x: e.pageX, y: e.pageY }, setTimeout(() => pe = null, 100); }; zo() && Ro(document.documentElement, "click", ut, !0); const ft = () => ({ prefixCls: String, /** @deprecated Please use `open` instead. */ visible: { type: Boolean, default: void 0 }, open: { type: Boolean, default: void 0 }, confirmLoading: { type: Boolean, default: void 0 }, title: z.any, closable: { type: Boolean, default: void 0 }, closeIcon: z.any, onOk: Function, onCancel: Function, "onUpdate:visible": Function, "onUpdate:open": Function, onChange: Function, afterClose: Function, centered: { type: Boolean, default: void 0 }, width: [String, Number], footer: z.any, okText: z.any, okType: String, cancelText: z.any, icon: z.any, maskClosable: { type: Boolean, default: void 0 }, forceRender: { type: Boolean, default: void 0 }, okButtonProps: ne(), cancelButtonProps: ne(), destroyOnClose: { type: Boolean, default: void 0 }, wrapClassName: String, maskTransitionName: String, transitionName: String, getContainer: { type: [String, Function, Boolean, Object], default: void 0 }, zIndex: Number, bodyStyle: ne(), maskStyle: ne(), mask: { type: Boolean, default: void 0 }, keyboard: { type: Boolean, default: void 0 }, wrapProps: Object, focusTriggerAfterClose: { type: Boolean, default: void 0 }, modalRender: Function, mousePosition: ne() }), W = K({ compatConfig: { MODE: 3 }, name: "AModal", inheritAttrs: !1, props: ce(ft(), { width: 520, confirmLoading: !1, okType: "primary" }), setup(e, o) { let { emit: t, slots: n, attrs: l } = o; const [a] = ge("Modal"), { prefixCls: p, rootPrefixCls: v, direction: x, getPopupContainer: f } = Ho("modal", e), [s, c] = ct(p); Ve(e.visible === void 0, "Modal", "`visible` will be removed in next major version, please use `open` instead."); const r = (h) => { t("update:visible", !1), t("update:open", !1), t("cancel", h), t("change", !1); }, i = (h) => { t("ok", h); }, y = () => { var h, S; const { okText: d = (h = n.okText) === null || h === void 0 ? void 0 : h.call(n), okType: g, cancelText: b = (S = n.cancelText) === null || S === void 0 ? void 0 : S.call(n), confirmLoading: T } = e; return u(ao, null, [u(we, B({ onClick: r }, e.cancelButtonProps), { default: () => [b || a.value.cancelText] }), u(we, B(B({}, Ao(g)), {}, { loading: T, onClick: i }, e.okButtonProps), { default: () => [d || a.value.okText] })]); }; return () => { var h, S; const { prefixCls: d, visible: g, open: b, wrapClassName: T, centered: M, getContainer: H, closeIcon: R = (h = n.closeIcon) === null || h === void 0 ? void 0 : h.call(n), focusTriggerAfterClose: C = !0 } = e, P = dt(e, ["prefixCls", "visible", "open", "wrapClassName", "centered", "getContainer", "closeIcon", "focusTriggerAfterClose"]), $ = le(T, { [`${p.value}-centered`]: !!M, [`${p.value}-wrap-rtl`]: x.value === "rtl" }); return s(u(nt, B(B(B({}, P), l), {}, { rootClassName: c.value, class: le(c.value, l.class), getContainer: H || (f == null ? void 0 : f.value), prefixCls: p.value, wrapClassName: $, visible: b != null ? b : g, onClose: r, focusTriggerAfterClose: C, transitionName: se(v.value, "zoom", e.transitionName), maskTransitionName: se(v.value, "fade", e.maskTransitionName), mousePosition: (S = P.mousePosition) !== null && S !== void 0 ? S : pe }), m(m({}, n), { footer: n.footer || y, closeIcon: () => u("span", { class: `${p.value}-close-x` }, [R || u(Io, { class: `${p.value}-close-icon` }, null)]) }))); }; } }); function J(e) { return typeof e == "function" ? e() : e; } const _e = K({ name: "ConfirmDialog", inheritAttrs: !1, props: ["icon", "onCancel", "onOk", "close", "closable", "zIndex", "afterClose", "visible", "open", "keyboard", "centered", "getContainer", "maskStyle", "okButtonProps", "cancelButtonProps", "okType", "prefixCls", "okCancel", "width", "mask", "maskClosable", "okText", "cancelText", "autoFocusButton", "transitionName", "maskTransitionName", "type", "title", "content", "direction", "rootPrefixCls", "bodyStyle", "closeIcon", "modalRender", "focusTriggerAfterClose", "wrapClassName", "confirmPrefixCls", "footer"], setup(e, o) { let { attrs: t } = o; const [n] = ge("Modal"); return process.env.NODE_ENV !== "production" && Ve(e.visible === void 0, "Modal", "`visible` is deprecated, please use `open` instead."), () => { const { icon: l, onCancel: a, onOk: p, close: v, okText: x, closable: f = !1, zIndex: s, afterClose: c, keyboard: r, centered: i, getContainer: y, maskStyle: h, okButtonProps: S, cancelButtonProps: d, okCancel: g, width: b = 416, mask: T = !0, maskClosable: M = !1, type: H, open: R, title: C, content: P, direction: $, closeIcon: I, modalRender: O, focusTriggerAfterClose: N, rootPrefixCls: E, bodyStyle: X, wrapClassName: Y, footer: G } = e; let k = l; if (!l && l !== null) switch (H) { case "info": k = u(Lo, null, null); break; case "success": k = u(Do, null, null); break; case "error": k = u(Eo, null, null); break; default: k = u(No, null, null); } const w = e.okType || "primary", V = e.prefixCls || "ant-modal", D = `${V}-confirm`, j = t.style || {}, ee = g != null ? g : H === "confirm", oe = e.autoFocusButton === null ? !1 : e.autoFocusButton || "ok", U = `${V}-confirm`, q = le(U, `${U}-${e.type}`, { [`${U}-rtl`]: $ === "rtl" }, t.class), de = n.value, qe = ee && u(Be, { actionFn: a, close: v, autofocus: oe === "cancel", buttonProps: d, prefixCls: `${E}-btn` }, { default: () => [J(e.cancelText) || de.cancelText] }); return u(W, { prefixCls: V, class: q, wrapClassName: le({ [`${U}-centered`]: !!i }, Y), onCancel: (Je) => v == null ? void 0 : v({ triggerCancel: !0 }, Je), open: R, title: "", footer: "", transitionName: se(E, "zoom", e.transitionName), maskTransitionName: se(E, "fade", e.maskTransitionName), mask: T, maskClosable: M, maskStyle: h, style: j, bodyStyle: X, width: b, zIndex: s, afterClose: c, keyboard: r, centered: i, getContainer: y, closable: f, closeIcon: I, modalRender: O, focusTriggerAfterClose: N }, { default: () => [u("div", { class: `${D}-body-wrapper` }, [u("div", { class: `${D}-body` }, [J(k), C === void 0 ? null : u("span", { class: `${D}-title` }, [J(C)]), u("div", { class: `${D}-content` }, [J(P)])]), G !== void 0 ? J(G) : u("div", { class: `${D}-btns` }, [qe, u(Be, { type: w, actionFn: p, close: v, autofocus: oe === "ok", buttonProps: S, prefixCls: `${E}-btn` }, { default: () => [J(x) || (ee ? de.okText : de.justOkText)] })])])] }); }; } }), Q = [], ae = (e) => { const o = document.createDocumentFragment(); let t = m(m({}, ke(e, ["parentContext", "appContext"])), { close: a, open: !0 }), n = null; function l() { n && (he(null, o), n = null); for (var f = arguments.length, s = new Array(f), c = 0; c < f; c++) s[c] = arguments[c]; const r = s.some((i) => i && i.triggerCancel); e.onCancel && r && e.onCancel(() => { }, ...s.slice(1)); for (let i = 0; i < Q.length; i++) if (Q[i] === a) { Q.splice(i, 1); break; } } function a() { for (var f = arguments.length, s = new Array(f), c = 0; c < f; c++) s[c] = arguments[c]; t = m(m({}, t), { open: !1, afterClose: () => { typeof e.afterClose == "function" && e.afterClose(), l.apply(this, s); } }), t.visible && delete t.visible, p(t); } function p(f) { typeof f == "function" ? t = f(t) : t = m(m({}, t), f), n && Wo(n, t, o); } const v = (f) => { const s = ko, c = s.prefixCls, r = f.prefixCls || `${c}-modal`, i = s.iconPrefixCls, y = _o(); return u(Vo, B(B({}, s), {}, { prefixCls: c }), { default: () => [u(_e, B(B({}, f), {}, { rootPrefixCls: c, prefixCls: r, iconPrefixCls: i, locale: y, cancelText: f.cancelText || y.cancelText }), null)] }); }; function x(f) { const s = u(v, m({}, f)); return s.appContext = e.parentContext || e.appContext || s.appContext, he(s, o), s; } return n = x(t), Q.push(a), { destroy: a, update: p }; }; function je(e) { return m(m({}, e), { type: "warning" }); } function Ge(e) { return m(m({}, e), { type: "info" }); } function Xe(e) { return m(m({}, e), { type: "success" }); } function Ye(e) { return m(m({}, e), { type: "error" }); } function Ke(e) { return m(m({}, e), { type: "confirm" }); } const mt = () => ({ config: Object, afterClose: Function, destroyAction: Function, open: Boolean }), pt = K({ name: "HookModal", inheritAttrs: !1, props: ce(mt(), { config: { width: 520, okType: "primary" } }), setup(e, o) { let { expose: t } = o; var n; const l = Z(() => e.open), a = Z(() => e.config), { direction: p, getPrefixCls: v } = jo(), x = v("modal"), f = v(), s = () => { var y, h; e == null || e.afterClose(), (h = (y = a.value).afterClose) === null || h === void 0 || h.call(y); }, c = function() { e.destroyAction(...arguments); }; t({ destroy: c }); const r = (n = a.value.okCancel) !== null && n !== void 0 ? n : a.value.type === "confirm", [i] = ge("Modal", Go.Modal); return () => u(_e, B(B({ prefixCls: x, rootPrefixCls: f }, a.value), {}, { close: c, open: l.value, afterClose: s, okText: a.value.okText || (r ? i == null ? void 0 : i.value.okText : i == null ? void 0 : i.value.justOkText), direction: a.value.direction || p.value, cancelText: a.value.cancelText || (i == null ? void 0 : i.value.cancelText) }), null); } }); let He = 0; const vt = K({ name: "ElementsHolder", inheritAttrs: !1, setup(e, o) { let { expose: t } = o; const n = L([]); return t({ addModal: (a) => (n.value.push(a), n.value = n.value.slice(), () => { n.value = n.value.filter((p) => p !== a); }) }), () => n.value.map((a) => a()); } }); function gt() { const e = L(null), o = L([]); _(o, () => { o.value.length && ([...o.value].forEach((p) => { p(); }), o.value = []); }, { immediate: !0 }); const t = (a) => function(v) { var x; He += 1; const f = L(!0), s = L(null), c = L(ve(v)), r = L({}); _(() => v, (b) => { S(m(m({}, De(b) ? b.value : b), r.value)); }); const i = function() { f.value = !1; for (var b = arguments.length, T = new Array(b), M = 0; M < b; M++) T[M] = arguments[M]; const H = T.some((R) => R && R.triggerCancel); c.value.onCancel && H && c.value.onCancel(() => { }, ...T.slice(1)); }; let y; const h = () => u(pt, { key: `modal-${He}`, config: a(c.value), ref: s, open: f.value, destroyAction: i, afterClose: () => { y == null || y(); } }, null); y = (x = e.value) === null || x === void 0 ? void 0 : x.addModal(h), y && Q.push(y); const S = (b) => { c.value = m(m({}, c.value), b); }; return { destroy: () => { s.value ? i() : o.value = [...o.value, i]; }, update: (b) => { r.value = b, s.value ? S(b) : o.value = [...o.value, () => S(b)]; } }; }, n = Z(() => ({ info: t(Ge), success: t(Xe), error: t(Ye), warning: t(je), confirm: t(Ke) })), l = Symbol("modalHolderKey"); return [n.value, () => u(vt, { key: l, ref: e }, null)]; } function Ue(e) { return ae(je(e)); } W.useModal = gt; W.info = function(o) { return ae(Ge(o)); }; W.success = function(o) { return ae(Xe(o)); }; W.error = function(o) { return ae(Ye(o)); }; W.warning = Ue; W.warn = Ue; W.confirm = function(o) { return ae(Ke(o)); }; W.destroyAll = function() { for (; Q.length; ) { const o = Q.pop(); o && o(); } }; W.install = function(e) { return e.component(W.name, W), e; }; function yt(e) { return so() ? (co(e), !0) : !1; } function A(e) { return typeof e == "function" ? e() : ve(e); } const Qe = typeof window != "undefined" && typeof document != "undefined"; typeof WorkerGlobalScope != "undefined" && globalThis instanceof WorkerGlobalScope; const Ct = Object.prototype.toString, bt = (e) => Ct.call(e) === "[object Object]", ht = () => { }; function xt(e, o = {}) { if (!De(e)) return io(e); const t = Array.isArray(e.value) ? Array.from({ length: e.value.length }) : {}; for (const n in e.value) t[n] = ro(() => ({ get() { return e.value[n]; }, set(l) { var a; if ((a = A(o.replaceRef)) != null ? a : !0) if (Array.isArray(e.value)) { const v = [...e.value]; v[n] = l, e.value = v; } else { const v = ue(te({}, e.value), { [n]: l }); Object.setPrototypeOf(v, Object.getPrototypeOf(e.value)), e.value = v; } else e.value[n] = l; } })); return t; } const Ze = Qe ? window : void 0; function St(e) { var o; const t = A(e); return (o = t == null ? void 0 : t.$el) != null ? o : t; } function me(...e) { let o, t, n, l; if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([t, n, l] = e, o = Ze) : [o, t, n, l] = e, !o) return ht; Array.isArray(t) || (t = [t]), Array.isArray(n) || (n = [n]); const a = [], p = () => { a.forEach((s) => s()), a.length = 0; }, v = (s, c, r, i) => (s.addEventListener(c, r, i), () => s.removeEventListener(c, r, i)), x = _( () => [St(o), A(l)], ([s, c]) => { if (p(), !s) return; const r = bt(c) ? te({}, c) : c; a.push( ...t.flatMap((i) => n.map((y) => v(s, i, y, r))) ); }, { immediate: !0, flush: "post" } ), f = () => { x(), p(); }; return yt(f), f; } function $t(e, o = {}) { var t, n; const { pointerTypes: l, preventDefault: a, stopPropagation: p, exact: v, onMove: x, onEnd: f, onStart: s, initialValue: c, axis: r = "both", draggingElement: i = Ze, containerElement: y, handle: h = e, buttons: S = [0] } = o, d = F( (t = A(c)) != null ? t : { x: 0, y: 0 } ), g = F(), b = (C) => l ? l.includes(C.pointerType) : !0, T = (C) => { A(a) && C.preventDefault(), A(p) && C.stopPropagation(); }, M = (C) => { var P; if (!A(S).includes(C.button) || A(o.disabled) || !b(C) || A(v) && C.target !== A(e)) return; const $ = A(y), I = (P = $ == null ? void 0 : $.getBoundingClientRect) == null ? void 0 : P.call($), O = A(e).getBoundingClientRect(), N = { x: C.clientX - ($ ? O.left - I.left + $.scrollLeft : O.left), y: C.clientY - ($ ? O.top - I.top + $.scrollTop : O.top) }; (s == null ? void 0 : s(N, C)) !== !1 && (g.value = N, T(C)); }, H = (C) => { if (A(o.disabled) || !b(C) || !g.value) return; const P = A(y), $ = A(e).getBoundingClientRect(); let { x: I, y: O } = d.value; (r === "x" || r === "both") && (I = C.clientX - g.value.x, P && (I = Math.min(Math.max(0, I), P.scrollWidth - $.width))), (r === "y" || r === "both") && (O = C.clientY - g.value.y, P && (O = Math.min(Math.max(0, O), P.scrollHeight - $.height))), d.value = { x: I, y: O }, x == null || x(d.value, C), T(C); }, R = (C) => { A(o.disabled) || !b(C) || g.value && (g.value = void 0, f == null || f(d.value, C), T(C)); }; if (Qe) { const C = { capture: (n = o.capture) != null ? n : !0 }; me(h, "pointerdown", M, C), me(i, "pointermove", H, C), me(i, "pointerup", R, C); } return ue(te({}, xt(d)), { position: d, isDragging: Z(() => !!g.value), style: Z( () => `left:${d.value.x}px;top:${d.value.y}px;` ) }); } const wt = { class: "modalHeader" }, Bt = /* @__PURE__ */ Object.assign({ name: "SModal" }, { __name: "SModal", props: { centered: { type: Boolean, default: !0 }, maskClosable: { type: Boolean, default: !0 }, mask: { type: Boolean, default: !0 }, topStyle: { type: String, default: "" }, closable: { type: Boolean, default: !0 }, destroyOnClose: { type: Boolean, default: !1 }, keyboardOpen: { type: Boolean, default: !0 }, title: { type: String, default: "" }, value: { type: Boolean, default: !1 }, haveFooter: { type: Boolean, default: !0 }, width: { type: [String, Number], default: "60vw" }, boxHeight: { type: [String, Number], default: 60 }, bodyStyle: { type: Object, default() { return { overflowX: "hidden", overflowY: "auto" }; } }, showFullScreen: { type: Boolean, default: !0 } }, emits: ["update:value", "handCancel", "afterClose"], setup(e, { emit: o }) { const t = e, n = o, l = uo(), a = F(), p = F(), v = (w) => { p.value = w, a.value = E.value ? null : w; }, { x, y: f, isDragging: s } = $t(a), c = F(0), r = F(0), i = F(!1), y = F(0), h = F(0), S = F(0), d = F(0), g = F({ left: 0, right: 0, top: 0, bottom: 0 }), b = Z(() => ({ transform: `translate(${y.value}px, ${h.value}px)` })); _([x, f], () => { var w, V; if (!i.value) { c.value = x.value, r.value = f.value; const D = document.body.getBoundingClientRect(), j = (V = (w = a.value) == null ? void 0 : w.getBoundingClientRect()) != null ? V : { width: 0, height: 0 }; g.value.right = D.width - j.width, g.value.bottom = D.height - j.height, S.value = y.value, d.value = h.value; } i.value = !0; }), _(s, () => { s.value || (i.value = !1); }), Ee(() => { i.value && (y.value = S.value + Math.min(Math.max(g.value.left, x.value), g.value.right) - c.value, h.value = d.value + Math.min(Math.max(g.value.top, f.value), g.value.bottom) - r.value); }); const T = F(null), M = F(null), H = F(t.value), R = F(te({}, t.bodyStyle)); let C = -1, P = null, $ = null; const I = () => { const w = T.value; if (!w) return; const V = a.value, D = M.value, j = w.scrollHeight || w.clientHeight; if (!j) return; const ee = (V == null ? void 0 : V.clientHeight) || 0, oe = (D == null ? void 0 : D.clientHeight) || 0, U = document.body.offsetHeight, q = j + ee + oe + 85 >= U ? U - ee - oe - 82 : j; q <= 0 || q === C || (C = q, R.value = Object.assign({ height: `${q}px` }, t.bodyStyle)); }, O = () => { Re(() => { P || (P = requestAnimationFrame(() => { P = null, I(); })); }); }; _(T, (w) => { $ && ($.disconnect(), $ = null), w && typeof ResizeObserver != "undefined" && ($ = new ResizeObserver(() => O()), $.observe(w)), O(); }); const N = F(t.width), E = F(), X = () => { N.value = "100vw", E.value = "s-full-modal", a.value = null, y.value = 0, h.value = 0; }, Y = () => { N.value = t.width, E.value = "", a.value = p.value; }, G = () => { n("update:value", !1), n("handCancel"); }, k = () => { E.value = "", a.value = p.value, N.value = t.width, n("afterClose"); }; return _( () => t.value, (w) => { w ? (H.value = !0, O()) : H.value = !1; }, { deep: !0 } ), _( () => H.value, (w) => { w && O(); } ), _( () => t.value, () => { t.value && O(); }, { immediate: !0 } ), Ne(() => { $ && ($.disconnect(), $ = null), P && (cancelAnimationFrame(P), P = null); }), (w, V) => { const D = W; return fe(), xe(D, fo({ open: H.value, "body-style": R.value, width: N.value, centered: e.centered, onCancel: G, afterClose: k, destroyOnClose: e.destroyOnClose, keyboard: e.keyboardOpen, style: e.topStyle, maskClosable: e.maskClosable, mask: e.mask, "wrap-class-name": "s-modal " + E.value }, ve(l)), mo({ title: ie(() => [ re("div", wt, [ re("div", { ref: v, class: "draggableTitle" }, go(e.title), 513), u(bo, { width: N.value, showFullScreen: e.showFullScreen, onFullScreen: X, onReduction: Y }, null, 8, ["width", "showFullScreen"]) ]) ]), modalRender: ie(({ originVNode: j }) => [ re("div", { style: po(b.value) }, [ (fe(), xe(vo(j))) ], 4) ]), default: ie(() => [ re("div", { ref_key: "bodySlot", ref: T }, [ Se(w.$slots, "default", {}, void 0, !0) ], 512) ]), _: 2 }, [ e.haveFooter ? { name: "footer", fn: ie(() => [ w.$slots.footer ? (fe(), yo("div", { key: 0, ref_key: "footerSlot", ref: M }, [ Se(w.$slots, "footer", {}, void 0, !0) ], 512)) : Co("", !0) ]), key: "0" } : void 0 ]), 1040, ["open", "body-style", "width", "centered", "destroyOnClose", "keyboard", "style", "maskClosable", "mask", "wrap-class-name"]); }; } }), Ht = /* @__PURE__ */ Xo(Bt, [["__scopeId", "data-v-3cabda62"]]); export { Ht as default };