System.register(["./index-legacy-16e217fd.js"],(function(t,e){"use strict";var o,n,l,a,s,c,i,r,u,d,m,f,B,g,b,v,h,p,w,C,y,x,k,S,D,T,O,A,H,P,z,I,N,j;return{setters:[t=>{o=t.y,n=t.d,l=t.I,a=t.aW,s=t.ac,c=t.G,i=t.a,r=t.w,u=t.a3,d=t.am,m=t.aX,f=t.ao,B=t.c,g=t.aa,b=t.B,v=t.aY,h=t.A,p=t.an,w=t.D,C=t.aZ,y=t.r,x=t.H,k=t.aw,S=t.z,D=t.P,T=t.a_,O=t.a$,A=t.b0,H=t.b1,P=t.b2,z=t.aj,I=t.Z,N=t.b3,j=t.b4}],execute:function(){t("b",tt);const[e,E]=o("action-bar"),F=Symbol(e),U={placeholder:Boolean,safeAreaInsetBottom:c};var Z=n({name:e,props:U,setup(t,{slots:e}){const o=l(),n=a(o,E),{linkChildren:c}=s(F);c();const r=()=>{var n;return i("div",{ref:o,"class":[E(),{"van-safe-area-bottom":t.safeAreaInsetBottom}]},[null==(n=e["default"])?void 0:n.call(e)])};return()=>t.placeholder?n(r):r()}});const G=r(Z),[K,L]=o("action-bar-button"),M=u({},d,{type:String,text:String,icon:String,color:String,loading:Boolean,disabled:Boolean});var R=n({name:K,props:M,setup(t,{slots:e}){const o=m(),{parent:n,index:l}=f(F),a=B((()=>{if(n){const t=n.children[l.value-1];return!(t&&"isButton"in t)}})),s=B((()=>{if(n){const t=n.children[l.value+1];return!(t&&"isButton"in t)}}));return g({isButton:!0}),()=>{const{type:n,icon:l,text:c,color:r,loading:u,disabled:d}=t;return i(b,{"class":L([n,{last:s.value,first:a.value}]),size:"large",type:n,icon:l,color:r,loading:u,disabled:d,onClick:o},{"default":()=>[e["default"]?e["default"]():c]})}}});const W=r(R),[X,Y,$]=o("dialog"),_=u({},v,{title:String,theme:String,width:h,message:[String,Function],callback:Function,allowHtml:Boolean,className:p,transition:w("van-dialog-bounce"),messageAlign:String,closeOnPopstate:c,showCancelButton:Boolean,cancelButtonText:String,cancelButtonColor:String,cancelButtonDisabled:Boolean,confirmButtonText:String,confirmButtonColor:String,confirmButtonDisabled:Boolean,showConfirmButton:c,closeOnClickOverlay:Boolean}),q=[...C,"transition","closeOnPopstate"];var J=t("s",n({name:X,props:_,emits:["confirm","cancel","keydown","update:show"],setup(t,{emit:e,slots:o}){const n=l(),a=y({confirm:!1,cancel:!1}),s=t=>e("update:show",t),c=e=>{var o;s(!1),null==(o=t.callback)||o.call(t,e)},r=o=>()=>{t.show&&(e(o),t.beforeClose?(a[o]=!0,z(t.beforeClose,{args:[o],done(){c(o),a[o]=!1},canceled(){a[o]=!1}})):c(o))},u=r("cancel"),d=r("confirm"),m=T((o=>{var l,a;o.target===(null==(a=null==(l=n.value)?void 0:l.popupRef)?void 0:a.value)&&({Enter:t.showConfirmButton?d:O,Escape:t.showCancelButton?u:O}[o.key](),e("keydown",o))}),["enter","esc"]),f=()=>{const e=o.title?o.title():t.title;if(e)return i("div",{"class":Y("header",{isolated:!t.message&&!o["default"]})},[e])},B=e=>{const{message:o,allowHtml:n,messageAlign:l}=t,a=Y("message",{"has-title":e,[l]:l}),s=A(o)?o():o;return n&&"string"==typeof s?i("div",{"class":a,innerHTML:s},null):i("div",{"class":a},[s])},g=()=>{if(o["default"])return i("div",{"class":Y("content")},[o["default"]()]);const{title:e,message:n,allowHtml:l}=t;if(n){const t=!(!e&&!o.title);return i("div",{key:l?1:0,"class":Y("content",{isolated:!t})},[B(t)])}},v=()=>o.footer?o.footer():"round-button"===t.theme?i(G,{"class":Y("footer")},{"default":()=>[t.showCancelButton&&i(W,{type:"warning",text:t.cancelButtonText||$("cancel"),"class":Y("cancel"),color:t.cancelButtonColor,loading:a.cancel,disabled:t.cancelButtonDisabled,onClick:u},null),t.showConfirmButton&&i(W,{type:"danger",text:t.confirmButtonText||$("confirm"),"class":Y("confirm"),color:t.confirmButtonColor,loading:a.confirm,disabled:t.confirmButtonDisabled,onClick:d},null)]}):i("div",{"class":[P,Y("footer")]},[t.showCancelButton&&i(b,{size:"large",text:t.cancelButtonText||$("cancel"),"class":Y("cancel"),style:{color:t.cancelButtonColor},loading:a.cancel,disabled:t.cancelButtonDisabled,onClick:u},null),t.showConfirmButton&&i(b,{size:"large",text:t.confirmButtonText||$("confirm"),"class":[Y("confirm"),{[H]:t.showCancelButton}],style:{color:t.confirmButtonColor},loading:a.confirm,disabled:t.confirmButtonDisabled,onClick:d},null)]);return()=>{const{width:e,title:o,theme:l,message:a,className:c}=t;return i(D,x({ref:n,role:"dialog","class":[Y([l]),c],style:{width:S(e)},tabindex:0,"aria-labelledby":o||a,onKeydown:m,"onUpdate:show":s},k(t,q)),{"default":()=>[f(),g(),v()]})}}}));let Q,V=u({},{title:"",width:"",theme:null,message:"",overlay:!0,callback:null,teleport:"body",className:"",allowHtml:!1,lockScroll:!0,transition:void 0,beforeClose:null,overlayClass:"",overlayStyle:void 0,messageAlign:"",cancelButtonText:"",cancelButtonColor:null,cancelButtonDisabled:!1,confirmButtonText:"",confirmButtonColor:null,confirmButtonDisabled:!1,showConfirmButton:!0,showCancelButton:!1,closeOnPopstate:!0,closeOnClickOverlay:!1});function tt(t){return I?new Promise(((e,o)=>{Q||function(){const t={setup(){const{state:t,toggle:e}=j();return()=>i(J,x(t,{"onUpdate:show":e}),null)}};({instance:Q}=N(t))}(),Q.open(u({},V,t,{callback:t=>{("confirm"===t?e:o)(t)}}))})):Promise.resolve(void 0)}t("a",(t=>tt(u({showCancelButton:!0},t))))}}}));
