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