import{M as z,W as I,Q as R,bD as C,bM as D,f as o,bE as L,O as l,S as N,I as O,a3 as q,X as w}from"./index-BV0H45HW.js";import{L as E}from"./index-BtHEBb5f.js";const[M,a]=R("button"),U=I({},L,{tag:l("button"),text:String,icon:String,type:l("default"),size:l("normal"),color:String,block:Boolean,plain:Boolean,round:Boolean,square:Boolean,loading:Boolean,hairline:Boolean,disabled:Boolean,iconPrefix:String,nativeType:l("button"),loadingSize:N,loadingText:String,loadingType:String,iconPosition:l("left")});var _=z({name:M,props:U,emits:["click"],setup(n,{emit:g,slots:t}){const f=C(),b=()=>t.loading?t.loading():o(E,{size:n.loadingSize,type:n.loadingType,class:a("loading")},null),c=()=>{if(n.loading)return b();if(t.icon)return o("div",{class:a("icon")},[t.icon()]);if(n.icon)return o(O,{name:n.icon,class:a("icon"),classPrefix:n.iconPrefix},null)},m=()=>{let e;if(n.loading?e=n.loadingText:e=t.default?t.default():n.text,e)return o("span",{class:a("text")},[e])},x=()=>{const{color:e,plain:r}=n;if(e){const i={color:r?e:"white"};return r||(i.background=e),e.includes("gradient")?i.border=0:i.borderColor=e,i}},S=e=>{n.loading?q(e):n.disabled||(g("click",e),f())};return()=>{const{tag:e,type:r,size:i,block:y,round:B,plain:P,square:k,loading:T,disabled:s,hairline:d,nativeType:h,iconPosition:u}=n,v=[a([r,i,{plain:P,block:y,round:B,square:k,loading:T,disabled:s,hairline:d}]),{[D]:d}];return o(e,{type:h,class:v,style:x(),disabled:s,onClick:S},{default:()=>[o("div",{class:a("content")},[u==="left"&&c(),m(),u==="right"&&c()])]})}}});const V=w(_);export{V as B};
