index-415d4eae.js 9.7 KB

1
  1. import{M as x,E as V,a as A,r as m,y as C,I as X,O as Q,n as Y,o as W,P as w,g as P,K as tt,s as et,H as nt,Q as ot,d as U,c as B,m as rt}from"./index-ccb16a16.js";function Kt(){}const Zt=Object.assign,H=typeof window<"u",F=t=>t!==null&&typeof t=="object",E=t=>t!=null,T=t=>typeof t=="function",Jt=t=>F(t)&&T(t.then)&&T(t.catch),qt=t=>Object.prototype.toString.call(t)==="[object Date]"&&!Number.isNaN(t.getTime()),K=t=>typeof t=="number"||/^\d+(\.\d+)?$/.test(t),st=()=>H?/ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()):!1;function R(t,e){const n=e.split(".");let o=t;return n.forEach(s=>{var u;o=F(o)&&(u=o[s])!=null?u:""}),o}function Gt(t,e,n){return e.reduce((o,s)=>((!n||t[s]!==void 0)&&(o[s]=t[s]),o),{})}const Xt=(t,e)=>JSON.stringify(t)===JSON.stringify(e),Qt=t=>Array.isArray(t)?t:[t],te=null,h=[Number,String],ut={type:Boolean,default:!0},ee=t=>({type:t,required:!0}),ne=()=>({type:Array,default:()=>[]}),oe=t=>({type:Number,default:t}),re=t=>({type:h,default:t}),S=t=>({type:String,default:t});var b=typeof window<"u",it=t=>t===window,N=(t,e)=>({top:0,left:0,right:t,bottom:e,width:t,height:e}),se=t=>{const e=w(t);if(it(e)){const n=e.innerWidth,o=e.innerHeight;return N(n,o)}return e!=null&&e.getBoundingClientRect?e.getBoundingClientRect():N(0,0)};function ue(t){const e=x(t,null);if(e){const n=P(),{link:o,unlink:s,internalChildren:u}=e;o(n),V(()=>s(n));const c=A(()=>u.indexOf(n));return{parent:e,index:c}}return{parent:null,index:m(-1)}}function at(t){const e=[],n=o=>{Array.isArray(o)&&o.forEach(s=>{var u;ot(s)&&(e.push(s),(u=s.component)!=null&&u.subTree&&(e.push(s.component.subTree),n(s.component.subTree.children)),s.children&&n(s.children))})};return n(t),e}var _=(t,e)=>{const n=t.indexOf(e);return n===-1?t.findIndex(o=>e.key!==void 0&&e.key!==null&&o.type===e.type&&o.key===e.key):n};function ct(t,e,n){const o=at(t.subTree.children);n.sort((u,c)=>_(o,u.vnode)-_(o,c.vnode));const s=n.map(u=>u.proxy);e.sort((u,c)=>{const r=s.indexOf(u),i=s.indexOf(c);return r-i})}function ie(t){const e=C([]),n=C([]),o=P();return{children:e,linkChildren:u=>{tt(t,Object.assign({link:i=>{i.proxy&&(n.push(i),e.push(i.proxy),ct(o,e,n))},unlink:i=>{const a=n.indexOf(i);e.splice(a,1),n.splice(a,1)},children:e,internalChildren:n},u))}}}function lt(t){let e;W(()=>{t(),et(()=>{e=!0})}),nt(()=>{e&&t()})}function dt(t,e,n={}){if(!b)return;const{target:o=window,passive:s=!1,capture:u=!1}=n;let c=!1,r;const i=l=>{if(c)return;const d=w(l);d&&!r&&(d.addEventListener(t,e,{capture:u,passive:s}),r=!0)},a=l=>{if(c)return;const d=w(l);d&&r&&(d.removeEventListener(t,e,u),r=!1)};V(()=>a(o)),X(()=>a(o)),lt(()=>i(o));let p;return Q(o)&&(p=Y(o,(l,d)=>{a(d),i(l)})),()=>{p==null||p(),a(o),c=!0}}function ae(t,e,n={}){if(!b)return;const{eventName:o="click"}=n;dt(o,u=>{(Array.isArray(t)?t:[t]).every(i=>{const a=w(i);return a&&!a.contains(u.target)})&&e(u)},{target:document})}var y,O;function ft(){if(!y&&(y=m(0),O=m(0),b)){const t=()=>{y.value=window.innerWidth,O.value=window.innerHeight};t(),window.addEventListener("resize",t,{passive:!0}),window.addEventListener("orientationchange",t,{passive:!0})}return{width:y,height:O}}var pt=/scroll|auto|overlay/i,Z=b?window:void 0;function gt(t){return t.tagName!=="HTML"&&t.tagName!=="BODY"&&t.nodeType===1}function mt(t,e=Z){let n=t;for(;n&&n!==e&&gt(n);){const{overflowY:o}=window.getComputedStyle(n);if(pt.test(o))return n;n=n.parentNode}return e}function ce(t,e=Z){const n=m();return W(()=>{t.value&&(n.value=mt(t.value,e))}),n}var Et=Symbol("van-field");function le(t){const e=x(Et,null);e&&!e.customValue.value&&(e.customValue.value=t,Y(t,()=>{e.resetValidation(),e.validateWithTrigger("onChange")}))}function de(t){const e="scrollTop"in t?t.scrollTop:t.pageYOffset;return Math.max(e,0)}function k(t,e){"scrollTop"in t?t.scrollTop=e:t.scrollTo(t.scrollX,e)}function ht(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0}function yt(t){k(window,t),k(document.body,t)}const wt=st();function fe(){wt&&yt(ht())}const Bt=t=>t.stopPropagation();function pe(t,e){(typeof t.cancelable!="boolean"||t.cancelable)&&t.preventDefault(),e&&Bt(t)}const{width:bt,height:Ot}=ft();function f(t){if(E(t))return K(t)?`${t}px`:String(t)}function ge(t){if(E(t)){if(Array.isArray(t))return{width:f(t[0]),height:f(t[1])};const e=f(t);return{width:e,height:e}}}function me(t){const e={};return t!==void 0&&(e.zIndex=+t),e}let v;function vt(){if(!v){const t=document.documentElement,e=t.style.fontSize||window.getComputedStyle(t).fontSize;v=parseFloat(e)}return v}function Ct(t){return t=t.replace(/rem/g,""),+t*vt()}function Tt(t){return t=t.replace(/vw/g,""),+t*bt.value/100}function St(t){return t=t.replace(/vh/g,""),+t*Ot.value/100}function Ee(t){if(typeof t=="number")return t;if(H){if(t.includes("rem"))return Ct(t);if(t.includes("vw"))return Tt(t);if(t.includes("vh"))return St(t)}return parseFloat(t)}const Dt=/-(\w)/g,J=t=>t.replace(Dt,(e,n)=>n.toUpperCase());function he(t,e=2){let n=t+"";for(;n.length<e;)n="0"+n;return n}const ye=(t,e,n)=>Math.min(Math.max(t,e),n);function I(t,e,n){const o=t.indexOf(e);return o===-1?t:e==="-"&&o!==0?t.slice(0,o):t.slice(0,o+1)+t.slice(o).replace(n,"")}function we(t,e=!0,n=!0){e?t=I(t,".",/\./g):t=t.split(".")[0],n?t=I(t,"-",/-/g):t=t.replace(/-/,"");const o=e?/[^-0-9.]/g:/[^-0-9]/g;return t.replace(o,"")}function Be(t,e){return Math.round((t+e)*1e10)/1e10}const{hasOwnProperty:xt}=Object.prototype;function At(t,e,n){const o=e[n];E(o)&&(!xt.call(t,n)||!F(o)?t[n]=o:t[n]=q(Object(t[n]),o))}function q(t,e){return Object.keys(e).forEach(n=>{At(t,e,n)}),t}var Pt={name:"姓名",tel:"电话",save:"保存",clear:"清空",cancel:"取消",confirm:"确认",delete:"删除",loading:"加载中...",noCoupon:"暂无优惠券",nameEmpty:"请填写姓名",addContact:"添加联系人",telInvalid:"请填写正确的电话",vanCalendar:{end:"结束",start:"开始",title:"日期选择",weekdays:["日","一","二","三","四","五","六"],monthTitle:(t,e)=>`${t}年${e}月`,rangePrompt:t=>`最多选择 ${t} 天`},vanCascader:{select:"请选择"},vanPagination:{prev:"上一页",next:"下一页"},vanPullRefresh:{pulling:"下拉即可刷新...",loosing:"释放即可刷新..."},vanSubmitBar:{label:"合计:"},vanCoupon:{unlimited:"无门槛",discount:t=>`${t}折`,condition:t=>`满${t}元可用`},vanCouponCell:{title:"优惠券",count:t=>`${t}张可用`},vanCouponList:{exchange:"兑换",close:"不使用",enable:"可用",disabled:"不可用",placeholder:"输入优惠码"},vanAddressEdit:{area:"地区",areaEmpty:"请选择地区",addressEmpty:"请填写详细地址",addressDetail:"详细地址",defaultAddress:"设为默认收货地址"},vanAddressList:{add:"新增地址"}};const M=m("zh-CN"),L=C({"zh-CN":Pt}),Ft={messages(){return L[M.value]},use(t,e){M.value=t,this.add({[t]:e})},add(t={}){q(L,t)}};var $t=Ft;function Rt(t){const e=J(t)+".";return(n,...o)=>{const s=$t.messages(),u=R(s,e+n)||R(s,n);return T(u)?u(...o):u}}function D(t,e){return e?typeof e=="string"?` ${t}--${e}`:Array.isArray(e)?e.reduce((n,o)=>n+D(t,o),""):Object.keys(e).reduce((n,o)=>n+(e[o]?D(t,o):""),""):""}function Nt(t){return(e,n)=>(e&&typeof e!="string"&&(n=e,e=""),e=e?`${t}__${e}`:t,`${e}${D(e,n)}`)}function $(t){const e=`van-${t}`;return[e,Nt(e),Rt(e)]}const g="van-hairline",be=`${g}--top`,Oe=`${g}--left`,ve=`${g}--bottom`,Ce=`${g}--surround`,Te=`${g}--top-bottom`,Se=`${g}-unset--top-bottom`,De="van-haptics-feedback",xe=Symbol("van-form"),Ae=500,Pe=5;function G(t){return t.install=e=>{const{name:n}=t;n&&(e.component(n,t),e.component(J(`-${n}`),t))},t}const Fe={to:[String,Object],url:String,replace:Boolean};function _t({to:t,url:e,replace:n,$router:o}){t&&o?o[n?"replace":"push"](t):e&&(n?location.replace(e):location.href=e)}function $e(){const t=P().proxy;return()=>_t(t)}const[kt,j]=$("badge"),It={dot:Boolean,max:h,tag:S("div"),color:String,offset:Array,content:h,showZero:ut,position:S("top-right")};var Mt=U({name:kt,props:It,setup(t,{slots:e}){const n=()=>{if(e.content)return!0;const{content:r,showZero:i}=t;return E(r)&&r!==""&&(i||r!==0&&r!=="0")},o=()=>{const{dot:r,max:i,content:a}=t;if(!r&&n())return e.content?e.content():E(i)&&K(a)&&+a>+i?`${i}+`:a},s=r=>r.startsWith("-")?r.replace("-",""):`-${r}`,u=A(()=>{const r={background:t.color};if(t.offset){const[i,a]=t.offset,{position:p}=t,[l,d]=p.split("-");e.default?(typeof a=="number"?r[l]=f(l==="top"?a:-a):r[l]=l==="top"?f(a):s(a),typeof i=="number"?r[d]=f(d==="left"?i:-i):r[d]=d==="left"?f(i):s(i)):(r.marginTop=f(a),r.marginLeft=f(i))}return r}),c=()=>{if(n()||t.dot)return B("div",{class:j([t.position,{dot:t.dot,fixed:!!e.default}]),style:u.value},[o()])};return()=>{if(e.default){const{tag:r}=t;return B(r,{class:j("wrapper")},{default:()=>[e.default(),c()]})}return c()}}});const Lt=G(Mt),[jt,Re]=$("config-provider"),zt=Symbol(jt),[Vt,z]=$("icon"),Yt=t=>t==null?void 0:t.includes("/"),Wt={dot:Boolean,tag:S("i"),name:String,size:h,badge:h,color:String,badgeProps:Object,classPrefix:String};var Ut=U({name:Vt,props:Wt,setup(t,{slots:e}){const n=x(zt,null),o=A(()=>t.classPrefix||(n==null?void 0:n.iconPrefix)||z());return()=>{const{tag:s,dot:u,name:c,size:r,badge:i,color:a}=t,p=Yt(c);return B(Lt,rt({dot:u,tag:s,class:[o.value,p?"":`${o.value}-${c}`],style:{color:a,fontSize:f(r)},content:i},t.badgeProps),{default:()=>{var l;return[(l=e.default)==null?void 0:l.call(e),p&&B("img",{class:z("image"),src:c},null)]}})}}});const Ne=G(Ut);export{Pe as $,we as A,Te as B,fe as C,pe as D,Be as E,ye as F,ee as G,De as H,Ne as I,ne as J,dt as K,Ae as L,Ee as M,Xt as N,Se as O,mt as P,de as Q,he as R,qt as S,ce as T,ae as U,se as V,Ot as W,ve as X,lt as Y,oe as Z,bt as _,$e as a,Jt as a0,xe as a1,ht as a2,yt as a3,Et as a4,Qt as a5,Ce as a6,ue as b,$ as c,Lt as d,Zt as e,f,me as g,be as h,F as i,g as j,E as k,H as l,re as m,h as n,S as o,te as p,Gt as q,Fe as r,Kt as s,ut as t,ie as u,T as v,G as w,Oe as x,ge as y,le as z};