import{r as S,I as Re,aO as Je,q as he,aP as De,V as F,w as L,z as le,b as P,C as ae,T as He,ar as R,as as z,j as J,S as re,P as Fe,aQ as Qe,aB as ce,v as Ke,D as me,l as Ue,aR as _e,m as We,f as I,k as ve,aH as en,a7 as Y,x as M,o as C,a as T,B as g,A as ne,E as Be,c as de,y as H,U as j,t as x,aS as te,d as ke,aT as ge,aU as Me,a1 as pe,n as Ye,aV as je,az as Te,aW as Le,J as nn}from"#entry";import{l as xe,m as G,n as V,o as be,h as tn,c as Se,q as Ie,T as on,E as sn,s as Ae,v as Pe}from"./C55C_g8I.js";import{E as ln}from"./BN7fr1Nn.js";import{E as an}from"./DedMas4Y.js";import{P as fe}from"./CyOsrYVo.js";import{b as rn,d as $e,_ as un}from"./COfxcSTK.js";import{E as cn}from"./Bro-MU8y.js";import{o as Oe,g as dn,E as fn,t as mn}from"./CJbXZyQO.js";function vn(e,t){let n;const l=S(!1),o=Re({...e,originalPosition:"",originalOverflow:"",visible:!1});function s(i){o.text=i}function r(){const i=o.parent,p=v.ns;if(!i.vLoadingAddClassList){let d=i.getAttribute("loading-number");d=Number.parseInt(d)-1,d?i.setAttribute("loading-number",d.toString()):(G(i,p.bm("parent","relative")),i.removeAttribute("loading-number")),G(i,p.bm("parent","hidden"))}u(),f.unmount()}function u(){var i,p;(p=(i=v.$el)==null?void 0:i.parentNode)==null||p.removeChild(v.$el)}function m(){var i;e.beforeClose&&!e.beforeClose()||(l.value=!0,clearTimeout(n),n=setTimeout(a,400),o.visible=!1,(i=e.closed)==null||i.call(e))}function a(){if(!l.value)return;const i=o.parent;l.value=!1,i.vLoadingAddClassList=void 0,r()}const y=he({name:"ElLoading",setup(i,{expose:p}){const{ns:d,zIndex:w}=xe("loading");return p({ns:d,zIndex:w}),()=>{const b=o.spinner||o.svg,h=F("svg",{class:"circular",viewBox:o.svgViewBox?o.svgViewBox:"0 0 50 50",...b?{innerHTML:b}:{}},[F("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),k=o.text?F("p",{class:d.b("text")},[o.text]):void 0;return F(He,{name:d.b("fade"),onAfterLeave:a},{default:L(()=>[le(P("div",{style:{backgroundColor:o.background||""},class:[d.b("mask"),o.customClass,o.fullscreen?"is-fullscreen":""]},[F("div",{class:d.b("spinner")},[h,k])]),[[ae,o.visible]])])})}}}),f=Je(y);Object.assign(f._context,t??{});const v=f.mount(document.createElement("div"));return{...De(o),setText:s,removeElLoadingChild:u,close:m,handleAfterLeave:a,vm:v,get $el(){return v.$el}}}let oe;const K=function(e={},t){if(!R)return;const n=gn(e);if(n.fullscreen&&oe)return oe;const l=vn({...n,closed:()=>{var s;(s=n.closed)==null||s.call(n),n.fullscreen&&(oe=void 0)}},t??K._context);pn(n,n.parent,l),Ve(n,n.parent,l),n.parent.vLoadingAddClassList=()=>Ve(n,n.parent,l);let o=n.parent.getAttribute("loading-number");return o?o=`${Number.parseInt(o)+1}`:o="1",n.parent.setAttribute("loading-number",o),n.parent.appendChild(l.$el),z(()=>l.visible.value=n.visible),n.fullscreen&&(oe=l),l},gn=e=>{var t,n,l,o;let s;return J(e.target)?s=(t=document.querySelector(e.target))!=null?t:document.body:s=e.target||document.body,{parent:s===document.body||e.body?document.body:s,background:e.background||"",svg:e.svg||"",svgViewBox:e.svgViewBox||"",spinner:e.spinner||!1,text:e.text||"",fullscreen:s===document.body&&((n=e.fullscreen)!=null?n:!0),lock:(l=e.lock)!=null?l:!1,customClass:e.customClass||"",visible:(o=e.visible)!=null?o:!0,beforeClose:e.beforeClose,closed:e.closed,target:s}},pn=async(e,t,n)=>{const{nextZIndex:l}=n.vm.zIndex||n.vm._.exposed.zIndex,o={};if(e.fullscreen)n.originalPosition.value=V(document.body,"position"),n.originalOverflow.value=V(document.body,"overflow"),o.zIndex=l();else if(e.parent===document.body){n.originalPosition.value=V(document.body,"position"),await z();for(const s of["top","left"]){const r=s==="top"?"scrollTop":"scrollLeft";o[s]=`${e.target.getBoundingClientRect()[s]+document.body[r]+document.documentElement[r]-Number.parseInt(V(document.body,`margin-${s}`),10)}px`}for(const s of["height","width"])o[s]=`${e.target.getBoundingClientRect()[s]}px`}else n.originalPosition.value=V(t,"position");for(const[s,r]of Object.entries(o))n.$el.style[s]=r},Ve=(e,t,n)=>{const l=n.vm.ns||n.vm._.exposed.ns;["absolute","fixed","sticky"].includes(n.originalPosition.value)?G(t,l.bm("parent","relative")):be(t,l.bm("parent","relative")),e.fullscreen&&e.lock?be(t,l.bm("parent","hidden")):G(t,l.bm("parent","hidden"))};K._context=null;const X=Symbol("ElLoading"),O=e=>`element-loading-${Qe(e)}`,ze=(e,t)=>{var n,l,o,s;const r=t.instance,u=i=>re(t.value)?t.value[i]:void 0,m=i=>{const p=J(i)&&r?.[i]||i;return S(p)},a=i=>m(u(i)||e.getAttribute(O(i))),y=(n=u("fullscreen"))!=null?n:t.modifiers.fullscreen,f={text:a("text"),svg:a("svg"),svgViewBox:a("svgViewBox"),spinner:a("spinner"),background:a("background"),customClass:a("customClass"),fullscreen:y,target:(l=u("target"))!=null?l:y?void 0:e,body:(o=u("body"))!=null?o:t.modifiers.body,lock:(s=u("lock"))!=null?s:t.modifiers.lock},v=K(f);v._context=q._context,e[X]={options:f,instance:v}},bn=(e,t)=>{for(const n of Object.keys(e))Fe(e[n])&&(e[n].value=t[n])},q={mounted(e,t){t.value&&ze(e,t)},updated(e,t){const n=e[X];if(!t.value){n?.instance.close(),e[X]=null;return}n?bn(n.options,re(t.value)?t.value:{text:e.getAttribute(O("text")),svg:e.getAttribute(O("svg")),svgViewBox:e.getAttribute(O("svgViewBox")),spinner:e.getAttribute(O("spinner")),background:e.getAttribute(O("background")),customClass:e.getAttribute(O("customClass"))}):ze(e,t)},unmounted(e){var t;(t=e[X])==null||t.instance.close(),e[X]=null}};q._context=null;const Xn={install(e){K._context=e._context,q._context=e._context,e.directive("loading",q),e.config.globalProperties.$loading=K},directive:q,service:K},Xe=e=>{if(!e)return{onClick:ce,onMousedown:ce,onMouseup:ce};let t=!1,n=!1;return{onClick:r=>{t&&n&&e(r),t=n=!1},onMousedown:r=>{t=r.target===r.currentTarget},onMouseup:r=>{n=r.target===r.currentTarget}}},yn=rn({mask:{type:Boolean,default:!0},customMaskEvent:Boolean,overlayClass:{type:$e([String,Array,Object])},zIndex:{type:$e([String,Number])}}),hn={click:e=>e instanceof MouseEvent},Cn="overlay";var wn=he({name:"ElOverlay",props:yn,emits:hn,setup(e,{slots:t,emit:n}){const l=Ke(Cn),o=m=>{n("click",m)},{onClick:s,onMousedown:r,onMouseup:u}=Xe(e.customMaskEvent?void 0:o);return()=>e.mask?P("div",{class:[l.b(),e.overlayClass],style:{zIndex:e.zIndex},onClick:s,onMousedown:r,onMouseup:u},[me(t,"default")],fe.STYLE|fe.CLASS|fe.PROPS,["onClick","onMouseup","onMousedown"]):F("div",{class:e.overlayClass,style:{zIndex:e.zIndex,position:"fixed",top:"0px",right:"0px",bottom:"0px",left:"0px"}},[me(t,"default")])}});const En=wn,ye="_trap-focus-children",N=[],Ne=e=>{if(N.length===0)return;const t=dn(e),n=N[N.length-1][ye];if(n.length>0&&t===fn.tab){if(n.length===1){e.preventDefault(),document.activeElement!==n[0]&&n[0].focus();return}const l=e.shiftKey,o=e.target===n[0],s=e.target===n[n.length-1];o&&l&&(e.preventDefault(),n[n.length-1].focus()),s&&!l&&(e.preventDefault(),n[0].focus())}},Bn={beforeMount(e){e[ye]=Oe(e),N.push(e),N.length<=1&&document.addEventListener("keydown",Ne)},updated(e){z(()=>{e[ye]=Oe(e)})},unmounted(){N.shift(),N.length===0&&document.removeEventListener("keydown",Ne)}},kn=e=>["",...tn].includes(e),Mn=(e,t,n,l)=>{const o={offsetX:0,offsetY:0},s=S(!1),r=(v,i)=>{if(e.value){const{offsetX:p,offsetY:d}=o,w=e.value.getBoundingClientRect(),b=w.left,h=w.top,k=w.width,D=w.height,W=document.documentElement.clientWidth,Q=document.documentElement.clientHeight,ie=-b+p,$=-h+d,_=W-b-k+p,ue=Q-h-(D<Q?D:0)+d;l?.value||(v=Math.min(Math.max(v,ie),_),i=Math.min(Math.max(i,$),ue)),o.offsetX=v,o.offsetY=i,e.value.style.transform=`translate(${Se(v)}, ${Se(i)})`}},u=v=>{const i=v.clientX,p=v.clientY,{offsetX:d,offsetY:w}=o,b=k=>{s.value||(s.value=!0);const D=d+k.clientX-i,W=w+k.clientY-p;r(D,W)},h=()=>{s.value=!1,document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",h)};document.addEventListener("mousemove",b),document.addEventListener("mouseup",h)},m=()=>{t.value&&e.value&&(t.value.addEventListener("mousedown",u),window.addEventListener("resize",f))},a=()=>{t.value&&e.value&&(t.value.removeEventListener("mousedown",u),window.removeEventListener("resize",f))},y=()=>{o.offsetX=0,o.offsetY=0,e.value&&(e.value.style.transform="")},f=()=>{const{offsetX:v,offsetY:i}=o;r(v,i)};return Ue(()=>{_e(()=>{n.value?m():a()})}),We(()=>{a()}),{isDragging:s,resetPosition:y,updatePosition:f}},Tn=(e,t)=>{if(!R)return!1;const n={undefined:"overflow",true:"overflow-y",false:"overflow-x"}[String(t)],l=V(e,n);return["scroll","auto","overlay"].some(o=>l.includes(o))},qn=(e,t)=>{if(!R)return;let n=e;for(;n;){if([window,document,document.documentElement].includes(n))return window;if(Tn(n,t))return n;n=n.parentNode}return n};let se;const Ln=e=>{var t;if(!R)return 0;if(se!==void 0)return se;const n=document.createElement("div");n.className=`${e}-scrollbar__wrap`,n.style.visibility="hidden",n.style.width="100px",n.style.position="absolute",n.style.top="-9999px",document.body.appendChild(n);const l=n.offsetWidth;n.style.overflow="scroll";const o=document.createElement("div");o.style.width="100%",n.appendChild(o);const s=o.offsetWidth;return(t=n.parentNode)==null||t.removeChild(n),se=l-s,se};function Gn(e,t){if(!R)return;if(!t){e.scrollTop=0;return}const n=[];let l=t.offsetParent;for(;l!==null&&e!==l&&e.contains(l);)n.push(l),l=l.offsetParent;const o=t.offsetTop+n.reduce((m,a)=>m+a.offsetTop,0),s=o+t.offsetHeight,r=e.scrollTop,u=r+e.clientHeight;o<r?e.scrollTop=o:s>u&&(e.scrollTop=s-e.clientHeight)}const Sn=(e,t={})=>{Fe(e)||mn("[useLockscreen]","You need to pass a ref param to this function");const n=t.ns||Ke("popup"),l=I(()=>n.bm("parent","hidden"));if(!R||Ie(document.body,l.value))return;let o=0,s=!1,r="0";const u=()=>{setTimeout(()=>{typeof document>"u"||s&&document&&(document.body.style.width=r,G(document.body,l.value))},200)};ve(e,m=>{if(!m){u();return}s=!Ie(document.body,l.value),s&&(r=document.body.style.width,be(document.body,l.value)),o=Ln(n.namespace.value);const a=document.documentElement.clientHeight<document.body.scrollHeight,y=V(document.body,"overflowY");o>0&&(a||y==="scroll")&&s&&(document.body.style.width=`calc(100% - ${o}px)`)}),en(()=>u())},In=he({name:"ElMessageBox",directives:{TrapFocus:Bn},components:{ElButton:ln,ElFocusTrap:cn,ElInput:an,ElOverlay:En,ElIcon:sn,...on},inheritAttrs:!1,props:{buttonSize:{type:String,validator:kn},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:t}){const{locale:n,zIndex:l,ns:o,size:s}=xe("message-box",I(()=>e.buttonSize)),{t:r}=n,{nextZIndex:u}=l,m=S(!1),a=Re({autofocus:!0,beforeClose:null,callback:null,cancelButtonText:"",cancelButtonClass:"",confirmButtonText:"",confirmButtonClass:"",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:ge(Ae),cancelButtonLoadingIcon:ge(Ae),confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:u()}),y=I(()=>{const c=a.type;return{[o.bm("icon",c)]:c&&Pe[c]}}),f=Me(),v=Me(),i=I(()=>{const c=a.type;return a.icon||c&&Pe[c]||""}),p=I(()=>!!a.message),d=S(),w=S(),b=S(),h=S(),k=S(),D=I(()=>a.confirmButtonClass);ve(()=>a.inputValue,async c=>{await z(),e.boxType==="prompt"&&c&&Ce()},{immediate:!0}),ve(()=>m.value,c=>{var E,B;c&&(e.boxType!=="prompt"&&(a.autofocus?b.value=(B=(E=k.value)==null?void 0:E.$el)!=null?B:d.value:b.value=d.value),a.zIndex=u()),e.boxType==="prompt"&&(c?z().then(()=>{var Ee;h.value&&h.value.$el&&(a.autofocus?b.value=(Ee=Ge())!=null?Ee:d.value:b.value=d.value)}):(a.editorErrorMessage="",a.validateError=!1))});const W=I(()=>e.draggable),Q=I(()=>e.overflow),{isDragging:ie}=Mn(d,w,W,Q);Ue(async()=>{await z(),e.closeOnHashChange&&window.addEventListener("hashchange",$)}),We(()=>{e.closeOnHashChange&&window.removeEventListener("hashchange",$)});function $(){m.value&&(m.value=!1,z(()=>{a.action&&t("action",a.action)}))}const _=()=>{e.closeOnClickModal&&ee(a.distinguishCancelAndClose?"close":"cancel")},ue=Xe(_),qe=c=>{if(a.inputType!=="textarea")return c.preventDefault(),ee("confirm")},ee=c=>{var E;e.boxType==="prompt"&&c==="confirm"&&!Ce()||(a.action=c,a.beforeClose?(E=a.beforeClose)==null||E.call(a,c,a,$):$())},Ce=()=>{if(e.boxType==="prompt"){const c=a.inputPattern;if(c&&!c.test(a.inputValue||""))return a.editorErrorMessage=a.inputErrorMessage||r("el.messagebox.error"),a.validateError=!0,!1;const E=a.inputValidator;if(pe(E)){const B=E(a.inputValue);if(B===!1)return a.editorErrorMessage=a.inputErrorMessage||r("el.messagebox.error"),a.validateError=!0,!1;if(J(B))return a.editorErrorMessage=B,a.validateError=!0,!1}}return a.editorErrorMessage="",a.validateError=!1,!0},Ge=()=>{var c,E;const B=(c=h.value)==null?void 0:c.$refs;return(E=B?.input)!=null?E:B?.textarea},we=()=>{ee("close")},Ze=()=>{e.closeOnPressEscape&&we()};return e.lockScroll&&Sn(m),{...De(a),ns:o,overlayEvent:ue,visible:m,hasMessage:p,typeClass:y,contentId:f,inputId:v,btnSize:s,iconComponent:i,confirmButtonClasses:D,rootRef:d,focusStartRef:b,headerRef:w,inputRef:h,isDragging:ie,confirmRef:k,doClose:$,handleClose:we,onCloseRequested:Ze,handleWrapperClick:_,handleInputEnter:qe,handleAction:ee,t:r}}});function An(e,t,n,l,o,s){const r=Y("el-icon"),u=Y("el-input"),m=Y("el-button"),a=Y("el-focus-trap"),y=Y("el-overlay");return C(),M(He,{name:"fade-in-linear",onAfterLeave:f=>e.$emit("vanish"),persisted:""},{default:L(()=>[le(P(y,{"z-index":e.zIndex,"overlay-class":[e.ns.is("message-box"),e.modalClass],mask:e.modal},{default:L(()=>[T("div",{role:"dialog","aria-label":e.title,"aria-modal":"true","aria-describedby":e.showInput?void 0:e.contentId,class:g(`${e.ns.namespace.value}-overlay-message-box`),onClick:e.overlayEvent.onClick,onMousedown:e.overlayEvent.onMousedown,onMouseup:e.overlayEvent.onMouseup},[P(a,{loop:"",trapped:e.visible,"focus-trap-el":e.rootRef,"focus-start-el":e.focusStartRef,onReleaseRequested:e.onCloseRequested},{default:L(()=>[T("div",{ref:"rootRef",class:g([e.ns.b(),e.customClass,e.ns.is("draggable",e.draggable),e.ns.is("dragging",e.isDragging),{[e.ns.m("center")]:e.center}]),style:Be(e.customStyle),tabindex:"-1",onClick:ne(()=>{},["stop"])},[e.title!==null&&e.title!==void 0?(C(),de("div",{key:0,ref:"headerRef",class:g([e.ns.e("header"),{"show-close":e.showClose}])},[T("div",{class:g(e.ns.e("title"))},[e.iconComponent&&e.center?(C(),M(r,{key:0,class:g([e.ns.e("status"),e.typeClass])},{default:L(()=>[(C(),M(j(e.iconComponent)))]),_:1},8,["class"])):H("v-if",!0),T("span",null,x(e.title),1)],2),e.showClose?(C(),de("button",{key:0,type:"button",class:g(e.ns.e("headerbtn")),"aria-label":e.t("el.messagebox.close"),onClick:f=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel"),onKeydown:te(ne(f=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"])},[P(r,{class:g(e.ns.e("close"))},{default:L(()=>[(C(),M(j(e.closeIcon||"close")))]),_:1},8,["class"])],42,["aria-label","onClick","onKeydown"])):H("v-if",!0)],2)):H("v-if",!0),T("div",{id:e.contentId,class:g(e.ns.e("content"))},[T("div",{class:g(e.ns.e("container"))},[e.iconComponent&&!e.center&&e.hasMessage?(C(),M(r,{key:0,class:g([e.ns.e("status"),e.typeClass])},{default:L(()=>[(C(),M(j(e.iconComponent)))]),_:1},8,["class"])):H("v-if",!0),e.hasMessage?(C(),de("div",{key:1,class:g(e.ns.e("message"))},[me(e.$slots,"default",{},()=>[e.dangerouslyUseHTMLString?(C(),M(j(e.showInput?"label":"p"),{key:1,for:e.showInput?e.inputId:void 0,innerHTML:e.message},null,8,["for","innerHTML"])):(C(),M(j(e.showInput?"label":"p"),{key:0,for:e.showInput?e.inputId:void 0,textContent:x(e.message)},null,8,["for","textContent"]))])],2)):H("v-if",!0)],2),le(T("div",{class:g(e.ns.e("input"))},[P(u,{id:e.inputId,ref:"inputRef",modelValue:e.inputValue,"onUpdate:modelValue":f=>e.inputValue=f,type:e.inputType,placeholder:e.inputPlaceholder,"aria-invalid":e.validateError,class:g({invalid:e.validateError}),onKeydown:te(e.handleInputEnter,["enter"])},null,8,["id","modelValue","onUpdate:modelValue","type","placeholder","aria-invalid","class","onKeydown"]),T("div",{class:g(e.ns.e("errormsg")),style:Be({visibility:e.editorErrorMessage?"visible":"hidden"})},x(e.editorErrorMessage),7)],2),[[ae,e.showInput]])],10,["id"]),T("div",{class:g(e.ns.e("btns"))},[e.showCancelButton?(C(),M(m,{key:0,loading:e.cancelButtonLoading,"loading-icon":e.cancelButtonLoadingIcon,class:g([e.cancelButtonClass]),round:e.roundButton,size:e.btnSize,onClick:f=>e.handleAction("cancel"),onKeydown:te(ne(f=>e.handleAction("cancel"),["prevent"]),["enter"])},{default:L(()=>[ke(x(e.cancelButtonText||e.t("el.messagebox.cancel")),1)]),_:1},8,["loading","loading-icon","class","round","size","onClick","onKeydown"])):H("v-if",!0),le(P(m,{ref:"confirmRef",type:"primary",loading:e.confirmButtonLoading,"loading-icon":e.confirmButtonLoadingIcon,class:g([e.confirmButtonClasses]),round:e.roundButton,disabled:e.confirmButtonDisabled,size:e.btnSize,onClick:f=>e.handleAction("confirm"),onKeydown:te(ne(f=>e.handleAction("confirm"),["prevent"]),["enter"])},{default:L(()=>[ke(x(e.confirmButtonText||e.t("el.messagebox.confirm")),1)]),_:1},8,["loading","loading-icon","class","round","disabled","size","onClick","onKeydown"]),[[ae,e.showConfirmButton]])],2)],14,["onClick"])]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])],42,["aria-label","aria-describedby","onClick","onMousedown","onMouseup"])]),_:3},8,["z-index","overlay-class","mask"]),[[ae,e.visible]])]),_:3},8,["onAfterLeave"])}var Pn=un(In,[["render",An],["__file","index.vue"]]);const Z=new Map,$n=e=>{let t=document.body;return e.appendTo&&(J(e.appendTo)&&(t=document.querySelector(e.appendTo)),Le(e.appendTo)&&(t=e.appendTo),Le(t)||(t=document.body)),t},On=(e,t,n=null)=>{const l=P(Pn,e,pe(e.message)||Ye(e.message)?{default:pe(e.message)?e.message:()=>e.message}:null);return l.appContext=n,je(l,t),$n(e).appendChild(t.firstElementChild),l.component},Vn=()=>document.createElement("div"),zn=(e,t)=>{const n=Vn();e.onVanish=()=>{je(null,n),Z.delete(o)},e.onAction=s=>{const r=Z.get(o);let u;e.showInput?u={value:o.inputValue,action:s}:u=s,e.callback?e.callback(u,l.proxy):s==="cancel"||s==="close"?e.distinguishCancelAndClose&&s!=="cancel"?r.reject("close"):r.reject("cancel"):r.resolve(u)};const l=On(e,n,t),o=l.proxy;for(const s in e)Te(e,s)&&!Te(o.$props,s)&&(s==="closeIcon"&&re(e[s])?o[s]=ge(e[s]):o[s]=e[s]);return o.visible=!0,o};function U(e,t=null){if(!R)return Promise.reject();let n;return J(e)||Ye(e)?e={message:e}:n=e.callback,new Promise((l,o)=>{const s=zn(e,t??U._context);Z.set(s,{options:e,callback:n,resolve:l,reject:o})})}const Nn=["alert","confirm","prompt"],Rn={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};Nn.forEach(e=>{U[e]=Dn(e)});function Dn(e){return(t,n,l,o)=>{let s="";return re(n)?(l=n,s=""):nn(n)?s="":s=n,U(Object.assign({title:s,message:t,type:"",...Rn[e]},l,{boxType:e}),o)}}U.close=()=>{Z.forEach((e,t)=>{t.doClose()}),Z.clear()};U._context=null;const A=U;A.install=e=>{A._context=e._context,e.config.globalProperties.$msgbox=A,e.config.globalProperties.$messageBox=A,e.config.globalProperties.$alert=A.alert,e.config.globalProperties.$confirm=A.confirm,e.config.globalProperties.$prompt=A.prompt};const Zn=A;export{Zn as E,Xn as a,Sn as b,En as c,Xe as d,qn as g,Gn as s,Mn as u,q as v};
