import{G as v,a1 as u,ac as S,I as B,d as y,j as t,O as I,E as T,P}from"./ResizeObserver.es.62ab429c.js";const[A,e,C]=v("submit-bar"),h={tip:String,label:String,price:Number,tipIcon:String,loading:Boolean,currency:u("\xA5"),disabled:Boolean,textAlign:String,buttonText:String,buttonType:u("danger"),buttonColor:String,suffixLabel:String,decimalLength:S(2),safeAreaInsetBottom:B};var k=y({name:A,props:h,emits:["submit"],setup(n,{emit:d,slots:a}){const b=()=>{const{price:i,label:r,currency:l,textAlign:g,suffixLabel:o,decimalLength:c}=n;if(typeof i=="number"){const s=(i/100).toFixed(+c).split("."),x=c?`.${s[1]}`:"";return t("div",{class:e("text"),style:{textAlign:g}},[t("span",null,[r||C("label")]),t("span",{class:e("price")},[l,t("span",{class:e("price-integer")},[s[0]]),x]),o&&t("span",{class:e("suffix-label")},[o])])}},m=()=>{var i;const{tip:r,tipIcon:l}=n;if(a.tip||r)return t("div",{class:e("tip")},[l&&t(I,{class:e("tip-icon"),name:l},null),r&&t("span",{class:e("tip-text")},[r]),(i=a.tip)==null?void 0:i.call(a)])},p=()=>d("submit"),f=()=>a.button?a.button():t(T,{round:!0,type:n.buttonType,text:n.buttonText,class:e("button",n.buttonType),color:n.buttonColor,loading:n.loading,disabled:n.disabled,onClick:p},null);return()=>{var i,r;return t("div",{class:[e(),{"van-safe-area-bottom":n.safeAreaInsetBottom}]},[(i=a.top)==null?void 0:i.call(a),m(),t("div",{class:e("bar")},[(r=a.default)==null?void 0:r.call(a),b(),f()])])}}});const N=P(k);export{N as S};
