"use strict";const e=require("../../../../common/vendor.js"),o=require("../common/base64.js"),n=require("./types.js");Math||a();const a=()=>"../wd-icon/wd-icon.js",t=e.defineComponent({name:"wd-button",options:{addGlobalClass:!0,virtualHost:!0,styleIsolation:"shared"},props:n.buttonProps,emits:["click","getuserinfo","contact","getphonenumber","getrealtimephonenumber","error","launchapp","opensetting","chooseavatar","agreeprivacyauthorization"],setup(n,{emit:a}){const t=n,i=a,s=e.ref(20),r=e.ref(70),c=e.ref(""),l=e.computed((()=>`background-image: url(${c.value});`));function d(e){t.disabled||t.loading||i("click",e)}function u(e){"phoneNumber"===t.scope?g(e):"userInfo"===t.scope&&p(e)}function p(e){i("getuserinfo",e.detail)}function f(e){i("contact",e.detail)}function g(e){i("getphonenumber",e.detail)}function m(e){i("getrealtimephonenumber",e.detail)}function b(e){i("error",e.detail)}function h(e){i("launchapp",e.detail)}function v(e){i("opensetting",e.detail)}function w(e){i("chooseavatar",e.detail)}function k(e){i("agreeprivacyauthorization",e.detail)}return e.watch((()=>t.loading),(()=>{!function(){const{loadingColor:e,type:n,plain:a}=t;let i=e;if(!i)switch(n){case"primary":i="#4D80F0";break;case"success":i="#34d19d";break;case"info":case"default":i="#333";break;case"warning":i="#f0883a";break;case"error":i="#fa4350"}const s=((e="#4D80F0",o=!0)=>`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 42 42"><defs><linearGradient x1="100%" y1="0%" x2="0%" y2="0%" id="a"><stop stop-color="${o?e:"#fff"}" offset="0%" stop-opacity="0"/><stop stop-color="${o?e:"#fff"}" offset="100%"/></linearGradient></defs><g fill="none" fill-rule="evenodd"><path d="M21 1c11.046 0 20 8.954 20 20s-8.954 20-20 20S1 32.046 1 21 9.954 1 21 1zm0 7C13.82 8 8 13.82 8 21s5.82 13 13 13 13-5.82 13-13S28.18 8 21 8z" fill="${o?"#fff":e}"/><path d="M4.599 21c0 9.044 7.332 16.376 16.376 16.376 9.045 0 16.376-7.332 16.376-16.376" stroke="url(#a)" stroke-width="3.5" stroke-linecap="round"/></g></svg>`)(i,!a);c.value=`"data:image/svg+xml;base64,${o.encode(s)}"`}()}),{deep:!0,immediate:!0}),(o,n)=>e.e({a:o.loading},o.loading?{b:e.s(l.value)}:o.icon?{d:e.p({"custom-class":"wd-button__icon",name:o.icon,classPrefix:o.classPrefix})}:{},{c:o.icon,e:o.buttonId,f:""+(o.disabled||o.loading?"":"wd-button--active"),g:e.s(o.customStyle),h:e.n("is-"+o.type),i:e.n("is-"+o.size),j:e.n(o.round?"is-round":""),k:e.n(o.hairline?"is-hairline":""),l:e.n(o.plain?"is-plain":""),m:e.n(o.disabled?"is-disabled":""),n:e.n(o.block?"is-block":""),o:e.n(o.loading?"is-loading":""),p:e.n(o.customClass),q:s.value,r:r.value,s:o.disabled||o.loading?void 0:o.openType,t:o.sendMessageTitle,v:o.sendMessagePath,w:o.sendMessageImg,x:o.appParameter,y:o.showMessageCard,z:o.sessionFrom,A:o.lang,B:o.hoverStopPropagation,C:o.scope,D:e.o(d),E:e.o(u),F:e.o(p),G:e.o(f),H:e.o(g),I:e.o(m),J:e.o(b),K:e.o(h),L:e.o(v),M:e.o(w),N:e.o(k)})}}),i=e._export_sfc(t,[["__scopeId","data-v-0fd72f7b"]]);wx.createComponent(i);
