import{_}from"./preload-helper.27958db9.js";import{e as A,R as C,S as E,U as L,f as n,o as t,k as i,l as R,c as m,I as r,m as s,u as d,b as a,a as U,q as V,V as g}from"./vue.runtime.esm-bundler.4a881941.js";import{P as M}from"./Phone.f8349cb0.js";import"./links.125d59c9.js";import"./default-i18n.3881921e.js";import"./isArrayLikeObject.ab8f4241.js";import"./_plugin-vue_export-helper.abeb2ae0.js";const D=A({__name:"MazBtn",props:{variant:{type:String,default:"button",validator:e=>["button","link"].includes(e)},size:{type:String,default:"md",validator:e=>["mini","xs","sm","md","lg","xl"].includes(e)},color:{type:String,default:"primary"},type:{type:String,default:"button",validator:e=>["button","submit","reset"].includes(e)},rounded:{type:Boolean,default:!1},noRounded:{type:Boolean,default:!1},outline:{type:Boolean,default:!1},pastel:{type:Boolean,default:!1},block:{type:Boolean,default:!1},noUnderline:{type:Boolean,default:!1},noLeading:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},fab:{type:Boolean,default:!1},icon:{type:String,default:void 0},leftIcon:{type:String,default:void 0},rightIcon:{type:String,default:void 0},noPadding:{type:Boolean,default:!1},noElevation:{type:Boolean,default:!1}},setup(e){const z=g(()=>_(()=>import("./MazSpinner-2nPx7jtV.73d5211f.js"),[window.__aioseoDynamicImportPreload__("js/MazSpinner-2nPx7jtV.73d5211f.js"),window.__aioseoDynamicImportPreload__("js/vue.runtime.esm-bundler.4a881941.js"),window.__aioseoDynamicImportPreload__("js/Phone.f8349cb0.js"),window.__aioseoDynamicImportPreload__("js/links.125d59c9.js"),window.__aioseoDynamicImportPreload__("js/default-i18n.3881921e.js"),window.__aioseoDynamicImportPreload__("js/isArrayLikeObject.ab8f4241.js"),window.__aioseoDynamicImportPreload__("js/preload-helper.27958db9.js"),window.__aioseoDynamicImportPreload__("js/_plugin-vue_export-helper.abeb2ae0.js"),window.__aioseoDynamicImportPreload__("css/Phone.ae88f739.css"),window.__aioseoDynamicImportPreload__("css/MazSpinner-2nPx7jtV.3f423c8d.css")],import.meta.url)),c=g(()=>_(()=>import("./MazIcon-RrJDzX3V.f04096c9.js"),[window.__aioseoDynamicImportPreload__("js/MazIcon-RrJDzX3V.f04096c9.js"),window.__aioseoDynamicImportPreload__("js/vue.runtime.esm-bundler.4a881941.js")],import.meta.url)),{href:B,to:k}=C(),v=E(),o=e;L(()=>{o.icon&&!o.fab&&console.error('[maz-ui](MazBtn) the prop "icon" must be used only with "fab" props')});const f=n(()=>B?"a":k?"router-link":"button"),x=n(()=>o.pastel?`--${o.color}-pastel`:o.outline?`--${o.color}-outline`:`--${o.color}`),p=n(()=>(o.loading||o.disabled)&&f.value==="button"),I=n(()=>p.value?"--cursor-default":"--cursor-pointer"),h=n(()=>`--is-${o.variant}`),l=n(()=>o.loading&&o.variant==="button"),y=n(()=>!!v["left-icon"]||o.leftIcon),b=n(()=>!!v["right-icon"]||o.rightIcon),S=n(()=>y.value||b.value),$=n(()=>o.fab&&o.icon),P=n(()=>f.value==="button"?o.type:void 0);return(u,w)=>(t(),i(V(f.value),{disabled:p.value,class:r(["m-btn",[`--${e.size}`,x.value,I.value,h.value,{"--block":e.block,"--no-underline":e.noUnderline,"--no-leading":e.noLeading,"--fab":e.fab,"--loading":e.loading,"--disabled":p.value,"--icon":S.value,"--rounded":e.rounded,"--no-rounded":e.noRounded,"--no-padding":e.noPadding,"--no-elevation":e.noElevation}]]),type:P.value},{default:R(()=>[y.value?(t(),m("div",{key:0,class:r(["m-btn__icon-left maz-flex maz-flex-center",{"maz-invisible":l.value}])},[s(u.$slots,"left-icon",{},()=>[e.leftIcon?(t(),i(d(c),{key:0,name:e.leftIcon},null,8,["name"])):a("v-if",!0)],!0)],2)):a("v-if",!0),$.value?(t(),m("div",{key:1,class:r(["m-btn__icon maz-flex maz-flex-center",{"maz-invisible":l.value}])},[s(u.$slots,"icon",{},()=>[e.icon?(t(),i(d(c),{key:0,name:e.icon},null,8,["name"])):a("v-if",!0)],!0)],2)):a("v-if",!0),U("span",{class:r(["maz-flex maz-flex-center",{"maz-invisible":l.value}])},[s(u.$slots,"default",{},void 0,!0)],2),b.value?(t(),m("div",{key:2,class:r(["m-btn__icon-right maz-flex maz-flex-center",{"maz-invisible":l.value}])},[s(u.$slots,"right-icon",{},()=>[e.rightIcon?(t(),i(d(c),{key:0,name:e.rightIcon},null,8,["name"])):a("v-if",!0)],!0)],2)):a("v-if",!0),l.value?(t(),i(d(z),{key:3,size:"2em",color:e.color,class:"maz-absolute"},null,8,["color"])):a("v-if",!0)]),_:3},8,["disabled","class","type"]))}}),H=M(D,[["__scopeId","data-v-3f2db58e"]]);export{H as default};
