vant.min.js 173 KB

1234567
  1. !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)}(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,"d",function(){return s}),i.d(e,"e",function(){return o}),i.d(e,"b",function(){return r}),i.d(e,"c",function(){return a}),i.d(e,"a",function(){return u});var n=i(2),s=i.n(n).a.prototype.$isServer;function o(){}function r(t){return null!=t}function a(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}function u(t,e){var i=e.split("."),n=t;return i.forEach(function(t){n=r(n[t])?n[t]:""}),n}},function(t,e,i){"use strict";function n(){return(n=Object.assign||function(t){for(var e,i=1;i<arguments.length;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)}var s=["attrs","props","domProps"],o=["class","style","directives"],r=["on","nativeOn"],a=function(t,e){return function(){t&&t.apply(this,arguments),e&&e.apply(this,arguments)}};t.exports=function(t){return t.reduce(function(t,e){for(var i in e)if(t[i])if(-1!==s.indexOf(i))t[i]=n({},t[i],e[i]);else if(-1!==o.indexOf(i)){var u=t[i]instanceof Array?t[i]:[t[i]],l=e[i]instanceof Array?e[i]:[e[i]];t[i]=u.concat(l)}else if(-1!==r.indexOf(i))for(var c in e[i])if(t[i][c]){var h=t[i][c]instanceof Array?t[i][c]:[t[i][c]],d=e[i][c]instanceof Array?e[i][c]:[e[i][c]];t[i][c]=h.concat(d)}else t[i][c]=e[i][c];else if("hook"==i)for(var f in e[i])t[i][f]=t[i][f]?a(t[i][f],e[i][f]):e[i][f];else t[i]=e[i];else t[i]=e[i];return t},{})}},function(e,i){e.exports=t},function(t,e,i){"use strict";i.d(e,"a",function(){return s}),i.d(e,"b",function(){return o});var n=/-(\w)/g;function s(t){return t.replace(n,function(t,e){return e.toUpperCase()})}function o(t,e){void 0===e&&(e=2);for(var i=t+"";i.length<e;)i="0"+i;return i}},function(t,e,i){"use strict";(function(t){i.d(e,"c",function(){return u}),i.d(e,"b",function(){return l}),i.d(e,"a",function(){return c});var n=i(0),s=Date.now();var o=n.d?t:window,r=o.requestAnimationFrame||function(t){var e=Date.now(),i=Math.max(0,16-(e-s)),n=setTimeout(t,i);return s=e+i,n},a=o.cancelAnimationFrame||o.clearTimeout;function u(t){return r.call(o,t)}function l(t){u(function(){u(t)})}function c(t){a.call(o,t)}}).call(this,i(11))},function(t,e,i){"use strict";var n=i(2),s=i.n(n),o=i(6),r=s.a.prototype,a=s.a.util.defineReactive;a(r,"$vantLang","zh-CN"),a(r,"$vantMessages",{"zh-CN":{name:"姓名",tel:"电话",save:"保存",confirm:"确认",cancel:"取消",delete:"删除",complete:"完成",loading:"加载中...",telEmpty:"请填写电话",nameEmpty:"请填写姓名",confirmDelete:"确定要删除么",telInvalid:"请填写正确的电话",vanContactCard:{addText:"添加联系人"},vanContactList:{addText:"新建联系人"},vanPagination:{prev:"上一页",next:"下一页"},vanPullRefresh:{pulling:"下拉即可刷新...",loosing:"释放即可刷新..."},vanSubmitBar:{label:"合计:"},vanCoupon:{valid:"有效期",unlimited:"无使用门槛",discount:function(t){return t+"折"},condition:function(t){return"满"+t+"元可用"}},vanCouponCell:{title:"优惠券",tips:"使用优惠",count:function(t){return t+"张可用"}},vanCouponList:{empty:"暂无优惠券",exchange:"兑换",close:"不使用优惠",enable:"可使用优惠券",disabled:"不可使用优惠券",placeholder:"请输入优惠码"},vanAddressEdit:{area:"地区",postal:"邮政编码",areaEmpty:"请选择地区",addressEmpty:"请填写详细地址",postalEmpty:"邮政编码格式不正确",defaultAddress:"设为默认收货地址",telPlaceholder:"收货人手机号",namePlaceholder:"收货人姓名",areaPlaceholder:"选择省 / 市 / 区"},vanAddressEditDetail:{label:"详细地址",placeholder:"街道门牌、楼层房间号等信息"},vanAddressList:{add:"新增地址"}}});e.a={messages:function(){return r.$vantMessages[r.$vantLang]},use:function(t,e){var i;r.$vantLang=t,this.add(((i={})[t]=e,i))},add:function(t){void 0===t&&(t={}),Object(o.a)(r.$vantMessages,t)}}},function(t,e,i){"use strict";i.d(e,"a",function(){return o});var n=i(0),s=Object.prototype.hasOwnProperty;function o(t,e){return Object.keys(e).forEach(function(i){!function(t,e,i){var r=e[i];Object(n.b)(r)&&(s.call(t,i)&&Object(n.c)(r)&&"function"!=typeof r?t[i]=o(Object(t[i]),e[i]):t[i]=r)}(t,e,i)}),t}},function(t,e,i){"use strict";function n(t){return/^\d+(\.\d+)?$/.test(t)}i.d(e,"a",function(){return n})},function(t,e,i){"use strict";i.d(e,"a",function(){return o});var n=i(0),s=i(7);function o(t){if(Object(n.b)(t))return t=String(t),Object(s.a)(t)?t+"px":t}},function(t,e,i){"use strict";var n="__",s="--";function o(t,e,i){return e?t+i+e:t}function r(t,e){if("string"==typeof e)return o(t,e,s);if(Array.isArray(e))return e.map(function(e){return r(t,e)});var i={};return e&&Object.keys(e).forEach(function(n){i[t+s+n]=e[n]}),i}function a(t){return function(e,i){return e&&"string"!=typeof e&&(i=e,e=""),e=o(t,e,n),i?[e,r(e,i)]:e}}var u=i(3),l=i(2),c=i.n(l).a.extend({methods:{slots:function(t,e){void 0===t&&(t="default");var i=this.$slots,n=this.$scopedSlots[t];return n?n(e):i[t]}}});function h(t){var e=this.name;t.component(e,this),t.component(Object(u.a)("-"+e),this)}function d(t){return{functional:!0,props:t.props,model:t.model,render:function(e,i){return t(e,i.props,function(t){var e=t.scopedSlots||t.data.scopedSlots||{},i=t.slots();return Object.keys(i).forEach(function(t){e[t]||(e[t]=function(){return i[t]})}),e}(i),i)}}}function f(t){return function(e){return"function"==typeof e&&(e=d(e)),e.functional||(e.mixins=e.mixins||[],e.mixins.push(c)),e.name=t,e.install=h,e}}var p=i(0),m=i(5);function v(t){var e=Object(u.a)(t)+".";return function(t){for(var i=Object(p.a)(m.a.messages(),e+t)||Object(p.a)(m.a.messages(),t),n=arguments.length,s=new Array(n>1?n-1:0),o=1;o<n;o++)s[o-1]=arguments[o];return"function"==typeof i?i.apply(void 0,s):i}}function g(t){return[f(t="van-"+t),a(t),v(t)]}i.d(e,"a",function(){return g})},function(t,e,i){
  2. /*!
  3. * Vue-Lazyload.js v1.2.3
  4. * (c) 2018 Awe <hilongjw@gmail.com>
  5. * Released under the MIT License.
  6. */
  7. t.exports=function(){"use strict";function t(t){t=t||{};var n=arguments.length,s=0;if(1===n)return t;for(;++s<n;){var o=arguments[s];d(t)&&(t=o),i(o)&&e(t,o)}return t}function e(e,s){for(var o in f(e,s),s)if("__proto__"!==o&&n(s,o)){var r=s[o];i(r)?("undefined"===m(e[o])&&"function"===m(r)&&(e[o]=r),e[o]=t(e[o]||{},r)):e[o]=r}return e}function i(t){return"object"===m(t)||"function"===m(t)}function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function s(t,e){if(t.length){var i=t.indexOf(e);return i>-1?t.splice(i,1):void 0}}function o(t,e){if("IMG"===t.tagName&&t.getAttribute("data-srcset")){var i=t.getAttribute("data-srcset"),n=[],s=t.parentNode,o=s.offsetWidth*e,r=void 0,a=void 0,u=void 0;(i=i.trim().split(",")).map(function(t){t=t.trim(),-1===(r=t.lastIndexOf(" "))?(a=t,u=999998):(a=t.substr(0,r),u=parseInt(t.substr(r+1,t.length-r-2),10)),n.push([u,a])}),n.sort(function(t,e){if(t[0]<e[0])return-1;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="",c=void 0,h=n.length,d=0;d<h;d++)if((c=n[d])[0]>=o){l=c[1];break}return l}}function r(t,e){for(var i=void 0,n=0,s=t.length;n<s;n++)if(e(t[n])){i=t[n];break}return i}function a(){if(!g)return!1;var t=!0,e=document;try{var i=e.createElement("object");i.type="image/webp",i.style.visibility="hidden",i.innerHTML="!",e.body.appendChild(i),t=!i.offsetWidth,e.body.removeChild(i)}catch(e){t=!1}return t}function u(){}var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},h=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),d=function(t){return null==t||"function"!=typeof t&&"object"!==(void 0===t?"undefined":l(t))},f=function(t,e){if(null==t)throw new TypeError("expected first argument to be an object.");if(void 0===e||"undefined"==typeof Symbol)return t;if("function"!=typeof Object.getOwnPropertySymbols)return t;for(var i=Object.prototype.propertyIsEnumerable,n=Object(t),s=arguments.length,o=0;++o<s;)for(var r=Object(arguments[o]),a=Object.getOwnPropertySymbols(r),u=0;u<a.length;u++){var l=a[u];i.call(r,l)&&(n[l]=r[l])}return n},p=Object.prototype.toString,m=function(t){var e=void 0===t?"undefined":l(t);return"undefined"===e?"undefined":null===t?"null":!0===t||!1===t||t instanceof Boolean?"boolean":"string"===e||t instanceof String?"string":"number"===e||t instanceof Number?"number":"function"===e||t instanceof Function?void 0!==t.constructor.name&&"Generator"===t.constructor.name.slice(0,9)?"generatorfunction":"function":void 0!==Array.isArray&&Array.isArray(t)?"array":t instanceof RegExp?"regexp":t instanceof Date?"date":"[object RegExp]"===(e=p.call(t))?"regexp":"[object Date]"===e?"date":"[object Arguments]"===e?"arguments":"[object Error]"===e?"error":"[object Promise]"===e?"promise":function(t){return t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}(t)?"buffer":"[object Set]"===e?"set":"[object WeakSet]"===e?"weakset":"[object Map]"===e?"map":"[object WeakMap]"===e?"weakmap":"[object Symbol]"===e?"symbol":"[object Map Iterator]"===e?"mapiterator":"[object Set Iterator]"===e?"setiterator":"[object String Iterator]"===e?"stringiterator":"[object Array Iterator]"===e?"arrayiterator":"[object Int8Array]"===e?"int8array":"[object Uint8Array]"===e?"uint8array":"[object Uint8ClampedArray]"===e?"uint8clampedarray":"[object Int16Array]"===e?"int16array":"[object Uint16Array]"===e?"uint16array":"[object Int32Array]"===e?"int32array":"[object Uint32Array]"===e?"uint32array":"[object Float32Array]"===e?"float32array":"[object Float64Array]"===e?"float64array":"object"},v=t,g="undefined"!=typeof window,b=g&&"IntersectionObserver"in window,y={event:"event",observer:"observer"},k=function(){function t(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var i=document.createEvent("CustomEvent");return i.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),i}if(g)return"function"==typeof window.CustomEvent?window.CustomEvent:(t.prototype=window.Event.prototype,t)}(),x=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return g&&window.devicePixelRatio||t},S=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}}(),w={on:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];S?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)}},C=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)}},O=function(t,e){return"undefined"!=typeof getComputedStyle?getComputedStyle(t,null).getPropertyValue(e):t.style[e]},T=function(t){return O(t,"overflow")+O(t,"overflow-y")+O(t,"overflow-x")},$={},I=function(){function t(e){var i=e.el,n=e.src,s=e.error,o=e.loading,r=e.bindType,a=e.$parent,u=e.options,l=e.elRenderer;c(this,t),this.el=i,this.src=n,this.error=s,this.loading=o,this.bindType=r,this.attempt=0,this.naturalHeight=0,this.naturalWidth=0,this.options=u,this.rect=null,this.$parent=a,this.elRenderer=l,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.top<window.innerHeight*this.options.preLoad&&this.rect.bottom>this.options.preLoadTop&&this.rect.left<window.innerWidth*this.options.preLoad&&this.rect.right>0}},{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;C({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]:u;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||$[this.src]?(this.state.loaded=!0,e(),this.render("loaded",!0)):void this.renderLoading(function(){t.attempt++,t.record("loadStart"),C({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),$[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}(),B="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",j=["scroll","wheel","mousewheel","resize","animationend","transitionend","touchmove"],N={rootMargin:"0px",threshold:0},A=function(t){return function(){function e(t){var i=t.preLoad,n=t.error,s=t.throttleWait,o=t.preLoadTop,r=t.dispatchEvent,u=t.loading,l=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.event,this.ListenerQueue=[],this.TargetIndex=0,this.TargetQueue=[],this.options={silent:d,dispatchEvent:!!r,throttleWait:s||200,preLoad:i||1.3,preLoadTop:o||0,error:n||B,loading:u||B,attempt:l||3,scale:f||x(f),ListenEvents:p||j,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,o=this,r=arguments,a=function(){n=Date.now(),i=!1,t.apply(o,r)};s>=e?a():i=setTimeout(a,e)}}}(this._lazyLoadHandler.bind(this),this.options.throttleWait),this.setMode(this.options.observer?y.observer:y.event)}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;n<s;n++)if(e(t[n])){i=!0;break}return i}(this.ListenerQueue,function(t){return t.el===e}))return this.update(e,i),t.nextTick(this.lazyLoadHandler);var r=this._valueFormatter(i.value),a=r.src,u=r.loading,l=r.error;t.nextTick(function(){a=o(e,s.options.scale)||a,s._observer&&s._observer.observe(e);var r=Object.keys(i.modifiers)[0],c=void 0;r&&(c=(c=n.context.$refs[r])?c.$el||c:document.getElementById(r)),c||(c=function(t){if(g){if(!(t instanceof HTMLElement))return window;for(var e=t;e&&e!==document.body&&e!==document.documentElement&&e.parentNode;){if(/(scroll|auto)/.test(T(e)))return e;e=e.parentNode}return window}}(e));var h=new I({bindType:i.arg,$parent:c,el:e,loading:u,error:l,src:a,elRenderer:s._elRenderer.bind(s),options:s.options});s.ListenerQueue.push(h),g&&(s._addListenerTarget(window),s._addListenerTarget(c)),s.lazyLoadHandler(),t.nextTick(function(){return s.lazyLoadHandler()})})}},{key:"update",value:function(e,i){var n=this,s=this._valueFormatter(i.value),a=s.src,u=s.loading,l=s.error;a=o(e,this.options.scale)||a;var c=r(this.ListenerQueue,function(t){return t.el===e});c&&c.update({src:a,loading:u,error:l}),this._observer&&(this._observer.unobserve(e),this._observer.observe(e)),this.lazyLoadHandler(),t.nextTick(function(){return n.lazyLoadHandler()})}},{key:"remove",value:function(t){if(t){this._observer&&this._observer.unobserve(t);var e=r(this.ListenerQueue,function(e){return e.el===t});e&&(this._removeListenerTarget(e.$parent),this._removeListenerTarget(window),s(this.ListenerQueue,e)&&e.destroy())}}},{key:"removeComponent",value:function(t){t&&(s(this.ListenerQueue,t),this._observer&&this._observer.unobserve(t.el),t.$parent&&t.$el.parentNode&&this._removeListenerTarget(t.$el.parentNode),this._removeListenerTarget(window))}},{key:"setMode",value:function(t){var e=this;b||t!==y.observer||(t=y.event),this.mode=t,t===y.event?(this._observer&&(this.ListenerQueue.forEach(function(t){e._observer.unobserve(t.el)}),this._observer=null),this.TargetQueue.forEach(function(t){e._initListen(t.el,!0)})):(this.TargetQueue.forEach(function(t){e._initListen(t.el,!1)}),this._initIntersectionObserver())}},{key:"_addListenerTarget",value:function(t){if(t){var e=r(this.TargetQueue,function(e){return e.el===t});return e?e.childrenCount++:(e={el:t,id:++this.TargetIndex,childrenCount:1,listened:!0},this.mode===y.event&&this._initListen(e.el,!0),this.TargetQueue.push(e)),this.TargetIndex}}},{key:"_removeListenerTarget",value:function(t){var e=this;this.TargetQueue.forEach(function(i,n){i.el===t&&(--i.childrenCount||(e._initListen(i.el,!1),e.TargetQueue.splice(n,1),i=null))})}},{key:"_initListen",value:function(t,e){var i=this;this.options.ListenEvents.forEach(function(n){return w[e?"on":"off"](t,n,i.lazyLoadHandler)})}},{key:"_initEvent",value:function(){var t=this;this.Event={listeners:{loading:[],loaded:[],error:[]}},this.$on=function(e,i){t.Event.listeners[e].push(i)},this.$once=function(e,i){var n=t;t.$on(e,function t(){n.$off(e,t),i.apply(n,arguments)})},this.$off=function(e,i){i?s(t.Event.listeners[e],i):t.Event.listeners[e]=[]},this.$emit=function(e,i,n){t.Event.listeners[e].forEach(function(t){return t(i,n)})}}},{key:"_lazyLoadHandler",value:function(){var t=this;this.ListenerQueue.forEach(function(e,i){e.state.loaded||e.checkInView()&&e.load(function(){!e.error&&e.loaded&&t.ListenerQueue.splice(i,1)})})}},{key:"_initIntersectionObserver",value:function(){var t=this;b&&(this._observer=new IntersectionObserver(this._observerHandler.bind(this),this.options.observerOptions),this.ListenerQueue.length&&this.ListenerQueue.forEach(function(e){t._observer.observe(e.el)}))}},{key:"_observerHandler",value:function(t,e){var i=this;t.forEach(function(t){t.isIntersecting&&i.ListenerQueue.forEach(function(e){if(e.el===t.target){if(e.state.loaded)return i._observer.unobserve(e.el);e.load()}})})}},{key:"_elRenderer",value:function(t,e,i){if(t.el){var n=t.el,s=t.bindType,o=void 0;switch(e){case"loading":o=t.loading;break;case"error":o=t.error;break;default:o=t.src}if(s?n.style[s]='url("'+o+'")':n.getAttribute("src")!==o&&n.setAttribute("src",o),n.setAttribute("lazy",e),this.$emit(e,t,i),this.options.adapter[e]&&this.options.adapter[e](t,this.options),this.options.dispatchEvent){var r=new k(e,{detail:t});n.dispatchEvent(r)}}}},{key:"_valueFormatter",value:function(t){var e=t,i=this.options.loading,n=this.options.error;return function(t){return null!==t&&"object"===(void 0===t?"undefined":l(t))}(t)&&(t.src||this.options.silent||console.error("Vue Lazyload warning: miss src with "+t),e=t.src,i=t.loading||this.options.loading,n=t.error||this.options.error),{src:e,loading:i,error:n}}}]),e}()},z=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 E({el:t,binding:e,vnode:i,lazy:this.lazy});this._queue.push(n)}},{key:"update",value:function(t,e,i){var n=r(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=r(this._queue,function(e){return e.el===t});n&&(n.clear(),s(this._queue,n))}}]),t}(),L={selector:"img"},E=function(){function t(e){var i=e.el,n=e.binding,s=e.vnode,o=e.lazy;c(this,t),this.el=null,this.vnode=s,this.binding=n,this.options={},this.lazy=o,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({},L,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;n<e;n++)i.push(t[n]);return i}(this.el.querySelectorAll(this.options.selector))}},{key:"clear",value:function(){var t=this;this.getImgs().forEach(function(e){return t.lazy.remove(e)}),this.vnode=null,this.binding=null,this.lazy=null}}]),t}();return{install:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=A(t),n=new i(e),s=new z({lazy:n}),o="2"===t.version.split(".")[0];t.prototype.$Lazyload=n,e.lazyComponent&&t.component("lazy-component",function(t){return{props:{tag:{type:String,default:"div"}},render:function(t){return!1===this.show?t(this.tag):t(this.tag,null,this.$slots.default)},data:function(){return{el:null,state:{loaded:!1},rect:{},show:!1}},mounted:function(){this.el=this.$el,t.addLazyBox(this),t.lazyLoadHandler()},beforeDestroy:function(){t.removeComponent(this)},methods:{getRect:function(){this.rect=this.$el.getBoundingClientRect()},checkInView:function(){return this.getRect(),g&&this.rect.top<window.innerHeight*t.options.preLoad&&this.rect.bottom>0&&this.rect.left<window.innerWidth*t.options.preLoad&&this.rect.right>0},load:function(){this.show=!0,this.state.loaded=!0,this.$emit("show",this)}}}}(n)),o?(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;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t}).apply(this,arguments)}i.r(e);var s=i(1),o=i.n(s),r=i(9),a=i(2),u=i.n(a),l=["ref","style","class","attrs","nativeOn","directives","staticClass","staticStyle"],c={nativeOn:"on"};function h(t,e){var i=l.reduce(function(e,i){return t.data[i]&&(e[c[i]||i]=t.data[i]),e},{});return e&&(i.on=i.on||{},n(i.on,t.data.on)),i}function d(t,e){for(var i=arguments.length,n=new Array(i>2?i-2:0),s=2;s<i;s++)n[s-2]=arguments[s];var o=t.listeners[e];o&&(Array.isArray(o)?o.forEach(function(t){t.apply(void 0,n)}):o.apply(void 0,n))}function f(t,e){var i=new u.a({el:document.createElement("div"),props:t.props,render:function(i){return i(t,n({props:this.$props},e))}});return document.body.appendChild(i.$el),i}var p={zIndex:2e3,lockCount:0,stack:[],get top(){return this.stack[this.stack.length-1]}},m=10;var v=u.a.extend({data:function(){return{direction:""}},methods:{touchStart:function(t){this.resetTouchStatus(),this.startX=t.touches[0].clientX,this.startY=t.touches[0].clientY},touchMove:function(t){var e,i,n=t.touches[0];this.deltaX=n.clientX-this.startX,this.deltaY=n.clientY-this.startY,this.offsetX=Math.abs(this.deltaX),this.offsetY=Math.abs(this.deltaY),this.direction=this.direction||(e=this.offsetX,i=this.offsetY,e>i&&e>m?"horizontal":i>e&&i>m?"vertical":"")},resetTouchStatus:function(){this.direction="",this.deltaX=0,this.deltaY=0,this.offsetX=0,this.offsetY=0}}});var g=i(0),b=!1;if(!g.d)try{var y={};Object.defineProperty(y,"passive",{get:function(){b=!0}}),window.addEventListener("test-passive",null,y)}catch(t){}function k(t,e,i,n){void 0===n&&(n=!1),g.d||t.addEventListener(e,i,!!b&&{capture:!1,passive:n})}function x(t,e,i){g.d||t.removeEventListener(e,i)}function S(t){t.stopPropagation()}function w(t,e){("boolean"!=typeof t.cancelable||t.cancelable)&&t.preventDefault(),e&&S(t)}var C=Object(r.a)("overlay"),O=C[0],T=C[1];function $(t){w(t,!0)}function I(t,e,i,s){var r=n({zIndex:e.zIndex},e.customStyle);return Object(g.b)(e.duration)&&(r.animationDuration=e.duration+"s"),t("transition",{attrs:{name:"van-fade"}},[t("div",o()([{directives:[{name:"show",value:e.show}],style:r,class:[T(),e.className],on:{touchmove:$}},h(s,!0)]))])}I.props={show:Boolean,duration:[Number,String],className:null,customStyle:null,zIndex:{type:[Number,String],default:1}};var B,j=O(I),N={className:"",customStyle:{}};function A(){if(p.top){var t=p.top.vm;t.$emit("click-overlay"),t.closeOnClickOverlay&&(t.onClickOverlay?t.onClickOverlay():t.close())}}function z(){if(B||(B=f(j,{on:{click:A}})),p.top){var t=p.top,e=t.vm,i=t.config,s=e.$el;s&&s.parentNode?s.parentNode.insertBefore(B.$el,s):document.body.appendChild(B.$el),n(B,N,i,{show:!0})}else B.show=!1}function L(t){var e=p.stack;e.length&&(p.top.vm===t?(e.pop(),z()):p.stack=e.filter(function(e){return e.vm!==t}))}var E=/scroll|auto/i;function D(t,e){void 0===e&&(e=window);for(var i=t;i&&"HTML"!==i.tagName&&1===i.nodeType&&i!==e;){var n=window.getComputedStyle(i).overflowY;if(E.test(n)){if("BODY"!==i.tagName)return i;var s=window.getComputedStyle(i.parentNode).overflowY;if(E.test(s))return i}i=i.parentNode}return e}function M(t){return"scrollTop"in t?t.scrollTop:t.pageYOffset}function F(t,e){"scrollTop"in t?t.scrollTop=e:t.scrollTo(t.scrollX,e)}function P(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0}function V(t){F(window,t),F(document.body,t)}function R(t){return(t===window?0:t.getBoundingClientRect().top)+P()}var _,H,W={mixins:[v,(_={afterPortal:function(){this.overlay&&z()}},H=_.afterPortal,u.a.extend({props:{getContainer:[String,Function]},watch:{getContainer:function(){this.portal()}},mounted:function(){this.getContainer&&this.portal()},methods:{portal:function(){var t,e,i=this.getContainer;i?t="string"==typeof(e=i)?document.querySelector(e):e():this.$parent&&(t=this.$parent.$el),t&&t!==this.$el.parentNode&&t.appendChild(this.$el),H&&H.call(this)}}}))],props:{value:Boolean,overlay:Boolean,overlayStyle:Object,overlayClass:String,closeOnClickOverlay:Boolean,zIndex:[Number,String],lockScroll:{type:Boolean,default:!0},lazyRender:{type:Boolean,default:!0}},data:function(){return{inited:this.value}},computed:{shouldRender:function(){return this.inited||!this.lazyRender}},watch:{value:function(t){var e=t?"open":"close";this.inited=this.inited||this.value,this[e](),this.$emit(e)},overlay:function(){this.renderOverlay()}},mounted:function(){this.value&&this.open()},activated:function(){this.value&&this.open()},beforeDestroy:function(){this.close(),this.getContainer&&this.$parent&&this.$parent.$el&&this.$parent.$el.appendChild(this.$el)},deactivated:function(){this.close()},methods:{open:function(){this.$isServer||this.opened||(void 0!==this.zIndex&&(p.zIndex=this.zIndex),this.opened=!0,this.renderOverlay(),this.lockScroll&&(k(document,"touchstart",this.touchStart),k(document,"touchmove",this.onTouchMove),p.lockCount||document.body.classList.add("van-overflow-hidden"),p.lockCount++))},close:function(){this.opened&&(this.lockScroll&&(p.lockCount--,x(document,"touchstart",this.touchStart),x(document,"touchmove",this.onTouchMove),p.lockCount||document.body.classList.remove("van-overflow-hidden")),this.opened=!1,L(this),this.$emit("input",!1))},onTouchMove:function(t){this.touchMove(t);var e=this.deltaY>0?"10":"01",i=D(t.target,this.$el),n=i.scrollHeight,s=i.offsetHeight,o=i.scrollTop,r="11";0===o?r=s>=n?"00":"01":o+s>=n&&(r="10"),"11"===r||"vertical"!==this.direction||parseInt(r,2)&parseInt(e,2)||w(t,!0)},renderOverlay:function(){var t,e;!this.$isServer&&this.value&&(this.overlay?(t=this,e={zIndex:p.zIndex++,duration:this.duration,className:this.overlayClass,customStyle:this.overlayStyle},p.stack.some(function(e){return e.vm===t})||(p.stack.push({vm:t,config:e}),z())):L(this),this.updateZIndex())},updateZIndex:function(){var t=this;this.$nextTick(function(){t.$el.style.zIndex=p.zIndex++})}}},q=i(8),Y=Object(r.a)("info"),X=Y[0],U=Y[1];function K(t,e,i,n){if(Object(g.b)(e.info)&&""!==e.info)return t("div",o()([{class:U()},h(n,!0)]),[e.info])}K.props={info:[Number,String]};var Q=X(K),G=Object(r.a)("image"),Z=G[0],J=G[1],tt=Z({props:{src:String,fit:String,alt:String,round:Boolean,width:[Number,String],height:[Number,String],lazyLoad:Boolean,showError:{type:Boolean,default:!0},showLoading:{type:Boolean,default:!0}},data:function(){return{loading:!0,error:!1}},watch:{src:function(){this.loading=!0,this.error=!1}},computed:{style:function(){var t={};return Object(g.b)(this.width)&&(t.width=Object(q.a)(this.width)),Object(g.b)(this.height)&&(t.height=Object(q.a)(this.height)),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)},renderPlaceholder:function(){var t=this.$createElement;return this.loading&&this.showLoading?t("div",{class:J("loading")},[this.slots("loading")||t(ot,{attrs:{name:"photo-o",size:"22"}})]):this.error&&this.showError?t("div",{class:J("error")},[this.slots("error")||t(ot,{attrs:{name:"warning-o",size:"22"}})]):void 0},renderImage:function(){var t=this.$createElement,e={class:J("img"),attrs:{alt:this.alt},style:{objectFit:this.fit}};if(!this.error)return this.lazyLoad?t("img",o()([{ref:"image",directives:[{name:"lazy",value:this.src}]},e])):t("img",o()([{attrs:{src:this.src},on:{load:this.onLoad,error:this.onError}},e]))}},render:function(t){return t("div",{class:J({round:this.round}),style:this.style,on:{click:this.onClick}},[this.renderImage(),this.renderPlaceholder()])}}),et=Object(r.a)("icon"),it=et[0],nt=et[1];function st(t,e,i,n){var s,r=!!(s=e.name)&&-1!==s.indexOf("/");return t(e.tag,o()([{class:[e.classPrefix,r?"":e.classPrefix+"-"+e.name],style:{color:e.color,fontSize:Object(q.a)(e.size)}},h(n,!0)]),[i.default&&i.default(),r&&t(tt,{class:nt("image"),attrs:{fit:"contain",src:e.name,showLoading:!1}}),t(Q,{attrs:{info:e.info}})])}st.props={name:String,size:[Number,String],info:[Number,String],color:String,tag:{type:String,default:"i"},classPrefix:{type:String,default:nt()}};var ot=it(st),rt=Object(r.a)("popup"),at=rt[0],ut=rt[1],lt=at({mixins:[W],props:{round:Boolean,duration:Number,transition:String,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(t){var e;if(this.shouldRender){var i=this.round,n=this.position,s=this.duration,o=this.transition||("center"===n?"van-fade":"van-popup-slide-"+n),r={};return Object(g.b)(s)&&(r.transitionDuration=s+"s"),t("transition",{attrs:{name:o},on:{afterEnter:this.onOpened,afterLeave:this.onClosed}},[t("div",{directives:[{name:"show",value:this.value}],style:r,class:ut((e={round:i},e[n]=n,e)),on:{click:this.onClick}},[this.slots()])])}}}),ct="#f44",ht="#1989fa",dt="#fff",ft="#969799",pt=Object(r.a)("loading"),mt=pt[0],vt=pt[1];function gt(t,e){if("spinner"===e.type){for(var i=[],n=0;n<12;n++)i.push(t("i"));return i}return t("svg",{class:vt("circular"),attrs:{viewBox:"25 25 50 50"}},[t("circle",{attrs:{cx:"50",cy:"50",r:"20",fill:"none"}})])}function bt(t,e,i){if(i.default){var n=e.textSize&&{fontSize:Object(q.a)(e.textSize)};return t("span",{class:vt("text"),style:n},[i.default()])}}function yt(t,e,i,n){var s=e.color,r=e.size,a=e.type,u={color:s};if(r){var l=Object(q.a)(r);u.width=l,u.height=l}return t("div",o()([{class:vt([a,{vertical:e.vertical}])},h(n,!0)]),[t("span",{class:vt("spinner",a),style:u},[gt(t,e)]),bt(t,e,i)])}yt.props={size:[Number,String],vertical:Boolean,textSize:[Number,String],type:{type:String,default:"circular"},color:{type:String,default:"#c9c9c9"}};var kt=mt(yt),xt=Object(r.a)("action-sheet"),St=xt[0],wt=xt[1];function Ct(t,e,i,n){var s=e.title,r=e.cancelText;function a(){d(n,"input",!1),d(n,"cancel")}return t(lt,o()([{class:wt({"safe-area-inset-bottom":e.safeAreaInsetBottom}),attrs:{position:"bottom",round:e.round,value:e.value,overlay:e.overlay,duration:e.duration,lazyRender:e.lazyRender,lockScroll:e.lockScroll,getContainer:e.getContainer,closeOnClickOverlay:e.closeOnClickOverlay}},h(n,!0)]),[function(){if(s)return t("div",{class:[wt("header"),"van-hairline--bottom"]},[s,t(ot,{attrs:{name:"close"},class:wt("close"),on:{click:a}})])}(),e.actions&&e.actions.map(function(i,s){var o=i.disabled||i.loading;return t("div",{class:[wt("item",{disabled:o}),i.className,"van-hairline--top"],on:{click:function(t){t.stopPropagation(),i.disabled||i.loading||(i.callback&&i.callback(i),d(n,"select",i,s),e.closeOnClickAction&&d(n,"input",!1))}}},[i.loading?t(kt,{attrs:{size:"20px"}}):[t("span",{class:wt("name")},[i.name]),i.subname&&t("span",{class:wt("subname")},[i.subname])]])}),function(){if(i.default)return t("div",{class:wt("content")},[i.default()])}(),function(){if(r)return t("div",{class:wt("cancel"),on:{click:a}},[r])}()])}Ct.props=n({},W.props,{title:String,round:Boolean,actions:Array,duration:Number,cancelText:String,getContainer:[String,Function],closeOnClickAction:Boolean,safeAreaInsetBottom:Boolean,overlay:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0}});var Ot=St(Ct);function Tt(t){return t=t.replace(/[^-|\d]/g,""),/^((\+86)|(86))?(1)\d{10}$/.test(t)||/^0[0-9-]{10,13}$/.test(t)}var $t=i(6);function It(t){return Array.isArray(t)?t.map(function(t){return It(t)}):"object"==typeof t?Object($t.a)({},t):t}var Bt={title:String,loading:Boolean,showToolbar:Boolean,cancelButtonText:String,confirmButtonText:String,visibleItemCount:{type:Number,default:5},itemHeight:{type:Number,default:44}};function jt(t,e,i){return Math.min(Math.max(t,e),i)}var Nt=Object(r.a)("picker-column"),At=Nt[0],zt=Nt[1];function Lt(t){return Object(g.c)(t)&&t.disabled}var Et=At({mixins:[v],props:{valueKey:String,className:String,itemHeight:Number,defaultIndex:Number,visibleItemCount:Number,initialOptions:{type:Array,default:function(){return[]}}},data:function(){return{offset:0,duration:0,options:It(this.initialOptions),currentIndex:this.defaultIndex}},created:function(){this.$parent.children&&this.$parent.children.push(this),this.setIndex(this.currentIndex)},destroyed:function(){var t=this.$parent.children;t&&t.splice(t.indexOf(this),1)},watch:{defaultIndex:function(){this.setIndex(this.defaultIndex)}},computed:{count:function(){return this.options.length}},methods:{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.startOffset=Math.min(0,e)}else this.startOffset=this.offset;this.duration=0,this.moving=!1,this.transitionEndTrigger=null,this.touchStartTime=Date.now(),this.momentumOffset=this.startOffset},onTouchMove:function(t){w(t),this.moving=!0,this.touchMove(t),this.offset=jt(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.offset-this.momentumOffset,e=Date.now()-this.touchStartTime;if(e<300&&Math.abs(t)>15)this.momentum(t,e);else if(this.offset!==this.startOffset){this.duration=200;var i=this.getIndexByOffset(this.offset);this.setIndex(i,!0)}},onTransitionEnd:function(){this.stopMomentum()},onClickItem:function(t){this.duration=200,this.setIndex(t,!0)},adjustIndex:function(t){for(var e=t=jt(t,0,this.count);e<this.count;e++)if(!Lt(this.options[e]))return e;for(var i=t-1;i>=0;i--)if(!Lt(this.options[i]))return i},getOptionText:function(t){return Object(g.c)(t)&&this.valueKey in t?t[this.valueKey]:t},setIndex:function(t,e){var i=this;t=this.adjustIndex(t)||0,this.offset=-t*this.itemHeight;var n=function(){t!==i.currentIndex&&(i.currentIndex=t,e&&i.$emit("change",t))};this.moving?this.transitionEndTrigger=n:n()},setValue:function(t){for(var e=this.options,i=0;i<e.length;i++)if(this.getOptionText(e[i])===t)return this.setIndex(i)},getValue:function(){return this.options[this.currentIndex]},getIndexByOffset:function(t){return jt(Math.round(-t/this.itemHeight),0,this.count-1)},momentum:function(t,e){var i=Math.abs(t/e);t=this.offset+i/.002*(t<0?-1:1);var n=this.getIndexByOffset(t);this.duration=1e3,this.setIndex(n,!0)},stopMomentum:function(){this.moving=!1,this.duration=0,this.transitionEndTrigger&&(this.transitionEndTrigger(),this.transitionEndTrigger=null)}},render:function(t){var e=this,i=this.itemHeight,n=i*(this.visibleItemCount-1)/2,s={transform:"translate3d(0, "+(this.offset+n)+"px, 0)",transitionDuration:this.duration+"ms",transitionProperty:this.duration?"all":"none",lineHeight:i+"px"},o={height:i+"px"};return t("div",{class:[zt(),this.className],on:{touchstart:this.onTouchStart,touchmove:this.onTouchMove,touchend:this.onTouchEnd,touchcancel:this.onTouchEnd}},[t("ul",{ref:"wrapper",style:s,class:zt("wrapper"),on:{transitionend:this.onTransitionEnd}},[this.options.map(function(i,n){return t("li",{style:o,class:["van-ellipsis",zt("item",{disabled:Lt(i),selected:n===e.currentIndex})],domProps:{innerHTML:e.getOptionText(i)},on:{click:function(){e.onClickItem(n)}}})})])])}}),Dt=Object(r.a)("picker"),Mt=Dt[0],Ft=Dt[1],Pt=Dt[2],Vt=Mt({props:n({},Bt,{defaultIndex:{type:Number,default:0},columns:{type:Array,default:function(){return[]}},toolbarPosition:{type:String,default:"top"},valueKey:{type:String,default:"text"}}),data:function(){return{children:[]}},computed:{simple:function(){return this.columns.length&&!this.columns[0].values}},watch:{columns:function(){this.setColumns()}},methods:{setColumns:function(){var t=this;(this.simple?[{values:this.columns}]:this.columns).forEach(function(e,i){t.setColumnValues(i,It(e.values))})},emit:function(t){this.simple?this.$emit(t,this.getColumnValue(0),this.getColumnIndex(0)):this.$emit(t,this.getValues(),this.getIndexes())},onChange:function(t){this.simple?this.$emit("change",this,this.getColumnValue(0),this.getColumnIndex(0)):this.$emit("change",this,this.getValues(),t)},getColumn:function(t){return this.children[t]},getColumnValue:function(t){var e=this.getColumn(t);return e&&e.getValue()},setColumnValue:function(t,e){var i=this.getColumn(t);i&&i.setValue(e)},getColumnIndex:function(t){return(this.getColumn(t)||{}).currentIndex},setColumnIndex:function(t,e){var i=this.getColumn(t);i&&i.setIndex(e)},getColumnValues:function(t){return(this.children[t]||{}).options},setColumnValues:function(t,e){var i=this.children[t];i&&JSON.stringify(i.options)!==JSON.stringify(e)&&(i.options=e,i.setIndex(0))},getValues:function(){return this.children.map(function(t){return t.getValue()})},setValues:function(t){var e=this;t.forEach(function(t,i){e.setColumnValue(i,t)})},getIndexes:function(){return this.children.map(function(t){return t.currentIndex})},setIndexes:function(t){var e=this;t.forEach(function(t,i){e.setColumnIndex(i,t)})},onConfirm:function(){this.children.map(function(t){return t.stopMomentum()}),this.emit("confirm")},onCancel:function(){this.emit("cancel")}},render:function(t){var e=this,i=this.itemHeight,n=i*this.visibleItemCount,s=this.simple?[this.columns]:this.columns,o={height:i+"px"},r={height:n+"px"},a={backgroundSize:"100% "+(n-i)/2+"px"},u=this.showToolbar&&t("div",{class:["van-hairline--top-bottom",Ft("toolbar")]},[this.slots()||[t("div",{attrs:{role:"button",tabindex:"0"},class:Ft("cancel"),on:{click:this.onCancel}},[this.cancelButtonText||Pt("cancel")]),this.slots("title")||this.title&&t("div",{class:["van-ellipsis",Ft("title")]},[this.title]),t("div",{attrs:{role:"button",tabindex:"0"},class:Ft("confirm"),on:{click:this.onConfirm}},[this.confirmButtonText||Pt("confirm")])]]);return t("div",{class:Ft()},["top"===this.toolbarPosition?u:t(),this.loading?t(kt,{class:Ft("loading"),attrs:{color:ht}}):t(),t("div",{class:Ft("columns"),style:r,on:{touchmove:w}},[s.map(function(i,n){return t(Et,{attrs:{valueKey:e.valueKey,className:i.className,itemHeight:e.itemHeight,defaultIndex:i.defaultIndex||e.defaultIndex,visibleItemCount:e.visibleItemCount,initialOptions:e.simple?i:i.values},on:{change:function(){e.onChange(n)}}})}),t("div",{class:Ft("mask"),style:a}),t("div",{class:["van-hairline--top-bottom",Ft("frame")],style:o})]),"bottom"===this.toolbarPosition?u:t()])}}),Rt=Object(r.a)("area"),_t=Rt[0],Ht=Rt[1],Wt=_t({props:n({},Bt,{value:String,areaList:{type:Object,default:function(){return{}}},columnsNum:{type:[Number,String],default:3}}),data:function(){return{code:this.value,columns:[{values:[]},{values:[]},{values:[]}]}},computed:{province:function(){return this.areaList.province_list||{}},city:function(){return this.areaList.city_list||{}},county:function(){return this.areaList.county_list||{}},displayColumns:function(){return this.columns.slice(0,+this.columnsNum)}},watch:{value:function(){this.code=this.value,this.setValues()},areaList:{deep:!0,handler:function(){this.setValues()}},columnsNum:function(){var t=this;this.$nextTick(function(){t.setValues()})}},mounted:function(){this.setValues()},methods:{getList:function(t,e){var i=[];if("province"!==t&&!e)return i;var n=this[t];return i=Object.keys(n).map(function(t){return{code:t,name:n[t]}}),e&&("9"===e[0]&&"city"===t&&(e="9"),i=i.filter(function(t){return 0===t.code.indexOf(e)})),i},getIndex:function(t,e){var i="province"===t?2:"city"===t?4:6,n=this.getList(t,e.slice(0,i-2));"9"===e[0]&&"province"===t&&(i=1),e=e.slice(0,i);for(var s=0;s<n.length;s++)if(n[s].code.slice(0,i)===e)return s;return 0},onChange:function(t,e,i){this.code=e[i].code,this.setValues(),this.$emit("change",t,t.getValues(),i)},setValues:function(){var t=this.code||Object.keys(this.county)[0]||"",e=this.$refs.picker,i=this.getList("province"),n=this.getList("city",t.slice(0,2));e&&(e.setColumnValues(0,i),e.setColumnValues(1,n),n.length&&"00"===t.slice(2,4)&&(t=n[0].code),e.setColumnValues(2,this.getList("county",t.slice(0,4))),e.setIndexes([this.getIndex("province",t),this.getIndex("city",t),this.getIndex("county",t)]))},getValues:function(){return this.$refs.picker?this.$refs.picker.getValues().filter(function(t){return!!t}):[]},getArea:function(){var t=this.getValues(),e={code:"",country:"",province:"",city:"",county:""};if(!t.length)return e;var i=t.map(function(t){return t.name});return e.code=t[t.length-1].code,"9"===e.code[0]?(e.country=i[1]||"",e.province=i[2]||""):(e.province=i[0]||"",e.city=i[1]||"",e.county=i[2]||""),e},reset:function(t){this.code=t||"",this.setValues()}},render:function(t){var e=n({},this.$listeners,{change:this.onChange});return t(Vt,{ref:"picker",class:Ht(),attrs:{showToolbar:!0,valueKey:"name",title:this.title,loading:this.loading,columns:this.displayColumns,itemHeight:this.itemHeight,visibleItemCount:this.visibleItemCount,cancelButtonText:this.cancelButtonText,confirmButtonText:this.confirmButtonText},on:n({},e)})}}),qt={icon:String,size:String,center:Boolean,isLink:Boolean,required:Boolean,clickable:Boolean,titleStyle:null,titleClass:null,valueClass:null,labelClass:null,title:[Number,String],value:[Number,String],label:[Number,String],arrowDirection:String,border:{type:Boolean,default:!0}};function Yt(t,e){var i=e.to,n=e.url,s=e.replace;i&&t?t[s?"replace":"push"](i):n&&(s?location.replace(n):location.href=n)}function Xt(t){Yt(t.parent&&t.parent.$router,t.props)}var Ut={url:String,replace:Boolean,to:[String,Object]},Kt=Object(r.a)("cell"),Qt=Kt[0],Gt=Kt[1];function Zt(t,e,i,n){var s=e.icon,r=e.size,a=e.title,u=e.label,l=e.value,c=e.isLink,f=e.arrowDirection,p=i.title||Object(g.b)(a),m=i.default||Object(g.b)(l),v=(i.label||Object(g.b)(u))&&t("div",{class:[Gt("label"),e.labelClass]},[i.label?i.label():u]),b=p&&t("div",{class:[Gt("title"),e.titleClass],style:e.titleStyle},[i.title?i.title():t("span",[a]),v]),y=m&&t("div",{class:[Gt("value",{alone:!i.title&&!a}),e.valueClass]},[i.default?i.default():t("span",[l])]),k=i.icon?i.icon():s&&t(ot,{class:Gt("left-icon"),attrs:{name:s}}),x=i["right-icon"],S=x?x():c&&t(ot,{class:Gt("right-icon"),attrs:{name:f?"arrow-"+f:"arrow"}});var w={center:e.center,required:e.required,borderless:!e.border,clickable:c||e.clickable};return r&&(w[r]=r),t("div",o()([{class:Gt(w),on:{click:function(t){d(n,"click",t),Xt(n)}}},h(n)]),[k,b,y,S,i.extra&&i.extra()])}Zt.props=n({},qt,{},Ut);var Jt=Qt(Zt);var te=!g.d&&/ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase());function ee(){te&&V(P())}var ie=Object(r.a)("field"),ne=ie[0],se=ie[1],oe=ne({inheritAttrs:!1,props:n({},qt,{error:Boolean,readonly:Boolean,autosize:[Boolean,Object],leftIcon:String,rightIcon:String,clearable:Boolean,labelClass:null,labelWidth:[Number,String],labelAlign:String,inputAlign:String,errorMessage:String,errorMessageAlign:String,type:{type:String,default:"text"}}),data:function(){return{focused:!1}},watch:{value:function(){this.$nextTick(this.adjustSize)}},mounted:function(){this.format(),this.$nextTick(this.adjustSize)},computed:{showClear:function(){return this.clearable&&this.focused&&""!==this.value&&Object(g.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.labelWidth;if(t)return{width:Object(q.a)(t)}}},methods:{focus:function(){this.$refs.input&&this.$refs.input.focus()},blur:function(){this.$refs.input&&this.$refs.input.blur()},format:function(t){if(void 0===t&&(t=this.$refs.input),t){var e=t.value,i=this.$attrs.maxlength;return"number"===this.type&&Object(g.b)(i)&&e.length>i&&(e=e.slice(0,i),t.value=e),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),ee()},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){w(t),this.$emit("input",""),this.$emit("clear",t)},onKeypress:function(t){if("number"===this.type){var e=t.keyCode,i=-1===String(this.value).indexOf(".");e>=48&&e<=57||46===e&&i||45===e||w(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(g.c)(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")}},renderInput:function(){var t=this.$createElement,e=this.slots("input");if(e)return t("div",{class:se("control",this.inputAlign)},[e]);var i={ref:"input",class:se("control",this.inputAlign),domProps:{value:this.value},attrs:n({},this.$attrs,{readonly:this.readonly}),on:this.listeners,directives:[{name:"model",value:this.value}]};return"textarea"===this.type?t("textarea",o()([{},i])):t("input",o()([{attrs:{type:this.type}},i]))},renderLeftIcon:function(){var t=this.$createElement;if(this.slots("left-icon")||this.leftIcon)return t("div",{class:se("left-icon"),on:{click:this.onClickLeftIcon}},[this.slots("left-icon")||t(ot,{attrs:{name:this.leftIcon}})])},renderRightIcon:function(){var t=this.$createElement,e=this.slots;if(e("right-icon")||this.rightIcon)return t("div",{class:se("right-icon"),on:{click:this.onClickRightIcon}},[e("right-icon")||t(ot,{attrs:{name:this.rightIcon}})])}},render:function(t){var e,i=this.slots,n=this.labelAlign,s={icon:this.renderLeftIcon};return i("label")&&(s.title=function(){return i("label")}),t(Jt,{attrs:{icon:this.leftIcon,size:this.size,title:this.label,center:this.center,border:this.border,isLink:this.isLink,required:this.required,clickable:this.clickable,titleStyle:this.labelStyle,titleClass:[se("label",n),this.labelClass],arrowDirection:this.arrowDirection},class:se((e={error:this.error,disabled:this.$attrs.disabled},e["label-"+n]=n,e["min-height"]="textarea"===this.type&&!this.autosize,e)),scopedSlots:s,on:{click:this.onClick}},[t("div",{class:se("body")},[this.renderInput(),this.showClear&&t(ot,{attrs:{name:"clear"},class:se("clear"),on:{touchstart:this.onClear}}),this.renderRightIcon(),i("button")&&t("div",{class:se("button")},[i("button")])]),this.errorMessage&&t("div",{class:se("error-message",this.errorMessageAlign)},[this.errorMessage])])}}),re=Object(r.a)("toast"),ae=re[0],ue=re[1],le=ae({mixins:[W],props:{icon:String,className:null,iconPrefix:String,loadingType:String,forbidClick:Boolean,message:[Number,String],type:{type:String,default:"text"},position:{type:String,default:"middle"},lockScroll:{type:Boolean,default:!1}},data:function(){return{clickable:!1}},mounted:function(){this.toggleClickable()},destroyed:function(){this.toggleClickable()},watch:{value:function(){this.toggleClickable()},forbidClick:function(){this.toggleClickable()}},methods:{toggleClickable:function(){var t=this.value&&this.forbidClick;if(this.clickable!==t){this.clickable=t;var e=t?"add":"remove";document.body.classList[e]("van-toast--unclickable")}},onAfterEnter:function(){this.$emit("opened"),this.onOpened&&this.onOpened()},onAfterLeave:function(){this.$emit("closed")}},render:function(t){var e=this.type,i=this.icon,n=this.message,s=this.iconPrefix,o=this.loadingType,r=i||"success"===e||"fail"===e;return t("transition",{attrs:{name:"van-fade"},on:{afterEnter:this.onAfterEnter,afterLeave:this.onAfterLeave}},[t("div",{directives:[{name:"show",value:this.value}],class:[ue([this.position,{text:!r&&"loading"!==e}]),this.className]},[r?t(ot,{class:ue("icon"),attrs:{classPrefix:s,name:i||e}}):"loading"===e?t(kt,{class:ue("loading"),attrs:{color:"white",type:o}}):void 0,function(){if(Object(g.b)(n)&&""!==n)return"html"===e?t("div",{class:ue("text"),domProps:{innerHTML:n}}):t("div",{class:ue("text")},[n])}()])])}}),ce={icon:"",type:"text",mask:!1,value:!0,message:"",className:"",onClose:null,onOpened:null,duration:3e3,iconPrefix:void 0,position:"middle",forbidClick:!1,loadingType:void 0,getContainer:"body",overlayStyle:null},he=[],de=!1,fe=n({},ce);function pe(t){return Object(g.c)(t)?t:{message:t}}function me(t){void 0===t&&(t={});var e=function(){if(g.d)return{};if(!he.length||de){var t=new(u.a.extend(le))({el:document.createElement("div")});he.push(t)}return he[he.length-1]}();return e.value&&e.updateZIndex(),t=n({},fe,{},pe(t),{clear:function(){e.value=!1,t.onClose&&t.onClose(),de&&!g.d&&e.$on("closed",function(){clearTimeout(e.timer),he=he.filter(function(t){return t!==e});var t=e.$el.parentNode;t&&t.removeChild(e.$el),e.$destroy()})}}),n(e,function(t){return(t=n({},t)).overlay=t.mask,delete t.mask,delete t.duration,t}(t)),clearTimeout(e.timer),t.duration>0&&(e.timer=setTimeout(function(){e.clear()},t.duration)),e}["loading","success","fail"].forEach(function(t){var e;me[t]=(e=t,function(t){return me(n({type:e},pe(t)))})}),me.clear=function(t){he.length&&(t?(he.forEach(function(t){t.clear()}),he=[]):de?he.shift().clear():he[0].clear())},me.setDefaultOptions=function(t){n(fe,t)},me.resetDefaultOptions=function(){fe=n({},ce)},me.allowMultiple=function(t){void 0===t&&(t=!0),de=t},me.install=function(){u.a.use(le)},u.a.prototype.$toast=me;var ve=me,ge=Object(r.a)("button"),be=ge[0],ye=ge[1];function ke(t,e,i,n){var s=e.tag,r=e.icon,a=e.type,u=e.disabled,l=e.loading,c=e.hairline,f=e.loadingText;var p,m,v=[ye([a,e.size,{disabled:u,hairline:c,block:e.block,plain:e.plain,round:e.round,square:e.square}]),{"van-hairline--surround":c}];return t(s,o()([{class:v,attrs:{type:e.nativeType,disabled:u},on:{click:function(t){l||u||(d(n,"click",t),Xt(n))},touchstart:function(t){d(n,"touchstart",t)}}},h(n)]),[(m=[],l?m.push(t(kt,{class:ye("loading"),attrs:{size:e.loadingSize,type:e.loadingType,color:"default"===a?void 0:""}})):r&&m.push(t(ot,{attrs:{name:r},class:ye("icon")})),(p=l?f:i.default?i.default():e.text)&&m.push(t("span",{class:ye("text")},[p])),m)])}ke.props=n({},Ut,{text:String,icon: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 xe=be(ke);function Se(t){function e(){this.binded||(t.call(this,k,!0),this.binded=!0)}function i(){this.binded&&(t.call(this,x,!1),this.binded=!1)}return{mounted:e,activated:e,deactivated:i,beforeDestroy:i}}var we,Ce=u.a.extend({mixins:[Se(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){this.$isServer||this.bindStatus!==t&&(this.bindStatus=t,(t?k:x)(window,"popstate",this.close))}}}),Oe=Object(r.a)("dialog"),Te=Oe[0],$e=Oe[1],Ie=Oe[2],Be=Te({mixins:[W,Ce],props:{title:String,message:String,className:null,callback:Function,beforeClose:Function,messageAlign:String,cancelButtonText:String,cancelButtonColor:String,confirmButtonText:String,confirmButtonColor:String,showCancelButton:Boolean,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.beforeClose?(this.loading[t]=!0,this.beforeClose(t,function(i){!1!==i&&e.onClose(t),e.loading[t]=!1})):this.onClose(t)},onClose:function(t){this.close(),this.callback&&this.callback(t)}},render:function(t){var e,i=this;if(this.shouldRender){var n=this.title,s=this.message,o=this.messageAlign,r=this.slots(),a=n&&t("div",{class:$e("header",{isolated:!s&&!r})},[n]),u=(r||s)&&t("div",{class:$e("content")},[r||t("div",{domProps:{innerHTML:s},class:$e("message",(e={"has-title":n},e[o]=o,e))})]),l=this.showCancelButton&&this.showConfirmButton,c=t("div",{class:["van-hairline--top",$e("footer",{buttons:l})]},[this.showCancelButton&&t(xe,{attrs:{size:"large",loading:this.loading.cancel,text:this.cancelButtonText||Ie("cancel")},class:$e("cancel"),style:{color:this.cancelButtonColor},on:{click:function(){i.handleAction("cancel")}}}),this.showConfirmButton&&t(xe,{attrs:{size:"large",loading:this.loading.confirm,text:this.confirmButtonText||Ie("confirm")},class:[$e("confirm"),{"van-hairline--left":l}],style:{color:this.confirmButtonColor},on:{click:function(){i.handleAction("confirm")}}})]);return t("transition",{attrs:{name:"van-dialog-bounce"}},[t("div",{directives:[{name:"show",value:this.value}],attrs:{role:"dialog","aria-labelledby":n||s},class:[$e(),this.className]},[a,u,c])])}}});function je(t){return g.d?Promise.resolve():new Promise(function(e,i){var s;we&&(s=we.$el,document.body.contains(s))||(we&&we.$destroy(),(we=new(u.a.extend(Be))({el:document.createElement("div"),propsData:{lazyRender:!1}})).$on("input",function(t){we.value=t})),n(we,je.currentOptions,t,{resolve:e,reject:i})})}je.defaultOptions={value:!0,title:"",message:"",overlay:!0,className:"",lockScroll:!0,beforeClose:null,messageAlign:"",getContainer:"body",cancelButtonText:"",cancelButtonColor:null,confirmButtonText:"",confirmButtonColor:null,showConfirmButton:!0,showCancelButton:!1,closeOnPopstate:!1,closeOnClickOverlay:!1,callback:function(t){we["confirm"===t?"resolve":"reject"](t)}},je.alert=je,je.confirm=function(t){return je(n({showCancelButton:!0},t))},je.close=function(){we&&(we.value=!1)},je.setDefaultOptions=function(t){n(je.currentOptions,t)},je.resetDefaultOptions=function(){je.currentOptions=n({},je.defaultOptions)},je.resetDefaultOptions(),je.install=function(){u.a.use(Be)},je.Component=Be,u.a.prototype.$dialog=je;var Ne=je,Ae=Object(r.a)("address-edit-detail"),ze=Ae[0],Le=Ae[1],Ee=Ae[2],De=!g.d&&/android/.test(navigator.userAgent.toLowerCase()),Me=ze({props:{value:String,error:Boolean,focused:Boolean,detailRows:Number,searchResult:Array,detailMaxlength:Number,showSearchResult:Boolean},methods:{onSelect:function(t){this.$emit("select-search",t),this.$emit("input",((t.address||"")+" "+(t.name||"")).trim())},onFinish:function(){this.$refs.field.blur()},renderFinish:function(){var t=this.$createElement;if(this.value&&this.focused&&De)return t("div",{class:Le("finish"),on:{click:this.onFinish}},[Ee("complete")])},renderSearchResult:function(){var t=this,e=this.$createElement,i=this.searchResult;if(this.focused&&i&&this.showSearchResult)return i.map(function(i){return e(Jt,{key:i.name+i.address,attrs:{title:i.name,label:i.address,icon:"location-o",clickable:!0},on:{click:function(){t.onSelect(i)}}})})}},render:function(t){return t(Jt,{class:Le()},[t(oe,{attrs:{autosize:!0,rows:this.detailRows,clearable:!De,type:"textarea",value:this.value,error:this.error,label:Ee("label"),maxlength:this.detailMaxlength,placeholder:Ee("placeholder")},ref:"field",scopedSlots:{icon:this.renderFinish},on:n({},this.$listeners)}),this.renderSearchResult()])}}),Fe={value:null,loading:Boolean,disabled:Boolean,activeColor:String,inactiveColor:String,activeValue:{type:null,default:!0},inactiveValue:{type:null,default:!1},size:{type:String,default:"30px"}},Pe=Object(r.a)("switch"),Ve=Pe[0],Re=Pe[1];function _e(t,e,i,n){var s=e.size,r=e.value,a=e.loading,u=e.disabled,l=e.activeColor,c=e.activeValue,f=e.inactiveColor,p=e.inactiveValue,m=r===c,v={fontSize:s,backgroundColor:m?l:f},g=m?l||ht:f||ft;return t("div",o()([{class:Re({on:m,disabled:u}),attrs:{role:"switch","aria-checked":String(m)},style:v,on:{click:function(){if(!u&&!a){var t=m?p:c;d(n,"input",t),d(n,"change",t)}}}},h(n)]),[t("div",{class:Re("node")},[a&&t(kt,{class:Re("loading"),attrs:{color:g}})])])}_e.props=Fe;var He=Ve(_e),We=Object(r.a)("switch-cell"),qe=We[0],Ye=We[1];function Xe(t,e,i,s){return t(Jt,o()([{attrs:{center:!0,size:e.cellSize,title:e.title,border:e.border},class:Ye([e.cellSize])},h(s)]),[t(He,{props:n({},e),on:n({},s.listeners)})])}Xe.props=n({},Fe,{title:String,cellSize:String,border:{type:Boolean,default:!0},size:{type:String,default:"24px"}});var Ue=qe(Xe),Ke=Object(r.a)("address-edit"),Qe=Ke[0],Ge=Ke[1],Ze=Ke[2],Je={name:"",tel:"",country:"",province:"",city:"",county:"",areaCode:"",postalCode:"",addressDetail:"",isDefault:!1},ti=Qe({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},detailRows:{type:Number,default:1},detailMaxlength:{type:Number,default:200},addressInfo:{type:Object,default:function(){return n({},Je)}},telValidator:{type:Function,default:Tt}},data:function(){return{data:{},showAreaPopup:!1,detailFocused:!1,errorInfo:{tel:!1,name:!1,postalCode:!1,addressDetail:!1}}},computed:{areaListLoaded:function(){return Object(g.c)(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 o=[e,i,n,s];return i&&i===n&&o.splice(1,1),o.filter(function(t){return t}).join("/")}return""}},watch:{addressInfo:{handler:function(t){this.data=n({},Je,{},t),this.setAreaCode(t.areaCode)},deep:!0,immediate:!0},areaList:function(){this.setAreaCode(this.data.areaCode)}},methods:{onFocus:function(t){this.errorInfo[t]=!1,this.detailFocused="addressDetail"===t,this.$emit("focus",t)},onChangeDetail:function(t){this.data.addressDetail=t,this.$emit("change-detail",t)},onAreaConfirm:function(t){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","areaCode","addressDetail"];this.showPostal&&e.push("postalCode"),e.every(function(e){var i=t.getErrorMessage(e);return i&&(t.errorInfo[e]=!0,ve(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?"":Ze("nameEmpty");case"tel":return this.telValidator(e)?"":Ze("telInvalid");case"areaCode":return e?"":Ze("areaEmpty");case"addressDetail":return e?"":Ze("addressEmpty");case"postalCode":return e&&!/^\d{6}$/.test(e)?Ze("postalEmpty"):""}},onDelete:function(){var t=this;Ne.confirm({title:Ze("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(t){var e=this,i=this.data,n=this.errorInfo,s=this.searchResult,o=function(t){return function(){return e.onFocus(t)}},r=s&&s.length&&this.detailFocused;return t("div",{class:Ge()},[t(oe,{attrs:{clearable:!0,label:Ze("name"),placeholder:Ze("namePlaceholder"),error:n.name},on:{focus:o("name")},model:{value:i.name,callback:function(t){i.name=t}}}),t(oe,{attrs:{clearable:!0,type:"tel",label:Ze("tel"),placeholder:Ze("telPlaceholder"),error:n.tel},on:{focus:o("tel")},model:{value:i.tel,callback:function(t){i.tel=t}}}),t(oe,{directives:[{name:"show",value:this.showArea}],attrs:{readonly:!0,label:Ze("area"),placeholder:Ze("areaPlaceholder"),value:this.areaText},on:{click:function(){e.showAreaPopup=!0}}}),t(Me,{directives:[{name:"show",value:this.showDetail}],attrs:{focused:this.detailFocused,value:i.addressDetail,error: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(t){e.$emit("select-search",t)}}}),this.showPostal&&t(oe,{directives:[{name:"show",value:!r}],attrs:{type:"tel",maxlength:"6",label:Ze("postal"),placeholder:Ze("postal"),error:n.postalCode},on:{focus:o("postalCode")},model:{value:i.postalCode,callback:function(t){i.postalCode=t}}}),this.slots(),this.showSetDefault&&t(Ue,{directives:[{name:"show",value:!r}],attrs:{title:Ze("defaultAddress")},on:{change:function(t){e.$emit("change-default",t)}},model:{value:i.isDefault,callback:function(t){i.isDefault=t}}}),t("div",{directives:[{name:"show",value:!r}],class:Ge("buttons")},[t(xe,{attrs:{block:!0,loading:this.isSaving,type:"danger",text:this.saveButtonText||Ze("save")},on:{click:this.onSave}}),this.showDelete&&t(xe,{attrs:{block:!0,loading:this.isDeleting,text:this.deleteButtonText||Ze("delete")},on:{click:this.onDelete}})]),t(lt,{attrs:{position:"bottom",lazyRender:!1,getContainer:"body"},model:{value:e.showAreaPopup,callback:function(t){e.showAreaPopup=t}}},[t(Wt,{ref:"area",attrs:{loading:!this.areaListLoaded,value:i.areaCode,areaList:this.areaList},on:{confirm:this.onAreaConfirm,cancel:function(){e.showAreaPopup=!1}}})])])}});function ei(t,e){var i,n;void 0===e&&(e={});var s=e.indexKey||"index";return u.a.extend({inject:(i={},i[t]={default:null},i),computed:(n={parent:function(){return this[t]}},n[s]=function(){return this.bindRelation(),this.parent.children.indexOf(this)},n),created: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){var t=this.parent.children;if(-1===t.indexOf(this)){var e=this.parent.slots().indexOf(this.$vnode);-1===e?t.push(this):t.splice(e,0,this)}}}}})}function ii(t){return{provide:function(){var e;return(e={})[t]=this,e},data:function(){return{children:[]}}}}var ni=Object(r.a)("radio-group"),si=ni[0],oi=ni[1],ri=si({mixins:[ii("vanRadio")],props:{value:null,disabled:Boolean},watch:{value:function(t){this.$emit("change",t)}},render:function(t){return t("div",{class:oi(),attrs:{role:"radiogroup"}},[this.slots()])}}),ai=function(t){var e=t.parent,i=t.bem,n=t.role;return{mixins:[ei(e)],props:{name:null,value:null,disabled:Boolean,iconSize:[Number,String],checkedColor:String,labelPosition:String,labelDisabled:Boolean,shape:{type:String,default:"round"}},computed:{isDisabled:function(){return this.parent&&this.parent.disabled||this.disabled},iconStyle:function(){var t=this.checkedColor;if(t&&this.checked&&!this.isDisabled)return{borderColor:t,backgroundColor:t}},tabindex:function(){return this.isDisabled||"radio"===n&&!this.checked?-1:0}},render:function(t){var e=this,s=this.slots,o=this.checked,r=s("icon",{checked:o})||t(ot,{attrs:{name:"success"},style:this.iconStyle}),a=s()&&t("span",{class:i("label",[this.labelPosition,{disabled:this.isDisabled}]),on:{click:this.onClickLabel}},[s()]),u=[t("div",{class:i("icon",[this.shape,{disabled:this.isDisabled,checked:o}]),style:{fontSize:Object(q.a)(this.iconSize)},on:{click:this.onClickIcon}},[r])];return"left"===this.labelPosition?u.unshift(a):u.push(a),t("div",{attrs:{role:n,tabindex:this.tabindex,"aria-checked":String(this.checked)},class:i(),on:{click:function(t){e.$emit("click",t)}}},[u])}}},ui=Object(r.a)("radio"),li=(0,ui[0])({mixins:[ai({bem:ui[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:{onClickIcon:function(){this.isDisabled||(this.currentValue=this.name)},onClickLabel:function(){this.isDisabled||this.labelDisabled||(this.currentValue=this.name)}}}),ci=Object(r.a)("address-item"),hi=ci[0],di=ci[1];function fi(t,e,i,n){var s=e.disabled,r=e.switchable;return t(Jt,o()([{class:di({disabled:s}),attrs:{valueClass:di("value"),clickable:r&&!s},scopedSlots:{default:function(){var i=e.data,n=[t("div",{class:di("name")},[i.name+","+i.tel]),t("div",{class:di("address")},[i.address])];return r&&!s?t(li,{attrs:{name:i.id,iconSize:16,checkedColor:ct}},[n]):n},"right-icon":function(){return t(ot,{attrs:{name:"edit"},class:di("edit"),on:{click:function(t){t.stopPropagation(),d(n,"edit")}}})}},on:{click:function(){r&&d(n,"select")}}},h(n)]))}fi.props={data:Object,disabled:Boolean,switchable:Boolean};var pi=hi(fi),mi=Object(r.a)("address-list"),vi=mi[0],gi=mi[1],bi=mi[2];function yi(t,e,i,n){function s(i,s){if(i)return i.map(function(i,o){return t(pi,{attrs:{data:i,disabled:s,switchable:e.switchable},key:i.id,on:{select:function(){d(n,s?"select-disabled":"select",i,o)},edit:function(){d(n,s?"edit-disabled":"edit",i,o)}}})})}var r=s(e.list),a=s(e.disabledList,!0);return t("div",o()([{class:gi()},h(n)]),[i.top&&i.top(),t(ri,{attrs:{value:e.value},on:{input:function(t){d(n,"input",t)}}},[r]),e.disabledText&&t("div",{class:gi("disabled-text")},[e.disabledText]),a,i.default&&i.default(),t(xe,{attrs:{square:!0,size:"large",type:"danger",text:e.addButtonText||bi("add")},class:gi("add"),on:{click:function(){d(n,"add")}}})])}yi.props={list:Array,disabledList:Array,disabledText:String,addButtonText:String,value:[Number,String],switchable:{type:Boolean,default:!0}};var ki=vi(yi),xi=Object(r.a)("tag"),Si=xi[0],wi=xi[1];function Ci(t,e,i,n){var s,r=e.type,a=e.mark,u=e.plain,l=e.color,c=e.round,d=e.size,f=((s={})[u?"color":"backgroundColor"]=l,s);e.textColor&&(f.color=e.textColor);var p={mark:a,plain:u,round:c};return d&&(p[d]=d),t("span",o()([{style:f,class:[wi([p,r]),{"van-hairline--surround":u}]},h(n,!0)]),[i.default&&i.default()])}Ci.props={size:String,mark:Boolean,color:String,plain:Boolean,round:Boolean,textColor:String,type:{type:String,default:"default"}};var Oi=Si(Ci),Ti=Object(r.a)("card"),$i=Ti[0],Ii=Ti[1];function Bi(t,e,i,n){var s=e.thumb,r=i.num||Object(g.b)(e.num),a=i.price||Object(g.b)(e.price),u=i["origin-price"]||Object(g.b)(e.originPrice),l=r||a||u;function c(t){d(n,"click-thumb",t)}function f(){if(i.tag||e.tag)return t("div",{class:Ii("tag")},[i.tag?i.tag():t(Oi,{attrs:{mark:!0,type:"danger"}},[e.tag])])}return t("div",o()([{class:Ii()},h(n,!0)]),[t("div",{class:Ii("header")},[function(){if(i.thumb||s)return t("a",{attrs:{href:e.thumbLink},class:Ii("thumb"),on:{click:c}},[i.thumb?i.thumb():t(tt,{attrs:{src:s,width:"100%",height:"100%",fit:"contain","lazy-load":e.lazyLoad}}),f()])}(),t("div",{class:Ii("content",{centered:e.centered})},[i.title?i.title():e.title?t("div",{class:Ii("title")},[e.title]):void 0,i.desc?i.desc():e.desc?t("div",{class:[Ii("desc"),"van-ellipsis"]},[e.desc]):void 0,i.tags&&i.tags(),l&&t("div",{class:"van-card__bottom"},[function(){if(a)return t("div",{class:Ii("price")},[i.price?i.price():e.currency+" "+e.price])}(),function(){if(u){var n=i["origin-price"];return t("div",{class:Ii("origin-price")},[n?n():e.currency+" "+e.originPrice])}}(),function(){if(r)return t("div",{class:Ii("num")},[i.num?i.num():"x "+e.num])}(),i.bottom&&i.bottom()])])]),function(){if(i.footer)return t("div",{class:Ii("footer")},[i.footer()])}()])}Bi.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 ji=$i(Bi),Ni=Object(r.a)("cell-group"),Ai=Ni[0],zi=Ni[1];function Li(t,e,i,n){var s=t("div",o()([{class:[zi(),{"van-hairline--top-bottom":e.border}]},h(n,!0)]),[i.default&&i.default()]);return e.title?t("div",[t("div",{class:zi("title")},[e.title]),s]):s}Li.props={title:String,border:{type:Boolean,default:!0}};var Ei=Ai(Li),Di=Object(r.a)("checkbox"),Mi=(0,Di[0])({mixins:[ai({bem:Di[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(){var t=this,e=!this.checked;clearTimeout(this.toggleTask),this.toggleTask=setTimeout(function(){t.checked=e})},onClickIcon:function(){this.isDisabled||this.toggle()},onClickLabel:function(){this.isDisabled||this.labelDisabled||this.toggle()},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))}}}}),Fi=Object(r.a)("checkbox-group"),Pi=Fi[0],Vi=Fi[1],Ri=Pi({mixins:[ii("vanCheckbox")],props:{max:Number,disabled:Boolean,value:{type:Array,default:function(){return[]}}},watch:{value:function(t){this.$emit("change",t)}},render:function(t){return t("div",{class:Vi()},[this.slots()])}}),_i=i(4),Hi=Object(r.a)("circle"),Wi=Hi[0],qi=Hi[1],Yi="M 530 530 m -500, 0 a 500, 500 0 1, 1 1000, 0 a 500, 500 0 1, 1 -1000, 0";function Xi(t){return Math.min(Math.max(t,0),100)}var Ui=Wi({props:{text:String,value:{type:Number,default:0},speed:{type:Number,default:0},size:{type:String,default:"100px"},fill:{type:String,default:"none"},rate:{type:Number,default:100},layerColor:{type:String,default:dt},color:{type:String,default:ht},strokeWidth:{type:Number,default:40},clockwise:{type:Boolean,default:!0}},computed:{style:function(){return{width:this.size,height:this.size}},layerStyle:function(){var t=3140*(100-this.value)/100;return t=this.clockwise?t:6280-t,{stroke:""+this.color,strokeDashoffset:t+"px",strokeWidth:this.strokeWidth+1+"px"}},hoverStyle:function(){return{fill:""+this.fill,stroke:""+this.layerColor,strokeWidth:this.strokeWidth+"px"}}},watch:{rate:{handler:function(){this.startTime=Date.now(),this.startRate=this.value,this.endRate=Xi(this.rate),this.increase=this.endRate>this.startRate,this.duration=Math.abs(1e3*(this.startRate-this.endRate)/this.speed),this.speed?(Object(_i.a)(this.rafId),this.rafId=Object(_i.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",Xi(parseFloat(e.toFixed(1)))),(this.increase?e<this.endRate:e>this.endRate)&&(this.rafId=Object(_i.c)(this.animate))}},render:function(t){return t("div",{class:qi(),style:this.style},[t("svg",{attrs:{viewBox:"0 0 1060 1060"}},[t("path",{class:qi("hover"),style:this.hoverStyle,attrs:{d:Yi}}),t("path",{class:qi("layer"),style:this.layerStyle,attrs:{d:Yi}})]),this.slots()||this.text&&t("div",{class:qi("text")},[this.text])])}}),Ki=Object(r.a)("col"),Qi=Ki[0],Gi=Ki[1],Zi=Qi({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}:{}}},render:function(t){var e,i=this.span,n=this.offset;return t(this.tag,{class:Gi((e={},e[i]=i,e["offset-"+n]=n,e)),style:this.style},[this.slots()])}}),Ji=Object(r.a)("collapse"),tn=Ji[0],en=Ji[1],nn=tn({mixins:[ii("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(t){return t("div",{class:[en(),{"van-hairline--top-bottom":this.border}]},[this.slots()])}}),sn=Object(r.a)("collapse-item"),on=sn[0],rn=sn[1],an=["title","icon","right-icon"],un=on({mixins:[ei("vanCollapse")],props:n({},qt,{name:[Number,String],disabled:Boolean,isLink:{type:Boolean,default:!0}}),data:function(){return{show:null,inited:null}},computed:{currentName:function(){return Object(g.b)(this.name)?this.name:this.index},expanded:function(){var t=this;if(!this.parent)return null;var e=this.parent.value;return this.parent.accordion?e===this.currentName:e.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:_i.c)(function(){var e=i.$refs,n=e.content,s=e.wrapper;if(n&&s){var o=n.offsetHeight;if(o){var r=o+"px";s.style.height=t?0:r,Object(_i.b)(function(){s.style.height=t?r:0})}else i.onTransitionEnd()}}))}},methods:{onClick:function(){if(!this.disabled){var t=this.parent,e=t.accordion&&this.currentName===t.value?"":this.currentName;this.parent.switch(e,!this.expanded)}},onTransitionEnd:function(){this.expanded?this.$refs.wrapper.style.height="":this.show=!1}},render:function(t){var e=this,i=this.disabled,s=this.expanded,o=an.reduce(function(t,i){return e.slots(i)&&(t[i]=function(){return e.slots(i)}),t},{});this.slots("value")&&(o.default=function(){return e.slots("value")});var r=t(Jt,{attrs:{role:"button",tabindex:i?-1:0,"aria-expanded":String(s)},class:rn("title",{disabled:i,expanded:s}),on:{click:this.onClick},scopedSlots:o,props:n({},this.$props)}),a=this.inited&&t("div",{directives:[{name:"show",value:this.show}],ref:"wrapper",class:rn("wrapper"),on:{transitionend:this.onTransitionEnd}},[t("div",{ref:"content",class:rn("content")},[this.slots()])]);return t("div",{class:[rn(),{"van-hairline--top":this.index}]},[r,a])}}),ln=Object(r.a)("contact-card"),cn=ln[0],hn=ln[1],dn=ln[2];function fn(t,e,i,n){var s=e.type,r=e.editable;return t(Jt,o()([{attrs:{center:!0,border:!1,isLink:r,valueClass:hn("value"),icon:"edit"===s?"contact":"add-square"},class:hn([s]),on:{click:function(t){r&&d(n,"click",t)}}},h(n)]),["add"===s?e.addText||dn("addText"):[t("div",[dn("name")+":"+e.name]),t("div",[dn("tel")+":"+e.tel])]])}fn.props={tel:String,name:String,addText:String,editable:{type:Boolean,default:!0},type:{type:String,default:"add"}};var pn=cn(fn),mn=Object(r.a)("contact-edit"),vn=mn[0],gn=mn[1],bn=mn[2],yn={tel:"",name:""},kn=vn({props:{isEdit:Boolean,isSaving:Boolean,isDeleting:Boolean,contactInfo:{type:Object,default:function(){return n({},yn)}},telValidator:{type:Function,default:Tt}},data:function(){return{data:n({},yn,{},this.contactInfo),errorInfo:{name:!1,tel:!1}}},watch:{contactInfo:function(t){this.data=n({},yn,{},t)}},methods:{onFocus:function(t){this.errorInfo[t]=!1},getErrorMessageByKey:function(t){var e=this.data[t].trim();switch(t){case"name":return e?"":bn("nameEmpty");case"tel":return this.telValidator(e)?"":bn("telInvalid")}},onSave:function(){var t=this;["name","tel"].every(function(e){var i=t.getErrorMessageByKey(e);return i&&(t.errorInfo[e]=!0,ve(i)),!i})&&!this.isSaving&&this.$emit("save",this.data)},onDelete:function(){var t=this;Ne.confirm({message:bn("confirmDelete")}).then(function(){t.$emit("delete",t.data)})}},render:function(t){var e=this,i=this.data,n=this.errorInfo,s=function(t){return function(){return e.onFocus(t)}};return t("div",{class:gn()},[t(oe,{attrs:{clearable:!0,maxlength:"30",label:bn("name"),placeholder:bn("nameEmpty"),error:n.name},on:{focus:s("name")},model:{value:i.name,callback:function(t){i.name=t}}}),t(oe,{attrs:{clearable:!0,type:"tel",label:bn("tel"),placeholder:bn("telEmpty"),error:n.tel},on:{focus:s("tel")},model:{value:i.tel,callback:function(t){i.tel=t}}}),t("div",{class:gn("buttons")},[t(xe,{attrs:{block:!0,type:"danger",text:bn("save"),loading:this.isSaving},on:{click:this.onSave}}),this.isEdit&&t(xe,{attrs:{block:!0,text:bn("delete"),loading:this.isDeleting},on:{click:this.onDelete}})])])}}),xn=Object(r.a)("contact-list"),Sn=xn[0],wn=xn[1],Cn=xn[2];function On(t,e,i,n){var s=e.list&&e.list.map(function(e,i){function s(){d(n,"input",e.id),d(n,"select",e,i)}return t(Jt,{key:e.id,attrs:{isLink:!0,valueClass:wn("item-value")},class:wn("item"),scopedSlots:{default:function(){return t(li,{attrs:{name:e.id,iconSize:16,checkedColor:ct},on:{click:s}},[t("div",{class:wn("name")},[e.name+","+e.tel])])},"right-icon":function(){return t(ot,{attrs:{name:"edit"},class:wn("edit"),on:{click:function(t){t.stopPropagation(),d(n,"edit",e,i)}}})}},on:{click:s}})});return t("div",o()([{class:wn()},h(n)]),[t(ri,{attrs:{value:e.value},class:wn("group")},[s]),t(xe,{attrs:{square:!0,size:"large",type:"danger",text:e.addText||Cn("addText")},class:wn("add"),on:{click:function(){d(n,"add")}}})])}On.props={value:null,list:Array,addText:String};var Tn=Sn(On),$n=i(3),In=1e3,Bn=60*In,jn=60*Bn,Nn=24*jn;var An=Object(r.a)("count-down"),zn=An[0],Ln=An[1],En=zn({props:{millisecond:Boolean,time:{type:Number,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/Nn),hours:Math.floor(t%Nn/jn),minutes:Math.floor(t%jn/Bn),seconds:Math.floor(t%Bn/In),milliseconds:Math.floor(t%In)};var t},formattedTime:function(){return t=this.format,e=this.timeData,i=e.days,n=e.hours,s=e.minutes,o=e.seconds,r=e.milliseconds,-1===t.indexOf("DD")?n+=24*i:t=t.replace("DD",Object($n.b)(i)),-1===t.indexOf("HH")?s+=60*n:t=t.replace("HH",Object($n.b)(n)),-1===t.indexOf("mm")?o+=60*s:t=t.replace("mm",Object($n.b)(s)),-1===t.indexOf("ss")?r+=1e3*o:t=t.replace("ss",Object($n.b)(o)),t.replace("SSS",Object($n.b)(r,3));var t,e,i,n,s,o,r}},watch:{time:{immediate:!0,handler:function(){this.reset()}}},methods:{start:function(){this.counting||(this.counting=!0,this.endTime=Date.now()+this.remain,this.tick())},pause:function(){this.counting=!1,Object(_i.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(_i.c)(function(){t.setRemain(t.getRemain()),0!==t.remain&&t.microTick()})},macroTick:function(){var t=this;this.rafId=Object(_i.c)(function(){var e,i,n=t.getRemain();e=n,i=t.remain,(Math.floor(e/1e3)!==Math.floor(i/1e3)||0===n)&&t.setRemain(n),0!==t.remain&&t.macroTick()})},getRemain:function(){return Math.max(this.endTime-Date.now(),0)},setRemain:function(t){this.remain=t,0===t&&(this.pause(),this.$emit("finish"))}},render:function(t){return t("div",{class:Ln()},[this.slots("default",this.timeData)||this.formattedTime])}}),Dn=Object(r.a)("coupon"),Mn=Dn[0],Fn=Dn[1],Pn=Dn[2];function Vn(t){var e=new Date(1e3*t);return e.getFullYear()+"."+Object($n.b)(e.getMonth()+1)+"."+Object($n.b)(e.getDate())}function Rn(t){return(t/100).toFixed(t%100==0?0:t%10==0?1:2)}var _n=Mn({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 Pn("valid")+":"+Vn(e)+" - "+Vn(i)},faceAmount:function(){var t,e=this.coupon;return e.valueDesc?e.valueDesc+"<span>"+(e.unitDesc||"")+"</span>":e.denominations?"<span>"+this.currency+"</span> "+Rn(this.coupon.denominations):e.discount?Pn("discount",((t=this.coupon.discount)/10).toFixed(t%10==0?0:1)):""},conditionMessage:function(){var t=Rn(this.coupon.originCondition);return"0"===t?Pn("unlimited"):Pn("condition",t)}},render:function(t){var e=this.coupon,i=this.disabled,n=i&&e.reason||e.description;return t("div",{class:Fn({disabled:i})},[t("div",{class:Fn("content")},[t("div",{class:Fn("head")},[t("h2",{class:Fn("amount"),domProps:{innerHTML:this.faceAmount}}),t("p",[this.coupon.condition||this.conditionMessage])]),t("div",{class:Fn("body")},[t("h2",{class:Fn("name")},[e.name]),t("p",[this.validPeriod]),this.chosen&&t(Mi,{attrs:{value:!0,"checked-color":ct},class:Fn("corner")})])]),n&&t("p",{class:Fn("description")},[n])])}}),Hn=Object(r.a)("coupon-cell"),Wn=Hn[0],qn=Hn[1],Yn=Hn[2];function Xn(t,e,i,n){var s=e.coupons[e.chosenCoupon]?"van-coupon-cell--selected":"",r=function(t){var e=t.coupons,i=t.chosenCoupon,n=t.currency,s=e[i];return s?"-"+n+((s.denominations||s.value)/100).toFixed(2):0===e.length?Yn("tips"):Yn("count",e.length)}(e);return t(Jt,o()([{class:qn(),attrs:{value:r,title:e.title||Yn("title"),border:e.border,isLink:e.editable,valueClass:s}},h(n,!0)]))}Xn.model={prop:"chosenCoupon"},Xn.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,default:-1}};var Un=Wn(Xn),Kn=Object(r.a)("tab"),Qn=Kn[0],Gn=Kn[1],Zn=Qn({mixins:[ei("vanTabs")],props:{name:[Number,String],title:String,disabled:Boolean},data:function(){return{inited:!1}},computed:{computedName:function(){return 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()}},mounted:function(){this.slots("title")&&this.parent.renderTitle(this.$refs.title,this.index)},render:function(t){var e=this.slots,i=this.isActive,n=[this.inited||!this.parent.lazyRender?e():t()];return e("title")&&n.push(t("div",{ref:"title"},[e("title")])),this.parent.animated?t("div",{attrs:{role:"tabpanel","aria-hidden":!i},class:Gn("pane-wrapper",{inactive:!i})},[t("div",{class:Gn("pane")},[n])]):t("div",{directives:[{name:"show",value:i}],attrs:{role:"tabpanel"},class:Gn("pane")},[n])}});var Jn=Object(r.a)("tab")[1],ts={props:{type:String,color:String,title:String,isActive:Boolean,ellipsis:Boolean,disabled:Boolean,scrollable:Boolean,activeColor:String,inactiveColor:String,swipeThreshold:Number},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")},renderTitle:function(t){var e=this.$refs.title;e.innerHTML="",e.appendChild(t)}},render:function(t){return t("div",{attrs:{role:"tab","aria-selected":this.isActive},class:Jn({active:this.isActive,disabled:this.disabled,complete:!this.ellipsis}),style:this.style,on:{click:this.onClick}},[t("span",{ref:"title",class:{"van-ellipsis":this.ellipsis}},[this.title])])}},es=Object(r.a)("tabs"),is=es[0],ns=es[1],ss=is({mixins:[v],props:{count:Number,duration:Number,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))},renderChildren:function(){var t=this.$createElement;return this.animated?t("div",{class:ns("track"),style:this.style},[this.slots()]):this.slots()}},render:function(t){return t("div",{class:ns("content",{animated:this.animated}),on:n({},this.listeners)},[this.renderChildren()])}}),os=Object(r.a)("sticky"),rs=os[0],as=os[1],us=rs({mixins:[Se(function(t){this.scroller||(this.scroller=D(this.$el)),t(this.scroller,"scroll",this.onScroll,!0),this.onScroll()})],props:{zIndex:Number,container:null,offsetTop:{type:Number,default:0}},data:function(){return{fixed:!1,height:0,transform:0}},computed:{style:function(){if(this.fixed){var t={};return Object(g.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}}},methods:{onScroll:function(){var t=this;this.height=this.$el.offsetHeight;var e=this.container,i=this.offsetTop,n=M(this.scroller),s=R(this.$el),o=function(){t.$emit("scroll",{scrollTop:n,isFixed:t.fixed})};if(e){var r=s+e.offsetHeight;if(n+i+this.height>r){var a=this.height+n-r;return a<this.height?(this.fixed=!0,this.transform=-(a+i)):this.fixed=!1,void o()}}n+i>s?(this.fixed=!0,this.transform=0):this.fixed=!1,o()}},render:function(t){var e=this.fixed;return t("div",{style:{height:e?this.height+"px":null}},[t("div",{class:as({fixed:e}),style:this.style},[this.slots()])])}}),ls=Object(r.a)("tabs"),cs=ls[0],hs=ls[1],ds=cs({mixins:[ii("vanTabs"),Se(function(t){t(window,"resize",this.setLine,!0)})],model:{prop:"active"},props:{color:String,sticky:Boolean,animated:Boolean,swipeable: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,default:.3},offsetTop:{type:Number,default:0},lazyRender:{type:Boolean,default:!0},swipeThreshold:{type:Number,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}},watch:{active:function(t){t!==this.currentName&&this.setCurrentIndexByName(t)},color:function(){this.setLine()},children:function(){this.setCurrentIndexByName(this.currentName||this.active),this.scrollIntoView(),this.setLine()},currentIndex:function(){this.scrollIntoView(),this.setLine(),this.stickyFixed&&V(R(this.$el)-this.offsetTop)}},mounted:function(){this.onShow()},activated:function(){this.onShow(),this.setLine()},methods:{onShow:function(){var t=this;this.$nextTick(function(){t.inited=!0,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){var n=i[t.currentIndex].$el,s=t.lineWidth,o=t.lineHeight,r=Object(g.b)(s)?s:n.offsetWidth/2,a=n.offsetLeft+n.offsetWidth/2,u={width:Object(q.a)(r),backgroundColor:t.color,transform:"translateX("+a+"px) translateX(-50%)"};if(e&&(u.transitionDuration=t.duration+"s"),Object(g.b)(o)){var l=Object(q.a)(o);u.height=l,u.borderRadius=l}t.lineStyle=u}})},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(g.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<this.currentIndex?-1:1;t>=0&&t<this.children.length;){if(!this.children[t].disabled)return t;t+=e}},onClick:function(t){var e=this.children[t],i=e.title,n=e.disabled,s=e.computedName;n?this.$emit("disabled",s,i):(this.setCurrentIndex(t),this.$emit("click",s,i))},scrollIntoView:function(t){var e=this.$refs.titles;if(this.scrollable&&e&&e[this.currentIndex]){var i=this.$refs.nav,n=e[this.currentIndex].$el;!function(t,e,i){var n=0,s=t.scrollLeft,o=0===i?1:Math.round(1e3*i/16);!function i(){t.scrollLeft+=(e-s)/o,++n<o&&Object(_i.c)(i)}()}(i,n.offsetLeft-(i.offsetWidth-n.offsetWidth)/2,t?0:this.duration)}},renderTitle:function(t,e){var i=this;this.$nextTick(function(){i.$refs.titles[e].renderTitle(t)})},onScroll:function(t){this.stickyFixed=t.isFixed,this.$emit("scroll",t)}},render:function(t){var e=this,i=this.type,n=this.ellipsis,s=this.animated,o=this.scrollable,r=this.children.map(function(s,r){return t(ts,{ref:"titles",refInFor:!0,attrs:{type:i,title:s.title,color:e.color,isActive:r===e.currentIndex,ellipsis:n,disabled:s.disabled,scrollable:o,activeColor:e.titleActiveColor,inactiveColor:e.titleInactiveColor,swipeThreshold:e.swipeThreshold},on:{click:function(){e.onClick(r)}}})}),a=t("div",{ref:"wrap",class:[hs("wrap",{scrollable:o}),{"van-hairline--top-bottom":"line"===i&&this.border}]},[t("div",{ref:"nav",attrs:{role:"tablist"},class:hs("nav",[i]),style:this.navStyle},[this.slots("nav-left"),r,"line"===i&&t("div",{class:hs("line"),style:this.lineStyle}),this.slots("nav-right")])]);return t("div",{class:hs([i])},[this.sticky?t(us,{attrs:{container:this.$el,offsetTop:this.offsetTop},on:{scroll:this.onScroll}},[a]):a,t(ss,{attrs:{count:this.children.length,animated:s,duration:this.duration,swipeable:this.swipeable,currentIndex:this.currentIndex},on:{change:this.setCurrentIndex}},[this.slots()])])}}),fs=Object(r.a)("coupon-list"),ps=fs[0],ms=fs[1],vs=fs[2],gs=ps({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},currency:{type:String,default:"¥"}},data:function(){return{tab:0,winHeight:window.innerHeight,currentCode:this.code||""}},computed:{buttonDisabled:function(){return!this.exchangeButtonLoading&&(this.exchangeButtonDisabled||!this.currentCode||this.currentCode.length<this.exchangeMinLength)},listStyle:function(){return{height:this.winHeight-(this.showExchangeBar?140:94)+"px"}}},watch:{code:function(t){this.currentCode=t},currentCode:function(t){this.$emit("input",t)},displayedCouponIndex:function(t){this.scrollToShowCoupon(t)}},mounted:function(){this.scrollToShowCoupon(this.displayedCouponIndex)},methods:{onClickExchangeButton:function(){this.$emit("exchange",this.currentCode),this.code||(this.currentCode="")},scrollToShowCoupon:function(t){var e=this;-1!==t&&this.$nextTick(function(){var i=e.$refs,n=i.card,s=i.list;s&&n&&n[t]&&(s.scrollTop=n[t].$el.offsetTop-100)})},renderEmpty:function(){var t=this.$createElement;return t("div",{class:ms("empty")},[t("img",{attrs:{src:"https://img.yzcdn.cn/vant/coupon-empty.png"}}),t("p",[vs("empty")])])},renderExchangeButton:function(){return(0,this.$createElement)(xe,{attrs:{size:"small",type:"danger",text:this.exchangeButtonText||vs("exchange"),loading:this.exchangeButtonLoading,disabled:this.buttonDisabled},class:ms("exchange"),on:{click:this.onClickExchangeButton}})}},render:function(t){var e=this,i=this.coupons,n=this.disabledCoupons,s=(this.enabledTitle||vs("enable"))+" ("+i.length+")",o=(this.disabledTitle||vs("disabled"))+" ("+n.length+")",r=this.showExchangeBar&&t(oe,{attrs:{clearable:!0,border:!1,placeholder:this.inputPlaceholder||vs("placeholder"),maxlength:"20"},class:ms("field"),scopedSlots:{button:this.renderExchangeButton},model:{value:e.currentCode,callback:function(t){e.currentCode=t}}}),a=function(t){return function(){return e.$emit("change",t)}},u=t(Zn,{attrs:{title:s}},[t("div",{class:ms("list"),style:this.listStyle},[i.map(function(i,n){return t(_n,{ref:"card",key:i.id,attrs:{coupon:i,currency:e.currency,chosen:n===e.chosenCoupon},nativeOn:{click:a(n)}})}),!i.length&&this.renderEmpty()])]),l=t(Zn,{attrs:{title:o}},[t("div",{class:ms("list"),style:this.listStyle},[n.map(function(i){return t(_n,{attrs:{disabled:!0,coupon:i,currency:e.currency},key:i.id})}),!n.length&&this.renderEmpty()])]);return t("div",{class:ms()},[r,t(ds,{class:ms("tab"),attrs:{"line-width":120},model:{value:e.tab,callback:function(t){e.tab=t}}},[u,l]),t(xe,{directives:[{name:"show",value:this.showCloseButton}],attrs:{size:"large",text:this.closeButtonText||vs("close")},class:ms("close"),on:{click:a(-1)}})])}});function bs(t){return"[object Date]"===Object.prototype.toString.call(t)&&!isNaN(t.getTime())}function ys(t){if(t){for(;isNaN(parseInt(t,10));)t=t.slice(1);return parseInt(t,10)}}function ks(t,e){return 32-new Date(t,e-1,32).getDate()}var xs=Object(r.a)("datetime-picker"),Ss=xs[0],ws=xs[1],Cs=(new Date).getFullYear(),Os=Ss({props:n({},Bt,{value:null,filter:Function,minHour:{type:Number,default:0},minMinute:{type:Number,default:0},type:{type:String,default:"datetime"},showToolbar:{type:Boolean,default:!0},format:{type:String,default:"YYYY.MM.DD HH时 mm分"},formatter:{type:Function,default:function(t,e){return e}},minDate:{type:Date,default:function(){return new Date(Cs-10,0,1)},validator:bs},maxDate:{type:Date,default:function(){return new Date(Cs+10,11,31)},validator:bs},maxHour:{type:Number,default:23},maxMinute:{type:Number,default:59}}),data:function(){return{innerValue:this.correctValue(this.value)}},watch:{value:function(t){t=this.correctValue(t),("time"===this.type?t===this.innerValue:t.valueOf()===this.innerValue.valueOf())||(this.innerValue=t,"time"===this.type&&this.updateColumnValue(t))},innerValue:function(t){this.$emit("input",t)},columns:function(){this.updateColumnValue(this.innerValue)}},computed:{ranges:function(){if("time"===this.type)return[{type:"hour",range:[this.minHour,this.maxHour]},{type:"minute",range:[this.minMinute,this.maxMinute]}];var t=this.getBoundary("max",this.innerValue),e=t.maxYear,i=t.maxDate,n=t.maxMonth,s=t.maxHour,o=t.maxMinute,r=this.getBoundary("min",this.innerValue),a=r.minYear,u=r.minDate,l=[{type:"year",range:[a,e]},{type:"month",range:[r.minMonth,n]},{type:"day",range:[u,i]},{type:"hour",range:[r.minHour,s]},{type:"minute",range:[r.minMinute,o]}];return"date"===this.type&&l.splice(3,2),"year-month"===this.type&&l.splice(2,3),l},columns:function(){var t=this;return this.ranges.map(function(e){var i=e.type,n=e.range,s=function(t,e){for(var i=-1,n=Array(t);++i<t;)n[i]=e(i);return n}(n[1]-n[0]+1,function(e){var s=Object($n.b)(n[0]+e);return t.formatter(i,s)});return t.filter&&(s=t.filter(i,s)),{values:s}})}},mounted:function(){this.updateColumnValue(this.innerValue)},methods:{correctValue:function(t){var e="time"!==this.type;if(e&&!bs(t)?t=this.minDate:t||(t=Object($n.b)(this.minHour)+":00"),!e){var i=t.split(":"),n=i[0],s=i[1];return(n=Object($n.b)(jt(n,this.minHour,this.maxHour)))+":"+(s=Object($n.b)(jt(s,this.minMinute,this.maxMinute)))}return t=Math.max(t,this.minDate.getTime()),t=Math.min(t,this.maxDate.getTime()),new Date(t)},getBoundary:function(t,e){var i,n=this[t+"Date"],s=n.getFullYear(),o=1,r=1,a=0,u=0;return"max"===t&&(o=12,r=ks(e.getFullYear(),e.getMonth()+1),a=23,u=59),e.getFullYear()===s&&(o=n.getMonth()+1,e.getMonth()+1===o&&(r=n.getDate(),e.getDate()===r&&(a=n.getHours(),e.getHours()===a&&(u=n.getMinutes())))),(i={})[t+"Year"]=s,i[t+"Month"]=o,i[t+"Date"]=r,i[t+"Hour"]=a,i[t+"Minute"]=u,i},onConfirm:function(){this.$emit("confirm",this.innerValue)},onChange:function(t){var e,i=this;if("time"===this.type)e=t.getValues().join(":");else{var n=t.getValues(),s=ys(n[0]),o=ys(n[1]),r=ks(s,o),a=ys(n[2]);"year-month"===this.type&&(a=1),a=a>r?r:a;var u=0,l=0;"datetime"===this.type&&(u=ys(n[3]),l=ys(n[4])),e=new Date(s,o-1,a,u,l)}this.innerValue=this.correctValue(e),this.$nextTick(function(){i.$nextTick(function(){i.$emit("change",t)})})},updateColumnValue:function(t){var e=this,i=[],n=this.formatter;if("time"===this.type){var s=t.split(":");i=[n("hour",s[0]),n("minute",s[1])]}else i=[n("year",""+t.getFullYear()),n("month",Object($n.b)(t.getMonth()+1)),n("day",Object($n.b)(t.getDate()))],"datetime"===this.type&&i.push(n("hour",Object($n.b)(t.getHours())),n("minute",Object($n.b)(t.getMinutes()))),"year-month"===this.type&&(i=i.slice(0,2));this.$nextTick(function(){e.$refs.picker.setValues(i)})}},render:function(t){var e=this,i={};return Object.keys(Bt).forEach(function(t){i[t]=e[t]}),t(Vt,{class:ws(),ref:"picker",attrs:{columns:this.columns},on:{change:this.onChange,confirm:this.onConfirm,cancel:function(){e.$emit("cancel")}},props:n({},i)})}}),Ts=Object(r.a)("divider"),$s=Ts[0],Is=Ts[1];function Bs(t,e,i,n){var s;return t("div",o()([{style:{borderColor:e.borderColor},class:Is((s={dashed:e.dashed,hairline:e.hairline},s["content-"+e.contentPosition]=i.default,s))},h(n,!0)]),[i.default&&i.default()])}Bs.props={dashed:Boolean,hairline:{type:Boolean,default:!0},contentPosition:{type:String,default:"center"}};var js=$s(Bs),Ns=Object(r.a)("dropdown-item"),As=Ns[0],zs=Ns[1],Ls=As({mixins:[ei("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:""}},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))}},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")},render:function(t){var e=this,i=this.parent,n=i.zIndex,s=i.offset,o=i.overlay,r=i.duration,a=i.direction,u=i.activeColor,l=i.closeOnClickOverlay,c=this.options.map(function(i){var n=i.value===e.value;return t(Jt,{attrs:{clickable:!0,icon:i.icon,title:i.text},key:i.value,style:{color:n?u:""},on:{click:function(){e.showPopup=!1,i.value!==e.value&&(e.$emit("input",i.value),e.$emit("change",i.value))}}},[n&&t(ot,{class:zs("icon"),attrs:{color:u,name:"success"}})])}),h={zIndex:n};return"down"===a?h.top=s+"px":h.bottom=s+"px",t("div",{directives:[{name:"show",value:this.showWrapper}],style:h,class:zs([a])},[t(lt,{attrs:{overlay:o,position:"down"===a?"top":"bottom",duration:this.transition?r:0,closeOnClickOverlay:l,overlayStyle:{position:"absolute"}},class:zs("content"),on:{open:this.onOpen,close:this.onClose,opened:this.onOpened,closed:function(){e.showWrapper=!1,e.$emit("closed")}},model:{value:e.showPopup,callback:function(t){e.showPopup=t}}},[c,this.slots("default")])])}}),Es=function(t){return u.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(){k(document,t.event,this.clickOutsideHandler)},beforeDestroy:function(){x(document,t.event,this.clickOutsideHandler)}})},Ds=Object(r.a)("dropdown-menu"),Ms=Ds[0],Fs=Ds[1],Ps=Ms({mixins:[ii("vanDropdownMenu"),Es({event:"click",method:"onClickOutside"})],props:{overlay:{type:Boolean,default:!0},zIndex:{type:Number,default:10},duration:{type:Number,default:.2},direction:{type:String,default:"down"},activeColor:{type:String,default:ht},closeOnClickOverlay:{type:Boolean,default:!0}},data:function(){return{offset:0}},methods:{updateOffset:function(){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(t){var e=this,i=this.children.map(function(i,n){return t("div",{attrs:{role:"button",tabindex:i.disabled?-1:0},class:Fs("item",{disabled:i.disabled}),on:{click:function(){i.disabled||e.toggleItem(n)}}},[t("span",{class:[Fs("title",{down:i.showPopup===("down"===e.direction)}),i.titleClass],style:{color:i.showPopup?e.activeColor:""}},[t("div",{class:"van-ellipsis"},[i.displayTitle])])])});return t("div",{ref:"menu",class:[Fs(),"van-hairline--top-bottom"]},[i,this.slots("default")])}}),Vs=Object(r.a)("goods-action"),Rs=Vs[0],_s=Vs[1];function Hs(t,e,i,n){return t("div",o()([{class:_s({"safe-area-inset-bottom":e.safeAreaInsetBottom})},h(n,!0)]),[i.default&&i.default()])}Hs.props={safeAreaInsetBottom:Boolean};var Ws=Rs(Hs),qs=Object(r.a)("goods-action-button"),Ys=qs[0],Xs=qs[1];function Us(t,e,i,n){return t(xe,o()([{attrs:{square:!0,size:"large",type:e.type,loading:e.loading,disabled:e.disabled},class:Xs(),on:{click:function(t){d(n,"click",t),Xt(n)}}},h(n)]),[i.default?i.default():e.text])}Us.props=n({},Ut,{type:String,text:String,loading:Boolean,disabled:Boolean});var Ks=Ys(Us),Qs=Object(r.a)("goods-action-icon"),Gs=Qs[0],Zs=Qs[1];function Js(t,e,i,n){return t("div",o()([{attrs:{role:"button",tabindex:"0"},class:Zs(),on:{click:function(t){d(n,"click",t),Xt(n)}}},h(n)]),[i.icon?t("div",{class:Zs("icon")},[i.icon()]):t(ot,{class:[Zs("icon"),e.iconClass],attrs:{tag:"div",info:e.info,name:e.icon}}),i.default?i.default():e.text])}Js.props=n({},Ut,{text:String,icon:String,info:[Number,String],iconClass:null});var to=Gs(Js),eo=Object(r.a)("grid"),io=eo[0],no=eo[1],so=io({mixins:[ii("vanGrid")],props:{square:Boolean,gutter:[Number,String],clickable:Boolean,columnNum:{type:Number,default:4},center:{type:Boolean,default:!0},border:{type:Boolean,default:!0}},computed:{style:function(){var t=this.gutter;if(t)return{paddingLeft:Object(q.a)(t)}}},render:function(t){return t("div",{style:this.style,class:[no(),{"van-hairline--top":this.border&&!this.gutter}]},[this.slots()])}}),oo=Object(r.a)("grid-item"),ro=oo[0],ao=oo[1],uo=ro({mixins:[ei("vanGrid")],props:n({},Ut,{icon:String,text:String}),computed:{style:function(){var t=this.parent,e=t.square,i=t.gutter,n=t.columnNum,s=100/n+"%",o={flexBasis:s};if(e)o.paddingTop=s;else if(i){var r=Object(q.a)(i);o.paddingRight=r,this.index>=n&&(o.marginTop=r)}return o},contentStyle:function(){var t=this.parent,e=t.square,i=t.gutter;if(e&&i){var n=Object(q.a)(i);return{right:n,bottom:n,height:"auto"}}}},methods:{onClick:function(t){this.$emit("click",t),Yt(this.$router,this)},renderContent:function(){var t=this.$createElement,e=this.slots();return e||[this.slots("icon")||this.icon&&t(ot,{attrs:{name:this.icon},class:ao("icon")}),this.slots("text")||this.text&&t("span",{class:ao("text")},[this.text])]}},render:function(t){var e=this.parent,i=e.center,n=e.border,s=e.square,o=e.gutter,r=e.clickable;return t("div",{class:[ao({square:s})],style:this.style,on:{click:this.onClick}},[t("div",{style:this.contentStyle,class:[ao("content",{center:i,square:s,clickable:r,surround:n&&o}),{"van-hairline":n}]},[this.renderContent()])])}}),lo=Object(r.a)("swipe"),co=lo[0],ho=lo[1],fo=co({mixins:[v,Se(function(t,e){t(window,"resize",this.onResize,!0),e?this.initialize():this.clear()})],props:{width:Number,height:Number,autoplay:Number,vertical:Boolean,indicatorColor:String,loop:{type:Boolean,default:!0},duration:{type:Number,default:500},touchable:{type:Boolean,default:!0},initialSwipe:{type:Number,default:0},showIndicators:{type:Boolean,default:!0}},data:function(){return{computedWidth:0,computedHeight:0,offset:0,active:0,deltaX:0,deltaY:0,swipes:[],swiping:!1}},watch:{swipes:function(){this.initialize()},initialSwipe:function(){this.initialize()},autoplay:function(t){t?this.autoPlay():this.clear()}},computed:{count:function(){return this.swipes.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(){var t=this.$el.getBoundingClientRect();return(this.vertical?t.height:t.width)-this.size*this.count}},methods:{initialize:function(t){if(void 0===t&&(t=this.initialSwipe),clearTimeout(this.timer),this.$el){var e=this.$el.getBoundingClientRect();this.computedWidth=this.width||e.width,this.computedHeight=this.height||e.height}this.swiping=!0,this.active=t,this.offset=this.count>1?-this.size*this.active:0,this.swipes.forEach(function(t){t.offset=0}),this.autoPlay()},onResize:function(){this.initialize(this.activeIndicator)},onTouchStart:function(t){this.touchable&&(this.clear(),this.swiping=!0,this.touchStart(t),this.correctPosition())},onTouchMove:function(t){this.touchable&&this.swiping&&(this.touchMove(t),this.isCorrectDirection&&(w(t,!0),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?jt(e+t,-1,i):jt(e+t,0,i-1):e},getTargetOffset:function(t,e){var i=t*this.size;this.loop||(i=Math.min(i,-this.minOffset));var n=Math.round(e-i);return this.loop||(n=jt(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,o=t.emitChange,r=this.loop,a=this.count,u=this.active,l=this.swipes,c=this.trackSize,h=this.minOffset;if(!(a<=1)){var d=this.getTargetActive(i),f=this.getTargetOffset(d,s);if(r){if(l[0]){var p=f<h;l[0].offset=p?c:0}if(l[a-1]){var m=f>0;l[a-1].offset=m?-c:0}}this.active=d,this.offset=f,o&&d!==u&&this.$emit("change",this.activeIndicator)}},swipeTo:function(t,e){var i=this;void 0===e&&(e={}),this.swiping=!0,this.resetTouchStatus(),this.correctPosition(),Object(_i.b)(function(){i.move({pace:t%i.count-i.active,emitChange:!0}),e.immediate?Object(_i.b)(function(){i.swiping=!1}):i.swiping=!1})},correctPosition:function(){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&&this.count>1&&(this.clear(),this.timer=setTimeout(function(){t.swiping=!0,t.resetTouchStatus(),t.correctPosition(),Object(_i.b)(function(){t.swiping=!1,t.move({pace:1,emitChange:!0}),t.autoPlay()})},e))},renderIndicator: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:ho("indicators",{vertical:this.vertical})},[Array.apply(void 0,Array(i)).map(function(i,s){return e("i",{class:ho("indicator",{active:s===n}),style:s===n?t.indicatorStyle:null})})]):void 0)}},render:function(t){return t("div",{class:ho()},[t("div",{ref:"track",style:this.trackStyle,class:ho("track"),on:{touchstart:this.onTouchStart,touchmove:this.onTouchMove,touchend:this.onTouchEnd,touchcancel:this.onTouchEnd}},[this.slots()]),this.renderIndicator()])}}),po=Object(r.a)("swipe-item"),mo=po[0],vo=po[1],go=mo({data:function(){return{offset:0}},beforeCreate:function(){this.$parent.swipes.push(this)},destroyed:function(){this.$parent.swipes.splice(this.$parent.swipes.indexOf(this),1)},render:function(t){var e=this.$parent,i=e.vertical,s=e.computedWidth,o=e.computedHeight,r={width:s+"px",height:i?o+"px":"100%",transform:"translate"+(i?"Y":"X")+"("+this.offset+"px)"};return t("div",{class:vo(),style:r,on:n({},this.$listeners)},[this.slots()])}}),bo=Object(r.a)("image-preview"),yo=bo[0],ko=bo[1];function xo(t){return Math.sqrt(Math.abs((t[0].clientX-t[1].clientX)*(t[0].clientY-t[1].clientY)))}var So,wo=yo({mixins:[W,v,Ce],props:{className:null,lazyLoad:Boolean,asyncClose:Boolean,showIndicators:Boolean,images:{type:Array,default:function(){return[]}},loop:{type:Boolean,default:!0},overlay:{type:Boolean,default:!0},showIndex:{type:Boolean,default:!0},startPosition:{type:Number,default:0},minZoom:{type:Number,default:1/3},maxZoom:{type:Number,default:3},overlayClass:{type:String,default:ko("overlay")},closeOnClickOverlay:{type:Boolean,default:!0}},data:function(){return this.bindStatus=!1,{scale:1,moveX:0,moveY:0,moving:!1,zooming:!1,active:0,doubleClickTimer:null}},computed:{imageStyle:function(){var t=this.scale,e={transition:this.zooming||this.moving?"":".3s all"};return 1!==t&&(e.transform="scale3d("+t+", "+t+", 1) translate("+this.moveX/t+"px, "+this.moveY/t+"px)"),e}},watch:{value:function(){this.active=this.startPosition},startPosition:function(t){this.active=t}},methods:{onWrapperTouchStart:function(){this.touchStartTime=new Date},onWrapperTouchEnd:function(t){var e=this;w(t);var i=new Date-this.touchStartTime,n=this.$refs.swipe||{},s=n.offsetX,o=void 0===s?0:s,r=n.offsetY;i<300&&o<10&&(void 0===r?0:r)<10&&(this.doubleClickTimer?(clearTimeout(this.doubleClickTimer),this.doubleClickTimer=null,this.toggleScale()):this.doubleClickTimer=setTimeout(function(){var t=e.active;e.resetScale(),e.$emit("close",{index:t,url:e.images[t]}),e.asyncClose||e.$emit("input",!1),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=xo(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)&&w(t,!0),this.moving){this.touchMove(t);var i=this.deltaX+this.startMoveX,n=this.deltaY+this.startMoveY;this.moveX=jt(i,-this.maxMoveX,this.maxMoveX),this.moveY=jt(n,-this.maxMoveY,this.maxMoveY)}if(this.zooming&&2===e.length){var s=xo(e),o=this.startScale*s/this.startDistance;this.scale=jt(o,this.minZoom,this.maxZoom)}},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&&w(t,!0)}},onSwipeChange:function(t){this.resetScale(),this.active=t,this.$emit("change",t)},resetScale:function(){this.scale=1,this.moveX=0,this.moveY=0},toggleScale:function(){var t=this.scale>1?1:2;this.scale=t,this.moveX=0,this.moveY=0}},render:function(t){var e=this;if(this.value){var i=this.active,n=this.images,s=this.showIndex&&t("div",{class:ko("index")},[this.slots("index")||i+1+"/"+n.length]),r=t(fo,{ref:"swipe",attrs:{loop:this.loop,indicatorColor:"white",initialSwipe:this.startPosition,showIndicators:this.showIndicators},on:{change:this.onSwipeChange}},[n.map(function(n,s){var r={class:ko("image"),style:s===i?e.imageStyle:null,on:{touchstart:e.onImageTouchStart,touchmove:e.onImageTouchMove,touchend:e.onImageTouchEnd,touchcancel:e.onImageTouchEnd}};return t(go,[e.lazyLoad?t("img",o()([{directives:[{name:"lazy",value:n}]},r])):t("img",o()([{attrs:{src:n}},r]))])})]);return t("transition",{attrs:{name:"van-fade"}},[t("div",{class:[ko(),this.className],on:{touchstart:this.onWrapperTouchStart,touchMove:w,touchend:this.onWrapperTouchEnd,touchcancel:this.onWrapperTouchEnd}},[s,r])])}}}),Co={images:[],loop:!0,value:!0,minZoom:1/3,maxZoom:3,className:"",lazyLoad:!1,showIndex:!0,asyncClose:!1,startPosition:0,showIndicators:!1,closeOnPopstate:!1},Oo=function(t,e){if(void 0===e&&(e=0),!g.d){So||(So=new(u.a.extend(wo))({el:document.createElement("div")}),document.body.appendChild(So.$el),So.$on("change",function(t){So.onChange&&So.onChange(t)}));var i=Array.isArray(t)?{images:t,startPosition:e}:t;return n(So,Co,i),So.$once("input",function(t){So.value=t}),i.onClose&&So.$once("close",i.onClose),So}};Oo.install=function(){u.a.use(wo)};var To=Oo,$o=Object(r.a)("index-anchor"),Io=$o[0],Bo=$o[1],jo=Io({mixins:[ei("vanIndexBar",{indexKey:"childrenIndex"})],props:{index:[Number,String]},data:function(){return{top:0,active:!1}},computed:{sticky:function(){return this.active&&this.parent.sticky},anchorStyle:function(){if(this.sticky)return{transform:"translate3d(0, "+this.top+"px, 0)",color:this.parent.highlightColor,zIndex:""+this.parent.zIndex}}},mounted:function(){this.height=this.$el.offsetHeight},methods:{scrollIntoView:function(){this.$el.scrollIntoView()}},render:function(t){var e=this.sticky;return t("div",{style:{height:e?this.height+"px":null}},[t("div",{style:this.anchorStyle,class:[Bo({sticky:e}),{"van-hairline--bottom":e}]},[this.slots("default")||this.index])])}}),No=Object(r.a)("index-bar"),Ao=No[0],zo=No[1],Lo=Ao({mixins:[v,ii("vanIndexBar"),Se(function(t){this.scroller||(this.scroller=D(this.$el)),t(this.scroller,"scroll",this.onScroll)})],props:{sticky:{type:Boolean,default:!0},zIndex:{type:Number,default:1},highlightColor:{type:String,default:"#07c160"},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:{highlightStyle:function(){var t=this.highlightColor;if(t)return{color:t}}},methods:{onScroll:function(){var t,e=this;t=this.scroller===window||this.scroller===document.body?M(this.scroller):0;var i=this.children.map(function(t){return{height:t.height,top:R(t.$el)}}),n=this.getActiveAnchorIndex(t,i);this.activeAnchorIndex=this.indexList[n],this.sticky&&this.children.forEach(function(s,o){if(o===n)s.active=!0,s.top=Math.max(e.stickyOffsetTop,i[o].top-t);else if(o===n-1){var r=i[n].top-t;s.active=r>0,s.top=r-s.height}else s.active=!1})},getActiveAnchorIndex:function(t,e){for(var i=this.children.length-1;i>=0;i--){if(t+(i>0?e[i-1].height:0)+this.stickyOffsetTop>=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.cancelable&&t.preventDefault();var e=t.touches[0],i=e.clientX,n=e.clientY,s=document.elementFromPoint(i,n);if(s){var o=s.dataset.index;this.touchActiveIndex!==o&&(this.touchActiveIndex=o,this.scrollToElement(s))}}},scrollToElement:function(t,e){var i=t.dataset.index;if(i){var n=this.children.filter(function(t){return String(t.index)===i});n[0]&&(n[0].scrollIntoView(),this.stickyOffsetTop&&V(P()-this.stickyOffsetTop),this.$emit("select",n[0].index))}},onTouchEnd:function(){this.active=null}},render:function(t){var e=this,i=this.indexList.map(function(i){var n=i===e.activeAnchorIndex;return t("span",{class:zo("index",{active:n}),style:n?e.highlightStyle:null,attrs:{"data-index":i}},[i])});return t("div",{class:zo()},[t("div",{class:zo("sidebar"),style:{zIndex:this.zIndex},on:{click:this.onClick,touchstart:this.touchStart,touchmove:this.onTouchMove,touchend:this.onTouchEnd,touchcancel:this.onTouchEnd}},[i]),this.slots("default")])}}),Eo=i(10),Do=i.n(Eo).a,Mo=Object(r.a)("list"),Fo=Mo[0],Po=Mo[1],Vo=Mo[2],Ro=Fo({mixins:[Se(function(t){this.scroller||(this.scroller=D(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,default:300},direction:{type:String,default:"down"}},mounted:function(){this.immediateCheck&&this.$nextTick(this.check)},watch:{loading:function(){this.$nextTick(this.check)},finished:function(){this.$nextTick(this.check)}},methods:{check:function(){if(!(this.loading||this.finished||this.error)){var t,e=this.$el,i=this.scroller,n=this.offset,s=this.direction;if(!((t=i.getBoundingClientRect?i.getBoundingClientRect():{top:0,bottom:i.innerHeight}).bottom-t.top)||"none"===window.getComputedStyle(e).display||null===e.offsetParent)return!1;var o=this.$refs.placeholder.getBoundingClientRect();("up"===s?o.top-t.top<=n:o.bottom-t.bottom<=n)&&(this.$emit("input",!0),this.$emit("load"))}},clickErrorText:function(){this.$emit("update:error",!1),this.$nextTick(this.check)}},render:function(t){var e=t("div",{ref:"placeholder",class:Po("placeholder")});return t("div",{class:Po(),attrs:{role:"feed","aria-busy":this.loading}},["down"===this.direction?this.slots():e,this.loading&&t("div",{class:Po("loading"),key:"loading"},[this.slots("loading")||t(kt,{attrs:{size:"16"}},[this.loadingText||Vo("loading")])]),this.finished&&this.finishedText&&t("div",{class:Po("finished-text")},[this.finishedText]),this.error&&this.errorText&&t("div",{on:{click:this.clickErrorText},class:Po("error-text")},[this.errorText]),"up"===this.direction?this.slots():e])}}),_o=i(5),Ho=Object(r.a)("nav-bar"),Wo=Ho[0],qo=Ho[1];function Yo(t,e,i,n){return t("div",o()([{class:[qo({fixed:e.fixed}),{"van-hairline--bottom":e.border}],style:{zIndex:e.zIndex}},h(n)]),[t("div",{class:qo("left"),on:{click:n.listeners["click-left"]||g.e}},[i.left?i.left():[e.leftArrow&&t(ot,{class:qo("arrow"),attrs:{name:"arrow-left"}}),e.leftText&&t("span",{class:qo("text")},[e.leftText])]]),t("div",{class:[qo("title"),"van-ellipsis"]},[i.title?i.title():e.title]),t("div",{class:qo("right"),on:{click:n.listeners["click-right"]||g.e}},[i.right?i.right():e.rightText&&t("span",{class:qo("text")},[e.rightText])])])}Yo.props={title:String,fixed:Boolean,leftText:String,rightText:String,leftArrow:Boolean,border:{type:Boolean,default:!0},zIndex:{type:Number,default:1}};var Xo=Wo(Yo),Uo=Object(r.a)("notice-bar"),Ko=Uo[0],Qo=Uo[1],Go=Ko({props:{text:String,mode:String,color:String,leftIcon:String,wrapable:Boolean,background:String,delay:{type:[Number,String],default:1},scrollable:{type:Boolean,default:!0},speed:{type:Number,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,o=n.getBoundingClientRect().width;t.scrollable&&o>s&&(t.wrapWidth=s,t.offsetWidth=o,t.duration=o/t.speed,t.animationClass=Qo("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=Qo("play--infinite")})}},render:function(t){var e,i=this,n=this.slots,s=this.mode,o=this.leftIcon,r=this.onClickIcon,a={color:this.color,background:this.background},u={paddingLeft:this.firstRound?0:this.wrapWidth+"px",animationDelay:(this.firstRound?this.delay:0)+"s",animationDuration:this.duration+"s"};return t("div",{attrs:{role:"alert"},directives:[{name:"show",value:this.showNoticeBar}],class:Qo({wrapable:this.wrapable}),style:a,on:{click:function(t){i.$emit("click",t)}}},[(e=n("left-icon"),e||(o?t(ot,{class:Qo("left-icon"),attrs:{name:o}}):void 0)),t("div",{ref:"wrap",class:Qo("wrap"),attrs:{role:"marquee"}},[t("div",{ref:"content",class:[Qo("content"),this.animationClass,{"van-ellipsis":!this.scrollable&&!this.wrapable}],style:u,on:{animationend:this.onAnimationEnd,webkitAnimationEnd:this.onAnimationEnd}},[this.slots()||this.text])]),function(){var e=n("right-icon");if(e)return e;var i="closeable"===s?"cross":"link"===s?"arrow":"";return i?t(ot,{class:Qo("right-icon"),attrs:{name:i},on:{click:r}}):void 0}()])}}),Zo=Object(r.a)("notify"),Jo=Zo[0],tr=Zo[1];function er(t,e,i,n){var s={color:e.color,background:e.background};return t(lt,o()([{attrs:{value:e.value,position:"top",overlay:!1,lockScroll:!1},style:s,class:[tr(),e.className]},h(n,!0)]),[e.message])}er.props=n({},W.props,{className:null,message:[Number,String],getContainer:[String,Function],color:{type:String,default:dt},background:{type:String,default:ct},duration:{type:Number,default:3e3}});var ir,nr,sr=Jo(er);function or(t){var e;if(!g.d)return nr||(nr=f(sr,{on:{click:function(t){nr.onClick&&nr.onClick(t)},close:function(){nr.onClose&&nr.onClose()},opened:function(){nr.onOpened&&nr.onOpened()}}})),t=n({},or.currentOptions,{},(e=t,Object(g.c)(e)?e:{message:e})),n(nr,t),clearTimeout(ir),t.duration&&t.duration>0&&(ir=setTimeout(or.clear,t.duration)),nr}function rr(){return{value:!0,message:"",color:dt,background:ct,duration:3e3,className:"",onClose:null,onClick:null,onOpened:null}}or.clear=function(){nr&&(nr.value=!1)},or.currentOptions=rr(),or.setDefaultOptions=function(t){n(or.currentOptions,t)},or.resetDefaultOptions=function(){or.currentOptions=rr()},or.install=function(){u.a.use(sr)},u.a.prototype.$notify=or;var ar=or,ur=Object(r.a)("key"),lr=ur[0],cr=ur[1],hr=lr({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),cr(t)}},methods:{onFocus:function(){this.active=!0},onBlur:function(t){this.active=!1},onClick:function(){this.$emit("press",this.text,this.type)}},render:function(t){var e=this.onBlur;return t("i",{attrs:{role:"button",tabindex:"0"},class:["van-hairline",this.className],on:{click:this.onClick,touchstart:this.onFocus,touchmove:e,touchend:e,touchcancel:e}},[this.slots("default")||this.text])}}),dr=Object(r.a)("number-keyboard"),fr=dr[0],pr=dr[1],mr=dr[2],vr=["blue","big"],gr=["delete","big","gray"],br=fr({mixins:[Se(function(t){this.hideOnClickOutside&&t(document.body,"touchstart",this.onBlur)})],model:{event:"update:value"},props:{show:Boolean,title:String,closeButtonText:String,deleteButtonText:String,safeAreaInsetBottom:Boolean,theme:{type:String,default:"default"},value:{type:String,default:""},extraKey:{type:String,default:""},maxlength:{type:[Number,String],default:Number.MAX_VALUE},zIndex:{type:Number,default:100},transition:{type:Boolean,default:!0},showDeleteKey:{type:Boolean,default:!0},hideOnClickOutside:{type:Boolean,default:!0}},watch:{show:function(){this.transition||this.$emit(this.show?"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"]},{text:0},{text:this.deleteText,theme:["gray"],type:"delete"});break;case"custom":t.push({text:0,theme:["middle"]},{text:this.extraKey})}return t},deleteText:function(){return this.deleteButtonText||mr("delete")}},methods:{onBlur:function(){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.length<this.maxlength&&(this.$emit("input",t),this.$emit("update:value",i+t))}}},render:function(t){var e=this,i=this.title,n=this.theme,s=this.onPress,o=this.closeButtonText,r=this.slots("title-left"),a=o&&"default"===n,u=(i||a||r)&&t("div",{class:[pr("title"),"van-hairline--top"]},[r&&t("span",{class:pr("title-left")},[r]),i&&t("span",[i]),a&&t("span",{attrs:{role:"button",tabindex:"0"},class:pr("close"),on:{click:this.onClose}},[o])]),l=this.keys.map(function(i){return t(hr,{key:i.text,attrs:{text:i.text,type:i.type,theme:i.theme},on:{press:s}},["delete"===i.type&&e.slots("delete")])}),c="custom"===n&&t("div",{class:pr("sidebar")},[t(hr,{attrs:{text:this.deleteText,type:"delete",theme:gr},on:{press:s}},[this.slots("delete")]),t(hr,{attrs:{text:o,type:"close",theme:vr},on:{press:s}})]);return t("transition",{attrs:{name:this.transition?"van-slide-up":""}},[t("div",{directives:[{name:"show",value:this.show}],style:{zIndex:this.zIndex},class:pr([n,{"safe-area-inset-bottom":this.safeAreaInsetBottom}]),on:{touchstart:S,animationend:this.onAnimationEnd,webkitAnimationEnd:this.onAnimationEnd}},[u,t("div",{class:pr("body")},[l]),c])])}}),yr=Object(r.a)("pagination"),kr=yr[0],xr=yr[1],Sr=yr[2];function wr(t,e,i){return{number:t,text:e,active:i}}var Cr=kr({props:{prevText:String,nextText:String,forceEllipses:Boolean,value:{type:Number,default:0},pageCount:{type:Number,default:0},totalItems:{type:Number,default:0},mode:{type:String,default:"multi"},itemsPerPage:{type:Number,default:10},showPageSize:{type:Number,default:5}},computed:{count:function(){var t=this.pageCount||Math.ceil(this.totalItems/this.itemsPerPage);return Math.max(1,t)},pages:function(){var t=[],e=this.count;if("multi"!==this.mode)return t;var i=1,n=e,s=void 0!==this.showPageSize&&this.showPageSize<e;s&&(n=(i=Math.max(this.value-Math.floor(this.showPageSize/2),1))+this.showPageSize-1)>e&&(i=(n=e)-this.showPageSize+1);for(var o=i;o<=n;o++){var r=wr(o,o,o===this.value);t.push(r)}if(s&&this.showPageSize>0&&this.forceEllipses){if(i>1){var a=wr(i-1,"...",!1);t.unshift(a)}if(n<e){var u=wr(n+1,"...",!1);t.push(u)}}return t}},watch:{value:{handler:function(t){this.select(t||this.value)},immediate:!0}},methods:{select:function(t,e){t=Math.min(this.count,Math.max(1,t)),this.value!==t&&(this.$emit("input",t),e&&this.$emit("change",t))}},render:function(t){var e=this,i=this.value,n="multi"!==this.mode,s=function(t){return function(){e.select(t,!0)}};return t("ul",{class:xr({simple:n})},[t("li",{class:[xr("item",{disabled:1===i}),xr("prev"),"van-hairline"],on:{click:s(i-1)}},[this.prevText||Sr("prev")]),this.pages.map(function(e){return t("li",{class:[xr("item",{active:e.active}),xr("page"),"van-hairline"],on:{click:s(e.number)}},[e.text])}),n&&t("li",{class:xr("page-desc")},[this.slots("pageDesc")||i+"/"+this.count]),t("li",{class:[xr("item",{disabled:i===this.count}),xr("next"),"van-hairline"],on:{click:s(i+1)}},[this.nextText||Sr("next")])])}}),Or=Object(r.a)("panel"),Tr=Or[0],$r=Or[1];function Ir(t,e,i,n){return t(Ei,o()([{class:$r(),scopedSlots:{default:function(){return[i.header?i.header():t(Jt,{attrs:{icon:e.icon,label:e.desc,title:e.title,value:e.status,valueClass:$r("header-value")},class:$r("header")}),t("div",{class:$r("content")},[i.default&&i.default()]),i.footer&&t("div",{class:[$r("footer"),"van-hairline--top"]},[i.footer()])]}}},h(n,!0)]))}Ir.props={icon:String,desc:String,title:String,status:String};var Br=Tr(Ir),jr=Object(r.a)("password-input"),Nr=jr[0],Ar=jr[1];function zr(t,e,i,n){for(var s=e.errorInfo||e.info,r=[],a=0;a<e.length;a++){var u=e.value[a],l=0!==a&&!e.gutter,c=void 0;0!==a&&e.gutter&&(c={marginLeft:Object(q.a)(e.gutter)}),r.push(t("li",{class:{"van-hairline--left":l},style:c},[e.mask?t("i",{style:{visibility:u?"visible":"hidden"}}):u]))}return t("div",{class:Ar()},[t("ul",o()([{class:[Ar("security"),{"van-hairline--surround":!e.gutter}],on:{touchstart:function(t){t.stopPropagation(),d(n,"focus",t)}}},h(n,!0)]),[r]),s&&t("div",{class:Ar(e.errorInfo?"error-info":"info")},[s])])}zr.props={info:String,gutter:[Number,String],errorInfo:String,mask:{type:Boolean,default:!0},value:{type:String,default:""},length:{type:Number,default:6}};var Lr=Nr(zr),Er=Object(r.a)("progress"),Dr=Er[0],Mr=Er[1],Fr=Dr({props:{inactive:Boolean,pivotText:String,pivotColor:String,percentage:{type:Number,required:!0,validator:function(t){return t>=0&&t<=100}},showPivot:{type:Boolean,default:!0},color:{type:String,default:ht},textColor:{type:String,default:dt}},data:function(){return{pivotWidth:0,progressWidth:0}},mounted:function(){this.getWidth()},watch:{showPivot:function(){this.getWidth()},pivotText:function(){this.getWidth()}},methods:{getWidth:function(){var t=this;this.$nextTick(function(){t.progressWidth=t.$el.offsetWidth,t.pivotWidth=t.$refs.pivot?t.$refs.pivot.offsetWidth:0})}},render:function(t){var e=this.pivotText,i=this.percentage,n=Object(g.b)(e)?e:i+"%",s=this.showPivot&&n,o=this.inactive?"#cacaca":this.color,r={color:this.textColor,background:this.pivotColor||o},a={background:o,width:(this.progressWidth-this.pivotWidth)*i/100+"px"};return t("div",{class:Mr()},[t("span",{class:Mr("portion",{"with-pivot":s}),style:a},[s&&t("span",{ref:"pivot",style:r,class:Mr("pivot")},[n])])])}}),Pr=Object(r.a)("pull-refresh"),Vr=Pr[0],Rr=Pr[1],_r=Pr[2],Hr=["pulling","loosing","success"],Wr=Vr({mixins:[v],props:{disabled:Boolean,successText:String,pullingText:String,loosingText:String,loadingText:String,value:{type:Boolean,required:!0},successDuration:{type:Number,default:500},animationDuration:{type:Number,default:300},headHeight:{type:Number,default:50}},data:function(){return{status:"normal",distance:0,duration:0}},computed:{untouchable:function(){return"loading"===this.status||"success"===this.status||this.disabled}},watch:{value:function(t){var e=this;this.duration=this.animationDuration,!t&&this.successText?(this.status="success",setTimeout(function(){e.setStatus(0)},this.successDuration)):this.setStatus(t?this.headHeight:0,t)}},mounted:function(){this.scrollEl=D(this.$el)},methods:{onTouchStart:function(t){!this.untouchable&&this.getCeiling()&&(this.duration=0,this.touchStart(t))},onTouchMove:function(t){this.untouchable||(this.touchMove(t),!this.ceiling&&this.getCeiling()&&(this.duration=0,this.startY=t.touches[0].clientY,this.deltaY=0),this.ceiling&&this.deltaY>=0&&"vertical"===this.direction&&(this.setStatus(this.ease(this.deltaY)),w(t)))},onTouchEnd:function(){var t=this;!this.untouchable&&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))},getCeiling:function(){return this.ceiling=0===M(this.scrollEl),this.ceiling},ease:function(t){var e=this.headHeight;return Math.round(t<e?t:t<2*e?e+(t-e)/2:1.5*e+(t-2*e)/4)},setStatus:function(t,e){this.distance=t;var i=e?"loading":0===t?"normal":t<this.headHeight?"pulling":"loosing";i!==this.status&&(this.status=i)}},render:function(t){var e=this.status,i=this.distance,n=this[e+"Text"]||_r(e),s={transition:this.duration+"ms",transform:this.distance?"translate3d(0,"+this.distance+"px, 0)":""},o=this.slots(e,{distance:i})||[-1!==Hr.indexOf(e)&&t("div",{class:Rr("text")},[n]),"loading"===e&&t(kt,{attrs:{size:"16"}},[n])];return t("div",{class:Rr()},[t("div",{class:Rr("track"),style:s,on:{touchstart:this.onTouchStart,touchmove:this.onTouchMove,touchend:this.onTouchEnd,touchcancel:this.onTouchEnd}},[t("div",{class:Rr("head")},[o]),this.slots()])])}}),qr=Object(r.a)("rate"),Yr=qr[0],Xr=qr[1];function Ur(t,e,i,n){for(var s,r,a,u=e.icon,l=e.color,c=e.count,f=e.voidIcon,p=e.readonly,m=e.disabled,v=e.voidColor,g=e.disabledColor,b=[],y=1;y<=c;y++)b.push((s=e.value,r=y,a=e.allowHalf,s>=r?"full":s+.5>=r&&a?"half":"void"));function k(t){m||p||(d(n,"input",t),d(n,"change",t))}var x=Object(q.a)(e.gutter);return t("div",o()([{class:Xr(),attrs:{tabindex:"0",role:"radiogroup"}},h(n),{on:{touchmove:function(t){if(!p&&!m&&document.elementFromPoint){w(t);var e=t.touches[0],i=e.clientX,n=e.clientY,s=document.elementFromPoint(i,n);if(s&&s.dataset){var o=s.dataset.score;o&&k(+o)}}}}}]),[b.map(function(i,n){return function(i,n){var s,o="full"===i,r="void"===i,a=n+1,h=Object(q.a)(e.size);return x&&a!==c&&(s={paddingRight:x}),t("div",{key:n,attrs:{role:"radio",tabindex:"0","aria-setsize":c,"aria-posinset":a,"aria-checked":String(!r)},style:s,class:Xr("item")},[t(ot,{attrs:{size:h,name:o?u:f,"data-score":a,color:m?g:o?l:v},class:Xr("icon"),on:{click:function(){k(a)}}}),e.allowHalf&&t(ot,{attrs:{size:h,name:r?f:u,"data-score":a-.5,color:m?g:r?v:l},class:Xr("icon","half"),on:{click:function(){k(a-.5)}}})])}(i,n)})])}Ur.props={size:[Number,String],gutter:[Number,String],readonly:Boolean,disabled:Boolean,allowHalf:Boolean,value:{type:Number,default:0},icon:{type:String,default:"star"},voidIcon:{type:String,default:"star-o"},color:{type:String,default:"#ffd21e"},voidColor:{type:String,default:"#c7c7c7"},disabledColor:{type:String,default:"#bdbdbd"},count:{type:Number,default:5}};var Kr=Yr(Ur),Qr=Object(r.a)("row"),Gr=Qr[0],Zr=Qr[1],Jr=Gr({props:{type:String,align:String,justify:String,tag:{type:String,default:"div"},gutter:{type:[Number,String],default:0}},render:function(t){var e,i=this.align,n=this.justify,s="flex"===this.type,o="-"+Number(this.gutter)/2+"px",r=this.gutter?{marginLeft:o,marginRight:o}:{};return t(this.tag,{style:r,class:Zr((e={flex:s},e["align-"+i]=s&&i,e["justify-"+n]=s&&n,e))},[this.slots()])}}),ta=Object(r.a)("search"),ea=ta[0],ia=ta[1],na=ta[2];function sa(t,e,i,s){var r={attrs:s.data.attrs,on:n({},s.listeners,{input:function(t){d(s,"input",t)},keypress:function(t){13===t.keyCode&&(w(t),d(s,"search",e.value)),d(s,"keypress",t)}})},a=h(s);return delete a.attrs,t("div",o()([{class:ia({"show-action":e.showAction}),style:{background:e.background}},a]),[t("div",{class:ia("content",e.shape)},[function(){if(i.label||e.label)return t("div",{class:ia("label")},[i.label?i.label():e.label])}(),t(oe,o()([{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"]}},r]))]),function(){if(e.showAction)return t("div",{class:ia("action")},[i.action?i.action():t("div",{on:{click:function(){d(s,"input",""),d(s,"cancel")}}},[na("cancel")])])}()])}sa.props={value:String,label:String,rightIcon:String,showAction:Boolean,shape:{type:String,default:"square"},clearable:{type:Boolean,default:!0},background:{type:String,default:"#fff"},leftIcon:{type:String,default:"search"}};var oa=ea(sa),ra=Object(r.a)("sidebar"),aa=ra[0],ua=ra[1],la=aa({mixins:[ii("vanSidebar")],model:{prop:"activeKey"},props:{activeKey:{type:[Number,String],default:0}},render:function(t){return t("div",{class:[ua(),"van-hairline--top-bottom"]},[this.slots()])}}),ca=Object(r.a)("sidebar-item"),ha=ca[0],da=ca[1],fa=ha({mixins:[ei("vanSidebar")],props:n({},Ut,{info:[Number,String],title:String}),computed:{select:function(){return this.index===+this.parent.activeKey}},methods:{onClick:function(){this.$emit("click",this.index),this.parent.$emit("input",this.index),this.parent.$emit("change",this.index),Yt(this.$router,this)}},render:function(t){return t("a",{class:[da({select:this.select}),"van-hairline"],on:{click:this.onClick}},[t("div",{class:da("text")},[this.title,t(Q,{attrs:{info:this.info},class:da("info")})])])}}),pa=Object(r.a)("skeleton"),ma=pa[0],va=pa[1],ga="100%",ba="60%";function ya(t,e,i,n){if(!e.loading)return i.default&&i.default();return t("div",o()([{class:va({animate:e.animate})},h(n)]),[function(){if(e.avatar){var i=Object(q.a)(e.avatarSize);return t("div",{class:va("avatar",e.avatarShape),style:{width:i,height:i}})}}(),t("div",{class:va("content")},[function(){if(e.title)return t("h3",{class:va("title"),style:{width:Object(q.a)(e.titleWidth)}})}(),function(){for(var i,n=[],s=e.rowWidth,o=0;o<e.row;o++)n.push(t("div",{class:va("row"),style:{width:Object(q.a)((i=o,s===ga&&i===e.row-1?ba:Array.isArray(s)?s[i]:s))}}));return n}()])])}ya.props={title:Boolean,avatar:Boolean,row:{type:Number,default:0},loading:{type:Boolean,default:!0},animate:{type:Boolean,default:!0},avatarSize:{type:String,default:"32px"},avatarShape:{type:String,default:"round"},titleWidth:{type:[Number,String],default:"40%"},rowWidth:{type:[Number,String,Array],default:ga}};var ka=ma(ya),xa=Object(r.a)("sku-header"),Sa=xa[0],wa=xa[1];function Ca(t,e,i,n){var s=e.sku,r=e.goods,a=e.skuEventBus,u=function(t,e){var i=e.s1;if(i){var n=t.tree.filter(function(t){return"s1"===t.k_s})[0]||{};if(n.v){var s=n.v.filter(function(t){return t.id===i})[0];if(s)return s.imgUrl||s.img_url}}}(s,e.selectedSku)||r.picture;return t("div",o()([{class:[wa(),"van-hairline--bottom"]},h(n)]),[t("div",{class:wa("img-wrap"),on:{click:function(){a.$emit("sku:previewImage",u)}}},[t("img",{attrs:{src:u}})]),t("div",{class:wa("goods-info")},[t("div",{class:"van-sku__goods-name van-ellipsis"},[r.title]),i.default&&i.default(),t(ot,{attrs:{name:"close"},class:"van-sku__close-icon",on:{click:function(){a.$emit("sku:close")}}})])])}Ca.props={sku:Object,goods:Object,skuEventBus:Object,selectedSku:Object};var Oa=Sa(Ca),Ta=Object(r.a)("sku-row"),$a=Ta[0],Ia=Ta[1];function Ba(t,e,i,n){return t("div",o()([{class:Ia()},h(n)]),[t("div",{class:Ia("title")},[e.skuRow.k,":"]),i.default&&i.default()])}Ba.props={skuRow:Object};var ja=$a(Ba),Na={QUOTA_LIMIT:0,STOCK_LIMIT:1},Aa={LIMIT_TYPE:Na,UNSELECTED_SKU_VALUE_ID:""},za=function(t){var e={};return t.forEach(function(t){e[t.k_s]=t.v}),e},La=function(t,e){var i=Object.keys(e).filter(function(t){return""!==e[t]});return t.length===i.length},Ea=function(t,e){return t.filter(function(t){return Object.keys(e).every(function(i){return String(t[i])===String(e[i])})})[0]},Da=function(t,e){var i=za(t);return Object.keys(e).reduce(function(t,n){var s=i[n],o=e[n];if(""!==o){var r=s.filter(function(t){return t.id===o})[0];r&&t.push(r)}return t},[])},Ma=function(t,e,i){var s,o=i.key,r=i.valueId,a=n({},e,((s={})[o]=r,s)),u=Object.keys(a).filter(function(t){return""!==a[t]});return t.filter(function(t){return u.every(function(e){return String(a[e])===String(t[e])})}).reduce(function(t,e){return t+=e.stock_num},0)>0},Fa={normalizeSkuTree:za,getSkuComb:Ea,getSelectedSkuValues:Da,isAllSelected:La,isSkuChoosable:Ma},Pa=(0,Object(r.a)("sku-row-item")[0])({props:{skuValue:Object,skuKeyStr:String,skuEventBus:Object,selectedSku:Object,skuList:{type:Array,default:function(){return[]}}},computed:{choosable:function(){return Ma(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(t){return t("span",{class:["van-sku-row__item",{"van-sku-row__item--active":this.skuValue.id===this.selectedSku[this.skuKeyStr],"van-sku-row__item--disabled":!this.choosable}],on:{click:this.onSelect}},[this.skuValue.name])}}),Va=Object(r.a)("stepper"),Ra=Va[0],_a=Va[1],Ha=Ra({props:{value:null,integer:Boolean,disabled:Boolean,inputWidth:[Number,String],buttonSize:[Number,String],asyncChange:Boolean,disableInput:Boolean,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}},data:function(){var t=this.range(Object(g.b)(this.value)?this.value:this.defaultValue);return t!==+this.value&&this.$emit("input",t),{currentValue:t}},computed:{minusDisabled:function(){return this.disabled||this.currentValue<=this.min},plusDisabled:function(){return this.disabled||this.currentValue>=this.max},inputStyle:function(){var t={};return this.inputWidth&&(t.width=Object(q.a)(this.inputWidth)),this.buttonSize&&(t.height=Object(q.a)(this.buttonSize)),t},buttonStyle:function(){var t={};if(this.buttonSize){var e=Object(q.a)(this.buttonSize);t.width=e,t.height=e}return t}},watch:{value:function(t){t!==this.currentValue&&(this.currentValue=this.format(t))},currentValue:function(t){this.$emit("input",t),this.$emit("change",t)}},methods:{format:function(t){return""===(t=String(t).replace(/[^0-9.-]/g,""))?0:this.integer?Math.floor(t):+t},range:function(t){return Math.max(Math.min(this.max,this.format(t)),this.min)},onInput:function(t){var e=t.target.value,i=this.format(e);this.asyncChange?(t.target.value=this.currentValue,this.$emit("input",i),this.$emit("change",i)):(+e!==i&&(t.target.value=i),this.currentValue=i)},onChange:function(){var t=this.type;if(this[t+"Disabled"])this.$emit("overlimit",t);else{var e="minus"===t?-this.step:+this.step,i=Math.round(100*(this.currentValue+e))/100;this.asyncChange?(this.$emit("input",i),this.$emit("change",i)):this.currentValue=this.range(i),this.$emit(t)}},onFocus:function(t){this.$emit("focus",t)},onBlur:function(t){this.currentValue=this.range(this.currentValue),this.$emit("blur",t),0===this.currentValue&&(t.target.value=this.currentValue),ee()},longPressStep:function(){var t=this;this.longPressTimer=setTimeout(function(){t.onChange(t.type),t.longPressStep(t.type)},200)},onTouchStart:function(t){var e=this;clearTimeout(this.longPressTimer),this.isLongPress=!1,this.longPressTimer=setTimeout(function(){e.isLongPress=!0,e.onChange(),e.longPressStep()},600)},onTouchEnd:function(t){clearTimeout(this.longPressTimer),this.isLongPress&&t.preventDefault()}},render:function(t){var e=this,i=function(t){return{on:{click:function(){e.type=t,e.onChange()},touchstart:function(){e.type=t,e.onTouchStart(t)},touchend:e.onTouchEnd,touchcancel:e.onTouchEnd}}};return t("div",{class:_a()},[t("button",o()([{style:this.buttonStyle,class:_a("minus",{disabled:this.minusDisabled})},i("minus")])),t("input",{attrs:{type:"number",role:"spinbutton","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.currentValue,disabled:this.disabled||this.disableInput},class:_a("input"),domProps:{value:this.currentValue},style:this.inputStyle,on:{input:this.onInput,focus:this.onFocus,blur:this.onBlur}}),t("button",o()([{style:this.buttonStyle,class:_a("plus",{disabled:this.plusDisabled})},i("plus")]))])}}),Wa=Object(r.a)("sku-stepper")[0],qa=Na.QUOTA_LIMIT,Ya=Na.STOCK_LIMIT,Xa=Wa({props:{hideStock:Boolean,selectedSku:Object,skuEventBus:Object,skuStockNum:Number,selectedNum:Number,stepperTitle:String,hideQuotaText:Boolean,selectedSkuComb:Object,disableStepperInput:Boolean,customStepperConfig:Object,quota:{type:Number,default:0},quotaUsed:{type:Number,default:0}},data:function(){return{currentNum:this.selectedNum,limitType:Ya}},watch:{currentNum:function(t){this.skuEventBus.$emit("sku:numChange",t)},stepperLimit:function(t){t<this.currentNum&&(this.currentNum=t)}},computed:{stock:function(){var t=this.customStepperConfig.stockNum;return void 0!==t?t:this.selectedSkuComb?this.selectedSkuComb.stock_num:this.skuStockNum},stockText:function(){var t=this.customStepperConfig.stockFormatter;return t?t(this.stock):"剩余"+this.stock+"件"},quotaText:function(){var t=this.customStepperConfig,e=t.quotaText;if(t.hideQuotaText)return"";var i="";return e?i=e:this.quota>0&&(i="每人限购"+this.quota+"件"),i},stepperLimit:function(){var t,e=this.quota-this.quotaUsed;return this.quota>0&&e<=this.stock?(t=e<0?0:e,this.limitType=qa):(t=this.stock,this.limitType=Ya),t}},methods:{setCurrentNum:function(t){this.currentNum=t},onOverLimit:function(t){this.skuEventBus.$emit("sku:overLimit",{action:t,limitType:this.limitType,quota:this.quota,quotaUsed:this.quotaUsed})},onChange:function(t){var e=this.customStepperConfig.handleStepperChange;e&&e(t),this.$emit("change",t)}},render:function(t){var e=this;return t("div",{class:"van-sku-stepper-stock"},[t("div",{class:"van-sku-stepper-container"},[t("div",{class:"van-sku__stepper-title"},[this.stepperTitle||"购买数量",":"]),t(Ha,{class:"van-sku__stepper",attrs:{max:this.stepperLimit,disableInput:this.disableStepperInput},on:{overlimit:this.onOverLimit,change:this.onChange},model:{value:e.currentNum,callback:function(t){e.currentNum=t}}})]),!this.hideStock&&t("div",{class:"van-sku__stock"},[this.stockText]),!this.hideQuotaText&&this.quotaText&&t("div",{class:"van-sku__quota"},[this.quotaText])])}});function Ua(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)}var Ka=i(7);function Qa(t){return Array.isArray(t)?t:[t]}function Ga(t,e){return new Promise(function(i){var n=new FileReader;n.onload=function(t){i(t.target.result)},"dataUrl"===e?n.readAsDataURL(t):"text"===e&&n.readAsText(t)})}var Za=["jpeg","jpg","gif","png","svg"];function Ja(t){return t.file&&t.file.type?0===t.file.type.indexOf("image"):t.url?(e=t.url,Za.some(function(t){return-1!==e.indexOf("."+t)})):!!t.content&&0===t.content.indexOf("data:image");var e}var tu=Object(r.a)("uploader"),eu=tu[0],iu=tu[1],nu=eu({inheritAttrs:!1,model:{prop:"fileList"},props:{disabled:Boolean,uploadText:String,afterRead:Function,beforeRead:Function,previewSize:[Number,String],name:{type:[Number,String],default:""},accept:{type:String,default:"image/*"},fileList:{type:Array,default:function(){return[]}},maxSize:{type:Number,default:Number.MAX_VALUE},maxCount:{type:Number,default:Number.MAX_VALUE},previewImage:{type:Boolean,default:!0},resultType:{type:String,default:"dataUrl"}},computed:{detail:function(){return{name:this.name}},previewSizeWithUnit:function(){return Object(q.a)(this.previewSize)}},methods:{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.detail);if(!n)return void this.resetInput();if(n.then)return void n.then(function(){e.readFile(i)}).catch(this.resetInput)}this.readFile(i)}},readFile:function(t){var e=this,i=function(t,e){return Qa(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 Ga(t,e.resultType)})).then(function(n){var s=t.map(function(t,e){return{file:t,content:n[e]}});e.onAfterRead(s,i)})}else Ga(t,this.resultType).then(function(n){e.onAfterRead({file:t,content:n},i)})},onAfterRead:function(t,e){e?this.$emit("oversize",t,this.detail):(this.resetInput(),this.$emit("input",[].concat(this.fileList,Qa(t))),this.afterRead&&this.afterRead(t,this.detail))},onDelete:function(t,e){var i=this.fileList.slice(0);i.splice(e,1),this.$emit("input",i),this.$emit("delete",t)},resetInput:function(){this.$refs.input&&(this.$refs.input.value="")},onPreviewImage:function(t){var e=this.fileList.filter(function(t){return Ja(t)}).map(function(t){return t.content||t.url});To({images:e,startPosition:e.indexOf(t.content||t.url)})},renderPreview:function(){var t=this,e=this.$createElement;if(this.previewImage)return this.fileList.map(function(i,n){return e("div",{class:iu("preview")},[Ja(i)?e(tt,{attrs:{fit:"cover",src:i.content||i.url,width:t.previewSize,height:t.previewSize},class:iu("preview-image"),on:{click:function(){t.onPreviewImage(i)}}}):e("div",{class:iu("file"),style:{width:t.previewSizeWithUnit,height:t.previewSizeWithUnit}},[e(ot,{class:iu("file-icon"),attrs:{name:"description"}}),e("div",{class:[iu("file-name"),"van-ellipsis"]},[i.file?i.file.name:i.url])]),e(ot,{attrs:{name:"delete"},class:iu("preview-delete"),on:{click:function(){t.onDelete(i,n)}}})])})},renderUpload:function(){var t=this.$createElement;if(!(this.fileList.length>=this.maxCount)){var e,i=this.slots(),s=t("input",{attrs:n({},this.$attrs,{type:"file",accept:this.accept,disabled:this.disabled}),ref:"input",class:iu("input"),on:{change:this.onChange}});if(i)return t("div",{class:iu("input-wrapper")},[i,s]);if(this.previewSize){var o=this.previewSizeWithUnit;e={width:o,height:o}}return t("div",{class:iu("upload"),style:e},[t(ot,{attrs:{name:"plus"},class:iu("upload-icon")}),this.uploadText&&t("span",{class:iu("upload-text")},[this.uploadText]),s])}}},render:function(t){return t("div",{class:iu()},[t("div",{class:iu("wrapper")},[this.renderPreview(),this.renderUpload()])])}}),su=Object(r.a)("sku-img-uploader"),ou=su[0],ru=su[1],au=ou({props:{value:String,uploadImg:Function,maxSize:{type:Number,default:6}},data:function(){return{paddingImg:""}},computed:{imgList:function(){return this.value&&!this.paddingImg?[this.value]:[]}},methods:{afterReadFile:function(t){var e=this;this.paddingImg=t.content,this.uploadImg(t.file,t.content).then(function(t){e.$emit("input",t),e.$nextTick(function(){e.paddingImg=""})}).catch(function(){e.paddingImg=""})},onOversize:function(){this.$toast("最大可上传图片为"+this.maxSize+"MB,请尝试压缩图片尺寸")}},render:function(t){var e=this,i=this.imgList,n=this.paddingImg,s=(n||i.length>0)&&t("div",{class:"van-clearfix"},[i.map(function(i){return t("div",{class:ru("img")},[t("img",{attrs:{src:i}}),t(ot,{attrs:{name:"clear"},class:ru("delete"),on:{click:function(){e.$emit("input","")}}})])}),n&&t("div",{class:ru("img")},[t("img",{attrs:{src:n}}),t(kt,{attrs:{type:"spinner"},class:ru("uploading")})])]);return t("div",{class:ru()},[t(nu,{attrs:{disabled:!!n,afterRead:this.afterReadFile,maxSize:1024*this.maxSize*1024},on:{oversize:this.onOversize}},[t("div",{class:ru("header")},[n?t("div",["正在上传..."]):[t(ot,{attrs:{name:"photograph"}}),t("span",{class:"label"},[this.value?"重拍":"拍照"," 或 "]),t(ot,{attrs:{name:"photo"}}),t("span",{class:"label"},[this.value?"重新选择照片":"选择照片"])]])]),s])}}),uu=Object(r.a)("sku-messages"),lu=uu[0],cu=uu[1],hu={id_no:"输入身份证号码",text:"输入文本",tel:"输入数字",email:"输入邮箱",date:"点击选择日期",time:"点击选择时间",textarea:"点击填写段落文本",mobile:"输入手机号码"},du=lu({props:{messages:Array,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){return(t||[]).map(function(){return{value:""}})},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,o=t.messages[n];o.datetime>0&&(s=s.replace(/T/g," ")),e[o.name]=s}),e},getPlaceholder:function(t){var e=1==+t.multiple?"textarea":t.type,i=this.messageConfig.placeholderMap||{};return t.placeholder||i[e]||hu[e]},validateMessages:function(){for(var t=this.messageValues,e=0;e<t.length;e++){var i=t[e].value,n=this.messages[e];if(""===i){if("1"===String(n.required))return("image"===n.type?"请上传":"请填写")+n.name}else{if("tel"===n.type&&!Object(Ka.a)(i))return"请填写正确的数字格式留言";if("mobile"===n.type&&!/^\d{6,20}$/.test(i))return"手机号长度为6-20位数字";if("email"===n.type&&!Ua(i))return"请填写正确的邮箱";if("id_no"===n.type&&(i.length<15||i.length>18))return"请填写正确的身份证号码"}}}},render:function(t){var e=this;return t(Ei,{class:cu()},[this.messages.map(function(i,n){return"image"===i.type?t(Jt,{class:cu("image-cell"),attrs:{label:"仅限一张",title:i.name,required:"1"===String(i.required)},key:e.goodsId+"-"+n},[t(au,{attrs:{uploadImg:e.messageConfig.uploadImg,maxSize:e.messageConfig.uploadMaxSize},model:{value:e.messageValues[n].value,callback:function(t){e.messageValues[n].value=t}}})]):t(oe,{attrs:{maxlength:"200",label:i.name,required:"1"===String(i.required),placeholder:e.getPlaceholder(i),type:e.getType(i)},key:e.goodsId+"-"+n,model:{value:e.messageValues[n].value,callback:function(t){e.messageValues[n].value=t}}})})])}}),fu=Object(r.a)("sku-actions"),pu=fu[0],mu=fu[1];function vu(t,e,i,n){var s=function(t){return function(){e.skuEventBus.$emit(t)}};return t("div",o()([{class:mu()},h(n)]),[e.showAddCartBtn&&t(xe,{attrs:{square:!0,size:"large",type:"warning",text:e.addCartText||"加入购物车"},on:{click:s("sku:addCart")}}),t(xe,{attrs:{square:!0,size:"large",type:"danger",text:e.buyText||"立即购买"},on:{click:s("sku:buy")}})])}vu.props={buyText:String,addCartText:String,skuEventBus:Object,showAddCartBtn:Boolean};var gu=pu(vu),bu=Object(r.a)("sku")[0],yu=Na.QUOTA_LIMIT,ku=bu({props:{sku:Object,goods:Object,value:Boolean,buyText:String,goodsId:[Number,String],hideStock:Boolean,addCartText:String,stepperTitle:String,getContainer:Function,hideQuotaText:Boolean,resetStepperOnHide:Boolean,customSkuValidator:Function,closeOnClickOverlay:Boolean,disableStepperInput:Boolean,resetSelectedSkuOnHide:Boolean,quota:{type:Number,default:0},quotaUsed:{type:Number,default:0},initialSku:{type:Object,default:function(){return{}}},showSoldoutSku:{type:Boolean,default:!0},showAddCartBtn:{type:Boolean,default:!0},bodyOffsetTop:{type:Number,default:200},messageConfig:{type:Object,default:function(){return{placeholderMap:{},uploadImg:function(){return Promise.resolve()},uploadMaxSize:5}}},customStepperConfig:{type:Object,default:function(){return{}}}},data:function(){return{selectedSku:{},selectedNum:1,show:this.value}},watch:{show:function(t){if(this.$emit("input",t),!t){var e=Da(this.sku.tree,this.selectedSku);this.$emit("sku-close",{selectedSkuValues:e,selectedNum:this.selectedNum,selectedSkuComb:this.selectedSkuComb}),this.resetStepperOnHide&&this.resetStepper(),this.resetSelectedSkuOnHide&&this.resetSelectedSku(this.skuTree)}},value:function(t){this.show=t},skuTree:function(t){this.resetSelectedSku(t)}},computed:{skuGroupClass:function(){return["van-sku-group-container","van-hairline--bottom",{"van-sku-group-container--hide-soldout":!this.showSoldoutSku}]},bodyStyle:function(){if(!this.$isServer)return{maxHeight:window.innerHeight-this.bodyOffsetTop+"px"}},isSkuCombSelected:function(){return La(this.sku.tree,this.selectedSku)},isSkuEmpty:function(){return 0===Object.keys(this.sku).length},hasSku:function(){return!this.sku.none_sku},selectedSkuComb:function(){return this.hasSku?this.isSkuCombSelected?Ea(this.sku.list,this.selectedSku):null:{id:this.sku.collection_id,price:Math.round(100*this.sku.price),stock_num:this.sku.stock_num}},price:function(){return this.selectedSkuComb?(this.selectedSkuComb.price/100).toFixed(2):this.sku.price},skuTree:function(){return this.sku.tree||[]},imageList:function(){var t=[this.goods.picture];if(this.skuTree.length>0){var e=this.skuTree.filter(function(t){return"s1"===t.k_s})[0]||{};if(!e.v)return t;e.v.forEach(function(e){var i=e.imgUrl||e.img_url;i&&t.push(i)})}return t}},created:function(){var t=new u.a;this.skuEventBus=t,t.$on("sku:close",this.onClose),t.$on("sku:select",this.onSelect),t.$on("sku:numChange",this.onNumChange),t.$on("sku:previewImage",this.onPreviewImage),t.$on("sku:overLimit",this.onOverLimit),t.$on("sku:addCart",this.onAddCart),t.$on("sku:buy",this.onBuy),this.resetStepper(),this.resetSelectedSku(this.skuTree),this.$emit("after-sku-create",t)},methods:{resetStepper:function(){var t=this.$refs.skuStepper,e=this.initialSku.selectedNum,i=Object(g.b)(e)?e:1;t?t.setCurrentNum(i):this.selectedNum=i},resetSelectedSku:function(t){var e=this;this.selectedSku={},t.forEach(function(t){e.selectedSku[t.k_s]=e.initialSku[t.k_s]||""}),t.forEach(function(t){var i=t.k_s,n=t.v[0].id;1===t.v.length&&Ma(e.sku.list,e.selectedSku,{key:i,valueId:n})&&(e.selectedSku[i]=n)})},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"商品已经无法购买啦";if(this.isSkuCombSelected)return this.validateSkuMessages();if(this.customSkuValidator){var t=this.customSkuValidator(this);if(t)return t}return"请先选择商品规格"},onClose:function(){this.show=!1},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})},onNumChange:function(t){this.selectedNum=t},onPreviewImage:function(t){var e=this,i=this.imageList.findIndex(function(e){return e===t}),n={index:i,imageList:this.imageList,indexImage:t};this.$emit("open-preview",n),To({images:this.imageList,startPosition:i,onClose:function(){e.$emit("close-preview",n)}})},onOverLimit:function(t){var e=t.action,i=t.limitType,n=t.quota,s=t.quotaUsed,o=this.customStepperConfig.handleOverLimit;if(o)o(t);else if("minus"===e)ve("至少选择一件");else if("plus"===e)if(i===yu){var r="限购"+n+"件";s>0&&(r+=",你已购买"+s+"件"),ve(r)}else ve("库存不足")},onAddCart:function(){this.onBuyOrAddCart("add-cart")},onBuy:function(){this.onBuyOrAddCart("buy-clicked")},onBuyOrAddCart:function(t){var e=this.validateSku();e?ve(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(t){var e=this;if(!this.isSkuEmpty){var i=this.sku,n=this.goods,s=this.price,o=this.skuEventBus,r=this.selectedSku,a=this.selectedNum,u=this.stepperTitle,l=this.hideQuotaText,c=this.selectedSkuComb,h={price:s,selectedNum:a,skuEventBus:o,selectedSku:r,selectedSkuComb:c},d=function(t){return e.slots(t,h)},f=d("sku-header")||t(Oa,{attrs:{sku:i,goods:n,skuEventBus:o,selectedSku:r}},[d("sku-header-price")||t("div",{class:"van-sku__goods-price"},[t("span",{class:"van-sku__price-symbol"},["¥"]),t("span",{class:"van-sku__price-num"},[s])])]),p=d("sku-group")||this.hasSku&&t("div",{class:this.skuGroupClass},[this.skuTree.map(function(e){return t(ja,{attrs:{skuRow:e}},[e.v.map(function(n){return t(Pa,{attrs:{skuList:i.list,skuValue:n,selectedSku:r,skuEventBus:o,skuKeyStr:e.k_s}})})])})]),m=d("sku-stepper")||t(Xa,{ref:"skuStepper",attrs:{quota:this.quota,hideStock:this.hideStock,quotaUsed:this.quotaUsed,skuEventBus:o,selectedNum:a,selectedSku:r,stepperTitle:u,skuStockNum:i.stock_num,hideQuotaText:l,selectedSkuComb:c,disableStepperInput:this.disableStepperInput,customStepperConfig:this.customStepperConfig},on:{change:function(t){e.$emit("stepper-change",t)}}}),v=d("sku-messages")||t(du,{ref:"skuMessages",attrs:{goodsId:this.goodsId,messageConfig:this.messageConfig,messages:i.messages}}),g=d("sku-actions")||t(gu,{attrs:{buyText:this.buyText,skuEventBus:o,addCartText:this.addCartText,showAddCartBtn:this.showAddCartBtn}});return t(lt,{attrs:{position:"bottom",getContainer:this.getContainer,closeOnClickOverlay:this.closeOnClickOverlay},class:"van-sku-container",model:{value:e.show,callback:function(t){e.show=t}}},[f,t("div",{class:"van-sku-body",style:this.bodyStyle},[d("sku-body-top"),p,d("extra-sku-group"),m,v]),g])}}});ku.SkuActions=gu,ku.SkuHeader=Oa,ku.SkuMessages=du,ku.SkuStepper=Xa,ku.SkuRow=ja,ku.SkuRowItem=Pa,ku.skuHelper=Fa,ku.skuConstants=Aa;var xu=ku,Su=Object(r.a)("slider"),wu=Su[0],Cu=Su[1],Ou=wu({mixins:[v],props:{disabled:Boolean,vertical:Boolean,activeColor:String,inactiveColor:String,min:{type:Number,default:0},max:{type:Number,default:100},step:{type:Number,default:1},value:{type:Number,default:0},barHeight:{type:[Number,String],default:2}},computed:{range:function(){return this.max-this.min}},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"),w(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)/(this.vertical?e.height:e.width)*this.range+this.min;this.updateValue(i,!0)}},updateValue:function(t,e){t=this.format(t),this.$emit("input",t),e&&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(t){var e,i=this.vertical,n={background:this.inactiveColor},s=i?"width":"height",o=((e={})[i?"height":"width"]=100*(this.value-this.min)/this.range+"%",e[s]=Object(q.a)(this.barHeight),e.background=this.activeColor,e);return t("div",{style:n,class:Cu({disabled:this.disabled,vertical:i}),on:{click:this.onClick}},[t("div",{class:Cu("bar"),style:o},[t("div",{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:Cu("button-wrapper"),on:{touchstart:this.onTouchStart,touchmove:this.onTouchMove,touchend:this.onTouchEnd,touchcancel:this.onTouchEnd}},[this.slots("button")||t("div",{class:Cu("button")})])])])}}),Tu=Object(r.a)("step"),$u=Tu[0],Iu=Tu[1],Bu=$u({beforeCreate:function(){var t=this.$parent.steps,e=this.$parent.slots().indexOf(this.$vnode);t.splice(-1===e?t.length:e,0,this)},beforeDestroy:function(){var t=this.$parent.steps.indexOf(this);t>-1&&this.$parent.steps.splice(t,1)},computed:{status:function(){var t=this.$parent.steps.indexOf(this),e=this.$parent.active;return t<e?"finish":t===e?"process":void 0}},render:function(t){var e,i=this.slots,n=this.status,s=this.$parent,o=s.activeIcon,r=s.activeColor,a=s.inactiveIcon,u=s.direction,l="process"===n&&{color:r};return t("div",{class:["van-hairline",Iu([u,(e={},e[n]=n,e)])]},[t("div",{class:Iu("title"),style:l},[this.slots()]),t("div",{class:Iu("circle-container")},[function(){if("process"===n)return i("active-icon")||t(ot,{class:Iu("icon"),attrs:{name:o,color:r}});var e=i("inactive-icon");return a||e?e||t(ot,{class:Iu("icon"),attrs:{name:a}}):t("i",{class:Iu("circle")})}()]),t("div",{class:Iu("line")})])}}),ju=Object(r.a)("steps"),Nu=ju[0],Au=ju[1],zu=Nu({props:{inactiveIcon:String,active:{type:Number,default:0},direction:{type:String,default:"horizontal"},activeColor:{type:String,default:"#07c160"},activeIcon:{type:String,default:"checked"}},data:function(){return{steps:[]}},render:function(t){return t("div",{class:Au([this.direction])},[t("div",{class:Au("items")},[this.slots()])])}}),Lu=Object(r.a)("submit-bar"),Eu=Lu[0],Du=Lu[1],Mu=Lu[2];function Fu(t,e,i,n){var s=e.tip,r=e.price,a=e.tipIcon;return t("div",o()([{class:Du({"safe-area-inset-bottom":e.safeAreaInsetBottom})},h(n)]),[i.top&&i.top(),function(){if(i.tip||s)return t("div",{class:Du("tip")},[a&&t(ot,{class:Du("tip-icon"),attrs:{name:a}}),s&&t("span",{class:Du("tip-text")},[s]),i.tip&&i.tip()])}(),t("div",{class:Du("bar")},[i.default&&i.default(),function(){if("number"==typeof r){var i=e.currency+" "+(r/100).toFixed(e.decimalLength);return t("div",{class:Du("text")},[t("span",[e.label||Mu("label")]),t("span",{class:Du("price")},[i]),e.suffixLabel&&t("span",{class:Du("suffix-label")},[e.suffixLabel])])}}(),t(xe,{attrs:{square:!0,size:"large",type:e.buttonType,loading:e.loading,disabled:e.disabled,text:e.loading?"":e.buttonText},class:Du("button"),on:{click:function(){d(n,"submit")}}})])])}Fu.props={tip:String,label:String,price:Number,tipIcon:String,loading:Boolean,disabled:Boolean,buttonText:String,suffixLabel:String,safeAreaInsetBottom:Boolean,decimalLength:{type:Number,default:2},currency:{type:String,default:"¥"},buttonType:{type:String,default:"danger"}};var Pu=Eu(Fu),Vu=Object(r.a)("swipe-cell"),Ru=Vu[0],_u=Vu[1],Hu=Ru({mixins:[v,Es({event:"touchstart",method:"onClick"})],props:{onClose:Function,disabled:Boolean,leftWidth:Number,rightWidth:Number,name:{type:[Number,String],default:""}},data:function(){return{offset:0,dragging:!1}},computed:{computedLeftWidth:function(){return this.leftWidth||this.getWidthByRef("left")},computedRightWidth:function(){return this.rightWidth||this.getWidthByRef("right")}},methods:{getWidthByRef:function(t){return this.$refs[t]?this.$refs[t].getBoundingClientRect().width:0},open:function(t){var e="left"===t?this.computedLeftWidth:-this.computedRightWidth;this.swipeMove(e),this.resetSwipeStatus()},close:function(){this.offset=0},resetSwipeStatus:function(){this.swiping=!1,this.opened=!0},swipeMove:function(t){void 0===t&&(t=0),this.offset=jt(t,-this.computedRightWidth,this.computedLeftWidth),this.offset?this.swiping=!0:this.opened=!1},swipeLeaveTransition:function(t){var e=this.offset,i=this.computedLeftWidth,n=this.computedRightWidth,s=this.opened?.85:.15;"right"===t&&-e>n*s&&n>0?this.open("right"):"left"===t&&e>i*s&&i>0?this.open("left"):this.swipeMove(0)},startDrag:function(t){this.disabled||(this.dragging=!0,this.startOffset=this.offset,this.touchStart(t))},onDrag:function(t){this.disabled||(this.touchMove(t),"horizontal"===this.direction&&(w(t,!0),this.swipeMove(this.deltaX+this.startOffset)))},endDrag:function(){this.disabled||(this.dragging=!1,this.swiping&&this.swipeLeaveTransition(this.offset>0?"left":"right"))},onClick:function(t){void 0===t&&(t="outside"),this.$emit("click",t),this.offset&&(this.onClose?this.onClose(t,this,{name:this.name}):this.swipeMove(0))}},render:function(t){var e=this,i=function(t,i){return function(n){i&&n.stopPropagation(),e.onClick(t)}},n={transform:"translate3d("+this.offset+"px, 0, 0)",transition:this.dragging?"none":".6s cubic-bezier(0.18, 0.89, 0.32, 1)"};return t("div",{class:_u(),on:{click:i("cell"),touchstart:this.startDrag,touchmove:this.onDrag,touchend:this.endDrag,touchcancel:this.endDrag}},[t("div",{class:_u("wrapper"),style:n,on:{transitionend:function(){e.swiping=!1}}},[this.slots("left")&&t("div",{ref:"left",class:_u("left"),on:{click:i("left",!0)}},[this.slots("left")]),this.slots(),this.slots("right")&&t("div",{ref:"right",class:_u("right"),on:{click:i("right",!0)}},[this.slots("right")])])])}}),Wu=Object(r.a)("tabbar"),qu=Wu[0],Yu=Wu[1],Xu=qu({mixins:[ii("vanTabbar")],props:{route:Boolean,activeColor:String,inactiveColor:String,safeAreaInsetBottom:Boolean,value:{type:[Number,String],default:0},border:{type:Boolean,default:!0},fixed:{type:Boolean,default:!0},zIndex:{type:Number,default:1}},watch:{children:function(){this.setActiveItem()},value:function(){this.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(t){return t("div",{style:{zIndex:this.zIndex},class:[{"van-hairline--top-bottom":this.border},Yu({fixed:this.fixed,"safe-area-inset-bottom":this.safeAreaInsetBottom})]},[this.slots()])}}),Uu=Object(r.a)("tabbar-item"),Ku=Uu[0],Qu=Uu[1],Gu=Ku({mixins:[ei("vanTabbar")],props:n({},Ut,{dot:Boolean,icon:String,name:[Number,String],info:[Number,String]}),data:function(){return{active:!1}},computed:{routeActive:function(){var t=this.to,e=this.$route;if(t&&e){var i=Object(g.c)(t)?t.path:t;return e.path===i}}},methods:{onClick:function(t){this.parent.onChange(this.name||this.index),this.$emit("click",t),Yt(this.$router,this)}},render:function(t){var e=this.icon,i=this.slots,n=this.parent.route?this.routeActive:this.active,s=this.parent[n?"activeColor":"inactiveColor"];return t("div",{class:Qu({active:n}),style:{color:s},on:{click:this.onClick}},[t("div",{class:Qu("icon",{dot:this.dot})},[i("icon",{active:n})||e&&t(ot,{attrs:{name:e}}),t(Q,{attrs:{info:this.info}})]),t("div",{class:Qu("text")},[i("default",{active:n})])])}}),Zu=Object(r.a)("tree-select"),Ju=Zu[0],tl=Zu[1];function el(t,e,i,n){var s=e.height,r=e.items,a=e.mainActiveIndex,u=e.activeId,l=(r[a]||{}).children||[];return t("div",o()([{class:tl(),style:{height:s+"px"}},h(n)]),[t("div",{class:tl("nav")},[r.map(function(e,i){return t("div",{key:i,class:["van-ellipsis",tl("nav-item",{active:a===i,disabled:e.disabled})],on:{click:function(){e.disabled||(d(n,"click-nav",i),d(n,"navclick",i))}}},[e.text])})]),t("div",{class:tl("content")},[l.map(function(e){return t("div",{key:e.id,class:["van-ellipsis",tl("item",{active:u===e.id,disabled:e.disabled})],on:{click:function(){e.disabled||(d(n,"click-item",e),d(n,"itemclick",e))}}},[e.text,u===e.id&&t(ot,{attrs:{name:"checked",size:"16px"},class:tl("selected")})])})])])}el.props={items:{type:Array,default:function(){return[]}},height:{type:Number,default:300},activeId:{type:[Number,String],default:0},mainActiveIndex:{type:Number,default:0}};var il=Ju(el);i.d(e,"install",function(){return ol}),i.d(e,"version",function(){return nl}),i.d(e,"ActionSheet",function(){return Ot}),i.d(e,"AddressEdit",function(){return ti}),i.d(e,"AddressList",function(){return ki}),i.d(e,"Area",function(){return Wt}),i.d(e,"Button",function(){return xe}),i.d(e,"Card",function(){return ji}),i.d(e,"Cell",function(){return Jt}),i.d(e,"CellGroup",function(){return Ei}),i.d(e,"Checkbox",function(){return Mi}),i.d(e,"CheckboxGroup",function(){return Ri}),i.d(e,"Circle",function(){return Ui}),i.d(e,"Col",function(){return Zi}),i.d(e,"Collapse",function(){return nn}),i.d(e,"CollapseItem",function(){return un}),i.d(e,"ContactCard",function(){return pn}),i.d(e,"ContactEdit",function(){return kn}),i.d(e,"ContactList",function(){return Tn}),i.d(e,"CountDown",function(){return En}),i.d(e,"Coupon",function(){return _n}),i.d(e,"CouponCell",function(){return Un}),i.d(e,"CouponList",function(){return gs}),i.d(e,"DatetimePicker",function(){return Os}),i.d(e,"Dialog",function(){return Ne}),i.d(e,"Divider",function(){return js}),i.d(e,"DropdownItem",function(){return Ls}),i.d(e,"DropdownMenu",function(){return Ps}),i.d(e,"Field",function(){return oe}),i.d(e,"GoodsAction",function(){return Ws}),i.d(e,"GoodsActionButton",function(){return Ks}),i.d(e,"GoodsActionIcon",function(){return to}),i.d(e,"Grid",function(){return so}),i.d(e,"GridItem",function(){return uo}),i.d(e,"Icon",function(){return ot}),i.d(e,"Image",function(){return tt}),i.d(e,"ImagePreview",function(){return To}),i.d(e,"IndexAnchor",function(){return jo}),i.d(e,"IndexBar",function(){return Lo}),i.d(e,"Info",function(){return Q}),i.d(e,"Lazyload",function(){return Do}),i.d(e,"List",function(){return Ro}),i.d(e,"Loading",function(){return kt}),i.d(e,"Locale",function(){return _o.a}),i.d(e,"NavBar",function(){return Xo}),i.d(e,"NoticeBar",function(){return Go}),i.d(e,"Notify",function(){return ar}),i.d(e,"NumberKeyboard",function(){return br}),i.d(e,"Overlay",function(){return j}),i.d(e,"Pagination",function(){return Cr}),i.d(e,"Panel",function(){return Br}),i.d(e,"PasswordInput",function(){return Lr}),i.d(e,"Picker",function(){return Vt}),i.d(e,"Popup",function(){return lt}),i.d(e,"Progress",function(){return Fr}),i.d(e,"PullRefresh",function(){return Wr}),i.d(e,"Radio",function(){return li}),i.d(e,"RadioGroup",function(){return ri}),i.d(e,"Rate",function(){return Kr}),i.d(e,"Row",function(){return Jr}),i.d(e,"Search",function(){return oa}),i.d(e,"Sidebar",function(){return la}),i.d(e,"SidebarItem",function(){return fa}),i.d(e,"Skeleton",function(){return ka}),i.d(e,"Sku",function(){return xu}),i.d(e,"Slider",function(){return Ou}),i.d(e,"Step",function(){return Bu}),i.d(e,"Stepper",function(){return Ha}),i.d(e,"Steps",function(){return zu}),i.d(e,"Sticky",function(){return us}),i.d(e,"SubmitBar",function(){return Pu}),i.d(e,"Swipe",function(){return fo}),i.d(e,"SwipeCell",function(){return Hu}),i.d(e,"SwipeItem",function(){return go}),i.d(e,"Switch",function(){return He}),i.d(e,"SwitchCell",function(){return Ue}),i.d(e,"Tab",function(){return Zn}),i.d(e,"Tabbar",function(){return Xu}),i.d(e,"TabbarItem",function(){return Gu}),i.d(e,"Tabs",function(){return ds}),i.d(e,"Tag",function(){return Oi}),i.d(e,"Toast",function(){return ve}),i.d(e,"TreeSelect",function(){return il}),i.d(e,"Uploader",function(){return nu});var nl="2.0.9",sl=[Ot,ti,ki,Wt,xe,ji,Jt,Ei,Mi,Ri,Ui,Zi,nn,un,pn,kn,Tn,En,_n,Un,gs,Os,Ne,js,Ls,Ps,oe,Ws,Ks,to,so,uo,ot,tt,To,jo,Lo,Q,Ro,kt,Xo,Go,ar,br,j,Cr,Br,Lr,Vt,lt,Fr,Wr,li,ri,Kr,Jr,oa,la,fa,ka,xu,Ou,Bu,Ha,zu,us,Pu,fo,Hu,go,He,Ue,Zn,Xu,Gu,ds,Oi,ve,il,nu],ol=function(t){sl.forEach(function(e){t.use(e)})};"undefined"!=typeof window&&window.Vue&&ol(window.Vue);e.default={install:ol,version:nl}}])});