import{r as j,a9 as I,N as C,l as g,S as P,aA as N,O as w}from"./index-CIAVq8iD-1776148658686.js";const ne=Object.assign,h=e=>e!==null&&typeof e=="object",m=e=>e!=null,z=e=>typeof e=="function",x=e=>typeof e=="number"||/^\d+(\.\d+)?$/.test(e);function b(e,u){const t=u.split(".");let r=e;return t.forEach(c=>{var s;r=h(r)&&(s=r[c])!=null?s:""}),r}const re=null,B=[Number,String],R={type:Boolean,default:!0},p=e=>({type:String,default:e});function l(e){if(m(e))return x(e)?`${e}px`:String(e)}const L=/-(\w)/g,S=e=>e.replace(L,(u,t)=>t.toUpperCase()),{hasOwnProperty:T}=Object.prototype;function k(e,u,t){const r=u[t];m(r)&&(!T.call(e,t)||!h(r)?e[t]=r:e[t]=O(Object(e[t]),r))}function O(e,u){return Object.keys(u).forEach(t=>{k(e,u,t)}),e}var K={name:"姓名",tel:"电话",save:"保存",clear:"清空",undo:"撤销",cancel:"取消",confirm:"确认",delete:"删除",loading:"加载中...",noCoupon:"暂无优惠券",nameEmpty:"请填写姓名",addContact:"添加联系人",telInvalid:"请填写正确的电话",vanCalendar:{end:"结束",start:"开始",title:"日期选择",weekdays:["日","一","二","三","四","五","六"],monthTitle:(e,u)=>`${e}年${u}月`,rangePrompt:e=>`最多选择 ${e} 天`},vanCascader:{select:"请选择"},vanPagination:{prev:"上一页",next:"下一页"},vanPullRefresh:{pulling:"下拉即可刷新...",loosing:"释放即可刷新..."},vanSubmitBar:{label:"合计:"},vanCoupon:{unlimited:"无门槛",discount:e=>`${e}折`,condition:e=>`满${e}元可用`},vanCouponCell:{title:"优惠券",count:e=>`${e}张可用`},vanCouponList:{exchange:"兑换",close:"不使用",enable:"可用",disabled:"不可用",placeholder:"输入优惠码"},vanAddressEdit:{area:"地区",areaEmpty:"请选择地区",addressEmpty:"请填写详细地址",addressDetail:"详细地址",defaultAddress:"设为默认收货地址"},vanAddressList:{add:"新增地址"}};const D=j("zh-CN"),$=I({"zh-CN":K}),M={messages(){return $[D.value]},use(e,u){D.value=e,this.add({[e]:u})},add(e={}){O($,e)}};var U=M;function V(e){const u=S(e)+".";return(t,...r)=>{const c=U.messages(),s=b(c,u+t)||b(c,t);return z(s)?s(...r):s}}function v(e,u){return u?typeof u=="string"?` ${e}--${u}`:Array.isArray(u)?u.reduce((t,r)=>t+v(e,r),""):Object.keys(u).reduce((t,r)=>t+(u[r]?v(e,r):""),""):""}function W(e){return(u,t)=>(u&&typeof u!="string"&&(t=u,u=""),u=u?`${e}__${u}`:e,`${u}${v(u,t)}`)}function F(e){const u=`van-${e}`;return[u,W(u),V(u)]}function _(e){return e.install=u=>{const{name:t}=e;t&&(u.component(t,e),u.component(S(`-${t}`),e))},e}const[Y,y]=F("badge"),Z={dot:Boolean,max:B,tag:p("div"),color:String,offset:Array,content:B,showZero:R,position:p("top-right")};var G=C({name:Y,props:Z,setup(e,{slots:u}){const t=()=>{if(u.content)return!0;const{content:n,showZero:a}=e;return m(n)&&n!==""&&(a||n!==0&&n!=="0")},r=()=>{const{dot:n,max:a,content:o}=e;if(!n&&t())return u.content?u.content():m(a)&&x(o)&&+o>+a?`${a}+`:o},c=n=>n.startsWith("-")?n.replace("-",""):`-${n}`,s=P(()=>{const n={background:e.color};if(e.offset){const[a,o]=e.offset,{position:f}=e,[i,E]=f.split("-");u.default?(typeof o=="number"?n[i]=l(i==="top"?o:-o):n[i]=i==="top"?l(o):c(o),typeof a=="number"?n[E]=l(E==="left"?a:-a):n[E]=E==="left"?l(a):c(a)):(n.marginTop=l(o),n.marginLeft=l(a))}return n}),d=()=>{if(t()||e.dot)return g("div",{class:y([e.position,{dot:e.dot,fixed:!!u.default}]),style:s.value},[r()])};return()=>{if(u.default){const{tag:n}=e;return g(n,{class:y("wrapper")},{default:()=>[u.default(),d()]})}return d()}}});const X=_(G),[q]=F("config-provider"),H=Symbol(q),[J,A]=F("icon"),Q=e=>e?.includes("/"),ee={dot:Boolean,tag:p("i"),name:String,size:B,badge:B,color:String,badgeProps:Object,classPrefix:String};var ue=C({name:J,props:ee,setup(e,{slots:u}){const t=N(H,null),r=P(()=>e.classPrefix||t?.iconPrefix||A());return()=>{const{tag:c,dot:s,name:d,size:n,badge:a,color:o}=e,f=Q(d);return g(X,w({dot:s,tag:c,class:[r.value,f?"":`${r.value}-${d}`],style:{color:o,fontSize:l(n)},content:a},e.badgeProps),{default:()=>{var i;return[(i=u.default)==null?void 0:i.call(u),f&&g("img",{class:A("image"),src:d},null)]}})}}});const ae=_(ue);export{ae as I,F as c,ne as e,m as i,p as m,B as n,R as t,re as u,_ as w};
