UNPKG

vant-fork

Version:

Lightweight Mobile UI Components built on Vue

7 lines 148 kB
!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 n(i){if(e[i])return e[i].exports;var s=e[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)n.d(i,s,function(e){return t[e]}.bind(null,s));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=5)}([function(t,e,n){"use strict";n.d(e,"b",function(){return r}),n.d(e,"g",function(){return d}),n.d(e,"e",function(){return a}),n.d(e,"d",function(){return o}),n.d(e,"f",function(){return s}),n.d(e,"a",function(){return u}),n.d(e,"c",function(){return c});var i=n(1),s=n.n(i).a.prototype.$isServer;function o(t){return void 0!==t&&null!==t}function a(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}function r(t,e){var n=t;return e.split(".").forEach(function(t){n=o(n[t])?n[t]:""}),n}var l=/-(\w)/g;function u(t){return t.replace(l,function(t,e){return e.toUpperCase()})}function c(){return!s&&/android/.test(navigator.userAgent.toLowerCase())}function d(t,e,n){return Math.min(Math.max(t,e),n)}},function(e,n){e.exports=t},function(t,e,n){"use strict";(function(t){n.d(e,"b",function(){return l}),n.d(e,"a",function(){return u});var i=n(0),s=Date.now();var o=i.f?t:window,a=o.requestAnimationFrame||o.webkitRequestAnimationFrame||function(t){var e=Date.now(),n=Math.max(0,16-(e-s)),i=setTimeout(t,n);return s=e+n,i},r=o.cancelAnimationFrame||o.webkitCancelAnimationFrame||o.clearTimeout;function l(t){return a.call(o,t)}function u(t){r.call(o,t)}}).call(this,n(4))},function(t,e,n){ /*! * Vue-Lazyload.js v1.2.3 * (c) 2018 Awe <hilongjw@gmail.com> * Released under the MIT License. */ t.exports=function(){"use strict";function t(t){t=t||{};var i=arguments.length,s=0;if(1===i)return t;for(;++s<i;){var o=arguments[s];d(t)&&(t=o),n(o)&&e(t,o)}return t}function e(e,s){for(var o in h(e,s),s)if("__proto__"!==o&&i(s,o)){var a=s[o];n(a)?("undefined"===p(e[o])&&"function"===p(a)&&(e[o]=a),e[o]=t(e[o]||{},a)):e[o]=a}return e}function n(t){return"object"===p(t)||"function"===p(t)}function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function s(t,e){if(t.length){var n=t.indexOf(e);return n>-1?t.splice(n,1):void 0}}function o(t,e){if("IMG"===t.tagName&&t.getAttribute("data-srcset")){var n=t.getAttribute("data-srcset"),i=[],s=t.parentNode,o=s.offsetWidth*e,a=void 0,r=void 0,l=void 0;(n=n.trim().split(",")).map(function(t){t=t.trim(),-1===(a=t.lastIndexOf(" "))?(r=t,l=999998):(r=t.substr(0,a),l=parseInt(t.substr(a+1,t.length-a-2),10)),i.push([l,r])}),i.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 u="",c=void 0,d=i.length,h=0;h<d;h++)if((c=i[h])[0]>=o){u=c[1];break}return u}}function a(t,e){for(var n=void 0,i=0,s=t.length;i<s;i++)if(e(t[i])){n=t[i];break}return n}function r(){}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},u=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},c=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),d=function(t){return null==t||"function"!=typeof t&&"object"!==(void 0===t?"undefined":l(t))},h=function(t,e){if(null===t||void 0===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 n=Object.prototype.propertyIsEnumerable,i=Object(t),s=arguments.length,o=0;++o<s;)for(var a=Object(arguments[o]),r=Object.getOwnPropertySymbols(a),l=0;l<r.length;l++){var u=r[l];n.call(a,u)&&(i[u]=a[u])}return i},f=Object.prototype.toString,p=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=f.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"},m=t,v="undefined"!=typeof window,g=v&&"IntersectionObserver"in window,b={event:"event",observer:"observer"},y=function(){function t(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n}if(v)return"function"==typeof window.CustomEvent?window.CustomEvent:(t.prototype=window.Event.prototype,t)}(),k=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return v&&window.devicePixelRatio||t},_=function(){if(v){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e)}catch(t){}return t}}(),x={on:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];_?t.addEventListener(e,n,{capture:i,passive:!0}):t.addEventListener(e,n,i)},off:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];t.removeEventListener(e,n,i)}},S=function(t,e,n){var i=new Image;i.src=t.src,i.onload=function(){e({naturalHeight:i.naturalHeight,naturalWidth:i.naturalWidth,src:i.src})},i.onerror=function(t){n(t)}},w=function(t,e){return"undefined"!=typeof getComputedStyle?getComputedStyle(t,null).getPropertyValue(e):t.style[e]},C=function(t){return w(t,"overflow")+w(t,"overflow-y")+w(t,"overflow-x")},$={},T=function(){function t(e){var n=e.el,i=e.src,s=e.error,o=e.loading,a=e.bindType,r=e.$parent,l=e.options,c=e.elRenderer;u(this,t),this.el=n,this.src=i,this.error=s,this.loading=o,this.bindType=a,this.attempt=0,this.naturalHeight=0,this.naturalWidth=0,this.options=l,this.rect=null,this.$parent=r,this.elRenderer=c,this.performanceData={init:Date.now(),loadStart:0,loadEnd:0},this.filter(),this.initState(),this.render("loading",!1)}return c(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,n=t.loading,i=t.error,s=this.src;this.src=e,this.loading=n,this.error=i,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 n in t)t.hasOwnProperty(n)&&e.push(n);return e})(this.options.filter).map(function(e){t.options.filter[e](t,t.options)})}},{key:"renderLoading",value:function(t){var e=this;S({src:this.loading},function(n){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]:r;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"),S({src:t.src},function(n){t.naturalHeight=n.naturalHeight,t.naturalWidth=n.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",E=["scroll","wheel","mousewheel","resize","animationend","transitionend","touchmove"],I={rootMargin:"0px",threshold:0},A=function(t){return function(){function e(t){var n=t.preLoad,i=t.error,s=t.throttleWait,o=t.preLoadTop,a=t.dispatchEvent,r=t.loading,l=t.attempt,c=t.silent,d=void 0===c||c,h=t.scale,f=t.listenEvents,p=(t.hasbind,t.filter),m=t.adapter,g=t.observer,y=t.observerOptions;u(this,e),this.version="1.2.3",this.mode=b.event,this.ListenerQueue=[],this.TargetIndex=0,this.TargetQueue=[],this.options={silent:d,dispatchEvent:!!a,throttleWait:s||200,preLoad:n||1.3,preLoadTop:o||0,error:i||B,loading:r||B,attempt:l||3,scale:h||k(h),ListenEvents:f||E,hasbind:!1,supportWebp:function(){if(!v)return!1;var t=!0,e=document;try{var n=e.createElement("object");n.type="image/webp",n.style.visibility="hidden",n.innerHTML="!",e.body.appendChild(n),t=!n.offsetWidth,e.body.removeChild(n)}catch(e){t=!1}return t}(),filter:p||{},adapter:m||{},observer:!!g,observerOptions:y||I},this._initEvent(),this.lazyLoadHandler=function(t,e){var n=null,i=0;return function(){if(!n){var s=Date.now()-i,o=this,a=arguments,r=function(){i=Date.now(),n=!1,t.apply(o,a)};s>=e?r():n=setTimeout(r,e)}}}(this._lazyLoadHandler.bind(this),this.options.throttleWait),this.setMode(this.options.observer?b.observer:b.event)}return c(e,[{key:"config",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(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),v&&(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,n,i){var s=this;if(function(t,e){for(var n=!1,i=0,s=t.length;i<s;i++)if(e(t[i])){n=!0;break}return n}(this.ListenerQueue,function(t){return t.el===e}))return this.update(e,n),t.nextTick(this.lazyLoadHandler);var a=this._valueFormatter(n.value),r=a.src,l=a.loading,u=a.error;t.nextTick(function(){r=o(e,s.options.scale)||r,s._observer&&s._observer.observe(e);var a=Object.keys(n.modifiers)[0],c=void 0;a&&(c=(c=i.context.$refs[a])?c.$el||c:document.getElementById(a)),c||(c=function(t){if(v){if(!(t instanceof HTMLElement))return window;for(var e=t;e&&e!==document.body&&e!==document.documentElement&&e.parentNode;){if(/(scroll|auto)/.test(C(e)))return e;e=e.parentNode}return window}}(e));var d=new T({bindType:n.arg,$parent:c,el:e,loading:l,error:u,src:r,elRenderer:s._elRenderer.bind(s),options:s.options});s.ListenerQueue.push(d),v&&(s._addListenerTarget(window),s._addListenerTarget(c)),s.lazyLoadHandler(),t.nextTick(function(){return s.lazyLoadHandler()})})}},{key:"update",value:function(e,n){var i=this,s=this._valueFormatter(n.value),r=s.src,l=s.loading,u=s.error;r=o(e,this.options.scale)||r;var c=a(this.ListenerQueue,function(t){return t.el===e});c&&c.update({src:r,loading:l,error:u}),this._observer&&(this._observer.unobserve(e),this._observer.observe(e)),this.lazyLoadHandler(),t.nextTick(function(){return i.lazyLoadHandler()})}},{key:"remove",value:function(t){if(t){this._observer&&this._observer.unobserve(t);var e=a(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;g||t!==b.observer||(t=b.event),this.mode=t,t===b.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=a(this.TargetQueue,function(e){return e.el===t});return e?e.childrenCount++:(e={el:t,id:++this.TargetIndex,childrenCount:1,listened:!0},this.mode===b.event&&this._initListen(e.el,!0),this.TargetQueue.push(e)),this.TargetIndex}}},{key:"_removeListenerTarget",value:function(t){var e=this;this.TargetQueue.forEach(function(n,i){n.el===t&&(--n.childrenCount||(e._initListen(n.el,!1),e.TargetQueue.splice(i,1),n=null))})}},{key:"_initListen",value:function(t,e){var n=this;this.options.ListenEvents.forEach(function(i){return x[e?"on":"off"](t,i,n.lazyLoadHandler)})}},{key:"_initEvent",value:function(){var t=this;this.Event={listeners:{loading:[],loaded:[],error:[]}},this.$on=function(e,n){t.Event.listeners[e].push(n)},this.$once=function(e,n){var i=t;t.$on(e,function t(){i.$off(e,t),n.apply(i,arguments)})},this.$off=function(e,n){n?s(t.Event.listeners[e],n):t.Event.listeners[e]=[]},this.$emit=function(e,n,i){t.Event.listeners[e].forEach(function(t){return t(n,i)})}}},{key:"_lazyLoadHandler",value:function(){var t=this;this.ListenerQueue.forEach(function(e,n){e.state.loaded||e.checkInView()&&e.load(function(){!e.error&&e.loaded&&t.ListenerQueue.splice(n,1)})})}},{key:"_initIntersectionObserver",value:function(){var t=this;g&&(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 n=this;t.forEach(function(t){t.isIntersecting&&n.ListenerQueue.forEach(function(e){if(e.el===t.target){if(e.state.loaded)return n._observer.unobserve(e.el);e.load()}})})}},{key:"_elRenderer",value:function(t,e,n){if(t.el){var i=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?i.style[s]='url("'+o+'")':i.getAttribute("src")!==o&&i.setAttribute("src",o),i.setAttribute("lazy",e),this.$emit(e,t,n),this.options.adapter[e]&&this.options.adapter[e](t,this.options),this.options.dispatchEvent){var a=new y(e,{detail:t});i.dispatchEvent(a)}}}},{key:"_valueFormatter",value:function(t){var e=t,n=this.options.loading,i=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,n=t.loading||this.options.loading,i=t.error||this.options.error),{src:e,loading:n,error:i}}}]),e}()},D=function(){function t(e){var n=e.lazy;u(this,t),this.lazy=n,n.lazyContainerMananger=this,this._queue=[]}return c(t,[{key:"bind",value:function(t,e,n){var i=new F({el:t,binding:e,vnode:n,lazy:this.lazy});this._queue.push(i)}},{key:"update",value:function(t,e,n){var i=a(this._queue,function(e){return e.el===t});i&&i.update({el:t,binding:e,vnode:n})}},{key:"unbind",value:function(t,e,n){var i=a(this._queue,function(e){return e.el===t});i&&(i.clear(),s(this._queue,i))}}]),t}(),N={selector:"img"},F=function(){function t(e){var n=e.el,i=e.binding,s=e.vnode,o=e.lazy;u(this,t),this.el=null,this.vnode=s,this.binding=i,this.options={},this.lazy=o,this._queue=[],this.update({el:n,binding:i})}return c(t,[{key:"update",value:function(t){var e=this,n=t.el,i=t.binding;this.el=n,this.options=m({},N,i.value),this.getImgs().forEach(function(t){e.lazy.add(t,m({},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,n=[],i=0;i<e;i++)n.push(t[i]);return n}(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]:{},n=A(t),i=new n(e),s=new D({lazy:i}),o="2"===t.version.split(".")[0];t.prototype.$Lazyload=i,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(),v&&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)}}}}(i)),o?(t.directive("lazy",{bind:i.add.bind(i),update:i.update.bind(i),componentUpdated:i.lazyLoadHandler.bind(i),unbind:i.remove.bind(i)}),t.directive("lazy-container",{bind:s.bind.bind(s),update:s.update.bind(s),unbind:s.unbind.bind(s)})):(t.directive("lazy",{bind:i.lazyLoadHandler.bind(i),update:function(t,e){m(this.vm.$refs,this.vm.$els),i.add(this.el,{modifiers:this.modifiers||{},arg:this.arg,value:t,oldValue:e},{context:this.vm})},unbind:function(){i.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 n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";function i(){return(i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}n.r(e);var s=n(1),o=n.n(s),a=n(0),r=Object.prototype.hasOwnProperty;function l(t,e,n){var i=e[n];!Object(a.d)(i)||r.call(t,n)&&!Object(a.d)(t[n])||(r.call(t,n)&&Object(a.e)(i)?t[n]=u(Object(t[n]),e[n]):t[n]=i)}function u(t,e){for(var n in e)r.call(e,n)&&l(t,e,n);return t}var c={name:"姓名",tel:"电话",save:"保存",confirm:"确认",cancel:"取消",delete:"删除",complete:"完成",loadingTip:"加载中...",telEmpty:"请填写电话",nameEmpty:"请填写姓名",confirmDelete:"确定要删除么",telInvalid:"请填写正确的电话",vanContactCard:{addText:"添加联系人"},vanContactList:{addText:"新建联系人"},vanPagination:{prev:"上一页",next:"下一页"},vanPullRefresh:{pulling:"下拉即可刷新...",loosing:"释放即可刷新..."},vanSubmitBar:{label:"合计:"},vanCouponCell:{title:"优惠券",tips:"使用优惠",count:function(t){return"您有 "+t+" 个可用优惠"}},vanCouponList:{empty:"暂无优惠券",exchange:"兑换",close:"不使用优惠",enable:"可使用优惠券",disabled:"不可使用优惠券",placeholder:"请输入优惠码"},vanCouponItem:{valid:"有效期",unlimited:"无使用门槛",discount:function(t){return t+"折"},condition:function(t){return"满"+t+"元可用"}},vanAddressEdit:{area:"地区",postal:"邮政编码",areaEmpty:"请选择地区",addressEmpty:"请填写详细地址",postalEmpty:"邮政编码格式不正确",defaultAddress:"设为默认收货地址",telPlaceholder:"收货人手机号",namePlaceholder:"收货人姓名",areaPlaceholder:"选择省 / 市 / 区"},vanAddressEditDetail:{label:"详细地址",placeholder:"街道门牌、楼层房间号等信息"},vanAddressList:{add:"新增地址"}},d=o.a.prototype,h={install:function(){var t;d.$vantLang||(o.a.util.defineReactive(d,"$vantLang","zh-CN"),o.a.util.defineReactive(d,"$vantMessages",((t={})["zh-CN"]=c,t)))},use:function(t,e){var n;d.$vantLang=t,this.add(((n={})[t]=e,n))},add:function(t){void 0===t&&(t={}),u(d.$vantMessages,t)}};h.install();var f,p=h,m=function(t,e,n){return e?t+n+e:t},v={methods:{b:function(t,e){var n=this.$options.name;return t&&"string"!=typeof t&&(e=t,t=""),t=m(n,t,"__"),e?[t,function t(e,n){if("string"==typeof n)return m(e,n,"--");if(Array.isArray(n))return n.map(function(n){return t(e,n)});var i={};return Object.keys(n).forEach(function(t){i[e+"--"+t]=n[t]}),i}(t,e)]:t}}},g={computed:{$t:function(){var t=this.$options.name,e=t?Object(a.a)(t)+".":"";if(!this.$vantMessages)return function(){return""};var n=this.$vantMessages[this.$vantLang];return function(t){for(var i=Object(a.b)(n,e+t)||Object(a.b)(n,t),s=arguments.length,o=new Array(s>1?s-1:0),r=1;r<s;r++)o[r-1]=arguments[r];return"function"==typeof i?i.apply(null,o):i}}}},b=function(t){t.component(this.name,this)},y=function(t){return t.name="van-"+t.name,t.install=t.install||b,t.mixins=t.mixins||[],t.mixins.push(g,v),t.methods=t.methods||{},t.methods.isDef=a.d,t},k=y({render:function(){var t=this.$createElement,e=this._self._c||t;return this.isDef(this.info)?e("div",{class:this.b()},[this._v(this._s(this.info))]):this._e()},name:"info",props:{info:[String,Number]}}),_=y({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("i",t._g({class:[t.classPrefix,t.classPrefix+"-"+t.name],style:t.style},t.$listeners),[t._t("default"),n("van-info",{attrs:{info:t.info}})],2)},name:"icon",components:(f={},f[k.name]=k,f),props:{name:String,info:[String,Number],color:String,size:String,classPrefix:{type:String,default:"van-icon"}},computed:{style:function(){return{color:this.color,fontSize:this.size}}}}),x=y({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.b([t.type,t.colorType]),style:t.style},[n("span",{class:t.b("spinner",t.type)},[t._l("spinner"===t.type?12:0,function(t,e){return n("i",{key:e})}),"circular"===t.type?n("svg",{class:t.b("circular"),attrs:{viewBox:"25 25 50 50"}},[n("circle",{attrs:{cx:"50",cy:"50",r:"20",fill:"none"}})]):t._e()],2)])},name:"loading",props:{size:String,type:{type:String,default:"circular"},color:{type:String,default:"#c9c9c9"}},computed:{colorType:function(){var t=this.color;return"white"===t||"black"===t?t:""},style:function(){return{color:"black"===this.color?"#c9c9c9":this.color,width:this.size,height:this.size}}}}),S={props:{url:String,replace:Boolean,to:[String,Object]},methods:{routerLink:function(){var t=this.to,e=this.url,n=this.$router,i=this.replace;t&&n?n[i?"replace":"push"](t):e&&(i?location.replace(e):location.href=e)}}},w=y({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:[t.b({center:t.center,required:t.required,clickable:t.isLink||t.clickable}),{"van-hairline":t.border}],on:{click:t.onClick}},[t._t("icon",[t.icon?n("icon",{class:t.b("left-icon"),attrs:{name:t.icon}}):t._e()]),t.isDef(t.title)||t.$slots.title?n("div",{class:t.b("title")},[t._t("title",[n("span",{domProps:{textContent:t._s(t.title)}}),t.label?n("div",{class:t.b("label"),domProps:{textContent:t._s(t.label)}}):t._e()])],2):t._e(),t.isDef(t.value)||t.$slots.default?n("div",{class:t.b("value",{alone:!t.$slots.title&&!t.title})},[t._t("default",[n("span",{domProps:{textContent:t._s(t.value)}})])],2):t._e(),t._t("right-icon",[t.isLink?n("icon",{class:t.b("right-icon",t.arrowDirection),attrs:{name:"arrow"}}):t._e()]),t._t("extra")],2)},name:"cell",components:{Icon:_},mixins:[S],props:{icon:String,label:String,center:Boolean,isLink:Boolean,required:Boolean,clickable:Boolean,title:[String,Number],value:[String,Number],arrowDirection:String,border:{type:Boolean,default:!0}},methods:{onClick:function(){this.$emit("click"),this.routerLink()}}}),C=y({render:function(){var t=this.$createElement;return(this._self._c||t)("div",{class:[this.b(),{"van-hairline--top-bottom":this.border}]},[this._t("default")],2)},name:"cell-group",props:{border:{type:Boolean,default:!0}}}),$=function(t){return t.components=i(t.components||{},{Icon:_,Loading:x,Cell:w,CellGroup:C}),y(t)},T={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"van-fade"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.visible,expression:"visible"}],staticClass:"van-modal",class:t.className,style:t.style,on:{touchmove:function(t){t.preventDefault(),t.stopPropagation()},click:function(e){t.$emit("click",e)}}})])},name:"modal",props:{visible:Boolean,zIndex:Number,className:String,customStyle:Object},computed:{style:function(){return i({zIndex:this.zIndex},this.customStyle)}}},B={id:1,zIndex:2e3,stack:[],lockCount:0,plusKey:function(t){return this[t]++},get top(){return this.stack[this.stack.length-1]}},E={className:"",customStyle:{}},I={open:function(t,e){if(!B.stack.some(function(e){return e.vm._popupId===t._popupId})){var n=t.$el,i=n&&n.parentNode&&11!==n.parentNode.nodeType?n.parentNode:document.body;B.stack.push({vm:t,config:e,targetNode:i}),this.update()}},close:function(t){var e=B.stack;e.length&&(B.top.vm._popupId===t?(e.pop(),this.update()):B.stack=e.filter(function(e){return e.vm._popupId!==t}))},update:function(){var t=B.modal;if(t||((t=new(o.a.extend(T))({el:document.createElement("div")})).$on("click",this.onClick),B.modal=t),t.$el.parentNode&&(t.visible=!1),B.top){var e=B.top,n=e.targetNode,s=e.config;n.appendChild(t.$el),i(t,i({},E,s,{visible:!0}))}},onClick:function(){if(B.top){var t=B.top.vm;t.$emit("click-overlay"),t.closeOnClickOverlay&&t.$emit("input",!1)}}},A={getScrollEventTarget:function(t,e){void 0===e&&(e=window);for(var n=t;n&&"HTML"!==n.tagName&&"BODY"!==n.tagName&&1===n.nodeType&&n!==e;){var i=this.getComputedStyle(n).overflowY;if("scroll"===i||"auto"===i)return n;n=n.parentNode}return e},getScrollTop:function(t){return"scrollTop"in t?t.scrollTop:t.pageYOffset},setScrollTop:function(t,e){"scrollTop"in t?t.scrollTop=e:t.scrollTo(t.scrollX,e)},getElementTop:function(t){return(t===window?0:t.getBoundingClientRect().top)+this.getScrollTop(window)},getVisibleHeight:function(t){return t===window?t.innerHeight:t.getBoundingClientRect().height},getComputedStyle:!a.f&&document.defaultView.getComputedStyle.bind(document.defaultView)},D=!1;if(!a.f)try{var N={};Object.defineProperty(N,"passive",{get:function(){D=!0}}),window.addEventListener("test-passive",null,N)}catch(t){}function F(t,e,n,i){void 0===i&&(i=!1),!a.f&&t.addEventListener(e,n,!!D&&{capture:!1,passive:i})}function O(t,e,n){!a.f&&t.removeEventListener(e,n)}var L={methods:{touchStart:function(t){this.resetTouchStatus(),this.startX=t.touches[0].clientX,this.startY=t.touches[0].clientY},touchMove:function(t){var e=t.touches[0];this.deltaX=e.clientX-this.startX,this.deltaY=e.clientY-this.startY,this.offsetX=Math.abs(this.deltaX),this.offsetY=Math.abs(this.deltaY),this.direction=this.offsetX>this.offsetY?"horizontal":this.offsetX<this.offsetY?"vertical":""},resetTouchStatus:function(){this.direction="",this.deltaX=0,this.deltaY=0,this.offsetX=0,this.offsetY=0}}},M={mixins:[L],props:{value:Boolean,overlay:Boolean,overlayStyle:Object,overlayClass:String,closeOnClickOverlay:Boolean,zIndex:[String,Number],getContainer:[String,Function],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){this.inited=this.inited||this.value,this[t?"open":"close"]()},getContainer:function(){this.move()},overlay:function(){this.renderOverlay()}},created:function(){this._popupId="popup-"+B.plusKey("id")},mounted:function(){this.getContainer&&this.move(),this.value&&this.open()},activated:function(){this.value&&this.open()},beforeDestroy:function(){this.close(),this.getContainer&&this.$parent.$el.appendChild(this.$el)},deactivated:function(){this.close()},methods:{open:function(){this.$isServer||this.opened||(void 0!==this.zIndex&&(B.zIndex=this.zIndex),this.opened=!0,this.renderOverlay(),this.lockScroll&&(F(document,"touchstart",this.touchStart),F(document,"touchmove",this.onTouchMove),B.lockCount||document.body.classList.add("van-overflow-hidden"),B.lockCount++))},close:function(){this.opened&&(this.lockScroll&&(B.lockCount--,O(document,"touchstart",this.touchStart),O(document,"touchmove",this.onTouchMove),B.lockCount||document.body.classList.remove("van-overflow-hidden")),this.opened=!1,I.close(this._popupId),this.$emit("input",!1))},move:function(){var t,e=this.getContainer;e?t="string"==typeof e?document.querySelector(e):e():this.$parent&&(t=this.$parent.$el),t&&t.appendChild(this.$el)},onTouchMove:function(t){this.touchMove(t);var e=this.deltaY>0?"10":"01",n=A.getScrollEventTarget(t.target,this.$el),i=n.scrollHeight,s=n.offsetHeight,o=n.scrollTop,a="11";0===o?a=s>=i?"00":"01":o+s>=i&&(a="10"),"11"===a||"vertical"!==this.direction||parseInt(a,2)&parseInt(e,2)||(t.preventDefault(),t.stopPropagation())},renderOverlay:function(){var t=this;this.overlay?I.open(this,{zIndex:B.plusKey("zIndex"),className:this.overlayClass,customStyle:this.overlayStyle}):I.close(this._popupId),this.$nextTick(function(){t.$el.style.zIndex=B.plusKey("zIndex")})}}},z=$({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"van-slide-bottom"}},[t.shouldRender?n("div",{directives:[{name:"show",rawName:"v-show",value:t.value,expression:"value"}],class:t.b({withtitle:t.title})},[t.title?n("div",{staticClass:"van-hairline--top-bottom",class:t.b("header")},[n("div",{domProps:{textContent:t._s(t.title)}}),n("icon",{attrs:{name:"close"},on:{click:t.onCancel}})],1):n("ul",{staticClass:"van-hairline--bottom"},t._l(t.actions,function(e){return n("li",{class:[t.b("item",{disabled:e.disabled||e.loading}),e.className,"van-hairline--top"],on:{click:function(n){n.stopPropagation(),t.onSelect(e)}}},[e.loading?n("loading",{class:t.b("loading"),attrs:{size:"20px"}}):[n("span",{class:t.b("name")},[t._v(t._s(e.name))]),e.subname?n("span",{class:t.b("subname")},[t._v(t._s(e.subname))]):t._e()]],2)})),t.cancelText?n("div",{class:[t.b("cancel"),"van-hairline--top"],domProps:{textContent:t._s(t.cancelText)},on:{click:t.onCancel}}):n("div",{class:t.b("content")},[t._t("default")],2)]):t._e()])},name:"actionsheet",mixins:[M],props:{value:Boolean,title:String,cancelText:String,actions:{type:Array,default:function(){return[]}},overlay:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0}},methods:{onSelect:function(t){t.disabled||t.loading||(t.callback&&t.callback(t),this.$emit("select",t))},onCancel:function(){this.$emit("input",!1),this.$emit("cancel")}}}),P=$({render:function(){var t,e=this,n=e.$createElement,i=e._self._c||n;return i("cell",{class:e.b((t={error:e.error,disabled:e.$attrs.disabled,"min-height":"textarea"===e.type&&!e.autosize},t["label-"+e.labelAlign]=e.labelAlign,t)),attrs:{icon:e.leftIcon,title:e.label,center:e.center,border:e.border,"is-link":e.isLink,required:e.required}},[e._t("label",null,{slot:"title"}),i("div",{class:e.b("body")},["textarea"===e.type?i("textarea",e._g(e._b({ref:"input",class:e.b("control",e.inputAlign),attrs:{readonly:e.readonly},domProps:{value:e.value}},"textarea",e.$attrs,!1),e.listeners)):i("input",e._g(e._b({ref:"input",class:e.b("control",e.inputAlign),attrs:{type:e.type,readonly:e.readonly},domProps:{value:e.value}},"input",e.$attrs,!1),e.listeners)),e.showClear?i("icon",{class:e.b("clear"),attrs:{name:"clear"},on:{touchstart:function(t){t.preventDefault(),e.$emit("input","")}}}):e._e(),e.$slots.icon||e.icon?i("div",{class:e.b("icon"),on:{click:e.onClickIcon}},[e._t("icon",[i("icon",{attrs:{name:e.icon}})])],2):e._e(),e.$slots.button?i("div",{class:e.b("button")},[e._t("button")],2):e._e()],1),e.errorMessage?i("div",{class:e.b("error-message"),domProps:{textContent:e._s(e.errorMessage)}}):e._e()],2)},name:"field",inheritAttrs:!1,props:{value:[String,Number],icon:String,label:String,error:Boolean,center:Boolean,isLink:Boolean,leftIcon:String,readonly:Boolean,required:Boolean,clearable:Boolean,labelAlign:String,inputAlign:String,onIconClick:Function,autosize:[Boolean,Object],errorMessage:String,type:{type:String,default:"text"},border:{type:Boolean,default:!0}},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&&this.isDef(this.value)&&!this.readonly},listeners:function(){return i({},this.$listeners,{input:this.onInput,keypress:this.onKeypress,focus:this.onFocus,blur:this.onBlur})}},methods:{blur:function(){this.$refs.input&&this.$refs.input.blur()},format:function(t){void 0===t&&(t=this.$refs.input);var e=t.value,n=this.$attrs.maxlength;return this.isDef(n)&&e.length>n&&(e=e.slice(0,n),t.value=e),e},onInput:function(t){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)},onClickIcon:function(){this.$emit("click-icon"),this.onIconClick&&this.onIconClick()},onKeypress:function(t){if("number"===this.type){var e=t.keyCode,n=-1===String(this.value).indexOf(".");e>=48&&e<=57||46===e&&n||45===e||t.preventDefault()}"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(a.e)(this.autosize)){var n=this.autosize,i=n.maxHeight,s=n.minHeight;i&&(e=Math.min(e,i)),s&&(e=Math.max(e,s))}e&&(t.style.height=e+"px")}}}}),V=$({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n(t.tag,{tag:"component",class:t.b([t.type,t.size,{block:t.block,plain:t.plain,round:t.round,square:t.square,loading:t.loading,disabled:t.disabled,unclickable:t.disabled||t.loading,"bottom-action":t.bottomAction}]),attrs:{type:t.nativeType,disabled:t.disabled},on:{click:t.onClick}},[t.loading?n("loading",{attrs:{size:"20px",color:"default"===t.type?void 0:""}}):n("span",{class:t.b("text")},[t._t("default",[t._v(t._s(t.text))])],2)],1)},name:"button",props:{text:String,block:Boolean,plain:Boolean,round:Boolean,square:Boolean,loading:Boolean,disabled:Boolean,nativeType:String,bottomAction:Boolean,tag:{type:String,default:"button"},type:{type:String,default:"default"},size:{type:String,default:"normal"}},methods:{onClick:function(t){this.loading||this.disabled||this.$emit("click",t)}}}),j=$({render:function(){var t,e=this,n=e.$createElement,i=e._self._c||n;return i("transition",{attrs:{name:e.currentTransition}},[e.shouldRender?i("div",{directives:[{name:"show",rawName:"v-show",value:e.value,expression:"value"}],class:e.b((t={},t[e.position]=e.position,t))},[e._t("default")],2):e._e()])},name:"popup",mixins:[M],props:{transition:String,overlay:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0},position:{type:String,default:""}},computed:{currentTransition:function(){return this.transition||(""===this.position?"van-fade":"popup-slide-"+this.position)}}}),H=["success","fail","loading"],R=$({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"van-fade"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.value,expression:"value"}],class:t.b([t.style,t.position])},["text"===t.style?n("div",[t._v(t._s(t.message))]):t._e(),"html"===t.style?n("div",{domProps:{innerHTML:t._s(t.message)}}):t._e(),"default"===t.style?["loading"===t.type?n("loading",{attrs:{color:"white",type:t.loadingType}}):n("icon",{class:t.b("icon"),attrs:{name:t.type}}),t.isDef(t.message)?n("div",{class:t.b("text")},[t._v(t._s(t.message))]):t._e()]:t._e()],2)])},name:"toast",mixins:[M],props:{forbidClick:Boolean,message:[String,Number],type:{type:String,default:"text"},loadingType:{type:String,default:"circular"},position:{type:String,default:"middle"},lockScroll:{type:Boolean,default:!1}},data:function(){return{clickable:!1}},computed:{style:function(){return-1!==H.indexOf(this.type)?"default":this.type}},mounted:function(){this.toggleClickale()},watch:{value:function(){this.toggleClickale()},forbidClick:function(){this.toggleClickale()}},methods:{toggleClickale: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")}}}}),W={type:"text",mask:!1,message:"",value:!0,duration:3e3,position:"middle",loadingType:"circular",forbidClick:!1,overlayStyle:{}},q=function(t){return Object(a.e)(t)?t:{message:t}},Y=[],K=!0,U=i({},W);function Q(t){void 0===t&&(t={});var e=function(){if(!Y.length||!K){var t=new(o.a.extend(R))({el:document.createElement("div")});document.body.appendChild(t.$el),Y.push(t)}return Y[Y.length-1]}();return t=i({},U,q(t),{clear:function(){e.value=!1}}),i(e,function(t){return t.overlay=t.mask,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;Q[t]=(e=t,function(t){return Q(i({type:e},q(t)))})}),Q.clear=function(t){Y.length&&(t?(Y.forEach(function(t){t.clear()}),Y=[]):K?Y[0].clear():Y.shift().clear())},Q.setDefaultOptions=function(t){i(U,t)},Q.resetDefaultOptions=function(){U=i({},W)},Q.allowMultiple=function(t){void 0===t&&(t=!0),K=!t},Q.install=function(){o.a.use(R)},o.a.prototype.$toast=Q;var X,G=Q,Z=$({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"van-dialog-bounce"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.value,expression:"value"}],class:[t.b(),t.className]},[t.title?n("div",{class:t.b("header",{isolated:!t.message&&!t.$slots.default}),domProps:{textContent:t._s(t.title)}}):t._e(),t.message||t.$slots.default?n("div",{class:t.b("content")},[t._t("default",[t.message?n("div",{class:t.b("message",{"has-title":t.title}),domProps:{innerHTML:t._s(t.message)}}):t._e()])],2):t._e(),n("div",{staticClass:"van-hairline--top",class:t.b("footer",{buttons:t.showCancelButton&&t.showConfirmButton})},[n("van-button",{directives:[{name:"show",rawName:"v-show",value:t.showCancelButton,expression:"showCancelButton"}],class:t.b("cancel"),attrs:{loading:t.loading.cancel,size:"large"},on:{click:function(e){t.handleAction("cancel")}}},[t._v("\n "+t._s(t.cancelButtonText||t.$t("cancel"))+"\n ")]),n("van-button",{directives:[{name:"show",rawName:"v-show",value:t.showConfirmButton,expression:"showConfirmButton"}],class:[t.b("confirm"),{"van-hairline--left":t.showCancelButton&&t.showConfirmButton}],attrs:{size:"large",loading:t.loading.confirm},on:{click:function(e){t.handleAction("confirm")}}},[t._v("\n "+t._s(t.confirmButtonText||t.$t("confirm"))+"\n ")])],1)])])},name:"dialog",components:{VanButton:V},mixins:[M],props:{title:String,message:String,callback:Function,className:[String,Object,Array],beforeClose:Function,confirmButtonText:String,cancelButtonText: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:{handleAction:function(t){var e=this;this.beforeClose?(this.loading[t]=!0,this.beforeClose(t,function(n){!1!==n&&e.onClose(t),e.loading[t]=!1})):this.onClose(t)},onClose:function(t){this.$emit("input",!1),this.$emit(t),this.callback&&this.callback(t)}}}),J=function(t){return new Promise(function(e,n){X||((X=new(o.a.extend(Z))({el:document.createElement("div")})).$on("input",function(t){X.value=t}),document.body.appendChild(X.$el)),i(X,i({resolve:e,reject:n},t))})};J.defaultOptions={value:!0,title:"",message:"",overlay:!0,className:"",lockScroll:!0,beforeClose:null,confirmButtonText:"",cancelButtonText:"",showConfirmButton:!0,showCancelButton:!1,closeOnClickOverlay:!1,callback:function(t){X["confirm"===t?"resolve":"reject"](t)}},J.alert=function(t){return J(i({},J.currentOptions,t))},J.confirm=function(t){return J(i({},J.currentOptions,{showCancelButton:!0},t))},J.close=function(){X&&(X.value=!1)},J.setDefaultOptions=function(t){i(J.currentOptions,t)},J.resetDefaultOptions=function(){J.currentOptions=i({},J.defaultOptions)},J.install=function(){o.a.use(Z)},o.a.prototype.$dialog=J,J.resetDefaultOptions();var tt=J;function et(t){return Array.isArray(t)?t.map(function(t){return et(t)}):"object"==typeof t?u({},t):t}var nt=$({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.b()},[t.showToolbar?n("div",{staticClass:"van-hairline--top-bottom",class:t.b("toolbar")},[t._t("default",[n("div",{class:t.b("cancel"),on:{click:function(e){t.emit("cancel")}}},[t._v(t._s(t.cancelButtonText||t.$t("cancel")))]),t.title?n("div",{staticClass:"van-ellipsis",class:t.b("title"),domProps:{textContent:t._s(t.title)}}):t._e(),n("div",{class:t.b("confirm"),on:{click:function(e){t.emit("confirm")}}},[t._v(t._s(t.confirmButtonText||t.$t("confirm")))])])],2):t._e(),t.loading?n("div",{class:t.b("loading")},[n("loading")],1):t._e(),n("div",{class:t.b("columns"),style:t.columnsStyle,on:{touchmove:function(t){t.preventDefault()}}},[t._l(t.simple?[t.columns]:t.columns,function(e,i){return n("picker-column",{key:i,attrs:{"value-key":t.valueKey,"initial-options":t.simple?e:e.values,"class-name":e.className,"default-index":e.defaultIndex,"item-height":t.itemHeight,"visible-item-count":t.visibleItemCount},on:{change:function(e){t.onChange(i)}}})}),n("div",{staticClass:"van-hairline--top-bottom",class:t.b("frame"),style:t.frameStyle})],2)])},name:"picker",components:{PickerColumn:$({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:[t.b(),t.className],style:t.columnStyle,on:{touchstart:t.onTouchStart,touchmove:function(e){return e.preventDefault(),t.onTouchMove(e)},touchend:t.onTouchEnd,touchcancel:t.onTouchEnd}},[n("ul",{style:t.wrapperStyle},t._l(t.options,function(e,i){return n("li",{staticClass:"van-ellipsis",class:t.b("item",{disabled:t.isDisabled(e),selected:i===t.currentIndex}),style:t.optionStyle,domProps:{innerHTML:t._s(t.getOptionText(e))},on:{click:function(e){t.setIndex(i,!0)}}})}))])},name:"picker-column",props:{valueKey:String,className:String,itemHeight:Number,visibleItemCount:Number,initialOptions:{type:Array,default:function(){return[]}},defaultIndex:{type:Number,default:0}},data:function(){return{startY:0,offset:0,duration:0,startOffset:0,options:et(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},baseOffset:function(){return this.itemHeight*(this.visibleItemCount-1)/2},columnStyle:function(){return{height:this.itemHeight*this.visibleItemCount+"px"}},wrapperStyle:function(){return{transition:this.duration+"ms",transform:"translate3d(0, "+(this.offset+this.baseOffset)+"px, 0)",lineHeight:this.itemHeight+"px"}},optionStyle:function(){return{height:this.itemHeight+"px"}}},methods:{onTouchStart:function(t){this.startY=t.touches[0].clientY,this.startOffset=this.offset,this.duration=0},onTouchMove:function(t){var e=t.touches[0].clientY-this.startY;this.offset=Object(a.g)(this.startOffset+e,-this.count*this.itemHeight,this.itemHeight)},onTouchEnd:function(){if(this.offset!==this.startOffset){this.duration=200;var t=Object(a.g)(Math.round(-this.offset/this.itemHeight),0,this.count-1);this.setIndex(t,!0)}},adjustIndex:function(t){for(var e=t=Object(a.g)(t,0,this.count);e<this.count;e++)if(!this.isDisabled(this.options[e]))return e;for(var n=t-1;n>=0;n--)if(!this.isDisabled(this.options[n]))return n},isDisabled:function(t){return Object(a.e)(t)&&t.disabled},getOptionText:function(t){return Object(a.e)(t)&&this.valueKey in t?t[this.valueKey]:t},setIndex:function(t,e){t=this.adjustIndex(t)||0,this.offset=-t*this.itemHeight,t!==this.currentIndex&&(this.currentIndex=t,e&&this.$emit("change",t))},setValue:function(t){for(var e=this.options,n=0;n<e.length;n++)if(this.getOptionText(e[n])===t)return this.setIndex(n)},getValue:function(){return this.options[this.currentIndex]}}})},props:{title:String,loading:Boolean,showToolbar:Boolean,confirmButtonText:String,cancelButtonText:String,visibleItemCount:{type:Number,default:5},valueKey:{type:String,default:"text"},itemHeight:{type:Number,default:44},columns:{type:Array,default:function(){return[]}}},data:function(){return{children:[]}},computed:{frameStyle:function(){return{height:this.itemHeight+"px"}},columnsStyle:function(){return{height:this.itemHeight*this.visibleItemCount+"px"}},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,n){t.setColumnValues(n,et(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 n=this.getColumn(t);n&&n.setValue(e)},getColumnIndex:function(t){return(this.getColumn(t)||{}).currentIndex},setColumnIndex:function(t,e){var n=this.getColumn(t);n&&n.setIndex(e)},getColumnValues:function(t){return(this.children[t]||{}).options},setColumnValues:function(t,e){var n=this.children[t];n&&JSON.stringify(n.options)!==JSON.stringify(e)&&(n.options=e,n.setIndex(0))},getValues:function(){return this.children.map(function(t){return t.getValue()})},setValues:function(t){var e=this;t.forEach(function(t,n){e.setColumnValue(n,t)})},getIndexes:function(){return this.children.map(function(t){return t.currentIndex})},setIndexes:function(t){var e=this;t.forEach(function(t,n){e.setColumnIndex(n,t)})}}}),it=$({render:function(){var t=this,e=t.$createElement;return(t._self._c||e)("picker",{ref:"picker",class:t.b(),attrs:{"show-toolbar":"","value-key":"name",title:t.title,loading:t.loading,columns:t.displayColumns,"item-height":t.itemHeight,"visible-item-count":t.visibleItemCount},on:{change:t.onChange,confirm:function(e){t.$emit("confirm",e)},cancel:function(e){t.$emit("cancel",e)}}})},name:"area",components:{Picker:nt},props:{value:String,title:String,loading:Boolean,itemHeight:Number,visibleItemCount:Number,areaList:{type:Object,default:function(){return{}}},columnsNum:{type:[String,Number],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()}}},mounted:function(){this.setValues()},methods:{getList:function(t,e){var n=[];if("province"!==t&&!e)return n;var i=this[t];return n=Object.keys(i).map(function(t){return{code:t,name:i[t]}}),e&&(n=n.filter(function(t){return 0===t.code.indexOf(e)})),n},getIndex:function(t,e){var n="province"===t?2:"city"===t?4:6,i=this.getList(t,e.slice(0,n-2));e=e.slice(0,n);for(var s=0;s<i.length;s++)if(i[s].code.slice(0,n)===e)return s;return 0},onChange:function(t,e,n){this.code=e[n].code,this.setValues(),this.$emit("change",t,e,n)},setValues:function(){var t=this.code||Object.keys(this.county)[0]||"",e=this.$refs.picker,n=this.getList("province"),i=this.getList("city",t.slice(0,2));e&&(e.setColumnValues(0,n),e.setColumnValues(1,i),i.length&&"00"===t.slice(2,4)&&(t=i[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.