All Downloads are FREE. Search and download functionalities are using the official Maven repository.

static.smart-ui.ui-groups.vant.vant.min.js Maven / Gradle / Ivy

There is a newer version: 1.0.4
Show newest version
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("vue")):"function"==typeof define&&define.amd?define("vant",["vue"],e):"object"==typeof exports?exports.vant=e(require("vue")):t.vant=e(t.Vue)}("undefined"!=typeof self?self:this,(function(t){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var s=e[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)i.d(n,s,function(e){return t[e]}.bind(null,s));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=12)}([function(t,e,i){"use strict";i.d(e,"f",(function(){return s})),i.d(e,"g",(function(){return r})),i.d(e,"b",(function(){return o})),i.d(e,"c",(function(){return a})),i.d(e,"d",(function(){return l})),i.d(e,"e",(function(){return u})),i.d(e,"a",(function(){return c}));var n=i(2),s=i.n(n).a.prototype.$isServer;function r(){}function o(t){return null!=t}function a(t){return"function"==typeof t}function l(t){return null!==t&&"object"==typeof t}function u(t){return l(t)&&a(t.then)&&a(t.catch)}function c(t,e){var i=e.split("."),n=t;return i.forEach((function(t){n=o(n[t])?n[t]:""})),n}},function(t,e,i){"use strict";function n(){return(n=Object.assign||function(t){for(var e,i=1;i1?r-1:0),a=1;a
 * Released under the MIT License.
 */
t.exports=function(){"use strict";function t(t){t=t||{};var n=arguments.length,s=0;if(1===n)return t;for(;++s-1?t.splice(i,1):void 0}}function r(t,e){if("IMG"===t.tagName&&t.getAttribute("data-srcset")){var i=t.getAttribute("data-srcset"),n=[],s=t.parentNode.offsetWidth*e,r=void 0,o=void 0,a=void 0;(i=i.trim().split(",")).map((function(t){t=t.trim(),-1===(r=t.lastIndexOf(" "))?(o=t,a=999998):(o=t.substr(0,r),a=parseInt(t.substr(r+1,t.length-r-2),10)),n.push([a,o])})),n.sort((function(t,e){if(t[0]e[0])return 1;if(t[0]===e[0]){if(-1!==e[1].indexOf(".webp",e[1].length-5))return 1;if(-1!==t[1].indexOf(".webp",t[1].length-5))return-1}return 0}));for(var l="",u=void 0,c=n.length,h=0;h=s){l=u[1];break}return l}}function o(t,e){for(var i=void 0,n=0,s=t.length;n0&&void 0!==arguments[0]?arguments[0]:1;return g&&window.devicePixelRatio||t},w=function(){if(g){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e)}catch(t){}return t}}(),C={on:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];w?t.addEventListener(e,i,{capture:n,passive:!0}):t.addEventListener(e,i,n)},off:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];t.removeEventListener(e,i,n)}},O=function(t,e,i){var n=new Image;n.src=t.src,n.onload=function(){e({naturalHeight:n.naturalHeight,naturalWidth:n.naturalWidth,src:n.src})},n.onerror=function(t){i(t)}},T=function(t,e){return"undefined"!=typeof getComputedStyle?getComputedStyle(t,null).getPropertyValue(e):t.style[e]},$=function(t){return T(t,"overflow")+T(t,"overflow-y")+T(t,"overflow-x")},I={},B=function(){function t(e){var i=e.el,n=e.src,s=e.error,r=e.loading,o=e.bindType,a=e.$parent,l=e.options,u=e.elRenderer;c(this,t),this.el=i,this.src=n,this.error=s,this.loading=r,this.bindType=o,this.attempt=0,this.naturalHeight=0,this.naturalWidth=0,this.options=l,this.rect=null,this.$parent=a,this.elRenderer=u,this.performanceData={init:Date.now(),loadStart:0,loadEnd:0},this.filter(),this.initState(),this.render("loading",!1)}return h(t,[{key:"initState",value:function(){this.el.dataset.src=this.src,this.state={error:!1,loaded:!1,rendered:!1}}},{key:"record",value:function(t){this.performanceData[t]=Date.now()}},{key:"update",value:function(t){var e=t.src,i=t.loading,n=t.error,s=this.src;this.src=e,this.loading=i,this.error=n,this.filter(),s!==this.src&&(this.attempt=0,this.initState())}},{key:"getRect",value:function(){this.rect=this.el.getBoundingClientRect()}},{key:"checkInView",value:function(){return this.getRect(),this.rect.topthis.options.preLoadTop&&this.rect.left0}},{key:"filter",value:function(){var t=this;(function(t){if(!(t instanceof Object))return[];if(Object.keys)return Object.keys(t);var e=[];for(var i in t)t.hasOwnProperty(i)&&e.push(i);return e})(this.options.filter).map((function(e){t.options.filter[e](t,t.options)}))}},{key:"renderLoading",value:function(t){var e=this;O({src:this.loading},(function(i){e.render("loading",!1),t()}),(function(){t(),e.options.silent||console.warn("VueLazyload log: load failed with loading image("+e.loading+")")}))}},{key:"load",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l;return this.attempt>this.options.attempt-1&&this.state.error?(this.options.silent||console.log("VueLazyload log: "+this.src+" tried too more than "+this.options.attempt+" times"),void e()):this.state.loaded||I[this.src]?(this.state.loaded=!0,e(),this.render("loaded",!0)):void this.renderLoading((function(){t.attempt++,t.record("loadStart"),O({src:t.src},(function(i){t.naturalHeight=i.naturalHeight,t.naturalWidth=i.naturalWidth,t.state.loaded=!0,t.state.error=!1,t.record("loadEnd"),t.render("loaded",!1),I[t.src]=1,e()}),(function(e){!t.options.silent&&console.error(e),t.state.error=!0,t.state.loaded=!1,t.render("error",!1)}))}))}},{key:"render",value:function(t,e){this.elRenderer(this,t,e)}},{key:"performance",value:function(){var t="loading",e=0;return this.state.loaded&&(t="loaded",e=(this.performanceData.loadEnd-this.performanceData.loadStart)/1e3),this.state.error&&(t="error"),{src:this.src,state:t,time:e}}},{key:"destroy",value:function(){this.el=null,this.src=null,this.error=null,this.loading=null,this.bindType=null,this.attempt=0}}]),t}(),j="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",D=["scroll","wheel","mousewheel","resize","animationend","transitionend","touchmove"],N={rootMargin:"0px",threshold:0},E=function(t){return function(){function e(t){var i=t.preLoad,n=t.error,s=t.throttleWait,r=t.preLoadTop,o=t.dispatchEvent,l=t.loading,u=t.attempt,h=t.silent,d=void 0===h||h,f=t.scale,p=t.listenEvents,m=(t.hasbind,t.filter),v=t.adapter,g=t.observer,b=t.observerOptions;c(this,e),this.version="1.2.3",this.mode=y,this.ListenerQueue=[],this.TargetIndex=0,this.TargetQueue=[],this.options={silent:d,dispatchEvent:!!o,throttleWait:s||200,preLoad:i||1.3,preLoadTop:r||0,error:n||j,loading:l||j,attempt:u||3,scale:f||x(f),ListenEvents:p||D,hasbind:!1,supportWebp:a(),filter:m||{},adapter:v||{},observer:!!g,observerOptions:b||N},this._initEvent(),this.lazyLoadHandler=function(t,e){var i=null,n=0;return function(){if(!i){var s=Date.now()-n,r=this,o=arguments,a=function(){n=Date.now(),i=!1,t.apply(r,o)};s>=e?a():i=setTimeout(a,e)}}}(this._lazyLoadHandler.bind(this),this.options.throttleWait),this.setMode(this.options.observer?S:y)}return h(e,[{key:"config",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};v(this.options,t)}},{key:"performance",value:function(){var t=[];return this.ListenerQueue.map((function(e){t.push(e.performance())})),t}},{key:"addLazyBox",value:function(t){this.ListenerQueue.push(t),g&&(this._addListenerTarget(window),this._observer&&this._observer.observe(t.el),t.$el&&t.$el.parentNode&&this._addListenerTarget(t.$el.parentNode))}},{key:"add",value:function(e,i,n){var s=this;if(function(t,e){for(var i=!1,n=0,s=t.length;n0&&this.rect.left0},load:function(){this.show=!0,this.state.loaded=!0,this.$emit("show",this)}}}},P=function(){function t(e){var i=e.lazy;c(this,t),this.lazy=i,i.lazyContainerMananger=this,this._queue=[]}return h(t,[{key:"bind",value:function(t,e,i){var n=new M({el:t,binding:e,vnode:i,lazy:this.lazy});this._queue.push(n)}},{key:"update",value:function(t,e,i){var n=o(this._queue,(function(e){return e.el===t}));n&&n.update({el:t,binding:e,vnode:i})}},{key:"unbind",value:function(t,e,i){var n=o(this._queue,(function(e){return e.el===t}));n&&(n.clear(),s(this._queue,n))}}]),t}(),A={selector:"img"},M=function(){function t(e){var i=e.el,n=e.binding,s=e.vnode,r=e.lazy;c(this,t),this.el=null,this.vnode=s,this.binding=n,this.options={},this.lazy=r,this._queue=[],this.update({el:i,binding:n})}return h(t,[{key:"update",value:function(t){var e=this,i=t.el,n=t.binding;this.el=i,this.options=v({},A,n.value),this.getImgs().forEach((function(t){e.lazy.add(t,v({},e.binding,{value:{src:t.dataset.src,error:t.dataset.error,loading:t.dataset.loading}}),e.vnode)}))}},{key:"getImgs",value:function(){return function(t){for(var e=t.length,i=[],n=0;n1&&void 0!==arguments[1]?arguments[1]:{},i=E(t),n=new i(e),s=new P({lazy:n}),r="2"===t.version.split(".")[0];t.prototype.$Lazyload=n,e.lazyComponent&&t.component("lazy-component",L(n)),r?(t.directive("lazy",{bind:n.add.bind(n),update:n.update.bind(n),componentUpdated:n.lazyLoadHandler.bind(n),unbind:n.remove.bind(n)}),t.directive("lazy-container",{bind:s.bind.bind(s),update:s.update.bind(s),unbind:s.unbind.bind(s)})):(t.directive("lazy",{bind:n.lazyLoadHandler.bind(n),update:function(t,e){v(this.vm.$refs,this.vm.$els),n.add(this.el,{modifiers:this.modifiers||{},arg:this.arg,value:t,oldValue:e},{context:this.vm})},unbind:function(){n.remove(this.el)}}),t.directive("lazy-container",{update:function(t,e){s.update(this.el,{modifiers:this.modifiers||{},arg:this.arg,value:t,oldValue:e},{context:this.vm})},unbind:function(){s.unbind(this.el)}}))}}}()},function(t,e){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){"use strict";function n(){return(n=Object.assign||function(t){for(var e=1;e2?i-2:0),s=2;si&&e>10?"horizontal":i>e&&i>10?"vertical":"")},resetTouchStatus:function(){this.direction="",this.deltaX=0,this.deltaY=0,this.offsetX=0,this.offsetY=0},bindTouchEvent:function(t){var e=this.onTouchStart,i=this.onTouchMove,n=this.onTouchEnd;w(t,"touchstart",e),w(t,"touchmove",i),n&&(w(t,"touchend",n),w(t,"touchcancel",n))}}});function K(t){var e=t.ref,i=t.afterPortal;return l.a.extend({props:{getContainer:[String,Function]},watch:{getContainer:"portal"},mounted:function(){this.getContainer&&this.portal()},methods:{portal:function(){var t,n,s=this.getContainer,r=e?this.$refs[e]:this.$el;s?t="string"==typeof(n=s)?document.querySelector(n):n():this.$parent&&(t=this.$parent.$el),t&&t!==r.parentNode&&t.appendChild(r),i&&i.call(this)}}})}function X(t){function e(){this.binded||(t.call(this,w,!0),this.binded=!0)}function i(){this.binded&&(t.call(this,C,!1),this.binded=!1)}return{mounted:e,activated:e,deactivated:i,beforeDestroy:i}}var Q={mixins:[X((function(t,e){this.handlePopstate(e&&this.closeOnPopstate)}))],props:{closeOnPopstate:Boolean},data:function(){return{bindStatus:!1}},watch:{closeOnPopstate:function(t){this.handlePopstate(t)}},methods:{handlePopstate:function(t){var e=this;this.$isServer||this.bindStatus!==t&&(this.bindStatus=t,(t?w:C)(window,"popstate",(function(){e.close(),e.shouldReopen=!1})))}}},G={value:Boolean,overlay:Boolean,overlayStyle:Object,overlayClass:String,closeOnClickOverlay:Boolean,zIndex:[Number,String],lockScroll:{type:Boolean,default:!0},lazyRender:{type:Boolean,default:!0}};function Z(t){return void 0===t&&(t={}),{mixins:[U,Q,K({afterPortal:function(){this.overlay&&A()}})],props:G,data:function(){return{inited:this.value}},computed:{shouldRender:function(){return this.inited||!this.lazyRender}},watch:{value:function(e){var i=e?"open":"close";this.inited=this.inited||this.value,this[i](),t.skipToggleEvent||this.$emit(i)},overlay:"renderOverlay"},mounted:function(){this.value&&this.open()},activated:function(){this.shouldReopen&&(this.$emit("input",!0),this.shouldReopen=!1)},beforeDestroy:function(){this.close(),this.getContainer&&z(this.$el)},deactivated:function(){this.value&&(this.close(),this.shouldReopen=!0)},methods:{open:function(){this.$isServer||this.opened||(void 0!==this.zIndex&&(y.zIndex=this.zIndex),this.opened=!0,this.renderOverlay(),this.lockScroll&&(w(document,"touchstart",this.touchStart),w(document,"touchmove",this.onTouchMove),y.lockCount||document.body.classList.add("van-overflow-hidden"),y.lockCount++))},close:function(){this.opened&&(this.lockScroll&&(y.lockCount--,C(document,"touchstart",this.touchStart),C(document,"touchmove",this.onTouchMove),y.lockCount||document.body.classList.remove("van-overflow-hidden")),this.opened=!1,M(this),this.$emit("input",!1))},onTouchMove:function(t){this.touchMove(t);var e=this.deltaY>0?"10":"01",i=R(t.target,this.$el),n=i.scrollHeight,s=i.offsetHeight,r=i.scrollTop,o="11";0===r?o=s>=n?"00":"01":r+s>=n&&(o="10"),"11"===o||"vertical"!==this.direction||parseInt(o,2)&parseInt(e,2)||T(t,!0)},renderOverlay:function(){var t=this;!this.$isServer&&this.value&&this.$nextTick((function(){var e,i;t.updateZIndex(t.overlay?1:0),t.overlay?(e=t,i={zIndex:y.zIndex++,duration:t.duration,className:t.overlayClass,customStyle:t.overlayStyle},y.stack.some((function(t){return t.vm===e}))||(y.stack.push({vm:e,config:i}),A())):M(t)}))},updateZIndex:function(t){void 0===t&&(t=0),this.$el.style.zIndex=++y.zIndex+t}}}}var J=i(8),tt=Object(o.a)("info"),et=tt[0],it=tt[1];function nt(t,e,i,n){var s=e.dot,o=e.info,a=Object(S.b)(o)&&""!==o;if(s||a)return t("div",r()([{class:it({dot:s})},h(n,!0)]),[s?"":e.info])}nt.props={dot:Boolean,info:[Number,String]};var st=et(nt),rt=Object(o.a)("icon"),ot=rt[0],at=rt[1];var lt={medel:"medal","medel-o":"medal-o"};function ut(t,e,i,n){var s=function(t){return t&<[t]||t}(e.name),o=function(t){return!!t&&-1!==t.indexOf("/")}(s);return t(e.tag,r()([{class:[e.classPrefix,o?"":e.classPrefix+"-"+s],style:{color:e.color,fontSize:Object(J.a)(e.size)}},h(n,!0)]),[i.default&&i.default(),o&&t("img",{class:at("image"),attrs:{src:s}}),t(st,{attrs:{dot:e.dot,info:Object(S.b)(e.badge)?e.badge:e.info}})])}ut.props={dot:Boolean,name:String,size:[Number,String],info:[Number,String],badge:[Number,String],color:String,tag:{type:String,default:"i"},classPrefix:{type:String,default:at()}};var ct=ot(ut),ht=Object(o.a)("popup"),dt=ht[0],ft=ht[1],pt=dt({mixins:[Z()],props:{round:Boolean,duration:[Number,String],closeable:Boolean,transition:String,safeAreaInsetBottom:Boolean,closeIcon:{type:String,default:"cross"},closeIconPosition:{type:String,default:"top-right"},position:{type:String,default:"center"},overlay:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0}},beforeCreate:function(){var t=this,e=function(e){return function(i){return t.$emit(e,i)}};this.onClick=e("click"),this.onOpened=e("opened"),this.onClosed=e("closed")},render:function(){var t,e=arguments[0];if(this.shouldRender){var i=this.round,n=this.position,s=this.duration,r="center"===n,o=this.transition||(r?"van-fade":"van-popup-slide-"+n),a={};if(Object(S.b)(s)){var l=r?"animationDuration":"transitionDuration";a[l]=s+"s"}return e("transition",{attrs:{name:o},on:{afterEnter:this.onOpened,afterLeave:this.onClosed}},[e("div",{directives:[{name:"show",value:this.value}],style:a,class:ft((t={round:i},t[n]=n,t["safe-area-inset-bottom"]=this.safeAreaInsetBottom,t)),on:{click:this.onClick}},[this.slots(),this.closeable&&e(ct,{attrs:{role:"button",tabindex:"0",name:this.closeIcon},class:ft("close-icon",this.closeIconPosition),on:{click:this.close}})])])}}}),mt=Object(o.a)("loading"),vt=mt[0],gt=mt[1];function bt(t,e){if("spinner"===e.type){for(var i=[],n=0;n<12;n++)i.push(t("i"));return i}return t("svg",{class:gt("circular"),attrs:{viewBox:"25 25 50 50"}},[t("circle",{attrs:{cx:"50",cy:"50",r:"20",fill:"none"}})])}function yt(t,e,i){if(i.default){var n=e.textSize&&{fontSize:Object(J.a)(e.textSize)};return t("span",{class:gt("text"),style:n},[i.default()])}}function St(t,e,i,n){var s=e.color,o=e.size,a=e.type,l={color:s};if(o){var u=Object(J.a)(o);l.width=u,l.height=u}return t("div",r()([{class:gt([a,{vertical:e.vertical}])},h(n,!0)]),[t("span",{class:gt("spinner",a),style:l},[bt(t,e)]),yt(t,e,i)])}St.props={color:String,size:[Number,String],vertical:Boolean,textSize:[Number,String],type:{type:String,default:"circular"}};var kt=vt(St),xt=Object(o.a)("action-sheet"),wt=xt[0],Ct=xt[1];function Ot(t,e,i,n){var s=e.title,o=e.cancelText;function a(){d(n,"input",!1),d(n,"cancel")}var l=e.description&&t("div",{class:Ct("description")},[e.description]);return t(pt,r()([{class:Ct(),attrs:{position:"bottom",round:e.round,value:e.value,overlay:e.overlay,duration:e.duration,lazyRender:e.lazyRender,lockScroll:e.lockScroll,getContainer:e.getContainer,closeOnPopstate:e.closeOnPopstate,closeOnClickOverlay:e.closeOnClickOverlay,safeAreaInsetBottom:e.safeAreaInsetBottom}},h(n,!0)]),[function(){if(s)return t("div",{class:Ct("header")},[s,t(ct,{attrs:{name:e.closeIcon},class:Ct("close"),on:{click:a}})])}(),l,e.actions&&e.actions.map((function(i,s){var r=i.disabled,o=i.loading,a=i.callback;return t("button",{attrs:{type:"button"},class:[Ct("item",{disabled:r,loading:o}),i.className,v],style:{color:i.color},on:{click:function(t){t.stopPropagation(),r||o||(a&&a(i),d(n,"select",i,s),e.closeOnClickAction&&d(n,"input",!1))}}},[o?t(kt,{attrs:{size:"20px"}}):[t("span",{class:Ct("name")},[i.name]),i.subname&&t("span",{class:Ct("subname")},[i.subname])]])})),function(){if(i.default)return t("div",{class:Ct("content")},[i.default()])}(),function(){if(o)return t("button",{attrs:{type:"button"},class:Ct("cancel"),on:{click:a}},[o])}()])}Ot.props=n({},G,{title:String,actions:Array,duration:[Number,String],cancelText:String,description:String,getContainer:[String,Function],closeOnPopstate:Boolean,closeOnClickAction:Boolean,round:{type:Boolean,default:!0},closeIcon:{type:String,default:"cross"},safeAreaInsetBottom:{type:Boolean,default:!0},overlay:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0}});var Tt=wt(Ot);function $t(t){return t=t.replace(/[^-|\d]/g,""),/^((\+86)|(86))?(1)\d{10}$/.test(t)||/^0[0-9-]{10,13}$/.test(t)}var It={title:String,loading:Boolean,showToolbar:Boolean,cancelButtonText:String,confirmButtonText:String,allowHtml:{type:Boolean,default:!0},visibleItemCount:{type:[Number,String],default:5},itemHeight:{type:[Number,String],default:44},swipeDuration:{type:[Number,String],default:1e3}},Bt=i(7);function jt(t){return Array.isArray(t)?t.map((function(t){return jt(t)})):"object"==typeof t?Object(Bt.a)({},t):t}function Dt(t,e,i){return Math.min(Math.max(t,e),i)}var Nt=Object(o.a)("picker-column"),Et=Nt[0],Lt=Nt[1];function Pt(t){return Object(S.d)(t)&&t.disabled}var At=Et({mixins:[U],props:{valueKey:String,allowHtml:Boolean,className:String,itemHeight:[Number,String],defaultIndex:Number,swipeDuration:[Number,String],visibleItemCount:[Number,String],initialOptions:{type:Array,default:function(){return[]}}},data:function(){return{offset:0,duration:0,options:jt(this.initialOptions),currentIndex:this.defaultIndex}},created:function(){this.$parent.children&&this.$parent.children.push(this),this.setIndex(this.currentIndex)},mounted:function(){this.bindTouchEvent(this.$el)},destroyed:function(){var t=this.$parent.children;t&&t.splice(t.indexOf(this),1)},watch:{initialOptions:"setOptions",defaultIndex:function(t){this.setIndex(t)}},computed:{count:function(){return this.options.length},baseOffset:function(){return this.itemHeight*(this.visibleItemCount-1)/2}},methods:{setOptions:function(t){JSON.stringify(t)!==JSON.stringify(this.options)&&(this.options=jt(t),this.setIndex(this.defaultIndex))},onTouchStart:function(t){if(this.touchStart(t),this.moving){var e=function(t){var e=window.getComputedStyle(t),i=e.transform||e.webkitTransform,n=i.slice(7,i.length-1).split(", ")[5];return Number(n)}(this.$refs.wrapper);this.offset=Math.min(0,e-this.baseOffset),this.startOffset=this.offset}else this.startOffset=this.offset;this.duration=0,this.transitionEndTrigger=null,this.touchStartTime=Date.now(),this.momentumOffset=this.startOffset},onTouchMove:function(t){this.touchMove(t),"vertical"===this.direction&&(this.moving=!0,T(t,!0)),this.offset=Dt(this.startOffset+this.deltaY,-this.count*this.itemHeight,this.itemHeight);var e=Date.now();e-this.touchStartTime>300&&(this.touchStartTime=e,this.momentumOffset=this.offset)},onTouchEnd:function(){var t=this,e=this.offset-this.momentumOffset,i=Date.now()-this.touchStartTime;if(i<300&&Math.abs(e)>15)this.momentum(e,i);else{var n=this.getIndexByOffset(this.offset);this.duration=200,this.setIndex(n,!0),setTimeout((function(){t.moving=!1}),0)}},onTransitionEnd:function(){this.stopMomentum()},onClickItem:function(t){this.moving||(this.duration=200,this.setIndex(t,!0))},adjustIndex:function(t){for(var e=t=Dt(t,0,this.count);e=0;i--)if(!Pt(this.options[i]))return i},getOptionText:function(t){return Object(S.d)(t)&&this.valueKey in t?t[this.valueKey]:t},setIndex:function(t,e){var i=this,n=-(t=this.adjustIndex(t)||0)*this.itemHeight,s=function(){t!==i.currentIndex&&(i.currentIndex=t,e&&i.$emit("change",t))};this.moving&&n!==this.offset?this.transitionEndTrigger=s:s(),this.offset=n},setValue:function(t){for(var e=this.options,i=0;i-1&&(t=t.slice(0,i+1)+t.slice(i).replace(/\./g,""))}else t=t.split(".")[0];var n=e?/[^0-9.]/g:/\D/g;return t.replace(n,"")}var Kt=!S.f&&/ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase());function Xt(){Kt&&q(W())}function Qt(t,e){var i=e.to,n=e.url,s=e.replace;if(i&&t){var r=t[s?"replace":"push"](i);r&&r.catch&&r.catch((function(t){if(t&&"NavigationDuplicated"!==t.name)throw t}))}else n&&(s?location.replace(n):location.href=n)}function Gt(t){Qt(t.parent&&t.parent.$router,t.props)}var Zt={url:String,replace:Boolean,to:[String,Object]},Jt={icon:String,size:String,center:Boolean,isLink:Boolean,required:Boolean,clickable:Boolean,iconPrefix:String,titleStyle:null,titleClass:null,valueClass:null,labelClass:null,title:[Number,String],value:[Number,String],label:[Number,String],arrowDirection:String,border:{type:Boolean,default:!0}},te=Object(o.a)("cell"),ee=te[0],ie=te[1];function ne(t,e,i,n){var s=e.icon,o=e.size,a=e.title,l=e.label,u=e.value,c=e.isLink,f=i.title||Object(S.b)(a);function p(){if(i.label||Object(S.b)(l))return t("div",{class:[ie("label"),e.labelClass]},[i.label?i.label():l])}var m=c||e.clickable,v={clickable:m,center:e.center,required:e.required,borderless:!e.border};return o&&(v[o]=o),t("div",r()([{class:ie(v),attrs:{role:m?"button":null,tabindex:m?0:null},on:{click:function(t){d(n,"click",t),Gt(n)}}},h(n)]),[i.icon?i.icon():s?t(ct,{class:ie("left-icon"),attrs:{name:s,classPrefix:e.iconPrefix}}):void 0,function(){if(f)return t("div",{class:[ie("title"),e.titleClass],style:e.titleStyle},[i.title?i.title():t("span",[a]),p()])}(),function(){if(i.default||Object(S.b)(u))return t("div",{class:[ie("value",{alone:!f}),e.valueClass]},[i.default?i.default():t("span",[u])])}(),function(){var n=i["right-icon"];if(n)return n();if(c){var s=e.arrowDirection;return t(ct,{class:ie("right-icon"),attrs:{name:s?"arrow-"+s:"arrow"}})}}(),null==i.extra?void 0:i.extra()])}ne.props=n({},Jt,{},Zt);var se=ee(ne),re=Object(o.a)("field"),oe=re[0],ae=re[1],le=oe({inheritAttrs:!1,provide:function(){return{vanField:this}},inject:{vanForm:{default:null}},props:n({},Jt,{name:String,rules:Array,error:Boolean,disabled:Boolean,readonly:Boolean,autosize:[Boolean,Object],leftIcon:String,rightIcon:String,clearable:Boolean,formatter:Function,maxlength:[Number,String],labelWidth:[Number,String],labelClass:null,labelAlign:String,inputAlign:String,placeholder:String,errorMessage:String,errorMessageAlign:String,showWordLimit:Boolean,type:{type:String,default:"text"}}),data:function(){return{focused:!1,validateMessage:""}},watch:{value:function(){this.resetValidation(),this.validateWithTrigger("onChange"),this.$nextTick(this.adjustSize)}},mounted:function(){this.format(),this.$nextTick(this.adjustSize),this.vanForm&&this.vanForm.fields.push(this)},beforeDestroy:function(){var t=this;this.vanForm&&(this.vanForm.fields=this.vanForm.fields.filter((function(e){return e!==t})))},computed:{showClear:function(){return this.clearable&&this.focused&&""!==this.value&&Object(S.b)(this.value)&&!this.readonly},listeners:function(){var t=n({},this.$listeners,{input:this.onInput,keypress:this.onKeypress,focus:this.onFocus,blur:this.onBlur});return delete t.click,t},labelStyle:function(){var t=this.getProp("labelWidth");if(t)return{width:Object(J.a)(t)}},formValue:function(){return this.children&&(this.$scopedSlots.input||this.$slots.input)?this.children.value:this.value}},methods:{focus:function(){this.$refs.input&&this.$refs.input.focus()},blur:function(){this.$refs.input&&this.$refs.input.blur()},runValidator:function(t,e){return new Promise((function(i){var n=e.validator(t,e);if(Object(S.e)(n))return n.then(i);i(n)}))},isEmptyValue:function(t){return Array.isArray(t)?!t.length:!t},runSyncRule:function(t,e){return(!e.required||!this.isEmptyValue(t))&&!(e.pattern&&!e.pattern.test(t))},getRuleMessage:function(t,e){var i=e.message;return Object(S.c)(i)?i(t,e):i},runRules:function(t){var e=this;return t.reduce((function(t,i){return t.then((function(){if(!e.validateMessage){var t=e.formValue;if(i.formatter&&(t=i.formatter(t,i)),e.runSyncRule(t,i))return i.validator?e.runValidator(t,i).then((function(n){!1===n&&(e.validateMessage=e.getRuleMessage(t,i))})):void 0;e.validateMessage=e.getRuleMessage(t,i)}}))}),Promise.resolve())},validate:function(t){var e=this;return void 0===t&&(t=this.rules),new Promise((function(i){t||i(),e.runRules(t).then((function(){e.validateMessage?i({name:e.name,message:e.validateMessage}):i()}))}))},validateWithTrigger:function(t){if(this.vanForm&&this.rules){var e=this.vanForm.validateTrigger===t,i=this.rules.filter((function(i){return i.trigger?i.trigger===t:e}));this.validate(i)}},resetValidation:function(){this.validateMessage&&(this.validateMessage="")},format:function(t){if(void 0===t&&(t=this.$refs.input),t){var e=t.value,i=this.maxlength;if(Object(S.b)(i)&&e.length>i&&(e=e.slice(0,i),t.value=e),"number"===this.type||"digit"===this.type){var n=e;(e=Ut(e,"number"===this.type))!==n&&(t.value=e)}if(this.formatter){var s=e;(e=this.formatter(e))!==s&&(t.value=e)}return e}},onInput:function(t){t.target.composing||this.$emit("input",this.format(t.target))},onFocus:function(t){this.focused=!0,this.$emit("focus",t),this.readonly&&this.blur()},onBlur:function(t){this.focused=!1,this.$emit("blur",t),this.validateWithTrigger("onBlur"),Xt()},onClick:function(t){this.$emit("click",t)},onClickLeftIcon:function(t){this.$emit("click-left-icon",t)},onClickRightIcon:function(t){this.$emit("click-right-icon",t)},onClear:function(t){T(t),this.$emit("input",""),this.$emit("clear",t)},onKeypress:function(t){"search"===this.type&&13===t.keyCode&&this.blur(),this.$emit("keypress",t)},adjustSize:function(){var t=this.$refs.input;if("textarea"===this.type&&this.autosize&&t){t.style.height="auto";var e=t.scrollHeight;if(Object(S.d)(this.autosize)){var i=this.autosize,n=i.maxHeight,s=i.minHeight;n&&(e=Math.min(e,n)),s&&(e=Math.max(e,s))}e&&(t.style.height=e+"px")}},genInput:function(){var t=this.$createElement,e=this.type,i=this.slots("input"),s=this.getProp("inputAlign");if(i)return t("div",{class:ae("control",[s,"custom"])},[i]);var o={ref:"input",class:ae("control",s),domProps:{value:this.value},attrs:n({},this.$attrs,{name:this.name,disabled:this.disabled,readonly:this.readonly,placeholder:this.placeholder}),on:this.listeners,directives:[{name:"model",value:this.value}]};if("textarea"===e)return t("textarea",r()([{},o]));var a,l=e;return"number"===e&&(l="text",a="decimal"),"digit"===e&&(l="tel",a="numeric"),t("input",r()([{attrs:{type:l,inputmode:a}},o]))},genLeftIcon:function(){var t=this.$createElement;if(this.slots("left-icon")||this.leftIcon)return t("div",{class:ae("left-icon"),on:{click:this.onClickLeftIcon}},[this.slots("left-icon")||t(ct,{attrs:{name:this.leftIcon,classPrefix:this.iconPrefix}})])},genRightIcon:function(){var t=this.$createElement,e=this.slots;if(e("right-icon")||this.rightIcon)return t("div",{class:ae("right-icon"),on:{click:this.onClickRightIcon}},[e("right-icon")||t(ct,{attrs:{name:this.rightIcon,classPrefix:this.iconPrefix}})])},genWordLimit:function(){var t=this.$createElement;if(this.showWordLimit&&this.maxlength){var e=this.value.length,i=e>=this.maxlength;return t("div",{class:ae("word-limit")},[t("span",{class:ae("word-num",{full:i})},[e]),"/",this.maxlength])}},genMessage:function(){var t=this.$createElement;if(!this.vanForm||!1!==this.vanForm.showErrorMessage){var e=this.errorMessage||this.validateMessage;if(e){var i=this.getProp("errorMessageAlign");return t("div",{class:ae("error-message",i)},[e])}}},getProp:function(t){return Object(S.b)(this[t])?this[t]:this.vanForm&&Object(S.b)(this.vanForm[t])?this.vanForm[t]:void 0},genLabel:function(){var t=this.$createElement,e=this.getProp("colon")?":":"";return this.slots("label")?[this.slots("label"),e]:this.label?t("span",[this.label+e]):void 0}},render:function(){var t,e=arguments[0],i=this.slots,n=this.getProp("labelAlign"),s={icon:this.genLeftIcon},r=this.genLabel();return r&&(s.title=function(){return r}),e(se,{attrs:{icon:this.leftIcon,size:this.size,center:this.center,border:this.border,isLink:this.isLink,required:this.required,clickable:this.clickable,titleStyle:this.labelStyle,valueClass:ae("value"),titleClass:[ae("label",n),this.labelClass],arrowDirection:this.arrowDirection},scopedSlots:s,class:ae((t={error:this.error||this.validateMessage},t["label-"+n]=n,t["min-height"]="textarea"===this.type&&!this.autosize,t)),on:{click:this.onClick}},[e("div",{class:ae("body")},[this.genInput(),this.showClear&&e(ct,{attrs:{name:"clear"},class:ae("clear"),on:{touchstart:this.onClear}}),this.genRightIcon(),i("button")&&e("div",{class:ae("button")},[i("button")])]),this.genWordLimit(),this.genMessage()])}}),ue=0;var ce=Object(o.a)("toast"),he=ce[0],de=ce[1],fe=he({mixins:[Z()],props:{icon:String,className:null,iconPrefix:String,loadingType:String,forbidClick:Boolean,closeOnClick:Boolean,message:[Number,String],type:{type:String,default:"text"},position:{type:String,default:"middle"},transition:{type:String,default:"van-fade"},lockScroll:{type:Boolean,default:!1}},data:function(){return{clickable:!1}},mounted:function(){this.toggleClickable()},destroyed:function(){this.toggleClickable()},watch:{value:"toggleClickable",forbidClick:"toggleClickable"},methods:{onClick:function(){this.closeOnClick&&this.close()},toggleClickable:function(){var t=this.value&&this.forbidClick;this.clickable!==t&&(this.clickable=t,t?(ue||document.body.classList.add("van-toast--unclickable"),ue++):--ue||document.body.classList.remove("van-toast--unclickable"))},onAfterEnter:function(){this.$emit("opened"),this.onOpened&&this.onOpened()},onAfterLeave:function(){this.$emit("closed")},genIcon:function(){var t=this.$createElement,e=this.icon,i=this.type,n=this.iconPrefix,s=this.loadingType;return e||"success"===i||"fail"===i?t(ct,{class:de("icon"),attrs:{classPrefix:n,name:e||i}}):"loading"===i?t(kt,{class:de("loading"),attrs:{type:s}}):void 0},genMessage:function(){var t=this.$createElement,e=this.type,i=this.message;if(Object(S.b)(i)&&""!==i)return"html"===e?t("div",{class:de("text"),domProps:{innerHTML:i}}):t("div",{class:de("text")},[i])}},render:function(){var t,e=arguments[0];return e("transition",{attrs:{name:this.transition},on:{afterEnter:this.onAfterEnter,afterLeave:this.onAfterLeave}},[e("div",{directives:[{name:"show",value:this.value}],class:[de([this.position,(t={},t[this.type]=!this.icon,t)]),this.className],on:{click:this.onClick}},[this.genIcon(),this.genMessage()])])}}),pe={icon:"",type:"text",mask:!1,value:!0,message:"",className:"",overlay:!1,onClose:null,onOpened:null,duration:2e3,iconPrefix:void 0,position:"middle",transition:"van-fade",forbidClick:!1,loadingType:void 0,getContainer:"body",overlayStyle:null,closeOnClick:!1,closeOnClickOverlay:!1},me={},ve=[],ge=!1,be=n({},pe);function ye(t){return Object(S.d)(t)?t:{message:t}}function Se(t){void 0===t&&(t={});var e=function(){if(S.f)return{};if(!ve.length||ge){var t=new(l.a.extend(fe))({el:document.createElement("div")});t.$on("input",(function(e){t.value=e})),ve.push(t)}return ve[ve.length-1]}();return e.value&&e.updateZIndex(),t=ye(t),(t=n({},be,{},me[t.type||be.type],{},t)).clear=function(){e.value=!1,t.onClose&&t.onClose(),ge&&!S.f&&e.$on("closed",(function(){clearTimeout(e.timer),ve=ve.filter((function(t){return t!==e})),z(e.$el),e.$destroy()}))},n(e,function(t){return n({},t,{overlay:t.mask||t.overlay,mask:void 0,duration:void 0})}(t)),clearTimeout(e.timer),t.duration>0&&(e.timer=setTimeout((function(){e.clear()}),t.duration)),e}["loading","success","fail"].forEach((function(t){var e;Se[t]=(e=t,function(t){return Se(n({type:e},ye(t)))})})),Se.clear=function(t){ve.length&&(t?(ve.forEach((function(t){t.clear()})),ve=[]):ge?ve.shift().clear():ve[0].clear())},Se.setDefaultOptions=function(t,e){"string"==typeof t?me[t]=e:n(be,t)},Se.resetDefaultOptions=function(t){"string"==typeof t?me[t]=null:(be=n({},pe),me={})},Se.allowMultiple=function(t){void 0===t&&(t=!0),ge=t},Se.install=function(){l.a.use(fe)},l.a.prototype.$toast=Se;var ke=Se,xe=Object(o.a)("button"),we=xe[0],Ce=xe[1];function Oe(t,e,i,n){var s,o=e.tag,a=e.icon,l=e.type,u=e.color,c=e.plain,f=e.disabled,p=e.loading,m=e.hairline,v=e.loadingText,g={};u&&(g.color=c?u:"#fff",c||(g.background=u),-1!==u.indexOf("gradient")?g.border=0:g.borderColor=u);var b,y,S=[Ce([l,e.size,{plain:c,loading:p,disabled:f,hairline:m,block:e.block,round:e.round,square:e.square}]),(s={},s["van-hairline--surround"]=m,s)];return t(o,r()([{style:g,class:S,attrs:{type:e.nativeType,disabled:f},on:{click:function(t){p||f||(d(n,"click",t),Gt(n))},touchstart:function(t){d(n,"touchstart",t)}}},h(n)]),[(y=[],p?y.push(t(kt,{class:Ce("loading"),attrs:{size:e.loadingSize,type:e.loadingType,color:"currentColor"}})):a&&y.push(t(ct,{attrs:{name:a,classPrefix:e.iconPrefix},class:Ce("icon")})),(b=p?v:i.default?i.default():e.text)&&y.push(t("span",{class:Ce("text")},[b])),y)])}Oe.props=n({},Zt,{text:String,icon:String,color:String,block:Boolean,plain:Boolean,round:Boolean,square:Boolean,loading:Boolean,hairline:Boolean,disabled:Boolean,nativeType:String,loadingText:String,loadingType:String,tag:{type:String,default:"button"},type:{type:String,default:"default"},size:{type:String,default:"normal"},loadingSize:{type:String,default:"20px"}});var Te,$e=we(Oe),Ie=Object(o.a)("dialog"),Be=Ie[0],je=Ie[1],De=Ie[2],Ne=Be({mixins:[Z()],props:{title:String,width:[Number,String],message:String,className:null,callback:Function,beforeClose:Function,messageAlign:String,cancelButtonText:String,cancelButtonColor:String,confirmButtonText:String,confirmButtonColor:String,showCancelButton:Boolean,transition:{type:String,default:"van-dialog-bounce"},showConfirmButton:{type:Boolean,default:!0},overlay:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!1}},data:function(){return{loading:{confirm:!1,cancel:!1}}},methods:{onClickOverlay:function(){this.handleAction("overlay")},handleAction:function(t){var e=this;this.$emit(t),this.value&&(this.beforeClose?(this.loading[t]=!0,this.beforeClose(t,(function(i){!1!==i&&e.loading[t]&&e.onClose(t),e.loading.confirm=!1,e.loading.cancel=!1}))):this.onClose(t))},onClose:function(t){this.close(),this.callback&&this.callback(t)},onOpened:function(){this.$emit("opened")},onClosed:function(){this.$emit("closed")},genButtons:function(){var t,e=this,i=this.$createElement,n=this.showCancelButton&&this.showConfirmButton;return i("div",{class:[v,je("footer",{buttons:n})]},[this.showCancelButton&&i($e,{attrs:{size:"large",loading:this.loading.cancel,text:this.cancelButtonText||De("cancel")},class:je("cancel"),style:{color:this.cancelButtonColor},on:{click:function(){e.handleAction("cancel")}}}),this.showConfirmButton&&i($e,{attrs:{size:"large",loading:this.loading.confirm,text:this.confirmButtonText||De("confirm")},class:[je("confirm"),(t={},t["van-hairline--left"]=n,t)],style:{color:this.confirmButtonColor},on:{click:function(){e.handleAction("confirm")}}})])}},render:function(){var t,e=arguments[0];if(this.shouldRender){var i=this.message,n=this.messageAlign,s=this.slots(),r=this.slots("title")||this.title,o=r&&e("div",{class:je("header",{isolated:!i&&!s})},[r]),a=(s||i)&&e("div",{class:je("content")},[s||e("div",{domProps:{innerHTML:i},class:je("message",(t={"has-title":r},t[n]=n,t))})]);return e("transition",{attrs:{name:this.transition},on:{afterEnter:this.onOpened,afterLeave:this.onClosed}},[e("div",{directives:[{name:"show",value:this.value}],attrs:{role:"dialog","aria-labelledby":this.title||i},class:[je(),this.className],style:{width:Object(J.a)(this.width)}},[o,a,this.genButtons()])])}}});function Ee(t){return S.f?Promise.resolve():new Promise((function(e,i){var s;Te&&(s=Te.$el,document.body.contains(s))||(Te&&Te.$destroy(),(Te=new(l.a.extend(Ne))({el:document.createElement("div"),propsData:{lazyRender:!1}})).$on("input",(function(t){Te.value=t}))),n(Te,Ee.currentOptions,t,{resolve:e,reject:i})}))}Ee.defaultOptions={value:!0,title:"",width:"",message:"",overlay:!0,className:"",lockScroll:!0,transition:"van-dialog-bounce",beforeClose:null,overlayClass:"",overlayStyle:null,messageAlign:"",getContainer:"body",cancelButtonText:"",cancelButtonColor:null,confirmButtonText:"",confirmButtonColor:null,showConfirmButton:!0,showCancelButton:!1,closeOnPopstate:!1,closeOnClickOverlay:!1,callback:function(t){Te["confirm"===t?"resolve":"reject"](t)}},Ee.alert=Ee,Ee.confirm=function(t){return Ee(n({showCancelButton:!0},t))},Ee.close=function(){Te&&(Te.value=!1)},Ee.setDefaultOptions=function(t){n(Ee.currentOptions,t)},Ee.resetDefaultOptions=function(){Ee.currentOptions=n({},Ee.defaultOptions)},Ee.resetDefaultOptions(),Ee.install=function(){l.a.use(Ne)},Ee.Component=Ne,l.a.prototype.$dialog=Ee;var Le=Ee,Pe=Object(o.a)("address-edit-detail"),Ae=Pe[0],Me=Pe[1],ze=Pe[2],Fe=!S.f&&/android/.test(navigator.userAgent.toLowerCase()),Ve=Ae({props:{value:String,errorMessage:String,focused:Boolean,detailRows:[Number,String],searchResult:Array,detailMaxlength:[Number,String],showSearchResult:Boolean},computed:{shouldShowSearchResult:function(){return this.focused&&this.searchResult&&this.showSearchResult}},methods:{onSelect:function(t){this.$emit("select-search",t),this.$emit("input",((t.address||"")+" "+(t.name||"")).trim())},onFinish:function(){this.$refs.field.blur()},genFinish:function(){var t=this.$createElement;if(this.value&&this.focused&&Fe)return t("div",{class:Me("finish"),on:{click:this.onFinish}},[ze("complete")])},genSearchResult:function(){var t=this,e=this.$createElement,i=this.value,n=this.shouldShowSearchResult,s=this.searchResult;if(n)return s.map((function(n){return e(se,{key:n.name+n.address,attrs:{clickable:!0,border:!1,icon:"location-o",label:n.address},class:Me("search-item"),on:{click:function(){t.onSelect(n)}},scopedSlots:{title:function(){if(n.name){var t=n.name.replace(i,""+i+"");return e("div",{domProps:{innerHTML:t}})}}}})}))}},render:function(){var t=arguments[0];return t(se,{class:Me()},[t(le,{attrs:{autosize:!0,rows:this.detailRows,clearable:!Fe,type:"textarea",value:this.value,errorMessage:this.errorMessage,border:!this.shouldShowSearchResult,label:ze("label"),maxlength:this.detailMaxlength,placeholder:ze("placeholder")},ref:"field",scopedSlots:{icon:this.genFinish},on:n({},this.$listeners)}),this.genSearchResult()])}}),Re={size:[Number,String],value:null,loading:Boolean,disabled:Boolean,activeColor:String,inactiveColor:String,activeValue:{type:null,default:!0},inactiveValue:{type:null,default:!1}},_e={inject:{vanField:{default:null}},watch:{value:function(){var t=this.vanField;t&&(t.resetValidation(),t.validateWithTrigger("onChange"))}},created:function(){var t=this.vanField;t&&!t.children&&(t.children=this)}},He=Object(o.a)("switch"),We=He[0],qe=He[1],Ye=We({mixins:[_e],props:Re,computed:{checked:function(){return this.value===this.activeValue},style:function(){return{fontSize:Object(J.a)(this.size),backgroundColor:this.checked?this.activeColor:this.inactiveColor}}},methods:{onClick:function(t){if(this.$emit("click",t),!this.disabled&&!this.loading){var e=this.checked?this.inactiveValue:this.activeValue;this.$emit("input",e),this.$emit("change",e)}},genLoading:function(){var t=this.$createElement;if(this.loading){var e=this.checked?this.activeColor:this.inactiveColor;return t(kt,{class:qe("loading"),attrs:{color:e}})}}},render:function(){var t=arguments[0],e=this.checked,i=this.loading,n=this.disabled;return t("div",{class:qe({on:e,loading:i,disabled:n}),attrs:{role:"switch","aria-checked":String(e)},style:this.style,on:{click:this.onClick}},[t("div",{class:qe("node")},[this.genLoading()])])}}),Ue=Object(o.a)("switch-cell"),Ke=Ue[0],Xe=Ue[1];function Qe(t,e,i,s){return t(se,r()([{attrs:{center:!0,size:e.cellSize,title:e.title,border:e.border},class:Xe([e.cellSize])},h(s)]),[t(Ye,{props:n({},e),on:n({},s.listeners)})])}Qe.props=n({},Re,{title:String,cellSize:String,border:{type:Boolean,default:!0},size:{type:String,default:"24px"}});var Ge=Ke(Qe),Ze=Object(o.a)("address-edit"),Je=Ze[0],ti=Ze[1],ei=Ze[2],ii={name:"",tel:"",country:"",province:"",city:"",county:"",areaCode:"",postalCode:"",addressDetail:"",isDefault:!1};var ni=Je({props:{areaList:Object,isSaving:Boolean,isDeleting:Boolean,validator:Function,showDelete:Boolean,showPostal:Boolean,searchResult:Array,showSetDefault:Boolean,showSearchResult:Boolean,saveButtonText:String,deleteButtonText:String,showArea:{type:Boolean,default:!0},showDetail:{type:Boolean,default:!0},disableArea:Boolean,detailRows:{type:[Number,String],default:1},detailMaxlength:{type:[Number,String],default:200},addressInfo:{type:Object,default:function(){return n({},ii)}},telValidator:{type:Function,default:$t},postalValidator:{type:Function,default:function(t){return/^\d{6}$/.test(t)}},areaColumnsPlaceholder:{type:Array,default:function(){return[]}}},data:function(){return{data:{},showAreaPopup:!1,detailFocused:!1,errorInfo:{tel:"",name:"",areaCode:"",postalCode:"",addressDetail:""}}},computed:{areaListLoaded:function(){return Object(S.d)(this.areaList)&&Object.keys(this.areaList).length},areaText:function(){var t=this.data,e=t.country,i=t.province,n=t.city,s=t.county;if(t.areaCode){var r=[e,i,n,s];return i&&i===n&&r.splice(1,1),r.filter((function(t){return t})).join("/")}return""}},watch:{addressInfo:{handler:function(t){this.data=n({},ii,{},t),this.setAreaCode(t.areaCode)},deep:!0,immediate:!0},areaList:function(){this.setAreaCode(this.data.areaCode)}},methods:{onFocus:function(t){this.errorInfo[t]="",this.detailFocused="addressDetail"===t,this.$emit("focus",t)},onChangeDetail:function(t){this.data.addressDetail=t,this.$emit("change-detail",t)},onAreaConfirm:function(t){(t=t.filter((function(t){return!!t}))).some((function(t){return!t.code}))?ke(ei("areaEmpty")):(this.showAreaPopup=!1,this.assignAreaValues(),this.$emit("change-area",t))},assignAreaValues:function(){var t=this.$refs.area;if(t){var e=t.getArea();e.areaCode=e.code,delete e.code,n(this.data,e)}},onSave:function(){var t=this,e=["name","tel"];this.showArea&&e.push("areaCode"),this.showDetail&&e.push("addressDetail"),this.showPostal&&e.push("postalCode"),e.every((function(e){var i=t.getErrorMessage(e);return i&&(t.errorInfo[e]=i),!i}))&&!this.isSaving&&this.$emit("save",this.data)},getErrorMessage:function(t){var e=String(this.data[t]||"").trim();if(this.validator){var i=this.validator(t,e);if(i)return i}switch(t){case"name":return e?"":ei("nameEmpty");case"tel":return this.telValidator(e)?"":ei("telInvalid");case"areaCode":return e?"":ei("areaEmpty");case"addressDetail":return e?"":ei("addressEmpty");case"postalCode":return e&&!this.postalValidator(e)?ei("postalEmpty"):""}},onDelete:function(){var t=this;Le.confirm({title:ei("confirmDelete")}).then((function(){t.$emit("delete",t.data)})).catch((function(){t.$emit("cancel-delete",t.data)}))},getArea:function(){return this.$refs.area?this.$refs.area.getValues():[]},setAreaCode:function(t){this.data.areaCode=t||"",t&&this.$nextTick(this.assignAreaValues)},setAddressDetail:function(t){this.data.addressDetail=t},onDetailBlur:function(){var t=this;setTimeout((function(){t.detailFocused=!1}))}},render:function(){var t=this,e=arguments[0],i=this.data,n=this.errorInfo,s=this.searchResult,r=this.disableArea,o=function(e){return function(){return t.onFocus(e)}},a=s&&s.length&&this.detailFocused;return e("div",{class:ti()},[e("div",{class:ti("fields")},[e(le,{attrs:{clearable:!0,label:ei("name"),placeholder:ei("namePlaceholder"),errorMessage:n.name},on:{focus:o("name")},model:{value:i.name,callback:function(e){t.$set(i,"name",e)}}}),e(le,{attrs:{clearable:!0,type:"tel",label:ei("tel"),placeholder:ei("telPlaceholder"),errorMessage:n.tel},on:{focus:o("tel")},model:{value:i.tel,callback:function(e){t.$set(i,"tel",e)}}}),e(le,{directives:[{name:"show",value:this.showArea}],attrs:{readonly:!0,clickable:!r,label:ei("area"),placeholder:ei("areaPlaceholder"),errorMessage:n.areaCode,rightIcon:r?null:"arrow",value:this.areaText},on:{focus:o("areaCode"),click:function(){t.$emit("click-area"),t.showAreaPopup=!r}}}),e(Ve,{directives:[{name:"show",value:this.showDetail}],attrs:{focused:this.detailFocused,value:i.addressDetail,errorMessage:n.addressDetail,detailRows:this.detailRows,detailMaxlength:this.detailMaxlength,searchResult:this.searchResult,showSearchResult:this.showSearchResult},on:{focus:o("addressDetail"),blur:this.onDetailBlur,input:this.onChangeDetail,"select-search":function(e){t.$emit("select-search",e)}}}),this.showPostal&&e(le,{directives:[{name:"show",value:!a}],attrs:{type:"tel",maxlength:"6",label:ei("postal"),placeholder:ei("postal"),errorMessage:n.postalCode},on:{focus:o("postalCode")},model:{value:i.postalCode,callback:function(e){t.$set(i,"postalCode",e)}}}),this.slots()]),this.showSetDefault&&e(Ge,{class:ti("default"),directives:[{name:"show",value:!a}],attrs:{title:ei("defaultAddress")},on:{change:function(e){t.$emit("change-default",e)}},model:{value:i.isDefault,callback:function(e){t.$set(i,"isDefault",e)}}}),e("div",{directives:[{name:"show",value:!a}],class:ti("buttons")},[e($e,{attrs:{block:!0,round:!0,loading:this.isSaving,type:"danger",text:this.saveButtonText||ei("save")},on:{click:this.onSave}}),this.showDelete&&e($e,{attrs:{block:!0,round:!0,loading:this.isDeleting,text:this.deleteButtonText||ei("delete")},on:{click:this.onDelete}})]),e(pt,{attrs:{position:"bottom",lazyRender:!1,getContainer:"body"},model:{value:t.showAreaPopup,callback:function(e){t.showAreaPopup=e}}},[e(Yt,{ref:"area",attrs:{loading:!this.areaListLoaded,value:i.areaCode,areaList:this.areaList,columnsPlaceholder:this.areaColumnsPlaceholder},on:{confirm:this.onAreaConfirm,cancel:function(){t.showAreaPopup=!1}}})])])}});function si(t,e){var i,n;void 0===e&&(e={});var s=e.indexKey||"index";return l.a.extend({inject:(i={},i[t]={default:null},i),computed:(n={parent:function(){return this.disableBindRelation?null:this[t]}},n[s]=function(){return this.bindRelation(),this.parent.children.indexOf(this)},n),mounted:function(){this.bindRelation()},beforeDestroy:function(){var t=this;this.parent&&(this.parent.children=this.parent.children.filter((function(e){return e!==t})))},methods:{bindRelation:function(){if(this.parent&&-1===this.parent.children.indexOf(this)){var t=[].concat(this.parent.children,[this]),e=function(t){var e=[];return function t(i){i.forEach((function(i){e.push(i),i.children&&t(i.children)}))}(t),e}(this.parent.slots());t.sort((function(t,i){return e.indexOf(t.$vnode)-e.indexOf(i.$vnode)})),this.parent.children=t}}}})}function ri(t){return{provide:function(){var e;return(e={})[t]=this,e},data:function(){return{children:[]}}}}var oi=Object(o.a)("radio-group"),ai=oi[0],li=oi[1],ui=ai({mixins:[ri("vanRadio"),_e],props:{value:null,disabled:Boolean,direction:String,checkedColor:String,iconSize:[Number,String]},watch:{value:function(t){this.$emit("change",t)}},render:function(){var t=arguments[0];return t("div",{class:li([this.direction]),attrs:{role:"radiogroup"}},[this.slots()])}}),ci=Object(o.a)("tag"),hi=ci[0],di=ci[1];function fi(t,e,i,n){var s,o,a=e.type,l=e.mark,u=e.plain,c=e.color,f=e.round,p=e.size,m=((s={})[u?"color":"backgroundColor"]=c,s);e.textColor&&(m.color=e.textColor);var v={mark:l,plain:u,round:f};p&&(v[p]=p);var g=e.closeable&&t(ct,{attrs:{name:"cross"},class:di("close"),on:{click:function(t){t.stopPropagation(),d(n,"close")}}});return t("transition",{attrs:{name:e.closeable?"van-fade":null}},[t("span",r()([{key:"content",style:m,class:[di([v,a]),(o={},o["van-hairline--surround"]=u,o)]},h(n,!0)]),[null==i.default?void 0:i.default(),g])])}fi.props={size:String,mark:Boolean,color:String,plain:Boolean,round:Boolean,textColor:String,closeable:Boolean,type:{type:String,default:"default"}};var pi=hi(fi),mi=function(t){var e=t.parent,i=t.bem,n=t.role;return{mixins:[si(e),_e],props:{name:null,value:null,disabled:Boolean,iconSize:[Number,String],checkedColor:String,labelPosition:String,labelDisabled:Boolean,shape:{type:String,default:"round"},bindGroup:{type:Boolean,default:!0}},computed:{disableBindRelation:function(){return!this.bindGroup},isDisabled:function(){return this.parent&&this.parent.disabled||this.disabled},direction:function(){return this.parent&&this.parent.direction||null},iconStyle:function(){var t=this.checkedColor||this.parent&&this.parent.checkedColor;if(t&&this.checked&&!this.isDisabled)return{borderColor:t,backgroundColor:t}},tabindex:function(){return this.isDisabled||"radio"===n&&!this.checked?-1:0}},methods:{onClick:function(t){var e=t.target,i=this.$refs.icon,n=i===e||i.contains(e);this.isDisabled||!n&&this.labelDisabled||this.toggle(),this.$emit("click",t)},genIcon:function(){var t=this.$createElement,e=this.checked,n=this.iconSize||this.parent&&this.parent.iconSize;return t("div",{ref:"icon",class:i("icon",[this.shape,{disabled:this.isDisabled,checked:e}]),style:{fontSize:Object(J.a)(n)}},[this.slots("icon",{checked:e})||t(ct,{attrs:{name:"success"},style:this.iconStyle})])},genLabel:function(){var t=this.$createElement,e=this.slots();if(e)return t("span",{class:i("label",[this.labelPosition,{disabled:this.isDisabled}])},[e])}},render:function(){var t=arguments[0],e=[this.genIcon()];return"left"===this.labelPosition?e.unshift(this.genLabel()):e.push(this.genLabel()),t("div",{attrs:{role:n,tabindex:this.tabindex,"aria-checked":String(this.checked)},class:i([{disabled:this.isDisabled,"label-disabled":this.labelDisabled},this.direction]),on:{click:this.onClick}},[e])}}},vi=Object(o.a)("radio"),gi=(0,vi[0])({mixins:[mi({bem:vi[1],role:"radio",parent:"vanRadio"})],computed:{currentValue:{get:function(){return this.parent?this.parent.value:this.value},set:function(t){(this.parent||this).$emit("input",t)}},checked:function(){return this.currentValue===this.name}},methods:{toggle:function(){this.currentValue=this.name}}}),bi=Object(o.a)("address-item"),yi=bi[0],Si=bi[1];function ki(t,e,i,s){var o=e.disabled,a=e.switchable;function l(){if(e.data.isDefault&&e.defaultTagText)return t(pi,{attrs:{type:"danger",round:!0},class:Si("tag")},[e.defaultTagText])}return t("div",{class:Si({disabled:o}),on:{click:function(){a&&d(s,"select"),d(s,"click")}}},[t(se,r()([{attrs:{border:!1,valueClass:Si("value")},scopedSlots:{default:function(){var i=e.data,n=[t("div",{class:Si("name")},[i.name+" "+i.tel,l()]),t("div",{class:Si("address")},[i.address])];return a&&!o?t(gi,{attrs:{name:i.id,iconSize:18}},[n]):n},"right-icon":function(){return t(ct,{attrs:{name:"edit"},class:Si("edit"),on:{click:function(t){t.stopPropagation(),d(s,"edit"),d(s,"click")}}})}}},h(s)])),null==i.bottom?void 0:i.bottom(n({},e.data,{disabled:o}))])}ki.props={data:Object,disabled:Boolean,switchable:Boolean,defaultTagText:String};var xi=yi(ki),wi=Object(o.a)("address-list"),Ci=wi[0],Oi=wi[1],Ti=wi[2];function $i(t,e,i,n){function s(s,r){if(s)return s.map((function(s,o){return t(xi,{attrs:{data:s,disabled:r,switchable:e.switchable,defaultTagText:e.defaultTagText},key:s.id,scopedSlots:{bottom:i["item-bottom"]},on:{select:function(){d(n,r?"select-disabled":"select",s,o),r||d(n,"input",s.id)},edit:function(){d(n,r?"edit-disabled":"edit",s,o)},click:function(){d(n,"click-item",s,o)}}})}))}var o=s(e.list),a=s(e.disabledList,!0);return t("div",r()([{class:Oi()},h(n)]),[null==i.top?void 0:i.top(),t(ui,{attrs:{value:e.value}},[o]),e.disabledText&&t("div",{class:Oi("disabled-text")},[e.disabledText]),a,null==i.default?void 0:i.default(),t("div",{class:Oi("bottom")},[t($e,{attrs:{round:!0,block:!0,type:"danger",text:e.addButtonText||Ti("add")},class:Oi("add"),on:{click:function(){d(n,"add")}}})])])}$i.props={list:Array,value:[Number,String],disabledList:Array,disabledText:String,addButtonText:String,defaultTagText:String,switchable:{type:Boolean,default:!0}};var Ii=Ci($i),Bi=i(6);function ji(t){return"[object Date]"===Object.prototype.toString.call(t)&&!Object(Bi.a)(t.getTime())}var Di=Object(o.a)("calendar"),Ni=Di[0],Ei=Di[1],Li=Di[2];function Pi(t,e){var i=t.getFullYear(),n=e.getFullYear(),s=t.getMonth(),r=e.getMonth();return i===n?s===r?0:s>r?1:-1:i>n?1:-1}function Ai(t,e){var i=Pi(t,e);if(0===i){var n=t.getDate(),s=e.getDate();return n===s?0:n>s?1:-1}return i}function Mi(t,e){return(t=new Date(t)).setDate(t.getDate()+e),t}function zi(t){return Mi(t,1)}function Fi(t){return Array.isArray(t)?t.map((function(t){return null===t?t:new Date(t)})):new Date(t)}function Vi(t,e){return 32-new Date(t,e-1,32).getDate()}var Ri=(0,Object(o.a)("calendar-month")[0])({props:{date:Date,type:String,color:String,minDate:Date,maxDate:Date,showMark:Boolean,rowHeight:[Number,String],formatter:Function,currentDate:[Date,Array],allowSameDay:Boolean,showSubtitle:Boolean,showMonthTitle:Boolean},data:function(){return{visible:!1}},computed:{title:function(){return t=this.date,Li("monthTitle",t.getFullYear(),t.getMonth()+1);var t},offset:function(){return this.date.getDay()},totalDay:function(){return Vi(this.date.getFullYear(),this.date.getMonth()+1)},monthStyle:function(){if(!this.visible)return{paddingBottom:Math.ceil((this.totalDay+this.offset)/7)*this.rowHeight+"px"}},days:function(){for(var t=[],e=this.date.getFullYear(),i=this.date.getMonth(),n=1;n<=this.totalDay;n++){var s=new Date(e,i,n),r=this.getDayType(s),o={date:s,type:r,text:n,bottomInfo:this.getBottomInfo(r)};this.formatter&&(o=this.formatter(o)),t.push(o)}return t}},mounted:function(){this.height=this.$el.getBoundingClientRect().height},methods:{scrollIntoView:function(){this.showSubtitle?this.$refs.days.scrollIntoView():this.$refs.month.scrollIntoView()},getMultipleDayType:function(t){var e=this,i=function(t){return e.currentDate.some((function(e){return 0===Ai(e,t)}))};if(i(t)){var n=Mi(t,-1),s=zi(t),r=i(n),o=i(s);return r&&o?"multiple-middle":r?"end":o?"start":"multiple-selected"}return""},getRangeDayType:function(t){var e=this.currentDate,i=e[0],n=e[1];if(!i)return"";var s=Ai(t,i);if(!n)return 0===s?"start":"";var r=Ai(t,n);return 0===s&&0===r&&this.allowSameDay?"start-end":0===s?"start":0===r?"end":s>0&&r<0?"middle":void 0},getDayType:function(t){var e=this.type,i=this.minDate,n=this.maxDate,s=this.currentDate;return Ai(t,i)<0||Ai(t,n)>0?"disabled":"single"===e?0===Ai(t,s)?"selected":"":"multiple"===e?this.getMultipleDayType(t):"range"===e?this.getRangeDayType(t):void 0},getBottomInfo:function(t){if("range"===this.type){if("start"===t||"end"===t)return Li(t);if("start-end"===t)return Li("startEnd")}},getDayStyle:function(t,e){var i={};return 0===e&&(i.marginLeft=100*this.offset/7+"%"),64!==this.rowHeight&&(i.height=this.rowHeight+"px"),this.color&&("start"===t||"end"===t||"multiple-selected"===t||"multiple-middle"===t?i.background=this.color:"middle"===t&&(i.color=this.color)),i},genTitle:function(){var t=this.$createElement;if(this.showMonthTitle)return t("div",{class:Ei("month-title")},[this.title])},genMark:function(){var t=this.$createElement;if(this.showMark)return t("div",{class:Ei("month-mark")},[this.date.getMonth()+1])},genDays:function(){var t=this.$createElement;return this.visible?t("div",{ref:"days",attrs:{role:"grid"},class:Ei("days")},[this.genMark(),this.days.map(this.genDay)]):t("div",{ref:"days"})},genDay:function(t,e){var i=this,n=this.$createElement,s=t.type,r=t.topInfo,o=t.bottomInfo,a=this.getDayStyle(s,e),l="disabled"===s,u=function(){l||i.$emit("click",t)},c=r&&n("div",{class:Ei("top-info")},[r]),h=o&&n("div",{class:Ei("bottom-info")},[o]);return"selected"===s?n("div",{attrs:{role:"gridcell",tabindex:-1},style:a,class:[Ei("day"),t.className],on:{click:u}},[n("div",{class:Ei("selected-day"),style:{background:this.color}},[c,t.text,h])]):n("div",{attrs:{role:"gridcell",tabindex:l?null:-1},style:a,class:[Ei("day",s),t.className],on:{click:u}},[c,t.text,h])}},render:function(){var t=arguments[0];return t("div",{class:Ei("month"),ref:"month",style:this.monthStyle},[this.genTitle(),this.genDays()])}}),_i=(0,Object(o.a)("calendar-header")[0])({props:{title:String,subtitle:String,showTitle:Boolean,showSubtitle:Boolean},methods:{genTitle:function(){var t=this.$createElement;if(this.showTitle){var e=this.slots("title")||this.title||Li("title");return t("div",{class:Ei("header-title")},[e])}},genSubtitle:function(){var t=this.$createElement;if(this.showSubtitle)return t("div",{class:Ei("header-subtitle")},[this.subtitle])},genWeekDays:function(){var t=this.$createElement,e=Li("weekdays");return t("div",{class:Ei("weekdays")},[e.map((function(e){return t("span",{class:Ei("weekday")},[e])}))])}},render:function(){var t=arguments[0];return t("div",{class:Ei("header")},[this.genTitle(),this.genSubtitle(),this.genWeekDays()])}}),Hi=Ni({props:{title:String,color:String,value:Boolean,formatter:Function,confirmText:String,rangePrompt:String,defaultDate:[Date,Array],getContainer:[String,Function],allowSameDay:Boolean,closeOnPopstate:Boolean,confirmDisabledText:String,type:{type:String,default:"single"},minDate:{type:Date,validator:ji,default:function(){return new Date}},maxDate:{type:Date,validator:ji,default:function(){var t=new Date;return new Date(t.getFullYear(),t.getMonth()+6,t.getDate())}},position:{type:String,default:"bottom"},rowHeight:{type:[Number,String],default:64},round:{type:Boolean,default:!0},poppable:{type:Boolean,default:!0},showMark:{type:Boolean,default:!0},showTitle:{type:Boolean,default:!0},showConfirm:{type:Boolean,default:!0},showSubtitle:{type:Boolean,default:!0},safeAreaInsetBottom:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0},maxRange:{type:[Number,String],default:null}},data:function(){return{subtitle:"",currentDate:this.getInitialDate()}},computed:{months:function(){var t=[],e=new Date(this.minDate);e.setDate(1);do{t.push(new Date(e)),e.setMonth(e.getMonth()+1)}while(1!==Pi(e,this.maxDate));return t},buttonDisabled:function(){var t=this.type,e=this.currentDate;return"range"===t?!e[0]||!e[1]:"multiple"===t?!e.length:!e}},watch:{type:"reset",value:function(t){t&&(this.initRect(),this.scrollIntoView())},defaultDate:function(t){this.currentDate=t,this.scrollIntoView()}},mounted:function(){!this.value&&this.poppable||(this.initRect(),this.scrollIntoView())},methods:{reset:function(){this.currentDate=this.getInitialDate(),this.scrollIntoView()},initRect:function(){var t=this;this.$nextTick((function(){t.bodyHeight=Math.floor(t.$refs.body.getBoundingClientRect().height),t.onScroll()}))},scrollIntoView:function(){var t=this;this.$nextTick((function(){var e=t.currentDate,i="single"===t.type?e:e[0],n=t.value||!t.poppable;i&&n&&t.months.some((function(e,n){return 0===Pi(e,i)&&(t.$refs.months[n].scrollIntoView(),!0)}))}))},getInitialDate:function(){var t=this.type,e=this.defaultDate,i=this.minDate;if("range"===t){var n=e||[];return[n[0]||i,n[1]||zi(i)]}return"multiple"===t?e||[i]:e||i},onScroll:function(){var t=this.$refs,e=t.body,i=t.months,n=_(e),s=n+this.bodyHeight,r=i.map((function(t){return t.height})),o=r.reduce((function(t,e){return t+e}),0);if(!(n<0||s>o&&n>0)){for(var a,l=0,u=0;u=n;c&&!a&&(a=i[u]),i[u].visible=c,l+=r[u]}a&&(this.subtitle=a.title)}},onClickDay:function(t){var e=t.date,i=this.type,n=this.currentDate;if("range"===i){var s=n[0],r=n[1];if(s&&!r){var o=Ai(e,s);1===o?this.select([s,e],!0):-1===o?this.select([e,null]):this.allowSameDay&&this.select([e,e])}else this.select([e,null])}else if("multiple"===i){var a;this.currentDate.some((function(t,i){var n=0===Ai(t,e);return n&&(a=i),n}))?n.splice(a,1):this.select([].concat(n,[e]))}else this.select(e,!0)},togglePopup:function(t){this.$emit("input",t)},select:function(t,e){if((this.currentDate=t,this.$emit("select",Fi(this.currentDate)),e&&"range"===this.type)&&!this.checkRange())return;e&&!this.showConfirm&&this.onConfirm()},checkRange:function(){var t,e,i=this.maxRange,n=this.currentDate,s=this.rangePrompt;return!(i&&(t=n,e=t[0].getTime(),(t[1].getTime()-e)/864e5+1>i))||(ke(s||Li("rangePrompt",i)),!1)},onConfirm:function(){("range"!==this.type||this.checkRange())&&this.$emit("confirm",Fi(this.currentDate))},genMonth:function(t,e){var i=this.$createElement,n=0!==e||!this.showSubtitle;return i(Ri,{ref:"months",refInFor:!0,attrs:{date:t,type:this.type,color:this.color,minDate:this.minDate,maxDate:this.maxDate,showMark:this.showMark,formatter:this.formatter,rowHeight:this.rowHeight,currentDate:this.currentDate,showSubtitle:this.showSubtitle,allowSameDay:this.allowSameDay,showMonthTitle:n},on:{click:this.onClickDay}})},genFooterContent:function(){var t=this.$createElement,e=this.slots("footer");if(e)return e;if(this.showConfirm){var i=this.buttonDisabled?this.confirmDisabledText:this.confirmText;return t($e,{attrs:{round:!0,block:!0,type:"danger",color:this.color,disabled:this.buttonDisabled,nativeType:"button"},class:Ei("confirm"),on:{click:this.onConfirm}},[i||Li("confirm")])}},genFooter:function(){return(0,this.$createElement)("div",{class:Ei("footer",{"safe-area-inset-bottom":this.safeAreaInsetBottom})},[this.genFooterContent()])},genCalendar:function(){var t=this,e=this.$createElement;return e("div",{class:Ei()},[e(_i,{attrs:{title:this.title,showTitle:this.showTitle,subtitle:this.subtitle,showSubtitle:this.showSubtitle},scopedSlots:{title:function(){return t.slots("title")}}}),e("div",{ref:"body",class:Ei("body"),on:{scroll:this.onScroll}},[this.months.map(this.genMonth)]),this.genFooter()])}},render:function(){var t=this,e=arguments[0];if(this.poppable){var i,n=function(e){return function(){return t.$emit(e)}};return e(pt,{attrs:(i={round:!0,value:this.value},i.round=this.round,i.position=this.position,i.closeable=this.showTitle||this.showSubtitle,i.getContainer=this.getContainer,i.closeOnPopstate=this.closeOnPopstate,i.closeOnClickOverlay=this.closeOnClickOverlay,i),class:Ei("popup"),on:{input:this.togglePopup,open:n("open"),opened:n("opened"),close:n("close"),closed:n("closed")}},[this.genCalendar()])}return this.genCalendar()}}),Wi=Object(o.a)("image"),qi=Wi[0],Yi=Wi[1],Ui=qi({props:{src:String,fit:String,alt:String,round:Boolean,width:[Number,String],height:[Number,String],radius:[Number,String],lazyLoad:Boolean,showError:{type:Boolean,default:!0},showLoading:{type:Boolean,default:!0},errorIcon:{type:String,default:"warning-o"},loadingIcon:{type:String,default:"photo-o"}},data:function(){return{loading:!0,error:!1}},watch:{src:function(){this.loading=!0,this.error=!1}},computed:{style:function(){var t={};return Object(S.b)(this.width)&&(t.width=Object(J.a)(this.width)),Object(S.b)(this.height)&&(t.height=Object(J.a)(this.height)),Object(S.b)(this.radius)&&(t.overflow="hidden",t.borderRadius=Object(J.a)(this.radius)),t}},created:function(){var t=this.$Lazyload;t&&(t.$on("loaded",this.onLazyLoaded),t.$on("error",this.onLazyLoadError))},beforeDestroy:function(){var t=this.$Lazyload;t&&(t.$off("loaded",this.onLazyLoaded),t.$off("error",this.onLazyLoadError))},methods:{onLoad:function(t){this.loading=!1,this.$emit("load",t)},onLazyLoaded:function(t){t.el===this.$refs.image&&this.loading&&this.onLoad()},onLazyLoadError:function(t){t.el!==this.$refs.image||this.error||this.onError()},onError:function(t){this.error=!0,this.loading=!1,this.$emit("error",t)},onClick:function(t){this.$emit("click",t)},genPlaceholder:function(){var t=this.$createElement;return this.loading&&this.showLoading?t("div",{class:Yi("loading")},[this.slots("loading")||t(ct,{attrs:{name:this.loadingIcon},class:Yi("loading-icon")})]):this.error&&this.showError?t("div",{class:Yi("error")},[this.slots("error")||t(ct,{attrs:{name:this.errorIcon},class:Yi("error-icon")})]):void 0},genImage:function(){var t=this.$createElement,e={class:Yi("img"),attrs:{alt:this.alt},style:{objectFit:this.fit}};if(!this.error)return this.lazyLoad?t("img",r()([{ref:"image",directives:[{name:"lazy",value:this.src}]},e])):t("img",r()([{attrs:{src:this.src},on:{load:this.onLoad,error:this.onError}},e]))}},render:function(){var t=arguments[0];return t("div",{class:Yi({round:this.round}),style:this.style,on:{click:this.onClick}},[this.genImage(),this.genPlaceholder()])}}),Ki=Object(o.a)("card"),Xi=Ki[0],Qi=Ki[1];function Gi(t,e,i,n){var s=e.thumb,o=i.num||Object(S.b)(e.num),a=i.price||Object(S.b)(e.price),l=i["origin-price"]||Object(S.b)(e.originPrice),u=o||a||l||i.bottom;function c(t){d(n,"click-thumb",t)}function f(){if(i.tag||e.tag)return t("div",{class:Qi("tag")},[i.tag?i.tag():t(pi,{attrs:{mark:!0,type:"danger"}},[e.tag])])}return t("div",r()([{class:Qi()},h(n,!0)]),[t("div",{class:Qi("header")},[function(){if(i.thumb||s)return t("a",{attrs:{href:e.thumbLink},class:Qi("thumb"),on:{click:c}},[i.thumb?i.thumb():t(Ui,{attrs:{src:s,width:"100%",height:"100%",fit:"cover","lazy-load":e.lazyLoad}}),f()])}(),t("div",{class:Qi("content",{centered:e.centered})},[t("div",[i.title?i.title():e.title?t("div",{class:[Qi("title"),"van-multi-ellipsis--l2"]},[e.title]):void 0,i.desc?i.desc():e.desc?t("div",{class:[Qi("desc"),"van-ellipsis"]},[e.desc]):void 0,null==i.tags?void 0:i.tags()]),u&&t("div",{class:"van-card__bottom"},[null==i["price-top"]?void 0:i["price-top"](),function(){if(a)return t("div",{class:Qi("price")},[i.price?i.price():(n=e.price.toString().split("."),t("div",[t("span",{class:Qi("price-currency")},[e.currency]),t("span",{class:Qi("price-integer")},[n[0]]),".",t("span",{class:Qi("price-decimal")},[n[1]])]))]);var n}(),function(){if(l){var n=i["origin-price"];return t("div",{class:Qi("origin-price")},[n?n():e.currency+" "+e.originPrice])}}(),function(){if(o)return t("div",{class:Qi("num")},[i.num?i.num():"x"+e.num])}(),null==i.bottom?void 0:i.bottom()])])]),function(){if(i.footer)return t("div",{class:Qi("footer")},[i.footer()])}()])}Gi.props={tag:String,desc:String,thumb:String,title:String,centered:Boolean,lazyLoad:Boolean,thumbLink:String,num:[Number,String],price:[Number,String],originPrice:[Number,String],currency:{type:String,default:"¥"}};var Zi=Xi(Gi),Ji=Object(o.a)("cell-group"),tn=Ji[0],en=Ji[1];function nn(t,e,i,n){var s,o=t("div",r()([{class:[en(),(s={},s[b]=e.border,s)]},h(n,!0)]),[null==i.default?void 0:i.default()]);return e.title||i.title?t("div",[t("div",{class:en("title")},[i.title?i.title():e.title]),o]):o}nn.props={title:String,border:{type:Boolean,default:!0}};var sn=tn(nn),rn=Object(o.a)("checkbox"),on=(0,rn[0])({mixins:[mi({bem:rn[1],role:"checkbox",parent:"vanCheckbox"})],computed:{checked:{get:function(){return this.parent?-1!==this.parent.value.indexOf(this.name):this.value},set:function(t){this.parent?this.setParentValue(t):this.$emit("input",t)}}},watch:{value:function(t){this.$emit("change",t)}},methods:{toggle:function(t){var e=this;void 0===t&&(t=!this.checked),clearTimeout(this.toggleTask),this.toggleTask=setTimeout((function(){e.checked=t}))},setParentValue:function(t){var e=this.parent,i=e.value.slice();if(t){if(e.max&&i.length>=e.max)return;-1===i.indexOf(this.name)&&(i.push(this.name),e.$emit("input",i))}else{var n=i.indexOf(this.name);-1!==n&&(i.splice(n,1),e.$emit("input",i))}}}}),an=Object(o.a)("checkbox-group"),ln=an[0],un=an[1],cn=ln({mixins:[ri("vanCheckbox"),_e],props:{max:[Number,String],disabled:Boolean,direction:String,iconSize:[Number,String],checkedColor:String,value:{type:Array,default:function(){return[]}}},watch:{value:function(t){this.$emit("change",t)}},methods:{toggleAll:function(t){if(!1!==t){var e=this.children;t||(e=e.filter((function(t){return!t.checked})));var i=e.map((function(t){return t.name}));this.$emit("input",i)}else this.$emit("input",[])}},render:function(){var t=arguments[0];return t("div",{class:un([this.direction])},[this.slots()])}}),hn=i(4),dn=Object(o.a)("circle"),fn=dn[0],pn=dn[1],mn=0;function vn(t){return Math.min(Math.max(t,0),100)}var gn=fn({props:{text:String,strokeLinecap:String,value:{type:Number,default:0},speed:{type:[Number,String],default:0},size:{type:[Number,String],default:100},fill:{type:String,default:"none"},rate:{type:[Number,String],default:100},layerColor:{type:String,default:"#fff"},color:{type:[String,Object],default:"#1989fa"},strokeWidth:{type:[Number,String],default:40},clockwise:{type:Boolean,default:!0}},beforeCreate:function(){this.uid="van-circle-gradient-"+mn++},computed:{style:function(){var t=Object(J.a)(this.size);return{width:t,height:t}},path:function(){return t=this.clockwise,"M "+(e=this.viewBoxSize)/2+" "+e/2+" m 0, -500 a 500, 500 0 1, "+(i=t?1:0)+" 0, 1000 a 500, 500 0 1, "+i+" 0, -1000";var t,e,i},viewBoxSize:function(){return+this.strokeWidth+1e3},layerStyle:function(){var t=3140*this.value/100;return{stroke:""+this.color,strokeWidth:+this.strokeWidth+1+"px",strokeLinecap:this.strokeLinecap,strokeDasharray:t+"px 3140px"}},hoverStyle:function(){return{fill:""+this.fill,stroke:""+this.layerColor,strokeWidth:this.strokeWidth+"px"}},gradient:function(){return Object(S.d)(this.color)},LinearGradient:function(){var t=this,e=this.$createElement;if(this.gradient){var i=Object.keys(this.color).sort((function(t,e){return parseFloat(t)-parseFloat(e)})).map((function(i,n){return e("stop",{key:n,attrs:{offset:i,"stop-color":t.color[i]}})}));return e("defs",[e("linearGradient",{attrs:{id:this.uid,x1:"100%",y1:"0%",x2:"0%",y2:"0%"}},[i])])}}},watch:{rate:{handler:function(t){this.startTime=Date.now(),this.startRate=this.value,this.endRate=vn(t),this.increase=this.endRate>this.startRate,this.duration=Math.abs(1e3*(this.startRate-this.endRate)/this.speed),this.speed?(Object(hn.a)(this.rafId),this.rafId=Object(hn.c)(this.animate)):this.$emit("input",this.endRate)},immediate:!0}},methods:{animate:function(){var t=Date.now(),e=Math.min((t-this.startTime)/this.duration,1)*(this.endRate-this.startRate)+this.startRate;this.$emit("input",vn(parseFloat(e.toFixed(1)))),(this.increase?ethis.endRate)&&(this.rafId=Object(hn.c)(this.animate))}},render:function(){var t=arguments[0];return t("div",{class:pn(),style:this.style},[t("svg",{attrs:{viewBox:"0 0 "+this.viewBoxSize+" "+this.viewBoxSize}},[this.LinearGradient,t("path",{class:pn("hover"),style:this.hoverStyle,attrs:{d:this.path}}),t("path",{attrs:{d:this.path,stroke:this.gradient?"url(#"+this.uid+")":this.color},class:pn("layer"),style:this.layerStyle})]),this.slots()||this.text&&t("div",{class:pn("text")},[this.text])])}}),bn=Object(o.a)("col"),yn=bn[0],Sn=bn[1],kn=yn({props:{span:[Number,String],offset:[Number,String],tag:{type:String,default:"div"}},computed:{gutter:function(){return this.$parent&&Number(this.$parent.gutter)||0},style:function(){var t=this.gutter/2+"px";return this.gutter?{paddingLeft:t,paddingRight:t}:{}}},methods:{onClick:function(t){this.$emit("click",t)}},render:function(){var t,e=arguments[0],i=this.span,n=this.offset;return e(this.tag,{style:this.style,class:Sn((t={},t[i]=i,t["offset-"+n]=n,t)),on:{click:this.onClick}},[this.slots()])}}),xn=Object(o.a)("collapse"),wn=xn[0],Cn=xn[1],On=wn({mixins:[ri("vanCollapse")],props:{accordion:Boolean,value:[String,Number,Array],border:{type:Boolean,default:!0}},methods:{switch:function(t,e){this.accordion||(t=e?this.value.concat(t):this.value.filter((function(e){return e!==t}))),this.$emit("change",t),this.$emit("input",t)}},render:function(){var t,e=arguments[0];return e("div",{class:[Cn(),(t={},t[b]=this.border,t)]},[this.slots()])}}),Tn=Object(o.a)("collapse-item"),$n=Tn[0],In=Tn[1],Bn=["title","icon","right-icon"],jn=$n({mixins:[si("vanCollapse")],props:n({},Jt,{name:[Number,String],disabled:Boolean,isLink:{type:Boolean,default:!0}}),data:function(){return{show:null,inited:null}},computed:{currentName:function(){return Object(S.b)(this.name)?this.name:this.index},expanded:function(){var t=this;if(!this.parent)return null;var e=this.parent,i=e.value;return e.accordion?i===this.currentName:i.some((function(e){return e===t.currentName}))}},created:function(){this.show=this.expanded,this.inited=this.expanded},watch:{expanded:function(t,e){var i=this;null!==e&&(t&&(this.show=!0,this.inited=!0),(t?this.$nextTick:hn.c)((function(){var e=i.$refs,n=e.content,s=e.wrapper;if(n&&s){var r=n.offsetHeight;if(r){var o=r+"px";s.style.height=t?0:o,Object(hn.b)((function(){s.style.height=t?o:0}))}else i.onTransitionEnd()}})))}},methods:{onClick:function(){if(!this.disabled){var t=this.parent,e=this.currentName,i=t.accordion&&e===t.value?"":e;t.switch(i,!this.expanded)}},onTransitionEnd:function(){this.expanded?this.$refs.wrapper.style.height="":this.show=!1},genTitle:function(){var t=this,e=this.$createElement,i=this.disabled,s=this.expanded,r=Bn.reduce((function(e,i){return t.slots(i)&&(e[i]=function(){return t.slots(i)}),e}),{});return this.slots("value")&&(r.default=function(){return t.slots("value")}),e(se,{attrs:{role:"button",tabindex:i?-1:0,"aria-expanded":String(s)},class:In("title",{disabled:i,expanded:s}),on:{click:this.onClick},scopedSlots:r,props:n({},this.$props)})},genContent:function(){var t=this.$createElement;if(this.inited)return t("div",{directives:[{name:"show",value:this.show}],ref:"wrapper",class:In("wrapper"),on:{transitionend:this.onTransitionEnd}},[t("div",{ref:"content",class:In("content")},[this.slots()])])}},render:function(){var t,e=arguments[0];return e("div",{class:[In(),(t={},t[v]=this.index,t)]},[this.genTitle(),this.genContent()])}}),Dn=Object(o.a)("contact-card"),Nn=Dn[0],En=Dn[1],Ln=Dn[2];function Pn(t,e,i,n){var s=e.type,o=e.editable;return t(se,r()([{attrs:{center:!0,border:!1,isLink:o,valueClass:En("value"),icon:"edit"===s?"contact":"add-square"},class:En([s]),on:{click:function(t){o&&d(n,"click",t)}}},h(n)]),["add"===s?e.addText||Ln("addText"):[t("div",[Ln("name")+":"+e.name]),t("div",[Ln("tel")+":"+e.tel])]])}Pn.props={tel:String,name:String,addText:String,editable:{type:Boolean,default:!0},type:{type:String,default:"add"}};var An=Nn(Pn),Mn=Object(o.a)("contact-edit"),zn=Mn[0],Fn=Mn[1],Vn=Mn[2],Rn={tel:"",name:""},_n=zn({props:{isEdit:Boolean,isSaving:Boolean,isDeleting:Boolean,showSetDefault:Boolean,setDefaultLabel:String,contactInfo:{type:Object,default:function(){return n({},Rn)}},telValidator:{type:Function,default:$t}},data:function(){return{data:n({},Rn,{},this.contactInfo),errorInfo:{name:"",tel:""}}},watch:{contactInfo:function(t){this.data=n({},Rn,{},t)}},methods:{onFocus:function(t){this.errorInfo[t]=""},getErrorMessageByKey:function(t){var e=this.data[t].trim();switch(t){case"name":return e?"":Vn("nameInvalid");case"tel":return this.telValidator(e)?"":Vn("telInvalid")}},onSave:function(){var t=this;["name","tel"].every((function(e){var i=t.getErrorMessageByKey(e);return i&&(t.errorInfo[e]=i),!i}))&&!this.isSaving&&this.$emit("save",this.data)},onDelete:function(){var t=this;Le.confirm({message:Vn("confirmDelete")}).then((function(){t.$emit("delete",t.data)}))}},render:function(){var t=this,e=arguments[0],i=this.data,n=this.errorInfo,s=function(e){return function(){return t.onFocus(e)}};return e("div",{class:Fn()},[e("div",{class:Fn("fields")},[e(le,{attrs:{clearable:!0,maxlength:"30",label:Vn("name"),placeholder:Vn("nameEmpty"),errorMessage:n.name},on:{focus:s("name")},model:{value:i.name,callback:function(e){t.$set(i,"name",e)}}}),e(le,{attrs:{clearable:!0,type:"tel",label:Vn("tel"),placeholder:Vn("telEmpty"),errorMessage:n.tel},on:{focus:s("tel")},model:{value:i.tel,callback:function(e){t.$set(i,"tel",e)}}})]),this.showSetDefault&&e(se,{attrs:{title:this.setDefaultLabel,border:!1},class:Fn("switch-cell")},[e(Ye,{attrs:{size:24},on:{change:function(e){t.$emit("change-default",e)}},model:{value:i.isDefault,callback:function(e){t.$set(i,"isDefault",e)}}})]),e("div",{class:Fn("buttons")},[e($e,{attrs:{block:!0,round:!0,type:"danger",text:Vn("save"),loading:this.isSaving},on:{click:this.onSave}}),this.isEdit&&e($e,{attrs:{block:!0,round:!0,text:Vn("delete"),loading:this.isDeleting},on:{click:this.onDelete}})])])}}),Hn=Object(o.a)("contact-list"),Wn=Hn[0],qn=Hn[1],Yn=Hn[2];function Un(t,e,i,n){var s=e.list&&e.list.map((function(i,s){function r(){d(n,"input",i.id),d(n,"select",i,s)}return t(se,{key:i.id,attrs:{isLink:!0,center:!0,valueClass:qn("item-value")},class:qn("item"),scopedSlots:{icon:function(){return t(ct,{attrs:{name:"edit"},class:qn("edit"),on:{click:function(t){t.stopPropagation(),d(n,"edit",i,s)}}})},default:function(){var n=[i.name+","+i.tel];return i.isDefault&&e.defaultTagText&&n.push(t(pi,{attrs:{type:"danger",round:!0},class:qn("item-tag")},[e.defaultTagText])),n},"right-icon":function(){return t(gi,{attrs:{name:i.id,iconSize:16,checkedColor:p},on:{click:r}})}},on:{click:r}})}));return t("div",r()([{class:qn()},h(n)]),[t(ui,{attrs:{value:e.value},class:qn("group")},[s]),t("div",{class:qn("bottom")},[t($e,{attrs:{round:!0,block:!0,type:"danger",text:e.addText||Yn("addText")},class:qn("add"),on:{click:function(){d(n,"add")}}})])])}Un.props={value:null,list:Array,addText:String,defaultTagText:String};var Kn=Wn(Un),Xn=i(3);var Qn=Object(o.a)("count-down"),Gn=Qn[0],Zn=Qn[1],Jn=Gn({props:{millisecond:Boolean,time:{type:[Number,String],default:0},format:{type:String,default:"HH:mm:ss"},autoStart:{type:Boolean,default:!0}},data:function(){return{remain:0}},computed:{timeData:function(){return t=this.remain,{days:Math.floor(t/864e5),hours:Math.floor(t%864e5/36e5),minutes:Math.floor(t%36e5/6e4),seconds:Math.floor(t%6e4/1e3),milliseconds:Math.floor(t%1e3)};var t},formattedTime:function(){return function(t,e){var i=e.days,n=e.hours,s=e.minutes,r=e.seconds,o=e.milliseconds;if(-1===t.indexOf("DD")?n+=24*i:t=t.replace("DD",Object(Xn.b)(i)),-1===t.indexOf("HH")?s+=60*n:t=t.replace("HH",Object(Xn.b)(n)),-1===t.indexOf("mm")?r+=60*s:t=t.replace("mm",Object(Xn.b)(s)),-1===t.indexOf("ss")?o+=1e3*r:t=t.replace("ss",Object(Xn.b)(r)),-1!==t.indexOf("S")){var a=Object(Xn.b)(o,3);t=-1!==t.indexOf("SSS")?t.replace("SSS",a):-1!==t.indexOf("SS")?t.replace("SS",a.slice(0,2)):t.replace("S",a.charAt(0))}return t}(this.format,this.timeData)}},watch:{time:{immediate:!0,handler:"reset"}},activated:function(){this.keepAlivePaused&&(this.counting=!0,this.keepAlivePaused=!1,this.tick())},deactivated:function(){this.counting&&(this.pause(),this.keepAlivePaused=!0)},beforeDestroy:function(){this.pause()},methods:{start:function(){this.counting||(this.counting=!0,this.endTime=Date.now()+this.remain,this.tick())},pause:function(){this.counting=!1,Object(hn.a)(this.rafId)},reset:function(){this.pause(),this.remain=+this.time,this.autoStart&&this.start()},tick:function(){this.millisecond?this.microTick():this.macroTick()},microTick:function(){var t=this;this.rafId=Object(hn.c)((function(){t.counting&&(t.setRemain(t.getRemain()),t.remain>0&&t.microTick())}))},macroTick:function(){var t=this;this.rafId=Object(hn.c)((function(){if(t.counting){var e,i,n=t.getRemain();e=n,i=t.remain,(Math.floor(e/1e3)!==Math.floor(i/1e3)||0===n)&&t.setRemain(n),t.remain>0&&t.macroTick()}}))},getRemain:function(){return Math.max(this.endTime-Date.now(),0)},setRemain:function(t){this.remain=t,this.$emit("change",this.timeData),0===t&&(this.pause(),this.$emit("finish"))}},render:function(){var t=arguments[0];return t("div",{class:Zn()},[this.slots("default",this.timeData)||this.formattedTime])}}),ts=Object(o.a)("coupon"),es=ts[0],is=ts[1],ns=ts[2];function ss(t){var e=new Date(1e3*t);return e.getFullYear()+"."+Object(Xn.b)(e.getMonth()+1)+"."+Object(Xn.b)(e.getDate())}function rs(t){return(t/100).toFixed(t%100==0?0:t%10==0?1:2)}var os=es({props:{coupon:Object,chosen:Boolean,disabled:Boolean,currency:{type:String,default:"¥"}},computed:{validPeriod:function(){var t=this.coupon,e=t.startAt,i=t.endAt;return ss(e)+" - "+ss(i)},faceAmount:function(){var t,e=this.coupon;if(e.valueDesc)return e.valueDesc+""+(e.unitDesc||"")+"";if(e.denominations){var i=rs(e.denominations);return""+this.currency+" "+i}return e.discount?ns("discount",((t=e.discount)/10).toFixed(t%10==0?0:1)):""},conditionMessage:function(){var t=rs(this.coupon.originCondition);return"0"===t?ns("unlimited"):ns("condition",t)}},render:function(){var t=arguments[0],e=this.coupon,i=this.disabled,n=i&&e.reason||e.description;return t("div",{class:is({disabled:i})},[t("div",{class:is("content")},[t("div",{class:is("head")},[t("h2",{class:is("amount"),domProps:{innerHTML:this.faceAmount}}),t("p",{class:is("condition")},[this.coupon.condition||this.conditionMessage])]),t("div",{class:is("body")},[t("p",{class:is("name")},[e.name]),t("p",{class:is("valid")},[this.validPeriod]),!this.disabled&&t(on,{attrs:{size:18,value:this.chosen,checkedColor:p},class:is("corner")})])]),n&&t("p",{class:is("description")},[n])])}}),as=Object(o.a)("coupon-cell"),ls=as[0],us=as[1],cs=as[2];function hs(t,e,i,n){var s=e.coupons[+e.chosenCoupon]?"van-coupon-cell--selected":"",o=function(t){var e=t.coupons,i=t.chosenCoupon,n=t.currency,s=e[+i];return s?"-"+n+((s.value||s.denominations||0)/100).toFixed(2):0===e.length?cs("tips"):cs("count",e.length)}(e);return t(se,r()([{class:us(),attrs:{value:o,title:e.title||cs("title"),border:e.border,isLink:e.editable,valueClass:s}},h(n,!0)]))}hs.model={prop:"chosenCoupon"},hs.props={title:String,coupons:{type:Array,default:function(){return[]}},currency:{type:String,default:"¥"},border:{type:Boolean,default:!0},editable:{type:Boolean,default:!0},chosenCoupon:{type:[Number,String],default:-1}};var ds,fs=ls(hs),ps=Object(o.a)("tab"),ms=ps[0],vs=ps[1],gs=ms({mixins:[si("vanTabs")],props:n({},Zt,{dot:Boolean,name:[Number,String],info:[Number,String],badge:[Number,String],title:String,titleStyle:null,disabled:Boolean}),data:function(){return{inited:!1}},computed:{computedName:function(){return Object(S.b)(this.name)?this.name:this.index},isActive:function(){return this.computedName===this.parent.currentName}},watch:{"parent.currentIndex":function(){this.inited=this.inited||this.isActive},title:function(){this.parent.setLine()},inited:function(t){var e=this;this.parent.lazyRender&&t&&this.$nextTick((function(){e.parent.$emit("rendered",e.computedName,e.title)}))}},render:function(t){var e=this.slots,i=this.parent,n=this.isActive,s=this.inited||i.scrollspy||!i.lazyRender,r=i.scrollspy||n,o=s?e():t();return i.animated?t("div",{attrs:{role:"tabpanel","aria-hidden":!n},class:vs("pane-wrapper",{inactive:!n})},[t("div",{class:vs("pane")},[o])]):t("div",{directives:[{name:"show",value:r}],attrs:{role:"tabpanel"},class:vs("pane")},[o])}});function bs(t){var e=window.getComputedStyle(t),i="none"===e.display,n=null===t.offsetParent&&"fixed"!==e.position;return i||n}var ys=Object(o.a)("tab"),Ss=ys[0],ks=ys[1],xs=Ss({props:{dot:Boolean,type:String,info:[Number,String],color:String,title:String,isActive:Boolean,ellipsis:Boolean,disabled:Boolean,scrollable:Boolean,activeColor:String,inactiveColor:String,swipeThreshold:[Number,String]},computed:{style:function(){var t={},e=this.color,i=this.isActive,n="card"===this.type;e&&n&&(t.borderColor=e,this.disabled||(i?t.backgroundColor=e:t.color=e));var s=i?this.activeColor:this.inactiveColor;return s&&(t.color=s),this.scrollable&&this.ellipsis&&(t.flexBasis=88/this.swipeThreshold+"%"),t}},methods:{onClick:function(){this.$emit("click")}},render:function(){var t=arguments[0];return t("div",{attrs:{role:"tab","aria-selected":this.isActive},class:[ks({active:this.isActive,disabled:this.disabled,complete:!this.ellipsis}),{"van-ellipsis":this.ellipsis}],style:this.style,on:{click:this.onClick}},[t("span",{class:ks("text")},[this.slots()||this.title,t(st,{attrs:{dot:this.dot,info:this.info}})])])}}),ws=Object(o.a)("sticky"),Cs=ws[0],Os=ws[1],Ts=Cs({mixins:[X((function(t,e){if(this.scroller||(this.scroller=R(this.$el)),this.observer){var i=e?"observe":"unobserve";this.observer[i](this.$el)}t(this.scroller,"scroll",this.onScroll,!0),this.onScroll()}))],props:{zIndex:[Number,String],container:null,offsetTop:{type:[Number,String],default:0}},data:function(){return{fixed:!1,height:0,transform:0}},computed:{style:function(){if(this.fixed){var t={};return Object(S.b)(this.zIndex)&&(t.zIndex=this.zIndex),this.offsetTop&&this.fixed&&(t.top=this.offsetTop+"px"),this.transform&&(t.transform="translate3d(0, "+this.transform+"px, 0)"),t}}},created:function(){var t=this;!S.f&&window.IntersectionObserver&&(this.observer=new IntersectionObserver((function(e){e[0].intersectionRatio>0&&t.onScroll()}),{root:document.body}))},methods:{onScroll:function(){var t=this;if(!bs(this.$el)){this.height=this.$el.offsetHeight;var e=this.container,i=+this.offsetTop,n=_(window),s=Y(this.$el),r=function(){t.$emit("scroll",{scrollTop:n,isFixed:t.fixed})};if(e){var o=s+e.offsetHeight;if(n+i+this.height>o){var a=this.height+n-o;return as?(this.fixed=!0,this.transform=0):this.fixed=!1,r()}}},render:function(){var t=arguments[0],e=this.fixed,i={height:e?this.height+"px":null};return t("div",{style:i},[t("div",{class:Os({fixed:e}),style:this.style},[this.slots()])])}}),$s=Object(o.a)("tabs"),Is=$s[0],Bs=$s[1],js=Is({mixins:[U],props:{count:Number,duration:[Number,String],animated:Boolean,swipeable:Boolean,currentIndex:Number},computed:{style:function(){if(this.animated)return{transform:"translate3d("+-1*this.currentIndex*100+"%, 0, 0)",transitionDuration:this.duration+"s"}},listeners:function(){if(this.swipeable)return{touchstart:this.touchStart,touchmove:this.touchMove,touchend:this.onTouchEnd,touchcancel:this.onTouchEnd}}},methods:{onTouchEnd:function(){var t=this.direction,e=this.deltaX,i=this.currentIndex;"horizontal"===t&&this.offsetX>=50&&(e>0&&0!==i?this.$emit("change",i-1):e<0&&i!==this.count-1&&this.$emit("change",i+1))},genChildren:function(){var t=this.$createElement;return this.animated?t("div",{class:Bs("track"),style:this.style},[this.slots()]):this.slots()}},render:function(){var t=arguments[0];return t("div",{class:Bs("content",{animated:this.animated}),on:n({},this.listeners)},[this.genChildren()])}}),Ds=Object(o.a)("tabs"),Ns=Ds[0],Es=Ds[1],Ls=Ns({mixins:[ri("vanTabs"),X((function(t){this.scroller||(this.scroller=R(this.$el)),t(window,"resize",this.resize,!0),this.scrollspy&&t(this.scroller,"scroll",this.onScroll,!0)}))],model:{prop:"active"},props:{color:String,sticky:Boolean,animated:Boolean,swipeable:Boolean,scrollspy:Boolean,background:String,lineWidth:[Number,String],lineHeight:[Number,String],titleActiveColor:String,titleInactiveColor:String,type:{type:String,default:"line"},active:{type:[Number,String],default:0},border:{type:Boolean,default:!0},ellipsis:{type:Boolean,default:!0},duration:{type:[Number,String],default:.3},offsetTop:{type:[Number,String],default:0},lazyRender:{type:Boolean,default:!0},swipeThreshold:{type:[Number,String],default:4}},data:function(){return{position:"",currentIndex:null,lineStyle:{backgroundColor:this.color}}},computed:{scrollable:function(){return this.children.length>this.swipeThreshold||!this.ellipsis},navStyle:function(){return{borderColor:this.color,background:this.background}},currentName:function(){var t=this.children[this.currentIndex];if(t)return t.computedName},scrollOffset:function(){return this.sticky?+this.offsetTop+this.tabHeight:0}},watch:{color:"setLine",active:function(t){t!==this.currentName&&this.setCurrentIndexByName(t)},children:function(){var t=this;this.setCurrentIndexByName(this.currentName||this.active),this.setLine(),this.$nextTick((function(){t.scrollIntoView(!0)}))},currentIndex:function(){this.scrollIntoView(),this.setLine(),this.stickyFixed&&!this.scrollspy&&q(Math.ceil(Y(this.$el)-this.offsetTop))},scrollspy:function(t){t?w(this.scroller,"scroll",this.onScroll,!0):C(this.scroller,"scroll",this.onScroll)}},mounted:function(){this.onShow()},activated:function(){this.onShow(),this.setLine()},methods:{resize:function(){this.setLine()},onShow:function(){var t=this;this.$nextTick((function(){var e;t.inited=!0,t.tabHeight=F(e=t.$refs.wrap)?e.innerHeight:e.getBoundingClientRect().height,t.scrollIntoView(!0)}))},setLine:function(){var t=this,e=this.inited;this.$nextTick((function(){var i=t.$refs.titles;if(i&&i[t.currentIndex]&&"line"===t.type&&!bs(t.$el)){var n=i[t.currentIndex].$el,s=t.lineWidth,r=t.lineHeight,o=Object(S.b)(s)?s:n.offsetWidth/2,a=n.offsetLeft+n.offsetWidth/2,l={width:Object(J.a)(o),backgroundColor:t.color,transform:"translateX("+a+"px) translateX(-50%)"};if(e&&(l.transitionDuration=t.duration+"s"),Object(S.b)(r)){var u=Object(J.a)(r);l.height=u,l.borderRadius=u}t.lineStyle=l}}))},setCurrentIndexByName:function(t){var e=this.children.filter((function(e){return e.computedName===t})),i=(this.children[0]||{}).index||0;this.setCurrentIndex(e.length?e[0].index:i)},setCurrentIndex:function(t){if(t=this.findAvailableTab(t),Object(S.b)(t)&&t!==this.currentIndex){var e=null!==this.currentIndex;this.currentIndex=t,this.$emit("input",this.currentName),e&&this.$emit("change",this.currentName,this.children[t].title)}},findAvailableTab:function(t){for(var e=t=0&&te||!r&&se?Object(hn.c)(i):n&&Object(hn.c)(n)}()}(this.scroller,n,+this.duration,(function(){t.lockScroll=!1}))}}},onScroll:function(){if(this.scrollspy&&!this.lockScroll){var t=this.getCurrentIndexOnScroll();this.setCurrentIndex(t)}},getCurrentIndexOnScroll:function(){for(var t,e=this.children,i=0;ithis.scrollOffset)return 0===i?0:i-1}return e.length-1}},render:function(){var t,e=this,i=arguments[0],n=this.type,s=this.ellipsis,r=this.animated,o=this.scrollable,a=this.children.map((function(t,r){return i(xs,{ref:"titles",refInFor:!0,attrs:{type:n,dot:t.dot,info:Object(S.b)(t.badge)?t.badge:t.info,title:t.title,color:e.color,isActive:r===e.currentIndex,ellipsis:s,disabled:t.disabled,scrollable:o,activeColor:e.titleActiveColor,inactiveColor:e.titleInactiveColor,swipeThreshold:e.swipeThreshold},style:t.titleStyle,scopedSlots:{default:function(){return t.slots("title")}},on:{click:function(){e.onClick(r),Qt(t.$router,t)}}})})),l=i("div",{ref:"wrap",class:[Es("wrap",{scrollable:o}),(t={},t[b]="line"===n&&this.border,t)]},[i("div",{ref:"nav",attrs:{role:"tablist"},class:Es("nav",[n]),style:this.navStyle},[this.slots("nav-left"),a,"line"===n&&i("div",{class:Es("line"),style:this.lineStyle}),this.slots("nav-right")])]);return i("div",{class:Es([n])},[this.sticky?i(Ts,{attrs:{container:this.$el,offsetTop:this.offsetTop},on:{scroll:this.onSticktScroll}},[l]):l,i(js,{attrs:{count:this.children.length,animated:r,duration:this.duration,swipeable:this.swipeable,currentIndex:this.currentIndex},on:{change:this.setCurrentIndex}},[this.slots()])])}}),Ps=Object(o.a)("coupon-list"),As=Ps[0],Ms=Ps[1],zs=Ps[2],Fs=As({model:{prop:"code"},props:{code:String,closeButtonText:String,inputPlaceholder:String,enabledTitle:String,disabledTitle:String,exchangeButtonText:String,exchangeButtonLoading:Boolean,exchangeButtonDisabled:Boolean,exchangeMinLength:{type:Number,default:1},chosenCoupon:{type:Number,default:-1},coupons:{type:Array,default:function(){return[]}},disabledCoupons:{type:Array,default:function(){return[]}},displayedCouponIndex:{type:Number,default:-1},showExchangeBar:{type:Boolean,default:!0},showCloseButton:{type:Boolean,default:!0},showCount:{type:Boolean,default:!0},currency:{type:String,default:"¥"},emptyImage:{type:String,default:"https://img.yzcdn.cn/vant/coupon-empty.png"}},data:function(){return{tab:0,winHeight:window.innerHeight,currentCode:this.code||""}},computed:{buttonDisabled:function(){return!this.exchangeButtonLoading&&(this.exchangeButtonDisabled||!this.currentCode||this.currentCode.length1))return 0;t=t.slice(1)}return parseInt(t,10)}(e.originColumns[t].values[i[t]])},s=n(0),r=n(1),o=Vi(s,r);t=(t="year-month"===this.type?1:n(2))>o?o:t;var a=0,l=0;"datetime"===this.type&&(a=n(3),l=n(4));var u=new Date(s,r-1,t,a,l);this.innerValue=this.formatValue(u)},onChange:function(t){var e=this;this.updateInnerValue(),this.$nextTick((function(){e.$nextTick((function(){e.$emit("change",t)}))}))},updateColumnValue:function(){var t=this,e=this.innerValue,i=this.formatter,n=[i("year",""+e.getFullYear()),i("month",Object(Xn.b)(e.getMonth()+1)),i("day",Object(Xn.b)(e.getDate()))];"datetime"===this.type&&n.push(i("hour",Object(Xn.b)(e.getHours())),i("minute",Object(Xn.b)(e.getMinutes()))),"year-month"===this.type&&(n=n.slice(0,2)),this.$nextTick((function(){t.getPicker().setValues(n)}))}}}),qs=Object(o.a)("datetime-picker"),Ys=qs[0],Us=qs[1],Ks=Ys({props:n({},_s.props,{},Ws.props),methods:{getPicker:function(){return this.$refs.root.getPicker()}},render:function(){var t=arguments[0],e="time"===this.type?_s:Ws;return t(e,{ref:"root",class:Us(),props:n({},this.$props),on:n({},this.$listeners)})}}),Xs=Object(o.a)("divider"),Qs=Xs[0],Gs=Xs[1];function Zs(t,e,i,n){var s;return t("div",r()([{attrs:{role:"separator"},style:{borderColor:e.borderColor},class:Gs((s={dashed:e.dashed,hairline:e.hairline},s["content-"+e.contentPosition]=i.default,s))},h(n,!0)]),[i.default&&i.default()])}Zs.props={dashed:Boolean,hairline:{type:Boolean,default:!0},contentPosition:{type:String,default:"center"}};var Js=Qs(Zs),tr=Object(o.a)("dropdown-item"),er=tr[0],ir=tr[1],nr=er({mixins:[K({ref:"wrapper"}),si("vanDropdownMenu")],props:{value:null,title:String,disabled:Boolean,titleClass:String,options:{type:Array,default:function(){return[]}}},data:function(){return{transition:!0,showPopup:!1,showWrapper:!1}},computed:{displayTitle:function(){var t=this;if(this.title)return this.title;var e=this.options.filter((function(e){return e.value===t.value}));return e.length?e[0].text:""}},watch:{showPopup:function(t){this.bindScroll(t)}},beforeCreate:function(){var t=this,e=function(e){return function(){return t.$emit(e)}};this.onOpen=e("open"),this.onClose=e("close"),this.onOpened=e("opened")},methods:{toggle:function(t,e){void 0===t&&(t=!this.showPopup),void 0===e&&(e={}),t!==this.showPopup&&(this.transition=!e.immediate,this.showPopup=t,t&&(this.parent.updateOffset(),this.showWrapper=!0))},bindScroll:function(t){(t?w:C)(this.parent.scroller,"scroll",this.onScroll,!0)},onScroll:function(){this.parent.updateOffset()},onClickWrapper:function(t){this.getContainer&&t.stopPropagation()}},render:function(){var t=this,e=arguments[0],i=this.parent,n=i.zIndex,s=i.offset,r=i.overlay,o=i.duration,a=i.direction,l=i.activeColor,u=i.closeOnClickOverlay,c=this.options.map((function(i){var n=i.value===t.value;return e(se,{attrs:{clickable:!0,icon:i.icon,title:i.text},key:i.value,class:ir("option",{active:n}),style:{color:n?l:""},on:{click:function(){t.showPopup=!1,i.value!==t.value&&(t.$emit("input",i.value),t.$emit("change",i.value))}}},[n&&e(ct,{class:ir("icon"),attrs:{color:l,name:"success"}})])})),h={zIndex:n};return"down"===a?h.top=s+"px":h.bottom=s+"px",e("div",[e("div",{directives:[{name:"show",value:this.showWrapper}],ref:"wrapper",style:h,class:ir([a]),on:{click:this.onClickWrapper}},[e(pt,{attrs:{overlay:r,position:"down"===a?"top":"bottom",duration:this.transition?o:0,closeOnClickOverlay:u,overlayStyle:{position:"absolute"}},class:ir("content"),on:{open:this.onOpen,close:this.onClose,opened:this.onOpened,closed:function(){t.showWrapper=!1,t.$emit("closed")}},model:{value:t.showPopup,callback:function(e){t.showPopup=e}}},[c,this.slots("default")])])])}}),sr=function(t){return l.a.extend({props:{closeOnClickOutside:{type:Boolean,default:!0}},data:function(){var e=this;return{clickOutsideHandler:function(i){e.closeOnClickOutside&&!e.$el.contains(i.target)&&e[t.method]()}}},mounted:function(){w(document,t.event,this.clickOutsideHandler)},beforeDestroy:function(){C(document,t.event,this.clickOutsideHandler)}})},rr=Object(o.a)("dropdown-menu"),or=rr[0],ar=rr[1],lr=or({mixins:[ri("vanDropdownMenu"),sr({event:"click",method:"onClickOutside"})],props:{zIndex:[Number,String],activeColor:String,overlay:{type:Boolean,default:!0},duration:{type:[Number,String],default:.2},direction:{type:String,default:"down"},closeOnClickOverlay:{type:Boolean,default:!0}},data:function(){return{offset:0}},computed:{scroller:function(){return R(this.$el)}},methods:{updateOffset:function(){if(this.$refs.menu){var t=this.$refs.menu.getBoundingClientRect();"down"===this.direction?this.offset=t.bottom:this.offset=window.innerHeight-t.top}},toggleItem:function(t){this.children.forEach((function(e,i){i===t?e.toggle():e.showPopup&&e.toggle(!1,{immediate:!0})}))},onClickOutside:function(){this.children.forEach((function(t){t.toggle(!1)}))}},render:function(){var t=this,e=arguments[0],i=this.children.map((function(i,n){return e("div",{attrs:{role:"button",tabindex:i.disabled?-1:0},class:ar("item",{disabled:i.disabled}),on:{click:function(){i.disabled||t.toggleItem(n)}}},[e("span",{class:[ar("title",{active:i.showPopup,down:i.showPopup===("down"===t.direction)}),i.titleClass],style:{color:i.showPopup?t.activeColor:""}},[e("div",{class:"van-ellipsis"},[i.slots("title")||i.displayTitle])])])}));return e("div",{ref:"menu",class:[ar(),b]},[i,this.slots("default")])}}),ur=Object(o.a)("form"),cr=ur[0],hr=ur[1],dr=cr({props:{colon:Boolean,labelWidth:[Number,String],labelAlign:String,inputAlign:String,scrollToError:Boolean,validateFirst:Boolean,errorMessageAlign:String,validateTrigger:{type:String,default:"onBlur"},showErrorMessage:{type:Boolean,default:!0}},provide:function(){return{vanForm:this}},data:function(){return{fields:[]}},methods:{validateSeq:function(){var t=this;return new Promise((function(e,i){var n=[];t.fields.reduce((function(t,e){return t.then((function(){if(!n.length)return e.validate().then((function(t){t&&n.push(t)}))}))}),Promise.resolve()).then((function(){n.length?i(n):e()}))}))},validateAll:function(){var t=this;return new Promise((function(e,i){Promise.all(t.fields.map((function(t){return t.validate()}))).then((function(t){(t=t.filter((function(t){return t}))).length?i(t):e()}))}))},validate:function(t){return t?this.validateField(t):this.validateFirst?this.validateSeq():this.validateAll()},validateField:function(t){var e=this.fields.filter((function(e){return e.name===t}));return e.length?new Promise((function(t,i){e[0].validate().then((function(e){e?i(e):t()}))})):Promise.reject()},resetValidation:function(t){this.fields.forEach((function(e){t&&e.name!==t||e.resetValidation()}))},scrollToField:function(t){this.fields.forEach((function(e){e.name===t&&e.$el.scrollIntoView()}))},getValues:function(){return this.fields.reduce((function(t,e){return t[e.name]=e.formValue,t}),{})},onSubmit:function(t){t.preventDefault(),this.submit()},submit:function(){var t=this,e=this.getValues();this.validate().then((function(){t.$emit("submit",e)})).catch((function(i){t.$emit("failed",{values:e,errors:i}),t.scrollToError&&t.scrollToField(i[0].name)}))}},render:function(){var t=arguments[0];return t("form",{class:hr(),on:{submit:this.onSubmit}},[this.slots()])}}),fr=Object(o.a)("goods-action"),pr=fr[0],mr=fr[1],vr=pr({mixins:[ri("vanGoodsAction")],props:{safeAreaInsetBottom:Boolean},render:function(){var t=arguments[0];return t("div",{class:mr({"safe-area-inset-bottom":this.safeAreaInsetBottom})},[this.slots()])}}),gr=Object(o.a)("goods-action-button"),br=gr[0],yr=gr[1],Sr=br({mixins:[si("vanGoodsAction")],props:n({},Zt,{type:String,text:String,icon:String,color:String,loading:Boolean,disabled:Boolean}),computed:{isFirst:function(){var t=this.parent&&this.parent.children[this.index-1];return!t||t.$options.name!==this.$options.name},isLast:function(){var t=this.parent&&this.parent.children[this.index+1];return!t||t.$options.name!==this.$options.name}},methods:{onClick:function(t){this.$emit("click",t),Qt(this.$router,this)}},render:function(){var t=arguments[0];return t($e,{class:yr([{first:this.isFirst,last:this.isLast},this.type]),attrs:{square:!0,size:"large",type:this.type,icon:this.icon,color:this.color,loading:this.loading,disabled:this.disabled},on:{click:this.onClick}},[this.slots()||this.text])}}),kr=Object(o.a)("goods-action-icon"),xr=kr[0],wr=kr[1],Cr=xr({mixins:[si("vanGoodsAction")],props:n({},Zt,{dot:Boolean,text:String,icon:String,color:String,info:[Number,String],badge:[Number,String],iconClass:null}),methods:{onClick:function(t){this.$emit("click",t),Qt(this.$router,this)},genIcon:function(){var t=this.$createElement,e=this.slots("icon"),i=Object(S.b)(this.badge)?this.badge:this.info;return e?t("div",{class:wr("icon")},[e,t(st,{attrs:{dot:this.dot,info:i}})]):t(ct,{class:[wr("icon"),this.iconClass],attrs:{tag:"div",dot:this.dot,info:i,name:this.icon,color:this.color}})}},render:function(){var t=arguments[0];return t("div",{attrs:{role:"button",tabindex:"0"},class:wr(),on:{click:this.onClick}},[this.genIcon(),this.slots()||this.text])}}),Or=Object(o.a)("grid"),Tr=Or[0],$r=Or[1],Ir=Tr({mixins:[ri("vanGrid")],props:{square:Boolean,gutter:[Number,String],iconSize:[Number,String],clickable:Boolean,columnNum:{type:[Number,String],default:4},center:{type:Boolean,default:!0},border:{type:Boolean,default:!0}},computed:{style:function(){var t=this.gutter;if(t)return{paddingLeft:Object(J.a)(t)}}},render:function(){var t,e=arguments[0];return e("div",{style:this.style,class:[$r(),(t={},t[v]=this.border&&!this.gutter,t)]},[this.slots()])}}),Br=Object(o.a)("grid-item"),jr=Br[0],Dr=Br[1],Nr=jr({mixins:[si("vanGrid")],props:n({},Zt,{dot:Boolean,text:String,icon:String,iconPrefix:String,info:[Number,String],badge:[Number,String]}),computed:{style:function(){var t=this.parent,e=t.square,i=t.gutter,n=t.columnNum,s=100/n+"%",r={flexBasis:s};if(e)r.paddingTop=s;else if(i){var o=Object(J.a)(i);r.paddingRight=o,this.index>=n&&(r.marginTop=o)}return r},contentStyle:function(){var t=this.parent,e=t.square,i=t.gutter;if(e&&i){var n=Object(J.a)(i);return{right:n,bottom:n,height:"auto"}}}},methods:{onClick:function(t){this.$emit("click",t),Qt(this.$router,this)},genIcon:function(){var t=this.$createElement,e=this.slots("icon"),i=Object(S.b)(this.badge)?this.badge:this.info;return e?t("div",{class:Dr("icon-wrapper")},[e,t(st,{attrs:{dot:this.dot,info:i}})]):this.icon?t(ct,{attrs:{name:this.icon,dot:this.dot,info:i,size:this.parent.iconSize,classPrefix:this.iconPrefix},class:Dr("icon")}):void 0},getText:function(){var t=this.$createElement,e=this.slots("text");return e||(this.text?t("span",{class:Dr("text")},[this.text]):void 0)},genContent:function(){var t=this.slots();return t||[this.genIcon(),this.getText()]}},render:function(){var t,e=arguments[0],i=this.parent,n=i.center,s=i.border,r=i.square,o=i.gutter,a=i.clickable;return e("div",{class:[Dr({square:r})],style:this.style},[e("div",{style:this.contentStyle,attrs:{role:a?"button":null,tabindex:a?0:null},class:[Dr("content",{center:n,square:r,clickable:a,surround:s&&o}),(t={},t[m]=s,t)],on:{click:this.onClick}},[this.genContent()])])}}),Er=Object(o.a)("swipe"),Lr=Er[0],Pr=Er[1],Ar=Lr({mixins:[U,ri("vanSwipe"),X((function(t,e){t(window,"resize",this.resize,!0),t(window,"visibilitychange",this.onVisibilityChange),e?this.initialize():this.clear()}))],props:{width:[Number,String],height:[Number,String],autoplay:[Number,String],vertical:Boolean,lazyRender:Boolean,indicatorColor:String,loop:{type:Boolean,default:!0},duration:{type:[Number,String],default:500},touchable:{type:Boolean,default:!0},initialSwipe:{type:[Number,String],default:0},showIndicators:{type:Boolean,default:!0},stopPropagation:{type:Boolean,default:!0}},data:function(){return{rect:null,offset:0,active:0,deltaX:0,deltaY:0,swiping:!1,computedWidth:0,computedHeight:0}},watch:{children:function(){this.initialize()},initialSwipe:function(){this.initialize()},autoplay:function(t){t>0?this.autoPlay():this.clear()}},computed:{count:function(){return this.children.length},delta:function(){return this.vertical?this.deltaY:this.deltaX},size:function(){return this[this.vertical?"computedHeight":"computedWidth"]},trackSize:function(){return this.count*this.size},activeIndicator:function(){return(this.active+this.count)%this.count},isCorrectDirection:function(){var t=this.vertical?"vertical":"horizontal";return this.direction===t},trackStyle:function(){var t,e=this.vertical?"height":"width",i=this.vertical?"width":"height";return(t={})[e]=this.trackSize+"px",t[i]=this[i]?this[i]+"px":"",t.transitionDuration=(this.swiping?0:this.duration)+"ms",t.transform="translate"+(this.vertical?"Y":"X")+"("+this.offset+"px)",t},indicatorStyle:function(){return{backgroundColor:this.indicatorColor}},minOffset:function(){return(this.vertical?this.rect.height:this.rect.width)-this.size*this.count}},mounted:function(){this.initRect(),this.bindTouchEvent(this.$refs.track)},methods:{initRect:function(){this.rect=this.$el.getBoundingClientRect()},initialize:function(t){if(void 0===t&&(t=+this.initialSwipe),this.rect){if(clearTimeout(this.timer),this.$el&&!bs(this.$el)){var e=this.rect;this.computedWidth=Math.round(+this.width||e.width),this.computedHeight=Math.round(+this.height||e.height)}this.swiping=!0,this.active=t,this.offset=this.getTargetOffset(t),this.children.forEach((function(t){t.offset=0})),this.autoPlay()}},resize:function(){this.initRect(),this.initialize(this.activeIndicator)},onVisibilityChange:function(){document.hidden?this.clear():this.autoPlay()},onTouchStart:function(t){this.touchable&&(this.clear(),this.touchStart(t),this.correctPosition())},onTouchMove:function(t){this.touchable&&this.swiping&&(this.touchMove(t),this.isCorrectDirection&&(T(t,this.stopPropagation),this.move({offset:this.delta})))},onTouchEnd:function(){if(this.touchable&&this.swiping){if(this.delta&&this.isCorrectDirection){var t=this.vertical?this.offsetY:this.offsetX;this.move({pace:t>0?this.delta>0?-1:1:0,emitChange:!0})}this.swiping=!1,this.autoPlay()}},getTargetActive:function(t){var e=this.active,i=this.count;return t?this.loop?Dt(e+t,-1,i):Dt(e+t,0,i-1):e},getTargetOffset:function(t,e){void 0===e&&(e=0);var i=t*this.size;this.loop||(i=Math.min(i,-this.minOffset));var n=Math.round(e-i);return this.loop||(n=Dt(n,this.minOffset,0)),n},move:function(t){var e=t.pace,i=void 0===e?0:e,n=t.offset,s=void 0===n?0:n,r=t.emitChange,o=this.loop,a=this.count,l=this.active,u=this.children,c=this.trackSize,h=this.minOffset;if(!(a<=1)){var d=this.getTargetActive(i),f=this.getTargetOffset(d,s);if(o){if(u[0]){var p=f0;u[a-1].offset=m?-c:0}}this.active=d,this.offset=f,r&&d!==l&&this.$emit("change",this.activeIndicator)}},prev:function(){var t=this;this.correctPosition(),this.resetTouchStatus(),Object(hn.b)((function(){t.swiping=!1,t.move({pace:-1,emitChange:!0})}))},next:function(){var t=this;this.correctPosition(),this.resetTouchStatus(),Object(hn.b)((function(){t.swiping=!1,t.move({pace:1,emitChange:!0})}))},swipeTo:function(t,e){var i=this;void 0===e&&(e={}),this.correctPosition(),this.resetTouchStatus(),Object(hn.b)((function(){var n;n=i.loop&&t===i.count?0===i.active?0:t:t%i.count,e.immediate?Object(hn.b)((function(){i.swiping=!1})):i.swiping=!1,i.move({pace:n-i.active,emitChange:!0})}))},correctPosition:function(){this.swiping=!0,this.active<=-1&&this.move({pace:this.count}),this.active>=this.count&&this.move({pace:-this.count})},clear:function(){clearTimeout(this.timer)},autoPlay:function(){var t=this,e=this.autoplay;e>0&&this.count>1&&(this.clear(),this.timer=setTimeout((function(){t.next(),t.autoPlay()}),e))},genIndicator:function(){var t=this,e=this.$createElement,i=this.count,n=this.activeIndicator,s=this.slots("indicator");return s||(this.showIndicators&&i>1?e("div",{class:Pr("indicators",{vertical:this.vertical})},[Array.apply(void 0,Array(i)).map((function(i,s){return e("i",{class:Pr("indicator",{active:s===n}),style:s===n?t.indicatorStyle:null})}))]):void 0)}},render:function(){var t=arguments[0];return t("div",{class:Pr()},[t("div",{ref:"track",style:this.trackStyle,class:Pr("track",{vertical:this.vertical})},[this.slots()]),this.genIndicator()])}}),Mr=Object(o.a)("swipe-item"),zr=Mr[0],Fr=Mr[1],Vr=zr({mixins:[si("vanSwipe")],data:function(){return{offset:0,mounted:!1}},mounted:function(){var t=this;this.$nextTick((function(){t.mounted=!0}))},computed:{style:function(){var t={},e=this.parent,i=e.size,n=e.vertical;return t[n?"height":"width"]=i+"px",this.offset&&(t.transform="translate"+(n?"Y":"X")+"("+this.offset+"px)"),t},shouldRender:function(){var t=this.index,e=this.parent,i=this.mounted;if(!e.lazyRender)return!0;if(!i)return!1;var n=e.activeIndicator,s=e.count-1;return t===n||t===(0===n?s:n-1)||t===(n===s?0:n+1)}},render:function(){var t=arguments[0];return t("div",{class:Fr(),style:this.style,on:n({},this.$listeners)},[this.shouldRender&&this.slots()])}}),Rr=Object(o.a)("image-preview"),_r=Rr[0],Hr=Rr[1];function Wr(t){return Math.sqrt(Math.pow(t[0].clientX-t[1].clientX,2)+Math.pow(t[0].clientY-t[1].clientY,2))}var qr,Yr=_r({mixins:[Z({skipToggleEvent:!0}),U],props:{className:null,asyncClose:Boolean,showIndicators:Boolean,images:{type:Array,default:function(){return[]}},loop:{type:Boolean,default:!0},swipeDuration:{type:[Number,String],default:500},overlay:{type:Boolean,default:!0},showIndex:{type:Boolean,default:!0},startPosition:{type:[Number,String],default:0},minZoom:{type:[Number,String],default:1/3},maxZoom:{type:[Number,String],default:3},overlayClass:{type:String,default:Hr("overlay")},closeable:Boolean,closeIcon:{type:String,default:"clear"},closeIconPosition:{type:String,default:"top-right"}},data:function(){return{scale:1,moveX:0,moveY:0,active:0,moving:!1,zooming:!1,doubleClickTimer:null}},computed:{imageStyle:function(){var t=this.scale,e={transitionDuration:this.zooming||this.moving?"0s":".3s"};return 1!==t&&(e.transform="scale3d("+t+", "+t+", 1) translate("+this.moveX/t+"px, "+this.moveY/t+"px)"),e}},watch:{startPosition:"setActive",value:function(t){var e=this;t?(this.setActive(+this.startPosition),this.$nextTick((function(){e.$refs.swipe.swipeTo(+e.startPosition,{immediate:!0})}))):this.$emit("close",{index:this.active,url:this.images[this.active]})},shouldRender:{handler:function(t){var e=this;t&&this.$nextTick((function(){var t=e.$refs.swipe.$el;w(t,"touchstart",e.onWrapperTouchStart),w(t,"touchmove",T),w(t,"touchend",e.onWrapperTouchEnd),w(t,"touchcancel",e.onWrapperTouchEnd)}))},immediate:!0}},methods:{emitClose:function(){this.asyncClose||this.$emit("input",!1)},onWrapperTouchStart:function(){this.touchStartTime=new Date},onWrapperTouchEnd:function(t){var e=this;T(t);var i=new Date-this.touchStartTime,n=this.$refs.swipe||{},s=n.offsetX,r=void 0===s?0:s,o=n.offsetY;i<300&&r<10&&(void 0===o?0:o)<10&&(this.doubleClickTimer?(clearTimeout(this.doubleClickTimer),this.doubleClickTimer=null,this.toggleScale()):this.doubleClickTimer=setTimeout((function(){e.emitClose(),e.doubleClickTimer=null}),300))},startMove:function(t){var e=t.currentTarget.getBoundingClientRect(),i=window.innerWidth,n=window.innerHeight;this.touchStart(t),this.moving=!0,this.startMoveX=this.moveX,this.startMoveY=this.moveY,this.maxMoveX=Math.max(0,(e.width-i)/2),this.maxMoveY=Math.max(0,(e.height-n)/2)},startZoom:function(t){this.moving=!1,this.zooming=!0,this.startScale=this.scale,this.startDistance=Wr(t.touches)},onImageTouchStart:function(t){var e=t.touches,i=(this.$refs.swipe||{}).offsetX,n=void 0===i?0:i;1===e.length&&1!==this.scale?this.startMove(t):2!==e.length||n||this.startZoom(t)},onImageTouchMove:function(t){var e=t.touches;if((this.moving||this.zooming)&&T(t,!0),this.moving){this.touchMove(t);var i=this.deltaX+this.startMoveX,n=this.deltaY+this.startMoveY;this.moveX=Dt(i,-this.maxMoveX,this.maxMoveX),this.moveY=Dt(n,-this.maxMoveY,this.maxMoveY)}if(this.zooming&&2===e.length){var s=Wr(e),r=this.startScale*s/this.startDistance;this.setScale(r)}},onImageTouchEnd:function(t){if(this.moving||this.zooming){var e=!0;this.moving&&this.startMoveX===this.moveX&&this.startMoveY===this.moveY&&(e=!1),t.touches.length||(this.moving=!1,this.zooming=!1,this.startMoveX=0,this.startMoveY=0,this.startScale=1,this.scale<1&&this.resetScale()),e&&T(t,!0)}},setActive:function(t){this.resetScale(),t!==this.active&&(this.active=t,this.$emit("change",t))},setScale:function(t){var e=Dt(t,+this.minZoom,+this.maxZoom);this.scale=e,this.$emit("scale",{index:this.active,scale:e})},resetScale:function(){this.setScale(1),this.moveX=0,this.moveY=0},toggleScale:function(){var t=this.scale>1?1:2;this.setScale(t),this.moveX=0,this.moveY=0},genIndex:function(){var t=this.$createElement;if(this.showIndex)return t("div",{class:Hr("index")},[this.slots("index")||this.active+1+" / "+this.images.length])},genCover:function(){var t=this.$createElement,e=this.slots("cover");if(e)return t("div",{class:Hr("cover")},[e])},genImages:function(){var t=this,e=this.$createElement,i={loading:function(){return e(kt,{attrs:{type:"spinner"}})}};return e(Ar,{ref:"swipe",attrs:{lazyRender:!0,loop:this.loop,indicatorColor:"white",duration:this.swipeDuration,initialSwipe:this.startPosition,showIndicators:this.showIndicators},class:Hr("swipe"),on:{change:this.setActive}},[this.images.map((function(n,s){return e(Vr,[e(Ui,{attrs:{src:n,fit:"contain"},class:Hr("image"),scopedSlots:i,style:s===t.active?t.imageStyle:null,nativeOn:{touchstart:t.onImageTouchStart,touchmove:t.onImageTouchMove,touchend:t.onImageTouchEnd,touchcancel:t.onImageTouchEnd}})])}))])},genClose:function(){var t=this.$createElement;if(this.closeable)return t(ct,{attrs:{role:"button",name:this.closeIcon},class:Hr("close-icon",this.closeIconPosition),on:{click:this.emitClose}})},onClosed:function(){this.$emit("closed")}},render:function(){var t=arguments[0];if(this.shouldRender)return t("transition",{attrs:{name:"van-fade"},on:{afterLeave:this.onClosed}},[t("div",{directives:[{name:"show",value:this.value}],class:[Hr(),this.className]},[this.genClose(),this.genImages(),this.genIndex(),this.genCover()])])}}),Ur={loop:!0,images:[],value:!0,minZoom:1/3,maxZoom:3,className:"",onClose:null,onChange:null,showIndex:!0,closeable:!1,closeIcon:"clear",asyncClose:!1,startPosition:0,swipeDuration:500,showIndicators:!1,closeOnPopstate:!1,closeIconPosition:"top-right"},Kr=function(t,e){if(void 0===e&&(e=0),!S.f){qr||(qr=new(l.a.extend(Yr))({el:document.createElement("div")}),document.body.appendChild(qr.$el),qr.$on("change",(function(t){qr.onChange&&qr.onChange(t)})),qr.$on("scale",(function(t){qr.onScale&&qr.onScale(t)})));var i=Array.isArray(t)?{images:t,startPosition:e}:t;return n(qr,Ur,i),qr.$once("input",(function(t){qr.value=t})),qr.$once("closed",(function(){qr.images=[]})),i.onClose&&(qr.$off("close"),qr.$once("close",i.onClose)),qr}};Kr.install=function(){l.a.use(Yr)};var Xr=Kr,Qr=Object(o.a)("index-anchor"),Gr=Qr[0],Zr=Qr[1],Jr=Gr({mixins:[si("vanIndexBar",{indexKey:"childrenIndex"})],props:{index:[Number,String]},data:function(){return{top:0,left:null,width:null,active:!1}},computed:{sticky:function(){return this.active&&this.parent.sticky},anchorStyle:function(){if(this.sticky)return{zIndex:""+this.parent.zIndex,left:this.left?this.left+"px":null,width:this.width?this.width+"px":null,transform:"translate3d(0, "+this.top+"px, 0)",color:this.parent.highlightColor}}},mounted:function(){this.height=this.$el.offsetHeight},methods:{scrollIntoView:function(){this.$el.scrollIntoView()}},render:function(){var t,e=arguments[0],i=this.sticky;return e("div",{style:{height:i?this.height+"px":null}},[e("div",{style:this.anchorStyle,class:[Zr({sticky:i}),(t={},t[g]=i,t)]},[this.slots("default")||this.index])])}});var to=Object(o.a)("index-bar"),eo=to[0],io=to[1],no=eo({mixins:[U,ri("vanIndexBar"),X((function(t){this.scroller||(this.scroller=R(this.$el)),t(this.scroller,"scroll",this.onScroll)}))],props:{zIndex:[Number,String],highlightColor:String,sticky:{type:Boolean,default:!0},stickyOffsetTop:{type:Number,default:0},indexList:{type:Array,default:function(){for(var t=[],e="A".charCodeAt(0),i=0;i<26;i++)t.push(String.fromCharCode(e+i));return t}}},data:function(){return{activeAnchorIndex:null}},computed:{sidebarStyle:function(){if(Object(S.b)(this.zIndex))return{zIndex:this.zIndex+1}},highlightStyle:function(){var t=this.highlightColor;if(t)return{color:t}}},watch:{indexList:function(){this.$nextTick(this.onScroll)}},methods:{onScroll:function(){var t=this;if(!bs(this.$el)){var e=_(this.scroller),i=this.getScrollerRect(),n=this.children.map((function(e){return{height:e.height,top:t.getElementTop(e.$el,i)}})),s=this.getActiveAnchorIndex(e,n);this.activeAnchorIndex=this.indexList[s],this.sticky&&this.children.forEach((function(r,o){if(o===s||o===s-1){var a=r.$el.getBoundingClientRect();r.left=a.left,r.width=a.width}else r.left=null,r.width=null;if(o===s)r.active=!0,r.top=Math.max(t.stickyOffsetTop,n[o].top-e)+i.top;else if(o===s-1){var l=n[s].top-e;r.active=l>0,r.top=l+i.top-r.height}else r.active=!1}))}},getScrollerRect:function(){return this.scroller.getBoundingClientRect?this.scroller.getBoundingClientRect():{top:0,left:0}},getElementTop:function(t,e){var i=this.scroller;return i===window||i===document.body?Y(t):t.getBoundingClientRect().top-e.top+_(i)},getActiveAnchorIndex:function(t,e){for(var i=this.children.length-1;i>=0;i--){var n=i>0?e[i-1].height:0;if(t+(this.sticky?n+this.stickyOffsetTop:0)>=e[i].top)return i}return-1},onClick:function(t){this.scrollToElement(t.target)},onTouchMove:function(t){if(this.touchMove(t),"vertical"===this.direction){T(t);var e=t.touches[0],i=e.clientX,n=e.clientY,s=document.elementFromPoint(i,n);if(s){var r=s.dataset.index;this.touchActiveIndex!==r&&(this.touchActiveIndex=r,this.scrollToElement(s))}}},scrollToElement:function(t){var e=t.dataset.index;if(e){var i=this.children.filter((function(t){return String(t.index)===e}));i[0]&&(i[0].scrollIntoView(),this.sticky&&this.stickyOffsetTop&&q(W()-this.stickyOffsetTop),this.$emit("select",i[0].index))}},onTouchEnd:function(){this.active=null}},render:function(){var t=this,e=arguments[0],i=this.indexList.map((function(i){var n=i===t.activeAnchorIndex;return e("span",{class:io("index",{active:n}),style:n?t.highlightStyle:null,attrs:{"data-index":i}},[i])}));return e("div",{class:io()},[e("div",{class:io("sidebar"),style:this.sidebarStyle,on:{click:this.onClick,touchstart:this.touchStart,touchmove:this.onTouchMove,touchend:this.onTouchEnd,touchcancel:this.onTouchEnd}},[i]),this.slots("default")])}}),so=i(10),ro=i.n(so).a,oo=Object(o.a)("list"),ao=oo[0],lo=oo[1],uo=oo[2],co=ao({mixins:[X((function(t){this.scroller||(this.scroller=R(this.$el)),t(this.scroller,"scroll",this.check)}))],model:{prop:"loading"},props:{error:Boolean,loading:Boolean,finished:Boolean,errorText:String,loadingText:String,finishedText:String,immediateCheck:{type:Boolean,default:!0},offset:{type:[Number,String],default:300},direction:{type:String,default:"down"}},data:function(){return{innerLoading:this.loading}},updated:function(){this.innerLoading=this.loading},mounted:function(){this.immediateCheck&&this.check()},watch:{loading:"check",finished:"check"},methods:{check:function(){var t=this;this.$nextTick((function(){if(!(t.innerLoading||t.finished||t.error)){var e,i=t.$el,n=t.scroller,s=t.offset,r=t.direction;if(!((e=n.getBoundingClientRect?n.getBoundingClientRect():{top:0,bottom:n.innerHeight}).bottom-e.top)||bs(i))return!1;var o=t.$refs.placeholder.getBoundingClientRect();("up"===r?e.top-o.top<=s:o.bottom-e.bottom<=s)&&(t.innerLoading=!0,t.$emit("input",!0),t.$emit("load"))}}))},clickErrorText:function(){this.$emit("update:error",!1),this.check()},genLoading:function(){var t=this.$createElement;if(this.innerLoading&&!this.finished)return t("div",{class:lo("loading"),key:"loading"},[this.slots("loading")||t(kt,{attrs:{size:"16"}},[this.loadingText||uo("loading")])])},genFinishedText:function(){var t=this.$createElement;if(this.finished){var e=this.slots("finished")||this.finishedText;if(e)return t("div",{class:lo("finished-text")},[e])}},genErrorText:function(){var t=this.$createElement;if(this.error){var e=this.slots("error")||this.errorText;if(e)return t("div",{on:{click:this.clickErrorText},class:lo("error-text")},[e])}}},render:function(){var t=arguments[0],e=t("div",{ref:"placeholder",class:lo("placeholder")});return t("div",{class:lo(),attrs:{role:"feed","aria-busy":this.innerLoading}},["down"===this.direction?this.slots():e,this.genLoading(),this.genFinishedText(),this.genErrorText(),"up"===this.direction?this.slots():e])}}),ho=i(5),fo=Object(o.a)("nav-bar"),po=fo[0],mo=fo[1],vo=po({props:{title:String,fixed:Boolean,zIndex:[Number,String],leftText:String,rightText:String,leftArrow:Boolean,placeholder:Boolean,border:{type:Boolean,default:!0}},data:function(){return{height:null}},mounted:function(){this.placeholder&&this.fixed&&(this.height=this.$refs.navBar.getBoundingClientRect().height)},methods:{genLeft:function(){var t=this.$createElement,e=this.slots("left");return e||[this.leftArrow&&t(ct,{class:mo("arrow"),attrs:{name:"arrow-left"}}),this.leftText&&t("span",{class:mo("text")},[this.leftText])]},genRight:function(){var t=this.$createElement,e=this.slots("right");return e||(this.rightText?t("span",{class:mo("text")},[this.rightText]):void 0)},genNavBar:function(){var t,e=this.$createElement;return e("div",{ref:"navBar",style:{zIndex:this.zIndex},class:[mo({fixed:this.fixed}),(t={},t[g]=this.border,t)]},[e("div",{class:mo("left"),on:{click:this.onClickLeft}},[this.genLeft()]),e("div",{class:[mo("title"),"van-ellipsis"]},[this.slots("title")||this.title]),e("div",{class:mo("right"),on:{click:this.onClickRight}},[this.genRight()])])},onClickLeft:function(t){this.$emit("click-left",t)},onClickRight:function(t){this.$emit("click-right",t)}},render:function(){var t=arguments[0];return this.placeholder&&this.fixed?t("div",{class:mo("placeholder"),style:{height:this.height+"px"}},[this.genNavBar()]):this.genNavBar()}}),go=Object(o.a)("notice-bar"),bo=go[0],yo=go[1],So=bo({props:{text:String,mode:String,color:String,leftIcon:String,wrapable:Boolean,background:String,scrollable:{type:Boolean,default:!0},delay:{type:[Number,String],default:1},speed:{type:[Number,String],default:50}},data:function(){return{wrapWidth:0,firstRound:!0,duration:0,offsetWidth:0,showNoticeBar:!0,animationClass:""}},watch:{text:{handler:function(){var t=this;this.$nextTick((function(){var e=t.$refs,i=e.wrap,n=e.content;if(i&&n){var s=i.getBoundingClientRect().width,r=n.getBoundingClientRect().width;t.scrollable&&r>s&&(t.wrapWidth=s,t.offsetWidth=r,t.duration=r/t.speed,t.animationClass=yo("play"))}}))},immediate:!0}},methods:{onClickIcon:function(t){"closeable"===this.mode&&(this.showNoticeBar=!1,this.$emit("close",t))},onAnimationEnd:function(){var t=this;this.firstRound=!1,this.$nextTick((function(){t.duration=(t.offsetWidth+t.wrapWidth)/t.speed,t.animationClass=yo("play--infinite")}))}},render:function(){var t=this,e=arguments[0],i=this.slots,n=this.mode,s=this.leftIcon,r=this.onClickIcon,o={color:this.color,background:this.background},a={paddingLeft:this.firstRound?0:this.wrapWidth+"px",animationDelay:(this.firstRound?this.delay:0)+"s",animationDuration:this.duration+"s"};function l(){var t=i("left-icon");return t||(s?e(ct,{class:yo("left-icon"),attrs:{name:s}}):void 0)}function u(){var t,s=i("right-icon");return s||("closeable"===n?t="cross":"link"===n&&(t="arrow"),t?e(ct,{class:yo("right-icon"),attrs:{name:t},on:{click:r}}):void 0)}return e("div",{attrs:{role:"alert"},directives:[{name:"show",value:this.showNoticeBar}],class:yo({wrapable:this.wrapable}),style:o,on:{click:function(e){t.$emit("click",e)}}},[l(),e("div",{ref:"wrap",class:yo("wrap"),attrs:{role:"marquee"}},[e("div",{ref:"content",class:[yo("content"),this.animationClass,{"van-ellipsis":!this.scrollable&&!this.wrapable}],style:a,on:{animationend:this.onAnimationEnd,webkitAnimationEnd:this.onAnimationEnd}},[this.slots()||this.text])]),u()])}}),ko=Object(o.a)("notify"),xo=ko[0],wo=ko[1];function Co(t,e,i,n){var s={color:e.color,background:e.background};return t(pt,r()([{attrs:{value:e.value,position:"top",overlay:!1,duration:.2,lockScroll:!1},style:s,class:[wo([e.type]),e.className]},h(n,!0)]),[e.message])}Co.props=n({},G,{color:String,message:[Number,String],duration:[Number,String],className:null,background:String,getContainer:[String,Function],type:{type:String,default:"danger"}});var Oo,To,$o=xo(Co);function Io(t){var e;if(!S.f)return To||(To=f($o,{on:{click:function(t){To.onClick&&To.onClick(t)},close:function(){To.onClose&&To.onClose()},opened:function(){To.onOpened&&To.onOpened()}}})),t=n({},Io.currentOptions,{},(e=t,Object(S.d)(e)?e:{message:e})),n(To,t),clearTimeout(Oo),t.duration&&t.duration>0&&(Oo=setTimeout(Io.clear,t.duration)),To}Io.clear=function(){To&&(To.value=!1)},Io.currentOptions={type:"danger",value:!0,message:"",color:void 0,background:void 0,duration:3e3,className:"",onClose:null,onClick:null,onOpened:null},Io.setDefaultOptions=function(t){n(Io.currentOptions,t)},Io.resetDefaultOptions=function(){Io.currentOptions={type:"danger",value:!0,message:"",color:void 0,background:void 0,duration:3e3,className:"",onClose:null,onClick:null,onOpened:null}},Io.install=function(){l.a.use($o)},l.a.prototype.$notify=Io;var Bo=Io,jo=Object(o.a)("key"),Do=jo[0],No=jo[1],Eo=Do({mixins:[U],props:{type:String,text:[Number,String],theme:{type:Array,default:function(){return[]}}},data:function(){return{active:!1}},computed:{className:function(){var t=this.theme.slice(0);return this.active&&t.push("active"),this.type&&t.push(this.type),No(t)}},mounted:function(){this.bindTouchEvent(this.$el)},methods:{onTouchStart:function(t){t.stopPropagation(),this.touchStart(t),this.active=!0},onTouchMove:function(t){this.touchMove(t),this.direction&&(this.active=!1)},onTouchEnd:function(){this.active&&(this.active=!1,this.$emit("press",this.text,this.type))}},render:function(){var t=arguments[0];return t("i",{attrs:{role:"button",tabindex:"0"},class:[m,this.className]},[this.slots("default")||this.text])}}),Lo=Object(o.a)("number-keyboard"),Po=Lo[0],Ao=Lo[1],Mo=Lo[2],zo=["blue","big"],Fo=["delete","big","gray"],Vo=Po({mixins:[X((function(t){this.hideOnClickOutside&&t(document.body,"touchstart",this.onBlur)}))],model:{event:"update:value"},props:{show:Boolean,title:String,zIndex:[Number,String],closeButtonText:String,deleteButtonText:String,theme:{type:String,default:"default"},value:{type:String,default:""},extraKey:{type:String,default:""},maxlength:{type:[Number,String],default:Number.MAX_VALUE},transition:{type:Boolean,default:!0},showDeleteKey:{type:Boolean,default:!0},hideOnClickOutside:{type:Boolean,default:!0},safeAreaInsetBottom:{type:Boolean,default:!0}},watch:{show:function(t){this.transition||this.$emit(t?"show":"hide")}},computed:{keys:function(){for(var t=[],e=1;e<=9;e++)t.push({text:e});switch(this.theme){case"default":t.push({text:this.extraKey,theme:["gray"],type:"extra"},{text:0},{theme:["gray"],text:this.showDeleteKey?this.deleteText:"",type:this.showDeleteKey?"delete":""});break;case"custom":t.push({text:0,theme:["middle"]},{text:this.extraKey,type:"extra"})}return t},deleteText:function(){return this.deleteButtonText||Mo("delete")}},methods:{onBlur:function(){this.show&&this.$emit("blur")},onClose:function(){this.$emit("close"),this.onBlur()},onAnimationEnd:function(){this.$emit(this.show?"show":"hide")},onPress:function(t,e){if(""!==t){var i=this.value;"delete"===e?(this.$emit("delete"),this.$emit("update:value",i.slice(0,i.length-1))):"close"===e?this.onClose():i.lengthe&&(n=(s=e)-i+1);for(var o=n;o<=s;o++){var a=qo(o,o,o===this.value);t.push(a)}if(r&&i>0&&this.forceEllipses){if(n>1){var l=qo(n-1,"...",!1);t.unshift(l)}if(s=0&&t<=100}},showPivot:{type:Boolean,default:!0}},data:function(){return{pivotWidth:0,progressWidth:0}},mounted:function(){this.setWidth()},watch:{showPivot:"setWidth",pivotText:"setWidth"},methods:{setWidth:function(){var t=this;this.$nextTick((function(){t.progressWidth=t.$el.offsetWidth,t.pivotWidth=t.$refs.pivot?t.$refs.pivot.offsetWidth:0}))}},render:function(){var t=arguments[0],e=this.pivotText,i=this.percentage,n=Object(S.b)(e)?e:i+"%",s=this.showPivot&&n,r=this.inactive?"#cacaca":this.color,o={color:this.textColor,left:(this.progressWidth-this.pivotWidth)*i/100+"px",background:this.pivotColor||r},a={background:r,width:this.progressWidth*i/100+"px"},l={background:this.trackColor,height:Object(J.a)(this.strokeWidth)};return t("div",{class:ra(),style:l},[t("span",{class:ra("portion"),style:a},[s&&t("span",{ref:"pivot",style:o,class:ra("pivot")},[n])])])}}),aa=Object(o.a)("pull-refresh"),la=aa[0],ua=aa[1],ca=aa[2],ha=["pulling","loosing","success"],da=la({mixins:[U],props:{disabled:Boolean,successText:String,pullingText:String,loosingText:String,loadingText:String,value:{type:Boolean,required:!0},successDuration:{type:[Number,String],default:500},animationDuration:{type:[Number,String],default:300},headHeight:{type:[Number,String],default:50}},data:function(){return{status:"normal",distance:0,duration:0}},computed:{touchable:function(){return"loading"!==this.status&&"success"!==this.status&&!this.disabled},headStyle:function(){if(50!==this.headHeight)return{height:this.headHeight+"px"}}},watch:{value:function(t){this.duration=this.animationDuration,t?this.setStatus(+this.headHeight,!0):this.slots("success")||this.successText?this.showSuccessTip():this.setStatus(0,!1)}},mounted:function(){this.bindTouchEvent(this.$refs.track),this.scrollEl=R(this.$el)},methods:{checkPullStart:function(t){this.ceiling=0===_(this.scrollEl),this.ceiling&&(this.duration=0,this.touchStart(t))},onTouchStart:function(t){this.touchable&&this.checkPullStart(t)},onTouchMove:function(t){this.touchable&&(this.ceiling||this.checkPullStart(t),this.touchMove(t),this.ceiling&&this.deltaY>=0&&"vertical"===this.direction&&(T(t),this.setStatus(this.ease(this.deltaY))))},onTouchEnd:function(){var t=this;this.touchable&&this.ceiling&&this.deltaY&&(this.duration=this.animationDuration,"loosing"===this.status?(this.setStatus(+this.headHeight,!0),this.$emit("input",!0),this.$nextTick((function(){t.$emit("refresh")}))):this.setStatus(0))},ease:function(t){var e=+this.headHeight;return t>e&&(t=t<2*e?e+(t-e)/2:1.5*e+(t-2*e)/4),Math.round(t)},setStatus:function(t,e){var i;i=e?"loading":0===t?"normal":t=e?"full":t+.5>=e&&i?"half":"void"));return n},sizeWithUnit:function(){return Object(J.a)(this.size)},gutterWithUnit:function(){return Object(J.a)(this.gutter)}},mounted:function(){this.bindTouchEvent(this.$el)},methods:{select:function(t){this.disabled||this.readonly||t===this.value||(this.$emit("input",t),this.$emit("change",t))},onTouchStart:function(t){var e=this;if(!this.readonly&&!this.disabled&&this.touchable){this.touchStart(t);var i=this.$refs.items.map((function(t){return t.getBoundingClientRect()})),n=[];i.forEach((function(t,i){e.allowHalf?n.push({score:i+.5,left:t.left},{score:i+1,left:t.left+t.width/2}):n.push({score:i+1,left:t.left})})),this.ranges=n}},onTouchMove:function(t){if(!this.readonly&&!this.disabled&&this.touchable&&(this.touchMove(t),"horizontal"===this.direction)){T(t);var e=t.touches[0].clientX;this.select(this.getScoreByPosition(e))}},getScoreByPosition:function(t){for(var e=this.ranges.length-1;e>0;e--)if(t>this.ranges[e].left)return this.ranges[e].score;return this.allowHalf?.5:1},genStar:function(t,e){var i,n=this,s=this.$createElement,r=this.icon,o=this.color,a=this.count,l=this.voidIcon,u=this.disabled,c=this.voidColor,h=this.disabledColor,d=e+1,f="full"===t,p="void"===t;return this.gutterWithUnit&&d!==+a&&(i={paddingRight:this.gutterWithUnit}),s("div",{ref:"items",refInFor:!0,key:e,attrs:{role:"radio",tabindex:"0","aria-setsize":a,"aria-posinset":d,"aria-checked":String(!p)},style:i,class:ma("item")},[s(ct,{attrs:{size:this.sizeWithUnit,name:f?r:l,color:u?h:f?o:c,classPrefix:this.iconPrefix,"data-score":d},class:ma("icon",{disabled:u,full:f}),on:{click:function(){n.select(d)}}}),this.allowHalf&&s(ct,{attrs:{size:this.sizeWithUnit,name:p?l:r,color:u?h:p?c:o,classPrefix:this.iconPrefix,"data-score":d-.5},class:ma("icon",["half",{disabled:u,full:!p}]),on:{click:function(){n.select(d-.5)}}})])}},render:function(){var t=this,e=arguments[0];return e("div",{class:ma({readonly:this.readonly,disabled:this.disabled}),attrs:{tabindex:"0",role:"radiogroup"}},[this.list.map((function(e,i){return t.genStar(e,i)}))])}}),ga=Object(o.a)("row"),ba=ga[0],ya=ga[1],Sa=ba({props:{type:String,align:String,justify:String,tag:{type:String,default:"div"},gutter:{type:[Number,String],default:0}},methods:{onClick:function(t){this.$emit("click",t)}},render:function(){var t,e=arguments[0],i=this.align,n=this.justify,s="flex"===this.type,r="-"+Number(this.gutter)/2+"px",o=this.gutter?{marginLeft:r,marginRight:r}:{};return e(this.tag,{style:o,class:ya((t={flex:s},t["align-"+i]=s&&i,t["justify-"+n]=s&&n,t)),on:{click:this.onClick}},[this.slots()])}}),ka=Object(o.a)("search"),xa=ka[0],wa=ka[1],Ca=ka[2];function Oa(t,e,i,s){var o={attrs:s.data.attrs,on:n({},s.listeners,{keypress:function(t){13===t.keyCode&&(T(t),d(s,"search",e.value)),d(s,"keypress",t)}})},a=h(s);return a.attrs=void 0,t("div",r()([{class:wa({"show-action":e.showAction}),style:{background:e.background}},a]),[null==i.left?void 0:i.left(),t("div",{class:wa("content",e.shape)},[function(){if(i.label||e.label)return t("div",{class:wa("label")},[i.label?i.label():e.label])}(),t(le,r()([{attrs:{type:"search",border:!1,value:e.value,leftIcon:e.leftIcon,rightIcon:e.rightIcon,clearable:e.clearable},scopedSlots:{"left-icon":i["left-icon"],"right-icon":i["right-icon"]}},o]))]),function(){if(e.showAction)return t("div",{class:wa("action"),attrs:{role:"button",tabindex:"0"},on:{click:function(){i.action||(d(s,"input",""),d(s,"cancel"))}}},[i.action?i.action():e.actionText||Ca("cancel")])}()])}Oa.props={value:String,label:String,rightIcon:String,actionText:String,showAction:Boolean,background:String,shape:{type:String,default:"square"},clearable:{type:Boolean,default:!0},leftIcon:{type:String,default:"search"}};var Ta=xa(Oa),$a=Object(o.a)("sidebar"),Ia=$a[0],Ba=$a[1],ja=Ia({mixins:[ri("vanSidebar")],model:{prop:"activeKey"},props:{activeKey:{type:[Number,String],default:0}},render:function(){var t=arguments[0];return t("div",{class:Ba()},[this.slots()])}}),Da=Object(o.a)("sidebar-item"),Na=Da[0],Ea=Da[1],La=Na({mixins:[si("vanSidebar")],props:n({},Zt,{dot:Boolean,info:[Number,String],badge:[Number,String],title:String,disabled:Boolean}),computed:{select:function(){return this.index===+this.parent.activeKey}},methods:{onClick:function(){this.disabled||(this.$emit("click",this.index),this.parent.$emit("input",this.index),this.parent.$emit("change",this.index),Qt(this.$router,this))}},render:function(){var t=arguments[0];return t("a",{class:Ea({select:this.select,disabled:this.disabled}),on:{click:this.onClick}},[t("div",{class:Ea("text")},[this.title,t(st,{attrs:{dot:this.dot,info:Object(S.b)(this.badge)?this.badge:this.info},class:Ea("info")})])])}}),Pa=Object(o.a)("skeleton"),Aa=Pa[0],Ma=Pa[1];function za(t,e,i,n){if(!e.loading)return i.default&&i.default();return t("div",r()([{class:Ma({animate:e.animate})},h(n)]),[function(){if(e.avatar){var i=Object(J.a)(e.avatarSize);return t("div",{class:Ma("avatar",e.avatarShape),style:{width:i,height:i}})}}(),t("div",{class:Ma("content")},[function(){if(e.title)return t("h3",{class:Ma("title"),style:{width:Object(J.a)(e.titleWidth)}})}(),function(){for(var i,n=[],s=e.rowWidth,r=0;r0},Ua=function(t,e){var i=function(t){var e={};return t.forEach((function(t){var i={};t.v.forEach((function(t){i[t.id]=t})),e[t.k_id]=i})),e}(t);return Object.keys(e).reduce((function(t,s){return e[s].forEach((function(e){t.push(n({},i[s][e]))})),t}),[])},Ka=function(t,e){var i=[];return(t||[]).forEach((function(t){if(e[t.k_id]&&e[t.k_id].length>0){var s=[];t.v.forEach((function(i){e[t.k_id].indexOf(i.id)>-1&&s.push(n({},i))})),i.push(n({},t,{v:s}))}})),i},Xa={normalizeSkuTree:_a,getSkuComb:Wa,getSelectedSkuValues:qa,isAllSelected:Ha,isSkuChoosable:Ya,getSelectedPropValues:Ua,getSelectedProperties:Ka},Qa=Object(o.a)("sku-header"),Ga=Qa[0],Za=Qa[1];function Ja(t,e,i,n){var s=e.sku,o=e.goods,a=e.skuEventBus,l=function(t,e){var i;return t.tree.some((function(t){var n=e[t.k_s];if(n&&t.v){var s=t.v.filter((function(t){return t.id===n}))[0]||{};return i=s.previewImgUrl||s.imgUrl||s.img_url}return!1})),i}(s,e.selectedSku)||o.picture;return t("div",r()([{class:[Za(),g]},h(n)]),[t("div",{class:Za("img-wrap"),on:{click:function(){a.$emit("sku:previewImage",l)}}},[t("img",{attrs:{src:l}}),null==i["sku-header-image-extra"]?void 0:i["sku-header-image-extra"]()]),t("div",{class:Za("goods-info")},[i.default&&i.default()])])}Ja.props={sku:Object,goods:Object,skuEventBus:Object,selectedSku:Object};var tl=Ga(Ja),el=Object(o.a)("sku-header-item"),il=el[0],nl=el[1];var sl=il((function(t,e,i,n){return t("div",r()([{class:nl()},h(n)]),[i.default&&i.default()])})),rl=Object(o.a)("sku-row"),ol=rl[0],al=rl[1],ll=rl[2];function ul(t,e,i,n){var s=e.skuRow.is_multiple&&t("span",{class:al("title-multiple")},["(",ll("multiple"),")"]);return t("div",r()([{class:[al(),g]},h(n)]),[t("div",{class:al("title")},[e.skuRow.k,s]),i.default&&i.default()])}ul.props={skuRow:Object};var cl=ol(ul),hl=(0,Object(o.a)("sku-row-item")[0])({props:{skuValue:Object,skuKeyStr:String,skuEventBus:Object,selectedSku:Object,skuList:{type:Array,default:function(){return[]}}},computed:{choosable:function(){return Ya(this.skuList,this.selectedSku,{key:this.skuKeyStr,valueId:this.skuValue.id})}},methods:{onSelect:function(){this.choosable&&this.skuEventBus.$emit("sku:select",n({},this.skuValue,{skuKeyStr:this.skuKeyStr}))}},render:function(){var t=arguments[0],e=this.skuValue.id===this.selectedSku[this.skuKeyStr],i=this.skuValue.imgUrl||this.skuValue.img_url;return t("span",{class:["van-sku-row__item",{"van-sku-row__item--active":e,"van-sku-row__item--disabled":!this.choosable}],on:{click:this.onSelect}},[i&&t("img",{class:"van-sku-row__item-img",attrs:{src:i}}),t("span",{class:"van-sku-row__item-name"},[this.skuValue.name])])}}),dl=(0,Object(o.a)("sku-row-prop-item")[0])({props:{skuValue:Object,skuKeyStr:String,skuEventBus:Object,selectedProp:Object,multiple:Boolean},computed:{choosed:function(){var t=this.selectedProp,e=this.skuKeyStr,i=this.skuValue;return!(!t||!t[e])&&t[e].indexOf(i.id)>-1}},methods:{onSelect:function(){this.skuEventBus.$emit("sku:propSelect",n({},this.skuValue,{skuKeyStr:this.skuKeyStr,multiple:this.multiple}))}},render:function(){var t=arguments[0];return t("span",{class:["van-sku-row__item",{"van-sku-row__item--active":this.choosed}],on:{click:this.onSelect}},[t("span",{class:"van-sku-row__item-name"},[this.skuValue.name])])}}),fl=Object(o.a)("stepper"),pl=fl[0],ml=fl[1];function vl(t,e){return String(t)===String(e)}var gl=pl({mixins:[_e],props:{value:null,integer:Boolean,disabled:Boolean,inputWidth:[Number,String],buttonSize:[Number,String],asyncChange:Boolean,disablePlus:Boolean,disableMinus:Boolean,disableInput:Boolean,decimalLength:[Number,String],name:{type:[Number,String],default:""},min:{type:[Number,String],default:1},max:{type:[Number,String],default:1/0},step:{type:[Number,String],default:1},defaultValue:{type:[Number,String],default:1},showPlus:{type:Boolean,default:!0},showMinus:{type:Boolean,default:!0},longPress:{type:Boolean,default:!0}},data:function(){var t=Object(S.b)(this.value)?this.value:this.defaultValue,e=this.format(t);return vl(e,this.value)||this.$emit("input",e),{currentValue:e}},computed:{minusDisabled:function(){return this.disabled||this.disableMinus||this.currentValue<=this.min},plusDisabled:function(){return this.disabled||this.disablePlus||this.currentValue>=this.max},inputStyle:function(){var t={};return this.inputWidth&&(t.width=Object(J.a)(this.inputWidth)),this.buttonSize&&(t.height=Object(J.a)(this.buttonSize)),t},buttonStyle:function(){if(this.buttonSize){var t=Object(J.a)(this.buttonSize);return{width:t,height:t}}}},watch:{max:"check",min:"check",integer:"check",decimalLength:"check",value:function(t){vl(t,this.currentValue)||(this.currentValue=this.format(t))},currentValue:function(t){this.$emit("input",t),this.$emit("change",t,{name:this.name})}},methods:{check:function(){var t=this.format(this.currentValue);vl(t,this.currentValue)||(this.currentValue=t)},formatNumber:function(t){return Ut(String(t),!this.integer)},format:function(t){return t=""===(t=this.formatNumber(t))?0:+t,t=Math.max(Math.min(this.max,t),this.min),Object(S.b)(this.decimalLength)&&(t=t.toFixed(this.decimalLength)),t},onInput:function(t){var e=t.target.value,i=this.formatNumber(e);if(Object(S.b)(this.decimalLength)&&-1!==i.indexOf(".")){var n=i.split(".");i=n[0]+"."+n[1].slice(0,this.decimalLength)}vl(e,i)||(t.target.value=i),this.emitChange(i)},emitChange:function(t){this.asyncChange?(this.$emit("input",t),this.$emit("change",t,{name:this.name})):this.currentValue=t},onChange:function(){var t=this.type;if(this[t+"Disabled"])this.$emit("overlimit",t);else{var e,i,n,s="minus"===t?-this.step:+this.step,r=this.format((e=+this.currentValue,i=s,n=Math.pow(10,10),Math.round((e+i)*n)/n));this.emitChange(r),this.$emit(t)}},onFocus:function(t){this.$emit("focus",t)},onBlur:function(t){var e=this.format(t.target.value);t.target.value=e,this.currentValue=e,this.$emit("blur",t),Xt()},longPressStep:function(){var t=this;this.longPressTimer=setTimeout((function(){t.onChange(),t.longPressStep(t.type)}),200)},onTouchStart:function(){var t=this;this.longPress&&(clearTimeout(this.longPressTimer),this.isLongPress=!1,this.longPressTimer=setTimeout((function(){t.isLongPress=!0,t.onChange(),t.longPressStep()}),600))},onTouchEnd:function(t){this.longPress&&(clearTimeout(this.longPressTimer),this.isLongPress&&T(t))}},render:function(){var t=this,e=arguments[0],i=function(e){return{on:{click:function(){t.type=e,t.onChange()},touchstart:function(){t.type=e,t.onTouchStart()},touchend:t.onTouchEnd,touchcancel:t.onTouchEnd}}};return e("div",{class:ml()},[e("button",r()([{directives:[{name:"show",value:this.showMinus}],attrs:{type:"button"},style:this.buttonStyle,class:ml("minus",{disabled:this.minusDisabled})},i("minus")])),e("input",{attrs:{type:this.integer?"tel":"text",role:"spinbutton",disabled:this.disabled,readonly:this.disableInput,inputmode:this.integer?"numeric":"decimal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.currentValue},class:ml("input"),domProps:{value:this.currentValue},style:this.inputStyle,on:{input:this.onInput,focus:this.onFocus,blur:this.onBlur}}),e("button",r()([{directives:[{name:"show",value:this.showPlus}],attrs:{type:"button"},style:this.buttonStyle,class:ml("plus",{disabled:this.plusDisabled})},i("plus")]))])}}),bl=Object(o.a)("sku-stepper"),yl=bl[0],Sl=bl[2],kl=Va.QUOTA_LIMIT,xl=Va.STOCK_LIMIT,wl=yl({props:{stock:Number,skuEventBus:Object,skuStockNum:Number,selectedNum:Number,stepperTitle:String,disableStepperInput:Boolean,customStepperConfig:Object,hideQuotaText:Boolean,quota:{type:Number,default:0},quotaUsed:{type:Number,default:0},startSaleNum:{type:Number,default:1}},data:function(){return{currentNum:this.selectedNum,limitType:xl}},watch:{currentNum:function(t){var e=parseInt(t,10);e>=this.stepperMinLimit&&e<=this.stepperLimit&&this.skuEventBus.$emit("sku:numChange",e)},stepperLimit:function(t){tthis.currentNum||t>this.stepperLimit)&&(this.currentNum=t),this.checkState(t,this.stepperLimit)}},computed:{stepperLimit:function(){var t,e=this.quota-this.quotaUsed;return this.quota>0&&e<=this.stock?(t=e<0?0:e,this.limitType=kl):(t=this.stock,this.limitType=xl),t},stepperMinLimit:function(){return this.startSaleNum<1?1:this.startSaleNum},quotaText:function(){var t=this.customStepperConfig,e=t.quotaText;if(t.hideQuotaText)return"";var i="";if(e)i=e;else{var n=[];this.startSaleNum>1&&n.push(Sl("quotaStart",this.startSaleNum)),this.quota>0&&n.push(Sl("quotaLimit",this.quota)),i=n.join(Sl("comma"))}return i}},created:function(){this.checkState(this.stepperMinLimit,this.stepperLimit)},methods:{setCurrentNum:function(t){this.currentNum=t,this.checkState(this.stepperMinLimit,this.stepperLimit)},onOverLimit:function(t){this.skuEventBus.$emit("sku:overLimit",{action:t,limitType:this.limitType,quota:this.quota,quotaUsed:this.quotaUsed,startSaleNum:this.startSaleNum})},onChange:function(t){var e=parseInt(t,10),i=this.customStepperConfig.handleStepperChange;i&&i(e),this.$emit("change",e)},checkState:function(t,e){this.currentNume?this.currentNum=t:this.currentNum>e&&(this.currentNum=e),this.skuEventBus.$emit("sku:stepperState",{valid:t<=e,min:t,max:e,limitType:this.limitType,quota:this.quota,quotaUsed:this.quotaUsed,startSaleNum:this.startSaleNum})}},render:function(){var t=this,e=arguments[0];return e("div",{class:"van-sku-stepper-stock"},[e("div",{class:"van-sku-stepper-container"},[e("div",{class:"van-sku__stepper-title"},[this.stepperTitle||Sl("num")]),e(gl,{class:"van-sku__stepper",attrs:{min:this.stepperMinLimit,max:this.stepperLimit,disableInput:this.disableStepperInput,integer:!0},on:{overlimit:this.onOverLimit,change:this.onChange},model:{value:t.currentNum,callback:function(e){t.currentNum=e}}}),!this.hideQuotaText&&this.quotaText&&e("span",{class:"van-sku__stepper-quota"},["(",this.quotaText,")"])])])}});function Cl(t){return/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(t)}function Ol(t){return Array.isArray(t)?t:[t]}function Tl(t,e){return new Promise((function(i){if("file"!==e){var n=new FileReader;n.onload=function(t){i(t.target.result)},"dataUrl"===e?n.readAsDataURL(t):"text"===e&&n.readAsText(t)}else i()}))}var $l=/\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i;function Il(t){return!!t.isImage||(t.file&&t.file.type?0===t.file.type.indexOf("image"):t.url?(e=t.url,$l.test(e)):!!t.content&&0===t.content.indexOf("data:image"));var e}var Bl=Object(o.a)("uploader"),jl=Bl[0],Dl=Bl[1],Nl=jl({inheritAttrs:!1,mixins:[_e],model:{prop:"fileList"},props:{disabled:Boolean,uploadText:String,afterRead:Function,beforeRead:Function,beforeDelete:Function,previewSize:[Number,String],name:{type:[Number,String],default:""},accept:{type:String,default:"image/*"},fileList:{type:Array,default:function(){return[]}},maxSize:{type:[Number,String],default:Number.MAX_VALUE},maxCount:{type:[Number,String],default:Number.MAX_VALUE},deletable:{type:Boolean,default:!0},showUpload:{type:Boolean,default:!0},previewImage:{type:Boolean,default:!0},previewFullImage:{type:Boolean,default:!0},imageFit:{type:String,default:"cover"},resultType:{type:String,default:"dataUrl"},uploadIcon:{type:String,default:"photograph"}},computed:{previewSizeWithUnit:function(){return Object(J.a)(this.previewSize)},value:function(){return this.fileList}},methods:{getDetail:function(t){return void 0===t&&(t=this.fileList.length),{name:this.name,index:t}},onChange:function(t){var e=this,i=t.target.files;if(!this.disabled&&i.length){if(i=1===i.length?i[0]:[].slice.call(i),this.beforeRead){var n=this.beforeRead(i,this.getDetail());if(!n)return void this.resetInput();if(Object(S.e)(n))return void n.then((function(t){t?e.readFile(t):e.readFile(i)})).catch(this.resetInput)}this.readFile(i)}},readFile:function(t){var e=this,i=function(t,e){return Ol(t).some((function(t){return t.size>e}))}(t,this.maxSize);if(Array.isArray(t)){var n=this.maxCount-this.fileList.length;t.length>n&&(t=t.slice(0,n)),Promise.all(t.map((function(t){return Tl(t,e.resultType)}))).then((function(n){var s=t.map((function(t,e){var i={file:t,status:""};return n[e]&&(i.content=n[e]),i}));e.onAfterRead(s,i)}))}else Tl(t,this.resultType).then((function(n){var s={file:t,status:""};n&&(s.content=n),e.onAfterRead(s,i)}))},onAfterRead:function(t,e){this.resetInput(),e?this.$emit("oversize",t,this.getDetail()):(this.$emit("input",[].concat(this.fileList,Ol(t))),this.afterRead&&this.afterRead(t,this.getDetail()))},onDelete:function(t,e){var i=this;if(this.beforeDelete){var n=this.beforeDelete(t,this.getDetail(e));if(!n)return;if(Object(S.e)(n))return void n.then((function(){i.deleteFile(t,e)})).catch(S.g)}this.deleteFile(t,e)},deleteFile:function(t,e){var i=this.fileList.slice(0);i.splice(e,1),this.$emit("input",i),this.$emit("delete",t,this.getDetail(e))},resetInput:function(){this.$refs.input&&(this.$refs.input.value="")},onPreviewImage:function(t){var e=this;if(this.previewFullImage){var i=this.fileList.filter((function(t){return Il(t)})),n=i.map((function(t){return t.content||t.url}));this.imagePreview=Xr({images:n,closeOnPopstate:!0,startPosition:i.indexOf(t),onClose:function(){e.$emit("close-preview")}})}},closeImagePreview:function(){this.imagePreview&&this.imagePreview.close()},chooseFile:function(){this.disabled||this.$refs.input&&this.$refs.input.click()},genPreviewMask:function(t){var e=this.$createElement,i=t.status;if("uploading"===i||"failed"===i){var n="failed"===i?e(ct,{attrs:{name:"warning-o"},class:Dl("mask-icon")}):e(kt,{class:Dl("loading")});return e("div",{class:Dl("mask")},[n,t.message&&e("div",{class:Dl("mask-message")},[t.message])])}},genPreviewItem:function(t,e){var i=this,n=this.$createElement,s="uploading"!==t.status&&this.deletable&&n(ct,{attrs:{name:"clear"},class:Dl("preview-delete"),on:{click:function(n){n.stopPropagation(),i.onDelete(t,e)}}}),r=Il(t)?n(Ui,{attrs:{fit:this.imageFit,src:t.content||t.url,width:this.previewSize,height:this.previewSize},class:Dl("preview-image"),on:{click:function(){i.onPreviewImage(t)}}}):n("div",{class:Dl("file"),style:{width:this.previewSizeWithUnit,height:this.previewSizeWithUnit}},[n(ct,{class:Dl("file-icon"),attrs:{name:"description"}}),n("div",{class:[Dl("file-name"),"van-ellipsis"]},[t.file?t.file.name:t.url])]);return n("div",{class:Dl("preview"),on:{click:function(){i.$emit("click-preview",t,i.getDetail(e))}}},[r,this.genPreviewMask(t),s])},genPreviewList:function(){if(this.previewImage)return this.fileList.map(this.genPreviewItem)},genUpload:function(){var t=this.$createElement;if(!(this.fileList.length>=this.maxCount)&&this.showUpload){var e,i=this.slots(),s=t("input",{attrs:n({},this.$attrs,{type:"file",accept:this.accept,disabled:this.disabled}),ref:"input",class:Dl("input"),on:{change:this.onChange}});if(i)return t("div",{class:Dl("input-wrapper")},[i,s]);if(this.previewSize){var r=this.previewSizeWithUnit;e={width:r,height:r}}return t("div",{class:Dl("upload"),style:e},[t(ct,{attrs:{name:this.uploadIcon},class:Dl("upload-icon")}),this.uploadText&&t("span",{class:Dl("upload-text")},[this.uploadText]),s])}}},render:function(){var t=arguments[0];return t("div",{class:Dl()},[t("div",{class:Dl("wrapper",{disabled:this.disabled})},[this.genPreviewList(),this.genUpload()])])}}),El=Object(o.a)("sku-img-uploader"),Ll=El[0],Pl=El[1],Al=El[2],Ml=Ll({props:{value:String,uploadImg:Function,maxSize:{type:Number,default:6}},data:function(){return{paddingImg:"",uploadFail:!1}},methods:{afterReadFile:function(t){var e=this;this.paddingImg=t.content,this.uploadFail=!1,this.uploadImg(t.file,t.content).then((function(t){e.$emit("input",t),e.$nextTick((function(){e.paddingImg=""}))})).catch((function(){e.uploadFail=!0}))},onOversize:function(){this.$toast(Al("oversize",this.maxSize))},genUploader:function(t,e){void 0===e&&(e=!1);var i=this.$createElement;return i(Nl,{class:Pl("uploader"),attrs:{disabled:e,afterRead:this.afterReadFile,maxSize:1024*this.maxSize*1024},on:{oversize:this.onOversize}},[i("div",{class:Pl("img")},[t])])},genMask:function(){var t=this.$createElement;return t("div",{class:Pl("mask")},[this.uploadFail?[t(ct,{attrs:{name:"warning-o",size:"20px"}}),t("div",{class:Pl("warn-text"),domProps:{innerHTML:Al("fail")}})]:t(kt,{attrs:{type:"spinner",size:"20px",color:"white"}})])}},render:function(){var t=this,e=arguments[0];return e("div",{class:Pl()},[this.value&&this.genUploader([e("img",{attrs:{src:this.value}}),e(ct,{attrs:{name:"clear"},class:Pl("delete"),on:{click:function(){t.$emit("input","")}}})],!0),this.paddingImg&&this.genUploader([e("img",{attrs:{src:this.paddingImg}}),this.genMask()],!this.uploadFail),!this.value&&!this.paddingImg&&this.genUploader(e("div",{class:Pl("trigger")},[e(ct,{attrs:{name:"photograph",size:"22px"}})]))])}}),zl=Object(o.a)("sku-messages"),Fl=zl[0],Vl=zl[1],Rl=zl[2],_l=Fl({props:{messages:{type:Array,default:function(){return[]}},messageConfig:Object,goodsId:[Number,String]},data:function(){return{messageValues:this.resetMessageValues(this.messages)}},watch:{messages:function(t){this.messageValues=this.resetMessageValues(t)}},methods:{resetMessageValues:function(t){var e=this.messageConfig.initialMessages,i=void 0===e?{}:e;return(t||[]).map((function(t){return{value:i[t.name]||""}}))},getType:function(t){return 1==+t.multiple?"textarea":"id_no"===t.type?"text":t.datetime>0?"datetime-local":t.type},getMessages:function(){var t=this,e={};return this.messageValues.forEach((function(i,n){var s=i.value;t.messages[n].datetime>0&&(s=s.replace(/T/g," ")),e["message_"+n]=s})),e},getCartMessages:function(){var t=this,e={};return this.messageValues.forEach((function(i,n){var s=i.value,r=t.messages[n];r.datetime>0&&(s=s.replace(/T/g," ")),e[r.name]=s})),e},getPlaceholder:function(t){var e=1==+t.multiple?"textarea":t.type,i=this.messageConfig.placeholderMap||{};return t.placeholder||i[e]||Rl("placeholder."+e)},validateMessages:function(){for(var t=this.messageValues,e=0;e18))return Rl("invalid.id_no")}}},genMessage:function(t,e){var i=this,n=this.$createElement;return"image"===t.type?n(se,{key:this.goodsId+"-"+e,attrs:{title:t.name,label:Rl("imageLabel"),required:"1"===String(t.required),valueClass:Vl("image-cell-value")},class:Vl("image-cell")},[n(Ml,{attrs:{maxSize:this.messageConfig.uploadMaxSize,uploadImg:this.messageConfig.uploadImg},model:{value:i.messageValues[e].value,callback:function(t){i.$set(i.messageValues[e],"value",t)}}})]):n(le,{attrs:{maxlength:"200",label:t.name,required:"1"===String(t.required),placeholder:this.getPlaceholder(t),type:this.getType(t)},key:this.goodsId+"-"+e,model:{value:i.messageValues[e].value,callback:function(t){i.$set(i.messageValues[e],"value",t)}}})}},render:function(){var t=arguments[0];return t(sn,{class:Vl(),attrs:{border:this.messages.length>0}},[this.messages.map(this.genMessage)])}}),Hl=Object(o.a)("sku-actions"),Wl=Hl[0],ql=Hl[1],Yl=Hl[2];function Ul(t,e,i,n){var s=function(t){return function(){e.skuEventBus.$emit(t)}};return t("div",r()([{class:ql()},h(n)]),[e.showAddCartBtn&&t($e,{attrs:{size:"large",type:"warning",text:e.addCartText||Yl("addCart")},on:{click:s("sku:addCart")}}),t($e,{attrs:{size:"large",type:"danger",text:e.buyText||Yl("buy")},on:{click:s("sku:buy")}})])}Ul.props={buyText:String,addCartText:String,skuEventBus:Object,showAddCartBtn:Boolean};var Kl=Wl(Ul),Xl=Object(o.a)("sku"),Ql=Xl[0],Gl=Xl[1],Zl=Xl[2],Jl=Va.QUOTA_LIMIT,tu=Ql({props:{sku:Object,priceTag:String,goods:Object,value:Boolean,buyText:String,goodsId:[Number,String],hideStock:Boolean,addCartText:String,stepperTitle:String,getContainer:[String,Function],hideQuotaText:Boolean,hideSelectedText:Boolean,resetStepperOnHide:Boolean,customSkuValidator:Function,closeOnClickOverlay:Boolean,disableStepperInput:Boolean,safeAreaInsetBottom:Boolean,resetSelectedSkuOnHide:Boolean,properties:Array,quota:{type:Number,default:0},quotaUsed:{type:Number,default:0},startSaleNum:{type:Number,default:1},initialSku:{type:Object,default:function(){return{}}},stockThreshold:{type:Number,default:50},showSoldoutSku:{type:Boolean,default:!0},showAddCartBtn:{type:Boolean,default:!0},bodyOffsetTop:{type:Number,default:200},messageConfig:{type:Object,default:function(){return{initialMessages:{},placeholderMap:{},uploadImg:function(){return Promise.resolve()},uploadMaxSize:5}}},customStepperConfig:{type:Object,default:function(){return{}}},previewOnClickImage:{type:Boolean,default:!0}},data:function(){return{selectedSku:{},selectedProp:{},selectedNum:1,show:this.value}},watch:{show:function(t){this.$emit("input",t),t||(this.$emit("sku-close",{selectedSkuValues:this.selectedSkuValues,selectedNum:this.selectedNum,selectedSkuComb:this.selectedSkuComb}),this.resetStepperOnHide&&this.resetStepper(),this.resetSelectedSkuOnHide&&this.resetSelectedSku())},value:function(t){this.show=t},skuTree:"resetSelectedSku",initialSku:function(){this.resetStepper(),this.resetSelectedSku()}},computed:{skuGroupClass:function(){return["van-sku-group-container",{"van-sku-group-container--hide-soldout":!this.showSoldoutSku}]},bodyStyle:function(){if(!this.$isServer)return{maxHeight:window.innerHeight-this.bodyOffsetTop+"px"}},isSkuCombSelected:function(){var t=this;return!(this.hasSku&&!Ha(this.skuTree,this.selectedSku))&&!this.propList.some((function(e){return(t.selectedProp[e.k_id]||[]).length<1}))},isSkuEmpty:function(){return 0===Object.keys(this.sku).length},hasSku:function(){return!this.sku.none_sku},hasSkuOrAttr:function(){return this.hasSku||this.propList.length>0},selectedSkuComb:function(){var t=null;return this.isSkuCombSelected&&(t=this.hasSku?Wa(this.sku.list,this.selectedSku):{id:this.sku.collection_id,price:Math.round(100*this.sku.price),stock_num:this.sku.stock_num})&&(t.properties=Ka(this.propList,this.selectedProp),t.property_price=this.selectedPropValues.reduce((function(t,e){return t+(e.price||0)}),0)),t},selectedSkuValues:function(){return qa(this.skuTree,this.selectedSku)},selectedPropValues:function(){return Ua(this.propList,this.selectedProp)},price:function(){return this.selectedSkuComb?((this.selectedSkuComb.price+this.selectedSkuComb.property_price)/100).toFixed(2):this.sku.price},originPrice:function(){return this.selectedSkuComb&&this.selectedSkuComb.origin_price?((this.selectedSkuComb.origin_price+this.selectedSkuComb.property_price)/100).toFixed(2):this.sku.origin_price},skuTree:function(){return this.sku.tree||[]},propList:function(){return this.properties||[]},imageList:function(){var t=[this.goods.picture];return this.skuTree.length>0&&this.skuTree.forEach((function(e){e.v&&e.v.forEach((function(e){var i=e.previewImgUrl||e.imgUrl||e.img_url;i&&t.push(i)}))})),t},stock:function(){var t=this.customStepperConfig.stockNum;return void 0!==t?t:this.selectedSkuComb?this.selectedSkuComb.stock_num:this.sku.stock_num},stockText:function(){var t=this.$createElement,e=this.customStepperConfig.stockFormatter;return e?e(this.stock):[Zl("stock")+" ",t("span",{class:Gl("stock-num",{highlight:this.stock0&&this.$nextTick((function(){t.$emit("sku-selected",{skuValue:e[e.length-1],selectedSku:t.selectedSku,selectedSkuComb:t.selectedSkuComb})})),this.selectedProp={};var i=this.initialSku.selectedProp,n=void 0===i?{}:i;this.propList.forEach((function(e){e.v&&1===e.v.length?t.selectedProp[e.k_id]=[e.v[0].id]:n[e.k_id]&&(t.selectedProp[e.k_id]=n[e.k_id])}));var s=this.selectedPropValues;s.length>0&&this.$emit("sku-prop-selected",{propValue:s[s.length-1],selectedProp:this.selectedProp,selectedSkuComb:this.selectedSkuComb})},getSkuMessages:function(){return this.$refs.skuMessages?this.$refs.skuMessages.getMessages():{}},getSkuCartMessages:function(){return this.$refs.skuMessages?this.$refs.skuMessages.getCartMessages():{}},validateSkuMessages:function(){return this.$refs.skuMessages?this.$refs.skuMessages.validateMessages():""},validateSku:function(){if(0===this.selectedNum)return Zl("unavailable");if(this.isSkuCombSelected)return this.validateSkuMessages();if(this.customSkuValidator){var t=this.customSkuValidator(this);if(t)return t}return Zl("selectSku")},onSelect:function(t){var e,i;this.selectedSku=this.selectedSku[t.skuKeyStr]===t.id?n({},this.selectedSku,((e={})[t.skuKeyStr]="",e)):n({},this.selectedSku,((i={})[t.skuKeyStr]=t.id,i)),this.$emit("sku-selected",{skuValue:t,selectedSku:this.selectedSku,selectedSkuComb:this.selectedSkuComb})},onPropSelect:function(t){var e,i=this.selectedProp[t.skuKeyStr]||[],s=i.indexOf(t.id);s>-1?i.splice(s,1):t.multiple?i.push(t.id):i.splice(0,1,t.id),this.selectedProp=n({},this.selectedProp,((e={})[t.skuKeyStr]=i,e)),this.$emit("sku-prop-selected",{propValue:t,selectedProp:this.selectedProp,selectedSkuComb:this.selectedSkuComb})},onNumChange:function(t){this.selectedNum=t},onPreviewImage:function(t){var e=this,i=this.previewOnClickImage,n=this.imageList.findIndex((function(e){return e===t})),s={index:n,imageList:this.imageList,indexImage:t};this.$emit("open-preview",s),i&&Xr({images:this.imageList,startPosition:n,closeOnPopstate:!0,onClose:function(){e.$emit("close-preview",s)}})},onOverLimit:function(t){var e=t.action,i=t.limitType,n=t.quota,s=t.quotaUsed,r=this.customStepperConfig.handleOverLimit;r?r(t):"minus"===e?this.startSaleNum>1?ke(Zl("minusStartTip",this.startSaleNum)):ke(Zl("minusTip")):"plus"===e&&ke(i===Jl?s>0?Zl("quotaUsedTip",n,s):Zl("quotaTip",n):Zl("soldout"))},onStepperState:function(t){t.valid?this.stepperError=null:this.stepperError=n({},t,{action:"plus"})},onAddCart:function(){this.onBuyOrAddCart("add-cart")},onBuy:function(){this.onBuyOrAddCart("buy-clicked")},onBuyOrAddCart:function(t){if(this.stepperError)return this.onOverLimit(this.stepperError);var e=this.validateSku();e?ke(e):this.$emit(t,this.getSkuData())},getSkuData:function(){return{goodsId:this.goodsId,selectedNum:this.selectedNum,selectedSkuComb:this.selectedSkuComb,messages:this.getSkuMessages(),cartMessages:this.getSkuCartMessages()}}},render:function(){var t=this,e=arguments[0];if(!this.isSkuEmpty){var i=this.sku,n=this.goods,s=this.price,r=this.originPrice,o=this.skuEventBus,a=this.selectedSku,l=this.selectedProp,u=this.selectedNum,c=this.stepperTitle,h=this.selectedSkuComb,d={price:s,originPrice:r,selectedNum:u,skuEventBus:o,selectedSku:a,selectedSkuComb:h},f=function(e){return t.slots(e,d)},p=f("sku-header")||e(tl,{attrs:{sku:i,goods:n,skuEventBus:o,selectedSku:a}},[e("template",{slot:"sku-header-image-extra"},[f("sku-header-image-extra")]),f("sku-header-price")||e("div",{class:"van-sku__goods-price"},[e("span",{class:"van-sku__price-symbol"},["¥"]),e("span",{class:"van-sku__price-num"},[s]),this.priceTag&&e("span",{class:"van-sku__price-tag"},[this.priceTag])]),f("sku-header-origin-price")||r&&e(sl,[Zl("originPrice")," ¥",r]),!this.hideStock&&e(sl,[e("span",{class:"van-sku__stock"},[this.stockText])]),this.hasSkuOrAttr&&!this.hideSelectedText&&e(sl,[this.selectedText]),f("sku-header-extra")]),m=f("sku-group")||this.hasSkuOrAttr&&e("div",{class:this.skuGroupClass},[this.skuTree.map((function(t){return e(cl,{attrs:{skuRow:t}},[t.v.map((function(n){return e(hl,{attrs:{skuList:i.list,skuValue:n,selectedSku:a,skuEventBus:o,skuKeyStr:t.k_s}})}))])})),this.propList.map((function(t){return e(cl,{attrs:{skuRow:t}},[t.v.map((function(i){return e(dl,{attrs:{skuValue:i,skuKeyStr:t.k_id+"",selectedProp:l,skuEventBus:o,multiple:t.is_multiple}})}))])}))]),v=f("sku-stepper")||e(wl,{ref:"skuStepper",attrs:{stock:this.stock,quota:this.quota,quotaUsed:this.quotaUsed,startSaleNum:this.startSaleNum,skuEventBus:o,selectedNum:u,selectedSku:a,stepperTitle:c,skuStockNum:i.stock_num,disableStepperInput:this.disableStepperInput,customStepperConfig:this.customStepperConfig,hideQuotaText:this.hideQuotaText},on:{change:function(e){t.$emit("stepper-change",e)}}}),g=f("sku-messages")||e(_l,{ref:"skuMessages",attrs:{goodsId:this.goodsId,messageConfig:this.messageConfig,messages:i.messages}}),b=f("sku-actions")||e(Kl,{attrs:{buyText:this.buyText,skuEventBus:o,addCartText:this.addCartText,showAddCartBtn:this.showAddCartBtn}});return e(pt,{attrs:{round:!0,closeable:!0,position:"bottom",getContainer:this.getContainer,closeOnClickOverlay:this.closeOnClickOverlay,safeAreaInsetBottom:this.safeAreaInsetBottom},class:"van-sku-container",model:{value:t.show,callback:function(e){t.show=e}}},[p,e("div",{class:"van-sku-body",style:this.bodyStyle},[f("sku-body-top"),m,f("extra-sku-group"),v,g]),f("sku-actions-top"),b])}}});ho.a.add({"zh-CN":{vanSku:{select:"选择",selected:"已选",selectSku:"请先选择商品规格",soldout:"库存不足",originPrice:"原价",minusTip:"至少选择一件",minusStartTip:function(t){return t+"件起售"},unavailable:"商品已经无法购买啦",stock:"剩余",stockUnit:"件",quotaTip:function(t){return"每人限购"+t+"件"},quotaUsedTip:function(t,e){return"每人限购"+t+"件,你已购买"+e+"件"}},vanSkuActions:{buy:"立即购买",addCart:"加入购物车"},vanSkuImgUploader:{oversize:function(t){return"最大可上传图片为"+t+"MB,请尝试压缩图片尺寸"},fail:"上传失败
重新上传"},vanSkuStepper:{quotaLimit:function(t){return"限购"+t+"件"},quotaStart:function(t){return t+"件起售"},comma:",",num:"购买数量"},vanSkuMessages:{fill:"请填写",upload:"请上传",imageLabel:"仅限一张",invalid:{tel:"请填写正确的数字格式留言",mobile:"手机号长度为6-20位数字",email:"请填写正确的邮箱",id_no:"请填写正确的身份证号码"},placeholder:{id_no:"输入身份证号码",text:"输入文本",tel:"输入数字",email:"输入邮箱",date:"点击选择日期",time:"点击选择时间",textarea:"点击填写段落文本",mobile:"输入手机号码"}},vanSkuRow:{multiple:"可多选"}}}),tu.SkuActions=Kl,tu.SkuHeader=tl,tu.SkuHeaderItem=sl,tu.SkuMessages=_l,tu.SkuStepper=wl,tu.SkuRow=cl,tu.SkuRowItem=hl,tu.SkuRowPropItem=dl,tu.skuHelper=Xa,tu.skuConstants=Ra;var eu=tu,iu=Object(o.a)("slider"),nu=iu[0],su=iu[1],ru=nu({mixins:[U,_e],props:{disabled:Boolean,vertical:Boolean,barHeight:[Number,String],buttonSize:[Number,String],activeColor:String,inactiveColor:String,min:{type:[Number,String],default:0},max:{type:[Number,String],default:100},step:{type:[Number,String],default:1},value:{type:Number,default:0}},data:function(){return{dragStatus:""}},computed:{range:function(){return this.max-this.min},buttonStyle:function(){if(this.buttonSize){var t=Object(J.a)(this.buttonSize);return{width:t,height:t}}}},created:function(){this.updateValue(this.value)},mounted:function(){this.bindTouchEvent(this.$refs.wrapper)},methods:{onTouchStart:function(t){this.disabled||(this.touchStart(t),this.startValue=this.format(this.value),this.dragStatus="start")},onTouchMove:function(t){if(!this.disabled){"start"===this.dragStatus&&this.$emit("drag-start"),T(t,!0),this.touchMove(t),this.dragStatus="draging";var e=this.$el.getBoundingClientRect(),i=(this.vertical?this.deltaY:this.deltaX)/(this.vertical?e.height:e.width)*this.range;this.newValue=this.startValue+i,this.updateValue(this.newValue)}},onTouchEnd:function(){this.disabled||("draging"===this.dragStatus&&(this.updateValue(this.newValue,!0),this.$emit("drag-end")),this.dragStatus="")},onClick:function(t){if(t.stopPropagation(),!this.disabled){var e=this.$el.getBoundingClientRect(),i=this.vertical?t.clientY-e.top:t.clientX-e.left,n=this.vertical?e.height:e.width,s=+this.min+i/n*this.range;this.startValue=this.value,this.updateValue(s,!0)}},updateValue:function(t,e){(t=this.format(t))!==this.value&&this.$emit("input",t),e&&t!==this.startValue&&this.$emit("change",t)},format:function(t){return Math.round(Math.max(this.min,Math.min(t,this.max))/this.step)*this.step}},render:function(){var t,e=arguments[0],i=this.vertical,n={background:this.inactiveColor},s=i?"height":"width",r=i?"width":"height",o=((t={})[s]=100*(this.value-this.min)/this.range+"%",t[r]=Object(J.a)(this.barHeight),t.background=this.activeColor,t);return this.dragStatus&&(o.transition="none"),e("div",{style:n,class:su({disabled:this.disabled,vertical:i}),on:{click:this.onClick}},[e("div",{class:su("bar"),style:o},[e("div",{ref:"wrapper",attrs:{role:"slider",tabindex:this.disabled?-1:0,"aria-valuemin":this.min,"aria-valuenow":this.value,"aria-valuemax":this.max,"aria-orientation":this.vertical?"vertical":"horizontal"},class:su("button-wrapper")},[this.slots("button")||e("div",{class:su("button"),style:this.buttonStyle})])])])}}),ou=Object(o.a)("step"),au=ou[0],lu=ou[1],uu=au({mixins:[si("vanSteps")],computed:{status:function(){return this.index0?"left":"right"),this.dragging=!1,setTimeout((function(){t.lockClick=!1}),0))},toggle:function(t){var e=Math.abs(this.offset),i=this.opened?.85:.15,n=this.computedLeftWidth,s=this.computedRightWidth;s&&"right"===t&&e>s*i?this.open("right"):n&&"left"===t&&e>n*i?this.open("left"):this.close()},onClick:function(t){void 0===t&&(t="outside"),this.$emit("click",t),this.opened&&!this.lockClick&&(this.beforeClose?this.beforeClose({position:t,name:this.name,instance:this}):this.onClose?this.onClose(t,this,{name:this.name}):this.close(t))},getClickHandler:function(t,e){var i=this;return function(n){e&&n.stopPropagation(),i.onClick(t)}},genLeftPart:function(){var t=this.$createElement,e=this.slots("left");if(e)return t("div",{ref:"left",class:xu("left"),on:{click:this.getClickHandler("left",!0)}},[e])},genRightPart:function(){var t=this.$createElement,e=this.slots("right");if(e)return t("div",{ref:"right",class:xu("right"),on:{click:this.getClickHandler("right",!0)}},[e])}},render:function(){var t=arguments[0],e={transform:"translate3d("+this.offset+"px, 0, 0)",transitionDuration:this.dragging?"0s":".6s"};return t("div",{class:xu(),on:{click:this.getClickHandler("cell")}},[t("div",{class:xu("wrapper"),style:e},[this.genLeftPart(),this.slots(),this.genRightPart()])])}}),Cu=Object(o.a)("tabbar"),Ou=Cu[0],Tu=Cu[1],$u=Ou({mixins:[ri("vanTabbar")],props:{route:Boolean,zIndex:[Number,String],activeColor:String,inactiveColor:String,safeAreaInsetBottom:Boolean,value:{type:[Number,String],default:0},border:{type:Boolean,default:!0},fixed:{type:Boolean,default:!0}},watch:{value:"setActiveItem",children:"setActiveItem"},methods:{setActiveItem:function(){var t=this;this.children.forEach((function(e,i){e.active=(e.name||i)===t.value}))},onChange:function(t){t!==this.value&&(this.$emit("input",t),this.$emit("change",t))}},render:function(){var t,e=arguments[0];return e("div",{style:{zIndex:this.zIndex},class:[(t={},t[b]=this.border,t),Tu({fixed:this.fixed,"safe-area-inset-bottom":this.safeAreaInsetBottom})]},[this.slots()])}}),Iu=Object(o.a)("tabbar-item"),Bu=Iu[0],ju=Iu[1],Du=Bu({mixins:[si("vanTabbar")],props:n({},Zt,{dot:Boolean,icon:String,name:[Number,String],info:[Number,String],badge:[Number,String],iconPrefix:String}),data:function(){return{active:!1}},computed:{routeActive:function(){var t=this.to,e=this.$route;if(t&&e){var i=Object(S.d)(t)?t:{path:t},n=i.path===e.path,s=Object(S.b)(i.name)&&i.name===e.name;return n||s}}},methods:{onClick:function(t){this.parent.onChange(this.name||this.index),this.$emit("click",t),Qt(this.$router,this)},genIcon:function(t){var e=this.$createElement,i=this.slots("icon",{active:t});return i||(this.icon?e(ct,{attrs:{name:this.icon,classPrefix:this.iconPrefix}}):void 0)}},render:function(){var t=arguments[0],e=this.parent.route?this.routeActive:this.active,i=this.parent[e?"activeColor":"inactiveColor"];return t("div",{class:ju({active:e}),style:{color:i},on:{click:this.onClick}},[t("div",{class:ju("icon")},[this.genIcon(e),t(st,{attrs:{dot:this.dot,info:Object(S.b)(this.badge)?this.badge:this.info}})]),t("div",{class:ju("text")},[this.slots("default",{active:e})])])}}),Nu=Object(o.a)("tree-select"),Eu=Nu[0],Lu=Nu[1];function Pu(t,e,i,n){var s=e.height,o=e.items,a=e.mainActiveIndex,l=e.activeId,u=(o[+a]||{}).children||[],c=Array.isArray(l);function f(t){return c?-1!==l.indexOf(t):l===t}var p=o.map((function(e){return t(La,{attrs:{dot:e.dot,info:Object(S.b)(e.badge)?e.badge:e.info,title:e.text,disabled:e.disabled},class:[Lu("nav-item"),e.className]})}));return t("div",r()([{class:Lu(),style:{height:Object(J.a)(s)}},h(n)]),[t(ja,{class:Lu("nav"),attrs:{activeKey:a},on:{change:function(t){d(n,"update:main-active-index",t),d(n,"click-nav",t),d(n,"navclick",t)}}},[p]),t("div",{class:Lu("content")},[i.content?i.content():u.map((function(i){return t("div",{key:i.id,class:["van-ellipsis",Lu("item",{active:f(i.id),disabled:i.disabled})],on:{click:function(){if(!i.disabled){var t=i.id;if(c){var s=(t=l.slice()).indexOf(i.id);-1!==s?t.splice(s,1):t.length




© 2015 - 2025 Weber Informatics LLC | Privacy Policy