index-c2909177.js 9.2 KB

1
  1. import{L as S,C as M,a as F,r as g,l as B,G,Q,y as j,o as V,O as y,g as W,J as X,z as ee,E as te,R as ne,d as Y,c as w,m as re}from"./index-e4df6086.js";function He(){}const Je=Object.assign,H=typeof window<"u",O=e=>e!==null&&typeof e=="object",m=e=>e!=null,x=e=>typeof e=="function",Ue=e=>O(e)&&x(e.then)&&x(e.catch),Ke=e=>Object.prototype.toString.call(e)==="[object Date]"&&!Number.isNaN(e.getTime()),J=e=>typeof e=="number"||/^\d+(\.\d+)?$/.test(e),oe=()=>H?/ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()):!1;function N(e,t){const n=t.split(".");let r=e;return n.forEach(u=>{var s;r=O(r)&&(s=r[u])!=null?s:""}),r}function Ze(e,t,n){return t.reduce((r,u)=>((!n||e[u]!==void 0)&&(r[u]=e[u]),r),{})}const qe=(e,t)=>JSON.stringify(e)===JSON.stringify(t),Ge=e=>Array.isArray(e)?e:[e],Qe=null,E=[Number,String],ue={type:Boolean,default:!0},Xe=e=>({type:e,required:!0}),et=()=>({type:Array,default:()=>[]}),tt=e=>({type:Number,default:e}),nt=e=>({type:E,default:e}),A=e=>({type:String,default:e});var b=typeof window<"u",se=e=>e===window,T=(e,t)=>({top:0,left:0,right:e,bottom:t,width:e,height:t}),rt=e=>{const t=y(e);if(se(t)){const n=t.innerWidth,r=t.innerHeight;return T(n,r)}return t!=null&&t.getBoundingClientRect?t.getBoundingClientRect():T(0,0)};function ot(e){const t=S(e,null);if(t){const n=W(),{link:r,unlink:u,internalChildren:s}=t;r(n),M(()=>u(n));const c=F(()=>s.indexOf(n));return{parent:t,index:c}}return{parent:null,index:g(-1)}}function ie(e){const t=[],n=r=>{Array.isArray(r)&&r.forEach(u=>{var s;ne(u)&&(t.push(u),(s=u.component)!=null&&s.subTree&&(t.push(u.component.subTree),n(u.component.subTree.children)),u.children&&n(u.children))})};return n(e),t}var $=(e,t)=>{const n=e.indexOf(t);return n===-1?e.findIndex(r=>t.key!==void 0&&t.key!==null&&r.type===t.type&&r.key===t.key):n};function ae(e,t,n){const r=ie(e.subTree.children);n.sort((s,c)=>$(r,s.vnode)-$(r,c.vnode));const u=n.map(s=>s.proxy);t.sort((s,c)=>{const o=u.indexOf(s),i=u.indexOf(c);return o-i})}function ut(e){const t=B([]),n=B([]),r=W();return{children:t,linkChildren:s=>{X(e,Object.assign({link:i=>{i.proxy&&(n.push(i),t.push(i.proxy),ae(r,t,n))},unlink:i=>{const a=n.indexOf(i);t.splice(a,1),n.splice(a,1)},children:t,internalChildren:n},s))}}}function ce(e){let t;V(()=>{e(),ee(()=>{t=!0})}),te(()=>{t&&e()})}function le(e,t,n={}){if(!b)return;const{target:r=window,passive:u=!1,capture:s=!1}=n;let c=!1,o;const i=l=>{if(c)return;const d=y(l);d&&!o&&(d.addEventListener(e,t,{capture:s,passive:u}),o=!0)},a=l=>{if(c)return;const d=y(l);d&&o&&(d.removeEventListener(e,t,s),o=!1)};M(()=>a(r)),G(()=>a(r)),ce(()=>i(r));let p;return Q(r)&&(p=j(r,(l,d)=>{a(d),i(l)})),()=>{p==null||p(),a(r),c=!0}}function st(e,t,n={}){if(!b)return;const{eventName:r="click"}=n;le(r,s=>{(Array.isArray(e)?e:[e]).every(i=>{const a=y(i);return a&&!a.contains(s.target)})&&t(s)},{target:document})}var h,v;function de(){if(!h&&(h=g(0),v=g(0),b)){const e=()=>{h.value=window.innerWidth,v.value=window.innerHeight};e(),window.addEventListener("resize",e,{passive:!0}),window.addEventListener("orientationchange",e,{passive:!0})}return{width:h,height:v}}var fe=/scroll|auto|overlay/i,U=b?window:void 0;function pe(e){return e.tagName!=="HTML"&&e.tagName!=="BODY"&&e.nodeType===1}function ge(e,t=U){let n=e;for(;n&&n!==t&&pe(n);){const{overflowY:r}=window.getComputedStyle(n);if(fe.test(r))return n;n=n.parentNode}return t}function it(e,t=U){const n=g();return V(()=>{e.value&&(n.value=ge(e.value,t))}),n}var me=Symbol("van-field");function at(e){const t=S(me,null);t&&!t.customValue.value&&(t.customValue.value=e,j(e,()=>{t.resetValidation(),t.validateWithTrigger("onChange")}))}function ct(e){const t="scrollTop"in e?e.scrollTop:e.pageYOffset;return Math.max(t,0)}function k(e,t){"scrollTop"in e?e.scrollTop=t:e.scrollTo(e.scrollX,t)}function Ee(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0}function he(e){k(window,e),k(document.body,e)}const ye=oe();function lt(){ye&&he(Ee())}const we=e=>e.stopPropagation();function dt(e,t){(typeof e.cancelable!="boolean"||e.cancelable)&&e.preventDefault(),t&&we(e)}const{width:be,height:ve}=de();function f(e){if(m(e))return J(e)?`${e}px`:String(e)}function ft(e){if(m(e)){if(Array.isArray(e))return{width:f(e[0]),height:f(e[1])};const t=f(e);return{width:t,height:t}}}function pt(e){const t={};return e!==void 0&&(t.zIndex=+e),t}let C;function Ce(){if(!C){const e=document.documentElement,t=e.style.fontSize||window.getComputedStyle(e).fontSize;C=parseFloat(t)}return C}function Be(e){return e=e.replace(/rem/g,""),+e*Ce()}function xe(e){return e=e.replace(/vw/g,""),+e*be.value/100}function Ae(e){return e=e.replace(/vh/g,""),+e*ve.value/100}function gt(e){if(typeof e=="number")return e;if(H){if(e.includes("rem"))return Be(e);if(e.includes("vw"))return xe(e);if(e.includes("vh"))return Ae(e)}return parseFloat(e)}const De=/-(\w)/g,K=e=>e.replace(De,(t,n)=>n.toUpperCase());function mt(e,t=2){let n=e+"";for(;n.length<t;)n="0"+n;return n}const Et=(e,t,n)=>Math.min(Math.max(e,t),n);function _(e,t,n){const r=e.indexOf(t);return r===-1?e:t==="-"&&r!==0?e.slice(0,r):e.slice(0,r+1)+e.slice(r).replace(n,"")}function ht(e,t=!0,n=!0){t?e=_(e,".",/\./g):e=e.split(".")[0],n?e=_(e,"-",/-/g):e=e.replace(/-/,"");const r=t?/[^-0-9.]/g:/[^-0-9]/g;return e.replace(r,"")}function yt(e,t){return Math.round((e+t)*1e10)/1e10}const{hasOwnProperty:Se}=Object.prototype;function Fe(e,t,n){const r=t[n];m(r)&&(!Se.call(e,n)||!O(r)?e[n]=r:e[n]=Z(Object(e[n]),r))}function Z(e,t){return Object.keys(t).forEach(n=>{Fe(e,t,n)}),e}var Oe={name:"姓名",tel:"电话",save:"保存",clear:"清空",cancel:"取消",confirm:"确认",delete:"删除",loading:"加载中...",noCoupon:"暂无优惠券",nameEmpty:"请填写姓名",addContact:"添加联系人",telInvalid:"请填写正确的电话",vanCalendar:{end:"结束",start:"开始",title:"日期选择",weekdays:["日","一","二","三","四","五","六"],monthTitle:(e,t)=>`${e}年${t}月`,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 I=g("zh-CN"),R=B({"zh-CN":Oe}),Pe={messages(){return R[I.value]},use(e,t){I.value=e,this.add({[e]:t})},add(e={}){Z(R,e)}};var Ne=Pe;function Te(e){const t=K(e)+".";return(n,...r)=>{const u=Ne.messages(),s=N(u,t+n)||N(u,n);return x(s)?s(...r):s}}function D(e,t){return t?typeof t=="string"?` ${e}--${t}`:Array.isArray(t)?t.reduce((n,r)=>n+D(e,r),""):Object.keys(t).reduce((n,r)=>n+(t[r]?D(e,r):""),""):""}function $e(e){return(t,n)=>(t&&typeof t!="string"&&(n=t,t=""),t=t?`${e}__${t}`:e,`${t}${D(t,n)}`)}function P(e){const t=`van-${e}`;return[t,$e(t),Te(t)]}function q(e){return e.install=t=>{const{name:n}=e;n&&(t.component(n,e),t.component(K(`-${n}`),e))},e}const[ke,L]=P("badge"),_e={dot:Boolean,max:E,tag:A("div"),color:String,offset:Array,content:E,showZero:ue,position:A("top-right")};var Ie=Y({name:ke,props:_e,setup(e,{slots:t}){const n=()=>{if(t.content)return!0;const{content:o,showZero:i}=e;return m(o)&&o!==""&&(i||o!==0&&o!=="0")},r=()=>{const{dot:o,max:i,content:a}=e;if(!o&&n())return t.content?t.content():m(i)&&J(a)&&+a>+i?`${i}+`:a},u=o=>o.startsWith("-")?o.replace("-",""):`-${o}`,s=F(()=>{const o={background:e.color};if(e.offset){const[i,a]=e.offset,{position:p}=e,[l,d]=p.split("-");t.default?(typeof a=="number"?o[l]=f(l==="top"?a:-a):o[l]=l==="top"?f(a):u(a),typeof i=="number"?o[d]=f(d==="left"?i:-i):o[d]=d==="left"?f(i):u(i)):(o.marginTop=f(a),o.marginLeft=f(i))}return o}),c=()=>{if(n()||e.dot)return w("div",{class:L([e.position,{dot:e.dot,fixed:!!t.default}]),style:s.value},[r()])};return()=>{if(t.default){const{tag:o}=e;return w(o,{class:L("wrapper")},{default:()=>[t.default(),c()]})}return c()}}});const Re=q(Ie),[Le,wt]=P("config-provider"),ze=Symbol(Le),[Me,z]=P("icon"),je=e=>e==null?void 0:e.includes("/"),Ve={dot:Boolean,tag:A("i"),name:String,size:E,badge:E,color:String,badgeProps:Object,classPrefix:String};var We=Y({name:Me,props:Ve,setup(e,{slots:t}){const n=S(ze,null),r=F(()=>e.classPrefix||(n==null?void 0:n.iconPrefix)||z());return()=>{const{tag:u,dot:s,name:c,size:o,badge:i,color:a}=e,p=je(c);return w(Re,re({dot:s,tag:u,class:[r.value,p?"":`${r.value}-${c}`],style:{color:a,fontSize:f(o)},content:i},e.badgeProps),{default:()=>{var l;return[(l=t.default)==null?void 0:l.call(t),p&&w("img",{class:z("image"),src:c},null)]}})}}});const bt=q(We);export{et as A,Re as B,le as C,gt as D,qe as E,mt as F,Ke as G,it as H,bt as I,st as J,rt as K,ve as L,ge as M,ct as N,ce as O,tt as P,be as Q,Ue as R,Ee as S,he as T,me as U,Ge as V,ot as a,f as b,P as c,Qe as d,Je as e,A as f,pt as g,He as h,O as i,x as j,H as k,ft as l,nt as m,E as n,at as o,Ze as p,ht as q,m as r,lt as s,ue as t,ut as u,dt as v,q as w,yt as x,Et as y,Xe as z};